diff --git a/lightrag/api/webui/assets/index-BMB0OroL.js b/lightrag/api/webui/assets/index-BMB0OroL.js new file mode 100644 index 00000000..75b01c44 --- /dev/null +++ b/lightrag/api/webui/assets/index-BMB0OroL.js @@ -0,0 +1,1065 @@ +var gD=Object.defineProperty;var vD=(e,t,n)=>t in e?gD(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Xr=(e,t,n)=>vD(e,typeof t!="symbol"?t+"":t,n);function yD(e,t){for(var n=0;na[o]})}}}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 o of document.querySelectorAll('link[rel="modulepreload"]'))a(o);new MutationObserver(o=>{for(const s of o)if(s.type==="childList")for(const c of s.addedNodes)c.tagName==="LINK"&&c.rel==="modulepreload"&&a(c)}).observe(document,{childList:!0,subtree:!0});function n(o){const s={};return o.integrity&&(s.integrity=o.integrity),o.referrerPolicy&&(s.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?s.credentials="include":o.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function a(o){if(o.ep)return;o.ep=!0;const s=n(o);fetch(o.href,s)}})();function dn(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function bD(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var n=function a(){return this instanceof a?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(a){var o=Object.getOwnPropertyDescriptor(e,a);Object.defineProperty(n,a,o.get?o:{enumerable:!0,get:function(){return e[a]}})}),n}var Mh={exports:{}},qs={};/** + * @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 Vx;function xD(){if(Vx)return qs;Vx=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(a,o,s){var c=null;if(s!==void 0&&(c=""+s),o.key!==void 0&&(c=""+o.key),"key"in o){s={};for(var u in o)u!=="key"&&(s[u]=o[u])}else s=o;return o=s.ref,{$$typeof:e,type:a,key:c,ref:o!==void 0?o:null,props:s}}return qs.Fragment=t,qs.jsx=n,qs.jsxs=n,qs}var qx;function wD(){return qx||(qx=1,Mh.exports=xD()),Mh.exports}var x=wD(),Ph={exports:{}},Ke={};/** + * @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 Yx;function ED(){if(Yx)return Ke;Yx=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),s=Symbol.for("react.consumer"),c=Symbol.for("react.context"),u=Symbol.for("react.forward_ref"),f=Symbol.for("react.suspense"),h=Symbol.for("react.memo"),m=Symbol.for("react.lazy"),g=Symbol.iterator;function y(G){return G===null||typeof G!="object"?null:(G=g&&G[g]||G["@@iterator"],typeof G=="function"?G:null)}var b={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},S=Object.assign,E={};function _(G,H,O){this.props=G,this.context=H,this.refs=E,this.updater=O||b}_.prototype.isReactComponent={},_.prototype.setState=function(G,H){if(typeof G!="object"&&typeof G!="function"&&G!=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,G,H,"setState")},_.prototype.forceUpdate=function(G){this.updater.enqueueForceUpdate(this,G,"forceUpdate")};function N(){}N.prototype=_.prototype;function C(G,H,O){this.props=G,this.context=H,this.refs=E,this.updater=O||b}var A=C.prototype=new N;A.constructor=C,S(A,_.prototype),A.isPureReactComponent=!0;var k=Array.isArray,D={H:null,A:null,T:null,S:null},M=Object.prototype.hasOwnProperty;function R(G,H,O,$,W,re){return O=re.ref,{$$typeof:e,type:G,key:H,ref:O!==void 0?O:null,props:re}}function U(G,H){return R(G.type,H,void 0,void 0,void 0,G.props)}function L(G){return typeof G=="object"&&G!==null&&G.$$typeof===e}function I(G){var H={"=":"=0",":":"=2"};return"$"+G.replace(/[=:]/g,function(O){return H[O]})}var q=/\/+/g;function Y(G,H){return typeof G=="object"&&G!==null&&G.key!=null?I(""+G.key):H.toString(36)}function B(){}function X(G){switch(G.status){case"fulfilled":return G.value;case"rejected":throw G.reason;default:switch(typeof G.status=="string"?G.then(B,B):(G.status="pending",G.then(function(H){G.status==="pending"&&(G.status="fulfilled",G.value=H)},function(H){G.status==="pending"&&(G.status="rejected",G.reason=H)})),G.status){case"fulfilled":return G.value;case"rejected":throw G.reason}}throw G}function ne(G,H,O,$,W){var re=typeof G;(re==="undefined"||re==="boolean")&&(G=null);var de=!1;if(G===null)de=!0;else switch(re){case"bigint":case"string":case"number":de=!0;break;case"object":switch(G.$$typeof){case e:case t:de=!0;break;case m:return de=G._init,ne(de(G._payload),H,O,$,W)}}if(de)return W=W(G),de=$===""?"."+Y(G,0):$,k(W)?(O="",de!=null&&(O=de.replace(q,"$&/")+"/"),ne(W,H,O,"",function(Ce){return Ce})):W!=null&&(L(W)&&(W=U(W,O+(W.key==null||G&&G.key===W.key?"":(""+W.key).replace(q,"$&/")+"/")+de)),H.push(W)),1;de=0;var ie=$===""?".":$+":";if(k(G))for(var oe=0;oe>>1,G=F[K];if(0>>1;Ko($,j))Wo(re,$)?(F[K]=re,F[W]=j,K=W):(F[K]=$,F[O]=j,K=O);else if(Wo(re,j))F[K]=re,F[W]=j,K=W;else break e}}return z}function o(F,z){var j=F.sortIndex-z.sortIndex;return j!==0?j:F.id-z.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var s=performance;e.unstable_now=function(){return s.now()}}else{var c=Date,u=c.now();e.unstable_now=function(){return c.now()-u}}var f=[],h=[],m=1,g=null,y=3,b=!1,S=!1,E=!1,_=typeof setTimeout=="function"?setTimeout:null,N=typeof clearTimeout=="function"?clearTimeout:null,C=typeof setImmediate<"u"?setImmediate:null;function A(F){for(var z=n(h);z!==null;){if(z.callback===null)a(h);else if(z.startTime<=F)a(h),z.sortIndex=z.expirationTime,t(f,z);else break;z=n(h)}}function k(F){if(E=!1,A(F),!S)if(n(f)!==null)S=!0,X();else{var z=n(h);z!==null&&ne(k,z.startTime-F)}}var D=!1,M=-1,R=5,U=-1;function L(){return!(e.unstable_now()-UF&&L());){var K=g.callback;if(typeof K=="function"){g.callback=null,y=g.priorityLevel;var G=K(g.expirationTime<=F);if(F=e.unstable_now(),typeof G=="function"){g.callback=G,A(F),z=!0;break t}g===n(f)&&a(f),A(F)}else a(f);g=n(f)}if(g!==null)z=!0;else{var H=n(h);H!==null&&ne(k,H.startTime-F),z=!1}}break e}finally{g=null,y=j,b=!1}z=void 0}}finally{z?q():D=!1}}}var q;if(typeof C=="function")q=function(){C(I)};else if(typeof MessageChannel<"u"){var Y=new MessageChannel,B=Y.port2;Y.port1.onmessage=I,q=function(){B.postMessage(null)}}else q=function(){_(I,0)};function X(){D||(D=!0,q())}function ne(F,z){M=_(function(){F(e.unstable_now())},z)}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(F){F.callback=null},e.unstable_continueExecution=function(){S||b||(S=!0,X())},e.unstable_forceFrameRate=function(F){0>F||125K?(F.sortIndex=j,t(h,F),n(f)===null&&F===n(h)&&(E?(N(M),M=-1):E=!0,ne(k,j-K))):(F.sortIndex=G,t(f,F),S||b||(S=!0,X())),F},e.unstable_shouldYield=L,e.unstable_wrapCallback=function(F){var z=y;return function(){var j=y;y=z;try{return F.apply(this,arguments)}finally{y=j}}}}(Uh)),Uh}var Kx;function CD(){return Kx||(Kx=1,Fh.exports=_D()),Fh.exports}var Bh={exports:{}},nn={};/** + * @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 Zx;function TD(){if(Zx)return nn;Zx=1;var e=Yu();function t(f){var h="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(),Bh.exports=TD(),Bh.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 Jx;function RD(){if(Jx)return Ys;Jx=1;var e=CD(),t=Yu(),n=Y1();function a(r){var i="https://react.dev/errors/"+r;if(1)":-1p||V[d]!==Q[p]){var fe=` +`+V[d].replace(" at new "," at ");return r.displayName&&fe.includes("")&&(fe=fe.replace("",r.displayName)),fe}while(1<=d&&0<=p);break}}}finally{X=!1,Error.prepareStackTrace=l}return(l=r?r.displayName||r.name:"")?B(l):""}function F(r){switch(r.tag){case 26:case 27:case 5:return B(r.type);case 16:return B("Lazy");case 13:return B("Suspense");case 19:return B("SuspenseList");case 0:case 15:return r=ne(r.type,!1),r;case 11:return r=ne(r.type.render,!1),r;case 1:return r=ne(r.type,!0),r;default:return""}}function z(r){try{var i="";do i+=F(r),r=r.return;while(r);return i}catch(l){return` +Error generating stack: `+l.message+` +`+l.stack}}function j(r){var i=r,l=r;if(r.alternate)for(;i.return;)i=i.return;else{r=i;do i=r,i.flags&4098&&(l=i.return),r=i.return;while(r)}return i.tag===3?l:null}function K(r){if(r.tag===13){var i=r.memoizedState;if(i===null&&(r=r.alternate,r!==null&&(i=r.memoizedState)),i!==null)return i.dehydrated}return null}function G(r){if(j(r)!==r)throw Error(a(188))}function H(r){var i=r.alternate;if(!i){if(i=j(r),i===null)throw Error(a(188));return i!==r?null:r}for(var l=r,d=i;;){var p=l.return;if(p===null)break;var v=p.alternate;if(v===null){if(d=p.return,d!==null){l=d;continue}break}if(p.child===v.child){for(v=p.child;v;){if(v===l)return G(p),r;if(v===d)return G(p),i;v=v.sibling}throw Error(a(188))}if(l.return!==d.return)l=p,d=v;else{for(var T=!1,P=p.child;P;){if(P===l){T=!0,l=p,d=v;break}if(P===d){T=!0,d=p,l=v;break}P=P.sibling}if(!T){for(P=v.child;P;){if(P===l){T=!0,l=v,d=p;break}if(P===d){T=!0,d=v,l=p;break}P=P.sibling}if(!T)throw Error(a(189))}}if(l.alternate!==d)throw Error(a(190))}if(l.tag!==3)throw Error(a(188));return l.stateNode.current===l?r:i}function O(r){var i=r.tag;if(i===5||i===26||i===27||i===6)return r;for(r=r.child;r!==null;){if(i=O(r),i!==null)return i;r=r.sibling}return null}var $=Array.isArray,W=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,re={pending:!1,data:null,method:null,action:null},de=[],ie=-1;function oe(r){return{current:r}}function Ce(r){0>ie||(r.current=de[ie],de[ie]=null,ie--)}function he(r,i){ie++,de[ie]=r.current,r.current=i}var Se=oe(null),be=oe(null),Le=oe(null),Te=oe(null);function ye(r,i){switch(he(Le,i),he(be,r),he(Se,null),r=i.nodeType,r){case 9:case 11:i=(i=i.documentElement)&&(i=i.namespaceURI)?xx(i):0;break;default:if(r=r===8?i.parentNode:i,i=r.tagName,r=r.namespaceURI)r=xx(r),i=wx(r,i);else switch(i){case"svg":i=1;break;case"math":i=2;break;default:i=0}}Ce(Se),he(Se,i)}function J(){Ce(Se),Ce(be),Ce(Le)}function le(r){r.memoizedState!==null&&he(Te,r);var i=Se.current,l=wx(i,r.type);i!==l&&(he(be,r),he(Se,l))}function _e(r){be.current===r&&(Ce(Se),Ce(be)),Te.current===r&&(Ce(Te),Bs._currentValue=re)}var pe=Object.prototype.hasOwnProperty,Ee=e.unstable_scheduleCallback,te=e.unstable_cancelCallback,Fe=e.unstable_shouldYield,Pe=e.unstable_requestPaint,me=e.unstable_now,Ae=e.unstable_getCurrentPriorityLevel,je=e.unstable_ImmediatePriority,He=e.unstable_UserBlockingPriority,it=e.unstable_NormalPriority,Ct=e.unstable_LowPriority,bt=e.unstable_IdlePriority,qt=e.log,fn=e.unstable_setDisableYieldValue,Gt=null,at=null;function Tn(r){if(at&&typeof at.onCommitFiberRoot=="function")try{at.onCommitFiberRoot(Gt,r,void 0,(r.current.flags&128)===128)}catch{}}function xt(r){if(typeof qt=="function"&&fn(r),at&&typeof at.setStrictMode=="function")try{at.setStrictMode(Gt,r)}catch{}}var Lt=Math.clz32?Math.clz32:Ol,Wa=Math.log,ji=Math.LN2;function Ol(r){return r>>>=0,r===0?32:31-(Wa(r)/ji|0)|0}var Li=128,ca=4194304;function Jt(r){var i=r&42;if(i!==0)return i;switch(r&-r){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128: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 r&4194176;case 4194304:case 8388608:case 16777216:case 33554432:return r&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return r}}function zi(r,i){var l=r.pendingLanes;if(l===0)return 0;var d=0,p=r.suspendedLanes,v=r.pingedLanes,T=r.warmLanes;r=r.finishedLanes!==0;var P=l&134217727;return P!==0?(l=P&~p,l!==0?d=Jt(l):(v&=P,v!==0?d=Jt(v):r||(T=P&~T,T!==0&&(d=Jt(T))))):(P=l&~p,P!==0?d=Jt(P):v!==0?d=Jt(v):r||(T=l&~T,T!==0&&(d=Jt(T)))),d===0?0:i!==0&&i!==d&&!(i&p)&&(p=d&-d,T=i&-i,p>=T||p===32&&(T&4194176)!==0)?i:d}function qe(r,i){return(r.pendingLanes&~(r.suspendedLanes&~r.pingedLanes)&i)===0}function lt(r,i){switch(r){case 1:case 2:case 4:case 8:return i+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 i+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function pt(){var r=Li;return Li<<=1,!(Li&4194176)&&(Li=128),r}function hn(){var r=ca;return ca<<=1,!(ca&62914560)&&(ca=4194304),r}function ln(r){for(var i=[],l=0;31>l;l++)i.push(r);return i}function pn(r,i){r.pendingLanes|=i,i!==268435456&&(r.suspendedLanes=0,r.pingedLanes=0,r.warmLanes=0)}function Nr(r,i,l,d,p,v){var T=r.pendingLanes;r.pendingLanes=l,r.suspendedLanes=0,r.pingedLanes=0,r.warmLanes=0,r.expiredLanes&=l,r.entangledLanes&=l,r.errorRecoveryDisabledLanes&=l,r.shellSuspendCounter=0;var P=r.entanglements,V=r.expirationTimes,Q=r.hiddenUpdates;for(l=T&~l;0"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),cA=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]*$"),wv={},Ev={};function uA(r){return pe.call(Ev,r)?!0:pe.call(wv,r)?!1:cA.test(r)?Ev[r]=!0:(wv[r]=!0,!1)}function jl(r,i,l){if(uA(i))if(l===null)r.removeAttribute(i);else{switch(typeof l){case"undefined":case"function":case"symbol":r.removeAttribute(i);return;case"boolean":var d=i.toLowerCase().slice(0,5);if(d!=="data-"&&d!=="aria-"){r.removeAttribute(i);return}}r.setAttribute(i,""+l)}}function Ll(r,i,l){if(l===null)r.removeAttribute(i);else{switch(typeof l){case"undefined":case"function":case"symbol":case"boolean":r.removeAttribute(i);return}r.setAttribute(i,""+l)}}function jr(r,i,l,d){if(d===null)r.removeAttribute(l);else{switch(typeof d){case"undefined":case"function":case"symbol":case"boolean":r.removeAttribute(l);return}r.setAttributeNS(i,l,""+d)}}function Mn(r){switch(typeof r){case"bigint":case"boolean":case"number":case"string":case"undefined":return r;case"object":return r;default:return""}}function Sv(r){var i=r.type;return(r=r.nodeName)&&r.toLowerCase()==="input"&&(i==="checkbox"||i==="radio")}function dA(r){var i=Sv(r)?"checked":"value",l=Object.getOwnPropertyDescriptor(r.constructor.prototype,i),d=""+r[i];if(!r.hasOwnProperty(i)&&typeof l<"u"&&typeof l.get=="function"&&typeof l.set=="function"){var p=l.get,v=l.set;return Object.defineProperty(r,i,{configurable:!0,get:function(){return p.call(this)},set:function(T){d=""+T,v.call(this,T)}}),Object.defineProperty(r,i,{enumerable:l.enumerable}),{getValue:function(){return d},setValue:function(T){d=""+T},stopTracking:function(){r._valueTracker=null,delete r[i]}}}}function zl(r){r._valueTracker||(r._valueTracker=dA(r))}function _v(r){if(!r)return!1;var i=r._valueTracker;if(!i)return!0;var l=i.getValue(),d="";return r&&(d=Sv(r)?r.checked?"true":"false":r.value),r=d,r!==l?(i.setValue(r),!0):!1}function Ml(r){if(r=r||(typeof document<"u"?document:void 0),typeof r>"u")return null;try{return r.activeElement||r.body}catch{return r.body}}var fA=/[\n"\\]/g;function Pn(r){return r.replace(fA,function(i){return"\\"+i.charCodeAt(0).toString(16)+" "})}function jd(r,i,l,d,p,v,T,P){r.name="",T!=null&&typeof T!="function"&&typeof T!="symbol"&&typeof T!="boolean"?r.type=T:r.removeAttribute("type"),i!=null?T==="number"?(i===0&&r.value===""||r.value!=i)&&(r.value=""+Mn(i)):r.value!==""+Mn(i)&&(r.value=""+Mn(i)):T!=="submit"&&T!=="reset"||r.removeAttribute("value"),i!=null?Ld(r,T,Mn(i)):l!=null?Ld(r,T,Mn(l)):d!=null&&r.removeAttribute("value"),p==null&&v!=null&&(r.defaultChecked=!!v),p!=null&&(r.checked=p&&typeof p!="function"&&typeof p!="symbol"),P!=null&&typeof P!="function"&&typeof P!="symbol"&&typeof P!="boolean"?r.name=""+Mn(P):r.removeAttribute("name")}function Cv(r,i,l,d,p,v,T,P){if(v!=null&&typeof v!="function"&&typeof v!="symbol"&&typeof v!="boolean"&&(r.type=v),i!=null||l!=null){if(!(v!=="submit"&&v!=="reset"||i!=null))return;l=l!=null?""+Mn(l):"",i=i!=null?""+Mn(i):l,P||i===r.value||(r.value=i),r.defaultValue=i}d=d??p,d=typeof d!="function"&&typeof d!="symbol"&&!!d,r.checked=P?r.checked:!!d,r.defaultChecked=!!d,T!=null&&typeof T!="function"&&typeof T!="symbol"&&typeof T!="boolean"&&(r.name=T)}function Ld(r,i,l){i==="number"&&Ml(r.ownerDocument)===r||r.defaultValue===""+l||(r.defaultValue=""+l)}function Ui(r,i,l,d){if(r=r.options,i){i={};for(var p=0;p=is),Gv=" ",Fv=!1;function Uv(r,i){switch(r){case"keyup":return UA.indexOf(i.keyCode)!==-1;case"keydown":return i.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Bv(r){return r=r.detail,typeof r=="object"&&"data"in r?r.data:null}var $i=!1;function IA(r,i){switch(r){case"compositionend":return Bv(i);case"keypress":return i.which!==32?null:(Fv=!0,Gv);case"textInput":return r=i.data,r===Gv&&Fv?null:r;default:return null}}function HA(r,i){if($i)return r==="compositionend"||!Vd&&Uv(r,i)?(r=Ov(),Gl=Ud=da=null,$i=!1,r):null;switch(r){case"paste":return null;case"keypress":if(!(i.ctrlKey||i.altKey||i.metaKey)||i.ctrlKey&&i.altKey){if(i.char&&1=i)return{node:l,offset:i-r};r=d}e:{for(;l;){if(l.nextSibling){l=l.nextSibling;break e}l=l.parentNode}l=void 0}l=Xv(l)}}function Zv(r,i){return r&&i?r===i?!0:r&&r.nodeType===3?!1:i&&i.nodeType===3?Zv(r,i.parentNode):"contains"in r?r.contains(i):r.compareDocumentPosition?!!(r.compareDocumentPosition(i)&16):!1:!1}function Qv(r){r=r!=null&&r.ownerDocument!=null&&r.ownerDocument.defaultView!=null?r.ownerDocument.defaultView:window;for(var i=Ml(r.document);i instanceof r.HTMLIFrameElement;){try{var l=typeof i.contentWindow.location.href=="string"}catch{l=!1}if(l)r=i.contentWindow;else break;i=Ml(r.document)}return i}function Wd(r){var i=r&&r.nodeName&&r.nodeName.toLowerCase();return i&&(i==="input"&&(r.type==="text"||r.type==="search"||r.type==="tel"||r.type==="url"||r.type==="password")||i==="textarea"||r.contentEditable==="true")}function ZA(r,i){var l=Qv(i);i=r.focusedElem;var d=r.selectionRange;if(l!==i&&i&&i.ownerDocument&&Zv(i.ownerDocument.documentElement,i)){if(d!==null&&Wd(i)){if(r=d.start,l=d.end,l===void 0&&(l=r),"selectionStart"in i)i.selectionStart=r,i.selectionEnd=Math.min(l,i.value.length);else if(l=(r=i.ownerDocument||document)&&r.defaultView||window,l.getSelection){l=l.getSelection();var p=i.textContent.length,v=Math.min(d.start,p);d=d.end===void 0?v:Math.min(d.end,p),!l.extend&&v>d&&(p=d,d=v,v=p),p=Kv(i,v);var T=Kv(i,d);p&&T&&(l.rangeCount!==1||l.anchorNode!==p.node||l.anchorOffset!==p.offset||l.focusNode!==T.node||l.focusOffset!==T.offset)&&(r=r.createRange(),r.setStart(p.node,p.offset),l.removeAllRanges(),v>d?(l.addRange(r),l.extend(T.node,T.offset)):(r.setEnd(T.node,T.offset),l.addRange(r)))}}for(r=[],l=i;l=l.parentNode;)l.nodeType===1&&r.push({element:l,left:l.scrollLeft,top:l.scrollTop});for(typeof i.focus=="function"&&i.focus(),i=0;i=document.documentMode,Vi=null,Xd=null,cs=null,Kd=!1;function Jv(r,i,l){var d=l.window===l?l.document:l.nodeType===9?l:l.ownerDocument;Kd||Vi==null||Vi!==Ml(d)||(d=Vi,"selectionStart"in d&&Wd(d)?d={start:d.selectionStart,end:d.selectionEnd}:(d=(d.ownerDocument&&d.ownerDocument.defaultView||window).getSelection(),d={anchorNode:d.anchorNode,anchorOffset:d.anchorOffset,focusNode:d.focusNode,focusOffset:d.focusOffset}),cs&&ls(cs,d)||(cs=d,d=Cc(Xd,"onSelect"),0>=T,p-=T,Lr=1<<32-Lt(i)+p|l<Ve?(It=Ue,Ue=null):It=Ue.sibling;var st=se(ee,Ue,ae[Ve],ge);if(st===null){Ue===null&&(Ue=It);break}r&&Ue&&st.alternate===null&&i(ee,Ue),Z=v(st,Z,Ve),Qe===null?Me=st:Qe.sibling=st,Qe=st,Ue=It}if(Ve===ae.length)return l(ee,Ue),ot&&ti(ee,Ve),Me;if(Ue===null){for(;VeVe?(It=Ue,Ue=null):It=Ue.sibling;var Na=se(ee,Ue,st.value,ge);if(Na===null){Ue===null&&(Ue=It);break}r&&Ue&&Na.alternate===null&&i(ee,Ue),Z=v(Na,Z,Ve),Qe===null?Me=Na:Qe.sibling=Na,Qe=Na,Ue=It}if(st.done)return l(ee,Ue),ot&&ti(ee,Ve),Me;if(Ue===null){for(;!st.done;Ve++,st=ae.next())st=xe(ee,st.value,ge),st!==null&&(Z=v(st,Z,Ve),Qe===null?Me=st:Qe.sibling=st,Qe=st);return ot&&ti(ee,Ve),Me}for(Ue=d(Ue);!st.done;Ve++,st=ae.next())st=ue(Ue,ee,Ve,st.value,ge),st!==null&&(r&&st.alternate!==null&&Ue.delete(st.key===null?Ve:st.key),Z=v(st,Z,Ve),Qe===null?Me=st:Qe.sibling=st,Qe=st);return r&&Ue.forEach(function(mD){return i(ee,mD)}),ot&&ti(ee,Ve),Me}function At(ee,Z,ae,ge){if(typeof ae=="object"&&ae!==null&&ae.type===f&&ae.key===null&&(ae=ae.props.children),typeof ae=="object"&&ae!==null){switch(ae.$$typeof){case c:e:{for(var Me=ae.key;Z!==null;){if(Z.key===Me){if(Me=ae.type,Me===f){if(Z.tag===7){l(ee,Z.sibling),ge=p(Z,ae.props.children),ge.return=ee,ee=ge;break e}}else if(Z.elementType===Me||typeof Me=="object"&&Me!==null&&Me.$$typeof===C&&gy(Me)===Z.type){l(ee,Z.sibling),ge=p(Z,ae.props),gs(ge,ae),ge.return=ee,ee=ge;break e}l(ee,Z);break}else i(ee,Z);Z=Z.sibling}ae.type===f?(ge=fi(ae.props.children,ee.mode,ge,ae.key),ge.return=ee,ee=ge):(ge=mc(ae.type,ae.key,ae.props,null,ee.mode,ge),gs(ge,ae),ge.return=ee,ee=ge)}return T(ee);case u:e:{for(Me=ae.key;Z!==null;){if(Z.key===Me)if(Z.tag===4&&Z.stateNode.containerInfo===ae.containerInfo&&Z.stateNode.implementation===ae.implementation){l(ee,Z.sibling),ge=p(Z,ae.children||[]),ge.return=ee,ee=ge;break e}else{l(ee,Z);break}else i(ee,Z);Z=Z.sibling}ge=Jf(ae,ee.mode,ge),ge.return=ee,ee=ge}return T(ee);case C:return Me=ae._init,ae=Me(ae._payload),At(ee,Z,ae,ge)}if($(ae))return Ge(ee,Z,ae,ge);if(M(ae)){if(Me=M(ae),typeof Me!="function")throw Error(a(150));return ae=Me.call(ae),We(ee,Z,ae,ge)}if(typeof ae.then=="function")return At(ee,Z,Kl(ae),ge);if(ae.$$typeof===b)return At(ee,Z,fc(ee,ae),ge);Zl(ee,ae)}return typeof ae=="string"&&ae!==""||typeof ae=="number"||typeof ae=="bigint"?(ae=""+ae,Z!==null&&Z.tag===6?(l(ee,Z.sibling),ge=p(Z,ae),ge.return=ee,ee=ge):(l(ee,Z),ge=Qf(ae,ee.mode,ge),ge.return=ee,ee=ge),T(ee)):l(ee,Z)}return function(ee,Z,ae,ge){try{ms=0;var Me=At(ee,Z,ae,ge);return Zi=null,Me}catch(Ue){if(Ue===hs)throw Ue;var Qe=Vn(29,Ue,null,ee.mode);return Qe.lanes=ge,Qe.return=ee,Qe}finally{}}}var ri=vy(!0),yy=vy(!1),Qi=oe(null),Ql=oe(0);function by(r,i){r=qr,he(Ql,r),he(Qi,i),qr=r|i.baseLanes}function af(){he(Ql,qr),he(Qi,Qi.current)}function of(){qr=Ql.current,Ce(Qi),Ce(Ql)}var In=oe(null),mr=null;function ha(r){var i=r.alternate;he(zt,zt.current&1),he(In,r),mr===null&&(i===null||Qi.current!==null||i.memoizedState!==null)&&(mr=r)}function xy(r){if(r.tag===22){if(he(zt,zt.current),he(In,r),mr===null){var i=r.alternate;i!==null&&i.memoizedState!==null&&(mr=r)}}else pa()}function pa(){he(zt,zt.current),he(In,In.current)}function Mr(r){Ce(In),mr===r&&(mr=null),Ce(zt)}var zt=oe(0);function Jl(r){for(var i=r;i!==null;){if(i.tag===13){var l=i.memoizedState;if(l!==null&&(l=l.dehydrated,l===null||l.data==="$?"||l.data==="$!"))return i}else if(i.tag===19&&i.memoizedProps.revealOrder!==void 0){if(i.flags&128)return i}else if(i.child!==null){i.child.return=i,i=i.child;continue}if(i===r)break;for(;i.sibling===null;){if(i.return===null||i.return===r)return null;i=i.return}i.sibling.return=i.return,i=i.sibling}return null}var n2=typeof AbortController<"u"?AbortController:function(){var r=[],i=this.signal={aborted:!1,addEventListener:function(l,d){r.push(d)}};this.abort=function(){i.aborted=!0,r.forEach(function(l){return l()})}},r2=e.unstable_scheduleCallback,a2=e.unstable_NormalPriority,Mt={$$typeof:b,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function sf(){return{controller:new n2,data:new Map,refCount:0}}function vs(r){r.refCount--,r.refCount===0&&r2(a2,function(){r.controller.abort()})}var ys=null,lf=0,Ji=0,eo=null;function i2(r,i){if(ys===null){var l=ys=[];lf=0,Ji=ph(),eo={status:"pending",value:void 0,then:function(d){l.push(d)}}}return lf++,i.then(wy,wy),i}function wy(){if(--lf===0&&ys!==null){eo!==null&&(eo.status="fulfilled");var r=ys;ys=null,Ji=0,eo=null;for(var i=0;iv?v:8;var T=L.T,P={};L.T=P,Cf(r,!1,i,l);try{var V=p(),Q=L.S;if(Q!==null&&Q(P,V),V!==null&&typeof V=="object"&&typeof V.then=="function"){var fe=o2(V,d);ws(r,i,fe,Nn(r))}else ws(r,i,d,Nn(r))}catch(xe){ws(r,i,{then:function(){},status:"rejected",reason:xe},Nn())}finally{W.p=v,L.T=T}}function d2(){}function Sf(r,i,l,d){if(r.tag!==5)throw Error(a(476));var p=Qy(r).queue;Zy(r,p,i,re,l===null?d2:function(){return Jy(r),l(d)})}function Qy(r){var i=r.memoizedState;if(i!==null)return i;i={memoizedState:re,baseState:re,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Pr,lastRenderedState:re},next:null};var l={};return i.next={memoizedState:l,baseState:l,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Pr,lastRenderedState:l},next:null},r.memoizedState=i,r=r.alternate,r!==null&&(r.memoizedState=i),i}function Jy(r){var i=Qy(r).next.queue;ws(r,i,{},Nn())}function _f(){return tn(Bs)}function eb(){return Ot().memoizedState}function tb(){return Ot().memoizedState}function f2(r){for(var i=r.return;i!==null;){switch(i.tag){case 24:case 3:var l=Nn();r=ba(l);var d=xa(i,r,l);d!==null&&(un(d,i,l),_s(d,i,l)),i={cache:sf()},r.payload=i;return}i=i.return}}function h2(r,i,l){var d=Nn();l={lane:d,revertLane:0,action:l,hasEagerState:!1,eagerState:null,next:null},lc(r)?rb(i,l):(l=Jd(r,i,l,d),l!==null&&(un(l,r,d),ab(l,i,d)))}function nb(r,i,l){var d=Nn();ws(r,i,l,d)}function ws(r,i,l,d){var p={lane:d,revertLane:0,action:l,hasEagerState:!1,eagerState:null,next:null};if(lc(r))rb(i,p);else{var v=r.alternate;if(r.lanes===0&&(v===null||v.lanes===0)&&(v=i.lastRenderedReducer,v!==null))try{var T=i.lastRenderedState,P=v(T,l);if(p.hasEagerState=!0,p.eagerState=P,Rn(P,T))return Vl(r,i,p,0),vt===null&&$l(),!1}catch{}finally{}if(l=Jd(r,i,p,d),l!==null)return un(l,r,d),ab(l,i,d),!0}return!1}function Cf(r,i,l,d){if(d={lane:2,revertLane:ph(),action:d,hasEagerState:!1,eagerState:null,next:null},lc(r)){if(i)throw Error(a(479))}else i=Jd(r,l,d,2),i!==null&&un(i,r,2)}function lc(r){var i=r.alternate;return r===Ze||i!==null&&i===Ze}function rb(r,i){to=tc=!0;var l=r.pending;l===null?i.next=i:(i.next=l.next,l.next=i),r.pending=i}function ab(r,i,l){if(l&4194176){var d=i.lanes;d&=r.pendingLanes,l|=d,i.lanes=l,Jn(r,l)}}var gr={readContext:tn,use:ac,useCallback:Dt,useContext:Dt,useEffect:Dt,useImperativeHandle:Dt,useLayoutEffect:Dt,useInsertionEffect:Dt,useMemo:Dt,useReducer:Dt,useRef:Dt,useState:Dt,useDebugValue:Dt,useDeferredValue:Dt,useTransition:Dt,useSyncExternalStore:Dt,useId:Dt};gr.useCacheRefresh=Dt,gr.useMemoCache=Dt,gr.useHostTransitionStatus=Dt,gr.useFormState=Dt,gr.useActionState=Dt,gr.useOptimistic=Dt;var oi={readContext:tn,use:ac,useCallback:function(r,i){return yn().memoizedState=[r,i===void 0?null:i],r},useContext:tn,useEffect:Hy,useImperativeHandle:function(r,i,l){l=l!=null?l.concat([r]):null,oc(4194308,4,qy.bind(null,i,r),l)},useLayoutEffect:function(r,i){return oc(4194308,4,r,i)},useInsertionEffect:function(r,i){oc(4,2,r,i)},useMemo:function(r,i){var l=yn();i=i===void 0?null:i;var d=r();if(ii){xt(!0);try{r()}finally{xt(!1)}}return l.memoizedState=[d,i],d},useReducer:function(r,i,l){var d=yn();if(l!==void 0){var p=l(i);if(ii){xt(!0);try{l(i)}finally{xt(!1)}}}else p=i;return d.memoizedState=d.baseState=p,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:r,lastRenderedState:p},d.queue=r,r=r.dispatch=h2.bind(null,Ze,r),[d.memoizedState,r]},useRef:function(r){var i=yn();return r={current:r},i.memoizedState=r},useState:function(r){r=yf(r);var i=r.queue,l=nb.bind(null,Ze,i);return i.dispatch=l,[r.memoizedState,l]},useDebugValue:wf,useDeferredValue:function(r,i){var l=yn();return Ef(l,r,i)},useTransition:function(){var r=yf(!1);return r=Zy.bind(null,Ze,r.queue,!0,!1),yn().memoizedState=r,[!1,r]},useSyncExternalStore:function(r,i,l){var d=Ze,p=yn();if(ot){if(l===void 0)throw Error(a(407));l=l()}else{if(l=i(),vt===null)throw Error(a(349));rt&60||Ry(d,i,l)}p.memoizedState=l;var v={value:l,getSnapshot:i};return p.queue=v,Hy(Dy.bind(null,d,v,r),[r]),d.flags|=2048,ro(9,Ay.bind(null,d,v,l,i),{destroy:void 0},null),l},useId:function(){var r=yn(),i=vt.identifierPrefix;if(ot){var l=zr,d=Lr;l=(d&~(1<<32-Lt(d)-1)).toString(32)+l,i=":"+i+"R"+l,l=nc++,0 title"))),Xt(v,d,l),v[en]=r,Ft(v),d=v;break e;case"link":var T=Nx("link","href",p).get(d+(l.href||""));if(T){for(var P=0;P<\/script>",r=r.removeChild(r.firstChild);break;case"select":r=typeof d.is=="string"?p.createElement("select",{is:d.is}):p.createElement("select"),d.multiple?r.multiple=!0:d.size&&(r.size=d.size);break;default:r=typeof d.is=="string"?p.createElement(l,{is:d.is}):p.createElement(l)}}r[en]=i,r[gn]=d;e:for(p=i.child;p!==null;){if(p.tag===5||p.tag===6)r.appendChild(p.stateNode);else if(p.tag!==4&&p.tag!==27&&p.child!==null){p.child.return=p,p=p.child;continue}if(p===i)break e;for(;p.sibling===null;){if(p.return===null||p.return===i)break e;p=p.return}p.sibling.return=p.return,p=p.sibling}i.stateNode=r;e:switch(Xt(r,l,d),l){case"button":case"input":case"select":case"textarea":r=!!d.autoFocus;break e;case"img":r=!0;break e;default:r=!1}r&&$r(i)}}return Et(i),i.flags&=-16777217,null;case 6:if(r&&i.stateNode!=null)r.memoizedProps!==d&&$r(i);else{if(typeof d!="string"&&i.stateNode===null)throw Error(a(166));if(r=Le.current,us(i)){if(r=i.stateNode,l=i.memoizedProps,d=null,p=cn,p!==null)switch(p.tag){case 27:case 5:d=p.memoizedProps}r[en]=i,r=!!(r.nodeValue===l||d!==null&&d.suppressHydrationWarning===!0||bx(r.nodeValue,l)),r||ni(i)}else r=Rc(r).createTextNode(d),r[en]=i,i.stateNode=r}return Et(i),null;case 13:if(d=i.memoizedState,r===null||r.memoizedState!==null&&r.memoizedState.dehydrated!==null){if(p=us(i),d!==null&&d.dehydrated!==null){if(r===null){if(!p)throw Error(a(318));if(p=i.memoizedState,p=p!==null?p.dehydrated:null,!p)throw Error(a(317));p[en]=i}else ds(),!(i.flags&128)&&(i.memoizedState=null),i.flags|=4;Et(i),p=!1}else tr!==null&&(sh(tr),tr=null),p=!0;if(!p)return i.flags&256?(Mr(i),i):(Mr(i),null)}if(Mr(i),i.flags&128)return i.lanes=l,i;if(l=d!==null,r=r!==null&&r.memoizedState!==null,l){d=i.child,p=null,d.alternate!==null&&d.alternate.memoizedState!==null&&d.alternate.memoizedState.cachePool!==null&&(p=d.alternate.memoizedState.cachePool.pool);var v=null;d.memoizedState!==null&&d.memoizedState.cachePool!==null&&(v=d.memoizedState.cachePool.pool),v!==p&&(d.flags|=2048)}return l!==r&&l&&(i.child.flags|=8192),gc(i,i.updateQueue),Et(i),null;case 4:return J(),r===null&&yh(i.stateNode.containerInfo),Et(i),null;case 10:return Ur(i.type),Et(i),null;case 19:if(Ce(zt),p=i.memoizedState,p===null)return Et(i),null;if(d=(i.flags&128)!==0,v=p.rendering,v===null)if(d)Ns(p,!1);else{if(Rt!==0||r!==null&&r.flags&128)for(r=i.child;r!==null;){if(v=Jl(r),v!==null){for(i.flags|=128,Ns(p,!1),r=v.updateQueue,i.updateQueue=r,gc(i,r),i.subtreeFlags=0,r=l,l=i.child;l!==null;)Yb(l,r),l=l.sibling;return he(zt,zt.current&1|2),i.child}r=r.sibling}p.tail!==null&&me()>vc&&(i.flags|=128,d=!0,Ns(p,!1),i.lanes=4194304)}else{if(!d)if(r=Jl(v),r!==null){if(i.flags|=128,d=!0,r=r.updateQueue,i.updateQueue=r,gc(i,r),Ns(p,!0),p.tail===null&&p.tailMode==="hidden"&&!v.alternate&&!ot)return Et(i),null}else 2*me()-p.renderingStartTime>vc&&l!==536870912&&(i.flags|=128,d=!0,Ns(p,!1),i.lanes=4194304);p.isBackwards?(v.sibling=i.child,i.child=v):(r=p.last,r!==null?r.sibling=v:i.child=v,p.last=v)}return p.tail!==null?(i=p.tail,p.rendering=i,p.tail=i.sibling,p.renderingStartTime=me(),i.sibling=null,r=zt.current,he(zt,d?r&1|2:r&1),i):(Et(i),null);case 22:case 23:return Mr(i),of(),d=i.memoizedState!==null,r!==null?r.memoizedState!==null!==d&&(i.flags|=8192):d&&(i.flags|=8192),d?l&536870912&&!(i.flags&128)&&(Et(i),i.subtreeFlags&6&&(i.flags|=8192)):Et(i),l=i.updateQueue,l!==null&&gc(i,l.retryQueue),l=null,r!==null&&r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(l=r.memoizedState.cachePool.pool),d=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(d=i.memoizedState.cachePool.pool),d!==l&&(i.flags|=2048),r!==null&&Ce(ai),null;case 24:return l=null,r!==null&&(l=r.memoizedState.cache),i.memoizedState.cache!==l&&(i.flags|=2048),Ur(Mt),Et(i),null;case 25:return null}throw Error(a(156,i.tag))}function x2(r,i){switch(tf(i),i.tag){case 1:return r=i.flags,r&65536?(i.flags=r&-65537|128,i):null;case 3:return Ur(Mt),J(),r=i.flags,r&65536&&!(r&128)?(i.flags=r&-65537|128,i):null;case 26:case 27:case 5:return _e(i),null;case 13:if(Mr(i),r=i.memoizedState,r!==null&&r.dehydrated!==null){if(i.alternate===null)throw Error(a(340));ds()}return r=i.flags,r&65536?(i.flags=r&-65537|128,i):null;case 19:return Ce(zt),null;case 4:return J(),null;case 10:return Ur(i.type),null;case 22:case 23:return Mr(i),of(),r!==null&&Ce(ai),r=i.flags,r&65536?(i.flags=r&-65537|128,i):null;case 24:return Ur(Mt),null;case 25:return null;default:return null}}function Kb(r,i){switch(tf(i),i.tag){case 3:Ur(Mt),J();break;case 26:case 27:case 5:_e(i);break;case 4:J();break;case 13:Mr(i);break;case 19:Ce(zt);break;case 10:Ur(i.type);break;case 22:case 23:Mr(i),of(),r!==null&&Ce(ai);break;case 24:Ur(Mt)}}var w2={getCacheForType:function(r){var i=tn(Mt),l=i.data.get(r);return l===void 0&&(l=r(),i.data.set(r,l)),l}},E2=typeof WeakMap=="function"?WeakMap:Map,St=0,vt=null,Je=null,rt=0,yt=0,kn=null,Vr=!1,so=!1,eh=!1,qr=0,Rt=0,Ca=0,hi=0,th=0,qn=0,lo=0,Os=null,vr=null,nh=!1,rh=0,vc=1/0,yc=null,Ta=null,bc=!1,pi=null,js=0,ah=0,ih=null,Ls=0,oh=null;function Nn(){if(St&2&&rt!==0)return rt&-rt;if(L.T!==null){var r=Ji;return r!==0?r:ph()}return vv()}function Zb(){qn===0&&(qn=!(rt&536870912)||ot?pt():536870912);var r=In.current;return r!==null&&(r.flags|=32),qn}function un(r,i,l){(r===vt&&yt===2||r.cancelPendingCommit!==null)&&(co(r,0),Yr(r,rt,qn,!1)),pn(r,l),(!(St&2)||r!==vt)&&(r===vt&&(!(St&2)&&(hi|=l),Rt===4&&Yr(r,rt,qn,!1)),yr(r))}function Qb(r,i,l){if(St&6)throw Error(a(327));var d=!l&&(i&60)===0&&(i&r.expiredLanes)===0||qe(r,i),p=d?C2(r,i):uh(r,i,!0),v=d;do{if(p===0){so&&!d&&Yr(r,i,0,!1);break}else if(p===6)Yr(r,i,0,!Vr);else{if(l=r.current.alternate,v&&!S2(l)){p=uh(r,i,!1),v=!1;continue}if(p===2){if(v=i,r.errorRecoveryDisabledLanes&v)var T=0;else T=r.pendingLanes&-536870913,T=T!==0?T:T&536870912?536870912:0;if(T!==0){i=T;e:{var P=r;p=Os;var V=P.current.memoizedState.isDehydrated;if(V&&(co(P,T).flags|=256),T=uh(P,T,!1),T!==2){if(eh&&!V){P.errorRecoveryDisabledLanes|=v,hi|=v,p=4;break e}v=vr,vr=p,v!==null&&sh(v)}p=T}if(v=!1,p!==2)continue}}if(p===1){co(r,0),Yr(r,i,0,!0);break}e:{switch(d=r,p){case 0:case 1:throw Error(a(345));case 4:if((i&4194176)===i){Yr(d,i,qn,!Vr);break e}break;case 2:vr=null;break;case 3:case 5:break;default:throw Error(a(329))}if(d.finishedWork=l,d.finishedLanes=i,(i&62914560)===i&&(v=rh+300-me(),10l?32:l,L.T=null,pi===null)var v=!1;else{l=ih,ih=null;var T=pi,P=js;if(pi=null,js=0,St&6)throw Error(a(331));var V=St;if(St|=4,Vb(T.current),Ib(T,T.current,P,l),St=V,zs(0,!1),at&&typeof at.onPostCommitFiberRoot=="function")try{at.onPostCommitFiberRoot(Gt,T)}catch{}v=!0}return v}finally{W.p=p,L.T=d,sx(r,i)}}return!1}function lx(r,i,l){i=Fn(l,i),i=Af(r.stateNode,i,2),r=xa(r,i,2),r!==null&&(pn(r,2),yr(r))}function mt(r,i,l){if(r.tag===3)lx(r,r,l);else for(;i!==null;){if(i.tag===3){lx(i,r,l);break}else if(i.tag===1){var d=i.stateNode;if(typeof i.type.getDerivedStateFromError=="function"||typeof d.componentDidCatch=="function"&&(Ta===null||!Ta.has(d))){r=Fn(l,r),l=db(2),d=xa(i,l,2),d!==null&&(fb(l,d,i,r),pn(d,2),yr(d));break}}i=i.return}}function dh(r,i,l){var d=r.pingCache;if(d===null){d=r.pingCache=new E2;var p=new Set;d.set(i,p)}else p=d.get(i),p===void 0&&(p=new Set,d.set(i,p));p.has(l)||(eh=!0,p.add(l),r=A2.bind(null,r,i,l),i.then(r,r))}function A2(r,i,l){var d=r.pingCache;d!==null&&d.delete(i),r.pingedLanes|=r.suspendedLanes&l,r.warmLanes&=~l,vt===r&&(rt&l)===l&&(Rt===4||Rt===3&&(rt&62914560)===rt&&300>me()-rh?!(St&2)&&co(r,0):th|=l,lo===rt&&(lo=0)),yr(r)}function cx(r,i){i===0&&(i=hn()),r=fa(r,i),r!==null&&(pn(r,i),yr(r))}function D2(r){var i=r.memoizedState,l=0;i!==null&&(l=i.retryLane),cx(r,l)}function k2(r,i){var l=0;switch(r.tag){case 13:var d=r.stateNode,p=r.memoizedState;p!==null&&(l=p.retryLane);break;case 19:d=r.stateNode;break;case 22:d=r.stateNode._retryCache;break;default:throw Error(a(314))}d!==null&&d.delete(i),cx(r,l)}function N2(r,i){return Ee(r,i)}var Ec=null,ho=null,fh=!1,Sc=!1,hh=!1,mi=0;function yr(r){r!==ho&&r.next===null&&(ho===null?Ec=ho=r:ho=ho.next=r),Sc=!0,fh||(fh=!0,j2(O2))}function zs(r,i){if(!hh&&Sc){hh=!0;do for(var l=!1,d=Ec;d!==null;){if(r!==0){var p=d.pendingLanes;if(p===0)var v=0;else{var T=d.suspendedLanes,P=d.pingedLanes;v=(1<<31-Lt(42|r)+1)-1,v&=p&~(T&~P),v=v&201326677?v&201326677|1:v?v|2:0}v!==0&&(l=!0,fx(d,v))}else v=rt,v=zi(d,d===vt?v:0),!(v&3)||qe(d,v)||(l=!0,fx(d,v));d=d.next}while(l);hh=!1}}function O2(){Sc=fh=!1;var r=0;mi!==0&&(B2()&&(r=mi),mi=0);for(var i=me(),l=null,d=Ec;d!==null;){var p=d.next,v=ux(d,i);v===0?(d.next=null,l===null?Ec=p:l.next=p,p===null&&(ho=l)):(l=d,(r!==0||v&3)&&(Sc=!0)),d=p}zs(r)}function ux(r,i){for(var l=r.suspendedLanes,d=r.pingedLanes,p=r.expirationTimes,v=r.pendingLanes&-62914561;0"u"?null:document;function Rx(r,i,l){var d=mo;if(d&&typeof i=="string"&&i){var p=Pn(i);p='link[rel="'+r+'"][href="'+p+'"]',typeof l=="string"&&(p+='[crossorigin="'+l+'"]'),Tx.has(p)||(Tx.add(p),r={rel:r,crossOrigin:l,href:i},d.querySelector(p)===null&&(i=d.createElement("link"),Xt(i,"link",r),Ft(i),d.head.appendChild(i)))}}function X2(r){Wr.D(r),Rx("dns-prefetch",r,null)}function K2(r,i){Wr.C(r,i),Rx("preconnect",r,i)}function Z2(r,i,l){Wr.L(r,i,l);var d=mo;if(d&&r&&i){var p='link[rel="preload"][as="'+Pn(i)+'"]';i==="image"&&l&&l.imageSrcSet?(p+='[imagesrcset="'+Pn(l.imageSrcSet)+'"]',typeof l.imageSizes=="string"&&(p+='[imagesizes="'+Pn(l.imageSizes)+'"]')):p+='[href="'+Pn(r)+'"]';var v=p;switch(i){case"style":v=go(r);break;case"script":v=vo(r)}Yn.has(v)||(r=I({rel:"preload",href:i==="image"&&l&&l.imageSrcSet?void 0:r,as:i},l),Yn.set(v,r),d.querySelector(p)!==null||i==="style"&&d.querySelector(Gs(v))||i==="script"&&d.querySelector(Fs(v))||(i=d.createElement("link"),Xt(i,"link",r),Ft(i),d.head.appendChild(i)))}}function Q2(r,i){Wr.m(r,i);var l=mo;if(l&&r){var d=i&&typeof i.as=="string"?i.as:"script",p='link[rel="modulepreload"][as="'+Pn(d)+'"][href="'+Pn(r)+'"]',v=p;switch(d){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":v=vo(r)}if(!Yn.has(v)&&(r=I({rel:"modulepreload",href:r},i),Yn.set(v,r),l.querySelector(p)===null)){switch(d){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(l.querySelector(Fs(v)))return}d=l.createElement("link"),Xt(d,"link",r),Ft(d),l.head.appendChild(d)}}}function J2(r,i,l){Wr.S(r,i,l);var d=mo;if(d&&r){var p=Gi(d).hoistableStyles,v=go(r);i=i||"default";var T=p.get(v);if(!T){var P={loading:0,preload:null};if(T=d.querySelector(Gs(v)))P.loading=5;else{r=I({rel:"stylesheet",href:r,"data-precedence":i},l),(l=Yn.get(v))&&Rh(r,l);var V=T=d.createElement("link");Ft(V),Xt(V,"link",r),V._p=new Promise(function(Q,fe){V.onload=Q,V.onerror=fe}),V.addEventListener("load",function(){P.loading|=1}),V.addEventListener("error",function(){P.loading|=2}),P.loading|=4,Dc(T,i,d)}T={type:"stylesheet",instance:T,count:1,state:P},p.set(v,T)}}}function eD(r,i){Wr.X(r,i);var l=mo;if(l&&r){var d=Gi(l).hoistableScripts,p=vo(r),v=d.get(p);v||(v=l.querySelector(Fs(p)),v||(r=I({src:r,async:!0},i),(i=Yn.get(p))&&Ah(r,i),v=l.createElement("script"),Ft(v),Xt(v,"link",r),l.head.appendChild(v)),v={type:"script",instance:v,count:1,state:null},d.set(p,v))}}function tD(r,i){Wr.M(r,i);var l=mo;if(l&&r){var d=Gi(l).hoistableScripts,p=vo(r),v=d.get(p);v||(v=l.querySelector(Fs(p)),v||(r=I({src:r,async:!0,type:"module"},i),(i=Yn.get(p))&&Ah(r,i),v=l.createElement("script"),Ft(v),Xt(v,"link",r),l.head.appendChild(v)),v={type:"script",instance:v,count:1,state:null},d.set(p,v))}}function Ax(r,i,l,d){var p=(p=Le.current)?Ac(p):null;if(!p)throw Error(a(446));switch(r){case"meta":case"title":return null;case"style":return typeof l.precedence=="string"&&typeof l.href=="string"?(i=go(l.href),l=Gi(p).hoistableStyles,d=l.get(i),d||(d={type:"style",instance:null,count:0,state:null},l.set(i,d)),d):{type:"void",instance:null,count:0,state:null};case"link":if(l.rel==="stylesheet"&&typeof l.href=="string"&&typeof l.precedence=="string"){r=go(l.href);var v=Gi(p).hoistableStyles,T=v.get(r);if(T||(p=p.ownerDocument||p,T={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},v.set(r,T),(v=p.querySelector(Gs(r)))&&!v._p&&(T.instance=v,T.state.loading=5),Yn.has(r)||(l={rel:"preload",as:"style",href:l.href,crossOrigin:l.crossOrigin,integrity:l.integrity,media:l.media,hrefLang:l.hrefLang,referrerPolicy:l.referrerPolicy},Yn.set(r,l),v||nD(p,r,l,T.state))),i&&d===null)throw Error(a(528,""));return T}if(i&&d!==null)throw Error(a(529,""));return null;case"script":return i=l.async,l=l.src,typeof l=="string"&&i&&typeof i!="function"&&typeof i!="symbol"?(i=vo(l),l=Gi(p).hoistableScripts,d=l.get(i),d||(d={type:"script",instance:null,count:0,state:null},l.set(i,d)),d):{type:"void",instance:null,count:0,state:null};default:throw Error(a(444,r))}}function go(r){return'href="'+Pn(r)+'"'}function Gs(r){return'link[rel="stylesheet"]['+r+"]"}function Dx(r){return I({},r,{"data-precedence":r.precedence,precedence:null})}function nD(r,i,l,d){r.querySelector('link[rel="preload"][as="style"]['+i+"]")?d.loading=1:(i=r.createElement("link"),d.preload=i,i.addEventListener("load",function(){return d.loading|=1}),i.addEventListener("error",function(){return d.loading|=2}),Xt(i,"link",l),Ft(i),r.head.appendChild(i))}function vo(r){return'[src="'+Pn(r)+'"]'}function Fs(r){return"script[async]"+r}function kx(r,i,l){if(i.count++,i.instance===null)switch(i.type){case"style":var d=r.querySelector('style[data-href~="'+Pn(l.href)+'"]');if(d)return i.instance=d,Ft(d),d;var p=I({},l,{"data-href":l.href,"data-precedence":l.precedence,href:null,precedence:null});return d=(r.ownerDocument||r).createElement("style"),Ft(d),Xt(d,"style",p),Dc(d,l.precedence,r),i.instance=d;case"stylesheet":p=go(l.href);var v=r.querySelector(Gs(p));if(v)return i.state.loading|=4,i.instance=v,Ft(v),v;d=Dx(l),(p=Yn.get(p))&&Rh(d,p),v=(r.ownerDocument||r).createElement("link"),Ft(v);var T=v;return T._p=new Promise(function(P,V){T.onload=P,T.onerror=V}),Xt(v,"link",d),i.state.loading|=4,Dc(v,l.precedence,r),i.instance=v;case"script":return v=vo(l.src),(p=r.querySelector(Fs(v)))?(i.instance=p,Ft(p),p):(d=l,(p=Yn.get(v))&&(d=I({},l),Ah(d,p)),r=r.ownerDocument||r,p=r.createElement("script"),Ft(p),Xt(p,"link",d),r.head.appendChild(p),i.instance=p);case"void":return null;default:throw Error(a(443,i.type))}else i.type==="stylesheet"&&!(i.state.loading&4)&&(d=i.instance,i.state.loading|=4,Dc(d,l.precedence,r));return i.instance}function Dc(r,i,l){for(var d=l.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),p=d.length?d[d.length-1]:null,v=p,T=0;T title"):null)}function rD(r,i,l){if(l===1||i.itemProp!=null)return!1;switch(r){case"meta":case"title":return!0;case"style":if(typeof i.precedence!="string"||typeof i.href!="string"||i.href==="")break;return!0;case"link":if(typeof i.rel!="string"||typeof i.href!="string"||i.href===""||i.onLoad||i.onError)break;switch(i.rel){case"stylesheet":return r=i.disabled,typeof i.precedence=="string"&&r==null;default:return!0}case"script":if(i.async&&typeof i.async!="function"&&typeof i.async!="symbol"&&!i.onLoad&&!i.onError&&i.src&&typeof i.src=="string")return!0}return!1}function jx(r){return!(r.type==="stylesheet"&&!(r.state.loading&3))}var Us=null;function aD(){}function iD(r,i,l){if(Us===null)throw Error(a(475));var d=Us;if(i.type==="stylesheet"&&(typeof l.media!="string"||matchMedia(l.media).matches!==!1)&&!(i.state.loading&4)){if(i.instance===null){var p=go(l.href),v=r.querySelector(Gs(p));if(v){r=v._p,r!==null&&typeof r=="object"&&typeof r.then=="function"&&(d.count++,d=Nc.bind(d),r.then(d,d)),i.state.loading|=4,i.instance=v,Ft(v);return}v=r.ownerDocument||r,l=Dx(l),(p=Yn.get(p))&&Rh(l,p),v=v.createElement("link"),Ft(v);var T=v;T._p=new Promise(function(P,V){T.onload=P,T.onerror=V}),Xt(v,"link",l),i.instance=v}d.stylesheets===null&&(d.stylesheets=new Map),d.stylesheets.set(i,r),(r=i.state.preload)&&!(i.state.loading&3)&&(d.count++,i=Nc.bind(d),r.addEventListener("load",i),r.addEventListener("error",i))}}function oD(){if(Us===null)throw Error(a(475));var r=Us;return r.stylesheets&&r.count===0&&Dh(r,r.stylesheets),0"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),Gh.exports=RD(),Gh.exports}var DD=AD();const t0=e=>{let t;const n=new Set,a=(h,m)=>{const g=typeof h=="function"?h(t):h;if(!Object.is(g,t)){const y=t;t=m??(typeof g!="object"||g===null)?g:Object.assign({},t,g),n.forEach(b=>b(t,y))}},o=()=>t,u={setState:a,getState:o,getInitialState:()=>f,subscribe:h=>(n.add(h),()=>n.delete(h))},f=t=e(a,o,u);return u},kD=e=>e?t0(e):t0,ND=e=>e;function OD(e,t=ND){const n=ve.useSyncExternalStore(e.subscribe,()=>t(e.getState()),()=>t(e.getInitialState()));return ve.useDebugValue(n),n}const jD=e=>{const t=kD(e),n=a=>OD(t,a);return Object.assign(n,t),n},Qm=e=>jD;function W1(e,t){let n;try{n=e()}catch{return}return{getItem:o=>{var s;const c=f=>f===null?null:JSON.parse(f,void 0),u=(s=n.getItem(o))!=null?s:null;return u instanceof Promise?u.then(c):c(u)},setItem:(o,s)=>n.setItem(o,JSON.stringify(s,void 0)),removeItem:o=>n.removeItem(o)}}const em=e=>t=>{try{const n=e(t);return n instanceof Promise?n:{then(a){return em(a)(n)},catch(a){return this}}}catch(n){return{then(a){return this},catch(a){return em(a)(n)}}}},LD=(e,t)=>(n,a,o)=>{let s={storage:W1(()=>localStorage),partialize:E=>E,version:0,merge:(E,_)=>({..._,...E}),...t},c=!1;const u=new Set,f=new Set;let h=s.storage;if(!h)return e((...E)=>{console.warn(`[zustand persist middleware] Unable to update item '${s.name}', the given storage is currently unavailable.`),n(...E)},a,o);const m=()=>{const E=s.partialize({...a()});return h.setItem(s.name,{state:E,version:s.version})},g=o.setState;o.setState=(E,_)=>{g(E,_),m()};const y=e((...E)=>{n(...E),m()},a,o);o.getInitialState=()=>y;let b;const S=()=>{var E,_;if(!h)return;c=!1,u.forEach(C=>{var A;return C((A=a())!=null?A:y)});const N=((_=s.onRehydrateStorage)==null?void 0:_.call(s,(E=a())!=null?E:y))||void 0;return em(h.getItem.bind(h))(s.name).then(C=>{if(C)if(typeof C.version=="number"&&C.version!==s.version){if(s.migrate){const A=s.migrate(C.state,C.version);return A instanceof Promise?A.then(k=>[!0,k]):[!0,A]}console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,C.state];return[!1,void 0]}).then(C=>{var A;const[k,D]=C;if(b=s.merge(D,(A=a())!=null?A:y),n(b,!0),k)return m()}).then(()=>{N==null||N(b,void 0),b=a(),c=!0,f.forEach(C=>C(b))}).catch(C=>{N==null||N(void 0,C)})};return o.persist={setOptions:E=>{s={...s,...E},E.storage&&(h=E.storage)},clearStorage:()=>{h==null||h.removeItem(s.name)},getOptions:()=>s,rehydrate:()=>S(),hasHydrated:()=>c,onHydrate:E=>(u.add(E),()=>{u.delete(E)}),onFinishHydration:E=>(f.add(E),()=>{f.delete(E)})},s.skipHydration||S(),b||y},zD=LD;function X1(e){var t,n,a="";if(typeof e=="string"||typeof e=="number")a+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t{const t=GD(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:a}=e;return{getClassGroupId:c=>{const u=c.split(Jm);return u[0]===""&&u.length!==1&&u.shift(),Z1(u,t)||PD(c)},getConflictingClassGroupIds:(c,u)=>{const f=n[c]||[];return u&&a[c]?[...f,...a[c]]:f}}},Z1=(e,t)=>{var c;if(e.length===0)return t.classGroupId;const n=e[0],a=t.nextPart.get(n),o=a?Z1(e.slice(1),a):void 0;if(o)return o;if(t.validators.length===0)return;const s=e.join(Jm);return(c=t.validators.find(({validator:u})=>u(s)))==null?void 0:c.classGroupId},n0=/^\[(.+)\]$/,PD=e=>{if(n0.test(e)){const t=n0.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},GD=e=>{const{theme:t,classGroups:n}=e,a={nextPart:new Map,validators:[]};for(const o in n)tm(n[o],a,o,t);return a},tm=(e,t,n,a)=>{e.forEach(o=>{if(typeof o=="string"){const s=o===""?t:r0(t,o);s.classGroupId=n;return}if(typeof o=="function"){if(FD(o)){tm(o(a),t,n,a);return}t.validators.push({validator:o,classGroupId:n});return}Object.entries(o).forEach(([s,c])=>{tm(c,r0(t,s),n,a)})})},r0=(e,t)=>{let n=e;return t.split(Jm).forEach(a=>{n.nextPart.has(a)||n.nextPart.set(a,{nextPart:new Map,validators:[]}),n=n.nextPart.get(a)}),n},FD=e=>e.isThemeGetter,UD=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,a=new Map;const o=(s,c)=>{n.set(s,c),t++,t>e&&(t=0,a=n,n=new Map)};return{get(s){let c=n.get(s);if(c!==void 0)return c;if((c=a.get(s))!==void 0)return o(s,c),c},set(s,c){n.has(s)?n.set(s,c):o(s,c)}}},nm="!",rm=":",BD=rm.length,ID=e=>{const{prefix:t,experimentalParseClassName:n}=e;let a=o=>{const s=[];let c=0,u=0,f=0,h;for(let S=0;Sf?h-f:void 0;return{modifiers:s,hasImportantModifier:y,baseClassName:g,maybePostfixModifierPosition:b}};if(t){const o=t+rm,s=a;a=c=>c.startsWith(o)?s(c.substring(o.length)):{isExternal:!0,modifiers:[],hasImportantModifier:!1,baseClassName:c,maybePostfixModifierPosition:void 0}}if(n){const o=a;a=s=>n({className:s,parseClassName:o})}return a},HD=e=>e.endsWith(nm)?e.substring(0,e.length-1):e.startsWith(nm)?e.substring(1):e,$D=e=>{const t=Object.fromEntries(e.orderSensitiveModifiers.map(a=>[a,!0]));return a=>{if(a.length<=1)return a;const o=[];let s=[];return a.forEach(c=>{c[0]==="["||t[c]?(o.push(...s.sort(),c),s=[]):s.push(c)}),o.push(...s.sort()),o}},VD=e=>({cache:UD(e.cacheSize),parseClassName:ID(e),sortModifiers:$D(e),...MD(e)}),qD=/\s+/,YD=(e,t)=>{const{parseClassName:n,getClassGroupId:a,getConflictingClassGroupIds:o,sortModifiers:s}=t,c=[],u=e.trim().split(qD);let f="";for(let h=u.length-1;h>=0;h-=1){const m=u[h],{isExternal:g,modifiers:y,hasImportantModifier:b,baseClassName:S,maybePostfixModifierPosition:E}=n(m);if(g){f=m+(f.length>0?" "+f:f);continue}let _=!!E,N=a(_?S.substring(0,E):S);if(!N){if(!_){f=m+(f.length>0?" "+f:f);continue}if(N=a(S),!N){f=m+(f.length>0?" "+f:f);continue}_=!1}const C=s(y).join(":"),A=b?C+nm:C,k=A+N;if(c.includes(k))continue;c.push(k);const D=o(N,_);for(let M=0;M0?" "+f:f)}return f};function WD(){let e=0,t,n,a="";for(;e{if(typeof e=="string")return e;let t,n="";for(let a=0;ag(m),e());return n=VD(h),a=n.cache.get,o=n.cache.set,s=u,u(f)}function u(f){const h=a(f);if(h)return h;const m=YD(f,n);return o(f,m),m}return function(){return s(WD.apply(null,arguments))}}const Ht=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},J1=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,eE=/^\((?:(\w[\w-]*):)?(.+)\)$/i,KD=/^\d+\/\d+$/,ZD=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,QD=/\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$/,JD=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,ek=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,tk=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,yo=e=>KD.test(e),et=e=>!!e&&!Number.isNaN(Number(e)),gi=e=>!!e&&Number.isInteger(Number(e)),a0=e=>e.endsWith("%")&&et(e.slice(0,-1)),Oa=e=>ZD.test(e),nk=()=>!0,rk=e=>QD.test(e)&&!JD.test(e),eg=()=>!1,ak=e=>ek.test(e),ik=e=>tk.test(e),ok=e=>!ke(e)&&!Ne(e),sk=e=>Fo(e,rE,eg),ke=e=>J1.test(e),vi=e=>Fo(e,aE,rk),Ih=e=>Fo(e,yk,et),lk=e=>Fo(e,tE,eg),ck=e=>Fo(e,nE,ik),uk=e=>Fo(e,eg,ak),Ne=e=>eE.test(e),Uc=e=>Uo(e,aE),dk=e=>Uo(e,bk),fk=e=>Uo(e,tE),hk=e=>Uo(e,rE),pk=e=>Uo(e,nE),mk=e=>Uo(e,xk,!0),Fo=(e,t,n)=>{const a=J1.exec(e);return a?a[1]?t(a[1]):n(a[2]):!1},Uo=(e,t,n=!1)=>{const a=eE.exec(e);return a?a[1]?t(a[1]):n:!1},tE=e=>e==="position",gk=new Set(["image","url"]),nE=e=>gk.has(e),vk=new Set(["length","size","percentage"]),rE=e=>vk.has(e),aE=e=>e==="length",yk=e=>e==="number",bk=e=>e==="family-name",xk=e=>e==="shadow",wk=()=>{const e=Ht("color"),t=Ht("font"),n=Ht("text"),a=Ht("font-weight"),o=Ht("tracking"),s=Ht("leading"),c=Ht("breakpoint"),u=Ht("container"),f=Ht("spacing"),h=Ht("radius"),m=Ht("shadow"),g=Ht("inset-shadow"),y=Ht("drop-shadow"),b=Ht("blur"),S=Ht("perspective"),E=Ht("aspect"),_=Ht("ease"),N=Ht("animate"),C=()=>["auto","avoid","all","avoid-page","page","left","right","column"],A=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],k=()=>["auto","hidden","clip","visible","scroll"],D=()=>["auto","contain","none"],M=()=>[yo,"px","full","auto",Ne,ke,f],R=()=>[gi,"none","subgrid",Ne,ke],U=()=>["auto",{span:["full",gi,Ne,ke]},Ne,ke],L=()=>[gi,"auto",Ne,ke],I=()=>["auto","min","max","fr",Ne,ke],q=()=>[Ne,ke,f],Y=()=>["start","end","center","between","around","evenly","stretch","baseline"],B=()=>["start","end","center","stretch"],X=()=>[Ne,ke,f],ne=()=>["px",...X()],F=()=>["px","auto",...X()],z=()=>[yo,"auto","px","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",Ne,ke,f],j=()=>[e,Ne,ke],K=()=>[a0,vi],G=()=>["","none","full",h,Ne,ke],H=()=>["",et,Uc,vi],O=()=>["solid","dashed","dotted","double"],$=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],W=()=>["","none",b,Ne,ke],re=()=>["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",Ne,ke],de=()=>["none",et,Ne,ke],ie=()=>["none",et,Ne,ke],oe=()=>[et,Ne,ke],Ce=()=>[yo,"full","px",Ne,ke,f];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Oa],breakpoint:[Oa],color:[nk],container:[Oa],"drop-shadow":[Oa],ease:["in","out","in-out"],font:[ok],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Oa],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Oa],shadow:[Oa],spacing:[et],text:[Oa],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",yo,ke,Ne,E]}],container:["container"],columns:[{columns:[et,ke,Ne,u]}],"break-after":[{"break-after":C()}],"break-before":[{"break-before":C()}],"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:[...A(),ke,Ne]}],overflow:[{overflow:k()}],"overflow-x":[{"overflow-x":k()}],"overflow-y":[{"overflow-y":k()}],overscroll:[{overscroll:D()}],"overscroll-x":[{"overscroll-x":D()}],"overscroll-y":[{"overscroll-y":D()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:M()}],"inset-x":[{"inset-x":M()}],"inset-y":[{"inset-y":M()}],start:[{start:M()}],end:[{end:M()}],top:[{top:M()}],right:[{right:M()}],bottom:[{bottom:M()}],left:[{left:M()}],visibility:["visible","invisible","collapse"],z:[{z:[gi,"auto",Ne,ke]}],basis:[{basis:[yo,"full","auto",Ne,ke,u,f]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[et,yo,"auto","initial","none",ke]}],grow:[{grow:["",et,Ne,ke]}],shrink:[{shrink:["",et,Ne,ke]}],order:[{order:[gi,"first","last","none",Ne,ke]}],"grid-cols":[{"grid-cols":R()}],"col-start-end":[{col:U()}],"col-start":[{"col-start":L()}],"col-end":[{"col-end":L()}],"grid-rows":[{"grid-rows":R()}],"row-start-end":[{row:U()}],"row-start":[{"row-start":L()}],"row-end":[{"row-end":L()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":I()}],"auto-rows":[{"auto-rows":I()}],gap:[{gap:q()}],"gap-x":[{"gap-x":q()}],"gap-y":[{"gap-y":q()}],"justify-content":[{justify:[...Y(),"normal"]}],"justify-items":[{"justify-items":[...B(),"normal"]}],"justify-self":[{"justify-self":["auto",...B()]}],"align-content":[{content:["normal",...Y()]}],"align-items":[{items:[...B(),"baseline"]}],"align-self":[{self:["auto",...B(),"baseline"]}],"place-content":[{"place-content":Y()}],"place-items":[{"place-items":[...B(),"baseline"]}],"place-self":[{"place-self":["auto",...B()]}],p:[{p:ne()}],px:[{px:ne()}],py:[{py:ne()}],ps:[{ps:ne()}],pe:[{pe:ne()}],pt:[{pt:ne()}],pr:[{pr:ne()}],pb:[{pb:ne()}],pl:[{pl:ne()}],m:[{m:F()}],mx:[{mx:F()}],my:[{my:F()}],ms:[{ms:F()}],me:[{me:F()}],mt:[{mt:F()}],mr:[{mr:F()}],mb:[{mb:F()}],ml:[{ml:F()}],"space-x":[{"space-x":X()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":X()}],"space-y-reverse":["space-y-reverse"],size:[{size:z()}],w:[{w:[u,"screen",...z()]}],"min-w":[{"min-w":[u,"screen","none",...z()]}],"max-w":[{"max-w":[u,"screen","none","prose",{screen:[c]},...z()]}],h:[{h:["screen",...z()]}],"min-h":[{"min-h":["screen","none",...z()]}],"max-h":[{"max-h":["screen",...z()]}],"font-size":[{text:["base",n,Uc,vi]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[a,Ne,Ih]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",a0,ke]}],"font-family":[{font:[dk,ke,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:[o,Ne,ke]}],"line-clamp":[{"line-clamp":[et,"none",Ne,Ih]}],leading:[{leading:[Ne,ke,s,f]}],"list-image":[{"list-image":["none",Ne,ke]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Ne,ke]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:j()}],"text-color":[{text:j()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...O(),"wavy"]}],"text-decoration-thickness":[{decoration:[et,"from-font","auto",Ne,vi]}],"text-decoration-color":[{decoration:j()}],"underline-offset":[{"underline-offset":[et,"auto",Ne,ke]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:["px",...X()]}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Ne,ke]}],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",Ne,ke]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...A(),fk,lk]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","space","round"]}]}],"bg-size":[{bg:["auto","cover","contain",hk,sk]}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},gi,Ne,ke],radial:["",Ne,ke],conic:[gi,Ne,ke]},pk,ck]}],"bg-color":[{bg:j()}],"gradient-from-pos":[{from:K()}],"gradient-via-pos":[{via:K()}],"gradient-to-pos":[{to:K()}],"gradient-from":[{from:j()}],"gradient-via":[{via:j()}],"gradient-to":[{to:j()}],rounded:[{rounded:G()}],"rounded-s":[{"rounded-s":G()}],"rounded-e":[{"rounded-e":G()}],"rounded-t":[{"rounded-t":G()}],"rounded-r":[{"rounded-r":G()}],"rounded-b":[{"rounded-b":G()}],"rounded-l":[{"rounded-l":G()}],"rounded-ss":[{"rounded-ss":G()}],"rounded-se":[{"rounded-se":G()}],"rounded-ee":[{"rounded-ee":G()}],"rounded-es":[{"rounded-es":G()}],"rounded-tl":[{"rounded-tl":G()}],"rounded-tr":[{"rounded-tr":G()}],"rounded-br":[{"rounded-br":G()}],"rounded-bl":[{"rounded-bl":G()}],"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:[...O(),"hidden","none"]}],"divide-style":[{divide:[...O(),"hidden","none"]}],"border-color":[{border:j()}],"border-color-x":[{"border-x":j()}],"border-color-y":[{"border-y":j()}],"border-color-s":[{"border-s":j()}],"border-color-e":[{"border-e":j()}],"border-color-t":[{"border-t":j()}],"border-color-r":[{"border-r":j()}],"border-color-b":[{"border-b":j()}],"border-color-l":[{"border-l":j()}],"divide-color":[{divide:j()}],"outline-style":[{outline:[...O(),"none","hidden"]}],"outline-offset":[{"outline-offset":[et,Ne,ke]}],"outline-w":[{outline:["",et,Uc,vi]}],"outline-color":[{outline:[e]}],shadow:[{shadow:["","none",m,mk,uk]}],"shadow-color":[{shadow:j()}],"inset-shadow":[{"inset-shadow":["none",Ne,ke,g]}],"inset-shadow-color":[{"inset-shadow":j()}],"ring-w":[{ring:H()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:j()}],"ring-offset-w":[{"ring-offset":[et,vi]}],"ring-offset-color":[{"ring-offset":j()}],"inset-ring-w":[{"inset-ring":H()}],"inset-ring-color":[{"inset-ring":j()}],opacity:[{opacity:[et,Ne,ke]}],"mix-blend":[{"mix-blend":[...$(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":$()}],filter:[{filter:["","none",Ne,ke]}],blur:[{blur:W()}],brightness:[{brightness:[et,Ne,ke]}],contrast:[{contrast:[et,Ne,ke]}],"drop-shadow":[{"drop-shadow":["","none",y,Ne,ke]}],grayscale:[{grayscale:["",et,Ne,ke]}],"hue-rotate":[{"hue-rotate":[et,Ne,ke]}],invert:[{invert:["",et,Ne,ke]}],saturate:[{saturate:[et,Ne,ke]}],sepia:[{sepia:["",et,Ne,ke]}],"backdrop-filter":[{"backdrop-filter":["","none",Ne,ke]}],"backdrop-blur":[{"backdrop-blur":W()}],"backdrop-brightness":[{"backdrop-brightness":[et,Ne,ke]}],"backdrop-contrast":[{"backdrop-contrast":[et,Ne,ke]}],"backdrop-grayscale":[{"backdrop-grayscale":["",et,Ne,ke]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[et,Ne,ke]}],"backdrop-invert":[{"backdrop-invert":["",et,Ne,ke]}],"backdrop-opacity":[{"backdrop-opacity":[et,Ne,ke]}],"backdrop-saturate":[{"backdrop-saturate":[et,Ne,ke]}],"backdrop-sepia":[{"backdrop-sepia":["",et,Ne,ke]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":X()}],"border-spacing-x":[{"border-spacing-x":X()}],"border-spacing-y":[{"border-spacing-y":X()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",Ne,ke]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[et,"initial",Ne,ke]}],ease:[{ease:["linear","initial",_,Ne,ke]}],delay:[{delay:[et,Ne,ke]}],animate:[{animate:["none",N,Ne,ke]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[S,Ne,ke]}],"perspective-origin":[{"perspective-origin":re()}],rotate:[{rotate:de()}],"rotate-x":[{"rotate-x":de()}],"rotate-y":[{"rotate-y":de()}],"rotate-z":[{"rotate-z":de()}],scale:[{scale:ie()}],"scale-x":[{"scale-x":ie()}],"scale-y":[{"scale-y":ie()}],"scale-z":[{"scale-z":ie()}],"scale-3d":["scale-3d"],skew:[{skew:oe()}],"skew-x":[{"skew-x":oe()}],"skew-y":[{"skew-y":oe()}],transform:[{transform:[Ne,ke,"","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:j()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:j()}],"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",Ne,ke]}],"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":X()}],"scroll-mx":[{"scroll-mx":X()}],"scroll-my":[{"scroll-my":X()}],"scroll-ms":[{"scroll-ms":X()}],"scroll-me":[{"scroll-me":X()}],"scroll-mt":[{"scroll-mt":X()}],"scroll-mr":[{"scroll-mr":X()}],"scroll-mb":[{"scroll-mb":X()}],"scroll-ml":[{"scroll-ml":X()}],"scroll-p":[{"scroll-p":X()}],"scroll-px":[{"scroll-px":X()}],"scroll-py":[{"scroll-py":X()}],"scroll-ps":[{"scroll-ps":X()}],"scroll-pe":[{"scroll-pe":X()}],"scroll-pt":[{"scroll-pt":X()}],"scroll-pr":[{"scroll-pr":X()}],"scroll-pb":[{"scroll-pb":X()}],"scroll-pl":[{"scroll-pl":X()}],"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",Ne,ke]}],fill:[{fill:["none",...j()]}],"stroke-w":[{stroke:[et,Uc,vi,Ih]}],stroke:[{stroke:["none",...j()]}],"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","*","**"]}},Ek=XD(wk);function Oe(...e){return Ek(K1(e))}function Sk(){const e="0123456789abcdef";let t="#";for(let n=0;n<6;n++)t+=e.charAt(Math.floor(Math.random()*16));return t}function Sr(e){return e instanceof Error?e.message:`${e}`}const tg=e=>{const t=e;t.use={};for(const n of Object.keys(t.getState()))t.use[n]=()=>t(a=>a[n]);return t},iE="",_r="ghost",_k="#B2EBF2",Ck="#000",Tk="#E2E2E2",Rk="#EEEEEE",Ak="#F57F17",Dk="#969696",kk="#F57F17",i0="#B2EBF2",Hh=20,o0=4,Nk=20,Ok=15,s0="*",jk={"text/plain":[".txt",".md"],"application/pdf":[".pdf"],"application/msword":[".doc"],"application/vnd.openxmlformats-officedocument.wordprocessingml.document":[".docx"],"application/vnd.openxmlformats-officedocument.presentationml.presentation":[".pptx"]},l0={name:"LightRAG",github:"https://github.com/HKUDS/LightRAG"},Lk=Qm()(zD(e=>({theme:"system",showPropertyPanel:!0,showNodeSearchBar:!0,showNodeLabel:!0,enableNodeDrag:!0,showEdgeLabel:!1,enableHideUnselectedEdges:!0,enableEdgeEvents:!1,queryLabel:s0,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:W1(()=>localStorage),version:6,migrate:(e,t)=>(t<2&&(e.showEdgeLabel=!1),t<3&&(e.queryLabel=s0),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)})),Ye=tg(Lk),zk={theme:"system",setTheme:()=>null},oE=w.createContext(zk);function Mk({children:e,...t}){const[n,a]=w.useState(Ye.getState().theme);w.useEffect(()=>{const s=window.document.documentElement;if(s.classList.remove("light","dark"),n==="system"){const c=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";s.classList.add(c),a(c);return}s.classList.add(n)},[n]);const o={theme:n,setTheme:s=>{Ye.getState().setTheme(s),a(s)}};return x.jsx(oE.Provider,{...t,value:o,children:e})}const c0=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,u0=K1,sE=(e,t)=>n=>{var a;if((t==null?void 0:t.variants)==null)return u0(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:o,defaultVariants:s}=t,c=Object.keys(o).map(h=>{const m=n==null?void 0:n[h],g=s==null?void 0:s[h];if(m===null)return null;const y=c0(m)||c0(g);return o[h][y]}),u=n&&Object.entries(n).reduce((h,m)=>{let[g,y]=m;return y===void 0||(h[g]=y),h},{}),f=t==null||(a=t.compoundVariants)===null||a===void 0?void 0:a.reduce((h,m)=>{let{class:g,className:y,...b}=m;return Object.entries(b).every(S=>{let[E,_]=S;return Array.isArray(_)?_.includes({...s,...u}[E]):{...s,...u}[E]===_})?[...h,g,y]:h},[]);return u0(e,c,f,n==null?void 0:n.class,n==null?void 0:n.className)},Pk=sE("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"}}),lE=w.forwardRef(({className:e,variant:t,...n},a)=>x.jsx("div",{ref:a,role:"alert",className:Oe(Pk({variant:t}),e),...n}));lE.displayName="Alert";const cE=w.forwardRef(({className:e,...t},n)=>x.jsx("h5",{ref:n,className:Oe("mb-1 leading-none font-medium tracking-tight",e),...t}));cE.displayName="AlertTitle";const uE=w.forwardRef(({className:e,...t},n)=>x.jsx("div",{ref:n,className:Oe("text-sm [&_p]:leading-relaxed",e),...t}));uE.displayName="AlertDescription";function dE(e,t){return function(){return e.apply(t,arguments)}}const{toString:Gk}=Object.prototype,{getPrototypeOf:ng}=Object,Wu=(e=>t=>{const n=Gk.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),dr=e=>(e=e.toLowerCase(),t=>Wu(t)===e),Xu=e=>t=>typeof t===e,{isArray:Bo}=Array,ll=Xu("undefined");function Fk(e){return e!==null&&!ll(e)&&e.constructor!==null&&!ll(e.constructor)&&jn(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const fE=dr("ArrayBuffer");function Uk(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&fE(e.buffer),t}const Bk=Xu("string"),jn=Xu("function"),hE=Xu("number"),Ku=e=>e!==null&&typeof e=="object",Ik=e=>e===!0||e===!1,cu=e=>{if(Wu(e)!=="object")return!1;const t=ng(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)},Hk=dr("Date"),$k=dr("File"),Vk=dr("Blob"),qk=dr("FileList"),Yk=e=>Ku(e)&&jn(e.pipe),Wk=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||jn(e.append)&&((t=Wu(e))==="formdata"||t==="object"&&jn(e.toString)&&e.toString()==="[object FormData]"))},Xk=dr("URLSearchParams"),[Kk,Zk,Qk,Jk]=["ReadableStream","Request","Response","Headers"].map(dr),eN=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function yl(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let a,o;if(typeof e!="object"&&(e=[e]),Bo(e))for(a=0,o=e.length;a0;)if(o=n[a],t===o.toLowerCase())return o;return null}const Si=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,mE=e=>!ll(e)&&e!==Si;function am(){const{caseless:e}=mE(this)&&this||{},t={},n=(a,o)=>{const s=e&&pE(t,o)||o;cu(t[s])&&cu(a)?t[s]=am(t[s],a):cu(a)?t[s]=am({},a):Bo(a)?t[s]=a.slice():t[s]=a};for(let a=0,o=arguments.length;a(yl(t,(o,s)=>{n&&jn(o)?e[s]=dE(o,n):e[s]=o},{allOwnKeys:a}),e),nN=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),rN=(e,t,n,a)=>{e.prototype=Object.create(t.prototype,a),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},aN=(e,t,n,a)=>{let o,s,c;const u={};if(t=t||{},e==null)return t;do{for(o=Object.getOwnPropertyNames(e),s=o.length;s-- >0;)c=o[s],(!a||a(c,e,t))&&!u[c]&&(t[c]=e[c],u[c]=!0);e=n!==!1&&ng(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},iN=(e,t,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=t.length;const a=e.indexOf(t,n);return a!==-1&&a===n},oN=e=>{if(!e)return null;if(Bo(e))return e;let t=e.length;if(!hE(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},sN=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&ng(Uint8Array)),lN=(e,t)=>{const a=(e&&e[Symbol.iterator]).call(e);let o;for(;(o=a.next())&&!o.done;){const s=o.value;t.call(e,s[0],s[1])}},cN=(e,t)=>{let n;const a=[];for(;(n=e.exec(t))!==null;)a.push(n);return a},uN=dr("HTMLFormElement"),dN=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,a,o){return a.toUpperCase()+o}),d0=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),fN=dr("RegExp"),gE=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),a={};yl(n,(o,s)=>{let c;(c=t(o,s,e))!==!1&&(a[s]=c||o)}),Object.defineProperties(e,a)},hN=e=>{gE(e,(t,n)=>{if(jn(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const a=e[n];if(jn(a)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},pN=(e,t)=>{const n={},a=o=>{o.forEach(s=>{n[s]=!0})};return Bo(e)?a(e):a(String(e).split(t)),n},mN=()=>{},gN=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t,$h="abcdefghijklmnopqrstuvwxyz",f0="0123456789",vE={DIGIT:f0,ALPHA:$h,ALPHA_DIGIT:$h+$h.toUpperCase()+f0},vN=(e=16,t=vE.ALPHA_DIGIT)=>{let n="";const{length:a}=t;for(;e--;)n+=t[Math.random()*a|0];return n};function yN(e){return!!(e&&jn(e.append)&&e[Symbol.toStringTag]==="FormData"&&e[Symbol.iterator])}const bN=e=>{const t=new Array(10),n=(a,o)=>{if(Ku(a)){if(t.indexOf(a)>=0)return;if(!("toJSON"in a)){t[o]=a;const s=Bo(a)?[]:{};return yl(a,(c,u)=>{const f=n(c,o+1);!ll(f)&&(s[u]=f)}),t[o]=void 0,s}}return a};return n(e,0)},xN=dr("AsyncFunction"),wN=e=>e&&(Ku(e)||jn(e))&&jn(e.then)&&jn(e.catch),yE=((e,t)=>e?setImmediate:t?((n,a)=>(Si.addEventListener("message",({source:o,data:s})=>{o===Si&&s===n&&a.length&&a.shift()()},!1),o=>{a.push(o),Si.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",jn(Si.postMessage)),EN=typeof queueMicrotask<"u"?queueMicrotask.bind(Si):typeof process<"u"&&process.nextTick||yE,ce={isArray:Bo,isArrayBuffer:fE,isBuffer:Fk,isFormData:Wk,isArrayBufferView:Uk,isString:Bk,isNumber:hE,isBoolean:Ik,isObject:Ku,isPlainObject:cu,isReadableStream:Kk,isRequest:Zk,isResponse:Qk,isHeaders:Jk,isUndefined:ll,isDate:Hk,isFile:$k,isBlob:Vk,isRegExp:fN,isFunction:jn,isStream:Yk,isURLSearchParams:Xk,isTypedArray:sN,isFileList:qk,forEach:yl,merge:am,extend:tN,trim:eN,stripBOM:nN,inherits:rN,toFlatObject:aN,kindOf:Wu,kindOfTest:dr,endsWith:iN,toArray:oN,forEachEntry:lN,matchAll:cN,isHTMLForm:uN,hasOwnProperty:d0,hasOwnProp:d0,reduceDescriptors:gE,freezeMethods:hN,toObjectSet:pN,toCamelCase:dN,noop:mN,toFiniteNumber:gN,findKey:pE,global:Si,isContextDefined:mE,ALPHABET:vE,generateString:vN,isSpecCompliantForm:yN,toJSONObject:bN,isAsyncFn:xN,isThenable:wN,setImmediate:yE,asap:EN};function Xe(e,t,n,a,o){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),a&&(this.request=a),o&&(this.response=o,this.status=o.status?o.status:null)}ce.inherits(Xe,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:ce.toJSONObject(this.config),code:this.code,status:this.status}}});const bE=Xe.prototype,xE={};["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=>{xE[e]={value:e}});Object.defineProperties(Xe,xE);Object.defineProperty(bE,"isAxiosError",{value:!0});Xe.from=(e,t,n,a,o,s)=>{const c=Object.create(bE);return ce.toFlatObject(e,c,function(f){return f!==Error.prototype},u=>u!=="isAxiosError"),Xe.call(c,e.message,t,n,a,o),c.cause=e,c.name=e.name,s&&Object.assign(c,s),c};const SN=null;function im(e){return ce.isPlainObject(e)||ce.isArray(e)}function wE(e){return ce.endsWith(e,"[]")?e.slice(0,-2):e}function h0(e,t,n){return e?e.concat(t).map(function(o,s){return o=wE(o),!n&&s?"["+o+"]":o}).join(n?".":""):t}function _N(e){return ce.isArray(e)&&!e.some(im)}const CN=ce.toFlatObject(ce,{},null,function(t){return/^is[A-Z]/.test(t)});function Zu(e,t,n){if(!ce.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,n=ce.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(E,_){return!ce.isUndefined(_[E])});const a=n.metaTokens,o=n.visitor||m,s=n.dots,c=n.indexes,f=(n.Blob||typeof Blob<"u"&&Blob)&&ce.isSpecCompliantForm(t);if(!ce.isFunction(o))throw new TypeError("visitor must be a function");function h(S){if(S===null)return"";if(ce.isDate(S))return S.toISOString();if(!f&&ce.isBlob(S))throw new Xe("Blob is not supported. Use a Buffer instead.");return ce.isArrayBuffer(S)||ce.isTypedArray(S)?f&&typeof Blob=="function"?new Blob([S]):Buffer.from(S):S}function m(S,E,_){let N=S;if(S&&!_&&typeof S=="object"){if(ce.endsWith(E,"{}"))E=a?E:E.slice(0,-2),S=JSON.stringify(S);else if(ce.isArray(S)&&_N(S)||(ce.isFileList(S)||ce.endsWith(E,"[]"))&&(N=ce.toArray(S)))return E=wE(E),N.forEach(function(A,k){!(ce.isUndefined(A)||A===null)&&t.append(c===!0?h0([E],k,s):c===null?E:E+"[]",h(A))}),!1}return im(S)?!0:(t.append(h0(_,E,s),h(S)),!1)}const g=[],y=Object.assign(CN,{defaultVisitor:m,convertValue:h,isVisitable:im});function b(S,E){if(!ce.isUndefined(S)){if(g.indexOf(S)!==-1)throw Error("Circular reference detected in "+E.join("."));g.push(S),ce.forEach(S,function(N,C){(!(ce.isUndefined(N)||N===null)&&o.call(t,N,ce.isString(C)?C.trim():C,E,y))===!0&&b(N,E?E.concat(C):[C])}),g.pop()}}if(!ce.isObject(e))throw new TypeError("data must be an object");return b(e),t}function p0(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(a){return t[a]})}function rg(e,t){this._pairs=[],e&&Zu(e,this,t)}const EE=rg.prototype;EE.append=function(t,n){this._pairs.push([t,n])};EE.toString=function(t){const n=t?function(a){return t.call(this,a,p0)}:p0;return this._pairs.map(function(o){return n(o[0])+"="+n(o[1])},"").join("&")};function TN(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function SE(e,t,n){if(!t)return e;const a=n&&n.encode||TN;ce.isFunction(n)&&(n={serialize:n});const o=n&&n.serialize;let s;if(o?s=o(t,n):s=ce.isURLSearchParams(t)?t.toString():new rg(t,n).toString(a),s){const c=e.indexOf("#");c!==-1&&(e=e.slice(0,c)),e+=(e.indexOf("?")===-1?"?":"&")+s}return e}class m0{constructor(){this.handlers=[]}use(t,n,a){return this.handlers.push({fulfilled:t,rejected:n,synchronous:a?a.synchronous:!1,runWhen:a?a.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){ce.forEach(this.handlers,function(a){a!==null&&t(a)})}}const _E={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},RN=typeof URLSearchParams<"u"?URLSearchParams:rg,AN=typeof FormData<"u"?FormData:null,DN=typeof Blob<"u"?Blob:null,kN={isBrowser:!0,classes:{URLSearchParams:RN,FormData:AN,Blob:DN},protocols:["http","https","file","blob","url","data"]},ag=typeof window<"u"&&typeof document<"u",om=typeof navigator=="object"&&navigator||void 0,NN=ag&&(!om||["ReactNative","NativeScript","NS"].indexOf(om.product)<0),ON=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",jN=ag&&window.location.href||"http://localhost",LN=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:ag,hasStandardBrowserEnv:NN,hasStandardBrowserWebWorkerEnv:ON,navigator:om,origin:jN},Symbol.toStringTag,{value:"Module"})),rn={...LN,...kN};function zN(e,t){return Zu(e,new rn.classes.URLSearchParams,Object.assign({visitor:function(n,a,o,s){return rn.isNode&&ce.isBuffer(n)?(this.append(a,n.toString("base64")),!1):s.defaultVisitor.apply(this,arguments)}},t))}function MN(e){return ce.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function PN(e){const t={},n=Object.keys(e);let a;const o=n.length;let s;for(a=0;a=n.length;return c=!c&&ce.isArray(o)?o.length:c,f?(ce.hasOwnProp(o,c)?o[c]=[o[c],a]:o[c]=a,!u):((!o[c]||!ce.isObject(o[c]))&&(o[c]=[]),t(n,a,o[c],s)&&ce.isArray(o[c])&&(o[c]=PN(o[c])),!u)}if(ce.isFormData(e)&&ce.isFunction(e.entries)){const n={};return ce.forEachEntry(e,(a,o)=>{t(MN(a),o,n,0)}),n}return null}function GN(e,t,n){if(ce.isString(e))try{return(t||JSON.parse)(e),ce.trim(e)}catch(a){if(a.name!=="SyntaxError")throw a}return(n||JSON.stringify)(e)}const bl={transitional:_E,adapter:["xhr","http","fetch"],transformRequest:[function(t,n){const a=n.getContentType()||"",o=a.indexOf("application/json")>-1,s=ce.isObject(t);if(s&&ce.isHTMLForm(t)&&(t=new FormData(t)),ce.isFormData(t))return o?JSON.stringify(CE(t)):t;if(ce.isArrayBuffer(t)||ce.isBuffer(t)||ce.isStream(t)||ce.isFile(t)||ce.isBlob(t)||ce.isReadableStream(t))return t;if(ce.isArrayBufferView(t))return t.buffer;if(ce.isURLSearchParams(t))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let u;if(s){if(a.indexOf("application/x-www-form-urlencoded")>-1)return zN(t,this.formSerializer).toString();if((u=ce.isFileList(t))||a.indexOf("multipart/form-data")>-1){const f=this.env&&this.env.FormData;return Zu(u?{"files[]":t}:t,f&&new f,this.formSerializer)}}return s||o?(n.setContentType("application/json",!1),GN(t)):t}],transformResponse:[function(t){const n=this.transitional||bl.transitional,a=n&&n.forcedJSONParsing,o=this.responseType==="json";if(ce.isResponse(t)||ce.isReadableStream(t))return t;if(t&&ce.isString(t)&&(a&&!this.responseType||o)){const c=!(n&&n.silentJSONParsing)&&o;try{return JSON.parse(t)}catch(u){if(c)throw u.name==="SyntaxError"?Xe.from(u,Xe.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:rn.classes.FormData,Blob:rn.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};ce.forEach(["delete","get","head","post","put","patch"],e=>{bl.headers[e]={}});const FN=ce.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"]),UN=e=>{const t={};let n,a,o;return e&&e.split(` +`).forEach(function(c){o=c.indexOf(":"),n=c.substring(0,o).trim().toLowerCase(),a=c.substring(o+1).trim(),!(!n||t[n]&&FN[n])&&(n==="set-cookie"?t[n]?t[n].push(a):t[n]=[a]:t[n]=t[n]?t[n]+", "+a:a)}),t},g0=Symbol("internals");function Ws(e){return e&&String(e).trim().toLowerCase()}function uu(e){return e===!1||e==null?e:ce.isArray(e)?e.map(uu):String(e)}function BN(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let a;for(;a=n.exec(e);)t[a[1]]=a[2];return t}const IN=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function Vh(e,t,n,a,o){if(ce.isFunction(a))return a.call(this,t,n);if(o&&(t=n),!!ce.isString(t)){if(ce.isString(a))return t.indexOf(a)!==-1;if(ce.isRegExp(a))return a.test(t)}}function HN(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,a)=>n.toUpperCase()+a)}function $N(e,t){const n=ce.toCamelCase(" "+t);["get","set","has"].forEach(a=>{Object.defineProperty(e,a+n,{value:function(o,s,c){return this[a].call(this,t,o,s,c)},configurable:!0})})}let wn=class{constructor(t){t&&this.set(t)}set(t,n,a){const o=this;function s(u,f,h){const m=Ws(f);if(!m)throw new Error("header name must be a non-empty string");const g=ce.findKey(o,m);(!g||o[g]===void 0||h===!0||h===void 0&&o[g]!==!1)&&(o[g||f]=uu(u))}const c=(u,f)=>ce.forEach(u,(h,m)=>s(h,m,f));if(ce.isPlainObject(t)||t instanceof this.constructor)c(t,n);else if(ce.isString(t)&&(t=t.trim())&&!IN(t))c(UN(t),n);else if(ce.isHeaders(t))for(const[u,f]of t.entries())s(f,u,a);else t!=null&&s(n,t,a);return this}get(t,n){if(t=Ws(t),t){const a=ce.findKey(this,t);if(a){const o=this[a];if(!n)return o;if(n===!0)return BN(o);if(ce.isFunction(n))return n.call(this,o,a);if(ce.isRegExp(n))return n.exec(o);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,n){if(t=Ws(t),t){const a=ce.findKey(this,t);return!!(a&&this[a]!==void 0&&(!n||Vh(this,this[a],a,n)))}return!1}delete(t,n){const a=this;let o=!1;function s(c){if(c=Ws(c),c){const u=ce.findKey(a,c);u&&(!n||Vh(a,a[u],u,n))&&(delete a[u],o=!0)}}return ce.isArray(t)?t.forEach(s):s(t),o}clear(t){const n=Object.keys(this);let a=n.length,o=!1;for(;a--;){const s=n[a];(!t||Vh(this,this[s],s,t,!0))&&(delete this[s],o=!0)}return o}normalize(t){const n=this,a={};return ce.forEach(this,(o,s)=>{const c=ce.findKey(a,s);if(c){n[c]=uu(o),delete n[s];return}const u=t?HN(s):String(s).trim();u!==s&&delete n[s],n[u]=uu(o),a[u]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const n=Object.create(null);return ce.forEach(this,(a,o)=>{a!=null&&a!==!1&&(n[o]=t&&ce.isArray(a)?a.join(", "):a)}),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 a=new this(t);return n.forEach(o=>a.set(o)),a}static accessor(t){const a=(this[g0]=this[g0]={accessors:{}}).accessors,o=this.prototype;function s(c){const u=Ws(c);a[u]||($N(o,c),a[u]=!0)}return ce.isArray(t)?t.forEach(s):s(t),this}};wn.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);ce.reduceDescriptors(wn.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(a){this[n]=a}}});ce.freezeMethods(wn);function qh(e,t){const n=this||bl,a=t||n,o=wn.from(a.headers);let s=a.data;return ce.forEach(e,function(u){s=u.call(n,s,o.normalize(),t?t.status:void 0)}),o.normalize(),s}function TE(e){return!!(e&&e.__CANCEL__)}function Io(e,t,n){Xe.call(this,e??"canceled",Xe.ERR_CANCELED,t,n),this.name="CanceledError"}ce.inherits(Io,Xe,{__CANCEL__:!0});function RE(e,t,n){const a=n.config.validateStatus;!n.status||!a||a(n.status)?e(n):t(new Xe("Request failed with status code "+n.status,[Xe.ERR_BAD_REQUEST,Xe.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function VN(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function qN(e,t){e=e||10;const n=new Array(e),a=new Array(e);let o=0,s=0,c;return t=t!==void 0?t:1e3,function(f){const h=Date.now(),m=a[s];c||(c=h),n[o]=f,a[o]=h;let g=s,y=0;for(;g!==o;)y+=n[g++],g=g%e;if(o=(o+1)%e,o===s&&(s=(s+1)%e),h-c{n=m,o=null,s&&(clearTimeout(s),s=null),e.apply(null,h)};return[(...h)=>{const m=Date.now(),g=m-n;g>=a?c(h,m):(o=h,s||(s=setTimeout(()=>{s=null,c(o)},a-g)))},()=>o&&c(o)]}const Cu=(e,t,n=3)=>{let a=0;const o=qN(50,250);return YN(s=>{const c=s.loaded,u=s.lengthComputable?s.total:void 0,f=c-a,h=o(f),m=c<=u;a=c;const g={loaded:c,total:u,progress:u?c/u:void 0,bytes:f,rate:h||void 0,estimated:h&&u&&m?(u-c)/h:void 0,event:s,lengthComputable:u!=null,[t?"download":"upload"]:!0};e(g)},n)},v0=(e,t)=>{const n=e!=null;return[a=>t[0]({lengthComputable:n,total:e,loaded:a}),t[1]]},y0=e=>(...t)=>ce.asap(()=>e(...t)),WN=rn.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,rn.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(rn.origin),rn.navigator&&/(msie|trident)/i.test(rn.navigator.userAgent)):()=>!0,XN=rn.hasStandardBrowserEnv?{write(e,t,n,a,o,s){const c=[e+"="+encodeURIComponent(t)];ce.isNumber(n)&&c.push("expires="+new Date(n).toGMTString()),ce.isString(a)&&c.push("path="+a),ce.isString(o)&&c.push("domain="+o),s===!0&&c.push("secure"),document.cookie=c.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 KN(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function ZN(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function AE(e,t){return e&&!KN(t)?ZN(e,t):t}const b0=e=>e instanceof wn?{...e}:e;function Ci(e,t){t=t||{};const n={};function a(h,m,g,y){return ce.isPlainObject(h)&&ce.isPlainObject(m)?ce.merge.call({caseless:y},h,m):ce.isPlainObject(m)?ce.merge({},m):ce.isArray(m)?m.slice():m}function o(h,m,g,y){if(ce.isUndefined(m)){if(!ce.isUndefined(h))return a(void 0,h,g,y)}else return a(h,m,g,y)}function s(h,m){if(!ce.isUndefined(m))return a(void 0,m)}function c(h,m){if(ce.isUndefined(m)){if(!ce.isUndefined(h))return a(void 0,h)}else return a(void 0,m)}function u(h,m,g){if(g in t)return a(h,m);if(g in e)return a(void 0,h)}const f={url:s,method:s,data:s,baseURL:c,transformRequest:c,transformResponse:c,paramsSerializer:c,timeout:c,timeoutMessage:c,withCredentials:c,withXSRFToken:c,adapter:c,responseType:c,xsrfCookieName:c,xsrfHeaderName:c,onUploadProgress:c,onDownloadProgress:c,decompress:c,maxContentLength:c,maxBodyLength:c,beforeRedirect:c,transport:c,httpAgent:c,httpsAgent:c,cancelToken:c,socketPath:c,responseEncoding:c,validateStatus:u,headers:(h,m,g)=>o(b0(h),b0(m),g,!0)};return ce.forEach(Object.keys(Object.assign({},e,t)),function(m){const g=f[m]||o,y=g(e[m],t[m],m);ce.isUndefined(y)&&g!==u||(n[m]=y)}),n}const DE=e=>{const t=Ci({},e);let{data:n,withXSRFToken:a,xsrfHeaderName:o,xsrfCookieName:s,headers:c,auth:u}=t;t.headers=c=wn.from(c),t.url=SE(AE(t.baseURL,t.url),e.params,e.paramsSerializer),u&&c.set("Authorization","Basic "+btoa((u.username||"")+":"+(u.password?unescape(encodeURIComponent(u.password)):"")));let f;if(ce.isFormData(n)){if(rn.hasStandardBrowserEnv||rn.hasStandardBrowserWebWorkerEnv)c.setContentType(void 0);else if((f=c.getContentType())!==!1){const[h,...m]=f?f.split(";").map(g=>g.trim()).filter(Boolean):[];c.setContentType([h||"multipart/form-data",...m].join("; "))}}if(rn.hasStandardBrowserEnv&&(a&&ce.isFunction(a)&&(a=a(t)),a||a!==!1&&WN(t.url))){const h=o&&s&&XN.read(s);h&&c.set(o,h)}return t},QN=typeof XMLHttpRequest<"u",JN=QN&&function(e){return new Promise(function(n,a){const o=DE(e);let s=o.data;const c=wn.from(o.headers).normalize();let{responseType:u,onUploadProgress:f,onDownloadProgress:h}=o,m,g,y,b,S;function E(){b&&b(),S&&S(),o.cancelToken&&o.cancelToken.unsubscribe(m),o.signal&&o.signal.removeEventListener("abort",m)}let _=new XMLHttpRequest;_.open(o.method.toUpperCase(),o.url,!0),_.timeout=o.timeout;function N(){if(!_)return;const A=wn.from("getAllResponseHeaders"in _&&_.getAllResponseHeaders()),D={data:!u||u==="text"||u==="json"?_.responseText:_.response,status:_.status,statusText:_.statusText,headers:A,config:e,request:_};RE(function(R){n(R),E()},function(R){a(R),E()},D),_=null}"onloadend"in _?_.onloadend=N:_.onreadystatechange=function(){!_||_.readyState!==4||_.status===0&&!(_.responseURL&&_.responseURL.indexOf("file:")===0)||setTimeout(N)},_.onabort=function(){_&&(a(new Xe("Request aborted",Xe.ECONNABORTED,e,_)),_=null)},_.onerror=function(){a(new Xe("Network Error",Xe.ERR_NETWORK,e,_)),_=null},_.ontimeout=function(){let k=o.timeout?"timeout of "+o.timeout+"ms exceeded":"timeout exceeded";const D=o.transitional||_E;o.timeoutErrorMessage&&(k=o.timeoutErrorMessage),a(new Xe(k,D.clarifyTimeoutError?Xe.ETIMEDOUT:Xe.ECONNABORTED,e,_)),_=null},s===void 0&&c.setContentType(null),"setRequestHeader"in _&&ce.forEach(c.toJSON(),function(k,D){_.setRequestHeader(D,k)}),ce.isUndefined(o.withCredentials)||(_.withCredentials=!!o.withCredentials),u&&u!=="json"&&(_.responseType=o.responseType),h&&([y,S]=Cu(h,!0),_.addEventListener("progress",y)),f&&_.upload&&([g,b]=Cu(f),_.upload.addEventListener("progress",g),_.upload.addEventListener("loadend",b)),(o.cancelToken||o.signal)&&(m=A=>{_&&(a(!A||A.type?new Io(null,e,_):A),_.abort(),_=null)},o.cancelToken&&o.cancelToken.subscribe(m),o.signal&&(o.signal.aborted?m():o.signal.addEventListener("abort",m)));const C=VN(o.url);if(C&&rn.protocols.indexOf(C)===-1){a(new Xe("Unsupported protocol "+C+":",Xe.ERR_BAD_REQUEST,e));return}_.send(s||null)})},eO=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let a=new AbortController,o;const s=function(h){if(!o){o=!0,u();const m=h instanceof Error?h:this.reason;a.abort(m instanceof Xe?m:new Io(m instanceof Error?m.message:m))}};let c=t&&setTimeout(()=>{c=null,s(new Xe(`timeout ${t} of ms exceeded`,Xe.ETIMEDOUT))},t);const u=()=>{e&&(c&&clearTimeout(c),c=null,e.forEach(h=>{h.unsubscribe?h.unsubscribe(s):h.removeEventListener("abort",s)}),e=null)};e.forEach(h=>h.addEventListener("abort",s));const{signal:f}=a;return f.unsubscribe=()=>ce.asap(u),f}},tO=function*(e,t){let n=e.byteLength;if(n{const o=nO(e,t);let s=0,c,u=f=>{c||(c=!0,a&&a(f))};return new ReadableStream({async pull(f){try{const{done:h,value:m}=await o.next();if(h){u(),f.close();return}let g=m.byteLength;if(n){let y=s+=g;n(y)}f.enqueue(new Uint8Array(m))}catch(h){throw u(h),h}},cancel(f){return u(f),o.return()}},{highWaterMark:2})},Qu=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",kE=Qu&&typeof ReadableStream=="function",aO=Qu&&(typeof TextEncoder=="function"?(e=>t=>e.encode(t))(new TextEncoder):async e=>new Uint8Array(await new Response(e).arrayBuffer())),NE=(e,...t)=>{try{return!!e(...t)}catch{return!1}},iO=kE&&NE(()=>{let e=!1;const t=new Request(rn.origin,{body:new ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t}),w0=64*1024,sm=kE&&NE(()=>ce.isReadableStream(new Response("").body)),Tu={stream:sm&&(e=>e.body)};Qu&&(e=>{["text","arrayBuffer","blob","formData","stream"].forEach(t=>{!Tu[t]&&(Tu[t]=ce.isFunction(e[t])?n=>n[t]():(n,a)=>{throw new Xe(`Response type '${t}' is not supported`,Xe.ERR_NOT_SUPPORT,a)})})})(new Response);const oO=async e=>{if(e==null)return 0;if(ce.isBlob(e))return e.size;if(ce.isSpecCompliantForm(e))return(await new Request(rn.origin,{method:"POST",body:e}).arrayBuffer()).byteLength;if(ce.isArrayBufferView(e)||ce.isArrayBuffer(e))return e.byteLength;if(ce.isURLSearchParams(e)&&(e=e+""),ce.isString(e))return(await aO(e)).byteLength},sO=async(e,t)=>{const n=ce.toFiniteNumber(e.getContentLength());return n??oO(t)},lO=Qu&&(async e=>{let{url:t,method:n,data:a,signal:o,cancelToken:s,timeout:c,onDownloadProgress:u,onUploadProgress:f,responseType:h,headers:m,withCredentials:g="same-origin",fetchOptions:y}=DE(e);h=h?(h+"").toLowerCase():"text";let b=eO([o,s&&s.toAbortSignal()],c),S;const E=b&&b.unsubscribe&&(()=>{b.unsubscribe()});let _;try{if(f&&iO&&n!=="get"&&n!=="head"&&(_=await sO(m,a))!==0){let D=new Request(t,{method:"POST",body:a,duplex:"half"}),M;if(ce.isFormData(a)&&(M=D.headers.get("content-type"))&&m.setContentType(M),D.body){const[R,U]=v0(_,Cu(y0(f)));a=x0(D.body,w0,R,U)}}ce.isString(g)||(g=g?"include":"omit");const N="credentials"in Request.prototype;S=new Request(t,{...y,signal:b,method:n.toUpperCase(),headers:m.normalize().toJSON(),body:a,duplex:"half",credentials:N?g:void 0});let C=await fetch(S);const A=sm&&(h==="stream"||h==="response");if(sm&&(u||A&&E)){const D={};["status","statusText","headers"].forEach(L=>{D[L]=C[L]});const M=ce.toFiniteNumber(C.headers.get("content-length")),[R,U]=u&&v0(M,Cu(y0(u),!0))||[];C=new Response(x0(C.body,w0,R,()=>{U&&U(),E&&E()}),D)}h=h||"text";let k=await Tu[ce.findKey(Tu,h)||"text"](C,e);return!A&&E&&E(),await new Promise((D,M)=>{RE(D,M,{data:k,headers:wn.from(C.headers),status:C.status,statusText:C.statusText,config:e,request:S})})}catch(N){throw E&&E(),N&&N.name==="TypeError"&&/fetch/i.test(N.message)?Object.assign(new Xe("Network Error",Xe.ERR_NETWORK,e,S),{cause:N.cause||N}):Xe.from(N,N&&N.code,e,S)}}),lm={http:SN,xhr:JN,fetch:lO};ce.forEach(lm,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const E0=e=>`- ${e}`,cO=e=>ce.isFunction(e)||e===null||e===!1,OE={getAdapter:e=>{e=ce.isArray(e)?e:[e];const{length:t}=e;let n,a;const o={};for(let s=0;s`adapter ${u} `+(f===!1?"is not supported by the environment":"is not available in the build"));let c=t?s.length>1?`since : +`+s.map(E0).join(` +`):" "+E0(s[0]):"as no adapter specified";throw new Xe("There is no suitable adapter to dispatch the request "+c,"ERR_NOT_SUPPORT")}return a},adapters:lm};function Yh(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Io(null,e)}function S0(e){return Yh(e),e.headers=wn.from(e.headers),e.data=qh.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),OE.getAdapter(e.adapter||bl.adapter)(e).then(function(a){return Yh(e),a.data=qh.call(e,e.transformResponse,a),a.headers=wn.from(a.headers),a},function(a){return TE(a)||(Yh(e),a&&a.response&&(a.response.data=qh.call(e,e.transformResponse,a.response),a.response.headers=wn.from(a.response.headers))),Promise.reject(a)})}const jE="1.7.9",Ju={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{Ju[e]=function(a){return typeof a===e||"a"+(t<1?"n ":" ")+e}});const _0={};Ju.transitional=function(t,n,a){function o(s,c){return"[Axios v"+jE+"] Transitional option '"+s+"'"+c+(a?". "+a:"")}return(s,c,u)=>{if(t===!1)throw new Xe(o(c," has been removed"+(n?" in "+n:"")),Xe.ERR_DEPRECATED);return n&&!_0[c]&&(_0[c]=!0,console.warn(o(c," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(s,c,u):!0}};Ju.spelling=function(t){return(n,a)=>(console.warn(`${a} is likely a misspelling of ${t}`),!0)};function uO(e,t,n){if(typeof e!="object")throw new Xe("options must be an object",Xe.ERR_BAD_OPTION_VALUE);const a=Object.keys(e);let o=a.length;for(;o-- >0;){const s=a[o],c=t[s];if(c){const u=e[s],f=u===void 0||c(u,s,e);if(f!==!0)throw new Xe("option "+s+" must be "+f,Xe.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new Xe("Unknown option "+s,Xe.ERR_BAD_OPTION)}}const du={assertOptions:uO,validators:Ju},br=du.validators;let _i=class{constructor(t){this.defaults=t,this.interceptors={request:new m0,response:new m0}}async request(t,n){try{return await this._request(t,n)}catch(a){if(a instanceof Error){let o={};Error.captureStackTrace?Error.captureStackTrace(o):o=new Error;const s=o.stack?o.stack.replace(/^.+\n/,""):"";try{a.stack?s&&!String(a.stack).endsWith(s.replace(/^.+\n.+\n/,""))&&(a.stack+=` +`+s):a.stack=s}catch{}}throw a}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=Ci(this.defaults,n);const{transitional:a,paramsSerializer:o,headers:s}=n;a!==void 0&&du.assertOptions(a,{silentJSONParsing:br.transitional(br.boolean),forcedJSONParsing:br.transitional(br.boolean),clarifyTimeoutError:br.transitional(br.boolean)},!1),o!=null&&(ce.isFunction(o)?n.paramsSerializer={serialize:o}:du.assertOptions(o,{encode:br.function,serialize:br.function},!0)),du.assertOptions(n,{baseUrl:br.spelling("baseURL"),withXsrfToken:br.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let c=s&&ce.merge(s.common,s[n.method]);s&&ce.forEach(["delete","get","head","post","put","patch","common"],S=>{delete s[S]}),n.headers=wn.concat(c,s);const u=[];let f=!0;this.interceptors.request.forEach(function(E){typeof E.runWhen=="function"&&E.runWhen(n)===!1||(f=f&&E.synchronous,u.unshift(E.fulfilled,E.rejected))});const h=[];this.interceptors.response.forEach(function(E){h.push(E.fulfilled,E.rejected)});let m,g=0,y;if(!f){const S=[S0.bind(this),void 0];for(S.unshift.apply(S,u),S.push.apply(S,h),y=S.length,m=Promise.resolve(n);g{if(!a._listeners)return;let s=a._listeners.length;for(;s-- >0;)a._listeners[s](o);a._listeners=null}),this.promise.then=o=>{let s;const c=new Promise(u=>{a.subscribe(u),s=u}).then(o);return c.cancel=function(){a.unsubscribe(s)},c},t(function(s,c,u){a.reason||(a.reason=new Io(s,c,u),n(a.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=a=>{t.abort(a)};return this.subscribe(n),t.signal.unsubscribe=()=>this.unsubscribe(n),t.signal}static source(){let t;return{token:new LE(function(o){t=o}),cancel:t}}};function fO(e){return function(n){return e.apply(null,n)}}function hO(e){return ce.isObject(e)&&e.isAxiosError===!0}const cm={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(cm).forEach(([e,t])=>{cm[t]=e});function zE(e){const t=new _i(e),n=dE(_i.prototype.request,t);return ce.extend(n,_i.prototype,t,{allOwnKeys:!0}),ce.extend(n,t,null,{allOwnKeys:!0}),n.create=function(o){return zE(Ci(e,o))},n}const kt=zE(bl);kt.Axios=_i;kt.CanceledError=Io;kt.CancelToken=dO;kt.isCancel=TE;kt.VERSION=jE;kt.toFormData=Zu;kt.AxiosError=Xe;kt.Cancel=kt.CanceledError;kt.all=function(t){return Promise.all(t)};kt.spread=fO;kt.isAxiosError=hO;kt.mergeConfig=Ci;kt.AxiosHeaders=wn;kt.formToJSON=e=>CE(ce.isHTMLForm(e)?new FormData(e):e);kt.getAdapter=OE.getAdapter;kt.HttpStatusCode=cm;kt.default=kt;const{Axios:R6,AxiosError:A6,CanceledError:D6,isCancel:k6,CancelToken:N6,VERSION:O6,all:j6,Cancel:L6,isAxiosError:z6,spread:M6,toFormData:P6,AxiosHeaders:G6,HttpStatusCode:F6,formToJSON:U6,getAdapter:B6,mergeConfig:I6}=kt,ME="Invalid API Key",PE="API Key required",fr=kt.create({baseURL:iE,headers:{"Content-Type":"application/json"}});fr.interceptors.request.use(e=>{const t=Ye.getState().apiKey;return t&&(e.headers["X-API-Key"]=t),e});fr.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 pO=async e=>(await fr.get(`/graphs?label=${e}`)).data,mO=async()=>(await fr.get("/graph/label/list")).data,gO=async()=>{try{return(await fr.get("/health")).data}catch(e){return{status:"error",message:Sr(e)}}},vO=async()=>(await fr.get("/documents")).data,yO=async()=>(await fr.post("/documents/scan")).data,bO=async e=>(await fr.post("/query",e)).data,xO=async(e,t,n)=>{try{let a="";if(await fr.post("/query/stream",e,{responseType:"text",headers:{Accept:"application/x-ndjson"},transformResponse:[o=>{a+=o;const s=a.split(` +`);a=s.pop()||"";for(const c of s)if(c.trim())try{const u=JSON.parse(c);u.response?t(u.response):u.error}catch(u){console.error("Error parsing stream chunk:",u)}return o}]}),a.trim())try{const o=JSON.parse(a);o.response?t(o.response):o.error}catch(o){console.error("Error parsing final chunk:",o)}}catch(a){const o=Sr(a);console.error("Stream request failed:",o)}},wO=async(e,t)=>{const n=new FormData;return n.append("file",e),(await fr.post("/documents/upload",n,{headers:{"Content-Type":"multipart/form-data"},onUploadProgress:t!==void 0?o=>{const s=Math.round(o.loaded*100/o.total);t(s)}:void 0})).data},EO=async()=>(await fr.delete("/documents")).data,SO=Qm()(e=>({health:!0,message:null,messageTitle:null,lastCheckTime:Date.now(),status:null,check:async()=>{const t=await gO();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})}})),En=tg(SO);/** + * @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 _O=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),GE=(...e)=>e.filter((t,n,a)=>!!t&&t.trim()!==""&&a.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 CO={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 TO=w.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:a,className:o="",children:s,iconNode:c,...u},f)=>w.createElement("svg",{ref:f,...CO,width:t,height:t,stroke:e,strokeWidth:a?Number(n)*24/Number(t):n,className:GE("lucide",o),...u},[...c.map(([h,m])=>w.createElement(h,m)),...Array.isArray(s)?s:[s]]));/** + * @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 ht=(e,t)=>{const n=w.forwardRef(({className:a,...o},s)=>w.createElement(TO,{ref:s,iconNode:t,className:GE(`lucide-${_O(e)}`,a),...o}));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 RO=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],ig=ht("Check",RO);/** + * @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 AO=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],og=ht("ChevronDown",AO);/** + * @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 DO=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],FE=ht("ChevronUp",DO);/** + * @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 kO=[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]],NO=ht("ChevronsUpDown",kO);/** + * @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 OO=[["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"}]],jO=ht("CircleAlert",OO);/** + * @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 LO=[["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"}]],UE=ht("Eraser",LO);/** + * @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 zO=[["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"}]],MO=ht("FileText",zO);/** + * @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 PO=[["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"}]],GO=ht("Files",PO);/** + * @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 FO=[["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"}]],UO=ht("Fullscreen",FO);/** + * @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 BO=[["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"}]],IO=ht("Github",BO);/** + * @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 HO=[["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"}]],$O=ht("Grip",HO);/** + * @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 VO=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],BE=ht("LoaderCircle",VO);/** + * @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 qO=[["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"}]],YO=ht("Loader",qO);/** + * @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 WO=[["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"}]],XO=ht("Maximize",WO);/** + * @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 KO=[["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"}]],ZO=ht("Minimize",KO);/** + * @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 QO=[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]],JO=ht("Moon",QO);/** + * @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 ej=[["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"}]],tj=ht("Pause",ej);/** + * @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 nj=[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]],rj=ht("Play",nj);/** + * @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 aj=[["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"}]],ij=ht("RefreshCw",aj);/** + * @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 oj=[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]],sj=ht("Search",oj);/** + * @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 lj=[["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"}]],cj=ht("Send",lj);/** + * @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 uj=[["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"}]],dj=ht("Settings",uj);/** + * @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 fj=[["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"}]],hj=ht("Sun",fj);/** + * @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 pj=[["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"}]],um=ht("Upload",pj);/** + * @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 mj=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],IE=ht("X",mj);/** + * @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 gj=[["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"}]],vj=ht("Zap",gj);/** + * @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 yj=[["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"}]],bj=ht("ZoomIn",yj);/** + * @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 xj=[["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"}]],wj=ht("ZoomOut",xj),Ej=()=>{const e=En.use.health(),t=En.use.message(),n=En.use.messageTitle(),[a,o]=w.useState(!1);return w.useEffect(()=>{setTimeout(()=>{o(!0)},50)},[]),x.jsxs(lE,{className:Oe("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",a?"translate-y-0 opacity-100":"-translate-y-20 opacity-0",!e&&"bg-red-700 text-white"),children:[!e&&x.jsx("div",{children:x.jsx(jO,{className:"size-4"})}),x.jsxs("div",{children:[x.jsx(cE,{className:"font-bold",children:n}),x.jsx(uE,{children:t})]})]})};function Sj(e,t){const n=w.createContext(t),a=s=>{const{children:c,...u}=s,f=w.useMemo(()=>u,Object.values(u));return x.jsx(n.Provider,{value:f,children:c})};a.displayName=e+"Provider";function o(s){const c=w.useContext(n);if(c)return c;if(t!==void 0)return t;throw new Error(`\`${s}\` must be used within \`${e}\``)}return[a,o]}function Kn(e,t=[]){let n=[];function a(s,c){const u=w.createContext(c),f=n.length;n=[...n,c];const h=g=>{var N;const{scope:y,children:b,...S}=g,E=((N=y==null?void 0:y[e])==null?void 0:N[f])||u,_=w.useMemo(()=>S,Object.values(S));return x.jsx(E.Provider,{value:_,children:b})};h.displayName=s+"Provider";function m(g,y){var E;const b=((E=y==null?void 0:y[e])==null?void 0:E[f])||u,S=w.useContext(b);if(S)return S;if(c!==void 0)return c;throw new Error(`\`${g}\` must be used within \`${s}\``)}return[h,m]}const o=()=>{const s=n.map(c=>w.createContext(c));return function(u){const f=(u==null?void 0:u[e])||s;return w.useMemo(()=>({[`__scope${e}`]:{...u,[e]:f}}),[u,f])}};return o.scopeName=e,[a,_j(o,...t)]}function _j(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const a=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(s){const c=a.reduce((u,{useScope:f,scopeName:h})=>{const g=f(s)[`__scope${h}`];return{...u,...g}},{});return w.useMemo(()=>({[`__scope${t.scopeName}`]:c}),[c])}};return n.scopeName=t.scopeName,n}function C0(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function HE(...e){return t=>{let n=!1;const a=e.map(o=>{const s=C0(o,t);return!n&&typeof s=="function"&&(n=!0),s});if(n)return()=>{for(let o=0;o{},Cj=SD.useId||(()=>{}),Tj=0;function on(e){const[t,n]=w.useState(Cj());return sn(()=>{n(a=>a??String(Tj++))},[e]),t?`radix-${t}`:""}function Zt(e){const t=w.useRef(e);return w.useEffect(()=>{t.current=e}),w.useMemo(()=>(...n)=>{var a;return(a=t.current)==null?void 0:a.call(t,...n)},[])}function aa({prop:e,defaultProp:t,onChange:n=()=>{}}){const[a,o]=Rj({defaultProp:t,onChange:n}),s=e!==void 0,c=s?e:a,u=Zt(n),f=w.useCallback(h=>{if(s){const g=typeof h=="function"?h(e):h;g!==e&&u(g)}else o(h)},[s,e,o,u]);return[c,f]}function Rj({defaultProp:e,onChange:t}){const n=w.useState(e),[a]=n,o=w.useRef(a),s=Zt(t);return w.useEffect(()=>{o.current!==a&&(s(a),o.current=a)},[a,o,s]),n}var xl=Y1();const $E=dn(xl);var Ba=w.forwardRef((e,t)=>{const{children:n,...a}=e,o=w.Children.toArray(n),s=o.find(Aj);if(s){const c=s.props.children,u=o.map(f=>f===s?w.Children.count(c)>1?w.Children.only(null):w.isValidElement(c)?c.props.children:null:f);return x.jsx(dm,{...a,ref:t,children:w.isValidElement(c)?w.cloneElement(c,void 0,u):null})}return x.jsx(dm,{...a,ref:t,children:n})});Ba.displayName="Slot";var dm=w.forwardRef((e,t)=>{const{children:n,...a}=e;if(w.isValidElement(n)){const o=kj(n),s=Dj(a,n.props);return n.type!==w.Fragment&&(s.ref=t?HE(t,o):o),w.cloneElement(n,s)}return w.Children.count(n)>1?w.Children.only(null):null});dm.displayName="SlotClone";var sg=({children:e})=>x.jsx(x.Fragment,{children:e});function Aj(e){return w.isValidElement(e)&&e.type===sg}function Dj(e,t){const n={...t};for(const a in t){const o=e[a],s=t[a];/^on[A-Z]/.test(a)?o&&s?n[a]=(...u)=>{s(...u),o(...u)}:o&&(n[a]=o):a==="style"?n[a]={...o,...s}:a==="className"&&(n[a]=[o,s].filter(Boolean).join(" "))}return{...e,...n}}function kj(e){var a,o;let t=(a=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:a.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Nj=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],Ie=Nj.reduce((e,t)=>{const n=w.forwardRef((a,o)=>{const{asChild:s,...c}=a,u=s?Ba:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),x.jsx(u,{...c,ref:o})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function Oj(e,t){e&&xl.flushSync(()=>e.dispatchEvent(t))}function jj(e,t=globalThis==null?void 0:globalThis.document){const n=Zt(e);w.useEffect(()=>{const a=o=>{o.key==="Escape"&&n(o)};return t.addEventListener("keydown",a,{capture:!0}),()=>t.removeEventListener("keydown",a,{capture:!0})},[n,t])}var Lj="DismissableLayer",fm="dismissableLayer.update",zj="dismissableLayer.pointerDownOutside",Mj="dismissableLayer.focusOutside",T0,VE=w.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),wl=w.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:a,onPointerDownOutside:o,onFocusOutside:s,onInteractOutside:c,onDismiss:u,...f}=e,h=w.useContext(VE),[m,g]=w.useState(null),y=(m==null?void 0:m.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,b]=w.useState({}),S=nt(t,R=>g(R)),E=Array.from(h.layers),[_]=[...h.layersWithOutsidePointerEventsDisabled].slice(-1),N=E.indexOf(_),C=m?E.indexOf(m):-1,A=h.layersWithOutsidePointerEventsDisabled.size>0,k=C>=N,D=Fj(R=>{const U=R.target,L=[...h.branches].some(I=>I.contains(U));!k||L||(o==null||o(R),c==null||c(R),R.defaultPrevented||u==null||u())},y),M=Uj(R=>{const U=R.target;[...h.branches].some(I=>I.contains(U))||(s==null||s(R),c==null||c(R),R.defaultPrevented||u==null||u())},y);return jj(R=>{C===h.layers.size-1&&(a==null||a(R),!R.defaultPrevented&&u&&(R.preventDefault(),u()))},y),w.useEffect(()=>{if(m)return n&&(h.layersWithOutsidePointerEventsDisabled.size===0&&(T0=y.body.style.pointerEvents,y.body.style.pointerEvents="none"),h.layersWithOutsidePointerEventsDisabled.add(m)),h.layers.add(m),R0(),()=>{n&&h.layersWithOutsidePointerEventsDisabled.size===1&&(y.body.style.pointerEvents=T0)}},[m,y,n,h]),w.useEffect(()=>()=>{m&&(h.layers.delete(m),h.layersWithOutsidePointerEventsDisabled.delete(m),R0())},[m,h]),w.useEffect(()=>{const R=()=>b({});return document.addEventListener(fm,R),()=>document.removeEventListener(fm,R)},[]),x.jsx(Ie.div,{...f,ref:S,style:{pointerEvents:A?k?"auto":"none":void 0,...e.style},onFocusCapture:Be(e.onFocusCapture,M.onFocusCapture),onBlurCapture:Be(e.onBlurCapture,M.onBlurCapture),onPointerDownCapture:Be(e.onPointerDownCapture,D.onPointerDownCapture)})});wl.displayName=Lj;var Pj="DismissableLayerBranch",Gj=w.forwardRef((e,t)=>{const n=w.useContext(VE),a=w.useRef(null),o=nt(t,a);return w.useEffect(()=>{const s=a.current;if(s)return n.branches.add(s),()=>{n.branches.delete(s)}},[n.branches]),x.jsx(Ie.div,{...e,ref:o})});Gj.displayName=Pj;function Fj(e,t=globalThis==null?void 0:globalThis.document){const n=Zt(e),a=w.useRef(!1),o=w.useRef(()=>{});return w.useEffect(()=>{const s=u=>{if(u.target&&!a.current){let f=function(){qE(zj,n,h,{discrete:!0})};const h={originalEvent:u};u.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=f,t.addEventListener("click",o.current,{once:!0})):f()}else t.removeEventListener("click",o.current);a.current=!1},c=window.setTimeout(()=>{t.addEventListener("pointerdown",s)},0);return()=>{window.clearTimeout(c),t.removeEventListener("pointerdown",s),t.removeEventListener("click",o.current)}},[t,n]),{onPointerDownCapture:()=>a.current=!0}}function Uj(e,t=globalThis==null?void 0:globalThis.document){const n=Zt(e),a=w.useRef(!1);return w.useEffect(()=>{const o=s=>{s.target&&!a.current&&qE(Mj,n,{originalEvent:s},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,n]),{onFocusCapture:()=>a.current=!0,onBlurCapture:()=>a.current=!1}}function R0(){const e=new CustomEvent(fm);document.dispatchEvent(e)}function qE(e,t,n,{discrete:a}){const o=n.originalEvent.target,s=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),a?Oj(o,s):o.dispatchEvent(s)}var Wh="focusScope.autoFocusOnMount",Xh="focusScope.autoFocusOnUnmount",A0={bubbles:!1,cancelable:!0},Bj="FocusScope",ed=w.forwardRef((e,t)=>{const{loop:n=!1,trapped:a=!1,onMountAutoFocus:o,onUnmountAutoFocus:s,...c}=e,[u,f]=w.useState(null),h=Zt(o),m=Zt(s),g=w.useRef(null),y=nt(t,E=>f(E)),b=w.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;w.useEffect(()=>{if(a){let E=function(A){if(b.paused||!u)return;const k=A.target;u.contains(k)?g.current=k:Ma(g.current,{select:!0})},_=function(A){if(b.paused||!u)return;const k=A.relatedTarget;k!==null&&(u.contains(k)||Ma(g.current,{select:!0}))},N=function(A){if(document.activeElement===document.body)for(const D of A)D.removedNodes.length>0&&Ma(u)};document.addEventListener("focusin",E),document.addEventListener("focusout",_);const C=new MutationObserver(N);return u&&C.observe(u,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",E),document.removeEventListener("focusout",_),C.disconnect()}}},[a,u,b.paused]),w.useEffect(()=>{if(u){k0.add(b);const E=document.activeElement;if(!u.contains(E)){const N=new CustomEvent(Wh,A0);u.addEventListener(Wh,h),u.dispatchEvent(N),N.defaultPrevented||(Ij(Yj(YE(u)),{select:!0}),document.activeElement===E&&Ma(u))}return()=>{u.removeEventListener(Wh,h),setTimeout(()=>{const N=new CustomEvent(Xh,A0);u.addEventListener(Xh,m),u.dispatchEvent(N),N.defaultPrevented||Ma(E??document.body,{select:!0}),u.removeEventListener(Xh,m),k0.remove(b)},0)}}},[u,h,m,b]);const S=w.useCallback(E=>{if(!n&&!a||b.paused)return;const _=E.key==="Tab"&&!E.altKey&&!E.ctrlKey&&!E.metaKey,N=document.activeElement;if(_&&N){const C=E.currentTarget,[A,k]=Hj(C);A&&k?!E.shiftKey&&N===k?(E.preventDefault(),n&&Ma(A,{select:!0})):E.shiftKey&&N===A&&(E.preventDefault(),n&&Ma(k,{select:!0})):N===C&&E.preventDefault()}},[n,a,b.paused]);return x.jsx(Ie.div,{tabIndex:-1,...c,ref:y,onKeyDown:S})});ed.displayName=Bj;function Ij(e,{select:t=!1}={}){const n=document.activeElement;for(const a of e)if(Ma(a,{select:t}),document.activeElement!==n)return}function Hj(e){const t=YE(e),n=D0(t,e),a=D0(t.reverse(),e);return[n,a]}function YE(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:a=>{const o=a.tagName==="INPUT"&&a.type==="hidden";return a.disabled||a.hidden||o?NodeFilter.FILTER_SKIP:a.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function D0(e,t){for(const n of e)if(!$j(n,{upTo:t}))return n}function $j(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 Vj(e){return e instanceof HTMLInputElement&&"select"in e}function Ma(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&Vj(e)&&t&&e.select()}}var k0=qj();function qj(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=N0(e,t),e.unshift(t)},remove(t){var n;e=N0(e,t),(n=e[0])==null||n.resume()}}}function N0(e,t){const n=[...e],a=n.indexOf(t);return a!==-1&&n.splice(a,1),n}function Yj(e){return e.filter(t=>t.tagName!=="A")}var Wj="Portal",td=w.forwardRef((e,t)=>{var u;const{container:n,...a}=e,[o,s]=w.useState(!1);sn(()=>s(!0),[]);const c=n||o&&((u=globalThis==null?void 0:globalThis.document)==null?void 0:u.body);return c?$E.createPortal(x.jsx(Ie.div,{...a,ref:t}),c):null});td.displayName=Wj;function Xj(e,t){return w.useReducer((n,a)=>t[n][a]??n,e)}var zn=e=>{const{present:t,children:n}=e,a=Kj(t),o=typeof n=="function"?n({present:a.isPresent}):w.Children.only(n),s=nt(a.ref,Zj(o));return typeof n=="function"||a.isPresent?w.cloneElement(o,{ref:s}):null};zn.displayName="Presence";function Kj(e){const[t,n]=w.useState(),a=w.useRef({}),o=w.useRef(e),s=w.useRef("none"),c=e?"mounted":"unmounted",[u,f]=Xj(c,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return w.useEffect(()=>{const h=Bc(a.current);s.current=u==="mounted"?h:"none"},[u]),sn(()=>{const h=a.current,m=o.current;if(m!==e){const y=s.current,b=Bc(h);e?f("MOUNT"):b==="none"||(h==null?void 0:h.display)==="none"?f("UNMOUNT"):f(m&&y!==b?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,f]),sn(()=>{if(t){let h;const m=t.ownerDocument.defaultView??window,g=b=>{const E=Bc(a.current).includes(b.animationName);if(b.target===t&&E&&(f("ANIMATION_END"),!o.current)){const _=t.style.animationFillMode;t.style.animationFillMode="forwards",h=m.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=_)})}},y=b=>{b.target===t&&(s.current=Bc(a.current))};return t.addEventListener("animationstart",y),t.addEventListener("animationcancel",g),t.addEventListener("animationend",g),()=>{m.clearTimeout(h),t.removeEventListener("animationstart",y),t.removeEventListener("animationcancel",g),t.removeEventListener("animationend",g)}}else f("ANIMATION_END")},[t,f]),{isPresent:["mounted","unmountSuspended"].includes(u),ref:w.useCallback(h=>{h&&(a.current=getComputedStyle(h)),n(h)},[])}}function Bc(e){return(e==null?void 0:e.animationName)||"none"}function Zj(e){var a,o;let t=(a=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:a.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Kh=0;function lg(){w.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??O0()),document.body.insertAdjacentElement("beforeend",e[1]??O0()),Kh++,()=>{Kh===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Kh--}},[])}function O0(){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 wr=function(){return wr=Object.assign||function(t){for(var n,a=1,o=arguments.length;a"u")return pL;var t=mL(e),n=document.documentElement.clientWidth,a=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,a-n+t[2]-t[0])}},vL=ZE(),Ro="data-scroll-locked",yL=function(e,t,n,a){var o=e.left,s=e.top,c=e.right,u=e.gap;return n===void 0&&(n="margin"),` + .`.concat(Jj,` { + overflow: hidden `).concat(a,`; + padding-right: `).concat(u,"px ").concat(a,`; + } + body[`).concat(Ro,`] { + overflow: hidden `).concat(a,`; + overscroll-behavior: contain; + `).concat([t&&"position: relative ".concat(a,";"),n==="margin"&&` + padding-left: `.concat(o,`px; + padding-top: `).concat(s,`px; + padding-right: `).concat(c,`px; + margin-left:0; + margin-top:0; + margin-right: `).concat(u,"px ").concat(a,`; + `),n==="padding"&&"padding-right: ".concat(u,"px ").concat(a,";")].filter(Boolean).join(""),` + } + + .`).concat(fu,` { + right: `).concat(u,"px ").concat(a,`; + } + + .`).concat(hu,` { + margin-right: `).concat(u,"px ").concat(a,`; + } + + .`).concat(fu," .").concat(fu,` { + right: 0 `).concat(a,`; + } + + .`).concat(hu," .").concat(hu,` { + margin-right: 0 `).concat(a,`; + } + + body[`).concat(Ro,`] { + `).concat(eL,": ").concat(u,`px; + } +`)},L0=function(){var e=parseInt(document.body.getAttribute(Ro)||"0",10);return isFinite(e)?e:0},bL=function(){w.useEffect(function(){return document.body.setAttribute(Ro,(L0()+1).toString()),function(){var e=L0()-1;e<=0?document.body.removeAttribute(Ro):document.body.setAttribute(Ro,e.toString())}},[])},xL=function(e){var t=e.noRelative,n=e.noImportant,a=e.gapMode,o=a===void 0?"margin":a;bL();var s=w.useMemo(function(){return gL(o)},[o]);return w.createElement(vL,{styles:yL(s,!t,o,n?"":"!important")})},hm=!1;if(typeof window<"u")try{var Ic=Object.defineProperty({},"passive",{get:function(){return hm=!0,!0}});window.addEventListener("test",Ic,Ic),window.removeEventListener("test",Ic,Ic)}catch{hm=!1}var bo=hm?{passive:!1}:!1,wL=function(e){return e.tagName==="TEXTAREA"},QE=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!wL(e)&&n[t]==="visible")},EL=function(e){return QE(e,"overflowY")},SL=function(e){return QE(e,"overflowX")},z0=function(e,t){var n=t.ownerDocument,a=t;do{typeof ShadowRoot<"u"&&a instanceof ShadowRoot&&(a=a.host);var o=JE(e,a);if(o){var s=eS(e,a),c=s[1],u=s[2];if(c>u)return!0}a=a.parentNode}while(a&&a!==n.body);return!1},_L=function(e){var t=e.scrollTop,n=e.scrollHeight,a=e.clientHeight;return[t,n,a]},CL=function(e){var t=e.scrollLeft,n=e.scrollWidth,a=e.clientWidth;return[t,n,a]},JE=function(e,t){return e==="v"?EL(t):SL(t)},eS=function(e,t){return e==="v"?_L(t):CL(t)},TL=function(e,t){return e==="h"&&t==="rtl"?-1:1},RL=function(e,t,n,a,o){var s=TL(e,window.getComputedStyle(t).direction),c=s*a,u=n.target,f=t.contains(u),h=!1,m=c>0,g=0,y=0;do{var b=eS(e,u),S=b[0],E=b[1],_=b[2],N=E-_-s*S;(S||N)&&JE(e,u)&&(g+=N,y+=S),u instanceof ShadowRoot?u=u.host:u=u.parentNode}while(!f&&u!==document.body||f&&(t.contains(u)||t===u));return(m&&Math.abs(g)<1||!m&&Math.abs(y)<1)&&(h=!0),h},Hc=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},M0=function(e){return[e.deltaX,e.deltaY]},P0=function(e){return e&&"current"in e?e.current:e},AL=function(e,t){return e[0]===t[0]&&e[1]===t[1]},DL=function(e){return` + .block-interactivity-`.concat(e,` {pointer-events: none;} + .allow-interactivity-`).concat(e,` {pointer-events: all;} +`)},kL=0,xo=[];function NL(e){var t=w.useRef([]),n=w.useRef([0,0]),a=w.useRef(),o=w.useState(kL++)[0],s=w.useState(ZE)[0],c=w.useRef(e);w.useEffect(function(){c.current=e},[e]),w.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var E=Qj([e.lockRef.current],(e.shards||[]).map(P0),!0).filter(Boolean);return E.forEach(function(_){return _.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),E.forEach(function(_){return _.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var u=w.useCallback(function(E,_){if("touches"in E&&E.touches.length===2||E.type==="wheel"&&E.ctrlKey)return!c.current.allowPinchZoom;var N=Hc(E),C=n.current,A="deltaX"in E?E.deltaX:C[0]-N[0],k="deltaY"in E?E.deltaY:C[1]-N[1],D,M=E.target,R=Math.abs(A)>Math.abs(k)?"h":"v";if("touches"in E&&R==="h"&&M.type==="range")return!1;var U=z0(R,M);if(!U)return!0;if(U?D=R:(D=R==="v"?"h":"v",U=z0(R,M)),!U)return!1;if(!a.current&&"changedTouches"in E&&(A||k)&&(a.current=D),!D)return!0;var L=a.current||D;return RL(L,_,E,L==="h"?A:k)},[]),f=w.useCallback(function(E){var _=E;if(!(!xo.length||xo[xo.length-1]!==s)){var N="deltaY"in _?M0(_):Hc(_),C=t.current.filter(function(D){return D.name===_.type&&(D.target===_.target||_.target===D.shadowParent)&&AL(D.delta,N)})[0];if(C&&C.should){_.cancelable&&_.preventDefault();return}if(!C){var A=(c.current.shards||[]).map(P0).filter(Boolean).filter(function(D){return D.contains(_.target)}),k=A.length>0?u(_,A[0]):!c.current.noIsolation;k&&_.cancelable&&_.preventDefault()}}},[]),h=w.useCallback(function(E,_,N,C){var A={name:E,delta:_,target:N,should:C,shadowParent:OL(N)};t.current.push(A),setTimeout(function(){t.current=t.current.filter(function(k){return k!==A})},1)},[]),m=w.useCallback(function(E){n.current=Hc(E),a.current=void 0},[]),g=w.useCallback(function(E){h(E.type,M0(E),E.target,u(E,e.lockRef.current))},[]),y=w.useCallback(function(E){h(E.type,Hc(E),E.target,u(E,e.lockRef.current))},[]);w.useEffect(function(){return xo.push(s),e.setCallbacks({onScrollCapture:g,onWheelCapture:g,onTouchMoveCapture:y}),document.addEventListener("wheel",f,bo),document.addEventListener("touchmove",f,bo),document.addEventListener("touchstart",m,bo),function(){xo=xo.filter(function(E){return E!==s}),document.removeEventListener("wheel",f,bo),document.removeEventListener("touchmove",f,bo),document.removeEventListener("touchstart",m,bo)}},[]);var b=e.removeScrollBar,S=e.inert;return w.createElement(w.Fragment,null,S?w.createElement(s,{styles:DL(o)}):null,b?w.createElement(xL,{gapMode:e.gapMode}):null)}function OL(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const jL=sL(KE,NL);var rd=w.forwardRef(function(e,t){return w.createElement(nd,wr({},e,{ref:t,sideCar:jL}))});rd.classNames=nd.classNames;var LL=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},wo=new WeakMap,$c=new WeakMap,Vc={},ep=0,tS=function(e){return e&&(e.host||tS(e.parentNode))},zL=function(e,t){return t.map(function(n){if(e.contains(n))return n;var a=tS(n);return a&&e.contains(a)?a:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},ML=function(e,t,n,a){var o=zL(t,Array.isArray(e)?e:[e]);Vc[n]||(Vc[n]=new WeakMap);var s=Vc[n],c=[],u=new Set,f=new Set(o),h=function(g){!g||u.has(g)||(u.add(g),h(g.parentNode))};o.forEach(h);var m=function(g){!g||f.has(g)||Array.prototype.forEach.call(g.children,function(y){if(u.has(y))m(y);else try{var b=y.getAttribute(a),S=b!==null&&b!=="false",E=(wo.get(y)||0)+1,_=(s.get(y)||0)+1;wo.set(y,E),s.set(y,_),c.push(y),E===1&&S&&$c.set(y,!0),_===1&&y.setAttribute(n,"true"),S||y.setAttribute(a,"true")}catch(N){console.error("aria-hidden: cannot operate on ",y,N)}})};return m(t),u.clear(),ep++,function(){c.forEach(function(g){var y=wo.get(g)-1,b=s.get(g)-1;wo.set(g,y),s.set(g,b),y||($c.has(g)||g.removeAttribute(a),$c.delete(g)),b||g.removeAttribute(n)}),ep--,ep||(wo=new WeakMap,wo=new WeakMap,$c=new WeakMap,Vc={})}},cg=function(e,t,n){n===void 0&&(n="data-aria-hidden");var a=Array.from(Array.isArray(e)?e:[e]),o=LL(e);return o?(a.push.apply(a,Array.from(o.querySelectorAll("[aria-live]"))),ML(a,o,n,"aria-hidden")):function(){return null}},ug="Dialog",[nS,rS]=Kn(ug),[PL,hr]=nS(ug),aS=e=>{const{__scopeDialog:t,children:n,open:a,defaultOpen:o,onOpenChange:s,modal:c=!0}=e,u=w.useRef(null),f=w.useRef(null),[h=!1,m]=aa({prop:a,defaultProp:o,onChange:s});return x.jsx(PL,{scope:t,triggerRef:u,contentRef:f,contentId:on(),titleId:on(),descriptionId:on(),open:h,onOpenChange:m,onOpenToggle:w.useCallback(()=>m(g=>!g),[m]),modal:c,children:n})};aS.displayName=ug;var iS="DialogTrigger",oS=w.forwardRef((e,t)=>{const{__scopeDialog:n,...a}=e,o=hr(iS,n),s=nt(t,o.triggerRef);return x.jsx(Ie.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":hg(o.open),...a,ref:s,onClick:Be(e.onClick,o.onOpenToggle)})});oS.displayName=iS;var dg="DialogPortal",[GL,sS]=nS(dg,{forceMount:void 0}),lS=e=>{const{__scopeDialog:t,forceMount:n,children:a,container:o}=e,s=hr(dg,t);return x.jsx(GL,{scope:t,forceMount:n,children:w.Children.map(a,c=>x.jsx(zn,{present:n||s.open,children:x.jsx(td,{asChild:!0,container:o,children:c})}))})};lS.displayName=dg;var Ru="DialogOverlay",cS=w.forwardRef((e,t)=>{const n=sS(Ru,e.__scopeDialog),{forceMount:a=n.forceMount,...o}=e,s=hr(Ru,e.__scopeDialog);return s.modal?x.jsx(zn,{present:a||s.open,children:x.jsx(FL,{...o,ref:t})}):null});cS.displayName=Ru;var FL=w.forwardRef((e,t)=>{const{__scopeDialog:n,...a}=e,o=hr(Ru,n);return x.jsx(rd,{as:Ba,allowPinchZoom:!0,shards:[o.contentRef],children:x.jsx(Ie.div,{"data-state":hg(o.open),...a,ref:t,style:{pointerEvents:"auto",...a.style}})})}),Ti="DialogContent",uS=w.forwardRef((e,t)=>{const n=sS(Ti,e.__scopeDialog),{forceMount:a=n.forceMount,...o}=e,s=hr(Ti,e.__scopeDialog);return x.jsx(zn,{present:a||s.open,children:s.modal?x.jsx(UL,{...o,ref:t}):x.jsx(BL,{...o,ref:t})})});uS.displayName=Ti;var UL=w.forwardRef((e,t)=>{const n=hr(Ti,e.__scopeDialog),a=w.useRef(null),o=nt(t,n.contentRef,a);return w.useEffect(()=>{const s=a.current;if(s)return cg(s)},[]),x.jsx(dS,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Be(e.onCloseAutoFocus,s=>{var c;s.preventDefault(),(c=n.triggerRef.current)==null||c.focus()}),onPointerDownOutside:Be(e.onPointerDownOutside,s=>{const c=s.detail.originalEvent,u=c.button===0&&c.ctrlKey===!0;(c.button===2||u)&&s.preventDefault()}),onFocusOutside:Be(e.onFocusOutside,s=>s.preventDefault())})}),BL=w.forwardRef((e,t)=>{const n=hr(Ti,e.__scopeDialog),a=w.useRef(!1),o=w.useRef(!1);return x.jsx(dS,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:s=>{var c,u;(c=e.onCloseAutoFocus)==null||c.call(e,s),s.defaultPrevented||(a.current||(u=n.triggerRef.current)==null||u.focus(),s.preventDefault()),a.current=!1,o.current=!1},onInteractOutside:s=>{var f,h;(f=e.onInteractOutside)==null||f.call(e,s),s.defaultPrevented||(a.current=!0,s.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const c=s.target;((h=n.triggerRef.current)==null?void 0:h.contains(c))&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&o.current&&s.preventDefault()}})}),dS=w.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:a,onOpenAutoFocus:o,onCloseAutoFocus:s,...c}=e,u=hr(Ti,n),f=w.useRef(null),h=nt(t,f);return lg(),x.jsxs(x.Fragment,{children:[x.jsx(ed,{asChild:!0,loop:!0,trapped:a,onMountAutoFocus:o,onUnmountAutoFocus:s,children:x.jsx(wl,{role:"dialog",id:u.contentId,"aria-describedby":u.descriptionId,"aria-labelledby":u.titleId,"data-state":hg(u.open),...c,ref:h,onDismiss:()=>u.onOpenChange(!1)})}),x.jsxs(x.Fragment,{children:[x.jsx(HL,{titleId:u.titleId}),x.jsx(VL,{contentRef:f,descriptionId:u.descriptionId})]})]})}),fg="DialogTitle",fS=w.forwardRef((e,t)=>{const{__scopeDialog:n,...a}=e,o=hr(fg,n);return x.jsx(Ie.h2,{id:o.titleId,...a,ref:t})});fS.displayName=fg;var hS="DialogDescription",pS=w.forwardRef((e,t)=>{const{__scopeDialog:n,...a}=e,o=hr(hS,n);return x.jsx(Ie.p,{id:o.descriptionId,...a,ref:t})});pS.displayName=hS;var mS="DialogClose",gS=w.forwardRef((e,t)=>{const{__scopeDialog:n,...a}=e,o=hr(mS,n);return x.jsx(Ie.button,{type:"button",...a,ref:t,onClick:Be(e.onClick,()=>o.onOpenChange(!1))})});gS.displayName=mS;function hg(e){return e?"open":"closed"}var vS="DialogTitleWarning",[IL,yS]=Sj(vS,{contentName:Ti,titleName:fg,docsSlug:"dialog"}),HL=({titleId:e})=>{const t=yS(vS),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 w.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},$L="DialogDescriptionWarning",VL=({contentRef:e,descriptionId:t})=>{const a=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${yS($L).contentName}}.`;return w.useEffect(()=>{var s;const o=(s=e.current)==null?void 0:s.getAttribute("aria-describedby");t&&o&&(document.getElementById(t)||console.warn(a))},[a,e,t]),null},pg=aS,bS=oS,mg=lS,ad=cS,id=uS,gg=fS,vg=pS,yg=gS,xS="AlertDialog",[qL,H6]=Kn(xS,[rS]),sa=rS(),wS=e=>{const{__scopeAlertDialog:t,...n}=e,a=sa(t);return x.jsx(pg,{...a,...n,modal:!0})};wS.displayName=xS;var YL="AlertDialogTrigger",WL=w.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...a}=e,o=sa(n);return x.jsx(bS,{...o,...a,ref:t})});WL.displayName=YL;var XL="AlertDialogPortal",ES=e=>{const{__scopeAlertDialog:t,...n}=e,a=sa(t);return x.jsx(mg,{...a,...n})};ES.displayName=XL;var KL="AlertDialogOverlay",SS=w.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...a}=e,o=sa(n);return x.jsx(ad,{...o,...a,ref:t})});SS.displayName=KL;var Ao="AlertDialogContent",[ZL,QL]=qL(Ao),_S=w.forwardRef((e,t)=>{const{__scopeAlertDialog:n,children:a,...o}=e,s=sa(n),c=w.useRef(null),u=nt(t,c),f=w.useRef(null);return x.jsx(IL,{contentName:Ao,titleName:CS,docsSlug:"alert-dialog",children:x.jsx(ZL,{scope:n,cancelRef:f,children:x.jsxs(id,{role:"alertdialog",...s,...o,ref:u,onOpenAutoFocus:Be(o.onOpenAutoFocus,h=>{var m;h.preventDefault(),(m=f.current)==null||m.focus({preventScroll:!0})}),onPointerDownOutside:h=>h.preventDefault(),onInteractOutside:h=>h.preventDefault(),children:[x.jsx(sg,{children:a}),x.jsx(ez,{contentRef:c})]})})})});_S.displayName=Ao;var CS="AlertDialogTitle",TS=w.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...a}=e,o=sa(n);return x.jsx(gg,{...o,...a,ref:t})});TS.displayName=CS;var RS="AlertDialogDescription",AS=w.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...a}=e,o=sa(n);return x.jsx(vg,{...o,...a,ref:t})});AS.displayName=RS;var JL="AlertDialogAction",DS=w.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...a}=e,o=sa(n);return x.jsx(yg,{...o,...a,ref:t})});DS.displayName=JL;var kS="AlertDialogCancel",NS=w.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...a}=e,{cancelRef:o}=QL(kS,n),s=sa(n),c=nt(t,o);return x.jsx(yg,{...s,...a,ref:c})});NS.displayName=kS;var ez=({contentRef:e})=>{const t=`\`${Ao}\` requires a description for the component to be accessible for screen reader users. + +You can add a description to the \`${Ao}\` by passing a \`${RS}\` 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 \`${Ao}\`. 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 w.useEffect(()=>{var a;document.getElementById((a=e.current)==null?void 0:a.getAttribute("aria-describedby"))||console.warn(t)},[t,e]),null},tz=wS,nz=ES,OS=SS,jS=_S,LS=DS,zS=NS,MS=TS,PS=AS;const rz=["top","right","bottom","left"],Ia=Math.min,On=Math.max,Au=Math.round,qc=Math.floor,Cr=e=>({x:e,y:e}),az={left:"right",right:"left",bottom:"top",top:"bottom"},iz={start:"end",end:"start"};function pm(e,t,n){return On(e,Ia(t,n))}function ia(e,t){return typeof e=="function"?e(t):e}function oa(e){return e.split("-")[0]}function Ho(e){return e.split("-")[1]}function bg(e){return e==="x"?"y":"x"}function xg(e){return e==="y"?"height":"width"}function Ha(e){return["top","bottom"].includes(oa(e))?"y":"x"}function wg(e){return bg(Ha(e))}function oz(e,t,n){n===void 0&&(n=!1);const a=Ho(e),o=wg(e),s=xg(o);let c=o==="x"?a===(n?"end":"start")?"right":"left":a==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(c=Du(c)),[c,Du(c)]}function sz(e){const t=Du(e);return[mm(e),t,mm(t)]}function mm(e){return e.replace(/start|end/g,t=>iz[t])}function lz(e,t,n){const a=["left","right"],o=["right","left"],s=["top","bottom"],c=["bottom","top"];switch(e){case"top":case"bottom":return n?t?o:a:t?a:o;case"left":case"right":return t?s:c;default:return[]}}function cz(e,t,n,a){const o=Ho(e);let s=lz(oa(e),n==="start",a);return o&&(s=s.map(c=>c+"-"+o),t&&(s=s.concat(s.map(mm)))),s}function Du(e){return e.replace(/left|right|bottom|top/g,t=>az[t])}function uz(e){return{top:0,right:0,bottom:0,left:0,...e}}function GS(e){return typeof e!="number"?uz(e):{top:e,right:e,bottom:e,left:e}}function ku(e){const{x:t,y:n,width:a,height:o}=e;return{width:a,height:o,top:n,left:t,right:t+a,bottom:n+o,x:t,y:n}}function G0(e,t,n){let{reference:a,floating:o}=e;const s=Ha(t),c=wg(t),u=xg(c),f=oa(t),h=s==="y",m=a.x+a.width/2-o.width/2,g=a.y+a.height/2-o.height/2,y=a[u]/2-o[u]/2;let b;switch(f){case"top":b={x:m,y:a.y-o.height};break;case"bottom":b={x:m,y:a.y+a.height};break;case"right":b={x:a.x+a.width,y:g};break;case"left":b={x:a.x-o.width,y:g};break;default:b={x:a.x,y:a.y}}switch(Ho(t)){case"start":b[c]-=y*(n&&h?-1:1);break;case"end":b[c]+=y*(n&&h?-1:1);break}return b}const dz=async(e,t,n)=>{const{placement:a="bottom",strategy:o="absolute",middleware:s=[],platform:c}=n,u=s.filter(Boolean),f=await(c.isRTL==null?void 0:c.isRTL(t));let h=await c.getElementRects({reference:e,floating:t,strategy:o}),{x:m,y:g}=G0(h,a,f),y=a,b={},S=0;for(let E=0;E({name:"arrow",options:e,async fn(t){const{x:n,y:a,placement:o,rects:s,platform:c,elements:u,middlewareData:f}=t,{element:h,padding:m=0}=ia(e,t)||{};if(h==null)return{};const g=GS(m),y={x:n,y:a},b=wg(o),S=xg(b),E=await c.getDimensions(h),_=b==="y",N=_?"top":"left",C=_?"bottom":"right",A=_?"clientHeight":"clientWidth",k=s.reference[S]+s.reference[b]-y[b]-s.floating[S],D=y[b]-s.reference[b],M=await(c.getOffsetParent==null?void 0:c.getOffsetParent(h));let R=M?M[A]:0;(!R||!await(c.isElement==null?void 0:c.isElement(M)))&&(R=u.floating[A]||s.floating[S]);const U=k/2-D/2,L=R/2-E[S]/2-1,I=Ia(g[N],L),q=Ia(g[C],L),Y=I,B=R-E[S]-q,X=R/2-E[S]/2+U,ne=pm(Y,X,B),F=!f.arrow&&Ho(o)!=null&&X!==ne&&s.reference[S]/2-(XX<=0)){var q,Y;const X=(((q=s.flip)==null?void 0:q.index)||0)+1,ne=R[X];if(ne)return{data:{index:X,overflows:I},reset:{placement:ne}};let F=(Y=I.filter(z=>z.overflows[0]<=0).sort((z,j)=>z.overflows[1]-j.overflows[1])[0])==null?void 0:Y.placement;if(!F)switch(b){case"bestFit":{var B;const z=(B=I.filter(j=>{if(M){const K=Ha(j.placement);return K===C||K==="y"}return!0}).map(j=>[j.placement,j.overflows.filter(K=>K>0).reduce((K,G)=>K+G,0)]).sort((j,K)=>j[1]-K[1])[0])==null?void 0:B[0];z&&(F=z);break}case"initialPlacement":F=u;break}if(o!==F)return{reset:{placement:F}}}return{}}}};function F0(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function U0(e){return rz.some(t=>e[t]>=0)}const pz=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:a="referenceHidden",...o}=ia(e,t);switch(a){case"referenceHidden":{const s=await cl(t,{...o,elementContext:"reference"}),c=F0(s,n.reference);return{data:{referenceHiddenOffsets:c,referenceHidden:U0(c)}}}case"escaped":{const s=await cl(t,{...o,altBoundary:!0}),c=F0(s,n.floating);return{data:{escapedOffsets:c,escaped:U0(c)}}}default:return{}}}}};async function mz(e,t){const{placement:n,platform:a,elements:o}=e,s=await(a.isRTL==null?void 0:a.isRTL(o.floating)),c=oa(n),u=Ho(n),f=Ha(n)==="y",h=["left","top"].includes(c)?-1:1,m=s&&f?-1:1,g=ia(t,e);let{mainAxis:y,crossAxis:b,alignmentAxis:S}=typeof g=="number"?{mainAxis:g,crossAxis:0,alignmentAxis:null}:{mainAxis:g.mainAxis||0,crossAxis:g.crossAxis||0,alignmentAxis:g.alignmentAxis};return u&&typeof S=="number"&&(b=u==="end"?S*-1:S),f?{x:b*m,y:y*h}:{x:y*h,y:b*m}}const gz=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,a;const{x:o,y:s,placement:c,middlewareData:u}=t,f=await mz(t,e);return c===((n=u.offset)==null?void 0:n.placement)&&(a=u.arrow)!=null&&a.alignmentOffset?{}:{x:o+f.x,y:s+f.y,data:{...f,placement:c}}}}},vz=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:a,placement:o}=t,{mainAxis:s=!0,crossAxis:c=!1,limiter:u={fn:_=>{let{x:N,y:C}=_;return{x:N,y:C}}},...f}=ia(e,t),h={x:n,y:a},m=await cl(t,f),g=Ha(oa(o)),y=bg(g);let b=h[y],S=h[g];if(s){const _=y==="y"?"top":"left",N=y==="y"?"bottom":"right",C=b+m[_],A=b-m[N];b=pm(C,b,A)}if(c){const _=g==="y"?"top":"left",N=g==="y"?"bottom":"right",C=S+m[_],A=S-m[N];S=pm(C,S,A)}const E=u.fn({...t,[y]:b,[g]:S});return{...E,data:{x:E.x-n,y:E.y-a,enabled:{[y]:s,[g]:c}}}}}},yz=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:a,placement:o,rects:s,middlewareData:c}=t,{offset:u=0,mainAxis:f=!0,crossAxis:h=!0}=ia(e,t),m={x:n,y:a},g=Ha(o),y=bg(g);let b=m[y],S=m[g];const E=ia(u,t),_=typeof E=="number"?{mainAxis:E,crossAxis:0}:{mainAxis:0,crossAxis:0,...E};if(f){const A=y==="y"?"height":"width",k=s.reference[y]-s.floating[A]+_.mainAxis,D=s.reference[y]+s.reference[A]-_.mainAxis;bD&&(b=D)}if(h){var N,C;const A=y==="y"?"width":"height",k=["top","left"].includes(oa(o)),D=s.reference[g]-s.floating[A]+(k&&((N=c.offset)==null?void 0:N[g])||0)+(k?0:_.crossAxis),M=s.reference[g]+s.reference[A]+(k?0:((C=c.offset)==null?void 0:C[g])||0)-(k?_.crossAxis:0);SM&&(S=M)}return{[y]:b,[g]:S}}}},bz=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,a;const{placement:o,rects:s,platform:c,elements:u}=t,{apply:f=()=>{},...h}=ia(e,t),m=await cl(t,h),g=oa(o),y=Ho(o),b=Ha(o)==="y",{width:S,height:E}=s.floating;let _,N;g==="top"||g==="bottom"?(_=g,N=y===(await(c.isRTL==null?void 0:c.isRTL(u.floating))?"start":"end")?"left":"right"):(N=g,_=y==="end"?"top":"bottom");const C=E-m.top-m.bottom,A=S-m.left-m.right,k=Ia(E-m[_],C),D=Ia(S-m[N],A),M=!t.middlewareData.shift;let R=k,U=D;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(U=A),(a=t.middlewareData.shift)!=null&&a.enabled.y&&(R=C),M&&!y){const I=On(m.left,0),q=On(m.right,0),Y=On(m.top,0),B=On(m.bottom,0);b?U=S-2*(I!==0||q!==0?I+q:On(m.left,m.right)):R=E-2*(Y!==0||B!==0?Y+B:On(m.top,m.bottom))}await f({...t,availableWidth:U,availableHeight:R});const L=await c.getDimensions(u.floating);return S!==L.width||E!==L.height?{reset:{rects:!0}}:{}}}};function od(){return typeof window<"u"}function $o(e){return FS(e)?(e.nodeName||"").toLowerCase():"#document"}function Ln(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Rr(e){var t;return(t=(FS(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function FS(e){return od()?e instanceof Node||e instanceof Ln(e).Node:!1}function cr(e){return od()?e instanceof Element||e instanceof Ln(e).Element:!1}function Tr(e){return od()?e instanceof HTMLElement||e instanceof Ln(e).HTMLElement:!1}function B0(e){return!od()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Ln(e).ShadowRoot}function El(e){const{overflow:t,overflowX:n,overflowY:a,display:o}=ur(e);return/auto|scroll|overlay|hidden|clip/.test(t+a+n)&&!["inline","contents"].includes(o)}function xz(e){return["table","td","th"].includes($o(e))}function sd(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function Eg(e){const t=Sg(),n=cr(e)?ur(e):e;return["transform","translate","scale","rotate","perspective"].some(a=>n[a]?n[a]!=="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(a=>(n.willChange||"").includes(a))||["paint","layout","strict","content"].some(a=>(n.contain||"").includes(a))}function wz(e){let t=$a(e);for(;Tr(t)&&!Oo(t);){if(Eg(t))return t;if(sd(t))return null;t=$a(t)}return null}function Sg(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Oo(e){return["html","body","#document"].includes($o(e))}function ur(e){return Ln(e).getComputedStyle(e)}function ld(e){return cr(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function $a(e){if($o(e)==="html")return e;const t=e.assignedSlot||e.parentNode||B0(e)&&e.host||Rr(e);return B0(t)?t.host:t}function US(e){const t=$a(e);return Oo(t)?e.ownerDocument?e.ownerDocument.body:e.body:Tr(t)&&El(t)?t:US(t)}function ul(e,t,n){var a;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=US(e),s=o===((a=e.ownerDocument)==null?void 0:a.body),c=Ln(o);if(s){const u=gm(c);return t.concat(c,c.visualViewport||[],El(o)?o:[],u&&n?ul(u):[])}return t.concat(o,ul(o,[],n))}function gm(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function BS(e){const t=ur(e);let n=parseFloat(t.width)||0,a=parseFloat(t.height)||0;const o=Tr(e),s=o?e.offsetWidth:n,c=o?e.offsetHeight:a,u=Au(n)!==s||Au(a)!==c;return u&&(n=s,a=c),{width:n,height:a,$:u}}function _g(e){return cr(e)?e:e.contextElement}function Do(e){const t=_g(e);if(!Tr(t))return Cr(1);const n=t.getBoundingClientRect(),{width:a,height:o,$:s}=BS(t);let c=(s?Au(n.width):n.width)/a,u=(s?Au(n.height):n.height)/o;return(!c||!Number.isFinite(c))&&(c=1),(!u||!Number.isFinite(u))&&(u=1),{x:c,y:u}}const Ez=Cr(0);function IS(e){const t=Ln(e);return!Sg()||!t.visualViewport?Ez:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Sz(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Ln(e)?!1:t}function Ri(e,t,n,a){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),s=_g(e);let c=Cr(1);t&&(a?cr(a)&&(c=Do(a)):c=Do(e));const u=Sz(s,n,a)?IS(s):Cr(0);let f=(o.left+u.x)/c.x,h=(o.top+u.y)/c.y,m=o.width/c.x,g=o.height/c.y;if(s){const y=Ln(s),b=a&&cr(a)?Ln(a):a;let S=y,E=gm(S);for(;E&&a&&b!==S;){const _=Do(E),N=E.getBoundingClientRect(),C=ur(E),A=N.left+(E.clientLeft+parseFloat(C.paddingLeft))*_.x,k=N.top+(E.clientTop+parseFloat(C.paddingTop))*_.y;f*=_.x,h*=_.y,m*=_.x,g*=_.y,f+=A,h+=k,S=Ln(E),E=gm(S)}}return ku({width:m,height:g,x:f,y:h})}function Cg(e,t){const n=ld(e).scrollLeft;return t?t.left+n:Ri(Rr(e)).left+n}function HS(e,t,n){n===void 0&&(n=!1);const a=e.getBoundingClientRect(),o=a.left+t.scrollLeft-(n?0:Cg(e,a)),s=a.top+t.scrollTop;return{x:o,y:s}}function _z(e){let{elements:t,rect:n,offsetParent:a,strategy:o}=e;const s=o==="fixed",c=Rr(a),u=t?sd(t.floating):!1;if(a===c||u&&s)return n;let f={scrollLeft:0,scrollTop:0},h=Cr(1);const m=Cr(0),g=Tr(a);if((g||!g&&!s)&&(($o(a)!=="body"||El(c))&&(f=ld(a)),Tr(a))){const b=Ri(a);h=Do(a),m.x=b.x+a.clientLeft,m.y=b.y+a.clientTop}const y=c&&!g&&!s?HS(c,f,!0):Cr(0);return{width:n.width*h.x,height:n.height*h.y,x:n.x*h.x-f.scrollLeft*h.x+m.x+y.x,y:n.y*h.y-f.scrollTop*h.y+m.y+y.y}}function Cz(e){return Array.from(e.getClientRects())}function Tz(e){const t=Rr(e),n=ld(e),a=e.ownerDocument.body,o=On(t.scrollWidth,t.clientWidth,a.scrollWidth,a.clientWidth),s=On(t.scrollHeight,t.clientHeight,a.scrollHeight,a.clientHeight);let c=-n.scrollLeft+Cg(e);const u=-n.scrollTop;return ur(a).direction==="rtl"&&(c+=On(t.clientWidth,a.clientWidth)-o),{width:o,height:s,x:c,y:u}}function Rz(e,t){const n=Ln(e),a=Rr(e),o=n.visualViewport;let s=a.clientWidth,c=a.clientHeight,u=0,f=0;if(o){s=o.width,c=o.height;const h=Sg();(!h||h&&t==="fixed")&&(u=o.offsetLeft,f=o.offsetTop)}return{width:s,height:c,x:u,y:f}}function Az(e,t){const n=Ri(e,!0,t==="fixed"),a=n.top+e.clientTop,o=n.left+e.clientLeft,s=Tr(e)?Do(e):Cr(1),c=e.clientWidth*s.x,u=e.clientHeight*s.y,f=o*s.x,h=a*s.y;return{width:c,height:u,x:f,y:h}}function I0(e,t,n){let a;if(t==="viewport")a=Rz(e,n);else if(t==="document")a=Tz(Rr(e));else if(cr(t))a=Az(t,n);else{const o=IS(e);a={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return ku(a)}function $S(e,t){const n=$a(e);return n===t||!cr(n)||Oo(n)?!1:ur(n).position==="fixed"||$S(n,t)}function Dz(e,t){const n=t.get(e);if(n)return n;let a=ul(e,[],!1).filter(u=>cr(u)&&$o(u)!=="body"),o=null;const s=ur(e).position==="fixed";let c=s?$a(e):e;for(;cr(c)&&!Oo(c);){const u=ur(c),f=Eg(c);!f&&u.position==="fixed"&&(o=null),(s?!f&&!o:!f&&u.position==="static"&&!!o&&["absolute","fixed"].includes(o.position)||El(c)&&!f&&$S(e,c))?a=a.filter(m=>m!==c):o=u,c=$a(c)}return t.set(e,a),a}function kz(e){let{element:t,boundary:n,rootBoundary:a,strategy:o}=e;const c=[...n==="clippingAncestors"?sd(t)?[]:Dz(t,this._c):[].concat(n),a],u=c[0],f=c.reduce((h,m)=>{const g=I0(t,m,o);return h.top=On(g.top,h.top),h.right=Ia(g.right,h.right),h.bottom=Ia(g.bottom,h.bottom),h.left=On(g.left,h.left),h},I0(t,u,o));return{width:f.right-f.left,height:f.bottom-f.top,x:f.left,y:f.top}}function Nz(e){const{width:t,height:n}=BS(e);return{width:t,height:n}}function Oz(e,t,n){const a=Tr(t),o=Rr(t),s=n==="fixed",c=Ri(e,!0,s,t);let u={scrollLeft:0,scrollTop:0};const f=Cr(0);if(a||!a&&!s)if(($o(t)!=="body"||El(o))&&(u=ld(t)),a){const y=Ri(t,!0,s,t);f.x=y.x+t.clientLeft,f.y=y.y+t.clientTop}else o&&(f.x=Cg(o));const h=o&&!a&&!s?HS(o,u):Cr(0),m=c.left+u.scrollLeft-f.x-h.x,g=c.top+u.scrollTop-f.y-h.y;return{x:m,y:g,width:c.width,height:c.height}}function tp(e){return ur(e).position==="static"}function H0(e,t){if(!Tr(e)||ur(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Rr(e)===n&&(n=n.ownerDocument.body),n}function VS(e,t){const n=Ln(e);if(sd(e))return n;if(!Tr(e)){let o=$a(e);for(;o&&!Oo(o);){if(cr(o)&&!tp(o))return o;o=$a(o)}return n}let a=H0(e,t);for(;a&&xz(a)&&tp(a);)a=H0(a,t);return a&&Oo(a)&&tp(a)&&!Eg(a)?n:a||wz(e)||n}const jz=async function(e){const t=this.getOffsetParent||VS,n=this.getDimensions,a=await n(e.floating);return{reference:Oz(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:a.width,height:a.height}}};function Lz(e){return ur(e).direction==="rtl"}const zz={convertOffsetParentRelativeRectToViewportRelativeRect:_z,getDocumentElement:Rr,getClippingRect:kz,getOffsetParent:VS,getElementRects:jz,getClientRects:Cz,getDimensions:Nz,getScale:Do,isElement:cr,isRTL:Lz};function qS(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Mz(e,t){let n=null,a;const o=Rr(e);function s(){var u;clearTimeout(a),(u=n)==null||u.disconnect(),n=null}function c(u,f){u===void 0&&(u=!1),f===void 0&&(f=1),s();const h=e.getBoundingClientRect(),{left:m,top:g,width:y,height:b}=h;if(u||t(),!y||!b)return;const S=qc(g),E=qc(o.clientWidth-(m+y)),_=qc(o.clientHeight-(g+b)),N=qc(m),A={rootMargin:-S+"px "+-E+"px "+-_+"px "+-N+"px",threshold:On(0,Ia(1,f))||1};let k=!0;function D(M){const R=M[0].intersectionRatio;if(R!==f){if(!k)return c();R?c(!1,R):a=setTimeout(()=>{c(!1,1e-7)},1e3)}R===1&&!qS(h,e.getBoundingClientRect())&&c(),k=!1}try{n=new IntersectionObserver(D,{...A,root:o.ownerDocument})}catch{n=new IntersectionObserver(D,A)}n.observe(e)}return c(!0),s}function Pz(e,t,n,a){a===void 0&&(a={});const{ancestorScroll:o=!0,ancestorResize:s=!0,elementResize:c=typeof ResizeObserver=="function",layoutShift:u=typeof IntersectionObserver=="function",animationFrame:f=!1}=a,h=_g(e),m=o||s?[...h?ul(h):[],...ul(t)]:[];m.forEach(N=>{o&&N.addEventListener("scroll",n,{passive:!0}),s&&N.addEventListener("resize",n)});const g=h&&u?Mz(h,n):null;let y=-1,b=null;c&&(b=new ResizeObserver(N=>{let[C]=N;C&&C.target===h&&b&&(b.unobserve(t),cancelAnimationFrame(y),y=requestAnimationFrame(()=>{var A;(A=b)==null||A.observe(t)})),n()}),h&&!f&&b.observe(h),b.observe(t));let S,E=f?Ri(e):null;f&&_();function _(){const N=Ri(e);E&&!qS(E,N)&&n(),E=N,S=requestAnimationFrame(_)}return n(),()=>{var N;m.forEach(C=>{o&&C.removeEventListener("scroll",n),s&&C.removeEventListener("resize",n)}),g==null||g(),(N=b)==null||N.disconnect(),b=null,f&&cancelAnimationFrame(S)}}const Gz=gz,Fz=vz,Uz=hz,Bz=bz,Iz=pz,$0=fz,Hz=yz,$z=(e,t,n)=>{const a=new Map,o={platform:zz,...n},s={...o.platform,_c:a};return dz(e,t,{...o,platform:s})};var pu=typeof document<"u"?w.useLayoutEffect:w.useEffect;function Nu(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,a,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(a=n;a--!==0;)if(!Nu(e[a],t[a]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(a=n;a--!==0;)if(!{}.hasOwnProperty.call(t,o[a]))return!1;for(a=n;a--!==0;){const s=o[a];if(!(s==="_owner"&&e.$$typeof)&&!Nu(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function YS(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function V0(e,t){const n=YS(e);return Math.round(t*n)/n}function np(e){const t=w.useRef(e);return pu(()=>{t.current=e}),t}function Vz(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:a=[],platform:o,elements:{reference:s,floating:c}={},transform:u=!0,whileElementsMounted:f,open:h}=e,[m,g]=w.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[y,b]=w.useState(a);Nu(y,a)||b(a);const[S,E]=w.useState(null),[_,N]=w.useState(null),C=w.useCallback(j=>{j!==M.current&&(M.current=j,E(j))},[]),A=w.useCallback(j=>{j!==R.current&&(R.current=j,N(j))},[]),k=s||S,D=c||_,M=w.useRef(null),R=w.useRef(null),U=w.useRef(m),L=f!=null,I=np(f),q=np(o),Y=np(h),B=w.useCallback(()=>{if(!M.current||!R.current)return;const j={placement:t,strategy:n,middleware:y};q.current&&(j.platform=q.current),$z(M.current,R.current,j).then(K=>{const G={...K,isPositioned:Y.current!==!1};X.current&&!Nu(U.current,G)&&(U.current=G,xl.flushSync(()=>{g(G)}))})},[y,t,n,q,Y]);pu(()=>{h===!1&&U.current.isPositioned&&(U.current.isPositioned=!1,g(j=>({...j,isPositioned:!1})))},[h]);const X=w.useRef(!1);pu(()=>(X.current=!0,()=>{X.current=!1}),[]),pu(()=>{if(k&&(M.current=k),D&&(R.current=D),k&&D){if(I.current)return I.current(k,D,B);B()}},[k,D,B,I,L]);const ne=w.useMemo(()=>({reference:M,floating:R,setReference:C,setFloating:A}),[C,A]),F=w.useMemo(()=>({reference:k,floating:D}),[k,D]),z=w.useMemo(()=>{const j={position:n,left:0,top:0};if(!F.floating)return j;const K=V0(F.floating,m.x),G=V0(F.floating,m.y);return u?{...j,transform:"translate("+K+"px, "+G+"px)",...YS(F.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:K,top:G}},[n,u,F.floating,m.x,m.y]);return w.useMemo(()=>({...m,update:B,refs:ne,elements:F,floatingStyles:z}),[m,B,ne,F,z])}const qz=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:a,padding:o}=typeof e=="function"?e(n):e;return a&&t(a)?a.current!=null?$0({element:a.current,padding:o}).fn(n):{}:a?$0({element:a,padding:o}).fn(n):{}}}},Yz=(e,t)=>({...Gz(e),options:[e,t]}),Wz=(e,t)=>({...Fz(e),options:[e,t]}),Xz=(e,t)=>({...Hz(e),options:[e,t]}),Kz=(e,t)=>({...Uz(e),options:[e,t]}),Zz=(e,t)=>({...Bz(e),options:[e,t]}),Qz=(e,t)=>({...Iz(e),options:[e,t]}),Jz=(e,t)=>({...qz(e),options:[e,t]});var eM="Arrow",WS=w.forwardRef((e,t)=>{const{children:n,width:a=10,height:o=5,...s}=e;return x.jsx(Ie.svg,{...s,ref:t,width:a,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:x.jsx("polygon",{points:"0,0 30,0 15,10"})})});WS.displayName=eM;var tM=WS;function XS(e){const[t,n]=w.useState(void 0);return sn(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const a=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const s=o[0];let c,u;if("borderBoxSize"in s){const f=s.borderBoxSize,h=Array.isArray(f)?f[0]:f;c=h.inlineSize,u=h.blockSize}else c=e.offsetWidth,u=e.offsetHeight;n({width:c,height:u})});return a.observe(e,{box:"border-box"}),()=>a.unobserve(e)}else n(void 0)},[e]),t}var Tg="Popper",[KS,Vo]=Kn(Tg),[nM,ZS]=KS(Tg),QS=e=>{const{__scopePopper:t,children:n}=e,[a,o]=w.useState(null);return x.jsx(nM,{scope:t,anchor:a,onAnchorChange:o,children:n})};QS.displayName=Tg;var JS="PopperAnchor",e_=w.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:a,...o}=e,s=ZS(JS,n),c=w.useRef(null),u=nt(t,c);return w.useEffect(()=>{s.onAnchorChange((a==null?void 0:a.current)||c.current)}),a?null:x.jsx(Ie.div,{...o,ref:u})});e_.displayName=JS;var Rg="PopperContent",[rM,aM]=KS(Rg),t_=w.forwardRef((e,t)=>{var ie,oe,Ce,he,Se,be;const{__scopePopper:n,side:a="bottom",sideOffset:o=0,align:s="center",alignOffset:c=0,arrowPadding:u=0,avoidCollisions:f=!0,collisionBoundary:h=[],collisionPadding:m=0,sticky:g="partial",hideWhenDetached:y=!1,updatePositionStrategy:b="optimized",onPlaced:S,...E}=e,_=ZS(Rg,n),[N,C]=w.useState(null),A=nt(t,Le=>C(Le)),[k,D]=w.useState(null),M=XS(k),R=(M==null?void 0:M.width)??0,U=(M==null?void 0:M.height)??0,L=a+(s!=="center"?"-"+s:""),I=typeof m=="number"?m:{top:0,right:0,bottom:0,left:0,...m},q=Array.isArray(h)?h:[h],Y=q.length>0,B={padding:I,boundary:q.filter(oM),altBoundary:Y},{refs:X,floatingStyles:ne,placement:F,isPositioned:z,middlewareData:j}=Vz({strategy:"fixed",placement:L,whileElementsMounted:(...Le)=>Pz(...Le,{animationFrame:b==="always"}),elements:{reference:_.anchor},middleware:[Yz({mainAxis:o+U,alignmentAxis:c}),f&&Wz({mainAxis:!0,crossAxis:!1,limiter:g==="partial"?Xz():void 0,...B}),f&&Kz({...B}),Zz({...B,apply:({elements:Le,rects:Te,availableWidth:ye,availableHeight:J})=>{const{width:le,height:_e}=Te.reference,pe=Le.floating.style;pe.setProperty("--radix-popper-available-width",`${ye}px`),pe.setProperty("--radix-popper-available-height",`${J}px`),pe.setProperty("--radix-popper-anchor-width",`${le}px`),pe.setProperty("--radix-popper-anchor-height",`${_e}px`)}}),k&&Jz({element:k,padding:u}),sM({arrowWidth:R,arrowHeight:U}),y&&Qz({strategy:"referenceHidden",...B})]}),[K,G]=a_(F),H=Zt(S);sn(()=>{z&&(H==null||H())},[z,H]);const O=(ie=j.arrow)==null?void 0:ie.x,$=(oe=j.arrow)==null?void 0:oe.y,W=((Ce=j.arrow)==null?void 0:Ce.centerOffset)!==0,[re,de]=w.useState();return sn(()=>{N&&de(window.getComputedStyle(N).zIndex)},[N]),x.jsx("div",{ref:X.setFloating,"data-radix-popper-content-wrapper":"",style:{...ne,transform:z?ne.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:re,"--radix-popper-transform-origin":[(he=j.transformOrigin)==null?void 0:he.x,(Se=j.transformOrigin)==null?void 0:Se.y].join(" "),...((be=j.hide)==null?void 0:be.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:x.jsx(rM,{scope:n,placedSide:K,onArrowChange:D,arrowX:O,arrowY:$,shouldHideArrow:W,children:x.jsx(Ie.div,{"data-side":K,"data-align":G,...E,ref:A,style:{...E.style,animation:z?void 0:"none"}})})})});t_.displayName=Rg;var n_="PopperArrow",iM={top:"bottom",right:"left",bottom:"top",left:"right"},r_=w.forwardRef(function(t,n){const{__scopePopper:a,...o}=t,s=aM(n_,a),c=iM[s.placedSide];return x.jsx("span",{ref:s.onArrowChange,style:{position:"absolute",left:s.arrowX,top:s.arrowY,[c]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[s.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[s.placedSide],visibility:s.shouldHideArrow?"hidden":void 0},children:x.jsx(tM,{...o,ref:n,style:{...o.style,display:"block"}})})});r_.displayName=n_;function oM(e){return e!==null}var sM=e=>({name:"transformOrigin",options:e,fn(t){var _,N,C;const{placement:n,rects:a,middlewareData:o}=t,c=((_=o.arrow)==null?void 0:_.centerOffset)!==0,u=c?0:e.arrowWidth,f=c?0:e.arrowHeight,[h,m]=a_(n),g={start:"0%",center:"50%",end:"100%"}[m],y=(((N=o.arrow)==null?void 0:N.x)??0)+u/2,b=(((C=o.arrow)==null?void 0:C.y)??0)+f/2;let S="",E="";return h==="bottom"?(S=c?g:`${y}px`,E=`${-f}px`):h==="top"?(S=c?g:`${y}px`,E=`${a.floating.height+f}px`):h==="right"?(S=`${-f}px`,E=c?g:`${b}px`):h==="left"&&(S=`${a.floating.width+f}px`,E=c?g:`${b}px`),{data:{x:S,y:E}}}});function a_(e){const[t,n="center"]=e.split("-");return[t,n]}var Ag=QS,cd=e_,Dg=t_,kg=r_,lM="VisuallyHidden",Ng=w.forwardRef((e,t)=>x.jsx(Ie.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}}));Ng.displayName=lM;var cM=Ng,[ud,$6]=Kn("Tooltip",[Vo]),dd=Vo(),i_="TooltipProvider",uM=700,vm="tooltip.open",[dM,Og]=ud(i_),o_=e=>{const{__scopeTooltip:t,delayDuration:n=uM,skipDelayDuration:a=300,disableHoverableContent:o=!1,children:s}=e,[c,u]=w.useState(!0),f=w.useRef(!1),h=w.useRef(0);return w.useEffect(()=>{const m=h.current;return()=>window.clearTimeout(m)},[]),x.jsx(dM,{scope:t,isOpenDelayed:c,delayDuration:n,onOpen:w.useCallback(()=>{window.clearTimeout(h.current),u(!1)},[]),onClose:w.useCallback(()=>{window.clearTimeout(h.current),h.current=window.setTimeout(()=>u(!0),a)},[a]),isPointerInTransitRef:f,onPointerInTransitChange:w.useCallback(m=>{f.current=m},[]),disableHoverableContent:o,children:s})};o_.displayName=i_;var fd="Tooltip",[fM,hd]=ud(fd),s_=e=>{const{__scopeTooltip:t,children:n,open:a,defaultOpen:o=!1,onOpenChange:s,disableHoverableContent:c,delayDuration:u}=e,f=Og(fd,e.__scopeTooltip),h=dd(t),[m,g]=w.useState(null),y=on(),b=w.useRef(0),S=c??f.disableHoverableContent,E=u??f.delayDuration,_=w.useRef(!1),[N=!1,C]=aa({prop:a,defaultProp:o,onChange:R=>{R?(f.onOpen(),document.dispatchEvent(new CustomEvent(vm))):f.onClose(),s==null||s(R)}}),A=w.useMemo(()=>N?_.current?"delayed-open":"instant-open":"closed",[N]),k=w.useCallback(()=>{window.clearTimeout(b.current),b.current=0,_.current=!1,C(!0)},[C]),D=w.useCallback(()=>{window.clearTimeout(b.current),b.current=0,C(!1)},[C]),M=w.useCallback(()=>{window.clearTimeout(b.current),b.current=window.setTimeout(()=>{_.current=!0,C(!0),b.current=0},E)},[E,C]);return w.useEffect(()=>()=>{b.current&&(window.clearTimeout(b.current),b.current=0)},[]),x.jsx(Ag,{...h,children:x.jsx(fM,{scope:t,contentId:y,open:N,stateAttribute:A,trigger:m,onTriggerChange:g,onTriggerEnter:w.useCallback(()=>{f.isOpenDelayed?M():k()},[f.isOpenDelayed,M,k]),onTriggerLeave:w.useCallback(()=>{S?D():(window.clearTimeout(b.current),b.current=0)},[D,S]),onOpen:k,onClose:D,disableHoverableContent:S,children:n})})};s_.displayName=fd;var ym="TooltipTrigger",l_=w.forwardRef((e,t)=>{const{__scopeTooltip:n,...a}=e,o=hd(ym,n),s=Og(ym,n),c=dd(n),u=w.useRef(null),f=nt(t,u,o.onTriggerChange),h=w.useRef(!1),m=w.useRef(!1),g=w.useCallback(()=>h.current=!1,[]);return w.useEffect(()=>()=>document.removeEventListener("pointerup",g),[g]),x.jsx(cd,{asChild:!0,...c,children:x.jsx(Ie.button,{"aria-describedby":o.open?o.contentId:void 0,"data-state":o.stateAttribute,...a,ref:f,onPointerMove:Be(e.onPointerMove,y=>{y.pointerType!=="touch"&&!m.current&&!s.isPointerInTransitRef.current&&(o.onTriggerEnter(),m.current=!0)}),onPointerLeave:Be(e.onPointerLeave,()=>{o.onTriggerLeave(),m.current=!1}),onPointerDown:Be(e.onPointerDown,()=>{h.current=!0,document.addEventListener("pointerup",g,{once:!0})}),onFocus:Be(e.onFocus,()=>{h.current||o.onOpen()}),onBlur:Be(e.onBlur,o.onClose),onClick:Be(e.onClick,o.onClose)})})});l_.displayName=ym;var hM="TooltipPortal",[V6,pM]=ud(hM,{forceMount:void 0}),jo="TooltipContent",c_=w.forwardRef((e,t)=>{const n=pM(jo,e.__scopeTooltip),{forceMount:a=n.forceMount,side:o="top",...s}=e,c=hd(jo,e.__scopeTooltip);return x.jsx(zn,{present:a||c.open,children:c.disableHoverableContent?x.jsx(u_,{side:o,...s,ref:t}):x.jsx(mM,{side:o,...s,ref:t})})}),mM=w.forwardRef((e,t)=>{const n=hd(jo,e.__scopeTooltip),a=Og(jo,e.__scopeTooltip),o=w.useRef(null),s=nt(t,o),[c,u]=w.useState(null),{trigger:f,onClose:h}=n,m=o.current,{onPointerInTransitChange:g}=a,y=w.useCallback(()=>{u(null),g(!1)},[g]),b=w.useCallback((S,E)=>{const _=S.currentTarget,N={x:S.clientX,y:S.clientY},C=bM(N,_.getBoundingClientRect()),A=xM(N,C),k=wM(E.getBoundingClientRect()),D=SM([...A,...k]);u(D),g(!0)},[g]);return w.useEffect(()=>()=>y(),[y]),w.useEffect(()=>{if(f&&m){const S=_=>b(_,m),E=_=>b(_,f);return f.addEventListener("pointerleave",S),m.addEventListener("pointerleave",E),()=>{f.removeEventListener("pointerleave",S),m.removeEventListener("pointerleave",E)}}},[f,m,b,y]),w.useEffect(()=>{if(c){const S=E=>{const _=E.target,N={x:E.clientX,y:E.clientY},C=(f==null?void 0:f.contains(_))||(m==null?void 0:m.contains(_)),A=!EM(N,c);C?y():A&&(y(),h())};return document.addEventListener("pointermove",S),()=>document.removeEventListener("pointermove",S)}},[f,m,c,h,y]),x.jsx(u_,{...e,ref:s})}),[gM,vM]=ud(fd,{isInside:!1}),u_=w.forwardRef((e,t)=>{const{__scopeTooltip:n,children:a,"aria-label":o,onEscapeKeyDown:s,onPointerDownOutside:c,...u}=e,f=hd(jo,n),h=dd(n),{onClose:m}=f;return w.useEffect(()=>(document.addEventListener(vm,m),()=>document.removeEventListener(vm,m)),[m]),w.useEffect(()=>{if(f.trigger){const g=y=>{const b=y.target;b!=null&&b.contains(f.trigger)&&m()};return window.addEventListener("scroll",g,{capture:!0}),()=>window.removeEventListener("scroll",g,{capture:!0})}},[f.trigger,m]),x.jsx(wl,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:g=>g.preventDefault(),onDismiss:m,children:x.jsxs(Dg,{"data-state":f.stateAttribute,...h,...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:[x.jsx(sg,{children:a}),x.jsx(gM,{scope:n,isInside:!0,children:x.jsx(cM,{id:f.contentId,role:"tooltip",children:o||a})})]})})});c_.displayName=jo;var d_="TooltipArrow",yM=w.forwardRef((e,t)=>{const{__scopeTooltip:n,...a}=e,o=dd(n);return vM(d_,n).isInside?null:x.jsx(kg,{...o,...a,ref:t})});yM.displayName=d_;function bM(e,t){const n=Math.abs(t.top-e.y),a=Math.abs(t.bottom-e.y),o=Math.abs(t.right-e.x),s=Math.abs(t.left-e.x);switch(Math.min(n,a,o,s)){case s:return"left";case o:return"right";case n:return"top";case a:return"bottom";default:throw new Error("unreachable")}}function xM(e,t,n=5){const a=[];switch(t){case"top":a.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":a.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":a.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":a.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return a}function wM(e){const{top:t,right:n,bottom:a,left:o}=e;return[{x:o,y:t},{x:n,y:t},{x:n,y:a},{x:o,y:a}]}function EM(e,t){const{x:n,y:a}=e;let o=!1;for(let s=0,c=t.length-1;sa!=m>a&&n<(h-u)*(a-f)/(m-f)+u&&(o=!o)}return o}function SM(e){const t=e.slice();return t.sort((n,a)=>n.xa.x?1:n.ya.y?1:0),_M(t)}function _M(e){if(e.length<=1)return e.slice();const t=[];for(let a=0;a=2;){const s=t[t.length-1],c=t[t.length-2];if((s.x-c.x)*(o.y-c.y)>=(s.y-c.y)*(o.x-c.x))t.pop();else break}t.push(o)}t.pop();const n=[];for(let a=e.length-1;a>=0;a--){const o=e[a];for(;n.length>=2;){const s=n[n.length-1],c=n[n.length-2];if((s.x-c.x)*(o.y-c.y)>=(s.y-c.y)*(o.x-c.x))n.pop();else break}n.push(o)}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 CM=o_,TM=s_,RM=l_,f_=c_;const h_=CM,p_=TM,m_=RM,AM=e=>typeof e!="string"?e:e.split("\\n").map((t,n)=>x.jsxs(w.Fragment,{children:[t,nx.jsx(f_,{ref:o,sideOffset:t,className:Oe("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),...a,children:typeof n=="string"?AM(n):n}));jg.displayName=f_.displayName;const Ou=sE("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"}}),wt=w.forwardRef(({className:e,variant:t,tooltip:n,size:a,side:o="right",asChild:s=!1,...c},u)=>{const f=s?Ba:"button";return n?x.jsx(h_,{children:x.jsxs(p_,{children:[x.jsx(m_,{asChild:!0,children:x.jsx(f,{className:Oe(Ou({variant:t,size:a,className:e}),"cursor-pointer"),ref:u,...c})}),x.jsx(jg,{side:o,children:n})]})}):x.jsx(f,{className:Oe(Ou({variant:t,size:a,className:e}),"cursor-pointer"),ref:u,...c})});wt.displayName="Button";const DM=tz,kM=nz,g_=w.forwardRef(({className:e,...t},n)=>x.jsx(OS,{className:Oe("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}));g_.displayName=OS.displayName;const v_=w.forwardRef(({className:e,...t},n)=>x.jsxs(kM,{children:[x.jsx(g_,{}),x.jsx(jS,{ref:n,className:Oe("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})]}));v_.displayName=jS.displayName;const y_=({className:e,...t})=>x.jsx("div",{className:Oe("flex flex-col space-y-2 text-center sm:text-left",e),...t});y_.displayName="AlertDialogHeader";const b_=w.forwardRef(({className:e,...t},n)=>x.jsx(MS,{ref:n,className:Oe("text-lg font-semibold",e),...t}));b_.displayName=MS.displayName;const x_=w.forwardRef(({className:e,...t},n)=>x.jsx(PS,{ref:n,className:Oe("text-muted-foreground text-sm",e),...t}));x_.displayName=PS.displayName;const NM=w.forwardRef(({className:e,...t},n)=>x.jsx(LS,{ref:n,className:Oe(Ou(),e),...t}));NM.displayName=LS.displayName;const OM=w.forwardRef(({className:e,...t},n)=>x.jsx(zS,{ref:n,className:Oe(Ou({variant:"outline"}),"mt-2 sm:mt-0",e),...t}));OM.displayName=zS.displayName;const Ai=w.forwardRef(({className:e,type:t,...n},a)=>x.jsx("input",{type:t,className:Oe("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:a,...n}));Ai.displayName="Input";var jM=e=>{switch(e){case"success":return MM;case"info":return GM;case"warning":return PM;case"error":return FM;default:return null}},LM=Array(12).fill(0),zM=({visible:e,className:t})=>ve.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},ve.createElement("div",{className:"sonner-spinner"},LM.map((n,a)=>ve.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${a}`})))),MM=ve.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},ve.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"})),PM=ve.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},ve.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"})),GM=ve.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},ve.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"})),FM=ve.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},ve.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"})),UM=ve.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"},ve.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),ve.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),BM=()=>{let[e,t]=ve.useState(document.hidden);return ve.useEffect(()=>{let n=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),e},bm=1,IM=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,...a}=e,o=typeof(e==null?void 0:e.id)=="number"||((t=e.id)==null?void 0:t.length)>0?e.id:bm++,s=this.toasts.find(u=>u.id===o),c=e.dismissible===void 0?!0:e.dismissible;return this.dismissedToasts.has(o)&&this.dismissedToasts.delete(o),s?this.toasts=this.toasts.map(u=>u.id===o?(this.publish({...u,...e,id:o,title:n}),{...u,...e,id:o,dismissible:c,title:n}):u):this.addToast({title:n,...a,dismissible:c,id:o}),o},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 a=e instanceof Promise?e:e(),o=n!==void 0,s,c=a.then(async f=>{if(s=["resolve",f],ve.isValidElement(f))o=!1,this.create({id:n,type:"default",message:f});else if($M(f)&&!f.ok){o=!1;let h=typeof t.error=="function"?await t.error(`HTTP error! status: ${f.status}`):t.error,m=typeof t.description=="function"?await t.description(`HTTP error! status: ${f.status}`):t.description;this.create({id:n,type:"error",message:h,description:m})}else if(t.success!==void 0){o=!1;let h=typeof t.success=="function"?await t.success(f):t.success,m=typeof t.description=="function"?await t.description(f):t.description;this.create({id:n,type:"success",message:h,description:m})}}).catch(async f=>{if(s=["reject",f],t.error!==void 0){o=!1;let h=typeof t.error=="function"?await t.error(f):t.error,m=typeof t.description=="function"?await t.description(f):t.description;this.create({id:n,type:"error",message:h,description:m})}}).finally(()=>{var f;o&&(this.dismiss(n),n=void 0),(f=t.finally)==null||f.call(t)}),u=()=>new Promise((f,h)=>c.then(()=>s[0]==="reject"?h(s[1]):f(s[1])).catch(h));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)||bm++;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}},xn=new IM,HM=(e,t)=>{let n=(t==null?void 0:t.id)||bm++;return xn.addToast({title:e,...t,id:n}),n},$M=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",VM=HM,qM=()=>xn.toasts,YM=()=>xn.getActiveToasts(),an=Object.assign(VM,{success:xn.success,info:xn.info,warning:xn.warning,error:xn.error,custom:xn.custom,message:xn.message,promise:xn.promise,dismiss:xn.dismiss,loading:xn.loading},{getHistory:qM,getToasts:YM});function WM(e,{insertAt:t}={}){if(typeof document>"u")return;let n=document.head||document.getElementsByTagName("head")[0],a=document.createElement("style");a.type="text/css",t==="top"&&n.firstChild?n.insertBefore(a,n.firstChild):n.appendChild(a),a.styleSheet?a.styleSheet.cssText=e:a.appendChild(document.createTextNode(e))}WM(`: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 Yc(e){return e.label!==void 0}var XM=3,KM="32px",ZM="16px",q0=4e3,QM=356,JM=14,eP=20,tP=200;function ar(...e){return e.filter(Boolean).join(" ")}function nP(e){let[t,n]=e.split("-"),a=[];return t&&a.push(t),n&&a.push(n),a}var rP=e=>{var t,n,a,o,s,c,u,f,h,m,g;let{invert:y,toast:b,unstyled:S,interacting:E,setHeights:_,visibleToasts:N,heights:C,index:A,toasts:k,expanded:D,removeToast:M,defaultRichColors:R,closeButton:U,style:L,cancelButtonStyle:I,actionButtonStyle:q,className:Y="",descriptionClassName:B="",duration:X,position:ne,gap:F,loadingIcon:z,expandByDefault:j,classNames:K,icons:G,closeButtonAriaLabel:H="Close toast",pauseWhenPageIsHidden:O}=e,[$,W]=ve.useState(null),[re,de]=ve.useState(null),[ie,oe]=ve.useState(!1),[Ce,he]=ve.useState(!1),[Se,be]=ve.useState(!1),[Le,Te]=ve.useState(!1),[ye,J]=ve.useState(!1),[le,_e]=ve.useState(0),[pe,Ee]=ve.useState(0),te=ve.useRef(b.duration||X||q0),Fe=ve.useRef(null),Pe=ve.useRef(null),me=A===0,Ae=A+1<=N,je=b.type,He=b.dismissible!==!1,it=b.className||"",Ct=b.descriptionClassName||"",bt=ve.useMemo(()=>C.findIndex(qe=>qe.toastId===b.id)||0,[C,b.id]),qt=ve.useMemo(()=>{var qe;return(qe=b.closeButton)!=null?qe:U},[b.closeButton,U]),fn=ve.useMemo(()=>b.duration||X||q0,[b.duration,X]),Gt=ve.useRef(0),at=ve.useRef(0),Tn=ve.useRef(0),xt=ve.useRef(null),[Lt,Wa]=ne.split("-"),ji=ve.useMemo(()=>C.reduce((qe,lt,pt)=>pt>=bt?qe:qe+lt.height,0),[C,bt]),Ol=BM(),Li=b.invert||y,ca=je==="loading";at.current=ve.useMemo(()=>bt*F+ji,[bt,ji]),ve.useEffect(()=>{te.current=fn},[fn]),ve.useEffect(()=>{oe(!0)},[]),ve.useEffect(()=>{let qe=Pe.current;if(qe){let lt=qe.getBoundingClientRect().height;return Ee(lt),_(pt=>[{toastId:b.id,height:lt,position:b.position},...pt]),()=>_(pt=>pt.filter(hn=>hn.toastId!==b.id))}},[_,b.id]),ve.useLayoutEffect(()=>{if(!ie)return;let qe=Pe.current,lt=qe.style.height;qe.style.height="auto";let pt=qe.getBoundingClientRect().height;qe.style.height=lt,Ee(pt),_(hn=>hn.find(ln=>ln.toastId===b.id)?hn.map(ln=>ln.toastId===b.id?{...ln,height:pt}:ln):[{toastId:b.id,height:pt,position:b.position},...hn])},[ie,b.title,b.description,_,b.id]);let Jt=ve.useCallback(()=>{he(!0),_e(at.current),_(qe=>qe.filter(lt=>lt.toastId!==b.id)),setTimeout(()=>{M(b)},tP)},[b,M,_,at]);ve.useEffect(()=>{if(b.promise&&je==="loading"||b.duration===1/0||b.type==="loading")return;let qe;return D||E||O&&Ol?(()=>{if(Tn.current{var lt;(lt=b.onAutoClose)==null||lt.call(b,b),Jt()},te.current)),()=>clearTimeout(qe)},[D,E,b,je,O,Ol,Jt]),ve.useEffect(()=>{b.delete&&Jt()},[Jt,b.delete]);function zi(){var qe,lt,pt;return G!=null&&G.loading?ve.createElement("div",{className:ar(K==null?void 0:K.loader,(qe=b==null?void 0:b.classNames)==null?void 0:qe.loader,"sonner-loader"),"data-visible":je==="loading"},G.loading):z?ve.createElement("div",{className:ar(K==null?void 0:K.loader,(lt=b==null?void 0:b.classNames)==null?void 0:lt.loader,"sonner-loader"),"data-visible":je==="loading"},z):ve.createElement(zM,{className:ar(K==null?void 0:K.loader,(pt=b==null?void 0:b.classNames)==null?void 0:pt.loader),visible:je==="loading"})}return ve.createElement("li",{tabIndex:0,ref:Pe,className:ar(Y,it,K==null?void 0:K.toast,(t=b==null?void 0:b.classNames)==null?void 0:t.toast,K==null?void 0:K.default,K==null?void 0:K[je],(n=b==null?void 0:b.classNames)==null?void 0:n[je]),"data-sonner-toast":"","data-rich-colors":(a=b.richColors)!=null?a:R,"data-styled":!(b.jsx||b.unstyled||S),"data-mounted":ie,"data-promise":!!b.promise,"data-swiped":ye,"data-removed":Ce,"data-visible":Ae,"data-y-position":Lt,"data-x-position":Wa,"data-index":A,"data-front":me,"data-swiping":Se,"data-dismissible":He,"data-type":je,"data-invert":Li,"data-swipe-out":Le,"data-swipe-direction":re,"data-expanded":!!(D||j&&ie),style:{"--index":A,"--toasts-before":A,"--z-index":k.length-A,"--offset":`${Ce?le:at.current}px`,"--initial-height":j?"auto":`${pe}px`,...L,...b.style},onDragEnd:()=>{be(!1),W(null),xt.current=null},onPointerDown:qe=>{ca||!He||(Fe.current=new Date,_e(at.current),qe.target.setPointerCapture(qe.pointerId),qe.target.tagName!=="BUTTON"&&(be(!0),xt.current={x:qe.clientX,y:qe.clientY}))},onPointerUp:()=>{var qe,lt,pt,hn;if(Le||!He)return;xt.current=null;let ln=Number(((qe=Pe.current)==null?void 0:qe.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),pn=Number(((lt=Pe.current)==null?void 0:lt.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),Nr=new Date().getTime()-((pt=Fe.current)==null?void 0:pt.getTime()),mn=$==="x"?ln:pn,Jn=Math.abs(mn)/Nr;if(Math.abs(mn)>=eP||Jn>.11){_e(at.current),(hn=b.onDismiss)==null||hn.call(b,b),de($==="x"?ln>0?"right":"left":pn>0?"down":"up"),Jt(),Te(!0),J(!1);return}be(!1),W(null)},onPointerMove:qe=>{var lt,pt,hn,ln;if(!xt.current||!He||((lt=window.getSelection())==null?void 0:lt.toString().length)>0)return;let pn=qe.clientY-xt.current.y,Nr=qe.clientX-xt.current.x,mn=(pt=e.swipeDirections)!=null?pt:nP(ne);!$&&(Math.abs(Nr)>1||Math.abs(pn)>1)&&W(Math.abs(Nr)>Math.abs(pn)?"x":"y");let Jn={x:0,y:0};$==="y"?(mn.includes("top")||mn.includes("bottom"))&&(mn.includes("top")&&pn<0||mn.includes("bottom")&&pn>0)&&(Jn.y=pn):$==="x"&&(mn.includes("left")||mn.includes("right"))&&(mn.includes("left")&&Nr<0||mn.includes("right")&&Nr>0)&&(Jn.x=Nr),(Math.abs(Jn.x)>0||Math.abs(Jn.y)>0)&&J(!0),(hn=Pe.current)==null||hn.style.setProperty("--swipe-amount-x",`${Jn.x}px`),(ln=Pe.current)==null||ln.style.setProperty("--swipe-amount-y",`${Jn.y}px`)}},qt&&!b.jsx?ve.createElement("button",{"aria-label":H,"data-disabled":ca,"data-close-button":!0,onClick:ca||!He?()=>{}:()=>{var qe;Jt(),(qe=b.onDismiss)==null||qe.call(b,b)},className:ar(K==null?void 0:K.closeButton,(o=b==null?void 0:b.classNames)==null?void 0:o.closeButton)},(s=G==null?void 0:G.close)!=null?s:UM):null,b.jsx||w.isValidElement(b.title)?b.jsx?b.jsx:typeof b.title=="function"?b.title():b.title:ve.createElement(ve.Fragment,null,je||b.icon||b.promise?ve.createElement("div",{"data-icon":"",className:ar(K==null?void 0:K.icon,(c=b==null?void 0:b.classNames)==null?void 0:c.icon)},b.promise||b.type==="loading"&&!b.icon?b.icon||zi():null,b.type!=="loading"?b.icon||(G==null?void 0:G[je])||jM(je):null):null,ve.createElement("div",{"data-content":"",className:ar(K==null?void 0:K.content,(u=b==null?void 0:b.classNames)==null?void 0:u.content)},ve.createElement("div",{"data-title":"",className:ar(K==null?void 0:K.title,(f=b==null?void 0:b.classNames)==null?void 0:f.title)},typeof b.title=="function"?b.title():b.title),b.description?ve.createElement("div",{"data-description":"",className:ar(B,Ct,K==null?void 0:K.description,(h=b==null?void 0:b.classNames)==null?void 0:h.description)},typeof b.description=="function"?b.description():b.description):null),w.isValidElement(b.cancel)?b.cancel:b.cancel&&Yc(b.cancel)?ve.createElement("button",{"data-button":!0,"data-cancel":!0,style:b.cancelButtonStyle||I,onClick:qe=>{var lt,pt;Yc(b.cancel)&&He&&((pt=(lt=b.cancel).onClick)==null||pt.call(lt,qe),Jt())},className:ar(K==null?void 0:K.cancelButton,(m=b==null?void 0:b.classNames)==null?void 0:m.cancelButton)},b.cancel.label):null,w.isValidElement(b.action)?b.action:b.action&&Yc(b.action)?ve.createElement("button",{"data-button":!0,"data-action":!0,style:b.actionButtonStyle||q,onClick:qe=>{var lt,pt;Yc(b.action)&&((pt=(lt=b.action).onClick)==null||pt.call(lt,qe),!qe.defaultPrevented&&Jt())},className:ar(K==null?void 0:K.actionButton,(g=b==null?void 0:b.classNames)==null?void 0:g.actionButton)},b.action.label):null))};function Y0(){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 aP(e,t){let n={};return[e,t].forEach((a,o)=>{let s=o===1,c=s?"--mobile-offset":"--offset",u=s?ZM:KM;function f(h){["top","right","bottom","left"].forEach(m=>{n[`${c}-${m}`]=typeof h=="number"?`${h}px`:h})}typeof a=="number"||typeof a=="string"?f(a):typeof a=="object"?["top","right","bottom","left"].forEach(h=>{a[h]===void 0?n[`${c}-${h}`]=u:n[`${c}-${h}`]=typeof a[h]=="number"?`${a[h]}px`:a[h]}):f(u)}),n}var iP=w.forwardRef(function(e,t){let{invert:n,position:a="bottom-right",hotkey:o=["altKey","KeyT"],expand:s,closeButton:c,className:u,offset:f,mobileOffset:h,theme:m="light",richColors:g,duration:y,style:b,visibleToasts:S=XM,toastOptions:E,dir:_=Y0(),gap:N=JM,loadingIcon:C,icons:A,containerAriaLabel:k="Notifications",pauseWhenPageIsHidden:D}=e,[M,R]=ve.useState([]),U=ve.useMemo(()=>Array.from(new Set([a].concat(M.filter(O=>O.position).map(O=>O.position)))),[M,a]),[L,I]=ve.useState([]),[q,Y]=ve.useState(!1),[B,X]=ve.useState(!1),[ne,F]=ve.useState(m!=="system"?m:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),z=ve.useRef(null),j=o.join("+").replace(/Key/g,"").replace(/Digit/g,""),K=ve.useRef(null),G=ve.useRef(!1),H=ve.useCallback(O=>{R($=>{var W;return(W=$.find(re=>re.id===O.id))!=null&&W.delete||xn.dismiss(O.id),$.filter(({id:re})=>re!==O.id)})},[]);return ve.useEffect(()=>xn.subscribe(O=>{if(O.dismiss){R($=>$.map(W=>W.id===O.id?{...W,delete:!0}:W));return}setTimeout(()=>{$E.flushSync(()=>{R($=>{let W=$.findIndex(re=>re.id===O.id);return W!==-1?[...$.slice(0,W),{...$[W],...O},...$.slice(W+1)]:[O,...$]})})})}),[]),ve.useEffect(()=>{if(m!=="system"){F(m);return}if(m==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?F("dark"):F("light")),typeof window>"u")return;let O=window.matchMedia("(prefers-color-scheme: dark)");try{O.addEventListener("change",({matches:$})=>{F($?"dark":"light")})}catch{O.addListener(({matches:W})=>{try{F(W?"dark":"light")}catch(re){console.error(re)}})}},[m]),ve.useEffect(()=>{M.length<=1&&Y(!1)},[M]),ve.useEffect(()=>{let O=$=>{var W,re;o.every(de=>$[de]||$.code===de)&&(Y(!0),(W=z.current)==null||W.focus()),$.code==="Escape"&&(document.activeElement===z.current||(re=z.current)!=null&&re.contains(document.activeElement))&&Y(!1)};return document.addEventListener("keydown",O),()=>document.removeEventListener("keydown",O)},[o]),ve.useEffect(()=>{if(z.current)return()=>{K.current&&(K.current.focus({preventScroll:!0}),K.current=null,G.current=!1)}},[z.current]),ve.createElement("section",{ref:t,"aria-label":`${k} ${j}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},U.map((O,$)=>{var W;let[re,de]=O.split("-");return M.length?ve.createElement("ol",{key:O,dir:_==="auto"?Y0():_,tabIndex:-1,ref:z,className:u,"data-sonner-toaster":!0,"data-theme":ne,"data-y-position":re,"data-lifted":q&&M.length>1&&!s,"data-x-position":de,style:{"--front-toast-height":`${((W=L[0])==null?void 0:W.height)||0}px`,"--width":`${QM}px`,"--gap":`${N}px`,...b,...aP(f,h)},onBlur:ie=>{G.current&&!ie.currentTarget.contains(ie.relatedTarget)&&(G.current=!1,K.current&&(K.current.focus({preventScroll:!0}),K.current=null))},onFocus:ie=>{ie.target instanceof HTMLElement&&ie.target.dataset.dismissible==="false"||G.current||(G.current=!0,K.current=ie.relatedTarget)},onMouseEnter:()=>Y(!0),onMouseMove:()=>Y(!0),onMouseLeave:()=>{B||Y(!1)},onDragEnd:()=>Y(!1),onPointerDown:ie=>{ie.target instanceof HTMLElement&&ie.target.dataset.dismissible==="false"||X(!0)},onPointerUp:()=>X(!1)},M.filter(ie=>!ie.position&&$===0||ie.position===O).map((ie,oe)=>{var Ce,he;return ve.createElement(rP,{key:ie.id,icons:A,index:oe,toast:ie,defaultRichColors:g,duration:(Ce=E==null?void 0:E.duration)!=null?Ce:y,className:E==null?void 0:E.className,descriptionClassName:E==null?void 0:E.descriptionClassName,invert:n,visibleToasts:S,closeButton:(he=E==null?void 0:E.closeButton)!=null?he:c,interacting:B,position:O,style:E==null?void 0:E.style,unstyled:E==null?void 0:E.unstyled,classNames:E==null?void 0:E.classNames,cancelButtonStyle:E==null?void 0:E.cancelButtonStyle,actionButtonStyle:E==null?void 0:E.actionButtonStyle,removeToast:H,toasts:M.filter(Se=>Se.position==ie.position),heights:L.filter(Se=>Se.position==ie.position),setHeights:I,expandByDefault:s,gap:N,loadingIcon:C,expanded:q,pauseWhenPageIsHidden:D,swipeDirections:e.swipeDirections})})):null}))});const oP=()=>{const[e,t]=w.useState(!0),n=Ye.use.apiKey(),[a,o]=w.useState(""),s=En.use.message();w.useEffect(()=>{o(n||"")},[n,e]),w.useEffect(()=>{s&&(s.includes(ME)||s.includes(PE))&&t(!0)},[s,t]);const c=w.useCallback(async()=>{if(Ye.setState({apiKey:a||null}),await En.getState().check()){t(!1);return}an.error("API Key is invalid")},[a]),u=w.useCallback(f=>{o(f.target.value)},[o]);return x.jsx(DM,{open:e,onOpenChange:t,children:x.jsxs(v_,{children:[x.jsxs(y_,{children:[x.jsx(b_,{children:"API Key is required"}),x.jsx(x_,{children:"Please enter your API key"})]}),x.jsxs("form",{className:"flex gap-2",onSubmit:f=>f.preventDefault(),children:[x.jsx(Ai,{type:"password",value:a,onChange:u,placeholder:"Enter your API key",className:"max-h-full w-full min-w-0",autoComplete:"off"}),x.jsx(wt,{onClick:c,variant:"outline",size:"sm",children:"Save"})]})]})})};var Lg="Popover",[w_,q6]=Kn(Lg,[Vo]),Sl=Vo(),[sP,Va]=w_(Lg),E_=e=>{const{__scopePopover:t,children:n,open:a,defaultOpen:o,onOpenChange:s,modal:c=!1}=e,u=Sl(t),f=w.useRef(null),[h,m]=w.useState(!1),[g=!1,y]=aa({prop:a,defaultProp:o,onChange:s});return x.jsx(Ag,{...u,children:x.jsx(sP,{scope:t,contentId:on(),triggerRef:f,open:g,onOpenChange:y,onOpenToggle:w.useCallback(()=>y(b=>!b),[y]),hasCustomAnchor:h,onCustomAnchorAdd:w.useCallback(()=>m(!0),[]),onCustomAnchorRemove:w.useCallback(()=>m(!1),[]),modal:c,children:n})})};E_.displayName=Lg;var S_="PopoverAnchor",lP=w.forwardRef((e,t)=>{const{__scopePopover:n,...a}=e,o=Va(S_,n),s=Sl(n),{onCustomAnchorAdd:c,onCustomAnchorRemove:u}=o;return w.useEffect(()=>(c(),()=>u()),[c,u]),x.jsx(cd,{...s,...a,ref:t})});lP.displayName=S_;var __="PopoverTrigger",C_=w.forwardRef((e,t)=>{const{__scopePopover:n,...a}=e,o=Va(__,n),s=Sl(n),c=nt(t,o.triggerRef),u=x.jsx(Ie.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":k_(o.open),...a,ref:c,onClick:Be(e.onClick,o.onOpenToggle)});return o.hasCustomAnchor?u:x.jsx(cd,{asChild:!0,...s,children:u})});C_.displayName=__;var zg="PopoverPortal",[cP,uP]=w_(zg,{forceMount:void 0}),T_=e=>{const{__scopePopover:t,forceMount:n,children:a,container:o}=e,s=Va(zg,t);return x.jsx(cP,{scope:t,forceMount:n,children:x.jsx(zn,{present:n||s.open,children:x.jsx(td,{asChild:!0,container:o,children:a})})})};T_.displayName=zg;var Lo="PopoverContent",R_=w.forwardRef((e,t)=>{const n=uP(Lo,e.__scopePopover),{forceMount:a=n.forceMount,...o}=e,s=Va(Lo,e.__scopePopover);return x.jsx(zn,{present:a||s.open,children:s.modal?x.jsx(dP,{...o,ref:t}):x.jsx(fP,{...o,ref:t})})});R_.displayName=Lo;var dP=w.forwardRef((e,t)=>{const n=Va(Lo,e.__scopePopover),a=w.useRef(null),o=nt(t,a),s=w.useRef(!1);return w.useEffect(()=>{const c=a.current;if(c)return cg(c)},[]),x.jsx(rd,{as:Ba,allowPinchZoom:!0,children:x.jsx(A_,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Be(e.onCloseAutoFocus,c=>{var u;c.preventDefault(),s.current||(u=n.triggerRef.current)==null||u.focus()}),onPointerDownOutside:Be(e.onPointerDownOutside,c=>{const u=c.detail.originalEvent,f=u.button===0&&u.ctrlKey===!0,h=u.button===2||f;s.current=h},{checkForDefaultPrevented:!1}),onFocusOutside:Be(e.onFocusOutside,c=>c.preventDefault(),{checkForDefaultPrevented:!1})})})}),fP=w.forwardRef((e,t)=>{const n=Va(Lo,e.__scopePopover),a=w.useRef(!1),o=w.useRef(!1);return x.jsx(A_,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:s=>{var c,u;(c=e.onCloseAutoFocus)==null||c.call(e,s),s.defaultPrevented||(a.current||(u=n.triggerRef.current)==null||u.focus(),s.preventDefault()),a.current=!1,o.current=!1},onInteractOutside:s=>{var f,h;(f=e.onInteractOutside)==null||f.call(e,s),s.defaultPrevented||(a.current=!0,s.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const c=s.target;((h=n.triggerRef.current)==null?void 0:h.contains(c))&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&o.current&&s.preventDefault()}})}),A_=w.forwardRef((e,t)=>{const{__scopePopover:n,trapFocus:a,onOpenAutoFocus:o,onCloseAutoFocus:s,disableOutsidePointerEvents:c,onEscapeKeyDown:u,onPointerDownOutside:f,onFocusOutside:h,onInteractOutside:m,...g}=e,y=Va(Lo,n),b=Sl(n);return lg(),x.jsx(ed,{asChild:!0,loop:!0,trapped:a,onMountAutoFocus:o,onUnmountAutoFocus:s,children:x.jsx(wl,{asChild:!0,disableOutsidePointerEvents:c,onInteractOutside:m,onEscapeKeyDown:u,onPointerDownOutside:f,onFocusOutside:h,onDismiss:()=>y.onOpenChange(!1),children:x.jsx(Dg,{"data-state":k_(y.open),role:"dialog",id:y.contentId,...b,...g,ref:t,style:{...g.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)"}})})})}),D_="PopoverClose",hP=w.forwardRef((e,t)=>{const{__scopePopover:n,...a}=e,o=Va(D_,n);return x.jsx(Ie.button,{type:"button",...a,ref:t,onClick:Be(e.onClick,()=>o.onOpenChange(!1))})});hP.displayName=D_;var pP="PopoverArrow",mP=w.forwardRef((e,t)=>{const{__scopePopover:n,...a}=e,o=Sl(n);return x.jsx(kg,{...o,...a,ref:t})});mP.displayName=pP;function k_(e){return e?"open":"closed"}var gP=E_,vP=C_,yP=T_,N_=R_;const pd=gP,md=vP,_l=w.forwardRef(({className:e,align:t="center",sideOffset:n=4,...a},o)=>x.jsx(yP,{children:x.jsx(N_,{ref:o,align:t,sideOffset:n,className:Oe("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),...a})}));_l.displayName=N_.displayName;const bP=({status:e})=>e?x.jsxs("div",{className:"min-w-[300px] space-y-3 text-sm",children:[x.jsxs("div",{className:"space-y-1",children:[x.jsx("h4",{className:"font-medium",children:"Storage Info"}),x.jsxs("div",{className:"text-muted-foreground grid grid-cols-2 gap-1",children:[x.jsx("span",{children:"Working Directory:"}),x.jsx("span",{className:"truncate",children:e.working_directory}),x.jsx("span",{children:"Input Directory:"}),x.jsx("span",{className:"truncate",children:e.input_directory})]})]}),x.jsxs("div",{className:"space-y-1",children:[x.jsx("h4",{className:"font-medium",children:"LLM Configuration"}),x.jsxs("div",{className:"text-muted-foreground grid grid-cols-2 gap-1",children:[x.jsx("span",{children:"LLM Binding:"}),x.jsx("span",{children:e.configuration.llm_binding}),x.jsx("span",{children:"LLM Binding Host:"}),x.jsx("span",{children:e.configuration.llm_binding_host}),x.jsx("span",{children:"LLM Model:"}),x.jsx("span",{children:e.configuration.llm_model}),x.jsx("span",{children:"Max Tokens:"}),x.jsx("span",{children:e.configuration.max_tokens})]})]}),x.jsxs("div",{className:"space-y-1",children:[x.jsx("h4",{className:"font-medium",children:"Embedding Configuration"}),x.jsxs("div",{className:"text-muted-foreground grid grid-cols-2 gap-1",children:[x.jsx("span",{children:"Embedding Binding:"}),x.jsx("span",{children:e.configuration.embedding_binding}),x.jsx("span",{children:"Embedding Binding Host:"}),x.jsx("span",{children:e.configuration.embedding_binding_host}),x.jsx("span",{children:"Embedding Model:"}),x.jsx("span",{children:e.configuration.embedding_model})]})]}),x.jsxs("div",{className:"space-y-1",children:[x.jsx("h4",{className:"font-medium",children:"Storage Configuration"}),x.jsxs("div",{className:"text-muted-foreground grid grid-cols-2 gap-1",children:[x.jsx("span",{children:"KV Storage:"}),x.jsx("span",{children:e.configuration.kv_storage}),x.jsx("span",{children:"Doc Status Storage:"}),x.jsx("span",{children:e.configuration.doc_status_storage}),x.jsx("span",{children:"Graph Storage:"}),x.jsx("span",{children:e.configuration.graph_storage}),x.jsx("span",{children:"Vector Storage:"}),x.jsx("span",{children:e.configuration.vector_storage})]})]})]}):x.jsx("div",{className:"text-muted-foreground text-sm",children:"Status information unavailable"}),xP=()=>{const e=En.use.health(),t=En.use.lastCheckTime(),n=En.use.status(),[a,o]=w.useState(!1);return w.useEffect(()=>{o(!0);const s=setTimeout(()=>o(!1),300);return()=>clearTimeout(s)},[t]),x.jsx("div",{className:"fixed right-4 bottom-4 flex items-center gap-2 opacity-80 select-none",children:x.jsxs(pd,{children:[x.jsx(md,{asChild:!0,children:x.jsxs("div",{className:"flex cursor-help items-center gap-2",children:[x.jsx("div",{className:Oe("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",a&&"scale-125",a&&e&&"shadow-[0_0_12px_rgba(34,197,94,0.4)]",a&&!e&&"shadow-[0_0_12px_rgba(239,68,68,0.4)]")}),x.jsx("span",{className:"text-muted-foreground text-xs",children:e?"Connected":"Disconnected"})]})}),x.jsx(_l,{className:"w-auto",side:"top",align:"end",children:x.jsx(bP,{status:n})})]})})},O_=()=>{const e=w.useContext(oE);if(e===void 0)throw new Error("useTheme must be used within a ThemeProvider");return e};function wP(){const{theme:e,setTheme:t}=O_(),n=w.useCallback(()=>t("light"),[t]),a=w.useCallback(()=>t("dark"),[t]);return e==="dark"?x.jsx(wt,{onClick:n,variant:_r,tooltip:"Switch to light theme",size:"icon",side:"bottom",children:x.jsx(JO,{})}):x.jsx(wt,{onClick:a,variant:_r,tooltip:"Switch to dark theme",size:"icon",side:"bottom",children:x.jsx(hj,{})})}function j_(e){const t=e+"CollectionProvider",[n,a]=Kn(t),[o,s]=n(t,{collectionRef:{current:null},itemMap:new Map}),c=b=>{const{scope:S,children:E}=b,_=ve.useRef(null),N=ve.useRef(new Map).current;return x.jsx(o,{scope:S,itemMap:N,collectionRef:_,children:E})};c.displayName=t;const u=e+"CollectionSlot",f=ve.forwardRef((b,S)=>{const{scope:E,children:_}=b,N=s(u,E),C=nt(S,N.collectionRef);return x.jsx(Ba,{ref:C,children:_})});f.displayName=u;const h=e+"CollectionItemSlot",m="data-radix-collection-item",g=ve.forwardRef((b,S)=>{const{scope:E,children:_,...N}=b,C=ve.useRef(null),A=nt(S,C),k=s(h,E);return ve.useEffect(()=>(k.itemMap.set(C,{ref:C,...N}),()=>void k.itemMap.delete(C))),x.jsx(Ba,{[m]:"",ref:A,children:_})});g.displayName=h;function y(b){const S=s(e+"CollectionConsumer",b);return ve.useCallback(()=>{const _=S.collectionRef.current;if(!_)return[];const N=Array.from(_.querySelectorAll(`[${m}]`));return Array.from(S.itemMap.values()).sort((k,D)=>N.indexOf(k.ref.current)-N.indexOf(D.ref.current))},[S.collectionRef,S.itemMap])}return[{Provider:c,Slot:f,ItemSlot:g},y,a]}var EP=w.createContext(void 0);function gd(e){const t=w.useContext(EP);return e||t||"ltr"}var rp="rovingFocusGroup.onEntryFocus",SP={bubbles:!1,cancelable:!0},vd="RovingFocusGroup",[xm,L_,_P]=j_(vd),[CP,z_]=Kn(vd,[_P]),[TP,RP]=CP(vd),M_=w.forwardRef((e,t)=>x.jsx(xm.Provider,{scope:e.__scopeRovingFocusGroup,children:x.jsx(xm.Slot,{scope:e.__scopeRovingFocusGroup,children:x.jsx(AP,{...e,ref:t})})}));M_.displayName=vd;var AP=w.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:a,loop:o=!1,dir:s,currentTabStopId:c,defaultCurrentTabStopId:u,onCurrentTabStopIdChange:f,onEntryFocus:h,preventScrollOnEntryFocus:m=!1,...g}=e,y=w.useRef(null),b=nt(t,y),S=gd(s),[E=null,_]=aa({prop:c,defaultProp:u,onChange:f}),[N,C]=w.useState(!1),A=Zt(h),k=L_(n),D=w.useRef(!1),[M,R]=w.useState(0);return w.useEffect(()=>{const U=y.current;if(U)return U.addEventListener(rp,A),()=>U.removeEventListener(rp,A)},[A]),x.jsx(TP,{scope:n,orientation:a,dir:S,loop:o,currentTabStopId:E,onItemFocus:w.useCallback(U=>_(U),[_]),onItemShiftTab:w.useCallback(()=>C(!0),[]),onFocusableItemAdd:w.useCallback(()=>R(U=>U+1),[]),onFocusableItemRemove:w.useCallback(()=>R(U=>U-1),[]),children:x.jsx(Ie.div,{tabIndex:N||M===0?-1:0,"data-orientation":a,...g,ref:b,style:{outline:"none",...e.style},onMouseDown:Be(e.onMouseDown,()=>{D.current=!0}),onFocus:Be(e.onFocus,U=>{const L=!D.current;if(U.target===U.currentTarget&&L&&!N){const I=new CustomEvent(rp,SP);if(U.currentTarget.dispatchEvent(I),!I.defaultPrevented){const q=k().filter(F=>F.focusable),Y=q.find(F=>F.active),B=q.find(F=>F.id===E),ne=[Y,B,...q].filter(Boolean).map(F=>F.ref.current);F_(ne,m)}}D.current=!1}),onBlur:Be(e.onBlur,()=>C(!1))})})}),P_="RovingFocusGroupItem",G_=w.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:a=!0,active:o=!1,tabStopId:s,...c}=e,u=on(),f=s||u,h=RP(P_,n),m=h.currentTabStopId===f,g=L_(n),{onFocusableItemAdd:y,onFocusableItemRemove:b}=h;return w.useEffect(()=>{if(a)return y(),()=>b()},[a,y,b]),x.jsx(xm.ItemSlot,{scope:n,id:f,focusable:a,active:o,children:x.jsx(Ie.span,{tabIndex:m?0:-1,"data-orientation":h.orientation,...c,ref:t,onMouseDown:Be(e.onMouseDown,S=>{a?h.onItemFocus(f):S.preventDefault()}),onFocus:Be(e.onFocus,()=>h.onItemFocus(f)),onKeyDown:Be(e.onKeyDown,S=>{if(S.key==="Tab"&&S.shiftKey){h.onItemShiftTab();return}if(S.target!==S.currentTarget)return;const E=NP(S,h.orientation,h.dir);if(E!==void 0){if(S.metaKey||S.ctrlKey||S.altKey||S.shiftKey)return;S.preventDefault();let N=g().filter(C=>C.focusable).map(C=>C.ref.current);if(E==="last")N.reverse();else if(E==="prev"||E==="next"){E==="prev"&&N.reverse();const C=N.indexOf(S.currentTarget);N=h.loop?OP(N,C+1):N.slice(C+1)}setTimeout(()=>F_(N))}})})})});G_.displayName=P_;var DP={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function kP(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function NP(e,t,n){const a=kP(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(a))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(a)))return DP[a]}function F_(e,t=!1){const n=document.activeElement;for(const a of e)if(a===n||(a.focus({preventScroll:t}),document.activeElement!==n))return}function OP(e,t){return e.map((n,a)=>e[(t+a)%e.length])}var jP=M_,LP=G_,Mg="Tabs",[zP,Y6]=Kn(Mg,[z_]),U_=z_(),[MP,Pg]=zP(Mg),B_=w.forwardRef((e,t)=>{const{__scopeTabs:n,value:a,onValueChange:o,defaultValue:s,orientation:c="horizontal",dir:u,activationMode:f="automatic",...h}=e,m=gd(u),[g,y]=aa({prop:a,onChange:o,defaultProp:s});return x.jsx(MP,{scope:n,baseId:on(),value:g,onValueChange:y,orientation:c,dir:m,activationMode:f,children:x.jsx(Ie.div,{dir:m,"data-orientation":c,...h,ref:t})})});B_.displayName=Mg;var I_="TabsList",H_=w.forwardRef((e,t)=>{const{__scopeTabs:n,loop:a=!0,...o}=e,s=Pg(I_,n),c=U_(n);return x.jsx(jP,{asChild:!0,...c,orientation:s.orientation,dir:s.dir,loop:a,children:x.jsx(Ie.div,{role:"tablist","aria-orientation":s.orientation,...o,ref:t})})});H_.displayName=I_;var $_="TabsTrigger",V_=w.forwardRef((e,t)=>{const{__scopeTabs:n,value:a,disabled:o=!1,...s}=e,c=Pg($_,n),u=U_(n),f=W_(c.baseId,a),h=X_(c.baseId,a),m=a===c.value;return x.jsx(LP,{asChild:!0,...u,focusable:!o,active:m,children:x.jsx(Ie.button,{type:"button",role:"tab","aria-selected":m,"aria-controls":h,"data-state":m?"active":"inactive","data-disabled":o?"":void 0,disabled:o,id:f,...s,ref:t,onMouseDown:Be(e.onMouseDown,g=>{!o&&g.button===0&&g.ctrlKey===!1?c.onValueChange(a):g.preventDefault()}),onKeyDown:Be(e.onKeyDown,g=>{[" ","Enter"].includes(g.key)&&c.onValueChange(a)}),onFocus:Be(e.onFocus,()=>{const g=c.activationMode!=="manual";!m&&!o&&g&&c.onValueChange(a)})})})});V_.displayName=$_;var q_="TabsContent",Y_=w.forwardRef((e,t)=>{const{__scopeTabs:n,value:a,forceMount:o,children:s,...c}=e,u=Pg(q_,n),f=W_(u.baseId,a),h=X_(u.baseId,a),m=a===u.value,g=w.useRef(m);return w.useEffect(()=>{const y=requestAnimationFrame(()=>g.current=!1);return()=>cancelAnimationFrame(y)},[]),x.jsx(zn,{present:o||m,children:({present:y})=>x.jsx(Ie.div,{"data-state":m?"active":"inactive","data-orientation":u.orientation,role:"tabpanel","aria-labelledby":f,hidden:!y,id:h,tabIndex:0,...c,ref:t,style:{...e.style,animationDuration:g.current?"0s":void 0},children:y&&s})})});Y_.displayName=q_;function W_(e,t){return`${e}-trigger-${t}`}function X_(e,t){return`${e}-content-${t}`}var PP=B_,K_=H_,Z_=V_,Q_=Y_;const GP=PP,J_=w.forwardRef(({className:e,...t},n)=>x.jsx(K_,{ref:n,className:Oe("bg-muted text-muted-foreground inline-flex h-10 items-center justify-center rounded-md p-1",e),...t}));J_.displayName=K_.displayName;const eC=w.forwardRef(({className:e,...t},n)=>x.jsx(Z_,{ref:n,className:Oe("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}));eC.displayName=Z_.displayName;const rl=w.forwardRef(({className:e,...t},n)=>x.jsx(Q_,{ref:n,className:Oe("ring-offset-background focus-visible:ring-ring mt-2 focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-none",e),...t}));rl.displayName=Q_.displayName;function Wc({value:e,currentTab:t,children:n}){return x.jsx(eC,{value:e,className:Oe("cursor-pointer px-2 py-1 transition-all",t===e?"!bg-emerald-400 !text-zinc-50":"hover:bg-background/60"),children:n})}function FP(){const e=Ye.use.currentTab();return x.jsx("div",{className:"flex h-8 self-center",children:x.jsxs(J_,{className:"h-full gap-2",children:[x.jsx(Wc,{value:"documents",currentTab:e,children:"Documents"}),x.jsx(Wc,{value:"knowledge-graph",currentTab:e,children:"Knowledge Graph"}),x.jsx(Wc,{value:"retrieval",currentTab:e,children:"Retrieval"}),x.jsx(Wc,{value:"api",currentTab:e,children:"API"})]})})}function UP(){return x.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:[x.jsxs("a",{href:"/",className:"mr-6 flex items-center gap-2",children:[x.jsx(vj,{className:"size-4 text-emerald-400","aria-hidden":"true"}),x.jsx("span",{className:"font-bold md:inline-block",children:l0.name})]}),x.jsx("div",{className:"flex h-10 flex-1 justify-center",children:x.jsx(FP,{})}),x.jsxs("nav",{className:"flex items-center",children:[x.jsx(wt,{variant:"ghost",size:"icon",side:"bottom",tooltip:"Project Repository",children:x.jsx("a",{href:l0.github,target:"_blank",rel:"noopener noreferrer",children:x.jsx(IO,{className:"size-4","aria-hidden":"true"})})}),x.jsx(wP,{})]})]})}var Xc={exports:{}},W0;function BP(){if(W0)return Xc.exports;W0=1;var e=typeof Reflect=="object"?Reflect:null,t=e&&typeof e.apply=="function"?e.apply:function(D,M,R){return Function.prototype.apply.call(D,M,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 a(k){console&&console.warn&&console.warn(k)}var o=Number.isNaN||function(D){return D!==D};function s(){s.init.call(this)}Xc.exports=s,Xc.exports.once=N,s.EventEmitter=s,s.prototype._events=void 0,s.prototype._eventsCount=0,s.prototype._maxListeners=void 0;var c=10;function u(k){if(typeof k!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof k)}Object.defineProperty(s,"defaultMaxListeners",{enumerable:!0,get:function(){return c},set:function(k){if(typeof k!="number"||k<0||o(k))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+k+".");c=k}}),s.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},s.prototype.setMaxListeners=function(D){if(typeof D!="number"||D<0||o(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(k){return k._maxListeners===void 0?s.defaultMaxListeners:k._maxListeners}s.prototype.getMaxListeners=function(){return f(this)},s.prototype.emit=function(D){for(var M=[],R=1;R0&&(I=M[0]),I instanceof Error)throw I;var q=new Error("Unhandled error."+(I?" ("+I.message+")":""));throw q.context=I,q}var Y=L[D];if(Y===void 0)return!1;if(typeof Y=="function")t(Y,this,M);else for(var B=Y.length,X=S(Y,B),R=0;R0&&I.length>U&&!I.warned){I.warned=!0;var q=new Error("Possible EventEmitter memory leak detected. "+I.length+" "+String(D)+" listeners added. Use emitter.setMaxListeners() to increase limit");q.name="MaxListenersExceededWarning",q.emitter=k,q.type=D,q.count=I.length,a(q)}return k}s.prototype.addListener=function(D,M){return h(this,D,M,!1)},s.prototype.on=s.prototype.addListener,s.prototype.prependListener=function(D,M){return h(this,D,M,!0)};function m(){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 g(k,D,M){var R={fired:!1,wrapFn:void 0,target:k,type:D,listener:M},U=m.bind(R);return U.listener=M,R.wrapFn=U,U}s.prototype.once=function(D,M){return u(M),this.on(D,g(this,D,M)),this},s.prototype.prependOnceListener=function(D,M){return u(M),this.prependListener(D,g(this,D,M)),this},s.prototype.removeListener=function(D,M){var R,U,L,I,q;if(u(M),U=this._events,U===void 0)return this;if(R=U[D],R===void 0)return this;if(R===M||R.listener===M)--this._eventsCount===0?this._events=Object.create(null):(delete U[D],U.removeListener&&this.emit("removeListener",D,R.listener||M));else if(typeof R!="function"){for(L=-1,I=R.length-1;I>=0;I--)if(R[I]===M||R[I].listener===M){q=R[I].listener,L=I;break}if(L<0)return this;L===0?R.shift():E(R,L),R.length===1&&(U[D]=R[0]),U.removeListener!==void 0&&this.emit("removeListener",D,q||M)}return this},s.prototype.off=s.prototype.removeListener,s.prototype.removeAllListeners=function(D){var M,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 L=Object.keys(R),I;for(U=0;U=0;U--)this.removeListener(D,M[U]);return this};function y(k,D,M){var R=k._events;if(R===void 0)return[];var U=R[D];return U===void 0?[]:typeof U=="function"?M?[U.listener||U]:[U]:M?_(U):S(U,U.length)}s.prototype.listeners=function(D){return y(this,D,!0)},s.prototype.rawListeners=function(D){return y(this,D,!1)},s.listenerCount=function(k,D){return typeof k.listenerCount=="function"?k.listenerCount(D):b.call(k,D)},s.prototype.listenerCount=b;function b(k){var D=this._events;if(D!==void 0){var M=D[k];if(typeof M=="function")return 1;if(M!==void 0)return M.length}return 0}s.prototype.eventNames=function(){return this._eventsCount>0?n(this._events):[]};function S(k,D){for(var M=new Array(D),R=0;Re++}function ra(){const e=arguments;let t=null,n=-1;return{[Symbol.iterator](){return this},next(){let a=null;do{if(t===null){if(n++,n>=e.length)return{done:!0};t=e[n][Symbol.iterator]()}if(a=t.next(),a.done){t=null;continue}break}while(!0);return a}}}function qo(){return{[Symbol.iterator](){return this},next(){return{done:!0}}}}class Gg extends Error{constructor(t){super(),this.name="GraphError",this.message=t}}class De extends Gg{constructor(t){super(t),this.name="InvalidArgumentsGraphError",typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,De.prototype.constructor)}}class Re extends Gg{constructor(t){super(t),this.name="NotFoundGraphError",typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,Re.prototype.constructor)}}class $e extends Gg{constructor(t){super(t),this.name="UsageGraphError",typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,$e.prototype.constructor)}}function rC(e,t){this.key=e,this.attributes=t,this.clear()}rC.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 aC(e,t){this.key=e,this.attributes=t,this.clear()}aC.prototype.clear=function(){this.inDegree=0,this.outDegree=0,this.directedLoops=0,this.in={},this.out={}};function iC(e,t){this.key=e,this.attributes=t,this.clear()}iC.prototype.clear=function(){this.undirectedDegree=0,this.undirectedLoops=0,this.undirected={}};function Yo(e,t,n,a,o){this.key=t,this.attributes=o,this.undirected=e,this.source=n,this.target=a}Yo.prototype.attach=function(){let e="out",t="in";this.undirected&&(e=t="undirected");const n=this.source.key,a=this.target.key;this.source[e][a]=this,!(this.undirected&&n===a)&&(this.target[t][n]=this)};Yo.prototype.attachMulti=function(){let e="out",t="in";const n=this.source.key,a=this.target.key;this.undirected&&(e=t="undirected");const o=this.source[e],s=o[a];if(typeof s>"u"){o[a]=this,this.undirected&&n===a||(this.target[t][n]=this);return}s.previous=this,this.next=s,o[a]=this,this.target[t][n]=this};Yo.prototype.detach=function(){const e=this.source.key,t=this.target.key;let n="out",a="in";this.undirected&&(n=a="undirected"),delete this.source[n][t],delete this.target[a][e]};Yo.prototype.detachMulti=function(){const e=this.source.key,t=this.target.key;let n="out",a="in";this.undirected&&(n=a="undirected"),this.previous===void 0?this.next===void 0?(delete this.source[n][t],delete this.target[a][e]):(this.next.previous=void 0,this.source[n][t]=this.next,this.target[a][e]=this.next):(this.previous.next=this.next,this.next!==void 0&&(this.next.previous=this.previous))};const oC=0,sC=1,$P=2,lC=3;function la(e,t,n,a,o,s,c){let u,f,h,m;if(a=""+a,n===oC){if(u=e._nodes.get(a),!u)throw new Re(`Graph.${t}: could not find the "${a}" node in the graph.`);h=o,m=s}else if(n===lC){if(o=""+o,f=e._edges.get(o),!f)throw new Re(`Graph.${t}: could not find the "${o}" edge in the graph.`);const g=f.source.key,y=f.target.key;if(a===g)u=f.target;else if(a===y)u=f.source;else throw new Re(`Graph.${t}: the "${a}" node is not attached to the "${o}" edge (${g}, ${y}).`);h=s,m=c}else{if(f=e._edges.get(a),!f)throw new Re(`Graph.${t}: could not find the "${a}" edge in the graph.`);n===sC?u=f.source:u=f.target,h=o,m=s}return[u,h,m]}function VP(e,t,n){e.prototype[t]=function(a,o,s){const[c,u]=la(this,t,n,a,o,s);return c.attributes[u]}}function qP(e,t,n){e.prototype[t]=function(a,o){const[s]=la(this,t,n,a,o);return s.attributes}}function YP(e,t,n){e.prototype[t]=function(a,o,s){const[c,u]=la(this,t,n,a,o,s);return c.attributes.hasOwnProperty(u)}}function WP(e,t,n){e.prototype[t]=function(a,o,s,c){const[u,f,h]=la(this,t,n,a,o,s,c);return u.attributes[f]=h,this.emit("nodeAttributesUpdated",{key:u.key,type:"set",attributes:u.attributes,name:f}),this}}function XP(e,t,n){e.prototype[t]=function(a,o,s,c){const[u,f,h]=la(this,t,n,a,o,s,c);if(typeof h!="function")throw new De(`Graph.${t}: updater should be a function.`);const m=u.attributes,g=h(m[f]);return m[f]=g,this.emit("nodeAttributesUpdated",{key:u.key,type:"set",attributes:u.attributes,name:f}),this}}function KP(e,t,n){e.prototype[t]=function(a,o,s){const[c,u]=la(this,t,n,a,o,s);return delete c.attributes[u],this.emit("nodeAttributesUpdated",{key:c.key,type:"remove",attributes:c.attributes,name:u}),this}}function ZP(e,t,n){e.prototype[t]=function(a,o,s){const[c,u]=la(this,t,n,a,o,s);if(!Qt(u))throw new De(`Graph.${t}: provided attributes are not a plain object.`);return c.attributes=u,this.emit("nodeAttributesUpdated",{key:c.key,type:"replace",attributes:c.attributes}),this}}function QP(e,t,n){e.prototype[t]=function(a,o,s){const[c,u]=la(this,t,n,a,o,s);if(!Qt(u))throw new De(`Graph.${t}: provided attributes are not a plain object.`);return Pt(c.attributes,u),this.emit("nodeAttributesUpdated",{key:c.key,type:"merge",attributes:c.attributes,data:u}),this}}function JP(e,t,n){e.prototype[t]=function(a,o,s){const[c,u]=la(this,t,n,a,o,s);if(typeof u!="function")throw new De(`Graph.${t}: provided updater is not a function.`);return c.attributes=u(c.attributes),this.emit("nodeAttributesUpdated",{key:c.key,type:"update",attributes:c.attributes}),this}}const e4=[{name:e=>`get${e}Attribute`,attacher:VP},{name:e=>`get${e}Attributes`,attacher:qP},{name:e=>`has${e}Attribute`,attacher:YP},{name:e=>`set${e}Attribute`,attacher:WP},{name:e=>`update${e}Attribute`,attacher:XP},{name:e=>`remove${e}Attribute`,attacher:KP},{name:e=>`replace${e}Attributes`,attacher:ZP},{name:e=>`merge${e}Attributes`,attacher:QP},{name:e=>`update${e}Attributes`,attacher:JP}];function t4(e){e4.forEach(function({name:t,attacher:n}){n(e,t("Node"),oC),n(e,t("Source"),sC),n(e,t("Target"),$P),n(e,t("Opposite"),lC)})}function n4(e,t,n){e.prototype[t]=function(a,o){let s;if(this.type!=="mixed"&&n!=="mixed"&&n!==this.type)throw new $e(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new $e(`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 c=""+a,u=""+o;if(o=arguments[2],s=Xn(this,c,u,n),!s)throw new Re(`Graph.${t}: could not find an edge for the given path ("${c}" - "${u}").`)}else{if(n!=="mixed")throw new $e(`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(a=""+a,s=this._edges.get(a),!s)throw new Re(`Graph.${t}: could not find the "${a}" edge in the graph.`)}return s.attributes[o]}}function r4(e,t,n){e.prototype[t]=function(a){let o;if(this.type!=="mixed"&&n!=="mixed"&&n!==this.type)throw new $e(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>1){if(this.multi)throw new $e(`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 s=""+a,c=""+arguments[1];if(o=Xn(this,s,c,n),!o)throw new Re(`Graph.${t}: could not find an edge for the given path ("${s}" - "${c}").`)}else{if(n!=="mixed")throw new $e(`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(a=""+a,o=this._edges.get(a),!o)throw new Re(`Graph.${t}: could not find the "${a}" edge in the graph.`)}return o.attributes}}function a4(e,t,n){e.prototype[t]=function(a,o){let s;if(this.type!=="mixed"&&n!=="mixed"&&n!==this.type)throw new $e(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new $e(`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 c=""+a,u=""+o;if(o=arguments[2],s=Xn(this,c,u,n),!s)throw new Re(`Graph.${t}: could not find an edge for the given path ("${c}" - "${u}").`)}else{if(n!=="mixed")throw new $e(`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(a=""+a,s=this._edges.get(a),!s)throw new Re(`Graph.${t}: could not find the "${a}" edge in the graph.`)}return s.attributes.hasOwnProperty(o)}}function i4(e,t,n){e.prototype[t]=function(a,o,s){let c;if(this.type!=="mixed"&&n!=="mixed"&&n!==this.type)throw new $e(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>3){if(this.multi)throw new $e(`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=""+a,f=""+o;if(o=arguments[2],s=arguments[3],c=Xn(this,u,f,n),!c)throw new Re(`Graph.${t}: could not find an edge for the given path ("${u}" - "${f}").`)}else{if(n!=="mixed")throw new $e(`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(a=""+a,c=this._edges.get(a),!c)throw new Re(`Graph.${t}: could not find the "${a}" edge in the graph.`)}return c.attributes[o]=s,this.emit("edgeAttributesUpdated",{key:c.key,type:"set",attributes:c.attributes,name:o}),this}}function o4(e,t,n){e.prototype[t]=function(a,o,s){let c;if(this.type!=="mixed"&&n!=="mixed"&&n!==this.type)throw new $e(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>3){if(this.multi)throw new $e(`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=""+a,f=""+o;if(o=arguments[2],s=arguments[3],c=Xn(this,u,f,n),!c)throw new Re(`Graph.${t}: could not find an edge for the given path ("${u}" - "${f}").`)}else{if(n!=="mixed")throw new $e(`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(a=""+a,c=this._edges.get(a),!c)throw new Re(`Graph.${t}: could not find the "${a}" edge in the graph.`)}if(typeof s!="function")throw new De(`Graph.${t}: updater should be a function.`);return c.attributes[o]=s(c.attributes[o]),this.emit("edgeAttributesUpdated",{key:c.key,type:"set",attributes:c.attributes,name:o}),this}}function s4(e,t,n){e.prototype[t]=function(a,o){let s;if(this.type!=="mixed"&&n!=="mixed"&&n!==this.type)throw new $e(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new $e(`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 c=""+a,u=""+o;if(o=arguments[2],s=Xn(this,c,u,n),!s)throw new Re(`Graph.${t}: could not find an edge for the given path ("${c}" - "${u}").`)}else{if(n!=="mixed")throw new $e(`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(a=""+a,s=this._edges.get(a),!s)throw new Re(`Graph.${t}: could not find the "${a}" edge in the graph.`)}return delete s.attributes[o],this.emit("edgeAttributesUpdated",{key:s.key,type:"remove",attributes:s.attributes,name:o}),this}}function l4(e,t,n){e.prototype[t]=function(a,o){let s;if(this.type!=="mixed"&&n!=="mixed"&&n!==this.type)throw new $e(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new $e(`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 c=""+a,u=""+o;if(o=arguments[2],s=Xn(this,c,u,n),!s)throw new Re(`Graph.${t}: could not find an edge for the given path ("${c}" - "${u}").`)}else{if(n!=="mixed")throw new $e(`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(a=""+a,s=this._edges.get(a),!s)throw new Re(`Graph.${t}: could not find the "${a}" edge in the graph.`)}if(!Qt(o))throw new De(`Graph.${t}: provided attributes are not a plain object.`);return s.attributes=o,this.emit("edgeAttributesUpdated",{key:s.key,type:"replace",attributes:s.attributes}),this}}function c4(e,t,n){e.prototype[t]=function(a,o){let s;if(this.type!=="mixed"&&n!=="mixed"&&n!==this.type)throw new $e(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new $e(`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 c=""+a,u=""+o;if(o=arguments[2],s=Xn(this,c,u,n),!s)throw new Re(`Graph.${t}: could not find an edge for the given path ("${c}" - "${u}").`)}else{if(n!=="mixed")throw new $e(`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(a=""+a,s=this._edges.get(a),!s)throw new Re(`Graph.${t}: could not find the "${a}" edge in the graph.`)}if(!Qt(o))throw new De(`Graph.${t}: provided attributes are not a plain object.`);return Pt(s.attributes,o),this.emit("edgeAttributesUpdated",{key:s.key,type:"merge",attributes:s.attributes,data:o}),this}}function u4(e,t,n){e.prototype[t]=function(a,o){let s;if(this.type!=="mixed"&&n!=="mixed"&&n!==this.type)throw new $e(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new $e(`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 c=""+a,u=""+o;if(o=arguments[2],s=Xn(this,c,u,n),!s)throw new Re(`Graph.${t}: could not find an edge for the given path ("${c}" - "${u}").`)}else{if(n!=="mixed")throw new $e(`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(a=""+a,s=this._edges.get(a),!s)throw new Re(`Graph.${t}: could not find the "${a}" edge in the graph.`)}if(typeof o!="function")throw new De(`Graph.${t}: provided updater is not a function.`);return s.attributes=o(s.attributes),this.emit("edgeAttributesUpdated",{key:s.key,type:"update",attributes:s.attributes}),this}}const d4=[{name:e=>`get${e}Attribute`,attacher:n4},{name:e=>`get${e}Attributes`,attacher:r4},{name:e=>`has${e}Attribute`,attacher:a4},{name:e=>`set${e}Attribute`,attacher:i4},{name:e=>`update${e}Attribute`,attacher:o4},{name:e=>`remove${e}Attribute`,attacher:s4},{name:e=>`replace${e}Attributes`,attacher:l4},{name:e=>`merge${e}Attributes`,attacher:c4},{name:e=>`update${e}Attributes`,attacher:u4}];function f4(e){d4.forEach(function({name:t,attacher:n}){n(e,t("Edge"),"mixed"),n(e,t("DirectedEdge"),"directed"),n(e,t("UndirectedEdge"),"undirected")})}const h4=[{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 p4(e,t,n,a){let o=!1;for(const s in t){if(s===a)continue;const c=t[s];if(o=n(c.key,c.attributes,c.source.key,c.target.key,c.source.attributes,c.target.attributes,c.undirected),e&&o)return c.key}}function m4(e,t,n,a){let o,s,c,u=!1;for(const f in t)if(f!==a){o=t[f];do{if(s=o.source,c=o.target,u=n(o.key,o.attributes,s.key,c.key,s.attributes,c.attributes,o.undirected),e&&u)return o.key;o=o.next}while(o!==void 0)}}function ap(e,t){const n=Object.keys(e),a=n.length;let o,s=0;return{[Symbol.iterator](){return this},next(){do if(o)o=o.next;else{if(s>=a)return{done:!0};const c=n[s++];if(c===t){o=void 0;continue}o=e[c]}while(!o);return{done:!1,value:{edge:o.key,attributes:o.attributes,source:o.source.key,target:o.target.key,sourceAttributes:o.source.attributes,targetAttributes:o.target.attributes,undirected:o.undirected}}}}}function g4(e,t,n,a){const o=t[n];if(!o)return;const s=o.source,c=o.target;if(a(o.key,o.attributes,s.key,c.key,s.attributes,c.attributes,o.undirected)&&e)return o.key}function v4(e,t,n,a){let o=t[n];if(!o)return;let s=!1;do{if(s=a(o.key,o.attributes,o.source.key,o.target.key,o.source.attributes,o.target.attributes,o.undirected),e&&s)return o.key;o=o.next}while(o!==void 0)}function ip(e,t){let n=e[t];if(n.next!==void 0)return{[Symbol.iterator](){return this},next(){if(!n)return{done:!0};const o={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:o}}};let a=!1;return{[Symbol.iterator](){return this},next(){return a===!0?{done:!0}:(a=!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 y4(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,a=new Array(n),o=t==="undirected",s=e._edges.values();let c=0,u,f;for(;u=s.next(),u.done!==!0;)f=u.value,f.undirected===o&&(a[c++]=f.key);return a}function cC(e,t,n,a){if(t.size===0)return;const o=n!=="mixed"&&n!==t.type,s=n==="undirected";let c,u,f=!1;const h=t._edges.values();for(;c=h.next(),c.done!==!0;){if(u=c.value,o&&u.undirected!==s)continue;const{key:m,attributes:g,source:y,target:b}=u;if(f=a(m,g,y.key,b.key,y.attributes,b.attributes,u.undirected),e&&f)return m}}function b4(e,t){if(e.size===0)return qo();const n=t!=="mixed"&&t!==e.type,a=t==="undirected",o=e._edges.values();return{[Symbol.iterator](){return this},next(){let s,c;for(;;){if(s=o.next(),s.done)return s;if(c=s.value,!(n&&c.undirected!==a))break}return{value:{edge:c.key,attributes:c.attributes,source:c.source.key,target:c.target.key,sourceAttributes:c.source.attributes,targetAttributes:c.target.attributes,undirected:c.undirected},done:!1}}}}function Fg(e,t,n,a,o,s){const c=t?m4:p4;let u;if(n!=="undirected"&&(a!=="out"&&(u=c(e,o.in,s),e&&u)||a!=="in"&&(u=c(e,o.out,s,a?void 0:o.key),e&&u))||n!=="directed"&&(u=c(e,o.undirected,s),e&&u))return u}function x4(e,t,n,a){const o=[];return Fg(!1,e,t,n,a,function(s){o.push(s)}),o}function w4(e,t,n){let a=qo();return e!=="undirected"&&(t!=="out"&&typeof n.in<"u"&&(a=ra(a,ap(n.in))),t!=="in"&&typeof n.out<"u"&&(a=ra(a,ap(n.out,t?void 0:n.key)))),e!=="directed"&&typeof n.undirected<"u"&&(a=ra(a,ap(n.undirected))),a}function Ug(e,t,n,a,o,s,c){const u=n?v4:g4;let f;if(t!=="undirected"&&(typeof o.in<"u"&&a!=="out"&&(f=u(e,o.in,s,c),e&&f)||typeof o.out<"u"&&a!=="in"&&(a||o.key!==s)&&(f=u(e,o.out,s,c),e&&f))||t!=="directed"&&typeof o.undirected<"u"&&(f=u(e,o.undirected,s,c),e&&f))return f}function E4(e,t,n,a,o){const s=[];return Ug(!1,e,t,n,a,o,function(c){s.push(c)}),s}function S4(e,t,n,a){let o=qo();return e!=="undirected"&&(typeof n.in<"u"&&t!=="out"&&a in n.in&&(o=ra(o,ip(n.in,a))),typeof n.out<"u"&&t!=="in"&&a in n.out&&(t||n.key!==a)&&(o=ra(o,ip(n.out,a)))),e!=="directed"&&typeof n.undirected<"u"&&a in n.undirected&&(o=ra(o,ip(n.undirected,a))),o}function _4(e,t){const{name:n,type:a,direction:o}=t;e.prototype[n]=function(s,c){if(a!=="mixed"&&this.type!=="mixed"&&a!==this.type)return[];if(!arguments.length)return y4(this,a);if(arguments.length===1){s=""+s;const u=this._nodes.get(s);if(typeof u>"u")throw new Re(`Graph.${n}: could not find the "${s}" node in the graph.`);return x4(this.multi,a==="mixed"?this.type:a,o,u)}if(arguments.length===2){s=""+s,c=""+c;const u=this._nodes.get(s);if(!u)throw new Re(`Graph.${n}: could not find the "${s}" source node in the graph.`);if(!this._nodes.has(c))throw new Re(`Graph.${n}: could not find the "${c}" target node in the graph.`);return E4(a,this.multi,o,u,c)}throw new De(`Graph.${n}: too many arguments (expecting 0, 1 or 2 and got ${arguments.length}).`)}}function C4(e,t){const{name:n,type:a,direction:o}=t,s="forEach"+n[0].toUpperCase()+n.slice(1,-1);e.prototype[s]=function(h,m,g){if(!(a!=="mixed"&&this.type!=="mixed"&&a!==this.type)){if(arguments.length===1)return g=h,cC(!1,this,a,g);if(arguments.length===2){h=""+h,g=m;const y=this._nodes.get(h);if(typeof y>"u")throw new Re(`Graph.${s}: could not find the "${h}" node in the graph.`);return Fg(!1,this.multi,a==="mixed"?this.type:a,o,y,g)}if(arguments.length===3){h=""+h,m=""+m;const y=this._nodes.get(h);if(!y)throw new Re(`Graph.${s}: could not find the "${h}" source node in the graph.`);if(!this._nodes.has(m))throw new Re(`Graph.${s}: could not find the "${m}" target node in the graph.`);return Ug(!1,a,this.multi,o,y,m,g)}throw new De(`Graph.${s}: too many arguments (expecting 1, 2 or 3 and got ${arguments.length}).`)}};const c="map"+n[0].toUpperCase()+n.slice(1);e.prototype[c]=function(){const h=Array.prototype.slice.call(arguments),m=h.pop();let g;if(h.length===0){let y=0;a!=="directed"&&(y+=this.undirectedSize),a!=="undirected"&&(y+=this.directedSize),g=new Array(y);let b=0;h.push((S,E,_,N,C,A,k)=>{g[b++]=m(S,E,_,N,C,A,k)})}else g=[],h.push((y,b,S,E,_,N,C)=>{g.push(m(y,b,S,E,_,N,C))});return this[s].apply(this,h),g};const u="filter"+n[0].toUpperCase()+n.slice(1);e.prototype[u]=function(){const h=Array.prototype.slice.call(arguments),m=h.pop(),g=[];return h.push((y,b,S,E,_,N,C)=>{m(y,b,S,E,_,N,C)&&g.push(y)}),this[s].apply(this,h),g};const f="reduce"+n[0].toUpperCase()+n.slice(1);e.prototype[f]=function(){let h=Array.prototype.slice.call(arguments);if(h.length<2||h.length>4)throw new De(`Graph.${f}: invalid number of arguments (expecting 2, 3 or 4 and got ${h.length}).`);if(typeof h[h.length-1]=="function"&&typeof h[h.length-2]!="function")throw new De(`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 m,g;h.length===2?(m=h[0],g=h[1],h=[]):h.length===3?(m=h[1],g=h[2],h=[h[0]]):h.length===4&&(m=h[2],g=h[3],h=[h[0],h[1]]);let y=g;return h.push((b,S,E,_,N,C,A)=>{y=m(y,b,S,E,_,N,C,A)}),this[s].apply(this,h),y}}function T4(e,t){const{name:n,type:a,direction:o}=t,s="find"+n[0].toUpperCase()+n.slice(1,-1);e.prototype[s]=function(f,h,m){if(a!=="mixed"&&this.type!=="mixed"&&a!==this.type)return!1;if(arguments.length===1)return m=f,cC(!0,this,a,m);if(arguments.length===2){f=""+f,m=h;const g=this._nodes.get(f);if(typeof g>"u")throw new Re(`Graph.${s}: could not find the "${f}" node in the graph.`);return Fg(!0,this.multi,a==="mixed"?this.type:a,o,g,m)}if(arguments.length===3){f=""+f,h=""+h;const g=this._nodes.get(f);if(!g)throw new Re(`Graph.${s}: could not find the "${f}" source node in the graph.`);if(!this._nodes.has(h))throw new Re(`Graph.${s}: could not find the "${h}" target node in the graph.`);return Ug(!0,a,this.multi,o,g,h,m)}throw new De(`Graph.${s}: too many arguments (expecting 1, 2 or 3 and got ${arguments.length}).`)};const c="some"+n[0].toUpperCase()+n.slice(1,-1);e.prototype[c]=function(){const f=Array.prototype.slice.call(arguments),h=f.pop();return f.push((g,y,b,S,E,_,N)=>h(g,y,b,S,E,_,N)),!!this[s].apply(this,f)};const u="every"+n[0].toUpperCase()+n.slice(1,-1);e.prototype[u]=function(){const f=Array.prototype.slice.call(arguments),h=f.pop();return f.push((g,y,b,S,E,_,N)=>!h(g,y,b,S,E,_,N)),!this[s].apply(this,f)}}function R4(e,t){const{name:n,type:a,direction:o}=t,s=n.slice(0,-1)+"Entries";e.prototype[s]=function(c,u){if(a!=="mixed"&&this.type!=="mixed"&&a!==this.type)return qo();if(!arguments.length)return b4(this,a);if(arguments.length===1){c=""+c;const f=this._nodes.get(c);if(!f)throw new Re(`Graph.${s}: could not find the "${c}" node in the graph.`);return w4(a,o,f)}if(arguments.length===2){c=""+c,u=""+u;const f=this._nodes.get(c);if(!f)throw new Re(`Graph.${s}: could not find the "${c}" source node in the graph.`);if(!this._nodes.has(u))throw new Re(`Graph.${s}: could not find the "${u}" target node in the graph.`);return S4(a,o,f,u)}throw new De(`Graph.${s}: too many arguments (expecting 0, 1 or 2 and got ${arguments.length}).`)}}function A4(e){h4.forEach(t=>{_4(e,t),C4(e,t),T4(e,t),R4(e,t)})}const D4=[{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 yd(){this.A=null,this.B=null}yd.prototype.wrap=function(e){this.A===null?this.A=e:this.B===null&&(this.B=e)};yd.prototype.has=function(e){return this.A!==null&&e in this.A||this.B!==null&&e in this.B};function Xs(e,t,n,a,o){for(const s in a){const c=a[s],u=c.source,f=c.target,h=u===n?f:u;if(t&&t.has(h.key))continue;const m=o(h.key,h.attributes);if(e&&m)return h.key}}function Bg(e,t,n,a,o){if(t!=="mixed"){if(t==="undirected")return Xs(e,null,a,a.undirected,o);if(typeof n=="string")return Xs(e,null,a,a[n],o)}const s=new yd;let c;if(t!=="undirected"){if(n!=="out"){if(c=Xs(e,null,a,a.in,o),e&&c)return c;s.wrap(a.in)}if(n!=="in"){if(c=Xs(e,s,a,a.out,o),e&&c)return c;s.wrap(a.out)}}if(t!=="directed"&&(c=Xs(e,s,a,a.undirected,o),e&&c))return c}function k4(e,t,n){if(e!=="mixed"){if(e==="undirected")return Object.keys(n.undirected);if(typeof t=="string")return Object.keys(n[t])}const a=[];return Bg(!1,e,t,n,function(o){a.push(o)}),a}function Ks(e,t,n){const a=Object.keys(n),o=a.length;let s=0;return{[Symbol.iterator](){return this},next(){let c=null;do{if(s>=o)return e&&e.wrap(n),{done:!0};const u=n[a[s++]],f=u.source,h=u.target;if(c=f===t?h:f,e&&e.has(c.key)){c=null;continue}}while(c===null);return{done:!1,value:{neighbor:c.key,attributes:c.attributes}}}}}function N4(e,t,n){if(e!=="mixed"){if(e==="undirected")return Ks(null,n,n.undirected);if(typeof t=="string")return Ks(null,n,n[t])}let a=qo();const o=new yd;return e!=="undirected"&&(t!=="out"&&(a=ra(a,Ks(o,n,n.in))),t!=="in"&&(a=ra(a,Ks(o,n,n.out)))),e!=="directed"&&(a=ra(a,Ks(o,n,n.undirected))),a}function O4(e,t){const{name:n,type:a,direction:o}=t;e.prototype[n]=function(s){if(a!=="mixed"&&this.type!=="mixed"&&a!==this.type)return[];s=""+s;const c=this._nodes.get(s);if(typeof c>"u")throw new Re(`Graph.${n}: could not find the "${s}" node in the graph.`);return k4(a==="mixed"?this.type:a,o,c)}}function j4(e,t){const{name:n,type:a,direction:o}=t,s="forEach"+n[0].toUpperCase()+n.slice(1,-1);e.prototype[s]=function(h,m){if(a!=="mixed"&&this.type!=="mixed"&&a!==this.type)return;h=""+h;const g=this._nodes.get(h);if(typeof g>"u")throw new Re(`Graph.${s}: could not find the "${h}" node in the graph.`);Bg(!1,a==="mixed"?this.type:a,o,g,m)};const c="map"+n[0].toUpperCase()+n.slice(1);e.prototype[c]=function(h,m){const g=[];return this[s](h,(y,b)=>{g.push(m(y,b))}),g};const u="filter"+n[0].toUpperCase()+n.slice(1);e.prototype[u]=function(h,m){const g=[];return this[s](h,(y,b)=>{m(y,b)&&g.push(y)}),g};const f="reduce"+n[0].toUpperCase()+n.slice(1);e.prototype[f]=function(h,m,g){if(arguments.length<3)throw new De(`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 y=g;return this[s](h,(b,S)=>{y=m(y,b,S)}),y}}function L4(e,t){const{name:n,type:a,direction:o}=t,s=n[0].toUpperCase()+n.slice(1,-1),c="find"+s;e.prototype[c]=function(h,m){if(a!=="mixed"&&this.type!=="mixed"&&a!==this.type)return;h=""+h;const g=this._nodes.get(h);if(typeof g>"u")throw new Re(`Graph.${c}: could not find the "${h}" node in the graph.`);return Bg(!0,a==="mixed"?this.type:a,o,g,m)};const u="some"+s;e.prototype[u]=function(h,m){return!!this[c](h,m)};const f="every"+s;e.prototype[f]=function(h,m){return!this[c](h,(y,b)=>!m(y,b))}}function z4(e,t){const{name:n,type:a,direction:o}=t,s=n.slice(0,-1)+"Entries";e.prototype[s]=function(c){if(a!=="mixed"&&this.type!=="mixed"&&a!==this.type)return qo();c=""+c;const u=this._nodes.get(c);if(typeof u>"u")throw new Re(`Graph.${s}: could not find the "${c}" node in the graph.`);return N4(a==="mixed"?this.type:a,o,u)}}function M4(e){D4.forEach(t=>{O4(e,t),j4(e,t),L4(e,t),z4(e,t)})}function Kc(e,t,n,a,o){const s=a._nodes.values(),c=a.type;let u,f,h,m,g,y;for(;u=s.next(),u.done!==!0;){let b=!1;if(f=u.value,c!=="undirected"){m=f.out;for(h in m){g=m[h];do y=g.target,b=!0,o(f.key,y.key,f.attributes,y.attributes,g.key,g.attributes,g.undirected),g=g.next;while(g)}}if(c!=="directed"){m=f.undirected;for(h in m)if(!(t&&f.key>h)){g=m[h];do y=g.target,y.key!==h&&(y=g.source),b=!0,o(f.key,y.key,f.attributes,y.attributes,g.key,g.attributes,g.undirected),g=g.next;while(g)}}n&&!b&&o(f.key,null,f.attributes,null,null,null,null)}}function P4(e,t){const n={key:e};return nC(t.attributes)||(n.attributes=Pt({},t.attributes)),n}function G4(e,t,n){const a={key:t,source:n.source.key,target:n.target.key};return nC(n.attributes)||(a.attributes=Pt({},n.attributes)),e==="mixed"&&n.undirected&&(a.undirected=!0),a}function F4(e){if(!Qt(e))throw new De('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 De("Graph.import: serialized node is missing its key.");if("attributes"in e&&(!Qt(e.attributes)||e.attributes===null))throw new De("Graph.import: invalid attributes. Attributes should be a plain object, null or omitted.")}function U4(e){if(!Qt(e))throw new De('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 De("Graph.import: serialized edge is missing its source.");if(!("target"in e))throw new De("Graph.import: serialized edge is missing its target.");if("attributes"in e&&(!Qt(e.attributes)||e.attributes===null))throw new De("Graph.import: invalid attributes. Attributes should be a plain object, null or omitted.");if("undirected"in e&&typeof e.undirected!="boolean")throw new De("Graph.import: invalid undirectedness information. Undirected should be boolean or omitted.")}const B4=HP(),I4=new Set(["directed","undirected","mixed"]),K0=new Set(["domain","_events","_eventsCount","_maxListeners"]),H4=[{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"}],$4={allowSelfLoops:!0,multi:!1,type:"mixed"};function V4(e,t,n){if(n&&!Qt(n))throw new De(`Graph.addNode: invalid attributes. Expecting an object but got "${n}"`);if(t=""+t,n=n||{},e._nodes.has(t))throw new $e(`Graph.addNode: the "${t}" node already exist in the graph.`);const a=new e.NodeDataClass(t,n);return e._nodes.set(t,a),e.emit("nodeAdded",{key:t,attributes:n}),a}function Z0(e,t,n){const a=new e.NodeDataClass(t,n);return e._nodes.set(t,a),e.emit("nodeAdded",{key:t,attributes:n}),a}function uC(e,t,n,a,o,s,c,u){if(!a&&e.type==="undirected")throw new $e(`Graph.${t}: you cannot add a directed edge to an undirected graph. Use the #.addEdge or #.addUndirectedEdge instead.`);if(a&&e.type==="directed")throw new $e(`Graph.${t}: you cannot add an undirected edge to a directed graph. Use the #.addEdge or #.addDirectedEdge instead.`);if(u&&!Qt(u))throw new De(`Graph.${t}: invalid attributes. Expecting an object but got "${u}"`);if(s=""+s,c=""+c,u=u||{},!e.allowSelfLoops&&s===c)throw new $e(`Graph.${t}: source & target are the same ("${s}"), thus creating a loop explicitly forbidden by this graph 'allowSelfLoops' option set to false.`);const f=e._nodes.get(s),h=e._nodes.get(c);if(!f)throw new Re(`Graph.${t}: source node "${s}" not found.`);if(!h)throw new Re(`Graph.${t}: target node "${c}" not found.`);const m={key:null,undirected:a,source:s,target:c,attributes:u};if(n)o=e._edgeKeyGenerator();else if(o=""+o,e._edges.has(o))throw new $e(`Graph.${t}: the "${o}" edge already exists in the graph.`);if(!e.multi&&(a?typeof f.undirected[c]<"u":typeof f.out[c]<"u"))throw new $e(`Graph.${t}: an edge linking "${s}" to "${c}" 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 g=new Yo(a,o,f,h,u);e._edges.set(o,g);const y=s===c;return a?(f.undirectedDegree++,h.undirectedDegree++,y&&(f.undirectedLoops++,e._undirectedSelfLoopCount++)):(f.outDegree++,h.inDegree++,y&&(f.directedLoops++,e._directedSelfLoopCount++)),e.multi?g.attachMulti():g.attach(),a?e._undirectedSize++:e._directedSize++,m.key=o,e.emit("edgeAdded",m),o}function q4(e,t,n,a,o,s,c,u,f){if(!a&&e.type==="undirected")throw new $e(`Graph.${t}: you cannot merge/update a directed edge to an undirected graph. Use the #.mergeEdge/#.updateEdge or #.addUndirectedEdge instead.`);if(a&&e.type==="directed")throw new $e(`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 De(`Graph.${t}: invalid updater function. Expecting a function but got "${u}"`)}else if(!Qt(u))throw new De(`Graph.${t}: invalid attributes. Expecting an object but got "${u}"`)}s=""+s,c=""+c;let h;if(f&&(h=u,u=void 0),!e.allowSelfLoops&&s===c)throw new $e(`Graph.${t}: source & target are the same ("${s}"), thus creating a loop explicitly forbidden by this graph 'allowSelfLoops' option set to false.`);let m=e._nodes.get(s),g=e._nodes.get(c),y,b;if(!n&&(y=e._edges.get(o),y)){if((y.source.key!==s||y.target.key!==c)&&(!a||y.source.key!==c||y.target.key!==s))throw new $e(`Graph.${t}: inconsistency detected when attempting to merge the "${o}" edge with "${s}" source & "${c}" target vs. ("${y.source.key}", "${y.target.key}").`);b=y}if(!b&&!e.multi&&m&&(b=a?m.undirected[c]:m.out[c]),b){const C=[b.key,!1,!1,!1];if(f?!h:!u)return C;if(f){const A=b.attributes;b.attributes=h(A),e.emit("edgeAttributesUpdated",{type:"replace",key:b.key,attributes:b.attributes})}else Pt(b.attributes,u),e.emit("edgeAttributesUpdated",{type:"merge",key:b.key,attributes:b.attributes,data:u});return C}u=u||{},f&&h&&(u=h(u));const S={key:null,undirected:a,source:s,target:c,attributes:u};if(n)o=e._edgeKeyGenerator();else if(o=""+o,e._edges.has(o))throw new $e(`Graph.${t}: the "${o}" edge already exists in the graph.`);let E=!1,_=!1;m||(m=Z0(e,s,{}),E=!0,s===c&&(g=m,_=!0)),g||(g=Z0(e,c,{}),_=!0),y=new Yo(a,o,m,g,u),e._edges.set(o,y);const N=s===c;return a?(m.undirectedDegree++,g.undirectedDegree++,N&&(m.undirectedLoops++,e._undirectedSelfLoopCount++)):(m.outDegree++,g.inDegree++,N&&(m.directedLoops++,e._directedSelfLoopCount++)),e.multi?y.attachMulti():y.attach(),a?e._undirectedSize++:e._directedSize++,S.key=o,e.emit("edgeAdded",S),[o,!0,E,_]}function Eo(e,t){e._edges.delete(t.key);const{source:n,target:a,attributes:o}=t,s=t.undirected,c=n===a;s?(n.undirectedDegree--,a.undirectedDegree--,c&&(n.undirectedLoops--,e._undirectedSelfLoopCount--)):(n.outDegree--,a.inDegree--,c&&(n.directedLoops--,e._directedSelfLoopCount--)),e.multi?t.detachMulti():t.detach(),s?e._undirectedSize--:e._directedSize--,e.emit("edgeDropped",{key:t.key,attributes:o,source:n.key,target:a.key,undirected:s})}class ft extends tC.EventEmitter{constructor(t){if(super(),t=Pt({},$4,t),typeof t.multi!="boolean")throw new De(`Graph.constructor: invalid 'multi' option. Expecting a boolean but got "${t.multi}".`);if(!I4.has(t.type))throw new De(`Graph.constructor: invalid 'type' option. Should be one of "mixed", "directed" or "undirected" but got "${t.type}".`);if(typeof t.allowSelfLoops!="boolean")throw new De(`Graph.constructor: invalid 'allowSelfLoops' option. Expecting a boolean but got "${t.allowSelfLoops}".`);const n=t.type==="mixed"?rC:t.type==="directed"?aC:iC;Wn(this,"NodeDataClass",n);const a="geid_"+B4()+"_";let o=0;const s=()=>{let c;do c=a+o++;while(this._edges.has(c));return c};Wn(this,"_attributes",{}),Wn(this,"_nodes",new Map),Wn(this,"_edges",new Map),Wn(this,"_directedSize",0),Wn(this,"_undirectedSize",0),Wn(this,"_directedSelfLoopCount",0),Wn(this,"_undirectedSelfLoopCount",0),Wn(this,"_edgeKeyGenerator",s),Wn(this,"_options",t),K0.forEach(c=>Wn(this,c,this[c])),ir(this,"order",()=>this._nodes.size),ir(this,"size",()=>this._edges.size),ir(this,"directedSize",()=>this._directedSize),ir(this,"undirectedSize",()=>this._undirectedSize),ir(this,"selfLoopCount",()=>this._directedSelfLoopCount+this._undirectedSelfLoopCount),ir(this,"directedSelfLoopCount",()=>this._directedSelfLoopCount),ir(this,"undirectedSelfLoopCount",()=>this._undirectedSelfLoopCount),ir(this,"multi",this._options.multi),ir(this,"type",this._options.type),ir(this,"allowSelfLoops",this._options.allowSelfLoops),ir(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 a=""+t,o=this._edges.get(a);return!!o&&!o.undirected}else if(arguments.length===2){t=""+t,n=""+n;const a=this._nodes.get(t);return a?a.out.hasOwnProperty(n):!1}throw new De(`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 a=""+t,o=this._edges.get(a);return!!o&&o.undirected}else if(arguments.length===2){t=""+t,n=""+n;const a=this._nodes.get(t);return a?a.undirected.hasOwnProperty(n):!1}throw new De(`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 a=""+t;return this._edges.has(a)}else if(arguments.length===2){t=""+t,n=""+n;const a=this._nodes.get(t);return a?typeof a.out<"u"&&a.out.hasOwnProperty(n)||typeof a.undirected<"u"&&a.undirected.hasOwnProperty(n):!1}throw new De(`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 $e("Graph.directedEdge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.directedEdges instead.");const a=this._nodes.get(t);if(!a)throw new Re(`Graph.directedEdge: could not find the "${t}" source node in the graph.`);if(!this._nodes.has(n))throw new Re(`Graph.directedEdge: could not find the "${n}" target node in the graph.`);const o=a.out&&a.out[n]||void 0;if(o)return o.key}undirectedEdge(t,n){if(this.type==="directed")return;if(t=""+t,n=""+n,this.multi)throw new $e("Graph.undirectedEdge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.undirectedEdges instead.");const a=this._nodes.get(t);if(!a)throw new Re(`Graph.undirectedEdge: could not find the "${t}" source node in the graph.`);if(!this._nodes.has(n))throw new Re(`Graph.undirectedEdge: could not find the "${n}" target node in the graph.`);const o=a.undirected&&a.undirected[n]||void 0;if(o)return o.key}edge(t,n){if(this.multi)throw new $e("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 a=this._nodes.get(t);if(!a)throw new Re(`Graph.edge: could not find the "${t}" source node in the graph.`);if(!this._nodes.has(n))throw new Re(`Graph.edge: could not find the "${n}" target node in the graph.`);const o=a.out&&a.out[n]||a.undirected&&a.undirected[n]||void 0;if(o)return o.key}areDirectedNeighbors(t,n){t=""+t,n=""+n;const a=this._nodes.get(t);if(!a)throw new Re(`Graph.areDirectedNeighbors: could not find the "${t}" node in the graph.`);return this.type==="undirected"?!1:n in a.in||n in a.out}areOutNeighbors(t,n){t=""+t,n=""+n;const a=this._nodes.get(t);if(!a)throw new Re(`Graph.areOutNeighbors: could not find the "${t}" node in the graph.`);return this.type==="undirected"?!1:n in a.out}areInNeighbors(t,n){t=""+t,n=""+n;const a=this._nodes.get(t);if(!a)throw new Re(`Graph.areInNeighbors: could not find the "${t}" node in the graph.`);return this.type==="undirected"?!1:n in a.in}areUndirectedNeighbors(t,n){t=""+t,n=""+n;const a=this._nodes.get(t);if(!a)throw new Re(`Graph.areUndirectedNeighbors: could not find the "${t}" node in the graph.`);return this.type==="directed"?!1:n in a.undirected}areNeighbors(t,n){t=""+t,n=""+n;const a=this._nodes.get(t);if(!a)throw new Re(`Graph.areNeighbors: could not find the "${t}" node in the graph.`);return this.type!=="undirected"&&(n in a.in||n in a.out)||this.type!=="directed"&&n in a.undirected}areInboundNeighbors(t,n){t=""+t,n=""+n;const a=this._nodes.get(t);if(!a)throw new Re(`Graph.areInboundNeighbors: could not find the "${t}" node in the graph.`);return this.type!=="undirected"&&n in a.in||this.type!=="directed"&&n in a.undirected}areOutboundNeighbors(t,n){t=""+t,n=""+n;const a=this._nodes.get(t);if(!a)throw new Re(`Graph.areOutboundNeighbors: could not find the "${t}" node in the graph.`);return this.type!=="undirected"&&n in a.out||this.type!=="directed"&&n in a.undirected}inDegree(t){t=""+t;const n=this._nodes.get(t);if(!n)throw new Re(`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 Re(`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 Re(`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 Re(`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 Re(`Graph.inboundDegree: could not find the "${t}" node in the graph.`);let a=0;return this.type!=="directed"&&(a+=n.undirectedDegree),this.type!=="undirected"&&(a+=n.inDegree),a}outboundDegree(t){t=""+t;const n=this._nodes.get(t);if(!n)throw new Re(`Graph.outboundDegree: could not find the "${t}" node in the graph.`);let a=0;return this.type!=="directed"&&(a+=n.undirectedDegree),this.type!=="undirected"&&(a+=n.outDegree),a}degree(t){t=""+t;const n=this._nodes.get(t);if(!n)throw new Re(`Graph.degree: could not find the "${t}" node in the graph.`);let a=0;return this.type!=="directed"&&(a+=n.undirectedDegree),this.type!=="undirected"&&(a+=n.inDegree+n.outDegree),a}inDegreeWithoutSelfLoops(t){t=""+t;const n=this._nodes.get(t);if(!n)throw new Re(`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 Re(`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 Re(`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 Re(`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 Re(`Graph.inboundDegreeWithoutSelfLoops: could not find the "${t}" node in the graph.`);let a=0,o=0;return this.type!=="directed"&&(a+=n.undirectedDegree,o+=n.undirectedLoops*2),this.type!=="undirected"&&(a+=n.inDegree,o+=n.directedLoops),a-o}outboundDegreeWithoutSelfLoops(t){t=""+t;const n=this._nodes.get(t);if(!n)throw new Re(`Graph.outboundDegreeWithoutSelfLoops: could not find the "${t}" node in the graph.`);let a=0,o=0;return this.type!=="directed"&&(a+=n.undirectedDegree,o+=n.undirectedLoops*2),this.type!=="undirected"&&(a+=n.outDegree,o+=n.directedLoops),a-o}degreeWithoutSelfLoops(t){t=""+t;const n=this._nodes.get(t);if(!n)throw new Re(`Graph.degreeWithoutSelfLoops: could not find the "${t}" node in the graph.`);let a=0,o=0;return this.type!=="directed"&&(a+=n.undirectedDegree,o+=n.undirectedLoops*2),this.type!=="undirected"&&(a+=n.inDegree+n.outDegree,o+=n.directedLoops*2),a-o}source(t){t=""+t;const n=this._edges.get(t);if(!n)throw new Re(`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 Re(`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 Re(`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 a=this._edges.get(n);if(!a)throw new Re(`Graph.opposite: could not find the "${n}" edge in the graph.`);const o=a.source.key,s=a.target.key;if(t===o)return s;if(t===s)return o;throw new Re(`Graph.opposite: the "${t}" node is not attached to the "${n}" edge (${o}, ${s}).`)}hasExtremity(t,n){t=""+t,n=""+n;const a=this._edges.get(t);if(!a)throw new Re(`Graph.hasExtremity: could not find the "${t}" edge in the graph.`);return a.source.key===n||a.target.key===n}isUndirected(t){t=""+t;const n=this._edges.get(t);if(!n)throw new Re(`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 Re(`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 Re(`Graph.isSelfLoop: could not find the "${t}" edge in the graph.`);return n.source===n.target}addNode(t,n){return V4(this,t,n).key}mergeNode(t,n){if(n&&!Qt(n))throw new De(`Graph.mergeNode: invalid attributes. Expecting an object but got "${n}"`);t=""+t,n=n||{};let a=this._nodes.get(t);return a?(n&&(Pt(a.attributes,n),this.emit("nodeAttributesUpdated",{type:"merge",key:t,attributes:a.attributes,data:n})),[t,!1]):(a=new this.NodeDataClass(t,n),this._nodes.set(t,a),this.emit("nodeAdded",{key:t,attributes:n}),[t,!0])}updateNode(t,n){if(n&&typeof n!="function")throw new De(`Graph.updateNode: invalid updater function. Expecting a function but got "${n}"`);t=""+t;let a=this._nodes.get(t);if(a){if(n){const s=a.attributes;a.attributes=n(s),this.emit("nodeAttributesUpdated",{type:"replace",key:t,attributes:a.attributes})}return[t,!1]}const o=n?n({}):{};return a=new this.NodeDataClass(t,o),this._nodes.set(t,a),this.emit("nodeAdded",{key:t,attributes:o}),[t,!0]}dropNode(t){t=""+t;const n=this._nodes.get(t);if(!n)throw new Re(`Graph.dropNode: could not find the "${t}" node in the graph.`);let a;if(this.type!=="undirected"){for(const o in n.out){a=n.out[o];do Eo(this,a),a=a.next;while(a)}for(const o in n.in){a=n.in[o];do Eo(this,a),a=a.next;while(a)}}if(this.type!=="directed")for(const o in n.undirected){a=n.undirected[o];do Eo(this,a),a=a.next;while(a)}this._nodes.delete(t),this.emit("nodeDropped",{key:t,attributes:n.attributes})}dropEdge(t){let n;if(arguments.length>1){const a=""+arguments[0],o=""+arguments[1];if(n=Xn(this,a,o,this.type),!n)throw new Re(`Graph.dropEdge: could not find the "${a}" -> "${o}" edge in the graph.`)}else if(t=""+t,n=this._edges.get(t),!n)throw new Re(`Graph.dropEdge: could not find the "${t}" edge in the graph.`);return Eo(this,n),this}dropDirectedEdge(t,n){if(arguments.length<2)throw new $e("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 $e("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 a=Xn(this,t,n,"directed");if(!a)throw new Re(`Graph.dropDirectedEdge: could not find a "${t}" -> "${n}" edge in the graph.`);return Eo(this,a),this}dropUndirectedEdge(t,n){if(arguments.length<2)throw new $e("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 $e("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 a=Xn(this,t,n,"undirected");if(!a)throw new Re(`Graph.dropUndirectedEdge: could not find a "${t}" -> "${n}" edge in the graph.`);return Eo(this,a),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 De("Graph.updateAttribute: updater should be a function.");const a=this._attributes[t];return this._attributes[t]=n(a),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(!Qt(t))throw new De("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(!Qt(t))throw new De("Graph.mergeAttributes: provided attributes are not a plain object.");return Pt(this._attributes,t),this.emit("attributesUpdated",{type:"merge",attributes:this._attributes,data:t}),this}updateAttributes(t){if(typeof t!="function")throw new De("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 De("Graph.updateEachNodeAttributes: expecting an updater function.");if(n&&!X0(n))throw new De("Graph.updateEachNodeAttributes: invalid hints. Expecting an object having the following shape: {attributes?: [string]}");const a=this._nodes.values();let o,s;for(;o=a.next(),o.done!==!0;)s=o.value,s.attributes=t(s.key,s.attributes);this.emit("eachNodeAttributesUpdated",{hints:n||null})}updateEachEdgeAttributes(t,n){if(typeof t!="function")throw new De("Graph.updateEachEdgeAttributes: expecting an updater function.");if(n&&!X0(n))throw new De("Graph.updateEachEdgeAttributes: invalid hints. Expecting an object having the following shape: {attributes?: [string]}");const a=this._edges.values();let o,s,c,u;for(;o=a.next(),o.done!==!0;)s=o.value,c=s.source,u=s.target,s.attributes=t(s.key,s.attributes,c.key,u.key,c.attributes,u.attributes,s.undirected);this.emit("eachEdgeAttributesUpdated",{hints:n||null})}forEachAdjacencyEntry(t){if(typeof t!="function")throw new De("Graph.forEachAdjacencyEntry: expecting a callback.");Kc(!1,!1,!1,this,t)}forEachAdjacencyEntryWithOrphans(t){if(typeof t!="function")throw new De("Graph.forEachAdjacencyEntryWithOrphans: expecting a callback.");Kc(!1,!1,!0,this,t)}forEachAssymetricAdjacencyEntry(t){if(typeof t!="function")throw new De("Graph.forEachAssymetricAdjacencyEntry: expecting a callback.");Kc(!1,!0,!1,this,t)}forEachAssymetricAdjacencyEntryWithOrphans(t){if(typeof t!="function")throw new De("Graph.forEachAssymetricAdjacencyEntryWithOrphans: expecting a callback.");Kc(!1,!0,!0,this,t)}nodes(){return Array.from(this._nodes.keys())}forEachNode(t){if(typeof t!="function")throw new De("Graph.forEachNode: expecting a callback.");const n=this._nodes.values();let a,o;for(;a=n.next(),a.done!==!0;)o=a.value,t(o.key,o.attributes)}findNode(t){if(typeof t!="function")throw new De("Graph.findNode: expecting a callback.");const n=this._nodes.values();let a,o;for(;a=n.next(),a.done!==!0;)if(o=a.value,t(o.key,o.attributes))return o.key}mapNodes(t){if(typeof t!="function")throw new De("Graph.mapNode: expecting a callback.");const n=this._nodes.values();let a,o;const s=new Array(this.order);let c=0;for(;a=n.next(),a.done!==!0;)o=a.value,s[c++]=t(o.key,o.attributes);return s}someNode(t){if(typeof t!="function")throw new De("Graph.someNode: expecting a callback.");const n=this._nodes.values();let a,o;for(;a=n.next(),a.done!==!0;)if(o=a.value,t(o.key,o.attributes))return!0;return!1}everyNode(t){if(typeof t!="function")throw new De("Graph.everyNode: expecting a callback.");const n=this._nodes.values();let a,o;for(;a=n.next(),a.done!==!0;)if(o=a.value,!t(o.key,o.attributes))return!1;return!0}filterNodes(t){if(typeof t!="function")throw new De("Graph.filterNodes: expecting a callback.");const n=this._nodes.values();let a,o;const s=[];for(;a=n.next(),a.done!==!0;)o=a.value,t(o.key,o.attributes)&&s.push(o.key);return s}reduceNodes(t,n){if(typeof t!="function")throw new De("Graph.reduceNodes: expecting a callback.");if(arguments.length<2)throw new De("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 a=n;const o=this._nodes.values();let s,c;for(;s=o.next(),s.done!==!0;)c=s.value,a=t(a,c.key,c.attributes);return a}nodeEntries(){const t=this._nodes.values();return{[Symbol.iterator](){return this},next(){const n=t.next();if(n.done)return n;const a=n.value;return{value:{node:a.key,attributes:a.attributes},done:!1}}}}export(){const t=new Array(this._nodes.size);let n=0;this._nodes.forEach((o,s)=>{t[n++]=P4(s,o)});const a=new Array(this._edges.size);return n=0,this._edges.forEach((o,s)=>{a[n++]=G4(this.type,s,o)}),{options:{type:this.type,multi:this.multi,allowSelfLoops:this.allowSelfLoops},attributes:this.getAttributes(),nodes:t,edges:a}}import(t,n=!1){if(t instanceof ft)return t.forEachNode((f,h)=>{n?this.mergeNode(f,h):this.addNode(f,h)}),t.forEachEdge((f,h,m,g,y,b,S)=>{n?S?this.mergeUndirectedEdgeWithKey(f,m,g,h):this.mergeDirectedEdgeWithKey(f,m,g,h):S?this.addUndirectedEdgeWithKey(f,m,g,h):this.addDirectedEdgeWithKey(f,m,g,h)}),this;if(!Qt(t))throw new De("Graph.import: invalid argument. Expecting a serialized graph or, alternatively, a Graph instance.");if(t.attributes){if(!Qt(t.attributes))throw new De("Graph.import: invalid attributes. Expecting a plain object.");n?this.mergeAttributes(t.attributes):this.replaceAttributes(t.attributes)}let a,o,s,c,u;if(t.nodes){if(s=t.nodes,!Array.isArray(s))throw new De("Graph.import: invalid nodes. Expecting an array.");for(a=0,o=s.length;a{const s=Pt({},a.attributes);a=new n.NodeDataClass(o,s),n._nodes.set(o,a)}),n}copy(t){if(t=t||{},typeof t.type=="string"&&t.type!==this.type&&t.type!=="mixed")throw new $e(`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 $e("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 $e("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),a=this._edges.values();let o,s;for(;o=a.next(),o.done!==!0;)s=o.value,uC(n,"copy",!1,s.undirected,s.key,s.source.key,s.target.key,Pt({},s.attributes));return n}toJSON(){return this.export()}toString(){return"[object Graph]"}inspect(){const t={};this._nodes.forEach((s,c)=>{t[c]=s.attributes});const n={},a={};this._edges.forEach((s,c)=>{const u=s.undirected?"--":"->";let f="",h=s.source.key,m=s.target.key,g;s.undirected&&h>m&&(g=h,h=m,m=g);const y=`(${h})${u}(${m})`;c.startsWith("geid_")?this.multi&&(typeof a[y]>"u"?a[y]=0:a[y]++,f+=`${a[y]}. `):f+=`[${c}]: `,f+=y,n[f]=s.attributes});const o={};for(const s in this)this.hasOwnProperty(s)&&!K0.has(s)&&typeof this[s]!="function"&&typeof s!="symbol"&&(o[s]=this[s]);return o.attributes=this._attributes,o.nodes=t,o.edges=n,Wn(o,"constructor",this.constructor),o}}typeof Symbol<"u"&&(ft.prototype[Symbol.for("nodejs.util.inspect.custom")]=ft.prototype.inspect);H4.forEach(e=>{["add","merge","update"].forEach(t=>{const n=e.name(t),a=t==="add"?uC:q4;e.generateKey?ft.prototype[n]=function(o,s,c){return a(this,n,!0,(e.type||this.type)==="undirected",null,o,s,c,t==="update")}:ft.prototype[n]=function(o,s,c,u){return a(this,n,!1,(e.type||this.type)==="undirected",o,s,c,u,t==="update")}})});t4(ft);f4(ft);A4(ft);M4(ft);class dl extends ft{constructor(t){const n=Pt({type:"directed"},t);if("multi"in n&&n.multi!==!1)throw new De("DirectedGraph.from: inconsistent indication that the graph should be multi in given options!");if(n.type!=="directed")throw new De('DirectedGraph.from: inconsistent "'+n.type+'" type in given options!');super(n)}}class dC extends ft{constructor(t){const n=Pt({type:"undirected"},t);if("multi"in n&&n.multi!==!1)throw new De("UndirectedGraph.from: inconsistent indication that the graph should be multi in given options!");if(n.type!=="undirected")throw new De('UndirectedGraph.from: inconsistent "'+n.type+'" type in given options!');super(n)}}class fC extends ft{constructor(t){const n=Pt({multi:!0},t);if("multi"in n&&n.multi!==!0)throw new De("MultiGraph.from: inconsistent indication that the graph should be simple in given options!");super(n)}}class hC extends ft{constructor(t){const n=Pt({type:"directed",multi:!0},t);if("multi"in n&&n.multi!==!0)throw new De("MultiDirectedGraph.from: inconsistent indication that the graph should be simple in given options!");if(n.type!=="directed")throw new De('MultiDirectedGraph.from: inconsistent "'+n.type+'" type in given options!');super(n)}}class pC extends ft{constructor(t){const n=Pt({type:"undirected",multi:!0},t);if("multi"in n&&n.multi!==!0)throw new De("MultiUndirectedGraph.from: inconsistent indication that the graph should be simple in given options!");if(n.type!=="undirected")throw new De('MultiUndirectedGraph.from: inconsistent "'+n.type+'" type in given options!');super(n)}}function Wo(e){e.from=function(t,n){const a=Pt({},t.options,n),o=new e(a);return o.import(t),o}}Wo(ft);Wo(dl);Wo(dC);Wo(fC);Wo(hC);Wo(pC);ft.Graph=ft;ft.DirectedGraph=dl;ft.UndirectedGraph=dC;ft.MultiGraph=fC;ft.MultiDirectedGraph=hC;ft.MultiUndirectedGraph=pC;ft.InvalidArgumentsGraphError=De;ft.NotFoundGraphError=Re;ft.UsageGraphError=$e;function Y4(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var a=n.call(e,t);if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function ol(e){var t=Y4(e,"string");return typeof t=="symbol"?t:t+""}function $t(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Q0(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,a=Array(t);n>8&255,s=n>>16&255,c=n>>24&255;return[a,o,s,c]}var sp={};function xC(e){if(typeof sp[e]<"u")return sp[e];var t=(e&16711680)>>>16,n=(e&65280)>>>8,a=e&255,o=255,s=bC(t,n,a,o);return sp[e]=s,s}function J0(e,t,n,a){return n+(t<<8)+(e<<16)}function ew(e,t,n,a,o,s){var c=Math.floor(n/s*o),u=Math.floor(e.drawingBufferHeight/s-a/s*o),f=new Uint8Array(4);e.bindFramebuffer(e.FRAMEBUFFER,t),e.readPixels(c,u,1,1,e.RGBA,e.UNSIGNED_BYTE,f);var h=Mo(f,4),m=h[0],g=h[1],y=h[2],b=h[3];return[m,g,y,b]}function we(e,t,n){return(t=ol(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function tw(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,a)}return n}function ze(e){for(var t=1;tk){var M="…";for(h=h+M,D=e.measureText(h).width;D>k&&h.length>1;)h=h.slice(0,-2)+M,D=e.measureText(h).width;if(h.length<4)return}var R;C>0?A>0?R=Math.acos(C/k):R=Math.asin(A/k):A>0?R=Math.acos(C/k)+Math.PI:R=Math.asin(C/k)+Math.PI/2,e.save(),e.translate(_,N),e.rotate(R),e.fillText(h,-D/2,t.size/2+s),e.restore()}}}function CC(e,t,n){if(t.label){var a=n.labelSize,o=n.labelFont,s=n.labelWeight,c=n.labelColor.attribute?t[n.labelColor.attribute]||n.labelColor.color||"#000":n.labelColor.color;e.fillStyle=c,e.font="".concat(s," ").concat(a,"px ").concat(o),e.fillText(t.label,t.x+t.size+3,t.y+a/3)}}function uG(e,t,n){var a=n.labelSize,o=n.labelFont,s=n.labelWeight;e.font="".concat(s," ").concat(a,"px ").concat(o),e.fillStyle="#FFF",e.shadowOffsetX=0,e.shadowOffsetY=0,e.shadowBlur=8,e.shadowColor="#000";var c=2;if(typeof t.label=="string"){var u=e.measureText(t.label).width,f=Math.round(u+5),h=Math.round(a+2*c),m=Math.max(t.size,a/2)+c,g=Math.asin(h/2/m),y=Math.sqrt(Math.abs(Math.pow(m,2)-Math.pow(h/2,2)));e.beginPath(),e.moveTo(t.x+y,t.y+h/2),e.lineTo(t.x+m+f,t.y+h/2),e.lineTo(t.x+m+f,t.y-h/2),e.lineTo(t.x+y,t.y-h/2),e.arc(t.x,t.y,m,g,-g),e.closePath(),e.fill()}else e.beginPath(),e.arc(t.x,t.y,t.size+c,0,Math.PI*2),e.closePath(),e.fill();e.shadowOffsetX=0,e.shadowOffsetY=0,e.shadowBlur=0,CC(e,t,n)}var dG=` +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 +} +`,fG=dG,hG=` +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; +} +`,pG=hG,TC=WebGLRenderingContext,iw=TC.UNSIGNED_BYTE,cp=TC.FLOAT,mG=["u_sizeRatio","u_correctionRatio","u_matrix"],Tl=function(e){function t(){return $t(this,t),Sn(this,t,arguments)}return _n(t,e),Vt(t,[{key:"getDefinition",value:function(){return{VERTICES:3,VERTEX_SHADER_SOURCE:pG,FRAGMENT_SHADER_SOURCE:fG,METHOD:WebGLRenderingContext.TRIANGLES,UNIFORMS:mG,ATTRIBUTES:[{name:"a_position",size:2,type:cp},{name:"a_size",size:1,type:cp},{name:"a_color",size:4,type:iw,normalized:!0},{name:"a_id",size:4,type:iw,normalized:!0}],CONSTANT_ATTRIBUTES:[{name:"a_angle",size:1,type:cp}],CONSTANT_DATA:[[t.ANGLE_1],[t.ANGLE_2],[t.ANGLE_3]]}}},{key:"processVisibleItem",value:function(a,o,s){var c=this.array,u=Ar(s.color);c[o++]=s.x,c[o++]=s.y,c[o++]=s.size,c[o++]=u,c[o++]=a}},{key:"setUniforms",value:function(a,o){var s=o.gl,c=o.uniformLocations,u=c.u_sizeRatio,f=c.u_correctionRatio,h=c.u_matrix;s.uniform1f(f,a.correctionRatio),s.uniform1f(u,a.sizeRatio),s.uniformMatrix3fv(h,!1,a.matrix)}}])}(Ig);we(Tl,"ANGLE_1",0);we(Tl,"ANGLE_2",2*Math.PI/3);we(Tl,"ANGLE_3",4*Math.PI/3);var gG=` +precision mediump float; + +varying vec4 v_color; + +void main(void) { + gl_FragColor = v_color; +} +`,vG=gG,yG=` +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; +} +`,bG=yG,RC=WebGLRenderingContext,ow=RC.UNSIGNED_BYTE,Qc=RC.FLOAT,xG=["u_matrix","u_sizeRatio","u_correctionRatio","u_minEdgeThickness","u_lengthToThicknessRatio","u_widenessToThicknessRatio"],Rl={extremity:"target",lengthToThicknessRatio:2.5,widenessToThicknessRatio:2};function ju(e){var t=ze(ze({},Rl),e||{});return function(n){function a(){return $t(this,a),Sn(this,a,arguments)}return _n(a,n),Vt(a,[{key:"getDefinition",value:function(){return{VERTICES:3,VERTEX_SHADER_SOURCE:bG,FRAGMENT_SHADER_SOURCE:vG,METHOD:WebGLRenderingContext.TRIANGLES,UNIFORMS:xG,ATTRIBUTES:[{name:"a_position",size:2,type:Qc},{name:"a_normal",size:2,type:Qc},{name:"a_radius",size:1,type:Qc},{name:"a_color",size:4,type:ow,normalized:!0},{name:"a_id",size:4,type:ow,normalized:!0}],CONSTANT_ATTRIBUTES:[{name:"a_barycentric",size:3,type:Qc}],CONSTANT_DATA:[[1,0,0],[0,1,0],[0,0,1]]}}},{key:"processVisibleItem",value:function(s,c,u,f,h){if(t.extremity==="source"){var m=[f,u];u=m[0],f=m[1]}var g=h.size||1,y=f.size||1,b=u.x,S=u.y,E=f.x,_=f.y,N=Ar(h.color),C=E-b,A=_-S,k=C*C+A*A,D=0,M=0;k&&(k=1/Math.sqrt(k),D=-A*k*g,M=C*k*g);var R=this.array;R[c++]=E,R[c++]=_,R[c++]=-D,R[c++]=-M,R[c++]=y,R[c++]=N,R[c++]=s}},{key:"setUniforms",value:function(s,c){var u=c.gl,f=c.uniformLocations,h=f.u_matrix,m=f.u_sizeRatio,g=f.u_correctionRatio,y=f.u_minEdgeThickness,b=f.u_lengthToThicknessRatio,S=f.u_widenessToThicknessRatio;u.uniformMatrix3fv(h,!1,s.matrix),u.uniform1f(m,s.sizeRatio),u.uniform1f(g,s.correctionRatio),u.uniform1f(y,s.minEdgeThickness),u.uniform1f(b,t.lengthToThicknessRatio),u.uniform1f(S,t.widenessToThicknessRatio)}}])}(Cl)}ju();var wG=` +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 +} +`,Hg=wG,EG=` +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; +} +`,SG=EG,AC=WebGLRenderingContext,sw=AC.UNSIGNED_BYTE,yi=AC.FLOAT,_G=["u_matrix","u_zoomRatio","u_sizeRatio","u_correctionRatio","u_pixelRatio","u_feather","u_minEdgeThickness","u_lengthToThicknessRatio"],CG={lengthToThicknessRatio:Rl.lengthToThicknessRatio};function DC(e){var t=ze(ze({},CG),{});return function(n){function a(){return $t(this,a),Sn(this,a,arguments)}return _n(a,n),Vt(a,[{key:"getDefinition",value:function(){return{VERTICES:6,VERTEX_SHADER_SOURCE:SG,FRAGMENT_SHADER_SOURCE:Hg,METHOD:WebGLRenderingContext.TRIANGLES,UNIFORMS:_G,ATTRIBUTES:[{name:"a_positionStart",size:2,type:yi},{name:"a_positionEnd",size:2,type:yi},{name:"a_normal",size:2,type:yi},{name:"a_color",size:4,type:sw,normalized:!0},{name:"a_id",size:4,type:sw,normalized:!0},{name:"a_radius",size:1,type:yi}],CONSTANT_ATTRIBUTES:[{name:"a_positionCoef",size:1,type:yi},{name:"a_normalCoef",size:1,type:yi},{name:"a_radiusCoef",size:1,type:yi}],CONSTANT_DATA:[[0,1,0],[0,-1,0],[1,1,1],[1,1,1],[0,-1,0],[1,-1,-1]]}}},{key:"processVisibleItem",value:function(s,c,u,f,h){var m=h.size||1,g=u.x,y=u.y,b=f.x,S=f.y,E=Ar(h.color),_=b-g,N=S-y,C=f.size||1,A=_*_+N*N,k=0,D=0;A&&(A=1/Math.sqrt(A),k=-N*A*m,D=_*A*m);var M=this.array;M[c++]=g,M[c++]=y,M[c++]=b,M[c++]=S,M[c++]=k,M[c++]=D,M[c++]=E,M[c++]=s,M[c++]=C}},{key:"setUniforms",value:function(s,c){var u=c.gl,f=c.uniformLocations,h=f.u_matrix,m=f.u_zoomRatio,g=f.u_feather,y=f.u_pixelRatio,b=f.u_correctionRatio,S=f.u_sizeRatio,E=f.u_minEdgeThickness,_=f.u_lengthToThicknessRatio;u.uniformMatrix3fv(h,!1,s.matrix),u.uniform1f(m,s.zoomRatio),u.uniform1f(S,s.sizeRatio),u.uniform1f(b,s.correctionRatio),u.uniform1f(y,s.pixelRatio),u.uniform1f(g,s.antiAliasingFeather),u.uniform1f(E,s.minEdgeThickness),u.uniform1f(_,t.lengthToThicknessRatio)}}])}(Cl)}DC();function TG(e){return _C([DC(),ju(e)])}var RG=TG(),kC=RG,AG=` +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; +} +`,DG=AG,NC=WebGLRenderingContext,lw=NC.UNSIGNED_BYTE,Zs=NC.FLOAT,kG=["u_matrix","u_zoomRatio","u_sizeRatio","u_correctionRatio","u_pixelRatio","u_feather","u_minEdgeThickness"],NG=function(e){function t(){return $t(this,t),Sn(this,t,arguments)}return _n(t,e),Vt(t,[{key:"getDefinition",value:function(){return{VERTICES:6,VERTEX_SHADER_SOURCE:DG,FRAGMENT_SHADER_SOURCE:Hg,METHOD:WebGLRenderingContext.TRIANGLES,UNIFORMS:kG,ATTRIBUTES:[{name:"a_positionStart",size:2,type:Zs},{name:"a_positionEnd",size:2,type:Zs},{name:"a_normal",size:2,type:Zs},{name:"a_color",size:4,type:lw,normalized:!0},{name:"a_id",size:4,type:lw,normalized:!0}],CONSTANT_ATTRIBUTES:[{name:"a_positionCoef",size:1,type:Zs},{name:"a_normalCoef",size:1,type:Zs}],CONSTANT_DATA:[[0,1],[0,-1],[1,1],[1,1],[0,-1],[1,-1]]}}},{key:"processVisibleItem",value:function(a,o,s,c,u){var f=u.size||1,h=s.x,m=s.y,g=c.x,y=c.y,b=Ar(u.color),S=g-h,E=y-m,_=S*S+E*E,N=0,C=0;_&&(_=1/Math.sqrt(_),N=-E*_*f,C=S*_*f);var A=this.array;A[o++]=h,A[o++]=m,A[o++]=g,A[o++]=y,A[o++]=N,A[o++]=C,A[o++]=b,A[o++]=a}},{key:"setUniforms",value:function(a,o){var s=o.gl,c=o.uniformLocations,u=c.u_matrix,f=c.u_zoomRatio,h=c.u_feather,m=c.u_pixelRatio,g=c.u_correctionRatio,y=c.u_sizeRatio,b=c.u_minEdgeThickness;s.uniformMatrix3fv(u,!1,a.matrix),s.uniform1f(f,a.zoomRatio),s.uniform1f(y,a.sizeRatio),s.uniform1f(g,a.correctionRatio),s.uniform1f(m,a.pixelRatio),s.uniform1f(h,a.antiAliasingFeather),s.uniform1f(b,a.minEdgeThickness)}}])}(Cl),$g=function(e){function t(){var n;return $t(this,t),n=Sn(this,t),n.rawEmitter=n,n}return _n(t,e),Vt(t)}(tC.EventEmitter),up,cw;function Dr(){return cw||(cw=1,up=function(t){return t!==null&&typeof t=="object"&&typeof t.addUndirectedEdgeWithKey=="function"&&typeof t.dropNode=="function"&&typeof t.multi=="boolean"}),up}var OG=Dr();const jG=dn(OG);var LG=function(t){return t},zG=function(t){return t*t},MG=function(t){return t*(2-t)},PG=function(t){return(t*=2)<1?.5*t*t:-.5*(--t*(t-2)-1)},GG=function(t){return t*t*t},FG=function(t){return--t*t*t+1},UG=function(t){return(t*=2)<1?.5*t*t*t:.5*((t-=2)*t*t+2)},OC={linear:LG,quadraticIn:zG,quadraticOut:MG,quadraticInOut:PG,cubicIn:GG,cubicOut:FG,cubicInOut:UG},jC={easing:"quadraticInOut",duration:150};function BG(e,t,n,a){var o=Object.assign({},jC,n),s=typeof o.easing=="function"?o.easing:OC[o.easing],c=Date.now(),u={};for(var f in t){var h=t[f];u[f]={};for(var m in h)u[f][m]=e.getNodeAttribute(f,m)}var g=null,y=function(){g=null;var S=(Date.now()-c)/o.duration;if(S>=1){for(var E in t){var _=t[E];for(var N in _)e.setNodeAttribute(E,N,_[N])}return}S=s(S);for(var C in t){var A=t[C],k=u[C];for(var D in A)e.setNodeAttribute(C,D,A[D]*S+k[D]*(1-S))}g=requestAnimationFrame(y)};return y(),function(){g&&cancelAnimationFrame(g)}}function or(){return Float32Array.of(1,0,0,0,1,0,0,0,1)}function Jc(e,t,n){return e[0]=t,e[4]=typeof n=="number"?n:t,e}function uw(e,t){var n=Math.sin(t),a=Math.cos(t);return e[0]=a,e[1]=n,e[3]=-n,e[4]=a,e}function dw(e,t,n){return e[6]=t,e[7]=n,e}function ja(e,t){var n=e[0],a=e[1],o=e[2],s=e[3],c=e[4],u=e[5],f=e[6],h=e[7],m=e[8],g=t[0],y=t[1],b=t[2],S=t[3],E=t[4],_=t[5],N=t[6],C=t[7],A=t[8];return e[0]=g*n+y*s+b*f,e[1]=g*a+y*c+b*h,e[2]=g*o+y*u+b*m,e[3]=S*n+E*s+_*f,e[4]=S*a+E*c+_*h,e[5]=S*o+E*u+_*m,e[6]=N*n+C*s+A*f,e[7]=N*a+C*c+A*h,e[8]=N*o+C*u+A*m,e}function _m(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,a=e[0],o=e[1],s=e[3],c=e[4],u=e[6],f=e[7],h=t.x,m=t.y;return{x:h*a+m*s+u*n,y:h*o+m*c+f*n}}function IG(e,t){var n=e.height/e.width,a=t.height/t.width;return n<1&&a>1||n>1&&a<1?1:Math.min(Math.max(a,1/a),Math.max(1/n,n))}function Qs(e,t,n,a,o){var s=e.angle,c=e.ratio,u=e.x,f=e.y,h=t.width,m=t.height,g=or(),y=Math.min(h,m)-2*a,b=IG(t,n);return o?(ja(g,dw(or(),u,f)),ja(g,Jc(or(),c)),ja(g,uw(or(),s)),ja(g,Jc(or(),h/y/2/b,m/y/2/b))):(ja(g,Jc(or(),2*(y/h)*b,2*(y/m)*b)),ja(g,uw(or(),-s)),ja(g,Jc(or(),1/c)),ja(g,dw(or(),-u,-f))),g}function HG(e,t,n){var a=_m(e,{x:Math.cos(t.angle),y:Math.sin(t.angle)},0),o=a.x,s=a.y;return 1/Math.sqrt(Math.pow(o,2)+Math.pow(s,2))/n.width}function $G(e){if(!e.order)return{x:[0,1],y:[0,1]};var t=1/0,n=-1/0,a=1/0,o=-1/0;return e.forEachNode(function(s,c){var u=c.x,f=c.y;un&&(n=u),fo&&(o=f)}),{x:[t,n],y:[a,o]}}function VG(e){if(!jG(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 qG(e,t,n){var a=document.createElement(e);if(t)for(var o in t)a.style[o]=t[o];if(n)for(var s in n)a.setAttribute(s,n[s]);return a}function fw(){return typeof window.devicePixelRatio<"u"?window.devicePixelRatio:1}function hw(e,t,n){return n.sort(function(a,o){var s=t(a)||0,c=t(o)||0;return sc?1:0})}function pw(e){var t=Mo(e.x,2),n=t[0],a=t[1],o=Mo(e.y,2),s=o[0],c=o[1],u=Math.max(a-n,c-s),f=(a+n)/2,h=(c+s)/2;(u===0||Math.abs(u)===1/0||isNaN(u))&&(u=1),isNaN(f)&&(f=0),isNaN(h)&&(h=0);var m=function(y){return{x:.5+(y.x-f)/u,y:.5+(y.y-h)/u}};return m.applyTo=function(g){g.x=.5+(g.x-f)/u,g.y=.5+(g.y-h)/u},m.inverse=function(g){return{x:f+u*(g.x-.5),y:h+u*(g.y-.5)}},m.ratio=u,m}function Cm(e){"@babel/helpers - typeof";return Cm=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},Cm(e)}function mw(e,t){var n=t.size;if(n!==0){var a=e.length;e.length+=n;var o=0;t.forEach(function(s){e[a+o]=s,o++})}}function dp(e){e=e||{};for(var t=0,n=arguments.length<=1?0:arguments.length-1;t1&&arguments[1]!==void 0?arguments[1]:{},c=arguments.length>2?arguments[2]:void 0;if(!c)return new Promise(function(b){return o.animate(a,s,b)});if(this.enabled){var u=ze(ze({},jC),s),f=this.validateState(a),h=typeof u.easing=="function"?u.easing:OC[u.easing],m=Date.now(),g=this.getState(),y=function(){var S=(Date.now()-m)/u.duration;if(S>=1){o.nextFrame=null,o.setState(f),o.animationCallback&&(o.animationCallback.call(null),o.animationCallback=void 0);return}var E=h(S),_={};typeof f.x=="number"&&(_.x=g.x+(f.x-g.x)*E),typeof f.y=="number"&&(_.y=g.y+(f.y-g.y)*E),o.enabledRotation&&typeof f.angle=="number"&&(_.angle=g.angle+(f.angle-g.angle)*E),typeof f.ratio=="number"&&(_.ratio=g.ratio+(f.ratio-g.ratio)*E),o.setState(_),o.nextFrame=requestAnimationFrame(y)};this.nextFrame?(cancelAnimationFrame(this.nextFrame),this.animationCallback&&this.animationCallback.call(null),this.nextFrame=requestAnimationFrame(y)):y(),this.animationCallback=c}}},{key:"animatedZoom",value:function(a){return a?typeof a=="number"?this.animate({ratio:this.ratio/a}):this.animate({ratio:this.ratio/(a.factor||eu)},a):this.animate({ratio:this.ratio/eu})}},{key:"animatedUnzoom",value:function(a){return a?typeof a=="number"?this.animate({ratio:this.ratio*a}):this.animate({ratio:this.ratio*(a.factor||eu)},a):this.animate({ratio:this.ratio*eu})}},{key:"animatedReset",value:function(a){return this.animate({x:.5,y:.5,ratio:1,angle:0},a)}},{key:"copy",value:function(){return t.from(this.getState())}}],[{key:"from",value:function(a){var o=new t;return o.setState(a)}}])}($g);function lr(e,t){var n=t.getBoundingClientRect();return{x:e.clientX-n.left,y:e.clientY-n.top}}function Qr(e,t){var n=ze(ze({},lr(e,t)),{},{sigmaDefaultPrevented:!1,preventSigmaDefault:function(){n.sigmaDefaultPrevented=!0},original:e});return n}function Js(e){var t="x"in e?e:ze(ze({},e.touches[0]||e.previousTouches[0]),{},{original:e.original,sigmaDefaultPrevented:e.sigmaDefaultPrevented,preventSigmaDefault:function(){e.sigmaDefaultPrevented=!0,t.sigmaDefaultPrevented=!0}});return t}function KG(e,t){return ze(ze({},Qr(e,t)),{},{delta:LC(e)})}var ZG=2;function gu(e){for(var t=[],n=0,a=Math.min(e.length,ZG);n0;o.draggedEvents=0,g&&o.renderer.getSetting("hideEdgesOnMove")&&o.renderer.refresh()},0),this.emit("mouseup",Qr(a,this.container))}}},{key:"handleMove",value:function(a){var o=this;if(this.enabled){var s=Qr(a,this.container);if(this.emit("mousemovebody",s),(a.target===this.container||a.composedPath()[0]===this.container)&&this.emit("mousemove",s),!s.sigmaDefaultPrevented&&this.isMouseDown){this.isMoving=!0,this.draggedEvents++,typeof this.movingTimeout=="number"&&clearTimeout(this.movingTimeout),this.movingTimeout=window.setTimeout(function(){o.movingTimeout=null,o.isMoving=!1},this.settings.dragTimeout);var c=this.renderer.getCamera(),u=lr(a,this.container),f=u.x,h=u.y,m=this.renderer.viewportToFramedGraph({x:this.lastMouseX,y:this.lastMouseY}),g=this.renderer.viewportToFramedGraph({x:f,y:h}),y=m.x-g.x,b=m.y-g.y,S=c.getState(),E=S.x+y,_=S.y+b;c.setState({x:E,y:_}),this.lastMouseX=f,this.lastMouseY=h,a.preventDefault(),a.stopPropagation()}}}},{key:"handleLeave",value:function(a){this.emit("mouseleave",Qr(a,this.container))}},{key:"handleEnter",value:function(a){this.emit("mouseenter",Qr(a,this.container))}},{key:"handleWheel",value:function(a){var o=this,s=this.renderer.getCamera();if(!(!this.enabled||!s.enabledZooming)){var c=LC(a);if(c){var u=KG(a,this.container);if(this.emit("wheel",u),u.sigmaDefaultPrevented){a.preventDefault(),a.stopPropagation();return}var f=s.getState().ratio,h=c>0?1/this.settings.zoomingRatio:this.settings.zoomingRatio,m=s.getBoundedRatio(f*h),g=c>0?1:-1,y=Date.now();f!==m&&(a.preventDefault(),a.stopPropagation(),!(this.currentWheelDirection===g&&this.lastWheelTriggerTime&&y-this.lastWheelTriggerTimea.size?-1:n.sizea.key?1:-1}}])}(),bw=function(){function e(){$t(this,e),we(this,"width",0),we(this,"height",0),we(this,"cellSize",0),we(this,"columns",0),we(this,"rows",0),we(this,"cells",{})}return Vt(e,[{key:"resizeAndClear",value:function(n,a){this.width=n.width,this.height=n.height,this.cellSize=a,this.columns=Math.ceil(n.width/a),this.rows=Math.ceil(n.height/a),this.cells={}}},{key:"getIndex",value:function(n){var a=Math.floor(n.x/this.cellSize),o=Math.floor(n.y/this.cellSize);return o*this.columns+a}},{key:"add",value:function(n,a,o){var s=new yw(n,a),c=this.getIndex(o),u=this.cells[c];u||(u=[],this.cells[c]=u),u.push(s)}},{key:"organize",value:function(){for(var n in this.cells){var a=this.cells[n];a.sort(yw.compare)}}},{key:"getLabelsToDisplay",value:function(n,a){var o=this.cellSize*this.cellSize,s=o/n/n,c=s*a/o,u=Math.ceil(c),f=[];for(var h in this.cells)for(var m=this.cells[h],g=0;g2&&arguments[2]!==void 0?arguments[2]:{};if($t(this,t),o=Sn(this,t),we(o,"elements",{}),we(o,"canvasContexts",{}),we(o,"webGLContexts",{}),we(o,"pickingLayers",new Set),we(o,"textures",{}),we(o,"frameBuffers",{}),we(o,"activeListeners",{}),we(o,"labelGrid",new bw),we(o,"nodeDataCache",{}),we(o,"edgeDataCache",{}),we(o,"nodeProgramIndex",{}),we(o,"edgeProgramIndex",{}),we(o,"nodesWithForcedLabels",new Set),we(o,"edgesWithForcedLabels",new Set),we(o,"nodeExtent",{x:[0,1],y:[0,1]}),we(o,"nodeZExtent",[1/0,-1/0]),we(o,"edgeZExtent",[1/0,-1/0]),we(o,"matrix",or()),we(o,"invMatrix",or()),we(o,"correctionRatio",1),we(o,"customBBox",null),we(o,"normalizationFunction",pw({x:[0,1],y:[0,1]})),we(o,"graphToViewportRatio",1),we(o,"itemIDsIndex",{}),we(o,"nodeIndices",{}),we(o,"edgeIndices",{}),we(o,"width",0),we(o,"height",0),we(o,"pixelRatio",fw()),we(o,"pickingDownSizingRatio",2*o.pixelRatio),we(o,"displayedNodeLabels",new Set),we(o,"displayedEdgeLabels",new Set),we(o,"highlightedNodes",new Set),we(o,"hoveredNode",null),we(o,"hoveredEdge",null),we(o,"renderFrame",null),we(o,"renderHighlightedNodesFrame",null),we(o,"needToProcess",!1),we(o,"checkEdgesEventsFrame",null),we(o,"nodePrograms",{}),we(o,"nodeHoverPrograms",{}),we(o,"edgePrograms",{}),o.settings=XG(s),fp(o.settings),VG(n),!(a instanceof HTMLElement))throw new Error("Sigma: container should be an html element.");o.graph=n,o.container=a,o.createWebGLContext("edges",{picking:s.enableEdgeEvents}),o.createCanvasContext("edgeLabels"),o.createWebGLContext("nodes",{picking:!0}),o.createCanvasContext("labels"),o.createCanvasContext("hovers"),o.createWebGLContext("hoverNodes"),o.createCanvasContext("mouse",{style:{touchAction:"none",userSelect:"none"}}),o.resize();for(var c in o.settings.nodeProgramClasses)o.registerNodeProgram(c,o.settings.nodeProgramClasses[c],o.settings.nodeHoverProgramClasses[c]);for(var u in o.settings.edgeProgramClasses)o.registerEdgeProgram(u,o.settings.edgeProgramClasses[u]);return o.camera=new gw,o.bindCameraHandlers(),o.mouseCaptor=new e3(o.elements.mouse,o),o.mouseCaptor.setSettings(o.settings),o.touchCaptor=new r3(o.elements.mouse,o),o.touchCaptor.setSettings(o.settings),o.bindEventHandlers(),o.bindGraphHandlers(),o.handleSettingsUpdate(),o.refresh(),o}return _n(t,e),Vt(t,[{key:"registerNodeProgram",value:function(a,o,s){return this.nodePrograms[a]&&this.nodePrograms[a].kill(),this.nodeHoverPrograms[a]&&this.nodeHoverPrograms[a].kill(),this.nodePrograms[a]=new o(this.webGLContexts.nodes,this.frameBuffers.nodes,this),this.nodeHoverPrograms[a]=new(s||o)(this.webGLContexts.hoverNodes,null,this),this}},{key:"registerEdgeProgram",value:function(a,o){return this.edgePrograms[a]&&this.edgePrograms[a].kill(),this.edgePrograms[a]=new o(this.webGLContexts.edges,this.frameBuffers.edges,this),this}},{key:"unregisterNodeProgram",value:function(a){if(this.nodePrograms[a]){var o=this.nodePrograms,s=o[a],c=hp(o,[a].map(ol));s.kill(),this.nodePrograms=c}if(this.nodeHoverPrograms[a]){var u=this.nodeHoverPrograms,f=u[a],h=hp(u,[a].map(ol));f.kill(),this.nodePrograms=h}return this}},{key:"unregisterEdgeProgram",value:function(a){if(this.edgePrograms[a]){var o=this.edgePrograms,s=o[a],c=hp(o,[a].map(ol));s.kill(),this.edgePrograms=c}return this}},{key:"resetWebGLTexture",value:function(a){var o=this.webGLContexts[a],s=this.frameBuffers[a],c=this.textures[a];c&&o.deleteTexture(c);var u=o.createTexture();return o.bindFramebuffer(o.FRAMEBUFFER,s),o.bindTexture(o.TEXTURE_2D,u),o.texImage2D(o.TEXTURE_2D,0,o.RGBA,this.width,this.height,0,o.RGBA,o.UNSIGNED_BYTE,null),o.framebufferTexture2D(o.FRAMEBUFFER,o.COLOR_ATTACHMENT0,o.TEXTURE_2D,u,0),this.textures[a]=u,this}},{key:"bindCameraHandlers",value:function(){var a=this;return this.activeListeners.camera=function(){a.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(a){var o=a.x,s=a.y,c=ew(this.webGLContexts.nodes,this.frameBuffers.nodes,o,s,this.pixelRatio,this.pickingDownSizingRatio),u=J0.apply(void 0,vw(c)),f=this.itemIDsIndex[u];return f&&f.type==="node"?f.id:null}},{key:"bindEventHandlers",value:function(){var a=this;this.activeListeners.handleResize=function(){a.scheduleRefresh()},window.addEventListener("resize",this.activeListeners.handleResize),this.activeListeners.handleMove=function(s){var c=Js(s),u={event:c,preventSigmaDefault:function(){c.preventSigmaDefault()}},f=a.getNodeAtPosition(c);if(f&&a.hoveredNode!==f&&!a.nodeDataCache[f].hidden){a.hoveredNode&&a.emit("leaveNode",ze(ze({},u),{},{node:a.hoveredNode})),a.hoveredNode=f,a.emit("enterNode",ze(ze({},u),{},{node:f})),a.scheduleHighlightedNodesRender();return}if(a.hoveredNode&&a.getNodeAtPosition(c)!==a.hoveredNode){var h=a.hoveredNode;a.hoveredNode=null,a.emit("leaveNode",ze(ze({},u),{},{node:h})),a.scheduleHighlightedNodesRender();return}if(a.settings.enableEdgeEvents){var m=a.hoveredNode?null:a.getEdgeAtPoint(u.event.x,u.event.y);m!==a.hoveredEdge&&(a.hoveredEdge&&a.emit("leaveEdge",ze(ze({},u),{},{edge:a.hoveredEdge})),m&&a.emit("enterEdge",ze(ze({},u),{},{edge:m})),a.hoveredEdge=m)}},this.activeListeners.handleMoveBody=function(s){var c=Js(s);a.emit("moveBody",{event:c,preventSigmaDefault:function(){c.preventSigmaDefault()}})},this.activeListeners.handleLeave=function(s){var c=Js(s),u={event:c,preventSigmaDefault:function(){c.preventSigmaDefault()}};a.hoveredNode&&(a.emit("leaveNode",ze(ze({},u),{},{node:a.hoveredNode})),a.scheduleHighlightedNodesRender()),a.settings.enableEdgeEvents&&a.hoveredEdge&&(a.emit("leaveEdge",ze(ze({},u),{},{edge:a.hoveredEdge})),a.scheduleHighlightedNodesRender()),a.emit("leaveStage",ze({},u))},this.activeListeners.handleEnter=function(s){var c=Js(s),u={event:c,preventSigmaDefault:function(){c.preventSigmaDefault()}};a.emit("enterStage",ze({},u))};var o=function(c){return function(u){var f=Js(u),h={event:f,preventSigmaDefault:function(){f.preventSigmaDefault()}},m=a.getNodeAtPosition(f);if(m)return a.emit("".concat(c,"Node"),ze(ze({},h),{},{node:m}));if(a.settings.enableEdgeEvents){var g=a.getEdgeAtPoint(f.x,f.y);if(g)return a.emit("".concat(c,"Edge"),ze(ze({},h),{},{edge:g}))}return a.emit("".concat(c,"Stage"),h)}};return this.activeListeners.handleClick=o("click"),this.activeListeners.handleRightClick=o("rightClick"),this.activeListeners.handleDoubleClick=o("doubleClick"),this.activeListeners.handleWheel=o("wheel"),this.activeListeners.handleDown=o("down"),this.activeListeners.handleUp=o("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 a=this,o=this.graph,s=new Set(["x","y","zIndex","type"]);return this.activeListeners.eachNodeAttributesUpdatedGraphUpdate=function(c){var u,f=(u=c.hints)===null||u===void 0?void 0:u.attributes;a.graph.forEachNode(function(m){return a.updateNode(m)});var h=!f||f.some(function(m){return s.has(m)});a.refresh({partialGraph:{nodes:o.nodes()},skipIndexation:!h,schedule:!0})},this.activeListeners.eachEdgeAttributesUpdatedGraphUpdate=function(c){var u,f=(u=c.hints)===null||u===void 0?void 0:u.attributes;a.graph.forEachEdge(function(m){return a.updateEdge(m)});var h=f&&["zIndex","type"].some(function(m){return f==null?void 0:f.includes(m)});a.refresh({partialGraph:{edges:o.edges()},skipIndexation:!h,schedule:!0})},this.activeListeners.addNodeGraphUpdate=function(c){var u=c.key;a.addNode(u),a.refresh({partialGraph:{nodes:[u]},skipIndexation:!1,schedule:!0})},this.activeListeners.updateNodeGraphUpdate=function(c){var u=c.key;a.refresh({partialGraph:{nodes:[u]},skipIndexation:!1,schedule:!0})},this.activeListeners.dropNodeGraphUpdate=function(c){var u=c.key;a.removeNode(u),a.refresh({schedule:!0})},this.activeListeners.addEdgeGraphUpdate=function(c){var u=c.key;a.addEdge(u),a.refresh({partialGraph:{edges:[u]},schedule:!0})},this.activeListeners.updateEdgeGraphUpdate=function(c){var u=c.key;a.refresh({partialGraph:{edges:[u]},skipIndexation:!1,schedule:!0})},this.activeListeners.dropEdgeGraphUpdate=function(c){var u=c.key;a.removeEdge(u),a.refresh({schedule:!0})},this.activeListeners.clearEdgesGraphUpdate=function(){a.clearEdgeState(),a.clearEdgeIndices(),a.refresh({schedule:!0})},this.activeListeners.clearGraphUpdate=function(){a.clearEdgeState(),a.clearNodeState(),a.clearEdgeIndices(),a.clearNodeIndices(),a.refresh({schedule:!0})},o.on("nodeAdded",this.activeListeners.addNodeGraphUpdate),o.on("nodeDropped",this.activeListeners.dropNodeGraphUpdate),o.on("nodeAttributesUpdated",this.activeListeners.updateNodeGraphUpdate),o.on("eachNodeAttributesUpdated",this.activeListeners.eachNodeAttributesUpdatedGraphUpdate),o.on("edgeAdded",this.activeListeners.addEdgeGraphUpdate),o.on("edgeDropped",this.activeListeners.dropEdgeGraphUpdate),o.on("edgeAttributesUpdated",this.activeListeners.updateEdgeGraphUpdate),o.on("eachEdgeAttributesUpdated",this.activeListeners.eachEdgeAttributesUpdatedGraphUpdate),o.on("edgesCleared",this.activeListeners.clearEdgesGraphUpdate),o.on("cleared",this.activeListeners.clearGraphUpdate),this}},{key:"unbindGraphHandlers",value:function(){var a=this.graph;a.removeListener("nodeAdded",this.activeListeners.addNodeGraphUpdate),a.removeListener("nodeDropped",this.activeListeners.dropNodeGraphUpdate),a.removeListener("nodeAttributesUpdated",this.activeListeners.updateNodeGraphUpdate),a.removeListener("eachNodeAttributesUpdated",this.activeListeners.eachNodeAttributesUpdatedGraphUpdate),a.removeListener("edgeAdded",this.activeListeners.addEdgeGraphUpdate),a.removeListener("edgeDropped",this.activeListeners.dropEdgeGraphUpdate),a.removeListener("edgeAttributesUpdated",this.activeListeners.updateEdgeGraphUpdate),a.removeListener("eachEdgeAttributesUpdated",this.activeListeners.eachEdgeAttributesUpdatedGraphUpdate),a.removeListener("edgesCleared",this.activeListeners.clearEdgesGraphUpdate),a.removeListener("cleared",this.activeListeners.clearGraphUpdate)}},{key:"getEdgeAtPoint",value:function(a,o){var s=ew(this.webGLContexts.edges,this.frameBuffers.edges,a,o,this.pixelRatio,this.pickingDownSizingRatio),c=J0.apply(void 0,vw(s)),u=this.itemIDsIndex[c];return u&&u.type==="edge"?u.id:null}},{key:"process",value:function(){var a=this;this.emit("beforeProcess");var o=this.graph,s=this.settings,c=this.getDimensions();if(this.nodeExtent=$G(this.graph),!this.settings.autoRescale){var u=c.width,f=c.height,h=this.nodeExtent,m=h.x,g=h.y;this.nodeExtent={x:[(m[0]+m[1])/2-u/2,(m[0]+m[1])/2+u/2],y:[(g[0]+g[1])/2-f/2,(g[0]+g[1])/2+f/2]}}this.normalizationFunction=pw(this.customBBox||this.nodeExtent);var y=new gw,b=Qs(y.getState(),c,this.getGraphDimensions(),this.getStagePadding());this.labelGrid.resizeAndClear(c,s.labelGridCellSize);for(var S={},E={},_={},N={},C=1,A=o.nodes(),k=0,D=A.length;k1&&arguments[1]!==void 0?arguments[1]:{},s=o.tolerance,c=s===void 0?0:s,u=o.boundaries,f=ze({},a),h=u||this.nodeExtent,m=Mo(h.x,2),g=m[0],y=m[1],b=Mo(h.y,2),S=b[0],E=b[1],_=[this.graphToViewport({x:g,y:S},{cameraState:a}),this.graphToViewport({x:y,y:S},{cameraState:a}),this.graphToViewport({x:g,y:E},{cameraState:a}),this.graphToViewport({x:y,y:E},{cameraState:a})],N=1/0,C=-1/0,A=1/0,k=-1/0;_.forEach(function(X){var ne=X.x,F=X.y;N=Math.min(N,ne),C=Math.max(C,ne),A=Math.min(A,F),k=Math.max(k,F)});var D=C-N,M=k-A,R=this.getDimensions(),U=R.width,L=R.height,I=0,q=0;if(D>=U?Cc&&(I=N-c):C>U+c?I=C-(U+c):N<-c&&(I=N+c),M>=L?kc&&(q=A-c):k>L+c?q=k-(L+c):A<-c&&(q=A+c),I||q){var Y=this.viewportToFramedGraph({x:0,y:0},{cameraState:a}),B=this.viewportToFramedGraph({x:I,y:q},{cameraState:a});I=B.x-Y.x,q=B.y-Y.y,f.x+=I,f.y+=q}return f}},{key:"renderLabels",value:function(){if(!this.settings.renderLabels)return this;var a=this.camera.getState(),o=this.labelGrid.getLabelsToDisplay(a.ratio,this.settings.labelDensity);mw(o,this.nodesWithForcedLabels),this.displayedNodeLabels=new Set;for(var s=this.canvasContexts.labels,c=0,u=o.length;cthis.width+c3||y<-50||y>this.height+u3)){this.displayedNodeLabels.add(f);var S=this.settings.defaultDrawNodeLabel,E=this.nodePrograms[h.type],_=(E==null?void 0:E.drawLabel)||S;_(s,ze(ze({key:f},h),{},{size:b,x:g,y}),this.settings)}}}return this}},{key:"renderEdgeLabels",value:function(){if(!this.settings.renderEdgeLabels)return this;var a=this.canvasContexts.edgeLabels;a.clearRect(0,0,this.width,this.height);var o=l3({graph:this.graph,hoveredNode:this.hoveredNode,displayedNodeLabels:this.displayedNodeLabels,highlightedNodes:this.highlightedNodes});mw(o,this.edgesWithForcedLabels);for(var s=new Set,c=0,u=o.length;cthis.nodeZExtent[1]&&(this.nodeZExtent[1]=s.zIndex))}},{key:"updateNode",value:function(a){this.addNode(a);var o=this.nodeDataCache[a];this.normalizationFunction.applyTo(o)}},{key:"removeNode",value:function(a){delete this.nodeDataCache[a],delete this.nodeProgramIndex[a],this.highlightedNodes.delete(a),this.hoveredNode===a&&(this.hoveredNode=null),this.nodesWithForcedLabels.delete(a)}},{key:"addEdge",value:function(a){var o=Object.assign({},this.graph.getEdgeAttributes(a));this.settings.edgeReducer&&(o=this.settings.edgeReducer(a,o));var s=f3(this.settings,a,o);this.edgeDataCache[a]=s,this.edgesWithForcedLabels.delete(a),s.forceLabel&&!s.hidden&&this.edgesWithForcedLabels.add(a),this.settings.zIndex&&(s.zIndexthis.edgeZExtent[1]&&(this.edgeZExtent[1]=s.zIndex))}},{key:"updateEdge",value:function(a){this.addEdge(a)}},{key:"removeEdge",value:function(a){delete this.edgeDataCache[a],delete this.edgeProgramIndex[a],this.hoveredEdge===a&&(this.hoveredEdge=null),this.edgesWithForcedLabels.delete(a)}},{key:"clearNodeIndices",value:function(){this.labelGrid=new bw,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(a,o,s){var c=this.nodeDataCache[a],u=this.nodePrograms[c.type];if(!u)throw new Error('Sigma: could not find a suitable program for node type "'.concat(c.type,'"!'));u.process(o,s,c),this.nodeProgramIndex[a]=s}},{key:"addEdgeToProgram",value:function(a,o,s){var c=this.edgeDataCache[a],u=this.edgePrograms[c.type];if(!u)throw new Error('Sigma: could not find a suitable program for edge type "'.concat(c.type,'"!'));var f=this.graph.extremities(a),h=this.nodeDataCache[f[0]],m=this.nodeDataCache[f[1]];u.process(o,s,h,m,c),this.edgeProgramIndex[a]=s}},{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 a=this.settings,o=a.stagePadding,s=a.autoRescale;return s&&o||0}},{key:"createLayer",value:function(a,o){var s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(this.elements[a])throw new Error('Sigma: a layer named "'.concat(a,'" already exists'));var c=qG(o,{position:"absolute"},{class:"sigma-".concat(a)});return s.style&&Object.assign(c.style,s.style),this.elements[a]=c,"beforeLayer"in s&&s.beforeLayer?this.elements[s.beforeLayer].before(c):"afterLayer"in s&&s.afterLayer?this.elements[s.afterLayer].after(c):this.container.appendChild(c),c}},{key:"createCanvas",value:function(a){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return this.createLayer(a,"canvas",o)}},{key:"createCanvasContext",value:function(a){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},s=this.createCanvas(a,o),c={preserveDrawingBuffer:!1,antialias:!1};return this.canvasContexts[a]=s.getContext("2d",c),this}},{key:"createWebGLContext",value:function(a){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},s=(o==null?void 0:o.canvas)||this.createCanvas(a,o);o.hidden&&s.remove();var c=ze({preserveDrawingBuffer:!1,antialias:!1},o),u;u=s.getContext("webgl2",c),u||(u=s.getContext("webgl",c)),u||(u=s.getContext("experimental-webgl",c));var f=u;if(this.webGLContexts[a]=f,f.blendFunc(f.ONE,f.ONE_MINUS_SRC_ALPHA),o.picking){this.pickingLayers.add(a);var h=f.createFramebuffer();if(!h)throw new Error("Sigma: cannot create a new frame buffer for layer ".concat(a));this.frameBuffers[a]=h}return f}},{key:"killLayer",value:function(a){var o=this.elements[a];if(!o)throw new Error("Sigma: cannot kill layer ".concat(a,", which does not exist"));if(this.webGLContexts[a]){var s,c=this.webGLContexts[a];(s=c.getExtension("WEBGL_lose_context"))===null||s===void 0||s.loseContext(),delete this.webGLContexts[a]}else this.canvasContexts[a]&&delete this.canvasContexts[a];return o.remove(),delete this.elements[a],this}},{key:"getCamera",value:function(){return this.camera}},{key:"setCamera",value:function(a){this.unbindCameraHandlers(),this.camera=a,this.bindCameraHandlers()}},{key:"getContainer",value:function(){return this.container}},{key:"getGraph",value:function(){return this.graph}},{key:"setGraph",value:function(a){a!==this.graph&&(this.hoveredNode&&!a.hasNode(this.hoveredNode)&&(this.hoveredNode=null),this.hoveredEdge&&!a.hasEdge(this.hoveredEdge)&&(this.hoveredEdge=null),this.unbindGraphHandlers(),this.checkEdgesEventsFrame!==null&&(cancelAnimationFrame(this.checkEdgesEventsFrame),this.checkEdgesEventsFrame=null),this.graph=a,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 a=this.customBBox||this.nodeExtent;return{width:a.x[1]-a.x[0]||1,height:a.y[1]-a.y[0]||1}}},{key:"getNodeDisplayData",value:function(a){var o=this.nodeDataCache[a];return o?Object.assign({},o):void 0}},{key:"getEdgeDisplayData",value:function(a){var o=this.edgeDataCache[a];return o?Object.assign({},o):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 ze({},this.settings)}},{key:"getSetting",value:function(a){return this.settings[a]}},{key:"setSetting",value:function(a,o){var s=ze({},this.settings);return this.settings[a]=o,fp(this.settings),this.handleSettingsUpdate(s),this.scheduleRefresh(),this}},{key:"updateSetting",value:function(a,o){return this.setSetting(a,o(this.settings[a])),this}},{key:"setSettings",value:function(a){var o=ze({},this.settings);return this.settings=ze(ze({},this.settings),a),fp(this.settings),this.handleSettingsUpdate(o),this.scheduleRefresh(),this}},{key:"resize",value:function(a){var o=this.width,s=this.height;if(this.width=this.container.offsetWidth,this.height=this.container.offsetHeight,this.pixelRatio=fw(),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(!a&&o===this.width&&s===this.height)return this;for(var c in this.elements){var u=this.elements[c];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 h in this.webGLContexts){this.elements[h].setAttribute("width",this.width*this.pixelRatio+"px"),this.elements[h].setAttribute("height",this.height*this.pixelRatio+"px");var m=this.webGLContexts[h];if(m.viewport(0,0,this.width*this.pixelRatio,this.height*this.pixelRatio),this.pickingLayers.has(h)){var g=this.textures[h];g&&m.deleteTexture(g)}}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(a){var o=this,s=(a==null?void 0:a.skipIndexation)!==void 0?a==null?void 0:a.skipIndexation:!1,c=(a==null?void 0:a.schedule)!==void 0?a.schedule:!1,u=!a||!a.partialGraph;if(u)this.clearEdgeIndices(),this.clearNodeIndices(),this.graph.forEachNode(function(k){return o.addNode(k)}),this.graph.forEachEdge(function(k){return o.addEdge(k)});else{for(var f,h,m=((f=a.partialGraph)===null||f===void 0?void 0:f.nodes)||[],g=0,y=(m==null?void 0:m.length)||0;g1&&arguments[1]!==void 0?arguments[1]:{},s=!!o.cameraState||!!o.viewportDimensions||!!o.graphDimensions,c=o.matrix?o.matrix:s?Qs(o.cameraState||this.camera.getState(),o.viewportDimensions||this.getDimensions(),o.graphDimensions||this.getGraphDimensions(),o.padding||this.getStagePadding()):this.matrix,u=_m(c,a);return{x:(1+u.x)*this.width/2,y:(1-u.y)*this.height/2}}},{key:"viewportToFramedGraph",value:function(a){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},s=!!o.cameraState||!!o.viewportDimensions||!o.graphDimensions,c=o.matrix?o.matrix:s?Qs(o.cameraState||this.camera.getState(),o.viewportDimensions||this.getDimensions(),o.graphDimensions||this.getGraphDimensions(),o.padding||this.getStagePadding(),!0):this.invMatrix,u=_m(c,{x:a.x/this.width*2-1,y:1-a.y/this.height*2});return isNaN(u.x)&&(u.x=0),isNaN(u.y)&&(u.y=0),u}},{key:"viewportToGraph",value:function(a){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return this.normalizationFunction.inverse(this.viewportToFramedGraph(a,o))}},{key:"graphToViewport",value:function(a){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return this.framedGraphToViewport(this.normalizationFunction(a),o)}},{key:"getGraphToViewportRatio",value:function(){var a={x:0,y:0},o={x:1,y:1},s=Math.sqrt(Math.pow(a.x-o.x,2)+Math.pow(a.y-o.y,2)),c=this.graphToViewport(a),u=this.graphToViewport(o),f=Math.sqrt(Math.pow(c.x-u.x,2)+Math.pow(c.y-u.y,2));return f/s}},{key:"getBBox",value:function(){return this.nodeExtent}},{key:"getCustomBBox",value:function(){return this.customBBox}},{key:"setCustomBBox",value:function(a){return this.customBBox=a,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 a=this.container;a.firstChild;)a.removeChild(a.firstChild);this.canvasContexts={},this.webGLContexts={},this.elements={};for(var o in this.nodePrograms)this.nodePrograms[o].kill();for(var s in this.nodeHoverPrograms)this.nodeHoverPrograms[s].kill();for(var c in this.edgePrograms)this.edgePrograms[c].kill();this.nodePrograms={},this.nodeHoverPrograms={},this.edgePrograms={};for(var u in this.elements)this.killLayer(u)}},{key:"scaleSize",value:function(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:1,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.camera.ratio;return a/this.settings.zoomToSizeRatioFunction(o)*(this.getSetting("itemSizesReference")==="positions"?o*this.graphToViewportRatio:1)}},{key:"getCanvases",value:function(){var a={};for(var o in this.elements)this.elements[o]instanceof HTMLCanvasElement&&(a[o]=this.elements[o]);return a}}])}($g);const MC=w.createContext(null),p3=MC.Provider;function qg(){const e=w.useContext(MC);if(e==null)throw new Error("No context provided: useSigmaContext() can only be used in a descendant of ");return e}function Zn(){return qg().sigma}function PC(){const{sigma:e}=qg();return w.useCallback(t=>{e&&Object.keys(t).forEach(n=>{e.setSetting(n,t[n])})},[e])}function bd(e){return new Set(Object.keys(e))}const xw=bd({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}),ww=bd({click:!0,rightClick:!0,doubleClick:!0,mouseup:!0,mousedown:!0,mousemove:!0,mousemovebody:!0,mouseleave:!0,mouseenter:!0,wheel:!0}),Ew=bd({touchup:!0,touchdown:!0,touchmove:!0,touchmovebody:!0,tap:!0,doubletap:!0}),Sw=bd({updated:!0});function GC(){const e=Zn(),t=PC(),[n,a]=w.useState({});return w.useEffect(()=>{if(!e||!n)return;const o=n,s=Object.keys(o);return s.forEach(c=>{const u=o[c];xw.has(c)&&e.on(c,u),ww.has(c)&&e.getMouseCaptor().on(c,u),Ew.has(c)&&e.getTouchCaptor().on(c,u),Sw.has(c)&&e.getCamera().on(c,u)}),()=>{e&&s.forEach(c=>{const u=o[c];xw.has(c)&&e.off(c,u),ww.has(c)&&e.getMouseCaptor().off(c,u),Ew.has(c)&&e.getTouchCaptor().off(c,u),Sw.has(c)&&e.getCamera().off(c,u)})}},[e,n,t]),a}function m3(){const e=Zn();return w.useCallback((t,n=!0)=>{e&&t&&(n&&e.getGraph().order>0&&e.getGraph().clear(),e.getGraph().import(t),e.refresh())},[e])}function Al(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)||!Al(e[n],t[n]))return!1;return!0}return!1}function FC(e){const t=Zn(),[n,a]=w.useState(e||{});w.useEffect(()=>{a(h=>Al(h,e||{})?h:e||{})},[e]);const o=w.useCallback(h=>{t.getCamera().animatedZoom(Object.assign(Object.assign({},n),h))},[t,n]),s=w.useCallback(h=>{t.getCamera().animatedUnzoom(Object.assign(Object.assign({},n),h))},[t,n]),c=w.useCallback(h=>{t.getCamera().animatedReset(Object.assign(Object.assign({},n),h))},[t,n]),u=w.useCallback((h,m)=>{t.getCamera().animate(h,Object.assign(Object.assign({},n),m))},[t,n]),f=w.useCallback((h,m)=>{const g=t.getNodeDisplayData(h);g?t.getCamera().animate(g,Object.assign(Object.assign({},n),m)):console.warn(`Node ${h} not found`)},[t,n]);return{zoomIn:o,zoomOut:s,reset:c,goto:u,gotoNode:f}}function g3(e){const t=qg(),[n,a]=w.useState(!1),[o,s]=w.useState(t.container),c=w.useCallback(()=>a(u=>!u),[]);return w.useEffect(()=>(document.addEventListener("fullscreenchange",c),()=>document.removeEventListener("fullscreenchange",c)),[c]),w.useEffect(()=>{s(t.container)},[e,t.container]),{toggle:w.useCallback(()=>{var u;u=o,document.fullscreenElement!==u?u.requestFullscreen():document.exitFullscreen&&document.exitFullscreen()},[o]),isFullScreen:n}}const v3=w.forwardRef(({graph:e,id:t,className:n,style:a,settings:o={},children:s},c)=>{const u=w.useRef(null),f=w.useRef(null),h={className:`react-sigma ${n||""}`,id:t,style:a},[m,g]=w.useState(null),[y,b]=w.useState(o);w.useEffect(()=>{b(_=>Al(_,o)?_:o)},[o]),w.useEffect(()=>{g(_=>{let N=null;if(f.current!==null){let C=new ft;e&&(C=typeof e=="function"?new e:e);let A=null;_&&(A=_.getCamera().getState(),_.kill()),N=new h3(C,f.current,y),A&&N.getCamera().setState(A)}return N})},[f,e,y]),w.useImperativeHandle(c,()=>m,[m]);const S=w.useMemo(()=>m&&u.current?{sigma:m,container:u.current}:null,[m,u]),E=S!==null?ve.createElement(p3,{value:S},s):null;return ve.createElement("div",Object.assign({},h,{ref:u}),ve.createElement("div",{className:"sigma-container",ref:f}),E)});var y3=` +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 +} +`,b3=y3,x3=` +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; +} +`,w3=x3,UC=WebGLRenderingContext,_w=UC.UNSIGNED_BYTE,Cw=UC.FLOAT,E3=["u_sizeRatio","u_pixelRatio","u_matrix"],S3=function(e){function t(){return $t(this,t),Sn(this,t,arguments)}return _n(t,e),Vt(t,[{key:"getDefinition",value:function(){return{VERTICES:1,VERTEX_SHADER_SOURCE:w3,FRAGMENT_SHADER_SOURCE:b3,METHOD:WebGLRenderingContext.POINTS,UNIFORMS:E3,ATTRIBUTES:[{name:"a_position",size:2,type:Cw},{name:"a_size",size:1,type:Cw},{name:"a_color",size:4,type:_w,normalized:!0},{name:"a_id",size:4,type:_w,normalized:!0}]}}},{key:"processVisibleItem",value:function(a,o,s){var c=this.array;c[o++]=s.x,c[o++]=s.y,c[o++]=s.size,c[o++]=Ar(s.color),c[o++]=a}},{key:"setUniforms",value:function(a,o){var s=a.sizeRatio,c=a.pixelRatio,u=a.matrix,f=o.gl,h=o.uniformLocations,m=h.u_sizeRatio,g=h.u_pixelRatio,y=h.u_matrix;f.uniform1f(g,c),f.uniform1f(m,s),f.uniformMatrix3fv(y,!1,u)}}])}(Ig),_3=` +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; +} +`,C3=_3,BC=WebGLRenderingContext,Tw=BC.UNSIGNED_BYTE,Kr=BC.FLOAT,T3=["u_matrix","u_zoomRatio","u_sizeRatio","u_correctionRatio","u_pixelRatio","u_feather","u_minEdgeThickness","u_lengthToThicknessRatio"],R3={lengthToThicknessRatio:Rl.lengthToThicknessRatio};function IC(e){var t=ze(ze({},R3),{});return function(n){function a(){return $t(this,a),Sn(this,a,arguments)}return _n(a,n),Vt(a,[{key:"getDefinition",value:function(){return{VERTICES:6,VERTEX_SHADER_SOURCE:C3,FRAGMENT_SHADER_SOURCE:Hg,METHOD:WebGLRenderingContext.TRIANGLES,UNIFORMS:T3,ATTRIBUTES:[{name:"a_positionStart",size:2,type:Kr},{name:"a_positionEnd",size:2,type:Kr},{name:"a_normal",size:2,type:Kr},{name:"a_color",size:4,type:Tw,normalized:!0},{name:"a_id",size:4,type:Tw,normalized:!0},{name:"a_sourceRadius",size:1,type:Kr},{name:"a_targetRadius",size:1,type:Kr}],CONSTANT_ATTRIBUTES:[{name:"a_positionCoef",size:1,type:Kr},{name:"a_normalCoef",size:1,type:Kr},{name:"a_sourceRadiusCoef",size:1,type:Kr},{name:"a_targetRadiusCoef",size:1,type:Kr}],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(s,c,u,f,h){var m=h.size||1,g=u.x,y=u.y,b=f.x,S=f.y,E=Ar(h.color),_=b-g,N=S-y,C=u.size||1,A=f.size||1,k=_*_+N*N,D=0,M=0;k&&(k=1/Math.sqrt(k),D=-N*k*m,M=_*k*m);var R=this.array;R[c++]=g,R[c++]=y,R[c++]=b,R[c++]=S,R[c++]=D,R[c++]=M,R[c++]=E,R[c++]=s,R[c++]=C,R[c++]=A}},{key:"setUniforms",value:function(s,c){var u=c.gl,f=c.uniformLocations,h=f.u_matrix,m=f.u_zoomRatio,g=f.u_feather,y=f.u_pixelRatio,b=f.u_correctionRatio,S=f.u_sizeRatio,E=f.u_minEdgeThickness,_=f.u_lengthToThicknessRatio;u.uniformMatrix3fv(h,!1,s.matrix),u.uniform1f(m,s.zoomRatio),u.uniform1f(S,s.sizeRatio),u.uniform1f(b,s.correctionRatio),u.uniform1f(y,s.pixelRatio),u.uniform1f(g,s.antiAliasingFeather),u.uniform1f(E,s.minEdgeThickness),u.uniform1f(_,t.lengthToThicknessRatio)}}])}(Cl)}IC();function A3(e){return _C([IC(),ju(e),ju(ze(ze({},e),{},{extremity:"source"}))])}A3();function D3(e){if(Array.isArray(e))return e}function k3(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var a,o,s,c,u=[],f=!0,h=!1;try{if(s=(n=n.call(e)).next,t!==0)for(;!(f=(a=s.call(n)).done)&&(u.push(a.value),u.length!==t);f=!0);}catch(m){h=!0,o=m}finally{try{if(!f&&n.return!=null&&(c=n.return(),Object(c)!==c))return}finally{if(h)throw o}}return u}}function Tm(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,a=Array(t);n v_radius) + gl_FragColor = transparent; + else { + gl_FragColor = v_color; + gl_FragColor.a *= bias; + } + #else + // Sizes: +`).concat(t.flatMap(function(o,s){var c=o.size;if("fill"in c)return[];c=c;var u="attribute"in c?"v_borderSize_".concat(s+1):rw(c.value),f=(c.mode||H3)==="pixels"?"u_correctionRatio":"v_radius";return[" float borderSize_".concat(s+1," = ").concat(f," * ").concat(u,";")]}).join(` +`),` + // Now, let's split the remaining space between "fill" borders: + float fillBorderSize = (v_radius - (`).concat(t.flatMap(function(o,s){var c=o.size;return"fill"in c?[]:["borderSize_".concat(s+1)]}).join(" + "),") ) / ").concat(n,`; +`).concat(t.flatMap(function(o,s){var c=o.size;return"fill"in c?[" float borderSize_".concat(s+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(o,s){return" float adjustedBorderSize_".concat(s+1," = adjustedBorderSize_").concat(s," - borderSize_").concat(s+1,";")}).join(` +`),` + + // Colors: + vec4 borderColor_0 = transparent; +`).concat(t.map(function(o,s){var c=o.color,u=[];return"attribute"in c?u.push(" vec4 borderColor_".concat(s+1," = v_borderColor_").concat(s+1,";")):"transparent"in c?u.push(" vec4 borderColor_".concat(s+1," = vec4(0.0, 0.0, 0.0, 0.0);")):u.push(" vec4 borderColor_".concat(s+1," = u_borderColor_").concat(s+1,";")),u.push(" borderColor_".concat(s+1,".a *= bias;")),u.push(" if (borderSize_".concat(s+1," <= 1.0 * u_correctionRatio) { borderColor_").concat(s+1," = borderColor_").concat(s,"; }")),u.join(` +`)}).join(` +`),` + if (dist > adjustedBorderSize_0) { + gl_FragColor = borderColor_0; + } else `).concat(t.map(function(o,s){return"if (dist > adjustedBorderSize_".concat(s,` - aaBorder) { + gl_FragColor = mix(borderColor_`).concat(s+1,", borderColor_").concat(s,", (dist - adjustedBorderSize_").concat(s,` + aaBorder) / aaBorder); + } else if (dist > adjustedBorderSize_`).concat(s+1,`) { + gl_FragColor = borderColor_`).concat(s+1,`; + } else `)}).join(""),` { /* Nothing to add here */ } + #endif +} +`);return a}function Y3(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(a,o){var s=a.size;return"attribute"in s?["attribute float a_borderSize_".concat(o+1,";"),"varying float v_borderSize_".concat(o+1,";")]:[]}).join(` +`),` +`).concat(t.flatMap(function(a,o){var s=a.color;return"attribute"in s?["attribute vec4 a_borderColor_".concat(o+1,";"),"varying vec4 v_borderColor_".concat(o+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(a,o){var s=a.size;return"attribute"in s?[" v_borderSize_".concat(o+1," = a_borderSize_").concat(o+1,";")]:[]}).join(` +`),` +`).concat(t.flatMap(function(a,o){var s=a.color;return"attribute"in s?[" v_borderColor_".concat(o+1," = a_borderColor_").concat(o+1,";")]:[]}).join(` +`),` + #endif +} +`);return n}var qC=WebGLRenderingContext,Dw=qC.UNSIGNED_BYTE,tu=qC.FLOAT;function W3(e){var t,n=Aw(Aw({},$3),{}),a=n.borders,o=n.drawLabel,s=n.drawHover,c=["u_sizeRatio","u_correctionRatio","u_matrix"].concat(pp(a.flatMap(function(u,f){var h=u.color;return"value"in h?["u_borderColor_".concat(f+1)]:[]})));return t=function(u){F3(f,u);function f(){var h;j3(this,f);for(var m=arguments.length,g=new Array(m),y=0;ye.length)&&(t=e.length);for(var n=0,a=Array(t);n$){var W="…";for(E=E+W,O=s.measureText(E).width;O>$&&E.length>1;)E=E.slice(0,-2)+W,O=s.measureText(E).width;if(E.length<4)return}for(var re={},de=0,ie=E.length;de{const n=this.nodeIdMap[t];if(n!==void 0)return this.nodes[n]});Xr(this,"getEdge",(t,n=!0)=>{const a=n?this.edgeDynamicIdMap[t]:this.edgeIdMap[t];if(a!==void 0)return this.edges[a]});Xr(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})})),ct=tg(m5),g5=({node:e,move:t})=>{const n=Zn(),{gotoNode:a}=FC();return w.useEffect(()=>{if(e)return n.getGraph().setNodeAttribute(e,"highlighted",!0),t&&(a(e),ct.getState().setMoveToSelectedNode(!1)),()=>{n.getGraph().setNodeAttribute(e,"highlighted",!1)}},[e,t,n,a]),null};function Xo(e,t){const n=Zn(),a=w.useRef(t);return Al(a.current,t)||(a.current=t),{positions:w.useCallback(()=>a.current?e(n.getGraph(),a.current):{},[n,a,e]),assign:w.useCallback(()=>{a.current&&e.assign(n.getGraph(),a.current)},[n,a,e])}}function Wg(e,t){const n=Zn(),[a,o]=w.useState(!1),[s,c]=w.useState(null),u=w.useRef(t);return Al(u.current,t)||(u.current=t),w.useEffect(()=>{o(!1);let f=null;return u.current&&(f=new e(n.getGraph(),u.current)),c(f),()=>{f!==null&&f.kill()}},[n,u,c,o,e]),{stop:w.useCallback(()=>{s&&(s.stop(),o(!1))},[s,o]),start:w.useCallback(()=>{s&&(s.start(),o(!0))},[s,o]),kill:w.useCallback(()=>{s&&s.kill(),o(!1)},[s,o]),isRunning:a}}var gp,Ow;function Dl(){if(Ow)return gp;Ow=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,a){n=n||{};var o={};for(var s in a){var c=n[s],u=a[s];if(!e(u)){o[s]=t(c,u);continue}c===void 0?o[s]=u:o[s]=c}return o}return gp=t,gp}var vp,jw;function v5(){if(jw)return vp;jw=1;function e(n){return function(a,o){return a+Math.floor(n()*(o-a+1))}}var t=e(Math.random);return t.createRandom=e,vp=t,vp}var yp,Lw;function y5(){if(Lw)return yp;Lw=1;var e=v5().createRandom;function t(a){var o=e(a);return function(s){for(var c=s.length,u=c-1,f=-1;++f0},o.prototype.addChild=function(R,U){this.children[R]=U,++this.countChildren},o.prototype.getChild=function(R){if(!this.children.hasOwnProperty(R)){var U=new o;this.children[R]=U,++this.countChildren}return this.children[R]},o.prototype.applyPositionToChildren=function(){if(this.hasChildren()){var R=this;for(var U in R.children){var L=R.children[U];L.x+=R.x,L.y+=R.y,L.applyPositionToChildren()}}};function s(R,U,L){for(var I in U.children){var q=U.children[I];q.hasChildren()?s(R,q,L):L[q.id]={x:q.x,y:q.y}}}function c(R,U){var L=R.r-U.r,I=U.x-R.x,q=U.y-R.y;return L<0||L*L0&&L*L>I*I+q*q}function f(R,U){for(var L=0;Lne?(q=(F+ne-Y)/(2*F),X=Math.sqrt(Math.max(0,ne/F-q*q)),L.x=R.x-q*I-X*B,L.y=R.y-q*B+X*I):(q=(F+Y-ne)/(2*F),X=Math.sqrt(Math.max(0,Y/F-q*q)),L.x=U.x+q*I-X*B,L.y=U.y+q*B+X*I)):(L.x=U.x+L.r,L.y=U.y)}function N(R,U){var L=R.r+U.r-1e-6,I=U.x-R.x,q=U.y-R.y;return L>0&&L*L>I*I+q*q}function C(R,U){var L=R.length;if(L===0)return 0;var I,q,Y,B,X,ne,F,z,j,K;if(I=R[0],I.x=0,I.y=0,L<=1)return I.r;if(q=R[1],I.x=-q.r,q.x=I.r,q.y=0,L<=2)return I.r+q.r;Y=R[2],_(q,I,Y),I=new o(null,null,null,null,I),q=new o(null,null,null,null,q),Y=new o(null,null,null,null,Y),I.next=Y.previous=q,q.next=I.previous=Y,Y.next=q.previous=I;e:for(ne=3;ne"u"?o:h};typeof o=="function"&&(c=o);var u=function(h){return c(h[a])},f=function(){return c(void 0)};return typeof a=="string"?(s.fromAttributes=u,s.fromGraph=function(h,m){return u(h.getNodeAttributes(m))},s.fromEntry=function(h,m){return u(m)}):typeof a=="function"?(s.fromAttributes=function(){throw new Error("graphology-utils/getters/createNodeValueGetter: irrelevant usage.")},s.fromGraph=function(h,m){return c(a(m,h.getNodeAttributes(m)))},s.fromEntry=function(h,m){return c(a(h,m))}):(s.fromAttributes=f,s.fromGraph=f,s.fromEntry=f),s}function n(a,o){var s={},c=function(h){return typeof h>"u"?o:h};typeof o=="function"&&(c=o);var u=function(h){return c(h[a])},f=function(){return c(void 0)};return typeof a=="string"?(s.fromAttributes=u,s.fromGraph=function(h,m){return u(h.getEdgeAttributes(m))},s.fromEntry=function(h,m){return u(m)},s.fromPartialEntry=s.fromEntry,s.fromMinimalEntry=s.fromEntry):typeof a=="function"?(s.fromAttributes=function(){throw new Error("graphology-utils/getters/createEdgeValueGetter: irrelevant usage.")},s.fromGraph=function(h,m){var g=h.extremities(m);return c(a(m,h.getEdgeAttributes(m),g[0],g[1],h.getNodeAttributes(g[0]),h.getNodeAttributes(g[1]),h.isUndirected(m)))},s.fromEntry=function(h,m,g,y,b,S,E){return c(a(h,m,g,y,b,S,E))},s.fromPartialEntry=function(h,m,g,y){return c(a(h,m,g,y))},s.fromMinimalEntry=function(h,m){return c(a(h,m))}):(s.fromAttributes=f,s.fromGraph=f,s.fromEntry=f,s.fromMinimalEntry=f),s}return tl.createNodeValueGetter=t,tl.createEdgeValueGetter=n,tl.createEdgeWeightGetter=function(a){return n(a,e)},tl}var wp,Gw;function eT(){if(Gw)return wp;Gw=1;const{createNodeValueGetter:e,createEdgeValueGetter:t}=Xg();return wp=function(a,o,s){const{nodeXAttribute:c,nodeYAttribute:u}=s,{attraction:f,repulsion:h,gravity:m,inertia:g,maxMove:y}=s.settings;let{shouldSkipNode:b,shouldSkipEdge:S,isNodeFixed:E}=s;E=e(E),b=e(b,!1),S=t(S,!1);const _=a.filterNodes((A,k)=>!b.fromEntry(A,k)),N=_.length;for(let A=0;A{if(D===M||b.fromEntry(D,R)||b.fromEntry(M,U)||S.fromEntry(A,k,D,M,R,U,L))return;const I=o[D],q=o[M],Y=q.x-I.x,B=q.y-I.y,X=Math.sqrt(Y*Y+B*B)||1,ne=f*X*Y,F=f*X*B;I.dx+=ne,I.dy+=F,q.dx-=ne,q.dy-=F}),m)for(let A=0;Ay&&(D.dx*=y/M,D.dy*=y/M),E.fromGraph(a,k)?D.fixed=!0:(D.x+=D.dx,D.y+=D.dy,D.fixed=!1)}return{converged:C}},wp}var nu={},Fw;function tT(){return Fw||(Fw=1,nu.assignLayoutChanges=function(e,t,n){const{nodeXAttribute:a,nodeYAttribute:o}=n;e.updateEachNodeAttributes((s,c)=>{const u=t[s];return!u||u.fixed||(c[a]=u.x,c[o]=u.y),c},{attributes:["x","y"]})},nu.collectLayoutChanges=function(e){const t={};for(const n in e){const a=e[n];t[n]={x:a.x,y:a.y}}return t}),nu}var Ep,Uw;function nT(){return Uw||(Uw=1,Ep={nodeXAttribute:"x",nodeYAttribute:"y",isNodeFixed:"fixed",shouldSkipNode:null,shouldSkipEdge:null,settings:{attraction:5e-4,repulsion:.1,gravity:1e-4,inertia:.6,maxMove:200}}),Ep}var Sp,Bw;function R5(){if(Bw)return Sp;Bw=1;const e=Dr(),t=Dl(),n=eT(),a=tT(),o=nT();function s(u,f,h){if(!e(f))throw new Error("graphology-layout-force: the given graph is not a valid graphology instance.");typeof h=="number"?h={maxIterations:h}:h=h||{};const m=h.maxIterations;if(h=t(h,o),typeof m!="number"||m<=0)throw new Error("graphology-layout-force: you should provide a positive number of maximum iterations.");const g={};let y=null,b;for(b=0;bthis.runFrame())},s.prototype.stop=function(){return this.running=!1,this.frameID!==null&&(window.cancelAnimationFrame(this.frameID),this.frameID=null),this},s.prototype.start=function(){if(this.killed)throw new Error("graphology-layout-force/worker.start: layout was killed.");this.running||(this.running=!0,this.runFrame())},s.prototype.kill=function(){this.stop(),delete this.nodeStates,this.killed=!0},_p=s,_p}var N5=k5();const O5=dn(N5);function j5(e={maxIterations:100}){return Xo(D5,e)}function L5(e={}){return Wg(O5,e)}var Cp,Hw;function z5(){if(Hw)return Cp;Hw=1;var e=0,t=1,n=2,a=3,o=4,s=5,c=6,u=7,f=8,h=9,m=0,g=1,y=2,b=0,S=1,E=2,_=3,N=4,C=5,A=6,k=7,D=8,M=3,R=10,U=3,L=9,I=10;return Cp=function(Y,B,X){var ne,F,z,j,K,G,H,O,$,W,re=B.length,de=X.length,ie=Y.adjustSizes,oe=Y.barnesHutTheta*Y.barnesHutTheta,Ce,he,Se,be,Le,Te,ye,J=[];for(z=0;zAe?(pe-=(me-Ae)/2,Ee=pe+me):(le-=(Ae-me)/2,_e=le+Ae),J[0+b]=-1,J[0+S]=(le+_e)/2,J[0+E]=(pe+Ee)/2,J[0+_]=Math.max(_e-le,Ee-pe),J[0+N]=-1,J[0+C]=-1,J[0+A]=0,J[0+k]=0,J[0+D]=0,ne=1,z=0;z=0){B[z+e]=0)if(Te=Math.pow(B[z+e]-J[F+k],2)+Math.pow(B[z+t]-J[F+D],2),W=J[F+_],4*W*W/Te0?(ye=he*B[z+c]*J[F+A]/Te,B[z+n]+=Se*ye,B[z+a]+=be*ye):Te<0&&(ye=-he*B[z+c]*J[F+A]/Math.sqrt(Te),B[z+n]+=Se*ye,B[z+a]+=be*ye):Te>0&&(ye=he*B[z+c]*J[F+A]/Te,B[z+n]+=Se*ye,B[z+a]+=be*ye),F=J[F+N],F<0)break;continue}else{F=J[F+C];continue}else{if(G=J[F+b],G>=0&&G!==z&&(Se=B[z+e]-B[G+e],be=B[z+t]-B[G+t],Te=Se*Se+be*be,ie===!0?Te>0?(ye=he*B[z+c]*B[G+c]/Te,B[z+n]+=Se*ye,B[z+a]+=be*ye):Te<0&&(ye=-he*B[z+c]*B[G+c]/Math.sqrt(Te),B[z+n]+=Se*ye,B[z+a]+=be*ye):Te>0&&(ye=he*B[z+c]*B[G+c]/Te,B[z+n]+=Se*ye,B[z+a]+=be*ye)),F=J[F+N],F<0)break;continue}else for(he=Y.scalingRatio,j=0;j0?(ye=he*B[j+c]*B[K+c]/Te/Te,B[j+n]+=Se*ye,B[j+a]+=be*ye,B[K+n]-=Se*ye,B[K+a]-=be*ye):Te<0&&(ye=100*he*B[j+c]*B[K+c],B[j+n]+=Se*ye,B[j+a]+=be*ye,B[K+n]-=Se*ye,B[K+a]-=be*ye)):(Te=Math.sqrt(Se*Se+be*be),Te>0&&(ye=he*B[j+c]*B[K+c]/Te/Te,B[j+n]+=Se*ye,B[j+a]+=be*ye,B[K+n]-=Se*ye,B[K+a]-=be*ye));for($=Y.gravity/Y.scalingRatio,he=Y.scalingRatio,z=0;z0&&(ye=he*B[z+c]*$):Te>0&&(ye=he*B[z+c]*$/Te),B[z+n]-=Se*ye,B[z+a]-=be*ye;for(he=1*(Y.outboundAttractionDistribution?Ce:1),H=0;H0&&(ye=-he*Le*Math.log(1+Te)/Te/B[j+c]):Te>0&&(ye=-he*Le*Math.log(1+Te)/Te):Y.outboundAttractionDistribution?Te>0&&(ye=-he*Le/B[j+c]):Te>0&&(ye=-he*Le)):(Te=Math.sqrt(Math.pow(Se,2)+Math.pow(be,2)),Y.linLogMode?Y.outboundAttractionDistribution?Te>0&&(ye=-he*Le*Math.log(1+Te)/Te/B[j+c]):Te>0&&(ye=-he*Le*Math.log(1+Te)/Te):Y.outboundAttractionDistribution?(Te=1,ye=-he*Le/B[j+c]):(Te=1,ye=-he*Le)),Te>0&&(B[j+n]+=Se*ye,B[j+a]+=be*ye,B[K+n]-=Se*ye,B[K+a]-=be*ye);var je,He,it,Ct,bt,qt;if(ie===!0)for(z=0;zI&&(B[z+n]=B[z+n]*I/je,B[z+a]=B[z+a]*I/je),He=B[z+c]*Math.sqrt((B[z+o]-B[z+n])*(B[z+o]-B[z+n])+(B[z+s]-B[z+a])*(B[z+s]-B[z+a])),it=Math.sqrt((B[z+o]+B[z+n])*(B[z+o]+B[z+n])+(B[z+s]+B[z+a])*(B[z+s]+B[z+a]))/2,Ct=.1*Math.log(1+it)/(1+Math.sqrt(He)),bt=B[z+e]+B[z+n]*(Ct/Y.slowDown),B[z+e]=bt,qt=B[z+t]+B[z+a]*(Ct/Y.slowDown),B[z+t]=qt);else for(z=0;z=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},Zr.graphToByteArrays=function(n,a){var o=n.order,s=n.size,c={},u,f=new Float32Array(o*e),h=new Float32Array(s*t);return u=0,n.forEachNode(function(m,g){c[m]=u,f[u]=g.x,f[u+1]=g.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]=g.size||1,f[u+9]=g.fixed?1:0,u+=e}),u=0,n.forEachEdge(function(m,g,y,b,S,E,_){var N=c[y],C=c[b],A=a(m,g,y,b,S,E,_);f[N+6]+=A,f[C+6]+=A,h[u]=N,h[u+1]=C,h[u+2]=A,u+=t}),{nodes:f,edges:h}},Zr.assignLayoutChanges=function(n,a,o){var s=0;n.updateEachNodeAttributes(function(c,u){return u.x=a[s],u.y=a[s+1],s+=e,o?o(c,u):u})},Zr.readGraphPositions=function(n,a){var o=0;n.forEachNode(function(s,c){a[o]=c.x,a[o+1]=c.y,o+=e})},Zr.collectLayoutChanges=function(n,a,o){for(var s=n.nodes(),c={},u=0,f=0,h=a.length;u2e3,strongGravityMode:!0,gravity:.05,scalingRatio:10,slowDown:1+Math.log(h)}}var u=s.bind(null,!1);return u.assign=s.bind(null,!0),u.inferSettings=c,Rp=u,Rp}var P5=M5();const G5=dn(P5);var Ap,Yw;function F5(){return Yw||(Yw=1,Ap=function(){var t,n,a={};(function(){var s=0,c=1,u=2,f=3,h=4,m=5,g=6,y=7,b=8,S=9,E=0,_=1,N=2,C=0,A=1,k=2,D=3,M=4,R=5,U=6,L=7,I=8,q=3,Y=10,B=3,X=9,ne=10;a.exports=function(z,j,K){var G,H,O,$,W,re,de,ie,oe,Ce,he=j.length,Se=K.length,be=z.adjustSizes,Le=z.barnesHutTheta*z.barnesHutTheta,Te,ye,J,le,_e,pe,Ee,te=[];for(O=0;Obt?(me-=(Ct-bt)/2,Ae=me+Ct):(Fe-=(bt-Ct)/2,Pe=Fe+bt),te[0+C]=-1,te[0+A]=(Fe+Pe)/2,te[0+k]=(me+Ae)/2,te[0+D]=Math.max(Pe-Fe,Ae-me),te[0+M]=-1,te[0+R]=-1,te[0+U]=0,te[0+L]=0,te[0+I]=0,G=1,O=0;O=0){j[O+s]=0)if(pe=Math.pow(j[O+s]-te[H+L],2)+Math.pow(j[O+c]-te[H+I],2),Ce=te[H+D],4*Ce*Ce/pe0?(Ee=ye*j[O+g]*te[H+U]/pe,j[O+u]+=J*Ee,j[O+f]+=le*Ee):pe<0&&(Ee=-ye*j[O+g]*te[H+U]/Math.sqrt(pe),j[O+u]+=J*Ee,j[O+f]+=le*Ee):pe>0&&(Ee=ye*j[O+g]*te[H+U]/pe,j[O+u]+=J*Ee,j[O+f]+=le*Ee),H=te[H+M],H<0)break;continue}else{H=te[H+R];continue}else{if(re=te[H+C],re>=0&&re!==O&&(J=j[O+s]-j[re+s],le=j[O+c]-j[re+c],pe=J*J+le*le,be===!0?pe>0?(Ee=ye*j[O+g]*j[re+g]/pe,j[O+u]+=J*Ee,j[O+f]+=le*Ee):pe<0&&(Ee=-ye*j[O+g]*j[re+g]/Math.sqrt(pe),j[O+u]+=J*Ee,j[O+f]+=le*Ee):pe>0&&(Ee=ye*j[O+g]*j[re+g]/pe,j[O+u]+=J*Ee,j[O+f]+=le*Ee)),H=te[H+M],H<0)break;continue}else for(ye=z.scalingRatio,$=0;$0?(Ee=ye*j[$+g]*j[W+g]/pe/pe,j[$+u]+=J*Ee,j[$+f]+=le*Ee,j[W+u]-=J*Ee,j[W+f]-=le*Ee):pe<0&&(Ee=100*ye*j[$+g]*j[W+g],j[$+u]+=J*Ee,j[$+f]+=le*Ee,j[W+u]-=J*Ee,j[W+f]-=le*Ee)):(pe=Math.sqrt(J*J+le*le),pe>0&&(Ee=ye*j[$+g]*j[W+g]/pe/pe,j[$+u]+=J*Ee,j[$+f]+=le*Ee,j[W+u]-=J*Ee,j[W+f]-=le*Ee));for(oe=z.gravity/z.scalingRatio,ye=z.scalingRatio,O=0;O0&&(Ee=ye*j[O+g]*oe):pe>0&&(Ee=ye*j[O+g]*oe/pe),j[O+u]-=J*Ee,j[O+f]-=le*Ee;for(ye=1*(z.outboundAttractionDistribution?Te:1),de=0;de0&&(Ee=-ye*_e*Math.log(1+pe)/pe/j[$+g]):pe>0&&(Ee=-ye*_e*Math.log(1+pe)/pe):z.outboundAttractionDistribution?pe>0&&(Ee=-ye*_e/j[$+g]):pe>0&&(Ee=-ye*_e)):(pe=Math.sqrt(Math.pow(J,2)+Math.pow(le,2)),z.linLogMode?z.outboundAttractionDistribution?pe>0&&(Ee=-ye*_e*Math.log(1+pe)/pe/j[$+g]):pe>0&&(Ee=-ye*_e*Math.log(1+pe)/pe):z.outboundAttractionDistribution?(pe=1,Ee=-ye*_e/j[$+g]):(pe=1,Ee=-ye*_e)),pe>0&&(j[$+u]+=J*Ee,j[$+f]+=le*Ee,j[W+u]-=J*Ee,j[W+f]-=le*Ee);var qt,fn,Gt,at,Tn,xt;if(be===!0)for(O=0;One&&(j[O+u]=j[O+u]*ne/qt,j[O+f]=j[O+f]*ne/qt),fn=j[O+g]*Math.sqrt((j[O+h]-j[O+u])*(j[O+h]-j[O+u])+(j[O+m]-j[O+f])*(j[O+m]-j[O+f])),Gt=Math.sqrt((j[O+h]+j[O+u])*(j[O+h]+j[O+u])+(j[O+m]+j[O+f])*(j[O+m]+j[O+f]))/2,at=.1*Math.log(1+Gt)/(1+Math.sqrt(fn)),Tn=j[O+s]+j[O+u]*(at/z.slowDown),j[O+s]=Tn,xt=j[O+c]+j[O+f]*(at/z.slowDown),j[O+c]=xt);else for(O=0;O1&&Se.has(Ee))&&(j>1&&Se.add(Ee),ye=f[Le+e],le=f[Le+t],pe=f[Le+n],te=ye-Te,Fe=le-J,Pe=Math.sqrt(te*te+Fe*Fe),me=Pe<_e*m+h+(pe*m+h),me&&(k=!1,Le=Le/a|0,Pe>0?(R[Le]+=te/Pe*(1+_e),U[Le]+=Fe/Pe*(1+_e)):(R[Le]+=B*s(),U[Le]+=X*s())));for(S=0,E=0;S1&&ye.has(me))&&(O>1&&ye.add(me),pe=y[le+o],te=y[le+s],Pe=y[le+c],Ae=pe-_e,je=te-Ee,He=Math.sqrt(Ae*Ae+je*je),it=He0?(q[le]+=Ae/He*(1+Fe),Y[le]+=je/He*(1+Fe)):(q[le]+=z*h(),Y[le]+=j*h())));for(C=0,A=0;C=0;)g=Nm(e,t,n,a,h+1,s+1,c),g>m&&(h===o?g*=n1:cF.test(e.charAt(h-1))?(g*=iF,b=e.slice(o,h-1).match(uF),b&&o>0&&(g*=Math.pow(Pp,b.length))):dF.test(e.charAt(h-1))?(g*=aF,S=e.slice(o,h-1).match(lT),S&&o>0&&(g*=Math.pow(Pp,S.length))):(g*=oF,o>0&&(g*=Math.pow(Pp,h-o))),e.charAt(h)!==t.charAt(s)&&(g*=sF)),(gg&&(g=y*Mp)),g>m&&(m=g),h=n.indexOf(f,h+1);return c[u]=m,m}function r1(e){return e.toLowerCase().replace(lT," ")}function fF(e,t,n){return e=n&&n.length>0?`${e+" "+n.join(" ")}`:e,Nm(e,t,r1(e),r1(t),0,0,{})}var Gp={exports:{}},Fp={};/** + * @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 a1;function hF(){if(a1)return Fp;a1=1;var e=Yu();function t(g,y){return g===y&&(g!==0||1/g===1/y)||g!==g&&y!==y}var n=typeof Object.is=="function"?Object.is:t,a=e.useState,o=e.useEffect,s=e.useLayoutEffect,c=e.useDebugValue;function u(g,y){var b=y(),S=a({inst:{value:b,getSnapshot:y}}),E=S[0].inst,_=S[1];return s(function(){E.value=b,E.getSnapshot=y,f(E)&&_({inst:E})},[g,b,y]),o(function(){return f(E)&&_({inst:E}),g(function(){f(E)&&_({inst:E})})},[g]),c(b),b}function f(g){var y=g.getSnapshot;g=g.value;try{var b=y();return!n(g,b)}catch{return!0}}function h(g,y){return y()}var m=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?h:u;return Fp.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:m,Fp}var i1;function pF(){return i1||(i1=1,Gp.exports=hF()),Gp.exports}var mF=pF(),nl='[cmdk-group=""]',Up='[cmdk-group-items=""]',gF='[cmdk-group-heading=""]',Kg='[cmdk-item=""]',o1=`${Kg}:not([aria-disabled="true"])`,Om="cmdk-item-select",xi="data-value",vF=(e,t,n)=>fF(e,t,n),cT=w.createContext(void 0),kl=()=>w.useContext(cT),uT=w.createContext(void 0),Zg=()=>w.useContext(uT),dT=w.createContext(void 0),fT=w.forwardRef((e,t)=>{let n=Co(()=>{var O,$;return{search:"",value:($=(O=e.value)!=null?O:e.defaultValue)!=null?$:"",filtered:{count:0,items:new Map,groups:new Set}}}),a=Co(()=>new Set),o=Co(()=>new Map),s=Co(()=>new Map),c=Co(()=>new Set),u=hT(e),{label:f,children:h,value:m,onValueChange:g,filter:y,shouldFilter:b,loop:S,disablePointerSelection:E=!1,vimBindings:_=!0,...N}=e,C=on(),A=on(),k=on(),D=w.useRef(null),M=AF();Di(()=>{if(m!==void 0){let O=m.trim();n.current.value=O,R.emit()}},[m]),Di(()=>{M(6,B)},[]);let R=w.useMemo(()=>({subscribe:O=>(c.current.add(O),()=>c.current.delete(O)),snapshot:()=>n.current,setState:(O,$,W)=>{var re,de,ie;if(!Object.is(n.current[O],$)){if(n.current[O]=$,O==="search")Y(),I(),M(1,q);else if(O==="value"&&(W||M(5,B),((re=u.current)==null?void 0:re.value)!==void 0)){let oe=$??"";(ie=(de=u.current).onValueChange)==null||ie.call(de,oe);return}R.emit()}},emit:()=>{c.current.forEach(O=>O())}}),[]),U=w.useMemo(()=>({value:(O,$,W)=>{var re;$!==((re=s.current.get(O))==null?void 0:re.value)&&(s.current.set(O,{value:$,keywords:W}),n.current.filtered.items.set(O,L($,W)),M(2,()=>{I(),R.emit()}))},item:(O,$)=>(a.current.add(O),$&&(o.current.has($)?o.current.get($).add(O):o.current.set($,new Set([O]))),M(3,()=>{Y(),I(),n.current.value||q(),R.emit()}),()=>{s.current.delete(O),a.current.delete(O),n.current.filtered.items.delete(O);let W=X();M(4,()=>{Y(),(W==null?void 0:W.getAttribute("id"))===O&&q(),R.emit()})}),group:O=>(o.current.has(O)||o.current.set(O,new Set),()=>{s.current.delete(O),o.current.delete(O)}),filter:()=>u.current.shouldFilter,label:f||e["aria-label"],getDisablePointerSelection:()=>u.current.disablePointerSelection,listId:C,inputId:k,labelId:A,listInnerRef:D}),[]);function L(O,$){var W,re;let de=(re=(W=u.current)==null?void 0:W.filter)!=null?re:vF;return O?de(O,n.current.search,$):0}function I(){if(!n.current.search||u.current.shouldFilter===!1)return;let O=n.current.filtered.items,$=[];n.current.filtered.groups.forEach(re=>{let de=o.current.get(re),ie=0;de.forEach(oe=>{let Ce=O.get(oe);ie=Math.max(Ce,ie)}),$.push([re,ie])});let W=D.current;ne().sort((re,de)=>{var ie,oe;let Ce=re.getAttribute("id"),he=de.getAttribute("id");return((ie=O.get(he))!=null?ie:0)-((oe=O.get(Ce))!=null?oe:0)}).forEach(re=>{let de=re.closest(Up);de?de.appendChild(re.parentElement===de?re:re.closest(`${Up} > *`)):W.appendChild(re.parentElement===W?re:re.closest(`${Up} > *`))}),$.sort((re,de)=>de[1]-re[1]).forEach(re=>{var de;let ie=(de=D.current)==null?void 0:de.querySelector(`${nl}[${xi}="${encodeURIComponent(re[0])}"]`);ie==null||ie.parentElement.appendChild(ie)})}function q(){let O=ne().find(W=>W.getAttribute("aria-disabled")!=="true"),$=O==null?void 0:O.getAttribute(xi);R.setState("value",$||void 0)}function Y(){var O,$,W,re;if(!n.current.search||u.current.shouldFilter===!1){n.current.filtered.count=a.current.size;return}n.current.filtered.groups=new Set;let de=0;for(let ie of a.current){let oe=($=(O=s.current.get(ie))==null?void 0:O.value)!=null?$:"",Ce=(re=(W=s.current.get(ie))==null?void 0:W.keywords)!=null?re:[],he=L(oe,Ce);n.current.filtered.items.set(ie,he),he>0&&de++}for(let[ie,oe]of o.current)for(let Ce of oe)if(n.current.filtered.items.get(Ce)>0){n.current.filtered.groups.add(ie);break}n.current.filtered.count=de}function B(){var O,$,W;let re=X();re&&(((O=re.parentElement)==null?void 0:O.firstChild)===re&&((W=($=re.closest(nl))==null?void 0:$.querySelector(gF))==null||W.scrollIntoView({block:"nearest"})),re.scrollIntoView({block:"nearest"}))}function X(){var O;return(O=D.current)==null?void 0:O.querySelector(`${Kg}[aria-selected="true"]`)}function ne(){var O;return Array.from(((O=D.current)==null?void 0:O.querySelectorAll(o1))||[])}function F(O){let $=ne()[O];$&&R.setState("value",$.getAttribute(xi))}function z(O){var $;let W=X(),re=ne(),de=re.findIndex(oe=>oe===W),ie=re[de+O];($=u.current)!=null&&$.loop&&(ie=de+O<0?re[re.length-1]:de+O===re.length?re[0]:re[de+O]),ie&&R.setState("value",ie.getAttribute(xi))}function j(O){let $=X(),W=$==null?void 0:$.closest(nl),re;for(;W&&!re;)W=O>0?TF(W,nl):RF(W,nl),re=W==null?void 0:W.querySelector(o1);re?R.setState("value",re.getAttribute(xi)):z(O)}let K=()=>F(ne().length-1),G=O=>{O.preventDefault(),O.metaKey?K():O.altKey?j(1):z(1)},H=O=>{O.preventDefault(),O.metaKey?F(0):O.altKey?j(-1):z(-1)};return w.createElement(Ie.div,{ref:t,tabIndex:-1,...N,"cmdk-root":"",onKeyDown:O=>{var $;if(($=N.onKeyDown)==null||$.call(N,O),!O.defaultPrevented)switch(O.key){case"n":case"j":{_&&O.ctrlKey&&G(O);break}case"ArrowDown":{G(O);break}case"p":case"k":{_&&O.ctrlKey&&H(O);break}case"ArrowUp":{H(O);break}case"Home":{O.preventDefault(),F(0);break}case"End":{O.preventDefault(),K();break}case"Enter":if(!O.nativeEvent.isComposing&&O.keyCode!==229){O.preventDefault();let W=X();if(W){let re=new Event(Om);W.dispatchEvent(re)}}}}},w.createElement("label",{"cmdk-label":"",htmlFor:U.inputId,id:U.labelId,style:kF},f),xd(e,O=>w.createElement(uT.Provider,{value:R},w.createElement(cT.Provider,{value:U},O))))}),yF=w.forwardRef((e,t)=>{var n,a;let o=on(),s=w.useRef(null),c=w.useContext(dT),u=kl(),f=hT(e),h=(a=(n=f.current)==null?void 0:n.forceMount)!=null?a:c==null?void 0:c.forceMount;Di(()=>{if(!h)return u.item(o,c==null?void 0:c.id)},[h]);let m=pT(o,s,[e.value,e.children,s],e.keywords),g=Zg(),y=ki(M=>M.value&&M.value===m.current),b=ki(M=>h||u.filter()===!1?!0:M.search?M.filtered.items.get(o)>0:!0);w.useEffect(()=>{let M=s.current;if(!(!M||e.disabled))return M.addEventListener(Om,S),()=>M.removeEventListener(Om,S)},[b,e.onSelect,e.disabled]);function S(){var M,R;E(),(R=(M=f.current).onSelect)==null||R.call(M,m.current)}function E(){g.setState("value",m.current,!0)}if(!b)return null;let{disabled:_,value:N,onSelect:C,forceMount:A,keywords:k,...D}=e;return w.createElement(Ie.div,{ref:fl([s,t]),...D,id:o,"cmdk-item":"",role:"option","aria-disabled":!!_,"aria-selected":!!y,"data-disabled":!!_,"data-selected":!!y,onPointerMove:_||u.getDisablePointerSelection()?void 0:E,onClick:_?void 0:S},e.children)}),bF=w.forwardRef((e,t)=>{let{heading:n,children:a,forceMount:o,...s}=e,c=on(),u=w.useRef(null),f=w.useRef(null),h=on(),m=kl(),g=ki(b=>o||m.filter()===!1?!0:b.search?b.filtered.groups.has(c):!0);Di(()=>m.group(c),[]),pT(c,u,[e.value,e.heading,f]);let y=w.useMemo(()=>({id:c,forceMount:o}),[o]);return w.createElement(Ie.div,{ref:fl([u,t]),...s,"cmdk-group":"",role:"presentation",hidden:g?void 0:!0},n&&w.createElement("div",{ref:f,"cmdk-group-heading":"","aria-hidden":!0,id:h},n),xd(e,b=>w.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?h:void 0},w.createElement(dT.Provider,{value:y},b))))}),xF=w.forwardRef((e,t)=>{let{alwaysRender:n,...a}=e,o=w.useRef(null),s=ki(c=>!c.search);return!n&&!s?null:w.createElement(Ie.div,{ref:fl([o,t]),...a,"cmdk-separator":"",role:"separator"})}),wF=w.forwardRef((e,t)=>{let{onValueChange:n,...a}=e,o=e.value!=null,s=Zg(),c=ki(m=>m.search),u=ki(m=>m.value),f=kl(),h=w.useMemo(()=>{var m;let g=(m=f.listInnerRef.current)==null?void 0:m.querySelector(`${Kg}[${xi}="${encodeURIComponent(u)}"]`);return g==null?void 0:g.getAttribute("id")},[]);return w.useEffect(()=>{e.value!=null&&s.setState("search",e.value)},[e.value]),w.createElement(Ie.input,{ref:t,...a,"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":h,id:f.inputId,type:"text",value:o?e.value:c,onChange:m=>{o||s.setState("search",m.target.value),n==null||n(m.target.value)}})}),EF=w.forwardRef((e,t)=>{let{children:n,label:a="Suggestions",...o}=e,s=w.useRef(null),c=w.useRef(null),u=kl();return w.useEffect(()=>{if(c.current&&s.current){let f=c.current,h=s.current,m,g=new ResizeObserver(()=>{m=requestAnimationFrame(()=>{let y=f.offsetHeight;h.style.setProperty("--cmdk-list-height",y.toFixed(1)+"px")})});return g.observe(f),()=>{cancelAnimationFrame(m),g.unobserve(f)}}},[]),w.createElement(Ie.div,{ref:fl([s,t]),...o,"cmdk-list":"",role:"listbox","aria-label":a,id:u.listId},xd(e,f=>w.createElement("div",{ref:fl([c,u.listInnerRef]),"cmdk-list-sizer":""},f)))}),SF=w.forwardRef((e,t)=>{let{open:n,onOpenChange:a,overlayClassName:o,contentClassName:s,container:c,...u}=e;return w.createElement(pg,{open:n,onOpenChange:a},w.createElement(mg,{container:c},w.createElement(ad,{"cmdk-overlay":"",className:o}),w.createElement(id,{"aria-label":e.label,"cmdk-dialog":"",className:s},w.createElement(fT,{ref:t,...u}))))}),_F=w.forwardRef((e,t)=>ki(n=>n.filtered.count===0)?w.createElement(Ie.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),CF=w.forwardRef((e,t)=>{let{progress:n,children:a,label:o="Loading...",...s}=e;return w.createElement(Ie.div,{ref:t,...s,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":o},xd(e,c=>w.createElement("div",{"aria-hidden":!0},c)))}),Cn=Object.assign(fT,{List:EF,Item:yF,Input:wF,Group:bF,Separator:xF,Dialog:SF,Empty:_F,Loading:CF});function TF(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function RF(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function hT(e){let t=w.useRef(e);return Di(()=>{t.current=e}),t}var Di=typeof window>"u"?w.useEffect:w.useLayoutEffect;function Co(e){let t=w.useRef();return t.current===void 0&&(t.current=e()),t}function fl(e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}function ki(e){let t=Zg(),n=()=>e(t.snapshot());return mF.useSyncExternalStore(t.subscribe,n,n)}function pT(e,t,n,a=[]){let o=w.useRef(),s=kl();return Di(()=>{var c;let u=(()=>{var h;for(let m of n){if(typeof m=="string")return m.trim();if(typeof m=="object"&&"current"in m)return m.current?(h=m.current.textContent)==null?void 0:h.trim():o.current}})(),f=a.map(h=>h.trim());s.value(e,u,f),(c=t.current)==null||c.setAttribute(xi,u),o.current=u}),o}var AF=()=>{let[e,t]=w.useState(),n=Co(()=>new Map);return Di(()=>{n.current.forEach(a=>a()),n.current=new Map},[e]),(a,o)=>{n.current.set(a,o),t({})}};function DF(e){let t=e.type;return typeof t=="function"?t(e.props):"render"in t?t.render(e.props):e}function xd({asChild:e,children:t},n){return e&&w.isValidElement(t)?w.cloneElement(DF(t),{ref:t.ref},n(t.props.children)):n(t)}var kF={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};const mT=pg,gT=bS,NF=mg,vT=w.forwardRef(({className:e,...t},n)=>x.jsx(ad,{ref:n,className:Oe("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}));vT.displayName=ad.displayName;const Qg=w.forwardRef(({className:e,children:t,...n},a)=>x.jsxs(NF,{children:[x.jsx(vT,{}),x.jsxs(id,{ref:a,className:Oe("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,x.jsxs(yg,{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:[x.jsx(IE,{className:"h-4 w-4"}),x.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));Qg.displayName=id.displayName;const Jg=({className:e,...t})=>x.jsx("div",{className:Oe("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});Jg.displayName="DialogHeader";const ev=w.forwardRef(({className:e,...t},n)=>x.jsx(gg,{ref:n,className:Oe("text-lg leading-none font-semibold tracking-tight",e),...t}));ev.displayName=gg.displayName;const tv=w.forwardRef(({className:e,...t},n)=>x.jsx(vg,{ref:n,className:Oe("text-muted-foreground text-sm",e),...t}));tv.displayName=vg.displayName;const wd=w.forwardRef(({className:e,...t},n)=>x.jsx(Cn,{ref:n,className:Oe("bg-popover text-popover-foreground flex h-full w-full flex-col overflow-hidden rounded-md",e),...t}));wd.displayName=Cn.displayName;const nv=w.forwardRef(({className:e,...t},n)=>x.jsxs("div",{className:"flex items-center border-b px-3","cmdk-input-wrapper":"",children:[x.jsx(sj,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),x.jsx(Cn.Input,{ref:n,className:Oe("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})]}));nv.displayName=Cn.Input.displayName;const Ed=w.forwardRef(({className:e,...t},n)=>x.jsx(Cn.List,{ref:n,className:Oe("max-h-[300px] overflow-x-hidden overflow-y-auto",e),...t}));Ed.displayName=Cn.List.displayName;const rv=w.forwardRef((e,t)=>x.jsx(Cn.Empty,{ref:t,className:"py-6 text-center text-sm",...e}));rv.displayName=Cn.Empty.displayName;const Ko=w.forwardRef(({className:e,...t},n)=>x.jsx(Cn.Group,{ref:n,className:Oe("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}));Ko.displayName=Cn.Group.displayName;const OF=w.forwardRef(({className:e,...t},n)=>x.jsx(Cn.Separator,{ref:n,className:Oe("bg-border -mx-1 h-px",e),...t}));OF.displayName=Cn.Separator.displayName;const Zo=w.forwardRef(({className:e,...t},n)=>x.jsx(Cn.Item,{ref:n,className:Oe("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}));Zo.displayName=Cn.Item.displayName;const jF=({layout:e,autoRunFor:t})=>{const n=Zn(),{stop:a,start:o,isRunning:s}=e;return w.useEffect(()=>{if(!n)return;let c=null;return t!==void 0&&t>-1&&n.getGraph().order>0&&(o(),c=t>0?window.setTimeout(()=>{a()},t):null),()=>{a(),c&&clearTimeout(c)}},[t,o,a,n]),x.jsx(wt,{size:"icon",onClick:()=>s?a():o(),tooltip:s?"Stop the layout animation":"Start the layout animation",variant:_r,children:s?x.jsx(tj,{}):x.jsx(rj,{})})},LF=()=>{const e=Zn(),[t,n]=w.useState("Circular"),[a,o]=w.useState(!1),s=T5(),c=E5(),u=rF(),f=Q5({settings:{margin:1}}),h=j5({maxIterations:20}),m=iT({iterations:20}),g=J5(),y=L5(),b=H5(),S=w.useMemo(()=>({Circular:{layout:s},Circlepack:{layout:c},Random:{layout:u},Noverlaps:{layout:f,worker:g},"Force Directed":{layout:h,worker:y},"Force Atlas":{layout:m,worker:b}}),[c,s,h,m,f,u,y,g,b]),E=w.useCallback(_=>{console.debug(_);const{positions:N}=S[_].layout;BG(e.getGraph(),N(),{duration:500}),n(_)},[S,e]);return x.jsxs(x.Fragment,{children:[x.jsx("div",{children:S[t]&&"worker"in S[t]&&x.jsx(jF,{layout:S[t].worker})}),x.jsx("div",{children:x.jsxs(pd,{open:a,onOpenChange:o,children:[x.jsx(md,{asChild:!0,children:x.jsx(wt,{size:"icon",variant:_r,onClick:()=>o(_=>!_),tooltip:"Layout Graph",children:x.jsx($O,{})})}),x.jsx(_l,{side:"right",align:"center",className:"p-1",children:x.jsx(wd,{children:x.jsx(Ed,{children:x.jsx(Ko,{children:Object.keys(S).map(_=>x.jsx(Zo,{onSelect:()=>{E(_)},className:"cursor-pointer text-xs",children:_},_))})})})})]})})]})};var vu={exports:{}},zF=vu.exports,s1;function MF(){return s1||(s1=1,function(e){(function(t,n,a){function o(f){var h=this,m=u();h.next=function(){var g=2091639*h.s0+h.c*23283064365386963e-26;return h.s0=h.s1,h.s1=h.s2,h.s2=g-(h.c=g|0)},h.c=1,h.s0=m(" "),h.s1=m(" "),h.s2=m(" "),h.s0-=m(f),h.s0<0&&(h.s0+=1),h.s1-=m(f),h.s1<0&&(h.s1+=1),h.s2-=m(f),h.s2<0&&(h.s2+=1),m=null}function s(f,h){return h.c=f.c,h.s0=f.s0,h.s1=f.s1,h.s2=f.s2,h}function c(f,h){var m=new o(f),g=h&&h.state,y=m.next;return y.int32=function(){return m.next()*4294967296|0},y.double=function(){return y()+(y()*2097152|0)*11102230246251565e-32},y.quick=y,g&&(typeof g=="object"&&s(g,m),y.state=function(){return s(m,{})}),y}function u(){var f=4022871197,h=function(m){m=String(m);for(var g=0;g>>0,y-=f,y*=f,f=y>>>0,y-=f,f+=y*4294967296}return(f>>>0)*23283064365386963e-26};return h}n&&n.exports?n.exports=c:this.alea=c})(zF,e)}(vu)),vu.exports}var yu={exports:{}},PF=yu.exports,l1;function GF(){return l1||(l1=1,function(e){(function(t,n,a){function o(u){var f=this,h="";f.x=0,f.y=0,f.z=0,f.w=0,f.next=function(){var g=f.x^f.x<<11;return f.x=f.y,f.y=f.z,f.z=f.w,f.w^=f.w>>>19^g^g>>>8},u===(u|0)?f.x=u:h+=u;for(var m=0;m>>0)/4294967296};return g.double=function(){do var y=h.next()>>>11,b=(h.next()>>>0)/4294967296,S=(y+b)/(1<<21);while(S===0);return S},g.int32=h.next,g.quick=g,m&&(typeof m=="object"&&s(m,h),g.state=function(){return s(h,{})}),g}n&&n.exports?n.exports=c:this.xor128=c})(PF,e)}(yu)),yu.exports}var bu={exports:{}},FF=bu.exports,c1;function UF(){return c1||(c1=1,function(e){(function(t,n,a){function o(u){var f=this,h="";f.next=function(){var g=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^(g^g<<1))|0},f.x=0,f.y=0,f.z=0,f.w=0,f.v=0,u===(u|0)?f.x=u:h+=u;for(var m=0;m>>4),f.next()}function s(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 c(u,f){var h=new o(u),m=f&&f.state,g=function(){return(h.next()>>>0)/4294967296};return g.double=function(){do var y=h.next()>>>11,b=(h.next()>>>0)/4294967296,S=(y+b)/(1<<21);while(S===0);return S},g.int32=h.next,g.quick=g,m&&(typeof m=="object"&&s(m,h),g.state=function(){return s(h,{})}),g}n&&n.exports?n.exports=c:this.xorwow=c})(FF,e)}(bu)),bu.exports}var xu={exports:{}},BF=xu.exports,u1;function IF(){return u1||(u1=1,function(e){(function(t,n,a){function o(u){var f=this;f.next=function(){var m=f.x,g=f.i,y,b;return y=m[g],y^=y>>>7,b=y^y<<24,y=m[g+1&7],b^=y^y>>>10,y=m[g+3&7],b^=y^y>>>3,y=m[g+4&7],b^=y^y<<7,y=m[g+7&7],y=y^y<<13,b^=y^y<<9,m[g]=b,f.i=g+1&7,b};function h(m,g){var y,b=[];if(g===(g|0))b[0]=g;else for(g=""+g,y=0;y0;--y)m.next()}h(f,u)}function s(u,f){return f.x=u.x.slice(),f.i=u.i,f}function c(u,f){u==null&&(u=+new Date);var h=new o(u),m=f&&f.state,g=function(){return(h.next()>>>0)/4294967296};return g.double=function(){do var y=h.next()>>>11,b=(h.next()>>>0)/4294967296,S=(y+b)/(1<<21);while(S===0);return S},g.int32=h.next,g.quick=g,m&&(m.x&&s(m,h),g.state=function(){return s(h,{})}),g}n&&n.exports?n.exports=c:this.xorshift7=c})(BF,e)}(xu)),xu.exports}var wu={exports:{}},HF=wu.exports,d1;function $F(){return d1||(d1=1,function(e){(function(t,n,a){function o(u){var f=this;f.next=function(){var m=f.w,g=f.X,y=f.i,b,S;return f.w=m=m+1640531527|0,S=g[y+34&127],b=g[y=y+1&127],S^=S<<13,b^=b<<17,S^=S>>>15,b^=b>>>12,S=g[y]=S^b,f.i=y,S+(m^m>>>16)|0};function h(m,g){var y,b,S,E,_,N=[],C=128;for(g===(g|0)?(b=g,g=null):(g=g+"\0",b=0,C=Math.max(C,g.length)),S=0,E=-32;E>>15,b^=b<<4,b^=b>>>13,E>=0&&(_=_+1640531527|0,y=N[E&127]^=b+_,S=y==0?S+1:0);for(S>=128&&(N[(g&&g.length||0)&127]=-1),S=127,E=4*128;E>0;--E)b=N[S+34&127],y=N[S=S+1&127],b^=b<<13,y^=y<<17,b^=b>>>15,y^=y>>>12,N[S]=b^y;m.w=_,m.X=N,m.i=S}h(f,u)}function s(u,f){return f.i=u.i,f.w=u.w,f.X=u.X.slice(),f}function c(u,f){u==null&&(u=+new Date);var h=new o(u),m=f&&f.state,g=function(){return(h.next()>>>0)/4294967296};return g.double=function(){do var y=h.next()>>>11,b=(h.next()>>>0)/4294967296,S=(y+b)/(1<<21);while(S===0);return S},g.int32=h.next,g.quick=g,m&&(m.X&&s(m,h),g.state=function(){return s(h,{})}),g}n&&n.exports?n.exports=c:this.xor4096=c})(HF,e)}(wu)),wu.exports}var Eu={exports:{}},VF=Eu.exports,f1;function qF(){return f1||(f1=1,function(e){(function(t,n,a){function o(u){var f=this,h="";f.next=function(){var g=f.b,y=f.c,b=f.d,S=f.a;return g=g<<25^g>>>7^y,y=y-b|0,b=b<<24^b>>>8^S,S=S-g|0,f.b=g=g<<20^g>>>12^y,f.c=y=y-b|0,f.d=b<<16^y>>>16^S,f.a=S-g|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):h+=u;for(var m=0;m>>0)/4294967296};return g.double=function(){do var y=h.next()>>>11,b=(h.next()>>>0)/4294967296,S=(y+b)/(1<<21);while(S===0);return S},g.int32=h.next,g.quick=g,m&&(typeof m=="object"&&s(m,h),g.state=function(){return s(h,{})}),g}n&&n.exports?n.exports=c:this.tychei=c})(VF,e)}(Eu)),Eu.exports}var Su={exports:{}};const YF={},WF=Object.freeze(Object.defineProperty({__proto__:null,default:YF},Symbol.toStringTag,{value:"Module"})),XF=bD(WF);var KF=Su.exports,h1;function ZF(){return h1||(h1=1,function(e){(function(t,n,a){var o=256,s=6,c=52,u="random",f=a.pow(o,s),h=a.pow(2,c),m=h*2,g=o-1,y;function b(k,D,M){var R=[];D=D==!0?{entropy:!0}:D||{};var U=N(_(D.entropy?[k,A(n)]:k??C(),3),R),L=new S(R),I=function(){for(var q=L.g(s),Y=f,B=0;q=m;)q/=2,Y/=2,B>>>=1;return(q+B)/Y};return I.int32=function(){return L.g(4)|0},I.quick=function(){return L.g(4)/4294967296},I.double=I,N(A(L.S),n),(D.pass||M||function(q,Y,B,X){return X&&(X.S&&E(X,L),q.state=function(){return E(L,{})}),B?(a[u]=q,Y):q})(I,U,"global"in D?D.global:this==a,D.state)}function S(k){var D,M=k.length,R=this,U=0,L=R.i=R.j=0,I=R.S=[];for(M||(k=[M++]);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),a=e.getNode(t.target);if(n==null||a==null)return!1}return!0},nU=async e=>{let t=null;try{t=await pO(e)}catch(a){return En.getState().setErrorMessage(Sr(a),"Query Graphs Error!"),null}let n=null;if(t){const a={},o={};for(let f=0;f0){const f=Nk-o0;for(const h of t.nodes)h.size=Math.round(o0+f*Math.pow((h.degree-s)/u,.5))}n=new p5,n.nodes=t.nodes,n.edges=t.edges,n.nodeIdMap=a,n.edgeIdMap=o,tU(n)||(n=null,console.error("Invalid graph data")),console.log("Graph data loaded")}return n},rU=e=>{const t=new dl;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:Rk,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},m1={label:""},yT=()=>{const e=Ye.use.queryLabel(),t=ct.use.rawGraph(),n=ct.use.sigmaGraph(),a=w.useCallback(c=>(t==null?void 0:t.getNode(c))||null,[t]),o=w.useCallback((c,u=!0)=>(t==null?void 0:t.getEdge(c,u))||null,[t]);return w.useEffect(()=>{if(e){if(m1.label!==e){m1.label=e;const c=ct.getState();c.reset(),nU(e).then(u=>{c.setSigmaGraph(rU(u)),u==null||u.buildDynamicMap(),c.setRawGraph(u)})}}else{const c=ct.getState();c.reset(),c.setSigmaGraph(new dl)}},[e]),{lightrageGraph:w.useCallback(()=>{if(n)return n;const c=new dl;return ct.getState().setSigmaGraph(c),c},[n]),getNode:a,getEdge:o}},ru=e=>!!(e.type.startsWith("mouse")&&e.buttons!==0),aU=({disableHoverEffect:e})=>{const{lightrageGraph:t}=yT(),n=Zn(),a=GC(),o=PC(),s=m3(),{assign:c}=iT({iterations:20}),{theme:u}=O_(),f=Ye.use.enableHideUnselectedEdges(),h=ct.use.selectedNode(),m=ct.use.focusedNode(),g=ct.use.selectedEdge(),y=ct.use.focusedEdge();return w.useEffect(()=>{const b=t();s(b),b.__force_applied||(c(),Object.assign(b,{__force_applied:!0}));const{setFocusedNode:S,setSelectedNode:E,setFocusedEdge:_,setSelectedEdge:N,clearSelection:C}=ct.getState();a({enterNode:A=>{ru(A.event.original)||S(A.node)},leaveNode:A=>{ru(A.event.original)||S(null)},clickNode:A=>{E(A.node),N(null)},clickEdge:A=>{N(A.edge),E(null)},enterEdge:A=>{ru(A.event.original)||_(A.edge)},leaveEdge:A=>{ru(A.event.original)||_(null)},clickStage:()=>C()})},[c,s,a,t]),w.useEffect(()=>{const b=u==="dark",S=b?_k:void 0,E=b?Dk:void 0;o({nodeReducer:(_,N)=>{const C=n.getGraph(),A={...N,highlighted:N.highlighted||!1,labelColor:S};if(!e){A.highlighted=!1;const k=m||h,D=y||g;if(k)(_===k||C.neighbors(k).includes(_))&&(A.highlighted=!0,_===h&&(A.borderColor=Ak));else if(D)C.extremities(D).includes(_)&&(A.highlighted=!0,A.size=3);else return A;A.highlighted?b&&(A.labelColor=Ck):A.color=Tk}return A},edgeReducer:(_,N)=>{const C=n.getGraph(),A={...N,hidden:!1,labelColor:S,color:E};if(!e){const k=m||h;k?f?C.extremities(_).includes(k)||(A.hidden=!0):C.extremities(_).includes(k)&&(A.color=i0):(y||g)&&(_===g?A.color=kk:_===y?A.color=i0:f&&(A.hidden=!0))}return A}})},[h,m,g,y,o,n,e,u,f]),null},iU=()=>{const{zoomIn:e,zoomOut:t,reset:n}=FC({duration:200,factor:1.5}),a=w.useCallback(()=>e(),[e]),o=w.useCallback(()=>t(),[t]),s=w.useCallback(()=>n(),[n]);return x.jsxs(x.Fragment,{children:[x.jsx(wt,{variant:_r,onClick:a,tooltip:"Zoom In",size:"icon",children:x.jsx(bj,{})}),x.jsx(wt,{variant:_r,onClick:o,tooltip:"Zoom Out",size:"icon",children:x.jsx(wj,{})}),x.jsx(wt,{variant:_r,onClick:s,tooltip:"Reset Zoom",size:"icon",children:x.jsx(UO,{})})]})},oU=()=>{const{isFullScreen:e,toggle:t}=g3();return x.jsx(x.Fragment,{children:e?x.jsx(wt,{variant:_r,onClick:t,tooltip:"Windowed",size:"icon",children:x.jsx(ZO,{})}):x.jsx(wt,{variant:_r,onClick:t,tooltip:"Full Screen",size:"icon",children:x.jsx(XO,{})})})};function bT(e){const t=w.useRef({value:e,previous:e});return w.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var av="Checkbox",[sU,W6]=Kn(av),[lU,cU]=sU(av),xT=w.forwardRef((e,t)=>{const{__scopeCheckbox:n,name:a,checked:o,defaultChecked:s,required:c,disabled:u,value:f="on",onCheckedChange:h,form:m,...g}=e,[y,b]=w.useState(null),S=nt(t,k=>b(k)),E=w.useRef(!1),_=y?m||!!y.closest("form"):!0,[N=!1,C]=aa({prop:o,defaultProp:s,onChange:h}),A=w.useRef(N);return w.useEffect(()=>{const k=y==null?void 0:y.form;if(k){const D=()=>C(A.current);return k.addEventListener("reset",D),()=>k.removeEventListener("reset",D)}},[y,C]),x.jsxs(lU,{scope:n,state:N,disabled:u,children:[x.jsx(Ie.button,{type:"button",role:"checkbox","aria-checked":Fa(N)?"mixed":N,"aria-required":c,"data-state":ST(N),"data-disabled":u?"":void 0,disabled:u,value:f,...g,ref:S,onKeyDown:Be(e.onKeyDown,k=>{k.key==="Enter"&&k.preventDefault()}),onClick:Be(e.onClick,k=>{C(D=>Fa(D)?!0:!D),_&&(E.current=k.isPropagationStopped(),E.current||k.stopPropagation())})}),_&&x.jsx(uU,{control:y,bubbles:!E.current,name:a,value:f,checked:N,required:c,disabled:u,form:m,style:{transform:"translateX(-100%)"},defaultChecked:Fa(s)?!1:s})]})});xT.displayName=av;var wT="CheckboxIndicator",ET=w.forwardRef((e,t)=>{const{__scopeCheckbox:n,forceMount:a,...o}=e,s=cU(wT,n);return x.jsx(zn,{present:a||Fa(s.state)||s.state===!0,children:x.jsx(Ie.span,{"data-state":ST(s.state),"data-disabled":s.disabled?"":void 0,...o,ref:t,style:{pointerEvents:"none",...e.style}})})});ET.displayName=wT;var uU=e=>{const{control:t,checked:n,bubbles:a=!0,defaultChecked:o,...s}=e,c=w.useRef(null),u=bT(n),f=XS(t);w.useEffect(()=>{const m=c.current,g=window.HTMLInputElement.prototype,b=Object.getOwnPropertyDescriptor(g,"checked").set;if(u!==n&&b){const S=new Event("click",{bubbles:a});m.indeterminate=Fa(n),b.call(m,Fa(n)?!1:n),m.dispatchEvent(S)}},[u,n,a]);const h=w.useRef(Fa(n)?!1:n);return x.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:o??h.current,...s,tabIndex:-1,ref:c,style:{...e.style,...f,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function Fa(e){return e==="indeterminate"}function ST(e){return Fa(e)?"indeterminate":e?"checked":"unchecked"}var _T=xT,dU=ET;const sl=w.forwardRef(({className:e,...t},n)=>x.jsx(_T,{ref:n,className:Oe("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:x.jsx(dU,{className:Oe("flex items-center justify-center text-current"),children:x.jsx(ig,{className:"h-4 w-4"})})}));sl.displayName=_T.displayName;var fU="Separator",g1="horizontal",hU=["horizontal","vertical"],CT=w.forwardRef((e,t)=>{const{decorative:n,orientation:a=g1,...o}=e,s=pU(a)?a:g1,u=n?{role:"none"}:{"aria-orientation":s==="vertical"?s:void 0,role:"separator"};return x.jsx(Ie.div,{"data-orientation":s,...u,...o,ref:t})});CT.displayName=fU;function pU(e){return hU.includes(e)}var TT=CT;const al=w.forwardRef(({className:e,orientation:t="horizontal",decorative:n=!0,...a},o)=>x.jsx(TT,{ref:o,decorative:n,orientation:t,className:Oe("bg-border shrink-0",t==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",e),...a}));al.displayName=TT.displayName;const za=({checked:e,onCheckedChange:t,label:n})=>x.jsxs("div",{className:"flex items-center gap-2",children:[x.jsx(sl,{checked:e,onCheckedChange:t}),x.jsx("label",{htmlFor:"terms",className:"text-sm leading-none font-medium peer-disabled:cursor-not-allowed peer-disabled:opacity-70",children:n})]});function mU(){const[e,t]=w.useState(!1),[n,a]=w.useState(""),o=Ye.use.showPropertyPanel(),s=Ye.use.showNodeSearchBar(),c=Ye.use.showNodeLabel(),u=Ye.use.enableEdgeEvents(),f=Ye.use.enableNodeDrag(),h=Ye.use.enableHideUnselectedEdges(),m=Ye.use.showEdgeLabel(),g=Ye.use.enableHealthCheck(),y=Ye.use.apiKey();w.useEffect(()=>{a(y||"")},[y,e]);const b=w.useCallback(()=>Ye.setState(R=>({enableNodeDrag:!R.enableNodeDrag})),[]),S=w.useCallback(()=>Ye.setState(R=>({enableEdgeEvents:!R.enableEdgeEvents})),[]),E=w.useCallback(()=>Ye.setState(R=>({enableHideUnselectedEdges:!R.enableHideUnselectedEdges})),[]),_=w.useCallback(()=>Ye.setState(R=>({showEdgeLabel:!R.showEdgeLabel})),[]),N=w.useCallback(()=>Ye.setState(R=>({showPropertyPanel:!R.showPropertyPanel})),[]),C=w.useCallback(()=>Ye.setState(R=>({showNodeSearchBar:!R.showNodeSearchBar})),[]),A=w.useCallback(()=>Ye.setState(R=>({showNodeLabel:!R.showNodeLabel})),[]),k=w.useCallback(()=>Ye.setState(R=>({enableHealthCheck:!R.enableHealthCheck})),[]),D=w.useCallback(async()=>{Ye.setState({apiKey:n||null}),await En.getState().check(),t(!1)},[n]),M=w.useCallback(R=>{a(R.target.value)},[a]);return x.jsxs(pd,{open:e,onOpenChange:t,children:[x.jsx(md,{asChild:!0,children:x.jsx(wt,{variant:_r,tooltip:"Settings",size:"icon",children:x.jsx(dj,{})})}),x.jsx(_l,{side:"right",align:"start",className:"mb-2 p-2",onCloseAutoFocus:R=>R.preventDefault(),children:x.jsxs("div",{className:"flex flex-col gap-2",children:[x.jsx(za,{checked:o,onCheckedChange:N,label:"Show Property Panel"}),x.jsx(za,{checked:s,onCheckedChange:C,label:"Show Search Bar"}),x.jsx(al,{}),x.jsx(za,{checked:c,onCheckedChange:A,label:"Show Node Label"}),x.jsx(za,{checked:f,onCheckedChange:b,label:"Node Draggable"}),x.jsx(al,{}),x.jsx(za,{checked:m,onCheckedChange:_,label:"Show Edge Label"}),x.jsx(za,{checked:h,onCheckedChange:E,label:"Hide Unselected Edges"}),x.jsx(za,{checked:u,onCheckedChange:S,label:"Edge Events"}),x.jsx(al,{}),x.jsx(za,{checked:g,onCheckedChange:k,label:"Health Check"}),x.jsx(al,{}),x.jsxs("div",{className:"flex flex-col gap-2",children:[x.jsx("label",{className:"text-sm font-medium",children:"API Key"}),x.jsxs("form",{className:"flex h-6 gap-2",onSubmit:R=>R.preventDefault(),children:[x.jsx("div",{className:"w-0 flex-1",children:x.jsx(Ai,{type:"password",value:n,onChange:M,placeholder:"Enter your API key",className:"max-h-full w-full min-w-0",autoComplete:"off"})}),x.jsx(wt,{onClick:D,variant:"outline",size:"sm",className:"max-h-full shrink-0",children:"Save"})]})]})]})})]})}function _u(e,t,n,a){function o(s){return s instanceof n?s:new n(function(c){c(s)})}return new(n||(n=Promise))(function(s,c){function u(m){try{h(a.next(m))}catch(g){c(g)}}function f(m){try{h(a.throw(m))}catch(g){c(g)}}function h(m){m.done?s(m.value):o(m.value).then(u,f)}h((a=a.apply(e,[])).next())})}const gU="ENTRIES",RT="KEYS",AT="VALUES",Kt="";class Ip{constructor(t,n){const a=t._tree,o=Array.from(a.keys());this.set=t,this._type=n,this._path=o.length>0?[{node:a,keys:o}]:[]}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}=So(this._path);if(So(n)===Kt)return{done:!1,value:this.result()};const a=t.get(So(n));return this._path.push({node:a,keys:Array.from(a.keys())}),this.dive()}backtrack(){if(this._path.length===0)return;const t=So(this._path).keys;t.pop(),!(t.length>0)&&(this._path.pop(),this.backtrack())}key(){return this.set._prefix+this._path.map(({keys:t})=>So(t)).filter(t=>t!==Kt).join("")}value(){return So(this._path).node.get(Kt)}result(){switch(this._type){case AT:return this.value();case RT:return this.key();default:return[this.key(),this.value()]}}[Symbol.iterator](){return this}}const So=e=>e[e.length-1],vU=(e,t,n)=>{const a=new Map;if(t===void 0)return a;const o=t.length+1,s=o+n,c=new Uint8Array(s*o).fill(n+1);for(let u=0;u{const f=s*c;e:for(const h of e.keys())if(h===Kt){const m=o[f-1];m<=n&&a.set(u,[e.get(h),m])}else{let m=s;for(let g=0;gn)continue e}DT(e.get(h),t,n,a,o,m,c,u+h)}};class Ga{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,a]=Pu(this._tree,t.slice(this._prefix.length));if(n===void 0){const[o,s]=iv(a);for(const c of o.keys())if(c!==Kt&&c.startsWith(s)){const u=new Map;return u.set(c.slice(s.length),o.get(c)),new Ga(u,t)}}return new Ga(n,t)}clear(){this._size=void 0,this._tree.clear()}delete(t){return this._size=void 0,yU(this._tree,t)}entries(){return new Ip(this,gU)}forEach(t){for(const[n,a]of this)t(n,a,this)}fuzzyGet(t,n){return vU(this._tree,t,n)}get(t){const n=jm(this._tree,t);return n!==void 0?n.get(Kt):void 0}has(t){const n=jm(this._tree,t);return n!==void 0&&n.has(Kt)}keys(){return new Ip(this,RT)}set(t,n){if(typeof t!="string")throw new Error("key must be a string");return this._size=void 0,Hp(this._tree,t).set(Kt,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 a=Hp(this._tree,t);return a.set(Kt,n(a.get(Kt))),this}fetch(t,n){if(typeof t!="string")throw new Error("key must be a string");this._size=void 0;const a=Hp(this._tree,t);let o=a.get(Kt);return o===void 0&&a.set(Kt,o=n()),o}values(){return new Ip(this,AT)}[Symbol.iterator](){return this.entries()}static from(t){const n=new Ga;for(const[a,o]of t)n.set(a,o);return n}static fromObject(t){return Ga.from(Object.entries(t))}}const Pu=(e,t,n=[])=>{if(t.length===0||e==null)return[e,n];for(const a of e.keys())if(a!==Kt&&t.startsWith(a))return n.push([e,a]),Pu(e.get(a),t.slice(a.length),n);return n.push([e,t]),Pu(void 0,"",n)},jm=(e,t)=>{if(t.length===0||e==null)return e;for(const n of e.keys())if(n!==Kt&&t.startsWith(n))return jm(e.get(n),t.slice(n.length))},Hp=(e,t)=>{const n=t.length;e:for(let a=0;e&&a{const[n,a]=Pu(e,t);if(n!==void 0){if(n.delete(Kt),n.size===0)kT(a);else if(n.size===1){const[o,s]=n.entries().next().value;NT(a,o,s)}}},kT=e=>{if(e.length===0)return;const[t,n]=iv(e);if(t.delete(n),t.size===0)kT(e.slice(0,-1));else if(t.size===1){const[a,o]=t.entries().next().value;a!==Kt&&NT(e.slice(0,-1),a,o)}},NT=(e,t,n)=>{if(e.length===0)return;const[a,o]=iv(e);a.set(o+t,n),a.delete(o)},iv=e=>e[e.length-1],ov="or",OT="and",bU="and_not";class Ua{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?qp:t.autoVacuum;this._options=Object.assign(Object.assign(Object.assign({},Vp),t),{autoVacuum:n,searchOptions:Object.assign(Object.assign({},v1),t.searchOptions||{}),autoSuggestOptions:Object.assign(Object.assign({},_U),t.autoSuggestOptions||{})}),this._index=new Ga,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=zm,this.addFields(this._options.fields)}add(t){const{extractField:n,tokenize:a,processTerm:o,fields:s,idField:c}=this._options,u=n(t,c);if(u==null)throw new Error(`MiniSearch: document does not have ID field "${c}"`);if(this._idToShortId.has(u))throw new Error(`MiniSearch: duplicate ID ${u}`);const f=this.addDocumentId(u);this.saveStoredFields(f,t);for(const h of s){const m=n(t,h);if(m==null)continue;const g=a(m.toString(),h),y=this._fieldIds[h],b=new Set(g).size;this.addFieldLength(f,y,this._documentCount-1,b);for(const S of g){const E=o(S,h);if(Array.isArray(E))for(const _ of E)this.addTerm(y,f,_);else E&&this.addTerm(y,f,E)}}}addAll(t){for(const n of t)this.add(n)}addAllAsync(t,n={}){const{chunkSize:a=10}=n,o={chunk:[],promise:Promise.resolve()},{chunk:s,promise:c}=t.reduce(({chunk:u,promise:f},h,m)=>(u.push(h),(m+1)%a===0?{chunk:[],promise:f.then(()=>new Promise(g=>setTimeout(g,0))).then(()=>this.addAll(u))}:{chunk:u,promise:f}),o);return c.then(()=>this.addAll(s))}remove(t){const{tokenize:n,processTerm:a,extractField:o,fields:s,idField:c}=this._options,u=o(t,c);if(u==null)throw new Error(`MiniSearch: document does not have ID field "${c}"`);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 h of s){const m=o(t,h);if(m==null)continue;const g=n(m.toString(),h),y=this._fieldIds[h],b=new Set(g).size;this.removeFieldLength(f,y,this._documentCount,b);for(const S of g){const E=a(S,h);if(Array.isArray(E))for(const _ of E)this.removeTerm(y,f,_);else E&&this.removeTerm(y,f,E)}}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 Ga,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((a,o)=>{this.removeFieldLength(n,o,this._documentCount,a)}),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:a,batchWait:o}=this._options.autoVacuum;this.conditionalVacuum({batchSize:a,batchWait:o},{minDirtCount:n,minDirtFactor:t})}discardAll(t){const n=this._options.autoVacuum;try{this._options.autoVacuum=!1;for(const a of t)this.discard(a)}finally{this._options.autoVacuum=n}this.maybeAutoVacuum()}replace(t){const{idField:n,extractField:a}=this._options,o=a(t,n);this.discard(o),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 a=this._enqueuedVacuumConditions;return this._enqueuedVacuumConditions=zm,this.performVacuuming(t,a)}),this._enqueuedVacuum)):this.vacuumConditionsMet(n)===!1?Promise.resolve():(this._currentVacuum=this.performVacuuming(t),this._currentVacuum)}performVacuuming(t,n){return _u(this,void 0,void 0,function*(){const a=this._dirtCount;if(this.vacuumConditionsMet(n)){const o=t.batchSize||Lm.batchSize,s=t.batchWait||Lm.batchWait;let c=1;for(const[u,f]of this._index){for(const[h,m]of f)for(const[g]of m)this._documentIds.has(g)||(m.size<=1?f.delete(h):m.delete(g));this._index.get(u).size===0&&this._index.delete(u),c%o===0&&(yield new Promise(h=>setTimeout(h,s))),c+=1}this._dirtCount-=a}yield null,this._currentVacuum=this._enqueuedVacuum,this._enqueuedVacuum=null})}vacuumConditionsMet(t){if(t==null)return!0;let{minDirtCount:n,minDirtFactor:a}=t;return n=n||qp.minDirtCount,a=a||qp.minDirtFactor,this.dirtCount>=n&&this.dirtFactor>=a}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:a}=this._options,o=Object.assign(Object.assign({},a),n),s=this.executeQuery(t,n),c=[];for(const[u,{score:f,terms:h,match:m}]of s){const g=h.length||1,y={id:this._documentIds.get(u),score:f*g,terms:Object.keys(m),queryTerms:h,match:m};Object.assign(y,this._storedFields.get(u)),(o.filter==null||o.filter(y))&&c.push(y)}return t===Ua.wildcard&&o.boostDocument==null||c.sort(b1),c}autoSuggest(t,n={}){n=Object.assign(Object.assign({},this._options.autoSuggestOptions),n);const a=new Map;for(const{score:s,terms:c}of this.search(t,n)){const u=c.join(" "),f=a.get(u);f!=null?(f.score+=s,f.count+=1):a.set(u,{score:s,terms:c,count:1})}const o=[];for(const[s,{score:c,terms:u,count:f}]of a)o.push({suggestion:s,terms:u,score:c/f});return o.sort(b1),o}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 _u(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(Vp.hasOwnProperty(t))return $p(Vp,t);throw new Error(`MiniSearch: unknown option "${t}"`)}static loadJS(t,n){const{index:a,documentIds:o,fieldLength:s,storedFields:c,serializationVersion:u}=t,f=this.instantiateMiniSearch(t,n);f._documentIds=au(o),f._fieldLength=au(s),f._storedFields=au(c);for(const[h,m]of f._documentIds)f._idToShortId.set(m,h);for(const[h,m]of a){const g=new Map;for(const y of Object.keys(m)){let b=m[y];u===1&&(b=b.ds),g.set(parseInt(y,10),au(b))}f._index.set(h,g)}return f}static loadJSAsync(t,n){return _u(this,void 0,void 0,function*(){const{index:a,documentIds:o,fieldLength:s,storedFields:c,serializationVersion:u}=t,f=this.instantiateMiniSearch(t,n);f._documentIds=yield iu(o),f._fieldLength=yield iu(s),f._storedFields=yield iu(c);for(const[m,g]of f._documentIds)f._idToShortId.set(g,m);let h=0;for(const[m,g]of a){const y=new Map;for(const b of Object.keys(g)){let S=g[b];u===1&&(S=S.ds),y.set(parseInt(b,10),yield iu(S))}++h%1e3===0&&(yield jT(0)),f._index.set(m,y)}return f})}static instantiateMiniSearch(t,n){const{documentCount:a,nextId:o,fieldIds:s,averageFieldLength:c,dirtCount:u,serializationVersion:f}=t;if(f!==1&&f!==2)throw new Error("MiniSearch: cannot deserialize an index created with an incompatible version");const h=new Ua(n);return h._documentCount=a,h._nextId=o,h._idToShortId=new Map,h._fieldIds=s,h._avgFieldLength=c,h._dirtCount=u||0,h._index=new Ga,h}executeQuery(t,n={}){if(t===Ua.wildcard)return this.executeWildcardQuery(n);if(typeof t!="string"){const y=Object.assign(Object.assign(Object.assign({},n),t),{queries:void 0}),b=t.queries.map(S=>this.executeQuery(S,y));return this.combineResults(b,y.combineWith)}const{tokenize:a,processTerm:o,searchOptions:s}=this._options,c=Object.assign(Object.assign({tokenize:a,processTerm:o},s),n),{tokenize:u,processTerm:f}=c,g=u(t).flatMap(y=>f(y)).filter(y=>!!y).map(SU(c)).map(y=>this.executeQuerySpec(y,c));return this.combineResults(g,c.combineWith)}executeQuerySpec(t,n){const a=Object.assign(Object.assign({},this._options.searchOptions),n),o=(a.fields||this._options.fields).reduce((E,_)=>Object.assign(Object.assign({},E),{[_]:$p(a.boost,_)||1}),{}),{boostDocument:s,weights:c,maxFuzzy:u,bm25:f}=a,{fuzzy:h,prefix:m}=Object.assign(Object.assign({},v1.weights),c),g=this._index.get(t.term),y=this.termResults(t.term,t.term,1,t.termBoost,g,o,s,f);let b,S;if(t.prefix&&(b=this._index.atPrefix(t.term)),t.fuzzy){const E=t.fuzzy===!0?.2:t.fuzzy,_=E<1?Math.min(u,Math.round(t.term.length*E)):E;_&&(S=this._index.fuzzyGet(t.term,_))}if(b)for(const[E,_]of b){const N=E.length-t.term.length;if(!N)continue;S==null||S.delete(E);const C=m*E.length/(E.length+.3*N);this.termResults(t.term,E,C,t.termBoost,_,o,s,f,y)}if(S)for(const E of S.keys()){const[_,N]=S.get(E);if(!N)continue;const C=h*E.length/(E.length+N);this.termResults(t.term,E,C,t.termBoost,_,o,s,f,y)}return y}executeWildcardQuery(t){const n=new Map,a=Object.assign(Object.assign({},this._options.searchOptions),t);for(const[o,s]of this._documentIds){const c=a.boostDocument?a.boostDocument(s,"",this._storedFields.get(o)):1;n.set(o,{score:c,terms:[],match:{}})}return n}combineResults(t,n=ov){if(t.length===0)return new Map;const a=n.toLowerCase(),o=xU[a];if(!o)throw new Error(`Invalid combination operator: ${n}`);return t.reduce(o)||new Map}toJSON(){const t=[];for(const[n,a]of this._index){const o={};for(const[s,c]of a)o[s]=Object.fromEntries(c);t.push([n,o])}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,a,o,s,c,u,f,h=new Map){if(s==null)return h;for(const m of Object.keys(c)){const g=c[m],y=this._fieldIds[m],b=s.get(y);if(b==null)continue;let S=b.size;const E=this._avgFieldLength[y];for(const _ of b.keys()){if(!this._documentIds.has(_)){this.removeTerm(y,_,n),S-=1;continue}const N=u?u(this._documentIds.get(_),n,this._storedFields.get(_)):1;if(!N)continue;const C=b.get(_),A=this._fieldLength.get(_)[y],k=EU(C,S,this._documentCount,A,E,f),D=a*o*g*N*k,M=h.get(_);if(M){M.score+=D,CU(M.terms,t);const R=$p(M.match,n);R?R.push(m):M.match[n]=[m]}else h.set(_,{score:D,terms:[t],match:{[n]:[m]}})}}return h}addTerm(t,n,a){const o=this._index.fetch(a,x1);let s=o.get(t);if(s==null)s=new Map,s.set(n,1),o.set(t,s);else{const c=s.get(n);s.set(n,(c||0)+1)}}removeTerm(t,n,a){if(!this._index.has(a)){this.warnDocumentChanged(n,t,a);return}const o=this._index.fetch(a,x1),s=o.get(t);s==null||s.get(n)==null?this.warnDocumentChanged(n,t,a):s.get(n)<=1?s.size<=1?o.delete(t):s.delete(n):s.set(n,s.get(n)-1),this._index.get(a).size===0&&this._index.delete(a)}warnDocumentChanged(t,n,a){for(const o of Object.keys(this._fieldIds))if(this._fieldIds[o]===n){this._options.logger("warn",`MiniSearch: document with ID ${this._documentIds.get(t)} has changed before removal: term "${a}" was not present in field "${o}". 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,xU={[ov]:(e,t)=>{for(const n of t.keys()){const a=e.get(n);if(a==null)e.set(n,t.get(n));else{const{score:o,terms:s,match:c}=t.get(n);a.score=a.score+o,a.match=Object.assign(a.match,c),y1(a.terms,s)}}return e},[OT]:(e,t)=>{const n=new Map;for(const a of t.keys()){const o=e.get(a);if(o==null)continue;const{score:s,terms:c,match:u}=t.get(a);y1(o.terms,c),n.set(a,{score:o.score+s,terms:o.terms,match:Object.assign(o.match,u)})}return n},[bU]:(e,t)=>{for(const n of t.keys())e.delete(n);return e}},wU={k:1.2,b:.7,d:.5},EU=(e,t,n,a,o,s)=>{const{k:c,b:u,d:f}=s;return Math.log(1+(n-t+.5)/(t+.5))*(f+e*(c+1)/(e+c*(1-u+u*a/o)))},SU=e=>(t,n,a)=>{const o=typeof e.fuzzy=="function"?e.fuzzy(t,n,a):e.fuzzy||!1,s=typeof e.prefix=="function"?e.prefix(t,n,a):e.prefix===!0,c=typeof e.boostTerm=="function"?e.boostTerm(t,n,a):1;return{term:t,fuzzy:o,prefix:s,termBoost:c}},Vp={idField:"id",extractField:(e,t)=>e[t],tokenize:e=>e.split(TU),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},v1={combineWith:ov,prefix:!1,fuzzy:!1,maxFuzzy:6,boost:{},weights:{fuzzy:.45,prefix:.375},bm25:wU},_U={combineWith:OT,prefix:(e,t,n)=>t===n.length-1},Lm={batchSize:1e3,batchWait:10},zm={minDirtFactor:.1,minDirtCount:20},qp=Object.assign(Object.assign({},Lm),zm),CU=(e,t)=>{e.includes(t)||e.push(t)},y1=(e,t)=>{for(const n of t)e.includes(n)||e.push(n)},b1=({score:e},{score:t})=>t-e,x1=()=>new Map,au=e=>{const t=new Map;for(const n of Object.keys(e))t.set(parseInt(n,10),e[n]);return t},iu=e=>_u(void 0,void 0,void 0,function*(){const t=new Map;let n=0;for(const a of Object.keys(e))t.set(parseInt(a,10),e[a]),++n%1e3===0&&(yield jT(0));return t}),jT=e=>new Promise(t=>setTimeout(t,e)),TU=/[\n\r\p{Z}\p{P}]+/u,RU={index:new Ua({fields:[]})};w.createContext(RU);const Mm=({label:e,color:t,hidden:n,labels:a={}})=>ve.createElement("div",{className:"node"},ve.createElement("span",{className:"render "+(n?"circle":"disc"),style:{backgroundColor:t||"#000"}}),ve.createElement("span",{className:`label ${n?"text-muted":""} ${e?"":"text-italic"}`},e||a.no_label||"No label")),AU=({id:e,labels:t})=>{const n=Zn(),a=w.useMemo(()=>{const o=n.getGraph().getNodeAttributes(e),s=n.getSetting("nodeReducer");return Object.assign(Object.assign({color:n.getSetting("defaultNodeColor")},o),s?s(e,o):{})},[n,e]);return ve.createElement(Mm,Object.assign({},a,{labels:t}))},DU=({label:e,color:t,source:n,target:a,hidden:o,directed:s,labels:c={}})=>ve.createElement("div",{className:"edge"},ve.createElement(Mm,Object.assign({},n,{labels:c})),ve.createElement("div",{className:"body"},ve.createElement("div",{className:"render"},ve.createElement("span",{className:o?"dotted":"dash",style:{borderColor:t||"#000"}})," ",s&&ve.createElement("span",{className:"arrow",style:{borderTopColor:t||"#000"}})),ve.createElement("span",{className:`label ${o?"text-muted":""} ${e?"":"fst-italic"}`},e||c.no_label||"No label")),ve.createElement(Mm,Object.assign({},a,{labels:c}))),kU=({id:e,labels:t})=>{const n=Zn(),a=w.useMemo(()=>{const o=n.getGraph().getEdgeAttributes(e),s=n.getSetting("nodeReducer"),c=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)},o),c?c(e,o):{}),{source:Object.assign(Object.assign({color:n.getSetting("defaultNodeColor")},u),s?s(e,u):{}),target:Object.assign(Object.assign({color:n.getSetting("defaultNodeColor")},f),s?s(e,f):{})})},[n,e]);return ve.createElement(DU,Object.assign({},a,{labels:t}))};function sv(e,t){const[n,a]=w.useState(e);return w.useEffect(()=>{const o=setTimeout(()=>{a(e)},t);return()=>{clearTimeout(o)}},[e,t]),n}function NU({fetcher:e,preload:t,filterFn:n,renderOption:a,getOptionValue:o,notFound:s,loadingSkeleton:c,label:u,placeholder:f="Select...",value:h,onChange:m,onFocus:g,disabled:y=!1,className:b,noResultsMessage:S}){const[E,_]=w.useState(!1),[N,C]=w.useState(!1),[A,k]=w.useState([]),[D,M]=w.useState(!1),[R,U]=w.useState(null),[L,I]=w.useState(h),[q,Y]=w.useState(null),[B,X]=w.useState(""),ne=sv(B,t?0:150),[F,z]=w.useState([]);w.useEffect(()=>{_(!0),I(h)},[h]),w.useEffect(()=>{E||(async()=>{try{M(!0),U(null);const H=h!==null?await e(h):[];z(H),k(H)}catch(H){U(H instanceof Error?H.message:"Failed to fetch options")}finally{M(!1)}})()},[E,e,h]),w.useEffect(()=>{const G=async()=>{try{M(!0),U(null);const H=await e(ne);z(H),k(H)}catch(H){U(H instanceof Error?H.message:"Failed to fetch options")}finally{M(!1)}};E&&t?t&&k(ne?F.filter(H=>n?n(H,ne):!0):F):G()},[e,ne,E,t,n]);const j=w.useCallback(G=>{G!==L&&(I(G),m(G)),C(!1)},[L,I,C,m]),K=w.useCallback(G=>{G!==q&&(Y(G),g(G))},[q,Y,g]);return x.jsx("div",{className:Oe(y&&"cursor-not-allowed opacity-50",b),onFocus:()=>{C(!0)},onBlur:()=>C(!1),children:x.jsxs(wd,{shouldFilter:!1,className:"bg-transparent",children:[x.jsxs("div",{children:[x.jsx(nv,{placeholder:f,value:B,className:"max-h-8",onValueChange:G=>{X(G),G&&!N&&C(!0)}}),D&&A.length>0&&x.jsx("div",{className:"absolute top-1/2 right-2 flex -translate-y-1/2 transform items-center",children:x.jsx(BE,{className:"h-4 w-4 animate-spin"})})]}),x.jsxs(Ed,{hidden:!N||ne.length===0,children:[R&&x.jsx("div",{className:"text-destructive p-4 text-center",children:R}),D&&A.length===0&&(c||x.jsx(OU,{})),!D&&!R&&A.length===0&&(s||x.jsx(rv,{children:S??`No ${u.toLowerCase()} found.`})),x.jsx(Ko,{children:A.map((G,H)=>x.jsxs(x.Fragment,{children:[x.jsx(Zo,{value:o(G),onSelect:j,onMouseEnter:()=>K(o(G)),className:"truncate",children:a(G)},o(G)+`${H}`),H!==A.length-1&&x.jsx("div",{className:"bg-foreground/10 h-[1px]"},H)]}))})]})]})})}function OU(){return x.jsx(Ko,{children:x.jsx(Zo,{disabled:!0,children:x.jsxs("div",{className:"flex w-full items-center gap-2",children:[x.jsx("div",{className:"bg-muted h-6 w-6 animate-pulse rounded-full"}),x.jsxs("div",{className:"flex flex-1 flex-col gap-1",children:[x.jsx("div",{className:"bg-muted h-4 w-24 animate-pulse rounded"}),x.jsx("div",{className:"bg-muted h-3 w-16 animate-pulse rounded"})]})]})})})}function jU(e){return x.jsxs("div",{children:[e.type==="nodes"&&x.jsx(AU,{id:e.id}),e.type==="edges"&&x.jsx(kU,{id:e.id}),e.type==="message"&&x.jsx("div",{children:e.message})]})}const Yp="__message_item",ou={graph:null,searchEngine:null},LU=({onChange:e,onFocus:t,value:n})=>{const a=ct.use.sigmaGraph(),o=w.useMemo(()=>{if(ou.graph==a)return ou.searchEngine;if(!a||a.nodes().length==0)return;ou.graph=a;const c=new Ua({idField:"id",fields:["label"],searchOptions:{prefix:!0,fuzzy:.2,boost:{label:2}}}),u=a.nodes().map(f=>({id:f,label:a.getNodeAttribute(f,"label")}));return c.addAll(u),ou.searchEngine=c,c},[a]),s=w.useCallback(async c=>{if(t&&t(null),!c||!o)return[];const u=o.search(c).map(f=>({id:f.id,type:"nodes"}));return u.length<=Hh?u:[...u.slice(0,Hh),{type:"message",id:Yp,message:`And ${u.length-Hh} others`}]},[o,t]);return x.jsx(NU,{className:"bg-background/60 w-24 rounded-xl border-1 opacity-60 backdrop-blur-lg transition-all hover:w-fit hover:opacity-100",fetcher:s,renderOption:jU,getOptionValue:c=>c.id,value:n&&n.type!=="message"?n.id:null,onChange:c=>{c!==Yp&&e(c?{id:c,type:"nodes"}:null)},onFocus:c=>{c!==Yp&&t&&t(c?{id:c,type:"nodes"}:null)},label:"item",placeholder:"Search nodes..."})},zU=({...e})=>x.jsx(LU,{...e});function MU({fetcher:e,preload:t,filterFn:n,renderOption:a,getOptionValue:o,getDisplayValue:s,notFound:c,loadingSkeleton:u,label:f,placeholder:h="Select...",value:m,onChange:g,disabled:y=!1,className:b,triggerClassName:S,searchInputClassName:E,noResultsMessage:_,triggerTooltip:N,clearable:C=!0}){const[A,k]=w.useState(!1),[D,M]=w.useState(!1),[R,U]=w.useState([]),[L,I]=w.useState(!1),[q,Y]=w.useState(null),[B,X]=w.useState(m),[ne,F]=w.useState(null),[z,j]=w.useState(""),K=sv(z,t?0:150),[G,H]=w.useState([]);w.useEffect(()=>{k(!0),X(m)},[m]),w.useEffect(()=>{if(m&&R.length>0){const $=R.find(W=>o(W)===m);$&&F($)}},[m,R,o]),w.useEffect(()=>{A||(async()=>{try{I(!0),Y(null);const W=await e(m);H(W),U(W)}catch(W){Y(W instanceof Error?W.message:"Failed to fetch options")}finally{I(!1)}})()},[A,e,m]),w.useEffect(()=>{const $=async()=>{try{I(!0),Y(null);const W=await e(K);H(W),U(W)}catch(W){Y(W instanceof Error?W.message:"Failed to fetch options")}finally{I(!1)}};A&&t?t&&U(K?G.filter(W=>n?n(W,K):!0):G):$()},[e,K,A,t,n]);const O=w.useCallback($=>{const W=C&&$===B?"":$;X(W),F(R.find(re=>o(re)===W)||null),g(W),M(!1)},[B,g,C,R,o]);return x.jsxs(pd,{open:D,onOpenChange:M,children:[x.jsx(md,{asChild:!0,children:x.jsxs(wt,{variant:"outline",role:"combobox","aria-expanded":D,className:Oe("justify-between",y&&"cursor-not-allowed opacity-50",S),disabled:y,tooltip:N,side:"bottom",children:[ne?s(ne):h,x.jsx(NO,{className:"opacity-50",size:10})]})}),x.jsx(_l,{className:Oe("p-0",b),onCloseAutoFocus:$=>$.preventDefault(),children:x.jsxs(wd,{shouldFilter:!1,children:[x.jsxs("div",{className:"relative w-full border-b",children:[x.jsx(nv,{placeholder:`Search ${f.toLowerCase()}...`,value:z,onValueChange:$=>{j($)},className:E}),L&&R.length>0&&x.jsx("div",{className:"absolute top-1/2 right-2 flex -translate-y-1/2 transform items-center",children:x.jsx(BE,{className:"h-4 w-4 animate-spin"})})]}),x.jsxs(Ed,{children:[q&&x.jsx("div",{className:"text-destructive p-4 text-center",children:q}),L&&R.length===0&&(u||x.jsx(PU,{})),!L&&!q&&R.length===0&&(c||x.jsx(rv,{children:_??`No ${f.toLowerCase()} found.`})),x.jsx(Ko,{children:R.map($=>x.jsxs(Zo,{value:o($),onSelect:O,className:"truncate",children:[a($),x.jsx(ig,{className:Oe("ml-auto h-3 w-3",B===o($)?"opacity-100":"opacity-0")})]},o($)))})]})]})})]})}function PU(){return x.jsx(Ko,{children:x.jsx(Zo,{disabled:!0,children:x.jsxs("div",{className:"flex w-full items-center gap-2",children:[x.jsx("div",{className:"bg-muted h-6 w-6 animate-pulse rounded-full"}),x.jsxs("div",{className:"flex flex-1 flex-col gap-1",children:[x.jsx("div",{className:"bg-muted h-4 w-24 animate-pulse rounded"}),x.jsx("div",{className:"bg-muted h-3 w-16 animate-pulse rounded"})]})]})})})}const GU=()=>{const e=Ye.use.queryLabel(),[t,n]=w.useState({labels:[],searchEngine:null}),[a,o]=w.useState(!1),s=w.useCallback(async u=>{let f=t.labels,h=t.searchEngine;if(!a||!h){f=["*"].concat(await mO()),f.includes(Ye.getState().queryLabel)||Ye.getState().setQueryLabel(f[0]),h=new Ua({idField:"id",fields:["value"],searchOptions:{prefix:!0,fuzzy:.2,boost:{label:2}}});const m=f.map((g,y)=>({id:y,value:g}));h.addAll(m),n({labels:f,searchEngine:h}),o(!0)}return u?h.search(u).map(m=>f[m.id]):f},[t,a,n,o]),c=w.useCallback(u=>{Ye.getState().setQueryLabel(u)},[]);return x.jsx(MU,{className:"ml-2",triggerClassName:"max-h-8",searchInputClassName:"max-h-8",triggerTooltip:"Select query label",fetcher:s,renderOption:u=>x.jsx("div",{children:u}),getOptionValue:u=>u,getDisplayValue:u=>x.jsx("div",{children:u}),notFound:x.jsx("div",{className:"py-6 text-center text-sm",children:"No labels found"}),label:"Label",placeholder:"Search labels...",value:e!==null?e:"",onChange:c})},bn=({text:e,className:t,tooltipClassName:n,tooltip:a,side:o,onClick:s})=>a?x.jsx(h_,{delayDuration:200,children:x.jsxs(p_,{children:[x.jsx(m_,{asChild:!0,children:x.jsx("label",{className:Oe(t,s!==void 0?"cursor-pointer":void 0),onClick:s,children:e})}),x.jsx(jg,{side:o,className:n,children:a})]})}):x.jsx("label",{className:Oe(t,s!==void 0?"cursor-pointer":void 0),onClick:s,children:e}),FU=()=>{const{getNode:e,getEdge:t}=yT(),n=ct.use.selectedNode(),a=ct.use.focusedNode(),o=ct.use.selectedEdge(),s=ct.use.focusedEdge(),[c,u]=w.useState(null),[f,h]=w.useState(null);return w.useEffect(()=>{let m=null,g=null;a?(m="node",g=e(a)):n?(m="node",g=e(n)):s?(m="edge",g=t(s,!0)):o&&(m="edge",g=t(o,!0)),g?(m=="node"?u(UU(g)):u(BU(g)),h(m)):(u(null),h(null))},[a,n,s,o,u,h,e,t]),c?x.jsx("div",{className:"bg-background/80 max-w-xs rounded-lg border-2 p-2 text-xs backdrop-blur-lg",children:f=="node"?x.jsx(IU,{node:c}):x.jsx(HU,{edge:c})}):x.jsx(x.Fragment,{})},UU=e=>{const t=ct.getState(),n=[];if(t.sigmaGraph&&t.rawGraph)for(const a of t.sigmaGraph.edges(e.id)){const o=t.rawGraph.getEdge(a,!0);if(o){const s=e.id===o.source,c=s?o.target:o.source,u=t.rawGraph.getNode(c);u&&n.push({type:s?"Target":"Source",id:c,label:u.labels.join(", ")})}}return{...e,relationships:n}},BU=e=>{var o,s;const t=ct.getState(),n=(o=t.rawGraph)==null?void 0:o.getNode(e.source),a=(s=t.rawGraph)==null?void 0:s.getNode(e.target);return{...e,sourceNode:n,targetNode:a}},Er=({name:e,value:t,onClick:n,tooltip:a})=>x.jsxs("div",{className:"flex items-center gap-2",children:[x.jsx("label",{className:"text-primary/60 tracking-wide",children:e}),":",x.jsx(bn,{className:"hover:bg-primary/20 rounded p-1 text-ellipsis",tooltipClassName:"max-w-80",text:t,tooltip:a||t,side:"left",onClick:n})]}),IU=({node:e})=>x.jsxs("div",{className:"flex flex-col gap-2",children:[x.jsx("label",{className:"text-md pl-1 font-bold tracking-wide text-sky-300",children:"Node"}),x.jsxs("div",{className:"bg-primary/5 max-h-96 overflow-auto rounded p-1",children:[x.jsx(Er,{name:"Id",value:e.id}),x.jsx(Er,{name:"Labels",value:e.labels.join(", "),onClick:()=>{ct.getState().setSelectedNode(e.id,!0)}}),x.jsx(Er,{name:"Degree",value:e.degree})]}),x.jsx("label",{className:"text-md pl-1 font-bold tracking-wide text-yellow-400/90",children:"Properties"}),x.jsx("div",{className:"bg-primary/5 max-h-96 overflow-auto rounded p-1",children:Object.keys(e.properties).sort().map(t=>x.jsx(Er,{name:t,value:e.properties[t]},t))}),e.relationships.length>0&&x.jsxs(x.Fragment,{children:[x.jsx("label",{className:"text-md pl-1 font-bold tracking-wide text-teal-600/90",children:"Relationships"}),x.jsx("div",{className:"bg-primary/5 max-h-96 overflow-auto rounded p-1",children:e.relationships.map(({type:t,id:n,label:a})=>x.jsx(Er,{name:t,value:a,onClick:()=>{ct.getState().setSelectedNode(n,!0)}},n))})]})]}),HU=({edge:e})=>x.jsxs("div",{className:"flex flex-col gap-2",children:[x.jsx("label",{className:"text-md pl-1 font-bold tracking-wide text-teal-600",children:"Relationship"}),x.jsxs("div",{className:"bg-primary/5 max-h-96 overflow-auto rounded p-1",children:[x.jsx(Er,{name:"Id",value:e.id}),e.type&&x.jsx(Er,{name:"Type",value:e.type}),x.jsx(Er,{name:"Source",value:e.sourceNode?e.sourceNode.labels.join(", "):e.source,onClick:()=>{ct.getState().setSelectedNode(e.source,!0)}}),x.jsx(Er,{name:"Target",value:e.targetNode?e.targetNode.labels.join(", "):e.target,onClick:()=>{ct.getState().setSelectedNode(e.target,!0)}})]}),x.jsx("label",{className:"text-md pl-1 font-bold tracking-wide text-yellow-400/90",children:"Properties"}),x.jsx("div",{className:"bg-primary/5 max-h-96 overflow-auto rounded p-1",children:Object.keys(e.properties).sort().map(t=>x.jsx(Er,{name:t,value:e.properties[t]},t))})]}),w1={allowInvalidContainer:!0,defaultNodeType:"default",defaultEdgeType:"curvedArrow",renderEdgeLabels:!1,edgeProgramClasses:{arrow:kC,curvedArrow:h5,curvedNoArrow:f5},nodeProgramClasses:{default:X3,circel:Tl,point:S3},labelGridCellSize:60,labelRenderedSizeThreshold:12,enableEdgeEvents:!0,labelColor:{color:"#000",attribute:"labelColor"},edgeLabelColor:{color:"#000",attribute:"labelColor"},edgeLabelSize:8,labelSize:12},$U=()=>{const e=GC(),t=Zn(),[n,a]=w.useState(null);return w.useEffect(()=>{e({downNode:o=>{a(o.node),t.getGraph().setNodeAttribute(o.node,"highlighted",!0)},mousemovebody:o=>{if(!n)return;const s=t.viewportToGraph(o);t.getGraph().setNodeAttribute(n,"x",s.x),t.getGraph().setNodeAttribute(n,"y",s.y),o.preventSigmaDefault(),o.original.preventDefault(),o.original.stopPropagation()},mouseup:()=>{n&&(a(null),t.getGraph().removeNodeAttribute(n,"highlighted"))},mousedown:()=>{t.getCustomBBox()||t.setCustomBBox(t.getBBox())}})},[e,t,n]),null},VU=()=>{const[e,t]=w.useState(w1),n=ct.use.selectedNode(),a=ct.use.focusedNode(),o=ct.use.moveToSelectedNode(),s=Ye.use.showPropertyPanel(),c=Ye.use.showNodeSearchBar(),u=Ye.use.showNodeLabel(),f=Ye.use.enableEdgeEvents(),h=Ye.use.enableNodeDrag(),m=Ye.use.showEdgeLabel();w.useEffect(()=>{t({...w1,enableEdgeEvents:f,renderEdgeLabels:m,renderLabels:u})},[u,f,m]);const g=w.useCallback(E=>{E===null?ct.getState().setFocusedNode(null):E.type==="nodes"&&ct.getState().setFocusedNode(E.id)},[]),y=w.useCallback(E=>{E===null?ct.getState().setSelectedNode(null):E.type==="nodes"&&ct.getState().setSelectedNode(E.id,!0)},[]),b=w.useMemo(()=>a??n,[a,n]),S=w.useMemo(()=>n?{type:"nodes",id:n}:null,[n]);return x.jsxs(v3,{settings:e,className:"!bg-background !size-full overflow-hidden",children:[x.jsx(aU,{}),h&&x.jsx($U,{}),x.jsx(g5,{node:b,move:o}),x.jsxs("div",{className:"absolute top-2 left-2 flex items-start gap-2",children:[x.jsx(GU,{}),c&&x.jsx(zU,{value:S,onFocus:g,onChange:y})]}),x.jsxs("div",{className:"bg-background/60 absolute bottom-2 left-2 flex flex-col rounded-xl border-2 backdrop-blur-lg",children:[x.jsx(mU,{}),x.jsx(iU,{}),x.jsx(LF,{}),x.jsx(oU,{})]}),s&&x.jsx("div",{className:"absolute top-2 right-2",children:x.jsx(FU,{})})]})},LT=w.forwardRef(({className:e,...t},n)=>x.jsx("div",{className:"relative w-full overflow-auto",children:x.jsx("table",{ref:n,className:Oe("w-full caption-bottom text-sm",e),...t})}));LT.displayName="Table";const zT=w.forwardRef(({className:e,...t},n)=>x.jsx("thead",{ref:n,className:Oe("[&_tr]:border-b",e),...t}));zT.displayName="TableHeader";const MT=w.forwardRef(({className:e,...t},n)=>x.jsx("tbody",{ref:n,className:Oe("[&_tr:last-child]:border-0",e),...t}));MT.displayName="TableBody";const qU=w.forwardRef(({className:e,...t},n)=>x.jsx("tfoot",{ref:n,className:Oe("bg-muted/50 border-t font-medium [&>tr]:last:border-b-0",e),...t}));qU.displayName="TableFooter";const Pm=w.forwardRef(({className:e,...t},n)=>x.jsx("tr",{ref:n,className:Oe("hover:bg-muted/50 data-[state=selected]:bg-muted border-b transition-colors",e),...t}));Pm.displayName="TableRow";const Jr=w.forwardRef(({className:e,...t},n)=>x.jsx("th",{ref:n,className:Oe("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}));Jr.displayName="TableHead";const ea=w.forwardRef(({className:e,...t},n)=>x.jsx("td",{ref:n,className:Oe("p-2 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...t}));ea.displayName="TableCell";const YU=w.forwardRef(({className:e,...t},n)=>x.jsx("caption",{ref:n,className:Oe("text-muted-foreground mt-4 text-sm",e),...t}));YU.displayName="TableCaption";const hl=w.forwardRef(({className:e,...t},n)=>x.jsx("div",{ref:n,className:Oe("bg-card text-card-foreground rounded-xl border shadow",e),...t}));hl.displayName="Card";const Gu=w.forwardRef(({className:e,...t},n)=>x.jsx("div",{ref:n,className:Oe("flex flex-col space-y-1.5 p-6",e),...t}));Gu.displayName="CardHeader";const pl=w.forwardRef(({className:e,...t},n)=>x.jsx("div",{ref:n,className:Oe("leading-none font-semibold tracking-tight",e),...t}));pl.displayName="CardTitle";const Sd=w.forwardRef(({className:e,...t},n)=>x.jsx("div",{ref:n,className:Oe("text-muted-foreground text-sm",e),...t}));Sd.displayName="CardDescription";const Fu=w.forwardRef(({className:e,...t},n)=>x.jsx("div",{ref:n,className:Oe("p-6 pt-0",e),...t}));Fu.displayName="CardContent";const WU=w.forwardRef(({className:e,...t},n)=>x.jsx("div",{ref:n,className:Oe("flex items-center p-6 pt-0",e),...t}));WU.displayName="CardFooter";function XU({title:e,description:t,icon:n=GO,action:a,className:o,...s}){return x.jsxs(hl,{className:Oe("flex w-full flex-col items-center justify-center space-y-6 bg-transparent p-16",o),...s,children:[x.jsx("div",{className:"mr-4 shrink-0 rounded-full border border-dashed p-4",children:x.jsx(n,{className:"text-muted-foreground size-8","aria-hidden":"true"})}),x.jsxs("div",{className:"flex flex-col items-center gap-1.5 text-center",children:[x.jsx(pl,{children:e}),t?x.jsx(Sd,{children:t}):null]}),a||null]})}var Wp={exports:{}},Xp,E1;function KU(){if(E1)return Xp;E1=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return Xp=e,Xp}var Kp,S1;function ZU(){if(S1)return Kp;S1=1;var e=KU();function t(){}function n(){}return n.resetWarningCache=t,Kp=function(){function a(c,u,f,h,m,g){if(g!==e){var y=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 y.name="Invariant Violation",y}}a.isRequired=a;function o(){return a}var s={array:a,bigint:a,bool:a,func:a,number:a,object:a,string:a,symbol:a,any:a,arrayOf:o,element:a,elementType:a,instanceOf:o,node:a,objectOf:o,oneOf:o,oneOfType:o,shape:o,exact:o,checkPropTypes:n,resetWarningCache:t};return s.PropTypes=s,s},Kp}var _1;function QU(){return _1||(_1=1,Wp.exports=ZU()()),Wp.exports}var JU=QU();const gt=dn(JU),eB=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 Po(e,t,n){const a=tB(e),{webkitRelativePath:o}=e,s=typeof t=="string"?t:typeof o=="string"&&o.length>0?o:`./${e.name}`;return typeof a.path!="string"&&C1(a,"path",s),C1(a,"relativePath",s),a}function tB(e){const{name:t}=e;if(t&&t.lastIndexOf(".")!==-1&&!e.type){const a=t.split(".").pop().toLowerCase(),o=eB.get(a);o&&Object.defineProperty(e,"type",{value:o,writable:!1,configurable:!1,enumerable:!0})}return e}function C1(e,t,n){Object.defineProperty(e,t,{value:n,writable:!1,configurable:!1,enumerable:!0})}const nB=[".DS_Store","Thumbs.db"];function rB(e){return Oi(this,void 0,void 0,function*(){return Uu(e)&&aB(e.dataTransfer)?lB(e.dataTransfer,e.type):iB(e)?oB(e):Array.isArray(e)&&e.every(t=>"getFile"in t&&typeof t.getFile=="function")?sB(e):[]})}function aB(e){return Uu(e)}function iB(e){return Uu(e)&&Uu(e.target)}function Uu(e){return typeof e=="object"&&e!==null}function oB(e){return Gm(e.target.files).map(t=>Po(t))}function sB(e){return Oi(this,void 0,void 0,function*(){return(yield Promise.all(e.map(n=>n.getFile()))).map(n=>Po(n))})}function lB(e,t){return Oi(this,void 0,void 0,function*(){if(e.items){const n=Gm(e.items).filter(o=>o.kind==="file");if(t!=="drop")return n;const a=yield Promise.all(n.map(cB));return T1(PT(a))}return T1(Gm(e.files).map(n=>Po(n)))})}function T1(e){return e.filter(t=>nB.indexOf(t.name)===-1)}function Gm(e){if(e===null)return[];const t=[];for(let n=0;n[...t,...Array.isArray(n)?PT(n):[n]],[])}function R1(e,t){return Oi(this,void 0,void 0,function*(){var n;if(globalThis.isSecureContext&&typeof e.getAsFileSystemHandle=="function"){const s=yield e.getAsFileSystemHandle();if(s===null)throw new Error(`${e} is not a File`);if(s!==void 0){const c=yield s.getFile();return c.handle=s,Po(c)}}const a=e.getAsFile();if(!a)throw new Error(`${e} is not a File`);return Po(a,(n=t==null?void 0:t.fullPath)!==null&&n!==void 0?n:void 0)})}function uB(e){return Oi(this,void 0,void 0,function*(){return e.isDirectory?GT(e):dB(e)})}function GT(e){const t=e.createReader();return new Promise((n,a)=>{const o=[];function s(){t.readEntries(c=>Oi(this,void 0,void 0,function*(){if(c.length){const u=Promise.all(c.map(uB));o.push(u),s()}else try{const u=yield Promise.all(o);n(u)}catch(u){a(u)}}),c=>{a(c)})}s()})}function dB(e){return Oi(this,void 0,void 0,function*(){return new Promise((t,n)=>{e.file(a=>{const o=Po(a,e.fullPath);t(o)},a=>{n(a)})})})}var su={},A1;function fB(){return A1||(A1=1,su.__esModule=!0,su.default=function(e,t){if(e&&t){var n=Array.isArray(t)?t:t.split(",");if(n.length===0)return!0;var a=e.name||"",o=(e.type||"").toLowerCase(),s=o.replace(/\/.*$/,"");return n.some(function(c){var u=c.trim().toLowerCase();return u.charAt(0)==="."?a.toLowerCase().endsWith(u):u.endsWith("/*")?s===u.replace(/\/.*$/,""):o===u})}return!0}),su}var hB=fB();const Zp=dn(hB);function D1(e){return gB(e)||mB(e)||UT(e)||pB()}function pB(){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 mB(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function gB(e){if(Array.isArray(e))return Fm(e)}function k1(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,a)}return n}function N1(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,a=new Array(t);n0&&arguments[0]!==void 0?arguments[0]:"",n=t.split(","),a=n.length>1?"one of ".concat(n.join(", ")):n[0];return{code:wB,message:"File type must be ".concat(a)}},O1=function(t){return{code:EB,message:"File is larger than ".concat(t," ").concat(t===1?"byte":"bytes")}},j1=function(t){return{code:SB,message:"File is smaller than ".concat(t," ").concat(t===1?"byte":"bytes")}},TB={code:_B,message:"Too many files"};function BT(e,t){var n=e.type==="application/x-moz-file"||xB(e,t);return[n,n?null:CB(t)]}function IT(e,t,n){if(wi(e.size))if(wi(t)&&wi(n)){if(e.size>n)return[!1,O1(n)];if(e.sizen)return[!1,O1(n)]}return[!0,null]}function wi(e){return e!=null}function RB(e){var t=e.files,n=e.accept,a=e.minSize,o=e.maxSize,s=e.multiple,c=e.maxFiles,u=e.validator;return!s&&t.length>1||s&&c>=1&&t.length>c?!1:t.every(function(f){var h=BT(f,n),m=ml(h,1),g=m[0],y=IT(f,a,o),b=ml(y,1),S=b[0],E=u?u(f):null;return g&&S&&!E})}function Bu(e){return typeof e.isPropagationStopped=="function"?e.isPropagationStopped():typeof e.cancelBubble<"u"?e.cancelBubble:!1}function lu(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 L1(e){e.preventDefault()}function AB(e){return e.indexOf("MSIE")!==-1||e.indexOf("Trident/")!==-1}function DB(e){return e.indexOf("Edge/")!==-1}function kB(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:window.navigator.userAgent;return AB(e)||DB(e)}function xr(){for(var e=arguments.length,t=new Array(e),n=0;n1?o-1:0),c=1;ce.length)&&(t=e.length);for(var n=0,a=new Array(t);n=0)&&Object.prototype.propertyIsEnumerable.call(e,a)&&(n[a]=e[a])}return n}function YB(e,t){if(e==null)return{};var n={},a=Object.keys(e),o,s;for(s=0;s=0)&&(n[o]=e[o]);return n}var _d=w.forwardRef(function(e,t){var n=e.children,a=Iu(e,MB),o=WB(a),s=o.open,c=Iu(o,PB);return w.useImperativeHandle(t,function(){return{open:s}},[s]),ve.createElement(w.Fragment,null,n(_t(_t({},c),{},{open:s})))});_d.displayName="Dropzone";var qT={disabled:!1,getFilesFromEvent:rB,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};_d.defaultProps=qT;_d.propTypes={children:gt.func,accept:gt.objectOf(gt.arrayOf(gt.string)),multiple:gt.bool,preventDropOnDocument:gt.bool,noClick:gt.bool,noKeyboard:gt.bool,noDrag:gt.bool,noDragEventsBubbling:gt.bool,minSize:gt.number,maxSize:gt.number,maxFiles:gt.number,disabled:gt.bool,getFilesFromEvent:gt.func,onFileDialogCancel:gt.func,onFileDialogOpen:gt.func,useFsAccessApi:gt.bool,autoFocus:gt.bool,onDragEnter:gt.func,onDragLeave:gt.func,onDragOver:gt.func,onDrop:gt.func,onDropAccepted:gt.func,onDropRejected:gt.func,onError:gt.func,validator:gt.func};var Im={isFocused:!1,isFileDialogActive:!1,isDragActive:!1,isDragAccept:!1,isDragReject:!1,acceptedFiles:[],fileRejections:[]};function WB(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=_t(_t({},qT),e),n=t.accept,a=t.disabled,o=t.getFilesFromEvent,s=t.maxSize,c=t.minSize,u=t.multiple,f=t.maxFiles,h=t.onDragEnter,m=t.onDragLeave,g=t.onDragOver,y=t.onDrop,b=t.onDropAccepted,S=t.onDropRejected,E=t.onFileDialogCancel,_=t.onFileDialogOpen,N=t.useFsAccessApi,C=t.autoFocus,A=t.preventDropOnDocument,k=t.noClick,D=t.noKeyboard,M=t.noDrag,R=t.noDragEventsBubbling,U=t.onError,L=t.validator,I=w.useMemo(function(){return jB(n)},[n]),q=w.useMemo(function(){return OB(n)},[n]),Y=w.useMemo(function(){return typeof _=="function"?_:M1},[_]),B=w.useMemo(function(){return typeof E=="function"?E:M1},[E]),X=w.useRef(null),ne=w.useRef(null),F=w.useReducer(XB,Im),z=Qp(F,2),j=z[0],K=z[1],G=j.isFocused,H=j.isFileDialogActive,O=w.useRef(typeof window<"u"&&window.isSecureContext&&N&&NB()),$=function(){!O.current&&H&&setTimeout(function(){if(ne.current){var Ae=ne.current.files;Ae.length||(K({type:"closeDialog"}),B())}},300)};w.useEffect(function(){return window.addEventListener("focus",$,!1),function(){window.removeEventListener("focus",$,!1)}},[ne,H,B,O]);var W=w.useRef([]),re=function(Ae){X.current&&X.current.contains(Ae.target)||(Ae.preventDefault(),W.current=[])};w.useEffect(function(){return A&&(document.addEventListener("dragover",L1,!1),document.addEventListener("drop",re,!1)),function(){A&&(document.removeEventListener("dragover",L1),document.removeEventListener("drop",re))}},[X,A]),w.useEffect(function(){return!a&&C&&X.current&&X.current.focus(),function(){}},[X,C,a]);var de=w.useCallback(function(me){U?U(me):console.error(me)},[U]),ie=w.useCallback(function(me){me.preventDefault(),me.persist(),Ee(me),W.current=[].concat(UB(W.current),[me.target]),lu(me)&&Promise.resolve(o(me)).then(function(Ae){if(!(Bu(me)&&!R)){var je=Ae.length,He=je>0&&RB({files:Ae,accept:I,minSize:c,maxSize:s,multiple:u,maxFiles:f,validator:L}),it=je>0&&!He;K({isDragAccept:He,isDragReject:it,isDragActive:!0,type:"setDraggedFiles"}),h&&h(me)}}).catch(function(Ae){return de(Ae)})},[o,h,de,R,I,c,s,u,f,L]),oe=w.useCallback(function(me){me.preventDefault(),me.persist(),Ee(me);var Ae=lu(me);if(Ae&&me.dataTransfer)try{me.dataTransfer.dropEffect="copy"}catch{}return Ae&&g&&g(me),!1},[g,R]),Ce=w.useCallback(function(me){me.preventDefault(),me.persist(),Ee(me);var Ae=W.current.filter(function(He){return X.current&&X.current.contains(He)}),je=Ae.indexOf(me.target);je!==-1&&Ae.splice(je,1),W.current=Ae,!(Ae.length>0)&&(K({type:"setDraggedFiles",isDragActive:!1,isDragAccept:!1,isDragReject:!1}),lu(me)&&m&&m(me))},[X,m,R]),he=w.useCallback(function(me,Ae){var je=[],He=[];me.forEach(function(it){var Ct=BT(it,I),bt=Qp(Ct,2),qt=bt[0],fn=bt[1],Gt=IT(it,c,s),at=Qp(Gt,2),Tn=at[0],xt=at[1],Lt=L?L(it):null;if(qt&&Tn&&!Lt)je.push(it);else{var Wa=[fn,xt];Lt&&(Wa=Wa.concat(Lt)),He.push({file:it,errors:Wa.filter(function(ji){return ji})})}}),(!u&&je.length>1||u&&f>=1&&je.length>f)&&(je.forEach(function(it){He.push({file:it,errors:[TB]})}),je.splice(0)),K({acceptedFiles:je,fileRejections:He,isDragReject:He.length>0,type:"setFiles"}),y&&y(je,He,Ae),He.length>0&&S&&S(He,Ae),je.length>0&&b&&b(je,Ae)},[K,u,I,c,s,f,y,b,S,L]),Se=w.useCallback(function(me){me.preventDefault(),me.persist(),Ee(me),W.current=[],lu(me)&&Promise.resolve(o(me)).then(function(Ae){Bu(me)&&!R||he(Ae,me)}).catch(function(Ae){return de(Ae)}),K({type:"reset"})},[o,he,de,R]),be=w.useCallback(function(){if(O.current){K({type:"openDialog"}),Y();var me={multiple:u,types:q};window.showOpenFilePicker(me).then(function(Ae){return o(Ae)}).then(function(Ae){he(Ae,null),K({type:"closeDialog"})}).catch(function(Ae){LB(Ae)?(B(Ae),K({type:"closeDialog"})):zB(Ae)?(O.current=!1,ne.current?(ne.current.value=null,ne.current.click()):de(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."))):de(Ae)});return}ne.current&&(K({type:"openDialog"}),Y(),ne.current.value=null,ne.current.click())},[K,Y,B,N,he,de,q,u]),Le=w.useCallback(function(me){!X.current||!X.current.isEqualNode(me.target)||(me.key===" "||me.key==="Enter"||me.keyCode===32||me.keyCode===13)&&(me.preventDefault(),be())},[X,be]),Te=w.useCallback(function(){K({type:"focus"})},[]),ye=w.useCallback(function(){K({type:"blur"})},[]),J=w.useCallback(function(){k||(kB()?setTimeout(be,0):be())},[k,be]),le=function(Ae){return a?null:Ae},_e=function(Ae){return D?null:le(Ae)},pe=function(Ae){return M?null:le(Ae)},Ee=function(Ae){R&&Ae.stopPropagation()},te=w.useMemo(function(){return function(){var me=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},Ae=me.refKey,je=Ae===void 0?"ref":Ae,He=me.role,it=me.onKeyDown,Ct=me.onFocus,bt=me.onBlur,qt=me.onClick,fn=me.onDragEnter,Gt=me.onDragOver,at=me.onDragLeave,Tn=me.onDrop,xt=Iu(me,GB);return _t(_t(Bm({onKeyDown:_e(xr(it,Le)),onFocus:_e(xr(Ct,Te)),onBlur:_e(xr(bt,ye)),onClick:le(xr(qt,J)),onDragEnter:pe(xr(fn,ie)),onDragOver:pe(xr(Gt,oe)),onDragLeave:pe(xr(at,Ce)),onDrop:pe(xr(Tn,Se)),role:typeof He=="string"&&He!==""?He:"presentation"},je,X),!a&&!D?{tabIndex:0}:{}),xt)}},[X,Le,Te,ye,J,ie,oe,Ce,Se,D,M,a]),Fe=w.useCallback(function(me){me.stopPropagation()},[]),Pe=w.useMemo(function(){return function(){var me=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},Ae=me.refKey,je=Ae===void 0?"ref":Ae,He=me.onChange,it=me.onClick,Ct=Iu(me,FB),bt=Bm({accept:I,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:le(xr(He,Se)),onClick:le(xr(it,Fe)),tabIndex:-1},je,ne);return _t(_t({},bt),Ct)}},[ne,n,u,Se,a]);return _t(_t({},j),{},{isFocused:G&&!a,getRootProps:te,getInputProps:Pe,rootRef:X,inputRef:ne,open:le(be)})}function XB(e,t){switch(t.type){case"focus":return _t(_t({},e),{},{isFocused:!0});case"blur":return _t(_t({},e),{},{isFocused:!1});case"openDialog":return _t(_t({},Im),{},{isFileDialogActive:!0});case"closeDialog":return _t(_t({},e),{},{isFileDialogActive:!1});case"setDraggedFiles":return _t(_t({},e),{},{isDragActive:t.isDragActive,isDragAccept:t.isDragAccept,isDragReject:t.isDragReject});case"setFiles":return _t(_t({},e),{},{acceptedFiles:t.acceptedFiles,fileRejections:t.fileRejections,isDragReject:t.isDragReject});case"reset":return _t({},Im);default:return e}}function M1(){}var lv="Progress",cv=100,[KB,X6]=Kn(lv),[ZB,QB]=KB(lv),YT=w.forwardRef((e,t)=>{const{__scopeProgress:n,value:a=null,max:o,getValueLabel:s=JB,...c}=e;(o||o===0)&&!P1(o)&&console.error(eI(`${o}`,"Progress"));const u=P1(o)?o:cv;a!==null&&!G1(a,u)&&console.error(tI(`${a}`,"Progress"));const f=G1(a,u)?a:null,h=Hu(f)?s(f,u):void 0;return x.jsx(ZB,{scope:n,value:f,max:u,children:x.jsx(Ie.div,{"aria-valuemax":u,"aria-valuemin":0,"aria-valuenow":Hu(f)?f:void 0,"aria-valuetext":h,role:"progressbar","data-state":KT(f,u),"data-value":f??void 0,"data-max":u,...c,ref:t})})});YT.displayName=lv;var WT="ProgressIndicator",XT=w.forwardRef((e,t)=>{const{__scopeProgress:n,...a}=e,o=QB(WT,n);return x.jsx(Ie.div,{"data-state":KT(o.value,o.max),"data-value":o.value??void 0,"data-max":o.max,...a,ref:t})});XT.displayName=WT;function JB(e,t){return`${Math.round(e/t*100)}%`}function KT(e,t){return e==null?"indeterminate":e===t?"complete":"loading"}function Hu(e){return typeof e=="number"}function P1(e){return Hu(e)&&!isNaN(e)&&e>0}function G1(e,t){return Hu(e)&&!isNaN(e)&&e<=t&&e>=0}function eI(e,t){return`Invalid prop \`max\` of value \`${e}\` supplied to \`${t}\`. Only numbers greater than 0 are valid max values. Defaulting to \`${cv}\`.`}function tI(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 ${cv} if no \`max\` prop is set) + - \`null\` or \`undefined\` if the progress is indeterminate. + +Defaulting to \`null\`.`}var ZT=YT,nI=XT;const QT=w.forwardRef(({className:e,value:t,...n},a)=>x.jsx(ZT,{ref:a,className:Oe("bg-secondary relative h-4 w-full overflow-hidden rounded-full",e),...n,children:x.jsx(nI,{className:"bg-primary h-full w-full flex-1 transition-all",style:{transform:`translateX(-${100-(t||0)}%)`}})}));QT.displayName=ZT.displayName;function Hm(e,[t,n]){return Math.min(n,Math.max(t,e))}function rI(e,t){return w.useReducer((n,a)=>t[n][a]??n,e)}var uv="ScrollArea",[JT,K6]=Kn(uv),[aI,Qn]=JT(uv),eR=w.forwardRef((e,t)=>{const{__scopeScrollArea:n,type:a="hover",dir:o,scrollHideDelay:s=600,...c}=e,[u,f]=w.useState(null),[h,m]=w.useState(null),[g,y]=w.useState(null),[b,S]=w.useState(null),[E,_]=w.useState(null),[N,C]=w.useState(0),[A,k]=w.useState(0),[D,M]=w.useState(!1),[R,U]=w.useState(!1),L=nt(t,q=>f(q)),I=gd(o);return x.jsx(aI,{scope:n,type:a,dir:I,scrollHideDelay:s,scrollArea:u,viewport:h,onViewportChange:m,content:g,onContentChange:y,scrollbarX:b,onScrollbarXChange:S,scrollbarXEnabled:D,onScrollbarXEnabledChange:M,scrollbarY:E,onScrollbarYChange:_,scrollbarYEnabled:R,onScrollbarYEnabledChange:U,onCornerWidthChange:C,onCornerHeightChange:k,children:x.jsx(Ie.div,{dir:I,...c,ref:L,style:{position:"relative","--radix-scroll-area-corner-width":N+"px","--radix-scroll-area-corner-height":A+"px",...e.style}})})});eR.displayName=uv;var tR="ScrollAreaViewport",nR=w.forwardRef((e,t)=>{const{__scopeScrollArea:n,children:a,nonce:o,...s}=e,c=Qn(tR,n),u=w.useRef(null),f=nt(t,u,c.onViewportChange);return x.jsxs(x.Fragment,{children:[x.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:o}),x.jsx(Ie.div,{"data-radix-scroll-area-viewport":"",...s,ref:f,style:{overflowX:c.scrollbarXEnabled?"scroll":"hidden",overflowY:c.scrollbarYEnabled?"scroll":"hidden",...e.style},children:x.jsx("div",{ref:c.onContentChange,style:{minWidth:"100%",display:"table"},children:a})})]})});nR.displayName=tR;var kr="ScrollAreaScrollbar",dv=w.forwardRef((e,t)=>{const{forceMount:n,...a}=e,o=Qn(kr,e.__scopeScrollArea),{onScrollbarXEnabledChange:s,onScrollbarYEnabledChange:c}=o,u=e.orientation==="horizontal";return w.useEffect(()=>(u?s(!0):c(!0),()=>{u?s(!1):c(!1)}),[u,s,c]),o.type==="hover"?x.jsx(iI,{...a,ref:t,forceMount:n}):o.type==="scroll"?x.jsx(oI,{...a,ref:t,forceMount:n}):o.type==="auto"?x.jsx(rR,{...a,ref:t,forceMount:n}):o.type==="always"?x.jsx(fv,{...a,ref:t}):null});dv.displayName=kr;var iI=w.forwardRef((e,t)=>{const{forceMount:n,...a}=e,o=Qn(kr,e.__scopeScrollArea),[s,c]=w.useState(!1);return w.useEffect(()=>{const u=o.scrollArea;let f=0;if(u){const h=()=>{window.clearTimeout(f),c(!0)},m=()=>{f=window.setTimeout(()=>c(!1),o.scrollHideDelay)};return u.addEventListener("pointerenter",h),u.addEventListener("pointerleave",m),()=>{window.clearTimeout(f),u.removeEventListener("pointerenter",h),u.removeEventListener("pointerleave",m)}}},[o.scrollArea,o.scrollHideDelay]),x.jsx(zn,{present:n||s,children:x.jsx(rR,{"data-state":s?"visible":"hidden",...a,ref:t})})}),oI=w.forwardRef((e,t)=>{const{forceMount:n,...a}=e,o=Qn(kr,e.__scopeScrollArea),s=e.orientation==="horizontal",c=Td(()=>f("SCROLL_END"),100),[u,f]=rI("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 w.useEffect(()=>{if(u==="idle"){const h=window.setTimeout(()=>f("HIDE"),o.scrollHideDelay);return()=>window.clearTimeout(h)}},[u,o.scrollHideDelay,f]),w.useEffect(()=>{const h=o.viewport,m=s?"scrollLeft":"scrollTop";if(h){let g=h[m];const y=()=>{const b=h[m];g!==b&&(f("SCROLL"),c()),g=b};return h.addEventListener("scroll",y),()=>h.removeEventListener("scroll",y)}},[o.viewport,s,f,c]),x.jsx(zn,{present:n||u!=="hidden",children:x.jsx(fv,{"data-state":u==="hidden"?"hidden":"visible",...a,ref:t,onPointerEnter:Be(e.onPointerEnter,()=>f("POINTER_ENTER")),onPointerLeave:Be(e.onPointerLeave,()=>f("POINTER_LEAVE"))})})}),rR=w.forwardRef((e,t)=>{const n=Qn(kr,e.__scopeScrollArea),{forceMount:a,...o}=e,[s,c]=w.useState(!1),u=e.orientation==="horizontal",f=Td(()=>{if(n.viewport){const h=n.viewport.offsetWidth{const{orientation:n="vertical",...a}=e,o=Qn(kr,e.__scopeScrollArea),s=w.useRef(null),c=w.useRef(0),[u,f]=w.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),h=lR(u.viewport,u.content),m={...a,sizes:u,onSizesChange:f,hasThumb:h>0&&h<1,onThumbChange:y=>s.current=y,onThumbPointerUp:()=>c.current=0,onThumbPointerDown:y=>c.current=y};function g(y,b){return fI(y,c.current,u,b)}return n==="horizontal"?x.jsx(sI,{...m,ref:t,onThumbPositionChange:()=>{if(o.viewport&&s.current){const y=o.viewport.scrollLeft,b=F1(y,u,o.dir);s.current.style.transform=`translate3d(${b}px, 0, 0)`}},onWheelScroll:y=>{o.viewport&&(o.viewport.scrollLeft=y)},onDragScroll:y=>{o.viewport&&(o.viewport.scrollLeft=g(y,o.dir))}}):n==="vertical"?x.jsx(lI,{...m,ref:t,onThumbPositionChange:()=>{if(o.viewport&&s.current){const y=o.viewport.scrollTop,b=F1(y,u);s.current.style.transform=`translate3d(0, ${b}px, 0)`}},onWheelScroll:y=>{o.viewport&&(o.viewport.scrollTop=y)},onDragScroll:y=>{o.viewport&&(o.viewport.scrollTop=g(y))}}):null}),sI=w.forwardRef((e,t)=>{const{sizes:n,onSizesChange:a,...o}=e,s=Qn(kr,e.__scopeScrollArea),[c,u]=w.useState(),f=w.useRef(null),h=nt(t,f,s.onScrollbarXChange);return w.useEffect(()=>{f.current&&u(getComputedStyle(f.current))},[f]),x.jsx(iR,{"data-orientation":"horizontal",...o,ref:h,sizes:n,style:{bottom:0,left:s.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:s.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":Cd(n)+"px",...e.style},onThumbPointerDown:m=>e.onThumbPointerDown(m.x),onDragScroll:m=>e.onDragScroll(m.x),onWheelScroll:(m,g)=>{if(s.viewport){const y=s.viewport.scrollLeft+m.deltaX;e.onWheelScroll(y),uR(y,g)&&m.preventDefault()}},onResize:()=>{f.current&&s.viewport&&c&&a({content:s.viewport.scrollWidth,viewport:s.viewport.offsetWidth,scrollbar:{size:f.current.clientWidth,paddingStart:Vu(c.paddingLeft),paddingEnd:Vu(c.paddingRight)}})}})}),lI=w.forwardRef((e,t)=>{const{sizes:n,onSizesChange:a,...o}=e,s=Qn(kr,e.__scopeScrollArea),[c,u]=w.useState(),f=w.useRef(null),h=nt(t,f,s.onScrollbarYChange);return w.useEffect(()=>{f.current&&u(getComputedStyle(f.current))},[f]),x.jsx(iR,{"data-orientation":"vertical",...o,ref:h,sizes:n,style:{top:0,right:s.dir==="ltr"?0:void 0,left:s.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":Cd(n)+"px",...e.style},onThumbPointerDown:m=>e.onThumbPointerDown(m.y),onDragScroll:m=>e.onDragScroll(m.y),onWheelScroll:(m,g)=>{if(s.viewport){const y=s.viewport.scrollTop+m.deltaY;e.onWheelScroll(y),uR(y,g)&&m.preventDefault()}},onResize:()=>{f.current&&s.viewport&&c&&a({content:s.viewport.scrollHeight,viewport:s.viewport.offsetHeight,scrollbar:{size:f.current.clientHeight,paddingStart:Vu(c.paddingTop),paddingEnd:Vu(c.paddingBottom)}})}})}),[cI,aR]=JT(kr),iR=w.forwardRef((e,t)=>{const{__scopeScrollArea:n,sizes:a,hasThumb:o,onThumbChange:s,onThumbPointerUp:c,onThumbPointerDown:u,onThumbPositionChange:f,onDragScroll:h,onWheelScroll:m,onResize:g,...y}=e,b=Qn(kr,n),[S,E]=w.useState(null),_=nt(t,L=>E(L)),N=w.useRef(null),C=w.useRef(""),A=b.viewport,k=a.content-a.viewport,D=Zt(m),M=Zt(f),R=Td(g,10);function U(L){if(N.current){const I=L.clientX-N.current.left,q=L.clientY-N.current.top;h({x:I,y:q})}}return w.useEffect(()=>{const L=I=>{const q=I.target;(S==null?void 0:S.contains(q))&&D(I,k)};return document.addEventListener("wheel",L,{passive:!1}),()=>document.removeEventListener("wheel",L,{passive:!1})},[A,S,k,D]),w.useEffect(M,[a,M]),Go(S,R),Go(b.content,R),x.jsx(cI,{scope:n,scrollbar:S,hasThumb:o,onThumbChange:Zt(s),onThumbPointerUp:Zt(c),onThumbPositionChange:M,onThumbPointerDown:Zt(u),children:x.jsx(Ie.div,{...y,ref:_,style:{position:"absolute",...y.style},onPointerDown:Be(e.onPointerDown,L=>{L.button===0&&(L.target.setPointerCapture(L.pointerId),N.current=S.getBoundingClientRect(),C.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",b.viewport&&(b.viewport.style.scrollBehavior="auto"),U(L))}),onPointerMove:Be(e.onPointerMove,U),onPointerUp:Be(e.onPointerUp,L=>{const I=L.target;I.hasPointerCapture(L.pointerId)&&I.releasePointerCapture(L.pointerId),document.body.style.webkitUserSelect=C.current,b.viewport&&(b.viewport.style.scrollBehavior=""),N.current=null})})})}),$u="ScrollAreaThumb",oR=w.forwardRef((e,t)=>{const{forceMount:n,...a}=e,o=aR($u,e.__scopeScrollArea);return x.jsx(zn,{present:n||o.hasThumb,children:x.jsx(uI,{ref:t,...a})})}),uI=w.forwardRef((e,t)=>{const{__scopeScrollArea:n,style:a,...o}=e,s=Qn($u,n),c=aR($u,n),{onThumbPositionChange:u}=c,f=nt(t,g=>c.onThumbChange(g)),h=w.useRef(void 0),m=Td(()=>{h.current&&(h.current(),h.current=void 0)},100);return w.useEffect(()=>{const g=s.viewport;if(g){const y=()=>{if(m(),!h.current){const b=hI(g,u);h.current=b,u()}};return u(),g.addEventListener("scroll",y),()=>g.removeEventListener("scroll",y)}},[s.viewport,m,u]),x.jsx(Ie.div,{"data-state":c.hasThumb?"visible":"hidden",...o,ref:f,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...a},onPointerDownCapture:Be(e.onPointerDownCapture,g=>{const b=g.target.getBoundingClientRect(),S=g.clientX-b.left,E=g.clientY-b.top;c.onThumbPointerDown({x:S,y:E})}),onPointerUp:Be(e.onPointerUp,c.onThumbPointerUp)})});oR.displayName=$u;var hv="ScrollAreaCorner",sR=w.forwardRef((e,t)=>{const n=Qn(hv,e.__scopeScrollArea),a=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&a?x.jsx(dI,{...e,ref:t}):null});sR.displayName=hv;var dI=w.forwardRef((e,t)=>{const{__scopeScrollArea:n,...a}=e,o=Qn(hv,n),[s,c]=w.useState(0),[u,f]=w.useState(0),h=!!(s&&u);return Go(o.scrollbarX,()=>{var g;const m=((g=o.scrollbarX)==null?void 0:g.offsetHeight)||0;o.onCornerHeightChange(m),f(m)}),Go(o.scrollbarY,()=>{var g;const m=((g=o.scrollbarY)==null?void 0:g.offsetWidth)||0;o.onCornerWidthChange(m),c(m)}),h?x.jsx(Ie.div,{...a,ref:t,style:{width:s,height:u,position:"absolute",right:o.dir==="ltr"?0:void 0,left:o.dir==="rtl"?0:void 0,bottom:0,...e.style}}):null});function Vu(e){return e?parseInt(e,10):0}function lR(e,t){const n=e/t;return isNaN(n)?0:n}function Cd(e){const t=lR(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,a=(e.scrollbar.size-n)*t;return Math.max(a,18)}function fI(e,t,n,a="ltr"){const o=Cd(n),s=o/2,c=t||s,u=o-c,f=n.scrollbar.paddingStart+c,h=n.scrollbar.size-n.scrollbar.paddingEnd-u,m=n.content-n.viewport,g=a==="ltr"?[0,m]:[m*-1,0];return cR([f,h],g)(e)}function F1(e,t,n="ltr"){const a=Cd(t),o=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,s=t.scrollbar.size-o,c=t.content-t.viewport,u=s-a,f=n==="ltr"?[0,c]:[c*-1,0],h=Hm(e,f);return cR([0,c],[0,u])(h)}function cR(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const a=(t[1]-t[0])/(e[1]-e[0]);return t[0]+a*(n-e[0])}}function uR(e,t){return e>0&&e{})=>{let n={left:e.scrollLeft,top:e.scrollTop},a=0;return function o(){const s={left:e.scrollLeft,top:e.scrollTop},c=n.left!==s.left,u=n.top!==s.top;(c||u)&&t(),n=s,a=window.requestAnimationFrame(o)}(),()=>window.cancelAnimationFrame(a)};function Td(e,t){const n=Zt(e),a=w.useRef(0);return w.useEffect(()=>()=>window.clearTimeout(a.current),[]),w.useCallback(()=>{window.clearTimeout(a.current),a.current=window.setTimeout(n,t)},[n,t])}function Go(e,t){const n=Zt(t);sn(()=>{let a=0;if(e){const o=new ResizeObserver(()=>{cancelAnimationFrame(a),a=window.requestAnimationFrame(n)});return o.observe(e),()=>{window.cancelAnimationFrame(a),o.unobserve(e)}}},[e,n])}var dR=eR,pI=nR,mI=sR;const fR=w.forwardRef(({className:e,children:t,...n},a)=>x.jsxs(dR,{ref:a,className:Oe("relative overflow-hidden",e),...n,children:[x.jsx(pI,{className:"h-full w-full rounded-[inherit]",children:t}),x.jsx(hR,{}),x.jsx(mI,{})]}));fR.displayName=dR.displayName;const hR=w.forwardRef(({className:e,orientation:t="vertical",...n},a)=>x.jsx(dv,{ref:a,orientation:t,className:Oe("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:x.jsx(oR,{className:"bg-border relative flex-1 rounded-full"})}));hR.displayName=dv.displayName;function $m(e,t={}){const{decimals:n=0,sizeType:a="normal"}=t,o=["Bytes","KB","MB","GB","TB"],s=["Bytes","KiB","MiB","GiB","TiB"];if(e===0)return"0 Byte";const c=Math.floor(Math.log(e)/Math.log(1024));return`${(e/Math.pow(1024,c)).toFixed(n)} ${a==="accurate"?s[c]??"Bytes":o[c]??"Bytes"}`}function gI(e){const{value:t,onValueChange:n,onUpload:a,progresses:o,accept:s=jk,maxSize:c=1024*1024*200,maxFileCount:u=1,multiple:f=!1,disabled:h=!1,description:m,className:g,...y}=e,[b,S]=aa({prop:t,onChange:n}),E=w.useCallback((C,A)=>{if(!f&&u===1&&C.length>1){an.error("Cannot upload more than 1 file at a time");return}if(((b==null?void 0:b.length)??0)+C.length>u){an.error(`Cannot upload more than ${u} files`);return}const k=C.map(M=>Object.assign(M,{preview:URL.createObjectURL(M)})),D=b?[...b,...k]:k;if(S(D),A.length>0&&A.forEach(({file:M})=>{an.error(`File ${M.name} was rejected`)}),a&&D.length>0&&D.length<=u){const M=D.length>0?`${D.length} files`:"file";an.promise(a(D),{loading:`Uploading ${M}...`,success:()=>(S([]),`${M} uploaded`),error:`Failed to upload ${M}`})}},[b,u,f,a,S]);function _(C){if(!b)return;const A=b.filter((k,D)=>D!==C);S(A),n==null||n(A)}w.useEffect(()=>()=>{b&&b.forEach(C=>{pR(C)&&URL.revokeObjectURL(C.preview)})},[]);const N=h||((b==null?void 0:b.length)??0)>=u;return x.jsxs("div",{className:"relative flex flex-col gap-6 overflow-hidden",children:[x.jsx(_d,{onDrop:E,accept:s,maxSize:c,maxFiles:u,multiple:u>1||f,disabled:N,children:({getRootProps:C,getInputProps:A,isDragActive:k})=>x.jsxs("div",{...C(),className:Oe("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",k&&"border-muted-foreground/50",N&&"pointer-events-none opacity-60",g),...y,children:[x.jsx("input",{...A()}),k?x.jsxs("div",{className:"flex flex-col items-center justify-center gap-4 sm:px-5",children:[x.jsx("div",{className:"rounded-full border border-dashed p-3",children:x.jsx(um,{className:"text-muted-foreground size-7","aria-hidden":"true"})}),x.jsx("p",{className:"text-muted-foreground font-medium",children:"Drop the files here"})]}):x.jsxs("div",{className:"flex flex-col items-center justify-center gap-4 sm:px-5",children:[x.jsx("div",{className:"rounded-full border border-dashed p-3",children:x.jsx(um,{className:"text-muted-foreground size-7","aria-hidden":"true"})}),x.jsxs("div",{className:"flex flex-col gap-px",children:[x.jsx("p",{className:"text-muted-foreground font-medium",children:"Drag and drop files here, or click to select files"}),m?x.jsx("p",{className:"text-muted-foreground/70 text-sm",children:m}):x.jsxs("p",{className:"text-muted-foreground/70 text-sm",children:["You can upload",u>1?` ${u===1/0?"multiple":u} + files (up to ${$m(c)} each)`:` a file with ${$m(c)}`,"Supported formats: TXT, MD, DOC, PDF, PPTX"]})]})]})]})}),b!=null&&b.length?x.jsx(fR,{className:"h-fit w-full px-3",children:x.jsx("div",{className:"flex max-h-48 flex-col gap-4",children:b==null?void 0:b.map((C,A)=>x.jsx(vI,{file:C,onRemove:()=>_(A),progress:o==null?void 0:o[C.name]},A))})}):null]})}function vI({file:e,progress:t,onRemove:n}){return x.jsxs("div",{className:"relative flex items-center gap-2.5",children:[x.jsxs("div",{className:"flex flex-1 gap-2.5",children:[pR(e)?x.jsx(yI,{file:e}):null,x.jsxs("div",{className:"flex w-full flex-col gap-2",children:[x.jsxs("div",{className:"flex flex-col gap-px",children:[x.jsx("p",{className:"text-foreground/80 line-clamp-1 text-sm font-medium",children:e.name}),x.jsx("p",{className:"text-muted-foreground text-xs",children:$m(e.size)})]}),t?x.jsx(QT,{value:t}):null]})]}),x.jsx("div",{className:"flex items-center gap-2",children:x.jsxs(wt,{type:"button",variant:"outline",size:"icon",className:"size-7",onClick:n,children:[x.jsx(IE,{className:"size-4","aria-hidden":"true"}),x.jsx("span",{className:"sr-only",children:"Remove file"})]})})]})}function pR(e){return"preview"in e&&typeof e.preview=="string"}function yI({file:e}){return e.type.startsWith("image/")?x.jsx("div",{className:"aspect-square shrink-0 rounded-md object-cover"}):x.jsx(MO,{className:"text-muted-foreground size-10","aria-hidden":"true"})}function bI(){const[e,t]=w.useState(!1),[n,a]=w.useState(!1),[o,s]=w.useState({}),c=w.useCallback(async u=>{a(!0);try{await Promise.all(u.map(async f=>{try{const h=await wO(f,m=>{console.debug(`Uploading ${f.name}: ${m}%`),s(g=>({...g,[f.name]:m}))});h.status==="success"?an.success(`Upload Success: +${f.name} uploaded successfully`):an.error(`Upload Failed: +${f.name} +${h.message}`)}catch(h){an.error(`Upload Failed: +${f.name} +${Sr(h)}`)}}))}catch(f){an.error(`Upload Failed +`+Sr(f))}finally{a(!1)}},[a,s]);return x.jsxs(mT,{open:e,onOpenChange:u=>{n&&!u||t(u)},children:[x.jsx(gT,{asChild:!0,children:x.jsxs(wt,{variant:"default",side:"bottom",tooltip:"Upload documents",size:"sm",children:[x.jsx(um,{})," Upload"]})}),x.jsxs(Qg,{className:"sm:max-w-xl",onCloseAutoFocus:u=>u.preventDefault(),children:[x.jsxs(Jg,{children:[x.jsx(ev,{children:"Upload documents"}),x.jsx(tv,{children:"Drag and drop your documents here or click to browse."})]}),x.jsx(gI,{maxFileCount:1/0,maxSize:200*1024*1024,description:"supported types: TXT, MD, DOC, PDF, PPTX",onUpload:c,progresses:o,disabled:n})]})]})}function xI(){const[e,t]=w.useState(!1),n=w.useCallback(async()=>{try{const a=await EO();a.status==="success"?(an.success("Documents cleared successfully"),t(!1)):an.error(`Clear Documents Failed: +${a.message}`)}catch(a){an.error(`Clear Documents Failed: +`+Sr(a))}},[t]);return x.jsxs(mT,{open:e,onOpenChange:t,children:[x.jsx(gT,{asChild:!0,children:x.jsxs(wt,{variant:"outline",side:"bottom",tooltip:"Clear documents",size:"sm",children:[x.jsx(UE,{})," Clear"]})}),x.jsxs(Qg,{className:"sm:max-w-xl",onCloseAutoFocus:a=>a.preventDefault(),children:[x.jsxs(Jg,{children:[x.jsx(ev,{children:"Clear documents"}),x.jsx(tv,{children:"Do you really want to clear all documents?"})]}),x.jsx(wt,{variant:"destructive",onClick:n,children:"YES"})]})]})}function wI(){const e=En.use.health(),[t,n]=w.useState(null),a=w.useCallback(async()=>{try{const s=await vO();s&&s.statuses?n(s):n(null)}catch(s){an.error(`Failed to load documents +`+Sr(s))}},[n]);w.useEffect(()=>{a()},[]);const o=w.useCallback(async()=>{try{const{status:s}=await yO();an.message(s)}catch(s){an.error(`Failed to load documents +`+Sr(s))}},[]);return w.useEffect(()=>{const s=setInterval(async()=>{if(e)try{await a()}catch(c){an.error(`Failed to get scan progress +`+Sr(c))}},5e3);return()=>clearInterval(s)},[e,a]),x.jsxs(hl,{className:"!size-full !rounded-none !border-none",children:[x.jsx(Gu,{children:x.jsx(pl,{className:"text-lg",children:"Document Management"})}),x.jsxs(Fu,{className:"space-y-4",children:[x.jsxs("div",{className:"flex gap-2",children:[x.jsxs(wt,{variant:"outline",onClick:o,side:"bottom",tooltip:"Scan documents",size:"sm",children:[x.jsx(ij,{})," Scan"]}),x.jsx("div",{className:"flex-1"}),x.jsx(xI,{}),x.jsx(bI,{})]}),x.jsxs(hl,{children:[x.jsxs(Gu,{children:[x.jsx(pl,{children:"Uploaded documents"}),x.jsx(Sd,{children:"view the uploaded documents here"})]}),x.jsxs(Fu,{children:[!t&&x.jsx(XU,{title:"No documents uploaded",description:"upload documents to see them here"}),t&&x.jsxs(LT,{children:[x.jsx(zT,{children:x.jsxs(Pm,{children:[x.jsx(Jr,{children:"ID"}),x.jsx(Jr,{children:"Summary"}),x.jsx(Jr,{children:"Status"}),x.jsx(Jr,{children:"Length"}),x.jsx(Jr,{children:"Chunks"}),x.jsx(Jr,{children:"Created"}),x.jsx(Jr,{children:"Updated"}),x.jsx(Jr,{children:"Metadata"})]})}),x.jsx(MT,{className:"text-sm",children:Object.entries(t.statuses).map(([s,c])=>c.map(u=>x.jsxs(Pm,{children:[x.jsx(ea,{className:"truncate font-mono",children:u.id}),x.jsx(ea,{className:"max-w-xs min-w-24 truncate",children:x.jsx(bn,{text:u.content_summary,tooltip:u.content_summary,tooltipClassName:"max-w-none overflow-visible block"})}),x.jsxs(ea,{children:[s==="processed"&&x.jsx("span",{className:"text-green-600",children:"Completed"}),s==="processing"&&x.jsx("span",{className:"text-blue-600",children:"Processing"}),s==="pending"&&x.jsx("span",{className:"text-yellow-600",children:"Pending"}),s==="failed"&&x.jsx("span",{className:"text-red-600",children:"Failed"}),u.error&&x.jsx("span",{className:"ml-2 text-red-500",title:u.error,children:"⚠️"})]}),x.jsx(ea,{children:u.content_length??"-"}),x.jsx(ea,{children:u.chunks_count??"-"}),x.jsx(ea,{className:"truncate",children:new Date(u.created_at).toLocaleString()}),x.jsx(ea,{className:"truncate",children:new Date(u.updated_at).toLocaleString()}),x.jsx(ea,{className:"max-w-xs truncate",children:u.metadata?JSON.stringify(u.metadata):"-"})]},u.id)))})]})]})]})]})]})}function mR(e,t){var n={};for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&t.indexOf(a)<0&&(n[a]=e[a]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,a=Object.getOwnPropertySymbols(e);o=u?o=o+U1("0",c-u):o=(o.substring(0,c)||"0")+"."+o.substring(c),n+o}function B1(e,t,n){if(["","-"].indexOf(e)!==-1)return e;var a=(e.indexOf(".")!==-1||n)&&t,o=pv(e),s=o.beforeDecimal,c=o.afterDecimal,u=o.hasNegation,f=parseFloat("0."+(c||"0")),h=c.length<=t?"0."+c:f.toFixed(t),m=h.split("."),g=s;s&&Number(m[0])&&(g=s.split("").reverse().reduce(function(E,_,N){return E.length>N?(Number(E[0])+Number(_)).toString()+E.substring(1,E.length):_+E},m[0]));var y=yR(m[1]||"",t,n),b=u?"-":"",S=a?".":"";return""+b+g+S+y}function Ei(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 xR=EI(function(e,t){for(var n=0,a=0,o=e.length,s=t.length;e[n]===t[n]&&nn&&o-a>n;)a++;return{from:{start:n,end:o-a},to:{start:n,end:s-a}}}),AI=function(e,t){var n=Math.min(e.selectionStart,t);return{from:{start:n,end:e.selectionEnd},to:{start:n,end:t}}};function DI(e,t,n){return Math.min(Math.max(e,t),n)}function Jp(e){return Math.max(e.selectionStart,e.selectionEnd)}function kI(){return typeof navigator<"u"&&!(navigator.platform&&/iPhone|iPod/.test(navigator.platform))}function NI(e){return{from:{start:0,end:0},to:{start:0,end:e.length},lastValue:""}}function OI(e){var t=e.currentValue,n=e.formattedValue,a=e.currentValueIndex,o=e.formattedValueIndex;return t[a]===n[o]}function jI(e,t,n,a,o,s,c){c===void 0&&(c=OI);var u=o.findIndex(function(k){return k}),f=e.slice(0,u);!t&&!n.startsWith(f)&&(t=f,n=f+n,a=a+f.length);for(var h=n.length,m=e.length,g={},y=new Array(h),b=0;b0&&y[N]===-1;)N--;var A=N===-1||y[N]===-1?0:y[N]+1;return A>C?C:a-A=0&&!n[t];)t--;t===-1&&(t=n.indexOf(!0))}else{for(;t<=o&&!n[t];)t++;t>o&&(t=n.lastIndexOf(!0))}return t===-1&&(t=o),t}function LI(e){for(var t=Array.from({length:e.length+1}).map(function(){return!0}),n=0,a=t.length;nR.length-c.length||Mq||g>e.length-c.length)&&(I=g),e=e.substring(0,I),e=GI(A?"-"+e:e,o),e=(e.match(FI(S))||[]).join("");var Y=e.indexOf(S);e=e.replace(new RegExp(vR(S),"g"),function(z,j){return j===Y?".":""});var B=pv(e,o),X=B.beforeDecimal,ne=B.afterDecimal,F=B.addNegation;return h.end-h.startH?!1:G>=re.start&&G{const[E,_]=w.useState(y??a),N=w.useCallback(()=>{_(D=>D===void 0?e??1:Math.min(D+(e??1),s))},[e,s]),C=w.useCallback(()=>{_(D=>D===void 0?-(e??1):Math.max(D-(e??1),o))},[e,o]);w.useEffect(()=>{y!==void 0&&_(y)},[y]);const A=D=>{const M=D.floatValue===void 0?void 0:D.floatValue;_(M),c&&c(M)},k=()=>{E!==void 0&&(Es&&(_(s),S.current.value=String(s)))};return x.jsxs("div",{className:"relative flex",children:[x.jsx(VI,{value:E,onValueChange:A,thousandSeparator:t,decimalScale:f,fixedDecimalScale:u,allowNegative:o<0,valueIsNumericString:!0,onBlur:k,max:s,min:o,suffix:m,prefix:g,customInput:D=>x.jsx(Ai,{...D,className:Oe("w-full",h)}),placeholder:n,className:"[appearance:textfield] [&::-webkit-inner-spin-button]:appearance-none [&::-webkit-outer-spin-button]:appearance-none",getInputRef:S,...b}),x.jsxs("div",{className:"absolute top-0 right-0 bottom-0 flex flex-col",children:[x.jsx(wt,{"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:N,disabled:E===s,children:x.jsx(FE,{size:15})}),x.jsx(wt,{"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:C,disabled:E===o,children:x.jsx(og,{size:15})})]})]})});To.displayName="NumberInput";var qI=[" ","Enter","ArrowUp","ArrowDown"],YI=[" ","Enter"],Nl="Select",[Ad,Dd,WI]=j_(Nl),[Qo,Z6]=Kn(Nl,[WI,Vo]),kd=Vo(),[XI,qa]=Qo(Nl),[KI,ZI]=Qo(Nl),ER=e=>{const{__scopeSelect:t,children:n,open:a,defaultOpen:o,onOpenChange:s,value:c,defaultValue:u,onValueChange:f,dir:h,name:m,autoComplete:g,disabled:y,required:b,form:S}=e,E=kd(t),[_,N]=w.useState(null),[C,A]=w.useState(null),[k,D]=w.useState(!1),M=gd(h),[R=!1,U]=aa({prop:a,defaultProp:o,onChange:s}),[L,I]=aa({prop:c,defaultProp:u,onChange:f}),q=w.useRef(null),Y=_?S||!!_.closest("form"):!0,[B,X]=w.useState(new Set),ne=Array.from(B).map(F=>F.props.value).join(";");return x.jsx(Ag,{...E,children:x.jsxs(XI,{required:b,scope:t,trigger:_,onTriggerChange:N,valueNode:C,onValueNodeChange:A,valueNodeHasChildren:k,onValueNodeHasChildrenChange:D,contentId:on(),value:L,onValueChange:I,open:R,onOpenChange:U,dir:M,triggerPointerDownPosRef:q,disabled:y,children:[x.jsx(Ad.Provider,{scope:t,children:x.jsx(KI,{scope:e.__scopeSelect,onNativeOptionAdd:w.useCallback(F=>{X(z=>new Set(z).add(F))},[]),onNativeOptionRemove:w.useCallback(F=>{X(z=>{const j=new Set(z);return j.delete(F),j})},[]),children:n})}),Y?x.jsxs(WR,{"aria-hidden":!0,required:b,tabIndex:-1,name:m,autoComplete:g,value:L,onChange:F=>I(F.target.value),disabled:y,form:S,children:[L===void 0?x.jsx("option",{value:""}):null,Array.from(B)]},ne):null]})})};ER.displayName=Nl;var SR="SelectTrigger",_R=w.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:a=!1,...o}=e,s=kd(n),c=qa(SR,n),u=c.disabled||a,f=nt(t,c.onTriggerChange),h=Dd(n),m=w.useRef("touch"),[g,y,b]=XR(E=>{const _=h().filter(A=>!A.disabled),N=_.find(A=>A.value===c.value),C=KR(_,E,N);C!==void 0&&c.onValueChange(C.value)}),S=E=>{u||(c.onOpenChange(!0),b()),E&&(c.triggerPointerDownPosRef.current={x:Math.round(E.pageX),y:Math.round(E.pageY)})};return x.jsx(cd,{asChild:!0,...s,children:x.jsx(Ie.button,{type:"button",role:"combobox","aria-controls":c.contentId,"aria-expanded":c.open,"aria-required":c.required,"aria-autocomplete":"none",dir:c.dir,"data-state":c.open?"open":"closed",disabled:u,"data-disabled":u?"":void 0,"data-placeholder":YR(c.value)?"":void 0,...o,ref:f,onClick:Be(o.onClick,E=>{E.currentTarget.focus(),m.current!=="mouse"&&S(E)}),onPointerDown:Be(o.onPointerDown,E=>{m.current=E.pointerType;const _=E.target;_.hasPointerCapture(E.pointerId)&&_.releasePointerCapture(E.pointerId),E.button===0&&E.ctrlKey===!1&&E.pointerType==="mouse"&&(S(E),E.preventDefault())}),onKeyDown:Be(o.onKeyDown,E=>{const _=g.current!=="";!(E.ctrlKey||E.altKey||E.metaKey)&&E.key.length===1&&y(E.key),!(_&&E.key===" ")&&qI.includes(E.key)&&(S(),E.preventDefault())})})})});_R.displayName=SR;var CR="SelectValue",TR=w.forwardRef((e,t)=>{const{__scopeSelect:n,className:a,style:o,children:s,placeholder:c="",...u}=e,f=qa(CR,n),{onValueNodeHasChildrenChange:h}=f,m=s!==void 0,g=nt(t,f.onValueNodeChange);return sn(()=>{h(m)},[h,m]),x.jsx(Ie.span,{...u,ref:g,style:{pointerEvents:"none"},children:YR(f.value)?x.jsx(x.Fragment,{children:c}):s})});TR.displayName=CR;var QI="SelectIcon",RR=w.forwardRef((e,t)=>{const{__scopeSelect:n,children:a,...o}=e;return x.jsx(Ie.span,{"aria-hidden":!0,...o,ref:t,children:a||"▼"})});RR.displayName=QI;var JI="SelectPortal",AR=e=>x.jsx(td,{asChild:!0,...e});AR.displayName=JI;var Ni="SelectContent",DR=w.forwardRef((e,t)=>{const n=qa(Ni,e.__scopeSelect),[a,o]=w.useState();if(sn(()=>{o(new DocumentFragment)},[]),!n.open){const s=a;return s?xl.createPortal(x.jsx(kR,{scope:e.__scopeSelect,children:x.jsx(Ad.Slot,{scope:e.__scopeSelect,children:x.jsx("div",{children:e.children})})}),s):null}return x.jsx(NR,{...e,ref:t})});DR.displayName=Ni;var sr=10,[kR,Ya]=Qo(Ni),e6="SelectContentImpl",NR=w.forwardRef((e,t)=>{const{__scopeSelect:n,position:a="item-aligned",onCloseAutoFocus:o,onEscapeKeyDown:s,onPointerDownOutside:c,side:u,sideOffset:f,align:h,alignOffset:m,arrowPadding:g,collisionBoundary:y,collisionPadding:b,sticky:S,hideWhenDetached:E,avoidCollisions:_,...N}=e,C=qa(Ni,n),[A,k]=w.useState(null),[D,M]=w.useState(null),R=nt(t,ie=>k(ie)),[U,L]=w.useState(null),[I,q]=w.useState(null),Y=Dd(n),[B,X]=w.useState(!1),ne=w.useRef(!1);w.useEffect(()=>{if(A)return cg(A)},[A]),lg();const F=w.useCallback(ie=>{const[oe,...Ce]=Y().map(be=>be.ref.current),[he]=Ce.slice(-1),Se=document.activeElement;for(const be of ie)if(be===Se||(be==null||be.scrollIntoView({block:"nearest"}),be===oe&&D&&(D.scrollTop=0),be===he&&D&&(D.scrollTop=D.scrollHeight),be==null||be.focus(),document.activeElement!==Se))return},[Y,D]),z=w.useCallback(()=>F([U,A]),[F,U,A]);w.useEffect(()=>{B&&z()},[B,z]);const{onOpenChange:j,triggerPointerDownPosRef:K}=C;w.useEffect(()=>{if(A){let ie={x:0,y:0};const oe=he=>{var Se,be;ie={x:Math.abs(Math.round(he.pageX)-(((Se=K.current)==null?void 0:Se.x)??0)),y:Math.abs(Math.round(he.pageY)-(((be=K.current)==null?void 0:be.y)??0))}},Ce=he=>{ie.x<=10&&ie.y<=10?he.preventDefault():A.contains(he.target)||j(!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})}}},[A,j,K]),w.useEffect(()=>{const ie=()=>j(!1);return window.addEventListener("blur",ie),window.addEventListener("resize",ie),()=>{window.removeEventListener("blur",ie),window.removeEventListener("resize",ie)}},[j]);const[G,H]=XR(ie=>{const oe=Y().filter(Se=>!Se.disabled),Ce=oe.find(Se=>Se.ref.current===document.activeElement),he=KR(oe,ie,Ce);he&&setTimeout(()=>he.ref.current.focus())}),O=w.useCallback((ie,oe,Ce)=>{const he=!ne.current&&!Ce;(C.value!==void 0&&C.value===oe||he)&&(L(ie),he&&(ne.current=!0))},[C.value]),$=w.useCallback(()=>A==null?void 0:A.focus(),[A]),W=w.useCallback((ie,oe,Ce)=>{const he=!ne.current&&!Ce;(C.value!==void 0&&C.value===oe||he)&&q(ie)},[C.value]),re=a==="popper"?Vm:OR,de=re===Vm?{side:u,sideOffset:f,align:h,alignOffset:m,arrowPadding:g,collisionBoundary:y,collisionPadding:b,sticky:S,hideWhenDetached:E,avoidCollisions:_}:{};return x.jsx(kR,{scope:n,content:A,viewport:D,onViewportChange:M,itemRefCallback:O,selectedItem:U,onItemLeave:$,itemTextRefCallback:W,focusSelectedItem:z,selectedItemText:I,position:a,isPositioned:B,searchRef:G,children:x.jsx(rd,{as:Ba,allowPinchZoom:!0,children:x.jsx(ed,{asChild:!0,trapped:C.open,onMountAutoFocus:ie=>{ie.preventDefault()},onUnmountAutoFocus:Be(o,ie=>{var oe;(oe=C.trigger)==null||oe.focus({preventScroll:!0}),ie.preventDefault()}),children:x.jsx(wl,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:ie=>ie.preventDefault(),onDismiss:()=>C.onOpenChange(!1),children:x.jsx(re,{role:"listbox",id:C.contentId,"data-state":C.open?"open":"closed",dir:C.dir,onContextMenu:ie=>ie.preventDefault(),...N,...de,onPlaced:()=>X(!0),ref:R,style:{display:"flex",flexDirection:"column",outline:"none",...N.style},onKeyDown:Be(N.onKeyDown,ie=>{const oe=ie.ctrlKey||ie.altKey||ie.metaKey;if(ie.key==="Tab"&&ie.preventDefault(),!oe&&ie.key.length===1&&H(ie.key),["ArrowUp","ArrowDown","Home","End"].includes(ie.key)){let he=Y().filter(Se=>!Se.disabled).map(Se=>Se.ref.current);if(["ArrowUp","End"].includes(ie.key)&&(he=he.slice().reverse()),["ArrowUp","ArrowDown"].includes(ie.key)){const Se=ie.target,be=he.indexOf(Se);he=he.slice(be+1)}setTimeout(()=>F(he)),ie.preventDefault()}})})})})})})});NR.displayName=e6;var t6="SelectItemAlignedPosition",OR=w.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:a,...o}=e,s=qa(Ni,n),c=Ya(Ni,n),[u,f]=w.useState(null),[h,m]=w.useState(null),g=nt(t,R=>m(R)),y=Dd(n),b=w.useRef(!1),S=w.useRef(!0),{viewport:E,selectedItem:_,selectedItemText:N,focusSelectedItem:C}=c,A=w.useCallback(()=>{if(s.trigger&&s.valueNode&&u&&h&&E&&_&&N){const R=s.trigger.getBoundingClientRect(),U=h.getBoundingClientRect(),L=s.valueNode.getBoundingClientRect(),I=N.getBoundingClientRect();if(s.dir!=="rtl"){const Se=I.left-U.left,be=L.left-Se,Le=R.left-be,Te=R.width+Le,ye=Math.max(Te,U.width),J=window.innerWidth-sr,le=Hm(be,[sr,Math.max(sr,J-ye)]);u.style.minWidth=Te+"px",u.style.left=le+"px"}else{const Se=U.right-I.right,be=window.innerWidth-L.right-Se,Le=window.innerWidth-R.right-be,Te=R.width+Le,ye=Math.max(Te,U.width),J=window.innerWidth-sr,le=Hm(be,[sr,Math.max(sr,J-ye)]);u.style.minWidth=Te+"px",u.style.right=le+"px"}const q=y(),Y=window.innerHeight-sr*2,B=E.scrollHeight,X=window.getComputedStyle(h),ne=parseInt(X.borderTopWidth,10),F=parseInt(X.paddingTop,10),z=parseInt(X.borderBottomWidth,10),j=parseInt(X.paddingBottom,10),K=ne+F+B+j+z,G=Math.min(_.offsetHeight*5,K),H=window.getComputedStyle(E),O=parseInt(H.paddingTop,10),$=parseInt(H.paddingBottom,10),W=R.top+R.height/2-sr,re=Y-W,de=_.offsetHeight/2,ie=_.offsetTop+de,oe=ne+F+ie,Ce=K-oe;if(oe<=W){const Se=q.length>0&&_===q[q.length-1].ref.current;u.style.bottom="0px";const be=h.clientHeight-E.offsetTop-E.offsetHeight,Le=Math.max(re,de+(Se?$:0)+be+z),Te=oe+Le;u.style.height=Te+"px"}else{const Se=q.length>0&&_===q[0].ref.current;u.style.top="0px";const Le=Math.max(W,ne+E.offsetTop+(Se?O:0)+de)+Ce;u.style.height=Le+"px",E.scrollTop=oe-W+E.offsetTop}u.style.margin=`${sr}px 0`,u.style.minHeight=G+"px",u.style.maxHeight=Y+"px",a==null||a(),requestAnimationFrame(()=>b.current=!0)}},[y,s.trigger,s.valueNode,u,h,E,_,N,s.dir,a]);sn(()=>A(),[A]);const[k,D]=w.useState();sn(()=>{h&&D(window.getComputedStyle(h).zIndex)},[h]);const M=w.useCallback(R=>{R&&S.current===!0&&(A(),C==null||C(),S.current=!1)},[A,C]);return x.jsx(r6,{scope:n,contentWrapper:u,shouldExpandOnScrollRef:b,onScrollButtonChange:M,children:x.jsx("div",{ref:f,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:k},children:x.jsx(Ie.div,{...o,ref:g,style:{boxSizing:"border-box",maxHeight:"100%",...o.style}})})})});OR.displayName=t6;var n6="SelectPopperPosition",Vm=w.forwardRef((e,t)=>{const{__scopeSelect:n,align:a="start",collisionPadding:o=sr,...s}=e,c=kd(n);return x.jsx(Dg,{...c,...s,ref:t,align:a,collisionPadding:o,style:{boxSizing:"border-box",...s.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)"}})});Vm.displayName=n6;var[r6,mv]=Qo(Ni,{}),qm="SelectViewport",jR=w.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:a,...o}=e,s=Ya(qm,n),c=mv(qm,n),u=nt(t,s.onViewportChange),f=w.useRef(0);return x.jsxs(x.Fragment,{children:[x.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:a}),x.jsx(Ad.Slot,{scope:n,children:x.jsx(Ie.div,{"data-radix-select-viewport":"",role:"presentation",...o,ref:u,style:{position:"relative",flex:1,overflow:"hidden auto",...o.style},onScroll:Be(o.onScroll,h=>{const m=h.currentTarget,{contentWrapper:g,shouldExpandOnScrollRef:y}=c;if(y!=null&&y.current&&g){const b=Math.abs(f.current-m.scrollTop);if(b>0){const S=window.innerHeight-sr*2,E=parseFloat(g.style.minHeight),_=parseFloat(g.style.height),N=Math.max(E,_);if(N0?k:0,g.style.justifyContent="flex-end")}}}f.current=m.scrollTop})})})]})});jR.displayName=qm;var LR="SelectGroup",[a6,i6]=Qo(LR),zR=w.forwardRef((e,t)=>{const{__scopeSelect:n,...a}=e,o=on();return x.jsx(a6,{scope:n,id:o,children:x.jsx(Ie.div,{role:"group","aria-labelledby":o,...a,ref:t})})});zR.displayName=LR;var MR="SelectLabel",PR=w.forwardRef((e,t)=>{const{__scopeSelect:n,...a}=e,o=i6(MR,n);return x.jsx(Ie.div,{id:o.id,...a,ref:t})});PR.displayName=MR;var qu="SelectItem",[o6,GR]=Qo(qu),FR=w.forwardRef((e,t)=>{const{__scopeSelect:n,value:a,disabled:o=!1,textValue:s,...c}=e,u=qa(qu,n),f=Ya(qu,n),h=u.value===a,[m,g]=w.useState(s??""),[y,b]=w.useState(!1),S=nt(t,C=>{var A;return(A=f.itemRefCallback)==null?void 0:A.call(f,C,a,o)}),E=on(),_=w.useRef("touch"),N=()=>{o||(u.onValueChange(a),u.onOpenChange(!1))};if(a==="")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 x.jsx(o6,{scope:n,value:a,disabled:o,textId:E,isSelected:h,onItemTextChange:w.useCallback(C=>{g(A=>A||((C==null?void 0:C.textContent)??"").trim())},[]),children:x.jsx(Ad.ItemSlot,{scope:n,value:a,disabled:o,textValue:m,children:x.jsx(Ie.div,{role:"option","aria-labelledby":E,"data-highlighted":y?"":void 0,"aria-selected":h&&y,"data-state":h?"checked":"unchecked","aria-disabled":o||void 0,"data-disabled":o?"":void 0,tabIndex:o?void 0:-1,...c,ref:S,onFocus:Be(c.onFocus,()=>b(!0)),onBlur:Be(c.onBlur,()=>b(!1)),onClick:Be(c.onClick,()=>{_.current!=="mouse"&&N()}),onPointerUp:Be(c.onPointerUp,()=>{_.current==="mouse"&&N()}),onPointerDown:Be(c.onPointerDown,C=>{_.current=C.pointerType}),onPointerMove:Be(c.onPointerMove,C=>{var A;_.current=C.pointerType,o?(A=f.onItemLeave)==null||A.call(f):_.current==="mouse"&&C.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Be(c.onPointerLeave,C=>{var A;C.currentTarget===document.activeElement&&((A=f.onItemLeave)==null||A.call(f))}),onKeyDown:Be(c.onKeyDown,C=>{var k;((k=f.searchRef)==null?void 0:k.current)!==""&&C.key===" "||(YI.includes(C.key)&&N(),C.key===" "&&C.preventDefault())})})})})});FR.displayName=qu;var il="SelectItemText",UR=w.forwardRef((e,t)=>{const{__scopeSelect:n,className:a,style:o,...s}=e,c=qa(il,n),u=Ya(il,n),f=GR(il,n),h=ZI(il,n),[m,g]=w.useState(null),y=nt(t,N=>g(N),f.onItemTextChange,N=>{var C;return(C=u.itemTextRefCallback)==null?void 0:C.call(u,N,f.value,f.disabled)}),b=m==null?void 0:m.textContent,S=w.useMemo(()=>x.jsx("option",{value:f.value,disabled:f.disabled,children:b},f.value),[f.disabled,f.value,b]),{onNativeOptionAdd:E,onNativeOptionRemove:_}=h;return sn(()=>(E(S),()=>_(S)),[E,_,S]),x.jsxs(x.Fragment,{children:[x.jsx(Ie.span,{id:f.textId,...s,ref:y}),f.isSelected&&c.valueNode&&!c.valueNodeHasChildren?xl.createPortal(s.children,c.valueNode):null]})});UR.displayName=il;var BR="SelectItemIndicator",IR=w.forwardRef((e,t)=>{const{__scopeSelect:n,...a}=e;return GR(BR,n).isSelected?x.jsx(Ie.span,{"aria-hidden":!0,...a,ref:t}):null});IR.displayName=BR;var Ym="SelectScrollUpButton",HR=w.forwardRef((e,t)=>{const n=Ya(Ym,e.__scopeSelect),a=mv(Ym,e.__scopeSelect),[o,s]=w.useState(!1),c=nt(t,a.onScrollButtonChange);return sn(()=>{if(n.viewport&&n.isPositioned){let u=function(){const h=f.scrollTop>0;s(h)};const f=n.viewport;return u(),f.addEventListener("scroll",u),()=>f.removeEventListener("scroll",u)}},[n.viewport,n.isPositioned]),o?x.jsx(VR,{...e,ref:c,onAutoScroll:()=>{const{viewport:u,selectedItem:f}=n;u&&f&&(u.scrollTop=u.scrollTop-f.offsetHeight)}}):null});HR.displayName=Ym;var Wm="SelectScrollDownButton",$R=w.forwardRef((e,t)=>{const n=Ya(Wm,e.__scopeSelect),a=mv(Wm,e.__scopeSelect),[o,s]=w.useState(!1),c=nt(t,a.onScrollButtonChange);return sn(()=>{if(n.viewport&&n.isPositioned){let u=function(){const h=f.scrollHeight-f.clientHeight,m=Math.ceil(f.scrollTop)f.removeEventListener("scroll",u)}},[n.viewport,n.isPositioned]),o?x.jsx(VR,{...e,ref:c,onAutoScroll:()=>{const{viewport:u,selectedItem:f}=n;u&&f&&(u.scrollTop=u.scrollTop+f.offsetHeight)}}):null});$R.displayName=Wm;var VR=w.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:a,...o}=e,s=Ya("SelectScrollButton",n),c=w.useRef(null),u=Dd(n),f=w.useCallback(()=>{c.current!==null&&(window.clearInterval(c.current),c.current=null)},[]);return w.useEffect(()=>()=>f(),[f]),sn(()=>{var m;const h=u().find(g=>g.ref.current===document.activeElement);(m=h==null?void 0:h.ref.current)==null||m.scrollIntoView({block:"nearest"})},[u]),x.jsx(Ie.div,{"aria-hidden":!0,...o,ref:t,style:{flexShrink:0,...o.style},onPointerDown:Be(o.onPointerDown,()=>{c.current===null&&(c.current=window.setInterval(a,50))}),onPointerMove:Be(o.onPointerMove,()=>{var h;(h=s.onItemLeave)==null||h.call(s),c.current===null&&(c.current=window.setInterval(a,50))}),onPointerLeave:Be(o.onPointerLeave,()=>{f()})})}),s6="SelectSeparator",qR=w.forwardRef((e,t)=>{const{__scopeSelect:n,...a}=e;return x.jsx(Ie.div,{"aria-hidden":!0,...a,ref:t})});qR.displayName=s6;var Xm="SelectArrow",l6=w.forwardRef((e,t)=>{const{__scopeSelect:n,...a}=e,o=kd(n),s=qa(Xm,n),c=Ya(Xm,n);return s.open&&c.position==="popper"?x.jsx(kg,{...o,...a,ref:t}):null});l6.displayName=Xm;function YR(e){return e===""||e===void 0}var WR=w.forwardRef((e,t)=>{const{value:n,...a}=e,o=w.useRef(null),s=nt(t,o),c=bT(n);return w.useEffect(()=>{const u=o.current,f=window.HTMLSelectElement.prototype,m=Object.getOwnPropertyDescriptor(f,"value").set;if(c!==n&&m){const g=new Event("change",{bubbles:!0});m.call(u,n),u.dispatchEvent(g)}},[c,n]),x.jsx(Ng,{asChild:!0,children:x.jsx("select",{...a,ref:s,defaultValue:n})})});WR.displayName="BubbleSelect";function XR(e){const t=Zt(e),n=w.useRef(""),a=w.useRef(0),o=w.useCallback(c=>{const u=n.current+c;t(u),function f(h){n.current=h,window.clearTimeout(a.current),h!==""&&(a.current=window.setTimeout(()=>f(""),1e3))}(u)},[t]),s=w.useCallback(()=>{n.current="",window.clearTimeout(a.current)},[]);return w.useEffect(()=>()=>window.clearTimeout(a.current),[]),[n,o,s]}function KR(e,t,n){const o=t.length>1&&Array.from(t).every(h=>h===t[0])?t[0]:t,s=n?e.indexOf(n):-1;let c=c6(e,Math.max(s,0));o.length===1&&(c=c.filter(h=>h!==n));const f=c.find(h=>h.textValue.toLowerCase().startsWith(o.toLowerCase()));return f!==n?f:void 0}function c6(e,t){return e.map((n,a)=>e[(t+a)%e.length])}var u6=ER,ZR=_R,d6=TR,f6=RR,h6=AR,QR=DR,p6=jR,m6=zR,JR=PR,eA=FR,g6=UR,v6=IR,tA=HR,nA=$R,rA=qR;const $1=u6,V1=m6,q1=d6,Km=w.forwardRef(({className:e,children:t,...n},a)=>x.jsxs(ZR,{ref:a,className:Oe("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,x.jsx(f6,{asChild:!0,children:x.jsx(og,{className:"h-4 w-4 opacity-50"})})]}));Km.displayName=ZR.displayName;const aA=w.forwardRef(({className:e,...t},n)=>x.jsx(tA,{ref:n,className:Oe("flex cursor-default items-center justify-center py-1",e),...t,children:x.jsx(FE,{className:"h-4 w-4"})}));aA.displayName=tA.displayName;const iA=w.forwardRef(({className:e,...t},n)=>x.jsx(nA,{ref:n,className:Oe("flex cursor-default items-center justify-center py-1",e),...t,children:x.jsx(og,{className:"h-4 w-4"})}));iA.displayName=nA.displayName;const Zm=w.forwardRef(({className:e,children:t,position:n="popper",...a},o)=>x.jsx(h6,{children:x.jsxs(QR,{ref:o,className:Oe("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,...a,children:[x.jsx(aA,{}),x.jsx(p6,{className:Oe("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),x.jsx(iA,{})]})}));Zm.displayName=QR.displayName;const y6=w.forwardRef(({className:e,...t},n)=>x.jsx(JR,{ref:n,className:Oe("py-1.5 pr-2 pl-8 text-sm font-semibold",e),...t}));y6.displayName=JR.displayName;const ta=w.forwardRef(({className:e,children:t,...n},a)=>x.jsxs(eA,{ref:a,className:Oe("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:[x.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:x.jsx(v6,{children:x.jsx(ig,{className:"h-4 w-4"})})}),x.jsx(g6,{children:t})]}));ta.displayName=eA.displayName;const b6=w.forwardRef(({className:e,...t},n)=>x.jsx(rA,{ref:n,className:Oe("bg-muted -mx-1 my-1 h-px",e),...t}));b6.displayName=rA.displayName;function x6(){var n,a;const e=Ye(o=>o.querySettings),t=w.useCallback((o,s)=>{Ye.getState().updateQuerySettings({[o]:s})},[]);return x.jsxs(hl,{className:"flex shrink-0 flex-col",children:[x.jsxs(Gu,{className:"px-4 pt-4 pb-2",children:[x.jsx(pl,{children:"Parameters"}),x.jsx(Sd,{children:"Configure your query parameters"})]}),x.jsx(Fu,{className:"m-0 flex grow flex-col p-0 text-xs",children:x.jsx("div",{className:"relative size-full",children:x.jsxs("div",{className:"absolute inset-0 flex flex-col gap-2 overflow-auto px-2",children:[x.jsxs(x.Fragment,{children:[x.jsx(bn,{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"}),x.jsxs($1,{value:e.mode,onValueChange:o=>t("mode",o),children:[x.jsx(Km,{className:"hover:bg-primary/5 h-9 cursor-pointer focus:ring-0 focus:ring-offset-0 focus:outline-0 active:right-0",children:x.jsx(q1,{})}),x.jsx(Zm,{children:x.jsxs(V1,{children:[x.jsx(ta,{value:"naive",children:"Naive"}),x.jsx(ta,{value:"local",children:"Local"}),x.jsx(ta,{value:"global",children:"Global"}),x.jsx(ta,{value:"hybrid",children:"Hybrid"}),x.jsx(ta,{value:"mix",children:"Mix"})]})})]})]}),x.jsxs(x.Fragment,{children:[x.jsx(bn,{className:"ml-1",text:"Response Format",tooltip:"Defines the response format. Examples:\\n• Multiple Paragraphs\\n• Single Paragraph\\n• Bullet Points",side:"left"}),x.jsxs($1,{value:e.response_type,onValueChange:o=>t("response_type",o),children:[x.jsx(Km,{className:"hover:bg-primary/5 h-9 cursor-pointer focus:ring-0 focus:ring-offset-0 focus:outline-0 active:right-0",children:x.jsx(q1,{})}),x.jsx(Zm,{children:x.jsxs(V1,{children:[x.jsx(ta,{value:"Multiple Paragraphs",children:"Multiple Paragraphs"}),x.jsx(ta,{value:"Single Paragraph",children:"Single Paragraph"}),x.jsx(ta,{value:"Bullet Points",children:"Bullet Points"})]})})]})]}),x.jsxs(x.Fragment,{children:[x.jsx(bn,{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"}),x.jsx(To,{id:"top_k",stepper:1,value:e.top_k,onValueChange:o=>t("top_k",o),min:1,placeholder:"Number of results"})]}),x.jsxs(x.Fragment,{children:[x.jsxs(x.Fragment,{children:[x.jsx(bn,{className:"ml-1",text:"Max Tokens for Text Unit",tooltip:"Maximum number of tokens allowed for each retrieved text chunk",side:"left"}),x.jsx(To,{id:"max_token_for_text_unit",stepper:500,value:e.max_token_for_text_unit,onValueChange:o=>t("max_token_for_text_unit",o),min:1,placeholder:"Max tokens for text unit"})]}),x.jsxs(x.Fragment,{children:[x.jsx(bn,{text:"Max Tokens for Global Context",tooltip:"Maximum number of tokens allocated for relationship descriptions in global retrieval",side:"left"}),x.jsx(To,{id:"max_token_for_global_context",stepper:500,value:e.max_token_for_global_context,onValueChange:o=>t("max_token_for_global_context",o),min:1,placeholder:"Max tokens for global context"})]}),x.jsxs(x.Fragment,{children:[x.jsx(bn,{className:"ml-1",text:"Max Tokens for Local Context",tooltip:"Maximum number of tokens allocated for entity descriptions in local retrieval",side:"left"}),x.jsx(To,{id:"max_token_for_local_context",stepper:500,value:e.max_token_for_local_context,onValueChange:o=>t("max_token_for_local_context",o),min:1,placeholder:"Max tokens for local context"})]})]}),x.jsxs(x.Fragment,{children:[x.jsx(bn,{className:"ml-1",text:"History Turns",tooltip:"Number of complete conversation turns (user-assistant pairs) to consider in the response context",side:"left"}),x.jsx(To,{className:"!border-input",id:"history_turns",stepper:1,type:"text",value:e.history_turns,onValueChange:o=>t("history_turns",o),min:0,placeholder:"Number of history turns"})]}),x.jsxs(x.Fragment,{children:[x.jsxs(x.Fragment,{children:[x.jsx(bn,{className:"ml-1",text:"High-Level Keywords",tooltip:"List of high-level keywords to prioritize in retrieval. Separate with commas",side:"left"}),x.jsx(Ai,{id:"hl_keywords",type:"text",value:(n=e.hl_keywords)==null?void 0:n.join(", "),onChange:o=>{const s=o.target.value.split(",").map(c=>c.trim()).filter(c=>c!=="");t("hl_keywords",s)},placeholder:"Enter keywords"})]}),x.jsxs(x.Fragment,{children:[x.jsx(bn,{className:"ml-1",text:"Low-Level Keywords",tooltip:"List of low-level keywords to refine retrieval focus. Separate with commas",side:"left"}),x.jsx(Ai,{id:"ll_keywords",type:"text",value:(a=e.ll_keywords)==null?void 0:a.join(", "),onChange:o=>{const s=o.target.value.split(",").map(c=>c.trim()).filter(c=>c!=="");t("ll_keywords",s)},placeholder:"Enter keywords"})]})]}),x.jsxs(x.Fragment,{children:[x.jsxs("div",{className:"flex items-center gap-2",children:[x.jsx(bn,{className:"ml-1",text:"Only Need Context",tooltip:"If True, only returns the retrieved context without generating a response",side:"left"}),x.jsx("div",{className:"grow"}),x.jsx(sl,{className:"mr-1 cursor-pointer",id:"only_need_context",checked:e.only_need_context,onCheckedChange:o=>t("only_need_context",o)})]}),x.jsxs("div",{className:"flex items-center gap-2",children:[x.jsx(bn,{className:"ml-1",text:"Only Need Prompt",tooltip:"If True, only returns the generated prompt without producing a response",side:"left"}),x.jsx("div",{className:"grow"}),x.jsx(sl,{className:"mr-1 cursor-pointer",id:"only_need_prompt",checked:e.only_need_prompt,onCheckedChange:o=>t("only_need_prompt",o)})]}),x.jsxs("div",{className:"flex items-center gap-2",children:[x.jsx(bn,{className:"ml-1",text:"Stream Response",tooltip:"If True, enables streaming output for real-time responses",side:"left"}),x.jsx("div",{className:"grow"}),x.jsx(sl,{className:"mr-1 cursor-pointer",id:"stream",checked:e.stream,onCheckedChange:o=>t("stream",o)})]})]})]})})})]})}function w6(){const[e,t]=w.useState(()=>Ye.getState().retrievalHistory||[]),[n,a]=w.useState(""),[o,s]=w.useState(!1),c=w.useRef(null),u=w.useCallback(()=>{var g;(g=c.current)==null||g.scrollIntoView({behavior:"smooth"})},[]),f=w.useCallback(async g=>{if(g.preventDefault(),!n.trim()||o)return;const y={content:n,role:"user"},b={content:"",role:"assistant"},S=[...e];t([...S,y,b]),a(""),s(!0);const E=C=>{b.content+=C,t(A=>{const k=[...A],D=k[k.length-1];return D.role==="assistant"&&(D.content=b.content),k})},_=Ye.getState(),N={..._.querySettings,query:y.content,conversation_history:S};try{if(_.querySettings.stream)await xO(N,E);else{const C=await bO(N);E(C.response)}}catch(C){E(`Error: Failed to get response +${Sr(C)}`)}finally{s(!1),Ye.getState().setRetrievalHistory([...S,y,b])}},[n,o,e,t]),h=sv(e,100);w.useEffect(()=>u(),[h,u]);const m=w.useCallback(()=>{t([]),Ye.getState().setRetrievalHistory([])},[t]);return x.jsxs("div",{className:"flex size-full gap-2 px-2 pb-12",children:[x.jsxs("div",{className:"flex grow flex-col gap-4",children:[x.jsx("div",{className:"relative grow",children:x.jsx("div",{className:"bg-primary-foreground/60 absolute inset-0 flex flex-col overflow-auto rounded-lg border p-2",children:x.jsxs("div",{className:"flex min-h-0 flex-1 flex-col gap-2",children:[e.length===0?x.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((g,y)=>x.jsx("div",{className:`flex ${g.role==="user"?"justify-end":"justify-start"}`,children:x.jsxs("div",{className:`max-w-[80%] rounded-lg px-4 py-2 ${g.role==="user"?"bg-primary text-primary-foreground":"bg-muted"}`,children:[x.jsx("pre",{className:"break-words whitespace-pre-wrap",children:g.content}),g.content.length===0&&x.jsx(YO,{className:"animate-spin duration-2000"})]})},y)),x.jsx("div",{ref:c,className:"pb-1"})]})})}),x.jsxs("form",{onSubmit:f,className:"flex shrink-0 items-center gap-2",children:[x.jsxs(wt,{type:"button",variant:"outline",onClick:m,disabled:o,size:"sm",children:[x.jsx(UE,{}),"Clear"]}),x.jsx(Ai,{className:"flex-1",value:n,onChange:g=>a(g.target.value),placeholder:"Type your query...",disabled:o}),x.jsxs(wt,{type:"submit",variant:"default",disabled:o,size:"sm",children:[x.jsx(cj,{}),"Send"]})]})]}),x.jsx(x6,{})]})}function E6(){return x.jsx("iframe",{src:iE+"/docs",className:"size-full"})}function S6(){const e=En.use.message(),t=Ye.use.enableHealthCheck(),[n]=w.useState(()=>Ye.getState().currentTab),[a,o]=w.useState(!1);w.useEffect(()=>{if(!t)return;En.getState().check();const c=setInterval(async()=>{await En.getState().check()},Ok*1e3);return()=>clearInterval(c)},[t]);const s=w.useCallback(c=>Ye.getState().setCurrentTab(c),[]);return w.useEffect(()=>{if(e&&(e.includes(ME)||e.includes(PE))){o(!0);return}o(!1)},[e,o]),x.jsx(Mk,{children:x.jsxs("main",{className:"flex h-screen w-screen overflow-x-hidden",children:[x.jsxs(GP,{defaultValue:n,className:"!m-0 flex grow flex-col !p-0",onValueChange:s,children:[x.jsx(UP,{}),x.jsxs("div",{className:"relative grow",children:[x.jsx(rl,{value:"documents",className:"absolute top-0 right-0 bottom-0 left-0",children:x.jsx(wI,{})}),x.jsx(rl,{value:"knowledge-graph",className:"absolute top-0 right-0 bottom-0 left-0",children:x.jsx(VU,{})}),x.jsx(rl,{value:"retrieval",className:"absolute top-0 right-0 bottom-0 left-0",children:x.jsx(w6,{})}),x.jsx(rl,{value:"api",className:"absolute top-0 right-0 bottom-0 left-0",children:x.jsx(E6,{})})]})]}),t&&x.jsx(xP,{}),e!==null&&!a&&x.jsx(Ej,{}),a&&x.jsx(oP,{}),x.jsx(iP,{})]})})}DD.createRoot(document.getElementById("root")).render(x.jsx(w.StrictMode,{children:x.jsx(S6,{})})); diff --git a/lightrag/api/webui/assets/index-BhTFLcnv.css b/lightrag/api/webui/assets/index-BhTFLcnv.css deleted file mode 100644 index b730b3e0..00000000 --- a/lightrag/api/webui/assets/index-BhTFLcnv.css +++ /dev/null @@ -1 +0,0 @@ -/*! tailwindcss v4.0.6 | MIT License | https://tailwindcss.com */@layer theme{:root,:host{--font-sans:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";--font-serif:ui-serif,Georgia,Cambria,"Times New Roman",Times,serif;--font-mono:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;--color-red-50:oklch(.971 .013 17.38);--color-red-100:oklch(.936 .032 17.717);--color-red-200:oklch(.885 .062 18.334);--color-red-300:oklch(.808 .114 19.571);--color-red-400:oklch(.704 .191 22.216);--color-red-500:oklch(.637 .237 25.331);--color-red-600:oklch(.577 .245 27.325);--color-red-700:oklch(.505 .213 27.518);--color-red-800:oklch(.444 .177 26.899);--color-red-900:oklch(.396 .141 25.723);--color-red-950:oklch(.258 .092 26.042);--color-orange-50:oklch(.98 .016 73.684);--color-orange-100:oklch(.954 .038 75.164);--color-orange-200:oklch(.901 .076 70.697);--color-orange-300:oklch(.837 .128 66.29);--color-orange-400:oklch(.75 .183 55.934);--color-orange-500:oklch(.705 .213 47.604);--color-orange-600:oklch(.646 .222 41.116);--color-orange-700:oklch(.553 .195 38.402);--color-orange-800:oklch(.47 .157 37.304);--color-orange-900:oklch(.408 .123 38.172);--color-orange-950:oklch(.266 .079 36.259);--color-amber-50:oklch(.987 .022 95.277);--color-amber-100:oklch(.962 .059 95.617);--color-amber-200:oklch(.924 .12 95.746);--color-amber-300:oklch(.879 .169 91.605);--color-amber-400:oklch(.828 .189 84.429);--color-amber-500:oklch(.769 .188 70.08);--color-amber-600:oklch(.666 .179 58.318);--color-amber-700:oklch(.555 .163 48.998);--color-amber-800:oklch(.473 .137 46.201);--color-amber-900:oklch(.414 .112 45.904);--color-amber-950:oklch(.279 .077 45.635);--color-yellow-50:oklch(.987 .026 102.212);--color-yellow-100:oklch(.973 .071 103.193);--color-yellow-200:oklch(.945 .129 101.54);--color-yellow-300:oklch(.905 .182 98.111);--color-yellow-400:oklch(.852 .199 91.936);--color-yellow-500:oklch(.795 .184 86.047);--color-yellow-600:oklch(.681 .162 75.834);--color-yellow-700:oklch(.554 .135 66.442);--color-yellow-800:oklch(.476 .114 61.907);--color-yellow-900:oklch(.421 .095 57.708);--color-yellow-950:oklch(.286 .066 53.813);--color-lime-50:oklch(.986 .031 120.757);--color-lime-100:oklch(.967 .067 122.328);--color-lime-200:oklch(.938 .127 124.321);--color-lime-300:oklch(.897 .196 126.665);--color-lime-400:oklch(.841 .238 128.85);--color-lime-500:oklch(.768 .233 130.85);--color-lime-600:oklch(.648 .2 131.684);--color-lime-700:oklch(.532 .157 131.589);--color-lime-800:oklch(.453 .124 130.933);--color-lime-900:oklch(.405 .101 131.063);--color-lime-950:oklch(.274 .072 132.109);--color-green-50:oklch(.982 .018 155.826);--color-green-100:oklch(.962 .044 156.743);--color-green-200:oklch(.925 .084 155.995);--color-green-300:oklch(.871 .15 154.449);--color-green-400:oklch(.792 .209 151.711);--color-green-500:oklch(.723 .219 149.579);--color-green-600:oklch(.627 .194 149.214);--color-green-700:oklch(.527 .154 150.069);--color-green-800:oklch(.448 .119 151.328);--color-green-900:oklch(.393 .095 152.535);--color-green-950:oklch(.266 .065 152.934);--color-emerald-50:oklch(.979 .021 166.113);--color-emerald-100:oklch(.95 .052 163.051);--color-emerald-200:oklch(.905 .093 164.15);--color-emerald-300:oklch(.845 .143 164.978);--color-emerald-400:oklch(.765 .177 163.223);--color-emerald-500:oklch(.696 .17 162.48);--color-emerald-600:oklch(.596 .145 163.225);--color-emerald-700:oklch(.508 .118 165.612);--color-emerald-800:oklch(.432 .095 166.913);--color-emerald-900:oklch(.378 .077 168.94);--color-emerald-950:oklch(.262 .051 172.552);--color-teal-50:oklch(.984 .014 180.72);--color-teal-100:oklch(.953 .051 180.801);--color-teal-200:oklch(.91 .096 180.426);--color-teal-300:oklch(.855 .138 181.071);--color-teal-400:oklch(.777 .152 181.912);--color-teal-500:oklch(.704 .14 182.503);--color-teal-600:oklch(.6 .118 184.704);--color-teal-700:oklch(.511 .096 186.391);--color-teal-800:oklch(.437 .078 188.216);--color-teal-900:oklch(.386 .063 188.416);--color-teal-950:oklch(.277 .046 192.524);--color-cyan-50:oklch(.984 .019 200.873);--color-cyan-100:oklch(.956 .045 203.388);--color-cyan-200:oklch(.917 .08 205.041);--color-cyan-300:oklch(.865 .127 207.078);--color-cyan-400:oklch(.789 .154 211.53);--color-cyan-500:oklch(.715 .143 215.221);--color-cyan-600:oklch(.609 .126 221.723);--color-cyan-700:oklch(.52 .105 223.128);--color-cyan-800:oklch(.45 .085 224.283);--color-cyan-900:oklch(.398 .07 227.392);--color-cyan-950:oklch(.302 .056 229.695);--color-sky-50:oklch(.977 .013 236.62);--color-sky-100:oklch(.951 .026 236.824);--color-sky-200:oklch(.901 .058 230.902);--color-sky-300:oklch(.828 .111 230.318);--color-sky-400:oklch(.746 .16 232.661);--color-sky-500:oklch(.685 .169 237.323);--color-sky-600:oklch(.588 .158 241.966);--color-sky-700:oklch(.5 .134 242.749);--color-sky-800:oklch(.443 .11 240.79);--color-sky-900:oklch(.391 .09 240.876);--color-sky-950:oklch(.293 .066 243.157);--color-blue-50:oklch(.97 .014 254.604);--color-blue-100:oklch(.932 .032 255.585);--color-blue-200:oklch(.882 .059 254.128);--color-blue-300:oklch(.809 .105 251.813);--color-blue-400:oklch(.707 .165 254.624);--color-blue-500:oklch(.623 .214 259.815);--color-blue-600:oklch(.546 .245 262.881);--color-blue-700:oklch(.488 .243 264.376);--color-blue-800:oklch(.424 .199 265.638);--color-blue-900:oklch(.379 .146 265.522);--color-blue-950:oklch(.282 .091 267.935);--color-indigo-50:oklch(.962 .018 272.314);--color-indigo-100:oklch(.93 .034 272.788);--color-indigo-200:oklch(.87 .065 274.039);--color-indigo-300:oklch(.785 .115 274.713);--color-indigo-400:oklch(.673 .182 276.935);--color-indigo-500:oklch(.585 .233 277.117);--color-indigo-600:oklch(.511 .262 276.966);--color-indigo-700:oklch(.457 .24 277.023);--color-indigo-800:oklch(.398 .195 277.366);--color-indigo-900:oklch(.359 .144 278.697);--color-indigo-950:oklch(.257 .09 281.288);--color-violet-50:oklch(.969 .016 293.756);--color-violet-100:oklch(.943 .029 294.588);--color-violet-200:oklch(.894 .057 293.283);--color-violet-300:oklch(.811 .111 293.571);--color-violet-400:oklch(.702 .183 293.541);--color-violet-500:oklch(.606 .25 292.717);--color-violet-600:oklch(.541 .281 293.009);--color-violet-700:oklch(.491 .27 292.581);--color-violet-800:oklch(.432 .232 292.759);--color-violet-900:oklch(.38 .189 293.745);--color-violet-950:oklch(.283 .141 291.089);--color-purple-50:oklch(.977 .014 308.299);--color-purple-100:oklch(.946 .033 307.174);--color-purple-200:oklch(.902 .063 306.703);--color-purple-300:oklch(.827 .119 306.383);--color-purple-400:oklch(.714 .203 305.504);--color-purple-500:oklch(.627 .265 303.9);--color-purple-600:oklch(.558 .288 302.321);--color-purple-700:oklch(.496 .265 301.924);--color-purple-800:oklch(.438 .218 303.724);--color-purple-900:oklch(.381 .176 304.987);--color-purple-950:oklch(.291 .149 302.717);--color-fuchsia-50:oklch(.977 .017 320.058);--color-fuchsia-100:oklch(.952 .037 318.852);--color-fuchsia-200:oklch(.903 .076 319.62);--color-fuchsia-300:oklch(.833 .145 321.434);--color-fuchsia-400:oklch(.74 .238 322.16);--color-fuchsia-500:oklch(.667 .295 322.15);--color-fuchsia-600:oklch(.591 .293 322.896);--color-fuchsia-700:oklch(.518 .253 323.949);--color-fuchsia-800:oklch(.452 .211 324.591);--color-fuchsia-900:oklch(.401 .17 325.612);--color-fuchsia-950:oklch(.293 .136 325.661);--color-pink-50:oklch(.971 .014 343.198);--color-pink-100:oklch(.948 .028 342.258);--color-pink-200:oklch(.899 .061 343.231);--color-pink-300:oklch(.823 .12 346.018);--color-pink-400:oklch(.718 .202 349.761);--color-pink-500:oklch(.656 .241 354.308);--color-pink-600:oklch(.592 .249 .584);--color-pink-700:oklch(.525 .223 3.958);--color-pink-800:oklch(.459 .187 3.815);--color-pink-900:oklch(.408 .153 2.432);--color-pink-950:oklch(.284 .109 3.907);--color-rose-50:oklch(.969 .015 12.422);--color-rose-100:oklch(.941 .03 12.58);--color-rose-200:oklch(.892 .058 10.001);--color-rose-300:oklch(.81 .117 11.638);--color-rose-400:oklch(.712 .194 13.428);--color-rose-500:oklch(.645 .246 16.439);--color-rose-600:oklch(.586 .253 17.585);--color-rose-700:oklch(.514 .222 16.935);--color-rose-800:oklch(.455 .188 13.697);--color-rose-900:oklch(.41 .159 10.272);--color-rose-950:oklch(.271 .105 12.094);--color-slate-50:oklch(.984 .003 247.858);--color-slate-100:oklch(.968 .007 247.896);--color-slate-200:oklch(.929 .013 255.508);--color-slate-300:oklch(.869 .022 252.894);--color-slate-400:oklch(.704 .04 256.788);--color-slate-500:oklch(.554 .046 257.417);--color-slate-600:oklch(.446 .043 257.281);--color-slate-700:oklch(.372 .044 257.287);--color-slate-800:oklch(.279 .041 260.031);--color-slate-900:oklch(.208 .042 265.755);--color-slate-950:oklch(.129 .042 264.695);--color-gray-50:oklch(.985 .002 247.839);--color-gray-100:oklch(.967 .003 264.542);--color-gray-200:oklch(.928 .006 264.531);--color-gray-300:oklch(.872 .01 258.338);--color-gray-400:oklch(.707 .022 261.325);--color-gray-500:oklch(.551 .027 264.364);--color-gray-600:oklch(.446 .03 256.802);--color-gray-700:oklch(.373 .034 259.733);--color-gray-800:oklch(.278 .033 256.848);--color-gray-900:oklch(.21 .034 264.665);--color-gray-950:oklch(.13 .028 261.692);--color-zinc-50:oklch(.985 0 0);--color-zinc-100:oklch(.967 .001 286.375);--color-zinc-200:oklch(.92 .004 286.32);--color-zinc-300:oklch(.871 .006 286.286);--color-zinc-400:oklch(.705 .015 286.067);--color-zinc-500:oklch(.552 .016 285.938);--color-zinc-600:oklch(.442 .017 285.786);--color-zinc-700:oklch(.37 .013 285.805);--color-zinc-800:oklch(.274 .006 286.033);--color-zinc-900:oklch(.21 .006 285.885);--color-zinc-950:oklch(.141 .005 285.823);--color-neutral-50:oklch(.985 0 0);--color-neutral-100:oklch(.97 0 0);--color-neutral-200:oklch(.922 0 0);--color-neutral-300:oklch(.87 0 0);--color-neutral-400:oklch(.708 0 0);--color-neutral-500:oklch(.556 0 0);--color-neutral-600:oklch(.439 0 0);--color-neutral-700:oklch(.371 0 0);--color-neutral-800:oklch(.269 0 0);--color-neutral-900:oklch(.205 0 0);--color-neutral-950:oklch(.145 0 0);--color-stone-50:oklch(.985 .001 106.423);--color-stone-100:oklch(.97 .001 106.424);--color-stone-200:oklch(.923 .003 48.717);--color-stone-300:oklch(.869 .005 56.366);--color-stone-400:oklch(.709 .01 56.259);--color-stone-500:oklch(.553 .013 58.071);--color-stone-600:oklch(.444 .011 73.639);--color-stone-700:oklch(.374 .01 67.558);--color-stone-800:oklch(.268 .007 34.298);--color-stone-900:oklch(.216 .006 56.043);--color-stone-950:oklch(.147 .004 49.25);--color-black:#000;--color-white:#fff;--spacing:.25rem;--breakpoint-sm:40rem;--breakpoint-md:48rem;--breakpoint-lg:64rem;--breakpoint-xl:80rem;--breakpoint-2xl:96rem;--container-3xs:16rem;--container-2xs:18rem;--container-xs:20rem;--container-sm:24rem;--container-md:28rem;--container-lg:32rem;--container-xl:36rem;--container-2xl:42rem;--container-3xl:48rem;--container-4xl:56rem;--container-5xl:64rem;--container-6xl:72rem;--container-7xl:80rem;--text-xs:.75rem;--text-xs--line-height:calc(1/.75);--text-sm:.875rem;--text-sm--line-height:calc(1.25/.875);--text-base:1rem;--text-base--line-height: 1.5 ;--text-lg:1.125rem;--text-lg--line-height:calc(1.75/1.125);--text-xl:1.25rem;--text-xl--line-height:calc(1.75/1.25);--text-2xl:1.5rem;--text-2xl--line-height:calc(2/1.5);--text-3xl:1.875rem;--text-3xl--line-height: 1.2 ;--text-4xl:2.25rem;--text-4xl--line-height:calc(2.5/2.25);--text-5xl:3rem;--text-5xl--line-height:1;--text-6xl:3.75rem;--text-6xl--line-height:1;--text-7xl:4.5rem;--text-7xl--line-height:1;--text-8xl:6rem;--text-8xl--line-height:1;--text-9xl:8rem;--text-9xl--line-height:1;--font-weight-thin:100;--font-weight-extralight:200;--font-weight-light:300;--font-weight-normal:400;--font-weight-medium:500;--font-weight-semibold:600;--font-weight-bold:700;--font-weight-extrabold:800;--font-weight-black:900;--tracking-tighter:-.05em;--tracking-tight:-.025em;--tracking-normal:0em;--tracking-wide:.025em;--tracking-wider:.05em;--tracking-widest:.1em;--leading-tight:1.25;--leading-snug:1.375;--leading-normal:1.5;--leading-relaxed:1.625;--leading-loose:2;--radius-xs:.125rem;--radius-sm:calc(var(--radius) - 4px);--radius-md:calc(var(--radius) - 2px);--radius-lg:var(--radius);--radius-xl:calc(var(--radius) + 4px);--radius-2xl:1rem;--radius-3xl:1.5rem;--radius-4xl:2rem;--shadow-2xs:0 1px #0000000d;--shadow-xs:0 1px 2px 0 #0000000d;--shadow-sm:0 1px 3px 0 #0000001a,0 1px 2px -1px #0000001a;--shadow-md:0 4px 6px -1px #0000001a,0 2px 4px -2px #0000001a;--shadow-lg:0 10px 15px -3px #0000001a,0 4px 6px -4px #0000001a;--shadow-xl:0 20px 25px -5px #0000001a,0 8px 10px -6px #0000001a;--shadow-2xl:0 25px 50px -12px #00000040;--inset-shadow-2xs:inset 0 1px #0000000d;--inset-shadow-xs:inset 0 1px 1px #0000000d;--inset-shadow-sm:inset 0 2px 4px #0000000d;--drop-shadow-xs:0 1px 1px #0000000d;--drop-shadow-sm:0 1px 2px #00000026;--drop-shadow-md:0 3px 3px #0000001f;--drop-shadow-lg:0 4px 4px #00000026;--drop-shadow-xl:0 9px 7px #0000001a;--drop-shadow-2xl:0 25px 25px #00000026;--ease-in:cubic-bezier(.4,0,1,1);--ease-out:cubic-bezier(0,0,.2,1);--ease-in-out:cubic-bezier(.4,0,.2,1);--animate-spin:spin 1s linear infinite;--animate-ping:ping 1s cubic-bezier(0,0,.2,1)infinite;--animate-pulse:pulse 2s cubic-bezier(.4,0,.6,1)infinite;--animate-bounce:bounce 1s infinite;--blur-xs:4px;--blur-sm:8px;--blur-md:12px;--blur-lg:16px;--blur-xl:24px;--blur-2xl:40px;--blur-3xl:64px;--perspective-dramatic:100px;--perspective-near:300px;--perspective-normal:500px;--perspective-midrange:800px;--perspective-distant:1200px;--aspect-video:16/9;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4,0,.2,1);--default-font-family:var(--font-sans);--default-font-feature-settings:var(--font-sans--font-feature-settings);--default-font-variation-settings:var(--font-sans--font-variation-settings);--default-mono-font-family:var(--font-mono);--default-mono-font-feature-settings:var(--font-mono--font-feature-settings);--default-mono-font-variation-settings:var(--font-mono--font-variation-settings);--color-background:var(--background);--color-foreground:var(--foreground);--color-card:var(--card);--color-card-foreground:var(--card-foreground);--color-popover:var(--popover);--color-popover-foreground:var(--popover-foreground);--color-primary:var(--primary);--color-primary-foreground:var(--primary-foreground);--color-secondary:var(--secondary);--color-secondary-foreground:var(--secondary-foreground);--color-muted:var(--muted);--color-muted-foreground:var(--muted-foreground);--color-accent:var(--accent);--color-accent-foreground:var(--accent-foreground);--color-destructive:var(--destructive);--color-destructive-foreground:var(--destructive-foreground);--color-border:var(--border);--color-input:var(--input);--color-ring:var(--ring);--color-chart-1:var(--chart-1);--color-chart-2:var(--chart-2);--color-chart-3:var(--chart-3);--color-chart-4:var(--chart-4);--color-chart-5:var(--chart-5);--color-sidebar-ring:var(--sidebar-ring);--color-sidebar-border:var(--sidebar-border);--color-sidebar-accent-foreground:var(--sidebar-accent-foreground);--color-sidebar-accent:var(--sidebar-accent);--color-sidebar-primary-foreground:var(--sidebar-primary-foreground);--color-sidebar-primary:var(--sidebar-primary);--color-sidebar-foreground:var(--sidebar-foreground);--color-sidebar:var(--sidebar-background);--animate-accordion-down:accordion-down .2s ease-out;--animate-accordion-up:accordion-up .2s ease-out}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;-moz-tab-size:4;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}body{line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1;color:color-mix(in oklab,currentColor 50%,transparent)}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){-webkit-appearance:button;-moz-appearance:button;appearance:button}::file-selector-button{-webkit-appearance:button;-moz-appearance:button;appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}*{border-color:var(--border);outline-color:color-mix(in oklab,var(--ring)50%,transparent)}body{background-color:var(--background);color:var(--foreground)}*{scrollbar-color:initial;scrollbar-width:initial}}@layer components;@layer utilities{.pointer-events-none{pointer-events:none}.invisible{visibility:hidden}.visible{visibility:visible}.sr-only{clip:rect(0,0,0,0);white-space:nowrap;border-width:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.static{position:static}.sticky{position:sticky}.inset-0{inset:calc(var(--spacing)*0)}.top-0{top:calc(var(--spacing)*0)}.top-1\/2{top:50%}.top-2{top:calc(var(--spacing)*2)}.top-4{top:calc(var(--spacing)*4)}.top-12{top:calc(var(--spacing)*12)}.top-\[50\%\]{top:50%}.right-0{right:calc(var(--spacing)*0)}.right-2{right:calc(var(--spacing)*2)}.right-4{right:calc(var(--spacing)*4)}.bottom-0{bottom:calc(var(--spacing)*0)}.bottom-2{bottom:calc(var(--spacing)*2)}.bottom-4{bottom:calc(var(--spacing)*4)}.left-0{left:calc(var(--spacing)*0)}.left-1\/2{left:50%}.left-2{left:calc(var(--spacing)*2)}.left-\[50\%\]{left:50%}.isolate{isolation:isolate}.z-50{z-index:50}.\!container{width:100%!important}@media (width>=40rem){.\!container{max-width:40rem!important}}@media (width>=48rem){.\!container{max-width:48rem!important}}@media (width>=64rem){.\!container{max-width:64rem!important}}@media (width>=80rem){.\!container{max-width:80rem!important}}@media (width>=96rem){.\!container{max-width:96rem!important}}.container{width:100%}@media (width>=40rem){.container{max-width:40rem}}@media (width>=48rem){.container{max-width:48rem}}@media (width>=64rem){.container{max-width:64rem}}@media (width>=80rem){.container{max-width:80rem}}@media (width>=96rem){.container{max-width:96rem}}.\!m-0{margin:calc(var(--spacing)*0)!important}.m-0{margin:calc(var(--spacing)*0)}.-mx-1{margin-inline:calc(var(--spacing)*-1)}.mx-1{margin-inline:calc(var(--spacing)*1)}.my-1{margin-block:calc(var(--spacing)*1)}.mt-2{margin-top:calc(var(--spacing)*2)}.mt-4{margin-top:calc(var(--spacing)*4)}.mr-1{margin-right:calc(var(--spacing)*1)}.mr-2{margin-right:calc(var(--spacing)*2)}.mr-4{margin-right:calc(var(--spacing)*4)}.mr-6{margin-right:calc(var(--spacing)*6)}.mb-1{margin-bottom:calc(var(--spacing)*1)}.mb-2{margin-bottom:calc(var(--spacing)*2)}.ml-1{margin-left:calc(var(--spacing)*1)}.ml-2{margin-left:calc(var(--spacing)*2)}.ml-auto{margin-left:auto}.scrollbar{scrollbar-width:auto;scrollbar-color:var(--scrollbar-thumb,initial)var(--scrollbar-track,initial)}.scrollbar::-webkit-scrollbar-track{background-color:var(--scrollbar-track);border-radius:var(--scrollbar-track-radius)}.scrollbar::-webkit-scrollbar-thumb{background-color:var(--scrollbar-thumb);border-radius:var(--scrollbar-thumb-radius)}.scrollbar::-webkit-scrollbar-corner{background-color:var(--scrollbar-corner);border-radius:var(--scrollbar-corner-radius)}.scrollbar::-webkit-scrollbar{width:var(--scrollbar-width,16px);height:var(--scrollbar-height,16px);display:block}.line-clamp-1{-webkit-line-clamp:1;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.block{display:block}.contents{display:contents}.flex{display:flex}.grid{display:grid}.hidden{display:none}.inline{display:inline}.inline-block{display:inline-block}.inline-flex{display:inline-flex}.inline-grid{display:inline-grid}.table{display:table}.aspect-square{aspect-ratio:1}.\!size-full{width:100%!important;height:100%!important}.size-4{width:calc(var(--spacing)*4);height:calc(var(--spacing)*4)}.size-7{width:calc(var(--spacing)*7);height:calc(var(--spacing)*7)}.size-8{width:calc(var(--spacing)*8);height:calc(var(--spacing)*8)}.size-10{width:calc(var(--spacing)*10);height:calc(var(--spacing)*10)}.size-full{width:100%;height:100%}.h-1\/2{height:50%}.h-2\.5{height:calc(var(--spacing)*2.5)}.h-3{height:calc(var(--spacing)*3)}.h-3\.5{height:calc(var(--spacing)*3.5)}.h-4{height:calc(var(--spacing)*4)}.h-6{height:calc(var(--spacing)*6)}.h-8{height:calc(var(--spacing)*8)}.h-9{height:calc(var(--spacing)*9)}.h-10{height:calc(var(--spacing)*10)}.h-11{height:calc(var(--spacing)*11)}.h-52{height:calc(var(--spacing)*52)}.h-\[1px\]{height:1px}.h-\[var\(--radix-select-trigger-height\)\]{height:var(--radix-select-trigger-height)}.h-fit{height:fit-content}.h-full{height:100%}.h-px{height:1px}.h-screen{height:100vh}.max-h-8{max-height:calc(var(--spacing)*8)}.max-h-48{max-height:calc(var(--spacing)*48)}.max-h-96{max-height:calc(var(--spacing)*96)}.max-h-\[300px\]{max-height:300px}.max-h-full{max-height:100%}.min-h-0{min-height:calc(var(--spacing)*0)}.w-0{width:calc(var(--spacing)*0)}.w-2\.5{width:calc(var(--spacing)*2.5)}.w-3{width:calc(var(--spacing)*3)}.w-3\.5{width:calc(var(--spacing)*3.5)}.w-4{width:calc(var(--spacing)*4)}.w-6{width:calc(var(--spacing)*6)}.w-16{width:calc(var(--spacing)*16)}.w-24{width:calc(var(--spacing)*24)}.w-\[1px\]{width:1px}.w-auto{width:auto}.w-full{width:100%}.w-screen{width:100vw}.max-w-80{max-width:calc(var(--spacing)*80)}.max-w-\[80\%\]{max-width:80%}.max-w-lg{max-width:var(--container-lg)}.max-w-none{max-width:none}.max-w-sm{max-width:var(--container-sm)}.max-w-xs{max-width:var(--container-xs)}.min-w-0{min-width:calc(var(--spacing)*0)}.min-w-24{min-width:calc(var(--spacing)*24)}.min-w-\[8rem\]{min-width:8rem}.min-w-\[300px\]{min-width:300px}.min-w-\[var\(--radix-select-trigger-width\)\]{min-width:var(--radix-select-trigger-width)}.flex-1{flex:1}.flex-auto{flex:auto}.flex-shrink,.shrink{flex-shrink:1}.shrink-0{flex-shrink:0}.flex-grow,.grow{flex-grow:1}.caption-bottom{caption-side:bottom}.-translate-x-1\/2{--tw-translate-x: -50% ;translate:var(--tw-translate-x)var(--tw-translate-y)}.-translate-y-1\/2{--tw-translate-y: -50% ;translate:var(--tw-translate-x)var(--tw-translate-y)}.-translate-y-20{--tw-translate-y:calc(var(--spacing)*-20);translate:var(--tw-translate-x)var(--tw-translate-y)}.translate-x-\[-50\%\]{--tw-translate-x:-50%;translate:var(--tw-translate-x)var(--tw-translate-y)}.translate-y-0{--tw-translate-y:calc(var(--spacing)*0);translate:var(--tw-translate-x)var(--tw-translate-y)}.translate-y-\[-50\%\]{--tw-translate-y:-50%;translate:var(--tw-translate-x)var(--tw-translate-y)}.scale-125{--tw-scale-x:125%;--tw-scale-y:125%;--tw-scale-z:125%;scale:var(--tw-scale-x)var(--tw-scale-y)}.scale-3d{scale:var(--tw-scale-x)var(--tw-scale-y)var(--tw-scale-z)}.transform{transform:var(--tw-rotate-x)var(--tw-rotate-y)var(--tw-rotate-z)var(--tw-skew-x)var(--tw-skew-y)}.animate-pulse{animation:var(--animate-pulse)}.animate-spin{animation:var(--animate-spin)}.cursor-default{cursor:default}.cursor-help{cursor:help}.cursor-not-allowed{cursor:not-allowed}.cursor-pointer{cursor:pointer}.touch-none{touch-action:none}.resize{resize:both}.\[appearance\:textfield\]{-webkit-appearance:textfield;-moz-appearance:textfield;appearance:textfield}.columns-2{columns:2}.columns-3{columns:3}.columns-4{columns:4}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.flex-col{flex-direction:column}.flex-col-reverse{flex-direction:column-reverse}.place-items-center{place-items:center}.items-center{align-items:center}.items-start{align-items:flex-start}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.justify-end{justify-content:flex-end}.justify-start{justify-content:flex-start}.gap-1{gap:calc(var(--spacing)*1)}.gap-1\.5{gap:calc(var(--spacing)*1.5)}.gap-2{gap:calc(var(--spacing)*2)}.gap-2\.5{gap:calc(var(--spacing)*2.5)}.gap-4{gap:calc(var(--spacing)*4)}.gap-6{gap:calc(var(--spacing)*6)}.gap-px{gap:1px}:where(.space-y-1>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*1)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*1)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-1\.5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*1.5)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*1.5)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-3>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*3)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*3)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-4>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*4)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*4)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-6>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*6)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*6)*calc(1 - var(--tw-space-y-reverse)))}.self-center{align-self:center}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-visible{overflow:visible}.overflow-x-hidden{overflow-x:hidden}.overflow-y-auto{overflow-y:auto}.\!rounded-none{border-radius:0!important}.rounded{border-radius:.25rem}.rounded-\[inherit\]{border-radius:inherit}.rounded-full{border-radius:3.40282e38px}.rounded-lg{border-radius:var(--radius)}.rounded-md{border-radius:calc(var(--radius) - 2px)}.rounded-sm{border-radius:calc(var(--radius) - 4px)}.rounded-xl{border-radius:calc(var(--radius) + 4px)}.rounded-l-none{border-top-left-radius:0;border-bottom-left-radius:0}.rounded-tr-none{border-top-right-radius:0}.rounded-br-none{border-bottom-right-radius:0}.border,.border-1{border-style:var(--tw-border-style);border-width:1px}.border-2{border-style:var(--tw-border-style);border-width:2px}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-l{border-left-style:var(--tw-border-style);border-left-width:1px}.\!border-none{--tw-border-style:none!important;border-style:none!important}.border-dashed{--tw-border-style:dashed;border-style:dashed}.\!border-input{border-color:var(--input)!important}.border-border\/40{border-color:color-mix(in oklab,var(--border)40%,transparent)}.border-destructive\/50{border-color:color-mix(in oklab,var(--destructive)50%,transparent)}.border-input{border-color:var(--input)}.border-muted-foreground\/25{border-color:color-mix(in oklab,var(--muted-foreground)25%,transparent)}.border-muted-foreground\/50{border-color:color-mix(in oklab,var(--muted-foreground)50%,transparent)}.border-primary{border-color:var(--primary)}.border-t-transparent{border-top-color:#0000}.border-l-transparent{border-left-color:#0000}.\!bg-background{background-color:var(--background)!important}.\!bg-emerald-400{background-color:var(--color-emerald-400)!important}.bg-background{background-color:var(--background)}.bg-background\/60{background-color:color-mix(in oklab,var(--background)60%,transparent)}.bg-background\/80{background-color:color-mix(in oklab,var(--background)80%,transparent)}.bg-background\/90{background-color:color-mix(in oklab,var(--background)90%,transparent)}.bg-background\/95{background-color:color-mix(in oklab,var(--background)95%,transparent)}.bg-black\/80{background-color:color-mix(in oklab,var(--color-black)80%,transparent)}.bg-border{background-color:var(--border)}.bg-card{background-color:var(--card)}.bg-destructive{background-color:var(--destructive)}.bg-foreground\/10{background-color:color-mix(in oklab,var(--foreground)10%,transparent)}.bg-green-500{background-color:var(--color-green-500)}.bg-muted{background-color:var(--muted)}.bg-muted\/50{background-color:color-mix(in oklab,var(--muted)50%,transparent)}.bg-popover{background-color:var(--popover)}.bg-primary{background-color:var(--primary)}.bg-primary-foreground\/60{background-color:color-mix(in oklab,var(--primary-foreground)60%,transparent)}.bg-primary\/5{background-color:color-mix(in oklab,var(--primary)5%,transparent)}.bg-red-500{background-color:var(--color-red-500)}.bg-red-700{background-color:var(--color-red-700)}.bg-secondary{background-color:var(--secondary)}.bg-transparent{background-color:#0000}.object-cover{object-fit:cover}.\!p-0{padding:calc(var(--spacing)*0)!important}.\!p-2{padding:calc(var(--spacing)*2)!important}.p-0{padding:calc(var(--spacing)*0)}.p-1{padding:calc(var(--spacing)*1)}.p-2{padding:calc(var(--spacing)*2)}.p-3{padding:calc(var(--spacing)*3)}.p-4{padding:calc(var(--spacing)*4)}.p-6{padding:calc(var(--spacing)*6)}.p-16{padding:calc(var(--spacing)*16)}.p-\[1px\]{padding:1px}.px-2{padding-inline:calc(var(--spacing)*2)}.px-3{padding-inline:calc(var(--spacing)*3)}.px-4{padding-inline:calc(var(--spacing)*4)}.px-5{padding-inline:calc(var(--spacing)*5)}.px-8{padding-inline:calc(var(--spacing)*8)}.py-1{padding-block:calc(var(--spacing)*1)}.py-1\.5{padding-block:calc(var(--spacing)*1.5)}.py-2{padding-block:calc(var(--spacing)*2)}.py-2\.5{padding-block:calc(var(--spacing)*2.5)}.py-3{padding-block:calc(var(--spacing)*3)}.py-6{padding-block:calc(var(--spacing)*6)}.pt-0{padding-top:calc(var(--spacing)*0)}.pt-4{padding-top:calc(var(--spacing)*4)}.pr-2{padding-right:calc(var(--spacing)*2)}.pb-1{padding-bottom:calc(var(--spacing)*1)}.pb-2{padding-bottom:calc(var(--spacing)*2)}.pb-12{padding-bottom:calc(var(--spacing)*12)}.pl-1{padding-left:calc(var(--spacing)*1)}.pl-8{padding-left:calc(var(--spacing)*8)}.text-center{text-align:center}.text-left{text-align:left}.align-middle{vertical-align:middle}.font-mono{font-family:var(--font-mono)}.text-base{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}.text-lg{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.leading-none{--tw-leading:1;line-height:1}.font-bold{--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.tracking-tight{--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.tracking-wide{--tw-tracking:var(--tracking-wide);letter-spacing:var(--tracking-wide)}.tracking-widest{--tw-tracking:var(--tracking-widest);letter-spacing:var(--tracking-widest)}.break-words{overflow-wrap:break-word}.text-ellipsis{text-overflow:ellipsis}.whitespace-nowrap{white-space:nowrap}.whitespace-pre-wrap{white-space:pre-wrap}.\!text-zinc-50{color:var(--color-zinc-50)!important}.text-blue-600{color:var(--color-blue-600)}.text-card-foreground{color:var(--card-foreground)}.text-current{color:currentColor}.text-destructive{color:var(--destructive)}.text-destructive-foreground{color:var(--destructive-foreground)}.text-emerald-400{color:var(--color-emerald-400)}.text-foreground{color:var(--foreground)}.text-foreground\/80{color:color-mix(in oklab,var(--foreground)80%,transparent)}.text-green-600{color:var(--color-green-600)}.text-muted{color:var(--muted)}.text-muted-foreground{color:var(--muted-foreground)}.text-muted-foreground\/70{color:color-mix(in oklab,var(--muted-foreground)70%,transparent)}.text-popover-foreground{color:var(--popover-foreground)}.text-primary{color:var(--primary)}.text-primary-foreground{color:var(--primary-foreground)}.text-primary\/60{color:color-mix(in oklab,var(--primary)60%,transparent)}.text-red-500{color:var(--color-red-500)}.text-red-600{color:var(--color-red-600)}.text-secondary-foreground{color:var(--secondary-foreground)}.text-sky-300{color:var(--color-sky-300)}.text-teal-600{color:var(--color-teal-600)}.text-teal-600\/90{color:color-mix(in oklab,var(--color-teal-600)90%,transparent)}.text-white{color:var(--color-white)}.text-yellow-400\/90{color:color-mix(in oklab,var(--color-yellow-400)90%,transparent)}.text-yellow-600{color:var(--color-yellow-600)}.uppercase{text-transform:uppercase}.italic{font-style:italic}.underline{text-decoration-line:underline}.underline-offset-4{text-underline-offset:4px}.opacity-0{opacity:0}.opacity-50{opacity:.5}.opacity-60{opacity:.6}.opacity-70{opacity:.7}.opacity-80{opacity:.8}.opacity-100{opacity:1}.shadow{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a),0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_0_8px_rgba\(0\,0\,0\,0\.2\)\]{--tw-shadow:0 0 8px var(--tw-shadow-color,#0003);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_0_12px_rgba\(34\,197\,94\,0\.4\)\]{--tw-shadow:0 0 12px var(--tw-shadow-color,#22c55e66);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_0_12px_rgba\(239\,68\,68\,0\.4\)\]{--tw-shadow:0 0 12px var(--tw-shadow-color,#ef444466);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-lg{--tw-shadow:0 10px 15px -3px var(--tw-shadow-color,#0000001a),0 4px 6px -4px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-md{--tw-shadow:0 4px 6px -1px var(--tw-shadow-color,#0000001a),0 2px 4px -2px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-sm{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a),0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring-offset-background{--tw-ring-offset-color:var(--background)}.outline{outline-style:var(--tw-outline-style);outline-width:1px}.blur{--tw-blur:blur(8px);filter:var(--tw-blur,)var(--tw-brightness,)var(--tw-contrast,)var(--tw-grayscale,)var(--tw-hue-rotate,)var(--tw-invert,)var(--tw-saturate,)var(--tw-sepia,)var(--tw-drop-shadow,)}.invert{--tw-invert:invert(100%);filter:var(--tw-blur,)var(--tw-brightness,)var(--tw-contrast,)var(--tw-grayscale,)var(--tw-hue-rotate,)var(--tw-invert,)var(--tw-saturate,)var(--tw-sepia,)var(--tw-drop-shadow,)}.\!filter{filter:var(--tw-blur,)var(--tw-brightness,)var(--tw-contrast,)var(--tw-grayscale,)var(--tw-hue-rotate,)var(--tw-invert,)var(--tw-saturate,)var(--tw-sepia,)var(--tw-drop-shadow,)!important}.filter{filter:var(--tw-blur,)var(--tw-brightness,)var(--tw-contrast,)var(--tw-grayscale,)var(--tw-hue-rotate,)var(--tw-invert,)var(--tw-saturate,)var(--tw-sepia,)var(--tw-drop-shadow,)}.backdrop-blur{--tw-backdrop-blur:blur(8px);-webkit-backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,)}.backdrop-blur-lg{--tw-backdrop-blur:blur(var(--blur-lg));-webkit-backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,)}.transition{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-all{transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-opacity{transition-property:opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.duration-200{--tw-duration:.2s;transition-duration:.2s}.duration-300{--tw-duration:.3s;transition-duration:.3s}.duration-500{--tw-duration:.5s;transition-duration:.5s}.duration-2000{--tw-duration:2s;transition-duration:2s}.ease-in-out{--tw-ease:var(--ease-in-out);transition-timing-function:var(--ease-in-out)}.animate-in{--tw-enter-opacity:initial;--tw-enter-scale:initial;--tw-enter-rotate:initial;--tw-enter-translate-x:initial;--tw-enter-translate-y:initial;animation-name:enter;animation-duration:.15s}.duration-200{animation-duration:.2s}.duration-300{animation-duration:.3s}.duration-500{animation-duration:.5s}.duration-2000{animation-duration:2s}.ease-in-out{animation-timing-function:cubic-bezier(.4,0,.2,1)}.fade-in-0{--tw-enter-opacity:0}.outline-none{--tw-outline-style:none;outline-style:none}.paused{animation-play-state:paused}.repeat-1{animation-iteration-count:1}.running{animation-play-state:running}.select-none{-webkit-user-select:none;user-select:none}.zoom-in{--tw-enter-scale:0}.zoom-in-95{--tw-enter-scale:.95}.zoom-out{--tw-exit-scale:0}.peer-disabled\:cursor-not-allowed:is(:where(.peer):disabled~*){cursor:not-allowed}.peer-disabled\:opacity-70:is(:where(.peer):disabled~*){opacity:.7}.file\:border-0::file-selector-button{border-style:var(--tw-border-style);border-width:0}.file\:bg-transparent::file-selector-button{background-color:#0000}.file\:text-sm::file-selector-button{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.file\:font-medium::file-selector-button{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.file\:text-foreground::file-selector-button{color:var(--foreground)}.placeholder\:text-muted-foreground::placeholder{color:var(--muted-foreground)}@media (hover:hover){.hover\:w-fit:hover{width:fit-content}.hover\:bg-accent:hover{background-color:var(--accent)}.hover\:bg-background\/60:hover{background-color:color-mix(in oklab,var(--background)60%,transparent)}.hover\:bg-destructive\/90:hover{background-color:color-mix(in oklab,var(--destructive)90%,transparent)}.hover\:bg-muted\/25:hover{background-color:color-mix(in oklab,var(--muted)25%,transparent)}.hover\:bg-muted\/50:hover{background-color:color-mix(in oklab,var(--muted)50%,transparent)}.hover\:bg-primary\/5:hover{background-color:color-mix(in oklab,var(--primary)5%,transparent)}.hover\:bg-primary\/20:hover{background-color:color-mix(in oklab,var(--primary)20%,transparent)}.hover\:bg-primary\/90:hover{background-color:color-mix(in oklab,var(--primary)90%,transparent)}.hover\:bg-secondary\/80:hover{background-color:color-mix(in oklab,var(--secondary)80%,transparent)}.hover\:text-accent-foreground:hover{color:var(--accent-foreground)}.hover\:underline:hover{text-decoration-line:underline}.hover\:opacity-100:hover{opacity:1}}.focus\:bg-accent:focus{background-color:var(--accent)}.focus\:text-accent-foreground:focus{color:var(--accent-foreground)}.focus\:ring-0:focus{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(0px + var(--tw-ring-offset-width))var(--tw-ring-color,currentColor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus\:ring-2:focus{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(2px + var(--tw-ring-offset-width))var(--tw-ring-color,currentColor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus\:ring-ring:focus{--tw-ring-color:var(--ring)}.focus\:ring-offset-0:focus{--tw-ring-offset-width:0px;--tw-ring-offset-shadow:var(--tw-ring-inset,)0 0 0 var(--tw-ring-offset-width)var(--tw-ring-offset-color)}.focus\:ring-offset-2:focus{--tw-ring-offset-width:2px;--tw-ring-offset-shadow:var(--tw-ring-inset,)0 0 0 var(--tw-ring-offset-width)var(--tw-ring-offset-color)}.focus\:outline-0:focus{outline-style:var(--tw-outline-style);outline-width:0}.focus\:outline-none:focus{--tw-outline-style:none;outline-style:none}.focus-visible\:relative:focus-visible{position:relative}.focus-visible\:ring-1:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(1px + var(--tw-ring-offset-width))var(--tw-ring-color,currentColor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus-visible\:ring-2:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(2px + var(--tw-ring-offset-width))var(--tw-ring-color,currentColor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus-visible\:ring-ring:focus-visible{--tw-ring-color:var(--ring)}.focus-visible\:ring-offset-2:focus-visible{--tw-ring-offset-width:2px;--tw-ring-offset-shadow:var(--tw-ring-inset,)0 0 0 var(--tw-ring-offset-width)var(--tw-ring-offset-color)}.focus-visible\:outline-none:focus-visible{--tw-outline-style:none;outline-style:none}.active\:right-0:active{right:calc(var(--spacing)*0)}.disabled\:pointer-events-none:disabled{pointer-events:none}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:opacity-50:disabled{opacity:.5}.data-\[disabled\]\:pointer-events-none[data-disabled]{pointer-events:none}.data-\[disabled\]\:opacity-50[data-disabled]{opacity:.5}.data-\[disabled\=true\]\:pointer-events-none[data-disabled=true]{pointer-events:none}.data-\[disabled\=true\]\:opacity-50[data-disabled=true]{opacity:.5}.data-\[selected\=\'true\'\]\:bg-accent[data-selected=true]{background-color:var(--accent)}.data-\[selected\=true\]\:text-accent-foreground[data-selected=true]{color:var(--accent-foreground)}.data-\[side\=bottom\]\:translate-y-1[data-side=bottom]{--tw-translate-y:calc(var(--spacing)*1);translate:var(--tw-translate-x)var(--tw-translate-y)}.data-\[side\=bottom\]\:slide-in-from-top-2[data-side=bottom]{--tw-enter-translate-y:-.5rem}.data-\[side\=left\]\:-translate-x-1[data-side=left]{--tw-translate-x:calc(var(--spacing)*-1);translate:var(--tw-translate-x)var(--tw-translate-y)}.data-\[side\=left\]\:slide-in-from-right-2[data-side=left]{--tw-enter-translate-x:.5rem}.data-\[side\=right\]\:translate-x-1[data-side=right]{--tw-translate-x:calc(var(--spacing)*1);translate:var(--tw-translate-x)var(--tw-translate-y)}.data-\[side\=right\]\:slide-in-from-left-2[data-side=right]{--tw-enter-translate-x:-.5rem}.data-\[side\=top\]\:-translate-y-1[data-side=top]{--tw-translate-y:calc(var(--spacing)*-1);translate:var(--tw-translate-x)var(--tw-translate-y)}.data-\[side\=top\]\:slide-in-from-bottom-2[data-side=top]{--tw-enter-translate-y:.5rem}.data-\[state\=active\]\:bg-background[data-state=active]{background-color:var(--background)}.data-\[state\=active\]\:text-foreground[data-state=active]{color:var(--foreground)}.data-\[state\=active\]\:shadow-sm[data-state=active]{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a),0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.data-\[state\=checked\]\:bg-primary[data-state=checked]{background-color:var(--primary)}.data-\[state\=checked\]\:text-primary-foreground[data-state=checked]{color:var(--primary-foreground)}.data-\[state\=closed\]\:animate-out[data-state=closed]{--tw-exit-opacity:initial;--tw-exit-scale:initial;--tw-exit-rotate:initial;--tw-exit-translate-x:initial;--tw-exit-translate-y:initial;animation-name:exit;animation-duration:.15s}.data-\[state\=closed\]\:fade-out-0[data-state=closed]{--tw-exit-opacity:0}.data-\[state\=closed\]\:slide-out-to-top-\[48\%\][data-state=closed]{--tw-exit-translate-y:-48%}.data-\[state\=closed\]\:zoom-out-95[data-state=closed]{--tw-exit-scale:.95}.data-\[state\=open\]\:bg-accent[data-state=open]{background-color:var(--accent)}.data-\[state\=open\]\:text-muted-foreground[data-state=open]{color:var(--muted-foreground)}.data-\[state\=open\]\:animate-in[data-state=open]{--tw-enter-opacity:initial;--tw-enter-scale:initial;--tw-enter-rotate:initial;--tw-enter-translate-x:initial;--tw-enter-translate-y:initial;animation-name:enter;animation-duration:.15s}.data-\[state\=open\]\:fade-in-0[data-state=open]{--tw-enter-opacity:0}.data-\[state\=open\]\:slide-in-from-top-\[48\%\][data-state=open]{--tw-enter-translate-y:-48%}.data-\[state\=open\]\:zoom-in-95[data-state=open]{--tw-enter-scale:.95}.data-\[state\=selected\]\:bg-muted[data-state=selected]{background-color:var(--muted)}@supports ((-webkit-backdrop-filter:var(--tw)) or (backdrop-filter:var(--tw))){.supports-\[backdrop-filter\]\:bg-background\/60{background-color:color-mix(in oklab,var(--background)60%,transparent)}}@media (width>=40rem){.sm\:max-w-xl{max-width:var(--container-xl)}.sm\:flex-row{flex-direction:row}.sm\:justify-end{justify-content:flex-end}:where(.sm\:space-x-2>:not(:last-child)){--tw-space-x-reverse:0;margin-inline-start:calc(calc(var(--spacing)*2)*var(--tw-space-x-reverse));margin-inline-end:calc(calc(var(--spacing)*2)*calc(1 - var(--tw-space-x-reverse)))}.sm\:rounded-lg{border-radius:var(--radius)}.sm\:px-5{padding-inline:calc(var(--spacing)*5)}.sm\:text-left{text-align:left}}@media (width>=48rem){.md\:inline-block{display:inline-block}.md\:text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}}.dark\:border-destructive:is(.dark *){border-color:var(--destructive)}.\[\&_\[cmdk-group-heading\]\]\:px-2 [cmdk-group-heading]{padding-inline:calc(var(--spacing)*2)}.\[\&_\[cmdk-group-heading\]\]\:py-1\.5 [cmdk-group-heading]{padding-block:calc(var(--spacing)*1.5)}.\[\&_\[cmdk-group-heading\]\]\:text-xs [cmdk-group-heading]{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.\[\&_\[cmdk-group-heading\]\]\:font-medium [cmdk-group-heading]{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.\[\&_\[cmdk-group-heading\]\]\:text-muted-foreground [cmdk-group-heading]{color:var(--muted-foreground)}.\[\&_\[cmdk-group\]\]\:px-2 [cmdk-group]{padding-inline:calc(var(--spacing)*2)}.\[\&_\[cmdk-group\]\:not\(\[hidden\]\)_\~\[cmdk-group\]\]\:pt-0 [cmdk-group]:not([hidden])~[cmdk-group]{padding-top:calc(var(--spacing)*0)}.\[\&_\[cmdk-input-wrapper\]_svg\]\:h-5 [cmdk-input-wrapper] svg{height:calc(var(--spacing)*5)}.\[\&_\[cmdk-input-wrapper\]_svg\]\:w-5 [cmdk-input-wrapper] svg{width:calc(var(--spacing)*5)}.\[\&_\[cmdk-input\]\]\:h-12 [cmdk-input]{height:calc(var(--spacing)*12)}.\[\&_\[cmdk-item\]\]\:px-2 [cmdk-item]{padding-inline:calc(var(--spacing)*2)}.\[\&_\[cmdk-item\]\]\:py-3 [cmdk-item]{padding-block:calc(var(--spacing)*3)}.\[\&_\[cmdk-item\]_svg\]\:h-5 [cmdk-item] svg{height:calc(var(--spacing)*5)}.\[\&_\[cmdk-item\]_svg\]\:w-5 [cmdk-item] svg{width:calc(var(--spacing)*5)}.\[\&_p\]\:leading-relaxed p{--tw-leading:var(--leading-relaxed);line-height:var(--leading-relaxed)}.\[\&_svg\]\:pointer-events-none svg{pointer-events:none}.\[\&_svg\]\:size-4 svg{width:calc(var(--spacing)*4);height:calc(var(--spacing)*4)}.\[\&_svg\]\:shrink-0 svg{flex-shrink:0}.\[\&_tr\]\:border-b tr{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.\[\&_tr\:last-child\]\:border-0 tr:last-child{border-style:var(--tw-border-style);border-width:0}.\[\&\:\:-webkit-inner-spin-button\]\:appearance-none::-webkit-inner-spin-button{-webkit-appearance:none;-moz-appearance:none;appearance:none}.\[\&\:\:-webkit-outer-spin-button\]\:appearance-none::-webkit-outer-spin-button{-webkit-appearance:none;-moz-appearance:none;appearance:none}.\[\&\:has\(\[role\=checkbox\]\)\]\:pr-0:has([role=checkbox]){padding-right:calc(var(--spacing)*0)}.\[\&\>\[role\=checkbox\]\]\:translate-y-\[2px\]>[role=checkbox]{--tw-translate-y:2px;translate:var(--tw-translate-x)var(--tw-translate-y)}.\[\&\>span\]\:line-clamp-1>span{-webkit-line-clamp:1;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.\[\&\>svg\]\:absolute>svg{position:absolute}.\[\&\>svg\]\:top-4>svg{top:calc(var(--spacing)*4)}.\[\&\>svg\]\:left-4>svg{left:calc(var(--spacing)*4)}.\[\&\>svg\]\:text-destructive>svg{color:var(--destructive)}.\[\&\>svg\]\:text-foreground>svg{color:var(--foreground)}.\[\&\>svg\+div\]\:translate-y-\[-3px\]>svg+div{--tw-translate-y:-3px;translate:var(--tw-translate-x)var(--tw-translate-y)}.\[\&\>svg\~\*\]\:pl-7>svg~*{padding-left:calc(var(--spacing)*7)}.\[\&\>tr\]\:last\:border-b-0>tr:last-child{border-bottom-style:var(--tw-border-style);border-bottom-width:0}}:root{--background:#fff;--foreground:#09090b;--card:#fff;--card-foreground:#09090b;--popover:#fff;--popover-foreground:#09090b;--primary:#18181b;--primary-foreground:#fafafa;--secondary:#f4f4f5;--secondary-foreground:#18181b;--muted:#f4f4f5;--muted-foreground:#71717a;--accent:#f4f4f5;--accent-foreground:#18181b;--destructive:#ef4444;--destructive-foreground:#fafafa;--border:#e4e4e7;--input:#e4e4e7;--ring:#09090b;--chart-1:#e76e50;--chart-2:#2a9d90;--chart-3:#274754;--chart-4:#e8c468;--chart-5:#f4a462;--radius:.6rem;--sidebar-background:#fafafa;--sidebar-foreground:#3f3f46;--sidebar-primary:#18181b;--sidebar-primary-foreground:#fafafa;--sidebar-accent:#f4f4f5;--sidebar-accent-foreground:#18181b;--sidebar-border:#e5e7eb;--sidebar-ring:#3b82f6}.dark{--background:#09090b;--foreground:#fafafa;--card:#09090b;--card-foreground:#fafafa;--popover:#09090b;--popover-foreground:#fafafa;--primary:#fafafa;--primary-foreground:#18181b;--secondary:#27272a;--secondary-foreground:#fafafa;--muted:#27272a;--muted-foreground:#a1a1aa;--accent:#27272a;--accent-foreground:#fafafa;--destructive:#7f1d1d;--destructive-foreground:#fafafa;--border:#27272a;--input:#27272a;--ring:#d4d4d8;--chart-1:#2662d9;--chart-2:#2eb88a;--chart-3:#e88c30;--chart-4:#af57db;--chart-5:#e23670;--sidebar-background:#18181b;--sidebar-foreground:#f4f4f5;--sidebar-primary:#1d4ed8;--sidebar-primary-foreground:#fff;--sidebar-accent:#27272a;--sidebar-accent-foreground:#f4f4f5;--sidebar-border:#27272a;--sidebar-ring:#3b82f6}::-webkit-scrollbar{width:10px;height:10px}::-webkit-scrollbar-thumb{background-color:#ccc;border-radius:5px}::-webkit-scrollbar-track{background-color:#f2f2f2}.dark ::-webkit-scrollbar-thumb{background-color:#e6e6e6}.dark ::-webkit-scrollbar-track{background-color:#000}@keyframes enter{0%{opacity:var(--tw-enter-opacity,1);transform:translate3d(var(--tw-enter-translate-x,0),var(--tw-enter-translate-y,0),0)scale3d(var(--tw-enter-scale,1),var(--tw-enter-scale,1),var(--tw-enter-scale,1))rotate(var(--tw-enter-rotate,0))}}@keyframes exit{to{opacity:var(--tw-exit-opacity,1);transform:translate3d(var(--tw-exit-translate-x,0),var(--tw-exit-translate-y,0),0)scale3d(var(--tw-exit-scale,1),var(--tw-exit-scale,1),var(--tw-exit-scale,1))rotate(var(--tw-exit-rotate,0))}}@keyframes spin{to{transform:rotate(360deg)}}@keyframes ping{75%,to{opacity:0;transform:scale(2)}}@keyframes pulse{50%{opacity:.5}}@keyframes bounce{0%,to{animation-timing-function:cubic-bezier(.8,0,1,1);transform:translateY(-25%)}50%{animation-timing-function:cubic-bezier(0,0,.2,1);transform:none}}@keyframes accordion-down{0%{height:0}to{height:var(--radix-accordion-content-height)}}@keyframes accordion-up{0%{height:var(--radix-accordion-content-height)}to{height:0}}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@property --tw-scale-x{syntax:"*";inherits:false;initial-value:1}@property --tw-scale-y{syntax:"*";inherits:false;initial-value:1}@property --tw-scale-z{syntax:"*";inherits:false;initial-value:1}@property --tw-rotate-x{syntax:"*";inherits:false;initial-value:rotateX(0)}@property --tw-rotate-y{syntax:"*";inherits:false;initial-value:rotateY(0)}@property --tw-rotate-z{syntax:"*";inherits:false;initial-value:rotateZ(0)}@property --tw-skew-x{syntax:"*";inherits:false;initial-value:skewX(0)}@property --tw-skew-y{syntax:"*";inherits:false;initial-value:skewY(0)}@property --tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-outline-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-backdrop-blur{syntax:"*";inherits:false}@property --tw-backdrop-brightness{syntax:"*";inherits:false}@property --tw-backdrop-contrast{syntax:"*";inherits:false}@property --tw-backdrop-grayscale{syntax:"*";inherits:false}@property --tw-backdrop-hue-rotate{syntax:"*";inherits:false}@property --tw-backdrop-invert{syntax:"*";inherits:false}@property --tw-backdrop-opacity{syntax:"*";inherits:false}@property --tw-backdrop-saturate{syntax:"*";inherits:false}@property --tw-backdrop-sepia{syntax:"*";inherits:false}@property --tw-duration{syntax:"*";inherits:false}@property --tw-ease{syntax:"*";inherits:false}@property --tw-space-x-reverse{syntax:"*";inherits:false;initial-value:0}:root{--sigma-background-color:#fff;--sigma-controls-background-color:#fff;--sigma-controls-background-color-hover:rgba(0,0,0,.2);--sigma-controls-border-color:rgba(0,0,0,.2);--sigma-controls-color:#000;--sigma-controls-zindex:100;--sigma-controls-margin:5px;--sigma-controls-size:30px}div.react-sigma{height:100%;width:100%;position:relative;background:var(--sigma-background-color)}div.sigma-container{height:100%;width:100%}.react-sigma-controls{position:absolute;z-index:var(--sigma-controls-zindex);border:2px solid var(--sigma-controls-border-color);border-radius:4px;color:var(--sigma-controls-color);background-color:var(--sigma-controls-background-color)}.react-sigma-controls.bottom-right{bottom:var(--sigma-controls-margin);right:var(--sigma-controls-margin)}.react-sigma-controls.bottom-left{bottom:var(--sigma-controls-margin);left:var(--sigma-controls-margin)}.react-sigma-controls.top-right{top:var(--sigma-controls-margin);right:var(--sigma-controls-margin)}.react-sigma-controls.top-left{top:var(--sigma-controls-margin);left:var(--sigma-controls-margin)}.react-sigma-controls:first-child{border-top-left-radius:2px;border-top-right-radius:2px}.react-sigma-controls:last-child{border-bottom-left-radius:2px;border-bottom-right-radius:2px}.react-sigma-control{width:var(--sigma-controls-size);height:var(--sigma-controls-size);line-height:var(--sigma-controls-size);background-color:var(--sigma-controls-background-color);border-bottom:1px solid var(--sigma-controls-border-color)}.react-sigma-control:last-child{border-bottom:none}.react-sigma-control>*{box-sizing:border-box}.react-sigma-control>button{display:block;border:none;margin:0;padding:0;width:var(--sigma-controls-size);height:var(--sigma-controls-size);line-height:var(--sigma-controls-size);background-position:center;background-size:50%;background-repeat:no-repeat;background-color:var(--sigma-controls-background-color);clip:rect(0,0,0,0)}.react-sigma-control>button:hover{background-color:var(--sigma-controls-background-color-hover)}.react-sigma-search{background-color:var(--sigma-controls-background-color)}.react-sigma-search label{visibility:hidden}.react-sigma-search input{color:var(--sigma-controls-color);background-color:var(--sigma-controls-background-color);font-size:1em;width:100%;margin:0;border:none;padding:var(--sigma-controls-margin);box-sizing:border-box}:root{--sigma-grey-color:#ccc}.react-sigma .option.hoverable{cursor:pointer!important}.react-sigma .text-ellipsis{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.react-sigma .react-select__clear-indicator{cursor:pointer!important}.react-sigma .text-muted{color:var(--sigma-grey-color)}.react-sigma .text-italic{font-style:italic}.react-sigma .text-center{text-align:center}.react-sigma .graph-search{min-width:250px}.react-sigma .graph-search .option{padding:2px 8px}.react-sigma .graph-search .dropdown-indicator{font-size:1.25em;padding:4px}.react-sigma .graph-search .option.selected{background-color:var(--sigma-grey-color)}.react-sigma .node .render{position:relative;display:inline-block;width:1em;height:1em;border-radius:1em;background-color:var(--sigma-grey-color);margin-right:8px}.react-sigma .node{display:flex;flex-direction:row;align-items:center}.react-sigma .node .render{flex-grow:0;flex-shrink:0;margin-right:0 .25em}.react-sigma .node .label{flex-grow:1;flex-shrink:1}.react-sigma .edge{display:flex;flex-direction:column;align-items:flex-start;flex-grow:0;flex-shrink:0;flex-wrap:nowrap}.react-sigma .edge .node{font-size:.7em}.react-sigma .edge .body{display:flex;flex-direction:row;flex-grow:1;flex-shrink:1;min-height:.6em}.react-sigma .edge .body .render{display:flex;flex-direction:column;margin:0 2px}.react-sigma .edge .body .render .dash,.react-sigma .edge .body .render .dotted{display:inline-block;width:0;margin:0 2px;border:2px solid #ccc;flex-grow:1;flex-shrink:1}.react-sigma .edge .body .render .dotted{border-style:dotted}.react-sigma .edge .body .render .arrow{width:0;height:0;border-left:.3em solid transparent;border-right:.3em solid transparent;border-top:.6em solid red;flex-shrink:0;flex-grow:0;border-left-width:.3em;border-right-width:.3em}.react-sigma .edge .body .label{flex-grow:1;flex-shrink:1;text-align:center} diff --git a/lightrag/api/webui/assets/index-CGBwpbZt.js b/lightrag/api/webui/assets/index-CGBwpbZt.js deleted file mode 100644 index c53af429..00000000 --- a/lightrag/api/webui/assets/index-CGBwpbZt.js +++ /dev/null @@ -1,1059 +0,0 @@ -var UA=Object.defineProperty;var BA=(e,t,n)=>t in e?UA(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Xr=(e,t,n)=>BA(e,typeof t!="symbol"?t+"":t,n);function IA(e,t){for(var n=0;na[o]})}}}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 o of document.querySelectorAll('link[rel="modulepreload"]'))a(o);new MutationObserver(o=>{for(const s of o)if(s.type==="childList")for(const c of s.addedNodes)c.tagName==="LINK"&&c.rel==="modulepreload"&&a(c)}).observe(document,{childList:!0,subtree:!0});function n(o){const s={};return o.integrity&&(s.integrity=o.integrity),o.referrerPolicy&&(s.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?s.credentials="include":o.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function a(o){if(o.ep)return;o.ep=!0;const s=n(o);fetch(o.href,s)}})();function dn(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function HA(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var n=function a(){return this instanceof a?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(a){var o=Object.getOwnPropertyDescriptor(e,a);Object.defineProperty(n,a,o.get?o:{enumerable:!0,get:function(){return e[a]}})}),n}var Nh={exports:{}},$s={};/** - * @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 Mx;function $A(){if(Mx)return $s;Mx=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(a,o,s){var c=null;if(s!==void 0&&(c=""+s),o.key!==void 0&&(c=""+o.key),"key"in o){s={};for(var u in o)u!=="key"&&(s[u]=o[u])}else s=o;return o=s.ref,{$$typeof:e,type:a,key:c,ref:o!==void 0?o:null,props:s}}return $s.Fragment=t,$s.jsx=n,$s.jsxs=n,$s}var Px;function VA(){return Px||(Px=1,Nh.exports=$A()),Nh.exports}var x=VA(),Oh={exports:{}},Ke={};/** - * @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 Gx;function qA(){if(Gx)return Ke;Gx=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),s=Symbol.for("react.consumer"),c=Symbol.for("react.context"),u=Symbol.for("react.forward_ref"),f=Symbol.for("react.suspense"),h=Symbol.for("react.memo"),m=Symbol.for("react.lazy"),g=Symbol.iterator;function y(G){return G===null||typeof G!="object"?null:(G=g&&G[g]||G["@@iterator"],typeof G=="function"?G:null)}var b={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},S=Object.assign,E={};function _(G,H,O){this.props=G,this.context=H,this.refs=E,this.updater=O||b}_.prototype.isReactComponent={},_.prototype.setState=function(G,H){if(typeof G!="object"&&typeof G!="function"&&G!=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,G,H,"setState")},_.prototype.forceUpdate=function(G){this.updater.enqueueForceUpdate(this,G,"forceUpdate")};function N(){}N.prototype=_.prototype;function T(G,H,O){this.props=G,this.context=H,this.refs=E,this.updater=O||b}var A=T.prototype=new N;A.constructor=T,S(A,_.prototype),A.isPureReactComponent=!0;var D=Array.isArray,k={H:null,A:null,T:null,S:null},M=Object.prototype.hasOwnProperty;function R(G,H,O,$,W,re){return O=re.ref,{$$typeof:e,type:G,key:H,ref:O!==void 0?O:null,props:re}}function U(G,H){return R(G.type,H,void 0,void 0,void 0,G.props)}function L(G){return typeof G=="object"&&G!==null&&G.$$typeof===e}function I(G){var H={"=":"=0",":":"=2"};return"$"+G.replace(/[=:]/g,function(O){return H[O]})}var q=/\/+/g;function Y(G,H){return typeof G=="object"&&G!==null&&G.key!=null?I(""+G.key):H.toString(36)}function B(){}function X(G){switch(G.status){case"fulfilled":return G.value;case"rejected":throw G.reason;default:switch(typeof G.status=="string"?G.then(B,B):(G.status="pending",G.then(function(H){G.status==="pending"&&(G.status="fulfilled",G.value=H)},function(H){G.status==="pending"&&(G.status="rejected",G.reason=H)})),G.status){case"fulfilled":return G.value;case"rejected":throw G.reason}}throw G}function ne(G,H,O,$,W){var re=typeof G;(re==="undefined"||re==="boolean")&&(G=null);var de=!1;if(G===null)de=!0;else switch(re){case"bigint":case"string":case"number":de=!0;break;case"object":switch(G.$$typeof){case e:case t:de=!0;break;case m:return de=G._init,ne(de(G._payload),H,O,$,W)}}if(de)return W=W(G),de=$===""?"."+Y(G,0):$,D(W)?(O="",de!=null&&(O=de.replace(q,"$&/")+"/"),ne(W,H,O,"",function(Te){return Te})):W!=null&&(L(W)&&(W=U(W,O+(W.key==null||G&&G.key===W.key?"":(""+W.key).replace(q,"$&/")+"/")+de)),H.push(W)),1;de=0;var ie=$===""?".":$+":";if(D(G))for(var oe=0;oe>>1,G=F[K];if(0>>1;Ko($,j))Wo(re,$)?(F[K]=re,F[W]=j,K=W):(F[K]=$,F[O]=j,K=O);else if(Wo(re,j))F[K]=re,F[W]=j,K=W;else break e}}return z}function o(F,z){var j=F.sortIndex-z.sortIndex;return j!==0?j:F.id-z.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var s=performance;e.unstable_now=function(){return s.now()}}else{var c=Date,u=c.now();e.unstable_now=function(){return c.now()-u}}var f=[],h=[],m=1,g=null,y=3,b=!1,S=!1,E=!1,_=typeof setTimeout=="function"?setTimeout:null,N=typeof clearTimeout=="function"?clearTimeout:null,T=typeof setImmediate<"u"?setImmediate:null;function A(F){for(var z=n(h);z!==null;){if(z.callback===null)a(h);else if(z.startTime<=F)a(h),z.sortIndex=z.expirationTime,t(f,z);else break;z=n(h)}}function D(F){if(E=!1,A(F),!S)if(n(f)!==null)S=!0,X();else{var z=n(h);z!==null&&ne(D,z.startTime-F)}}var k=!1,M=-1,R=5,U=-1;function L(){return!(e.unstable_now()-UF&&L());){var K=g.callback;if(typeof K=="function"){g.callback=null,y=g.priorityLevel;var G=K(g.expirationTime<=F);if(F=e.unstable_now(),typeof G=="function"){g.callback=G,A(F),z=!0;break t}g===n(f)&&a(f),A(F)}else a(f);g=n(f)}if(g!==null)z=!0;else{var H=n(h);H!==null&&ne(D,H.startTime-F),z=!1}}break e}finally{g=null,y=j,b=!1}z=void 0}}finally{z?q():k=!1}}}var q;if(typeof T=="function")q=function(){T(I)};else if(typeof MessageChannel<"u"){var Y=new MessageChannel,B=Y.port2;Y.port1.onmessage=I,q=function(){B.postMessage(null)}}else q=function(){_(I,0)};function X(){k||(k=!0,q())}function ne(F,z){M=_(function(){F(e.unstable_now())},z)}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(F){F.callback=null},e.unstable_continueExecution=function(){S||b||(S=!0,X())},e.unstable_forceFrameRate=function(F){0>F||125K?(F.sortIndex=j,t(h,F),n(f)===null&&F===n(h)&&(E?(N(M),M=-1):E=!0,ne(D,j-K))):(F.sortIndex=G,t(f,F),S||b||(S=!0,X())),F},e.unstable_shouldYield=L,e.unstable_wrapCallback=function(F){var z=y;return function(){var j=y;y=z;try{return F.apply(this,arguments)}finally{y=j}}}}(zh)),zh}var Bx;function XA(){return Bx||(Bx=1,Lh.exports=WA()),Lh.exports}var Mh={exports:{}},nn={};/** - * @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 Ix;function KA(){if(Ix)return nn;Ix=1;var e=$u();function t(f){var h="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(),Mh.exports=KA(),Mh.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 $x;function ZA(){if($x)return Vs;$x=1;var e=XA(),t=$u(),n=F1();function a(r){var i="https://react.dev/errors/"+r;if(1)":-1p||V[d]!==Q[p]){var fe=` -`+V[d].replace(" at new "," at ");return r.displayName&&fe.includes("")&&(fe=fe.replace("",r.displayName)),fe}while(1<=d&&0<=p);break}}}finally{X=!1,Error.prepareStackTrace=l}return(l=r?r.displayName||r.name:"")?B(l):""}function F(r){switch(r.tag){case 26:case 27:case 5:return B(r.type);case 16:return B("Lazy");case 13:return B("Suspense");case 19:return B("SuspenseList");case 0:case 15:return r=ne(r.type,!1),r;case 11:return r=ne(r.type.render,!1),r;case 1:return r=ne(r.type,!0),r;default:return""}}function z(r){try{var i="";do i+=F(r),r=r.return;while(r);return i}catch(l){return` -Error generating stack: `+l.message+` -`+l.stack}}function j(r){var i=r,l=r;if(r.alternate)for(;i.return;)i=i.return;else{r=i;do i=r,i.flags&4098&&(l=i.return),r=i.return;while(r)}return i.tag===3?l:null}function K(r){if(r.tag===13){var i=r.memoizedState;if(i===null&&(r=r.alternate,r!==null&&(i=r.memoizedState)),i!==null)return i.dehydrated}return null}function G(r){if(j(r)!==r)throw Error(a(188))}function H(r){var i=r.alternate;if(!i){if(i=j(r),i===null)throw Error(a(188));return i!==r?null:r}for(var l=r,d=i;;){var p=l.return;if(p===null)break;var v=p.alternate;if(v===null){if(d=p.return,d!==null){l=d;continue}break}if(p.child===v.child){for(v=p.child;v;){if(v===l)return G(p),r;if(v===d)return G(p),i;v=v.sibling}throw Error(a(188))}if(l.return!==d.return)l=p,d=v;else{for(var C=!1,P=p.child;P;){if(P===l){C=!0,l=p,d=v;break}if(P===d){C=!0,d=p,l=v;break}P=P.sibling}if(!C){for(P=v.child;P;){if(P===l){C=!0,l=v,d=p;break}if(P===d){C=!0,d=v,l=p;break}P=P.sibling}if(!C)throw Error(a(189))}}if(l.alternate!==d)throw Error(a(190))}if(l.tag!==3)throw Error(a(188));return l.stateNode.current===l?r:i}function O(r){var i=r.tag;if(i===5||i===26||i===27||i===6)return r;for(r=r.child;r!==null;){if(i=O(r),i!==null)return i;r=r.sibling}return null}var $=Array.isArray,W=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,re={pending:!1,data:null,method:null,action:null},de=[],ie=-1;function oe(r){return{current:r}}function Te(r){0>ie||(r.current=de[ie],de[ie]=null,ie--)}function he(r,i){ie++,de[ie]=r.current,r.current=i}var Se=oe(null),be=oe(null),je=oe(null),Ce=oe(null);function ye(r,i){switch(he(je,i),he(be,r),he(Se,null),r=i.nodeType,r){case 9:case 11:i=(i=i.documentElement)&&(i=i.namespaceURI)?dx(i):0;break;default:if(r=r===8?i.parentNode:i,i=r.tagName,r=r.namespaceURI)r=dx(r),i=fx(r,i);else switch(i){case"svg":i=1;break;case"math":i=2;break;default:i=0}}Te(Se),he(Se,i)}function J(){Te(Se),Te(be),Te(je)}function le(r){r.memoizedState!==null&&he(Ce,r);var i=Se.current,l=fx(i,r.type);i!==l&&(he(be,r),he(Se,l))}function _e(r){be.current===r&&(Te(Se),Te(be)),Ce.current===r&&(Te(Ce),Fs._currentValue=re)}var pe=Object.prototype.hasOwnProperty,Ee=e.unstable_scheduleCallback,te=e.unstable_cancelCallback,Fe=e.unstable_shouldYield,Pe=e.unstable_requestPaint,me=e.unstable_now,Ae=e.unstable_getCurrentPriorityLevel,Oe=e.unstable_ImmediatePriority,He=e.unstable_UserBlockingPriority,it=e.unstable_NormalPriority,Tt=e.unstable_LowPriority,bt=e.unstable_IdlePriority,qt=e.log,fn=e.unstable_setDisableYieldValue,Gt=null,rt=null;function Tn(r){if(rt&&typeof rt.onCommitFiberRoot=="function")try{rt.onCommitFiberRoot(Gt,r,void 0,(r.current.flags&128)===128)}catch{}}function xt(r){if(typeof qt=="function"&&fn(r),rt&&typeof rt.setStrictMode=="function")try{rt.setStrictMode(Gt,r)}catch{}}var Lt=Math.clz32?Math.clz32:Dl,Ya=Math.log,Ni=Math.LN2;function Dl(r){return r>>>=0,r===0?32:31-(Ya(r)/Ni|0)|0}var Oi=128,la=4194304;function Jt(r){var i=r&42;if(i!==0)return i;switch(r&-r){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128: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 r&4194176;case 4194304:case 8388608:case 16777216:case 33554432:return r&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return r}}function ji(r,i){var l=r.pendingLanes;if(l===0)return 0;var d=0,p=r.suspendedLanes,v=r.pingedLanes,C=r.warmLanes;r=r.finishedLanes!==0;var P=l&134217727;return P!==0?(l=P&~p,l!==0?d=Jt(l):(v&=P,v!==0?d=Jt(v):r||(C=P&~C,C!==0&&(d=Jt(C))))):(P=l&~p,P!==0?d=Jt(P):v!==0?d=Jt(v):r||(C=l&~C,C!==0&&(d=Jt(C)))),d===0?0:i!==0&&i!==d&&!(i&p)&&(p=d&-d,C=i&-i,p>=C||p===32&&(C&4194176)!==0)?i:d}function qe(r,i){return(r.pendingLanes&~(r.suspendedLanes&~r.pingedLanes)&i)===0}function lt(r,i){switch(r){case 1:case 2:case 4:case 8:return i+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 i+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function pt(){var r=Oi;return Oi<<=1,!(Oi&4194176)&&(Oi=128),r}function hn(){var r=la;return la<<=1,!(la&62914560)&&(la=4194304),r}function sn(r){for(var i=[],l=0;31>l;l++)i.push(r);return i}function pn(r,i){r.pendingLanes|=i,i!==268435456&&(r.suspendedLanes=0,r.pingedLanes=0,r.warmLanes=0)}function Nr(r,i,l,d,p,v){var C=r.pendingLanes;r.pendingLanes=l,r.suspendedLanes=0,r.pingedLanes=0,r.warmLanes=0,r.expiredLanes&=l,r.entangledLanes&=l,r.errorRecoveryDisabledLanes&=l,r.shellSuspendCounter=0;var P=r.entanglements,V=r.expirationTimes,Q=r.hiddenUpdates;for(l=C&~l;0"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),jR=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]*$"),fv={},hv={};function LR(r){return pe.call(hv,r)?!0:pe.call(fv,r)?!1:jR.test(r)?hv[r]=!0:(fv[r]=!0,!1)}function Nl(r,i,l){if(LR(i))if(l===null)r.removeAttribute(i);else{switch(typeof l){case"undefined":case"function":case"symbol":r.removeAttribute(i);return;case"boolean":var d=i.toLowerCase().slice(0,5);if(d!=="data-"&&d!=="aria-"){r.removeAttribute(i);return}}r.setAttribute(i,""+l)}}function Ol(r,i,l){if(l===null)r.removeAttribute(i);else{switch(typeof l){case"undefined":case"function":case"symbol":case"boolean":r.removeAttribute(i);return}r.setAttribute(i,""+l)}}function jr(r,i,l,d){if(d===null)r.removeAttribute(l);else{switch(typeof d){case"undefined":case"function":case"symbol":case"boolean":r.removeAttribute(l);return}r.setAttributeNS(i,l,""+d)}}function zn(r){switch(typeof r){case"bigint":case"boolean":case"number":case"string":case"undefined":return r;case"object":return r;default:return""}}function pv(r){var i=r.type;return(r=r.nodeName)&&r.toLowerCase()==="input"&&(i==="checkbox"||i==="radio")}function zR(r){var i=pv(r)?"checked":"value",l=Object.getOwnPropertyDescriptor(r.constructor.prototype,i),d=""+r[i];if(!r.hasOwnProperty(i)&&typeof l<"u"&&typeof l.get=="function"&&typeof l.set=="function"){var p=l.get,v=l.set;return Object.defineProperty(r,i,{configurable:!0,get:function(){return p.call(this)},set:function(C){d=""+C,v.call(this,C)}}),Object.defineProperty(r,i,{enumerable:l.enumerable}),{getValue:function(){return d},setValue:function(C){d=""+C},stopTracking:function(){r._valueTracker=null,delete r[i]}}}}function jl(r){r._valueTracker||(r._valueTracker=zR(r))}function mv(r){if(!r)return!1;var i=r._valueTracker;if(!i)return!0;var l=i.getValue(),d="";return r&&(d=pv(r)?r.checked?"true":"false":r.value),r=d,r!==l?(i.setValue(r),!0):!1}function Ll(r){if(r=r||(typeof document<"u"?document:void 0),typeof r>"u")return null;try{return r.activeElement||r.body}catch{return r.body}}var MR=/[\n"\\]/g;function Mn(r){return r.replace(MR,function(i){return"\\"+i.charCodeAt(0).toString(16)+" "})}function Ad(r,i,l,d,p,v,C,P){r.name="",C!=null&&typeof C!="function"&&typeof C!="symbol"&&typeof C!="boolean"?r.type=C:r.removeAttribute("type"),i!=null?C==="number"?(i===0&&r.value===""||r.value!=i)&&(r.value=""+zn(i)):r.value!==""+zn(i)&&(r.value=""+zn(i)):C!=="submit"&&C!=="reset"||r.removeAttribute("value"),i!=null?kd(r,C,zn(i)):l!=null?kd(r,C,zn(l)):d!=null&&r.removeAttribute("value"),p==null&&v!=null&&(r.defaultChecked=!!v),p!=null&&(r.checked=p&&typeof p!="function"&&typeof p!="symbol"),P!=null&&typeof P!="function"&&typeof P!="symbol"&&typeof P!="boolean"?r.name=""+zn(P):r.removeAttribute("name")}function gv(r,i,l,d,p,v,C,P){if(v!=null&&typeof v!="function"&&typeof v!="symbol"&&typeof v!="boolean"&&(r.type=v),i!=null||l!=null){if(!(v!=="submit"&&v!=="reset"||i!=null))return;l=l!=null?""+zn(l):"",i=i!=null?""+zn(i):l,P||i===r.value||(r.value=i),r.defaultValue=i}d=d??p,d=typeof d!="function"&&typeof d!="symbol"&&!!d,r.checked=P?r.checked:!!d,r.defaultChecked=!!d,C!=null&&typeof C!="function"&&typeof C!="symbol"&&typeof C!="boolean"&&(r.name=C)}function kd(r,i,l){i==="number"&&Ll(r.ownerDocument)===r||r.defaultValue===""+l||(r.defaultValue=""+l)}function Gi(r,i,l,d){if(r=r.options,i){i={};for(var p=0;p=rs),kv=" ",Dv=!1;function Nv(r,i){switch(r){case"keyup":return u2.indexOf(i.keyCode)!==-1;case"keydown":return i.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Ov(r){return r=r.detail,typeof r=="object"&&"data"in r?r.data:null}var Ii=!1;function f2(r,i){switch(r){case"compositionend":return Ov(i);case"keypress":return i.which!==32?null:(Dv=!0,kv);case"textInput":return r=i.data,r===kv&&Dv?null:r;default:return null}}function h2(r,i){if(Ii)return r==="compositionend"||!Ud&&Nv(r,i)?(r=Sv(),Ml=zd=ua=null,Ii=!1,r):null;switch(r){case"paste":return null;case"keypress":if(!(i.ctrlKey||i.altKey||i.metaKey)||i.ctrlKey&&i.altKey){if(i.char&&1=i)return{node:l,offset:i-r};r=d}e:{for(;l;){if(l.nextSibling){l=l.nextSibling;break e}l=l.parentNode}l=void 0}l=Uv(l)}}function Iv(r,i){return r&&i?r===i?!0:r&&r.nodeType===3?!1:i&&i.nodeType===3?Iv(r,i.parentNode):"contains"in r?r.contains(i):r.compareDocumentPosition?!!(r.compareDocumentPosition(i)&16):!1:!1}function Hv(r){r=r!=null&&r.ownerDocument!=null&&r.ownerDocument.defaultView!=null?r.ownerDocument.defaultView:window;for(var i=Ll(r.document);i instanceof r.HTMLIFrameElement;){try{var l=typeof i.contentWindow.location.href=="string"}catch{l=!1}if(l)r=i.contentWindow;else break;i=Ll(r.document)}return i}function Hd(r){var i=r&&r.nodeName&&r.nodeName.toLowerCase();return i&&(i==="input"&&(r.type==="text"||r.type==="search"||r.type==="tel"||r.type==="url"||r.type==="password")||i==="textarea"||r.contentEditable==="true")}function w2(r,i){var l=Hv(i);i=r.focusedElem;var d=r.selectionRange;if(l!==i&&i&&i.ownerDocument&&Iv(i.ownerDocument.documentElement,i)){if(d!==null&&Hd(i)){if(r=d.start,l=d.end,l===void 0&&(l=r),"selectionStart"in i)i.selectionStart=r,i.selectionEnd=Math.min(l,i.value.length);else if(l=(r=i.ownerDocument||document)&&r.defaultView||window,l.getSelection){l=l.getSelection();var p=i.textContent.length,v=Math.min(d.start,p);d=d.end===void 0?v:Math.min(d.end,p),!l.extend&&v>d&&(p=d,d=v,v=p),p=Bv(i,v);var C=Bv(i,d);p&&C&&(l.rangeCount!==1||l.anchorNode!==p.node||l.anchorOffset!==p.offset||l.focusNode!==C.node||l.focusOffset!==C.offset)&&(r=r.createRange(),r.setStart(p.node,p.offset),l.removeAllRanges(),v>d?(l.addRange(r),l.extend(C.node,C.offset)):(r.setEnd(C.node,C.offset),l.addRange(r)))}}for(r=[],l=i;l=l.parentNode;)l.nodeType===1&&r.push({element:l,left:l.scrollLeft,top:l.scrollTop});for(typeof i.focus=="function"&&i.focus(),i=0;i=document.documentMode,Hi=null,$d=null,ss=null,Vd=!1;function $v(r,i,l){var d=l.window===l?l.document:l.nodeType===9?l:l.ownerDocument;Vd||Hi==null||Hi!==Ll(d)||(d=Hi,"selectionStart"in d&&Hd(d)?d={start:d.selectionStart,end:d.selectionEnd}:(d=(d.ownerDocument&&d.ownerDocument.defaultView||window).getSelection(),d={anchorNode:d.anchorNode,anchorOffset:d.anchorOffset,focusNode:d.focusNode,focusOffset:d.focusOffset}),ss&&os(ss,d)||(ss=d,d=Sc($d,"onSelect"),0>=C,p-=C,Lr=1<<32-Lt(i)+p|l<Ve?(It=Ue,Ue=null):It=Ue.sibling;var st=se(ee,Ue,ae[Ve],ge);if(st===null){Ue===null&&(Ue=It);break}r&&Ue&&st.alternate===null&&i(ee,Ue),Z=v(st,Z,Ve),Qe===null?ze=st:Qe.sibling=st,Qe=st,Ue=It}if(Ve===ae.length)return l(ee,Ue),ot&&ei(ee,Ve),ze;if(Ue===null){for(;VeVe?(It=Ue,Ue=null):It=Ue.sibling;var Da=se(ee,Ue,st.value,ge);if(Da===null){Ue===null&&(Ue=It);break}r&&Ue&&Da.alternate===null&&i(ee,Ue),Z=v(Da,Z,Ve),Qe===null?ze=Da:Qe.sibling=Da,Qe=Da,Ue=It}if(st.done)return l(ee,Ue),ot&&ei(ee,Ve),ze;if(Ue===null){for(;!st.done;Ve++,st=ae.next())st=xe(ee,st.value,ge),st!==null&&(Z=v(st,Z,Ve),Qe===null?ze=st:Qe.sibling=st,Qe=st);return ot&&ei(ee,Ve),ze}for(Ue=d(Ue);!st.done;Ve++,st=ae.next())st=ue(Ue,ee,Ve,st.value,ge),st!==null&&(r&&st.alternate!==null&&Ue.delete(st.key===null?Ve:st.key),Z=v(st,Z,Ve),Qe===null?ze=st:Qe.sibling=st,Qe=st);return r&&Ue.forEach(function(FA){return i(ee,FA)}),ot&&ei(ee,Ve),ze}function At(ee,Z,ae,ge){if(typeof ae=="object"&&ae!==null&&ae.type===f&&ae.key===null&&(ae=ae.props.children),typeof ae=="object"&&ae!==null){switch(ae.$$typeof){case c:e:{for(var ze=ae.key;Z!==null;){if(Z.key===ze){if(ze=ae.type,ze===f){if(Z.tag===7){l(ee,Z.sibling),ge=p(Z,ae.props.children),ge.return=ee,ee=ge;break e}}else if(Z.elementType===ze||typeof ze=="object"&&ze!==null&&ze.$$typeof===T&&sy(ze)===Z.type){l(ee,Z.sibling),ge=p(Z,ae.props),ps(ge,ae),ge.return=ee,ee=ge;break e}l(ee,Z);break}else i(ee,Z);Z=Z.sibling}ae.type===f?(ge=di(ae.props.children,ee.mode,ge,ae.key),ge.return=ee,ee=ge):(ge=hc(ae.type,ae.key,ae.props,null,ee.mode,ge),ps(ge,ae),ge.return=ee,ee=ge)}return C(ee);case u:e:{for(ze=ae.key;Z!==null;){if(Z.key===ze)if(Z.tag===4&&Z.stateNode.containerInfo===ae.containerInfo&&Z.stateNode.implementation===ae.implementation){l(ee,Z.sibling),ge=p(Z,ae.children||[]),ge.return=ee,ee=ge;break e}else{l(ee,Z);break}else i(ee,Z);Z=Z.sibling}ge=Wf(ae,ee.mode,ge),ge.return=ee,ee=ge}return C(ee);case T:return ze=ae._init,ae=ze(ae._payload),At(ee,Z,ae,ge)}if($(ae))return Ge(ee,Z,ae,ge);if(M(ae)){if(ze=M(ae),typeof ze!="function")throw Error(a(150));return ae=ze.call(ae),Ye(ee,Z,ae,ge)}if(typeof ae.then=="function")return At(ee,Z,Wl(ae),ge);if(ae.$$typeof===b)return At(ee,Z,uc(ee,ae),ge);Xl(ee,ae)}return typeof ae=="string"&&ae!==""||typeof ae=="number"||typeof ae=="bigint"?(ae=""+ae,Z!==null&&Z.tag===6?(l(ee,Z.sibling),ge=p(Z,ae),ge.return=ee,ee=ge):(l(ee,Z),ge=Yf(ae,ee.mode,ge),ge.return=ee,ee=ge),C(ee)):l(ee,Z)}return function(ee,Z,ae,ge){try{hs=0;var ze=At(ee,Z,ae,ge);return Xi=null,ze}catch(Ue){if(Ue===ds)throw Ue;var Qe=$n(29,Ue,null,ee.mode);return Qe.lanes=ge,Qe.return=ee,Qe}finally{}}}var ni=ly(!0),cy=ly(!1),Ki=oe(null),Kl=oe(0);function uy(r,i){r=qr,he(Kl,r),he(Ki,i),qr=r|i.baseLanes}function Jd(){he(Kl,qr),he(Ki,Ki.current)}function ef(){qr=Kl.current,Te(Ki),Te(Kl)}var Bn=oe(null),mr=null;function fa(r){var i=r.alternate;he(zt,zt.current&1),he(Bn,r),mr===null&&(i===null||Ki.current!==null||i.memoizedState!==null)&&(mr=r)}function dy(r){if(r.tag===22){if(he(zt,zt.current),he(Bn,r),mr===null){var i=r.alternate;i!==null&&i.memoizedState!==null&&(mr=r)}}else ha()}function ha(){he(zt,zt.current),he(Bn,Bn.current)}function Mr(r){Te(Bn),mr===r&&(mr=null),Te(zt)}var zt=oe(0);function Zl(r){for(var i=r;i!==null;){if(i.tag===13){var l=i.memoizedState;if(l!==null&&(l=l.dehydrated,l===null||l.data==="$?"||l.data==="$!"))return i}else if(i.tag===19&&i.memoizedProps.revealOrder!==void 0){if(i.flags&128)return i}else if(i.child!==null){i.child.return=i,i=i.child;continue}if(i===r)break;for(;i.sibling===null;){if(i.return===null||i.return===r)return null;i=i.return}i.sibling.return=i.return,i=i.sibling}return null}var C2=typeof AbortController<"u"?AbortController:function(){var r=[],i=this.signal={aborted:!1,addEventListener:function(l,d){r.push(d)}};this.abort=function(){i.aborted=!0,r.forEach(function(l){return l()})}},R2=e.unstable_scheduleCallback,A2=e.unstable_NormalPriority,Mt={$$typeof:b,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function tf(){return{controller:new C2,data:new Map,refCount:0}}function ms(r){r.refCount--,r.refCount===0&&R2(A2,function(){r.controller.abort()})}var gs=null,nf=0,Zi=0,Qi=null;function k2(r,i){if(gs===null){var l=gs=[];nf=0,Zi=ch(),Qi={status:"pending",value:void 0,then:function(d){l.push(d)}}}return nf++,i.then(fy,fy),i}function fy(){if(--nf===0&&gs!==null){Qi!==null&&(Qi.status="fulfilled");var r=gs;gs=null,Zi=0,Qi=null;for(var i=0;iv?v:8;var C=L.T,P={};L.T=P,xf(r,!1,i,l);try{var V=p(),Q=L.S;if(Q!==null&&Q(P,V),V!==null&&typeof V=="object"&&typeof V.then=="function"){var fe=D2(V,d);bs(r,i,fe,Dn(r))}else bs(r,i,d,Dn(r))}catch(xe){bs(r,i,{then:function(){},status:"rejected",reason:xe},Dn())}finally{W.p=v,L.T=C}}function z2(){}function yf(r,i,l,d){if(r.tag!==5)throw Error(a(476));var p=Hy(r).queue;Iy(r,p,i,re,l===null?z2:function(){return $y(r),l(d)})}function Hy(r){var i=r.memoizedState;if(i!==null)return i;i={memoizedState:re,baseState:re,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Pr,lastRenderedState:re},next:null};var l={};return i.next={memoizedState:l,baseState:l,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Pr,lastRenderedState:l},next:null},r.memoizedState=i,r=r.alternate,r!==null&&(r.memoizedState=i),i}function $y(r){var i=Hy(r).next.queue;bs(r,i,{},Dn())}function bf(){return tn(Fs)}function Vy(){return Ot().memoizedState}function qy(){return Ot().memoizedState}function M2(r){for(var i=r.return;i!==null;){switch(i.tag){case 24:case 3:var l=Dn();r=ya(l);var d=ba(i,r,l);d!==null&&(cn(d,i,l),Es(d,i,l)),i={cache:tf()},r.payload=i;return}i=i.return}}function P2(r,i,l){var d=Dn();l={lane:d,revertLane:0,action:l,hasEagerState:!1,eagerState:null,next:null},oc(r)?Wy(i,l):(l=Wd(r,i,l,d),l!==null&&(cn(l,r,d),Xy(l,i,d)))}function Yy(r,i,l){var d=Dn();bs(r,i,l,d)}function bs(r,i,l,d){var p={lane:d,revertLane:0,action:l,hasEagerState:!1,eagerState:null,next:null};if(oc(r))Wy(i,p);else{var v=r.alternate;if(r.lanes===0&&(v===null||v.lanes===0)&&(v=i.lastRenderedReducer,v!==null))try{var C=i.lastRenderedState,P=v(C,l);if(p.hasEagerState=!0,p.eagerState=P,Cn(P,C))return Hl(r,i,p,0),vt===null&&Il(),!1}catch{}finally{}if(l=Wd(r,i,p,d),l!==null)return cn(l,r,d),Xy(l,i,d),!0}return!1}function xf(r,i,l,d){if(d={lane:2,revertLane:ch(),action:d,hasEagerState:!1,eagerState:null,next:null},oc(r)){if(i)throw Error(a(479))}else i=Wd(r,l,d,2),i!==null&&cn(i,r,2)}function oc(r){var i=r.alternate;return r===Ze||i!==null&&i===Ze}function Wy(r,i){Ji=Jl=!0;var l=r.pending;l===null?i.next=i:(i.next=l.next,l.next=i),r.pending=i}function Xy(r,i,l){if(l&4194176){var d=i.lanes;d&=r.pendingLanes,l|=d,i.lanes=l,Qn(r,l)}}var gr={readContext:tn,use:nc,useCallback:kt,useContext:kt,useEffect:kt,useImperativeHandle:kt,useLayoutEffect:kt,useInsertionEffect:kt,useMemo:kt,useReducer:kt,useRef:kt,useState:kt,useDebugValue:kt,useDeferredValue:kt,useTransition:kt,useSyncExternalStore:kt,useId:kt};gr.useCacheRefresh=kt,gr.useMemoCache=kt,gr.useHostTransitionStatus=kt,gr.useFormState=kt,gr.useActionState=kt,gr.useOptimistic=kt;var ii={readContext:tn,use:nc,useCallback:function(r,i){return yn().memoizedState=[r,i===void 0?null:i],r},useContext:tn,useEffect:Ly,useImperativeHandle:function(r,i,l){l=l!=null?l.concat([r]):null,ac(4194308,4,Py.bind(null,i,r),l)},useLayoutEffect:function(r,i){return ac(4194308,4,r,i)},useInsertionEffect:function(r,i){ac(4,2,r,i)},useMemo:function(r,i){var l=yn();i=i===void 0?null:i;var d=r();if(ai){xt(!0);try{r()}finally{xt(!1)}}return l.memoizedState=[d,i],d},useReducer:function(r,i,l){var d=yn();if(l!==void 0){var p=l(i);if(ai){xt(!0);try{l(i)}finally{xt(!1)}}}else p=i;return d.memoizedState=d.baseState=p,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:r,lastRenderedState:p},d.queue=r,r=r.dispatch=P2.bind(null,Ze,r),[d.memoizedState,r]},useRef:function(r){var i=yn();return r={current:r},i.memoizedState=r},useState:function(r){r=hf(r);var i=r.queue,l=Yy.bind(null,Ze,i);return i.dispatch=l,[r.memoizedState,l]},useDebugValue:gf,useDeferredValue:function(r,i){var l=yn();return vf(l,r,i)},useTransition:function(){var r=hf(!1);return r=Iy.bind(null,Ze,r.queue,!0,!1),yn().memoizedState=r,[!1,r]},useSyncExternalStore:function(r,i,l){var d=Ze,p=yn();if(ot){if(l===void 0)throw Error(a(407));l=l()}else{if(l=i(),vt===null)throw Error(a(349));nt&60||yy(d,i,l)}p.memoizedState=l;var v={value:l,getSnapshot:i};return p.queue=v,Ly(xy.bind(null,d,v,r),[r]),d.flags|=2048,to(9,by.bind(null,d,v,l,i),{destroy:void 0},null),l},useId:function(){var r=yn(),i=vt.identifierPrefix;if(ot){var l=zr,d=Lr;l=(d&~(1<<32-Lt(d)-1)).toString(32)+l,i=":"+i+"R"+l,l=ec++,0 title"))),Xt(v,d,l),v[en]=r,Ft(v),d=v;break e;case"link":var C=Ex("link","href",p).get(d+(l.href||""));if(C){for(var P=0;P<\/script>",r=r.removeChild(r.firstChild);break;case"select":r=typeof d.is=="string"?p.createElement("select",{is:d.is}):p.createElement("select"),d.multiple?r.multiple=!0:d.size&&(r.size=d.size);break;default:r=typeof d.is=="string"?p.createElement(l,{is:d.is}):p.createElement(l)}}r[en]=i,r[gn]=d;e:for(p=i.child;p!==null;){if(p.tag===5||p.tag===6)r.appendChild(p.stateNode);else if(p.tag!==4&&p.tag!==27&&p.child!==null){p.child.return=p,p=p.child;continue}if(p===i)break e;for(;p.sibling===null;){if(p.return===null||p.return===i)break e;p=p.return}p.sibling.return=p.return,p=p.sibling}i.stateNode=r;e:switch(Xt(r,l,d),l){case"button":case"input":case"select":case"textarea":r=!!d.autoFocus;break e;case"img":r=!0;break e;default:r=!1}r&&$r(i)}}return wt(i),i.flags&=-16777217,null;case 6:if(r&&i.stateNode!=null)r.memoizedProps!==d&&$r(i);else{if(typeof d!="string"&&i.stateNode===null)throw Error(a(166));if(r=je.current,ls(i)){if(r=i.stateNode,l=i.memoizedProps,d=null,p=ln,p!==null)switch(p.tag){case 27:case 5:d=p.memoizedProps}r[en]=i,r=!!(r.nodeValue===l||d!==null&&d.suppressHydrationWarning===!0||ux(r.nodeValue,l)),r||ti(i)}else r=Tc(r).createTextNode(d),r[en]=i,i.stateNode=r}return wt(i),null;case 13:if(d=i.memoizedState,r===null||r.memoizedState!==null&&r.memoizedState.dehydrated!==null){if(p=ls(i),d!==null&&d.dehydrated!==null){if(r===null){if(!p)throw Error(a(318));if(p=i.memoizedState,p=p!==null?p.dehydrated:null,!p)throw Error(a(317));p[en]=i}else cs(),!(i.flags&128)&&(i.memoizedState=null),i.flags|=4;wt(i),p=!1}else er!==null&&(nh(er),er=null),p=!0;if(!p)return i.flags&256?(Mr(i),i):(Mr(i),null)}if(Mr(i),i.flags&128)return i.lanes=l,i;if(l=d!==null,r=r!==null&&r.memoizedState!==null,l){d=i.child,p=null,d.alternate!==null&&d.alternate.memoizedState!==null&&d.alternate.memoizedState.cachePool!==null&&(p=d.alternate.memoizedState.cachePool.pool);var v=null;d.memoizedState!==null&&d.memoizedState.cachePool!==null&&(v=d.memoizedState.cachePool.pool),v!==p&&(d.flags|=2048)}return l!==r&&l&&(i.child.flags|=8192),pc(i,i.updateQueue),wt(i),null;case 4:return J(),r===null&&hh(i.stateNode.containerInfo),wt(i),null;case 10:return Ur(i.type),wt(i),null;case 19:if(Te(zt),p=i.memoizedState,p===null)return wt(i),null;if(d=(i.flags&128)!==0,v=p.rendering,v===null)if(d)ks(p,!1);else{if(Rt!==0||r!==null&&r.flags&128)for(r=i.child;r!==null;){if(v=Zl(r),v!==null){for(i.flags|=128,ks(p,!1),r=v.updateQueue,i.updateQueue=r,pc(i,r),i.subtreeFlags=0,r=l,l=i.child;l!==null;)Gb(l,r),l=l.sibling;return he(zt,zt.current&1|2),i.child}r=r.sibling}p.tail!==null&&me()>mc&&(i.flags|=128,d=!0,ks(p,!1),i.lanes=4194304)}else{if(!d)if(r=Zl(v),r!==null){if(i.flags|=128,d=!0,r=r.updateQueue,i.updateQueue=r,pc(i,r),ks(p,!0),p.tail===null&&p.tailMode==="hidden"&&!v.alternate&&!ot)return wt(i),null}else 2*me()-p.renderingStartTime>mc&&l!==536870912&&(i.flags|=128,d=!0,ks(p,!1),i.lanes=4194304);p.isBackwards?(v.sibling=i.child,i.child=v):(r=p.last,r!==null?r.sibling=v:i.child=v,p.last=v)}return p.tail!==null?(i=p.tail,p.rendering=i,p.tail=i.sibling,p.renderingStartTime=me(),i.sibling=null,r=zt.current,he(zt,d?r&1|2:r&1),i):(wt(i),null);case 22:case 23:return Mr(i),ef(),d=i.memoizedState!==null,r!==null?r.memoizedState!==null!==d&&(i.flags|=8192):d&&(i.flags|=8192),d?l&536870912&&!(i.flags&128)&&(wt(i),i.subtreeFlags&6&&(i.flags|=8192)):wt(i),l=i.updateQueue,l!==null&&pc(i,l.retryQueue),l=null,r!==null&&r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(l=r.memoizedState.cachePool.pool),d=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(d=i.memoizedState.cachePool.pool),d!==l&&(i.flags|=2048),r!==null&&Te(ri),null;case 24:return l=null,r!==null&&(l=r.memoizedState.cache),i.memoizedState.cache!==l&&(i.flags|=2048),Ur(Mt),wt(i),null;case 25:return null}throw Error(a(156,i.tag))}function $2(r,i){switch(Kd(i),i.tag){case 1:return r=i.flags,r&65536?(i.flags=r&-65537|128,i):null;case 3:return Ur(Mt),J(),r=i.flags,r&65536&&!(r&128)?(i.flags=r&-65537|128,i):null;case 26:case 27:case 5:return _e(i),null;case 13:if(Mr(i),r=i.memoizedState,r!==null&&r.dehydrated!==null){if(i.alternate===null)throw Error(a(340));cs()}return r=i.flags,r&65536?(i.flags=r&-65537|128,i):null;case 19:return Te(zt),null;case 4:return J(),null;case 10:return Ur(i.type),null;case 22:case 23:return Mr(i),ef(),r!==null&&Te(ri),r=i.flags,r&65536?(i.flags=r&-65537|128,i):null;case 24:return Ur(Mt),null;case 25:return null;default:return null}}function Bb(r,i){switch(Kd(i),i.tag){case 3:Ur(Mt),J();break;case 26:case 27:case 5:_e(i);break;case 4:J();break;case 13:Mr(i);break;case 19:Te(zt);break;case 10:Ur(i.type);break;case 22:case 23:Mr(i),ef(),r!==null&&Te(ri);break;case 24:Ur(Mt)}}var V2={getCacheForType:function(r){var i=tn(Mt),l=i.data.get(r);return l===void 0&&(l=r(),i.data.set(r,l)),l}},q2=typeof WeakMap=="function"?WeakMap:Map,Et=0,vt=null,Je=null,nt=0,yt=0,kn=null,Vr=!1,io=!1,Xf=!1,qr=0,Rt=0,_a=0,fi=0,Kf=0,Vn=0,oo=0,Ds=null,vr=null,Zf=!1,Qf=0,mc=1/0,gc=null,Ta=null,vc=!1,hi=null,Ns=0,Jf=0,eh=null,Os=0,th=null;function Dn(){if(Et&2&&nt!==0)return nt&-nt;if(L.T!==null){var r=Zi;return r!==0?r:ch()}return lv()}function Ib(){Vn===0&&(Vn=!(nt&536870912)||ot?pt():536870912);var r=Bn.current;return r!==null&&(r.flags|=32),Vn}function cn(r,i,l){(r===vt&&yt===2||r.cancelPendingCommit!==null)&&(so(r,0),Yr(r,nt,Vn,!1)),pn(r,l),(!(Et&2)||r!==vt)&&(r===vt&&(!(Et&2)&&(fi|=l),Rt===4&&Yr(r,nt,Vn,!1)),yr(r))}function Hb(r,i,l){if(Et&6)throw Error(a(327));var d=!l&&(i&60)===0&&(i&r.expiredLanes)===0||qe(r,i),p=d?X2(r,i):ih(r,i,!0),v=d;do{if(p===0){io&&!d&&Yr(r,i,0,!1);break}else if(p===6)Yr(r,i,0,!Vr);else{if(l=r.current.alternate,v&&!Y2(l)){p=ih(r,i,!1),v=!1;continue}if(p===2){if(v=i,r.errorRecoveryDisabledLanes&v)var C=0;else C=r.pendingLanes&-536870913,C=C!==0?C:C&536870912?536870912:0;if(C!==0){i=C;e:{var P=r;p=Ds;var V=P.current.memoizedState.isDehydrated;if(V&&(so(P,C).flags|=256),C=ih(P,C,!1),C!==2){if(Xf&&!V){P.errorRecoveryDisabledLanes|=v,fi|=v,p=4;break e}v=vr,vr=p,v!==null&&nh(v)}p=C}if(v=!1,p!==2)continue}}if(p===1){so(r,0),Yr(r,i,0,!0);break}e:{switch(d=r,p){case 0:case 1:throw Error(a(345));case 4:if((i&4194176)===i){Yr(d,i,Vn,!Vr);break e}break;case 2:vr=null;break;case 3:case 5:break;default:throw Error(a(329))}if(d.finishedWork=l,d.finishedLanes=i,(i&62914560)===i&&(v=Qf+300-me(),10l?32:l,L.T=null,hi===null)var v=!1;else{l=eh,eh=null;var C=hi,P=Ns;if(hi=null,Ns=0,Et&6)throw Error(a(331));var V=Et;if(Et|=4,Mb(C.current),jb(C,C.current,P,l),Et=V,js(0,!1),rt&&typeof rt.onPostCommitFiberRoot=="function")try{rt.onPostCommitFiberRoot(Gt,C)}catch{}v=!0}return v}finally{W.p=p,L.T=d,Qb(r,i)}}return!1}function Jb(r,i,l){i=Gn(l,i),i=Sf(r.stateNode,i,2),r=ba(r,i,2),r!==null&&(pn(r,2),yr(r))}function mt(r,i,l){if(r.tag===3)Jb(r,r,l);else for(;i!==null;){if(i.tag===3){Jb(i,r,l);break}else if(i.tag===1){var d=i.stateNode;if(typeof i.type.getDerivedStateFromError=="function"||typeof d.componentDidCatch=="function"&&(Ta===null||!Ta.has(d))){r=Gn(l,r),l=nb(2),d=ba(i,l,2),d!==null&&(rb(l,d,i,r),pn(d,2),yr(d));break}}i=i.return}}function oh(r,i,l){var d=r.pingCache;if(d===null){d=r.pingCache=new q2;var p=new Set;d.set(i,p)}else p=d.get(i),p===void 0&&(p=new Set,d.set(i,p));p.has(l)||(Xf=!0,p.add(l),r=Q2.bind(null,r,i,l),i.then(r,r))}function Q2(r,i,l){var d=r.pingCache;d!==null&&d.delete(i),r.pingedLanes|=r.suspendedLanes&l,r.warmLanes&=~l,vt===r&&(nt&l)===l&&(Rt===4||Rt===3&&(nt&62914560)===nt&&300>me()-Qf?!(Et&2)&&so(r,0):Kf|=l,oo===nt&&(oo=0)),yr(r)}function ex(r,i){i===0&&(i=hn()),r=da(r,i),r!==null&&(pn(r,i),yr(r))}function J2(r){var i=r.memoizedState,l=0;i!==null&&(l=i.retryLane),ex(r,l)}function eA(r,i){var l=0;switch(r.tag){case 13:var d=r.stateNode,p=r.memoizedState;p!==null&&(l=p.retryLane);break;case 19:d=r.stateNode;break;case 22:d=r.stateNode._retryCache;break;default:throw Error(a(314))}d!==null&&d.delete(i),ex(r,l)}function tA(r,i){return Ee(r,i)}var xc=null,uo=null,sh=!1,wc=!1,lh=!1,pi=0;function yr(r){r!==uo&&r.next===null&&(uo===null?xc=uo=r:uo=uo.next=r),wc=!0,sh||(sh=!0,rA(nA))}function js(r,i){if(!lh&&wc){lh=!0;do for(var l=!1,d=xc;d!==null;){if(r!==0){var p=d.pendingLanes;if(p===0)var v=0;else{var C=d.suspendedLanes,P=d.pingedLanes;v=(1<<31-Lt(42|r)+1)-1,v&=p&~(C&~P),v=v&201326677?v&201326677|1:v?v|2:0}v!==0&&(l=!0,rx(d,v))}else v=nt,v=ji(d,d===vt?v:0),!(v&3)||qe(d,v)||(l=!0,rx(d,v));d=d.next}while(l);lh=!1}}function nA(){wc=sh=!1;var r=0;pi!==0&&(dA()&&(r=pi),pi=0);for(var i=me(),l=null,d=xc;d!==null;){var p=d.next,v=tx(d,i);v===0?(d.next=null,l===null?xc=p:l.next=p,p===null&&(uo=l)):(l=d,(r!==0||v&3)&&(wc=!0)),d=p}js(r)}function tx(r,i){for(var l=r.suspendedLanes,d=r.pingedLanes,p=r.expirationTimes,v=r.pendingLanes&-62914561;0"u"?null:document;function yx(r,i,l){var d=ho;if(d&&typeof i=="string"&&i){var p=Mn(i);p='link[rel="'+r+'"][href="'+p+'"]',typeof l=="string"&&(p+='[crossorigin="'+l+'"]'),vx.has(p)||(vx.add(p),r={rel:r,crossOrigin:l,href:i},d.querySelector(p)===null&&(i=d.createElement("link"),Xt(i,"link",r),Ft(i),d.head.appendChild(i)))}}function bA(r){Wr.D(r),yx("dns-prefetch",r,null)}function xA(r,i){Wr.C(r,i),yx("preconnect",r,i)}function wA(r,i,l){Wr.L(r,i,l);var d=ho;if(d&&r&&i){var p='link[rel="preload"][as="'+Mn(i)+'"]';i==="image"&&l&&l.imageSrcSet?(p+='[imagesrcset="'+Mn(l.imageSrcSet)+'"]',typeof l.imageSizes=="string"&&(p+='[imagesizes="'+Mn(l.imageSizes)+'"]')):p+='[href="'+Mn(r)+'"]';var v=p;switch(i){case"style":v=po(r);break;case"script":v=mo(r)}qn.has(v)||(r=I({rel:"preload",href:i==="image"&&l&&l.imageSrcSet?void 0:r,as:i},l),qn.set(v,r),d.querySelector(p)!==null||i==="style"&&d.querySelector(Ms(v))||i==="script"&&d.querySelector(Ps(v))||(i=d.createElement("link"),Xt(i,"link",r),Ft(i),d.head.appendChild(i)))}}function EA(r,i){Wr.m(r,i);var l=ho;if(l&&r){var d=i&&typeof i.as=="string"?i.as:"script",p='link[rel="modulepreload"][as="'+Mn(d)+'"][href="'+Mn(r)+'"]',v=p;switch(d){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":v=mo(r)}if(!qn.has(v)&&(r=I({rel:"modulepreload",href:r},i),qn.set(v,r),l.querySelector(p)===null)){switch(d){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(l.querySelector(Ps(v)))return}d=l.createElement("link"),Xt(d,"link",r),Ft(d),l.head.appendChild(d)}}}function SA(r,i,l){Wr.S(r,i,l);var d=ho;if(d&&r){var p=Mi(d).hoistableStyles,v=po(r);i=i||"default";var C=p.get(v);if(!C){var P={loading:0,preload:null};if(C=d.querySelector(Ms(v)))P.loading=5;else{r=I({rel:"stylesheet",href:r,"data-precedence":i},l),(l=qn.get(v))&&Eh(r,l);var V=C=d.createElement("link");Ft(V),Xt(V,"link",r),V._p=new Promise(function(Q,fe){V.onload=Q,V.onerror=fe}),V.addEventListener("load",function(){P.loading|=1}),V.addEventListener("error",function(){P.loading|=2}),P.loading|=4,Rc(C,i,d)}C={type:"stylesheet",instance:C,count:1,state:P},p.set(v,C)}}}function _A(r,i){Wr.X(r,i);var l=ho;if(l&&r){var d=Mi(l).hoistableScripts,p=mo(r),v=d.get(p);v||(v=l.querySelector(Ps(p)),v||(r=I({src:r,async:!0},i),(i=qn.get(p))&&Sh(r,i),v=l.createElement("script"),Ft(v),Xt(v,"link",r),l.head.appendChild(v)),v={type:"script",instance:v,count:1,state:null},d.set(p,v))}}function TA(r,i){Wr.M(r,i);var l=ho;if(l&&r){var d=Mi(l).hoistableScripts,p=mo(r),v=d.get(p);v||(v=l.querySelector(Ps(p)),v||(r=I({src:r,async:!0,type:"module"},i),(i=qn.get(p))&&Sh(r,i),v=l.createElement("script"),Ft(v),Xt(v,"link",r),l.head.appendChild(v)),v={type:"script",instance:v,count:1,state:null},d.set(p,v))}}function bx(r,i,l,d){var p=(p=je.current)?Cc(p):null;if(!p)throw Error(a(446));switch(r){case"meta":case"title":return null;case"style":return typeof l.precedence=="string"&&typeof l.href=="string"?(i=po(l.href),l=Mi(p).hoistableStyles,d=l.get(i),d||(d={type:"style",instance:null,count:0,state:null},l.set(i,d)),d):{type:"void",instance:null,count:0,state:null};case"link":if(l.rel==="stylesheet"&&typeof l.href=="string"&&typeof l.precedence=="string"){r=po(l.href);var v=Mi(p).hoistableStyles,C=v.get(r);if(C||(p=p.ownerDocument||p,C={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},v.set(r,C),(v=p.querySelector(Ms(r)))&&!v._p&&(C.instance=v,C.state.loading=5),qn.has(r)||(l={rel:"preload",as:"style",href:l.href,crossOrigin:l.crossOrigin,integrity:l.integrity,media:l.media,hrefLang:l.hrefLang,referrerPolicy:l.referrerPolicy},qn.set(r,l),v||CA(p,r,l,C.state))),i&&d===null)throw Error(a(528,""));return C}if(i&&d!==null)throw Error(a(529,""));return null;case"script":return i=l.async,l=l.src,typeof l=="string"&&i&&typeof i!="function"&&typeof i!="symbol"?(i=mo(l),l=Mi(p).hoistableScripts,d=l.get(i),d||(d={type:"script",instance:null,count:0,state:null},l.set(i,d)),d):{type:"void",instance:null,count:0,state:null};default:throw Error(a(444,r))}}function po(r){return'href="'+Mn(r)+'"'}function Ms(r){return'link[rel="stylesheet"]['+r+"]"}function xx(r){return I({},r,{"data-precedence":r.precedence,precedence:null})}function CA(r,i,l,d){r.querySelector('link[rel="preload"][as="style"]['+i+"]")?d.loading=1:(i=r.createElement("link"),d.preload=i,i.addEventListener("load",function(){return d.loading|=1}),i.addEventListener("error",function(){return d.loading|=2}),Xt(i,"link",l),Ft(i),r.head.appendChild(i))}function mo(r){return'[src="'+Mn(r)+'"]'}function Ps(r){return"script[async]"+r}function wx(r,i,l){if(i.count++,i.instance===null)switch(i.type){case"style":var d=r.querySelector('style[data-href~="'+Mn(l.href)+'"]');if(d)return i.instance=d,Ft(d),d;var p=I({},l,{"data-href":l.href,"data-precedence":l.precedence,href:null,precedence:null});return d=(r.ownerDocument||r).createElement("style"),Ft(d),Xt(d,"style",p),Rc(d,l.precedence,r),i.instance=d;case"stylesheet":p=po(l.href);var v=r.querySelector(Ms(p));if(v)return i.state.loading|=4,i.instance=v,Ft(v),v;d=xx(l),(p=qn.get(p))&&Eh(d,p),v=(r.ownerDocument||r).createElement("link"),Ft(v);var C=v;return C._p=new Promise(function(P,V){C.onload=P,C.onerror=V}),Xt(v,"link",d),i.state.loading|=4,Rc(v,l.precedence,r),i.instance=v;case"script":return v=mo(l.src),(p=r.querySelector(Ps(v)))?(i.instance=p,Ft(p),p):(d=l,(p=qn.get(v))&&(d=I({},l),Sh(d,p)),r=r.ownerDocument||r,p=r.createElement("script"),Ft(p),Xt(p,"link",d),r.head.appendChild(p),i.instance=p);case"void":return null;default:throw Error(a(443,i.type))}else i.type==="stylesheet"&&!(i.state.loading&4)&&(d=i.instance,i.state.loading|=4,Rc(d,l.precedence,r));return i.instance}function Rc(r,i,l){for(var d=l.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),p=d.length?d[d.length-1]:null,v=p,C=0;C title"):null)}function RA(r,i,l){if(l===1||i.itemProp!=null)return!1;switch(r){case"meta":case"title":return!0;case"style":if(typeof i.precedence!="string"||typeof i.href!="string"||i.href==="")break;return!0;case"link":if(typeof i.rel!="string"||typeof i.href!="string"||i.href===""||i.onLoad||i.onError)break;switch(i.rel){case"stylesheet":return r=i.disabled,typeof i.precedence=="string"&&r==null;default:return!0}case"script":if(i.async&&typeof i.async!="function"&&typeof i.async!="symbol"&&!i.onLoad&&!i.onError&&i.src&&typeof i.src=="string")return!0}return!1}function _x(r){return!(r.type==="stylesheet"&&!(r.state.loading&3))}var Gs=null;function AA(){}function kA(r,i,l){if(Gs===null)throw Error(a(475));var d=Gs;if(i.type==="stylesheet"&&(typeof l.media!="string"||matchMedia(l.media).matches!==!1)&&!(i.state.loading&4)){if(i.instance===null){var p=po(l.href),v=r.querySelector(Ms(p));if(v){r=v._p,r!==null&&typeof r=="object"&&typeof r.then=="function"&&(d.count++,d=kc.bind(d),r.then(d,d)),i.state.loading|=4,i.instance=v,Ft(v);return}v=r.ownerDocument||r,l=xx(l),(p=qn.get(p))&&Eh(l,p),v=v.createElement("link"),Ft(v);var C=v;C._p=new Promise(function(P,V){C.onload=P,C.onerror=V}),Xt(v,"link",l),i.instance=v}d.stylesheets===null&&(d.stylesheets=new Map),d.stylesheets.set(i,r),(r=i.state.preload)&&!(i.state.loading&3)&&(d.count++,i=kc.bind(d),r.addEventListener("load",i),r.addEventListener("error",i))}}function DA(){if(Gs===null)throw Error(a(475));var r=Gs;return r.stylesheets&&r.count===0&&_h(r,r.stylesheets),0"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),jh.exports=ZA(),jh.exports}var JA=QA();const qx=e=>{let t;const n=new Set,a=(h,m)=>{const g=typeof h=="function"?h(t):h;if(!Object.is(g,t)){const y=t;t=m??(typeof g!="object"||g===null)?g:Object.assign({},t,g),n.forEach(b=>b(t,y))}},o=()=>t,u={setState:a,getState:o,getInitialState:()=>f,subscribe:h=>(n.add(h),()=>n.delete(h))},f=t=e(a,o,u);return u},ek=e=>e?qx(e):qx,tk=e=>e;function nk(e,t=tk){const n=ve.useSyncExternalStore(e.subscribe,()=>t(e.getState()),()=>t(e.getInitialState()));return ve.useDebugValue(n),n}const rk=e=>{const t=ek(e),n=a=>nk(t,a);return Object.assign(n,t),n},Ym=e=>rk;function U1(e,t){let n;try{n=e()}catch{return}return{getItem:o=>{var s;const c=f=>f===null?null:JSON.parse(f,void 0),u=(s=n.getItem(o))!=null?s:null;return u instanceof Promise?u.then(c):c(u)},setItem:(o,s)=>n.setItem(o,JSON.stringify(s,void 0)),removeItem:o=>n.removeItem(o)}}const Xp=e=>t=>{try{const n=e(t);return n instanceof Promise?n:{then(a){return Xp(a)(n)},catch(a){return this}}}catch(n){return{then(a){return this},catch(a){return Xp(a)(n)}}}},ak=(e,t)=>(n,a,o)=>{let s={storage:U1(()=>localStorage),partialize:E=>E,version:0,merge:(E,_)=>({..._,...E}),...t},c=!1;const u=new Set,f=new Set;let h=s.storage;if(!h)return e((...E)=>{console.warn(`[zustand persist middleware] Unable to update item '${s.name}', the given storage is currently unavailable.`),n(...E)},a,o);const m=()=>{const E=s.partialize({...a()});return h.setItem(s.name,{state:E,version:s.version})},g=o.setState;o.setState=(E,_)=>{g(E,_),m()};const y=e((...E)=>{n(...E),m()},a,o);o.getInitialState=()=>y;let b;const S=()=>{var E,_;if(!h)return;c=!1,u.forEach(T=>{var A;return T((A=a())!=null?A:y)});const N=((_=s.onRehydrateStorage)==null?void 0:_.call(s,(E=a())!=null?E:y))||void 0;return Xp(h.getItem.bind(h))(s.name).then(T=>{if(T)if(typeof T.version=="number"&&T.version!==s.version){if(s.migrate){const A=s.migrate(T.state,T.version);return A instanceof Promise?A.then(D=>[!0,D]):[!0,A]}console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,T.state];return[!1,void 0]}).then(T=>{var A;const[D,k]=T;if(b=s.merge(k,(A=a())!=null?A:y),n(b,!0),D)return m()}).then(()=>{N==null||N(b,void 0),b=a(),c=!0,f.forEach(T=>T(b))}).catch(T=>{N==null||N(void 0,T)})};return o.persist={setOptions:E=>{s={...s,...E},E.storage&&(h=E.storage)},clearStorage:()=>{h==null||h.removeItem(s.name)},getOptions:()=>s,rehydrate:()=>S(),hasHydrated:()=>c,onHydrate:E=>(u.add(E),()=>{u.delete(E)}),onFinishHydration:E=>(f.add(E),()=>{f.delete(E)})},s.skipHydration||S(),b||y},ik=ak;function B1(e){var t,n,a="";if(typeof e=="string"||typeof e=="number")a+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t{const t=lk(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:a}=e;return{getClassGroupId:c=>{const u=c.split(Wm);return u[0]===""&&u.length!==1&&u.shift(),H1(u,t)||sk(c)},getConflictingClassGroupIds:(c,u)=>{const f=n[c]||[];return u&&a[c]?[...f,...a[c]]:f}}},H1=(e,t)=>{var c;if(e.length===0)return t.classGroupId;const n=e[0],a=t.nextPart.get(n),o=a?H1(e.slice(1),a):void 0;if(o)return o;if(t.validators.length===0)return;const s=e.join(Wm);return(c=t.validators.find(({validator:u})=>u(s)))==null?void 0:c.classGroupId},Yx=/^\[(.+)\]$/,sk=e=>{if(Yx.test(e)){const t=Yx.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},lk=e=>{const{theme:t,classGroups:n}=e,a={nextPart:new Map,validators:[]};for(const o in n)Kp(n[o],a,o,t);return a},Kp=(e,t,n,a)=>{e.forEach(o=>{if(typeof o=="string"){const s=o===""?t:Wx(t,o);s.classGroupId=n;return}if(typeof o=="function"){if(ck(o)){Kp(o(a),t,n,a);return}t.validators.push({validator:o,classGroupId:n});return}Object.entries(o).forEach(([s,c])=>{Kp(c,Wx(t,s),n,a)})})},Wx=(e,t)=>{let n=e;return t.split(Wm).forEach(a=>{n.nextPart.has(a)||n.nextPart.set(a,{nextPart:new Map,validators:[]}),n=n.nextPart.get(a)}),n},ck=e=>e.isThemeGetter,uk=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,a=new Map;const o=(s,c)=>{n.set(s,c),t++,t>e&&(t=0,a=n,n=new Map)};return{get(s){let c=n.get(s);if(c!==void 0)return c;if((c=a.get(s))!==void 0)return o(s,c),c},set(s,c){n.has(s)?n.set(s,c):o(s,c)}}},Zp="!",Qp=":",dk=Qp.length,fk=e=>{const{prefix:t,experimentalParseClassName:n}=e;let a=o=>{const s=[];let c=0,u=0,f=0,h;for(let S=0;Sf?h-f:void 0;return{modifiers:s,hasImportantModifier:y,baseClassName:g,maybePostfixModifierPosition:b}};if(t){const o=t+Qp,s=a;a=c=>c.startsWith(o)?s(c.substring(o.length)):{isExternal:!0,modifiers:[],hasImportantModifier:!1,baseClassName:c,maybePostfixModifierPosition:void 0}}if(n){const o=a;a=s=>n({className:s,parseClassName:o})}return a},hk=e=>e.endsWith(Zp)?e.substring(0,e.length-1):e.startsWith(Zp)?e.substring(1):e,pk=e=>{const t=Object.fromEntries(e.orderSensitiveModifiers.map(a=>[a,!0]));return a=>{if(a.length<=1)return a;const o=[];let s=[];return a.forEach(c=>{c[0]==="["||t[c]?(o.push(...s.sort(),c),s=[]):s.push(c)}),o.push(...s.sort()),o}},mk=e=>({cache:uk(e.cacheSize),parseClassName:fk(e),sortModifiers:pk(e),...ok(e)}),gk=/\s+/,vk=(e,t)=>{const{parseClassName:n,getClassGroupId:a,getConflictingClassGroupIds:o,sortModifiers:s}=t,c=[],u=e.trim().split(gk);let f="";for(let h=u.length-1;h>=0;h-=1){const m=u[h],{isExternal:g,modifiers:y,hasImportantModifier:b,baseClassName:S,maybePostfixModifierPosition:E}=n(m);if(g){f=m+(f.length>0?" "+f:f);continue}let _=!!E,N=a(_?S.substring(0,E):S);if(!N){if(!_){f=m+(f.length>0?" "+f:f);continue}if(N=a(S),!N){f=m+(f.length>0?" "+f:f);continue}_=!1}const T=s(y).join(":"),A=b?T+Zp:T,D=A+N;if(c.includes(D))continue;c.push(D);const k=o(N,_);for(let M=0;M0?" "+f:f)}return f};function yk(){let e=0,t,n,a="";for(;e{if(typeof e=="string")return e;let t,n="";for(let a=0;ag(m),e());return n=mk(h),a=n.cache.get,o=n.cache.set,s=u,u(f)}function u(f){const h=a(f);if(h)return h;const m=vk(f,n);return o(f,m),m}return function(){return s(yk.apply(null,arguments))}}const Ht=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},V1=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,q1=/^\((?:(\w[\w-]*):)?(.+)\)$/i,xk=/^\d+\/\d+$/,wk=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Ek=/\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$/,Sk=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,_k=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Tk=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,go=e=>xk.test(e),et=e=>!!e&&!Number.isNaN(Number(e)),mi=e=>!!e&&Number.isInteger(Number(e)),Xx=e=>e.endsWith("%")&&et(e.slice(0,-1)),Na=e=>wk.test(e),Ck=()=>!0,Rk=e=>Ek.test(e)&&!Sk.test(e),Xm=()=>!1,Ak=e=>_k.test(e),kk=e=>Tk.test(e),Dk=e=>!De(e)&&!Ne(e),Nk=e=>Po(e,X1,Xm),De=e=>V1.test(e),gi=e=>Po(e,K1,Rk),Ph=e=>Po(e,Ik,et),Ok=e=>Po(e,Y1,Xm),jk=e=>Po(e,W1,kk),Lk=e=>Po(e,Xm,Ak),Ne=e=>q1.test(e),Gc=e=>Go(e,K1),zk=e=>Go(e,Hk),Mk=e=>Go(e,Y1),Pk=e=>Go(e,X1),Gk=e=>Go(e,W1),Fk=e=>Go(e,$k,!0),Po=(e,t,n)=>{const a=V1.exec(e);return a?a[1]?t(a[1]):n(a[2]):!1},Go=(e,t,n=!1)=>{const a=q1.exec(e);return a?a[1]?t(a[1]):n:!1},Y1=e=>e==="position",Uk=new Set(["image","url"]),W1=e=>Uk.has(e),Bk=new Set(["length","size","percentage"]),X1=e=>Bk.has(e),K1=e=>e==="length",Ik=e=>e==="number",Hk=e=>e==="family-name",$k=e=>e==="shadow",Vk=()=>{const e=Ht("color"),t=Ht("font"),n=Ht("text"),a=Ht("font-weight"),o=Ht("tracking"),s=Ht("leading"),c=Ht("breakpoint"),u=Ht("container"),f=Ht("spacing"),h=Ht("radius"),m=Ht("shadow"),g=Ht("inset-shadow"),y=Ht("drop-shadow"),b=Ht("blur"),S=Ht("perspective"),E=Ht("aspect"),_=Ht("ease"),N=Ht("animate"),T=()=>["auto","avoid","all","avoid-page","page","left","right","column"],A=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],D=()=>["auto","hidden","clip","visible","scroll"],k=()=>["auto","contain","none"],M=()=>[go,"px","full","auto",Ne,De,f],R=()=>[mi,"none","subgrid",Ne,De],U=()=>["auto",{span:["full",mi,Ne,De]},Ne,De],L=()=>[mi,"auto",Ne,De],I=()=>["auto","min","max","fr",Ne,De],q=()=>[Ne,De,f],Y=()=>["start","end","center","between","around","evenly","stretch","baseline"],B=()=>["start","end","center","stretch"],X=()=>[Ne,De,f],ne=()=>["px",...X()],F=()=>["px","auto",...X()],z=()=>[go,"auto","px","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",Ne,De,f],j=()=>[e,Ne,De],K=()=>[Xx,gi],G=()=>["","none","full",h,Ne,De],H=()=>["",et,Gc,gi],O=()=>["solid","dashed","dotted","double"],$=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],W=()=>["","none",b,Ne,De],re=()=>["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",Ne,De],de=()=>["none",et,Ne,De],ie=()=>["none",et,Ne,De],oe=()=>[et,Ne,De],Te=()=>[go,"full","px",Ne,De,f];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Na],breakpoint:[Na],color:[Ck],container:[Na],"drop-shadow":[Na],ease:["in","out","in-out"],font:[Dk],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Na],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Na],shadow:[Na],spacing:[et],text:[Na],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",go,De,Ne,E]}],container:["container"],columns:[{columns:[et,De,Ne,u]}],"break-after":[{"break-after":T()}],"break-before":[{"break-before":T()}],"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:[...A(),De,Ne]}],overflow:[{overflow:D()}],"overflow-x":[{"overflow-x":D()}],"overflow-y":[{"overflow-y":D()}],overscroll:[{overscroll:k()}],"overscroll-x":[{"overscroll-x":k()}],"overscroll-y":[{"overscroll-y":k()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:M()}],"inset-x":[{"inset-x":M()}],"inset-y":[{"inset-y":M()}],start:[{start:M()}],end:[{end:M()}],top:[{top:M()}],right:[{right:M()}],bottom:[{bottom:M()}],left:[{left:M()}],visibility:["visible","invisible","collapse"],z:[{z:[mi,"auto",Ne,De]}],basis:[{basis:[go,"full","auto",Ne,De,u,f]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[et,go,"auto","initial","none",De]}],grow:[{grow:["",et,Ne,De]}],shrink:[{shrink:["",et,Ne,De]}],order:[{order:[mi,"first","last","none",Ne,De]}],"grid-cols":[{"grid-cols":R()}],"col-start-end":[{col:U()}],"col-start":[{"col-start":L()}],"col-end":[{"col-end":L()}],"grid-rows":[{"grid-rows":R()}],"row-start-end":[{row:U()}],"row-start":[{"row-start":L()}],"row-end":[{"row-end":L()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":I()}],"auto-rows":[{"auto-rows":I()}],gap:[{gap:q()}],"gap-x":[{"gap-x":q()}],"gap-y":[{"gap-y":q()}],"justify-content":[{justify:[...Y(),"normal"]}],"justify-items":[{"justify-items":[...B(),"normal"]}],"justify-self":[{"justify-self":["auto",...B()]}],"align-content":[{content:["normal",...Y()]}],"align-items":[{items:[...B(),"baseline"]}],"align-self":[{self:["auto",...B(),"baseline"]}],"place-content":[{"place-content":Y()}],"place-items":[{"place-items":[...B(),"baseline"]}],"place-self":[{"place-self":["auto",...B()]}],p:[{p:ne()}],px:[{px:ne()}],py:[{py:ne()}],ps:[{ps:ne()}],pe:[{pe:ne()}],pt:[{pt:ne()}],pr:[{pr:ne()}],pb:[{pb:ne()}],pl:[{pl:ne()}],m:[{m:F()}],mx:[{mx:F()}],my:[{my:F()}],ms:[{ms:F()}],me:[{me:F()}],mt:[{mt:F()}],mr:[{mr:F()}],mb:[{mb:F()}],ml:[{ml:F()}],"space-x":[{"space-x":X()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":X()}],"space-y-reverse":["space-y-reverse"],size:[{size:z()}],w:[{w:[u,"screen",...z()]}],"min-w":[{"min-w":[u,"screen","none",...z()]}],"max-w":[{"max-w":[u,"screen","none","prose",{screen:[c]},...z()]}],h:[{h:["screen",...z()]}],"min-h":[{"min-h":["screen","none",...z()]}],"max-h":[{"max-h":["screen",...z()]}],"font-size":[{text:["base",n,Gc,gi]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[a,Ne,Ph]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Xx,De]}],"font-family":[{font:[zk,De,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:[o,Ne,De]}],"line-clamp":[{"line-clamp":[et,"none",Ne,Ph]}],leading:[{leading:[Ne,De,s,f]}],"list-image":[{"list-image":["none",Ne,De]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Ne,De]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:j()}],"text-color":[{text:j()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...O(),"wavy"]}],"text-decoration-thickness":[{decoration:[et,"from-font","auto",Ne,gi]}],"text-decoration-color":[{decoration:j()}],"underline-offset":[{"underline-offset":[et,"auto",Ne,De]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:["px",...X()]}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Ne,De]}],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",Ne,De]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...A(),Mk,Ok]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","space","round"]}]}],"bg-size":[{bg:["auto","cover","contain",Pk,Nk]}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},mi,Ne,De],radial:["",Ne,De],conic:[mi,Ne,De]},Gk,jk]}],"bg-color":[{bg:j()}],"gradient-from-pos":[{from:K()}],"gradient-via-pos":[{via:K()}],"gradient-to-pos":[{to:K()}],"gradient-from":[{from:j()}],"gradient-via":[{via:j()}],"gradient-to":[{to:j()}],rounded:[{rounded:G()}],"rounded-s":[{"rounded-s":G()}],"rounded-e":[{"rounded-e":G()}],"rounded-t":[{"rounded-t":G()}],"rounded-r":[{"rounded-r":G()}],"rounded-b":[{"rounded-b":G()}],"rounded-l":[{"rounded-l":G()}],"rounded-ss":[{"rounded-ss":G()}],"rounded-se":[{"rounded-se":G()}],"rounded-ee":[{"rounded-ee":G()}],"rounded-es":[{"rounded-es":G()}],"rounded-tl":[{"rounded-tl":G()}],"rounded-tr":[{"rounded-tr":G()}],"rounded-br":[{"rounded-br":G()}],"rounded-bl":[{"rounded-bl":G()}],"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:[...O(),"hidden","none"]}],"divide-style":[{divide:[...O(),"hidden","none"]}],"border-color":[{border:j()}],"border-color-x":[{"border-x":j()}],"border-color-y":[{"border-y":j()}],"border-color-s":[{"border-s":j()}],"border-color-e":[{"border-e":j()}],"border-color-t":[{"border-t":j()}],"border-color-r":[{"border-r":j()}],"border-color-b":[{"border-b":j()}],"border-color-l":[{"border-l":j()}],"divide-color":[{divide:j()}],"outline-style":[{outline:[...O(),"none","hidden"]}],"outline-offset":[{"outline-offset":[et,Ne,De]}],"outline-w":[{outline:["",et,Gc,gi]}],"outline-color":[{outline:[e]}],shadow:[{shadow:["","none",m,Fk,Lk]}],"shadow-color":[{shadow:j()}],"inset-shadow":[{"inset-shadow":["none",Ne,De,g]}],"inset-shadow-color":[{"inset-shadow":j()}],"ring-w":[{ring:H()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:j()}],"ring-offset-w":[{"ring-offset":[et,gi]}],"ring-offset-color":[{"ring-offset":j()}],"inset-ring-w":[{"inset-ring":H()}],"inset-ring-color":[{"inset-ring":j()}],opacity:[{opacity:[et,Ne,De]}],"mix-blend":[{"mix-blend":[...$(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":$()}],filter:[{filter:["","none",Ne,De]}],blur:[{blur:W()}],brightness:[{brightness:[et,Ne,De]}],contrast:[{contrast:[et,Ne,De]}],"drop-shadow":[{"drop-shadow":["","none",y,Ne,De]}],grayscale:[{grayscale:["",et,Ne,De]}],"hue-rotate":[{"hue-rotate":[et,Ne,De]}],invert:[{invert:["",et,Ne,De]}],saturate:[{saturate:[et,Ne,De]}],sepia:[{sepia:["",et,Ne,De]}],"backdrop-filter":[{"backdrop-filter":["","none",Ne,De]}],"backdrop-blur":[{"backdrop-blur":W()}],"backdrop-brightness":[{"backdrop-brightness":[et,Ne,De]}],"backdrop-contrast":[{"backdrop-contrast":[et,Ne,De]}],"backdrop-grayscale":[{"backdrop-grayscale":["",et,Ne,De]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[et,Ne,De]}],"backdrop-invert":[{"backdrop-invert":["",et,Ne,De]}],"backdrop-opacity":[{"backdrop-opacity":[et,Ne,De]}],"backdrop-saturate":[{"backdrop-saturate":[et,Ne,De]}],"backdrop-sepia":[{"backdrop-sepia":["",et,Ne,De]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":X()}],"border-spacing-x":[{"border-spacing-x":X()}],"border-spacing-y":[{"border-spacing-y":X()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",Ne,De]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[et,"initial",Ne,De]}],ease:[{ease:["linear","initial",_,Ne,De]}],delay:[{delay:[et,Ne,De]}],animate:[{animate:["none",N,Ne,De]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[S,Ne,De]}],"perspective-origin":[{"perspective-origin":re()}],rotate:[{rotate:de()}],"rotate-x":[{"rotate-x":de()}],"rotate-y":[{"rotate-y":de()}],"rotate-z":[{"rotate-z":de()}],scale:[{scale:ie()}],"scale-x":[{"scale-x":ie()}],"scale-y":[{"scale-y":ie()}],"scale-z":[{"scale-z":ie()}],"scale-3d":["scale-3d"],skew:[{skew:oe()}],"skew-x":[{"skew-x":oe()}],"skew-y":[{"skew-y":oe()}],transform:[{transform:[Ne,De,"","none","gpu","cpu"]}],"transform-origin":[{origin:re()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Te()}],"translate-x":[{"translate-x":Te()}],"translate-y":[{"translate-y":Te()}],"translate-z":[{"translate-z":Te()}],"translate-none":["translate-none"],accent:[{accent:j()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:j()}],"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",Ne,De]}],"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":X()}],"scroll-mx":[{"scroll-mx":X()}],"scroll-my":[{"scroll-my":X()}],"scroll-ms":[{"scroll-ms":X()}],"scroll-me":[{"scroll-me":X()}],"scroll-mt":[{"scroll-mt":X()}],"scroll-mr":[{"scroll-mr":X()}],"scroll-mb":[{"scroll-mb":X()}],"scroll-ml":[{"scroll-ml":X()}],"scroll-p":[{"scroll-p":X()}],"scroll-px":[{"scroll-px":X()}],"scroll-py":[{"scroll-py":X()}],"scroll-ps":[{"scroll-ps":X()}],"scroll-pe":[{"scroll-pe":X()}],"scroll-pt":[{"scroll-pt":X()}],"scroll-pr":[{"scroll-pr":X()}],"scroll-pb":[{"scroll-pb":X()}],"scroll-pl":[{"scroll-pl":X()}],"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",Ne,De]}],fill:[{fill:["none",...j()]}],"stroke-w":[{stroke:[et,Gc,gi,Ph]}],stroke:[{stroke:["none",...j()]}],"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","*","**"]}},qk=bk(Vk);function Me(...e){return qk(I1(e))}function Yk(){const e="0123456789abcdef";let t="#";for(let n=0;n<6;n++)t+=e.charAt(Math.floor(Math.random()*16));return t}function Sr(e){return e instanceof Error?e.message:`${e}`}const Km=e=>{const t=e;t.use={};for(const n of Object.keys(t.getState()))t.use[n]=()=>t(a=>a[n]);return t},Z1="",_r="ghost",Wk="#B2EBF2",Xk="#000",Kk="#E2E2E2",Zk="#EEEEEE",Qk="#F57F17",Jk="#969696",eD="#F57F17",Kx="#B2EBF2",Gh=20,Zx=4,tD=20,nD=15,Qx="*",rD={"text/plain":[".txt",".md"],"application/pdf":[".pdf"],"application/msword":[".doc"],"application/vnd.openxmlformats-officedocument.wordprocessingml.document":[".docx"],"application/vnd.openxmlformats-officedocument.presentationml.presentation":[".pptx"]},Jx={name:"LightRAG",github:"https://github.com/HKUDS/LightRAG"},aD=Ym()(ik(e=>({theme:"system",showPropertyPanel:!0,showNodeSearchBar:!0,showNodeLabel:!0,enableNodeDrag:!0,showEdgeLabel:!1,enableHideUnselectedEdges:!0,enableEdgeEvents:!1,queryLabel:Qx,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:U1(()=>localStorage),version:6,migrate:(e,t)=>(t<2&&(e.showEdgeLabel=!1),t<3&&(e.queryLabel=Qx),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)})),We=Km(aD),iD={theme:"system",setTheme:()=>null},Q1=w.createContext(iD);function oD({children:e,...t}){const[n,a]=w.useState(We.getState().theme);w.useEffect(()=>{const s=window.document.documentElement;if(s.classList.remove("light","dark"),n==="system"){const c=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";s.classList.add(c),a(c);return}s.classList.add(n)},[n]);const o={theme:n,setTheme:s=>{We.getState().setTheme(s),a(s)}};return x.jsx(Q1.Provider,{...t,value:o,children:e})}const e0=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,t0=I1,J1=(e,t)=>n=>{var a;if((t==null?void 0:t.variants)==null)return t0(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:o,defaultVariants:s}=t,c=Object.keys(o).map(h=>{const m=n==null?void 0:n[h],g=s==null?void 0:s[h];if(m===null)return null;const y=e0(m)||e0(g);return o[h][y]}),u=n&&Object.entries(n).reduce((h,m)=>{let[g,y]=m;return y===void 0||(h[g]=y),h},{}),f=t==null||(a=t.compoundVariants)===null||a===void 0?void 0:a.reduce((h,m)=>{let{class:g,className:y,...b}=m;return Object.entries(b).every(S=>{let[E,_]=S;return Array.isArray(_)?_.includes({...s,...u}[E]):{...s,...u}[E]===_})?[...h,g,y]:h},[]);return t0(e,c,f,n==null?void 0:n.class,n==null?void 0:n.className)},sD=J1("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"}}),eE=w.forwardRef(({className:e,variant:t,...n},a)=>x.jsx("div",{ref:a,role:"alert",className:Me(sD({variant:t}),e),...n}));eE.displayName="Alert";const tE=w.forwardRef(({className:e,...t},n)=>x.jsx("h5",{ref:n,className:Me("mb-1 leading-none font-medium tracking-tight",e),...t}));tE.displayName="AlertTitle";const nE=w.forwardRef(({className:e,...t},n)=>x.jsx("div",{ref:n,className:Me("text-sm [&_p]:leading-relaxed",e),...t}));nE.displayName="AlertDescription";function rE(e,t){return function(){return e.apply(t,arguments)}}const{toString:lD}=Object.prototype,{getPrototypeOf:Zm}=Object,Vu=(e=>t=>{const n=lD.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),ur=e=>(e=e.toLowerCase(),t=>Vu(t)===e),qu=e=>t=>typeof t===e,{isArray:Fo}=Array,ol=qu("undefined");function cD(e){return e!==null&&!ol(e)&&e.constructor!==null&&!ol(e.constructor)&&On(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const aE=ur("ArrayBuffer");function uD(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&aE(e.buffer),t}const dD=qu("string"),On=qu("function"),iE=qu("number"),Yu=e=>e!==null&&typeof e=="object",fD=e=>e===!0||e===!1,su=e=>{if(Vu(e)!=="object")return!1;const t=Zm(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)},hD=ur("Date"),pD=ur("File"),mD=ur("Blob"),gD=ur("FileList"),vD=e=>Yu(e)&&On(e.pipe),yD=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||On(e.append)&&((t=Vu(e))==="formdata"||t==="object"&&On(e.toString)&&e.toString()==="[object FormData]"))},bD=ur("URLSearchParams"),[xD,wD,ED,SD]=["ReadableStream","Request","Response","Headers"].map(ur),_D=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function gl(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let a,o;if(typeof e!="object"&&(e=[e]),Fo(e))for(a=0,o=e.length;a0;)if(o=n[a],t===o.toLowerCase())return o;return null}const Ei=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,sE=e=>!ol(e)&&e!==Ei;function Jp(){const{caseless:e}=sE(this)&&this||{},t={},n=(a,o)=>{const s=e&&oE(t,o)||o;su(t[s])&&su(a)?t[s]=Jp(t[s],a):su(a)?t[s]=Jp({},a):Fo(a)?t[s]=a.slice():t[s]=a};for(let a=0,o=arguments.length;a(gl(t,(o,s)=>{n&&On(o)?e[s]=rE(o,n):e[s]=o},{allOwnKeys:a}),e),CD=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),RD=(e,t,n,a)=>{e.prototype=Object.create(t.prototype,a),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},AD=(e,t,n,a)=>{let o,s,c;const u={};if(t=t||{},e==null)return t;do{for(o=Object.getOwnPropertyNames(e),s=o.length;s-- >0;)c=o[s],(!a||a(c,e,t))&&!u[c]&&(t[c]=e[c],u[c]=!0);e=n!==!1&&Zm(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},kD=(e,t,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=t.length;const a=e.indexOf(t,n);return a!==-1&&a===n},DD=e=>{if(!e)return null;if(Fo(e))return e;let t=e.length;if(!iE(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},ND=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&Zm(Uint8Array)),OD=(e,t)=>{const a=(e&&e[Symbol.iterator]).call(e);let o;for(;(o=a.next())&&!o.done;){const s=o.value;t.call(e,s[0],s[1])}},jD=(e,t)=>{let n;const a=[];for(;(n=e.exec(t))!==null;)a.push(n);return a},LD=ur("HTMLFormElement"),zD=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,a,o){return a.toUpperCase()+o}),n0=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),MD=ur("RegExp"),lE=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),a={};gl(n,(o,s)=>{let c;(c=t(o,s,e))!==!1&&(a[s]=c||o)}),Object.defineProperties(e,a)},PD=e=>{lE(e,(t,n)=>{if(On(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const a=e[n];if(On(a)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},GD=(e,t)=>{const n={},a=o=>{o.forEach(s=>{n[s]=!0})};return Fo(e)?a(e):a(String(e).split(t)),n},FD=()=>{},UD=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t,Fh="abcdefghijklmnopqrstuvwxyz",r0="0123456789",cE={DIGIT:r0,ALPHA:Fh,ALPHA_DIGIT:Fh+Fh.toUpperCase()+r0},BD=(e=16,t=cE.ALPHA_DIGIT)=>{let n="";const{length:a}=t;for(;e--;)n+=t[Math.random()*a|0];return n};function ID(e){return!!(e&&On(e.append)&&e[Symbol.toStringTag]==="FormData"&&e[Symbol.iterator])}const HD=e=>{const t=new Array(10),n=(a,o)=>{if(Yu(a)){if(t.indexOf(a)>=0)return;if(!("toJSON"in a)){t[o]=a;const s=Fo(a)?[]:{};return gl(a,(c,u)=>{const f=n(c,o+1);!ol(f)&&(s[u]=f)}),t[o]=void 0,s}}return a};return n(e,0)},$D=ur("AsyncFunction"),VD=e=>e&&(Yu(e)||On(e))&&On(e.then)&&On(e.catch),uE=((e,t)=>e?setImmediate:t?((n,a)=>(Ei.addEventListener("message",({source:o,data:s})=>{o===Ei&&s===n&&a.length&&a.shift()()},!1),o=>{a.push(o),Ei.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",On(Ei.postMessage)),qD=typeof queueMicrotask<"u"?queueMicrotask.bind(Ei):typeof process<"u"&&process.nextTick||uE,ce={isArray:Fo,isArrayBuffer:aE,isBuffer:cD,isFormData:yD,isArrayBufferView:uD,isString:dD,isNumber:iE,isBoolean:fD,isObject:Yu,isPlainObject:su,isReadableStream:xD,isRequest:wD,isResponse:ED,isHeaders:SD,isUndefined:ol,isDate:hD,isFile:pD,isBlob:mD,isRegExp:MD,isFunction:On,isStream:vD,isURLSearchParams:bD,isTypedArray:ND,isFileList:gD,forEach:gl,merge:Jp,extend:TD,trim:_D,stripBOM:CD,inherits:RD,toFlatObject:AD,kindOf:Vu,kindOfTest:ur,endsWith:kD,toArray:DD,forEachEntry:OD,matchAll:jD,isHTMLForm:LD,hasOwnProperty:n0,hasOwnProp:n0,reduceDescriptors:lE,freezeMethods:PD,toObjectSet:GD,toCamelCase:zD,noop:FD,toFiniteNumber:UD,findKey:oE,global:Ei,isContextDefined:sE,ALPHABET:cE,generateString:BD,isSpecCompliantForm:ID,toJSONObject:HD,isAsyncFn:$D,isThenable:VD,setImmediate:uE,asap:qD};function Xe(e,t,n,a,o){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),a&&(this.request=a),o&&(this.response=o,this.status=o.status?o.status:null)}ce.inherits(Xe,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:ce.toJSONObject(this.config),code:this.code,status:this.status}}});const dE=Xe.prototype,fE={};["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=>{fE[e]={value:e}});Object.defineProperties(Xe,fE);Object.defineProperty(dE,"isAxiosError",{value:!0});Xe.from=(e,t,n,a,o,s)=>{const c=Object.create(dE);return ce.toFlatObject(e,c,function(f){return f!==Error.prototype},u=>u!=="isAxiosError"),Xe.call(c,e.message,t,n,a,o),c.cause=e,c.name=e.name,s&&Object.assign(c,s),c};const YD=null;function em(e){return ce.isPlainObject(e)||ce.isArray(e)}function hE(e){return ce.endsWith(e,"[]")?e.slice(0,-2):e}function a0(e,t,n){return e?e.concat(t).map(function(o,s){return o=hE(o),!n&&s?"["+o+"]":o}).join(n?".":""):t}function WD(e){return ce.isArray(e)&&!e.some(em)}const XD=ce.toFlatObject(ce,{},null,function(t){return/^is[A-Z]/.test(t)});function Wu(e,t,n){if(!ce.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,n=ce.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(E,_){return!ce.isUndefined(_[E])});const a=n.metaTokens,o=n.visitor||m,s=n.dots,c=n.indexes,f=(n.Blob||typeof Blob<"u"&&Blob)&&ce.isSpecCompliantForm(t);if(!ce.isFunction(o))throw new TypeError("visitor must be a function");function h(S){if(S===null)return"";if(ce.isDate(S))return S.toISOString();if(!f&&ce.isBlob(S))throw new Xe("Blob is not supported. Use a Buffer instead.");return ce.isArrayBuffer(S)||ce.isTypedArray(S)?f&&typeof Blob=="function"?new Blob([S]):Buffer.from(S):S}function m(S,E,_){let N=S;if(S&&!_&&typeof S=="object"){if(ce.endsWith(E,"{}"))E=a?E:E.slice(0,-2),S=JSON.stringify(S);else if(ce.isArray(S)&&WD(S)||(ce.isFileList(S)||ce.endsWith(E,"[]"))&&(N=ce.toArray(S)))return E=hE(E),N.forEach(function(A,D){!(ce.isUndefined(A)||A===null)&&t.append(c===!0?a0([E],D,s):c===null?E:E+"[]",h(A))}),!1}return em(S)?!0:(t.append(a0(_,E,s),h(S)),!1)}const g=[],y=Object.assign(XD,{defaultVisitor:m,convertValue:h,isVisitable:em});function b(S,E){if(!ce.isUndefined(S)){if(g.indexOf(S)!==-1)throw Error("Circular reference detected in "+E.join("."));g.push(S),ce.forEach(S,function(N,T){(!(ce.isUndefined(N)||N===null)&&o.call(t,N,ce.isString(T)?T.trim():T,E,y))===!0&&b(N,E?E.concat(T):[T])}),g.pop()}}if(!ce.isObject(e))throw new TypeError("data must be an object");return b(e),t}function i0(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(a){return t[a]})}function Qm(e,t){this._pairs=[],e&&Wu(e,this,t)}const pE=Qm.prototype;pE.append=function(t,n){this._pairs.push([t,n])};pE.toString=function(t){const n=t?function(a){return t.call(this,a,i0)}:i0;return this._pairs.map(function(o){return n(o[0])+"="+n(o[1])},"").join("&")};function KD(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function mE(e,t,n){if(!t)return e;const a=n&&n.encode||KD;ce.isFunction(n)&&(n={serialize:n});const o=n&&n.serialize;let s;if(o?s=o(t,n):s=ce.isURLSearchParams(t)?t.toString():new Qm(t,n).toString(a),s){const c=e.indexOf("#");c!==-1&&(e=e.slice(0,c)),e+=(e.indexOf("?")===-1?"?":"&")+s}return e}class o0{constructor(){this.handlers=[]}use(t,n,a){return this.handlers.push({fulfilled:t,rejected:n,synchronous:a?a.synchronous:!1,runWhen:a?a.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){ce.forEach(this.handlers,function(a){a!==null&&t(a)})}}const gE={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},ZD=typeof URLSearchParams<"u"?URLSearchParams:Qm,QD=typeof FormData<"u"?FormData:null,JD=typeof Blob<"u"?Blob:null,eN={isBrowser:!0,classes:{URLSearchParams:ZD,FormData:QD,Blob:JD},protocols:["http","https","file","blob","url","data"]},Jm=typeof window<"u"&&typeof document<"u",tm=typeof navigator=="object"&&navigator||void 0,tN=Jm&&(!tm||["ReactNative","NativeScript","NS"].indexOf(tm.product)<0),nN=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",rN=Jm&&window.location.href||"http://localhost",aN=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:Jm,hasStandardBrowserEnv:tN,hasStandardBrowserWebWorkerEnv:nN,navigator:tm,origin:rN},Symbol.toStringTag,{value:"Module"})),rn={...aN,...eN};function iN(e,t){return Wu(e,new rn.classes.URLSearchParams,Object.assign({visitor:function(n,a,o,s){return rn.isNode&&ce.isBuffer(n)?(this.append(a,n.toString("base64")),!1):s.defaultVisitor.apply(this,arguments)}},t))}function oN(e){return ce.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function sN(e){const t={},n=Object.keys(e);let a;const o=n.length;let s;for(a=0;a=n.length;return c=!c&&ce.isArray(o)?o.length:c,f?(ce.hasOwnProp(o,c)?o[c]=[o[c],a]:o[c]=a,!u):((!o[c]||!ce.isObject(o[c]))&&(o[c]=[]),t(n,a,o[c],s)&&ce.isArray(o[c])&&(o[c]=sN(o[c])),!u)}if(ce.isFormData(e)&&ce.isFunction(e.entries)){const n={};return ce.forEachEntry(e,(a,o)=>{t(oN(a),o,n,0)}),n}return null}function lN(e,t,n){if(ce.isString(e))try{return(t||JSON.parse)(e),ce.trim(e)}catch(a){if(a.name!=="SyntaxError")throw a}return(n||JSON.stringify)(e)}const vl={transitional:gE,adapter:["xhr","http","fetch"],transformRequest:[function(t,n){const a=n.getContentType()||"",o=a.indexOf("application/json")>-1,s=ce.isObject(t);if(s&&ce.isHTMLForm(t)&&(t=new FormData(t)),ce.isFormData(t))return o?JSON.stringify(vE(t)):t;if(ce.isArrayBuffer(t)||ce.isBuffer(t)||ce.isStream(t)||ce.isFile(t)||ce.isBlob(t)||ce.isReadableStream(t))return t;if(ce.isArrayBufferView(t))return t.buffer;if(ce.isURLSearchParams(t))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let u;if(s){if(a.indexOf("application/x-www-form-urlencoded")>-1)return iN(t,this.formSerializer).toString();if((u=ce.isFileList(t))||a.indexOf("multipart/form-data")>-1){const f=this.env&&this.env.FormData;return Wu(u?{"files[]":t}:t,f&&new f,this.formSerializer)}}return s||o?(n.setContentType("application/json",!1),lN(t)):t}],transformResponse:[function(t){const n=this.transitional||vl.transitional,a=n&&n.forcedJSONParsing,o=this.responseType==="json";if(ce.isResponse(t)||ce.isReadableStream(t))return t;if(t&&ce.isString(t)&&(a&&!this.responseType||o)){const c=!(n&&n.silentJSONParsing)&&o;try{return JSON.parse(t)}catch(u){if(c)throw u.name==="SyntaxError"?Xe.from(u,Xe.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:rn.classes.FormData,Blob:rn.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};ce.forEach(["delete","get","head","post","put","patch"],e=>{vl.headers[e]={}});const cN=ce.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"]),uN=e=>{const t={};let n,a,o;return e&&e.split(` -`).forEach(function(c){o=c.indexOf(":"),n=c.substring(0,o).trim().toLowerCase(),a=c.substring(o+1).trim(),!(!n||t[n]&&cN[n])&&(n==="set-cookie"?t[n]?t[n].push(a):t[n]=[a]:t[n]=t[n]?t[n]+", "+a:a)}),t},s0=Symbol("internals");function qs(e){return e&&String(e).trim().toLowerCase()}function lu(e){return e===!1||e==null?e:ce.isArray(e)?e.map(lu):String(e)}function dN(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let a;for(;a=n.exec(e);)t[a[1]]=a[2];return t}const fN=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function Uh(e,t,n,a,o){if(ce.isFunction(a))return a.call(this,t,n);if(o&&(t=n),!!ce.isString(t)){if(ce.isString(a))return t.indexOf(a)!==-1;if(ce.isRegExp(a))return a.test(t)}}function hN(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,a)=>n.toUpperCase()+a)}function pN(e,t){const n=ce.toCamelCase(" "+t);["get","set","has"].forEach(a=>{Object.defineProperty(e,a+n,{value:function(o,s,c){return this[a].call(this,t,o,s,c)},configurable:!0})})}let wn=class{constructor(t){t&&this.set(t)}set(t,n,a){const o=this;function s(u,f,h){const m=qs(f);if(!m)throw new Error("header name must be a non-empty string");const g=ce.findKey(o,m);(!g||o[g]===void 0||h===!0||h===void 0&&o[g]!==!1)&&(o[g||f]=lu(u))}const c=(u,f)=>ce.forEach(u,(h,m)=>s(h,m,f));if(ce.isPlainObject(t)||t instanceof this.constructor)c(t,n);else if(ce.isString(t)&&(t=t.trim())&&!fN(t))c(uN(t),n);else if(ce.isHeaders(t))for(const[u,f]of t.entries())s(f,u,a);else t!=null&&s(n,t,a);return this}get(t,n){if(t=qs(t),t){const a=ce.findKey(this,t);if(a){const o=this[a];if(!n)return o;if(n===!0)return dN(o);if(ce.isFunction(n))return n.call(this,o,a);if(ce.isRegExp(n))return n.exec(o);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,n){if(t=qs(t),t){const a=ce.findKey(this,t);return!!(a&&this[a]!==void 0&&(!n||Uh(this,this[a],a,n)))}return!1}delete(t,n){const a=this;let o=!1;function s(c){if(c=qs(c),c){const u=ce.findKey(a,c);u&&(!n||Uh(a,a[u],u,n))&&(delete a[u],o=!0)}}return ce.isArray(t)?t.forEach(s):s(t),o}clear(t){const n=Object.keys(this);let a=n.length,o=!1;for(;a--;){const s=n[a];(!t||Uh(this,this[s],s,t,!0))&&(delete this[s],o=!0)}return o}normalize(t){const n=this,a={};return ce.forEach(this,(o,s)=>{const c=ce.findKey(a,s);if(c){n[c]=lu(o),delete n[s];return}const u=t?hN(s):String(s).trim();u!==s&&delete n[s],n[u]=lu(o),a[u]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const n=Object.create(null);return ce.forEach(this,(a,o)=>{a!=null&&a!==!1&&(n[o]=t&&ce.isArray(a)?a.join(", "):a)}),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 a=new this(t);return n.forEach(o=>a.set(o)),a}static accessor(t){const a=(this[s0]=this[s0]={accessors:{}}).accessors,o=this.prototype;function s(c){const u=qs(c);a[u]||(pN(o,c),a[u]=!0)}return ce.isArray(t)?t.forEach(s):s(t),this}};wn.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);ce.reduceDescriptors(wn.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(a){this[n]=a}}});ce.freezeMethods(wn);function Bh(e,t){const n=this||vl,a=t||n,o=wn.from(a.headers);let s=a.data;return ce.forEach(e,function(u){s=u.call(n,s,o.normalize(),t?t.status:void 0)}),o.normalize(),s}function yE(e){return!!(e&&e.__CANCEL__)}function Uo(e,t,n){Xe.call(this,e??"canceled",Xe.ERR_CANCELED,t,n),this.name="CanceledError"}ce.inherits(Uo,Xe,{__CANCEL__:!0});function bE(e,t,n){const a=n.config.validateStatus;!n.status||!a||a(n.status)?e(n):t(new Xe("Request failed with status code "+n.status,[Xe.ERR_BAD_REQUEST,Xe.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function mN(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function gN(e,t){e=e||10;const n=new Array(e),a=new Array(e);let o=0,s=0,c;return t=t!==void 0?t:1e3,function(f){const h=Date.now(),m=a[s];c||(c=h),n[o]=f,a[o]=h;let g=s,y=0;for(;g!==o;)y+=n[g++],g=g%e;if(o=(o+1)%e,o===s&&(s=(s+1)%e),h-c{n=m,o=null,s&&(clearTimeout(s),s=null),e.apply(null,h)};return[(...h)=>{const m=Date.now(),g=m-n;g>=a?c(h,m):(o=h,s||(s=setTimeout(()=>{s=null,c(o)},a-g)))},()=>o&&c(o)]}const Su=(e,t,n=3)=>{let a=0;const o=gN(50,250);return vN(s=>{const c=s.loaded,u=s.lengthComputable?s.total:void 0,f=c-a,h=o(f),m=c<=u;a=c;const g={loaded:c,total:u,progress:u?c/u:void 0,bytes:f,rate:h||void 0,estimated:h&&u&&m?(u-c)/h:void 0,event:s,lengthComputable:u!=null,[t?"download":"upload"]:!0};e(g)},n)},l0=(e,t)=>{const n=e!=null;return[a=>t[0]({lengthComputable:n,total:e,loaded:a}),t[1]]},c0=e=>(...t)=>ce.asap(()=>e(...t)),yN=rn.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,rn.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(rn.origin),rn.navigator&&/(msie|trident)/i.test(rn.navigator.userAgent)):()=>!0,bN=rn.hasStandardBrowserEnv?{write(e,t,n,a,o,s){const c=[e+"="+encodeURIComponent(t)];ce.isNumber(n)&&c.push("expires="+new Date(n).toGMTString()),ce.isString(a)&&c.push("path="+a),ce.isString(o)&&c.push("domain="+o),s===!0&&c.push("secure"),document.cookie=c.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 xN(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function wN(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function xE(e,t){return e&&!xN(t)?wN(e,t):t}const u0=e=>e instanceof wn?{...e}:e;function _i(e,t){t=t||{};const n={};function a(h,m,g,y){return ce.isPlainObject(h)&&ce.isPlainObject(m)?ce.merge.call({caseless:y},h,m):ce.isPlainObject(m)?ce.merge({},m):ce.isArray(m)?m.slice():m}function o(h,m,g,y){if(ce.isUndefined(m)){if(!ce.isUndefined(h))return a(void 0,h,g,y)}else return a(h,m,g,y)}function s(h,m){if(!ce.isUndefined(m))return a(void 0,m)}function c(h,m){if(ce.isUndefined(m)){if(!ce.isUndefined(h))return a(void 0,h)}else return a(void 0,m)}function u(h,m,g){if(g in t)return a(h,m);if(g in e)return a(void 0,h)}const f={url:s,method:s,data:s,baseURL:c,transformRequest:c,transformResponse:c,paramsSerializer:c,timeout:c,timeoutMessage:c,withCredentials:c,withXSRFToken:c,adapter:c,responseType:c,xsrfCookieName:c,xsrfHeaderName:c,onUploadProgress:c,onDownloadProgress:c,decompress:c,maxContentLength:c,maxBodyLength:c,beforeRedirect:c,transport:c,httpAgent:c,httpsAgent:c,cancelToken:c,socketPath:c,responseEncoding:c,validateStatus:u,headers:(h,m,g)=>o(u0(h),u0(m),g,!0)};return ce.forEach(Object.keys(Object.assign({},e,t)),function(m){const g=f[m]||o,y=g(e[m],t[m],m);ce.isUndefined(y)&&g!==u||(n[m]=y)}),n}const wE=e=>{const t=_i({},e);let{data:n,withXSRFToken:a,xsrfHeaderName:o,xsrfCookieName:s,headers:c,auth:u}=t;t.headers=c=wn.from(c),t.url=mE(xE(t.baseURL,t.url),e.params,e.paramsSerializer),u&&c.set("Authorization","Basic "+btoa((u.username||"")+":"+(u.password?unescape(encodeURIComponent(u.password)):"")));let f;if(ce.isFormData(n)){if(rn.hasStandardBrowserEnv||rn.hasStandardBrowserWebWorkerEnv)c.setContentType(void 0);else if((f=c.getContentType())!==!1){const[h,...m]=f?f.split(";").map(g=>g.trim()).filter(Boolean):[];c.setContentType([h||"multipart/form-data",...m].join("; "))}}if(rn.hasStandardBrowserEnv&&(a&&ce.isFunction(a)&&(a=a(t)),a||a!==!1&&yN(t.url))){const h=o&&s&&bN.read(s);h&&c.set(o,h)}return t},EN=typeof XMLHttpRequest<"u",SN=EN&&function(e){return new Promise(function(n,a){const o=wE(e);let s=o.data;const c=wn.from(o.headers).normalize();let{responseType:u,onUploadProgress:f,onDownloadProgress:h}=o,m,g,y,b,S;function E(){b&&b(),S&&S(),o.cancelToken&&o.cancelToken.unsubscribe(m),o.signal&&o.signal.removeEventListener("abort",m)}let _=new XMLHttpRequest;_.open(o.method.toUpperCase(),o.url,!0),_.timeout=o.timeout;function N(){if(!_)return;const A=wn.from("getAllResponseHeaders"in _&&_.getAllResponseHeaders()),k={data:!u||u==="text"||u==="json"?_.responseText:_.response,status:_.status,statusText:_.statusText,headers:A,config:e,request:_};bE(function(R){n(R),E()},function(R){a(R),E()},k),_=null}"onloadend"in _?_.onloadend=N:_.onreadystatechange=function(){!_||_.readyState!==4||_.status===0&&!(_.responseURL&&_.responseURL.indexOf("file:")===0)||setTimeout(N)},_.onabort=function(){_&&(a(new Xe("Request aborted",Xe.ECONNABORTED,e,_)),_=null)},_.onerror=function(){a(new Xe("Network Error",Xe.ERR_NETWORK,e,_)),_=null},_.ontimeout=function(){let D=o.timeout?"timeout of "+o.timeout+"ms exceeded":"timeout exceeded";const k=o.transitional||gE;o.timeoutErrorMessage&&(D=o.timeoutErrorMessage),a(new Xe(D,k.clarifyTimeoutError?Xe.ETIMEDOUT:Xe.ECONNABORTED,e,_)),_=null},s===void 0&&c.setContentType(null),"setRequestHeader"in _&&ce.forEach(c.toJSON(),function(D,k){_.setRequestHeader(k,D)}),ce.isUndefined(o.withCredentials)||(_.withCredentials=!!o.withCredentials),u&&u!=="json"&&(_.responseType=o.responseType),h&&([y,S]=Su(h,!0),_.addEventListener("progress",y)),f&&_.upload&&([g,b]=Su(f),_.upload.addEventListener("progress",g),_.upload.addEventListener("loadend",b)),(o.cancelToken||o.signal)&&(m=A=>{_&&(a(!A||A.type?new Uo(null,e,_):A),_.abort(),_=null)},o.cancelToken&&o.cancelToken.subscribe(m),o.signal&&(o.signal.aborted?m():o.signal.addEventListener("abort",m)));const T=mN(o.url);if(T&&rn.protocols.indexOf(T)===-1){a(new Xe("Unsupported protocol "+T+":",Xe.ERR_BAD_REQUEST,e));return}_.send(s||null)})},_N=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let a=new AbortController,o;const s=function(h){if(!o){o=!0,u();const m=h instanceof Error?h:this.reason;a.abort(m instanceof Xe?m:new Uo(m instanceof Error?m.message:m))}};let c=t&&setTimeout(()=>{c=null,s(new Xe(`timeout ${t} of ms exceeded`,Xe.ETIMEDOUT))},t);const u=()=>{e&&(c&&clearTimeout(c),c=null,e.forEach(h=>{h.unsubscribe?h.unsubscribe(s):h.removeEventListener("abort",s)}),e=null)};e.forEach(h=>h.addEventListener("abort",s));const{signal:f}=a;return f.unsubscribe=()=>ce.asap(u),f}},TN=function*(e,t){let n=e.byteLength;if(n{const o=CN(e,t);let s=0,c,u=f=>{c||(c=!0,a&&a(f))};return new ReadableStream({async pull(f){try{const{done:h,value:m}=await o.next();if(h){u(),f.close();return}let g=m.byteLength;if(n){let y=s+=g;n(y)}f.enqueue(new Uint8Array(m))}catch(h){throw u(h),h}},cancel(f){return u(f),o.return()}},{highWaterMark:2})},Xu=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",EE=Xu&&typeof ReadableStream=="function",AN=Xu&&(typeof TextEncoder=="function"?(e=>t=>e.encode(t))(new TextEncoder):async e=>new Uint8Array(await new Response(e).arrayBuffer())),SE=(e,...t)=>{try{return!!e(...t)}catch{return!1}},kN=EE&&SE(()=>{let e=!1;const t=new Request(rn.origin,{body:new ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t}),f0=64*1024,nm=EE&&SE(()=>ce.isReadableStream(new Response("").body)),_u={stream:nm&&(e=>e.body)};Xu&&(e=>{["text","arrayBuffer","blob","formData","stream"].forEach(t=>{!_u[t]&&(_u[t]=ce.isFunction(e[t])?n=>n[t]():(n,a)=>{throw new Xe(`Response type '${t}' is not supported`,Xe.ERR_NOT_SUPPORT,a)})})})(new Response);const DN=async e=>{if(e==null)return 0;if(ce.isBlob(e))return e.size;if(ce.isSpecCompliantForm(e))return(await new Request(rn.origin,{method:"POST",body:e}).arrayBuffer()).byteLength;if(ce.isArrayBufferView(e)||ce.isArrayBuffer(e))return e.byteLength;if(ce.isURLSearchParams(e)&&(e=e+""),ce.isString(e))return(await AN(e)).byteLength},NN=async(e,t)=>{const n=ce.toFiniteNumber(e.getContentLength());return n??DN(t)},ON=Xu&&(async e=>{let{url:t,method:n,data:a,signal:o,cancelToken:s,timeout:c,onDownloadProgress:u,onUploadProgress:f,responseType:h,headers:m,withCredentials:g="same-origin",fetchOptions:y}=wE(e);h=h?(h+"").toLowerCase():"text";let b=_N([o,s&&s.toAbortSignal()],c),S;const E=b&&b.unsubscribe&&(()=>{b.unsubscribe()});let _;try{if(f&&kN&&n!=="get"&&n!=="head"&&(_=await NN(m,a))!==0){let k=new Request(t,{method:"POST",body:a,duplex:"half"}),M;if(ce.isFormData(a)&&(M=k.headers.get("content-type"))&&m.setContentType(M),k.body){const[R,U]=l0(_,Su(c0(f)));a=d0(k.body,f0,R,U)}}ce.isString(g)||(g=g?"include":"omit");const N="credentials"in Request.prototype;S=new Request(t,{...y,signal:b,method:n.toUpperCase(),headers:m.normalize().toJSON(),body:a,duplex:"half",credentials:N?g:void 0});let T=await fetch(S);const A=nm&&(h==="stream"||h==="response");if(nm&&(u||A&&E)){const k={};["status","statusText","headers"].forEach(L=>{k[L]=T[L]});const M=ce.toFiniteNumber(T.headers.get("content-length")),[R,U]=u&&l0(M,Su(c0(u),!0))||[];T=new Response(d0(T.body,f0,R,()=>{U&&U(),E&&E()}),k)}h=h||"text";let D=await _u[ce.findKey(_u,h)||"text"](T,e);return!A&&E&&E(),await new Promise((k,M)=>{bE(k,M,{data:D,headers:wn.from(T.headers),status:T.status,statusText:T.statusText,config:e,request:S})})}catch(N){throw E&&E(),N&&N.name==="TypeError"&&/fetch/i.test(N.message)?Object.assign(new Xe("Network Error",Xe.ERR_NETWORK,e,S),{cause:N.cause||N}):Xe.from(N,N&&N.code,e,S)}}),rm={http:YD,xhr:SN,fetch:ON};ce.forEach(rm,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const h0=e=>`- ${e}`,jN=e=>ce.isFunction(e)||e===null||e===!1,_E={getAdapter:e=>{e=ce.isArray(e)?e:[e];const{length:t}=e;let n,a;const o={};for(let s=0;s`adapter ${u} `+(f===!1?"is not supported by the environment":"is not available in the build"));let c=t?s.length>1?`since : -`+s.map(h0).join(` -`):" "+h0(s[0]):"as no adapter specified";throw new Xe("There is no suitable adapter to dispatch the request "+c,"ERR_NOT_SUPPORT")}return a},adapters:rm};function Ih(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Uo(null,e)}function p0(e){return Ih(e),e.headers=wn.from(e.headers),e.data=Bh.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),_E.getAdapter(e.adapter||vl.adapter)(e).then(function(a){return Ih(e),a.data=Bh.call(e,e.transformResponse,a),a.headers=wn.from(a.headers),a},function(a){return yE(a)||(Ih(e),a&&a.response&&(a.response.data=Bh.call(e,e.transformResponse,a.response),a.response.headers=wn.from(a.response.headers))),Promise.reject(a)})}const TE="1.7.9",Ku={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{Ku[e]=function(a){return typeof a===e||"a"+(t<1?"n ":" ")+e}});const m0={};Ku.transitional=function(t,n,a){function o(s,c){return"[Axios v"+TE+"] Transitional option '"+s+"'"+c+(a?". "+a:"")}return(s,c,u)=>{if(t===!1)throw new Xe(o(c," has been removed"+(n?" in "+n:"")),Xe.ERR_DEPRECATED);return n&&!m0[c]&&(m0[c]=!0,console.warn(o(c," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(s,c,u):!0}};Ku.spelling=function(t){return(n,a)=>(console.warn(`${a} is likely a misspelling of ${t}`),!0)};function LN(e,t,n){if(typeof e!="object")throw new Xe("options must be an object",Xe.ERR_BAD_OPTION_VALUE);const a=Object.keys(e);let o=a.length;for(;o-- >0;){const s=a[o],c=t[s];if(c){const u=e[s],f=u===void 0||c(u,s,e);if(f!==!0)throw new Xe("option "+s+" must be "+f,Xe.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new Xe("Unknown option "+s,Xe.ERR_BAD_OPTION)}}const cu={assertOptions:LN,validators:Ku},br=cu.validators;let Si=class{constructor(t){this.defaults=t,this.interceptors={request:new o0,response:new o0}}async request(t,n){try{return await this._request(t,n)}catch(a){if(a instanceof Error){let o={};Error.captureStackTrace?Error.captureStackTrace(o):o=new Error;const s=o.stack?o.stack.replace(/^.+\n/,""):"";try{a.stack?s&&!String(a.stack).endsWith(s.replace(/^.+\n.+\n/,""))&&(a.stack+=` -`+s):a.stack=s}catch{}}throw a}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=_i(this.defaults,n);const{transitional:a,paramsSerializer:o,headers:s}=n;a!==void 0&&cu.assertOptions(a,{silentJSONParsing:br.transitional(br.boolean),forcedJSONParsing:br.transitional(br.boolean),clarifyTimeoutError:br.transitional(br.boolean)},!1),o!=null&&(ce.isFunction(o)?n.paramsSerializer={serialize:o}:cu.assertOptions(o,{encode:br.function,serialize:br.function},!0)),cu.assertOptions(n,{baseUrl:br.spelling("baseURL"),withXsrfToken:br.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let c=s&&ce.merge(s.common,s[n.method]);s&&ce.forEach(["delete","get","head","post","put","patch","common"],S=>{delete s[S]}),n.headers=wn.concat(c,s);const u=[];let f=!0;this.interceptors.request.forEach(function(E){typeof E.runWhen=="function"&&E.runWhen(n)===!1||(f=f&&E.synchronous,u.unshift(E.fulfilled,E.rejected))});const h=[];this.interceptors.response.forEach(function(E){h.push(E.fulfilled,E.rejected)});let m,g=0,y;if(!f){const S=[p0.bind(this),void 0];for(S.unshift.apply(S,u),S.push.apply(S,h),y=S.length,m=Promise.resolve(n);g{if(!a._listeners)return;let s=a._listeners.length;for(;s-- >0;)a._listeners[s](o);a._listeners=null}),this.promise.then=o=>{let s;const c=new Promise(u=>{a.subscribe(u),s=u}).then(o);return c.cancel=function(){a.unsubscribe(s)},c},t(function(s,c,u){a.reason||(a.reason=new Uo(s,c,u),n(a.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=a=>{t.abort(a)};return this.subscribe(n),t.signal.unsubscribe=()=>this.unsubscribe(n),t.signal}static source(){let t;return{token:new CE(function(o){t=o}),cancel:t}}};function MN(e){return function(n){return e.apply(null,n)}}function PN(e){return ce.isObject(e)&&e.isAxiosError===!0}const am={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(am).forEach(([e,t])=>{am[t]=e});function RE(e){const t=new Si(e),n=rE(Si.prototype.request,t);return ce.extend(n,Si.prototype,t,{allOwnKeys:!0}),ce.extend(n,t,null,{allOwnKeys:!0}),n.create=function(o){return RE(_i(e,o))},n}const Dt=RE(vl);Dt.Axios=Si;Dt.CanceledError=Uo;Dt.CancelToken=zN;Dt.isCancel=yE;Dt.VERSION=TE;Dt.toFormData=Wu;Dt.AxiosError=Xe;Dt.Cancel=Dt.CanceledError;Dt.all=function(t){return Promise.all(t)};Dt.spread=MN;Dt.isAxiosError=PN;Dt.mergeConfig=_i;Dt.AxiosHeaders=wn;Dt.formToJSON=e=>vE(ce.isHTMLForm(e)?new FormData(e):e);Dt.getAdapter=_E.getAdapter;Dt.HttpStatusCode=am;Dt.default=Dt;const{Axios:MI,AxiosError:PI,CanceledError:GI,isCancel:FI,CancelToken:UI,VERSION:BI,all:II,Cancel:HI,isAxiosError:$I,spread:VI,toFormData:qI,AxiosHeaders:YI,HttpStatusCode:WI,formToJSON:XI,getAdapter:KI,mergeConfig:ZI}=Dt,dr=Dt.create({baseURL:Z1,headers:{"Content-Type":"application/json"}});dr.interceptors.request.use(e=>{const t=We.getState().apiKey;return t&&(e.headers["X-API-Key"]=t),e});dr.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 GN=async e=>(await dr.get(`/graphs?label=${e}`)).data,FN=async()=>(await dr.get("/graph/label/list")).data,UN=async()=>{try{return(await dr.get("/health")).data}catch(e){return{status:"error",message:Sr(e)}}},BN=async()=>(await dr.get("/documents")).data,IN=async()=>(await dr.post("/documents/scan")).data,HN=async e=>(await dr.post("/query",e)).data,$N=async(e,t,n)=>{try{let a="";if(await dr.post("/query/stream",e,{responseType:"text",headers:{Accept:"application/x-ndjson"},transformResponse:[o=>{a+=o;const s=a.split(` -`);a=s.pop()||"";for(const c of s)if(c.trim())try{const u=JSON.parse(c);u.response?t(u.response):u.error}catch(u){console.error("Error parsing stream chunk:",u)}return o}]}),a.trim())try{const o=JSON.parse(a);o.response?t(o.response):o.error}catch(o){console.error("Error parsing final chunk:",o)}}catch(a){const o=Sr(a);console.error("Stream request failed:",o)}},VN=async(e,t)=>{const n=new FormData;return n.append("file",e),(await dr.post("/documents/upload",n,{headers:{"Content-Type":"multipart/form-data"},onUploadProgress:t!==void 0?o=>{const s=Math.round(o.loaded*100/o.total);t(s)}:void 0})).data},qN=async()=>(await dr.delete("/documents")).data,YN=Ym()(e=>({health:!0,message:null,messageTitle:null,lastCheckTime:Date.now(),status:null,check:async()=>{const t=await UN();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})}})),Wn=Km(YN);/** - * @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 WN=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),AE=(...e)=>e.filter((t,n,a)=>!!t&&t.trim()!==""&&a.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 XN={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 KN=w.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:a,className:o="",children:s,iconNode:c,...u},f)=>w.createElement("svg",{ref:f,...XN,width:t,height:t,stroke:e,strokeWidth:a?Number(n)*24/Number(t):n,className:AE("lucide",o),...u},[...c.map(([h,m])=>w.createElement(h,m)),...Array.isArray(s)?s:[s]]));/** - * @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 ht=(e,t)=>{const n=w.forwardRef(({className:a,...o},s)=>w.createElement(KN,{ref:s,iconNode:t,className:AE(`lucide-${WN(e)}`,a),...o}));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 ZN=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],eg=ht("Check",ZN);/** - * @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 QN=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],tg=ht("ChevronDown",QN);/** - * @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 JN=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],kE=ht("ChevronUp",JN);/** - * @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 eO=[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]],tO=ht("ChevronsUpDown",eO);/** - * @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 nO=[["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"}]],rO=ht("CircleAlert",nO);/** - * @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 aO=[["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"}]],DE=ht("Eraser",aO);/** - * @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 iO=[["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"}]],oO=ht("FileText",iO);/** - * @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 sO=[["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"}]],lO=ht("Files",sO);/** - * @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 cO=[["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"}]],uO=ht("Fullscreen",cO);/** - * @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 dO=[["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"}]],fO=ht("Github",dO);/** - * @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 hO=[["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"}]],pO=ht("Grip",hO);/** - * @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 mO=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],NE=ht("LoaderCircle",mO);/** - * @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 gO=[["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"}]],vO=ht("Loader",gO);/** - * @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 yO=[["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"}]],bO=ht("Maximize",yO);/** - * @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 xO=[["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"}]],wO=ht("Minimize",xO);/** - * @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 EO=[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]],SO=ht("Moon",EO);/** - * @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 _O=[["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"}]],TO=ht("Pause",_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 CO=[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]],RO=ht("Play",CO);/** - * @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 AO=[["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"}]],kO=ht("RefreshCw",AO);/** - * @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 DO=[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]],NO=ht("Search",DO);/** - * @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 OO=[["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"}]],jO=ht("Send",OO);/** - * @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 LO=[["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"}]],zO=ht("Settings",LO);/** - * @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 MO=[["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"}]],PO=ht("Sun",MO);/** - * @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 GO=[["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"}]],im=ht("Upload",GO);/** - * @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 FO=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],OE=ht("X",FO);/** - * @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 UO=[["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"}]],BO=ht("Zap",UO);/** - * @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 IO=[["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"}]],HO=ht("ZoomIn",IO);/** - * @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 $O=[["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"}]],VO=ht("ZoomOut",$O),qO=()=>{const e=Wn.use.health(),t=Wn.use.message(),n=Wn.use.messageTitle(),[a,o]=w.useState(!1);return w.useEffect(()=>{setTimeout(()=>{o(!0)},50)},[]),x.jsxs(eE,{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",a?"translate-y-0 opacity-100":"-translate-y-20 opacity-0",!e&&"bg-red-700 text-white"),children:[!e&&x.jsx("div",{children:x.jsx(rO,{className:"size-4"})}),x.jsxs("div",{children:[x.jsx(tE,{className:"font-bold",children:n}),x.jsx(nE,{children:t})]})]})};function Be(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e==null||e(o),n===!1||!o.defaultPrevented)return t==null?void 0:t(o)}}function g0(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function jE(...e){return t=>{let n=!1;const a=e.map(o=>{const s=g0(o,t);return!n&&typeof s=="function"&&(n=!0),s});if(n)return()=>{for(let o=0;o{const{children:c,...u}=s,f=w.useMemo(()=>u,Object.values(u));return x.jsx(n.Provider,{value:f,children:c})};a.displayName=e+"Provider";function o(s){const c=w.useContext(n);if(c)return c;if(t!==void 0)return t;throw new Error(`\`${s}\` must be used within \`${e}\``)}return[a,o]}function fr(e,t=[]){let n=[];function a(s,c){const u=w.createContext(c),f=n.length;n=[...n,c];const h=g=>{var N;const{scope:y,children:b,...S}=g,E=((N=y==null?void 0:y[e])==null?void 0:N[f])||u,_=w.useMemo(()=>S,Object.values(S));return x.jsx(E.Provider,{value:_,children:b})};h.displayName=s+"Provider";function m(g,y){var E;const b=((E=y==null?void 0:y[e])==null?void 0:E[f])||u,S=w.useContext(b);if(S)return S;if(c!==void 0)return c;throw new Error(`\`${g}\` must be used within \`${s}\``)}return[h,m]}const o=()=>{const s=n.map(c=>w.createContext(c));return function(u){const f=(u==null?void 0:u[e])||s;return w.useMemo(()=>({[`__scope${e}`]:{...u,[e]:f}}),[u,f])}};return o.scopeName=e,[a,WO(o,...t)]}function WO(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const a=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(s){const c=a.reduce((u,{useScope:f,scopeName:h})=>{const g=f(s)[`__scope${h}`];return{...u,...g}},{});return w.useMemo(()=>({[`__scope${t.scopeName}`]:c}),[c])}};return n.scopeName=t.scopeName,n}var yl=F1();const LE=dn(yl);var Ua=w.forwardRef((e,t)=>{const{children:n,...a}=e,o=w.Children.toArray(n),s=o.find(XO);if(s){const c=s.props.children,u=o.map(f=>f===s?w.Children.count(c)>1?w.Children.only(null):w.isValidElement(c)?c.props.children:null:f);return x.jsx(om,{...a,ref:t,children:w.isValidElement(c)?w.cloneElement(c,void 0,u):null})}return x.jsx(om,{...a,ref:t,children:n})});Ua.displayName="Slot";var om=w.forwardRef((e,t)=>{const{children:n,...a}=e;if(w.isValidElement(n)){const o=ZO(n),s=KO(a,n.props);return n.type!==w.Fragment&&(s.ref=t?jE(t,o):o),w.cloneElement(n,s)}return w.Children.count(n)>1?w.Children.only(null):null});om.displayName="SlotClone";var zE=({children:e})=>x.jsx(x.Fragment,{children:e});function XO(e){return w.isValidElement(e)&&e.type===zE}function KO(e,t){const n={...t};for(const a in t){const o=e[a],s=t[a];/^on[A-Z]/.test(a)?o&&s?n[a]=(...u)=>{s(...u),o(...u)}:o&&(n[a]=o):a==="style"?n[a]={...o,...s}:a==="className"&&(n[a]=[o,s].filter(Boolean).join(" "))}return{...e,...n}}function ZO(e){var a,o;let t=(a=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:a.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var QO=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],Ie=QO.reduce((e,t)=>{const n=w.forwardRef((a,o)=>{const{asChild:s,...c}=a,u=s?Ua:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),x.jsx(u,{...c,ref:o})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function JO(e,t){e&&yl.flushSync(()=>e.dispatchEvent(t))}function Zt(e){const t=w.useRef(e);return w.useEffect(()=>{t.current=e}),w.useMemo(()=>(...n)=>{var a;return(a=t.current)==null?void 0:a.call(t,...n)},[])}function ej(e,t=globalThis==null?void 0:globalThis.document){const n=Zt(e);w.useEffect(()=>{const a=o=>{o.key==="Escape"&&n(o)};return t.addEventListener("keydown",a,{capture:!0}),()=>t.removeEventListener("keydown",a,{capture:!0})},[n,t])}var tj="DismissableLayer",sm="dismissableLayer.update",nj="dismissableLayer.pointerDownOutside",rj="dismissableLayer.focusOutside",v0,ME=w.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),bl=w.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:a,onPointerDownOutside:o,onFocusOutside:s,onInteractOutside:c,onDismiss:u,...f}=e,h=w.useContext(ME),[m,g]=w.useState(null),y=(m==null?void 0:m.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,b]=w.useState({}),S=at(t,R=>g(R)),E=Array.from(h.layers),[_]=[...h.layersWithOutsidePointerEventsDisabled].slice(-1),N=E.indexOf(_),T=m?E.indexOf(m):-1,A=h.layersWithOutsidePointerEventsDisabled.size>0,D=T>=N,k=oj(R=>{const U=R.target,L=[...h.branches].some(I=>I.contains(U));!D||L||(o==null||o(R),c==null||c(R),R.defaultPrevented||u==null||u())},y),M=sj(R=>{const U=R.target;[...h.branches].some(I=>I.contains(U))||(s==null||s(R),c==null||c(R),R.defaultPrevented||u==null||u())},y);return ej(R=>{T===h.layers.size-1&&(a==null||a(R),!R.defaultPrevented&&u&&(R.preventDefault(),u()))},y),w.useEffect(()=>{if(m)return n&&(h.layersWithOutsidePointerEventsDisabled.size===0&&(v0=y.body.style.pointerEvents,y.body.style.pointerEvents="none"),h.layersWithOutsidePointerEventsDisabled.add(m)),h.layers.add(m),y0(),()=>{n&&h.layersWithOutsidePointerEventsDisabled.size===1&&(y.body.style.pointerEvents=v0)}},[m,y,n,h]),w.useEffect(()=>()=>{m&&(h.layers.delete(m),h.layersWithOutsidePointerEventsDisabled.delete(m),y0())},[m,h]),w.useEffect(()=>{const R=()=>b({});return document.addEventListener(sm,R),()=>document.removeEventListener(sm,R)},[]),x.jsx(Ie.div,{...f,ref:S,style:{pointerEvents:A?D?"auto":"none":void 0,...e.style},onFocusCapture:Be(e.onFocusCapture,M.onFocusCapture),onBlurCapture:Be(e.onBlurCapture,M.onBlurCapture),onPointerDownCapture:Be(e.onPointerDownCapture,k.onPointerDownCapture)})});bl.displayName=tj;var aj="DismissableLayerBranch",ij=w.forwardRef((e,t)=>{const n=w.useContext(ME),a=w.useRef(null),o=at(t,a);return w.useEffect(()=>{const s=a.current;if(s)return n.branches.add(s),()=>{n.branches.delete(s)}},[n.branches]),x.jsx(Ie.div,{...e,ref:o})});ij.displayName=aj;function oj(e,t=globalThis==null?void 0:globalThis.document){const n=Zt(e),a=w.useRef(!1),o=w.useRef(()=>{});return w.useEffect(()=>{const s=u=>{if(u.target&&!a.current){let f=function(){PE(nj,n,h,{discrete:!0})};const h={originalEvent:u};u.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=f,t.addEventListener("click",o.current,{once:!0})):f()}else t.removeEventListener("click",o.current);a.current=!1},c=window.setTimeout(()=>{t.addEventListener("pointerdown",s)},0);return()=>{window.clearTimeout(c),t.removeEventListener("pointerdown",s),t.removeEventListener("click",o.current)}},[t,n]),{onPointerDownCapture:()=>a.current=!0}}function sj(e,t=globalThis==null?void 0:globalThis.document){const n=Zt(e),a=w.useRef(!1);return w.useEffect(()=>{const o=s=>{s.target&&!a.current&&PE(rj,n,{originalEvent:s},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,n]),{onFocusCapture:()=>a.current=!0,onBlurCapture:()=>a.current=!1}}function y0(){const e=new CustomEvent(sm);document.dispatchEvent(e)}function PE(e,t,n,{discrete:a}){const o=n.originalEvent.target,s=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),a?JO(o,s):o.dispatchEvent(s)}var Hh=0;function ng(){w.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??b0()),document.body.insertAdjacentElement("beforeend",e[1]??b0()),Hh++,()=>{Hh===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Hh--}},[])}function b0(){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 $h="focusScope.autoFocusOnMount",Vh="focusScope.autoFocusOnUnmount",x0={bubbles:!1,cancelable:!0},lj="FocusScope",Zu=w.forwardRef((e,t)=>{const{loop:n=!1,trapped:a=!1,onMountAutoFocus:o,onUnmountAutoFocus:s,...c}=e,[u,f]=w.useState(null),h=Zt(o),m=Zt(s),g=w.useRef(null),y=at(t,E=>f(E)),b=w.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;w.useEffect(()=>{if(a){let E=function(A){if(b.paused||!u)return;const D=A.target;u.contains(D)?g.current=D:za(g.current,{select:!0})},_=function(A){if(b.paused||!u)return;const D=A.relatedTarget;D!==null&&(u.contains(D)||za(g.current,{select:!0}))},N=function(A){if(document.activeElement===document.body)for(const k of A)k.removedNodes.length>0&&za(u)};document.addEventListener("focusin",E),document.addEventListener("focusout",_);const T=new MutationObserver(N);return u&&T.observe(u,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",E),document.removeEventListener("focusout",_),T.disconnect()}}},[a,u,b.paused]),w.useEffect(()=>{if(u){E0.add(b);const E=document.activeElement;if(!u.contains(E)){const N=new CustomEvent($h,x0);u.addEventListener($h,h),u.dispatchEvent(N),N.defaultPrevented||(cj(pj(GE(u)),{select:!0}),document.activeElement===E&&za(u))}return()=>{u.removeEventListener($h,h),setTimeout(()=>{const N=new CustomEvent(Vh,x0);u.addEventListener(Vh,m),u.dispatchEvent(N),N.defaultPrevented||za(E??document.body,{select:!0}),u.removeEventListener(Vh,m),E0.remove(b)},0)}}},[u,h,m,b]);const S=w.useCallback(E=>{if(!n&&!a||b.paused)return;const _=E.key==="Tab"&&!E.altKey&&!E.ctrlKey&&!E.metaKey,N=document.activeElement;if(_&&N){const T=E.currentTarget,[A,D]=uj(T);A&&D?!E.shiftKey&&N===D?(E.preventDefault(),n&&za(A,{select:!0})):E.shiftKey&&N===A&&(E.preventDefault(),n&&za(D,{select:!0})):N===T&&E.preventDefault()}},[n,a,b.paused]);return x.jsx(Ie.div,{tabIndex:-1,...c,ref:y,onKeyDown:S})});Zu.displayName=lj;function cj(e,{select:t=!1}={}){const n=document.activeElement;for(const a of e)if(za(a,{select:t}),document.activeElement!==n)return}function uj(e){const t=GE(e),n=w0(t,e),a=w0(t.reverse(),e);return[n,a]}function GE(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:a=>{const o=a.tagName==="INPUT"&&a.type==="hidden";return a.disabled||a.hidden||o?NodeFilter.FILTER_SKIP:a.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function w0(e,t){for(const n of e)if(!dj(n,{upTo:t}))return n}function dj(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 fj(e){return e instanceof HTMLInputElement&&"select"in e}function za(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&fj(e)&&t&&e.select()}}var E0=hj();function hj(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=S0(e,t),e.unshift(t)},remove(t){var n;e=S0(e,t),(n=e[0])==null||n.resume()}}}function S0(e,t){const n=[...e],a=n.indexOf(t);return a!==-1&&n.splice(a,1),n}function pj(e){return e.filter(t=>t.tagName!=="A")}var on=globalThis!=null&&globalThis.document?w.useLayoutEffect:()=>{},mj=YA.useId||(()=>{}),gj=0;function an(e){const[t,n]=w.useState(mj());return on(()=>{n(a=>a??String(gj++))},[e]),t?`radix-${t}`:""}const vj=["top","right","bottom","left"],Ba=Math.min,Nn=Math.max,Tu=Math.round,Fc=Math.floor,Tr=e=>({x:e,y:e}),yj={left:"right",right:"left",bottom:"top",top:"bottom"},bj={start:"end",end:"start"};function lm(e,t,n){return Nn(e,Ba(t,n))}function aa(e,t){return typeof e=="function"?e(t):e}function ia(e){return e.split("-")[0]}function Bo(e){return e.split("-")[1]}function rg(e){return e==="x"?"y":"x"}function ag(e){return e==="y"?"height":"width"}function Ia(e){return["top","bottom"].includes(ia(e))?"y":"x"}function ig(e){return rg(Ia(e))}function xj(e,t,n){n===void 0&&(n=!1);const a=Bo(e),o=ig(e),s=ag(o);let c=o==="x"?a===(n?"end":"start")?"right":"left":a==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(c=Cu(c)),[c,Cu(c)]}function wj(e){const t=Cu(e);return[cm(e),t,cm(t)]}function cm(e){return e.replace(/start|end/g,t=>bj[t])}function Ej(e,t,n){const a=["left","right"],o=["right","left"],s=["top","bottom"],c=["bottom","top"];switch(e){case"top":case"bottom":return n?t?o:a:t?a:o;case"left":case"right":return t?s:c;default:return[]}}function Sj(e,t,n,a){const o=Bo(e);let s=Ej(ia(e),n==="start",a);return o&&(s=s.map(c=>c+"-"+o),t&&(s=s.concat(s.map(cm)))),s}function Cu(e){return e.replace(/left|right|bottom|top/g,t=>yj[t])}function _j(e){return{top:0,right:0,bottom:0,left:0,...e}}function FE(e){return typeof e!="number"?_j(e):{top:e,right:e,bottom:e,left:e}}function Ru(e){const{x:t,y:n,width:a,height:o}=e;return{width:a,height:o,top:n,left:t,right:t+a,bottom:n+o,x:t,y:n}}function _0(e,t,n){let{reference:a,floating:o}=e;const s=Ia(t),c=ig(t),u=ag(c),f=ia(t),h=s==="y",m=a.x+a.width/2-o.width/2,g=a.y+a.height/2-o.height/2,y=a[u]/2-o[u]/2;let b;switch(f){case"top":b={x:m,y:a.y-o.height};break;case"bottom":b={x:m,y:a.y+a.height};break;case"right":b={x:a.x+a.width,y:g};break;case"left":b={x:a.x-o.width,y:g};break;default:b={x:a.x,y:a.y}}switch(Bo(t)){case"start":b[c]-=y*(n&&h?-1:1);break;case"end":b[c]+=y*(n&&h?-1:1);break}return b}const Tj=async(e,t,n)=>{const{placement:a="bottom",strategy:o="absolute",middleware:s=[],platform:c}=n,u=s.filter(Boolean),f=await(c.isRTL==null?void 0:c.isRTL(t));let h=await c.getElementRects({reference:e,floating:t,strategy:o}),{x:m,y:g}=_0(h,a,f),y=a,b={},S=0;for(let E=0;E({name:"arrow",options:e,async fn(t){const{x:n,y:a,placement:o,rects:s,platform:c,elements:u,middlewareData:f}=t,{element:h,padding:m=0}=aa(e,t)||{};if(h==null)return{};const g=FE(m),y={x:n,y:a},b=ig(o),S=ag(b),E=await c.getDimensions(h),_=b==="y",N=_?"top":"left",T=_?"bottom":"right",A=_?"clientHeight":"clientWidth",D=s.reference[S]+s.reference[b]-y[b]-s.floating[S],k=y[b]-s.reference[b],M=await(c.getOffsetParent==null?void 0:c.getOffsetParent(h));let R=M?M[A]:0;(!R||!await(c.isElement==null?void 0:c.isElement(M)))&&(R=u.floating[A]||s.floating[S]);const U=D/2-k/2,L=R/2-E[S]/2-1,I=Ba(g[N],L),q=Ba(g[T],L),Y=I,B=R-E[S]-q,X=R/2-E[S]/2+U,ne=lm(Y,X,B),F=!f.arrow&&Bo(o)!=null&&X!==ne&&s.reference[S]/2-(XX<=0)){var q,Y;const X=(((q=s.flip)==null?void 0:q.index)||0)+1,ne=R[X];if(ne)return{data:{index:X,overflows:I},reset:{placement:ne}};let F=(Y=I.filter(z=>z.overflows[0]<=0).sort((z,j)=>z.overflows[1]-j.overflows[1])[0])==null?void 0:Y.placement;if(!F)switch(b){case"bestFit":{var B;const z=(B=I.filter(j=>{if(M){const K=Ia(j.placement);return K===T||K==="y"}return!0}).map(j=>[j.placement,j.overflows.filter(K=>K>0).reduce((K,G)=>K+G,0)]).sort((j,K)=>j[1]-K[1])[0])==null?void 0:B[0];z&&(F=z);break}case"initialPlacement":F=u;break}if(o!==F)return{reset:{placement:F}}}return{}}}};function T0(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function C0(e){return vj.some(t=>e[t]>=0)}const Aj=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:a="referenceHidden",...o}=aa(e,t);switch(a){case"referenceHidden":{const s=await sl(t,{...o,elementContext:"reference"}),c=T0(s,n.reference);return{data:{referenceHiddenOffsets:c,referenceHidden:C0(c)}}}case"escaped":{const s=await sl(t,{...o,altBoundary:!0}),c=T0(s,n.floating);return{data:{escapedOffsets:c,escaped:C0(c)}}}default:return{}}}}};async function kj(e,t){const{placement:n,platform:a,elements:o}=e,s=await(a.isRTL==null?void 0:a.isRTL(o.floating)),c=ia(n),u=Bo(n),f=Ia(n)==="y",h=["left","top"].includes(c)?-1:1,m=s&&f?-1:1,g=aa(t,e);let{mainAxis:y,crossAxis:b,alignmentAxis:S}=typeof g=="number"?{mainAxis:g,crossAxis:0,alignmentAxis:null}:{mainAxis:g.mainAxis||0,crossAxis:g.crossAxis||0,alignmentAxis:g.alignmentAxis};return u&&typeof S=="number"&&(b=u==="end"?S*-1:S),f?{x:b*m,y:y*h}:{x:y*h,y:b*m}}const Dj=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,a;const{x:o,y:s,placement:c,middlewareData:u}=t,f=await kj(t,e);return c===((n=u.offset)==null?void 0:n.placement)&&(a=u.arrow)!=null&&a.alignmentOffset?{}:{x:o+f.x,y:s+f.y,data:{...f,placement:c}}}}},Nj=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:a,placement:o}=t,{mainAxis:s=!0,crossAxis:c=!1,limiter:u={fn:_=>{let{x:N,y:T}=_;return{x:N,y:T}}},...f}=aa(e,t),h={x:n,y:a},m=await sl(t,f),g=Ia(ia(o)),y=rg(g);let b=h[y],S=h[g];if(s){const _=y==="y"?"top":"left",N=y==="y"?"bottom":"right",T=b+m[_],A=b-m[N];b=lm(T,b,A)}if(c){const _=g==="y"?"top":"left",N=g==="y"?"bottom":"right",T=S+m[_],A=S-m[N];S=lm(T,S,A)}const E=u.fn({...t,[y]:b,[g]:S});return{...E,data:{x:E.x-n,y:E.y-a,enabled:{[y]:s,[g]:c}}}}}},Oj=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:a,placement:o,rects:s,middlewareData:c}=t,{offset:u=0,mainAxis:f=!0,crossAxis:h=!0}=aa(e,t),m={x:n,y:a},g=Ia(o),y=rg(g);let b=m[y],S=m[g];const E=aa(u,t),_=typeof E=="number"?{mainAxis:E,crossAxis:0}:{mainAxis:0,crossAxis:0,...E};if(f){const A=y==="y"?"height":"width",D=s.reference[y]-s.floating[A]+_.mainAxis,k=s.reference[y]+s.reference[A]-_.mainAxis;bk&&(b=k)}if(h){var N,T;const A=y==="y"?"width":"height",D=["top","left"].includes(ia(o)),k=s.reference[g]-s.floating[A]+(D&&((N=c.offset)==null?void 0:N[g])||0)+(D?0:_.crossAxis),M=s.reference[g]+s.reference[A]+(D?0:((T=c.offset)==null?void 0:T[g])||0)-(D?_.crossAxis:0);SM&&(S=M)}return{[y]:b,[g]:S}}}},jj=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,a;const{placement:o,rects:s,platform:c,elements:u}=t,{apply:f=()=>{},...h}=aa(e,t),m=await sl(t,h),g=ia(o),y=Bo(o),b=Ia(o)==="y",{width:S,height:E}=s.floating;let _,N;g==="top"||g==="bottom"?(_=g,N=y===(await(c.isRTL==null?void 0:c.isRTL(u.floating))?"start":"end")?"left":"right"):(N=g,_=y==="end"?"top":"bottom");const T=E-m.top-m.bottom,A=S-m.left-m.right,D=Ba(E-m[_],T),k=Ba(S-m[N],A),M=!t.middlewareData.shift;let R=D,U=k;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(U=A),(a=t.middlewareData.shift)!=null&&a.enabled.y&&(R=T),M&&!y){const I=Nn(m.left,0),q=Nn(m.right,0),Y=Nn(m.top,0),B=Nn(m.bottom,0);b?U=S-2*(I!==0||q!==0?I+q:Nn(m.left,m.right)):R=E-2*(Y!==0||B!==0?Y+B:Nn(m.top,m.bottom))}await f({...t,availableWidth:U,availableHeight:R});const L=await c.getDimensions(u.floating);return S!==L.width||E!==L.height?{reset:{rects:!0}}:{}}}};function Qu(){return typeof window<"u"}function Io(e){return UE(e)?(e.nodeName||"").toLowerCase():"#document"}function jn(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Rr(e){var t;return(t=(UE(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function UE(e){return Qu()?e instanceof Node||e instanceof jn(e).Node:!1}function lr(e){return Qu()?e instanceof Element||e instanceof jn(e).Element:!1}function Cr(e){return Qu()?e instanceof HTMLElement||e instanceof jn(e).HTMLElement:!1}function R0(e){return!Qu()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof jn(e).ShadowRoot}function xl(e){const{overflow:t,overflowX:n,overflowY:a,display:o}=cr(e);return/auto|scroll|overlay|hidden|clip/.test(t+a+n)&&!["inline","contents"].includes(o)}function Lj(e){return["table","td","th"].includes(Io(e))}function Ju(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function og(e){const t=sg(),n=lr(e)?cr(e):e;return["transform","translate","scale","rotate","perspective"].some(a=>n[a]?n[a]!=="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(a=>(n.willChange||"").includes(a))||["paint","layout","strict","content"].some(a=>(n.contain||"").includes(a))}function zj(e){let t=Ha(e);for(;Cr(t)&&!ko(t);){if(og(t))return t;if(Ju(t))return null;t=Ha(t)}return null}function sg(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function ko(e){return["html","body","#document"].includes(Io(e))}function cr(e){return jn(e).getComputedStyle(e)}function ed(e){return lr(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Ha(e){if(Io(e)==="html")return e;const t=e.assignedSlot||e.parentNode||R0(e)&&e.host||Rr(e);return R0(t)?t.host:t}function BE(e){const t=Ha(e);return ko(t)?e.ownerDocument?e.ownerDocument.body:e.body:Cr(t)&&xl(t)?t:BE(t)}function ll(e,t,n){var a;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=BE(e),s=o===((a=e.ownerDocument)==null?void 0:a.body),c=jn(o);if(s){const u=um(c);return t.concat(c,c.visualViewport||[],xl(o)?o:[],u&&n?ll(u):[])}return t.concat(o,ll(o,[],n))}function um(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function IE(e){const t=cr(e);let n=parseFloat(t.width)||0,a=parseFloat(t.height)||0;const o=Cr(e),s=o?e.offsetWidth:n,c=o?e.offsetHeight:a,u=Tu(n)!==s||Tu(a)!==c;return u&&(n=s,a=c),{width:n,height:a,$:u}}function lg(e){return lr(e)?e:e.contextElement}function To(e){const t=lg(e);if(!Cr(t))return Tr(1);const n=t.getBoundingClientRect(),{width:a,height:o,$:s}=IE(t);let c=(s?Tu(n.width):n.width)/a,u=(s?Tu(n.height):n.height)/o;return(!c||!Number.isFinite(c))&&(c=1),(!u||!Number.isFinite(u))&&(u=1),{x:c,y:u}}const Mj=Tr(0);function HE(e){const t=jn(e);return!sg()||!t.visualViewport?Mj:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Pj(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==jn(e)?!1:t}function Ti(e,t,n,a){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),s=lg(e);let c=Tr(1);t&&(a?lr(a)&&(c=To(a)):c=To(e));const u=Pj(s,n,a)?HE(s):Tr(0);let f=(o.left+u.x)/c.x,h=(o.top+u.y)/c.y,m=o.width/c.x,g=o.height/c.y;if(s){const y=jn(s),b=a&&lr(a)?jn(a):a;let S=y,E=um(S);for(;E&&a&&b!==S;){const _=To(E),N=E.getBoundingClientRect(),T=cr(E),A=N.left+(E.clientLeft+parseFloat(T.paddingLeft))*_.x,D=N.top+(E.clientTop+parseFloat(T.paddingTop))*_.y;f*=_.x,h*=_.y,m*=_.x,g*=_.y,f+=A,h+=D,S=jn(E),E=um(S)}}return Ru({width:m,height:g,x:f,y:h})}function cg(e,t){const n=ed(e).scrollLeft;return t?t.left+n:Ti(Rr(e)).left+n}function $E(e,t,n){n===void 0&&(n=!1);const a=e.getBoundingClientRect(),o=a.left+t.scrollLeft-(n?0:cg(e,a)),s=a.top+t.scrollTop;return{x:o,y:s}}function Gj(e){let{elements:t,rect:n,offsetParent:a,strategy:o}=e;const s=o==="fixed",c=Rr(a),u=t?Ju(t.floating):!1;if(a===c||u&&s)return n;let f={scrollLeft:0,scrollTop:0},h=Tr(1);const m=Tr(0),g=Cr(a);if((g||!g&&!s)&&((Io(a)!=="body"||xl(c))&&(f=ed(a)),Cr(a))){const b=Ti(a);h=To(a),m.x=b.x+a.clientLeft,m.y=b.y+a.clientTop}const y=c&&!g&&!s?$E(c,f,!0):Tr(0);return{width:n.width*h.x,height:n.height*h.y,x:n.x*h.x-f.scrollLeft*h.x+m.x+y.x,y:n.y*h.y-f.scrollTop*h.y+m.y+y.y}}function Fj(e){return Array.from(e.getClientRects())}function Uj(e){const t=Rr(e),n=ed(e),a=e.ownerDocument.body,o=Nn(t.scrollWidth,t.clientWidth,a.scrollWidth,a.clientWidth),s=Nn(t.scrollHeight,t.clientHeight,a.scrollHeight,a.clientHeight);let c=-n.scrollLeft+cg(e);const u=-n.scrollTop;return cr(a).direction==="rtl"&&(c+=Nn(t.clientWidth,a.clientWidth)-o),{width:o,height:s,x:c,y:u}}function Bj(e,t){const n=jn(e),a=Rr(e),o=n.visualViewport;let s=a.clientWidth,c=a.clientHeight,u=0,f=0;if(o){s=o.width,c=o.height;const h=sg();(!h||h&&t==="fixed")&&(u=o.offsetLeft,f=o.offsetTop)}return{width:s,height:c,x:u,y:f}}function Ij(e,t){const n=Ti(e,!0,t==="fixed"),a=n.top+e.clientTop,o=n.left+e.clientLeft,s=Cr(e)?To(e):Tr(1),c=e.clientWidth*s.x,u=e.clientHeight*s.y,f=o*s.x,h=a*s.y;return{width:c,height:u,x:f,y:h}}function A0(e,t,n){let a;if(t==="viewport")a=Bj(e,n);else if(t==="document")a=Uj(Rr(e));else if(lr(t))a=Ij(t,n);else{const o=HE(e);a={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return Ru(a)}function VE(e,t){const n=Ha(e);return n===t||!lr(n)||ko(n)?!1:cr(n).position==="fixed"||VE(n,t)}function Hj(e,t){const n=t.get(e);if(n)return n;let a=ll(e,[],!1).filter(u=>lr(u)&&Io(u)!=="body"),o=null;const s=cr(e).position==="fixed";let c=s?Ha(e):e;for(;lr(c)&&!ko(c);){const u=cr(c),f=og(c);!f&&u.position==="fixed"&&(o=null),(s?!f&&!o:!f&&u.position==="static"&&!!o&&["absolute","fixed"].includes(o.position)||xl(c)&&!f&&VE(e,c))?a=a.filter(m=>m!==c):o=u,c=Ha(c)}return t.set(e,a),a}function $j(e){let{element:t,boundary:n,rootBoundary:a,strategy:o}=e;const c=[...n==="clippingAncestors"?Ju(t)?[]:Hj(t,this._c):[].concat(n),a],u=c[0],f=c.reduce((h,m)=>{const g=A0(t,m,o);return h.top=Nn(g.top,h.top),h.right=Ba(g.right,h.right),h.bottom=Ba(g.bottom,h.bottom),h.left=Nn(g.left,h.left),h},A0(t,u,o));return{width:f.right-f.left,height:f.bottom-f.top,x:f.left,y:f.top}}function Vj(e){const{width:t,height:n}=IE(e);return{width:t,height:n}}function qj(e,t,n){const a=Cr(t),o=Rr(t),s=n==="fixed",c=Ti(e,!0,s,t);let u={scrollLeft:0,scrollTop:0};const f=Tr(0);if(a||!a&&!s)if((Io(t)!=="body"||xl(o))&&(u=ed(t)),a){const y=Ti(t,!0,s,t);f.x=y.x+t.clientLeft,f.y=y.y+t.clientTop}else o&&(f.x=cg(o));const h=o&&!a&&!s?$E(o,u):Tr(0),m=c.left+u.scrollLeft-f.x-h.x,g=c.top+u.scrollTop-f.y-h.y;return{x:m,y:g,width:c.width,height:c.height}}function qh(e){return cr(e).position==="static"}function k0(e,t){if(!Cr(e)||cr(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Rr(e)===n&&(n=n.ownerDocument.body),n}function qE(e,t){const n=jn(e);if(Ju(e))return n;if(!Cr(e)){let o=Ha(e);for(;o&&!ko(o);){if(lr(o)&&!qh(o))return o;o=Ha(o)}return n}let a=k0(e,t);for(;a&&Lj(a)&&qh(a);)a=k0(a,t);return a&&ko(a)&&qh(a)&&!og(a)?n:a||zj(e)||n}const Yj=async function(e){const t=this.getOffsetParent||qE,n=this.getDimensions,a=await n(e.floating);return{reference:qj(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:a.width,height:a.height}}};function Wj(e){return cr(e).direction==="rtl"}const Xj={convertOffsetParentRelativeRectToViewportRelativeRect:Gj,getDocumentElement:Rr,getClippingRect:$j,getOffsetParent:qE,getElementRects:Yj,getClientRects:Fj,getDimensions:Vj,getScale:To,isElement:lr,isRTL:Wj};function YE(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Kj(e,t){let n=null,a;const o=Rr(e);function s(){var u;clearTimeout(a),(u=n)==null||u.disconnect(),n=null}function c(u,f){u===void 0&&(u=!1),f===void 0&&(f=1),s();const h=e.getBoundingClientRect(),{left:m,top:g,width:y,height:b}=h;if(u||t(),!y||!b)return;const S=Fc(g),E=Fc(o.clientWidth-(m+y)),_=Fc(o.clientHeight-(g+b)),N=Fc(m),A={rootMargin:-S+"px "+-E+"px "+-_+"px "+-N+"px",threshold:Nn(0,Ba(1,f))||1};let D=!0;function k(M){const R=M[0].intersectionRatio;if(R!==f){if(!D)return c();R?c(!1,R):a=setTimeout(()=>{c(!1,1e-7)},1e3)}R===1&&!YE(h,e.getBoundingClientRect())&&c(),D=!1}try{n=new IntersectionObserver(k,{...A,root:o.ownerDocument})}catch{n=new IntersectionObserver(k,A)}n.observe(e)}return c(!0),s}function Zj(e,t,n,a){a===void 0&&(a={});const{ancestorScroll:o=!0,ancestorResize:s=!0,elementResize:c=typeof ResizeObserver=="function",layoutShift:u=typeof IntersectionObserver=="function",animationFrame:f=!1}=a,h=lg(e),m=o||s?[...h?ll(h):[],...ll(t)]:[];m.forEach(N=>{o&&N.addEventListener("scroll",n,{passive:!0}),s&&N.addEventListener("resize",n)});const g=h&&u?Kj(h,n):null;let y=-1,b=null;c&&(b=new ResizeObserver(N=>{let[T]=N;T&&T.target===h&&b&&(b.unobserve(t),cancelAnimationFrame(y),y=requestAnimationFrame(()=>{var A;(A=b)==null||A.observe(t)})),n()}),h&&!f&&b.observe(h),b.observe(t));let S,E=f?Ti(e):null;f&&_();function _(){const N=Ti(e);E&&!YE(E,N)&&n(),E=N,S=requestAnimationFrame(_)}return n(),()=>{var N;m.forEach(T=>{o&&T.removeEventListener("scroll",n),s&&T.removeEventListener("resize",n)}),g==null||g(),(N=b)==null||N.disconnect(),b=null,f&&cancelAnimationFrame(S)}}const Qj=Dj,Jj=Nj,eL=Rj,tL=jj,nL=Aj,D0=Cj,rL=Oj,aL=(e,t,n)=>{const a=new Map,o={platform:Xj,...n},s={...o.platform,_c:a};return Tj(e,t,{...o,platform:s})};var uu=typeof document<"u"?w.useLayoutEffect:w.useEffect;function Au(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,a,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(a=n;a--!==0;)if(!Au(e[a],t[a]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(a=n;a--!==0;)if(!{}.hasOwnProperty.call(t,o[a]))return!1;for(a=n;a--!==0;){const s=o[a];if(!(s==="_owner"&&e.$$typeof)&&!Au(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function WE(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function N0(e,t){const n=WE(e);return Math.round(t*n)/n}function Yh(e){const t=w.useRef(e);return uu(()=>{t.current=e}),t}function iL(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:a=[],platform:o,elements:{reference:s,floating:c}={},transform:u=!0,whileElementsMounted:f,open:h}=e,[m,g]=w.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[y,b]=w.useState(a);Au(y,a)||b(a);const[S,E]=w.useState(null),[_,N]=w.useState(null),T=w.useCallback(j=>{j!==M.current&&(M.current=j,E(j))},[]),A=w.useCallback(j=>{j!==R.current&&(R.current=j,N(j))},[]),D=s||S,k=c||_,M=w.useRef(null),R=w.useRef(null),U=w.useRef(m),L=f!=null,I=Yh(f),q=Yh(o),Y=Yh(h),B=w.useCallback(()=>{if(!M.current||!R.current)return;const j={placement:t,strategy:n,middleware:y};q.current&&(j.platform=q.current),aL(M.current,R.current,j).then(K=>{const G={...K,isPositioned:Y.current!==!1};X.current&&!Au(U.current,G)&&(U.current=G,yl.flushSync(()=>{g(G)}))})},[y,t,n,q,Y]);uu(()=>{h===!1&&U.current.isPositioned&&(U.current.isPositioned=!1,g(j=>({...j,isPositioned:!1})))},[h]);const X=w.useRef(!1);uu(()=>(X.current=!0,()=>{X.current=!1}),[]),uu(()=>{if(D&&(M.current=D),k&&(R.current=k),D&&k){if(I.current)return I.current(D,k,B);B()}},[D,k,B,I,L]);const ne=w.useMemo(()=>({reference:M,floating:R,setReference:T,setFloating:A}),[T,A]),F=w.useMemo(()=>({reference:D,floating:k}),[D,k]),z=w.useMemo(()=>{const j={position:n,left:0,top:0};if(!F.floating)return j;const K=N0(F.floating,m.x),G=N0(F.floating,m.y);return u?{...j,transform:"translate("+K+"px, "+G+"px)",...WE(F.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:K,top:G}},[n,u,F.floating,m.x,m.y]);return w.useMemo(()=>({...m,update:B,refs:ne,elements:F,floatingStyles:z}),[m,B,ne,F,z])}const oL=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:a,padding:o}=typeof e=="function"?e(n):e;return a&&t(a)?a.current!=null?D0({element:a.current,padding:o}).fn(n):{}:a?D0({element:a,padding:o}).fn(n):{}}}},sL=(e,t)=>({...Qj(e),options:[e,t]}),lL=(e,t)=>({...Jj(e),options:[e,t]}),cL=(e,t)=>({...rL(e),options:[e,t]}),uL=(e,t)=>({...eL(e),options:[e,t]}),dL=(e,t)=>({...tL(e),options:[e,t]}),fL=(e,t)=>({...nL(e),options:[e,t]}),hL=(e,t)=>({...oL(e),options:[e,t]});var pL="Arrow",XE=w.forwardRef((e,t)=>{const{children:n,width:a=10,height:o=5,...s}=e;return x.jsx(Ie.svg,{...s,ref:t,width:a,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:x.jsx("polygon",{points:"0,0 30,0 15,10"})})});XE.displayName=pL;var mL=XE;function KE(e){const[t,n]=w.useState(void 0);return on(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const a=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const s=o[0];let c,u;if("borderBoxSize"in s){const f=s.borderBoxSize,h=Array.isArray(f)?f[0]:f;c=h.inlineSize,u=h.blockSize}else c=e.offsetWidth,u=e.offsetHeight;n({width:c,height:u})});return a.observe(e,{box:"border-box"}),()=>a.unobserve(e)}else n(void 0)},[e]),t}var ug="Popper",[ZE,Ho]=fr(ug),[gL,QE]=ZE(ug),JE=e=>{const{__scopePopper:t,children:n}=e,[a,o]=w.useState(null);return x.jsx(gL,{scope:t,anchor:a,onAnchorChange:o,children:n})};JE.displayName=ug;var eS="PopperAnchor",tS=w.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:a,...o}=e,s=QE(eS,n),c=w.useRef(null),u=at(t,c);return w.useEffect(()=>{s.onAnchorChange((a==null?void 0:a.current)||c.current)}),a?null:x.jsx(Ie.div,{...o,ref:u})});tS.displayName=eS;var dg="PopperContent",[vL,yL]=ZE(dg),nS=w.forwardRef((e,t)=>{var ie,oe,Te,he,Se,be;const{__scopePopper:n,side:a="bottom",sideOffset:o=0,align:s="center",alignOffset:c=0,arrowPadding:u=0,avoidCollisions:f=!0,collisionBoundary:h=[],collisionPadding:m=0,sticky:g="partial",hideWhenDetached:y=!1,updatePositionStrategy:b="optimized",onPlaced:S,...E}=e,_=QE(dg,n),[N,T]=w.useState(null),A=at(t,je=>T(je)),[D,k]=w.useState(null),M=KE(D),R=(M==null?void 0:M.width)??0,U=(M==null?void 0:M.height)??0,L=a+(s!=="center"?"-"+s:""),I=typeof m=="number"?m:{top:0,right:0,bottom:0,left:0,...m},q=Array.isArray(h)?h:[h],Y=q.length>0,B={padding:I,boundary:q.filter(xL),altBoundary:Y},{refs:X,floatingStyles:ne,placement:F,isPositioned:z,middlewareData:j}=iL({strategy:"fixed",placement:L,whileElementsMounted:(...je)=>Zj(...je,{animationFrame:b==="always"}),elements:{reference:_.anchor},middleware:[sL({mainAxis:o+U,alignmentAxis:c}),f&&lL({mainAxis:!0,crossAxis:!1,limiter:g==="partial"?cL():void 0,...B}),f&&uL({...B}),dL({...B,apply:({elements:je,rects:Ce,availableWidth:ye,availableHeight:J})=>{const{width:le,height:_e}=Ce.reference,pe=je.floating.style;pe.setProperty("--radix-popper-available-width",`${ye}px`),pe.setProperty("--radix-popper-available-height",`${J}px`),pe.setProperty("--radix-popper-anchor-width",`${le}px`),pe.setProperty("--radix-popper-anchor-height",`${_e}px`)}}),D&&hL({element:D,padding:u}),wL({arrowWidth:R,arrowHeight:U}),y&&fL({strategy:"referenceHidden",...B})]}),[K,G]=iS(F),H=Zt(S);on(()=>{z&&(H==null||H())},[z,H]);const O=(ie=j.arrow)==null?void 0:ie.x,$=(oe=j.arrow)==null?void 0:oe.y,W=((Te=j.arrow)==null?void 0:Te.centerOffset)!==0,[re,de]=w.useState();return on(()=>{N&&de(window.getComputedStyle(N).zIndex)},[N]),x.jsx("div",{ref:X.setFloating,"data-radix-popper-content-wrapper":"",style:{...ne,transform:z?ne.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:re,"--radix-popper-transform-origin":[(he=j.transformOrigin)==null?void 0:he.x,(Se=j.transformOrigin)==null?void 0:Se.y].join(" "),...((be=j.hide)==null?void 0:be.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:x.jsx(vL,{scope:n,placedSide:K,onArrowChange:k,arrowX:O,arrowY:$,shouldHideArrow:W,children:x.jsx(Ie.div,{"data-side":K,"data-align":G,...E,ref:A,style:{...E.style,animation:z?void 0:"none"}})})})});nS.displayName=dg;var rS="PopperArrow",bL={top:"bottom",right:"left",bottom:"top",left:"right"},aS=w.forwardRef(function(t,n){const{__scopePopper:a,...o}=t,s=yL(rS,a),c=bL[s.placedSide];return x.jsx("span",{ref:s.onArrowChange,style:{position:"absolute",left:s.arrowX,top:s.arrowY,[c]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[s.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[s.placedSide],visibility:s.shouldHideArrow?"hidden":void 0},children:x.jsx(mL,{...o,ref:n,style:{...o.style,display:"block"}})})});aS.displayName=rS;function xL(e){return e!==null}var wL=e=>({name:"transformOrigin",options:e,fn(t){var _,N,T;const{placement:n,rects:a,middlewareData:o}=t,c=((_=o.arrow)==null?void 0:_.centerOffset)!==0,u=c?0:e.arrowWidth,f=c?0:e.arrowHeight,[h,m]=iS(n),g={start:"0%",center:"50%",end:"100%"}[m],y=(((N=o.arrow)==null?void 0:N.x)??0)+u/2,b=(((T=o.arrow)==null?void 0:T.y)??0)+f/2;let S="",E="";return h==="bottom"?(S=c?g:`${y}px`,E=`${-f}px`):h==="top"?(S=c?g:`${y}px`,E=`${a.floating.height+f}px`):h==="right"?(S=`${-f}px`,E=c?g:`${b}px`):h==="left"&&(S=`${a.floating.width+f}px`,E=c?g:`${b}px`),{data:{x:S,y:E}}}});function iS(e){const[t,n="center"]=e.split("-");return[t,n]}var fg=JE,td=tS,hg=nS,pg=aS,EL="Portal",nd=w.forwardRef((e,t)=>{var u;const{container:n,...a}=e,[o,s]=w.useState(!1);on(()=>s(!0),[]);const c=n||o&&((u=globalThis==null?void 0:globalThis.document)==null?void 0:u.body);return c?LE.createPortal(x.jsx(Ie.div,{...a,ref:t}),c):null});nd.displayName=EL;function SL(e,t){return w.useReducer((n,a)=>t[n][a]??n,e)}var Ln=e=>{const{present:t,children:n}=e,a=_L(t),o=typeof n=="function"?n({present:a.isPresent}):w.Children.only(n),s=at(a.ref,TL(o));return typeof n=="function"||a.isPresent?w.cloneElement(o,{ref:s}):null};Ln.displayName="Presence";function _L(e){const[t,n]=w.useState(),a=w.useRef({}),o=w.useRef(e),s=w.useRef("none"),c=e?"mounted":"unmounted",[u,f]=SL(c,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return w.useEffect(()=>{const h=Uc(a.current);s.current=u==="mounted"?h:"none"},[u]),on(()=>{const h=a.current,m=o.current;if(m!==e){const y=s.current,b=Uc(h);e?f("MOUNT"):b==="none"||(h==null?void 0:h.display)==="none"?f("UNMOUNT"):f(m&&y!==b?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,f]),on(()=>{if(t){let h;const m=t.ownerDocument.defaultView??window,g=b=>{const E=Uc(a.current).includes(b.animationName);if(b.target===t&&E&&(f("ANIMATION_END"),!o.current)){const _=t.style.animationFillMode;t.style.animationFillMode="forwards",h=m.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=_)})}},y=b=>{b.target===t&&(s.current=Uc(a.current))};return t.addEventListener("animationstart",y),t.addEventListener("animationcancel",g),t.addEventListener("animationend",g),()=>{m.clearTimeout(h),t.removeEventListener("animationstart",y),t.removeEventListener("animationcancel",g),t.removeEventListener("animationend",g)}}else f("ANIMATION_END")},[t,f]),{isPresent:["mounted","unmountSuspended"].includes(u),ref:w.useCallback(h=>{h&&(a.current=getComputedStyle(h)),n(h)},[])}}function Uc(e){return(e==null?void 0:e.animationName)||"none"}function TL(e){var a,o;let t=(a=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:a.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function oa({prop:e,defaultProp:t,onChange:n=()=>{}}){const[a,o]=CL({defaultProp:t,onChange:n}),s=e!==void 0,c=s?e:a,u=Zt(n),f=w.useCallback(h=>{if(s){const g=typeof h=="function"?h(e):h;g!==e&&u(g)}else o(h)},[s,e,o,u]);return[c,f]}function CL({defaultProp:e,onChange:t}){const n=w.useState(e),[a]=n,o=w.useRef(a),s=Zt(t);return w.useEffect(()=>{o.current!==a&&(s(a),o.current=a)},[a,o,s]),n}var RL=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},vo=new WeakMap,Bc=new WeakMap,Ic={},Wh=0,oS=function(e){return e&&(e.host||oS(e.parentNode))},AL=function(e,t){return t.map(function(n){if(e.contains(n))return n;var a=oS(n);return a&&e.contains(a)?a:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},kL=function(e,t,n,a){var o=AL(t,Array.isArray(e)?e:[e]);Ic[n]||(Ic[n]=new WeakMap);var s=Ic[n],c=[],u=new Set,f=new Set(o),h=function(g){!g||u.has(g)||(u.add(g),h(g.parentNode))};o.forEach(h);var m=function(g){!g||f.has(g)||Array.prototype.forEach.call(g.children,function(y){if(u.has(y))m(y);else try{var b=y.getAttribute(a),S=b!==null&&b!=="false",E=(vo.get(y)||0)+1,_=(s.get(y)||0)+1;vo.set(y,E),s.set(y,_),c.push(y),E===1&&S&&Bc.set(y,!0),_===1&&y.setAttribute(n,"true"),S||y.setAttribute(a,"true")}catch(N){console.error("aria-hidden: cannot operate on ",y,N)}})};return m(t),u.clear(),Wh++,function(){c.forEach(function(g){var y=vo.get(g)-1,b=s.get(g)-1;vo.set(g,y),s.set(g,b),y||(Bc.has(g)||g.removeAttribute(a),Bc.delete(g)),b||g.removeAttribute(n)}),Wh--,Wh||(vo=new WeakMap,vo=new WeakMap,Bc=new WeakMap,Ic={})}},mg=function(e,t,n){n===void 0&&(n="data-aria-hidden");var a=Array.from(Array.isArray(e)?e:[e]),o=RL(e);return o?(a.push.apply(a,Array.from(o.querySelectorAll("[aria-live]"))),kL(a,o,n,"aria-hidden")):function(){return null}},wr=function(){return wr=Object.assign||function(t){for(var n,a=1,o=arguments.length;a"u")return qL;var t=YL(e),n=document.documentElement.clientWidth,a=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,a-n+t[2]-t[0])}},XL=uS(),Co="data-scroll-locked",KL=function(e,t,n,a){var o=e.left,s=e.top,c=e.right,u=e.gap;return n===void 0&&(n="margin"),` - .`.concat(NL,` { - overflow: hidden `).concat(a,`; - padding-right: `).concat(u,"px ").concat(a,`; - } - body[`).concat(Co,`] { - overflow: hidden `).concat(a,`; - overscroll-behavior: contain; - `).concat([t&&"position: relative ".concat(a,";"),n==="margin"&&` - padding-left: `.concat(o,`px; - padding-top: `).concat(s,`px; - padding-right: `).concat(c,`px; - margin-left:0; - margin-top:0; - margin-right: `).concat(u,"px ").concat(a,`; - `),n==="padding"&&"padding-right: ".concat(u,"px ").concat(a,";")].filter(Boolean).join(""),` - } - - .`).concat(du,` { - right: `).concat(u,"px ").concat(a,`; - } - - .`).concat(fu,` { - margin-right: `).concat(u,"px ").concat(a,`; - } - - .`).concat(du," .").concat(du,` { - right: 0 `).concat(a,`; - } - - .`).concat(fu," .").concat(fu,` { - margin-right: 0 `).concat(a,`; - } - - body[`).concat(Co,`] { - `).concat(OL,": ").concat(u,`px; - } -`)},j0=function(){var e=parseInt(document.body.getAttribute(Co)||"0",10);return isFinite(e)?e:0},ZL=function(){w.useEffect(function(){return document.body.setAttribute(Co,(j0()+1).toString()),function(){var e=j0()-1;e<=0?document.body.removeAttribute(Co):document.body.setAttribute(Co,e.toString())}},[])},QL=function(e){var t=e.noRelative,n=e.noImportant,a=e.gapMode,o=a===void 0?"margin":a;ZL();var s=w.useMemo(function(){return WL(o)},[o]);return w.createElement(XL,{styles:KL(s,!t,o,n?"":"!important")})},dm=!1;if(typeof window<"u")try{var Hc=Object.defineProperty({},"passive",{get:function(){return dm=!0,!0}});window.addEventListener("test",Hc,Hc),window.removeEventListener("test",Hc,Hc)}catch{dm=!1}var yo=dm?{passive:!1}:!1,JL=function(e){return e.tagName==="TEXTAREA"},dS=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!JL(e)&&n[t]==="visible")},ez=function(e){return dS(e,"overflowY")},tz=function(e){return dS(e,"overflowX")},L0=function(e,t){var n=t.ownerDocument,a=t;do{typeof ShadowRoot<"u"&&a instanceof ShadowRoot&&(a=a.host);var o=fS(e,a);if(o){var s=hS(e,a),c=s[1],u=s[2];if(c>u)return!0}a=a.parentNode}while(a&&a!==n.body);return!1},nz=function(e){var t=e.scrollTop,n=e.scrollHeight,a=e.clientHeight;return[t,n,a]},rz=function(e){var t=e.scrollLeft,n=e.scrollWidth,a=e.clientWidth;return[t,n,a]},fS=function(e,t){return e==="v"?ez(t):tz(t)},hS=function(e,t){return e==="v"?nz(t):rz(t)},az=function(e,t){return e==="h"&&t==="rtl"?-1:1},iz=function(e,t,n,a,o){var s=az(e,window.getComputedStyle(t).direction),c=s*a,u=n.target,f=t.contains(u),h=!1,m=c>0,g=0,y=0;do{var b=hS(e,u),S=b[0],E=b[1],_=b[2],N=E-_-s*S;(S||N)&&fS(e,u)&&(g+=N,y+=S),u instanceof ShadowRoot?u=u.host:u=u.parentNode}while(!f&&u!==document.body||f&&(t.contains(u)||t===u));return(m&&Math.abs(g)<1||!m&&Math.abs(y)<1)&&(h=!0),h},$c=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},z0=function(e){return[e.deltaX,e.deltaY]},M0=function(e){return e&&"current"in e?e.current:e},oz=function(e,t){return e[0]===t[0]&&e[1]===t[1]},sz=function(e){return` - .block-interactivity-`.concat(e,` {pointer-events: none;} - .allow-interactivity-`).concat(e,` {pointer-events: all;} -`)},lz=0,bo=[];function cz(e){var t=w.useRef([]),n=w.useRef([0,0]),a=w.useRef(),o=w.useState(lz++)[0],s=w.useState(uS)[0],c=w.useRef(e);w.useEffect(function(){c.current=e},[e]),w.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var E=DL([e.lockRef.current],(e.shards||[]).map(M0),!0).filter(Boolean);return E.forEach(function(_){return _.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),E.forEach(function(_){return _.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var u=w.useCallback(function(E,_){if("touches"in E&&E.touches.length===2||E.type==="wheel"&&E.ctrlKey)return!c.current.allowPinchZoom;var N=$c(E),T=n.current,A="deltaX"in E?E.deltaX:T[0]-N[0],D="deltaY"in E?E.deltaY:T[1]-N[1],k,M=E.target,R=Math.abs(A)>Math.abs(D)?"h":"v";if("touches"in E&&R==="h"&&M.type==="range")return!1;var U=L0(R,M);if(!U)return!0;if(U?k=R:(k=R==="v"?"h":"v",U=L0(R,M)),!U)return!1;if(!a.current&&"changedTouches"in E&&(A||D)&&(a.current=k),!k)return!0;var L=a.current||k;return iz(L,_,E,L==="h"?A:D)},[]),f=w.useCallback(function(E){var _=E;if(!(!bo.length||bo[bo.length-1]!==s)){var N="deltaY"in _?z0(_):$c(_),T=t.current.filter(function(k){return k.name===_.type&&(k.target===_.target||_.target===k.shadowParent)&&oz(k.delta,N)})[0];if(T&&T.should){_.cancelable&&_.preventDefault();return}if(!T){var A=(c.current.shards||[]).map(M0).filter(Boolean).filter(function(k){return k.contains(_.target)}),D=A.length>0?u(_,A[0]):!c.current.noIsolation;D&&_.cancelable&&_.preventDefault()}}},[]),h=w.useCallback(function(E,_,N,T){var A={name:E,delta:_,target:N,should:T,shadowParent:uz(N)};t.current.push(A),setTimeout(function(){t.current=t.current.filter(function(D){return D!==A})},1)},[]),m=w.useCallback(function(E){n.current=$c(E),a.current=void 0},[]),g=w.useCallback(function(E){h(E.type,z0(E),E.target,u(E,e.lockRef.current))},[]),y=w.useCallback(function(E){h(E.type,$c(E),E.target,u(E,e.lockRef.current))},[]);w.useEffect(function(){return bo.push(s),e.setCallbacks({onScrollCapture:g,onWheelCapture:g,onTouchMoveCapture:y}),document.addEventListener("wheel",f,yo),document.addEventListener("touchmove",f,yo),document.addEventListener("touchstart",m,yo),function(){bo=bo.filter(function(E){return E!==s}),document.removeEventListener("wheel",f,yo),document.removeEventListener("touchmove",f,yo),document.removeEventListener("touchstart",m,yo)}},[]);var b=e.removeScrollBar,S=e.inert;return w.createElement(w.Fragment,null,S?w.createElement(s,{styles:sz(o)}):null,b?w.createElement(QL,{gapMode:e.gapMode}):null)}function uz(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const dz=FL(cS,cz);var ad=w.forwardRef(function(e,t){return w.createElement(rd,wr({},e,{ref:t,sideCar:dz}))});ad.classNames=rd.classNames;var gg="Popover",[pS,QI]=fr(gg,[Ho]),wl=Ho(),[fz,$a]=pS(gg),mS=e=>{const{__scopePopover:t,children:n,open:a,defaultOpen:o,onOpenChange:s,modal:c=!1}=e,u=wl(t),f=w.useRef(null),[h,m]=w.useState(!1),[g=!1,y]=oa({prop:a,defaultProp:o,onChange:s});return x.jsx(fg,{...u,children:x.jsx(fz,{scope:t,contentId:an(),triggerRef:f,open:g,onOpenChange:y,onOpenToggle:w.useCallback(()=>y(b=>!b),[y]),hasCustomAnchor:h,onCustomAnchorAdd:w.useCallback(()=>m(!0),[]),onCustomAnchorRemove:w.useCallback(()=>m(!1),[]),modal:c,children:n})})};mS.displayName=gg;var gS="PopoverAnchor",hz=w.forwardRef((e,t)=>{const{__scopePopover:n,...a}=e,o=$a(gS,n),s=wl(n),{onCustomAnchorAdd:c,onCustomAnchorRemove:u}=o;return w.useEffect(()=>(c(),()=>u()),[c,u]),x.jsx(td,{...s,...a,ref:t})});hz.displayName=gS;var vS="PopoverTrigger",yS=w.forwardRef((e,t)=>{const{__scopePopover:n,...a}=e,o=$a(vS,n),s=wl(n),c=at(t,o.triggerRef),u=x.jsx(Ie.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":SS(o.open),...a,ref:c,onClick:Be(e.onClick,o.onOpenToggle)});return o.hasCustomAnchor?u:x.jsx(td,{asChild:!0,...s,children:u})});yS.displayName=vS;var vg="PopoverPortal",[pz,mz]=pS(vg,{forceMount:void 0}),bS=e=>{const{__scopePopover:t,forceMount:n,children:a,container:o}=e,s=$a(vg,t);return x.jsx(pz,{scope:t,forceMount:n,children:x.jsx(Ln,{present:n||s.open,children:x.jsx(nd,{asChild:!0,container:o,children:a})})})};bS.displayName=vg;var Do="PopoverContent",xS=w.forwardRef((e,t)=>{const n=mz(Do,e.__scopePopover),{forceMount:a=n.forceMount,...o}=e,s=$a(Do,e.__scopePopover);return x.jsx(Ln,{present:a||s.open,children:s.modal?x.jsx(gz,{...o,ref:t}):x.jsx(vz,{...o,ref:t})})});xS.displayName=Do;var gz=w.forwardRef((e,t)=>{const n=$a(Do,e.__scopePopover),a=w.useRef(null),o=at(t,a),s=w.useRef(!1);return w.useEffect(()=>{const c=a.current;if(c)return mg(c)},[]),x.jsx(ad,{as:Ua,allowPinchZoom:!0,children:x.jsx(wS,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Be(e.onCloseAutoFocus,c=>{var u;c.preventDefault(),s.current||(u=n.triggerRef.current)==null||u.focus()}),onPointerDownOutside:Be(e.onPointerDownOutside,c=>{const u=c.detail.originalEvent,f=u.button===0&&u.ctrlKey===!0,h=u.button===2||f;s.current=h},{checkForDefaultPrevented:!1}),onFocusOutside:Be(e.onFocusOutside,c=>c.preventDefault(),{checkForDefaultPrevented:!1})})})}),vz=w.forwardRef((e,t)=>{const n=$a(Do,e.__scopePopover),a=w.useRef(!1),o=w.useRef(!1);return x.jsx(wS,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:s=>{var c,u;(c=e.onCloseAutoFocus)==null||c.call(e,s),s.defaultPrevented||(a.current||(u=n.triggerRef.current)==null||u.focus(),s.preventDefault()),a.current=!1,o.current=!1},onInteractOutside:s=>{var f,h;(f=e.onInteractOutside)==null||f.call(e,s),s.defaultPrevented||(a.current=!0,s.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const c=s.target;((h=n.triggerRef.current)==null?void 0:h.contains(c))&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&o.current&&s.preventDefault()}})}),wS=w.forwardRef((e,t)=>{const{__scopePopover:n,trapFocus:a,onOpenAutoFocus:o,onCloseAutoFocus:s,disableOutsidePointerEvents:c,onEscapeKeyDown:u,onPointerDownOutside:f,onFocusOutside:h,onInteractOutside:m,...g}=e,y=$a(Do,n),b=wl(n);return ng(),x.jsx(Zu,{asChild:!0,loop:!0,trapped:a,onMountAutoFocus:o,onUnmountAutoFocus:s,children:x.jsx(bl,{asChild:!0,disableOutsidePointerEvents:c,onInteractOutside:m,onEscapeKeyDown:u,onPointerDownOutside:f,onFocusOutside:h,onDismiss:()=>y.onOpenChange(!1),children:x.jsx(hg,{"data-state":SS(y.open),role:"dialog",id:y.contentId,...b,...g,ref:t,style:{...g.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)"}})})})}),ES="PopoverClose",yz=w.forwardRef((e,t)=>{const{__scopePopover:n,...a}=e,o=$a(ES,n);return x.jsx(Ie.button,{type:"button",...a,ref:t,onClick:Be(e.onClick,()=>o.onOpenChange(!1))})});yz.displayName=ES;var bz="PopoverArrow",xz=w.forwardRef((e,t)=>{const{__scopePopover:n,...a}=e,o=wl(n);return x.jsx(pg,{...o,...a,ref:t})});xz.displayName=bz;function SS(e){return e?"open":"closed"}var wz=mS,Ez=yS,Sz=bS,_S=xS;const id=wz,od=Ez,El=w.forwardRef(({className:e,align:t="center",sideOffset:n=4,...a},o)=>x.jsx(Sz,{children:x.jsx(_S,{ref:o,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),...a})}));El.displayName=_S.displayName;const _z=({status:e})=>e?x.jsxs("div",{className:"min-w-[300px] space-y-3 text-sm",children:[x.jsxs("div",{className:"space-y-1",children:[x.jsx("h4",{className:"font-medium",children:"Storage Info"}),x.jsxs("div",{className:"text-muted-foreground grid grid-cols-2 gap-1",children:[x.jsx("span",{children:"Working Directory:"}),x.jsx("span",{className:"truncate",children:e.working_directory}),x.jsx("span",{children:"Input Directory:"}),x.jsx("span",{className:"truncate",children:e.input_directory})]})]}),x.jsxs("div",{className:"space-y-1",children:[x.jsx("h4",{className:"font-medium",children:"LLM Configuration"}),x.jsxs("div",{className:"text-muted-foreground grid grid-cols-2 gap-1",children:[x.jsx("span",{children:"LLM Binding:"}),x.jsx("span",{children:e.configuration.llm_binding}),x.jsx("span",{children:"LLM Binding Host:"}),x.jsx("span",{children:e.configuration.llm_binding_host}),x.jsx("span",{children:"LLM Model:"}),x.jsx("span",{children:e.configuration.llm_model}),x.jsx("span",{children:"Max Tokens:"}),x.jsx("span",{children:e.configuration.max_tokens})]})]}),x.jsxs("div",{className:"space-y-1",children:[x.jsx("h4",{className:"font-medium",children:"Embedding Configuration"}),x.jsxs("div",{className:"text-muted-foreground grid grid-cols-2 gap-1",children:[x.jsx("span",{children:"Embedding Binding:"}),x.jsx("span",{children:e.configuration.embedding_binding}),x.jsx("span",{children:"Embedding Binding Host:"}),x.jsx("span",{children:e.configuration.embedding_binding_host}),x.jsx("span",{children:"Embedding Model:"}),x.jsx("span",{children:e.configuration.embedding_model})]})]}),x.jsxs("div",{className:"space-y-1",children:[x.jsx("h4",{className:"font-medium",children:"Storage Configuration"}),x.jsxs("div",{className:"text-muted-foreground grid grid-cols-2 gap-1",children:[x.jsx("span",{children:"KV Storage:"}),x.jsx("span",{children:e.configuration.kv_storage}),x.jsx("span",{children:"Doc Status Storage:"}),x.jsx("span",{children:e.configuration.doc_status_storage}),x.jsx("span",{children:"Graph Storage:"}),x.jsx("span",{children:e.configuration.graph_storage}),x.jsx("span",{children:"Vector Storage:"}),x.jsx("span",{children:e.configuration.vector_storage})]})]})]}):x.jsx("div",{className:"text-muted-foreground text-sm",children:"Status information unavailable"}),Tz=()=>{const e=Wn.use.health(),t=Wn.use.lastCheckTime(),n=Wn.use.status(),[a,o]=w.useState(!1);return w.useEffect(()=>{o(!0);const s=setTimeout(()=>o(!1),300);return()=>clearTimeout(s)},[t]),x.jsx("div",{className:"fixed right-4 bottom-4 flex items-center gap-2 opacity-80 select-none",children:x.jsxs(id,{children:[x.jsx(od,{asChild:!0,children:x.jsxs("div",{className:"flex cursor-help items-center gap-2",children:[x.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",a&&"scale-125",a&&e&&"shadow-[0_0_12px_rgba(34,197,94,0.4)]",a&&!e&&"shadow-[0_0_12px_rgba(239,68,68,0.4)]")}),x.jsx("span",{className:"text-muted-foreground text-xs",children:e?"Connected":"Disconnected"})]})}),x.jsx(El,{className:"w-auto",side:"top",align:"end",children:x.jsx(_z,{status:n})})]})})};var Cz=e=>{switch(e){case"success":return kz;case"info":return Nz;case"warning":return Dz;case"error":return Oz;default:return null}},Rz=Array(12).fill(0),Az=({visible:e,className:t})=>ve.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},ve.createElement("div",{className:"sonner-spinner"},Rz.map((n,a)=>ve.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${a}`})))),kz=ve.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},ve.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"})),Dz=ve.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},ve.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"})),Nz=ve.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},ve.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"})),Oz=ve.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},ve.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"})),jz=ve.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"},ve.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),ve.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),Lz=()=>{let[e,t]=ve.useState(document.hidden);return ve.useEffect(()=>{let n=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),e},fm=1,zz=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,...a}=e,o=typeof(e==null?void 0:e.id)=="number"||((t=e.id)==null?void 0:t.length)>0?e.id:fm++,s=this.toasts.find(u=>u.id===o),c=e.dismissible===void 0?!0:e.dismissible;return this.dismissedToasts.has(o)&&this.dismissedToasts.delete(o),s?this.toasts=this.toasts.map(u=>u.id===o?(this.publish({...u,...e,id:o,title:n}),{...u,...e,id:o,dismissible:c,title:n}):u):this.addToast({title:n,...a,dismissible:c,id:o}),o},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 a=e instanceof Promise?e:e(),o=n!==void 0,s,c=a.then(async f=>{if(s=["resolve",f],ve.isValidElement(f))o=!1,this.create({id:n,type:"default",message:f});else if(Pz(f)&&!f.ok){o=!1;let h=typeof t.error=="function"?await t.error(`HTTP error! status: ${f.status}`):t.error,m=typeof t.description=="function"?await t.description(`HTTP error! status: ${f.status}`):t.description;this.create({id:n,type:"error",message:h,description:m})}else if(t.success!==void 0){o=!1;let h=typeof t.success=="function"?await t.success(f):t.success,m=typeof t.description=="function"?await t.description(f):t.description;this.create({id:n,type:"success",message:h,description:m})}}).catch(async f=>{if(s=["reject",f],t.error!==void 0){o=!1;let h=typeof t.error=="function"?await t.error(f):t.error,m=typeof t.description=="function"?await t.description(f):t.description;this.create({id:n,type:"error",message:h,description:m})}}).finally(()=>{var f;o&&(this.dismiss(n),n=void 0),(f=t.finally)==null||f.call(t)}),u=()=>new Promise((f,h)=>c.then(()=>s[0]==="reject"?h(s[1]):f(s[1])).catch(h));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)||fm++;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}},xn=new zz,Mz=(e,t)=>{let n=(t==null?void 0:t.id)||fm++;return xn.addToast({title:e,...t,id:n}),n},Pz=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",Gz=Mz,Fz=()=>xn.toasts,Uz=()=>xn.getActiveToasts(),un=Object.assign(Gz,{success:xn.success,info:xn.info,warning:xn.warning,error:xn.error,custom:xn.custom,message:xn.message,promise:xn.promise,dismiss:xn.dismiss,loading:xn.loading},{getHistory:Fz,getToasts:Uz});function Bz(e,{insertAt:t}={}){if(typeof document>"u")return;let n=document.head||document.getElementsByTagName("head")[0],a=document.createElement("style");a.type="text/css",t==="top"&&n.firstChild?n.insertBefore(a,n.firstChild):n.appendChild(a),a.styleSheet?a.styleSheet.cssText=e:a.appendChild(document.createTextNode(e))}Bz(`: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 Vc(e){return e.label!==void 0}var Iz=3,Hz="32px",$z="16px",P0=4e3,Vz=356,qz=14,Yz=20,Wz=200;function rr(...e){return e.filter(Boolean).join(" ")}function Xz(e){let[t,n]=e.split("-"),a=[];return t&&a.push(t),n&&a.push(n),a}var Kz=e=>{var t,n,a,o,s,c,u,f,h,m,g;let{invert:y,toast:b,unstyled:S,interacting:E,setHeights:_,visibleToasts:N,heights:T,index:A,toasts:D,expanded:k,removeToast:M,defaultRichColors:R,closeButton:U,style:L,cancelButtonStyle:I,actionButtonStyle:q,className:Y="",descriptionClassName:B="",duration:X,position:ne,gap:F,loadingIcon:z,expandByDefault:j,classNames:K,icons:G,closeButtonAriaLabel:H="Close toast",pauseWhenPageIsHidden:O}=e,[$,W]=ve.useState(null),[re,de]=ve.useState(null),[ie,oe]=ve.useState(!1),[Te,he]=ve.useState(!1),[Se,be]=ve.useState(!1),[je,Ce]=ve.useState(!1),[ye,J]=ve.useState(!1),[le,_e]=ve.useState(0),[pe,Ee]=ve.useState(0),te=ve.useRef(b.duration||X||P0),Fe=ve.useRef(null),Pe=ve.useRef(null),me=A===0,Ae=A+1<=N,Oe=b.type,He=b.dismissible!==!1,it=b.className||"",Tt=b.descriptionClassName||"",bt=ve.useMemo(()=>T.findIndex(qe=>qe.toastId===b.id)||0,[T,b.id]),qt=ve.useMemo(()=>{var qe;return(qe=b.closeButton)!=null?qe:U},[b.closeButton,U]),fn=ve.useMemo(()=>b.duration||X||P0,[b.duration,X]),Gt=ve.useRef(0),rt=ve.useRef(0),Tn=ve.useRef(0),xt=ve.useRef(null),[Lt,Ya]=ne.split("-"),Ni=ve.useMemo(()=>T.reduce((qe,lt,pt)=>pt>=bt?qe:qe+lt.height,0),[T,bt]),Dl=Lz(),Oi=b.invert||y,la=Oe==="loading";rt.current=ve.useMemo(()=>bt*F+Ni,[bt,Ni]),ve.useEffect(()=>{te.current=fn},[fn]),ve.useEffect(()=>{oe(!0)},[]),ve.useEffect(()=>{let qe=Pe.current;if(qe){let lt=qe.getBoundingClientRect().height;return Ee(lt),_(pt=>[{toastId:b.id,height:lt,position:b.position},...pt]),()=>_(pt=>pt.filter(hn=>hn.toastId!==b.id))}},[_,b.id]),ve.useLayoutEffect(()=>{if(!ie)return;let qe=Pe.current,lt=qe.style.height;qe.style.height="auto";let pt=qe.getBoundingClientRect().height;qe.style.height=lt,Ee(pt),_(hn=>hn.find(sn=>sn.toastId===b.id)?hn.map(sn=>sn.toastId===b.id?{...sn,height:pt}:sn):[{toastId:b.id,height:pt,position:b.position},...hn])},[ie,b.title,b.description,_,b.id]);let Jt=ve.useCallback(()=>{he(!0),_e(rt.current),_(qe=>qe.filter(lt=>lt.toastId!==b.id)),setTimeout(()=>{M(b)},Wz)},[b,M,_,rt]);ve.useEffect(()=>{if(b.promise&&Oe==="loading"||b.duration===1/0||b.type==="loading")return;let qe;return k||E||O&&Dl?(()=>{if(Tn.current{var lt;(lt=b.onAutoClose)==null||lt.call(b,b),Jt()},te.current)),()=>clearTimeout(qe)},[k,E,b,Oe,O,Dl,Jt]),ve.useEffect(()=>{b.delete&&Jt()},[Jt,b.delete]);function ji(){var qe,lt,pt;return G!=null&&G.loading?ve.createElement("div",{className:rr(K==null?void 0:K.loader,(qe=b==null?void 0:b.classNames)==null?void 0:qe.loader,"sonner-loader"),"data-visible":Oe==="loading"},G.loading):z?ve.createElement("div",{className:rr(K==null?void 0:K.loader,(lt=b==null?void 0:b.classNames)==null?void 0:lt.loader,"sonner-loader"),"data-visible":Oe==="loading"},z):ve.createElement(Az,{className:rr(K==null?void 0:K.loader,(pt=b==null?void 0:b.classNames)==null?void 0:pt.loader),visible:Oe==="loading"})}return ve.createElement("li",{tabIndex:0,ref:Pe,className:rr(Y,it,K==null?void 0:K.toast,(t=b==null?void 0:b.classNames)==null?void 0:t.toast,K==null?void 0:K.default,K==null?void 0:K[Oe],(n=b==null?void 0:b.classNames)==null?void 0:n[Oe]),"data-sonner-toast":"","data-rich-colors":(a=b.richColors)!=null?a:R,"data-styled":!(b.jsx||b.unstyled||S),"data-mounted":ie,"data-promise":!!b.promise,"data-swiped":ye,"data-removed":Te,"data-visible":Ae,"data-y-position":Lt,"data-x-position":Ya,"data-index":A,"data-front":me,"data-swiping":Se,"data-dismissible":He,"data-type":Oe,"data-invert":Oi,"data-swipe-out":je,"data-swipe-direction":re,"data-expanded":!!(k||j&&ie),style:{"--index":A,"--toasts-before":A,"--z-index":D.length-A,"--offset":`${Te?le:rt.current}px`,"--initial-height":j?"auto":`${pe}px`,...L,...b.style},onDragEnd:()=>{be(!1),W(null),xt.current=null},onPointerDown:qe=>{la||!He||(Fe.current=new Date,_e(rt.current),qe.target.setPointerCapture(qe.pointerId),qe.target.tagName!=="BUTTON"&&(be(!0),xt.current={x:qe.clientX,y:qe.clientY}))},onPointerUp:()=>{var qe,lt,pt,hn;if(je||!He)return;xt.current=null;let sn=Number(((qe=Pe.current)==null?void 0:qe.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),pn=Number(((lt=Pe.current)==null?void 0:lt.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),Nr=new Date().getTime()-((pt=Fe.current)==null?void 0:pt.getTime()),mn=$==="x"?sn:pn,Qn=Math.abs(mn)/Nr;if(Math.abs(mn)>=Yz||Qn>.11){_e(rt.current),(hn=b.onDismiss)==null||hn.call(b,b),de($==="x"?sn>0?"right":"left":pn>0?"down":"up"),Jt(),Ce(!0),J(!1);return}be(!1),W(null)},onPointerMove:qe=>{var lt,pt,hn,sn;if(!xt.current||!He||((lt=window.getSelection())==null?void 0:lt.toString().length)>0)return;let pn=qe.clientY-xt.current.y,Nr=qe.clientX-xt.current.x,mn=(pt=e.swipeDirections)!=null?pt:Xz(ne);!$&&(Math.abs(Nr)>1||Math.abs(pn)>1)&&W(Math.abs(Nr)>Math.abs(pn)?"x":"y");let Qn={x:0,y:0};$==="y"?(mn.includes("top")||mn.includes("bottom"))&&(mn.includes("top")&&pn<0||mn.includes("bottom")&&pn>0)&&(Qn.y=pn):$==="x"&&(mn.includes("left")||mn.includes("right"))&&(mn.includes("left")&&Nr<0||mn.includes("right")&&Nr>0)&&(Qn.x=Nr),(Math.abs(Qn.x)>0||Math.abs(Qn.y)>0)&&J(!0),(hn=Pe.current)==null||hn.style.setProperty("--swipe-amount-x",`${Qn.x}px`),(sn=Pe.current)==null||sn.style.setProperty("--swipe-amount-y",`${Qn.y}px`)}},qt&&!b.jsx?ve.createElement("button",{"aria-label":H,"data-disabled":la,"data-close-button":!0,onClick:la||!He?()=>{}:()=>{var qe;Jt(),(qe=b.onDismiss)==null||qe.call(b,b)},className:rr(K==null?void 0:K.closeButton,(o=b==null?void 0:b.classNames)==null?void 0:o.closeButton)},(s=G==null?void 0:G.close)!=null?s:jz):null,b.jsx||w.isValidElement(b.title)?b.jsx?b.jsx:typeof b.title=="function"?b.title():b.title:ve.createElement(ve.Fragment,null,Oe||b.icon||b.promise?ve.createElement("div",{"data-icon":"",className:rr(K==null?void 0:K.icon,(c=b==null?void 0:b.classNames)==null?void 0:c.icon)},b.promise||b.type==="loading"&&!b.icon?b.icon||ji():null,b.type!=="loading"?b.icon||(G==null?void 0:G[Oe])||Cz(Oe):null):null,ve.createElement("div",{"data-content":"",className:rr(K==null?void 0:K.content,(u=b==null?void 0:b.classNames)==null?void 0:u.content)},ve.createElement("div",{"data-title":"",className:rr(K==null?void 0:K.title,(f=b==null?void 0:b.classNames)==null?void 0:f.title)},typeof b.title=="function"?b.title():b.title),b.description?ve.createElement("div",{"data-description":"",className:rr(B,Tt,K==null?void 0:K.description,(h=b==null?void 0:b.classNames)==null?void 0:h.description)},typeof b.description=="function"?b.description():b.description):null),w.isValidElement(b.cancel)?b.cancel:b.cancel&&Vc(b.cancel)?ve.createElement("button",{"data-button":!0,"data-cancel":!0,style:b.cancelButtonStyle||I,onClick:qe=>{var lt,pt;Vc(b.cancel)&&He&&((pt=(lt=b.cancel).onClick)==null||pt.call(lt,qe),Jt())},className:rr(K==null?void 0:K.cancelButton,(m=b==null?void 0:b.classNames)==null?void 0:m.cancelButton)},b.cancel.label):null,w.isValidElement(b.action)?b.action:b.action&&Vc(b.action)?ve.createElement("button",{"data-button":!0,"data-action":!0,style:b.actionButtonStyle||q,onClick:qe=>{var lt,pt;Vc(b.action)&&((pt=(lt=b.action).onClick)==null||pt.call(lt,qe),!qe.defaultPrevented&&Jt())},className:rr(K==null?void 0:K.actionButton,(g=b==null?void 0:b.classNames)==null?void 0:g.actionButton)},b.action.label):null))};function G0(){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 Zz(e,t){let n={};return[e,t].forEach((a,o)=>{let s=o===1,c=s?"--mobile-offset":"--offset",u=s?$z:Hz;function f(h){["top","right","bottom","left"].forEach(m=>{n[`${c}-${m}`]=typeof h=="number"?`${h}px`:h})}typeof a=="number"||typeof a=="string"?f(a):typeof a=="object"?["top","right","bottom","left"].forEach(h=>{a[h]===void 0?n[`${c}-${h}`]=u:n[`${c}-${h}`]=typeof a[h]=="number"?`${a[h]}px`:a[h]}):f(u)}),n}var Qz=w.forwardRef(function(e,t){let{invert:n,position:a="bottom-right",hotkey:o=["altKey","KeyT"],expand:s,closeButton:c,className:u,offset:f,mobileOffset:h,theme:m="light",richColors:g,duration:y,style:b,visibleToasts:S=Iz,toastOptions:E,dir:_=G0(),gap:N=qz,loadingIcon:T,icons:A,containerAriaLabel:D="Notifications",pauseWhenPageIsHidden:k}=e,[M,R]=ve.useState([]),U=ve.useMemo(()=>Array.from(new Set([a].concat(M.filter(O=>O.position).map(O=>O.position)))),[M,a]),[L,I]=ve.useState([]),[q,Y]=ve.useState(!1),[B,X]=ve.useState(!1),[ne,F]=ve.useState(m!=="system"?m:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),z=ve.useRef(null),j=o.join("+").replace(/Key/g,"").replace(/Digit/g,""),K=ve.useRef(null),G=ve.useRef(!1),H=ve.useCallback(O=>{R($=>{var W;return(W=$.find(re=>re.id===O.id))!=null&&W.delete||xn.dismiss(O.id),$.filter(({id:re})=>re!==O.id)})},[]);return ve.useEffect(()=>xn.subscribe(O=>{if(O.dismiss){R($=>$.map(W=>W.id===O.id?{...W,delete:!0}:W));return}setTimeout(()=>{LE.flushSync(()=>{R($=>{let W=$.findIndex(re=>re.id===O.id);return W!==-1?[...$.slice(0,W),{...$[W],...O},...$.slice(W+1)]:[O,...$]})})})}),[]),ve.useEffect(()=>{if(m!=="system"){F(m);return}if(m==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?F("dark"):F("light")),typeof window>"u")return;let O=window.matchMedia("(prefers-color-scheme: dark)");try{O.addEventListener("change",({matches:$})=>{F($?"dark":"light")})}catch{O.addListener(({matches:W})=>{try{F(W?"dark":"light")}catch(re){console.error(re)}})}},[m]),ve.useEffect(()=>{M.length<=1&&Y(!1)},[M]),ve.useEffect(()=>{let O=$=>{var W,re;o.every(de=>$[de]||$.code===de)&&(Y(!0),(W=z.current)==null||W.focus()),$.code==="Escape"&&(document.activeElement===z.current||(re=z.current)!=null&&re.contains(document.activeElement))&&Y(!1)};return document.addEventListener("keydown",O),()=>document.removeEventListener("keydown",O)},[o]),ve.useEffect(()=>{if(z.current)return()=>{K.current&&(K.current.focus({preventScroll:!0}),K.current=null,G.current=!1)}},[z.current]),ve.createElement("section",{ref:t,"aria-label":`${D} ${j}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},U.map((O,$)=>{var W;let[re,de]=O.split("-");return M.length?ve.createElement("ol",{key:O,dir:_==="auto"?G0():_,tabIndex:-1,ref:z,className:u,"data-sonner-toaster":!0,"data-theme":ne,"data-y-position":re,"data-lifted":q&&M.length>1&&!s,"data-x-position":de,style:{"--front-toast-height":`${((W=L[0])==null?void 0:W.height)||0}px`,"--width":`${Vz}px`,"--gap":`${N}px`,...b,...Zz(f,h)},onBlur:ie=>{G.current&&!ie.currentTarget.contains(ie.relatedTarget)&&(G.current=!1,K.current&&(K.current.focus({preventScroll:!0}),K.current=null))},onFocus:ie=>{ie.target instanceof HTMLElement&&ie.target.dataset.dismissible==="false"||G.current||(G.current=!0,K.current=ie.relatedTarget)},onMouseEnter:()=>Y(!0),onMouseMove:()=>Y(!0),onMouseLeave:()=>{B||Y(!1)},onDragEnd:()=>Y(!1),onPointerDown:ie=>{ie.target instanceof HTMLElement&&ie.target.dataset.dismissible==="false"||X(!0)},onPointerUp:()=>X(!1)},M.filter(ie=>!ie.position&&$===0||ie.position===O).map((ie,oe)=>{var Te,he;return ve.createElement(Kz,{key:ie.id,icons:A,index:oe,toast:ie,defaultRichColors:g,duration:(Te=E==null?void 0:E.duration)!=null?Te:y,className:E==null?void 0:E.className,descriptionClassName:E==null?void 0:E.descriptionClassName,invert:n,visibleToasts:S,closeButton:(he=E==null?void 0:E.closeButton)!=null?he:c,interacting:B,position:O,style:E==null?void 0:E.style,unstyled:E==null?void 0:E.unstyled,classNames:E==null?void 0:E.classNames,cancelButtonStyle:E==null?void 0:E.cancelButtonStyle,actionButtonStyle:E==null?void 0:E.actionButtonStyle,removeToast:H,toasts:M.filter(Se=>Se.position==ie.position),heights:L.filter(Se=>Se.position==ie.position),setHeights:I,expandByDefault:s,gap:N,loadingIcon:T,expanded:q,pauseWhenPageIsHidden:k,swipeDirections:e.swipeDirections})})):null}))}),Jz="VisuallyHidden",yg=w.forwardRef((e,t)=>x.jsx(Ie.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}}));yg.displayName=Jz;var eM=yg,[sd,JI]=fr("Tooltip",[Ho]),ld=Ho(),TS="TooltipProvider",tM=700,hm="tooltip.open",[nM,bg]=sd(TS),CS=e=>{const{__scopeTooltip:t,delayDuration:n=tM,skipDelayDuration:a=300,disableHoverableContent:o=!1,children:s}=e,[c,u]=w.useState(!0),f=w.useRef(!1),h=w.useRef(0);return w.useEffect(()=>{const m=h.current;return()=>window.clearTimeout(m)},[]),x.jsx(nM,{scope:t,isOpenDelayed:c,delayDuration:n,onOpen:w.useCallback(()=>{window.clearTimeout(h.current),u(!1)},[]),onClose:w.useCallback(()=>{window.clearTimeout(h.current),h.current=window.setTimeout(()=>u(!0),a)},[a]),isPointerInTransitRef:f,onPointerInTransitChange:w.useCallback(m=>{f.current=m},[]),disableHoverableContent:o,children:s})};CS.displayName=TS;var cd="Tooltip",[rM,ud]=sd(cd),RS=e=>{const{__scopeTooltip:t,children:n,open:a,defaultOpen:o=!1,onOpenChange:s,disableHoverableContent:c,delayDuration:u}=e,f=bg(cd,e.__scopeTooltip),h=ld(t),[m,g]=w.useState(null),y=an(),b=w.useRef(0),S=c??f.disableHoverableContent,E=u??f.delayDuration,_=w.useRef(!1),[N=!1,T]=oa({prop:a,defaultProp:o,onChange:R=>{R?(f.onOpen(),document.dispatchEvent(new CustomEvent(hm))):f.onClose(),s==null||s(R)}}),A=w.useMemo(()=>N?_.current?"delayed-open":"instant-open":"closed",[N]),D=w.useCallback(()=>{window.clearTimeout(b.current),b.current=0,_.current=!1,T(!0)},[T]),k=w.useCallback(()=>{window.clearTimeout(b.current),b.current=0,T(!1)},[T]),M=w.useCallback(()=>{window.clearTimeout(b.current),b.current=window.setTimeout(()=>{_.current=!0,T(!0),b.current=0},E)},[E,T]);return w.useEffect(()=>()=>{b.current&&(window.clearTimeout(b.current),b.current=0)},[]),x.jsx(fg,{...h,children:x.jsx(rM,{scope:t,contentId:y,open:N,stateAttribute:A,trigger:m,onTriggerChange:g,onTriggerEnter:w.useCallback(()=>{f.isOpenDelayed?M():D()},[f.isOpenDelayed,M,D]),onTriggerLeave:w.useCallback(()=>{S?k():(window.clearTimeout(b.current),b.current=0)},[k,S]),onOpen:D,onClose:k,disableHoverableContent:S,children:n})})};RS.displayName=cd;var pm="TooltipTrigger",AS=w.forwardRef((e,t)=>{const{__scopeTooltip:n,...a}=e,o=ud(pm,n),s=bg(pm,n),c=ld(n),u=w.useRef(null),f=at(t,u,o.onTriggerChange),h=w.useRef(!1),m=w.useRef(!1),g=w.useCallback(()=>h.current=!1,[]);return w.useEffect(()=>()=>document.removeEventListener("pointerup",g),[g]),x.jsx(td,{asChild:!0,...c,children:x.jsx(Ie.button,{"aria-describedby":o.open?o.contentId:void 0,"data-state":o.stateAttribute,...a,ref:f,onPointerMove:Be(e.onPointerMove,y=>{y.pointerType!=="touch"&&!m.current&&!s.isPointerInTransitRef.current&&(o.onTriggerEnter(),m.current=!0)}),onPointerLeave:Be(e.onPointerLeave,()=>{o.onTriggerLeave(),m.current=!1}),onPointerDown:Be(e.onPointerDown,()=>{h.current=!0,document.addEventListener("pointerup",g,{once:!0})}),onFocus:Be(e.onFocus,()=>{h.current||o.onOpen()}),onBlur:Be(e.onBlur,o.onClose),onClick:Be(e.onClick,o.onClose)})})});AS.displayName=pm;var aM="TooltipPortal",[e6,iM]=sd(aM,{forceMount:void 0}),No="TooltipContent",kS=w.forwardRef((e,t)=>{const n=iM(No,e.__scopeTooltip),{forceMount:a=n.forceMount,side:o="top",...s}=e,c=ud(No,e.__scopeTooltip);return x.jsx(Ln,{present:a||c.open,children:c.disableHoverableContent?x.jsx(DS,{side:o,...s,ref:t}):x.jsx(oM,{side:o,...s,ref:t})})}),oM=w.forwardRef((e,t)=>{const n=ud(No,e.__scopeTooltip),a=bg(No,e.__scopeTooltip),o=w.useRef(null),s=at(t,o),[c,u]=w.useState(null),{trigger:f,onClose:h}=n,m=o.current,{onPointerInTransitChange:g}=a,y=w.useCallback(()=>{u(null),g(!1)},[g]),b=w.useCallback((S,E)=>{const _=S.currentTarget,N={x:S.clientX,y:S.clientY},T=uM(N,_.getBoundingClientRect()),A=dM(N,T),D=fM(E.getBoundingClientRect()),k=pM([...A,...D]);u(k),g(!0)},[g]);return w.useEffect(()=>()=>y(),[y]),w.useEffect(()=>{if(f&&m){const S=_=>b(_,m),E=_=>b(_,f);return f.addEventListener("pointerleave",S),m.addEventListener("pointerleave",E),()=>{f.removeEventListener("pointerleave",S),m.removeEventListener("pointerleave",E)}}},[f,m,b,y]),w.useEffect(()=>{if(c){const S=E=>{const _=E.target,N={x:E.clientX,y:E.clientY},T=(f==null?void 0:f.contains(_))||(m==null?void 0:m.contains(_)),A=!hM(N,c);T?y():A&&(y(),h())};return document.addEventListener("pointermove",S),()=>document.removeEventListener("pointermove",S)}},[f,m,c,h,y]),x.jsx(DS,{...e,ref:s})}),[sM,lM]=sd(cd,{isInside:!1}),DS=w.forwardRef((e,t)=>{const{__scopeTooltip:n,children:a,"aria-label":o,onEscapeKeyDown:s,onPointerDownOutside:c,...u}=e,f=ud(No,n),h=ld(n),{onClose:m}=f;return w.useEffect(()=>(document.addEventListener(hm,m),()=>document.removeEventListener(hm,m)),[m]),w.useEffect(()=>{if(f.trigger){const g=y=>{const b=y.target;b!=null&&b.contains(f.trigger)&&m()};return window.addEventListener("scroll",g,{capture:!0}),()=>window.removeEventListener("scroll",g,{capture:!0})}},[f.trigger,m]),x.jsx(bl,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:g=>g.preventDefault(),onDismiss:m,children:x.jsxs(hg,{"data-state":f.stateAttribute,...h,...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:[x.jsx(zE,{children:a}),x.jsx(sM,{scope:n,isInside:!0,children:x.jsx(eM,{id:f.contentId,role:"tooltip",children:o||a})})]})})});kS.displayName=No;var NS="TooltipArrow",cM=w.forwardRef((e,t)=>{const{__scopeTooltip:n,...a}=e,o=ld(n);return lM(NS,n).isInside?null:x.jsx(pg,{...o,...a,ref:t})});cM.displayName=NS;function uM(e,t){const n=Math.abs(t.top-e.y),a=Math.abs(t.bottom-e.y),o=Math.abs(t.right-e.x),s=Math.abs(t.left-e.x);switch(Math.min(n,a,o,s)){case s:return"left";case o:return"right";case n:return"top";case a:return"bottom";default:throw new Error("unreachable")}}function dM(e,t,n=5){const a=[];switch(t){case"top":a.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":a.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":a.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":a.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return a}function fM(e){const{top:t,right:n,bottom:a,left:o}=e;return[{x:o,y:t},{x:n,y:t},{x:n,y:a},{x:o,y:a}]}function hM(e,t){const{x:n,y:a}=e;let o=!1;for(let s=0,c=t.length-1;sa!=m>a&&n<(h-u)*(a-f)/(m-f)+u&&(o=!o)}return o}function pM(e){const t=e.slice();return t.sort((n,a)=>n.xa.x?1:n.ya.y?1:0),mM(t)}function mM(e){if(e.length<=1)return e.slice();const t=[];for(let a=0;a=2;){const s=t[t.length-1],c=t[t.length-2];if((s.x-c.x)*(o.y-c.y)>=(s.y-c.y)*(o.x-c.x))t.pop();else break}t.push(o)}t.pop();const n=[];for(let a=e.length-1;a>=0;a--){const o=e[a];for(;n.length>=2;){const s=n[n.length-1],c=n[n.length-2];if((s.x-c.x)*(o.y-c.y)>=(s.y-c.y)*(o.x-c.x))n.pop();else break}n.push(o)}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 gM=CS,vM=RS,yM=AS,OS=kS;const jS=gM,LS=vM,zS=yM,bM=e=>typeof e!="string"?e:e.split("\\n").map((t,n)=>x.jsxs(w.Fragment,{children:[t,nx.jsx(OS,{ref:o,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),...a,children:typeof n=="string"?bM(n):n}));xg.displayName=OS.displayName;const F0=J1("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"}}),_t=w.forwardRef(({className:e,variant:t,tooltip:n,size:a,side:o="right",asChild:s=!1,...c},u)=>{const f=s?Ua:"button";return n?x.jsx(jS,{children:x.jsxs(LS,{children:[x.jsx(zS,{asChild:!0,children:x.jsx(f,{className:Me(F0({variant:t,size:a,className:e}),"cursor-pointer"),ref:u,...c})}),x.jsx(xg,{side:o,children:n})]})}):x.jsx(f,{className:Me(F0({variant:t,size:a,className:e}),"cursor-pointer"),ref:u,...c})});_t.displayName="Button";const MS=()=>{const e=w.useContext(Q1);if(e===void 0)throw new Error("useTheme must be used within a ThemeProvider");return e};function xM(){const{theme:e,setTheme:t}=MS(),n=w.useCallback(()=>t("light"),[t]),a=w.useCallback(()=>t("dark"),[t]);return e==="dark"?x.jsx(_t,{onClick:n,variant:_r,tooltip:"Switch to light theme",size:"icon",side:"bottom",children:x.jsx(SO,{})}):x.jsx(_t,{onClick:a,variant:_r,tooltip:"Switch to dark theme",size:"icon",side:"bottom",children:x.jsx(PO,{})})}function PS(e){const t=e+"CollectionProvider",[n,a]=fr(t),[o,s]=n(t,{collectionRef:{current:null},itemMap:new Map}),c=b=>{const{scope:S,children:E}=b,_=ve.useRef(null),N=ve.useRef(new Map).current;return x.jsx(o,{scope:S,itemMap:N,collectionRef:_,children:E})};c.displayName=t;const u=e+"CollectionSlot",f=ve.forwardRef((b,S)=>{const{scope:E,children:_}=b,N=s(u,E),T=at(S,N.collectionRef);return x.jsx(Ua,{ref:T,children:_})});f.displayName=u;const h=e+"CollectionItemSlot",m="data-radix-collection-item",g=ve.forwardRef((b,S)=>{const{scope:E,children:_,...N}=b,T=ve.useRef(null),A=at(S,T),D=s(h,E);return ve.useEffect(()=>(D.itemMap.set(T,{ref:T,...N}),()=>void D.itemMap.delete(T))),x.jsx(Ua,{[m]:"",ref:A,children:_})});g.displayName=h;function y(b){const S=s(e+"CollectionConsumer",b);return ve.useCallback(()=>{const _=S.collectionRef.current;if(!_)return[];const N=Array.from(_.querySelectorAll(`[${m}]`));return Array.from(S.itemMap.values()).sort((D,k)=>N.indexOf(D.ref.current)-N.indexOf(k.ref.current))},[S.collectionRef,S.itemMap])}return[{Provider:c,Slot:f,ItemSlot:g},y,a]}var wM=w.createContext(void 0);function dd(e){const t=w.useContext(wM);return e||t||"ltr"}var Qh="rovingFocusGroup.onEntryFocus",EM={bubbles:!1,cancelable:!0},fd="RovingFocusGroup",[mm,GS,SM]=PS(fd),[_M,FS]=fr(fd,[SM]),[TM,CM]=_M(fd),US=w.forwardRef((e,t)=>x.jsx(mm.Provider,{scope:e.__scopeRovingFocusGroup,children:x.jsx(mm.Slot,{scope:e.__scopeRovingFocusGroup,children:x.jsx(RM,{...e,ref:t})})}));US.displayName=fd;var RM=w.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:a,loop:o=!1,dir:s,currentTabStopId:c,defaultCurrentTabStopId:u,onCurrentTabStopIdChange:f,onEntryFocus:h,preventScrollOnEntryFocus:m=!1,...g}=e,y=w.useRef(null),b=at(t,y),S=dd(s),[E=null,_]=oa({prop:c,defaultProp:u,onChange:f}),[N,T]=w.useState(!1),A=Zt(h),D=GS(n),k=w.useRef(!1),[M,R]=w.useState(0);return w.useEffect(()=>{const U=y.current;if(U)return U.addEventListener(Qh,A),()=>U.removeEventListener(Qh,A)},[A]),x.jsx(TM,{scope:n,orientation:a,dir:S,loop:o,currentTabStopId:E,onItemFocus:w.useCallback(U=>_(U),[_]),onItemShiftTab:w.useCallback(()=>T(!0),[]),onFocusableItemAdd:w.useCallback(()=>R(U=>U+1),[]),onFocusableItemRemove:w.useCallback(()=>R(U=>U-1),[]),children:x.jsx(Ie.div,{tabIndex:N||M===0?-1:0,"data-orientation":a,...g,ref:b,style:{outline:"none",...e.style},onMouseDown:Be(e.onMouseDown,()=>{k.current=!0}),onFocus:Be(e.onFocus,U=>{const L=!k.current;if(U.target===U.currentTarget&&L&&!N){const I=new CustomEvent(Qh,EM);if(U.currentTarget.dispatchEvent(I),!I.defaultPrevented){const q=D().filter(F=>F.focusable),Y=q.find(F=>F.active),B=q.find(F=>F.id===E),ne=[Y,B,...q].filter(Boolean).map(F=>F.ref.current);HS(ne,m)}}k.current=!1}),onBlur:Be(e.onBlur,()=>T(!1))})})}),BS="RovingFocusGroupItem",IS=w.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:a=!0,active:o=!1,tabStopId:s,...c}=e,u=an(),f=s||u,h=CM(BS,n),m=h.currentTabStopId===f,g=GS(n),{onFocusableItemAdd:y,onFocusableItemRemove:b}=h;return w.useEffect(()=>{if(a)return y(),()=>b()},[a,y,b]),x.jsx(mm.ItemSlot,{scope:n,id:f,focusable:a,active:o,children:x.jsx(Ie.span,{tabIndex:m?0:-1,"data-orientation":h.orientation,...c,ref:t,onMouseDown:Be(e.onMouseDown,S=>{a?h.onItemFocus(f):S.preventDefault()}),onFocus:Be(e.onFocus,()=>h.onItemFocus(f)),onKeyDown:Be(e.onKeyDown,S=>{if(S.key==="Tab"&&S.shiftKey){h.onItemShiftTab();return}if(S.target!==S.currentTarget)return;const E=DM(S,h.orientation,h.dir);if(E!==void 0){if(S.metaKey||S.ctrlKey||S.altKey||S.shiftKey)return;S.preventDefault();let N=g().filter(T=>T.focusable).map(T=>T.ref.current);if(E==="last")N.reverse();else if(E==="prev"||E==="next"){E==="prev"&&N.reverse();const T=N.indexOf(S.currentTarget);N=h.loop?NM(N,T+1):N.slice(T+1)}setTimeout(()=>HS(N))}})})})});IS.displayName=BS;var AM={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function kM(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function DM(e,t,n){const a=kM(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(a))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(a)))return AM[a]}function HS(e,t=!1){const n=document.activeElement;for(const a of e)if(a===n||(a.focus({preventScroll:t}),document.activeElement!==n))return}function NM(e,t){return e.map((n,a)=>e[(t+a)%e.length])}var OM=US,jM=IS,wg="Tabs",[LM,t6]=fr(wg,[FS]),$S=FS(),[zM,Eg]=LM(wg),VS=w.forwardRef((e,t)=>{const{__scopeTabs:n,value:a,onValueChange:o,defaultValue:s,orientation:c="horizontal",dir:u,activationMode:f="automatic",...h}=e,m=dd(u),[g,y]=oa({prop:a,onChange:o,defaultProp:s});return x.jsx(zM,{scope:n,baseId:an(),value:g,onValueChange:y,orientation:c,dir:m,activationMode:f,children:x.jsx(Ie.div,{dir:m,"data-orientation":c,...h,ref:t})})});VS.displayName=wg;var qS="TabsList",YS=w.forwardRef((e,t)=>{const{__scopeTabs:n,loop:a=!0,...o}=e,s=Eg(qS,n),c=$S(n);return x.jsx(OM,{asChild:!0,...c,orientation:s.orientation,dir:s.dir,loop:a,children:x.jsx(Ie.div,{role:"tablist","aria-orientation":s.orientation,...o,ref:t})})});YS.displayName=qS;var WS="TabsTrigger",XS=w.forwardRef((e,t)=>{const{__scopeTabs:n,value:a,disabled:o=!1,...s}=e,c=Eg(WS,n),u=$S(n),f=QS(c.baseId,a),h=JS(c.baseId,a),m=a===c.value;return x.jsx(jM,{asChild:!0,...u,focusable:!o,active:m,children:x.jsx(Ie.button,{type:"button",role:"tab","aria-selected":m,"aria-controls":h,"data-state":m?"active":"inactive","data-disabled":o?"":void 0,disabled:o,id:f,...s,ref:t,onMouseDown:Be(e.onMouseDown,g=>{!o&&g.button===0&&g.ctrlKey===!1?c.onValueChange(a):g.preventDefault()}),onKeyDown:Be(e.onKeyDown,g=>{[" ","Enter"].includes(g.key)&&c.onValueChange(a)}),onFocus:Be(e.onFocus,()=>{const g=c.activationMode!=="manual";!m&&!o&&g&&c.onValueChange(a)})})})});XS.displayName=WS;var KS="TabsContent",ZS=w.forwardRef((e,t)=>{const{__scopeTabs:n,value:a,forceMount:o,children:s,...c}=e,u=Eg(KS,n),f=QS(u.baseId,a),h=JS(u.baseId,a),m=a===u.value,g=w.useRef(m);return w.useEffect(()=>{const y=requestAnimationFrame(()=>g.current=!1);return()=>cancelAnimationFrame(y)},[]),x.jsx(Ln,{present:o||m,children:({present:y})=>x.jsx(Ie.div,{"data-state":m?"active":"inactive","data-orientation":u.orientation,role:"tabpanel","aria-labelledby":f,hidden:!y,id:h,tabIndex:0,...c,ref:t,style:{...e.style,animationDuration:g.current?"0s":void 0},children:y&&s})})});ZS.displayName=KS;function QS(e,t){return`${e}-trigger-${t}`}function JS(e,t){return`${e}-content-${t}`}var MM=VS,e_=YS,t_=XS,n_=ZS;const PM=MM,r_=w.forwardRef(({className:e,...t},n)=>x.jsx(e_,{ref:n,className:Me("bg-muted text-muted-foreground inline-flex h-10 items-center justify-center rounded-md p-1",e),...t}));r_.displayName=e_.displayName;const a_=w.forwardRef(({className:e,...t},n)=>x.jsx(t_,{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}));a_.displayName=t_.displayName;const tl=w.forwardRef(({className:e,...t},n)=>x.jsx(n_,{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}));tl.displayName=n_.displayName;function qc({value:e,currentTab:t,children:n}){return x.jsx(a_,{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 GM(){const e=We.use.currentTab();return x.jsx("div",{className:"flex h-8 self-center",children:x.jsxs(r_,{className:"h-full gap-2",children:[x.jsx(qc,{value:"documents",currentTab:e,children:"Documents"}),x.jsx(qc,{value:"knowledge-graph",currentTab:e,children:"Knowledge Graph"}),x.jsx(qc,{value:"retrieval",currentTab:e,children:"Retrieval"}),x.jsx(qc,{value:"api",currentTab:e,children:"API"})]})})}function FM(){return x.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:[x.jsxs("a",{href:"/",className:"mr-6 flex items-center gap-2",children:[x.jsx(BO,{className:"size-4 text-emerald-400","aria-hidden":"true"}),x.jsx("span",{className:"font-bold md:inline-block",children:Jx.name})]}),x.jsx("div",{className:"flex h-10 flex-1 justify-center",children:x.jsx(GM,{})}),x.jsxs("nav",{className:"flex items-center",children:[x.jsx(_t,{variant:"ghost",size:"icon",side:"bottom",tooltip:"Project Repository",children:x.jsx("a",{href:Jx.github,target:"_blank",rel:"noopener noreferrer",children:x.jsx(fO,{className:"size-4","aria-hidden":"true"})})}),x.jsx(xM,{})]})]})}var Yc={exports:{}},U0;function UM(){if(U0)return Yc.exports;U0=1;var e=typeof Reflect=="object"?Reflect:null,t=e&&typeof e.apply=="function"?e.apply:function(k,M,R){return Function.prototype.apply.call(k,M,R)},n;e&&typeof e.ownKeys=="function"?n=e.ownKeys:Object.getOwnPropertySymbols?n=function(k){return Object.getOwnPropertyNames(k).concat(Object.getOwnPropertySymbols(k))}:n=function(k){return Object.getOwnPropertyNames(k)};function a(D){console&&console.warn&&console.warn(D)}var o=Number.isNaN||function(k){return k!==k};function s(){s.init.call(this)}Yc.exports=s,Yc.exports.once=N,s.EventEmitter=s,s.prototype._events=void 0,s.prototype._eventsCount=0,s.prototype._maxListeners=void 0;var c=10;function u(D){if(typeof D!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof D)}Object.defineProperty(s,"defaultMaxListeners",{enumerable:!0,get:function(){return c},set:function(D){if(typeof D!="number"||D<0||o(D))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+D+".");c=D}}),s.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},s.prototype.setMaxListeners=function(k){if(typeof k!="number"||k<0||o(k))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+k+".");return this._maxListeners=k,this};function f(D){return D._maxListeners===void 0?s.defaultMaxListeners:D._maxListeners}s.prototype.getMaxListeners=function(){return f(this)},s.prototype.emit=function(k){for(var M=[],R=1;R0&&(I=M[0]),I instanceof Error)throw I;var q=new Error("Unhandled error."+(I?" ("+I.message+")":""));throw q.context=I,q}var Y=L[k];if(Y===void 0)return!1;if(typeof Y=="function")t(Y,this,M);else for(var B=Y.length,X=S(Y,B),R=0;R0&&I.length>U&&!I.warned){I.warned=!0;var q=new Error("Possible EventEmitter memory leak detected. "+I.length+" "+String(k)+" listeners added. Use emitter.setMaxListeners() to increase limit");q.name="MaxListenersExceededWarning",q.emitter=D,q.type=k,q.count=I.length,a(q)}return D}s.prototype.addListener=function(k,M){return h(this,k,M,!1)},s.prototype.on=s.prototype.addListener,s.prototype.prependListener=function(k,M){return h(this,k,M,!0)};function m(){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 g(D,k,M){var R={fired:!1,wrapFn:void 0,target:D,type:k,listener:M},U=m.bind(R);return U.listener=M,R.wrapFn=U,U}s.prototype.once=function(k,M){return u(M),this.on(k,g(this,k,M)),this},s.prototype.prependOnceListener=function(k,M){return u(M),this.prependListener(k,g(this,k,M)),this},s.prototype.removeListener=function(k,M){var R,U,L,I,q;if(u(M),U=this._events,U===void 0)return this;if(R=U[k],R===void 0)return this;if(R===M||R.listener===M)--this._eventsCount===0?this._events=Object.create(null):(delete U[k],U.removeListener&&this.emit("removeListener",k,R.listener||M));else if(typeof R!="function"){for(L=-1,I=R.length-1;I>=0;I--)if(R[I]===M||R[I].listener===M){q=R[I].listener,L=I;break}if(L<0)return this;L===0?R.shift():E(R,L),R.length===1&&(U[k]=R[0]),U.removeListener!==void 0&&this.emit("removeListener",k,q||M)}return this},s.prototype.off=s.prototype.removeListener,s.prototype.removeAllListeners=function(k){var M,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[k]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete R[k]),this;if(arguments.length===0){var L=Object.keys(R),I;for(U=0;U=0;U--)this.removeListener(k,M[U]);return this};function y(D,k,M){var R=D._events;if(R===void 0)return[];var U=R[k];return U===void 0?[]:typeof U=="function"?M?[U.listener||U]:[U]:M?_(U):S(U,U.length)}s.prototype.listeners=function(k){return y(this,k,!0)},s.prototype.rawListeners=function(k){return y(this,k,!1)},s.listenerCount=function(D,k){return typeof D.listenerCount=="function"?D.listenerCount(k):b.call(D,k)},s.prototype.listenerCount=b;function b(D){var k=this._events;if(k!==void 0){var M=k[D];if(typeof M=="function")return 1;if(M!==void 0)return M.length}return 0}s.prototype.eventNames=function(){return this._eventsCount>0?n(this._events):[]};function S(D,k){for(var M=new Array(k),R=0;Re++}function ra(){const e=arguments;let t=null,n=-1;return{[Symbol.iterator](){return this},next(){let a=null;do{if(t===null){if(n++,n>=e.length)return{done:!0};t=e[n][Symbol.iterator]()}if(a=t.next(),a.done){t=null;continue}break}while(!0);return a}}}function $o(){return{[Symbol.iterator](){return this},next(){return{done:!0}}}}class Sg extends Error{constructor(t){super(),this.name="GraphError",this.message=t}}class ke extends Sg{constructor(t){super(t),this.name="InvalidArgumentsGraphError",typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,ke.prototype.constructor)}}class Re extends Sg{constructor(t){super(t),this.name="NotFoundGraphError",typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,Re.prototype.constructor)}}class $e extends Sg{constructor(t){super(t),this.name="UsageGraphError",typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,$e.prototype.constructor)}}function s_(e,t){this.key=e,this.attributes=t,this.clear()}s_.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 l_(e,t){this.key=e,this.attributes=t,this.clear()}l_.prototype.clear=function(){this.inDegree=0,this.outDegree=0,this.directedLoops=0,this.in={},this.out={}};function c_(e,t){this.key=e,this.attributes=t,this.clear()}c_.prototype.clear=function(){this.undirectedDegree=0,this.undirectedLoops=0,this.undirected={}};function Vo(e,t,n,a,o){this.key=t,this.attributes=o,this.undirected=e,this.source=n,this.target=a}Vo.prototype.attach=function(){let e="out",t="in";this.undirected&&(e=t="undirected");const n=this.source.key,a=this.target.key;this.source[e][a]=this,!(this.undirected&&n===a)&&(this.target[t][n]=this)};Vo.prototype.attachMulti=function(){let e="out",t="in";const n=this.source.key,a=this.target.key;this.undirected&&(e=t="undirected");const o=this.source[e],s=o[a];if(typeof s>"u"){o[a]=this,this.undirected&&n===a||(this.target[t][n]=this);return}s.previous=this,this.next=s,o[a]=this,this.target[t][n]=this};Vo.prototype.detach=function(){const e=this.source.key,t=this.target.key;let n="out",a="in";this.undirected&&(n=a="undirected"),delete this.source[n][t],delete this.target[a][e]};Vo.prototype.detachMulti=function(){const e=this.source.key,t=this.target.key;let n="out",a="in";this.undirected&&(n=a="undirected"),this.previous===void 0?this.next===void 0?(delete this.source[n][t],delete this.target[a][e]):(this.next.previous=void 0,this.source[n][t]=this.next,this.target[a][e]=this.next):(this.previous.next=this.next,this.next!==void 0&&(this.next.previous=this.previous))};const u_=0,d_=1,HM=2,f_=3;function sa(e,t,n,a,o,s,c){let u,f,h,m;if(a=""+a,n===u_){if(u=e._nodes.get(a),!u)throw new Re(`Graph.${t}: could not find the "${a}" node in the graph.`);h=o,m=s}else if(n===f_){if(o=""+o,f=e._edges.get(o),!f)throw new Re(`Graph.${t}: could not find the "${o}" edge in the graph.`);const g=f.source.key,y=f.target.key;if(a===g)u=f.target;else if(a===y)u=f.source;else throw new Re(`Graph.${t}: the "${a}" node is not attached to the "${o}" edge (${g}, ${y}).`);h=s,m=c}else{if(f=e._edges.get(a),!f)throw new Re(`Graph.${t}: could not find the "${a}" edge in the graph.`);n===d_?u=f.source:u=f.target,h=o,m=s}return[u,h,m]}function $M(e,t,n){e.prototype[t]=function(a,o,s){const[c,u]=sa(this,t,n,a,o,s);return c.attributes[u]}}function VM(e,t,n){e.prototype[t]=function(a,o){const[s]=sa(this,t,n,a,o);return s.attributes}}function qM(e,t,n){e.prototype[t]=function(a,o,s){const[c,u]=sa(this,t,n,a,o,s);return c.attributes.hasOwnProperty(u)}}function YM(e,t,n){e.prototype[t]=function(a,o,s,c){const[u,f,h]=sa(this,t,n,a,o,s,c);return u.attributes[f]=h,this.emit("nodeAttributesUpdated",{key:u.key,type:"set",attributes:u.attributes,name:f}),this}}function WM(e,t,n){e.prototype[t]=function(a,o,s,c){const[u,f,h]=sa(this,t,n,a,o,s,c);if(typeof h!="function")throw new ke(`Graph.${t}: updater should be a function.`);const m=u.attributes,g=h(m[f]);return m[f]=g,this.emit("nodeAttributesUpdated",{key:u.key,type:"set",attributes:u.attributes,name:f}),this}}function XM(e,t,n){e.prototype[t]=function(a,o,s){const[c,u]=sa(this,t,n,a,o,s);return delete c.attributes[u],this.emit("nodeAttributesUpdated",{key:c.key,type:"remove",attributes:c.attributes,name:u}),this}}function KM(e,t,n){e.prototype[t]=function(a,o,s){const[c,u]=sa(this,t,n,a,o,s);if(!Qt(u))throw new ke(`Graph.${t}: provided attributes are not a plain object.`);return c.attributes=u,this.emit("nodeAttributesUpdated",{key:c.key,type:"replace",attributes:c.attributes}),this}}function ZM(e,t,n){e.prototype[t]=function(a,o,s){const[c,u]=sa(this,t,n,a,o,s);if(!Qt(u))throw new ke(`Graph.${t}: provided attributes are not a plain object.`);return Pt(c.attributes,u),this.emit("nodeAttributesUpdated",{key:c.key,type:"merge",attributes:c.attributes,data:u}),this}}function QM(e,t,n){e.prototype[t]=function(a,o,s){const[c,u]=sa(this,t,n,a,o,s);if(typeof u!="function")throw new ke(`Graph.${t}: provided updater is not a function.`);return c.attributes=u(c.attributes),this.emit("nodeAttributesUpdated",{key:c.key,type:"update",attributes:c.attributes}),this}}const JM=[{name:e=>`get${e}Attribute`,attacher:$M},{name:e=>`get${e}Attributes`,attacher:VM},{name:e=>`has${e}Attribute`,attacher:qM},{name:e=>`set${e}Attribute`,attacher:YM},{name:e=>`update${e}Attribute`,attacher:WM},{name:e=>`remove${e}Attribute`,attacher:XM},{name:e=>`replace${e}Attributes`,attacher:KM},{name:e=>`merge${e}Attributes`,attacher:ZM},{name:e=>`update${e}Attributes`,attacher:QM}];function eP(e){JM.forEach(function({name:t,attacher:n}){n(e,t("Node"),u_),n(e,t("Source"),d_),n(e,t("Target"),HM),n(e,t("Opposite"),f_)})}function tP(e,t,n){e.prototype[t]=function(a,o){let s;if(this.type!=="mixed"&&n!=="mixed"&&n!==this.type)throw new $e(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new $e(`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 c=""+a,u=""+o;if(o=arguments[2],s=Xn(this,c,u,n),!s)throw new Re(`Graph.${t}: could not find an edge for the given path ("${c}" - "${u}").`)}else{if(n!=="mixed")throw new $e(`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(a=""+a,s=this._edges.get(a),!s)throw new Re(`Graph.${t}: could not find the "${a}" edge in the graph.`)}return s.attributes[o]}}function nP(e,t,n){e.prototype[t]=function(a){let o;if(this.type!=="mixed"&&n!=="mixed"&&n!==this.type)throw new $e(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>1){if(this.multi)throw new $e(`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 s=""+a,c=""+arguments[1];if(o=Xn(this,s,c,n),!o)throw new Re(`Graph.${t}: could not find an edge for the given path ("${s}" - "${c}").`)}else{if(n!=="mixed")throw new $e(`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(a=""+a,o=this._edges.get(a),!o)throw new Re(`Graph.${t}: could not find the "${a}" edge in the graph.`)}return o.attributes}}function rP(e,t,n){e.prototype[t]=function(a,o){let s;if(this.type!=="mixed"&&n!=="mixed"&&n!==this.type)throw new $e(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new $e(`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 c=""+a,u=""+o;if(o=arguments[2],s=Xn(this,c,u,n),!s)throw new Re(`Graph.${t}: could not find an edge for the given path ("${c}" - "${u}").`)}else{if(n!=="mixed")throw new $e(`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(a=""+a,s=this._edges.get(a),!s)throw new Re(`Graph.${t}: could not find the "${a}" edge in the graph.`)}return s.attributes.hasOwnProperty(o)}}function aP(e,t,n){e.prototype[t]=function(a,o,s){let c;if(this.type!=="mixed"&&n!=="mixed"&&n!==this.type)throw new $e(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>3){if(this.multi)throw new $e(`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=""+a,f=""+o;if(o=arguments[2],s=arguments[3],c=Xn(this,u,f,n),!c)throw new Re(`Graph.${t}: could not find an edge for the given path ("${u}" - "${f}").`)}else{if(n!=="mixed")throw new $e(`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(a=""+a,c=this._edges.get(a),!c)throw new Re(`Graph.${t}: could not find the "${a}" edge in the graph.`)}return c.attributes[o]=s,this.emit("edgeAttributesUpdated",{key:c.key,type:"set",attributes:c.attributes,name:o}),this}}function iP(e,t,n){e.prototype[t]=function(a,o,s){let c;if(this.type!=="mixed"&&n!=="mixed"&&n!==this.type)throw new $e(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>3){if(this.multi)throw new $e(`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=""+a,f=""+o;if(o=arguments[2],s=arguments[3],c=Xn(this,u,f,n),!c)throw new Re(`Graph.${t}: could not find an edge for the given path ("${u}" - "${f}").`)}else{if(n!=="mixed")throw new $e(`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(a=""+a,c=this._edges.get(a),!c)throw new Re(`Graph.${t}: could not find the "${a}" edge in the graph.`)}if(typeof s!="function")throw new ke(`Graph.${t}: updater should be a function.`);return c.attributes[o]=s(c.attributes[o]),this.emit("edgeAttributesUpdated",{key:c.key,type:"set",attributes:c.attributes,name:o}),this}}function oP(e,t,n){e.prototype[t]=function(a,o){let s;if(this.type!=="mixed"&&n!=="mixed"&&n!==this.type)throw new $e(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new $e(`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 c=""+a,u=""+o;if(o=arguments[2],s=Xn(this,c,u,n),!s)throw new Re(`Graph.${t}: could not find an edge for the given path ("${c}" - "${u}").`)}else{if(n!=="mixed")throw new $e(`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(a=""+a,s=this._edges.get(a),!s)throw new Re(`Graph.${t}: could not find the "${a}" edge in the graph.`)}return delete s.attributes[o],this.emit("edgeAttributesUpdated",{key:s.key,type:"remove",attributes:s.attributes,name:o}),this}}function sP(e,t,n){e.prototype[t]=function(a,o){let s;if(this.type!=="mixed"&&n!=="mixed"&&n!==this.type)throw new $e(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new $e(`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 c=""+a,u=""+o;if(o=arguments[2],s=Xn(this,c,u,n),!s)throw new Re(`Graph.${t}: could not find an edge for the given path ("${c}" - "${u}").`)}else{if(n!=="mixed")throw new $e(`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(a=""+a,s=this._edges.get(a),!s)throw new Re(`Graph.${t}: could not find the "${a}" edge in the graph.`)}if(!Qt(o))throw new ke(`Graph.${t}: provided attributes are not a plain object.`);return s.attributes=o,this.emit("edgeAttributesUpdated",{key:s.key,type:"replace",attributes:s.attributes}),this}}function lP(e,t,n){e.prototype[t]=function(a,o){let s;if(this.type!=="mixed"&&n!=="mixed"&&n!==this.type)throw new $e(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new $e(`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 c=""+a,u=""+o;if(o=arguments[2],s=Xn(this,c,u,n),!s)throw new Re(`Graph.${t}: could not find an edge for the given path ("${c}" - "${u}").`)}else{if(n!=="mixed")throw new $e(`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(a=""+a,s=this._edges.get(a),!s)throw new Re(`Graph.${t}: could not find the "${a}" edge in the graph.`)}if(!Qt(o))throw new ke(`Graph.${t}: provided attributes are not a plain object.`);return Pt(s.attributes,o),this.emit("edgeAttributesUpdated",{key:s.key,type:"merge",attributes:s.attributes,data:o}),this}}function cP(e,t,n){e.prototype[t]=function(a,o){let s;if(this.type!=="mixed"&&n!=="mixed"&&n!==this.type)throw new $e(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new $e(`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 c=""+a,u=""+o;if(o=arguments[2],s=Xn(this,c,u,n),!s)throw new Re(`Graph.${t}: could not find an edge for the given path ("${c}" - "${u}").`)}else{if(n!=="mixed")throw new $e(`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(a=""+a,s=this._edges.get(a),!s)throw new Re(`Graph.${t}: could not find the "${a}" edge in the graph.`)}if(typeof o!="function")throw new ke(`Graph.${t}: provided updater is not a function.`);return s.attributes=o(s.attributes),this.emit("edgeAttributesUpdated",{key:s.key,type:"update",attributes:s.attributes}),this}}const uP=[{name:e=>`get${e}Attribute`,attacher:tP},{name:e=>`get${e}Attributes`,attacher:nP},{name:e=>`has${e}Attribute`,attacher:rP},{name:e=>`set${e}Attribute`,attacher:aP},{name:e=>`update${e}Attribute`,attacher:iP},{name:e=>`remove${e}Attribute`,attacher:oP},{name:e=>`replace${e}Attributes`,attacher:sP},{name:e=>`merge${e}Attributes`,attacher:lP},{name:e=>`update${e}Attributes`,attacher:cP}];function dP(e){uP.forEach(function({name:t,attacher:n}){n(e,t("Edge"),"mixed"),n(e,t("DirectedEdge"),"directed"),n(e,t("UndirectedEdge"),"undirected")})}const fP=[{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 hP(e,t,n,a){let o=!1;for(const s in t){if(s===a)continue;const c=t[s];if(o=n(c.key,c.attributes,c.source.key,c.target.key,c.source.attributes,c.target.attributes,c.undirected),e&&o)return c.key}}function pP(e,t,n,a){let o,s,c,u=!1;for(const f in t)if(f!==a){o=t[f];do{if(s=o.source,c=o.target,u=n(o.key,o.attributes,s.key,c.key,s.attributes,c.attributes,o.undirected),e&&u)return o.key;o=o.next}while(o!==void 0)}}function Jh(e,t){const n=Object.keys(e),a=n.length;let o,s=0;return{[Symbol.iterator](){return this},next(){do if(o)o=o.next;else{if(s>=a)return{done:!0};const c=n[s++];if(c===t){o=void 0;continue}o=e[c]}while(!o);return{done:!1,value:{edge:o.key,attributes:o.attributes,source:o.source.key,target:o.target.key,sourceAttributes:o.source.attributes,targetAttributes:o.target.attributes,undirected:o.undirected}}}}}function mP(e,t,n,a){const o=t[n];if(!o)return;const s=o.source,c=o.target;if(a(o.key,o.attributes,s.key,c.key,s.attributes,c.attributes,o.undirected)&&e)return o.key}function gP(e,t,n,a){let o=t[n];if(!o)return;let s=!1;do{if(s=a(o.key,o.attributes,o.source.key,o.target.key,o.source.attributes,o.target.attributes,o.undirected),e&&s)return o.key;o=o.next}while(o!==void 0)}function ep(e,t){let n=e[t];if(n.next!==void 0)return{[Symbol.iterator](){return this},next(){if(!n)return{done:!0};const o={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:o}}};let a=!1;return{[Symbol.iterator](){return this},next(){return a===!0?{done:!0}:(a=!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 vP(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,a=new Array(n),o=t==="undirected",s=e._edges.values();let c=0,u,f;for(;u=s.next(),u.done!==!0;)f=u.value,f.undirected===o&&(a[c++]=f.key);return a}function h_(e,t,n,a){if(t.size===0)return;const o=n!=="mixed"&&n!==t.type,s=n==="undirected";let c,u,f=!1;const h=t._edges.values();for(;c=h.next(),c.done!==!0;){if(u=c.value,o&&u.undirected!==s)continue;const{key:m,attributes:g,source:y,target:b}=u;if(f=a(m,g,y.key,b.key,y.attributes,b.attributes,u.undirected),e&&f)return m}}function yP(e,t){if(e.size===0)return $o();const n=t!=="mixed"&&t!==e.type,a=t==="undirected",o=e._edges.values();return{[Symbol.iterator](){return this},next(){let s,c;for(;;){if(s=o.next(),s.done)return s;if(c=s.value,!(n&&c.undirected!==a))break}return{value:{edge:c.key,attributes:c.attributes,source:c.source.key,target:c.target.key,sourceAttributes:c.source.attributes,targetAttributes:c.target.attributes,undirected:c.undirected},done:!1}}}}function _g(e,t,n,a,o,s){const c=t?pP:hP;let u;if(n!=="undirected"&&(a!=="out"&&(u=c(e,o.in,s),e&&u)||a!=="in"&&(u=c(e,o.out,s,a?void 0:o.key),e&&u))||n!=="directed"&&(u=c(e,o.undirected,s),e&&u))return u}function bP(e,t,n,a){const o=[];return _g(!1,e,t,n,a,function(s){o.push(s)}),o}function xP(e,t,n){let a=$o();return e!=="undirected"&&(t!=="out"&&typeof n.in<"u"&&(a=ra(a,Jh(n.in))),t!=="in"&&typeof n.out<"u"&&(a=ra(a,Jh(n.out,t?void 0:n.key)))),e!=="directed"&&typeof n.undirected<"u"&&(a=ra(a,Jh(n.undirected))),a}function Tg(e,t,n,a,o,s,c){const u=n?gP:mP;let f;if(t!=="undirected"&&(typeof o.in<"u"&&a!=="out"&&(f=u(e,o.in,s,c),e&&f)||typeof o.out<"u"&&a!=="in"&&(a||o.key!==s)&&(f=u(e,o.out,s,c),e&&f))||t!=="directed"&&typeof o.undirected<"u"&&(f=u(e,o.undirected,s,c),e&&f))return f}function wP(e,t,n,a,o){const s=[];return Tg(!1,e,t,n,a,o,function(c){s.push(c)}),s}function EP(e,t,n,a){let o=$o();return e!=="undirected"&&(typeof n.in<"u"&&t!=="out"&&a in n.in&&(o=ra(o,ep(n.in,a))),typeof n.out<"u"&&t!=="in"&&a in n.out&&(t||n.key!==a)&&(o=ra(o,ep(n.out,a)))),e!=="directed"&&typeof n.undirected<"u"&&a in n.undirected&&(o=ra(o,ep(n.undirected,a))),o}function SP(e,t){const{name:n,type:a,direction:o}=t;e.prototype[n]=function(s,c){if(a!=="mixed"&&this.type!=="mixed"&&a!==this.type)return[];if(!arguments.length)return vP(this,a);if(arguments.length===1){s=""+s;const u=this._nodes.get(s);if(typeof u>"u")throw new Re(`Graph.${n}: could not find the "${s}" node in the graph.`);return bP(this.multi,a==="mixed"?this.type:a,o,u)}if(arguments.length===2){s=""+s,c=""+c;const u=this._nodes.get(s);if(!u)throw new Re(`Graph.${n}: could not find the "${s}" source node in the graph.`);if(!this._nodes.has(c))throw new Re(`Graph.${n}: could not find the "${c}" target node in the graph.`);return wP(a,this.multi,o,u,c)}throw new ke(`Graph.${n}: too many arguments (expecting 0, 1 or 2 and got ${arguments.length}).`)}}function _P(e,t){const{name:n,type:a,direction:o}=t,s="forEach"+n[0].toUpperCase()+n.slice(1,-1);e.prototype[s]=function(h,m,g){if(!(a!=="mixed"&&this.type!=="mixed"&&a!==this.type)){if(arguments.length===1)return g=h,h_(!1,this,a,g);if(arguments.length===2){h=""+h,g=m;const y=this._nodes.get(h);if(typeof y>"u")throw new Re(`Graph.${s}: could not find the "${h}" node in the graph.`);return _g(!1,this.multi,a==="mixed"?this.type:a,o,y,g)}if(arguments.length===3){h=""+h,m=""+m;const y=this._nodes.get(h);if(!y)throw new Re(`Graph.${s}: could not find the "${h}" source node in the graph.`);if(!this._nodes.has(m))throw new Re(`Graph.${s}: could not find the "${m}" target node in the graph.`);return Tg(!1,a,this.multi,o,y,m,g)}throw new ke(`Graph.${s}: too many arguments (expecting 1, 2 or 3 and got ${arguments.length}).`)}};const c="map"+n[0].toUpperCase()+n.slice(1);e.prototype[c]=function(){const h=Array.prototype.slice.call(arguments),m=h.pop();let g;if(h.length===0){let y=0;a!=="directed"&&(y+=this.undirectedSize),a!=="undirected"&&(y+=this.directedSize),g=new Array(y);let b=0;h.push((S,E,_,N,T,A,D)=>{g[b++]=m(S,E,_,N,T,A,D)})}else g=[],h.push((y,b,S,E,_,N,T)=>{g.push(m(y,b,S,E,_,N,T))});return this[s].apply(this,h),g};const u="filter"+n[0].toUpperCase()+n.slice(1);e.prototype[u]=function(){const h=Array.prototype.slice.call(arguments),m=h.pop(),g=[];return h.push((y,b,S,E,_,N,T)=>{m(y,b,S,E,_,N,T)&&g.push(y)}),this[s].apply(this,h),g};const f="reduce"+n[0].toUpperCase()+n.slice(1);e.prototype[f]=function(){let h=Array.prototype.slice.call(arguments);if(h.length<2||h.length>4)throw new ke(`Graph.${f}: invalid number of arguments (expecting 2, 3 or 4 and got ${h.length}).`);if(typeof h[h.length-1]=="function"&&typeof h[h.length-2]!="function")throw new ke(`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 m,g;h.length===2?(m=h[0],g=h[1],h=[]):h.length===3?(m=h[1],g=h[2],h=[h[0]]):h.length===4&&(m=h[2],g=h[3],h=[h[0],h[1]]);let y=g;return h.push((b,S,E,_,N,T,A)=>{y=m(y,b,S,E,_,N,T,A)}),this[s].apply(this,h),y}}function TP(e,t){const{name:n,type:a,direction:o}=t,s="find"+n[0].toUpperCase()+n.slice(1,-1);e.prototype[s]=function(f,h,m){if(a!=="mixed"&&this.type!=="mixed"&&a!==this.type)return!1;if(arguments.length===1)return m=f,h_(!0,this,a,m);if(arguments.length===2){f=""+f,m=h;const g=this._nodes.get(f);if(typeof g>"u")throw new Re(`Graph.${s}: could not find the "${f}" node in the graph.`);return _g(!0,this.multi,a==="mixed"?this.type:a,o,g,m)}if(arguments.length===3){f=""+f,h=""+h;const g=this._nodes.get(f);if(!g)throw new Re(`Graph.${s}: could not find the "${f}" source node in the graph.`);if(!this._nodes.has(h))throw new Re(`Graph.${s}: could not find the "${h}" target node in the graph.`);return Tg(!0,a,this.multi,o,g,h,m)}throw new ke(`Graph.${s}: too many arguments (expecting 1, 2 or 3 and got ${arguments.length}).`)};const c="some"+n[0].toUpperCase()+n.slice(1,-1);e.prototype[c]=function(){const f=Array.prototype.slice.call(arguments),h=f.pop();return f.push((g,y,b,S,E,_,N)=>h(g,y,b,S,E,_,N)),!!this[s].apply(this,f)};const u="every"+n[0].toUpperCase()+n.slice(1,-1);e.prototype[u]=function(){const f=Array.prototype.slice.call(arguments),h=f.pop();return f.push((g,y,b,S,E,_,N)=>!h(g,y,b,S,E,_,N)),!this[s].apply(this,f)}}function CP(e,t){const{name:n,type:a,direction:o}=t,s=n.slice(0,-1)+"Entries";e.prototype[s]=function(c,u){if(a!=="mixed"&&this.type!=="mixed"&&a!==this.type)return $o();if(!arguments.length)return yP(this,a);if(arguments.length===1){c=""+c;const f=this._nodes.get(c);if(!f)throw new Re(`Graph.${s}: could not find the "${c}" node in the graph.`);return xP(a,o,f)}if(arguments.length===2){c=""+c,u=""+u;const f=this._nodes.get(c);if(!f)throw new Re(`Graph.${s}: could not find the "${c}" source node in the graph.`);if(!this._nodes.has(u))throw new Re(`Graph.${s}: could not find the "${u}" target node in the graph.`);return EP(a,o,f,u)}throw new ke(`Graph.${s}: too many arguments (expecting 0, 1 or 2 and got ${arguments.length}).`)}}function RP(e){fP.forEach(t=>{SP(e,t),_P(e,t),TP(e,t),CP(e,t)})}const AP=[{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 hd(){this.A=null,this.B=null}hd.prototype.wrap=function(e){this.A===null?this.A=e:this.B===null&&(this.B=e)};hd.prototype.has=function(e){return this.A!==null&&e in this.A||this.B!==null&&e in this.B};function Ys(e,t,n,a,o){for(const s in a){const c=a[s],u=c.source,f=c.target,h=u===n?f:u;if(t&&t.has(h.key))continue;const m=o(h.key,h.attributes);if(e&&m)return h.key}}function Cg(e,t,n,a,o){if(t!=="mixed"){if(t==="undirected")return Ys(e,null,a,a.undirected,o);if(typeof n=="string")return Ys(e,null,a,a[n],o)}const s=new hd;let c;if(t!=="undirected"){if(n!=="out"){if(c=Ys(e,null,a,a.in,o),e&&c)return c;s.wrap(a.in)}if(n!=="in"){if(c=Ys(e,s,a,a.out,o),e&&c)return c;s.wrap(a.out)}}if(t!=="directed"&&(c=Ys(e,s,a,a.undirected,o),e&&c))return c}function kP(e,t,n){if(e!=="mixed"){if(e==="undirected")return Object.keys(n.undirected);if(typeof t=="string")return Object.keys(n[t])}const a=[];return Cg(!1,e,t,n,function(o){a.push(o)}),a}function Ws(e,t,n){const a=Object.keys(n),o=a.length;let s=0;return{[Symbol.iterator](){return this},next(){let c=null;do{if(s>=o)return e&&e.wrap(n),{done:!0};const u=n[a[s++]],f=u.source,h=u.target;if(c=f===t?h:f,e&&e.has(c.key)){c=null;continue}}while(c===null);return{done:!1,value:{neighbor:c.key,attributes:c.attributes}}}}}function DP(e,t,n){if(e!=="mixed"){if(e==="undirected")return Ws(null,n,n.undirected);if(typeof t=="string")return Ws(null,n,n[t])}let a=$o();const o=new hd;return e!=="undirected"&&(t!=="out"&&(a=ra(a,Ws(o,n,n.in))),t!=="in"&&(a=ra(a,Ws(o,n,n.out)))),e!=="directed"&&(a=ra(a,Ws(o,n,n.undirected))),a}function NP(e,t){const{name:n,type:a,direction:o}=t;e.prototype[n]=function(s){if(a!=="mixed"&&this.type!=="mixed"&&a!==this.type)return[];s=""+s;const c=this._nodes.get(s);if(typeof c>"u")throw new Re(`Graph.${n}: could not find the "${s}" node in the graph.`);return kP(a==="mixed"?this.type:a,o,c)}}function OP(e,t){const{name:n,type:a,direction:o}=t,s="forEach"+n[0].toUpperCase()+n.slice(1,-1);e.prototype[s]=function(h,m){if(a!=="mixed"&&this.type!=="mixed"&&a!==this.type)return;h=""+h;const g=this._nodes.get(h);if(typeof g>"u")throw new Re(`Graph.${s}: could not find the "${h}" node in the graph.`);Cg(!1,a==="mixed"?this.type:a,o,g,m)};const c="map"+n[0].toUpperCase()+n.slice(1);e.prototype[c]=function(h,m){const g=[];return this[s](h,(y,b)=>{g.push(m(y,b))}),g};const u="filter"+n[0].toUpperCase()+n.slice(1);e.prototype[u]=function(h,m){const g=[];return this[s](h,(y,b)=>{m(y,b)&&g.push(y)}),g};const f="reduce"+n[0].toUpperCase()+n.slice(1);e.prototype[f]=function(h,m,g){if(arguments.length<3)throw new ke(`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 y=g;return this[s](h,(b,S)=>{y=m(y,b,S)}),y}}function jP(e,t){const{name:n,type:a,direction:o}=t,s=n[0].toUpperCase()+n.slice(1,-1),c="find"+s;e.prototype[c]=function(h,m){if(a!=="mixed"&&this.type!=="mixed"&&a!==this.type)return;h=""+h;const g=this._nodes.get(h);if(typeof g>"u")throw new Re(`Graph.${c}: could not find the "${h}" node in the graph.`);return Cg(!0,a==="mixed"?this.type:a,o,g,m)};const u="some"+s;e.prototype[u]=function(h,m){return!!this[c](h,m)};const f="every"+s;e.prototype[f]=function(h,m){return!this[c](h,(y,b)=>!m(y,b))}}function LP(e,t){const{name:n,type:a,direction:o}=t,s=n.slice(0,-1)+"Entries";e.prototype[s]=function(c){if(a!=="mixed"&&this.type!=="mixed"&&a!==this.type)return $o();c=""+c;const u=this._nodes.get(c);if(typeof u>"u")throw new Re(`Graph.${s}: could not find the "${c}" node in the graph.`);return DP(a==="mixed"?this.type:a,o,u)}}function zP(e){AP.forEach(t=>{NP(e,t),OP(e,t),jP(e,t),LP(e,t)})}function Wc(e,t,n,a,o){const s=a._nodes.values(),c=a.type;let u,f,h,m,g,y;for(;u=s.next(),u.done!==!0;){let b=!1;if(f=u.value,c!=="undirected"){m=f.out;for(h in m){g=m[h];do y=g.target,b=!0,o(f.key,y.key,f.attributes,y.attributes,g.key,g.attributes,g.undirected),g=g.next;while(g)}}if(c!=="directed"){m=f.undirected;for(h in m)if(!(t&&f.key>h)){g=m[h];do y=g.target,y.key!==h&&(y=g.source),b=!0,o(f.key,y.key,f.attributes,y.attributes,g.key,g.attributes,g.undirected),g=g.next;while(g)}}n&&!b&&o(f.key,null,f.attributes,null,null,null,null)}}function MP(e,t){const n={key:e};return o_(t.attributes)||(n.attributes=Pt({},t.attributes)),n}function PP(e,t,n){const a={key:t,source:n.source.key,target:n.target.key};return o_(n.attributes)||(a.attributes=Pt({},n.attributes)),e==="mixed"&&n.undirected&&(a.undirected=!0),a}function GP(e){if(!Qt(e))throw new ke('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 ke("Graph.import: serialized node is missing its key.");if("attributes"in e&&(!Qt(e.attributes)||e.attributes===null))throw new ke("Graph.import: invalid attributes. Attributes should be a plain object, null or omitted.")}function FP(e){if(!Qt(e))throw new ke('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 ke("Graph.import: serialized edge is missing its source.");if(!("target"in e))throw new ke("Graph.import: serialized edge is missing its target.");if("attributes"in e&&(!Qt(e.attributes)||e.attributes===null))throw new ke("Graph.import: invalid attributes. Attributes should be a plain object, null or omitted.");if("undirected"in e&&typeof e.undirected!="boolean")throw new ke("Graph.import: invalid undirectedness information. Undirected should be boolean or omitted.")}const UP=IM(),BP=new Set(["directed","undirected","mixed"]),I0=new Set(["domain","_events","_eventsCount","_maxListeners"]),IP=[{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"}],HP={allowSelfLoops:!0,multi:!1,type:"mixed"};function $P(e,t,n){if(n&&!Qt(n))throw new ke(`Graph.addNode: invalid attributes. Expecting an object but got "${n}"`);if(t=""+t,n=n||{},e._nodes.has(t))throw new $e(`Graph.addNode: the "${t}" node already exist in the graph.`);const a=new e.NodeDataClass(t,n);return e._nodes.set(t,a),e.emit("nodeAdded",{key:t,attributes:n}),a}function H0(e,t,n){const a=new e.NodeDataClass(t,n);return e._nodes.set(t,a),e.emit("nodeAdded",{key:t,attributes:n}),a}function p_(e,t,n,a,o,s,c,u){if(!a&&e.type==="undirected")throw new $e(`Graph.${t}: you cannot add a directed edge to an undirected graph. Use the #.addEdge or #.addUndirectedEdge instead.`);if(a&&e.type==="directed")throw new $e(`Graph.${t}: you cannot add an undirected edge to a directed graph. Use the #.addEdge or #.addDirectedEdge instead.`);if(u&&!Qt(u))throw new ke(`Graph.${t}: invalid attributes. Expecting an object but got "${u}"`);if(s=""+s,c=""+c,u=u||{},!e.allowSelfLoops&&s===c)throw new $e(`Graph.${t}: source & target are the same ("${s}"), thus creating a loop explicitly forbidden by this graph 'allowSelfLoops' option set to false.`);const f=e._nodes.get(s),h=e._nodes.get(c);if(!f)throw new Re(`Graph.${t}: source node "${s}" not found.`);if(!h)throw new Re(`Graph.${t}: target node "${c}" not found.`);const m={key:null,undirected:a,source:s,target:c,attributes:u};if(n)o=e._edgeKeyGenerator();else if(o=""+o,e._edges.has(o))throw new $e(`Graph.${t}: the "${o}" edge already exists in the graph.`);if(!e.multi&&(a?typeof f.undirected[c]<"u":typeof f.out[c]<"u"))throw new $e(`Graph.${t}: an edge linking "${s}" to "${c}" 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 g=new Vo(a,o,f,h,u);e._edges.set(o,g);const y=s===c;return a?(f.undirectedDegree++,h.undirectedDegree++,y&&(f.undirectedLoops++,e._undirectedSelfLoopCount++)):(f.outDegree++,h.inDegree++,y&&(f.directedLoops++,e._directedSelfLoopCount++)),e.multi?g.attachMulti():g.attach(),a?e._undirectedSize++:e._directedSize++,m.key=o,e.emit("edgeAdded",m),o}function VP(e,t,n,a,o,s,c,u,f){if(!a&&e.type==="undirected")throw new $e(`Graph.${t}: you cannot merge/update a directed edge to an undirected graph. Use the #.mergeEdge/#.updateEdge or #.addUndirectedEdge instead.`);if(a&&e.type==="directed")throw new $e(`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 ke(`Graph.${t}: invalid updater function. Expecting a function but got "${u}"`)}else if(!Qt(u))throw new ke(`Graph.${t}: invalid attributes. Expecting an object but got "${u}"`)}s=""+s,c=""+c;let h;if(f&&(h=u,u=void 0),!e.allowSelfLoops&&s===c)throw new $e(`Graph.${t}: source & target are the same ("${s}"), thus creating a loop explicitly forbidden by this graph 'allowSelfLoops' option set to false.`);let m=e._nodes.get(s),g=e._nodes.get(c),y,b;if(!n&&(y=e._edges.get(o),y)){if((y.source.key!==s||y.target.key!==c)&&(!a||y.source.key!==c||y.target.key!==s))throw new $e(`Graph.${t}: inconsistency detected when attempting to merge the "${o}" edge with "${s}" source & "${c}" target vs. ("${y.source.key}", "${y.target.key}").`);b=y}if(!b&&!e.multi&&m&&(b=a?m.undirected[c]:m.out[c]),b){const T=[b.key,!1,!1,!1];if(f?!h:!u)return T;if(f){const A=b.attributes;b.attributes=h(A),e.emit("edgeAttributesUpdated",{type:"replace",key:b.key,attributes:b.attributes})}else Pt(b.attributes,u),e.emit("edgeAttributesUpdated",{type:"merge",key:b.key,attributes:b.attributes,data:u});return T}u=u||{},f&&h&&(u=h(u));const S={key:null,undirected:a,source:s,target:c,attributes:u};if(n)o=e._edgeKeyGenerator();else if(o=""+o,e._edges.has(o))throw new $e(`Graph.${t}: the "${o}" edge already exists in the graph.`);let E=!1,_=!1;m||(m=H0(e,s,{}),E=!0,s===c&&(g=m,_=!0)),g||(g=H0(e,c,{}),_=!0),y=new Vo(a,o,m,g,u),e._edges.set(o,y);const N=s===c;return a?(m.undirectedDegree++,g.undirectedDegree++,N&&(m.undirectedLoops++,e._undirectedSelfLoopCount++)):(m.outDegree++,g.inDegree++,N&&(m.directedLoops++,e._directedSelfLoopCount++)),e.multi?y.attachMulti():y.attach(),a?e._undirectedSize++:e._directedSize++,S.key=o,e.emit("edgeAdded",S),[o,!0,E,_]}function xo(e,t){e._edges.delete(t.key);const{source:n,target:a,attributes:o}=t,s=t.undirected,c=n===a;s?(n.undirectedDegree--,a.undirectedDegree--,c&&(n.undirectedLoops--,e._undirectedSelfLoopCount--)):(n.outDegree--,a.inDegree--,c&&(n.directedLoops--,e._directedSelfLoopCount--)),e.multi?t.detachMulti():t.detach(),s?e._undirectedSize--:e._directedSize--,e.emit("edgeDropped",{key:t.key,attributes:o,source:n.key,target:a.key,undirected:s})}class ft extends i_.EventEmitter{constructor(t){if(super(),t=Pt({},HP,t),typeof t.multi!="boolean")throw new ke(`Graph.constructor: invalid 'multi' option. Expecting a boolean but got "${t.multi}".`);if(!BP.has(t.type))throw new ke(`Graph.constructor: invalid 'type' option. Should be one of "mixed", "directed" or "undirected" but got "${t.type}".`);if(typeof t.allowSelfLoops!="boolean")throw new ke(`Graph.constructor: invalid 'allowSelfLoops' option. Expecting a boolean but got "${t.allowSelfLoops}".`);const n=t.type==="mixed"?s_:t.type==="directed"?l_:c_;Yn(this,"NodeDataClass",n);const a="geid_"+UP()+"_";let o=0;const s=()=>{let c;do c=a+o++;while(this._edges.has(c));return c};Yn(this,"_attributes",{}),Yn(this,"_nodes",new Map),Yn(this,"_edges",new Map),Yn(this,"_directedSize",0),Yn(this,"_undirectedSize",0),Yn(this,"_directedSelfLoopCount",0),Yn(this,"_undirectedSelfLoopCount",0),Yn(this,"_edgeKeyGenerator",s),Yn(this,"_options",t),I0.forEach(c=>Yn(this,c,this[c])),ar(this,"order",()=>this._nodes.size),ar(this,"size",()=>this._edges.size),ar(this,"directedSize",()=>this._directedSize),ar(this,"undirectedSize",()=>this._undirectedSize),ar(this,"selfLoopCount",()=>this._directedSelfLoopCount+this._undirectedSelfLoopCount),ar(this,"directedSelfLoopCount",()=>this._directedSelfLoopCount),ar(this,"undirectedSelfLoopCount",()=>this._undirectedSelfLoopCount),ar(this,"multi",this._options.multi),ar(this,"type",this._options.type),ar(this,"allowSelfLoops",this._options.allowSelfLoops),ar(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 a=""+t,o=this._edges.get(a);return!!o&&!o.undirected}else if(arguments.length===2){t=""+t,n=""+n;const a=this._nodes.get(t);return a?a.out.hasOwnProperty(n):!1}throw new ke(`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 a=""+t,o=this._edges.get(a);return!!o&&o.undirected}else if(arguments.length===2){t=""+t,n=""+n;const a=this._nodes.get(t);return a?a.undirected.hasOwnProperty(n):!1}throw new ke(`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 a=""+t;return this._edges.has(a)}else if(arguments.length===2){t=""+t,n=""+n;const a=this._nodes.get(t);return a?typeof a.out<"u"&&a.out.hasOwnProperty(n)||typeof a.undirected<"u"&&a.undirected.hasOwnProperty(n):!1}throw new ke(`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 $e("Graph.directedEdge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.directedEdges instead.");const a=this._nodes.get(t);if(!a)throw new Re(`Graph.directedEdge: could not find the "${t}" source node in the graph.`);if(!this._nodes.has(n))throw new Re(`Graph.directedEdge: could not find the "${n}" target node in the graph.`);const o=a.out&&a.out[n]||void 0;if(o)return o.key}undirectedEdge(t,n){if(this.type==="directed")return;if(t=""+t,n=""+n,this.multi)throw new $e("Graph.undirectedEdge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.undirectedEdges instead.");const a=this._nodes.get(t);if(!a)throw new Re(`Graph.undirectedEdge: could not find the "${t}" source node in the graph.`);if(!this._nodes.has(n))throw new Re(`Graph.undirectedEdge: could not find the "${n}" target node in the graph.`);const o=a.undirected&&a.undirected[n]||void 0;if(o)return o.key}edge(t,n){if(this.multi)throw new $e("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 a=this._nodes.get(t);if(!a)throw new Re(`Graph.edge: could not find the "${t}" source node in the graph.`);if(!this._nodes.has(n))throw new Re(`Graph.edge: could not find the "${n}" target node in the graph.`);const o=a.out&&a.out[n]||a.undirected&&a.undirected[n]||void 0;if(o)return o.key}areDirectedNeighbors(t,n){t=""+t,n=""+n;const a=this._nodes.get(t);if(!a)throw new Re(`Graph.areDirectedNeighbors: could not find the "${t}" node in the graph.`);return this.type==="undirected"?!1:n in a.in||n in a.out}areOutNeighbors(t,n){t=""+t,n=""+n;const a=this._nodes.get(t);if(!a)throw new Re(`Graph.areOutNeighbors: could not find the "${t}" node in the graph.`);return this.type==="undirected"?!1:n in a.out}areInNeighbors(t,n){t=""+t,n=""+n;const a=this._nodes.get(t);if(!a)throw new Re(`Graph.areInNeighbors: could not find the "${t}" node in the graph.`);return this.type==="undirected"?!1:n in a.in}areUndirectedNeighbors(t,n){t=""+t,n=""+n;const a=this._nodes.get(t);if(!a)throw new Re(`Graph.areUndirectedNeighbors: could not find the "${t}" node in the graph.`);return this.type==="directed"?!1:n in a.undirected}areNeighbors(t,n){t=""+t,n=""+n;const a=this._nodes.get(t);if(!a)throw new Re(`Graph.areNeighbors: could not find the "${t}" node in the graph.`);return this.type!=="undirected"&&(n in a.in||n in a.out)||this.type!=="directed"&&n in a.undirected}areInboundNeighbors(t,n){t=""+t,n=""+n;const a=this._nodes.get(t);if(!a)throw new Re(`Graph.areInboundNeighbors: could not find the "${t}" node in the graph.`);return this.type!=="undirected"&&n in a.in||this.type!=="directed"&&n in a.undirected}areOutboundNeighbors(t,n){t=""+t,n=""+n;const a=this._nodes.get(t);if(!a)throw new Re(`Graph.areOutboundNeighbors: could not find the "${t}" node in the graph.`);return this.type!=="undirected"&&n in a.out||this.type!=="directed"&&n in a.undirected}inDegree(t){t=""+t;const n=this._nodes.get(t);if(!n)throw new Re(`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 Re(`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 Re(`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 Re(`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 Re(`Graph.inboundDegree: could not find the "${t}" node in the graph.`);let a=0;return this.type!=="directed"&&(a+=n.undirectedDegree),this.type!=="undirected"&&(a+=n.inDegree),a}outboundDegree(t){t=""+t;const n=this._nodes.get(t);if(!n)throw new Re(`Graph.outboundDegree: could not find the "${t}" node in the graph.`);let a=0;return this.type!=="directed"&&(a+=n.undirectedDegree),this.type!=="undirected"&&(a+=n.outDegree),a}degree(t){t=""+t;const n=this._nodes.get(t);if(!n)throw new Re(`Graph.degree: could not find the "${t}" node in the graph.`);let a=0;return this.type!=="directed"&&(a+=n.undirectedDegree),this.type!=="undirected"&&(a+=n.inDegree+n.outDegree),a}inDegreeWithoutSelfLoops(t){t=""+t;const n=this._nodes.get(t);if(!n)throw new Re(`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 Re(`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 Re(`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 Re(`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 Re(`Graph.inboundDegreeWithoutSelfLoops: could not find the "${t}" node in the graph.`);let a=0,o=0;return this.type!=="directed"&&(a+=n.undirectedDegree,o+=n.undirectedLoops*2),this.type!=="undirected"&&(a+=n.inDegree,o+=n.directedLoops),a-o}outboundDegreeWithoutSelfLoops(t){t=""+t;const n=this._nodes.get(t);if(!n)throw new Re(`Graph.outboundDegreeWithoutSelfLoops: could not find the "${t}" node in the graph.`);let a=0,o=0;return this.type!=="directed"&&(a+=n.undirectedDegree,o+=n.undirectedLoops*2),this.type!=="undirected"&&(a+=n.outDegree,o+=n.directedLoops),a-o}degreeWithoutSelfLoops(t){t=""+t;const n=this._nodes.get(t);if(!n)throw new Re(`Graph.degreeWithoutSelfLoops: could not find the "${t}" node in the graph.`);let a=0,o=0;return this.type!=="directed"&&(a+=n.undirectedDegree,o+=n.undirectedLoops*2),this.type!=="undirected"&&(a+=n.inDegree+n.outDegree,o+=n.directedLoops*2),a-o}source(t){t=""+t;const n=this._edges.get(t);if(!n)throw new Re(`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 Re(`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 Re(`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 a=this._edges.get(n);if(!a)throw new Re(`Graph.opposite: could not find the "${n}" edge in the graph.`);const o=a.source.key,s=a.target.key;if(t===o)return s;if(t===s)return o;throw new Re(`Graph.opposite: the "${t}" node is not attached to the "${n}" edge (${o}, ${s}).`)}hasExtremity(t,n){t=""+t,n=""+n;const a=this._edges.get(t);if(!a)throw new Re(`Graph.hasExtremity: could not find the "${t}" edge in the graph.`);return a.source.key===n||a.target.key===n}isUndirected(t){t=""+t;const n=this._edges.get(t);if(!n)throw new Re(`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 Re(`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 Re(`Graph.isSelfLoop: could not find the "${t}" edge in the graph.`);return n.source===n.target}addNode(t,n){return $P(this,t,n).key}mergeNode(t,n){if(n&&!Qt(n))throw new ke(`Graph.mergeNode: invalid attributes. Expecting an object but got "${n}"`);t=""+t,n=n||{};let a=this._nodes.get(t);return a?(n&&(Pt(a.attributes,n),this.emit("nodeAttributesUpdated",{type:"merge",key:t,attributes:a.attributes,data:n})),[t,!1]):(a=new this.NodeDataClass(t,n),this._nodes.set(t,a),this.emit("nodeAdded",{key:t,attributes:n}),[t,!0])}updateNode(t,n){if(n&&typeof n!="function")throw new ke(`Graph.updateNode: invalid updater function. Expecting a function but got "${n}"`);t=""+t;let a=this._nodes.get(t);if(a){if(n){const s=a.attributes;a.attributes=n(s),this.emit("nodeAttributesUpdated",{type:"replace",key:t,attributes:a.attributes})}return[t,!1]}const o=n?n({}):{};return a=new this.NodeDataClass(t,o),this._nodes.set(t,a),this.emit("nodeAdded",{key:t,attributes:o}),[t,!0]}dropNode(t){t=""+t;const n=this._nodes.get(t);if(!n)throw new Re(`Graph.dropNode: could not find the "${t}" node in the graph.`);let a;if(this.type!=="undirected"){for(const o in n.out){a=n.out[o];do xo(this,a),a=a.next;while(a)}for(const o in n.in){a=n.in[o];do xo(this,a),a=a.next;while(a)}}if(this.type!=="directed")for(const o in n.undirected){a=n.undirected[o];do xo(this,a),a=a.next;while(a)}this._nodes.delete(t),this.emit("nodeDropped",{key:t,attributes:n.attributes})}dropEdge(t){let n;if(arguments.length>1){const a=""+arguments[0],o=""+arguments[1];if(n=Xn(this,a,o,this.type),!n)throw new Re(`Graph.dropEdge: could not find the "${a}" -> "${o}" edge in the graph.`)}else if(t=""+t,n=this._edges.get(t),!n)throw new Re(`Graph.dropEdge: could not find the "${t}" edge in the graph.`);return xo(this,n),this}dropDirectedEdge(t,n){if(arguments.length<2)throw new $e("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 $e("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 a=Xn(this,t,n,"directed");if(!a)throw new Re(`Graph.dropDirectedEdge: could not find a "${t}" -> "${n}" edge in the graph.`);return xo(this,a),this}dropUndirectedEdge(t,n){if(arguments.length<2)throw new $e("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 $e("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 a=Xn(this,t,n,"undirected");if(!a)throw new Re(`Graph.dropUndirectedEdge: could not find a "${t}" -> "${n}" edge in the graph.`);return xo(this,a),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 ke("Graph.updateAttribute: updater should be a function.");const a=this._attributes[t];return this._attributes[t]=n(a),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(!Qt(t))throw new ke("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(!Qt(t))throw new ke("Graph.mergeAttributes: provided attributes are not a plain object.");return Pt(this._attributes,t),this.emit("attributesUpdated",{type:"merge",attributes:this._attributes,data:t}),this}updateAttributes(t){if(typeof t!="function")throw new ke("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 ke("Graph.updateEachNodeAttributes: expecting an updater function.");if(n&&!B0(n))throw new ke("Graph.updateEachNodeAttributes: invalid hints. Expecting an object having the following shape: {attributes?: [string]}");const a=this._nodes.values();let o,s;for(;o=a.next(),o.done!==!0;)s=o.value,s.attributes=t(s.key,s.attributes);this.emit("eachNodeAttributesUpdated",{hints:n||null})}updateEachEdgeAttributes(t,n){if(typeof t!="function")throw new ke("Graph.updateEachEdgeAttributes: expecting an updater function.");if(n&&!B0(n))throw new ke("Graph.updateEachEdgeAttributes: invalid hints. Expecting an object having the following shape: {attributes?: [string]}");const a=this._edges.values();let o,s,c,u;for(;o=a.next(),o.done!==!0;)s=o.value,c=s.source,u=s.target,s.attributes=t(s.key,s.attributes,c.key,u.key,c.attributes,u.attributes,s.undirected);this.emit("eachEdgeAttributesUpdated",{hints:n||null})}forEachAdjacencyEntry(t){if(typeof t!="function")throw new ke("Graph.forEachAdjacencyEntry: expecting a callback.");Wc(!1,!1,!1,this,t)}forEachAdjacencyEntryWithOrphans(t){if(typeof t!="function")throw new ke("Graph.forEachAdjacencyEntryWithOrphans: expecting a callback.");Wc(!1,!1,!0,this,t)}forEachAssymetricAdjacencyEntry(t){if(typeof t!="function")throw new ke("Graph.forEachAssymetricAdjacencyEntry: expecting a callback.");Wc(!1,!0,!1,this,t)}forEachAssymetricAdjacencyEntryWithOrphans(t){if(typeof t!="function")throw new ke("Graph.forEachAssymetricAdjacencyEntryWithOrphans: expecting a callback.");Wc(!1,!0,!0,this,t)}nodes(){return Array.from(this._nodes.keys())}forEachNode(t){if(typeof t!="function")throw new ke("Graph.forEachNode: expecting a callback.");const n=this._nodes.values();let a,o;for(;a=n.next(),a.done!==!0;)o=a.value,t(o.key,o.attributes)}findNode(t){if(typeof t!="function")throw new ke("Graph.findNode: expecting a callback.");const n=this._nodes.values();let a,o;for(;a=n.next(),a.done!==!0;)if(o=a.value,t(o.key,o.attributes))return o.key}mapNodes(t){if(typeof t!="function")throw new ke("Graph.mapNode: expecting a callback.");const n=this._nodes.values();let a,o;const s=new Array(this.order);let c=0;for(;a=n.next(),a.done!==!0;)o=a.value,s[c++]=t(o.key,o.attributes);return s}someNode(t){if(typeof t!="function")throw new ke("Graph.someNode: expecting a callback.");const n=this._nodes.values();let a,o;for(;a=n.next(),a.done!==!0;)if(o=a.value,t(o.key,o.attributes))return!0;return!1}everyNode(t){if(typeof t!="function")throw new ke("Graph.everyNode: expecting a callback.");const n=this._nodes.values();let a,o;for(;a=n.next(),a.done!==!0;)if(o=a.value,!t(o.key,o.attributes))return!1;return!0}filterNodes(t){if(typeof t!="function")throw new ke("Graph.filterNodes: expecting a callback.");const n=this._nodes.values();let a,o;const s=[];for(;a=n.next(),a.done!==!0;)o=a.value,t(o.key,o.attributes)&&s.push(o.key);return s}reduceNodes(t,n){if(typeof t!="function")throw new ke("Graph.reduceNodes: expecting a callback.");if(arguments.length<2)throw new ke("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 a=n;const o=this._nodes.values();let s,c;for(;s=o.next(),s.done!==!0;)c=s.value,a=t(a,c.key,c.attributes);return a}nodeEntries(){const t=this._nodes.values();return{[Symbol.iterator](){return this},next(){const n=t.next();if(n.done)return n;const a=n.value;return{value:{node:a.key,attributes:a.attributes},done:!1}}}}export(){const t=new Array(this._nodes.size);let n=0;this._nodes.forEach((o,s)=>{t[n++]=MP(s,o)});const a=new Array(this._edges.size);return n=0,this._edges.forEach((o,s)=>{a[n++]=PP(this.type,s,o)}),{options:{type:this.type,multi:this.multi,allowSelfLoops:this.allowSelfLoops},attributes:this.getAttributes(),nodes:t,edges:a}}import(t,n=!1){if(t instanceof ft)return t.forEachNode((f,h)=>{n?this.mergeNode(f,h):this.addNode(f,h)}),t.forEachEdge((f,h,m,g,y,b,S)=>{n?S?this.mergeUndirectedEdgeWithKey(f,m,g,h):this.mergeDirectedEdgeWithKey(f,m,g,h):S?this.addUndirectedEdgeWithKey(f,m,g,h):this.addDirectedEdgeWithKey(f,m,g,h)}),this;if(!Qt(t))throw new ke("Graph.import: invalid argument. Expecting a serialized graph or, alternatively, a Graph instance.");if(t.attributes){if(!Qt(t.attributes))throw new ke("Graph.import: invalid attributes. Expecting a plain object.");n?this.mergeAttributes(t.attributes):this.replaceAttributes(t.attributes)}let a,o,s,c,u;if(t.nodes){if(s=t.nodes,!Array.isArray(s))throw new ke("Graph.import: invalid nodes. Expecting an array.");for(a=0,o=s.length;a{const s=Pt({},a.attributes);a=new n.NodeDataClass(o,s),n._nodes.set(o,a)}),n}copy(t){if(t=t||{},typeof t.type=="string"&&t.type!==this.type&&t.type!=="mixed")throw new $e(`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 $e("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 $e("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),a=this._edges.values();let o,s;for(;o=a.next(),o.done!==!0;)s=o.value,p_(n,"copy",!1,s.undirected,s.key,s.source.key,s.target.key,Pt({},s.attributes));return n}toJSON(){return this.export()}toString(){return"[object Graph]"}inspect(){const t={};this._nodes.forEach((s,c)=>{t[c]=s.attributes});const n={},a={};this._edges.forEach((s,c)=>{const u=s.undirected?"--":"->";let f="",h=s.source.key,m=s.target.key,g;s.undirected&&h>m&&(g=h,h=m,m=g);const y=`(${h})${u}(${m})`;c.startsWith("geid_")?this.multi&&(typeof a[y]>"u"?a[y]=0:a[y]++,f+=`${a[y]}. `):f+=`[${c}]: `,f+=y,n[f]=s.attributes});const o={};for(const s in this)this.hasOwnProperty(s)&&!I0.has(s)&&typeof this[s]!="function"&&typeof s!="symbol"&&(o[s]=this[s]);return o.attributes=this._attributes,o.nodes=t,o.edges=n,Yn(o,"constructor",this.constructor),o}}typeof Symbol<"u"&&(ft.prototype[Symbol.for("nodejs.util.inspect.custom")]=ft.prototype.inspect);IP.forEach(e=>{["add","merge","update"].forEach(t=>{const n=e.name(t),a=t==="add"?p_:VP;e.generateKey?ft.prototype[n]=function(o,s,c){return a(this,n,!0,(e.type||this.type)==="undirected",null,o,s,c,t==="update")}:ft.prototype[n]=function(o,s,c,u){return a(this,n,!1,(e.type||this.type)==="undirected",o,s,c,u,t==="update")}})});eP(ft);dP(ft);RP(ft);zP(ft);class cl extends ft{constructor(t){const n=Pt({type:"directed"},t);if("multi"in n&&n.multi!==!1)throw new ke("DirectedGraph.from: inconsistent indication that the graph should be multi in given options!");if(n.type!=="directed")throw new ke('DirectedGraph.from: inconsistent "'+n.type+'" type in given options!');super(n)}}class m_ extends ft{constructor(t){const n=Pt({type:"undirected"},t);if("multi"in n&&n.multi!==!1)throw new ke("UndirectedGraph.from: inconsistent indication that the graph should be multi in given options!");if(n.type!=="undirected")throw new ke('UndirectedGraph.from: inconsistent "'+n.type+'" type in given options!');super(n)}}class g_ extends ft{constructor(t){const n=Pt({multi:!0},t);if("multi"in n&&n.multi!==!0)throw new ke("MultiGraph.from: inconsistent indication that the graph should be simple in given options!");super(n)}}class v_ extends ft{constructor(t){const n=Pt({type:"directed",multi:!0},t);if("multi"in n&&n.multi!==!0)throw new ke("MultiDirectedGraph.from: inconsistent indication that the graph should be simple in given options!");if(n.type!=="directed")throw new ke('MultiDirectedGraph.from: inconsistent "'+n.type+'" type in given options!');super(n)}}class y_ extends ft{constructor(t){const n=Pt({type:"undirected",multi:!0},t);if("multi"in n&&n.multi!==!0)throw new ke("MultiUndirectedGraph.from: inconsistent indication that the graph should be simple in given options!");if(n.type!=="undirected")throw new ke('MultiUndirectedGraph.from: inconsistent "'+n.type+'" type in given options!');super(n)}}function qo(e){e.from=function(t,n){const a=Pt({},t.options,n),o=new e(a);return o.import(t),o}}qo(ft);qo(cl);qo(m_);qo(g_);qo(v_);qo(y_);ft.Graph=ft;ft.DirectedGraph=cl;ft.UndirectedGraph=m_;ft.MultiGraph=g_;ft.MultiDirectedGraph=v_;ft.MultiUndirectedGraph=y_;ft.InvalidArgumentsGraphError=ke;ft.NotFoundGraphError=Re;ft.UsageGraphError=$e;function qP(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var a=n.call(e,t);if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function al(e){var t=qP(e,"string");return typeof t=="symbol"?t:t+""}function $t(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function $0(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,a=Array(t);n>8&255,s=n>>16&255,c=n>>24&255;return[a,o,s,c]}var np={};function __(e){if(typeof np[e]<"u")return np[e];var t=(e&16711680)>>>16,n=(e&65280)>>>8,a=e&255,o=255,s=S_(t,n,a,o);return np[e]=s,s}function V0(e,t,n,a){return n+(t<<8)+(e<<16)}function q0(e,t,n,a,o,s){var c=Math.floor(n/s*o),u=Math.floor(e.drawingBufferHeight/s-a/s*o),f=new Uint8Array(4);e.bindFramebuffer(e.FRAMEBUFFER,t),e.readPixels(c,u,1,1,e.RGBA,e.UNSIGNED_BYTE,f);var h=jo(f,4),m=h[0],g=h[1],y=h[2],b=h[3];return[m,g,y,b]}function we(e,t,n){return(t=al(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Y0(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,a)}return n}function Le(e){for(var t=1;tD){var M="…";for(h=h+M,k=e.measureText(h).width;k>D&&h.length>1;)h=h.slice(0,-2)+M,k=e.measureText(h).width;if(h.length<4)return}var R;T>0?A>0?R=Math.acos(T/D):R=Math.asin(A/D):A>0?R=Math.acos(T/D)+Math.PI:R=Math.asin(T/D)+Math.PI/2,e.save(),e.translate(_,N),e.rotate(R),e.fillText(h,-k/2,t.size/2+s),e.restore()}}}function k_(e,t,n){if(t.label){var a=n.labelSize,o=n.labelFont,s=n.labelWeight,c=n.labelColor.attribute?t[n.labelColor.attribute]||n.labelColor.color||"#000":n.labelColor.color;e.fillStyle=c,e.font="".concat(s," ").concat(a,"px ").concat(o),e.fillText(t.label,t.x+t.size+3,t.y+a/3)}}function c4(e,t,n){var a=n.labelSize,o=n.labelFont,s=n.labelWeight;e.font="".concat(s," ").concat(a,"px ").concat(o),e.fillStyle="#FFF",e.shadowOffsetX=0,e.shadowOffsetY=0,e.shadowBlur=8,e.shadowColor="#000";var c=2;if(typeof t.label=="string"){var u=e.measureText(t.label).width,f=Math.round(u+5),h=Math.round(a+2*c),m=Math.max(t.size,a/2)+c,g=Math.asin(h/2/m),y=Math.sqrt(Math.abs(Math.pow(m,2)-Math.pow(h/2,2)));e.beginPath(),e.moveTo(t.x+y,t.y+h/2),e.lineTo(t.x+m+f,t.y+h/2),e.lineTo(t.x+m+f,t.y-h/2),e.lineTo(t.x+y,t.y-h/2),e.arc(t.x,t.y,m,g,-g),e.closePath(),e.fill()}else e.beginPath(),e.arc(t.x,t.y,t.size+c,0,Math.PI*2),e.closePath(),e.fill();e.shadowOffsetX=0,e.shadowOffsetY=0,e.shadowBlur=0,k_(e,t,n)}var u4=` -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 -} -`,d4=u4,f4=` -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; -} -`,h4=f4,D_=WebGLRenderingContext,Z0=D_.UNSIGNED_BYTE,ap=D_.FLOAT,p4=["u_sizeRatio","u_correctionRatio","u_matrix"],_l=function(e){function t(){return $t(this,t),En(this,t,arguments)}return Sn(t,e),Vt(t,[{key:"getDefinition",value:function(){return{VERTICES:3,VERTEX_SHADER_SOURCE:h4,FRAGMENT_SHADER_SOURCE:d4,METHOD:WebGLRenderingContext.TRIANGLES,UNIFORMS:p4,ATTRIBUTES:[{name:"a_position",size:2,type:ap},{name:"a_size",size:1,type:ap},{name:"a_color",size:4,type:Z0,normalized:!0},{name:"a_id",size:4,type:Z0,normalized:!0}],CONSTANT_ATTRIBUTES:[{name:"a_angle",size:1,type:ap}],CONSTANT_DATA:[[t.ANGLE_1],[t.ANGLE_2],[t.ANGLE_3]]}}},{key:"processVisibleItem",value:function(a,o,s){var c=this.array,u=Ar(s.color);c[o++]=s.x,c[o++]=s.y,c[o++]=s.size,c[o++]=u,c[o++]=a}},{key:"setUniforms",value:function(a,o){var s=o.gl,c=o.uniformLocations,u=c.u_sizeRatio,f=c.u_correctionRatio,h=c.u_matrix;s.uniform1f(f,a.correctionRatio),s.uniform1f(u,a.sizeRatio),s.uniformMatrix3fv(h,!1,a.matrix)}}])}(Rg);we(_l,"ANGLE_1",0);we(_l,"ANGLE_2",2*Math.PI/3);we(_l,"ANGLE_3",4*Math.PI/3);var m4=` -precision mediump float; - -varying vec4 v_color; - -void main(void) { - gl_FragColor = v_color; -} -`,g4=m4,v4=` -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; -} -`,y4=v4,N_=WebGLRenderingContext,Q0=N_.UNSIGNED_BYTE,Kc=N_.FLOAT,b4=["u_matrix","u_sizeRatio","u_correctionRatio","u_minEdgeThickness","u_lengthToThicknessRatio","u_widenessToThicknessRatio"],Tl={extremity:"target",lengthToThicknessRatio:2.5,widenessToThicknessRatio:2};function ku(e){var t=Le(Le({},Tl),e||{});return function(n){function a(){return $t(this,a),En(this,a,arguments)}return Sn(a,n),Vt(a,[{key:"getDefinition",value:function(){return{VERTICES:3,VERTEX_SHADER_SOURCE:y4,FRAGMENT_SHADER_SOURCE:g4,METHOD:WebGLRenderingContext.TRIANGLES,UNIFORMS:b4,ATTRIBUTES:[{name:"a_position",size:2,type:Kc},{name:"a_normal",size:2,type:Kc},{name:"a_radius",size:1,type:Kc},{name:"a_color",size:4,type:Q0,normalized:!0},{name:"a_id",size:4,type:Q0,normalized:!0}],CONSTANT_ATTRIBUTES:[{name:"a_barycentric",size:3,type:Kc}],CONSTANT_DATA:[[1,0,0],[0,1,0],[0,0,1]]}}},{key:"processVisibleItem",value:function(s,c,u,f,h){if(t.extremity==="source"){var m=[f,u];u=m[0],f=m[1]}var g=h.size||1,y=f.size||1,b=u.x,S=u.y,E=f.x,_=f.y,N=Ar(h.color),T=E-b,A=_-S,D=T*T+A*A,k=0,M=0;D&&(D=1/Math.sqrt(D),k=-A*D*g,M=T*D*g);var R=this.array;R[c++]=E,R[c++]=_,R[c++]=-k,R[c++]=-M,R[c++]=y,R[c++]=N,R[c++]=s}},{key:"setUniforms",value:function(s,c){var u=c.gl,f=c.uniformLocations,h=f.u_matrix,m=f.u_sizeRatio,g=f.u_correctionRatio,y=f.u_minEdgeThickness,b=f.u_lengthToThicknessRatio,S=f.u_widenessToThicknessRatio;u.uniformMatrix3fv(h,!1,s.matrix),u.uniform1f(m,s.sizeRatio),u.uniform1f(g,s.correctionRatio),u.uniform1f(y,s.minEdgeThickness),u.uniform1f(b,t.lengthToThicknessRatio),u.uniform1f(S,t.widenessToThicknessRatio)}}])}(Sl)}ku();var x4=` -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 -} -`,Ag=x4,w4=` -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; -} -`,E4=w4,O_=WebGLRenderingContext,J0=O_.UNSIGNED_BYTE,vi=O_.FLOAT,S4=["u_matrix","u_zoomRatio","u_sizeRatio","u_correctionRatio","u_pixelRatio","u_feather","u_minEdgeThickness","u_lengthToThicknessRatio"],_4={lengthToThicknessRatio:Tl.lengthToThicknessRatio};function j_(e){var t=Le(Le({},_4),{});return function(n){function a(){return $t(this,a),En(this,a,arguments)}return Sn(a,n),Vt(a,[{key:"getDefinition",value:function(){return{VERTICES:6,VERTEX_SHADER_SOURCE:E4,FRAGMENT_SHADER_SOURCE:Ag,METHOD:WebGLRenderingContext.TRIANGLES,UNIFORMS:S4,ATTRIBUTES:[{name:"a_positionStart",size:2,type:vi},{name:"a_positionEnd",size:2,type:vi},{name:"a_normal",size:2,type:vi},{name:"a_color",size:4,type:J0,normalized:!0},{name:"a_id",size:4,type:J0,normalized:!0},{name:"a_radius",size:1,type:vi}],CONSTANT_ATTRIBUTES:[{name:"a_positionCoef",size:1,type:vi},{name:"a_normalCoef",size:1,type:vi},{name:"a_radiusCoef",size:1,type:vi}],CONSTANT_DATA:[[0,1,0],[0,-1,0],[1,1,1],[1,1,1],[0,-1,0],[1,-1,-1]]}}},{key:"processVisibleItem",value:function(s,c,u,f,h){var m=h.size||1,g=u.x,y=u.y,b=f.x,S=f.y,E=Ar(h.color),_=b-g,N=S-y,T=f.size||1,A=_*_+N*N,D=0,k=0;A&&(A=1/Math.sqrt(A),D=-N*A*m,k=_*A*m);var M=this.array;M[c++]=g,M[c++]=y,M[c++]=b,M[c++]=S,M[c++]=D,M[c++]=k,M[c++]=E,M[c++]=s,M[c++]=T}},{key:"setUniforms",value:function(s,c){var u=c.gl,f=c.uniformLocations,h=f.u_matrix,m=f.u_zoomRatio,g=f.u_feather,y=f.u_pixelRatio,b=f.u_correctionRatio,S=f.u_sizeRatio,E=f.u_minEdgeThickness,_=f.u_lengthToThicknessRatio;u.uniformMatrix3fv(h,!1,s.matrix),u.uniform1f(m,s.zoomRatio),u.uniform1f(S,s.sizeRatio),u.uniform1f(b,s.correctionRatio),u.uniform1f(y,s.pixelRatio),u.uniform1f(g,s.antiAliasingFeather),u.uniform1f(E,s.minEdgeThickness),u.uniform1f(_,t.lengthToThicknessRatio)}}])}(Sl)}j_();function T4(e){return A_([j_(),ku(e)])}var C4=T4(),L_=C4,R4=` -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; -} -`,A4=R4,z_=WebGLRenderingContext,ew=z_.UNSIGNED_BYTE,Xs=z_.FLOAT,k4=["u_matrix","u_zoomRatio","u_sizeRatio","u_correctionRatio","u_pixelRatio","u_feather","u_minEdgeThickness"],D4=function(e){function t(){return $t(this,t),En(this,t,arguments)}return Sn(t,e),Vt(t,[{key:"getDefinition",value:function(){return{VERTICES:6,VERTEX_SHADER_SOURCE:A4,FRAGMENT_SHADER_SOURCE:Ag,METHOD:WebGLRenderingContext.TRIANGLES,UNIFORMS:k4,ATTRIBUTES:[{name:"a_positionStart",size:2,type:Xs},{name:"a_positionEnd",size:2,type:Xs},{name:"a_normal",size:2,type:Xs},{name:"a_color",size:4,type:ew,normalized:!0},{name:"a_id",size:4,type:ew,normalized:!0}],CONSTANT_ATTRIBUTES:[{name:"a_positionCoef",size:1,type:Xs},{name:"a_normalCoef",size:1,type:Xs}],CONSTANT_DATA:[[0,1],[0,-1],[1,1],[1,1],[0,-1],[1,-1]]}}},{key:"processVisibleItem",value:function(a,o,s,c,u){var f=u.size||1,h=s.x,m=s.y,g=c.x,y=c.y,b=Ar(u.color),S=g-h,E=y-m,_=S*S+E*E,N=0,T=0;_&&(_=1/Math.sqrt(_),N=-E*_*f,T=S*_*f);var A=this.array;A[o++]=h,A[o++]=m,A[o++]=g,A[o++]=y,A[o++]=N,A[o++]=T,A[o++]=b,A[o++]=a}},{key:"setUniforms",value:function(a,o){var s=o.gl,c=o.uniformLocations,u=c.u_matrix,f=c.u_zoomRatio,h=c.u_feather,m=c.u_pixelRatio,g=c.u_correctionRatio,y=c.u_sizeRatio,b=c.u_minEdgeThickness;s.uniformMatrix3fv(u,!1,a.matrix),s.uniform1f(f,a.zoomRatio),s.uniform1f(y,a.sizeRatio),s.uniform1f(g,a.correctionRatio),s.uniform1f(m,a.pixelRatio),s.uniform1f(h,a.antiAliasingFeather),s.uniform1f(b,a.minEdgeThickness)}}])}(Sl),kg=function(e){function t(){var n;return $t(this,t),n=En(this,t),n.rawEmitter=n,n}return Sn(t,e),Vt(t)}(i_.EventEmitter),ip,tw;function kr(){return tw||(tw=1,ip=function(t){return t!==null&&typeof t=="object"&&typeof t.addUndirectedEdgeWithKey=="function"&&typeof t.dropNode=="function"&&typeof t.multi=="boolean"}),ip}var N4=kr();const O4=dn(N4);var j4=function(t){return t},L4=function(t){return t*t},z4=function(t){return t*(2-t)},M4=function(t){return(t*=2)<1?.5*t*t:-.5*(--t*(t-2)-1)},P4=function(t){return t*t*t},G4=function(t){return--t*t*t+1},F4=function(t){return(t*=2)<1?.5*t*t*t:.5*((t-=2)*t*t+2)},M_={linear:j4,quadraticIn:L4,quadraticOut:z4,quadraticInOut:M4,cubicIn:P4,cubicOut:G4,cubicInOut:F4},P_={easing:"quadraticInOut",duration:150};function U4(e,t,n,a){var o=Object.assign({},P_,n),s=typeof o.easing=="function"?o.easing:M_[o.easing],c=Date.now(),u={};for(var f in t){var h=t[f];u[f]={};for(var m in h)u[f][m]=e.getNodeAttribute(f,m)}var g=null,y=function(){g=null;var S=(Date.now()-c)/o.duration;if(S>=1){for(var E in t){var _=t[E];for(var N in _)e.setNodeAttribute(E,N,_[N])}return}S=s(S);for(var T in t){var A=t[T],D=u[T];for(var k in A)e.setNodeAttribute(T,k,A[k]*S+D[k]*(1-S))}g=requestAnimationFrame(y)};return y(),function(){g&&cancelAnimationFrame(g)}}function ir(){return Float32Array.of(1,0,0,0,1,0,0,0,1)}function Zc(e,t,n){return e[0]=t,e[4]=typeof n=="number"?n:t,e}function nw(e,t){var n=Math.sin(t),a=Math.cos(t);return e[0]=a,e[1]=n,e[3]=-n,e[4]=a,e}function rw(e,t,n){return e[6]=t,e[7]=n,e}function Oa(e,t){var n=e[0],a=e[1],o=e[2],s=e[3],c=e[4],u=e[5],f=e[6],h=e[7],m=e[8],g=t[0],y=t[1],b=t[2],S=t[3],E=t[4],_=t[5],N=t[6],T=t[7],A=t[8];return e[0]=g*n+y*s+b*f,e[1]=g*a+y*c+b*h,e[2]=g*o+y*u+b*m,e[3]=S*n+E*s+_*f,e[4]=S*a+E*c+_*h,e[5]=S*o+E*u+_*m,e[6]=N*n+T*s+A*f,e[7]=N*a+T*c+A*h,e[8]=N*o+T*u+A*m,e}function bm(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,a=e[0],o=e[1],s=e[3],c=e[4],u=e[6],f=e[7],h=t.x,m=t.y;return{x:h*a+m*s+u*n,y:h*o+m*c+f*n}}function B4(e,t){var n=e.height/e.width,a=t.height/t.width;return n<1&&a>1||n>1&&a<1?1:Math.min(Math.max(a,1/a),Math.max(1/n,n))}function Ks(e,t,n,a,o){var s=e.angle,c=e.ratio,u=e.x,f=e.y,h=t.width,m=t.height,g=ir(),y=Math.min(h,m)-2*a,b=B4(t,n);return o?(Oa(g,rw(ir(),u,f)),Oa(g,Zc(ir(),c)),Oa(g,nw(ir(),s)),Oa(g,Zc(ir(),h/y/2/b,m/y/2/b))):(Oa(g,Zc(ir(),2*(y/h)*b,2*(y/m)*b)),Oa(g,nw(ir(),-s)),Oa(g,Zc(ir(),1/c)),Oa(g,rw(ir(),-u,-f))),g}function I4(e,t,n){var a=bm(e,{x:Math.cos(t.angle),y:Math.sin(t.angle)},0),o=a.x,s=a.y;return 1/Math.sqrt(Math.pow(o,2)+Math.pow(s,2))/n.width}function H4(e){if(!e.order)return{x:[0,1],y:[0,1]};var t=1/0,n=-1/0,a=1/0,o=-1/0;return e.forEachNode(function(s,c){var u=c.x,f=c.y;un&&(n=u),fo&&(o=f)}),{x:[t,n],y:[a,o]}}function $4(e){if(!O4(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 V4(e,t,n){var a=document.createElement(e);if(t)for(var o in t)a.style[o]=t[o];if(n)for(var s in n)a.setAttribute(s,n[s]);return a}function aw(){return typeof window.devicePixelRatio<"u"?window.devicePixelRatio:1}function iw(e,t,n){return n.sort(function(a,o){var s=t(a)||0,c=t(o)||0;return sc?1:0})}function ow(e){var t=jo(e.x,2),n=t[0],a=t[1],o=jo(e.y,2),s=o[0],c=o[1],u=Math.max(a-n,c-s),f=(a+n)/2,h=(c+s)/2;(u===0||Math.abs(u)===1/0||isNaN(u))&&(u=1),isNaN(f)&&(f=0),isNaN(h)&&(h=0);var m=function(y){return{x:.5+(y.x-f)/u,y:.5+(y.y-h)/u}};return m.applyTo=function(g){g.x=.5+(g.x-f)/u,g.y=.5+(g.y-h)/u},m.inverse=function(g){return{x:f+u*(g.x-.5),y:h+u*(g.y-.5)}},m.ratio=u,m}function xm(e){"@babel/helpers - typeof";return xm=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},xm(e)}function sw(e,t){var n=t.size;if(n!==0){var a=e.length;e.length+=n;var o=0;t.forEach(function(s){e[a+o]=s,o++})}}function op(e){e=e||{};for(var t=0,n=arguments.length<=1?0:arguments.length-1;t1&&arguments[1]!==void 0?arguments[1]:{},c=arguments.length>2?arguments[2]:void 0;if(!c)return new Promise(function(b){return o.animate(a,s,b)});if(this.enabled){var u=Le(Le({},P_),s),f=this.validateState(a),h=typeof u.easing=="function"?u.easing:M_[u.easing],m=Date.now(),g=this.getState(),y=function(){var S=(Date.now()-m)/u.duration;if(S>=1){o.nextFrame=null,o.setState(f),o.animationCallback&&(o.animationCallback.call(null),o.animationCallback=void 0);return}var E=h(S),_={};typeof f.x=="number"&&(_.x=g.x+(f.x-g.x)*E),typeof f.y=="number"&&(_.y=g.y+(f.y-g.y)*E),o.enabledRotation&&typeof f.angle=="number"&&(_.angle=g.angle+(f.angle-g.angle)*E),typeof f.ratio=="number"&&(_.ratio=g.ratio+(f.ratio-g.ratio)*E),o.setState(_),o.nextFrame=requestAnimationFrame(y)};this.nextFrame?(cancelAnimationFrame(this.nextFrame),this.animationCallback&&this.animationCallback.call(null),this.nextFrame=requestAnimationFrame(y)):y(),this.animationCallback=c}}},{key:"animatedZoom",value:function(a){return a?typeof a=="number"?this.animate({ratio:this.ratio/a}):this.animate({ratio:this.ratio/(a.factor||Qc)},a):this.animate({ratio:this.ratio/Qc})}},{key:"animatedUnzoom",value:function(a){return a?typeof a=="number"?this.animate({ratio:this.ratio*a}):this.animate({ratio:this.ratio*(a.factor||Qc)},a):this.animate({ratio:this.ratio*Qc})}},{key:"animatedReset",value:function(a){return this.animate({x:.5,y:.5,ratio:1,angle:0},a)}},{key:"copy",value:function(){return t.from(this.getState())}}],[{key:"from",value:function(a){var o=new t;return o.setState(a)}}])}(kg);function sr(e,t){var n=t.getBoundingClientRect();return{x:e.clientX-n.left,y:e.clientY-n.top}}function Qr(e,t){var n=Le(Le({},sr(e,t)),{},{sigmaDefaultPrevented:!1,preventSigmaDefault:function(){n.sigmaDefaultPrevented=!0},original:e});return n}function Zs(e){var t="x"in e?e:Le(Le({},e.touches[0]||e.previousTouches[0]),{},{original:e.original,sigmaDefaultPrevented:e.sigmaDefaultPrevented,preventSigmaDefault:function(){e.sigmaDefaultPrevented=!0,t.sigmaDefaultPrevented=!0}});return t}function X4(e,t){return Le(Le({},Qr(e,t)),{},{delta:G_(e)})}var K4=2;function pu(e){for(var t=[],n=0,a=Math.min(e.length,K4);n0;o.draggedEvents=0,g&&o.renderer.getSetting("hideEdgesOnMove")&&o.renderer.refresh()},0),this.emit("mouseup",Qr(a,this.container))}}},{key:"handleMove",value:function(a){var o=this;if(this.enabled){var s=Qr(a,this.container);if(this.emit("mousemovebody",s),(a.target===this.container||a.composedPath()[0]===this.container)&&this.emit("mousemove",s),!s.sigmaDefaultPrevented&&this.isMouseDown){this.isMoving=!0,this.draggedEvents++,typeof this.movingTimeout=="number"&&clearTimeout(this.movingTimeout),this.movingTimeout=window.setTimeout(function(){o.movingTimeout=null,o.isMoving=!1},this.settings.dragTimeout);var c=this.renderer.getCamera(),u=sr(a,this.container),f=u.x,h=u.y,m=this.renderer.viewportToFramedGraph({x:this.lastMouseX,y:this.lastMouseY}),g=this.renderer.viewportToFramedGraph({x:f,y:h}),y=m.x-g.x,b=m.y-g.y,S=c.getState(),E=S.x+y,_=S.y+b;c.setState({x:E,y:_}),this.lastMouseX=f,this.lastMouseY=h,a.preventDefault(),a.stopPropagation()}}}},{key:"handleLeave",value:function(a){this.emit("mouseleave",Qr(a,this.container))}},{key:"handleEnter",value:function(a){this.emit("mouseenter",Qr(a,this.container))}},{key:"handleWheel",value:function(a){var o=this,s=this.renderer.getCamera();if(!(!this.enabled||!s.enabledZooming)){var c=G_(a);if(c){var u=X4(a,this.container);if(this.emit("wheel",u),u.sigmaDefaultPrevented){a.preventDefault(),a.stopPropagation();return}var f=s.getState().ratio,h=c>0?1/this.settings.zoomingRatio:this.settings.zoomingRatio,m=s.getBoundedRatio(f*h),g=c>0?1:-1,y=Date.now();f!==m&&(a.preventDefault(),a.stopPropagation(),!(this.currentWheelDirection===g&&this.lastWheelTriggerTime&&y-this.lastWheelTriggerTimea.size?-1:n.sizea.key?1:-1}}])}(),dw=function(){function e(){$t(this,e),we(this,"width",0),we(this,"height",0),we(this,"cellSize",0),we(this,"columns",0),we(this,"rows",0),we(this,"cells",{})}return Vt(e,[{key:"resizeAndClear",value:function(n,a){this.width=n.width,this.height=n.height,this.cellSize=a,this.columns=Math.ceil(n.width/a),this.rows=Math.ceil(n.height/a),this.cells={}}},{key:"getIndex",value:function(n){var a=Math.floor(n.x/this.cellSize),o=Math.floor(n.y/this.cellSize);return o*this.columns+a}},{key:"add",value:function(n,a,o){var s=new uw(n,a),c=this.getIndex(o),u=this.cells[c];u||(u=[],this.cells[c]=u),u.push(s)}},{key:"organize",value:function(){for(var n in this.cells){var a=this.cells[n];a.sort(uw.compare)}}},{key:"getLabelsToDisplay",value:function(n,a){var o=this.cellSize*this.cellSize,s=o/n/n,c=s*a/o,u=Math.ceil(c),f=[];for(var h in this.cells)for(var m=this.cells[h],g=0;g2&&arguments[2]!==void 0?arguments[2]:{};if($t(this,t),o=En(this,t),we(o,"elements",{}),we(o,"canvasContexts",{}),we(o,"webGLContexts",{}),we(o,"pickingLayers",new Set),we(o,"textures",{}),we(o,"frameBuffers",{}),we(o,"activeListeners",{}),we(o,"labelGrid",new dw),we(o,"nodeDataCache",{}),we(o,"edgeDataCache",{}),we(o,"nodeProgramIndex",{}),we(o,"edgeProgramIndex",{}),we(o,"nodesWithForcedLabels",new Set),we(o,"edgesWithForcedLabels",new Set),we(o,"nodeExtent",{x:[0,1],y:[0,1]}),we(o,"nodeZExtent",[1/0,-1/0]),we(o,"edgeZExtent",[1/0,-1/0]),we(o,"matrix",ir()),we(o,"invMatrix",ir()),we(o,"correctionRatio",1),we(o,"customBBox",null),we(o,"normalizationFunction",ow({x:[0,1],y:[0,1]})),we(o,"graphToViewportRatio",1),we(o,"itemIDsIndex",{}),we(o,"nodeIndices",{}),we(o,"edgeIndices",{}),we(o,"width",0),we(o,"height",0),we(o,"pixelRatio",aw()),we(o,"pickingDownSizingRatio",2*o.pixelRatio),we(o,"displayedNodeLabels",new Set),we(o,"displayedEdgeLabels",new Set),we(o,"highlightedNodes",new Set),we(o,"hoveredNode",null),we(o,"hoveredEdge",null),we(o,"renderFrame",null),we(o,"renderHighlightedNodesFrame",null),we(o,"needToProcess",!1),we(o,"checkEdgesEventsFrame",null),we(o,"nodePrograms",{}),we(o,"nodeHoverPrograms",{}),we(o,"edgePrograms",{}),o.settings=W4(s),sp(o.settings),$4(n),!(a instanceof HTMLElement))throw new Error("Sigma: container should be an html element.");o.graph=n,o.container=a,o.createWebGLContext("edges",{picking:s.enableEdgeEvents}),o.createCanvasContext("edgeLabels"),o.createWebGLContext("nodes",{picking:!0}),o.createCanvasContext("labels"),o.createCanvasContext("hovers"),o.createWebGLContext("hoverNodes"),o.createCanvasContext("mouse",{style:{touchAction:"none",userSelect:"none"}}),o.resize();for(var c in o.settings.nodeProgramClasses)o.registerNodeProgram(c,o.settings.nodeProgramClasses[c],o.settings.nodeHoverProgramClasses[c]);for(var u in o.settings.edgeProgramClasses)o.registerEdgeProgram(u,o.settings.edgeProgramClasses[u]);return o.camera=new lw,o.bindCameraHandlers(),o.mouseCaptor=new J4(o.elements.mouse,o),o.mouseCaptor.setSettings(o.settings),o.touchCaptor=new nG(o.elements.mouse,o),o.touchCaptor.setSettings(o.settings),o.bindEventHandlers(),o.bindGraphHandlers(),o.handleSettingsUpdate(),o.refresh(),o}return Sn(t,e),Vt(t,[{key:"registerNodeProgram",value:function(a,o,s){return this.nodePrograms[a]&&this.nodePrograms[a].kill(),this.nodeHoverPrograms[a]&&this.nodeHoverPrograms[a].kill(),this.nodePrograms[a]=new o(this.webGLContexts.nodes,this.frameBuffers.nodes,this),this.nodeHoverPrograms[a]=new(s||o)(this.webGLContexts.hoverNodes,null,this),this}},{key:"registerEdgeProgram",value:function(a,o){return this.edgePrograms[a]&&this.edgePrograms[a].kill(),this.edgePrograms[a]=new o(this.webGLContexts.edges,this.frameBuffers.edges,this),this}},{key:"unregisterNodeProgram",value:function(a){if(this.nodePrograms[a]){var o=this.nodePrograms,s=o[a],c=lp(o,[a].map(al));s.kill(),this.nodePrograms=c}if(this.nodeHoverPrograms[a]){var u=this.nodeHoverPrograms,f=u[a],h=lp(u,[a].map(al));f.kill(),this.nodePrograms=h}return this}},{key:"unregisterEdgeProgram",value:function(a){if(this.edgePrograms[a]){var o=this.edgePrograms,s=o[a],c=lp(o,[a].map(al));s.kill(),this.edgePrograms=c}return this}},{key:"resetWebGLTexture",value:function(a){var o=this.webGLContexts[a],s=this.frameBuffers[a],c=this.textures[a];c&&o.deleteTexture(c);var u=o.createTexture();return o.bindFramebuffer(o.FRAMEBUFFER,s),o.bindTexture(o.TEXTURE_2D,u),o.texImage2D(o.TEXTURE_2D,0,o.RGBA,this.width,this.height,0,o.RGBA,o.UNSIGNED_BYTE,null),o.framebufferTexture2D(o.FRAMEBUFFER,o.COLOR_ATTACHMENT0,o.TEXTURE_2D,u,0),this.textures[a]=u,this}},{key:"bindCameraHandlers",value:function(){var a=this;return this.activeListeners.camera=function(){a.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(a){var o=a.x,s=a.y,c=q0(this.webGLContexts.nodes,this.frameBuffers.nodes,o,s,this.pixelRatio,this.pickingDownSizingRatio),u=V0.apply(void 0,cw(c)),f=this.itemIDsIndex[u];return f&&f.type==="node"?f.id:null}},{key:"bindEventHandlers",value:function(){var a=this;this.activeListeners.handleResize=function(){a.scheduleRefresh()},window.addEventListener("resize",this.activeListeners.handleResize),this.activeListeners.handleMove=function(s){var c=Zs(s),u={event:c,preventSigmaDefault:function(){c.preventSigmaDefault()}},f=a.getNodeAtPosition(c);if(f&&a.hoveredNode!==f&&!a.nodeDataCache[f].hidden){a.hoveredNode&&a.emit("leaveNode",Le(Le({},u),{},{node:a.hoveredNode})),a.hoveredNode=f,a.emit("enterNode",Le(Le({},u),{},{node:f})),a.scheduleHighlightedNodesRender();return}if(a.hoveredNode&&a.getNodeAtPosition(c)!==a.hoveredNode){var h=a.hoveredNode;a.hoveredNode=null,a.emit("leaveNode",Le(Le({},u),{},{node:h})),a.scheduleHighlightedNodesRender();return}if(a.settings.enableEdgeEvents){var m=a.hoveredNode?null:a.getEdgeAtPoint(u.event.x,u.event.y);m!==a.hoveredEdge&&(a.hoveredEdge&&a.emit("leaveEdge",Le(Le({},u),{},{edge:a.hoveredEdge})),m&&a.emit("enterEdge",Le(Le({},u),{},{edge:m})),a.hoveredEdge=m)}},this.activeListeners.handleMoveBody=function(s){var c=Zs(s);a.emit("moveBody",{event:c,preventSigmaDefault:function(){c.preventSigmaDefault()}})},this.activeListeners.handleLeave=function(s){var c=Zs(s),u={event:c,preventSigmaDefault:function(){c.preventSigmaDefault()}};a.hoveredNode&&(a.emit("leaveNode",Le(Le({},u),{},{node:a.hoveredNode})),a.scheduleHighlightedNodesRender()),a.settings.enableEdgeEvents&&a.hoveredEdge&&(a.emit("leaveEdge",Le(Le({},u),{},{edge:a.hoveredEdge})),a.scheduleHighlightedNodesRender()),a.emit("leaveStage",Le({},u))},this.activeListeners.handleEnter=function(s){var c=Zs(s),u={event:c,preventSigmaDefault:function(){c.preventSigmaDefault()}};a.emit("enterStage",Le({},u))};var o=function(c){return function(u){var f=Zs(u),h={event:f,preventSigmaDefault:function(){f.preventSigmaDefault()}},m=a.getNodeAtPosition(f);if(m)return a.emit("".concat(c,"Node"),Le(Le({},h),{},{node:m}));if(a.settings.enableEdgeEvents){var g=a.getEdgeAtPoint(f.x,f.y);if(g)return a.emit("".concat(c,"Edge"),Le(Le({},h),{},{edge:g}))}return a.emit("".concat(c,"Stage"),h)}};return this.activeListeners.handleClick=o("click"),this.activeListeners.handleRightClick=o("rightClick"),this.activeListeners.handleDoubleClick=o("doubleClick"),this.activeListeners.handleWheel=o("wheel"),this.activeListeners.handleDown=o("down"),this.activeListeners.handleUp=o("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 a=this,o=this.graph,s=new Set(["x","y","zIndex","type"]);return this.activeListeners.eachNodeAttributesUpdatedGraphUpdate=function(c){var u,f=(u=c.hints)===null||u===void 0?void 0:u.attributes;a.graph.forEachNode(function(m){return a.updateNode(m)});var h=!f||f.some(function(m){return s.has(m)});a.refresh({partialGraph:{nodes:o.nodes()},skipIndexation:!h,schedule:!0})},this.activeListeners.eachEdgeAttributesUpdatedGraphUpdate=function(c){var u,f=(u=c.hints)===null||u===void 0?void 0:u.attributes;a.graph.forEachEdge(function(m){return a.updateEdge(m)});var h=f&&["zIndex","type"].some(function(m){return f==null?void 0:f.includes(m)});a.refresh({partialGraph:{edges:o.edges()},skipIndexation:!h,schedule:!0})},this.activeListeners.addNodeGraphUpdate=function(c){var u=c.key;a.addNode(u),a.refresh({partialGraph:{nodes:[u]},skipIndexation:!1,schedule:!0})},this.activeListeners.updateNodeGraphUpdate=function(c){var u=c.key;a.refresh({partialGraph:{nodes:[u]},skipIndexation:!1,schedule:!0})},this.activeListeners.dropNodeGraphUpdate=function(c){var u=c.key;a.removeNode(u),a.refresh({schedule:!0})},this.activeListeners.addEdgeGraphUpdate=function(c){var u=c.key;a.addEdge(u),a.refresh({partialGraph:{edges:[u]},schedule:!0})},this.activeListeners.updateEdgeGraphUpdate=function(c){var u=c.key;a.refresh({partialGraph:{edges:[u]},skipIndexation:!1,schedule:!0})},this.activeListeners.dropEdgeGraphUpdate=function(c){var u=c.key;a.removeEdge(u),a.refresh({schedule:!0})},this.activeListeners.clearEdgesGraphUpdate=function(){a.clearEdgeState(),a.clearEdgeIndices(),a.refresh({schedule:!0})},this.activeListeners.clearGraphUpdate=function(){a.clearEdgeState(),a.clearNodeState(),a.clearEdgeIndices(),a.clearNodeIndices(),a.refresh({schedule:!0})},o.on("nodeAdded",this.activeListeners.addNodeGraphUpdate),o.on("nodeDropped",this.activeListeners.dropNodeGraphUpdate),o.on("nodeAttributesUpdated",this.activeListeners.updateNodeGraphUpdate),o.on("eachNodeAttributesUpdated",this.activeListeners.eachNodeAttributesUpdatedGraphUpdate),o.on("edgeAdded",this.activeListeners.addEdgeGraphUpdate),o.on("edgeDropped",this.activeListeners.dropEdgeGraphUpdate),o.on("edgeAttributesUpdated",this.activeListeners.updateEdgeGraphUpdate),o.on("eachEdgeAttributesUpdated",this.activeListeners.eachEdgeAttributesUpdatedGraphUpdate),o.on("edgesCleared",this.activeListeners.clearEdgesGraphUpdate),o.on("cleared",this.activeListeners.clearGraphUpdate),this}},{key:"unbindGraphHandlers",value:function(){var a=this.graph;a.removeListener("nodeAdded",this.activeListeners.addNodeGraphUpdate),a.removeListener("nodeDropped",this.activeListeners.dropNodeGraphUpdate),a.removeListener("nodeAttributesUpdated",this.activeListeners.updateNodeGraphUpdate),a.removeListener("eachNodeAttributesUpdated",this.activeListeners.eachNodeAttributesUpdatedGraphUpdate),a.removeListener("edgeAdded",this.activeListeners.addEdgeGraphUpdate),a.removeListener("edgeDropped",this.activeListeners.dropEdgeGraphUpdate),a.removeListener("edgeAttributesUpdated",this.activeListeners.updateEdgeGraphUpdate),a.removeListener("eachEdgeAttributesUpdated",this.activeListeners.eachEdgeAttributesUpdatedGraphUpdate),a.removeListener("edgesCleared",this.activeListeners.clearEdgesGraphUpdate),a.removeListener("cleared",this.activeListeners.clearGraphUpdate)}},{key:"getEdgeAtPoint",value:function(a,o){var s=q0(this.webGLContexts.edges,this.frameBuffers.edges,a,o,this.pixelRatio,this.pickingDownSizingRatio),c=V0.apply(void 0,cw(s)),u=this.itemIDsIndex[c];return u&&u.type==="edge"?u.id:null}},{key:"process",value:function(){var a=this;this.emit("beforeProcess");var o=this.graph,s=this.settings,c=this.getDimensions();if(this.nodeExtent=H4(this.graph),!this.settings.autoRescale){var u=c.width,f=c.height,h=this.nodeExtent,m=h.x,g=h.y;this.nodeExtent={x:[(m[0]+m[1])/2-u/2,(m[0]+m[1])/2+u/2],y:[(g[0]+g[1])/2-f/2,(g[0]+g[1])/2+f/2]}}this.normalizationFunction=ow(this.customBBox||this.nodeExtent);var y=new lw,b=Ks(y.getState(),c,this.getGraphDimensions(),this.getStagePadding());this.labelGrid.resizeAndClear(c,s.labelGridCellSize);for(var S={},E={},_={},N={},T=1,A=o.nodes(),D=0,k=A.length;D1&&arguments[1]!==void 0?arguments[1]:{},s=o.tolerance,c=s===void 0?0:s,u=o.boundaries,f=Le({},a),h=u||this.nodeExtent,m=jo(h.x,2),g=m[0],y=m[1],b=jo(h.y,2),S=b[0],E=b[1],_=[this.graphToViewport({x:g,y:S},{cameraState:a}),this.graphToViewport({x:y,y:S},{cameraState:a}),this.graphToViewport({x:g,y:E},{cameraState:a}),this.graphToViewport({x:y,y:E},{cameraState:a})],N=1/0,T=-1/0,A=1/0,D=-1/0;_.forEach(function(X){var ne=X.x,F=X.y;N=Math.min(N,ne),T=Math.max(T,ne),A=Math.min(A,F),D=Math.max(D,F)});var k=T-N,M=D-A,R=this.getDimensions(),U=R.width,L=R.height,I=0,q=0;if(k>=U?Tc&&(I=N-c):T>U+c?I=T-(U+c):N<-c&&(I=N+c),M>=L?Dc&&(q=A-c):D>L+c?q=D-(L+c):A<-c&&(q=A+c),I||q){var Y=this.viewportToFramedGraph({x:0,y:0},{cameraState:a}),B=this.viewportToFramedGraph({x:I,y:q},{cameraState:a});I=B.x-Y.x,q=B.y-Y.y,f.x+=I,f.y+=q}return f}},{key:"renderLabels",value:function(){if(!this.settings.renderLabels)return this;var a=this.camera.getState(),o=this.labelGrid.getLabelsToDisplay(a.ratio,this.settings.labelDensity);sw(o,this.nodesWithForcedLabels),this.displayedNodeLabels=new Set;for(var s=this.canvasContexts.labels,c=0,u=o.length;cthis.width+lG||y<-50||y>this.height+cG)){this.displayedNodeLabels.add(f);var S=this.settings.defaultDrawNodeLabel,E=this.nodePrograms[h.type],_=(E==null?void 0:E.drawLabel)||S;_(s,Le(Le({key:f},h),{},{size:b,x:g,y}),this.settings)}}}return this}},{key:"renderEdgeLabels",value:function(){if(!this.settings.renderEdgeLabels)return this;var a=this.canvasContexts.edgeLabels;a.clearRect(0,0,this.width,this.height);var o=sG({graph:this.graph,hoveredNode:this.hoveredNode,displayedNodeLabels:this.displayedNodeLabels,highlightedNodes:this.highlightedNodes});sw(o,this.edgesWithForcedLabels);for(var s=new Set,c=0,u=o.length;cthis.nodeZExtent[1]&&(this.nodeZExtent[1]=s.zIndex))}},{key:"updateNode",value:function(a){this.addNode(a);var o=this.nodeDataCache[a];this.normalizationFunction.applyTo(o)}},{key:"removeNode",value:function(a){delete this.nodeDataCache[a],delete this.nodeProgramIndex[a],this.highlightedNodes.delete(a),this.hoveredNode===a&&(this.hoveredNode=null),this.nodesWithForcedLabels.delete(a)}},{key:"addEdge",value:function(a){var o=Object.assign({},this.graph.getEdgeAttributes(a));this.settings.edgeReducer&&(o=this.settings.edgeReducer(a,o));var s=dG(this.settings,a,o);this.edgeDataCache[a]=s,this.edgesWithForcedLabels.delete(a),s.forceLabel&&!s.hidden&&this.edgesWithForcedLabels.add(a),this.settings.zIndex&&(s.zIndexthis.edgeZExtent[1]&&(this.edgeZExtent[1]=s.zIndex))}},{key:"updateEdge",value:function(a){this.addEdge(a)}},{key:"removeEdge",value:function(a){delete this.edgeDataCache[a],delete this.edgeProgramIndex[a],this.hoveredEdge===a&&(this.hoveredEdge=null),this.edgesWithForcedLabels.delete(a)}},{key:"clearNodeIndices",value:function(){this.labelGrid=new dw,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(a,o,s){var c=this.nodeDataCache[a],u=this.nodePrograms[c.type];if(!u)throw new Error('Sigma: could not find a suitable program for node type "'.concat(c.type,'"!'));u.process(o,s,c),this.nodeProgramIndex[a]=s}},{key:"addEdgeToProgram",value:function(a,o,s){var c=this.edgeDataCache[a],u=this.edgePrograms[c.type];if(!u)throw new Error('Sigma: could not find a suitable program for edge type "'.concat(c.type,'"!'));var f=this.graph.extremities(a),h=this.nodeDataCache[f[0]],m=this.nodeDataCache[f[1]];u.process(o,s,h,m,c),this.edgeProgramIndex[a]=s}},{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 a=this.settings,o=a.stagePadding,s=a.autoRescale;return s&&o||0}},{key:"createLayer",value:function(a,o){var s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(this.elements[a])throw new Error('Sigma: a layer named "'.concat(a,'" already exists'));var c=V4(o,{position:"absolute"},{class:"sigma-".concat(a)});return s.style&&Object.assign(c.style,s.style),this.elements[a]=c,"beforeLayer"in s&&s.beforeLayer?this.elements[s.beforeLayer].before(c):"afterLayer"in s&&s.afterLayer?this.elements[s.afterLayer].after(c):this.container.appendChild(c),c}},{key:"createCanvas",value:function(a){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return this.createLayer(a,"canvas",o)}},{key:"createCanvasContext",value:function(a){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},s=this.createCanvas(a,o),c={preserveDrawingBuffer:!1,antialias:!1};return this.canvasContexts[a]=s.getContext("2d",c),this}},{key:"createWebGLContext",value:function(a){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},s=(o==null?void 0:o.canvas)||this.createCanvas(a,o);o.hidden&&s.remove();var c=Le({preserveDrawingBuffer:!1,antialias:!1},o),u;u=s.getContext("webgl2",c),u||(u=s.getContext("webgl",c)),u||(u=s.getContext("experimental-webgl",c));var f=u;if(this.webGLContexts[a]=f,f.blendFunc(f.ONE,f.ONE_MINUS_SRC_ALPHA),o.picking){this.pickingLayers.add(a);var h=f.createFramebuffer();if(!h)throw new Error("Sigma: cannot create a new frame buffer for layer ".concat(a));this.frameBuffers[a]=h}return f}},{key:"killLayer",value:function(a){var o=this.elements[a];if(!o)throw new Error("Sigma: cannot kill layer ".concat(a,", which does not exist"));if(this.webGLContexts[a]){var s,c=this.webGLContexts[a];(s=c.getExtension("WEBGL_lose_context"))===null||s===void 0||s.loseContext(),delete this.webGLContexts[a]}else this.canvasContexts[a]&&delete this.canvasContexts[a];return o.remove(),delete this.elements[a],this}},{key:"getCamera",value:function(){return this.camera}},{key:"setCamera",value:function(a){this.unbindCameraHandlers(),this.camera=a,this.bindCameraHandlers()}},{key:"getContainer",value:function(){return this.container}},{key:"getGraph",value:function(){return this.graph}},{key:"setGraph",value:function(a){a!==this.graph&&(this.hoveredNode&&!a.hasNode(this.hoveredNode)&&(this.hoveredNode=null),this.hoveredEdge&&!a.hasEdge(this.hoveredEdge)&&(this.hoveredEdge=null),this.unbindGraphHandlers(),this.checkEdgesEventsFrame!==null&&(cancelAnimationFrame(this.checkEdgesEventsFrame),this.checkEdgesEventsFrame=null),this.graph=a,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 a=this.customBBox||this.nodeExtent;return{width:a.x[1]-a.x[0]||1,height:a.y[1]-a.y[0]||1}}},{key:"getNodeDisplayData",value:function(a){var o=this.nodeDataCache[a];return o?Object.assign({},o):void 0}},{key:"getEdgeDisplayData",value:function(a){var o=this.edgeDataCache[a];return o?Object.assign({},o):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 Le({},this.settings)}},{key:"getSetting",value:function(a){return this.settings[a]}},{key:"setSetting",value:function(a,o){var s=Le({},this.settings);return this.settings[a]=o,sp(this.settings),this.handleSettingsUpdate(s),this.scheduleRefresh(),this}},{key:"updateSetting",value:function(a,o){return this.setSetting(a,o(this.settings[a])),this}},{key:"setSettings",value:function(a){var o=Le({},this.settings);return this.settings=Le(Le({},this.settings),a),sp(this.settings),this.handleSettingsUpdate(o),this.scheduleRefresh(),this}},{key:"resize",value:function(a){var o=this.width,s=this.height;if(this.width=this.container.offsetWidth,this.height=this.container.offsetHeight,this.pixelRatio=aw(),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(!a&&o===this.width&&s===this.height)return this;for(var c in this.elements){var u=this.elements[c];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 h in this.webGLContexts){this.elements[h].setAttribute("width",this.width*this.pixelRatio+"px"),this.elements[h].setAttribute("height",this.height*this.pixelRatio+"px");var m=this.webGLContexts[h];if(m.viewport(0,0,this.width*this.pixelRatio,this.height*this.pixelRatio),this.pickingLayers.has(h)){var g=this.textures[h];g&&m.deleteTexture(g)}}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(a){var o=this,s=(a==null?void 0:a.skipIndexation)!==void 0?a==null?void 0:a.skipIndexation:!1,c=(a==null?void 0:a.schedule)!==void 0?a.schedule:!1,u=!a||!a.partialGraph;if(u)this.clearEdgeIndices(),this.clearNodeIndices(),this.graph.forEachNode(function(D){return o.addNode(D)}),this.graph.forEachEdge(function(D){return o.addEdge(D)});else{for(var f,h,m=((f=a.partialGraph)===null||f===void 0?void 0:f.nodes)||[],g=0,y=(m==null?void 0:m.length)||0;g1&&arguments[1]!==void 0?arguments[1]:{},s=!!o.cameraState||!!o.viewportDimensions||!!o.graphDimensions,c=o.matrix?o.matrix:s?Ks(o.cameraState||this.camera.getState(),o.viewportDimensions||this.getDimensions(),o.graphDimensions||this.getGraphDimensions(),o.padding||this.getStagePadding()):this.matrix,u=bm(c,a);return{x:(1+u.x)*this.width/2,y:(1-u.y)*this.height/2}}},{key:"viewportToFramedGraph",value:function(a){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},s=!!o.cameraState||!!o.viewportDimensions||!o.graphDimensions,c=o.matrix?o.matrix:s?Ks(o.cameraState||this.camera.getState(),o.viewportDimensions||this.getDimensions(),o.graphDimensions||this.getGraphDimensions(),o.padding||this.getStagePadding(),!0):this.invMatrix,u=bm(c,{x:a.x/this.width*2-1,y:1-a.y/this.height*2});return isNaN(u.x)&&(u.x=0),isNaN(u.y)&&(u.y=0),u}},{key:"viewportToGraph",value:function(a){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return this.normalizationFunction.inverse(this.viewportToFramedGraph(a,o))}},{key:"graphToViewport",value:function(a){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return this.framedGraphToViewport(this.normalizationFunction(a),o)}},{key:"getGraphToViewportRatio",value:function(){var a={x:0,y:0},o={x:1,y:1},s=Math.sqrt(Math.pow(a.x-o.x,2)+Math.pow(a.y-o.y,2)),c=this.graphToViewport(a),u=this.graphToViewport(o),f=Math.sqrt(Math.pow(c.x-u.x,2)+Math.pow(c.y-u.y,2));return f/s}},{key:"getBBox",value:function(){return this.nodeExtent}},{key:"getCustomBBox",value:function(){return this.customBBox}},{key:"setCustomBBox",value:function(a){return this.customBBox=a,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 a=this.container;a.firstChild;)a.removeChild(a.firstChild);this.canvasContexts={},this.webGLContexts={},this.elements={};for(var o in this.nodePrograms)this.nodePrograms[o].kill();for(var s in this.nodeHoverPrograms)this.nodeHoverPrograms[s].kill();for(var c in this.edgePrograms)this.edgePrograms[c].kill();this.nodePrograms={},this.nodeHoverPrograms={},this.edgePrograms={};for(var u in this.elements)this.killLayer(u)}},{key:"scaleSize",value:function(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:1,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.camera.ratio;return a/this.settings.zoomToSizeRatioFunction(o)*(this.getSetting("itemSizesReference")==="positions"?o*this.graphToViewportRatio:1)}},{key:"getCanvases",value:function(){var a={};for(var o in this.elements)this.elements[o]instanceof HTMLCanvasElement&&(a[o]=this.elements[o]);return a}}])}(kg);const U_=w.createContext(null),hG=U_.Provider;function Ng(){const e=w.useContext(U_);if(e==null)throw new Error("No context provided: useSigmaContext() can only be used in a descendant of ");return e}function Kn(){return Ng().sigma}function B_(){const{sigma:e}=Ng();return w.useCallback(t=>{e&&Object.keys(t).forEach(n=>{e.setSetting(n,t[n])})},[e])}function pd(e){return new Set(Object.keys(e))}const fw=pd({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}),hw=pd({click:!0,rightClick:!0,doubleClick:!0,mouseup:!0,mousedown:!0,mousemove:!0,mousemovebody:!0,mouseleave:!0,mouseenter:!0,wheel:!0}),pw=pd({touchup:!0,touchdown:!0,touchmove:!0,touchmovebody:!0,tap:!0,doubletap:!0}),mw=pd({updated:!0});function I_(){const e=Kn(),t=B_(),[n,a]=w.useState({});return w.useEffect(()=>{if(!e||!n)return;const o=n,s=Object.keys(o);return s.forEach(c=>{const u=o[c];fw.has(c)&&e.on(c,u),hw.has(c)&&e.getMouseCaptor().on(c,u),pw.has(c)&&e.getTouchCaptor().on(c,u),mw.has(c)&&e.getCamera().on(c,u)}),()=>{e&&s.forEach(c=>{const u=o[c];fw.has(c)&&e.off(c,u),hw.has(c)&&e.getMouseCaptor().off(c,u),pw.has(c)&&e.getTouchCaptor().off(c,u),mw.has(c)&&e.getCamera().off(c,u)})}},[e,n,t]),a}function pG(){const e=Kn();return w.useCallback((t,n=!0)=>{e&&t&&(n&&e.getGraph().order>0&&e.getGraph().clear(),e.getGraph().import(t),e.refresh())},[e])}function Cl(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)||!Cl(e[n],t[n]))return!1;return!0}return!1}function H_(e){const t=Kn(),[n,a]=w.useState(e||{});w.useEffect(()=>{a(h=>Cl(h,e||{})?h:e||{})},[e]);const o=w.useCallback(h=>{t.getCamera().animatedZoom(Object.assign(Object.assign({},n),h))},[t,n]),s=w.useCallback(h=>{t.getCamera().animatedUnzoom(Object.assign(Object.assign({},n),h))},[t,n]),c=w.useCallback(h=>{t.getCamera().animatedReset(Object.assign(Object.assign({},n),h))},[t,n]),u=w.useCallback((h,m)=>{t.getCamera().animate(h,Object.assign(Object.assign({},n),m))},[t,n]),f=w.useCallback((h,m)=>{const g=t.getNodeDisplayData(h);g?t.getCamera().animate(g,Object.assign(Object.assign({},n),m)):console.warn(`Node ${h} not found`)},[t,n]);return{zoomIn:o,zoomOut:s,reset:c,goto:u,gotoNode:f}}function mG(e){const t=Ng(),[n,a]=w.useState(!1),[o,s]=w.useState(t.container),c=w.useCallback(()=>a(u=>!u),[]);return w.useEffect(()=>(document.addEventListener("fullscreenchange",c),()=>document.removeEventListener("fullscreenchange",c)),[c]),w.useEffect(()=>{s(t.container)},[e,t.container]),{toggle:w.useCallback(()=>{var u;u=o,document.fullscreenElement!==u?u.requestFullscreen():document.exitFullscreen&&document.exitFullscreen()},[o]),isFullScreen:n}}const gG=w.forwardRef(({graph:e,id:t,className:n,style:a,settings:o={},children:s},c)=>{const u=w.useRef(null),f=w.useRef(null),h={className:`react-sigma ${n||""}`,id:t,style:a},[m,g]=w.useState(null),[y,b]=w.useState(o);w.useEffect(()=>{b(_=>Cl(_,o)?_:o)},[o]),w.useEffect(()=>{g(_=>{let N=null;if(f.current!==null){let T=new ft;e&&(T=typeof e=="function"?new e:e);let A=null;_&&(A=_.getCamera().getState(),_.kill()),N=new fG(T,f.current,y),A&&N.getCamera().setState(A)}return N})},[f,e,y]),w.useImperativeHandle(c,()=>m,[m]);const S=w.useMemo(()=>m&&u.current?{sigma:m,container:u.current}:null,[m,u]),E=S!==null?ve.createElement(hG,{value:S},s):null;return ve.createElement("div",Object.assign({},h,{ref:u}),ve.createElement("div",{className:"sigma-container",ref:f}),E)});var vG=` -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 -} -`,yG=vG,bG=` -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; -} -`,xG=bG,$_=WebGLRenderingContext,gw=$_.UNSIGNED_BYTE,vw=$_.FLOAT,wG=["u_sizeRatio","u_pixelRatio","u_matrix"],EG=function(e){function t(){return $t(this,t),En(this,t,arguments)}return Sn(t,e),Vt(t,[{key:"getDefinition",value:function(){return{VERTICES:1,VERTEX_SHADER_SOURCE:xG,FRAGMENT_SHADER_SOURCE:yG,METHOD:WebGLRenderingContext.POINTS,UNIFORMS:wG,ATTRIBUTES:[{name:"a_position",size:2,type:vw},{name:"a_size",size:1,type:vw},{name:"a_color",size:4,type:gw,normalized:!0},{name:"a_id",size:4,type:gw,normalized:!0}]}}},{key:"processVisibleItem",value:function(a,o,s){var c=this.array;c[o++]=s.x,c[o++]=s.y,c[o++]=s.size,c[o++]=Ar(s.color),c[o++]=a}},{key:"setUniforms",value:function(a,o){var s=a.sizeRatio,c=a.pixelRatio,u=a.matrix,f=o.gl,h=o.uniformLocations,m=h.u_sizeRatio,g=h.u_pixelRatio,y=h.u_matrix;f.uniform1f(g,c),f.uniform1f(m,s),f.uniformMatrix3fv(y,!1,u)}}])}(Rg),SG=` -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; -} -`,_G=SG,V_=WebGLRenderingContext,yw=V_.UNSIGNED_BYTE,Kr=V_.FLOAT,TG=["u_matrix","u_zoomRatio","u_sizeRatio","u_correctionRatio","u_pixelRatio","u_feather","u_minEdgeThickness","u_lengthToThicknessRatio"],CG={lengthToThicknessRatio:Tl.lengthToThicknessRatio};function q_(e){var t=Le(Le({},CG),{});return function(n){function a(){return $t(this,a),En(this,a,arguments)}return Sn(a,n),Vt(a,[{key:"getDefinition",value:function(){return{VERTICES:6,VERTEX_SHADER_SOURCE:_G,FRAGMENT_SHADER_SOURCE:Ag,METHOD:WebGLRenderingContext.TRIANGLES,UNIFORMS:TG,ATTRIBUTES:[{name:"a_positionStart",size:2,type:Kr},{name:"a_positionEnd",size:2,type:Kr},{name:"a_normal",size:2,type:Kr},{name:"a_color",size:4,type:yw,normalized:!0},{name:"a_id",size:4,type:yw,normalized:!0},{name:"a_sourceRadius",size:1,type:Kr},{name:"a_targetRadius",size:1,type:Kr}],CONSTANT_ATTRIBUTES:[{name:"a_positionCoef",size:1,type:Kr},{name:"a_normalCoef",size:1,type:Kr},{name:"a_sourceRadiusCoef",size:1,type:Kr},{name:"a_targetRadiusCoef",size:1,type:Kr}],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(s,c,u,f,h){var m=h.size||1,g=u.x,y=u.y,b=f.x,S=f.y,E=Ar(h.color),_=b-g,N=S-y,T=u.size||1,A=f.size||1,D=_*_+N*N,k=0,M=0;D&&(D=1/Math.sqrt(D),k=-N*D*m,M=_*D*m);var R=this.array;R[c++]=g,R[c++]=y,R[c++]=b,R[c++]=S,R[c++]=k,R[c++]=M,R[c++]=E,R[c++]=s,R[c++]=T,R[c++]=A}},{key:"setUniforms",value:function(s,c){var u=c.gl,f=c.uniformLocations,h=f.u_matrix,m=f.u_zoomRatio,g=f.u_feather,y=f.u_pixelRatio,b=f.u_correctionRatio,S=f.u_sizeRatio,E=f.u_minEdgeThickness,_=f.u_lengthToThicknessRatio;u.uniformMatrix3fv(h,!1,s.matrix),u.uniform1f(m,s.zoomRatio),u.uniform1f(S,s.sizeRatio),u.uniform1f(b,s.correctionRatio),u.uniform1f(y,s.pixelRatio),u.uniform1f(g,s.antiAliasingFeather),u.uniform1f(E,s.minEdgeThickness),u.uniform1f(_,t.lengthToThicknessRatio)}}])}(Sl)}q_();function RG(e){return A_([q_(),ku(e),ku(Le(Le({},e),{},{extremity:"source"}))])}RG();function AG(e){if(Array.isArray(e))return e}function kG(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var a,o,s,c,u=[],f=!0,h=!1;try{if(s=(n=n.call(e)).next,t!==0)for(;!(f=(a=s.call(n)).done)&&(u.push(a.value),u.length!==t);f=!0);}catch(m){h=!0,o=m}finally{try{if(!f&&n.return!=null&&(c=n.return(),Object(c)!==c))return}finally{if(h)throw o}}return u}}function wm(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,a=Array(t);n v_radius) - gl_FragColor = transparent; - else { - gl_FragColor = v_color; - gl_FragColor.a *= bias; - } - #else - // Sizes: -`).concat(t.flatMap(function(o,s){var c=o.size;if("fill"in c)return[];c=c;var u="attribute"in c?"v_borderSize_".concat(s+1):X0(c.value),f=(c.mode||IG)==="pixels"?"u_correctionRatio":"v_radius";return[" float borderSize_".concat(s+1," = ").concat(f," * ").concat(u,";")]}).join(` -`),` - // Now, let's split the remaining space between "fill" borders: - float fillBorderSize = (v_radius - (`).concat(t.flatMap(function(o,s){var c=o.size;return"fill"in c?[]:["borderSize_".concat(s+1)]}).join(" + "),") ) / ").concat(n,`; -`).concat(t.flatMap(function(o,s){var c=o.size;return"fill"in c?[" float borderSize_".concat(s+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(o,s){return" float adjustedBorderSize_".concat(s+1," = adjustedBorderSize_").concat(s," - borderSize_").concat(s+1,";")}).join(` -`),` - - // Colors: - vec4 borderColor_0 = transparent; -`).concat(t.map(function(o,s){var c=o.color,u=[];return"attribute"in c?u.push(" vec4 borderColor_".concat(s+1," = v_borderColor_").concat(s+1,";")):"transparent"in c?u.push(" vec4 borderColor_".concat(s+1," = vec4(0.0, 0.0, 0.0, 0.0);")):u.push(" vec4 borderColor_".concat(s+1," = u_borderColor_").concat(s+1,";")),u.push(" borderColor_".concat(s+1,".a *= bias;")),u.push(" if (borderSize_".concat(s+1," <= 1.0 * u_correctionRatio) { borderColor_").concat(s+1," = borderColor_").concat(s,"; }")),u.join(` -`)}).join(` -`),` - if (dist > adjustedBorderSize_0) { - gl_FragColor = borderColor_0; - } else `).concat(t.map(function(o,s){return"if (dist > adjustedBorderSize_".concat(s,` - aaBorder) { - gl_FragColor = mix(borderColor_`).concat(s+1,", borderColor_").concat(s,", (dist - adjustedBorderSize_").concat(s,` + aaBorder) / aaBorder); - } else if (dist > adjustedBorderSize_`).concat(s+1,`) { - gl_FragColor = borderColor_`).concat(s+1,`; - } else `)}).join(""),` { /* Nothing to add here */ } - #endif -} -`);return a}function qG(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(a,o){var s=a.size;return"attribute"in s?["attribute float a_borderSize_".concat(o+1,";"),"varying float v_borderSize_".concat(o+1,";")]:[]}).join(` -`),` -`).concat(t.flatMap(function(a,o){var s=a.color;return"attribute"in s?["attribute vec4 a_borderColor_".concat(o+1,";"),"varying vec4 v_borderColor_".concat(o+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(a,o){var s=a.size;return"attribute"in s?[" v_borderSize_".concat(o+1," = a_borderSize_").concat(o+1,";")]:[]}).join(` -`),` -`).concat(t.flatMap(function(a,o){var s=a.color;return"attribute"in s?[" v_borderColor_".concat(o+1," = a_borderColor_").concat(o+1,";")]:[]}).join(` -`),` - #endif -} -`);return n}var K_=WebGLRenderingContext,ww=K_.UNSIGNED_BYTE,Jc=K_.FLOAT;function YG(e){var t,n=xw(xw({},HG),{}),a=n.borders,o=n.drawLabel,s=n.drawHover,c=["u_sizeRatio","u_correctionRatio","u_matrix"].concat(cp(a.flatMap(function(u,f){var h=u.color;return"value"in h?["u_borderColor_".concat(f+1)]:[]})));return t=function(u){GG(f,u);function f(){var h;OG(this,f);for(var m=arguments.length,g=new Array(m),y=0;ye.length)&&(t=e.length);for(var n=0,a=Array(t);n$){var W="…";for(E=E+W,O=s.measureText(E).width;O>$&&E.length>1;)E=E.slice(0,-2)+W,O=s.measureText(E).width;if(E.length<4)return}for(var re={},de=0,ie=E.length;de{const n=this.nodeIdMap[t];if(n!==void 0)return this.nodes[n]});Xr(this,"getEdge",(t,n=!0)=>{const a=n?this.edgeDynamicIdMap[t]:this.edgeIdMap[t];if(a!==void 0)return this.edges[a]});Xr(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})})),ct=Km(p3),m3=({node:e,move:t})=>{const n=Kn(),{gotoNode:a}=H_();return w.useEffect(()=>{if(e)return n.getGraph().setNodeAttribute(e,"highlighted",!0),t&&(a(e),ct.getState().setMoveToSelectedNode(!1)),()=>{n.getGraph().setNodeAttribute(e,"highlighted",!1)}},[e,t,n,a]),null};function Yo(e,t){const n=Kn(),a=w.useRef(t);return Cl(a.current,t)||(a.current=t),{positions:w.useCallback(()=>a.current?e(n.getGraph(),a.current):{},[n,a,e]),assign:w.useCallback(()=>{a.current&&e.assign(n.getGraph(),a.current)},[n,a,e])}}function jg(e,t){const n=Kn(),[a,o]=w.useState(!1),[s,c]=w.useState(null),u=w.useRef(t);return Cl(u.current,t)||(u.current=t),w.useEffect(()=>{o(!1);let f=null;return u.current&&(f=new e(n.getGraph(),u.current)),c(f),()=>{f!==null&&f.kill()}},[n,u,c,o,e]),{stop:w.useCallback(()=>{s&&(s.stop(),o(!1))},[s,o]),start:w.useCallback(()=>{s&&(s.start(),o(!0))},[s,o]),kill:w.useCallback(()=>{s&&s.kill(),o(!1)},[s,o]),isRunning:a}}var dp,_w;function Rl(){if(_w)return dp;_w=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,a){n=n||{};var o={};for(var s in a){var c=n[s],u=a[s];if(!e(u)){o[s]=t(c,u);continue}c===void 0?o[s]=u:o[s]=c}return o}return dp=t,dp}var fp,Tw;function g3(){if(Tw)return fp;Tw=1;function e(n){return function(a,o){return a+Math.floor(n()*(o-a+1))}}var t=e(Math.random);return t.createRandom=e,fp=t,fp}var hp,Cw;function v3(){if(Cw)return hp;Cw=1;var e=g3().createRandom;function t(a){var o=e(a);return function(s){for(var c=s.length,u=c-1,f=-1;++f0},o.prototype.addChild=function(R,U){this.children[R]=U,++this.countChildren},o.prototype.getChild=function(R){if(!this.children.hasOwnProperty(R)){var U=new o;this.children[R]=U,++this.countChildren}return this.children[R]},o.prototype.applyPositionToChildren=function(){if(this.hasChildren()){var R=this;for(var U in R.children){var L=R.children[U];L.x+=R.x,L.y+=R.y,L.applyPositionToChildren()}}};function s(R,U,L){for(var I in U.children){var q=U.children[I];q.hasChildren()?s(R,q,L):L[q.id]={x:q.x,y:q.y}}}function c(R,U){var L=R.r-U.r,I=U.x-R.x,q=U.y-R.y;return L<0||L*L0&&L*L>I*I+q*q}function f(R,U){for(var L=0;Lne?(q=(F+ne-Y)/(2*F),X=Math.sqrt(Math.max(0,ne/F-q*q)),L.x=R.x-q*I-X*B,L.y=R.y-q*B+X*I):(q=(F+Y-ne)/(2*F),X=Math.sqrt(Math.max(0,Y/F-q*q)),L.x=U.x+q*I-X*B,L.y=U.y+q*B+X*I)):(L.x=U.x+L.r,L.y=U.y)}function N(R,U){var L=R.r+U.r-1e-6,I=U.x-R.x,q=U.y-R.y;return L>0&&L*L>I*I+q*q}function T(R,U){var L=R.length;if(L===0)return 0;var I,q,Y,B,X,ne,F,z,j,K;if(I=R[0],I.x=0,I.y=0,L<=1)return I.r;if(q=R[1],I.x=-q.r,q.x=I.r,q.y=0,L<=2)return I.r+q.r;Y=R[2],_(q,I,Y),I=new o(null,null,null,null,I),q=new o(null,null,null,null,q),Y=new o(null,null,null,null,Y),I.next=Y.previous=q,q.next=I.previous=Y,Y.next=q.previous=I;e:for(ne=3;ne"u"?o:h};typeof o=="function"&&(c=o);var u=function(h){return c(h[a])},f=function(){return c(void 0)};return typeof a=="string"?(s.fromAttributes=u,s.fromGraph=function(h,m){return u(h.getNodeAttributes(m))},s.fromEntry=function(h,m){return u(m)}):typeof a=="function"?(s.fromAttributes=function(){throw new Error("graphology-utils/getters/createNodeValueGetter: irrelevant usage.")},s.fromGraph=function(h,m){return c(a(m,h.getNodeAttributes(m)))},s.fromEntry=function(h,m){return c(a(h,m))}):(s.fromAttributes=f,s.fromGraph=f,s.fromEntry=f),s}function n(a,o){var s={},c=function(h){return typeof h>"u"?o:h};typeof o=="function"&&(c=o);var u=function(h){return c(h[a])},f=function(){return c(void 0)};return typeof a=="string"?(s.fromAttributes=u,s.fromGraph=function(h,m){return u(h.getEdgeAttributes(m))},s.fromEntry=function(h,m){return u(m)},s.fromPartialEntry=s.fromEntry,s.fromMinimalEntry=s.fromEntry):typeof a=="function"?(s.fromAttributes=function(){throw new Error("graphology-utils/getters/createEdgeValueGetter: irrelevant usage.")},s.fromGraph=function(h,m){var g=h.extremities(m);return c(a(m,h.getEdgeAttributes(m),g[0],g[1],h.getNodeAttributes(g[0]),h.getNodeAttributes(g[1]),h.isUndirected(m)))},s.fromEntry=function(h,m,g,y,b,S,E){return c(a(h,m,g,y,b,S,E))},s.fromPartialEntry=function(h,m,g,y){return c(a(h,m,g,y))},s.fromMinimalEntry=function(h,m){return c(a(h,m))}):(s.fromAttributes=f,s.fromGraph=f,s.fromEntry=f,s.fromMinimalEntry=f),s}return Js.createNodeValueGetter=t,Js.createEdgeValueGetter=n,Js.createEdgeWeightGetter=function(a){return n(a,e)},Js}var gp,Dw;function aT(){if(Dw)return gp;Dw=1;const{createNodeValueGetter:e,createEdgeValueGetter:t}=Lg();return gp=function(a,o,s){const{nodeXAttribute:c,nodeYAttribute:u}=s,{attraction:f,repulsion:h,gravity:m,inertia:g,maxMove:y}=s.settings;let{shouldSkipNode:b,shouldSkipEdge:S,isNodeFixed:E}=s;E=e(E),b=e(b,!1),S=t(S,!1);const _=a.filterNodes((A,D)=>!b.fromEntry(A,D)),N=_.length;for(let A=0;A{if(k===M||b.fromEntry(k,R)||b.fromEntry(M,U)||S.fromEntry(A,D,k,M,R,U,L))return;const I=o[k],q=o[M],Y=q.x-I.x,B=q.y-I.y,X=Math.sqrt(Y*Y+B*B)||1,ne=f*X*Y,F=f*X*B;I.dx+=ne,I.dy+=F,q.dx-=ne,q.dy-=F}),m)for(let A=0;Ay&&(k.dx*=y/M,k.dy*=y/M),E.fromGraph(a,D)?k.fixed=!0:(k.x+=k.dx,k.y+=k.dy,k.fixed=!1)}return{converged:T}},gp}var eu={},Nw;function iT(){return Nw||(Nw=1,eu.assignLayoutChanges=function(e,t,n){const{nodeXAttribute:a,nodeYAttribute:o}=n;e.updateEachNodeAttributes((s,c)=>{const u=t[s];return!u||u.fixed||(c[a]=u.x,c[o]=u.y),c},{attributes:["x","y"]})},eu.collectLayoutChanges=function(e){const t={};for(const n in e){const a=e[n];t[n]={x:a.x,y:a.y}}return t}),eu}var vp,Ow;function oT(){return Ow||(Ow=1,vp={nodeXAttribute:"x",nodeYAttribute:"y",isNodeFixed:"fixed",shouldSkipNode:null,shouldSkipEdge:null,settings:{attraction:5e-4,repulsion:.1,gravity:1e-4,inertia:.6,maxMove:200}}),vp}var yp,jw;function C3(){if(jw)return yp;jw=1;const e=kr(),t=Rl(),n=aT(),a=iT(),o=oT();function s(u,f,h){if(!e(f))throw new Error("graphology-layout-force: the given graph is not a valid graphology instance.");typeof h=="number"?h={maxIterations:h}:h=h||{};const m=h.maxIterations;if(h=t(h,o),typeof m!="number"||m<=0)throw new Error("graphology-layout-force: you should provide a positive number of maximum iterations.");const g={};let y=null,b;for(b=0;bthis.runFrame())},s.prototype.stop=function(){return this.running=!1,this.frameID!==null&&(window.cancelAnimationFrame(this.frameID),this.frameID=null),this},s.prototype.start=function(){if(this.killed)throw new Error("graphology-layout-force/worker.start: layout was killed.");this.running||(this.running=!0,this.runFrame())},s.prototype.kill=function(){this.stop(),delete this.nodeStates,this.killed=!0},bp=s,bp}var D3=k3();const N3=dn(D3);function O3(e={maxIterations:100}){return Yo(A3,e)}function j3(e={}){return jg(N3,e)}var xp,zw;function L3(){if(zw)return xp;zw=1;var e=0,t=1,n=2,a=3,o=4,s=5,c=6,u=7,f=8,h=9,m=0,g=1,y=2,b=0,S=1,E=2,_=3,N=4,T=5,A=6,D=7,k=8,M=3,R=10,U=3,L=9,I=10;return xp=function(Y,B,X){var ne,F,z,j,K,G,H,O,$,W,re=B.length,de=X.length,ie=Y.adjustSizes,oe=Y.barnesHutTheta*Y.barnesHutTheta,Te,he,Se,be,je,Ce,ye,J=[];for(z=0;zAe?(pe-=(me-Ae)/2,Ee=pe+me):(le-=(Ae-me)/2,_e=le+Ae),J[0+b]=-1,J[0+S]=(le+_e)/2,J[0+E]=(pe+Ee)/2,J[0+_]=Math.max(_e-le,Ee-pe),J[0+N]=-1,J[0+T]=-1,J[0+A]=0,J[0+D]=0,J[0+k]=0,ne=1,z=0;z=0){B[z+e]=0)if(Ce=Math.pow(B[z+e]-J[F+D],2)+Math.pow(B[z+t]-J[F+k],2),W=J[F+_],4*W*W/Ce0?(ye=he*B[z+c]*J[F+A]/Ce,B[z+n]+=Se*ye,B[z+a]+=be*ye):Ce<0&&(ye=-he*B[z+c]*J[F+A]/Math.sqrt(Ce),B[z+n]+=Se*ye,B[z+a]+=be*ye):Ce>0&&(ye=he*B[z+c]*J[F+A]/Ce,B[z+n]+=Se*ye,B[z+a]+=be*ye),F=J[F+N],F<0)break;continue}else{F=J[F+T];continue}else{if(G=J[F+b],G>=0&&G!==z&&(Se=B[z+e]-B[G+e],be=B[z+t]-B[G+t],Ce=Se*Se+be*be,ie===!0?Ce>0?(ye=he*B[z+c]*B[G+c]/Ce,B[z+n]+=Se*ye,B[z+a]+=be*ye):Ce<0&&(ye=-he*B[z+c]*B[G+c]/Math.sqrt(Ce),B[z+n]+=Se*ye,B[z+a]+=be*ye):Ce>0&&(ye=he*B[z+c]*B[G+c]/Ce,B[z+n]+=Se*ye,B[z+a]+=be*ye)),F=J[F+N],F<0)break;continue}else for(he=Y.scalingRatio,j=0;j0?(ye=he*B[j+c]*B[K+c]/Ce/Ce,B[j+n]+=Se*ye,B[j+a]+=be*ye,B[K+n]-=Se*ye,B[K+a]-=be*ye):Ce<0&&(ye=100*he*B[j+c]*B[K+c],B[j+n]+=Se*ye,B[j+a]+=be*ye,B[K+n]-=Se*ye,B[K+a]-=be*ye)):(Ce=Math.sqrt(Se*Se+be*be),Ce>0&&(ye=he*B[j+c]*B[K+c]/Ce/Ce,B[j+n]+=Se*ye,B[j+a]+=be*ye,B[K+n]-=Se*ye,B[K+a]-=be*ye));for($=Y.gravity/Y.scalingRatio,he=Y.scalingRatio,z=0;z0&&(ye=he*B[z+c]*$):Ce>0&&(ye=he*B[z+c]*$/Ce),B[z+n]-=Se*ye,B[z+a]-=be*ye;for(he=1*(Y.outboundAttractionDistribution?Te:1),H=0;H0&&(ye=-he*je*Math.log(1+Ce)/Ce/B[j+c]):Ce>0&&(ye=-he*je*Math.log(1+Ce)/Ce):Y.outboundAttractionDistribution?Ce>0&&(ye=-he*je/B[j+c]):Ce>0&&(ye=-he*je)):(Ce=Math.sqrt(Math.pow(Se,2)+Math.pow(be,2)),Y.linLogMode?Y.outboundAttractionDistribution?Ce>0&&(ye=-he*je*Math.log(1+Ce)/Ce/B[j+c]):Ce>0&&(ye=-he*je*Math.log(1+Ce)/Ce):Y.outboundAttractionDistribution?(Ce=1,ye=-he*je/B[j+c]):(Ce=1,ye=-he*je)),Ce>0&&(B[j+n]+=Se*ye,B[j+a]+=be*ye,B[K+n]-=Se*ye,B[K+a]-=be*ye);var Oe,He,it,Tt,bt,qt;if(ie===!0)for(z=0;zI&&(B[z+n]=B[z+n]*I/Oe,B[z+a]=B[z+a]*I/Oe),He=B[z+c]*Math.sqrt((B[z+o]-B[z+n])*(B[z+o]-B[z+n])+(B[z+s]-B[z+a])*(B[z+s]-B[z+a])),it=Math.sqrt((B[z+o]+B[z+n])*(B[z+o]+B[z+n])+(B[z+s]+B[z+a])*(B[z+s]+B[z+a]))/2,Tt=.1*Math.log(1+it)/(1+Math.sqrt(He)),bt=B[z+e]+B[z+n]*(Tt/Y.slowDown),B[z+e]=bt,qt=B[z+t]+B[z+a]*(Tt/Y.slowDown),B[z+t]=qt);else for(z=0;z=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},Zr.graphToByteArrays=function(n,a){var o=n.order,s=n.size,c={},u,f=new Float32Array(o*e),h=new Float32Array(s*t);return u=0,n.forEachNode(function(m,g){c[m]=u,f[u]=g.x,f[u+1]=g.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]=g.size||1,f[u+9]=g.fixed?1:0,u+=e}),u=0,n.forEachEdge(function(m,g,y,b,S,E,_){var N=c[y],T=c[b],A=a(m,g,y,b,S,E,_);f[N+6]+=A,f[T+6]+=A,h[u]=N,h[u+1]=T,h[u+2]=A,u+=t}),{nodes:f,edges:h}},Zr.assignLayoutChanges=function(n,a,o){var s=0;n.updateEachNodeAttributes(function(c,u){return u.x=a[s],u.y=a[s+1],s+=e,o?o(c,u):u})},Zr.readGraphPositions=function(n,a){var o=0;n.forEachNode(function(s,c){a[o]=c.x,a[o+1]=c.y,o+=e})},Zr.collectLayoutChanges=function(n,a,o){for(var s=n.nodes(),c={},u=0,f=0,h=a.length;u2e3,strongGravityMode:!0,gravity:.05,scalingRatio:10,slowDown:1+Math.log(h)}}var u=s.bind(null,!1);return u.assign=s.bind(null,!0),u.inferSettings=c,Ep=u,Ep}var M3=z3();const P3=dn(M3);var Sp,Fw;function G3(){return Fw||(Fw=1,Sp=function(){var t,n,a={};(function(){var s=0,c=1,u=2,f=3,h=4,m=5,g=6,y=7,b=8,S=9,E=0,_=1,N=2,T=0,A=1,D=2,k=3,M=4,R=5,U=6,L=7,I=8,q=3,Y=10,B=3,X=9,ne=10;a.exports=function(z,j,K){var G,H,O,$,W,re,de,ie,oe,Te,he=j.length,Se=K.length,be=z.adjustSizes,je=z.barnesHutTheta*z.barnesHutTheta,Ce,ye,J,le,_e,pe,Ee,te=[];for(O=0;Obt?(me-=(Tt-bt)/2,Ae=me+Tt):(Fe-=(bt-Tt)/2,Pe=Fe+bt),te[0+T]=-1,te[0+A]=(Fe+Pe)/2,te[0+D]=(me+Ae)/2,te[0+k]=Math.max(Pe-Fe,Ae-me),te[0+M]=-1,te[0+R]=-1,te[0+U]=0,te[0+L]=0,te[0+I]=0,G=1,O=0;O=0){j[O+s]=0)if(pe=Math.pow(j[O+s]-te[H+L],2)+Math.pow(j[O+c]-te[H+I],2),Te=te[H+k],4*Te*Te/pe0?(Ee=ye*j[O+g]*te[H+U]/pe,j[O+u]+=J*Ee,j[O+f]+=le*Ee):pe<0&&(Ee=-ye*j[O+g]*te[H+U]/Math.sqrt(pe),j[O+u]+=J*Ee,j[O+f]+=le*Ee):pe>0&&(Ee=ye*j[O+g]*te[H+U]/pe,j[O+u]+=J*Ee,j[O+f]+=le*Ee),H=te[H+M],H<0)break;continue}else{H=te[H+R];continue}else{if(re=te[H+T],re>=0&&re!==O&&(J=j[O+s]-j[re+s],le=j[O+c]-j[re+c],pe=J*J+le*le,be===!0?pe>0?(Ee=ye*j[O+g]*j[re+g]/pe,j[O+u]+=J*Ee,j[O+f]+=le*Ee):pe<0&&(Ee=-ye*j[O+g]*j[re+g]/Math.sqrt(pe),j[O+u]+=J*Ee,j[O+f]+=le*Ee):pe>0&&(Ee=ye*j[O+g]*j[re+g]/pe,j[O+u]+=J*Ee,j[O+f]+=le*Ee)),H=te[H+M],H<0)break;continue}else for(ye=z.scalingRatio,$=0;$0?(Ee=ye*j[$+g]*j[W+g]/pe/pe,j[$+u]+=J*Ee,j[$+f]+=le*Ee,j[W+u]-=J*Ee,j[W+f]-=le*Ee):pe<0&&(Ee=100*ye*j[$+g]*j[W+g],j[$+u]+=J*Ee,j[$+f]+=le*Ee,j[W+u]-=J*Ee,j[W+f]-=le*Ee)):(pe=Math.sqrt(J*J+le*le),pe>0&&(Ee=ye*j[$+g]*j[W+g]/pe/pe,j[$+u]+=J*Ee,j[$+f]+=le*Ee,j[W+u]-=J*Ee,j[W+f]-=le*Ee));for(oe=z.gravity/z.scalingRatio,ye=z.scalingRatio,O=0;O0&&(Ee=ye*j[O+g]*oe):pe>0&&(Ee=ye*j[O+g]*oe/pe),j[O+u]-=J*Ee,j[O+f]-=le*Ee;for(ye=1*(z.outboundAttractionDistribution?Ce:1),de=0;de0&&(Ee=-ye*_e*Math.log(1+pe)/pe/j[$+g]):pe>0&&(Ee=-ye*_e*Math.log(1+pe)/pe):z.outboundAttractionDistribution?pe>0&&(Ee=-ye*_e/j[$+g]):pe>0&&(Ee=-ye*_e)):(pe=Math.sqrt(Math.pow(J,2)+Math.pow(le,2)),z.linLogMode?z.outboundAttractionDistribution?pe>0&&(Ee=-ye*_e*Math.log(1+pe)/pe/j[$+g]):pe>0&&(Ee=-ye*_e*Math.log(1+pe)/pe):z.outboundAttractionDistribution?(pe=1,Ee=-ye*_e/j[$+g]):(pe=1,Ee=-ye*_e)),pe>0&&(j[$+u]+=J*Ee,j[$+f]+=le*Ee,j[W+u]-=J*Ee,j[W+f]-=le*Ee);var qt,fn,Gt,rt,Tn,xt;if(be===!0)for(O=0;One&&(j[O+u]=j[O+u]*ne/qt,j[O+f]=j[O+f]*ne/qt),fn=j[O+g]*Math.sqrt((j[O+h]-j[O+u])*(j[O+h]-j[O+u])+(j[O+m]-j[O+f])*(j[O+m]-j[O+f])),Gt=Math.sqrt((j[O+h]+j[O+u])*(j[O+h]+j[O+u])+(j[O+m]+j[O+f])*(j[O+m]+j[O+f]))/2,rt=.1*Math.log(1+Gt)/(1+Math.sqrt(fn)),Tn=j[O+s]+j[O+u]*(rt/z.slowDown),j[O+s]=Tn,xt=j[O+c]+j[O+f]*(rt/z.slowDown),j[O+c]=xt);else for(O=0;O1&&Se.has(Ee))&&(j>1&&Se.add(Ee),ye=f[je+e],le=f[je+t],pe=f[je+n],te=ye-Ce,Fe=le-J,Pe=Math.sqrt(te*te+Fe*Fe),me=Pe<_e*m+h+(pe*m+h),me&&(D=!1,je=je/a|0,Pe>0?(R[je]+=te/Pe*(1+_e),U[je]+=Fe/Pe*(1+_e)):(R[je]+=B*s(),U[je]+=X*s())));for(S=0,E=0;S1&&ye.has(me))&&(O>1&&ye.add(me),pe=y[le+o],te=y[le+s],Pe=y[le+c],Ae=pe-_e,Oe=te-Ee,He=Math.sqrt(Ae*Ae+Oe*Oe),it=He0?(q[le]+=Ae/He*(1+Fe),Y[le]+=Oe/He*(1+Fe)):(q[le]+=z*h(),Y[le]+=j*h())));for(T=0,A=0;T=0;)g=Cm(e,t,n,a,h+1,s+1,c),g>m&&(h===o?g*=Ww:l5.test(e.charAt(h-1))?(g*=a5,b=e.slice(o,h-1).match(c5),b&&o>0&&(g*=Math.pow(Op,b.length))):u5.test(e.charAt(h-1))?(g*=r5,S=e.slice(o,h-1).match(fT),S&&o>0&&(g*=Math.pow(Op,S.length))):(g*=i5,o>0&&(g*=Math.pow(Op,h-o))),e.charAt(h)!==t.charAt(s)&&(g*=o5)),(gg&&(g=y*Np)),g>m&&(m=g),h=n.indexOf(f,h+1);return c[u]=m,m}function Xw(e){return e.toLowerCase().replace(fT," ")}function d5(e,t,n){return e=n&&n.length>0?`${e+" "+n.join(" ")}`:e,Cm(e,t,Xw(e),Xw(t),0,0,{})}var zg="Dialog",[hT,n6]=fr(zg),[f5,hr]=hT(zg),pT=e=>{const{__scopeDialog:t,children:n,open:a,defaultOpen:o,onOpenChange:s,modal:c=!0}=e,u=w.useRef(null),f=w.useRef(null),[h=!1,m]=oa({prop:a,defaultProp:o,onChange:s});return x.jsx(f5,{scope:t,triggerRef:u,contentRef:f,contentId:an(),titleId:an(),descriptionId:an(),open:h,onOpenChange:m,onOpenToggle:w.useCallback(()=>m(g=>!g),[m]),modal:c,children:n})};pT.displayName=zg;var mT="DialogTrigger",gT=w.forwardRef((e,t)=>{const{__scopeDialog:n,...a}=e,o=hr(mT,n),s=at(t,o.triggerRef);return x.jsx(Ie.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":Gg(o.open),...a,ref:s,onClick:Be(e.onClick,o.onOpenToggle)})});gT.displayName=mT;var Mg="DialogPortal",[h5,vT]=hT(Mg,{forceMount:void 0}),yT=e=>{const{__scopeDialog:t,forceMount:n,children:a,container:o}=e,s=hr(Mg,t);return x.jsx(h5,{scope:t,forceMount:n,children:w.Children.map(a,c=>x.jsx(Ln,{present:n||s.open,children:x.jsx(nd,{asChild:!0,container:o,children:c})}))})};yT.displayName=Mg;var ju="DialogOverlay",bT=w.forwardRef((e,t)=>{const n=vT(ju,e.__scopeDialog),{forceMount:a=n.forceMount,...o}=e,s=hr(ju,e.__scopeDialog);return s.modal?x.jsx(Ln,{present:a||s.open,children:x.jsx(p5,{...o,ref:t})}):null});bT.displayName=ju;var p5=w.forwardRef((e,t)=>{const{__scopeDialog:n,...a}=e,o=hr(ju,n);return x.jsx(ad,{as:Ua,allowPinchZoom:!0,shards:[o.contentRef],children:x.jsx(Ie.div,{"data-state":Gg(o.open),...a,ref:t,style:{pointerEvents:"auto",...a.style}})})}),Ci="DialogContent",xT=w.forwardRef((e,t)=>{const n=vT(Ci,e.__scopeDialog),{forceMount:a=n.forceMount,...o}=e,s=hr(Ci,e.__scopeDialog);return x.jsx(Ln,{present:a||s.open,children:s.modal?x.jsx(m5,{...o,ref:t}):x.jsx(g5,{...o,ref:t})})});xT.displayName=Ci;var m5=w.forwardRef((e,t)=>{const n=hr(Ci,e.__scopeDialog),a=w.useRef(null),o=at(t,n.contentRef,a);return w.useEffect(()=>{const s=a.current;if(s)return mg(s)},[]),x.jsx(wT,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Be(e.onCloseAutoFocus,s=>{var c;s.preventDefault(),(c=n.triggerRef.current)==null||c.focus()}),onPointerDownOutside:Be(e.onPointerDownOutside,s=>{const c=s.detail.originalEvent,u=c.button===0&&c.ctrlKey===!0;(c.button===2||u)&&s.preventDefault()}),onFocusOutside:Be(e.onFocusOutside,s=>s.preventDefault())})}),g5=w.forwardRef((e,t)=>{const n=hr(Ci,e.__scopeDialog),a=w.useRef(!1),o=w.useRef(!1);return x.jsx(wT,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:s=>{var c,u;(c=e.onCloseAutoFocus)==null||c.call(e,s),s.defaultPrevented||(a.current||(u=n.triggerRef.current)==null||u.focus(),s.preventDefault()),a.current=!1,o.current=!1},onInteractOutside:s=>{var f,h;(f=e.onInteractOutside)==null||f.call(e,s),s.defaultPrevented||(a.current=!0,s.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const c=s.target;((h=n.triggerRef.current)==null?void 0:h.contains(c))&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&o.current&&s.preventDefault()}})}),wT=w.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:a,onOpenAutoFocus:o,onCloseAutoFocus:s,...c}=e,u=hr(Ci,n),f=w.useRef(null),h=at(t,f);return ng(),x.jsxs(x.Fragment,{children:[x.jsx(Zu,{asChild:!0,loop:!0,trapped:a,onMountAutoFocus:o,onUnmountAutoFocus:s,children:x.jsx(bl,{role:"dialog",id:u.contentId,"aria-describedby":u.descriptionId,"aria-labelledby":u.titleId,"data-state":Gg(u.open),...c,ref:h,onDismiss:()=>u.onOpenChange(!1)})}),x.jsxs(x.Fragment,{children:[x.jsx(v5,{titleId:u.titleId}),x.jsx(b5,{contentRef:f,descriptionId:u.descriptionId})]})]})}),Pg="DialogTitle",ET=w.forwardRef((e,t)=>{const{__scopeDialog:n,...a}=e,o=hr(Pg,n);return x.jsx(Ie.h2,{id:o.titleId,...a,ref:t})});ET.displayName=Pg;var ST="DialogDescription",_T=w.forwardRef((e,t)=>{const{__scopeDialog:n,...a}=e,o=hr(ST,n);return x.jsx(Ie.p,{id:o.descriptionId,...a,ref:t})});_T.displayName=ST;var TT="DialogClose",CT=w.forwardRef((e,t)=>{const{__scopeDialog:n,...a}=e,o=hr(TT,n);return x.jsx(Ie.button,{type:"button",...a,ref:t,onClick:Be(e.onClick,()=>o.onOpenChange(!1))})});CT.displayName=TT;function Gg(e){return e?"open":"closed"}var RT="DialogTitleWarning",[r6,AT]=YO(RT,{contentName:Ci,titleName:Pg,docsSlug:"dialog"}),v5=({titleId:e})=>{const t=AT(RT),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 w.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},y5="DialogDescriptionWarning",b5=({contentRef:e,descriptionId:t})=>{const a=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${AT(y5).contentName}}.`;return w.useEffect(()=>{var s;const o=(s=e.current)==null?void 0:s.getAttribute("aria-describedby");t&&o&&(document.getElementById(t)||console.warn(a))},[a,e,t]),null},kT=pT,x5=gT,DT=yT,Fg=bT,Ug=xT,NT=ET,OT=_T,w5=CT,jp={exports:{}},Lp={};/** - * @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 Kw;function E5(){if(Kw)return Lp;Kw=1;var e=$u();function t(g,y){return g===y&&(g!==0||1/g===1/y)||g!==g&&y!==y}var n=typeof Object.is=="function"?Object.is:t,a=e.useState,o=e.useEffect,s=e.useLayoutEffect,c=e.useDebugValue;function u(g,y){var b=y(),S=a({inst:{value:b,getSnapshot:y}}),E=S[0].inst,_=S[1];return s(function(){E.value=b,E.getSnapshot=y,f(E)&&_({inst:E})},[g,b,y]),o(function(){return f(E)&&_({inst:E}),g(function(){f(E)&&_({inst:E})})},[g]),c(b),b}function f(g){var y=g.getSnapshot;g=g.value;try{var b=y();return!n(g,b)}catch{return!0}}function h(g,y){return y()}var m=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?h:u;return Lp.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:m,Lp}var Zw;function S5(){return Zw||(Zw=1,jp.exports=E5()),jp.exports}var _5=S5(),el='[cmdk-group=""]',zp='[cmdk-group-items=""]',T5='[cmdk-group-heading=""]',Bg='[cmdk-item=""]',Qw=`${Bg}:not([aria-disabled="true"])`,Rm="cmdk-item-select",bi="data-value",C5=(e,t,n)=>d5(e,t,n),jT=w.createContext(void 0),Al=()=>w.useContext(jT),LT=w.createContext(void 0),Ig=()=>w.useContext(LT),zT=w.createContext(void 0),MT=w.forwardRef((e,t)=>{let n=So(()=>{var O,$;return{search:"",value:($=(O=e.value)!=null?O:e.defaultValue)!=null?$:"",filtered:{count:0,items:new Map,groups:new Set}}}),a=So(()=>new Set),o=So(()=>new Map),s=So(()=>new Map),c=So(()=>new Set),u=PT(e),{label:f,children:h,value:m,onValueChange:g,filter:y,shouldFilter:b,loop:S,disablePointerSelection:E=!1,vimBindings:_=!0,...N}=e,T=an(),A=an(),D=an(),k=w.useRef(null),M=P5();Ri(()=>{if(m!==void 0){let O=m.trim();n.current.value=O,R.emit()}},[m]),Ri(()=>{M(6,B)},[]);let R=w.useMemo(()=>({subscribe:O=>(c.current.add(O),()=>c.current.delete(O)),snapshot:()=>n.current,setState:(O,$,W)=>{var re,de,ie;if(!Object.is(n.current[O],$)){if(n.current[O]=$,O==="search")Y(),I(),M(1,q);else if(O==="value"&&(W||M(5,B),((re=u.current)==null?void 0:re.value)!==void 0)){let oe=$??"";(ie=(de=u.current).onValueChange)==null||ie.call(de,oe);return}R.emit()}},emit:()=>{c.current.forEach(O=>O())}}),[]),U=w.useMemo(()=>({value:(O,$,W)=>{var re;$!==((re=s.current.get(O))==null?void 0:re.value)&&(s.current.set(O,{value:$,keywords:W}),n.current.filtered.items.set(O,L($,W)),M(2,()=>{I(),R.emit()}))},item:(O,$)=>(a.current.add(O),$&&(o.current.has($)?o.current.get($).add(O):o.current.set($,new Set([O]))),M(3,()=>{Y(),I(),n.current.value||q(),R.emit()}),()=>{s.current.delete(O),a.current.delete(O),n.current.filtered.items.delete(O);let W=X();M(4,()=>{Y(),(W==null?void 0:W.getAttribute("id"))===O&&q(),R.emit()})}),group:O=>(o.current.has(O)||o.current.set(O,new Set),()=>{s.current.delete(O),o.current.delete(O)}),filter:()=>u.current.shouldFilter,label:f||e["aria-label"],getDisablePointerSelection:()=>u.current.disablePointerSelection,listId:T,inputId:D,labelId:A,listInnerRef:k}),[]);function L(O,$){var W,re;let de=(re=(W=u.current)==null?void 0:W.filter)!=null?re:C5;return O?de(O,n.current.search,$):0}function I(){if(!n.current.search||u.current.shouldFilter===!1)return;let O=n.current.filtered.items,$=[];n.current.filtered.groups.forEach(re=>{let de=o.current.get(re),ie=0;de.forEach(oe=>{let Te=O.get(oe);ie=Math.max(Te,ie)}),$.push([re,ie])});let W=k.current;ne().sort((re,de)=>{var ie,oe;let Te=re.getAttribute("id"),he=de.getAttribute("id");return((ie=O.get(he))!=null?ie:0)-((oe=O.get(Te))!=null?oe:0)}).forEach(re=>{let de=re.closest(zp);de?de.appendChild(re.parentElement===de?re:re.closest(`${zp} > *`)):W.appendChild(re.parentElement===W?re:re.closest(`${zp} > *`))}),$.sort((re,de)=>de[1]-re[1]).forEach(re=>{var de;let ie=(de=k.current)==null?void 0:de.querySelector(`${el}[${bi}="${encodeURIComponent(re[0])}"]`);ie==null||ie.parentElement.appendChild(ie)})}function q(){let O=ne().find(W=>W.getAttribute("aria-disabled")!=="true"),$=O==null?void 0:O.getAttribute(bi);R.setState("value",$||void 0)}function Y(){var O,$,W,re;if(!n.current.search||u.current.shouldFilter===!1){n.current.filtered.count=a.current.size;return}n.current.filtered.groups=new Set;let de=0;for(let ie of a.current){let oe=($=(O=s.current.get(ie))==null?void 0:O.value)!=null?$:"",Te=(re=(W=s.current.get(ie))==null?void 0:W.keywords)!=null?re:[],he=L(oe,Te);n.current.filtered.items.set(ie,he),he>0&&de++}for(let[ie,oe]of o.current)for(let Te of oe)if(n.current.filtered.items.get(Te)>0){n.current.filtered.groups.add(ie);break}n.current.filtered.count=de}function B(){var O,$,W;let re=X();re&&(((O=re.parentElement)==null?void 0:O.firstChild)===re&&((W=($=re.closest(el))==null?void 0:$.querySelector(T5))==null||W.scrollIntoView({block:"nearest"})),re.scrollIntoView({block:"nearest"}))}function X(){var O;return(O=k.current)==null?void 0:O.querySelector(`${Bg}[aria-selected="true"]`)}function ne(){var O;return Array.from(((O=k.current)==null?void 0:O.querySelectorAll(Qw))||[])}function F(O){let $=ne()[O];$&&R.setState("value",$.getAttribute(bi))}function z(O){var $;let W=X(),re=ne(),de=re.findIndex(oe=>oe===W),ie=re[de+O];($=u.current)!=null&&$.loop&&(ie=de+O<0?re[re.length-1]:de+O===re.length?re[0]:re[de+O]),ie&&R.setState("value",ie.getAttribute(bi))}function j(O){let $=X(),W=$==null?void 0:$.closest(el),re;for(;W&&!re;)W=O>0?z5(W,el):M5(W,el),re=W==null?void 0:W.querySelector(Qw);re?R.setState("value",re.getAttribute(bi)):z(O)}let K=()=>F(ne().length-1),G=O=>{O.preventDefault(),O.metaKey?K():O.altKey?j(1):z(1)},H=O=>{O.preventDefault(),O.metaKey?F(0):O.altKey?j(-1):z(-1)};return w.createElement(Ie.div,{ref:t,tabIndex:-1,...N,"cmdk-root":"",onKeyDown:O=>{var $;if(($=N.onKeyDown)==null||$.call(N,O),!O.defaultPrevented)switch(O.key){case"n":case"j":{_&&O.ctrlKey&&G(O);break}case"ArrowDown":{G(O);break}case"p":case"k":{_&&O.ctrlKey&&H(O);break}case"ArrowUp":{H(O);break}case"Home":{O.preventDefault(),F(0);break}case"End":{O.preventDefault(),K();break}case"Enter":if(!O.nativeEvent.isComposing&&O.keyCode!==229){O.preventDefault();let W=X();if(W){let re=new Event(Rm);W.dispatchEvent(re)}}}}},w.createElement("label",{"cmdk-label":"",htmlFor:U.inputId,id:U.labelId,style:F5},f),md(e,O=>w.createElement(LT.Provider,{value:R},w.createElement(jT.Provider,{value:U},O))))}),R5=w.forwardRef((e,t)=>{var n,a;let o=an(),s=w.useRef(null),c=w.useContext(zT),u=Al(),f=PT(e),h=(a=(n=f.current)==null?void 0:n.forceMount)!=null?a:c==null?void 0:c.forceMount;Ri(()=>{if(!h)return u.item(o,c==null?void 0:c.id)},[h]);let m=GT(o,s,[e.value,e.children,s],e.keywords),g=Ig(),y=Ai(M=>M.value&&M.value===m.current),b=Ai(M=>h||u.filter()===!1?!0:M.search?M.filtered.items.get(o)>0:!0);w.useEffect(()=>{let M=s.current;if(!(!M||e.disabled))return M.addEventListener(Rm,S),()=>M.removeEventListener(Rm,S)},[b,e.onSelect,e.disabled]);function S(){var M,R;E(),(R=(M=f.current).onSelect)==null||R.call(M,m.current)}function E(){g.setState("value",m.current,!0)}if(!b)return null;let{disabled:_,value:N,onSelect:T,forceMount:A,keywords:D,...k}=e;return w.createElement(Ie.div,{ref:ul([s,t]),...k,id:o,"cmdk-item":"",role:"option","aria-disabled":!!_,"aria-selected":!!y,"data-disabled":!!_,"data-selected":!!y,onPointerMove:_||u.getDisablePointerSelection()?void 0:E,onClick:_?void 0:S},e.children)}),A5=w.forwardRef((e,t)=>{let{heading:n,children:a,forceMount:o,...s}=e,c=an(),u=w.useRef(null),f=w.useRef(null),h=an(),m=Al(),g=Ai(b=>o||m.filter()===!1?!0:b.search?b.filtered.groups.has(c):!0);Ri(()=>m.group(c),[]),GT(c,u,[e.value,e.heading,f]);let y=w.useMemo(()=>({id:c,forceMount:o}),[o]);return w.createElement(Ie.div,{ref:ul([u,t]),...s,"cmdk-group":"",role:"presentation",hidden:g?void 0:!0},n&&w.createElement("div",{ref:f,"cmdk-group-heading":"","aria-hidden":!0,id:h},n),md(e,b=>w.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?h:void 0},w.createElement(zT.Provider,{value:y},b))))}),k5=w.forwardRef((e,t)=>{let{alwaysRender:n,...a}=e,o=w.useRef(null),s=Ai(c=>!c.search);return!n&&!s?null:w.createElement(Ie.div,{ref:ul([o,t]),...a,"cmdk-separator":"",role:"separator"})}),D5=w.forwardRef((e,t)=>{let{onValueChange:n,...a}=e,o=e.value!=null,s=Ig(),c=Ai(m=>m.search),u=Ai(m=>m.value),f=Al(),h=w.useMemo(()=>{var m;let g=(m=f.listInnerRef.current)==null?void 0:m.querySelector(`${Bg}[${bi}="${encodeURIComponent(u)}"]`);return g==null?void 0:g.getAttribute("id")},[]);return w.useEffect(()=>{e.value!=null&&s.setState("search",e.value)},[e.value]),w.createElement(Ie.input,{ref:t,...a,"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":h,id:f.inputId,type:"text",value:o?e.value:c,onChange:m=>{o||s.setState("search",m.target.value),n==null||n(m.target.value)}})}),N5=w.forwardRef((e,t)=>{let{children:n,label:a="Suggestions",...o}=e,s=w.useRef(null),c=w.useRef(null),u=Al();return w.useEffect(()=>{if(c.current&&s.current){let f=c.current,h=s.current,m,g=new ResizeObserver(()=>{m=requestAnimationFrame(()=>{let y=f.offsetHeight;h.style.setProperty("--cmdk-list-height",y.toFixed(1)+"px")})});return g.observe(f),()=>{cancelAnimationFrame(m),g.unobserve(f)}}},[]),w.createElement(Ie.div,{ref:ul([s,t]),...o,"cmdk-list":"",role:"listbox","aria-label":a,id:u.listId},md(e,f=>w.createElement("div",{ref:ul([c,u.listInnerRef]),"cmdk-list-sizer":""},f)))}),O5=w.forwardRef((e,t)=>{let{open:n,onOpenChange:a,overlayClassName:o,contentClassName:s,container:c,...u}=e;return w.createElement(kT,{open:n,onOpenChange:a},w.createElement(DT,{container:c},w.createElement(Fg,{"cmdk-overlay":"",className:o}),w.createElement(Ug,{"aria-label":e.label,"cmdk-dialog":"",className:s},w.createElement(MT,{ref:t,...u}))))}),j5=w.forwardRef((e,t)=>Ai(n=>n.filtered.count===0)?w.createElement(Ie.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),L5=w.forwardRef((e,t)=>{let{progress:n,children:a,label:o="Loading...",...s}=e;return w.createElement(Ie.div,{ref:t,...s,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":o},md(e,c=>w.createElement("div",{"aria-hidden":!0},c)))}),_n=Object.assign(MT,{List:N5,Item:R5,Input:D5,Group:A5,Separator:k5,Dialog:O5,Empty:j5,Loading:L5});function z5(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function M5(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function PT(e){let t=w.useRef(e);return Ri(()=>{t.current=e}),t}var Ri=typeof window>"u"?w.useEffect:w.useLayoutEffect;function So(e){let t=w.useRef();return t.current===void 0&&(t.current=e()),t}function ul(e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}function Ai(e){let t=Ig(),n=()=>e(t.snapshot());return _5.useSyncExternalStore(t.subscribe,n,n)}function GT(e,t,n,a=[]){let o=w.useRef(),s=Al();return Ri(()=>{var c;let u=(()=>{var h;for(let m of n){if(typeof m=="string")return m.trim();if(typeof m=="object"&&"current"in m)return m.current?(h=m.current.textContent)==null?void 0:h.trim():o.current}})(),f=a.map(h=>h.trim());s.value(e,u,f),(c=t.current)==null||c.setAttribute(bi,u),o.current=u}),o}var P5=()=>{let[e,t]=w.useState(),n=So(()=>new Map);return Ri(()=>{n.current.forEach(a=>a()),n.current=new Map},[e]),(a,o)=>{n.current.set(a,o),t({})}};function G5(e){let t=e.type;return typeof t=="function"?t(e.props):"render"in t?t.render(e.props):e}function md({asChild:e,children:t},n){return e&&w.isValidElement(t)?w.cloneElement(G5(t),{ref:t.ref},n(t.props.children)):n(t)}var F5={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};const FT=kT,UT=x5,U5=DT,BT=w.forwardRef(({className:e,...t},n)=>x.jsx(Fg,{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}));BT.displayName=Fg.displayName;const Hg=w.forwardRef(({className:e,children:t,...n},a)=>x.jsxs(U5,{children:[x.jsx(BT,{}),x.jsxs(Ug,{ref:a,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,x.jsxs(w5,{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:[x.jsx(OE,{className:"h-4 w-4"}),x.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));Hg.displayName=Ug.displayName;const $g=({className:e,...t})=>x.jsx("div",{className:Me("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});$g.displayName="DialogHeader";const Vg=w.forwardRef(({className:e,...t},n)=>x.jsx(NT,{ref:n,className:Me("text-lg leading-none font-semibold tracking-tight",e),...t}));Vg.displayName=NT.displayName;const qg=w.forwardRef(({className:e,...t},n)=>x.jsx(OT,{ref:n,className:Me("text-muted-foreground text-sm",e),...t}));qg.displayName=OT.displayName;const gd=w.forwardRef(({className:e,...t},n)=>x.jsx(_n,{ref:n,className:Me("bg-popover text-popover-foreground flex h-full w-full flex-col overflow-hidden rounded-md",e),...t}));gd.displayName=_n.displayName;const Yg=w.forwardRef(({className:e,...t},n)=>x.jsxs("div",{className:"flex items-center border-b px-3","cmdk-input-wrapper":"",children:[x.jsx(NO,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),x.jsx(_n.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})]}));Yg.displayName=_n.Input.displayName;const vd=w.forwardRef(({className:e,...t},n)=>x.jsx(_n.List,{ref:n,className:Me("max-h-[300px] overflow-x-hidden overflow-y-auto",e),...t}));vd.displayName=_n.List.displayName;const Wg=w.forwardRef((e,t)=>x.jsx(_n.Empty,{ref:t,className:"py-6 text-center text-sm",...e}));Wg.displayName=_n.Empty.displayName;const Wo=w.forwardRef(({className:e,...t},n)=>x.jsx(_n.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}));Wo.displayName=_n.Group.displayName;const B5=w.forwardRef(({className:e,...t},n)=>x.jsx(_n.Separator,{ref:n,className:Me("bg-border -mx-1 h-px",e),...t}));B5.displayName=_n.Separator.displayName;const Xo=w.forwardRef(({className:e,...t},n)=>x.jsx(_n.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}));Xo.displayName=_n.Item.displayName;const I5=({layout:e,autoRunFor:t})=>{const n=Kn(),{stop:a,start:o,isRunning:s}=e;return w.useEffect(()=>{if(!n)return;let c=null;return t!==void 0&&t>-1&&n.getGraph().order>0&&(o(),c=t>0?window.setTimeout(()=>{a()},t):null),()=>{a(),c&&clearTimeout(c)}},[t,o,a,n]),x.jsx(_t,{size:"icon",onClick:()=>s?a():o(),tooltip:s?"Stop the layout animation":"Start the layout animation",variant:_r,children:s?x.jsx(TO,{}):x.jsx(RO,{})})},H5=()=>{const e=Kn(),[t,n]=w.useState("Circular"),[a,o]=w.useState(!1),s=T3(),c=w3(),u=n5(),f=Z3({settings:{margin:1}}),h=O3({maxIterations:20}),m=cT({iterations:20}),g=Q3(),y=j3(),b=I3(),S=w.useMemo(()=>({Circular:{layout:s},Circlepack:{layout:c},Random:{layout:u},Noverlaps:{layout:f,worker:g},"Force Directed":{layout:h,worker:y},"Force Atlas":{layout:m,worker:b}}),[c,s,h,m,f,u,y,g,b]),E=w.useCallback(_=>{console.debug(_);const{positions:N}=S[_].layout;U4(e.getGraph(),N(),{duration:500}),n(_)},[S,e]);return x.jsxs(x.Fragment,{children:[x.jsx("div",{children:S[t]&&"worker"in S[t]&&x.jsx(I5,{layout:S[t].worker})}),x.jsx("div",{children:x.jsxs(id,{open:a,onOpenChange:o,children:[x.jsx(od,{asChild:!0,children:x.jsx(_t,{size:"icon",variant:_r,onClick:()=>o(_=>!_),tooltip:"Layout Graph",children:x.jsx(pO,{})})}),x.jsx(El,{side:"right",align:"center",className:"p-1",children:x.jsx(gd,{children:x.jsx(vd,{children:x.jsx(Wo,{children:Object.keys(S).map(_=>x.jsx(Xo,{onSelect:()=>{E(_)},className:"cursor-pointer text-xs",children:_},_))})})})})]})})]})};var mu={exports:{}},$5=mu.exports,Jw;function V5(){return Jw||(Jw=1,function(e){(function(t,n,a){function o(f){var h=this,m=u();h.next=function(){var g=2091639*h.s0+h.c*23283064365386963e-26;return h.s0=h.s1,h.s1=h.s2,h.s2=g-(h.c=g|0)},h.c=1,h.s0=m(" "),h.s1=m(" "),h.s2=m(" "),h.s0-=m(f),h.s0<0&&(h.s0+=1),h.s1-=m(f),h.s1<0&&(h.s1+=1),h.s2-=m(f),h.s2<0&&(h.s2+=1),m=null}function s(f,h){return h.c=f.c,h.s0=f.s0,h.s1=f.s1,h.s2=f.s2,h}function c(f,h){var m=new o(f),g=h&&h.state,y=m.next;return y.int32=function(){return m.next()*4294967296|0},y.double=function(){return y()+(y()*2097152|0)*11102230246251565e-32},y.quick=y,g&&(typeof g=="object"&&s(g,m),y.state=function(){return s(m,{})}),y}function u(){var f=4022871197,h=function(m){m=String(m);for(var g=0;g>>0,y-=f,y*=f,f=y>>>0,y-=f,f+=y*4294967296}return(f>>>0)*23283064365386963e-26};return h}n&&n.exports?n.exports=c:this.alea=c})($5,e)}(mu)),mu.exports}var gu={exports:{}},q5=gu.exports,e1;function Y5(){return e1||(e1=1,function(e){(function(t,n,a){function o(u){var f=this,h="";f.x=0,f.y=0,f.z=0,f.w=0,f.next=function(){var g=f.x^f.x<<11;return f.x=f.y,f.y=f.z,f.z=f.w,f.w^=f.w>>>19^g^g>>>8},u===(u|0)?f.x=u:h+=u;for(var m=0;m>>0)/4294967296};return g.double=function(){do var y=h.next()>>>11,b=(h.next()>>>0)/4294967296,S=(y+b)/(1<<21);while(S===0);return S},g.int32=h.next,g.quick=g,m&&(typeof m=="object"&&s(m,h),g.state=function(){return s(h,{})}),g}n&&n.exports?n.exports=c:this.xor128=c})(q5,e)}(gu)),gu.exports}var vu={exports:{}},W5=vu.exports,t1;function X5(){return t1||(t1=1,function(e){(function(t,n,a){function o(u){var f=this,h="";f.next=function(){var g=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^(g^g<<1))|0},f.x=0,f.y=0,f.z=0,f.w=0,f.v=0,u===(u|0)?f.x=u:h+=u;for(var m=0;m>>4),f.next()}function s(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 c(u,f){var h=new o(u),m=f&&f.state,g=function(){return(h.next()>>>0)/4294967296};return g.double=function(){do var y=h.next()>>>11,b=(h.next()>>>0)/4294967296,S=(y+b)/(1<<21);while(S===0);return S},g.int32=h.next,g.quick=g,m&&(typeof m=="object"&&s(m,h),g.state=function(){return s(h,{})}),g}n&&n.exports?n.exports=c:this.xorwow=c})(W5,e)}(vu)),vu.exports}var yu={exports:{}},K5=yu.exports,n1;function Z5(){return n1||(n1=1,function(e){(function(t,n,a){function o(u){var f=this;f.next=function(){var m=f.x,g=f.i,y,b;return y=m[g],y^=y>>>7,b=y^y<<24,y=m[g+1&7],b^=y^y>>>10,y=m[g+3&7],b^=y^y>>>3,y=m[g+4&7],b^=y^y<<7,y=m[g+7&7],y=y^y<<13,b^=y^y<<9,m[g]=b,f.i=g+1&7,b};function h(m,g){var y,b=[];if(g===(g|0))b[0]=g;else for(g=""+g,y=0;y0;--y)m.next()}h(f,u)}function s(u,f){return f.x=u.x.slice(),f.i=u.i,f}function c(u,f){u==null&&(u=+new Date);var h=new o(u),m=f&&f.state,g=function(){return(h.next()>>>0)/4294967296};return g.double=function(){do var y=h.next()>>>11,b=(h.next()>>>0)/4294967296,S=(y+b)/(1<<21);while(S===0);return S},g.int32=h.next,g.quick=g,m&&(m.x&&s(m,h),g.state=function(){return s(h,{})}),g}n&&n.exports?n.exports=c:this.xorshift7=c})(K5,e)}(yu)),yu.exports}var bu={exports:{}},Q5=bu.exports,r1;function J5(){return r1||(r1=1,function(e){(function(t,n,a){function o(u){var f=this;f.next=function(){var m=f.w,g=f.X,y=f.i,b,S;return f.w=m=m+1640531527|0,S=g[y+34&127],b=g[y=y+1&127],S^=S<<13,b^=b<<17,S^=S>>>15,b^=b>>>12,S=g[y]=S^b,f.i=y,S+(m^m>>>16)|0};function h(m,g){var y,b,S,E,_,N=[],T=128;for(g===(g|0)?(b=g,g=null):(g=g+"\0",b=0,T=Math.max(T,g.length)),S=0,E=-32;E>>15,b^=b<<4,b^=b>>>13,E>=0&&(_=_+1640531527|0,y=N[E&127]^=b+_,S=y==0?S+1:0);for(S>=128&&(N[(g&&g.length||0)&127]=-1),S=127,E=4*128;E>0;--E)b=N[S+34&127],y=N[S=S+1&127],b^=b<<13,y^=y<<17,b^=b>>>15,y^=y>>>12,N[S]=b^y;m.w=_,m.X=N,m.i=S}h(f,u)}function s(u,f){return f.i=u.i,f.w=u.w,f.X=u.X.slice(),f}function c(u,f){u==null&&(u=+new Date);var h=new o(u),m=f&&f.state,g=function(){return(h.next()>>>0)/4294967296};return g.double=function(){do var y=h.next()>>>11,b=(h.next()>>>0)/4294967296,S=(y+b)/(1<<21);while(S===0);return S},g.int32=h.next,g.quick=g,m&&(m.X&&s(m,h),g.state=function(){return s(h,{})}),g}n&&n.exports?n.exports=c:this.xor4096=c})(Q5,e)}(bu)),bu.exports}var xu={exports:{}},eF=xu.exports,a1;function tF(){return a1||(a1=1,function(e){(function(t,n,a){function o(u){var f=this,h="";f.next=function(){var g=f.b,y=f.c,b=f.d,S=f.a;return g=g<<25^g>>>7^y,y=y-b|0,b=b<<24^b>>>8^S,S=S-g|0,f.b=g=g<<20^g>>>12^y,f.c=y=y-b|0,f.d=b<<16^y>>>16^S,f.a=S-g|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):h+=u;for(var m=0;m>>0)/4294967296};return g.double=function(){do var y=h.next()>>>11,b=(h.next()>>>0)/4294967296,S=(y+b)/(1<<21);while(S===0);return S},g.int32=h.next,g.quick=g,m&&(typeof m=="object"&&s(m,h),g.state=function(){return s(h,{})}),g}n&&n.exports?n.exports=c:this.tychei=c})(eF,e)}(xu)),xu.exports}var wu={exports:{}};const nF={},rF=Object.freeze(Object.defineProperty({__proto__:null,default:nF},Symbol.toStringTag,{value:"Module"})),aF=HA(rF);var iF=wu.exports,i1;function oF(){return i1||(i1=1,function(e){(function(t,n,a){var o=256,s=6,c=52,u="random",f=a.pow(o,s),h=a.pow(2,c),m=h*2,g=o-1,y;function b(D,k,M){var R=[];k=k==!0?{entropy:!0}:k||{};var U=N(_(k.entropy?[D,A(n)]:D??T(),3),R),L=new S(R),I=function(){for(var q=L.g(s),Y=f,B=0;q=m;)q/=2,Y/=2,B>>>=1;return(q+B)/Y};return I.int32=function(){return L.g(4)|0},I.quick=function(){return L.g(4)/4294967296},I.double=I,N(A(L.S),n),(k.pass||M||function(q,Y,B,X){return X&&(X.S&&E(X,L),q.state=function(){return E(L,{})}),B?(a[u]=q,Y):q})(I,U,"global"in k?k.global:this==a,k.state)}function S(D){var k,M=D.length,R=this,U=0,L=R.i=R.j=0,I=R.S=[];for(M||(D=[M++]);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),a=e.getNode(t.target);if(n==null||a==null)return!1}return!0},dF=async e=>{let t=null;try{t=await GN(e)}catch(a){return Wn.getState().setErrorMessage(Sr(a),"Query Graphs Error!"),null}let n=null;if(t){const a={},o={};for(let f=0;f0){const f=tD-Zx;for(const h of t.nodes)h.size=Math.round(Zx+f*Math.pow((h.degree-s)/u,.5))}n=new h3,n.nodes=t.nodes,n.edges=t.edges,n.nodeIdMap=a,n.edgeIdMap=o,uF(n)||(n=null,console.error("Invalid graph data")),console.log("Graph data loaded")}return n},fF=e=>{const t=new cl;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:Zk,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},s1={label:""},IT=()=>{const e=We.use.queryLabel(),t=ct.use.rawGraph(),n=ct.use.sigmaGraph(),a=w.useCallback(c=>(t==null?void 0:t.getNode(c))||null,[t]),o=w.useCallback((c,u=!0)=>(t==null?void 0:t.getEdge(c,u))||null,[t]);return w.useEffect(()=>{if(e){if(s1.label!==e){s1.label=e;const c=ct.getState();c.reset(),dF(e).then(u=>{c.setSigmaGraph(fF(u)),u==null||u.buildDynamicMap(),c.setRawGraph(u)})}}else{const c=ct.getState();c.reset(),c.setSigmaGraph(new cl)}},[e]),{lightrageGraph:w.useCallback(()=>{if(n)return n;const c=new cl;return ct.getState().setSigmaGraph(c),c},[n]),getNode:a,getEdge:o}},tu=e=>!!(e.type.startsWith("mouse")&&e.buttons!==0),hF=({disableHoverEffect:e})=>{const{lightrageGraph:t}=IT(),n=Kn(),a=I_(),o=B_(),s=pG(),{assign:c}=cT({iterations:20}),{theme:u}=MS(),f=We.use.enableHideUnselectedEdges(),h=ct.use.selectedNode(),m=ct.use.focusedNode(),g=ct.use.selectedEdge(),y=ct.use.focusedEdge();return w.useEffect(()=>{const b=t();s(b),b.__force_applied||(c(),Object.assign(b,{__force_applied:!0}));const{setFocusedNode:S,setSelectedNode:E,setFocusedEdge:_,setSelectedEdge:N,clearSelection:T}=ct.getState();a({enterNode:A=>{tu(A.event.original)||S(A.node)},leaveNode:A=>{tu(A.event.original)||S(null)},clickNode:A=>{E(A.node),N(null)},clickEdge:A=>{N(A.edge),E(null)},enterEdge:A=>{tu(A.event.original)||_(A.edge)},leaveEdge:A=>{tu(A.event.original)||_(null)},clickStage:()=>T()})},[c,s,a,t]),w.useEffect(()=>{const b=u==="dark",S=b?Wk:void 0,E=b?Jk:void 0;o({nodeReducer:(_,N)=>{const T=n.getGraph(),A={...N,highlighted:N.highlighted||!1,labelColor:S};if(!e){A.highlighted=!1;const D=m||h,k=y||g;if(D)(_===D||T.neighbors(D).includes(_))&&(A.highlighted=!0,_===h&&(A.borderColor=Qk));else if(k)T.extremities(k).includes(_)&&(A.highlighted=!0,A.size=3);else return A;A.highlighted?b&&(A.labelColor=Xk):A.color=Kk}return A},edgeReducer:(_,N)=>{const T=n.getGraph(),A={...N,hidden:!1,labelColor:S,color:E};if(!e){const D=m||h;D?f?T.extremities(_).includes(D)||(A.hidden=!0):T.extremities(_).includes(D)&&(A.color=Kx):(y||g)&&(_===g?A.color=eD:_===y?A.color=Kx:f&&(A.hidden=!0))}return A}})},[h,m,g,y,o,n,e,u,f]),null},pF=()=>{const{zoomIn:e,zoomOut:t,reset:n}=H_({duration:200,factor:1.5}),a=w.useCallback(()=>e(),[e]),o=w.useCallback(()=>t(),[t]),s=w.useCallback(()=>n(),[n]);return x.jsxs(x.Fragment,{children:[x.jsx(_t,{variant:_r,onClick:a,tooltip:"Zoom In",size:"icon",children:x.jsx(HO,{})}),x.jsx(_t,{variant:_r,onClick:o,tooltip:"Zoom Out",size:"icon",children:x.jsx(VO,{})}),x.jsx(_t,{variant:_r,onClick:s,tooltip:"Reset Zoom",size:"icon",children:x.jsx(uO,{})})]})},mF=()=>{const{isFullScreen:e,toggle:t}=mG();return x.jsx(x.Fragment,{children:e?x.jsx(_t,{variant:_r,onClick:t,tooltip:"Windowed",size:"icon",children:x.jsx(wO,{})}):x.jsx(_t,{variant:_r,onClick:t,tooltip:"Full Screen",size:"icon",children:x.jsx(bO,{})})})};function HT(e){const t=w.useRef({value:e,previous:e});return w.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var Xg="Checkbox",[gF,a6]=fr(Xg),[vF,yF]=gF(Xg),$T=w.forwardRef((e,t)=>{const{__scopeCheckbox:n,name:a,checked:o,defaultChecked:s,required:c,disabled:u,value:f="on",onCheckedChange:h,form:m,...g}=e,[y,b]=w.useState(null),S=at(t,D=>b(D)),E=w.useRef(!1),_=y?m||!!y.closest("form"):!0,[N=!1,T]=oa({prop:o,defaultProp:s,onChange:h}),A=w.useRef(N);return w.useEffect(()=>{const D=y==null?void 0:y.form;if(D){const k=()=>T(A.current);return D.addEventListener("reset",k),()=>D.removeEventListener("reset",k)}},[y,T]),x.jsxs(vF,{scope:n,state:N,disabled:u,children:[x.jsx(Ie.button,{type:"button",role:"checkbox","aria-checked":Ga(N)?"mixed":N,"aria-required":c,"data-state":YT(N),"data-disabled":u?"":void 0,disabled:u,value:f,...g,ref:S,onKeyDown:Be(e.onKeyDown,D=>{D.key==="Enter"&&D.preventDefault()}),onClick:Be(e.onClick,D=>{T(k=>Ga(k)?!0:!k),_&&(E.current=D.isPropagationStopped(),E.current||D.stopPropagation())})}),_&&x.jsx(bF,{control:y,bubbles:!E.current,name:a,value:f,checked:N,required:c,disabled:u,form:m,style:{transform:"translateX(-100%)"},defaultChecked:Ga(s)?!1:s})]})});$T.displayName=Xg;var VT="CheckboxIndicator",qT=w.forwardRef((e,t)=>{const{__scopeCheckbox:n,forceMount:a,...o}=e,s=yF(VT,n);return x.jsx(Ln,{present:a||Ga(s.state)||s.state===!0,children:x.jsx(Ie.span,{"data-state":YT(s.state),"data-disabled":s.disabled?"":void 0,...o,ref:t,style:{pointerEvents:"none",...e.style}})})});qT.displayName=VT;var bF=e=>{const{control:t,checked:n,bubbles:a=!0,defaultChecked:o,...s}=e,c=w.useRef(null),u=HT(n),f=KE(t);w.useEffect(()=>{const m=c.current,g=window.HTMLInputElement.prototype,b=Object.getOwnPropertyDescriptor(g,"checked").set;if(u!==n&&b){const S=new Event("click",{bubbles:a});m.indeterminate=Ga(n),b.call(m,Ga(n)?!1:n),m.dispatchEvent(S)}},[u,n,a]);const h=w.useRef(Ga(n)?!1:n);return x.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:o??h.current,...s,tabIndex:-1,ref:c,style:{...e.style,...f,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function Ga(e){return e==="indeterminate"}function YT(e){return Ga(e)?"indeterminate":e?"checked":"unchecked"}var WT=$T,xF=qT;const il=w.forwardRef(({className:e,...t},n)=>x.jsx(WT,{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:x.jsx(xF,{className:Me("flex items-center justify-center text-current"),children:x.jsx(eg,{className:"h-4 w-4"})})}));il.displayName=WT.displayName;var wF="Separator",l1="horizontal",EF=["horizontal","vertical"],XT=w.forwardRef((e,t)=>{const{decorative:n,orientation:a=l1,...o}=e,s=SF(a)?a:l1,u=n?{role:"none"}:{"aria-orientation":s==="vertical"?s:void 0,role:"separator"};return x.jsx(Ie.div,{"data-orientation":s,...u,...o,ref:t})});XT.displayName=wF;function SF(e){return EF.includes(e)}var KT=XT;const nl=w.forwardRef(({className:e,orientation:t="horizontal",decorative:n=!0,...a},o)=>x.jsx(KT,{ref:o,decorative:n,orientation:t,className:Me("bg-border shrink-0",t==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",e),...a}));nl.displayName=KT.displayName;const Lo=w.forwardRef(({className:e,type:t,...n},a)=>x.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:a,...n}));Lo.displayName="Input";const La=({checked:e,onCheckedChange:t,label:n})=>x.jsxs("div",{className:"flex items-center gap-2",children:[x.jsx(il,{checked:e,onCheckedChange:t}),x.jsx("label",{htmlFor:"terms",className:"text-sm leading-none font-medium peer-disabled:cursor-not-allowed peer-disabled:opacity-70",children:n})]});function _F(){const[e,t]=w.useState(!1),[n,a]=w.useState(""),o=We.use.showPropertyPanel(),s=We.use.showNodeSearchBar(),c=We.use.showNodeLabel(),u=We.use.enableEdgeEvents(),f=We.use.enableNodeDrag(),h=We.use.enableHideUnselectedEdges(),m=We.use.showEdgeLabel(),g=We.use.enableHealthCheck(),y=We.use.apiKey();w.useEffect(()=>{a(y||"")},[y,e]);const b=w.useCallback(()=>We.setState(R=>({enableNodeDrag:!R.enableNodeDrag})),[]),S=w.useCallback(()=>We.setState(R=>({enableEdgeEvents:!R.enableEdgeEvents})),[]),E=w.useCallback(()=>We.setState(R=>({enableHideUnselectedEdges:!R.enableHideUnselectedEdges})),[]),_=w.useCallback(()=>We.setState(R=>({showEdgeLabel:!R.showEdgeLabel})),[]),N=w.useCallback(()=>We.setState(R=>({showPropertyPanel:!R.showPropertyPanel})),[]),T=w.useCallback(()=>We.setState(R=>({showNodeSearchBar:!R.showNodeSearchBar})),[]),A=w.useCallback(()=>We.setState(R=>({showNodeLabel:!R.showNodeLabel})),[]),D=w.useCallback(()=>We.setState(R=>({enableHealthCheck:!R.enableHealthCheck})),[]),k=w.useCallback(async()=>{We.setState({apiKey:n||null}),await Wn.getState().check(),t(!1)},[n]),M=w.useCallback(R=>{a(R.target.value)},[a]);return x.jsxs(id,{open:e,onOpenChange:t,children:[x.jsx(od,{asChild:!0,children:x.jsx(_t,{variant:_r,tooltip:"Settings",size:"icon",children:x.jsx(zO,{})})}),x.jsx(El,{side:"right",align:"start",className:"mb-2 p-2",onCloseAutoFocus:R=>R.preventDefault(),children:x.jsxs("div",{className:"flex flex-col gap-2",children:[x.jsx(La,{checked:o,onCheckedChange:N,label:"Show Property Panel"}),x.jsx(La,{checked:s,onCheckedChange:T,label:"Show Search Bar"}),x.jsx(nl,{}),x.jsx(La,{checked:c,onCheckedChange:A,label:"Show Node Label"}),x.jsx(La,{checked:f,onCheckedChange:b,label:"Node Draggable"}),x.jsx(nl,{}),x.jsx(La,{checked:m,onCheckedChange:_,label:"Show Edge Label"}),x.jsx(La,{checked:h,onCheckedChange:E,label:"Hide Unselected Edges"}),x.jsx(La,{checked:u,onCheckedChange:S,label:"Edge Events"}),x.jsx(nl,{}),x.jsx(La,{checked:g,onCheckedChange:D,label:"Health Check"}),x.jsx(nl,{}),x.jsxs("div",{className:"flex flex-col gap-2",children:[x.jsx("label",{className:"text-sm font-medium",children:"API Key"}),x.jsxs("form",{className:"flex h-6 gap-2",onSubmit:R=>R.preventDefault(),children:[x.jsx("div",{className:"w-0 flex-1",children:x.jsx(Lo,{type:"password",value:n,onChange:M,placeholder:"Enter your API key",className:"max-h-full w-full min-w-0",autoComplete:"off"})}),x.jsx(_t,{onClick:k,variant:"outline",size:"sm",className:"max-h-full shrink-0",children:"Save"})]})]})]})})]})}function Eu(e,t,n,a){function o(s){return s instanceof n?s:new n(function(c){c(s)})}return new(n||(n=Promise))(function(s,c){function u(m){try{h(a.next(m))}catch(g){c(g)}}function f(m){try{h(a.throw(m))}catch(g){c(g)}}function h(m){m.done?s(m.value):o(m.value).then(u,f)}h((a=a.apply(e,[])).next())})}const TF="ENTRIES",ZT="KEYS",QT="VALUES",Kt="";class Pp{constructor(t,n){const a=t._tree,o=Array.from(a.keys());this.set=t,this._type=n,this._path=o.length>0?[{node:a,keys:o}]:[]}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)===Kt)return{done:!1,value:this.result()};const a=t.get(wo(n));return this._path.push({node:a,keys:Array.from(a.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!==Kt).join("")}value(){return wo(this._path).node.get(Kt)}result(){switch(this._type){case QT:return this.value();case ZT:return this.key();default:return[this.key(),this.value()]}}[Symbol.iterator](){return this}}const wo=e=>e[e.length-1],CF=(e,t,n)=>{const a=new Map;if(t===void 0)return a;const o=t.length+1,s=o+n,c=new Uint8Array(s*o).fill(n+1);for(let u=0;u{const f=s*c;e:for(const h of e.keys())if(h===Kt){const m=o[f-1];m<=n&&a.set(u,[e.get(h),m])}else{let m=s;for(let g=0;gn)continue e}JT(e.get(h),t,n,a,o,m,c,u+h)}};class Pa{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,a]=Lu(this._tree,t.slice(this._prefix.length));if(n===void 0){const[o,s]=Kg(a);for(const c of o.keys())if(c!==Kt&&c.startsWith(s)){const u=new Map;return u.set(c.slice(s.length),o.get(c)),new Pa(u,t)}}return new Pa(n,t)}clear(){this._size=void 0,this._tree.clear()}delete(t){return this._size=void 0,RF(this._tree,t)}entries(){return new Pp(this,TF)}forEach(t){for(const[n,a]of this)t(n,a,this)}fuzzyGet(t,n){return CF(this._tree,t,n)}get(t){const n=Am(this._tree,t);return n!==void 0?n.get(Kt):void 0}has(t){const n=Am(this._tree,t);return n!==void 0&&n.has(Kt)}keys(){return new Pp(this,ZT)}set(t,n){if(typeof t!="string")throw new Error("key must be a string");return this._size=void 0,Gp(this._tree,t).set(Kt,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 a=Gp(this._tree,t);return a.set(Kt,n(a.get(Kt))),this}fetch(t,n){if(typeof t!="string")throw new Error("key must be a string");this._size=void 0;const a=Gp(this._tree,t);let o=a.get(Kt);return o===void 0&&a.set(Kt,o=n()),o}values(){return new Pp(this,QT)}[Symbol.iterator](){return this.entries()}static from(t){const n=new Pa;for(const[a,o]of t)n.set(a,o);return n}static fromObject(t){return Pa.from(Object.entries(t))}}const Lu=(e,t,n=[])=>{if(t.length===0||e==null)return[e,n];for(const a of e.keys())if(a!==Kt&&t.startsWith(a))return n.push([e,a]),Lu(e.get(a),t.slice(a.length),n);return n.push([e,t]),Lu(void 0,"",n)},Am=(e,t)=>{if(t.length===0||e==null)return e;for(const n of e.keys())if(n!==Kt&&t.startsWith(n))return Am(e.get(n),t.slice(n.length))},Gp=(e,t)=>{const n=t.length;e:for(let a=0;e&&a{const[n,a]=Lu(e,t);if(n!==void 0){if(n.delete(Kt),n.size===0)eC(a);else if(n.size===1){const[o,s]=n.entries().next().value;tC(a,o,s)}}},eC=e=>{if(e.length===0)return;const[t,n]=Kg(e);if(t.delete(n),t.size===0)eC(e.slice(0,-1));else if(t.size===1){const[a,o]=t.entries().next().value;a!==Kt&&tC(e.slice(0,-1),a,o)}},tC=(e,t,n)=>{if(e.length===0)return;const[a,o]=Kg(e);a.set(o+t,n),a.delete(o)},Kg=e=>e[e.length-1],Zg="or",nC="and",AF="and_not";class Fa{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?Bp:t.autoVacuum;this._options=Object.assign(Object.assign(Object.assign({},Up),t),{autoVacuum:n,searchOptions:Object.assign(Object.assign({},c1),t.searchOptions||{}),autoSuggestOptions:Object.assign(Object.assign({},jF),t.autoSuggestOptions||{})}),this._index=new Pa,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=Dm,this.addFields(this._options.fields)}add(t){const{extractField:n,tokenize:a,processTerm:o,fields:s,idField:c}=this._options,u=n(t,c);if(u==null)throw new Error(`MiniSearch: document does not have ID field "${c}"`);if(this._idToShortId.has(u))throw new Error(`MiniSearch: duplicate ID ${u}`);const f=this.addDocumentId(u);this.saveStoredFields(f,t);for(const h of s){const m=n(t,h);if(m==null)continue;const g=a(m.toString(),h),y=this._fieldIds[h],b=new Set(g).size;this.addFieldLength(f,y,this._documentCount-1,b);for(const S of g){const E=o(S,h);if(Array.isArray(E))for(const _ of E)this.addTerm(y,f,_);else E&&this.addTerm(y,f,E)}}}addAll(t){for(const n of t)this.add(n)}addAllAsync(t,n={}){const{chunkSize:a=10}=n,o={chunk:[],promise:Promise.resolve()},{chunk:s,promise:c}=t.reduce(({chunk:u,promise:f},h,m)=>(u.push(h),(m+1)%a===0?{chunk:[],promise:f.then(()=>new Promise(g=>setTimeout(g,0))).then(()=>this.addAll(u))}:{chunk:u,promise:f}),o);return c.then(()=>this.addAll(s))}remove(t){const{tokenize:n,processTerm:a,extractField:o,fields:s,idField:c}=this._options,u=o(t,c);if(u==null)throw new Error(`MiniSearch: document does not have ID field "${c}"`);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 h of s){const m=o(t,h);if(m==null)continue;const g=n(m.toString(),h),y=this._fieldIds[h],b=new Set(g).size;this.removeFieldLength(f,y,this._documentCount,b);for(const S of g){const E=a(S,h);if(Array.isArray(E))for(const _ of E)this.removeTerm(y,f,_);else E&&this.removeTerm(y,f,E)}}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 Pa,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((a,o)=>{this.removeFieldLength(n,o,this._documentCount,a)}),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:a,batchWait:o}=this._options.autoVacuum;this.conditionalVacuum({batchSize:a,batchWait:o},{minDirtCount:n,minDirtFactor:t})}discardAll(t){const n=this._options.autoVacuum;try{this._options.autoVacuum=!1;for(const a of t)this.discard(a)}finally{this._options.autoVacuum=n}this.maybeAutoVacuum()}replace(t){const{idField:n,extractField:a}=this._options,o=a(t,n);this.discard(o),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 a=this._enqueuedVacuumConditions;return this._enqueuedVacuumConditions=Dm,this.performVacuuming(t,a)}),this._enqueuedVacuum)):this.vacuumConditionsMet(n)===!1?Promise.resolve():(this._currentVacuum=this.performVacuuming(t),this._currentVacuum)}performVacuuming(t,n){return Eu(this,void 0,void 0,function*(){const a=this._dirtCount;if(this.vacuumConditionsMet(n)){const o=t.batchSize||km.batchSize,s=t.batchWait||km.batchWait;let c=1;for(const[u,f]of this._index){for(const[h,m]of f)for(const[g]of m)this._documentIds.has(g)||(m.size<=1?f.delete(h):m.delete(g));this._index.get(u).size===0&&this._index.delete(u),c%o===0&&(yield new Promise(h=>setTimeout(h,s))),c+=1}this._dirtCount-=a}yield null,this._currentVacuum=this._enqueuedVacuum,this._enqueuedVacuum=null})}vacuumConditionsMet(t){if(t==null)return!0;let{minDirtCount:n,minDirtFactor:a}=t;return n=n||Bp.minDirtCount,a=a||Bp.minDirtFactor,this.dirtCount>=n&&this.dirtFactor>=a}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:a}=this._options,o=Object.assign(Object.assign({},a),n),s=this.executeQuery(t,n),c=[];for(const[u,{score:f,terms:h,match:m}]of s){const g=h.length||1,y={id:this._documentIds.get(u),score:f*g,terms:Object.keys(m),queryTerms:h,match:m};Object.assign(y,this._storedFields.get(u)),(o.filter==null||o.filter(y))&&c.push(y)}return t===Fa.wildcard&&o.boostDocument==null||c.sort(d1),c}autoSuggest(t,n={}){n=Object.assign(Object.assign({},this._options.autoSuggestOptions),n);const a=new Map;for(const{score:s,terms:c}of this.search(t,n)){const u=c.join(" "),f=a.get(u);f!=null?(f.score+=s,f.count+=1):a.set(u,{score:s,terms:c,count:1})}const o=[];for(const[s,{score:c,terms:u,count:f}]of a)o.push({suggestion:s,terms:u,score:c/f});return o.sort(d1),o}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 Eu(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(Up.hasOwnProperty(t))return Fp(Up,t);throw new Error(`MiniSearch: unknown option "${t}"`)}static loadJS(t,n){const{index:a,documentIds:o,fieldLength:s,storedFields:c,serializationVersion:u}=t,f=this.instantiateMiniSearch(t,n);f._documentIds=nu(o),f._fieldLength=nu(s),f._storedFields=nu(c);for(const[h,m]of f._documentIds)f._idToShortId.set(m,h);for(const[h,m]of a){const g=new Map;for(const y of Object.keys(m)){let b=m[y];u===1&&(b=b.ds),g.set(parseInt(y,10),nu(b))}f._index.set(h,g)}return f}static loadJSAsync(t,n){return Eu(this,void 0,void 0,function*(){const{index:a,documentIds:o,fieldLength:s,storedFields:c,serializationVersion:u}=t,f=this.instantiateMiniSearch(t,n);f._documentIds=yield ru(o),f._fieldLength=yield ru(s),f._storedFields=yield ru(c);for(const[m,g]of f._documentIds)f._idToShortId.set(g,m);let h=0;for(const[m,g]of a){const y=new Map;for(const b of Object.keys(g)){let S=g[b];u===1&&(S=S.ds),y.set(parseInt(b,10),yield ru(S))}++h%1e3===0&&(yield rC(0)),f._index.set(m,y)}return f})}static instantiateMiniSearch(t,n){const{documentCount:a,nextId:o,fieldIds:s,averageFieldLength:c,dirtCount:u,serializationVersion:f}=t;if(f!==1&&f!==2)throw new Error("MiniSearch: cannot deserialize an index created with an incompatible version");const h=new Fa(n);return h._documentCount=a,h._nextId=o,h._idToShortId=new Map,h._fieldIds=s,h._avgFieldLength=c,h._dirtCount=u||0,h._index=new Pa,h}executeQuery(t,n={}){if(t===Fa.wildcard)return this.executeWildcardQuery(n);if(typeof t!="string"){const y=Object.assign(Object.assign(Object.assign({},n),t),{queries:void 0}),b=t.queries.map(S=>this.executeQuery(S,y));return this.combineResults(b,y.combineWith)}const{tokenize:a,processTerm:o,searchOptions:s}=this._options,c=Object.assign(Object.assign({tokenize:a,processTerm:o},s),n),{tokenize:u,processTerm:f}=c,g=u(t).flatMap(y=>f(y)).filter(y=>!!y).map(OF(c)).map(y=>this.executeQuerySpec(y,c));return this.combineResults(g,c.combineWith)}executeQuerySpec(t,n){const a=Object.assign(Object.assign({},this._options.searchOptions),n),o=(a.fields||this._options.fields).reduce((E,_)=>Object.assign(Object.assign({},E),{[_]:Fp(a.boost,_)||1}),{}),{boostDocument:s,weights:c,maxFuzzy:u,bm25:f}=a,{fuzzy:h,prefix:m}=Object.assign(Object.assign({},c1.weights),c),g=this._index.get(t.term),y=this.termResults(t.term,t.term,1,t.termBoost,g,o,s,f);let b,S;if(t.prefix&&(b=this._index.atPrefix(t.term)),t.fuzzy){const E=t.fuzzy===!0?.2:t.fuzzy,_=E<1?Math.min(u,Math.round(t.term.length*E)):E;_&&(S=this._index.fuzzyGet(t.term,_))}if(b)for(const[E,_]of b){const N=E.length-t.term.length;if(!N)continue;S==null||S.delete(E);const T=m*E.length/(E.length+.3*N);this.termResults(t.term,E,T,t.termBoost,_,o,s,f,y)}if(S)for(const E of S.keys()){const[_,N]=S.get(E);if(!N)continue;const T=h*E.length/(E.length+N);this.termResults(t.term,E,T,t.termBoost,_,o,s,f,y)}return y}executeWildcardQuery(t){const n=new Map,a=Object.assign(Object.assign({},this._options.searchOptions),t);for(const[o,s]of this._documentIds){const c=a.boostDocument?a.boostDocument(s,"",this._storedFields.get(o)):1;n.set(o,{score:c,terms:[],match:{}})}return n}combineResults(t,n=Zg){if(t.length===0)return new Map;const a=n.toLowerCase(),o=kF[a];if(!o)throw new Error(`Invalid combination operator: ${n}`);return t.reduce(o)||new Map}toJSON(){const t=[];for(const[n,a]of this._index){const o={};for(const[s,c]of a)o[s]=Object.fromEntries(c);t.push([n,o])}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,a,o,s,c,u,f,h=new Map){if(s==null)return h;for(const m of Object.keys(c)){const g=c[m],y=this._fieldIds[m],b=s.get(y);if(b==null)continue;let S=b.size;const E=this._avgFieldLength[y];for(const _ of b.keys()){if(!this._documentIds.has(_)){this.removeTerm(y,_,n),S-=1;continue}const N=u?u(this._documentIds.get(_),n,this._storedFields.get(_)):1;if(!N)continue;const T=b.get(_),A=this._fieldLength.get(_)[y],D=NF(T,S,this._documentCount,A,E,f),k=a*o*g*N*D,M=h.get(_);if(M){M.score+=k,LF(M.terms,t);const R=Fp(M.match,n);R?R.push(m):M.match[n]=[m]}else h.set(_,{score:k,terms:[t],match:{[n]:[m]}})}}return h}addTerm(t,n,a){const o=this._index.fetch(a,f1);let s=o.get(t);if(s==null)s=new Map,s.set(n,1),o.set(t,s);else{const c=s.get(n);s.set(n,(c||0)+1)}}removeTerm(t,n,a){if(!this._index.has(a)){this.warnDocumentChanged(n,t,a);return}const o=this._index.fetch(a,f1),s=o.get(t);s==null||s.get(n)==null?this.warnDocumentChanged(n,t,a):s.get(n)<=1?s.size<=1?o.delete(t):s.delete(n):s.set(n,s.get(n)-1),this._index.get(a).size===0&&this._index.delete(a)}warnDocumentChanged(t,n,a){for(const o of Object.keys(this._fieldIds))if(this._fieldIds[o]===n){this._options.logger("warn",`MiniSearch: document with ID ${this._documentIds.get(t)} has changed before removal: term "${a}" was not present in field "${o}". 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,kF={[Zg]:(e,t)=>{for(const n of t.keys()){const a=e.get(n);if(a==null)e.set(n,t.get(n));else{const{score:o,terms:s,match:c}=t.get(n);a.score=a.score+o,a.match=Object.assign(a.match,c),u1(a.terms,s)}}return e},[nC]:(e,t)=>{const n=new Map;for(const a of t.keys()){const o=e.get(a);if(o==null)continue;const{score:s,terms:c,match:u}=t.get(a);u1(o.terms,c),n.set(a,{score:o.score+s,terms:o.terms,match:Object.assign(o.match,u)})}return n},[AF]:(e,t)=>{for(const n of t.keys())e.delete(n);return e}},DF={k:1.2,b:.7,d:.5},NF=(e,t,n,a,o,s)=>{const{k:c,b:u,d:f}=s;return Math.log(1+(n-t+.5)/(t+.5))*(f+e*(c+1)/(e+c*(1-u+u*a/o)))},OF=e=>(t,n,a)=>{const o=typeof e.fuzzy=="function"?e.fuzzy(t,n,a):e.fuzzy||!1,s=typeof e.prefix=="function"?e.prefix(t,n,a):e.prefix===!0,c=typeof e.boostTerm=="function"?e.boostTerm(t,n,a):1;return{term:t,fuzzy:o,prefix:s,termBoost:c}},Up={idField:"id",extractField:(e,t)=>e[t],tokenize:e=>e.split(zF),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},c1={combineWith:Zg,prefix:!1,fuzzy:!1,maxFuzzy:6,boost:{},weights:{fuzzy:.45,prefix:.375},bm25:DF},jF={combineWith:nC,prefix:(e,t,n)=>t===n.length-1},km={batchSize:1e3,batchWait:10},Dm={minDirtFactor:.1,minDirtCount:20},Bp=Object.assign(Object.assign({},km),Dm),LF=(e,t)=>{e.includes(t)||e.push(t)},u1=(e,t)=>{for(const n of t)e.includes(n)||e.push(n)},d1=({score:e},{score:t})=>t-e,f1=()=>new Map,nu=e=>{const t=new Map;for(const n of Object.keys(e))t.set(parseInt(n,10),e[n]);return t},ru=e=>Eu(void 0,void 0,void 0,function*(){const t=new Map;let n=0;for(const a of Object.keys(e))t.set(parseInt(a,10),e[a]),++n%1e3===0&&(yield rC(0));return t}),rC=e=>new Promise(t=>setTimeout(t,e)),zF=/[\n\r\p{Z}\p{P}]+/u,MF={index:new Fa({fields:[]})};w.createContext(MF);const Nm=({label:e,color:t,hidden:n,labels:a={}})=>ve.createElement("div",{className:"node"},ve.createElement("span",{className:"render "+(n?"circle":"disc"),style:{backgroundColor:t||"#000"}}),ve.createElement("span",{className:`label ${n?"text-muted":""} ${e?"":"text-italic"}`},e||a.no_label||"No label")),PF=({id:e,labels:t})=>{const n=Kn(),a=w.useMemo(()=>{const o=n.getGraph().getNodeAttributes(e),s=n.getSetting("nodeReducer");return Object.assign(Object.assign({color:n.getSetting("defaultNodeColor")},o),s?s(e,o):{})},[n,e]);return ve.createElement(Nm,Object.assign({},a,{labels:t}))},GF=({label:e,color:t,source:n,target:a,hidden:o,directed:s,labels:c={}})=>ve.createElement("div",{className:"edge"},ve.createElement(Nm,Object.assign({},n,{labels:c})),ve.createElement("div",{className:"body"},ve.createElement("div",{className:"render"},ve.createElement("span",{className:o?"dotted":"dash",style:{borderColor:t||"#000"}})," ",s&&ve.createElement("span",{className:"arrow",style:{borderTopColor:t||"#000"}})),ve.createElement("span",{className:`label ${o?"text-muted":""} ${e?"":"fst-italic"}`},e||c.no_label||"No label")),ve.createElement(Nm,Object.assign({},a,{labels:c}))),FF=({id:e,labels:t})=>{const n=Kn(),a=w.useMemo(()=>{const o=n.getGraph().getEdgeAttributes(e),s=n.getSetting("nodeReducer"),c=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)},o),c?c(e,o):{}),{source:Object.assign(Object.assign({color:n.getSetting("defaultNodeColor")},u),s?s(e,u):{}),target:Object.assign(Object.assign({color:n.getSetting("defaultNodeColor")},f),s?s(e,f):{})})},[n,e]);return ve.createElement(GF,Object.assign({},a,{labels:t}))};function Qg(e,t){const[n,a]=w.useState(e);return w.useEffect(()=>{const o=setTimeout(()=>{a(e)},t);return()=>{clearTimeout(o)}},[e,t]),n}function UF({fetcher:e,preload:t,filterFn:n,renderOption:a,getOptionValue:o,notFound:s,loadingSkeleton:c,label:u,placeholder:f="Select...",value:h,onChange:m,onFocus:g,disabled:y=!1,className:b,noResultsMessage:S}){const[E,_]=w.useState(!1),[N,T]=w.useState(!1),[A,D]=w.useState([]),[k,M]=w.useState(!1),[R,U]=w.useState(null),[L,I]=w.useState(h),[q,Y]=w.useState(null),[B,X]=w.useState(""),ne=Qg(B,t?0:150),[F,z]=w.useState([]);w.useEffect(()=>{_(!0),I(h)},[h]),w.useEffect(()=>{E||(async()=>{try{M(!0),U(null);const H=h!==null?await e(h):[];z(H),D(H)}catch(H){U(H instanceof Error?H.message:"Failed to fetch options")}finally{M(!1)}})()},[E,e,h]),w.useEffect(()=>{const G=async()=>{try{M(!0),U(null);const H=await e(ne);z(H),D(H)}catch(H){U(H instanceof Error?H.message:"Failed to fetch options")}finally{M(!1)}};E&&t?t&&D(ne?F.filter(H=>n?n(H,ne):!0):F):G()},[e,ne,E,t,n]);const j=w.useCallback(G=>{G!==L&&(I(G),m(G)),T(!1)},[L,I,T,m]),K=w.useCallback(G=>{G!==q&&(Y(G),g(G))},[q,Y,g]);return x.jsx("div",{className:Me(y&&"cursor-not-allowed opacity-50",b),onFocus:()=>{T(!0)},onBlur:()=>T(!1),children:x.jsxs(gd,{shouldFilter:!1,className:"bg-transparent",children:[x.jsxs("div",{children:[x.jsx(Yg,{placeholder:f,value:B,className:"max-h-8",onValueChange:G=>{X(G),G&&!N&&T(!0)}}),k&&A.length>0&&x.jsx("div",{className:"absolute top-1/2 right-2 flex -translate-y-1/2 transform items-center",children:x.jsx(NE,{className:"h-4 w-4 animate-spin"})})]}),x.jsxs(vd,{hidden:!N||ne.length===0,children:[R&&x.jsx("div",{className:"text-destructive p-4 text-center",children:R}),k&&A.length===0&&(c||x.jsx(BF,{})),!k&&!R&&A.length===0&&(s||x.jsx(Wg,{children:S??`No ${u.toLowerCase()} found.`})),x.jsx(Wo,{children:A.map((G,H)=>x.jsxs(x.Fragment,{children:[x.jsx(Xo,{value:o(G),onSelect:j,onMouseEnter:()=>K(o(G)),className:"truncate",children:a(G)},o(G)+`${H}`),H!==A.length-1&&x.jsx("div",{className:"bg-foreground/10 h-[1px]"},H)]}))})]})]})})}function BF(){return x.jsx(Wo,{children:x.jsx(Xo,{disabled:!0,children:x.jsxs("div",{className:"flex w-full items-center gap-2",children:[x.jsx("div",{className:"bg-muted h-6 w-6 animate-pulse rounded-full"}),x.jsxs("div",{className:"flex flex-1 flex-col gap-1",children:[x.jsx("div",{className:"bg-muted h-4 w-24 animate-pulse rounded"}),x.jsx("div",{className:"bg-muted h-3 w-16 animate-pulse rounded"})]})]})})})}function IF(e){return x.jsxs("div",{children:[e.type==="nodes"&&x.jsx(PF,{id:e.id}),e.type==="edges"&&x.jsx(FF,{id:e.id}),e.type==="message"&&x.jsx("div",{children:e.message})]})}const Ip="__message_item",au={graph:null,searchEngine:null},HF=({onChange:e,onFocus:t,value:n})=>{const a=ct.use.sigmaGraph(),o=w.useMemo(()=>{if(au.graph==a)return au.searchEngine;if(!a||a.nodes().length==0)return;au.graph=a;const c=new Fa({idField:"id",fields:["label"],searchOptions:{prefix:!0,fuzzy:.2,boost:{label:2}}}),u=a.nodes().map(f=>({id:f,label:a.getNodeAttribute(f,"label")}));return c.addAll(u),au.searchEngine=c,c},[a]),s=w.useCallback(async c=>{if(t&&t(null),!c||!o)return[];const u=o.search(c).map(f=>({id:f.id,type:"nodes"}));return u.length<=Gh?u:[...u.slice(0,Gh),{type:"message",id:Ip,message:`And ${u.length-Gh} others`}]},[o,t]);return x.jsx(UF,{className:"bg-background/60 w-24 rounded-xl border-1 opacity-60 backdrop-blur-lg transition-all hover:w-fit hover:opacity-100",fetcher:s,renderOption:IF,getOptionValue:c=>c.id,value:n&&n.type!=="message"?n.id:null,onChange:c=>{c!==Ip&&e(c?{id:c,type:"nodes"}:null)},onFocus:c=>{c!==Ip&&t&&t(c?{id:c,type:"nodes"}:null)},label:"item",placeholder:"Search nodes..."})},$F=({...e})=>x.jsx(HF,{...e});function VF({fetcher:e,preload:t,filterFn:n,renderOption:a,getOptionValue:o,getDisplayValue:s,notFound:c,loadingSkeleton:u,label:f,placeholder:h="Select...",value:m,onChange:g,disabled:y=!1,className:b,triggerClassName:S,searchInputClassName:E,noResultsMessage:_,triggerTooltip:N,clearable:T=!0}){const[A,D]=w.useState(!1),[k,M]=w.useState(!1),[R,U]=w.useState([]),[L,I]=w.useState(!1),[q,Y]=w.useState(null),[B,X]=w.useState(m),[ne,F]=w.useState(null),[z,j]=w.useState(""),K=Qg(z,t?0:150),[G,H]=w.useState([]);w.useEffect(()=>{D(!0),X(m)},[m]),w.useEffect(()=>{if(m&&R.length>0){const $=R.find(W=>o(W)===m);$&&F($)}},[m,R,o]),w.useEffect(()=>{A||(async()=>{try{I(!0),Y(null);const W=await e(m);H(W),U(W)}catch(W){Y(W instanceof Error?W.message:"Failed to fetch options")}finally{I(!1)}})()},[A,e,m]),w.useEffect(()=>{const $=async()=>{try{I(!0),Y(null);const W=await e(K);H(W),U(W)}catch(W){Y(W instanceof Error?W.message:"Failed to fetch options")}finally{I(!1)}};A&&t?t&&U(K?G.filter(W=>n?n(W,K):!0):G):$()},[e,K,A,t,n]);const O=w.useCallback($=>{const W=T&&$===B?"":$;X(W),F(R.find(re=>o(re)===W)||null),g(W),M(!1)},[B,g,T,R,o]);return x.jsxs(id,{open:k,onOpenChange:M,children:[x.jsx(od,{asChild:!0,children:x.jsxs(_t,{variant:"outline",role:"combobox","aria-expanded":k,className:Me("justify-between",y&&"cursor-not-allowed opacity-50",S),disabled:y,tooltip:N,side:"bottom",children:[ne?s(ne):h,x.jsx(tO,{className:"opacity-50",size:10})]})}),x.jsx(El,{className:Me("p-0",b),onCloseAutoFocus:$=>$.preventDefault(),children:x.jsxs(gd,{shouldFilter:!1,children:[x.jsxs("div",{className:"relative w-full border-b",children:[x.jsx(Yg,{placeholder:`Search ${f.toLowerCase()}...`,value:z,onValueChange:$=>{j($)},className:E}),L&&R.length>0&&x.jsx("div",{className:"absolute top-1/2 right-2 flex -translate-y-1/2 transform items-center",children:x.jsx(NE,{className:"h-4 w-4 animate-spin"})})]}),x.jsxs(vd,{children:[q&&x.jsx("div",{className:"text-destructive p-4 text-center",children:q}),L&&R.length===0&&(u||x.jsx(qF,{})),!L&&!q&&R.length===0&&(c||x.jsx(Wg,{children:_??`No ${f.toLowerCase()} found.`})),x.jsx(Wo,{children:R.map($=>x.jsxs(Xo,{value:o($),onSelect:O,className:"truncate",children:[a($),x.jsx(eg,{className:Me("ml-auto h-3 w-3",B===o($)?"opacity-100":"opacity-0")})]},o($)))})]})]})})]})}function qF(){return x.jsx(Wo,{children:x.jsx(Xo,{disabled:!0,children:x.jsxs("div",{className:"flex w-full items-center gap-2",children:[x.jsx("div",{className:"bg-muted h-6 w-6 animate-pulse rounded-full"}),x.jsxs("div",{className:"flex flex-1 flex-col gap-1",children:[x.jsx("div",{className:"bg-muted h-4 w-24 animate-pulse rounded"}),x.jsx("div",{className:"bg-muted h-3 w-16 animate-pulse rounded"})]})]})})})}const YF=()=>{const e=We.use.queryLabel(),[t,n]=w.useState({labels:[],searchEngine:null}),[a,o]=w.useState(!1),s=w.useCallback(async u=>{let f=t.labels,h=t.searchEngine;if(!a||!h){f=["*"].concat(await FN()),f.includes(We.getState().queryLabel)||We.getState().setQueryLabel(f[0]),h=new Fa({idField:"id",fields:["value"],searchOptions:{prefix:!0,fuzzy:.2,boost:{label:2}}});const m=f.map((g,y)=>({id:y,value:g}));h.addAll(m),n({labels:f,searchEngine:h}),o(!0)}return u?h.search(u).map(m=>f[m.id]):f},[t,a,n,o]),c=w.useCallback(u=>{We.getState().setQueryLabel(u)},[]);return x.jsx(VF,{className:"ml-2",triggerClassName:"max-h-8",searchInputClassName:"max-h-8",triggerTooltip:"Select query label",fetcher:s,renderOption:u=>x.jsx("div",{children:u}),getOptionValue:u=>u,getDisplayValue:u=>x.jsx("div",{children:u}),notFound:x.jsx("div",{className:"py-6 text-center text-sm",children:"No labels found"}),label:"Label",placeholder:"Search labels...",value:e!==null?e:"",onChange:c})},bn=({text:e,className:t,tooltipClassName:n,tooltip:a,side:o,onClick:s})=>a?x.jsx(jS,{delayDuration:200,children:x.jsxs(LS,{children:[x.jsx(zS,{asChild:!0,children:x.jsx("label",{className:Me(t,s!==void 0?"cursor-pointer":void 0),onClick:s,children:e})}),x.jsx(xg,{side:o,className:n,children:a})]})}):x.jsx("label",{className:Me(t,s!==void 0?"cursor-pointer":void 0),onClick:s,children:e}),WF=()=>{const{getNode:e,getEdge:t}=IT(),n=ct.use.selectedNode(),a=ct.use.focusedNode(),o=ct.use.selectedEdge(),s=ct.use.focusedEdge(),[c,u]=w.useState(null),[f,h]=w.useState(null);return w.useEffect(()=>{let m=null,g=null;a?(m="node",g=e(a)):n?(m="node",g=e(n)):s?(m="edge",g=t(s,!0)):o&&(m="edge",g=t(o,!0)),g?(m=="node"?u(XF(g)):u(KF(g)),h(m)):(u(null),h(null))},[a,n,s,o,u,h,e,t]),c?x.jsx("div",{className:"bg-background/80 max-w-xs rounded-lg border-2 p-2 text-xs backdrop-blur-lg",children:f=="node"?x.jsx(ZF,{node:c}):x.jsx(QF,{edge:c})}):x.jsx(x.Fragment,{})},XF=e=>{const t=ct.getState(),n=[];if(t.sigmaGraph&&t.rawGraph)for(const a of t.sigmaGraph.edges(e.id)){const o=t.rawGraph.getEdge(a,!0);if(o){const s=e.id===o.source,c=s?o.target:o.source,u=t.rawGraph.getNode(c);u&&n.push({type:s?"Target":"Source",id:c,label:u.labels.join(", ")})}}return{...e,relationships:n}},KF=e=>{var o,s;const t=ct.getState(),n=(o=t.rawGraph)==null?void 0:o.getNode(e.source),a=(s=t.rawGraph)==null?void 0:s.getNode(e.target);return{...e,sourceNode:n,targetNode:a}},Er=({name:e,value:t,onClick:n,tooltip:a})=>x.jsxs("div",{className:"flex items-center gap-2",children:[x.jsx("label",{className:"text-primary/60 tracking-wide",children:e}),":",x.jsx(bn,{className:"hover:bg-primary/20 rounded p-1 text-ellipsis",tooltipClassName:"max-w-80",text:t,tooltip:a||t,side:"left",onClick:n})]}),ZF=({node:e})=>x.jsxs("div",{className:"flex flex-col gap-2",children:[x.jsx("label",{className:"text-md pl-1 font-bold tracking-wide text-sky-300",children:"Node"}),x.jsxs("div",{className:"bg-primary/5 max-h-96 overflow-auto rounded p-1",children:[x.jsx(Er,{name:"Id",value:e.id}),x.jsx(Er,{name:"Labels",value:e.labels.join(", "),onClick:()=>{ct.getState().setSelectedNode(e.id,!0)}}),x.jsx(Er,{name:"Degree",value:e.degree})]}),x.jsx("label",{className:"text-md pl-1 font-bold tracking-wide text-yellow-400/90",children:"Properties"}),x.jsx("div",{className:"bg-primary/5 max-h-96 overflow-auto rounded p-1",children:Object.keys(e.properties).sort().map(t=>x.jsx(Er,{name:t,value:e.properties[t]},t))}),e.relationships.length>0&&x.jsxs(x.Fragment,{children:[x.jsx("label",{className:"text-md pl-1 font-bold tracking-wide text-teal-600/90",children:"Relationships"}),x.jsx("div",{className:"bg-primary/5 max-h-96 overflow-auto rounded p-1",children:e.relationships.map(({type:t,id:n,label:a})=>x.jsx(Er,{name:t,value:a,onClick:()=>{ct.getState().setSelectedNode(n,!0)}},n))})]})]}),QF=({edge:e})=>x.jsxs("div",{className:"flex flex-col gap-2",children:[x.jsx("label",{className:"text-md pl-1 font-bold tracking-wide text-teal-600",children:"Relationship"}),x.jsxs("div",{className:"bg-primary/5 max-h-96 overflow-auto rounded p-1",children:[x.jsx(Er,{name:"Id",value:e.id}),e.type&&x.jsx(Er,{name:"Type",value:e.type}),x.jsx(Er,{name:"Source",value:e.sourceNode?e.sourceNode.labels.join(", "):e.source,onClick:()=>{ct.getState().setSelectedNode(e.source,!0)}}),x.jsx(Er,{name:"Target",value:e.targetNode?e.targetNode.labels.join(", "):e.target,onClick:()=>{ct.getState().setSelectedNode(e.target,!0)}})]}),x.jsx("label",{className:"text-md pl-1 font-bold tracking-wide text-yellow-400/90",children:"Properties"}),x.jsx("div",{className:"bg-primary/5 max-h-96 overflow-auto rounded p-1",children:Object.keys(e.properties).sort().map(t=>x.jsx(Er,{name:t,value:e.properties[t]},t))})]}),h1={allowInvalidContainer:!0,defaultNodeType:"default",defaultEdgeType:"curvedArrow",renderEdgeLabels:!1,edgeProgramClasses:{arrow:L_,curvedArrow:f3,curvedNoArrow:d3},nodeProgramClasses:{default:WG,circel:_l,point:EG},labelGridCellSize:60,labelRenderedSizeThreshold:12,enableEdgeEvents:!0,labelColor:{color:"#000",attribute:"labelColor"},edgeLabelColor:{color:"#000",attribute:"labelColor"},edgeLabelSize:8,labelSize:12},JF=()=>{const e=I_(),t=Kn(),[n,a]=w.useState(null);return w.useEffect(()=>{e({downNode:o=>{a(o.node),t.getGraph().setNodeAttribute(o.node,"highlighted",!0)},mousemovebody:o=>{if(!n)return;const s=t.viewportToGraph(o);t.getGraph().setNodeAttribute(n,"x",s.x),t.getGraph().setNodeAttribute(n,"y",s.y),o.preventSigmaDefault(),o.original.preventDefault(),o.original.stopPropagation()},mouseup:()=>{n&&(a(null),t.getGraph().removeNodeAttribute(n,"highlighted"))},mousedown:()=>{t.getCustomBBox()||t.setCustomBBox(t.getBBox())}})},[e,t,n]),null},eU=()=>{const[e,t]=w.useState(h1),n=ct.use.selectedNode(),a=ct.use.focusedNode(),o=ct.use.moveToSelectedNode(),s=We.use.showPropertyPanel(),c=We.use.showNodeSearchBar(),u=We.use.showNodeLabel(),f=We.use.enableEdgeEvents(),h=We.use.enableNodeDrag(),m=We.use.showEdgeLabel();w.useEffect(()=>{t({...h1,enableEdgeEvents:f,renderEdgeLabels:m,renderLabels:u})},[u,f,m]);const g=w.useCallback(E=>{E===null?ct.getState().setFocusedNode(null):E.type==="nodes"&&ct.getState().setFocusedNode(E.id)},[]),y=w.useCallback(E=>{E===null?ct.getState().setSelectedNode(null):E.type==="nodes"&&ct.getState().setSelectedNode(E.id,!0)},[]),b=w.useMemo(()=>a??n,[a,n]),S=w.useMemo(()=>n?{type:"nodes",id:n}:null,[n]);return x.jsxs(gG,{settings:e,className:"!bg-background !size-full overflow-hidden",children:[x.jsx(hF,{}),h&&x.jsx(JF,{}),x.jsx(m3,{node:b,move:o}),x.jsxs("div",{className:"absolute top-2 left-2 flex items-start gap-2",children:[x.jsx(YF,{}),c&&x.jsx($F,{value:S,onFocus:g,onChange:y})]}),x.jsxs("div",{className:"bg-background/60 absolute bottom-2 left-2 flex flex-col rounded-xl border-2 backdrop-blur-lg",children:[x.jsx(_F,{}),x.jsx(pF,{}),x.jsx(H5,{}),x.jsx(mF,{})]}),s&&x.jsx("div",{className:"absolute top-2 right-2",children:x.jsx(WF,{})})]})},aC=w.forwardRef(({className:e,...t},n)=>x.jsx("div",{className:"relative w-full overflow-auto",children:x.jsx("table",{ref:n,className:Me("w-full caption-bottom text-sm",e),...t})}));aC.displayName="Table";const iC=w.forwardRef(({className:e,...t},n)=>x.jsx("thead",{ref:n,className:Me("[&_tr]:border-b",e),...t}));iC.displayName="TableHeader";const oC=w.forwardRef(({className:e,...t},n)=>x.jsx("tbody",{ref:n,className:Me("[&_tr:last-child]:border-0",e),...t}));oC.displayName="TableBody";const tU=w.forwardRef(({className:e,...t},n)=>x.jsx("tfoot",{ref:n,className:Me("bg-muted/50 border-t font-medium [&>tr]:last:border-b-0",e),...t}));tU.displayName="TableFooter";const Om=w.forwardRef(({className:e,...t},n)=>x.jsx("tr",{ref:n,className:Me("hover:bg-muted/50 data-[state=selected]:bg-muted border-b transition-colors",e),...t}));Om.displayName="TableRow";const Jr=w.forwardRef(({className:e,...t},n)=>x.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}));Jr.displayName="TableHead";const ea=w.forwardRef(({className:e,...t},n)=>x.jsx("td",{ref:n,className:Me("p-2 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...t}));ea.displayName="TableCell";const nU=w.forwardRef(({className:e,...t},n)=>x.jsx("caption",{ref:n,className:Me("text-muted-foreground mt-4 text-sm",e),...t}));nU.displayName="TableCaption";const dl=w.forwardRef(({className:e,...t},n)=>x.jsx("div",{ref:n,className:Me("bg-card text-card-foreground rounded-xl border shadow",e),...t}));dl.displayName="Card";const zu=w.forwardRef(({className:e,...t},n)=>x.jsx("div",{ref:n,className:Me("flex flex-col space-y-1.5 p-6",e),...t}));zu.displayName="CardHeader";const fl=w.forwardRef(({className:e,...t},n)=>x.jsx("div",{ref:n,className:Me("leading-none font-semibold tracking-tight",e),...t}));fl.displayName="CardTitle";const yd=w.forwardRef(({className:e,...t},n)=>x.jsx("div",{ref:n,className:Me("text-muted-foreground text-sm",e),...t}));yd.displayName="CardDescription";const Mu=w.forwardRef(({className:e,...t},n)=>x.jsx("div",{ref:n,className:Me("p-6 pt-0",e),...t}));Mu.displayName="CardContent";const rU=w.forwardRef(({className:e,...t},n)=>x.jsx("div",{ref:n,className:Me("flex items-center p-6 pt-0",e),...t}));rU.displayName="CardFooter";function aU({title:e,description:t,icon:n=lO,action:a,className:o,...s}){return x.jsxs(dl,{className:Me("flex w-full flex-col items-center justify-center space-y-6 bg-transparent p-16",o),...s,children:[x.jsx("div",{className:"mr-4 shrink-0 rounded-full border border-dashed p-4",children:x.jsx(n,{className:"text-muted-foreground size-8","aria-hidden":"true"})}),x.jsxs("div",{className:"flex flex-col items-center gap-1.5 text-center",children:[x.jsx(fl,{children:e}),t?x.jsx(yd,{children:t}):null]}),a||null]})}var Hp={exports:{}},$p,p1;function iU(){if(p1)return $p;p1=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return $p=e,$p}var Vp,m1;function oU(){if(m1)return Vp;m1=1;var e=iU();function t(){}function n(){}return n.resetWarningCache=t,Vp=function(){function a(c,u,f,h,m,g){if(g!==e){var y=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 y.name="Invariant Violation",y}}a.isRequired=a;function o(){return a}var s={array:a,bigint:a,bool:a,func:a,number:a,object:a,string:a,symbol:a,any:a,arrayOf:o,element:a,elementType:a,instanceOf:o,node:a,objectOf:o,oneOf:o,oneOfType:o,shape:o,exact:o,checkPropTypes:n,resetWarningCache:t};return s.PropTypes=s,s},Vp}var g1;function sU(){return g1||(g1=1,Hp.exports=oU()()),Hp.exports}var lU=sU();const gt=dn(lU),cU=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 zo(e,t,n){const a=uU(e),{webkitRelativePath:o}=e,s=typeof t=="string"?t:typeof o=="string"&&o.length>0?o:`./${e.name}`;return typeof a.path!="string"&&v1(a,"path",s),v1(a,"relativePath",s),a}function uU(e){const{name:t}=e;if(t&&t.lastIndexOf(".")!==-1&&!e.type){const a=t.split(".").pop().toLowerCase(),o=cU.get(a);o&&Object.defineProperty(e,"type",{value:o,writable:!1,configurable:!1,enumerable:!0})}return e}function v1(e,t,n){Object.defineProperty(e,t,{value:n,writable:!1,configurable:!1,enumerable:!0})}const dU=[".DS_Store","Thumbs.db"];function fU(e){return Di(this,void 0,void 0,function*(){return Pu(e)&&hU(e.dataTransfer)?vU(e.dataTransfer,e.type):pU(e)?mU(e):Array.isArray(e)&&e.every(t=>"getFile"in t&&typeof t.getFile=="function")?gU(e):[]})}function hU(e){return Pu(e)}function pU(e){return Pu(e)&&Pu(e.target)}function Pu(e){return typeof e=="object"&&e!==null}function mU(e){return jm(e.target.files).map(t=>zo(t))}function gU(e){return Di(this,void 0,void 0,function*(){return(yield Promise.all(e.map(n=>n.getFile()))).map(n=>zo(n))})}function vU(e,t){return Di(this,void 0,void 0,function*(){if(e.items){const n=jm(e.items).filter(o=>o.kind==="file");if(t!=="drop")return n;const a=yield Promise.all(n.map(yU));return y1(sC(a))}return y1(jm(e.files).map(n=>zo(n)))})}function y1(e){return e.filter(t=>dU.indexOf(t.name)===-1)}function jm(e){if(e===null)return[];const t=[];for(let n=0;n[...t,...Array.isArray(n)?sC(n):[n]],[])}function b1(e,t){return Di(this,void 0,void 0,function*(){var n;if(globalThis.isSecureContext&&typeof e.getAsFileSystemHandle=="function"){const s=yield e.getAsFileSystemHandle();if(s===null)throw new Error(`${e} is not a File`);if(s!==void 0){const c=yield s.getFile();return c.handle=s,zo(c)}}const a=e.getAsFile();if(!a)throw new Error(`${e} is not a File`);return zo(a,(n=t==null?void 0:t.fullPath)!==null&&n!==void 0?n:void 0)})}function bU(e){return Di(this,void 0,void 0,function*(){return e.isDirectory?lC(e):xU(e)})}function lC(e){const t=e.createReader();return new Promise((n,a)=>{const o=[];function s(){t.readEntries(c=>Di(this,void 0,void 0,function*(){if(c.length){const u=Promise.all(c.map(bU));o.push(u),s()}else try{const u=yield Promise.all(o);n(u)}catch(u){a(u)}}),c=>{a(c)})}s()})}function xU(e){return Di(this,void 0,void 0,function*(){return new Promise((t,n)=>{e.file(a=>{const o=zo(a,e.fullPath);t(o)},a=>{n(a)})})})}var iu={},x1;function wU(){return x1||(x1=1,iu.__esModule=!0,iu.default=function(e,t){if(e&&t){var n=Array.isArray(t)?t:t.split(",");if(n.length===0)return!0;var a=e.name||"",o=(e.type||"").toLowerCase(),s=o.replace(/\/.*$/,"");return n.some(function(c){var u=c.trim().toLowerCase();return u.charAt(0)==="."?a.toLowerCase().endsWith(u):u.endsWith("/*")?s===u.replace(/\/.*$/,""):o===u})}return!0}),iu}var EU=wU();const qp=dn(EU);function w1(e){return TU(e)||_U(e)||uC(e)||SU()}function SU(){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 _U(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function TU(e){if(Array.isArray(e))return Lm(e)}function E1(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,a)}return n}function S1(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,a=new Array(t);n0&&arguments[0]!==void 0?arguments[0]:"",n=t.split(","),a=n.length>1?"one of ".concat(n.join(", ")):n[0];return{code:DU,message:"File type must be ".concat(a)}},_1=function(t){return{code:NU,message:"File is larger than ".concat(t," ").concat(t===1?"byte":"bytes")}},T1=function(t){return{code:OU,message:"File is smaller than ".concat(t," ").concat(t===1?"byte":"bytes")}},zU={code:jU,message:"Too many files"};function dC(e,t){var n=e.type==="application/x-moz-file"||kU(e,t);return[n,n?null:LU(t)]}function fC(e,t,n){if(xi(e.size))if(xi(t)&&xi(n)){if(e.size>n)return[!1,_1(n)];if(e.sizen)return[!1,_1(n)]}return[!0,null]}function xi(e){return e!=null}function MU(e){var t=e.files,n=e.accept,a=e.minSize,o=e.maxSize,s=e.multiple,c=e.maxFiles,u=e.validator;return!s&&t.length>1||s&&c>=1&&t.length>c?!1:t.every(function(f){var h=dC(f,n),m=hl(h,1),g=m[0],y=fC(f,a,o),b=hl(y,1),S=b[0],E=u?u(f):null;return g&&S&&!E})}function Gu(e){return typeof e.isPropagationStopped=="function"?e.isPropagationStopped():typeof e.cancelBubble<"u"?e.cancelBubble:!1}function ou(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 C1(e){e.preventDefault()}function PU(e){return e.indexOf("MSIE")!==-1||e.indexOf("Trident/")!==-1}function GU(e){return e.indexOf("Edge/")!==-1}function FU(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:window.navigator.userAgent;return PU(e)||GU(e)}function xr(){for(var e=arguments.length,t=new Array(e),n=0;n1?o-1:0),c=1;ce.length)&&(t=e.length);for(var n=0,a=new Array(t);n=0)&&Object.prototype.propertyIsEnumerable.call(e,a)&&(n[a]=e[a])}return n}function nB(e,t){if(e==null)return{};var n={},a=Object.keys(e),o,s;for(s=0;s=0)&&(n[o]=e[o]);return n}var bd=w.forwardRef(function(e,t){var n=e.children,a=Fu(e,VU),o=rB(a),s=o.open,c=Fu(o,qU);return w.useImperativeHandle(t,function(){return{open:s}},[s]),ve.createElement(w.Fragment,null,n(St(St({},c),{},{open:s})))});bd.displayName="Dropzone";var gC={disabled:!1,getFilesFromEvent:fU,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};bd.defaultProps=gC;bd.propTypes={children:gt.func,accept:gt.objectOf(gt.arrayOf(gt.string)),multiple:gt.bool,preventDropOnDocument:gt.bool,noClick:gt.bool,noKeyboard:gt.bool,noDrag:gt.bool,noDragEventsBubbling:gt.bool,minSize:gt.number,maxSize:gt.number,maxFiles:gt.number,disabled:gt.bool,getFilesFromEvent:gt.func,onFileDialogCancel:gt.func,onFileDialogOpen:gt.func,useFsAccessApi:gt.bool,autoFocus:gt.bool,onDragEnter:gt.func,onDragLeave:gt.func,onDragOver:gt.func,onDrop:gt.func,onDropAccepted:gt.func,onDropRejected:gt.func,onError:gt.func,validator:gt.func};var Pm={isFocused:!1,isFileDialogActive:!1,isDragActive:!1,isDragAccept:!1,isDragReject:!1,acceptedFiles:[],fileRejections:[]};function rB(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=St(St({},gC),e),n=t.accept,a=t.disabled,o=t.getFilesFromEvent,s=t.maxSize,c=t.minSize,u=t.multiple,f=t.maxFiles,h=t.onDragEnter,m=t.onDragLeave,g=t.onDragOver,y=t.onDrop,b=t.onDropAccepted,S=t.onDropRejected,E=t.onFileDialogCancel,_=t.onFileDialogOpen,N=t.useFsAccessApi,T=t.autoFocus,A=t.preventDropOnDocument,D=t.noClick,k=t.noKeyboard,M=t.noDrag,R=t.noDragEventsBubbling,U=t.onError,L=t.validator,I=w.useMemo(function(){return IU(n)},[n]),q=w.useMemo(function(){return BU(n)},[n]),Y=w.useMemo(function(){return typeof _=="function"?_:A1},[_]),B=w.useMemo(function(){return typeof E=="function"?E:A1},[E]),X=w.useRef(null),ne=w.useRef(null),F=w.useReducer(aB,Pm),z=Yp(F,2),j=z[0],K=z[1],G=j.isFocused,H=j.isFileDialogActive,O=w.useRef(typeof window<"u"&&window.isSecureContext&&N&&UU()),$=function(){!O.current&&H&&setTimeout(function(){if(ne.current){var Ae=ne.current.files;Ae.length||(K({type:"closeDialog"}),B())}},300)};w.useEffect(function(){return window.addEventListener("focus",$,!1),function(){window.removeEventListener("focus",$,!1)}},[ne,H,B,O]);var W=w.useRef([]),re=function(Ae){X.current&&X.current.contains(Ae.target)||(Ae.preventDefault(),W.current=[])};w.useEffect(function(){return A&&(document.addEventListener("dragover",C1,!1),document.addEventListener("drop",re,!1)),function(){A&&(document.removeEventListener("dragover",C1),document.removeEventListener("drop",re))}},[X,A]),w.useEffect(function(){return!a&&T&&X.current&&X.current.focus(),function(){}},[X,T,a]);var de=w.useCallback(function(me){U?U(me):console.error(me)},[U]),ie=w.useCallback(function(me){me.preventDefault(),me.persist(),Ee(me),W.current=[].concat(XU(W.current),[me.target]),ou(me)&&Promise.resolve(o(me)).then(function(Ae){if(!(Gu(me)&&!R)){var Oe=Ae.length,He=Oe>0&&MU({files:Ae,accept:I,minSize:c,maxSize:s,multiple:u,maxFiles:f,validator:L}),it=Oe>0&&!He;K({isDragAccept:He,isDragReject:it,isDragActive:!0,type:"setDraggedFiles"}),h&&h(me)}}).catch(function(Ae){return de(Ae)})},[o,h,de,R,I,c,s,u,f,L]),oe=w.useCallback(function(me){me.preventDefault(),me.persist(),Ee(me);var Ae=ou(me);if(Ae&&me.dataTransfer)try{me.dataTransfer.dropEffect="copy"}catch{}return Ae&&g&&g(me),!1},[g,R]),Te=w.useCallback(function(me){me.preventDefault(),me.persist(),Ee(me);var Ae=W.current.filter(function(He){return X.current&&X.current.contains(He)}),Oe=Ae.indexOf(me.target);Oe!==-1&&Ae.splice(Oe,1),W.current=Ae,!(Ae.length>0)&&(K({type:"setDraggedFiles",isDragActive:!1,isDragAccept:!1,isDragReject:!1}),ou(me)&&m&&m(me))},[X,m,R]),he=w.useCallback(function(me,Ae){var Oe=[],He=[];me.forEach(function(it){var Tt=dC(it,I),bt=Yp(Tt,2),qt=bt[0],fn=bt[1],Gt=fC(it,c,s),rt=Yp(Gt,2),Tn=rt[0],xt=rt[1],Lt=L?L(it):null;if(qt&&Tn&&!Lt)Oe.push(it);else{var Ya=[fn,xt];Lt&&(Ya=Ya.concat(Lt)),He.push({file:it,errors:Ya.filter(function(Ni){return Ni})})}}),(!u&&Oe.length>1||u&&f>=1&&Oe.length>f)&&(Oe.forEach(function(it){He.push({file:it,errors:[zU]})}),Oe.splice(0)),K({acceptedFiles:Oe,fileRejections:He,isDragReject:He.length>0,type:"setFiles"}),y&&y(Oe,He,Ae),He.length>0&&S&&S(He,Ae),Oe.length>0&&b&&b(Oe,Ae)},[K,u,I,c,s,f,y,b,S,L]),Se=w.useCallback(function(me){me.preventDefault(),me.persist(),Ee(me),W.current=[],ou(me)&&Promise.resolve(o(me)).then(function(Ae){Gu(me)&&!R||he(Ae,me)}).catch(function(Ae){return de(Ae)}),K({type:"reset"})},[o,he,de,R]),be=w.useCallback(function(){if(O.current){K({type:"openDialog"}),Y();var me={multiple:u,types:q};window.showOpenFilePicker(me).then(function(Ae){return o(Ae)}).then(function(Ae){he(Ae,null),K({type:"closeDialog"})}).catch(function(Ae){HU(Ae)?(B(Ae),K({type:"closeDialog"})):$U(Ae)?(O.current=!1,ne.current?(ne.current.value=null,ne.current.click()):de(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."))):de(Ae)});return}ne.current&&(K({type:"openDialog"}),Y(),ne.current.value=null,ne.current.click())},[K,Y,B,N,he,de,q,u]),je=w.useCallback(function(me){!X.current||!X.current.isEqualNode(me.target)||(me.key===" "||me.key==="Enter"||me.keyCode===32||me.keyCode===13)&&(me.preventDefault(),be())},[X,be]),Ce=w.useCallback(function(){K({type:"focus"})},[]),ye=w.useCallback(function(){K({type:"blur"})},[]),J=w.useCallback(function(){D||(FU()?setTimeout(be,0):be())},[D,be]),le=function(Ae){return a?null:Ae},_e=function(Ae){return k?null:le(Ae)},pe=function(Ae){return M?null:le(Ae)},Ee=function(Ae){R&&Ae.stopPropagation()},te=w.useMemo(function(){return function(){var me=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},Ae=me.refKey,Oe=Ae===void 0?"ref":Ae,He=me.role,it=me.onKeyDown,Tt=me.onFocus,bt=me.onBlur,qt=me.onClick,fn=me.onDragEnter,Gt=me.onDragOver,rt=me.onDragLeave,Tn=me.onDrop,xt=Fu(me,YU);return St(St(Mm({onKeyDown:_e(xr(it,je)),onFocus:_e(xr(Tt,Ce)),onBlur:_e(xr(bt,ye)),onClick:le(xr(qt,J)),onDragEnter:pe(xr(fn,ie)),onDragOver:pe(xr(Gt,oe)),onDragLeave:pe(xr(rt,Te)),onDrop:pe(xr(Tn,Se)),role:typeof He=="string"&&He!==""?He:"presentation"},Oe,X),!a&&!k?{tabIndex:0}:{}),xt)}},[X,je,Ce,ye,J,ie,oe,Te,Se,k,M,a]),Fe=w.useCallback(function(me){me.stopPropagation()},[]),Pe=w.useMemo(function(){return function(){var me=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},Ae=me.refKey,Oe=Ae===void 0?"ref":Ae,He=me.onChange,it=me.onClick,Tt=Fu(me,WU),bt=Mm({accept:I,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:le(xr(He,Se)),onClick:le(xr(it,Fe)),tabIndex:-1},Oe,ne);return St(St({},bt),Tt)}},[ne,n,u,Se,a]);return St(St({},j),{},{isFocused:G&&!a,getRootProps:te,getInputProps:Pe,rootRef:X,inputRef:ne,open:le(be)})}function aB(e,t){switch(t.type){case"focus":return St(St({},e),{},{isFocused:!0});case"blur":return St(St({},e),{},{isFocused:!1});case"openDialog":return St(St({},Pm),{},{isFileDialogActive:!0});case"closeDialog":return St(St({},e),{},{isFileDialogActive:!1});case"setDraggedFiles":return St(St({},e),{},{isDragActive:t.isDragActive,isDragAccept:t.isDragAccept,isDragReject:t.isDragReject});case"setFiles":return St(St({},e),{},{acceptedFiles:t.acceptedFiles,fileRejections:t.fileRejections,isDragReject:t.isDragReject});case"reset":return St({},Pm);default:return e}}function A1(){}var Jg="Progress",ev=100,[iB,i6]=fr(Jg),[oB,sB]=iB(Jg),vC=w.forwardRef((e,t)=>{const{__scopeProgress:n,value:a=null,max:o,getValueLabel:s=lB,...c}=e;(o||o===0)&&!k1(o)&&console.error(cB(`${o}`,"Progress"));const u=k1(o)?o:ev;a!==null&&!D1(a,u)&&console.error(uB(`${a}`,"Progress"));const f=D1(a,u)?a:null,h=Uu(f)?s(f,u):void 0;return x.jsx(oB,{scope:n,value:f,max:u,children:x.jsx(Ie.div,{"aria-valuemax":u,"aria-valuemin":0,"aria-valuenow":Uu(f)?f:void 0,"aria-valuetext":h,role:"progressbar","data-state":xC(f,u),"data-value":f??void 0,"data-max":u,...c,ref:t})})});vC.displayName=Jg;var yC="ProgressIndicator",bC=w.forwardRef((e,t)=>{const{__scopeProgress:n,...a}=e,o=sB(yC,n);return x.jsx(Ie.div,{"data-state":xC(o.value,o.max),"data-value":o.value??void 0,"data-max":o.max,...a,ref:t})});bC.displayName=yC;function lB(e,t){return`${Math.round(e/t*100)}%`}function xC(e,t){return e==null?"indeterminate":e===t?"complete":"loading"}function Uu(e){return typeof e=="number"}function k1(e){return Uu(e)&&!isNaN(e)&&e>0}function D1(e,t){return Uu(e)&&!isNaN(e)&&e<=t&&e>=0}function cB(e,t){return`Invalid prop \`max\` of value \`${e}\` supplied to \`${t}\`. Only numbers greater than 0 are valid max values. Defaulting to \`${ev}\`.`}function uB(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 ${ev} if no \`max\` prop is set) - - \`null\` or \`undefined\` if the progress is indeterminate. - -Defaulting to \`null\`.`}var wC=vC,dB=bC;const EC=w.forwardRef(({className:e,value:t,...n},a)=>x.jsx(wC,{ref:a,className:Me("bg-secondary relative h-4 w-full overflow-hidden rounded-full",e),...n,children:x.jsx(dB,{className:"bg-primary h-full w-full flex-1 transition-all",style:{transform:`translateX(-${100-(t||0)}%)`}})}));EC.displayName=wC.displayName;function Gm(e,[t,n]){return Math.min(n,Math.max(t,e))}function fB(e,t){return w.useReducer((n,a)=>t[n][a]??n,e)}var tv="ScrollArea",[SC,o6]=fr(tv),[hB,Zn]=SC(tv),_C=w.forwardRef((e,t)=>{const{__scopeScrollArea:n,type:a="hover",dir:o,scrollHideDelay:s=600,...c}=e,[u,f]=w.useState(null),[h,m]=w.useState(null),[g,y]=w.useState(null),[b,S]=w.useState(null),[E,_]=w.useState(null),[N,T]=w.useState(0),[A,D]=w.useState(0),[k,M]=w.useState(!1),[R,U]=w.useState(!1),L=at(t,q=>f(q)),I=dd(o);return x.jsx(hB,{scope:n,type:a,dir:I,scrollHideDelay:s,scrollArea:u,viewport:h,onViewportChange:m,content:g,onContentChange:y,scrollbarX:b,onScrollbarXChange:S,scrollbarXEnabled:k,onScrollbarXEnabledChange:M,scrollbarY:E,onScrollbarYChange:_,scrollbarYEnabled:R,onScrollbarYEnabledChange:U,onCornerWidthChange:T,onCornerHeightChange:D,children:x.jsx(Ie.div,{dir:I,...c,ref:L,style:{position:"relative","--radix-scroll-area-corner-width":N+"px","--radix-scroll-area-corner-height":A+"px",...e.style}})})});_C.displayName=tv;var TC="ScrollAreaViewport",CC=w.forwardRef((e,t)=>{const{__scopeScrollArea:n,children:a,nonce:o,...s}=e,c=Zn(TC,n),u=w.useRef(null),f=at(t,u,c.onViewportChange);return x.jsxs(x.Fragment,{children:[x.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:o}),x.jsx(Ie.div,{"data-radix-scroll-area-viewport":"",...s,ref:f,style:{overflowX:c.scrollbarXEnabled?"scroll":"hidden",overflowY:c.scrollbarYEnabled?"scroll":"hidden",...e.style},children:x.jsx("div",{ref:c.onContentChange,style:{minWidth:"100%",display:"table"},children:a})})]})});CC.displayName=TC;var Dr="ScrollAreaScrollbar",nv=w.forwardRef((e,t)=>{const{forceMount:n,...a}=e,o=Zn(Dr,e.__scopeScrollArea),{onScrollbarXEnabledChange:s,onScrollbarYEnabledChange:c}=o,u=e.orientation==="horizontal";return w.useEffect(()=>(u?s(!0):c(!0),()=>{u?s(!1):c(!1)}),[u,s,c]),o.type==="hover"?x.jsx(pB,{...a,ref:t,forceMount:n}):o.type==="scroll"?x.jsx(mB,{...a,ref:t,forceMount:n}):o.type==="auto"?x.jsx(RC,{...a,ref:t,forceMount:n}):o.type==="always"?x.jsx(rv,{...a,ref:t}):null});nv.displayName=Dr;var pB=w.forwardRef((e,t)=>{const{forceMount:n,...a}=e,o=Zn(Dr,e.__scopeScrollArea),[s,c]=w.useState(!1);return w.useEffect(()=>{const u=o.scrollArea;let f=0;if(u){const h=()=>{window.clearTimeout(f),c(!0)},m=()=>{f=window.setTimeout(()=>c(!1),o.scrollHideDelay)};return u.addEventListener("pointerenter",h),u.addEventListener("pointerleave",m),()=>{window.clearTimeout(f),u.removeEventListener("pointerenter",h),u.removeEventListener("pointerleave",m)}}},[o.scrollArea,o.scrollHideDelay]),x.jsx(Ln,{present:n||s,children:x.jsx(RC,{"data-state":s?"visible":"hidden",...a,ref:t})})}),mB=w.forwardRef((e,t)=>{const{forceMount:n,...a}=e,o=Zn(Dr,e.__scopeScrollArea),s=e.orientation==="horizontal",c=wd(()=>f("SCROLL_END"),100),[u,f]=fB("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 w.useEffect(()=>{if(u==="idle"){const h=window.setTimeout(()=>f("HIDE"),o.scrollHideDelay);return()=>window.clearTimeout(h)}},[u,o.scrollHideDelay,f]),w.useEffect(()=>{const h=o.viewport,m=s?"scrollLeft":"scrollTop";if(h){let g=h[m];const y=()=>{const b=h[m];g!==b&&(f("SCROLL"),c()),g=b};return h.addEventListener("scroll",y),()=>h.removeEventListener("scroll",y)}},[o.viewport,s,f,c]),x.jsx(Ln,{present:n||u!=="hidden",children:x.jsx(rv,{"data-state":u==="hidden"?"hidden":"visible",...a,ref:t,onPointerEnter:Be(e.onPointerEnter,()=>f("POINTER_ENTER")),onPointerLeave:Be(e.onPointerLeave,()=>f("POINTER_LEAVE"))})})}),RC=w.forwardRef((e,t)=>{const n=Zn(Dr,e.__scopeScrollArea),{forceMount:a,...o}=e,[s,c]=w.useState(!1),u=e.orientation==="horizontal",f=wd(()=>{if(n.viewport){const h=n.viewport.offsetWidth{const{orientation:n="vertical",...a}=e,o=Zn(Dr,e.__scopeScrollArea),s=w.useRef(null),c=w.useRef(0),[u,f]=w.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),h=OC(u.viewport,u.content),m={...a,sizes:u,onSizesChange:f,hasThumb:h>0&&h<1,onThumbChange:y=>s.current=y,onThumbPointerUp:()=>c.current=0,onThumbPointerDown:y=>c.current=y};function g(y,b){return wB(y,c.current,u,b)}return n==="horizontal"?x.jsx(gB,{...m,ref:t,onThumbPositionChange:()=>{if(o.viewport&&s.current){const y=o.viewport.scrollLeft,b=N1(y,u,o.dir);s.current.style.transform=`translate3d(${b}px, 0, 0)`}},onWheelScroll:y=>{o.viewport&&(o.viewport.scrollLeft=y)},onDragScroll:y=>{o.viewport&&(o.viewport.scrollLeft=g(y,o.dir))}}):n==="vertical"?x.jsx(vB,{...m,ref:t,onThumbPositionChange:()=>{if(o.viewport&&s.current){const y=o.viewport.scrollTop,b=N1(y,u);s.current.style.transform=`translate3d(0, ${b}px, 0)`}},onWheelScroll:y=>{o.viewport&&(o.viewport.scrollTop=y)},onDragScroll:y=>{o.viewport&&(o.viewport.scrollTop=g(y))}}):null}),gB=w.forwardRef((e,t)=>{const{sizes:n,onSizesChange:a,...o}=e,s=Zn(Dr,e.__scopeScrollArea),[c,u]=w.useState(),f=w.useRef(null),h=at(t,f,s.onScrollbarXChange);return w.useEffect(()=>{f.current&&u(getComputedStyle(f.current))},[f]),x.jsx(kC,{"data-orientation":"horizontal",...o,ref:h,sizes:n,style:{bottom:0,left:s.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:s.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":xd(n)+"px",...e.style},onThumbPointerDown:m=>e.onThumbPointerDown(m.x),onDragScroll:m=>e.onDragScroll(m.x),onWheelScroll:(m,g)=>{if(s.viewport){const y=s.viewport.scrollLeft+m.deltaX;e.onWheelScroll(y),LC(y,g)&&m.preventDefault()}},onResize:()=>{f.current&&s.viewport&&c&&a({content:s.viewport.scrollWidth,viewport:s.viewport.offsetWidth,scrollbar:{size:f.current.clientWidth,paddingStart:Iu(c.paddingLeft),paddingEnd:Iu(c.paddingRight)}})}})}),vB=w.forwardRef((e,t)=>{const{sizes:n,onSizesChange:a,...o}=e,s=Zn(Dr,e.__scopeScrollArea),[c,u]=w.useState(),f=w.useRef(null),h=at(t,f,s.onScrollbarYChange);return w.useEffect(()=>{f.current&&u(getComputedStyle(f.current))},[f]),x.jsx(kC,{"data-orientation":"vertical",...o,ref:h,sizes:n,style:{top:0,right:s.dir==="ltr"?0:void 0,left:s.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":xd(n)+"px",...e.style},onThumbPointerDown:m=>e.onThumbPointerDown(m.y),onDragScroll:m=>e.onDragScroll(m.y),onWheelScroll:(m,g)=>{if(s.viewport){const y=s.viewport.scrollTop+m.deltaY;e.onWheelScroll(y),LC(y,g)&&m.preventDefault()}},onResize:()=>{f.current&&s.viewport&&c&&a({content:s.viewport.scrollHeight,viewport:s.viewport.offsetHeight,scrollbar:{size:f.current.clientHeight,paddingStart:Iu(c.paddingTop),paddingEnd:Iu(c.paddingBottom)}})}})}),[yB,AC]=SC(Dr),kC=w.forwardRef((e,t)=>{const{__scopeScrollArea:n,sizes:a,hasThumb:o,onThumbChange:s,onThumbPointerUp:c,onThumbPointerDown:u,onThumbPositionChange:f,onDragScroll:h,onWheelScroll:m,onResize:g,...y}=e,b=Zn(Dr,n),[S,E]=w.useState(null),_=at(t,L=>E(L)),N=w.useRef(null),T=w.useRef(""),A=b.viewport,D=a.content-a.viewport,k=Zt(m),M=Zt(f),R=wd(g,10);function U(L){if(N.current){const I=L.clientX-N.current.left,q=L.clientY-N.current.top;h({x:I,y:q})}}return w.useEffect(()=>{const L=I=>{const q=I.target;(S==null?void 0:S.contains(q))&&k(I,D)};return document.addEventListener("wheel",L,{passive:!1}),()=>document.removeEventListener("wheel",L,{passive:!1})},[A,S,D,k]),w.useEffect(M,[a,M]),Mo(S,R),Mo(b.content,R),x.jsx(yB,{scope:n,scrollbar:S,hasThumb:o,onThumbChange:Zt(s),onThumbPointerUp:Zt(c),onThumbPositionChange:M,onThumbPointerDown:Zt(u),children:x.jsx(Ie.div,{...y,ref:_,style:{position:"absolute",...y.style},onPointerDown:Be(e.onPointerDown,L=>{L.button===0&&(L.target.setPointerCapture(L.pointerId),N.current=S.getBoundingClientRect(),T.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",b.viewport&&(b.viewport.style.scrollBehavior="auto"),U(L))}),onPointerMove:Be(e.onPointerMove,U),onPointerUp:Be(e.onPointerUp,L=>{const I=L.target;I.hasPointerCapture(L.pointerId)&&I.releasePointerCapture(L.pointerId),document.body.style.webkitUserSelect=T.current,b.viewport&&(b.viewport.style.scrollBehavior=""),N.current=null})})})}),Bu="ScrollAreaThumb",DC=w.forwardRef((e,t)=>{const{forceMount:n,...a}=e,o=AC(Bu,e.__scopeScrollArea);return x.jsx(Ln,{present:n||o.hasThumb,children:x.jsx(bB,{ref:t,...a})})}),bB=w.forwardRef((e,t)=>{const{__scopeScrollArea:n,style:a,...o}=e,s=Zn(Bu,n),c=AC(Bu,n),{onThumbPositionChange:u}=c,f=at(t,g=>c.onThumbChange(g)),h=w.useRef(void 0),m=wd(()=>{h.current&&(h.current(),h.current=void 0)},100);return w.useEffect(()=>{const g=s.viewport;if(g){const y=()=>{if(m(),!h.current){const b=EB(g,u);h.current=b,u()}};return u(),g.addEventListener("scroll",y),()=>g.removeEventListener("scroll",y)}},[s.viewport,m,u]),x.jsx(Ie.div,{"data-state":c.hasThumb?"visible":"hidden",...o,ref:f,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...a},onPointerDownCapture:Be(e.onPointerDownCapture,g=>{const b=g.target.getBoundingClientRect(),S=g.clientX-b.left,E=g.clientY-b.top;c.onThumbPointerDown({x:S,y:E})}),onPointerUp:Be(e.onPointerUp,c.onThumbPointerUp)})});DC.displayName=Bu;var av="ScrollAreaCorner",NC=w.forwardRef((e,t)=>{const n=Zn(av,e.__scopeScrollArea),a=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&a?x.jsx(xB,{...e,ref:t}):null});NC.displayName=av;var xB=w.forwardRef((e,t)=>{const{__scopeScrollArea:n,...a}=e,o=Zn(av,n),[s,c]=w.useState(0),[u,f]=w.useState(0),h=!!(s&&u);return Mo(o.scrollbarX,()=>{var g;const m=((g=o.scrollbarX)==null?void 0:g.offsetHeight)||0;o.onCornerHeightChange(m),f(m)}),Mo(o.scrollbarY,()=>{var g;const m=((g=o.scrollbarY)==null?void 0:g.offsetWidth)||0;o.onCornerWidthChange(m),c(m)}),h?x.jsx(Ie.div,{...a,ref:t,style:{width:s,height:u,position:"absolute",right:o.dir==="ltr"?0:void 0,left:o.dir==="rtl"?0:void 0,bottom:0,...e.style}}):null});function Iu(e){return e?parseInt(e,10):0}function OC(e,t){const n=e/t;return isNaN(n)?0:n}function xd(e){const t=OC(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,a=(e.scrollbar.size-n)*t;return Math.max(a,18)}function wB(e,t,n,a="ltr"){const o=xd(n),s=o/2,c=t||s,u=o-c,f=n.scrollbar.paddingStart+c,h=n.scrollbar.size-n.scrollbar.paddingEnd-u,m=n.content-n.viewport,g=a==="ltr"?[0,m]:[m*-1,0];return jC([f,h],g)(e)}function N1(e,t,n="ltr"){const a=xd(t),o=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,s=t.scrollbar.size-o,c=t.content-t.viewport,u=s-a,f=n==="ltr"?[0,c]:[c*-1,0],h=Gm(e,f);return jC([0,c],[0,u])(h)}function jC(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const a=(t[1]-t[0])/(e[1]-e[0]);return t[0]+a*(n-e[0])}}function LC(e,t){return e>0&&e{})=>{let n={left:e.scrollLeft,top:e.scrollTop},a=0;return function o(){const s={left:e.scrollLeft,top:e.scrollTop},c=n.left!==s.left,u=n.top!==s.top;(c||u)&&t(),n=s,a=window.requestAnimationFrame(o)}(),()=>window.cancelAnimationFrame(a)};function wd(e,t){const n=Zt(e),a=w.useRef(0);return w.useEffect(()=>()=>window.clearTimeout(a.current),[]),w.useCallback(()=>{window.clearTimeout(a.current),a.current=window.setTimeout(n,t)},[n,t])}function Mo(e,t){const n=Zt(t);on(()=>{let a=0;if(e){const o=new ResizeObserver(()=>{cancelAnimationFrame(a),a=window.requestAnimationFrame(n)});return o.observe(e),()=>{window.cancelAnimationFrame(a),o.unobserve(e)}}},[e,n])}var zC=_C,SB=CC,_B=NC;const MC=w.forwardRef(({className:e,children:t,...n},a)=>x.jsxs(zC,{ref:a,className:Me("relative overflow-hidden",e),...n,children:[x.jsx(SB,{className:"h-full w-full rounded-[inherit]",children:t}),x.jsx(PC,{}),x.jsx(_B,{})]}));MC.displayName=zC.displayName;const PC=w.forwardRef(({className:e,orientation:t="vertical",...n},a)=>x.jsx(nv,{ref:a,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:x.jsx(DC,{className:"bg-border relative flex-1 rounded-full"})}));PC.displayName=nv.displayName;function Fm(e,t={}){const{decimals:n=0,sizeType:a="normal"}=t,o=["Bytes","KB","MB","GB","TB"],s=["Bytes","KiB","MiB","GiB","TiB"];if(e===0)return"0 Byte";const c=Math.floor(Math.log(e)/Math.log(1024));return`${(e/Math.pow(1024,c)).toFixed(n)} ${a==="accurate"?s[c]??"Bytes":o[c]??"Bytes"}`}function TB(e){const{value:t,onValueChange:n,onUpload:a,progresses:o,accept:s=rD,maxSize:c=1024*1024*200,maxFileCount:u=1,multiple:f=!1,disabled:h=!1,description:m,className:g,...y}=e,[b,S]=oa({prop:t,onChange:n}),E=w.useCallback((T,A)=>{if(!f&&u===1&&T.length>1){un.error("Cannot upload more than 1 file at a time");return}if(((b==null?void 0:b.length)??0)+T.length>u){un.error(`Cannot upload more than ${u} files`);return}const D=T.map(M=>Object.assign(M,{preview:URL.createObjectURL(M)})),k=b?[...b,...D]:D;if(S(k),A.length>0&&A.forEach(({file:M})=>{un.error(`File ${M.name} was rejected`)}),a&&k.length>0&&k.length<=u){const M=k.length>0?`${k.length} files`:"file";un.promise(a(k),{loading:`Uploading ${M}...`,success:()=>(S([]),`${M} uploaded`),error:`Failed to upload ${M}`})}},[b,u,f,a,S]);function _(T){if(!b)return;const A=b.filter((D,k)=>k!==T);S(A),n==null||n(A)}w.useEffect(()=>()=>{b&&b.forEach(T=>{GC(T)&&URL.revokeObjectURL(T.preview)})},[]);const N=h||((b==null?void 0:b.length)??0)>=u;return x.jsxs("div",{className:"relative flex flex-col gap-6 overflow-hidden",children:[x.jsx(bd,{onDrop:E,accept:s,maxSize:c,maxFiles:u,multiple:u>1||f,disabled:N,children:({getRootProps:T,getInputProps:A,isDragActive:D})=>x.jsxs("div",{...T(),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",D&&"border-muted-foreground/50",N&&"pointer-events-none opacity-60",g),...y,children:[x.jsx("input",{...A()}),D?x.jsxs("div",{className:"flex flex-col items-center justify-center gap-4 sm:px-5",children:[x.jsx("div",{className:"rounded-full border border-dashed p-3",children:x.jsx(im,{className:"text-muted-foreground size-7","aria-hidden":"true"})}),x.jsx("p",{className:"text-muted-foreground font-medium",children:"Drop the files here"})]}):x.jsxs("div",{className:"flex flex-col items-center justify-center gap-4 sm:px-5",children:[x.jsx("div",{className:"rounded-full border border-dashed p-3",children:x.jsx(im,{className:"text-muted-foreground size-7","aria-hidden":"true"})}),x.jsxs("div",{className:"flex flex-col gap-px",children:[x.jsx("p",{className:"text-muted-foreground font-medium",children:"Drag and drop files here, or click to select files"}),m?x.jsx("p",{className:"text-muted-foreground/70 text-sm",children:m}):x.jsxs("p",{className:"text-muted-foreground/70 text-sm",children:["You can upload",u>1?` ${u===1/0?"multiple":u} - files (up to ${Fm(c)} each)`:` a file with ${Fm(c)}`,"Supported formats: TXT, MD, DOC, PDF, PPTX"]})]})]})]})}),b!=null&&b.length?x.jsx(MC,{className:"h-fit w-full px-3",children:x.jsx("div",{className:"flex max-h-48 flex-col gap-4",children:b==null?void 0:b.map((T,A)=>x.jsx(CB,{file:T,onRemove:()=>_(A),progress:o==null?void 0:o[T.name]},A))})}):null]})}function CB({file:e,progress:t,onRemove:n}){return x.jsxs("div",{className:"relative flex items-center gap-2.5",children:[x.jsxs("div",{className:"flex flex-1 gap-2.5",children:[GC(e)?x.jsx(RB,{file:e}):null,x.jsxs("div",{className:"flex w-full flex-col gap-2",children:[x.jsxs("div",{className:"flex flex-col gap-px",children:[x.jsx("p",{className:"text-foreground/80 line-clamp-1 text-sm font-medium",children:e.name}),x.jsx("p",{className:"text-muted-foreground text-xs",children:Fm(e.size)})]}),t?x.jsx(EC,{value:t}):null]})]}),x.jsx("div",{className:"flex items-center gap-2",children:x.jsxs(_t,{type:"button",variant:"outline",size:"icon",className:"size-7",onClick:n,children:[x.jsx(OE,{className:"size-4","aria-hidden":"true"}),x.jsx("span",{className:"sr-only",children:"Remove file"})]})})]})}function GC(e){return"preview"in e&&typeof e.preview=="string"}function RB({file:e}){return e.type.startsWith("image/")?x.jsx("div",{className:"aspect-square shrink-0 rounded-md object-cover"}):x.jsx(oO,{className:"text-muted-foreground size-10","aria-hidden":"true"})}function AB(){const[e,t]=w.useState(!1),[n,a]=w.useState(!1),[o,s]=w.useState({}),c=w.useCallback(async u=>{a(!0);try{await Promise.all(u.map(async f=>{try{const h=await VN(f,m=>{console.debug(`Uploading ${f.name}: ${m}%`),s(g=>({...g,[f.name]:m}))});h.status==="success"?un.success(`Upload Success: -${f.name} uploaded successfully`):un.error(`Upload Failed: -${f.name} -${h.message}`)}catch(h){un.error(`Upload Failed: -${f.name} -${Sr(h)}`)}}))}catch(f){un.error(`Upload Failed -`+Sr(f))}finally{a(!1)}},[a,s]);return x.jsxs(FT,{open:e,onOpenChange:u=>{n&&!u||t(u)},children:[x.jsx(UT,{asChild:!0,children:x.jsxs(_t,{variant:"default",side:"bottom",tooltip:"Upload documents",size:"sm",children:[x.jsx(im,{})," Upload"]})}),x.jsxs(Hg,{className:"sm:max-w-xl",onCloseAutoFocus:u=>u.preventDefault(),children:[x.jsxs($g,{children:[x.jsx(Vg,{children:"Upload documents"}),x.jsx(qg,{children:"Drag and drop your documents here or click to browse."})]}),x.jsx(TB,{maxFileCount:1/0,maxSize:200*1024*1024,description:"supported types: TXT, MD, DOC, PDF, PPTX",onUpload:c,progresses:o,disabled:n})]})]})}function kB(){const[e,t]=w.useState(!1),n=w.useCallback(async()=>{try{const a=await qN();a.status==="success"?(un.success("Documents cleared successfully"),t(!1)):un.error(`Clear Documents Failed: -${a.message}`)}catch(a){un.error(`Clear Documents Failed: -`+Sr(a))}},[t]);return x.jsxs(FT,{open:e,onOpenChange:t,children:[x.jsx(UT,{asChild:!0,children:x.jsxs(_t,{variant:"outline",side:"bottom",tooltip:"Clear documents",size:"sm",children:[x.jsx(DE,{})," Clear"]})}),x.jsxs(Hg,{className:"sm:max-w-xl",onCloseAutoFocus:a=>a.preventDefault(),children:[x.jsxs($g,{children:[x.jsx(Vg,{children:"Clear documents"}),x.jsx(qg,{children:"Do you really want to clear all documents?"})]}),x.jsx(_t,{variant:"destructive",onClick:n,children:"YES"})]})]})}function DB(){const e=Wn.use.health(),[t,n]=w.useState(null),a=w.useCallback(async()=>{try{const s=await BN();s&&s.statuses?n(s):n(null)}catch(s){un.error(`Failed to load documents -`+Sr(s))}},[n]);w.useEffect(()=>{a()},[]);const o=w.useCallback(async()=>{try{const{status:s}=await IN();un.message(s)}catch(s){un.error(`Failed to load documents -`+Sr(s))}},[]);return w.useEffect(()=>{const s=setInterval(async()=>{if(e)try{await a()}catch(c){un.error(`Failed to get scan progress -`+Sr(c))}},5e3);return()=>clearInterval(s)},[e,a]),x.jsxs(dl,{className:"!size-full !rounded-none !border-none",children:[x.jsx(zu,{children:x.jsx(fl,{className:"text-lg",children:"Document Management"})}),x.jsxs(Mu,{className:"space-y-4",children:[x.jsxs("div",{className:"flex gap-2",children:[x.jsxs(_t,{variant:"outline",onClick:o,side:"bottom",tooltip:"Scan documents",size:"sm",children:[x.jsx(kO,{})," Scan"]}),x.jsx("div",{className:"flex-1"}),x.jsx(kB,{}),x.jsx(AB,{})]}),x.jsxs(dl,{children:[x.jsxs(zu,{children:[x.jsx(fl,{children:"Uploaded documents"}),x.jsx(yd,{children:"view the uploaded documents here"})]}),x.jsxs(Mu,{children:[!t&&x.jsx(aU,{title:"No documents uploaded",description:"upload documents to see them here"}),t&&x.jsxs(aC,{children:[x.jsx(iC,{children:x.jsxs(Om,{children:[x.jsx(Jr,{children:"ID"}),x.jsx(Jr,{children:"Summary"}),x.jsx(Jr,{children:"Status"}),x.jsx(Jr,{children:"Length"}),x.jsx(Jr,{children:"Chunks"}),x.jsx(Jr,{children:"Created"}),x.jsx(Jr,{children:"Updated"}),x.jsx(Jr,{children:"Metadata"})]})}),x.jsx(oC,{className:"text-sm",children:Object.entries(t.statuses).map(([s,c])=>c.map(u=>x.jsxs(Om,{children:[x.jsx(ea,{className:"truncate font-mono",children:u.id}),x.jsx(ea,{className:"max-w-xs min-w-24 truncate",children:x.jsx(bn,{text:u.content_summary,tooltip:u.content_summary,tooltipClassName:"max-w-none overflow-visible block"})}),x.jsxs(ea,{children:[s==="processed"&&x.jsx("span",{className:"text-green-600",children:"Completed"}),s==="processing"&&x.jsx("span",{className:"text-blue-600",children:"Processing"}),s==="pending"&&x.jsx("span",{className:"text-yellow-600",children:"Pending"}),s==="failed"&&x.jsx("span",{className:"text-red-600",children:"Failed"}),u.error&&x.jsx("span",{className:"ml-2 text-red-500",title:u.error,children:"⚠️"})]}),x.jsx(ea,{children:u.content_length??"-"}),x.jsx(ea,{children:u.chunks_count??"-"}),x.jsx(ea,{className:"truncate",children:new Date(u.created_at).toLocaleString()}),x.jsx(ea,{className:"truncate",children:new Date(u.updated_at).toLocaleString()}),x.jsx(ea,{className:"max-w-xs truncate",children:u.metadata?JSON.stringify(u.metadata):"-"})]},u.id)))})]})]})]})]})]})}function FC(e,t){var n={};for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&t.indexOf(a)<0&&(n[a]=e[a]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,a=Object.getOwnPropertySymbols(e);o=u?o=o+O1("0",c-u):o=(o.substring(0,c)||"0")+"."+o.substring(c),n+o}function j1(e,t,n){if(["","-"].indexOf(e)!==-1)return e;var a=(e.indexOf(".")!==-1||n)&&t,o=iv(e),s=o.beforeDecimal,c=o.afterDecimal,u=o.hasNegation,f=parseFloat("0."+(c||"0")),h=c.length<=t?"0."+c:f.toFixed(t),m=h.split("."),g=s;s&&Number(m[0])&&(g=s.split("").reverse().reduce(function(E,_,N){return E.length>N?(Number(E[0])+Number(_)).toString()+E.substring(1,E.length):_+E},m[0]));var y=IC(m[1]||"",t,n),b=u?"-":"",S=a?".":"";return""+b+g+S+y}function wi(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 $C=NB(function(e,t){for(var n=0,a=0,o=e.length,s=t.length;e[n]===t[n]&&nn&&o-a>n;)a++;return{from:{start:n,end:o-a},to:{start:n,end:s-a}}}),PB=function(e,t){var n=Math.min(e.selectionStart,t);return{from:{start:n,end:e.selectionEnd},to:{start:n,end:t}}};function GB(e,t,n){return Math.min(Math.max(e,t),n)}function Wp(e){return Math.max(e.selectionStart,e.selectionEnd)}function FB(){return typeof navigator<"u"&&!(navigator.platform&&/iPhone|iPod/.test(navigator.platform))}function UB(e){return{from:{start:0,end:0},to:{start:0,end:e.length},lastValue:""}}function BB(e){var t=e.currentValue,n=e.formattedValue,a=e.currentValueIndex,o=e.formattedValueIndex;return t[a]===n[o]}function IB(e,t,n,a,o,s,c){c===void 0&&(c=BB);var u=o.findIndex(function(D){return D}),f=e.slice(0,u);!t&&!n.startsWith(f)&&(t=f,n=f+n,a=a+f.length);for(var h=n.length,m=e.length,g={},y=new Array(h),b=0;b0&&y[N]===-1;)N--;var A=N===-1||y[N]===-1?0:y[N]+1;return A>T?T:a-A=0&&!n[t];)t--;t===-1&&(t=n.indexOf(!0))}else{for(;t<=o&&!n[t];)t++;t>o&&(t=n.lastIndexOf(!0))}return t===-1&&(t=o),t}function HB(e){for(var t=Array.from({length:e.length+1}).map(function(){return!0}),n=0,a=t.length;nR.length-c.length||Mq||g>e.length-c.length)&&(I=g),e=e.substring(0,I),e=YB(A?"-"+e:e,o),e=(e.match(WB(S))||[]).join("");var Y=e.indexOf(S);e=e.replace(new RegExp(BC(S),"g"),function(z,j){return j===Y?".":""});var B=iv(e,o),X=B.beforeDecimal,ne=B.afterDecimal,F=B.addNegation;return h.end-h.startH?!1:G>=re.start&&G{const[E,_]=w.useState(y??a),N=w.useCallback(()=>{_(k=>k===void 0?e??1:Math.min(k+(e??1),s))},[e,s]),T=w.useCallback(()=>{_(k=>k===void 0?-(e??1):Math.max(k-(e??1),o))},[e,o]);w.useEffect(()=>{y!==void 0&&_(y)},[y]);const A=k=>{const M=k.floatValue===void 0?void 0:k.floatValue;_(M),c&&c(M)},D=()=>{E!==void 0&&(Es&&(_(s),S.current.value=String(s)))};return x.jsxs("div",{className:"relative flex",children:[x.jsx(eI,{value:E,onValueChange:A,thousandSeparator:t,decimalScale:f,fixedDecimalScale:u,allowNegative:o<0,valueIsNumericString:!0,onBlur:D,max:s,min:o,suffix:m,prefix:g,customInput:k=>x.jsx(Lo,{...k,className:Me("w-full",h)}),placeholder:n,className:"[appearance:textfield] [&::-webkit-inner-spin-button]:appearance-none [&::-webkit-outer-spin-button]:appearance-none",getInputRef:S,...b}),x.jsxs("div",{className:"absolute top-0 right-0 bottom-0 flex flex-col",children:[x.jsx(_t,{"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:N,disabled:E===s,children:x.jsx(kE,{size:15})}),x.jsx(_t,{"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:T,disabled:E===o,children:x.jsx(tg,{size:15})})]})]})});_o.displayName="NumberInput";var tI=[" ","Enter","ArrowUp","ArrowDown"],nI=[" ","Enter"],kl="Select",[Sd,_d,rI]=PS(kl),[Ko,s6]=fr(kl,[rI,Ho]),Td=Ho(),[aI,Va]=Ko(kl),[iI,oI]=Ko(kl),qC=e=>{const{__scopeSelect:t,children:n,open:a,defaultOpen:o,onOpenChange:s,value:c,defaultValue:u,onValueChange:f,dir:h,name:m,autoComplete:g,disabled:y,required:b,form:S}=e,E=Td(t),[_,N]=w.useState(null),[T,A]=w.useState(null),[D,k]=w.useState(!1),M=dd(h),[R=!1,U]=oa({prop:a,defaultProp:o,onChange:s}),[L,I]=oa({prop:c,defaultProp:u,onChange:f}),q=w.useRef(null),Y=_?S||!!_.closest("form"):!0,[B,X]=w.useState(new Set),ne=Array.from(B).map(F=>F.props.value).join(";");return x.jsx(fg,{...E,children:x.jsxs(aI,{required:b,scope:t,trigger:_,onTriggerChange:N,valueNode:T,onValueNodeChange:A,valueNodeHasChildren:D,onValueNodeHasChildrenChange:k,contentId:an(),value:L,onValueChange:I,open:R,onOpenChange:U,dir:M,triggerPointerDownPosRef:q,disabled:y,children:[x.jsx(Sd.Provider,{scope:t,children:x.jsx(iI,{scope:e.__scopeSelect,onNativeOptionAdd:w.useCallback(F=>{X(z=>new Set(z).add(F))},[]),onNativeOptionRemove:w.useCallback(F=>{X(z=>{const j=new Set(z);return j.delete(F),j})},[]),children:n})}),Y?x.jsxs(yR,{"aria-hidden":!0,required:b,tabIndex:-1,name:m,autoComplete:g,value:L,onChange:F=>I(F.target.value),disabled:y,form:S,children:[L===void 0?x.jsx("option",{value:""}):null,Array.from(B)]},ne):null]})})};qC.displayName=kl;var YC="SelectTrigger",WC=w.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:a=!1,...o}=e,s=Td(n),c=Va(YC,n),u=c.disabled||a,f=at(t,c.onTriggerChange),h=_d(n),m=w.useRef("touch"),[g,y,b]=bR(E=>{const _=h().filter(A=>!A.disabled),N=_.find(A=>A.value===c.value),T=xR(_,E,N);T!==void 0&&c.onValueChange(T.value)}),S=E=>{u||(c.onOpenChange(!0),b()),E&&(c.triggerPointerDownPosRef.current={x:Math.round(E.pageX),y:Math.round(E.pageY)})};return x.jsx(td,{asChild:!0,...s,children:x.jsx(Ie.button,{type:"button",role:"combobox","aria-controls":c.contentId,"aria-expanded":c.open,"aria-required":c.required,"aria-autocomplete":"none",dir:c.dir,"data-state":c.open?"open":"closed",disabled:u,"data-disabled":u?"":void 0,"data-placeholder":vR(c.value)?"":void 0,...o,ref:f,onClick:Be(o.onClick,E=>{E.currentTarget.focus(),m.current!=="mouse"&&S(E)}),onPointerDown:Be(o.onPointerDown,E=>{m.current=E.pointerType;const _=E.target;_.hasPointerCapture(E.pointerId)&&_.releasePointerCapture(E.pointerId),E.button===0&&E.ctrlKey===!1&&E.pointerType==="mouse"&&(S(E),E.preventDefault())}),onKeyDown:Be(o.onKeyDown,E=>{const _=g.current!=="";!(E.ctrlKey||E.altKey||E.metaKey)&&E.key.length===1&&y(E.key),!(_&&E.key===" ")&&tI.includes(E.key)&&(S(),E.preventDefault())})})})});WC.displayName=YC;var XC="SelectValue",KC=w.forwardRef((e,t)=>{const{__scopeSelect:n,className:a,style:o,children:s,placeholder:c="",...u}=e,f=Va(XC,n),{onValueNodeHasChildrenChange:h}=f,m=s!==void 0,g=at(t,f.onValueNodeChange);return on(()=>{h(m)},[h,m]),x.jsx(Ie.span,{...u,ref:g,style:{pointerEvents:"none"},children:vR(f.value)?x.jsx(x.Fragment,{children:c}):s})});KC.displayName=XC;var sI="SelectIcon",ZC=w.forwardRef((e,t)=>{const{__scopeSelect:n,children:a,...o}=e;return x.jsx(Ie.span,{"aria-hidden":!0,...o,ref:t,children:a||"▼"})});ZC.displayName=sI;var lI="SelectPortal",QC=e=>x.jsx(nd,{asChild:!0,...e});QC.displayName=lI;var ki="SelectContent",JC=w.forwardRef((e,t)=>{const n=Va(ki,e.__scopeSelect),[a,o]=w.useState();if(on(()=>{o(new DocumentFragment)},[]),!n.open){const s=a;return s?yl.createPortal(x.jsx(eR,{scope:e.__scopeSelect,children:x.jsx(Sd.Slot,{scope:e.__scopeSelect,children:x.jsx("div",{children:e.children})})}),s):null}return x.jsx(tR,{...e,ref:t})});JC.displayName=ki;var or=10,[eR,qa]=Ko(ki),cI="SelectContentImpl",tR=w.forwardRef((e,t)=>{const{__scopeSelect:n,position:a="item-aligned",onCloseAutoFocus:o,onEscapeKeyDown:s,onPointerDownOutside:c,side:u,sideOffset:f,align:h,alignOffset:m,arrowPadding:g,collisionBoundary:y,collisionPadding:b,sticky:S,hideWhenDetached:E,avoidCollisions:_,...N}=e,T=Va(ki,n),[A,D]=w.useState(null),[k,M]=w.useState(null),R=at(t,ie=>D(ie)),[U,L]=w.useState(null),[I,q]=w.useState(null),Y=_d(n),[B,X]=w.useState(!1),ne=w.useRef(!1);w.useEffect(()=>{if(A)return mg(A)},[A]),ng();const F=w.useCallback(ie=>{const[oe,...Te]=Y().map(be=>be.ref.current),[he]=Te.slice(-1),Se=document.activeElement;for(const be of ie)if(be===Se||(be==null||be.scrollIntoView({block:"nearest"}),be===oe&&k&&(k.scrollTop=0),be===he&&k&&(k.scrollTop=k.scrollHeight),be==null||be.focus(),document.activeElement!==Se))return},[Y,k]),z=w.useCallback(()=>F([U,A]),[F,U,A]);w.useEffect(()=>{B&&z()},[B,z]);const{onOpenChange:j,triggerPointerDownPosRef:K}=T;w.useEffect(()=>{if(A){let ie={x:0,y:0};const oe=he=>{var Se,be;ie={x:Math.abs(Math.round(he.pageX)-(((Se=K.current)==null?void 0:Se.x)??0)),y:Math.abs(Math.round(he.pageY)-(((be=K.current)==null?void 0:be.y)??0))}},Te=he=>{ie.x<=10&&ie.y<=10?he.preventDefault():A.contains(he.target)||j(!1),document.removeEventListener("pointermove",oe),K.current=null};return K.current!==null&&(document.addEventListener("pointermove",oe),document.addEventListener("pointerup",Te,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",oe),document.removeEventListener("pointerup",Te,{capture:!0})}}},[A,j,K]),w.useEffect(()=>{const ie=()=>j(!1);return window.addEventListener("blur",ie),window.addEventListener("resize",ie),()=>{window.removeEventListener("blur",ie),window.removeEventListener("resize",ie)}},[j]);const[G,H]=bR(ie=>{const oe=Y().filter(Se=>!Se.disabled),Te=oe.find(Se=>Se.ref.current===document.activeElement),he=xR(oe,ie,Te);he&&setTimeout(()=>he.ref.current.focus())}),O=w.useCallback((ie,oe,Te)=>{const he=!ne.current&&!Te;(T.value!==void 0&&T.value===oe||he)&&(L(ie),he&&(ne.current=!0))},[T.value]),$=w.useCallback(()=>A==null?void 0:A.focus(),[A]),W=w.useCallback((ie,oe,Te)=>{const he=!ne.current&&!Te;(T.value!==void 0&&T.value===oe||he)&&q(ie)},[T.value]),re=a==="popper"?Um:nR,de=re===Um?{side:u,sideOffset:f,align:h,alignOffset:m,arrowPadding:g,collisionBoundary:y,collisionPadding:b,sticky:S,hideWhenDetached:E,avoidCollisions:_}:{};return x.jsx(eR,{scope:n,content:A,viewport:k,onViewportChange:M,itemRefCallback:O,selectedItem:U,onItemLeave:$,itemTextRefCallback:W,focusSelectedItem:z,selectedItemText:I,position:a,isPositioned:B,searchRef:G,children:x.jsx(ad,{as:Ua,allowPinchZoom:!0,children:x.jsx(Zu,{asChild:!0,trapped:T.open,onMountAutoFocus:ie=>{ie.preventDefault()},onUnmountAutoFocus:Be(o,ie=>{var oe;(oe=T.trigger)==null||oe.focus({preventScroll:!0}),ie.preventDefault()}),children:x.jsx(bl,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:ie=>ie.preventDefault(),onDismiss:()=>T.onOpenChange(!1),children:x.jsx(re,{role:"listbox",id:T.contentId,"data-state":T.open?"open":"closed",dir:T.dir,onContextMenu:ie=>ie.preventDefault(),...N,...de,onPlaced:()=>X(!0),ref:R,style:{display:"flex",flexDirection:"column",outline:"none",...N.style},onKeyDown:Be(N.onKeyDown,ie=>{const oe=ie.ctrlKey||ie.altKey||ie.metaKey;if(ie.key==="Tab"&&ie.preventDefault(),!oe&&ie.key.length===1&&H(ie.key),["ArrowUp","ArrowDown","Home","End"].includes(ie.key)){let he=Y().filter(Se=>!Se.disabled).map(Se=>Se.ref.current);if(["ArrowUp","End"].includes(ie.key)&&(he=he.slice().reverse()),["ArrowUp","ArrowDown"].includes(ie.key)){const Se=ie.target,be=he.indexOf(Se);he=he.slice(be+1)}setTimeout(()=>F(he)),ie.preventDefault()}})})})})})})});tR.displayName=cI;var uI="SelectItemAlignedPosition",nR=w.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:a,...o}=e,s=Va(ki,n),c=qa(ki,n),[u,f]=w.useState(null),[h,m]=w.useState(null),g=at(t,R=>m(R)),y=_d(n),b=w.useRef(!1),S=w.useRef(!0),{viewport:E,selectedItem:_,selectedItemText:N,focusSelectedItem:T}=c,A=w.useCallback(()=>{if(s.trigger&&s.valueNode&&u&&h&&E&&_&&N){const R=s.trigger.getBoundingClientRect(),U=h.getBoundingClientRect(),L=s.valueNode.getBoundingClientRect(),I=N.getBoundingClientRect();if(s.dir!=="rtl"){const Se=I.left-U.left,be=L.left-Se,je=R.left-be,Ce=R.width+je,ye=Math.max(Ce,U.width),J=window.innerWidth-or,le=Gm(be,[or,Math.max(or,J-ye)]);u.style.minWidth=Ce+"px",u.style.left=le+"px"}else{const Se=U.right-I.right,be=window.innerWidth-L.right-Se,je=window.innerWidth-R.right-be,Ce=R.width+je,ye=Math.max(Ce,U.width),J=window.innerWidth-or,le=Gm(be,[or,Math.max(or,J-ye)]);u.style.minWidth=Ce+"px",u.style.right=le+"px"}const q=y(),Y=window.innerHeight-or*2,B=E.scrollHeight,X=window.getComputedStyle(h),ne=parseInt(X.borderTopWidth,10),F=parseInt(X.paddingTop,10),z=parseInt(X.borderBottomWidth,10),j=parseInt(X.paddingBottom,10),K=ne+F+B+j+z,G=Math.min(_.offsetHeight*5,K),H=window.getComputedStyle(E),O=parseInt(H.paddingTop,10),$=parseInt(H.paddingBottom,10),W=R.top+R.height/2-or,re=Y-W,de=_.offsetHeight/2,ie=_.offsetTop+de,oe=ne+F+ie,Te=K-oe;if(oe<=W){const Se=q.length>0&&_===q[q.length-1].ref.current;u.style.bottom="0px";const be=h.clientHeight-E.offsetTop-E.offsetHeight,je=Math.max(re,de+(Se?$:0)+be+z),Ce=oe+je;u.style.height=Ce+"px"}else{const Se=q.length>0&&_===q[0].ref.current;u.style.top="0px";const je=Math.max(W,ne+E.offsetTop+(Se?O:0)+de)+Te;u.style.height=je+"px",E.scrollTop=oe-W+E.offsetTop}u.style.margin=`${or}px 0`,u.style.minHeight=G+"px",u.style.maxHeight=Y+"px",a==null||a(),requestAnimationFrame(()=>b.current=!0)}},[y,s.trigger,s.valueNode,u,h,E,_,N,s.dir,a]);on(()=>A(),[A]);const[D,k]=w.useState();on(()=>{h&&k(window.getComputedStyle(h).zIndex)},[h]);const M=w.useCallback(R=>{R&&S.current===!0&&(A(),T==null||T(),S.current=!1)},[A,T]);return x.jsx(fI,{scope:n,contentWrapper:u,shouldExpandOnScrollRef:b,onScrollButtonChange:M,children:x.jsx("div",{ref:f,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:D},children:x.jsx(Ie.div,{...o,ref:g,style:{boxSizing:"border-box",maxHeight:"100%",...o.style}})})})});nR.displayName=uI;var dI="SelectPopperPosition",Um=w.forwardRef((e,t)=>{const{__scopeSelect:n,align:a="start",collisionPadding:o=or,...s}=e,c=Td(n);return x.jsx(hg,{...c,...s,ref:t,align:a,collisionPadding:o,style:{boxSizing:"border-box",...s.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)"}})});Um.displayName=dI;var[fI,ov]=Ko(ki,{}),Bm="SelectViewport",rR=w.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:a,...o}=e,s=qa(Bm,n),c=ov(Bm,n),u=at(t,s.onViewportChange),f=w.useRef(0);return x.jsxs(x.Fragment,{children:[x.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:a}),x.jsx(Sd.Slot,{scope:n,children:x.jsx(Ie.div,{"data-radix-select-viewport":"",role:"presentation",...o,ref:u,style:{position:"relative",flex:1,overflow:"hidden auto",...o.style},onScroll:Be(o.onScroll,h=>{const m=h.currentTarget,{contentWrapper:g,shouldExpandOnScrollRef:y}=c;if(y!=null&&y.current&&g){const b=Math.abs(f.current-m.scrollTop);if(b>0){const S=window.innerHeight-or*2,E=parseFloat(g.style.minHeight),_=parseFloat(g.style.height),N=Math.max(E,_);if(N0?D:0,g.style.justifyContent="flex-end")}}}f.current=m.scrollTop})})})]})});rR.displayName=Bm;var aR="SelectGroup",[hI,pI]=Ko(aR),iR=w.forwardRef((e,t)=>{const{__scopeSelect:n,...a}=e,o=an();return x.jsx(hI,{scope:n,id:o,children:x.jsx(Ie.div,{role:"group","aria-labelledby":o,...a,ref:t})})});iR.displayName=aR;var oR="SelectLabel",sR=w.forwardRef((e,t)=>{const{__scopeSelect:n,...a}=e,o=pI(oR,n);return x.jsx(Ie.div,{id:o.id,...a,ref:t})});sR.displayName=oR;var Hu="SelectItem",[mI,lR]=Ko(Hu),cR=w.forwardRef((e,t)=>{const{__scopeSelect:n,value:a,disabled:o=!1,textValue:s,...c}=e,u=Va(Hu,n),f=qa(Hu,n),h=u.value===a,[m,g]=w.useState(s??""),[y,b]=w.useState(!1),S=at(t,T=>{var A;return(A=f.itemRefCallback)==null?void 0:A.call(f,T,a,o)}),E=an(),_=w.useRef("touch"),N=()=>{o||(u.onValueChange(a),u.onOpenChange(!1))};if(a==="")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 x.jsx(mI,{scope:n,value:a,disabled:o,textId:E,isSelected:h,onItemTextChange:w.useCallback(T=>{g(A=>A||((T==null?void 0:T.textContent)??"").trim())},[]),children:x.jsx(Sd.ItemSlot,{scope:n,value:a,disabled:o,textValue:m,children:x.jsx(Ie.div,{role:"option","aria-labelledby":E,"data-highlighted":y?"":void 0,"aria-selected":h&&y,"data-state":h?"checked":"unchecked","aria-disabled":o||void 0,"data-disabled":o?"":void 0,tabIndex:o?void 0:-1,...c,ref:S,onFocus:Be(c.onFocus,()=>b(!0)),onBlur:Be(c.onBlur,()=>b(!1)),onClick:Be(c.onClick,()=>{_.current!=="mouse"&&N()}),onPointerUp:Be(c.onPointerUp,()=>{_.current==="mouse"&&N()}),onPointerDown:Be(c.onPointerDown,T=>{_.current=T.pointerType}),onPointerMove:Be(c.onPointerMove,T=>{var A;_.current=T.pointerType,o?(A=f.onItemLeave)==null||A.call(f):_.current==="mouse"&&T.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Be(c.onPointerLeave,T=>{var A;T.currentTarget===document.activeElement&&((A=f.onItemLeave)==null||A.call(f))}),onKeyDown:Be(c.onKeyDown,T=>{var D;((D=f.searchRef)==null?void 0:D.current)!==""&&T.key===" "||(nI.includes(T.key)&&N(),T.key===" "&&T.preventDefault())})})})})});cR.displayName=Hu;var rl="SelectItemText",uR=w.forwardRef((e,t)=>{const{__scopeSelect:n,className:a,style:o,...s}=e,c=Va(rl,n),u=qa(rl,n),f=lR(rl,n),h=oI(rl,n),[m,g]=w.useState(null),y=at(t,N=>g(N),f.onItemTextChange,N=>{var T;return(T=u.itemTextRefCallback)==null?void 0:T.call(u,N,f.value,f.disabled)}),b=m==null?void 0:m.textContent,S=w.useMemo(()=>x.jsx("option",{value:f.value,disabled:f.disabled,children:b},f.value),[f.disabled,f.value,b]),{onNativeOptionAdd:E,onNativeOptionRemove:_}=h;return on(()=>(E(S),()=>_(S)),[E,_,S]),x.jsxs(x.Fragment,{children:[x.jsx(Ie.span,{id:f.textId,...s,ref:y}),f.isSelected&&c.valueNode&&!c.valueNodeHasChildren?yl.createPortal(s.children,c.valueNode):null]})});uR.displayName=rl;var dR="SelectItemIndicator",fR=w.forwardRef((e,t)=>{const{__scopeSelect:n,...a}=e;return lR(dR,n).isSelected?x.jsx(Ie.span,{"aria-hidden":!0,...a,ref:t}):null});fR.displayName=dR;var Im="SelectScrollUpButton",hR=w.forwardRef((e,t)=>{const n=qa(Im,e.__scopeSelect),a=ov(Im,e.__scopeSelect),[o,s]=w.useState(!1),c=at(t,a.onScrollButtonChange);return on(()=>{if(n.viewport&&n.isPositioned){let u=function(){const h=f.scrollTop>0;s(h)};const f=n.viewport;return u(),f.addEventListener("scroll",u),()=>f.removeEventListener("scroll",u)}},[n.viewport,n.isPositioned]),o?x.jsx(mR,{...e,ref:c,onAutoScroll:()=>{const{viewport:u,selectedItem:f}=n;u&&f&&(u.scrollTop=u.scrollTop-f.offsetHeight)}}):null});hR.displayName=Im;var Hm="SelectScrollDownButton",pR=w.forwardRef((e,t)=>{const n=qa(Hm,e.__scopeSelect),a=ov(Hm,e.__scopeSelect),[o,s]=w.useState(!1),c=at(t,a.onScrollButtonChange);return on(()=>{if(n.viewport&&n.isPositioned){let u=function(){const h=f.scrollHeight-f.clientHeight,m=Math.ceil(f.scrollTop)f.removeEventListener("scroll",u)}},[n.viewport,n.isPositioned]),o?x.jsx(mR,{...e,ref:c,onAutoScroll:()=>{const{viewport:u,selectedItem:f}=n;u&&f&&(u.scrollTop=u.scrollTop+f.offsetHeight)}}):null});pR.displayName=Hm;var mR=w.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:a,...o}=e,s=qa("SelectScrollButton",n),c=w.useRef(null),u=_d(n),f=w.useCallback(()=>{c.current!==null&&(window.clearInterval(c.current),c.current=null)},[]);return w.useEffect(()=>()=>f(),[f]),on(()=>{var m;const h=u().find(g=>g.ref.current===document.activeElement);(m=h==null?void 0:h.ref.current)==null||m.scrollIntoView({block:"nearest"})},[u]),x.jsx(Ie.div,{"aria-hidden":!0,...o,ref:t,style:{flexShrink:0,...o.style},onPointerDown:Be(o.onPointerDown,()=>{c.current===null&&(c.current=window.setInterval(a,50))}),onPointerMove:Be(o.onPointerMove,()=>{var h;(h=s.onItemLeave)==null||h.call(s),c.current===null&&(c.current=window.setInterval(a,50))}),onPointerLeave:Be(o.onPointerLeave,()=>{f()})})}),gI="SelectSeparator",gR=w.forwardRef((e,t)=>{const{__scopeSelect:n,...a}=e;return x.jsx(Ie.div,{"aria-hidden":!0,...a,ref:t})});gR.displayName=gI;var $m="SelectArrow",vI=w.forwardRef((e,t)=>{const{__scopeSelect:n,...a}=e,o=Td(n),s=Va($m,n),c=qa($m,n);return s.open&&c.position==="popper"?x.jsx(pg,{...o,...a,ref:t}):null});vI.displayName=$m;function vR(e){return e===""||e===void 0}var yR=w.forwardRef((e,t)=>{const{value:n,...a}=e,o=w.useRef(null),s=at(t,o),c=HT(n);return w.useEffect(()=>{const u=o.current,f=window.HTMLSelectElement.prototype,m=Object.getOwnPropertyDescriptor(f,"value").set;if(c!==n&&m){const g=new Event("change",{bubbles:!0});m.call(u,n),u.dispatchEvent(g)}},[c,n]),x.jsx(yg,{asChild:!0,children:x.jsx("select",{...a,ref:s,defaultValue:n})})});yR.displayName="BubbleSelect";function bR(e){const t=Zt(e),n=w.useRef(""),a=w.useRef(0),o=w.useCallback(c=>{const u=n.current+c;t(u),function f(h){n.current=h,window.clearTimeout(a.current),h!==""&&(a.current=window.setTimeout(()=>f(""),1e3))}(u)},[t]),s=w.useCallback(()=>{n.current="",window.clearTimeout(a.current)},[]);return w.useEffect(()=>()=>window.clearTimeout(a.current),[]),[n,o,s]}function xR(e,t,n){const o=t.length>1&&Array.from(t).every(h=>h===t[0])?t[0]:t,s=n?e.indexOf(n):-1;let c=yI(e,Math.max(s,0));o.length===1&&(c=c.filter(h=>h!==n));const f=c.find(h=>h.textValue.toLowerCase().startsWith(o.toLowerCase()));return f!==n?f:void 0}function yI(e,t){return e.map((n,a)=>e[(t+a)%e.length])}var bI=qC,wR=WC,xI=KC,wI=ZC,EI=QC,ER=JC,SI=rR,_I=iR,SR=sR,_R=cR,TI=uR,CI=fR,TR=hR,CR=pR,RR=gR;const M1=bI,P1=_I,G1=xI,Vm=w.forwardRef(({className:e,children:t,...n},a)=>x.jsxs(wR,{ref:a,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,x.jsx(wI,{asChild:!0,children:x.jsx(tg,{className:"h-4 w-4 opacity-50"})})]}));Vm.displayName=wR.displayName;const AR=w.forwardRef(({className:e,...t},n)=>x.jsx(TR,{ref:n,className:Me("flex cursor-default items-center justify-center py-1",e),...t,children:x.jsx(kE,{className:"h-4 w-4"})}));AR.displayName=TR.displayName;const kR=w.forwardRef(({className:e,...t},n)=>x.jsx(CR,{ref:n,className:Me("flex cursor-default items-center justify-center py-1",e),...t,children:x.jsx(tg,{className:"h-4 w-4"})}));kR.displayName=CR.displayName;const qm=w.forwardRef(({className:e,children:t,position:n="popper",...a},o)=>x.jsx(EI,{children:x.jsxs(ER,{ref:o,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,...a,children:[x.jsx(AR,{}),x.jsx(SI,{className:Me("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),x.jsx(kR,{})]})}));qm.displayName=ER.displayName;const RI=w.forwardRef(({className:e,...t},n)=>x.jsx(SR,{ref:n,className:Me("py-1.5 pr-2 pl-8 text-sm font-semibold",e),...t}));RI.displayName=SR.displayName;const ta=w.forwardRef(({className:e,children:t,...n},a)=>x.jsxs(_R,{ref:a,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:[x.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:x.jsx(CI,{children:x.jsx(eg,{className:"h-4 w-4"})})}),x.jsx(TI,{children:t})]}));ta.displayName=_R.displayName;const AI=w.forwardRef(({className:e,...t},n)=>x.jsx(RR,{ref:n,className:Me("bg-muted -mx-1 my-1 h-px",e),...t}));AI.displayName=RR.displayName;function kI(){var n,a;const e=We(o=>o.querySettings),t=w.useCallback((o,s)=>{We.getState().updateQuerySettings({[o]:s})},[]);return x.jsxs(dl,{className:"flex shrink-0 flex-col",children:[x.jsxs(zu,{className:"px-4 pt-4 pb-2",children:[x.jsx(fl,{children:"Parameters"}),x.jsx(yd,{children:"Configure your query parameters"})]}),x.jsx(Mu,{className:"m-0 flex grow flex-col p-0 text-xs",children:x.jsx("div",{className:"relative size-full",children:x.jsxs("div",{className:"absolute inset-0 flex flex-col gap-2 overflow-auto px-2",children:[x.jsxs(x.Fragment,{children:[x.jsx(bn,{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"}),x.jsxs(M1,{value:e.mode,onValueChange:o=>t("mode",o),children:[x.jsx(Vm,{className:"hover:bg-primary/5 h-9 cursor-pointer focus:ring-0 focus:ring-offset-0 focus:outline-0 active:right-0",children:x.jsx(G1,{})}),x.jsx(qm,{children:x.jsxs(P1,{children:[x.jsx(ta,{value:"naive",children:"Naive"}),x.jsx(ta,{value:"local",children:"Local"}),x.jsx(ta,{value:"global",children:"Global"}),x.jsx(ta,{value:"hybrid",children:"Hybrid"}),x.jsx(ta,{value:"mix",children:"Mix"})]})})]})]}),x.jsxs(x.Fragment,{children:[x.jsx(bn,{className:"ml-1",text:"Response Format",tooltip:"Defines the response format. Examples:\\n• Multiple Paragraphs\\n• Single Paragraph\\n• Bullet Points",side:"left"}),x.jsxs(M1,{value:e.response_type,onValueChange:o=>t("response_type",o),children:[x.jsx(Vm,{className:"hover:bg-primary/5 h-9 cursor-pointer focus:ring-0 focus:ring-offset-0 focus:outline-0 active:right-0",children:x.jsx(G1,{})}),x.jsx(qm,{children:x.jsxs(P1,{children:[x.jsx(ta,{value:"Multiple Paragraphs",children:"Multiple Paragraphs"}),x.jsx(ta,{value:"Single Paragraph",children:"Single Paragraph"}),x.jsx(ta,{value:"Bullet Points",children:"Bullet Points"})]})})]})]}),x.jsxs(x.Fragment,{children:[x.jsx(bn,{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"}),x.jsx(_o,{id:"top_k",stepper:1,value:e.top_k,onValueChange:o=>t("top_k",o),min:1,placeholder:"Number of results"})]}),x.jsxs(x.Fragment,{children:[x.jsxs(x.Fragment,{children:[x.jsx(bn,{className:"ml-1",text:"Max Tokens for Text Unit",tooltip:"Maximum number of tokens allowed for each retrieved text chunk",side:"left"}),x.jsx(_o,{id:"max_token_for_text_unit",stepper:500,value:e.max_token_for_text_unit,onValueChange:o=>t("max_token_for_text_unit",o),min:1,placeholder:"Max tokens for text unit"})]}),x.jsxs(x.Fragment,{children:[x.jsx(bn,{text:"Max Tokens for Global Context",tooltip:"Maximum number of tokens allocated for relationship descriptions in global retrieval",side:"left"}),x.jsx(_o,{id:"max_token_for_global_context",stepper:500,value:e.max_token_for_global_context,onValueChange:o=>t("max_token_for_global_context",o),min:1,placeholder:"Max tokens for global context"})]}),x.jsxs(x.Fragment,{children:[x.jsx(bn,{className:"ml-1",text:"Max Tokens for Local Context",tooltip:"Maximum number of tokens allocated for entity descriptions in local retrieval",side:"left"}),x.jsx(_o,{id:"max_token_for_local_context",stepper:500,value:e.max_token_for_local_context,onValueChange:o=>t("max_token_for_local_context",o),min:1,placeholder:"Max tokens for local context"})]})]}),x.jsxs(x.Fragment,{children:[x.jsx(bn,{className:"ml-1",text:"History Turns",tooltip:"Number of complete conversation turns (user-assistant pairs) to consider in the response context",side:"left"}),x.jsx(_o,{className:"!border-input",id:"history_turns",stepper:1,type:"text",value:e.history_turns,onValueChange:o=>t("history_turns",o),min:0,placeholder:"Number of history turns"})]}),x.jsxs(x.Fragment,{children:[x.jsxs(x.Fragment,{children:[x.jsx(bn,{className:"ml-1",text:"High-Level Keywords",tooltip:"List of high-level keywords to prioritize in retrieval. Separate with commas",side:"left"}),x.jsx(Lo,{id:"hl_keywords",type:"text",value:(n=e.hl_keywords)==null?void 0:n.join(", "),onChange:o=>{const s=o.target.value.split(",").map(c=>c.trim()).filter(c=>c!=="");t("hl_keywords",s)},placeholder:"Enter keywords"})]}),x.jsxs(x.Fragment,{children:[x.jsx(bn,{className:"ml-1",text:"Low-Level Keywords",tooltip:"List of low-level keywords to refine retrieval focus. Separate with commas",side:"left"}),x.jsx(Lo,{id:"ll_keywords",type:"text",value:(a=e.ll_keywords)==null?void 0:a.join(", "),onChange:o=>{const s=o.target.value.split(",").map(c=>c.trim()).filter(c=>c!=="");t("ll_keywords",s)},placeholder:"Enter keywords"})]})]}),x.jsxs(x.Fragment,{children:[x.jsxs("div",{className:"flex items-center gap-2",children:[x.jsx(bn,{className:"ml-1",text:"Only Need Context",tooltip:"If True, only returns the retrieved context without generating a response",side:"left"}),x.jsx("div",{className:"grow"}),x.jsx(il,{className:"mr-1 cursor-pointer",id:"only_need_context",checked:e.only_need_context,onCheckedChange:o=>t("only_need_context",o)})]}),x.jsxs("div",{className:"flex items-center gap-2",children:[x.jsx(bn,{className:"ml-1",text:"Only Need Prompt",tooltip:"If True, only returns the generated prompt without producing a response",side:"left"}),x.jsx("div",{className:"grow"}),x.jsx(il,{className:"mr-1 cursor-pointer",id:"only_need_prompt",checked:e.only_need_prompt,onCheckedChange:o=>t("only_need_prompt",o)})]}),x.jsxs("div",{className:"flex items-center gap-2",children:[x.jsx(bn,{className:"ml-1",text:"Stream Response",tooltip:"If True, enables streaming output for real-time responses",side:"left"}),x.jsx("div",{className:"grow"}),x.jsx(il,{className:"mr-1 cursor-pointer",id:"stream",checked:e.stream,onCheckedChange:o=>t("stream",o)})]})]})]})})})]})}function DI(){const[e,t]=w.useState(()=>We.getState().retrievalHistory||[]),[n,a]=w.useState(""),[o,s]=w.useState(!1),c=w.useRef(null),u=w.useCallback(()=>{var g;(g=c.current)==null||g.scrollIntoView({behavior:"smooth"})},[]),f=w.useCallback(async g=>{if(g.preventDefault(),!n.trim()||o)return;const y={content:n,role:"user"},b={content:"",role:"assistant"},S=[...e];t([...S,y,b]),a(""),s(!0);const E=T=>{b.content+=T,t(A=>{const D=[...A],k=D[D.length-1];return k.role==="assistant"&&(k.content=b.content),D})},_=We.getState(),N={..._.querySettings,query:y.content,conversation_history:S};try{if(_.querySettings.stream)await $N(N,E);else{const T=await HN(N);E(T.response)}}catch(T){E(`Error: Failed to get response -${Sr(T)}`)}finally{s(!1),We.getState().setRetrievalHistory([...S,y,b])}},[n,o,e,t]),h=Qg(e,100);w.useEffect(()=>u(),[h,u]);const m=w.useCallback(()=>{t([]),We.getState().setRetrievalHistory([])},[t]);return x.jsxs("div",{className:"flex size-full gap-2 px-2 pb-12",children:[x.jsxs("div",{className:"flex grow flex-col gap-4",children:[x.jsx("div",{className:"relative grow",children:x.jsx("div",{className:"bg-primary-foreground/60 absolute inset-0 flex flex-col overflow-auto rounded-lg border p-2",children:x.jsxs("div",{className:"flex min-h-0 flex-1 flex-col gap-2",children:[e.length===0?x.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((g,y)=>x.jsx("div",{className:`flex ${g.role==="user"?"justify-end":"justify-start"}`,children:x.jsxs("div",{className:`max-w-[80%] rounded-lg px-4 py-2 ${g.role==="user"?"bg-primary text-primary-foreground":"bg-muted"}`,children:[x.jsx("pre",{className:"break-words whitespace-pre-wrap",children:g.content}),g.content.length===0&&x.jsx(vO,{className:"animate-spin duration-2000"})]})},y)),x.jsx("div",{ref:c,className:"pb-1"})]})})}),x.jsxs("form",{onSubmit:f,className:"flex shrink-0 items-center gap-2",children:[x.jsxs(_t,{type:"button",variant:"outline",onClick:m,disabled:o,size:"sm",children:[x.jsx(DE,{}),"Clear"]}),x.jsx(Lo,{className:"flex-1",value:n,onChange:g=>a(g.target.value),placeholder:"Type your query...",disabled:o}),x.jsxs(_t,{type:"submit",variant:"default",disabled:o,size:"sm",children:[x.jsx(jO,{}),"Send"]})]})]}),x.jsx(kI,{})]})}function NI(){return x.jsx("iframe",{src:Z1+"/docs",className:"size-full"})}function OI(){const e=Wn.use.message(),t=We.use.enableHealthCheck(),[n]=w.useState(()=>We.getState().currentTab);w.useEffect(()=>{if(!t)return;Wn.getState().check();const o=setInterval(async()=>{await Wn.getState().check()},nD*1e3);return()=>clearInterval(o)},[t]);const a=w.useCallback(o=>We.getState().setCurrentTab(o),[]);return x.jsx(oD,{children:x.jsxs("main",{className:"flex h-screen w-screen overflow-x-hidden",children:[x.jsxs(PM,{defaultValue:n,className:"!m-0 flex grow flex-col !p-0",onValueChange:a,children:[x.jsx(FM,{}),x.jsxs("div",{className:"relative grow",children:[x.jsx(tl,{value:"documents",className:"absolute top-0 right-0 bottom-0 left-0",children:x.jsx(DB,{})}),x.jsx(tl,{value:"knowledge-graph",className:"absolute top-0 right-0 bottom-0 left-0",children:x.jsx(eU,{})}),x.jsx(tl,{value:"retrieval",className:"absolute top-0 right-0 bottom-0 left-0",children:x.jsx(DI,{})}),x.jsx(tl,{value:"api",className:"absolute top-0 right-0 bottom-0 left-0",children:x.jsx(NI,{})})]})]}),t&&x.jsx(Tz,{}),e!==null&&x.jsx(qO,{}),x.jsx(Qz,{})]})})}JA.createRoot(document.getElementById("root")).render(x.jsx(w.StrictMode,{children:x.jsx(OI,{})})); diff --git a/lightrag/api/webui/assets/index-CLgSwrjG.css b/lightrag/api/webui/assets/index-CLgSwrjG.css new file mode 100644 index 00000000..0a63c408 --- /dev/null +++ b/lightrag/api/webui/assets/index-CLgSwrjG.css @@ -0,0 +1 @@ +/*! tailwindcss v4.0.6 | MIT License | https://tailwindcss.com */@layer theme{:root,:host{--font-sans:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";--font-serif:ui-serif,Georgia,Cambria,"Times New Roman",Times,serif;--font-mono:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;--color-red-50:oklch(.971 .013 17.38);--color-red-100:oklch(.936 .032 17.717);--color-red-200:oklch(.885 .062 18.334);--color-red-300:oklch(.808 .114 19.571);--color-red-400:oklch(.704 .191 22.216);--color-red-500:oklch(.637 .237 25.331);--color-red-600:oklch(.577 .245 27.325);--color-red-700:oklch(.505 .213 27.518);--color-red-800:oklch(.444 .177 26.899);--color-red-900:oklch(.396 .141 25.723);--color-red-950:oklch(.258 .092 26.042);--color-orange-50:oklch(.98 .016 73.684);--color-orange-100:oklch(.954 .038 75.164);--color-orange-200:oklch(.901 .076 70.697);--color-orange-300:oklch(.837 .128 66.29);--color-orange-400:oklch(.75 .183 55.934);--color-orange-500:oklch(.705 .213 47.604);--color-orange-600:oklch(.646 .222 41.116);--color-orange-700:oklch(.553 .195 38.402);--color-orange-800:oklch(.47 .157 37.304);--color-orange-900:oklch(.408 .123 38.172);--color-orange-950:oklch(.266 .079 36.259);--color-amber-50:oklch(.987 .022 95.277);--color-amber-100:oklch(.962 .059 95.617);--color-amber-200:oklch(.924 .12 95.746);--color-amber-300:oklch(.879 .169 91.605);--color-amber-400:oklch(.828 .189 84.429);--color-amber-500:oklch(.769 .188 70.08);--color-amber-600:oklch(.666 .179 58.318);--color-amber-700:oklch(.555 .163 48.998);--color-amber-800:oklch(.473 .137 46.201);--color-amber-900:oklch(.414 .112 45.904);--color-amber-950:oklch(.279 .077 45.635);--color-yellow-50:oklch(.987 .026 102.212);--color-yellow-100:oklch(.973 .071 103.193);--color-yellow-200:oklch(.945 .129 101.54);--color-yellow-300:oklch(.905 .182 98.111);--color-yellow-400:oklch(.852 .199 91.936);--color-yellow-500:oklch(.795 .184 86.047);--color-yellow-600:oklch(.681 .162 75.834);--color-yellow-700:oklch(.554 .135 66.442);--color-yellow-800:oklch(.476 .114 61.907);--color-yellow-900:oklch(.421 .095 57.708);--color-yellow-950:oklch(.286 .066 53.813);--color-lime-50:oklch(.986 .031 120.757);--color-lime-100:oklch(.967 .067 122.328);--color-lime-200:oklch(.938 .127 124.321);--color-lime-300:oklch(.897 .196 126.665);--color-lime-400:oklch(.841 .238 128.85);--color-lime-500:oklch(.768 .233 130.85);--color-lime-600:oklch(.648 .2 131.684);--color-lime-700:oklch(.532 .157 131.589);--color-lime-800:oklch(.453 .124 130.933);--color-lime-900:oklch(.405 .101 131.063);--color-lime-950:oklch(.274 .072 132.109);--color-green-50:oklch(.982 .018 155.826);--color-green-100:oklch(.962 .044 156.743);--color-green-200:oklch(.925 .084 155.995);--color-green-300:oklch(.871 .15 154.449);--color-green-400:oklch(.792 .209 151.711);--color-green-500:oklch(.723 .219 149.579);--color-green-600:oklch(.627 .194 149.214);--color-green-700:oklch(.527 .154 150.069);--color-green-800:oklch(.448 .119 151.328);--color-green-900:oklch(.393 .095 152.535);--color-green-950:oklch(.266 .065 152.934);--color-emerald-50:oklch(.979 .021 166.113);--color-emerald-100:oklch(.95 .052 163.051);--color-emerald-200:oklch(.905 .093 164.15);--color-emerald-300:oklch(.845 .143 164.978);--color-emerald-400:oklch(.765 .177 163.223);--color-emerald-500:oklch(.696 .17 162.48);--color-emerald-600:oklch(.596 .145 163.225);--color-emerald-700:oklch(.508 .118 165.612);--color-emerald-800:oklch(.432 .095 166.913);--color-emerald-900:oklch(.378 .077 168.94);--color-emerald-950:oklch(.262 .051 172.552);--color-teal-50:oklch(.984 .014 180.72);--color-teal-100:oklch(.953 .051 180.801);--color-teal-200:oklch(.91 .096 180.426);--color-teal-300:oklch(.855 .138 181.071);--color-teal-400:oklch(.777 .152 181.912);--color-teal-500:oklch(.704 .14 182.503);--color-teal-600:oklch(.6 .118 184.704);--color-teal-700:oklch(.511 .096 186.391);--color-teal-800:oklch(.437 .078 188.216);--color-teal-900:oklch(.386 .063 188.416);--color-teal-950:oklch(.277 .046 192.524);--color-cyan-50:oklch(.984 .019 200.873);--color-cyan-100:oklch(.956 .045 203.388);--color-cyan-200:oklch(.917 .08 205.041);--color-cyan-300:oklch(.865 .127 207.078);--color-cyan-400:oklch(.789 .154 211.53);--color-cyan-500:oklch(.715 .143 215.221);--color-cyan-600:oklch(.609 .126 221.723);--color-cyan-700:oklch(.52 .105 223.128);--color-cyan-800:oklch(.45 .085 224.283);--color-cyan-900:oklch(.398 .07 227.392);--color-cyan-950:oklch(.302 .056 229.695);--color-sky-50:oklch(.977 .013 236.62);--color-sky-100:oklch(.951 .026 236.824);--color-sky-200:oklch(.901 .058 230.902);--color-sky-300:oklch(.828 .111 230.318);--color-sky-400:oklch(.746 .16 232.661);--color-sky-500:oklch(.685 .169 237.323);--color-sky-600:oklch(.588 .158 241.966);--color-sky-700:oklch(.5 .134 242.749);--color-sky-800:oklch(.443 .11 240.79);--color-sky-900:oklch(.391 .09 240.876);--color-sky-950:oklch(.293 .066 243.157);--color-blue-50:oklch(.97 .014 254.604);--color-blue-100:oklch(.932 .032 255.585);--color-blue-200:oklch(.882 .059 254.128);--color-blue-300:oklch(.809 .105 251.813);--color-blue-400:oklch(.707 .165 254.624);--color-blue-500:oklch(.623 .214 259.815);--color-blue-600:oklch(.546 .245 262.881);--color-blue-700:oklch(.488 .243 264.376);--color-blue-800:oklch(.424 .199 265.638);--color-blue-900:oklch(.379 .146 265.522);--color-blue-950:oklch(.282 .091 267.935);--color-indigo-50:oklch(.962 .018 272.314);--color-indigo-100:oklch(.93 .034 272.788);--color-indigo-200:oklch(.87 .065 274.039);--color-indigo-300:oklch(.785 .115 274.713);--color-indigo-400:oklch(.673 .182 276.935);--color-indigo-500:oklch(.585 .233 277.117);--color-indigo-600:oklch(.511 .262 276.966);--color-indigo-700:oklch(.457 .24 277.023);--color-indigo-800:oklch(.398 .195 277.366);--color-indigo-900:oklch(.359 .144 278.697);--color-indigo-950:oklch(.257 .09 281.288);--color-violet-50:oklch(.969 .016 293.756);--color-violet-100:oklch(.943 .029 294.588);--color-violet-200:oklch(.894 .057 293.283);--color-violet-300:oklch(.811 .111 293.571);--color-violet-400:oklch(.702 .183 293.541);--color-violet-500:oklch(.606 .25 292.717);--color-violet-600:oklch(.541 .281 293.009);--color-violet-700:oklch(.491 .27 292.581);--color-violet-800:oklch(.432 .232 292.759);--color-violet-900:oklch(.38 .189 293.745);--color-violet-950:oklch(.283 .141 291.089);--color-purple-50:oklch(.977 .014 308.299);--color-purple-100:oklch(.946 .033 307.174);--color-purple-200:oklch(.902 .063 306.703);--color-purple-300:oklch(.827 .119 306.383);--color-purple-400:oklch(.714 .203 305.504);--color-purple-500:oklch(.627 .265 303.9);--color-purple-600:oklch(.558 .288 302.321);--color-purple-700:oklch(.496 .265 301.924);--color-purple-800:oklch(.438 .218 303.724);--color-purple-900:oklch(.381 .176 304.987);--color-purple-950:oklch(.291 .149 302.717);--color-fuchsia-50:oklch(.977 .017 320.058);--color-fuchsia-100:oklch(.952 .037 318.852);--color-fuchsia-200:oklch(.903 .076 319.62);--color-fuchsia-300:oklch(.833 .145 321.434);--color-fuchsia-400:oklch(.74 .238 322.16);--color-fuchsia-500:oklch(.667 .295 322.15);--color-fuchsia-600:oklch(.591 .293 322.896);--color-fuchsia-700:oklch(.518 .253 323.949);--color-fuchsia-800:oklch(.452 .211 324.591);--color-fuchsia-900:oklch(.401 .17 325.612);--color-fuchsia-950:oklch(.293 .136 325.661);--color-pink-50:oklch(.971 .014 343.198);--color-pink-100:oklch(.948 .028 342.258);--color-pink-200:oklch(.899 .061 343.231);--color-pink-300:oklch(.823 .12 346.018);--color-pink-400:oklch(.718 .202 349.761);--color-pink-500:oklch(.656 .241 354.308);--color-pink-600:oklch(.592 .249 .584);--color-pink-700:oklch(.525 .223 3.958);--color-pink-800:oklch(.459 .187 3.815);--color-pink-900:oklch(.408 .153 2.432);--color-pink-950:oklch(.284 .109 3.907);--color-rose-50:oklch(.969 .015 12.422);--color-rose-100:oklch(.941 .03 12.58);--color-rose-200:oklch(.892 .058 10.001);--color-rose-300:oklch(.81 .117 11.638);--color-rose-400:oklch(.712 .194 13.428);--color-rose-500:oklch(.645 .246 16.439);--color-rose-600:oklch(.586 .253 17.585);--color-rose-700:oklch(.514 .222 16.935);--color-rose-800:oklch(.455 .188 13.697);--color-rose-900:oklch(.41 .159 10.272);--color-rose-950:oklch(.271 .105 12.094);--color-slate-50:oklch(.984 .003 247.858);--color-slate-100:oklch(.968 .007 247.896);--color-slate-200:oklch(.929 .013 255.508);--color-slate-300:oklch(.869 .022 252.894);--color-slate-400:oklch(.704 .04 256.788);--color-slate-500:oklch(.554 .046 257.417);--color-slate-600:oklch(.446 .043 257.281);--color-slate-700:oklch(.372 .044 257.287);--color-slate-800:oklch(.279 .041 260.031);--color-slate-900:oklch(.208 .042 265.755);--color-slate-950:oklch(.129 .042 264.695);--color-gray-50:oklch(.985 .002 247.839);--color-gray-100:oklch(.967 .003 264.542);--color-gray-200:oklch(.928 .006 264.531);--color-gray-300:oklch(.872 .01 258.338);--color-gray-400:oklch(.707 .022 261.325);--color-gray-500:oklch(.551 .027 264.364);--color-gray-600:oklch(.446 .03 256.802);--color-gray-700:oklch(.373 .034 259.733);--color-gray-800:oklch(.278 .033 256.848);--color-gray-900:oklch(.21 .034 264.665);--color-gray-950:oklch(.13 .028 261.692);--color-zinc-50:oklch(.985 0 0);--color-zinc-100:oklch(.967 .001 286.375);--color-zinc-200:oklch(.92 .004 286.32);--color-zinc-300:oklch(.871 .006 286.286);--color-zinc-400:oklch(.705 .015 286.067);--color-zinc-500:oklch(.552 .016 285.938);--color-zinc-600:oklch(.442 .017 285.786);--color-zinc-700:oklch(.37 .013 285.805);--color-zinc-800:oklch(.274 .006 286.033);--color-zinc-900:oklch(.21 .006 285.885);--color-zinc-950:oklch(.141 .005 285.823);--color-neutral-50:oklch(.985 0 0);--color-neutral-100:oklch(.97 0 0);--color-neutral-200:oklch(.922 0 0);--color-neutral-300:oklch(.87 0 0);--color-neutral-400:oklch(.708 0 0);--color-neutral-500:oklch(.556 0 0);--color-neutral-600:oklch(.439 0 0);--color-neutral-700:oklch(.371 0 0);--color-neutral-800:oklch(.269 0 0);--color-neutral-900:oklch(.205 0 0);--color-neutral-950:oklch(.145 0 0);--color-stone-50:oklch(.985 .001 106.423);--color-stone-100:oklch(.97 .001 106.424);--color-stone-200:oklch(.923 .003 48.717);--color-stone-300:oklch(.869 .005 56.366);--color-stone-400:oklch(.709 .01 56.259);--color-stone-500:oklch(.553 .013 58.071);--color-stone-600:oklch(.444 .011 73.639);--color-stone-700:oklch(.374 .01 67.558);--color-stone-800:oklch(.268 .007 34.298);--color-stone-900:oklch(.216 .006 56.043);--color-stone-950:oklch(.147 .004 49.25);--color-black:#000;--color-white:#fff;--spacing:.25rem;--breakpoint-sm:40rem;--breakpoint-md:48rem;--breakpoint-lg:64rem;--breakpoint-xl:80rem;--breakpoint-2xl:96rem;--container-3xs:16rem;--container-2xs:18rem;--container-xs:20rem;--container-sm:24rem;--container-md:28rem;--container-lg:32rem;--container-xl:36rem;--container-2xl:42rem;--container-3xl:48rem;--container-4xl:56rem;--container-5xl:64rem;--container-6xl:72rem;--container-7xl:80rem;--text-xs:.75rem;--text-xs--line-height:calc(1/.75);--text-sm:.875rem;--text-sm--line-height:calc(1.25/.875);--text-base:1rem;--text-base--line-height: 1.5 ;--text-lg:1.125rem;--text-lg--line-height:calc(1.75/1.125);--text-xl:1.25rem;--text-xl--line-height:calc(1.75/1.25);--text-2xl:1.5rem;--text-2xl--line-height:calc(2/1.5);--text-3xl:1.875rem;--text-3xl--line-height: 1.2 ;--text-4xl:2.25rem;--text-4xl--line-height:calc(2.5/2.25);--text-5xl:3rem;--text-5xl--line-height:1;--text-6xl:3.75rem;--text-6xl--line-height:1;--text-7xl:4.5rem;--text-7xl--line-height:1;--text-8xl:6rem;--text-8xl--line-height:1;--text-9xl:8rem;--text-9xl--line-height:1;--font-weight-thin:100;--font-weight-extralight:200;--font-weight-light:300;--font-weight-normal:400;--font-weight-medium:500;--font-weight-semibold:600;--font-weight-bold:700;--font-weight-extrabold:800;--font-weight-black:900;--tracking-tighter:-.05em;--tracking-tight:-.025em;--tracking-normal:0em;--tracking-wide:.025em;--tracking-wider:.05em;--tracking-widest:.1em;--leading-tight:1.25;--leading-snug:1.375;--leading-normal:1.5;--leading-relaxed:1.625;--leading-loose:2;--radius-xs:.125rem;--radius-sm:calc(var(--radius) - 4px);--radius-md:calc(var(--radius) - 2px);--radius-lg:var(--radius);--radius-xl:calc(var(--radius) + 4px);--radius-2xl:1rem;--radius-3xl:1.5rem;--radius-4xl:2rem;--shadow-2xs:0 1px #0000000d;--shadow-xs:0 1px 2px 0 #0000000d;--shadow-sm:0 1px 3px 0 #0000001a,0 1px 2px -1px #0000001a;--shadow-md:0 4px 6px -1px #0000001a,0 2px 4px -2px #0000001a;--shadow-lg:0 10px 15px -3px #0000001a,0 4px 6px -4px #0000001a;--shadow-xl:0 20px 25px -5px #0000001a,0 8px 10px -6px #0000001a;--shadow-2xl:0 25px 50px -12px #00000040;--inset-shadow-2xs:inset 0 1px #0000000d;--inset-shadow-xs:inset 0 1px 1px #0000000d;--inset-shadow-sm:inset 0 2px 4px #0000000d;--drop-shadow-xs:0 1px 1px #0000000d;--drop-shadow-sm:0 1px 2px #00000026;--drop-shadow-md:0 3px 3px #0000001f;--drop-shadow-lg:0 4px 4px #00000026;--drop-shadow-xl:0 9px 7px #0000001a;--drop-shadow-2xl:0 25px 25px #00000026;--ease-in:cubic-bezier(.4,0,1,1);--ease-out:cubic-bezier(0,0,.2,1);--ease-in-out:cubic-bezier(.4,0,.2,1);--animate-spin:spin 1s linear infinite;--animate-ping:ping 1s cubic-bezier(0,0,.2,1)infinite;--animate-pulse:pulse 2s cubic-bezier(.4,0,.6,1)infinite;--animate-bounce:bounce 1s infinite;--blur-xs:4px;--blur-sm:8px;--blur-md:12px;--blur-lg:16px;--blur-xl:24px;--blur-2xl:40px;--blur-3xl:64px;--perspective-dramatic:100px;--perspective-near:300px;--perspective-normal:500px;--perspective-midrange:800px;--perspective-distant:1200px;--aspect-video:16/9;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4,0,.2,1);--default-font-family:var(--font-sans);--default-font-feature-settings:var(--font-sans--font-feature-settings);--default-font-variation-settings:var(--font-sans--font-variation-settings);--default-mono-font-family:var(--font-mono);--default-mono-font-feature-settings:var(--font-mono--font-feature-settings);--default-mono-font-variation-settings:var(--font-mono--font-variation-settings);--color-background:var(--background);--color-foreground:var(--foreground);--color-card:var(--card);--color-card-foreground:var(--card-foreground);--color-popover:var(--popover);--color-popover-foreground:var(--popover-foreground);--color-primary:var(--primary);--color-primary-foreground:var(--primary-foreground);--color-secondary:var(--secondary);--color-secondary-foreground:var(--secondary-foreground);--color-muted:var(--muted);--color-muted-foreground:var(--muted-foreground);--color-accent:var(--accent);--color-accent-foreground:var(--accent-foreground);--color-destructive:var(--destructive);--color-destructive-foreground:var(--destructive-foreground);--color-border:var(--border);--color-input:var(--input);--color-ring:var(--ring);--color-chart-1:var(--chart-1);--color-chart-2:var(--chart-2);--color-chart-3:var(--chart-3);--color-chart-4:var(--chart-4);--color-chart-5:var(--chart-5);--color-sidebar-ring:var(--sidebar-ring);--color-sidebar-border:var(--sidebar-border);--color-sidebar-accent-foreground:var(--sidebar-accent-foreground);--color-sidebar-accent:var(--sidebar-accent);--color-sidebar-primary-foreground:var(--sidebar-primary-foreground);--color-sidebar-primary:var(--sidebar-primary);--color-sidebar-foreground:var(--sidebar-foreground);--color-sidebar:var(--sidebar-background);--animate-accordion-down:accordion-down .2s ease-out;--animate-accordion-up:accordion-up .2s ease-out}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;-moz-tab-size:4;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}body{line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1;color:color-mix(in oklab,currentColor 50%,transparent)}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){-webkit-appearance:button;-moz-appearance:button;appearance:button}::file-selector-button{-webkit-appearance:button;-moz-appearance:button;appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}*{border-color:var(--border);outline-color:color-mix(in oklab,var(--ring)50%,transparent)}body{background-color:var(--background);color:var(--foreground)}*{scrollbar-color:initial;scrollbar-width:initial}}@layer components;@layer utilities{.pointer-events-none{pointer-events:none}.invisible{visibility:hidden}.visible{visibility:visible}.sr-only{clip:rect(0,0,0,0);white-space:nowrap;border-width:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.static{position:static}.sticky{position:sticky}.inset-0{inset:calc(var(--spacing)*0)}.top-0{top:calc(var(--spacing)*0)}.top-1\/2{top:50%}.top-2{top:calc(var(--spacing)*2)}.top-4{top:calc(var(--spacing)*4)}.top-12{top:calc(var(--spacing)*12)}.top-\[50\%\]{top:50%}.right-0{right:calc(var(--spacing)*0)}.right-2{right:calc(var(--spacing)*2)}.right-4{right:calc(var(--spacing)*4)}.bottom-0{bottom:calc(var(--spacing)*0)}.bottom-2{bottom:calc(var(--spacing)*2)}.bottom-4{bottom:calc(var(--spacing)*4)}.left-0{left:calc(var(--spacing)*0)}.left-1\/2{left:50%}.left-2{left:calc(var(--spacing)*2)}.left-\[50\%\]{left:50%}.isolate{isolation:isolate}.z-50{z-index:50}.\!container{width:100%!important}@media (width>=40rem){.\!container{max-width:40rem!important}}@media (width>=48rem){.\!container{max-width:48rem!important}}@media (width>=64rem){.\!container{max-width:64rem!important}}@media (width>=80rem){.\!container{max-width:80rem!important}}@media (width>=96rem){.\!container{max-width:96rem!important}}.container{width:100%}@media (width>=40rem){.container{max-width:40rem}}@media (width>=48rem){.container{max-width:48rem}}@media (width>=64rem){.container{max-width:64rem}}@media (width>=80rem){.container{max-width:80rem}}@media (width>=96rem){.container{max-width:96rem}}.\!m-0{margin:calc(var(--spacing)*0)!important}.m-0{margin:calc(var(--spacing)*0)}.-mx-1{margin-inline:calc(var(--spacing)*-1)}.mx-1{margin-inline:calc(var(--spacing)*1)}.my-1{margin-block:calc(var(--spacing)*1)}.mt-2{margin-top:calc(var(--spacing)*2)}.mt-4{margin-top:calc(var(--spacing)*4)}.mr-1{margin-right:calc(var(--spacing)*1)}.mr-2{margin-right:calc(var(--spacing)*2)}.mr-4{margin-right:calc(var(--spacing)*4)}.mr-6{margin-right:calc(var(--spacing)*6)}.mb-1{margin-bottom:calc(var(--spacing)*1)}.mb-2{margin-bottom:calc(var(--spacing)*2)}.ml-1{margin-left:calc(var(--spacing)*1)}.ml-2{margin-left:calc(var(--spacing)*2)}.ml-auto{margin-left:auto}.scrollbar{scrollbar-width:auto;scrollbar-color:var(--scrollbar-thumb,initial)var(--scrollbar-track,initial)}.scrollbar::-webkit-scrollbar-track{background-color:var(--scrollbar-track);border-radius:var(--scrollbar-track-radius)}.scrollbar::-webkit-scrollbar-thumb{background-color:var(--scrollbar-thumb);border-radius:var(--scrollbar-thumb-radius)}.scrollbar::-webkit-scrollbar-corner{background-color:var(--scrollbar-corner);border-radius:var(--scrollbar-corner-radius)}.scrollbar::-webkit-scrollbar{width:var(--scrollbar-width,16px);height:var(--scrollbar-height,16px);display:block}.line-clamp-1{-webkit-line-clamp:1;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.block{display:block}.contents{display:contents}.flex{display:flex}.grid{display:grid}.hidden{display:none}.inline{display:inline}.inline-block{display:inline-block}.inline-flex{display:inline-flex}.inline-grid{display:inline-grid}.table{display:table}.aspect-square{aspect-ratio:1}.\!size-full{width:100%!important;height:100%!important}.size-4{width:calc(var(--spacing)*4);height:calc(var(--spacing)*4)}.size-7{width:calc(var(--spacing)*7);height:calc(var(--spacing)*7)}.size-8{width:calc(var(--spacing)*8);height:calc(var(--spacing)*8)}.size-10{width:calc(var(--spacing)*10);height:calc(var(--spacing)*10)}.size-full{width:100%;height:100%}.h-1\/2{height:50%}.h-2\.5{height:calc(var(--spacing)*2.5)}.h-3{height:calc(var(--spacing)*3)}.h-3\.5{height:calc(var(--spacing)*3.5)}.h-4{height:calc(var(--spacing)*4)}.h-6{height:calc(var(--spacing)*6)}.h-8{height:calc(var(--spacing)*8)}.h-9{height:calc(var(--spacing)*9)}.h-10{height:calc(var(--spacing)*10)}.h-11{height:calc(var(--spacing)*11)}.h-52{height:calc(var(--spacing)*52)}.h-\[1px\]{height:1px}.h-\[var\(--radix-select-trigger-height\)\]{height:var(--radix-select-trigger-height)}.h-fit{height:fit-content}.h-full{height:100%}.h-px{height:1px}.h-screen{height:100vh}.max-h-8{max-height:calc(var(--spacing)*8)}.max-h-48{max-height:calc(var(--spacing)*48)}.max-h-96{max-height:calc(var(--spacing)*96)}.max-h-\[300px\]{max-height:300px}.max-h-full{max-height:100%}.min-h-0{min-height:calc(var(--spacing)*0)}.w-0{width:calc(var(--spacing)*0)}.w-2\.5{width:calc(var(--spacing)*2.5)}.w-3{width:calc(var(--spacing)*3)}.w-3\.5{width:calc(var(--spacing)*3.5)}.w-4{width:calc(var(--spacing)*4)}.w-6{width:calc(var(--spacing)*6)}.w-16{width:calc(var(--spacing)*16)}.w-24{width:calc(var(--spacing)*24)}.w-\[1px\]{width:1px}.w-auto{width:auto}.w-full{width:100%}.w-screen{width:100vw}.max-w-80{max-width:calc(var(--spacing)*80)}.max-w-\[80\%\]{max-width:80%}.max-w-lg{max-width:var(--container-lg)}.max-w-none{max-width:none}.max-w-sm{max-width:var(--container-sm)}.max-w-xs{max-width:var(--container-xs)}.min-w-0{min-width:calc(var(--spacing)*0)}.min-w-24{min-width:calc(var(--spacing)*24)}.min-w-\[8rem\]{min-width:8rem}.min-w-\[300px\]{min-width:300px}.min-w-\[var\(--radix-select-trigger-width\)\]{min-width:var(--radix-select-trigger-width)}.flex-1{flex:1}.flex-auto{flex:auto}.flex-shrink,.shrink{flex-shrink:1}.shrink-0{flex-shrink:0}.flex-grow,.grow{flex-grow:1}.caption-bottom{caption-side:bottom}.-translate-x-1\/2{--tw-translate-x: -50% ;translate:var(--tw-translate-x)var(--tw-translate-y)}.-translate-y-1\/2{--tw-translate-y: -50% ;translate:var(--tw-translate-x)var(--tw-translate-y)}.-translate-y-20{--tw-translate-y:calc(var(--spacing)*-20);translate:var(--tw-translate-x)var(--tw-translate-y)}.translate-x-\[-50\%\]{--tw-translate-x:-50%;translate:var(--tw-translate-x)var(--tw-translate-y)}.translate-y-0{--tw-translate-y:calc(var(--spacing)*0);translate:var(--tw-translate-x)var(--tw-translate-y)}.translate-y-\[-50\%\]{--tw-translate-y:-50%;translate:var(--tw-translate-x)var(--tw-translate-y)}.scale-125{--tw-scale-x:125%;--tw-scale-y:125%;--tw-scale-z:125%;scale:var(--tw-scale-x)var(--tw-scale-y)}.scale-3d{scale:var(--tw-scale-x)var(--tw-scale-y)var(--tw-scale-z)}.transform{transform:var(--tw-rotate-x)var(--tw-rotate-y)var(--tw-rotate-z)var(--tw-skew-x)var(--tw-skew-y)}.animate-pulse{animation:var(--animate-pulse)}.animate-spin{animation:var(--animate-spin)}.cursor-default{cursor:default}.cursor-help{cursor:help}.cursor-not-allowed{cursor:not-allowed}.cursor-pointer{cursor:pointer}.touch-none{touch-action:none}.resize{resize:both}.\[appearance\:textfield\]{-webkit-appearance:textfield;-moz-appearance:textfield;appearance:textfield}.columns-2{columns:2}.columns-3{columns:3}.columns-4{columns:4}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.flex-col{flex-direction:column}.flex-col-reverse{flex-direction:column-reverse}.place-items-center{place-items:center}.items-center{align-items:center}.items-start{align-items:flex-start}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.justify-end{justify-content:flex-end}.justify-start{justify-content:flex-start}.gap-1{gap:calc(var(--spacing)*1)}.gap-1\.5{gap:calc(var(--spacing)*1.5)}.gap-2{gap:calc(var(--spacing)*2)}.gap-2\.5{gap:calc(var(--spacing)*2.5)}.gap-4{gap:calc(var(--spacing)*4)}.gap-6{gap:calc(var(--spacing)*6)}.gap-px{gap:1px}:where(.space-y-1>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*1)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*1)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-1\.5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*1.5)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*1.5)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-2>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*2)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*2)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-3>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*3)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*3)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-4>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*4)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*4)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-6>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*6)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*6)*calc(1 - var(--tw-space-y-reverse)))}.self-center{align-self:center}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-visible{overflow:visible}.overflow-x-hidden{overflow-x:hidden}.overflow-y-auto{overflow-y:auto}.\!rounded-none{border-radius:0!important}.rounded{border-radius:.25rem}.rounded-\[inherit\]{border-radius:inherit}.rounded-full{border-radius:3.40282e38px}.rounded-lg{border-radius:var(--radius)}.rounded-md{border-radius:calc(var(--radius) - 2px)}.rounded-sm{border-radius:calc(var(--radius) - 4px)}.rounded-xl{border-radius:calc(var(--radius) + 4px)}.rounded-l-none{border-top-left-radius:0;border-bottom-left-radius:0}.rounded-tr-none{border-top-right-radius:0}.rounded-br-none{border-bottom-right-radius:0}.border,.border-1{border-style:var(--tw-border-style);border-width:1px}.border-2{border-style:var(--tw-border-style);border-width:2px}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-l{border-left-style:var(--tw-border-style);border-left-width:1px}.\!border-none{--tw-border-style:none!important;border-style:none!important}.border-dashed{--tw-border-style:dashed;border-style:dashed}.\!border-input{border-color:var(--input)!important}.border-border\/40{border-color:color-mix(in oklab,var(--border)40%,transparent)}.border-destructive\/50{border-color:color-mix(in oklab,var(--destructive)50%,transparent)}.border-input{border-color:var(--input)}.border-muted-foreground\/25{border-color:color-mix(in oklab,var(--muted-foreground)25%,transparent)}.border-muted-foreground\/50{border-color:color-mix(in oklab,var(--muted-foreground)50%,transparent)}.border-primary{border-color:var(--primary)}.border-t-transparent{border-top-color:#0000}.border-l-transparent{border-left-color:#0000}.\!bg-background{background-color:var(--background)!important}.\!bg-emerald-400{background-color:var(--color-emerald-400)!important}.bg-background{background-color:var(--background)}.bg-background\/60{background-color:color-mix(in oklab,var(--background)60%,transparent)}.bg-background\/80{background-color:color-mix(in oklab,var(--background)80%,transparent)}.bg-background\/90{background-color:color-mix(in oklab,var(--background)90%,transparent)}.bg-background\/95{background-color:color-mix(in oklab,var(--background)95%,transparent)}.bg-black\/80{background-color:color-mix(in oklab,var(--color-black)80%,transparent)}.bg-border{background-color:var(--border)}.bg-card{background-color:var(--card)}.bg-destructive{background-color:var(--destructive)}.bg-foreground\/10{background-color:color-mix(in oklab,var(--foreground)10%,transparent)}.bg-green-500{background-color:var(--color-green-500)}.bg-muted{background-color:var(--muted)}.bg-muted\/50{background-color:color-mix(in oklab,var(--muted)50%,transparent)}.bg-popover{background-color:var(--popover)}.bg-primary{background-color:var(--primary)}.bg-primary-foreground\/60{background-color:color-mix(in oklab,var(--primary-foreground)60%,transparent)}.bg-primary\/5{background-color:color-mix(in oklab,var(--primary)5%,transparent)}.bg-red-500{background-color:var(--color-red-500)}.bg-red-700{background-color:var(--color-red-700)}.bg-secondary{background-color:var(--secondary)}.bg-transparent{background-color:#0000}.object-cover{object-fit:cover}.\!p-0{padding:calc(var(--spacing)*0)!important}.\!p-2{padding:calc(var(--spacing)*2)!important}.p-0{padding:calc(var(--spacing)*0)}.p-1{padding:calc(var(--spacing)*1)}.p-2{padding:calc(var(--spacing)*2)}.p-3{padding:calc(var(--spacing)*3)}.p-4{padding:calc(var(--spacing)*4)}.p-6{padding:calc(var(--spacing)*6)}.p-16{padding:calc(var(--spacing)*16)}.p-\[1px\]{padding:1px}.px-2{padding-inline:calc(var(--spacing)*2)}.px-3{padding-inline:calc(var(--spacing)*3)}.px-4{padding-inline:calc(var(--spacing)*4)}.px-5{padding-inline:calc(var(--spacing)*5)}.px-8{padding-inline:calc(var(--spacing)*8)}.py-1{padding-block:calc(var(--spacing)*1)}.py-1\.5{padding-block:calc(var(--spacing)*1.5)}.py-2{padding-block:calc(var(--spacing)*2)}.py-2\.5{padding-block:calc(var(--spacing)*2.5)}.py-3{padding-block:calc(var(--spacing)*3)}.py-6{padding-block:calc(var(--spacing)*6)}.pt-0{padding-top:calc(var(--spacing)*0)}.pt-4{padding-top:calc(var(--spacing)*4)}.pr-2{padding-right:calc(var(--spacing)*2)}.pb-1{padding-bottom:calc(var(--spacing)*1)}.pb-2{padding-bottom:calc(var(--spacing)*2)}.pb-12{padding-bottom:calc(var(--spacing)*12)}.pl-1{padding-left:calc(var(--spacing)*1)}.pl-8{padding-left:calc(var(--spacing)*8)}.text-center{text-align:center}.text-left{text-align:left}.align-middle{vertical-align:middle}.font-mono{font-family:var(--font-mono)}.text-base{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}.text-lg{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.leading-none{--tw-leading:1;line-height:1}.font-bold{--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.tracking-tight{--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.tracking-wide{--tw-tracking:var(--tracking-wide);letter-spacing:var(--tracking-wide)}.tracking-widest{--tw-tracking:var(--tracking-widest);letter-spacing:var(--tracking-widest)}.break-words{overflow-wrap:break-word}.text-ellipsis{text-overflow:ellipsis}.whitespace-nowrap{white-space:nowrap}.whitespace-pre-wrap{white-space:pre-wrap}.\!text-zinc-50{color:var(--color-zinc-50)!important}.text-blue-600{color:var(--color-blue-600)}.text-card-foreground{color:var(--card-foreground)}.text-current{color:currentColor}.text-destructive{color:var(--destructive)}.text-destructive-foreground{color:var(--destructive-foreground)}.text-emerald-400{color:var(--color-emerald-400)}.text-foreground{color:var(--foreground)}.text-foreground\/80{color:color-mix(in oklab,var(--foreground)80%,transparent)}.text-green-600{color:var(--color-green-600)}.text-muted{color:var(--muted)}.text-muted-foreground{color:var(--muted-foreground)}.text-muted-foreground\/70{color:color-mix(in oklab,var(--muted-foreground)70%,transparent)}.text-popover-foreground{color:var(--popover-foreground)}.text-primary{color:var(--primary)}.text-primary-foreground{color:var(--primary-foreground)}.text-primary\/60{color:color-mix(in oklab,var(--primary)60%,transparent)}.text-red-500{color:var(--color-red-500)}.text-red-600{color:var(--color-red-600)}.text-secondary-foreground{color:var(--secondary-foreground)}.text-sky-300{color:var(--color-sky-300)}.text-teal-600{color:var(--color-teal-600)}.text-teal-600\/90{color:color-mix(in oklab,var(--color-teal-600)90%,transparent)}.text-white{color:var(--color-white)}.text-yellow-400\/90{color:color-mix(in oklab,var(--color-yellow-400)90%,transparent)}.text-yellow-600{color:var(--color-yellow-600)}.uppercase{text-transform:uppercase}.italic{font-style:italic}.underline{text-decoration-line:underline}.underline-offset-4{text-underline-offset:4px}.opacity-0{opacity:0}.opacity-50{opacity:.5}.opacity-60{opacity:.6}.opacity-70{opacity:.7}.opacity-80{opacity:.8}.opacity-100{opacity:1}.shadow{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a),0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_0_8px_rgba\(0\,0\,0\,0\.2\)\]{--tw-shadow:0 0 8px var(--tw-shadow-color,#0003);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_0_12px_rgba\(34\,197\,94\,0\.4\)\]{--tw-shadow:0 0 12px var(--tw-shadow-color,#22c55e66);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_0_12px_rgba\(239\,68\,68\,0\.4\)\]{--tw-shadow:0 0 12px var(--tw-shadow-color,#ef444466);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-lg{--tw-shadow:0 10px 15px -3px var(--tw-shadow-color,#0000001a),0 4px 6px -4px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-md{--tw-shadow:0 4px 6px -1px var(--tw-shadow-color,#0000001a),0 2px 4px -2px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-sm{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a),0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring-offset-background{--tw-ring-offset-color:var(--background)}.outline{outline-style:var(--tw-outline-style);outline-width:1px}.blur{--tw-blur:blur(8px);filter:var(--tw-blur,)var(--tw-brightness,)var(--tw-contrast,)var(--tw-grayscale,)var(--tw-hue-rotate,)var(--tw-invert,)var(--tw-saturate,)var(--tw-sepia,)var(--tw-drop-shadow,)}.invert{--tw-invert:invert(100%);filter:var(--tw-blur,)var(--tw-brightness,)var(--tw-contrast,)var(--tw-grayscale,)var(--tw-hue-rotate,)var(--tw-invert,)var(--tw-saturate,)var(--tw-sepia,)var(--tw-drop-shadow,)}.\!filter{filter:var(--tw-blur,)var(--tw-brightness,)var(--tw-contrast,)var(--tw-grayscale,)var(--tw-hue-rotate,)var(--tw-invert,)var(--tw-saturate,)var(--tw-sepia,)var(--tw-drop-shadow,)!important}.filter{filter:var(--tw-blur,)var(--tw-brightness,)var(--tw-contrast,)var(--tw-grayscale,)var(--tw-hue-rotate,)var(--tw-invert,)var(--tw-saturate,)var(--tw-sepia,)var(--tw-drop-shadow,)}.backdrop-blur{--tw-backdrop-blur:blur(8px);-webkit-backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,)}.backdrop-blur-lg{--tw-backdrop-blur:blur(var(--blur-lg));-webkit-backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,)}.transition{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-all{transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-opacity{transition-property:opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.duration-200{--tw-duration:.2s;transition-duration:.2s}.duration-300{--tw-duration:.3s;transition-duration:.3s}.duration-500{--tw-duration:.5s;transition-duration:.5s}.duration-2000{--tw-duration:2s;transition-duration:2s}.ease-in-out{--tw-ease:var(--ease-in-out);transition-timing-function:var(--ease-in-out)}.animate-in{--tw-enter-opacity:initial;--tw-enter-scale:initial;--tw-enter-rotate:initial;--tw-enter-translate-x:initial;--tw-enter-translate-y:initial;animation-name:enter;animation-duration:.15s}.duration-200{animation-duration:.2s}.duration-300{animation-duration:.3s}.duration-500{animation-duration:.5s}.duration-2000{animation-duration:2s}.ease-in-out{animation-timing-function:cubic-bezier(.4,0,.2,1)}.fade-in-0{--tw-enter-opacity:0}.outline-none{--tw-outline-style:none;outline-style:none}.paused{animation-play-state:paused}.repeat-1{animation-iteration-count:1}.running{animation-play-state:running}.select-none{-webkit-user-select:none;user-select:none}.zoom-in{--tw-enter-scale:0}.zoom-in-95{--tw-enter-scale:.95}.zoom-out{--tw-exit-scale:0}.peer-disabled\:cursor-not-allowed:is(:where(.peer):disabled~*){cursor:not-allowed}.peer-disabled\:opacity-70:is(:where(.peer):disabled~*){opacity:.7}.file\:border-0::file-selector-button{border-style:var(--tw-border-style);border-width:0}.file\:bg-transparent::file-selector-button{background-color:#0000}.file\:text-sm::file-selector-button{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.file\:font-medium::file-selector-button{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.file\:text-foreground::file-selector-button{color:var(--foreground)}.placeholder\:text-muted-foreground::placeholder{color:var(--muted-foreground)}@media (hover:hover){.hover\:w-fit:hover{width:fit-content}.hover\:bg-accent:hover{background-color:var(--accent)}.hover\:bg-background\/60:hover{background-color:color-mix(in oklab,var(--background)60%,transparent)}.hover\:bg-destructive\/90:hover{background-color:color-mix(in oklab,var(--destructive)90%,transparent)}.hover\:bg-muted\/25:hover{background-color:color-mix(in oklab,var(--muted)25%,transparent)}.hover\:bg-muted\/50:hover{background-color:color-mix(in oklab,var(--muted)50%,transparent)}.hover\:bg-primary\/5:hover{background-color:color-mix(in oklab,var(--primary)5%,transparent)}.hover\:bg-primary\/20:hover{background-color:color-mix(in oklab,var(--primary)20%,transparent)}.hover\:bg-primary\/90:hover{background-color:color-mix(in oklab,var(--primary)90%,transparent)}.hover\:bg-secondary\/80:hover{background-color:color-mix(in oklab,var(--secondary)80%,transparent)}.hover\:text-accent-foreground:hover{color:var(--accent-foreground)}.hover\:underline:hover{text-decoration-line:underline}.hover\:opacity-100:hover{opacity:1}}.focus\:bg-accent:focus{background-color:var(--accent)}.focus\:text-accent-foreground:focus{color:var(--accent-foreground)}.focus\:ring-0:focus{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(0px + var(--tw-ring-offset-width))var(--tw-ring-color,currentColor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus\:ring-2:focus{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(2px + var(--tw-ring-offset-width))var(--tw-ring-color,currentColor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus\:ring-ring:focus{--tw-ring-color:var(--ring)}.focus\:ring-offset-0:focus{--tw-ring-offset-width:0px;--tw-ring-offset-shadow:var(--tw-ring-inset,)0 0 0 var(--tw-ring-offset-width)var(--tw-ring-offset-color)}.focus\:ring-offset-2:focus{--tw-ring-offset-width:2px;--tw-ring-offset-shadow:var(--tw-ring-inset,)0 0 0 var(--tw-ring-offset-width)var(--tw-ring-offset-color)}.focus\:outline-0:focus{outline-style:var(--tw-outline-style);outline-width:0}.focus\:outline-none:focus{--tw-outline-style:none;outline-style:none}.focus-visible\:relative:focus-visible{position:relative}.focus-visible\:ring-1:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(1px + var(--tw-ring-offset-width))var(--tw-ring-color,currentColor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus-visible\:ring-2:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(2px + var(--tw-ring-offset-width))var(--tw-ring-color,currentColor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus-visible\:ring-ring:focus-visible{--tw-ring-color:var(--ring)}.focus-visible\:ring-offset-2:focus-visible{--tw-ring-offset-width:2px;--tw-ring-offset-shadow:var(--tw-ring-inset,)0 0 0 var(--tw-ring-offset-width)var(--tw-ring-offset-color)}.focus-visible\:outline-none:focus-visible{--tw-outline-style:none;outline-style:none}.active\:right-0:active{right:calc(var(--spacing)*0)}.disabled\:pointer-events-none:disabled{pointer-events:none}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:opacity-50:disabled{opacity:.5}.data-\[disabled\]\:pointer-events-none[data-disabled]{pointer-events:none}.data-\[disabled\]\:opacity-50[data-disabled]{opacity:.5}.data-\[disabled\=true\]\:pointer-events-none[data-disabled=true]{pointer-events:none}.data-\[disabled\=true\]\:opacity-50[data-disabled=true]{opacity:.5}.data-\[selected\=\'true\'\]\:bg-accent[data-selected=true]{background-color:var(--accent)}.data-\[selected\=true\]\:text-accent-foreground[data-selected=true]{color:var(--accent-foreground)}.data-\[side\=bottom\]\:translate-y-1[data-side=bottom]{--tw-translate-y:calc(var(--spacing)*1);translate:var(--tw-translate-x)var(--tw-translate-y)}.data-\[side\=bottom\]\:slide-in-from-top-2[data-side=bottom]{--tw-enter-translate-y:-.5rem}.data-\[side\=left\]\:-translate-x-1[data-side=left]{--tw-translate-x:calc(var(--spacing)*-1);translate:var(--tw-translate-x)var(--tw-translate-y)}.data-\[side\=left\]\:slide-in-from-right-2[data-side=left]{--tw-enter-translate-x:.5rem}.data-\[side\=right\]\:translate-x-1[data-side=right]{--tw-translate-x:calc(var(--spacing)*1);translate:var(--tw-translate-x)var(--tw-translate-y)}.data-\[side\=right\]\:slide-in-from-left-2[data-side=right]{--tw-enter-translate-x:-.5rem}.data-\[side\=top\]\:-translate-y-1[data-side=top]{--tw-translate-y:calc(var(--spacing)*-1);translate:var(--tw-translate-x)var(--tw-translate-y)}.data-\[side\=top\]\:slide-in-from-bottom-2[data-side=top]{--tw-enter-translate-y:.5rem}.data-\[state\=active\]\:bg-background[data-state=active]{background-color:var(--background)}.data-\[state\=active\]\:text-foreground[data-state=active]{color:var(--foreground)}.data-\[state\=active\]\:shadow-sm[data-state=active]{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a),0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.data-\[state\=checked\]\:bg-primary[data-state=checked]{background-color:var(--primary)}.data-\[state\=checked\]\:text-primary-foreground[data-state=checked]{color:var(--primary-foreground)}.data-\[state\=closed\]\:animate-out[data-state=closed]{--tw-exit-opacity:initial;--tw-exit-scale:initial;--tw-exit-rotate:initial;--tw-exit-translate-x:initial;--tw-exit-translate-y:initial;animation-name:exit;animation-duration:.15s}.data-\[state\=closed\]\:fade-out-0[data-state=closed]{--tw-exit-opacity:0}.data-\[state\=closed\]\:slide-out-to-top-\[48\%\][data-state=closed]{--tw-exit-translate-y:-48%}.data-\[state\=closed\]\:zoom-out-95[data-state=closed]{--tw-exit-scale:.95}.data-\[state\=open\]\:bg-accent[data-state=open]{background-color:var(--accent)}.data-\[state\=open\]\:text-muted-foreground[data-state=open]{color:var(--muted-foreground)}.data-\[state\=open\]\:animate-in[data-state=open]{--tw-enter-opacity:initial;--tw-enter-scale:initial;--tw-enter-rotate:initial;--tw-enter-translate-x:initial;--tw-enter-translate-y:initial;animation-name:enter;animation-duration:.15s}.data-\[state\=open\]\:fade-in-0[data-state=open]{--tw-enter-opacity:0}.data-\[state\=open\]\:slide-in-from-top-\[48\%\][data-state=open]{--tw-enter-translate-y:-48%}.data-\[state\=open\]\:zoom-in-95[data-state=open]{--tw-enter-scale:.95}.data-\[state\=selected\]\:bg-muted[data-state=selected]{background-color:var(--muted)}@supports ((-webkit-backdrop-filter:var(--tw)) or (backdrop-filter:var(--tw))){.supports-\[backdrop-filter\]\:bg-background\/60{background-color:color-mix(in oklab,var(--background)60%,transparent)}}@media (width>=40rem){.sm\:mt-0{margin-top:calc(var(--spacing)*0)}.sm\:max-w-xl{max-width:var(--container-xl)}.sm\:flex-row{flex-direction:row}.sm\:justify-end{justify-content:flex-end}:where(.sm\:space-x-2>:not(:last-child)){--tw-space-x-reverse:0;margin-inline-start:calc(calc(var(--spacing)*2)*var(--tw-space-x-reverse));margin-inline-end:calc(calc(var(--spacing)*2)*calc(1 - var(--tw-space-x-reverse)))}.sm\:rounded-lg{border-radius:var(--radius)}.sm\:px-5{padding-inline:calc(var(--spacing)*5)}.sm\:text-left{text-align:left}}@media (width>=48rem){.md\:inline-block{display:inline-block}.md\:text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}}.dark\:border-destructive:is(.dark *){border-color:var(--destructive)}.\[\&_\[cmdk-group-heading\]\]\:px-2 [cmdk-group-heading]{padding-inline:calc(var(--spacing)*2)}.\[\&_\[cmdk-group-heading\]\]\:py-1\.5 [cmdk-group-heading]{padding-block:calc(var(--spacing)*1.5)}.\[\&_\[cmdk-group-heading\]\]\:text-xs [cmdk-group-heading]{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.\[\&_\[cmdk-group-heading\]\]\:font-medium [cmdk-group-heading]{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.\[\&_\[cmdk-group-heading\]\]\:text-muted-foreground [cmdk-group-heading]{color:var(--muted-foreground)}.\[\&_\[cmdk-group\]\]\:px-2 [cmdk-group]{padding-inline:calc(var(--spacing)*2)}.\[\&_\[cmdk-group\]\:not\(\[hidden\]\)_\~\[cmdk-group\]\]\:pt-0 [cmdk-group]:not([hidden])~[cmdk-group]{padding-top:calc(var(--spacing)*0)}.\[\&_\[cmdk-input-wrapper\]_svg\]\:h-5 [cmdk-input-wrapper] svg{height:calc(var(--spacing)*5)}.\[\&_\[cmdk-input-wrapper\]_svg\]\:w-5 [cmdk-input-wrapper] svg{width:calc(var(--spacing)*5)}.\[\&_\[cmdk-input\]\]\:h-12 [cmdk-input]{height:calc(var(--spacing)*12)}.\[\&_\[cmdk-item\]\]\:px-2 [cmdk-item]{padding-inline:calc(var(--spacing)*2)}.\[\&_\[cmdk-item\]\]\:py-3 [cmdk-item]{padding-block:calc(var(--spacing)*3)}.\[\&_\[cmdk-item\]_svg\]\:h-5 [cmdk-item] svg{height:calc(var(--spacing)*5)}.\[\&_\[cmdk-item\]_svg\]\:w-5 [cmdk-item] svg{width:calc(var(--spacing)*5)}.\[\&_p\]\:leading-relaxed p{--tw-leading:var(--leading-relaxed);line-height:var(--leading-relaxed)}.\[\&_svg\]\:pointer-events-none svg{pointer-events:none}.\[\&_svg\]\:size-4 svg{width:calc(var(--spacing)*4);height:calc(var(--spacing)*4)}.\[\&_svg\]\:shrink-0 svg{flex-shrink:0}.\[\&_tr\]\:border-b tr{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.\[\&_tr\:last-child\]\:border-0 tr:last-child{border-style:var(--tw-border-style);border-width:0}.\[\&\:\:-webkit-inner-spin-button\]\:appearance-none::-webkit-inner-spin-button{-webkit-appearance:none;-moz-appearance:none;appearance:none}.\[\&\:\:-webkit-outer-spin-button\]\:appearance-none::-webkit-outer-spin-button{-webkit-appearance:none;-moz-appearance:none;appearance:none}.\[\&\:has\(\[role\=checkbox\]\)\]\:pr-0:has([role=checkbox]){padding-right:calc(var(--spacing)*0)}.\[\&\>\[role\=checkbox\]\]\:translate-y-\[2px\]>[role=checkbox]{--tw-translate-y:2px;translate:var(--tw-translate-x)var(--tw-translate-y)}.\[\&\>span\]\:line-clamp-1>span{-webkit-line-clamp:1;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.\[\&\>svg\]\:absolute>svg{position:absolute}.\[\&\>svg\]\:top-4>svg{top:calc(var(--spacing)*4)}.\[\&\>svg\]\:left-4>svg{left:calc(var(--spacing)*4)}.\[\&\>svg\]\:text-destructive>svg{color:var(--destructive)}.\[\&\>svg\]\:text-foreground>svg{color:var(--foreground)}.\[\&\>svg\+div\]\:translate-y-\[-3px\]>svg+div{--tw-translate-y:-3px;translate:var(--tw-translate-x)var(--tw-translate-y)}.\[\&\>svg\~\*\]\:pl-7>svg~*{padding-left:calc(var(--spacing)*7)}.\[\&\>tr\]\:last\:border-b-0>tr:last-child{border-bottom-style:var(--tw-border-style);border-bottom-width:0}}:root{--background:#fff;--foreground:#09090b;--card:#fff;--card-foreground:#09090b;--popover:#fff;--popover-foreground:#09090b;--primary:#18181b;--primary-foreground:#fafafa;--secondary:#f4f4f5;--secondary-foreground:#18181b;--muted:#f4f4f5;--muted-foreground:#71717a;--accent:#f4f4f5;--accent-foreground:#18181b;--destructive:#ef4444;--destructive-foreground:#fafafa;--border:#e4e4e7;--input:#e4e4e7;--ring:#09090b;--chart-1:#e76e50;--chart-2:#2a9d90;--chart-3:#274754;--chart-4:#e8c468;--chart-5:#f4a462;--radius:.6rem;--sidebar-background:#fafafa;--sidebar-foreground:#3f3f46;--sidebar-primary:#18181b;--sidebar-primary-foreground:#fafafa;--sidebar-accent:#f4f4f5;--sidebar-accent-foreground:#18181b;--sidebar-border:#e5e7eb;--sidebar-ring:#3b82f6}.dark{--background:#09090b;--foreground:#fafafa;--card:#09090b;--card-foreground:#fafafa;--popover:#09090b;--popover-foreground:#fafafa;--primary:#fafafa;--primary-foreground:#18181b;--secondary:#27272a;--secondary-foreground:#fafafa;--muted:#27272a;--muted-foreground:#a1a1aa;--accent:#27272a;--accent-foreground:#fafafa;--destructive:#7f1d1d;--destructive-foreground:#fafafa;--border:#27272a;--input:#27272a;--ring:#d4d4d8;--chart-1:#2662d9;--chart-2:#2eb88a;--chart-3:#e88c30;--chart-4:#af57db;--chart-5:#e23670;--sidebar-background:#18181b;--sidebar-foreground:#f4f4f5;--sidebar-primary:#1d4ed8;--sidebar-primary-foreground:#fff;--sidebar-accent:#27272a;--sidebar-accent-foreground:#f4f4f5;--sidebar-border:#27272a;--sidebar-ring:#3b82f6}::-webkit-scrollbar{width:10px;height:10px}::-webkit-scrollbar-thumb{background-color:#ccc;border-radius:5px}::-webkit-scrollbar-track{background-color:#f2f2f2}.dark ::-webkit-scrollbar-thumb{background-color:#e6e6e6}.dark ::-webkit-scrollbar-track{background-color:#000}@keyframes enter{0%{opacity:var(--tw-enter-opacity,1);transform:translate3d(var(--tw-enter-translate-x,0),var(--tw-enter-translate-y,0),0)scale3d(var(--tw-enter-scale,1),var(--tw-enter-scale,1),var(--tw-enter-scale,1))rotate(var(--tw-enter-rotate,0))}}@keyframes exit{to{opacity:var(--tw-exit-opacity,1);transform:translate3d(var(--tw-exit-translate-x,0),var(--tw-exit-translate-y,0),0)scale3d(var(--tw-exit-scale,1),var(--tw-exit-scale,1),var(--tw-exit-scale,1))rotate(var(--tw-exit-rotate,0))}}@keyframes spin{to{transform:rotate(360deg)}}@keyframes ping{75%,to{opacity:0;transform:scale(2)}}@keyframes pulse{50%{opacity:.5}}@keyframes bounce{0%,to{animation-timing-function:cubic-bezier(.8,0,1,1);transform:translateY(-25%)}50%{animation-timing-function:cubic-bezier(0,0,.2,1);transform:none}}@keyframes accordion-down{0%{height:0}to{height:var(--radix-accordion-content-height)}}@keyframes accordion-up{0%{height:var(--radix-accordion-content-height)}to{height:0}}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@property --tw-scale-x{syntax:"*";inherits:false;initial-value:1}@property --tw-scale-y{syntax:"*";inherits:false;initial-value:1}@property --tw-scale-z{syntax:"*";inherits:false;initial-value:1}@property --tw-rotate-x{syntax:"*";inherits:false;initial-value:rotateX(0)}@property --tw-rotate-y{syntax:"*";inherits:false;initial-value:rotateY(0)}@property --tw-rotate-z{syntax:"*";inherits:false;initial-value:rotateZ(0)}@property --tw-skew-x{syntax:"*";inherits:false;initial-value:skewX(0)}@property --tw-skew-y{syntax:"*";inherits:false;initial-value:skewY(0)}@property --tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-outline-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-backdrop-blur{syntax:"*";inherits:false}@property --tw-backdrop-brightness{syntax:"*";inherits:false}@property --tw-backdrop-contrast{syntax:"*";inherits:false}@property --tw-backdrop-grayscale{syntax:"*";inherits:false}@property --tw-backdrop-hue-rotate{syntax:"*";inherits:false}@property --tw-backdrop-invert{syntax:"*";inherits:false}@property --tw-backdrop-opacity{syntax:"*";inherits:false}@property --tw-backdrop-saturate{syntax:"*";inherits:false}@property --tw-backdrop-sepia{syntax:"*";inherits:false}@property --tw-duration{syntax:"*";inherits:false}@property --tw-ease{syntax:"*";inherits:false}@property --tw-space-x-reverse{syntax:"*";inherits:false;initial-value:0}:root{--sigma-background-color:#fff;--sigma-controls-background-color:#fff;--sigma-controls-background-color-hover:rgba(0,0,0,.2);--sigma-controls-border-color:rgba(0,0,0,.2);--sigma-controls-color:#000;--sigma-controls-zindex:100;--sigma-controls-margin:5px;--sigma-controls-size:30px}div.react-sigma{height:100%;width:100%;position:relative;background:var(--sigma-background-color)}div.sigma-container{height:100%;width:100%}.react-sigma-controls{position:absolute;z-index:var(--sigma-controls-zindex);border:2px solid var(--sigma-controls-border-color);border-radius:4px;color:var(--sigma-controls-color);background-color:var(--sigma-controls-background-color)}.react-sigma-controls.bottom-right{bottom:var(--sigma-controls-margin);right:var(--sigma-controls-margin)}.react-sigma-controls.bottom-left{bottom:var(--sigma-controls-margin);left:var(--sigma-controls-margin)}.react-sigma-controls.top-right{top:var(--sigma-controls-margin);right:var(--sigma-controls-margin)}.react-sigma-controls.top-left{top:var(--sigma-controls-margin);left:var(--sigma-controls-margin)}.react-sigma-controls:first-child{border-top-left-radius:2px;border-top-right-radius:2px}.react-sigma-controls:last-child{border-bottom-left-radius:2px;border-bottom-right-radius:2px}.react-sigma-control{width:var(--sigma-controls-size);height:var(--sigma-controls-size);line-height:var(--sigma-controls-size);background-color:var(--sigma-controls-background-color);border-bottom:1px solid var(--sigma-controls-border-color)}.react-sigma-control:last-child{border-bottom:none}.react-sigma-control>*{box-sizing:border-box}.react-sigma-control>button{display:block;border:none;margin:0;padding:0;width:var(--sigma-controls-size);height:var(--sigma-controls-size);line-height:var(--sigma-controls-size);background-position:center;background-size:50%;background-repeat:no-repeat;background-color:var(--sigma-controls-background-color);clip:rect(0,0,0,0)}.react-sigma-control>button:hover{background-color:var(--sigma-controls-background-color-hover)}.react-sigma-search{background-color:var(--sigma-controls-background-color)}.react-sigma-search label{visibility:hidden}.react-sigma-search input{color:var(--sigma-controls-color);background-color:var(--sigma-controls-background-color);font-size:1em;width:100%;margin:0;border:none;padding:var(--sigma-controls-margin);box-sizing:border-box}:root{--sigma-grey-color:#ccc}.react-sigma .option.hoverable{cursor:pointer!important}.react-sigma .text-ellipsis{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.react-sigma .react-select__clear-indicator{cursor:pointer!important}.react-sigma .text-muted{color:var(--sigma-grey-color)}.react-sigma .text-italic{font-style:italic}.react-sigma .text-center{text-align:center}.react-sigma .graph-search{min-width:250px}.react-sigma .graph-search .option{padding:2px 8px}.react-sigma .graph-search .dropdown-indicator{font-size:1.25em;padding:4px}.react-sigma .graph-search .option.selected{background-color:var(--sigma-grey-color)}.react-sigma .node .render{position:relative;display:inline-block;width:1em;height:1em;border-radius:1em;background-color:var(--sigma-grey-color);margin-right:8px}.react-sigma .node{display:flex;flex-direction:row;align-items:center}.react-sigma .node .render{flex-grow:0;flex-shrink:0;margin-right:0 .25em}.react-sigma .node .label{flex-grow:1;flex-shrink:1}.react-sigma .edge{display:flex;flex-direction:column;align-items:flex-start;flex-grow:0;flex-shrink:0;flex-wrap:nowrap}.react-sigma .edge .node{font-size:.7em}.react-sigma .edge .body{display:flex;flex-direction:row;flex-grow:1;flex-shrink:1;min-height:.6em}.react-sigma .edge .body .render{display:flex;flex-direction:column;margin:0 2px}.react-sigma .edge .body .render .dash,.react-sigma .edge .body .render .dotted{display:inline-block;width:0;margin:0 2px;border:2px solid #ccc;flex-grow:1;flex-shrink:1}.react-sigma .edge .body .render .dotted{border-style:dotted}.react-sigma .edge .body .render .arrow{width:0;height:0;border-left:.3em solid transparent;border-right:.3em solid transparent;border-top:.6em solid red;flex-shrink:0;flex-grow:0;border-left-width:.3em;border-right-width:.3em}.react-sigma .edge .body .label{flex-grow:1;flex-shrink:1;text-align:center} diff --git a/lightrag/api/webui/index.html b/lightrag/api/webui/index.html index dd7c5047..dc92bda5 100644 --- a/lightrag/api/webui/index.html +++ b/lightrag/api/webui/index.html @@ -1,14 +1,14 @@ - - - - - - - Lightrag - - - - -
- - + + + + + + + Lightrag + + + + +
+ + diff --git a/lightrag_webui/src/App.tsx b/lightrag_webui/src/App.tsx index 1eeab2b0..2c7e8001 100644 --- a/lightrag_webui/src/App.tsx +++ b/lightrag_webui/src/App.tsx @@ -46,8 +46,10 @@ function App() { if (message) { if (message.includes(InvalidApiKeyError) || message.includes(RequireApiKeError)) { setApiKeyInvalid(true) + return } } + setApiKeyInvalid(false) }, [message, setApiKeyInvalid]) return ( diff --git a/lightrag_webui/src/components/ApiKeyAlert.tsx b/lightrag_webui/src/components/ApiKeyAlert.tsx index f0276085..86c8e13f 100644 --- a/lightrag_webui/src/components/ApiKeyAlert.tsx +++ b/lightrag_webui/src/components/ApiKeyAlert.tsx @@ -4,8 +4,7 @@ import { AlertDialogContent, AlertDialogDescription, AlertDialogHeader, - AlertDialogTitle, - AlertDialogTrigger + AlertDialogTitle } from '@/components/ui/AlertDialog' import Button from '@/components/ui/Button' import Input from '@/components/ui/Input' @@ -51,7 +50,6 @@ const ApiKeyAlert = () => { return ( - Open API Key is required