diff --git a/README.md b/README.md index cf1ee8ca..84b35654 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@
Y<=0)){var V,q;const Y=(((V=o.flip)==null?void 0:V.index)||0)+1,Z=R[Y];if(Z)return{data:{index:Y,overflows:j},reset:{placement:Z}};let U=(q=j.filter(G=>G.overflows[0]<=0).sort((G,F)=>G.overflows[1]-F.overflows[1])[0])==null?void 0:q.placement;if(!U)switch(g){case"bestFit":{var I;const G=(I=j.filter(F=>{if(z){const K=fa(F.placement);return K===_||K==="y"}return!0}).map(F=>[F.placement,F.overflows.filter(K=>K>0).reduce((K,A)=>K+A,0)]).sort((F,K)=>F[1]-K[1])[0])==null?void 0:I[0];G&&(U=G);break}case"initialPlacement":U=u;break}if(i!==U)return{reset:{placement:U}}}return{}}}};function N1(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function O1(e){return VF.some(t=>e[t]>=0)}const n4=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...i}=ki(e,t);switch(r){case"referenceHidden":{const o=await qs(t,{...i,elementContext:"reference"}),s=N1(o,n.reference);return{data:{referenceHiddenOffsets:s,referenceHidden:O1(s)}}}case"escaped":{const o=await qs(t,{...i,altBoundary:!0}),s=N1(o,n.floating);return{data:{escapedOffsets:s,escaped:O1(s)}}}default:return{}}}}};async function r4(e,t){const{placement:n,platform:r,elements:i}=e,o=await(r.isRTL==null?void 0:r.isRTL(i.floating)),s=Ci(n),u=bl(n),f=fa(n)==="y",d=["left","top"].includes(s)?-1:1,p=o&&f?-1:1,m=ki(t,e);let{mainAxis:v,crossAxis:g,alignmentAxis:w}=typeof m=="number"?{mainAxis:m,crossAxis:0,alignmentAxis:null}:{mainAxis:m.mainAxis||0,crossAxis:m.crossAxis||0,alignmentAxis:m.alignmentAxis};return u&&typeof w=="number"&&(g=u==="end"?w*-1:w),f?{x:g*p,y:v*d}:{x:v*d,y:g*p}}const i4=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:i,y:o,placement:s,middlewareData:u}=t,f=await r4(t,e);return s===((n=u.offset)==null?void 0:n.placement)&&(r=u.arrow)!=null&&r.alignmentOffset?{}:{x:i+f.x,y:o+f.y,data:{...f,placement:s}}}}},a4=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:i}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:u={fn:k=>{let{x:C,y:_}=k;return{x:C,y:_}}},...f}=ki(e,t),d={x:n,y:r},p=await qs(t,f),m=fa(Ci(i)),v=Yv(m);let g=d[v],w=d[m];if(o){const k=v==="y"?"top":"left",C=v==="y"?"bottom":"right",_=g+p[k],T=g-p[C];g=Og(_,g,T)}if(s){const k=m==="y"?"top":"left",C=m==="y"?"bottom":"right",_=w+p[k],T=w-p[C];w=Og(_,w,T)}const x=u.fn({...t,[v]:g,[m]:w});return{...x,data:{x:x.x-n,y:x.y-r,enabled:{[v]:o,[m]:s}}}}}},o4=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:i,rects:o,middlewareData:s}=t,{offset:u=0,mainAxis:f=!0,crossAxis:d=!0}=ki(e,t),p={x:n,y:r},m=fa(i),v=Yv(m);let g=p[v],w=p[m];const x=ki(u,t),k=typeof x=="number"?{mainAxis:x,crossAxis:0}:{mainAxis:0,crossAxis:0,...x};if(f){const T=v==="y"?"height":"width",N=o.reference[v]-o.floating[T]+k.mainAxis,D=o.reference[v]+o.reference[T]-k.mainAxis;gD&&(g=D)}if(d){var C,_;const T=v==="y"?"width":"height",N=["top","left"].includes(Ci(i)),D=o.reference[m]-o.floating[T]+(N&&((C=s.offset)==null?void 0:C[m])||0)+(N?0:k.crossAxis),z=o.reference[m]+o.reference[T]+(N?0:((_=s.offset)==null?void 0:_[m])||0)-(N?k.crossAxis:0);wz&&(w=z)}return{[v]:g,[m]:w}}}},l4=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:i,rects:o,platform:s,elements:u}=t,{apply:f=()=>{},...d}=ki(e,t),p=await qs(t,d),m=Ci(i),v=bl(i),g=fa(i)==="y",{width:w,height:x}=o.floating;let k,C;m==="top"||m==="bottom"?(k=m,C=v===(await(s.isRTL==null?void 0:s.isRTL(u.floating))?"start":"end")?"left":"right"):(C=m,k=v==="end"?"top":"bottom");const _=x-p.top-p.bottom,T=w-p.left-p.right,N=ca(x-p[k],_),D=ca(w-p[C],T),z=!t.middlewareData.shift;let R=N,B=D;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(B=T),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(R=_),z&&!v){const j=Yn(p.left,0),V=Yn(p.right,0),q=Yn(p.top,0),I=Yn(p.bottom,0);g?B=w-2*(j!==0||V!==0?j+V:Yn(p.left,p.right)):R=x-2*(q!==0||I!==0?q+I:Yn(p.top,p.bottom))}await f({...t,availableWidth:B,availableHeight:R});const P=await s.getDimensions(u.floating);return w!==P.width||x!==P.height?{reset:{rects:!0}}:{}}}};function rd(){return typeof window<"u"}function xl(e){return xC(e)?(e.nodeName||"").toLowerCase():"#document"}function Xn(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function qr(e){var t;return(t=(xC(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function xC(e){return rd()?e instanceof Node||e instanceof Xn(e).Node:!1}function Ar(e){return rd()?e instanceof Element||e instanceof Xn(e).Element:!1}function Vr(e){return rd()?e instanceof HTMLElement||e instanceof Xn(e).HTMLElement:!1}function L1(e){return!rd()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Xn(e).ShadowRoot}function lu(e){const{overflow:t,overflowX:n,overflowY:r,display:i}=Rr(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(i)}function s4(e){return["table","td","th"].includes(xl(e))}function id(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function Kv(e){const t=Zv(),n=Ar(e)?Rr(e):e;return["transform","translate","scale","rotate","perspective"].some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||["transform","translate","scale","rotate","perspective","filter"].some(r=>(n.willChange||"").includes(r))||["paint","layout","strict","content"].some(r=>(n.contain||"").includes(r))}function u4(e){let t=da(e);for(;Vr(t)&&!ll(t);){if(Kv(t))return t;if(id(t))return null;t=da(t)}return null}function Zv(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function ll(e){return["html","body","#document"].includes(xl(e))}function Rr(e){return Xn(e).getComputedStyle(e)}function ad(e){return Ar(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function da(e){if(xl(e)==="html")return e;const t=e.assignedSlot||e.parentNode||L1(e)&&e.host||qr(e);return L1(t)?t.host:t}function wC(e){const t=da(e);return ll(t)?e.ownerDocument?e.ownerDocument.body:e.body:Vr(t)&&lu(t)?t:wC(t)}function Ys(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=wC(e),o=i===((r=e.ownerDocument)==null?void 0:r.body),s=Xn(i);if(o){const u=zg(s);return t.concat(s,s.visualViewport||[],lu(i)?i:[],u&&n?Ys(u):[])}return t.concat(i,Ys(i,[],n))}function zg(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function SC(e){const t=Rr(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const i=Vr(e),o=i?e.offsetWidth:n,s=i?e.offsetHeight:r,u=wf(n)!==o||wf(r)!==s;return u&&(n=o,r=s),{width:n,height:r,$:u}}function Qv(e){return Ar(e)?e:e.contextElement}function rl(e){const t=Qv(e);if(!Vr(t))return $r(1);const n=t.getBoundingClientRect(),{width:r,height:i,$:o}=SC(t);let s=(o?wf(n.width):n.width)/r,u=(o?wf(n.height):n.height)/i;return(!s||!Number.isFinite(s))&&(s=1),(!u||!Number.isFinite(u))&&(u=1),{x:s,y:u}}const c4=$r(0);function EC(e){const t=Xn(e);return!Zv()||!t.visualViewport?c4:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function f4(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Xn(e)?!1:t}function Ka(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const i=e.getBoundingClientRect(),o=Qv(e);let s=$r(1);t&&(r?Ar(r)&&(s=rl(r)):s=rl(e));const u=f4(o,n,r)?EC(o):$r(0);let f=(i.left+u.x)/s.x,d=(i.top+u.y)/s.y,p=i.width/s.x,m=i.height/s.y;if(o){const v=Xn(o),g=r&&Ar(r)?Xn(r):r;let w=v,x=zg(w);for(;x&&r&&g!==w;){const k=rl(x),C=x.getBoundingClientRect(),_=Rr(x),T=C.left+(x.clientLeft+parseFloat(_.paddingLeft))*k.x,N=C.top+(x.clientTop+parseFloat(_.paddingTop))*k.y;f*=k.x,d*=k.y,p*=k.x,m*=k.y,f+=T,d+=N,w=Xn(x),x=zg(w)}}return Ef({width:p,height:m,x:f,y:d})}function Jv(e,t){const n=ad(e).scrollLeft;return t?t.left+n:Ka(qr(e)).left+n}function _C(e,t,n){n===void 0&&(n=!1);const r=e.getBoundingClientRect(),i=r.left+t.scrollLeft-(n?0:Jv(e,r)),o=r.top+t.scrollTop;return{x:i,y:o}}function d4(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e;const o=i==="fixed",s=qr(r),u=t?id(t.floating):!1;if(r===s||u&&o)return n;let f={scrollLeft:0,scrollTop:0},d=$r(1);const p=$r(0),m=Vr(r);if((m||!m&&!o)&&((xl(r)!=="body"||lu(s))&&(f=ad(r)),Vr(r))){const g=Ka(r);d=rl(r),p.x=g.x+r.clientLeft,p.y=g.y+r.clientTop}const v=s&&!m&&!o?_C(s,f,!0):$r(0);return{width:n.width*d.x,height:n.height*d.y,x:n.x*d.x-f.scrollLeft*d.x+p.x+v.x,y:n.y*d.y-f.scrollTop*d.y+p.y+v.y}}function h4(e){return Array.from(e.getClientRects())}function p4(e){const t=qr(e),n=ad(e),r=e.ownerDocument.body,i=Yn(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),o=Yn(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+Jv(e);const u=-n.scrollTop;return Rr(r).direction==="rtl"&&(s+=Yn(t.clientWidth,r.clientWidth)-i),{width:i,height:o,x:s,y:u}}function m4(e,t){const n=Xn(e),r=qr(e),i=n.visualViewport;let o=r.clientWidth,s=r.clientHeight,u=0,f=0;if(i){o=i.width,s=i.height;const d=Zv();(!d||d&&t==="fixed")&&(u=i.offsetLeft,f=i.offsetTop)}return{width:o,height:s,x:u,y:f}}function g4(e,t){const n=Ka(e,!0,t==="fixed"),r=n.top+e.clientTop,i=n.left+e.clientLeft,o=Vr(e)?rl(e):$r(1),s=e.clientWidth*o.x,u=e.clientHeight*o.y,f=i*o.x,d=r*o.y;return{width:s,height:u,x:f,y:d}}function z1(e,t,n){let r;if(t==="viewport")r=m4(e,n);else if(t==="document")r=p4(qr(e));else if(Ar(t))r=g4(t,n);else{const i=EC(e);r={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return Ef(r)}function kC(e,t){const n=da(e);return n===t||!Ar(n)||ll(n)?!1:Rr(n).position==="fixed"||kC(n,t)}function v4(e,t){const n=t.get(e);if(n)return n;let r=Ys(e,[],!1).filter(u=>Ar(u)&&xl(u)!=="body"),i=null;const o=Rr(e).position==="fixed";let s=o?da(e):e;for(;Ar(s)&&!ll(s);){const u=Rr(s),f=Kv(s);!f&&u.position==="fixed"&&(i=null),(o?!f&&!i:!f&&u.position==="static"&&!!i&&["absolute","fixed"].includes(i.position)||lu(s)&&!f&&kC(e,s))?r=r.filter(p=>p!==s):i=u,s=da(s)}return t.set(e,r),r}function y4(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e;const s=[...n==="clippingAncestors"?id(t)?[]:v4(t,this._c):[].concat(n),r],u=s[0],f=s.reduce((d,p)=>{const m=z1(t,p,i);return d.top=Yn(m.top,d.top),d.right=ca(m.right,d.right),d.bottom=ca(m.bottom,d.bottom),d.left=Yn(m.left,d.left),d},z1(t,u,i));return{width:f.right-f.left,height:f.bottom-f.top,x:f.left,y:f.top}}function b4(e){const{width:t,height:n}=SC(e);return{width:t,height:n}}function x4(e,t,n){const r=Vr(t),i=qr(t),o=n==="fixed",s=Ka(e,!0,o,t);let u={scrollLeft:0,scrollTop:0};const f=$r(0);if(r||!r&&!o)if((xl(t)!=="body"||lu(i))&&(u=ad(t)),r){const v=Ka(t,!0,o,t);f.x=v.x+t.clientLeft,f.y=v.y+t.clientTop}else i&&(f.x=Jv(i));const d=i&&!r&&!o?_C(i,u):$r(0),p=s.left+u.scrollLeft-f.x-d.x,m=s.top+u.scrollTop-f.y-d.y;return{x:p,y:m,width:s.width,height:s.height}}function nm(e){return Rr(e).position==="static"}function j1(e,t){if(!Vr(e)||Rr(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return qr(e)===n&&(n=n.ownerDocument.body),n}function CC(e,t){const n=Xn(e);if(id(e))return n;if(!Vr(e)){let i=da(e);for(;i&&!ll(i);){if(Ar(i)&&!nm(i))return i;i=da(i)}return n}let r=j1(e,t);for(;r&&s4(r)&&nm(r);)r=j1(r,t);return r&&ll(r)&&nm(r)&&!Kv(r)?n:r||u4(e)||n}const w4=async function(e){const t=this.getOffsetParent||CC,n=this.getDimensions,r=await n(e.floating);return{reference:x4(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function S4(e){return Rr(e).direction==="rtl"}const E4={convertOffsetParentRelativeRectToViewportRelativeRect:d4,getDocumentElement:qr,getClippingRect:y4,getOffsetParent:CC,getElementRects:w4,getClientRects:h4,getDimensions:b4,getScale:rl,isElement:Ar,isRTL:S4};function TC(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function _4(e,t){let n=null,r;const i=qr(e);function o(){var u;clearTimeout(r),(u=n)==null||u.disconnect(),n=null}function s(u,f){u===void 0&&(u=!1),f===void 0&&(f=1),o();const d=e.getBoundingClientRect(),{left:p,top:m,width:v,height:g}=d;if(u||t(),!v||!g)return;const w=zc(m),x=zc(i.clientWidth-(p+v)),k=zc(i.clientHeight-(m+g)),C=zc(p),T={rootMargin:-w+"px "+-x+"px "+-k+"px "+-C+"px",threshold:Yn(0,ca(1,f))||1};let N=!0;function D(z){const R=z[0].intersectionRatio;if(R!==f){if(!N)return s();R?s(!1,R):r=setTimeout(()=>{s(!1,1e-7)},1e3)}R===1&&!TC(d,e.getBoundingClientRect())&&s(),N=!1}try{n=new IntersectionObserver(D,{...T,root:i.ownerDocument})}catch{n=new IntersectionObserver(D,T)}n.observe(e)}return s(!0),o}function k4(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:o=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:u=typeof IntersectionObserver=="function",animationFrame:f=!1}=r,d=Qv(e),p=i||o?[...d?Ys(d):[],...Ys(t)]:[];p.forEach(C=>{i&&C.addEventListener("scroll",n,{passive:!0}),o&&C.addEventListener("resize",n)});const m=d&&u?_4(d,n):null;let v=-1,g=null;s&&(g=new ResizeObserver(C=>{let[_]=C;_&&_.target===d&&g&&(g.unobserve(t),cancelAnimationFrame(v),v=requestAnimationFrame(()=>{var T;(T=g)==null||T.observe(t)})),n()}),d&&!f&&g.observe(d),g.observe(t));let w,x=f?Ka(e):null;f&&k();function k(){const C=Ka(e);x&&!TC(x,C)&&n(),x=C,w=requestAnimationFrame(k)}return n(),()=>{var C;p.forEach(_=>{i&&_.removeEventListener("scroll",n),o&&_.removeEventListener("resize",n)}),m==null||m(),(C=g)==null||C.disconnect(),g=null,f&&cancelAnimationFrame(w)}}const C4=i4,T4=a4,A4=t4,R4=l4,D4=n4,M1=e4,N4=o4,O4=(e,t,n)=>{const r=new Map,i={platform:E4,...n},o={...i.platform,_c:r};return JF(e,t,{...i,platform:o})};var lf=typeof document<"u"?E.useLayoutEffect:E.useEffect;function _f(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!_f(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){const o=i[r];if(!(o==="_owner"&&e.$$typeof)&&!_f(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}function AC(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function P1(e,t){const n=AC(e);return Math.round(t*n)/n}function rm(e){const t=E.useRef(e);return lf(()=>{t.current=e}),t}function L4(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:i,elements:{reference:o,floating:s}={},transform:u=!0,whileElementsMounted:f,open:d}=e,[p,m]=E.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[v,g]=E.useState(r);_f(v,r)||g(r);const[w,x]=E.useState(null),[k,C]=E.useState(null),_=E.useCallback(F=>{F!==z.current&&(z.current=F,x(F))},[]),T=E.useCallback(F=>{F!==R.current&&(R.current=F,C(F))},[]),N=o||w,D=s||k,z=E.useRef(null),R=E.useRef(null),B=E.useRef(p),P=f!=null,j=rm(f),V=rm(i),q=rm(d),I=E.useCallback(()=>{if(!z.current||!R.current)return;const F={placement:t,strategy:n,middleware:v};V.current&&(F.platform=V.current),O4(z.current,R.current,F).then(K=>{const A={...K,isPositioned:q.current!==!1};Y.current&&!_f(B.current,A)&&(B.current=A,au.flushSync(()=>{m(A)}))})},[v,t,n,V,q]);lf(()=>{d===!1&&B.current.isPositioned&&(B.current.isPositioned=!1,m(F=>({...F,isPositioned:!1})))},[d]);const Y=E.useRef(!1);lf(()=>(Y.current=!0,()=>{Y.current=!1}),[]),lf(()=>{if(N&&(z.current=N),D&&(R.current=D),N&&D){if(j.current)return j.current(N,D,I);I()}},[N,D,I,j,P]);const Z=E.useMemo(()=>({reference:z,floating:R,setReference:_,setFloating:T}),[_,T]),U=E.useMemo(()=>({reference:N,floating:D}),[N,D]),G=E.useMemo(()=>{const F={position:n,left:0,top:0};if(!U.floating)return F;const K=P1(U.floating,p.x),A=P1(U.floating,p.y);return u?{...F,transform:"translate("+K+"px, "+A+"px)",...AC(U.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:K,top:A}},[n,u,U.floating,p.x,p.y]);return E.useMemo(()=>({...p,update:I,refs:Z,elements:U,floatingStyles:G}),[p,I,Z,U,G])}const z4=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:i}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?M1({element:r.current,padding:i}).fn(n):{}:r?M1({element:r,padding:i}).fn(n):{}}}},j4=(e,t)=>({...C4(e),options:[e,t]}),M4=(e,t)=>({...T4(e),options:[e,t]}),P4=(e,t)=>({...N4(e),options:[e,t]}),F4=(e,t)=>({...A4(e),options:[e,t]}),I4=(e,t)=>({...R4(e),options:[e,t]}),G4=(e,t)=>({...D4(e),options:[e,t]}),B4=(e,t)=>({...z4(e),options:[e,t]});var U4="Arrow",RC=E.forwardRef((e,t)=>{const{children:n,width:r=10,height:i=5,...o}=e;return S.jsx(We.svg,{...o,ref:t,width:r,height:i,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:S.jsx("polygon",{points:"0,0 30,0 15,10"})})});RC.displayName=U4;var H4=RC;function DC(e){const[t,n]=E.useState(void 0);return xn(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(i=>{if(!Array.isArray(i)||!i.length)return;const o=i[0];let s,u;if("borderBoxSize"in o){const f=o.borderBoxSize,d=Array.isArray(f)?f[0]:f;s=d.inlineSize,u=d.blockSize}else s=e.offsetWidth,u=e.offsetHeight;n({width:s,height:u})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var ey="Popper",[NC,wl]=hr(ey),[$4,OC]=NC(ey),LC=e=>{const{__scopePopper:t,children:n}=e,[r,i]=E.useState(null);return S.jsx($4,{scope:t,anchor:r,onAnchorChange:i,children:n})};LC.displayName=ey;var zC="PopperAnchor",jC=E.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...i}=e,o=OC(zC,n),s=E.useRef(null),u=dt(t,s);return E.useEffect(()=>{o.onAnchorChange((r==null?void 0:r.current)||s.current)}),r?null:S.jsx(We.div,{...i,ref:u})});jC.displayName=zC;var ty="PopperContent",[V4,q4]=NC(ty),MC=E.forwardRef((e,t)=>{var ae,oe,Ce,he,Ee,we;const{__scopePopper:n,side:r="bottom",sideOffset:i=0,align:o="center",alignOffset:s=0,arrowPadding:u=0,avoidCollisions:f=!0,collisionBoundary:d=[],collisionPadding:p=0,sticky:m="partial",hideWhenDetached:v=!1,updatePositionStrategy:g="optimized",onPlaced:w,...x}=e,k=OC(ty,n),[C,_]=E.useState(null),T=dt(t,Pe=>_(Pe)),[N,D]=E.useState(null),z=DC(N),R=(z==null?void 0:z.width)??0,B=(z==null?void 0:z.height)??0,P=r+(o!=="center"?"-"+o:""),j=typeof p=="number"?p:{top:0,right:0,bottom:0,left:0,...p},V=Array.isArray(d)?d:[d],q=V.length>0,I={padding:j,boundary:V.filter(W4),altBoundary:q},{refs:Y,floatingStyles:Z,placement:U,isPositioned:G,middlewareData:F}=L4({strategy:"fixed",placement:P,whileElementsMounted:(...Pe)=>k4(...Pe,{animationFrame:g==="always"}),elements:{reference:k.anchor},middleware:[j4({mainAxis:i+B,alignmentAxis:s}),f&&M4({mainAxis:!0,crossAxis:!1,limiter:m==="partial"?P4():void 0,...I}),f&&F4({...I}),I4({...I,apply:({elements:Pe,rects:Ae,availableWidth:xe,availableHeight:ee})=>{const{width:ce,height:Te}=Ae.reference,ge=Pe.floating.style;ge.setProperty("--radix-popper-available-width",`${xe}px`),ge.setProperty("--radix-popper-available-height",`${ee}px`),ge.setProperty("--radix-popper-anchor-width",`${ce}px`),ge.setProperty("--radix-popper-anchor-height",`${Te}px`)}}),N&&B4({element:N,padding:u}),X4({arrowWidth:R,arrowHeight:B}),v&&G4({strategy:"referenceHidden",...I})]}),[K,A]=IC(U),$=un(w);xn(()=>{G&&($==null||$())},[G,$]);const M=(ae=F.arrow)==null?void 0:ae.x,O=(oe=F.arrow)==null?void 0:oe.y,X=((Ce=F.arrow)==null?void 0:Ce.centerOffset)!==0,[re,ue]=E.useState();return xn(()=>{C&&ue(window.getComputedStyle(C).zIndex)},[C]),S.jsx("div",{ref:Y.setFloating,"data-radix-popper-content-wrapper":"",style:{...Z,transform:G?Z.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:re,"--radix-popper-transform-origin":[(he=F.transformOrigin)==null?void 0:he.x,(Ee=F.transformOrigin)==null?void 0:Ee.y].join(" "),...((we=F.hide)==null?void 0:we.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:S.jsx(V4,{scope:n,placedSide:K,onArrowChange:D,arrowX:M,arrowY:O,shouldHideArrow:X,children:S.jsx(We.div,{"data-side":K,"data-align":A,...x,ref:T,style:{...x.style,animation:G?void 0:"none"}})})})});MC.displayName=ty;var PC="PopperArrow",Y4={top:"bottom",right:"left",bottom:"top",left:"right"},FC=E.forwardRef(function(t,n){const{__scopePopper:r,...i}=t,o=q4(PC,r),s=Y4[o.placedSide];return S.jsx("span",{ref:o.onArrowChange,style:{position:"absolute",left:o.arrowX,top:o.arrowY,[s]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[o.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[o.placedSide],visibility:o.shouldHideArrow?"hidden":void 0},children:S.jsx(H4,{...i,ref:n,style:{...i.style,display:"block"}})})});FC.displayName=PC;function W4(e){return e!==null}var X4=e=>({name:"transformOrigin",options:e,fn(t){var k,C,_;const{placement:n,rects:r,middlewareData:i}=t,s=((k=i.arrow)==null?void 0:k.centerOffset)!==0,u=s?0:e.arrowWidth,f=s?0:e.arrowHeight,[d,p]=IC(n),m={start:"0%",center:"50%",end:"100%"}[p],v=(((C=i.arrow)==null?void 0:C.x)??0)+u/2,g=(((_=i.arrow)==null?void 0:_.y)??0)+f/2;let w="",x="";return d==="bottom"?(w=s?m:`${v}px`,x=`${-f}px`):d==="top"?(w=s?m:`${v}px`,x=`${r.floating.height+f}px`):d==="right"?(w=`${-f}px`,x=s?m:`${g}px`):d==="left"&&(w=`${r.floating.width+f}px`,x=s?m:`${g}px`),{data:{x:w,y:x}}}});function IC(e){const[t,n="center"]=e.split("-");return[t,n]}var ny=LC,od=jC,ry=MC,iy=FC,K4="VisuallyHidden",ay=E.forwardRef((e,t)=>S.jsx(We.span,{...e,ref:t,style:{position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal",...e.style}}));ay.displayName=K4;var Z4=ay,[ld,cK]=hr("Tooltip",[wl]),sd=wl(),GC="TooltipProvider",Q4=700,jg="tooltip.open",[J4,oy]=ld(GC),BC=e=>{const{__scopeTooltip:t,delayDuration:n=Q4,skipDelayDuration:r=300,disableHoverableContent:i=!1,children:o}=e,[s,u]=E.useState(!0),f=E.useRef(!1),d=E.useRef(0);return E.useEffect(()=>{const p=d.current;return()=>window.clearTimeout(p)},[]),S.jsx(J4,{scope:t,isOpenDelayed:s,delayDuration:n,onOpen:E.useCallback(()=>{window.clearTimeout(d.current),u(!1)},[]),onClose:E.useCallback(()=>{window.clearTimeout(d.current),d.current=window.setTimeout(()=>u(!0),r)},[r]),isPointerInTransitRef:f,onPointerInTransitChange:E.useCallback(p=>{f.current=p},[]),disableHoverableContent:i,children:o})};BC.displayName=GC;var ud="Tooltip",[eI,cd]=ld(ud),UC=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:i=!1,onOpenChange:o,disableHoverableContent:s,delayDuration:u}=e,f=oy(ud,e.__scopeTooltip),d=sd(t),[p,m]=E.useState(null),v=bn(),g=E.useRef(0),w=s??f.disableHoverableContent,x=u??f.delayDuration,k=E.useRef(!1),[C=!1,_]=_i({prop:r,defaultProp:i,onChange:R=>{R?(f.onOpen(),document.dispatchEvent(new CustomEvent(jg))):f.onClose(),o==null||o(R)}}),T=E.useMemo(()=>C?k.current?"delayed-open":"instant-open":"closed",[C]),N=E.useCallback(()=>{window.clearTimeout(g.current),g.current=0,k.current=!1,_(!0)},[_]),D=E.useCallback(()=>{window.clearTimeout(g.current),g.current=0,_(!1)},[_]),z=E.useCallback(()=>{window.clearTimeout(g.current),g.current=window.setTimeout(()=>{k.current=!0,_(!0),g.current=0},x)},[x,_]);return E.useEffect(()=>()=>{g.current&&(window.clearTimeout(g.current),g.current=0)},[]),S.jsx(ny,{...d,children:S.jsx(eI,{scope:t,contentId:v,open:C,stateAttribute:T,trigger:p,onTriggerChange:m,onTriggerEnter:E.useCallback(()=>{f.isOpenDelayed?z():N()},[f.isOpenDelayed,z,N]),onTriggerLeave:E.useCallback(()=>{w?D():(window.clearTimeout(g.current),g.current=0)},[D,w]),onOpen:N,onClose:D,disableHoverableContent:w,children:n})})};UC.displayName=ud;var Mg="TooltipTrigger",HC=E.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,i=cd(Mg,n),o=oy(Mg,n),s=sd(n),u=E.useRef(null),f=dt(t,u,i.onTriggerChange),d=E.useRef(!1),p=E.useRef(!1),m=E.useCallback(()=>d.current=!1,[]);return E.useEffect(()=>()=>document.removeEventListener("pointerup",m),[m]),S.jsx(od,{asChild:!0,...s,children:S.jsx(We.button,{"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute,...r,ref:f,onPointerMove:qe(e.onPointerMove,v=>{v.pointerType!=="touch"&&!p.current&&!o.isPointerInTransitRef.current&&(i.onTriggerEnter(),p.current=!0)}),onPointerLeave:qe(e.onPointerLeave,()=>{i.onTriggerLeave(),p.current=!1}),onPointerDown:qe(e.onPointerDown,()=>{d.current=!0,document.addEventListener("pointerup",m,{once:!0})}),onFocus:qe(e.onFocus,()=>{d.current||i.onOpen()}),onBlur:qe(e.onBlur,i.onClose),onClick:qe(e.onClick,i.onClose)})})});HC.displayName=Mg;var tI="TooltipPortal",[fK,nI]=ld(tI,{forceMount:void 0}),sl="TooltipContent",$C=E.forwardRef((e,t)=>{const n=nI(sl,e.__scopeTooltip),{forceMount:r=n.forceMount,side:i="top",...o}=e,s=cd(sl,e.__scopeTooltip);return S.jsx(Zn,{present:r||s.open,children:s.disableHoverableContent?S.jsx(VC,{side:i,...o,ref:t}):S.jsx(rI,{side:i,...o,ref:t})})}),rI=E.forwardRef((e,t)=>{const n=cd(sl,e.__scopeTooltip),r=oy(sl,e.__scopeTooltip),i=E.useRef(null),o=dt(t,i),[s,u]=E.useState(null),{trigger:f,onClose:d}=n,p=i.current,{onPointerInTransitChange:m}=r,v=E.useCallback(()=>{u(null),m(!1)},[m]),g=E.useCallback((w,x)=>{const k=w.currentTarget,C={x:w.clientX,y:w.clientY},_=lI(C,k.getBoundingClientRect()),T=sI(C,_),N=uI(x.getBoundingClientRect()),D=fI([...T,...N]);u(D),m(!0)},[m]);return E.useEffect(()=>()=>v(),[v]),E.useEffect(()=>{if(f&&p){const w=k=>g(k,p),x=k=>g(k,f);return f.addEventListener("pointerleave",w),p.addEventListener("pointerleave",x),()=>{f.removeEventListener("pointerleave",w),p.removeEventListener("pointerleave",x)}}},[f,p,g,v]),E.useEffect(()=>{if(s){const w=x=>{const k=x.target,C={x:x.clientX,y:x.clientY},_=(f==null?void 0:f.contains(k))||(p==null?void 0:p.contains(k)),T=!cI(C,s);_?v():T&&(v(),d())};return document.addEventListener("pointermove",w),()=>document.removeEventListener("pointermove",w)}},[f,p,s,d,v]),S.jsx(VC,{...e,ref:o})}),[iI,aI]=ld(ud,{isInside:!1}),VC=E.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":i,onEscapeKeyDown:o,onPointerDownOutside:s,...u}=e,f=cd(sl,n),d=sd(n),{onClose:p}=f;return E.useEffect(()=>(document.addEventListener(jg,p),()=>document.removeEventListener(jg,p)),[p]),E.useEffect(()=>{if(f.trigger){const m=v=>{const g=v.target;g!=null&&g.contains(f.trigger)&&p()};return window.addEventListener("scroll",m,{capture:!0}),()=>window.removeEventListener("scroll",m,{capture:!0})}},[f.trigger,p]),S.jsx(ou,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:o,onPointerDownOutside:s,onFocusOutside:m=>m.preventDefault(),onDismiss:p,children:S.jsxs(ry,{"data-state":f.stateAttribute,...d,...u,ref:t,style:{...u.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[S.jsx(jv,{children:r}),S.jsx(iI,{scope:n,isInside:!0,children:S.jsx(Z4,{id:f.contentId,role:"tooltip",children:i||r})})]})})});$C.displayName=sl;var qC="TooltipArrow",oI=E.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,i=sd(n);return aI(qC,n).isInside?null:S.jsx(iy,{...i,...r,ref:t})});oI.displayName=qC;function lI(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),i=Math.abs(t.right-e.x),o=Math.abs(t.left-e.x);switch(Math.min(n,r,i,o)){case o:return"left";case i:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function sI(e,t,n=5){const r=[];switch(t){case"top":r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}function uI(e){const{top:t,right:n,bottom:r,left:i}=e;return[{x:i,y:t},{x:n,y:t},{x:n,y:r},{x:i,y:r}]}function cI(e,t){const{x:n,y:r}=e;let i=!1;for(let o=0,s=t.length-1;or!=p>r&&n<(d-u)*(r-f)/(p-f)+u&&(i=!i)}return i}function fI(e){const t=e.slice();return t.sort((n,r)=>n.xr.x?1:n.yr.y?1:0),dI(t)}function dI(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r=2;){const o=t[t.length-1],s=t[t.length-2];if((o.x-s.x)*(i.y-s.y)>=(o.y-s.y)*(i.x-s.x))t.pop();else break}t.push(i)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const i=e[r];for(;n.length>=2;){const o=n[n.length-1],s=n[n.length-2];if((o.x-s.x)*(i.y-s.y)>=(o.y-s.y)*(i.x-s.x))n.pop();else break}n.push(i)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var hI=BC,pI=UC,mI=HC,YC=$C;const WC=hI,XC=pI,KC=mI,gI=e=>typeof e!="string"?e:e.split("\\n").map((t,n)=>S.jsxs(E.Fragment,{children:[t,nS.jsx(YC,{ref:i,sideOffset:t,className:Me("bg-popover text-popover-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 mx-1 max-w-sm overflow-hidden rounded-md border px-3 py-2 text-sm shadow-md",e),...r,children:typeof n=="string"?gI(n):n}));ly.displayName=YC.displayName;const kf=U_("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"size-8"}},defaultVariants:{variant:"default",size:"default"}}),Ot=E.forwardRef(({className:e,variant:t,tooltip:n,size:r,side:i="right",asChild:o=!1,...s},u)=>{const f=o?ua:"button";return n?S.jsx(WC,{children:S.jsxs(XC,{children:[S.jsx(KC,{asChild:!0,children:S.jsx(f,{className:Me(kf({variant:t,size:r,className:e}),"cursor-pointer"),ref:u,...s})}),S.jsx(ly,{side:i,children:n})]})}):S.jsx(f,{className:Me(kf({variant:t,size:r,className:e}),"cursor-pointer"),ref:u,...s})});Ot.displayName="Button";const vI=HF,yI=$F,ZC=E.forwardRef(({className:e,...t},n)=>S.jsx(hC,{className:Me("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/80",e),...t,ref:n}));ZC.displayName=hC.displayName;const QC=E.forwardRef(({className:e,...t},n)=>S.jsxs(yI,{children:[S.jsx(ZC,{}),S.jsx(pC,{ref:n,className:Me("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-top-[48%] fixed top-[50%] left-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border p-6 shadow-lg duration-200 sm:rounded-lg",e),...t})]}));QC.displayName=pC.displayName;const JC=({className:e,...t})=>S.jsx("div",{className:Me("flex flex-col space-y-2 text-center sm:text-left",e),...t});JC.displayName="AlertDialogHeader";const eT=E.forwardRef(({className:e,...t},n)=>S.jsx(vC,{ref:n,className:Me("text-lg font-semibold",e),...t}));eT.displayName=vC.displayName;const tT=E.forwardRef(({className:e,...t},n)=>S.jsx(yC,{ref:n,className:Me("text-muted-foreground text-sm",e),...t}));tT.displayName=yC.displayName;const bI=E.forwardRef(({className:e,...t},n)=>S.jsx(mC,{ref:n,className:Me(kf(),e),...t}));bI.displayName=mC.displayName;const xI=E.forwardRef(({className:e,...t},n)=>S.jsx(gC,{ref:n,className:Me(kf({variant:"outline"}),"mt-2 sm:mt-0",e),...t}));xI.displayName=gC.displayName;const Za=E.forwardRef(({className:e,type:t,...n},r)=>S.jsx("input",{type:t,className:Me("border-input file:text-foreground placeholder:text-muted-foreground focus-visible:ring-ring flex h-9 rounded-md border bg-transparent px-3 py-1 text-base shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium focus-visible:ring-1 focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),ref:r,...n}));Za.displayName="Input";var wI=e=>{switch(e){case"success":return _I;case"info":return CI;case"warning":return kI;case"error":return TI;default:return null}},SI=Array(12).fill(0),EI=({visible:e,className:t})=>be.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},be.createElement("div",{className:"sonner-spinner"},SI.map((n,r)=>be.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),_I=be.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},be.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),kI=be.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},be.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),CI=be.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},be.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),TI=be.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},be.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-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"})),AI=be.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},be.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),be.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),RI=()=>{let[e,t]=be.useState(document.hidden);return be.useEffect(()=>{let n=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),e},Pg=1,DI=class{constructor(){this.subscribe=e=>(this.subscribers.push(e),()=>{let t=this.subscribers.indexOf(e);this.subscribers.splice(t,1)}),this.publish=e=>{this.subscribers.forEach(t=>t(e))},this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e]},this.create=e=>{var t;let{message:n,...r}=e,i=typeof(e==null?void 0:e.id)=="number"||((t=e.id)==null?void 0:t.length)>0?e.id:Pg++,o=this.toasts.find(u=>u.id===i),s=e.dismissible===void 0?!0:e.dismissible;return this.dismissedToasts.has(i)&&this.dismissedToasts.delete(i),o?this.toasts=this.toasts.map(u=>u.id===i?(this.publish({...u,...e,id:i,title:n}),{...u,...e,id:i,dismissible:s,title:n}):u):this.addToast({title:n,...r,dismissible:s,id:i}),i},this.dismiss=e=>(this.dismissedToasts.add(e),e||this.toasts.forEach(t=>{this.subscribers.forEach(n=>n({id:t.id,dismiss:!0}))}),this.subscribers.forEach(t=>t({id:e,dismiss:!0})),e),this.message=(e,t)=>this.create({...t,message:e}),this.error=(e,t)=>this.create({...t,message:e,type:"error"}),this.success=(e,t)=>this.create({...t,type:"success",message:e}),this.info=(e,t)=>this.create({...t,type:"info",message:e}),this.warning=(e,t)=>this.create({...t,type:"warning",message:e}),this.loading=(e,t)=>this.create({...t,type:"loading",message:e}),this.promise=(e,t)=>{if(!t)return;let n;t.loading!==void 0&&(n=this.create({...t,promise:e,type:"loading",message:t.loading,description:typeof t.description!="function"?t.description:void 0}));let r=e instanceof Promise?e:e(),i=n!==void 0,o,s=r.then(async f=>{if(o=["resolve",f],be.isValidElement(f))i=!1,this.create({id:n,type:"default",message:f});else if(OI(f)&&!f.ok){i=!1;let d=typeof t.error=="function"?await t.error(`HTTP error! status: ${f.status}`):t.error,p=typeof t.description=="function"?await t.description(`HTTP error! status: ${f.status}`):t.description;this.create({id:n,type:"error",message:d,description:p})}else if(t.success!==void 0){i=!1;let d=typeof t.success=="function"?await t.success(f):t.success,p=typeof t.description=="function"?await t.description(f):t.description;this.create({id:n,type:"success",message:d,description:p})}}).catch(async f=>{if(o=["reject",f],t.error!==void 0){i=!1;let d=typeof t.error=="function"?await t.error(f):t.error,p=typeof t.description=="function"?await t.description(f):t.description;this.create({id:n,type:"error",message:d,description:p})}}).finally(()=>{var f;i&&(this.dismiss(n),n=void 0),(f=t.finally)==null||f.call(t)}),u=()=>new Promise((f,d)=>s.then(()=>o[0]==="reject"?d(o[1]):f(o[1])).catch(d));return typeof n!="string"&&typeof n!="number"?{unwrap:u}:Object.assign(n,{unwrap:u})},this.custom=(e,t)=>{let n=(t==null?void 0:t.id)||Pg++;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}},zn=new DI,NI=(e,t)=>{let n=(t==null?void 0:t.id)||Pg++;return zn.addToast({title:e,...t,id:n}),n},OI=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",LI=NI,zI=()=>zn.toasts,jI=()=>zn.getActiveToasts(),vn=Object.assign(LI,{success:zn.success,info:zn.info,warning:zn.warning,error:zn.error,custom:zn.custom,message:zn.message,promise:zn.promise,dismiss:zn.dismiss,loading:zn.loading},{getHistory:zI,getToasts:jI});function MI(e,{insertAt:t}={}){if(typeof document>"u")return;let n=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",t==="top"&&n.firstChild?n.insertBefore(r,n.firstChild):n.appendChild(r),r.styleSheet?r.styleSheet.cssText=e:r.appendChild(document.createTextNode(e))}MI(`: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 jc(e){return e.label!==void 0}var PI=3,FI="32px",II="16px",F1=4e3,GI=356,BI=14,UI=20,HI=200;function wr(...e){return e.filter(Boolean).join(" ")}function $I(e){let[t,n]=e.split("-"),r=[];return t&&r.push(t),n&&r.push(n),r}var VI=e=>{var t,n,r,i,o,s,u,f,d,p,m;let{invert:v,toast:g,unstyled:w,interacting:x,setHeights:k,visibleToasts:C,heights:_,index:T,toasts:N,expanded:D,removeToast:z,defaultRichColors:R,closeButton:B,style:P,cancelButtonStyle:j,actionButtonStyle:V,className:q="",descriptionClassName:I="",duration:Y,position:Z,gap:U,loadingIcon:G,expandByDefault:F,classNames:K,icons:A,closeButtonAriaLabel:$="Close toast",pauseWhenPageIsHidden:M}=e,[O,X]=be.useState(null),[re,ue]=be.useState(null),[ae,oe]=be.useState(!1),[Ce,he]=be.useState(!1),[Ee,we]=be.useState(!1),[Pe,Ae]=be.useState(!1),[xe,ee]=be.useState(!1),[ce,Te]=be.useState(0),[ge,Se]=be.useState(0),ie=be.useRef(g.duration||Y||F1),He=be.useRef(null),Ge=be.useRef(null),ve=T===0,Ne=T+1<=C,te=g.type,de=g.dismissible!==!1,Oe=g.className||"",$e=g.descriptionClassName||"",Ye=be.useMemo(()=>_.findIndex(Ze=>Ze.toastId===g.id)||0,[_,g.id]),vt=be.useMemo(()=>{var Ze;return(Ze=g.closeButton)!=null?Ze:B},[g.closeButton,B]),Mt=be.useMemo(()=>g.duration||Y||F1,[g.duration,Y]),bt=be.useRef(0),rt=be.useRef(0),qt=be.useRef(0),at=be.useRef(null),[At,rn]=Z.split("-"),io=be.useMemo(()=>_.reduce((Ze,gt,_t)=>_t>=Ye?Ze:Ze+gt.height,0),[_,Ye]),xu=RI(),ao=g.invert||v,Di=te==="loading";rt.current=be.useMemo(()=>Ye*U+io,[Ye,io]),be.useEffect(()=>{ie.current=Mt},[Mt]),be.useEffect(()=>{oe(!0)},[]),be.useEffect(()=>{let Ze=Ge.current;if(Ze){let gt=Ze.getBoundingClientRect().height;return Se(gt),k(_t=>[{toastId:g.id,height:gt,position:g.position},..._t]),()=>k(_t=>_t.filter(Cn=>Cn.toastId!==g.id))}},[k,g.id]),be.useLayoutEffect(()=>{if(!ae)return;let Ze=Ge.current,gt=Ze.style.height;Ze.style.height="auto";let _t=Ze.getBoundingClientRect().height;Ze.style.height=gt,Se(_t),k(Cn=>Cn.find(Sn=>Sn.toastId===g.id)?Cn.map(Sn=>Sn.toastId===g.id?{...Sn,height:_t}:Sn):[{toastId:g.id,height:_t,position:g.position},...Cn])},[ae,g.title,g.description,k,g.id]);let dn=be.useCallback(()=>{he(!0),Te(rt.current),k(Ze=>Ze.filter(gt=>gt.toastId!==g.id)),setTimeout(()=>{z(g)},HI)},[g,z,k,rt]);be.useEffect(()=>{if(g.promise&&te==="loading"||g.duration===1/0||g.type==="loading")return;let Ze;return D||x||M&&xu?(()=>{if(qt.current{var gt;(gt=g.onAutoClose)==null||gt.call(g,g),dn()},ie.current)),()=>clearTimeout(Ze)},[D,x,g,te,M,xu,dn]),be.useEffect(()=>{g.delete&&dn()},[dn,g.delete]);function oo(){var Ze,gt,_t;return A!=null&&A.loading?be.createElement("div",{className:wr(K==null?void 0:K.loader,(Ze=g==null?void 0:g.classNames)==null?void 0:Ze.loader,"sonner-loader"),"data-visible":te==="loading"},A.loading):G?be.createElement("div",{className:wr(K==null?void 0:K.loader,(gt=g==null?void 0:g.classNames)==null?void 0:gt.loader,"sonner-loader"),"data-visible":te==="loading"},G):be.createElement(EI,{className:wr(K==null?void 0:K.loader,(_t=g==null?void 0:g.classNames)==null?void 0:_t.loader),visible:te==="loading"})}return be.createElement("li",{tabIndex:0,ref:Ge,className:wr(q,Oe,K==null?void 0:K.toast,(t=g==null?void 0:g.classNames)==null?void 0:t.toast,K==null?void 0:K.default,K==null?void 0:K[te],(n=g==null?void 0:g.classNames)==null?void 0:n[te]),"data-sonner-toast":"","data-rich-colors":(r=g.richColors)!=null?r:R,"data-styled":!(g.jsx||g.unstyled||w),"data-mounted":ae,"data-promise":!!g.promise,"data-swiped":xe,"data-removed":Ce,"data-visible":Ne,"data-y-position":At,"data-x-position":rn,"data-index":T,"data-front":ve,"data-swiping":Ee,"data-dismissible":de,"data-type":te,"data-invert":ao,"data-swipe-out":Pe,"data-swipe-direction":re,"data-expanded":!!(D||F&&ae),style:{"--index":T,"--toasts-before":T,"--z-index":N.length-T,"--offset":`${Ce?ce:rt.current}px`,"--initial-height":F?"auto":`${ge}px`,...P,...g.style},onDragEnd:()=>{we(!1),X(null),at.current=null},onPointerDown:Ze=>{Di||!de||(He.current=new Date,Te(rt.current),Ze.target.setPointerCapture(Ze.pointerId),Ze.target.tagName!=="BUTTON"&&(we(!0),at.current={x:Ze.clientX,y:Ze.clientY}))},onPointerUp:()=>{var Ze,gt,_t,Cn;if(Pe||!de)return;at.current=null;let Sn=Number(((Ze=Ge.current)==null?void 0:Ze.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),Tn=Number(((gt=Ge.current)==null?void 0:gt.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),Zr=new Date().getTime()-((_t=He.current)==null?void 0:_t.getTime()),An=O==="x"?Sn:Tn,gr=Math.abs(An)/Zr;if(Math.abs(An)>=UI||gr>.11){Te(rt.current),(Cn=g.onDismiss)==null||Cn.call(g,g),ue(O==="x"?Sn>0?"right":"left":Tn>0?"down":"up"),dn(),Ae(!0),ee(!1);return}we(!1),X(null)},onPointerMove:Ze=>{var gt,_t,Cn,Sn;if(!at.current||!de||((gt=window.getSelection())==null?void 0:gt.toString().length)>0)return;let Tn=Ze.clientY-at.current.y,Zr=Ze.clientX-at.current.x,An=(_t=e.swipeDirections)!=null?_t:$I(Z);!O&&(Math.abs(Zr)>1||Math.abs(Tn)>1)&&X(Math.abs(Zr)>Math.abs(Tn)?"x":"y");let gr={x:0,y:0};O==="y"?(An.includes("top")||An.includes("bottom"))&&(An.includes("top")&&Tn<0||An.includes("bottom")&&Tn>0)&&(gr.y=Tn):O==="x"&&(An.includes("left")||An.includes("right"))&&(An.includes("left")&&Zr<0||An.includes("right")&&Zr>0)&&(gr.x=Zr),(Math.abs(gr.x)>0||Math.abs(gr.y)>0)&&ee(!0),(Cn=Ge.current)==null||Cn.style.setProperty("--swipe-amount-x",`${gr.x}px`),(Sn=Ge.current)==null||Sn.style.setProperty("--swipe-amount-y",`${gr.y}px`)}},vt&&!g.jsx?be.createElement("button",{"aria-label":$,"data-disabled":Di,"data-close-button":!0,onClick:Di||!de?()=>{}:()=>{var Ze;dn(),(Ze=g.onDismiss)==null||Ze.call(g,g)},className:wr(K==null?void 0:K.closeButton,(i=g==null?void 0:g.classNames)==null?void 0:i.closeButton)},(o=A==null?void 0:A.close)!=null?o:AI):null,g.jsx||E.isValidElement(g.title)?g.jsx?g.jsx:typeof g.title=="function"?g.title():g.title:be.createElement(be.Fragment,null,te||g.icon||g.promise?be.createElement("div",{"data-icon":"",className:wr(K==null?void 0:K.icon,(s=g==null?void 0:g.classNames)==null?void 0:s.icon)},g.promise||g.type==="loading"&&!g.icon?g.icon||oo():null,g.type!=="loading"?g.icon||(A==null?void 0:A[te])||wI(te):null):null,be.createElement("div",{"data-content":"",className:wr(K==null?void 0:K.content,(u=g==null?void 0:g.classNames)==null?void 0:u.content)},be.createElement("div",{"data-title":"",className:wr(K==null?void 0:K.title,(f=g==null?void 0:g.classNames)==null?void 0:f.title)},typeof g.title=="function"?g.title():g.title),g.description?be.createElement("div",{"data-description":"",className:wr(I,$e,K==null?void 0:K.description,(d=g==null?void 0:g.classNames)==null?void 0:d.description)},typeof g.description=="function"?g.description():g.description):null),E.isValidElement(g.cancel)?g.cancel:g.cancel&&jc(g.cancel)?be.createElement("button",{"data-button":!0,"data-cancel":!0,style:g.cancelButtonStyle||j,onClick:Ze=>{var gt,_t;jc(g.cancel)&&de&&((_t=(gt=g.cancel).onClick)==null||_t.call(gt,Ze),dn())},className:wr(K==null?void 0:K.cancelButton,(p=g==null?void 0:g.classNames)==null?void 0:p.cancelButton)},g.cancel.label):null,E.isValidElement(g.action)?g.action:g.action&&jc(g.action)?be.createElement("button",{"data-button":!0,"data-action":!0,style:g.actionButtonStyle||V,onClick:Ze=>{var gt,_t;jc(g.action)&&((_t=(gt=g.action).onClick)==null||_t.call(gt,Ze),!Ze.defaultPrevented&&dn())},className:wr(K==null?void 0:K.actionButton,(m=g==null?void 0:g.classNames)==null?void 0:m.actionButton)},g.action.label):null))};function I1(){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 qI(e,t){let n={};return[e,t].forEach((r,i)=>{let o=i===1,s=o?"--mobile-offset":"--offset",u=o?II:FI;function f(d){["top","right","bottom","left"].forEach(p=>{n[`${s}-${p}`]=typeof d=="number"?`${d}px`:d})}typeof r=="number"||typeof r=="string"?f(r):typeof r=="object"?["top","right","bottom","left"].forEach(d=>{r[d]===void 0?n[`${s}-${d}`]=u:n[`${s}-${d}`]=typeof r[d]=="number"?`${r[d]}px`:r[d]}):f(u)}),n}var YI=E.forwardRef(function(e,t){let{invert:n,position:r="bottom-right",hotkey:i=["altKey","KeyT"],expand:o,closeButton:s,className:u,offset:f,mobileOffset:d,theme:p="light",richColors:m,duration:v,style:g,visibleToasts:w=PI,toastOptions:x,dir:k=I1(),gap:C=BI,loadingIcon:_,icons:T,containerAriaLabel:N="Notifications",pauseWhenPageIsHidden:D}=e,[z,R]=be.useState([]),B=be.useMemo(()=>Array.from(new Set([r].concat(z.filter(M=>M.position).map(M=>M.position)))),[z,r]),[P,j]=be.useState([]),[V,q]=be.useState(!1),[I,Y]=be.useState(!1),[Z,U]=be.useState(p!=="system"?p:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),G=be.useRef(null),F=i.join("+").replace(/Key/g,"").replace(/Digit/g,""),K=be.useRef(null),A=be.useRef(!1),$=be.useCallback(M=>{R(O=>{var X;return(X=O.find(re=>re.id===M.id))!=null&&X.delete||zn.dismiss(M.id),O.filter(({id:re})=>re!==M.id)})},[]);return be.useEffect(()=>zn.subscribe(M=>{if(M.dismiss){R(O=>O.map(X=>X.id===M.id?{...X,delete:!0}:X));return}setTimeout(()=>{kk.flushSync(()=>{R(O=>{let X=O.findIndex(re=>re.id===M.id);return X!==-1?[...O.slice(0,X),{...O[X],...M},...O.slice(X+1)]:[M,...O]})})})}),[]),be.useEffect(()=>{if(p!=="system"){U(p);return}if(p==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?U("dark"):U("light")),typeof window>"u")return;let M=window.matchMedia("(prefers-color-scheme: dark)");try{M.addEventListener("change",({matches:O})=>{U(O?"dark":"light")})}catch{M.addListener(({matches:X})=>{try{U(X?"dark":"light")}catch(re){console.error(re)}})}},[p]),be.useEffect(()=>{z.length<=1&&q(!1)},[z]),be.useEffect(()=>{let M=O=>{var X,re;i.every(ue=>O[ue]||O.code===ue)&&(q(!0),(X=G.current)==null||X.focus()),O.code==="Escape"&&(document.activeElement===G.current||(re=G.current)!=null&&re.contains(document.activeElement))&&q(!1)};return document.addEventListener("keydown",M),()=>document.removeEventListener("keydown",M)},[i]),be.useEffect(()=>{if(G.current)return()=>{K.current&&(K.current.focus({preventScroll:!0}),K.current=null,A.current=!1)}},[G.current]),be.createElement("section",{ref:t,"aria-label":`${N} ${F}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},B.map((M,O)=>{var X;let[re,ue]=M.split("-");return z.length?be.createElement("ol",{key:M,dir:k==="auto"?I1():k,tabIndex:-1,ref:G,className:u,"data-sonner-toaster":!0,"data-theme":Z,"data-y-position":re,"data-lifted":V&&z.length>1&&!o,"data-x-position":ue,style:{"--front-toast-height":`${((X=P[0])==null?void 0:X.height)||0}px`,"--width":`${GI}px`,"--gap":`${C}px`,...g,...qI(f,d)},onBlur:ae=>{A.current&&!ae.currentTarget.contains(ae.relatedTarget)&&(A.current=!1,K.current&&(K.current.focus({preventScroll:!0}),K.current=null))},onFocus:ae=>{ae.target instanceof HTMLElement&&ae.target.dataset.dismissible==="false"||A.current||(A.current=!0,K.current=ae.relatedTarget)},onMouseEnter:()=>q(!0),onMouseMove:()=>q(!0),onMouseLeave:()=>{I||q(!1)},onDragEnd:()=>q(!1),onPointerDown:ae=>{ae.target instanceof HTMLElement&&ae.target.dataset.dismissible==="false"||Y(!0)},onPointerUp:()=>Y(!1)},z.filter(ae=>!ae.position&&O===0||ae.position===M).map((ae,oe)=>{var Ce,he;return be.createElement(VI,{key:ae.id,icons:T,index:oe,toast:ae,defaultRichColors:m,duration:(Ce=x==null?void 0:x.duration)!=null?Ce:v,className:x==null?void 0:x.className,descriptionClassName:x==null?void 0:x.descriptionClassName,invert:n,visibleToasts:w,closeButton:(he=x==null?void 0:x.closeButton)!=null?he:s,interacting:I,position:M,style:x==null?void 0:x.style,unstyled:x==null?void 0:x.unstyled,classNames:x==null?void 0:x.classNames,cancelButtonStyle:x==null?void 0:x.cancelButtonStyle,actionButtonStyle:x==null?void 0:x.actionButtonStyle,removeToast:$,toasts:z.filter(Ee=>Ee.position==ae.position),heights:P.filter(Ee=>Ee.position==ae.position),setHeights:j,expandByDefault:o,gap:C,loadingIcon:_,expanded:V,pauseWhenPageIsHidden:D,swipeDirections:e.swipeDirections})})):null}))});const WI=()=>{const[e,t]=E.useState(!0),n=Qe.use.apiKey(),[r,i]=E.useState(""),o=Mn.use.message();E.useEffect(()=>{i(n||"")},[n,e]),E.useEffect(()=>{o&&(o.includes(vk)||o.includes(yk))&&t(!0)},[o,t]);const s=E.useCallback(async()=>{if(Qe.setState({apiKey:r||null}),await Mn.getState().check()){t(!1);return}vn.error("API Key is invalid")},[r]),u=E.useCallback(f=>{i(f.target.value)},[i]);return S.jsx(vI,{open:e,onOpenChange:t,children:S.jsxs(QC,{children:[S.jsxs(JC,{children:[S.jsx(eT,{children:"API Key is required"}),S.jsx(tT,{children:"Please enter your API key"})]}),S.jsxs("form",{className:"flex gap-2",onSubmit:f=>f.preventDefault(),children:[S.jsx(Za,{type:"password",value:r,onChange:u,placeholder:"Enter your API key",className:"max-h-full w-full min-w-0",autoComplete:"off"}),S.jsx(Ot,{onClick:s,variant:"outline",size:"sm",children:"Save"})]})]})})};var sy="Popover",[nT,dK]=hr(sy,[wl]),su=wl(),[XI,ha]=nT(sy),rT=e=>{const{__scopePopover:t,children:n,open:r,defaultOpen:i,onOpenChange:o,modal:s=!1}=e,u=su(t),f=E.useRef(null),[d,p]=E.useState(!1),[m=!1,v]=_i({prop:r,defaultProp:i,onChange:o});return S.jsx(ny,{...u,children:S.jsx(XI,{scope:t,contentId:bn(),triggerRef:f,open:m,onOpenChange:v,onOpenToggle:E.useCallback(()=>v(g=>!g),[v]),hasCustomAnchor:d,onCustomAnchorAdd:E.useCallback(()=>p(!0),[]),onCustomAnchorRemove:E.useCallback(()=>p(!1),[]),modal:s,children:n})})};rT.displayName=sy;var iT="PopoverAnchor",KI=E.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,i=ha(iT,n),o=su(n),{onCustomAnchorAdd:s,onCustomAnchorRemove:u}=i;return E.useEffect(()=>(s(),()=>u()),[s,u]),S.jsx(od,{...o,...r,ref:t})});KI.displayName=iT;var aT="PopoverTrigger",oT=E.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,i=ha(aT,n),o=su(n),s=dt(t,i.triggerRef),u=S.jsx(We.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":fT(i.open),...r,ref:s,onClick:qe(e.onClick,i.onOpenToggle)});return i.hasCustomAnchor?u:S.jsx(od,{asChild:!0,...o,children:u})});oT.displayName=aT;var uy="PopoverPortal",[ZI,QI]=nT(uy,{forceMount:void 0}),lT=e=>{const{__scopePopover:t,forceMount:n,children:r,container:i}=e,o=ha(uy,t);return S.jsx(ZI,{scope:t,forceMount:n,children:S.jsx(Zn,{present:n||o.open,children:S.jsx(Qf,{asChild:!0,container:i,children:r})})})};lT.displayName=uy;var ul="PopoverContent",sT=E.forwardRef((e,t)=>{const n=QI(ul,e.__scopePopover),{forceMount:r=n.forceMount,...i}=e,o=ha(ul,e.__scopePopover);return S.jsx(Zn,{present:r||o.open,children:o.modal?S.jsx(JI,{...i,ref:t}):S.jsx(e3,{...i,ref:t})})});sT.displayName=ul;var JI=E.forwardRef((e,t)=>{const n=ha(ul,e.__scopePopover),r=E.useRef(null),i=dt(t,r),o=E.useRef(!1);return E.useEffect(()=>{const s=r.current;if(s)return Pv(s)},[]),S.jsx(ed,{as:ua,allowPinchZoom:!0,children:S.jsx(uT,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:qe(e.onCloseAutoFocus,s=>{var u;s.preventDefault(),o.current||(u=n.triggerRef.current)==null||u.focus()}),onPointerDownOutside:qe(e.onPointerDownOutside,s=>{const u=s.detail.originalEvent,f=u.button===0&&u.ctrlKey===!0,d=u.button===2||f;o.current=d},{checkForDefaultPrevented:!1}),onFocusOutside:qe(e.onFocusOutside,s=>s.preventDefault(),{checkForDefaultPrevented:!1})})})}),e3=E.forwardRef((e,t)=>{const n=ha(ul,e.__scopePopover),r=E.useRef(!1),i=E.useRef(!1);return S.jsx(uT,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{var s,u;(s=e.onCloseAutoFocus)==null||s.call(e,o),o.defaultPrevented||(r.current||(u=n.triggerRef.current)==null||u.focus(),o.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:o=>{var f,d;(f=e.onInteractOutside)==null||f.call(e,o),o.defaultPrevented||(r.current=!0,o.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const s=o.target;((d=n.triggerRef.current)==null?void 0:d.contains(s))&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&i.current&&o.preventDefault()}})}),uT=E.forwardRef((e,t)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:o,disableOutsidePointerEvents:s,onEscapeKeyDown:u,onPointerDownOutside:f,onFocusOutside:d,onInteractOutside:p,...m}=e,v=ha(ul,n),g=su(n);return Mv(),S.jsx(Zf,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:o,children:S.jsx(ou,{asChild:!0,disableOutsidePointerEvents:s,onInteractOutside:p,onEscapeKeyDown:u,onPointerDownOutside:f,onFocusOutside:d,onDismiss:()=>v.onOpenChange(!1),children:S.jsx(ry,{"data-state":fT(v.open),role:"dialog",id:v.contentId,...g,...m,ref:t,style:{...m.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),cT="PopoverClose",t3=E.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,i=ha(cT,n);return S.jsx(We.button,{type:"button",...r,ref:t,onClick:qe(e.onClick,()=>i.onOpenChange(!1))})});t3.displayName=cT;var n3="PopoverArrow",r3=E.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,i=su(n);return S.jsx(iy,{...i,...r,ref:t})});r3.displayName=n3;function fT(e){return e?"open":"closed"}var i3=rT,a3=oT,o3=lT,dT=sT;const fd=i3,dd=a3,uu=E.forwardRef(({className:e,align:t="center",sideOffset:n=4,...r},i)=>S.jsx(o3,{children:S.jsx(dT,{ref:i,align:t,sideOffset:n,className:Me("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 rounded-md border p-4 shadow-md outline-none",e),...r})}));uu.displayName=dT.displayName;const l3=({status:e})=>e?S.jsxs("div",{className:"min-w-[300px] space-y-3 text-sm",children:[S.jsxs("div",{className:"space-y-1",children:[S.jsx("h4",{className:"font-medium",children:"Storage Info"}),S.jsxs("div",{className:"text-muted-foreground grid grid-cols-2 gap-1",children:[S.jsx("span",{children:"Working Directory:"}),S.jsx("span",{className:"truncate",children:e.working_directory}),S.jsx("span",{children:"Input Directory:"}),S.jsx("span",{className:"truncate",children:e.input_directory})]})]}),S.jsxs("div",{className:"space-y-1",children:[S.jsx("h4",{className:"font-medium",children:"LLM Configuration"}),S.jsxs("div",{className:"text-muted-foreground grid grid-cols-2 gap-1",children:[S.jsx("span",{children:"LLM Binding:"}),S.jsx("span",{children:e.configuration.llm_binding}),S.jsx("span",{children:"LLM Binding Host:"}),S.jsx("span",{children:e.configuration.llm_binding_host}),S.jsx("span",{children:"LLM Model:"}),S.jsx("span",{children:e.configuration.llm_model}),S.jsx("span",{children:"Max Tokens:"}),S.jsx("span",{children:e.configuration.max_tokens})]})]}),S.jsxs("div",{className:"space-y-1",children:[S.jsx("h4",{className:"font-medium",children:"Embedding Configuration"}),S.jsxs("div",{className:"text-muted-foreground grid grid-cols-2 gap-1",children:[S.jsx("span",{children:"Embedding Binding:"}),S.jsx("span",{children:e.configuration.embedding_binding}),S.jsx("span",{children:"Embedding Binding Host:"}),S.jsx("span",{children:e.configuration.embedding_binding_host}),S.jsx("span",{children:"Embedding Model:"}),S.jsx("span",{children:e.configuration.embedding_model})]})]}),S.jsxs("div",{className:"space-y-1",children:[S.jsx("h4",{className:"font-medium",children:"Storage Configuration"}),S.jsxs("div",{className:"text-muted-foreground grid grid-cols-2 gap-1",children:[S.jsx("span",{children:"KV Storage:"}),S.jsx("span",{children:e.configuration.kv_storage}),S.jsx("span",{children:"Doc Status Storage:"}),S.jsx("span",{children:e.configuration.doc_status_storage}),S.jsx("span",{children:"Graph Storage:"}),S.jsx("span",{children:e.configuration.graph_storage}),S.jsx("span",{children:"Vector Storage:"}),S.jsx("span",{children:e.configuration.vector_storage})]})]})]}):S.jsx("div",{className:"text-muted-foreground text-sm",children:"Status information unavailable"}),s3=()=>{const e=Mn.use.health(),t=Mn.use.lastCheckTime(),n=Mn.use.status(),[r,i]=E.useState(!1);return E.useEffect(()=>{i(!0);const o=setTimeout(()=>i(!1),300);return()=>clearTimeout(o)},[t]),S.jsx("div",{className:"fixed right-4 bottom-4 flex items-center gap-2 opacity-80 select-none",children:S.jsxs(fd,{children:[S.jsx(dd,{asChild:!0,children:S.jsxs("div",{className:"flex cursor-help items-center gap-2",children:[S.jsx("div",{className:Me("h-3 w-3 rounded-full transition-all duration-300","shadow-[0_0_8px_rgba(0,0,0,0.2)]",e?"bg-green-500":"bg-red-500",r&&"scale-125",r&&e&&"shadow-[0_0_12px_rgba(34,197,94,0.4)]",r&&!e&&"shadow-[0_0_12px_rgba(239,68,68,0.4)]")}),S.jsx("span",{className:"text-muted-foreground text-xs",children:e?"Connected":"Disconnected"})]})}),S.jsx(uu,{className:"w-auto",side:"top",align:"end",children:S.jsx(l3,{status:n})})]})})},hT=()=>{const e=E.useContext(B_);if(e===void 0)throw new Error("useTheme must be used within a ThemeProvider");return e};function u3(){const{theme:e,setTheme:t}=hT(),n=E.useCallback(()=>t("light"),[t]),r=E.useCallback(()=>t("dark"),[t]);return e==="dark"?S.jsx(Ot,{onClick:n,variant:Hr,tooltip:"Switch to light theme",size:"icon",side:"bottom",children:S.jsx(BM,{})}):S.jsx(Ot,{onClick:r,variant:Hr,tooltip:"Switch to dark theme",size:"icon",side:"bottom",children:S.jsx(tP,{})})}function pT(e){const t=e+"CollectionProvider",[n,r]=hr(t),[i,o]=n(t,{collectionRef:{current:null},itemMap:new Map}),s=g=>{const{scope:w,children:x}=g,k=be.useRef(null),C=be.useRef(new Map).current;return S.jsx(i,{scope:w,itemMap:C,collectionRef:k,children:x})};s.displayName=t;const u=e+"CollectionSlot",f=be.forwardRef((g,w)=>{const{scope:x,children:k}=g,C=o(u,x),_=dt(w,C.collectionRef);return S.jsx(ua,{ref:_,children:k})});f.displayName=u;const d=e+"CollectionItemSlot",p="data-radix-collection-item",m=be.forwardRef((g,w)=>{const{scope:x,children:k,...C}=g,_=be.useRef(null),T=dt(w,_),N=o(d,x);return be.useEffect(()=>(N.itemMap.set(_,{ref:_,...C}),()=>void N.itemMap.delete(_))),S.jsx(ua,{[p]:"",ref:T,children:k})});m.displayName=d;function v(g){const w=o(e+"CollectionConsumer",g);return be.useCallback(()=>{const k=w.collectionRef.current;if(!k)return[];const C=Array.from(k.querySelectorAll(`[${p}]`));return Array.from(w.itemMap.values()).sort((N,D)=>C.indexOf(N.ref.current)-C.indexOf(D.ref.current))},[w.collectionRef,w.itemMap])}return[{Provider:s,Slot:f,ItemSlot:m},v,r]}var c3=E.createContext(void 0);function hd(e){const t=E.useContext(c3);return e||t||"ltr"}var im="rovingFocusGroup.onEntryFocus",f3={bubbles:!1,cancelable:!0},pd="RovingFocusGroup",[Fg,mT,d3]=pT(pd),[h3,gT]=hr(pd,[d3]),[p3,m3]=h3(pd),vT=E.forwardRef((e,t)=>S.jsx(Fg.Provider,{scope:e.__scopeRovingFocusGroup,children:S.jsx(Fg.Slot,{scope:e.__scopeRovingFocusGroup,children:S.jsx(g3,{...e,ref:t})})}));vT.displayName=pd;var g3=E.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:i=!1,dir:o,currentTabStopId:s,defaultCurrentTabStopId:u,onCurrentTabStopIdChange:f,onEntryFocus:d,preventScrollOnEntryFocus:p=!1,...m}=e,v=E.useRef(null),g=dt(t,v),w=hd(o),[x=null,k]=_i({prop:s,defaultProp:u,onChange:f}),[C,_]=E.useState(!1),T=un(d),N=mT(n),D=E.useRef(!1),[z,R]=E.useState(0);return E.useEffect(()=>{const B=v.current;if(B)return B.addEventListener(im,T),()=>B.removeEventListener(im,T)},[T]),S.jsx(p3,{scope:n,orientation:r,dir:w,loop:i,currentTabStopId:x,onItemFocus:E.useCallback(B=>k(B),[k]),onItemShiftTab:E.useCallback(()=>_(!0),[]),onFocusableItemAdd:E.useCallback(()=>R(B=>B+1),[]),onFocusableItemRemove:E.useCallback(()=>R(B=>B-1),[]),children:S.jsx(We.div,{tabIndex:C||z===0?-1:0,"data-orientation":r,...m,ref:g,style:{outline:"none",...e.style},onMouseDown:qe(e.onMouseDown,()=>{D.current=!0}),onFocus:qe(e.onFocus,B=>{const P=!D.current;if(B.target===B.currentTarget&&P&&!C){const j=new CustomEvent(im,f3);if(B.currentTarget.dispatchEvent(j),!j.defaultPrevented){const V=N().filter(U=>U.focusable),q=V.find(U=>U.active),I=V.find(U=>U.id===x),Z=[q,I,...V].filter(Boolean).map(U=>U.ref.current);xT(Z,p)}}D.current=!1}),onBlur:qe(e.onBlur,()=>_(!1))})})}),yT="RovingFocusGroupItem",bT=E.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:o,...s}=e,u=bn(),f=o||u,d=m3(yT,n),p=d.currentTabStopId===f,m=mT(n),{onFocusableItemAdd:v,onFocusableItemRemove:g}=d;return E.useEffect(()=>{if(r)return v(),()=>g()},[r,v,g]),S.jsx(Fg.ItemSlot,{scope:n,id:f,focusable:r,active:i,children:S.jsx(We.span,{tabIndex:p?0:-1,"data-orientation":d.orientation,...s,ref:t,onMouseDown:qe(e.onMouseDown,w=>{r?d.onItemFocus(f):w.preventDefault()}),onFocus:qe(e.onFocus,()=>d.onItemFocus(f)),onKeyDown:qe(e.onKeyDown,w=>{if(w.key==="Tab"&&w.shiftKey){d.onItemShiftTab();return}if(w.target!==w.currentTarget)return;const x=b3(w,d.orientation,d.dir);if(x!==void 0){if(w.metaKey||w.ctrlKey||w.altKey||w.shiftKey)return;w.preventDefault();let C=m().filter(_=>_.focusable).map(_=>_.ref.current);if(x==="last")C.reverse();else if(x==="prev"||x==="next"){x==="prev"&&C.reverse();const _=C.indexOf(w.currentTarget);C=d.loop?x3(C,_+1):C.slice(_+1)}setTimeout(()=>xT(C))}})})})});bT.displayName=yT;var v3={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function y3(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function b3(e,t,n){const r=y3(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return v3[r]}function xT(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function x3(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var w3=vT,S3=bT,cy="Tabs",[E3,hK]=hr(cy,[gT]),wT=gT(),[_3,fy]=E3(cy),ST=E.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:i,defaultValue:o,orientation:s="horizontal",dir:u,activationMode:f="automatic",...d}=e,p=hd(u),[m,v]=_i({prop:r,onChange:i,defaultProp:o});return S.jsx(_3,{scope:n,baseId:bn(),value:m,onValueChange:v,orientation:s,dir:p,activationMode:f,children:S.jsx(We.div,{dir:p,"data-orientation":s,...d,ref:t})})});ST.displayName=cy;var ET="TabsList",_T=E.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...i}=e,o=fy(ET,n),s=wT(n);return S.jsx(w3,{asChild:!0,...s,orientation:o.orientation,dir:o.dir,loop:r,children:S.jsx(We.div,{role:"tablist","aria-orientation":o.orientation,...i,ref:t})})});_T.displayName=ET;var kT="TabsTrigger",CT=E.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:i=!1,...o}=e,s=fy(kT,n),u=wT(n),f=RT(s.baseId,r),d=DT(s.baseId,r),p=r===s.value;return S.jsx(S3,{asChild:!0,...u,focusable:!i,active:p,children:S.jsx(We.button,{type:"button",role:"tab","aria-selected":p,"aria-controls":d,"data-state":p?"active":"inactive","data-disabled":i?"":void 0,disabled:i,id:f,...o,ref:t,onMouseDown:qe(e.onMouseDown,m=>{!i&&m.button===0&&m.ctrlKey===!1?s.onValueChange(r):m.preventDefault()}),onKeyDown:qe(e.onKeyDown,m=>{[" ","Enter"].includes(m.key)&&s.onValueChange(r)}),onFocus:qe(e.onFocus,()=>{const m=s.activationMode!=="manual";!p&&!i&&m&&s.onValueChange(r)})})})});CT.displayName=kT;var TT="TabsContent",AT=E.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:i,children:o,...s}=e,u=fy(TT,n),f=RT(u.baseId,r),d=DT(u.baseId,r),p=r===u.value,m=E.useRef(p);return E.useEffect(()=>{const v=requestAnimationFrame(()=>m.current=!1);return()=>cancelAnimationFrame(v)},[]),S.jsx(Zn,{present:i||p,children:({present:v})=>S.jsx(We.div,{"data-state":p?"active":"inactive","data-orientation":u.orientation,role:"tabpanel","aria-labelledby":f,hidden:!v,id:d,tabIndex:0,...s,ref:t,style:{...e.style,animationDuration:m.current?"0s":void 0},children:v&&o})})});AT.displayName=TT;function RT(e,t){return`${e}-trigger-${t}`}function DT(e,t){return`${e}-content-${t}`}var k3=ST,NT=_T,OT=CT,LT=AT;const C3=k3,zT=E.forwardRef(({className:e,...t},n)=>S.jsx(NT,{ref:n,className:Me("bg-muted text-muted-foreground inline-flex h-10 items-center justify-center rounded-md p-1",e),...t}));zT.displayName=NT.displayName;const jT=E.forwardRef(({className:e,...t},n)=>S.jsx(OT,{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}));jT.displayName=OT.displayName;const Ps=E.forwardRef(({className:e,...t},n)=>S.jsx(LT,{ref:n,className:Me("ring-offset-background focus-visible:ring-ring mt-2 focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-none",e),...t}));Ps.displayName=LT.displayName;function Mc({value:e,currentTab:t,children:n}){return S.jsx(jT,{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 T3(){const e=Qe.use.currentTab();return S.jsx("div",{className:"flex h-8 self-center",children:S.jsxs(zT,{className:"h-full gap-2",children:[S.jsx(Mc,{value:"documents",currentTab:e,children:"Documents"}),S.jsx(Mc,{value:"knowledge-graph",currentTab:e,children:"Knowledge Graph"}),S.jsx(Mc,{value:"retrieval",currentTab:e,children:"Retrieval"}),S.jsx(Mc,{value:"api",currentTab:e,children:"API"})]})})}function A3(){return S.jsxs("header",{className:"border-border/40 bg-background/95 supports-[backdrop-filter]:bg-background/60 sticky top-0 z-50 flex h-10 w-full border-b px-4 backdrop-blur",children:[S.jsxs("a",{href:"/",className:"mr-6 flex items-center gap-2",children:[S.jsx(aP,{className:"size-4 text-emerald-400","aria-hidden":"true"}),S.jsx("span",{className:"font-bold md:inline-block",children:e1.name})]}),S.jsx("div",{className:"flex h-10 flex-1 justify-center",children:S.jsx(T3,{})}),S.jsxs("nav",{className:"flex items-center",children:[S.jsx(Ot,{variant:"ghost",size:"icon",side:"bottom",tooltip:"Project Repository",children:S.jsx("a",{href:e1.github,target:"_blank",rel:"noopener noreferrer",children:S.jsx(DM,{className:"size-4","aria-hidden":"true"})})}),S.jsx(u3,{})]})]})}var Pc={exports:{}},G1;function R3(){if(G1)return Pc.exports;G1=1;var e=typeof Reflect=="object"?Reflect:null,t=e&&typeof e.apply=="function"?e.apply:function(D,z,R){return Function.prototype.apply.call(D,z,R)},n;e&&typeof e.ownKeys=="function"?n=e.ownKeys:Object.getOwnPropertySymbols?n=function(D){return Object.getOwnPropertyNames(D).concat(Object.getOwnPropertySymbols(D))}:n=function(D){return Object.getOwnPropertyNames(D)};function r(N){console&&console.warn&&console.warn(N)}var i=Number.isNaN||function(D){return D!==D};function o(){o.init.call(this)}Pc.exports=o,Pc.exports.once=C,o.EventEmitter=o,o.prototype._events=void 0,o.prototype._eventsCount=0,o.prototype._maxListeners=void 0;var s=10;function u(N){if(typeof N!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof N)}Object.defineProperty(o,"defaultMaxListeners",{enumerable:!0,get:function(){return s},set:function(N){if(typeof N!="number"||N<0||i(N))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+N+".");s=N}}),o.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},o.prototype.setMaxListeners=function(D){if(typeof D!="number"||D<0||i(D))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+D+".");return this._maxListeners=D,this};function f(N){return N._maxListeners===void 0?o.defaultMaxListeners:N._maxListeners}o.prototype.getMaxListeners=function(){return f(this)},o.prototype.emit=function(D){for(var z=[],R=1;R0&&(j=z[0]),j instanceof Error)throw j;var V=new Error("Unhandled error."+(j?" ("+j.message+")":""));throw V.context=j,V}var q=P[D];if(q===void 0)return!1;if(typeof q=="function")t(q,this,z);else for(var I=q.length,Y=w(q,I),R=0;R0&&j.length>B&&!j.warned){j.warned=!0;var V=new Error("Possible EventEmitter memory leak detected. "+j.length+" "+String(D)+" listeners added. Use emitter.setMaxListeners() to increase limit");V.name="MaxListenersExceededWarning",V.emitter=N,V.type=D,V.count=j.length,r(V)}return N}o.prototype.addListener=function(D,z){return d(this,D,z,!1)},o.prototype.on=o.prototype.addListener,o.prototype.prependListener=function(D,z){return d(this,D,z,!0)};function p(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function m(N,D,z){var R={fired:!1,wrapFn:void 0,target:N,type:D,listener:z},B=p.bind(R);return B.listener=z,R.wrapFn=B,B}o.prototype.once=function(D,z){return u(z),this.on(D,m(this,D,z)),this},o.prototype.prependOnceListener=function(D,z){return u(z),this.prependListener(D,m(this,D,z)),this},o.prototype.removeListener=function(D,z){var R,B,P,j,V;if(u(z),B=this._events,B===void 0)return this;if(R=B[D],R===void 0)return this;if(R===z||R.listener===z)--this._eventsCount===0?this._events=Object.create(null):(delete B[D],B.removeListener&&this.emit("removeListener",D,R.listener||z));else if(typeof R!="function"){for(P=-1,j=R.length-1;j>=0;j--)if(R[j]===z||R[j].listener===z){V=R[j].listener,P=j;break}if(P<0)return this;P===0?R.shift():x(R,P),R.length===1&&(B[D]=R[0]),B.removeListener!==void 0&&this.emit("removeListener",D,V||z)}return this},o.prototype.off=o.prototype.removeListener,o.prototype.removeAllListeners=function(D){var z,R,B;if(R=this._events,R===void 0)return this;if(R.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):R[D]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete R[D]),this;if(arguments.length===0){var P=Object.keys(R),j;for(B=0;B=0;B--)this.removeListener(D,z[B]);return this};function v(N,D,z){var R=N._events;if(R===void 0)return[];var B=R[D];return B===void 0?[]:typeof B=="function"?z?[B.listener||B]:[B]:z?k(B):w(B,B.length)}o.prototype.listeners=function(D){return v(this,D,!0)},o.prototype.rawListeners=function(D){return v(this,D,!1)},o.listenerCount=function(N,D){return typeof N.listenerCount=="function"?N.listenerCount(D):g.call(N,D)},o.prototype.listenerCount=g;function g(N){var D=this._events;if(D!==void 0){var z=D[N];if(typeof z=="function")return 1;if(z!==void 0)return z.length}return 0}o.prototype.eventNames=function(){return this._eventsCount>0?n(this._events):[]};function w(N,D){for(var z=new Array(D),R=0;Re++}function Ei(){const e=arguments;let t=null,n=-1;return{[Symbol.iterator](){return this},next(){let r=null;do{if(t===null){if(n++,n>=e.length)return{done:!0};t=e[n][Symbol.iterator]()}if(r=t.next(),r.done){t=null;continue}break}while(!0);return r}}}function Sl(){return{[Symbol.iterator](){return this},next(){return{done:!0}}}}class dy extends Error{constructor(t){super(),this.name="GraphError",this.message=t}}class Le extends dy{constructor(t){super(t),this.name="InvalidArgumentsGraphError",typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,Le.prototype.constructor)}}class De extends dy{constructor(t){super(t),this.name="NotFoundGraphError",typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,De.prototype.constructor)}}class Xe extends dy{constructor(t){super(t),this.name="UsageGraphError",typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,Xe.prototype.constructor)}}function FT(e,t){this.key=e,this.attributes=t,this.clear()}FT.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 IT(e,t){this.key=e,this.attributes=t,this.clear()}IT.prototype.clear=function(){this.inDegree=0,this.outDegree=0,this.directedLoops=0,this.in={},this.out={}};function GT(e,t){this.key=e,this.attributes=t,this.clear()}GT.prototype.clear=function(){this.undirectedDegree=0,this.undirectedLoops=0,this.undirected={}};function El(e,t,n,r,i){this.key=t,this.attributes=i,this.undirected=e,this.source=n,this.target=r}El.prototype.attach=function(){let e="out",t="in";this.undirected&&(e=t="undirected");const n=this.source.key,r=this.target.key;this.source[e][r]=this,!(this.undirected&&n===r)&&(this.target[t][n]=this)};El.prototype.attachMulti=function(){let e="out",t="in";const n=this.source.key,r=this.target.key;this.undirected&&(e=t="undirected");const i=this.source[e],o=i[r];if(typeof o>"u"){i[r]=this,this.undirected&&n===r||(this.target[t][n]=this);return}o.previous=this,this.next=o,i[r]=this,this.target[t][n]=this};El.prototype.detach=function(){const e=this.source.key,t=this.target.key;let n="out",r="in";this.undirected&&(n=r="undirected"),delete this.source[n][t],delete this.target[r][e]};El.prototype.detachMulti=function(){const e=this.source.key,t=this.target.key;let n="out",r="in";this.undirected&&(n=r="undirected"),this.previous===void 0?this.next===void 0?(delete this.source[n][t],delete this.target[r][e]):(this.next.previous=void 0,this.source[n][t]=this.next,this.target[r][e]=this.next):(this.previous.next=this.next,this.next!==void 0&&(this.next.previous=this.previous))};const BT=0,UT=1,O3=2,HT=3;function Ai(e,t,n,r,i,o,s){let u,f,d,p;if(r=""+r,n===BT){if(u=e._nodes.get(r),!u)throw new De(`Graph.${t}: could not find the "${r}" node in the graph.`);d=i,p=o}else if(n===HT){if(i=""+i,f=e._edges.get(i),!f)throw new De(`Graph.${t}: could not find the "${i}" edge in the graph.`);const m=f.source.key,v=f.target.key;if(r===m)u=f.target;else if(r===v)u=f.source;else throw new De(`Graph.${t}: the "${r}" node is not attached to the "${i}" edge (${m}, ${v}).`);d=o,p=s}else{if(f=e._edges.get(r),!f)throw new De(`Graph.${t}: could not find the "${r}" edge in the graph.`);n===UT?u=f.source:u=f.target,d=i,p=o}return[u,d,p]}function L3(e,t,n){e.prototype[t]=function(r,i,o){const[s,u]=Ai(this,t,n,r,i,o);return s.attributes[u]}}function z3(e,t,n){e.prototype[t]=function(r,i){const[o]=Ai(this,t,n,r,i);return o.attributes}}function j3(e,t,n){e.prototype[t]=function(r,i,o){const[s,u]=Ai(this,t,n,r,i,o);return s.attributes.hasOwnProperty(u)}}function M3(e,t,n){e.prototype[t]=function(r,i,o,s){const[u,f,d]=Ai(this,t,n,r,i,o,s);return u.attributes[f]=d,this.emit("nodeAttributesUpdated",{key:u.key,type:"set",attributes:u.attributes,name:f}),this}}function P3(e,t,n){e.prototype[t]=function(r,i,o,s){const[u,f,d]=Ai(this,t,n,r,i,o,s);if(typeof d!="function")throw new Le(`Graph.${t}: updater should be a function.`);const p=u.attributes,m=d(p[f]);return p[f]=m,this.emit("nodeAttributesUpdated",{key:u.key,type:"set",attributes:u.attributes,name:f}),this}}function F3(e,t,n){e.prototype[t]=function(r,i,o){const[s,u]=Ai(this,t,n,r,i,o);return delete s.attributes[u],this.emit("nodeAttributesUpdated",{key:s.key,type:"remove",attributes:s.attributes,name:u}),this}}function I3(e,t,n){e.prototype[t]=function(r,i,o){const[s,u]=Ai(this,t,n,r,i,o);if(!cn(u))throw new Le(`Graph.${t}: provided attributes are not a plain object.`);return s.attributes=u,this.emit("nodeAttributesUpdated",{key:s.key,type:"replace",attributes:s.attributes}),this}}function G3(e,t,n){e.prototype[t]=function(r,i,o){const[s,u]=Ai(this,t,n,r,i,o);if(!cn(u))throw new Le(`Graph.${t}: provided attributes are not a plain object.`);return Xt(s.attributes,u),this.emit("nodeAttributesUpdated",{key:s.key,type:"merge",attributes:s.attributes,data:u}),this}}function B3(e,t,n){e.prototype[t]=function(r,i,o){const[s,u]=Ai(this,t,n,r,i,o);if(typeof u!="function")throw new Le(`Graph.${t}: provided updater is not a function.`);return s.attributes=u(s.attributes),this.emit("nodeAttributesUpdated",{key:s.key,type:"update",attributes:s.attributes}),this}}const U3=[{name:e=>`get${e}Attribute`,attacher:L3},{name:e=>`get${e}Attributes`,attacher:z3},{name:e=>`has${e}Attribute`,attacher:j3},{name:e=>`set${e}Attribute`,attacher:M3},{name:e=>`update${e}Attribute`,attacher:P3},{name:e=>`remove${e}Attribute`,attacher:F3},{name:e=>`replace${e}Attributes`,attacher:I3},{name:e=>`merge${e}Attributes`,attacher:G3},{name:e=>`update${e}Attributes`,attacher:B3}];function H3(e){U3.forEach(function({name:t,attacher:n}){n(e,t("Node"),BT),n(e,t("Source"),UT),n(e,t("Target"),O3),n(e,t("Opposite"),HT)})}function $3(e,t,n){e.prototype[t]=function(r,i){let o;if(this.type!=="mixed"&&n!=="mixed"&&n!==this.type)throw new Xe(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new Xe(`Graph.${t}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const s=""+r,u=""+i;if(i=arguments[2],o=dr(this,s,u,n),!o)throw new De(`Graph.${t}: could not find an edge for the given path ("${s}" - "${u}").`)}else{if(n!=="mixed")throw new Xe(`Graph.${t}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(r=""+r,o=this._edges.get(r),!o)throw new De(`Graph.${t}: could not find the "${r}" edge in the graph.`)}return o.attributes[i]}}function V3(e,t,n){e.prototype[t]=function(r){let i;if(this.type!=="mixed"&&n!=="mixed"&&n!==this.type)throw new Xe(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>1){if(this.multi)throw new Xe(`Graph.${t}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const o=""+r,s=""+arguments[1];if(i=dr(this,o,s,n),!i)throw new De(`Graph.${t}: could not find an edge for the given path ("${o}" - "${s}").`)}else{if(n!=="mixed")throw new Xe(`Graph.${t}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(r=""+r,i=this._edges.get(r),!i)throw new De(`Graph.${t}: could not find the "${r}" edge in the graph.`)}return i.attributes}}function q3(e,t,n){e.prototype[t]=function(r,i){let o;if(this.type!=="mixed"&&n!=="mixed"&&n!==this.type)throw new Xe(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new Xe(`Graph.${t}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const s=""+r,u=""+i;if(i=arguments[2],o=dr(this,s,u,n),!o)throw new De(`Graph.${t}: could not find an edge for the given path ("${s}" - "${u}").`)}else{if(n!=="mixed")throw new Xe(`Graph.${t}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(r=""+r,o=this._edges.get(r),!o)throw new De(`Graph.${t}: could not find the "${r}" edge in the graph.`)}return o.attributes.hasOwnProperty(i)}}function Y3(e,t,n){e.prototype[t]=function(r,i,o){let s;if(this.type!=="mixed"&&n!=="mixed"&&n!==this.type)throw new Xe(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>3){if(this.multi)throw new Xe(`Graph.${t}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const u=""+r,f=""+i;if(i=arguments[2],o=arguments[3],s=dr(this,u,f,n),!s)throw new De(`Graph.${t}: could not find an edge for the given path ("${u}" - "${f}").`)}else{if(n!=="mixed")throw new Xe(`Graph.${t}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(r=""+r,s=this._edges.get(r),!s)throw new De(`Graph.${t}: could not find the "${r}" edge in the graph.`)}return s.attributes[i]=o,this.emit("edgeAttributesUpdated",{key:s.key,type:"set",attributes:s.attributes,name:i}),this}}function W3(e,t,n){e.prototype[t]=function(r,i,o){let s;if(this.type!=="mixed"&&n!=="mixed"&&n!==this.type)throw new Xe(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>3){if(this.multi)throw new Xe(`Graph.${t}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const u=""+r,f=""+i;if(i=arguments[2],o=arguments[3],s=dr(this,u,f,n),!s)throw new De(`Graph.${t}: could not find an edge for the given path ("${u}" - "${f}").`)}else{if(n!=="mixed")throw new Xe(`Graph.${t}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(r=""+r,s=this._edges.get(r),!s)throw new De(`Graph.${t}: could not find the "${r}" edge in the graph.`)}if(typeof o!="function")throw new Le(`Graph.${t}: updater should be a function.`);return s.attributes[i]=o(s.attributes[i]),this.emit("edgeAttributesUpdated",{key:s.key,type:"set",attributes:s.attributes,name:i}),this}}function X3(e,t,n){e.prototype[t]=function(r,i){let o;if(this.type!=="mixed"&&n!=="mixed"&&n!==this.type)throw new Xe(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new Xe(`Graph.${t}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const s=""+r,u=""+i;if(i=arguments[2],o=dr(this,s,u,n),!o)throw new De(`Graph.${t}: could not find an edge for the given path ("${s}" - "${u}").`)}else{if(n!=="mixed")throw new Xe(`Graph.${t}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(r=""+r,o=this._edges.get(r),!o)throw new De(`Graph.${t}: could not find the "${r}" edge in the graph.`)}return delete o.attributes[i],this.emit("edgeAttributesUpdated",{key:o.key,type:"remove",attributes:o.attributes,name:i}),this}}function K3(e,t,n){e.prototype[t]=function(r,i){let o;if(this.type!=="mixed"&&n!=="mixed"&&n!==this.type)throw new Xe(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new Xe(`Graph.${t}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const s=""+r,u=""+i;if(i=arguments[2],o=dr(this,s,u,n),!o)throw new De(`Graph.${t}: could not find an edge for the given path ("${s}" - "${u}").`)}else{if(n!=="mixed")throw new Xe(`Graph.${t}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(r=""+r,o=this._edges.get(r),!o)throw new De(`Graph.${t}: could not find the "${r}" edge in the graph.`)}if(!cn(i))throw new Le(`Graph.${t}: provided attributes are not a plain object.`);return o.attributes=i,this.emit("edgeAttributesUpdated",{key:o.key,type:"replace",attributes:o.attributes}),this}}function Z3(e,t,n){e.prototype[t]=function(r,i){let o;if(this.type!=="mixed"&&n!=="mixed"&&n!==this.type)throw new Xe(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new Xe(`Graph.${t}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const s=""+r,u=""+i;if(i=arguments[2],o=dr(this,s,u,n),!o)throw new De(`Graph.${t}: could not find an edge for the given path ("${s}" - "${u}").`)}else{if(n!=="mixed")throw new Xe(`Graph.${t}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(r=""+r,o=this._edges.get(r),!o)throw new De(`Graph.${t}: could not find the "${r}" edge in the graph.`)}if(!cn(i))throw new Le(`Graph.${t}: provided attributes are not a plain object.`);return Xt(o.attributes,i),this.emit("edgeAttributesUpdated",{key:o.key,type:"merge",attributes:o.attributes,data:i}),this}}function Q3(e,t,n){e.prototype[t]=function(r,i){let o;if(this.type!=="mixed"&&n!=="mixed"&&n!==this.type)throw new Xe(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new Xe(`Graph.${t}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const s=""+r,u=""+i;if(i=arguments[2],o=dr(this,s,u,n),!o)throw new De(`Graph.${t}: could not find an edge for the given path ("${s}" - "${u}").`)}else{if(n!=="mixed")throw new Xe(`Graph.${t}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(r=""+r,o=this._edges.get(r),!o)throw new De(`Graph.${t}: could not find the "${r}" edge in the graph.`)}if(typeof i!="function")throw new Le(`Graph.${t}: provided updater is not a function.`);return o.attributes=i(o.attributes),this.emit("edgeAttributesUpdated",{key:o.key,type:"update",attributes:o.attributes}),this}}const J3=[{name:e=>`get${e}Attribute`,attacher:$3},{name:e=>`get${e}Attributes`,attacher:V3},{name:e=>`has${e}Attribute`,attacher:q3},{name:e=>`set${e}Attribute`,attacher:Y3},{name:e=>`update${e}Attribute`,attacher:W3},{name:e=>`remove${e}Attribute`,attacher:X3},{name:e=>`replace${e}Attributes`,attacher:K3},{name:e=>`merge${e}Attributes`,attacher:Z3},{name:e=>`update${e}Attributes`,attacher:Q3}];function e5(e){J3.forEach(function({name:t,attacher:n}){n(e,t("Edge"),"mixed"),n(e,t("DirectedEdge"),"directed"),n(e,t("UndirectedEdge"),"undirected")})}const t5=[{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 n5(e,t,n,r){let i=!1;for(const o in t){if(o===r)continue;const s=t[o];if(i=n(s.key,s.attributes,s.source.key,s.target.key,s.source.attributes,s.target.attributes,s.undirected),e&&i)return s.key}}function r5(e,t,n,r){let i,o,s,u=!1;for(const f in t)if(f!==r){i=t[f];do{if(o=i.source,s=i.target,u=n(i.key,i.attributes,o.key,s.key,o.attributes,s.attributes,i.undirected),e&&u)return i.key;i=i.next}while(i!==void 0)}}function am(e,t){const n=Object.keys(e),r=n.length;let i,o=0;return{[Symbol.iterator](){return this},next(){do if(i)i=i.next;else{if(o>=r)return{done:!0};const s=n[o++];if(s===t){i=void 0;continue}i=e[s]}while(!i);return{done:!1,value:{edge:i.key,attributes:i.attributes,source:i.source.key,target:i.target.key,sourceAttributes:i.source.attributes,targetAttributes:i.target.attributes,undirected:i.undirected}}}}}function i5(e,t,n,r){const i=t[n];if(!i)return;const o=i.source,s=i.target;if(r(i.key,i.attributes,o.key,s.key,o.attributes,s.attributes,i.undirected)&&e)return i.key}function a5(e,t,n,r){let i=t[n];if(!i)return;let o=!1;do{if(o=r(i.key,i.attributes,i.source.key,i.target.key,i.source.attributes,i.target.attributes,i.undirected),e&&o)return i.key;i=i.next}while(i!==void 0)}function om(e,t){let n=e[t];if(n.next!==void 0)return{[Symbol.iterator](){return this},next(){if(!n)return{done:!0};const i={edge:n.key,attributes:n.attributes,source:n.source.key,target:n.target.key,sourceAttributes:n.source.attributes,targetAttributes:n.target.attributes,undirected:n.undirected};return n=n.next,{done:!1,value:i}}};let r=!1;return{[Symbol.iterator](){return this},next(){return r===!0?{done:!0}:(r=!0,{done:!1,value:{edge:n.key,attributes:n.attributes,source:n.source.key,target:n.target.key,sourceAttributes:n.source.attributes,targetAttributes:n.target.attributes,undirected:n.undirected}})}}}function o5(e,t){if(e.size===0)return[];if(t==="mixed"||t===e.type)return Array.from(e._edges.keys());const n=t==="undirected"?e.undirectedSize:e.directedSize,r=new Array(n),i=t==="undirected",o=e._edges.values();let s=0,u,f;for(;u=o.next(),u.done!==!0;)f=u.value,f.undirected===i&&(r[s++]=f.key);return r}function $T(e,t,n,r){if(t.size===0)return;const i=n!=="mixed"&&n!==t.type,o=n==="undirected";let s,u,f=!1;const d=t._edges.values();for(;s=d.next(),s.done!==!0;){if(u=s.value,i&&u.undirected!==o)continue;const{key:p,attributes:m,source:v,target:g}=u;if(f=r(p,m,v.key,g.key,v.attributes,g.attributes,u.undirected),e&&f)return p}}function l5(e,t){if(e.size===0)return Sl();const n=t!=="mixed"&&t!==e.type,r=t==="undirected",i=e._edges.values();return{[Symbol.iterator](){return this},next(){let o,s;for(;;){if(o=i.next(),o.done)return o;if(s=o.value,!(n&&s.undirected!==r))break}return{value:{edge:s.key,attributes:s.attributes,source:s.source.key,target:s.target.key,sourceAttributes:s.source.attributes,targetAttributes:s.target.attributes,undirected:s.undirected},done:!1}}}}function hy(e,t,n,r,i,o){const s=t?r5:n5;let u;if(n!=="undirected"&&(r!=="out"&&(u=s(e,i.in,o),e&&u)||r!=="in"&&(u=s(e,i.out,o,r?void 0:i.key),e&&u))||n!=="directed"&&(u=s(e,i.undirected,o),e&&u))return u}function s5(e,t,n,r){const i=[];return hy(!1,e,t,n,r,function(o){i.push(o)}),i}function u5(e,t,n){let r=Sl();return e!=="undirected"&&(t!=="out"&&typeof n.in<"u"&&(r=Ei(r,am(n.in))),t!=="in"&&typeof n.out<"u"&&(r=Ei(r,am(n.out,t?void 0:n.key)))),e!=="directed"&&typeof n.undirected<"u"&&(r=Ei(r,am(n.undirected))),r}function py(e,t,n,r,i,o,s){const u=n?a5:i5;let f;if(t!=="undirected"&&(typeof i.in<"u"&&r!=="out"&&(f=u(e,i.in,o,s),e&&f)||typeof i.out<"u"&&r!=="in"&&(r||i.key!==o)&&(f=u(e,i.out,o,s),e&&f))||t!=="directed"&&typeof i.undirected<"u"&&(f=u(e,i.undirected,o,s),e&&f))return f}function c5(e,t,n,r,i){const o=[];return py(!1,e,t,n,r,i,function(s){o.push(s)}),o}function f5(e,t,n,r){let i=Sl();return e!=="undirected"&&(typeof n.in<"u"&&t!=="out"&&r in n.in&&(i=Ei(i,om(n.in,r))),typeof n.out<"u"&&t!=="in"&&r in n.out&&(t||n.key!==r)&&(i=Ei(i,om(n.out,r)))),e!=="directed"&&typeof n.undirected<"u"&&r in n.undirected&&(i=Ei(i,om(n.undirected,r))),i}function d5(e,t){const{name:n,type:r,direction:i}=t;e.prototype[n]=function(o,s){if(r!=="mixed"&&this.type!=="mixed"&&r!==this.type)return[];if(!arguments.length)return o5(this,r);if(arguments.length===1){o=""+o;const u=this._nodes.get(o);if(typeof u>"u")throw new De(`Graph.${n}: could not find the "${o}" node in the graph.`);return s5(this.multi,r==="mixed"?this.type:r,i,u)}if(arguments.length===2){o=""+o,s=""+s;const u=this._nodes.get(o);if(!u)throw new De(`Graph.${n}: could not find the "${o}" source node in the graph.`);if(!this._nodes.has(s))throw new De(`Graph.${n}: could not find the "${s}" target node in the graph.`);return c5(r,this.multi,i,u,s)}throw new Le(`Graph.${n}: too many arguments (expecting 0, 1 or 2 and got ${arguments.length}).`)}}function h5(e,t){const{name:n,type:r,direction:i}=t,o="forEach"+n[0].toUpperCase()+n.slice(1,-1);e.prototype[o]=function(d,p,m){if(!(r!=="mixed"&&this.type!=="mixed"&&r!==this.type)){if(arguments.length===1)return m=d,$T(!1,this,r,m);if(arguments.length===2){d=""+d,m=p;const v=this._nodes.get(d);if(typeof v>"u")throw new De(`Graph.${o}: could not find the "${d}" node in the graph.`);return hy(!1,this.multi,r==="mixed"?this.type:r,i,v,m)}if(arguments.length===3){d=""+d,p=""+p;const v=this._nodes.get(d);if(!v)throw new De(`Graph.${o}: could not find the "${d}" source node in the graph.`);if(!this._nodes.has(p))throw new De(`Graph.${o}: could not find the "${p}" target node in the graph.`);return py(!1,r,this.multi,i,v,p,m)}throw new Le(`Graph.${o}: too many arguments (expecting 1, 2 or 3 and got ${arguments.length}).`)}};const s="map"+n[0].toUpperCase()+n.slice(1);e.prototype[s]=function(){const d=Array.prototype.slice.call(arguments),p=d.pop();let m;if(d.length===0){let v=0;r!=="directed"&&(v+=this.undirectedSize),r!=="undirected"&&(v+=this.directedSize),m=new Array(v);let g=0;d.push((w,x,k,C,_,T,N)=>{m[g++]=p(w,x,k,C,_,T,N)})}else m=[],d.push((v,g,w,x,k,C,_)=>{m.push(p(v,g,w,x,k,C,_))});return this[o].apply(this,d),m};const u="filter"+n[0].toUpperCase()+n.slice(1);e.prototype[u]=function(){const d=Array.prototype.slice.call(arguments),p=d.pop(),m=[];return d.push((v,g,w,x,k,C,_)=>{p(v,g,w,x,k,C,_)&&m.push(v)}),this[o].apply(this,d),m};const f="reduce"+n[0].toUpperCase()+n.slice(1);e.prototype[f]=function(){let d=Array.prototype.slice.call(arguments);if(d.length<2||d.length>4)throw new Le(`Graph.${f}: invalid number of arguments (expecting 2, 3 or 4 and got ${d.length}).`);if(typeof d[d.length-1]=="function"&&typeof d[d.length-2]!="function")throw new Le(`Graph.${f}: missing initial value. You must provide it because the callback takes more than one argument and we cannot infer the initial value from the first iteration, as you could with a simple array.`);let p,m;d.length===2?(p=d[0],m=d[1],d=[]):d.length===3?(p=d[1],m=d[2],d=[d[0]]):d.length===4&&(p=d[2],m=d[3],d=[d[0],d[1]]);let v=m;return d.push((g,w,x,k,C,_,T)=>{v=p(v,g,w,x,k,C,_,T)}),this[o].apply(this,d),v}}function p5(e,t){const{name:n,type:r,direction:i}=t,o="find"+n[0].toUpperCase()+n.slice(1,-1);e.prototype[o]=function(f,d,p){if(r!=="mixed"&&this.type!=="mixed"&&r!==this.type)return!1;if(arguments.length===1)return p=f,$T(!0,this,r,p);if(arguments.length===2){f=""+f,p=d;const m=this._nodes.get(f);if(typeof m>"u")throw new De(`Graph.${o}: could not find the "${f}" node in the graph.`);return hy(!0,this.multi,r==="mixed"?this.type:r,i,m,p)}if(arguments.length===3){f=""+f,d=""+d;const m=this._nodes.get(f);if(!m)throw new De(`Graph.${o}: could not find the "${f}" source node in the graph.`);if(!this._nodes.has(d))throw new De(`Graph.${o}: could not find the "${d}" target node in the graph.`);return py(!0,r,this.multi,i,m,d,p)}throw new Le(`Graph.${o}: too many arguments (expecting 1, 2 or 3 and got ${arguments.length}).`)};const s="some"+n[0].toUpperCase()+n.slice(1,-1);e.prototype[s]=function(){const f=Array.prototype.slice.call(arguments),d=f.pop();return f.push((m,v,g,w,x,k,C)=>d(m,v,g,w,x,k,C)),!!this[o].apply(this,f)};const u="every"+n[0].toUpperCase()+n.slice(1,-1);e.prototype[u]=function(){const f=Array.prototype.slice.call(arguments),d=f.pop();return f.push((m,v,g,w,x,k,C)=>!d(m,v,g,w,x,k,C)),!this[o].apply(this,f)}}function m5(e,t){const{name:n,type:r,direction:i}=t,o=n.slice(0,-1)+"Entries";e.prototype[o]=function(s,u){if(r!=="mixed"&&this.type!=="mixed"&&r!==this.type)return Sl();if(!arguments.length)return l5(this,r);if(arguments.length===1){s=""+s;const f=this._nodes.get(s);if(!f)throw new De(`Graph.${o}: could not find the "${s}" node in the graph.`);return u5(r,i,f)}if(arguments.length===2){s=""+s,u=""+u;const f=this._nodes.get(s);if(!f)throw new De(`Graph.${o}: could not find the "${s}" source node in the graph.`);if(!this._nodes.has(u))throw new De(`Graph.${o}: could not find the "${u}" target node in the graph.`);return f5(r,i,f,u)}throw new Le(`Graph.${o}: too many arguments (expecting 0, 1 or 2 and got ${arguments.length}).`)}}function g5(e){t5.forEach(t=>{d5(e,t),h5(e,t),p5(e,t),m5(e,t)})}const v5=[{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 md(){this.A=null,this.B=null}md.prototype.wrap=function(e){this.A===null?this.A=e:this.B===null&&(this.B=e)};md.prototype.has=function(e){return this.A!==null&&e in this.A||this.B!==null&&e in this.B};function Ts(e,t,n,r,i){for(const o in r){const s=r[o],u=s.source,f=s.target,d=u===n?f:u;if(t&&t.has(d.key))continue;const p=i(d.key,d.attributes);if(e&&p)return d.key}}function my(e,t,n,r,i){if(t!=="mixed"){if(t==="undirected")return Ts(e,null,r,r.undirected,i);if(typeof n=="string")return Ts(e,null,r,r[n],i)}const o=new md;let s;if(t!=="undirected"){if(n!=="out"){if(s=Ts(e,null,r,r.in,i),e&&s)return s;o.wrap(r.in)}if(n!=="in"){if(s=Ts(e,o,r,r.out,i),e&&s)return s;o.wrap(r.out)}}if(t!=="directed"&&(s=Ts(e,o,r,r.undirected,i),e&&s))return s}function y5(e,t,n){if(e!=="mixed"){if(e==="undirected")return Object.keys(n.undirected);if(typeof t=="string")return Object.keys(n[t])}const r=[];return my(!1,e,t,n,function(i){r.push(i)}),r}function As(e,t,n){const r=Object.keys(n),i=r.length;let o=0;return{[Symbol.iterator](){return this},next(){let s=null;do{if(o>=i)return e&&e.wrap(n),{done:!0};const u=n[r[o++]],f=u.source,d=u.target;if(s=f===t?d:f,e&&e.has(s.key)){s=null;continue}}while(s===null);return{done:!1,value:{neighbor:s.key,attributes:s.attributes}}}}}function b5(e,t,n){if(e!=="mixed"){if(e==="undirected")return As(null,n,n.undirected);if(typeof t=="string")return As(null,n,n[t])}let r=Sl();const i=new md;return e!=="undirected"&&(t!=="out"&&(r=Ei(r,As(i,n,n.in))),t!=="in"&&(r=Ei(r,As(i,n,n.out)))),e!=="directed"&&(r=Ei(r,As(i,n,n.undirected))),r}function x5(e,t){const{name:n,type:r,direction:i}=t;e.prototype[n]=function(o){if(r!=="mixed"&&this.type!=="mixed"&&r!==this.type)return[];o=""+o;const s=this._nodes.get(o);if(typeof s>"u")throw new De(`Graph.${n}: could not find the "${o}" node in the graph.`);return y5(r==="mixed"?this.type:r,i,s)}}function w5(e,t){const{name:n,type:r,direction:i}=t,o="forEach"+n[0].toUpperCase()+n.slice(1,-1);e.prototype[o]=function(d,p){if(r!=="mixed"&&this.type!=="mixed"&&r!==this.type)return;d=""+d;const m=this._nodes.get(d);if(typeof m>"u")throw new De(`Graph.${o}: could not find the "${d}" node in the graph.`);my(!1,r==="mixed"?this.type:r,i,m,p)};const s="map"+n[0].toUpperCase()+n.slice(1);e.prototype[s]=function(d,p){const m=[];return this[o](d,(v,g)=>{m.push(p(v,g))}),m};const u="filter"+n[0].toUpperCase()+n.slice(1);e.prototype[u]=function(d,p){const m=[];return this[o](d,(v,g)=>{p(v,g)&&m.push(v)}),m};const f="reduce"+n[0].toUpperCase()+n.slice(1);e.prototype[f]=function(d,p,m){if(arguments.length<3)throw new Le(`Graph.${f}: missing initial value. You must provide it because the callback takes more than one argument and we cannot infer the initial value from the first iteration, as you could with a simple array.`);let v=m;return this[o](d,(g,w)=>{v=p(v,g,w)}),v}}function S5(e,t){const{name:n,type:r,direction:i}=t,o=n[0].toUpperCase()+n.slice(1,-1),s="find"+o;e.prototype[s]=function(d,p){if(r!=="mixed"&&this.type!=="mixed"&&r!==this.type)return;d=""+d;const m=this._nodes.get(d);if(typeof m>"u")throw new De(`Graph.${s}: could not find the "${d}" node in the graph.`);return my(!0,r==="mixed"?this.type:r,i,m,p)};const u="some"+o;e.prototype[u]=function(d,p){return!!this[s](d,p)};const f="every"+o;e.prototype[f]=function(d,p){return!this[s](d,(v,g)=>!p(v,g))}}function E5(e,t){const{name:n,type:r,direction:i}=t,o=n.slice(0,-1)+"Entries";e.prototype[o]=function(s){if(r!=="mixed"&&this.type!=="mixed"&&r!==this.type)return Sl();s=""+s;const u=this._nodes.get(s);if(typeof u>"u")throw new De(`Graph.${o}: could not find the "${s}" node in the graph.`);return b5(r==="mixed"?this.type:r,i,u)}}function _5(e){v5.forEach(t=>{x5(e,t),w5(e,t),S5(e,t),E5(e,t)})}function Fc(e,t,n,r,i){const o=r._nodes.values(),s=r.type;let u,f,d,p,m,v;for(;u=o.next(),u.done!==!0;){let g=!1;if(f=u.value,s!=="undirected"){p=f.out;for(d in p){m=p[d];do v=m.target,g=!0,i(f.key,v.key,f.attributes,v.attributes,m.key,m.attributes,m.undirected),m=m.next;while(m)}}if(s!=="directed"){p=f.undirected;for(d in p)if(!(t&&f.key>d)){m=p[d];do v=m.target,v.key!==d&&(v=m.source),g=!0,i(f.key,v.key,f.attributes,v.attributes,m.key,m.attributes,m.undirected),m=m.next;while(m)}}n&&!g&&i(f.key,null,f.attributes,null,null,null,null)}}function k5(e,t){const n={key:e};return PT(t.attributes)||(n.attributes=Xt({},t.attributes)),n}function C5(e,t,n){const r={key:t,source:n.source.key,target:n.target.key};return PT(n.attributes)||(r.attributes=Xt({},n.attributes)),e==="mixed"&&n.undirected&&(r.undirected=!0),r}function T5(e){if(!cn(e))throw new Le('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 Le("Graph.import: serialized node is missing its key.");if("attributes"in e&&(!cn(e.attributes)||e.attributes===null))throw new Le("Graph.import: invalid attributes. Attributes should be a plain object, null or omitted.")}function A5(e){if(!cn(e))throw new Le('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 Le("Graph.import: serialized edge is missing its source.");if(!("target"in e))throw new Le("Graph.import: serialized edge is missing its target.");if("attributes"in e&&(!cn(e.attributes)||e.attributes===null))throw new Le("Graph.import: invalid attributes. Attributes should be a plain object, null or omitted.");if("undirected"in e&&typeof e.undirected!="boolean")throw new Le("Graph.import: invalid undirectedness information. Undirected should be boolean or omitted.")}const R5=N3(),D5=new Set(["directed","undirected","mixed"]),U1=new Set(["domain","_events","_eventsCount","_maxListeners"]),N5=[{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"}],O5={allowSelfLoops:!0,multi:!1,type:"mixed"};function L5(e,t,n){if(n&&!cn(n))throw new Le(`Graph.addNode: invalid attributes. Expecting an object but got "${n}"`);if(t=""+t,n=n||{},e._nodes.has(t))throw new Xe(`Graph.addNode: the "${t}" node already exist in the graph.`);const r=new e.NodeDataClass(t,n);return e._nodes.set(t,r),e.emit("nodeAdded",{key:t,attributes:n}),r}function H1(e,t,n){const r=new e.NodeDataClass(t,n);return e._nodes.set(t,r),e.emit("nodeAdded",{key:t,attributes:n}),r}function VT(e,t,n,r,i,o,s,u){if(!r&&e.type==="undirected")throw new Xe(`Graph.${t}: you cannot add a directed edge to an undirected graph. Use the #.addEdge or #.addUndirectedEdge instead.`);if(r&&e.type==="directed")throw new Xe(`Graph.${t}: you cannot add an undirected edge to a directed graph. Use the #.addEdge or #.addDirectedEdge instead.`);if(u&&!cn(u))throw new Le(`Graph.${t}: invalid attributes. Expecting an object but got "${u}"`);if(o=""+o,s=""+s,u=u||{},!e.allowSelfLoops&&o===s)throw new Xe(`Graph.${t}: source & target are the same ("${o}"), thus creating a loop explicitly forbidden by this graph 'allowSelfLoops' option set to false.`);const f=e._nodes.get(o),d=e._nodes.get(s);if(!f)throw new De(`Graph.${t}: source node "${o}" not found.`);if(!d)throw new De(`Graph.${t}: target node "${s}" not found.`);const p={key:null,undirected:r,source:o,target:s,attributes:u};if(n)i=e._edgeKeyGenerator();else if(i=""+i,e._edges.has(i))throw new Xe(`Graph.${t}: the "${i}" edge already exists in the graph.`);if(!e.multi&&(r?typeof f.undirected[s]<"u":typeof f.out[s]<"u"))throw new Xe(`Graph.${t}: an edge linking "${o}" to "${s}" already exists. If you really want to add multiple edges linking those nodes, you should create a multi graph by using the 'multi' option.`);const m=new El(r,i,f,d,u);e._edges.set(i,m);const v=o===s;return r?(f.undirectedDegree++,d.undirectedDegree++,v&&(f.undirectedLoops++,e._undirectedSelfLoopCount++)):(f.outDegree++,d.inDegree++,v&&(f.directedLoops++,e._directedSelfLoopCount++)),e.multi?m.attachMulti():m.attach(),r?e._undirectedSize++:e._directedSize++,p.key=i,e.emit("edgeAdded",p),i}function z5(e,t,n,r,i,o,s,u,f){if(!r&&e.type==="undirected")throw new Xe(`Graph.${t}: you cannot merge/update a directed edge to an undirected graph. Use the #.mergeEdge/#.updateEdge or #.addUndirectedEdge instead.`);if(r&&e.type==="directed")throw new Xe(`Graph.${t}: you cannot merge/update an undirected edge to a directed graph. Use the #.mergeEdge/#.updateEdge or #.addDirectedEdge instead.`);if(u){if(f){if(typeof u!="function")throw new Le(`Graph.${t}: invalid updater function. Expecting a function but got "${u}"`)}else if(!cn(u))throw new Le(`Graph.${t}: invalid attributes. Expecting an object but got "${u}"`)}o=""+o,s=""+s;let d;if(f&&(d=u,u=void 0),!e.allowSelfLoops&&o===s)throw new Xe(`Graph.${t}: source & target are the same ("${o}"), thus creating a loop explicitly forbidden by this graph 'allowSelfLoops' option set to false.`);let p=e._nodes.get(o),m=e._nodes.get(s),v,g;if(!n&&(v=e._edges.get(i),v)){if((v.source.key!==o||v.target.key!==s)&&(!r||v.source.key!==s||v.target.key!==o))throw new Xe(`Graph.${t}: inconsistency detected when attempting to merge the "${i}" edge with "${o}" source & "${s}" target vs. ("${v.source.key}", "${v.target.key}").`);g=v}if(!g&&!e.multi&&p&&(g=r?p.undirected[s]:p.out[s]),g){const _=[g.key,!1,!1,!1];if(f?!d:!u)return _;if(f){const T=g.attributes;g.attributes=d(T),e.emit("edgeAttributesUpdated",{type:"replace",key:g.key,attributes:g.attributes})}else Xt(g.attributes,u),e.emit("edgeAttributesUpdated",{type:"merge",key:g.key,attributes:g.attributes,data:u});return _}u=u||{},f&&d&&(u=d(u));const w={key:null,undirected:r,source:o,target:s,attributes:u};if(n)i=e._edgeKeyGenerator();else if(i=""+i,e._edges.has(i))throw new Xe(`Graph.${t}: the "${i}" edge already exists in the graph.`);let x=!1,k=!1;p||(p=H1(e,o,{}),x=!0,o===s&&(m=p,k=!0)),m||(m=H1(e,s,{}),k=!0),v=new El(r,i,p,m,u),e._edges.set(i,v);const C=o===s;return r?(p.undirectedDegree++,m.undirectedDegree++,C&&(p.undirectedLoops++,e._undirectedSelfLoopCount++)):(p.outDegree++,m.inDegree++,C&&(p.directedLoops++,e._directedSelfLoopCount++)),e.multi?v.attachMulti():v.attach(),r?e._undirectedSize++:e._directedSize++,w.key=i,e.emit("edgeAdded",w),[i,!0,x,k]}function Yo(e,t){e._edges.delete(t.key);const{source:n,target:r,attributes:i}=t,o=t.undirected,s=n===r;o?(n.undirectedDegree--,r.undirectedDegree--,s&&(n.undirectedLoops--,e._undirectedSelfLoopCount--)):(n.outDegree--,r.inDegree--,s&&(n.directedLoops--,e._directedSelfLoopCount--)),e.multi?t.detachMulti():t.detach(),o?e._undirectedSize--:e._directedSize--,e.emit("edgeDropped",{key:t.key,attributes:i,source:n.key,target:r.key,undirected:o})}class St extends MT.EventEmitter{constructor(t){if(super(),t=Xt({},O5,t),typeof t.multi!="boolean")throw new Le(`Graph.constructor: invalid 'multi' option. Expecting a boolean but got "${t.multi}".`);if(!D5.has(t.type))throw new Le(`Graph.constructor: invalid 'type' option. Should be one of "mixed", "directed" or "undirected" but got "${t.type}".`);if(typeof t.allowSelfLoops!="boolean")throw new Le(`Graph.constructor: invalid 'allowSelfLoops' option. Expecting a boolean but got "${t.allowSelfLoops}".`);const n=t.type==="mixed"?FT:t.type==="directed"?IT:GT;cr(this,"NodeDataClass",n);const r="geid_"+R5()+"_";let i=0;const o=()=>{let s;do s=r+i++;while(this._edges.has(s));return s};cr(this,"_attributes",{}),cr(this,"_nodes",new Map),cr(this,"_edges",new Map),cr(this,"_directedSize",0),cr(this,"_undirectedSize",0),cr(this,"_directedSelfLoopCount",0),cr(this,"_undirectedSelfLoopCount",0),cr(this,"_edgeKeyGenerator",o),cr(this,"_options",t),U1.forEach(s=>cr(this,s,this[s])),Sr(this,"order",()=>this._nodes.size),Sr(this,"size",()=>this._edges.size),Sr(this,"directedSize",()=>this._directedSize),Sr(this,"undirectedSize",()=>this._undirectedSize),Sr(this,"selfLoopCount",()=>this._directedSelfLoopCount+this._undirectedSelfLoopCount),Sr(this,"directedSelfLoopCount",()=>this._directedSelfLoopCount),Sr(this,"undirectedSelfLoopCount",()=>this._undirectedSelfLoopCount),Sr(this,"multi",this._options.multi),Sr(this,"type",this._options.type),Sr(this,"allowSelfLoops",this._options.allowSelfLoops),Sr(this,"implementation",()=>"graphology")}_resetInstanceCounters(){this._directedSize=0,this._undirectedSize=0,this._directedSelfLoopCount=0,this._undirectedSelfLoopCount=0}hasNode(t){return this._nodes.has(""+t)}hasDirectedEdge(t,n){if(this.type==="undirected")return!1;if(arguments.length===1){const r=""+t,i=this._edges.get(r);return!!i&&!i.undirected}else if(arguments.length===2){t=""+t,n=""+n;const r=this._nodes.get(t);return r?r.out.hasOwnProperty(n):!1}throw new Le(`Graph.hasDirectedEdge: invalid arity (${arguments.length}, instead of 1 or 2). You can either ask for an edge id or for the existence of an edge between a source & a target.`)}hasUndirectedEdge(t,n){if(this.type==="directed")return!1;if(arguments.length===1){const r=""+t,i=this._edges.get(r);return!!i&&i.undirected}else if(arguments.length===2){t=""+t,n=""+n;const r=this._nodes.get(t);return r?r.undirected.hasOwnProperty(n):!1}throw new Le(`Graph.hasDirectedEdge: invalid arity (${arguments.length}, instead of 1 or 2). You can either ask for an edge id or for the existence of an edge between a source & a target.`)}hasEdge(t,n){if(arguments.length===1){const r=""+t;return this._edges.has(r)}else if(arguments.length===2){t=""+t,n=""+n;const r=this._nodes.get(t);return r?typeof r.out<"u"&&r.out.hasOwnProperty(n)||typeof r.undirected<"u"&&r.undirected.hasOwnProperty(n):!1}throw new Le(`Graph.hasEdge: invalid arity (${arguments.length}, instead of 1 or 2). You can either ask for an edge id or for the existence of an edge between a source & a target.`)}directedEdge(t,n){if(this.type==="undirected")return;if(t=""+t,n=""+n,this.multi)throw new Xe("Graph.directedEdge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.directedEdges instead.");const r=this._nodes.get(t);if(!r)throw new De(`Graph.directedEdge: could not find the "${t}" source node in the graph.`);if(!this._nodes.has(n))throw new De(`Graph.directedEdge: could not find the "${n}" target node in the graph.`);const i=r.out&&r.out[n]||void 0;if(i)return i.key}undirectedEdge(t,n){if(this.type==="directed")return;if(t=""+t,n=""+n,this.multi)throw new Xe("Graph.undirectedEdge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.undirectedEdges instead.");const r=this._nodes.get(t);if(!r)throw new De(`Graph.undirectedEdge: could not find the "${t}" source node in the graph.`);if(!this._nodes.has(n))throw new De(`Graph.undirectedEdge: could not find the "${n}" target node in the graph.`);const i=r.undirected&&r.undirected[n]||void 0;if(i)return i.key}edge(t,n){if(this.multi)throw new Xe("Graph.edge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.edges instead.");t=""+t,n=""+n;const r=this._nodes.get(t);if(!r)throw new De(`Graph.edge: could not find the "${t}" source node in the graph.`);if(!this._nodes.has(n))throw new De(`Graph.edge: could not find the "${n}" target node in the graph.`);const i=r.out&&r.out[n]||r.undirected&&r.undirected[n]||void 0;if(i)return i.key}areDirectedNeighbors(t,n){t=""+t,n=""+n;const r=this._nodes.get(t);if(!r)throw new De(`Graph.areDirectedNeighbors: could not find the "${t}" node in the graph.`);return this.type==="undirected"?!1:n in r.in||n in r.out}areOutNeighbors(t,n){t=""+t,n=""+n;const r=this._nodes.get(t);if(!r)throw new De(`Graph.areOutNeighbors: could not find the "${t}" node in the graph.`);return this.type==="undirected"?!1:n in r.out}areInNeighbors(t,n){t=""+t,n=""+n;const r=this._nodes.get(t);if(!r)throw new De(`Graph.areInNeighbors: could not find the "${t}" node in the graph.`);return this.type==="undirected"?!1:n in r.in}areUndirectedNeighbors(t,n){t=""+t,n=""+n;const r=this._nodes.get(t);if(!r)throw new De(`Graph.areUndirectedNeighbors: could not find the "${t}" node in the graph.`);return this.type==="directed"?!1:n in r.undirected}areNeighbors(t,n){t=""+t,n=""+n;const r=this._nodes.get(t);if(!r)throw new De(`Graph.areNeighbors: could not find the "${t}" node in the graph.`);return this.type!=="undirected"&&(n in r.in||n in r.out)||this.type!=="directed"&&n in r.undirected}areInboundNeighbors(t,n){t=""+t,n=""+n;const r=this._nodes.get(t);if(!r)throw new De(`Graph.areInboundNeighbors: could not find the "${t}" node in the graph.`);return this.type!=="undirected"&&n in r.in||this.type!=="directed"&&n in r.undirected}areOutboundNeighbors(t,n){t=""+t,n=""+n;const r=this._nodes.get(t);if(!r)throw new De(`Graph.areOutboundNeighbors: could not find the "${t}" node in the graph.`);return this.type!=="undirected"&&n in r.out||this.type!=="directed"&&n in r.undirected}inDegree(t){t=""+t;const n=this._nodes.get(t);if(!n)throw new De(`Graph.inDegree: could not find the "${t}" node in the graph.`);return this.type==="undirected"?0:n.inDegree}outDegree(t){t=""+t;const n=this._nodes.get(t);if(!n)throw new De(`Graph.outDegree: could not find the "${t}" node in the graph.`);return this.type==="undirected"?0:n.outDegree}directedDegree(t){t=""+t;const n=this._nodes.get(t);if(!n)throw new De(`Graph.directedDegree: could not find the "${t}" node in the graph.`);return this.type==="undirected"?0:n.inDegree+n.outDegree}undirectedDegree(t){t=""+t;const n=this._nodes.get(t);if(!n)throw new De(`Graph.undirectedDegree: could not find the "${t}" node in the graph.`);return this.type==="directed"?0:n.undirectedDegree}inboundDegree(t){t=""+t;const n=this._nodes.get(t);if(!n)throw new De(`Graph.inboundDegree: could not find the "${t}" node in the graph.`);let r=0;return this.type!=="directed"&&(r+=n.undirectedDegree),this.type!=="undirected"&&(r+=n.inDegree),r}outboundDegree(t){t=""+t;const n=this._nodes.get(t);if(!n)throw new De(`Graph.outboundDegree: could not find the "${t}" node in the graph.`);let r=0;return this.type!=="directed"&&(r+=n.undirectedDegree),this.type!=="undirected"&&(r+=n.outDegree),r}degree(t){t=""+t;const n=this._nodes.get(t);if(!n)throw new De(`Graph.degree: could not find the "${t}" node in the graph.`);let r=0;return this.type!=="directed"&&(r+=n.undirectedDegree),this.type!=="undirected"&&(r+=n.inDegree+n.outDegree),r}inDegreeWithoutSelfLoops(t){t=""+t;const n=this._nodes.get(t);if(!n)throw new De(`Graph.inDegreeWithoutSelfLoops: could not find the "${t}" node in the graph.`);return this.type==="undirected"?0:n.inDegree-n.directedLoops}outDegreeWithoutSelfLoops(t){t=""+t;const n=this._nodes.get(t);if(!n)throw new De(`Graph.outDegreeWithoutSelfLoops: could not find the "${t}" node in the graph.`);return this.type==="undirected"?0:n.outDegree-n.directedLoops}directedDegreeWithoutSelfLoops(t){t=""+t;const n=this._nodes.get(t);if(!n)throw new De(`Graph.directedDegreeWithoutSelfLoops: could not find the "${t}" node in the graph.`);return this.type==="undirected"?0:n.inDegree+n.outDegree-n.directedLoops*2}undirectedDegreeWithoutSelfLoops(t){t=""+t;const n=this._nodes.get(t);if(!n)throw new De(`Graph.undirectedDegreeWithoutSelfLoops: could not find the "${t}" node in the graph.`);return this.type==="directed"?0:n.undirectedDegree-n.undirectedLoops*2}inboundDegreeWithoutSelfLoops(t){t=""+t;const n=this._nodes.get(t);if(!n)throw new De(`Graph.inboundDegreeWithoutSelfLoops: could not find the "${t}" node in the graph.`);let r=0,i=0;return this.type!=="directed"&&(r+=n.undirectedDegree,i+=n.undirectedLoops*2),this.type!=="undirected"&&(r+=n.inDegree,i+=n.directedLoops),r-i}outboundDegreeWithoutSelfLoops(t){t=""+t;const n=this._nodes.get(t);if(!n)throw new De(`Graph.outboundDegreeWithoutSelfLoops: could not find the "${t}" node in the graph.`);let r=0,i=0;return this.type!=="directed"&&(r+=n.undirectedDegree,i+=n.undirectedLoops*2),this.type!=="undirected"&&(r+=n.outDegree,i+=n.directedLoops),r-i}degreeWithoutSelfLoops(t){t=""+t;const n=this._nodes.get(t);if(!n)throw new De(`Graph.degreeWithoutSelfLoops: could not find the "${t}" node in the graph.`);let r=0,i=0;return this.type!=="directed"&&(r+=n.undirectedDegree,i+=n.undirectedLoops*2),this.type!=="undirected"&&(r+=n.inDegree+n.outDegree,i+=n.directedLoops*2),r-i}source(t){t=""+t;const n=this._edges.get(t);if(!n)throw new De(`Graph.source: could not find the "${t}" edge in the graph.`);return n.source.key}target(t){t=""+t;const n=this._edges.get(t);if(!n)throw new De(`Graph.target: could not find the "${t}" edge in the graph.`);return n.target.key}extremities(t){t=""+t;const n=this._edges.get(t);if(!n)throw new De(`Graph.extremities: could not find the "${t}" edge in the graph.`);return[n.source.key,n.target.key]}opposite(t,n){t=""+t,n=""+n;const r=this._edges.get(n);if(!r)throw new De(`Graph.opposite: could not find the "${n}" edge in the graph.`);const i=r.source.key,o=r.target.key;if(t===i)return o;if(t===o)return i;throw new De(`Graph.opposite: the "${t}" node is not attached to the "${n}" edge (${i}, ${o}).`)}hasExtremity(t,n){t=""+t,n=""+n;const r=this._edges.get(t);if(!r)throw new De(`Graph.hasExtremity: could not find the "${t}" edge in the graph.`);return r.source.key===n||r.target.key===n}isUndirected(t){t=""+t;const n=this._edges.get(t);if(!n)throw new De(`Graph.isUndirected: could not find the "${t}" edge in the graph.`);return n.undirected}isDirected(t){t=""+t;const n=this._edges.get(t);if(!n)throw new De(`Graph.isDirected: could not find the "${t}" edge in the graph.`);return!n.undirected}isSelfLoop(t){t=""+t;const n=this._edges.get(t);if(!n)throw new De(`Graph.isSelfLoop: could not find the "${t}" edge in the graph.`);return n.source===n.target}addNode(t,n){return L5(this,t,n).key}mergeNode(t,n){if(n&&!cn(n))throw new Le(`Graph.mergeNode: invalid attributes. Expecting an object but got "${n}"`);t=""+t,n=n||{};let r=this._nodes.get(t);return r?(n&&(Xt(r.attributes,n),this.emit("nodeAttributesUpdated",{type:"merge",key:t,attributes:r.attributes,data:n})),[t,!1]):(r=new this.NodeDataClass(t,n),this._nodes.set(t,r),this.emit("nodeAdded",{key:t,attributes:n}),[t,!0])}updateNode(t,n){if(n&&typeof n!="function")throw new Le(`Graph.updateNode: invalid updater function. Expecting a function but got "${n}"`);t=""+t;let r=this._nodes.get(t);if(r){if(n){const o=r.attributes;r.attributes=n(o),this.emit("nodeAttributesUpdated",{type:"replace",key:t,attributes:r.attributes})}return[t,!1]}const i=n?n({}):{};return r=new this.NodeDataClass(t,i),this._nodes.set(t,r),this.emit("nodeAdded",{key:t,attributes:i}),[t,!0]}dropNode(t){t=""+t;const n=this._nodes.get(t);if(!n)throw new De(`Graph.dropNode: could not find the "${t}" node in the graph.`);let r;if(this.type!=="undirected"){for(const i in n.out){r=n.out[i];do Yo(this,r),r=r.next;while(r)}for(const i in n.in){r=n.in[i];do Yo(this,r),r=r.next;while(r)}}if(this.type!=="directed")for(const i in n.undirected){r=n.undirected[i];do Yo(this,r),r=r.next;while(r)}this._nodes.delete(t),this.emit("nodeDropped",{key:t,attributes:n.attributes})}dropEdge(t){let n;if(arguments.length>1){const r=""+arguments[0],i=""+arguments[1];if(n=dr(this,r,i,this.type),!n)throw new De(`Graph.dropEdge: could not find the "${r}" -> "${i}" edge in the graph.`)}else if(t=""+t,n=this._edges.get(t),!n)throw new De(`Graph.dropEdge: could not find the "${t}" edge in the graph.`);return Yo(this,n),this}dropDirectedEdge(t,n){if(arguments.length<2)throw new Xe("Graph.dropDirectedEdge: it does not make sense to try and drop a directed edge by key. What if the edge with this key is undirected? Use #.dropEdge for this purpose instead.");if(this.multi)throw new Xe("Graph.dropDirectedEdge: cannot use a {source,target} combo when dropping an edge in a MultiGraph since we cannot infer the one you want to delete as there could be multiple ones.");t=""+t,n=""+n;const r=dr(this,t,n,"directed");if(!r)throw new De(`Graph.dropDirectedEdge: could not find a "${t}" -> "${n}" edge in the graph.`);return Yo(this,r),this}dropUndirectedEdge(t,n){if(arguments.length<2)throw new Xe("Graph.dropUndirectedEdge: it does not make sense to drop a directed edge by key. What if the edge with this key is undirected? Use #.dropEdge for this purpose instead.");if(this.multi)throw new Xe("Graph.dropUndirectedEdge: cannot use a {source,target} combo when dropping an edge in a MultiGraph since we cannot infer the one you want to delete as there could be multiple ones.");const r=dr(this,t,n,"undirected");if(!r)throw new De(`Graph.dropUndirectedEdge: could not find a "${t}" -> "${n}" edge in the graph.`);return Yo(this,r),this}clear(){this._edges.clear(),this._nodes.clear(),this._resetInstanceCounters(),this.emit("cleared")}clearEdges(){const t=this._nodes.values();let n;for(;n=t.next(),n.done!==!0;)n.value.clear();this._edges.clear(),this._resetInstanceCounters(),this.emit("edgesCleared")}getAttribute(t){return this._attributes[t]}getAttributes(){return this._attributes}hasAttribute(t){return this._attributes.hasOwnProperty(t)}setAttribute(t,n){return this._attributes[t]=n,this.emit("attributesUpdated",{type:"set",attributes:this._attributes,name:t}),this}updateAttribute(t,n){if(typeof n!="function")throw new Le("Graph.updateAttribute: updater should be a function.");const r=this._attributes[t];return this._attributes[t]=n(r),this.emit("attributesUpdated",{type:"set",attributes:this._attributes,name:t}),this}removeAttribute(t){return delete this._attributes[t],this.emit("attributesUpdated",{type:"remove",attributes:this._attributes,name:t}),this}replaceAttributes(t){if(!cn(t))throw new Le("Graph.replaceAttributes: provided attributes are not a plain object.");return this._attributes=t,this.emit("attributesUpdated",{type:"replace",attributes:this._attributes}),this}mergeAttributes(t){if(!cn(t))throw new Le("Graph.mergeAttributes: provided attributes are not a plain object.");return Xt(this._attributes,t),this.emit("attributesUpdated",{type:"merge",attributes:this._attributes,data:t}),this}updateAttributes(t){if(typeof t!="function")throw new Le("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 Le("Graph.updateEachNodeAttributes: expecting an updater function.");if(n&&!B1(n))throw new Le("Graph.updateEachNodeAttributes: invalid hints. Expecting an object having the following shape: {attributes?: [string]}");const r=this._nodes.values();let i,o;for(;i=r.next(),i.done!==!0;)o=i.value,o.attributes=t(o.key,o.attributes);this.emit("eachNodeAttributesUpdated",{hints:n||null})}updateEachEdgeAttributes(t,n){if(typeof t!="function")throw new Le("Graph.updateEachEdgeAttributes: expecting an updater function.");if(n&&!B1(n))throw new Le("Graph.updateEachEdgeAttributes: invalid hints. Expecting an object having the following shape: {attributes?: [string]}");const r=this._edges.values();let i,o,s,u;for(;i=r.next(),i.done!==!0;)o=i.value,s=o.source,u=o.target,o.attributes=t(o.key,o.attributes,s.key,u.key,s.attributes,u.attributes,o.undirected);this.emit("eachEdgeAttributesUpdated",{hints:n||null})}forEachAdjacencyEntry(t){if(typeof t!="function")throw new Le("Graph.forEachAdjacencyEntry: expecting a callback.");Fc(!1,!1,!1,this,t)}forEachAdjacencyEntryWithOrphans(t){if(typeof t!="function")throw new Le("Graph.forEachAdjacencyEntryWithOrphans: expecting a callback.");Fc(!1,!1,!0,this,t)}forEachAssymetricAdjacencyEntry(t){if(typeof t!="function")throw new Le("Graph.forEachAssymetricAdjacencyEntry: expecting a callback.");Fc(!1,!0,!1,this,t)}forEachAssymetricAdjacencyEntryWithOrphans(t){if(typeof t!="function")throw new Le("Graph.forEachAssymetricAdjacencyEntryWithOrphans: expecting a callback.");Fc(!1,!0,!0,this,t)}nodes(){return Array.from(this._nodes.keys())}forEachNode(t){if(typeof t!="function")throw new Le("Graph.forEachNode: expecting a callback.");const n=this._nodes.values();let r,i;for(;r=n.next(),r.done!==!0;)i=r.value,t(i.key,i.attributes)}findNode(t){if(typeof t!="function")throw new Le("Graph.findNode: expecting a callback.");const n=this._nodes.values();let r,i;for(;r=n.next(),r.done!==!0;)if(i=r.value,t(i.key,i.attributes))return i.key}mapNodes(t){if(typeof t!="function")throw new Le("Graph.mapNode: expecting a callback.");const n=this._nodes.values();let r,i;const o=new Array(this.order);let s=0;for(;r=n.next(),r.done!==!0;)i=r.value,o[s++]=t(i.key,i.attributes);return o}someNode(t){if(typeof t!="function")throw new Le("Graph.someNode: expecting a callback.");const n=this._nodes.values();let r,i;for(;r=n.next(),r.done!==!0;)if(i=r.value,t(i.key,i.attributes))return!0;return!1}everyNode(t){if(typeof t!="function")throw new Le("Graph.everyNode: expecting a callback.");const n=this._nodes.values();let r,i;for(;r=n.next(),r.done!==!0;)if(i=r.value,!t(i.key,i.attributes))return!1;return!0}filterNodes(t){if(typeof t!="function")throw new Le("Graph.filterNodes: expecting a callback.");const n=this._nodes.values();let r,i;const o=[];for(;r=n.next(),r.done!==!0;)i=r.value,t(i.key,i.attributes)&&o.push(i.key);return o}reduceNodes(t,n){if(typeof t!="function")throw new Le("Graph.reduceNodes: expecting a callback.");if(arguments.length<2)throw new Le("Graph.reduceNodes: missing initial value. You must provide it because the callback takes more than one argument and we cannot infer the initial value from the first iteration, as you could with a simple array.");let r=n;const i=this._nodes.values();let o,s;for(;o=i.next(),o.done!==!0;)s=o.value,r=t(r,s.key,s.attributes);return r}nodeEntries(){const t=this._nodes.values();return{[Symbol.iterator](){return this},next(){const n=t.next();if(n.done)return n;const r=n.value;return{value:{node:r.key,attributes:r.attributes},done:!1}}}}export(){const t=new Array(this._nodes.size);let n=0;this._nodes.forEach((i,o)=>{t[n++]=k5(o,i)});const r=new Array(this._edges.size);return n=0,this._edges.forEach((i,o)=>{r[n++]=C5(this.type,o,i)}),{options:{type:this.type,multi:this.multi,allowSelfLoops:this.allowSelfLoops},attributes:this.getAttributes(),nodes:t,edges:r}}import(t,n=!1){if(t instanceof St)return t.forEachNode((f,d)=>{n?this.mergeNode(f,d):this.addNode(f,d)}),t.forEachEdge((f,d,p,m,v,g,w)=>{n?w?this.mergeUndirectedEdgeWithKey(f,p,m,d):this.mergeDirectedEdgeWithKey(f,p,m,d):w?this.addUndirectedEdgeWithKey(f,p,m,d):this.addDirectedEdgeWithKey(f,p,m,d)}),this;if(!cn(t))throw new Le("Graph.import: invalid argument. Expecting a serialized graph or, alternatively, a Graph instance.");if(t.attributes){if(!cn(t.attributes))throw new Le("Graph.import: invalid attributes. Expecting a plain object.");n?this.mergeAttributes(t.attributes):this.replaceAttributes(t.attributes)}let r,i,o,s,u;if(t.nodes){if(o=t.nodes,!Array.isArray(o))throw new Le("Graph.import: invalid nodes. Expecting an array.");for(r=0,i=o.length;r{const o=Xt({},r.attributes);r=new n.NodeDataClass(i,o),n._nodes.set(i,r)}),n}copy(t){if(t=t||{},typeof t.type=="string"&&t.type!==this.type&&t.type!=="mixed")throw new Xe(`Graph.copy: cannot create an incompatible copy from "${this.type}" type to "${t.type}" because this would mean losing information about the current graph.`);if(typeof t.multi=="boolean"&&t.multi!==this.multi&&t.multi!==!0)throw new Xe("Graph.copy: cannot create an incompatible copy by downgrading a multi graph to a simple one because this would mean losing information about the current graph.");if(typeof t.allowSelfLoops=="boolean"&&t.allowSelfLoops!==this.allowSelfLoops&&t.allowSelfLoops!==!0)throw new Xe("Graph.copy: cannot create an incompatible copy from a graph allowing self loops to one that does not because this would mean losing information about the current graph.");const n=this.emptyCopy(t),r=this._edges.values();let i,o;for(;i=r.next(),i.done!==!0;)o=i.value,VT(n,"copy",!1,o.undirected,o.key,o.source.key,o.target.key,Xt({},o.attributes));return n}toJSON(){return this.export()}toString(){return"[object Graph]"}inspect(){const t={};this._nodes.forEach((o,s)=>{t[s]=o.attributes});const n={},r={};this._edges.forEach((o,s)=>{const u=o.undirected?"--":"->";let f="",d=o.source.key,p=o.target.key,m;o.undirected&&d>p&&(m=d,d=p,p=m);const v=`(${d})${u}(${p})`;s.startsWith("geid_")?this.multi&&(typeof r[v]>"u"?r[v]=0:r[v]++,f+=`${r[v]}. `):f+=`[${s}]: `,f+=v,n[f]=o.attributes});const i={};for(const o in this)this.hasOwnProperty(o)&&!U1.has(o)&&typeof this[o]!="function"&&typeof o!="symbol"&&(i[o]=this[o]);return i.attributes=this._attributes,i.nodes=t,i.edges=n,cr(i,"constructor",this.constructor),i}}typeof Symbol<"u"&&(St.prototype[Symbol.for("nodejs.util.inspect.custom")]=St.prototype.inspect);N5.forEach(e=>{["add","merge","update"].forEach(t=>{const n=e.name(t),r=t==="add"?VT:z5;e.generateKey?St.prototype[n]=function(i,o,s){return r(this,n,!0,(e.type||this.type)==="undirected",null,i,o,s,t==="update")}:St.prototype[n]=function(i,o,s,u){return r(this,n,!1,(e.type||this.type)==="undirected",i,o,s,u,t==="update")}})});H3(St);e5(St);g5(St);_5(St);class Ws extends St{constructor(t){const n=Xt({type:"directed"},t);if("multi"in n&&n.multi!==!1)throw new Le("DirectedGraph.from: inconsistent indication that the graph should be multi in given options!");if(n.type!=="directed")throw new Le('DirectedGraph.from: inconsistent "'+n.type+'" type in given options!');super(n)}}class qT extends St{constructor(t){const n=Xt({type:"undirected"},t);if("multi"in n&&n.multi!==!1)throw new Le("UndirectedGraph.from: inconsistent indication that the graph should be multi in given options!");if(n.type!=="undirected")throw new Le('UndirectedGraph.from: inconsistent "'+n.type+'" type in given options!');super(n)}}class YT extends St{constructor(t){const n=Xt({multi:!0},t);if("multi"in n&&n.multi!==!0)throw new Le("MultiGraph.from: inconsistent indication that the graph should be simple in given options!");super(n)}}class WT extends St{constructor(t){const n=Xt({type:"directed",multi:!0},t);if("multi"in n&&n.multi!==!0)throw new Le("MultiDirectedGraph.from: inconsistent indication that the graph should be simple in given options!");if(n.type!=="directed")throw new Le('MultiDirectedGraph.from: inconsistent "'+n.type+'" type in given options!');super(n)}}class XT extends St{constructor(t){const n=Xt({type:"undirected",multi:!0},t);if("multi"in n&&n.multi!==!0)throw new Le("MultiUndirectedGraph.from: inconsistent indication that the graph should be simple in given options!");if(n.type!=="undirected")throw new Le('MultiUndirectedGraph.from: inconsistent "'+n.type+'" type in given options!');super(n)}}function _l(e){e.from=function(t,n){const r=Xt({},t.options,n),i=new e(r);return i.import(t),i}}_l(St);_l(Ws);_l(qT);_l(YT);_l(WT);_l(XT);St.Graph=St;St.DirectedGraph=Ws;St.UndirectedGraph=qT;St.MultiGraph=YT;St.MultiDirectedGraph=WT;St.MultiUndirectedGraph=XT;St.InvalidArgumentsGraphError=Le;St.NotFoundGraphError=De;St.UsageGraphError=Xe;function j5(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function Gs(e){var t=j5(e,"string");return typeof t=="symbol"?t:t+""}function tn(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function $1(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,r=Array(t);n>8&255,o=n>>16&255,s=n>>24&255;return[r,i,o,s]}var sm={};function tA(e){if(typeof sm[e]<"u")return sm[e];var t=(e&16711680)>>>16,n=(e&65280)>>>8,r=e&255,i=255,o=eA(t,n,r,i);return sm[e]=o,o}function V1(e,t,n,r){return n+(t<<8)+(e<<16)}function q1(e,t,n,r,i,o){var s=Math.floor(n/o*i),u=Math.floor(e.drawingBufferHeight/o-r/o*i),f=new Uint8Array(4);e.bindFramebuffer(e.FRAMEBUFFER,t),e.readPixels(s,u,1,1,e.RGBA,e.UNSIGNED_BYTE,f);var d=fl(f,4),p=d[0],m=d[1],v=d[2],g=d[3];return[p,m,v,g]}function ke(e,t,n){return(t=Gs(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Y1(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Fe(e){for(var t=1;tN){var z="…";for(d=d+z,D=e.measureText(d).width;D>N&&d.length>1;)d=d.slice(0,-2)+z,D=e.measureText(d).width;if(d.length<4)return}var R;_>0?T>0?R=Math.acos(_/N):R=Math.asin(T/N):T>0?R=Math.acos(_/N)+Math.PI:R=Math.asin(_/N)+Math.PI/2,e.save(),e.translate(k,C),e.rotate(R),e.fillText(d,-D/2,t.size/2+o),e.restore()}}}function oA(e,t,n){if(t.label){var r=n.labelSize,i=n.labelFont,o=n.labelWeight,s=n.labelColor.attribute?t[n.labelColor.attribute]||n.labelColor.color||"#000":n.labelColor.color;e.fillStyle=s,e.font="".concat(o," ").concat(r,"px ").concat(i),e.fillText(t.label,t.x+t.size+3,t.y+r/3)}}function Q5(e,t,n){var r=n.labelSize,i=n.labelFont,o=n.labelWeight;e.font="".concat(o," ").concat(r,"px ").concat(i),e.fillStyle="#FFF",e.shadowOffsetX=0,e.shadowOffsetY=0,e.shadowBlur=8,e.shadowColor="#000";var s=2;if(typeof t.label=="string"){var u=e.measureText(t.label).width,f=Math.round(u+5),d=Math.round(r+2*s),p=Math.max(t.size,r/2)+s,m=Math.asin(d/2/p),v=Math.sqrt(Math.abs(Math.pow(p,2)-Math.pow(d/2,2)));e.beginPath(),e.moveTo(t.x+v,t.y+d/2),e.lineTo(t.x+p+f,t.y+d/2),e.lineTo(t.x+p+f,t.y-d/2),e.lineTo(t.x+v,t.y-d/2),e.arc(t.x,t.y,p,m,-m),e.closePath(),e.fill()}else e.beginPath(),e.arc(t.x,t.y,t.size+s,0,Math.PI*2),e.closePath(),e.fill();e.shadowOffsetX=0,e.shadowOffsetY=0,e.shadowBlur=0,oA(e,t,n)}var J5=` -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 -} -`,eG=J5,tG=` -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; -} -`,nG=tG,lA=WebGLRenderingContext,Z1=lA.UNSIGNED_BYTE,cm=lA.FLOAT,rG=["u_sizeRatio","u_correctionRatio","u_matrix"],fu=function(e){function t(){return tn(this,t),Pn(this,t,arguments)}return Fn(t,e),nn(t,[{key:"getDefinition",value:function(){return{VERTICES:3,VERTEX_SHADER_SOURCE:nG,FRAGMENT_SHADER_SOURCE:eG,METHOD:WebGLRenderingContext.TRIANGLES,UNIFORMS:rG,ATTRIBUTES:[{name:"a_position",size:2,type:cm},{name:"a_size",size:1,type:cm},{name:"a_color",size:4,type:Z1,normalized:!0},{name:"a_id",size:4,type:Z1,normalized:!0}],CONSTANT_ATTRIBUTES:[{name:"a_angle",size:1,type:cm}],CONSTANT_DATA:[[t.ANGLE_1],[t.ANGLE_2],[t.ANGLE_3]]}}},{key:"processVisibleItem",value:function(r,i,o){var s=this.array,u=Yr(o.color);s[i++]=o.x,s[i++]=o.y,s[i++]=o.size,s[i++]=u,s[i++]=r}},{key:"setUniforms",value:function(r,i){var o=i.gl,s=i.uniformLocations,u=s.u_sizeRatio,f=s.u_correctionRatio,d=s.u_matrix;o.uniform1f(f,r.correctionRatio),o.uniform1f(u,r.sizeRatio),o.uniformMatrix3fv(d,!1,r.matrix)}}])}(gy);ke(fu,"ANGLE_1",0);ke(fu,"ANGLE_2",2*Math.PI/3);ke(fu,"ANGLE_3",4*Math.PI/3);var iG=` -precision mediump float; - -varying vec4 v_color; - -void main(void) { - gl_FragColor = v_color; -} -`,aG=iG,oG=` -attribute vec2 a_position; -attribute vec2 a_normal; -attribute float a_radius; -attribute vec3 a_barycentric; - -#ifdef PICKING_MODE -attribute vec4 a_id; -#else -attribute vec4 a_color; -#endif - -uniform mat3 u_matrix; -uniform float u_sizeRatio; -uniform float u_correctionRatio; -uniform float u_minEdgeThickness; -uniform float u_lengthToThicknessRatio; -uniform float u_widenessToThicknessRatio; - -varying vec4 v_color; - -const float bias = 255.0 / 254.0; - -void main() { - float minThickness = u_minEdgeThickness; - - float normalLength = length(a_normal); - vec2 unitNormal = a_normal / normalLength; - - // These first computations are taken from edge.vert.glsl and - // edge.clamped.vert.glsl. Please read it to get better comments on what's - // happening: - float pixelsThickness = max(normalLength / u_sizeRatio, minThickness); - float webGLThickness = pixelsThickness * u_correctionRatio; - float webGLNodeRadius = a_radius * 2.0 * u_correctionRatio / u_sizeRatio; - float webGLArrowHeadLength = webGLThickness * u_lengthToThicknessRatio * 2.0; - float webGLArrowHeadThickness = webGLThickness * u_widenessToThicknessRatio; - - float da = a_barycentric.x; - float db = a_barycentric.y; - float dc = a_barycentric.z; - - vec2 delta = vec2( - da * (webGLNodeRadius * unitNormal.y) - + db * ((webGLNodeRadius + webGLArrowHeadLength) * unitNormal.y + webGLArrowHeadThickness * unitNormal.x) - + dc * ((webGLNodeRadius + webGLArrowHeadLength) * unitNormal.y - webGLArrowHeadThickness * unitNormal.x), - - da * (-webGLNodeRadius * unitNormal.x) - + db * (-(webGLNodeRadius + webGLArrowHeadLength) * unitNormal.x + webGLArrowHeadThickness * unitNormal.y) - + dc * (-(webGLNodeRadius + webGLArrowHeadLength) * unitNormal.x - webGLArrowHeadThickness * unitNormal.y) - ); - - vec2 position = (u_matrix * vec3(a_position + delta, 1)).xy; - - gl_Position = vec4(position, 0, 1); - - #ifdef PICKING_MODE - // For picking mode, we use the ID as the color: - v_color = a_id; - #else - // For normal mode, we use the color: - v_color = a_color; - #endif - - v_color.a *= bias; -} -`,lG=oG,sA=WebGLRenderingContext,Q1=sA.UNSIGNED_BYTE,Gc=sA.FLOAT,sG=["u_matrix","u_sizeRatio","u_correctionRatio","u_minEdgeThickness","u_lengthToThicknessRatio","u_widenessToThicknessRatio"],du={extremity:"target",lengthToThicknessRatio:2.5,widenessToThicknessRatio:2};function Cf(e){var t=Fe(Fe({},du),e||{});return function(n){function r(){return tn(this,r),Pn(this,r,arguments)}return Fn(r,n),nn(r,[{key:"getDefinition",value:function(){return{VERTICES:3,VERTEX_SHADER_SOURCE:lG,FRAGMENT_SHADER_SOURCE:aG,METHOD:WebGLRenderingContext.TRIANGLES,UNIFORMS:sG,ATTRIBUTES:[{name:"a_position",size:2,type:Gc},{name:"a_normal",size:2,type:Gc},{name:"a_radius",size:1,type:Gc},{name:"a_color",size:4,type:Q1,normalized:!0},{name:"a_id",size:4,type:Q1,normalized:!0}],CONSTANT_ATTRIBUTES:[{name:"a_barycentric",size:3,type:Gc}],CONSTANT_DATA:[[1,0,0],[0,1,0],[0,0,1]]}}},{key:"processVisibleItem",value:function(o,s,u,f,d){if(t.extremity==="source"){var p=[f,u];u=p[0],f=p[1]}var m=d.size||1,v=f.size||1,g=u.x,w=u.y,x=f.x,k=f.y,C=Yr(d.color),_=x-g,T=k-w,N=_*_+T*T,D=0,z=0;N&&(N=1/Math.sqrt(N),D=-T*N*m,z=_*N*m);var R=this.array;R[s++]=x,R[s++]=k,R[s++]=-D,R[s++]=-z,R[s++]=v,R[s++]=C,R[s++]=o}},{key:"setUniforms",value:function(o,s){var u=s.gl,f=s.uniformLocations,d=f.u_matrix,p=f.u_sizeRatio,m=f.u_correctionRatio,v=f.u_minEdgeThickness,g=f.u_lengthToThicknessRatio,w=f.u_widenessToThicknessRatio;u.uniformMatrix3fv(d,!1,o.matrix),u.uniform1f(p,o.sizeRatio),u.uniform1f(m,o.correctionRatio),u.uniform1f(v,o.minEdgeThickness),u.uniform1f(g,t.lengthToThicknessRatio),u.uniform1f(w,t.widenessToThicknessRatio)}}])}(cu)}Cf();var uG=` -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 -} -`,vy=uG,cG=` -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; -} -`,fG=cG,uA=WebGLRenderingContext,J1=uA.UNSIGNED_BYTE,Ga=uA.FLOAT,dG=["u_matrix","u_zoomRatio","u_sizeRatio","u_correctionRatio","u_pixelRatio","u_feather","u_minEdgeThickness","u_lengthToThicknessRatio"],hG={lengthToThicknessRatio:du.lengthToThicknessRatio};function cA(e){var t=Fe(Fe({},hG),{});return function(n){function r(){return tn(this,r),Pn(this,r,arguments)}return Fn(r,n),nn(r,[{key:"getDefinition",value:function(){return{VERTICES:6,VERTEX_SHADER_SOURCE:fG,FRAGMENT_SHADER_SOURCE:vy,METHOD:WebGLRenderingContext.TRIANGLES,UNIFORMS:dG,ATTRIBUTES:[{name:"a_positionStart",size:2,type:Ga},{name:"a_positionEnd",size:2,type:Ga},{name:"a_normal",size:2,type:Ga},{name:"a_color",size:4,type:J1,normalized:!0},{name:"a_id",size:4,type:J1,normalized:!0},{name:"a_radius",size:1,type:Ga}],CONSTANT_ATTRIBUTES:[{name:"a_positionCoef",size:1,type:Ga},{name:"a_normalCoef",size:1,type:Ga},{name:"a_radiusCoef",size:1,type:Ga}],CONSTANT_DATA:[[0,1,0],[0,-1,0],[1,1,1],[1,1,1],[0,-1,0],[1,-1,-1]]}}},{key:"processVisibleItem",value:function(o,s,u,f,d){var p=d.size||1,m=u.x,v=u.y,g=f.x,w=f.y,x=Yr(d.color),k=g-m,C=w-v,_=f.size||1,T=k*k+C*C,N=0,D=0;T&&(T=1/Math.sqrt(T),N=-C*T*p,D=k*T*p);var z=this.array;z[s++]=m,z[s++]=v,z[s++]=g,z[s++]=w,z[s++]=N,z[s++]=D,z[s++]=x,z[s++]=o,z[s++]=_}},{key:"setUniforms",value:function(o,s){var u=s.gl,f=s.uniformLocations,d=f.u_matrix,p=f.u_zoomRatio,m=f.u_feather,v=f.u_pixelRatio,g=f.u_correctionRatio,w=f.u_sizeRatio,x=f.u_minEdgeThickness,k=f.u_lengthToThicknessRatio;u.uniformMatrix3fv(d,!1,o.matrix),u.uniform1f(p,o.zoomRatio),u.uniform1f(w,o.sizeRatio),u.uniform1f(g,o.correctionRatio),u.uniform1f(v,o.pixelRatio),u.uniform1f(m,o.antiAliasingFeather),u.uniform1f(x,o.minEdgeThickness),u.uniform1f(k,t.lengthToThicknessRatio)}}])}(cu)}cA();function pG(e){return aA([cA(),Cf(e)])}var mG=pG(),fA=mG,gG=` -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; -} -`,vG=gG,dA=WebGLRenderingContext,eS=dA.UNSIGNED_BYTE,Rs=dA.FLOAT,yG=["u_matrix","u_zoomRatio","u_sizeRatio","u_correctionRatio","u_pixelRatio","u_feather","u_minEdgeThickness"],bG=function(e){function t(){return tn(this,t),Pn(this,t,arguments)}return Fn(t,e),nn(t,[{key:"getDefinition",value:function(){return{VERTICES:6,VERTEX_SHADER_SOURCE:vG,FRAGMENT_SHADER_SOURCE:vy,METHOD:WebGLRenderingContext.TRIANGLES,UNIFORMS:yG,ATTRIBUTES:[{name:"a_positionStart",size:2,type:Rs},{name:"a_positionEnd",size:2,type:Rs},{name:"a_normal",size:2,type:Rs},{name:"a_color",size:4,type:eS,normalized:!0},{name:"a_id",size:4,type:eS,normalized:!0}],CONSTANT_ATTRIBUTES:[{name:"a_positionCoef",size:1,type:Rs},{name:"a_normalCoef",size:1,type:Rs}],CONSTANT_DATA:[[0,1],[0,-1],[1,1],[1,1],[0,-1],[1,-1]]}}},{key:"processVisibleItem",value:function(r,i,o,s,u){var f=u.size||1,d=o.x,p=o.y,m=s.x,v=s.y,g=Yr(u.color),w=m-d,x=v-p,k=w*w+x*x,C=0,_=0;k&&(k=1/Math.sqrt(k),C=-x*k*f,_=w*k*f);var T=this.array;T[i++]=d,T[i++]=p,T[i++]=m,T[i++]=v,T[i++]=C,T[i++]=_,T[i++]=g,T[i++]=r}},{key:"setUniforms",value:function(r,i){var o=i.gl,s=i.uniformLocations,u=s.u_matrix,f=s.u_zoomRatio,d=s.u_feather,p=s.u_pixelRatio,m=s.u_correctionRatio,v=s.u_sizeRatio,g=s.u_minEdgeThickness;o.uniformMatrix3fv(u,!1,r.matrix),o.uniform1f(f,r.zoomRatio),o.uniform1f(v,r.sizeRatio),o.uniform1f(m,r.correctionRatio),o.uniform1f(p,r.pixelRatio),o.uniform1f(d,r.antiAliasingFeather),o.uniform1f(g,r.minEdgeThickness)}}])}(cu),yy=function(e){function t(){var n;return tn(this,t),n=Pn(this,t),n.rawEmitter=n,n}return Fn(t,e),nn(t)}(MT.EventEmitter),fm,tS;function Wr(){return tS||(tS=1,fm=function(t){return t!==null&&typeof t=="object"&&typeof t.addUndirectedEdgeWithKey=="function"&&typeof t.dropNode=="function"&&typeof t.multi=="boolean"}),fm}var xG=Wr();const wG=fn(xG);var SG=function(t){return t},EG=function(t){return t*t},_G=function(t){return t*(2-t)},kG=function(t){return(t*=2)<1?.5*t*t:-.5*(--t*(t-2)-1)},CG=function(t){return t*t*t},TG=function(t){return--t*t*t+1},AG=function(t){return(t*=2)<1?.5*t*t*t:.5*((t-=2)*t*t+2)},hA={linear:SG,quadraticIn:EG,quadraticOut:_G,quadraticInOut:kG,cubicIn:CG,cubicOut:TG,cubicInOut:AG},pA={easing:"quadraticInOut",duration:150};function RG(e,t,n,r){var i=Object.assign({},pA,n),o=typeof i.easing=="function"?i.easing:hA[i.easing],s=Date.now(),u={};for(var f in t){var d=t[f];u[f]={};for(var p in d)u[f][p]=e.getNodeAttribute(f,p)}var m=null,v=function(){m=null;var w=(Date.now()-s)/i.duration;if(w>=1){for(var x in t){var k=t[x];for(var C in k)e.setNodeAttribute(x,C,k[C])}return}w=o(w);for(var _ in t){var T=t[_],N=u[_];for(var D in T)e.setNodeAttribute(_,D,T[D]*w+N[D]*(1-w))}m=requestAnimationFrame(v)};return v(),function(){m&&cancelAnimationFrame(m)}}function Er(){return Float32Array.of(1,0,0,0,1,0,0,0,1)}function Bc(e,t,n){return e[0]=t,e[4]=typeof n=="number"?n:t,e}function nS(e,t){var n=Math.sin(t),r=Math.cos(t);return e[0]=r,e[1]=n,e[3]=-n,e[4]=r,e}function rS(e,t,n){return e[6]=t,e[7]=n,e}function ea(e,t){var n=e[0],r=e[1],i=e[2],o=e[3],s=e[4],u=e[5],f=e[6],d=e[7],p=e[8],m=t[0],v=t[1],g=t[2],w=t[3],x=t[4],k=t[5],C=t[6],_=t[7],T=t[8];return e[0]=m*n+v*o+g*f,e[1]=m*r+v*s+g*d,e[2]=m*i+v*u+g*p,e[3]=w*n+x*o+k*f,e[4]=w*r+x*s+k*d,e[5]=w*i+x*u+k*p,e[6]=C*n+_*o+T*f,e[7]=C*r+_*s+T*d,e[8]=C*i+_*u+T*p,e}function Ug(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,r=e[0],i=e[1],o=e[3],s=e[4],u=e[6],f=e[7],d=t.x,p=t.y;return{x:d*r+p*o+u*n,y:d*i+p*s+f*n}}function DG(e,t){var n=e.height/e.width,r=t.height/t.width;return n<1&&r>1||n>1&&r<1?1:Math.min(Math.max(r,1/r),Math.max(1/n,n))}function Ds(e,t,n,r,i){var o=e.angle,s=e.ratio,u=e.x,f=e.y,d=t.width,p=t.height,m=Er(),v=Math.min(d,p)-2*r,g=DG(t,n);return i?(ea(m,rS(Er(),u,f)),ea(m,Bc(Er(),s)),ea(m,nS(Er(),o)),ea(m,Bc(Er(),d/v/2/g,p/v/2/g))):(ea(m,Bc(Er(),2*(v/d)*g,2*(v/p)*g)),ea(m,nS(Er(),-o)),ea(m,Bc(Er(),1/s)),ea(m,rS(Er(),-u,-f))),m}function NG(e,t,n){var r=Ug(e,{x:Math.cos(t.angle),y:Math.sin(t.angle)},0),i=r.x,o=r.y;return 1/Math.sqrt(Math.pow(i,2)+Math.pow(o,2))/n.width}function OG(e){if(!e.order)return{x:[0,1],y:[0,1]};var t=1/0,n=-1/0,r=1/0,i=-1/0;return e.forEachNode(function(o,s){var u=s.x,f=s.y;un&&(n=u),fi&&(i=f)}),{x:[t,n],y:[r,i]}}function LG(e){if(!wG(e))throw new Error("Sigma: invalid graph instance.");e.forEachNode(function(t,n){if(!Number.isFinite(n.x)||!Number.isFinite(n.y))throw new Error("Sigma: Coordinates of node ".concat(t," are invalid. A node must have a numeric 'x' and 'y' attribute."))})}function zG(e,t,n){var r=document.createElement(e);if(t)for(var i in t)r.style[i]=t[i];if(n)for(var o in n)r.setAttribute(o,n[o]);return r}function iS(){return typeof window.devicePixelRatio<"u"?window.devicePixelRatio:1}function aS(e,t,n){return n.sort(function(r,i){var o=t(r)||0,s=t(i)||0;return os?1:0})}function oS(e){var t=fl(e.x,2),n=t[0],r=t[1],i=fl(e.y,2),o=i[0],s=i[1],u=Math.max(r-n,s-o),f=(r+n)/2,d=(s+o)/2;(u===0||Math.abs(u)===1/0||isNaN(u))&&(u=1),isNaN(f)&&(f=0),isNaN(d)&&(d=0);var p=function(v){return{x:.5+(v.x-f)/u,y:.5+(v.y-d)/u}};return p.applyTo=function(m){m.x=.5+(m.x-f)/u,m.y=.5+(m.y-d)/u},p.inverse=function(m){return{x:f+u*(m.x-.5),y:d+u*(m.y-.5)}},p.ratio=u,p}function Hg(e){"@babel/helpers - typeof";return Hg=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Hg(e)}function lS(e,t){var n=t.size;if(n!==0){var r=e.length;e.length+=n;var i=0;t.forEach(function(o){e[r+i]=o,i++})}}function dm(e){e=e||{};for(var t=0,n=arguments.length<=1?0:arguments.length-1;t1&&arguments[1]!==void 0?arguments[1]:{},s=arguments.length>2?arguments[2]:void 0;if(!s)return new Promise(function(g){return i.animate(r,o,g)});if(this.enabled){var u=Fe(Fe({},pA),o),f=this.validateState(r),d=typeof u.easing=="function"?u.easing:hA[u.easing],p=Date.now(),m=this.getState(),v=function(){var w=(Date.now()-p)/u.duration;if(w>=1){i.nextFrame=null,i.setState(f),i.animationCallback&&(i.animationCallback.call(null),i.animationCallback=void 0);return}var x=d(w),k={};typeof f.x=="number"&&(k.x=m.x+(f.x-m.x)*x),typeof f.y=="number"&&(k.y=m.y+(f.y-m.y)*x),i.enabledRotation&&typeof f.angle=="number"&&(k.angle=m.angle+(f.angle-m.angle)*x),typeof f.ratio=="number"&&(k.ratio=m.ratio+(f.ratio-m.ratio)*x),i.setState(k),i.nextFrame=requestAnimationFrame(v)};this.nextFrame?(cancelAnimationFrame(this.nextFrame),this.animationCallback&&this.animationCallback.call(null),this.nextFrame=requestAnimationFrame(v)):v(),this.animationCallback=s}}},{key:"animatedZoom",value:function(r){return r?typeof r=="number"?this.animate({ratio:this.ratio/r}):this.animate({ratio:this.ratio/(r.factor||Uc)},r):this.animate({ratio:this.ratio/Uc})}},{key:"animatedUnzoom",value:function(r){return r?typeof r=="number"?this.animate({ratio:this.ratio*r}):this.animate({ratio:this.ratio*(r.factor||Uc)},r):this.animate({ratio:this.ratio*Uc})}},{key:"animatedReset",value:function(r){return this.animate({x:.5,y:.5,ratio:1,angle:0},r)}},{key:"copy",value:function(){return t.from(this.getState())}}],[{key:"from",value:function(r){var i=new t;return i.setState(r)}}])}(yy);function kr(e,t){var n=t.getBoundingClientRect();return{x:e.clientX-n.left,y:e.clientY-n.top}}function yi(e,t){var n=Fe(Fe({},kr(e,t)),{},{sigmaDefaultPrevented:!1,preventSigmaDefault:function(){n.sigmaDefaultPrevented=!0},original:e});return n}function Ns(e){var t="x"in e?e:Fe(Fe({},e.touches[0]||e.previousTouches[0]),{},{original:e.original,sigmaDefaultPrevented:e.sigmaDefaultPrevented,preventSigmaDefault:function(){e.sigmaDefaultPrevented=!0,t.sigmaDefaultPrevented=!0}});return t}function FG(e,t){return Fe(Fe({},yi(e,t)),{},{delta:mA(e)})}var IG=2;function uf(e){for(var t=[],n=0,r=Math.min(e.length,IG);n0;i.draggedEvents=0,m&&i.renderer.getSetting("hideEdgesOnMove")&&i.renderer.refresh()},0),this.emit("mouseup",yi(r,this.container))}}},{key:"handleMove",value:function(r){var i=this;if(this.enabled){var o=yi(r,this.container);if(this.emit("mousemovebody",o),(r.target===this.container||r.composedPath()[0]===this.container)&&this.emit("mousemove",o),!o.sigmaDefaultPrevented&&this.isMouseDown){this.isMoving=!0,this.draggedEvents++,typeof this.movingTimeout=="number"&&clearTimeout(this.movingTimeout),this.movingTimeout=window.setTimeout(function(){i.movingTimeout=null,i.isMoving=!1},this.settings.dragTimeout);var s=this.renderer.getCamera(),u=kr(r,this.container),f=u.x,d=u.y,p=this.renderer.viewportToFramedGraph({x:this.lastMouseX,y:this.lastMouseY}),m=this.renderer.viewportToFramedGraph({x:f,y:d}),v=p.x-m.x,g=p.y-m.y,w=s.getState(),x=w.x+v,k=w.y+g;s.setState({x,y:k}),this.lastMouseX=f,this.lastMouseY=d,r.preventDefault(),r.stopPropagation()}}}},{key:"handleLeave",value:function(r){this.emit("mouseleave",yi(r,this.container))}},{key:"handleEnter",value:function(r){this.emit("mouseenter",yi(r,this.container))}},{key:"handleWheel",value:function(r){var i=this,o=this.renderer.getCamera();if(!(!this.enabled||!o.enabledZooming)){var s=mA(r);if(s){var u=FG(r,this.container);if(this.emit("wheel",u),u.sigmaDefaultPrevented){r.preventDefault(),r.stopPropagation();return}var f=o.getState().ratio,d=s>0?1/this.settings.zoomingRatio:this.settings.zoomingRatio,p=o.getBoundedRatio(f*d),m=s>0?1:-1,v=Date.now();f!==p&&(r.preventDefault(),r.stopPropagation(),!(this.currentWheelDirection===m&&this.lastWheelTriggerTime&&v-this.lastWheelTriggerTimer.size?-1:n.sizer.key?1:-1}}])}(),fS=function(){function e(){tn(this,e),ke(this,"width",0),ke(this,"height",0),ke(this,"cellSize",0),ke(this,"columns",0),ke(this,"rows",0),ke(this,"cells",{})}return nn(e,[{key:"resizeAndClear",value:function(n,r){this.width=n.width,this.height=n.height,this.cellSize=r,this.columns=Math.ceil(n.width/r),this.rows=Math.ceil(n.height/r),this.cells={}}},{key:"getIndex",value:function(n){var r=Math.floor(n.x/this.cellSize),i=Math.floor(n.y/this.cellSize);return i*this.columns+r}},{key:"add",value:function(n,r,i){var o=new cS(n,r),s=this.getIndex(i),u=this.cells[s];u||(u=[],this.cells[s]=u),u.push(o)}},{key:"organize",value:function(){for(var n in this.cells){var r=this.cells[n];r.sort(cS.compare)}}},{key:"getLabelsToDisplay",value:function(n,r){var i=this.cellSize*this.cellSize,o=i/n/n,s=o*r/i,u=Math.ceil(s),f=[];for(var d in this.cells)for(var p=this.cells[d],m=0;m2&&arguments[2]!==void 0?arguments[2]:{};if(tn(this,t),i=Pn(this,t),ke(i,"elements",{}),ke(i,"canvasContexts",{}),ke(i,"webGLContexts",{}),ke(i,"pickingLayers",new Set),ke(i,"textures",{}),ke(i,"frameBuffers",{}),ke(i,"activeListeners",{}),ke(i,"labelGrid",new fS),ke(i,"nodeDataCache",{}),ke(i,"edgeDataCache",{}),ke(i,"nodeProgramIndex",{}),ke(i,"edgeProgramIndex",{}),ke(i,"nodesWithForcedLabels",new Set),ke(i,"edgesWithForcedLabels",new Set),ke(i,"nodeExtent",{x:[0,1],y:[0,1]}),ke(i,"nodeZExtent",[1/0,-1/0]),ke(i,"edgeZExtent",[1/0,-1/0]),ke(i,"matrix",Er()),ke(i,"invMatrix",Er()),ke(i,"correctionRatio",1),ke(i,"customBBox",null),ke(i,"normalizationFunction",oS({x:[0,1],y:[0,1]})),ke(i,"graphToViewportRatio",1),ke(i,"itemIDsIndex",{}),ke(i,"nodeIndices",{}),ke(i,"edgeIndices",{}),ke(i,"width",0),ke(i,"height",0),ke(i,"pixelRatio",iS()),ke(i,"pickingDownSizingRatio",2*i.pixelRatio),ke(i,"displayedNodeLabels",new Set),ke(i,"displayedEdgeLabels",new Set),ke(i,"highlightedNodes",new Set),ke(i,"hoveredNode",null),ke(i,"hoveredEdge",null),ke(i,"renderFrame",null),ke(i,"renderHighlightedNodesFrame",null),ke(i,"needToProcess",!1),ke(i,"checkEdgesEventsFrame",null),ke(i,"nodePrograms",{}),ke(i,"nodeHoverPrograms",{}),ke(i,"edgePrograms",{}),i.settings=PG(o),hm(i.settings),LG(n),!(r instanceof HTMLElement))throw new Error("Sigma: container should be an html element.");i.graph=n,i.container=r,i.createWebGLContext("edges",{picking:o.enableEdgeEvents}),i.createCanvasContext("edgeLabels"),i.createWebGLContext("nodes",{picking:!0}),i.createCanvasContext("labels"),i.createCanvasContext("hovers"),i.createWebGLContext("hoverNodes"),i.createCanvasContext("mouse",{style:{touchAction:"none",userSelect:"none"}}),i.resize();for(var s in i.settings.nodeProgramClasses)i.registerNodeProgram(s,i.settings.nodeProgramClasses[s],i.settings.nodeHoverProgramClasses[s]);for(var u in i.settings.edgeProgramClasses)i.registerEdgeProgram(u,i.settings.edgeProgramClasses[u]);return i.camera=new sS,i.bindCameraHandlers(),i.mouseCaptor=new UG(i.elements.mouse,i),i.mouseCaptor.setSettings(i.settings),i.touchCaptor=new VG(i.elements.mouse,i),i.touchCaptor.setSettings(i.settings),i.bindEventHandlers(),i.bindGraphHandlers(),i.handleSettingsUpdate(),i.refresh(),i}return Fn(t,e),nn(t,[{key:"registerNodeProgram",value:function(r,i,o){return this.nodePrograms[r]&&this.nodePrograms[r].kill(),this.nodeHoverPrograms[r]&&this.nodeHoverPrograms[r].kill(),this.nodePrograms[r]=new i(this.webGLContexts.nodes,this.frameBuffers.nodes,this),this.nodeHoverPrograms[r]=new(o||i)(this.webGLContexts.hoverNodes,null,this),this}},{key:"registerEdgeProgram",value:function(r,i){return this.edgePrograms[r]&&this.edgePrograms[r].kill(),this.edgePrograms[r]=new i(this.webGLContexts.edges,this.frameBuffers.edges,this),this}},{key:"unregisterNodeProgram",value:function(r){if(this.nodePrograms[r]){var i=this.nodePrograms,o=i[r],s=pm(i,[r].map(Gs));o.kill(),this.nodePrograms=s}if(this.nodeHoverPrograms[r]){var u=this.nodeHoverPrograms,f=u[r],d=pm(u,[r].map(Gs));f.kill(),this.nodePrograms=d}return this}},{key:"unregisterEdgeProgram",value:function(r){if(this.edgePrograms[r]){var i=this.edgePrograms,o=i[r],s=pm(i,[r].map(Gs));o.kill(),this.edgePrograms=s}return this}},{key:"resetWebGLTexture",value:function(r){var i=this.webGLContexts[r],o=this.frameBuffers[r],s=this.textures[r];s&&i.deleteTexture(s);var u=i.createTexture();return i.bindFramebuffer(i.FRAMEBUFFER,o),i.bindTexture(i.TEXTURE_2D,u),i.texImage2D(i.TEXTURE_2D,0,i.RGBA,this.width,this.height,0,i.RGBA,i.UNSIGNED_BYTE,null),i.framebufferTexture2D(i.FRAMEBUFFER,i.COLOR_ATTACHMENT0,i.TEXTURE_2D,u,0),this.textures[r]=u,this}},{key:"bindCameraHandlers",value:function(){var r=this;return this.activeListeners.camera=function(){r.scheduleRender()},this.camera.on("updated",this.activeListeners.camera),this}},{key:"unbindCameraHandlers",value:function(){return this.camera.removeListener("updated",this.activeListeners.camera),this}},{key:"getNodeAtPosition",value:function(r){var i=r.x,o=r.y,s=q1(this.webGLContexts.nodes,this.frameBuffers.nodes,i,o,this.pixelRatio,this.pickingDownSizingRatio),u=V1.apply(void 0,uS(s)),f=this.itemIDsIndex[u];return f&&f.type==="node"?f.id:null}},{key:"bindEventHandlers",value:function(){var r=this;this.activeListeners.handleResize=function(){r.scheduleRefresh()},window.addEventListener("resize",this.activeListeners.handleResize),this.activeListeners.handleMove=function(o){var s=Ns(o),u={event:s,preventSigmaDefault:function(){s.preventSigmaDefault()}},f=r.getNodeAtPosition(s);if(f&&r.hoveredNode!==f&&!r.nodeDataCache[f].hidden){r.hoveredNode&&r.emit("leaveNode",Fe(Fe({},u),{},{node:r.hoveredNode})),r.hoveredNode=f,r.emit("enterNode",Fe(Fe({},u),{},{node:f})),r.scheduleHighlightedNodesRender();return}if(r.hoveredNode&&r.getNodeAtPosition(s)!==r.hoveredNode){var d=r.hoveredNode;r.hoveredNode=null,r.emit("leaveNode",Fe(Fe({},u),{},{node:d})),r.scheduleHighlightedNodesRender();return}if(r.settings.enableEdgeEvents){var p=r.hoveredNode?null:r.getEdgeAtPoint(u.event.x,u.event.y);p!==r.hoveredEdge&&(r.hoveredEdge&&r.emit("leaveEdge",Fe(Fe({},u),{},{edge:r.hoveredEdge})),p&&r.emit("enterEdge",Fe(Fe({},u),{},{edge:p})),r.hoveredEdge=p)}},this.activeListeners.handleMoveBody=function(o){var s=Ns(o);r.emit("moveBody",{event:s,preventSigmaDefault:function(){s.preventSigmaDefault()}})},this.activeListeners.handleLeave=function(o){var s=Ns(o),u={event:s,preventSigmaDefault:function(){s.preventSigmaDefault()}};r.hoveredNode&&(r.emit("leaveNode",Fe(Fe({},u),{},{node:r.hoveredNode})),r.scheduleHighlightedNodesRender()),r.settings.enableEdgeEvents&&r.hoveredEdge&&(r.emit("leaveEdge",Fe(Fe({},u),{},{edge:r.hoveredEdge})),r.scheduleHighlightedNodesRender()),r.emit("leaveStage",Fe({},u))},this.activeListeners.handleEnter=function(o){var s=Ns(o),u={event:s,preventSigmaDefault:function(){s.preventSigmaDefault()}};r.emit("enterStage",Fe({},u))};var i=function(s){return function(u){var f=Ns(u),d={event:f,preventSigmaDefault:function(){f.preventSigmaDefault()}},p=r.getNodeAtPosition(f);if(p)return r.emit("".concat(s,"Node"),Fe(Fe({},d),{},{node:p}));if(r.settings.enableEdgeEvents){var m=r.getEdgeAtPoint(f.x,f.y);if(m)return r.emit("".concat(s,"Edge"),Fe(Fe({},d),{},{edge:m}))}return r.emit("".concat(s,"Stage"),d)}};return this.activeListeners.handleClick=i("click"),this.activeListeners.handleRightClick=i("rightClick"),this.activeListeners.handleDoubleClick=i("doubleClick"),this.activeListeners.handleWheel=i("wheel"),this.activeListeners.handleDown=i("down"),this.activeListeners.handleUp=i("up"),this.mouseCaptor.on("mousemove",this.activeListeners.handleMove),this.mouseCaptor.on("mousemovebody",this.activeListeners.handleMoveBody),this.mouseCaptor.on("click",this.activeListeners.handleClick),this.mouseCaptor.on("rightClick",this.activeListeners.handleRightClick),this.mouseCaptor.on("doubleClick",this.activeListeners.handleDoubleClick),this.mouseCaptor.on("wheel",this.activeListeners.handleWheel),this.mouseCaptor.on("mousedown",this.activeListeners.handleDown),this.mouseCaptor.on("mouseup",this.activeListeners.handleUp),this.mouseCaptor.on("mouseleave",this.activeListeners.handleLeave),this.mouseCaptor.on("mouseenter",this.activeListeners.handleEnter),this.touchCaptor.on("touchdown",this.activeListeners.handleDown),this.touchCaptor.on("touchdown",this.activeListeners.handleMove),this.touchCaptor.on("touchup",this.activeListeners.handleUp),this.touchCaptor.on("touchmove",this.activeListeners.handleMove),this.touchCaptor.on("tap",this.activeListeners.handleClick),this.touchCaptor.on("doubletap",this.activeListeners.handleDoubleClick),this.touchCaptor.on("touchmove",this.activeListeners.handleMoveBody),this}},{key:"bindGraphHandlers",value:function(){var r=this,i=this.graph,o=new Set(["x","y","zIndex","type"]);return this.activeListeners.eachNodeAttributesUpdatedGraphUpdate=function(s){var u,f=(u=s.hints)===null||u===void 0?void 0:u.attributes;r.graph.forEachNode(function(p){return r.updateNode(p)});var d=!f||f.some(function(p){return o.has(p)});r.refresh({partialGraph:{nodes:i.nodes()},skipIndexation:!d,schedule:!0})},this.activeListeners.eachEdgeAttributesUpdatedGraphUpdate=function(s){var u,f=(u=s.hints)===null||u===void 0?void 0:u.attributes;r.graph.forEachEdge(function(p){return r.updateEdge(p)});var d=f&&["zIndex","type"].some(function(p){return f==null?void 0:f.includes(p)});r.refresh({partialGraph:{edges:i.edges()},skipIndexation:!d,schedule:!0})},this.activeListeners.addNodeGraphUpdate=function(s){var u=s.key;r.addNode(u),r.refresh({partialGraph:{nodes:[u]},skipIndexation:!1,schedule:!0})},this.activeListeners.updateNodeGraphUpdate=function(s){var u=s.key;r.refresh({partialGraph:{nodes:[u]},skipIndexation:!1,schedule:!0})},this.activeListeners.dropNodeGraphUpdate=function(s){var u=s.key;r.removeNode(u),r.refresh({schedule:!0})},this.activeListeners.addEdgeGraphUpdate=function(s){var u=s.key;r.addEdge(u),r.refresh({partialGraph:{edges:[u]},schedule:!0})},this.activeListeners.updateEdgeGraphUpdate=function(s){var u=s.key;r.refresh({partialGraph:{edges:[u]},skipIndexation:!1,schedule:!0})},this.activeListeners.dropEdgeGraphUpdate=function(s){var u=s.key;r.removeEdge(u),r.refresh({schedule:!0})},this.activeListeners.clearEdgesGraphUpdate=function(){r.clearEdgeState(),r.clearEdgeIndices(),r.refresh({schedule:!0})},this.activeListeners.clearGraphUpdate=function(){r.clearEdgeState(),r.clearNodeState(),r.clearEdgeIndices(),r.clearNodeIndices(),r.refresh({schedule:!0})},i.on("nodeAdded",this.activeListeners.addNodeGraphUpdate),i.on("nodeDropped",this.activeListeners.dropNodeGraphUpdate),i.on("nodeAttributesUpdated",this.activeListeners.updateNodeGraphUpdate),i.on("eachNodeAttributesUpdated",this.activeListeners.eachNodeAttributesUpdatedGraphUpdate),i.on("edgeAdded",this.activeListeners.addEdgeGraphUpdate),i.on("edgeDropped",this.activeListeners.dropEdgeGraphUpdate),i.on("edgeAttributesUpdated",this.activeListeners.updateEdgeGraphUpdate),i.on("eachEdgeAttributesUpdated",this.activeListeners.eachEdgeAttributesUpdatedGraphUpdate),i.on("edgesCleared",this.activeListeners.clearEdgesGraphUpdate),i.on("cleared",this.activeListeners.clearGraphUpdate),this}},{key:"unbindGraphHandlers",value:function(){var r=this.graph;r.removeListener("nodeAdded",this.activeListeners.addNodeGraphUpdate),r.removeListener("nodeDropped",this.activeListeners.dropNodeGraphUpdate),r.removeListener("nodeAttributesUpdated",this.activeListeners.updateNodeGraphUpdate),r.removeListener("eachNodeAttributesUpdated",this.activeListeners.eachNodeAttributesUpdatedGraphUpdate),r.removeListener("edgeAdded",this.activeListeners.addEdgeGraphUpdate),r.removeListener("edgeDropped",this.activeListeners.dropEdgeGraphUpdate),r.removeListener("edgeAttributesUpdated",this.activeListeners.updateEdgeGraphUpdate),r.removeListener("eachEdgeAttributesUpdated",this.activeListeners.eachEdgeAttributesUpdatedGraphUpdate),r.removeListener("edgesCleared",this.activeListeners.clearEdgesGraphUpdate),r.removeListener("cleared",this.activeListeners.clearGraphUpdate)}},{key:"getEdgeAtPoint",value:function(r,i){var o=q1(this.webGLContexts.edges,this.frameBuffers.edges,r,i,this.pixelRatio,this.pickingDownSizingRatio),s=V1.apply(void 0,uS(o)),u=this.itemIDsIndex[s];return u&&u.type==="edge"?u.id:null}},{key:"process",value:function(){var r=this;this.emit("beforeProcess");var i=this.graph,o=this.settings,s=this.getDimensions();if(this.nodeExtent=OG(this.graph),!this.settings.autoRescale){var u=s.width,f=s.height,d=this.nodeExtent,p=d.x,m=d.y;this.nodeExtent={x:[(p[0]+p[1])/2-u/2,(p[0]+p[1])/2+u/2],y:[(m[0]+m[1])/2-f/2,(m[0]+m[1])/2+f/2]}}this.normalizationFunction=oS(this.customBBox||this.nodeExtent);var v=new sS,g=Ds(v.getState(),s,this.getGraphDimensions(),this.getStagePadding());this.labelGrid.resizeAndClear(s,o.labelGridCellSize);for(var w={},x={},k={},C={},_=1,T=i.nodes(),N=0,D=T.length;N1&&arguments[1]!==void 0?arguments[1]:{},o=i.tolerance,s=o===void 0?0:o,u=i.boundaries,f=Fe({},r),d=u||this.nodeExtent,p=fl(d.x,2),m=p[0],v=p[1],g=fl(d.y,2),w=g[0],x=g[1],k=[this.graphToViewport({x:m,y:w},{cameraState:r}),this.graphToViewport({x:v,y:w},{cameraState:r}),this.graphToViewport({x:m,y:x},{cameraState:r}),this.graphToViewport({x:v,y:x},{cameraState:r})],C=1/0,_=-1/0,T=1/0,N=-1/0;k.forEach(function(Y){var Z=Y.x,U=Y.y;C=Math.min(C,Z),_=Math.max(_,Z),T=Math.min(T,U),N=Math.max(N,U)});var D=_-C,z=N-T,R=this.getDimensions(),B=R.width,P=R.height,j=0,V=0;if(D>=B?_s&&(j=C-s):_>B+s?j=_-(B+s):C<-s&&(j=C+s),z>=P?Ns&&(V=T-s):N>P+s?V=N-(P+s):T<-s&&(V=T+s),j||V){var q=this.viewportToFramedGraph({x:0,y:0},{cameraState:r}),I=this.viewportToFramedGraph({x:j,y:V},{cameraState:r});j=I.x-q.x,V=I.y-q.y,f.x+=j,f.y+=V}return f}},{key:"renderLabels",value:function(){if(!this.settings.renderLabels)return this;var r=this.camera.getState(),i=this.labelGrid.getLabelsToDisplay(r.ratio,this.settings.labelDensity);lS(i,this.nodesWithForcedLabels),this.displayedNodeLabels=new Set;for(var o=this.canvasContexts.labels,s=0,u=i.length;sthis.width+ZG||v<-50||v>this.height+QG)){this.displayedNodeLabels.add(f);var w=this.settings.defaultDrawNodeLabel,x=this.nodePrograms[d.type],k=(x==null?void 0:x.drawLabel)||w;k(o,Fe(Fe({key:f},d),{},{size:g,x:m,y:v}),this.settings)}}}return this}},{key:"renderEdgeLabels",value:function(){if(!this.settings.renderEdgeLabels)return this;var r=this.canvasContexts.edgeLabels;r.clearRect(0,0,this.width,this.height);var i=KG({graph:this.graph,hoveredNode:this.hoveredNode,displayedNodeLabels:this.displayedNodeLabels,highlightedNodes:this.highlightedNodes});lS(i,this.edgesWithForcedLabels);for(var o=new Set,s=0,u=i.length;sthis.nodeZExtent[1]&&(this.nodeZExtent[1]=o.zIndex))}},{key:"updateNode",value:function(r){this.addNode(r);var i=this.nodeDataCache[r];this.normalizationFunction.applyTo(i)}},{key:"removeNode",value:function(r){delete this.nodeDataCache[r],delete this.nodeProgramIndex[r],this.highlightedNodes.delete(r),this.hoveredNode===r&&(this.hoveredNode=null),this.nodesWithForcedLabels.delete(r)}},{key:"addEdge",value:function(r){var i=Object.assign({},this.graph.getEdgeAttributes(r));this.settings.edgeReducer&&(i=this.settings.edgeReducer(r,i));var o=eB(this.settings,r,i);this.edgeDataCache[r]=o,this.edgesWithForcedLabels.delete(r),o.forceLabel&&!o.hidden&&this.edgesWithForcedLabels.add(r),this.settings.zIndex&&(o.zIndexthis.edgeZExtent[1]&&(this.edgeZExtent[1]=o.zIndex))}},{key:"updateEdge",value:function(r){this.addEdge(r)}},{key:"removeEdge",value:function(r){delete this.edgeDataCache[r],delete this.edgeProgramIndex[r],this.hoveredEdge===r&&(this.hoveredEdge=null),this.edgesWithForcedLabels.delete(r)}},{key:"clearNodeIndices",value:function(){this.labelGrid=new fS,this.nodeExtent={x:[0,1],y:[0,1]},this.nodeDataCache={},this.edgeProgramIndex={},this.nodesWithForcedLabels=new Set,this.nodeZExtent=[1/0,-1/0]}},{key:"clearEdgeIndices",value:function(){this.edgeDataCache={},this.edgeProgramIndex={},this.edgesWithForcedLabels=new Set,this.edgeZExtent=[1/0,-1/0]}},{key:"clearIndices",value:function(){this.clearEdgeIndices(),this.clearNodeIndices()}},{key:"clearNodeState",value:function(){this.displayedNodeLabels=new Set,this.highlightedNodes=new Set,this.hoveredNode=null}},{key:"clearEdgeState",value:function(){this.displayedEdgeLabels=new Set,this.highlightedNodes=new Set,this.hoveredEdge=null}},{key:"clearState",value:function(){this.clearEdgeState(),this.clearNodeState()}},{key:"addNodeToProgram",value:function(r,i,o){var s=this.nodeDataCache[r],u=this.nodePrograms[s.type];if(!u)throw new Error('Sigma: could not find a suitable program for node type "'.concat(s.type,'"!'));u.process(i,o,s),this.nodeProgramIndex[r]=o}},{key:"addEdgeToProgram",value:function(r,i,o){var s=this.edgeDataCache[r],u=this.edgePrograms[s.type];if(!u)throw new Error('Sigma: could not find a suitable program for edge type "'.concat(s.type,'"!'));var f=this.graph.extremities(r),d=this.nodeDataCache[f[0]],p=this.nodeDataCache[f[1]];u.process(i,o,d,p,s),this.edgeProgramIndex[r]=o}},{key:"getRenderParams",value:function(){return{matrix:this.matrix,invMatrix:this.invMatrix,width:this.width,height:this.height,pixelRatio:this.pixelRatio,zoomRatio:this.camera.ratio,cameraAngle:this.camera.angle,sizeRatio:1/this.scaleSize(),correctionRatio:this.correctionRatio,downSizingRatio:this.pickingDownSizingRatio,minEdgeThickness:this.settings.minEdgeThickness,antiAliasingFeather:this.settings.antiAliasingFeather}}},{key:"getStagePadding",value:function(){var r=this.settings,i=r.stagePadding,o=r.autoRescale;return o&&i||0}},{key:"createLayer",value:function(r,i){var o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(this.elements[r])throw new Error('Sigma: a layer named "'.concat(r,'" already exists'));var s=zG(i,{position:"absolute"},{class:"sigma-".concat(r)});return o.style&&Object.assign(s.style,o.style),this.elements[r]=s,"beforeLayer"in o&&o.beforeLayer?this.elements[o.beforeLayer].before(s):"afterLayer"in o&&o.afterLayer?this.elements[o.afterLayer].after(s):this.container.appendChild(s),s}},{key:"createCanvas",value:function(r){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return this.createLayer(r,"canvas",i)}},{key:"createCanvasContext",value:function(r){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=this.createCanvas(r,i),s={preserveDrawingBuffer:!1,antialias:!1};return this.canvasContexts[r]=o.getContext("2d",s),this}},{key:"createWebGLContext",value:function(r){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=(i==null?void 0:i.canvas)||this.createCanvas(r,i);i.hidden&&o.remove();var s=Fe({preserveDrawingBuffer:!1,antialias:!1},i),u;u=o.getContext("webgl2",s),u||(u=o.getContext("webgl",s)),u||(u=o.getContext("experimental-webgl",s));var f=u;if(this.webGLContexts[r]=f,f.blendFunc(f.ONE,f.ONE_MINUS_SRC_ALPHA),i.picking){this.pickingLayers.add(r);var d=f.createFramebuffer();if(!d)throw new Error("Sigma: cannot create a new frame buffer for layer ".concat(r));this.frameBuffers[r]=d}return f}},{key:"killLayer",value:function(r){var i=this.elements[r];if(!i)throw new Error("Sigma: cannot kill layer ".concat(r,", which does not exist"));if(this.webGLContexts[r]){var o,s=this.webGLContexts[r];(o=s.getExtension("WEBGL_lose_context"))===null||o===void 0||o.loseContext(),delete this.webGLContexts[r]}else this.canvasContexts[r]&&delete this.canvasContexts[r];return i.remove(),delete this.elements[r],this}},{key:"getCamera",value:function(){return this.camera}},{key:"setCamera",value:function(r){this.unbindCameraHandlers(),this.camera=r,this.bindCameraHandlers()}},{key:"getContainer",value:function(){return this.container}},{key:"getGraph",value:function(){return this.graph}},{key:"setGraph",value:function(r){r!==this.graph&&(this.hoveredNode&&!r.hasNode(this.hoveredNode)&&(this.hoveredNode=null),this.hoveredEdge&&!r.hasEdge(this.hoveredEdge)&&(this.hoveredEdge=null),this.unbindGraphHandlers(),this.checkEdgesEventsFrame!==null&&(cancelAnimationFrame(this.checkEdgesEventsFrame),this.checkEdgesEventsFrame=null),this.graph=r,this.bindGraphHandlers(),this.refresh())}},{key:"getMouseCaptor",value:function(){return this.mouseCaptor}},{key:"getTouchCaptor",value:function(){return this.touchCaptor}},{key:"getDimensions",value:function(){return{width:this.width,height:this.height}}},{key:"getGraphDimensions",value:function(){var r=this.customBBox||this.nodeExtent;return{width:r.x[1]-r.x[0]||1,height:r.y[1]-r.y[0]||1}}},{key:"getNodeDisplayData",value:function(r){var i=this.nodeDataCache[r];return i?Object.assign({},i):void 0}},{key:"getEdgeDisplayData",value:function(r){var i=this.edgeDataCache[r];return i?Object.assign({},i):void 0}},{key:"getNodeDisplayedLabels",value:function(){return new Set(this.displayedNodeLabels)}},{key:"getEdgeDisplayedLabels",value:function(){return new Set(this.displayedEdgeLabels)}},{key:"getSettings",value:function(){return Fe({},this.settings)}},{key:"getSetting",value:function(r){return this.settings[r]}},{key:"setSetting",value:function(r,i){var o=Fe({},this.settings);return this.settings[r]=i,hm(this.settings),this.handleSettingsUpdate(o),this.scheduleRefresh(),this}},{key:"updateSetting",value:function(r,i){return this.setSetting(r,i(this.settings[r])),this}},{key:"setSettings",value:function(r){var i=Fe({},this.settings);return this.settings=Fe(Fe({},this.settings),r),hm(this.settings),this.handleSettingsUpdate(i),this.scheduleRefresh(),this}},{key:"resize",value:function(r){var i=this.width,o=this.height;if(this.width=this.container.offsetWidth,this.height=this.container.offsetHeight,this.pixelRatio=iS(),this.width===0)if(this.settings.allowInvalidContainer)this.width=1;else throw new Error("Sigma: Container has no width. You can set the allowInvalidContainer setting to true to stop seeing this error.");if(this.height===0)if(this.settings.allowInvalidContainer)this.height=1;else throw new Error("Sigma: Container has no height. You can set the allowInvalidContainer setting to true to stop seeing this error.");if(!r&&i===this.width&&o===this.height)return this;for(var s in this.elements){var u=this.elements[s];u.style.width=this.width+"px",u.style.height=this.height+"px"}for(var f in this.canvasContexts)this.elements[f].setAttribute("width",this.width*this.pixelRatio+"px"),this.elements[f].setAttribute("height",this.height*this.pixelRatio+"px"),this.pixelRatio!==1&&this.canvasContexts[f].scale(this.pixelRatio,this.pixelRatio);for(var d in this.webGLContexts){this.elements[d].setAttribute("width",this.width*this.pixelRatio+"px"),this.elements[d].setAttribute("height",this.height*this.pixelRatio+"px");var p=this.webGLContexts[d];if(p.viewport(0,0,this.width*this.pixelRatio,this.height*this.pixelRatio),this.pickingLayers.has(d)){var m=this.textures[d];m&&p.deleteTexture(m)}}return this.emit("resize"),this}},{key:"clear",value:function(){return this.emit("beforeClear"),this.webGLContexts.nodes.bindFramebuffer(WebGLRenderingContext.FRAMEBUFFER,null),this.webGLContexts.nodes.clear(WebGLRenderingContext.COLOR_BUFFER_BIT),this.webGLContexts.edges.bindFramebuffer(WebGLRenderingContext.FRAMEBUFFER,null),this.webGLContexts.edges.clear(WebGLRenderingContext.COLOR_BUFFER_BIT),this.webGLContexts.hoverNodes.clear(WebGLRenderingContext.COLOR_BUFFER_BIT),this.canvasContexts.labels.clearRect(0,0,this.width,this.height),this.canvasContexts.hovers.clearRect(0,0,this.width,this.height),this.canvasContexts.edgeLabels.clearRect(0,0,this.width,this.height),this.emit("afterClear"),this}},{key:"refresh",value:function(r){var i=this,o=(r==null?void 0:r.skipIndexation)!==void 0?r==null?void 0:r.skipIndexation:!1,s=(r==null?void 0:r.schedule)!==void 0?r.schedule:!1,u=!r||!r.partialGraph;if(u)this.clearEdgeIndices(),this.clearNodeIndices(),this.graph.forEachNode(function(N){return i.addNode(N)}),this.graph.forEachEdge(function(N){return i.addEdge(N)});else{for(var f,d,p=((f=r.partialGraph)===null||f===void 0?void 0:f.nodes)||[],m=0,v=(p==null?void 0:p.length)||0;m1&&arguments[1]!==void 0?arguments[1]:{},o=!!i.cameraState||!!i.viewportDimensions||!!i.graphDimensions,s=i.matrix?i.matrix:o?Ds(i.cameraState||this.camera.getState(),i.viewportDimensions||this.getDimensions(),i.graphDimensions||this.getGraphDimensions(),i.padding||this.getStagePadding()):this.matrix,u=Ug(s,r);return{x:(1+u.x)*this.width/2,y:(1-u.y)*this.height/2}}},{key:"viewportToFramedGraph",value:function(r){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=!!i.cameraState||!!i.viewportDimensions||!i.graphDimensions,s=i.matrix?i.matrix:o?Ds(i.cameraState||this.camera.getState(),i.viewportDimensions||this.getDimensions(),i.graphDimensions||this.getGraphDimensions(),i.padding||this.getStagePadding(),!0):this.invMatrix,u=Ug(s,{x:r.x/this.width*2-1,y:1-r.y/this.height*2});return isNaN(u.x)&&(u.x=0),isNaN(u.y)&&(u.y=0),u}},{key:"viewportToGraph",value:function(r){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return this.normalizationFunction.inverse(this.viewportToFramedGraph(r,i))}},{key:"graphToViewport",value:function(r){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return this.framedGraphToViewport(this.normalizationFunction(r),i)}},{key:"getGraphToViewportRatio",value:function(){var r={x:0,y:0},i={x:1,y:1},o=Math.sqrt(Math.pow(r.x-i.x,2)+Math.pow(r.y-i.y,2)),s=this.graphToViewport(r),u=this.graphToViewport(i),f=Math.sqrt(Math.pow(s.x-u.x,2)+Math.pow(s.y-u.y,2));return f/o}},{key:"getBBox",value:function(){return this.nodeExtent}},{key:"getCustomBBox",value:function(){return this.customBBox}},{key:"setCustomBBox",value:function(r){return this.customBBox=r,this.scheduleRender(),this}},{key:"kill",value:function(){this.emit("kill"),this.removeAllListeners(),this.unbindCameraHandlers(),window.removeEventListener("resize",this.activeListeners.handleResize),this.mouseCaptor.kill(),this.touchCaptor.kill(),this.unbindGraphHandlers(),this.clearIndices(),this.clearState(),this.nodeDataCache={},this.edgeDataCache={},this.highlightedNodes.clear(),this.renderFrame&&(cancelAnimationFrame(this.renderFrame),this.renderFrame=null),this.renderHighlightedNodesFrame&&(cancelAnimationFrame(this.renderHighlightedNodesFrame),this.renderHighlightedNodesFrame=null);for(var r=this.container;r.firstChild;)r.removeChild(r.firstChild);this.canvasContexts={},this.webGLContexts={},this.elements={};for(var i in this.nodePrograms)this.nodePrograms[i].kill();for(var o in this.nodeHoverPrograms)this.nodeHoverPrograms[o].kill();for(var s in this.edgePrograms)this.edgePrograms[s].kill();this.nodePrograms={},this.nodeHoverPrograms={},this.edgePrograms={};for(var u in this.elements)this.killLayer(u)}},{key:"scaleSize",value:function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:1,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.camera.ratio;return r/this.settings.zoomToSizeRatioFunction(i)*(this.getSetting("itemSizesReference")==="positions"?i*this.graphToViewportRatio:1)}},{key:"getCanvases",value:function(){var r={};for(var i in this.elements)this.elements[i]instanceof HTMLCanvasElement&&(r[i]=this.elements[i]);return r}}])}(yy);const vA=E.createContext(null),nB=vA.Provider;function xy(){const e=E.useContext(vA);if(e==null)throw new Error("No context provided: useSigmaContext() can only be used in a descendant of ");return e}function pr(){return xy().sigma}function yA(){const{sigma:e}=xy();return E.useCallback(t=>{e&&Object.keys(t).forEach(n=>{e.setSetting(n,t[n])})},[e])}function gd(e){return new Set(Object.keys(e))}const dS=gd({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}),hS=gd({click:!0,rightClick:!0,doubleClick:!0,mouseup:!0,mousedown:!0,mousemove:!0,mousemovebody:!0,mouseleave:!0,mouseenter:!0,wheel:!0}),pS=gd({touchup:!0,touchdown:!0,touchmove:!0,touchmovebody:!0,tap:!0,doubletap:!0}),mS=gd({updated:!0});function bA(){const e=pr(),t=yA(),[n,r]=E.useState({});return E.useEffect(()=>{if(!e||!n)return;const i=n,o=Object.keys(i);return o.forEach(s=>{const u=i[s];dS.has(s)&&e.on(s,u),hS.has(s)&&e.getMouseCaptor().on(s,u),pS.has(s)&&e.getTouchCaptor().on(s,u),mS.has(s)&&e.getCamera().on(s,u)}),()=>{e&&o.forEach(s=>{const u=i[s];dS.has(s)&&e.off(s,u),hS.has(s)&&e.getMouseCaptor().off(s,u),pS.has(s)&&e.getTouchCaptor().off(s,u),mS.has(s)&&e.getCamera().off(s,u)})}},[e,n,t]),r}function rB(){const e=pr();return E.useCallback((t,n=!0)=>{e&&t&&(n&&e.getGraph().order>0&&e.getGraph().clear(),e.getGraph().import(t),e.refresh())},[e])}function hu(e,t){if(e===t)return!0;if(typeof e=="object"&&e!=null&&typeof t=="object"&&t!=null){if(Object.keys(e).length!=Object.keys(t).length)return!1;for(const n in e)if(!Object.hasOwn(t,n)||!hu(e[n],t[n]))return!1;return!0}return!1}function xA(e){const t=pr(),[n,r]=E.useState(e||{});E.useEffect(()=>{r(d=>hu(d,e||{})?d:e||{})},[e]);const i=E.useCallback(d=>{t.getCamera().animatedZoom(Object.assign(Object.assign({},n),d))},[t,n]),o=E.useCallback(d=>{t.getCamera().animatedUnzoom(Object.assign(Object.assign({},n),d))},[t,n]),s=E.useCallback(d=>{t.getCamera().animatedReset(Object.assign(Object.assign({},n),d))},[t,n]),u=E.useCallback((d,p)=>{t.getCamera().animate(d,Object.assign(Object.assign({},n),p))},[t,n]),f=E.useCallback((d,p)=>{const m=t.getNodeDisplayData(d);m?t.getCamera().animate(m,Object.assign(Object.assign({},n),p)):console.warn(`Node ${d} not found`)},[t,n]);return{zoomIn:i,zoomOut:o,reset:s,goto:u,gotoNode:f}}function iB(e){const t=xy(),[n,r]=E.useState(!1),[i,o]=E.useState(t.container),s=E.useCallback(()=>r(u=>!u),[]);return E.useEffect(()=>(document.addEventListener("fullscreenchange",s),()=>document.removeEventListener("fullscreenchange",s)),[s]),E.useEffect(()=>{o(t.container)},[e,t.container]),{toggle:E.useCallback(()=>{var u;u=i,document.fullscreenElement!==u?u.requestFullscreen():document.exitFullscreen&&document.exitFullscreen()},[i]),isFullScreen:n}}const aB=E.forwardRef(({graph:e,id:t,className:n,style:r,settings:i={},children:o},s)=>{const u=E.useRef(null),f=E.useRef(null),d={className:`react-sigma ${n||""}`,id:t,style:r},[p,m]=E.useState(null),[v,g]=E.useState(i);E.useEffect(()=>{g(k=>hu(k,i)?k:i)},[i]),E.useEffect(()=>{m(k=>{let C=null;if(f.current!==null){let _=new St;e&&(_=typeof e=="function"?new e:e);let T=null;k&&(T=k.getCamera().getState(),k.kill()),C=new tB(_,f.current,v),T&&C.getCamera().setState(T)}return C})},[f,e,v]),E.useImperativeHandle(s,()=>p,[p]);const w=E.useMemo(()=>p&&u.current?{sigma:p,container:u.current}:null,[p,u]),x=w!==null?be.createElement(nB,{value:w},o):null;return be.createElement("div",Object.assign({},d,{ref:u}),be.createElement("div",{className:"sigma-container",ref:f}),x)});var oB=` -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 -} -`,lB=oB,sB=` -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; -} -`,uB=sB,wA=WebGLRenderingContext,gS=wA.UNSIGNED_BYTE,vS=wA.FLOAT,cB=["u_sizeRatio","u_pixelRatio","u_matrix"],fB=function(e){function t(){return tn(this,t),Pn(this,t,arguments)}return Fn(t,e),nn(t,[{key:"getDefinition",value:function(){return{VERTICES:1,VERTEX_SHADER_SOURCE:uB,FRAGMENT_SHADER_SOURCE:lB,METHOD:WebGLRenderingContext.POINTS,UNIFORMS:cB,ATTRIBUTES:[{name:"a_position",size:2,type:vS},{name:"a_size",size:1,type:vS},{name:"a_color",size:4,type:gS,normalized:!0},{name:"a_id",size:4,type:gS,normalized:!0}]}}},{key:"processVisibleItem",value:function(r,i,o){var s=this.array;s[i++]=o.x,s[i++]=o.y,s[i++]=o.size,s[i++]=Yr(o.color),s[i++]=r}},{key:"setUniforms",value:function(r,i){var o=r.sizeRatio,s=r.pixelRatio,u=r.matrix,f=i.gl,d=i.uniformLocations,p=d.u_sizeRatio,m=d.u_pixelRatio,v=d.u_matrix;f.uniform1f(m,s),f.uniform1f(p,o),f.uniformMatrix3fv(v,!1,u)}}])}(gy),dB=` -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; -} -`,hB=dB,SA=WebGLRenderingContext,yS=SA.UNSIGNED_BYTE,gi=SA.FLOAT,pB=["u_matrix","u_zoomRatio","u_sizeRatio","u_correctionRatio","u_pixelRatio","u_feather","u_minEdgeThickness","u_lengthToThicknessRatio"],mB={lengthToThicknessRatio:du.lengthToThicknessRatio};function EA(e){var t=Fe(Fe({},mB),{});return function(n){function r(){return tn(this,r),Pn(this,r,arguments)}return Fn(r,n),nn(r,[{key:"getDefinition",value:function(){return{VERTICES:6,VERTEX_SHADER_SOURCE:hB,FRAGMENT_SHADER_SOURCE:vy,METHOD:WebGLRenderingContext.TRIANGLES,UNIFORMS:pB,ATTRIBUTES:[{name:"a_positionStart",size:2,type:gi},{name:"a_positionEnd",size:2,type:gi},{name:"a_normal",size:2,type:gi},{name:"a_color",size:4,type:yS,normalized:!0},{name:"a_id",size:4,type:yS,normalized:!0},{name:"a_sourceRadius",size:1,type:gi},{name:"a_targetRadius",size:1,type:gi}],CONSTANT_ATTRIBUTES:[{name:"a_positionCoef",size:1,type:gi},{name:"a_normalCoef",size:1,type:gi},{name:"a_sourceRadiusCoef",size:1,type:gi},{name:"a_targetRadiusCoef",size:1,type:gi}],CONSTANT_DATA:[[0,1,-1,0],[0,-1,1,0],[1,1,0,1],[1,1,0,1],[0,-1,1,0],[1,-1,0,-1]]}}},{key:"processVisibleItem",value:function(o,s,u,f,d){var p=d.size||1,m=u.x,v=u.y,g=f.x,w=f.y,x=Yr(d.color),k=g-m,C=w-v,_=u.size||1,T=f.size||1,N=k*k+C*C,D=0,z=0;N&&(N=1/Math.sqrt(N),D=-C*N*p,z=k*N*p);var R=this.array;R[s++]=m,R[s++]=v,R[s++]=g,R[s++]=w,R[s++]=D,R[s++]=z,R[s++]=x,R[s++]=o,R[s++]=_,R[s++]=T}},{key:"setUniforms",value:function(o,s){var u=s.gl,f=s.uniformLocations,d=f.u_matrix,p=f.u_zoomRatio,m=f.u_feather,v=f.u_pixelRatio,g=f.u_correctionRatio,w=f.u_sizeRatio,x=f.u_minEdgeThickness,k=f.u_lengthToThicknessRatio;u.uniformMatrix3fv(d,!1,o.matrix),u.uniform1f(p,o.zoomRatio),u.uniform1f(w,o.sizeRatio),u.uniform1f(g,o.correctionRatio),u.uniform1f(v,o.pixelRatio),u.uniform1f(m,o.antiAliasingFeather),u.uniform1f(x,o.minEdgeThickness),u.uniform1f(k,t.lengthToThicknessRatio)}}])}(cu)}EA();function gB(e){return aA([EA(),Cf(e),Cf(Fe(Fe({},e),{},{extremity:"source"}))])}gB();function vB(e){if(Array.isArray(e))return e}function yB(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,o,s,u=[],f=!0,d=!1;try{if(o=(n=n.call(e)).next,t!==0)for(;!(f=(r=o.call(n)).done)&&(u.push(r.value),u.length!==t);f=!0);}catch(p){d=!0,i=p}finally{try{if(!f&&n.return!=null&&(s=n.return(),Object(s)!==s))return}finally{if(d)throw i}}return u}}function $g(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n v_radius) - gl_FragColor = transparent; - else { - gl_FragColor = v_color; - gl_FragColor.a *= bias; - } - #else - // Sizes: -`).concat(t.flatMap(function(i,o){var s=i.size;if("fill"in s)return[];s=s;var u="attribute"in s?"v_borderSize_".concat(o+1):X1(s.value),f=(s.mode||NB)==="pixels"?"u_correctionRatio":"v_radius";return[" float borderSize_".concat(o+1," = ").concat(f," * ").concat(u,";")]}).join(` -`),` - // Now, let's split the remaining space between "fill" borders: - float fillBorderSize = (v_radius - (`).concat(t.flatMap(function(i,o){var s=i.size;return"fill"in s?[]:["borderSize_".concat(o+1)]}).join(" + "),") ) / ").concat(n,`; -`).concat(t.flatMap(function(i,o){var s=i.size;return"fill"in s?[" float borderSize_".concat(o+1," = fillBorderSize;")]:[]}).join(` -`),` - - // Finally, normalize all border sizes, to start from the full size and to end with the smallest: - float adjustedBorderSize_0 = v_radius; -`).concat(t.map(function(i,o){return" float adjustedBorderSize_".concat(o+1," = adjustedBorderSize_").concat(o," - borderSize_").concat(o+1,";")}).join(` -`),` - - // Colors: - vec4 borderColor_0 = transparent; -`).concat(t.map(function(i,o){var s=i.color,u=[];return"attribute"in s?u.push(" vec4 borderColor_".concat(o+1," = v_borderColor_").concat(o+1,";")):"transparent"in s?u.push(" vec4 borderColor_".concat(o+1," = vec4(0.0, 0.0, 0.0, 0.0);")):u.push(" vec4 borderColor_".concat(o+1," = u_borderColor_").concat(o+1,";")),u.push(" borderColor_".concat(o+1,".a *= bias;")),u.push(" if (borderSize_".concat(o+1," <= 1.0 * u_correctionRatio) { borderColor_").concat(o+1," = borderColor_").concat(o,"; }")),u.join(` -`)}).join(` -`),` - if (dist > adjustedBorderSize_0) { - gl_FragColor = borderColor_0; - } else `).concat(t.map(function(i,o){return"if (dist > adjustedBorderSize_".concat(o,` - aaBorder) { - gl_FragColor = mix(borderColor_`).concat(o+1,", borderColor_").concat(o,", (dist - adjustedBorderSize_").concat(o,` + aaBorder) / aaBorder); - } else if (dist > adjustedBorderSize_`).concat(o+1,`) { - gl_FragColor = borderColor_`).concat(o+1,`; - } else `)}).join(""),` { /* Nothing to add here */ } - #endif -} -`);return r}function jB(e){var t=e.borders,n=` -attribute vec2 a_position; -attribute float a_size; -attribute float a_angle; - -uniform mat3 u_matrix; -uniform float u_sizeRatio; -uniform float u_correctionRatio; - -varying vec2 v_diffVector; -varying float v_radius; - -#ifdef PICKING_MODE -attribute vec4 a_id; -varying vec4 v_color; -#else -`.concat(t.flatMap(function(r,i){var o=r.size;return"attribute"in o?["attribute float a_borderSize_".concat(i+1,";"),"varying float v_borderSize_".concat(i+1,";")]:[]}).join(` -`),` -`).concat(t.flatMap(function(r,i){var o=r.color;return"attribute"in o?["attribute vec4 a_borderColor_".concat(i+1,";"),"varying vec4 v_borderColor_".concat(i+1,";")]:[]}).join(` -`),` -#endif - -const float bias = 255.0 / 254.0; -const vec4 transparent = vec4(0.0, 0.0, 0.0, 0.0); - -void main() { - float size = a_size * u_correctionRatio / u_sizeRatio * 4.0; - vec2 diffVector = size * vec2(cos(a_angle), sin(a_angle)); - vec2 position = a_position + diffVector; - gl_Position = vec4( - (u_matrix * vec3(position, 1)).xy, - 0, - 1 - ); - - v_radius = size / 2.0; - v_diffVector = diffVector; - - #ifdef PICKING_MODE - v_color = a_id; - #else -`).concat(t.flatMap(function(r,i){var o=r.size;return"attribute"in o?[" v_borderSize_".concat(i+1," = a_borderSize_").concat(i+1,";")]:[]}).join(` -`),` -`).concat(t.flatMap(function(r,i){var o=r.color;return"attribute"in o?[" v_borderColor_".concat(i+1," = a_borderColor_").concat(i+1,";")]:[]}).join(` -`),` - #endif -} -`);return n}var TA=WebGLRenderingContext,wS=TA.UNSIGNED_BYTE,Hc=TA.FLOAT;function MB(e){var t,n=xS(xS({},OB),{}),r=n.borders,i=n.drawLabel,o=n.drawHover,s=["u_sizeRatio","u_correctionRatio","u_matrix"].concat(mm(r.flatMap(function(u,f){var d=u.color;return"value"in d?["u_borderColor_".concat(f+1)]:[]})));return t=function(u){TB(f,u);function f(){var d;wB(this,f);for(var p=arguments.length,m=new Array(p),v=0;ve.length)&&(t=e.length);for(var n=0,r=Array(t);nO){var X="…";for(x=x+X,M=o.measureText(x).width;M>O&&x.length>1;)x=x.slice(0,-2)+X,M=o.measureText(x).width;if(x.length<4)return}for(var re={},ue=0,ae=x.length;ue{const n=this.nodeIdMap[t];if(n!==void 0)return this.nodes[n]});mi(this,"getEdge",(t,n=!0)=>{const r=n?this.edgeDynamicIdMap[t]:this.edgeIdMap[t];if(r!==void 0)return this.edges[r]});mi(this,"buildDynamicMap",()=>{this.edgeDynamicIdMap={};for(let t=0;t({selectedNode:null,focusedNode:null,selectedEdge:null,focusedEdge:null,moveToSelectedNode:!1,rawGraph:null,sigmaGraph:null,setSelectedNode:(t,n)=>e({selectedNode:t,moveToSelectedNode:n}),setFocusedNode:t=>e({focusedNode:t}),setSelectedEdge:t=>e({selectedEdge:t}),setFocusedEdge:t=>e({focusedEdge:t}),clearSelection:()=>e({selectedNode:null,focusedNode:null,selectedEdge:null,focusedEdge:null}),reset:()=>e({selectedNode:null,focusedNode:null,selectedEdge:null,focusedEdge:null,rawGraph:null,sigmaGraph:null,moveToSelectedNode:!1}),setRawGraph:t=>e({rawGraph:t}),setSigmaGraph:t=>e({sigmaGraph:t}),setMoveToSelectedNode:t=>e({moveToSelectedNode:t})})),yt=Rv(rU),iU=({node:e,move:t})=>{const n=pr(),{gotoNode:r}=xA();return E.useEffect(()=>{if(e)return n.getGraph().setNodeAttribute(e,"highlighted",!0),t&&(r(e),yt.getState().setMoveToSelectedNode(!1)),()=>{n.getGraph().setNodeAttribute(e,"highlighted",!1)}},[e,t,n,r]),null};function kl(e,t){const n=pr(),r=E.useRef(t);return hu(r.current,t)||(r.current=t),{positions:E.useCallback(()=>r.current?e(n.getGraph(),r.current):{},[n,r,e]),assign:E.useCallback(()=>{r.current&&e.assign(n.getGraph(),r.current)},[n,r,e])}}function Sy(e,t){const n=pr(),[r,i]=E.useState(!1),[o,s]=E.useState(null),u=E.useRef(t);return hu(u.current,t)||(u.current=t),E.useEffect(()=>{i(!1);let f=null;return u.current&&(f=new e(n.getGraph(),u.current)),s(f),()=>{f!==null&&f.kill()}},[n,u,s,i,e]),{stop:E.useCallback(()=>{o&&(o.stop(),i(!1))},[o,i]),start:E.useCallback(()=>{o&&(o.start(),i(!0))},[o,i]),kill:E.useCallback(()=>{o&&o.kill(),i(!1)},[o,i]),isRunning:r}}var vm,_S;function pu(){if(_S)return vm;_S=1;function e(n){return!n||typeof n!="object"||typeof n=="function"||Array.isArray(n)||n instanceof Set||n instanceof Map||n instanceof RegExp||n instanceof Date}function t(n,r){n=n||{};var i={};for(var o in r){var s=n[o],u=r[o];if(!e(u)){i[o]=t(s,u);continue}s===void 0?i[o]=u:i[o]=s}return i}return vm=t,vm}var ym,kS;function aU(){if(kS)return ym;kS=1;function e(n){return function(r,i){return r+Math.floor(n()*(i-r+1))}}var t=e(Math.random);return t.createRandom=e,ym=t,ym}var bm,CS;function oU(){if(CS)return bm;CS=1;var e=aU().createRandom;function t(r){var i=e(r);return function(o){for(var s=o.length,u=s-1,f=-1;++f0},i.prototype.addChild=function(R,B){this.children[R]=B,++this.countChildren},i.prototype.getChild=function(R){if(!this.children.hasOwnProperty(R)){var B=new i;this.children[R]=B,++this.countChildren}return this.children[R]},i.prototype.applyPositionToChildren=function(){if(this.hasChildren()){var R=this;for(var B in R.children){var P=R.children[B];P.x+=R.x,P.y+=R.y,P.applyPositionToChildren()}}};function o(R,B,P){for(var j in B.children){var V=B.children[j];V.hasChildren()?o(R,V,P):P[V.id]={x:V.x,y:V.y}}}function s(R,B){var P=R.r-B.r,j=B.x-R.x,V=B.y-R.y;return P<0||P*P0&&P*P>j*j+V*V}function f(R,B){for(var P=0;PZ?(V=(U+Z-q)/(2*U),Y=Math.sqrt(Math.max(0,Z/U-V*V)),P.x=R.x-V*j-Y*I,P.y=R.y-V*I+Y*j):(V=(U+q-Z)/(2*U),Y=Math.sqrt(Math.max(0,q/U-V*V)),P.x=B.x+V*j-Y*I,P.y=B.y+V*I+Y*j)):(P.x=B.x+P.r,P.y=B.y)}function C(R,B){var P=R.r+B.r-1e-6,j=B.x-R.x,V=B.y-R.y;return P>0&&P*P>j*j+V*V}function _(R,B){var P=R.length;if(P===0)return 0;var j,V,q,I,Y,Z,U,G,F,K;if(j=R[0],j.x=0,j.y=0,P<=1)return j.r;if(V=R[1],j.x=-V.r,V.x=j.r,V.y=0,P<=2)return j.r+V.r;q=R[2],k(V,j,q),j=new i(null,null,null,null,j),V=new i(null,null,null,null,V),q=new i(null,null,null,null,q),j.next=q.previous=V,V.next=j.previous=q,q.next=V.previous=j;e:for(Z=3;Z"u"?i:d};typeof i=="function"&&(s=i);var u=function(d){return s(d[r])},f=function(){return s(void 0)};return typeof r=="string"?(o.fromAttributes=u,o.fromGraph=function(d,p){return u(d.getNodeAttributes(p))},o.fromEntry=function(d,p){return u(p)}):typeof r=="function"?(o.fromAttributes=function(){throw new Error("graphology-utils/getters/createNodeValueGetter: irrelevant usage.")},o.fromGraph=function(d,p){return s(r(p,d.getNodeAttributes(p)))},o.fromEntry=function(d,p){return s(r(d,p))}):(o.fromAttributes=f,o.fromGraph=f,o.fromEntry=f),o}function n(r,i){var o={},s=function(d){return typeof d>"u"?i:d};typeof i=="function"&&(s=i);var u=function(d){return s(d[r])},f=function(){return s(void 0)};return typeof r=="string"?(o.fromAttributes=u,o.fromGraph=function(d,p){return u(d.getEdgeAttributes(p))},o.fromEntry=function(d,p){return u(p)},o.fromPartialEntry=o.fromEntry,o.fromMinimalEntry=o.fromEntry):typeof r=="function"?(o.fromAttributes=function(){throw new Error("graphology-utils/getters/createEdgeValueGetter: irrelevant usage.")},o.fromGraph=function(d,p){var m=d.extremities(p);return s(r(p,d.getEdgeAttributes(p),m[0],m[1],d.getNodeAttributes(m[0]),d.getNodeAttributes(m[1]),d.isUndirected(p)))},o.fromEntry=function(d,p,m,v,g,w,x){return s(r(d,p,m,v,g,w,x))},o.fromPartialEntry=function(d,p,m,v){return s(r(d,p,m,v))},o.fromMinimalEntry=function(d,p){return s(r(d,p))}):(o.fromAttributes=f,o.fromGraph=f,o.fromEntry=f,o.fromMinimalEntry=f),o}return Ls.createNodeValueGetter=t,Ls.createEdgeValueGetter=n,Ls.createEdgeWeightGetter=function(r){return n(r,e)},Ls}var Sm,DS;function jA(){if(DS)return Sm;DS=1;const{createNodeValueGetter:e,createEdgeValueGetter:t}=Ey();return Sm=function(r,i,o){const{nodeXAttribute:s,nodeYAttribute:u}=o,{attraction:f,repulsion:d,gravity:p,inertia:m,maxMove:v}=o.settings;let{shouldSkipNode:g,shouldSkipEdge:w,isNodeFixed:x}=o;x=e(x),g=e(g,!1),w=t(w,!1);const k=r.filterNodes((T,N)=>!g.fromEntry(T,N)),C=k.length;for(let T=0;T{if(D===z||g.fromEntry(D,R)||g.fromEntry(z,B)||w.fromEntry(T,N,D,z,R,B,P))return;const j=i[D],V=i[z],q=V.x-j.x,I=V.y-j.y,Y=Math.sqrt(q*q+I*I)||1,Z=f*Y*q,U=f*Y*I;j.dx+=Z,j.dy+=U,V.dx-=Z,V.dy-=U}),p)for(let T=0;Tv&&(D.dx*=v/z,D.dy*=v/z),x.fromGraph(r,N)?D.fixed=!0:(D.x+=D.dx,D.y+=D.dy,D.fixed=!1)}return{converged:_}},Sm}var $c={},NS;function MA(){return NS||(NS=1,$c.assignLayoutChanges=function(e,t,n){const{nodeXAttribute:r,nodeYAttribute:i}=n;e.updateEachNodeAttributes((o,s)=>{const u=t[o];return!u||u.fixed||(s[r]=u.x,s[i]=u.y),s},{attributes:["x","y"]})},$c.collectLayoutChanges=function(e){const t={};for(const n in e){const r=e[n];t[n]={x:r.x,y:r.y}}return t}),$c}var Em,OS;function PA(){return OS||(OS=1,Em={nodeXAttribute:"x",nodeYAttribute:"y",isNodeFixed:"fixed",shouldSkipNode:null,shouldSkipEdge:null,settings:{attraction:5e-4,repulsion:.1,gravity:1e-4,inertia:.6,maxMove:200}}),Em}var _m,LS;function mU(){if(LS)return _m;LS=1;const e=Wr(),t=pu(),n=jA(),r=MA(),i=PA();function o(u,f,d){if(!e(f))throw new Error("graphology-layout-force: the given graph is not a valid graphology instance.");typeof d=="number"?d={maxIterations:d}:d=d||{};const p=d.maxIterations;if(d=t(d,i),typeof p!="number"||p<=0)throw new Error("graphology-layout-force: you should provide a positive number of maximum iterations.");const m={};let v=null,g;for(g=0;gthis.runFrame())},o.prototype.stop=function(){return this.running=!1,this.frameID!==null&&(window.cancelAnimationFrame(this.frameID),this.frameID=null),this},o.prototype.start=function(){if(this.killed)throw new Error("graphology-layout-force/worker.start: layout was killed.");this.running||(this.running=!0,this.runFrame())},o.prototype.kill=function(){this.stop(),delete this.nodeStates,this.killed=!0},km=o,km}var bU=yU();const xU=fn(bU);function wU(e={maxIterations:100}){return kl(vU,e)}function SU(e={}){return Sy(xU,e)}var Cm,jS;function EU(){if(jS)return Cm;jS=1;var e=0,t=1,n=2,r=3,i=4,o=5,s=6,u=7,f=8,d=9,p=0,m=1,v=2,g=0,w=1,x=2,k=3,C=4,_=5,T=6,N=7,D=8,z=3,R=10,B=3,P=9,j=10;return Cm=function(q,I,Y){var Z,U,G,F,K,A,$,M,O,X,re=I.length,ue=Y.length,ae=q.adjustSizes,oe=q.barnesHutTheta*q.barnesHutTheta,Ce,he,Ee,we,Pe,Ae,xe,ee=[];for(G=0;GNe?(ge-=(ve-Ne)/2,Se=ge+ve):(ce-=(Ne-ve)/2,Te=ce+Ne),ee[0+g]=-1,ee[0+w]=(ce+Te)/2,ee[0+x]=(ge+Se)/2,ee[0+k]=Math.max(Te-ce,Se-ge),ee[0+C]=-1,ee[0+_]=-1,ee[0+T]=0,ee[0+N]=0,ee[0+D]=0,Z=1,G=0;G=0){I[G+e]=0)if(Ae=Math.pow(I[G+e]-ee[U+N],2)+Math.pow(I[G+t]-ee[U+D],2),X=ee[U+k],4*X*X/Ae0?(xe=he*I[G+s]*ee[U+T]/Ae,I[G+n]+=Ee*xe,I[G+r]+=we*xe):Ae<0&&(xe=-he*I[G+s]*ee[U+T]/Math.sqrt(Ae),I[G+n]+=Ee*xe,I[G+r]+=we*xe):Ae>0&&(xe=he*I[G+s]*ee[U+T]/Ae,I[G+n]+=Ee*xe,I[G+r]+=we*xe),U=ee[U+C],U<0)break;continue}else{U=ee[U+_];continue}else{if(A=ee[U+g],A>=0&&A!==G&&(Ee=I[G+e]-I[A+e],we=I[G+t]-I[A+t],Ae=Ee*Ee+we*we,ae===!0?Ae>0?(xe=he*I[G+s]*I[A+s]/Ae,I[G+n]+=Ee*xe,I[G+r]+=we*xe):Ae<0&&(xe=-he*I[G+s]*I[A+s]/Math.sqrt(Ae),I[G+n]+=Ee*xe,I[G+r]+=we*xe):Ae>0&&(xe=he*I[G+s]*I[A+s]/Ae,I[G+n]+=Ee*xe,I[G+r]+=we*xe)),U=ee[U+C],U<0)break;continue}else for(he=q.scalingRatio,F=0;F0?(xe=he*I[F+s]*I[K+s]/Ae/Ae,I[F+n]+=Ee*xe,I[F+r]+=we*xe,I[K+n]-=Ee*xe,I[K+r]-=we*xe):Ae<0&&(xe=100*he*I[F+s]*I[K+s],I[F+n]+=Ee*xe,I[F+r]+=we*xe,I[K+n]-=Ee*xe,I[K+r]-=we*xe)):(Ae=Math.sqrt(Ee*Ee+we*we),Ae>0&&(xe=he*I[F+s]*I[K+s]/Ae/Ae,I[F+n]+=Ee*xe,I[F+r]+=we*xe,I[K+n]-=Ee*xe,I[K+r]-=we*xe));for(O=q.gravity/q.scalingRatio,he=q.scalingRatio,G=0;G0&&(xe=he*I[G+s]*O):Ae>0&&(xe=he*I[G+s]*O/Ae),I[G+n]-=Ee*xe,I[G+r]-=we*xe;for(he=1*(q.outboundAttractionDistribution?Ce:1),$=0;$0&&(xe=-he*Pe*Math.log(1+Ae)/Ae/I[F+s]):Ae>0&&(xe=-he*Pe*Math.log(1+Ae)/Ae):q.outboundAttractionDistribution?Ae>0&&(xe=-he*Pe/I[F+s]):Ae>0&&(xe=-he*Pe)):(Ae=Math.sqrt(Math.pow(Ee,2)+Math.pow(we,2)),q.linLogMode?q.outboundAttractionDistribution?Ae>0&&(xe=-he*Pe*Math.log(1+Ae)/Ae/I[F+s]):Ae>0&&(xe=-he*Pe*Math.log(1+Ae)/Ae):q.outboundAttractionDistribution?(Ae=1,xe=-he*Pe/I[F+s]):(Ae=1,xe=-he*Pe)),Ae>0&&(I[F+n]+=Ee*xe,I[F+r]+=we*xe,I[K+n]-=Ee*xe,I[K+r]-=we*xe);var te,de,Oe,$e,Ye,vt;if(ae===!0)for(G=0;Gj&&(I[G+n]=I[G+n]*j/te,I[G+r]=I[G+r]*j/te),de=I[G+s]*Math.sqrt((I[G+i]-I[G+n])*(I[G+i]-I[G+n])+(I[G+o]-I[G+r])*(I[G+o]-I[G+r])),Oe=Math.sqrt((I[G+i]+I[G+n])*(I[G+i]+I[G+n])+(I[G+o]+I[G+r])*(I[G+o]+I[G+r]))/2,$e=.1*Math.log(1+Oe)/(1+Math.sqrt(de)),Ye=I[G+e]+I[G+n]*($e/q.slowDown),I[G+e]=Ye,vt=I[G+t]+I[G+r]*($e/q.slowDown),I[G+t]=vt);else for(G=0;G=0)?{message:"the `scalingRatio` setting should be a number >= 0."}:"strongGravityMode"in n&&typeof n.strongGravityMode!="boolean"?{message:"the `strongGravityMode` setting should be a boolean."}:"gravity"in n&&!(typeof n.gravity=="number"&&n.gravity>=0)?{message:"the `gravity` setting should be a number >= 0."}:"slowDown"in n&&!(typeof n.slowDown=="number"||n.slowDown>=0)?{message:"the `slowDown` setting should be a number >= 0."}:"barnesHutOptimize"in n&&typeof n.barnesHutOptimize!="boolean"?{message:"the `barnesHutOptimize` setting should be a boolean."}:"barnesHutTheta"in n&&!(typeof n.barnesHutTheta=="number"&&n.barnesHutTheta>=0)?{message:"the `barnesHutTheta` setting should be a number >= 0."}:null},vi.graphToByteArrays=function(n,r){var i=n.order,o=n.size,s={},u,f=new Float32Array(i*e),d=new Float32Array(o*t);return u=0,n.forEachNode(function(p,m){s[p]=u,f[u]=m.x,f[u+1]=m.y,f[u+2]=0,f[u+3]=0,f[u+4]=0,f[u+5]=0,f[u+6]=1,f[u+7]=1,f[u+8]=m.size||1,f[u+9]=m.fixed?1:0,u+=e}),u=0,n.forEachEdge(function(p,m,v,g,w,x,k){var C=s[v],_=s[g],T=r(p,m,v,g,w,x,k);f[C+6]+=T,f[_+6]+=T,d[u]=C,d[u+1]=_,d[u+2]=T,u+=t}),{nodes:f,edges:d}},vi.assignLayoutChanges=function(n,r,i){var o=0;n.updateEachNodeAttributes(function(s,u){return u.x=r[o],u.y=r[o+1],o+=e,i?i(s,u):u})},vi.readGraphPositions=function(n,r){var i=0;n.forEachNode(function(o,s){r[i]=s.x,r[i+1]=s.y,i+=e})},vi.collectLayoutChanges=function(n,r,i){for(var o=n.nodes(),s={},u=0,f=0,d=r.length;u2e3,strongGravityMode:!0,gravity:.05,scalingRatio:10,slowDown:1+Math.log(d)}}var u=o.bind(null,!1);return u.assign=o.bind(null,!0),u.inferSettings=s,Am=u,Am}var kU=_U();const CU=fn(kU);var Rm,IS;function TU(){return IS||(IS=1,Rm=function(){var t,n,r={};(function(){var o=0,s=1,u=2,f=3,d=4,p=5,m=6,v=7,g=8,w=9,x=0,k=1,C=2,_=0,T=1,N=2,D=3,z=4,R=5,B=6,P=7,j=8,V=3,q=10,I=3,Y=9,Z=10;r.exports=function(G,F,K){var A,$,M,O,X,re,ue,ae,oe,Ce,he=F.length,Ee=K.length,we=G.adjustSizes,Pe=G.barnesHutTheta*G.barnesHutTheta,Ae,xe,ee,ce,Te,ge,Se,ie=[];for(M=0;MYe?(ve-=($e-Ye)/2,Ne=ve+$e):(He-=(Ye-$e)/2,Ge=He+Ye),ie[0+_]=-1,ie[0+T]=(He+Ge)/2,ie[0+N]=(ve+Ne)/2,ie[0+D]=Math.max(Ge-He,Ne-ve),ie[0+z]=-1,ie[0+R]=-1,ie[0+B]=0,ie[0+P]=0,ie[0+j]=0,A=1,M=0;M=0){F[M+o]=0)if(ge=Math.pow(F[M+o]-ie[$+P],2)+Math.pow(F[M+s]-ie[$+j],2),Ce=ie[$+D],4*Ce*Ce/ge0?(Se=xe*F[M+m]*ie[$+B]/ge,F[M+u]+=ee*Se,F[M+f]+=ce*Se):ge<0&&(Se=-xe*F[M+m]*ie[$+B]/Math.sqrt(ge),F[M+u]+=ee*Se,F[M+f]+=ce*Se):ge>0&&(Se=xe*F[M+m]*ie[$+B]/ge,F[M+u]+=ee*Se,F[M+f]+=ce*Se),$=ie[$+z],$<0)break;continue}else{$=ie[$+R];continue}else{if(re=ie[$+_],re>=0&&re!==M&&(ee=F[M+o]-F[re+o],ce=F[M+s]-F[re+s],ge=ee*ee+ce*ce,we===!0?ge>0?(Se=xe*F[M+m]*F[re+m]/ge,F[M+u]+=ee*Se,F[M+f]+=ce*Se):ge<0&&(Se=-xe*F[M+m]*F[re+m]/Math.sqrt(ge),F[M+u]+=ee*Se,F[M+f]+=ce*Se):ge>0&&(Se=xe*F[M+m]*F[re+m]/ge,F[M+u]+=ee*Se,F[M+f]+=ce*Se)),$=ie[$+z],$<0)break;continue}else for(xe=G.scalingRatio,O=0;O0?(Se=xe*F[O+m]*F[X+m]/ge/ge,F[O+u]+=ee*Se,F[O+f]+=ce*Se,F[X+u]-=ee*Se,F[X+f]-=ce*Se):ge<0&&(Se=100*xe*F[O+m]*F[X+m],F[O+u]+=ee*Se,F[O+f]+=ce*Se,F[X+u]-=ee*Se,F[X+f]-=ce*Se)):(ge=Math.sqrt(ee*ee+ce*ce),ge>0&&(Se=xe*F[O+m]*F[X+m]/ge/ge,F[O+u]+=ee*Se,F[O+f]+=ce*Se,F[X+u]-=ee*Se,F[X+f]-=ce*Se));for(oe=G.gravity/G.scalingRatio,xe=G.scalingRatio,M=0;M0&&(Se=xe*F[M+m]*oe):ge>0&&(Se=xe*F[M+m]*oe/ge),F[M+u]-=ee*Se,F[M+f]-=ce*Se;for(xe=1*(G.outboundAttractionDistribution?Ae:1),ue=0;ue0&&(Se=-xe*Te*Math.log(1+ge)/ge/F[O+m]):ge>0&&(Se=-xe*Te*Math.log(1+ge)/ge):G.outboundAttractionDistribution?ge>0&&(Se=-xe*Te/F[O+m]):ge>0&&(Se=-xe*Te)):(ge=Math.sqrt(Math.pow(ee,2)+Math.pow(ce,2)),G.linLogMode?G.outboundAttractionDistribution?ge>0&&(Se=-xe*Te*Math.log(1+ge)/ge/F[O+m]):ge>0&&(Se=-xe*Te*Math.log(1+ge)/ge):G.outboundAttractionDistribution?(ge=1,Se=-xe*Te/F[O+m]):(ge=1,Se=-xe*Te)),ge>0&&(F[O+u]+=ee*Se,F[O+f]+=ce*Se,F[X+u]-=ee*Se,F[X+f]-=ce*Se);var vt,Mt,bt,rt,qt,at;if(we===!0)for(M=0;MZ&&(F[M+u]=F[M+u]*Z/vt,F[M+f]=F[M+f]*Z/vt),Mt=F[M+m]*Math.sqrt((F[M+d]-F[M+u])*(F[M+d]-F[M+u])+(F[M+p]-F[M+f])*(F[M+p]-F[M+f])),bt=Math.sqrt((F[M+d]+F[M+u])*(F[M+d]+F[M+u])+(F[M+p]+F[M+f])*(F[M+p]+F[M+f]))/2,rt=.1*Math.log(1+bt)/(1+Math.sqrt(Mt)),qt=F[M+o]+F[M+u]*(rt/G.slowDown),F[M+o]=qt,at=F[M+s]+F[M+f]*(rt/G.slowDown),F[M+s]=at);else for(M=0;M1&&Ee.has(Se))&&(F>1&&Ee.add(Se),xe=f[Pe+e],ce=f[Pe+t],ge=f[Pe+n],ie=xe-Ae,He=ce-ee,Ge=Math.sqrt(ie*ie+He*He),ve=Ge0?(R[Pe]+=ie/Ge*(1+Te),B[Pe]+=He/Ge*(1+Te)):(R[Pe]+=I*o(),B[Pe]+=Y*o())));for(w=0,x=0;w1&&xe.has(ve))&&(M>1&&xe.add(ve),ge=v[ce+i],ie=v[ce+o],Ge=v[ce+s],Ne=ge-Te,te=ie-Se,de=Math.sqrt(Ne*Ne+te*te),Oe=de0?(V[ce]+=Ne/de*(1+He),q[ce]+=te/de*(1+He)):(V[ce]+=G*d(),q[ce]+=F*d())));for(_=0,T=0;_=0;)m=Xg(e,t,n,r,d+1,o+1,s),m>p&&(d===i?m*=WS:ZU.test(e.charAt(d-1))?(m*=YU,g=e.slice(i,d-1).match(QU),g&&i>0&&(m*=Math.pow(Fm,g.length))):JU.test(e.charAt(d-1))?(m*=qU,w=e.slice(i,d-1).match(HA),w&&i>0&&(m*=Math.pow(Fm,w.length))):(m*=WU,i>0&&(m*=Math.pow(Fm,d-i))),e.charAt(d)!==t.charAt(o)&&(m*=XU)),(mm&&(m=v*Pm)),m>p&&(p=m),d=n.indexOf(f,d+1);return s[u]=p,p}function XS(e){return e.toLowerCase().replace(HA," ")}function e6(e,t,n){return e=n&&n.length>0?`${e+" "+n.join(" ")}`:e,Xg(e,t,XS(e),XS(t),0,0,{})}var Im={exports:{}},Gm={};/** - * @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 KS;function t6(){if(KS)return Gm;KS=1;var e=$f();function t(m,v){return m===v&&(m!==0||1/m===1/v)||m!==m&&v!==v}var n=typeof Object.is=="function"?Object.is:t,r=e.useState,i=e.useEffect,o=e.useLayoutEffect,s=e.useDebugValue;function u(m,v){var g=v(),w=r({inst:{value:g,getSnapshot:v}}),x=w[0].inst,k=w[1];return o(function(){x.value=g,x.getSnapshot=v,f(x)&&k({inst:x})},[m,g,v]),i(function(){return f(x)&&k({inst:x}),m(function(){f(x)&&k({inst:x})})},[m]),s(g),g}function f(m){var v=m.getSnapshot;m=m.value;try{var g=v();return!n(m,g)}catch{return!0}}function d(m,v){return v()}var p=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?d:u;return Gm.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:p,Gm}var ZS;function n6(){return ZS||(ZS=1,Im.exports=t6()),Im.exports}var r6=n6(),zs='[cmdk-group=""]',Bm='[cmdk-group-items=""]',i6='[cmdk-group-heading=""]',_y='[cmdk-item=""]',QS=`${_y}:not([aria-disabled="true"])`,Kg="cmdk-item-select",Ha="data-value",a6=(e,t,n)=>e6(e,t,n),$A=E.createContext(void 0),mu=()=>E.useContext($A),VA=E.createContext(void 0),ky=()=>E.useContext(VA),qA=E.createContext(void 0),YA=E.forwardRef((e,t)=>{let n=Qo(()=>{var M,O;return{search:"",value:(O=(M=e.value)!=null?M:e.defaultValue)!=null?O:"",filtered:{count:0,items:new Map,groups:new Set}}}),r=Qo(()=>new Set),i=Qo(()=>new Map),o=Qo(()=>new Map),s=Qo(()=>new Set),u=WA(e),{label:f,children:d,value:p,onValueChange:m,filter:v,shouldFilter:g,loop:w,disablePointerSelection:x=!1,vimBindings:k=!0,...C}=e,_=bn(),T=bn(),N=bn(),D=E.useRef(null),z=g6();Qa(()=>{if(p!==void 0){let M=p.trim();n.current.value=M,R.emit()}},[p]),Qa(()=>{z(6,I)},[]);let R=E.useMemo(()=>({subscribe:M=>(s.current.add(M),()=>s.current.delete(M)),snapshot:()=>n.current,setState:(M,O,X)=>{var re,ue,ae;if(!Object.is(n.current[M],O)){if(n.current[M]=O,M==="search")q(),j(),z(1,V);else if(M==="value"&&(X||z(5,I),((re=u.current)==null?void 0:re.value)!==void 0)){let oe=O??"";(ae=(ue=u.current).onValueChange)==null||ae.call(ue,oe);return}R.emit()}},emit:()=>{s.current.forEach(M=>M())}}),[]),B=E.useMemo(()=>({value:(M,O,X)=>{var re;O!==((re=o.current.get(M))==null?void 0:re.value)&&(o.current.set(M,{value:O,keywords:X}),n.current.filtered.items.set(M,P(O,X)),z(2,()=>{j(),R.emit()}))},item:(M,O)=>(r.current.add(M),O&&(i.current.has(O)?i.current.get(O).add(M):i.current.set(O,new Set([M]))),z(3,()=>{q(),j(),n.current.value||V(),R.emit()}),()=>{o.current.delete(M),r.current.delete(M),n.current.filtered.items.delete(M);let X=Y();z(4,()=>{q(),(X==null?void 0:X.getAttribute("id"))===M&&V(),R.emit()})}),group:M=>(i.current.has(M)||i.current.set(M,new Set),()=>{o.current.delete(M),i.current.delete(M)}),filter:()=>u.current.shouldFilter,label:f||e["aria-label"],getDisablePointerSelection:()=>u.current.disablePointerSelection,listId:_,inputId:N,labelId:T,listInnerRef:D}),[]);function P(M,O){var X,re;let ue=(re=(X=u.current)==null?void 0:X.filter)!=null?re:a6;return M?ue(M,n.current.search,O):0}function j(){if(!n.current.search||u.current.shouldFilter===!1)return;let M=n.current.filtered.items,O=[];n.current.filtered.groups.forEach(re=>{let ue=i.current.get(re),ae=0;ue.forEach(oe=>{let Ce=M.get(oe);ae=Math.max(Ce,ae)}),O.push([re,ae])});let X=D.current;Z().sort((re,ue)=>{var ae,oe;let Ce=re.getAttribute("id"),he=ue.getAttribute("id");return((ae=M.get(he))!=null?ae:0)-((oe=M.get(Ce))!=null?oe:0)}).forEach(re=>{let ue=re.closest(Bm);ue?ue.appendChild(re.parentElement===ue?re:re.closest(`${Bm} > *`)):X.appendChild(re.parentElement===X?re:re.closest(`${Bm} > *`))}),O.sort((re,ue)=>ue[1]-re[1]).forEach(re=>{var ue;let ae=(ue=D.current)==null?void 0:ue.querySelector(`${zs}[${Ha}="${encodeURIComponent(re[0])}"]`);ae==null||ae.parentElement.appendChild(ae)})}function V(){let M=Z().find(X=>X.getAttribute("aria-disabled")!=="true"),O=M==null?void 0:M.getAttribute(Ha);R.setState("value",O||void 0)}function q(){var M,O,X,re;if(!n.current.search||u.current.shouldFilter===!1){n.current.filtered.count=r.current.size;return}n.current.filtered.groups=new Set;let ue=0;for(let ae of r.current){let oe=(O=(M=o.current.get(ae))==null?void 0:M.value)!=null?O:"",Ce=(re=(X=o.current.get(ae))==null?void 0:X.keywords)!=null?re:[],he=P(oe,Ce);n.current.filtered.items.set(ae,he),he>0&&ue++}for(let[ae,oe]of i.current)for(let Ce of oe)if(n.current.filtered.items.get(Ce)>0){n.current.filtered.groups.add(ae);break}n.current.filtered.count=ue}function I(){var M,O,X;let re=Y();re&&(((M=re.parentElement)==null?void 0:M.firstChild)===re&&((X=(O=re.closest(zs))==null?void 0:O.querySelector(i6))==null||X.scrollIntoView({block:"nearest"})),re.scrollIntoView({block:"nearest"}))}function Y(){var M;return(M=D.current)==null?void 0:M.querySelector(`${_y}[aria-selected="true"]`)}function Z(){var M;return Array.from(((M=D.current)==null?void 0:M.querySelectorAll(QS))||[])}function U(M){let O=Z()[M];O&&R.setState("value",O.getAttribute(Ha))}function G(M){var O;let X=Y(),re=Z(),ue=re.findIndex(oe=>oe===X),ae=re[ue+M];(O=u.current)!=null&&O.loop&&(ae=ue+M<0?re[re.length-1]:ue+M===re.length?re[0]:re[ue+M]),ae&&R.setState("value",ae.getAttribute(Ha))}function F(M){let O=Y(),X=O==null?void 0:O.closest(zs),re;for(;X&&!re;)X=M>0?p6(X,zs):m6(X,zs),re=X==null?void 0:X.querySelector(QS);re?R.setState("value",re.getAttribute(Ha)):G(M)}let K=()=>U(Z().length-1),A=M=>{M.preventDefault(),M.metaKey?K():M.altKey?F(1):G(1)},$=M=>{M.preventDefault(),M.metaKey?U(0):M.altKey?F(-1):G(-1)};return E.createElement(We.div,{ref:t,tabIndex:-1,...C,"cmdk-root":"",onKeyDown:M=>{var O;if((O=C.onKeyDown)==null||O.call(C,M),!M.defaultPrevented)switch(M.key){case"n":case"j":{k&&M.ctrlKey&&A(M);break}case"ArrowDown":{A(M);break}case"p":case"k":{k&&M.ctrlKey&&$(M);break}case"ArrowUp":{$(M);break}case"Home":{M.preventDefault(),U(0);break}case"End":{M.preventDefault(),K();break}case"Enter":if(!M.nativeEvent.isComposing&&M.keyCode!==229){M.preventDefault();let X=Y();if(X){let re=new Event(Kg);X.dispatchEvent(re)}}}}},E.createElement("label",{"cmdk-label":"",htmlFor:B.inputId,id:B.labelId,style:y6},f),vd(e,M=>E.createElement(VA.Provider,{value:R},E.createElement($A.Provider,{value:B},M))))}),o6=E.forwardRef((e,t)=>{var n,r;let i=bn(),o=E.useRef(null),s=E.useContext(qA),u=mu(),f=WA(e),d=(r=(n=f.current)==null?void 0:n.forceMount)!=null?r:s==null?void 0:s.forceMount;Qa(()=>{if(!d)return u.item(i,s==null?void 0:s.id)},[d]);let p=XA(i,o,[e.value,e.children,o],e.keywords),m=ky(),v=Ja(z=>z.value&&z.value===p.current),g=Ja(z=>d||u.filter()===!1?!0:z.search?z.filtered.items.get(i)>0:!0);E.useEffect(()=>{let z=o.current;if(!(!z||e.disabled))return z.addEventListener(Kg,w),()=>z.removeEventListener(Kg,w)},[g,e.onSelect,e.disabled]);function w(){var z,R;x(),(R=(z=f.current).onSelect)==null||R.call(z,p.current)}function x(){m.setState("value",p.current,!0)}if(!g)return null;let{disabled:k,value:C,onSelect:_,forceMount:T,keywords:N,...D}=e;return E.createElement(We.div,{ref:Xs([o,t]),...D,id:i,"cmdk-item":"",role:"option","aria-disabled":!!k,"aria-selected":!!v,"data-disabled":!!k,"data-selected":!!v,onPointerMove:k||u.getDisablePointerSelection()?void 0:x,onClick:k?void 0:w},e.children)}),l6=E.forwardRef((e,t)=>{let{heading:n,children:r,forceMount:i,...o}=e,s=bn(),u=E.useRef(null),f=E.useRef(null),d=bn(),p=mu(),m=Ja(g=>i||p.filter()===!1?!0:g.search?g.filtered.groups.has(s):!0);Qa(()=>p.group(s),[]),XA(s,u,[e.value,e.heading,f]);let v=E.useMemo(()=>({id:s,forceMount:i}),[i]);return E.createElement(We.div,{ref:Xs([u,t]),...o,"cmdk-group":"",role:"presentation",hidden:m?void 0:!0},n&&E.createElement("div",{ref:f,"cmdk-group-heading":"","aria-hidden":!0,id:d},n),vd(e,g=>E.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?d:void 0},E.createElement(qA.Provider,{value:v},g))))}),s6=E.forwardRef((e,t)=>{let{alwaysRender:n,...r}=e,i=E.useRef(null),o=Ja(s=>!s.search);return!n&&!o?null:E.createElement(We.div,{ref:Xs([i,t]),...r,"cmdk-separator":"",role:"separator"})}),u6=E.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,i=e.value!=null,o=ky(),s=Ja(p=>p.search),u=Ja(p=>p.value),f=mu(),d=E.useMemo(()=>{var p;let m=(p=f.listInnerRef.current)==null?void 0:p.querySelector(`${_y}[${Ha}="${encodeURIComponent(u)}"]`);return m==null?void 0:m.getAttribute("id")},[]);return E.useEffect(()=>{e.value!=null&&o.setState("search",e.value)},[e.value]),E.createElement(We.input,{ref:t,...r,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":f.listId,"aria-labelledby":f.labelId,"aria-activedescendant":d,id:f.inputId,type:"text",value:i?e.value:s,onChange:p=>{i||o.setState("search",p.target.value),n==null||n(p.target.value)}})}),c6=E.forwardRef((e,t)=>{let{children:n,label:r="Suggestions",...i}=e,o=E.useRef(null),s=E.useRef(null),u=mu();return E.useEffect(()=>{if(s.current&&o.current){let f=s.current,d=o.current,p,m=new ResizeObserver(()=>{p=requestAnimationFrame(()=>{let v=f.offsetHeight;d.style.setProperty("--cmdk-list-height",v.toFixed(1)+"px")})});return m.observe(f),()=>{cancelAnimationFrame(p),m.unobserve(f)}}},[]),E.createElement(We.div,{ref:Xs([o,t]),...i,"cmdk-list":"",role:"listbox","aria-label":r,id:u.listId},vd(e,f=>E.createElement("div",{ref:Xs([s,u.listInnerRef]),"cmdk-list-sizer":""},f)))}),f6=E.forwardRef((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:i,contentClassName:o,container:s,...u}=e;return E.createElement(Uv,{open:n,onOpenChange:r},E.createElement(Hv,{container:s},E.createElement(td,{"cmdk-overlay":"",className:i}),E.createElement(nd,{"aria-label":e.label,"cmdk-dialog":"",className:o},E.createElement(YA,{ref:t,...u}))))}),d6=E.forwardRef((e,t)=>Ja(n=>n.filtered.count===0)?E.createElement(We.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),h6=E.forwardRef((e,t)=>{let{progress:n,children:r,label:i="Loading...",...o}=e;return E.createElement(We.div,{ref:t,...o,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":i},vd(e,s=>E.createElement("div",{"aria-hidden":!0},s)))}),In=Object.assign(YA,{List:c6,Item:o6,Input:u6,Group:l6,Separator:s6,Dialog:f6,Empty:d6,Loading:h6});function p6(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function m6(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function WA(e){let t=E.useRef(e);return Qa(()=>{t.current=e}),t}var Qa=typeof window>"u"?E.useEffect:E.useLayoutEffect;function Qo(e){let t=E.useRef();return t.current===void 0&&(t.current=e()),t}function Xs(e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}function Ja(e){let t=ky(),n=()=>e(t.snapshot());return r6.useSyncExternalStore(t.subscribe,n,n)}function XA(e,t,n,r=[]){let i=E.useRef(),o=mu();return Qa(()=>{var s;let u=(()=>{var d;for(let p of n){if(typeof p=="string")return p.trim();if(typeof p=="object"&&"current"in p)return p.current?(d=p.current.textContent)==null?void 0:d.trim():i.current}})(),f=r.map(d=>d.trim());o.value(e,u,f),(s=t.current)==null||s.setAttribute(Ha,u),i.current=u}),i}var g6=()=>{let[e,t]=E.useState(),n=Qo(()=>new Map);return Qa(()=>{n.current.forEach(r=>r()),n.current=new Map},[e]),(r,i)=>{n.current.set(r,i),t({})}};function v6(e){let t=e.type;return typeof t=="function"?t(e.props):"render"in t?t.render(e.props):e}function vd({asChild:e,children:t},n){return e&&E.isValidElement(t)?E.cloneElement(v6(t),{ref:t.ref},n(t.props.children)):n(t)}var y6={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};const KA=Uv,ZA=eC,b6=Hv,QA=E.forwardRef(({className:e,...t},n)=>S.jsx(td,{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}));QA.displayName=td.displayName;const Cy=E.forwardRef(({className:e,children:t,...n},r)=>S.jsxs(b6,{children:[S.jsx(QA,{}),S.jsxs(nd,{ref:r,className:Me("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-top-[48%] fixed top-[50%] left-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border p-6 shadow-lg duration-200 sm:rounded-lg",e),...n,children:[t,S.jsxs(qv,{className:"ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-sm opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-none disabled:pointer-events-none",children:[S.jsx(Ek,{className:"h-4 w-4"}),S.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));Cy.displayName=nd.displayName;const Ty=({className:e,...t})=>S.jsx("div",{className:Me("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});Ty.displayName="DialogHeader";const Ay=E.forwardRef(({className:e,...t},n)=>S.jsx($v,{ref:n,className:Me("text-lg leading-none font-semibold tracking-tight",e),...t}));Ay.displayName=$v.displayName;const Ry=E.forwardRef(({className:e,...t},n)=>S.jsx(Vv,{ref:n,className:Me("text-muted-foreground text-sm",e),...t}));Ry.displayName=Vv.displayName;const yd=E.forwardRef(({className:e,...t},n)=>S.jsx(In,{ref:n,className:Me("bg-popover text-popover-foreground flex h-full w-full flex-col overflow-hidden rounded-md",e),...t}));yd.displayName=In.displayName;const Dy=E.forwardRef(({className:e,...t},n)=>S.jsxs("div",{className:"flex items-center border-b px-3","cmdk-input-wrapper":"",children:[S.jsx(XM,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),S.jsx(In.Input,{ref:n,className:Me("placeholder:text-muted-foreground flex h-11 w-full rounded-md bg-transparent py-3 text-sm outline-none disabled:cursor-not-allowed disabled:opacity-50",e),...t})]}));Dy.displayName=In.Input.displayName;const bd=E.forwardRef(({className:e,...t},n)=>S.jsx(In.List,{ref:n,className:Me("max-h-[300px] overflow-x-hidden overflow-y-auto",e),...t}));bd.displayName=In.List.displayName;const Ny=E.forwardRef((e,t)=>S.jsx(In.Empty,{ref:t,className:"py-6 text-center text-sm",...e}));Ny.displayName=In.Empty.displayName;const Cl=E.forwardRef(({className:e,...t},n)=>S.jsx(In.Group,{ref:n,className:Me("text-foreground [&_[cmdk-group-heading]]:text-muted-foreground overflow-hidden p-1 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium",e),...t}));Cl.displayName=In.Group.displayName;const x6=E.forwardRef(({className:e,...t},n)=>S.jsx(In.Separator,{ref:n,className:Me("bg-border -mx-1 h-px",e),...t}));x6.displayName=In.Separator.displayName;const Tl=E.forwardRef(({className:e,...t},n)=>S.jsx(In.Item,{ref:n,className:Me("data-[selected='true']:bg-accent data-[selected=true]:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",e),...t}));Tl.displayName=In.Item.displayName;const w6=({layout:e,autoRunFor:t})=>{const n=pr(),{stop:r,start:i,isRunning:o}=e;return E.useEffect(()=>{if(!n)return;let s=null;return t!==void 0&&t>-1&&n.getGraph().order>0&&(i(),s=t>0?window.setTimeout(()=>{r()},t):null),()=>{r(),s&&clearTimeout(s)}},[t,i,r,n]),S.jsx(Ot,{size:"icon",onClick:()=>o?r():i(),tooltip:o?"Stop the layout animation":"Start the layout animation",variant:Hr,children:o?S.jsx(HM,{}):S.jsx(VM,{})})},S6=()=>{const e=pr(),[t,n]=E.useState("Circular"),[r,i]=E.useState(!1),o=pU(),s=cU(),u=VU(),f=GU({settings:{margin:1}}),d=wU({maxIterations:20}),p=GA({iterations:20}),m=BU(),v=SU(),g=NU(),w=E.useMemo(()=>({Circular:{layout:o},Circlepack:{layout:s},Random:{layout:u},Noverlaps:{layout:f,worker:m},"Force Directed":{layout:d,worker:v},"Force Atlas":{layout:p,worker:g}}),[s,o,d,p,f,u,v,m,g]),x=E.useCallback(k=>{console.debug(k);const{positions:C}=w[k].layout;RG(e.getGraph(),C(),{duration:500}),n(k)},[w,e]);return S.jsxs(S.Fragment,{children:[S.jsx("div",{children:w[t]&&"worker"in w[t]&&S.jsx(w6,{layout:w[t].worker})}),S.jsx("div",{children:S.jsxs(fd,{open:r,onOpenChange:i,children:[S.jsx(dd,{asChild:!0,children:S.jsx(Ot,{size:"icon",variant:Hr,onClick:()=>i(k=>!k),tooltip:"Layout Graph",children:S.jsx(OM,{})})}),S.jsx(uu,{side:"right",align:"center",className:"p-1",children:S.jsx(yd,{children:S.jsx(bd,{children:S.jsx(Cl,{children:Object.keys(w).map(k=>S.jsx(Tl,{onSelect:()=>{x(k)},className:"cursor-pointer text-xs",children:k},k))})})})})]})})]})};var cf={exports:{}},E6=cf.exports,JS;function _6(){return JS||(JS=1,function(e){(function(t,n,r){function i(f){var d=this,p=u();d.next=function(){var m=2091639*d.s0+d.c*23283064365386963e-26;return d.s0=d.s1,d.s1=d.s2,d.s2=m-(d.c=m|0)},d.c=1,d.s0=p(" "),d.s1=p(" "),d.s2=p(" "),d.s0-=p(f),d.s0<0&&(d.s0+=1),d.s1-=p(f),d.s1<0&&(d.s1+=1),d.s2-=p(f),d.s2<0&&(d.s2+=1),p=null}function o(f,d){return d.c=f.c,d.s0=f.s0,d.s1=f.s1,d.s2=f.s2,d}function s(f,d){var p=new i(f),m=d&&d.state,v=p.next;return v.int32=function(){return p.next()*4294967296|0},v.double=function(){return v()+(v()*2097152|0)*11102230246251565e-32},v.quick=v,m&&(typeof m=="object"&&o(m,p),v.state=function(){return o(p,{})}),v}function u(){var f=4022871197,d=function(p){p=String(p);for(var m=0;m>>0,v-=f,v*=f,f=v>>>0,v-=f,f+=v*4294967296}return(f>>>0)*23283064365386963e-26};return d}n&&n.exports?n.exports=s:this.alea=s})(E6,e)}(cf)),cf.exports}var ff={exports:{}},k6=ff.exports,eE;function C6(){return eE||(eE=1,function(e){(function(t,n,r){function i(u){var f=this,d="";f.x=0,f.y=0,f.z=0,f.w=0,f.next=function(){var m=f.x^f.x<<11;return f.x=f.y,f.y=f.z,f.z=f.w,f.w^=f.w>>>19^m^m>>>8},u===(u|0)?f.x=u:d+=u;for(var p=0;p>>0)/4294967296};return m.double=function(){do var v=d.next()>>>11,g=(d.next()>>>0)/4294967296,w=(v+g)/(1<<21);while(w===0);return w},m.int32=d.next,m.quick=m,p&&(typeof p=="object"&&o(p,d),m.state=function(){return o(d,{})}),m}n&&n.exports?n.exports=s:this.xor128=s})(k6,e)}(ff)),ff.exports}var df={exports:{}},T6=df.exports,tE;function A6(){return tE||(tE=1,function(e){(function(t,n,r){function i(u){var f=this,d="";f.next=function(){var m=f.x^f.x>>>2;return f.x=f.y,f.y=f.z,f.z=f.w,f.w=f.v,(f.d=f.d+362437|0)+(f.v=f.v^f.v<<4^(m^m<<1))|0},f.x=0,f.y=0,f.z=0,f.w=0,f.v=0,u===(u|0)?f.x=u:d+=u;for(var p=0;p>>4),f.next()}function o(u,f){return f.x=u.x,f.y=u.y,f.z=u.z,f.w=u.w,f.v=u.v,f.d=u.d,f}function s(u,f){var d=new i(u),p=f&&f.state,m=function(){return(d.next()>>>0)/4294967296};return m.double=function(){do var v=d.next()>>>11,g=(d.next()>>>0)/4294967296,w=(v+g)/(1<<21);while(w===0);return w},m.int32=d.next,m.quick=m,p&&(typeof p=="object"&&o(p,d),m.state=function(){return o(d,{})}),m}n&&n.exports?n.exports=s:this.xorwow=s})(T6,e)}(df)),df.exports}var hf={exports:{}},R6=hf.exports,nE;function D6(){return nE||(nE=1,function(e){(function(t,n,r){function i(u){var f=this;f.next=function(){var p=f.x,m=f.i,v,g;return v=p[m],v^=v>>>7,g=v^v<<24,v=p[m+1&7],g^=v^v>>>10,v=p[m+3&7],g^=v^v>>>3,v=p[m+4&7],g^=v^v<<7,v=p[m+7&7],v=v^v<<13,g^=v^v<<9,p[m]=g,f.i=m+1&7,g};function d(p,m){var v,g=[];if(m===(m|0))g[0]=m;else for(m=""+m,v=0;v0;--v)p.next()}d(f,u)}function o(u,f){return f.x=u.x.slice(),f.i=u.i,f}function s(u,f){u==null&&(u=+new Date);var d=new i(u),p=f&&f.state,m=function(){return(d.next()>>>0)/4294967296};return m.double=function(){do var v=d.next()>>>11,g=(d.next()>>>0)/4294967296,w=(v+g)/(1<<21);while(w===0);return w},m.int32=d.next,m.quick=m,p&&(p.x&&o(p,d),m.state=function(){return o(d,{})}),m}n&&n.exports?n.exports=s:this.xorshift7=s})(R6,e)}(hf)),hf.exports}var pf={exports:{}},N6=pf.exports,rE;function O6(){return rE||(rE=1,function(e){(function(t,n,r){function i(u){var f=this;f.next=function(){var p=f.w,m=f.X,v=f.i,g,w;return f.w=p=p+1640531527|0,w=m[v+34&127],g=m[v=v+1&127],w^=w<<13,g^=g<<17,w^=w>>>15,g^=g>>>12,w=m[v]=w^g,f.i=v,w+(p^p>>>16)|0};function d(p,m){var v,g,w,x,k,C=[],_=128;for(m===(m|0)?(g=m,m=null):(m=m+"\0",g=0,_=Math.max(_,m.length)),w=0,x=-32;x<_;++x)m&&(g^=m.charCodeAt((x+32)%m.length)),x===0&&(k=g),g^=g<<10,g^=g>>>15,g^=g<<4,g^=g>>>13,x>=0&&(k=k+1640531527|0,v=C[x&127]^=g+k,w=v==0?w+1:0);for(w>=128&&(C[(m&&m.length||0)&127]=-1),w=127,x=4*128;x>0;--x)g=C[w+34&127],v=C[w=w+1&127],g^=g<<13,v^=v<<17,g^=g>>>15,v^=v>>>12,C[w]=g^v;p.w=k,p.X=C,p.i=w}d(f,u)}function o(u,f){return f.i=u.i,f.w=u.w,f.X=u.X.slice(),f}function s(u,f){u==null&&(u=+new Date);var d=new i(u),p=f&&f.state,m=function(){return(d.next()>>>0)/4294967296};return m.double=function(){do var v=d.next()>>>11,g=(d.next()>>>0)/4294967296,w=(v+g)/(1<<21);while(w===0);return w},m.int32=d.next,m.quick=m,p&&(p.X&&o(p,d),m.state=function(){return o(d,{})}),m}n&&n.exports?n.exports=s:this.xor4096=s})(N6,e)}(pf)),pf.exports}var mf={exports:{}},L6=mf.exports,iE;function z6(){return iE||(iE=1,function(e){(function(t,n,r){function i(u){var f=this,d="";f.next=function(){var m=f.b,v=f.c,g=f.d,w=f.a;return m=m<<25^m>>>7^v,v=v-g|0,g=g<<24^g>>>8^w,w=w-m|0,f.b=m=m<<20^m>>>12^v,f.c=v=v-g|0,f.d=g<<16^v>>>16^w,f.a=w-m|0},f.a=0,f.b=0,f.c=-1640531527,f.d=1367130551,u===Math.floor(u)?(f.a=u/4294967296|0,f.b=u|0):d+=u;for(var p=0;p>>0)/4294967296};return m.double=function(){do var v=d.next()>>>11,g=(d.next()>>>0)/4294967296,w=(v+g)/(1<<21);while(w===0);return w},m.int32=d.next,m.quick=m,p&&(typeof p=="object"&&o(p,d),m.state=function(){return o(d,{})}),m}n&&n.exports?n.exports=s:this.tychei=s})(L6,e)}(mf)),mf.exports}var gf={exports:{}};const j6={},M6=Object.freeze(Object.defineProperty({__proto__:null,default:j6},Symbol.toStringTag,{value:"Module"})),P6=lL(M6);var F6=gf.exports,aE;function I6(){return aE||(aE=1,function(e){(function(t,n,r){var i=256,o=6,s=52,u="random",f=r.pow(i,o),d=r.pow(2,s),p=d*2,m=i-1,v;function g(N,D,z){var R=[];D=D==!0?{entropy:!0}:D||{};var B=C(k(D.entropy?[N,T(n)]:N??_(),3),R),P=new w(R),j=function(){for(var V=P.g(o),q=f,I=0;V=p;)V/=2,q/=2,I>>>=1;return(V+I)/q};return j.int32=function(){return P.g(4)|0},j.quick=function(){return P.g(4)/4294967296},j.double=j,C(T(P.S),n),(D.pass||z||function(V,q,I,Y){return Y&&(Y.S&&x(Y,P),V.state=function(){return x(P,{})}),I?(r[u]=V,q):V})(j,B,"global"in D?D.global:this==r,D.state)}function w(N){var D,z=N.length,R=this,B=0,P=R.i=R.j=0,j=R.S=[];for(z||(N=[z++]);B{if(!e||!Array.isArray(e.nodes)||!Array.isArray(e.edges))return!1;for(const t of e.nodes)if(!t.id||!t.labels||!t.properties)return!1;for(const t of e.edges)if(!t.id||!t.source||!t.target)return!1;for(const t of e.edges){const n=e.getNode(t.source),r=e.getNode(t.target);if(n==null||r==null)return!1}return!0},$6=async e=>{let t=null;try{t=await nM(e)}catch(r){return Mn.getState().setErrorMessage(Cr(r),"Query Graphs Error!"),null}let n=null;if(t){const r={},i={};for(let f=0;f0){const f=bz-Qw;for(const d of t.nodes)d.size=Math.round(Qw+f*Math.pow((d.degree-o)/u,.5))}n=new nU,n.nodes=t.nodes,n.edges=t.edges,n.nodeIdMap=r,n.edgeIdMap=i,H6(n)||(n=null,console.error("Invalid graph data")),console.log("Graph data loaded")}return n},V6=e=>{const t=new Ws;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:mz,borderSize:.2});for(const n of(e==null?void 0:e.edges)??[])n.dynamicId=t.addDirectedEdge(n.source,n.target,{label:n.type||void 0});return t},lE={label:""},JA=()=>{const e=Qe.use.queryLabel(),t=yt.use.rawGraph(),n=yt.use.sigmaGraph(),r=E.useCallback(s=>(t==null?void 0:t.getNode(s))||null,[t]),i=E.useCallback((s,u=!0)=>(t==null?void 0:t.getEdge(s,u))||null,[t]);return E.useEffect(()=>{if(e){if(lE.label!==e){lE.label=e;const s=yt.getState();s.reset(),$6(e).then(u=>{s.setSigmaGraph(V6(u)),u==null||u.buildDynamicMap(),s.setRawGraph(u)})}}else{const s=yt.getState();s.reset(),s.setSigmaGraph(new Ws)}},[e]),{lightrageGraph:E.useCallback(()=>{if(n)return n;const s=new Ws;return yt.getState().setSigmaGraph(s),s},[n]),getNode:r,getEdge:i}},Vc=e=>!!(e.type.startsWith("mouse")&&e.buttons!==0),q6=({disableHoverEffect:e})=>{const{lightrageGraph:t}=JA(),n=pr(),r=bA(),i=yA(),o=rB(),{assign:s}=GA({iterations:20}),{theme:u}=hT(),f=Qe.use.enableHideUnselectedEdges(),d=yt.use.selectedNode(),p=yt.use.focusedNode(),m=yt.use.selectedEdge(),v=yt.use.focusedEdge();return E.useEffect(()=>{const g=t();o(g),g.__force_applied||(s(),Object.assign(g,{__force_applied:!0}));const{setFocusedNode:w,setSelectedNode:x,setFocusedEdge:k,setSelectedEdge:C,clearSelection:_}=yt.getState();r({enterNode:T=>{Vc(T.event.original)||w(T.node)},leaveNode:T=>{Vc(T.event.original)||w(null)},clickNode:T=>{x(T.node),C(null)},clickEdge:T=>{C(T.edge),x(null)},enterEdge:T=>{Vc(T.event.original)||k(T.edge)},leaveEdge:T=>{Vc(T.event.original)||k(null)},clickStage:()=>_()})},[s,o,r,t]),E.useEffect(()=>{const g=u==="dark",w=g?dz:void 0,x=g?vz:void 0;i({nodeReducer:(k,C)=>{const _=n.getGraph(),T={...C,highlighted:C.highlighted||!1,labelColor:w};if(!e){T.highlighted=!1;const N=p||d,D=v||m;if(N)(k===N||_.neighbors(N).includes(k))&&(T.highlighted=!0,k===d&&(T.borderColor=gz));else if(D)_.extremities(D).includes(k)&&(T.highlighted=!0,T.size=3);else return T;T.highlighted?g&&(T.labelColor=hz):T.color=pz}return T},edgeReducer:(k,C)=>{const _=n.getGraph(),T={...C,hidden:!1,labelColor:w,color:x};if(!e){const N=p||d;N?f?_.extremities(k).includes(N)||(T.hidden=!0):_.extremities(k).includes(N)&&(T.color=Zw):(v||m)&&(k===m?T.color=yz:k===v?T.color=Zw:f&&(T.hidden=!0))}return T}})},[d,p,m,v,i,n,e,u,f]),null},Y6=()=>{const{zoomIn:e,zoomOut:t,reset:n}=xA({duration:200,factor:1.5}),r=E.useCallback(()=>e(),[e]),i=E.useCallback(()=>t(),[t]),o=E.useCallback(()=>n(),[n]);return S.jsxs(S.Fragment,{children:[S.jsx(Ot,{variant:Hr,onClick:r,tooltip:"Zoom In",size:"icon",children:S.jsx(lP,{})}),S.jsx(Ot,{variant:Hr,onClick:i,tooltip:"Zoom Out",size:"icon",children:S.jsx(uP,{})}),S.jsx(Ot,{variant:Hr,onClick:o,tooltip:"Reset Zoom",size:"icon",children:S.jsx(AM,{})})]})},W6=()=>{const{isFullScreen:e,toggle:t}=iB();return S.jsx(S.Fragment,{children:e?S.jsx(Ot,{variant:Hr,onClick:t,tooltip:"Windowed",size:"icon",children:S.jsx(IM,{})}):S.jsx(Ot,{variant:Hr,onClick:t,tooltip:"Full Screen",size:"icon",children:S.jsx(PM,{})})})};function eR(e){const t=E.useRef({value:e,previous:e});return E.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var Oy="Checkbox",[X6,pK]=hr(Oy),[K6,Z6]=X6(Oy),tR=E.forwardRef((e,t)=>{const{__scopeCheckbox:n,name:r,checked:i,defaultChecked:o,required:s,disabled:u,value:f="on",onCheckedChange:d,form:p,...m}=e,[v,g]=E.useState(null),w=dt(t,N=>g(N)),x=E.useRef(!1),k=v?p||!!v.closest("form"):!0,[C=!1,_]=_i({prop:i,defaultProp:o,onChange:d}),T=E.useRef(C);return E.useEffect(()=>{const N=v==null?void 0:v.form;if(N){const D=()=>_(T.current);return N.addEventListener("reset",D),()=>N.removeEventListener("reset",D)}},[v,_]),S.jsxs(K6,{scope:n,state:C,disabled:u,children:[S.jsx(We.button,{type:"button",role:"checkbox","aria-checked":la(C)?"mixed":C,"aria-required":s,"data-state":iR(C),"data-disabled":u?"":void 0,disabled:u,value:f,...m,ref:w,onKeyDown:qe(e.onKeyDown,N=>{N.key==="Enter"&&N.preventDefault()}),onClick:qe(e.onClick,N=>{_(D=>la(D)?!0:!D),k&&(x.current=N.isPropagationStopped(),x.current||N.stopPropagation())})}),k&&S.jsx(Q6,{control:v,bubbles:!x.current,name:r,value:f,checked:C,required:s,disabled:u,form:p,style:{transform:"translateX(-100%)"},defaultChecked:la(o)?!1:o})]})});tR.displayName=Oy;var nR="CheckboxIndicator",rR=E.forwardRef((e,t)=>{const{__scopeCheckbox:n,forceMount:r,...i}=e,o=Z6(nR,n);return S.jsx(Zn,{present:r||la(o.state)||o.state===!0,children:S.jsx(We.span,{"data-state":iR(o.state),"data-disabled":o.disabled?"":void 0,...i,ref:t,style:{pointerEvents:"none",...e.style}})})});rR.displayName=nR;var Q6=e=>{const{control:t,checked:n,bubbles:r=!0,defaultChecked:i,...o}=e,s=E.useRef(null),u=eR(n),f=DC(t);E.useEffect(()=>{const p=s.current,m=window.HTMLInputElement.prototype,g=Object.getOwnPropertyDescriptor(m,"checked").set;if(u!==n&&g){const w=new Event("click",{bubbles:r});p.indeterminate=la(n),g.call(p,la(n)?!1:n),p.dispatchEvent(w)}},[u,n,r]);const d=E.useRef(la(n)?!1:n);return S.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:i??d.current,...o,tabIndex:-1,ref:s,style:{...e.style,...f,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function la(e){return e==="indeterminate"}function iR(e){return la(e)?"indeterminate":e?"checked":"unchecked"}var aR=tR,J6=rR;const Bs=E.forwardRef(({className:e,...t},n)=>S.jsx(aR,{ref:n,className:Me("peer border-primary ring-offset-background focus-visible:ring-ring data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground h-4 w-4 shrink-0 rounded-sm border focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50",e),...t,children:S.jsx(J6,{className:Me("flex items-center justify-center text-current"),children:S.jsx(Lv,{className:"h-4 w-4"})})}));Bs.displayName=aR.displayName;var eH="Separator",sE="horizontal",tH=["horizontal","vertical"],oR=E.forwardRef((e,t)=>{const{decorative:n,orientation:r=sE,...i}=e,o=nH(r)?r:sE,u=n?{role:"none"}:{"aria-orientation":o==="vertical"?o:void 0,role:"separator"};return S.jsx(We.div,{"data-orientation":o,...u,...i,ref:t})});oR.displayName=eH;function nH(e){return tH.includes(e)}var lR=oR;const Fs=E.forwardRef(({className:e,orientation:t="horizontal",decorative:n=!0,...r},i)=>S.jsx(lR,{ref:i,decorative:n,orientation:t,className:Me("bg-border shrink-0",t==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",e),...r}));Fs.displayName=lR.displayName;const na=({checked:e,onCheckedChange:t,label:n})=>S.jsxs("div",{className:"flex items-center gap-2",children:[S.jsx(Bs,{checked:e,onCheckedChange:t}),S.jsx("label",{htmlFor:"terms",className:"text-sm leading-none font-medium peer-disabled:cursor-not-allowed peer-disabled:opacity-70",children:n})]});function rH(){const[e,t]=E.useState(!1),[n,r]=E.useState(""),i=Qe.use.showPropertyPanel(),o=Qe.use.showNodeSearchBar(),s=Qe.use.showNodeLabel(),u=Qe.use.enableEdgeEvents(),f=Qe.use.enableNodeDrag(),d=Qe.use.enableHideUnselectedEdges(),p=Qe.use.showEdgeLabel(),m=Qe.use.enableHealthCheck(),v=Qe.use.apiKey();E.useEffect(()=>{r(v||"")},[v,e]);const g=E.useCallback(()=>Qe.setState(R=>({enableNodeDrag:!R.enableNodeDrag})),[]),w=E.useCallback(()=>Qe.setState(R=>({enableEdgeEvents:!R.enableEdgeEvents})),[]),x=E.useCallback(()=>Qe.setState(R=>({enableHideUnselectedEdges:!R.enableHideUnselectedEdges})),[]),k=E.useCallback(()=>Qe.setState(R=>({showEdgeLabel:!R.showEdgeLabel})),[]),C=E.useCallback(()=>Qe.setState(R=>({showPropertyPanel:!R.showPropertyPanel})),[]),_=E.useCallback(()=>Qe.setState(R=>({showNodeSearchBar:!R.showNodeSearchBar})),[]),T=E.useCallback(()=>Qe.setState(R=>({showNodeLabel:!R.showNodeLabel})),[]),N=E.useCallback(()=>Qe.setState(R=>({enableHealthCheck:!R.enableHealthCheck})),[]),D=E.useCallback(async()=>{Qe.setState({apiKey:n||null}),await Mn.getState().check(),t(!1)},[n]),z=E.useCallback(R=>{r(R.target.value)},[r]);return S.jsxs(fd,{open:e,onOpenChange:t,children:[S.jsx(dd,{asChild:!0,children:S.jsx(Ot,{variant:Hr,tooltip:"Settings",size:"icon",children:S.jsx(JM,{})})}),S.jsx(uu,{side:"right",align:"start",className:"mb-2 p-2",onCloseAutoFocus:R=>R.preventDefault(),children:S.jsxs("div",{className:"flex flex-col gap-2",children:[S.jsx(na,{checked:i,onCheckedChange:C,label:"Show Property Panel"}),S.jsx(na,{checked:o,onCheckedChange:_,label:"Show Search Bar"}),S.jsx(Fs,{}),S.jsx(na,{checked:s,onCheckedChange:T,label:"Show Node Label"}),S.jsx(na,{checked:f,onCheckedChange:g,label:"Node Draggable"}),S.jsx(Fs,{}),S.jsx(na,{checked:p,onCheckedChange:k,label:"Show Edge Label"}),S.jsx(na,{checked:d,onCheckedChange:x,label:"Hide Unselected Edges"}),S.jsx(na,{checked:u,onCheckedChange:w,label:"Edge Events"}),S.jsx(Fs,{}),S.jsx(na,{checked:m,onCheckedChange:N,label:"Health Check"}),S.jsx(Fs,{}),S.jsxs("div",{className:"flex flex-col gap-2",children:[S.jsx("label",{className:"text-sm font-medium",children:"API Key"}),S.jsxs("form",{className:"flex h-6 gap-2",onSubmit:R=>R.preventDefault(),children:[S.jsx("div",{className:"w-0 flex-1",children:S.jsx(Za,{type:"password",value:n,onChange:z,placeholder:"Enter your API key",className:"max-h-full w-full min-w-0",autoComplete:"off"})}),S.jsx(Ot,{onClick:D,variant:"outline",size:"sm",className:"max-h-full shrink-0",children:"Save"})]})]})]})})]})}const iH="ENTRIES",sR="KEYS",uR="VALUES",sn="";class Hm{constructor(t,n){const r=t._tree,i=Array.from(r.keys());this.set=t,this._type=n,this._path=i.length>0?[{node:r,keys:i}]:[]}next(){const t=this.dive();return this.backtrack(),t}dive(){if(this._path.length===0)return{done:!0,value:void 0};const{node:t,keys:n}=Wo(this._path);if(Wo(n)===sn)return{done:!1,value:this.result()};const r=t.get(Wo(n));return this._path.push({node:r,keys:Array.from(r.keys())}),this.dive()}backtrack(){if(this._path.length===0)return;const t=Wo(this._path).keys;t.pop(),!(t.length>0)&&(this._path.pop(),this.backtrack())}key(){return this.set._prefix+this._path.map(({keys:t})=>Wo(t)).filter(t=>t!==sn).join("")}value(){return Wo(this._path).node.get(sn)}result(){switch(this._type){case uR:return this.value();case sR:return this.key();default:return[this.key(),this.value()]}}[Symbol.iterator](){return this}}const Wo=e=>e[e.length-1],aH=(e,t,n)=>{const r=new Map;if(t===void 0)return r;const i=t.length+1,o=i+n,s=new Uint8Array(o*i).fill(n+1);for(let u=0;u{const f=o*s;e:for(const d of e.keys())if(d===sn){const p=i[f-1];p<=n&&r.set(u,[e.get(d),p])}else{let p=o;for(let m=0;mn)continue e}cR(e.get(d),t,n,r,i,p,s,u+d)}};class oa{constructor(t=new Map,n=""){this._size=void 0,this._tree=t,this._prefix=n}atPrefix(t){if(!t.startsWith(this._prefix))throw new Error("Mismatched prefix");const[n,r]=Df(this._tree,t.slice(this._prefix.length));if(n===void 0){const[i,o]=Ly(r);for(const s of i.keys())if(s!==sn&&s.startsWith(o)){const u=new Map;return u.set(s.slice(o.length),i.get(s)),new oa(u,t)}}return new oa(n,t)}clear(){this._size=void 0,this._tree.clear()}delete(t){return this._size=void 0,oH(this._tree,t)}entries(){return new Hm(this,iH)}forEach(t){for(const[n,r]of this)t(n,r,this)}fuzzyGet(t,n){return aH(this._tree,t,n)}get(t){const n=Zg(this._tree,t);return n!==void 0?n.get(sn):void 0}has(t){const n=Zg(this._tree,t);return n!==void 0&&n.has(sn)}keys(){return new Hm(this,sR)}set(t,n){if(typeof t!="string")throw new Error("key must be a string");return this._size=void 0,$m(this._tree,t).set(sn,n),this}get size(){if(this._size)return this._size;this._size=0;const t=this.entries();for(;!t.next().done;)this._size+=1;return this._size}update(t,n){if(typeof t!="string")throw new Error("key must be a string");this._size=void 0;const r=$m(this._tree,t);return r.set(sn,n(r.get(sn))),this}fetch(t,n){if(typeof t!="string")throw new Error("key must be a string");this._size=void 0;const r=$m(this._tree,t);let i=r.get(sn);return i===void 0&&r.set(sn,i=n()),i}values(){return new Hm(this,uR)}[Symbol.iterator](){return this.entries()}static from(t){const n=new oa;for(const[r,i]of t)n.set(r,i);return n}static fromObject(t){return oa.from(Object.entries(t))}}const Df=(e,t,n=[])=>{if(t.length===0||e==null)return[e,n];for(const r of e.keys())if(r!==sn&&t.startsWith(r))return n.push([e,r]),Df(e.get(r),t.slice(r.length),n);return n.push([e,t]),Df(void 0,"",n)},Zg=(e,t)=>{if(t.length===0||e==null)return e;for(const n of e.keys())if(n!==sn&&t.startsWith(n))return Zg(e.get(n),t.slice(n.length))},$m=(e,t)=>{const n=t.length;e:for(let r=0;e&&r{const[n,r]=Df(e,t);if(n!==void 0){if(n.delete(sn),n.size===0)fR(r);else if(n.size===1){const[i,o]=n.entries().next().value;dR(r,i,o)}}},fR=e=>{if(e.length===0)return;const[t,n]=Ly(e);if(t.delete(n),t.size===0)fR(e.slice(0,-1));else if(t.size===1){const[r,i]=t.entries().next().value;r!==sn&&dR(e.slice(0,-1),r,i)}},dR=(e,t,n)=>{if(e.length===0)return;const[r,i]=Ly(e);r.set(i+t,n),r.delete(i)},Ly=e=>e[e.length-1],zy="or",hR="and",lH="and_not";class sa{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?Ym:t.autoVacuum;this._options={...qm,...t,autoVacuum:n,searchOptions:{...uE,...t.searchOptions||{}},autoSuggestOptions:{...dH,...t.autoSuggestOptions||{}}},this._index=new oa,this._documentCount=0,this._documentIds=new Map,this._idToShortId=new Map,this._fieldIds={},this._fieldLength=new Map,this._avgFieldLength=[],this._nextId=0,this._storedFields=new Map,this._dirtCount=0,this._currentVacuum=null,this._enqueuedVacuum=null,this._enqueuedVacuumConditions=Jg,this.addFields(this._options.fields)}add(t){const{extractField:n,tokenize:r,processTerm:i,fields:o,idField:s}=this._options,u=n(t,s);if(u==null)throw new Error(`MiniSearch: document does not have ID field "${s}"`);if(this._idToShortId.has(u))throw new Error(`MiniSearch: duplicate ID ${u}`);const f=this.addDocumentId(u);this.saveStoredFields(f,t);for(const d of o){const p=n(t,d);if(p==null)continue;const m=r(p.toString(),d),v=this._fieldIds[d],g=new Set(m).size;this.addFieldLength(f,v,this._documentCount-1,g);for(const w of m){const x=i(w,d);if(Array.isArray(x))for(const k of x)this.addTerm(v,f,k);else x&&this.addTerm(v,f,x)}}}addAll(t){for(const n of t)this.add(n)}addAllAsync(t,n={}){const{chunkSize:r=10}=n,i={chunk:[],promise:Promise.resolve()},{chunk:o,promise:s}=t.reduce(({chunk:u,promise:f},d,p)=>(u.push(d),(p+1)%r===0?{chunk:[],promise:f.then(()=>new Promise(m=>setTimeout(m,0))).then(()=>this.addAll(u))}:{chunk:u,promise:f}),i);return s.then(()=>this.addAll(o))}remove(t){const{tokenize:n,processTerm:r,extractField:i,fields:o,idField:s}=this._options,u=i(t,s);if(u==null)throw new Error(`MiniSearch: document does not have ID field "${s}"`);const f=this._idToShortId.get(u);if(f==null)throw new Error(`MiniSearch: cannot remove document with ID ${u}: it is not in the index`);for(const d of o){const p=i(t,d);if(p==null)continue;const m=n(p.toString(),d),v=this._fieldIds[d],g=new Set(m).size;this.removeFieldLength(f,v,this._documentCount,g);for(const w of m){const x=r(w,d);if(Array.isArray(x))for(const k of x)this.removeTerm(v,f,k);else x&&this.removeTerm(v,f,x)}}this._storedFields.delete(f),this._documentIds.delete(f),this._idToShortId.delete(u),this._fieldLength.delete(f),this._documentCount-=1}removeAll(t){if(t)for(const n of t)this.remove(n);else{if(arguments.length>0)throw new Error("Expected documents to be present. Omit the argument to remove all documents.");this._index=new oa,this._documentCount=0,this._documentIds=new Map,this._idToShortId=new Map,this._fieldLength=new Map,this._avgFieldLength=[],this._storedFields=new Map,this._nextId=0}}discard(t){const n=this._idToShortId.get(t);if(n==null)throw new Error(`MiniSearch: cannot discard document with ID ${t}: it is not in the index`);this._idToShortId.delete(t),this._documentIds.delete(n),this._storedFields.delete(n),(this._fieldLength.get(n)||[]).forEach((r,i)=>{this.removeFieldLength(n,i,this._documentCount,r)}),this._fieldLength.delete(n),this._documentCount-=1,this._dirtCount+=1,this.maybeAutoVacuum()}maybeAutoVacuum(){if(this._options.autoVacuum===!1)return;const{minDirtFactor:t,minDirtCount:n,batchSize:r,batchWait:i}=this._options.autoVacuum;this.conditionalVacuum({batchSize:r,batchWait:i},{minDirtCount:n,minDirtFactor:t})}discardAll(t){const n=this._options.autoVacuum;try{this._options.autoVacuum=!1;for(const r of t)this.discard(r)}finally{this._options.autoVacuum=n}this.maybeAutoVacuum()}replace(t){const{idField:n,extractField:r}=this._options,i=r(t,n);this.discard(i),this.add(t)}vacuum(t={}){return this.conditionalVacuum(t)}conditionalVacuum(t,n){return this._currentVacuum?(this._enqueuedVacuumConditions=this._enqueuedVacuumConditions&&n,this._enqueuedVacuum!=null?this._enqueuedVacuum:(this._enqueuedVacuum=this._currentVacuum.then(()=>{const r=this._enqueuedVacuumConditions;return this._enqueuedVacuumConditions=Jg,this.performVacuuming(t,r)}),this._enqueuedVacuum)):this.vacuumConditionsMet(n)===!1?Promise.resolve():(this._currentVacuum=this.performVacuuming(t),this._currentVacuum)}async performVacuuming(t,n){const r=this._dirtCount;if(this.vacuumConditionsMet(n)){const i=t.batchSize||Qg.batchSize,o=t.batchWait||Qg.batchWait;let s=1;for(const[u,f]of this._index){for(const[d,p]of f)for(const[m]of p)this._documentIds.has(m)||(p.size<=1?f.delete(d):p.delete(m));this._index.get(u).size===0&&this._index.delete(u),s%i===0&&await new Promise(d=>setTimeout(d,o)),s+=1}this._dirtCount-=r}await null,this._currentVacuum=this._enqueuedVacuum,this._enqueuedVacuum=null}vacuumConditionsMet(t){if(t==null)return!0;let{minDirtCount:n,minDirtFactor:r}=t;return n=n||Ym.minDirtCount,r=r||Ym.minDirtFactor,this.dirtCount>=n&&this.dirtFactor>=r}get isVacuuming(){return this._currentVacuum!=null}get dirtCount(){return this._dirtCount}get dirtFactor(){return this._dirtCount/(1+this._documentCount+this._dirtCount)}has(t){return this._idToShortId.has(t)}getStoredFields(t){const n=this._idToShortId.get(t);if(n!=null)return this._storedFields.get(n)}search(t,n={}){const{searchOptions:r}=this._options,i={...r,...n},o=this.executeQuery(t,n),s=[];for(const[u,{score:f,terms:d,match:p}]of o){const m=d.length||1,v={id:this._documentIds.get(u),score:f*m,terms:Object.keys(p),queryTerms:d,match:p};Object.assign(v,this._storedFields.get(u)),(i.filter==null||i.filter(v))&&s.push(v)}return t===sa.wildcard&&i.boostDocument==null||s.sort(fE),s}autoSuggest(t,n={}){n={...this._options.autoSuggestOptions,...n};const r=new Map;for(const{score:o,terms:s}of this.search(t,n)){const u=s.join(" "),f=r.get(u);f!=null?(f.score+=o,f.count+=1):r.set(u,{score:o,terms:s,count:1})}const i=[];for(const[o,{score:s,terms:u,count:f}]of r)i.push({suggestion:o,terms:u,score:s/f});return i.sort(fE),i}get documentCount(){return this._documentCount}get termCount(){return this._index.size}static loadJSON(t,n){if(n==null)throw new Error("MiniSearch: loadJSON should be given the same options used when serializing the index");return this.loadJS(JSON.parse(t),n)}static async loadJSONAsync(t,n){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(qm.hasOwnProperty(t))return Vm(qm,t);throw new Error(`MiniSearch: unknown option "${t}"`)}static loadJS(t,n){const{index:r,documentIds:i,fieldLength:o,storedFields:s,serializationVersion:u}=t,f=this.instantiateMiniSearch(t,n);f._documentIds=qc(i),f._fieldLength=qc(o),f._storedFields=qc(s);for(const[d,p]of f._documentIds)f._idToShortId.set(p,d);for(const[d,p]of r){const m=new Map;for(const v of Object.keys(p)){let g=p[v];u===1&&(g=g.ds),m.set(parseInt(v,10),qc(g))}f._index.set(d,m)}return f}static async loadJSAsync(t,n){const{index:r,documentIds:i,fieldLength:o,storedFields:s,serializationVersion:u}=t,f=this.instantiateMiniSearch(t,n);f._documentIds=await Yc(i),f._fieldLength=await Yc(o),f._storedFields=await Yc(s);for(const[p,m]of f._documentIds)f._idToShortId.set(m,p);let d=0;for(const[p,m]of r){const v=new Map;for(const g of Object.keys(m)){let w=m[g];u===1&&(w=w.ds),v.set(parseInt(g,10),await Yc(w))}++d%1e3===0&&await pR(0),f._index.set(p,v)}return f}static instantiateMiniSearch(t,n){const{documentCount:r,nextId:i,fieldIds:o,averageFieldLength:s,dirtCount:u,serializationVersion:f}=t;if(f!==1&&f!==2)throw new Error("MiniSearch: cannot deserialize an index created with an incompatible version");const d=new sa(n);return d._documentCount=r,d._nextId=i,d._idToShortId=new Map,d._fieldIds=o,d._avgFieldLength=s,d._dirtCount=u||0,d._index=new oa,d}executeQuery(t,n={}){if(t===sa.wildcard)return this.executeWildcardQuery(n);if(typeof t!="string"){const v={...n,...t,queries:void 0},g=t.queries.map(w=>this.executeQuery(w,v));return this.combineResults(g,v.combineWith)}const{tokenize:r,processTerm:i,searchOptions:o}=this._options,s={tokenize:r,processTerm:i,...o,...n},{tokenize:u,processTerm:f}=s,m=u(t).flatMap(v=>f(v)).filter(v=>!!v).map(fH(s)).map(v=>this.executeQuerySpec(v,s));return this.combineResults(m,s.combineWith)}executeQuerySpec(t,n){const r={...this._options.searchOptions,...n},i=(r.fields||this._options.fields).reduce((x,k)=>({...x,[k]:Vm(r.boost,k)||1}),{}),{boostDocument:o,weights:s,maxFuzzy:u,bm25:f}=r,{fuzzy:d,prefix:p}={...uE.weights,...s},m=this._index.get(t.term),v=this.termResults(t.term,t.term,1,t.termBoost,m,i,o,f);let g,w;if(t.prefix&&(g=this._index.atPrefix(t.term)),t.fuzzy){const x=t.fuzzy===!0?.2:t.fuzzy,k=x<1?Math.min(u,Math.round(t.term.length*x)):x;k&&(w=this._index.fuzzyGet(t.term,k))}if(g)for(const[x,k]of g){const C=x.length-t.term.length;if(!C)continue;w==null||w.delete(x);const _=p*x.length/(x.length+.3*C);this.termResults(t.term,x,_,t.termBoost,k,i,o,f,v)}if(w)for(const x of w.keys()){const[k,C]=w.get(x);if(!C)continue;const _=d*x.length/(x.length+C);this.termResults(t.term,x,_,t.termBoost,k,i,o,f,v)}return v}executeWildcardQuery(t){const n=new Map,r={...this._options.searchOptions,...t};for(const[i,o]of this._documentIds){const s=r.boostDocument?r.boostDocument(o,"",this._storedFields.get(i)):1;n.set(i,{score:s,terms:[],match:{}})}return n}combineResults(t,n=zy){if(t.length===0)return new Map;const r=n.toLowerCase(),i=sH[r];if(!i)throw new Error(`Invalid combination operator: ${n}`);return t.reduce(i)||new Map}toJSON(){const t=[];for(const[n,r]of this._index){const i={};for(const[o,s]of r)i[o]=Object.fromEntries(s);t.push([n,i])}return{documentCount:this._documentCount,nextId:this._nextId,documentIds:Object.fromEntries(this._documentIds),fieldIds:this._fieldIds,fieldLength:Object.fromEntries(this._fieldLength),averageFieldLength:this._avgFieldLength,storedFields:Object.fromEntries(this._storedFields),dirtCount:this._dirtCount,index:t,serializationVersion:2}}termResults(t,n,r,i,o,s,u,f,d=new Map){if(o==null)return d;for(const p of Object.keys(s)){const m=s[p],v=this._fieldIds[p],g=o.get(v);if(g==null)continue;let w=g.size;const x=this._avgFieldLength[v];for(const k of g.keys()){if(!this._documentIds.has(k)){this.removeTerm(v,k,n),w-=1;continue}const C=u?u(this._documentIds.get(k),n,this._storedFields.get(k)):1;if(!C)continue;const _=g.get(k),T=this._fieldLength.get(k)[v],N=cH(_,w,this._documentCount,T,x,f),D=r*i*m*C*N,z=d.get(k);if(z){z.score+=D,hH(z.terms,t);const R=Vm(z.match,n);R?R.push(p):z.match[n]=[p]}else d.set(k,{score:D,terms:[t],match:{[n]:[p]}})}}return d}addTerm(t,n,r){const i=this._index.fetch(r,dE);let o=i.get(t);if(o==null)o=new Map,o.set(n,1),i.set(t,o);else{const s=o.get(n);o.set(n,(s||0)+1)}}removeTerm(t,n,r){if(!this._index.has(r)){this.warnDocumentChanged(n,t,r);return}const i=this._index.fetch(r,dE),o=i.get(t);o==null||o.get(n)==null?this.warnDocumentChanged(n,t,r):o.get(n)<=1?o.size<=1?i.delete(t):o.delete(n):o.set(n,o.get(n)-1),this._index.get(r).size===0&&this._index.delete(r)}warnDocumentChanged(t,n,r){for(const i of Object.keys(this._fieldIds))if(this._fieldIds[i]===n){this._options.logger("warn",`MiniSearch: document with ID ${this._documentIds.get(t)} has changed before removal: term "${r}" was not present in field "${i}". Removing a document after it has changed can corrupt the index!`,"version_conflict");return}}addDocumentId(t){const n=this._nextId;return this._idToShortId.set(t,n),this._documentIds.set(n,t),this._documentCount+=1,this._nextId+=1,n}addFields(t){for(let n=0;nObject.prototype.hasOwnProperty.call(e,t)?e[t]:void 0,sH={[zy]:(e,t)=>{for(const n of t.keys()){const r=e.get(n);if(r==null)e.set(n,t.get(n));else{const{score:i,terms:o,match:s}=t.get(n);r.score=r.score+i,r.match=Object.assign(r.match,s),cE(r.terms,o)}}return e},[hR]:(e,t)=>{const n=new Map;for(const r of t.keys()){const i=e.get(r);if(i==null)continue;const{score:o,terms:s,match:u}=t.get(r);cE(i.terms,s),n.set(r,{score:i.score+o,terms:i.terms,match:Object.assign(i.match,u)})}return n},[lH]:(e,t)=>{for(const n of t.keys())e.delete(n);return e}},uH={k:1.2,b:.7,d:.5},cH=(e,t,n,r,i,o)=>{const{k:s,b:u,d:f}=o;return Math.log(1+(n-t+.5)/(t+.5))*(f+e*(s+1)/(e+s*(1-u+u*r/i)))},fH=e=>(t,n,r)=>{const i=typeof e.fuzzy=="function"?e.fuzzy(t,n,r):e.fuzzy||!1,o=typeof e.prefix=="function"?e.prefix(t,n,r):e.prefix===!0,s=typeof e.boostTerm=="function"?e.boostTerm(t,n,r):1;return{term:t,fuzzy:i,prefix:o,termBoost:s}},qm={idField:"id",extractField:(e,t)=>e[t],tokenize:e=>e.split(pH),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},uE={combineWith:zy,prefix:!1,fuzzy:!1,maxFuzzy:6,boost:{},weights:{fuzzy:.45,prefix:.375},bm25:uH},dH={combineWith:hR,prefix:(e,t,n)=>t===n.length-1},Qg={batchSize:1e3,batchWait:10},Jg={minDirtFactor:.1,minDirtCount:20},Ym={...Qg,...Jg},hH=(e,t)=>{e.includes(t)||e.push(t)},cE=(e,t)=>{for(const n of t)e.includes(n)||e.push(n)},fE=({score:e},{score:t})=>t-e,dE=()=>new Map,qc=e=>{const t=new Map;for(const n of Object.keys(e))t.set(parseInt(n,10),e[n]);return t},Yc=async e=>{const t=new Map;let n=0;for(const r of Object.keys(e))t.set(parseInt(r,10),e[r]),++n%1e3===0&&await pR(0);return t},pR=e=>new Promise(t=>setTimeout(t,e)),pH=/[\n\r\p{Z}\p{P}]+/u,mH={index:new sa({fields:[]})};E.createContext(mH);const ev=({label:e,color:t,hidden:n,labels:r={}})=>be.createElement("div",{className:"node"},be.createElement("span",{className:"render "+(n?"circle":"disc"),style:{backgroundColor:t||"#000"}}),be.createElement("span",{className:`label ${n?"text-muted":""} ${e?"":"text-italic"}`},e||r.no_label||"No label")),gH=({id:e,labels:t})=>{const n=pr(),r=E.useMemo(()=>{const i=n.getGraph().getNodeAttributes(e),o=n.getSetting("nodeReducer");return Object.assign(Object.assign({color:n.getSetting("defaultNodeColor")},i),o?o(e,i):{})},[n,e]);return be.createElement(ev,Object.assign({},r,{labels:t}))},vH=({label:e,color:t,source:n,target:r,hidden:i,directed:o,labels:s={}})=>be.createElement("div",{className:"edge"},be.createElement(ev,Object.assign({},n,{labels:s})),be.createElement("div",{className:"body"},be.createElement("div",{className:"render"},be.createElement("span",{className:i?"dotted":"dash",style:{borderColor:t||"#000"}})," ",o&&be.createElement("span",{className:"arrow",style:{borderTopColor:t||"#000"}})),be.createElement("span",{className:`label ${i?"text-muted":""} ${e?"":"fst-italic"}`},e||s.no_label||"No label")),be.createElement(ev,Object.assign({},r,{labels:s}))),yH=({id:e,labels:t})=>{const n=pr(),r=E.useMemo(()=>{const i=n.getGraph().getEdgeAttributes(e),o=n.getSetting("nodeReducer"),s=n.getSetting("edgeReducer"),u=n.getGraph().getNodeAttributes(n.getGraph().source(e)),f=n.getGraph().getNodeAttributes(n.getGraph().target(e));return Object.assign(Object.assign(Object.assign({color:n.getSetting("defaultEdgeColor"),directed:n.getGraph().isDirected(e)},i),s?s(e,i):{}),{source:Object.assign(Object.assign({color:n.getSetting("defaultNodeColor")},u),o?o(e,u):{}),target:Object.assign(Object.assign({color:n.getSetting("defaultNodeColor")},f),o?o(e,f):{})})},[n,e]);return be.createElement(vH,Object.assign({},r,{labels:t}))};function jy(e,t){const[n,r]=E.useState(e);return E.useEffect(()=>{const i=setTimeout(()=>{r(e)},t);return()=>{clearTimeout(i)}},[e,t]),n}function bH({fetcher:e,preload:t,filterFn:n,renderOption:r,getOptionValue:i,notFound:o,loadingSkeleton:s,label:u,placeholder:f="Select...",value:d,onChange:p,onFocus:m,disabled:v=!1,className:g,noResultsMessage:w}){const[x,k]=E.useState(!1),[C,_]=E.useState(!1),[T,N]=E.useState([]),[D,z]=E.useState(!1),[R,B]=E.useState(null),[P,j]=E.useState(d),[V,q]=E.useState(null),[I,Y]=E.useState(""),Z=jy(I,t?0:150),[U,G]=E.useState([]);E.useEffect(()=>{k(!0),j(d)},[d]),E.useEffect(()=>{x||(async()=>{try{z(!0),B(null);const $=d!==null?await e(d):[];G($),N($)}catch($){B($ instanceof Error?$.message:"Failed to fetch options")}finally{z(!1)}})()},[x,e,d]),E.useEffect(()=>{const A=async()=>{try{z(!0),B(null);const $=await e(Z);G($),N($)}catch($){B($ instanceof Error?$.message:"Failed to fetch options")}finally{z(!1)}};x&&t?t&&N(Z?U.filter($=>n?n($,Z):!0):U):A()},[e,Z,x,t,n]);const F=E.useCallback(A=>{A!==P&&(j(A),p(A)),_(!1)},[P,j,_,p]),K=E.useCallback(A=>{A!==V&&(q(A),m(A))},[V,q,m]);return S.jsx("div",{className:Me(v&&"cursor-not-allowed opacity-50",g),onFocus:()=>{_(!0)},onBlur:()=>_(!1),children:S.jsxs(yd,{shouldFilter:!1,className:"bg-transparent",children:[S.jsxs("div",{children:[S.jsx(Dy,{placeholder:f,value:I,className:"max-h-8",onValueChange:A=>{Y(A),A&&!C&&_(!0)}}),D&&T.length>0&&S.jsx("div",{className:"absolute top-1/2 right-2 flex -translate-y-1/2 transform items-center",children:S.jsx(Sk,{className:"h-4 w-4 animate-spin"})})]}),S.jsxs(bd,{hidden:!C||Z.length===0,children:[R&&S.jsx("div",{className:"text-destructive p-4 text-center",children:R}),D&&T.length===0&&(s||S.jsx(xH,{})),!D&&!R&&T.length===0&&(o||S.jsx(Ny,{children:w??`No ${u.toLowerCase()} found.`})),S.jsx(Cl,{children:T.map((A,$)=>S.jsxs(S.Fragment,{children:[S.jsx(Tl,{value:i(A),onSelect:F,onMouseEnter:()=>K(i(A)),className:"truncate",children:r(A)},i(A)+`${$}`),$!==T.length-1&&S.jsx("div",{className:"bg-foreground/10 h-[1px]"},$)]}))})]})]})})}function xH(){return S.jsx(Cl,{children:S.jsx(Tl,{disabled:!0,children:S.jsxs("div",{className:"flex w-full items-center gap-2",children:[S.jsx("div",{className:"bg-muted h-6 w-6 animate-pulse rounded-full"}),S.jsxs("div",{className:"flex flex-1 flex-col gap-1",children:[S.jsx("div",{className:"bg-muted h-4 w-24 animate-pulse rounded"}),S.jsx("div",{className:"bg-muted h-3 w-16 animate-pulse rounded"})]})]})})})}function wH(e){return S.jsxs("div",{children:[e.type==="nodes"&&S.jsx(gH,{id:e.id}),e.type==="edges"&&S.jsx(yH,{id:e.id}),e.type==="message"&&S.jsx("div",{children:e.message})]})}const Wm="__message_item",Wc={graph:null,searchEngine:null},SH=({onChange:e,onFocus:t,value:n})=>{const r=yt.use.sigmaGraph(),i=E.useMemo(()=>{if(Wc.graph==r)return Wc.searchEngine;if(!r||r.nodes().length==0)return;Wc.graph=r;const s=new sa({idField:"id",fields:["label"],searchOptions:{prefix:!0,fuzzy:.2,boost:{label:2}}}),u=r.nodes().map(f=>({id:f,label:r.getNodeAttribute(f,"label")}));return s.addAll(u),Wc.searchEngine=s,s},[r]),o=E.useCallback(async s=>{if(t&&t(null),!s||!i)return[];const u=i.search(s).map(f=>({id:f.id,type:"nodes"}));return u.length<=$p?u:[...u.slice(0,$p),{type:"message",id:Wm,message:`And ${u.length-$p} others`}]},[i,t]);return S.jsx(bH,{className:"bg-background/60 w-24 rounded-xl border-1 opacity-60 backdrop-blur-lg transition-all hover:w-fit hover:opacity-100",fetcher:o,renderOption:wH,getOptionValue:s=>s.id,value:n&&n.type!=="message"?n.id:null,onChange:s=>{s!==Wm&&e(s?{id:s,type:"nodes"}:null)},onFocus:s=>{s!==Wm&&t&&t(s?{id:s,type:"nodes"}:null)},label:"item",placeholder:"Search nodes..."})},EH=({...e})=>S.jsx(SH,{...e});function _H({fetcher:e,preload:t,filterFn:n,renderOption:r,getOptionValue:i,getDisplayValue:o,notFound:s,loadingSkeleton:u,label:f,placeholder:d="Select...",value:p,onChange:m,disabled:v=!1,className:g,triggerClassName:w,searchInputClassName:x,noResultsMessage:k,triggerTooltip:C,clearable:_=!0}){const[T,N]=E.useState(!1),[D,z]=E.useState(!1),[R,B]=E.useState([]),[P,j]=E.useState(!1),[V,q]=E.useState(null),[I,Y]=E.useState(p),[Z,U]=E.useState(null),[G,F]=E.useState(""),K=jy(G,t?0:150),[A,$]=E.useState([]);E.useEffect(()=>{N(!0),Y(p)},[p]),E.useEffect(()=>{if(p&&R.length>0){const O=R.find(X=>i(X)===p);O&&U(O)}},[p,R,i]),E.useEffect(()=>{T||(async()=>{try{j(!0),q(null);const X=await e(p);$(X),B(X)}catch(X){q(X instanceof Error?X.message:"Failed to fetch options")}finally{j(!1)}})()},[T,e,p]),E.useEffect(()=>{const O=async()=>{try{j(!0),q(null);const X=await e(K);$(X),B(X)}catch(X){q(X instanceof Error?X.message:"Failed to fetch options")}finally{j(!1)}};T&&t?t&&B(K?A.filter(X=>n?n(X,K):!0):A):O()},[e,K,T,t,n]);const M=E.useCallback(O=>{const X=_&&O===I?"":O;Y(X),U(R.find(re=>i(re)===X)||null),m(X),z(!1)},[I,m,_,R,i]);return S.jsxs(fd,{open:D,onOpenChange:z,children:[S.jsx(dd,{asChild:!0,children:S.jsxs(Ot,{variant:"outline",role:"combobox","aria-expanded":D,className:Me("justify-between",v&&"cursor-not-allowed opacity-50",w),disabled:v,tooltip:C,side:"bottom",children:[Z?o(Z):d,S.jsx(bM,{className:"opacity-50",size:10})]})}),S.jsx(uu,{className:Me("p-0",g),onCloseAutoFocus:O=>O.preventDefault(),children:S.jsxs(yd,{shouldFilter:!1,children:[S.jsxs("div",{className:"relative w-full border-b",children:[S.jsx(Dy,{placeholder:`Search ${f.toLowerCase()}...`,value:G,onValueChange:O=>{F(O)},className:x}),P&&R.length>0&&S.jsx("div",{className:"absolute top-1/2 right-2 flex -translate-y-1/2 transform items-center",children:S.jsx(Sk,{className:"h-4 w-4 animate-spin"})})]}),S.jsxs(bd,{children:[V&&S.jsx("div",{className:"text-destructive p-4 text-center",children:V}),P&&R.length===0&&(u||S.jsx(kH,{})),!P&&!V&&R.length===0&&(s||S.jsx(Ny,{children:k??`No ${f.toLowerCase()} found.`})),S.jsx(Cl,{children:R.map(O=>S.jsxs(Tl,{value:i(O),onSelect:M,className:"truncate",children:[r(O),S.jsx(Lv,{className:Me("ml-auto h-3 w-3",I===i(O)?"opacity-100":"opacity-0")})]},i(O)))})]})]})})]})}function kH(){return S.jsx(Cl,{children:S.jsx(Tl,{disabled:!0,children:S.jsxs("div",{className:"flex w-full items-center gap-2",children:[S.jsx("div",{className:"bg-muted h-6 w-6 animate-pulse rounded-full"}),S.jsxs("div",{className:"flex flex-1 flex-col gap-1",children:[S.jsx("div",{className:"bg-muted h-4 w-24 animate-pulse rounded"}),S.jsx("div",{className:"bg-muted h-3 w-16 animate-pulse rounded"})]})]})})})}const CH=()=>{const e=Qe.use.queryLabel(),[t,n]=E.useState({labels:[],searchEngine:null}),[r,i]=E.useState(!1),o=E.useCallback(async u=>{let f=t.labels,d=t.searchEngine;if(!r||!d){f=["*"].concat(await rM()),f.includes(Qe.getState().queryLabel)||Qe.getState().setQueryLabel(f[0]),d=new sa({idField:"id",fields:["value"],searchOptions:{prefix:!0,fuzzy:.2,boost:{label:2}}});const p=f.map((m,v)=>({id:v,value:m}));d.addAll(p),n({labels:f,searchEngine:d}),i(!0)}return u?d.search(u).map(p=>f[p.id]):f},[t,r,n,i]),s=E.useCallback(u=>{Qe.getState().setQueryLabel(u)},[]);return S.jsx(_H,{className:"ml-2",triggerClassName:"max-h-8",searchInputClassName:"max-h-8",triggerTooltip:"Select query label",fetcher:o,renderOption:u=>S.jsx("div",{children:u}),getOptionValue:u=>u,getDisplayValue:u=>S.jsx("div",{children:u}),notFound:S.jsx("div",{className:"py-6 text-center text-sm",children:"No labels found"}),label:"Label",placeholder:"Search labels...",value:e!==null?e:"",onChange:s})},Ln=({text:e,className:t,tooltipClassName:n,tooltip:r,side:i,onClick:o})=>r?S.jsx(WC,{delayDuration:200,children:S.jsxs(XC,{children:[S.jsx(KC,{asChild:!0,children:S.jsx("label",{className:Me(t,o!==void 0?"cursor-pointer":void 0),onClick:o,children:e})}),S.jsx(ly,{side:i,className:n,children:r})]})}):S.jsx("label",{className:Me(t,o!==void 0?"cursor-pointer":void 0),onClick:o,children:e}),TH=()=>{const{getNode:e,getEdge:t}=JA(),n=yt.use.selectedNode(),r=yt.use.focusedNode(),i=yt.use.selectedEdge(),o=yt.use.focusedEdge(),[s,u]=E.useState(null),[f,d]=E.useState(null);return E.useEffect(()=>{let p=null,m=null;r?(p="node",m=e(r)):n?(p="node",m=e(n)):o?(p="edge",m=t(o,!0)):i&&(p="edge",m=t(i,!0)),m?(p=="node"?u(AH(m)):u(RH(m)),d(p)):(u(null),d(null))},[r,n,o,i,u,d,e,t]),s?S.jsx("div",{className:"bg-background/80 max-w-xs rounded-lg border-2 p-2 text-xs backdrop-blur-lg",children:f=="node"?S.jsx(DH,{node:s}):S.jsx(NH,{edge:s})}):S.jsx(S.Fragment,{})},AH=e=>{const t=yt.getState(),n=[];if(t.sigmaGraph&&t.rawGraph)for(const r of t.sigmaGraph.edges(e.id)){const i=t.rawGraph.getEdge(r,!0);if(i){const o=e.id===i.source,s=o?i.target:i.source,u=t.rawGraph.getNode(s);u&&n.push({type:o?"Target":"Source",id:s,label:u.labels.join(", ")})}}return{...e,relationships:n}},RH=e=>{var i,o;const t=yt.getState(),n=(i=t.rawGraph)==null?void 0:i.getNode(e.source),r=(o=t.rawGraph)==null?void 0:o.getNode(e.target);return{...e,sourceNode:n,targetNode:r}},Ur=({name:e,value:t,onClick:n,tooltip:r})=>S.jsxs("div",{className:"flex items-center gap-2",children:[S.jsx("label",{className:"text-primary/60 tracking-wide",children:e}),":",S.jsx(Ln,{className:"hover:bg-primary/20 rounded p-1 text-ellipsis",tooltipClassName:"max-w-80",text:t,tooltip:r||t,side:"left",onClick:n})]}),DH=({node:e})=>S.jsxs("div",{className:"flex flex-col gap-2",children:[S.jsx("label",{className:"text-md pl-1 font-bold tracking-wide text-sky-300",children:"Node"}),S.jsxs("div",{className:"bg-primary/5 max-h-96 overflow-auto rounded p-1",children:[S.jsx(Ur,{name:"Id",value:e.id}),S.jsx(Ur,{name:"Labels",value:e.labels.join(", "),onClick:()=>{yt.getState().setSelectedNode(e.id,!0)}}),S.jsx(Ur,{name:"Degree",value:e.degree})]}),S.jsx("label",{className:"text-md pl-1 font-bold tracking-wide text-yellow-400/90",children:"Properties"}),S.jsx("div",{className:"bg-primary/5 max-h-96 overflow-auto rounded p-1",children:Object.keys(e.properties).sort().map(t=>S.jsx(Ur,{name:t,value:e.properties[t]},t))}),e.relationships.length>0&&S.jsxs(S.Fragment,{children:[S.jsx("label",{className:"text-md pl-1 font-bold tracking-wide text-teal-600/90",children:"Relationships"}),S.jsx("div",{className:"bg-primary/5 max-h-96 overflow-auto rounded p-1",children:e.relationships.map(({type:t,id:n,label:r})=>S.jsx(Ur,{name:t,value:r,onClick:()=>{yt.getState().setSelectedNode(n,!0)}},n))})]})]}),NH=({edge:e})=>S.jsxs("div",{className:"flex flex-col gap-2",children:[S.jsx("label",{className:"text-md pl-1 font-bold tracking-wide text-teal-600",children:"Relationship"}),S.jsxs("div",{className:"bg-primary/5 max-h-96 overflow-auto rounded p-1",children:[S.jsx(Ur,{name:"Id",value:e.id}),e.type&&S.jsx(Ur,{name:"Type",value:e.type}),S.jsx(Ur,{name:"Source",value:e.sourceNode?e.sourceNode.labels.join(", "):e.source,onClick:()=>{yt.getState().setSelectedNode(e.source,!0)}}),S.jsx(Ur,{name:"Target",value:e.targetNode?e.targetNode.labels.join(", "):e.target,onClick:()=>{yt.getState().setSelectedNode(e.target,!0)}})]}),S.jsx("label",{className:"text-md pl-1 font-bold tracking-wide text-yellow-400/90",children:"Properties"}),S.jsx("div",{className:"bg-primary/5 max-h-96 overflow-auto rounded p-1",children:Object.keys(e.properties).sort().map(t=>S.jsx(Ur,{name:t,value:e.properties[t]},t))})]}),hE={allowInvalidContainer:!0,defaultNodeType:"default",defaultEdgeType:"curvedArrow",renderEdgeLabels:!1,edgeProgramClasses:{arrow:fA,curvedArrow:tU,curvedNoArrow:eU},nodeProgramClasses:{default:PB,circel:fu,point:fB},labelGridCellSize:60,labelRenderedSizeThreshold:12,enableEdgeEvents:!0,labelColor:{color:"#000",attribute:"labelColor"},edgeLabelColor:{color:"#000",attribute:"labelColor"},edgeLabelSize:8,labelSize:12},OH=()=>{const e=bA(),t=pr(),[n,r]=E.useState(null);return E.useEffect(()=>{e({downNode:i=>{r(i.node),t.getGraph().setNodeAttribute(i.node,"highlighted",!0)},mousemovebody:i=>{if(!n)return;const o=t.viewportToGraph(i);t.getGraph().setNodeAttribute(n,"x",o.x),t.getGraph().setNodeAttribute(n,"y",o.y),i.preventSigmaDefault(),i.original.preventDefault(),i.original.stopPropagation()},mouseup:()=>{n&&(r(null),t.getGraph().removeNodeAttribute(n,"highlighted"))},mousedown:()=>{t.getCustomBBox()||t.setCustomBBox(t.getBBox())}})},[e,t,n]),null},LH=()=>{const[e,t]=E.useState(hE),n=yt.use.selectedNode(),r=yt.use.focusedNode(),i=yt.use.moveToSelectedNode(),o=Qe.use.showPropertyPanel(),s=Qe.use.showNodeSearchBar(),u=Qe.use.showNodeLabel(),f=Qe.use.enableEdgeEvents(),d=Qe.use.enableNodeDrag(),p=Qe.use.showEdgeLabel();E.useEffect(()=>{t({...hE,enableEdgeEvents:f,renderEdgeLabels:p,renderLabels:u})},[u,f,p]);const m=E.useCallback(x=>{x===null?yt.getState().setFocusedNode(null):x.type==="nodes"&&yt.getState().setFocusedNode(x.id)},[]),v=E.useCallback(x=>{x===null?yt.getState().setSelectedNode(null):x.type==="nodes"&&yt.getState().setSelectedNode(x.id,!0)},[]),g=E.useMemo(()=>r??n,[r,n]),w=E.useMemo(()=>n?{type:"nodes",id:n}:null,[n]);return S.jsxs(aB,{settings:e,className:"!bg-background !size-full overflow-hidden",children:[S.jsx(q6,{}),d&&S.jsx(OH,{}),S.jsx(iU,{node:g,move:i}),S.jsxs("div",{className:"absolute top-2 left-2 flex items-start gap-2",children:[S.jsx(CH,{}),s&&S.jsx(EH,{value:w,onFocus:m,onChange:v})]}),S.jsxs("div",{className:"bg-background/60 absolute bottom-2 left-2 flex flex-col rounded-xl border-2 backdrop-blur-lg",children:[S.jsx(rH,{}),S.jsx(Y6,{}),S.jsx(S6,{}),S.jsx(W6,{})]}),o&&S.jsx("div",{className:"absolute top-2 right-2",children:S.jsx(TH,{})})]})},mR=E.forwardRef(({className:e,...t},n)=>S.jsx("div",{className:"relative w-full overflow-auto",children:S.jsx("table",{ref:n,className:Me("w-full caption-bottom text-sm",e),...t})}));mR.displayName="Table";const gR=E.forwardRef(({className:e,...t},n)=>S.jsx("thead",{ref:n,className:Me("[&_tr]:border-b",e),...t}));gR.displayName="TableHeader";const vR=E.forwardRef(({className:e,...t},n)=>S.jsx("tbody",{ref:n,className:Me("[&_tr:last-child]:border-0",e),...t}));vR.displayName="TableBody";const zH=E.forwardRef(({className:e,...t},n)=>S.jsx("tfoot",{ref:n,className:Me("bg-muted/50 border-t font-medium [&>tr]:last:border-b-0",e),...t}));zH.displayName="TableFooter";const tv=E.forwardRef(({className:e,...t},n)=>S.jsx("tr",{ref:n,className:Me("hover:bg-muted/50 data-[state=selected]:bg-muted border-b transition-colors",e),...t}));tv.displayName="TableRow";const bi=E.forwardRef(({className:e,...t},n)=>S.jsx("th",{ref:n,className:Me("text-muted-foreground h-10 px-2 text-left align-middle font-medium [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...t}));bi.displayName="TableHead";const xi=E.forwardRef(({className:e,...t},n)=>S.jsx("td",{ref:n,className:Me("p-2 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...t}));xi.displayName="TableCell";const jH=E.forwardRef(({className:e,...t},n)=>S.jsx("caption",{ref:n,className:Me("text-muted-foreground mt-4 text-sm",e),...t}));jH.displayName="TableCaption";const Ks=E.forwardRef(({className:e,...t},n)=>S.jsx("div",{ref:n,className:Me("bg-card text-card-foreground rounded-xl border shadow",e),...t}));Ks.displayName="Card";const Nf=E.forwardRef(({className:e,...t},n)=>S.jsx("div",{ref:n,className:Me("flex flex-col space-y-1.5 p-6",e),...t}));Nf.displayName="CardHeader";const Zs=E.forwardRef(({className:e,...t},n)=>S.jsx("div",{ref:n,className:Me("leading-none font-semibold tracking-tight",e),...t}));Zs.displayName="CardTitle";const xd=E.forwardRef(({className:e,...t},n)=>S.jsx("div",{ref:n,className:Me("text-muted-foreground text-sm",e),...t}));xd.displayName="CardDescription";const Of=E.forwardRef(({className:e,...t},n)=>S.jsx("div",{ref:n,className:Me("p-6 pt-0",e),...t}));Of.displayName="CardContent";const MH=E.forwardRef(({className:e,...t},n)=>S.jsx("div",{ref:n,className:Me("flex items-center p-6 pt-0",e),...t}));MH.displayName="CardFooter";function PH({title:e,description:t,icon:n=CM,action:r,className:i,...o}){return S.jsxs(Ks,{className:Me("flex w-full flex-col items-center justify-center space-y-6 bg-transparent p-16",i),...o,children:[S.jsx("div",{className:"mr-4 shrink-0 rounded-full border border-dashed p-4",children:S.jsx(n,{className:"text-muted-foreground size-8","aria-hidden":"true"})}),S.jsxs("div",{className:"flex flex-col items-center gap-1.5 text-center",children:[S.jsx(Zs,{children:e}),t?S.jsx(xd,{children:t}):null]}),r||null]})}var Xm={exports:{}},Km,pE;function FH(){if(pE)return Km;pE=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return Km=e,Km}var Zm,mE;function IH(){if(mE)return Zm;mE=1;var e=FH();function t(){}function n(){}return n.resetWarningCache=t,Zm=function(){function r(s,u,f,d,p,m){if(m!==e){var v=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw v.name="Invariant Violation",v}}r.isRequired=r;function i(){return r}var o={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:i,element:r,elementType:r,instanceOf:i,node:r,objectOf:i,oneOf:i,oneOfType:i,shape:i,exact:i,checkPropTypes:n,resetWarningCache:t};return o.PropTypes=o,o},Zm}var gE;function GH(){return gE||(gE=1,Xm.exports=IH()()),Xm.exports}var BH=GH();const Ct=fn(BH),UH=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 dl(e,t,n){const r=HH(e),{webkitRelativePath:i}=e,o=typeof t=="string"?t:typeof i=="string"&&i.length>0?i:`./${e.name}`;return typeof r.path!="string"&&vE(r,"path",o),vE(r,"relativePath",o),r}function HH(e){const{name:t}=e;if(t&&t.lastIndexOf(".")!==-1&&!e.type){const r=t.split(".").pop().toLowerCase(),i=UH.get(r);i&&Object.defineProperty(e,"type",{value:i,writable:!1,configurable:!1,enumerable:!0})}return e}function vE(e,t,n){Object.defineProperty(e,t,{value:n,writable:!1,configurable:!1,enumerable:!0})}const $H=[".DS_Store","Thumbs.db"];function VH(e){return no(this,void 0,void 0,function*(){return Lf(e)&&qH(e.dataTransfer)?KH(e.dataTransfer,e.type):YH(e)?WH(e):Array.isArray(e)&&e.every(t=>"getFile"in t&&typeof t.getFile=="function")?XH(e):[]})}function qH(e){return Lf(e)}function YH(e){return Lf(e)&&Lf(e.target)}function Lf(e){return typeof e=="object"&&e!==null}function WH(e){return nv(e.target.files).map(t=>dl(t))}function XH(e){return no(this,void 0,void 0,function*(){return(yield Promise.all(e.map(n=>n.getFile()))).map(n=>dl(n))})}function KH(e,t){return no(this,void 0,void 0,function*(){if(e.items){const n=nv(e.items).filter(i=>i.kind==="file");if(t!=="drop")return n;const r=yield Promise.all(n.map(ZH));return yE(yR(r))}return yE(nv(e.files).map(n=>dl(n)))})}function yE(e){return e.filter(t=>$H.indexOf(t.name)===-1)}function nv(e){if(e===null)return[];const t=[];for(let n=0;n[...t,...Array.isArray(n)?yR(n):[n]],[])}function bE(e,t){return no(this,void 0,void 0,function*(){var n;if(globalThis.isSecureContext&&typeof e.getAsFileSystemHandle=="function"){const o=yield e.getAsFileSystemHandle();if(o===null)throw new Error(`${e} is not a File`);if(o!==void 0){const s=yield o.getFile();return s.handle=o,dl(s)}}const r=e.getAsFile();if(!r)throw new Error(`${e} is not a File`);return dl(r,(n=t==null?void 0:t.fullPath)!==null&&n!==void 0?n:void 0)})}function QH(e){return no(this,void 0,void 0,function*(){return e.isDirectory?bR(e):JH(e)})}function bR(e){const t=e.createReader();return new Promise((n,r)=>{const i=[];function o(){t.readEntries(s=>no(this,void 0,void 0,function*(){if(s.length){const u=Promise.all(s.map(QH));i.push(u),o()}else try{const u=yield Promise.all(i);n(u)}catch(u){r(u)}}),s=>{r(s)})}o()})}function JH(e){return no(this,void 0,void 0,function*(){return new Promise((t,n)=>{e.file(r=>{const i=dl(r,e.fullPath);t(i)},r=>{n(r)})})})}var Xc={},xE;function e$(){return xE||(xE=1,Xc.__esModule=!0,Xc.default=function(e,t){if(e&&t){var n=Array.isArray(t)?t:t.split(",");if(n.length===0)return!0;var r=e.name||"",i=(e.type||"").toLowerCase(),o=i.replace(/\/.*$/,"");return n.some(function(s){var u=s.trim().toLowerCase();return u.charAt(0)==="."?r.toLowerCase().endsWith(u):u.endsWith("/*")?o===u.replace(/\/.*$/,""):i===u})}return!0}),Xc}var t$=e$();const Qm=fn(t$);function wE(e){return i$(e)||r$(e)||wR(e)||n$()}function n$(){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 r$(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function i$(e){if(Array.isArray(e))return rv(e)}function SE(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function EE(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&arguments[0]!==void 0?arguments[0]:"",n=t.split(","),r=n.length>1?"one of ".concat(n.join(", ")):n[0];return{code:u$,message:"File type must be ".concat(r)}},_E=function(t){return{code:c$,message:"File is larger than ".concat(t," ").concat(t===1?"byte":"bytes")}},kE=function(t){return{code:f$,message:"File is smaller than ".concat(t," ").concat(t===1?"byte":"bytes")}},p$={code:d$,message:"Too many files"};function SR(e,t){var n=e.type==="application/x-moz-file"||s$(e,t);return[n,n?null:h$(t)]}function ER(e,t,n){if($a(e.size))if($a(t)&&$a(n)){if(e.size>n)return[!1,_E(n)];if(e.sizen)return[!1,_E(n)]}return[!0,null]}function $a(e){return e!=null}function m$(e){var t=e.files,n=e.accept,r=e.minSize,i=e.maxSize,o=e.multiple,s=e.maxFiles,u=e.validator;return!o&&t.length>1||o&&s>=1&&t.length>s?!1:t.every(function(f){var d=SR(f,n),p=Qs(d,1),m=p[0],v=ER(f,r,i),g=Qs(v,1),w=g[0],x=u?u(f):null;return m&&w&&!x})}function zf(e){return typeof e.isPropagationStopped=="function"?e.isPropagationStopped():typeof e.cancelBubble<"u"?e.cancelBubble:!1}function Kc(e){return e.dataTransfer?Array.prototype.some.call(e.dataTransfer.types,function(t){return t==="Files"||t==="application/x-moz-file"}):!!e.target&&!!e.target.files}function CE(e){e.preventDefault()}function g$(e){return e.indexOf("MSIE")!==-1||e.indexOf("Trident/")!==-1}function v$(e){return e.indexOf("Edge/")!==-1}function y$(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:window.navigator.userAgent;return g$(e)||v$(e)}function Ir(){for(var e=arguments.length,t=new Array(e),n=0;n1?i-1:0),s=1;se.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function j$(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,o;for(o=0;o=0)&&(n[i]=e[i]);return n}var wd=E.forwardRef(function(e,t){var n=e.children,r=jf(e,_$),i=M$(r),o=i.open,s=jf(i,k$);return E.useImperativeHandle(t,function(){return{open:o}},[o]),be.createElement(E.Fragment,null,n(jt(jt({},s),{},{open:o})))});wd.displayName="Dropzone";var TR={disabled:!1,getFilesFromEvent:VH,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};wd.defaultProps=TR;wd.propTypes={children:Ct.func,accept:Ct.objectOf(Ct.arrayOf(Ct.string)),multiple:Ct.bool,preventDropOnDocument:Ct.bool,noClick:Ct.bool,noKeyboard:Ct.bool,noDrag:Ct.bool,noDragEventsBubbling:Ct.bool,minSize:Ct.number,maxSize:Ct.number,maxFiles:Ct.number,disabled:Ct.bool,getFilesFromEvent:Ct.func,onFileDialogCancel:Ct.func,onFileDialogOpen:Ct.func,useFsAccessApi:Ct.bool,autoFocus:Ct.bool,onDragEnter:Ct.func,onDragLeave:Ct.func,onDragOver:Ct.func,onDrop:Ct.func,onDropAccepted:Ct.func,onDropRejected:Ct.func,onError:Ct.func,validator:Ct.func};var ov={isFocused:!1,isFileDialogActive:!1,isDragActive:!1,isDragAccept:!1,isDragReject:!1,acceptedFiles:[],fileRejections:[]};function M$(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=jt(jt({},TR),e),n=t.accept,r=t.disabled,i=t.getFilesFromEvent,o=t.maxSize,s=t.minSize,u=t.multiple,f=t.maxFiles,d=t.onDragEnter,p=t.onDragLeave,m=t.onDragOver,v=t.onDrop,g=t.onDropAccepted,w=t.onDropRejected,x=t.onFileDialogCancel,k=t.onFileDialogOpen,C=t.useFsAccessApi,_=t.autoFocus,T=t.preventDropOnDocument,N=t.noClick,D=t.noKeyboard,z=t.noDrag,R=t.noDragEventsBubbling,B=t.onError,P=t.validator,j=E.useMemo(function(){return w$(n)},[n]),V=E.useMemo(function(){return x$(n)},[n]),q=E.useMemo(function(){return typeof k=="function"?k:AE},[k]),I=E.useMemo(function(){return typeof x=="function"?x:AE},[x]),Y=E.useRef(null),Z=E.useRef(null),U=E.useReducer(P$,ov),G=Jm(U,2),F=G[0],K=G[1],A=F.isFocused,$=F.isFileDialogActive,M=E.useRef(typeof window<"u"&&window.isSecureContext&&C&&b$()),O=function(){!M.current&&$&&setTimeout(function(){if(Z.current){var Ne=Z.current.files;Ne.length||(K({type:"closeDialog"}),I())}},300)};E.useEffect(function(){return window.addEventListener("focus",O,!1),function(){window.removeEventListener("focus",O,!1)}},[Z,$,I,M]);var X=E.useRef([]),re=function(Ne){Y.current&&Y.current.contains(Ne.target)||(Ne.preventDefault(),X.current=[])};E.useEffect(function(){return T&&(document.addEventListener("dragover",CE,!1),document.addEventListener("drop",re,!1)),function(){T&&(document.removeEventListener("dragover",CE),document.removeEventListener("drop",re))}},[Y,T]),E.useEffect(function(){return!r&&_&&Y.current&&Y.current.focus(),function(){}},[Y,_,r]);var ue=E.useCallback(function(ve){B?B(ve):console.error(ve)},[B]),ae=E.useCallback(function(ve){ve.preventDefault(),ve.persist(),Se(ve),X.current=[].concat(A$(X.current),[ve.target]),Kc(ve)&&Promise.resolve(i(ve)).then(function(Ne){if(!(zf(ve)&&!R)){var te=Ne.length,de=te>0&&m$({files:Ne,accept:j,minSize:s,maxSize:o,multiple:u,maxFiles:f,validator:P}),Oe=te>0&&!de;K({isDragAccept:de,isDragReject:Oe,isDragActive:!0,type:"setDraggedFiles"}),d&&d(ve)}}).catch(function(Ne){return ue(Ne)})},[i,d,ue,R,j,s,o,u,f,P]),oe=E.useCallback(function(ve){ve.preventDefault(),ve.persist(),Se(ve);var Ne=Kc(ve);if(Ne&&ve.dataTransfer)try{ve.dataTransfer.dropEffect="copy"}catch{}return Ne&&m&&m(ve),!1},[m,R]),Ce=E.useCallback(function(ve){ve.preventDefault(),ve.persist(),Se(ve);var Ne=X.current.filter(function(de){return Y.current&&Y.current.contains(de)}),te=Ne.indexOf(ve.target);te!==-1&&Ne.splice(te,1),X.current=Ne,!(Ne.length>0)&&(K({type:"setDraggedFiles",isDragActive:!1,isDragAccept:!1,isDragReject:!1}),Kc(ve)&&p&&p(ve))},[Y,p,R]),he=E.useCallback(function(ve,Ne){var te=[],de=[];ve.forEach(function(Oe){var $e=SR(Oe,j),Ye=Jm($e,2),vt=Ye[0],Mt=Ye[1],bt=ER(Oe,s,o),rt=Jm(bt,2),qt=rt[0],at=rt[1],At=P?P(Oe):null;if(vt&&qt&&!At)te.push(Oe);else{var rn=[Mt,at];At&&(rn=rn.concat(At)),de.push({file:Oe,errors:rn.filter(function(io){return io})})}}),(!u&&te.length>1||u&&f>=1&&te.length>f)&&(te.forEach(function(Oe){de.push({file:Oe,errors:[p$]})}),te.splice(0)),K({acceptedFiles:te,fileRejections:de,isDragReject:de.length>0,type:"setFiles"}),v&&v(te,de,Ne),de.length>0&&w&&w(de,Ne),te.length>0&&g&&g(te,Ne)},[K,u,j,s,o,f,v,g,w,P]),Ee=E.useCallback(function(ve){ve.preventDefault(),ve.persist(),Se(ve),X.current=[],Kc(ve)&&Promise.resolve(i(ve)).then(function(Ne){zf(ve)&&!R||he(Ne,ve)}).catch(function(Ne){return ue(Ne)}),K({type:"reset"})},[i,he,ue,R]),we=E.useCallback(function(){if(M.current){K({type:"openDialog"}),q();var ve={multiple:u,types:V};window.showOpenFilePicker(ve).then(function(Ne){return i(Ne)}).then(function(Ne){he(Ne,null),K({type:"closeDialog"})}).catch(function(Ne){S$(Ne)?(I(Ne),K({type:"closeDialog"})):E$(Ne)?(M.current=!1,Z.current?(Z.current.value=null,Z.current.click()):ue(new Error("Cannot open the file picker because the https://developer.mozilla.org/en-US/docs/Web/API/File_System_Access_API is not supported and no was provided."))):ue(Ne)});return}Z.current&&(K({type:"openDialog"}),q(),Z.current.value=null,Z.current.click())},[K,q,I,C,he,ue,V,u]),Pe=E.useCallback(function(ve){!Y.current||!Y.current.isEqualNode(ve.target)||(ve.key===" "||ve.key==="Enter"||ve.keyCode===32||ve.keyCode===13)&&(ve.preventDefault(),we())},[Y,we]),Ae=E.useCallback(function(){K({type:"focus"})},[]),xe=E.useCallback(function(){K({type:"blur"})},[]),ee=E.useCallback(function(){N||(y$()?setTimeout(we,0):we())},[N,we]),ce=function(Ne){return r?null:Ne},Te=function(Ne){return D?null:ce(Ne)},ge=function(Ne){return z?null:ce(Ne)},Se=function(Ne){R&&Ne.stopPropagation()},ie=E.useMemo(function(){return function(){var ve=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},Ne=ve.refKey,te=Ne===void 0?"ref":Ne,de=ve.role,Oe=ve.onKeyDown,$e=ve.onFocus,Ye=ve.onBlur,vt=ve.onClick,Mt=ve.onDragEnter,bt=ve.onDragOver,rt=ve.onDragLeave,qt=ve.onDrop,at=jf(ve,C$);return jt(jt(av({onKeyDown:Te(Ir(Oe,Pe)),onFocus:Te(Ir($e,Ae)),onBlur:Te(Ir(Ye,xe)),onClick:ce(Ir(vt,ee)),onDragEnter:ge(Ir(Mt,ae)),onDragOver:ge(Ir(bt,oe)),onDragLeave:ge(Ir(rt,Ce)),onDrop:ge(Ir(qt,Ee)),role:typeof de=="string"&&de!==""?de:"presentation"},te,Y),!r&&!D?{tabIndex:0}:{}),at)}},[Y,Pe,Ae,xe,ee,ae,oe,Ce,Ee,D,z,r]),He=E.useCallback(function(ve){ve.stopPropagation()},[]),Ge=E.useMemo(function(){return function(){var ve=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},Ne=ve.refKey,te=Ne===void 0?"ref":Ne,de=ve.onChange,Oe=ve.onClick,$e=jf(ve,T$),Ye=av({accept:j,multiple:u,type:"file",style:{border:0,clip:"rect(0, 0, 0, 0)",clipPath:"inset(50%)",height:"1px",margin:"0 -1px -1px 0",overflow:"hidden",padding:0,position:"absolute",width:"1px",whiteSpace:"nowrap"},onChange:ce(Ir(de,Ee)),onClick:ce(Ir(Oe,He)),tabIndex:-1},te,Z);return jt(jt({},Ye),$e)}},[Z,n,u,Ee,r]);return jt(jt({},F),{},{isFocused:A&&!r,getRootProps:ie,getInputProps:Ge,rootRef:Y,inputRef:Z,open:ce(we)})}function P$(e,t){switch(t.type){case"focus":return jt(jt({},e),{},{isFocused:!0});case"blur":return jt(jt({},e),{},{isFocused:!1});case"openDialog":return jt(jt({},ov),{},{isFileDialogActive:!0});case"closeDialog":return jt(jt({},e),{},{isFileDialogActive:!1});case"setDraggedFiles":return jt(jt({},e),{},{isDragActive:t.isDragActive,isDragAccept:t.isDragAccept,isDragReject:t.isDragReject});case"setFiles":return jt(jt({},e),{},{acceptedFiles:t.acceptedFiles,fileRejections:t.fileRejections,isDragReject:t.isDragReject});case"reset":return jt({},ov);default:return e}}function AE(){}var My="Progress",Py=100,[F$,mK]=hr(My),[I$,G$]=F$(My),AR=E.forwardRef((e,t)=>{const{__scopeProgress:n,value:r=null,max:i,getValueLabel:o=B$,...s}=e;(i||i===0)&&!RE(i)&&console.error(U$(`${i}`,"Progress"));const u=RE(i)?i:Py;r!==null&&!DE(r,u)&&console.error(H$(`${r}`,"Progress"));const f=DE(r,u)?r:null,d=Mf(f)?o(f,u):void 0;return S.jsx(I$,{scope:n,value:f,max:u,children:S.jsx(We.div,{"aria-valuemax":u,"aria-valuemin":0,"aria-valuenow":Mf(f)?f:void 0,"aria-valuetext":d,role:"progressbar","data-state":NR(f,u),"data-value":f??void 0,"data-max":u,...s,ref:t})})});AR.displayName=My;var RR="ProgressIndicator",DR=E.forwardRef((e,t)=>{const{__scopeProgress:n,...r}=e,i=G$(RR,n);return S.jsx(We.div,{"data-state":NR(i.value,i.max),"data-value":i.value??void 0,"data-max":i.max,...r,ref:t})});DR.displayName=RR;function B$(e,t){return`${Math.round(e/t*100)}%`}function NR(e,t){return e==null?"indeterminate":e===t?"complete":"loading"}function Mf(e){return typeof e=="number"}function RE(e){return Mf(e)&&!isNaN(e)&&e>0}function DE(e,t){return Mf(e)&&!isNaN(e)&&e<=t&&e>=0}function U$(e,t){return`Invalid prop \`max\` of value \`${e}\` supplied to \`${t}\`. Only numbers greater than 0 are valid max values. Defaulting to \`${Py}\`.`}function H$(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 ${Py} if no \`max\` prop is set) - - \`null\` or \`undefined\` if the progress is indeterminate. - -Defaulting to \`null\`.`}var OR=AR,$$=DR;const LR=E.forwardRef(({className:e,value:t,...n},r)=>S.jsx(OR,{ref:r,className:Me("bg-secondary relative h-4 w-full overflow-hidden rounded-full",e),...n,children:S.jsx($$,{className:"bg-primary h-full w-full flex-1 transition-all",style:{transform:`translateX(-${100-(t||0)}%)`}})}));LR.displayName=OR.displayName;function lv(e,[t,n]){return Math.min(n,Math.max(t,e))}function V$(e,t){return E.useReducer((n,r)=>t[n][r]??n,e)}var Fy="ScrollArea",[zR,gK]=hr(Fy),[q$,mr]=zR(Fy),jR=E.forwardRef((e,t)=>{const{__scopeScrollArea:n,type:r="hover",dir:i,scrollHideDelay:o=600,...s}=e,[u,f]=E.useState(null),[d,p]=E.useState(null),[m,v]=E.useState(null),[g,w]=E.useState(null),[x,k]=E.useState(null),[C,_]=E.useState(0),[T,N]=E.useState(0),[D,z]=E.useState(!1),[R,B]=E.useState(!1),P=dt(t,V=>f(V)),j=hd(i);return S.jsx(q$,{scope:n,type:r,dir:j,scrollHideDelay:o,scrollArea:u,viewport:d,onViewportChange:p,content:m,onContentChange:v,scrollbarX:g,onScrollbarXChange:w,scrollbarXEnabled:D,onScrollbarXEnabledChange:z,scrollbarY:x,onScrollbarYChange:k,scrollbarYEnabled:R,onScrollbarYEnabledChange:B,onCornerWidthChange:_,onCornerHeightChange:N,children:S.jsx(We.div,{dir:j,...s,ref:P,style:{position:"relative","--radix-scroll-area-corner-width":C+"px","--radix-scroll-area-corner-height":T+"px",...e.style}})})});jR.displayName=Fy;var MR="ScrollAreaViewport",PR=E.forwardRef((e,t)=>{const{__scopeScrollArea:n,children:r,nonce:i,...o}=e,s=mr(MR,n),u=E.useRef(null),f=dt(t,u,s.onViewportChange);return S.jsxs(S.Fragment,{children:[S.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:i}),S.jsx(We.div,{"data-radix-scroll-area-viewport":"",...o,ref:f,style:{overflowX:s.scrollbarXEnabled?"scroll":"hidden",overflowY:s.scrollbarYEnabled?"scroll":"hidden",...e.style},children:S.jsx("div",{ref:s.onContentChange,style:{minWidth:"100%",display:"table"},children:r})})]})});PR.displayName=MR;var Xr="ScrollAreaScrollbar",Iy=E.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=mr(Xr,e.__scopeScrollArea),{onScrollbarXEnabledChange:o,onScrollbarYEnabledChange:s}=i,u=e.orientation==="horizontal";return E.useEffect(()=>(u?o(!0):s(!0),()=>{u?o(!1):s(!1)}),[u,o,s]),i.type==="hover"?S.jsx(Y$,{...r,ref:t,forceMount:n}):i.type==="scroll"?S.jsx(W$,{...r,ref:t,forceMount:n}):i.type==="auto"?S.jsx(FR,{...r,ref:t,forceMount:n}):i.type==="always"?S.jsx(Gy,{...r,ref:t}):null});Iy.displayName=Xr;var Y$=E.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=mr(Xr,e.__scopeScrollArea),[o,s]=E.useState(!1);return E.useEffect(()=>{const u=i.scrollArea;let f=0;if(u){const d=()=>{window.clearTimeout(f),s(!0)},p=()=>{f=window.setTimeout(()=>s(!1),i.scrollHideDelay)};return u.addEventListener("pointerenter",d),u.addEventListener("pointerleave",p),()=>{window.clearTimeout(f),u.removeEventListener("pointerenter",d),u.removeEventListener("pointerleave",p)}}},[i.scrollArea,i.scrollHideDelay]),S.jsx(Zn,{present:n||o,children:S.jsx(FR,{"data-state":o?"visible":"hidden",...r,ref:t})})}),W$=E.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=mr(Xr,e.__scopeScrollArea),o=e.orientation==="horizontal",s=Ed(()=>f("SCROLL_END"),100),[u,f]=V$("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return E.useEffect(()=>{if(u==="idle"){const d=window.setTimeout(()=>f("HIDE"),i.scrollHideDelay);return()=>window.clearTimeout(d)}},[u,i.scrollHideDelay,f]),E.useEffect(()=>{const d=i.viewport,p=o?"scrollLeft":"scrollTop";if(d){let m=d[p];const v=()=>{const g=d[p];m!==g&&(f("SCROLL"),s()),m=g};return d.addEventListener("scroll",v),()=>d.removeEventListener("scroll",v)}},[i.viewport,o,f,s]),S.jsx(Zn,{present:n||u!=="hidden",children:S.jsx(Gy,{"data-state":u==="hidden"?"hidden":"visible",...r,ref:t,onPointerEnter:qe(e.onPointerEnter,()=>f("POINTER_ENTER")),onPointerLeave:qe(e.onPointerLeave,()=>f("POINTER_LEAVE"))})})}),FR=E.forwardRef((e,t)=>{const n=mr(Xr,e.__scopeScrollArea),{forceMount:r,...i}=e,[o,s]=E.useState(!1),u=e.orientation==="horizontal",f=Ed(()=>{if(n.viewport){const d=n.viewport.offsetWidth{const{orientation:n="vertical",...r}=e,i=mr(Xr,e.__scopeScrollArea),o=E.useRef(null),s=E.useRef(0),[u,f]=E.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),d=HR(u.viewport,u.content),p={...r,sizes:u,onSizesChange:f,hasThumb:d>0&&d<1,onThumbChange:v=>o.current=v,onThumbPointerUp:()=>s.current=0,onThumbPointerDown:v=>s.current=v};function m(v,g){return e9(v,s.current,u,g)}return n==="horizontal"?S.jsx(X$,{...p,ref:t,onThumbPositionChange:()=>{if(i.viewport&&o.current){const v=i.viewport.scrollLeft,g=NE(v,u,i.dir);o.current.style.transform=`translate3d(${g}px, 0, 0)`}},onWheelScroll:v=>{i.viewport&&(i.viewport.scrollLeft=v)},onDragScroll:v=>{i.viewport&&(i.viewport.scrollLeft=m(v,i.dir))}}):n==="vertical"?S.jsx(K$,{...p,ref:t,onThumbPositionChange:()=>{if(i.viewport&&o.current){const v=i.viewport.scrollTop,g=NE(v,u);o.current.style.transform=`translate3d(0, ${g}px, 0)`}},onWheelScroll:v=>{i.viewport&&(i.viewport.scrollTop=v)},onDragScroll:v=>{i.viewport&&(i.viewport.scrollTop=m(v))}}):null}),X$=E.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...i}=e,o=mr(Xr,e.__scopeScrollArea),[s,u]=E.useState(),f=E.useRef(null),d=dt(t,f,o.onScrollbarXChange);return E.useEffect(()=>{f.current&&u(getComputedStyle(f.current))},[f]),S.jsx(GR,{"data-orientation":"horizontal",...i,ref:d,sizes:n,style:{bottom:0,left:o.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:o.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":Sd(n)+"px",...e.style},onThumbPointerDown:p=>e.onThumbPointerDown(p.x),onDragScroll:p=>e.onDragScroll(p.x),onWheelScroll:(p,m)=>{if(o.viewport){const v=o.viewport.scrollLeft+p.deltaX;e.onWheelScroll(v),VR(v,m)&&p.preventDefault()}},onResize:()=>{f.current&&o.viewport&&s&&r({content:o.viewport.scrollWidth,viewport:o.viewport.offsetWidth,scrollbar:{size:f.current.clientWidth,paddingStart:Ff(s.paddingLeft),paddingEnd:Ff(s.paddingRight)}})}})}),K$=E.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...i}=e,o=mr(Xr,e.__scopeScrollArea),[s,u]=E.useState(),f=E.useRef(null),d=dt(t,f,o.onScrollbarYChange);return E.useEffect(()=>{f.current&&u(getComputedStyle(f.current))},[f]),S.jsx(GR,{"data-orientation":"vertical",...i,ref:d,sizes:n,style:{top:0,right:o.dir==="ltr"?0:void 0,left:o.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":Sd(n)+"px",...e.style},onThumbPointerDown:p=>e.onThumbPointerDown(p.y),onDragScroll:p=>e.onDragScroll(p.y),onWheelScroll:(p,m)=>{if(o.viewport){const v=o.viewport.scrollTop+p.deltaY;e.onWheelScroll(v),VR(v,m)&&p.preventDefault()}},onResize:()=>{f.current&&o.viewport&&s&&r({content:o.viewport.scrollHeight,viewport:o.viewport.offsetHeight,scrollbar:{size:f.current.clientHeight,paddingStart:Ff(s.paddingTop),paddingEnd:Ff(s.paddingBottom)}})}})}),[Z$,IR]=zR(Xr),GR=E.forwardRef((e,t)=>{const{__scopeScrollArea:n,sizes:r,hasThumb:i,onThumbChange:o,onThumbPointerUp:s,onThumbPointerDown:u,onThumbPositionChange:f,onDragScroll:d,onWheelScroll:p,onResize:m,...v}=e,g=mr(Xr,n),[w,x]=E.useState(null),k=dt(t,P=>x(P)),C=E.useRef(null),_=E.useRef(""),T=g.viewport,N=r.content-r.viewport,D=un(p),z=un(f),R=Ed(m,10);function B(P){if(C.current){const j=P.clientX-C.current.left,V=P.clientY-C.current.top;d({x:j,y:V})}}return E.useEffect(()=>{const P=j=>{const V=j.target;(w==null?void 0:w.contains(V))&&D(j,N)};return document.addEventListener("wheel",P,{passive:!1}),()=>document.removeEventListener("wheel",P,{passive:!1})},[T,w,N,D]),E.useEffect(z,[r,z]),hl(w,R),hl(g.content,R),S.jsx(Z$,{scope:n,scrollbar:w,hasThumb:i,onThumbChange:un(o),onThumbPointerUp:un(s),onThumbPositionChange:z,onThumbPointerDown:un(u),children:S.jsx(We.div,{...v,ref:k,style:{position:"absolute",...v.style},onPointerDown:qe(e.onPointerDown,P=>{P.button===0&&(P.target.setPointerCapture(P.pointerId),C.current=w.getBoundingClientRect(),_.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",g.viewport&&(g.viewport.style.scrollBehavior="auto"),B(P))}),onPointerMove:qe(e.onPointerMove,B),onPointerUp:qe(e.onPointerUp,P=>{const j=P.target;j.hasPointerCapture(P.pointerId)&&j.releasePointerCapture(P.pointerId),document.body.style.webkitUserSelect=_.current,g.viewport&&(g.viewport.style.scrollBehavior=""),C.current=null})})})}),Pf="ScrollAreaThumb",BR=E.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=IR(Pf,e.__scopeScrollArea);return S.jsx(Zn,{present:n||i.hasThumb,children:S.jsx(Q$,{ref:t,...r})})}),Q$=E.forwardRef((e,t)=>{const{__scopeScrollArea:n,style:r,...i}=e,o=mr(Pf,n),s=IR(Pf,n),{onThumbPositionChange:u}=s,f=dt(t,m=>s.onThumbChange(m)),d=E.useRef(void 0),p=Ed(()=>{d.current&&(d.current(),d.current=void 0)},100);return E.useEffect(()=>{const m=o.viewport;if(m){const v=()=>{if(p(),!d.current){const g=t9(m,u);d.current=g,u()}};return u(),m.addEventListener("scroll",v),()=>m.removeEventListener("scroll",v)}},[o.viewport,p,u]),S.jsx(We.div,{"data-state":s.hasThumb?"visible":"hidden",...i,ref:f,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...r},onPointerDownCapture:qe(e.onPointerDownCapture,m=>{const g=m.target.getBoundingClientRect(),w=m.clientX-g.left,x=m.clientY-g.top;s.onThumbPointerDown({x:w,y:x})}),onPointerUp:qe(e.onPointerUp,s.onThumbPointerUp)})});BR.displayName=Pf;var By="ScrollAreaCorner",UR=E.forwardRef((e,t)=>{const n=mr(By,e.__scopeScrollArea),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&r?S.jsx(J$,{...e,ref:t}):null});UR.displayName=By;var J$=E.forwardRef((e,t)=>{const{__scopeScrollArea:n,...r}=e,i=mr(By,n),[o,s]=E.useState(0),[u,f]=E.useState(0),d=!!(o&&u);return hl(i.scrollbarX,()=>{var m;const p=((m=i.scrollbarX)==null?void 0:m.offsetHeight)||0;i.onCornerHeightChange(p),f(p)}),hl(i.scrollbarY,()=>{var m;const p=((m=i.scrollbarY)==null?void 0:m.offsetWidth)||0;i.onCornerWidthChange(p),s(p)}),d?S.jsx(We.div,{...r,ref:t,style:{width:o,height:u,position:"absolute",right:i.dir==="ltr"?0:void 0,left:i.dir==="rtl"?0:void 0,bottom:0,...e.style}}):null});function Ff(e){return e?parseInt(e,10):0}function HR(e,t){const n=e/t;return isNaN(n)?0:n}function Sd(e){const t=HR(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function e9(e,t,n,r="ltr"){const i=Sd(n),o=i/2,s=t||o,u=i-s,f=n.scrollbar.paddingStart+s,d=n.scrollbar.size-n.scrollbar.paddingEnd-u,p=n.content-n.viewport,m=r==="ltr"?[0,p]:[p*-1,0];return $R([f,d],m)(e)}function NE(e,t,n="ltr"){const r=Sd(t),i=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,o=t.scrollbar.size-i,s=t.content-t.viewport,u=o-r,f=n==="ltr"?[0,s]:[s*-1,0],d=lv(e,f);return $R([0,s],[0,u])(d)}function $R(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}function VR(e,t){return e>0&&e{})=>{let n={left:e.scrollLeft,top:e.scrollTop},r=0;return function i(){const o={left:e.scrollLeft,top:e.scrollTop},s=n.left!==o.left,u=n.top!==o.top;(s||u)&&t(),n=o,r=window.requestAnimationFrame(i)}(),()=>window.cancelAnimationFrame(r)};function Ed(e,t){const n=un(e),r=E.useRef(0);return E.useEffect(()=>()=>window.clearTimeout(r.current),[]),E.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(n,t)},[n,t])}function hl(e,t){const n=un(t);xn(()=>{let r=0;if(e){const i=new ResizeObserver(()=>{cancelAnimationFrame(r),r=window.requestAnimationFrame(n)});return i.observe(e),()=>{window.cancelAnimationFrame(r),i.unobserve(e)}}},[e,n])}var qR=jR,n9=PR,r9=UR;const YR=E.forwardRef(({className:e,children:t,...n},r)=>S.jsxs(qR,{ref:r,className:Me("relative overflow-hidden",e),...n,children:[S.jsx(n9,{className:"h-full w-full rounded-[inherit]",children:t}),S.jsx(WR,{}),S.jsx(r9,{})]}));YR.displayName=qR.displayName;const WR=E.forwardRef(({className:e,orientation:t="vertical",...n},r)=>S.jsx(Iy,{ref:r,orientation:t,className:Me("flex touch-none transition-colors select-none",t==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-[1px]",t==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",e),...n,children:S.jsx(BR,{className:"bg-border relative flex-1 rounded-full"})}));WR.displayName=Iy.displayName;function sv(e,t={}){const{decimals:n=0,sizeType:r="normal"}=t,i=["Bytes","KB","MB","GB","TB"],o=["Bytes","KiB","MiB","GiB","TiB"];if(e===0)return"0 Byte";const s=Math.floor(Math.log(e)/Math.log(1024));return`${(e/Math.pow(1024,s)).toFixed(n)} ${r==="accurate"?o[s]??"Bytes":i[s]??"Bytes"}`}function i9(e){const{value:t,onValueChange:n,onUpload:r,progresses:i,accept:o=wz,maxSize:s=1024*1024*200,maxFileCount:u=1,multiple:f=!1,disabled:d=!1,description:p,className:m,...v}=e,[g,w]=_i({prop:t,onChange:n}),x=E.useCallback((_,T)=>{if(!f&&u===1&&_.length>1){vn.error("Cannot upload more than 1 file at a time");return}if(((g==null?void 0:g.length)??0)+_.length>u){vn.error(`Cannot upload more than ${u} files`);return}const N=_.map(z=>Object.assign(z,{preview:URL.createObjectURL(z)})),D=g?[...g,...N]:N;if(w(D),T.length>0&&T.forEach(({file:z})=>{vn.error(`File ${z.name} was rejected`)}),r&&D.length>0&&D.length<=u){const z=D.length>0?`${D.length} files`:"file";vn.promise(r(D),{loading:`Uploading ${z}...`,success:()=>(w([]),`${z} uploaded`),error:`Failed to upload ${z}`})}},[g,u,f,r,w]);function k(_){if(!g)return;const T=g.filter((N,D)=>D!==_);w(T),n==null||n(T)}E.useEffect(()=>()=>{g&&g.forEach(_=>{XR(_)&&URL.revokeObjectURL(_.preview)})},[]);const C=d||((g==null?void 0:g.length)??0)>=u;return S.jsxs("div",{className:"relative flex flex-col gap-6 overflow-hidden",children:[S.jsx(wd,{onDrop:x,accept:o,maxSize:s,maxFiles:u,multiple:u>1||f,disabled:C,children:({getRootProps:_,getInputProps:T,isDragActive:N})=>S.jsxs("div",{..._(),className:Me("group border-muted-foreground/25 hover:bg-muted/25 relative grid h-52 w-full cursor-pointer place-items-center rounded-lg border-2 border-dashed px-5 py-2.5 text-center transition","ring-offset-background focus-visible:ring-ring focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-none",N&&"border-muted-foreground/50",C&&"pointer-events-none opacity-60",m),...v,children:[S.jsx("input",{...T()}),N?S.jsxs("div",{className:"flex flex-col items-center justify-center gap-4 sm:px-5",children:[S.jsx("div",{className:"rounded-full border border-dashed p-3",children:S.jsx(Ag,{className:"text-muted-foreground size-7","aria-hidden":"true"})}),S.jsx("p",{className:"text-muted-foreground font-medium",children:"Drop the files here"})]}):S.jsxs("div",{className:"flex flex-col items-center justify-center gap-4 sm:px-5",children:[S.jsx("div",{className:"rounded-full border border-dashed p-3",children:S.jsx(Ag,{className:"text-muted-foreground size-7","aria-hidden":"true"})}),S.jsxs("div",{className:"flex flex-col gap-px",children:[S.jsx("p",{className:"text-muted-foreground font-medium",children:"Drag and drop files here, or click to select files"}),p?S.jsx("p",{className:"text-muted-foreground/70 text-sm",children:p}):S.jsxs("p",{className:"text-muted-foreground/70 text-sm",children:["You can upload",u>1?` ${u===1/0?"multiple":u} - files (up to ${sv(s)} each)`:` a file with ${sv(s)}`,"Supported formats: TXT, MD, DOCX, PDF, PPTX, RTF, ODT, EPUB, HTML, HTM, TEX, JSON, XML, YAML, YML, CSV, LOG, CONF, INI, PROPERTIES, SQL, BAT, SH, C, CPP, PY, JAVA, JS, TS, SWIFT, GO, RB, PHP, CSS, SCSS, LESS"]})]})]})]})}),g!=null&&g.length?S.jsx(YR,{className:"h-fit w-full px-3",children:S.jsx("div",{className:"flex max-h-48 flex-col gap-4",children:g==null?void 0:g.map((_,T)=>S.jsx(a9,{file:_,onRemove:()=>k(T),progress:i==null?void 0:i[_.name]},T))})}):null]})}function a9({file:e,progress:t,onRemove:n}){return S.jsxs("div",{className:"relative flex items-center gap-2.5",children:[S.jsxs("div",{className:"flex flex-1 gap-2.5",children:[XR(e)?S.jsx(o9,{file:e}):null,S.jsxs("div",{className:"flex w-full flex-col gap-2",children:[S.jsxs("div",{className:"flex flex-col gap-px",children:[S.jsx("p",{className:"text-foreground/80 line-clamp-1 text-sm font-medium",children:e.name}),S.jsx("p",{className:"text-muted-foreground text-xs",children:sv(e.size)})]}),t?S.jsx(LR,{value:t}):null]})]}),S.jsx("div",{className:"flex items-center gap-2",children:S.jsxs(Ot,{type:"button",variant:"outline",size:"icon",className:"size-7",onClick:n,children:[S.jsx(Ek,{className:"size-4","aria-hidden":"true"}),S.jsx("span",{className:"sr-only",children:"Remove file"})]})})]})}function XR(e){return"preview"in e&&typeof e.preview=="string"}function o9({file:e}){return e.type.startsWith("image/")?S.jsx("div",{className:"aspect-square shrink-0 rounded-md object-cover"}):S.jsx(_M,{className:"text-muted-foreground size-10","aria-hidden":"true"})}function l9(){const[e,t]=E.useState(!1),[n,r]=E.useState(!1),[i,o]=E.useState({}),s=E.useCallback(async u=>{r(!0);try{await Promise.all(u.map(async f=>{try{const d=await uM(f,p=>{console.debug(`Uploading ${f.name}: ${p}%`),o(m=>({...m,[f.name]:p}))});d.status==="success"?vn.success(`Upload Success: -${f.name} uploaded successfully`):vn.error(`Upload Failed: -${f.name} -${d.message}`)}catch(d){vn.error(`Upload Failed: -${f.name} -${Cr(d)}`)}}))}catch(f){vn.error(`Upload Failed -`+Cr(f))}finally{r(!1)}},[r,o]);return S.jsxs(KA,{open:e,onOpenChange:u=>{n&&!u||t(u)},children:[S.jsx(ZA,{asChild:!0,children:S.jsxs(Ot,{variant:"default",side:"bottom",tooltip:"Upload documents",size:"sm",children:[S.jsx(Ag,{})," Upload"]})}),S.jsxs(Cy,{className:"sm:max-w-xl",onCloseAutoFocus:u=>u.preventDefault(),children:[S.jsxs(Ty,{children:[S.jsx(Ay,{children:"Upload documents"}),S.jsx(Ry,{children:"Drag and drop your documents here or click to browse."})]}),S.jsx(i9,{maxFileCount:1/0,maxSize:200*1024*1024,description:"supported types: TXT, MD, DOCX, PDF, PPTX, RTF, ODT, EPUB, HTML, HTM, TEX, JSON, XML, YAML, YML, CSV, LOG, CONF, INI, PROPERTIES, SQL, BAT, SH, C, CPP, PY, JAVA, JS, TS, SWIFT, GO, RB, PHP, CSS, SCSS, LESS",onUpload:s,progresses:i,disabled:n})]})]})}function s9(){const[e,t]=E.useState(!1),n=E.useCallback(async()=>{try{const r=await cM();r.status==="success"?(vn.success("Documents cleared successfully"),t(!1)):vn.error(`Clear Documents Failed: -${r.message}`)}catch(r){vn.error(`Clear Documents Failed: -`+Cr(r))}},[t]);return S.jsxs(KA,{open:e,onOpenChange:t,children:[S.jsx(ZA,{asChild:!0,children:S.jsxs(Ot,{variant:"outline",side:"bottom",tooltip:"Clear documents",size:"sm",children:[S.jsx(wk,{})," Clear"]})}),S.jsxs(Cy,{className:"sm:max-w-xl",onCloseAutoFocus:r=>r.preventDefault(),children:[S.jsxs(Ty,{children:[S.jsx(Ay,{children:"Clear documents"}),S.jsx(Ry,{children:"Do you really want to clear all documents?"})]}),S.jsx(Ot,{variant:"destructive",onClick:n,children:"YES"})]})]})}function u9(){const e=Mn.use.health(),[t,n]=E.useState(null),r=E.useCallback(async()=>{try{const o=await aM();o&&o.statuses&&Object.values(o.statuses).reduce((u,f)=>u+f.length,0)>0?n(o):n(null)}catch(o){vn.error(`Failed to load documents -`+Cr(o))}},[n]);E.useEffect(()=>{r()},[]);const i=E.useCallback(async()=>{try{const{status:o}=await oM();vn.message(o)}catch(o){vn.error(`Failed to load documents -`+Cr(o))}},[]);return E.useEffect(()=>{const o=setInterval(async()=>{if(e)try{await r()}catch(s){vn.error(`Failed to get scan progress -`+Cr(s))}},5e3);return()=>clearInterval(o)},[e,r]),S.jsxs(Ks,{className:"!size-full !rounded-none !border-none",children:[S.jsx(Nf,{children:S.jsx(Zs,{className:"text-lg",children:"Document Management"})}),S.jsxs(Of,{className:"space-y-4",children:[S.jsxs("div",{className:"flex gap-2",children:[S.jsxs(Ot,{variant:"outline",onClick:i,side:"bottom",tooltip:"Scan documents",size:"sm",children:[S.jsx(YM,{})," Scan"]}),S.jsx("div",{className:"flex-1"}),S.jsx(s9,{}),S.jsx(l9,{})]}),S.jsxs(Ks,{children:[S.jsxs(Nf,{children:[S.jsx(Zs,{children:"Uploaded documents"}),S.jsx(xd,{children:"view the uploaded documents here"})]}),S.jsxs(Of,{children:[!t&&S.jsx(PH,{title:"No documents uploaded",description:"upload documents to see them here"}),t&&S.jsxs(mR,{children:[S.jsx(gR,{children:S.jsxs(tv,{children:[S.jsx(bi,{children:"ID"}),S.jsx(bi,{children:"Summary"}),S.jsx(bi,{children:"Status"}),S.jsx(bi,{children:"Length"}),S.jsx(bi,{children:"Chunks"}),S.jsx(bi,{children:"Created"}),S.jsx(bi,{children:"Updated"}),S.jsx(bi,{children:"Metadata"})]})}),S.jsx(vR,{className:"text-sm",children:Object.entries(t.statuses).map(([o,s])=>s.map(u=>S.jsxs(tv,{children:[S.jsx(xi,{className:"truncate font-mono",children:u.id}),S.jsx(xi,{className:"max-w-xs min-w-24 truncate",children:S.jsx(Ln,{text:u.content_summary,tooltip:u.content_summary,tooltipClassName:"max-w-none overflow-visible block"})}),S.jsxs(xi,{children:[o==="processed"&&S.jsx("span",{className:"text-green-600",children:"Completed"}),o==="processing"&&S.jsx("span",{className:"text-blue-600",children:"Processing"}),o==="pending"&&S.jsx("span",{className:"text-yellow-600",children:"Pending"}),o==="failed"&&S.jsx("span",{className:"text-red-600",children:"Failed"}),u.error&&S.jsx("span",{className:"ml-2 text-red-500",title:u.error,children:"⚠️"})]}),S.jsx(xi,{children:u.content_length??"-"}),S.jsx(xi,{children:u.chunks_count??"-"}),S.jsx(xi,{className:"truncate",children:new Date(u.created_at).toLocaleString()}),S.jsx(xi,{className:"truncate",children:new Date(u.updated_at).toLocaleString()}),S.jsx(xi,{className:"max-w-xs truncate",children:u.metadata?JSON.stringify(u.metadata):"-"})]},u.id)))})]})]})]})]})]})}function KR(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i=u?i=i+OE("0",s-u):i=(i.substring(0,s)||"0")+"."+i.substring(s),n+i}function LE(e,t,n){if(["","-"].indexOf(e)!==-1)return e;var r=(e.indexOf(".")!==-1||n)&&t,i=Uy(e),o=i.beforeDecimal,s=i.afterDecimal,u=i.hasNegation,f=parseFloat("0."+(s||"0")),d=s.length<=t?"0."+s:f.toFixed(t),p=d.split("."),m=o;o&&Number(p[0])&&(m=o.split("").reverse().reduce(function(x,k,C){return x.length>C?(Number(x[0])+Number(k)).toString()+x.substring(1,x.length):k+x},p[0]));var v=JR(p[1]||"",t,n),g=u?"-":"",w=r?".":"";return""+g+m+w+v}function Va(e,t){if(e.value=e.value,e!==null){if(e.createTextRange){var n=e.createTextRange();return n.move("character",t),n.select(),!0}return e.selectionStart||e.selectionStart===0?(e.focus(),e.setSelectionRange(t,t),!0):(e.focus(),!1)}}var t2=c9(function(e,t){for(var n=0,r=0,i=e.length,o=t.length;e[n]===t[n]&&nn&&i-r>n;)r++;return{from:{start:n,end:i-r},to:{start:n,end:o-r}}}),g9=function(e,t){var n=Math.min(e.selectionStart,t);return{from:{start:n,end:e.selectionEnd},to:{start:n,end:t}}};function v9(e,t,n){return Math.min(Math.max(e,t),n)}function eg(e){return Math.max(e.selectionStart,e.selectionEnd)}function y9(){return typeof navigator<"u"&&!(navigator.platform&&/iPhone|iPod/.test(navigator.platform))}function b9(e){return{from:{start:0,end:0},to:{start:0,end:e.length},lastValue:""}}function x9(e){var t=e.currentValue,n=e.formattedValue,r=e.currentValueIndex,i=e.formattedValueIndex;return t[r]===n[i]}function w9(e,t,n,r,i,o,s){s===void 0&&(s=x9);var u=i.findIndex(function(N){return N}),f=e.slice(0,u);!t&&!n.startsWith(f)&&(t=f,n=f+n,r=r+f.length);for(var d=n.length,p=e.length,m={},v=new Array(d),g=0;g0&&v[C]===-1;)C--;var T=C===-1||v[C]===-1?0:v[C]+1;return T>_?_:r-T<_-r?T:_}function zE(e,t,n,r){var i=e.length;if(t=v9(t,0,i),r==="left"){for(;t>=0&&!n[t];)t--;t===-1&&(t=n.indexOf(!0))}else{for(;t<=i&&!n[t];)t++;t>i&&(t=n.lastIndexOf(!0))}return t===-1&&(t=i),t}function S9(e){for(var t=Array.from({length:e.length+1}).map(function(){return!0}),n=0,r=t.length;nR.length-s.length||zV||m>e.length-s.length)&&(j=m),e=e.substring(0,j),e=C9(T?"-"+e:e,i),e=(e.match(T9(w))||[]).join("");var q=e.indexOf(w);e=e.replace(new RegExp(QR(w),"g"),function(G,F){return F===q?".":""});var I=Uy(e,i),Y=I.beforeDecimal,Z=I.afterDecimal,U=I.addNegation;return d.end-d.start$?!1:A>=re.start&&A{const[x,k]=E.useState(v??r),C=E.useCallback(()=>{k(D=>D===void 0?e??1:Math.min(D+(e??1),o))},[e,o]),_=E.useCallback(()=>{k(D=>D===void 0?-(e??1):Math.max(D-(e??1),i))},[e,i]);E.useEffect(()=>{v!==void 0&&k(v)},[v]);const T=D=>{const z=D.floatValue===void 0?void 0:D.floatValue;k(z),s&&s(z)},N=()=>{x!==void 0&&(xo&&(k(o),w.current.value=String(o)))};return S.jsxs("div",{className:"relative flex",children:[S.jsx(L9,{value:x,onValueChange:T,thousandSeparator:t,decimalScale:f,fixedDecimalScale:u,allowNegative:i<0,valueIsNumericString:!0,onBlur:N,max:o,min:i,suffix:p,prefix:m,customInput:D=>S.jsx(Za,{...D,className:Me("w-full",d)}),placeholder:n,className:"[appearance:textfield] [&::-webkit-inner-spin-button]:appearance-none [&::-webkit-outer-spin-button]:appearance-none",getInputRef:w,...g}),S.jsxs("div",{className:"absolute top-0 right-0 bottom-0 flex flex-col",children:[S.jsx(Ot,{"aria-label":"Increase value",className:"border-input h-1/2 rounded-l-none rounded-br-none border-b border-l px-2 focus-visible:relative",variant:"outline",onClick:C,disabled:x===o,children:S.jsx(xk,{size:15})}),S.jsx(Ot,{"aria-label":"Decrease value",className:"border-input h-1/2 rounded-l-none rounded-tr-none border-b border-l px-2 focus-visible:relative",variant:"outline",onClick:_,disabled:x===i,children:S.jsx(zv,{size:15})})]})]})});Jo.displayName="NumberInput";var z9=[" ","Enter","ArrowUp","ArrowDown"],j9=[" ","Enter"],gu="Select",[kd,Cd,M9]=pT(gu),[Al,vK]=hr(gu,[M9,wl]),Td=wl(),[P9,pa]=Al(gu),[F9,I9]=Al(gu),r2=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:i,onOpenChange:o,value:s,defaultValue:u,onValueChange:f,dir:d,name:p,autoComplete:m,disabled:v,required:g,form:w}=e,x=Td(t),[k,C]=E.useState(null),[_,T]=E.useState(null),[N,D]=E.useState(!1),z=hd(d),[R=!1,B]=_i({prop:r,defaultProp:i,onChange:o}),[P,j]=_i({prop:s,defaultProp:u,onChange:f}),V=E.useRef(null),q=k?w||!!k.closest("form"):!0,[I,Y]=E.useState(new Set),Z=Array.from(I).map(U=>U.props.value).join(";");return S.jsx(ny,{...x,children:S.jsxs(P9,{required:g,scope:t,trigger:k,onTriggerChange:C,valueNode:_,onValueNodeChange:T,valueNodeHasChildren:N,onValueNodeHasChildrenChange:D,contentId:bn(),value:P,onValueChange:j,open:R,onOpenChange:B,dir:z,triggerPointerDownPosRef:V,disabled:v,children:[S.jsx(kd.Provider,{scope:t,children:S.jsx(F9,{scope:e.__scopeSelect,onNativeOptionAdd:E.useCallback(U=>{Y(G=>new Set(G).add(U))},[]),onNativeOptionRemove:E.useCallback(U=>{Y(G=>{const F=new Set(G);return F.delete(U),F})},[]),children:n})}),q?S.jsxs(R2,{"aria-hidden":!0,required:g,tabIndex:-1,name:p,autoComplete:m,value:P,onChange:U=>j(U.target.value),disabled:v,form:w,children:[P===void 0?S.jsx("option",{value:""}):null,Array.from(I)]},Z):null]})})};r2.displayName=gu;var i2="SelectTrigger",a2=E.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...i}=e,o=Td(n),s=pa(i2,n),u=s.disabled||r,f=dt(t,s.onTriggerChange),d=Cd(n),p=E.useRef("touch"),[m,v,g]=D2(x=>{const k=d().filter(T=>!T.disabled),C=k.find(T=>T.value===s.value),_=N2(k,x,C);_!==void 0&&s.onValueChange(_.value)}),w=x=>{u||(s.onOpenChange(!0),g()),x&&(s.triggerPointerDownPosRef.current={x:Math.round(x.pageX),y:Math.round(x.pageY)})};return S.jsx(od,{asChild:!0,...o,children:S.jsx(We.button,{type:"button",role:"combobox","aria-controls":s.contentId,"aria-expanded":s.open,"aria-required":s.required,"aria-autocomplete":"none",dir:s.dir,"data-state":s.open?"open":"closed",disabled:u,"data-disabled":u?"":void 0,"data-placeholder":A2(s.value)?"":void 0,...i,ref:f,onClick:qe(i.onClick,x=>{x.currentTarget.focus(),p.current!=="mouse"&&w(x)}),onPointerDown:qe(i.onPointerDown,x=>{p.current=x.pointerType;const k=x.target;k.hasPointerCapture(x.pointerId)&&k.releasePointerCapture(x.pointerId),x.button===0&&x.ctrlKey===!1&&x.pointerType==="mouse"&&(w(x),x.preventDefault())}),onKeyDown:qe(i.onKeyDown,x=>{const k=m.current!=="";!(x.ctrlKey||x.altKey||x.metaKey)&&x.key.length===1&&v(x.key),!(k&&x.key===" ")&&z9.includes(x.key)&&(w(),x.preventDefault())})})})});a2.displayName=i2;var o2="SelectValue",l2=E.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:i,children:o,placeholder:s="",...u}=e,f=pa(o2,n),{onValueNodeHasChildrenChange:d}=f,p=o!==void 0,m=dt(t,f.onValueNodeChange);return xn(()=>{d(p)},[d,p]),S.jsx(We.span,{...u,ref:m,style:{pointerEvents:"none"},children:A2(f.value)?S.jsx(S.Fragment,{children:s}):o})});l2.displayName=o2;var G9="SelectIcon",s2=E.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...i}=e;return S.jsx(We.span,{"aria-hidden":!0,...i,ref:t,children:r||"▼"})});s2.displayName=G9;var B9="SelectPortal",u2=e=>S.jsx(Qf,{asChild:!0,...e});u2.displayName=B9;var eo="SelectContent",c2=E.forwardRef((e,t)=>{const n=pa(eo,e.__scopeSelect),[r,i]=E.useState();if(xn(()=>{i(new DocumentFragment)},[]),!n.open){const o=r;return o?au.createPortal(S.jsx(f2,{scope:e.__scopeSelect,children:S.jsx(kd.Slot,{scope:e.__scopeSelect,children:S.jsx("div",{children:e.children})})}),o):null}return S.jsx(d2,{...e,ref:t})});c2.displayName=eo;var _r=10,[f2,ma]=Al(eo),U9="SelectContentImpl",d2=E.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:i,onEscapeKeyDown:o,onPointerDownOutside:s,side:u,sideOffset:f,align:d,alignOffset:p,arrowPadding:m,collisionBoundary:v,collisionPadding:g,sticky:w,hideWhenDetached:x,avoidCollisions:k,...C}=e,_=pa(eo,n),[T,N]=E.useState(null),[D,z]=E.useState(null),R=dt(t,ae=>N(ae)),[B,P]=E.useState(null),[j,V]=E.useState(null),q=Cd(n),[I,Y]=E.useState(!1),Z=E.useRef(!1);E.useEffect(()=>{if(T)return Pv(T)},[T]),Mv();const U=E.useCallback(ae=>{const[oe,...Ce]=q().map(we=>we.ref.current),[he]=Ce.slice(-1),Ee=document.activeElement;for(const we of ae)if(we===Ee||(we==null||we.scrollIntoView({block:"nearest"}),we===oe&&D&&(D.scrollTop=0),we===he&&D&&(D.scrollTop=D.scrollHeight),we==null||we.focus(),document.activeElement!==Ee))return},[q,D]),G=E.useCallback(()=>U([B,T]),[U,B,T]);E.useEffect(()=>{I&&G()},[I,G]);const{onOpenChange:F,triggerPointerDownPosRef:K}=_;E.useEffect(()=>{if(T){let ae={x:0,y:0};const oe=he=>{var Ee,we;ae={x:Math.abs(Math.round(he.pageX)-(((Ee=K.current)==null?void 0:Ee.x)??0)),y:Math.abs(Math.round(he.pageY)-(((we=K.current)==null?void 0:we.y)??0))}},Ce=he=>{ae.x<=10&&ae.y<=10?he.preventDefault():T.contains(he.target)||F(!1),document.removeEventListener("pointermove",oe),K.current=null};return K.current!==null&&(document.addEventListener("pointermove",oe),document.addEventListener("pointerup",Ce,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",oe),document.removeEventListener("pointerup",Ce,{capture:!0})}}},[T,F,K]),E.useEffect(()=>{const ae=()=>F(!1);return window.addEventListener("blur",ae),window.addEventListener("resize",ae),()=>{window.removeEventListener("blur",ae),window.removeEventListener("resize",ae)}},[F]);const[A,$]=D2(ae=>{const oe=q().filter(Ee=>!Ee.disabled),Ce=oe.find(Ee=>Ee.ref.current===document.activeElement),he=N2(oe,ae,Ce);he&&setTimeout(()=>he.ref.current.focus())}),M=E.useCallback((ae,oe,Ce)=>{const he=!Z.current&&!Ce;(_.value!==void 0&&_.value===oe||he)&&(P(ae),he&&(Z.current=!0))},[_.value]),O=E.useCallback(()=>T==null?void 0:T.focus(),[T]),X=E.useCallback((ae,oe,Ce)=>{const he=!Z.current&&!Ce;(_.value!==void 0&&_.value===oe||he)&&V(ae)},[_.value]),re=r==="popper"?uv:h2,ue=re===uv?{side:u,sideOffset:f,align:d,alignOffset:p,arrowPadding:m,collisionBoundary:v,collisionPadding:g,sticky:w,hideWhenDetached:x,avoidCollisions:k}:{};return S.jsx(f2,{scope:n,content:T,viewport:D,onViewportChange:z,itemRefCallback:M,selectedItem:B,onItemLeave:O,itemTextRefCallback:X,focusSelectedItem:G,selectedItemText:j,position:r,isPositioned:I,searchRef:A,children:S.jsx(ed,{as:ua,allowPinchZoom:!0,children:S.jsx(Zf,{asChild:!0,trapped:_.open,onMountAutoFocus:ae=>{ae.preventDefault()},onUnmountAutoFocus:qe(i,ae=>{var oe;(oe=_.trigger)==null||oe.focus({preventScroll:!0}),ae.preventDefault()}),children:S.jsx(ou,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:o,onPointerDownOutside:s,onFocusOutside:ae=>ae.preventDefault(),onDismiss:()=>_.onOpenChange(!1),children:S.jsx(re,{role:"listbox",id:_.contentId,"data-state":_.open?"open":"closed",dir:_.dir,onContextMenu:ae=>ae.preventDefault(),...C,...ue,onPlaced:()=>Y(!0),ref:R,style:{display:"flex",flexDirection:"column",outline:"none",...C.style},onKeyDown:qe(C.onKeyDown,ae=>{const oe=ae.ctrlKey||ae.altKey||ae.metaKey;if(ae.key==="Tab"&&ae.preventDefault(),!oe&&ae.key.length===1&&$(ae.key),["ArrowUp","ArrowDown","Home","End"].includes(ae.key)){let he=q().filter(Ee=>!Ee.disabled).map(Ee=>Ee.ref.current);if(["ArrowUp","End"].includes(ae.key)&&(he=he.slice().reverse()),["ArrowUp","ArrowDown"].includes(ae.key)){const Ee=ae.target,we=he.indexOf(Ee);he=he.slice(we+1)}setTimeout(()=>U(he)),ae.preventDefault()}})})})})})})});d2.displayName=U9;var H9="SelectItemAlignedPosition",h2=E.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...i}=e,o=pa(eo,n),s=ma(eo,n),[u,f]=E.useState(null),[d,p]=E.useState(null),m=dt(t,R=>p(R)),v=Cd(n),g=E.useRef(!1),w=E.useRef(!0),{viewport:x,selectedItem:k,selectedItemText:C,focusSelectedItem:_}=s,T=E.useCallback(()=>{if(o.trigger&&o.valueNode&&u&&d&&x&&k&&C){const R=o.trigger.getBoundingClientRect(),B=d.getBoundingClientRect(),P=o.valueNode.getBoundingClientRect(),j=C.getBoundingClientRect();if(o.dir!=="rtl"){const Ee=j.left-B.left,we=P.left-Ee,Pe=R.left-we,Ae=R.width+Pe,xe=Math.max(Ae,B.width),ee=window.innerWidth-_r,ce=lv(we,[_r,Math.max(_r,ee-xe)]);u.style.minWidth=Ae+"px",u.style.left=ce+"px"}else{const Ee=B.right-j.right,we=window.innerWidth-P.right-Ee,Pe=window.innerWidth-R.right-we,Ae=R.width+Pe,xe=Math.max(Ae,B.width),ee=window.innerWidth-_r,ce=lv(we,[_r,Math.max(_r,ee-xe)]);u.style.minWidth=Ae+"px",u.style.right=ce+"px"}const V=v(),q=window.innerHeight-_r*2,I=x.scrollHeight,Y=window.getComputedStyle(d),Z=parseInt(Y.borderTopWidth,10),U=parseInt(Y.paddingTop,10),G=parseInt(Y.borderBottomWidth,10),F=parseInt(Y.paddingBottom,10),K=Z+U+I+F+G,A=Math.min(k.offsetHeight*5,K),$=window.getComputedStyle(x),M=parseInt($.paddingTop,10),O=parseInt($.paddingBottom,10),X=R.top+R.height/2-_r,re=q-X,ue=k.offsetHeight/2,ae=k.offsetTop+ue,oe=Z+U+ae,Ce=K-oe;if(oe<=X){const Ee=V.length>0&&k===V[V.length-1].ref.current;u.style.bottom="0px";const we=d.clientHeight-x.offsetTop-x.offsetHeight,Pe=Math.max(re,ue+(Ee?O:0)+we+G),Ae=oe+Pe;u.style.height=Ae+"px"}else{const Ee=V.length>0&&k===V[0].ref.current;u.style.top="0px";const Pe=Math.max(X,Z+x.offsetTop+(Ee?M:0)+ue)+Ce;u.style.height=Pe+"px",x.scrollTop=oe-X+x.offsetTop}u.style.margin=`${_r}px 0`,u.style.minHeight=A+"px",u.style.maxHeight=q+"px",r==null||r(),requestAnimationFrame(()=>g.current=!0)}},[v,o.trigger,o.valueNode,u,d,x,k,C,o.dir,r]);xn(()=>T(),[T]);const[N,D]=E.useState();xn(()=>{d&&D(window.getComputedStyle(d).zIndex)},[d]);const z=E.useCallback(R=>{R&&w.current===!0&&(T(),_==null||_(),w.current=!1)},[T,_]);return S.jsx(V9,{scope:n,contentWrapper:u,shouldExpandOnScrollRef:g,onScrollButtonChange:z,children:S.jsx("div",{ref:f,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:N},children:S.jsx(We.div,{...i,ref:m,style:{boxSizing:"border-box",maxHeight:"100%",...i.style}})})})});h2.displayName=H9;var $9="SelectPopperPosition",uv=E.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:i=_r,...o}=e,s=Td(n);return S.jsx(ry,{...s,...o,ref:t,align:r,collisionPadding:i,style:{boxSizing:"border-box",...o.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});uv.displayName=$9;var[V9,Hy]=Al(eo,{}),cv="SelectViewport",p2=E.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...i}=e,o=ma(cv,n),s=Hy(cv,n),u=dt(t,o.onViewportChange),f=E.useRef(0);return S.jsxs(S.Fragment,{children:[S.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:r}),S.jsx(kd.Slot,{scope:n,children:S.jsx(We.div,{"data-radix-select-viewport":"",role:"presentation",...i,ref:u,style:{position:"relative",flex:1,overflow:"hidden auto",...i.style},onScroll:qe(i.onScroll,d=>{const p=d.currentTarget,{contentWrapper:m,shouldExpandOnScrollRef:v}=s;if(v!=null&&v.current&&m){const g=Math.abs(f.current-p.scrollTop);if(g>0){const w=window.innerHeight-_r*2,x=parseFloat(m.style.minHeight),k=parseFloat(m.style.height),C=Math.max(x,k);if(C0?N:0,m.style.justifyContent="flex-end")}}}f.current=p.scrollTop})})})]})});p2.displayName=cv;var m2="SelectGroup",[q9,Y9]=Al(m2),g2=E.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=bn();return S.jsx(q9,{scope:n,id:i,children:S.jsx(We.div,{role:"group","aria-labelledby":i,...r,ref:t})})});g2.displayName=m2;var v2="SelectLabel",y2=E.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=Y9(v2,n);return S.jsx(We.div,{id:i.id,...r,ref:t})});y2.displayName=v2;var If="SelectItem",[W9,b2]=Al(If),x2=E.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:i=!1,textValue:o,...s}=e,u=pa(If,n),f=ma(If,n),d=u.value===r,[p,m]=E.useState(o??""),[v,g]=E.useState(!1),w=dt(t,_=>{var T;return(T=f.itemRefCallback)==null?void 0:T.call(f,_,r,i)}),x=bn(),k=E.useRef("touch"),C=()=>{i||(u.onValueChange(r),u.onOpenChange(!1))};if(r==="")throw new Error("A must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return S.jsx(W9,{scope:n,value:r,disabled:i,textId:x,isSelected:d,onItemTextChange:E.useCallback(_=>{m(T=>T||((_==null?void 0:_.textContent)??"").trim())},[]),children:S.jsx(kd.ItemSlot,{scope:n,value:r,disabled:i,textValue:p,children:S.jsx(We.div,{role:"option","aria-labelledby":x,"data-highlighted":v?"":void 0,"aria-selected":d&&v,"data-state":d?"checked":"unchecked","aria-disabled":i||void 0,"data-disabled":i?"":void 0,tabIndex:i?void 0:-1,...s,ref:w,onFocus:qe(s.onFocus,()=>g(!0)),onBlur:qe(s.onBlur,()=>g(!1)),onClick:qe(s.onClick,()=>{k.current!=="mouse"&&C()}),onPointerUp:qe(s.onPointerUp,()=>{k.current==="mouse"&&C()}),onPointerDown:qe(s.onPointerDown,_=>{k.current=_.pointerType}),onPointerMove:qe(s.onPointerMove,_=>{var T;k.current=_.pointerType,i?(T=f.onItemLeave)==null||T.call(f):k.current==="mouse"&&_.currentTarget.focus({preventScroll:!0})}),onPointerLeave:qe(s.onPointerLeave,_=>{var T;_.currentTarget===document.activeElement&&((T=f.onItemLeave)==null||T.call(f))}),onKeyDown:qe(s.onKeyDown,_=>{var N;((N=f.searchRef)==null?void 0:N.current)!==""&&_.key===" "||(j9.includes(_.key)&&C(),_.key===" "&&_.preventDefault())})})})})});x2.displayName=If;var Is="SelectItemText",w2=E.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:i,...o}=e,s=pa(Is,n),u=ma(Is,n),f=b2(Is,n),d=I9(Is,n),[p,m]=E.useState(null),v=dt(t,C=>m(C),f.onItemTextChange,C=>{var _;return(_=u.itemTextRefCallback)==null?void 0:_.call(u,C,f.value,f.disabled)}),g=p==null?void 0:p.textContent,w=E.useMemo(()=>S.jsx("option",{value:f.value,disabled:f.disabled,children:g},f.value),[f.disabled,f.value,g]),{onNativeOptionAdd:x,onNativeOptionRemove:k}=d;return xn(()=>(x(w),()=>k(w)),[x,k,w]),S.jsxs(S.Fragment,{children:[S.jsx(We.span,{id:f.textId,...o,ref:v}),f.isSelected&&s.valueNode&&!s.valueNodeHasChildren?au.createPortal(o.children,s.valueNode):null]})});w2.displayName=Is;var S2="SelectItemIndicator",E2=E.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return b2(S2,n).isSelected?S.jsx(We.span,{"aria-hidden":!0,...r,ref:t}):null});E2.displayName=S2;var fv="SelectScrollUpButton",_2=E.forwardRef((e,t)=>{const n=ma(fv,e.__scopeSelect),r=Hy(fv,e.__scopeSelect),[i,o]=E.useState(!1),s=dt(t,r.onScrollButtonChange);return xn(()=>{if(n.viewport&&n.isPositioned){let u=function(){const d=f.scrollTop>0;o(d)};const f=n.viewport;return u(),f.addEventListener("scroll",u),()=>f.removeEventListener("scroll",u)}},[n.viewport,n.isPositioned]),i?S.jsx(C2,{...e,ref:s,onAutoScroll:()=>{const{viewport:u,selectedItem:f}=n;u&&f&&(u.scrollTop=u.scrollTop-f.offsetHeight)}}):null});_2.displayName=fv;var dv="SelectScrollDownButton",k2=E.forwardRef((e,t)=>{const n=ma(dv,e.__scopeSelect),r=Hy(dv,e.__scopeSelect),[i,o]=E.useState(!1),s=dt(t,r.onScrollButtonChange);return xn(()=>{if(n.viewport&&n.isPositioned){let u=function(){const d=f.scrollHeight-f.clientHeight,p=Math.ceil(f.scrollTop)f.removeEventListener("scroll",u)}},[n.viewport,n.isPositioned]),i?S.jsx(C2,{...e,ref:s,onAutoScroll:()=>{const{viewport:u,selectedItem:f}=n;u&&f&&(u.scrollTop=u.scrollTop+f.offsetHeight)}}):null});k2.displayName=dv;var C2=E.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...i}=e,o=ma("SelectScrollButton",n),s=E.useRef(null),u=Cd(n),f=E.useCallback(()=>{s.current!==null&&(window.clearInterval(s.current),s.current=null)},[]);return E.useEffect(()=>()=>f(),[f]),xn(()=>{var p;const d=u().find(m=>m.ref.current===document.activeElement);(p=d==null?void 0:d.ref.current)==null||p.scrollIntoView({block:"nearest"})},[u]),S.jsx(We.div,{"aria-hidden":!0,...i,ref:t,style:{flexShrink:0,...i.style},onPointerDown:qe(i.onPointerDown,()=>{s.current===null&&(s.current=window.setInterval(r,50))}),onPointerMove:qe(i.onPointerMove,()=>{var d;(d=o.onItemLeave)==null||d.call(o),s.current===null&&(s.current=window.setInterval(r,50))}),onPointerLeave:qe(i.onPointerLeave,()=>{f()})})}),X9="SelectSeparator",T2=E.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return S.jsx(We.div,{"aria-hidden":!0,...r,ref:t})});T2.displayName=X9;var hv="SelectArrow",K9=E.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=Td(n),o=pa(hv,n),s=ma(hv,n);return o.open&&s.position==="popper"?S.jsx(iy,{...i,...r,ref:t}):null});K9.displayName=hv;function A2(e){return e===""||e===void 0}var R2=E.forwardRef((e,t)=>{const{value:n,...r}=e,i=E.useRef(null),o=dt(t,i),s=eR(n);return E.useEffect(()=>{const u=i.current,f=window.HTMLSelectElement.prototype,p=Object.getOwnPropertyDescriptor(f,"value").set;if(s!==n&&p){const m=new Event("change",{bubbles:!0});p.call(u,n),u.dispatchEvent(m)}},[s,n]),S.jsx(ay,{asChild:!0,children:S.jsx("select",{...r,ref:o,defaultValue:n})})});R2.displayName="BubbleSelect";function D2(e){const t=un(e),n=E.useRef(""),r=E.useRef(0),i=E.useCallback(s=>{const u=n.current+s;t(u),function f(d){n.current=d,window.clearTimeout(r.current),d!==""&&(r.current=window.setTimeout(()=>f(""),1e3))}(u)},[t]),o=E.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return E.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,i,o]}function N2(e,t,n){const i=t.length>1&&Array.from(t).every(d=>d===t[0])?t[0]:t,o=n?e.indexOf(n):-1;let s=Z9(e,Math.max(o,0));i.length===1&&(s=s.filter(d=>d!==n));const f=s.find(d=>d.textValue.toLowerCase().startsWith(i.toLowerCase()));return f!==n?f:void 0}function Z9(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var Q9=r2,O2=a2,J9=l2,e8=s2,t8=u2,L2=c2,n8=p2,r8=g2,z2=y2,j2=x2,i8=w2,a8=E2,M2=_2,P2=k2,F2=T2;const ME=Q9,PE=r8,FE=J9,pv=E.forwardRef(({className:e,children:t,...n},r)=>S.jsxs(O2,{ref:r,className:Me("border-input bg-background ring-offset-background placeholder:text-muted-foreground focus:ring-ring flex h-10 w-full items-center justify-between rounded-md border px-3 py-2 text-sm focus:ring-2 focus:ring-offset-2 focus:outline-none disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",e),...n,children:[t,S.jsx(e8,{asChild:!0,children:S.jsx(zv,{className:"h-4 w-4 opacity-50"})})]}));pv.displayName=O2.displayName;const I2=E.forwardRef(({className:e,...t},n)=>S.jsx(M2,{ref:n,className:Me("flex cursor-default items-center justify-center py-1",e),...t,children:S.jsx(xk,{className:"h-4 w-4"})}));I2.displayName=M2.displayName;const G2=E.forwardRef(({className:e,...t},n)=>S.jsx(P2,{ref:n,className:Me("flex cursor-default items-center justify-center py-1",e),...t,children:S.jsx(zv,{className:"h-4 w-4"})}));G2.displayName=P2.displayName;const mv=E.forwardRef(({className:e,children:t,position:n="popper",...r},i)=>S.jsx(t8,{children:S.jsxs(L2,{ref:i,className:Me("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border shadow-md",n==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:n,...r,children:[S.jsx(I2,{}),S.jsx(n8,{className:Me("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),S.jsx(G2,{})]})}));mv.displayName=L2.displayName;const o8=E.forwardRef(({className:e,...t},n)=>S.jsx(z2,{ref:n,className:Me("py-1.5 pr-2 pl-8 text-sm font-semibold",e),...t}));o8.displayName=z2.displayName;const wi=E.forwardRef(({className:e,children:t,...n},r)=>S.jsxs(j2,{ref:r,className:Me("focus:bg-accent focus:text-accent-foreground relative flex w-full cursor-default items-center rounded-sm py-1.5 pr-2 pl-8 text-sm outline-none select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...n,children:[S.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:S.jsx(a8,{children:S.jsx(Lv,{className:"h-4 w-4"})})}),S.jsx(i8,{children:t})]}));wi.displayName=j2.displayName;const l8=E.forwardRef(({className:e,...t},n)=>S.jsx(F2,{ref:n,className:Me("bg-muted -mx-1 my-1 h-px",e),...t}));l8.displayName=F2.displayName;function s8(){var n,r;const e=Qe(i=>i.querySettings),t=E.useCallback((i,o)=>{Qe.getState().updateQuerySettings({[i]:o})},[]);return S.jsxs(Ks,{className:"flex shrink-0 flex-col",children:[S.jsxs(Nf,{className:"px-4 pt-4 pb-2",children:[S.jsx(Zs,{children:"Parameters"}),S.jsx(xd,{children:"Configure your query parameters"})]}),S.jsx(Of,{className:"m-0 flex grow flex-col p-0 text-xs",children:S.jsx("div",{className:"relative size-full",children:S.jsxs("div",{className:"absolute inset-0 flex flex-col gap-2 overflow-auto px-2",children:[S.jsxs(S.Fragment,{children:[S.jsx(Ln,{className:"ml-1",text:"Query Mode",tooltip:"Select the retrieval strategy:\\n• Naive: Basic search without advanced techniques\\n• Local: Context-dependent information retrieval\\n• Global: Utilizes global knowledge base\\n• Hybrid: Combines local and global retrieval\\n• Mix: Integrates knowledge graph with vector retrieval",side:"left"}),S.jsxs(ME,{value:e.mode,onValueChange:i=>t("mode",i),children:[S.jsx(pv,{className:"hover:bg-primary/5 h-9 cursor-pointer focus:ring-0 focus:ring-offset-0 focus:outline-0 active:right-0",children:S.jsx(FE,{})}),S.jsx(mv,{children:S.jsxs(PE,{children:[S.jsx(wi,{value:"naive",children:"Naive"}),S.jsx(wi,{value:"local",children:"Local"}),S.jsx(wi,{value:"global",children:"Global"}),S.jsx(wi,{value:"hybrid",children:"Hybrid"}),S.jsx(wi,{value:"mix",children:"Mix"})]})})]})]}),S.jsxs(S.Fragment,{children:[S.jsx(Ln,{className:"ml-1",text:"Response Format",tooltip:"Defines the response format. Examples:\\n• Multiple Paragraphs\\n• Single Paragraph\\n• Bullet Points",side:"left"}),S.jsxs(ME,{value:e.response_type,onValueChange:i=>t("response_type",i),children:[S.jsx(pv,{className:"hover:bg-primary/5 h-9 cursor-pointer focus:ring-0 focus:ring-offset-0 focus:outline-0 active:right-0",children:S.jsx(FE,{})}),S.jsx(mv,{children:S.jsxs(PE,{children:[S.jsx(wi,{value:"Multiple Paragraphs",children:"Multiple Paragraphs"}),S.jsx(wi,{value:"Single Paragraph",children:"Single Paragraph"}),S.jsx(wi,{value:"Bullet Points",children:"Bullet Points"})]})})]})]}),S.jsxs(S.Fragment,{children:[S.jsx(Ln,{className:"ml-1",text:"Top K Results",tooltip:"Number of top items to retrieve. Represents entities in 'local' mode and relationships in 'global' mode",side:"left"}),S.jsx(Jo,{id:"top_k",stepper:1,value:e.top_k,onValueChange:i=>t("top_k",i),min:1,placeholder:"Number of results"})]}),S.jsxs(S.Fragment,{children:[S.jsxs(S.Fragment,{children:[S.jsx(Ln,{className:"ml-1",text:"Max Tokens for Text Unit",tooltip:"Maximum number of tokens allowed for each retrieved text chunk",side:"left"}),S.jsx(Jo,{id:"max_token_for_text_unit",stepper:500,value:e.max_token_for_text_unit,onValueChange:i=>t("max_token_for_text_unit",i),min:1,placeholder:"Max tokens for text unit"})]}),S.jsxs(S.Fragment,{children:[S.jsx(Ln,{text:"Max Tokens for Global Context",tooltip:"Maximum number of tokens allocated for relationship descriptions in global retrieval",side:"left"}),S.jsx(Jo,{id:"max_token_for_global_context",stepper:500,value:e.max_token_for_global_context,onValueChange:i=>t("max_token_for_global_context",i),min:1,placeholder:"Max tokens for global context"})]}),S.jsxs(S.Fragment,{children:[S.jsx(Ln,{className:"ml-1",text:"Max Tokens for Local Context",tooltip:"Maximum number of tokens allocated for entity descriptions in local retrieval",side:"left"}),S.jsx(Jo,{id:"max_token_for_local_context",stepper:500,value:e.max_token_for_local_context,onValueChange:i=>t("max_token_for_local_context",i),min:1,placeholder:"Max tokens for local context"})]})]}),S.jsxs(S.Fragment,{children:[S.jsx(Ln,{className:"ml-1",text:"History Turns",tooltip:"Number of complete conversation turns (user-assistant pairs) to consider in the response context",side:"left"}),S.jsx(Jo,{className:"!border-input",id:"history_turns",stepper:1,type:"text",value:e.history_turns,onValueChange:i=>t("history_turns",i),min:0,placeholder:"Number of history turns"})]}),S.jsxs(S.Fragment,{children:[S.jsxs(S.Fragment,{children:[S.jsx(Ln,{className:"ml-1",text:"High-Level Keywords",tooltip:"List of high-level keywords to prioritize in retrieval. Separate with commas",side:"left"}),S.jsx(Za,{id:"hl_keywords",type:"text",value:(n=e.hl_keywords)==null?void 0:n.join(", "),onChange:i=>{const o=i.target.value.split(",").map(s=>s.trim()).filter(s=>s!=="");t("hl_keywords",o)},placeholder:"Enter keywords"})]}),S.jsxs(S.Fragment,{children:[S.jsx(Ln,{className:"ml-1",text:"Low-Level Keywords",tooltip:"List of low-level keywords to refine retrieval focus. Separate with commas",side:"left"}),S.jsx(Za,{id:"ll_keywords",type:"text",value:(r=e.ll_keywords)==null?void 0:r.join(", "),onChange:i=>{const o=i.target.value.split(",").map(s=>s.trim()).filter(s=>s!=="");t("ll_keywords",o)},placeholder:"Enter keywords"})]})]}),S.jsxs(S.Fragment,{children:[S.jsxs("div",{className:"flex items-center gap-2",children:[S.jsx(Ln,{className:"ml-1",text:"Only Need Context",tooltip:"If True, only returns the retrieved context without generating a response",side:"left"}),S.jsx("div",{className:"grow"}),S.jsx(Bs,{className:"mr-1 cursor-pointer",id:"only_need_context",checked:e.only_need_context,onCheckedChange:i=>t("only_need_context",i)})]}),S.jsxs("div",{className:"flex items-center gap-2",children:[S.jsx(Ln,{className:"ml-1",text:"Only Need Prompt",tooltip:"If True, only returns the generated prompt without producing a response",side:"left"}),S.jsx("div",{className:"grow"}),S.jsx(Bs,{className:"mr-1 cursor-pointer",id:"only_need_prompt",checked:e.only_need_prompt,onCheckedChange:i=>t("only_need_prompt",i)})]}),S.jsxs("div",{className:"flex items-center gap-2",children:[S.jsx(Ln,{className:"ml-1",text:"Stream Response",tooltip:"If True, enables streaming output for real-time responses",side:"left"}),S.jsx("div",{className:"grow"}),S.jsx(Bs,{className:"mr-1 cursor-pointer",id:"stream",checked:e.stream,onCheckedChange:i=>t("stream",i)})]})]})]})})})]})}function u8(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const c8=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,f8=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,d8={};function IE(e,t){return(d8.jsx?f8:c8).test(e)}const h8=/[ \t\n\f\r]/g;function p8(e){return typeof e=="object"?e.type==="text"?GE(e.value):!1:GE(e)}function GE(e){return e.replace(h8,"")===""}class vu{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}vu.prototype.normal={};vu.prototype.property={};vu.prototype.space=void 0;function B2(e,t){const n={},r={};for(const i of e)Object.assign(n,i.property),Object.assign(r,i.normal);return new vu(n,r,t)}function gv(e){return e.toLowerCase()}class Gn{constructor(t,n){this.attribute=n,this.property=t}}Gn.prototype.attribute="";Gn.prototype.booleanish=!1;Gn.prototype.boolean=!1;Gn.prototype.commaOrSpaceSeparated=!1;Gn.prototype.commaSeparated=!1;Gn.prototype.defined=!1;Gn.prototype.mustUseProperty=!1;Gn.prototype.number=!1;Gn.prototype.overloadedBoolean=!1;Gn.prototype.property="";Gn.prototype.spaceSeparated=!1;Gn.prototype.space=void 0;let m8=0;const et=ro(),Vt=ro(),U2=ro(),Re=ro(),Nt=ro(),ol=ro(),qn=ro();function ro(){return 2**++m8}const vv=Object.freeze(Object.defineProperty({__proto__:null,boolean:et,booleanish:Vt,commaOrSpaceSeparated:qn,commaSeparated:ol,number:Re,overloadedBoolean:U2,spaceSeparated:Nt},Symbol.toStringTag,{value:"Module"})),tg=Object.keys(vv);class $y extends Gn{constructor(t,n,r,i){let o=-1;if(super(t,n),BE(this,"space",i),typeof r=="number")for(;++o4&&n.slice(0,4)==="data"&&x8.test(t)){if(t.charAt(4)==="-"){const o=t.slice(5).replace(UE,E8);r="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=t.slice(4);if(!UE.test(o)){let s=o.replace(b8,S8);s.charAt(0)!=="-"&&(s="-"+s),t="data"+s}}i=$y}return new i(r,t)}function S8(e){return"-"+e.toLowerCase()}function E8(e){return e.charAt(1).toUpperCase()}const _8=B2([H2,g8,q2,Y2,W2],"html"),Vy=B2([H2,v8,q2,Y2,W2],"svg");function k8(e){return e.join(" ").trim()}var Xo={},ng,HE;function C8(){if(HE)return ng;HE=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,i=/^:\s*/,o=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,s=/^[;\s]*/,u=/^\s+|\s+$/g,f=` -`,d="/",p="*",m="",v="comment",g="declaration";ng=function(x,k){if(typeof x!="string")throw new TypeError("First argument must be a string");if(!x)return[];k=k||{};var C=1,_=1;function T(I){var Y=I.match(t);Y&&(C+=Y.length);var Z=I.lastIndexOf(f);_=~Z?I.length-Z:_+I.length}function N(){var I={line:C,column:_};return function(Y){return Y.position=new D(I),B(),Y}}function D(I){this.start=I,this.end={line:C,column:_},this.source=k.source}D.prototype.content=x;function z(I){var Y=new Error(k.source+":"+C+":"+_+": "+I);if(Y.reason=I,Y.filename=k.source,Y.line=C,Y.column=_,Y.source=x,!k.silent)throw Y}function R(I){var Y=I.exec(x);if(Y){var Z=Y[0];return T(Z),x=x.slice(Z.length),Y}}function B(){R(n)}function P(I){var Y;for(I=I||[];Y=j();)Y!==!1&&I.push(Y);return I}function j(){var I=N();if(!(d!=x.charAt(0)||p!=x.charAt(1))){for(var Y=2;m!=x.charAt(Y)&&(p!=x.charAt(Y)||d!=x.charAt(Y+1));)++Y;if(Y+=2,m===x.charAt(Y-1))return z("End of comment missing");var Z=x.slice(2,Y-2);return _+=2,T(Z),x=x.slice(Y),_+=2,I({type:v,comment:Z})}}function V(){var I=N(),Y=R(r);if(Y){if(j(),!R(i))return z("property missing ':'");var Z=R(o),U=I({type:g,property:w(Y[0].replace(e,m)),value:Z?w(Z[0].replace(e,m)):m});return R(s),U}}function q(){var I=[];P(I);for(var Y;Y=V();)Y!==!1&&(I.push(Y),P(I));return I}return B(),q()};function w(x){return x?x.replace(u,m):m}return ng}var $E;function T8(){if($E)return Xo;$E=1;var e=Xo&&Xo.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Xo,"__esModule",{value:!0}),Xo.default=n;var t=e(C8());function n(r,i){var o=null;if(!r||typeof r!="string")return o;var s=(0,t.default)(r),u=typeof i=="function";return s.forEach(function(f){if(f.type==="declaration"){var d=f.property,p=f.value;u?i(d,p,f):p&&(o=o||{},o[d]=p)}}),o}return Xo}var A8=T8();const VE=fn(A8),R8=VE.default||VE,X2=K2("end"),qy=K2("start");function K2(e){return t;function t(n){const r=n&&n.position&&n.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function D8(e){const t=qy(e),n=X2(e);if(t&&n)return{start:t,end:n}}function Us(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?qE(e.position):"start"in e||"end"in e?qE(e):"line"in e||"column"in e?yv(e):""}function yv(e){return YE(e&&e.line)+":"+YE(e&&e.column)}function qE(e){return yv(e&&e.start)+"-"+yv(e&&e.end)}function YE(e){return e&&typeof e=="number"?e:1}class wn extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let i="",o={},s=!1;if(n&&("line"in n&&"column"in n?o={place:n}:"start"in n&&"end"in n?o={place:n}:"type"in n?o={ancestors:[n],place:n.position}:o={...n}),typeof t=="string"?i=t:!o.cause&&t&&(s=!0,i=t.message,o.cause=t),!o.ruleId&&!o.source&&typeof r=="string"){const f=r.indexOf(":");f===-1?o.ruleId=r:(o.source=r.slice(0,f),o.ruleId=r.slice(f+1))}if(!o.place&&o.ancestors&&o.ancestors){const f=o.ancestors[o.ancestors.length-1];f&&(o.place=f.position)}const u=o.place&&"start"in o.place?o.place.start:o.place;this.ancestors=o.ancestors||void 0,this.cause=o.cause||void 0,this.column=u?u.column:void 0,this.fatal=void 0,this.file,this.message=i,this.line=u?u.line:void 0,this.name=Us(o.place)||"1:1",this.place=o.place||void 0,this.reason=this.message,this.ruleId=o.ruleId||void 0,this.source=o.source||void 0,this.stack=s&&o.cause&&typeof o.cause.stack=="string"?o.cause.stack:"",this.actual,this.expected,this.note,this.url}}wn.prototype.file="";wn.prototype.name="";wn.prototype.reason="";wn.prototype.message="";wn.prototype.stack="";wn.prototype.column=void 0;wn.prototype.line=void 0;wn.prototype.ancestors=void 0;wn.prototype.cause=void 0;wn.prototype.fatal=void 0;wn.prototype.place=void 0;wn.prototype.ruleId=void 0;wn.prototype.source=void 0;const Yy={}.hasOwnProperty,N8=new Map,O8=/[A-Z]/g,L8=/-([a-z])/g,z8=new Set(["table","tbody","thead","tfoot","tr"]),j8=new Set(["td","th"]),Z2="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function Q2(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let r;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=H8(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=U8(n,t.jsx,t.jsxs)}const i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?Vy:_8,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},o=J2(i,e,void 0);return o&&typeof o!="string"?o:i.create(e,i.Fragment,{children:o||void 0},void 0)}function J2(e,t,n){if(t.type==="element")return M8(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return P8(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return I8(e,t,n);if(t.type==="mdxjsEsm")return F8(e,t);if(t.type==="root")return G8(e,t,n);if(t.type==="text")return B8(e,t)}function M8(e,t,n){const r=e.schema;let i=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=Vy,e.schema=i),e.ancestors.push(t);const o=tD(e,t.tagName,!1),s=$8(e,t);let u=Xy(e,t);return z8.has(t.tagName)&&(u=u.filter(function(f){return typeof f=="string"?!p8(f):!0})),eD(e,s,o,t),Wy(s,u),e.ancestors.pop(),e.schema=r,e.create(t,o,s,n)}function P8(e,t){if(t.data&&t.data.estree&&e.evaluater){const r=t.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}tu(e,t.position)}function F8(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);tu(e,t.position)}function I8(e,t,n){const r=e.schema;let i=r;t.name==="svg"&&r.space==="html"&&(i=Vy,e.schema=i),e.ancestors.push(t);const o=t.name===null?e.Fragment:tD(e,t.name,!0),s=V8(e,t),u=Xy(e,t);return eD(e,s,o,t),Wy(s,u),e.ancestors.pop(),e.schema=r,e.create(t,o,s,n)}function G8(e,t,n){const r={};return Wy(r,Xy(e,t)),e.create(t,e.Fragment,r,n)}function B8(e,t){return t.value}function eD(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function Wy(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function U8(e,t,n){return r;function r(i,o,s,u){const d=Array.isArray(s.children)?n:t;return u?d(o,s,u):d(o,s)}}function H8(e,t){return n;function n(r,i,o,s){const u=Array.isArray(o.children),f=qy(r);return t(i,o,s,u,{columnNumber:f?f.column-1:void 0,fileName:e,lineNumber:f?f.line:void 0},void 0)}}function $8(e,t){const n={};let r,i;for(i in t.properties)if(i!=="children"&&Yy.call(t.properties,i)){const o=q8(e,i,t.properties[i]);if(o){const[s,u]=o;e.tableCellAlignToStyle&&s==="align"&&typeof u=="string"&&j8.has(t.tagName)?r=u:n[s]=u}}if(r){const o=n.style||(n.style={});o[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function V8(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const o=r.data.estree.body[0];o.type;const s=o.expression;s.type;const u=s.properties[0];u.type,Object.assign(n,e.evaluater.evaluateExpression(u.argument))}else tu(e,t.position);else{const i=r.name;let o;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const u=r.value.data.estree.body[0];u.type,o=e.evaluater.evaluateExpression(u.expression)}else tu(e,t.position);else o=r.value===null?!0:r.value;n[i]=o}return n}function Xy(e,t){const n=[];let r=-1;const i=e.passKeys?new Map:N8;for(;++ri?0:i+t:t=t>i?i:t,n=n>0?n:0,r.length<1e4)s=Array.from(r),s.unshift(t,n),e.splice(...s);else for(n&&e.splice(t,n);o0?(Kn(e,e.length,0,t),e):t}const KE={}.hasOwnProperty;function rD(e){const t={};let n=-1;for(;++n13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function Tr(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const kn=ga(/[A-Za-z]/),yn=ga(/[\dA-Za-z]/),n7=ga(/[#-'*+\--9=?A-Z^-~]/);function Gf(e){return e!==null&&(e<32||e===127)}const bv=ga(/\d/),r7=ga(/[\dA-Fa-f]/),i7=ga(/[!-/:-@[-`{-~]/);function Ue(e){return e!==null&&e<-2}function Tt(e){return e!==null&&(e<0||e===32)}function ut(e){return e===-2||e===-1||e===32}const Ad=ga(new RegExp("\\p{P}|\\p{S}","u")),to=ga(/\s/);function ga(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function Dl(e){const t=[];let n=-1,r=0,i=0;for(;++n55295&&o<57344){const u=e.charCodeAt(n+1);o<56320&&u>56319&&u<57344?(s=String.fromCharCode(o,u),i=1):s="�"}else s=String.fromCharCode(o);s&&(t.push(e.slice(r,n),encodeURIComponent(s)),r=n+i+1,s=""),i&&(n+=i,i=0)}return t.join("")+e.slice(r)}function lt(e,t,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let o=0;return s;function s(f){return ut(f)?(e.enter(n),u(f)):t(f)}function u(f){return ut(f)&&o++s))return;const R=t.events.length;let B=R,P,j;for(;B--;)if(t.events[B][0]==="exit"&&t.events[B][1].type==="chunkFlow"){if(P){j=t.events[B][1].end;break}P=!0}for(C(r),z=R;zT;){const D=n[N];t.containerState=D[1],D[0].exit.call(t,e)}n.length=T}function _(){i.write([null]),o=void 0,i=void 0,t.containerState._closeFlow=void 0}}function u7(e,t,n){return lt(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function pl(e){if(e===null||Tt(e)||to(e))return 1;if(Ad(e))return 2}function Rd(e,t,n){const r=[];let i=-1;for(;++i1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const m={...e[r][1].end},v={...e[n][1].start};QE(m,-f),QE(v,f),s={type:f>1?"strongSequence":"emphasisSequence",start:m,end:{...e[r][1].end}},u={type:f>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:v},o={type:f>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},i={type:f>1?"strong":"emphasis",start:{...s.start},end:{...u.end}},e[r][1].end={...s.start},e[n][1].start={...u.end},d=[],e[r][1].end.offset-e[r][1].start.offset&&(d=fr(d,[["enter",e[r][1],t],["exit",e[r][1],t]])),d=fr(d,[["enter",i,t],["enter",s,t],["exit",s,t],["enter",o,t]]),d=fr(d,Rd(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),d=fr(d,[["exit",o,t],["enter",u,t],["exit",u,t],["exit",i,t]]),e[n][1].end.offset-e[n][1].start.offset?(p=2,d=fr(d,[["enter",e[n][1],t],["exit",e[n][1],t]])):p=0,Kn(e,r-1,n-r+3,d),n=r+d.length-p-2;break}}for(n=-1;++n0&&ut(z)?lt(e,_,"linePrefix",o+1)(z):_(z)}function _(z){return z===null||Ue(z)?e.check(JE,x,N)(z):(e.enter("codeFlowValue"),T(z))}function T(z){return z===null||Ue(z)?(e.exit("codeFlowValue"),_(z)):(e.consume(z),T)}function N(z){return e.exit("codeFenced"),t(z)}function D(z,R,B){let P=0;return j;function j(Z){return z.enter("lineEnding"),z.consume(Z),z.exit("lineEnding"),V}function V(Z){return z.enter("codeFencedFence"),ut(Z)?lt(z,q,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(Z):q(Z)}function q(Z){return Z===u?(z.enter("codeFencedFenceSequence"),I(Z)):B(Z)}function I(Z){return Z===u?(P++,z.consume(Z),I):P>=s?(z.exit("codeFencedFenceSequence"),ut(Z)?lt(z,Y,"whitespace")(Z):Y(Z)):B(Z)}function Y(Z){return Z===null||Ue(Z)?(z.exit("codeFencedFence"),R(Z)):B(Z)}}}function w7(e,t,n){const r=this;return i;function i(s){return s===null?n(s):(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),o)}function o(s){return r.parser.lazy[r.now().line]?n(s):t(s)}}const ig={name:"codeIndented",tokenize:E7},S7={partial:!0,tokenize:_7};function E7(e,t,n){const r=this;return i;function i(d){return e.enter("codeIndented"),lt(e,o,"linePrefix",5)(d)}function o(d){const p=r.events[r.events.length-1];return p&&p[1].type==="linePrefix"&&p[2].sliceSerialize(p[1],!0).length>=4?s(d):n(d)}function s(d){return d===null?f(d):Ue(d)?e.attempt(S7,s,f)(d):(e.enter("codeFlowValue"),u(d))}function u(d){return d===null||Ue(d)?(e.exit("codeFlowValue"),s(d)):(e.consume(d),u)}function f(d){return e.exit("codeIndented"),t(d)}}function _7(e,t,n){const r=this;return i;function i(s){return r.parser.lazy[r.now().line]?n(s):Ue(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),i):lt(e,o,"linePrefix",5)(s)}function o(s){const u=r.events[r.events.length-1];return u&&u[1].type==="linePrefix"&&u[2].sliceSerialize(u[1],!0).length>=4?t(s):Ue(s)?i(s):n(s)}}const k7={name:"codeText",previous:T7,resolve:C7,tokenize:A7};function C7(e){let t=e.length-4,n=3,r,i;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return tthis.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(t,n,r){const i=n||0;this.setCursor(Math.trunc(t));const o=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&js(this.left,r),o.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),js(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),js(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t=4?t(s):e.interrupt(r.parser.constructs.flow,n,t)(s)}}function uD(e,t,n,r,i,o,s,u,f){const d=f||Number.POSITIVE_INFINITY;let p=0;return m;function m(C){return C===60?(e.enter(r),e.enter(i),e.enter(o),e.consume(C),e.exit(o),v):C===null||C===32||C===41||Gf(C)?n(C):(e.enter(r),e.enter(s),e.enter(u),e.enter("chunkString",{contentType:"string"}),x(C))}function v(C){return C===62?(e.enter(o),e.consume(C),e.exit(o),e.exit(i),e.exit(r),t):(e.enter(u),e.enter("chunkString",{contentType:"string"}),g(C))}function g(C){return C===62?(e.exit("chunkString"),e.exit(u),v(C)):C===null||C===60||Ue(C)?n(C):(e.consume(C),C===92?w:g)}function w(C){return C===60||C===62||C===92?(e.consume(C),g):g(C)}function x(C){return!p&&(C===null||C===41||Tt(C))?(e.exit("chunkString"),e.exit(u),e.exit(s),e.exit(r),t(C)):p999||g===null||g===91||g===93&&!f||g===94&&!u&&"_hiddenFootnoteSupport"in s.parser.constructs?n(g):g===93?(e.exit(o),e.enter(i),e.consume(g),e.exit(i),e.exit(r),t):Ue(g)?(e.enter("lineEnding"),e.consume(g),e.exit("lineEnding"),p):(e.enter("chunkString",{contentType:"string"}),m(g))}function m(g){return g===null||g===91||g===93||Ue(g)||u++>999?(e.exit("chunkString"),p(g)):(e.consume(g),f||(f=!ut(g)),g===92?v:m)}function v(g){return g===91||g===92||g===93?(e.consume(g),u++,m):m(g)}}function fD(e,t,n,r,i,o){let s;return u;function u(v){return v===34||v===39||v===40?(e.enter(r),e.enter(i),e.consume(v),e.exit(i),s=v===40?41:v,f):n(v)}function f(v){return v===s?(e.enter(i),e.consume(v),e.exit(i),e.exit(r),t):(e.enter(o),d(v))}function d(v){return v===s?(e.exit(o),f(s)):v===null?n(v):Ue(v)?(e.enter("lineEnding"),e.consume(v),e.exit("lineEnding"),lt(e,d,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),p(v))}function p(v){return v===s||v===null||Ue(v)?(e.exit("chunkString"),d(v)):(e.consume(v),v===92?m:p)}function m(v){return v===s||v===92?(e.consume(v),p):p(v)}}function Hs(e,t){let n;return r;function r(i){return Ue(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):ut(i)?lt(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}const M7={name:"definition",tokenize:F7},P7={partial:!0,tokenize:I7};function F7(e,t,n){const r=this;let i;return o;function o(g){return e.enter("definition"),s(g)}function s(g){return cD.call(r,e,u,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(g)}function u(g){return i=Tr(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),g===58?(e.enter("definitionMarker"),e.consume(g),e.exit("definitionMarker"),f):n(g)}function f(g){return Tt(g)?Hs(e,d)(g):d(g)}function d(g){return uD(e,p,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(g)}function p(g){return e.attempt(P7,m,m)(g)}function m(g){return ut(g)?lt(e,v,"whitespace")(g):v(g)}function v(g){return g===null||Ue(g)?(e.exit("definition"),r.parser.defined.push(i),t(g)):n(g)}}function I7(e,t,n){return r;function r(u){return Tt(u)?Hs(e,i)(u):n(u)}function i(u){return fD(e,o,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(u)}function o(u){return ut(u)?lt(e,s,"whitespace")(u):s(u)}function s(u){return u===null||Ue(u)?t(u):n(u)}}const G7={name:"hardBreakEscape",tokenize:B7};function B7(e,t,n){return r;function r(o){return e.enter("hardBreakEscape"),e.consume(o),i}function i(o){return Ue(o)?(e.exit("hardBreakEscape"),t(o)):n(o)}}const U7={name:"headingAtx",resolve:H7,tokenize:$7};function H7(e,t){let n=e.length-2,r=3,i,o;return e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(i={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},o={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},Kn(e,r,n-r+1,[["enter",i,t],["enter",o,t],["exit",o,t],["exit",i,t]])),e}function $7(e,t,n){let r=0;return i;function i(p){return e.enter("atxHeading"),o(p)}function o(p){return e.enter("atxHeadingSequence"),s(p)}function s(p){return p===35&&r++<6?(e.consume(p),s):p===null||Tt(p)?(e.exit("atxHeadingSequence"),u(p)):n(p)}function u(p){return p===35?(e.enter("atxHeadingSequence"),f(p)):p===null||Ue(p)?(e.exit("atxHeading"),t(p)):ut(p)?lt(e,u,"whitespace")(p):(e.enter("atxHeadingText"),d(p))}function f(p){return p===35?(e.consume(p),f):(e.exit("atxHeadingSequence"),u(p))}function d(p){return p===null||p===35||Tt(p)?(e.exit("atxHeadingText"),u(p)):(e.consume(p),d)}}const V7=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],t_=["pre","script","style","textarea"],q7={concrete:!0,name:"htmlFlow",resolveTo:X7,tokenize:K7},Y7={partial:!0,tokenize:Q7},W7={partial:!0,tokenize:Z7};function X7(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function K7(e,t,n){const r=this;let i,o,s,u,f;return d;function d(O){return p(O)}function p(O){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(O),m}function m(O){return O===33?(e.consume(O),v):O===47?(e.consume(O),o=!0,x):O===63?(e.consume(O),i=3,r.interrupt?t:A):kn(O)?(e.consume(O),s=String.fromCharCode(O),k):n(O)}function v(O){return O===45?(e.consume(O),i=2,g):O===91?(e.consume(O),i=5,u=0,w):kn(O)?(e.consume(O),i=4,r.interrupt?t:A):n(O)}function g(O){return O===45?(e.consume(O),r.interrupt?t:A):n(O)}function w(O){const X="CDATA[";return O===X.charCodeAt(u++)?(e.consume(O),u===X.length?r.interrupt?t:q:w):n(O)}function x(O){return kn(O)?(e.consume(O),s=String.fromCharCode(O),k):n(O)}function k(O){if(O===null||O===47||O===62||Tt(O)){const X=O===47,re=s.toLowerCase();return!X&&!o&&t_.includes(re)?(i=1,r.interrupt?t(O):q(O)):V7.includes(s.toLowerCase())?(i=6,X?(e.consume(O),C):r.interrupt?t(O):q(O)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(O):o?_(O):T(O))}return O===45||yn(O)?(e.consume(O),s+=String.fromCharCode(O),k):n(O)}function C(O){return O===62?(e.consume(O),r.interrupt?t:q):n(O)}function _(O){return ut(O)?(e.consume(O),_):j(O)}function T(O){return O===47?(e.consume(O),j):O===58||O===95||kn(O)?(e.consume(O),N):ut(O)?(e.consume(O),T):j(O)}function N(O){return O===45||O===46||O===58||O===95||yn(O)?(e.consume(O),N):D(O)}function D(O){return O===61?(e.consume(O),z):ut(O)?(e.consume(O),D):T(O)}function z(O){return O===null||O===60||O===61||O===62||O===96?n(O):O===34||O===39?(e.consume(O),f=O,R):ut(O)?(e.consume(O),z):B(O)}function R(O){return O===f?(e.consume(O),f=null,P):O===null||Ue(O)?n(O):(e.consume(O),R)}function B(O){return O===null||O===34||O===39||O===47||O===60||O===61||O===62||O===96||Tt(O)?D(O):(e.consume(O),B)}function P(O){return O===47||O===62||ut(O)?T(O):n(O)}function j(O){return O===62?(e.consume(O),V):n(O)}function V(O){return O===null||Ue(O)?q(O):ut(O)?(e.consume(O),V):n(O)}function q(O){return O===45&&i===2?(e.consume(O),U):O===60&&i===1?(e.consume(O),G):O===62&&i===4?(e.consume(O),$):O===63&&i===3?(e.consume(O),A):O===93&&i===5?(e.consume(O),K):Ue(O)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(Y7,M,I)(O)):O===null||Ue(O)?(e.exit("htmlFlowData"),I(O)):(e.consume(O),q)}function I(O){return e.check(W7,Y,M)(O)}function Y(O){return e.enter("lineEnding"),e.consume(O),e.exit("lineEnding"),Z}function Z(O){return O===null||Ue(O)?I(O):(e.enter("htmlFlowData"),q(O))}function U(O){return O===45?(e.consume(O),A):q(O)}function G(O){return O===47?(e.consume(O),s="",F):q(O)}function F(O){if(O===62){const X=s.toLowerCase();return t_.includes(X)?(e.consume(O),$):q(O)}return kn(O)&&s.length<8?(e.consume(O),s+=String.fromCharCode(O),F):q(O)}function K(O){return O===93?(e.consume(O),A):q(O)}function A(O){return O===62?(e.consume(O),$):O===45&&i===2?(e.consume(O),A):q(O)}function $(O){return O===null||Ue(O)?(e.exit("htmlFlowData"),M(O)):(e.consume(O),$)}function M(O){return e.exit("htmlFlow"),t(O)}}function Z7(e,t,n){const r=this;return i;function i(s){return Ue(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),o):n(s)}function o(s){return r.parser.lazy[r.now().line]?n(s):t(s)}}function Q7(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(yu,t,n)}}const J7={name:"htmlText",tokenize:eV};function eV(e,t,n){const r=this;let i,o,s;return u;function u(A){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(A),f}function f(A){return A===33?(e.consume(A),d):A===47?(e.consume(A),D):A===63?(e.consume(A),T):kn(A)?(e.consume(A),B):n(A)}function d(A){return A===45?(e.consume(A),p):A===91?(e.consume(A),o=0,w):kn(A)?(e.consume(A),_):n(A)}function p(A){return A===45?(e.consume(A),g):n(A)}function m(A){return A===null?n(A):A===45?(e.consume(A),v):Ue(A)?(s=m,G(A)):(e.consume(A),m)}function v(A){return A===45?(e.consume(A),g):m(A)}function g(A){return A===62?U(A):A===45?v(A):m(A)}function w(A){const $="CDATA[";return A===$.charCodeAt(o++)?(e.consume(A),o===$.length?x:w):n(A)}function x(A){return A===null?n(A):A===93?(e.consume(A),k):Ue(A)?(s=x,G(A)):(e.consume(A),x)}function k(A){return A===93?(e.consume(A),C):x(A)}function C(A){return A===62?U(A):A===93?(e.consume(A),C):x(A)}function _(A){return A===null||A===62?U(A):Ue(A)?(s=_,G(A)):(e.consume(A),_)}function T(A){return A===null?n(A):A===63?(e.consume(A),N):Ue(A)?(s=T,G(A)):(e.consume(A),T)}function N(A){return A===62?U(A):T(A)}function D(A){return kn(A)?(e.consume(A),z):n(A)}function z(A){return A===45||yn(A)?(e.consume(A),z):R(A)}function R(A){return Ue(A)?(s=R,G(A)):ut(A)?(e.consume(A),R):U(A)}function B(A){return A===45||yn(A)?(e.consume(A),B):A===47||A===62||Tt(A)?P(A):n(A)}function P(A){return A===47?(e.consume(A),U):A===58||A===95||kn(A)?(e.consume(A),j):Ue(A)?(s=P,G(A)):ut(A)?(e.consume(A),P):U(A)}function j(A){return A===45||A===46||A===58||A===95||yn(A)?(e.consume(A),j):V(A)}function V(A){return A===61?(e.consume(A),q):Ue(A)?(s=V,G(A)):ut(A)?(e.consume(A),V):P(A)}function q(A){return A===null||A===60||A===61||A===62||A===96?n(A):A===34||A===39?(e.consume(A),i=A,I):Ue(A)?(s=q,G(A)):ut(A)?(e.consume(A),q):(e.consume(A),Y)}function I(A){return A===i?(e.consume(A),i=void 0,Z):A===null?n(A):Ue(A)?(s=I,G(A)):(e.consume(A),I)}function Y(A){return A===null||A===34||A===39||A===60||A===61||A===96?n(A):A===47||A===62||Tt(A)?P(A):(e.consume(A),Y)}function Z(A){return A===47||A===62||Tt(A)?P(A):n(A)}function U(A){return A===62?(e.consume(A),e.exit("htmlTextData"),e.exit("htmlText"),t):n(A)}function G(A){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(A),e.exit("lineEnding"),F}function F(A){return ut(A)?lt(e,K,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(A):K(A)}function K(A){return e.enter("htmlTextData"),s(A)}}const Qy={name:"labelEnd",resolveAll:iV,resolveTo:aV,tokenize:oV},tV={tokenize:lV},nV={tokenize:sV},rV={tokenize:uV};function iV(e){let t=-1;const n=[];for(;++t=3&&(d===null||Ue(d))?(e.exit("thematicBreak"),t(d)):n(d)}function f(d){return d===i?(e.consume(d),r++,f):(e.exit("thematicBreakSequence"),ut(d)?lt(e,u,"whitespace")(d):u(d))}}const On={continuation:{tokenize:bV},exit:wV,name:"list",tokenize:yV},gV={partial:!0,tokenize:SV},vV={partial:!0,tokenize:xV};function yV(e,t,n){const r=this,i=r.events[r.events.length-1];let o=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,s=0;return u;function u(g){const w=r.containerState.type||(g===42||g===43||g===45?"listUnordered":"listOrdered");if(w==="listUnordered"?!r.containerState.marker||g===r.containerState.marker:bv(g)){if(r.containerState.type||(r.containerState.type=w,e.enter(w,{_container:!0})),w==="listUnordered")return e.enter("listItemPrefix"),g===42||g===45?e.check(vf,n,d)(g):d(g);if(!r.interrupt||g===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),f(g)}return n(g)}function f(g){return bv(g)&&++s<10?(e.consume(g),f):(!r.interrupt||s<2)&&(r.containerState.marker?g===r.containerState.marker:g===41||g===46)?(e.exit("listItemValue"),d(g)):n(g)}function d(g){return e.enter("listItemMarker"),e.consume(g),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||g,e.check(yu,r.interrupt?n:p,e.attempt(gV,v,m))}function p(g){return r.containerState.initialBlankLine=!0,o++,v(g)}function m(g){return ut(g)?(e.enter("listItemPrefixWhitespace"),e.consume(g),e.exit("listItemPrefixWhitespace"),v):n(g)}function v(g){return r.containerState.size=o+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(g)}}function bV(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(yu,i,o);function i(u){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,lt(e,t,"listItemIndent",r.containerState.size+1)(u)}function o(u){return r.containerState.furtherBlankLines||!ut(u)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,s(u)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(vV,t,s)(u))}function s(u){return r.containerState._closeFlow=!0,r.interrupt=void 0,lt(e,e.attempt(On,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(u)}}function xV(e,t,n){const r=this;return lt(e,i,"listItemIndent",r.containerState.size+1);function i(o){const s=r.events[r.events.length-1];return s&&s[1].type==="listItemIndent"&&s[2].sliceSerialize(s[1],!0).length===r.containerState.size?t(o):n(o)}}function wV(e){e.exit(this.containerState.type)}function SV(e,t,n){const r=this;return lt(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(o){const s=r.events[r.events.length-1];return!ut(o)&&s&&s[1].type==="listItemPrefixWhitespace"?t(o):n(o)}}const n_={name:"setextUnderline",resolveTo:EV,tokenize:_V};function EV(e,t){let n=e.length,r,i,o;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(i=n)}else e[n][1].type==="content"&&e.splice(n,1),!o&&e[n][1].type==="definition"&&(o=n);const s={type:"setextHeading",start:{...e[i][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type="setextHeadingText",o?(e.splice(i,0,["enter",s,t]),e.splice(o+1,0,["exit",e[r][1],t]),e[r][1].end={...e[o][1].end}):e[r][1]=s,e.push(["exit",s,t]),e}function _V(e,t,n){const r=this;let i;return o;function o(d){let p=r.events.length,m;for(;p--;)if(r.events[p][1].type!=="lineEnding"&&r.events[p][1].type!=="linePrefix"&&r.events[p][1].type!=="content"){m=r.events[p][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||m)?(e.enter("setextHeadingLine"),i=d,s(d)):n(d)}function s(d){return e.enter("setextHeadingLineSequence"),u(d)}function u(d){return d===i?(e.consume(d),u):(e.exit("setextHeadingLineSequence"),ut(d)?lt(e,f,"lineSuffix")(d):f(d))}function f(d){return d===null||Ue(d)?(e.exit("setextHeadingLine"),t(d)):n(d)}}const kV={tokenize:CV};function CV(e){const t=this,n=e.attempt(yu,r,e.attempt(this.parser.constructs.flowInitial,i,lt(e,e.attempt(this.parser.constructs.flow,i,e.attempt(N7,i)),"linePrefix")));return n;function r(o){if(o===null){e.consume(o);return}return e.enter("lineEndingBlank"),e.consume(o),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function i(o){if(o===null){e.consume(o);return}return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const TV={resolveAll:hD()},AV=dD("string"),RV=dD("text");function dD(e){return{resolveAll:hD(e==="text"?DV:void 0),tokenize:t};function t(n){const r=this,i=this.parser.constructs[e],o=n.attempt(i,s,u);return s;function s(p){return d(p)?o(p):u(p)}function u(p){if(p===null){n.consume(p);return}return n.enter("data"),n.consume(p),f}function f(p){return d(p)?(n.exit("data"),o(p)):(n.consume(p),f)}function d(p){if(p===null)return!0;const m=i[p];let v=-1;if(m)for(;++v-1){const u=s[0];typeof u=="string"?s[0]=u.slice(r):s.shift()}o>0&&s.push(e[i].slice(0,o))}return s}function HV(e,t){let n=-1;const r=[];let i;for(;++n0){const vt=Oe.tokenStack[Oe.tokenStack.length-1];(vt[1]||i_).call(Oe,void 0,vt[0])}for(de.position={start:ra(te.length>0?te[0][1].start:{line:1,column:1,offset:0}),end:ra(te.length>0?te[te.length-2][1].end:{line:1,column:1,offset:0})},Ye=-1;++Ye1?"-"+u:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(s)}]};e.patch(t,f);const d={type:"element",tagName:"sup",properties:{},children:[f]};return e.patch(t,d),e.applyData(t,d)}function oq(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function lq(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function gD(e,t){const n=t.referenceType;let r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+r}];const i=e.all(t),o=i[0];o&&o.type==="text"?o.value="["+o.value:i.unshift({type:"text",value:"["});const s=i[i.length-1];return s&&s.type==="text"?s.value+=r:i.push({type:"text",value:r}),i}function sq(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return gD(e,t);const i={src:Dl(r.url||""),alt:t.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);const o={type:"element",tagName:"img",properties:i,children:[]};return e.patch(t,o),e.applyData(t,o)}function uq(e,t){const n={src:Dl(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function cq(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function fq(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return gD(e,t);const i={href:Dl(r.url||"")};r.title!==null&&r.title!==void 0&&(i.title=r.title);const o={type:"element",tagName:"a",properties:i,children:e.all(t)};return e.patch(t,o),e.applyData(t,o)}function dq(e,t){const n={href:Dl(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function hq(e,t,n){const r=e.all(t),i=n?pq(n):vD(t),o={},s=[];if(typeof t.checked=="boolean"){const p=r[0];let m;p&&p.type==="element"&&p.tagName==="p"?m=p:(m={type:"element",tagName:"p",properties:{},children:[]},r.unshift(m)),m.children.length>0&&m.children.unshift({type:"text",value:" "}),m.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),o.className=["task-list-item"]}let u=-1;for(;++u1}function mq(e,t){const n={},r=e.all(t);let i=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++i0){const s={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},u=qy(t.children[1]),f=X2(t.children[t.children.length-1]);u&&f&&(s.position={start:u,end:f}),i.push(s)}const o={type:"element",tagName:"table",properties:{},children:e.wrap(i,!0)};return e.patch(t,o),e.applyData(t,o)}function xq(e,t,n){const r=n?n.children:void 0,o=(r?r.indexOf(t):1)===0?"th":"td",s=n&&n.type==="table"?n.align:void 0,u=s?s.length:t.children.length;let f=-1;const d=[];for(;++f0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return o.push(l_(t.slice(i),i>0,!1)),o.join("")}function l_(e,t,n){let r=0,i=e.length;if(t){let o=e.codePointAt(r);for(;o===a_||o===o_;)r++,o=e.codePointAt(r)}if(n){let o=e.codePointAt(i-1);for(;o===a_||o===o_;)i--,o=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}function Eq(e,t){const n={type:"text",value:Sq(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function _q(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const kq={blockquote:eq,break:tq,code:nq,delete:rq,emphasis:iq,footnoteReference:aq,heading:oq,html:lq,imageReference:sq,image:uq,inlineCode:cq,linkReference:fq,link:dq,listItem:hq,list:mq,paragraph:gq,root:vq,strong:yq,table:bq,tableCell:wq,tableRow:xq,text:Eq,thematicBreak:_q,toml:Zc,yaml:Zc,definition:Zc,footnoteDefinition:Zc};function Zc(){}const yD=-1,Dd=0,$s=1,Bf=2,Jy=3,eb=4,tb=5,nb=6,bD=7,xD=8,s_=typeof self=="object"?self:globalThis,Cq=(e,t)=>{const n=(i,o)=>(e.set(o,i),i),r=i=>{if(e.has(i))return e.get(i);const[o,s]=t[i];switch(o){case Dd:case yD:return n(s,i);case $s:{const u=n([],i);for(const f of s)u.push(r(f));return u}case Bf:{const u=n({},i);for(const[f,d]of s)u[r(f)]=r(d);return u}case Jy:return n(new Date(s),i);case eb:{const{source:u,flags:f}=s;return n(new RegExp(u,f),i)}case tb:{const u=n(new Map,i);for(const[f,d]of s)u.set(r(f),r(d));return u}case nb:{const u=n(new Set,i);for(const f of s)u.add(r(f));return u}case bD:{const{name:u,message:f}=s;return n(new s_[u](f),i)}case xD:return n(BigInt(s),i);case"BigInt":return n(Object(BigInt(s)),i);case"ArrayBuffer":return n(new Uint8Array(s).buffer,s);case"DataView":{const{buffer:u}=new Uint8Array(s);return n(new DataView(u),s)}}return n(new s_[o](s),i)};return r},u_=e=>Cq(new Map,e)(0),Ko="",{toString:Tq}={},{keys:Aq}=Object,Ms=e=>{const t=typeof e;if(t!=="object"||!e)return[Dd,t];const n=Tq.call(e).slice(8,-1);switch(n){case"Array":return[$s,Ko];case"Object":return[Bf,Ko];case"Date":return[Jy,Ko];case"RegExp":return[eb,Ko];case"Map":return[tb,Ko];case"Set":return[nb,Ko];case"DataView":return[$s,n]}return n.includes("Array")?[$s,n]:n.includes("Error")?[bD,n]:[Bf,n]},Qc=([e,t])=>e===Dd&&(t==="function"||t==="symbol"),Rq=(e,t,n,r)=>{const i=(s,u)=>{const f=r.push(s)-1;return n.set(u,f),f},o=s=>{if(n.has(s))return n.get(s);let[u,f]=Ms(s);switch(u){case Dd:{let p=s;switch(f){case"bigint":u=xD,p=s.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+f);p=null;break;case"undefined":return i([yD],s)}return i([u,p],s)}case $s:{if(f){let v=s;return f==="DataView"?v=new Uint8Array(s.buffer):f==="ArrayBuffer"&&(v=new Uint8Array(s)),i([f,[...v]],s)}const p=[],m=i([u,p],s);for(const v of s)p.push(o(v));return m}case Bf:{if(f)switch(f){case"BigInt":return i([f,s.toString()],s);case"Boolean":case"Number":case"String":return i([f,s.valueOf()],s)}if(t&&"toJSON"in s)return o(s.toJSON());const p=[],m=i([u,p],s);for(const v of Aq(s))(e||!Qc(Ms(s[v])))&&p.push([o(v),o(s[v])]);return m}case Jy:return i([u,s.toISOString()],s);case eb:{const{source:p,flags:m}=s;return i([u,{source:p,flags:m}],s)}case tb:{const p=[],m=i([u,p],s);for(const[v,g]of s)(e||!(Qc(Ms(v))||Qc(Ms(g))))&&p.push([o(v),o(g)]);return m}case nb:{const p=[],m=i([u,p],s);for(const v of s)(e||!Qc(Ms(v)))&&p.push(o(v));return m}}const{message:d}=s;return i([u,{name:f,message:d}],s)};return o},c_=(e,{json:t,lossy:n}={})=>{const r=[];return Rq(!(t||n),!!t,new Map,r)(e),r},Uf=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?u_(c_(e,t)):structuredClone(e):(e,t)=>u_(c_(e,t));function Dq(e,t){const n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function Nq(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function Oq(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||Dq,r=e.options.footnoteBackLabel||Nq,i=e.options.footnoteLabel||"Footnotes",o=e.options.footnoteLabelTagName||"h2",s=e.options.footnoteLabelProperties||{className:["sr-only"]},u=[];let f=-1;for(;++f0&&w.push({type:"text",value:" "});let _=typeof n=="string"?n:n(f,g);typeof _=="string"&&(_={type:"text",value:_}),w.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+v+(g>1?"-"+g:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(f,g),className:["data-footnote-backref"]},children:Array.isArray(_)?_:[_]})}const k=p[p.length-1];if(k&&k.type==="element"&&k.tagName==="p"){const _=k.children[k.children.length-1];_&&_.type==="text"?_.value+=" ":k.children.push({type:"text",value:" "}),k.children.push(...w)}else p.push(...w);const C={type:"element",tagName:"li",properties:{id:t+"fn-"+v},children:e.wrap(p,!0)};e.patch(d,C),u.push(C)}if(u.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:o,properties:{...Uf(s),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:` -`},{type:"element",tagName:"ol",properties:{},children:e.wrap(u,!0)},{type:"text",value:` -`}]}}const Nd=function(e){if(e==null)return Mq;if(typeof e=="function")return Od(e);if(typeof e=="object")return Array.isArray(e)?Lq(e):zq(e);if(typeof e=="string")return jq(e);throw new Error("Expected function, string, or object as test")};function Lq(e){const t=[];let n=-1;for(;++n":""))+")"})}return v;function v(){let g=wD,w,x,k;if((!t||o(f,d,p[p.length-1]||void 0))&&(g=Gq(n(f,p)),g[0]===wv))return g;if("children"in f&&f.children){const C=f;if(C.children&&g[0]!==Iq)for(x=(r?C.children.length:-1)+s,k=p.concat(C);x>-1&&x0&&n.push({type:"text",value:` -`}),n}function f_(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function d_(e,t){const n=Uq(e,t),r=n.one(e,void 0),i=Oq(n),o=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return i&&o.children.push({type:"text",value:` -`},i),o}function Yq(e,t){return e&&"run"in e?async function(n,r){const i=d_(n,{file:r,...t});await e.run(i,r)}:function(n,r){return d_(n,{file:r,...e||t})}}function h_(e){if(e)throw e}var og,p_;function Wq(){if(p_)return og;p_=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=function(d){return typeof Array.isArray=="function"?Array.isArray(d):t.call(d)==="[object Array]"},o=function(d){if(!d||t.call(d)!=="[object Object]")return!1;var p=e.call(d,"constructor"),m=d.constructor&&d.constructor.prototype&&e.call(d.constructor.prototype,"isPrototypeOf");if(d.constructor&&!p&&!m)return!1;var v;for(v in d);return typeof v>"u"||e.call(d,v)},s=function(d,p){n&&p.name==="__proto__"?n(d,p.name,{enumerable:!0,configurable:!0,value:p.newValue,writable:!0}):d[p.name]=p.newValue},u=function(d,p){if(p==="__proto__")if(e.call(d,p)){if(r)return r(d,p).value}else return;return d[p]};return og=function f(){var d,p,m,v,g,w,x=arguments[0],k=1,C=arguments.length,_=!1;for(typeof x=="boolean"&&(_=x,x=arguments[1]||{},k=2),(x==null||typeof x!="object"&&typeof x!="function")&&(x={});ks.length;let f;u&&s.push(i);try{f=e.apply(this,s)}catch(d){const p=d;if(u&&n)throw p;return i(p)}u||(f&&f.then&&typeof f.then=="function"?f.then(o,i):f instanceof Error?i(f):o(f))}function i(s,...u){n||(n=!0,t(s,...u))}function o(s){i(null,s)}}const Gr={basename:Qq,dirname:Jq,extname:eY,join:tY,sep:"/"};function Qq(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');bu(e);let n=0,r=-1,i=e.length,o;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(o){n=i+1;break}}else r<0&&(o=!0,r=i+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let s=-1,u=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(o){n=i+1;break}}else s<0&&(o=!0,s=i+1),u>-1&&(e.codePointAt(i)===t.codePointAt(u--)?u<0&&(r=i):(u=-1,r=s));return n===r?r=s:r<0&&(r=e.length),e.slice(n,r)}function Jq(e){if(bu(e),e.length===0)return".";let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||(r=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function eY(e){bu(e);let t=e.length,n=-1,r=0,i=-1,o=0,s;for(;t--;){const u=e.codePointAt(t);if(u===47){if(s){r=t+1;break}continue}n<0&&(s=!0,n=t+1),u===46?i<0?i=t:o!==1&&(o=1):i>-1&&(o=-1)}return i<0||n<0||o===0||o===1&&i===n-1&&i===r+1?"":e.slice(i,n)}function tY(...e){let t=-1,n;for(;++t0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function rY(e,t){let n="",r=0,i=-1,o=0,s=-1,u,f;for(;++s<=e.length;){if(s2){if(f=n.lastIndexOf("/"),f!==n.length-1){f<0?(n="",r=0):(n=n.slice(0,f),r=n.length-1-n.lastIndexOf("/")),i=s,o=0;continue}}else if(n.length>0){n="",r=0,i=s,o=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(i+1,s):n=e.slice(i+1,s),r=s-i-1;i=s,o=0}else u===46&&o>-1?o++:o=-1}return n}function bu(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const iY={cwd:aY};function aY(){return"/"}function _v(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function oY(e){if(typeof e=="string")e=new URL(e);else if(!_v(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return lY(e)}function lY(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const t=e.pathname;let n=-1;for(;++n0){let[g,...w]=p;const x=r[v][1];Ev(x)&&Ev(g)&&(g=lg(!0,x,g)),r[v]=[d,g,...w]}}}}const fY=new ib().freeze();function fg(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function dg(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function hg(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function g_(e){if(!Ev(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function v_(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function Jc(e){return dY(e)?e:new ED(e)}function dY(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function hY(e){return typeof e=="string"||pY(e)}function pY(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const mY="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",y_=[],b_={allowDangerousHtml:!0},gY=/^(https?|ircs?|mailto|xmpp)$/i,vY=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function yY(e){const t=e.allowedElements,n=e.allowElement,r=e.children||"",i=e.className,o=e.components,s=e.disallowedElements,u=e.rehypePlugins||y_,f=e.remarkPlugins||y_,d=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...b_}:b_,p=e.skipHtml,m=e.unwrapDisallowed,v=e.urlTransform||bY,g=fY().use(JV).use(f).use(Yq,d).use(u),w=new ED;typeof r=="string"&&(w.value=r);for(const _ of vY)Object.hasOwn(e,_.from)&&(""+_.from+(_.to?"use `"+_.to+"` instead":"remove it")+mY+_.id,void 0);const x=g.parse(w);let k=g.runSync(x,w);return i&&(k={type:"element",tagName:"div",properties:{className:i},children:k.type==="root"?k.children:[k]}),rb(k,C),Q2(k,{Fragment:S.Fragment,components:o,ignoreInvalidStyle:!0,jsx:S.jsx,jsxs:S.jsxs,passKeys:!0,passNode:!0});function C(_,T,N){if(_.type==="raw"&&N&&typeof T=="number")return p?N.children.splice(T,1):N.children[T]={type:"text",value:_.value},T;if(_.type==="element"){let D;for(D in rg)if(Object.hasOwn(rg,D)&&Object.hasOwn(_.properties,D)){const z=_.properties[D],R=rg[D];(R===null||R.includes(_.tagName))&&(_.properties[D]=v(String(z||""),D,_))}}if(_.type==="element"){let D=t?!t.includes(_.tagName):s?s.includes(_.tagName):!1;if(!D&&n&&typeof T=="number"&&(D=!n(_,T,N)),D&&N&&typeof T=="number")return m&&_.children?N.children.splice(T,1,..._.children):N.children.splice(T,1),T}}}function bY(e){const t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),i=e.indexOf("/");return t===-1||i!==-1&&t>i||n!==-1&&t>n||r!==-1&&t>r||gY.test(e.slice(0,t))?e:""}function x_(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let r=0,i=n.indexOf(t);for(;i!==-1;)r++,i=n.indexOf(t,i+t.length);return r}function xY(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function wY(e,t,n){const i=Nd((n||{}).ignore||[]),o=SY(t);let s=-1;for(;++s0?{type:"text",value:z}:void 0),z===!1?v.lastIndex=N+1:(w!==N&&_.push({type:"text",value:d.value.slice(w,N)}),Array.isArray(z)?_.push(...z):z&&_.push(z),w=N+T[0].length,C=!0),!v.global)break;T=v.exec(d.value)}return C?(w?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(")");const i=x_(e,"(");let o=x_(e,")");for(;r!==-1&&i>o;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),o++;return[e,n]}function _D(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||to(n)||Ad(n))&&(!t||n!==47)}kD.peek=VY;function PY(){this.buffer()}function FY(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function IY(){this.buffer()}function GY(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function BY(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Tr(this.sliceSerialize(e)).toLowerCase(),n.label=t}function UY(e){this.exit(e)}function HY(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Tr(this.sliceSerialize(e)).toLowerCase(),n.label=t}function $Y(e){this.exit(e)}function VY(){return"["}function kD(e,t,n,r){const i=n.createTracker(r);let o=i.move("[^");const s=n.enter("footnoteReference"),u=n.enter("reference");return o+=i.move(n.safe(n.associationId(e),{after:"]",before:o})),u(),s(),o+=i.move("]"),o}function qY(){return{enter:{gfmFootnoteCallString:PY,gfmFootnoteCall:FY,gfmFootnoteDefinitionLabelString:IY,gfmFootnoteDefinition:GY},exit:{gfmFootnoteCallString:BY,gfmFootnoteCall:UY,gfmFootnoteDefinitionLabelString:HY,gfmFootnoteDefinition:$Y}}}function YY(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:kD},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(r,i,o,s){const u=o.createTracker(s);let f=u.move("[^");const d=o.enter("footnoteDefinition"),p=o.enter("label");return f+=u.move(o.safe(o.associationId(r),{before:f,after:"]"})),p(),f+=u.move("]:"),r.children&&r.children.length>0&&(u.shift(4),f+=u.move((t?` -`:" ")+o.indentLines(o.containerFlow(r,u.current()),t?CD:WY))),d(),f}}function WY(e,t,n){return t===0?e:CD(e,t,n)}function CD(e,t,n){return(n?"":" ")+e}const XY=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];TD.peek=eW;function KY(){return{canContainEols:["delete"],enter:{strikethrough:QY},exit:{strikethrough:JY}}}function ZY(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:XY}],handlers:{delete:TD}}}function QY(e){this.enter({type:"delete",children:[]},e)}function JY(e){this.exit(e)}function TD(e,t,n,r){const i=n.createTracker(r),o=n.enter("strikethrough");let s=i.move("~~");return s+=n.containerPhrasing(e,{...i.current(),before:s,after:"~"}),s+=i.move("~~"),o(),s}function eW(){return"~"}function tW(e){return e.length}function nW(e,t){const n=t||{},r=(n.align||[]).concat(),i=n.stringLength||tW,o=[],s=[],u=[],f=[];let d=0,p=-1;for(;++pd&&(d=e[p].length);++Cf[C])&&(f[C]=T)}x.push(_)}s[p]=x,u[p]=k}let m=-1;if(typeof r=="object"&&"length"in r)for(;++mf[m]&&(f[m]=_),g[m]=_),v[m]=T}s.splice(1,0,v),u.splice(1,0,g),p=-1;const w=[];for(;++p "),o.shift(2);const s=n.indentLines(n.containerFlow(e,o.current()),aW);return i(),s}function aW(e,t,n){return">"+(n?"":" ")+e}function oW(e,t){return S_(e,t.inConstruct,!0)&&!S_(e,t.notInConstruct,!1)}function S_(e,t,n){if(typeof t=="string"&&(t=[t]),!t||t.length===0)return n;let r=-1;for(;++rs&&(s=o):o=1,i=r+t.length,r=n.indexOf(t,i);return s}function lW(e,t){return!!(t.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function sW(e){const t=e.options.fence||"`";if(t!=="`"&&t!=="~")throw new Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function uW(e,t,n,r){const i=sW(n),o=e.value||"",s=i==="`"?"GraveAccent":"Tilde";if(lW(e,n)){const m=n.enter("codeIndented"),v=n.indentLines(o,cW);return m(),v}const u=n.createTracker(r),f=i.repeat(Math.max(AD(o,i)+1,3)),d=n.enter("codeFenced");let p=u.move(f);if(e.lang){const m=n.enter(`codeFencedLang${s}`);p+=u.move(n.safe(e.lang,{before:p,after:" ",encode:["`"],...u.current()})),m()}if(e.lang&&e.meta){const m=n.enter(`codeFencedMeta${s}`);p+=u.move(" "),p+=u.move(n.safe(e.meta,{before:p,after:` -`,encode:["`"],...u.current()})),m()}return p+=u.move(` -`),o&&(p+=u.move(o+` -`)),p+=u.move(f),d(),p}function cW(e,t,n){return(n?"":" ")+e}function ab(e){const t=e.options.quote||'"';if(t!=='"'&&t!=="'")throw new Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function fW(e,t,n,r){const i=ab(n),o=i==='"'?"Quote":"Apostrophe",s=n.enter("definition");let u=n.enter("label");const f=n.createTracker(r);let d=f.move("[");return d+=f.move(n.safe(n.associationId(e),{before:d,after:"]",...f.current()})),d+=f.move("]: "),u(),!e.url||/[\0- \u007F]/.test(e.url)?(u=n.enter("destinationLiteral"),d+=f.move("<"),d+=f.move(n.safe(e.url,{before:d,after:">",...f.current()})),d+=f.move(">")):(u=n.enter("destinationRaw"),d+=f.move(n.safe(e.url,{before:d,after:e.title?" ":` -`,...f.current()}))),u(),e.title&&(u=n.enter(`title${o}`),d+=f.move(" "+i),d+=f.move(n.safe(e.title,{before:d,after:i,...f.current()})),d+=f.move(i),u()),s(),d}function dW(e){const t=e.options.emphasis||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function nu(e){return""+e.toString(16).toUpperCase()+";"}function Hf(e,t,n){const r=pl(e),i=pl(t);return r===void 0?i===void 0?n==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}RD.peek=hW;function RD(e,t,n,r){const i=dW(n),o=n.enter("emphasis"),s=n.createTracker(r),u=s.move(i);let f=s.move(n.containerPhrasing(e,{after:i,before:u,...s.current()}));const d=f.charCodeAt(0),p=Hf(r.before.charCodeAt(r.before.length-1),d,i);p.inside&&(f=nu(d)+f.slice(1));const m=f.charCodeAt(f.length-1),v=Hf(r.after.charCodeAt(0),m,i);v.inside&&(f=f.slice(0,-1)+nu(m));const g=s.move(i);return o(),n.attentionEncodeSurroundingInfo={after:v.outside,before:p.outside},u+f+g}function hW(e,t,n){return n.options.emphasis||"*"}function pW(e,t){let n=!1;return rb(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return n=!0,wv}),!!((!e.depth||e.depth<3)&&Ky(e)&&(t.options.setext||n))}function mW(e,t,n,r){const i=Math.max(Math.min(6,e.depth||1),1),o=n.createTracker(r);if(pW(e,n)){const p=n.enter("headingSetext"),m=n.enter("phrasing"),v=n.containerPhrasing(e,{...o.current(),before:` -`,after:` -`});return m(),p(),v+` -`+(i===1?"=":"-").repeat(v.length-(Math.max(v.lastIndexOf("\r"),v.lastIndexOf(` -`))+1))}const s="#".repeat(i),u=n.enter("headingAtx"),f=n.enter("phrasing");o.move(s+" ");let d=n.containerPhrasing(e,{before:"# ",after:` -`,...o.current()});return/^[\t ]/.test(d)&&(d=nu(d.charCodeAt(0))+d.slice(1)),d=d?s+" "+d:s,n.options.closeAtx&&(d+=" "+s),f(),u(),d}DD.peek=gW;function DD(e){return e.value||""}function gW(){return"<"}ND.peek=vW;function ND(e,t,n,r){const i=ab(n),o=i==='"'?"Quote":"Apostrophe",s=n.enter("image");let u=n.enter("label");const f=n.createTracker(r);let d=f.move("![");return d+=f.move(n.safe(e.alt,{before:d,after:"]",...f.current()})),d+=f.move("]("),u(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(u=n.enter("destinationLiteral"),d+=f.move("<"),d+=f.move(n.safe(e.url,{before:d,after:">",...f.current()})),d+=f.move(">")):(u=n.enter("destinationRaw"),d+=f.move(n.safe(e.url,{before:d,after:e.title?" ":")",...f.current()}))),u(),e.title&&(u=n.enter(`title${o}`),d+=f.move(" "+i),d+=f.move(n.safe(e.title,{before:d,after:i,...f.current()})),d+=f.move(i),u()),d+=f.move(")"),s(),d}function vW(){return"!"}OD.peek=yW;function OD(e,t,n,r){const i=e.referenceType,o=n.enter("imageReference");let s=n.enter("label");const u=n.createTracker(r);let f=u.move("![");const d=n.safe(e.alt,{before:f,after:"]",...u.current()});f+=u.move(d+"]["),s();const p=n.stack;n.stack=[],s=n.enter("reference");const m=n.safe(n.associationId(e),{before:f,after:"]",...u.current()});return s(),n.stack=p,o(),i==="full"||!d||d!==m?f+=u.move(m+"]"):i==="shortcut"?f=f.slice(0,-1):f+=u.move("]"),f}function yW(){return"!"}LD.peek=bW;function LD(e,t,n){let r=e.value||"",i="`",o=-1;for(;new RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++o\u007F]/.test(e.url))}jD.peek=xW;function jD(e,t,n,r){const i=ab(n),o=i==='"'?"Quote":"Apostrophe",s=n.createTracker(r);let u,f;if(zD(e,n)){const p=n.stack;n.stack=[],u=n.enter("autolink");let m=s.move("<");return m+=s.move(n.containerPhrasing(e,{before:m,after:">",...s.current()})),m+=s.move(">"),u(),n.stack=p,m}u=n.enter("link"),f=n.enter("label");let d=s.move("[");return d+=s.move(n.containerPhrasing(e,{before:d,after:"](",...s.current()})),d+=s.move("]("),f(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(f=n.enter("destinationLiteral"),d+=s.move("<"),d+=s.move(n.safe(e.url,{before:d,after:">",...s.current()})),d+=s.move(">")):(f=n.enter("destinationRaw"),d+=s.move(n.safe(e.url,{before:d,after:e.title?" ":")",...s.current()}))),f(),e.title&&(f=n.enter(`title${o}`),d+=s.move(" "+i),d+=s.move(n.safe(e.title,{before:d,after:i,...s.current()})),d+=s.move(i),f()),d+=s.move(")"),u(),d}function xW(e,t,n){return zD(e,n)?"<":"["}MD.peek=wW;function MD(e,t,n,r){const i=e.referenceType,o=n.enter("linkReference");let s=n.enter("label");const u=n.createTracker(r);let f=u.move("[");const d=n.containerPhrasing(e,{before:f,after:"]",...u.current()});f+=u.move(d+"]["),s();const p=n.stack;n.stack=[],s=n.enter("reference");const m=n.safe(n.associationId(e),{before:f,after:"]",...u.current()});return s(),n.stack=p,o(),i==="full"||!d||d!==m?f+=u.move(m+"]"):i==="shortcut"?f=f.slice(0,-1):f+=u.move("]"),f}function wW(){return"["}function ob(e){const t=e.options.bullet||"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function SW(e){const t=ob(e),n=e.options.bulletOther;if(!n)return t==="*"?"-":"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw new Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function EW(e){const t=e.options.bulletOrdered||".";if(t!=="."&&t!==")")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function PD(e){const t=e.options.rule||"*";if(t!=="*"&&t!=="-"&&t!=="_")throw new Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function _W(e,t,n,r){const i=n.enter("list"),o=n.bulletCurrent;let s=e.ordered?EW(n):ob(n);const u=e.ordered?s==="."?")":".":SW(n);let f=t&&n.bulletLastUsed?s===n.bulletLastUsed:!1;if(!e.ordered){const p=e.children?e.children[0]:void 0;if((s==="*"||s==="-")&&p&&(!p.children||!p.children[0])&&n.stack[n.stack.length-1]==="list"&&n.stack[n.stack.length-2]==="listItem"&&n.stack[n.stack.length-3]==="list"&&n.stack[n.stack.length-4]==="listItem"&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(f=!0),PD(n)===s&&p){let m=-1;for(;++m-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+o);let s=o.length+1;(i==="tab"||i==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(s=Math.ceil(s/4)*4);const u=n.createTracker(r);u.move(o+" ".repeat(s-o.length)),u.shift(s);const f=n.enter("listItem"),d=n.indentLines(n.containerFlow(e,u.current()),p);return f(),d;function p(m,v,g){return v?(g?"":" ".repeat(s))+m:(g?o:o+" ".repeat(s-o.length))+m}}function TW(e,t,n,r){const i=n.enter("paragraph"),o=n.enter("phrasing"),s=n.containerPhrasing(e,r);return o(),i(),s}const AW=Nd(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function RW(e,t,n,r){return(e.children.some(function(s){return AW(s)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function DW(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}FD.peek=NW;function FD(e,t,n,r){const i=DW(n),o=n.enter("strong"),s=n.createTracker(r),u=s.move(i+i);let f=s.move(n.containerPhrasing(e,{after:i,before:u,...s.current()}));const d=f.charCodeAt(0),p=Hf(r.before.charCodeAt(r.before.length-1),d,i);p.inside&&(f=nu(d)+f.slice(1));const m=f.charCodeAt(f.length-1),v=Hf(r.after.charCodeAt(0),m,i);v.inside&&(f=f.slice(0,-1)+nu(m));const g=s.move(i+i);return o(),n.attentionEncodeSurroundingInfo={after:v.outside,before:p.outside},u+f+g}function NW(e,t,n){return n.options.strong||"*"}function OW(e,t,n,r){return n.safe(e.value,r)}function LW(e){const t=e.options.ruleRepetition||3;if(t<3)throw new Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function zW(e,t,n){const r=(PD(n)+(n.options.ruleSpaces?" ":"")).repeat(LW(n));return n.options.ruleSpaces?r.slice(0,-1):r}const ID={blockquote:iW,break:E_,code:uW,definition:fW,emphasis:RD,hardBreak:E_,heading:mW,html:DD,image:ND,imageReference:OD,inlineCode:LD,link:jD,linkReference:MD,list:_W,listItem:CW,paragraph:TW,root:RW,strong:FD,text:OW,thematicBreak:zW};function jW(){return{enter:{table:MW,tableData:__,tableHeader:__,tableRow:FW},exit:{codeText:IW,table:PW,tableData:vg,tableHeader:vg,tableRow:vg}}}function MW(e){const t=e._align;this.enter({type:"table",align:t.map(function(n){return n==="none"?null:n}),children:[]},e),this.data.inTable=!0}function PW(e){this.exit(e),this.data.inTable=void 0}function FW(e){this.enter({type:"tableRow",children:[]},e)}function vg(e){this.exit(e)}function __(e){this.enter({type:"tableCell",children:[]},e)}function IW(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,GW));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function GW(e,t){return t==="|"?t:e}function BW(e){const t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,o=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:` -`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:v,table:s,tableCell:f,tableRow:u}};function s(g,w,x,k){return d(p(g,x,k),g.align)}function u(g,w,x,k){const C=m(g,x,k),_=d([C]);return _.slice(0,_.indexOf(` -`))}function f(g,w,x,k){const C=x.enter("tableCell"),_=x.enter("phrasing"),T=x.containerPhrasing(g,{...k,before:o,after:o});return _(),C(),T}function d(g,w){return nW(g,{align:w,alignDelimiters:r,padding:n,stringLength:i})}function p(g,w,x){const k=g.children;let C=-1;const _=[],T=w.enter("table");for(;++C0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const aX={tokenize:hX,partial:!0};function oX(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:cX,continuation:{tokenize:fX},exit:dX}},text:{91:{name:"gfmFootnoteCall",tokenize:uX},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:lX,resolveTo:sX}}}}function lX(e,t,n){const r=this;let i=r.events.length;const o=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let s;for(;i--;){const f=r.events[i][1];if(f.type==="labelImage"){s=f;break}if(f.type==="gfmFootnoteCall"||f.type==="labelLink"||f.type==="label"||f.type==="image"||f.type==="link")break}return u;function u(f){if(!s||!s._balanced)return n(f);const d=Tr(r.sliceSerialize({start:s.end,end:r.now()}));return d.codePointAt(0)!==94||!o.includes(d.slice(1))?n(f):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(f),e.exit("gfmFootnoteCallLabelMarker"),t(f))}}function sX(e,t){let n=e.length;for(;n--;)if(e[n][1].type==="labelImage"&&e[n][0]==="enter"){e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;const o={type:"gfmFootnoteCallString",start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},s={type:"chunkString",contentType:"string",start:Object.assign({},o.start),end:Object.assign({},o.end)},u=[e[n+1],e[n+2],["enter",r,t],e[n+3],e[n+4],["enter",i,t],["exit",i,t],["enter",o,t],["enter",s,t],["exit",s,t],["exit",o,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(n,e.length-n+1,...u),e}function uX(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let o=0,s;return u;function u(m){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(m),e.exit("gfmFootnoteCallLabelMarker"),f}function f(m){return m!==94?n(m):(e.enter("gfmFootnoteCallMarker"),e.consume(m),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",d)}function d(m){if(o>999||m===93&&!s||m===null||m===91||Tt(m))return n(m);if(m===93){e.exit("chunkString");const v=e.exit("gfmFootnoteCallString");return i.includes(Tr(r.sliceSerialize(v)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(m),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(m)}return Tt(m)||(s=!0),o++,e.consume(m),m===92?p:d}function p(m){return m===91||m===92||m===93?(e.consume(m),o++,d):d(m)}}function cX(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let o,s=0,u;return f;function f(w){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(w),e.exit("gfmFootnoteDefinitionLabelMarker"),d}function d(w){return w===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(w),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",p):n(w)}function p(w){if(s>999||w===93&&!u||w===null||w===91||Tt(w))return n(w);if(w===93){e.exit("chunkString");const x=e.exit("gfmFootnoteDefinitionLabelString");return o=Tr(r.sliceSerialize(x)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(w),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),v}return Tt(w)||(u=!0),s++,e.consume(w),w===92?m:p}function m(w){return w===91||w===92||w===93?(e.consume(w),s++,p):p(w)}function v(w){return w===58?(e.enter("definitionMarker"),e.consume(w),e.exit("definitionMarker"),i.includes(o)||i.push(o),lt(e,g,"gfmFootnoteDefinitionWhitespace")):n(w)}function g(w){return t(w)}}function fX(e,t,n){return e.check(yu,t,e.attempt(aX,t,n))}function dX(e){e.exit("gfmFootnoteDefinition")}function hX(e,t,n){const r=this;return lt(e,i,"gfmFootnoteDefinitionIndent",5);function i(o){const s=r.events[r.events.length-1];return s&&s[1].type==="gfmFootnoteDefinitionIndent"&&s[2].sliceSerialize(s[1],!0).length===4?t(o):n(o)}}function pX(e){let n=(e||{}).singleTilde;const r={name:"strikethrough",tokenize:o,resolveAll:i};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function i(s,u){let f=-1;for(;++f1?f(w):(s.consume(w),m++,g);if(m<2&&!n)return f(w);const k=s.exit("strikethroughSequenceTemporary"),C=pl(w);return k._open=!C||C===2&&!!x,k._close=!x||x===2&&!!C,u(w)}}}class mX{constructor(){this.map=[]}add(t,n,r){gX(this,t,n,r)}consume(t){if(this.map.sort(function(o,s){return o[0]-s[0]}),this.map.length===0)return;let n=this.map.length;const r=[];for(;n>0;)n-=1,r.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];r.push(t.slice()),t.length=0;let i=r.pop();for(;i;){for(const o of i)t.push(o);i=r.pop()}this.map.length=0}}function gX(e,t,n,r){let i=0;if(!(n===0&&r.length===0)){for(;i-1;){const Y=r.events[V][1].type;if(Y==="lineEnding"||Y==="linePrefix")V--;else break}const q=V>-1?r.events[V][1].type:null,I=q==="tableHead"||q==="tableRow"?z:f;return I===z&&r.parser.lazy[r.now().line]?n(j):I(j)}function f(j){return e.enter("tableHead"),e.enter("tableRow"),d(j)}function d(j){return j===124||(s=!0,o+=1),p(j)}function p(j){return j===null?n(j):Ue(j)?o>1?(o=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(j),e.exit("lineEnding"),g):n(j):ut(j)?lt(e,p,"whitespace")(j):(o+=1,s&&(s=!1,i+=1),j===124?(e.enter("tableCellDivider"),e.consume(j),e.exit("tableCellDivider"),s=!0,p):(e.enter("data"),m(j)))}function m(j){return j===null||j===124||Tt(j)?(e.exit("data"),p(j)):(e.consume(j),j===92?v:m)}function v(j){return j===92||j===124?(e.consume(j),m):m(j)}function g(j){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(j):(e.enter("tableDelimiterRow"),s=!1,ut(j)?lt(e,w,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(j):w(j))}function w(j){return j===45||j===58?k(j):j===124?(s=!0,e.enter("tableCellDivider"),e.consume(j),e.exit("tableCellDivider"),x):D(j)}function x(j){return ut(j)?lt(e,k,"whitespace")(j):k(j)}function k(j){return j===58?(o+=1,s=!0,e.enter("tableDelimiterMarker"),e.consume(j),e.exit("tableDelimiterMarker"),C):j===45?(o+=1,C(j)):j===null||Ue(j)?N(j):D(j)}function C(j){return j===45?(e.enter("tableDelimiterFiller"),_(j)):D(j)}function _(j){return j===45?(e.consume(j),_):j===58?(s=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(j),e.exit("tableDelimiterMarker"),T):(e.exit("tableDelimiterFiller"),T(j))}function T(j){return ut(j)?lt(e,N,"whitespace")(j):N(j)}function N(j){return j===124?w(j):j===null||Ue(j)?!s||i!==o?D(j):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(j)):D(j)}function D(j){return n(j)}function z(j){return e.enter("tableRow"),R(j)}function R(j){return j===124?(e.enter("tableCellDivider"),e.consume(j),e.exit("tableCellDivider"),R):j===null||Ue(j)?(e.exit("tableRow"),t(j)):ut(j)?lt(e,R,"whitespace")(j):(e.enter("data"),B(j))}function B(j){return j===null||j===124||Tt(j)?(e.exit("data"),R(j)):(e.consume(j),j===92?P:B)}function P(j){return j===92||j===124?(e.consume(j),B):B(j)}}function xX(e,t){let n=-1,r=!0,i=0,o=[0,0,0,0],s=[0,0,0,0],u=!1,f=0,d,p,m;const v=new mX;for(;++nn[2]+1){const w=n[2]+1,x=n[3]-n[2]-1;e.add(w,x,[])}}e.add(n[3]+1,0,[["exit",m,t]])}return i!==void 0&&(o.end=Object.assign({},el(t.events,i)),e.add(i,0,[["exit",o,t]]),o=void 0),o}function C_(e,t,n,r,i){const o=[],s=el(t.events,n);i&&(i.end=Object.assign({},s),o.push(["exit",i,t])),r.end=Object.assign({},s),o.push(["exit",r,t]),e.add(n+1,0,o)}function el(e,t){const n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}const wX={name:"tasklistCheck",tokenize:EX};function SX(){return{text:{91:wX}}}function EX(e,t,n){const r=this;return i;function i(f){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(f):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(f),e.exit("taskListCheckMarker"),o)}function o(f){return Tt(f)?(e.enter("taskListCheckValueUnchecked"),e.consume(f),e.exit("taskListCheckValueUnchecked"),s):f===88||f===120?(e.enter("taskListCheckValueChecked"),e.consume(f),e.exit("taskListCheckValueChecked"),s):n(f)}function s(f){return f===93?(e.enter("taskListCheckMarker"),e.consume(f),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),u):n(f)}function u(f){return Ue(f)?t(f):ut(f)?e.check({tokenize:_X},t,n)(f):n(f)}}function _X(e,t,n){return lt(e,r,"whitespace");function r(i){return i===null?n(i):t(i)}}function kX(e){return rD([KW(),oX(),pX(e),yX(),SX()])}const CX={};function TX(e){const t=this,n=e||CX,r=t.data(),i=r.micromarkExtensions||(r.micromarkExtensions=[]),o=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),s=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);i.push(kX(n)),o.push(qW()),s.push(YW(n))}function AX(e){const t=this;t.compiler=n;function n(r,i){return Q2(r,{filePath:i.path,...e})}}function RX(){return{enter:{mathFlow:e,mathFlowFenceMeta:t,mathText:o},exit:{mathFlow:i,mathFlowFence:r,mathFlowFenceMeta:n,mathFlowValue:u,mathText:s,mathTextData:u}};function e(f){const d={type:"element",tagName:"code",properties:{className:["language-math","math-display"]},children:[]};this.enter({type:"math",meta:null,value:"",data:{hName:"pre",hChildren:[d]}},f)}function t(){this.buffer()}function n(){const f=this.resume(),d=this.stack[this.stack.length-1];d.type,d.meta=f}function r(){this.data.mathFlowInside||(this.buffer(),this.data.mathFlowInside=!0)}function i(f){const d=this.resume().replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),p=this.stack[this.stack.length-1];p.type,this.exit(f),p.value=d;const m=p.data.hChildren[0];m.type,m.tagName,m.children.push({type:"text",value:d}),this.data.mathFlowInside=void 0}function o(f){this.enter({type:"inlineMath",value:"",data:{hName:"code",hProperties:{className:["language-math","math-inline"]},hChildren:[]}},f),this.buffer()}function s(f){const d=this.resume(),p=this.stack[this.stack.length-1];p.type,this.exit(f),p.value=d,p.data.hChildren.push({type:"text",value:d})}function u(f){this.config.enter.data.call(this,f),this.config.exit.data.call(this,f)}}function DX(e){let t=(e||{}).singleDollarTextMath;return t==null&&(t=!0),r.peek=i,{unsafe:[{character:"\r",inConstruct:"mathFlowMeta"},{character:` -`,inConstruct:"mathFlowMeta"},{character:"$",after:t?void 0:"\\$",inConstruct:"phrasing"},{character:"$",inConstruct:"mathFlowMeta"},{atBreak:!0,character:"$",after:"\\$"}],handlers:{math:n,inlineMath:r}};function n(o,s,u,f){const d=o.value||"",p=u.createTracker(f),m="$".repeat(Math.max(AD(d,"$")+1,2)),v=u.enter("mathFlow");let g=p.move(m);if(o.meta){const w=u.enter("mathFlowMeta");g+=p.move(u.safe(o.meta,{after:` -`,before:g,encode:["$"],...p.current()})),w()}return g+=p.move(` -`),d&&(g+=p.move(d+` -`)),g+=p.move(m),v(),g}function r(o,s,u){let f=o.value||"",d=1;for(t||d++;new RegExp("(^|[^$])"+"\\$".repeat(d)+"([^$]|$)").test(f);)d++;const p="$".repeat(d);/[^ \r\n]/.test(f)&&(/^[ \r\n]/.test(f)&&/[ \r\n]$/.test(f)||/^\$|\$$/.test(f))&&(f=" "+f+" ");let m=-1;for(;++mS.jsx(yY,{className:"prose lg:prose-xs dark:prose-invert max-w-none text-base",remarkPlugins:[TX,IX],rehypePlugins:[AX],skipHtml:!1,children:e.content});function BX(){const[e,t]=E.useState(()=>Qe.getState().retrievalHistory||[]),[n,r]=E.useState(""),[i,o]=E.useState(!1),s=E.useRef(null),u=E.useCallback(()=>{var m;(m=s.current)==null||m.scrollIntoView({behavior:"smooth"})},[]),f=E.useCallback(async m=>{if(m.preventDefault(),!n.trim()||i)return;const v={content:n,role:"user"},g={content:"",role:"assistant"},w=[...e];t([...w,v,g]),r(""),o(!0);const x=(_,T)=>{g.content+=_,t(N=>{const D=[...N],z=D[D.length-1];return z.role==="assistant"&&(z.content=g.content,z.isError=T),D})},k=Qe.getState(),C={...k.querySettings,query:v.content,conversation_history:w.filter(_=>_.isError!==!0).map(_=>({role:_.role,content:_.content}))};try{if(k.querySettings.stream){let _="";await sM(C,x,T=>{_+=T}),_&&(g.content&&(_=g.content+` -`+_),x(_,!0))}else{const _=await lM(C);x(_.response)}}catch(_){x(`Error: Failed to get response -${Cr(_)}`,!0)}finally{o(!1),Qe.getState().setRetrievalHistory([...w,v,g])}},[n,i,e,t]),d=jy(e,100);E.useEffect(()=>u(),[d,u]);const p=E.useCallback(()=>{t([]),Qe.getState().setRetrievalHistory([])},[t]);return S.jsxs("div",{className:"flex size-full gap-2 px-2 pb-12",children:[S.jsxs("div",{className:"flex grow flex-col gap-4",children:[S.jsx("div",{className:"relative grow",children:S.jsx("div",{className:"bg-primary-foreground/60 absolute inset-0 flex flex-col overflow-auto rounded-lg border p-2",children:S.jsxs("div",{className:"flex min-h-0 flex-1 flex-col gap-2",children:[e.length===0?S.jsx("div",{className:"text-muted-foreground flex h-full items-center justify-center text-lg",children:"Start a retrieval by typing your query below"}):e.map((m,v)=>S.jsx("div",{className:`flex ${m.role==="user"?"justify-end":"justify-start"}`,children:S.jsxs("div",{className:`max-w-[80%] rounded-lg px-4 py-2 ${m.role==="user"?"bg-primary text-primary-foreground":m.isError?"bg-red-100 text-red-600 dark:bg-red-950 dark:text-red-400":"bg-muted"}`,children:[S.jsx("pre",{className:"break-words whitespace-pre-wrap",children:S.jsx(GX,{message:m})}),m.content.length===0&&S.jsx(jM,{className:"animate-spin duration-2000"})]})},v)),S.jsx("div",{ref:s,className:"pb-1"})]})})}),S.jsxs("form",{onSubmit:f,className:"flex shrink-0 items-center gap-2",children:[S.jsxs(Ot,{type:"button",variant:"outline",onClick:p,disabled:i,size:"sm",children:[S.jsx(wk,{}),"Clear"]}),S.jsx(Za,{className:"flex-1",value:n,onChange:m=>r(m.target.value),placeholder:"Type your query...",disabled:i}),S.jsxs(Ot,{type:"submit",variant:"default",disabled:i,size:"sm",children:[S.jsx(ZM,{}),"Send"]})]})]}),S.jsx(s8,{})]})}function UX(){return S.jsx("iframe",{src:G_+"/docs",className:"size-full"})}function HX(){const e=Mn.use.message(),t=Qe.use.enableHealthCheck(),[n]=E.useState(()=>Qe.getState().currentTab),[r,i]=E.useState(!1);E.useEffect(()=>{if(!t)return;Mn.getState().check();const s=setInterval(async()=>{await Mn.getState().check()},xz*1e3);return()=>clearInterval(s)},[t]);const o=E.useCallback(s=>Qe.getState().setCurrentTab(s),[]);return E.useEffect(()=>{if(e&&(e.includes(vk)||e.includes(yk))){i(!0);return}i(!1)},[e,i]),S.jsx(_z,{children:S.jsxs("main",{className:"flex h-screen w-screen overflow-x-hidden",children:[S.jsxs(C3,{defaultValue:n,className:"!m-0 flex grow flex-col !p-0",onValueChange:o,children:[S.jsx(A3,{}),S.jsxs("div",{className:"relative grow",children:[S.jsx(Ps,{value:"documents",className:"absolute top-0 right-0 bottom-0 left-0",children:S.jsx(u9,{})}),S.jsx(Ps,{value:"knowledge-graph",className:"absolute top-0 right-0 bottom-0 left-0",children:S.jsx(LH,{})}),S.jsx(Ps,{value:"retrieval",className:"absolute top-0 right-0 bottom-0 left-0",children:S.jsx(BX,{})}),S.jsx(Ps,{value:"api",className:"absolute top-0 right-0 bottom-0 left-0",children:S.jsx(UX,{})})]})]}),t&&S.jsx(s3,{}),e!==null&&!r&&S.jsx(cP,{}),r&&S.jsx(WI,{}),S.jsx(YI,{})]})})}vL.createRoot(document.getElementById("root")).render(S.jsx(E.StrictMode,{children:S.jsx(HX,{})})); diff --git a/lightrag/api/webui/assets/index-CLsJV-0i.css b/lightrag/api/webui/assets/index-CLsJV-0i.css deleted file mode 100644 index 0e1032b4..00000000 --- a/lightrag/api/webui/assets/index-CLsJV-0i.css +++ /dev/null @@ -1 +0,0 @@ -/*! tailwindcss v4.0.7 | 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!important}.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}.list-item{display:list-item}.table{display:table}.table-cell{display:table-cell}.table-row{display:table-row}.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-40{height:calc(var(--spacing)*40)}.h-52{height:calc(var(--spacing)*52)}.h-84{height:calc(var(--spacing)*84)}.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-100{background-color:var(--color-red-100)}.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)}.lowercase{text-transform:lowercase}.uppercase{text-transform:uppercase}.italic{font-style:italic}.ordinal{--tw-ordinal:ordinal;font-variant-numeric:var(--tw-ordinal,)var(--tw-slashed-zero,)var(--tw-numeric-figure,)var(--tw-numeric-spacing,)var(--tw-numeric-fraction,)}.overline{text-decoration-line:overline}.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}.ring{--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)}.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)}.dark\:bg-red-950:is(.dark *){background-color:var(--color-red-950)}.dark\:text-red-400:is(.dark *){color:var(--color-red-400)}.\[\&_\[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-ordinal{syntax:"*";inherits:false}@property --tw-slashed-zero{syntax:"*";inherits:false}@property --tw-numeric-figure{syntax:"*";inherits:false}@property --tw-numeric-spacing{syntax:"*";inherits:false}@property --tw-numeric-fraction{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-drop-shadow{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-DbuMPJAD.js b/lightrag/api/webui/assets/index-DbuMPJAD.js new file mode 100644 index 00000000..5cc7b4c2 --- /dev/null +++ b/lightrag/api/webui/assets/index-DbuMPJAD.js @@ -0,0 +1,1120 @@ +var cH=Object.defineProperty;var dH=(e,t,n)=>t in e?cH(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Ea=(e,t,n)=>dH(e,typeof t!="symbol"?t+"":t,n);function fH(e,t){for(var n=0;nr[a]})}}}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 a of document.querySelectorAll('link[rel="modulepreload"]'))r(a);new MutationObserver(a=>{for(const i of a)if(i.type==="childList")for(const l of i.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&r(l)}).observe(document,{childList:!0,subtree:!0});function n(a){const i={};return a.integrity&&(i.integrity=a.integrity),a.referrerPolicy&&(i.referrerPolicy=a.referrerPolicy),a.crossOrigin==="use-credentials"?i.credentials="include":a.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(a){if(a.ep)return;a.ep=!0;const i=n(a);fetch(a.href,i)}})();var Cd=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function an(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function pH(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var n=function r(){return this instanceof r?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(r){var a=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,a.get?a:{enumerable:!0,get:function(){return e[r]}})}),n}var eh={exports:{}},Ds={};/** + * @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 $1;function gH(){if($1)return Ds;$1=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(r,a,i){var l=null;if(i!==void 0&&(l=""+i),a.key!==void 0&&(l=""+a.key),"key"in a){i={};for(var u in a)u!=="key"&&(i[u]=a[u])}else i=a;return a=i.ref,{$$typeof:e,type:r,key:l,ref:a!==void 0?a:null,props:i}}return Ds.Fragment=t,Ds.jsx=n,Ds.jsxs=n,Ds}var q1;function hH(){return q1||(q1=1,eh.exports=gH()),eh.exports}var w=hH(),th={exports:{}},at={};/** + * @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 V1;function mH(){if(V1)return at;V1=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),i=Symbol.for("react.consumer"),l=Symbol.for("react.context"),u=Symbol.for("react.forward_ref"),c=Symbol.for("react.suspense"),f=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),g=Symbol.iterator;function b(D){return D===null||typeof D!="object"?null:(D=g&&D[g]||D["@@iterator"],typeof D=="function"?D:null)}var m={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},S=Object.assign,v={};function A(D,V,B){this.props=D,this.context=V,this.refs=v,this.updater=B||m}A.prototype.isReactComponent={},A.prototype.setState=function(D,V){if(typeof D!="object"&&typeof D!="function"&&D!=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,D,V,"setState")},A.prototype.forceUpdate=function(D){this.updater.enqueueForceUpdate(this,D,"forceUpdate")};function R(){}R.prototype=A.prototype;function x(D,V,B){this.props=D,this.context=V,this.refs=v,this.updater=B||m}var _=x.prototype=new R;_.constructor=x,S(_,A.prototype),_.isPureReactComponent=!0;var C=Array.isArray,N={H:null,A:null,T:null,S:null},T=Object.prototype.hasOwnProperty;function O(D,V,B,L,Y,Q){return B=Q.ref,{$$typeof:e,type:D,key:V,ref:B!==void 0?B:null,props:Q}}function z(D,V){return O(D.type,V,void 0,void 0,void 0,D.props)}function I(D){return typeof D=="object"&&D!==null&&D.$$typeof===e}function M(D){var V={"=":"=0",":":"=2"};return"$"+D.replace(/[=:]/g,function(B){return V[B]})}var H=/\/+/g;function q(D,V){return typeof D=="object"&&D!==null&&D.key!=null?M(""+D.key):V.toString(36)}function U(){}function W(D){switch(D.status){case"fulfilled":return D.value;case"rejected":throw D.reason;default:switch(typeof D.status=="string"?D.then(U,U):(D.status="pending",D.then(function(V){D.status==="pending"&&(D.status="fulfilled",D.value=V)},function(V){D.status==="pending"&&(D.status="rejected",D.reason=V)})),D.status){case"fulfilled":return D.value;case"rejected":throw D.reason}}throw D}function Z(D,V,B,L,Y){var Q=typeof D;(Q==="undefined"||Q==="boolean")&&(D=null);var se=!1;if(D===null)se=!0;else switch(Q){case"bigint":case"string":case"number":se=!0;break;case"object":switch(D.$$typeof){case e:case t:se=!0;break;case p:return se=D._init,Z(se(D._payload),V,B,L,Y)}}if(se)return Y=Y(D),se=L===""?"."+q(D,0):L,C(Y)?(B="",se!=null&&(B=se.replace(H,"$&/")+"/"),Z(Y,V,B,"",function(Ae){return Ae})):Y!=null&&(I(Y)&&(Y=z(Y,B+(Y.key==null||D&&D.key===Y.key?"":(""+Y.key).replace(H,"$&/")+"/")+se)),V.push(Y)),1;se=0;var re=L===""?".":L+":";if(C(D))for(var le=0;le>>1,D=j[X];if(0>>1;Xa(L,P))Ya(Q,L)?(j[X]=Q,j[Y]=P,X=Y):(j[X]=L,j[B]=P,X=B);else if(Ya(Q,P))j[X]=Q,j[Y]=P,X=Y;else break e}}return G}function a(j,G){var P=j.sortIndex-G.sortIndex;return P!==0?P:j.id-G.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var l=Date,u=l.now();e.unstable_now=function(){return l.now()-u}}var c=[],f=[],p=1,g=null,b=3,m=!1,S=!1,v=!1,A=typeof setTimeout=="function"?setTimeout:null,R=typeof clearTimeout=="function"?clearTimeout:null,x=typeof setImmediate<"u"?setImmediate:null;function _(j){for(var G=n(f);G!==null;){if(G.callback===null)r(f);else if(G.startTime<=j)r(f),G.sortIndex=G.expirationTime,t(c,G);else break;G=n(f)}}function C(j){if(v=!1,_(j),!S)if(n(c)!==null)S=!0,W();else{var G=n(f);G!==null&&Z(C,G.startTime-j)}}var N=!1,T=-1,O=5,z=-1;function I(){return!(e.unstable_now()-zj&&I());){var X=g.callback;if(typeof X=="function"){g.callback=null,b=g.priorityLevel;var D=X(g.expirationTime<=j);if(j=e.unstable_now(),typeof D=="function"){g.callback=D,_(j),G=!0;break t}g===n(c)&&r(c),_(j)}else r(c);g=n(c)}if(g!==null)G=!0;else{var V=n(f);V!==null&&Z(C,V.startTime-j),G=!1}}break e}finally{g=null,b=P,m=!1}G=void 0}}finally{G?H():N=!1}}}var H;if(typeof x=="function")H=function(){x(M)};else if(typeof MessageChannel<"u"){var q=new MessageChannel,U=q.port2;q.port1.onmessage=M,H=function(){U.postMessage(null)}}else H=function(){A(M,0)};function W(){N||(N=!0,H())}function Z(j,G){T=A(function(){j(e.unstable_now())},G)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(j){j.callback=null},e.unstable_continueExecution=function(){S||m||(S=!0,W())},e.unstable_forceFrameRate=function(j){0>j||125X?(j.sortIndex=P,t(f,j),n(c)===null&&j===n(f)&&(v?(R(T),T=-1):v=!0,Z(C,P-X))):(j.sortIndex=D,t(c,j),S||m||(S=!0,W())),j},e.unstable_shouldYield=I,e.unstable_wrapCallback=function(j){var G=b;return function(){var P=b;b=G;try{return j.apply(this,arguments)}finally{b=P}}}}(ah)),ah}var K1;function vH(){return K1||(K1=1,rh.exports=yH()),rh.exports}var oh={exports:{}},bn={};/** + * @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 X1;function SH(){if(X1)return bn;X1=1;var e=nf();function t(c){var f="https://react.dev/errors/"+c;if(1"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),oh.exports=SH(),oh.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 Q1;function EH(){if(Q1)return Is;Q1=1;var e=vH(),t=nf(),n=mz();function r(o){var s="https://react.dev/errors/"+o;if(1)":-1y||K[h]!==ne[y]){var be=` +`+K[h].replace(" at new "," at ");return o.displayName&&be.includes("")&&(be=be.replace("",o.displayName)),be}while(1<=h&&0<=y);break}}}finally{W=!1,Error.prepareStackTrace=d}return(d=o?o.displayName||o.name:"")?U(d):""}function j(o){switch(o.tag){case 26:case 27:case 5:return U(o.type);case 16:return U("Lazy");case 13:return U("Suspense");case 19:return U("SuspenseList");case 0:case 15:return o=Z(o.type,!1),o;case 11:return o=Z(o.type.render,!1),o;case 1:return o=Z(o.type,!0),o;default:return""}}function G(o){try{var s="";do s+=j(o),o=o.return;while(o);return s}catch(d){return` +Error generating stack: `+d.message+` +`+d.stack}}function P(o){var s=o,d=o;if(o.alternate)for(;s.return;)s=s.return;else{o=s;do s=o,s.flags&4098&&(d=s.return),o=s.return;while(o)}return s.tag===3?d:null}function X(o){if(o.tag===13){var s=o.memoizedState;if(s===null&&(o=o.alternate,o!==null&&(s=o.memoizedState)),s!==null)return s.dehydrated}return null}function D(o){if(P(o)!==o)throw Error(r(188))}function V(o){var s=o.alternate;if(!s){if(s=P(o),s===null)throw Error(r(188));return s!==o?null:o}for(var d=o,h=s;;){var y=d.return;if(y===null)break;var E=y.alternate;if(E===null){if(h=y.return,h!==null){d=h;continue}break}if(y.child===E.child){for(E=y.child;E;){if(E===d)return D(y),o;if(E===h)return D(y),s;E=E.sibling}throw Error(r(188))}if(d.return!==h.return)d=y,h=E;else{for(var F=!1,$=y.child;$;){if($===d){F=!0,d=y,h=E;break}if($===h){F=!0,h=y,d=E;break}$=$.sibling}if(!F){for($=E.child;$;){if($===d){F=!0,d=E,h=y;break}if($===h){F=!0,h=E,d=y;break}$=$.sibling}if(!F)throw Error(r(189))}}if(d.alternate!==h)throw Error(r(190))}if(d.tag!==3)throw Error(r(188));return d.stateNode.current===d?o:s}function B(o){var s=o.tag;if(s===5||s===26||s===27||s===6)return o;for(o=o.child;o!==null;){if(s=B(o),s!==null)return s;o=o.sibling}return null}var L=Array.isArray,Y=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Q={pending:!1,data:null,method:null,action:null},se=[],re=-1;function le(o){return{current:o}}function Ae(o){0>re||(o.current=se[re],se[re]=null,re--)}function ae(o,s){re++,se[re]=o.current,o.current=s}var we=le(null),xe=le(null),Ie=le(null),Ce=le(null);function Ee(o,s){switch(ae(Ie,s),ae(xe,o),ae(we,null),o=s.nodeType,o){case 9:case 11:s=(s=s.documentElement)&&(s=s.namespaceURI)?v1(s):0;break;default:if(o=o===8?s.parentNode:s,s=o.tagName,o=o.namespaceURI)o=v1(o),s=S1(o,s);else switch(s){case"svg":s=1;break;case"math":s=2;break;default:s=0}}Ae(we),ae(we,s)}function J(){Ae(we),Ae(xe),Ae(Ie)}function fe(o){o.memoizedState!==null&&ae(Ce,o);var s=we.current,d=S1(s,o.type);s!==d&&(ae(xe,o),ae(we,d))}function ke(o){xe.current===o&&(Ae(we),Ae(xe)),Ce.current===o&&(Ae(Ce),_s._currentValue=Q)}var me=Object.prototype.hasOwnProperty,ve=e.unstable_scheduleCallback,ie=e.unstable_cancelCallback,ze=e.unstable_shouldYield,Pe=e.unstable_requestPaint,he=e.unstable_now,Ne=e.unstable_getCurrentPriorityLevel,ee=e.unstable_ImmediatePriority,ce=e.unstable_UserBlockingPriority,Re=e.unstable_NormalPriority,Fe=e.unstable_LowPriority,qe=e.unstable_IdlePriority,mt=e.log,St=e.unstable_setDisableYieldValue,pt=null,Je=null;function wt(o){if(Je&&typeof Je.onCommitFiberRoot=="function")try{Je.onCommitFiberRoot(pt,o,void 0,(o.current.flags&128)===128)}catch{}}function rt(o){if(typeof mt=="function"&&St(o),Je&&typeof Je.setStrictMode=="function")try{Je.setStrictMode(pt,o)}catch{}}var bt=Math.clz32?Math.clz32:Mt,Bt=Math.log,sn=Math.LN2;function Mt(o){return o>>>=0,o===0?32:31-(Bt(o)/sn|0)|0}var er=128,zr=4194304;function Kt(o){var s=o&42;if(s!==0)return s;switch(o&-o){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 o&4194176;case 4194304:case 8388608:case 16777216:case 33554432:return o&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return o}}function na(o,s){var d=o.pendingLanes;if(d===0)return 0;var h=0,y=o.suspendedLanes,E=o.pingedLanes,F=o.warmLanes;o=o.finishedLanes!==0;var $=d&134217727;return $!==0?(d=$&~y,d!==0?h=Kt(d):(E&=$,E!==0?h=Kt(E):o||(F=$&~F,F!==0&&(h=Kt(F))))):($=d&~y,$!==0?h=Kt($):E!==0?h=Kt(E):o||(F=d&~F,F!==0&&(h=Kt(F)))),h===0?0:s!==0&&s!==h&&!(s&y)&&(y=h&-h,F=s&-s,y>=F||y===32&&(F&4194176)!==0)?s:h}function Ye(o,s){return(o.pendingLanes&~(o.suspendedLanes&~o.pingedLanes)&s)===0}function gt(o,s){switch(o){case 1:case 2:case 4:case 8:return s+250;case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return s+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function _t(){var o=er;return er<<=1,!(er&4194176)&&(er=128),o}function Rn(){var o=zr;return zr<<=1,!(zr&62914560)&&(zr=4194304),o}function kn(o){for(var s=[],d=0;31>d;d++)s.push(o);return s}function Cn(o,s){o.pendingLanes|=s,s!==268435456&&(o.suspendedLanes=0,o.pingedLanes=0,o.warmLanes=0)}function ra(o,s,d,h,y,E){var F=o.pendingLanes;o.pendingLanes=d,o.suspendedLanes=0,o.pingedLanes=0,o.warmLanes=0,o.expiredLanes&=d,o.entangledLanes&=d,o.errorRecoveryDisabledLanes&=d,o.shellSuspendCounter=0;var $=o.entanglements,K=o.expirationTimes,ne=o.hiddenUpdates;for(d=F&~d;0"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),rG=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]*$"),SA={},EA={};function aG(o){return me.call(EA,o)?!0:me.call(SA,o)?!1:rG.test(o)?EA[o]=!0:(SA[o]=!0,!1)}function Cu(o,s,d){if(aG(s))if(d===null)o.removeAttribute(s);else{switch(typeof d){case"undefined":case"function":case"symbol":o.removeAttribute(s);return;case"boolean":var h=s.toLowerCase().slice(0,5);if(h!=="data-"&&h!=="aria-"){o.removeAttribute(s);return}}o.setAttribute(s,""+d)}}function Nu(o,s,d){if(d===null)o.removeAttribute(s);else{switch(typeof d){case"undefined":case"function":case"symbol":case"boolean":o.removeAttribute(s);return}o.setAttribute(s,""+d)}}function oa(o,s,d,h){if(h===null)o.removeAttribute(d);else{switch(typeof h){case"undefined":case"function":case"symbol":case"boolean":o.removeAttribute(d);return}o.setAttributeNS(s,d,""+h)}}function tr(o){switch(typeof o){case"bigint":case"boolean":case"number":case"string":case"undefined":return o;case"object":return o;default:return""}}function wA(o){var s=o.type;return(o=o.nodeName)&&o.toLowerCase()==="input"&&(s==="checkbox"||s==="radio")}function oG(o){var s=wA(o)?"checked":"value",d=Object.getOwnPropertyDescriptor(o.constructor.prototype,s),h=""+o[s];if(!o.hasOwnProperty(s)&&typeof d<"u"&&typeof d.get=="function"&&typeof d.set=="function"){var y=d.get,E=d.set;return Object.defineProperty(o,s,{configurable:!0,get:function(){return y.call(this)},set:function(F){h=""+F,E.call(this,F)}}),Object.defineProperty(o,s,{enumerable:d.enumerable}),{getValue:function(){return h},setValue:function(F){h=""+F},stopTracking:function(){o._valueTracker=null,delete o[s]}}}}function Ou(o){o._valueTracker||(o._valueTracker=oG(o))}function xA(o){if(!o)return!1;var s=o._valueTracker;if(!s)return!0;var d=s.getValue(),h="";return o&&(h=wA(o)?o.checked?"true":"false":o.value),o=h,o!==d?(s.setValue(o),!0):!1}function Du(o){if(o=o||(typeof document<"u"?document:void 0),typeof o>"u")return null;try{return o.activeElement||o.body}catch{return o.body}}var iG=/[\n"\\]/g;function nr(o){return o.replace(iG,function(s){return"\\"+s.charCodeAt(0).toString(16)+" "})}function Qf(o,s,d,h,y,E,F,$){o.name="",F!=null&&typeof F!="function"&&typeof F!="symbol"&&typeof F!="boolean"?o.type=F:o.removeAttribute("type"),s!=null?F==="number"?(s===0&&o.value===""||o.value!=s)&&(o.value=""+tr(s)):o.value!==""+tr(s)&&(o.value=""+tr(s)):F!=="submit"&&F!=="reset"||o.removeAttribute("value"),s!=null?Jf(o,F,tr(s)):d!=null?Jf(o,F,tr(d)):h!=null&&o.removeAttribute("value"),y==null&&E!=null&&(o.defaultChecked=!!E),y!=null&&(o.checked=y&&typeof y!="function"&&typeof y!="symbol"),$!=null&&typeof $!="function"&&typeof $!="symbol"&&typeof $!="boolean"?o.name=""+tr($):o.removeAttribute("name")}function kA(o,s,d,h,y,E,F,$){if(E!=null&&typeof E!="function"&&typeof E!="symbol"&&typeof E!="boolean"&&(o.type=E),s!=null||d!=null){if(!(E!=="submit"&&E!=="reset"||s!=null))return;d=d!=null?""+tr(d):"",s=s!=null?""+tr(s):d,$||s===o.value||(o.value=s),o.defaultValue=s}h=h??y,h=typeof h!="function"&&typeof h!="symbol"&&!!h,o.checked=$?o.checked:!!h,o.defaultChecked=!!h,F!=null&&typeof F!="function"&&typeof F!="symbol"&&typeof F!="boolean"&&(o.name=F)}function Jf(o,s,d){s==="number"&&Du(o.ownerDocument)===o||o.defaultValue===""+d||(o.defaultValue=""+d)}function bi(o,s,d,h){if(o=o.options,s){s={};for(var y=0;y=ql),zA=" ",PA=!1;function BA(o,s){switch(o){case"keyup":return LG.indexOf(s.keyCode)!==-1;case"keydown":return s.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function UA(o){return o=o.detail,typeof o=="object"&&"data"in o?o.data:null}var Ei=!1;function FG(o,s){switch(o){case"compositionend":return UA(s);case"keypress":return s.which!==32?null:(PA=!0,zA);case"textInput":return o=s.data,o===zA&&PA?null:o;default:return null}}function zG(o,s){if(Ei)return o==="compositionend"||!cp&&BA(o,s)?(o=OA(),Lu=op=Pa=null,Ei=!1,o):null;switch(o){case"paste":return null;case"keypress":if(!(s.ctrlKey||s.altKey||s.metaKey)||s.ctrlKey&&s.altKey){if(s.char&&1=s)return{node:d,offset:s-o};o=h}e:{for(;d;){if(d.nextSibling){d=d.nextSibling;break e}d=d.parentNode}d=void 0}d=YA(d)}}function XA(o,s){return o&&s?o===s?!0:o&&o.nodeType===3?!1:s&&s.nodeType===3?XA(o,s.parentNode):"contains"in o?o.contains(s):o.compareDocumentPosition?!!(o.compareDocumentPosition(s)&16):!1:!1}function ZA(o){o=o!=null&&o.ownerDocument!=null&&o.ownerDocument.defaultView!=null?o.ownerDocument.defaultView:window;for(var s=Du(o.document);s instanceof o.HTMLIFrameElement;){try{var d=typeof s.contentWindow.location.href=="string"}catch{d=!1}if(d)o=s.contentWindow;else break;s=Du(o.document)}return s}function pp(o){var s=o&&o.nodeName&&o.nodeName.toLowerCase();return s&&(s==="input"&&(o.type==="text"||o.type==="search"||o.type==="tel"||o.type==="url"||o.type==="password")||s==="textarea"||o.contentEditable==="true")}function qG(o,s){var d=ZA(s);s=o.focusedElem;var h=o.selectionRange;if(d!==s&&s&&s.ownerDocument&&XA(s.ownerDocument.documentElement,s)){if(h!==null&&pp(s)){if(o=h.start,d=h.end,d===void 0&&(d=o),"selectionStart"in s)s.selectionStart=o,s.selectionEnd=Math.min(d,s.value.length);else if(d=(o=s.ownerDocument||document)&&o.defaultView||window,d.getSelection){d=d.getSelection();var y=s.textContent.length,E=Math.min(h.start,y);h=h.end===void 0?E:Math.min(h.end,y),!d.extend&&E>h&&(y=h,h=E,E=y),y=KA(s,E);var F=KA(s,h);y&&F&&(d.rangeCount!==1||d.anchorNode!==y.node||d.anchorOffset!==y.offset||d.focusNode!==F.node||d.focusOffset!==F.offset)&&(o=o.createRange(),o.setStart(y.node,y.offset),d.removeAllRanges(),E>h?(d.addRange(o),d.extend(F.node,F.offset)):(o.setEnd(F.node,F.offset),d.addRange(o)))}}for(o=[],d=s;d=d.parentNode;)d.nodeType===1&&o.push({element:d,left:d.scrollLeft,top:d.scrollTop});for(typeof s.focus=="function"&&s.focus(),s=0;s=document.documentMode,wi=null,gp=null,Kl=null,hp=!1;function QA(o,s,d){var h=d.window===d?d.document:d.nodeType===9?d:d.ownerDocument;hp||wi==null||wi!==Du(h)||(h=wi,"selectionStart"in h&&pp(h)?h={start:h.selectionStart,end:h.selectionEnd}:(h=(h.ownerDocument&&h.ownerDocument.defaultView||window).getSelection(),h={anchorNode:h.anchorNode,anchorOffset:h.anchorOffset,focusNode:h.focusNode,focusOffset:h.focusOffset}),Kl&&Yl(Kl,h)||(Kl=h,h=Ec(gp,"onSelect"),0>=F,y-=F,ia=1<<32-bt(s)+y|d<Qe?(nn=Ve,Ve=null):nn=Ve.sibling;var vt=de(oe,Ve,ue[Qe],Se);if(vt===null){Ve===null&&(Ve=nn);break}o&&Ve&&vt.alternate===null&&s(oe,Ve),te=E(vt,te,Qe),it===null?Ue=vt:it.sibling=vt,it=vt,Ve=nn}if(Qe===ue.length)return d(oe,Ve),yt&&Do(oe,Qe),Ue;if(Ve===null){for(;QeQe?(nn=Ve,Ve=null):nn=Ve.sibling;var ao=de(oe,Ve,vt.value,Se);if(ao===null){Ve===null&&(Ve=nn);break}o&&Ve&&ao.alternate===null&&s(oe,Ve),te=E(ao,te,Qe),it===null?Ue=ao:it.sibling=ao,it=ao,Ve=nn}if(vt.done)return d(oe,Ve),yt&&Do(oe,Qe),Ue;if(Ve===null){for(;!vt.done;Qe++,vt=ue.next())vt=Te(oe,vt.value,Se),vt!==null&&(te=E(vt,te,Qe),it===null?Ue=vt:it.sibling=vt,it=vt);return yt&&Do(oe,Qe),Ue}for(Ve=h(Ve);!vt.done;Qe++,vt=ue.next())vt=ge(Ve,oe,Qe,vt.value,Se),vt!==null&&(o&&vt.alternate!==null&&Ve.delete(vt.key===null?Qe:vt.key),te=E(vt,te,Qe),it===null?Ue=vt:it.sibling=vt,it=vt);return o&&Ve.forEach(function(uH){return s(oe,uH)}),yt&&Do(oe,Qe),Ue}function Gt(oe,te,ue,Se){if(typeof ue=="object"&&ue!==null&&ue.type===c&&ue.key===null&&(ue=ue.props.children),typeof ue=="object"&&ue!==null){switch(ue.$$typeof){case l:e:{for(var Ue=ue.key;te!==null;){if(te.key===Ue){if(Ue=ue.type,Ue===c){if(te.tag===7){d(oe,te.sibling),Se=y(te,ue.props.children),Se.return=oe,oe=Se;break e}}else if(te.elementType===Ue||typeof Ue=="object"&&Ue!==null&&Ue.$$typeof===x&&hT(Ue)===te.type){d(oe,te.sibling),Se=y(te,ue.props),ns(Se,ue),Se.return=oe,oe=Se;break e}d(oe,te);break}else s(oe,te);te=te.sibling}ue.type===c?(Se=Ho(ue.props.children,oe.mode,Se,ue.key),Se.return=oe,oe=Se):(Se=dc(ue.type,ue.key,ue.props,null,oe.mode,Se),ns(Se,ue),Se.return=oe,oe=Se)}return F(oe);case u:e:{for(Ue=ue.key;te!==null;){if(te.key===Ue)if(te.tag===4&&te.stateNode.containerInfo===ue.containerInfo&&te.stateNode.implementation===ue.implementation){d(oe,te.sibling),Se=y(te,ue.children||[]),Se.return=oe,oe=Se;break e}else{d(oe,te);break}else s(oe,te);te=te.sibling}Se=bg(ue,oe.mode,Se),Se.return=oe,oe=Se}return F(oe);case x:return Ue=ue._init,ue=Ue(ue._payload),Gt(oe,te,ue,Se)}if(L(ue))return He(oe,te,ue,Se);if(T(ue)){if(Ue=T(ue),typeof Ue!="function")throw Error(r(150));return ue=Ue.call(ue),et(oe,te,ue,Se)}if(typeof ue.then=="function")return Gt(oe,te,Vu(ue),Se);if(ue.$$typeof===m)return Gt(oe,te,sc(oe,ue),Se);Wu(oe,ue)}return typeof ue=="string"&&ue!==""||typeof ue=="number"||typeof ue=="bigint"?(ue=""+ue,te!==null&&te.tag===6?(d(oe,te.sibling),Se=y(te,ue),Se.return=oe,oe=Se):(d(oe,te),Se=mg(ue,oe.mode,Se),Se.return=oe,oe=Se),F(oe)):d(oe,te)}return function(oe,te,ue,Se){try{ts=0;var Ue=Gt(oe,te,ue,Se);return Ri=null,Ue}catch(Ve){if(Ve===Jl)throw Ve;var it=cr(29,Ve,null,oe.mode);return it.lanes=Se,it.return=oe,it}finally{}}}var Lo=mT(!0),bT=mT(!1),Ci=le(null),Yu=le(0);function yT(o,s){o=ya,ae(Yu,o),ae(Ci,s),ya=o|s.baseLanes}function xp(){ae(Yu,ya),ae(Ci,Ci.current)}function kp(){ya=Yu.current,Ae(Ci),Ae(Yu)}var lr=le(null),Br=null;function Ua(o){var s=o.alternate;ae(Xt,Xt.current&1),ae(lr,o),Br===null&&(s===null||Ci.current!==null||s.memoizedState!==null)&&(Br=o)}function vT(o){if(o.tag===22){if(ae(Xt,Xt.current),ae(lr,o),Br===null){var s=o.alternate;s!==null&&s.memoizedState!==null&&(Br=o)}}else ja()}function ja(){ae(Xt,Xt.current),ae(lr,lr.current)}function sa(o){Ae(lr),Br===o&&(Br=null),Ae(Xt)}var Xt=le(0);function Ku(o){for(var s=o;s!==null;){if(s.tag===13){var d=s.memoizedState;if(d!==null&&(d=d.dehydrated,d===null||d.data==="$?"||d.data==="$!"))return s}else if(s.tag===19&&s.memoizedProps.revealOrder!==void 0){if(s.flags&128)return s}else if(s.child!==null){s.child.return=s,s=s.child;continue}if(s===o)break;for(;s.sibling===null;){if(s.return===null||s.return===o)return null;s=s.return}s.sibling.return=s.return,s=s.sibling}return null}var XG=typeof AbortController<"u"?AbortController:function(){var o=[],s=this.signal={aborted:!1,addEventListener:function(d,h){o.push(h)}};this.abort=function(){s.aborted=!0,o.forEach(function(d){return d()})}},ZG=e.unstable_scheduleCallback,QG=e.unstable_NormalPriority,Zt={$$typeof:m,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Ap(){return{controller:new XG,data:new Map,refCount:0}}function rs(o){o.refCount--,o.refCount===0&&ZG(QG,function(){o.controller.abort()})}var as=null,Tp=0,Ni=0,Oi=null;function JG(o,s){if(as===null){var d=as=[];Tp=0,Ni=Dg(),Oi={status:"pending",value:void 0,then:function(h){d.push(h)}}}return Tp++,s.then(ST,ST),s}function ST(){if(--Tp===0&&as!==null){Oi!==null&&(Oi.status="fulfilled");var o=as;as=null,Ni=0,Oi=null;for(var s=0;sE?E:8;var F=I.T,$={};I.T=$,Hp(o,!1,s,d);try{var K=y(),ne=I.S;if(ne!==null&&ne($,K),K!==null&&typeof K=="object"&&typeof K.then=="function"){var be=e6(K,h);ls(o,s,be,Wn(o))}else ls(o,s,h,Wn(o))}catch(Te){ls(o,s,{then:function(){},status:"rejected",reason:Te},Wn())}finally{Y.p=E,I.T=F}}function o6(){}function jp(o,s,d,h){if(o.tag!==5)throw Error(r(476));var y=ZT(o).queue;XT(o,y,s,Q,d===null?o6:function(){return QT(o),d(h)})}function ZT(o){var s=o.memoizedState;if(s!==null)return s;s={memoizedState:Q,baseState:Q,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ua,lastRenderedState:Q},next:null};var d={};return s.next={memoizedState:d,baseState:d,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ua,lastRenderedState:d},next:null},o.memoizedState=s,o=o.alternate,o!==null&&(o.memoizedState=s),s}function QT(o){var s=ZT(o).next.queue;ls(o,s,{},Wn())}function Gp(){return mn(_s)}function JT(){return Vt().memoizedState}function e_(){return Vt().memoizedState}function i6(o){for(var s=o.return;s!==null;){switch(s.tag){case 24:case 3:var d=Wn();o=Va(d);var h=Wa(s,o,d);h!==null&&(Tn(h,s,d),cs(h,s,d)),s={cache:Ap()},o.payload=s;return}s=s.return}}function l6(o,s,d){var h=Wn();d={lane:h,revertLane:0,action:d,hasEagerState:!1,eagerState:null,next:null},ac(o)?n_(s,d):(d=yp(o,s,d,h),d!==null&&(Tn(d,o,h),r_(d,s,h)))}function t_(o,s,d){var h=Wn();ls(o,s,d,h)}function ls(o,s,d,h){var y={lane:h,revertLane:0,action:d,hasEagerState:!1,eagerState:null,next:null};if(ac(o))n_(s,y);else{var E=o.alternate;if(o.lanes===0&&(E===null||E.lanes===0)&&(E=s.lastRenderedReducer,E!==null))try{var F=s.lastRenderedState,$=E(F,d);if(y.hasEagerState=!0,y.eagerState=$,Hn($,F))return ju(o,s,y,0),Ot===null&&Uu(),!1}catch{}finally{}if(d=yp(o,s,y,h),d!==null)return Tn(d,o,h),r_(d,s,h),!0}return!1}function Hp(o,s,d,h){if(h={lane:2,revertLane:Dg(),action:h,hasEagerState:!1,eagerState:null,next:null},ac(o)){if(s)throw Error(r(479))}else s=yp(o,d,h,2),s!==null&&Tn(s,o,2)}function ac(o){var s=o.alternate;return o===ot||s!==null&&s===ot}function n_(o,s){Di=Zu=!0;var d=o.pending;d===null?s.next=s:(s.next=d.next,d.next=s),o.pending=s}function r_(o,s,d){if(d&4194176){var h=s.lanes;h&=o.pendingLanes,d|=h,s.lanes=d,Sr(o,d)}}var Ur={readContext:mn,use:ec,useCallback:Ht,useContext:Ht,useEffect:Ht,useImperativeHandle:Ht,useLayoutEffect:Ht,useInsertionEffect:Ht,useMemo:Ht,useReducer:Ht,useRef:Ht,useState:Ht,useDebugValue:Ht,useDeferredValue:Ht,useTransition:Ht,useSyncExternalStore:Ht,useId:Ht};Ur.useCacheRefresh=Ht,Ur.useMemoCache=Ht,Ur.useHostTransitionStatus=Ht,Ur.useFormState=Ht,Ur.useActionState=Ht,Ur.useOptimistic=Ht;var zo={readContext:mn,use:ec,useCallback:function(o,s){return In().memoizedState=[o,s===void 0?null:s],o},useContext:mn,useEffect:GT,useImperativeHandle:function(o,s,d){d=d!=null?d.concat([o]):null,nc(4194308,4,qT.bind(null,s,o),d)},useLayoutEffect:function(o,s){return nc(4194308,4,o,s)},useInsertionEffect:function(o,s){nc(4,2,o,s)},useMemo:function(o,s){var d=In();s=s===void 0?null:s;var h=o();if(Fo){rt(!0);try{o()}finally{rt(!1)}}return d.memoizedState=[h,s],h},useReducer:function(o,s,d){var h=In();if(d!==void 0){var y=d(s);if(Fo){rt(!0);try{d(s)}finally{rt(!1)}}}else y=s;return h.memoizedState=h.baseState=y,o={pending:null,lanes:0,dispatch:null,lastRenderedReducer:o,lastRenderedState:y},h.queue=o,o=o.dispatch=l6.bind(null,ot,o),[h.memoizedState,o]},useRef:function(o){var s=In();return o={current:o},s.memoizedState=o},useState:function(o){o=Fp(o);var s=o.queue,d=t_.bind(null,ot,s);return s.dispatch=d,[o.memoizedState,d]},useDebugValue:Bp,useDeferredValue:function(o,s){var d=In();return Up(d,o,s)},useTransition:function(){var o=Fp(!1);return o=XT.bind(null,ot,o.queue,!0,!1),In().memoizedState=o,[!1,o]},useSyncExternalStore:function(o,s,d){var h=ot,y=In();if(yt){if(d===void 0)throw Error(r(407));d=d()}else{if(d=s(),Ot===null)throw Error(r(349));ht&60||TT(h,s,d)}y.memoizedState=d;var E={value:d,getSnapshot:s};return y.queue=E,GT(RT.bind(null,h,E,o),[o]),h.flags|=2048,Li(9,_T.bind(null,h,E,d,s),{destroy:void 0},null),d},useId:function(){var o=In(),s=Ot.identifierPrefix;if(yt){var d=la,h=ia;d=(h&~(1<<32-bt(h)-1)).toString(32)+d,s=":"+s+"R"+d,d=Qu++,0 title"))),dn(E,h,d),E[hn]=o,Jt(E),h=E;break e;case"link":var F=N1("link","href",y).get(h+(d.href||""));if(F){for(var $=0;$<\/script>",o=o.removeChild(o.firstChild);break;case"select":o=typeof h.is=="string"?y.createElement("select",{is:h.is}):y.createElement("select"),h.multiple?o.multiple=!0:h.size&&(o.size=h.size);break;default:o=typeof h.is=="string"?y.createElement(d,{is:h.is}):y.createElement(d)}}o[hn]=s,o[On]=h;e:for(y=s.child;y!==null;){if(y.tag===5||y.tag===6)o.appendChild(y.stateNode);else if(y.tag!==4&&y.tag!==27&&y.child!==null){y.child.return=y,y=y.child;continue}if(y===s)break e;for(;y.sibling===null;){if(y.return===null||y.return===s)break e;y=y.return}y.sibling.return=y.return,y=y.sibling}s.stateNode=o;e:switch(dn(o,d,h),d){case"button":case"input":case"select":case"textarea":o=!!h.autoFocus;break e;case"img":o=!0;break e;default:o=!1}o&&ma(s)}}return Ft(s),s.flags&=-16777217,null;case 6:if(o&&s.stateNode!=null)o.memoizedProps!==h&&ma(s);else{if(typeof h!="string"&&s.stateNode===null)throw Error(r(166));if(o=Ie.current,Xl(s)){if(o=s.stateNode,d=s.memoizedProps,h=null,y=An,y!==null)switch(y.tag){case 27:case 5:h=y.memoizedProps}o[hn]=s,o=!!(o.nodeValue===d||h!==null&&h.suppressHydrationWarning===!0||y1(o.nodeValue,d)),o||Io(s)}else o=xc(o).createTextNode(h),o[hn]=s,s.stateNode=o}return Ft(s),null;case 13:if(h=s.memoizedState,o===null||o.memoizedState!==null&&o.memoizedState.dehydrated!==null){if(y=Xl(s),h!==null&&h.dehydrated!==null){if(o===null){if(!y)throw Error(r(318));if(y=s.memoizedState,y=y!==null?y.dehydrated:null,!y)throw Error(r(317));y[hn]=s}else Zl(),!(s.flags&128)&&(s.memoizedState=null),s.flags|=4;Ft(s),y=!1}else wr!==null&&(Ag(wr),wr=null),y=!0;if(!y)return s.flags&256?(sa(s),s):(sa(s),null)}if(sa(s),s.flags&128)return s.lanes=d,s;if(d=h!==null,o=o!==null&&o.memoizedState!==null,d){h=s.child,y=null,h.alternate!==null&&h.alternate.memoizedState!==null&&h.alternate.memoizedState.cachePool!==null&&(y=h.alternate.memoizedState.cachePool.pool);var E=null;h.memoizedState!==null&&h.memoizedState.cachePool!==null&&(E=h.memoizedState.cachePool.pool),E!==y&&(h.flags|=2048)}return d!==o&&d&&(s.child.flags|=8192),fc(s,s.updateQueue),Ft(s),null;case 4:return J(),o===null&&Fg(s.stateNode.containerInfo),Ft(s),null;case 10:return fa(s.type),Ft(s),null;case 19:if(Ae(Xt),y=s.memoizedState,y===null)return Ft(s),null;if(h=(s.flags&128)!==0,E=y.rendering,E===null)if(h)bs(y,!1);else{if(jt!==0||o!==null&&o.flags&128)for(o=s.child;o!==null;){if(E=Ku(o),E!==null){for(s.flags|=128,bs(y,!1),o=E.updateQueue,s.updateQueue=o,fc(s,o),s.subtreeFlags=0,o=d,d=s.child;d!==null;)V_(d,o),d=d.sibling;return ae(Xt,Xt.current&1|2),s.child}o=o.sibling}y.tail!==null&&he()>pc&&(s.flags|=128,h=!0,bs(y,!1),s.lanes=4194304)}else{if(!h)if(o=Ku(E),o!==null){if(s.flags|=128,h=!0,o=o.updateQueue,s.updateQueue=o,fc(s,o),bs(y,!0),y.tail===null&&y.tailMode==="hidden"&&!E.alternate&&!yt)return Ft(s),null}else 2*he()-y.renderingStartTime>pc&&d!==536870912&&(s.flags|=128,h=!0,bs(y,!1),s.lanes=4194304);y.isBackwards?(E.sibling=s.child,s.child=E):(o=y.last,o!==null?o.sibling=E:s.child=E,y.last=E)}return y.tail!==null?(s=y.tail,y.rendering=s,y.tail=s.sibling,y.renderingStartTime=he(),s.sibling=null,o=Xt.current,ae(Xt,h?o&1|2:o&1),s):(Ft(s),null);case 22:case 23:return sa(s),kp(),h=s.memoizedState!==null,o!==null?o.memoizedState!==null!==h&&(s.flags|=8192):h&&(s.flags|=8192),h?d&536870912&&!(s.flags&128)&&(Ft(s),s.subtreeFlags&6&&(s.flags|=8192)):Ft(s),d=s.updateQueue,d!==null&&fc(s,d.retryQueue),d=null,o!==null&&o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(d=o.memoizedState.cachePool.pool),h=null,s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(h=s.memoizedState.cachePool.pool),h!==d&&(s.flags|=2048),o!==null&&Ae(Mo),null;case 24:return d=null,o!==null&&(d=o.memoizedState.cache),s.memoizedState.cache!==d&&(s.flags|=2048),fa(Zt),Ft(s),null;case 25:return null}throw Error(r(156,s.tag))}function g6(o,s){switch(Sp(s),s.tag){case 1:return o=s.flags,o&65536?(s.flags=o&-65537|128,s):null;case 3:return fa(Zt),J(),o=s.flags,o&65536&&!(o&128)?(s.flags=o&-65537|128,s):null;case 26:case 27:case 5:return ke(s),null;case 13:if(sa(s),o=s.memoizedState,o!==null&&o.dehydrated!==null){if(s.alternate===null)throw Error(r(340));Zl()}return o=s.flags,o&65536?(s.flags=o&-65537|128,s):null;case 19:return Ae(Xt),null;case 4:return J(),null;case 10:return fa(s.type),null;case 22:case 23:return sa(s),kp(),o!==null&&Ae(Mo),o=s.flags,o&65536?(s.flags=o&-65537|128,s):null;case 24:return fa(Zt),null;case 25:return null;default:return null}}function K_(o,s){switch(Sp(s),s.tag){case 3:fa(Zt),J();break;case 26:case 27:case 5:ke(s);break;case 4:J();break;case 13:sa(s);break;case 19:Ae(Xt);break;case 10:fa(s.type);break;case 22:case 23:sa(s),kp(),o!==null&&Ae(Mo);break;case 24:fa(Zt)}}var h6={getCacheForType:function(o){var s=mn(Zt),d=s.data.get(o);return d===void 0&&(d=o(),s.data.set(o,d)),d}},m6=typeof WeakMap=="function"?WeakMap:Map,zt=0,Ot=null,st=null,ht=0,Dt=0,Vn=null,ba=!1,Pi=!1,yg=!1,ya=0,jt=0,Qa=0,$o=0,vg=0,dr=0,Bi=0,ys=null,jr=null,Sg=!1,Eg=0,pc=1/0,gc=null,Ja=null,hc=!1,qo=null,vs=0,wg=0,xg=null,Ss=0,kg=null;function Wn(){if(zt&2&&ht!==0)return ht&-ht;if(I.T!==null){var o=Ni;return o!==0?o:Dg()}return mA()}function X_(){dr===0&&(dr=!(ht&536870912)||yt?_t():536870912);var o=lr.current;return o!==null&&(o.flags|=32),dr}function Tn(o,s,d){(o===Ot&&Dt===2||o.cancelPendingCommit!==null)&&(Ui(o,0),va(o,ht,dr,!1)),Cn(o,d),(!(zt&2)||o!==Ot)&&(o===Ot&&(!(zt&2)&&($o|=d),jt===4&&va(o,ht,dr,!1)),Gr(o))}function Z_(o,s,d){if(zt&6)throw Error(r(327));var h=!d&&(s&60)===0&&(s&o.expiredLanes)===0||Ye(o,s),y=h?v6(o,s):Rg(o,s,!0),E=h;do{if(y===0){Pi&&!h&&va(o,s,0,!1);break}else if(y===6)va(o,s,0,!ba);else{if(d=o.current.alternate,E&&!b6(d)){y=Rg(o,s,!1),E=!1;continue}if(y===2){if(E=s,o.errorRecoveryDisabledLanes&E)var F=0;else F=o.pendingLanes&-536870913,F=F!==0?F:F&536870912?536870912:0;if(F!==0){s=F;e:{var $=o;y=ys;var K=$.current.memoizedState.isDehydrated;if(K&&(Ui($,F).flags|=256),F=Rg($,F,!1),F!==2){if(yg&&!K){$.errorRecoveryDisabledLanes|=E,$o|=E,y=4;break e}E=jr,jr=y,E!==null&&Ag(E)}y=F}if(E=!1,y!==2)continue}}if(y===1){Ui(o,0),va(o,s,0,!0);break}e:{switch(h=o,y){case 0:case 1:throw Error(r(345));case 4:if((s&4194176)===s){va(h,s,dr,!ba);break e}break;case 2:jr=null;break;case 3:case 5:break;default:throw Error(r(329))}if(h.finishedWork=d,h.finishedLanes=s,(s&62914560)===s&&(E=Eg+300-he(),10d?32:d,I.T=null,qo===null)var E=!1;else{d=xg,xg=null;var F=qo,$=vs;if(qo=null,vs=0,zt&6)throw Error(r(331));var K=zt;if(zt|=4,$_(F.current),j_(F,F.current,$,d),zt=K,Es(0,!1),Je&&typeof Je.onPostCommitFiberRoot=="function")try{Je.onPostCommitFiberRoot(pt,F)}catch{}E=!0}return E}finally{Y.p=y,I.T=h,i1(o,s)}}return!1}function l1(o,s,d){s=ar(d,s),s=Vp(o.stateNode,s,2),o=Wa(o,s,2),o!==null&&(Cn(o,2),Gr(o))}function Rt(o,s,d){if(o.tag===3)l1(o,o,d);else for(;s!==null;){if(s.tag===3){l1(s,o,d);break}else if(s.tag===1){var h=s.stateNode;if(typeof s.type.getDerivedStateFromError=="function"||typeof h.componentDidCatch=="function"&&(Ja===null||!Ja.has(h))){o=ar(d,o),d=c_(2),h=Wa(s,d,2),h!==null&&(d_(d,h,s,o),Cn(h,2),Gr(h));break}}s=s.return}}function Cg(o,s,d){var h=o.pingCache;if(h===null){h=o.pingCache=new m6;var y=new Set;h.set(s,y)}else y=h.get(s),y===void 0&&(y=new Set,h.set(s,y));y.has(d)||(yg=!0,y.add(d),o=w6.bind(null,o,s,d),s.then(o,o))}function w6(o,s,d){var h=o.pingCache;h!==null&&h.delete(s),o.pingedLanes|=o.suspendedLanes&d,o.warmLanes&=~d,Ot===o&&(ht&d)===d&&(jt===4||jt===3&&(ht&62914560)===ht&&300>he()-Eg?!(zt&2)&&Ui(o,0):vg|=d,Bi===ht&&(Bi=0)),Gr(o)}function s1(o,s){s===0&&(s=Rn()),o=Ba(o,s),o!==null&&(Cn(o,s),Gr(o))}function x6(o){var s=o.memoizedState,d=0;s!==null&&(d=s.retryLane),s1(o,d)}function k6(o,s){var d=0;switch(o.tag){case 13:var h=o.stateNode,y=o.memoizedState;y!==null&&(d=y.retryLane);break;case 19:h=o.stateNode;break;case 22:h=o.stateNode._retryCache;break;default:throw Error(r(314))}h!==null&&h.delete(s),s1(o,d)}function A6(o,s){return ve(o,s)}var yc=null,Hi=null,Ng=!1,vc=!1,Og=!1,Vo=0;function Gr(o){o!==Hi&&o.next===null&&(Hi===null?yc=Hi=o:Hi=Hi.next=o),vc=!0,Ng||(Ng=!0,_6(T6))}function Es(o,s){if(!Og&&vc){Og=!0;do for(var d=!1,h=yc;h!==null;){if(o!==0){var y=h.pendingLanes;if(y===0)var E=0;else{var F=h.suspendedLanes,$=h.pingedLanes;E=(1<<31-bt(42|o)+1)-1,E&=y&~(F&~$),E=E&201326677?E&201326677|1:E?E|2:0}E!==0&&(d=!0,d1(h,E))}else E=ht,E=na(h,h===Ot?E:0),!(E&3)||Ye(h,E)||(d=!0,d1(h,E));h=h.next}while(d);Og=!1}}function T6(){vc=Ng=!1;var o=0;Vo!==0&&(M6()&&(o=Vo),Vo=0);for(var s=he(),d=null,h=yc;h!==null;){var y=h.next,E=u1(h,s);E===0?(h.next=null,d===null?yc=y:d.next=y,y===null&&(Hi=d)):(d=h,(o!==0||E&3)&&(vc=!0)),h=y}Es(o)}function u1(o,s){for(var d=o.suspendedLanes,h=o.pingedLanes,y=o.expirationTimes,E=o.pendingLanes&-62914561;0"u"?null:document;function T1(o,s,d){var h=qi;if(h&&typeof s=="string"&&s){var y=nr(s);y='link[rel="'+o+'"][href="'+y+'"]',typeof d=="string"&&(y+='[crossorigin="'+d+'"]'),A1.has(y)||(A1.add(y),o={rel:o,crossOrigin:d,href:s},h.querySelector(y)===null&&(s=h.createElement("link"),dn(s,"link",o),Jt(s),h.head.appendChild(s)))}}function H6(o){Sa.D(o),T1("dns-prefetch",o,null)}function $6(o,s){Sa.C(o,s),T1("preconnect",o,s)}function q6(o,s,d){Sa.L(o,s,d);var h=qi;if(h&&o&&s){var y='link[rel="preload"][as="'+nr(s)+'"]';s==="image"&&d&&d.imageSrcSet?(y+='[imagesrcset="'+nr(d.imageSrcSet)+'"]',typeof d.imageSizes=="string"&&(y+='[imagesizes="'+nr(d.imageSizes)+'"]')):y+='[href="'+nr(o)+'"]';var E=y;switch(s){case"style":E=Vi(o);break;case"script":E=Wi(o)}fr.has(E)||(o=M({rel:"preload",href:s==="image"&&d&&d.imageSrcSet?void 0:o,as:s},d),fr.set(E,o),h.querySelector(y)!==null||s==="style"&&h.querySelector(ks(E))||s==="script"&&h.querySelector(As(E))||(s=h.createElement("link"),dn(s,"link",o),Jt(s),h.head.appendChild(s)))}}function V6(o,s){Sa.m(o,s);var d=qi;if(d&&o){var h=s&&typeof s.as=="string"?s.as:"script",y='link[rel="modulepreload"][as="'+nr(h)+'"][href="'+nr(o)+'"]',E=y;switch(h){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":E=Wi(o)}if(!fr.has(E)&&(o=M({rel:"modulepreload",href:o},s),fr.set(E,o),d.querySelector(y)===null)){switch(h){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(d.querySelector(As(E)))return}h=d.createElement("link"),dn(h,"link",o),Jt(h),d.head.appendChild(h)}}}function W6(o,s,d){Sa.S(o,s,d);var h=qi;if(h&&o){var y=hi(h).hoistableStyles,E=Vi(o);s=s||"default";var F=y.get(E);if(!F){var $={loading:0,preload:null};if(F=h.querySelector(ks(E)))$.loading=5;else{o=M({rel:"stylesheet",href:o,"data-precedence":s},d),(d=fr.get(E))&&qg(o,d);var K=F=h.createElement("link");Jt(K),dn(K,"link",o),K._p=new Promise(function(ne,be){K.onload=ne,K.onerror=be}),K.addEventListener("load",function(){$.loading|=1}),K.addEventListener("error",function(){$.loading|=2}),$.loading|=4,Ac(F,s,h)}F={type:"stylesheet",instance:F,count:1,state:$},y.set(E,F)}}}function Y6(o,s){Sa.X(o,s);var d=qi;if(d&&o){var h=hi(d).hoistableScripts,y=Wi(o),E=h.get(y);E||(E=d.querySelector(As(y)),E||(o=M({src:o,async:!0},s),(s=fr.get(y))&&Vg(o,s),E=d.createElement("script"),Jt(E),dn(E,"link",o),d.head.appendChild(E)),E={type:"script",instance:E,count:1,state:null},h.set(y,E))}}function K6(o,s){Sa.M(o,s);var d=qi;if(d&&o){var h=hi(d).hoistableScripts,y=Wi(o),E=h.get(y);E||(E=d.querySelector(As(y)),E||(o=M({src:o,async:!0,type:"module"},s),(s=fr.get(y))&&Vg(o,s),E=d.createElement("script"),Jt(E),dn(E,"link",o),d.head.appendChild(E)),E={type:"script",instance:E,count:1,state:null},h.set(y,E))}}function _1(o,s,d,h){var y=(y=Ie.current)?kc(y):null;if(!y)throw Error(r(446));switch(o){case"meta":case"title":return null;case"style":return typeof d.precedence=="string"&&typeof d.href=="string"?(s=Vi(d.href),d=hi(y).hoistableStyles,h=d.get(s),h||(h={type:"style",instance:null,count:0,state:null},d.set(s,h)),h):{type:"void",instance:null,count:0,state:null};case"link":if(d.rel==="stylesheet"&&typeof d.href=="string"&&typeof d.precedence=="string"){o=Vi(d.href);var E=hi(y).hoistableStyles,F=E.get(o);if(F||(y=y.ownerDocument||y,F={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},E.set(o,F),(E=y.querySelector(ks(o)))&&!E._p&&(F.instance=E,F.state.loading=5),fr.has(o)||(d={rel:"preload",as:"style",href:d.href,crossOrigin:d.crossOrigin,integrity:d.integrity,media:d.media,hrefLang:d.hrefLang,referrerPolicy:d.referrerPolicy},fr.set(o,d),E||X6(y,o,d,F.state))),s&&h===null)throw Error(r(528,""));return F}if(s&&h!==null)throw Error(r(529,""));return null;case"script":return s=d.async,d=d.src,typeof d=="string"&&s&&typeof s!="function"&&typeof s!="symbol"?(s=Wi(d),d=hi(y).hoistableScripts,h=d.get(s),h||(h={type:"script",instance:null,count:0,state:null},d.set(s,h)),h):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,o))}}function Vi(o){return'href="'+nr(o)+'"'}function ks(o){return'link[rel="stylesheet"]['+o+"]"}function R1(o){return M({},o,{"data-precedence":o.precedence,precedence:null})}function X6(o,s,d,h){o.querySelector('link[rel="preload"][as="style"]['+s+"]")?h.loading=1:(s=o.createElement("link"),h.preload=s,s.addEventListener("load",function(){return h.loading|=1}),s.addEventListener("error",function(){return h.loading|=2}),dn(s,"link",d),Jt(s),o.head.appendChild(s))}function Wi(o){return'[src="'+nr(o)+'"]'}function As(o){return"script[async]"+o}function C1(o,s,d){if(s.count++,s.instance===null)switch(s.type){case"style":var h=o.querySelector('style[data-href~="'+nr(d.href)+'"]');if(h)return s.instance=h,Jt(h),h;var y=M({},d,{"data-href":d.href,"data-precedence":d.precedence,href:null,precedence:null});return h=(o.ownerDocument||o).createElement("style"),Jt(h),dn(h,"style",y),Ac(h,d.precedence,o),s.instance=h;case"stylesheet":y=Vi(d.href);var E=o.querySelector(ks(y));if(E)return s.state.loading|=4,s.instance=E,Jt(E),E;h=R1(d),(y=fr.get(y))&&qg(h,y),E=(o.ownerDocument||o).createElement("link"),Jt(E);var F=E;return F._p=new Promise(function($,K){F.onload=$,F.onerror=K}),dn(E,"link",h),s.state.loading|=4,Ac(E,d.precedence,o),s.instance=E;case"script":return E=Wi(d.src),(y=o.querySelector(As(E)))?(s.instance=y,Jt(y),y):(h=d,(y=fr.get(E))&&(h=M({},d),Vg(h,y)),o=o.ownerDocument||o,y=o.createElement("script"),Jt(y),dn(y,"link",h),o.head.appendChild(y),s.instance=y);case"void":return null;default:throw Error(r(443,s.type))}else s.type==="stylesheet"&&!(s.state.loading&4)&&(h=s.instance,s.state.loading|=4,Ac(h,d.precedence,o));return s.instance}function Ac(o,s,d){for(var h=d.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),y=h.length?h[h.length-1]:null,E=y,F=0;F title"):null)}function Z6(o,s,d){if(d===1||s.itemProp!=null)return!1;switch(o){case"meta":case"title":return!0;case"style":if(typeof s.precedence!="string"||typeof s.href!="string"||s.href==="")break;return!0;case"link":if(typeof s.rel!="string"||typeof s.href!="string"||s.href===""||s.onLoad||s.onError)break;switch(s.rel){case"stylesheet":return o=s.disabled,typeof s.precedence=="string"&&o==null;default:return!0}case"script":if(s.async&&typeof s.async!="function"&&typeof s.async!="symbol"&&!s.onLoad&&!s.onError&&s.src&&typeof s.src=="string")return!0}return!1}function D1(o){return!(o.type==="stylesheet"&&!(o.state.loading&3))}var Ts=null;function Q6(){}function J6(o,s,d){if(Ts===null)throw Error(r(475));var h=Ts;if(s.type==="stylesheet"&&(typeof d.media!="string"||matchMedia(d.media).matches!==!1)&&!(s.state.loading&4)){if(s.instance===null){var y=Vi(d.href),E=o.querySelector(ks(y));if(E){o=E._p,o!==null&&typeof o=="object"&&typeof o.then=="function"&&(h.count++,h=_c.bind(h),o.then(h,h)),s.state.loading|=4,s.instance=E,Jt(E);return}E=o.ownerDocument||o,d=R1(d),(y=fr.get(y))&&qg(d,y),E=E.createElement("link"),Jt(E);var F=E;F._p=new Promise(function($,K){F.onload=$,F.onerror=K}),dn(E,"link",d),s.instance=E}h.stylesheets===null&&(h.stylesheets=new Map),h.stylesheets.set(s,o),(o=s.state.preload)&&!(s.state.loading&3)&&(h.count++,s=_c.bind(h),o.addEventListener("load",s),o.addEventListener("error",s))}}function eH(){if(Ts===null)throw Error(r(475));var o=Ts;return o.stylesheets&&o.count===0&&Wg(o,o.stylesheets),0"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),nh.exports=EH(),nh.exports}var xH=wH();const eR=e=>{let t;const n=new Set,r=(f,p)=>{const g=typeof f=="function"?f(t):f;if(!Object.is(g,t)){const b=t;t=p??(typeof g!="object"||g===null)?g:Object.assign({},t,g),n.forEach(m=>m(t,b))}},a=()=>t,u={setState:r,getState:a,getInitialState:()=>c,subscribe:f=>(n.add(f),()=>n.delete(f))},c=t=e(r,a,u);return u},kH=e=>e?eR(e):eR,AH=e=>e;function TH(e,t=AH){const n=ye.useSyncExternalStore(e.subscribe,()=>t(e.getState()),()=>t(e.getInitialState()));return ye.useDebugValue(n),n}const _H=e=>{const t=kH(e),n=r=>TH(t,r);return Object.assign(n,t),n},wk=e=>_H;function bz(e,t){let n;try{n=e()}catch{return}return{getItem:a=>{var i;const l=c=>c===null?null:JSON.parse(c,void 0),u=(i=n.getItem(a))!=null?i:null;return u instanceof Promise?u.then(l):l(u)},setItem:(a,i)=>n.setItem(a,JSON.stringify(i,void 0)),removeItem:a=>n.removeItem(a)}}const dx=e=>t=>{try{const n=e(t);return n instanceof Promise?n:{then(r){return dx(r)(n)},catch(r){return this}}}catch(n){return{then(r){return this},catch(r){return dx(r)(n)}}}},RH=(e,t)=>(n,r,a)=>{let i={storage:bz(()=>localStorage),partialize:v=>v,version:0,merge:(v,A)=>({...A,...v}),...t},l=!1;const u=new Set,c=new Set;let f=i.storage;if(!f)return e((...v)=>{console.warn(`[zustand persist middleware] Unable to update item '${i.name}', the given storage is currently unavailable.`),n(...v)},r,a);const p=()=>{const v=i.partialize({...r()});return f.setItem(i.name,{state:v,version:i.version})},g=a.setState;a.setState=(v,A)=>{g(v,A),p()};const b=e((...v)=>{n(...v),p()},r,a);a.getInitialState=()=>b;let m;const S=()=>{var v,A;if(!f)return;l=!1,u.forEach(x=>{var _;return x((_=r())!=null?_:b)});const R=((A=i.onRehydrateStorage)==null?void 0:A.call(i,(v=r())!=null?v:b))||void 0;return dx(f.getItem.bind(f))(i.name).then(x=>{if(x)if(typeof x.version=="number"&&x.version!==i.version){if(i.migrate){const _=i.migrate(x.state,x.version);return _ instanceof Promise?_.then(C=>[!0,C]):[!0,_]}console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,x.state];return[!1,void 0]}).then(x=>{var _;const[C,N]=x;if(m=i.merge(N,(_=r())!=null?_:b),n(m,!0),C)return p()}).then(()=>{R==null||R(m,void 0),m=r(),l=!0,c.forEach(x=>x(m))}).catch(x=>{R==null||R(void 0,x)})};return a.persist={setOptions:v=>{i={...i,...v},v.storage&&(f=v.storage)},clearStorage:()=>{f==null||f.removeItem(i.name)},getOptions:()=>i,rehydrate:()=>S(),hasHydrated:()=>l,onHydrate:v=>(u.add(v),()=>{u.delete(v)}),onFinishHydration:v=>(c.add(v),()=>{c.delete(v)})},i.skipHydration||S(),m||b},CH=RH;function yz(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var a=e.length;for(t=0;t{const t=DH(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:l=>{const u=l.split(xk);return u[0]===""&&u.length!==1&&u.shift(),Sz(u,t)||OH(l)},getConflictingClassGroupIds:(l,u)=>{const c=n[l]||[];return u&&r[l]?[...c,...r[l]]:c}}},Sz=(e,t)=>{var l;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),a=r?Sz(e.slice(1),r):void 0;if(a)return a;if(t.validators.length===0)return;const i=e.join(xk);return(l=t.validators.find(({validator:u})=>u(i)))==null?void 0:l.classGroupId},tR=/^\[(.+)\]$/,OH=e=>{if(tR.test(e)){const t=tR.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},DH=e=>{const{theme:t,classGroups:n}=e,r={nextPart:new Map,validators:[]};for(const a in n)fx(n[a],r,a,t);return r},fx=(e,t,n,r)=>{e.forEach(a=>{if(typeof a=="string"){const i=a===""?t:nR(t,a);i.classGroupId=n;return}if(typeof a=="function"){if(IH(a)){fx(a(r),t,n,r);return}t.validators.push({validator:a,classGroupId:n});return}Object.entries(a).forEach(([i,l])=>{fx(l,nR(t,i),n,r)})})},nR=(e,t)=>{let n=e;return t.split(xk).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},IH=e=>e.isThemeGetter,LH=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const a=(i,l)=>{n.set(i,l),t++,t>e&&(t=0,r=n,n=new Map)};return{get(i){let l=n.get(i);if(l!==void 0)return l;if((l=r.get(i))!==void 0)return a(i,l),l},set(i,l){n.has(i)?n.set(i,l):a(i,l)}}},px="!",gx=":",MH=gx.length,FH=e=>{const{prefix:t,experimentalParseClassName:n}=e;let r=a=>{const i=[];let l=0,u=0,c=0,f;for(let S=0;Sc?f-c:void 0;return{modifiers:i,hasImportantModifier:b,baseClassName:g,maybePostfixModifierPosition:m}};if(t){const a=t+gx,i=r;r=l=>l.startsWith(a)?i(l.substring(a.length)):{isExternal:!0,modifiers:[],hasImportantModifier:!1,baseClassName:l,maybePostfixModifierPosition:void 0}}if(n){const a=r;r=i=>n({className:i,parseClassName:a})}return r},zH=e=>e.endsWith(px)?e.substring(0,e.length-1):e.startsWith(px)?e.substring(1):e,PH=e=>{const t=Object.fromEntries(e.orderSensitiveModifiers.map(r=>[r,!0]));return r=>{if(r.length<=1)return r;const a=[];let i=[];return r.forEach(l=>{l[0]==="["||t[l]?(a.push(...i.sort(),l),i=[]):i.push(l)}),a.push(...i.sort()),a}},BH=e=>({cache:LH(e.cacheSize),parseClassName:FH(e),sortModifiers:PH(e),...NH(e)}),UH=/\s+/,jH=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:a,sortModifiers:i}=t,l=[],u=e.trim().split(UH);let c="";for(let f=u.length-1;f>=0;f-=1){const p=u[f],{isExternal:g,modifiers:b,hasImportantModifier:m,baseClassName:S,maybePostfixModifierPosition:v}=n(p);if(g){c=p+(c.length>0?" "+c:c);continue}let A=!!v,R=r(A?S.substring(0,v):S);if(!R){if(!A){c=p+(c.length>0?" "+c:c);continue}if(R=r(S),!R){c=p+(c.length>0?" "+c:c);continue}A=!1}const x=i(b).join(":"),_=m?x+px:x,C=_+R;if(l.includes(C))continue;l.push(C);const N=a(R,A);for(let T=0;T0?" "+c:c)}return c};function GH(){let e=0,t,n,r="";for(;e{if(typeof e=="string")return e;let t,n="";for(let r=0;rg(p),e());return n=BH(f),r=n.cache.get,a=n.cache.set,i=u,u(c)}function u(c){const f=r(c);if(f)return f;const p=jH(c,n);return a(c,p),p}return function(){return i(GH.apply(null,arguments))}}const rn=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},wz=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,xz=/^\((?:(\w[\w-]*):)?(.+)\)$/i,$H=/^\d+\/\d+$/,qH=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,VH=/\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$/,WH=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,YH=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,KH=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Yi=e=>$H.test(e),ct=e=>!!e&&!Number.isNaN(Number(e)),Wo=e=>!!e&&Number.isInteger(Number(e)),rR=e=>e.endsWith("%")&&ct(e.slice(0,-1)),oo=e=>qH.test(e),XH=()=>!0,ZH=e=>VH.test(e)&&!WH.test(e),kk=()=>!1,QH=e=>YH.test(e),JH=e=>KH.test(e),e9=e=>!je(e)&&!Ge(e),t9=e=>xl(e,Tz,kk),je=e=>wz.test(e),Yo=e=>xl(e,_z,ZH),ih=e=>xl(e,f9,ct),n9=e=>xl(e,kz,kk),r9=e=>xl(e,Az,JH),a9=e=>xl(e,kk,QH),Ge=e=>xz.test(e),Fc=e=>kl(e,_z),o9=e=>kl(e,p9),i9=e=>kl(e,kz),l9=e=>kl(e,Tz),s9=e=>kl(e,Az),u9=e=>kl(e,g9,!0),xl=(e,t,n)=>{const r=wz.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},kl=(e,t,n=!1)=>{const r=xz.exec(e);return r?r[1]?t(r[1]):n:!1},kz=e=>e==="position",c9=new Set(["image","url"]),Az=e=>c9.has(e),d9=new Set(["length","size","percentage"]),Tz=e=>d9.has(e),_z=e=>e==="length",f9=e=>e==="number",p9=e=>e==="family-name",g9=e=>e==="shadow",h9=()=>{const e=rn("color"),t=rn("font"),n=rn("text"),r=rn("font-weight"),a=rn("tracking"),i=rn("leading"),l=rn("breakpoint"),u=rn("container"),c=rn("spacing"),f=rn("radius"),p=rn("shadow"),g=rn("inset-shadow"),b=rn("drop-shadow"),m=rn("blur"),S=rn("perspective"),v=rn("aspect"),A=rn("ease"),R=rn("animate"),x=()=>["auto","avoid","all","avoid-page","page","left","right","column"],_=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],C=()=>["auto","hidden","clip","visible","scroll"],N=()=>["auto","contain","none"],T=()=>[Ge,je,c],O=()=>[Yi,"full","auto",...T()],z=()=>[Wo,"none","subgrid",Ge,je],I=()=>["auto",{span:["full",Wo,Ge,je]},Ge,je],M=()=>[Wo,"auto",Ge,je],H=()=>["auto","min","max","fr",Ge,je],q=()=>["start","end","center","between","around","evenly","stretch","baseline"],U=()=>["start","end","center","stretch"],W=()=>["auto",...T()],Z=()=>[Yi,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...T()],j=()=>[e,Ge,je],G=()=>[rR,Yo],P=()=>["","none","full",f,Ge,je],X=()=>["",ct,Fc,Yo],D=()=>["solid","dashed","dotted","double"],V=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],B=()=>["","none",m,Ge,je],L=()=>["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",Ge,je],Y=()=>["none",ct,Ge,je],Q=()=>["none",ct,Ge,je],se=()=>[ct,Ge,je],re=()=>[Yi,"full",...T()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[oo],breakpoint:[oo],color:[XH],container:[oo],"drop-shadow":[oo],ease:["in","out","in-out"],font:[e9],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[oo],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[oo],shadow:[oo],spacing:["px",ct],text:[oo],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Yi,je,Ge,v]}],container:["container"],columns:[{columns:[ct,je,Ge,u]}],"break-after":[{"break-after":x()}],"break-before":[{"break-before":x()}],"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:[..._(),je,Ge]}],overflow:[{overflow:C()}],"overflow-x":[{"overflow-x":C()}],"overflow-y":[{"overflow-y":C()}],overscroll:[{overscroll:N()}],"overscroll-x":[{"overscroll-x":N()}],"overscroll-y":[{"overscroll-y":N()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:O()}],"inset-x":[{"inset-x":O()}],"inset-y":[{"inset-y":O()}],start:[{start:O()}],end:[{end:O()}],top:[{top:O()}],right:[{right:O()}],bottom:[{bottom:O()}],left:[{left:O()}],visibility:["visible","invisible","collapse"],z:[{z:[Wo,"auto",Ge,je]}],basis:[{basis:[Yi,"full","auto",u,...T()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[ct,Yi,"auto","initial","none",je]}],grow:[{grow:["",ct,Ge,je]}],shrink:[{shrink:["",ct,Ge,je]}],order:[{order:[Wo,"first","last","none",Ge,je]}],"grid-cols":[{"grid-cols":z()}],"col-start-end":[{col:I()}],"col-start":[{"col-start":M()}],"col-end":[{"col-end":M()}],"grid-rows":[{"grid-rows":z()}],"row-start-end":[{row:I()}],"row-start":[{"row-start":M()}],"row-end":[{"row-end":M()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":H()}],"auto-rows":[{"auto-rows":H()}],gap:[{gap:T()}],"gap-x":[{"gap-x":T()}],"gap-y":[{"gap-y":T()}],"justify-content":[{justify:[...q(),"normal"]}],"justify-items":[{"justify-items":[...U(),"normal"]}],"justify-self":[{"justify-self":["auto",...U()]}],"align-content":[{content:["normal",...q()]}],"align-items":[{items:[...U(),"baseline"]}],"align-self":[{self:["auto",...U(),"baseline"]}],"place-content":[{"place-content":q()}],"place-items":[{"place-items":[...U(),"baseline"]}],"place-self":[{"place-self":["auto",...U()]}],p:[{p:T()}],px:[{px:T()}],py:[{py:T()}],ps:[{ps:T()}],pe:[{pe:T()}],pt:[{pt:T()}],pr:[{pr:T()}],pb:[{pb:T()}],pl:[{pl:T()}],m:[{m:W()}],mx:[{mx:W()}],my:[{my:W()}],ms:[{ms:W()}],me:[{me:W()}],mt:[{mt:W()}],mr:[{mr:W()}],mb:[{mb:W()}],ml:[{ml:W()}],"space-x":[{"space-x":T()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":T()}],"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:[l]},...Z()]}],h:[{h:["screen",...Z()]}],"min-h":[{"min-h":["screen","none",...Z()]}],"max-h":[{"max-h":["screen",...Z()]}],"font-size":[{text:["base",n,Fc,Yo]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,Ge,ih]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",rR,je]}],"font-family":[{font:[o9,je,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:[a,Ge,je]}],"line-clamp":[{"line-clamp":[ct,"none",Ge,ih]}],leading:[{leading:[i,...T()]}],"list-image":[{"list-image":["none",Ge,je]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Ge,je]}],"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:[...D(),"wavy"]}],"text-decoration-thickness":[{decoration:[ct,"from-font","auto",Ge,Yo]}],"text-decoration-color":[{decoration:j()}],"underline-offset":[{"underline-offset":[ct,"auto",Ge,je]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:T()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Ge,je]}],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",Ge,je]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[..._(),i9,n9]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","space","round"]}]}],"bg-size":[{bg:["auto","cover","contain",l9,t9]}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Wo,Ge,je],radial:["",Ge,je],conic:[Wo,Ge,je]},s9,r9]}],"bg-color":[{bg:j()}],"gradient-from-pos":[{from:G()}],"gradient-via-pos":[{via:G()}],"gradient-to-pos":[{to:G()}],"gradient-from":[{from:j()}],"gradient-via":[{via:j()}],"gradient-to":[{to:j()}],rounded:[{rounded:P()}],"rounded-s":[{"rounded-s":P()}],"rounded-e":[{"rounded-e":P()}],"rounded-t":[{"rounded-t":P()}],"rounded-r":[{"rounded-r":P()}],"rounded-b":[{"rounded-b":P()}],"rounded-l":[{"rounded-l":P()}],"rounded-ss":[{"rounded-ss":P()}],"rounded-se":[{"rounded-se":P()}],"rounded-ee":[{"rounded-ee":P()}],"rounded-es":[{"rounded-es":P()}],"rounded-tl":[{"rounded-tl":P()}],"rounded-tr":[{"rounded-tr":P()}],"rounded-br":[{"rounded-br":P()}],"rounded-bl":[{"rounded-bl":P()}],"border-w":[{border:X()}],"border-w-x":[{"border-x":X()}],"border-w-y":[{"border-y":X()}],"border-w-s":[{"border-s":X()}],"border-w-e":[{"border-e":X()}],"border-w-t":[{"border-t":X()}],"border-w-r":[{"border-r":X()}],"border-w-b":[{"border-b":X()}],"border-w-l":[{"border-l":X()}],"divide-x":[{"divide-x":X()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":X()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...D(),"hidden","none"]}],"divide-style":[{divide:[...D(),"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:[...D(),"none","hidden"]}],"outline-offset":[{"outline-offset":[ct,Ge,je]}],"outline-w":[{outline:["",ct,Fc,Yo]}],"outline-color":[{outline:[e]}],shadow:[{shadow:["","none",p,u9,a9]}],"shadow-color":[{shadow:j()}],"inset-shadow":[{"inset-shadow":["none",Ge,je,g]}],"inset-shadow-color":[{"inset-shadow":j()}],"ring-w":[{ring:X()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:j()}],"ring-offset-w":[{"ring-offset":[ct,Yo]}],"ring-offset-color":[{"ring-offset":j()}],"inset-ring-w":[{"inset-ring":X()}],"inset-ring-color":[{"inset-ring":j()}],opacity:[{opacity:[ct,Ge,je]}],"mix-blend":[{"mix-blend":[...V(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":V()}],filter:[{filter:["","none",Ge,je]}],blur:[{blur:B()}],brightness:[{brightness:[ct,Ge,je]}],contrast:[{contrast:[ct,Ge,je]}],"drop-shadow":[{"drop-shadow":["","none",b,Ge,je]}],grayscale:[{grayscale:["",ct,Ge,je]}],"hue-rotate":[{"hue-rotate":[ct,Ge,je]}],invert:[{invert:["",ct,Ge,je]}],saturate:[{saturate:[ct,Ge,je]}],sepia:[{sepia:["",ct,Ge,je]}],"backdrop-filter":[{"backdrop-filter":["","none",Ge,je]}],"backdrop-blur":[{"backdrop-blur":B()}],"backdrop-brightness":[{"backdrop-brightness":[ct,Ge,je]}],"backdrop-contrast":[{"backdrop-contrast":[ct,Ge,je]}],"backdrop-grayscale":[{"backdrop-grayscale":["",ct,Ge,je]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[ct,Ge,je]}],"backdrop-invert":[{"backdrop-invert":["",ct,Ge,je]}],"backdrop-opacity":[{"backdrop-opacity":[ct,Ge,je]}],"backdrop-saturate":[{"backdrop-saturate":[ct,Ge,je]}],"backdrop-sepia":[{"backdrop-sepia":["",ct,Ge,je]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":T()}],"border-spacing-x":[{"border-spacing-x":T()}],"border-spacing-y":[{"border-spacing-y":T()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",Ge,je]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[ct,"initial",Ge,je]}],ease:[{ease:["linear","initial",A,Ge,je]}],delay:[{delay:[ct,Ge,je]}],animate:[{animate:["none",R,Ge,je]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[S,Ge,je]}],"perspective-origin":[{"perspective-origin":L()}],rotate:[{rotate:Y()}],"rotate-x":[{"rotate-x":Y()}],"rotate-y":[{"rotate-y":Y()}],"rotate-z":[{"rotate-z":Y()}],scale:[{scale:Q()}],"scale-x":[{"scale-x":Q()}],"scale-y":[{"scale-y":Q()}],"scale-z":[{"scale-z":Q()}],"scale-3d":["scale-3d"],skew:[{skew:se()}],"skew-x":[{"skew-x":se()}],"skew-y":[{"skew-y":se()}],transform:[{transform:[Ge,je,"","none","gpu","cpu"]}],"transform-origin":[{origin:L()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:re()}],"translate-x":[{"translate-x":re()}],"translate-y":[{"translate-y":re()}],"translate-z":[{"translate-z":re()}],"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",Ge,je]}],"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":T()}],"scroll-mx":[{"scroll-mx":T()}],"scroll-my":[{"scroll-my":T()}],"scroll-ms":[{"scroll-ms":T()}],"scroll-me":[{"scroll-me":T()}],"scroll-mt":[{"scroll-mt":T()}],"scroll-mr":[{"scroll-mr":T()}],"scroll-mb":[{"scroll-mb":T()}],"scroll-ml":[{"scroll-ml":T()}],"scroll-p":[{"scroll-p":T()}],"scroll-px":[{"scroll-px":T()}],"scroll-py":[{"scroll-py":T()}],"scroll-ps":[{"scroll-ps":T()}],"scroll-pe":[{"scroll-pe":T()}],"scroll-pt":[{"scroll-pt":T()}],"scroll-pr":[{"scroll-pr":T()}],"scroll-pb":[{"scroll-pb":T()}],"scroll-pl":[{"scroll-pl":T()}],"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",Ge,je]}],fill:[{fill:["none",...j()]}],"stroke-w":[{stroke:[ct,Fc,Yo,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","*","**"]}},m9=HH(h9);function Me(...e){return m9(vz(e))}function b9(){const e="0123456789abcdef";let t="#";for(let n=0;n<6;n++)t+=e.charAt(Math.floor(Math.random()*16));return t}function Nr(e){return e instanceof Error?e.message:`${e}`}const Ak=e=>{const t=e;t.use={};for(const n of Object.keys(t.getState()))t.use[n]=()=>t(r=>r[n]);return t},Rz="",Yr="ghost",y9="#B2EBF2",v9="#000",S9="#E2E2E2",E9="#EEEEEE",w9="#F57F17",x9="#969696",k9="#F57F17",aR="#B2EBF2",lh=20,sh=40,oR=4,A9=20,T9=15,iR="*",_9={"text/plain":[".txt",".md",".html",".htm",".tex",".json",".xml",".yaml",".yml",".rtf",".odt",".epub",".csv",".log",".conf",".ini",".properties",".sql",".bat",".sh",".c",".cpp",".py",".java",".js",".ts",".swift",".go",".rb",".php",".css",".scss",".less"],"application/pdf":[".pdf"],"application/msword":[".doc"],"application/vnd.openxmlformats-officedocument.wordprocessingml.document":[".docx"],"application/vnd.openxmlformats-officedocument.presentationml.presentation":[".pptx"]},lR={name:"LightRAG",github:"https://github.com/HKUDS/LightRAG"},R9=wk()(CH(e=>({theme:"system",showPropertyPanel:!0,showNodeSearchBar:!0,showNodeLabel:!0,enableNodeDrag:!0,showEdgeLabel:!1,enableHideUnselectedEdges:!0,enableEdgeEvents:!1,graphQueryMaxDepth:3,graphLayoutMaxIterations:10,queryLabel:iR,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}),setGraphLayoutMaxIterations:t=>e({graphLayoutMaxIterations:t}),setQueryLabel:t=>e({queryLabel:t}),setGraphQueryMaxDepth:t=>e({graphQueryMaxDepth: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:bz(()=>localStorage),version:7,migrate:(e,t)=>(t<2&&(e.showEdgeLabel=!1),t<3&&(e.queryLabel=iR),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=[]),t<7&&(e.graphQueryMaxDepth=3,e.graphLayoutMaxIterations=10),e)})),Ke=Ak(R9),C9={theme:"system",setTheme:()=>null},Cz=k.createContext(C9);function N9({children:e,...t}){const[n,r]=k.useState(Ke.getState().theme);k.useEffect(()=>{const i=window.document.documentElement;if(i.classList.remove("light","dark"),n==="system"){const l=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";i.classList.add(l),r(l);return}i.classList.add(n)},[n]);const a={theme:n,setTheme:i=>{Ke.getState().setTheme(i),r(i)}};return w.jsx(Cz.Provider,{...t,value:a,children:e})}const sR=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,uR=vz,Nz=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return uR(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:a,defaultVariants:i}=t,l=Object.keys(a).map(f=>{const p=n==null?void 0:n[f],g=i==null?void 0:i[f];if(p===null)return null;const b=sR(p)||sR(g);return a[f][b]}),u=n&&Object.entries(n).reduce((f,p)=>{let[g,b]=p;return b===void 0||(f[g]=b),f},{}),c=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((f,p)=>{let{class:g,className:b,...m}=p;return Object.entries(m).every(S=>{let[v,A]=S;return Array.isArray(A)?A.includes({...i,...u}[v]):{...i,...u}[v]===A})?[...f,g,b]:f},[]);return uR(e,l,c,n==null?void 0:n.class,n==null?void 0:n.className)},O9=Nz("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"}}),Oz=k.forwardRef(({className:e,variant:t,...n},r)=>w.jsx("div",{ref:r,role:"alert",className:Me(O9({variant:t}),e),...n}));Oz.displayName="Alert";const Dz=k.forwardRef(({className:e,...t},n)=>w.jsx("h5",{ref:n,className:Me("mb-1 leading-none font-medium tracking-tight",e),...t}));Dz.displayName="AlertTitle";const Iz=k.forwardRef(({className:e,...t},n)=>w.jsx("div",{ref:n,className:Me("text-sm [&_p]:leading-relaxed",e),...t}));Iz.displayName="AlertDescription";function Lz(e,t){return function(){return e.apply(t,arguments)}}const{toString:D9}=Object.prototype,{getPrototypeOf:Tk}=Object,rf=(e=>t=>{const n=D9.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),Lr=e=>(e=e.toLowerCase(),t=>rf(t)===e),af=e=>t=>typeof t===e,{isArray:Al}=Array,Qs=af("undefined");function I9(e){return e!==null&&!Qs(e)&&e.constructor!==null&&!Qs(e.constructor)&&Xn(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const Mz=Lr("ArrayBuffer");function L9(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&Mz(e.buffer),t}const M9=af("string"),Xn=af("function"),Fz=af("number"),of=e=>e!==null&&typeof e=="object",F9=e=>e===!0||e===!1,fd=e=>{if(rf(e)!=="object")return!1;const t=Tk(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)},z9=Lr("Date"),P9=Lr("File"),B9=Lr("Blob"),U9=Lr("FileList"),j9=e=>of(e)&&Xn(e.pipe),G9=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||Xn(e.append)&&((t=rf(e))==="formdata"||t==="object"&&Xn(e.toString)&&e.toString()==="[object FormData]"))},H9=Lr("URLSearchParams"),[$9,q9,V9,W9]=["ReadableStream","Request","Response","Headers"].map(Lr),Y9=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function du(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let r,a;if(typeof e!="object"&&(e=[e]),Al(e))for(r=0,a=e.length;r0;)if(a=n[r],t===a.toLowerCase())return a;return null}const ti=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,Pz=e=>!Qs(e)&&e!==ti;function hx(){const{caseless:e}=Pz(this)&&this||{},t={},n=(r,a)=>{const i=e&&zz(t,a)||a;fd(t[i])&&fd(r)?t[i]=hx(t[i],r):fd(r)?t[i]=hx({},r):Al(r)?t[i]=r.slice():t[i]=r};for(let r=0,a=arguments.length;r(du(t,(a,i)=>{n&&Xn(a)?e[i]=Lz(a,n):e[i]=a},{allOwnKeys:r}),e),X9=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),Z9=(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},Q9=(e,t,n,r)=>{let a,i,l;const u={};if(t=t||{},e==null)return t;do{for(a=Object.getOwnPropertyNames(e),i=a.length;i-- >0;)l=a[i],(!r||r(l,e,t))&&!u[l]&&(t[l]=e[l],u[l]=!0);e=n!==!1&&Tk(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},J9=(e,t,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return r!==-1&&r===n},e$=e=>{if(!e)return null;if(Al(e))return e;let t=e.length;if(!Fz(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},t$=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&Tk(Uint8Array)),n$=(e,t)=>{const r=(e&&e[Symbol.iterator]).call(e);let a;for(;(a=r.next())&&!a.done;){const i=a.value;t.call(e,i[0],i[1])}},r$=(e,t)=>{let n;const r=[];for(;(n=e.exec(t))!==null;)r.push(n);return r},a$=Lr("HTMLFormElement"),o$=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,a){return r.toUpperCase()+a}),cR=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),i$=Lr("RegExp"),Bz=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};du(n,(a,i)=>{let l;(l=t(a,i,e))!==!1&&(r[i]=l||a)}),Object.defineProperties(e,r)},l$=e=>{Bz(e,(t,n)=>{if(Xn(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=e[n];if(Xn(r)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},s$=(e,t)=>{const n={},r=a=>{a.forEach(i=>{n[i]=!0})};return Al(e)?r(e):r(String(e).split(t)),n},u$=()=>{},c$=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t,uh="abcdefghijklmnopqrstuvwxyz",dR="0123456789",Uz={DIGIT:dR,ALPHA:uh,ALPHA_DIGIT:uh+uh.toUpperCase()+dR},d$=(e=16,t=Uz.ALPHA_DIGIT)=>{let n="";const{length:r}=t;for(;e--;)n+=t[Math.random()*r|0];return n};function f$(e){return!!(e&&Xn(e.append)&&e[Symbol.toStringTag]==="FormData"&&e[Symbol.iterator])}const p$=e=>{const t=new Array(10),n=(r,a)=>{if(of(r)){if(t.indexOf(r)>=0)return;if(!("toJSON"in r)){t[a]=r;const i=Al(r)?[]:{};return du(r,(l,u)=>{const c=n(l,a+1);!Qs(c)&&(i[u]=c)}),t[a]=void 0,i}}return r};return n(e,0)},g$=Lr("AsyncFunction"),h$=e=>e&&(of(e)||Xn(e))&&Xn(e.then)&&Xn(e.catch),jz=((e,t)=>e?setImmediate:t?((n,r)=>(ti.addEventListener("message",({source:a,data:i})=>{a===ti&&i===n&&r.length&&r.shift()()},!1),a=>{r.push(a),ti.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",Xn(ti.postMessage)),m$=typeof queueMicrotask<"u"?queueMicrotask.bind(ti):typeof process<"u"&&process.nextTick||jz,pe={isArray:Al,isArrayBuffer:Mz,isBuffer:I9,isFormData:G9,isArrayBufferView:L9,isString:M9,isNumber:Fz,isBoolean:F9,isObject:of,isPlainObject:fd,isReadableStream:$9,isRequest:q9,isResponse:V9,isHeaders:W9,isUndefined:Qs,isDate:z9,isFile:P9,isBlob:B9,isRegExp:i$,isFunction:Xn,isStream:j9,isURLSearchParams:H9,isTypedArray:t$,isFileList:U9,forEach:du,merge:hx,extend:K9,trim:Y9,stripBOM:X9,inherits:Z9,toFlatObject:Q9,kindOf:rf,kindOfTest:Lr,endsWith:J9,toArray:e$,forEachEntry:n$,matchAll:r$,isHTMLForm:a$,hasOwnProperty:cR,hasOwnProp:cR,reduceDescriptors:Bz,freezeMethods:l$,toObjectSet:s$,toCamelCase:o$,noop:u$,toFiniteNumber:c$,findKey:zz,global:ti,isContextDefined:Pz,ALPHABET:Uz,generateString:d$,isSpecCompliantForm:f$,toJSONObject:p$,isAsyncFn:g$,isThenable:h$,setImmediate:jz,asap:m$};function nt(e,t,n,r,a){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),a&&(this.response=a,this.status=a.status?a.status:null)}pe.inherits(nt,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:pe.toJSONObject(this.config),code:this.code,status:this.status}}});const Gz=nt.prototype,Hz={};["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=>{Hz[e]={value:e}});Object.defineProperties(nt,Hz);Object.defineProperty(Gz,"isAxiosError",{value:!0});nt.from=(e,t,n,r,a,i)=>{const l=Object.create(Gz);return pe.toFlatObject(e,l,function(c){return c!==Error.prototype},u=>u!=="isAxiosError"),nt.call(l,e.message,t,n,r,a),l.cause=e,l.name=e.name,i&&Object.assign(l,i),l};const b$=null;function mx(e){return pe.isPlainObject(e)||pe.isArray(e)}function $z(e){return pe.endsWith(e,"[]")?e.slice(0,-2):e}function fR(e,t,n){return e?e.concat(t).map(function(a,i){return a=$z(a),!n&&i?"["+a+"]":a}).join(n?".":""):t}function y$(e){return pe.isArray(e)&&!e.some(mx)}const v$=pe.toFlatObject(pe,{},null,function(t){return/^is[A-Z]/.test(t)});function lf(e,t,n){if(!pe.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,n=pe.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(v,A){return!pe.isUndefined(A[v])});const r=n.metaTokens,a=n.visitor||p,i=n.dots,l=n.indexes,c=(n.Blob||typeof Blob<"u"&&Blob)&&pe.isSpecCompliantForm(t);if(!pe.isFunction(a))throw new TypeError("visitor must be a function");function f(S){if(S===null)return"";if(pe.isDate(S))return S.toISOString();if(!c&&pe.isBlob(S))throw new nt("Blob is not supported. Use a Buffer instead.");return pe.isArrayBuffer(S)||pe.isTypedArray(S)?c&&typeof Blob=="function"?new Blob([S]):Buffer.from(S):S}function p(S,v,A){let R=S;if(S&&!A&&typeof S=="object"){if(pe.endsWith(v,"{}"))v=r?v:v.slice(0,-2),S=JSON.stringify(S);else if(pe.isArray(S)&&y$(S)||(pe.isFileList(S)||pe.endsWith(v,"[]"))&&(R=pe.toArray(S)))return v=$z(v),R.forEach(function(_,C){!(pe.isUndefined(_)||_===null)&&t.append(l===!0?fR([v],C,i):l===null?v:v+"[]",f(_))}),!1}return mx(S)?!0:(t.append(fR(A,v,i),f(S)),!1)}const g=[],b=Object.assign(v$,{defaultVisitor:p,convertValue:f,isVisitable:mx});function m(S,v){if(!pe.isUndefined(S)){if(g.indexOf(S)!==-1)throw Error("Circular reference detected in "+v.join("."));g.push(S),pe.forEach(S,function(R,x){(!(pe.isUndefined(R)||R===null)&&a.call(t,R,pe.isString(x)?x.trim():x,v,b))===!0&&m(R,v?v.concat(x):[x])}),g.pop()}}if(!pe.isObject(e))throw new TypeError("data must be an object");return m(e),t}function pR(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(r){return t[r]})}function _k(e,t){this._pairs=[],e&&lf(e,this,t)}const qz=_k.prototype;qz.append=function(t,n){this._pairs.push([t,n])};qz.toString=function(t){const n=t?function(r){return t.call(this,r,pR)}:pR;return this._pairs.map(function(a){return n(a[0])+"="+n(a[1])},"").join("&")};function S$(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Vz(e,t,n){if(!t)return e;const r=n&&n.encode||S$;pe.isFunction(n)&&(n={serialize:n});const a=n&&n.serialize;let i;if(a?i=a(t,n):i=pe.isURLSearchParams(t)?t.toString():new _k(t,n).toString(r),i){const l=e.indexOf("#");l!==-1&&(e=e.slice(0,l)),e+=(e.indexOf("?")===-1?"?":"&")+i}return e}class gR{constructor(){this.handlers=[]}use(t,n,r){return this.handlers.push({fulfilled:t,rejected:n,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){pe.forEach(this.handlers,function(r){r!==null&&t(r)})}}const Wz={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},E$=typeof URLSearchParams<"u"?URLSearchParams:_k,w$=typeof FormData<"u"?FormData:null,x$=typeof Blob<"u"?Blob:null,k$={isBrowser:!0,classes:{URLSearchParams:E$,FormData:w$,Blob:x$},protocols:["http","https","file","blob","url","data"]},Rk=typeof window<"u"&&typeof document<"u",bx=typeof navigator=="object"&&navigator||void 0,A$=Rk&&(!bx||["ReactNative","NativeScript","NS"].indexOf(bx.product)<0),T$=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",_$=Rk&&window.location.href||"http://localhost",R$=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:Rk,hasStandardBrowserEnv:A$,hasStandardBrowserWebWorkerEnv:T$,navigator:bx,origin:_$},Symbol.toStringTag,{value:"Module"})),yn={...R$,...k$};function C$(e,t){return lf(e,new yn.classes.URLSearchParams,Object.assign({visitor:function(n,r,a,i){return yn.isNode&&pe.isBuffer(n)?(this.append(r,n.toString("base64")),!1):i.defaultVisitor.apply(this,arguments)}},t))}function N$(e){return pe.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function O$(e){const t={},n=Object.keys(e);let r;const a=n.length;let i;for(r=0;r=n.length;return l=!l&&pe.isArray(a)?a.length:l,c?(pe.hasOwnProp(a,l)?a[l]=[a[l],r]:a[l]=r,!u):((!a[l]||!pe.isObject(a[l]))&&(a[l]=[]),t(n,r,a[l],i)&&pe.isArray(a[l])&&(a[l]=O$(a[l])),!u)}if(pe.isFormData(e)&&pe.isFunction(e.entries)){const n={};return pe.forEachEntry(e,(r,a)=>{t(N$(r),a,n,0)}),n}return null}function D$(e,t,n){if(pe.isString(e))try{return(t||JSON.parse)(e),pe.trim(e)}catch(r){if(r.name!=="SyntaxError")throw r}return(n||JSON.stringify)(e)}const fu={transitional:Wz,adapter:["xhr","http","fetch"],transformRequest:[function(t,n){const r=n.getContentType()||"",a=r.indexOf("application/json")>-1,i=pe.isObject(t);if(i&&pe.isHTMLForm(t)&&(t=new FormData(t)),pe.isFormData(t))return a?JSON.stringify(Yz(t)):t;if(pe.isArrayBuffer(t)||pe.isBuffer(t)||pe.isStream(t)||pe.isFile(t)||pe.isBlob(t)||pe.isReadableStream(t))return t;if(pe.isArrayBufferView(t))return t.buffer;if(pe.isURLSearchParams(t))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let u;if(i){if(r.indexOf("application/x-www-form-urlencoded")>-1)return C$(t,this.formSerializer).toString();if((u=pe.isFileList(t))||r.indexOf("multipart/form-data")>-1){const c=this.env&&this.env.FormData;return lf(u?{"files[]":t}:t,c&&new c,this.formSerializer)}}return i||a?(n.setContentType("application/json",!1),D$(t)):t}],transformResponse:[function(t){const n=this.transitional||fu.transitional,r=n&&n.forcedJSONParsing,a=this.responseType==="json";if(pe.isResponse(t)||pe.isReadableStream(t))return t;if(t&&pe.isString(t)&&(r&&!this.responseType||a)){const l=!(n&&n.silentJSONParsing)&&a;try{return JSON.parse(t)}catch(u){if(l)throw u.name==="SyntaxError"?nt.from(u,nt.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:yn.classes.FormData,Blob:yn.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};pe.forEach(["delete","get","head","post","put","patch"],e=>{fu.headers[e]={}});const I$=pe.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"]),L$=e=>{const t={};let n,r,a;return e&&e.split(` +`).forEach(function(l){a=l.indexOf(":"),n=l.substring(0,a).trim().toLowerCase(),r=l.substring(a+1).trim(),!(!n||t[n]&&I$[n])&&(n==="set-cookie"?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)}),t},hR=Symbol("internals");function Ls(e){return e&&String(e).trim().toLowerCase()}function pd(e){return e===!1||e==null?e:pe.isArray(e)?e.map(pd):String(e)}function M$(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}const F$=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function ch(e,t,n,r,a){if(pe.isFunction(r))return r.call(this,t,n);if(a&&(t=n),!!pe.isString(t)){if(pe.isString(r))return t.indexOf(r)!==-1;if(pe.isRegExp(r))return r.test(t)}}function z$(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,r)=>n.toUpperCase()+r)}function P$(e,t){const n=pe.toCamelCase(" "+t);["get","set","has"].forEach(r=>{Object.defineProperty(e,r+n,{value:function(a,i,l){return this[r].call(this,t,a,i,l)},configurable:!0})})}let zn=class{constructor(t){t&&this.set(t)}set(t,n,r){const a=this;function i(u,c,f){const p=Ls(c);if(!p)throw new Error("header name must be a non-empty string");const g=pe.findKey(a,p);(!g||a[g]===void 0||f===!0||f===void 0&&a[g]!==!1)&&(a[g||c]=pd(u))}const l=(u,c)=>pe.forEach(u,(f,p)=>i(f,p,c));if(pe.isPlainObject(t)||t instanceof this.constructor)l(t,n);else if(pe.isString(t)&&(t=t.trim())&&!F$(t))l(L$(t),n);else if(pe.isHeaders(t))for(const[u,c]of t.entries())i(c,u,r);else t!=null&&i(n,t,r);return this}get(t,n){if(t=Ls(t),t){const r=pe.findKey(this,t);if(r){const a=this[r];if(!n)return a;if(n===!0)return M$(a);if(pe.isFunction(n))return n.call(this,a,r);if(pe.isRegExp(n))return n.exec(a);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,n){if(t=Ls(t),t){const r=pe.findKey(this,t);return!!(r&&this[r]!==void 0&&(!n||ch(this,this[r],r,n)))}return!1}delete(t,n){const r=this;let a=!1;function i(l){if(l=Ls(l),l){const u=pe.findKey(r,l);u&&(!n||ch(r,r[u],u,n))&&(delete r[u],a=!0)}}return pe.isArray(t)?t.forEach(i):i(t),a}clear(t){const n=Object.keys(this);let r=n.length,a=!1;for(;r--;){const i=n[r];(!t||ch(this,this[i],i,t,!0))&&(delete this[i],a=!0)}return a}normalize(t){const n=this,r={};return pe.forEach(this,(a,i)=>{const l=pe.findKey(r,i);if(l){n[l]=pd(a),delete n[i];return}const u=t?z$(i):String(i).trim();u!==i&&delete n[i],n[u]=pd(a),r[u]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const n=Object.create(null);return pe.forEach(this,(r,a)=>{r!=null&&r!==!1&&(n[a]=t&&pe.isArray(r)?r.join(", "):r)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,n])=>t+": "+n).join(` +`)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...n){const r=new this(t);return n.forEach(a=>r.set(a)),r}static accessor(t){const r=(this[hR]=this[hR]={accessors:{}}).accessors,a=this.prototype;function i(l){const u=Ls(l);r[u]||(P$(a,l),r[u]=!0)}return pe.isArray(t)?t.forEach(i):i(t),this}};zn.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);pe.reduceDescriptors(zn.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(r){this[n]=r}}});pe.freezeMethods(zn);function dh(e,t){const n=this||fu,r=t||n,a=zn.from(r.headers);let i=r.data;return pe.forEach(e,function(u){i=u.call(n,i,a.normalize(),t?t.status:void 0)}),a.normalize(),i}function Kz(e){return!!(e&&e.__CANCEL__)}function Tl(e,t,n){nt.call(this,e??"canceled",nt.ERR_CANCELED,t,n),this.name="CanceledError"}pe.inherits(Tl,nt,{__CANCEL__:!0});function Xz(e,t,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new nt("Request failed with status code "+n.status,[nt.ERR_BAD_REQUEST,nt.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function B$(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function U$(e,t){e=e||10;const n=new Array(e),r=new Array(e);let a=0,i=0,l;return t=t!==void 0?t:1e3,function(c){const f=Date.now(),p=r[i];l||(l=f),n[a]=c,r[a]=f;let g=i,b=0;for(;g!==a;)b+=n[g++],g=g%e;if(a=(a+1)%e,a===i&&(i=(i+1)%e),f-l{n=p,a=null,i&&(clearTimeout(i),i=null),e.apply(null,f)};return[(...f)=>{const p=Date.now(),g=p-n;g>=r?l(f,p):(a=f,i||(i=setTimeout(()=>{i=null,l(a)},r-g)))},()=>a&&l(a)]}const Nd=(e,t,n=3)=>{let r=0;const a=U$(50,250);return j$(i=>{const l=i.loaded,u=i.lengthComputable?i.total:void 0,c=l-r,f=a(c),p=l<=u;r=l;const g={loaded:l,total:u,progress:u?l/u:void 0,bytes:c,rate:f||void 0,estimated:f&&u&&p?(u-l)/f:void 0,event:i,lengthComputable:u!=null,[t?"download":"upload"]:!0};e(g)},n)},mR=(e,t)=>{const n=e!=null;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},bR=e=>(...t)=>pe.asap(()=>e(...t)),G$=yn.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,yn.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(yn.origin),yn.navigator&&/(msie|trident)/i.test(yn.navigator.userAgent)):()=>!0,H$=yn.hasStandardBrowserEnv?{write(e,t,n,r,a,i){const l=[e+"="+encodeURIComponent(t)];pe.isNumber(n)&&l.push("expires="+new Date(n).toGMTString()),pe.isString(r)&&l.push("path="+r),pe.isString(a)&&l.push("domain="+a),i===!0&&l.push("secure"),document.cookie=l.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function $$(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function q$(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function Zz(e,t){return e&&!$$(t)?q$(e,t):t}const yR=e=>e instanceof zn?{...e}:e;function ri(e,t){t=t||{};const n={};function r(f,p,g,b){return pe.isPlainObject(f)&&pe.isPlainObject(p)?pe.merge.call({caseless:b},f,p):pe.isPlainObject(p)?pe.merge({},p):pe.isArray(p)?p.slice():p}function a(f,p,g,b){if(pe.isUndefined(p)){if(!pe.isUndefined(f))return r(void 0,f,g,b)}else return r(f,p,g,b)}function i(f,p){if(!pe.isUndefined(p))return r(void 0,p)}function l(f,p){if(pe.isUndefined(p)){if(!pe.isUndefined(f))return r(void 0,f)}else return r(void 0,p)}function u(f,p,g){if(g in t)return r(f,p);if(g in e)return r(void 0,f)}const c={url:i,method:i,data:i,baseURL:l,transformRequest:l,transformResponse:l,paramsSerializer:l,timeout:l,timeoutMessage:l,withCredentials:l,withXSRFToken:l,adapter:l,responseType:l,xsrfCookieName:l,xsrfHeaderName:l,onUploadProgress:l,onDownloadProgress:l,decompress:l,maxContentLength:l,maxBodyLength:l,beforeRedirect:l,transport:l,httpAgent:l,httpsAgent:l,cancelToken:l,socketPath:l,responseEncoding:l,validateStatus:u,headers:(f,p,g)=>a(yR(f),yR(p),g,!0)};return pe.forEach(Object.keys(Object.assign({},e,t)),function(p){const g=c[p]||a,b=g(e[p],t[p],p);pe.isUndefined(b)&&g!==u||(n[p]=b)}),n}const Qz=e=>{const t=ri({},e);let{data:n,withXSRFToken:r,xsrfHeaderName:a,xsrfCookieName:i,headers:l,auth:u}=t;t.headers=l=zn.from(l),t.url=Vz(Zz(t.baseURL,t.url),e.params,e.paramsSerializer),u&&l.set("Authorization","Basic "+btoa((u.username||"")+":"+(u.password?unescape(encodeURIComponent(u.password)):"")));let c;if(pe.isFormData(n)){if(yn.hasStandardBrowserEnv||yn.hasStandardBrowserWebWorkerEnv)l.setContentType(void 0);else if((c=l.getContentType())!==!1){const[f,...p]=c?c.split(";").map(g=>g.trim()).filter(Boolean):[];l.setContentType([f||"multipart/form-data",...p].join("; "))}}if(yn.hasStandardBrowserEnv&&(r&&pe.isFunction(r)&&(r=r(t)),r||r!==!1&&G$(t.url))){const f=a&&i&&H$.read(i);f&&l.set(a,f)}return t},V$=typeof XMLHttpRequest<"u",W$=V$&&function(e){return new Promise(function(n,r){const a=Qz(e);let i=a.data;const l=zn.from(a.headers).normalize();let{responseType:u,onUploadProgress:c,onDownloadProgress:f}=a,p,g,b,m,S;function v(){m&&m(),S&&S(),a.cancelToken&&a.cancelToken.unsubscribe(p),a.signal&&a.signal.removeEventListener("abort",p)}let A=new XMLHttpRequest;A.open(a.method.toUpperCase(),a.url,!0),A.timeout=a.timeout;function R(){if(!A)return;const _=zn.from("getAllResponseHeaders"in A&&A.getAllResponseHeaders()),N={data:!u||u==="text"||u==="json"?A.responseText:A.response,status:A.status,statusText:A.statusText,headers:_,config:e,request:A};Xz(function(O){n(O),v()},function(O){r(O),v()},N),A=null}"onloadend"in A?A.onloadend=R:A.onreadystatechange=function(){!A||A.readyState!==4||A.status===0&&!(A.responseURL&&A.responseURL.indexOf("file:")===0)||setTimeout(R)},A.onabort=function(){A&&(r(new nt("Request aborted",nt.ECONNABORTED,e,A)),A=null)},A.onerror=function(){r(new nt("Network Error",nt.ERR_NETWORK,e,A)),A=null},A.ontimeout=function(){let C=a.timeout?"timeout of "+a.timeout+"ms exceeded":"timeout exceeded";const N=a.transitional||Wz;a.timeoutErrorMessage&&(C=a.timeoutErrorMessage),r(new nt(C,N.clarifyTimeoutError?nt.ETIMEDOUT:nt.ECONNABORTED,e,A)),A=null},i===void 0&&l.setContentType(null),"setRequestHeader"in A&&pe.forEach(l.toJSON(),function(C,N){A.setRequestHeader(N,C)}),pe.isUndefined(a.withCredentials)||(A.withCredentials=!!a.withCredentials),u&&u!=="json"&&(A.responseType=a.responseType),f&&([b,S]=Nd(f,!0),A.addEventListener("progress",b)),c&&A.upload&&([g,m]=Nd(c),A.upload.addEventListener("progress",g),A.upload.addEventListener("loadend",m)),(a.cancelToken||a.signal)&&(p=_=>{A&&(r(!_||_.type?new Tl(null,e,A):_),A.abort(),A=null)},a.cancelToken&&a.cancelToken.subscribe(p),a.signal&&(a.signal.aborted?p():a.signal.addEventListener("abort",p)));const x=B$(a.url);if(x&&yn.protocols.indexOf(x)===-1){r(new nt("Unsupported protocol "+x+":",nt.ERR_BAD_REQUEST,e));return}A.send(i||null)})},Y$=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let r=new AbortController,a;const i=function(f){if(!a){a=!0,u();const p=f instanceof Error?f:this.reason;r.abort(p instanceof nt?p:new Tl(p instanceof Error?p.message:p))}};let l=t&&setTimeout(()=>{l=null,i(new nt(`timeout ${t} of ms exceeded`,nt.ETIMEDOUT))},t);const u=()=>{e&&(l&&clearTimeout(l),l=null,e.forEach(f=>{f.unsubscribe?f.unsubscribe(i):f.removeEventListener("abort",i)}),e=null)};e.forEach(f=>f.addEventListener("abort",i));const{signal:c}=r;return c.unsubscribe=()=>pe.asap(u),c}},K$=function*(e,t){let n=e.byteLength;if(n{const a=X$(e,t);let i=0,l,u=c=>{l||(l=!0,r&&r(c))};return new ReadableStream({async pull(c){try{const{done:f,value:p}=await a.next();if(f){u(),c.close();return}let g=p.byteLength;if(n){let b=i+=g;n(b)}c.enqueue(new Uint8Array(p))}catch(f){throw u(f),f}},cancel(c){return u(c),a.return()}},{highWaterMark:2})},sf=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",Jz=sf&&typeof ReadableStream=="function",Q$=sf&&(typeof TextEncoder=="function"?(e=>t=>e.encode(t))(new TextEncoder):async e=>new Uint8Array(await new Response(e).arrayBuffer())),eP=(e,...t)=>{try{return!!e(...t)}catch{return!1}},J$=Jz&&eP(()=>{let e=!1;const t=new Request(yn.origin,{body:new ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t}),SR=64*1024,yx=Jz&&eP(()=>pe.isReadableStream(new Response("").body)),Od={stream:yx&&(e=>e.body)};sf&&(e=>{["text","arrayBuffer","blob","formData","stream"].forEach(t=>{!Od[t]&&(Od[t]=pe.isFunction(e[t])?n=>n[t]():(n,r)=>{throw new nt(`Response type '${t}' is not supported`,nt.ERR_NOT_SUPPORT,r)})})})(new Response);const eq=async e=>{if(e==null)return 0;if(pe.isBlob(e))return e.size;if(pe.isSpecCompliantForm(e))return(await new Request(yn.origin,{method:"POST",body:e}).arrayBuffer()).byteLength;if(pe.isArrayBufferView(e)||pe.isArrayBuffer(e))return e.byteLength;if(pe.isURLSearchParams(e)&&(e=e+""),pe.isString(e))return(await Q$(e)).byteLength},tq=async(e,t)=>{const n=pe.toFiniteNumber(e.getContentLength());return n??eq(t)},nq=sf&&(async e=>{let{url:t,method:n,data:r,signal:a,cancelToken:i,timeout:l,onDownloadProgress:u,onUploadProgress:c,responseType:f,headers:p,withCredentials:g="same-origin",fetchOptions:b}=Qz(e);f=f?(f+"").toLowerCase():"text";let m=Y$([a,i&&i.toAbortSignal()],l),S;const v=m&&m.unsubscribe&&(()=>{m.unsubscribe()});let A;try{if(c&&J$&&n!=="get"&&n!=="head"&&(A=await tq(p,r))!==0){let N=new Request(t,{method:"POST",body:r,duplex:"half"}),T;if(pe.isFormData(r)&&(T=N.headers.get("content-type"))&&p.setContentType(T),N.body){const[O,z]=mR(A,Nd(bR(c)));r=vR(N.body,SR,O,z)}}pe.isString(g)||(g=g?"include":"omit");const R="credentials"in Request.prototype;S=new Request(t,{...b,signal:m,method:n.toUpperCase(),headers:p.normalize().toJSON(),body:r,duplex:"half",credentials:R?g:void 0});let x=await fetch(S);const _=yx&&(f==="stream"||f==="response");if(yx&&(u||_&&v)){const N={};["status","statusText","headers"].forEach(I=>{N[I]=x[I]});const T=pe.toFiniteNumber(x.headers.get("content-length")),[O,z]=u&&mR(T,Nd(bR(u),!0))||[];x=new Response(vR(x.body,SR,O,()=>{z&&z(),v&&v()}),N)}f=f||"text";let C=await Od[pe.findKey(Od,f)||"text"](x,e);return!_&&v&&v(),await new Promise((N,T)=>{Xz(N,T,{data:C,headers:zn.from(x.headers),status:x.status,statusText:x.statusText,config:e,request:S})})}catch(R){throw v&&v(),R&&R.name==="TypeError"&&/fetch/i.test(R.message)?Object.assign(new nt("Network Error",nt.ERR_NETWORK,e,S),{cause:R.cause||R}):nt.from(R,R&&R.code,e,S)}}),vx={http:b$,xhr:W$,fetch:nq};pe.forEach(vx,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const ER=e=>`- ${e}`,rq=e=>pe.isFunction(e)||e===null||e===!1,tP={getAdapter:e=>{e=pe.isArray(e)?e:[e];const{length:t}=e;let n,r;const a={};for(let i=0;i`adapter ${u} `+(c===!1?"is not supported by the environment":"is not available in the build"));let l=t?i.length>1?`since : +`+i.map(ER).join(` +`):" "+ER(i[0]):"as no adapter specified";throw new nt("There is no suitable adapter to dispatch the request "+l,"ERR_NOT_SUPPORT")}return r},adapters:vx};function fh(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Tl(null,e)}function wR(e){return fh(e),e.headers=zn.from(e.headers),e.data=dh.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),tP.getAdapter(e.adapter||fu.adapter)(e).then(function(r){return fh(e),r.data=dh.call(e,e.transformResponse,r),r.headers=zn.from(r.headers),r},function(r){return Kz(r)||(fh(e),r&&r.response&&(r.response.data=dh.call(e,e.transformResponse,r.response),r.response.headers=zn.from(r.response.headers))),Promise.reject(r)})}const nP="1.7.9",uf={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{uf[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const xR={};uf.transitional=function(t,n,r){function a(i,l){return"[Axios v"+nP+"] Transitional option '"+i+"'"+l+(r?". "+r:"")}return(i,l,u)=>{if(t===!1)throw new nt(a(l," has been removed"+(n?" in "+n:"")),nt.ERR_DEPRECATED);return n&&!xR[l]&&(xR[l]=!0,console.warn(a(l," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(i,l,u):!0}};uf.spelling=function(t){return(n,r)=>(console.warn(`${r} is likely a misspelling of ${t}`),!0)};function aq(e,t,n){if(typeof e!="object")throw new nt("options must be an object",nt.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let a=r.length;for(;a-- >0;){const i=r[a],l=t[i];if(l){const u=e[i],c=u===void 0||l(u,i,e);if(c!==!0)throw new nt("option "+i+" must be "+c,nt.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new nt("Unknown option "+i,nt.ERR_BAD_OPTION)}}const gd={assertOptions:aq,validators:uf},Hr=gd.validators;let ni=class{constructor(t){this.defaults=t,this.interceptors={request:new gR,response:new gR}}async request(t,n){try{return await this._request(t,n)}catch(r){if(r instanceof Error){let a={};Error.captureStackTrace?Error.captureStackTrace(a):a=new Error;const i=a.stack?a.stack.replace(/^.+\n/,""):"";try{r.stack?i&&!String(r.stack).endsWith(i.replace(/^.+\n.+\n/,""))&&(r.stack+=` +`+i):r.stack=i}catch{}}throw r}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=ri(this.defaults,n);const{transitional:r,paramsSerializer:a,headers:i}=n;r!==void 0&&gd.assertOptions(r,{silentJSONParsing:Hr.transitional(Hr.boolean),forcedJSONParsing:Hr.transitional(Hr.boolean),clarifyTimeoutError:Hr.transitional(Hr.boolean)},!1),a!=null&&(pe.isFunction(a)?n.paramsSerializer={serialize:a}:gd.assertOptions(a,{encode:Hr.function,serialize:Hr.function},!0)),gd.assertOptions(n,{baseUrl:Hr.spelling("baseURL"),withXsrfToken:Hr.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let l=i&&pe.merge(i.common,i[n.method]);i&&pe.forEach(["delete","get","head","post","put","patch","common"],S=>{delete i[S]}),n.headers=zn.concat(l,i);const u=[];let c=!0;this.interceptors.request.forEach(function(v){typeof v.runWhen=="function"&&v.runWhen(n)===!1||(c=c&&v.synchronous,u.unshift(v.fulfilled,v.rejected))});const f=[];this.interceptors.response.forEach(function(v){f.push(v.fulfilled,v.rejected)});let p,g=0,b;if(!c){const S=[wR.bind(this),void 0];for(S.unshift.apply(S,u),S.push.apply(S,f),b=S.length,p=Promise.resolve(n);g{if(!r._listeners)return;let i=r._listeners.length;for(;i-- >0;)r._listeners[i](a);r._listeners=null}),this.promise.then=a=>{let i;const l=new Promise(u=>{r.subscribe(u),i=u}).then(a);return l.cancel=function(){r.unsubscribe(i)},l},t(function(i,l,u){r.reason||(r.reason=new Tl(i,l,u),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const t=new AbortController,n=r=>{t.abort(r)};return this.subscribe(n),t.signal.unsubscribe=()=>this.unsubscribe(n),t.signal}static source(){let t;return{token:new rP(function(a){t=a}),cancel:t}}};function iq(e){return function(n){return e.apply(null,n)}}function lq(e){return pe.isObject(e)&&e.isAxiosError===!0}const Sx={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(Sx).forEach(([e,t])=>{Sx[t]=e});function aP(e){const t=new ni(e),n=Lz(ni.prototype.request,t);return pe.extend(n,ni.prototype,t,{allOwnKeys:!0}),pe.extend(n,t,null,{allOwnKeys:!0}),n.create=function(a){return aP(ri(e,a))},n}const $t=aP(fu);$t.Axios=ni;$t.CanceledError=Tl;$t.CancelToken=oq;$t.isCancel=Kz;$t.VERSION=nP;$t.toFormData=lf;$t.AxiosError=nt;$t.Cancel=$t.CanceledError;$t.all=function(t){return Promise.all(t)};$t.spread=iq;$t.isAxiosError=lq;$t.mergeConfig=ri;$t.AxiosHeaders=zn;$t.formToJSON=e=>Yz(pe.isHTMLForm(e)?new FormData(e):e);$t.getAdapter=tP.getAdapter;$t.HttpStatusCode=Sx;$t.default=$t;const{Axios:Fye,AxiosError:zye,CanceledError:Pye,isCancel:Bye,CancelToken:Uye,VERSION:jye,all:Gye,Cancel:Hye,isAxiosError:$ye,spread:qye,toFormData:Vye,AxiosHeaders:Wye,HttpStatusCode:Yye,formToJSON:Kye,getAdapter:Xye,mergeConfig:Zye}=$t,oP="Invalid API Key",iP="API Key required",Mr=$t.create({baseURL:Rz,headers:{"Content-Type":"application/json"}});Mr.interceptors.request.use(e=>{const t=Ke.getState().apiKey;return t&&(e.headers["X-API-Key"]=t),e});Mr.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 sq=async(e,t)=>(await Mr.get(`/graphs?label=${e}&max_depth=${t}`)).data,uq=async()=>(await Mr.get("/graph/label/list")).data,cq=async()=>{try{return(await Mr.get("/health")).data}catch(e){return{status:"error",message:Nr(e)}}},dq=async()=>(await Mr.get("/documents")).data,fq=async()=>(await Mr.post("/documents/scan")).data,pq=async e=>(await Mr.post("/query",e)).data,gq=async(e,t,n)=>{try{let r="";if(await Mr.post("/query/stream",e,{responseType:"text",headers:{Accept:"application/x-ndjson"},transformResponse:[a=>{r+=a;const i=r.split(` +`);r=i.pop()||"";for(const l of i)if(l.trim())try{const u=JSON.parse(l);u.response?t(u.response):u.error&&n&&n(u.error)}catch(u){console.error("Error parsing stream chunk:",u),n&&n("Error parsing server response")}return a}]}).catch(a=>{n&&n(Nr(a))}),r.trim())try{const a=JSON.parse(r);a.response?t(a.response):a.error&&n&&n(a.error)}catch(a){console.error("Error parsing final chunk:",a),n&&n("Error parsing server response")}}catch(r){const a=Nr(r);console.error("Stream request failed:",a),n&&n(a)}},hq=async(e,t)=>{const n=new FormData;return n.append("file",e),(await Mr.post("/documents/upload",n,{headers:{"Content-Type":"multipart/form-data"},onUploadProgress:t!==void 0?a=>{const i=Math.round(a.loaded*100/a.total);t(i)}:void 0})).data},mq=async()=>(await Mr.delete("/documents")).data,bq=wk()(e=>({health:!0,message:null,messageTitle:null,lastCheckTime:Date.now(),status:null,check:async()=>{const t=await cq();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})}})),Pn=Ak(bq);/** + * @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 yq=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),lP=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim();/** + * @license lucide-react v0.475.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */var vq={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 Sq=k.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:a="",children:i,iconNode:l,...u},c)=>k.createElement("svg",{ref:c,...vq,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:lP("lucide",a),...u},[...l.map(([f,p])=>k.createElement(f,p)),...Array.isArray(i)?i:[i]]));/** + * @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 xt=(e,t)=>{const n=k.forwardRef(({className:r,...a},i)=>k.createElement(Sq,{ref:i,iconNode:t,className:lP(`lucide-${yq(e)}`,r),...a}));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 Eq=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Ck=xt("Check",Eq);/** + * @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 wq=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],Nk=xt("ChevronDown",wq);/** + * @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 xq=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],sP=xt("ChevronUp",xq);/** + * @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 kq=[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]],Aq=xt("ChevronsUpDown",kq);/** + * @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 Tq=[["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"}]],_q=xt("CircleAlert",Tq);/** + * @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 Rq=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],Cq=xt("Copy",Rq);/** + * @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 Nq=[["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"}]],uP=xt("Eraser",Nq);/** + * @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 Oq=[["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"}]],Dq=xt("FileText",Oq);/** + * @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 Iq=[["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"}]],Lq=xt("Files",Iq);/** + * @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 Mq=[["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"}]],Fq=xt("Fullscreen",Mq);/** + * @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 zq=[["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"}]],Pq=xt("Github",zq);/** + * @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 Bq=[["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"}]],Uq=xt("Grip",Bq);/** + * @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 jq=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],cP=xt("LoaderCircle",jq);/** + * @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 Gq=[["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"}]],Hq=xt("Loader",Gq);/** + * @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 $q=[["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"}]],qq=xt("Maximize",$q);/** + * @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 Vq=[["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"}]],Wq=xt("Minimize",Vq);/** + * @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 Yq=[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]],Kq=xt("Moon",Yq);/** + * @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 Xq=[["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"}]],Zq=xt("Pause",Xq);/** + * @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 Qq=[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]],Jq=xt("Play",Qq);/** + * @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 e8=[["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"}]],t8=xt("RefreshCw",e8);/** + * @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 n8=[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]],r8=xt("Search",n8);/** + * @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 a8=[["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"}]],o8=xt("Send",a8);/** + * @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 i8=[["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"}]],l8=xt("Settings",i8);/** + * @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 s8=[["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"}]],u8=xt("Sun",s8);/** + * @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 c8=[["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"}]],Ex=xt("Upload",c8);/** + * @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 d8=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],dP=xt("X",d8);/** + * @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 f8=[["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"}]],p8=xt("Zap",f8);/** + * @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 g8=[["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"}]],h8=xt("ZoomIn",g8);/** + * @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 m8=[["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"}]],b8=xt("ZoomOut",m8),y8=()=>{const e=Pn.use.health(),t=Pn.use.message(),n=Pn.use.messageTitle(),[r,a]=k.useState(!1);return k.useEffect(()=>{setTimeout(()=>{a(!0)},50)},[]),w.jsxs(Oz,{className:Me("bg-background/90 absolute top-12 left-1/2 flex w-auto max-w-lg -translate-x-1/2 transform items-center gap-4 shadow-md backdrop-blur-lg transition-all duration-500 ease-in-out",r?"translate-y-0 opacity-100":"-translate-y-20 opacity-0",!e&&"bg-red-700 text-white"),children:[!e&&w.jsx("div",{children:w.jsx(_q,{className:"size-4"})}),w.jsxs("div",{children:[w.jsx(Dz,{className:"font-bold",children:n}),w.jsx(Iz,{children:t})]})]})};function v8(e,t){const n=k.createContext(t),r=i=>{const{children:l,...u}=i,c=k.useMemo(()=>u,Object.values(u));return w.jsx(n.Provider,{value:c,children:l})};r.displayName=e+"Provider";function a(i){const l=k.useContext(n);if(l)return l;if(t!==void 0)return t;throw new Error(`\`${i}\` must be used within \`${e}\``)}return[r,a]}function mr(e,t=[]){let n=[];function r(i,l){const u=k.createContext(l),c=n.length;n=[...n,l];const f=g=>{var R;const{scope:b,children:m,...S}=g,v=((R=b==null?void 0:b[e])==null?void 0:R[c])||u,A=k.useMemo(()=>S,Object.values(S));return w.jsx(v.Provider,{value:A,children:m})};f.displayName=i+"Provider";function p(g,b){var v;const m=((v=b==null?void 0:b[e])==null?void 0:v[c])||u,S=k.useContext(m);if(S)return S;if(l!==void 0)return l;throw new Error(`\`${g}\` must be used within \`${i}\``)}return[f,p]}const a=()=>{const i=n.map(l=>k.createContext(l));return function(u){const c=(u==null?void 0:u[e])||i;return k.useMemo(()=>({[`__scope${e}`]:{...u,[e]:c}}),[u,c])}};return a.scopeName=e,[r,S8(a,...t)]}function S8(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(a=>({useScope:a(),scopeName:a.scopeName}));return function(i){const l=r.reduce((u,{useScope:c,scopeName:f})=>{const g=c(i)[`__scope${f}`];return{...u,...g}},{});return k.useMemo(()=>({[`__scope${t.scopeName}`]:l}),[l])}};return n.scopeName=t.scopeName,n}function kR(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function fP(...e){return t=>{let n=!1;const r=e.map(a=>{const i=kR(a,t);return!n&&typeof i=="function"&&(n=!0),i});if(n)return()=>{for(let a=0;a{},E8=bH.useId||(()=>{}),w8=0;function En(e){const[t,n]=k.useState(E8());return wn(()=>{n(r=>r??String(w8++))},[e]),t?`radix-${t}`:""}function pn(e){const t=k.useRef(e);return k.useEffect(()=>{t.current=e}),k.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function Oa({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,a]=x8({defaultProp:t,onChange:n}),i=e!==void 0,l=i?e:r,u=pn(n),c=k.useCallback(f=>{if(i){const g=typeof f=="function"?f(e):f;g!==e&&u(g)}else a(f)},[i,e,a,u]);return[l,c]}function x8({defaultProp:e,onChange:t}){const n=k.useState(e),[r]=n,a=k.useRef(r),i=pn(t);return k.useEffect(()=>{a.current!==r&&(i(r),a.current=r)},[r,a,i]),n}var pu=mz();const pP=an(pu);var bo=k.forwardRef((e,t)=>{const{children:n,...r}=e,a=k.Children.toArray(n),i=a.find(k8);if(i){const l=i.props.children,u=a.map(c=>c===i?k.Children.count(l)>1?k.Children.only(null):k.isValidElement(l)?l.props.children:null:c);return w.jsx(wx,{...r,ref:t,children:k.isValidElement(l)?k.cloneElement(l,void 0,u):null})}return w.jsx(wx,{...r,ref:t,children:n})});bo.displayName="Slot";var wx=k.forwardRef((e,t)=>{const{children:n,...r}=e;if(k.isValidElement(n)){const a=T8(n),i=A8(r,n.props);return n.type!==k.Fragment&&(i.ref=t?fP(t,a):a),k.cloneElement(n,i)}return k.Children.count(n)>1?k.Children.only(null):null});wx.displayName="SlotClone";var Ok=({children:e})=>w.jsx(w.Fragment,{children:e});function k8(e){return k.isValidElement(e)&&e.type===Ok}function A8(e,t){const n={...t};for(const r in t){const a=e[r],i=t[r];/^on[A-Z]/.test(r)?a&&i?n[r]=(...u)=>{i(...u),a(...u)}:a&&(n[r]=a):r==="style"?n[r]={...a,...i}:r==="className"&&(n[r]=[a,i].filter(Boolean).join(" "))}return{...e,...n}}function T8(e){var r,a;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(a=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:a.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var _8=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],Xe=_8.reduce((e,t)=>{const n=k.forwardRef((r,a)=>{const{asChild:i,...l}=r,u=i?bo:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),w.jsx(u,{...l,ref:a})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function R8(e,t){e&&pu.flushSync(()=>e.dispatchEvent(t))}function C8(e,t=globalThis==null?void 0:globalThis.document){const n=pn(e);k.useEffect(()=>{const r=a=>{a.key==="Escape"&&n(a)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var N8="DismissableLayer",xx="dismissableLayer.update",O8="dismissableLayer.pointerDownOutside",D8="dismissableLayer.focusOutside",AR,gP=k.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),gu=k.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:a,onFocusOutside:i,onInteractOutside:l,onDismiss:u,...c}=e,f=k.useContext(gP),[p,g]=k.useState(null),b=(p==null?void 0:p.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,m]=k.useState({}),S=ft(t,O=>g(O)),v=Array.from(f.layers),[A]=[...f.layersWithOutsidePointerEventsDisabled].slice(-1),R=v.indexOf(A),x=p?v.indexOf(p):-1,_=f.layersWithOutsidePointerEventsDisabled.size>0,C=x>=R,N=M8(O=>{const z=O.target,I=[...f.branches].some(M=>M.contains(z));!C||I||(a==null||a(O),l==null||l(O),O.defaultPrevented||u==null||u())},b),T=F8(O=>{const z=O.target;[...f.branches].some(M=>M.contains(z))||(i==null||i(O),l==null||l(O),O.defaultPrevented||u==null||u())},b);return C8(O=>{x===f.layers.size-1&&(r==null||r(O),!O.defaultPrevented&&u&&(O.preventDefault(),u()))},b),k.useEffect(()=>{if(p)return n&&(f.layersWithOutsidePointerEventsDisabled.size===0&&(AR=b.body.style.pointerEvents,b.body.style.pointerEvents="none"),f.layersWithOutsidePointerEventsDisabled.add(p)),f.layers.add(p),TR(),()=>{n&&f.layersWithOutsidePointerEventsDisabled.size===1&&(b.body.style.pointerEvents=AR)}},[p,b,n,f]),k.useEffect(()=>()=>{p&&(f.layers.delete(p),f.layersWithOutsidePointerEventsDisabled.delete(p),TR())},[p,f]),k.useEffect(()=>{const O=()=>m({});return document.addEventListener(xx,O),()=>document.removeEventListener(xx,O)},[]),w.jsx(Xe.div,{...c,ref:S,style:{pointerEvents:_?C?"auto":"none":void 0,...e.style},onFocusCapture:We(e.onFocusCapture,T.onFocusCapture),onBlurCapture:We(e.onBlurCapture,T.onBlurCapture),onPointerDownCapture:We(e.onPointerDownCapture,N.onPointerDownCapture)})});gu.displayName=N8;var I8="DismissableLayerBranch",L8=k.forwardRef((e,t)=>{const n=k.useContext(gP),r=k.useRef(null),a=ft(t,r);return k.useEffect(()=>{const i=r.current;if(i)return n.branches.add(i),()=>{n.branches.delete(i)}},[n.branches]),w.jsx(Xe.div,{...e,ref:a})});L8.displayName=I8;function M8(e,t=globalThis==null?void 0:globalThis.document){const n=pn(e),r=k.useRef(!1),a=k.useRef(()=>{});return k.useEffect(()=>{const i=u=>{if(u.target&&!r.current){let c=function(){hP(O8,n,f,{discrete:!0})};const f={originalEvent:u};u.pointerType==="touch"?(t.removeEventListener("click",a.current),a.current=c,t.addEventListener("click",a.current,{once:!0})):c()}else t.removeEventListener("click",a.current);r.current=!1},l=window.setTimeout(()=>{t.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(l),t.removeEventListener("pointerdown",i),t.removeEventListener("click",a.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function F8(e,t=globalThis==null?void 0:globalThis.document){const n=pn(e),r=k.useRef(!1);return k.useEffect(()=>{const a=i=>{i.target&&!r.current&&hP(D8,n,{originalEvent:i},{discrete:!1})};return t.addEventListener("focusin",a),()=>t.removeEventListener("focusin",a)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function TR(){const e=new CustomEvent(xx);document.dispatchEvent(e)}function hP(e,t,n,{discrete:r}){const a=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&a.addEventListener(e,t,{once:!0}),r?R8(a,i):a.dispatchEvent(i)}var ph="focusScope.autoFocusOnMount",gh="focusScope.autoFocusOnUnmount",_R={bubbles:!1,cancelable:!0},z8="FocusScope",cf=k.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:a,onUnmountAutoFocus:i,...l}=e,[u,c]=k.useState(null),f=pn(a),p=pn(i),g=k.useRef(null),b=ft(t,v=>c(v)),m=k.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;k.useEffect(()=>{if(r){let v=function(_){if(m.paused||!u)return;const C=_.target;u.contains(C)?g.current=C:co(g.current,{select:!0})},A=function(_){if(m.paused||!u)return;const C=_.relatedTarget;C!==null&&(u.contains(C)||co(g.current,{select:!0}))},R=function(_){if(document.activeElement===document.body)for(const N of _)N.removedNodes.length>0&&co(u)};document.addEventListener("focusin",v),document.addEventListener("focusout",A);const x=new MutationObserver(R);return u&&x.observe(u,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",v),document.removeEventListener("focusout",A),x.disconnect()}}},[r,u,m.paused]),k.useEffect(()=>{if(u){CR.add(m);const v=document.activeElement;if(!u.contains(v)){const R=new CustomEvent(ph,_R);u.addEventListener(ph,f),u.dispatchEvent(R),R.defaultPrevented||(P8(H8(mP(u)),{select:!0}),document.activeElement===v&&co(u))}return()=>{u.removeEventListener(ph,f),setTimeout(()=>{const R=new CustomEvent(gh,_R);u.addEventListener(gh,p),u.dispatchEvent(R),R.defaultPrevented||co(v??document.body,{select:!0}),u.removeEventListener(gh,p),CR.remove(m)},0)}}},[u,f,p,m]);const S=k.useCallback(v=>{if(!n&&!r||m.paused)return;const A=v.key==="Tab"&&!v.altKey&&!v.ctrlKey&&!v.metaKey,R=document.activeElement;if(A&&R){const x=v.currentTarget,[_,C]=B8(x);_&&C?!v.shiftKey&&R===C?(v.preventDefault(),n&&co(_,{select:!0})):v.shiftKey&&R===_&&(v.preventDefault(),n&&co(C,{select:!0})):R===x&&v.preventDefault()}},[n,r,m.paused]);return w.jsx(Xe.div,{tabIndex:-1,...l,ref:b,onKeyDown:S})});cf.displayName=z8;function P8(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(co(r,{select:t}),document.activeElement!==n)return}function B8(e){const t=mP(e),n=RR(t,e),r=RR(t.reverse(),e);return[n,r]}function mP(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const a=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||a?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function RR(e,t){for(const n of e)if(!U8(n,{upTo:t}))return n}function U8(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 j8(e){return e instanceof HTMLInputElement&&"select"in e}function co(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&j8(e)&&t&&e.select()}}var CR=G8();function G8(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=NR(e,t),e.unshift(t)},remove(t){var n;e=NR(e,t),(n=e[0])==null||n.resume()}}}function NR(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function H8(e){return e.filter(t=>t.tagName!=="A")}var $8="Portal",df=k.forwardRef((e,t)=>{var u;const{container:n,...r}=e,[a,i]=k.useState(!1);wn(()=>i(!0),[]);const l=n||a&&((u=globalThis==null?void 0:globalThis.document)==null?void 0:u.body);return l?pP.createPortal(w.jsx(Xe.div,{...r,ref:t}),l):null});df.displayName=$8;function q8(e,t){return k.useReducer((n,r)=>t[n][r]??n,e)}var Jn=e=>{const{present:t,children:n}=e,r=V8(t),a=typeof n=="function"?n({present:r.isPresent}):k.Children.only(n),i=ft(r.ref,W8(a));return typeof n=="function"||r.isPresent?k.cloneElement(a,{ref:i}):null};Jn.displayName="Presence";function V8(e){const[t,n]=k.useState(),r=k.useRef({}),a=k.useRef(e),i=k.useRef("none"),l=e?"mounted":"unmounted",[u,c]=q8(l,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return k.useEffect(()=>{const f=zc(r.current);i.current=u==="mounted"?f:"none"},[u]),wn(()=>{const f=r.current,p=a.current;if(p!==e){const b=i.current,m=zc(f);e?c("MOUNT"):m==="none"||(f==null?void 0:f.display)==="none"?c("UNMOUNT"):c(p&&b!==m?"ANIMATION_OUT":"UNMOUNT"),a.current=e}},[e,c]),wn(()=>{if(t){let f;const p=t.ownerDocument.defaultView??window,g=m=>{const v=zc(r.current).includes(m.animationName);if(m.target===t&&v&&(c("ANIMATION_END"),!a.current)){const A=t.style.animationFillMode;t.style.animationFillMode="forwards",f=p.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=A)})}},b=m=>{m.target===t&&(i.current=zc(r.current))};return t.addEventListener("animationstart",b),t.addEventListener("animationcancel",g),t.addEventListener("animationend",g),()=>{p.clearTimeout(f),t.removeEventListener("animationstart",b),t.removeEventListener("animationcancel",g),t.removeEventListener("animationend",g)}}else c("ANIMATION_END")},[t,c]),{isPresent:["mounted","unmountSuspended"].includes(u),ref:k.useCallback(f=>{f&&(r.current=getComputedStyle(f)),n(f)},[])}}function zc(e){return(e==null?void 0:e.animationName)||"none"}function W8(e){var r,a;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(a=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:a.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var hh=0;function Dk(){k.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??OR()),document.body.insertAdjacentElement("beforeend",e[1]??OR()),hh++,()=>{hh===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),hh--}},[])}function OR(){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 Vr=function(){return Vr=Object.assign||function(t){for(var n,r=1,a=arguments.length;r"u")return c7;var t=d7(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},p7=SP(),ul="data-scroll-locked",g7=function(e,t,n,r){var a=e.left,i=e.top,l=e.right,u=e.gap;return n===void 0&&(n="margin"),` + .`.concat(K8,` { + overflow: hidden `).concat(r,`; + padding-right: `).concat(u,"px ").concat(r,`; + } + body[`).concat(ul,`] { + overflow: hidden `).concat(r,`; + overscroll-behavior: contain; + `).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&` + padding-left: `.concat(a,`px; + padding-top: `).concat(i,`px; + padding-right: `).concat(l,`px; + margin-left:0; + margin-top:0; + margin-right: `).concat(u,"px ").concat(r,`; + `),n==="padding"&&"padding-right: ".concat(u,"px ").concat(r,";")].filter(Boolean).join(""),` + } + + .`).concat(hd,` { + right: `).concat(u,"px ").concat(r,`; + } + + .`).concat(md,` { + margin-right: `).concat(u,"px ").concat(r,`; + } + + .`).concat(hd," .").concat(hd,` { + right: 0 `).concat(r,`; + } + + .`).concat(md," .").concat(md,` { + margin-right: 0 `).concat(r,`; + } + + body[`).concat(ul,`] { + `).concat(X8,": ").concat(u,`px; + } +`)},IR=function(){var e=parseInt(document.body.getAttribute(ul)||"0",10);return isFinite(e)?e:0},h7=function(){k.useEffect(function(){return document.body.setAttribute(ul,(IR()+1).toString()),function(){var e=IR()-1;e<=0?document.body.removeAttribute(ul):document.body.setAttribute(ul,e.toString())}},[])},m7=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,a=r===void 0?"margin":r;h7();var i=k.useMemo(function(){return f7(a)},[a]);return k.createElement(p7,{styles:g7(i,!t,a,n?"":"!important")})},kx=!1;if(typeof window<"u")try{var Pc=Object.defineProperty({},"passive",{get:function(){return kx=!0,!0}});window.addEventListener("test",Pc,Pc),window.removeEventListener("test",Pc,Pc)}catch{kx=!1}var Ki=kx?{passive:!1}:!1,b7=function(e){return e.tagName==="TEXTAREA"},EP=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!b7(e)&&n[t]==="visible")},y7=function(e){return EP(e,"overflowY")},v7=function(e){return EP(e,"overflowX")},LR=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var a=wP(e,r);if(a){var i=xP(e,r),l=i[1],u=i[2];if(l>u)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},S7=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},E7=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},wP=function(e,t){return e==="v"?y7(t):v7(t)},xP=function(e,t){return e==="v"?S7(t):E7(t)},w7=function(e,t){return e==="h"&&t==="rtl"?-1:1},x7=function(e,t,n,r,a){var i=w7(e,window.getComputedStyle(t).direction),l=i*r,u=n.target,c=t.contains(u),f=!1,p=l>0,g=0,b=0;do{var m=xP(e,u),S=m[0],v=m[1],A=m[2],R=v-A-i*S;(S||R)&&wP(e,u)&&(g+=R,b+=S),u instanceof ShadowRoot?u=u.host:u=u.parentNode}while(!c&&u!==document.body||c&&(t.contains(u)||t===u));return(p&&Math.abs(g)<1||!p&&Math.abs(b)<1)&&(f=!0),f},Bc=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},MR=function(e){return[e.deltaX,e.deltaY]},FR=function(e){return e&&"current"in e?e.current:e},k7=function(e,t){return e[0]===t[0]&&e[1]===t[1]},A7=function(e){return` + .block-interactivity-`.concat(e,` {pointer-events: none;} + .allow-interactivity-`).concat(e,` {pointer-events: all;} +`)},T7=0,Xi=[];function _7(e){var t=k.useRef([]),n=k.useRef([0,0]),r=k.useRef(),a=k.useState(T7++)[0],i=k.useState(SP)[0],l=k.useRef(e);k.useEffect(function(){l.current=e},[e]),k.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(a));var v=Y8([e.lockRef.current],(e.shards||[]).map(FR),!0).filter(Boolean);return v.forEach(function(A){return A.classList.add("allow-interactivity-".concat(a))}),function(){document.body.classList.remove("block-interactivity-".concat(a)),v.forEach(function(A){return A.classList.remove("allow-interactivity-".concat(a))})}}},[e.inert,e.lockRef.current,e.shards]);var u=k.useCallback(function(v,A){if("touches"in v&&v.touches.length===2||v.type==="wheel"&&v.ctrlKey)return!l.current.allowPinchZoom;var R=Bc(v),x=n.current,_="deltaX"in v?v.deltaX:x[0]-R[0],C="deltaY"in v?v.deltaY:x[1]-R[1],N,T=v.target,O=Math.abs(_)>Math.abs(C)?"h":"v";if("touches"in v&&O==="h"&&T.type==="range")return!1;var z=LR(O,T);if(!z)return!0;if(z?N=O:(N=O==="v"?"h":"v",z=LR(O,T)),!z)return!1;if(!r.current&&"changedTouches"in v&&(_||C)&&(r.current=N),!N)return!0;var I=r.current||N;return x7(I,A,v,I==="h"?_:C)},[]),c=k.useCallback(function(v){var A=v;if(!(!Xi.length||Xi[Xi.length-1]!==i)){var R="deltaY"in A?MR(A):Bc(A),x=t.current.filter(function(N){return N.name===A.type&&(N.target===A.target||A.target===N.shadowParent)&&k7(N.delta,R)})[0];if(x&&x.should){A.cancelable&&A.preventDefault();return}if(!x){var _=(l.current.shards||[]).map(FR).filter(Boolean).filter(function(N){return N.contains(A.target)}),C=_.length>0?u(A,_[0]):!l.current.noIsolation;C&&A.cancelable&&A.preventDefault()}}},[]),f=k.useCallback(function(v,A,R,x){var _={name:v,delta:A,target:R,should:x,shadowParent:R7(R)};t.current.push(_),setTimeout(function(){t.current=t.current.filter(function(C){return C!==_})},1)},[]),p=k.useCallback(function(v){n.current=Bc(v),r.current=void 0},[]),g=k.useCallback(function(v){f(v.type,MR(v),v.target,u(v,e.lockRef.current))},[]),b=k.useCallback(function(v){f(v.type,Bc(v),v.target,u(v,e.lockRef.current))},[]);k.useEffect(function(){return Xi.push(i),e.setCallbacks({onScrollCapture:g,onWheelCapture:g,onTouchMoveCapture:b}),document.addEventListener("wheel",c,Ki),document.addEventListener("touchmove",c,Ki),document.addEventListener("touchstart",p,Ki),function(){Xi=Xi.filter(function(v){return v!==i}),document.removeEventListener("wheel",c,Ki),document.removeEventListener("touchmove",c,Ki),document.removeEventListener("touchstart",p,Ki)}},[]);var m=e.removeScrollBar,S=e.inert;return k.createElement(k.Fragment,null,S?k.createElement(i,{styles:A7(a)}):null,m?k.createElement(m7,{gapMode:e.gapMode}):null)}function R7(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const C7=r7(vP,_7);var pf=k.forwardRef(function(e,t){return k.createElement(ff,Vr({},e,{ref:t,sideCar:C7}))});pf.classNames=ff.classNames;var N7=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Zi=new WeakMap,Uc=new WeakMap,jc={},vh=0,kP=function(e){return e&&(e.host||kP(e.parentNode))},O7=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=kP(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},D7=function(e,t,n,r){var a=O7(t,Array.isArray(e)?e:[e]);jc[n]||(jc[n]=new WeakMap);var i=jc[n],l=[],u=new Set,c=new Set(a),f=function(g){!g||u.has(g)||(u.add(g),f(g.parentNode))};a.forEach(f);var p=function(g){!g||c.has(g)||Array.prototype.forEach.call(g.children,function(b){if(u.has(b))p(b);else try{var m=b.getAttribute(r),S=m!==null&&m!=="false",v=(Zi.get(b)||0)+1,A=(i.get(b)||0)+1;Zi.set(b,v),i.set(b,A),l.push(b),v===1&&S&&Uc.set(b,!0),A===1&&b.setAttribute(n,"true"),S||b.setAttribute(r,"true")}catch(R){console.error("aria-hidden: cannot operate on ",b,R)}})};return p(t),u.clear(),vh++,function(){l.forEach(function(g){var b=Zi.get(g)-1,m=i.get(g)-1;Zi.set(g,b),i.set(g,m),b||(Uc.has(g)||g.removeAttribute(r),Uc.delete(g)),m||g.removeAttribute(n)}),vh--,vh||(Zi=new WeakMap,Zi=new WeakMap,Uc=new WeakMap,jc={})}},Ik=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),a=N7(e);return a?(r.push.apply(r,Array.from(a.querySelectorAll("[aria-live]"))),D7(r,a,n,"aria-hidden")):function(){return null}},Lk="Dialog",[AP,TP]=mr(Lk),[I7,Fr]=AP(Lk),_P=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:a,onOpenChange:i,modal:l=!0}=e,u=k.useRef(null),c=k.useRef(null),[f=!1,p]=Oa({prop:r,defaultProp:a,onChange:i});return w.jsx(I7,{scope:t,triggerRef:u,contentRef:c,contentId:En(),titleId:En(),descriptionId:En(),open:f,onOpenChange:p,onOpenToggle:k.useCallback(()=>p(g=>!g),[p]),modal:l,children:n})};_P.displayName=Lk;var RP="DialogTrigger",CP=k.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,a=Fr(RP,n),i=ft(t,a.triggerRef);return w.jsx(Xe.button,{type:"button","aria-haspopup":"dialog","aria-expanded":a.open,"aria-controls":a.contentId,"data-state":zk(a.open),...r,ref:i,onClick:We(e.onClick,a.onOpenToggle)})});CP.displayName=RP;var Mk="DialogPortal",[L7,NP]=AP(Mk,{forceMount:void 0}),OP=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:a}=e,i=Fr(Mk,t);return w.jsx(L7,{scope:t,forceMount:n,children:k.Children.map(r,l=>w.jsx(Jn,{present:n||i.open,children:w.jsx(df,{asChild:!0,container:a,children:l})}))})};OP.displayName=Mk;var Dd="DialogOverlay",DP=k.forwardRef((e,t)=>{const n=NP(Dd,e.__scopeDialog),{forceMount:r=n.forceMount,...a}=e,i=Fr(Dd,e.__scopeDialog);return i.modal?w.jsx(Jn,{present:r||i.open,children:w.jsx(M7,{...a,ref:t})}):null});DP.displayName=Dd;var M7=k.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,a=Fr(Dd,n);return w.jsx(pf,{as:bo,allowPinchZoom:!0,shards:[a.contentRef],children:w.jsx(Xe.div,{"data-state":zk(a.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),ai="DialogContent",IP=k.forwardRef((e,t)=>{const n=NP(ai,e.__scopeDialog),{forceMount:r=n.forceMount,...a}=e,i=Fr(ai,e.__scopeDialog);return w.jsx(Jn,{present:r||i.open,children:i.modal?w.jsx(F7,{...a,ref:t}):w.jsx(z7,{...a,ref:t})})});IP.displayName=ai;var F7=k.forwardRef((e,t)=>{const n=Fr(ai,e.__scopeDialog),r=k.useRef(null),a=ft(t,n.contentRef,r);return k.useEffect(()=>{const i=r.current;if(i)return Ik(i)},[]),w.jsx(LP,{...e,ref:a,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:We(e.onCloseAutoFocus,i=>{var l;i.preventDefault(),(l=n.triggerRef.current)==null||l.focus()}),onPointerDownOutside:We(e.onPointerDownOutside,i=>{const l=i.detail.originalEvent,u=l.button===0&&l.ctrlKey===!0;(l.button===2||u)&&i.preventDefault()}),onFocusOutside:We(e.onFocusOutside,i=>i.preventDefault())})}),z7=k.forwardRef((e,t)=>{const n=Fr(ai,e.__scopeDialog),r=k.useRef(!1),a=k.useRef(!1);return w.jsx(LP,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var l,u;(l=e.onCloseAutoFocus)==null||l.call(e,i),i.defaultPrevented||(r.current||(u=n.triggerRef.current)==null||u.focus(),i.preventDefault()),r.current=!1,a.current=!1},onInteractOutside:i=>{var c,f;(c=e.onInteractOutside)==null||c.call(e,i),i.defaultPrevented||(r.current=!0,i.detail.originalEvent.type==="pointerdown"&&(a.current=!0));const l=i.target;((f=n.triggerRef.current)==null?void 0:f.contains(l))&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&a.current&&i.preventDefault()}})}),LP=k.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:a,onCloseAutoFocus:i,...l}=e,u=Fr(ai,n),c=k.useRef(null),f=ft(t,c);return Dk(),w.jsxs(w.Fragment,{children:[w.jsx(cf,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:a,onUnmountAutoFocus:i,children:w.jsx(gu,{role:"dialog",id:u.contentId,"aria-describedby":u.descriptionId,"aria-labelledby":u.titleId,"data-state":zk(u.open),...l,ref:f,onDismiss:()=>u.onOpenChange(!1)})}),w.jsxs(w.Fragment,{children:[w.jsx(B7,{titleId:u.titleId}),w.jsx(j7,{contentRef:c,descriptionId:u.descriptionId})]})]})}),Fk="DialogTitle",MP=k.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,a=Fr(Fk,n);return w.jsx(Xe.h2,{id:a.titleId,...r,ref:t})});MP.displayName=Fk;var FP="DialogDescription",zP=k.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,a=Fr(FP,n);return w.jsx(Xe.p,{id:a.descriptionId,...r,ref:t})});zP.displayName=FP;var PP="DialogClose",BP=k.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,a=Fr(PP,n);return w.jsx(Xe.button,{type:"button",...r,ref:t,onClick:We(e.onClick,()=>a.onOpenChange(!1))})});BP.displayName=PP;function zk(e){return e?"open":"closed"}var UP="DialogTitleWarning",[P7,jP]=v8(UP,{contentName:ai,titleName:Fk,docsSlug:"dialog"}),B7=({titleId:e})=>{const t=jP(UP),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 k.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},U7="DialogDescriptionWarning",j7=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${jP(U7).contentName}}.`;return k.useEffect(()=>{var i;const a=(i=e.current)==null?void 0:i.getAttribute("aria-describedby");t&&a&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},Pk=_P,GP=CP,Bk=OP,gf=DP,hf=IP,Uk=MP,jk=zP,Gk=BP,HP="AlertDialog",[G7,Qye]=mr(HP,[TP]),La=TP(),$P=e=>{const{__scopeAlertDialog:t,...n}=e,r=La(t);return w.jsx(Pk,{...r,...n,modal:!0})};$P.displayName=HP;var H7="AlertDialogTrigger",$7=k.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,a=La(n);return w.jsx(GP,{...a,...r,ref:t})});$7.displayName=H7;var q7="AlertDialogPortal",qP=e=>{const{__scopeAlertDialog:t,...n}=e,r=La(t);return w.jsx(Bk,{...r,...n})};qP.displayName=q7;var V7="AlertDialogOverlay",VP=k.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,a=La(n);return w.jsx(gf,{...a,...r,ref:t})});VP.displayName=V7;var cl="AlertDialogContent",[W7,Y7]=G7(cl),WP=k.forwardRef((e,t)=>{const{__scopeAlertDialog:n,children:r,...a}=e,i=La(n),l=k.useRef(null),u=ft(t,l),c=k.useRef(null);return w.jsx(P7,{contentName:cl,titleName:YP,docsSlug:"alert-dialog",children:w.jsx(W7,{scope:n,cancelRef:c,children:w.jsxs(hf,{role:"alertdialog",...i,...a,ref:u,onOpenAutoFocus:We(a.onOpenAutoFocus,f=>{var p;f.preventDefault(),(p=c.current)==null||p.focus({preventScroll:!0})}),onPointerDownOutside:f=>f.preventDefault(),onInteractOutside:f=>f.preventDefault(),children:[w.jsx(Ok,{children:r}),w.jsx(X7,{contentRef:l})]})})})});WP.displayName=cl;var YP="AlertDialogTitle",KP=k.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,a=La(n);return w.jsx(Uk,{...a,...r,ref:t})});KP.displayName=YP;var XP="AlertDialogDescription",ZP=k.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,a=La(n);return w.jsx(jk,{...a,...r,ref:t})});ZP.displayName=XP;var K7="AlertDialogAction",QP=k.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,a=La(n);return w.jsx(Gk,{...a,...r,ref:t})});QP.displayName=K7;var JP="AlertDialogCancel",eB=k.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,{cancelRef:a}=Y7(JP,n),i=La(n),l=ft(t,a);return w.jsx(Gk,{...i,...r,ref:l})});eB.displayName=JP;var X7=({contentRef:e})=>{const t=`\`${cl}\` requires a description for the component to be accessible for screen reader users. + +You can add a description to the \`${cl}\` by passing a \`${XP}\` 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 \`${cl}\`. 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 k.useEffect(()=>{var r;document.getElementById((r=e.current)==null?void 0:r.getAttribute("aria-describedby"))||console.warn(t)},[t,e]),null},Z7=$P,Q7=qP,tB=VP,nB=WP,rB=QP,aB=eB,oB=KP,iB=ZP;const J7=["top","right","bottom","left"],yo=Math.min,Kn=Math.max,Id=Math.round,Gc=Math.floor,Kr=e=>({x:e,y:e}),eV={left:"right",right:"left",bottom:"top",top:"bottom"},tV={start:"end",end:"start"};function Ax(e,t,n){return Kn(e,yo(t,n))}function Da(e,t){return typeof e=="function"?e(t):e}function Ia(e){return e.split("-")[0]}function _l(e){return e.split("-")[1]}function Hk(e){return e==="x"?"y":"x"}function $k(e){return e==="y"?"height":"width"}function vo(e){return["top","bottom"].includes(Ia(e))?"y":"x"}function qk(e){return Hk(vo(e))}function nV(e,t,n){n===void 0&&(n=!1);const r=_l(e),a=qk(e),i=$k(a);let l=a==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(l=Ld(l)),[l,Ld(l)]}function rV(e){const t=Ld(e);return[Tx(e),t,Tx(t)]}function Tx(e){return e.replace(/start|end/g,t=>tV[t])}function aV(e,t,n){const r=["left","right"],a=["right","left"],i=["top","bottom"],l=["bottom","top"];switch(e){case"top":case"bottom":return n?t?a:r:t?r:a;case"left":case"right":return t?i:l;default:return[]}}function oV(e,t,n,r){const a=_l(e);let i=aV(Ia(e),n==="start",r);return a&&(i=i.map(l=>l+"-"+a),t&&(i=i.concat(i.map(Tx)))),i}function Ld(e){return e.replace(/left|right|bottom|top/g,t=>eV[t])}function iV(e){return{top:0,right:0,bottom:0,left:0,...e}}function lB(e){return typeof e!="number"?iV(e):{top:e,right:e,bottom:e,left:e}}function Md(e){const{x:t,y:n,width:r,height:a}=e;return{width:r,height:a,top:n,left:t,right:t+r,bottom:n+a,x:t,y:n}}function zR(e,t,n){let{reference:r,floating:a}=e;const i=vo(t),l=qk(t),u=$k(l),c=Ia(t),f=i==="y",p=r.x+r.width/2-a.width/2,g=r.y+r.height/2-a.height/2,b=r[u]/2-a[u]/2;let m;switch(c){case"top":m={x:p,y:r.y-a.height};break;case"bottom":m={x:p,y:r.y+r.height};break;case"right":m={x:r.x+r.width,y:g};break;case"left":m={x:r.x-a.width,y:g};break;default:m={x:r.x,y:r.y}}switch(_l(t)){case"start":m[l]-=b*(n&&f?-1:1);break;case"end":m[l]+=b*(n&&f?-1:1);break}return m}const lV=async(e,t,n)=>{const{placement:r="bottom",strategy:a="absolute",middleware:i=[],platform:l}=n,u=i.filter(Boolean),c=await(l.isRTL==null?void 0:l.isRTL(t));let f=await l.getElementRects({reference:e,floating:t,strategy:a}),{x:p,y:g}=zR(f,r,c),b=r,m={},S=0;for(let v=0;v({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:a,rects:i,platform:l,elements:u,middlewareData:c}=t,{element:f,padding:p=0}=Da(e,t)||{};if(f==null)return{};const g=lB(p),b={x:n,y:r},m=qk(a),S=$k(m),v=await l.getDimensions(f),A=m==="y",R=A?"top":"left",x=A?"bottom":"right",_=A?"clientHeight":"clientWidth",C=i.reference[S]+i.reference[m]-b[m]-i.floating[S],N=b[m]-i.reference[m],T=await(l.getOffsetParent==null?void 0:l.getOffsetParent(f));let O=T?T[_]:0;(!O||!await(l.isElement==null?void 0:l.isElement(T)))&&(O=u.floating[_]||i.floating[S]);const z=C/2-N/2,I=O/2-v[S]/2-1,M=yo(g[R],I),H=yo(g[x],I),q=M,U=O-v[S]-H,W=O/2-v[S]/2+z,Z=Ax(q,W,U),j=!c.arrow&&_l(a)!=null&&W!==Z&&i.reference[S]/2-(WW<=0)){var H,q;const W=(((H=i.flip)==null?void 0:H.index)||0)+1,Z=O[W];if(Z)return{data:{index:W,overflows:M},reset:{placement:Z}};let j=(q=M.filter(G=>G.overflows[0]<=0).sort((G,P)=>G.overflows[1]-P.overflows[1])[0])==null?void 0:q.placement;if(!j)switch(m){case"bestFit":{var U;const G=(U=M.filter(P=>{if(T){const X=vo(P.placement);return X===x||X==="y"}return!0}).map(P=>[P.placement,P.overflows.filter(X=>X>0).reduce((X,D)=>X+D,0)]).sort((P,X)=>P[1]-X[1])[0])==null?void 0:U[0];G&&(j=G);break}case"initialPlacement":j=u;break}if(a!==j)return{reset:{placement:j}}}return{}}}};function PR(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function BR(e){return J7.some(t=>e[t]>=0)}const cV=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...a}=Da(e,t);switch(r){case"referenceHidden":{const i=await Js(t,{...a,elementContext:"reference"}),l=PR(i,n.reference);return{data:{referenceHiddenOffsets:l,referenceHidden:BR(l)}}}case"escaped":{const i=await Js(t,{...a,altBoundary:!0}),l=PR(i,n.floating);return{data:{escapedOffsets:l,escaped:BR(l)}}}default:return{}}}}};async function dV(e,t){const{placement:n,platform:r,elements:a}=e,i=await(r.isRTL==null?void 0:r.isRTL(a.floating)),l=Ia(n),u=_l(n),c=vo(n)==="y",f=["left","top"].includes(l)?-1:1,p=i&&c?-1:1,g=Da(t,e);let{mainAxis:b,crossAxis:m,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"&&(m=u==="end"?S*-1:S),c?{x:m*p,y:b*f}:{x:b*f,y:m*p}}const fV=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:a,y:i,placement:l,middlewareData:u}=t,c=await dV(t,e);return l===((n=u.offset)==null?void 0:n.placement)&&(r=u.arrow)!=null&&r.alignmentOffset?{}:{x:a+c.x,y:i+c.y,data:{...c,placement:l}}}}},pV=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:a}=t,{mainAxis:i=!0,crossAxis:l=!1,limiter:u={fn:A=>{let{x:R,y:x}=A;return{x:R,y:x}}},...c}=Da(e,t),f={x:n,y:r},p=await Js(t,c),g=vo(Ia(a)),b=Hk(g);let m=f[b],S=f[g];if(i){const A=b==="y"?"top":"left",R=b==="y"?"bottom":"right",x=m+p[A],_=m-p[R];m=Ax(x,m,_)}if(l){const A=g==="y"?"top":"left",R=g==="y"?"bottom":"right",x=S+p[A],_=S-p[R];S=Ax(x,S,_)}const v=u.fn({...t,[b]:m,[g]:S});return{...v,data:{x:v.x-n,y:v.y-r,enabled:{[b]:i,[g]:l}}}}}},gV=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:a,rects:i,middlewareData:l}=t,{offset:u=0,mainAxis:c=!0,crossAxis:f=!0}=Da(e,t),p={x:n,y:r},g=vo(a),b=Hk(g);let m=p[b],S=p[g];const v=Da(u,t),A=typeof v=="number"?{mainAxis:v,crossAxis:0}:{mainAxis:0,crossAxis:0,...v};if(c){const _=b==="y"?"height":"width",C=i.reference[b]-i.floating[_]+A.mainAxis,N=i.reference[b]+i.reference[_]-A.mainAxis;mN&&(m=N)}if(f){var R,x;const _=b==="y"?"width":"height",C=["top","left"].includes(Ia(a)),N=i.reference[g]-i.floating[_]+(C&&((R=l.offset)==null?void 0:R[g])||0)+(C?0:A.crossAxis),T=i.reference[g]+i.reference[_]+(C?0:((x=l.offset)==null?void 0:x[g])||0)-(C?A.crossAxis:0);ST&&(S=T)}return{[b]:m,[g]:S}}}},hV=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:a,rects:i,platform:l,elements:u}=t,{apply:c=()=>{},...f}=Da(e,t),p=await Js(t,f),g=Ia(a),b=_l(a),m=vo(a)==="y",{width:S,height:v}=i.floating;let A,R;g==="top"||g==="bottom"?(A=g,R=b===(await(l.isRTL==null?void 0:l.isRTL(u.floating))?"start":"end")?"left":"right"):(R=g,A=b==="end"?"top":"bottom");const x=v-p.top-p.bottom,_=S-p.left-p.right,C=yo(v-p[A],x),N=yo(S-p[R],_),T=!t.middlewareData.shift;let O=C,z=N;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(z=_),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(O=x),T&&!b){const M=Kn(p.left,0),H=Kn(p.right,0),q=Kn(p.top,0),U=Kn(p.bottom,0);m?z=S-2*(M!==0||H!==0?M+H:Kn(p.left,p.right)):O=v-2*(q!==0||U!==0?q+U:Kn(p.top,p.bottom))}await c({...t,availableWidth:z,availableHeight:O});const I=await l.getDimensions(u.floating);return S!==I.width||v!==I.height?{reset:{rects:!0}}:{}}}};function mf(){return typeof window<"u"}function Rl(e){return sB(e)?(e.nodeName||"").toLowerCase():"#document"}function Zn(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Zr(e){var t;return(t=(sB(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function sB(e){return mf()?e instanceof Node||e instanceof Zn(e).Node:!1}function Dr(e){return mf()?e instanceof Element||e instanceof Zn(e).Element:!1}function Xr(e){return mf()?e instanceof HTMLElement||e instanceof Zn(e).HTMLElement:!1}function UR(e){return!mf()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Zn(e).ShadowRoot}function hu(e){const{overflow:t,overflowX:n,overflowY:r,display:a}=Ir(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(a)}function mV(e){return["table","td","th"].includes(Rl(e))}function bf(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function Vk(e){const t=Wk(),n=Dr(e)?Ir(e):e;return["transform","translate","scale","rotate","perspective"].some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||["transform","translate","scale","rotate","perspective","filter"].some(r=>(n.willChange||"").includes(r))||["paint","layout","strict","content"].some(r=>(n.contain||"").includes(r))}function bV(e){let t=So(e);for(;Xr(t)&&!hl(t);){if(Vk(t))return t;if(bf(t))return null;t=So(t)}return null}function Wk(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function hl(e){return["html","body","#document"].includes(Rl(e))}function Ir(e){return Zn(e).getComputedStyle(e)}function yf(e){return Dr(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function So(e){if(Rl(e)==="html")return e;const t=e.assignedSlot||e.parentNode||UR(e)&&e.host||Zr(e);return UR(t)?t.host:t}function uB(e){const t=So(e);return hl(t)?e.ownerDocument?e.ownerDocument.body:e.body:Xr(t)&&hu(t)?t:uB(t)}function eu(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const a=uB(e),i=a===((r=e.ownerDocument)==null?void 0:r.body),l=Zn(a);if(i){const u=_x(l);return t.concat(l,l.visualViewport||[],hu(a)?a:[],u&&n?eu(u):[])}return t.concat(a,eu(a,[],n))}function _x(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function cB(e){const t=Ir(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const a=Xr(e),i=a?e.offsetWidth:n,l=a?e.offsetHeight:r,u=Id(n)!==i||Id(r)!==l;return u&&(n=i,r=l),{width:n,height:r,$:u}}function Yk(e){return Dr(e)?e:e.contextElement}function dl(e){const t=Yk(e);if(!Xr(t))return Kr(1);const n=t.getBoundingClientRect(),{width:r,height:a,$:i}=cB(t);let l=(i?Id(n.width):n.width)/r,u=(i?Id(n.height):n.height)/a;return(!l||!Number.isFinite(l))&&(l=1),(!u||!Number.isFinite(u))&&(u=1),{x:l,y:u}}const yV=Kr(0);function dB(e){const t=Zn(e);return!Wk()||!t.visualViewport?yV:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function vV(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Zn(e)?!1:t}function oi(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const a=e.getBoundingClientRect(),i=Yk(e);let l=Kr(1);t&&(r?Dr(r)&&(l=dl(r)):l=dl(e));const u=vV(i,n,r)?dB(i):Kr(0);let c=(a.left+u.x)/l.x,f=(a.top+u.y)/l.y,p=a.width/l.x,g=a.height/l.y;if(i){const b=Zn(i),m=r&&Dr(r)?Zn(r):r;let S=b,v=_x(S);for(;v&&r&&m!==S;){const A=dl(v),R=v.getBoundingClientRect(),x=Ir(v),_=R.left+(v.clientLeft+parseFloat(x.paddingLeft))*A.x,C=R.top+(v.clientTop+parseFloat(x.paddingTop))*A.y;c*=A.x,f*=A.y,p*=A.x,g*=A.y,c+=_,f+=C,S=Zn(v),v=_x(S)}}return Md({width:p,height:g,x:c,y:f})}function Kk(e,t){const n=yf(e).scrollLeft;return t?t.left+n:oi(Zr(e)).left+n}function fB(e,t,n){n===void 0&&(n=!1);const r=e.getBoundingClientRect(),a=r.left+t.scrollLeft-(n?0:Kk(e,r)),i=r.top+t.scrollTop;return{x:a,y:i}}function SV(e){let{elements:t,rect:n,offsetParent:r,strategy:a}=e;const i=a==="fixed",l=Zr(r),u=t?bf(t.floating):!1;if(r===l||u&&i)return n;let c={scrollLeft:0,scrollTop:0},f=Kr(1);const p=Kr(0),g=Xr(r);if((g||!g&&!i)&&((Rl(r)!=="body"||hu(l))&&(c=yf(r)),Xr(r))){const m=oi(r);f=dl(r),p.x=m.x+r.clientLeft,p.y=m.y+r.clientTop}const b=l&&!g&&!i?fB(l,c,!0):Kr(0);return{width:n.width*f.x,height:n.height*f.y,x:n.x*f.x-c.scrollLeft*f.x+p.x+b.x,y:n.y*f.y-c.scrollTop*f.y+p.y+b.y}}function EV(e){return Array.from(e.getClientRects())}function wV(e){const t=Zr(e),n=yf(e),r=e.ownerDocument.body,a=Kn(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=Kn(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let l=-n.scrollLeft+Kk(e);const u=-n.scrollTop;return Ir(r).direction==="rtl"&&(l+=Kn(t.clientWidth,r.clientWidth)-a),{width:a,height:i,x:l,y:u}}function xV(e,t){const n=Zn(e),r=Zr(e),a=n.visualViewport;let i=r.clientWidth,l=r.clientHeight,u=0,c=0;if(a){i=a.width,l=a.height;const f=Wk();(!f||f&&t==="fixed")&&(u=a.offsetLeft,c=a.offsetTop)}return{width:i,height:l,x:u,y:c}}function kV(e,t){const n=oi(e,!0,t==="fixed"),r=n.top+e.clientTop,a=n.left+e.clientLeft,i=Xr(e)?dl(e):Kr(1),l=e.clientWidth*i.x,u=e.clientHeight*i.y,c=a*i.x,f=r*i.y;return{width:l,height:u,x:c,y:f}}function jR(e,t,n){let r;if(t==="viewport")r=xV(e,n);else if(t==="document")r=wV(Zr(e));else if(Dr(t))r=kV(t,n);else{const a=dB(e);r={x:t.x-a.x,y:t.y-a.y,width:t.width,height:t.height}}return Md(r)}function pB(e,t){const n=So(e);return n===t||!Dr(n)||hl(n)?!1:Ir(n).position==="fixed"||pB(n,t)}function AV(e,t){const n=t.get(e);if(n)return n;let r=eu(e,[],!1).filter(u=>Dr(u)&&Rl(u)!=="body"),a=null;const i=Ir(e).position==="fixed";let l=i?So(e):e;for(;Dr(l)&&!hl(l);){const u=Ir(l),c=Vk(l);!c&&u.position==="fixed"&&(a=null),(i?!c&&!a:!c&&u.position==="static"&&!!a&&["absolute","fixed"].includes(a.position)||hu(l)&&!c&&pB(e,l))?r=r.filter(p=>p!==l):a=u,l=So(l)}return t.set(e,r),r}function TV(e){let{element:t,boundary:n,rootBoundary:r,strategy:a}=e;const l=[...n==="clippingAncestors"?bf(t)?[]:AV(t,this._c):[].concat(n),r],u=l[0],c=l.reduce((f,p)=>{const g=jR(t,p,a);return f.top=Kn(g.top,f.top),f.right=yo(g.right,f.right),f.bottom=yo(g.bottom,f.bottom),f.left=Kn(g.left,f.left),f},jR(t,u,a));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function _V(e){const{width:t,height:n}=cB(e);return{width:t,height:n}}function RV(e,t,n){const r=Xr(t),a=Zr(t),i=n==="fixed",l=oi(e,!0,i,t);let u={scrollLeft:0,scrollTop:0};const c=Kr(0);if(r||!r&&!i)if((Rl(t)!=="body"||hu(a))&&(u=yf(t)),r){const b=oi(t,!0,i,t);c.x=b.x+t.clientLeft,c.y=b.y+t.clientTop}else a&&(c.x=Kk(a));const f=a&&!r&&!i?fB(a,u):Kr(0),p=l.left+u.scrollLeft-c.x-f.x,g=l.top+u.scrollTop-c.y-f.y;return{x:p,y:g,width:l.width,height:l.height}}function Sh(e){return Ir(e).position==="static"}function GR(e,t){if(!Xr(e)||Ir(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Zr(e)===n&&(n=n.ownerDocument.body),n}function gB(e,t){const n=Zn(e);if(bf(e))return n;if(!Xr(e)){let a=So(e);for(;a&&!hl(a);){if(Dr(a)&&!Sh(a))return a;a=So(a)}return n}let r=GR(e,t);for(;r&&mV(r)&&Sh(r);)r=GR(r,t);return r&&hl(r)&&Sh(r)&&!Vk(r)?n:r||bV(e)||n}const CV=async function(e){const t=this.getOffsetParent||gB,n=this.getDimensions,r=await n(e.floating);return{reference:RV(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function NV(e){return Ir(e).direction==="rtl"}const OV={convertOffsetParentRelativeRectToViewportRelativeRect:SV,getDocumentElement:Zr,getClippingRect:TV,getOffsetParent:gB,getElementRects:CV,getClientRects:EV,getDimensions:_V,getScale:dl,isElement:Dr,isRTL:NV};function hB(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function DV(e,t){let n=null,r;const a=Zr(e);function i(){var u;clearTimeout(r),(u=n)==null||u.disconnect(),n=null}function l(u,c){u===void 0&&(u=!1),c===void 0&&(c=1),i();const f=e.getBoundingClientRect(),{left:p,top:g,width:b,height:m}=f;if(u||t(),!b||!m)return;const S=Gc(g),v=Gc(a.clientWidth-(p+b)),A=Gc(a.clientHeight-(g+m)),R=Gc(p),_={rootMargin:-S+"px "+-v+"px "+-A+"px "+-R+"px",threshold:Kn(0,yo(1,c))||1};let C=!0;function N(T){const O=T[0].intersectionRatio;if(O!==c){if(!C)return l();O?l(!1,O):r=setTimeout(()=>{l(!1,1e-7)},1e3)}O===1&&!hB(f,e.getBoundingClientRect())&&l(),C=!1}try{n=new IntersectionObserver(N,{..._,root:a.ownerDocument})}catch{n=new IntersectionObserver(N,_)}n.observe(e)}return l(!0),i}function IV(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:a=!0,ancestorResize:i=!0,elementResize:l=typeof ResizeObserver=="function",layoutShift:u=typeof IntersectionObserver=="function",animationFrame:c=!1}=r,f=Yk(e),p=a||i?[...f?eu(f):[],...eu(t)]:[];p.forEach(R=>{a&&R.addEventListener("scroll",n,{passive:!0}),i&&R.addEventListener("resize",n)});const g=f&&u?DV(f,n):null;let b=-1,m=null;l&&(m=new ResizeObserver(R=>{let[x]=R;x&&x.target===f&&m&&(m.unobserve(t),cancelAnimationFrame(b),b=requestAnimationFrame(()=>{var _;(_=m)==null||_.observe(t)})),n()}),f&&!c&&m.observe(f),m.observe(t));let S,v=c?oi(e):null;c&&A();function A(){const R=oi(e);v&&!hB(v,R)&&n(),v=R,S=requestAnimationFrame(A)}return n(),()=>{var R;p.forEach(x=>{a&&x.removeEventListener("scroll",n),i&&x.removeEventListener("resize",n)}),g==null||g(),(R=m)==null||R.disconnect(),m=null,c&&cancelAnimationFrame(S)}}const LV=fV,MV=pV,FV=uV,zV=hV,PV=cV,HR=sV,BV=gV,UV=(e,t,n)=>{const r=new Map,a={platform:OV,...n},i={...a.platform,_c:r};return lV(e,t,{...a,platform:i})};var bd=typeof document<"u"?k.useLayoutEffect:k.useEffect;function Fd(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,a;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!Fd(e[r],t[r]))return!1;return!0}if(a=Object.keys(e),n=a.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,a[r]))return!1;for(r=n;r--!==0;){const i=a[r];if(!(i==="_owner"&&e.$$typeof)&&!Fd(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function mB(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function $R(e,t){const n=mB(e);return Math.round(t*n)/n}function Eh(e){const t=k.useRef(e);return bd(()=>{t.current=e}),t}function jV(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:a,elements:{reference:i,floating:l}={},transform:u=!0,whileElementsMounted:c,open:f}=e,[p,g]=k.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[b,m]=k.useState(r);Fd(b,r)||m(r);const[S,v]=k.useState(null),[A,R]=k.useState(null),x=k.useCallback(P=>{P!==T.current&&(T.current=P,v(P))},[]),_=k.useCallback(P=>{P!==O.current&&(O.current=P,R(P))},[]),C=i||S,N=l||A,T=k.useRef(null),O=k.useRef(null),z=k.useRef(p),I=c!=null,M=Eh(c),H=Eh(a),q=Eh(f),U=k.useCallback(()=>{if(!T.current||!O.current)return;const P={placement:t,strategy:n,middleware:b};H.current&&(P.platform=H.current),UV(T.current,O.current,P).then(X=>{const D={...X,isPositioned:q.current!==!1};W.current&&!Fd(z.current,D)&&(z.current=D,pu.flushSync(()=>{g(D)}))})},[b,t,n,H,q]);bd(()=>{f===!1&&z.current.isPositioned&&(z.current.isPositioned=!1,g(P=>({...P,isPositioned:!1})))},[f]);const W=k.useRef(!1);bd(()=>(W.current=!0,()=>{W.current=!1}),[]),bd(()=>{if(C&&(T.current=C),N&&(O.current=N),C&&N){if(M.current)return M.current(C,N,U);U()}},[C,N,U,M,I]);const Z=k.useMemo(()=>({reference:T,floating:O,setReference:x,setFloating:_}),[x,_]),j=k.useMemo(()=>({reference:C,floating:N}),[C,N]),G=k.useMemo(()=>{const P={position:n,left:0,top:0};if(!j.floating)return P;const X=$R(j.floating,p.x),D=$R(j.floating,p.y);return u?{...P,transform:"translate("+X+"px, "+D+"px)",...mB(j.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:X,top:D}},[n,u,j.floating,p.x,p.y]);return k.useMemo(()=>({...p,update:U,refs:Z,elements:j,floatingStyles:G}),[p,U,Z,j,G])}const GV=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:a}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?HR({element:r.current,padding:a}).fn(n):{}:r?HR({element:r,padding:a}).fn(n):{}}}},HV=(e,t)=>({...LV(e),options:[e,t]}),$V=(e,t)=>({...MV(e),options:[e,t]}),qV=(e,t)=>({...BV(e),options:[e,t]}),VV=(e,t)=>({...FV(e),options:[e,t]}),WV=(e,t)=>({...zV(e),options:[e,t]}),YV=(e,t)=>({...PV(e),options:[e,t]}),KV=(e,t)=>({...GV(e),options:[e,t]});var XV="Arrow",bB=k.forwardRef((e,t)=>{const{children:n,width:r=10,height:a=5,...i}=e;return w.jsx(Xe.svg,{...i,ref:t,width:r,height:a,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:w.jsx("polygon",{points:"0,0 30,0 15,10"})})});bB.displayName=XV;var ZV=bB;function yB(e){const[t,n]=k.useState(void 0);return wn(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(a=>{if(!Array.isArray(a)||!a.length)return;const i=a[0];let l,u;if("borderBoxSize"in i){const c=i.borderBoxSize,f=Array.isArray(c)?c[0]:c;l=f.inlineSize,u=f.blockSize}else l=e.offsetWidth,u=e.offsetHeight;n({width:l,height:u})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var Xk="Popper",[vB,Cl]=mr(Xk),[QV,SB]=vB(Xk),EB=e=>{const{__scopePopper:t,children:n}=e,[r,a]=k.useState(null);return w.jsx(QV,{scope:t,anchor:r,onAnchorChange:a,children:n})};EB.displayName=Xk;var wB="PopperAnchor",xB=k.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...a}=e,i=SB(wB,n),l=k.useRef(null),u=ft(t,l);return k.useEffect(()=>{i.onAnchorChange((r==null?void 0:r.current)||l.current)}),r?null:w.jsx(Xe.div,{...a,ref:u})});xB.displayName=wB;var Zk="PopperContent",[JV,eW]=vB(Zk),kB=k.forwardRef((e,t)=>{var re,le,Ae,ae,we,xe;const{__scopePopper:n,side:r="bottom",sideOffset:a=0,align:i="center",alignOffset:l=0,arrowPadding:u=0,avoidCollisions:c=!0,collisionBoundary:f=[],collisionPadding:p=0,sticky:g="partial",hideWhenDetached:b=!1,updatePositionStrategy:m="optimized",onPlaced:S,...v}=e,A=SB(Zk,n),[R,x]=k.useState(null),_=ft(t,Ie=>x(Ie)),[C,N]=k.useState(null),T=yB(C),O=(T==null?void 0:T.width)??0,z=(T==null?void 0:T.height)??0,I=r+(i!=="center"?"-"+i:""),M=typeof p=="number"?p:{top:0,right:0,bottom:0,left:0,...p},H=Array.isArray(f)?f:[f],q=H.length>0,U={padding:M,boundary:H.filter(nW),altBoundary:q},{refs:W,floatingStyles:Z,placement:j,isPositioned:G,middlewareData:P}=jV({strategy:"fixed",placement:I,whileElementsMounted:(...Ie)=>IV(...Ie,{animationFrame:m==="always"}),elements:{reference:A.anchor},middleware:[HV({mainAxis:a+z,alignmentAxis:l}),c&&$V({mainAxis:!0,crossAxis:!1,limiter:g==="partial"?qV():void 0,...U}),c&&VV({...U}),WV({...U,apply:({elements:Ie,rects:Ce,availableWidth:Ee,availableHeight:J})=>{const{width:fe,height:ke}=Ce.reference,me=Ie.floating.style;me.setProperty("--radix-popper-available-width",`${Ee}px`),me.setProperty("--radix-popper-available-height",`${J}px`),me.setProperty("--radix-popper-anchor-width",`${fe}px`),me.setProperty("--radix-popper-anchor-height",`${ke}px`)}}),C&&KV({element:C,padding:u}),rW({arrowWidth:O,arrowHeight:z}),b&&YV({strategy:"referenceHidden",...U})]}),[X,D]=_B(j),V=pn(S);wn(()=>{G&&(V==null||V())},[G,V]);const B=(re=P.arrow)==null?void 0:re.x,L=(le=P.arrow)==null?void 0:le.y,Y=((Ae=P.arrow)==null?void 0:Ae.centerOffset)!==0,[Q,se]=k.useState();return wn(()=>{R&&se(window.getComputedStyle(R).zIndex)},[R]),w.jsx("div",{ref:W.setFloating,"data-radix-popper-content-wrapper":"",style:{...Z,transform:G?Z.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:Q,"--radix-popper-transform-origin":[(ae=P.transformOrigin)==null?void 0:ae.x,(we=P.transformOrigin)==null?void 0:we.y].join(" "),...((xe=P.hide)==null?void 0:xe.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:w.jsx(JV,{scope:n,placedSide:X,onArrowChange:N,arrowX:B,arrowY:L,shouldHideArrow:Y,children:w.jsx(Xe.div,{"data-side":X,"data-align":D,...v,ref:_,style:{...v.style,animation:G?void 0:"none"}})})})});kB.displayName=Zk;var AB="PopperArrow",tW={top:"bottom",right:"left",bottom:"top",left:"right"},TB=k.forwardRef(function(t,n){const{__scopePopper:r,...a}=t,i=eW(AB,r),l=tW[i.placedSide];return w.jsx("span",{ref:i.onArrowChange,style:{position:"absolute",left:i.arrowX,top:i.arrowY,[l]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[i.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[i.placedSide],visibility:i.shouldHideArrow?"hidden":void 0},children:w.jsx(ZV,{...a,ref:n,style:{...a.style,display:"block"}})})});TB.displayName=AB;function nW(e){return e!==null}var rW=e=>({name:"transformOrigin",options:e,fn(t){var A,R,x;const{placement:n,rects:r,middlewareData:a}=t,l=((A=a.arrow)==null?void 0:A.centerOffset)!==0,u=l?0:e.arrowWidth,c=l?0:e.arrowHeight,[f,p]=_B(n),g={start:"0%",center:"50%",end:"100%"}[p],b=(((R=a.arrow)==null?void 0:R.x)??0)+u/2,m=(((x=a.arrow)==null?void 0:x.y)??0)+c/2;let S="",v="";return f==="bottom"?(S=l?g:`${b}px`,v=`${-c}px`):f==="top"?(S=l?g:`${b}px`,v=`${r.floating.height+c}px`):f==="right"?(S=`${-c}px`,v=l?g:`${m}px`):f==="left"&&(S=`${r.floating.width+c}px`,v=l?g:`${m}px`),{data:{x:S,y:v}}}});function _B(e){const[t,n="center"]=e.split("-");return[t,n]}var Qk=EB,vf=xB,Jk=kB,e0=TB,aW="VisuallyHidden",t0=k.forwardRef((e,t)=>w.jsx(Xe.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}}));t0.displayName=aW;var oW=t0,[Sf,Jye]=mr("Tooltip",[Cl]),Ef=Cl(),RB="TooltipProvider",iW=700,Rx="tooltip.open",[lW,n0]=Sf(RB),CB=e=>{const{__scopeTooltip:t,delayDuration:n=iW,skipDelayDuration:r=300,disableHoverableContent:a=!1,children:i}=e,[l,u]=k.useState(!0),c=k.useRef(!1),f=k.useRef(0);return k.useEffect(()=>{const p=f.current;return()=>window.clearTimeout(p)},[]),w.jsx(lW,{scope:t,isOpenDelayed:l,delayDuration:n,onOpen:k.useCallback(()=>{window.clearTimeout(f.current),u(!1)},[]),onClose:k.useCallback(()=>{window.clearTimeout(f.current),f.current=window.setTimeout(()=>u(!0),r)},[r]),isPointerInTransitRef:c,onPointerInTransitChange:k.useCallback(p=>{c.current=p},[]),disableHoverableContent:a,children:i})};CB.displayName=RB;var wf="Tooltip",[sW,xf]=Sf(wf),NB=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:a=!1,onOpenChange:i,disableHoverableContent:l,delayDuration:u}=e,c=n0(wf,e.__scopeTooltip),f=Ef(t),[p,g]=k.useState(null),b=En(),m=k.useRef(0),S=l??c.disableHoverableContent,v=u??c.delayDuration,A=k.useRef(!1),[R=!1,x]=Oa({prop:r,defaultProp:a,onChange:O=>{O?(c.onOpen(),document.dispatchEvent(new CustomEvent(Rx))):c.onClose(),i==null||i(O)}}),_=k.useMemo(()=>R?A.current?"delayed-open":"instant-open":"closed",[R]),C=k.useCallback(()=>{window.clearTimeout(m.current),m.current=0,A.current=!1,x(!0)},[x]),N=k.useCallback(()=>{window.clearTimeout(m.current),m.current=0,x(!1)},[x]),T=k.useCallback(()=>{window.clearTimeout(m.current),m.current=window.setTimeout(()=>{A.current=!0,x(!0),m.current=0},v)},[v,x]);return k.useEffect(()=>()=>{m.current&&(window.clearTimeout(m.current),m.current=0)},[]),w.jsx(Qk,{...f,children:w.jsx(sW,{scope:t,contentId:b,open:R,stateAttribute:_,trigger:p,onTriggerChange:g,onTriggerEnter:k.useCallback(()=>{c.isOpenDelayed?T():C()},[c.isOpenDelayed,T,C]),onTriggerLeave:k.useCallback(()=>{S?N():(window.clearTimeout(m.current),m.current=0)},[N,S]),onOpen:C,onClose:N,disableHoverableContent:S,children:n})})};NB.displayName=wf;var Cx="TooltipTrigger",OB=k.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,a=xf(Cx,n),i=n0(Cx,n),l=Ef(n),u=k.useRef(null),c=ft(t,u,a.onTriggerChange),f=k.useRef(!1),p=k.useRef(!1),g=k.useCallback(()=>f.current=!1,[]);return k.useEffect(()=>()=>document.removeEventListener("pointerup",g),[g]),w.jsx(vf,{asChild:!0,...l,children:w.jsx(Xe.button,{"aria-describedby":a.open?a.contentId:void 0,"data-state":a.stateAttribute,...r,ref:c,onPointerMove:We(e.onPointerMove,b=>{b.pointerType!=="touch"&&!p.current&&!i.isPointerInTransitRef.current&&(a.onTriggerEnter(),p.current=!0)}),onPointerLeave:We(e.onPointerLeave,()=>{a.onTriggerLeave(),p.current=!1}),onPointerDown:We(e.onPointerDown,()=>{f.current=!0,document.addEventListener("pointerup",g,{once:!0})}),onFocus:We(e.onFocus,()=>{f.current||a.onOpen()}),onBlur:We(e.onBlur,a.onClose),onClick:We(e.onClick,a.onClose)})})});OB.displayName=Cx;var uW="TooltipPortal",[eve,cW]=Sf(uW,{forceMount:void 0}),ml="TooltipContent",DB=k.forwardRef((e,t)=>{const n=cW(ml,e.__scopeTooltip),{forceMount:r=n.forceMount,side:a="top",...i}=e,l=xf(ml,e.__scopeTooltip);return w.jsx(Jn,{present:r||l.open,children:l.disableHoverableContent?w.jsx(IB,{side:a,...i,ref:t}):w.jsx(dW,{side:a,...i,ref:t})})}),dW=k.forwardRef((e,t)=>{const n=xf(ml,e.__scopeTooltip),r=n0(ml,e.__scopeTooltip),a=k.useRef(null),i=ft(t,a),[l,u]=k.useState(null),{trigger:c,onClose:f}=n,p=a.current,{onPointerInTransitChange:g}=r,b=k.useCallback(()=>{u(null),g(!1)},[g]),m=k.useCallback((S,v)=>{const A=S.currentTarget,R={x:S.clientX,y:S.clientY},x=hW(R,A.getBoundingClientRect()),_=mW(R,x),C=bW(v.getBoundingClientRect()),N=vW([..._,...C]);u(N),g(!0)},[g]);return k.useEffect(()=>()=>b(),[b]),k.useEffect(()=>{if(c&&p){const S=A=>m(A,p),v=A=>m(A,c);return c.addEventListener("pointerleave",S),p.addEventListener("pointerleave",v),()=>{c.removeEventListener("pointerleave",S),p.removeEventListener("pointerleave",v)}}},[c,p,m,b]),k.useEffect(()=>{if(l){const S=v=>{const A=v.target,R={x:v.clientX,y:v.clientY},x=(c==null?void 0:c.contains(A))||(p==null?void 0:p.contains(A)),_=!yW(R,l);x?b():_&&(b(),f())};return document.addEventListener("pointermove",S),()=>document.removeEventListener("pointermove",S)}},[c,p,l,f,b]),w.jsx(IB,{...e,ref:i})}),[fW,pW]=Sf(wf,{isInside:!1}),IB=k.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":a,onEscapeKeyDown:i,onPointerDownOutside:l,...u}=e,c=xf(ml,n),f=Ef(n),{onClose:p}=c;return k.useEffect(()=>(document.addEventListener(Rx,p),()=>document.removeEventListener(Rx,p)),[p]),k.useEffect(()=>{if(c.trigger){const g=b=>{const m=b.target;m!=null&&m.contains(c.trigger)&&p()};return window.addEventListener("scroll",g,{capture:!0}),()=>window.removeEventListener("scroll",g,{capture:!0})}},[c.trigger,p]),w.jsx(gu,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:i,onPointerDownOutside:l,onFocusOutside:g=>g.preventDefault(),onDismiss:p,children:w.jsxs(Jk,{"data-state":c.stateAttribute,...f,...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:[w.jsx(Ok,{children:r}),w.jsx(fW,{scope:n,isInside:!0,children:w.jsx(oW,{id:c.contentId,role:"tooltip",children:a||r})})]})})});DB.displayName=ml;var LB="TooltipArrow",gW=k.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,a=Ef(n);return pW(LB,n).isInside?null:w.jsx(e0,{...a,...r,ref:t})});gW.displayName=LB;function hW(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),a=Math.abs(t.right-e.x),i=Math.abs(t.left-e.x);switch(Math.min(n,r,a,i)){case i:return"left";case a:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function mW(e,t,n=5){const r=[];switch(t){case"top":r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}function bW(e){const{top:t,right:n,bottom:r,left:a}=e;return[{x:a,y:t},{x:n,y:t},{x:n,y:r},{x:a,y:r}]}function yW(e,t){const{x:n,y:r}=e;let a=!1;for(let i=0,l=t.length-1;ir!=p>r&&n<(f-u)*(r-c)/(p-c)+u&&(a=!a)}return a}function vW(e){const t=e.slice();return t.sort((n,r)=>n.xr.x?1:n.yr.y?1:0),SW(t)}function SW(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r=2;){const i=t[t.length-1],l=t[t.length-2];if((i.x-l.x)*(a.y-l.y)>=(i.y-l.y)*(a.x-l.x))t.pop();else break}t.push(a)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const a=e[r];for(;n.length>=2;){const i=n[n.length-1],l=n[n.length-2];if((i.x-l.x)*(a.y-l.y)>=(i.y-l.y)*(a.x-l.x))n.pop();else break}n.push(a)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var EW=CB,wW=NB,xW=OB,MB=DB;const FB=EW,zB=wW,PB=xW,kW=e=>typeof e!="string"?e:e.split("\\n").map((t,n)=>w.jsxs(k.Fragment,{children:[t,nw.jsx(MB,{ref:a,sideOffset:t,className:Me("bg-popover text-popover-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 mx-1 max-w-sm overflow-hidden rounded-md border px-3 py-2 text-sm shadow-md",e),...r,children:typeof n=="string"?kW(n):n}));r0.displayName=MB.displayName;const zd=Nz("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"}}),Lt=k.forwardRef(({className:e,variant:t,tooltip:n,size:r,side:a="right",asChild:i=!1,...l},u)=>{const c=i?bo:"button";return n?w.jsx(FB,{children:w.jsxs(zB,{children:[w.jsx(PB,{asChild:!0,children:w.jsx(c,{className:Me(zd({variant:t,size:r,className:e}),"cursor-pointer"),ref:u,...l})}),w.jsx(r0,{side:a,children:n})]})}):w.jsx(c,{className:Me(zd({variant:t,size:r,className:e}),"cursor-pointer"),ref:u,...l})});Lt.displayName="Button";const AW=Z7,TW=Q7,BB=k.forwardRef(({className:e,...t},n)=>w.jsx(tB,{className:Me("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/80",e),...t,ref:n}));BB.displayName=tB.displayName;const UB=k.forwardRef(({className:e,...t},n)=>w.jsxs(TW,{children:[w.jsx(BB,{}),w.jsx(nB,{ref:n,className:Me("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-top-[48%] fixed top-[50%] left-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border p-6 shadow-lg duration-200 sm:rounded-lg",e),...t})]}));UB.displayName=nB.displayName;const jB=({className:e,...t})=>w.jsx("div",{className:Me("flex flex-col space-y-2 text-center sm:text-left",e),...t});jB.displayName="AlertDialogHeader";const GB=k.forwardRef(({className:e,...t},n)=>w.jsx(oB,{ref:n,className:Me("text-lg font-semibold",e),...t}));GB.displayName=oB.displayName;const HB=k.forwardRef(({className:e,...t},n)=>w.jsx(iB,{ref:n,className:Me("text-muted-foreground text-sm",e),...t}));HB.displayName=iB.displayName;const _W=k.forwardRef(({className:e,...t},n)=>w.jsx(rB,{ref:n,className:Me(zd(),e),...t}));_W.displayName=rB.displayName;const RW=k.forwardRef(({className:e,...t},n)=>w.jsx(aB,{ref:n,className:Me(zd({variant:"outline"}),"mt-2 sm:mt-0",e),...t}));RW.displayName=aB.displayName;const Eo=k.forwardRef(({className:e,type:t,...n},r)=>w.jsx("input",{type:t,className:Me("border-input file:text-foreground placeholder:text-muted-foreground focus-visible:ring-ring flex h-9 rounded-md border bg-transparent px-3 py-1 text-base shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium focus-visible:ring-1 focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),ref:r,...n}));Eo.displayName="Input";var CW=e=>{switch(e){case"success":return DW;case"info":return LW;case"warning":return IW;case"error":return MW;default:return null}},NW=Array(12).fill(0),OW=({visible:e,className:t})=>ye.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},ye.createElement("div",{className:"sonner-spinner"},NW.map((n,r)=>ye.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),DW=ye.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},ye.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"})),IW=ye.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},ye.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"})),LW=ye.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},ye.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"})),MW=ye.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},ye.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"})),FW=ye.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"},ye.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),ye.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),zW=()=>{let[e,t]=ye.useState(document.hidden);return ye.useEffect(()=>{let n=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),e},Nx=1,PW=class{constructor(){this.subscribe=e=>(this.subscribers.push(e),()=>{let t=this.subscribers.indexOf(e);this.subscribers.splice(t,1)}),this.publish=e=>{this.subscribers.forEach(t=>t(e))},this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e]},this.create=e=>{var t;let{message:n,...r}=e,a=typeof(e==null?void 0:e.id)=="number"||((t=e.id)==null?void 0:t.length)>0?e.id:Nx++,i=this.toasts.find(u=>u.id===a),l=e.dismissible===void 0?!0:e.dismissible;return this.dismissedToasts.has(a)&&this.dismissedToasts.delete(a),i?this.toasts=this.toasts.map(u=>u.id===a?(this.publish({...u,...e,id:a,title:n}),{...u,...e,id:a,dismissible:l,title:n}):u):this.addToast({title:n,...r,dismissible:l,id:a}),a},this.dismiss=e=>(this.dismissedToasts.add(e),e||this.toasts.forEach(t=>{this.subscribers.forEach(n=>n({id:t.id,dismiss:!0}))}),this.subscribers.forEach(t=>t({id:e,dismiss:!0})),e),this.message=(e,t)=>this.create({...t,message:e}),this.error=(e,t)=>this.create({...t,message:e,type:"error"}),this.success=(e,t)=>this.create({...t,type:"success",message:e}),this.info=(e,t)=>this.create({...t,type:"info",message:e}),this.warning=(e,t)=>this.create({...t,type:"warning",message:e}),this.loading=(e,t)=>this.create({...t,type:"loading",message:e}),this.promise=(e,t)=>{if(!t)return;let n;t.loading!==void 0&&(n=this.create({...t,promise:e,type:"loading",message:t.loading,description:typeof t.description!="function"?t.description:void 0}));let r=e instanceof Promise?e:e(),a=n!==void 0,i,l=r.then(async c=>{if(i=["resolve",c],ye.isValidElement(c))a=!1,this.create({id:n,type:"default",message:c});else if(UW(c)&&!c.ok){a=!1;let f=typeof t.error=="function"?await t.error(`HTTP error! status: ${c.status}`):t.error,p=typeof t.description=="function"?await t.description(`HTTP error! status: ${c.status}`):t.description;this.create({id:n,type:"error",message:f,description:p})}else if(t.success!==void 0){a=!1;let f=typeof t.success=="function"?await t.success(c):t.success,p=typeof t.description=="function"?await t.description(c):t.description;this.create({id:n,type:"success",message:f,description:p})}}).catch(async c=>{if(i=["reject",c],t.error!==void 0){a=!1;let f=typeof t.error=="function"?await t.error(c):t.error,p=typeof t.description=="function"?await t.description(c):t.description;this.create({id:n,type:"error",message:f,description:p})}}).finally(()=>{var c;a&&(this.dismiss(n),n=void 0),(c=t.finally)==null||c.call(t)}),u=()=>new Promise((c,f)=>l.then(()=>i[0]==="reject"?f(i[1]):c(i[1])).catch(f));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)||Nx++;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}},Fn=new PW,BW=(e,t)=>{let n=(t==null?void 0:t.id)||Nx++;return Fn.addToast({title:e,...t,id:n}),n},UW=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",jW=BW,GW=()=>Fn.toasts,HW=()=>Fn.getActiveToasts(),vn=Object.assign(jW,{success:Fn.success,info:Fn.info,warning:Fn.warning,error:Fn.error,custom:Fn.custom,message:Fn.message,promise:Fn.promise,dismiss:Fn.dismiss,loading:Fn.loading},{getHistory:GW,getToasts:HW});function $W(e,{insertAt:t}={}){if(typeof document>"u")return;let n=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",t==="top"&&n.firstChild?n.insertBefore(r,n.firstChild):n.appendChild(r),r.styleSheet?r.styleSheet.cssText=e:r.appendChild(document.createTextNode(e))}$W(`: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 Hc(e){return e.label!==void 0}var qW=3,VW="32px",WW="16px",qR=4e3,YW=356,KW=14,XW=20,ZW=200;function Ar(...e){return e.filter(Boolean).join(" ")}function QW(e){let[t,n]=e.split("-"),r=[];return t&&r.push(t),n&&r.push(n),r}var JW=e=>{var t,n,r,a,i,l,u,c,f,p,g;let{invert:b,toast:m,unstyled:S,interacting:v,setHeights:A,visibleToasts:R,heights:x,index:_,toasts:C,expanded:N,removeToast:T,defaultRichColors:O,closeButton:z,style:I,cancelButtonStyle:M,actionButtonStyle:H,className:q="",descriptionClassName:U="",duration:W,position:Z,gap:j,loadingIcon:G,expandByDefault:P,classNames:X,icons:D,closeButtonAriaLabel:V="Close toast",pauseWhenPageIsHidden:B}=e,[L,Y]=ye.useState(null),[Q,se]=ye.useState(null),[re,le]=ye.useState(!1),[Ae,ae]=ye.useState(!1),[we,xe]=ye.useState(!1),[Ie,Ce]=ye.useState(!1),[Ee,J]=ye.useState(!1),[fe,ke]=ye.useState(0),[me,ve]=ye.useState(0),ie=ye.useRef(m.duration||W||qR),ze=ye.useRef(null),Pe=ye.useRef(null),he=_===0,Ne=_+1<=R,ee=m.type,ce=m.dismissible!==!1,Re=m.className||"",Fe=m.descriptionClassName||"",qe=ye.useMemo(()=>x.findIndex(Ye=>Ye.toastId===m.id)||0,[x,m.id]),mt=ye.useMemo(()=>{var Ye;return(Ye=m.closeButton)!=null?Ye:z},[m.closeButton,z]),St=ye.useMemo(()=>m.duration||W||qR,[m.duration,W]),pt=ye.useRef(0),Je=ye.useRef(0),wt=ye.useRef(0),rt=ye.useRef(null),[bt,Bt]=Z.split("-"),sn=ye.useMemo(()=>x.reduce((Ye,gt,_t)=>_t>=qe?Ye:Ye+gt.height,0),[x,qe]),Mt=zW(),er=m.invert||b,zr=ee==="loading";Je.current=ye.useMemo(()=>qe*j+sn,[qe,sn]),ye.useEffect(()=>{ie.current=St},[St]),ye.useEffect(()=>{le(!0)},[]),ye.useEffect(()=>{let Ye=Pe.current;if(Ye){let gt=Ye.getBoundingClientRect().height;return ve(gt),A(_t=>[{toastId:m.id,height:gt,position:m.position},..._t]),()=>A(_t=>_t.filter(Rn=>Rn.toastId!==m.id))}},[A,m.id]),ye.useLayoutEffect(()=>{if(!re)return;let Ye=Pe.current,gt=Ye.style.height;Ye.style.height="auto";let _t=Ye.getBoundingClientRect().height;Ye.style.height=gt,ve(_t),A(Rn=>Rn.find(kn=>kn.toastId===m.id)?Rn.map(kn=>kn.toastId===m.id?{...kn,height:_t}:kn):[{toastId:m.id,height:_t,position:m.position},...Rn])},[re,m.title,m.description,A,m.id]);let Kt=ye.useCallback(()=>{ae(!0),ke(Je.current),A(Ye=>Ye.filter(gt=>gt.toastId!==m.id)),setTimeout(()=>{T(m)},ZW)},[m,T,A,Je]);ye.useEffect(()=>{if(m.promise&&ee==="loading"||m.duration===1/0||m.type==="loading")return;let Ye;return N||v||B&&Mt?(()=>{if(wt.current{var gt;(gt=m.onAutoClose)==null||gt.call(m,m),Kt()},ie.current)),()=>clearTimeout(Ye)},[N,v,m,ee,B,Mt,Kt]),ye.useEffect(()=>{m.delete&&Kt()},[Kt,m.delete]);function na(){var Ye,gt,_t;return D!=null&&D.loading?ye.createElement("div",{className:Ar(X==null?void 0:X.loader,(Ye=m==null?void 0:m.classNames)==null?void 0:Ye.loader,"sonner-loader"),"data-visible":ee==="loading"},D.loading):G?ye.createElement("div",{className:Ar(X==null?void 0:X.loader,(gt=m==null?void 0:m.classNames)==null?void 0:gt.loader,"sonner-loader"),"data-visible":ee==="loading"},G):ye.createElement(OW,{className:Ar(X==null?void 0:X.loader,(_t=m==null?void 0:m.classNames)==null?void 0:_t.loader),visible:ee==="loading"})}return ye.createElement("li",{tabIndex:0,ref:Pe,className:Ar(q,Re,X==null?void 0:X.toast,(t=m==null?void 0:m.classNames)==null?void 0:t.toast,X==null?void 0:X.default,X==null?void 0:X[ee],(n=m==null?void 0:m.classNames)==null?void 0:n[ee]),"data-sonner-toast":"","data-rich-colors":(r=m.richColors)!=null?r:O,"data-styled":!(m.jsx||m.unstyled||S),"data-mounted":re,"data-promise":!!m.promise,"data-swiped":Ee,"data-removed":Ae,"data-visible":Ne,"data-y-position":bt,"data-x-position":Bt,"data-index":_,"data-front":he,"data-swiping":we,"data-dismissible":ce,"data-type":ee,"data-invert":er,"data-swipe-out":Ie,"data-swipe-direction":Q,"data-expanded":!!(N||P&&re),style:{"--index":_,"--toasts-before":_,"--z-index":C.length-_,"--offset":`${Ae?fe:Je.current}px`,"--initial-height":P?"auto":`${me}px`,...I,...m.style},onDragEnd:()=>{xe(!1),Y(null),rt.current=null},onPointerDown:Ye=>{zr||!ce||(ze.current=new Date,ke(Je.current),Ye.target.setPointerCapture(Ye.pointerId),Ye.target.tagName!=="BUTTON"&&(xe(!0),rt.current={x:Ye.clientX,y:Ye.clientY}))},onPointerUp:()=>{var Ye,gt,_t,Rn;if(Ie||!ce)return;rt.current=null;let kn=Number(((Ye=Pe.current)==null?void 0:Ye.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),Cn=Number(((gt=Pe.current)==null?void 0:gt.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),ra=new Date().getTime()-((_t=ze.current)==null?void 0:_t.getTime()),Nn=L==="x"?kn:Cn,Sr=Math.abs(Nn)/ra;if(Math.abs(Nn)>=XW||Sr>.11){ke(Je.current),(Rn=m.onDismiss)==null||Rn.call(m,m),se(L==="x"?kn>0?"right":"left":Cn>0?"down":"up"),Kt(),Ce(!0),J(!1);return}xe(!1),Y(null)},onPointerMove:Ye=>{var gt,_t,Rn,kn;if(!rt.current||!ce||((gt=window.getSelection())==null?void 0:gt.toString().length)>0)return;let Cn=Ye.clientY-rt.current.y,ra=Ye.clientX-rt.current.x,Nn=(_t=e.swipeDirections)!=null?_t:QW(Z);!L&&(Math.abs(ra)>1||Math.abs(Cn)>1)&&Y(Math.abs(ra)>Math.abs(Cn)?"x":"y");let Sr={x:0,y:0};L==="y"?(Nn.includes("top")||Nn.includes("bottom"))&&(Nn.includes("top")&&Cn<0||Nn.includes("bottom")&&Cn>0)&&(Sr.y=Cn):L==="x"&&(Nn.includes("left")||Nn.includes("right"))&&(Nn.includes("left")&&ra<0||Nn.includes("right")&&ra>0)&&(Sr.x=ra),(Math.abs(Sr.x)>0||Math.abs(Sr.y)>0)&&J(!0),(Rn=Pe.current)==null||Rn.style.setProperty("--swipe-amount-x",`${Sr.x}px`),(kn=Pe.current)==null||kn.style.setProperty("--swipe-amount-y",`${Sr.y}px`)}},mt&&!m.jsx?ye.createElement("button",{"aria-label":V,"data-disabled":zr,"data-close-button":!0,onClick:zr||!ce?()=>{}:()=>{var Ye;Kt(),(Ye=m.onDismiss)==null||Ye.call(m,m)},className:Ar(X==null?void 0:X.closeButton,(a=m==null?void 0:m.classNames)==null?void 0:a.closeButton)},(i=D==null?void 0:D.close)!=null?i:FW):null,m.jsx||k.isValidElement(m.title)?m.jsx?m.jsx:typeof m.title=="function"?m.title():m.title:ye.createElement(ye.Fragment,null,ee||m.icon||m.promise?ye.createElement("div",{"data-icon":"",className:Ar(X==null?void 0:X.icon,(l=m==null?void 0:m.classNames)==null?void 0:l.icon)},m.promise||m.type==="loading"&&!m.icon?m.icon||na():null,m.type!=="loading"?m.icon||(D==null?void 0:D[ee])||CW(ee):null):null,ye.createElement("div",{"data-content":"",className:Ar(X==null?void 0:X.content,(u=m==null?void 0:m.classNames)==null?void 0:u.content)},ye.createElement("div",{"data-title":"",className:Ar(X==null?void 0:X.title,(c=m==null?void 0:m.classNames)==null?void 0:c.title)},typeof m.title=="function"?m.title():m.title),m.description?ye.createElement("div",{"data-description":"",className:Ar(U,Fe,X==null?void 0:X.description,(f=m==null?void 0:m.classNames)==null?void 0:f.description)},typeof m.description=="function"?m.description():m.description):null),k.isValidElement(m.cancel)?m.cancel:m.cancel&&Hc(m.cancel)?ye.createElement("button",{"data-button":!0,"data-cancel":!0,style:m.cancelButtonStyle||M,onClick:Ye=>{var gt,_t;Hc(m.cancel)&&ce&&((_t=(gt=m.cancel).onClick)==null||_t.call(gt,Ye),Kt())},className:Ar(X==null?void 0:X.cancelButton,(p=m==null?void 0:m.classNames)==null?void 0:p.cancelButton)},m.cancel.label):null,k.isValidElement(m.action)?m.action:m.action&&Hc(m.action)?ye.createElement("button",{"data-button":!0,"data-action":!0,style:m.actionButtonStyle||H,onClick:Ye=>{var gt,_t;Hc(m.action)&&((_t=(gt=m.action).onClick)==null||_t.call(gt,Ye),!Ye.defaultPrevented&&Kt())},className:Ar(X==null?void 0:X.actionButton,(g=m==null?void 0:m.classNames)==null?void 0:g.actionButton)},m.action.label):null))};function VR(){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 eY(e,t){let n={};return[e,t].forEach((r,a)=>{let i=a===1,l=i?"--mobile-offset":"--offset",u=i?WW:VW;function c(f){["top","right","bottom","left"].forEach(p=>{n[`${l}-${p}`]=typeof f=="number"?`${f}px`:f})}typeof r=="number"||typeof r=="string"?c(r):typeof r=="object"?["top","right","bottom","left"].forEach(f=>{r[f]===void 0?n[`${l}-${f}`]=u:n[`${l}-${f}`]=typeof r[f]=="number"?`${r[f]}px`:r[f]}):c(u)}),n}var tY=k.forwardRef(function(e,t){let{invert:n,position:r="bottom-right",hotkey:a=["altKey","KeyT"],expand:i,closeButton:l,className:u,offset:c,mobileOffset:f,theme:p="light",richColors:g,duration:b,style:m,visibleToasts:S=qW,toastOptions:v,dir:A=VR(),gap:R=KW,loadingIcon:x,icons:_,containerAriaLabel:C="Notifications",pauseWhenPageIsHidden:N}=e,[T,O]=ye.useState([]),z=ye.useMemo(()=>Array.from(new Set([r].concat(T.filter(B=>B.position).map(B=>B.position)))),[T,r]),[I,M]=ye.useState([]),[H,q]=ye.useState(!1),[U,W]=ye.useState(!1),[Z,j]=ye.useState(p!=="system"?p:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),G=ye.useRef(null),P=a.join("+").replace(/Key/g,"").replace(/Digit/g,""),X=ye.useRef(null),D=ye.useRef(!1),V=ye.useCallback(B=>{O(L=>{var Y;return(Y=L.find(Q=>Q.id===B.id))!=null&&Y.delete||Fn.dismiss(B.id),L.filter(({id:Q})=>Q!==B.id)})},[]);return ye.useEffect(()=>Fn.subscribe(B=>{if(B.dismiss){O(L=>L.map(Y=>Y.id===B.id?{...Y,delete:!0}:Y));return}setTimeout(()=>{pP.flushSync(()=>{O(L=>{let Y=L.findIndex(Q=>Q.id===B.id);return Y!==-1?[...L.slice(0,Y),{...L[Y],...B},...L.slice(Y+1)]:[B,...L]})})})}),[]),ye.useEffect(()=>{if(p!=="system"){j(p);return}if(p==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?j("dark"):j("light")),typeof window>"u")return;let B=window.matchMedia("(prefers-color-scheme: dark)");try{B.addEventListener("change",({matches:L})=>{j(L?"dark":"light")})}catch{B.addListener(({matches:Y})=>{try{j(Y?"dark":"light")}catch(Q){console.error(Q)}})}},[p]),ye.useEffect(()=>{T.length<=1&&q(!1)},[T]),ye.useEffect(()=>{let B=L=>{var Y,Q;a.every(se=>L[se]||L.code===se)&&(q(!0),(Y=G.current)==null||Y.focus()),L.code==="Escape"&&(document.activeElement===G.current||(Q=G.current)!=null&&Q.contains(document.activeElement))&&q(!1)};return document.addEventListener("keydown",B),()=>document.removeEventListener("keydown",B)},[a]),ye.useEffect(()=>{if(G.current)return()=>{X.current&&(X.current.focus({preventScroll:!0}),X.current=null,D.current=!1)}},[G.current]),ye.createElement("section",{ref:t,"aria-label":`${C} ${P}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},z.map((B,L)=>{var Y;let[Q,se]=B.split("-");return T.length?ye.createElement("ol",{key:B,dir:A==="auto"?VR():A,tabIndex:-1,ref:G,className:u,"data-sonner-toaster":!0,"data-theme":Z,"data-y-position":Q,"data-lifted":H&&T.length>1&&!i,"data-x-position":se,style:{"--front-toast-height":`${((Y=I[0])==null?void 0:Y.height)||0}px`,"--width":`${YW}px`,"--gap":`${R}px`,...m,...eY(c,f)},onBlur:re=>{D.current&&!re.currentTarget.contains(re.relatedTarget)&&(D.current=!1,X.current&&(X.current.focus({preventScroll:!0}),X.current=null))},onFocus:re=>{re.target instanceof HTMLElement&&re.target.dataset.dismissible==="false"||D.current||(D.current=!0,X.current=re.relatedTarget)},onMouseEnter:()=>q(!0),onMouseMove:()=>q(!0),onMouseLeave:()=>{U||q(!1)},onDragEnd:()=>q(!1),onPointerDown:re=>{re.target instanceof HTMLElement&&re.target.dataset.dismissible==="false"||W(!0)},onPointerUp:()=>W(!1)},T.filter(re=>!re.position&&L===0||re.position===B).map((re,le)=>{var Ae,ae;return ye.createElement(JW,{key:re.id,icons:_,index:le,toast:re,defaultRichColors:g,duration:(Ae=v==null?void 0:v.duration)!=null?Ae:b,className:v==null?void 0:v.className,descriptionClassName:v==null?void 0:v.descriptionClassName,invert:n,visibleToasts:S,closeButton:(ae=v==null?void 0:v.closeButton)!=null?ae:l,interacting:U,position:B,style:v==null?void 0:v.style,unstyled:v==null?void 0:v.unstyled,classNames:v==null?void 0:v.classNames,cancelButtonStyle:v==null?void 0:v.cancelButtonStyle,actionButtonStyle:v==null?void 0:v.actionButtonStyle,removeToast:V,toasts:T.filter(we=>we.position==re.position),heights:I.filter(we=>we.position==re.position),setHeights:M,expandByDefault:i,gap:R,loadingIcon:x,expanded:H,pauseWhenPageIsHidden:N,swipeDirections:e.swipeDirections})})):null}))});const nY=()=>{const[e,t]=k.useState(!0),n=Ke.use.apiKey(),[r,a]=k.useState(""),i=Pn.use.message();k.useEffect(()=>{a(n||"")},[n,e]),k.useEffect(()=>{i&&(i.includes(oP)||i.includes(iP))&&t(!0)},[i,t]);const l=k.useCallback(async()=>{if(Ke.setState({apiKey:r||null}),await Pn.getState().check()){t(!1);return}vn.error("API Key is invalid")},[r]),u=k.useCallback(c=>{a(c.target.value)},[a]);return w.jsx(AW,{open:e,onOpenChange:t,children:w.jsxs(UB,{children:[w.jsxs(jB,{children:[w.jsx(GB,{children:"API Key is required"}),w.jsx(HB,{children:"Please enter your API key"})]}),w.jsxs("form",{className:"flex gap-2",onSubmit:c=>c.preventDefault(),children:[w.jsx(Eo,{type:"password",value:r,onChange:u,placeholder:"Enter your API key",className:"max-h-full w-full min-w-0",autoComplete:"off"}),w.jsx(Lt,{onClick:l,variant:"outline",size:"sm",children:"Save"})]})]})})};var a0="Popover",[$B,tve]=mr(a0,[Cl]),mu=Cl(),[rY,wo]=$B(a0),qB=e=>{const{__scopePopover:t,children:n,open:r,defaultOpen:a,onOpenChange:i,modal:l=!1}=e,u=mu(t),c=k.useRef(null),[f,p]=k.useState(!1),[g=!1,b]=Oa({prop:r,defaultProp:a,onChange:i});return w.jsx(Qk,{...u,children:w.jsx(rY,{scope:t,contentId:En(),triggerRef:c,open:g,onOpenChange:b,onOpenToggle:k.useCallback(()=>b(m=>!m),[b]),hasCustomAnchor:f,onCustomAnchorAdd:k.useCallback(()=>p(!0),[]),onCustomAnchorRemove:k.useCallback(()=>p(!1),[]),modal:l,children:n})})};qB.displayName=a0;var VB="PopoverAnchor",aY=k.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,a=wo(VB,n),i=mu(n),{onCustomAnchorAdd:l,onCustomAnchorRemove:u}=a;return k.useEffect(()=>(l(),()=>u()),[l,u]),w.jsx(vf,{...i,...r,ref:t})});aY.displayName=VB;var WB="PopoverTrigger",YB=k.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,a=wo(WB,n),i=mu(n),l=ft(t,a.triggerRef),u=w.jsx(Xe.button,{type:"button","aria-haspopup":"dialog","aria-expanded":a.open,"aria-controls":a.contentId,"data-state":JB(a.open),...r,ref:l,onClick:We(e.onClick,a.onOpenToggle)});return a.hasCustomAnchor?u:w.jsx(vf,{asChild:!0,...i,children:u})});YB.displayName=WB;var o0="PopoverPortal",[oY,iY]=$B(o0,{forceMount:void 0}),KB=e=>{const{__scopePopover:t,forceMount:n,children:r,container:a}=e,i=wo(o0,t);return w.jsx(oY,{scope:t,forceMount:n,children:w.jsx(Jn,{present:n||i.open,children:w.jsx(df,{asChild:!0,container:a,children:r})})})};KB.displayName=o0;var bl="PopoverContent",XB=k.forwardRef((e,t)=>{const n=iY(bl,e.__scopePopover),{forceMount:r=n.forceMount,...a}=e,i=wo(bl,e.__scopePopover);return w.jsx(Jn,{present:r||i.open,children:i.modal?w.jsx(lY,{...a,ref:t}):w.jsx(sY,{...a,ref:t})})});XB.displayName=bl;var lY=k.forwardRef((e,t)=>{const n=wo(bl,e.__scopePopover),r=k.useRef(null),a=ft(t,r),i=k.useRef(!1);return k.useEffect(()=>{const l=r.current;if(l)return Ik(l)},[]),w.jsx(pf,{as:bo,allowPinchZoom:!0,children:w.jsx(ZB,{...e,ref:a,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:We(e.onCloseAutoFocus,l=>{var u;l.preventDefault(),i.current||(u=n.triggerRef.current)==null||u.focus()}),onPointerDownOutside:We(e.onPointerDownOutside,l=>{const u=l.detail.originalEvent,c=u.button===0&&u.ctrlKey===!0,f=u.button===2||c;i.current=f},{checkForDefaultPrevented:!1}),onFocusOutside:We(e.onFocusOutside,l=>l.preventDefault(),{checkForDefaultPrevented:!1})})})}),sY=k.forwardRef((e,t)=>{const n=wo(bl,e.__scopePopover),r=k.useRef(!1),a=k.useRef(!1);return w.jsx(ZB,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var l,u;(l=e.onCloseAutoFocus)==null||l.call(e,i),i.defaultPrevented||(r.current||(u=n.triggerRef.current)==null||u.focus(),i.preventDefault()),r.current=!1,a.current=!1},onInteractOutside:i=>{var c,f;(c=e.onInteractOutside)==null||c.call(e,i),i.defaultPrevented||(r.current=!0,i.detail.originalEvent.type==="pointerdown"&&(a.current=!0));const l=i.target;((f=n.triggerRef.current)==null?void 0:f.contains(l))&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&a.current&&i.preventDefault()}})}),ZB=k.forwardRef((e,t)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:a,onCloseAutoFocus:i,disableOutsidePointerEvents:l,onEscapeKeyDown:u,onPointerDownOutside:c,onFocusOutside:f,onInteractOutside:p,...g}=e,b=wo(bl,n),m=mu(n);return Dk(),w.jsx(cf,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:a,onUnmountAutoFocus:i,children:w.jsx(gu,{asChild:!0,disableOutsidePointerEvents:l,onInteractOutside:p,onEscapeKeyDown:u,onPointerDownOutside:c,onFocusOutside:f,onDismiss:()=>b.onOpenChange(!1),children:w.jsx(Jk,{"data-state":JB(b.open),role:"dialog",id:b.contentId,...m,...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)"}})})})}),QB="PopoverClose",uY=k.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,a=wo(QB,n);return w.jsx(Xe.button,{type:"button",...r,ref:t,onClick:We(e.onClick,()=>a.onOpenChange(!1))})});uY.displayName=QB;var cY="PopoverArrow",dY=k.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,a=mu(n);return w.jsx(e0,{...a,...r,ref:t})});dY.displayName=cY;function JB(e){return e?"open":"closed"}var fY=qB,pY=YB,gY=KB,eU=XB;const kf=fY,Af=pY,bu=k.forwardRef(({className:e,align:t="center",sideOffset:n=4,...r},a)=>w.jsx(gY,{children:w.jsx(eU,{ref:a,align:t,sideOffset:n,className:Me("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 rounded-md border p-4 shadow-md outline-none",e),...r})}));bu.displayName=eU.displayName;const hY=({status:e})=>e?w.jsxs("div",{className:"min-w-[300px] space-y-3 text-sm",children:[w.jsxs("div",{className:"space-y-1",children:[w.jsx("h4",{className:"font-medium",children:"Storage Info"}),w.jsxs("div",{className:"text-muted-foreground grid grid-cols-2 gap-1",children:[w.jsx("span",{children:"Working Directory:"}),w.jsx("span",{className:"truncate",children:e.working_directory}),w.jsx("span",{children:"Input Directory:"}),w.jsx("span",{className:"truncate",children:e.input_directory})]})]}),w.jsxs("div",{className:"space-y-1",children:[w.jsx("h4",{className:"font-medium",children:"LLM Configuration"}),w.jsxs("div",{className:"text-muted-foreground grid grid-cols-2 gap-1",children:[w.jsx("span",{children:"LLM Binding:"}),w.jsx("span",{children:e.configuration.llm_binding}),w.jsx("span",{children:"LLM Binding Host:"}),w.jsx("span",{children:e.configuration.llm_binding_host}),w.jsx("span",{children:"LLM Model:"}),w.jsx("span",{children:e.configuration.llm_model}),w.jsx("span",{children:"Max Tokens:"}),w.jsx("span",{children:e.configuration.max_tokens})]})]}),w.jsxs("div",{className:"space-y-1",children:[w.jsx("h4",{className:"font-medium",children:"Embedding Configuration"}),w.jsxs("div",{className:"text-muted-foreground grid grid-cols-2 gap-1",children:[w.jsx("span",{children:"Embedding Binding:"}),w.jsx("span",{children:e.configuration.embedding_binding}),w.jsx("span",{children:"Embedding Binding Host:"}),w.jsx("span",{children:e.configuration.embedding_binding_host}),w.jsx("span",{children:"Embedding Model:"}),w.jsx("span",{children:e.configuration.embedding_model})]})]}),w.jsxs("div",{className:"space-y-1",children:[w.jsx("h4",{className:"font-medium",children:"Storage Configuration"}),w.jsxs("div",{className:"text-muted-foreground grid grid-cols-2 gap-1",children:[w.jsx("span",{children:"KV Storage:"}),w.jsx("span",{children:e.configuration.kv_storage}),w.jsx("span",{children:"Doc Status Storage:"}),w.jsx("span",{children:e.configuration.doc_status_storage}),w.jsx("span",{children:"Graph Storage:"}),w.jsx("span",{children:e.configuration.graph_storage}),w.jsx("span",{children:"Vector Storage:"}),w.jsx("span",{children:e.configuration.vector_storage})]})]})]}):w.jsx("div",{className:"text-muted-foreground text-sm",children:"Status information unavailable"}),mY=()=>{const e=Pn.use.health(),t=Pn.use.lastCheckTime(),n=Pn.use.status(),[r,a]=k.useState(!1);return k.useEffect(()=>{a(!0);const i=setTimeout(()=>a(!1),300);return()=>clearTimeout(i)},[t]),w.jsx("div",{className:"fixed right-4 bottom-4 flex items-center gap-2 opacity-80 select-none",children:w.jsxs(kf,{children:[w.jsx(Af,{asChild:!0,children:w.jsxs("div",{className:"flex cursor-help items-center gap-2",children:[w.jsx("div",{className:Me("h-3 w-3 rounded-full transition-all duration-300","shadow-[0_0_8px_rgba(0,0,0,0.2)]",e?"bg-green-500":"bg-red-500",r&&"scale-125",r&&e&&"shadow-[0_0_12px_rgba(34,197,94,0.4)]",r&&!e&&"shadow-[0_0_12px_rgba(239,68,68,0.4)]")}),w.jsx("span",{className:"text-muted-foreground text-xs",children:e?"Connected":"Disconnected"})]})}),w.jsx(bu,{className:"w-auto",side:"top",align:"end",children:w.jsx(hY,{status:n})})]})})},i0=()=>{const e=k.useContext(Cz);if(e===void 0)throw new Error("useTheme must be used within a ThemeProvider");return e};function bY(){const{theme:e,setTheme:t}=i0(),n=k.useCallback(()=>t("light"),[t]),r=k.useCallback(()=>t("dark"),[t]);return e==="dark"?w.jsx(Lt,{onClick:n,variant:Yr,tooltip:"Switch to light theme",size:"icon",side:"bottom",children:w.jsx(Kq,{})}):w.jsx(Lt,{onClick:r,variant:Yr,tooltip:"Switch to dark theme",size:"icon",side:"bottom",children:w.jsx(u8,{})})}function tU(e){const t=e+"CollectionProvider",[n,r]=mr(t),[a,i]=n(t,{collectionRef:{current:null},itemMap:new Map}),l=m=>{const{scope:S,children:v}=m,A=ye.useRef(null),R=ye.useRef(new Map).current;return w.jsx(a,{scope:S,itemMap:R,collectionRef:A,children:v})};l.displayName=t;const u=e+"CollectionSlot",c=ye.forwardRef((m,S)=>{const{scope:v,children:A}=m,R=i(u,v),x=ft(S,R.collectionRef);return w.jsx(bo,{ref:x,children:A})});c.displayName=u;const f=e+"CollectionItemSlot",p="data-radix-collection-item",g=ye.forwardRef((m,S)=>{const{scope:v,children:A,...R}=m,x=ye.useRef(null),_=ft(S,x),C=i(f,v);return ye.useEffect(()=>(C.itemMap.set(x,{ref:x,...R}),()=>void C.itemMap.delete(x))),w.jsx(bo,{[p]:"",ref:_,children:A})});g.displayName=f;function b(m){const S=i(e+"CollectionConsumer",m);return ye.useCallback(()=>{const A=S.collectionRef.current;if(!A)return[];const R=Array.from(A.querySelectorAll(`[${p}]`));return Array.from(S.itemMap.values()).sort((C,N)=>R.indexOf(C.ref.current)-R.indexOf(N.ref.current))},[S.collectionRef,S.itemMap])}return[{Provider:l,Slot:c,ItemSlot:g},b,r]}var yY=k.createContext(void 0);function Tf(e){const t=k.useContext(yY);return e||t||"ltr"}var wh="rovingFocusGroup.onEntryFocus",vY={bubbles:!1,cancelable:!0},_f="RovingFocusGroup",[Ox,nU,SY]=tU(_f),[EY,rU]=mr(_f,[SY]),[wY,xY]=EY(_f),aU=k.forwardRef((e,t)=>w.jsx(Ox.Provider,{scope:e.__scopeRovingFocusGroup,children:w.jsx(Ox.Slot,{scope:e.__scopeRovingFocusGroup,children:w.jsx(kY,{...e,ref:t})})}));aU.displayName=_f;var kY=k.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:a=!1,dir:i,currentTabStopId:l,defaultCurrentTabStopId:u,onCurrentTabStopIdChange:c,onEntryFocus:f,preventScrollOnEntryFocus:p=!1,...g}=e,b=k.useRef(null),m=ft(t,b),S=Tf(i),[v=null,A]=Oa({prop:l,defaultProp:u,onChange:c}),[R,x]=k.useState(!1),_=pn(f),C=nU(n),N=k.useRef(!1),[T,O]=k.useState(0);return k.useEffect(()=>{const z=b.current;if(z)return z.addEventListener(wh,_),()=>z.removeEventListener(wh,_)},[_]),w.jsx(wY,{scope:n,orientation:r,dir:S,loop:a,currentTabStopId:v,onItemFocus:k.useCallback(z=>A(z),[A]),onItemShiftTab:k.useCallback(()=>x(!0),[]),onFocusableItemAdd:k.useCallback(()=>O(z=>z+1),[]),onFocusableItemRemove:k.useCallback(()=>O(z=>z-1),[]),children:w.jsx(Xe.div,{tabIndex:R||T===0?-1:0,"data-orientation":r,...g,ref:m,style:{outline:"none",...e.style},onMouseDown:We(e.onMouseDown,()=>{N.current=!0}),onFocus:We(e.onFocus,z=>{const I=!N.current;if(z.target===z.currentTarget&&I&&!R){const M=new CustomEvent(wh,vY);if(z.currentTarget.dispatchEvent(M),!M.defaultPrevented){const H=C().filter(j=>j.focusable),q=H.find(j=>j.active),U=H.find(j=>j.id===v),Z=[q,U,...H].filter(Boolean).map(j=>j.ref.current);lU(Z,p)}}N.current=!1}),onBlur:We(e.onBlur,()=>x(!1))})})}),oU="RovingFocusGroupItem",iU=k.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:a=!1,tabStopId:i,...l}=e,u=En(),c=i||u,f=xY(oU,n),p=f.currentTabStopId===c,g=nU(n),{onFocusableItemAdd:b,onFocusableItemRemove:m}=f;return k.useEffect(()=>{if(r)return b(),()=>m()},[r,b,m]),w.jsx(Ox.ItemSlot,{scope:n,id:c,focusable:r,active:a,children:w.jsx(Xe.span,{tabIndex:p?0:-1,"data-orientation":f.orientation,...l,ref:t,onMouseDown:We(e.onMouseDown,S=>{r?f.onItemFocus(c):S.preventDefault()}),onFocus:We(e.onFocus,()=>f.onItemFocus(c)),onKeyDown:We(e.onKeyDown,S=>{if(S.key==="Tab"&&S.shiftKey){f.onItemShiftTab();return}if(S.target!==S.currentTarget)return;const v=_Y(S,f.orientation,f.dir);if(v!==void 0){if(S.metaKey||S.ctrlKey||S.altKey||S.shiftKey)return;S.preventDefault();let R=g().filter(x=>x.focusable).map(x=>x.ref.current);if(v==="last")R.reverse();else if(v==="prev"||v==="next"){v==="prev"&&R.reverse();const x=R.indexOf(S.currentTarget);R=f.loop?RY(R,x+1):R.slice(x+1)}setTimeout(()=>lU(R))}})})})});iU.displayName=oU;var AY={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function TY(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function _Y(e,t,n){const r=TY(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return AY[r]}function lU(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function RY(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var CY=aU,NY=iU,l0="Tabs",[OY,nve]=mr(l0,[rU]),sU=rU(),[DY,s0]=OY(l0),uU=k.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:a,defaultValue:i,orientation:l="horizontal",dir:u,activationMode:c="automatic",...f}=e,p=Tf(u),[g,b]=Oa({prop:r,onChange:a,defaultProp:i});return w.jsx(DY,{scope:n,baseId:En(),value:g,onValueChange:b,orientation:l,dir:p,activationMode:c,children:w.jsx(Xe.div,{dir:p,"data-orientation":l,...f,ref:t})})});uU.displayName=l0;var cU="TabsList",dU=k.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...a}=e,i=s0(cU,n),l=sU(n);return w.jsx(CY,{asChild:!0,...l,orientation:i.orientation,dir:i.dir,loop:r,children:w.jsx(Xe.div,{role:"tablist","aria-orientation":i.orientation,...a,ref:t})})});dU.displayName=cU;var fU="TabsTrigger",pU=k.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:a=!1,...i}=e,l=s0(fU,n),u=sU(n),c=mU(l.baseId,r),f=bU(l.baseId,r),p=r===l.value;return w.jsx(NY,{asChild:!0,...u,focusable:!a,active:p,children:w.jsx(Xe.button,{type:"button",role:"tab","aria-selected":p,"aria-controls":f,"data-state":p?"active":"inactive","data-disabled":a?"":void 0,disabled:a,id:c,...i,ref:t,onMouseDown:We(e.onMouseDown,g=>{!a&&g.button===0&&g.ctrlKey===!1?l.onValueChange(r):g.preventDefault()}),onKeyDown:We(e.onKeyDown,g=>{[" ","Enter"].includes(g.key)&&l.onValueChange(r)}),onFocus:We(e.onFocus,()=>{const g=l.activationMode!=="manual";!p&&!a&&g&&l.onValueChange(r)})})})});pU.displayName=fU;var gU="TabsContent",hU=k.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:a,children:i,...l}=e,u=s0(gU,n),c=mU(u.baseId,r),f=bU(u.baseId,r),p=r===u.value,g=k.useRef(p);return k.useEffect(()=>{const b=requestAnimationFrame(()=>g.current=!1);return()=>cancelAnimationFrame(b)},[]),w.jsx(Jn,{present:a||p,children:({present:b})=>w.jsx(Xe.div,{"data-state":p?"active":"inactive","data-orientation":u.orientation,role:"tabpanel","aria-labelledby":c,hidden:!b,id:f,tabIndex:0,...l,ref:t,style:{...e.style,animationDuration:g.current?"0s":void 0},children:b&&i})})});hU.displayName=gU;function mU(e,t){return`${e}-trigger-${t}`}function bU(e,t){return`${e}-content-${t}`}var IY=uU,yU=dU,vU=pU,SU=hU;const LY=IY,EU=k.forwardRef(({className:e,...t},n)=>w.jsx(yU,{ref:n,className:Me("bg-muted text-muted-foreground inline-flex h-10 items-center justify-center rounded-md p-1",e),...t}));EU.displayName=yU.displayName;const wU=k.forwardRef(({className:e,...t},n)=>w.jsx(vU,{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}));wU.displayName=vU.displayName;const qs=k.forwardRef(({className:e,...t},n)=>w.jsx(SU,{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}));qs.displayName=SU.displayName;function $c({value:e,currentTab:t,children:n}){return w.jsx(wU,{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 MY(){const e=Ke.use.currentTab();return w.jsx("div",{className:"flex h-8 self-center",children:w.jsxs(EU,{className:"h-full gap-2",children:[w.jsx($c,{value:"documents",currentTab:e,children:"Documents"}),w.jsx($c,{value:"knowledge-graph",currentTab:e,children:"Knowledge Graph"}),w.jsx($c,{value:"retrieval",currentTab:e,children:"Retrieval"}),w.jsx($c,{value:"api",currentTab:e,children:"API"})]})})}function FY(){return w.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:[w.jsxs("a",{href:"/",className:"mr-6 flex items-center gap-2",children:[w.jsx(p8,{className:"size-4 text-emerald-400","aria-hidden":"true"}),w.jsx("span",{className:"font-bold md:inline-block",children:lR.name})]}),w.jsx("div",{className:"flex h-10 flex-1 justify-center",children:w.jsx(MY,{})}),w.jsxs("nav",{className:"flex items-center",children:[w.jsx(Lt,{variant:"ghost",size:"icon",side:"bottom",tooltip:"Project Repository",children:w.jsx("a",{href:lR.github,target:"_blank",rel:"noopener noreferrer",children:w.jsx(Pq,{className:"size-4","aria-hidden":"true"})})}),w.jsx(bY,{})]})]})}var qc={exports:{}},WR;function zY(){if(WR)return qc.exports;WR=1;var e=typeof Reflect=="object"?Reflect:null,t=e&&typeof e.apply=="function"?e.apply:function(N,T,O){return Function.prototype.apply.call(N,T,O)},n;e&&typeof e.ownKeys=="function"?n=e.ownKeys:Object.getOwnPropertySymbols?n=function(N){return Object.getOwnPropertyNames(N).concat(Object.getOwnPropertySymbols(N))}:n=function(N){return Object.getOwnPropertyNames(N)};function r(C){console&&console.warn&&console.warn(C)}var a=Number.isNaN||function(N){return N!==N};function i(){i.init.call(this)}qc.exports=i,qc.exports.once=R,i.EventEmitter=i,i.prototype._events=void 0,i.prototype._eventsCount=0,i.prototype._maxListeners=void 0;var l=10;function u(C){if(typeof C!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof C)}Object.defineProperty(i,"defaultMaxListeners",{enumerable:!0,get:function(){return l},set:function(C){if(typeof C!="number"||C<0||a(C))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+C+".");l=C}}),i.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},i.prototype.setMaxListeners=function(N){if(typeof N!="number"||N<0||a(N))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+N+".");return this._maxListeners=N,this};function c(C){return C._maxListeners===void 0?i.defaultMaxListeners:C._maxListeners}i.prototype.getMaxListeners=function(){return c(this)},i.prototype.emit=function(N){for(var T=[],O=1;O0&&(M=T[0]),M instanceof Error)throw M;var H=new Error("Unhandled error."+(M?" ("+M.message+")":""));throw H.context=M,H}var q=I[N];if(q===void 0)return!1;if(typeof q=="function")t(q,this,T);else for(var U=q.length,W=S(q,U),O=0;O0&&M.length>z&&!M.warned){M.warned=!0;var H=new Error("Possible EventEmitter memory leak detected. "+M.length+" "+String(N)+" listeners added. Use emitter.setMaxListeners() to increase limit");H.name="MaxListenersExceededWarning",H.emitter=C,H.type=N,H.count=M.length,r(H)}return C}i.prototype.addListener=function(N,T){return f(this,N,T,!1)},i.prototype.on=i.prototype.addListener,i.prototype.prependListener=function(N,T){return f(this,N,T,!0)};function p(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function g(C,N,T){var O={fired:!1,wrapFn:void 0,target:C,type:N,listener:T},z=p.bind(O);return z.listener=T,O.wrapFn=z,z}i.prototype.once=function(N,T){return u(T),this.on(N,g(this,N,T)),this},i.prototype.prependOnceListener=function(N,T){return u(T),this.prependListener(N,g(this,N,T)),this},i.prototype.removeListener=function(N,T){var O,z,I,M,H;if(u(T),z=this._events,z===void 0)return this;if(O=z[N],O===void 0)return this;if(O===T||O.listener===T)--this._eventsCount===0?this._events=Object.create(null):(delete z[N],z.removeListener&&this.emit("removeListener",N,O.listener||T));else if(typeof O!="function"){for(I=-1,M=O.length-1;M>=0;M--)if(O[M]===T||O[M].listener===T){H=O[M].listener,I=M;break}if(I<0)return this;I===0?O.shift():v(O,I),O.length===1&&(z[N]=O[0]),z.removeListener!==void 0&&this.emit("removeListener",N,H||T)}return this},i.prototype.off=i.prototype.removeListener,i.prototype.removeAllListeners=function(N){var T,O,z;if(O=this._events,O===void 0)return this;if(O.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):O[N]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete O[N]),this;if(arguments.length===0){var I=Object.keys(O),M;for(z=0;z=0;z--)this.removeListener(N,T[z]);return this};function b(C,N,T){var O=C._events;if(O===void 0)return[];var z=O[N];return z===void 0?[]:typeof z=="function"?T?[z.listener||z]:[z]:T?A(z):S(z,z.length)}i.prototype.listeners=function(N){return b(this,N,!0)},i.prototype.rawListeners=function(N){return b(this,N,!1)},i.listenerCount=function(C,N){return typeof C.listenerCount=="function"?C.listenerCount(N):m.call(C,N)},i.prototype.listenerCount=m;function m(C){var N=this._events;if(N!==void 0){var T=N[C];if(typeof T=="function")return 1;if(T!==void 0)return T.length}return 0}i.prototype.eventNames=function(){return this._eventsCount>0?n(this._events):[]};function S(C,N){for(var T=new Array(N),O=0;Oe++}function Na(){const e=arguments;let t=null,n=-1;return{[Symbol.iterator](){return this},next(){let r=null;do{if(t===null){if(n++,n>=e.length)return{done:!0};t=e[n][Symbol.iterator]()}if(r=t.next(),r.done){t=null;continue}break}while(!0);return r}}}function Nl(){return{[Symbol.iterator](){return this},next(){return{done:!0}}}}class u0 extends Error{constructor(t){super(),this.name="GraphError",this.message=t}}class Le extends u0{constructor(t){super(t),this.name="InvalidArgumentsGraphError",typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,Le.prototype.constructor)}}class De extends u0{constructor(t){super(t),this.name="NotFoundGraphError",typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,De.prototype.constructor)}}class Ze extends u0{constructor(t){super(t),this.name="UsageGraphError",typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,Ze.prototype.constructor)}}function AU(e,t){this.key=e,this.attributes=t,this.clear()}AU.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 TU(e,t){this.key=e,this.attributes=t,this.clear()}TU.prototype.clear=function(){this.inDegree=0,this.outDegree=0,this.directedLoops=0,this.in={},this.out={}};function _U(e,t){this.key=e,this.attributes=t,this.clear()}_U.prototype.clear=function(){this.undirectedDegree=0,this.undirectedLoops=0,this.undirected={}};function Ol(e,t,n,r,a){this.key=t,this.attributes=a,this.undirected=e,this.source=n,this.target=r}Ol.prototype.attach=function(){let e="out",t="in";this.undirected&&(e=t="undirected");const n=this.source.key,r=this.target.key;this.source[e][r]=this,!(this.undirected&&n===r)&&(this.target[t][n]=this)};Ol.prototype.attachMulti=function(){let e="out",t="in";const n=this.source.key,r=this.target.key;this.undirected&&(e=t="undirected");const a=this.source[e],i=a[r];if(typeof i>"u"){a[r]=this,this.undirected&&n===r||(this.target[t][n]=this);return}i.previous=this,this.next=i,a[r]=this,this.target[t][n]=this};Ol.prototype.detach=function(){const e=this.source.key,t=this.target.key;let n="out",r="in";this.undirected&&(n=r="undirected"),delete this.source[n][t],delete this.target[r][e]};Ol.prototype.detachMulti=function(){const e=this.source.key,t=this.target.key;let n="out",r="in";this.undirected&&(n=r="undirected"),this.previous===void 0?this.next===void 0?(delete this.source[n][t],delete this.target[r][e]):(this.next.previous=void 0,this.source[n][t]=this.next,this.target[r][e]=this.next):(this.previous.next=this.next,this.next!==void 0&&(this.next.previous=this.previous))};const RU=0,CU=1,UY=2,NU=3;function Ma(e,t,n,r,a,i,l){let u,c,f,p;if(r=""+r,n===RU){if(u=e._nodes.get(r),!u)throw new De(`Graph.${t}: could not find the "${r}" node in the graph.`);f=a,p=i}else if(n===NU){if(a=""+a,c=e._edges.get(a),!c)throw new De(`Graph.${t}: could not find the "${a}" edge in the graph.`);const g=c.source.key,b=c.target.key;if(r===g)u=c.target;else if(r===b)u=c.source;else throw new De(`Graph.${t}: the "${r}" node is not attached to the "${a}" edge (${g}, ${b}).`);f=i,p=l}else{if(c=e._edges.get(r),!c)throw new De(`Graph.${t}: could not find the "${r}" edge in the graph.`);n===CU?u=c.source:u=c.target,f=a,p=i}return[u,f,p]}function jY(e,t,n){e.prototype[t]=function(r,a,i){const[l,u]=Ma(this,t,n,r,a,i);return l.attributes[u]}}function GY(e,t,n){e.prototype[t]=function(r,a){const[i]=Ma(this,t,n,r,a);return i.attributes}}function HY(e,t,n){e.prototype[t]=function(r,a,i){const[l,u]=Ma(this,t,n,r,a,i);return l.attributes.hasOwnProperty(u)}}function $Y(e,t,n){e.prototype[t]=function(r,a,i,l){const[u,c,f]=Ma(this,t,n,r,a,i,l);return u.attributes[c]=f,this.emit("nodeAttributesUpdated",{key:u.key,type:"set",attributes:u.attributes,name:c}),this}}function qY(e,t,n){e.prototype[t]=function(r,a,i,l){const[u,c,f]=Ma(this,t,n,r,a,i,l);if(typeof f!="function")throw new Le(`Graph.${t}: updater should be a function.`);const p=u.attributes,g=f(p[c]);return p[c]=g,this.emit("nodeAttributesUpdated",{key:u.key,type:"set",attributes:u.attributes,name:c}),this}}function VY(e,t,n){e.prototype[t]=function(r,a,i){const[l,u]=Ma(this,t,n,r,a,i);return delete l.attributes[u],this.emit("nodeAttributesUpdated",{key:l.key,type:"remove",attributes:l.attributes,name:u}),this}}function WY(e,t,n){e.prototype[t]=function(r,a,i){const[l,u]=Ma(this,t,n,r,a,i);if(!gn(u))throw new Le(`Graph.${t}: provided attributes are not a plain object.`);return l.attributes=u,this.emit("nodeAttributesUpdated",{key:l.key,type:"replace",attributes:l.attributes}),this}}function YY(e,t,n){e.prototype[t]=function(r,a,i){const[l,u]=Ma(this,t,n,r,a,i);if(!gn(u))throw new Le(`Graph.${t}: provided attributes are not a plain object.`);return Qt(l.attributes,u),this.emit("nodeAttributesUpdated",{key:l.key,type:"merge",attributes:l.attributes,data:u}),this}}function KY(e,t,n){e.prototype[t]=function(r,a,i){const[l,u]=Ma(this,t,n,r,a,i);if(typeof u!="function")throw new Le(`Graph.${t}: provided updater is not a function.`);return l.attributes=u(l.attributes),this.emit("nodeAttributesUpdated",{key:l.key,type:"update",attributes:l.attributes}),this}}const XY=[{name:e=>`get${e}Attribute`,attacher:jY},{name:e=>`get${e}Attributes`,attacher:GY},{name:e=>`has${e}Attribute`,attacher:HY},{name:e=>`set${e}Attribute`,attacher:$Y},{name:e=>`update${e}Attribute`,attacher:qY},{name:e=>`remove${e}Attribute`,attacher:VY},{name:e=>`replace${e}Attributes`,attacher:WY},{name:e=>`merge${e}Attributes`,attacher:YY},{name:e=>`update${e}Attributes`,attacher:KY}];function ZY(e){XY.forEach(function({name:t,attacher:n}){n(e,t("Node"),RU),n(e,t("Source"),CU),n(e,t("Target"),UY),n(e,t("Opposite"),NU)})}function QY(e,t,n){e.prototype[t]=function(r,a){let i;if(this.type!=="mixed"&&n!=="mixed"&&n!==this.type)throw new Ze(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new Ze(`Graph.${t}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const l=""+r,u=""+a;if(a=arguments[2],i=hr(this,l,u,n),!i)throw new De(`Graph.${t}: could not find an edge for the given path ("${l}" - "${u}").`)}else{if(n!=="mixed")throw new Ze(`Graph.${t}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(r=""+r,i=this._edges.get(r),!i)throw new De(`Graph.${t}: could not find the "${r}" edge in the graph.`)}return i.attributes[a]}}function JY(e,t,n){e.prototype[t]=function(r){let a;if(this.type!=="mixed"&&n!=="mixed"&&n!==this.type)throw new Ze(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>1){if(this.multi)throw new Ze(`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 i=""+r,l=""+arguments[1];if(a=hr(this,i,l,n),!a)throw new De(`Graph.${t}: could not find an edge for the given path ("${i}" - "${l}").`)}else{if(n!=="mixed")throw new Ze(`Graph.${t}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(r=""+r,a=this._edges.get(r),!a)throw new De(`Graph.${t}: could not find the "${r}" edge in the graph.`)}return a.attributes}}function eK(e,t,n){e.prototype[t]=function(r,a){let i;if(this.type!=="mixed"&&n!=="mixed"&&n!==this.type)throw new Ze(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new Ze(`Graph.${t}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const l=""+r,u=""+a;if(a=arguments[2],i=hr(this,l,u,n),!i)throw new De(`Graph.${t}: could not find an edge for the given path ("${l}" - "${u}").`)}else{if(n!=="mixed")throw new Ze(`Graph.${t}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(r=""+r,i=this._edges.get(r),!i)throw new De(`Graph.${t}: could not find the "${r}" edge in the graph.`)}return i.attributes.hasOwnProperty(a)}}function tK(e,t,n){e.prototype[t]=function(r,a,i){let l;if(this.type!=="mixed"&&n!=="mixed"&&n!==this.type)throw new Ze(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>3){if(this.multi)throw new Ze(`Graph.${t}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const u=""+r,c=""+a;if(a=arguments[2],i=arguments[3],l=hr(this,u,c,n),!l)throw new De(`Graph.${t}: could not find an edge for the given path ("${u}" - "${c}").`)}else{if(n!=="mixed")throw new Ze(`Graph.${t}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(r=""+r,l=this._edges.get(r),!l)throw new De(`Graph.${t}: could not find the "${r}" edge in the graph.`)}return l.attributes[a]=i,this.emit("edgeAttributesUpdated",{key:l.key,type:"set",attributes:l.attributes,name:a}),this}}function nK(e,t,n){e.prototype[t]=function(r,a,i){let l;if(this.type!=="mixed"&&n!=="mixed"&&n!==this.type)throw new Ze(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>3){if(this.multi)throw new Ze(`Graph.${t}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const u=""+r,c=""+a;if(a=arguments[2],i=arguments[3],l=hr(this,u,c,n),!l)throw new De(`Graph.${t}: could not find an edge for the given path ("${u}" - "${c}").`)}else{if(n!=="mixed")throw new Ze(`Graph.${t}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(r=""+r,l=this._edges.get(r),!l)throw new De(`Graph.${t}: could not find the "${r}" edge in the graph.`)}if(typeof i!="function")throw new Le(`Graph.${t}: updater should be a function.`);return l.attributes[a]=i(l.attributes[a]),this.emit("edgeAttributesUpdated",{key:l.key,type:"set",attributes:l.attributes,name:a}),this}}function rK(e,t,n){e.prototype[t]=function(r,a){let i;if(this.type!=="mixed"&&n!=="mixed"&&n!==this.type)throw new Ze(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new Ze(`Graph.${t}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const l=""+r,u=""+a;if(a=arguments[2],i=hr(this,l,u,n),!i)throw new De(`Graph.${t}: could not find an edge for the given path ("${l}" - "${u}").`)}else{if(n!=="mixed")throw new Ze(`Graph.${t}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(r=""+r,i=this._edges.get(r),!i)throw new De(`Graph.${t}: could not find the "${r}" edge in the graph.`)}return delete i.attributes[a],this.emit("edgeAttributesUpdated",{key:i.key,type:"remove",attributes:i.attributes,name:a}),this}}function aK(e,t,n){e.prototype[t]=function(r,a){let i;if(this.type!=="mixed"&&n!=="mixed"&&n!==this.type)throw new Ze(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new Ze(`Graph.${t}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const l=""+r,u=""+a;if(a=arguments[2],i=hr(this,l,u,n),!i)throw new De(`Graph.${t}: could not find an edge for the given path ("${l}" - "${u}").`)}else{if(n!=="mixed")throw new Ze(`Graph.${t}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(r=""+r,i=this._edges.get(r),!i)throw new De(`Graph.${t}: could not find the "${r}" edge in the graph.`)}if(!gn(a))throw new Le(`Graph.${t}: provided attributes are not a plain object.`);return i.attributes=a,this.emit("edgeAttributesUpdated",{key:i.key,type:"replace",attributes:i.attributes}),this}}function oK(e,t,n){e.prototype[t]=function(r,a){let i;if(this.type!=="mixed"&&n!=="mixed"&&n!==this.type)throw new Ze(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new Ze(`Graph.${t}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const l=""+r,u=""+a;if(a=arguments[2],i=hr(this,l,u,n),!i)throw new De(`Graph.${t}: could not find an edge for the given path ("${l}" - "${u}").`)}else{if(n!=="mixed")throw new Ze(`Graph.${t}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(r=""+r,i=this._edges.get(r),!i)throw new De(`Graph.${t}: could not find the "${r}" edge in the graph.`)}if(!gn(a))throw new Le(`Graph.${t}: provided attributes are not a plain object.`);return Qt(i.attributes,a),this.emit("edgeAttributesUpdated",{key:i.key,type:"merge",attributes:i.attributes,data:a}),this}}function iK(e,t,n){e.prototype[t]=function(r,a){let i;if(this.type!=="mixed"&&n!=="mixed"&&n!==this.type)throw new Ze(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new Ze(`Graph.${t}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const l=""+r,u=""+a;if(a=arguments[2],i=hr(this,l,u,n),!i)throw new De(`Graph.${t}: could not find an edge for the given path ("${l}" - "${u}").`)}else{if(n!=="mixed")throw new Ze(`Graph.${t}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(r=""+r,i=this._edges.get(r),!i)throw new De(`Graph.${t}: could not find the "${r}" edge in the graph.`)}if(typeof a!="function")throw new Le(`Graph.${t}: provided updater is not a function.`);return i.attributes=a(i.attributes),this.emit("edgeAttributesUpdated",{key:i.key,type:"update",attributes:i.attributes}),this}}const lK=[{name:e=>`get${e}Attribute`,attacher:QY},{name:e=>`get${e}Attributes`,attacher:JY},{name:e=>`has${e}Attribute`,attacher:eK},{name:e=>`set${e}Attribute`,attacher:tK},{name:e=>`update${e}Attribute`,attacher:nK},{name:e=>`remove${e}Attribute`,attacher:rK},{name:e=>`replace${e}Attributes`,attacher:aK},{name:e=>`merge${e}Attributes`,attacher:oK},{name:e=>`update${e}Attributes`,attacher:iK}];function sK(e){lK.forEach(function({name:t,attacher:n}){n(e,t("Edge"),"mixed"),n(e,t("DirectedEdge"),"directed"),n(e,t("UndirectedEdge"),"undirected")})}const uK=[{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 cK(e,t,n,r){let a=!1;for(const i in t){if(i===r)continue;const l=t[i];if(a=n(l.key,l.attributes,l.source.key,l.target.key,l.source.attributes,l.target.attributes,l.undirected),e&&a)return l.key}}function dK(e,t,n,r){let a,i,l,u=!1;for(const c in t)if(c!==r){a=t[c];do{if(i=a.source,l=a.target,u=n(a.key,a.attributes,i.key,l.key,i.attributes,l.attributes,a.undirected),e&&u)return a.key;a=a.next}while(a!==void 0)}}function xh(e,t){const n=Object.keys(e),r=n.length;let a,i=0;return{[Symbol.iterator](){return this},next(){do if(a)a=a.next;else{if(i>=r)return{done:!0};const l=n[i++];if(l===t){a=void 0;continue}a=e[l]}while(!a);return{done:!1,value:{edge:a.key,attributes:a.attributes,source:a.source.key,target:a.target.key,sourceAttributes:a.source.attributes,targetAttributes:a.target.attributes,undirected:a.undirected}}}}}function fK(e,t,n,r){const a=t[n];if(!a)return;const i=a.source,l=a.target;if(r(a.key,a.attributes,i.key,l.key,i.attributes,l.attributes,a.undirected)&&e)return a.key}function pK(e,t,n,r){let a=t[n];if(!a)return;let i=!1;do{if(i=r(a.key,a.attributes,a.source.key,a.target.key,a.source.attributes,a.target.attributes,a.undirected),e&&i)return a.key;a=a.next}while(a!==void 0)}function kh(e,t){let n=e[t];if(n.next!==void 0)return{[Symbol.iterator](){return this},next(){if(!n)return{done:!0};const a={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:a}}};let r=!1;return{[Symbol.iterator](){return this},next(){return r===!0?{done:!0}:(r=!0,{done:!1,value:{edge:n.key,attributes:n.attributes,source:n.source.key,target:n.target.key,sourceAttributes:n.source.attributes,targetAttributes:n.target.attributes,undirected:n.undirected}})}}}function gK(e,t){if(e.size===0)return[];if(t==="mixed"||t===e.type)return Array.from(e._edges.keys());const n=t==="undirected"?e.undirectedSize:e.directedSize,r=new Array(n),a=t==="undirected",i=e._edges.values();let l=0,u,c;for(;u=i.next(),u.done!==!0;)c=u.value,c.undirected===a&&(r[l++]=c.key);return r}function OU(e,t,n,r){if(t.size===0)return;const a=n!=="mixed"&&n!==t.type,i=n==="undirected";let l,u,c=!1;const f=t._edges.values();for(;l=f.next(),l.done!==!0;){if(u=l.value,a&&u.undirected!==i)continue;const{key:p,attributes:g,source:b,target:m}=u;if(c=r(p,g,b.key,m.key,b.attributes,m.attributes,u.undirected),e&&c)return p}}function hK(e,t){if(e.size===0)return Nl();const n=t!=="mixed"&&t!==e.type,r=t==="undirected",a=e._edges.values();return{[Symbol.iterator](){return this},next(){let i,l;for(;;){if(i=a.next(),i.done)return i;if(l=i.value,!(n&&l.undirected!==r))break}return{value:{edge:l.key,attributes:l.attributes,source:l.source.key,target:l.target.key,sourceAttributes:l.source.attributes,targetAttributes:l.target.attributes,undirected:l.undirected},done:!1}}}}function c0(e,t,n,r,a,i){const l=t?dK:cK;let u;if(n!=="undirected"&&(r!=="out"&&(u=l(e,a.in,i),e&&u)||r!=="in"&&(u=l(e,a.out,i,r?void 0:a.key),e&&u))||n!=="directed"&&(u=l(e,a.undirected,i),e&&u))return u}function mK(e,t,n,r){const a=[];return c0(!1,e,t,n,r,function(i){a.push(i)}),a}function bK(e,t,n){let r=Nl();return e!=="undirected"&&(t!=="out"&&typeof n.in<"u"&&(r=Na(r,xh(n.in))),t!=="in"&&typeof n.out<"u"&&(r=Na(r,xh(n.out,t?void 0:n.key)))),e!=="directed"&&typeof n.undirected<"u"&&(r=Na(r,xh(n.undirected))),r}function d0(e,t,n,r,a,i,l){const u=n?pK:fK;let c;if(t!=="undirected"&&(typeof a.in<"u"&&r!=="out"&&(c=u(e,a.in,i,l),e&&c)||typeof a.out<"u"&&r!=="in"&&(r||a.key!==i)&&(c=u(e,a.out,i,l),e&&c))||t!=="directed"&&typeof a.undirected<"u"&&(c=u(e,a.undirected,i,l),e&&c))return c}function yK(e,t,n,r,a){const i=[];return d0(!1,e,t,n,r,a,function(l){i.push(l)}),i}function vK(e,t,n,r){let a=Nl();return e!=="undirected"&&(typeof n.in<"u"&&t!=="out"&&r in n.in&&(a=Na(a,kh(n.in,r))),typeof n.out<"u"&&t!=="in"&&r in n.out&&(t||n.key!==r)&&(a=Na(a,kh(n.out,r)))),e!=="directed"&&typeof n.undirected<"u"&&r in n.undirected&&(a=Na(a,kh(n.undirected,r))),a}function SK(e,t){const{name:n,type:r,direction:a}=t;e.prototype[n]=function(i,l){if(r!=="mixed"&&this.type!=="mixed"&&r!==this.type)return[];if(!arguments.length)return gK(this,r);if(arguments.length===1){i=""+i;const u=this._nodes.get(i);if(typeof u>"u")throw new De(`Graph.${n}: could not find the "${i}" node in the graph.`);return mK(this.multi,r==="mixed"?this.type:r,a,u)}if(arguments.length===2){i=""+i,l=""+l;const u=this._nodes.get(i);if(!u)throw new De(`Graph.${n}: could not find the "${i}" source node in the graph.`);if(!this._nodes.has(l))throw new De(`Graph.${n}: could not find the "${l}" target node in the graph.`);return yK(r,this.multi,a,u,l)}throw new Le(`Graph.${n}: too many arguments (expecting 0, 1 or 2 and got ${arguments.length}).`)}}function EK(e,t){const{name:n,type:r,direction:a}=t,i="forEach"+n[0].toUpperCase()+n.slice(1,-1);e.prototype[i]=function(f,p,g){if(!(r!=="mixed"&&this.type!=="mixed"&&r!==this.type)){if(arguments.length===1)return g=f,OU(!1,this,r,g);if(arguments.length===2){f=""+f,g=p;const b=this._nodes.get(f);if(typeof b>"u")throw new De(`Graph.${i}: could not find the "${f}" node in the graph.`);return c0(!1,this.multi,r==="mixed"?this.type:r,a,b,g)}if(arguments.length===3){f=""+f,p=""+p;const b=this._nodes.get(f);if(!b)throw new De(`Graph.${i}: could not find the "${f}" source node in the graph.`);if(!this._nodes.has(p))throw new De(`Graph.${i}: could not find the "${p}" target node in the graph.`);return d0(!1,r,this.multi,a,b,p,g)}throw new Le(`Graph.${i}: too many arguments (expecting 1, 2 or 3 and got ${arguments.length}).`)}};const l="map"+n[0].toUpperCase()+n.slice(1);e.prototype[l]=function(){const f=Array.prototype.slice.call(arguments),p=f.pop();let g;if(f.length===0){let b=0;r!=="directed"&&(b+=this.undirectedSize),r!=="undirected"&&(b+=this.directedSize),g=new Array(b);let m=0;f.push((S,v,A,R,x,_,C)=>{g[m++]=p(S,v,A,R,x,_,C)})}else g=[],f.push((b,m,S,v,A,R,x)=>{g.push(p(b,m,S,v,A,R,x))});return this[i].apply(this,f),g};const u="filter"+n[0].toUpperCase()+n.slice(1);e.prototype[u]=function(){const f=Array.prototype.slice.call(arguments),p=f.pop(),g=[];return f.push((b,m,S,v,A,R,x)=>{p(b,m,S,v,A,R,x)&&g.push(b)}),this[i].apply(this,f),g};const c="reduce"+n[0].toUpperCase()+n.slice(1);e.prototype[c]=function(){let f=Array.prototype.slice.call(arguments);if(f.length<2||f.length>4)throw new Le(`Graph.${c}: invalid number of arguments (expecting 2, 3 or 4 and got ${f.length}).`);if(typeof f[f.length-1]=="function"&&typeof f[f.length-2]!="function")throw new Le(`Graph.${c}: missing initial value. You must provide it because the callback takes more than one argument and we cannot infer the initial value from the first iteration, as you could with a simple array.`);let p,g;f.length===2?(p=f[0],g=f[1],f=[]):f.length===3?(p=f[1],g=f[2],f=[f[0]]):f.length===4&&(p=f[2],g=f[3],f=[f[0],f[1]]);let b=g;return f.push((m,S,v,A,R,x,_)=>{b=p(b,m,S,v,A,R,x,_)}),this[i].apply(this,f),b}}function wK(e,t){const{name:n,type:r,direction:a}=t,i="find"+n[0].toUpperCase()+n.slice(1,-1);e.prototype[i]=function(c,f,p){if(r!=="mixed"&&this.type!=="mixed"&&r!==this.type)return!1;if(arguments.length===1)return p=c,OU(!0,this,r,p);if(arguments.length===2){c=""+c,p=f;const g=this._nodes.get(c);if(typeof g>"u")throw new De(`Graph.${i}: could not find the "${c}" node in the graph.`);return c0(!0,this.multi,r==="mixed"?this.type:r,a,g,p)}if(arguments.length===3){c=""+c,f=""+f;const g=this._nodes.get(c);if(!g)throw new De(`Graph.${i}: could not find the "${c}" source node in the graph.`);if(!this._nodes.has(f))throw new De(`Graph.${i}: could not find the "${f}" target node in the graph.`);return d0(!0,r,this.multi,a,g,f,p)}throw new Le(`Graph.${i}: too many arguments (expecting 1, 2 or 3 and got ${arguments.length}).`)};const l="some"+n[0].toUpperCase()+n.slice(1,-1);e.prototype[l]=function(){const c=Array.prototype.slice.call(arguments),f=c.pop();return c.push((g,b,m,S,v,A,R)=>f(g,b,m,S,v,A,R)),!!this[i].apply(this,c)};const u="every"+n[0].toUpperCase()+n.slice(1,-1);e.prototype[u]=function(){const c=Array.prototype.slice.call(arguments),f=c.pop();return c.push((g,b,m,S,v,A,R)=>!f(g,b,m,S,v,A,R)),!this[i].apply(this,c)}}function xK(e,t){const{name:n,type:r,direction:a}=t,i=n.slice(0,-1)+"Entries";e.prototype[i]=function(l,u){if(r!=="mixed"&&this.type!=="mixed"&&r!==this.type)return Nl();if(!arguments.length)return hK(this,r);if(arguments.length===1){l=""+l;const c=this._nodes.get(l);if(!c)throw new De(`Graph.${i}: could not find the "${l}" node in the graph.`);return bK(r,a,c)}if(arguments.length===2){l=""+l,u=""+u;const c=this._nodes.get(l);if(!c)throw new De(`Graph.${i}: could not find the "${l}" source node in the graph.`);if(!this._nodes.has(u))throw new De(`Graph.${i}: could not find the "${u}" target node in the graph.`);return vK(r,a,c,u)}throw new Le(`Graph.${i}: too many arguments (expecting 0, 1 or 2 and got ${arguments.length}).`)}}function kK(e){uK.forEach(t=>{SK(e,t),EK(e,t),wK(e,t),xK(e,t)})}const AK=[{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 Rf(){this.A=null,this.B=null}Rf.prototype.wrap=function(e){this.A===null?this.A=e:this.B===null&&(this.B=e)};Rf.prototype.has=function(e){return this.A!==null&&e in this.A||this.B!==null&&e in this.B};function Ms(e,t,n,r,a){for(const i in r){const l=r[i],u=l.source,c=l.target,f=u===n?c:u;if(t&&t.has(f.key))continue;const p=a(f.key,f.attributes);if(e&&p)return f.key}}function f0(e,t,n,r,a){if(t!=="mixed"){if(t==="undirected")return Ms(e,null,r,r.undirected,a);if(typeof n=="string")return Ms(e,null,r,r[n],a)}const i=new Rf;let l;if(t!=="undirected"){if(n!=="out"){if(l=Ms(e,null,r,r.in,a),e&&l)return l;i.wrap(r.in)}if(n!=="in"){if(l=Ms(e,i,r,r.out,a),e&&l)return l;i.wrap(r.out)}}if(t!=="directed"&&(l=Ms(e,i,r,r.undirected,a),e&&l))return l}function TK(e,t,n){if(e!=="mixed"){if(e==="undirected")return Object.keys(n.undirected);if(typeof t=="string")return Object.keys(n[t])}const r=[];return f0(!1,e,t,n,function(a){r.push(a)}),r}function Fs(e,t,n){const r=Object.keys(n),a=r.length;let i=0;return{[Symbol.iterator](){return this},next(){let l=null;do{if(i>=a)return e&&e.wrap(n),{done:!0};const u=n[r[i++]],c=u.source,f=u.target;if(l=c===t?f:c,e&&e.has(l.key)){l=null;continue}}while(l===null);return{done:!1,value:{neighbor:l.key,attributes:l.attributes}}}}}function _K(e,t,n){if(e!=="mixed"){if(e==="undirected")return Fs(null,n,n.undirected);if(typeof t=="string")return Fs(null,n,n[t])}let r=Nl();const a=new Rf;return e!=="undirected"&&(t!=="out"&&(r=Na(r,Fs(a,n,n.in))),t!=="in"&&(r=Na(r,Fs(a,n,n.out)))),e!=="directed"&&(r=Na(r,Fs(a,n,n.undirected))),r}function RK(e,t){const{name:n,type:r,direction:a}=t;e.prototype[n]=function(i){if(r!=="mixed"&&this.type!=="mixed"&&r!==this.type)return[];i=""+i;const l=this._nodes.get(i);if(typeof l>"u")throw new De(`Graph.${n}: could not find the "${i}" node in the graph.`);return TK(r==="mixed"?this.type:r,a,l)}}function CK(e,t){const{name:n,type:r,direction:a}=t,i="forEach"+n[0].toUpperCase()+n.slice(1,-1);e.prototype[i]=function(f,p){if(r!=="mixed"&&this.type!=="mixed"&&r!==this.type)return;f=""+f;const g=this._nodes.get(f);if(typeof g>"u")throw new De(`Graph.${i}: could not find the "${f}" node in the graph.`);f0(!1,r==="mixed"?this.type:r,a,g,p)};const l="map"+n[0].toUpperCase()+n.slice(1);e.prototype[l]=function(f,p){const g=[];return this[i](f,(b,m)=>{g.push(p(b,m))}),g};const u="filter"+n[0].toUpperCase()+n.slice(1);e.prototype[u]=function(f,p){const g=[];return this[i](f,(b,m)=>{p(b,m)&&g.push(b)}),g};const c="reduce"+n[0].toUpperCase()+n.slice(1);e.prototype[c]=function(f,p,g){if(arguments.length<3)throw new Le(`Graph.${c}: 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 b=g;return this[i](f,(m,S)=>{b=p(b,m,S)}),b}}function NK(e,t){const{name:n,type:r,direction:a}=t,i=n[0].toUpperCase()+n.slice(1,-1),l="find"+i;e.prototype[l]=function(f,p){if(r!=="mixed"&&this.type!=="mixed"&&r!==this.type)return;f=""+f;const g=this._nodes.get(f);if(typeof g>"u")throw new De(`Graph.${l}: could not find the "${f}" node in the graph.`);return f0(!0,r==="mixed"?this.type:r,a,g,p)};const u="some"+i;e.prototype[u]=function(f,p){return!!this[l](f,p)};const c="every"+i;e.prototype[c]=function(f,p){return!this[l](f,(b,m)=>!p(b,m))}}function OK(e,t){const{name:n,type:r,direction:a}=t,i=n.slice(0,-1)+"Entries";e.prototype[i]=function(l){if(r!=="mixed"&&this.type!=="mixed"&&r!==this.type)return Nl();l=""+l;const u=this._nodes.get(l);if(typeof u>"u")throw new De(`Graph.${i}: could not find the "${l}" node in the graph.`);return _K(r==="mixed"?this.type:r,a,u)}}function DK(e){AK.forEach(t=>{RK(e,t),CK(e,t),NK(e,t),OK(e,t)})}function Vc(e,t,n,r,a){const i=r._nodes.values(),l=r.type;let u,c,f,p,g,b;for(;u=i.next(),u.done!==!0;){let m=!1;if(c=u.value,l!=="undirected"){p=c.out;for(f in p){g=p[f];do b=g.target,m=!0,a(c.key,b.key,c.attributes,b.attributes,g.key,g.attributes,g.undirected),g=g.next;while(g)}}if(l!=="directed"){p=c.undirected;for(f in p)if(!(t&&c.key>f)){g=p[f];do b=g.target,b.key!==f&&(b=g.source),m=!0,a(c.key,b.key,c.attributes,b.attributes,g.key,g.attributes,g.undirected),g=g.next;while(g)}}n&&!m&&a(c.key,null,c.attributes,null,null,null,null)}}function IK(e,t){const n={key:e};return kU(t.attributes)||(n.attributes=Qt({},t.attributes)),n}function LK(e,t,n){const r={key:t,source:n.source.key,target:n.target.key};return kU(n.attributes)||(r.attributes=Qt({},n.attributes)),e==="mixed"&&n.undirected&&(r.undirected=!0),r}function MK(e){if(!gn(e))throw new Le('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 Le("Graph.import: serialized node is missing its key.");if("attributes"in e&&(!gn(e.attributes)||e.attributes===null))throw new Le("Graph.import: invalid attributes. Attributes should be a plain object, null or omitted.")}function FK(e){if(!gn(e))throw new Le('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 Le("Graph.import: serialized edge is missing its source.");if(!("target"in e))throw new Le("Graph.import: serialized edge is missing its target.");if("attributes"in e&&(!gn(e.attributes)||e.attributes===null))throw new Le("Graph.import: invalid attributes. Attributes should be a plain object, null or omitted.");if("undirected"in e&&typeof e.undirected!="boolean")throw new Le("Graph.import: invalid undirectedness information. Undirected should be boolean or omitted.")}const zK=BY(),PK=new Set(["directed","undirected","mixed"]),KR=new Set(["domain","_events","_eventsCount","_maxListeners"]),BK=[{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"}],UK={allowSelfLoops:!0,multi:!1,type:"mixed"};function jK(e,t,n){if(n&&!gn(n))throw new Le(`Graph.addNode: invalid attributes. Expecting an object but got "${n}"`);if(t=""+t,n=n||{},e._nodes.has(t))throw new Ze(`Graph.addNode: the "${t}" node already exist in the graph.`);const r=new e.NodeDataClass(t,n);return e._nodes.set(t,r),e.emit("nodeAdded",{key:t,attributes:n}),r}function XR(e,t,n){const r=new e.NodeDataClass(t,n);return e._nodes.set(t,r),e.emit("nodeAdded",{key:t,attributes:n}),r}function DU(e,t,n,r,a,i,l,u){if(!r&&e.type==="undirected")throw new Ze(`Graph.${t}: you cannot add a directed edge to an undirected graph. Use the #.addEdge or #.addUndirectedEdge instead.`);if(r&&e.type==="directed")throw new Ze(`Graph.${t}: you cannot add an undirected edge to a directed graph. Use the #.addEdge or #.addDirectedEdge instead.`);if(u&&!gn(u))throw new Le(`Graph.${t}: invalid attributes. Expecting an object but got "${u}"`);if(i=""+i,l=""+l,u=u||{},!e.allowSelfLoops&&i===l)throw new Ze(`Graph.${t}: source & target are the same ("${i}"), thus creating a loop explicitly forbidden by this graph 'allowSelfLoops' option set to false.`);const c=e._nodes.get(i),f=e._nodes.get(l);if(!c)throw new De(`Graph.${t}: source node "${i}" not found.`);if(!f)throw new De(`Graph.${t}: target node "${l}" not found.`);const p={key:null,undirected:r,source:i,target:l,attributes:u};if(n)a=e._edgeKeyGenerator();else if(a=""+a,e._edges.has(a))throw new Ze(`Graph.${t}: the "${a}" edge already exists in the graph.`);if(!e.multi&&(r?typeof c.undirected[l]<"u":typeof c.out[l]<"u"))throw new Ze(`Graph.${t}: an edge linking "${i}" to "${l}" already exists. If you really want to add multiple edges linking those nodes, you should create a multi graph by using the 'multi' option.`);const g=new Ol(r,a,c,f,u);e._edges.set(a,g);const b=i===l;return r?(c.undirectedDegree++,f.undirectedDegree++,b&&(c.undirectedLoops++,e._undirectedSelfLoopCount++)):(c.outDegree++,f.inDegree++,b&&(c.directedLoops++,e._directedSelfLoopCount++)),e.multi?g.attachMulti():g.attach(),r?e._undirectedSize++:e._directedSize++,p.key=a,e.emit("edgeAdded",p),a}function GK(e,t,n,r,a,i,l,u,c){if(!r&&e.type==="undirected")throw new Ze(`Graph.${t}: you cannot merge/update a directed edge to an undirected graph. Use the #.mergeEdge/#.updateEdge or #.addUndirectedEdge instead.`);if(r&&e.type==="directed")throw new Ze(`Graph.${t}: you cannot merge/update an undirected edge to a directed graph. Use the #.mergeEdge/#.updateEdge or #.addDirectedEdge instead.`);if(u){if(c){if(typeof u!="function")throw new Le(`Graph.${t}: invalid updater function. Expecting a function but got "${u}"`)}else if(!gn(u))throw new Le(`Graph.${t}: invalid attributes. Expecting an object but got "${u}"`)}i=""+i,l=""+l;let f;if(c&&(f=u,u=void 0),!e.allowSelfLoops&&i===l)throw new Ze(`Graph.${t}: source & target are the same ("${i}"), thus creating a loop explicitly forbidden by this graph 'allowSelfLoops' option set to false.`);let p=e._nodes.get(i),g=e._nodes.get(l),b,m;if(!n&&(b=e._edges.get(a),b)){if((b.source.key!==i||b.target.key!==l)&&(!r||b.source.key!==l||b.target.key!==i))throw new Ze(`Graph.${t}: inconsistency detected when attempting to merge the "${a}" edge with "${i}" source & "${l}" target vs. ("${b.source.key}", "${b.target.key}").`);m=b}if(!m&&!e.multi&&p&&(m=r?p.undirected[l]:p.out[l]),m){const x=[m.key,!1,!1,!1];if(c?!f:!u)return x;if(c){const _=m.attributes;m.attributes=f(_),e.emit("edgeAttributesUpdated",{type:"replace",key:m.key,attributes:m.attributes})}else Qt(m.attributes,u),e.emit("edgeAttributesUpdated",{type:"merge",key:m.key,attributes:m.attributes,data:u});return x}u=u||{},c&&f&&(u=f(u));const S={key:null,undirected:r,source:i,target:l,attributes:u};if(n)a=e._edgeKeyGenerator();else if(a=""+a,e._edges.has(a))throw new Ze(`Graph.${t}: the "${a}" edge already exists in the graph.`);let v=!1,A=!1;p||(p=XR(e,i,{}),v=!0,i===l&&(g=p,A=!0)),g||(g=XR(e,l,{}),A=!0),b=new Ol(r,a,p,g,u),e._edges.set(a,b);const R=i===l;return r?(p.undirectedDegree++,g.undirectedDegree++,R&&(p.undirectedLoops++,e._undirectedSelfLoopCount++)):(p.outDegree++,g.inDegree++,R&&(p.directedLoops++,e._directedSelfLoopCount++)),e.multi?b.attachMulti():b.attach(),r?e._undirectedSize++:e._directedSize++,S.key=a,e.emit("edgeAdded",S),[a,!0,v,A]}function Qi(e,t){e._edges.delete(t.key);const{source:n,target:r,attributes:a}=t,i=t.undirected,l=n===r;i?(n.undirectedDegree--,r.undirectedDegree--,l&&(n.undirectedLoops--,e._undirectedSelfLoopCount--)):(n.outDegree--,r.inDegree--,l&&(n.directedLoops--,e._directedSelfLoopCount--)),e.multi?t.detachMulti():t.detach(),i?e._undirectedSize--:e._directedSize--,e.emit("edgeDropped",{key:t.key,attributes:a,source:n.key,target:r.key,undirected:i})}class Tt extends xU.EventEmitter{constructor(t){if(super(),t=Qt({},UK,t),typeof t.multi!="boolean")throw new Le(`Graph.constructor: invalid 'multi' option. Expecting a boolean but got "${t.multi}".`);if(!PK.has(t.type))throw new Le(`Graph.constructor: invalid 'type' option. Should be one of "mixed", "directed" or "undirected" but got "${t.type}".`);if(typeof t.allowSelfLoops!="boolean")throw new Le(`Graph.constructor: invalid 'allowSelfLoops' option. Expecting a boolean but got "${t.allowSelfLoops}".`);const n=t.type==="mixed"?AU:t.type==="directed"?TU:_U;pr(this,"NodeDataClass",n);const r="geid_"+zK()+"_";let a=0;const i=()=>{let l;do l=r+a++;while(this._edges.has(l));return l};pr(this,"_attributes",{}),pr(this,"_nodes",new Map),pr(this,"_edges",new Map),pr(this,"_directedSize",0),pr(this,"_undirectedSize",0),pr(this,"_directedSelfLoopCount",0),pr(this,"_undirectedSelfLoopCount",0),pr(this,"_edgeKeyGenerator",i),pr(this,"_options",t),KR.forEach(l=>pr(this,l,this[l])),Tr(this,"order",()=>this._nodes.size),Tr(this,"size",()=>this._edges.size),Tr(this,"directedSize",()=>this._directedSize),Tr(this,"undirectedSize",()=>this._undirectedSize),Tr(this,"selfLoopCount",()=>this._directedSelfLoopCount+this._undirectedSelfLoopCount),Tr(this,"directedSelfLoopCount",()=>this._directedSelfLoopCount),Tr(this,"undirectedSelfLoopCount",()=>this._undirectedSelfLoopCount),Tr(this,"multi",this._options.multi),Tr(this,"type",this._options.type),Tr(this,"allowSelfLoops",this._options.allowSelfLoops),Tr(this,"implementation",()=>"graphology")}_resetInstanceCounters(){this._directedSize=0,this._undirectedSize=0,this._directedSelfLoopCount=0,this._undirectedSelfLoopCount=0}hasNode(t){return this._nodes.has(""+t)}hasDirectedEdge(t,n){if(this.type==="undirected")return!1;if(arguments.length===1){const r=""+t,a=this._edges.get(r);return!!a&&!a.undirected}else if(arguments.length===2){t=""+t,n=""+n;const r=this._nodes.get(t);return r?r.out.hasOwnProperty(n):!1}throw new Le(`Graph.hasDirectedEdge: invalid arity (${arguments.length}, instead of 1 or 2). You can either ask for an edge id or for the existence of an edge between a source & a target.`)}hasUndirectedEdge(t,n){if(this.type==="directed")return!1;if(arguments.length===1){const r=""+t,a=this._edges.get(r);return!!a&&a.undirected}else if(arguments.length===2){t=""+t,n=""+n;const r=this._nodes.get(t);return r?r.undirected.hasOwnProperty(n):!1}throw new Le(`Graph.hasDirectedEdge: invalid arity (${arguments.length}, instead of 1 or 2). You can either ask for an edge id or for the existence of an edge between a source & a target.`)}hasEdge(t,n){if(arguments.length===1){const r=""+t;return this._edges.has(r)}else if(arguments.length===2){t=""+t,n=""+n;const r=this._nodes.get(t);return r?typeof r.out<"u"&&r.out.hasOwnProperty(n)||typeof r.undirected<"u"&&r.undirected.hasOwnProperty(n):!1}throw new Le(`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 Ze("Graph.directedEdge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.directedEdges instead.");const r=this._nodes.get(t);if(!r)throw new De(`Graph.directedEdge: could not find the "${t}" source node in the graph.`);if(!this._nodes.has(n))throw new De(`Graph.directedEdge: could not find the "${n}" target node in the graph.`);const a=r.out&&r.out[n]||void 0;if(a)return a.key}undirectedEdge(t,n){if(this.type==="directed")return;if(t=""+t,n=""+n,this.multi)throw new Ze("Graph.undirectedEdge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.undirectedEdges instead.");const r=this._nodes.get(t);if(!r)throw new De(`Graph.undirectedEdge: could not find the "${t}" source node in the graph.`);if(!this._nodes.has(n))throw new De(`Graph.undirectedEdge: could not find the "${n}" target node in the graph.`);const a=r.undirected&&r.undirected[n]||void 0;if(a)return a.key}edge(t,n){if(this.multi)throw new Ze("Graph.edge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.edges instead.");t=""+t,n=""+n;const r=this._nodes.get(t);if(!r)throw new De(`Graph.edge: could not find the "${t}" source node in the graph.`);if(!this._nodes.has(n))throw new De(`Graph.edge: could not find the "${n}" target node in the graph.`);const a=r.out&&r.out[n]||r.undirected&&r.undirected[n]||void 0;if(a)return a.key}areDirectedNeighbors(t,n){t=""+t,n=""+n;const r=this._nodes.get(t);if(!r)throw new De(`Graph.areDirectedNeighbors: could not find the "${t}" node in the graph.`);return this.type==="undirected"?!1:n in r.in||n in r.out}areOutNeighbors(t,n){t=""+t,n=""+n;const r=this._nodes.get(t);if(!r)throw new De(`Graph.areOutNeighbors: could not find the "${t}" node in the graph.`);return this.type==="undirected"?!1:n in r.out}areInNeighbors(t,n){t=""+t,n=""+n;const r=this._nodes.get(t);if(!r)throw new De(`Graph.areInNeighbors: could not find the "${t}" node in the graph.`);return this.type==="undirected"?!1:n in r.in}areUndirectedNeighbors(t,n){t=""+t,n=""+n;const r=this._nodes.get(t);if(!r)throw new De(`Graph.areUndirectedNeighbors: could not find the "${t}" node in the graph.`);return this.type==="directed"?!1:n in r.undirected}areNeighbors(t,n){t=""+t,n=""+n;const r=this._nodes.get(t);if(!r)throw new De(`Graph.areNeighbors: could not find the "${t}" node in the graph.`);return this.type!=="undirected"&&(n in r.in||n in r.out)||this.type!=="directed"&&n in r.undirected}areInboundNeighbors(t,n){t=""+t,n=""+n;const r=this._nodes.get(t);if(!r)throw new De(`Graph.areInboundNeighbors: could not find the "${t}" node in the graph.`);return this.type!=="undirected"&&n in r.in||this.type!=="directed"&&n in r.undirected}areOutboundNeighbors(t,n){t=""+t,n=""+n;const r=this._nodes.get(t);if(!r)throw new De(`Graph.areOutboundNeighbors: could not find the "${t}" node in the graph.`);return this.type!=="undirected"&&n in r.out||this.type!=="directed"&&n in r.undirected}inDegree(t){t=""+t;const n=this._nodes.get(t);if(!n)throw new De(`Graph.inDegree: could not find the "${t}" node in the graph.`);return this.type==="undirected"?0:n.inDegree}outDegree(t){t=""+t;const n=this._nodes.get(t);if(!n)throw new De(`Graph.outDegree: could not find the "${t}" node in the graph.`);return this.type==="undirected"?0:n.outDegree}directedDegree(t){t=""+t;const n=this._nodes.get(t);if(!n)throw new De(`Graph.directedDegree: could not find the "${t}" node in the graph.`);return this.type==="undirected"?0:n.inDegree+n.outDegree}undirectedDegree(t){t=""+t;const n=this._nodes.get(t);if(!n)throw new De(`Graph.undirectedDegree: could not find the "${t}" node in the graph.`);return this.type==="directed"?0:n.undirectedDegree}inboundDegree(t){t=""+t;const n=this._nodes.get(t);if(!n)throw new De(`Graph.inboundDegree: could not find the "${t}" node in the graph.`);let r=0;return this.type!=="directed"&&(r+=n.undirectedDegree),this.type!=="undirected"&&(r+=n.inDegree),r}outboundDegree(t){t=""+t;const n=this._nodes.get(t);if(!n)throw new De(`Graph.outboundDegree: could not find the "${t}" node in the graph.`);let r=0;return this.type!=="directed"&&(r+=n.undirectedDegree),this.type!=="undirected"&&(r+=n.outDegree),r}degree(t){t=""+t;const n=this._nodes.get(t);if(!n)throw new De(`Graph.degree: could not find the "${t}" node in the graph.`);let r=0;return this.type!=="directed"&&(r+=n.undirectedDegree),this.type!=="undirected"&&(r+=n.inDegree+n.outDegree),r}inDegreeWithoutSelfLoops(t){t=""+t;const n=this._nodes.get(t);if(!n)throw new De(`Graph.inDegreeWithoutSelfLoops: could not find the "${t}" node in the graph.`);return this.type==="undirected"?0:n.inDegree-n.directedLoops}outDegreeWithoutSelfLoops(t){t=""+t;const n=this._nodes.get(t);if(!n)throw new De(`Graph.outDegreeWithoutSelfLoops: could not find the "${t}" node in the graph.`);return this.type==="undirected"?0:n.outDegree-n.directedLoops}directedDegreeWithoutSelfLoops(t){t=""+t;const n=this._nodes.get(t);if(!n)throw new De(`Graph.directedDegreeWithoutSelfLoops: could not find the "${t}" node in the graph.`);return this.type==="undirected"?0:n.inDegree+n.outDegree-n.directedLoops*2}undirectedDegreeWithoutSelfLoops(t){t=""+t;const n=this._nodes.get(t);if(!n)throw new De(`Graph.undirectedDegreeWithoutSelfLoops: could not find the "${t}" node in the graph.`);return this.type==="directed"?0:n.undirectedDegree-n.undirectedLoops*2}inboundDegreeWithoutSelfLoops(t){t=""+t;const n=this._nodes.get(t);if(!n)throw new De(`Graph.inboundDegreeWithoutSelfLoops: could not find the "${t}" node in the graph.`);let r=0,a=0;return this.type!=="directed"&&(r+=n.undirectedDegree,a+=n.undirectedLoops*2),this.type!=="undirected"&&(r+=n.inDegree,a+=n.directedLoops),r-a}outboundDegreeWithoutSelfLoops(t){t=""+t;const n=this._nodes.get(t);if(!n)throw new De(`Graph.outboundDegreeWithoutSelfLoops: could not find the "${t}" node in the graph.`);let r=0,a=0;return this.type!=="directed"&&(r+=n.undirectedDegree,a+=n.undirectedLoops*2),this.type!=="undirected"&&(r+=n.outDegree,a+=n.directedLoops),r-a}degreeWithoutSelfLoops(t){t=""+t;const n=this._nodes.get(t);if(!n)throw new De(`Graph.degreeWithoutSelfLoops: could not find the "${t}" node in the graph.`);let r=0,a=0;return this.type!=="directed"&&(r+=n.undirectedDegree,a+=n.undirectedLoops*2),this.type!=="undirected"&&(r+=n.inDegree+n.outDegree,a+=n.directedLoops*2),r-a}source(t){t=""+t;const n=this._edges.get(t);if(!n)throw new De(`Graph.source: could not find the "${t}" edge in the graph.`);return n.source.key}target(t){t=""+t;const n=this._edges.get(t);if(!n)throw new De(`Graph.target: could not find the "${t}" edge in the graph.`);return n.target.key}extremities(t){t=""+t;const n=this._edges.get(t);if(!n)throw new De(`Graph.extremities: could not find the "${t}" edge in the graph.`);return[n.source.key,n.target.key]}opposite(t,n){t=""+t,n=""+n;const r=this._edges.get(n);if(!r)throw new De(`Graph.opposite: could not find the "${n}" edge in the graph.`);const a=r.source.key,i=r.target.key;if(t===a)return i;if(t===i)return a;throw new De(`Graph.opposite: the "${t}" node is not attached to the "${n}" edge (${a}, ${i}).`)}hasExtremity(t,n){t=""+t,n=""+n;const r=this._edges.get(t);if(!r)throw new De(`Graph.hasExtremity: could not find the "${t}" edge in the graph.`);return r.source.key===n||r.target.key===n}isUndirected(t){t=""+t;const n=this._edges.get(t);if(!n)throw new De(`Graph.isUndirected: could not find the "${t}" edge in the graph.`);return n.undirected}isDirected(t){t=""+t;const n=this._edges.get(t);if(!n)throw new De(`Graph.isDirected: could not find the "${t}" edge in the graph.`);return!n.undirected}isSelfLoop(t){t=""+t;const n=this._edges.get(t);if(!n)throw new De(`Graph.isSelfLoop: could not find the "${t}" edge in the graph.`);return n.source===n.target}addNode(t,n){return jK(this,t,n).key}mergeNode(t,n){if(n&&!gn(n))throw new Le(`Graph.mergeNode: invalid attributes. Expecting an object but got "${n}"`);t=""+t,n=n||{};let r=this._nodes.get(t);return r?(n&&(Qt(r.attributes,n),this.emit("nodeAttributesUpdated",{type:"merge",key:t,attributes:r.attributes,data:n})),[t,!1]):(r=new this.NodeDataClass(t,n),this._nodes.set(t,r),this.emit("nodeAdded",{key:t,attributes:n}),[t,!0])}updateNode(t,n){if(n&&typeof n!="function")throw new Le(`Graph.updateNode: invalid updater function. Expecting a function but got "${n}"`);t=""+t;let r=this._nodes.get(t);if(r){if(n){const i=r.attributes;r.attributes=n(i),this.emit("nodeAttributesUpdated",{type:"replace",key:t,attributes:r.attributes})}return[t,!1]}const a=n?n({}):{};return r=new this.NodeDataClass(t,a),this._nodes.set(t,r),this.emit("nodeAdded",{key:t,attributes:a}),[t,!0]}dropNode(t){t=""+t;const n=this._nodes.get(t);if(!n)throw new De(`Graph.dropNode: could not find the "${t}" node in the graph.`);let r;if(this.type!=="undirected"){for(const a in n.out){r=n.out[a];do Qi(this,r),r=r.next;while(r)}for(const a in n.in){r=n.in[a];do Qi(this,r),r=r.next;while(r)}}if(this.type!=="directed")for(const a in n.undirected){r=n.undirected[a];do Qi(this,r),r=r.next;while(r)}this._nodes.delete(t),this.emit("nodeDropped",{key:t,attributes:n.attributes})}dropEdge(t){let n;if(arguments.length>1){const r=""+arguments[0],a=""+arguments[1];if(n=hr(this,r,a,this.type),!n)throw new De(`Graph.dropEdge: could not find the "${r}" -> "${a}" edge in the graph.`)}else if(t=""+t,n=this._edges.get(t),!n)throw new De(`Graph.dropEdge: could not find the "${t}" edge in the graph.`);return Qi(this,n),this}dropDirectedEdge(t,n){if(arguments.length<2)throw new Ze("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 Ze("Graph.dropDirectedEdge: cannot use a {source,target} combo when dropping an edge in a MultiGraph since we cannot infer the one you want to delete as there could be multiple ones.");t=""+t,n=""+n;const r=hr(this,t,n,"directed");if(!r)throw new De(`Graph.dropDirectedEdge: could not find a "${t}" -> "${n}" edge in the graph.`);return Qi(this,r),this}dropUndirectedEdge(t,n){if(arguments.length<2)throw new Ze("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 Ze("Graph.dropUndirectedEdge: cannot use a {source,target} combo when dropping an edge in a MultiGraph since we cannot infer the one you want to delete as there could be multiple ones.");const r=hr(this,t,n,"undirected");if(!r)throw new De(`Graph.dropUndirectedEdge: could not find a "${t}" -> "${n}" edge in the graph.`);return Qi(this,r),this}clear(){this._edges.clear(),this._nodes.clear(),this._resetInstanceCounters(),this.emit("cleared")}clearEdges(){const t=this._nodes.values();let n;for(;n=t.next(),n.done!==!0;)n.value.clear();this._edges.clear(),this._resetInstanceCounters(),this.emit("edgesCleared")}getAttribute(t){return this._attributes[t]}getAttributes(){return this._attributes}hasAttribute(t){return this._attributes.hasOwnProperty(t)}setAttribute(t,n){return this._attributes[t]=n,this.emit("attributesUpdated",{type:"set",attributes:this._attributes,name:t}),this}updateAttribute(t,n){if(typeof n!="function")throw new Le("Graph.updateAttribute: updater should be a function.");const r=this._attributes[t];return this._attributes[t]=n(r),this.emit("attributesUpdated",{type:"set",attributes:this._attributes,name:t}),this}removeAttribute(t){return delete this._attributes[t],this.emit("attributesUpdated",{type:"remove",attributes:this._attributes,name:t}),this}replaceAttributes(t){if(!gn(t))throw new Le("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(!gn(t))throw new Le("Graph.mergeAttributes: provided attributes are not a plain object.");return Qt(this._attributes,t),this.emit("attributesUpdated",{type:"merge",attributes:this._attributes,data:t}),this}updateAttributes(t){if(typeof t!="function")throw new Le("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 Le("Graph.updateEachNodeAttributes: expecting an updater function.");if(n&&!YR(n))throw new Le("Graph.updateEachNodeAttributes: invalid hints. Expecting an object having the following shape: {attributes?: [string]}");const r=this._nodes.values();let a,i;for(;a=r.next(),a.done!==!0;)i=a.value,i.attributes=t(i.key,i.attributes);this.emit("eachNodeAttributesUpdated",{hints:n||null})}updateEachEdgeAttributes(t,n){if(typeof t!="function")throw new Le("Graph.updateEachEdgeAttributes: expecting an updater function.");if(n&&!YR(n))throw new Le("Graph.updateEachEdgeAttributes: invalid hints. Expecting an object having the following shape: {attributes?: [string]}");const r=this._edges.values();let a,i,l,u;for(;a=r.next(),a.done!==!0;)i=a.value,l=i.source,u=i.target,i.attributes=t(i.key,i.attributes,l.key,u.key,l.attributes,u.attributes,i.undirected);this.emit("eachEdgeAttributesUpdated",{hints:n||null})}forEachAdjacencyEntry(t){if(typeof t!="function")throw new Le("Graph.forEachAdjacencyEntry: expecting a callback.");Vc(!1,!1,!1,this,t)}forEachAdjacencyEntryWithOrphans(t){if(typeof t!="function")throw new Le("Graph.forEachAdjacencyEntryWithOrphans: expecting a callback.");Vc(!1,!1,!0,this,t)}forEachAssymetricAdjacencyEntry(t){if(typeof t!="function")throw new Le("Graph.forEachAssymetricAdjacencyEntry: expecting a callback.");Vc(!1,!0,!1,this,t)}forEachAssymetricAdjacencyEntryWithOrphans(t){if(typeof t!="function")throw new Le("Graph.forEachAssymetricAdjacencyEntryWithOrphans: expecting a callback.");Vc(!1,!0,!0,this,t)}nodes(){return Array.from(this._nodes.keys())}forEachNode(t){if(typeof t!="function")throw new Le("Graph.forEachNode: expecting a callback.");const n=this._nodes.values();let r,a;for(;r=n.next(),r.done!==!0;)a=r.value,t(a.key,a.attributes)}findNode(t){if(typeof t!="function")throw new Le("Graph.findNode: expecting a callback.");const n=this._nodes.values();let r,a;for(;r=n.next(),r.done!==!0;)if(a=r.value,t(a.key,a.attributes))return a.key}mapNodes(t){if(typeof t!="function")throw new Le("Graph.mapNode: expecting a callback.");const n=this._nodes.values();let r,a;const i=new Array(this.order);let l=0;for(;r=n.next(),r.done!==!0;)a=r.value,i[l++]=t(a.key,a.attributes);return i}someNode(t){if(typeof t!="function")throw new Le("Graph.someNode: expecting a callback.");const n=this._nodes.values();let r,a;for(;r=n.next(),r.done!==!0;)if(a=r.value,t(a.key,a.attributes))return!0;return!1}everyNode(t){if(typeof t!="function")throw new Le("Graph.everyNode: expecting a callback.");const n=this._nodes.values();let r,a;for(;r=n.next(),r.done!==!0;)if(a=r.value,!t(a.key,a.attributes))return!1;return!0}filterNodes(t){if(typeof t!="function")throw new Le("Graph.filterNodes: expecting a callback.");const n=this._nodes.values();let r,a;const i=[];for(;r=n.next(),r.done!==!0;)a=r.value,t(a.key,a.attributes)&&i.push(a.key);return i}reduceNodes(t,n){if(typeof t!="function")throw new Le("Graph.reduceNodes: expecting a callback.");if(arguments.length<2)throw new Le("Graph.reduceNodes: missing initial value. You must provide it because the callback takes more than one argument and we cannot infer the initial value from the first iteration, as you could with a simple array.");let r=n;const a=this._nodes.values();let i,l;for(;i=a.next(),i.done!==!0;)l=i.value,r=t(r,l.key,l.attributes);return r}nodeEntries(){const t=this._nodes.values();return{[Symbol.iterator](){return this},next(){const n=t.next();if(n.done)return n;const r=n.value;return{value:{node:r.key,attributes:r.attributes},done:!1}}}}export(){const t=new Array(this._nodes.size);let n=0;this._nodes.forEach((a,i)=>{t[n++]=IK(i,a)});const r=new Array(this._edges.size);return n=0,this._edges.forEach((a,i)=>{r[n++]=LK(this.type,i,a)}),{options:{type:this.type,multi:this.multi,allowSelfLoops:this.allowSelfLoops},attributes:this.getAttributes(),nodes:t,edges:r}}import(t,n=!1){if(t instanceof Tt)return t.forEachNode((c,f)=>{n?this.mergeNode(c,f):this.addNode(c,f)}),t.forEachEdge((c,f,p,g,b,m,S)=>{n?S?this.mergeUndirectedEdgeWithKey(c,p,g,f):this.mergeDirectedEdgeWithKey(c,p,g,f):S?this.addUndirectedEdgeWithKey(c,p,g,f):this.addDirectedEdgeWithKey(c,p,g,f)}),this;if(!gn(t))throw new Le("Graph.import: invalid argument. Expecting a serialized graph or, alternatively, a Graph instance.");if(t.attributes){if(!gn(t.attributes))throw new Le("Graph.import: invalid attributes. Expecting a plain object.");n?this.mergeAttributes(t.attributes):this.replaceAttributes(t.attributes)}let r,a,i,l,u;if(t.nodes){if(i=t.nodes,!Array.isArray(i))throw new Le("Graph.import: invalid nodes. Expecting an array.");for(r=0,a=i.length;r{const i=Qt({},r.attributes);r=new n.NodeDataClass(a,i),n._nodes.set(a,r)}),n}copy(t){if(t=t||{},typeof t.type=="string"&&t.type!==this.type&&t.type!=="mixed")throw new Ze(`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 Ze("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 Ze("Graph.copy: cannot create an incompatible copy from a graph allowing self loops to one that does not because this would mean losing information about the current graph.");const n=this.emptyCopy(t),r=this._edges.values();let a,i;for(;a=r.next(),a.done!==!0;)i=a.value,DU(n,"copy",!1,i.undirected,i.key,i.source.key,i.target.key,Qt({},i.attributes));return n}toJSON(){return this.export()}toString(){return"[object Graph]"}inspect(){const t={};this._nodes.forEach((i,l)=>{t[l]=i.attributes});const n={},r={};this._edges.forEach((i,l)=>{const u=i.undirected?"--":"->";let c="",f=i.source.key,p=i.target.key,g;i.undirected&&f>p&&(g=f,f=p,p=g);const b=`(${f})${u}(${p})`;l.startsWith("geid_")?this.multi&&(typeof r[b]>"u"?r[b]=0:r[b]++,c+=`${r[b]}. `):c+=`[${l}]: `,c+=b,n[c]=i.attributes});const a={};for(const i in this)this.hasOwnProperty(i)&&!KR.has(i)&&typeof this[i]!="function"&&typeof i!="symbol"&&(a[i]=this[i]);return a.attributes=this._attributes,a.nodes=t,a.edges=n,pr(a,"constructor",this.constructor),a}}typeof Symbol<"u"&&(Tt.prototype[Symbol.for("nodejs.util.inspect.custom")]=Tt.prototype.inspect);BK.forEach(e=>{["add","merge","update"].forEach(t=>{const n=e.name(t),r=t==="add"?DU:GK;e.generateKey?Tt.prototype[n]=function(a,i,l){return r(this,n,!0,(e.type||this.type)==="undirected",null,a,i,l,t==="update")}:Tt.prototype[n]=function(a,i,l,u){return r(this,n,!1,(e.type||this.type)==="undirected",a,i,l,u,t==="update")}})});ZY(Tt);sK(Tt);kK(Tt);DK(Tt);class tu extends Tt{constructor(t){const n=Qt({type:"directed"},t);if("multi"in n&&n.multi!==!1)throw new Le("DirectedGraph.from: inconsistent indication that the graph should be multi in given options!");if(n.type!=="directed")throw new Le('DirectedGraph.from: inconsistent "'+n.type+'" type in given options!');super(n)}}class IU extends Tt{constructor(t){const n=Qt({type:"undirected"},t);if("multi"in n&&n.multi!==!1)throw new Le("UndirectedGraph.from: inconsistent indication that the graph should be multi in given options!");if(n.type!=="undirected")throw new Le('UndirectedGraph.from: inconsistent "'+n.type+'" type in given options!');super(n)}}class LU extends Tt{constructor(t){const n=Qt({multi:!0},t);if("multi"in n&&n.multi!==!0)throw new Le("MultiGraph.from: inconsistent indication that the graph should be simple in given options!");super(n)}}class MU extends Tt{constructor(t){const n=Qt({type:"directed",multi:!0},t);if("multi"in n&&n.multi!==!0)throw new Le("MultiDirectedGraph.from: inconsistent indication that the graph should be simple in given options!");if(n.type!=="directed")throw new Le('MultiDirectedGraph.from: inconsistent "'+n.type+'" type in given options!');super(n)}}class FU extends Tt{constructor(t){const n=Qt({type:"undirected",multi:!0},t);if("multi"in n&&n.multi!==!0)throw new Le("MultiUndirectedGraph.from: inconsistent indication that the graph should be simple in given options!");if(n.type!=="undirected")throw new Le('MultiUndirectedGraph.from: inconsistent "'+n.type+'" type in given options!');super(n)}}function Dl(e){e.from=function(t,n){const r=Qt({},t.options,n),a=new e(r);return a.import(t),a}}Dl(Tt);Dl(tu);Dl(IU);Dl(LU);Dl(MU);Dl(FU);Tt.Graph=Tt;Tt.DirectedGraph=tu;Tt.UndirectedGraph=IU;Tt.MultiGraph=LU;Tt.MultiDirectedGraph=MU;Tt.MultiUndirectedGraph=FU;Tt.InvalidArgumentsGraphError=Le;Tt.NotFoundGraphError=De;Tt.UsageGraphError=Ze;function HK(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function Ws(e){var t=HK(e,"string");return typeof t=="symbol"?t:t+""}function on(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ZR(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,r=Array(t);n>8&255,i=n>>16&255,l=n>>24&255;return[r,a,i,l]}var Th={};function GU(e){if(typeof Th[e]<"u")return Th[e];var t=(e&16711680)>>>16,n=(e&65280)>>>8,r=e&255,a=255,i=jU(t,n,r,a);return Th[e]=i,i}function QR(e,t,n,r){return n+(t<<8)+(e<<16)}function JR(e,t,n,r,a,i){var l=Math.floor(n/i*a),u=Math.floor(e.drawingBufferHeight/i-r/i*a),c=new Uint8Array(4);e.bindFramebuffer(e.FRAMEBUFFER,t),e.readPixels(l,u,1,1,e.RGBA,e.UNSIGNED_BYTE,c);var f=vl(c,4),p=f[0],g=f[1],b=f[2],m=f[3];return[p,g,b,m]}function _e(e,t,n){return(t=Ws(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function eC(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function Be(e){for(var t=1;tC){var T="…";for(f=f+T,N=e.measureText(f).width;N>C&&f.length>1;)f=f.slice(0,-2)+T,N=e.measureText(f).width;if(f.length<4)return}var O;x>0?_>0?O=Math.acos(x/C):O=Math.asin(_/C):_>0?O=Math.acos(x/C)+Math.PI:O=Math.asin(x/C)+Math.PI/2,e.save(),e.translate(A,R),e.rotate(O),e.fillText(f,-N/2,t.size/2+i),e.restore()}}}function WU(e,t,n){if(t.label){var r=n.labelSize,a=n.labelFont,i=n.labelWeight,l=n.labelColor.attribute?t[n.labelColor.attribute]||n.labelColor.color||"#000":n.labelColor.color;e.fillStyle=l,e.font="".concat(i," ").concat(r,"px ").concat(a),e.fillText(t.label,t.x+t.size+3,t.y+r/3)}}function iX(e,t,n){var r=n.labelSize,a=n.labelFont,i=n.labelWeight;e.font="".concat(i," ").concat(r,"px ").concat(a),e.fillStyle="#FFF",e.shadowOffsetX=0,e.shadowOffsetY=0,e.shadowBlur=8,e.shadowColor="#000";var l=2;if(typeof t.label=="string"){var u=e.measureText(t.label).width,c=Math.round(u+5),f=Math.round(r+2*l),p=Math.max(t.size,r/2)+l,g=Math.asin(f/2/p),b=Math.sqrt(Math.abs(Math.pow(p,2)-Math.pow(f/2,2)));e.beginPath(),e.moveTo(t.x+b,t.y+f/2),e.lineTo(t.x+p+c,t.y+f/2),e.lineTo(t.x+p+c,t.y-f/2),e.lineTo(t.x+b,t.y-f/2),e.arc(t.x,t.y,p,g,-g),e.closePath(),e.fill()}else e.beginPath(),e.arc(t.x,t.y,t.size+l,0,Math.PI*2),e.closePath(),e.fill();e.shadowOffsetX=0,e.shadowOffsetY=0,e.shadowBlur=0,WU(e,t,n)}var lX=` +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 +} +`,sX=lX,uX=` +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; +} +`,cX=uX,YU=WebGLRenderingContext,aC=YU.UNSIGNED_BYTE,Rh=YU.FLOAT,dX=["u_sizeRatio","u_correctionRatio","u_matrix"],vu=function(e){function t(){return on(this,t),Bn(this,t,arguments)}return Un(t,e),ln(t,[{key:"getDefinition",value:function(){return{VERTICES:3,VERTEX_SHADER_SOURCE:cX,FRAGMENT_SHADER_SOURCE:sX,METHOD:WebGLRenderingContext.TRIANGLES,UNIFORMS:dX,ATTRIBUTES:[{name:"a_position",size:2,type:Rh},{name:"a_size",size:1,type:Rh},{name:"a_color",size:4,type:aC,normalized:!0},{name:"a_id",size:4,type:aC,normalized:!0}],CONSTANT_ATTRIBUTES:[{name:"a_angle",size:1,type:Rh}],CONSTANT_DATA:[[t.ANGLE_1],[t.ANGLE_2],[t.ANGLE_3]]}}},{key:"processVisibleItem",value:function(r,a,i){var l=this.array,u=Qr(i.color);l[a++]=i.x,l[a++]=i.y,l[a++]=i.size,l[a++]=u,l[a++]=r}},{key:"setUniforms",value:function(r,a){var i=a.gl,l=a.uniformLocations,u=l.u_sizeRatio,c=l.u_correctionRatio,f=l.u_matrix;i.uniform1f(c,r.correctionRatio),i.uniform1f(u,r.sizeRatio),i.uniformMatrix3fv(f,!1,r.matrix)}}])}(p0);_e(vu,"ANGLE_1",0);_e(vu,"ANGLE_2",2*Math.PI/3);_e(vu,"ANGLE_3",4*Math.PI/3);var fX=` +precision mediump float; + +varying vec4 v_color; + +void main(void) { + gl_FragColor = v_color; +} +`,pX=fX,gX=` +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; +} +`,hX=gX,KU=WebGLRenderingContext,oC=KU.UNSIGNED_BYTE,Yc=KU.FLOAT,mX=["u_matrix","u_sizeRatio","u_correctionRatio","u_minEdgeThickness","u_lengthToThicknessRatio","u_widenessToThicknessRatio"],Su={extremity:"target",lengthToThicknessRatio:2.5,widenessToThicknessRatio:2};function Pd(e){var t=Be(Be({},Su),e||{});return function(n){function r(){return on(this,r),Bn(this,r,arguments)}return Un(r,n),ln(r,[{key:"getDefinition",value:function(){return{VERTICES:3,VERTEX_SHADER_SOURCE:hX,FRAGMENT_SHADER_SOURCE:pX,METHOD:WebGLRenderingContext.TRIANGLES,UNIFORMS:mX,ATTRIBUTES:[{name:"a_position",size:2,type:Yc},{name:"a_normal",size:2,type:Yc},{name:"a_radius",size:1,type:Yc},{name:"a_color",size:4,type:oC,normalized:!0},{name:"a_id",size:4,type:oC,normalized:!0}],CONSTANT_ATTRIBUTES:[{name:"a_barycentric",size:3,type:Yc}],CONSTANT_DATA:[[1,0,0],[0,1,0],[0,0,1]]}}},{key:"processVisibleItem",value:function(i,l,u,c,f){if(t.extremity==="source"){var p=[c,u];u=p[0],c=p[1]}var g=f.size||1,b=c.size||1,m=u.x,S=u.y,v=c.x,A=c.y,R=Qr(f.color),x=v-m,_=A-S,C=x*x+_*_,N=0,T=0;C&&(C=1/Math.sqrt(C),N=-_*C*g,T=x*C*g);var O=this.array;O[l++]=v,O[l++]=A,O[l++]=-N,O[l++]=-T,O[l++]=b,O[l++]=R,O[l++]=i}},{key:"setUniforms",value:function(i,l){var u=l.gl,c=l.uniformLocations,f=c.u_matrix,p=c.u_sizeRatio,g=c.u_correctionRatio,b=c.u_minEdgeThickness,m=c.u_lengthToThicknessRatio,S=c.u_widenessToThicknessRatio;u.uniformMatrix3fv(f,!1,i.matrix),u.uniform1f(p,i.sizeRatio),u.uniform1f(g,i.correctionRatio),u.uniform1f(b,i.minEdgeThickness),u.uniform1f(m,t.lengthToThicknessRatio),u.uniform1f(S,t.widenessToThicknessRatio)}}])}(yu)}Pd();var bX=` +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 +} +`,g0=bX,yX=` +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; +} +`,vX=yX,XU=WebGLRenderingContext,iC=XU.UNSIGNED_BYTE,Ko=XU.FLOAT,SX=["u_matrix","u_zoomRatio","u_sizeRatio","u_correctionRatio","u_pixelRatio","u_feather","u_minEdgeThickness","u_lengthToThicknessRatio"],EX={lengthToThicknessRatio:Su.lengthToThicknessRatio};function ZU(e){var t=Be(Be({},EX),{});return function(n){function r(){return on(this,r),Bn(this,r,arguments)}return Un(r,n),ln(r,[{key:"getDefinition",value:function(){return{VERTICES:6,VERTEX_SHADER_SOURCE:vX,FRAGMENT_SHADER_SOURCE:g0,METHOD:WebGLRenderingContext.TRIANGLES,UNIFORMS:SX,ATTRIBUTES:[{name:"a_positionStart",size:2,type:Ko},{name:"a_positionEnd",size:2,type:Ko},{name:"a_normal",size:2,type:Ko},{name:"a_color",size:4,type:iC,normalized:!0},{name:"a_id",size:4,type:iC,normalized:!0},{name:"a_radius",size:1,type:Ko}],CONSTANT_ATTRIBUTES:[{name:"a_positionCoef",size:1,type:Ko},{name:"a_normalCoef",size:1,type:Ko},{name:"a_radiusCoef",size:1,type:Ko}],CONSTANT_DATA:[[0,1,0],[0,-1,0],[1,1,1],[1,1,1],[0,-1,0],[1,-1,-1]]}}},{key:"processVisibleItem",value:function(i,l,u,c,f){var p=f.size||1,g=u.x,b=u.y,m=c.x,S=c.y,v=Qr(f.color),A=m-g,R=S-b,x=c.size||1,_=A*A+R*R,C=0,N=0;_&&(_=1/Math.sqrt(_),C=-R*_*p,N=A*_*p);var T=this.array;T[l++]=g,T[l++]=b,T[l++]=m,T[l++]=S,T[l++]=C,T[l++]=N,T[l++]=v,T[l++]=i,T[l++]=x}},{key:"setUniforms",value:function(i,l){var u=l.gl,c=l.uniformLocations,f=c.u_matrix,p=c.u_zoomRatio,g=c.u_feather,b=c.u_pixelRatio,m=c.u_correctionRatio,S=c.u_sizeRatio,v=c.u_minEdgeThickness,A=c.u_lengthToThicknessRatio;u.uniformMatrix3fv(f,!1,i.matrix),u.uniform1f(p,i.zoomRatio),u.uniform1f(S,i.sizeRatio),u.uniform1f(m,i.correctionRatio),u.uniform1f(b,i.pixelRatio),u.uniform1f(g,i.antiAliasingFeather),u.uniform1f(v,i.minEdgeThickness),u.uniform1f(A,t.lengthToThicknessRatio)}}])}(yu)}ZU();function wX(e){return VU([ZU(),Pd(e)])}var xX=wX(),QU=xX,kX=` +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; +} +`,AX=kX,JU=WebGLRenderingContext,lC=JU.UNSIGNED_BYTE,zs=JU.FLOAT,TX=["u_matrix","u_zoomRatio","u_sizeRatio","u_correctionRatio","u_pixelRatio","u_feather","u_minEdgeThickness"],_X=function(e){function t(){return on(this,t),Bn(this,t,arguments)}return Un(t,e),ln(t,[{key:"getDefinition",value:function(){return{VERTICES:6,VERTEX_SHADER_SOURCE:AX,FRAGMENT_SHADER_SOURCE:g0,METHOD:WebGLRenderingContext.TRIANGLES,UNIFORMS:TX,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:lC,normalized:!0},{name:"a_id",size:4,type:lC,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(r,a,i,l,u){var c=u.size||1,f=i.x,p=i.y,g=l.x,b=l.y,m=Qr(u.color),S=g-f,v=b-p,A=S*S+v*v,R=0,x=0;A&&(A=1/Math.sqrt(A),R=-v*A*c,x=S*A*c);var _=this.array;_[a++]=f,_[a++]=p,_[a++]=g,_[a++]=b,_[a++]=R,_[a++]=x,_[a++]=m,_[a++]=r}},{key:"setUniforms",value:function(r,a){var i=a.gl,l=a.uniformLocations,u=l.u_matrix,c=l.u_zoomRatio,f=l.u_feather,p=l.u_pixelRatio,g=l.u_correctionRatio,b=l.u_sizeRatio,m=l.u_minEdgeThickness;i.uniformMatrix3fv(u,!1,r.matrix),i.uniform1f(c,r.zoomRatio),i.uniform1f(b,r.sizeRatio),i.uniform1f(g,r.correctionRatio),i.uniform1f(p,r.pixelRatio),i.uniform1f(f,r.antiAliasingFeather),i.uniform1f(m,r.minEdgeThickness)}}])}(yu),h0=function(e){function t(){var n;return on(this,t),n=Bn(this,t),n.rawEmitter=n,n}return Un(t,e),ln(t)}(xU.EventEmitter),Ch,sC;function Jr(){return sC||(sC=1,Ch=function(t){return t!==null&&typeof t=="object"&&typeof t.addUndirectedEdgeWithKey=="function"&&typeof t.dropNode=="function"&&typeof t.multi=="boolean"}),Ch}var RX=Jr();const CX=an(RX);var NX=function(t){return t},OX=function(t){return t*t},DX=function(t){return t*(2-t)},IX=function(t){return(t*=2)<1?.5*t*t:-.5*(--t*(t-2)-1)},LX=function(t){return t*t*t},MX=function(t){return--t*t*t+1},FX=function(t){return(t*=2)<1?.5*t*t*t:.5*((t-=2)*t*t+2)},e3={linear:NX,quadraticIn:OX,quadraticOut:DX,quadraticInOut:IX,cubicIn:LX,cubicOut:MX,cubicInOut:FX},t3={easing:"quadraticInOut",duration:150};function zX(e,t,n,r){var a=Object.assign({},t3,n),i=typeof a.easing=="function"?a.easing:e3[a.easing],l=Date.now(),u={};for(var c in t){var f=t[c];u[c]={};for(var p in f)u[c][p]=e.getNodeAttribute(c,p)}var g=null,b=function(){g=null;var S=(Date.now()-l)/a.duration;if(S>=1){for(var v in t){var A=t[v];for(var R in A)e.setNodeAttribute(v,R,A[R])}return}S=i(S);for(var x in t){var _=t[x],C=u[x];for(var N in _)e.setNodeAttribute(x,N,_[N]*S+C[N]*(1-S))}g=requestAnimationFrame(b)};return b(),function(){g&&cancelAnimationFrame(g)}}function _r(){return Float32Array.of(1,0,0,0,1,0,0,0,1)}function Kc(e,t,n){return e[0]=t,e[4]=typeof n=="number"?n:t,e}function uC(e,t){var n=Math.sin(t),r=Math.cos(t);return e[0]=r,e[1]=n,e[3]=-n,e[4]=r,e}function cC(e,t,n){return e[6]=t,e[7]=n,e}function io(e,t){var n=e[0],r=e[1],a=e[2],i=e[3],l=e[4],u=e[5],c=e[6],f=e[7],p=e[8],g=t[0],b=t[1],m=t[2],S=t[3],v=t[4],A=t[5],R=t[6],x=t[7],_=t[8];return e[0]=g*n+b*i+m*c,e[1]=g*r+b*l+m*f,e[2]=g*a+b*u+m*p,e[3]=S*n+v*i+A*c,e[4]=S*r+v*l+A*f,e[5]=S*a+v*u+A*p,e[6]=R*n+x*i+_*c,e[7]=R*r+x*l+_*f,e[8]=R*a+x*u+_*p,e}function Mx(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,r=e[0],a=e[1],i=e[3],l=e[4],u=e[6],c=e[7],f=t.x,p=t.y;return{x:f*r+p*i+u*n,y:f*a+p*l+c*n}}function PX(e,t){var n=e.height/e.width,r=t.height/t.width;return n<1&&r>1||n>1&&r<1?1:Math.min(Math.max(r,1/r),Math.max(1/n,n))}function Ps(e,t,n,r,a){var i=e.angle,l=e.ratio,u=e.x,c=e.y,f=t.width,p=t.height,g=_r(),b=Math.min(f,p)-2*r,m=PX(t,n);return a?(io(g,cC(_r(),u,c)),io(g,Kc(_r(),l)),io(g,uC(_r(),i)),io(g,Kc(_r(),f/b/2/m,p/b/2/m))):(io(g,Kc(_r(),2*(b/f)*m,2*(b/p)*m)),io(g,uC(_r(),-i)),io(g,Kc(_r(),1/l)),io(g,cC(_r(),-u,-c))),g}function BX(e,t,n){var r=Mx(e,{x:Math.cos(t.angle),y:Math.sin(t.angle)},0),a=r.x,i=r.y;return 1/Math.sqrt(Math.pow(a,2)+Math.pow(i,2))/n.width}function UX(e){if(!e.order)return{x:[0,1],y:[0,1]};var t=1/0,n=-1/0,r=1/0,a=-1/0;return e.forEachNode(function(i,l){var u=l.x,c=l.y;un&&(n=u),ca&&(a=c)}),{x:[t,n],y:[r,a]}}function jX(e){if(!CX(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 GX(e,t,n){var r=document.createElement(e);if(t)for(var a in t)r.style[a]=t[a];if(n)for(var i in n)r.setAttribute(i,n[i]);return r}function dC(){return typeof window.devicePixelRatio<"u"?window.devicePixelRatio:1}function fC(e,t,n){return n.sort(function(r,a){var i=t(r)||0,l=t(a)||0;return il?1:0})}function pC(e){var t=vl(e.x,2),n=t[0],r=t[1],a=vl(e.y,2),i=a[0],l=a[1],u=Math.max(r-n,l-i),c=(r+n)/2,f=(l+i)/2;(u===0||Math.abs(u)===1/0||isNaN(u))&&(u=1),isNaN(c)&&(c=0),isNaN(f)&&(f=0);var p=function(b){return{x:.5+(b.x-c)/u,y:.5+(b.y-f)/u}};return p.applyTo=function(g){g.x=.5+(g.x-c)/u,g.y=.5+(g.y-f)/u},p.inverse=function(g){return{x:c+u*(g.x-.5),y:f+u*(g.y-.5)}},p.ratio=u,p}function Fx(e){"@babel/helpers - typeof";return Fx=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},Fx(e)}function gC(e,t){var n=t.size;if(n!==0){var r=e.length;e.length+=n;var a=0;t.forEach(function(i){e[r+a]=i,a++})}}function Nh(e){e=e||{};for(var t=0,n=arguments.length<=1?0:arguments.length-1;t1&&arguments[1]!==void 0?arguments[1]:{},l=arguments.length>2?arguments[2]:void 0;if(!l)return new Promise(function(m){return a.animate(r,i,m)});if(this.enabled){var u=Be(Be({},t3),i),c=this.validateState(r),f=typeof u.easing=="function"?u.easing:e3[u.easing],p=Date.now(),g=this.getState(),b=function(){var S=(Date.now()-p)/u.duration;if(S>=1){a.nextFrame=null,a.setState(c),a.animationCallback&&(a.animationCallback.call(null),a.animationCallback=void 0);return}var v=f(S),A={};typeof c.x=="number"&&(A.x=g.x+(c.x-g.x)*v),typeof c.y=="number"&&(A.y=g.y+(c.y-g.y)*v),a.enabledRotation&&typeof c.angle=="number"&&(A.angle=g.angle+(c.angle-g.angle)*v),typeof c.ratio=="number"&&(A.ratio=g.ratio+(c.ratio-g.ratio)*v),a.setState(A),a.nextFrame=requestAnimationFrame(b)};this.nextFrame?(cancelAnimationFrame(this.nextFrame),this.animationCallback&&this.animationCallback.call(null),this.nextFrame=requestAnimationFrame(b)):b(),this.animationCallback=l}}},{key:"animatedZoom",value:function(r){return r?typeof r=="number"?this.animate({ratio:this.ratio/r}):this.animate({ratio:this.ratio/(r.factor||Xc)},r):this.animate({ratio:this.ratio/Xc})}},{key:"animatedUnzoom",value:function(r){return r?typeof r=="number"?this.animate({ratio:this.ratio*r}):this.animate({ratio:this.ratio*(r.factor||Xc)},r):this.animate({ratio:this.ratio*Xc})}},{key:"animatedReset",value:function(r){return this.animate({x:.5,y:.5,ratio:1,angle:0},r)}},{key:"copy",value:function(){return t.from(this.getState())}}],[{key:"from",value:function(r){var a=new t;return a.setState(r)}}])}(h0);function Cr(e,t){var n=t.getBoundingClientRect();return{x:e.clientX-n.left,y:e.clientY-n.top}}function Aa(e,t){var n=Be(Be({},Cr(e,t)),{},{sigmaDefaultPrevented:!1,preventSigmaDefault:function(){n.sigmaDefaultPrevented=!0},original:e});return n}function Bs(e){var t="x"in e?e:Be(Be({},e.touches[0]||e.previousTouches[0]),{},{original:e.original,sigmaDefaultPrevented:e.sigmaDefaultPrevented,preventSigmaDefault:function(){e.sigmaDefaultPrevented=!0,t.sigmaDefaultPrevented=!0}});return t}function VX(e,t){return Be(Be({},Aa(e,t)),{},{delta:n3(e)})}var WX=2;function vd(e){for(var t=[],n=0,r=Math.min(e.length,WX);n0;a.draggedEvents=0,g&&a.renderer.getSetting("hideEdgesOnMove")&&a.renderer.refresh()},0),this.emit("mouseup",Aa(r,this.container))}}},{key:"handleMove",value:function(r){var a=this;if(this.enabled){var i=Aa(r,this.container);if(this.emit("mousemovebody",i),(r.target===this.container||r.composedPath()[0]===this.container)&&this.emit("mousemove",i),!i.sigmaDefaultPrevented&&this.isMouseDown){this.isMoving=!0,this.draggedEvents++,typeof this.movingTimeout=="number"&&clearTimeout(this.movingTimeout),this.movingTimeout=window.setTimeout(function(){a.movingTimeout=null,a.isMoving=!1},this.settings.dragTimeout);var l=this.renderer.getCamera(),u=Cr(r,this.container),c=u.x,f=u.y,p=this.renderer.viewportToFramedGraph({x:this.lastMouseX,y:this.lastMouseY}),g=this.renderer.viewportToFramedGraph({x:c,y:f}),b=p.x-g.x,m=p.y-g.y,S=l.getState(),v=S.x+b,A=S.y+m;l.setState({x:v,y:A}),this.lastMouseX=c,this.lastMouseY=f,r.preventDefault(),r.stopPropagation()}}}},{key:"handleLeave",value:function(r){this.emit("mouseleave",Aa(r,this.container))}},{key:"handleEnter",value:function(r){this.emit("mouseenter",Aa(r,this.container))}},{key:"handleWheel",value:function(r){var a=this,i=this.renderer.getCamera();if(!(!this.enabled||!i.enabledZooming)){var l=n3(r);if(l){var u=VX(r,this.container);if(this.emit("wheel",u),u.sigmaDefaultPrevented){r.preventDefault(),r.stopPropagation();return}var c=i.getState().ratio,f=l>0?1/this.settings.zoomingRatio:this.settings.zoomingRatio,p=i.getBoundedRatio(c*f),g=l>0?1:-1,b=Date.now();c!==p&&(r.preventDefault(),r.stopPropagation(),!(this.currentWheelDirection===g&&this.lastWheelTriggerTime&&b-this.lastWheelTriggerTimer.size?-1:n.sizer.key?1:-1}}])}(),yC=function(){function e(){on(this,e),_e(this,"width",0),_e(this,"height",0),_e(this,"cellSize",0),_e(this,"columns",0),_e(this,"rows",0),_e(this,"cells",{})}return ln(e,[{key:"resizeAndClear",value:function(n,r){this.width=n.width,this.height=n.height,this.cellSize=r,this.columns=Math.ceil(n.width/r),this.rows=Math.ceil(n.height/r),this.cells={}}},{key:"getIndex",value:function(n){var r=Math.floor(n.x/this.cellSize),a=Math.floor(n.y/this.cellSize);return a*this.columns+r}},{key:"add",value:function(n,r,a){var i=new bC(n,r),l=this.getIndex(a),u=this.cells[l];u||(u=[],this.cells[l]=u),u.push(i)}},{key:"organize",value:function(){for(var n in this.cells){var r=this.cells[n];r.sort(bC.compare)}}},{key:"getLabelsToDisplay",value:function(n,r){var a=this.cellSize*this.cellSize,i=a/n/n,l=i*r/a,u=Math.ceil(l),c=[];for(var f in this.cells)for(var p=this.cells[f],g=0;g2&&arguments[2]!==void 0?arguments[2]:{};if(on(this,t),a=Bn(this,t),_e(a,"elements",{}),_e(a,"canvasContexts",{}),_e(a,"webGLContexts",{}),_e(a,"pickingLayers",new Set),_e(a,"textures",{}),_e(a,"frameBuffers",{}),_e(a,"activeListeners",{}),_e(a,"labelGrid",new yC),_e(a,"nodeDataCache",{}),_e(a,"edgeDataCache",{}),_e(a,"nodeProgramIndex",{}),_e(a,"edgeProgramIndex",{}),_e(a,"nodesWithForcedLabels",new Set),_e(a,"edgesWithForcedLabels",new Set),_e(a,"nodeExtent",{x:[0,1],y:[0,1]}),_e(a,"nodeZExtent",[1/0,-1/0]),_e(a,"edgeZExtent",[1/0,-1/0]),_e(a,"matrix",_r()),_e(a,"invMatrix",_r()),_e(a,"correctionRatio",1),_e(a,"customBBox",null),_e(a,"normalizationFunction",pC({x:[0,1],y:[0,1]})),_e(a,"graphToViewportRatio",1),_e(a,"itemIDsIndex",{}),_e(a,"nodeIndices",{}),_e(a,"edgeIndices",{}),_e(a,"width",0),_e(a,"height",0),_e(a,"pixelRatio",dC()),_e(a,"pickingDownSizingRatio",2*a.pixelRatio),_e(a,"displayedNodeLabels",new Set),_e(a,"displayedEdgeLabels",new Set),_e(a,"highlightedNodes",new Set),_e(a,"hoveredNode",null),_e(a,"hoveredEdge",null),_e(a,"renderFrame",null),_e(a,"renderHighlightedNodesFrame",null),_e(a,"needToProcess",!1),_e(a,"checkEdgesEventsFrame",null),_e(a,"nodePrograms",{}),_e(a,"nodeHoverPrograms",{}),_e(a,"edgePrograms",{}),a.settings=qX(i),Oh(a.settings),jX(n),!(r instanceof HTMLElement))throw new Error("Sigma: container should be an html element.");a.graph=n,a.container=r,a.createWebGLContext("edges",{picking:i.enableEdgeEvents}),a.createCanvasContext("edgeLabels"),a.createWebGLContext("nodes",{picking:!0}),a.createCanvasContext("labels"),a.createCanvasContext("hovers"),a.createWebGLContext("hoverNodes"),a.createCanvasContext("mouse",{style:{touchAction:"none",userSelect:"none"}}),a.resize();for(var l in a.settings.nodeProgramClasses)a.registerNodeProgram(l,a.settings.nodeProgramClasses[l],a.settings.nodeHoverProgramClasses[l]);for(var u in a.settings.edgeProgramClasses)a.registerEdgeProgram(u,a.settings.edgeProgramClasses[u]);return a.camera=new hC,a.bindCameraHandlers(),a.mouseCaptor=new XX(a.elements.mouse,a),a.mouseCaptor.setSettings(a.settings),a.touchCaptor=new JX(a.elements.mouse,a),a.touchCaptor.setSettings(a.settings),a.bindEventHandlers(),a.bindGraphHandlers(),a.handleSettingsUpdate(),a.refresh(),a}return Un(t,e),ln(t,[{key:"registerNodeProgram",value:function(r,a,i){return this.nodePrograms[r]&&this.nodePrograms[r].kill(),this.nodeHoverPrograms[r]&&this.nodeHoverPrograms[r].kill(),this.nodePrograms[r]=new a(this.webGLContexts.nodes,this.frameBuffers.nodes,this),this.nodeHoverPrograms[r]=new(i||a)(this.webGLContexts.hoverNodes,null,this),this}},{key:"registerEdgeProgram",value:function(r,a){return this.edgePrograms[r]&&this.edgePrograms[r].kill(),this.edgePrograms[r]=new a(this.webGLContexts.edges,this.frameBuffers.edges,this),this}},{key:"unregisterNodeProgram",value:function(r){if(this.nodePrograms[r]){var a=this.nodePrograms,i=a[r],l=Dh(a,[r].map(Ws));i.kill(),this.nodePrograms=l}if(this.nodeHoverPrograms[r]){var u=this.nodeHoverPrograms,c=u[r],f=Dh(u,[r].map(Ws));c.kill(),this.nodePrograms=f}return this}},{key:"unregisterEdgeProgram",value:function(r){if(this.edgePrograms[r]){var a=this.edgePrograms,i=a[r],l=Dh(a,[r].map(Ws));i.kill(),this.edgePrograms=l}return this}},{key:"resetWebGLTexture",value:function(r){var a=this.webGLContexts[r],i=this.frameBuffers[r],l=this.textures[r];l&&a.deleteTexture(l);var u=a.createTexture();return a.bindFramebuffer(a.FRAMEBUFFER,i),a.bindTexture(a.TEXTURE_2D,u),a.texImage2D(a.TEXTURE_2D,0,a.RGBA,this.width,this.height,0,a.RGBA,a.UNSIGNED_BYTE,null),a.framebufferTexture2D(a.FRAMEBUFFER,a.COLOR_ATTACHMENT0,a.TEXTURE_2D,u,0),this.textures[r]=u,this}},{key:"bindCameraHandlers",value:function(){var r=this;return this.activeListeners.camera=function(){r.scheduleRender()},this.camera.on("updated",this.activeListeners.camera),this}},{key:"unbindCameraHandlers",value:function(){return this.camera.removeListener("updated",this.activeListeners.camera),this}},{key:"getNodeAtPosition",value:function(r){var a=r.x,i=r.y,l=JR(this.webGLContexts.nodes,this.frameBuffers.nodes,a,i,this.pixelRatio,this.pickingDownSizingRatio),u=QR.apply(void 0,mC(l)),c=this.itemIDsIndex[u];return c&&c.type==="node"?c.id:null}},{key:"bindEventHandlers",value:function(){var r=this;this.activeListeners.handleResize=function(){r.scheduleRefresh()},window.addEventListener("resize",this.activeListeners.handleResize),this.activeListeners.handleMove=function(i){var l=Bs(i),u={event:l,preventSigmaDefault:function(){l.preventSigmaDefault()}},c=r.getNodeAtPosition(l);if(c&&r.hoveredNode!==c&&!r.nodeDataCache[c].hidden){r.hoveredNode&&r.emit("leaveNode",Be(Be({},u),{},{node:r.hoveredNode})),r.hoveredNode=c,r.emit("enterNode",Be(Be({},u),{},{node:c})),r.scheduleHighlightedNodesRender();return}if(r.hoveredNode&&r.getNodeAtPosition(l)!==r.hoveredNode){var f=r.hoveredNode;r.hoveredNode=null,r.emit("leaveNode",Be(Be({},u),{},{node:f})),r.scheduleHighlightedNodesRender();return}if(r.settings.enableEdgeEvents){var p=r.hoveredNode?null:r.getEdgeAtPoint(u.event.x,u.event.y);p!==r.hoveredEdge&&(r.hoveredEdge&&r.emit("leaveEdge",Be(Be({},u),{},{edge:r.hoveredEdge})),p&&r.emit("enterEdge",Be(Be({},u),{},{edge:p})),r.hoveredEdge=p)}},this.activeListeners.handleMoveBody=function(i){var l=Bs(i);r.emit("moveBody",{event:l,preventSigmaDefault:function(){l.preventSigmaDefault()}})},this.activeListeners.handleLeave=function(i){var l=Bs(i),u={event:l,preventSigmaDefault:function(){l.preventSigmaDefault()}};r.hoveredNode&&(r.emit("leaveNode",Be(Be({},u),{},{node:r.hoveredNode})),r.scheduleHighlightedNodesRender()),r.settings.enableEdgeEvents&&r.hoveredEdge&&(r.emit("leaveEdge",Be(Be({},u),{},{edge:r.hoveredEdge})),r.scheduleHighlightedNodesRender()),r.emit("leaveStage",Be({},u))},this.activeListeners.handleEnter=function(i){var l=Bs(i),u={event:l,preventSigmaDefault:function(){l.preventSigmaDefault()}};r.emit("enterStage",Be({},u))};var a=function(l){return function(u){var c=Bs(u),f={event:c,preventSigmaDefault:function(){c.preventSigmaDefault()}},p=r.getNodeAtPosition(c);if(p)return r.emit("".concat(l,"Node"),Be(Be({},f),{},{node:p}));if(r.settings.enableEdgeEvents){var g=r.getEdgeAtPoint(c.x,c.y);if(g)return r.emit("".concat(l,"Edge"),Be(Be({},f),{},{edge:g}))}return r.emit("".concat(l,"Stage"),f)}};return this.activeListeners.handleClick=a("click"),this.activeListeners.handleRightClick=a("rightClick"),this.activeListeners.handleDoubleClick=a("doubleClick"),this.activeListeners.handleWheel=a("wheel"),this.activeListeners.handleDown=a("down"),this.activeListeners.handleUp=a("up"),this.mouseCaptor.on("mousemove",this.activeListeners.handleMove),this.mouseCaptor.on("mousemovebody",this.activeListeners.handleMoveBody),this.mouseCaptor.on("click",this.activeListeners.handleClick),this.mouseCaptor.on("rightClick",this.activeListeners.handleRightClick),this.mouseCaptor.on("doubleClick",this.activeListeners.handleDoubleClick),this.mouseCaptor.on("wheel",this.activeListeners.handleWheel),this.mouseCaptor.on("mousedown",this.activeListeners.handleDown),this.mouseCaptor.on("mouseup",this.activeListeners.handleUp),this.mouseCaptor.on("mouseleave",this.activeListeners.handleLeave),this.mouseCaptor.on("mouseenter",this.activeListeners.handleEnter),this.touchCaptor.on("touchdown",this.activeListeners.handleDown),this.touchCaptor.on("touchdown",this.activeListeners.handleMove),this.touchCaptor.on("touchup",this.activeListeners.handleUp),this.touchCaptor.on("touchmove",this.activeListeners.handleMove),this.touchCaptor.on("tap",this.activeListeners.handleClick),this.touchCaptor.on("doubletap",this.activeListeners.handleDoubleClick),this.touchCaptor.on("touchmove",this.activeListeners.handleMoveBody),this}},{key:"bindGraphHandlers",value:function(){var r=this,a=this.graph,i=new Set(["x","y","zIndex","type"]);return this.activeListeners.eachNodeAttributesUpdatedGraphUpdate=function(l){var u,c=(u=l.hints)===null||u===void 0?void 0:u.attributes;r.graph.forEachNode(function(p){return r.updateNode(p)});var f=!c||c.some(function(p){return i.has(p)});r.refresh({partialGraph:{nodes:a.nodes()},skipIndexation:!f,schedule:!0})},this.activeListeners.eachEdgeAttributesUpdatedGraphUpdate=function(l){var u,c=(u=l.hints)===null||u===void 0?void 0:u.attributes;r.graph.forEachEdge(function(p){return r.updateEdge(p)});var f=c&&["zIndex","type"].some(function(p){return c==null?void 0:c.includes(p)});r.refresh({partialGraph:{edges:a.edges()},skipIndexation:!f,schedule:!0})},this.activeListeners.addNodeGraphUpdate=function(l){var u=l.key;r.addNode(u),r.refresh({partialGraph:{nodes:[u]},skipIndexation:!1,schedule:!0})},this.activeListeners.updateNodeGraphUpdate=function(l){var u=l.key;r.refresh({partialGraph:{nodes:[u]},skipIndexation:!1,schedule:!0})},this.activeListeners.dropNodeGraphUpdate=function(l){var u=l.key;r.removeNode(u),r.refresh({schedule:!0})},this.activeListeners.addEdgeGraphUpdate=function(l){var u=l.key;r.addEdge(u),r.refresh({partialGraph:{edges:[u]},schedule:!0})},this.activeListeners.updateEdgeGraphUpdate=function(l){var u=l.key;r.refresh({partialGraph:{edges:[u]},skipIndexation:!1,schedule:!0})},this.activeListeners.dropEdgeGraphUpdate=function(l){var u=l.key;r.removeEdge(u),r.refresh({schedule:!0})},this.activeListeners.clearEdgesGraphUpdate=function(){r.clearEdgeState(),r.clearEdgeIndices(),r.refresh({schedule:!0})},this.activeListeners.clearGraphUpdate=function(){r.clearEdgeState(),r.clearNodeState(),r.clearEdgeIndices(),r.clearNodeIndices(),r.refresh({schedule:!0})},a.on("nodeAdded",this.activeListeners.addNodeGraphUpdate),a.on("nodeDropped",this.activeListeners.dropNodeGraphUpdate),a.on("nodeAttributesUpdated",this.activeListeners.updateNodeGraphUpdate),a.on("eachNodeAttributesUpdated",this.activeListeners.eachNodeAttributesUpdatedGraphUpdate),a.on("edgeAdded",this.activeListeners.addEdgeGraphUpdate),a.on("edgeDropped",this.activeListeners.dropEdgeGraphUpdate),a.on("edgeAttributesUpdated",this.activeListeners.updateEdgeGraphUpdate),a.on("eachEdgeAttributesUpdated",this.activeListeners.eachEdgeAttributesUpdatedGraphUpdate),a.on("edgesCleared",this.activeListeners.clearEdgesGraphUpdate),a.on("cleared",this.activeListeners.clearGraphUpdate),this}},{key:"unbindGraphHandlers",value:function(){var r=this.graph;r.removeListener("nodeAdded",this.activeListeners.addNodeGraphUpdate),r.removeListener("nodeDropped",this.activeListeners.dropNodeGraphUpdate),r.removeListener("nodeAttributesUpdated",this.activeListeners.updateNodeGraphUpdate),r.removeListener("eachNodeAttributesUpdated",this.activeListeners.eachNodeAttributesUpdatedGraphUpdate),r.removeListener("edgeAdded",this.activeListeners.addEdgeGraphUpdate),r.removeListener("edgeDropped",this.activeListeners.dropEdgeGraphUpdate),r.removeListener("edgeAttributesUpdated",this.activeListeners.updateEdgeGraphUpdate),r.removeListener("eachEdgeAttributesUpdated",this.activeListeners.eachEdgeAttributesUpdatedGraphUpdate),r.removeListener("edgesCleared",this.activeListeners.clearEdgesGraphUpdate),r.removeListener("cleared",this.activeListeners.clearGraphUpdate)}},{key:"getEdgeAtPoint",value:function(r,a){var i=JR(this.webGLContexts.edges,this.frameBuffers.edges,r,a,this.pixelRatio,this.pickingDownSizingRatio),l=QR.apply(void 0,mC(i)),u=this.itemIDsIndex[l];return u&&u.type==="edge"?u.id:null}},{key:"process",value:function(){var r=this;this.emit("beforeProcess");var a=this.graph,i=this.settings,l=this.getDimensions();if(this.nodeExtent=UX(this.graph),!this.settings.autoRescale){var u=l.width,c=l.height,f=this.nodeExtent,p=f.x,g=f.y;this.nodeExtent={x:[(p[0]+p[1])/2-u/2,(p[0]+p[1])/2+u/2],y:[(g[0]+g[1])/2-c/2,(g[0]+g[1])/2+c/2]}}this.normalizationFunction=pC(this.customBBox||this.nodeExtent);var b=new hC,m=Ps(b.getState(),l,this.getGraphDimensions(),this.getStagePadding());this.labelGrid.resizeAndClear(l,i.labelGridCellSize);for(var S={},v={},A={},R={},x=1,_=a.nodes(),C=0,N=_.length;C1&&arguments[1]!==void 0?arguments[1]:{},i=a.tolerance,l=i===void 0?0:i,u=a.boundaries,c=Be({},r),f=u||this.nodeExtent,p=vl(f.x,2),g=p[0],b=p[1],m=vl(f.y,2),S=m[0],v=m[1],A=[this.graphToViewport({x:g,y:S},{cameraState:r}),this.graphToViewport({x:b,y:S},{cameraState:r}),this.graphToViewport({x:g,y:v},{cameraState:r}),this.graphToViewport({x:b,y:v},{cameraState:r})],R=1/0,x=-1/0,_=1/0,C=-1/0;A.forEach(function(W){var Z=W.x,j=W.y;R=Math.min(R,Z),x=Math.max(x,Z),_=Math.min(_,j),C=Math.max(C,j)});var N=x-R,T=C-_,O=this.getDimensions(),z=O.width,I=O.height,M=0,H=0;if(N>=z?xl&&(M=R-l):x>z+l?M=x-(z+l):R<-l&&(M=R+l),T>=I?Cl&&(H=_-l):C>I+l?H=C-(I+l):_<-l&&(H=_+l),M||H){var q=this.viewportToFramedGraph({x:0,y:0},{cameraState:r}),U=this.viewportToFramedGraph({x:M,y:H},{cameraState:r});M=U.x-q.x,H=U.y-q.y,c.x+=M,c.y+=H}return c}},{key:"renderLabels",value:function(){if(!this.settings.renderLabels)return this;var r=this.camera.getState(),a=this.labelGrid.getLabelsToDisplay(r.ratio,this.settings.labelDensity);gC(a,this.nodesWithForcedLabels),this.displayedNodeLabels=new Set;for(var i=this.canvasContexts.labels,l=0,u=a.length;lthis.width+oZ||b<-50||b>this.height+iZ)){this.displayedNodeLabels.add(c);var S=this.settings.defaultDrawNodeLabel,v=this.nodePrograms[f.type],A=(v==null?void 0:v.drawLabel)||S;A(i,Be(Be({key:c},f),{},{size:m,x:g,y:b}),this.settings)}}}return this}},{key:"renderEdgeLabels",value:function(){if(!this.settings.renderEdgeLabels)return this;var r=this.canvasContexts.edgeLabels;r.clearRect(0,0,this.width,this.height);var a=aZ({graph:this.graph,hoveredNode:this.hoveredNode,displayedNodeLabels:this.displayedNodeLabels,highlightedNodes:this.highlightedNodes});gC(a,this.edgesWithForcedLabels);for(var i=new Set,l=0,u=a.length;lthis.nodeZExtent[1]&&(this.nodeZExtent[1]=i.zIndex))}},{key:"updateNode",value:function(r){this.addNode(r);var a=this.nodeDataCache[r];this.normalizationFunction.applyTo(a)}},{key:"removeNode",value:function(r){delete this.nodeDataCache[r],delete this.nodeProgramIndex[r],this.highlightedNodes.delete(r),this.hoveredNode===r&&(this.hoveredNode=null),this.nodesWithForcedLabels.delete(r)}},{key:"addEdge",value:function(r){var a=Object.assign({},this.graph.getEdgeAttributes(r));this.settings.edgeReducer&&(a=this.settings.edgeReducer(r,a));var i=sZ(this.settings,r,a);this.edgeDataCache[r]=i,this.edgesWithForcedLabels.delete(r),i.forceLabel&&!i.hidden&&this.edgesWithForcedLabels.add(r),this.settings.zIndex&&(i.zIndex
e.length)&&(t=e.length);for(var n=0,r=Array(t);nO){var X="…";for(x=x+X,M=o.measureText(x).width;M>O&&x.length>1;)x=x.slice(0,-2)+X,M=o.measureText(x).width;if(x.length<4)return}for(var re={},ue=0,ae=x.length;ue{const n=this.nodeIdMap[t];if(n!==void 0)return this.nodes[n]});mi(this,"getEdge",(t,n=!0)=>{const r=n?this.edgeDynamicIdMap[t]:this.edgeIdMap[t];if(r!==void 0)return this.edges[r]});mi(this,"buildDynamicMap",()=>{this.edgeDynamicIdMap={};for(let t=0;t({selectedNode:null,focusedNode:null,selectedEdge:null,focusedEdge:null,moveToSelectedNode:!1,rawGraph:null,sigmaGraph:null,setSelectedNode:(t,n)=>e({selectedNode:t,moveToSelectedNode:n}),setFocusedNode:t=>e({focusedNode:t}),setSelectedEdge:t=>e({selectedEdge:t}),setFocusedEdge:t=>e({focusedEdge:t}),clearSelection:()=>e({selectedNode:null,focusedNode:null,selectedEdge:null,focusedEdge:null}),reset:()=>e({selectedNode:null,focusedNode:null,selectedEdge:null,focusedEdge:null,rawGraph:null,sigmaGraph:null,moveToSelectedNode:!1}),setRawGraph:t=>e({rawGraph:t}),setSigmaGraph:t=>e({sigmaGraph:t}),setMoveToSelectedNode:t=>e({moveToSelectedNode:t})})),yt=Rv(rU),iU=({node:e,move:t})=>{const n=pr(),{gotoNode:r}=xA();return E.useEffect(()=>{if(e)return n.getGraph().setNodeAttribute(e,"highlighted",!0),t&&(r(e),yt.getState().setMoveToSelectedNode(!1)),()=>{n.getGraph().setNodeAttribute(e,"highlighted",!1)}},[e,t,n,r]),null};function kl(e,t){const n=pr(),r=E.useRef(t);return hu(r.current,t)||(r.current=t),{positions:E.useCallback(()=>r.current?e(n.getGraph(),r.current):{},[n,r,e]),assign:E.useCallback(()=>{r.current&&e.assign(n.getGraph(),r.current)},[n,r,e])}}function Sy(e,t){const n=pr(),[r,i]=E.useState(!1),[o,s]=E.useState(null),u=E.useRef(t);return hu(u.current,t)||(u.current=t),E.useEffect(()=>{i(!1);let f=null;return u.current&&(f=new e(n.getGraph(),u.current)),s(f),()=>{f!==null&&f.kill()}},[n,u,s,i,e]),{stop:E.useCallback(()=>{o&&(o.stop(),i(!1))},[o,i]),start:E.useCallback(()=>{o&&(o.start(),i(!0))},[o,i]),kill:E.useCallback(()=>{o&&o.kill(),i(!1)},[o,i]),isRunning:r}}var vm,_S;function pu(){if(_S)return vm;_S=1;function e(n){return!n||typeof n!="object"||typeof n=="function"||Array.isArray(n)||n instanceof Set||n instanceof Map||n instanceof RegExp||n instanceof Date}function t(n,r){n=n||{};var i={};for(var o in r){var s=n[o],u=r[o];if(!e(u)){i[o]=t(s,u);continue}s===void 0?i[o]=u:i[o]=s}return i}return vm=t,vm}var ym,kS;function aU(){if(kS)return ym;kS=1;function e(n){return function(r,i){return r+Math.floor(n()*(i-r+1))}}var t=e(Math.random);return t.createRandom=e,ym=t,ym}var bm,CS;function oU(){if(CS)return bm;CS=1;var e=aU().createRandom;function t(r){var i=e(r);return function(o){for(var s=o.length,u=s-1,f=-1;++f0},i.prototype.addChild=function(R,B){this.children[R]=B,++this.countChildren},i.prototype.getChild=function(R){if(!this.children.hasOwnProperty(R)){var B=new i;this.children[R]=B,++this.countChildren}return this.children[R]},i.prototype.applyPositionToChildren=function(){if(this.hasChildren()){var R=this;for(var B in R.children){var P=R.children[B];P.x+=R.x,P.y+=R.y,P.applyPositionToChildren()}}};function o(R,B,P){for(var j in B.children){var V=B.children[j];V.hasChildren()?o(R,V,P):P[V.id]={x:V.x,y:V.y}}}function s(R,B){var P=R.r-B.r,j=B.x-R.x,V=B.y-R.y;return P<0||P*P0&&P*P>j*j+V*V}function f(R,B){for(var P=0;PZ?(V=(U+Z-q)/(2*U),Y=Math.sqrt(Math.max(0,Z/U-V*V)),P.x=R.x-V*j-Y*I,P.y=R.y-V*I+Y*j):(V=(U+q-Z)/(2*U),Y=Math.sqrt(Math.max(0,q/U-V*V)),P.x=B.x+V*j-Y*I,P.y=B.y+V*I+Y*j)):(P.x=B.x+P.r,P.y=B.y)}function C(R,B){var P=R.r+B.r-1e-6,j=B.x-R.x,V=B.y-R.y;return P>0&&P*P>j*j+V*V}function _(R,B){var P=R.length;if(P===0)return 0;var j,V,q,I,Y,Z,U,G,F,K;if(j=R[0],j.x=0,j.y=0,P<=1)return j.r;if(V=R[1],j.x=-V.r,V.x=j.r,V.y=0,P<=2)return j.r+V.r;q=R[2],k(V,j,q),j=new i(null,null,null,null,j),V=new i(null,null,null,null,V),q=new i(null,null,null,null,q),j.next=q.previous=V,V.next=j.previous=q,q.next=V.previous=j;e:for(Z=3;Z"u"?i:d};typeof i=="function"&&(s=i);var u=function(d){return s(d[r])},f=function(){return s(void 0)};return typeof r=="string"?(o.fromAttributes=u,o.fromGraph=function(d,p){return u(d.getNodeAttributes(p))},o.fromEntry=function(d,p){return u(p)}):typeof r=="function"?(o.fromAttributes=function(){throw new Error("graphology-utils/getters/createNodeValueGetter: irrelevant usage.")},o.fromGraph=function(d,p){return s(r(p,d.getNodeAttributes(p)))},o.fromEntry=function(d,p){return s(r(d,p))}):(o.fromAttributes=f,o.fromGraph=f,o.fromEntry=f),o}function n(r,i){var o={},s=function(d){return typeof d>"u"?i:d};typeof i=="function"&&(s=i);var u=function(d){return s(d[r])},f=function(){return s(void 0)};return typeof r=="string"?(o.fromAttributes=u,o.fromGraph=function(d,p){return u(d.getEdgeAttributes(p))},o.fromEntry=function(d,p){return u(p)},o.fromPartialEntry=o.fromEntry,o.fromMinimalEntry=o.fromEntry):typeof r=="function"?(o.fromAttributes=function(){throw new Error("graphology-utils/getters/createEdgeValueGetter: irrelevant usage.")},o.fromGraph=function(d,p){var m=d.extremities(p);return s(r(p,d.getEdgeAttributes(p),m[0],m[1],d.getNodeAttributes(m[0]),d.getNodeAttributes(m[1]),d.isUndirected(p)))},o.fromEntry=function(d,p,m,v,g,w,x){return s(r(d,p,m,v,g,w,x))},o.fromPartialEntry=function(d,p,m,v){return s(r(d,p,m,v))},o.fromMinimalEntry=function(d,p){return s(r(d,p))}):(o.fromAttributes=f,o.fromGraph=f,o.fromEntry=f,o.fromMinimalEntry=f),o}return Ls.createNodeValueGetter=t,Ls.createEdgeValueGetter=n,Ls.createEdgeWeightGetter=function(r){return n(r,e)},Ls}var Sm,DS;function jA(){if(DS)return Sm;DS=1;const{createNodeValueGetter:e,createEdgeValueGetter:t}=Ey();return Sm=function(r,i,o){const{nodeXAttribute:s,nodeYAttribute:u}=o,{attraction:f,repulsion:d,gravity:p,inertia:m,maxMove:v}=o.settings;let{shouldSkipNode:g,shouldSkipEdge:w,isNodeFixed:x}=o;x=e(x),g=e(g,!1),w=t(w,!1);const k=r.filterNodes((T,N)=>!g.fromEntry(T,N)),C=k.length;for(let T=0;T{if(D===z||g.fromEntry(D,R)||g.fromEntry(z,B)||w.fromEntry(T,N,D,z,R,B,P))return;const j=i[D],V=i[z],q=V.x-j.x,I=V.y-j.y,Y=Math.sqrt(q*q+I*I)||1,Z=f*Y*q,U=f*Y*I;j.dx+=Z,j.dy+=U,V.dx-=Z,V.dy-=U}),p)for(let T=0;Tv&&(D.dx*=v/z,D.dy*=v/z),x.fromGraph(r,N)?D.fixed=!0:(D.x+=D.dx,D.y+=D.dy,D.fixed=!1)}return{converged:_}},Sm}var $c={},NS;function MA(){return NS||(NS=1,$c.assignLayoutChanges=function(e,t,n){const{nodeXAttribute:r,nodeYAttribute:i}=n;e.updateEachNodeAttributes((o,s)=>{const u=t[o];return!u||u.fixed||(s[r]=u.x,s[i]=u.y),s},{attributes:["x","y"]})},$c.collectLayoutChanges=function(e){const t={};for(const n in e){const r=e[n];t[n]={x:r.x,y:r.y}}return t}),$c}var Em,OS;function PA(){return OS||(OS=1,Em={nodeXAttribute:"x",nodeYAttribute:"y",isNodeFixed:"fixed",shouldSkipNode:null,shouldSkipEdge:null,settings:{attraction:5e-4,repulsion:.1,gravity:1e-4,inertia:.6,maxMove:200}}),Em}var _m,LS;function mU(){if(LS)return _m;LS=1;const e=Wr(),t=pu(),n=jA(),r=MA(),i=PA();function o(u,f,d){if(!e(f))throw new Error("graphology-layout-force: the given graph is not a valid graphology instance.");typeof d=="number"?d={maxIterations:d}:d=d||{};const p=d.maxIterations;if(d=t(d,i),typeof p!="number"||p<=0)throw new Error("graphology-layout-force: you should provide a positive number of maximum iterations.");const m={};let v=null,g;for(g=0;gthis.runFrame())},o.prototype.stop=function(){return this.running=!1,this.frameID!==null&&(window.cancelAnimationFrame(this.frameID),this.frameID=null),this},o.prototype.start=function(){if(this.killed)throw new Error("graphology-layout-force/worker.start: layout was killed.");this.running||(this.running=!0,this.runFrame())},o.prototype.kill=function(){this.stop(),delete this.nodeStates,this.killed=!0},km=o,km}var bU=yU();const xU=fn(bU);function wU(e={maxIterations:100}){return kl(vU,e)}function SU(e={}){return Sy(xU,e)}var Cm,jS;function EU(){if(jS)return Cm;jS=1;var e=0,t=1,n=2,r=3,i=4,o=5,s=6,u=7,f=8,d=9,p=0,m=1,v=2,g=0,w=1,x=2,k=3,C=4,_=5,T=6,N=7,D=8,z=3,R=10,B=3,P=9,j=10;return Cm=function(q,I,Y){var Z,U,G,F,K,A,$,M,O,X,re=I.length,ue=Y.length,ae=q.adjustSizes,oe=q.barnesHutTheta*q.barnesHutTheta,Ce,he,Ee,we,Pe,Ae,xe,ee=[];for(G=0;GNe?(ge-=(ve-Ne)/2,Se=ge+ve):(ce-=(Ne-ve)/2,Te=ce+Ne),ee[0+g]=-1,ee[0+w]=(ce+Te)/2,ee[0+x]=(ge+Se)/2,ee[0+k]=Math.max(Te-ce,Se-ge),ee[0+C]=-1,ee[0+_]=-1,ee[0+T]=0,ee[0+N]=0,ee[0+D]=0,Z=1,G=0;G=0){I[G+e]=0)if(Ae=Math.pow(I[G+e]-ee[U+N],2)+Math.pow(I[G+t]-ee[U+D],2),X=ee[U+k],4*X*X/Ae0?(xe=he*I[G+s]*ee[U+T]/Ae,I[G+n]+=Ee*xe,I[G+r]+=we*xe):Ae<0&&(xe=-he*I[G+s]*ee[U+T]/Math.sqrt(Ae),I[G+n]+=Ee*xe,I[G+r]+=we*xe):Ae>0&&(xe=he*I[G+s]*ee[U+T]/Ae,I[G+n]+=Ee*xe,I[G+r]+=we*xe),U=ee[U+C],U<0)break;continue}else{U=ee[U+_];continue}else{if(A=ee[U+g],A>=0&&A!==G&&(Ee=I[G+e]-I[A+e],we=I[G+t]-I[A+t],Ae=Ee*Ee+we*we,ae===!0?Ae>0?(xe=he*I[G+s]*I[A+s]/Ae,I[G+n]+=Ee*xe,I[G+r]+=we*xe):Ae<0&&(xe=-he*I[G+s]*I[A+s]/Math.sqrt(Ae),I[G+n]+=Ee*xe,I[G+r]+=we*xe):Ae>0&&(xe=he*I[G+s]*I[A+s]/Ae,I[G+n]+=Ee*xe,I[G+r]+=we*xe)),U=ee[U+C],U<0)break;continue}else for(he=q.scalingRatio,F=0;F0?(xe=he*I[F+s]*I[K+s]/Ae/Ae,I[F+n]+=Ee*xe,I[F+r]+=we*xe,I[K+n]-=Ee*xe,I[K+r]-=we*xe):Ae<0&&(xe=100*he*I[F+s]*I[K+s],I[F+n]+=Ee*xe,I[F+r]+=we*xe,I[K+n]-=Ee*xe,I[K+r]-=we*xe)):(Ae=Math.sqrt(Ee*Ee+we*we),Ae>0&&(xe=he*I[F+s]*I[K+s]/Ae/Ae,I[F+n]+=Ee*xe,I[F+r]+=we*xe,I[K+n]-=Ee*xe,I[K+r]-=we*xe));for(O=q.gravity/q.scalingRatio,he=q.scalingRatio,G=0;G0&&(xe=he*I[G+s]*O):Ae>0&&(xe=he*I[G+s]*O/Ae),I[G+n]-=Ee*xe,I[G+r]-=we*xe;for(he=1*(q.outboundAttractionDistribution?Ce:1),$=0;$0&&(xe=-he*Pe*Math.log(1+Ae)/Ae/I[F+s]):Ae>0&&(xe=-he*Pe*Math.log(1+Ae)/Ae):q.outboundAttractionDistribution?Ae>0&&(xe=-he*Pe/I[F+s]):Ae>0&&(xe=-he*Pe)):(Ae=Math.sqrt(Math.pow(Ee,2)+Math.pow(we,2)),q.linLogMode?q.outboundAttractionDistribution?Ae>0&&(xe=-he*Pe*Math.log(1+Ae)/Ae/I[F+s]):Ae>0&&(xe=-he*Pe*Math.log(1+Ae)/Ae):q.outboundAttractionDistribution?(Ae=1,xe=-he*Pe/I[F+s]):(Ae=1,xe=-he*Pe)),Ae>0&&(I[F+n]+=Ee*xe,I[F+r]+=we*xe,I[K+n]-=Ee*xe,I[K+r]-=we*xe);var te,de,Oe,$e,Ye,vt;if(ae===!0)for(G=0;Gj&&(I[G+n]=I[G+n]*j/te,I[G+r]=I[G+r]*j/te),de=I[G+s]*Math.sqrt((I[G+i]-I[G+n])*(I[G+i]-I[G+n])+(I[G+o]-I[G+r])*(I[G+o]-I[G+r])),Oe=Math.sqrt((I[G+i]+I[G+n])*(I[G+i]+I[G+n])+(I[G+o]+I[G+r])*(I[G+o]+I[G+r]))/2,$e=.1*Math.log(1+Oe)/(1+Math.sqrt(de)),Ye=I[G+e]+I[G+n]*($e/q.slowDown),I[G+e]=Ye,vt=I[G+t]+I[G+r]*($e/q.slowDown),I[G+t]=vt);else for(G=0;G=0)?{message:"the `scalingRatio` setting should be a number >= 0."}:"strongGravityMode"in n&&typeof n.strongGravityMode!="boolean"?{message:"the `strongGravityMode` setting should be a boolean."}:"gravity"in n&&!(typeof n.gravity=="number"&&n.gravity>=0)?{message:"the `gravity` setting should be a number >= 0."}:"slowDown"in n&&!(typeof n.slowDown=="number"||n.slowDown>=0)?{message:"the `slowDown` setting should be a number >= 0."}:"barnesHutOptimize"in n&&typeof n.barnesHutOptimize!="boolean"?{message:"the `barnesHutOptimize` setting should be a boolean."}:"barnesHutTheta"in n&&!(typeof n.barnesHutTheta=="number"&&n.barnesHutTheta>=0)?{message:"the `barnesHutTheta` setting should be a number >= 0."}:null},vi.graphToByteArrays=function(n,r){var i=n.order,o=n.size,s={},u,f=new Float32Array(i*e),d=new Float32Array(o*t);return u=0,n.forEachNode(function(p,m){s[p]=u,f[u]=m.x,f[u+1]=m.y,f[u+2]=0,f[u+3]=0,f[u+4]=0,f[u+5]=0,f[u+6]=1,f[u+7]=1,f[u+8]=m.size||1,f[u+9]=m.fixed?1:0,u+=e}),u=0,n.forEachEdge(function(p,m,v,g,w,x,k){var C=s[v],_=s[g],T=r(p,m,v,g,w,x,k);f[C+6]+=T,f[_+6]+=T,d[u]=C,d[u+1]=_,d[u+2]=T,u+=t}),{nodes:f,edges:d}},vi.assignLayoutChanges=function(n,r,i){var o=0;n.updateEachNodeAttributes(function(s,u){return u.x=r[o],u.y=r[o+1],o+=e,i?i(s,u):u})},vi.readGraphPositions=function(n,r){var i=0;n.forEachNode(function(o,s){r[i]=s.x,r[i+1]=s.y,i+=e})},vi.collectLayoutChanges=function(n,r,i){for(var o=n.nodes(),s={},u=0,f=0,d=r.length;u2e3,strongGravityMode:!0,gravity:.05,scalingRatio:10,slowDown:1+Math.log(d)}}var u=o.bind(null,!1);return u.assign=o.bind(null,!0),u.inferSettings=s,Am=u,Am}var kU=_U();const CU=fn(kU);var Rm,IS;function TU(){return IS||(IS=1,Rm=function(){var t,n,r={};(function(){var o=0,s=1,u=2,f=3,d=4,p=5,m=6,v=7,g=8,w=9,x=0,k=1,C=2,_=0,T=1,N=2,D=3,z=4,R=5,B=6,P=7,j=8,V=3,q=10,I=3,Y=9,Z=10;r.exports=function(G,F,K){var A,$,M,O,X,re,ue,ae,oe,Ce,he=F.length,Ee=K.length,we=G.adjustSizes,Pe=G.barnesHutTheta*G.barnesHutTheta,Ae,xe,ee,ce,Te,ge,Se,ie=[];for(M=0;MYe?(ve-=($e-Ye)/2,Ne=ve+$e):(He-=(Ye-$e)/2,Ge=He+Ye),ie[0+_]=-1,ie[0+T]=(He+Ge)/2,ie[0+N]=(ve+Ne)/2,ie[0+D]=Math.max(Ge-He,Ne-ve),ie[0+z]=-1,ie[0+R]=-1,ie[0+B]=0,ie[0+P]=0,ie[0+j]=0,A=1,M=0;M=0){F[M+o]=0)if(ge=Math.pow(F[M+o]-ie[$+P],2)+Math.pow(F[M+s]-ie[$+j],2),Ce=ie[$+D],4*Ce*Ce/ge0?(Se=xe*F[M+m]*ie[$+B]/ge,F[M+u]+=ee*Se,F[M+f]+=ce*Se):ge<0&&(Se=-xe*F[M+m]*ie[$+B]/Math.sqrt(ge),F[M+u]+=ee*Se,F[M+f]+=ce*Se):ge>0&&(Se=xe*F[M+m]*ie[$+B]/ge,F[M+u]+=ee*Se,F[M+f]+=ce*Se),$=ie[$+z],$<0)break;continue}else{$=ie[$+R];continue}else{if(re=ie[$+_],re>=0&&re!==M&&(ee=F[M+o]-F[re+o],ce=F[M+s]-F[re+s],ge=ee*ee+ce*ce,we===!0?ge>0?(Se=xe*F[M+m]*F[re+m]/ge,F[M+u]+=ee*Se,F[M+f]+=ce*Se):ge<0&&(Se=-xe*F[M+m]*F[re+m]/Math.sqrt(ge),F[M+u]+=ee*Se,F[M+f]+=ce*Se):ge>0&&(Se=xe*F[M+m]*F[re+m]/ge,F[M+u]+=ee*Se,F[M+f]+=ce*Se)),$=ie[$+z],$<0)break;continue}else for(xe=G.scalingRatio,O=0;O0?(Se=xe*F[O+m]*F[X+m]/ge/ge,F[O+u]+=ee*Se,F[O+f]+=ce*Se,F[X+u]-=ee*Se,F[X+f]-=ce*Se):ge<0&&(Se=100*xe*F[O+m]*F[X+m],F[O+u]+=ee*Se,F[O+f]+=ce*Se,F[X+u]-=ee*Se,F[X+f]-=ce*Se)):(ge=Math.sqrt(ee*ee+ce*ce),ge>0&&(Se=xe*F[O+m]*F[X+m]/ge/ge,F[O+u]+=ee*Se,F[O+f]+=ce*Se,F[X+u]-=ee*Se,F[X+f]-=ce*Se));for(oe=G.gravity/G.scalingRatio,xe=G.scalingRatio,M=0;M0&&(Se=xe*F[M+m]*oe):ge>0&&(Se=xe*F[M+m]*oe/ge),F[M+u]-=ee*Se,F[M+f]-=ce*Se;for(xe=1*(G.outboundAttractionDistribution?Ae:1),ue=0;ue0&&(Se=-xe*Te*Math.log(1+ge)/ge/F[O+m]):ge>0&&(Se=-xe*Te*Math.log(1+ge)/ge):G.outboundAttractionDistribution?ge>0&&(Se=-xe*Te/F[O+m]):ge>0&&(Se=-xe*Te)):(ge=Math.sqrt(Math.pow(ee,2)+Math.pow(ce,2)),G.linLogMode?G.outboundAttractionDistribution?ge>0&&(Se=-xe*Te*Math.log(1+ge)/ge/F[O+m]):ge>0&&(Se=-xe*Te*Math.log(1+ge)/ge):G.outboundAttractionDistribution?(ge=1,Se=-xe*Te/F[O+m]):(ge=1,Se=-xe*Te)),ge>0&&(F[O+u]+=ee*Se,F[O+f]+=ce*Se,F[X+u]-=ee*Se,F[X+f]-=ce*Se);var vt,Mt,bt,rt,qt,at;if(we===!0)for(M=0;MZ&&(F[M+u]=F[M+u]*Z/vt,F[M+f]=F[M+f]*Z/vt),Mt=F[M+m]*Math.sqrt((F[M+d]-F[M+u])*(F[M+d]-F[M+u])+(F[M+p]-F[M+f])*(F[M+p]-F[M+f])),bt=Math.sqrt((F[M+d]+F[M+u])*(F[M+d]+F[M+u])+(F[M+p]+F[M+f])*(F[M+p]+F[M+f]))/2,rt=.1*Math.log(1+bt)/(1+Math.sqrt(Mt)),qt=F[M+o]+F[M+u]*(rt/G.slowDown),F[M+o]=qt,at=F[M+s]+F[M+f]*(rt/G.slowDown),F[M+s]=at);else for(M=0;M1&&Ee.has(Se))&&(F>1&&Ee.add(Se),xe=f[Pe+e],ce=f[Pe+t],ge=f[Pe+n],ie=xe-Ae,He=ce-ee,Ge=Math.sqrt(ie*ie+He*He),ve=Ge0?(R[Pe]+=ie/Ge*(1+Te),B[Pe]+=He/Ge*(1+Te)):(R[Pe]+=I*o(),B[Pe]+=Y*o())));for(w=0,x=0;w1&&xe.has(ve))&&(M>1&&xe.add(ve),ge=v[ce+i],ie=v[ce+o],Ge=v[ce+s],Ne=ge-Te,te=ie-Se,de=Math.sqrt(Ne*Ne+te*te),Oe=de0?(V[ce]+=Ne/de*(1+He),q[ce]+=te/de*(1+He)):(V[ce]+=G*d(),q[ce]+=F*d())));for(_=0,T=0;_=0;)m=Xg(e,t,n,r,d+1,o+1,s),m>p&&(d===i?m*=WS:ZU.test(e.charAt(d-1))?(m*=YU,g=e.slice(i,d-1).match(QU),g&&i>0&&(m*=Math.pow(Fm,g.length))):JU.test(e.charAt(d-1))?(m*=qU,w=e.slice(i,d-1).match(HA),w&&i>0&&(m*=Math.pow(Fm,w.length))):(m*=WU,i>0&&(m*=Math.pow(Fm,d-i))),e.charAt(d)!==t.charAt(o)&&(m*=XU)),(mm&&(m=v*Pm)),m>p&&(p=m),d=n.indexOf(f,d+1);return s[u]=p,p}function XS(e){return e.toLowerCase().replace(HA," ")}function e6(e,t,n){return e=n&&n.length>0?`${e+" "+n.join(" ")}`:e,Xg(e,t,XS(e),XS(t),0,0,{})}var Im={exports:{}},Gm={};/** - * @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 KS;function t6(){if(KS)return Gm;KS=1;var e=$f();function t(m,v){return m===v&&(m!==0||1/m===1/v)||m!==m&&v!==v}var n=typeof Object.is=="function"?Object.is:t,r=e.useState,i=e.useEffect,o=e.useLayoutEffect,s=e.useDebugValue;function u(m,v){var g=v(),w=r({inst:{value:g,getSnapshot:v}}),x=w[0].inst,k=w[1];return o(function(){x.value=g,x.getSnapshot=v,f(x)&&k({inst:x})},[m,g,v]),i(function(){return f(x)&&k({inst:x}),m(function(){f(x)&&k({inst:x})})},[m]),s(g),g}function f(m){var v=m.getSnapshot;m=m.value;try{var g=v();return!n(m,g)}catch{return!0}}function d(m,v){return v()}var p=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?d:u;return Gm.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:p,Gm}var ZS;function n6(){return ZS||(ZS=1,Im.exports=t6()),Im.exports}var r6=n6(),zs='[cmdk-group=""]',Bm='[cmdk-group-items=""]',i6='[cmdk-group-heading=""]',_y='[cmdk-item=""]',QS=`${_y}:not([aria-disabled="true"])`,Kg="cmdk-item-select",Ha="data-value",a6=(e,t,n)=>e6(e,t,n),$A=E.createContext(void 0),mu=()=>E.useContext($A),VA=E.createContext(void 0),ky=()=>E.useContext(VA),qA=E.createContext(void 0),YA=E.forwardRef((e,t)=>{let n=Qo(()=>{var M,O;return{search:"",value:(O=(M=e.value)!=null?M:e.defaultValue)!=null?O:"",filtered:{count:0,items:new Map,groups:new Set}}}),r=Qo(()=>new Set),i=Qo(()=>new Map),o=Qo(()=>new Map),s=Qo(()=>new Set),u=WA(e),{label:f,children:d,value:p,onValueChange:m,filter:v,shouldFilter:g,loop:w,disablePointerSelection:x=!1,vimBindings:k=!0,...C}=e,_=bn(),T=bn(),N=bn(),D=E.useRef(null),z=g6();Qa(()=>{if(p!==void 0){let M=p.trim();n.current.value=M,R.emit()}},[p]),Qa(()=>{z(6,I)},[]);let R=E.useMemo(()=>({subscribe:M=>(s.current.add(M),()=>s.current.delete(M)),snapshot:()=>n.current,setState:(M,O,X)=>{var re,ue,ae;if(!Object.is(n.current[M],O)){if(n.current[M]=O,M==="search")q(),j(),z(1,V);else if(M==="value"&&(X||z(5,I),((re=u.current)==null?void 0:re.value)!==void 0)){let oe=O??"";(ae=(ue=u.current).onValueChange)==null||ae.call(ue,oe);return}R.emit()}},emit:()=>{s.current.forEach(M=>M())}}),[]),B=E.useMemo(()=>({value:(M,O,X)=>{var re;O!==((re=o.current.get(M))==null?void 0:re.value)&&(o.current.set(M,{value:O,keywords:X}),n.current.filtered.items.set(M,P(O,X)),z(2,()=>{j(),R.emit()}))},item:(M,O)=>(r.current.add(M),O&&(i.current.has(O)?i.current.get(O).add(M):i.current.set(O,new Set([M]))),z(3,()=>{q(),j(),n.current.value||V(),R.emit()}),()=>{o.current.delete(M),r.current.delete(M),n.current.filtered.items.delete(M);let X=Y();z(4,()=>{q(),(X==null?void 0:X.getAttribute("id"))===M&&V(),R.emit()})}),group:M=>(i.current.has(M)||i.current.set(M,new Set),()=>{o.current.delete(M),i.current.delete(M)}),filter:()=>u.current.shouldFilter,label:f||e["aria-label"],getDisablePointerSelection:()=>u.current.disablePointerSelection,listId:_,inputId:N,labelId:T,listInnerRef:D}),[]);function P(M,O){var X,re;let ue=(re=(X=u.current)==null?void 0:X.filter)!=null?re:a6;return M?ue(M,n.current.search,O):0}function j(){if(!n.current.search||u.current.shouldFilter===!1)return;let M=n.current.filtered.items,O=[];n.current.filtered.groups.forEach(re=>{let ue=i.current.get(re),ae=0;ue.forEach(oe=>{let Ce=M.get(oe);ae=Math.max(Ce,ae)}),O.push([re,ae])});let X=D.current;Z().sort((re,ue)=>{var ae,oe;let Ce=re.getAttribute("id"),he=ue.getAttribute("id");return((ae=M.get(he))!=null?ae:0)-((oe=M.get(Ce))!=null?oe:0)}).forEach(re=>{let ue=re.closest(Bm);ue?ue.appendChild(re.parentElement===ue?re:re.closest(`${Bm} > *`)):X.appendChild(re.parentElement===X?re:re.closest(`${Bm} > *`))}),O.sort((re,ue)=>ue[1]-re[1]).forEach(re=>{var ue;let ae=(ue=D.current)==null?void 0:ue.querySelector(`${zs}[${Ha}="${encodeURIComponent(re[0])}"]`);ae==null||ae.parentElement.appendChild(ae)})}function V(){let M=Z().find(X=>X.getAttribute("aria-disabled")!=="true"),O=M==null?void 0:M.getAttribute(Ha);R.setState("value",O||void 0)}function q(){var M,O,X,re;if(!n.current.search||u.current.shouldFilter===!1){n.current.filtered.count=r.current.size;return}n.current.filtered.groups=new Set;let ue=0;for(let ae of r.current){let oe=(O=(M=o.current.get(ae))==null?void 0:M.value)!=null?O:"",Ce=(re=(X=o.current.get(ae))==null?void 0:X.keywords)!=null?re:[],he=P(oe,Ce);n.current.filtered.items.set(ae,he),he>0&&ue++}for(let[ae,oe]of i.current)for(let Ce of oe)if(n.current.filtered.items.get(Ce)>0){n.current.filtered.groups.add(ae);break}n.current.filtered.count=ue}function I(){var M,O,X;let re=Y();re&&(((M=re.parentElement)==null?void 0:M.firstChild)===re&&((X=(O=re.closest(zs))==null?void 0:O.querySelector(i6))==null||X.scrollIntoView({block:"nearest"})),re.scrollIntoView({block:"nearest"}))}function Y(){var M;return(M=D.current)==null?void 0:M.querySelector(`${_y}[aria-selected="true"]`)}function Z(){var M;return Array.from(((M=D.current)==null?void 0:M.querySelectorAll(QS))||[])}function U(M){let O=Z()[M];O&&R.setState("value",O.getAttribute(Ha))}function G(M){var O;let X=Y(),re=Z(),ue=re.findIndex(oe=>oe===X),ae=re[ue+M];(O=u.current)!=null&&O.loop&&(ae=ue+M<0?re[re.length-1]:ue+M===re.length?re[0]:re[ue+M]),ae&&R.setState("value",ae.getAttribute(Ha))}function F(M){let O=Y(),X=O==null?void 0:O.closest(zs),re;for(;X&&!re;)X=M>0?p6(X,zs):m6(X,zs),re=X==null?void 0:X.querySelector(QS);re?R.setState("value",re.getAttribute(Ha)):G(M)}let K=()=>U(Z().length-1),A=M=>{M.preventDefault(),M.metaKey?K():M.altKey?F(1):G(1)},$=M=>{M.preventDefault(),M.metaKey?U(0):M.altKey?F(-1):G(-1)};return E.createElement(We.div,{ref:t,tabIndex:-1,...C,"cmdk-root":"",onKeyDown:M=>{var O;if((O=C.onKeyDown)==null||O.call(C,M),!M.defaultPrevented)switch(M.key){case"n":case"j":{k&&M.ctrlKey&&A(M);break}case"ArrowDown":{A(M);break}case"p":case"k":{k&&M.ctrlKey&&$(M);break}case"ArrowUp":{$(M);break}case"Home":{M.preventDefault(),U(0);break}case"End":{M.preventDefault(),K();break}case"Enter":if(!M.nativeEvent.isComposing&&M.keyCode!==229){M.preventDefault();let X=Y();if(X){let re=new Event(Kg);X.dispatchEvent(re)}}}}},E.createElement("label",{"cmdk-label":"",htmlFor:B.inputId,id:B.labelId,style:y6},f),vd(e,M=>E.createElement(VA.Provider,{value:R},E.createElement($A.Provider,{value:B},M))))}),o6=E.forwardRef((e,t)=>{var n,r;let i=bn(),o=E.useRef(null),s=E.useContext(qA),u=mu(),f=WA(e),d=(r=(n=f.current)==null?void 0:n.forceMount)!=null?r:s==null?void 0:s.forceMount;Qa(()=>{if(!d)return u.item(i,s==null?void 0:s.id)},[d]);let p=XA(i,o,[e.value,e.children,o],e.keywords),m=ky(),v=Ja(z=>z.value&&z.value===p.current),g=Ja(z=>d||u.filter()===!1?!0:z.search?z.filtered.items.get(i)>0:!0);E.useEffect(()=>{let z=o.current;if(!(!z||e.disabled))return z.addEventListener(Kg,w),()=>z.removeEventListener(Kg,w)},[g,e.onSelect,e.disabled]);function w(){var z,R;x(),(R=(z=f.current).onSelect)==null||R.call(z,p.current)}function x(){m.setState("value",p.current,!0)}if(!g)return null;let{disabled:k,value:C,onSelect:_,forceMount:T,keywords:N,...D}=e;return E.createElement(We.div,{ref:Xs([o,t]),...D,id:i,"cmdk-item":"",role:"option","aria-disabled":!!k,"aria-selected":!!v,"data-disabled":!!k,"data-selected":!!v,onPointerMove:k||u.getDisablePointerSelection()?void 0:x,onClick:k?void 0:w},e.children)}),l6=E.forwardRef((e,t)=>{let{heading:n,children:r,forceMount:i,...o}=e,s=bn(),u=E.useRef(null),f=E.useRef(null),d=bn(),p=mu(),m=Ja(g=>i||p.filter()===!1?!0:g.search?g.filtered.groups.has(s):!0);Qa(()=>p.group(s),[]),XA(s,u,[e.value,e.heading,f]);let v=E.useMemo(()=>({id:s,forceMount:i}),[i]);return E.createElement(We.div,{ref:Xs([u,t]),...o,"cmdk-group":"",role:"presentation",hidden:m?void 0:!0},n&&E.createElement("div",{ref:f,"cmdk-group-heading":"","aria-hidden":!0,id:d},n),vd(e,g=>E.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?d:void 0},E.createElement(qA.Provider,{value:v},g))))}),s6=E.forwardRef((e,t)=>{let{alwaysRender:n,...r}=e,i=E.useRef(null),o=Ja(s=>!s.search);return!n&&!o?null:E.createElement(We.div,{ref:Xs([i,t]),...r,"cmdk-separator":"",role:"separator"})}),u6=E.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,i=e.value!=null,o=ky(),s=Ja(p=>p.search),u=Ja(p=>p.value),f=mu(),d=E.useMemo(()=>{var p;let m=(p=f.listInnerRef.current)==null?void 0:p.querySelector(`${_y}[${Ha}="${encodeURIComponent(u)}"]`);return m==null?void 0:m.getAttribute("id")},[]);return E.useEffect(()=>{e.value!=null&&o.setState("search",e.value)},[e.value]),E.createElement(We.input,{ref:t,...r,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":f.listId,"aria-labelledby":f.labelId,"aria-activedescendant":d,id:f.inputId,type:"text",value:i?e.value:s,onChange:p=>{i||o.setState("search",p.target.value),n==null||n(p.target.value)}})}),c6=E.forwardRef((e,t)=>{let{children:n,label:r="Suggestions",...i}=e,o=E.useRef(null),s=E.useRef(null),u=mu();return E.useEffect(()=>{if(s.current&&o.current){let f=s.current,d=o.current,p,m=new ResizeObserver(()=>{p=requestAnimationFrame(()=>{let v=f.offsetHeight;d.style.setProperty("--cmdk-list-height",v.toFixed(1)+"px")})});return m.observe(f),()=>{cancelAnimationFrame(p),m.unobserve(f)}}},[]),E.createElement(We.div,{ref:Xs([o,t]),...i,"cmdk-list":"",role:"listbox","aria-label":r,id:u.listId},vd(e,f=>E.createElement("div",{ref:Xs([s,u.listInnerRef]),"cmdk-list-sizer":""},f)))}),f6=E.forwardRef((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:i,contentClassName:o,container:s,...u}=e;return E.createElement(Uv,{open:n,onOpenChange:r},E.createElement(Hv,{container:s},E.createElement(td,{"cmdk-overlay":"",className:i}),E.createElement(nd,{"aria-label":e.label,"cmdk-dialog":"",className:o},E.createElement(YA,{ref:t,...u}))))}),d6=E.forwardRef((e,t)=>Ja(n=>n.filtered.count===0)?E.createElement(We.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),h6=E.forwardRef((e,t)=>{let{progress:n,children:r,label:i="Loading...",...o}=e;return E.createElement(We.div,{ref:t,...o,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":i},vd(e,s=>E.createElement("div",{"aria-hidden":!0},s)))}),In=Object.assign(YA,{List:c6,Item:o6,Input:u6,Group:l6,Separator:s6,Dialog:f6,Empty:d6,Loading:h6});function p6(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function m6(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function WA(e){let t=E.useRef(e);return Qa(()=>{t.current=e}),t}var Qa=typeof window>"u"?E.useEffect:E.useLayoutEffect;function Qo(e){let t=E.useRef();return t.current===void 0&&(t.current=e()),t}function Xs(e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}function Ja(e){let t=ky(),n=()=>e(t.snapshot());return r6.useSyncExternalStore(t.subscribe,n,n)}function XA(e,t,n,r=[]){let i=E.useRef(),o=mu();return Qa(()=>{var s;let u=(()=>{var d;for(let p of n){if(typeof p=="string")return p.trim();if(typeof p=="object"&&"current"in p)return p.current?(d=p.current.textContent)==null?void 0:d.trim():i.current}})(),f=r.map(d=>d.trim());o.value(e,u,f),(s=t.current)==null||s.setAttribute(Ha,u),i.current=u}),i}var g6=()=>{let[e,t]=E.useState(),n=Qo(()=>new Map);return Qa(()=>{n.current.forEach(r=>r()),n.current=new Map},[e]),(r,i)=>{n.current.set(r,i),t({})}};function v6(e){let t=e.type;return typeof t=="function"?t(e.props):"render"in t?t.render(e.props):e}function vd({asChild:e,children:t},n){return e&&E.isValidElement(t)?E.cloneElement(v6(t),{ref:t.ref},n(t.props.children)):n(t)}var y6={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};const KA=Uv,ZA=eC,b6=Hv,QA=E.forwardRef(({className:e,...t},n)=>S.jsx(td,{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}));QA.displayName=td.displayName;const Cy=E.forwardRef(({className:e,children:t,...n},r)=>S.jsxs(b6,{children:[S.jsx(QA,{}),S.jsxs(nd,{ref:r,className:Me("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-top-[48%] fixed top-[50%] left-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border p-6 shadow-lg duration-200 sm:rounded-lg",e),...n,children:[t,S.jsxs(qv,{className:"ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-sm opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-none disabled:pointer-events-none",children:[S.jsx(Ek,{className:"h-4 w-4"}),S.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));Cy.displayName=nd.displayName;const Ty=({className:e,...t})=>S.jsx("div",{className:Me("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});Ty.displayName="DialogHeader";const Ay=E.forwardRef(({className:e,...t},n)=>S.jsx($v,{ref:n,className:Me("text-lg leading-none font-semibold tracking-tight",e),...t}));Ay.displayName=$v.displayName;const Ry=E.forwardRef(({className:e,...t},n)=>S.jsx(Vv,{ref:n,className:Me("text-muted-foreground text-sm",e),...t}));Ry.displayName=Vv.displayName;const yd=E.forwardRef(({className:e,...t},n)=>S.jsx(In,{ref:n,className:Me("bg-popover text-popover-foreground flex h-full w-full flex-col overflow-hidden rounded-md",e),...t}));yd.displayName=In.displayName;const Dy=E.forwardRef(({className:e,...t},n)=>S.jsxs("div",{className:"flex items-center border-b px-3","cmdk-input-wrapper":"",children:[S.jsx(XM,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),S.jsx(In.Input,{ref:n,className:Me("placeholder:text-muted-foreground flex h-11 w-full rounded-md bg-transparent py-3 text-sm outline-none disabled:cursor-not-allowed disabled:opacity-50",e),...t})]}));Dy.displayName=In.Input.displayName;const bd=E.forwardRef(({className:e,...t},n)=>S.jsx(In.List,{ref:n,className:Me("max-h-[300px] overflow-x-hidden overflow-y-auto",e),...t}));bd.displayName=In.List.displayName;const Ny=E.forwardRef((e,t)=>S.jsx(In.Empty,{ref:t,className:"py-6 text-center text-sm",...e}));Ny.displayName=In.Empty.displayName;const Cl=E.forwardRef(({className:e,...t},n)=>S.jsx(In.Group,{ref:n,className:Me("text-foreground [&_[cmdk-group-heading]]:text-muted-foreground overflow-hidden p-1 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium",e),...t}));Cl.displayName=In.Group.displayName;const x6=E.forwardRef(({className:e,...t},n)=>S.jsx(In.Separator,{ref:n,className:Me("bg-border -mx-1 h-px",e),...t}));x6.displayName=In.Separator.displayName;const Tl=E.forwardRef(({className:e,...t},n)=>S.jsx(In.Item,{ref:n,className:Me("data-[selected='true']:bg-accent data-[selected=true]:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",e),...t}));Tl.displayName=In.Item.displayName;const w6=({layout:e,autoRunFor:t})=>{const n=pr(),{stop:r,start:i,isRunning:o}=e;return E.useEffect(()=>{if(!n)return;let s=null;return t!==void 0&&t>-1&&n.getGraph().order>0&&(i(),s=t>0?window.setTimeout(()=>{r()},t):null),()=>{r(),s&&clearTimeout(s)}},[t,i,r,n]),S.jsx(Ot,{size:"icon",onClick:()=>o?r():i(),tooltip:o?"Stop the layout animation":"Start the layout animation",variant:Hr,children:o?S.jsx(HM,{}):S.jsx(VM,{})})},S6=()=>{const e=pr(),[t,n]=E.useState("Circular"),[r,i]=E.useState(!1),o=pU(),s=cU(),u=VU(),f=GU({settings:{margin:1}}),d=wU({maxIterations:20}),p=GA({iterations:20}),m=BU(),v=SU(),g=NU(),w=E.useMemo(()=>({Circular:{layout:o},Circlepack:{layout:s},Random:{layout:u},Noverlaps:{layout:f,worker:m},"Force Directed":{layout:d,worker:v},"Force Atlas":{layout:p,worker:g}}),[s,o,d,p,f,u,v,m,g]),x=E.useCallback(k=>{console.debug(k);const{positions:C}=w[k].layout;RG(e.getGraph(),C(),{duration:500}),n(k)},[w,e]);return S.jsxs(S.Fragment,{children:[S.jsx("div",{children:w[t]&&"worker"in w[t]&&S.jsx(w6,{layout:w[t].worker})}),S.jsx("div",{children:S.jsxs(fd,{open:r,onOpenChange:i,children:[S.jsx(dd,{asChild:!0,children:S.jsx(Ot,{size:"icon",variant:Hr,onClick:()=>i(k=>!k),tooltip:"Layout Graph",children:S.jsx(OM,{})})}),S.jsx(uu,{side:"right",align:"center",className:"p-1",children:S.jsx(yd,{children:S.jsx(bd,{children:S.jsx(Cl,{children:Object.keys(w).map(k=>S.jsx(Tl,{onSelect:()=>{x(k)},className:"cursor-pointer text-xs",children:k},k))})})})})]})})]})};var cf={exports:{}},E6=cf.exports,JS;function _6(){return JS||(JS=1,function(e){(function(t,n,r){function i(f){var d=this,p=u();d.next=function(){var m=2091639*d.s0+d.c*23283064365386963e-26;return d.s0=d.s1,d.s1=d.s2,d.s2=m-(d.c=m|0)},d.c=1,d.s0=p(" "),d.s1=p(" "),d.s2=p(" "),d.s0-=p(f),d.s0<0&&(d.s0+=1),d.s1-=p(f),d.s1<0&&(d.s1+=1),d.s2-=p(f),d.s2<0&&(d.s2+=1),p=null}function o(f,d){return d.c=f.c,d.s0=f.s0,d.s1=f.s1,d.s2=f.s2,d}function s(f,d){var p=new i(f),m=d&&d.state,v=p.next;return v.int32=function(){return p.next()*4294967296|0},v.double=function(){return v()+(v()*2097152|0)*11102230246251565e-32},v.quick=v,m&&(typeof m=="object"&&o(m,p),v.state=function(){return o(p,{})}),v}function u(){var f=4022871197,d=function(p){p=String(p);for(var m=0;m>>0,v-=f,v*=f,f=v>>>0,v-=f,f+=v*4294967296}return(f>>>0)*23283064365386963e-26};return d}n&&n.exports?n.exports=s:this.alea=s})(E6,e)}(cf)),cf.exports}var ff={exports:{}},k6=ff.exports,eE;function C6(){return eE||(eE=1,function(e){(function(t,n,r){function i(u){var f=this,d="";f.x=0,f.y=0,f.z=0,f.w=0,f.next=function(){var m=f.x^f.x<<11;return f.x=f.y,f.y=f.z,f.z=f.w,f.w^=f.w>>>19^m^m>>>8},u===(u|0)?f.x=u:d+=u;for(var p=0;p>>0)/4294967296};return m.double=function(){do var v=d.next()>>>11,g=(d.next()>>>0)/4294967296,w=(v+g)/(1<<21);while(w===0);return w},m.int32=d.next,m.quick=m,p&&(typeof p=="object"&&o(p,d),m.state=function(){return o(d,{})}),m}n&&n.exports?n.exports=s:this.xor128=s})(k6,e)}(ff)),ff.exports}var df={exports:{}},T6=df.exports,tE;function A6(){return tE||(tE=1,function(e){(function(t,n,r){function i(u){var f=this,d="";f.next=function(){var m=f.x^f.x>>>2;return f.x=f.y,f.y=f.z,f.z=f.w,f.w=f.v,(f.d=f.d+362437|0)+(f.v=f.v^f.v<<4^(m^m<<1))|0},f.x=0,f.y=0,f.z=0,f.w=0,f.v=0,u===(u|0)?f.x=u:d+=u;for(var p=0;p>>4),f.next()}function o(u,f){return f.x=u.x,f.y=u.y,f.z=u.z,f.w=u.w,f.v=u.v,f.d=u.d,f}function s(u,f){var d=new i(u),p=f&&f.state,m=function(){return(d.next()>>>0)/4294967296};return m.double=function(){do var v=d.next()>>>11,g=(d.next()>>>0)/4294967296,w=(v+g)/(1<<21);while(w===0);return w},m.int32=d.next,m.quick=m,p&&(typeof p=="object"&&o(p,d),m.state=function(){return o(d,{})}),m}n&&n.exports?n.exports=s:this.xorwow=s})(T6,e)}(df)),df.exports}var hf={exports:{}},R6=hf.exports,nE;function D6(){return nE||(nE=1,function(e){(function(t,n,r){function i(u){var f=this;f.next=function(){var p=f.x,m=f.i,v,g;return v=p[m],v^=v>>>7,g=v^v<<24,v=p[m+1&7],g^=v^v>>>10,v=p[m+3&7],g^=v^v>>>3,v=p[m+4&7],g^=v^v<<7,v=p[m+7&7],v=v^v<<13,g^=v^v<<9,p[m]=g,f.i=m+1&7,g};function d(p,m){var v,g=[];if(m===(m|0))g[0]=m;else for(m=""+m,v=0;v0;--v)p.next()}d(f,u)}function o(u,f){return f.x=u.x.slice(),f.i=u.i,f}function s(u,f){u==null&&(u=+new Date);var d=new i(u),p=f&&f.state,m=function(){return(d.next()>>>0)/4294967296};return m.double=function(){do var v=d.next()>>>11,g=(d.next()>>>0)/4294967296,w=(v+g)/(1<<21);while(w===0);return w},m.int32=d.next,m.quick=m,p&&(p.x&&o(p,d),m.state=function(){return o(d,{})}),m}n&&n.exports?n.exports=s:this.xorshift7=s})(R6,e)}(hf)),hf.exports}var pf={exports:{}},N6=pf.exports,rE;function O6(){return rE||(rE=1,function(e){(function(t,n,r){function i(u){var f=this;f.next=function(){var p=f.w,m=f.X,v=f.i,g,w;return f.w=p=p+1640531527|0,w=m[v+34&127],g=m[v=v+1&127],w^=w<<13,g^=g<<17,w^=w>>>15,g^=g>>>12,w=m[v]=w^g,f.i=v,w+(p^p>>>16)|0};function d(p,m){var v,g,w,x,k,C=[],_=128;for(m===(m|0)?(g=m,m=null):(m=m+"\0",g=0,_=Math.max(_,m.length)),w=0,x=-32;x<_;++x)m&&(g^=m.charCodeAt((x+32)%m.length)),x===0&&(k=g),g^=g<<10,g^=g>>>15,g^=g<<4,g^=g>>>13,x>=0&&(k=k+1640531527|0,v=C[x&127]^=g+k,w=v==0?w+1:0);for(w>=128&&(C[(m&&m.length||0)&127]=-1),w=127,x=4*128;x>0;--x)g=C[w+34&127],v=C[w=w+1&127],g^=g<<13,v^=v<<17,g^=g>>>15,v^=v>>>12,C[w]=g^v;p.w=k,p.X=C,p.i=w}d(f,u)}function o(u,f){return f.i=u.i,f.w=u.w,f.X=u.X.slice(),f}function s(u,f){u==null&&(u=+new Date);var d=new i(u),p=f&&f.state,m=function(){return(d.next()>>>0)/4294967296};return m.double=function(){do var v=d.next()>>>11,g=(d.next()>>>0)/4294967296,w=(v+g)/(1<<21);while(w===0);return w},m.int32=d.next,m.quick=m,p&&(p.X&&o(p,d),m.state=function(){return o(d,{})}),m}n&&n.exports?n.exports=s:this.xor4096=s})(N6,e)}(pf)),pf.exports}var mf={exports:{}},L6=mf.exports,iE;function z6(){return iE||(iE=1,function(e){(function(t,n,r){function i(u){var f=this,d="";f.next=function(){var m=f.b,v=f.c,g=f.d,w=f.a;return m=m<<25^m>>>7^v,v=v-g|0,g=g<<24^g>>>8^w,w=w-m|0,f.b=m=m<<20^m>>>12^v,f.c=v=v-g|0,f.d=g<<16^v>>>16^w,f.a=w-m|0},f.a=0,f.b=0,f.c=-1640531527,f.d=1367130551,u===Math.floor(u)?(f.a=u/4294967296|0,f.b=u|0):d+=u;for(var p=0;p>>0)/4294967296};return m.double=function(){do var v=d.next()>>>11,g=(d.next()>>>0)/4294967296,w=(v+g)/(1<<21);while(w===0);return w},m.int32=d.next,m.quick=m,p&&(typeof p=="object"&&o(p,d),m.state=function(){return o(d,{})}),m}n&&n.exports?n.exports=s:this.tychei=s})(L6,e)}(mf)),mf.exports}var gf={exports:{}};const j6={},M6=Object.freeze(Object.defineProperty({__proto__:null,default:j6},Symbol.toStringTag,{value:"Module"})),P6=lL(M6);var F6=gf.exports,aE;function I6(){return aE||(aE=1,function(e){(function(t,n,r){var i=256,o=6,s=52,u="random",f=r.pow(i,o),d=r.pow(2,s),p=d*2,m=i-1,v;function g(N,D,z){var R=[];D=D==!0?{entropy:!0}:D||{};var B=C(k(D.entropy?[N,T(n)]:N??_(),3),R),P=new w(R),j=function(){for(var V=P.g(o),q=f,I=0;V=p;)V/=2,q/=2,I>>>=1;return(V+I)/q};return j.int32=function(){return P.g(4)|0},j.quick=function(){return P.g(4)/4294967296},j.double=j,C(T(P.S),n),(D.pass||z||function(V,q,I,Y){return Y&&(Y.S&&x(Y,P),V.state=function(){return x(P,{})}),I?(r[u]=V,q):V})(j,B,"global"in D?D.global:this==r,D.state)}function w(N){var D,z=N.length,R=this,B=0,P=R.i=R.j=0,j=R.S=[];for(z||(N=[z++]);B{if(!e||!Array.isArray(e.nodes)||!Array.isArray(e.edges))return!1;for(const t of e.nodes)if(!t.id||!t.labels||!t.properties)return!1;for(const t of e.edges)if(!t.id||!t.source||!t.target)return!1;for(const t of e.edges){const n=e.getNode(t.source),r=e.getNode(t.target);if(n==null||r==null)return!1}return!0},$6=async e=>{let t=null;try{t=await nM(e)}catch(r){return Mn.getState().setErrorMessage(Cr(r),"Query Graphs Error!"),null}let n=null;if(t){const r={},i={};for(let f=0;f0){const f=bz-Qw;for(const d of t.nodes)d.size=Math.round(Qw+f*Math.pow((d.degree-o)/u,.5))}n=new nU,n.nodes=t.nodes,n.edges=t.edges,n.nodeIdMap=r,n.edgeIdMap=i,H6(n)||(n=null,console.error("Invalid graph data")),console.log("Graph data loaded")}return n},V6=e=>{const t=new Ws;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:mz,borderSize:.2});for(const n of(e==null?void 0:e.edges)??[])n.dynamicId=t.addDirectedEdge(n.source,n.target,{label:n.type||void 0});return t},lE={label:""},JA=()=>{const e=Qe.use.queryLabel(),t=yt.use.rawGraph(),n=yt.use.sigmaGraph(),r=E.useCallback(s=>(t==null?void 0:t.getNode(s))||null,[t]),i=E.useCallback((s,u=!0)=>(t==null?void 0:t.getEdge(s,u))||null,[t]);return E.useEffect(()=>{if(e){if(lE.label!==e){lE.label=e;const s=yt.getState();s.reset(),$6(e).then(u=>{s.setSigmaGraph(V6(u)),u==null||u.buildDynamicMap(),s.setRawGraph(u)})}}else{const s=yt.getState();s.reset(),s.setSigmaGraph(new Ws)}},[e]),{lightrageGraph:E.useCallback(()=>{if(n)return n;const s=new Ws;return yt.getState().setSigmaGraph(s),s},[n]),getNode:r,getEdge:i}},Vc=e=>!!(e.type.startsWith("mouse")&&e.buttons!==0),q6=({disableHoverEffect:e})=>{const{lightrageGraph:t}=JA(),n=pr(),r=bA(),i=yA(),o=rB(),{assign:s}=GA({iterations:20}),{theme:u}=hT(),f=Qe.use.enableHideUnselectedEdges(),d=yt.use.selectedNode(),p=yt.use.focusedNode(),m=yt.use.selectedEdge(),v=yt.use.focusedEdge();return E.useEffect(()=>{const g=t();o(g),g.__force_applied||(s(),Object.assign(g,{__force_applied:!0}));const{setFocusedNode:w,setSelectedNode:x,setFocusedEdge:k,setSelectedEdge:C,clearSelection:_}=yt.getState();r({enterNode:T=>{Vc(T.event.original)||w(T.node)},leaveNode:T=>{Vc(T.event.original)||w(null)},clickNode:T=>{x(T.node),C(null)},clickEdge:T=>{C(T.edge),x(null)},enterEdge:T=>{Vc(T.event.original)||k(T.edge)},leaveEdge:T=>{Vc(T.event.original)||k(null)},clickStage:()=>_()})},[s,o,r,t]),E.useEffect(()=>{const g=u==="dark",w=g?dz:void 0,x=g?vz:void 0;i({nodeReducer:(k,C)=>{const _=n.getGraph(),T={...C,highlighted:C.highlighted||!1,labelColor:w};if(!e){T.highlighted=!1;const N=p||d,D=v||m;if(N)(k===N||_.neighbors(N).includes(k))&&(T.highlighted=!0,k===d&&(T.borderColor=gz));else if(D)_.extremities(D).includes(k)&&(T.highlighted=!0,T.size=3);else return T;T.highlighted?g&&(T.labelColor=hz):T.color=pz}return T},edgeReducer:(k,C)=>{const _=n.getGraph(),T={...C,hidden:!1,labelColor:w,color:x};if(!e){const N=p||d;N?f?_.extremities(k).includes(N)||(T.hidden=!0):_.extremities(k).includes(N)&&(T.color=Zw):(v||m)&&(k===m?T.color=yz:k===v?T.color=Zw:f&&(T.hidden=!0))}return T}})},[d,p,m,v,i,n,e,u,f]),null},Y6=()=>{const{zoomIn:e,zoomOut:t,reset:n}=xA({duration:200,factor:1.5}),r=E.useCallback(()=>e(),[e]),i=E.useCallback(()=>t(),[t]),o=E.useCallback(()=>n(),[n]);return S.jsxs(S.Fragment,{children:[S.jsx(Ot,{variant:Hr,onClick:r,tooltip:"Zoom In",size:"icon",children:S.jsx(lP,{})}),S.jsx(Ot,{variant:Hr,onClick:i,tooltip:"Zoom Out",size:"icon",children:S.jsx(uP,{})}),S.jsx(Ot,{variant:Hr,onClick:o,tooltip:"Reset Zoom",size:"icon",children:S.jsx(AM,{})})]})},W6=()=>{const{isFullScreen:e,toggle:t}=iB();return S.jsx(S.Fragment,{children:e?S.jsx(Ot,{variant:Hr,onClick:t,tooltip:"Windowed",size:"icon",children:S.jsx(IM,{})}):S.jsx(Ot,{variant:Hr,onClick:t,tooltip:"Full Screen",size:"icon",children:S.jsx(PM,{})})})};function eR(e){const t=E.useRef({value:e,previous:e});return E.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var Oy="Checkbox",[X6,pK]=hr(Oy),[K6,Z6]=X6(Oy),tR=E.forwardRef((e,t)=>{const{__scopeCheckbox:n,name:r,checked:i,defaultChecked:o,required:s,disabled:u,value:f="on",onCheckedChange:d,form:p,...m}=e,[v,g]=E.useState(null),w=dt(t,N=>g(N)),x=E.useRef(!1),k=v?p||!!v.closest("form"):!0,[C=!1,_]=_i({prop:i,defaultProp:o,onChange:d}),T=E.useRef(C);return E.useEffect(()=>{const N=v==null?void 0:v.form;if(N){const D=()=>_(T.current);return N.addEventListener("reset",D),()=>N.removeEventListener("reset",D)}},[v,_]),S.jsxs(K6,{scope:n,state:C,disabled:u,children:[S.jsx(We.button,{type:"button",role:"checkbox","aria-checked":la(C)?"mixed":C,"aria-required":s,"data-state":iR(C),"data-disabled":u?"":void 0,disabled:u,value:f,...m,ref:w,onKeyDown:qe(e.onKeyDown,N=>{N.key==="Enter"&&N.preventDefault()}),onClick:qe(e.onClick,N=>{_(D=>la(D)?!0:!D),k&&(x.current=N.isPropagationStopped(),x.current||N.stopPropagation())})}),k&&S.jsx(Q6,{control:v,bubbles:!x.current,name:r,value:f,checked:C,required:s,disabled:u,form:p,style:{transform:"translateX(-100%)"},defaultChecked:la(o)?!1:o})]})});tR.displayName=Oy;var nR="CheckboxIndicator",rR=E.forwardRef((e,t)=>{const{__scopeCheckbox:n,forceMount:r,...i}=e,o=Z6(nR,n);return S.jsx(Zn,{present:r||la(o.state)||o.state===!0,children:S.jsx(We.span,{"data-state":iR(o.state),"data-disabled":o.disabled?"":void 0,...i,ref:t,style:{pointerEvents:"none",...e.style}})})});rR.displayName=nR;var Q6=e=>{const{control:t,checked:n,bubbles:r=!0,defaultChecked:i,...o}=e,s=E.useRef(null),u=eR(n),f=DC(t);E.useEffect(()=>{const p=s.current,m=window.HTMLInputElement.prototype,g=Object.getOwnPropertyDescriptor(m,"checked").set;if(u!==n&&g){const w=new Event("click",{bubbles:r});p.indeterminate=la(n),g.call(p,la(n)?!1:n),p.dispatchEvent(w)}},[u,n,r]);const d=E.useRef(la(n)?!1:n);return S.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:i??d.current,...o,tabIndex:-1,ref:s,style:{...e.style,...f,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function la(e){return e==="indeterminate"}function iR(e){return la(e)?"indeterminate":e?"checked":"unchecked"}var aR=tR,J6=rR;const Bs=E.forwardRef(({className:e,...t},n)=>S.jsx(aR,{ref:n,className:Me("peer border-primary ring-offset-background focus-visible:ring-ring data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground h-4 w-4 shrink-0 rounded-sm border focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50",e),...t,children:S.jsx(J6,{className:Me("flex items-center justify-center text-current"),children:S.jsx(Lv,{className:"h-4 w-4"})})}));Bs.displayName=aR.displayName;var eH="Separator",sE="horizontal",tH=["horizontal","vertical"],oR=E.forwardRef((e,t)=>{const{decorative:n,orientation:r=sE,...i}=e,o=nH(r)?r:sE,u=n?{role:"none"}:{"aria-orientation":o==="vertical"?o:void 0,role:"separator"};return S.jsx(We.div,{"data-orientation":o,...u,...i,ref:t})});oR.displayName=eH;function nH(e){return tH.includes(e)}var lR=oR;const Fs=E.forwardRef(({className:e,orientation:t="horizontal",decorative:n=!0,...r},i)=>S.jsx(lR,{ref:i,decorative:n,orientation:t,className:Me("bg-border shrink-0",t==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",e),...r}));Fs.displayName=lR.displayName;const na=({checked:e,onCheckedChange:t,label:n})=>S.jsxs("div",{className:"flex items-center gap-2",children:[S.jsx(Bs,{checked:e,onCheckedChange:t}),S.jsx("label",{htmlFor:"terms",className:"text-sm leading-none font-medium peer-disabled:cursor-not-allowed peer-disabled:opacity-70",children:n})]});function rH(){const[e,t]=E.useState(!1),[n,r]=E.useState(""),i=Qe.use.showPropertyPanel(),o=Qe.use.showNodeSearchBar(),s=Qe.use.showNodeLabel(),u=Qe.use.enableEdgeEvents(),f=Qe.use.enableNodeDrag(),d=Qe.use.enableHideUnselectedEdges(),p=Qe.use.showEdgeLabel(),m=Qe.use.enableHealthCheck(),v=Qe.use.apiKey();E.useEffect(()=>{r(v||"")},[v,e]);const g=E.useCallback(()=>Qe.setState(R=>({enableNodeDrag:!R.enableNodeDrag})),[]),w=E.useCallback(()=>Qe.setState(R=>({enableEdgeEvents:!R.enableEdgeEvents})),[]),x=E.useCallback(()=>Qe.setState(R=>({enableHideUnselectedEdges:!R.enableHideUnselectedEdges})),[]),k=E.useCallback(()=>Qe.setState(R=>({showEdgeLabel:!R.showEdgeLabel})),[]),C=E.useCallback(()=>Qe.setState(R=>({showPropertyPanel:!R.showPropertyPanel})),[]),_=E.useCallback(()=>Qe.setState(R=>({showNodeSearchBar:!R.showNodeSearchBar})),[]),T=E.useCallback(()=>Qe.setState(R=>({showNodeLabel:!R.showNodeLabel})),[]),N=E.useCallback(()=>Qe.setState(R=>({enableHealthCheck:!R.enableHealthCheck})),[]),D=E.useCallback(async()=>{Qe.setState({apiKey:n||null}),await Mn.getState().check(),t(!1)},[n]),z=E.useCallback(R=>{r(R.target.value)},[r]);return S.jsxs(fd,{open:e,onOpenChange:t,children:[S.jsx(dd,{asChild:!0,children:S.jsx(Ot,{variant:Hr,tooltip:"Settings",size:"icon",children:S.jsx(JM,{})})}),S.jsx(uu,{side:"right",align:"start",className:"mb-2 p-2",onCloseAutoFocus:R=>R.preventDefault(),children:S.jsxs("div",{className:"flex flex-col gap-2",children:[S.jsx(na,{checked:i,onCheckedChange:C,label:"Show Property Panel"}),S.jsx(na,{checked:o,onCheckedChange:_,label:"Show Search Bar"}),S.jsx(Fs,{}),S.jsx(na,{checked:s,onCheckedChange:T,label:"Show Node Label"}),S.jsx(na,{checked:f,onCheckedChange:g,label:"Node Draggable"}),S.jsx(Fs,{}),S.jsx(na,{checked:p,onCheckedChange:k,label:"Show Edge Label"}),S.jsx(na,{checked:d,onCheckedChange:x,label:"Hide Unselected Edges"}),S.jsx(na,{checked:u,onCheckedChange:w,label:"Edge Events"}),S.jsx(Fs,{}),S.jsx(na,{checked:m,onCheckedChange:N,label:"Health Check"}),S.jsx(Fs,{}),S.jsxs("div",{className:"flex flex-col gap-2",children:[S.jsx("label",{className:"text-sm font-medium",children:"API Key"}),S.jsxs("form",{className:"flex h-6 gap-2",onSubmit:R=>R.preventDefault(),children:[S.jsx("div",{className:"w-0 flex-1",children:S.jsx(Za,{type:"password",value:n,onChange:z,placeholder:"Enter your API key",className:"max-h-full w-full min-w-0",autoComplete:"off"})}),S.jsx(Ot,{onClick:D,variant:"outline",size:"sm",className:"max-h-full shrink-0",children:"Save"})]})]})]})})]})}const iH="ENTRIES",sR="KEYS",uR="VALUES",sn="";class Hm{constructor(t,n){const r=t._tree,i=Array.from(r.keys());this.set=t,this._type=n,this._path=i.length>0?[{node:r,keys:i}]:[]}next(){const t=this.dive();return this.backtrack(),t}dive(){if(this._path.length===0)return{done:!0,value:void 0};const{node:t,keys:n}=Wo(this._path);if(Wo(n)===sn)return{done:!1,value:this.result()};const r=t.get(Wo(n));return this._path.push({node:r,keys:Array.from(r.keys())}),this.dive()}backtrack(){if(this._path.length===0)return;const t=Wo(this._path).keys;t.pop(),!(t.length>0)&&(this._path.pop(),this.backtrack())}key(){return this.set._prefix+this._path.map(({keys:t})=>Wo(t)).filter(t=>t!==sn).join("")}value(){return Wo(this._path).node.get(sn)}result(){switch(this._type){case uR:return this.value();case sR:return this.key();default:return[this.key(),this.value()]}}[Symbol.iterator](){return this}}const Wo=e=>e[e.length-1],aH=(e,t,n)=>{const r=new Map;if(t===void 0)return r;const i=t.length+1,o=i+n,s=new Uint8Array(o*i).fill(n+1);for(let u=0;u{const f=o*s;e:for(const d of e.keys())if(d===sn){const p=i[f-1];p<=n&&r.set(u,[e.get(d),p])}else{let p=o;for(let m=0;mn)continue e}cR(e.get(d),t,n,r,i,p,s,u+d)}};class oa{constructor(t=new Map,n=""){this._size=void 0,this._tree=t,this._prefix=n}atPrefix(t){if(!t.startsWith(this._prefix))throw new Error("Mismatched prefix");const[n,r]=Df(this._tree,t.slice(this._prefix.length));if(n===void 0){const[i,o]=Ly(r);for(const s of i.keys())if(s!==sn&&s.startsWith(o)){const u=new Map;return u.set(s.slice(o.length),i.get(s)),new oa(u,t)}}return new oa(n,t)}clear(){this._size=void 0,this._tree.clear()}delete(t){return this._size=void 0,oH(this._tree,t)}entries(){return new Hm(this,iH)}forEach(t){for(const[n,r]of this)t(n,r,this)}fuzzyGet(t,n){return aH(this._tree,t,n)}get(t){const n=Zg(this._tree,t);return n!==void 0?n.get(sn):void 0}has(t){const n=Zg(this._tree,t);return n!==void 0&&n.has(sn)}keys(){return new Hm(this,sR)}set(t,n){if(typeof t!="string")throw new Error("key must be a string");return this._size=void 0,$m(this._tree,t).set(sn,n),this}get size(){if(this._size)return this._size;this._size=0;const t=this.entries();for(;!t.next().done;)this._size+=1;return this._size}update(t,n){if(typeof t!="string")throw new Error("key must be a string");this._size=void 0;const r=$m(this._tree,t);return r.set(sn,n(r.get(sn))),this}fetch(t,n){if(typeof t!="string")throw new Error("key must be a string");this._size=void 0;const r=$m(this._tree,t);let i=r.get(sn);return i===void 0&&r.set(sn,i=n()),i}values(){return new Hm(this,uR)}[Symbol.iterator](){return this.entries()}static from(t){const n=new oa;for(const[r,i]of t)n.set(r,i);return n}static fromObject(t){return oa.from(Object.entries(t))}}const Df=(e,t,n=[])=>{if(t.length===0||e==null)return[e,n];for(const r of e.keys())if(r!==sn&&t.startsWith(r))return n.push([e,r]),Df(e.get(r),t.slice(r.length),n);return n.push([e,t]),Df(void 0,"",n)},Zg=(e,t)=>{if(t.length===0||e==null)return e;for(const n of e.keys())if(n!==sn&&t.startsWith(n))return Zg(e.get(n),t.slice(n.length))},$m=(e,t)=>{const n=t.length;e:for(let r=0;e&&r{const[n,r]=Df(e,t);if(n!==void 0){if(n.delete(sn),n.size===0)fR(r);else if(n.size===1){const[i,o]=n.entries().next().value;dR(r,i,o)}}},fR=e=>{if(e.length===0)return;const[t,n]=Ly(e);if(t.delete(n),t.size===0)fR(e.slice(0,-1));else if(t.size===1){const[r,i]=t.entries().next().value;r!==sn&&dR(e.slice(0,-1),r,i)}},dR=(e,t,n)=>{if(e.length===0)return;const[r,i]=Ly(e);r.set(i+t,n),r.delete(i)},Ly=e=>e[e.length-1],zy="or",hR="and",lH="and_not";class sa{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?Ym:t.autoVacuum;this._options={...qm,...t,autoVacuum:n,searchOptions:{...uE,...t.searchOptions||{}},autoSuggestOptions:{...dH,...t.autoSuggestOptions||{}}},this._index=new oa,this._documentCount=0,this._documentIds=new Map,this._idToShortId=new Map,this._fieldIds={},this._fieldLength=new Map,this._avgFieldLength=[],this._nextId=0,this._storedFields=new Map,this._dirtCount=0,this._currentVacuum=null,this._enqueuedVacuum=null,this._enqueuedVacuumConditions=Jg,this.addFields(this._options.fields)}add(t){const{extractField:n,tokenize:r,processTerm:i,fields:o,idField:s}=this._options,u=n(t,s);if(u==null)throw new Error(`MiniSearch: document does not have ID field "${s}"`);if(this._idToShortId.has(u))throw new Error(`MiniSearch: duplicate ID ${u}`);const f=this.addDocumentId(u);this.saveStoredFields(f,t);for(const d of o){const p=n(t,d);if(p==null)continue;const m=r(p.toString(),d),v=this._fieldIds[d],g=new Set(m).size;this.addFieldLength(f,v,this._documentCount-1,g);for(const w of m){const x=i(w,d);if(Array.isArray(x))for(const k of x)this.addTerm(v,f,k);else x&&this.addTerm(v,f,x)}}}addAll(t){for(const n of t)this.add(n)}addAllAsync(t,n={}){const{chunkSize:r=10}=n,i={chunk:[],promise:Promise.resolve()},{chunk:o,promise:s}=t.reduce(({chunk:u,promise:f},d,p)=>(u.push(d),(p+1)%r===0?{chunk:[],promise:f.then(()=>new Promise(m=>setTimeout(m,0))).then(()=>this.addAll(u))}:{chunk:u,promise:f}),i);return s.then(()=>this.addAll(o))}remove(t){const{tokenize:n,processTerm:r,extractField:i,fields:o,idField:s}=this._options,u=i(t,s);if(u==null)throw new Error(`MiniSearch: document does not have ID field "${s}"`);const f=this._idToShortId.get(u);if(f==null)throw new Error(`MiniSearch: cannot remove document with ID ${u}: it is not in the index`);for(const d of o){const p=i(t,d);if(p==null)continue;const m=n(p.toString(),d),v=this._fieldIds[d],g=new Set(m).size;this.removeFieldLength(f,v,this._documentCount,g);for(const w of m){const x=r(w,d);if(Array.isArray(x))for(const k of x)this.removeTerm(v,f,k);else x&&this.removeTerm(v,f,x)}}this._storedFields.delete(f),this._documentIds.delete(f),this._idToShortId.delete(u),this._fieldLength.delete(f),this._documentCount-=1}removeAll(t){if(t)for(const n of t)this.remove(n);else{if(arguments.length>0)throw new Error("Expected documents to be present. Omit the argument to remove all documents.");this._index=new oa,this._documentCount=0,this._documentIds=new Map,this._idToShortId=new Map,this._fieldLength=new Map,this._avgFieldLength=[],this._storedFields=new Map,this._nextId=0}}discard(t){const n=this._idToShortId.get(t);if(n==null)throw new Error(`MiniSearch: cannot discard document with ID ${t}: it is not in the index`);this._idToShortId.delete(t),this._documentIds.delete(n),this._storedFields.delete(n),(this._fieldLength.get(n)||[]).forEach((r,i)=>{this.removeFieldLength(n,i,this._documentCount,r)}),this._fieldLength.delete(n),this._documentCount-=1,this._dirtCount+=1,this.maybeAutoVacuum()}maybeAutoVacuum(){if(this._options.autoVacuum===!1)return;const{minDirtFactor:t,minDirtCount:n,batchSize:r,batchWait:i}=this._options.autoVacuum;this.conditionalVacuum({batchSize:r,batchWait:i},{minDirtCount:n,minDirtFactor:t})}discardAll(t){const n=this._options.autoVacuum;try{this._options.autoVacuum=!1;for(const r of t)this.discard(r)}finally{this._options.autoVacuum=n}this.maybeAutoVacuum()}replace(t){const{idField:n,extractField:r}=this._options,i=r(t,n);this.discard(i),this.add(t)}vacuum(t={}){return this.conditionalVacuum(t)}conditionalVacuum(t,n){return this._currentVacuum?(this._enqueuedVacuumConditions=this._enqueuedVacuumConditions&&n,this._enqueuedVacuum!=null?this._enqueuedVacuum:(this._enqueuedVacuum=this._currentVacuum.then(()=>{const r=this._enqueuedVacuumConditions;return this._enqueuedVacuumConditions=Jg,this.performVacuuming(t,r)}),this._enqueuedVacuum)):this.vacuumConditionsMet(n)===!1?Promise.resolve():(this._currentVacuum=this.performVacuuming(t),this._currentVacuum)}async performVacuuming(t,n){const r=this._dirtCount;if(this.vacuumConditionsMet(n)){const i=t.batchSize||Qg.batchSize,o=t.batchWait||Qg.batchWait;let s=1;for(const[u,f]of this._index){for(const[d,p]of f)for(const[m]of p)this._documentIds.has(m)||(p.size<=1?f.delete(d):p.delete(m));this._index.get(u).size===0&&this._index.delete(u),s%i===0&&await new Promise(d=>setTimeout(d,o)),s+=1}this._dirtCount-=r}await null,this._currentVacuum=this._enqueuedVacuum,this._enqueuedVacuum=null}vacuumConditionsMet(t){if(t==null)return!0;let{minDirtCount:n,minDirtFactor:r}=t;return n=n||Ym.minDirtCount,r=r||Ym.minDirtFactor,this.dirtCount>=n&&this.dirtFactor>=r}get isVacuuming(){return this._currentVacuum!=null}get dirtCount(){return this._dirtCount}get dirtFactor(){return this._dirtCount/(1+this._documentCount+this._dirtCount)}has(t){return this._idToShortId.has(t)}getStoredFields(t){const n=this._idToShortId.get(t);if(n!=null)return this._storedFields.get(n)}search(t,n={}){const{searchOptions:r}=this._options,i={...r,...n},o=this.executeQuery(t,n),s=[];for(const[u,{score:f,terms:d,match:p}]of o){const m=d.length||1,v={id:this._documentIds.get(u),score:f*m,terms:Object.keys(p),queryTerms:d,match:p};Object.assign(v,this._storedFields.get(u)),(i.filter==null||i.filter(v))&&s.push(v)}return t===sa.wildcard&&i.boostDocument==null||s.sort(fE),s}autoSuggest(t,n={}){n={...this._options.autoSuggestOptions,...n};const r=new Map;for(const{score:o,terms:s}of this.search(t,n)){const u=s.join(" "),f=r.get(u);f!=null?(f.score+=o,f.count+=1):r.set(u,{score:o,terms:s,count:1})}const i=[];for(const[o,{score:s,terms:u,count:f}]of r)i.push({suggestion:o,terms:u,score:s/f});return i.sort(fE),i}get documentCount(){return this._documentCount}get termCount(){return this._index.size}static loadJSON(t,n){if(n==null)throw new Error("MiniSearch: loadJSON should be given the same options used when serializing the index");return this.loadJS(JSON.parse(t),n)}static async loadJSONAsync(t,n){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(qm.hasOwnProperty(t))return Vm(qm,t);throw new Error(`MiniSearch: unknown option "${t}"`)}static loadJS(t,n){const{index:r,documentIds:i,fieldLength:o,storedFields:s,serializationVersion:u}=t,f=this.instantiateMiniSearch(t,n);f._documentIds=qc(i),f._fieldLength=qc(o),f._storedFields=qc(s);for(const[d,p]of f._documentIds)f._idToShortId.set(p,d);for(const[d,p]of r){const m=new Map;for(const v of Object.keys(p)){let g=p[v];u===1&&(g=g.ds),m.set(parseInt(v,10),qc(g))}f._index.set(d,m)}return f}static async loadJSAsync(t,n){const{index:r,documentIds:i,fieldLength:o,storedFields:s,serializationVersion:u}=t,f=this.instantiateMiniSearch(t,n);f._documentIds=await Yc(i),f._fieldLength=await Yc(o),f._storedFields=await Yc(s);for(const[p,m]of f._documentIds)f._idToShortId.set(m,p);let d=0;for(const[p,m]of r){const v=new Map;for(const g of Object.keys(m)){let w=m[g];u===1&&(w=w.ds),v.set(parseInt(g,10),await Yc(w))}++d%1e3===0&&await pR(0),f._index.set(p,v)}return f}static instantiateMiniSearch(t,n){const{documentCount:r,nextId:i,fieldIds:o,averageFieldLength:s,dirtCount:u,serializationVersion:f}=t;if(f!==1&&f!==2)throw new Error("MiniSearch: cannot deserialize an index created with an incompatible version");const d=new sa(n);return d._documentCount=r,d._nextId=i,d._idToShortId=new Map,d._fieldIds=o,d._avgFieldLength=s,d._dirtCount=u||0,d._index=new oa,d}executeQuery(t,n={}){if(t===sa.wildcard)return this.executeWildcardQuery(n);if(typeof t!="string"){const v={...n,...t,queries:void 0},g=t.queries.map(w=>this.executeQuery(w,v));return this.combineResults(g,v.combineWith)}const{tokenize:r,processTerm:i,searchOptions:o}=this._options,s={tokenize:r,processTerm:i,...o,...n},{tokenize:u,processTerm:f}=s,m=u(t).flatMap(v=>f(v)).filter(v=>!!v).map(fH(s)).map(v=>this.executeQuerySpec(v,s));return this.combineResults(m,s.combineWith)}executeQuerySpec(t,n){const r={...this._options.searchOptions,...n},i=(r.fields||this._options.fields).reduce((x,k)=>({...x,[k]:Vm(r.boost,k)||1}),{}),{boostDocument:o,weights:s,maxFuzzy:u,bm25:f}=r,{fuzzy:d,prefix:p}={...uE.weights,...s},m=this._index.get(t.term),v=this.termResults(t.term,t.term,1,t.termBoost,m,i,o,f);let g,w;if(t.prefix&&(g=this._index.atPrefix(t.term)),t.fuzzy){const x=t.fuzzy===!0?.2:t.fuzzy,k=x<1?Math.min(u,Math.round(t.term.length*x)):x;k&&(w=this._index.fuzzyGet(t.term,k))}if(g)for(const[x,k]of g){const C=x.length-t.term.length;if(!C)continue;w==null||w.delete(x);const _=p*x.length/(x.length+.3*C);this.termResults(t.term,x,_,t.termBoost,k,i,o,f,v)}if(w)for(const x of w.keys()){const[k,C]=w.get(x);if(!C)continue;const _=d*x.length/(x.length+C);this.termResults(t.term,x,_,t.termBoost,k,i,o,f,v)}return v}executeWildcardQuery(t){const n=new Map,r={...this._options.searchOptions,...t};for(const[i,o]of this._documentIds){const s=r.boostDocument?r.boostDocument(o,"",this._storedFields.get(i)):1;n.set(i,{score:s,terms:[],match:{}})}return n}combineResults(t,n=zy){if(t.length===0)return new Map;const r=n.toLowerCase(),i=sH[r];if(!i)throw new Error(`Invalid combination operator: ${n}`);return t.reduce(i)||new Map}toJSON(){const t=[];for(const[n,r]of this._index){const i={};for(const[o,s]of r)i[o]=Object.fromEntries(s);t.push([n,i])}return{documentCount:this._documentCount,nextId:this._nextId,documentIds:Object.fromEntries(this._documentIds),fieldIds:this._fieldIds,fieldLength:Object.fromEntries(this._fieldLength),averageFieldLength:this._avgFieldLength,storedFields:Object.fromEntries(this._storedFields),dirtCount:this._dirtCount,index:t,serializationVersion:2}}termResults(t,n,r,i,o,s,u,f,d=new Map){if(o==null)return d;for(const p of Object.keys(s)){const m=s[p],v=this._fieldIds[p],g=o.get(v);if(g==null)continue;let w=g.size;const x=this._avgFieldLength[v];for(const k of g.keys()){if(!this._documentIds.has(k)){this.removeTerm(v,k,n),w-=1;continue}const C=u?u(this._documentIds.get(k),n,this._storedFields.get(k)):1;if(!C)continue;const _=g.get(k),T=this._fieldLength.get(k)[v],N=cH(_,w,this._documentCount,T,x,f),D=r*i*m*C*N,z=d.get(k);if(z){z.score+=D,hH(z.terms,t);const R=Vm(z.match,n);R?R.push(p):z.match[n]=[p]}else d.set(k,{score:D,terms:[t],match:{[n]:[p]}})}}return d}addTerm(t,n,r){const i=this._index.fetch(r,dE);let o=i.get(t);if(o==null)o=new Map,o.set(n,1),i.set(t,o);else{const s=o.get(n);o.set(n,(s||0)+1)}}removeTerm(t,n,r){if(!this._index.has(r)){this.warnDocumentChanged(n,t,r);return}const i=this._index.fetch(r,dE),o=i.get(t);o==null||o.get(n)==null?this.warnDocumentChanged(n,t,r):o.get(n)<=1?o.size<=1?i.delete(t):o.delete(n):o.set(n,o.get(n)-1),this._index.get(r).size===0&&this._index.delete(r)}warnDocumentChanged(t,n,r){for(const i of Object.keys(this._fieldIds))if(this._fieldIds[i]===n){this._options.logger("warn",`MiniSearch: document with ID ${this._documentIds.get(t)} has changed before removal: term "${r}" was not present in field "${i}". Removing a document after it has changed can corrupt the index!`,"version_conflict");return}}addDocumentId(t){const n=this._nextId;return this._idToShortId.set(t,n),this._documentIds.set(n,t),this._documentCount+=1,this._nextId+=1,n}addFields(t){for(let n=0;nObject.prototype.hasOwnProperty.call(e,t)?e[t]:void 0,sH={[zy]:(e,t)=>{for(const n of t.keys()){const r=e.get(n);if(r==null)e.set(n,t.get(n));else{const{score:i,terms:o,match:s}=t.get(n);r.score=r.score+i,r.match=Object.assign(r.match,s),cE(r.terms,o)}}return e},[hR]:(e,t)=>{const n=new Map;for(const r of t.keys()){const i=e.get(r);if(i==null)continue;const{score:o,terms:s,match:u}=t.get(r);cE(i.terms,s),n.set(r,{score:i.score+o,terms:i.terms,match:Object.assign(i.match,u)})}return n},[lH]:(e,t)=>{for(const n of t.keys())e.delete(n);return e}},uH={k:1.2,b:.7,d:.5},cH=(e,t,n,r,i,o)=>{const{k:s,b:u,d:f}=o;return Math.log(1+(n-t+.5)/(t+.5))*(f+e*(s+1)/(e+s*(1-u+u*r/i)))},fH=e=>(t,n,r)=>{const i=typeof e.fuzzy=="function"?e.fuzzy(t,n,r):e.fuzzy||!1,o=typeof e.prefix=="function"?e.prefix(t,n,r):e.prefix===!0,s=typeof e.boostTerm=="function"?e.boostTerm(t,n,r):1;return{term:t,fuzzy:i,prefix:o,termBoost:s}},qm={idField:"id",extractField:(e,t)=>e[t],tokenize:e=>e.split(pH),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},uE={combineWith:zy,prefix:!1,fuzzy:!1,maxFuzzy:6,boost:{},weights:{fuzzy:.45,prefix:.375},bm25:uH},dH={combineWith:hR,prefix:(e,t,n)=>t===n.length-1},Qg={batchSize:1e3,batchWait:10},Jg={minDirtFactor:.1,minDirtCount:20},Ym={...Qg,...Jg},hH=(e,t)=>{e.includes(t)||e.push(t)},cE=(e,t)=>{for(const n of t)e.includes(n)||e.push(n)},fE=({score:e},{score:t})=>t-e,dE=()=>new Map,qc=e=>{const t=new Map;for(const n of Object.keys(e))t.set(parseInt(n,10),e[n]);return t},Yc=async e=>{const t=new Map;let n=0;for(const r of Object.keys(e))t.set(parseInt(r,10),e[r]),++n%1e3===0&&await pR(0);return t},pR=e=>new Promise(t=>setTimeout(t,e)),pH=/[\n\r\p{Z}\p{P}]+/u,mH={index:new sa({fields:[]})};E.createContext(mH);const ev=({label:e,color:t,hidden:n,labels:r={}})=>be.createElement("div",{className:"node"},be.createElement("span",{className:"render "+(n?"circle":"disc"),style:{backgroundColor:t||"#000"}}),be.createElement("span",{className:`label ${n?"text-muted":""} ${e?"":"text-italic"}`},e||r.no_label||"No label")),gH=({id:e,labels:t})=>{const n=pr(),r=E.useMemo(()=>{const i=n.getGraph().getNodeAttributes(e),o=n.getSetting("nodeReducer");return Object.assign(Object.assign({color:n.getSetting("defaultNodeColor")},i),o?o(e,i):{})},[n,e]);return be.createElement(ev,Object.assign({},r,{labels:t}))},vH=({label:e,color:t,source:n,target:r,hidden:i,directed:o,labels:s={}})=>be.createElement("div",{className:"edge"},be.createElement(ev,Object.assign({},n,{labels:s})),be.createElement("div",{className:"body"},be.createElement("div",{className:"render"},be.createElement("span",{className:i?"dotted":"dash",style:{borderColor:t||"#000"}})," ",o&&be.createElement("span",{className:"arrow",style:{borderTopColor:t||"#000"}})),be.createElement("span",{className:`label ${i?"text-muted":""} ${e?"":"fst-italic"}`},e||s.no_label||"No label")),be.createElement(ev,Object.assign({},r,{labels:s}))),yH=({id:e,labels:t})=>{const n=pr(),r=E.useMemo(()=>{const i=n.getGraph().getEdgeAttributes(e),o=n.getSetting("nodeReducer"),s=n.getSetting("edgeReducer"),u=n.getGraph().getNodeAttributes(n.getGraph().source(e)),f=n.getGraph().getNodeAttributes(n.getGraph().target(e));return Object.assign(Object.assign(Object.assign({color:n.getSetting("defaultEdgeColor"),directed:n.getGraph().isDirected(e)},i),s?s(e,i):{}),{source:Object.assign(Object.assign({color:n.getSetting("defaultNodeColor")},u),o?o(e,u):{}),target:Object.assign(Object.assign({color:n.getSetting("defaultNodeColor")},f),o?o(e,f):{})})},[n,e]);return be.createElement(vH,Object.assign({},r,{labels:t}))};function jy(e,t){const[n,r]=E.useState(e);return E.useEffect(()=>{const i=setTimeout(()=>{r(e)},t);return()=>{clearTimeout(i)}},[e,t]),n}function bH({fetcher:e,preload:t,filterFn:n,renderOption:r,getOptionValue:i,notFound:o,loadingSkeleton:s,label:u,placeholder:f="Select...",value:d,onChange:p,onFocus:m,disabled:v=!1,className:g,noResultsMessage:w}){const[x,k]=E.useState(!1),[C,_]=E.useState(!1),[T,N]=E.useState([]),[D,z]=E.useState(!1),[R,B]=E.useState(null),[P,j]=E.useState(d),[V,q]=E.useState(null),[I,Y]=E.useState(""),Z=jy(I,t?0:150),[U,G]=E.useState([]);E.useEffect(()=>{k(!0),j(d)},[d]),E.useEffect(()=>{x||(async()=>{try{z(!0),B(null);const $=d!==null?await e(d):[];G($),N($)}catch($){B($ instanceof Error?$.message:"Failed to fetch options")}finally{z(!1)}})()},[x,e,d]),E.useEffect(()=>{const A=async()=>{try{z(!0),B(null);const $=await e(Z);G($),N($)}catch($){B($ instanceof Error?$.message:"Failed to fetch options")}finally{z(!1)}};x&&t?t&&N(Z?U.filter($=>n?n($,Z):!0):U):A()},[e,Z,x,t,n]);const F=E.useCallback(A=>{A!==P&&(j(A),p(A)),_(!1)},[P,j,_,p]),K=E.useCallback(A=>{A!==V&&(q(A),m(A))},[V,q,m]);return S.jsx("div",{className:Me(v&&"cursor-not-allowed opacity-50",g),onFocus:()=>{_(!0)},onBlur:()=>_(!1),children:S.jsxs(yd,{shouldFilter:!1,className:"bg-transparent",children:[S.jsxs("div",{children:[S.jsx(Dy,{placeholder:f,value:I,className:"max-h-8",onValueChange:A=>{Y(A),A&&!C&&_(!0)}}),D&&T.length>0&&S.jsx("div",{className:"absolute top-1/2 right-2 flex -translate-y-1/2 transform items-center",children:S.jsx(Sk,{className:"h-4 w-4 animate-spin"})})]}),S.jsxs(bd,{hidden:!C||Z.length===0,children:[R&&S.jsx("div",{className:"text-destructive p-4 text-center",children:R}),D&&T.length===0&&(s||S.jsx(xH,{})),!D&&!R&&T.length===0&&(o||S.jsx(Ny,{children:w??`No ${u.toLowerCase()} found.`})),S.jsx(Cl,{children:T.map((A,$)=>S.jsxs(S.Fragment,{children:[S.jsx(Tl,{value:i(A),onSelect:F,onMouseEnter:()=>K(i(A)),className:"truncate",children:r(A)},i(A)+`${$}`),$!==T.length-1&&S.jsx("div",{className:"bg-foreground/10 h-[1px]"},$)]}))})]})]})})}function xH(){return S.jsx(Cl,{children:S.jsx(Tl,{disabled:!0,children:S.jsxs("div",{className:"flex w-full items-center gap-2",children:[S.jsx("div",{className:"bg-muted h-6 w-6 animate-pulse rounded-full"}),S.jsxs("div",{className:"flex flex-1 flex-col gap-1",children:[S.jsx("div",{className:"bg-muted h-4 w-24 animate-pulse rounded"}),S.jsx("div",{className:"bg-muted h-3 w-16 animate-pulse rounded"})]})]})})})}function wH(e){return S.jsxs("div",{children:[e.type==="nodes"&&S.jsx(gH,{id:e.id}),e.type==="edges"&&S.jsx(yH,{id:e.id}),e.type==="message"&&S.jsx("div",{children:e.message})]})}const Wm="__message_item",Wc={graph:null,searchEngine:null},SH=({onChange:e,onFocus:t,value:n})=>{const r=yt.use.sigmaGraph(),i=E.useMemo(()=>{if(Wc.graph==r)return Wc.searchEngine;if(!r||r.nodes().length==0)return;Wc.graph=r;const s=new sa({idField:"id",fields:["label"],searchOptions:{prefix:!0,fuzzy:.2,boost:{label:2}}}),u=r.nodes().map(f=>({id:f,label:r.getNodeAttribute(f,"label")}));return s.addAll(u),Wc.searchEngine=s,s},[r]),o=E.useCallback(async s=>{if(t&&t(null),!s||!i)return[];const u=i.search(s).map(f=>({id:f.id,type:"nodes"}));return u.length<=$p?u:[...u.slice(0,$p),{type:"message",id:Wm,message:`And ${u.length-$p} others`}]},[i,t]);return S.jsx(bH,{className:"bg-background/60 w-24 rounded-xl border-1 opacity-60 backdrop-blur-lg transition-all hover:w-fit hover:opacity-100",fetcher:o,renderOption:wH,getOptionValue:s=>s.id,value:n&&n.type!=="message"?n.id:null,onChange:s=>{s!==Wm&&e(s?{id:s,type:"nodes"}:null)},onFocus:s=>{s!==Wm&&t&&t(s?{id:s,type:"nodes"}:null)},label:"item",placeholder:"Search nodes..."})},EH=({...e})=>S.jsx(SH,{...e});function _H({fetcher:e,preload:t,filterFn:n,renderOption:r,getOptionValue:i,getDisplayValue:o,notFound:s,loadingSkeleton:u,label:f,placeholder:d="Select...",value:p,onChange:m,disabled:v=!1,className:g,triggerClassName:w,searchInputClassName:x,noResultsMessage:k,triggerTooltip:C,clearable:_=!0}){const[T,N]=E.useState(!1),[D,z]=E.useState(!1),[R,B]=E.useState([]),[P,j]=E.useState(!1),[V,q]=E.useState(null),[I,Y]=E.useState(p),[Z,U]=E.useState(null),[G,F]=E.useState(""),K=jy(G,t?0:150),[A,$]=E.useState([]);E.useEffect(()=>{N(!0),Y(p)},[p]),E.useEffect(()=>{if(p&&R.length>0){const O=R.find(X=>i(X)===p);O&&U(O)}},[p,R,i]),E.useEffect(()=>{T||(async()=>{try{j(!0),q(null);const X=await e(p);$(X),B(X)}catch(X){q(X instanceof Error?X.message:"Failed to fetch options")}finally{j(!1)}})()},[T,e,p]),E.useEffect(()=>{const O=async()=>{try{j(!0),q(null);const X=await e(K);$(X),B(X)}catch(X){q(X instanceof Error?X.message:"Failed to fetch options")}finally{j(!1)}};T&&t?t&&B(K?A.filter(X=>n?n(X,K):!0):A):O()},[e,K,T,t,n]);const M=E.useCallback(O=>{const X=_&&O===I?"":O;Y(X),U(R.find(re=>i(re)===X)||null),m(X),z(!1)},[I,m,_,R,i]);return S.jsxs(fd,{open:D,onOpenChange:z,children:[S.jsx(dd,{asChild:!0,children:S.jsxs(Ot,{variant:"outline",role:"combobox","aria-expanded":D,className:Me("justify-between",v&&"cursor-not-allowed opacity-50",w),disabled:v,tooltip:C,side:"bottom",children:[Z?o(Z):d,S.jsx(bM,{className:"opacity-50",size:10})]})}),S.jsx(uu,{className:Me("p-0",g),onCloseAutoFocus:O=>O.preventDefault(),children:S.jsxs(yd,{shouldFilter:!1,children:[S.jsxs("div",{className:"relative w-full border-b",children:[S.jsx(Dy,{placeholder:`Search ${f.toLowerCase()}...`,value:G,onValueChange:O=>{F(O)},className:x}),P&&R.length>0&&S.jsx("div",{className:"absolute top-1/2 right-2 flex -translate-y-1/2 transform items-center",children:S.jsx(Sk,{className:"h-4 w-4 animate-spin"})})]}),S.jsxs(bd,{children:[V&&S.jsx("div",{className:"text-destructive p-4 text-center",children:V}),P&&R.length===0&&(u||S.jsx(kH,{})),!P&&!V&&R.length===0&&(s||S.jsx(Ny,{children:k??`No ${f.toLowerCase()} found.`})),S.jsx(Cl,{children:R.map(O=>S.jsxs(Tl,{value:i(O),onSelect:M,className:"truncate",children:[r(O),S.jsx(Lv,{className:Me("ml-auto h-3 w-3",I===i(O)?"opacity-100":"opacity-0")})]},i(O)))})]})]})})]})}function kH(){return S.jsx(Cl,{children:S.jsx(Tl,{disabled:!0,children:S.jsxs("div",{className:"flex w-full items-center gap-2",children:[S.jsx("div",{className:"bg-muted h-6 w-6 animate-pulse rounded-full"}),S.jsxs("div",{className:"flex flex-1 flex-col gap-1",children:[S.jsx("div",{className:"bg-muted h-4 w-24 animate-pulse rounded"}),S.jsx("div",{className:"bg-muted h-3 w-16 animate-pulse rounded"})]})]})})})}const CH=()=>{const e=Qe.use.queryLabel(),[t,n]=E.useState({labels:[],searchEngine:null}),[r,i]=E.useState(!1),o=E.useCallback(async u=>{let f=t.labels,d=t.searchEngine;if(!r||!d){f=["*"].concat(await rM()),f.includes(Qe.getState().queryLabel)||Qe.getState().setQueryLabel(f[0]),d=new sa({idField:"id",fields:["value"],searchOptions:{prefix:!0,fuzzy:.2,boost:{label:2}}});const p=f.map((m,v)=>({id:v,value:m}));d.addAll(p),n({labels:f,searchEngine:d}),i(!0)}return u?d.search(u).map(p=>f[p.id]):f},[t,r,n,i]),s=E.useCallback(u=>{Qe.getState().setQueryLabel(u)},[]);return S.jsx(_H,{className:"ml-2",triggerClassName:"max-h-8",searchInputClassName:"max-h-8",triggerTooltip:"Select query label",fetcher:o,renderOption:u=>S.jsx("div",{children:u}),getOptionValue:u=>u,getDisplayValue:u=>S.jsx("div",{children:u}),notFound:S.jsx("div",{className:"py-6 text-center text-sm",children:"No labels found"}),label:"Label",placeholder:"Search labels...",value:e!==null?e:"",onChange:s})},Ln=({text:e,className:t,tooltipClassName:n,tooltip:r,side:i,onClick:o})=>r?S.jsx(WC,{delayDuration:200,children:S.jsxs(XC,{children:[S.jsx(KC,{asChild:!0,children:S.jsx("label",{className:Me(t,o!==void 0?"cursor-pointer":void 0),onClick:o,children:e})}),S.jsx(ly,{side:i,className:n,children:r})]})}):S.jsx("label",{className:Me(t,o!==void 0?"cursor-pointer":void 0),onClick:o,children:e}),TH=()=>{const{getNode:e,getEdge:t}=JA(),n=yt.use.selectedNode(),r=yt.use.focusedNode(),i=yt.use.selectedEdge(),o=yt.use.focusedEdge(),[s,u]=E.useState(null),[f,d]=E.useState(null);return E.useEffect(()=>{let p=null,m=null;r?(p="node",m=e(r)):n?(p="node",m=e(n)):o?(p="edge",m=t(o,!0)):i&&(p="edge",m=t(i,!0)),m?(p=="node"?u(AH(m)):u(RH(m)),d(p)):(u(null),d(null))},[r,n,o,i,u,d,e,t]),s?S.jsx("div",{className:"bg-background/80 max-w-xs rounded-lg border-2 p-2 text-xs backdrop-blur-lg",children:f=="node"?S.jsx(DH,{node:s}):S.jsx(NH,{edge:s})}):S.jsx(S.Fragment,{})},AH=e=>{const t=yt.getState(),n=[];if(t.sigmaGraph&&t.rawGraph)for(const r of t.sigmaGraph.edges(e.id)){const i=t.rawGraph.getEdge(r,!0);if(i){const o=e.id===i.source,s=o?i.target:i.source,u=t.rawGraph.getNode(s);u&&n.push({type:o?"Target":"Source",id:s,label:u.labels.join(", ")})}}return{...e,relationships:n}},RH=e=>{var i,o;const t=yt.getState(),n=(i=t.rawGraph)==null?void 0:i.getNode(e.source),r=(o=t.rawGraph)==null?void 0:o.getNode(e.target);return{...e,sourceNode:n,targetNode:r}},Ur=({name:e,value:t,onClick:n,tooltip:r})=>S.jsxs("div",{className:"flex items-center gap-2",children:[S.jsx("label",{className:"text-primary/60 tracking-wide",children:e}),":",S.jsx(Ln,{className:"hover:bg-primary/20 rounded p-1 text-ellipsis",tooltipClassName:"max-w-80",text:t,tooltip:r||t,side:"left",onClick:n})]}),DH=({node:e})=>S.jsxs("div",{className:"flex flex-col gap-2",children:[S.jsx("label",{className:"text-md pl-1 font-bold tracking-wide text-sky-300",children:"Node"}),S.jsxs("div",{className:"bg-primary/5 max-h-96 overflow-auto rounded p-1",children:[S.jsx(Ur,{name:"Id",value:e.id}),S.jsx(Ur,{name:"Labels",value:e.labels.join(", "),onClick:()=>{yt.getState().setSelectedNode(e.id,!0)}}),S.jsx(Ur,{name:"Degree",value:e.degree})]}),S.jsx("label",{className:"text-md pl-1 font-bold tracking-wide text-yellow-400/90",children:"Properties"}),S.jsx("div",{className:"bg-primary/5 max-h-96 overflow-auto rounded p-1",children:Object.keys(e.properties).sort().map(t=>S.jsx(Ur,{name:t,value:e.properties[t]},t))}),e.relationships.length>0&&S.jsxs(S.Fragment,{children:[S.jsx("label",{className:"text-md pl-1 font-bold tracking-wide text-teal-600/90",children:"Relationships"}),S.jsx("div",{className:"bg-primary/5 max-h-96 overflow-auto rounded p-1",children:e.relationships.map(({type:t,id:n,label:r})=>S.jsx(Ur,{name:t,value:r,onClick:()=>{yt.getState().setSelectedNode(n,!0)}},n))})]})]}),NH=({edge:e})=>S.jsxs("div",{className:"flex flex-col gap-2",children:[S.jsx("label",{className:"text-md pl-1 font-bold tracking-wide text-teal-600",children:"Relationship"}),S.jsxs("div",{className:"bg-primary/5 max-h-96 overflow-auto rounded p-1",children:[S.jsx(Ur,{name:"Id",value:e.id}),e.type&&S.jsx(Ur,{name:"Type",value:e.type}),S.jsx(Ur,{name:"Source",value:e.sourceNode?e.sourceNode.labels.join(", "):e.source,onClick:()=>{yt.getState().setSelectedNode(e.source,!0)}}),S.jsx(Ur,{name:"Target",value:e.targetNode?e.targetNode.labels.join(", "):e.target,onClick:()=>{yt.getState().setSelectedNode(e.target,!0)}})]}),S.jsx("label",{className:"text-md pl-1 font-bold tracking-wide text-yellow-400/90",children:"Properties"}),S.jsx("div",{className:"bg-primary/5 max-h-96 overflow-auto rounded p-1",children:Object.keys(e.properties).sort().map(t=>S.jsx(Ur,{name:t,value:e.properties[t]},t))})]}),hE={allowInvalidContainer:!0,defaultNodeType:"default",defaultEdgeType:"curvedArrow",renderEdgeLabels:!1,edgeProgramClasses:{arrow:fA,curvedArrow:tU,curvedNoArrow:eU},nodeProgramClasses:{default:PB,circel:fu,point:fB},labelGridCellSize:60,labelRenderedSizeThreshold:12,enableEdgeEvents:!0,labelColor:{color:"#000",attribute:"labelColor"},edgeLabelColor:{color:"#000",attribute:"labelColor"},edgeLabelSize:8,labelSize:12},OH=()=>{const e=bA(),t=pr(),[n,r]=E.useState(null);return E.useEffect(()=>{e({downNode:i=>{r(i.node),t.getGraph().setNodeAttribute(i.node,"highlighted",!0)},mousemovebody:i=>{if(!n)return;const o=t.viewportToGraph(i);t.getGraph().setNodeAttribute(n,"x",o.x),t.getGraph().setNodeAttribute(n,"y",o.y),i.preventSigmaDefault(),i.original.preventDefault(),i.original.stopPropagation()},mouseup:()=>{n&&(r(null),t.getGraph().removeNodeAttribute(n,"highlighted"))},mousedown:()=>{t.getCustomBBox()||t.setCustomBBox(t.getBBox())}})},[e,t,n]),null},LH=()=>{const[e,t]=E.useState(hE),n=yt.use.selectedNode(),r=yt.use.focusedNode(),i=yt.use.moveToSelectedNode(),o=Qe.use.showPropertyPanel(),s=Qe.use.showNodeSearchBar(),u=Qe.use.showNodeLabel(),f=Qe.use.enableEdgeEvents(),d=Qe.use.enableNodeDrag(),p=Qe.use.showEdgeLabel();E.useEffect(()=>{t({...hE,enableEdgeEvents:f,renderEdgeLabels:p,renderLabels:u})},[u,f,p]);const m=E.useCallback(x=>{x===null?yt.getState().setFocusedNode(null):x.type==="nodes"&&yt.getState().setFocusedNode(x.id)},[]),v=E.useCallback(x=>{x===null?yt.getState().setSelectedNode(null):x.type==="nodes"&&yt.getState().setSelectedNode(x.id,!0)},[]),g=E.useMemo(()=>r??n,[r,n]),w=E.useMemo(()=>n?{type:"nodes",id:n}:null,[n]);return S.jsxs(aB,{settings:e,className:"!bg-background !size-full overflow-hidden",children:[S.jsx(q6,{}),d&&S.jsx(OH,{}),S.jsx(iU,{node:g,move:i}),S.jsxs("div",{className:"absolute top-2 left-2 flex items-start gap-2",children:[S.jsx(CH,{}),s&&S.jsx(EH,{value:w,onFocus:m,onChange:v})]}),S.jsxs("div",{className:"bg-background/60 absolute bottom-2 left-2 flex flex-col rounded-xl border-2 backdrop-blur-lg",children:[S.jsx(rH,{}),S.jsx(Y6,{}),S.jsx(S6,{}),S.jsx(W6,{})]}),o&&S.jsx("div",{className:"absolute top-2 right-2",children:S.jsx(TH,{})})]})},mR=E.forwardRef(({className:e,...t},n)=>S.jsx("div",{className:"relative w-full overflow-auto",children:S.jsx("table",{ref:n,className:Me("w-full caption-bottom text-sm",e),...t})}));mR.displayName="Table";const gR=E.forwardRef(({className:e,...t},n)=>S.jsx("thead",{ref:n,className:Me("[&_tr]:border-b",e),...t}));gR.displayName="TableHeader";const vR=E.forwardRef(({className:e,...t},n)=>S.jsx("tbody",{ref:n,className:Me("[&_tr:last-child]:border-0",e),...t}));vR.displayName="TableBody";const zH=E.forwardRef(({className:e,...t},n)=>S.jsx("tfoot",{ref:n,className:Me("bg-muted/50 border-t font-medium [&>tr]:last:border-b-0",e),...t}));zH.displayName="TableFooter";const tv=E.forwardRef(({className:e,...t},n)=>S.jsx("tr",{ref:n,className:Me("hover:bg-muted/50 data-[state=selected]:bg-muted border-b transition-colors",e),...t}));tv.displayName="TableRow";const bi=E.forwardRef(({className:e,...t},n)=>S.jsx("th",{ref:n,className:Me("text-muted-foreground h-10 px-2 text-left align-middle font-medium [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...t}));bi.displayName="TableHead";const xi=E.forwardRef(({className:e,...t},n)=>S.jsx("td",{ref:n,className:Me("p-2 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...t}));xi.displayName="TableCell";const jH=E.forwardRef(({className:e,...t},n)=>S.jsx("caption",{ref:n,className:Me("text-muted-foreground mt-4 text-sm",e),...t}));jH.displayName="TableCaption";const Ks=E.forwardRef(({className:e,...t},n)=>S.jsx("div",{ref:n,className:Me("bg-card text-card-foreground rounded-xl border shadow",e),...t}));Ks.displayName="Card";const Nf=E.forwardRef(({className:e,...t},n)=>S.jsx("div",{ref:n,className:Me("flex flex-col space-y-1.5 p-6",e),...t}));Nf.displayName="CardHeader";const Zs=E.forwardRef(({className:e,...t},n)=>S.jsx("div",{ref:n,className:Me("leading-none font-semibold tracking-tight",e),...t}));Zs.displayName="CardTitle";const xd=E.forwardRef(({className:e,...t},n)=>S.jsx("div",{ref:n,className:Me("text-muted-foreground text-sm",e),...t}));xd.displayName="CardDescription";const Of=E.forwardRef(({className:e,...t},n)=>S.jsx("div",{ref:n,className:Me("p-6 pt-0",e),...t}));Of.displayName="CardContent";const MH=E.forwardRef(({className:e,...t},n)=>S.jsx("div",{ref:n,className:Me("flex items-center p-6 pt-0",e),...t}));MH.displayName="CardFooter";function PH({title:e,description:t,icon:n=CM,action:r,className:i,...o}){return S.jsxs(Ks,{className:Me("flex w-full flex-col items-center justify-center space-y-6 bg-transparent p-16",i),...o,children:[S.jsx("div",{className:"mr-4 shrink-0 rounded-full border border-dashed p-4",children:S.jsx(n,{className:"text-muted-foreground size-8","aria-hidden":"true"})}),S.jsxs("div",{className:"flex flex-col items-center gap-1.5 text-center",children:[S.jsx(Zs,{children:e}),t?S.jsx(xd,{children:t}):null]}),r||null]})}var Xm={exports:{}},Km,pE;function FH(){if(pE)return Km;pE=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return Km=e,Km}var Zm,mE;function IH(){if(mE)return Zm;mE=1;var e=FH();function t(){}function n(){}return n.resetWarningCache=t,Zm=function(){function r(s,u,f,d,p,m){if(m!==e){var v=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw v.name="Invariant Violation",v}}r.isRequired=r;function i(){return r}var o={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:i,element:r,elementType:r,instanceOf:i,node:r,objectOf:i,oneOf:i,oneOfType:i,shape:i,exact:i,checkPropTypes:n,resetWarningCache:t};return o.PropTypes=o,o},Zm}var gE;function GH(){return gE||(gE=1,Xm.exports=IH()()),Xm.exports}var BH=GH();const Ct=fn(BH),UH=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 dl(e,t,n){const r=HH(e),{webkitRelativePath:i}=e,o=typeof t=="string"?t:typeof i=="string"&&i.length>0?i:`./${e.name}`;return typeof r.path!="string"&&vE(r,"path",o),vE(r,"relativePath",o),r}function HH(e){const{name:t}=e;if(t&&t.lastIndexOf(".")!==-1&&!e.type){const r=t.split(".").pop().toLowerCase(),i=UH.get(r);i&&Object.defineProperty(e,"type",{value:i,writable:!1,configurable:!1,enumerable:!0})}return e}function vE(e,t,n){Object.defineProperty(e,t,{value:n,writable:!1,configurable:!1,enumerable:!0})}const $H=[".DS_Store","Thumbs.db"];function VH(e){return no(this,void 0,void 0,function*(){return Lf(e)&&qH(e.dataTransfer)?KH(e.dataTransfer,e.type):YH(e)?WH(e):Array.isArray(e)&&e.every(t=>"getFile"in t&&typeof t.getFile=="function")?XH(e):[]})}function qH(e){return Lf(e)}function YH(e){return Lf(e)&&Lf(e.target)}function Lf(e){return typeof e=="object"&&e!==null}function WH(e){return nv(e.target.files).map(t=>dl(t))}function XH(e){return no(this,void 0,void 0,function*(){return(yield Promise.all(e.map(n=>n.getFile()))).map(n=>dl(n))})}function KH(e,t){return no(this,void 0,void 0,function*(){if(e.items){const n=nv(e.items).filter(i=>i.kind==="file");if(t!=="drop")return n;const r=yield Promise.all(n.map(ZH));return yE(yR(r))}return yE(nv(e.files).map(n=>dl(n)))})}function yE(e){return e.filter(t=>$H.indexOf(t.name)===-1)}function nv(e){if(e===null)return[];const t=[];for(let n=0;n[...t,...Array.isArray(n)?yR(n):[n]],[])}function bE(e,t){return no(this,void 0,void 0,function*(){var n;if(globalThis.isSecureContext&&typeof e.getAsFileSystemHandle=="function"){const o=yield e.getAsFileSystemHandle();if(o===null)throw new Error(`${e} is not a File`);if(o!==void 0){const s=yield o.getFile();return s.handle=o,dl(s)}}const r=e.getAsFile();if(!r)throw new Error(`${e} is not a File`);return dl(r,(n=t==null?void 0:t.fullPath)!==null&&n!==void 0?n:void 0)})}function QH(e){return no(this,void 0,void 0,function*(){return e.isDirectory?bR(e):JH(e)})}function bR(e){const t=e.createReader();return new Promise((n,r)=>{const i=[];function o(){t.readEntries(s=>no(this,void 0,void 0,function*(){if(s.length){const u=Promise.all(s.map(QH));i.push(u),o()}else try{const u=yield Promise.all(i);n(u)}catch(u){r(u)}}),s=>{r(s)})}o()})}function JH(e){return no(this,void 0,void 0,function*(){return new Promise((t,n)=>{e.file(r=>{const i=dl(r,e.fullPath);t(i)},r=>{n(r)})})})}var Xc={},xE;function e$(){return xE||(xE=1,Xc.__esModule=!0,Xc.default=function(e,t){if(e&&t){var n=Array.isArray(t)?t:t.split(",");if(n.length===0)return!0;var r=e.name||"",i=(e.type||"").toLowerCase(),o=i.replace(/\/.*$/,"");return n.some(function(s){var u=s.trim().toLowerCase();return u.charAt(0)==="."?r.toLowerCase().endsWith(u):u.endsWith("/*")?o===u.replace(/\/.*$/,""):i===u})}return!0}),Xc}var t$=e$();const Qm=fn(t$);function wE(e){return i$(e)||r$(e)||wR(e)||n$()}function n$(){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 r$(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function i$(e){if(Array.isArray(e))return rv(e)}function SE(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function EE(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&arguments[0]!==void 0?arguments[0]:"",n=t.split(","),r=n.length>1?"one of ".concat(n.join(", ")):n[0];return{code:u$,message:"File type must be ".concat(r)}},_E=function(t){return{code:c$,message:"File is larger than ".concat(t," ").concat(t===1?"byte":"bytes")}},kE=function(t){return{code:f$,message:"File is smaller than ".concat(t," ").concat(t===1?"byte":"bytes")}},p$={code:d$,message:"Too many files"};function SR(e,t){var n=e.type==="application/x-moz-file"||s$(e,t);return[n,n?null:h$(t)]}function ER(e,t,n){if($a(e.size))if($a(t)&&$a(n)){if(e.size>n)return[!1,_E(n)];if(e.sizen)return[!1,_E(n)]}return[!0,null]}function $a(e){return e!=null}function m$(e){var t=e.files,n=e.accept,r=e.minSize,i=e.maxSize,o=e.multiple,s=e.maxFiles,u=e.validator;return!o&&t.length>1||o&&s>=1&&t.length>s?!1:t.every(function(f){var d=SR(f,n),p=Qs(d,1),m=p[0],v=ER(f,r,i),g=Qs(v,1),w=g[0],x=u?u(f):null;return m&&w&&!x})}function zf(e){return typeof e.isPropagationStopped=="function"?e.isPropagationStopped():typeof e.cancelBubble<"u"?e.cancelBubble:!1}function Kc(e){return e.dataTransfer?Array.prototype.some.call(e.dataTransfer.types,function(t){return t==="Files"||t==="application/x-moz-file"}):!!e.target&&!!e.target.files}function CE(e){e.preventDefault()}function g$(e){return e.indexOf("MSIE")!==-1||e.indexOf("Trident/")!==-1}function v$(e){return e.indexOf("Edge/")!==-1}function y$(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:window.navigator.userAgent;return g$(e)||v$(e)}function Ir(){for(var e=arguments.length,t=new Array(e),n=0;n1?i-1:0),s=1;se.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function j$(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,o;for(o=0;o=0)&&(n[i]=e[i]);return n}var wd=E.forwardRef(function(e,t){var n=e.children,r=jf(e,_$),i=M$(r),o=i.open,s=jf(i,k$);return E.useImperativeHandle(t,function(){return{open:o}},[o]),be.createElement(E.Fragment,null,n(jt(jt({},s),{},{open:o})))});wd.displayName="Dropzone";var TR={disabled:!1,getFilesFromEvent:VH,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};wd.defaultProps=TR;wd.propTypes={children:Ct.func,accept:Ct.objectOf(Ct.arrayOf(Ct.string)),multiple:Ct.bool,preventDropOnDocument:Ct.bool,noClick:Ct.bool,noKeyboard:Ct.bool,noDrag:Ct.bool,noDragEventsBubbling:Ct.bool,minSize:Ct.number,maxSize:Ct.number,maxFiles:Ct.number,disabled:Ct.bool,getFilesFromEvent:Ct.func,onFileDialogCancel:Ct.func,onFileDialogOpen:Ct.func,useFsAccessApi:Ct.bool,autoFocus:Ct.bool,onDragEnter:Ct.func,onDragLeave:Ct.func,onDragOver:Ct.func,onDrop:Ct.func,onDropAccepted:Ct.func,onDropRejected:Ct.func,onError:Ct.func,validator:Ct.func};var ov={isFocused:!1,isFileDialogActive:!1,isDragActive:!1,isDragAccept:!1,isDragReject:!1,acceptedFiles:[],fileRejections:[]};function M$(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=jt(jt({},TR),e),n=t.accept,r=t.disabled,i=t.getFilesFromEvent,o=t.maxSize,s=t.minSize,u=t.multiple,f=t.maxFiles,d=t.onDragEnter,p=t.onDragLeave,m=t.onDragOver,v=t.onDrop,g=t.onDropAccepted,w=t.onDropRejected,x=t.onFileDialogCancel,k=t.onFileDialogOpen,C=t.useFsAccessApi,_=t.autoFocus,T=t.preventDropOnDocument,N=t.noClick,D=t.noKeyboard,z=t.noDrag,R=t.noDragEventsBubbling,B=t.onError,P=t.validator,j=E.useMemo(function(){return w$(n)},[n]),V=E.useMemo(function(){return x$(n)},[n]),q=E.useMemo(function(){return typeof k=="function"?k:AE},[k]),I=E.useMemo(function(){return typeof x=="function"?x:AE},[x]),Y=E.useRef(null),Z=E.useRef(null),U=E.useReducer(P$,ov),G=Jm(U,2),F=G[0],K=G[1],A=F.isFocused,$=F.isFileDialogActive,M=E.useRef(typeof window<"u"&&window.isSecureContext&&C&&b$()),O=function(){!M.current&&$&&setTimeout(function(){if(Z.current){var Ne=Z.current.files;Ne.length||(K({type:"closeDialog"}),I())}},300)};E.useEffect(function(){return window.addEventListener("focus",O,!1),function(){window.removeEventListener("focus",O,!1)}},[Z,$,I,M]);var X=E.useRef([]),re=function(Ne){Y.current&&Y.current.contains(Ne.target)||(Ne.preventDefault(),X.current=[])};E.useEffect(function(){return T&&(document.addEventListener("dragover",CE,!1),document.addEventListener("drop",re,!1)),function(){T&&(document.removeEventListener("dragover",CE),document.removeEventListener("drop",re))}},[Y,T]),E.useEffect(function(){return!r&&_&&Y.current&&Y.current.focus(),function(){}},[Y,_,r]);var ue=E.useCallback(function(ve){B?B(ve):console.error(ve)},[B]),ae=E.useCallback(function(ve){ve.preventDefault(),ve.persist(),Se(ve),X.current=[].concat(A$(X.current),[ve.target]),Kc(ve)&&Promise.resolve(i(ve)).then(function(Ne){if(!(zf(ve)&&!R)){var te=Ne.length,de=te>0&&m$({files:Ne,accept:j,minSize:s,maxSize:o,multiple:u,maxFiles:f,validator:P}),Oe=te>0&&!de;K({isDragAccept:de,isDragReject:Oe,isDragActive:!0,type:"setDraggedFiles"}),d&&d(ve)}}).catch(function(Ne){return ue(Ne)})},[i,d,ue,R,j,s,o,u,f,P]),oe=E.useCallback(function(ve){ve.preventDefault(),ve.persist(),Se(ve);var Ne=Kc(ve);if(Ne&&ve.dataTransfer)try{ve.dataTransfer.dropEffect="copy"}catch{}return Ne&&m&&m(ve),!1},[m,R]),Ce=E.useCallback(function(ve){ve.preventDefault(),ve.persist(),Se(ve);var Ne=X.current.filter(function(de){return Y.current&&Y.current.contains(de)}),te=Ne.indexOf(ve.target);te!==-1&&Ne.splice(te,1),X.current=Ne,!(Ne.length>0)&&(K({type:"setDraggedFiles",isDragActive:!1,isDragAccept:!1,isDragReject:!1}),Kc(ve)&&p&&p(ve))},[Y,p,R]),he=E.useCallback(function(ve,Ne){var te=[],de=[];ve.forEach(function(Oe){var $e=SR(Oe,j),Ye=Jm($e,2),vt=Ye[0],Mt=Ye[1],bt=ER(Oe,s,o),rt=Jm(bt,2),qt=rt[0],at=rt[1],At=P?P(Oe):null;if(vt&&qt&&!At)te.push(Oe);else{var rn=[Mt,at];At&&(rn=rn.concat(At)),de.push({file:Oe,errors:rn.filter(function(io){return io})})}}),(!u&&te.length>1||u&&f>=1&&te.length>f)&&(te.forEach(function(Oe){de.push({file:Oe,errors:[p$]})}),te.splice(0)),K({acceptedFiles:te,fileRejections:de,isDragReject:de.length>0,type:"setFiles"}),v&&v(te,de,Ne),de.length>0&&w&&w(de,Ne),te.length>0&&g&&g(te,Ne)},[K,u,j,s,o,f,v,g,w,P]),Ee=E.useCallback(function(ve){ve.preventDefault(),ve.persist(),Se(ve),X.current=[],Kc(ve)&&Promise.resolve(i(ve)).then(function(Ne){zf(ve)&&!R||he(Ne,ve)}).catch(function(Ne){return ue(Ne)}),K({type:"reset"})},[i,he,ue,R]),we=E.useCallback(function(){if(M.current){K({type:"openDialog"}),q();var ve={multiple:u,types:V};window.showOpenFilePicker(ve).then(function(Ne){return i(Ne)}).then(function(Ne){he(Ne,null),K({type:"closeDialog"})}).catch(function(Ne){S$(Ne)?(I(Ne),K({type:"closeDialog"})):E$(Ne)?(M.current=!1,Z.current?(Z.current.value=null,Z.current.click()):ue(new Error("Cannot open the file picker because the https://developer.mozilla.org/en-US/docs/Web/API/File_System_Access_API is not supported and no was provided."))):ue(Ne)});return}Z.current&&(K({type:"openDialog"}),q(),Z.current.value=null,Z.current.click())},[K,q,I,C,he,ue,V,u]),Pe=E.useCallback(function(ve){!Y.current||!Y.current.isEqualNode(ve.target)||(ve.key===" "||ve.key==="Enter"||ve.keyCode===32||ve.keyCode===13)&&(ve.preventDefault(),we())},[Y,we]),Ae=E.useCallback(function(){K({type:"focus"})},[]),xe=E.useCallback(function(){K({type:"blur"})},[]),ee=E.useCallback(function(){N||(y$()?setTimeout(we,0):we())},[N,we]),ce=function(Ne){return r?null:Ne},Te=function(Ne){return D?null:ce(Ne)},ge=function(Ne){return z?null:ce(Ne)},Se=function(Ne){R&&Ne.stopPropagation()},ie=E.useMemo(function(){return function(){var ve=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},Ne=ve.refKey,te=Ne===void 0?"ref":Ne,de=ve.role,Oe=ve.onKeyDown,$e=ve.onFocus,Ye=ve.onBlur,vt=ve.onClick,Mt=ve.onDragEnter,bt=ve.onDragOver,rt=ve.onDragLeave,qt=ve.onDrop,at=jf(ve,C$);return jt(jt(av({onKeyDown:Te(Ir(Oe,Pe)),onFocus:Te(Ir($e,Ae)),onBlur:Te(Ir(Ye,xe)),onClick:ce(Ir(vt,ee)),onDragEnter:ge(Ir(Mt,ae)),onDragOver:ge(Ir(bt,oe)),onDragLeave:ge(Ir(rt,Ce)),onDrop:ge(Ir(qt,Ee)),role:typeof de=="string"&&de!==""?de:"presentation"},te,Y),!r&&!D?{tabIndex:0}:{}),at)}},[Y,Pe,Ae,xe,ee,ae,oe,Ce,Ee,D,z,r]),He=E.useCallback(function(ve){ve.stopPropagation()},[]),Ge=E.useMemo(function(){return function(){var ve=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},Ne=ve.refKey,te=Ne===void 0?"ref":Ne,de=ve.onChange,Oe=ve.onClick,$e=jf(ve,T$),Ye=av({accept:j,multiple:u,type:"file",style:{border:0,clip:"rect(0, 0, 0, 0)",clipPath:"inset(50%)",height:"1px",margin:"0 -1px -1px 0",overflow:"hidden",padding:0,position:"absolute",width:"1px",whiteSpace:"nowrap"},onChange:ce(Ir(de,Ee)),onClick:ce(Ir(Oe,He)),tabIndex:-1},te,Z);return jt(jt({},Ye),$e)}},[Z,n,u,Ee,r]);return jt(jt({},F),{},{isFocused:A&&!r,getRootProps:ie,getInputProps:Ge,rootRef:Y,inputRef:Z,open:ce(we)})}function P$(e,t){switch(t.type){case"focus":return jt(jt({},e),{},{isFocused:!0});case"blur":return jt(jt({},e),{},{isFocused:!1});case"openDialog":return jt(jt({},ov),{},{isFileDialogActive:!0});case"closeDialog":return jt(jt({},e),{},{isFileDialogActive:!1});case"setDraggedFiles":return jt(jt({},e),{},{isDragActive:t.isDragActive,isDragAccept:t.isDragAccept,isDragReject:t.isDragReject});case"setFiles":return jt(jt({},e),{},{acceptedFiles:t.acceptedFiles,fileRejections:t.fileRejections,isDragReject:t.isDragReject});case"reset":return jt({},ov);default:return e}}function AE(){}var My="Progress",Py=100,[F$,mK]=hr(My),[I$,G$]=F$(My),AR=E.forwardRef((e,t)=>{const{__scopeProgress:n,value:r=null,max:i,getValueLabel:o=B$,...s}=e;(i||i===0)&&!RE(i)&&console.error(U$(`${i}`,"Progress"));const u=RE(i)?i:Py;r!==null&&!DE(r,u)&&console.error(H$(`${r}`,"Progress"));const f=DE(r,u)?r:null,d=Mf(f)?o(f,u):void 0;return S.jsx(I$,{scope:n,value:f,max:u,children:S.jsx(We.div,{"aria-valuemax":u,"aria-valuemin":0,"aria-valuenow":Mf(f)?f:void 0,"aria-valuetext":d,role:"progressbar","data-state":NR(f,u),"data-value":f??void 0,"data-max":u,...s,ref:t})})});AR.displayName=My;var RR="ProgressIndicator",DR=E.forwardRef((e,t)=>{const{__scopeProgress:n,...r}=e,i=G$(RR,n);return S.jsx(We.div,{"data-state":NR(i.value,i.max),"data-value":i.value??void 0,"data-max":i.max,...r,ref:t})});DR.displayName=RR;function B$(e,t){return`${Math.round(e/t*100)}%`}function NR(e,t){return e==null?"indeterminate":e===t?"complete":"loading"}function Mf(e){return typeof e=="number"}function RE(e){return Mf(e)&&!isNaN(e)&&e>0}function DE(e,t){return Mf(e)&&!isNaN(e)&&e<=t&&e>=0}function U$(e,t){return`Invalid prop \`max\` of value \`${e}\` supplied to \`${t}\`. Only numbers greater than 0 are valid max values. Defaulting to \`${Py}\`.`}function H$(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 ${Py} if no \`max\` prop is set) - - \`null\` or \`undefined\` if the progress is indeterminate. - -Defaulting to \`null\`.`}var OR=AR,$$=DR;const LR=E.forwardRef(({className:e,value:t,...n},r)=>S.jsx(OR,{ref:r,className:Me("bg-secondary relative h-4 w-full overflow-hidden rounded-full",e),...n,children:S.jsx($$,{className:"bg-primary h-full w-full flex-1 transition-all",style:{transform:`translateX(-${100-(t||0)}%)`}})}));LR.displayName=OR.displayName;function lv(e,[t,n]){return Math.min(n,Math.max(t,e))}function V$(e,t){return E.useReducer((n,r)=>t[n][r]??n,e)}var Fy="ScrollArea",[zR,gK]=hr(Fy),[q$,mr]=zR(Fy),jR=E.forwardRef((e,t)=>{const{__scopeScrollArea:n,type:r="hover",dir:i,scrollHideDelay:o=600,...s}=e,[u,f]=E.useState(null),[d,p]=E.useState(null),[m,v]=E.useState(null),[g,w]=E.useState(null),[x,k]=E.useState(null),[C,_]=E.useState(0),[T,N]=E.useState(0),[D,z]=E.useState(!1),[R,B]=E.useState(!1),P=dt(t,V=>f(V)),j=hd(i);return S.jsx(q$,{scope:n,type:r,dir:j,scrollHideDelay:o,scrollArea:u,viewport:d,onViewportChange:p,content:m,onContentChange:v,scrollbarX:g,onScrollbarXChange:w,scrollbarXEnabled:D,onScrollbarXEnabledChange:z,scrollbarY:x,onScrollbarYChange:k,scrollbarYEnabled:R,onScrollbarYEnabledChange:B,onCornerWidthChange:_,onCornerHeightChange:N,children:S.jsx(We.div,{dir:j,...s,ref:P,style:{position:"relative","--radix-scroll-area-corner-width":C+"px","--radix-scroll-area-corner-height":T+"px",...e.style}})})});jR.displayName=Fy;var MR="ScrollAreaViewport",PR=E.forwardRef((e,t)=>{const{__scopeScrollArea:n,children:r,nonce:i,...o}=e,s=mr(MR,n),u=E.useRef(null),f=dt(t,u,s.onViewportChange);return S.jsxs(S.Fragment,{children:[S.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:i}),S.jsx(We.div,{"data-radix-scroll-area-viewport":"",...o,ref:f,style:{overflowX:s.scrollbarXEnabled?"scroll":"hidden",overflowY:s.scrollbarYEnabled?"scroll":"hidden",...e.style},children:S.jsx("div",{ref:s.onContentChange,style:{minWidth:"100%",display:"table"},children:r})})]})});PR.displayName=MR;var Xr="ScrollAreaScrollbar",Iy=E.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=mr(Xr,e.__scopeScrollArea),{onScrollbarXEnabledChange:o,onScrollbarYEnabledChange:s}=i,u=e.orientation==="horizontal";return E.useEffect(()=>(u?o(!0):s(!0),()=>{u?o(!1):s(!1)}),[u,o,s]),i.type==="hover"?S.jsx(Y$,{...r,ref:t,forceMount:n}):i.type==="scroll"?S.jsx(W$,{...r,ref:t,forceMount:n}):i.type==="auto"?S.jsx(FR,{...r,ref:t,forceMount:n}):i.type==="always"?S.jsx(Gy,{...r,ref:t}):null});Iy.displayName=Xr;var Y$=E.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=mr(Xr,e.__scopeScrollArea),[o,s]=E.useState(!1);return E.useEffect(()=>{const u=i.scrollArea;let f=0;if(u){const d=()=>{window.clearTimeout(f),s(!0)},p=()=>{f=window.setTimeout(()=>s(!1),i.scrollHideDelay)};return u.addEventListener("pointerenter",d),u.addEventListener("pointerleave",p),()=>{window.clearTimeout(f),u.removeEventListener("pointerenter",d),u.removeEventListener("pointerleave",p)}}},[i.scrollArea,i.scrollHideDelay]),S.jsx(Zn,{present:n||o,children:S.jsx(FR,{"data-state":o?"visible":"hidden",...r,ref:t})})}),W$=E.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=mr(Xr,e.__scopeScrollArea),o=e.orientation==="horizontal",s=Ed(()=>f("SCROLL_END"),100),[u,f]=V$("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return E.useEffect(()=>{if(u==="idle"){const d=window.setTimeout(()=>f("HIDE"),i.scrollHideDelay);return()=>window.clearTimeout(d)}},[u,i.scrollHideDelay,f]),E.useEffect(()=>{const d=i.viewport,p=o?"scrollLeft":"scrollTop";if(d){let m=d[p];const v=()=>{const g=d[p];m!==g&&(f("SCROLL"),s()),m=g};return d.addEventListener("scroll",v),()=>d.removeEventListener("scroll",v)}},[i.viewport,o,f,s]),S.jsx(Zn,{present:n||u!=="hidden",children:S.jsx(Gy,{"data-state":u==="hidden"?"hidden":"visible",...r,ref:t,onPointerEnter:qe(e.onPointerEnter,()=>f("POINTER_ENTER")),onPointerLeave:qe(e.onPointerLeave,()=>f("POINTER_LEAVE"))})})}),FR=E.forwardRef((e,t)=>{const n=mr(Xr,e.__scopeScrollArea),{forceMount:r,...i}=e,[o,s]=E.useState(!1),u=e.orientation==="horizontal",f=Ed(()=>{if(n.viewport){const d=n.viewport.offsetWidth{const{orientation:n="vertical",...r}=e,i=mr(Xr,e.__scopeScrollArea),o=E.useRef(null),s=E.useRef(0),[u,f]=E.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),d=HR(u.viewport,u.content),p={...r,sizes:u,onSizesChange:f,hasThumb:d>0&&d<1,onThumbChange:v=>o.current=v,onThumbPointerUp:()=>s.current=0,onThumbPointerDown:v=>s.current=v};function m(v,g){return e9(v,s.current,u,g)}return n==="horizontal"?S.jsx(X$,{...p,ref:t,onThumbPositionChange:()=>{if(i.viewport&&o.current){const v=i.viewport.scrollLeft,g=NE(v,u,i.dir);o.current.style.transform=`translate3d(${g}px, 0, 0)`}},onWheelScroll:v=>{i.viewport&&(i.viewport.scrollLeft=v)},onDragScroll:v=>{i.viewport&&(i.viewport.scrollLeft=m(v,i.dir))}}):n==="vertical"?S.jsx(K$,{...p,ref:t,onThumbPositionChange:()=>{if(i.viewport&&o.current){const v=i.viewport.scrollTop,g=NE(v,u);o.current.style.transform=`translate3d(0, ${g}px, 0)`}},onWheelScroll:v=>{i.viewport&&(i.viewport.scrollTop=v)},onDragScroll:v=>{i.viewport&&(i.viewport.scrollTop=m(v))}}):null}),X$=E.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...i}=e,o=mr(Xr,e.__scopeScrollArea),[s,u]=E.useState(),f=E.useRef(null),d=dt(t,f,o.onScrollbarXChange);return E.useEffect(()=>{f.current&&u(getComputedStyle(f.current))},[f]),S.jsx(GR,{"data-orientation":"horizontal",...i,ref:d,sizes:n,style:{bottom:0,left:o.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:o.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":Sd(n)+"px",...e.style},onThumbPointerDown:p=>e.onThumbPointerDown(p.x),onDragScroll:p=>e.onDragScroll(p.x),onWheelScroll:(p,m)=>{if(o.viewport){const v=o.viewport.scrollLeft+p.deltaX;e.onWheelScroll(v),VR(v,m)&&p.preventDefault()}},onResize:()=>{f.current&&o.viewport&&s&&r({content:o.viewport.scrollWidth,viewport:o.viewport.offsetWidth,scrollbar:{size:f.current.clientWidth,paddingStart:Ff(s.paddingLeft),paddingEnd:Ff(s.paddingRight)}})}})}),K$=E.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...i}=e,o=mr(Xr,e.__scopeScrollArea),[s,u]=E.useState(),f=E.useRef(null),d=dt(t,f,o.onScrollbarYChange);return E.useEffect(()=>{f.current&&u(getComputedStyle(f.current))},[f]),S.jsx(GR,{"data-orientation":"vertical",...i,ref:d,sizes:n,style:{top:0,right:o.dir==="ltr"?0:void 0,left:o.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":Sd(n)+"px",...e.style},onThumbPointerDown:p=>e.onThumbPointerDown(p.y),onDragScroll:p=>e.onDragScroll(p.y),onWheelScroll:(p,m)=>{if(o.viewport){const v=o.viewport.scrollTop+p.deltaY;e.onWheelScroll(v),VR(v,m)&&p.preventDefault()}},onResize:()=>{f.current&&o.viewport&&s&&r({content:o.viewport.scrollHeight,viewport:o.viewport.offsetHeight,scrollbar:{size:f.current.clientHeight,paddingStart:Ff(s.paddingTop),paddingEnd:Ff(s.paddingBottom)}})}})}),[Z$,IR]=zR(Xr),GR=E.forwardRef((e,t)=>{const{__scopeScrollArea:n,sizes:r,hasThumb:i,onThumbChange:o,onThumbPointerUp:s,onThumbPointerDown:u,onThumbPositionChange:f,onDragScroll:d,onWheelScroll:p,onResize:m,...v}=e,g=mr(Xr,n),[w,x]=E.useState(null),k=dt(t,P=>x(P)),C=E.useRef(null),_=E.useRef(""),T=g.viewport,N=r.content-r.viewport,D=un(p),z=un(f),R=Ed(m,10);function B(P){if(C.current){const j=P.clientX-C.current.left,V=P.clientY-C.current.top;d({x:j,y:V})}}return E.useEffect(()=>{const P=j=>{const V=j.target;(w==null?void 0:w.contains(V))&&D(j,N)};return document.addEventListener("wheel",P,{passive:!1}),()=>document.removeEventListener("wheel",P,{passive:!1})},[T,w,N,D]),E.useEffect(z,[r,z]),hl(w,R),hl(g.content,R),S.jsx(Z$,{scope:n,scrollbar:w,hasThumb:i,onThumbChange:un(o),onThumbPointerUp:un(s),onThumbPositionChange:z,onThumbPointerDown:un(u),children:S.jsx(We.div,{...v,ref:k,style:{position:"absolute",...v.style},onPointerDown:qe(e.onPointerDown,P=>{P.button===0&&(P.target.setPointerCapture(P.pointerId),C.current=w.getBoundingClientRect(),_.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",g.viewport&&(g.viewport.style.scrollBehavior="auto"),B(P))}),onPointerMove:qe(e.onPointerMove,B),onPointerUp:qe(e.onPointerUp,P=>{const j=P.target;j.hasPointerCapture(P.pointerId)&&j.releasePointerCapture(P.pointerId),document.body.style.webkitUserSelect=_.current,g.viewport&&(g.viewport.style.scrollBehavior=""),C.current=null})})})}),Pf="ScrollAreaThumb",BR=E.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=IR(Pf,e.__scopeScrollArea);return S.jsx(Zn,{present:n||i.hasThumb,children:S.jsx(Q$,{ref:t,...r})})}),Q$=E.forwardRef((e,t)=>{const{__scopeScrollArea:n,style:r,...i}=e,o=mr(Pf,n),s=IR(Pf,n),{onThumbPositionChange:u}=s,f=dt(t,m=>s.onThumbChange(m)),d=E.useRef(void 0),p=Ed(()=>{d.current&&(d.current(),d.current=void 0)},100);return E.useEffect(()=>{const m=o.viewport;if(m){const v=()=>{if(p(),!d.current){const g=t9(m,u);d.current=g,u()}};return u(),m.addEventListener("scroll",v),()=>m.removeEventListener("scroll",v)}},[o.viewport,p,u]),S.jsx(We.div,{"data-state":s.hasThumb?"visible":"hidden",...i,ref:f,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...r},onPointerDownCapture:qe(e.onPointerDownCapture,m=>{const g=m.target.getBoundingClientRect(),w=m.clientX-g.left,x=m.clientY-g.top;s.onThumbPointerDown({x:w,y:x})}),onPointerUp:qe(e.onPointerUp,s.onThumbPointerUp)})});BR.displayName=Pf;var By="ScrollAreaCorner",UR=E.forwardRef((e,t)=>{const n=mr(By,e.__scopeScrollArea),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&r?S.jsx(J$,{...e,ref:t}):null});UR.displayName=By;var J$=E.forwardRef((e,t)=>{const{__scopeScrollArea:n,...r}=e,i=mr(By,n),[o,s]=E.useState(0),[u,f]=E.useState(0),d=!!(o&&u);return hl(i.scrollbarX,()=>{var m;const p=((m=i.scrollbarX)==null?void 0:m.offsetHeight)||0;i.onCornerHeightChange(p),f(p)}),hl(i.scrollbarY,()=>{var m;const p=((m=i.scrollbarY)==null?void 0:m.offsetWidth)||0;i.onCornerWidthChange(p),s(p)}),d?S.jsx(We.div,{...r,ref:t,style:{width:o,height:u,position:"absolute",right:i.dir==="ltr"?0:void 0,left:i.dir==="rtl"?0:void 0,bottom:0,...e.style}}):null});function Ff(e){return e?parseInt(e,10):0}function HR(e,t){const n=e/t;return isNaN(n)?0:n}function Sd(e){const t=HR(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function e9(e,t,n,r="ltr"){const i=Sd(n),o=i/2,s=t||o,u=i-s,f=n.scrollbar.paddingStart+s,d=n.scrollbar.size-n.scrollbar.paddingEnd-u,p=n.content-n.viewport,m=r==="ltr"?[0,p]:[p*-1,0];return $R([f,d],m)(e)}function NE(e,t,n="ltr"){const r=Sd(t),i=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,o=t.scrollbar.size-i,s=t.content-t.viewport,u=o-r,f=n==="ltr"?[0,s]:[s*-1,0],d=lv(e,f);return $R([0,s],[0,u])(d)}function $R(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}function VR(e,t){return e>0&&e{})=>{let n={left:e.scrollLeft,top:e.scrollTop},r=0;return function i(){const o={left:e.scrollLeft,top:e.scrollTop},s=n.left!==o.left,u=n.top!==o.top;(s||u)&&t(),n=o,r=window.requestAnimationFrame(i)}(),()=>window.cancelAnimationFrame(r)};function Ed(e,t){const n=un(e),r=E.useRef(0);return E.useEffect(()=>()=>window.clearTimeout(r.current),[]),E.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(n,t)},[n,t])}function hl(e,t){const n=un(t);xn(()=>{let r=0;if(e){const i=new ResizeObserver(()=>{cancelAnimationFrame(r),r=window.requestAnimationFrame(n)});return i.observe(e),()=>{window.cancelAnimationFrame(r),i.unobserve(e)}}},[e,n])}var qR=jR,n9=PR,r9=UR;const YR=E.forwardRef(({className:e,children:t,...n},r)=>S.jsxs(qR,{ref:r,className:Me("relative overflow-hidden",e),...n,children:[S.jsx(n9,{className:"h-full w-full rounded-[inherit]",children:t}),S.jsx(WR,{}),S.jsx(r9,{})]}));YR.displayName=qR.displayName;const WR=E.forwardRef(({className:e,orientation:t="vertical",...n},r)=>S.jsx(Iy,{ref:r,orientation:t,className:Me("flex touch-none transition-colors select-none",t==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-[1px]",t==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",e),...n,children:S.jsx(BR,{className:"bg-border relative flex-1 rounded-full"})}));WR.displayName=Iy.displayName;function sv(e,t={}){const{decimals:n=0,sizeType:r="normal"}=t,i=["Bytes","KB","MB","GB","TB"],o=["Bytes","KiB","MiB","GiB","TiB"];if(e===0)return"0 Byte";const s=Math.floor(Math.log(e)/Math.log(1024));return`${(e/Math.pow(1024,s)).toFixed(n)} ${r==="accurate"?o[s]??"Bytes":i[s]??"Bytes"}`}function i9(e){const{value:t,onValueChange:n,onUpload:r,progresses:i,accept:o=wz,maxSize:s=1024*1024*200,maxFileCount:u=1,multiple:f=!1,disabled:d=!1,description:p,className:m,...v}=e,[g,w]=_i({prop:t,onChange:n}),x=E.useCallback((_,T)=>{if(!f&&u===1&&_.length>1){vn.error("Cannot upload more than 1 file at a time");return}if(((g==null?void 0:g.length)??0)+_.length>u){vn.error(`Cannot upload more than ${u} files`);return}const N=_.map(z=>Object.assign(z,{preview:URL.createObjectURL(z)})),D=g?[...g,...N]:N;if(w(D),T.length>0&&T.forEach(({file:z})=>{vn.error(`File ${z.name} was rejected`)}),r&&D.length>0&&D.length<=u){const z=D.length>0?`${D.length} files`:"file";vn.promise(r(D),{loading:`Uploading ${z}...`,success:()=>(w([]),`${z} uploaded`),error:`Failed to upload ${z}`})}},[g,u,f,r,w]);function k(_){if(!g)return;const T=g.filter((N,D)=>D!==_);w(T),n==null||n(T)}E.useEffect(()=>()=>{g&&g.forEach(_=>{XR(_)&&URL.revokeObjectURL(_.preview)})},[]);const C=d||((g==null?void 0:g.length)??0)>=u;return S.jsxs("div",{className:"relative flex flex-col gap-6 overflow-hidden",children:[S.jsx(wd,{onDrop:x,accept:o,maxSize:s,maxFiles:u,multiple:u>1||f,disabled:C,children:({getRootProps:_,getInputProps:T,isDragActive:N})=>S.jsxs("div",{..._(),className:Me("group border-muted-foreground/25 hover:bg-muted/25 relative grid h-52 w-full cursor-pointer place-items-center rounded-lg border-2 border-dashed px-5 py-2.5 text-center transition","ring-offset-background focus-visible:ring-ring focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-none",N&&"border-muted-foreground/50",C&&"pointer-events-none opacity-60",m),...v,children:[S.jsx("input",{...T()}),N?S.jsxs("div",{className:"flex flex-col items-center justify-center gap-4 sm:px-5",children:[S.jsx("div",{className:"rounded-full border border-dashed p-3",children:S.jsx(Ag,{className:"text-muted-foreground size-7","aria-hidden":"true"})}),S.jsx("p",{className:"text-muted-foreground font-medium",children:"Drop the files here"})]}):S.jsxs("div",{className:"flex flex-col items-center justify-center gap-4 sm:px-5",children:[S.jsx("div",{className:"rounded-full border border-dashed p-3",children:S.jsx(Ag,{className:"text-muted-foreground size-7","aria-hidden":"true"})}),S.jsxs("div",{className:"flex flex-col gap-px",children:[S.jsx("p",{className:"text-muted-foreground font-medium",children:"Drag and drop files here, or click to select files"}),p?S.jsx("p",{className:"text-muted-foreground/70 text-sm",children:p}):S.jsxs("p",{className:"text-muted-foreground/70 text-sm",children:["You can upload",u>1?` ${u===1/0?"multiple":u} - files (up to ${sv(s)} each)`:` a file with ${sv(s)}`,"Supported formats: TXT, MD, DOCX, PDF, PPTX, RTF, ODT, EPUB, HTML, HTM, TEX, JSON, XML, YAML, YML, CSV, LOG, CONF, INI, PROPERTIES, SQL, BAT, SH, C, CPP, PY, JAVA, JS, TS, SWIFT, GO, RB, PHP, CSS, SCSS, LESS"]})]})]})]})}),g!=null&&g.length?S.jsx(YR,{className:"h-fit w-full px-3",children:S.jsx("div",{className:"flex max-h-48 flex-col gap-4",children:g==null?void 0:g.map((_,T)=>S.jsx(a9,{file:_,onRemove:()=>k(T),progress:i==null?void 0:i[_.name]},T))})}):null]})}function a9({file:e,progress:t,onRemove:n}){return S.jsxs("div",{className:"relative flex items-center gap-2.5",children:[S.jsxs("div",{className:"flex flex-1 gap-2.5",children:[XR(e)?S.jsx(o9,{file:e}):null,S.jsxs("div",{className:"flex w-full flex-col gap-2",children:[S.jsxs("div",{className:"flex flex-col gap-px",children:[S.jsx("p",{className:"text-foreground/80 line-clamp-1 text-sm font-medium",children:e.name}),S.jsx("p",{className:"text-muted-foreground text-xs",children:sv(e.size)})]}),t?S.jsx(LR,{value:t}):null]})]}),S.jsx("div",{className:"flex items-center gap-2",children:S.jsxs(Ot,{type:"button",variant:"outline",size:"icon",className:"size-7",onClick:n,children:[S.jsx(Ek,{className:"size-4","aria-hidden":"true"}),S.jsx("span",{className:"sr-only",children:"Remove file"})]})})]})}function XR(e){return"preview"in e&&typeof e.preview=="string"}function o9({file:e}){return e.type.startsWith("image/")?S.jsx("div",{className:"aspect-square shrink-0 rounded-md object-cover"}):S.jsx(_M,{className:"text-muted-foreground size-10","aria-hidden":"true"})}function l9(){const[e,t]=E.useState(!1),[n,r]=E.useState(!1),[i,o]=E.useState({}),s=E.useCallback(async u=>{r(!0);try{await Promise.all(u.map(async f=>{try{const d=await uM(f,p=>{console.debug(`Uploading ${f.name}: ${p}%`),o(m=>({...m,[f.name]:p}))});d.status==="success"?vn.success(`Upload Success: -${f.name} uploaded successfully`):vn.error(`Upload Failed: -${f.name} -${d.message}`)}catch(d){vn.error(`Upload Failed: -${f.name} -${Cr(d)}`)}}))}catch(f){vn.error(`Upload Failed -`+Cr(f))}finally{r(!1)}},[r,o]);return S.jsxs(KA,{open:e,onOpenChange:u=>{n&&!u||t(u)},children:[S.jsx(ZA,{asChild:!0,children:S.jsxs(Ot,{variant:"default",side:"bottom",tooltip:"Upload documents",size:"sm",children:[S.jsx(Ag,{})," Upload"]})}),S.jsxs(Cy,{className:"sm:max-w-xl",onCloseAutoFocus:u=>u.preventDefault(),children:[S.jsxs(Ty,{children:[S.jsx(Ay,{children:"Upload documents"}),S.jsx(Ry,{children:"Drag and drop your documents here or click to browse."})]}),S.jsx(i9,{maxFileCount:1/0,maxSize:200*1024*1024,description:"supported types: TXT, MD, DOCX, PDF, PPTX, RTF, ODT, EPUB, HTML, HTM, TEX, JSON, XML, YAML, YML, CSV, LOG, CONF, INI, PROPERTIES, SQL, BAT, SH, C, CPP, PY, JAVA, JS, TS, SWIFT, GO, RB, PHP, CSS, SCSS, LESS",onUpload:s,progresses:i,disabled:n})]})]})}function s9(){const[e,t]=E.useState(!1),n=E.useCallback(async()=>{try{const r=await cM();r.status==="success"?(vn.success("Documents cleared successfully"),t(!1)):vn.error(`Clear Documents Failed: -${r.message}`)}catch(r){vn.error(`Clear Documents Failed: -`+Cr(r))}},[t]);return S.jsxs(KA,{open:e,onOpenChange:t,children:[S.jsx(ZA,{asChild:!0,children:S.jsxs(Ot,{variant:"outline",side:"bottom",tooltip:"Clear documents",size:"sm",children:[S.jsx(wk,{})," Clear"]})}),S.jsxs(Cy,{className:"sm:max-w-xl",onCloseAutoFocus:r=>r.preventDefault(),children:[S.jsxs(Ty,{children:[S.jsx(Ay,{children:"Clear documents"}),S.jsx(Ry,{children:"Do you really want to clear all documents?"})]}),S.jsx(Ot,{variant:"destructive",onClick:n,children:"YES"})]})]})}function u9(){const e=Mn.use.health(),[t,n]=E.useState(null),r=E.useCallback(async()=>{try{const o=await aM();o&&o.statuses&&Object.values(o.statuses).reduce((u,f)=>u+f.length,0)>0?n(o):n(null)}catch(o){vn.error(`Failed to load documents -`+Cr(o))}},[n]);E.useEffect(()=>{r()},[]);const i=E.useCallback(async()=>{try{const{status:o}=await oM();vn.message(o)}catch(o){vn.error(`Failed to load documents -`+Cr(o))}},[]);return E.useEffect(()=>{const o=setInterval(async()=>{if(e)try{await r()}catch(s){vn.error(`Failed to get scan progress -`+Cr(s))}},5e3);return()=>clearInterval(o)},[e,r]),S.jsxs(Ks,{className:"!size-full !rounded-none !border-none",children:[S.jsx(Nf,{children:S.jsx(Zs,{className:"text-lg",children:"Document Management"})}),S.jsxs(Of,{className:"space-y-4",children:[S.jsxs("div",{className:"flex gap-2",children:[S.jsxs(Ot,{variant:"outline",onClick:i,side:"bottom",tooltip:"Scan documents",size:"sm",children:[S.jsx(YM,{})," Scan"]}),S.jsx("div",{className:"flex-1"}),S.jsx(s9,{}),S.jsx(l9,{})]}),S.jsxs(Ks,{children:[S.jsxs(Nf,{children:[S.jsx(Zs,{children:"Uploaded documents"}),S.jsx(xd,{children:"view the uploaded documents here"})]}),S.jsxs(Of,{children:[!t&&S.jsx(PH,{title:"No documents uploaded",description:"upload documents to see them here"}),t&&S.jsxs(mR,{children:[S.jsx(gR,{children:S.jsxs(tv,{children:[S.jsx(bi,{children:"ID"}),S.jsx(bi,{children:"Summary"}),S.jsx(bi,{children:"Status"}),S.jsx(bi,{children:"Length"}),S.jsx(bi,{children:"Chunks"}),S.jsx(bi,{children:"Created"}),S.jsx(bi,{children:"Updated"}),S.jsx(bi,{children:"Metadata"})]})}),S.jsx(vR,{className:"text-sm",children:Object.entries(t.statuses).map(([o,s])=>s.map(u=>S.jsxs(tv,{children:[S.jsx(xi,{className:"truncate font-mono",children:u.id}),S.jsx(xi,{className:"max-w-xs min-w-24 truncate",children:S.jsx(Ln,{text:u.content_summary,tooltip:u.content_summary,tooltipClassName:"max-w-none overflow-visible block"})}),S.jsxs(xi,{children:[o==="processed"&&S.jsx("span",{className:"text-green-600",children:"Completed"}),o==="processing"&&S.jsx("span",{className:"text-blue-600",children:"Processing"}),o==="pending"&&S.jsx("span",{className:"text-yellow-600",children:"Pending"}),o==="failed"&&S.jsx("span",{className:"text-red-600",children:"Failed"}),u.error&&S.jsx("span",{className:"ml-2 text-red-500",title:u.error,children:"⚠️"})]}),S.jsx(xi,{children:u.content_length??"-"}),S.jsx(xi,{children:u.chunks_count??"-"}),S.jsx(xi,{className:"truncate",children:new Date(u.created_at).toLocaleString()}),S.jsx(xi,{className:"truncate",children:new Date(u.updated_at).toLocaleString()}),S.jsx(xi,{className:"max-w-xs truncate",children:u.metadata?JSON.stringify(u.metadata):"-"})]},u.id)))})]})]})]})]})]})}function KR(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i=u?i=i+OE("0",s-u):i=(i.substring(0,s)||"0")+"."+i.substring(s),n+i}function LE(e,t,n){if(["","-"].indexOf(e)!==-1)return e;var r=(e.indexOf(".")!==-1||n)&&t,i=Uy(e),o=i.beforeDecimal,s=i.afterDecimal,u=i.hasNegation,f=parseFloat("0."+(s||"0")),d=s.length<=t?"0."+s:f.toFixed(t),p=d.split("."),m=o;o&&Number(p[0])&&(m=o.split("").reverse().reduce(function(x,k,C){return x.length>C?(Number(x[0])+Number(k)).toString()+x.substring(1,x.length):k+x},p[0]));var v=JR(p[1]||"",t,n),g=u?"-":"",w=r?".":"";return""+g+m+w+v}function Va(e,t){if(e.value=e.value,e!==null){if(e.createTextRange){var n=e.createTextRange();return n.move("character",t),n.select(),!0}return e.selectionStart||e.selectionStart===0?(e.focus(),e.setSelectionRange(t,t),!0):(e.focus(),!1)}}var t2=c9(function(e,t){for(var n=0,r=0,i=e.length,o=t.length;e[n]===t[n]&&nn&&i-r>n;)r++;return{from:{start:n,end:i-r},to:{start:n,end:o-r}}}),g9=function(e,t){var n=Math.min(e.selectionStart,t);return{from:{start:n,end:e.selectionEnd},to:{start:n,end:t}}};function v9(e,t,n){return Math.min(Math.max(e,t),n)}function eg(e){return Math.max(e.selectionStart,e.selectionEnd)}function y9(){return typeof navigator<"u"&&!(navigator.platform&&/iPhone|iPod/.test(navigator.platform))}function b9(e){return{from:{start:0,end:0},to:{start:0,end:e.length},lastValue:""}}function x9(e){var t=e.currentValue,n=e.formattedValue,r=e.currentValueIndex,i=e.formattedValueIndex;return t[r]===n[i]}function w9(e,t,n,r,i,o,s){s===void 0&&(s=x9);var u=i.findIndex(function(N){return N}),f=e.slice(0,u);!t&&!n.startsWith(f)&&(t=f,n=f+n,r=r+f.length);for(var d=n.length,p=e.length,m={},v=new Array(d),g=0;g0&&v[C]===-1;)C--;var T=C===-1||v[C]===-1?0:v[C]+1;return T>_?_:r-T<_-r?T:_}function zE(e,t,n,r){var i=e.length;if(t=v9(t,0,i),r==="left"){for(;t>=0&&!n[t];)t--;t===-1&&(t=n.indexOf(!0))}else{for(;t<=i&&!n[t];)t++;t>i&&(t=n.lastIndexOf(!0))}return t===-1&&(t=i),t}function S9(e){for(var t=Array.from({length:e.length+1}).map(function(){return!0}),n=0,r=t.length;nR.length-s.length||zV||m>e.length-s.length)&&(j=m),e=e.substring(0,j),e=C9(T?"-"+e:e,i),e=(e.match(T9(w))||[]).join("");var q=e.indexOf(w);e=e.replace(new RegExp(QR(w),"g"),function(G,F){return F===q?".":""});var I=Uy(e,i),Y=I.beforeDecimal,Z=I.afterDecimal,U=I.addNegation;return d.end-d.start$?!1:A>=re.start&&A{const[x,k]=E.useState(v??r),C=E.useCallback(()=>{k(D=>D===void 0?e??1:Math.min(D+(e??1),o))},[e,o]),_=E.useCallback(()=>{k(D=>D===void 0?-(e??1):Math.max(D-(e??1),i))},[e,i]);E.useEffect(()=>{v!==void 0&&k(v)},[v]);const T=D=>{const z=D.floatValue===void 0?void 0:D.floatValue;k(z),s&&s(z)},N=()=>{x!==void 0&&(xo&&(k(o),w.current.value=String(o)))};return S.jsxs("div",{className:"relative flex",children:[S.jsx(L9,{value:x,onValueChange:T,thousandSeparator:t,decimalScale:f,fixedDecimalScale:u,allowNegative:i<0,valueIsNumericString:!0,onBlur:N,max:o,min:i,suffix:p,prefix:m,customInput:D=>S.jsx(Za,{...D,className:Me("w-full",d)}),placeholder:n,className:"[appearance:textfield] [&::-webkit-inner-spin-button]:appearance-none [&::-webkit-outer-spin-button]:appearance-none",getInputRef:w,...g}),S.jsxs("div",{className:"absolute top-0 right-0 bottom-0 flex flex-col",children:[S.jsx(Ot,{"aria-label":"Increase value",className:"border-input h-1/2 rounded-l-none rounded-br-none border-b border-l px-2 focus-visible:relative",variant:"outline",onClick:C,disabled:x===o,children:S.jsx(xk,{size:15})}),S.jsx(Ot,{"aria-label":"Decrease value",className:"border-input h-1/2 rounded-l-none rounded-tr-none border-b border-l px-2 focus-visible:relative",variant:"outline",onClick:_,disabled:x===i,children:S.jsx(zv,{size:15})})]})]})});Jo.displayName="NumberInput";var z9=[" ","Enter","ArrowUp","ArrowDown"],j9=[" ","Enter"],gu="Select",[kd,Cd,M9]=pT(gu),[Al,vK]=hr(gu,[M9,wl]),Td=wl(),[P9,pa]=Al(gu),[F9,I9]=Al(gu),r2=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:i,onOpenChange:o,value:s,defaultValue:u,onValueChange:f,dir:d,name:p,autoComplete:m,disabled:v,required:g,form:w}=e,x=Td(t),[k,C]=E.useState(null),[_,T]=E.useState(null),[N,D]=E.useState(!1),z=hd(d),[R=!1,B]=_i({prop:r,defaultProp:i,onChange:o}),[P,j]=_i({prop:s,defaultProp:u,onChange:f}),V=E.useRef(null),q=k?w||!!k.closest("form"):!0,[I,Y]=E.useState(new Set),Z=Array.from(I).map(U=>U.props.value).join(";");return S.jsx(ny,{...x,children:S.jsxs(P9,{required:g,scope:t,trigger:k,onTriggerChange:C,valueNode:_,onValueNodeChange:T,valueNodeHasChildren:N,onValueNodeHasChildrenChange:D,contentId:bn(),value:P,onValueChange:j,open:R,onOpenChange:B,dir:z,triggerPointerDownPosRef:V,disabled:v,children:[S.jsx(kd.Provider,{scope:t,children:S.jsx(F9,{scope:e.__scopeSelect,onNativeOptionAdd:E.useCallback(U=>{Y(G=>new Set(G).add(U))},[]),onNativeOptionRemove:E.useCallback(U=>{Y(G=>{const F=new Set(G);return F.delete(U),F})},[]),children:n})}),q?S.jsxs(R2,{"aria-hidden":!0,required:g,tabIndex:-1,name:p,autoComplete:m,value:P,onChange:U=>j(U.target.value),disabled:v,form:w,children:[P===void 0?S.jsx("option",{value:""}):null,Array.from(I)]},Z):null]})})};r2.displayName=gu;var i2="SelectTrigger",a2=E.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...i}=e,o=Td(n),s=pa(i2,n),u=s.disabled||r,f=dt(t,s.onTriggerChange),d=Cd(n),p=E.useRef("touch"),[m,v,g]=D2(x=>{const k=d().filter(T=>!T.disabled),C=k.find(T=>T.value===s.value),_=N2(k,x,C);_!==void 0&&s.onValueChange(_.value)}),w=x=>{u||(s.onOpenChange(!0),g()),x&&(s.triggerPointerDownPosRef.current={x:Math.round(x.pageX),y:Math.round(x.pageY)})};return S.jsx(od,{asChild:!0,...o,children:S.jsx(We.button,{type:"button",role:"combobox","aria-controls":s.contentId,"aria-expanded":s.open,"aria-required":s.required,"aria-autocomplete":"none",dir:s.dir,"data-state":s.open?"open":"closed",disabled:u,"data-disabled":u?"":void 0,"data-placeholder":A2(s.value)?"":void 0,...i,ref:f,onClick:qe(i.onClick,x=>{x.currentTarget.focus(),p.current!=="mouse"&&w(x)}),onPointerDown:qe(i.onPointerDown,x=>{p.current=x.pointerType;const k=x.target;k.hasPointerCapture(x.pointerId)&&k.releasePointerCapture(x.pointerId),x.button===0&&x.ctrlKey===!1&&x.pointerType==="mouse"&&(w(x),x.preventDefault())}),onKeyDown:qe(i.onKeyDown,x=>{const k=m.current!=="";!(x.ctrlKey||x.altKey||x.metaKey)&&x.key.length===1&&v(x.key),!(k&&x.key===" ")&&z9.includes(x.key)&&(w(),x.preventDefault())})})})});a2.displayName=i2;var o2="SelectValue",l2=E.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:i,children:o,placeholder:s="",...u}=e,f=pa(o2,n),{onValueNodeHasChildrenChange:d}=f,p=o!==void 0,m=dt(t,f.onValueNodeChange);return xn(()=>{d(p)},[d,p]),S.jsx(We.span,{...u,ref:m,style:{pointerEvents:"none"},children:A2(f.value)?S.jsx(S.Fragment,{children:s}):o})});l2.displayName=o2;var G9="SelectIcon",s2=E.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...i}=e;return S.jsx(We.span,{"aria-hidden":!0,...i,ref:t,children:r||"▼"})});s2.displayName=G9;var B9="SelectPortal",u2=e=>S.jsx(Qf,{asChild:!0,...e});u2.displayName=B9;var eo="SelectContent",c2=E.forwardRef((e,t)=>{const n=pa(eo,e.__scopeSelect),[r,i]=E.useState();if(xn(()=>{i(new DocumentFragment)},[]),!n.open){const o=r;return o?au.createPortal(S.jsx(f2,{scope:e.__scopeSelect,children:S.jsx(kd.Slot,{scope:e.__scopeSelect,children:S.jsx("div",{children:e.children})})}),o):null}return S.jsx(d2,{...e,ref:t})});c2.displayName=eo;var _r=10,[f2,ma]=Al(eo),U9="SelectContentImpl",d2=E.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:i,onEscapeKeyDown:o,onPointerDownOutside:s,side:u,sideOffset:f,align:d,alignOffset:p,arrowPadding:m,collisionBoundary:v,collisionPadding:g,sticky:w,hideWhenDetached:x,avoidCollisions:k,...C}=e,_=pa(eo,n),[T,N]=E.useState(null),[D,z]=E.useState(null),R=dt(t,ae=>N(ae)),[B,P]=E.useState(null),[j,V]=E.useState(null),q=Cd(n),[I,Y]=E.useState(!1),Z=E.useRef(!1);E.useEffect(()=>{if(T)return Pv(T)},[T]),Mv();const U=E.useCallback(ae=>{const[oe,...Ce]=q().map(we=>we.ref.current),[he]=Ce.slice(-1),Ee=document.activeElement;for(const we of ae)if(we===Ee||(we==null||we.scrollIntoView({block:"nearest"}),we===oe&&D&&(D.scrollTop=0),we===he&&D&&(D.scrollTop=D.scrollHeight),we==null||we.focus(),document.activeElement!==Ee))return},[q,D]),G=E.useCallback(()=>U([B,T]),[U,B,T]);E.useEffect(()=>{I&&G()},[I,G]);const{onOpenChange:F,triggerPointerDownPosRef:K}=_;E.useEffect(()=>{if(T){let ae={x:0,y:0};const oe=he=>{var Ee,we;ae={x:Math.abs(Math.round(he.pageX)-(((Ee=K.current)==null?void 0:Ee.x)??0)),y:Math.abs(Math.round(he.pageY)-(((we=K.current)==null?void 0:we.y)??0))}},Ce=he=>{ae.x<=10&&ae.y<=10?he.preventDefault():T.contains(he.target)||F(!1),document.removeEventListener("pointermove",oe),K.current=null};return K.current!==null&&(document.addEventListener("pointermove",oe),document.addEventListener("pointerup",Ce,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",oe),document.removeEventListener("pointerup",Ce,{capture:!0})}}},[T,F,K]),E.useEffect(()=>{const ae=()=>F(!1);return window.addEventListener("blur",ae),window.addEventListener("resize",ae),()=>{window.removeEventListener("blur",ae),window.removeEventListener("resize",ae)}},[F]);const[A,$]=D2(ae=>{const oe=q().filter(Ee=>!Ee.disabled),Ce=oe.find(Ee=>Ee.ref.current===document.activeElement),he=N2(oe,ae,Ce);he&&setTimeout(()=>he.ref.current.focus())}),M=E.useCallback((ae,oe,Ce)=>{const he=!Z.current&&!Ce;(_.value!==void 0&&_.value===oe||he)&&(P(ae),he&&(Z.current=!0))},[_.value]),O=E.useCallback(()=>T==null?void 0:T.focus(),[T]),X=E.useCallback((ae,oe,Ce)=>{const he=!Z.current&&!Ce;(_.value!==void 0&&_.value===oe||he)&&V(ae)},[_.value]),re=r==="popper"?uv:h2,ue=re===uv?{side:u,sideOffset:f,align:d,alignOffset:p,arrowPadding:m,collisionBoundary:v,collisionPadding:g,sticky:w,hideWhenDetached:x,avoidCollisions:k}:{};return S.jsx(f2,{scope:n,content:T,viewport:D,onViewportChange:z,itemRefCallback:M,selectedItem:B,onItemLeave:O,itemTextRefCallback:X,focusSelectedItem:G,selectedItemText:j,position:r,isPositioned:I,searchRef:A,children:S.jsx(ed,{as:ua,allowPinchZoom:!0,children:S.jsx(Zf,{asChild:!0,trapped:_.open,onMountAutoFocus:ae=>{ae.preventDefault()},onUnmountAutoFocus:qe(i,ae=>{var oe;(oe=_.trigger)==null||oe.focus({preventScroll:!0}),ae.preventDefault()}),children:S.jsx(ou,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:o,onPointerDownOutside:s,onFocusOutside:ae=>ae.preventDefault(),onDismiss:()=>_.onOpenChange(!1),children:S.jsx(re,{role:"listbox",id:_.contentId,"data-state":_.open?"open":"closed",dir:_.dir,onContextMenu:ae=>ae.preventDefault(),...C,...ue,onPlaced:()=>Y(!0),ref:R,style:{display:"flex",flexDirection:"column",outline:"none",...C.style},onKeyDown:qe(C.onKeyDown,ae=>{const oe=ae.ctrlKey||ae.altKey||ae.metaKey;if(ae.key==="Tab"&&ae.preventDefault(),!oe&&ae.key.length===1&&$(ae.key),["ArrowUp","ArrowDown","Home","End"].includes(ae.key)){let he=q().filter(Ee=>!Ee.disabled).map(Ee=>Ee.ref.current);if(["ArrowUp","End"].includes(ae.key)&&(he=he.slice().reverse()),["ArrowUp","ArrowDown"].includes(ae.key)){const Ee=ae.target,we=he.indexOf(Ee);he=he.slice(we+1)}setTimeout(()=>U(he)),ae.preventDefault()}})})})})})})});d2.displayName=U9;var H9="SelectItemAlignedPosition",h2=E.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...i}=e,o=pa(eo,n),s=ma(eo,n),[u,f]=E.useState(null),[d,p]=E.useState(null),m=dt(t,R=>p(R)),v=Cd(n),g=E.useRef(!1),w=E.useRef(!0),{viewport:x,selectedItem:k,selectedItemText:C,focusSelectedItem:_}=s,T=E.useCallback(()=>{if(o.trigger&&o.valueNode&&u&&d&&x&&k&&C){const R=o.trigger.getBoundingClientRect(),B=d.getBoundingClientRect(),P=o.valueNode.getBoundingClientRect(),j=C.getBoundingClientRect();if(o.dir!=="rtl"){const Ee=j.left-B.left,we=P.left-Ee,Pe=R.left-we,Ae=R.width+Pe,xe=Math.max(Ae,B.width),ee=window.innerWidth-_r,ce=lv(we,[_r,Math.max(_r,ee-xe)]);u.style.minWidth=Ae+"px",u.style.left=ce+"px"}else{const Ee=B.right-j.right,we=window.innerWidth-P.right-Ee,Pe=window.innerWidth-R.right-we,Ae=R.width+Pe,xe=Math.max(Ae,B.width),ee=window.innerWidth-_r,ce=lv(we,[_r,Math.max(_r,ee-xe)]);u.style.minWidth=Ae+"px",u.style.right=ce+"px"}const V=v(),q=window.innerHeight-_r*2,I=x.scrollHeight,Y=window.getComputedStyle(d),Z=parseInt(Y.borderTopWidth,10),U=parseInt(Y.paddingTop,10),G=parseInt(Y.borderBottomWidth,10),F=parseInt(Y.paddingBottom,10),K=Z+U+I+F+G,A=Math.min(k.offsetHeight*5,K),$=window.getComputedStyle(x),M=parseInt($.paddingTop,10),O=parseInt($.paddingBottom,10),X=R.top+R.height/2-_r,re=q-X,ue=k.offsetHeight/2,ae=k.offsetTop+ue,oe=Z+U+ae,Ce=K-oe;if(oe<=X){const Ee=V.length>0&&k===V[V.length-1].ref.current;u.style.bottom="0px";const we=d.clientHeight-x.offsetTop-x.offsetHeight,Pe=Math.max(re,ue+(Ee?O:0)+we+G),Ae=oe+Pe;u.style.height=Ae+"px"}else{const Ee=V.length>0&&k===V[0].ref.current;u.style.top="0px";const Pe=Math.max(X,Z+x.offsetTop+(Ee?M:0)+ue)+Ce;u.style.height=Pe+"px",x.scrollTop=oe-X+x.offsetTop}u.style.margin=`${_r}px 0`,u.style.minHeight=A+"px",u.style.maxHeight=q+"px",r==null||r(),requestAnimationFrame(()=>g.current=!0)}},[v,o.trigger,o.valueNode,u,d,x,k,C,o.dir,r]);xn(()=>T(),[T]);const[N,D]=E.useState();xn(()=>{d&&D(window.getComputedStyle(d).zIndex)},[d]);const z=E.useCallback(R=>{R&&w.current===!0&&(T(),_==null||_(),w.current=!1)},[T,_]);return S.jsx(V9,{scope:n,contentWrapper:u,shouldExpandOnScrollRef:g,onScrollButtonChange:z,children:S.jsx("div",{ref:f,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:N},children:S.jsx(We.div,{...i,ref:m,style:{boxSizing:"border-box",maxHeight:"100%",...i.style}})})})});h2.displayName=H9;var $9="SelectPopperPosition",uv=E.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:i=_r,...o}=e,s=Td(n);return S.jsx(ry,{...s,...o,ref:t,align:r,collisionPadding:i,style:{boxSizing:"border-box",...o.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});uv.displayName=$9;var[V9,Hy]=Al(eo,{}),cv="SelectViewport",p2=E.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...i}=e,o=ma(cv,n),s=Hy(cv,n),u=dt(t,o.onViewportChange),f=E.useRef(0);return S.jsxs(S.Fragment,{children:[S.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:r}),S.jsx(kd.Slot,{scope:n,children:S.jsx(We.div,{"data-radix-select-viewport":"",role:"presentation",...i,ref:u,style:{position:"relative",flex:1,overflow:"hidden auto",...i.style},onScroll:qe(i.onScroll,d=>{const p=d.currentTarget,{contentWrapper:m,shouldExpandOnScrollRef:v}=s;if(v!=null&&v.current&&m){const g=Math.abs(f.current-p.scrollTop);if(g>0){const w=window.innerHeight-_r*2,x=parseFloat(m.style.minHeight),k=parseFloat(m.style.height),C=Math.max(x,k);if(C0?N:0,m.style.justifyContent="flex-end")}}}f.current=p.scrollTop})})})]})});p2.displayName=cv;var m2="SelectGroup",[q9,Y9]=Al(m2),g2=E.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=bn();return S.jsx(q9,{scope:n,id:i,children:S.jsx(We.div,{role:"group","aria-labelledby":i,...r,ref:t})})});g2.displayName=m2;var v2="SelectLabel",y2=E.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=Y9(v2,n);return S.jsx(We.div,{id:i.id,...r,ref:t})});y2.displayName=v2;var If="SelectItem",[W9,b2]=Al(If),x2=E.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:i=!1,textValue:o,...s}=e,u=pa(If,n),f=ma(If,n),d=u.value===r,[p,m]=E.useState(o??""),[v,g]=E.useState(!1),w=dt(t,_=>{var T;return(T=f.itemRefCallback)==null?void 0:T.call(f,_,r,i)}),x=bn(),k=E.useRef("touch"),C=()=>{i||(u.onValueChange(r),u.onOpenChange(!1))};if(r==="")throw new Error("A must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return S.jsx(W9,{scope:n,value:r,disabled:i,textId:x,isSelected:d,onItemTextChange:E.useCallback(_=>{m(T=>T||((_==null?void 0:_.textContent)??"").trim())},[]),children:S.jsx(kd.ItemSlot,{scope:n,value:r,disabled:i,textValue:p,children:S.jsx(We.div,{role:"option","aria-labelledby":x,"data-highlighted":v?"":void 0,"aria-selected":d&&v,"data-state":d?"checked":"unchecked","aria-disabled":i||void 0,"data-disabled":i?"":void 0,tabIndex:i?void 0:-1,...s,ref:w,onFocus:qe(s.onFocus,()=>g(!0)),onBlur:qe(s.onBlur,()=>g(!1)),onClick:qe(s.onClick,()=>{k.current!=="mouse"&&C()}),onPointerUp:qe(s.onPointerUp,()=>{k.current==="mouse"&&C()}),onPointerDown:qe(s.onPointerDown,_=>{k.current=_.pointerType}),onPointerMove:qe(s.onPointerMove,_=>{var T;k.current=_.pointerType,i?(T=f.onItemLeave)==null||T.call(f):k.current==="mouse"&&_.currentTarget.focus({preventScroll:!0})}),onPointerLeave:qe(s.onPointerLeave,_=>{var T;_.currentTarget===document.activeElement&&((T=f.onItemLeave)==null||T.call(f))}),onKeyDown:qe(s.onKeyDown,_=>{var N;((N=f.searchRef)==null?void 0:N.current)!==""&&_.key===" "||(j9.includes(_.key)&&C(),_.key===" "&&_.preventDefault())})})})})});x2.displayName=If;var Is="SelectItemText",w2=E.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:i,...o}=e,s=pa(Is,n),u=ma(Is,n),f=b2(Is,n),d=I9(Is,n),[p,m]=E.useState(null),v=dt(t,C=>m(C),f.onItemTextChange,C=>{var _;return(_=u.itemTextRefCallback)==null?void 0:_.call(u,C,f.value,f.disabled)}),g=p==null?void 0:p.textContent,w=E.useMemo(()=>S.jsx("option",{value:f.value,disabled:f.disabled,children:g},f.value),[f.disabled,f.value,g]),{onNativeOptionAdd:x,onNativeOptionRemove:k}=d;return xn(()=>(x(w),()=>k(w)),[x,k,w]),S.jsxs(S.Fragment,{children:[S.jsx(We.span,{id:f.textId,...o,ref:v}),f.isSelected&&s.valueNode&&!s.valueNodeHasChildren?au.createPortal(o.children,s.valueNode):null]})});w2.displayName=Is;var S2="SelectItemIndicator",E2=E.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return b2(S2,n).isSelected?S.jsx(We.span,{"aria-hidden":!0,...r,ref:t}):null});E2.displayName=S2;var fv="SelectScrollUpButton",_2=E.forwardRef((e,t)=>{const n=ma(fv,e.__scopeSelect),r=Hy(fv,e.__scopeSelect),[i,o]=E.useState(!1),s=dt(t,r.onScrollButtonChange);return xn(()=>{if(n.viewport&&n.isPositioned){let u=function(){const d=f.scrollTop>0;o(d)};const f=n.viewport;return u(),f.addEventListener("scroll",u),()=>f.removeEventListener("scroll",u)}},[n.viewport,n.isPositioned]),i?S.jsx(C2,{...e,ref:s,onAutoScroll:()=>{const{viewport:u,selectedItem:f}=n;u&&f&&(u.scrollTop=u.scrollTop-f.offsetHeight)}}):null});_2.displayName=fv;var dv="SelectScrollDownButton",k2=E.forwardRef((e,t)=>{const n=ma(dv,e.__scopeSelect),r=Hy(dv,e.__scopeSelect),[i,o]=E.useState(!1),s=dt(t,r.onScrollButtonChange);return xn(()=>{if(n.viewport&&n.isPositioned){let u=function(){const d=f.scrollHeight-f.clientHeight,p=Math.ceil(f.scrollTop)f.removeEventListener("scroll",u)}},[n.viewport,n.isPositioned]),i?S.jsx(C2,{...e,ref:s,onAutoScroll:()=>{const{viewport:u,selectedItem:f}=n;u&&f&&(u.scrollTop=u.scrollTop+f.offsetHeight)}}):null});k2.displayName=dv;var C2=E.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...i}=e,o=ma("SelectScrollButton",n),s=E.useRef(null),u=Cd(n),f=E.useCallback(()=>{s.current!==null&&(window.clearInterval(s.current),s.current=null)},[]);return E.useEffect(()=>()=>f(),[f]),xn(()=>{var p;const d=u().find(m=>m.ref.current===document.activeElement);(p=d==null?void 0:d.ref.current)==null||p.scrollIntoView({block:"nearest"})},[u]),S.jsx(We.div,{"aria-hidden":!0,...i,ref:t,style:{flexShrink:0,...i.style},onPointerDown:qe(i.onPointerDown,()=>{s.current===null&&(s.current=window.setInterval(r,50))}),onPointerMove:qe(i.onPointerMove,()=>{var d;(d=o.onItemLeave)==null||d.call(o),s.current===null&&(s.current=window.setInterval(r,50))}),onPointerLeave:qe(i.onPointerLeave,()=>{f()})})}),X9="SelectSeparator",T2=E.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return S.jsx(We.div,{"aria-hidden":!0,...r,ref:t})});T2.displayName=X9;var hv="SelectArrow",K9=E.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=Td(n),o=pa(hv,n),s=ma(hv,n);return o.open&&s.position==="popper"?S.jsx(iy,{...i,...r,ref:t}):null});K9.displayName=hv;function A2(e){return e===""||e===void 0}var R2=E.forwardRef((e,t)=>{const{value:n,...r}=e,i=E.useRef(null),o=dt(t,i),s=eR(n);return E.useEffect(()=>{const u=i.current,f=window.HTMLSelectElement.prototype,p=Object.getOwnPropertyDescriptor(f,"value").set;if(s!==n&&p){const m=new Event("change",{bubbles:!0});p.call(u,n),u.dispatchEvent(m)}},[s,n]),S.jsx(ay,{asChild:!0,children:S.jsx("select",{...r,ref:o,defaultValue:n})})});R2.displayName="BubbleSelect";function D2(e){const t=un(e),n=E.useRef(""),r=E.useRef(0),i=E.useCallback(s=>{const u=n.current+s;t(u),function f(d){n.current=d,window.clearTimeout(r.current),d!==""&&(r.current=window.setTimeout(()=>f(""),1e3))}(u)},[t]),o=E.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return E.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,i,o]}function N2(e,t,n){const i=t.length>1&&Array.from(t).every(d=>d===t[0])?t[0]:t,o=n?e.indexOf(n):-1;let s=Z9(e,Math.max(o,0));i.length===1&&(s=s.filter(d=>d!==n));const f=s.find(d=>d.textValue.toLowerCase().startsWith(i.toLowerCase()));return f!==n?f:void 0}function Z9(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var Q9=r2,O2=a2,J9=l2,e8=s2,t8=u2,L2=c2,n8=p2,r8=g2,z2=y2,j2=x2,i8=w2,a8=E2,M2=_2,P2=k2,F2=T2;const ME=Q9,PE=r8,FE=J9,pv=E.forwardRef(({className:e,children:t,...n},r)=>S.jsxs(O2,{ref:r,className:Me("border-input bg-background ring-offset-background placeholder:text-muted-foreground focus:ring-ring flex h-10 w-full items-center justify-between rounded-md border px-3 py-2 text-sm focus:ring-2 focus:ring-offset-2 focus:outline-none disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",e),...n,children:[t,S.jsx(e8,{asChild:!0,children:S.jsx(zv,{className:"h-4 w-4 opacity-50"})})]}));pv.displayName=O2.displayName;const I2=E.forwardRef(({className:e,...t},n)=>S.jsx(M2,{ref:n,className:Me("flex cursor-default items-center justify-center py-1",e),...t,children:S.jsx(xk,{className:"h-4 w-4"})}));I2.displayName=M2.displayName;const G2=E.forwardRef(({className:e,...t},n)=>S.jsx(P2,{ref:n,className:Me("flex cursor-default items-center justify-center py-1",e),...t,children:S.jsx(zv,{className:"h-4 w-4"})}));G2.displayName=P2.displayName;const mv=E.forwardRef(({className:e,children:t,position:n="popper",...r},i)=>S.jsx(t8,{children:S.jsxs(L2,{ref:i,className:Me("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border shadow-md",n==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:n,...r,children:[S.jsx(I2,{}),S.jsx(n8,{className:Me("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),S.jsx(G2,{})]})}));mv.displayName=L2.displayName;const o8=E.forwardRef(({className:e,...t},n)=>S.jsx(z2,{ref:n,className:Me("py-1.5 pr-2 pl-8 text-sm font-semibold",e),...t}));o8.displayName=z2.displayName;const wi=E.forwardRef(({className:e,children:t,...n},r)=>S.jsxs(j2,{ref:r,className:Me("focus:bg-accent focus:text-accent-foreground relative flex w-full cursor-default items-center rounded-sm py-1.5 pr-2 pl-8 text-sm outline-none select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...n,children:[S.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:S.jsx(a8,{children:S.jsx(Lv,{className:"h-4 w-4"})})}),S.jsx(i8,{children:t})]}));wi.displayName=j2.displayName;const l8=E.forwardRef(({className:e,...t},n)=>S.jsx(F2,{ref:n,className:Me("bg-muted -mx-1 my-1 h-px",e),...t}));l8.displayName=F2.displayName;function s8(){var n,r;const e=Qe(i=>i.querySettings),t=E.useCallback((i,o)=>{Qe.getState().updateQuerySettings({[i]:o})},[]);return S.jsxs(Ks,{className:"flex shrink-0 flex-col",children:[S.jsxs(Nf,{className:"px-4 pt-4 pb-2",children:[S.jsx(Zs,{children:"Parameters"}),S.jsx(xd,{children:"Configure your query parameters"})]}),S.jsx(Of,{className:"m-0 flex grow flex-col p-0 text-xs",children:S.jsx("div",{className:"relative size-full",children:S.jsxs("div",{className:"absolute inset-0 flex flex-col gap-2 overflow-auto px-2",children:[S.jsxs(S.Fragment,{children:[S.jsx(Ln,{className:"ml-1",text:"Query Mode",tooltip:"Select the retrieval strategy:\\n• Naive: Basic search without advanced techniques\\n• Local: Context-dependent information retrieval\\n• Global: Utilizes global knowledge base\\n• Hybrid: Combines local and global retrieval\\n• Mix: Integrates knowledge graph with vector retrieval",side:"left"}),S.jsxs(ME,{value:e.mode,onValueChange:i=>t("mode",i),children:[S.jsx(pv,{className:"hover:bg-primary/5 h-9 cursor-pointer focus:ring-0 focus:ring-offset-0 focus:outline-0 active:right-0",children:S.jsx(FE,{})}),S.jsx(mv,{children:S.jsxs(PE,{children:[S.jsx(wi,{value:"naive",children:"Naive"}),S.jsx(wi,{value:"local",children:"Local"}),S.jsx(wi,{value:"global",children:"Global"}),S.jsx(wi,{value:"hybrid",children:"Hybrid"}),S.jsx(wi,{value:"mix",children:"Mix"})]})})]})]}),S.jsxs(S.Fragment,{children:[S.jsx(Ln,{className:"ml-1",text:"Response Format",tooltip:"Defines the response format. Examples:\\n• Multiple Paragraphs\\n• Single Paragraph\\n• Bullet Points",side:"left"}),S.jsxs(ME,{value:e.response_type,onValueChange:i=>t("response_type",i),children:[S.jsx(pv,{className:"hover:bg-primary/5 h-9 cursor-pointer focus:ring-0 focus:ring-offset-0 focus:outline-0 active:right-0",children:S.jsx(FE,{})}),S.jsx(mv,{children:S.jsxs(PE,{children:[S.jsx(wi,{value:"Multiple Paragraphs",children:"Multiple Paragraphs"}),S.jsx(wi,{value:"Single Paragraph",children:"Single Paragraph"}),S.jsx(wi,{value:"Bullet Points",children:"Bullet Points"})]})})]})]}),S.jsxs(S.Fragment,{children:[S.jsx(Ln,{className:"ml-1",text:"Top K Results",tooltip:"Number of top items to retrieve. Represents entities in 'local' mode and relationships in 'global' mode",side:"left"}),S.jsx(Jo,{id:"top_k",stepper:1,value:e.top_k,onValueChange:i=>t("top_k",i),min:1,placeholder:"Number of results"})]}),S.jsxs(S.Fragment,{children:[S.jsxs(S.Fragment,{children:[S.jsx(Ln,{className:"ml-1",text:"Max Tokens for Text Unit",tooltip:"Maximum number of tokens allowed for each retrieved text chunk",side:"left"}),S.jsx(Jo,{id:"max_token_for_text_unit",stepper:500,value:e.max_token_for_text_unit,onValueChange:i=>t("max_token_for_text_unit",i),min:1,placeholder:"Max tokens for text unit"})]}),S.jsxs(S.Fragment,{children:[S.jsx(Ln,{text:"Max Tokens for Global Context",tooltip:"Maximum number of tokens allocated for relationship descriptions in global retrieval",side:"left"}),S.jsx(Jo,{id:"max_token_for_global_context",stepper:500,value:e.max_token_for_global_context,onValueChange:i=>t("max_token_for_global_context",i),min:1,placeholder:"Max tokens for global context"})]}),S.jsxs(S.Fragment,{children:[S.jsx(Ln,{className:"ml-1",text:"Max Tokens for Local Context",tooltip:"Maximum number of tokens allocated for entity descriptions in local retrieval",side:"left"}),S.jsx(Jo,{id:"max_token_for_local_context",stepper:500,value:e.max_token_for_local_context,onValueChange:i=>t("max_token_for_local_context",i),min:1,placeholder:"Max tokens for local context"})]})]}),S.jsxs(S.Fragment,{children:[S.jsx(Ln,{className:"ml-1",text:"History Turns",tooltip:"Number of complete conversation turns (user-assistant pairs) to consider in the response context",side:"left"}),S.jsx(Jo,{className:"!border-input",id:"history_turns",stepper:1,type:"text",value:e.history_turns,onValueChange:i=>t("history_turns",i),min:0,placeholder:"Number of history turns"})]}),S.jsxs(S.Fragment,{children:[S.jsxs(S.Fragment,{children:[S.jsx(Ln,{className:"ml-1",text:"High-Level Keywords",tooltip:"List of high-level keywords to prioritize in retrieval. Separate with commas",side:"left"}),S.jsx(Za,{id:"hl_keywords",type:"text",value:(n=e.hl_keywords)==null?void 0:n.join(", "),onChange:i=>{const o=i.target.value.split(",").map(s=>s.trim()).filter(s=>s!=="");t("hl_keywords",o)},placeholder:"Enter keywords"})]}),S.jsxs(S.Fragment,{children:[S.jsx(Ln,{className:"ml-1",text:"Low-Level Keywords",tooltip:"List of low-level keywords to refine retrieval focus. Separate with commas",side:"left"}),S.jsx(Za,{id:"ll_keywords",type:"text",value:(r=e.ll_keywords)==null?void 0:r.join(", "),onChange:i=>{const o=i.target.value.split(",").map(s=>s.trim()).filter(s=>s!=="");t("ll_keywords",o)},placeholder:"Enter keywords"})]})]}),S.jsxs(S.Fragment,{children:[S.jsxs("div",{className:"flex items-center gap-2",children:[S.jsx(Ln,{className:"ml-1",text:"Only Need Context",tooltip:"If True, only returns the retrieved context without generating a response",side:"left"}),S.jsx("div",{className:"grow"}),S.jsx(Bs,{className:"mr-1 cursor-pointer",id:"only_need_context",checked:e.only_need_context,onCheckedChange:i=>t("only_need_context",i)})]}),S.jsxs("div",{className:"flex items-center gap-2",children:[S.jsx(Ln,{className:"ml-1",text:"Only Need Prompt",tooltip:"If True, only returns the generated prompt without producing a response",side:"left"}),S.jsx("div",{className:"grow"}),S.jsx(Bs,{className:"mr-1 cursor-pointer",id:"only_need_prompt",checked:e.only_need_prompt,onCheckedChange:i=>t("only_need_prompt",i)})]}),S.jsxs("div",{className:"flex items-center gap-2",children:[S.jsx(Ln,{className:"ml-1",text:"Stream Response",tooltip:"If True, enables streaming output for real-time responses",side:"left"}),S.jsx("div",{className:"grow"}),S.jsx(Bs,{className:"mr-1 cursor-pointer",id:"stream",checked:e.stream,onCheckedChange:i=>t("stream",i)})]})]})]})})})]})}function u8(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const c8=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,f8=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,d8={};function IE(e,t){return(d8.jsx?f8:c8).test(e)}const h8=/[ \t\n\f\r]/g;function p8(e){return typeof e=="object"?e.type==="text"?GE(e.value):!1:GE(e)}function GE(e){return e.replace(h8,"")===""}class vu{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}vu.prototype.normal={};vu.prototype.property={};vu.prototype.space=void 0;function B2(e,t){const n={},r={};for(const i of e)Object.assign(n,i.property),Object.assign(r,i.normal);return new vu(n,r,t)}function gv(e){return e.toLowerCase()}class Gn{constructor(t,n){this.attribute=n,this.property=t}}Gn.prototype.attribute="";Gn.prototype.booleanish=!1;Gn.prototype.boolean=!1;Gn.prototype.commaOrSpaceSeparated=!1;Gn.prototype.commaSeparated=!1;Gn.prototype.defined=!1;Gn.prototype.mustUseProperty=!1;Gn.prototype.number=!1;Gn.prototype.overloadedBoolean=!1;Gn.prototype.property="";Gn.prototype.spaceSeparated=!1;Gn.prototype.space=void 0;let m8=0;const et=ro(),Vt=ro(),U2=ro(),Re=ro(),Nt=ro(),ol=ro(),qn=ro();function ro(){return 2**++m8}const vv=Object.freeze(Object.defineProperty({__proto__:null,boolean:et,booleanish:Vt,commaOrSpaceSeparated:qn,commaSeparated:ol,number:Re,overloadedBoolean:U2,spaceSeparated:Nt},Symbol.toStringTag,{value:"Module"})),tg=Object.keys(vv);class $y extends Gn{constructor(t,n,r,i){let o=-1;if(super(t,n),BE(this,"space",i),typeof r=="number")for(;++o4&&n.slice(0,4)==="data"&&x8.test(t)){if(t.charAt(4)==="-"){const o=t.slice(5).replace(UE,E8);r="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=t.slice(4);if(!UE.test(o)){let s=o.replace(b8,S8);s.charAt(0)!=="-"&&(s="-"+s),t="data"+s}}i=$y}return new i(r,t)}function S8(e){return"-"+e.toLowerCase()}function E8(e){return e.charAt(1).toUpperCase()}const _8=B2([H2,g8,q2,Y2,W2],"html"),Vy=B2([H2,v8,q2,Y2,W2],"svg");function k8(e){return e.join(" ").trim()}var Xo={},ng,HE;function C8(){if(HE)return ng;HE=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,i=/^:\s*/,o=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,s=/^[;\s]*/,u=/^\s+|\s+$/g,f=` -`,d="/",p="*",m="",v="comment",g="declaration";ng=function(x,k){if(typeof x!="string")throw new TypeError("First argument must be a string");if(!x)return[];k=k||{};var C=1,_=1;function T(I){var Y=I.match(t);Y&&(C+=Y.length);var Z=I.lastIndexOf(f);_=~Z?I.length-Z:_+I.length}function N(){var I={line:C,column:_};return function(Y){return Y.position=new D(I),B(),Y}}function D(I){this.start=I,this.end={line:C,column:_},this.source=k.source}D.prototype.content=x;function z(I){var Y=new Error(k.source+":"+C+":"+_+": "+I);if(Y.reason=I,Y.filename=k.source,Y.line=C,Y.column=_,Y.source=x,!k.silent)throw Y}function R(I){var Y=I.exec(x);if(Y){var Z=Y[0];return T(Z),x=x.slice(Z.length),Y}}function B(){R(n)}function P(I){var Y;for(I=I||[];Y=j();)Y!==!1&&I.push(Y);return I}function j(){var I=N();if(!(d!=x.charAt(0)||p!=x.charAt(1))){for(var Y=2;m!=x.charAt(Y)&&(p!=x.charAt(Y)||d!=x.charAt(Y+1));)++Y;if(Y+=2,m===x.charAt(Y-1))return z("End of comment missing");var Z=x.slice(2,Y-2);return _+=2,T(Z),x=x.slice(Y),_+=2,I({type:v,comment:Z})}}function V(){var I=N(),Y=R(r);if(Y){if(j(),!R(i))return z("property missing ':'");var Z=R(o),U=I({type:g,property:w(Y[0].replace(e,m)),value:Z?w(Z[0].replace(e,m)):m});return R(s),U}}function q(){var I=[];P(I);for(var Y;Y=V();)Y!==!1&&(I.push(Y),P(I));return I}return B(),q()};function w(x){return x?x.replace(u,m):m}return ng}var $E;function T8(){if($E)return Xo;$E=1;var e=Xo&&Xo.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Xo,"__esModule",{value:!0}),Xo.default=n;var t=e(C8());function n(r,i){var o=null;if(!r||typeof r!="string")return o;var s=(0,t.default)(r),u=typeof i=="function";return s.forEach(function(f){if(f.type==="declaration"){var d=f.property,p=f.value;u?i(d,p,f):p&&(o=o||{},o[d]=p)}}),o}return Xo}var A8=T8();const VE=fn(A8),R8=VE.default||VE,X2=K2("end"),qy=K2("start");function K2(e){return t;function t(n){const r=n&&n.position&&n.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function D8(e){const t=qy(e),n=X2(e);if(t&&n)return{start:t,end:n}}function Us(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?qE(e.position):"start"in e||"end"in e?qE(e):"line"in e||"column"in e?yv(e):""}function yv(e){return YE(e&&e.line)+":"+YE(e&&e.column)}function qE(e){return yv(e&&e.start)+"-"+yv(e&&e.end)}function YE(e){return e&&typeof e=="number"?e:1}class wn extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let i="",o={},s=!1;if(n&&("line"in n&&"column"in n?o={place:n}:"start"in n&&"end"in n?o={place:n}:"type"in n?o={ancestors:[n],place:n.position}:o={...n}),typeof t=="string"?i=t:!o.cause&&t&&(s=!0,i=t.message,o.cause=t),!o.ruleId&&!o.source&&typeof r=="string"){const f=r.indexOf(":");f===-1?o.ruleId=r:(o.source=r.slice(0,f),o.ruleId=r.slice(f+1))}if(!o.place&&o.ancestors&&o.ancestors){const f=o.ancestors[o.ancestors.length-1];f&&(o.place=f.position)}const u=o.place&&"start"in o.place?o.place.start:o.place;this.ancestors=o.ancestors||void 0,this.cause=o.cause||void 0,this.column=u?u.column:void 0,this.fatal=void 0,this.file,this.message=i,this.line=u?u.line:void 0,this.name=Us(o.place)||"1:1",this.place=o.place||void 0,this.reason=this.message,this.ruleId=o.ruleId||void 0,this.source=o.source||void 0,this.stack=s&&o.cause&&typeof o.cause.stack=="string"?o.cause.stack:"",this.actual,this.expected,this.note,this.url}}wn.prototype.file="";wn.prototype.name="";wn.prototype.reason="";wn.prototype.message="";wn.prototype.stack="";wn.prototype.column=void 0;wn.prototype.line=void 0;wn.prototype.ancestors=void 0;wn.prototype.cause=void 0;wn.prototype.fatal=void 0;wn.prototype.place=void 0;wn.prototype.ruleId=void 0;wn.prototype.source=void 0;const Yy={}.hasOwnProperty,N8=new Map,O8=/[A-Z]/g,L8=/-([a-z])/g,z8=new Set(["table","tbody","thead","tfoot","tr"]),j8=new Set(["td","th"]),Z2="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function Q2(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let r;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=H8(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=U8(n,t.jsx,t.jsxs)}const i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?Vy:_8,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},o=J2(i,e,void 0);return o&&typeof o!="string"?o:i.create(e,i.Fragment,{children:o||void 0},void 0)}function J2(e,t,n){if(t.type==="element")return M8(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return P8(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return I8(e,t,n);if(t.type==="mdxjsEsm")return F8(e,t);if(t.type==="root")return G8(e,t,n);if(t.type==="text")return B8(e,t)}function M8(e,t,n){const r=e.schema;let i=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=Vy,e.schema=i),e.ancestors.push(t);const o=tD(e,t.tagName,!1),s=$8(e,t);let u=Xy(e,t);return z8.has(t.tagName)&&(u=u.filter(function(f){return typeof f=="string"?!p8(f):!0})),eD(e,s,o,t),Wy(s,u),e.ancestors.pop(),e.schema=r,e.create(t,o,s,n)}function P8(e,t){if(t.data&&t.data.estree&&e.evaluater){const r=t.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}tu(e,t.position)}function F8(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);tu(e,t.position)}function I8(e,t,n){const r=e.schema;let i=r;t.name==="svg"&&r.space==="html"&&(i=Vy,e.schema=i),e.ancestors.push(t);const o=t.name===null?e.Fragment:tD(e,t.name,!0),s=V8(e,t),u=Xy(e,t);return eD(e,s,o,t),Wy(s,u),e.ancestors.pop(),e.schema=r,e.create(t,o,s,n)}function G8(e,t,n){const r={};return Wy(r,Xy(e,t)),e.create(t,e.Fragment,r,n)}function B8(e,t){return t.value}function eD(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function Wy(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function U8(e,t,n){return r;function r(i,o,s,u){const d=Array.isArray(s.children)?n:t;return u?d(o,s,u):d(o,s)}}function H8(e,t){return n;function n(r,i,o,s){const u=Array.isArray(o.children),f=qy(r);return t(i,o,s,u,{columnNumber:f?f.column-1:void 0,fileName:e,lineNumber:f?f.line:void 0},void 0)}}function $8(e,t){const n={};let r,i;for(i in t.properties)if(i!=="children"&&Yy.call(t.properties,i)){const o=q8(e,i,t.properties[i]);if(o){const[s,u]=o;e.tableCellAlignToStyle&&s==="align"&&typeof u=="string"&&j8.has(t.tagName)?r=u:n[s]=u}}if(r){const o=n.style||(n.style={});o[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function V8(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const o=r.data.estree.body[0];o.type;const s=o.expression;s.type;const u=s.properties[0];u.type,Object.assign(n,e.evaluater.evaluateExpression(u.argument))}else tu(e,t.position);else{const i=r.name;let o;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const u=r.value.data.estree.body[0];u.type,o=e.evaluater.evaluateExpression(u.expression)}else tu(e,t.position);else o=r.value===null?!0:r.value;n[i]=o}return n}function Xy(e,t){const n=[];let r=-1;const i=e.passKeys?new Map:N8;for(;++ri?0:i+t:t=t>i?i:t,n=n>0?n:0,r.length<1e4)s=Array.from(r),s.unshift(t,n),e.splice(...s);else for(n&&e.splice(t,n);o0?(Kn(e,e.length,0,t),e):t}const KE={}.hasOwnProperty;function rD(e){const t={};let n=-1;for(;++n13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function Tr(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const kn=ga(/[A-Za-z]/),yn=ga(/[\dA-Za-z]/),n7=ga(/[#-'*+\--9=?A-Z^-~]/);function Gf(e){return e!==null&&(e<32||e===127)}const bv=ga(/\d/),r7=ga(/[\dA-Fa-f]/),i7=ga(/[!-/:-@[-`{-~]/);function Ue(e){return e!==null&&e<-2}function Tt(e){return e!==null&&(e<0||e===32)}function ut(e){return e===-2||e===-1||e===32}const Ad=ga(new RegExp("\\p{P}|\\p{S}","u")),to=ga(/\s/);function ga(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function Dl(e){const t=[];let n=-1,r=0,i=0;for(;++n55295&&o<57344){const u=e.charCodeAt(n+1);o<56320&&u>56319&&u<57344?(s=String.fromCharCode(o,u),i=1):s="�"}else s=String.fromCharCode(o);s&&(t.push(e.slice(r,n),encodeURIComponent(s)),r=n+i+1,s=""),i&&(n+=i,i=0)}return t.join("")+e.slice(r)}function lt(e,t,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let o=0;return s;function s(f){return ut(f)?(e.enter(n),u(f)):t(f)}function u(f){return ut(f)&&o++s))return;const R=t.events.length;let B=R,P,j;for(;B--;)if(t.events[B][0]==="exit"&&t.events[B][1].type==="chunkFlow"){if(P){j=t.events[B][1].end;break}P=!0}for(C(r),z=R;zT;){const D=n[N];t.containerState=D[1],D[0].exit.call(t,e)}n.length=T}function _(){i.write([null]),o=void 0,i=void 0,t.containerState._closeFlow=void 0}}function u7(e,t,n){return lt(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function pl(e){if(e===null||Tt(e)||to(e))return 1;if(Ad(e))return 2}function Rd(e,t,n){const r=[];let i=-1;for(;++i1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const m={...e[r][1].end},v={...e[n][1].start};QE(m,-f),QE(v,f),s={type:f>1?"strongSequence":"emphasisSequence",start:m,end:{...e[r][1].end}},u={type:f>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:v},o={type:f>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},i={type:f>1?"strong":"emphasis",start:{...s.start},end:{...u.end}},e[r][1].end={...s.start},e[n][1].start={...u.end},d=[],e[r][1].end.offset-e[r][1].start.offset&&(d=fr(d,[["enter",e[r][1],t],["exit",e[r][1],t]])),d=fr(d,[["enter",i,t],["enter",s,t],["exit",s,t],["enter",o,t]]),d=fr(d,Rd(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),d=fr(d,[["exit",o,t],["enter",u,t],["exit",u,t],["exit",i,t]]),e[n][1].end.offset-e[n][1].start.offset?(p=2,d=fr(d,[["enter",e[n][1],t],["exit",e[n][1],t]])):p=0,Kn(e,r-1,n-r+3,d),n=r+d.length-p-2;break}}for(n=-1;++n0&&ut(z)?lt(e,_,"linePrefix",o+1)(z):_(z)}function _(z){return z===null||Ue(z)?e.check(JE,x,N)(z):(e.enter("codeFlowValue"),T(z))}function T(z){return z===null||Ue(z)?(e.exit("codeFlowValue"),_(z)):(e.consume(z),T)}function N(z){return e.exit("codeFenced"),t(z)}function D(z,R,B){let P=0;return j;function j(Z){return z.enter("lineEnding"),z.consume(Z),z.exit("lineEnding"),V}function V(Z){return z.enter("codeFencedFence"),ut(Z)?lt(z,q,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(Z):q(Z)}function q(Z){return Z===u?(z.enter("codeFencedFenceSequence"),I(Z)):B(Z)}function I(Z){return Z===u?(P++,z.consume(Z),I):P>=s?(z.exit("codeFencedFenceSequence"),ut(Z)?lt(z,Y,"whitespace")(Z):Y(Z)):B(Z)}function Y(Z){return Z===null||Ue(Z)?(z.exit("codeFencedFence"),R(Z)):B(Z)}}}function w7(e,t,n){const r=this;return i;function i(s){return s===null?n(s):(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),o)}function o(s){return r.parser.lazy[r.now().line]?n(s):t(s)}}const ig={name:"codeIndented",tokenize:E7},S7={partial:!0,tokenize:_7};function E7(e,t,n){const r=this;return i;function i(d){return e.enter("codeIndented"),lt(e,o,"linePrefix",5)(d)}function o(d){const p=r.events[r.events.length-1];return p&&p[1].type==="linePrefix"&&p[2].sliceSerialize(p[1],!0).length>=4?s(d):n(d)}function s(d){return d===null?f(d):Ue(d)?e.attempt(S7,s,f)(d):(e.enter("codeFlowValue"),u(d))}function u(d){return d===null||Ue(d)?(e.exit("codeFlowValue"),s(d)):(e.consume(d),u)}function f(d){return e.exit("codeIndented"),t(d)}}function _7(e,t,n){const r=this;return i;function i(s){return r.parser.lazy[r.now().line]?n(s):Ue(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),i):lt(e,o,"linePrefix",5)(s)}function o(s){const u=r.events[r.events.length-1];return u&&u[1].type==="linePrefix"&&u[2].sliceSerialize(u[1],!0).length>=4?t(s):Ue(s)?i(s):n(s)}}const k7={name:"codeText",previous:T7,resolve:C7,tokenize:A7};function C7(e){let t=e.length-4,n=3,r,i;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return tthis.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(t,n,r){const i=n||0;this.setCursor(Math.trunc(t));const o=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&js(this.left,r),o.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),js(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),js(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t=4?t(s):e.interrupt(r.parser.constructs.flow,n,t)(s)}}function uD(e,t,n,r,i,o,s,u,f){const d=f||Number.POSITIVE_INFINITY;let p=0;return m;function m(C){return C===60?(e.enter(r),e.enter(i),e.enter(o),e.consume(C),e.exit(o),v):C===null||C===32||C===41||Gf(C)?n(C):(e.enter(r),e.enter(s),e.enter(u),e.enter("chunkString",{contentType:"string"}),x(C))}function v(C){return C===62?(e.enter(o),e.consume(C),e.exit(o),e.exit(i),e.exit(r),t):(e.enter(u),e.enter("chunkString",{contentType:"string"}),g(C))}function g(C){return C===62?(e.exit("chunkString"),e.exit(u),v(C)):C===null||C===60||Ue(C)?n(C):(e.consume(C),C===92?w:g)}function w(C){return C===60||C===62||C===92?(e.consume(C),g):g(C)}function x(C){return!p&&(C===null||C===41||Tt(C))?(e.exit("chunkString"),e.exit(u),e.exit(s),e.exit(r),t(C)):p999||g===null||g===91||g===93&&!f||g===94&&!u&&"_hiddenFootnoteSupport"in s.parser.constructs?n(g):g===93?(e.exit(o),e.enter(i),e.consume(g),e.exit(i),e.exit(r),t):Ue(g)?(e.enter("lineEnding"),e.consume(g),e.exit("lineEnding"),p):(e.enter("chunkString",{contentType:"string"}),m(g))}function m(g){return g===null||g===91||g===93||Ue(g)||u++>999?(e.exit("chunkString"),p(g)):(e.consume(g),f||(f=!ut(g)),g===92?v:m)}function v(g){return g===91||g===92||g===93?(e.consume(g),u++,m):m(g)}}function fD(e,t,n,r,i,o){let s;return u;function u(v){return v===34||v===39||v===40?(e.enter(r),e.enter(i),e.consume(v),e.exit(i),s=v===40?41:v,f):n(v)}function f(v){return v===s?(e.enter(i),e.consume(v),e.exit(i),e.exit(r),t):(e.enter(o),d(v))}function d(v){return v===s?(e.exit(o),f(s)):v===null?n(v):Ue(v)?(e.enter("lineEnding"),e.consume(v),e.exit("lineEnding"),lt(e,d,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),p(v))}function p(v){return v===s||v===null||Ue(v)?(e.exit("chunkString"),d(v)):(e.consume(v),v===92?m:p)}function m(v){return v===s||v===92?(e.consume(v),p):p(v)}}function Hs(e,t){let n;return r;function r(i){return Ue(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):ut(i)?lt(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}const M7={name:"definition",tokenize:F7},P7={partial:!0,tokenize:I7};function F7(e,t,n){const r=this;let i;return o;function o(g){return e.enter("definition"),s(g)}function s(g){return cD.call(r,e,u,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(g)}function u(g){return i=Tr(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),g===58?(e.enter("definitionMarker"),e.consume(g),e.exit("definitionMarker"),f):n(g)}function f(g){return Tt(g)?Hs(e,d)(g):d(g)}function d(g){return uD(e,p,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(g)}function p(g){return e.attempt(P7,m,m)(g)}function m(g){return ut(g)?lt(e,v,"whitespace")(g):v(g)}function v(g){return g===null||Ue(g)?(e.exit("definition"),r.parser.defined.push(i),t(g)):n(g)}}function I7(e,t,n){return r;function r(u){return Tt(u)?Hs(e,i)(u):n(u)}function i(u){return fD(e,o,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(u)}function o(u){return ut(u)?lt(e,s,"whitespace")(u):s(u)}function s(u){return u===null||Ue(u)?t(u):n(u)}}const G7={name:"hardBreakEscape",tokenize:B7};function B7(e,t,n){return r;function r(o){return e.enter("hardBreakEscape"),e.consume(o),i}function i(o){return Ue(o)?(e.exit("hardBreakEscape"),t(o)):n(o)}}const U7={name:"headingAtx",resolve:H7,tokenize:$7};function H7(e,t){let n=e.length-2,r=3,i,o;return e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(i={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},o={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},Kn(e,r,n-r+1,[["enter",i,t],["enter",o,t],["exit",o,t],["exit",i,t]])),e}function $7(e,t,n){let r=0;return i;function i(p){return e.enter("atxHeading"),o(p)}function o(p){return e.enter("atxHeadingSequence"),s(p)}function s(p){return p===35&&r++<6?(e.consume(p),s):p===null||Tt(p)?(e.exit("atxHeadingSequence"),u(p)):n(p)}function u(p){return p===35?(e.enter("atxHeadingSequence"),f(p)):p===null||Ue(p)?(e.exit("atxHeading"),t(p)):ut(p)?lt(e,u,"whitespace")(p):(e.enter("atxHeadingText"),d(p))}function f(p){return p===35?(e.consume(p),f):(e.exit("atxHeadingSequence"),u(p))}function d(p){return p===null||p===35||Tt(p)?(e.exit("atxHeadingText"),u(p)):(e.consume(p),d)}}const V7=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],t_=["pre","script","style","textarea"],q7={concrete:!0,name:"htmlFlow",resolveTo:X7,tokenize:K7},Y7={partial:!0,tokenize:Q7},W7={partial:!0,tokenize:Z7};function X7(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function K7(e,t,n){const r=this;let i,o,s,u,f;return d;function d(O){return p(O)}function p(O){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(O),m}function m(O){return O===33?(e.consume(O),v):O===47?(e.consume(O),o=!0,x):O===63?(e.consume(O),i=3,r.interrupt?t:A):kn(O)?(e.consume(O),s=String.fromCharCode(O),k):n(O)}function v(O){return O===45?(e.consume(O),i=2,g):O===91?(e.consume(O),i=5,u=0,w):kn(O)?(e.consume(O),i=4,r.interrupt?t:A):n(O)}function g(O){return O===45?(e.consume(O),r.interrupt?t:A):n(O)}function w(O){const X="CDATA[";return O===X.charCodeAt(u++)?(e.consume(O),u===X.length?r.interrupt?t:q:w):n(O)}function x(O){return kn(O)?(e.consume(O),s=String.fromCharCode(O),k):n(O)}function k(O){if(O===null||O===47||O===62||Tt(O)){const X=O===47,re=s.toLowerCase();return!X&&!o&&t_.includes(re)?(i=1,r.interrupt?t(O):q(O)):V7.includes(s.toLowerCase())?(i=6,X?(e.consume(O),C):r.interrupt?t(O):q(O)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(O):o?_(O):T(O))}return O===45||yn(O)?(e.consume(O),s+=String.fromCharCode(O),k):n(O)}function C(O){return O===62?(e.consume(O),r.interrupt?t:q):n(O)}function _(O){return ut(O)?(e.consume(O),_):j(O)}function T(O){return O===47?(e.consume(O),j):O===58||O===95||kn(O)?(e.consume(O),N):ut(O)?(e.consume(O),T):j(O)}function N(O){return O===45||O===46||O===58||O===95||yn(O)?(e.consume(O),N):D(O)}function D(O){return O===61?(e.consume(O),z):ut(O)?(e.consume(O),D):T(O)}function z(O){return O===null||O===60||O===61||O===62||O===96?n(O):O===34||O===39?(e.consume(O),f=O,R):ut(O)?(e.consume(O),z):B(O)}function R(O){return O===f?(e.consume(O),f=null,P):O===null||Ue(O)?n(O):(e.consume(O),R)}function B(O){return O===null||O===34||O===39||O===47||O===60||O===61||O===62||O===96||Tt(O)?D(O):(e.consume(O),B)}function P(O){return O===47||O===62||ut(O)?T(O):n(O)}function j(O){return O===62?(e.consume(O),V):n(O)}function V(O){return O===null||Ue(O)?q(O):ut(O)?(e.consume(O),V):n(O)}function q(O){return O===45&&i===2?(e.consume(O),U):O===60&&i===1?(e.consume(O),G):O===62&&i===4?(e.consume(O),$):O===63&&i===3?(e.consume(O),A):O===93&&i===5?(e.consume(O),K):Ue(O)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(Y7,M,I)(O)):O===null||Ue(O)?(e.exit("htmlFlowData"),I(O)):(e.consume(O),q)}function I(O){return e.check(W7,Y,M)(O)}function Y(O){return e.enter("lineEnding"),e.consume(O),e.exit("lineEnding"),Z}function Z(O){return O===null||Ue(O)?I(O):(e.enter("htmlFlowData"),q(O))}function U(O){return O===45?(e.consume(O),A):q(O)}function G(O){return O===47?(e.consume(O),s="",F):q(O)}function F(O){if(O===62){const X=s.toLowerCase();return t_.includes(X)?(e.consume(O),$):q(O)}return kn(O)&&s.length<8?(e.consume(O),s+=String.fromCharCode(O),F):q(O)}function K(O){return O===93?(e.consume(O),A):q(O)}function A(O){return O===62?(e.consume(O),$):O===45&&i===2?(e.consume(O),A):q(O)}function $(O){return O===null||Ue(O)?(e.exit("htmlFlowData"),M(O)):(e.consume(O),$)}function M(O){return e.exit("htmlFlow"),t(O)}}function Z7(e,t,n){const r=this;return i;function i(s){return Ue(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),o):n(s)}function o(s){return r.parser.lazy[r.now().line]?n(s):t(s)}}function Q7(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(yu,t,n)}}const J7={name:"htmlText",tokenize:eV};function eV(e,t,n){const r=this;let i,o,s;return u;function u(A){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(A),f}function f(A){return A===33?(e.consume(A),d):A===47?(e.consume(A),D):A===63?(e.consume(A),T):kn(A)?(e.consume(A),B):n(A)}function d(A){return A===45?(e.consume(A),p):A===91?(e.consume(A),o=0,w):kn(A)?(e.consume(A),_):n(A)}function p(A){return A===45?(e.consume(A),g):n(A)}function m(A){return A===null?n(A):A===45?(e.consume(A),v):Ue(A)?(s=m,G(A)):(e.consume(A),m)}function v(A){return A===45?(e.consume(A),g):m(A)}function g(A){return A===62?U(A):A===45?v(A):m(A)}function w(A){const $="CDATA[";return A===$.charCodeAt(o++)?(e.consume(A),o===$.length?x:w):n(A)}function x(A){return A===null?n(A):A===93?(e.consume(A),k):Ue(A)?(s=x,G(A)):(e.consume(A),x)}function k(A){return A===93?(e.consume(A),C):x(A)}function C(A){return A===62?U(A):A===93?(e.consume(A),C):x(A)}function _(A){return A===null||A===62?U(A):Ue(A)?(s=_,G(A)):(e.consume(A),_)}function T(A){return A===null?n(A):A===63?(e.consume(A),N):Ue(A)?(s=T,G(A)):(e.consume(A),T)}function N(A){return A===62?U(A):T(A)}function D(A){return kn(A)?(e.consume(A),z):n(A)}function z(A){return A===45||yn(A)?(e.consume(A),z):R(A)}function R(A){return Ue(A)?(s=R,G(A)):ut(A)?(e.consume(A),R):U(A)}function B(A){return A===45||yn(A)?(e.consume(A),B):A===47||A===62||Tt(A)?P(A):n(A)}function P(A){return A===47?(e.consume(A),U):A===58||A===95||kn(A)?(e.consume(A),j):Ue(A)?(s=P,G(A)):ut(A)?(e.consume(A),P):U(A)}function j(A){return A===45||A===46||A===58||A===95||yn(A)?(e.consume(A),j):V(A)}function V(A){return A===61?(e.consume(A),q):Ue(A)?(s=V,G(A)):ut(A)?(e.consume(A),V):P(A)}function q(A){return A===null||A===60||A===61||A===62||A===96?n(A):A===34||A===39?(e.consume(A),i=A,I):Ue(A)?(s=q,G(A)):ut(A)?(e.consume(A),q):(e.consume(A),Y)}function I(A){return A===i?(e.consume(A),i=void 0,Z):A===null?n(A):Ue(A)?(s=I,G(A)):(e.consume(A),I)}function Y(A){return A===null||A===34||A===39||A===60||A===61||A===96?n(A):A===47||A===62||Tt(A)?P(A):(e.consume(A),Y)}function Z(A){return A===47||A===62||Tt(A)?P(A):n(A)}function U(A){return A===62?(e.consume(A),e.exit("htmlTextData"),e.exit("htmlText"),t):n(A)}function G(A){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(A),e.exit("lineEnding"),F}function F(A){return ut(A)?lt(e,K,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(A):K(A)}function K(A){return e.enter("htmlTextData"),s(A)}}const Qy={name:"labelEnd",resolveAll:iV,resolveTo:aV,tokenize:oV},tV={tokenize:lV},nV={tokenize:sV},rV={tokenize:uV};function iV(e){let t=-1;const n=[];for(;++t=3&&(d===null||Ue(d))?(e.exit("thematicBreak"),t(d)):n(d)}function f(d){return d===i?(e.consume(d),r++,f):(e.exit("thematicBreakSequence"),ut(d)?lt(e,u,"whitespace")(d):u(d))}}const On={continuation:{tokenize:bV},exit:wV,name:"list",tokenize:yV},gV={partial:!0,tokenize:SV},vV={partial:!0,tokenize:xV};function yV(e,t,n){const r=this,i=r.events[r.events.length-1];let o=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,s=0;return u;function u(g){const w=r.containerState.type||(g===42||g===43||g===45?"listUnordered":"listOrdered");if(w==="listUnordered"?!r.containerState.marker||g===r.containerState.marker:bv(g)){if(r.containerState.type||(r.containerState.type=w,e.enter(w,{_container:!0})),w==="listUnordered")return e.enter("listItemPrefix"),g===42||g===45?e.check(vf,n,d)(g):d(g);if(!r.interrupt||g===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),f(g)}return n(g)}function f(g){return bv(g)&&++s<10?(e.consume(g),f):(!r.interrupt||s<2)&&(r.containerState.marker?g===r.containerState.marker:g===41||g===46)?(e.exit("listItemValue"),d(g)):n(g)}function d(g){return e.enter("listItemMarker"),e.consume(g),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||g,e.check(yu,r.interrupt?n:p,e.attempt(gV,v,m))}function p(g){return r.containerState.initialBlankLine=!0,o++,v(g)}function m(g){return ut(g)?(e.enter("listItemPrefixWhitespace"),e.consume(g),e.exit("listItemPrefixWhitespace"),v):n(g)}function v(g){return r.containerState.size=o+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(g)}}function bV(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(yu,i,o);function i(u){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,lt(e,t,"listItemIndent",r.containerState.size+1)(u)}function o(u){return r.containerState.furtherBlankLines||!ut(u)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,s(u)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(vV,t,s)(u))}function s(u){return r.containerState._closeFlow=!0,r.interrupt=void 0,lt(e,e.attempt(On,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(u)}}function xV(e,t,n){const r=this;return lt(e,i,"listItemIndent",r.containerState.size+1);function i(o){const s=r.events[r.events.length-1];return s&&s[1].type==="listItemIndent"&&s[2].sliceSerialize(s[1],!0).length===r.containerState.size?t(o):n(o)}}function wV(e){e.exit(this.containerState.type)}function SV(e,t,n){const r=this;return lt(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(o){const s=r.events[r.events.length-1];return!ut(o)&&s&&s[1].type==="listItemPrefixWhitespace"?t(o):n(o)}}const n_={name:"setextUnderline",resolveTo:EV,tokenize:_V};function EV(e,t){let n=e.length,r,i,o;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(i=n)}else e[n][1].type==="content"&&e.splice(n,1),!o&&e[n][1].type==="definition"&&(o=n);const s={type:"setextHeading",start:{...e[i][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type="setextHeadingText",o?(e.splice(i,0,["enter",s,t]),e.splice(o+1,0,["exit",e[r][1],t]),e[r][1].end={...e[o][1].end}):e[r][1]=s,e.push(["exit",s,t]),e}function _V(e,t,n){const r=this;let i;return o;function o(d){let p=r.events.length,m;for(;p--;)if(r.events[p][1].type!=="lineEnding"&&r.events[p][1].type!=="linePrefix"&&r.events[p][1].type!=="content"){m=r.events[p][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||m)?(e.enter("setextHeadingLine"),i=d,s(d)):n(d)}function s(d){return e.enter("setextHeadingLineSequence"),u(d)}function u(d){return d===i?(e.consume(d),u):(e.exit("setextHeadingLineSequence"),ut(d)?lt(e,f,"lineSuffix")(d):f(d))}function f(d){return d===null||Ue(d)?(e.exit("setextHeadingLine"),t(d)):n(d)}}const kV={tokenize:CV};function CV(e){const t=this,n=e.attempt(yu,r,e.attempt(this.parser.constructs.flowInitial,i,lt(e,e.attempt(this.parser.constructs.flow,i,e.attempt(N7,i)),"linePrefix")));return n;function r(o){if(o===null){e.consume(o);return}return e.enter("lineEndingBlank"),e.consume(o),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function i(o){if(o===null){e.consume(o);return}return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const TV={resolveAll:hD()},AV=dD("string"),RV=dD("text");function dD(e){return{resolveAll:hD(e==="text"?DV:void 0),tokenize:t};function t(n){const r=this,i=this.parser.constructs[e],o=n.attempt(i,s,u);return s;function s(p){return d(p)?o(p):u(p)}function u(p){if(p===null){n.consume(p);return}return n.enter("data"),n.consume(p),f}function f(p){return d(p)?(n.exit("data"),o(p)):(n.consume(p),f)}function d(p){if(p===null)return!0;const m=i[p];let v=-1;if(m)for(;++v-1){const u=s[0];typeof u=="string"?s[0]=u.slice(r):s.shift()}o>0&&s.push(e[i].slice(0,o))}return s}function HV(e,t){let n=-1;const r=[];let i;for(;++n0){const vt=Oe.tokenStack[Oe.tokenStack.length-1];(vt[1]||i_).call(Oe,void 0,vt[0])}for(de.position={start:ra(te.length>0?te[0][1].start:{line:1,column:1,offset:0}),end:ra(te.length>0?te[te.length-2][1].end:{line:1,column:1,offset:0})},Ye=-1;++Ye1?"-"+u:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(s)}]};e.patch(t,f);const d={type:"element",tagName:"sup",properties:{},children:[f]};return e.patch(t,d),e.applyData(t,d)}function oq(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function lq(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function gD(e,t){const n=t.referenceType;let r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+r}];const i=e.all(t),o=i[0];o&&o.type==="text"?o.value="["+o.value:i.unshift({type:"text",value:"["});const s=i[i.length-1];return s&&s.type==="text"?s.value+=r:i.push({type:"text",value:r}),i}function sq(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return gD(e,t);const i={src:Dl(r.url||""),alt:t.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);const o={type:"element",tagName:"img",properties:i,children:[]};return e.patch(t,o),e.applyData(t,o)}function uq(e,t){const n={src:Dl(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function cq(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function fq(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return gD(e,t);const i={href:Dl(r.url||"")};r.title!==null&&r.title!==void 0&&(i.title=r.title);const o={type:"element",tagName:"a",properties:i,children:e.all(t)};return e.patch(t,o),e.applyData(t,o)}function dq(e,t){const n={href:Dl(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function hq(e,t,n){const r=e.all(t),i=n?pq(n):vD(t),o={},s=[];if(typeof t.checked=="boolean"){const p=r[0];let m;p&&p.type==="element"&&p.tagName==="p"?m=p:(m={type:"element",tagName:"p",properties:{},children:[]},r.unshift(m)),m.children.length>0&&m.children.unshift({type:"text",value:" "}),m.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),o.className=["task-list-item"]}let u=-1;for(;++u1}function mq(e,t){const n={},r=e.all(t);let i=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++i0){const s={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},u=qy(t.children[1]),f=X2(t.children[t.children.length-1]);u&&f&&(s.position={start:u,end:f}),i.push(s)}const o={type:"element",tagName:"table",properties:{},children:e.wrap(i,!0)};return e.patch(t,o),e.applyData(t,o)}function xq(e,t,n){const r=n?n.children:void 0,o=(r?r.indexOf(t):1)===0?"th":"td",s=n&&n.type==="table"?n.align:void 0,u=s?s.length:t.children.length;let f=-1;const d=[];for(;++f0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return o.push(l_(t.slice(i),i>0,!1)),o.join("")}function l_(e,t,n){let r=0,i=e.length;if(t){let o=e.codePointAt(r);for(;o===a_||o===o_;)r++,o=e.codePointAt(r)}if(n){let o=e.codePointAt(i-1);for(;o===a_||o===o_;)i--,o=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}function Eq(e,t){const n={type:"text",value:Sq(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function _q(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const kq={blockquote:eq,break:tq,code:nq,delete:rq,emphasis:iq,footnoteReference:aq,heading:oq,html:lq,imageReference:sq,image:uq,inlineCode:cq,linkReference:fq,link:dq,listItem:hq,list:mq,paragraph:gq,root:vq,strong:yq,table:bq,tableCell:wq,tableRow:xq,text:Eq,thematicBreak:_q,toml:Zc,yaml:Zc,definition:Zc,footnoteDefinition:Zc};function Zc(){}const yD=-1,Dd=0,$s=1,Bf=2,Jy=3,eb=4,tb=5,nb=6,bD=7,xD=8,s_=typeof self=="object"?self:globalThis,Cq=(e,t)=>{const n=(i,o)=>(e.set(o,i),i),r=i=>{if(e.has(i))return e.get(i);const[o,s]=t[i];switch(o){case Dd:case yD:return n(s,i);case $s:{const u=n([],i);for(const f of s)u.push(r(f));return u}case Bf:{const u=n({},i);for(const[f,d]of s)u[r(f)]=r(d);return u}case Jy:return n(new Date(s),i);case eb:{const{source:u,flags:f}=s;return n(new RegExp(u,f),i)}case tb:{const u=n(new Map,i);for(const[f,d]of s)u.set(r(f),r(d));return u}case nb:{const u=n(new Set,i);for(const f of s)u.add(r(f));return u}case bD:{const{name:u,message:f}=s;return n(new s_[u](f),i)}case xD:return n(BigInt(s),i);case"BigInt":return n(Object(BigInt(s)),i);case"ArrayBuffer":return n(new Uint8Array(s).buffer,s);case"DataView":{const{buffer:u}=new Uint8Array(s);return n(new DataView(u),s)}}return n(new s_[o](s),i)};return r},u_=e=>Cq(new Map,e)(0),Ko="",{toString:Tq}={},{keys:Aq}=Object,Ms=e=>{const t=typeof e;if(t!=="object"||!e)return[Dd,t];const n=Tq.call(e).slice(8,-1);switch(n){case"Array":return[$s,Ko];case"Object":return[Bf,Ko];case"Date":return[Jy,Ko];case"RegExp":return[eb,Ko];case"Map":return[tb,Ko];case"Set":return[nb,Ko];case"DataView":return[$s,n]}return n.includes("Array")?[$s,n]:n.includes("Error")?[bD,n]:[Bf,n]},Qc=([e,t])=>e===Dd&&(t==="function"||t==="symbol"),Rq=(e,t,n,r)=>{const i=(s,u)=>{const f=r.push(s)-1;return n.set(u,f),f},o=s=>{if(n.has(s))return n.get(s);let[u,f]=Ms(s);switch(u){case Dd:{let p=s;switch(f){case"bigint":u=xD,p=s.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+f);p=null;break;case"undefined":return i([yD],s)}return i([u,p],s)}case $s:{if(f){let v=s;return f==="DataView"?v=new Uint8Array(s.buffer):f==="ArrayBuffer"&&(v=new Uint8Array(s)),i([f,[...v]],s)}const p=[],m=i([u,p],s);for(const v of s)p.push(o(v));return m}case Bf:{if(f)switch(f){case"BigInt":return i([f,s.toString()],s);case"Boolean":case"Number":case"String":return i([f,s.valueOf()],s)}if(t&&"toJSON"in s)return o(s.toJSON());const p=[],m=i([u,p],s);for(const v of Aq(s))(e||!Qc(Ms(s[v])))&&p.push([o(v),o(s[v])]);return m}case Jy:return i([u,s.toISOString()],s);case eb:{const{source:p,flags:m}=s;return i([u,{source:p,flags:m}],s)}case tb:{const p=[],m=i([u,p],s);for(const[v,g]of s)(e||!(Qc(Ms(v))||Qc(Ms(g))))&&p.push([o(v),o(g)]);return m}case nb:{const p=[],m=i([u,p],s);for(const v of s)(e||!Qc(Ms(v)))&&p.push(o(v));return m}}const{message:d}=s;return i([u,{name:f,message:d}],s)};return o},c_=(e,{json:t,lossy:n}={})=>{const r=[];return Rq(!(t||n),!!t,new Map,r)(e),r},Uf=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?u_(c_(e,t)):structuredClone(e):(e,t)=>u_(c_(e,t));function Dq(e,t){const n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function Nq(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function Oq(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||Dq,r=e.options.footnoteBackLabel||Nq,i=e.options.footnoteLabel||"Footnotes",o=e.options.footnoteLabelTagName||"h2",s=e.options.footnoteLabelProperties||{className:["sr-only"]},u=[];let f=-1;for(;++f0&&w.push({type:"text",value:" "});let _=typeof n=="string"?n:n(f,g);typeof _=="string"&&(_={type:"text",value:_}),w.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+v+(g>1?"-"+g:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(f,g),className:["data-footnote-backref"]},children:Array.isArray(_)?_:[_]})}const k=p[p.length-1];if(k&&k.type==="element"&&k.tagName==="p"){const _=k.children[k.children.length-1];_&&_.type==="text"?_.value+=" ":k.children.push({type:"text",value:" "}),k.children.push(...w)}else p.push(...w);const C={type:"element",tagName:"li",properties:{id:t+"fn-"+v},children:e.wrap(p,!0)};e.patch(d,C),u.push(C)}if(u.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:o,properties:{...Uf(s),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:` -`},{type:"element",tagName:"ol",properties:{},children:e.wrap(u,!0)},{type:"text",value:` -`}]}}const Nd=function(e){if(e==null)return Mq;if(typeof e=="function")return Od(e);if(typeof e=="object")return Array.isArray(e)?Lq(e):zq(e);if(typeof e=="string")return jq(e);throw new Error("Expected function, string, or object as test")};function Lq(e){const t=[];let n=-1;for(;++n":""))+")"})}return v;function v(){let g=wD,w,x,k;if((!t||o(f,d,p[p.length-1]||void 0))&&(g=Gq(n(f,p)),g[0]===wv))return g;if("children"in f&&f.children){const C=f;if(C.children&&g[0]!==Iq)for(x=(r?C.children.length:-1)+s,k=p.concat(C);x>-1&&x0&&n.push({type:"text",value:` -`}),n}function f_(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function d_(e,t){const n=Uq(e,t),r=n.one(e,void 0),i=Oq(n),o=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return i&&o.children.push({type:"text",value:` -`},i),o}function Yq(e,t){return e&&"run"in e?async function(n,r){const i=d_(n,{file:r,...t});await e.run(i,r)}:function(n,r){return d_(n,{file:r,...e||t})}}function h_(e){if(e)throw e}var og,p_;function Wq(){if(p_)return og;p_=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=function(d){return typeof Array.isArray=="function"?Array.isArray(d):t.call(d)==="[object Array]"},o=function(d){if(!d||t.call(d)!=="[object Object]")return!1;var p=e.call(d,"constructor"),m=d.constructor&&d.constructor.prototype&&e.call(d.constructor.prototype,"isPrototypeOf");if(d.constructor&&!p&&!m)return!1;var v;for(v in d);return typeof v>"u"||e.call(d,v)},s=function(d,p){n&&p.name==="__proto__"?n(d,p.name,{enumerable:!0,configurable:!0,value:p.newValue,writable:!0}):d[p.name]=p.newValue},u=function(d,p){if(p==="__proto__")if(e.call(d,p)){if(r)return r(d,p).value}else return;return d[p]};return og=function f(){var d,p,m,v,g,w,x=arguments[0],k=1,C=arguments.length,_=!1;for(typeof x=="boolean"&&(_=x,x=arguments[1]||{},k=2),(x==null||typeof x!="object"&&typeof x!="function")&&(x={});ks.length;let f;u&&s.push(i);try{f=e.apply(this,s)}catch(d){const p=d;if(u&&n)throw p;return i(p)}u||(f&&f.then&&typeof f.then=="function"?f.then(o,i):f instanceof Error?i(f):o(f))}function i(s,...u){n||(n=!0,t(s,...u))}function o(s){i(null,s)}}const Gr={basename:Qq,dirname:Jq,extname:eY,join:tY,sep:"/"};function Qq(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');bu(e);let n=0,r=-1,i=e.length,o;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(o){n=i+1;break}}else r<0&&(o=!0,r=i+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let s=-1,u=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(o){n=i+1;break}}else s<0&&(o=!0,s=i+1),u>-1&&(e.codePointAt(i)===t.codePointAt(u--)?u<0&&(r=i):(u=-1,r=s));return n===r?r=s:r<0&&(r=e.length),e.slice(n,r)}function Jq(e){if(bu(e),e.length===0)return".";let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||(r=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function eY(e){bu(e);let t=e.length,n=-1,r=0,i=-1,o=0,s;for(;t--;){const u=e.codePointAt(t);if(u===47){if(s){r=t+1;break}continue}n<0&&(s=!0,n=t+1),u===46?i<0?i=t:o!==1&&(o=1):i>-1&&(o=-1)}return i<0||n<0||o===0||o===1&&i===n-1&&i===r+1?"":e.slice(i,n)}function tY(...e){let t=-1,n;for(;++t0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function rY(e,t){let n="",r=0,i=-1,o=0,s=-1,u,f;for(;++s<=e.length;){if(s2){if(f=n.lastIndexOf("/"),f!==n.length-1){f<0?(n="",r=0):(n=n.slice(0,f),r=n.length-1-n.lastIndexOf("/")),i=s,o=0;continue}}else if(n.length>0){n="",r=0,i=s,o=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(i+1,s):n=e.slice(i+1,s),r=s-i-1;i=s,o=0}else u===46&&o>-1?o++:o=-1}return n}function bu(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const iY={cwd:aY};function aY(){return"/"}function _v(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function oY(e){if(typeof e=="string")e=new URL(e);else if(!_v(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return lY(e)}function lY(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const t=e.pathname;let n=-1;for(;++n0){let[g,...w]=p;const x=r[v][1];Ev(x)&&Ev(g)&&(g=lg(!0,x,g)),r[v]=[d,g,...w]}}}}const fY=new ib().freeze();function fg(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function dg(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function hg(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function g_(e){if(!Ev(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function v_(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function Jc(e){return dY(e)?e:new ED(e)}function dY(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function hY(e){return typeof e=="string"||pY(e)}function pY(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const mY="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",y_=[],b_={allowDangerousHtml:!0},gY=/^(https?|ircs?|mailto|xmpp)$/i,vY=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function yY(e){const t=e.allowedElements,n=e.allowElement,r=e.children||"",i=e.className,o=e.components,s=e.disallowedElements,u=e.rehypePlugins||y_,f=e.remarkPlugins||y_,d=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...b_}:b_,p=e.skipHtml,m=e.unwrapDisallowed,v=e.urlTransform||bY,g=fY().use(JV).use(f).use(Yq,d).use(u),w=new ED;typeof r=="string"&&(w.value=r);for(const _ of vY)Object.hasOwn(e,_.from)&&(""+_.from+(_.to?"use `"+_.to+"` instead":"remove it")+mY+_.id,void 0);const x=g.parse(w);let k=g.runSync(x,w);return i&&(k={type:"element",tagName:"div",properties:{className:i},children:k.type==="root"?k.children:[k]}),rb(k,C),Q2(k,{Fragment:S.Fragment,components:o,ignoreInvalidStyle:!0,jsx:S.jsx,jsxs:S.jsxs,passKeys:!0,passNode:!0});function C(_,T,N){if(_.type==="raw"&&N&&typeof T=="number")return p?N.children.splice(T,1):N.children[T]={type:"text",value:_.value},T;if(_.type==="element"){let D;for(D in rg)if(Object.hasOwn(rg,D)&&Object.hasOwn(_.properties,D)){const z=_.properties[D],R=rg[D];(R===null||R.includes(_.tagName))&&(_.properties[D]=v(String(z||""),D,_))}}if(_.type==="element"){let D=t?!t.includes(_.tagName):s?s.includes(_.tagName):!1;if(!D&&n&&typeof T=="number"&&(D=!n(_,T,N)),D&&N&&typeof T=="number")return m&&_.children?N.children.splice(T,1,..._.children):N.children.splice(T,1),T}}}function bY(e){const t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),i=e.indexOf("/");return t===-1||i!==-1&&t>i||n!==-1&&t>n||r!==-1&&t>r||gY.test(e.slice(0,t))?e:""}function x_(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let r=0,i=n.indexOf(t);for(;i!==-1;)r++,i=n.indexOf(t,i+t.length);return r}function xY(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function wY(e,t,n){const i=Nd((n||{}).ignore||[]),o=SY(t);let s=-1;for(;++s0?{type:"text",value:z}:void 0),z===!1?v.lastIndex=N+1:(w!==N&&_.push({type:"text",value:d.value.slice(w,N)}),Array.isArray(z)?_.push(...z):z&&_.push(z),w=N+T[0].length,C=!0),!v.global)break;T=v.exec(d.value)}return C?(w?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(")");const i=x_(e,"(");let o=x_(e,")");for(;r!==-1&&i>o;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),o++;return[e,n]}function _D(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||to(n)||Ad(n))&&(!t||n!==47)}kD.peek=VY;function PY(){this.buffer()}function FY(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function IY(){this.buffer()}function GY(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function BY(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Tr(this.sliceSerialize(e)).toLowerCase(),n.label=t}function UY(e){this.exit(e)}function HY(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Tr(this.sliceSerialize(e)).toLowerCase(),n.label=t}function $Y(e){this.exit(e)}function VY(){return"["}function kD(e,t,n,r){const i=n.createTracker(r);let o=i.move("[^");const s=n.enter("footnoteReference"),u=n.enter("reference");return o+=i.move(n.safe(n.associationId(e),{after:"]",before:o})),u(),s(),o+=i.move("]"),o}function qY(){return{enter:{gfmFootnoteCallString:PY,gfmFootnoteCall:FY,gfmFootnoteDefinitionLabelString:IY,gfmFootnoteDefinition:GY},exit:{gfmFootnoteCallString:BY,gfmFootnoteCall:UY,gfmFootnoteDefinitionLabelString:HY,gfmFootnoteDefinition:$Y}}}function YY(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:kD},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(r,i,o,s){const u=o.createTracker(s);let f=u.move("[^");const d=o.enter("footnoteDefinition"),p=o.enter("label");return f+=u.move(o.safe(o.associationId(r),{before:f,after:"]"})),p(),f+=u.move("]:"),r.children&&r.children.length>0&&(u.shift(4),f+=u.move((t?` -`:" ")+o.indentLines(o.containerFlow(r,u.current()),t?CD:WY))),d(),f}}function WY(e,t,n){return t===0?e:CD(e,t,n)}function CD(e,t,n){return(n?"":" ")+e}const XY=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];TD.peek=eW;function KY(){return{canContainEols:["delete"],enter:{strikethrough:QY},exit:{strikethrough:JY}}}function ZY(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:XY}],handlers:{delete:TD}}}function QY(e){this.enter({type:"delete",children:[]},e)}function JY(e){this.exit(e)}function TD(e,t,n,r){const i=n.createTracker(r),o=n.enter("strikethrough");let s=i.move("~~");return s+=n.containerPhrasing(e,{...i.current(),before:s,after:"~"}),s+=i.move("~~"),o(),s}function eW(){return"~"}function tW(e){return e.length}function nW(e,t){const n=t||{},r=(n.align||[]).concat(),i=n.stringLength||tW,o=[],s=[],u=[],f=[];let d=0,p=-1;for(;++pd&&(d=e[p].length);++Cf[C])&&(f[C]=T)}x.push(_)}s[p]=x,u[p]=k}let m=-1;if(typeof r=="object"&&"length"in r)for(;++mf[m]&&(f[m]=_),g[m]=_),v[m]=T}s.splice(1,0,v),u.splice(1,0,g),p=-1;const w=[];for(;++p "),o.shift(2);const s=n.indentLines(n.containerFlow(e,o.current()),aW);return i(),s}function aW(e,t,n){return">"+(n?"":" ")+e}function oW(e,t){return S_(e,t.inConstruct,!0)&&!S_(e,t.notInConstruct,!1)}function S_(e,t,n){if(typeof t=="string"&&(t=[t]),!t||t.length===0)return n;let r=-1;for(;++rs&&(s=o):o=1,i=r+t.length,r=n.indexOf(t,i);return s}function lW(e,t){return!!(t.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function sW(e){const t=e.options.fence||"`";if(t!=="`"&&t!=="~")throw new Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function uW(e,t,n,r){const i=sW(n),o=e.value||"",s=i==="`"?"GraveAccent":"Tilde";if(lW(e,n)){const m=n.enter("codeIndented"),v=n.indentLines(o,cW);return m(),v}const u=n.createTracker(r),f=i.repeat(Math.max(AD(o,i)+1,3)),d=n.enter("codeFenced");let p=u.move(f);if(e.lang){const m=n.enter(`codeFencedLang${s}`);p+=u.move(n.safe(e.lang,{before:p,after:" ",encode:["`"],...u.current()})),m()}if(e.lang&&e.meta){const m=n.enter(`codeFencedMeta${s}`);p+=u.move(" "),p+=u.move(n.safe(e.meta,{before:p,after:` -`,encode:["`"],...u.current()})),m()}return p+=u.move(` -`),o&&(p+=u.move(o+` -`)),p+=u.move(f),d(),p}function cW(e,t,n){return(n?"":" ")+e}function ab(e){const t=e.options.quote||'"';if(t!=='"'&&t!=="'")throw new Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function fW(e,t,n,r){const i=ab(n),o=i==='"'?"Quote":"Apostrophe",s=n.enter("definition");let u=n.enter("label");const f=n.createTracker(r);let d=f.move("[");return d+=f.move(n.safe(n.associationId(e),{before:d,after:"]",...f.current()})),d+=f.move("]: "),u(),!e.url||/[\0- \u007F]/.test(e.url)?(u=n.enter("destinationLiteral"),d+=f.move("<"),d+=f.move(n.safe(e.url,{before:d,after:">",...f.current()})),d+=f.move(">")):(u=n.enter("destinationRaw"),d+=f.move(n.safe(e.url,{before:d,after:e.title?" ":` -`,...f.current()}))),u(),e.title&&(u=n.enter(`title${o}`),d+=f.move(" "+i),d+=f.move(n.safe(e.title,{before:d,after:i,...f.current()})),d+=f.move(i),u()),s(),d}function dW(e){const t=e.options.emphasis||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function nu(e){return""+e.toString(16).toUpperCase()+";"}function Hf(e,t,n){const r=pl(e),i=pl(t);return r===void 0?i===void 0?n==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}RD.peek=hW;function RD(e,t,n,r){const i=dW(n),o=n.enter("emphasis"),s=n.createTracker(r),u=s.move(i);let f=s.move(n.containerPhrasing(e,{after:i,before:u,...s.current()}));const d=f.charCodeAt(0),p=Hf(r.before.charCodeAt(r.before.length-1),d,i);p.inside&&(f=nu(d)+f.slice(1));const m=f.charCodeAt(f.length-1),v=Hf(r.after.charCodeAt(0),m,i);v.inside&&(f=f.slice(0,-1)+nu(m));const g=s.move(i);return o(),n.attentionEncodeSurroundingInfo={after:v.outside,before:p.outside},u+f+g}function hW(e,t,n){return n.options.emphasis||"*"}function pW(e,t){let n=!1;return rb(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return n=!0,wv}),!!((!e.depth||e.depth<3)&&Ky(e)&&(t.options.setext||n))}function mW(e,t,n,r){const i=Math.max(Math.min(6,e.depth||1),1),o=n.createTracker(r);if(pW(e,n)){const p=n.enter("headingSetext"),m=n.enter("phrasing"),v=n.containerPhrasing(e,{...o.current(),before:` -`,after:` -`});return m(),p(),v+` -`+(i===1?"=":"-").repeat(v.length-(Math.max(v.lastIndexOf("\r"),v.lastIndexOf(` -`))+1))}const s="#".repeat(i),u=n.enter("headingAtx"),f=n.enter("phrasing");o.move(s+" ");let d=n.containerPhrasing(e,{before:"# ",after:` -`,...o.current()});return/^[\t ]/.test(d)&&(d=nu(d.charCodeAt(0))+d.slice(1)),d=d?s+" "+d:s,n.options.closeAtx&&(d+=" "+s),f(),u(),d}DD.peek=gW;function DD(e){return e.value||""}function gW(){return"<"}ND.peek=vW;function ND(e,t,n,r){const i=ab(n),o=i==='"'?"Quote":"Apostrophe",s=n.enter("image");let u=n.enter("label");const f=n.createTracker(r);let d=f.move("![");return d+=f.move(n.safe(e.alt,{before:d,after:"]",...f.current()})),d+=f.move("]("),u(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(u=n.enter("destinationLiteral"),d+=f.move("<"),d+=f.move(n.safe(e.url,{before:d,after:">",...f.current()})),d+=f.move(">")):(u=n.enter("destinationRaw"),d+=f.move(n.safe(e.url,{before:d,after:e.title?" ":")",...f.current()}))),u(),e.title&&(u=n.enter(`title${o}`),d+=f.move(" "+i),d+=f.move(n.safe(e.title,{before:d,after:i,...f.current()})),d+=f.move(i),u()),d+=f.move(")"),s(),d}function vW(){return"!"}OD.peek=yW;function OD(e,t,n,r){const i=e.referenceType,o=n.enter("imageReference");let s=n.enter("label");const u=n.createTracker(r);let f=u.move("![");const d=n.safe(e.alt,{before:f,after:"]",...u.current()});f+=u.move(d+"]["),s();const p=n.stack;n.stack=[],s=n.enter("reference");const m=n.safe(n.associationId(e),{before:f,after:"]",...u.current()});return s(),n.stack=p,o(),i==="full"||!d||d!==m?f+=u.move(m+"]"):i==="shortcut"?f=f.slice(0,-1):f+=u.move("]"),f}function yW(){return"!"}LD.peek=bW;function LD(e,t,n){let r=e.value||"",i="`",o=-1;for(;new RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++o\u007F]/.test(e.url))}jD.peek=xW;function jD(e,t,n,r){const i=ab(n),o=i==='"'?"Quote":"Apostrophe",s=n.createTracker(r);let u,f;if(zD(e,n)){const p=n.stack;n.stack=[],u=n.enter("autolink");let m=s.move("<");return m+=s.move(n.containerPhrasing(e,{before:m,after:">",...s.current()})),m+=s.move(">"),u(),n.stack=p,m}u=n.enter("link"),f=n.enter("label");let d=s.move("[");return d+=s.move(n.containerPhrasing(e,{before:d,after:"](",...s.current()})),d+=s.move("]("),f(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(f=n.enter("destinationLiteral"),d+=s.move("<"),d+=s.move(n.safe(e.url,{before:d,after:">",...s.current()})),d+=s.move(">")):(f=n.enter("destinationRaw"),d+=s.move(n.safe(e.url,{before:d,after:e.title?" ":")",...s.current()}))),f(),e.title&&(f=n.enter(`title${o}`),d+=s.move(" "+i),d+=s.move(n.safe(e.title,{before:d,after:i,...s.current()})),d+=s.move(i),f()),d+=s.move(")"),u(),d}function xW(e,t,n){return zD(e,n)?"<":"["}MD.peek=wW;function MD(e,t,n,r){const i=e.referenceType,o=n.enter("linkReference");let s=n.enter("label");const u=n.createTracker(r);let f=u.move("[");const d=n.containerPhrasing(e,{before:f,after:"]",...u.current()});f+=u.move(d+"]["),s();const p=n.stack;n.stack=[],s=n.enter("reference");const m=n.safe(n.associationId(e),{before:f,after:"]",...u.current()});return s(),n.stack=p,o(),i==="full"||!d||d!==m?f+=u.move(m+"]"):i==="shortcut"?f=f.slice(0,-1):f+=u.move("]"),f}function wW(){return"["}function ob(e){const t=e.options.bullet||"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function SW(e){const t=ob(e),n=e.options.bulletOther;if(!n)return t==="*"?"-":"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw new Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function EW(e){const t=e.options.bulletOrdered||".";if(t!=="."&&t!==")")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function PD(e){const t=e.options.rule||"*";if(t!=="*"&&t!=="-"&&t!=="_")throw new Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function _W(e,t,n,r){const i=n.enter("list"),o=n.bulletCurrent;let s=e.ordered?EW(n):ob(n);const u=e.ordered?s==="."?")":".":SW(n);let f=t&&n.bulletLastUsed?s===n.bulletLastUsed:!1;if(!e.ordered){const p=e.children?e.children[0]:void 0;if((s==="*"||s==="-")&&p&&(!p.children||!p.children[0])&&n.stack[n.stack.length-1]==="list"&&n.stack[n.stack.length-2]==="listItem"&&n.stack[n.stack.length-3]==="list"&&n.stack[n.stack.length-4]==="listItem"&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(f=!0),PD(n)===s&&p){let m=-1;for(;++m-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+o);let s=o.length+1;(i==="tab"||i==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(s=Math.ceil(s/4)*4);const u=n.createTracker(r);u.move(o+" ".repeat(s-o.length)),u.shift(s);const f=n.enter("listItem"),d=n.indentLines(n.containerFlow(e,u.current()),p);return f(),d;function p(m,v,g){return v?(g?"":" ".repeat(s))+m:(g?o:o+" ".repeat(s-o.length))+m}}function TW(e,t,n,r){const i=n.enter("paragraph"),o=n.enter("phrasing"),s=n.containerPhrasing(e,r);return o(),i(),s}const AW=Nd(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function RW(e,t,n,r){return(e.children.some(function(s){return AW(s)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function DW(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}FD.peek=NW;function FD(e,t,n,r){const i=DW(n),o=n.enter("strong"),s=n.createTracker(r),u=s.move(i+i);let f=s.move(n.containerPhrasing(e,{after:i,before:u,...s.current()}));const d=f.charCodeAt(0),p=Hf(r.before.charCodeAt(r.before.length-1),d,i);p.inside&&(f=nu(d)+f.slice(1));const m=f.charCodeAt(f.length-1),v=Hf(r.after.charCodeAt(0),m,i);v.inside&&(f=f.slice(0,-1)+nu(m));const g=s.move(i+i);return o(),n.attentionEncodeSurroundingInfo={after:v.outside,before:p.outside},u+f+g}function NW(e,t,n){return n.options.strong||"*"}function OW(e,t,n,r){return n.safe(e.value,r)}function LW(e){const t=e.options.ruleRepetition||3;if(t<3)throw new Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function zW(e,t,n){const r=(PD(n)+(n.options.ruleSpaces?" ":"")).repeat(LW(n));return n.options.ruleSpaces?r.slice(0,-1):r}const ID={blockquote:iW,break:E_,code:uW,definition:fW,emphasis:RD,hardBreak:E_,heading:mW,html:DD,image:ND,imageReference:OD,inlineCode:LD,link:jD,linkReference:MD,list:_W,listItem:CW,paragraph:TW,root:RW,strong:FD,text:OW,thematicBreak:zW};function jW(){return{enter:{table:MW,tableData:__,tableHeader:__,tableRow:FW},exit:{codeText:IW,table:PW,tableData:vg,tableHeader:vg,tableRow:vg}}}function MW(e){const t=e._align;this.enter({type:"table",align:t.map(function(n){return n==="none"?null:n}),children:[]},e),this.data.inTable=!0}function PW(e){this.exit(e),this.data.inTable=void 0}function FW(e){this.enter({type:"tableRow",children:[]},e)}function vg(e){this.exit(e)}function __(e){this.enter({type:"tableCell",children:[]},e)}function IW(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,GW));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function GW(e,t){return t==="|"?t:e}function BW(e){const t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,o=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:` -`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:v,table:s,tableCell:f,tableRow:u}};function s(g,w,x,k){return d(p(g,x,k),g.align)}function u(g,w,x,k){const C=m(g,x,k),_=d([C]);return _.slice(0,_.indexOf(` -`))}function f(g,w,x,k){const C=x.enter("tableCell"),_=x.enter("phrasing"),T=x.containerPhrasing(g,{...k,before:o,after:o});return _(),C(),T}function d(g,w){return nW(g,{align:w,alignDelimiters:r,padding:n,stringLength:i})}function p(g,w,x){const k=g.children;let C=-1;const _=[],T=w.enter("table");for(;++C0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const aX={tokenize:hX,partial:!0};function oX(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:cX,continuation:{tokenize:fX},exit:dX}},text:{91:{name:"gfmFootnoteCall",tokenize:uX},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:lX,resolveTo:sX}}}}function lX(e,t,n){const r=this;let i=r.events.length;const o=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let s;for(;i--;){const f=r.events[i][1];if(f.type==="labelImage"){s=f;break}if(f.type==="gfmFootnoteCall"||f.type==="labelLink"||f.type==="label"||f.type==="image"||f.type==="link")break}return u;function u(f){if(!s||!s._balanced)return n(f);const d=Tr(r.sliceSerialize({start:s.end,end:r.now()}));return d.codePointAt(0)!==94||!o.includes(d.slice(1))?n(f):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(f),e.exit("gfmFootnoteCallLabelMarker"),t(f))}}function sX(e,t){let n=e.length;for(;n--;)if(e[n][1].type==="labelImage"&&e[n][0]==="enter"){e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;const o={type:"gfmFootnoteCallString",start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},s={type:"chunkString",contentType:"string",start:Object.assign({},o.start),end:Object.assign({},o.end)},u=[e[n+1],e[n+2],["enter",r,t],e[n+3],e[n+4],["enter",i,t],["exit",i,t],["enter",o,t],["enter",s,t],["exit",s,t],["exit",o,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(n,e.length-n+1,...u),e}function uX(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let o=0,s;return u;function u(m){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(m),e.exit("gfmFootnoteCallLabelMarker"),f}function f(m){return m!==94?n(m):(e.enter("gfmFootnoteCallMarker"),e.consume(m),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",d)}function d(m){if(o>999||m===93&&!s||m===null||m===91||Tt(m))return n(m);if(m===93){e.exit("chunkString");const v=e.exit("gfmFootnoteCallString");return i.includes(Tr(r.sliceSerialize(v)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(m),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(m)}return Tt(m)||(s=!0),o++,e.consume(m),m===92?p:d}function p(m){return m===91||m===92||m===93?(e.consume(m),o++,d):d(m)}}function cX(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let o,s=0,u;return f;function f(w){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(w),e.exit("gfmFootnoteDefinitionLabelMarker"),d}function d(w){return w===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(w),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",p):n(w)}function p(w){if(s>999||w===93&&!u||w===null||w===91||Tt(w))return n(w);if(w===93){e.exit("chunkString");const x=e.exit("gfmFootnoteDefinitionLabelString");return o=Tr(r.sliceSerialize(x)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(w),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),v}return Tt(w)||(u=!0),s++,e.consume(w),w===92?m:p}function m(w){return w===91||w===92||w===93?(e.consume(w),s++,p):p(w)}function v(w){return w===58?(e.enter("definitionMarker"),e.consume(w),e.exit("definitionMarker"),i.includes(o)||i.push(o),lt(e,g,"gfmFootnoteDefinitionWhitespace")):n(w)}function g(w){return t(w)}}function fX(e,t,n){return e.check(yu,t,e.attempt(aX,t,n))}function dX(e){e.exit("gfmFootnoteDefinition")}function hX(e,t,n){const r=this;return lt(e,i,"gfmFootnoteDefinitionIndent",5);function i(o){const s=r.events[r.events.length-1];return s&&s[1].type==="gfmFootnoteDefinitionIndent"&&s[2].sliceSerialize(s[1],!0).length===4?t(o):n(o)}}function pX(e){let n=(e||{}).singleTilde;const r={name:"strikethrough",tokenize:o,resolveAll:i};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function i(s,u){let f=-1;for(;++f1?f(w):(s.consume(w),m++,g);if(m<2&&!n)return f(w);const k=s.exit("strikethroughSequenceTemporary"),C=pl(w);return k._open=!C||C===2&&!!x,k._close=!x||x===2&&!!C,u(w)}}}class mX{constructor(){this.map=[]}add(t,n,r){gX(this,t,n,r)}consume(t){if(this.map.sort(function(o,s){return o[0]-s[0]}),this.map.length===0)return;let n=this.map.length;const r=[];for(;n>0;)n-=1,r.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];r.push(t.slice()),t.length=0;let i=r.pop();for(;i;){for(const o of i)t.push(o);i=r.pop()}this.map.length=0}}function gX(e,t,n,r){let i=0;if(!(n===0&&r.length===0)){for(;i-1;){const Y=r.events[V][1].type;if(Y==="lineEnding"||Y==="linePrefix")V--;else break}const q=V>-1?r.events[V][1].type:null,I=q==="tableHead"||q==="tableRow"?z:f;return I===z&&r.parser.lazy[r.now().line]?n(j):I(j)}function f(j){return e.enter("tableHead"),e.enter("tableRow"),d(j)}function d(j){return j===124||(s=!0,o+=1),p(j)}function p(j){return j===null?n(j):Ue(j)?o>1?(o=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(j),e.exit("lineEnding"),g):n(j):ut(j)?lt(e,p,"whitespace")(j):(o+=1,s&&(s=!1,i+=1),j===124?(e.enter("tableCellDivider"),e.consume(j),e.exit("tableCellDivider"),s=!0,p):(e.enter("data"),m(j)))}function m(j){return j===null||j===124||Tt(j)?(e.exit("data"),p(j)):(e.consume(j),j===92?v:m)}function v(j){return j===92||j===124?(e.consume(j),m):m(j)}function g(j){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(j):(e.enter("tableDelimiterRow"),s=!1,ut(j)?lt(e,w,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(j):w(j))}function w(j){return j===45||j===58?k(j):j===124?(s=!0,e.enter("tableCellDivider"),e.consume(j),e.exit("tableCellDivider"),x):D(j)}function x(j){return ut(j)?lt(e,k,"whitespace")(j):k(j)}function k(j){return j===58?(o+=1,s=!0,e.enter("tableDelimiterMarker"),e.consume(j),e.exit("tableDelimiterMarker"),C):j===45?(o+=1,C(j)):j===null||Ue(j)?N(j):D(j)}function C(j){return j===45?(e.enter("tableDelimiterFiller"),_(j)):D(j)}function _(j){return j===45?(e.consume(j),_):j===58?(s=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(j),e.exit("tableDelimiterMarker"),T):(e.exit("tableDelimiterFiller"),T(j))}function T(j){return ut(j)?lt(e,N,"whitespace")(j):N(j)}function N(j){return j===124?w(j):j===null||Ue(j)?!s||i!==o?D(j):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(j)):D(j)}function D(j){return n(j)}function z(j){return e.enter("tableRow"),R(j)}function R(j){return j===124?(e.enter("tableCellDivider"),e.consume(j),e.exit("tableCellDivider"),R):j===null||Ue(j)?(e.exit("tableRow"),t(j)):ut(j)?lt(e,R,"whitespace")(j):(e.enter("data"),B(j))}function B(j){return j===null||j===124||Tt(j)?(e.exit("data"),R(j)):(e.consume(j),j===92?P:B)}function P(j){return j===92||j===124?(e.consume(j),B):B(j)}}function xX(e,t){let n=-1,r=!0,i=0,o=[0,0,0,0],s=[0,0,0,0],u=!1,f=0,d,p,m;const v=new mX;for(;++nn[2]+1){const w=n[2]+1,x=n[3]-n[2]-1;e.add(w,x,[])}}e.add(n[3]+1,0,[["exit",m,t]])}return i!==void 0&&(o.end=Object.assign({},el(t.events,i)),e.add(i,0,[["exit",o,t]]),o=void 0),o}function C_(e,t,n,r,i){const o=[],s=el(t.events,n);i&&(i.end=Object.assign({},s),o.push(["exit",i,t])),r.end=Object.assign({},s),o.push(["exit",r,t]),e.add(n+1,0,o)}function el(e,t){const n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}const wX={name:"tasklistCheck",tokenize:EX};function SX(){return{text:{91:wX}}}function EX(e,t,n){const r=this;return i;function i(f){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(f):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(f),e.exit("taskListCheckMarker"),o)}function o(f){return Tt(f)?(e.enter("taskListCheckValueUnchecked"),e.consume(f),e.exit("taskListCheckValueUnchecked"),s):f===88||f===120?(e.enter("taskListCheckValueChecked"),e.consume(f),e.exit("taskListCheckValueChecked"),s):n(f)}function s(f){return f===93?(e.enter("taskListCheckMarker"),e.consume(f),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),u):n(f)}function u(f){return Ue(f)?t(f):ut(f)?e.check({tokenize:_X},t,n)(f):n(f)}}function _X(e,t,n){return lt(e,r,"whitespace");function r(i){return i===null?n(i):t(i)}}function kX(e){return rD([KW(),oX(),pX(e),yX(),SX()])}const CX={};function TX(e){const t=this,n=e||CX,r=t.data(),i=r.micromarkExtensions||(r.micromarkExtensions=[]),o=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),s=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);i.push(kX(n)),o.push(qW()),s.push(YW(n))}function AX(e){const t=this;t.compiler=n;function n(r,i){return Q2(r,{filePath:i.path,...e})}}function RX(){return{enter:{mathFlow:e,mathFlowFenceMeta:t,mathText:o},exit:{mathFlow:i,mathFlowFence:r,mathFlowFenceMeta:n,mathFlowValue:u,mathText:s,mathTextData:u}};function e(f){const d={type:"element",tagName:"code",properties:{className:["language-math","math-display"]},children:[]};this.enter({type:"math",meta:null,value:"",data:{hName:"pre",hChildren:[d]}},f)}function t(){this.buffer()}function n(){const f=this.resume(),d=this.stack[this.stack.length-1];d.type,d.meta=f}function r(){this.data.mathFlowInside||(this.buffer(),this.data.mathFlowInside=!0)}function i(f){const d=this.resume().replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),p=this.stack[this.stack.length-1];p.type,this.exit(f),p.value=d;const m=p.data.hChildren[0];m.type,m.tagName,m.children.push({type:"text",value:d}),this.data.mathFlowInside=void 0}function o(f){this.enter({type:"inlineMath",value:"",data:{hName:"code",hProperties:{className:["language-math","math-inline"]},hChildren:[]}},f),this.buffer()}function s(f){const d=this.resume(),p=this.stack[this.stack.length-1];p.type,this.exit(f),p.value=d,p.data.hChildren.push({type:"text",value:d})}function u(f){this.config.enter.data.call(this,f),this.config.exit.data.call(this,f)}}function DX(e){let t=(e||{}).singleDollarTextMath;return t==null&&(t=!0),r.peek=i,{unsafe:[{character:"\r",inConstruct:"mathFlowMeta"},{character:` -`,inConstruct:"mathFlowMeta"},{character:"$",after:t?void 0:"\\$",inConstruct:"phrasing"},{character:"$",inConstruct:"mathFlowMeta"},{atBreak:!0,character:"$",after:"\\$"}],handlers:{math:n,inlineMath:r}};function n(o,s,u,f){const d=o.value||"",p=u.createTracker(f),m="$".repeat(Math.max(AD(d,"$")+1,2)),v=u.enter("mathFlow");let g=p.move(m);if(o.meta){const w=u.enter("mathFlowMeta");g+=p.move(u.safe(o.meta,{after:` -`,before:g,encode:["$"],...p.current()})),w()}return g+=p.move(` -`),d&&(g+=p.move(d+` -`)),g+=p.move(m),v(),g}function r(o,s,u){let f=o.value||"",d=1;for(t||d++;new RegExp("(^|[^$])"+"\\$".repeat(d)+"([^$]|$)").test(f);)d++;const p="$".repeat(d);/[^ \r\n]/.test(f)&&(/^[ \r\n]/.test(f)&&/[ \r\n]$/.test(f)||/^\$|\$$/.test(f))&&(f=" "+f+" ");let m=-1;for(;++mS.jsx(yY,{className:"prose lg:prose-xs dark:prose-invert max-w-none text-base",remarkPlugins:[TX,IX],rehypePlugins:[AX],skipHtml:!1,children:e.content});function BX(){const[e,t]=E.useState(()=>Qe.getState().retrievalHistory||[]),[n,r]=E.useState(""),[i,o]=E.useState(!1),s=E.useRef(null),u=E.useCallback(()=>{var m;(m=s.current)==null||m.scrollIntoView({behavior:"smooth"})},[]),f=E.useCallback(async m=>{if(m.preventDefault(),!n.trim()||i)return;const v={content:n,role:"user"},g={content:"",role:"assistant"},w=[...e];t([...w,v,g]),r(""),o(!0);const x=(_,T)=>{g.content+=_,t(N=>{const D=[...N],z=D[D.length-1];return z.role==="assistant"&&(z.content=g.content,z.isError=T),D})},k=Qe.getState(),C={...k.querySettings,query:v.content,conversation_history:w.filter(_=>_.isError!==!0).map(_=>({role:_.role,content:_.content}))};try{if(k.querySettings.stream){let _="";await sM(C,x,T=>{_+=T}),_&&(g.content&&(_=g.content+` -`+_),x(_,!0))}else{const _=await lM(C);x(_.response)}}catch(_){x(`Error: Failed to get response -${Cr(_)}`,!0)}finally{o(!1),Qe.getState().setRetrievalHistory([...w,v,g])}},[n,i,e,t]),d=jy(e,100);E.useEffect(()=>u(),[d,u]);const p=E.useCallback(()=>{t([]),Qe.getState().setRetrievalHistory([])},[t]);return S.jsxs("div",{className:"flex size-full gap-2 px-2 pb-12",children:[S.jsxs("div",{className:"flex grow flex-col gap-4",children:[S.jsx("div",{className:"relative grow",children:S.jsx("div",{className:"bg-primary-foreground/60 absolute inset-0 flex flex-col overflow-auto rounded-lg border p-2",children:S.jsxs("div",{className:"flex min-h-0 flex-1 flex-col gap-2",children:[e.length===0?S.jsx("div",{className:"text-muted-foreground flex h-full items-center justify-center text-lg",children:"Start a retrieval by typing your query below"}):e.map((m,v)=>S.jsx("div",{className:`flex ${m.role==="user"?"justify-end":"justify-start"}`,children:S.jsxs("div",{className:`max-w-[80%] rounded-lg px-4 py-2 ${m.role==="user"?"bg-primary text-primary-foreground":m.isError?"bg-red-100 text-red-600 dark:bg-red-950 dark:text-red-400":"bg-muted"}`,children:[S.jsx("pre",{className:"break-words whitespace-pre-wrap",children:S.jsx(GX,{message:m})}),m.content.length===0&&S.jsx(jM,{className:"animate-spin duration-2000"})]})},v)),S.jsx("div",{ref:s,className:"pb-1"})]})})}),S.jsxs("form",{onSubmit:f,className:"flex shrink-0 items-center gap-2",children:[S.jsxs(Ot,{type:"button",variant:"outline",onClick:p,disabled:i,size:"sm",children:[S.jsx(wk,{}),"Clear"]}),S.jsx(Za,{className:"flex-1",value:n,onChange:m=>r(m.target.value),placeholder:"Type your query...",disabled:i}),S.jsxs(Ot,{type:"submit",variant:"default",disabled:i,size:"sm",children:[S.jsx(ZM,{}),"Send"]})]})]}),S.jsx(s8,{})]})}function UX(){return S.jsx("iframe",{src:G_+"/docs",className:"size-full"})}function HX(){const e=Mn.use.message(),t=Qe.use.enableHealthCheck(),[n]=E.useState(()=>Qe.getState().currentTab),[r,i]=E.useState(!1);E.useEffect(()=>{if(!t)return;Mn.getState().check();const s=setInterval(async()=>{await Mn.getState().check()},xz*1e3);return()=>clearInterval(s)},[t]);const o=E.useCallback(s=>Qe.getState().setCurrentTab(s),[]);return E.useEffect(()=>{if(e&&(e.includes(vk)||e.includes(yk))){i(!0);return}i(!1)},[e,i]),S.jsx(_z,{children:S.jsxs("main",{className:"flex h-screen w-screen overflow-x-hidden",children:[S.jsxs(C3,{defaultValue:n,className:"!m-0 flex grow flex-col !p-0",onValueChange:o,children:[S.jsx(A3,{}),S.jsxs("div",{className:"relative grow",children:[S.jsx(Ps,{value:"documents",className:"absolute top-0 right-0 bottom-0 left-0",children:S.jsx(u9,{})}),S.jsx(Ps,{value:"knowledge-graph",className:"absolute top-0 right-0 bottom-0 left-0",children:S.jsx(LH,{})}),S.jsx(Ps,{value:"retrieval",className:"absolute top-0 right-0 bottom-0 left-0",children:S.jsx(BX,{})}),S.jsx(Ps,{value:"api",className:"absolute top-0 right-0 bottom-0 left-0",children:S.jsx(UX,{})})]})]}),t&&S.jsx(s3,{}),e!==null&&!r&&S.jsx(cP,{}),r&&S.jsx(WI,{}),S.jsx(YI,{})]})})}vL.createRoot(document.getElementById("root")).render(S.jsx(E.StrictMode,{children:S.jsx(HX,{})})); diff --git a/lightrag/api/webui/assets/index-CLsJV-0i.css b/lightrag/api/webui/assets/index-CLsJV-0i.css deleted file mode 100644 index 0e1032b4..00000000 --- a/lightrag/api/webui/assets/index-CLsJV-0i.css +++ /dev/null @@ -1 +0,0 @@ -/*! tailwindcss v4.0.7 | 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!important}.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}.list-item{display:list-item}.table{display:table}.table-cell{display:table-cell}.table-row{display:table-row}.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-40{height:calc(var(--spacing)*40)}.h-52{height:calc(var(--spacing)*52)}.h-84{height:calc(var(--spacing)*84)}.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-100{background-color:var(--color-red-100)}.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)}.lowercase{text-transform:lowercase}.uppercase{text-transform:uppercase}.italic{font-style:italic}.ordinal{--tw-ordinal:ordinal;font-variant-numeric:var(--tw-ordinal,)var(--tw-slashed-zero,)var(--tw-numeric-figure,)var(--tw-numeric-spacing,)var(--tw-numeric-fraction,)}.overline{text-decoration-line:overline}.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}.ring{--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)}.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)}.dark\:bg-red-950:is(.dark *){background-color:var(--color-red-950)}.dark\:text-red-400:is(.dark *){color:var(--color-red-400)}.\[\&_\[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-ordinal{syntax:"*";inherits:false}@property --tw-slashed-zero{syntax:"*";inherits:false}@property --tw-numeric-figure{syntax:"*";inherits:false}@property --tw-numeric-spacing{syntax:"*";inherits:false}@property --tw-numeric-fraction{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-drop-shadow{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-DbuMPJAD.js b/lightrag/api/webui/assets/index-DbuMPJAD.js new file mode 100644 index 00000000..5cc7b4c2 --- /dev/null +++ b/lightrag/api/webui/assets/index-DbuMPJAD.js @@ -0,0 +1,1120 @@ +var cH=Object.defineProperty;var dH=(e,t,n)=>t in e?cH(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Ea=(e,t,n)=>dH(e,typeof t!="symbol"?t+"":t,n);function fH(e,t){for(var n=0;nr[a]})}}}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 a of document.querySelectorAll('link[rel="modulepreload"]'))r(a);new MutationObserver(a=>{for(const i of a)if(i.type==="childList")for(const l of i.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&r(l)}).observe(document,{childList:!0,subtree:!0});function n(a){const i={};return a.integrity&&(i.integrity=a.integrity),a.referrerPolicy&&(i.referrerPolicy=a.referrerPolicy),a.crossOrigin==="use-credentials"?i.credentials="include":a.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(a){if(a.ep)return;a.ep=!0;const i=n(a);fetch(a.href,i)}})();var Cd=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function an(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function pH(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var n=function r(){return this instanceof r?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(r){var a=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,a.get?a:{enumerable:!0,get:function(){return e[r]}})}),n}var eh={exports:{}},Ds={};/** + * @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 $1;function gH(){if($1)return Ds;$1=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(r,a,i){var l=null;if(i!==void 0&&(l=""+i),a.key!==void 0&&(l=""+a.key),"key"in a){i={};for(var u in a)u!=="key"&&(i[u]=a[u])}else i=a;return a=i.ref,{$$typeof:e,type:r,key:l,ref:a!==void 0?a:null,props:i}}return Ds.Fragment=t,Ds.jsx=n,Ds.jsxs=n,Ds}var q1;function hH(){return q1||(q1=1,eh.exports=gH()),eh.exports}var w=hH(),th={exports:{}},at={};/** + * @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 V1;function mH(){if(V1)return at;V1=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),i=Symbol.for("react.consumer"),l=Symbol.for("react.context"),u=Symbol.for("react.forward_ref"),c=Symbol.for("react.suspense"),f=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),g=Symbol.iterator;function b(D){return D===null||typeof D!="object"?null:(D=g&&D[g]||D["@@iterator"],typeof D=="function"?D:null)}var m={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},S=Object.assign,v={};function A(D,V,B){this.props=D,this.context=V,this.refs=v,this.updater=B||m}A.prototype.isReactComponent={},A.prototype.setState=function(D,V){if(typeof D!="object"&&typeof D!="function"&&D!=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,D,V,"setState")},A.prototype.forceUpdate=function(D){this.updater.enqueueForceUpdate(this,D,"forceUpdate")};function R(){}R.prototype=A.prototype;function x(D,V,B){this.props=D,this.context=V,this.refs=v,this.updater=B||m}var _=x.prototype=new R;_.constructor=x,S(_,A.prototype),_.isPureReactComponent=!0;var C=Array.isArray,N={H:null,A:null,T:null,S:null},T=Object.prototype.hasOwnProperty;function O(D,V,B,L,Y,Q){return B=Q.ref,{$$typeof:e,type:D,key:V,ref:B!==void 0?B:null,props:Q}}function z(D,V){return O(D.type,V,void 0,void 0,void 0,D.props)}function I(D){return typeof D=="object"&&D!==null&&D.$$typeof===e}function M(D){var V={"=":"=0",":":"=2"};return"$"+D.replace(/[=:]/g,function(B){return V[B]})}var H=/\/+/g;function q(D,V){return typeof D=="object"&&D!==null&&D.key!=null?M(""+D.key):V.toString(36)}function U(){}function W(D){switch(D.status){case"fulfilled":return D.value;case"rejected":throw D.reason;default:switch(typeof D.status=="string"?D.then(U,U):(D.status="pending",D.then(function(V){D.status==="pending"&&(D.status="fulfilled",D.value=V)},function(V){D.status==="pending"&&(D.status="rejected",D.reason=V)})),D.status){case"fulfilled":return D.value;case"rejected":throw D.reason}}throw D}function Z(D,V,B,L,Y){var Q=typeof D;(Q==="undefined"||Q==="boolean")&&(D=null);var se=!1;if(D===null)se=!0;else switch(Q){case"bigint":case"string":case"number":se=!0;break;case"object":switch(D.$$typeof){case e:case t:se=!0;break;case p:return se=D._init,Z(se(D._payload),V,B,L,Y)}}if(se)return Y=Y(D),se=L===""?"."+q(D,0):L,C(Y)?(B="",se!=null&&(B=se.replace(H,"$&/")+"/"),Z(Y,V,B,"",function(Ae){return Ae})):Y!=null&&(I(Y)&&(Y=z(Y,B+(Y.key==null||D&&D.key===Y.key?"":(""+Y.key).replace(H,"$&/")+"/")+se)),V.push(Y)),1;se=0;var re=L===""?".":L+":";if(C(D))for(var le=0;le>>1,D=j[X];if(0>>1;Xa(L,P))Ya(Q,L)?(j[X]=Q,j[Y]=P,X=Y):(j[X]=L,j[B]=P,X=B);else if(Ya(Q,P))j[X]=Q,j[Y]=P,X=Y;else break e}}return G}function a(j,G){var P=j.sortIndex-G.sortIndex;return P!==0?P:j.id-G.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var l=Date,u=l.now();e.unstable_now=function(){return l.now()-u}}var c=[],f=[],p=1,g=null,b=3,m=!1,S=!1,v=!1,A=typeof setTimeout=="function"?setTimeout:null,R=typeof clearTimeout=="function"?clearTimeout:null,x=typeof setImmediate<"u"?setImmediate:null;function _(j){for(var G=n(f);G!==null;){if(G.callback===null)r(f);else if(G.startTime<=j)r(f),G.sortIndex=G.expirationTime,t(c,G);else break;G=n(f)}}function C(j){if(v=!1,_(j),!S)if(n(c)!==null)S=!0,W();else{var G=n(f);G!==null&&Z(C,G.startTime-j)}}var N=!1,T=-1,O=5,z=-1;function I(){return!(e.unstable_now()-zj&&I());){var X=g.callback;if(typeof X=="function"){g.callback=null,b=g.priorityLevel;var D=X(g.expirationTime<=j);if(j=e.unstable_now(),typeof D=="function"){g.callback=D,_(j),G=!0;break t}g===n(c)&&r(c),_(j)}else r(c);g=n(c)}if(g!==null)G=!0;else{var V=n(f);V!==null&&Z(C,V.startTime-j),G=!1}}break e}finally{g=null,b=P,m=!1}G=void 0}}finally{G?H():N=!1}}}var H;if(typeof x=="function")H=function(){x(M)};else if(typeof MessageChannel<"u"){var q=new MessageChannel,U=q.port2;q.port1.onmessage=M,H=function(){U.postMessage(null)}}else H=function(){A(M,0)};function W(){N||(N=!0,H())}function Z(j,G){T=A(function(){j(e.unstable_now())},G)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(j){j.callback=null},e.unstable_continueExecution=function(){S||m||(S=!0,W())},e.unstable_forceFrameRate=function(j){0>j||125X?(j.sortIndex=P,t(f,j),n(c)===null&&j===n(f)&&(v?(R(T),T=-1):v=!0,Z(C,P-X))):(j.sortIndex=D,t(c,j),S||m||(S=!0,W())),j},e.unstable_shouldYield=I,e.unstable_wrapCallback=function(j){var G=b;return function(){var P=b;b=G;try{return j.apply(this,arguments)}finally{b=P}}}}(ah)),ah}var K1;function vH(){return K1||(K1=1,rh.exports=yH()),rh.exports}var oh={exports:{}},bn={};/** + * @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 X1;function SH(){if(X1)return bn;X1=1;var e=nf();function t(c){var f="https://react.dev/errors/"+c;if(1"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),oh.exports=SH(),oh.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 Q1;function EH(){if(Q1)return Is;Q1=1;var e=vH(),t=nf(),n=mz();function r(o){var s="https://react.dev/errors/"+o;if(1)":-1y||K[h]!==ne[y]){var be=` +`+K[h].replace(" at new "," at ");return o.displayName&&be.includes("")&&(be=be.replace("",o.displayName)),be}while(1<=h&&0<=y);break}}}finally{W=!1,Error.prepareStackTrace=d}return(d=o?o.displayName||o.name:"")?U(d):""}function j(o){switch(o.tag){case 26:case 27:case 5:return U(o.type);case 16:return U("Lazy");case 13:return U("Suspense");case 19:return U("SuspenseList");case 0:case 15:return o=Z(o.type,!1),o;case 11:return o=Z(o.type.render,!1),o;case 1:return o=Z(o.type,!0),o;default:return""}}function G(o){try{var s="";do s+=j(o),o=o.return;while(o);return s}catch(d){return` +Error generating stack: `+d.message+` +`+d.stack}}function P(o){var s=o,d=o;if(o.alternate)for(;s.return;)s=s.return;else{o=s;do s=o,s.flags&4098&&(d=s.return),o=s.return;while(o)}return s.tag===3?d:null}function X(o){if(o.tag===13){var s=o.memoizedState;if(s===null&&(o=o.alternate,o!==null&&(s=o.memoizedState)),s!==null)return s.dehydrated}return null}function D(o){if(P(o)!==o)throw Error(r(188))}function V(o){var s=o.alternate;if(!s){if(s=P(o),s===null)throw Error(r(188));return s!==o?null:o}for(var d=o,h=s;;){var y=d.return;if(y===null)break;var E=y.alternate;if(E===null){if(h=y.return,h!==null){d=h;continue}break}if(y.child===E.child){for(E=y.child;E;){if(E===d)return D(y),o;if(E===h)return D(y),s;E=E.sibling}throw Error(r(188))}if(d.return!==h.return)d=y,h=E;else{for(var F=!1,$=y.child;$;){if($===d){F=!0,d=y,h=E;break}if($===h){F=!0,h=y,d=E;break}$=$.sibling}if(!F){for($=E.child;$;){if($===d){F=!0,d=E,h=y;break}if($===h){F=!0,h=E,d=y;break}$=$.sibling}if(!F)throw Error(r(189))}}if(d.alternate!==h)throw Error(r(190))}if(d.tag!==3)throw Error(r(188));return d.stateNode.current===d?o:s}function B(o){var s=o.tag;if(s===5||s===26||s===27||s===6)return o;for(o=o.child;o!==null;){if(s=B(o),s!==null)return s;o=o.sibling}return null}var L=Array.isArray,Y=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Q={pending:!1,data:null,method:null,action:null},se=[],re=-1;function le(o){return{current:o}}function Ae(o){0>re||(o.current=se[re],se[re]=null,re--)}function ae(o,s){re++,se[re]=o.current,o.current=s}var we=le(null),xe=le(null),Ie=le(null),Ce=le(null);function Ee(o,s){switch(ae(Ie,s),ae(xe,o),ae(we,null),o=s.nodeType,o){case 9:case 11:s=(s=s.documentElement)&&(s=s.namespaceURI)?v1(s):0;break;default:if(o=o===8?s.parentNode:s,s=o.tagName,o=o.namespaceURI)o=v1(o),s=S1(o,s);else switch(s){case"svg":s=1;break;case"math":s=2;break;default:s=0}}Ae(we),ae(we,s)}function J(){Ae(we),Ae(xe),Ae(Ie)}function fe(o){o.memoizedState!==null&&ae(Ce,o);var s=we.current,d=S1(s,o.type);s!==d&&(ae(xe,o),ae(we,d))}function ke(o){xe.current===o&&(Ae(we),Ae(xe)),Ce.current===o&&(Ae(Ce),_s._currentValue=Q)}var me=Object.prototype.hasOwnProperty,ve=e.unstable_scheduleCallback,ie=e.unstable_cancelCallback,ze=e.unstable_shouldYield,Pe=e.unstable_requestPaint,he=e.unstable_now,Ne=e.unstable_getCurrentPriorityLevel,ee=e.unstable_ImmediatePriority,ce=e.unstable_UserBlockingPriority,Re=e.unstable_NormalPriority,Fe=e.unstable_LowPriority,qe=e.unstable_IdlePriority,mt=e.log,St=e.unstable_setDisableYieldValue,pt=null,Je=null;function wt(o){if(Je&&typeof Je.onCommitFiberRoot=="function")try{Je.onCommitFiberRoot(pt,o,void 0,(o.current.flags&128)===128)}catch{}}function rt(o){if(typeof mt=="function"&&St(o),Je&&typeof Je.setStrictMode=="function")try{Je.setStrictMode(pt,o)}catch{}}var bt=Math.clz32?Math.clz32:Mt,Bt=Math.log,sn=Math.LN2;function Mt(o){return o>>>=0,o===0?32:31-(Bt(o)/sn|0)|0}var er=128,zr=4194304;function Kt(o){var s=o&42;if(s!==0)return s;switch(o&-o){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 o&4194176;case 4194304:case 8388608:case 16777216:case 33554432:return o&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return o}}function na(o,s){var d=o.pendingLanes;if(d===0)return 0;var h=0,y=o.suspendedLanes,E=o.pingedLanes,F=o.warmLanes;o=o.finishedLanes!==0;var $=d&134217727;return $!==0?(d=$&~y,d!==0?h=Kt(d):(E&=$,E!==0?h=Kt(E):o||(F=$&~F,F!==0&&(h=Kt(F))))):($=d&~y,$!==0?h=Kt($):E!==0?h=Kt(E):o||(F=d&~F,F!==0&&(h=Kt(F)))),h===0?0:s!==0&&s!==h&&!(s&y)&&(y=h&-h,F=s&-s,y>=F||y===32&&(F&4194176)!==0)?s:h}function Ye(o,s){return(o.pendingLanes&~(o.suspendedLanes&~o.pingedLanes)&s)===0}function gt(o,s){switch(o){case 1:case 2:case 4:case 8:return s+250;case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return s+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function _t(){var o=er;return er<<=1,!(er&4194176)&&(er=128),o}function Rn(){var o=zr;return zr<<=1,!(zr&62914560)&&(zr=4194304),o}function kn(o){for(var s=[],d=0;31>d;d++)s.push(o);return s}function Cn(o,s){o.pendingLanes|=s,s!==268435456&&(o.suspendedLanes=0,o.pingedLanes=0,o.warmLanes=0)}function ra(o,s,d,h,y,E){var F=o.pendingLanes;o.pendingLanes=d,o.suspendedLanes=0,o.pingedLanes=0,o.warmLanes=0,o.expiredLanes&=d,o.entangledLanes&=d,o.errorRecoveryDisabledLanes&=d,o.shellSuspendCounter=0;var $=o.entanglements,K=o.expirationTimes,ne=o.hiddenUpdates;for(d=F&~d;0"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),rG=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]*$"),SA={},EA={};function aG(o){return me.call(EA,o)?!0:me.call(SA,o)?!1:rG.test(o)?EA[o]=!0:(SA[o]=!0,!1)}function Cu(o,s,d){if(aG(s))if(d===null)o.removeAttribute(s);else{switch(typeof d){case"undefined":case"function":case"symbol":o.removeAttribute(s);return;case"boolean":var h=s.toLowerCase().slice(0,5);if(h!=="data-"&&h!=="aria-"){o.removeAttribute(s);return}}o.setAttribute(s,""+d)}}function Nu(o,s,d){if(d===null)o.removeAttribute(s);else{switch(typeof d){case"undefined":case"function":case"symbol":case"boolean":o.removeAttribute(s);return}o.setAttribute(s,""+d)}}function oa(o,s,d,h){if(h===null)o.removeAttribute(d);else{switch(typeof h){case"undefined":case"function":case"symbol":case"boolean":o.removeAttribute(d);return}o.setAttributeNS(s,d,""+h)}}function tr(o){switch(typeof o){case"bigint":case"boolean":case"number":case"string":case"undefined":return o;case"object":return o;default:return""}}function wA(o){var s=o.type;return(o=o.nodeName)&&o.toLowerCase()==="input"&&(s==="checkbox"||s==="radio")}function oG(o){var s=wA(o)?"checked":"value",d=Object.getOwnPropertyDescriptor(o.constructor.prototype,s),h=""+o[s];if(!o.hasOwnProperty(s)&&typeof d<"u"&&typeof d.get=="function"&&typeof d.set=="function"){var y=d.get,E=d.set;return Object.defineProperty(o,s,{configurable:!0,get:function(){return y.call(this)},set:function(F){h=""+F,E.call(this,F)}}),Object.defineProperty(o,s,{enumerable:d.enumerable}),{getValue:function(){return h},setValue:function(F){h=""+F},stopTracking:function(){o._valueTracker=null,delete o[s]}}}}function Ou(o){o._valueTracker||(o._valueTracker=oG(o))}function xA(o){if(!o)return!1;var s=o._valueTracker;if(!s)return!0;var d=s.getValue(),h="";return o&&(h=wA(o)?o.checked?"true":"false":o.value),o=h,o!==d?(s.setValue(o),!0):!1}function Du(o){if(o=o||(typeof document<"u"?document:void 0),typeof o>"u")return null;try{return o.activeElement||o.body}catch{return o.body}}var iG=/[\n"\\]/g;function nr(o){return o.replace(iG,function(s){return"\\"+s.charCodeAt(0).toString(16)+" "})}function Qf(o,s,d,h,y,E,F,$){o.name="",F!=null&&typeof F!="function"&&typeof F!="symbol"&&typeof F!="boolean"?o.type=F:o.removeAttribute("type"),s!=null?F==="number"?(s===0&&o.value===""||o.value!=s)&&(o.value=""+tr(s)):o.value!==""+tr(s)&&(o.value=""+tr(s)):F!=="submit"&&F!=="reset"||o.removeAttribute("value"),s!=null?Jf(o,F,tr(s)):d!=null?Jf(o,F,tr(d)):h!=null&&o.removeAttribute("value"),y==null&&E!=null&&(o.defaultChecked=!!E),y!=null&&(o.checked=y&&typeof y!="function"&&typeof y!="symbol"),$!=null&&typeof $!="function"&&typeof $!="symbol"&&typeof $!="boolean"?o.name=""+tr($):o.removeAttribute("name")}function kA(o,s,d,h,y,E,F,$){if(E!=null&&typeof E!="function"&&typeof E!="symbol"&&typeof E!="boolean"&&(o.type=E),s!=null||d!=null){if(!(E!=="submit"&&E!=="reset"||s!=null))return;d=d!=null?""+tr(d):"",s=s!=null?""+tr(s):d,$||s===o.value||(o.value=s),o.defaultValue=s}h=h??y,h=typeof h!="function"&&typeof h!="symbol"&&!!h,o.checked=$?o.checked:!!h,o.defaultChecked=!!h,F!=null&&typeof F!="function"&&typeof F!="symbol"&&typeof F!="boolean"&&(o.name=F)}function Jf(o,s,d){s==="number"&&Du(o.ownerDocument)===o||o.defaultValue===""+d||(o.defaultValue=""+d)}function bi(o,s,d,h){if(o=o.options,s){s={};for(var y=0;y=ql),zA=" ",PA=!1;function BA(o,s){switch(o){case"keyup":return LG.indexOf(s.keyCode)!==-1;case"keydown":return s.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function UA(o){return o=o.detail,typeof o=="object"&&"data"in o?o.data:null}var Ei=!1;function FG(o,s){switch(o){case"compositionend":return UA(s);case"keypress":return s.which!==32?null:(PA=!0,zA);case"textInput":return o=s.data,o===zA&&PA?null:o;default:return null}}function zG(o,s){if(Ei)return o==="compositionend"||!cp&&BA(o,s)?(o=OA(),Lu=op=Pa=null,Ei=!1,o):null;switch(o){case"paste":return null;case"keypress":if(!(s.ctrlKey||s.altKey||s.metaKey)||s.ctrlKey&&s.altKey){if(s.char&&1=s)return{node:d,offset:s-o};o=h}e:{for(;d;){if(d.nextSibling){d=d.nextSibling;break e}d=d.parentNode}d=void 0}d=YA(d)}}function XA(o,s){return o&&s?o===s?!0:o&&o.nodeType===3?!1:s&&s.nodeType===3?XA(o,s.parentNode):"contains"in o?o.contains(s):o.compareDocumentPosition?!!(o.compareDocumentPosition(s)&16):!1:!1}function ZA(o){o=o!=null&&o.ownerDocument!=null&&o.ownerDocument.defaultView!=null?o.ownerDocument.defaultView:window;for(var s=Du(o.document);s instanceof o.HTMLIFrameElement;){try{var d=typeof s.contentWindow.location.href=="string"}catch{d=!1}if(d)o=s.contentWindow;else break;s=Du(o.document)}return s}function pp(o){var s=o&&o.nodeName&&o.nodeName.toLowerCase();return s&&(s==="input"&&(o.type==="text"||o.type==="search"||o.type==="tel"||o.type==="url"||o.type==="password")||s==="textarea"||o.contentEditable==="true")}function qG(o,s){var d=ZA(s);s=o.focusedElem;var h=o.selectionRange;if(d!==s&&s&&s.ownerDocument&&XA(s.ownerDocument.documentElement,s)){if(h!==null&&pp(s)){if(o=h.start,d=h.end,d===void 0&&(d=o),"selectionStart"in s)s.selectionStart=o,s.selectionEnd=Math.min(d,s.value.length);else if(d=(o=s.ownerDocument||document)&&o.defaultView||window,d.getSelection){d=d.getSelection();var y=s.textContent.length,E=Math.min(h.start,y);h=h.end===void 0?E:Math.min(h.end,y),!d.extend&&E>h&&(y=h,h=E,E=y),y=KA(s,E);var F=KA(s,h);y&&F&&(d.rangeCount!==1||d.anchorNode!==y.node||d.anchorOffset!==y.offset||d.focusNode!==F.node||d.focusOffset!==F.offset)&&(o=o.createRange(),o.setStart(y.node,y.offset),d.removeAllRanges(),E>h?(d.addRange(o),d.extend(F.node,F.offset)):(o.setEnd(F.node,F.offset),d.addRange(o)))}}for(o=[],d=s;d=d.parentNode;)d.nodeType===1&&o.push({element:d,left:d.scrollLeft,top:d.scrollTop});for(typeof s.focus=="function"&&s.focus(),s=0;s=document.documentMode,wi=null,gp=null,Kl=null,hp=!1;function QA(o,s,d){var h=d.window===d?d.document:d.nodeType===9?d:d.ownerDocument;hp||wi==null||wi!==Du(h)||(h=wi,"selectionStart"in h&&pp(h)?h={start:h.selectionStart,end:h.selectionEnd}:(h=(h.ownerDocument&&h.ownerDocument.defaultView||window).getSelection(),h={anchorNode:h.anchorNode,anchorOffset:h.anchorOffset,focusNode:h.focusNode,focusOffset:h.focusOffset}),Kl&&Yl(Kl,h)||(Kl=h,h=Ec(gp,"onSelect"),0>=F,y-=F,ia=1<<32-bt(s)+y|d<Qe?(nn=Ve,Ve=null):nn=Ve.sibling;var vt=de(oe,Ve,ue[Qe],Se);if(vt===null){Ve===null&&(Ve=nn);break}o&&Ve&&vt.alternate===null&&s(oe,Ve),te=E(vt,te,Qe),it===null?Ue=vt:it.sibling=vt,it=vt,Ve=nn}if(Qe===ue.length)return d(oe,Ve),yt&&Do(oe,Qe),Ue;if(Ve===null){for(;QeQe?(nn=Ve,Ve=null):nn=Ve.sibling;var ao=de(oe,Ve,vt.value,Se);if(ao===null){Ve===null&&(Ve=nn);break}o&&Ve&&ao.alternate===null&&s(oe,Ve),te=E(ao,te,Qe),it===null?Ue=ao:it.sibling=ao,it=ao,Ve=nn}if(vt.done)return d(oe,Ve),yt&&Do(oe,Qe),Ue;if(Ve===null){for(;!vt.done;Qe++,vt=ue.next())vt=Te(oe,vt.value,Se),vt!==null&&(te=E(vt,te,Qe),it===null?Ue=vt:it.sibling=vt,it=vt);return yt&&Do(oe,Qe),Ue}for(Ve=h(Ve);!vt.done;Qe++,vt=ue.next())vt=ge(Ve,oe,Qe,vt.value,Se),vt!==null&&(o&&vt.alternate!==null&&Ve.delete(vt.key===null?Qe:vt.key),te=E(vt,te,Qe),it===null?Ue=vt:it.sibling=vt,it=vt);return o&&Ve.forEach(function(uH){return s(oe,uH)}),yt&&Do(oe,Qe),Ue}function Gt(oe,te,ue,Se){if(typeof ue=="object"&&ue!==null&&ue.type===c&&ue.key===null&&(ue=ue.props.children),typeof ue=="object"&&ue!==null){switch(ue.$$typeof){case l:e:{for(var Ue=ue.key;te!==null;){if(te.key===Ue){if(Ue=ue.type,Ue===c){if(te.tag===7){d(oe,te.sibling),Se=y(te,ue.props.children),Se.return=oe,oe=Se;break e}}else if(te.elementType===Ue||typeof Ue=="object"&&Ue!==null&&Ue.$$typeof===x&&hT(Ue)===te.type){d(oe,te.sibling),Se=y(te,ue.props),ns(Se,ue),Se.return=oe,oe=Se;break e}d(oe,te);break}else s(oe,te);te=te.sibling}ue.type===c?(Se=Ho(ue.props.children,oe.mode,Se,ue.key),Se.return=oe,oe=Se):(Se=dc(ue.type,ue.key,ue.props,null,oe.mode,Se),ns(Se,ue),Se.return=oe,oe=Se)}return F(oe);case u:e:{for(Ue=ue.key;te!==null;){if(te.key===Ue)if(te.tag===4&&te.stateNode.containerInfo===ue.containerInfo&&te.stateNode.implementation===ue.implementation){d(oe,te.sibling),Se=y(te,ue.children||[]),Se.return=oe,oe=Se;break e}else{d(oe,te);break}else s(oe,te);te=te.sibling}Se=bg(ue,oe.mode,Se),Se.return=oe,oe=Se}return F(oe);case x:return Ue=ue._init,ue=Ue(ue._payload),Gt(oe,te,ue,Se)}if(L(ue))return He(oe,te,ue,Se);if(T(ue)){if(Ue=T(ue),typeof Ue!="function")throw Error(r(150));return ue=Ue.call(ue),et(oe,te,ue,Se)}if(typeof ue.then=="function")return Gt(oe,te,Vu(ue),Se);if(ue.$$typeof===m)return Gt(oe,te,sc(oe,ue),Se);Wu(oe,ue)}return typeof ue=="string"&&ue!==""||typeof ue=="number"||typeof ue=="bigint"?(ue=""+ue,te!==null&&te.tag===6?(d(oe,te.sibling),Se=y(te,ue),Se.return=oe,oe=Se):(d(oe,te),Se=mg(ue,oe.mode,Se),Se.return=oe,oe=Se),F(oe)):d(oe,te)}return function(oe,te,ue,Se){try{ts=0;var Ue=Gt(oe,te,ue,Se);return Ri=null,Ue}catch(Ve){if(Ve===Jl)throw Ve;var it=cr(29,Ve,null,oe.mode);return it.lanes=Se,it.return=oe,it}finally{}}}var Lo=mT(!0),bT=mT(!1),Ci=le(null),Yu=le(0);function yT(o,s){o=ya,ae(Yu,o),ae(Ci,s),ya=o|s.baseLanes}function xp(){ae(Yu,ya),ae(Ci,Ci.current)}function kp(){ya=Yu.current,Ae(Ci),Ae(Yu)}var lr=le(null),Br=null;function Ua(o){var s=o.alternate;ae(Xt,Xt.current&1),ae(lr,o),Br===null&&(s===null||Ci.current!==null||s.memoizedState!==null)&&(Br=o)}function vT(o){if(o.tag===22){if(ae(Xt,Xt.current),ae(lr,o),Br===null){var s=o.alternate;s!==null&&s.memoizedState!==null&&(Br=o)}}else ja()}function ja(){ae(Xt,Xt.current),ae(lr,lr.current)}function sa(o){Ae(lr),Br===o&&(Br=null),Ae(Xt)}var Xt=le(0);function Ku(o){for(var s=o;s!==null;){if(s.tag===13){var d=s.memoizedState;if(d!==null&&(d=d.dehydrated,d===null||d.data==="$?"||d.data==="$!"))return s}else if(s.tag===19&&s.memoizedProps.revealOrder!==void 0){if(s.flags&128)return s}else if(s.child!==null){s.child.return=s,s=s.child;continue}if(s===o)break;for(;s.sibling===null;){if(s.return===null||s.return===o)return null;s=s.return}s.sibling.return=s.return,s=s.sibling}return null}var XG=typeof AbortController<"u"?AbortController:function(){var o=[],s=this.signal={aborted:!1,addEventListener:function(d,h){o.push(h)}};this.abort=function(){s.aborted=!0,o.forEach(function(d){return d()})}},ZG=e.unstable_scheduleCallback,QG=e.unstable_NormalPriority,Zt={$$typeof:m,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Ap(){return{controller:new XG,data:new Map,refCount:0}}function rs(o){o.refCount--,o.refCount===0&&ZG(QG,function(){o.controller.abort()})}var as=null,Tp=0,Ni=0,Oi=null;function JG(o,s){if(as===null){var d=as=[];Tp=0,Ni=Dg(),Oi={status:"pending",value:void 0,then:function(h){d.push(h)}}}return Tp++,s.then(ST,ST),s}function ST(){if(--Tp===0&&as!==null){Oi!==null&&(Oi.status="fulfilled");var o=as;as=null,Ni=0,Oi=null;for(var s=0;sE?E:8;var F=I.T,$={};I.T=$,Hp(o,!1,s,d);try{var K=y(),ne=I.S;if(ne!==null&&ne($,K),K!==null&&typeof K=="object"&&typeof K.then=="function"){var be=e6(K,h);ls(o,s,be,Wn(o))}else ls(o,s,h,Wn(o))}catch(Te){ls(o,s,{then:function(){},status:"rejected",reason:Te},Wn())}finally{Y.p=E,I.T=F}}function o6(){}function jp(o,s,d,h){if(o.tag!==5)throw Error(r(476));var y=ZT(o).queue;XT(o,y,s,Q,d===null?o6:function(){return QT(o),d(h)})}function ZT(o){var s=o.memoizedState;if(s!==null)return s;s={memoizedState:Q,baseState:Q,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ua,lastRenderedState:Q},next:null};var d={};return s.next={memoizedState:d,baseState:d,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ua,lastRenderedState:d},next:null},o.memoizedState=s,o=o.alternate,o!==null&&(o.memoizedState=s),s}function QT(o){var s=ZT(o).next.queue;ls(o,s,{},Wn())}function Gp(){return mn(_s)}function JT(){return Vt().memoizedState}function e_(){return Vt().memoizedState}function i6(o){for(var s=o.return;s!==null;){switch(s.tag){case 24:case 3:var d=Wn();o=Va(d);var h=Wa(s,o,d);h!==null&&(Tn(h,s,d),cs(h,s,d)),s={cache:Ap()},o.payload=s;return}s=s.return}}function l6(o,s,d){var h=Wn();d={lane:h,revertLane:0,action:d,hasEagerState:!1,eagerState:null,next:null},ac(o)?n_(s,d):(d=yp(o,s,d,h),d!==null&&(Tn(d,o,h),r_(d,s,h)))}function t_(o,s,d){var h=Wn();ls(o,s,d,h)}function ls(o,s,d,h){var y={lane:h,revertLane:0,action:d,hasEagerState:!1,eagerState:null,next:null};if(ac(o))n_(s,y);else{var E=o.alternate;if(o.lanes===0&&(E===null||E.lanes===0)&&(E=s.lastRenderedReducer,E!==null))try{var F=s.lastRenderedState,$=E(F,d);if(y.hasEagerState=!0,y.eagerState=$,Hn($,F))return ju(o,s,y,0),Ot===null&&Uu(),!1}catch{}finally{}if(d=yp(o,s,y,h),d!==null)return Tn(d,o,h),r_(d,s,h),!0}return!1}function Hp(o,s,d,h){if(h={lane:2,revertLane:Dg(),action:h,hasEagerState:!1,eagerState:null,next:null},ac(o)){if(s)throw Error(r(479))}else s=yp(o,d,h,2),s!==null&&Tn(s,o,2)}function ac(o){var s=o.alternate;return o===ot||s!==null&&s===ot}function n_(o,s){Di=Zu=!0;var d=o.pending;d===null?s.next=s:(s.next=d.next,d.next=s),o.pending=s}function r_(o,s,d){if(d&4194176){var h=s.lanes;h&=o.pendingLanes,d|=h,s.lanes=d,Sr(o,d)}}var Ur={readContext:mn,use:ec,useCallback:Ht,useContext:Ht,useEffect:Ht,useImperativeHandle:Ht,useLayoutEffect:Ht,useInsertionEffect:Ht,useMemo:Ht,useReducer:Ht,useRef:Ht,useState:Ht,useDebugValue:Ht,useDeferredValue:Ht,useTransition:Ht,useSyncExternalStore:Ht,useId:Ht};Ur.useCacheRefresh=Ht,Ur.useMemoCache=Ht,Ur.useHostTransitionStatus=Ht,Ur.useFormState=Ht,Ur.useActionState=Ht,Ur.useOptimistic=Ht;var zo={readContext:mn,use:ec,useCallback:function(o,s){return In().memoizedState=[o,s===void 0?null:s],o},useContext:mn,useEffect:GT,useImperativeHandle:function(o,s,d){d=d!=null?d.concat([o]):null,nc(4194308,4,qT.bind(null,s,o),d)},useLayoutEffect:function(o,s){return nc(4194308,4,o,s)},useInsertionEffect:function(o,s){nc(4,2,o,s)},useMemo:function(o,s){var d=In();s=s===void 0?null:s;var h=o();if(Fo){rt(!0);try{o()}finally{rt(!1)}}return d.memoizedState=[h,s],h},useReducer:function(o,s,d){var h=In();if(d!==void 0){var y=d(s);if(Fo){rt(!0);try{d(s)}finally{rt(!1)}}}else y=s;return h.memoizedState=h.baseState=y,o={pending:null,lanes:0,dispatch:null,lastRenderedReducer:o,lastRenderedState:y},h.queue=o,o=o.dispatch=l6.bind(null,ot,o),[h.memoizedState,o]},useRef:function(o){var s=In();return o={current:o},s.memoizedState=o},useState:function(o){o=Fp(o);var s=o.queue,d=t_.bind(null,ot,s);return s.dispatch=d,[o.memoizedState,d]},useDebugValue:Bp,useDeferredValue:function(o,s){var d=In();return Up(d,o,s)},useTransition:function(){var o=Fp(!1);return o=XT.bind(null,ot,o.queue,!0,!1),In().memoizedState=o,[!1,o]},useSyncExternalStore:function(o,s,d){var h=ot,y=In();if(yt){if(d===void 0)throw Error(r(407));d=d()}else{if(d=s(),Ot===null)throw Error(r(349));ht&60||TT(h,s,d)}y.memoizedState=d;var E={value:d,getSnapshot:s};return y.queue=E,GT(RT.bind(null,h,E,o),[o]),h.flags|=2048,Li(9,_T.bind(null,h,E,d,s),{destroy:void 0},null),d},useId:function(){var o=In(),s=Ot.identifierPrefix;if(yt){var d=la,h=ia;d=(h&~(1<<32-bt(h)-1)).toString(32)+d,s=":"+s+"R"+d,d=Qu++,0 title"))),dn(E,h,d),E[hn]=o,Jt(E),h=E;break e;case"link":var F=N1("link","href",y).get(h+(d.href||""));if(F){for(var $=0;$<\/script>",o=o.removeChild(o.firstChild);break;case"select":o=typeof h.is=="string"?y.createElement("select",{is:h.is}):y.createElement("select"),h.multiple?o.multiple=!0:h.size&&(o.size=h.size);break;default:o=typeof h.is=="string"?y.createElement(d,{is:h.is}):y.createElement(d)}}o[hn]=s,o[On]=h;e:for(y=s.child;y!==null;){if(y.tag===5||y.tag===6)o.appendChild(y.stateNode);else if(y.tag!==4&&y.tag!==27&&y.child!==null){y.child.return=y,y=y.child;continue}if(y===s)break e;for(;y.sibling===null;){if(y.return===null||y.return===s)break e;y=y.return}y.sibling.return=y.return,y=y.sibling}s.stateNode=o;e:switch(dn(o,d,h),d){case"button":case"input":case"select":case"textarea":o=!!h.autoFocus;break e;case"img":o=!0;break e;default:o=!1}o&&ma(s)}}return Ft(s),s.flags&=-16777217,null;case 6:if(o&&s.stateNode!=null)o.memoizedProps!==h&&ma(s);else{if(typeof h!="string"&&s.stateNode===null)throw Error(r(166));if(o=Ie.current,Xl(s)){if(o=s.stateNode,d=s.memoizedProps,h=null,y=An,y!==null)switch(y.tag){case 27:case 5:h=y.memoizedProps}o[hn]=s,o=!!(o.nodeValue===d||h!==null&&h.suppressHydrationWarning===!0||y1(o.nodeValue,d)),o||Io(s)}else o=xc(o).createTextNode(h),o[hn]=s,s.stateNode=o}return Ft(s),null;case 13:if(h=s.memoizedState,o===null||o.memoizedState!==null&&o.memoizedState.dehydrated!==null){if(y=Xl(s),h!==null&&h.dehydrated!==null){if(o===null){if(!y)throw Error(r(318));if(y=s.memoizedState,y=y!==null?y.dehydrated:null,!y)throw Error(r(317));y[hn]=s}else Zl(),!(s.flags&128)&&(s.memoizedState=null),s.flags|=4;Ft(s),y=!1}else wr!==null&&(Ag(wr),wr=null),y=!0;if(!y)return s.flags&256?(sa(s),s):(sa(s),null)}if(sa(s),s.flags&128)return s.lanes=d,s;if(d=h!==null,o=o!==null&&o.memoizedState!==null,d){h=s.child,y=null,h.alternate!==null&&h.alternate.memoizedState!==null&&h.alternate.memoizedState.cachePool!==null&&(y=h.alternate.memoizedState.cachePool.pool);var E=null;h.memoizedState!==null&&h.memoizedState.cachePool!==null&&(E=h.memoizedState.cachePool.pool),E!==y&&(h.flags|=2048)}return d!==o&&d&&(s.child.flags|=8192),fc(s,s.updateQueue),Ft(s),null;case 4:return J(),o===null&&Fg(s.stateNode.containerInfo),Ft(s),null;case 10:return fa(s.type),Ft(s),null;case 19:if(Ae(Xt),y=s.memoizedState,y===null)return Ft(s),null;if(h=(s.flags&128)!==0,E=y.rendering,E===null)if(h)bs(y,!1);else{if(jt!==0||o!==null&&o.flags&128)for(o=s.child;o!==null;){if(E=Ku(o),E!==null){for(s.flags|=128,bs(y,!1),o=E.updateQueue,s.updateQueue=o,fc(s,o),s.subtreeFlags=0,o=d,d=s.child;d!==null;)V_(d,o),d=d.sibling;return ae(Xt,Xt.current&1|2),s.child}o=o.sibling}y.tail!==null&&he()>pc&&(s.flags|=128,h=!0,bs(y,!1),s.lanes=4194304)}else{if(!h)if(o=Ku(E),o!==null){if(s.flags|=128,h=!0,o=o.updateQueue,s.updateQueue=o,fc(s,o),bs(y,!0),y.tail===null&&y.tailMode==="hidden"&&!E.alternate&&!yt)return Ft(s),null}else 2*he()-y.renderingStartTime>pc&&d!==536870912&&(s.flags|=128,h=!0,bs(y,!1),s.lanes=4194304);y.isBackwards?(E.sibling=s.child,s.child=E):(o=y.last,o!==null?o.sibling=E:s.child=E,y.last=E)}return y.tail!==null?(s=y.tail,y.rendering=s,y.tail=s.sibling,y.renderingStartTime=he(),s.sibling=null,o=Xt.current,ae(Xt,h?o&1|2:o&1),s):(Ft(s),null);case 22:case 23:return sa(s),kp(),h=s.memoizedState!==null,o!==null?o.memoizedState!==null!==h&&(s.flags|=8192):h&&(s.flags|=8192),h?d&536870912&&!(s.flags&128)&&(Ft(s),s.subtreeFlags&6&&(s.flags|=8192)):Ft(s),d=s.updateQueue,d!==null&&fc(s,d.retryQueue),d=null,o!==null&&o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(d=o.memoizedState.cachePool.pool),h=null,s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(h=s.memoizedState.cachePool.pool),h!==d&&(s.flags|=2048),o!==null&&Ae(Mo),null;case 24:return d=null,o!==null&&(d=o.memoizedState.cache),s.memoizedState.cache!==d&&(s.flags|=2048),fa(Zt),Ft(s),null;case 25:return null}throw Error(r(156,s.tag))}function g6(o,s){switch(Sp(s),s.tag){case 1:return o=s.flags,o&65536?(s.flags=o&-65537|128,s):null;case 3:return fa(Zt),J(),o=s.flags,o&65536&&!(o&128)?(s.flags=o&-65537|128,s):null;case 26:case 27:case 5:return ke(s),null;case 13:if(sa(s),o=s.memoizedState,o!==null&&o.dehydrated!==null){if(s.alternate===null)throw Error(r(340));Zl()}return o=s.flags,o&65536?(s.flags=o&-65537|128,s):null;case 19:return Ae(Xt),null;case 4:return J(),null;case 10:return fa(s.type),null;case 22:case 23:return sa(s),kp(),o!==null&&Ae(Mo),o=s.flags,o&65536?(s.flags=o&-65537|128,s):null;case 24:return fa(Zt),null;case 25:return null;default:return null}}function K_(o,s){switch(Sp(s),s.tag){case 3:fa(Zt),J();break;case 26:case 27:case 5:ke(s);break;case 4:J();break;case 13:sa(s);break;case 19:Ae(Xt);break;case 10:fa(s.type);break;case 22:case 23:sa(s),kp(),o!==null&&Ae(Mo);break;case 24:fa(Zt)}}var h6={getCacheForType:function(o){var s=mn(Zt),d=s.data.get(o);return d===void 0&&(d=o(),s.data.set(o,d)),d}},m6=typeof WeakMap=="function"?WeakMap:Map,zt=0,Ot=null,st=null,ht=0,Dt=0,Vn=null,ba=!1,Pi=!1,yg=!1,ya=0,jt=0,Qa=0,$o=0,vg=0,dr=0,Bi=0,ys=null,jr=null,Sg=!1,Eg=0,pc=1/0,gc=null,Ja=null,hc=!1,qo=null,vs=0,wg=0,xg=null,Ss=0,kg=null;function Wn(){if(zt&2&&ht!==0)return ht&-ht;if(I.T!==null){var o=Ni;return o!==0?o:Dg()}return mA()}function X_(){dr===0&&(dr=!(ht&536870912)||yt?_t():536870912);var o=lr.current;return o!==null&&(o.flags|=32),dr}function Tn(o,s,d){(o===Ot&&Dt===2||o.cancelPendingCommit!==null)&&(Ui(o,0),va(o,ht,dr,!1)),Cn(o,d),(!(zt&2)||o!==Ot)&&(o===Ot&&(!(zt&2)&&($o|=d),jt===4&&va(o,ht,dr,!1)),Gr(o))}function Z_(o,s,d){if(zt&6)throw Error(r(327));var h=!d&&(s&60)===0&&(s&o.expiredLanes)===0||Ye(o,s),y=h?v6(o,s):Rg(o,s,!0),E=h;do{if(y===0){Pi&&!h&&va(o,s,0,!1);break}else if(y===6)va(o,s,0,!ba);else{if(d=o.current.alternate,E&&!b6(d)){y=Rg(o,s,!1),E=!1;continue}if(y===2){if(E=s,o.errorRecoveryDisabledLanes&E)var F=0;else F=o.pendingLanes&-536870913,F=F!==0?F:F&536870912?536870912:0;if(F!==0){s=F;e:{var $=o;y=ys;var K=$.current.memoizedState.isDehydrated;if(K&&(Ui($,F).flags|=256),F=Rg($,F,!1),F!==2){if(yg&&!K){$.errorRecoveryDisabledLanes|=E,$o|=E,y=4;break e}E=jr,jr=y,E!==null&&Ag(E)}y=F}if(E=!1,y!==2)continue}}if(y===1){Ui(o,0),va(o,s,0,!0);break}e:{switch(h=o,y){case 0:case 1:throw Error(r(345));case 4:if((s&4194176)===s){va(h,s,dr,!ba);break e}break;case 2:jr=null;break;case 3:case 5:break;default:throw Error(r(329))}if(h.finishedWork=d,h.finishedLanes=s,(s&62914560)===s&&(E=Eg+300-he(),10d?32:d,I.T=null,qo===null)var E=!1;else{d=xg,xg=null;var F=qo,$=vs;if(qo=null,vs=0,zt&6)throw Error(r(331));var K=zt;if(zt|=4,$_(F.current),j_(F,F.current,$,d),zt=K,Es(0,!1),Je&&typeof Je.onPostCommitFiberRoot=="function")try{Je.onPostCommitFiberRoot(pt,F)}catch{}E=!0}return E}finally{Y.p=y,I.T=h,i1(o,s)}}return!1}function l1(o,s,d){s=ar(d,s),s=Vp(o.stateNode,s,2),o=Wa(o,s,2),o!==null&&(Cn(o,2),Gr(o))}function Rt(o,s,d){if(o.tag===3)l1(o,o,d);else for(;s!==null;){if(s.tag===3){l1(s,o,d);break}else if(s.tag===1){var h=s.stateNode;if(typeof s.type.getDerivedStateFromError=="function"||typeof h.componentDidCatch=="function"&&(Ja===null||!Ja.has(h))){o=ar(d,o),d=c_(2),h=Wa(s,d,2),h!==null&&(d_(d,h,s,o),Cn(h,2),Gr(h));break}}s=s.return}}function Cg(o,s,d){var h=o.pingCache;if(h===null){h=o.pingCache=new m6;var y=new Set;h.set(s,y)}else y=h.get(s),y===void 0&&(y=new Set,h.set(s,y));y.has(d)||(yg=!0,y.add(d),o=w6.bind(null,o,s,d),s.then(o,o))}function w6(o,s,d){var h=o.pingCache;h!==null&&h.delete(s),o.pingedLanes|=o.suspendedLanes&d,o.warmLanes&=~d,Ot===o&&(ht&d)===d&&(jt===4||jt===3&&(ht&62914560)===ht&&300>he()-Eg?!(zt&2)&&Ui(o,0):vg|=d,Bi===ht&&(Bi=0)),Gr(o)}function s1(o,s){s===0&&(s=Rn()),o=Ba(o,s),o!==null&&(Cn(o,s),Gr(o))}function x6(o){var s=o.memoizedState,d=0;s!==null&&(d=s.retryLane),s1(o,d)}function k6(o,s){var d=0;switch(o.tag){case 13:var h=o.stateNode,y=o.memoizedState;y!==null&&(d=y.retryLane);break;case 19:h=o.stateNode;break;case 22:h=o.stateNode._retryCache;break;default:throw Error(r(314))}h!==null&&h.delete(s),s1(o,d)}function A6(o,s){return ve(o,s)}var yc=null,Hi=null,Ng=!1,vc=!1,Og=!1,Vo=0;function Gr(o){o!==Hi&&o.next===null&&(Hi===null?yc=Hi=o:Hi=Hi.next=o),vc=!0,Ng||(Ng=!0,_6(T6))}function Es(o,s){if(!Og&&vc){Og=!0;do for(var d=!1,h=yc;h!==null;){if(o!==0){var y=h.pendingLanes;if(y===0)var E=0;else{var F=h.suspendedLanes,$=h.pingedLanes;E=(1<<31-bt(42|o)+1)-1,E&=y&~(F&~$),E=E&201326677?E&201326677|1:E?E|2:0}E!==0&&(d=!0,d1(h,E))}else E=ht,E=na(h,h===Ot?E:0),!(E&3)||Ye(h,E)||(d=!0,d1(h,E));h=h.next}while(d);Og=!1}}function T6(){vc=Ng=!1;var o=0;Vo!==0&&(M6()&&(o=Vo),Vo=0);for(var s=he(),d=null,h=yc;h!==null;){var y=h.next,E=u1(h,s);E===0?(h.next=null,d===null?yc=y:d.next=y,y===null&&(Hi=d)):(d=h,(o!==0||E&3)&&(vc=!0)),h=y}Es(o)}function u1(o,s){for(var d=o.suspendedLanes,h=o.pingedLanes,y=o.expirationTimes,E=o.pendingLanes&-62914561;0"u"?null:document;function T1(o,s,d){var h=qi;if(h&&typeof s=="string"&&s){var y=nr(s);y='link[rel="'+o+'"][href="'+y+'"]',typeof d=="string"&&(y+='[crossorigin="'+d+'"]'),A1.has(y)||(A1.add(y),o={rel:o,crossOrigin:d,href:s},h.querySelector(y)===null&&(s=h.createElement("link"),dn(s,"link",o),Jt(s),h.head.appendChild(s)))}}function H6(o){Sa.D(o),T1("dns-prefetch",o,null)}function $6(o,s){Sa.C(o,s),T1("preconnect",o,s)}function q6(o,s,d){Sa.L(o,s,d);var h=qi;if(h&&o&&s){var y='link[rel="preload"][as="'+nr(s)+'"]';s==="image"&&d&&d.imageSrcSet?(y+='[imagesrcset="'+nr(d.imageSrcSet)+'"]',typeof d.imageSizes=="string"&&(y+='[imagesizes="'+nr(d.imageSizes)+'"]')):y+='[href="'+nr(o)+'"]';var E=y;switch(s){case"style":E=Vi(o);break;case"script":E=Wi(o)}fr.has(E)||(o=M({rel:"preload",href:s==="image"&&d&&d.imageSrcSet?void 0:o,as:s},d),fr.set(E,o),h.querySelector(y)!==null||s==="style"&&h.querySelector(ks(E))||s==="script"&&h.querySelector(As(E))||(s=h.createElement("link"),dn(s,"link",o),Jt(s),h.head.appendChild(s)))}}function V6(o,s){Sa.m(o,s);var d=qi;if(d&&o){var h=s&&typeof s.as=="string"?s.as:"script",y='link[rel="modulepreload"][as="'+nr(h)+'"][href="'+nr(o)+'"]',E=y;switch(h){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":E=Wi(o)}if(!fr.has(E)&&(o=M({rel:"modulepreload",href:o},s),fr.set(E,o),d.querySelector(y)===null)){switch(h){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(d.querySelector(As(E)))return}h=d.createElement("link"),dn(h,"link",o),Jt(h),d.head.appendChild(h)}}}function W6(o,s,d){Sa.S(o,s,d);var h=qi;if(h&&o){var y=hi(h).hoistableStyles,E=Vi(o);s=s||"default";var F=y.get(E);if(!F){var $={loading:0,preload:null};if(F=h.querySelector(ks(E)))$.loading=5;else{o=M({rel:"stylesheet",href:o,"data-precedence":s},d),(d=fr.get(E))&&qg(o,d);var K=F=h.createElement("link");Jt(K),dn(K,"link",o),K._p=new Promise(function(ne,be){K.onload=ne,K.onerror=be}),K.addEventListener("load",function(){$.loading|=1}),K.addEventListener("error",function(){$.loading|=2}),$.loading|=4,Ac(F,s,h)}F={type:"stylesheet",instance:F,count:1,state:$},y.set(E,F)}}}function Y6(o,s){Sa.X(o,s);var d=qi;if(d&&o){var h=hi(d).hoistableScripts,y=Wi(o),E=h.get(y);E||(E=d.querySelector(As(y)),E||(o=M({src:o,async:!0},s),(s=fr.get(y))&&Vg(o,s),E=d.createElement("script"),Jt(E),dn(E,"link",o),d.head.appendChild(E)),E={type:"script",instance:E,count:1,state:null},h.set(y,E))}}function K6(o,s){Sa.M(o,s);var d=qi;if(d&&o){var h=hi(d).hoistableScripts,y=Wi(o),E=h.get(y);E||(E=d.querySelector(As(y)),E||(o=M({src:o,async:!0,type:"module"},s),(s=fr.get(y))&&Vg(o,s),E=d.createElement("script"),Jt(E),dn(E,"link",o),d.head.appendChild(E)),E={type:"script",instance:E,count:1,state:null},h.set(y,E))}}function _1(o,s,d,h){var y=(y=Ie.current)?kc(y):null;if(!y)throw Error(r(446));switch(o){case"meta":case"title":return null;case"style":return typeof d.precedence=="string"&&typeof d.href=="string"?(s=Vi(d.href),d=hi(y).hoistableStyles,h=d.get(s),h||(h={type:"style",instance:null,count:0,state:null},d.set(s,h)),h):{type:"void",instance:null,count:0,state:null};case"link":if(d.rel==="stylesheet"&&typeof d.href=="string"&&typeof d.precedence=="string"){o=Vi(d.href);var E=hi(y).hoistableStyles,F=E.get(o);if(F||(y=y.ownerDocument||y,F={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},E.set(o,F),(E=y.querySelector(ks(o)))&&!E._p&&(F.instance=E,F.state.loading=5),fr.has(o)||(d={rel:"preload",as:"style",href:d.href,crossOrigin:d.crossOrigin,integrity:d.integrity,media:d.media,hrefLang:d.hrefLang,referrerPolicy:d.referrerPolicy},fr.set(o,d),E||X6(y,o,d,F.state))),s&&h===null)throw Error(r(528,""));return F}if(s&&h!==null)throw Error(r(529,""));return null;case"script":return s=d.async,d=d.src,typeof d=="string"&&s&&typeof s!="function"&&typeof s!="symbol"?(s=Wi(d),d=hi(y).hoistableScripts,h=d.get(s),h||(h={type:"script",instance:null,count:0,state:null},d.set(s,h)),h):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,o))}}function Vi(o){return'href="'+nr(o)+'"'}function ks(o){return'link[rel="stylesheet"]['+o+"]"}function R1(o){return M({},o,{"data-precedence":o.precedence,precedence:null})}function X6(o,s,d,h){o.querySelector('link[rel="preload"][as="style"]['+s+"]")?h.loading=1:(s=o.createElement("link"),h.preload=s,s.addEventListener("load",function(){return h.loading|=1}),s.addEventListener("error",function(){return h.loading|=2}),dn(s,"link",d),Jt(s),o.head.appendChild(s))}function Wi(o){return'[src="'+nr(o)+'"]'}function As(o){return"script[async]"+o}function C1(o,s,d){if(s.count++,s.instance===null)switch(s.type){case"style":var h=o.querySelector('style[data-href~="'+nr(d.href)+'"]');if(h)return s.instance=h,Jt(h),h;var y=M({},d,{"data-href":d.href,"data-precedence":d.precedence,href:null,precedence:null});return h=(o.ownerDocument||o).createElement("style"),Jt(h),dn(h,"style",y),Ac(h,d.precedence,o),s.instance=h;case"stylesheet":y=Vi(d.href);var E=o.querySelector(ks(y));if(E)return s.state.loading|=4,s.instance=E,Jt(E),E;h=R1(d),(y=fr.get(y))&&qg(h,y),E=(o.ownerDocument||o).createElement("link"),Jt(E);var F=E;return F._p=new Promise(function($,K){F.onload=$,F.onerror=K}),dn(E,"link",h),s.state.loading|=4,Ac(E,d.precedence,o),s.instance=E;case"script":return E=Wi(d.src),(y=o.querySelector(As(E)))?(s.instance=y,Jt(y),y):(h=d,(y=fr.get(E))&&(h=M({},d),Vg(h,y)),o=o.ownerDocument||o,y=o.createElement("script"),Jt(y),dn(y,"link",h),o.head.appendChild(y),s.instance=y);case"void":return null;default:throw Error(r(443,s.type))}else s.type==="stylesheet"&&!(s.state.loading&4)&&(h=s.instance,s.state.loading|=4,Ac(h,d.precedence,o));return s.instance}function Ac(o,s,d){for(var h=d.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),y=h.length?h[h.length-1]:null,E=y,F=0;F title"):null)}function Z6(o,s,d){if(d===1||s.itemProp!=null)return!1;switch(o){case"meta":case"title":return!0;case"style":if(typeof s.precedence!="string"||typeof s.href!="string"||s.href==="")break;return!0;case"link":if(typeof s.rel!="string"||typeof s.href!="string"||s.href===""||s.onLoad||s.onError)break;switch(s.rel){case"stylesheet":return o=s.disabled,typeof s.precedence=="string"&&o==null;default:return!0}case"script":if(s.async&&typeof s.async!="function"&&typeof s.async!="symbol"&&!s.onLoad&&!s.onError&&s.src&&typeof s.src=="string")return!0}return!1}function D1(o){return!(o.type==="stylesheet"&&!(o.state.loading&3))}var Ts=null;function Q6(){}function J6(o,s,d){if(Ts===null)throw Error(r(475));var h=Ts;if(s.type==="stylesheet"&&(typeof d.media!="string"||matchMedia(d.media).matches!==!1)&&!(s.state.loading&4)){if(s.instance===null){var y=Vi(d.href),E=o.querySelector(ks(y));if(E){o=E._p,o!==null&&typeof o=="object"&&typeof o.then=="function"&&(h.count++,h=_c.bind(h),o.then(h,h)),s.state.loading|=4,s.instance=E,Jt(E);return}E=o.ownerDocument||o,d=R1(d),(y=fr.get(y))&&qg(d,y),E=E.createElement("link"),Jt(E);var F=E;F._p=new Promise(function($,K){F.onload=$,F.onerror=K}),dn(E,"link",d),s.instance=E}h.stylesheets===null&&(h.stylesheets=new Map),h.stylesheets.set(s,o),(o=s.state.preload)&&!(s.state.loading&3)&&(h.count++,s=_c.bind(h),o.addEventListener("load",s),o.addEventListener("error",s))}}function eH(){if(Ts===null)throw Error(r(475));var o=Ts;return o.stylesheets&&o.count===0&&Wg(o,o.stylesheets),0"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),nh.exports=EH(),nh.exports}var xH=wH();const eR=e=>{let t;const n=new Set,r=(f,p)=>{const g=typeof f=="function"?f(t):f;if(!Object.is(g,t)){const b=t;t=p??(typeof g!="object"||g===null)?g:Object.assign({},t,g),n.forEach(m=>m(t,b))}},a=()=>t,u={setState:r,getState:a,getInitialState:()=>c,subscribe:f=>(n.add(f),()=>n.delete(f))},c=t=e(r,a,u);return u},kH=e=>e?eR(e):eR,AH=e=>e;function TH(e,t=AH){const n=ye.useSyncExternalStore(e.subscribe,()=>t(e.getState()),()=>t(e.getInitialState()));return ye.useDebugValue(n),n}const _H=e=>{const t=kH(e),n=r=>TH(t,r);return Object.assign(n,t),n},wk=e=>_H;function bz(e,t){let n;try{n=e()}catch{return}return{getItem:a=>{var i;const l=c=>c===null?null:JSON.parse(c,void 0),u=(i=n.getItem(a))!=null?i:null;return u instanceof Promise?u.then(l):l(u)},setItem:(a,i)=>n.setItem(a,JSON.stringify(i,void 0)),removeItem:a=>n.removeItem(a)}}const dx=e=>t=>{try{const n=e(t);return n instanceof Promise?n:{then(r){return dx(r)(n)},catch(r){return this}}}catch(n){return{then(r){return this},catch(r){return dx(r)(n)}}}},RH=(e,t)=>(n,r,a)=>{let i={storage:bz(()=>localStorage),partialize:v=>v,version:0,merge:(v,A)=>({...A,...v}),...t},l=!1;const u=new Set,c=new Set;let f=i.storage;if(!f)return e((...v)=>{console.warn(`[zustand persist middleware] Unable to update item '${i.name}', the given storage is currently unavailable.`),n(...v)},r,a);const p=()=>{const v=i.partialize({...r()});return f.setItem(i.name,{state:v,version:i.version})},g=a.setState;a.setState=(v,A)=>{g(v,A),p()};const b=e((...v)=>{n(...v),p()},r,a);a.getInitialState=()=>b;let m;const S=()=>{var v,A;if(!f)return;l=!1,u.forEach(x=>{var _;return x((_=r())!=null?_:b)});const R=((A=i.onRehydrateStorage)==null?void 0:A.call(i,(v=r())!=null?v:b))||void 0;return dx(f.getItem.bind(f))(i.name).then(x=>{if(x)if(typeof x.version=="number"&&x.version!==i.version){if(i.migrate){const _=i.migrate(x.state,x.version);return _ instanceof Promise?_.then(C=>[!0,C]):[!0,_]}console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,x.state];return[!1,void 0]}).then(x=>{var _;const[C,N]=x;if(m=i.merge(N,(_=r())!=null?_:b),n(m,!0),C)return p()}).then(()=>{R==null||R(m,void 0),m=r(),l=!0,c.forEach(x=>x(m))}).catch(x=>{R==null||R(void 0,x)})};return a.persist={setOptions:v=>{i={...i,...v},v.storage&&(f=v.storage)},clearStorage:()=>{f==null||f.removeItem(i.name)},getOptions:()=>i,rehydrate:()=>S(),hasHydrated:()=>l,onHydrate:v=>(u.add(v),()=>{u.delete(v)}),onFinishHydration:v=>(c.add(v),()=>{c.delete(v)})},i.skipHydration||S(),m||b},CH=RH;function yz(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var a=e.length;for(t=0;t{const t=DH(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:l=>{const u=l.split(xk);return u[0]===""&&u.length!==1&&u.shift(),Sz(u,t)||OH(l)},getConflictingClassGroupIds:(l,u)=>{const c=n[l]||[];return u&&r[l]?[...c,...r[l]]:c}}},Sz=(e,t)=>{var l;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),a=r?Sz(e.slice(1),r):void 0;if(a)return a;if(t.validators.length===0)return;const i=e.join(xk);return(l=t.validators.find(({validator:u})=>u(i)))==null?void 0:l.classGroupId},tR=/^\[(.+)\]$/,OH=e=>{if(tR.test(e)){const t=tR.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},DH=e=>{const{theme:t,classGroups:n}=e,r={nextPart:new Map,validators:[]};for(const a in n)fx(n[a],r,a,t);return r},fx=(e,t,n,r)=>{e.forEach(a=>{if(typeof a=="string"){const i=a===""?t:nR(t,a);i.classGroupId=n;return}if(typeof a=="function"){if(IH(a)){fx(a(r),t,n,r);return}t.validators.push({validator:a,classGroupId:n});return}Object.entries(a).forEach(([i,l])=>{fx(l,nR(t,i),n,r)})})},nR=(e,t)=>{let n=e;return t.split(xk).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},IH=e=>e.isThemeGetter,LH=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const a=(i,l)=>{n.set(i,l),t++,t>e&&(t=0,r=n,n=new Map)};return{get(i){let l=n.get(i);if(l!==void 0)return l;if((l=r.get(i))!==void 0)return a(i,l),l},set(i,l){n.has(i)?n.set(i,l):a(i,l)}}},px="!",gx=":",MH=gx.length,FH=e=>{const{prefix:t,experimentalParseClassName:n}=e;let r=a=>{const i=[];let l=0,u=0,c=0,f;for(let S=0;Sc?f-c:void 0;return{modifiers:i,hasImportantModifier:b,baseClassName:g,maybePostfixModifierPosition:m}};if(t){const a=t+gx,i=r;r=l=>l.startsWith(a)?i(l.substring(a.length)):{isExternal:!0,modifiers:[],hasImportantModifier:!1,baseClassName:l,maybePostfixModifierPosition:void 0}}if(n){const a=r;r=i=>n({className:i,parseClassName:a})}return r},zH=e=>e.endsWith(px)?e.substring(0,e.length-1):e.startsWith(px)?e.substring(1):e,PH=e=>{const t=Object.fromEntries(e.orderSensitiveModifiers.map(r=>[r,!0]));return r=>{if(r.length<=1)return r;const a=[];let i=[];return r.forEach(l=>{l[0]==="["||t[l]?(a.push(...i.sort(),l),i=[]):i.push(l)}),a.push(...i.sort()),a}},BH=e=>({cache:LH(e.cacheSize),parseClassName:FH(e),sortModifiers:PH(e),...NH(e)}),UH=/\s+/,jH=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:a,sortModifiers:i}=t,l=[],u=e.trim().split(UH);let c="";for(let f=u.length-1;f>=0;f-=1){const p=u[f],{isExternal:g,modifiers:b,hasImportantModifier:m,baseClassName:S,maybePostfixModifierPosition:v}=n(p);if(g){c=p+(c.length>0?" "+c:c);continue}let A=!!v,R=r(A?S.substring(0,v):S);if(!R){if(!A){c=p+(c.length>0?" "+c:c);continue}if(R=r(S),!R){c=p+(c.length>0?" "+c:c);continue}A=!1}const x=i(b).join(":"),_=m?x+px:x,C=_+R;if(l.includes(C))continue;l.push(C);const N=a(R,A);for(let T=0;T0?" "+c:c)}return c};function GH(){let e=0,t,n,r="";for(;e{if(typeof e=="string")return e;let t,n="";for(let r=0;rg(p),e());return n=BH(f),r=n.cache.get,a=n.cache.set,i=u,u(c)}function u(c){const f=r(c);if(f)return f;const p=jH(c,n);return a(c,p),p}return function(){return i(GH.apply(null,arguments))}}const rn=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},wz=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,xz=/^\((?:(\w[\w-]*):)?(.+)\)$/i,$H=/^\d+\/\d+$/,qH=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,VH=/\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$/,WH=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,YH=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,KH=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Yi=e=>$H.test(e),ct=e=>!!e&&!Number.isNaN(Number(e)),Wo=e=>!!e&&Number.isInteger(Number(e)),rR=e=>e.endsWith("%")&&ct(e.slice(0,-1)),oo=e=>qH.test(e),XH=()=>!0,ZH=e=>VH.test(e)&&!WH.test(e),kk=()=>!1,QH=e=>YH.test(e),JH=e=>KH.test(e),e9=e=>!je(e)&&!Ge(e),t9=e=>xl(e,Tz,kk),je=e=>wz.test(e),Yo=e=>xl(e,_z,ZH),ih=e=>xl(e,f9,ct),n9=e=>xl(e,kz,kk),r9=e=>xl(e,Az,JH),a9=e=>xl(e,kk,QH),Ge=e=>xz.test(e),Fc=e=>kl(e,_z),o9=e=>kl(e,p9),i9=e=>kl(e,kz),l9=e=>kl(e,Tz),s9=e=>kl(e,Az),u9=e=>kl(e,g9,!0),xl=(e,t,n)=>{const r=wz.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},kl=(e,t,n=!1)=>{const r=xz.exec(e);return r?r[1]?t(r[1]):n:!1},kz=e=>e==="position",c9=new Set(["image","url"]),Az=e=>c9.has(e),d9=new Set(["length","size","percentage"]),Tz=e=>d9.has(e),_z=e=>e==="length",f9=e=>e==="number",p9=e=>e==="family-name",g9=e=>e==="shadow",h9=()=>{const e=rn("color"),t=rn("font"),n=rn("text"),r=rn("font-weight"),a=rn("tracking"),i=rn("leading"),l=rn("breakpoint"),u=rn("container"),c=rn("spacing"),f=rn("radius"),p=rn("shadow"),g=rn("inset-shadow"),b=rn("drop-shadow"),m=rn("blur"),S=rn("perspective"),v=rn("aspect"),A=rn("ease"),R=rn("animate"),x=()=>["auto","avoid","all","avoid-page","page","left","right","column"],_=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],C=()=>["auto","hidden","clip","visible","scroll"],N=()=>["auto","contain","none"],T=()=>[Ge,je,c],O=()=>[Yi,"full","auto",...T()],z=()=>[Wo,"none","subgrid",Ge,je],I=()=>["auto",{span:["full",Wo,Ge,je]},Ge,je],M=()=>[Wo,"auto",Ge,je],H=()=>["auto","min","max","fr",Ge,je],q=()=>["start","end","center","between","around","evenly","stretch","baseline"],U=()=>["start","end","center","stretch"],W=()=>["auto",...T()],Z=()=>[Yi,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...T()],j=()=>[e,Ge,je],G=()=>[rR,Yo],P=()=>["","none","full",f,Ge,je],X=()=>["",ct,Fc,Yo],D=()=>["solid","dashed","dotted","double"],V=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],B=()=>["","none",m,Ge,je],L=()=>["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",Ge,je],Y=()=>["none",ct,Ge,je],Q=()=>["none",ct,Ge,je],se=()=>[ct,Ge,je],re=()=>[Yi,"full",...T()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[oo],breakpoint:[oo],color:[XH],container:[oo],"drop-shadow":[oo],ease:["in","out","in-out"],font:[e9],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[oo],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[oo],shadow:[oo],spacing:["px",ct],text:[oo],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Yi,je,Ge,v]}],container:["container"],columns:[{columns:[ct,je,Ge,u]}],"break-after":[{"break-after":x()}],"break-before":[{"break-before":x()}],"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:[..._(),je,Ge]}],overflow:[{overflow:C()}],"overflow-x":[{"overflow-x":C()}],"overflow-y":[{"overflow-y":C()}],overscroll:[{overscroll:N()}],"overscroll-x":[{"overscroll-x":N()}],"overscroll-y":[{"overscroll-y":N()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:O()}],"inset-x":[{"inset-x":O()}],"inset-y":[{"inset-y":O()}],start:[{start:O()}],end:[{end:O()}],top:[{top:O()}],right:[{right:O()}],bottom:[{bottom:O()}],left:[{left:O()}],visibility:["visible","invisible","collapse"],z:[{z:[Wo,"auto",Ge,je]}],basis:[{basis:[Yi,"full","auto",u,...T()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[ct,Yi,"auto","initial","none",je]}],grow:[{grow:["",ct,Ge,je]}],shrink:[{shrink:["",ct,Ge,je]}],order:[{order:[Wo,"first","last","none",Ge,je]}],"grid-cols":[{"grid-cols":z()}],"col-start-end":[{col:I()}],"col-start":[{"col-start":M()}],"col-end":[{"col-end":M()}],"grid-rows":[{"grid-rows":z()}],"row-start-end":[{row:I()}],"row-start":[{"row-start":M()}],"row-end":[{"row-end":M()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":H()}],"auto-rows":[{"auto-rows":H()}],gap:[{gap:T()}],"gap-x":[{"gap-x":T()}],"gap-y":[{"gap-y":T()}],"justify-content":[{justify:[...q(),"normal"]}],"justify-items":[{"justify-items":[...U(),"normal"]}],"justify-self":[{"justify-self":["auto",...U()]}],"align-content":[{content:["normal",...q()]}],"align-items":[{items:[...U(),"baseline"]}],"align-self":[{self:["auto",...U(),"baseline"]}],"place-content":[{"place-content":q()}],"place-items":[{"place-items":[...U(),"baseline"]}],"place-self":[{"place-self":["auto",...U()]}],p:[{p:T()}],px:[{px:T()}],py:[{py:T()}],ps:[{ps:T()}],pe:[{pe:T()}],pt:[{pt:T()}],pr:[{pr:T()}],pb:[{pb:T()}],pl:[{pl:T()}],m:[{m:W()}],mx:[{mx:W()}],my:[{my:W()}],ms:[{ms:W()}],me:[{me:W()}],mt:[{mt:W()}],mr:[{mr:W()}],mb:[{mb:W()}],ml:[{ml:W()}],"space-x":[{"space-x":T()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":T()}],"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:[l]},...Z()]}],h:[{h:["screen",...Z()]}],"min-h":[{"min-h":["screen","none",...Z()]}],"max-h":[{"max-h":["screen",...Z()]}],"font-size":[{text:["base",n,Fc,Yo]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,Ge,ih]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",rR,je]}],"font-family":[{font:[o9,je,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:[a,Ge,je]}],"line-clamp":[{"line-clamp":[ct,"none",Ge,ih]}],leading:[{leading:[i,...T()]}],"list-image":[{"list-image":["none",Ge,je]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Ge,je]}],"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:[...D(),"wavy"]}],"text-decoration-thickness":[{decoration:[ct,"from-font","auto",Ge,Yo]}],"text-decoration-color":[{decoration:j()}],"underline-offset":[{"underline-offset":[ct,"auto",Ge,je]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:T()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Ge,je]}],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",Ge,je]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[..._(),i9,n9]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","space","round"]}]}],"bg-size":[{bg:["auto","cover","contain",l9,t9]}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Wo,Ge,je],radial:["",Ge,je],conic:[Wo,Ge,je]},s9,r9]}],"bg-color":[{bg:j()}],"gradient-from-pos":[{from:G()}],"gradient-via-pos":[{via:G()}],"gradient-to-pos":[{to:G()}],"gradient-from":[{from:j()}],"gradient-via":[{via:j()}],"gradient-to":[{to:j()}],rounded:[{rounded:P()}],"rounded-s":[{"rounded-s":P()}],"rounded-e":[{"rounded-e":P()}],"rounded-t":[{"rounded-t":P()}],"rounded-r":[{"rounded-r":P()}],"rounded-b":[{"rounded-b":P()}],"rounded-l":[{"rounded-l":P()}],"rounded-ss":[{"rounded-ss":P()}],"rounded-se":[{"rounded-se":P()}],"rounded-ee":[{"rounded-ee":P()}],"rounded-es":[{"rounded-es":P()}],"rounded-tl":[{"rounded-tl":P()}],"rounded-tr":[{"rounded-tr":P()}],"rounded-br":[{"rounded-br":P()}],"rounded-bl":[{"rounded-bl":P()}],"border-w":[{border:X()}],"border-w-x":[{"border-x":X()}],"border-w-y":[{"border-y":X()}],"border-w-s":[{"border-s":X()}],"border-w-e":[{"border-e":X()}],"border-w-t":[{"border-t":X()}],"border-w-r":[{"border-r":X()}],"border-w-b":[{"border-b":X()}],"border-w-l":[{"border-l":X()}],"divide-x":[{"divide-x":X()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":X()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...D(),"hidden","none"]}],"divide-style":[{divide:[...D(),"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:[...D(),"none","hidden"]}],"outline-offset":[{"outline-offset":[ct,Ge,je]}],"outline-w":[{outline:["",ct,Fc,Yo]}],"outline-color":[{outline:[e]}],shadow:[{shadow:["","none",p,u9,a9]}],"shadow-color":[{shadow:j()}],"inset-shadow":[{"inset-shadow":["none",Ge,je,g]}],"inset-shadow-color":[{"inset-shadow":j()}],"ring-w":[{ring:X()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:j()}],"ring-offset-w":[{"ring-offset":[ct,Yo]}],"ring-offset-color":[{"ring-offset":j()}],"inset-ring-w":[{"inset-ring":X()}],"inset-ring-color":[{"inset-ring":j()}],opacity:[{opacity:[ct,Ge,je]}],"mix-blend":[{"mix-blend":[...V(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":V()}],filter:[{filter:["","none",Ge,je]}],blur:[{blur:B()}],brightness:[{brightness:[ct,Ge,je]}],contrast:[{contrast:[ct,Ge,je]}],"drop-shadow":[{"drop-shadow":["","none",b,Ge,je]}],grayscale:[{grayscale:["",ct,Ge,je]}],"hue-rotate":[{"hue-rotate":[ct,Ge,je]}],invert:[{invert:["",ct,Ge,je]}],saturate:[{saturate:[ct,Ge,je]}],sepia:[{sepia:["",ct,Ge,je]}],"backdrop-filter":[{"backdrop-filter":["","none",Ge,je]}],"backdrop-blur":[{"backdrop-blur":B()}],"backdrop-brightness":[{"backdrop-brightness":[ct,Ge,je]}],"backdrop-contrast":[{"backdrop-contrast":[ct,Ge,je]}],"backdrop-grayscale":[{"backdrop-grayscale":["",ct,Ge,je]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[ct,Ge,je]}],"backdrop-invert":[{"backdrop-invert":["",ct,Ge,je]}],"backdrop-opacity":[{"backdrop-opacity":[ct,Ge,je]}],"backdrop-saturate":[{"backdrop-saturate":[ct,Ge,je]}],"backdrop-sepia":[{"backdrop-sepia":["",ct,Ge,je]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":T()}],"border-spacing-x":[{"border-spacing-x":T()}],"border-spacing-y":[{"border-spacing-y":T()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",Ge,je]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[ct,"initial",Ge,je]}],ease:[{ease:["linear","initial",A,Ge,je]}],delay:[{delay:[ct,Ge,je]}],animate:[{animate:["none",R,Ge,je]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[S,Ge,je]}],"perspective-origin":[{"perspective-origin":L()}],rotate:[{rotate:Y()}],"rotate-x":[{"rotate-x":Y()}],"rotate-y":[{"rotate-y":Y()}],"rotate-z":[{"rotate-z":Y()}],scale:[{scale:Q()}],"scale-x":[{"scale-x":Q()}],"scale-y":[{"scale-y":Q()}],"scale-z":[{"scale-z":Q()}],"scale-3d":["scale-3d"],skew:[{skew:se()}],"skew-x":[{"skew-x":se()}],"skew-y":[{"skew-y":se()}],transform:[{transform:[Ge,je,"","none","gpu","cpu"]}],"transform-origin":[{origin:L()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:re()}],"translate-x":[{"translate-x":re()}],"translate-y":[{"translate-y":re()}],"translate-z":[{"translate-z":re()}],"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",Ge,je]}],"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":T()}],"scroll-mx":[{"scroll-mx":T()}],"scroll-my":[{"scroll-my":T()}],"scroll-ms":[{"scroll-ms":T()}],"scroll-me":[{"scroll-me":T()}],"scroll-mt":[{"scroll-mt":T()}],"scroll-mr":[{"scroll-mr":T()}],"scroll-mb":[{"scroll-mb":T()}],"scroll-ml":[{"scroll-ml":T()}],"scroll-p":[{"scroll-p":T()}],"scroll-px":[{"scroll-px":T()}],"scroll-py":[{"scroll-py":T()}],"scroll-ps":[{"scroll-ps":T()}],"scroll-pe":[{"scroll-pe":T()}],"scroll-pt":[{"scroll-pt":T()}],"scroll-pr":[{"scroll-pr":T()}],"scroll-pb":[{"scroll-pb":T()}],"scroll-pl":[{"scroll-pl":T()}],"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",Ge,je]}],fill:[{fill:["none",...j()]}],"stroke-w":[{stroke:[ct,Fc,Yo,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","*","**"]}},m9=HH(h9);function Me(...e){return m9(vz(e))}function b9(){const e="0123456789abcdef";let t="#";for(let n=0;n<6;n++)t+=e.charAt(Math.floor(Math.random()*16));return t}function Nr(e){return e instanceof Error?e.message:`${e}`}const Ak=e=>{const t=e;t.use={};for(const n of Object.keys(t.getState()))t.use[n]=()=>t(r=>r[n]);return t},Rz="",Yr="ghost",y9="#B2EBF2",v9="#000",S9="#E2E2E2",E9="#EEEEEE",w9="#F57F17",x9="#969696",k9="#F57F17",aR="#B2EBF2",lh=20,sh=40,oR=4,A9=20,T9=15,iR="*",_9={"text/plain":[".txt",".md",".html",".htm",".tex",".json",".xml",".yaml",".yml",".rtf",".odt",".epub",".csv",".log",".conf",".ini",".properties",".sql",".bat",".sh",".c",".cpp",".py",".java",".js",".ts",".swift",".go",".rb",".php",".css",".scss",".less"],"application/pdf":[".pdf"],"application/msword":[".doc"],"application/vnd.openxmlformats-officedocument.wordprocessingml.document":[".docx"],"application/vnd.openxmlformats-officedocument.presentationml.presentation":[".pptx"]},lR={name:"LightRAG",github:"https://github.com/HKUDS/LightRAG"},R9=wk()(CH(e=>({theme:"system",showPropertyPanel:!0,showNodeSearchBar:!0,showNodeLabel:!0,enableNodeDrag:!0,showEdgeLabel:!1,enableHideUnselectedEdges:!0,enableEdgeEvents:!1,graphQueryMaxDepth:3,graphLayoutMaxIterations:10,queryLabel:iR,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}),setGraphLayoutMaxIterations:t=>e({graphLayoutMaxIterations:t}),setQueryLabel:t=>e({queryLabel:t}),setGraphQueryMaxDepth:t=>e({graphQueryMaxDepth: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:bz(()=>localStorage),version:7,migrate:(e,t)=>(t<2&&(e.showEdgeLabel=!1),t<3&&(e.queryLabel=iR),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=[]),t<7&&(e.graphQueryMaxDepth=3,e.graphLayoutMaxIterations=10),e)})),Ke=Ak(R9),C9={theme:"system",setTheme:()=>null},Cz=k.createContext(C9);function N9({children:e,...t}){const[n,r]=k.useState(Ke.getState().theme);k.useEffect(()=>{const i=window.document.documentElement;if(i.classList.remove("light","dark"),n==="system"){const l=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";i.classList.add(l),r(l);return}i.classList.add(n)},[n]);const a={theme:n,setTheme:i=>{Ke.getState().setTheme(i),r(i)}};return w.jsx(Cz.Provider,{...t,value:a,children:e})}const sR=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,uR=vz,Nz=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return uR(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:a,defaultVariants:i}=t,l=Object.keys(a).map(f=>{const p=n==null?void 0:n[f],g=i==null?void 0:i[f];if(p===null)return null;const b=sR(p)||sR(g);return a[f][b]}),u=n&&Object.entries(n).reduce((f,p)=>{let[g,b]=p;return b===void 0||(f[g]=b),f},{}),c=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((f,p)=>{let{class:g,className:b,...m}=p;return Object.entries(m).every(S=>{let[v,A]=S;return Array.isArray(A)?A.includes({...i,...u}[v]):{...i,...u}[v]===A})?[...f,g,b]:f},[]);return uR(e,l,c,n==null?void 0:n.class,n==null?void 0:n.className)},O9=Nz("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"}}),Oz=k.forwardRef(({className:e,variant:t,...n},r)=>w.jsx("div",{ref:r,role:"alert",className:Me(O9({variant:t}),e),...n}));Oz.displayName="Alert";const Dz=k.forwardRef(({className:e,...t},n)=>w.jsx("h5",{ref:n,className:Me("mb-1 leading-none font-medium tracking-tight",e),...t}));Dz.displayName="AlertTitle";const Iz=k.forwardRef(({className:e,...t},n)=>w.jsx("div",{ref:n,className:Me("text-sm [&_p]:leading-relaxed",e),...t}));Iz.displayName="AlertDescription";function Lz(e,t){return function(){return e.apply(t,arguments)}}const{toString:D9}=Object.prototype,{getPrototypeOf:Tk}=Object,rf=(e=>t=>{const n=D9.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),Lr=e=>(e=e.toLowerCase(),t=>rf(t)===e),af=e=>t=>typeof t===e,{isArray:Al}=Array,Qs=af("undefined");function I9(e){return e!==null&&!Qs(e)&&e.constructor!==null&&!Qs(e.constructor)&&Xn(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const Mz=Lr("ArrayBuffer");function L9(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&Mz(e.buffer),t}const M9=af("string"),Xn=af("function"),Fz=af("number"),of=e=>e!==null&&typeof e=="object",F9=e=>e===!0||e===!1,fd=e=>{if(rf(e)!=="object")return!1;const t=Tk(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)},z9=Lr("Date"),P9=Lr("File"),B9=Lr("Blob"),U9=Lr("FileList"),j9=e=>of(e)&&Xn(e.pipe),G9=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||Xn(e.append)&&((t=rf(e))==="formdata"||t==="object"&&Xn(e.toString)&&e.toString()==="[object FormData]"))},H9=Lr("URLSearchParams"),[$9,q9,V9,W9]=["ReadableStream","Request","Response","Headers"].map(Lr),Y9=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function du(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let r,a;if(typeof e!="object"&&(e=[e]),Al(e))for(r=0,a=e.length;r0;)if(a=n[r],t===a.toLowerCase())return a;return null}const ti=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,Pz=e=>!Qs(e)&&e!==ti;function hx(){const{caseless:e}=Pz(this)&&this||{},t={},n=(r,a)=>{const i=e&&zz(t,a)||a;fd(t[i])&&fd(r)?t[i]=hx(t[i],r):fd(r)?t[i]=hx({},r):Al(r)?t[i]=r.slice():t[i]=r};for(let r=0,a=arguments.length;r(du(t,(a,i)=>{n&&Xn(a)?e[i]=Lz(a,n):e[i]=a},{allOwnKeys:r}),e),X9=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),Z9=(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},Q9=(e,t,n,r)=>{let a,i,l;const u={};if(t=t||{},e==null)return t;do{for(a=Object.getOwnPropertyNames(e),i=a.length;i-- >0;)l=a[i],(!r||r(l,e,t))&&!u[l]&&(t[l]=e[l],u[l]=!0);e=n!==!1&&Tk(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},J9=(e,t,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return r!==-1&&r===n},e$=e=>{if(!e)return null;if(Al(e))return e;let t=e.length;if(!Fz(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},t$=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&Tk(Uint8Array)),n$=(e,t)=>{const r=(e&&e[Symbol.iterator]).call(e);let a;for(;(a=r.next())&&!a.done;){const i=a.value;t.call(e,i[0],i[1])}},r$=(e,t)=>{let n;const r=[];for(;(n=e.exec(t))!==null;)r.push(n);return r},a$=Lr("HTMLFormElement"),o$=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,a){return r.toUpperCase()+a}),cR=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),i$=Lr("RegExp"),Bz=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};du(n,(a,i)=>{let l;(l=t(a,i,e))!==!1&&(r[i]=l||a)}),Object.defineProperties(e,r)},l$=e=>{Bz(e,(t,n)=>{if(Xn(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=e[n];if(Xn(r)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},s$=(e,t)=>{const n={},r=a=>{a.forEach(i=>{n[i]=!0})};return Al(e)?r(e):r(String(e).split(t)),n},u$=()=>{},c$=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t,uh="abcdefghijklmnopqrstuvwxyz",dR="0123456789",Uz={DIGIT:dR,ALPHA:uh,ALPHA_DIGIT:uh+uh.toUpperCase()+dR},d$=(e=16,t=Uz.ALPHA_DIGIT)=>{let n="";const{length:r}=t;for(;e--;)n+=t[Math.random()*r|0];return n};function f$(e){return!!(e&&Xn(e.append)&&e[Symbol.toStringTag]==="FormData"&&e[Symbol.iterator])}const p$=e=>{const t=new Array(10),n=(r,a)=>{if(of(r)){if(t.indexOf(r)>=0)return;if(!("toJSON"in r)){t[a]=r;const i=Al(r)?[]:{};return du(r,(l,u)=>{const c=n(l,a+1);!Qs(c)&&(i[u]=c)}),t[a]=void 0,i}}return r};return n(e,0)},g$=Lr("AsyncFunction"),h$=e=>e&&(of(e)||Xn(e))&&Xn(e.then)&&Xn(e.catch),jz=((e,t)=>e?setImmediate:t?((n,r)=>(ti.addEventListener("message",({source:a,data:i})=>{a===ti&&i===n&&r.length&&r.shift()()},!1),a=>{r.push(a),ti.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",Xn(ti.postMessage)),m$=typeof queueMicrotask<"u"?queueMicrotask.bind(ti):typeof process<"u"&&process.nextTick||jz,pe={isArray:Al,isArrayBuffer:Mz,isBuffer:I9,isFormData:G9,isArrayBufferView:L9,isString:M9,isNumber:Fz,isBoolean:F9,isObject:of,isPlainObject:fd,isReadableStream:$9,isRequest:q9,isResponse:V9,isHeaders:W9,isUndefined:Qs,isDate:z9,isFile:P9,isBlob:B9,isRegExp:i$,isFunction:Xn,isStream:j9,isURLSearchParams:H9,isTypedArray:t$,isFileList:U9,forEach:du,merge:hx,extend:K9,trim:Y9,stripBOM:X9,inherits:Z9,toFlatObject:Q9,kindOf:rf,kindOfTest:Lr,endsWith:J9,toArray:e$,forEachEntry:n$,matchAll:r$,isHTMLForm:a$,hasOwnProperty:cR,hasOwnProp:cR,reduceDescriptors:Bz,freezeMethods:l$,toObjectSet:s$,toCamelCase:o$,noop:u$,toFiniteNumber:c$,findKey:zz,global:ti,isContextDefined:Pz,ALPHABET:Uz,generateString:d$,isSpecCompliantForm:f$,toJSONObject:p$,isAsyncFn:g$,isThenable:h$,setImmediate:jz,asap:m$};function nt(e,t,n,r,a){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),a&&(this.response=a,this.status=a.status?a.status:null)}pe.inherits(nt,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:pe.toJSONObject(this.config),code:this.code,status:this.status}}});const Gz=nt.prototype,Hz={};["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=>{Hz[e]={value:e}});Object.defineProperties(nt,Hz);Object.defineProperty(Gz,"isAxiosError",{value:!0});nt.from=(e,t,n,r,a,i)=>{const l=Object.create(Gz);return pe.toFlatObject(e,l,function(c){return c!==Error.prototype},u=>u!=="isAxiosError"),nt.call(l,e.message,t,n,r,a),l.cause=e,l.name=e.name,i&&Object.assign(l,i),l};const b$=null;function mx(e){return pe.isPlainObject(e)||pe.isArray(e)}function $z(e){return pe.endsWith(e,"[]")?e.slice(0,-2):e}function fR(e,t,n){return e?e.concat(t).map(function(a,i){return a=$z(a),!n&&i?"["+a+"]":a}).join(n?".":""):t}function y$(e){return pe.isArray(e)&&!e.some(mx)}const v$=pe.toFlatObject(pe,{},null,function(t){return/^is[A-Z]/.test(t)});function lf(e,t,n){if(!pe.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,n=pe.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(v,A){return!pe.isUndefined(A[v])});const r=n.metaTokens,a=n.visitor||p,i=n.dots,l=n.indexes,c=(n.Blob||typeof Blob<"u"&&Blob)&&pe.isSpecCompliantForm(t);if(!pe.isFunction(a))throw new TypeError("visitor must be a function");function f(S){if(S===null)return"";if(pe.isDate(S))return S.toISOString();if(!c&&pe.isBlob(S))throw new nt("Blob is not supported. Use a Buffer instead.");return pe.isArrayBuffer(S)||pe.isTypedArray(S)?c&&typeof Blob=="function"?new Blob([S]):Buffer.from(S):S}function p(S,v,A){let R=S;if(S&&!A&&typeof S=="object"){if(pe.endsWith(v,"{}"))v=r?v:v.slice(0,-2),S=JSON.stringify(S);else if(pe.isArray(S)&&y$(S)||(pe.isFileList(S)||pe.endsWith(v,"[]"))&&(R=pe.toArray(S)))return v=$z(v),R.forEach(function(_,C){!(pe.isUndefined(_)||_===null)&&t.append(l===!0?fR([v],C,i):l===null?v:v+"[]",f(_))}),!1}return mx(S)?!0:(t.append(fR(A,v,i),f(S)),!1)}const g=[],b=Object.assign(v$,{defaultVisitor:p,convertValue:f,isVisitable:mx});function m(S,v){if(!pe.isUndefined(S)){if(g.indexOf(S)!==-1)throw Error("Circular reference detected in "+v.join("."));g.push(S),pe.forEach(S,function(R,x){(!(pe.isUndefined(R)||R===null)&&a.call(t,R,pe.isString(x)?x.trim():x,v,b))===!0&&m(R,v?v.concat(x):[x])}),g.pop()}}if(!pe.isObject(e))throw new TypeError("data must be an object");return m(e),t}function pR(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(r){return t[r]})}function _k(e,t){this._pairs=[],e&&lf(e,this,t)}const qz=_k.prototype;qz.append=function(t,n){this._pairs.push([t,n])};qz.toString=function(t){const n=t?function(r){return t.call(this,r,pR)}:pR;return this._pairs.map(function(a){return n(a[0])+"="+n(a[1])},"").join("&")};function S$(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Vz(e,t,n){if(!t)return e;const r=n&&n.encode||S$;pe.isFunction(n)&&(n={serialize:n});const a=n&&n.serialize;let i;if(a?i=a(t,n):i=pe.isURLSearchParams(t)?t.toString():new _k(t,n).toString(r),i){const l=e.indexOf("#");l!==-1&&(e=e.slice(0,l)),e+=(e.indexOf("?")===-1?"?":"&")+i}return e}class gR{constructor(){this.handlers=[]}use(t,n,r){return this.handlers.push({fulfilled:t,rejected:n,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){pe.forEach(this.handlers,function(r){r!==null&&t(r)})}}const Wz={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},E$=typeof URLSearchParams<"u"?URLSearchParams:_k,w$=typeof FormData<"u"?FormData:null,x$=typeof Blob<"u"?Blob:null,k$={isBrowser:!0,classes:{URLSearchParams:E$,FormData:w$,Blob:x$},protocols:["http","https","file","blob","url","data"]},Rk=typeof window<"u"&&typeof document<"u",bx=typeof navigator=="object"&&navigator||void 0,A$=Rk&&(!bx||["ReactNative","NativeScript","NS"].indexOf(bx.product)<0),T$=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",_$=Rk&&window.location.href||"http://localhost",R$=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:Rk,hasStandardBrowserEnv:A$,hasStandardBrowserWebWorkerEnv:T$,navigator:bx,origin:_$},Symbol.toStringTag,{value:"Module"})),yn={...R$,...k$};function C$(e,t){return lf(e,new yn.classes.URLSearchParams,Object.assign({visitor:function(n,r,a,i){return yn.isNode&&pe.isBuffer(n)?(this.append(r,n.toString("base64")),!1):i.defaultVisitor.apply(this,arguments)}},t))}function N$(e){return pe.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function O$(e){const t={},n=Object.keys(e);let r;const a=n.length;let i;for(r=0;r=n.length;return l=!l&&pe.isArray(a)?a.length:l,c?(pe.hasOwnProp(a,l)?a[l]=[a[l],r]:a[l]=r,!u):((!a[l]||!pe.isObject(a[l]))&&(a[l]=[]),t(n,r,a[l],i)&&pe.isArray(a[l])&&(a[l]=O$(a[l])),!u)}if(pe.isFormData(e)&&pe.isFunction(e.entries)){const n={};return pe.forEachEntry(e,(r,a)=>{t(N$(r),a,n,0)}),n}return null}function D$(e,t,n){if(pe.isString(e))try{return(t||JSON.parse)(e),pe.trim(e)}catch(r){if(r.name!=="SyntaxError")throw r}return(n||JSON.stringify)(e)}const fu={transitional:Wz,adapter:["xhr","http","fetch"],transformRequest:[function(t,n){const r=n.getContentType()||"",a=r.indexOf("application/json")>-1,i=pe.isObject(t);if(i&&pe.isHTMLForm(t)&&(t=new FormData(t)),pe.isFormData(t))return a?JSON.stringify(Yz(t)):t;if(pe.isArrayBuffer(t)||pe.isBuffer(t)||pe.isStream(t)||pe.isFile(t)||pe.isBlob(t)||pe.isReadableStream(t))return t;if(pe.isArrayBufferView(t))return t.buffer;if(pe.isURLSearchParams(t))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let u;if(i){if(r.indexOf("application/x-www-form-urlencoded")>-1)return C$(t,this.formSerializer).toString();if((u=pe.isFileList(t))||r.indexOf("multipart/form-data")>-1){const c=this.env&&this.env.FormData;return lf(u?{"files[]":t}:t,c&&new c,this.formSerializer)}}return i||a?(n.setContentType("application/json",!1),D$(t)):t}],transformResponse:[function(t){const n=this.transitional||fu.transitional,r=n&&n.forcedJSONParsing,a=this.responseType==="json";if(pe.isResponse(t)||pe.isReadableStream(t))return t;if(t&&pe.isString(t)&&(r&&!this.responseType||a)){const l=!(n&&n.silentJSONParsing)&&a;try{return JSON.parse(t)}catch(u){if(l)throw u.name==="SyntaxError"?nt.from(u,nt.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:yn.classes.FormData,Blob:yn.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};pe.forEach(["delete","get","head","post","put","patch"],e=>{fu.headers[e]={}});const I$=pe.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"]),L$=e=>{const t={};let n,r,a;return e&&e.split(` +`).forEach(function(l){a=l.indexOf(":"),n=l.substring(0,a).trim().toLowerCase(),r=l.substring(a+1).trim(),!(!n||t[n]&&I$[n])&&(n==="set-cookie"?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)}),t},hR=Symbol("internals");function Ls(e){return e&&String(e).trim().toLowerCase()}function pd(e){return e===!1||e==null?e:pe.isArray(e)?e.map(pd):String(e)}function M$(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}const F$=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function ch(e,t,n,r,a){if(pe.isFunction(r))return r.call(this,t,n);if(a&&(t=n),!!pe.isString(t)){if(pe.isString(r))return t.indexOf(r)!==-1;if(pe.isRegExp(r))return r.test(t)}}function z$(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,r)=>n.toUpperCase()+r)}function P$(e,t){const n=pe.toCamelCase(" "+t);["get","set","has"].forEach(r=>{Object.defineProperty(e,r+n,{value:function(a,i,l){return this[r].call(this,t,a,i,l)},configurable:!0})})}let zn=class{constructor(t){t&&this.set(t)}set(t,n,r){const a=this;function i(u,c,f){const p=Ls(c);if(!p)throw new Error("header name must be a non-empty string");const g=pe.findKey(a,p);(!g||a[g]===void 0||f===!0||f===void 0&&a[g]!==!1)&&(a[g||c]=pd(u))}const l=(u,c)=>pe.forEach(u,(f,p)=>i(f,p,c));if(pe.isPlainObject(t)||t instanceof this.constructor)l(t,n);else if(pe.isString(t)&&(t=t.trim())&&!F$(t))l(L$(t),n);else if(pe.isHeaders(t))for(const[u,c]of t.entries())i(c,u,r);else t!=null&&i(n,t,r);return this}get(t,n){if(t=Ls(t),t){const r=pe.findKey(this,t);if(r){const a=this[r];if(!n)return a;if(n===!0)return M$(a);if(pe.isFunction(n))return n.call(this,a,r);if(pe.isRegExp(n))return n.exec(a);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,n){if(t=Ls(t),t){const r=pe.findKey(this,t);return!!(r&&this[r]!==void 0&&(!n||ch(this,this[r],r,n)))}return!1}delete(t,n){const r=this;let a=!1;function i(l){if(l=Ls(l),l){const u=pe.findKey(r,l);u&&(!n||ch(r,r[u],u,n))&&(delete r[u],a=!0)}}return pe.isArray(t)?t.forEach(i):i(t),a}clear(t){const n=Object.keys(this);let r=n.length,a=!1;for(;r--;){const i=n[r];(!t||ch(this,this[i],i,t,!0))&&(delete this[i],a=!0)}return a}normalize(t){const n=this,r={};return pe.forEach(this,(a,i)=>{const l=pe.findKey(r,i);if(l){n[l]=pd(a),delete n[i];return}const u=t?z$(i):String(i).trim();u!==i&&delete n[i],n[u]=pd(a),r[u]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const n=Object.create(null);return pe.forEach(this,(r,a)=>{r!=null&&r!==!1&&(n[a]=t&&pe.isArray(r)?r.join(", "):r)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,n])=>t+": "+n).join(` +`)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...n){const r=new this(t);return n.forEach(a=>r.set(a)),r}static accessor(t){const r=(this[hR]=this[hR]={accessors:{}}).accessors,a=this.prototype;function i(l){const u=Ls(l);r[u]||(P$(a,l),r[u]=!0)}return pe.isArray(t)?t.forEach(i):i(t),this}};zn.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);pe.reduceDescriptors(zn.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(r){this[n]=r}}});pe.freezeMethods(zn);function dh(e,t){const n=this||fu,r=t||n,a=zn.from(r.headers);let i=r.data;return pe.forEach(e,function(u){i=u.call(n,i,a.normalize(),t?t.status:void 0)}),a.normalize(),i}function Kz(e){return!!(e&&e.__CANCEL__)}function Tl(e,t,n){nt.call(this,e??"canceled",nt.ERR_CANCELED,t,n),this.name="CanceledError"}pe.inherits(Tl,nt,{__CANCEL__:!0});function Xz(e,t,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new nt("Request failed with status code "+n.status,[nt.ERR_BAD_REQUEST,nt.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function B$(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function U$(e,t){e=e||10;const n=new Array(e),r=new Array(e);let a=0,i=0,l;return t=t!==void 0?t:1e3,function(c){const f=Date.now(),p=r[i];l||(l=f),n[a]=c,r[a]=f;let g=i,b=0;for(;g!==a;)b+=n[g++],g=g%e;if(a=(a+1)%e,a===i&&(i=(i+1)%e),f-l{n=p,a=null,i&&(clearTimeout(i),i=null),e.apply(null,f)};return[(...f)=>{const p=Date.now(),g=p-n;g>=r?l(f,p):(a=f,i||(i=setTimeout(()=>{i=null,l(a)},r-g)))},()=>a&&l(a)]}const Nd=(e,t,n=3)=>{let r=0;const a=U$(50,250);return j$(i=>{const l=i.loaded,u=i.lengthComputable?i.total:void 0,c=l-r,f=a(c),p=l<=u;r=l;const g={loaded:l,total:u,progress:u?l/u:void 0,bytes:c,rate:f||void 0,estimated:f&&u&&p?(u-l)/f:void 0,event:i,lengthComputable:u!=null,[t?"download":"upload"]:!0};e(g)},n)},mR=(e,t)=>{const n=e!=null;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},bR=e=>(...t)=>pe.asap(()=>e(...t)),G$=yn.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,yn.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(yn.origin),yn.navigator&&/(msie|trident)/i.test(yn.navigator.userAgent)):()=>!0,H$=yn.hasStandardBrowserEnv?{write(e,t,n,r,a,i){const l=[e+"="+encodeURIComponent(t)];pe.isNumber(n)&&l.push("expires="+new Date(n).toGMTString()),pe.isString(r)&&l.push("path="+r),pe.isString(a)&&l.push("domain="+a),i===!0&&l.push("secure"),document.cookie=l.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function $$(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function q$(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function Zz(e,t){return e&&!$$(t)?q$(e,t):t}const yR=e=>e instanceof zn?{...e}:e;function ri(e,t){t=t||{};const n={};function r(f,p,g,b){return pe.isPlainObject(f)&&pe.isPlainObject(p)?pe.merge.call({caseless:b},f,p):pe.isPlainObject(p)?pe.merge({},p):pe.isArray(p)?p.slice():p}function a(f,p,g,b){if(pe.isUndefined(p)){if(!pe.isUndefined(f))return r(void 0,f,g,b)}else return r(f,p,g,b)}function i(f,p){if(!pe.isUndefined(p))return r(void 0,p)}function l(f,p){if(pe.isUndefined(p)){if(!pe.isUndefined(f))return r(void 0,f)}else return r(void 0,p)}function u(f,p,g){if(g in t)return r(f,p);if(g in e)return r(void 0,f)}const c={url:i,method:i,data:i,baseURL:l,transformRequest:l,transformResponse:l,paramsSerializer:l,timeout:l,timeoutMessage:l,withCredentials:l,withXSRFToken:l,adapter:l,responseType:l,xsrfCookieName:l,xsrfHeaderName:l,onUploadProgress:l,onDownloadProgress:l,decompress:l,maxContentLength:l,maxBodyLength:l,beforeRedirect:l,transport:l,httpAgent:l,httpsAgent:l,cancelToken:l,socketPath:l,responseEncoding:l,validateStatus:u,headers:(f,p,g)=>a(yR(f),yR(p),g,!0)};return pe.forEach(Object.keys(Object.assign({},e,t)),function(p){const g=c[p]||a,b=g(e[p],t[p],p);pe.isUndefined(b)&&g!==u||(n[p]=b)}),n}const Qz=e=>{const t=ri({},e);let{data:n,withXSRFToken:r,xsrfHeaderName:a,xsrfCookieName:i,headers:l,auth:u}=t;t.headers=l=zn.from(l),t.url=Vz(Zz(t.baseURL,t.url),e.params,e.paramsSerializer),u&&l.set("Authorization","Basic "+btoa((u.username||"")+":"+(u.password?unescape(encodeURIComponent(u.password)):"")));let c;if(pe.isFormData(n)){if(yn.hasStandardBrowserEnv||yn.hasStandardBrowserWebWorkerEnv)l.setContentType(void 0);else if((c=l.getContentType())!==!1){const[f,...p]=c?c.split(";").map(g=>g.trim()).filter(Boolean):[];l.setContentType([f||"multipart/form-data",...p].join("; "))}}if(yn.hasStandardBrowserEnv&&(r&&pe.isFunction(r)&&(r=r(t)),r||r!==!1&&G$(t.url))){const f=a&&i&&H$.read(i);f&&l.set(a,f)}return t},V$=typeof XMLHttpRequest<"u",W$=V$&&function(e){return new Promise(function(n,r){const a=Qz(e);let i=a.data;const l=zn.from(a.headers).normalize();let{responseType:u,onUploadProgress:c,onDownloadProgress:f}=a,p,g,b,m,S;function v(){m&&m(),S&&S(),a.cancelToken&&a.cancelToken.unsubscribe(p),a.signal&&a.signal.removeEventListener("abort",p)}let A=new XMLHttpRequest;A.open(a.method.toUpperCase(),a.url,!0),A.timeout=a.timeout;function R(){if(!A)return;const _=zn.from("getAllResponseHeaders"in A&&A.getAllResponseHeaders()),N={data:!u||u==="text"||u==="json"?A.responseText:A.response,status:A.status,statusText:A.statusText,headers:_,config:e,request:A};Xz(function(O){n(O),v()},function(O){r(O),v()},N),A=null}"onloadend"in A?A.onloadend=R:A.onreadystatechange=function(){!A||A.readyState!==4||A.status===0&&!(A.responseURL&&A.responseURL.indexOf("file:")===0)||setTimeout(R)},A.onabort=function(){A&&(r(new nt("Request aborted",nt.ECONNABORTED,e,A)),A=null)},A.onerror=function(){r(new nt("Network Error",nt.ERR_NETWORK,e,A)),A=null},A.ontimeout=function(){let C=a.timeout?"timeout of "+a.timeout+"ms exceeded":"timeout exceeded";const N=a.transitional||Wz;a.timeoutErrorMessage&&(C=a.timeoutErrorMessage),r(new nt(C,N.clarifyTimeoutError?nt.ETIMEDOUT:nt.ECONNABORTED,e,A)),A=null},i===void 0&&l.setContentType(null),"setRequestHeader"in A&&pe.forEach(l.toJSON(),function(C,N){A.setRequestHeader(N,C)}),pe.isUndefined(a.withCredentials)||(A.withCredentials=!!a.withCredentials),u&&u!=="json"&&(A.responseType=a.responseType),f&&([b,S]=Nd(f,!0),A.addEventListener("progress",b)),c&&A.upload&&([g,m]=Nd(c),A.upload.addEventListener("progress",g),A.upload.addEventListener("loadend",m)),(a.cancelToken||a.signal)&&(p=_=>{A&&(r(!_||_.type?new Tl(null,e,A):_),A.abort(),A=null)},a.cancelToken&&a.cancelToken.subscribe(p),a.signal&&(a.signal.aborted?p():a.signal.addEventListener("abort",p)));const x=B$(a.url);if(x&&yn.protocols.indexOf(x)===-1){r(new nt("Unsupported protocol "+x+":",nt.ERR_BAD_REQUEST,e));return}A.send(i||null)})},Y$=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let r=new AbortController,a;const i=function(f){if(!a){a=!0,u();const p=f instanceof Error?f:this.reason;r.abort(p instanceof nt?p:new Tl(p instanceof Error?p.message:p))}};let l=t&&setTimeout(()=>{l=null,i(new nt(`timeout ${t} of ms exceeded`,nt.ETIMEDOUT))},t);const u=()=>{e&&(l&&clearTimeout(l),l=null,e.forEach(f=>{f.unsubscribe?f.unsubscribe(i):f.removeEventListener("abort",i)}),e=null)};e.forEach(f=>f.addEventListener("abort",i));const{signal:c}=r;return c.unsubscribe=()=>pe.asap(u),c}},K$=function*(e,t){let n=e.byteLength;if(n{const a=X$(e,t);let i=0,l,u=c=>{l||(l=!0,r&&r(c))};return new ReadableStream({async pull(c){try{const{done:f,value:p}=await a.next();if(f){u(),c.close();return}let g=p.byteLength;if(n){let b=i+=g;n(b)}c.enqueue(new Uint8Array(p))}catch(f){throw u(f),f}},cancel(c){return u(c),a.return()}},{highWaterMark:2})},sf=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",Jz=sf&&typeof ReadableStream=="function",Q$=sf&&(typeof TextEncoder=="function"?(e=>t=>e.encode(t))(new TextEncoder):async e=>new Uint8Array(await new Response(e).arrayBuffer())),eP=(e,...t)=>{try{return!!e(...t)}catch{return!1}},J$=Jz&&eP(()=>{let e=!1;const t=new Request(yn.origin,{body:new ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t}),SR=64*1024,yx=Jz&&eP(()=>pe.isReadableStream(new Response("").body)),Od={stream:yx&&(e=>e.body)};sf&&(e=>{["text","arrayBuffer","blob","formData","stream"].forEach(t=>{!Od[t]&&(Od[t]=pe.isFunction(e[t])?n=>n[t]():(n,r)=>{throw new nt(`Response type '${t}' is not supported`,nt.ERR_NOT_SUPPORT,r)})})})(new Response);const eq=async e=>{if(e==null)return 0;if(pe.isBlob(e))return e.size;if(pe.isSpecCompliantForm(e))return(await new Request(yn.origin,{method:"POST",body:e}).arrayBuffer()).byteLength;if(pe.isArrayBufferView(e)||pe.isArrayBuffer(e))return e.byteLength;if(pe.isURLSearchParams(e)&&(e=e+""),pe.isString(e))return(await Q$(e)).byteLength},tq=async(e,t)=>{const n=pe.toFiniteNumber(e.getContentLength());return n??eq(t)},nq=sf&&(async e=>{let{url:t,method:n,data:r,signal:a,cancelToken:i,timeout:l,onDownloadProgress:u,onUploadProgress:c,responseType:f,headers:p,withCredentials:g="same-origin",fetchOptions:b}=Qz(e);f=f?(f+"").toLowerCase():"text";let m=Y$([a,i&&i.toAbortSignal()],l),S;const v=m&&m.unsubscribe&&(()=>{m.unsubscribe()});let A;try{if(c&&J$&&n!=="get"&&n!=="head"&&(A=await tq(p,r))!==0){let N=new Request(t,{method:"POST",body:r,duplex:"half"}),T;if(pe.isFormData(r)&&(T=N.headers.get("content-type"))&&p.setContentType(T),N.body){const[O,z]=mR(A,Nd(bR(c)));r=vR(N.body,SR,O,z)}}pe.isString(g)||(g=g?"include":"omit");const R="credentials"in Request.prototype;S=new Request(t,{...b,signal:m,method:n.toUpperCase(),headers:p.normalize().toJSON(),body:r,duplex:"half",credentials:R?g:void 0});let x=await fetch(S);const _=yx&&(f==="stream"||f==="response");if(yx&&(u||_&&v)){const N={};["status","statusText","headers"].forEach(I=>{N[I]=x[I]});const T=pe.toFiniteNumber(x.headers.get("content-length")),[O,z]=u&&mR(T,Nd(bR(u),!0))||[];x=new Response(vR(x.body,SR,O,()=>{z&&z(),v&&v()}),N)}f=f||"text";let C=await Od[pe.findKey(Od,f)||"text"](x,e);return!_&&v&&v(),await new Promise((N,T)=>{Xz(N,T,{data:C,headers:zn.from(x.headers),status:x.status,statusText:x.statusText,config:e,request:S})})}catch(R){throw v&&v(),R&&R.name==="TypeError"&&/fetch/i.test(R.message)?Object.assign(new nt("Network Error",nt.ERR_NETWORK,e,S),{cause:R.cause||R}):nt.from(R,R&&R.code,e,S)}}),vx={http:b$,xhr:W$,fetch:nq};pe.forEach(vx,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const ER=e=>`- ${e}`,rq=e=>pe.isFunction(e)||e===null||e===!1,tP={getAdapter:e=>{e=pe.isArray(e)?e:[e];const{length:t}=e;let n,r;const a={};for(let i=0;i`adapter ${u} `+(c===!1?"is not supported by the environment":"is not available in the build"));let l=t?i.length>1?`since : +`+i.map(ER).join(` +`):" "+ER(i[0]):"as no adapter specified";throw new nt("There is no suitable adapter to dispatch the request "+l,"ERR_NOT_SUPPORT")}return r},adapters:vx};function fh(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Tl(null,e)}function wR(e){return fh(e),e.headers=zn.from(e.headers),e.data=dh.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),tP.getAdapter(e.adapter||fu.adapter)(e).then(function(r){return fh(e),r.data=dh.call(e,e.transformResponse,r),r.headers=zn.from(r.headers),r},function(r){return Kz(r)||(fh(e),r&&r.response&&(r.response.data=dh.call(e,e.transformResponse,r.response),r.response.headers=zn.from(r.response.headers))),Promise.reject(r)})}const nP="1.7.9",uf={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{uf[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const xR={};uf.transitional=function(t,n,r){function a(i,l){return"[Axios v"+nP+"] Transitional option '"+i+"'"+l+(r?". "+r:"")}return(i,l,u)=>{if(t===!1)throw new nt(a(l," has been removed"+(n?" in "+n:"")),nt.ERR_DEPRECATED);return n&&!xR[l]&&(xR[l]=!0,console.warn(a(l," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(i,l,u):!0}};uf.spelling=function(t){return(n,r)=>(console.warn(`${r} is likely a misspelling of ${t}`),!0)};function aq(e,t,n){if(typeof e!="object")throw new nt("options must be an object",nt.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let a=r.length;for(;a-- >0;){const i=r[a],l=t[i];if(l){const u=e[i],c=u===void 0||l(u,i,e);if(c!==!0)throw new nt("option "+i+" must be "+c,nt.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new nt("Unknown option "+i,nt.ERR_BAD_OPTION)}}const gd={assertOptions:aq,validators:uf},Hr=gd.validators;let ni=class{constructor(t){this.defaults=t,this.interceptors={request:new gR,response:new gR}}async request(t,n){try{return await this._request(t,n)}catch(r){if(r instanceof Error){let a={};Error.captureStackTrace?Error.captureStackTrace(a):a=new Error;const i=a.stack?a.stack.replace(/^.+\n/,""):"";try{r.stack?i&&!String(r.stack).endsWith(i.replace(/^.+\n.+\n/,""))&&(r.stack+=` +`+i):r.stack=i}catch{}}throw r}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=ri(this.defaults,n);const{transitional:r,paramsSerializer:a,headers:i}=n;r!==void 0&&gd.assertOptions(r,{silentJSONParsing:Hr.transitional(Hr.boolean),forcedJSONParsing:Hr.transitional(Hr.boolean),clarifyTimeoutError:Hr.transitional(Hr.boolean)},!1),a!=null&&(pe.isFunction(a)?n.paramsSerializer={serialize:a}:gd.assertOptions(a,{encode:Hr.function,serialize:Hr.function},!0)),gd.assertOptions(n,{baseUrl:Hr.spelling("baseURL"),withXsrfToken:Hr.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let l=i&&pe.merge(i.common,i[n.method]);i&&pe.forEach(["delete","get","head","post","put","patch","common"],S=>{delete i[S]}),n.headers=zn.concat(l,i);const u=[];let c=!0;this.interceptors.request.forEach(function(v){typeof v.runWhen=="function"&&v.runWhen(n)===!1||(c=c&&v.synchronous,u.unshift(v.fulfilled,v.rejected))});const f=[];this.interceptors.response.forEach(function(v){f.push(v.fulfilled,v.rejected)});let p,g=0,b;if(!c){const S=[wR.bind(this),void 0];for(S.unshift.apply(S,u),S.push.apply(S,f),b=S.length,p=Promise.resolve(n);g{if(!r._listeners)return;let i=r._listeners.length;for(;i-- >0;)r._listeners[i](a);r._listeners=null}),this.promise.then=a=>{let i;const l=new Promise(u=>{r.subscribe(u),i=u}).then(a);return l.cancel=function(){r.unsubscribe(i)},l},t(function(i,l,u){r.reason||(r.reason=new Tl(i,l,u),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const t=new AbortController,n=r=>{t.abort(r)};return this.subscribe(n),t.signal.unsubscribe=()=>this.unsubscribe(n),t.signal}static source(){let t;return{token:new rP(function(a){t=a}),cancel:t}}};function iq(e){return function(n){return e.apply(null,n)}}function lq(e){return pe.isObject(e)&&e.isAxiosError===!0}const Sx={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(Sx).forEach(([e,t])=>{Sx[t]=e});function aP(e){const t=new ni(e),n=Lz(ni.prototype.request,t);return pe.extend(n,ni.prototype,t,{allOwnKeys:!0}),pe.extend(n,t,null,{allOwnKeys:!0}),n.create=function(a){return aP(ri(e,a))},n}const $t=aP(fu);$t.Axios=ni;$t.CanceledError=Tl;$t.CancelToken=oq;$t.isCancel=Kz;$t.VERSION=nP;$t.toFormData=lf;$t.AxiosError=nt;$t.Cancel=$t.CanceledError;$t.all=function(t){return Promise.all(t)};$t.spread=iq;$t.isAxiosError=lq;$t.mergeConfig=ri;$t.AxiosHeaders=zn;$t.formToJSON=e=>Yz(pe.isHTMLForm(e)?new FormData(e):e);$t.getAdapter=tP.getAdapter;$t.HttpStatusCode=Sx;$t.default=$t;const{Axios:Fye,AxiosError:zye,CanceledError:Pye,isCancel:Bye,CancelToken:Uye,VERSION:jye,all:Gye,Cancel:Hye,isAxiosError:$ye,spread:qye,toFormData:Vye,AxiosHeaders:Wye,HttpStatusCode:Yye,formToJSON:Kye,getAdapter:Xye,mergeConfig:Zye}=$t,oP="Invalid API Key",iP="API Key required",Mr=$t.create({baseURL:Rz,headers:{"Content-Type":"application/json"}});Mr.interceptors.request.use(e=>{const t=Ke.getState().apiKey;return t&&(e.headers["X-API-Key"]=t),e});Mr.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 sq=async(e,t)=>(await Mr.get(`/graphs?label=${e}&max_depth=${t}`)).data,uq=async()=>(await Mr.get("/graph/label/list")).data,cq=async()=>{try{return(await Mr.get("/health")).data}catch(e){return{status:"error",message:Nr(e)}}},dq=async()=>(await Mr.get("/documents")).data,fq=async()=>(await Mr.post("/documents/scan")).data,pq=async e=>(await Mr.post("/query",e)).data,gq=async(e,t,n)=>{try{let r="";if(await Mr.post("/query/stream",e,{responseType:"text",headers:{Accept:"application/x-ndjson"},transformResponse:[a=>{r+=a;const i=r.split(` +`);r=i.pop()||"";for(const l of i)if(l.trim())try{const u=JSON.parse(l);u.response?t(u.response):u.error&&n&&n(u.error)}catch(u){console.error("Error parsing stream chunk:",u),n&&n("Error parsing server response")}return a}]}).catch(a=>{n&&n(Nr(a))}),r.trim())try{const a=JSON.parse(r);a.response?t(a.response):a.error&&n&&n(a.error)}catch(a){console.error("Error parsing final chunk:",a),n&&n("Error parsing server response")}}catch(r){const a=Nr(r);console.error("Stream request failed:",a),n&&n(a)}},hq=async(e,t)=>{const n=new FormData;return n.append("file",e),(await Mr.post("/documents/upload",n,{headers:{"Content-Type":"multipart/form-data"},onUploadProgress:t!==void 0?a=>{const i=Math.round(a.loaded*100/a.total);t(i)}:void 0})).data},mq=async()=>(await Mr.delete("/documents")).data,bq=wk()(e=>({health:!0,message:null,messageTitle:null,lastCheckTime:Date.now(),status:null,check:async()=>{const t=await cq();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})}})),Pn=Ak(bq);/** + * @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 yq=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),lP=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim();/** + * @license lucide-react v0.475.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */var vq={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 Sq=k.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:a="",children:i,iconNode:l,...u},c)=>k.createElement("svg",{ref:c,...vq,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:lP("lucide",a),...u},[...l.map(([f,p])=>k.createElement(f,p)),...Array.isArray(i)?i:[i]]));/** + * @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 xt=(e,t)=>{const n=k.forwardRef(({className:r,...a},i)=>k.createElement(Sq,{ref:i,iconNode:t,className:lP(`lucide-${yq(e)}`,r),...a}));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 Eq=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Ck=xt("Check",Eq);/** + * @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 wq=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],Nk=xt("ChevronDown",wq);/** + * @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 xq=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],sP=xt("ChevronUp",xq);/** + * @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 kq=[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]],Aq=xt("ChevronsUpDown",kq);/** + * @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 Tq=[["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"}]],_q=xt("CircleAlert",Tq);/** + * @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 Rq=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],Cq=xt("Copy",Rq);/** + * @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 Nq=[["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"}]],uP=xt("Eraser",Nq);/** + * @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 Oq=[["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"}]],Dq=xt("FileText",Oq);/** + * @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 Iq=[["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"}]],Lq=xt("Files",Iq);/** + * @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 Mq=[["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"}]],Fq=xt("Fullscreen",Mq);/** + * @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 zq=[["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"}]],Pq=xt("Github",zq);/** + * @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 Bq=[["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"}]],Uq=xt("Grip",Bq);/** + * @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 jq=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],cP=xt("LoaderCircle",jq);/** + * @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 Gq=[["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"}]],Hq=xt("Loader",Gq);/** + * @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 $q=[["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"}]],qq=xt("Maximize",$q);/** + * @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 Vq=[["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"}]],Wq=xt("Minimize",Vq);/** + * @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 Yq=[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]],Kq=xt("Moon",Yq);/** + * @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 Xq=[["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"}]],Zq=xt("Pause",Xq);/** + * @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 Qq=[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]],Jq=xt("Play",Qq);/** + * @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 e8=[["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"}]],t8=xt("RefreshCw",e8);/** + * @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 n8=[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]],r8=xt("Search",n8);/** + * @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 a8=[["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"}]],o8=xt("Send",a8);/** + * @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 i8=[["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"}]],l8=xt("Settings",i8);/** + * @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 s8=[["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"}]],u8=xt("Sun",s8);/** + * @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 c8=[["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"}]],Ex=xt("Upload",c8);/** + * @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 d8=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],dP=xt("X",d8);/** + * @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 f8=[["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"}]],p8=xt("Zap",f8);/** + * @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 g8=[["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"}]],h8=xt("ZoomIn",g8);/** + * @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 m8=[["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"}]],b8=xt("ZoomOut",m8),y8=()=>{const e=Pn.use.health(),t=Pn.use.message(),n=Pn.use.messageTitle(),[r,a]=k.useState(!1);return k.useEffect(()=>{setTimeout(()=>{a(!0)},50)},[]),w.jsxs(Oz,{className:Me("bg-background/90 absolute top-12 left-1/2 flex w-auto max-w-lg -translate-x-1/2 transform items-center gap-4 shadow-md backdrop-blur-lg transition-all duration-500 ease-in-out",r?"translate-y-0 opacity-100":"-translate-y-20 opacity-0",!e&&"bg-red-700 text-white"),children:[!e&&w.jsx("div",{children:w.jsx(_q,{className:"size-4"})}),w.jsxs("div",{children:[w.jsx(Dz,{className:"font-bold",children:n}),w.jsx(Iz,{children:t})]})]})};function v8(e,t){const n=k.createContext(t),r=i=>{const{children:l,...u}=i,c=k.useMemo(()=>u,Object.values(u));return w.jsx(n.Provider,{value:c,children:l})};r.displayName=e+"Provider";function a(i){const l=k.useContext(n);if(l)return l;if(t!==void 0)return t;throw new Error(`\`${i}\` must be used within \`${e}\``)}return[r,a]}function mr(e,t=[]){let n=[];function r(i,l){const u=k.createContext(l),c=n.length;n=[...n,l];const f=g=>{var R;const{scope:b,children:m,...S}=g,v=((R=b==null?void 0:b[e])==null?void 0:R[c])||u,A=k.useMemo(()=>S,Object.values(S));return w.jsx(v.Provider,{value:A,children:m})};f.displayName=i+"Provider";function p(g,b){var v;const m=((v=b==null?void 0:b[e])==null?void 0:v[c])||u,S=k.useContext(m);if(S)return S;if(l!==void 0)return l;throw new Error(`\`${g}\` must be used within \`${i}\``)}return[f,p]}const a=()=>{const i=n.map(l=>k.createContext(l));return function(u){const c=(u==null?void 0:u[e])||i;return k.useMemo(()=>({[`__scope${e}`]:{...u,[e]:c}}),[u,c])}};return a.scopeName=e,[r,S8(a,...t)]}function S8(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(a=>({useScope:a(),scopeName:a.scopeName}));return function(i){const l=r.reduce((u,{useScope:c,scopeName:f})=>{const g=c(i)[`__scope${f}`];return{...u,...g}},{});return k.useMemo(()=>({[`__scope${t.scopeName}`]:l}),[l])}};return n.scopeName=t.scopeName,n}function kR(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function fP(...e){return t=>{let n=!1;const r=e.map(a=>{const i=kR(a,t);return!n&&typeof i=="function"&&(n=!0),i});if(n)return()=>{for(let a=0;a{},E8=bH.useId||(()=>{}),w8=0;function En(e){const[t,n]=k.useState(E8());return wn(()=>{n(r=>r??String(w8++))},[e]),t?`radix-${t}`:""}function pn(e){const t=k.useRef(e);return k.useEffect(()=>{t.current=e}),k.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function Oa({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,a]=x8({defaultProp:t,onChange:n}),i=e!==void 0,l=i?e:r,u=pn(n),c=k.useCallback(f=>{if(i){const g=typeof f=="function"?f(e):f;g!==e&&u(g)}else a(f)},[i,e,a,u]);return[l,c]}function x8({defaultProp:e,onChange:t}){const n=k.useState(e),[r]=n,a=k.useRef(r),i=pn(t);return k.useEffect(()=>{a.current!==r&&(i(r),a.current=r)},[r,a,i]),n}var pu=mz();const pP=an(pu);var bo=k.forwardRef((e,t)=>{const{children:n,...r}=e,a=k.Children.toArray(n),i=a.find(k8);if(i){const l=i.props.children,u=a.map(c=>c===i?k.Children.count(l)>1?k.Children.only(null):k.isValidElement(l)?l.props.children:null:c);return w.jsx(wx,{...r,ref:t,children:k.isValidElement(l)?k.cloneElement(l,void 0,u):null})}return w.jsx(wx,{...r,ref:t,children:n})});bo.displayName="Slot";var wx=k.forwardRef((e,t)=>{const{children:n,...r}=e;if(k.isValidElement(n)){const a=T8(n),i=A8(r,n.props);return n.type!==k.Fragment&&(i.ref=t?fP(t,a):a),k.cloneElement(n,i)}return k.Children.count(n)>1?k.Children.only(null):null});wx.displayName="SlotClone";var Ok=({children:e})=>w.jsx(w.Fragment,{children:e});function k8(e){return k.isValidElement(e)&&e.type===Ok}function A8(e,t){const n={...t};for(const r in t){const a=e[r],i=t[r];/^on[A-Z]/.test(r)?a&&i?n[r]=(...u)=>{i(...u),a(...u)}:a&&(n[r]=a):r==="style"?n[r]={...a,...i}:r==="className"&&(n[r]=[a,i].filter(Boolean).join(" "))}return{...e,...n}}function T8(e){var r,a;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(a=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:a.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var _8=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],Xe=_8.reduce((e,t)=>{const n=k.forwardRef((r,a)=>{const{asChild:i,...l}=r,u=i?bo:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),w.jsx(u,{...l,ref:a})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function R8(e,t){e&&pu.flushSync(()=>e.dispatchEvent(t))}function C8(e,t=globalThis==null?void 0:globalThis.document){const n=pn(e);k.useEffect(()=>{const r=a=>{a.key==="Escape"&&n(a)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var N8="DismissableLayer",xx="dismissableLayer.update",O8="dismissableLayer.pointerDownOutside",D8="dismissableLayer.focusOutside",AR,gP=k.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),gu=k.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:a,onFocusOutside:i,onInteractOutside:l,onDismiss:u,...c}=e,f=k.useContext(gP),[p,g]=k.useState(null),b=(p==null?void 0:p.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,m]=k.useState({}),S=ft(t,O=>g(O)),v=Array.from(f.layers),[A]=[...f.layersWithOutsidePointerEventsDisabled].slice(-1),R=v.indexOf(A),x=p?v.indexOf(p):-1,_=f.layersWithOutsidePointerEventsDisabled.size>0,C=x>=R,N=M8(O=>{const z=O.target,I=[...f.branches].some(M=>M.contains(z));!C||I||(a==null||a(O),l==null||l(O),O.defaultPrevented||u==null||u())},b),T=F8(O=>{const z=O.target;[...f.branches].some(M=>M.contains(z))||(i==null||i(O),l==null||l(O),O.defaultPrevented||u==null||u())},b);return C8(O=>{x===f.layers.size-1&&(r==null||r(O),!O.defaultPrevented&&u&&(O.preventDefault(),u()))},b),k.useEffect(()=>{if(p)return n&&(f.layersWithOutsidePointerEventsDisabled.size===0&&(AR=b.body.style.pointerEvents,b.body.style.pointerEvents="none"),f.layersWithOutsidePointerEventsDisabled.add(p)),f.layers.add(p),TR(),()=>{n&&f.layersWithOutsidePointerEventsDisabled.size===1&&(b.body.style.pointerEvents=AR)}},[p,b,n,f]),k.useEffect(()=>()=>{p&&(f.layers.delete(p),f.layersWithOutsidePointerEventsDisabled.delete(p),TR())},[p,f]),k.useEffect(()=>{const O=()=>m({});return document.addEventListener(xx,O),()=>document.removeEventListener(xx,O)},[]),w.jsx(Xe.div,{...c,ref:S,style:{pointerEvents:_?C?"auto":"none":void 0,...e.style},onFocusCapture:We(e.onFocusCapture,T.onFocusCapture),onBlurCapture:We(e.onBlurCapture,T.onBlurCapture),onPointerDownCapture:We(e.onPointerDownCapture,N.onPointerDownCapture)})});gu.displayName=N8;var I8="DismissableLayerBranch",L8=k.forwardRef((e,t)=>{const n=k.useContext(gP),r=k.useRef(null),a=ft(t,r);return k.useEffect(()=>{const i=r.current;if(i)return n.branches.add(i),()=>{n.branches.delete(i)}},[n.branches]),w.jsx(Xe.div,{...e,ref:a})});L8.displayName=I8;function M8(e,t=globalThis==null?void 0:globalThis.document){const n=pn(e),r=k.useRef(!1),a=k.useRef(()=>{});return k.useEffect(()=>{const i=u=>{if(u.target&&!r.current){let c=function(){hP(O8,n,f,{discrete:!0})};const f={originalEvent:u};u.pointerType==="touch"?(t.removeEventListener("click",a.current),a.current=c,t.addEventListener("click",a.current,{once:!0})):c()}else t.removeEventListener("click",a.current);r.current=!1},l=window.setTimeout(()=>{t.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(l),t.removeEventListener("pointerdown",i),t.removeEventListener("click",a.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function F8(e,t=globalThis==null?void 0:globalThis.document){const n=pn(e),r=k.useRef(!1);return k.useEffect(()=>{const a=i=>{i.target&&!r.current&&hP(D8,n,{originalEvent:i},{discrete:!1})};return t.addEventListener("focusin",a),()=>t.removeEventListener("focusin",a)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function TR(){const e=new CustomEvent(xx);document.dispatchEvent(e)}function hP(e,t,n,{discrete:r}){const a=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&a.addEventListener(e,t,{once:!0}),r?R8(a,i):a.dispatchEvent(i)}var ph="focusScope.autoFocusOnMount",gh="focusScope.autoFocusOnUnmount",_R={bubbles:!1,cancelable:!0},z8="FocusScope",cf=k.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:a,onUnmountAutoFocus:i,...l}=e,[u,c]=k.useState(null),f=pn(a),p=pn(i),g=k.useRef(null),b=ft(t,v=>c(v)),m=k.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;k.useEffect(()=>{if(r){let v=function(_){if(m.paused||!u)return;const C=_.target;u.contains(C)?g.current=C:co(g.current,{select:!0})},A=function(_){if(m.paused||!u)return;const C=_.relatedTarget;C!==null&&(u.contains(C)||co(g.current,{select:!0}))},R=function(_){if(document.activeElement===document.body)for(const N of _)N.removedNodes.length>0&&co(u)};document.addEventListener("focusin",v),document.addEventListener("focusout",A);const x=new MutationObserver(R);return u&&x.observe(u,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",v),document.removeEventListener("focusout",A),x.disconnect()}}},[r,u,m.paused]),k.useEffect(()=>{if(u){CR.add(m);const v=document.activeElement;if(!u.contains(v)){const R=new CustomEvent(ph,_R);u.addEventListener(ph,f),u.dispatchEvent(R),R.defaultPrevented||(P8(H8(mP(u)),{select:!0}),document.activeElement===v&&co(u))}return()=>{u.removeEventListener(ph,f),setTimeout(()=>{const R=new CustomEvent(gh,_R);u.addEventListener(gh,p),u.dispatchEvent(R),R.defaultPrevented||co(v??document.body,{select:!0}),u.removeEventListener(gh,p),CR.remove(m)},0)}}},[u,f,p,m]);const S=k.useCallback(v=>{if(!n&&!r||m.paused)return;const A=v.key==="Tab"&&!v.altKey&&!v.ctrlKey&&!v.metaKey,R=document.activeElement;if(A&&R){const x=v.currentTarget,[_,C]=B8(x);_&&C?!v.shiftKey&&R===C?(v.preventDefault(),n&&co(_,{select:!0})):v.shiftKey&&R===_&&(v.preventDefault(),n&&co(C,{select:!0})):R===x&&v.preventDefault()}},[n,r,m.paused]);return w.jsx(Xe.div,{tabIndex:-1,...l,ref:b,onKeyDown:S})});cf.displayName=z8;function P8(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(co(r,{select:t}),document.activeElement!==n)return}function B8(e){const t=mP(e),n=RR(t,e),r=RR(t.reverse(),e);return[n,r]}function mP(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const a=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||a?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function RR(e,t){for(const n of e)if(!U8(n,{upTo:t}))return n}function U8(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 j8(e){return e instanceof HTMLInputElement&&"select"in e}function co(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&j8(e)&&t&&e.select()}}var CR=G8();function G8(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=NR(e,t),e.unshift(t)},remove(t){var n;e=NR(e,t),(n=e[0])==null||n.resume()}}}function NR(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function H8(e){return e.filter(t=>t.tagName!=="A")}var $8="Portal",df=k.forwardRef((e,t)=>{var u;const{container:n,...r}=e,[a,i]=k.useState(!1);wn(()=>i(!0),[]);const l=n||a&&((u=globalThis==null?void 0:globalThis.document)==null?void 0:u.body);return l?pP.createPortal(w.jsx(Xe.div,{...r,ref:t}),l):null});df.displayName=$8;function q8(e,t){return k.useReducer((n,r)=>t[n][r]??n,e)}var Jn=e=>{const{present:t,children:n}=e,r=V8(t),a=typeof n=="function"?n({present:r.isPresent}):k.Children.only(n),i=ft(r.ref,W8(a));return typeof n=="function"||r.isPresent?k.cloneElement(a,{ref:i}):null};Jn.displayName="Presence";function V8(e){const[t,n]=k.useState(),r=k.useRef({}),a=k.useRef(e),i=k.useRef("none"),l=e?"mounted":"unmounted",[u,c]=q8(l,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return k.useEffect(()=>{const f=zc(r.current);i.current=u==="mounted"?f:"none"},[u]),wn(()=>{const f=r.current,p=a.current;if(p!==e){const b=i.current,m=zc(f);e?c("MOUNT"):m==="none"||(f==null?void 0:f.display)==="none"?c("UNMOUNT"):c(p&&b!==m?"ANIMATION_OUT":"UNMOUNT"),a.current=e}},[e,c]),wn(()=>{if(t){let f;const p=t.ownerDocument.defaultView??window,g=m=>{const v=zc(r.current).includes(m.animationName);if(m.target===t&&v&&(c("ANIMATION_END"),!a.current)){const A=t.style.animationFillMode;t.style.animationFillMode="forwards",f=p.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=A)})}},b=m=>{m.target===t&&(i.current=zc(r.current))};return t.addEventListener("animationstart",b),t.addEventListener("animationcancel",g),t.addEventListener("animationend",g),()=>{p.clearTimeout(f),t.removeEventListener("animationstart",b),t.removeEventListener("animationcancel",g),t.removeEventListener("animationend",g)}}else c("ANIMATION_END")},[t,c]),{isPresent:["mounted","unmountSuspended"].includes(u),ref:k.useCallback(f=>{f&&(r.current=getComputedStyle(f)),n(f)},[])}}function zc(e){return(e==null?void 0:e.animationName)||"none"}function W8(e){var r,a;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(a=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:a.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var hh=0;function Dk(){k.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??OR()),document.body.insertAdjacentElement("beforeend",e[1]??OR()),hh++,()=>{hh===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),hh--}},[])}function OR(){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 Vr=function(){return Vr=Object.assign||function(t){for(var n,r=1,a=arguments.length;r"u")return c7;var t=d7(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},p7=SP(),ul="data-scroll-locked",g7=function(e,t,n,r){var a=e.left,i=e.top,l=e.right,u=e.gap;return n===void 0&&(n="margin"),` + .`.concat(K8,` { + overflow: hidden `).concat(r,`; + padding-right: `).concat(u,"px ").concat(r,`; + } + body[`).concat(ul,`] { + overflow: hidden `).concat(r,`; + overscroll-behavior: contain; + `).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&` + padding-left: `.concat(a,`px; + padding-top: `).concat(i,`px; + padding-right: `).concat(l,`px; + margin-left:0; + margin-top:0; + margin-right: `).concat(u,"px ").concat(r,`; + `),n==="padding"&&"padding-right: ".concat(u,"px ").concat(r,";")].filter(Boolean).join(""),` + } + + .`).concat(hd,` { + right: `).concat(u,"px ").concat(r,`; + } + + .`).concat(md,` { + margin-right: `).concat(u,"px ").concat(r,`; + } + + .`).concat(hd," .").concat(hd,` { + right: 0 `).concat(r,`; + } + + .`).concat(md," .").concat(md,` { + margin-right: 0 `).concat(r,`; + } + + body[`).concat(ul,`] { + `).concat(X8,": ").concat(u,`px; + } +`)},IR=function(){var e=parseInt(document.body.getAttribute(ul)||"0",10);return isFinite(e)?e:0},h7=function(){k.useEffect(function(){return document.body.setAttribute(ul,(IR()+1).toString()),function(){var e=IR()-1;e<=0?document.body.removeAttribute(ul):document.body.setAttribute(ul,e.toString())}},[])},m7=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,a=r===void 0?"margin":r;h7();var i=k.useMemo(function(){return f7(a)},[a]);return k.createElement(p7,{styles:g7(i,!t,a,n?"":"!important")})},kx=!1;if(typeof window<"u")try{var Pc=Object.defineProperty({},"passive",{get:function(){return kx=!0,!0}});window.addEventListener("test",Pc,Pc),window.removeEventListener("test",Pc,Pc)}catch{kx=!1}var Ki=kx?{passive:!1}:!1,b7=function(e){return e.tagName==="TEXTAREA"},EP=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!b7(e)&&n[t]==="visible")},y7=function(e){return EP(e,"overflowY")},v7=function(e){return EP(e,"overflowX")},LR=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var a=wP(e,r);if(a){var i=xP(e,r),l=i[1],u=i[2];if(l>u)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},S7=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},E7=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},wP=function(e,t){return e==="v"?y7(t):v7(t)},xP=function(e,t){return e==="v"?S7(t):E7(t)},w7=function(e,t){return e==="h"&&t==="rtl"?-1:1},x7=function(e,t,n,r,a){var i=w7(e,window.getComputedStyle(t).direction),l=i*r,u=n.target,c=t.contains(u),f=!1,p=l>0,g=0,b=0;do{var m=xP(e,u),S=m[0],v=m[1],A=m[2],R=v-A-i*S;(S||R)&&wP(e,u)&&(g+=R,b+=S),u instanceof ShadowRoot?u=u.host:u=u.parentNode}while(!c&&u!==document.body||c&&(t.contains(u)||t===u));return(p&&Math.abs(g)<1||!p&&Math.abs(b)<1)&&(f=!0),f},Bc=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},MR=function(e){return[e.deltaX,e.deltaY]},FR=function(e){return e&&"current"in e?e.current:e},k7=function(e,t){return e[0]===t[0]&&e[1]===t[1]},A7=function(e){return` + .block-interactivity-`.concat(e,` {pointer-events: none;} + .allow-interactivity-`).concat(e,` {pointer-events: all;} +`)},T7=0,Xi=[];function _7(e){var t=k.useRef([]),n=k.useRef([0,0]),r=k.useRef(),a=k.useState(T7++)[0],i=k.useState(SP)[0],l=k.useRef(e);k.useEffect(function(){l.current=e},[e]),k.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(a));var v=Y8([e.lockRef.current],(e.shards||[]).map(FR),!0).filter(Boolean);return v.forEach(function(A){return A.classList.add("allow-interactivity-".concat(a))}),function(){document.body.classList.remove("block-interactivity-".concat(a)),v.forEach(function(A){return A.classList.remove("allow-interactivity-".concat(a))})}}},[e.inert,e.lockRef.current,e.shards]);var u=k.useCallback(function(v,A){if("touches"in v&&v.touches.length===2||v.type==="wheel"&&v.ctrlKey)return!l.current.allowPinchZoom;var R=Bc(v),x=n.current,_="deltaX"in v?v.deltaX:x[0]-R[0],C="deltaY"in v?v.deltaY:x[1]-R[1],N,T=v.target,O=Math.abs(_)>Math.abs(C)?"h":"v";if("touches"in v&&O==="h"&&T.type==="range")return!1;var z=LR(O,T);if(!z)return!0;if(z?N=O:(N=O==="v"?"h":"v",z=LR(O,T)),!z)return!1;if(!r.current&&"changedTouches"in v&&(_||C)&&(r.current=N),!N)return!0;var I=r.current||N;return x7(I,A,v,I==="h"?_:C)},[]),c=k.useCallback(function(v){var A=v;if(!(!Xi.length||Xi[Xi.length-1]!==i)){var R="deltaY"in A?MR(A):Bc(A),x=t.current.filter(function(N){return N.name===A.type&&(N.target===A.target||A.target===N.shadowParent)&&k7(N.delta,R)})[0];if(x&&x.should){A.cancelable&&A.preventDefault();return}if(!x){var _=(l.current.shards||[]).map(FR).filter(Boolean).filter(function(N){return N.contains(A.target)}),C=_.length>0?u(A,_[0]):!l.current.noIsolation;C&&A.cancelable&&A.preventDefault()}}},[]),f=k.useCallback(function(v,A,R,x){var _={name:v,delta:A,target:R,should:x,shadowParent:R7(R)};t.current.push(_),setTimeout(function(){t.current=t.current.filter(function(C){return C!==_})},1)},[]),p=k.useCallback(function(v){n.current=Bc(v),r.current=void 0},[]),g=k.useCallback(function(v){f(v.type,MR(v),v.target,u(v,e.lockRef.current))},[]),b=k.useCallback(function(v){f(v.type,Bc(v),v.target,u(v,e.lockRef.current))},[]);k.useEffect(function(){return Xi.push(i),e.setCallbacks({onScrollCapture:g,onWheelCapture:g,onTouchMoveCapture:b}),document.addEventListener("wheel",c,Ki),document.addEventListener("touchmove",c,Ki),document.addEventListener("touchstart",p,Ki),function(){Xi=Xi.filter(function(v){return v!==i}),document.removeEventListener("wheel",c,Ki),document.removeEventListener("touchmove",c,Ki),document.removeEventListener("touchstart",p,Ki)}},[]);var m=e.removeScrollBar,S=e.inert;return k.createElement(k.Fragment,null,S?k.createElement(i,{styles:A7(a)}):null,m?k.createElement(m7,{gapMode:e.gapMode}):null)}function R7(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const C7=r7(vP,_7);var pf=k.forwardRef(function(e,t){return k.createElement(ff,Vr({},e,{ref:t,sideCar:C7}))});pf.classNames=ff.classNames;var N7=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Zi=new WeakMap,Uc=new WeakMap,jc={},vh=0,kP=function(e){return e&&(e.host||kP(e.parentNode))},O7=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=kP(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},D7=function(e,t,n,r){var a=O7(t,Array.isArray(e)?e:[e]);jc[n]||(jc[n]=new WeakMap);var i=jc[n],l=[],u=new Set,c=new Set(a),f=function(g){!g||u.has(g)||(u.add(g),f(g.parentNode))};a.forEach(f);var p=function(g){!g||c.has(g)||Array.prototype.forEach.call(g.children,function(b){if(u.has(b))p(b);else try{var m=b.getAttribute(r),S=m!==null&&m!=="false",v=(Zi.get(b)||0)+1,A=(i.get(b)||0)+1;Zi.set(b,v),i.set(b,A),l.push(b),v===1&&S&&Uc.set(b,!0),A===1&&b.setAttribute(n,"true"),S||b.setAttribute(r,"true")}catch(R){console.error("aria-hidden: cannot operate on ",b,R)}})};return p(t),u.clear(),vh++,function(){l.forEach(function(g){var b=Zi.get(g)-1,m=i.get(g)-1;Zi.set(g,b),i.set(g,m),b||(Uc.has(g)||g.removeAttribute(r),Uc.delete(g)),m||g.removeAttribute(n)}),vh--,vh||(Zi=new WeakMap,Zi=new WeakMap,Uc=new WeakMap,jc={})}},Ik=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),a=N7(e);return a?(r.push.apply(r,Array.from(a.querySelectorAll("[aria-live]"))),D7(r,a,n,"aria-hidden")):function(){return null}},Lk="Dialog",[AP,TP]=mr(Lk),[I7,Fr]=AP(Lk),_P=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:a,onOpenChange:i,modal:l=!0}=e,u=k.useRef(null),c=k.useRef(null),[f=!1,p]=Oa({prop:r,defaultProp:a,onChange:i});return w.jsx(I7,{scope:t,triggerRef:u,contentRef:c,contentId:En(),titleId:En(),descriptionId:En(),open:f,onOpenChange:p,onOpenToggle:k.useCallback(()=>p(g=>!g),[p]),modal:l,children:n})};_P.displayName=Lk;var RP="DialogTrigger",CP=k.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,a=Fr(RP,n),i=ft(t,a.triggerRef);return w.jsx(Xe.button,{type:"button","aria-haspopup":"dialog","aria-expanded":a.open,"aria-controls":a.contentId,"data-state":zk(a.open),...r,ref:i,onClick:We(e.onClick,a.onOpenToggle)})});CP.displayName=RP;var Mk="DialogPortal",[L7,NP]=AP(Mk,{forceMount:void 0}),OP=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:a}=e,i=Fr(Mk,t);return w.jsx(L7,{scope:t,forceMount:n,children:k.Children.map(r,l=>w.jsx(Jn,{present:n||i.open,children:w.jsx(df,{asChild:!0,container:a,children:l})}))})};OP.displayName=Mk;var Dd="DialogOverlay",DP=k.forwardRef((e,t)=>{const n=NP(Dd,e.__scopeDialog),{forceMount:r=n.forceMount,...a}=e,i=Fr(Dd,e.__scopeDialog);return i.modal?w.jsx(Jn,{present:r||i.open,children:w.jsx(M7,{...a,ref:t})}):null});DP.displayName=Dd;var M7=k.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,a=Fr(Dd,n);return w.jsx(pf,{as:bo,allowPinchZoom:!0,shards:[a.contentRef],children:w.jsx(Xe.div,{"data-state":zk(a.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),ai="DialogContent",IP=k.forwardRef((e,t)=>{const n=NP(ai,e.__scopeDialog),{forceMount:r=n.forceMount,...a}=e,i=Fr(ai,e.__scopeDialog);return w.jsx(Jn,{present:r||i.open,children:i.modal?w.jsx(F7,{...a,ref:t}):w.jsx(z7,{...a,ref:t})})});IP.displayName=ai;var F7=k.forwardRef((e,t)=>{const n=Fr(ai,e.__scopeDialog),r=k.useRef(null),a=ft(t,n.contentRef,r);return k.useEffect(()=>{const i=r.current;if(i)return Ik(i)},[]),w.jsx(LP,{...e,ref:a,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:We(e.onCloseAutoFocus,i=>{var l;i.preventDefault(),(l=n.triggerRef.current)==null||l.focus()}),onPointerDownOutside:We(e.onPointerDownOutside,i=>{const l=i.detail.originalEvent,u=l.button===0&&l.ctrlKey===!0;(l.button===2||u)&&i.preventDefault()}),onFocusOutside:We(e.onFocusOutside,i=>i.preventDefault())})}),z7=k.forwardRef((e,t)=>{const n=Fr(ai,e.__scopeDialog),r=k.useRef(!1),a=k.useRef(!1);return w.jsx(LP,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var l,u;(l=e.onCloseAutoFocus)==null||l.call(e,i),i.defaultPrevented||(r.current||(u=n.triggerRef.current)==null||u.focus(),i.preventDefault()),r.current=!1,a.current=!1},onInteractOutside:i=>{var c,f;(c=e.onInteractOutside)==null||c.call(e,i),i.defaultPrevented||(r.current=!0,i.detail.originalEvent.type==="pointerdown"&&(a.current=!0));const l=i.target;((f=n.triggerRef.current)==null?void 0:f.contains(l))&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&a.current&&i.preventDefault()}})}),LP=k.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:a,onCloseAutoFocus:i,...l}=e,u=Fr(ai,n),c=k.useRef(null),f=ft(t,c);return Dk(),w.jsxs(w.Fragment,{children:[w.jsx(cf,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:a,onUnmountAutoFocus:i,children:w.jsx(gu,{role:"dialog",id:u.contentId,"aria-describedby":u.descriptionId,"aria-labelledby":u.titleId,"data-state":zk(u.open),...l,ref:f,onDismiss:()=>u.onOpenChange(!1)})}),w.jsxs(w.Fragment,{children:[w.jsx(B7,{titleId:u.titleId}),w.jsx(j7,{contentRef:c,descriptionId:u.descriptionId})]})]})}),Fk="DialogTitle",MP=k.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,a=Fr(Fk,n);return w.jsx(Xe.h2,{id:a.titleId,...r,ref:t})});MP.displayName=Fk;var FP="DialogDescription",zP=k.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,a=Fr(FP,n);return w.jsx(Xe.p,{id:a.descriptionId,...r,ref:t})});zP.displayName=FP;var PP="DialogClose",BP=k.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,a=Fr(PP,n);return w.jsx(Xe.button,{type:"button",...r,ref:t,onClick:We(e.onClick,()=>a.onOpenChange(!1))})});BP.displayName=PP;function zk(e){return e?"open":"closed"}var UP="DialogTitleWarning",[P7,jP]=v8(UP,{contentName:ai,titleName:Fk,docsSlug:"dialog"}),B7=({titleId:e})=>{const t=jP(UP),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 k.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},U7="DialogDescriptionWarning",j7=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${jP(U7).contentName}}.`;return k.useEffect(()=>{var i;const a=(i=e.current)==null?void 0:i.getAttribute("aria-describedby");t&&a&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},Pk=_P,GP=CP,Bk=OP,gf=DP,hf=IP,Uk=MP,jk=zP,Gk=BP,HP="AlertDialog",[G7,Qye]=mr(HP,[TP]),La=TP(),$P=e=>{const{__scopeAlertDialog:t,...n}=e,r=La(t);return w.jsx(Pk,{...r,...n,modal:!0})};$P.displayName=HP;var H7="AlertDialogTrigger",$7=k.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,a=La(n);return w.jsx(GP,{...a,...r,ref:t})});$7.displayName=H7;var q7="AlertDialogPortal",qP=e=>{const{__scopeAlertDialog:t,...n}=e,r=La(t);return w.jsx(Bk,{...r,...n})};qP.displayName=q7;var V7="AlertDialogOverlay",VP=k.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,a=La(n);return w.jsx(gf,{...a,...r,ref:t})});VP.displayName=V7;var cl="AlertDialogContent",[W7,Y7]=G7(cl),WP=k.forwardRef((e,t)=>{const{__scopeAlertDialog:n,children:r,...a}=e,i=La(n),l=k.useRef(null),u=ft(t,l),c=k.useRef(null);return w.jsx(P7,{contentName:cl,titleName:YP,docsSlug:"alert-dialog",children:w.jsx(W7,{scope:n,cancelRef:c,children:w.jsxs(hf,{role:"alertdialog",...i,...a,ref:u,onOpenAutoFocus:We(a.onOpenAutoFocus,f=>{var p;f.preventDefault(),(p=c.current)==null||p.focus({preventScroll:!0})}),onPointerDownOutside:f=>f.preventDefault(),onInteractOutside:f=>f.preventDefault(),children:[w.jsx(Ok,{children:r}),w.jsx(X7,{contentRef:l})]})})})});WP.displayName=cl;var YP="AlertDialogTitle",KP=k.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,a=La(n);return w.jsx(Uk,{...a,...r,ref:t})});KP.displayName=YP;var XP="AlertDialogDescription",ZP=k.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,a=La(n);return w.jsx(jk,{...a,...r,ref:t})});ZP.displayName=XP;var K7="AlertDialogAction",QP=k.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,a=La(n);return w.jsx(Gk,{...a,...r,ref:t})});QP.displayName=K7;var JP="AlertDialogCancel",eB=k.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,{cancelRef:a}=Y7(JP,n),i=La(n),l=ft(t,a);return w.jsx(Gk,{...i,...r,ref:l})});eB.displayName=JP;var X7=({contentRef:e})=>{const t=`\`${cl}\` requires a description for the component to be accessible for screen reader users. + +You can add a description to the \`${cl}\` by passing a \`${XP}\` 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 \`${cl}\`. 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 k.useEffect(()=>{var r;document.getElementById((r=e.current)==null?void 0:r.getAttribute("aria-describedby"))||console.warn(t)},[t,e]),null},Z7=$P,Q7=qP,tB=VP,nB=WP,rB=QP,aB=eB,oB=KP,iB=ZP;const J7=["top","right","bottom","left"],yo=Math.min,Kn=Math.max,Id=Math.round,Gc=Math.floor,Kr=e=>({x:e,y:e}),eV={left:"right",right:"left",bottom:"top",top:"bottom"},tV={start:"end",end:"start"};function Ax(e,t,n){return Kn(e,yo(t,n))}function Da(e,t){return typeof e=="function"?e(t):e}function Ia(e){return e.split("-")[0]}function _l(e){return e.split("-")[1]}function Hk(e){return e==="x"?"y":"x"}function $k(e){return e==="y"?"height":"width"}function vo(e){return["top","bottom"].includes(Ia(e))?"y":"x"}function qk(e){return Hk(vo(e))}function nV(e,t,n){n===void 0&&(n=!1);const r=_l(e),a=qk(e),i=$k(a);let l=a==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(l=Ld(l)),[l,Ld(l)]}function rV(e){const t=Ld(e);return[Tx(e),t,Tx(t)]}function Tx(e){return e.replace(/start|end/g,t=>tV[t])}function aV(e,t,n){const r=["left","right"],a=["right","left"],i=["top","bottom"],l=["bottom","top"];switch(e){case"top":case"bottom":return n?t?a:r:t?r:a;case"left":case"right":return t?i:l;default:return[]}}function oV(e,t,n,r){const a=_l(e);let i=aV(Ia(e),n==="start",r);return a&&(i=i.map(l=>l+"-"+a),t&&(i=i.concat(i.map(Tx)))),i}function Ld(e){return e.replace(/left|right|bottom|top/g,t=>eV[t])}function iV(e){return{top:0,right:0,bottom:0,left:0,...e}}function lB(e){return typeof e!="number"?iV(e):{top:e,right:e,bottom:e,left:e}}function Md(e){const{x:t,y:n,width:r,height:a}=e;return{width:r,height:a,top:n,left:t,right:t+r,bottom:n+a,x:t,y:n}}function zR(e,t,n){let{reference:r,floating:a}=e;const i=vo(t),l=qk(t),u=$k(l),c=Ia(t),f=i==="y",p=r.x+r.width/2-a.width/2,g=r.y+r.height/2-a.height/2,b=r[u]/2-a[u]/2;let m;switch(c){case"top":m={x:p,y:r.y-a.height};break;case"bottom":m={x:p,y:r.y+r.height};break;case"right":m={x:r.x+r.width,y:g};break;case"left":m={x:r.x-a.width,y:g};break;default:m={x:r.x,y:r.y}}switch(_l(t)){case"start":m[l]-=b*(n&&f?-1:1);break;case"end":m[l]+=b*(n&&f?-1:1);break}return m}const lV=async(e,t,n)=>{const{placement:r="bottom",strategy:a="absolute",middleware:i=[],platform:l}=n,u=i.filter(Boolean),c=await(l.isRTL==null?void 0:l.isRTL(t));let f=await l.getElementRects({reference:e,floating:t,strategy:a}),{x:p,y:g}=zR(f,r,c),b=r,m={},S=0;for(let v=0;v({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:a,rects:i,platform:l,elements:u,middlewareData:c}=t,{element:f,padding:p=0}=Da(e,t)||{};if(f==null)return{};const g=lB(p),b={x:n,y:r},m=qk(a),S=$k(m),v=await l.getDimensions(f),A=m==="y",R=A?"top":"left",x=A?"bottom":"right",_=A?"clientHeight":"clientWidth",C=i.reference[S]+i.reference[m]-b[m]-i.floating[S],N=b[m]-i.reference[m],T=await(l.getOffsetParent==null?void 0:l.getOffsetParent(f));let O=T?T[_]:0;(!O||!await(l.isElement==null?void 0:l.isElement(T)))&&(O=u.floating[_]||i.floating[S]);const z=C/2-N/2,I=O/2-v[S]/2-1,M=yo(g[R],I),H=yo(g[x],I),q=M,U=O-v[S]-H,W=O/2-v[S]/2+z,Z=Ax(q,W,U),j=!c.arrow&&_l(a)!=null&&W!==Z&&i.reference[S]/2-(WW<=0)){var H,q;const W=(((H=i.flip)==null?void 0:H.index)||0)+1,Z=O[W];if(Z)return{data:{index:W,overflows:M},reset:{placement:Z}};let j=(q=M.filter(G=>G.overflows[0]<=0).sort((G,P)=>G.overflows[1]-P.overflows[1])[0])==null?void 0:q.placement;if(!j)switch(m){case"bestFit":{var U;const G=(U=M.filter(P=>{if(T){const X=vo(P.placement);return X===x||X==="y"}return!0}).map(P=>[P.placement,P.overflows.filter(X=>X>0).reduce((X,D)=>X+D,0)]).sort((P,X)=>P[1]-X[1])[0])==null?void 0:U[0];G&&(j=G);break}case"initialPlacement":j=u;break}if(a!==j)return{reset:{placement:j}}}return{}}}};function PR(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function BR(e){return J7.some(t=>e[t]>=0)}const cV=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...a}=Da(e,t);switch(r){case"referenceHidden":{const i=await Js(t,{...a,elementContext:"reference"}),l=PR(i,n.reference);return{data:{referenceHiddenOffsets:l,referenceHidden:BR(l)}}}case"escaped":{const i=await Js(t,{...a,altBoundary:!0}),l=PR(i,n.floating);return{data:{escapedOffsets:l,escaped:BR(l)}}}default:return{}}}}};async function dV(e,t){const{placement:n,platform:r,elements:a}=e,i=await(r.isRTL==null?void 0:r.isRTL(a.floating)),l=Ia(n),u=_l(n),c=vo(n)==="y",f=["left","top"].includes(l)?-1:1,p=i&&c?-1:1,g=Da(t,e);let{mainAxis:b,crossAxis:m,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"&&(m=u==="end"?S*-1:S),c?{x:m*p,y:b*f}:{x:b*f,y:m*p}}const fV=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:a,y:i,placement:l,middlewareData:u}=t,c=await dV(t,e);return l===((n=u.offset)==null?void 0:n.placement)&&(r=u.arrow)!=null&&r.alignmentOffset?{}:{x:a+c.x,y:i+c.y,data:{...c,placement:l}}}}},pV=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:a}=t,{mainAxis:i=!0,crossAxis:l=!1,limiter:u={fn:A=>{let{x:R,y:x}=A;return{x:R,y:x}}},...c}=Da(e,t),f={x:n,y:r},p=await Js(t,c),g=vo(Ia(a)),b=Hk(g);let m=f[b],S=f[g];if(i){const A=b==="y"?"top":"left",R=b==="y"?"bottom":"right",x=m+p[A],_=m-p[R];m=Ax(x,m,_)}if(l){const A=g==="y"?"top":"left",R=g==="y"?"bottom":"right",x=S+p[A],_=S-p[R];S=Ax(x,S,_)}const v=u.fn({...t,[b]:m,[g]:S});return{...v,data:{x:v.x-n,y:v.y-r,enabled:{[b]:i,[g]:l}}}}}},gV=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:a,rects:i,middlewareData:l}=t,{offset:u=0,mainAxis:c=!0,crossAxis:f=!0}=Da(e,t),p={x:n,y:r},g=vo(a),b=Hk(g);let m=p[b],S=p[g];const v=Da(u,t),A=typeof v=="number"?{mainAxis:v,crossAxis:0}:{mainAxis:0,crossAxis:0,...v};if(c){const _=b==="y"?"height":"width",C=i.reference[b]-i.floating[_]+A.mainAxis,N=i.reference[b]+i.reference[_]-A.mainAxis;mN&&(m=N)}if(f){var R,x;const _=b==="y"?"width":"height",C=["top","left"].includes(Ia(a)),N=i.reference[g]-i.floating[_]+(C&&((R=l.offset)==null?void 0:R[g])||0)+(C?0:A.crossAxis),T=i.reference[g]+i.reference[_]+(C?0:((x=l.offset)==null?void 0:x[g])||0)-(C?A.crossAxis:0);ST&&(S=T)}return{[b]:m,[g]:S}}}},hV=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:a,rects:i,platform:l,elements:u}=t,{apply:c=()=>{},...f}=Da(e,t),p=await Js(t,f),g=Ia(a),b=_l(a),m=vo(a)==="y",{width:S,height:v}=i.floating;let A,R;g==="top"||g==="bottom"?(A=g,R=b===(await(l.isRTL==null?void 0:l.isRTL(u.floating))?"start":"end")?"left":"right"):(R=g,A=b==="end"?"top":"bottom");const x=v-p.top-p.bottom,_=S-p.left-p.right,C=yo(v-p[A],x),N=yo(S-p[R],_),T=!t.middlewareData.shift;let O=C,z=N;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(z=_),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(O=x),T&&!b){const M=Kn(p.left,0),H=Kn(p.right,0),q=Kn(p.top,0),U=Kn(p.bottom,0);m?z=S-2*(M!==0||H!==0?M+H:Kn(p.left,p.right)):O=v-2*(q!==0||U!==0?q+U:Kn(p.top,p.bottom))}await c({...t,availableWidth:z,availableHeight:O});const I=await l.getDimensions(u.floating);return S!==I.width||v!==I.height?{reset:{rects:!0}}:{}}}};function mf(){return typeof window<"u"}function Rl(e){return sB(e)?(e.nodeName||"").toLowerCase():"#document"}function Zn(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Zr(e){var t;return(t=(sB(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function sB(e){return mf()?e instanceof Node||e instanceof Zn(e).Node:!1}function Dr(e){return mf()?e instanceof Element||e instanceof Zn(e).Element:!1}function Xr(e){return mf()?e instanceof HTMLElement||e instanceof Zn(e).HTMLElement:!1}function UR(e){return!mf()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Zn(e).ShadowRoot}function hu(e){const{overflow:t,overflowX:n,overflowY:r,display:a}=Ir(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(a)}function mV(e){return["table","td","th"].includes(Rl(e))}function bf(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function Vk(e){const t=Wk(),n=Dr(e)?Ir(e):e;return["transform","translate","scale","rotate","perspective"].some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||["transform","translate","scale","rotate","perspective","filter"].some(r=>(n.willChange||"").includes(r))||["paint","layout","strict","content"].some(r=>(n.contain||"").includes(r))}function bV(e){let t=So(e);for(;Xr(t)&&!hl(t);){if(Vk(t))return t;if(bf(t))return null;t=So(t)}return null}function Wk(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function hl(e){return["html","body","#document"].includes(Rl(e))}function Ir(e){return Zn(e).getComputedStyle(e)}function yf(e){return Dr(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function So(e){if(Rl(e)==="html")return e;const t=e.assignedSlot||e.parentNode||UR(e)&&e.host||Zr(e);return UR(t)?t.host:t}function uB(e){const t=So(e);return hl(t)?e.ownerDocument?e.ownerDocument.body:e.body:Xr(t)&&hu(t)?t:uB(t)}function eu(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const a=uB(e),i=a===((r=e.ownerDocument)==null?void 0:r.body),l=Zn(a);if(i){const u=_x(l);return t.concat(l,l.visualViewport||[],hu(a)?a:[],u&&n?eu(u):[])}return t.concat(a,eu(a,[],n))}function _x(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function cB(e){const t=Ir(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const a=Xr(e),i=a?e.offsetWidth:n,l=a?e.offsetHeight:r,u=Id(n)!==i||Id(r)!==l;return u&&(n=i,r=l),{width:n,height:r,$:u}}function Yk(e){return Dr(e)?e:e.contextElement}function dl(e){const t=Yk(e);if(!Xr(t))return Kr(1);const n=t.getBoundingClientRect(),{width:r,height:a,$:i}=cB(t);let l=(i?Id(n.width):n.width)/r,u=(i?Id(n.height):n.height)/a;return(!l||!Number.isFinite(l))&&(l=1),(!u||!Number.isFinite(u))&&(u=1),{x:l,y:u}}const yV=Kr(0);function dB(e){const t=Zn(e);return!Wk()||!t.visualViewport?yV:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function vV(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Zn(e)?!1:t}function oi(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const a=e.getBoundingClientRect(),i=Yk(e);let l=Kr(1);t&&(r?Dr(r)&&(l=dl(r)):l=dl(e));const u=vV(i,n,r)?dB(i):Kr(0);let c=(a.left+u.x)/l.x,f=(a.top+u.y)/l.y,p=a.width/l.x,g=a.height/l.y;if(i){const b=Zn(i),m=r&&Dr(r)?Zn(r):r;let S=b,v=_x(S);for(;v&&r&&m!==S;){const A=dl(v),R=v.getBoundingClientRect(),x=Ir(v),_=R.left+(v.clientLeft+parseFloat(x.paddingLeft))*A.x,C=R.top+(v.clientTop+parseFloat(x.paddingTop))*A.y;c*=A.x,f*=A.y,p*=A.x,g*=A.y,c+=_,f+=C,S=Zn(v),v=_x(S)}}return Md({width:p,height:g,x:c,y:f})}function Kk(e,t){const n=yf(e).scrollLeft;return t?t.left+n:oi(Zr(e)).left+n}function fB(e,t,n){n===void 0&&(n=!1);const r=e.getBoundingClientRect(),a=r.left+t.scrollLeft-(n?0:Kk(e,r)),i=r.top+t.scrollTop;return{x:a,y:i}}function SV(e){let{elements:t,rect:n,offsetParent:r,strategy:a}=e;const i=a==="fixed",l=Zr(r),u=t?bf(t.floating):!1;if(r===l||u&&i)return n;let c={scrollLeft:0,scrollTop:0},f=Kr(1);const p=Kr(0),g=Xr(r);if((g||!g&&!i)&&((Rl(r)!=="body"||hu(l))&&(c=yf(r)),Xr(r))){const m=oi(r);f=dl(r),p.x=m.x+r.clientLeft,p.y=m.y+r.clientTop}const b=l&&!g&&!i?fB(l,c,!0):Kr(0);return{width:n.width*f.x,height:n.height*f.y,x:n.x*f.x-c.scrollLeft*f.x+p.x+b.x,y:n.y*f.y-c.scrollTop*f.y+p.y+b.y}}function EV(e){return Array.from(e.getClientRects())}function wV(e){const t=Zr(e),n=yf(e),r=e.ownerDocument.body,a=Kn(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=Kn(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let l=-n.scrollLeft+Kk(e);const u=-n.scrollTop;return Ir(r).direction==="rtl"&&(l+=Kn(t.clientWidth,r.clientWidth)-a),{width:a,height:i,x:l,y:u}}function xV(e,t){const n=Zn(e),r=Zr(e),a=n.visualViewport;let i=r.clientWidth,l=r.clientHeight,u=0,c=0;if(a){i=a.width,l=a.height;const f=Wk();(!f||f&&t==="fixed")&&(u=a.offsetLeft,c=a.offsetTop)}return{width:i,height:l,x:u,y:c}}function kV(e,t){const n=oi(e,!0,t==="fixed"),r=n.top+e.clientTop,a=n.left+e.clientLeft,i=Xr(e)?dl(e):Kr(1),l=e.clientWidth*i.x,u=e.clientHeight*i.y,c=a*i.x,f=r*i.y;return{width:l,height:u,x:c,y:f}}function jR(e,t,n){let r;if(t==="viewport")r=xV(e,n);else if(t==="document")r=wV(Zr(e));else if(Dr(t))r=kV(t,n);else{const a=dB(e);r={x:t.x-a.x,y:t.y-a.y,width:t.width,height:t.height}}return Md(r)}function pB(e,t){const n=So(e);return n===t||!Dr(n)||hl(n)?!1:Ir(n).position==="fixed"||pB(n,t)}function AV(e,t){const n=t.get(e);if(n)return n;let r=eu(e,[],!1).filter(u=>Dr(u)&&Rl(u)!=="body"),a=null;const i=Ir(e).position==="fixed";let l=i?So(e):e;for(;Dr(l)&&!hl(l);){const u=Ir(l),c=Vk(l);!c&&u.position==="fixed"&&(a=null),(i?!c&&!a:!c&&u.position==="static"&&!!a&&["absolute","fixed"].includes(a.position)||hu(l)&&!c&&pB(e,l))?r=r.filter(p=>p!==l):a=u,l=So(l)}return t.set(e,r),r}function TV(e){let{element:t,boundary:n,rootBoundary:r,strategy:a}=e;const l=[...n==="clippingAncestors"?bf(t)?[]:AV(t,this._c):[].concat(n),r],u=l[0],c=l.reduce((f,p)=>{const g=jR(t,p,a);return f.top=Kn(g.top,f.top),f.right=yo(g.right,f.right),f.bottom=yo(g.bottom,f.bottom),f.left=Kn(g.left,f.left),f},jR(t,u,a));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function _V(e){const{width:t,height:n}=cB(e);return{width:t,height:n}}function RV(e,t,n){const r=Xr(t),a=Zr(t),i=n==="fixed",l=oi(e,!0,i,t);let u={scrollLeft:0,scrollTop:0};const c=Kr(0);if(r||!r&&!i)if((Rl(t)!=="body"||hu(a))&&(u=yf(t)),r){const b=oi(t,!0,i,t);c.x=b.x+t.clientLeft,c.y=b.y+t.clientTop}else a&&(c.x=Kk(a));const f=a&&!r&&!i?fB(a,u):Kr(0),p=l.left+u.scrollLeft-c.x-f.x,g=l.top+u.scrollTop-c.y-f.y;return{x:p,y:g,width:l.width,height:l.height}}function Sh(e){return Ir(e).position==="static"}function GR(e,t){if(!Xr(e)||Ir(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Zr(e)===n&&(n=n.ownerDocument.body),n}function gB(e,t){const n=Zn(e);if(bf(e))return n;if(!Xr(e)){let a=So(e);for(;a&&!hl(a);){if(Dr(a)&&!Sh(a))return a;a=So(a)}return n}let r=GR(e,t);for(;r&&mV(r)&&Sh(r);)r=GR(r,t);return r&&hl(r)&&Sh(r)&&!Vk(r)?n:r||bV(e)||n}const CV=async function(e){const t=this.getOffsetParent||gB,n=this.getDimensions,r=await n(e.floating);return{reference:RV(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function NV(e){return Ir(e).direction==="rtl"}const OV={convertOffsetParentRelativeRectToViewportRelativeRect:SV,getDocumentElement:Zr,getClippingRect:TV,getOffsetParent:gB,getElementRects:CV,getClientRects:EV,getDimensions:_V,getScale:dl,isElement:Dr,isRTL:NV};function hB(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function DV(e,t){let n=null,r;const a=Zr(e);function i(){var u;clearTimeout(r),(u=n)==null||u.disconnect(),n=null}function l(u,c){u===void 0&&(u=!1),c===void 0&&(c=1),i();const f=e.getBoundingClientRect(),{left:p,top:g,width:b,height:m}=f;if(u||t(),!b||!m)return;const S=Gc(g),v=Gc(a.clientWidth-(p+b)),A=Gc(a.clientHeight-(g+m)),R=Gc(p),_={rootMargin:-S+"px "+-v+"px "+-A+"px "+-R+"px",threshold:Kn(0,yo(1,c))||1};let C=!0;function N(T){const O=T[0].intersectionRatio;if(O!==c){if(!C)return l();O?l(!1,O):r=setTimeout(()=>{l(!1,1e-7)},1e3)}O===1&&!hB(f,e.getBoundingClientRect())&&l(),C=!1}try{n=new IntersectionObserver(N,{..._,root:a.ownerDocument})}catch{n=new IntersectionObserver(N,_)}n.observe(e)}return l(!0),i}function IV(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:a=!0,ancestorResize:i=!0,elementResize:l=typeof ResizeObserver=="function",layoutShift:u=typeof IntersectionObserver=="function",animationFrame:c=!1}=r,f=Yk(e),p=a||i?[...f?eu(f):[],...eu(t)]:[];p.forEach(R=>{a&&R.addEventListener("scroll",n,{passive:!0}),i&&R.addEventListener("resize",n)});const g=f&&u?DV(f,n):null;let b=-1,m=null;l&&(m=new ResizeObserver(R=>{let[x]=R;x&&x.target===f&&m&&(m.unobserve(t),cancelAnimationFrame(b),b=requestAnimationFrame(()=>{var _;(_=m)==null||_.observe(t)})),n()}),f&&!c&&m.observe(f),m.observe(t));let S,v=c?oi(e):null;c&&A();function A(){const R=oi(e);v&&!hB(v,R)&&n(),v=R,S=requestAnimationFrame(A)}return n(),()=>{var R;p.forEach(x=>{a&&x.removeEventListener("scroll",n),i&&x.removeEventListener("resize",n)}),g==null||g(),(R=m)==null||R.disconnect(),m=null,c&&cancelAnimationFrame(S)}}const LV=fV,MV=pV,FV=uV,zV=hV,PV=cV,HR=sV,BV=gV,UV=(e,t,n)=>{const r=new Map,a={platform:OV,...n},i={...a.platform,_c:r};return lV(e,t,{...a,platform:i})};var bd=typeof document<"u"?k.useLayoutEffect:k.useEffect;function Fd(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,a;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!Fd(e[r],t[r]))return!1;return!0}if(a=Object.keys(e),n=a.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,a[r]))return!1;for(r=n;r--!==0;){const i=a[r];if(!(i==="_owner"&&e.$$typeof)&&!Fd(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function mB(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function $R(e,t){const n=mB(e);return Math.round(t*n)/n}function Eh(e){const t=k.useRef(e);return bd(()=>{t.current=e}),t}function jV(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:a,elements:{reference:i,floating:l}={},transform:u=!0,whileElementsMounted:c,open:f}=e,[p,g]=k.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[b,m]=k.useState(r);Fd(b,r)||m(r);const[S,v]=k.useState(null),[A,R]=k.useState(null),x=k.useCallback(P=>{P!==T.current&&(T.current=P,v(P))},[]),_=k.useCallback(P=>{P!==O.current&&(O.current=P,R(P))},[]),C=i||S,N=l||A,T=k.useRef(null),O=k.useRef(null),z=k.useRef(p),I=c!=null,M=Eh(c),H=Eh(a),q=Eh(f),U=k.useCallback(()=>{if(!T.current||!O.current)return;const P={placement:t,strategy:n,middleware:b};H.current&&(P.platform=H.current),UV(T.current,O.current,P).then(X=>{const D={...X,isPositioned:q.current!==!1};W.current&&!Fd(z.current,D)&&(z.current=D,pu.flushSync(()=>{g(D)}))})},[b,t,n,H,q]);bd(()=>{f===!1&&z.current.isPositioned&&(z.current.isPositioned=!1,g(P=>({...P,isPositioned:!1})))},[f]);const W=k.useRef(!1);bd(()=>(W.current=!0,()=>{W.current=!1}),[]),bd(()=>{if(C&&(T.current=C),N&&(O.current=N),C&&N){if(M.current)return M.current(C,N,U);U()}},[C,N,U,M,I]);const Z=k.useMemo(()=>({reference:T,floating:O,setReference:x,setFloating:_}),[x,_]),j=k.useMemo(()=>({reference:C,floating:N}),[C,N]),G=k.useMemo(()=>{const P={position:n,left:0,top:0};if(!j.floating)return P;const X=$R(j.floating,p.x),D=$R(j.floating,p.y);return u?{...P,transform:"translate("+X+"px, "+D+"px)",...mB(j.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:X,top:D}},[n,u,j.floating,p.x,p.y]);return k.useMemo(()=>({...p,update:U,refs:Z,elements:j,floatingStyles:G}),[p,U,Z,j,G])}const GV=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:a}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?HR({element:r.current,padding:a}).fn(n):{}:r?HR({element:r,padding:a}).fn(n):{}}}},HV=(e,t)=>({...LV(e),options:[e,t]}),$V=(e,t)=>({...MV(e),options:[e,t]}),qV=(e,t)=>({...BV(e),options:[e,t]}),VV=(e,t)=>({...FV(e),options:[e,t]}),WV=(e,t)=>({...zV(e),options:[e,t]}),YV=(e,t)=>({...PV(e),options:[e,t]}),KV=(e,t)=>({...GV(e),options:[e,t]});var XV="Arrow",bB=k.forwardRef((e,t)=>{const{children:n,width:r=10,height:a=5,...i}=e;return w.jsx(Xe.svg,{...i,ref:t,width:r,height:a,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:w.jsx("polygon",{points:"0,0 30,0 15,10"})})});bB.displayName=XV;var ZV=bB;function yB(e){const[t,n]=k.useState(void 0);return wn(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(a=>{if(!Array.isArray(a)||!a.length)return;const i=a[0];let l,u;if("borderBoxSize"in i){const c=i.borderBoxSize,f=Array.isArray(c)?c[0]:c;l=f.inlineSize,u=f.blockSize}else l=e.offsetWidth,u=e.offsetHeight;n({width:l,height:u})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var Xk="Popper",[vB,Cl]=mr(Xk),[QV,SB]=vB(Xk),EB=e=>{const{__scopePopper:t,children:n}=e,[r,a]=k.useState(null);return w.jsx(QV,{scope:t,anchor:r,onAnchorChange:a,children:n})};EB.displayName=Xk;var wB="PopperAnchor",xB=k.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...a}=e,i=SB(wB,n),l=k.useRef(null),u=ft(t,l);return k.useEffect(()=>{i.onAnchorChange((r==null?void 0:r.current)||l.current)}),r?null:w.jsx(Xe.div,{...a,ref:u})});xB.displayName=wB;var Zk="PopperContent",[JV,eW]=vB(Zk),kB=k.forwardRef((e,t)=>{var re,le,Ae,ae,we,xe;const{__scopePopper:n,side:r="bottom",sideOffset:a=0,align:i="center",alignOffset:l=0,arrowPadding:u=0,avoidCollisions:c=!0,collisionBoundary:f=[],collisionPadding:p=0,sticky:g="partial",hideWhenDetached:b=!1,updatePositionStrategy:m="optimized",onPlaced:S,...v}=e,A=SB(Zk,n),[R,x]=k.useState(null),_=ft(t,Ie=>x(Ie)),[C,N]=k.useState(null),T=yB(C),O=(T==null?void 0:T.width)??0,z=(T==null?void 0:T.height)??0,I=r+(i!=="center"?"-"+i:""),M=typeof p=="number"?p:{top:0,right:0,bottom:0,left:0,...p},H=Array.isArray(f)?f:[f],q=H.length>0,U={padding:M,boundary:H.filter(nW),altBoundary:q},{refs:W,floatingStyles:Z,placement:j,isPositioned:G,middlewareData:P}=jV({strategy:"fixed",placement:I,whileElementsMounted:(...Ie)=>IV(...Ie,{animationFrame:m==="always"}),elements:{reference:A.anchor},middleware:[HV({mainAxis:a+z,alignmentAxis:l}),c&&$V({mainAxis:!0,crossAxis:!1,limiter:g==="partial"?qV():void 0,...U}),c&&VV({...U}),WV({...U,apply:({elements:Ie,rects:Ce,availableWidth:Ee,availableHeight:J})=>{const{width:fe,height:ke}=Ce.reference,me=Ie.floating.style;me.setProperty("--radix-popper-available-width",`${Ee}px`),me.setProperty("--radix-popper-available-height",`${J}px`),me.setProperty("--radix-popper-anchor-width",`${fe}px`),me.setProperty("--radix-popper-anchor-height",`${ke}px`)}}),C&&KV({element:C,padding:u}),rW({arrowWidth:O,arrowHeight:z}),b&&YV({strategy:"referenceHidden",...U})]}),[X,D]=_B(j),V=pn(S);wn(()=>{G&&(V==null||V())},[G,V]);const B=(re=P.arrow)==null?void 0:re.x,L=(le=P.arrow)==null?void 0:le.y,Y=((Ae=P.arrow)==null?void 0:Ae.centerOffset)!==0,[Q,se]=k.useState();return wn(()=>{R&&se(window.getComputedStyle(R).zIndex)},[R]),w.jsx("div",{ref:W.setFloating,"data-radix-popper-content-wrapper":"",style:{...Z,transform:G?Z.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:Q,"--radix-popper-transform-origin":[(ae=P.transformOrigin)==null?void 0:ae.x,(we=P.transformOrigin)==null?void 0:we.y].join(" "),...((xe=P.hide)==null?void 0:xe.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:w.jsx(JV,{scope:n,placedSide:X,onArrowChange:N,arrowX:B,arrowY:L,shouldHideArrow:Y,children:w.jsx(Xe.div,{"data-side":X,"data-align":D,...v,ref:_,style:{...v.style,animation:G?void 0:"none"}})})})});kB.displayName=Zk;var AB="PopperArrow",tW={top:"bottom",right:"left",bottom:"top",left:"right"},TB=k.forwardRef(function(t,n){const{__scopePopper:r,...a}=t,i=eW(AB,r),l=tW[i.placedSide];return w.jsx("span",{ref:i.onArrowChange,style:{position:"absolute",left:i.arrowX,top:i.arrowY,[l]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[i.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[i.placedSide],visibility:i.shouldHideArrow?"hidden":void 0},children:w.jsx(ZV,{...a,ref:n,style:{...a.style,display:"block"}})})});TB.displayName=AB;function nW(e){return e!==null}var rW=e=>({name:"transformOrigin",options:e,fn(t){var A,R,x;const{placement:n,rects:r,middlewareData:a}=t,l=((A=a.arrow)==null?void 0:A.centerOffset)!==0,u=l?0:e.arrowWidth,c=l?0:e.arrowHeight,[f,p]=_B(n),g={start:"0%",center:"50%",end:"100%"}[p],b=(((R=a.arrow)==null?void 0:R.x)??0)+u/2,m=(((x=a.arrow)==null?void 0:x.y)??0)+c/2;let S="",v="";return f==="bottom"?(S=l?g:`${b}px`,v=`${-c}px`):f==="top"?(S=l?g:`${b}px`,v=`${r.floating.height+c}px`):f==="right"?(S=`${-c}px`,v=l?g:`${m}px`):f==="left"&&(S=`${r.floating.width+c}px`,v=l?g:`${m}px`),{data:{x:S,y:v}}}});function _B(e){const[t,n="center"]=e.split("-");return[t,n]}var Qk=EB,vf=xB,Jk=kB,e0=TB,aW="VisuallyHidden",t0=k.forwardRef((e,t)=>w.jsx(Xe.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}}));t0.displayName=aW;var oW=t0,[Sf,Jye]=mr("Tooltip",[Cl]),Ef=Cl(),RB="TooltipProvider",iW=700,Rx="tooltip.open",[lW,n0]=Sf(RB),CB=e=>{const{__scopeTooltip:t,delayDuration:n=iW,skipDelayDuration:r=300,disableHoverableContent:a=!1,children:i}=e,[l,u]=k.useState(!0),c=k.useRef(!1),f=k.useRef(0);return k.useEffect(()=>{const p=f.current;return()=>window.clearTimeout(p)},[]),w.jsx(lW,{scope:t,isOpenDelayed:l,delayDuration:n,onOpen:k.useCallback(()=>{window.clearTimeout(f.current),u(!1)},[]),onClose:k.useCallback(()=>{window.clearTimeout(f.current),f.current=window.setTimeout(()=>u(!0),r)},[r]),isPointerInTransitRef:c,onPointerInTransitChange:k.useCallback(p=>{c.current=p},[]),disableHoverableContent:a,children:i})};CB.displayName=RB;var wf="Tooltip",[sW,xf]=Sf(wf),NB=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:a=!1,onOpenChange:i,disableHoverableContent:l,delayDuration:u}=e,c=n0(wf,e.__scopeTooltip),f=Ef(t),[p,g]=k.useState(null),b=En(),m=k.useRef(0),S=l??c.disableHoverableContent,v=u??c.delayDuration,A=k.useRef(!1),[R=!1,x]=Oa({prop:r,defaultProp:a,onChange:O=>{O?(c.onOpen(),document.dispatchEvent(new CustomEvent(Rx))):c.onClose(),i==null||i(O)}}),_=k.useMemo(()=>R?A.current?"delayed-open":"instant-open":"closed",[R]),C=k.useCallback(()=>{window.clearTimeout(m.current),m.current=0,A.current=!1,x(!0)},[x]),N=k.useCallback(()=>{window.clearTimeout(m.current),m.current=0,x(!1)},[x]),T=k.useCallback(()=>{window.clearTimeout(m.current),m.current=window.setTimeout(()=>{A.current=!0,x(!0),m.current=0},v)},[v,x]);return k.useEffect(()=>()=>{m.current&&(window.clearTimeout(m.current),m.current=0)},[]),w.jsx(Qk,{...f,children:w.jsx(sW,{scope:t,contentId:b,open:R,stateAttribute:_,trigger:p,onTriggerChange:g,onTriggerEnter:k.useCallback(()=>{c.isOpenDelayed?T():C()},[c.isOpenDelayed,T,C]),onTriggerLeave:k.useCallback(()=>{S?N():(window.clearTimeout(m.current),m.current=0)},[N,S]),onOpen:C,onClose:N,disableHoverableContent:S,children:n})})};NB.displayName=wf;var Cx="TooltipTrigger",OB=k.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,a=xf(Cx,n),i=n0(Cx,n),l=Ef(n),u=k.useRef(null),c=ft(t,u,a.onTriggerChange),f=k.useRef(!1),p=k.useRef(!1),g=k.useCallback(()=>f.current=!1,[]);return k.useEffect(()=>()=>document.removeEventListener("pointerup",g),[g]),w.jsx(vf,{asChild:!0,...l,children:w.jsx(Xe.button,{"aria-describedby":a.open?a.contentId:void 0,"data-state":a.stateAttribute,...r,ref:c,onPointerMove:We(e.onPointerMove,b=>{b.pointerType!=="touch"&&!p.current&&!i.isPointerInTransitRef.current&&(a.onTriggerEnter(),p.current=!0)}),onPointerLeave:We(e.onPointerLeave,()=>{a.onTriggerLeave(),p.current=!1}),onPointerDown:We(e.onPointerDown,()=>{f.current=!0,document.addEventListener("pointerup",g,{once:!0})}),onFocus:We(e.onFocus,()=>{f.current||a.onOpen()}),onBlur:We(e.onBlur,a.onClose),onClick:We(e.onClick,a.onClose)})})});OB.displayName=Cx;var uW="TooltipPortal",[eve,cW]=Sf(uW,{forceMount:void 0}),ml="TooltipContent",DB=k.forwardRef((e,t)=>{const n=cW(ml,e.__scopeTooltip),{forceMount:r=n.forceMount,side:a="top",...i}=e,l=xf(ml,e.__scopeTooltip);return w.jsx(Jn,{present:r||l.open,children:l.disableHoverableContent?w.jsx(IB,{side:a,...i,ref:t}):w.jsx(dW,{side:a,...i,ref:t})})}),dW=k.forwardRef((e,t)=>{const n=xf(ml,e.__scopeTooltip),r=n0(ml,e.__scopeTooltip),a=k.useRef(null),i=ft(t,a),[l,u]=k.useState(null),{trigger:c,onClose:f}=n,p=a.current,{onPointerInTransitChange:g}=r,b=k.useCallback(()=>{u(null),g(!1)},[g]),m=k.useCallback((S,v)=>{const A=S.currentTarget,R={x:S.clientX,y:S.clientY},x=hW(R,A.getBoundingClientRect()),_=mW(R,x),C=bW(v.getBoundingClientRect()),N=vW([..._,...C]);u(N),g(!0)},[g]);return k.useEffect(()=>()=>b(),[b]),k.useEffect(()=>{if(c&&p){const S=A=>m(A,p),v=A=>m(A,c);return c.addEventListener("pointerleave",S),p.addEventListener("pointerleave",v),()=>{c.removeEventListener("pointerleave",S),p.removeEventListener("pointerleave",v)}}},[c,p,m,b]),k.useEffect(()=>{if(l){const S=v=>{const A=v.target,R={x:v.clientX,y:v.clientY},x=(c==null?void 0:c.contains(A))||(p==null?void 0:p.contains(A)),_=!yW(R,l);x?b():_&&(b(),f())};return document.addEventListener("pointermove",S),()=>document.removeEventListener("pointermove",S)}},[c,p,l,f,b]),w.jsx(IB,{...e,ref:i})}),[fW,pW]=Sf(wf,{isInside:!1}),IB=k.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":a,onEscapeKeyDown:i,onPointerDownOutside:l,...u}=e,c=xf(ml,n),f=Ef(n),{onClose:p}=c;return k.useEffect(()=>(document.addEventListener(Rx,p),()=>document.removeEventListener(Rx,p)),[p]),k.useEffect(()=>{if(c.trigger){const g=b=>{const m=b.target;m!=null&&m.contains(c.trigger)&&p()};return window.addEventListener("scroll",g,{capture:!0}),()=>window.removeEventListener("scroll",g,{capture:!0})}},[c.trigger,p]),w.jsx(gu,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:i,onPointerDownOutside:l,onFocusOutside:g=>g.preventDefault(),onDismiss:p,children:w.jsxs(Jk,{"data-state":c.stateAttribute,...f,...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:[w.jsx(Ok,{children:r}),w.jsx(fW,{scope:n,isInside:!0,children:w.jsx(oW,{id:c.contentId,role:"tooltip",children:a||r})})]})})});DB.displayName=ml;var LB="TooltipArrow",gW=k.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,a=Ef(n);return pW(LB,n).isInside?null:w.jsx(e0,{...a,...r,ref:t})});gW.displayName=LB;function hW(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),a=Math.abs(t.right-e.x),i=Math.abs(t.left-e.x);switch(Math.min(n,r,a,i)){case i:return"left";case a:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function mW(e,t,n=5){const r=[];switch(t){case"top":r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}function bW(e){const{top:t,right:n,bottom:r,left:a}=e;return[{x:a,y:t},{x:n,y:t},{x:n,y:r},{x:a,y:r}]}function yW(e,t){const{x:n,y:r}=e;let a=!1;for(let i=0,l=t.length-1;ir!=p>r&&n<(f-u)*(r-c)/(p-c)+u&&(a=!a)}return a}function vW(e){const t=e.slice();return t.sort((n,r)=>n.xr.x?1:n.yr.y?1:0),SW(t)}function SW(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r=2;){const i=t[t.length-1],l=t[t.length-2];if((i.x-l.x)*(a.y-l.y)>=(i.y-l.y)*(a.x-l.x))t.pop();else break}t.push(a)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const a=e[r];for(;n.length>=2;){const i=n[n.length-1],l=n[n.length-2];if((i.x-l.x)*(a.y-l.y)>=(i.y-l.y)*(a.x-l.x))n.pop();else break}n.push(a)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var EW=CB,wW=NB,xW=OB,MB=DB;const FB=EW,zB=wW,PB=xW,kW=e=>typeof e!="string"?e:e.split("\\n").map((t,n)=>w.jsxs(k.Fragment,{children:[t,nw.jsx(MB,{ref:a,sideOffset:t,className:Me("bg-popover text-popover-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 mx-1 max-w-sm overflow-hidden rounded-md border px-3 py-2 text-sm shadow-md",e),...r,children:typeof n=="string"?kW(n):n}));r0.displayName=MB.displayName;const zd=Nz("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"}}),Lt=k.forwardRef(({className:e,variant:t,tooltip:n,size:r,side:a="right",asChild:i=!1,...l},u)=>{const c=i?bo:"button";return n?w.jsx(FB,{children:w.jsxs(zB,{children:[w.jsx(PB,{asChild:!0,children:w.jsx(c,{className:Me(zd({variant:t,size:r,className:e}),"cursor-pointer"),ref:u,...l})}),w.jsx(r0,{side:a,children:n})]})}):w.jsx(c,{className:Me(zd({variant:t,size:r,className:e}),"cursor-pointer"),ref:u,...l})});Lt.displayName="Button";const AW=Z7,TW=Q7,BB=k.forwardRef(({className:e,...t},n)=>w.jsx(tB,{className:Me("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/80",e),...t,ref:n}));BB.displayName=tB.displayName;const UB=k.forwardRef(({className:e,...t},n)=>w.jsxs(TW,{children:[w.jsx(BB,{}),w.jsx(nB,{ref:n,className:Me("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-top-[48%] fixed top-[50%] left-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border p-6 shadow-lg duration-200 sm:rounded-lg",e),...t})]}));UB.displayName=nB.displayName;const jB=({className:e,...t})=>w.jsx("div",{className:Me("flex flex-col space-y-2 text-center sm:text-left",e),...t});jB.displayName="AlertDialogHeader";const GB=k.forwardRef(({className:e,...t},n)=>w.jsx(oB,{ref:n,className:Me("text-lg font-semibold",e),...t}));GB.displayName=oB.displayName;const HB=k.forwardRef(({className:e,...t},n)=>w.jsx(iB,{ref:n,className:Me("text-muted-foreground text-sm",e),...t}));HB.displayName=iB.displayName;const _W=k.forwardRef(({className:e,...t},n)=>w.jsx(rB,{ref:n,className:Me(zd(),e),...t}));_W.displayName=rB.displayName;const RW=k.forwardRef(({className:e,...t},n)=>w.jsx(aB,{ref:n,className:Me(zd({variant:"outline"}),"mt-2 sm:mt-0",e),...t}));RW.displayName=aB.displayName;const Eo=k.forwardRef(({className:e,type:t,...n},r)=>w.jsx("input",{type:t,className:Me("border-input file:text-foreground placeholder:text-muted-foreground focus-visible:ring-ring flex h-9 rounded-md border bg-transparent px-3 py-1 text-base shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium focus-visible:ring-1 focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),ref:r,...n}));Eo.displayName="Input";var CW=e=>{switch(e){case"success":return DW;case"info":return LW;case"warning":return IW;case"error":return MW;default:return null}},NW=Array(12).fill(0),OW=({visible:e,className:t})=>ye.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},ye.createElement("div",{className:"sonner-spinner"},NW.map((n,r)=>ye.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),DW=ye.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},ye.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"})),IW=ye.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},ye.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"})),LW=ye.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},ye.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"})),MW=ye.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},ye.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"})),FW=ye.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"},ye.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),ye.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),zW=()=>{let[e,t]=ye.useState(document.hidden);return ye.useEffect(()=>{let n=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),e},Nx=1,PW=class{constructor(){this.subscribe=e=>(this.subscribers.push(e),()=>{let t=this.subscribers.indexOf(e);this.subscribers.splice(t,1)}),this.publish=e=>{this.subscribers.forEach(t=>t(e))},this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e]},this.create=e=>{var t;let{message:n,...r}=e,a=typeof(e==null?void 0:e.id)=="number"||((t=e.id)==null?void 0:t.length)>0?e.id:Nx++,i=this.toasts.find(u=>u.id===a),l=e.dismissible===void 0?!0:e.dismissible;return this.dismissedToasts.has(a)&&this.dismissedToasts.delete(a),i?this.toasts=this.toasts.map(u=>u.id===a?(this.publish({...u,...e,id:a,title:n}),{...u,...e,id:a,dismissible:l,title:n}):u):this.addToast({title:n,...r,dismissible:l,id:a}),a},this.dismiss=e=>(this.dismissedToasts.add(e),e||this.toasts.forEach(t=>{this.subscribers.forEach(n=>n({id:t.id,dismiss:!0}))}),this.subscribers.forEach(t=>t({id:e,dismiss:!0})),e),this.message=(e,t)=>this.create({...t,message:e}),this.error=(e,t)=>this.create({...t,message:e,type:"error"}),this.success=(e,t)=>this.create({...t,type:"success",message:e}),this.info=(e,t)=>this.create({...t,type:"info",message:e}),this.warning=(e,t)=>this.create({...t,type:"warning",message:e}),this.loading=(e,t)=>this.create({...t,type:"loading",message:e}),this.promise=(e,t)=>{if(!t)return;let n;t.loading!==void 0&&(n=this.create({...t,promise:e,type:"loading",message:t.loading,description:typeof t.description!="function"?t.description:void 0}));let r=e instanceof Promise?e:e(),a=n!==void 0,i,l=r.then(async c=>{if(i=["resolve",c],ye.isValidElement(c))a=!1,this.create({id:n,type:"default",message:c});else if(UW(c)&&!c.ok){a=!1;let f=typeof t.error=="function"?await t.error(`HTTP error! status: ${c.status}`):t.error,p=typeof t.description=="function"?await t.description(`HTTP error! status: ${c.status}`):t.description;this.create({id:n,type:"error",message:f,description:p})}else if(t.success!==void 0){a=!1;let f=typeof t.success=="function"?await t.success(c):t.success,p=typeof t.description=="function"?await t.description(c):t.description;this.create({id:n,type:"success",message:f,description:p})}}).catch(async c=>{if(i=["reject",c],t.error!==void 0){a=!1;let f=typeof t.error=="function"?await t.error(c):t.error,p=typeof t.description=="function"?await t.description(c):t.description;this.create({id:n,type:"error",message:f,description:p})}}).finally(()=>{var c;a&&(this.dismiss(n),n=void 0),(c=t.finally)==null||c.call(t)}),u=()=>new Promise((c,f)=>l.then(()=>i[0]==="reject"?f(i[1]):c(i[1])).catch(f));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)||Nx++;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}},Fn=new PW,BW=(e,t)=>{let n=(t==null?void 0:t.id)||Nx++;return Fn.addToast({title:e,...t,id:n}),n},UW=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",jW=BW,GW=()=>Fn.toasts,HW=()=>Fn.getActiveToasts(),vn=Object.assign(jW,{success:Fn.success,info:Fn.info,warning:Fn.warning,error:Fn.error,custom:Fn.custom,message:Fn.message,promise:Fn.promise,dismiss:Fn.dismiss,loading:Fn.loading},{getHistory:GW,getToasts:HW});function $W(e,{insertAt:t}={}){if(typeof document>"u")return;let n=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",t==="top"&&n.firstChild?n.insertBefore(r,n.firstChild):n.appendChild(r),r.styleSheet?r.styleSheet.cssText=e:r.appendChild(document.createTextNode(e))}$W(`: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 Hc(e){return e.label!==void 0}var qW=3,VW="32px",WW="16px",qR=4e3,YW=356,KW=14,XW=20,ZW=200;function Ar(...e){return e.filter(Boolean).join(" ")}function QW(e){let[t,n]=e.split("-"),r=[];return t&&r.push(t),n&&r.push(n),r}var JW=e=>{var t,n,r,a,i,l,u,c,f,p,g;let{invert:b,toast:m,unstyled:S,interacting:v,setHeights:A,visibleToasts:R,heights:x,index:_,toasts:C,expanded:N,removeToast:T,defaultRichColors:O,closeButton:z,style:I,cancelButtonStyle:M,actionButtonStyle:H,className:q="",descriptionClassName:U="",duration:W,position:Z,gap:j,loadingIcon:G,expandByDefault:P,classNames:X,icons:D,closeButtonAriaLabel:V="Close toast",pauseWhenPageIsHidden:B}=e,[L,Y]=ye.useState(null),[Q,se]=ye.useState(null),[re,le]=ye.useState(!1),[Ae,ae]=ye.useState(!1),[we,xe]=ye.useState(!1),[Ie,Ce]=ye.useState(!1),[Ee,J]=ye.useState(!1),[fe,ke]=ye.useState(0),[me,ve]=ye.useState(0),ie=ye.useRef(m.duration||W||qR),ze=ye.useRef(null),Pe=ye.useRef(null),he=_===0,Ne=_+1<=R,ee=m.type,ce=m.dismissible!==!1,Re=m.className||"",Fe=m.descriptionClassName||"",qe=ye.useMemo(()=>x.findIndex(Ye=>Ye.toastId===m.id)||0,[x,m.id]),mt=ye.useMemo(()=>{var Ye;return(Ye=m.closeButton)!=null?Ye:z},[m.closeButton,z]),St=ye.useMemo(()=>m.duration||W||qR,[m.duration,W]),pt=ye.useRef(0),Je=ye.useRef(0),wt=ye.useRef(0),rt=ye.useRef(null),[bt,Bt]=Z.split("-"),sn=ye.useMemo(()=>x.reduce((Ye,gt,_t)=>_t>=qe?Ye:Ye+gt.height,0),[x,qe]),Mt=zW(),er=m.invert||b,zr=ee==="loading";Je.current=ye.useMemo(()=>qe*j+sn,[qe,sn]),ye.useEffect(()=>{ie.current=St},[St]),ye.useEffect(()=>{le(!0)},[]),ye.useEffect(()=>{let Ye=Pe.current;if(Ye){let gt=Ye.getBoundingClientRect().height;return ve(gt),A(_t=>[{toastId:m.id,height:gt,position:m.position},..._t]),()=>A(_t=>_t.filter(Rn=>Rn.toastId!==m.id))}},[A,m.id]),ye.useLayoutEffect(()=>{if(!re)return;let Ye=Pe.current,gt=Ye.style.height;Ye.style.height="auto";let _t=Ye.getBoundingClientRect().height;Ye.style.height=gt,ve(_t),A(Rn=>Rn.find(kn=>kn.toastId===m.id)?Rn.map(kn=>kn.toastId===m.id?{...kn,height:_t}:kn):[{toastId:m.id,height:_t,position:m.position},...Rn])},[re,m.title,m.description,A,m.id]);let Kt=ye.useCallback(()=>{ae(!0),ke(Je.current),A(Ye=>Ye.filter(gt=>gt.toastId!==m.id)),setTimeout(()=>{T(m)},ZW)},[m,T,A,Je]);ye.useEffect(()=>{if(m.promise&&ee==="loading"||m.duration===1/0||m.type==="loading")return;let Ye;return N||v||B&&Mt?(()=>{if(wt.current{var gt;(gt=m.onAutoClose)==null||gt.call(m,m),Kt()},ie.current)),()=>clearTimeout(Ye)},[N,v,m,ee,B,Mt,Kt]),ye.useEffect(()=>{m.delete&&Kt()},[Kt,m.delete]);function na(){var Ye,gt,_t;return D!=null&&D.loading?ye.createElement("div",{className:Ar(X==null?void 0:X.loader,(Ye=m==null?void 0:m.classNames)==null?void 0:Ye.loader,"sonner-loader"),"data-visible":ee==="loading"},D.loading):G?ye.createElement("div",{className:Ar(X==null?void 0:X.loader,(gt=m==null?void 0:m.classNames)==null?void 0:gt.loader,"sonner-loader"),"data-visible":ee==="loading"},G):ye.createElement(OW,{className:Ar(X==null?void 0:X.loader,(_t=m==null?void 0:m.classNames)==null?void 0:_t.loader),visible:ee==="loading"})}return ye.createElement("li",{tabIndex:0,ref:Pe,className:Ar(q,Re,X==null?void 0:X.toast,(t=m==null?void 0:m.classNames)==null?void 0:t.toast,X==null?void 0:X.default,X==null?void 0:X[ee],(n=m==null?void 0:m.classNames)==null?void 0:n[ee]),"data-sonner-toast":"","data-rich-colors":(r=m.richColors)!=null?r:O,"data-styled":!(m.jsx||m.unstyled||S),"data-mounted":re,"data-promise":!!m.promise,"data-swiped":Ee,"data-removed":Ae,"data-visible":Ne,"data-y-position":bt,"data-x-position":Bt,"data-index":_,"data-front":he,"data-swiping":we,"data-dismissible":ce,"data-type":ee,"data-invert":er,"data-swipe-out":Ie,"data-swipe-direction":Q,"data-expanded":!!(N||P&&re),style:{"--index":_,"--toasts-before":_,"--z-index":C.length-_,"--offset":`${Ae?fe:Je.current}px`,"--initial-height":P?"auto":`${me}px`,...I,...m.style},onDragEnd:()=>{xe(!1),Y(null),rt.current=null},onPointerDown:Ye=>{zr||!ce||(ze.current=new Date,ke(Je.current),Ye.target.setPointerCapture(Ye.pointerId),Ye.target.tagName!=="BUTTON"&&(xe(!0),rt.current={x:Ye.clientX,y:Ye.clientY}))},onPointerUp:()=>{var Ye,gt,_t,Rn;if(Ie||!ce)return;rt.current=null;let kn=Number(((Ye=Pe.current)==null?void 0:Ye.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),Cn=Number(((gt=Pe.current)==null?void 0:gt.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),ra=new Date().getTime()-((_t=ze.current)==null?void 0:_t.getTime()),Nn=L==="x"?kn:Cn,Sr=Math.abs(Nn)/ra;if(Math.abs(Nn)>=XW||Sr>.11){ke(Je.current),(Rn=m.onDismiss)==null||Rn.call(m,m),se(L==="x"?kn>0?"right":"left":Cn>0?"down":"up"),Kt(),Ce(!0),J(!1);return}xe(!1),Y(null)},onPointerMove:Ye=>{var gt,_t,Rn,kn;if(!rt.current||!ce||((gt=window.getSelection())==null?void 0:gt.toString().length)>0)return;let Cn=Ye.clientY-rt.current.y,ra=Ye.clientX-rt.current.x,Nn=(_t=e.swipeDirections)!=null?_t:QW(Z);!L&&(Math.abs(ra)>1||Math.abs(Cn)>1)&&Y(Math.abs(ra)>Math.abs(Cn)?"x":"y");let Sr={x:0,y:0};L==="y"?(Nn.includes("top")||Nn.includes("bottom"))&&(Nn.includes("top")&&Cn<0||Nn.includes("bottom")&&Cn>0)&&(Sr.y=Cn):L==="x"&&(Nn.includes("left")||Nn.includes("right"))&&(Nn.includes("left")&&ra<0||Nn.includes("right")&&ra>0)&&(Sr.x=ra),(Math.abs(Sr.x)>0||Math.abs(Sr.y)>0)&&J(!0),(Rn=Pe.current)==null||Rn.style.setProperty("--swipe-amount-x",`${Sr.x}px`),(kn=Pe.current)==null||kn.style.setProperty("--swipe-amount-y",`${Sr.y}px`)}},mt&&!m.jsx?ye.createElement("button",{"aria-label":V,"data-disabled":zr,"data-close-button":!0,onClick:zr||!ce?()=>{}:()=>{var Ye;Kt(),(Ye=m.onDismiss)==null||Ye.call(m,m)},className:Ar(X==null?void 0:X.closeButton,(a=m==null?void 0:m.classNames)==null?void 0:a.closeButton)},(i=D==null?void 0:D.close)!=null?i:FW):null,m.jsx||k.isValidElement(m.title)?m.jsx?m.jsx:typeof m.title=="function"?m.title():m.title:ye.createElement(ye.Fragment,null,ee||m.icon||m.promise?ye.createElement("div",{"data-icon":"",className:Ar(X==null?void 0:X.icon,(l=m==null?void 0:m.classNames)==null?void 0:l.icon)},m.promise||m.type==="loading"&&!m.icon?m.icon||na():null,m.type!=="loading"?m.icon||(D==null?void 0:D[ee])||CW(ee):null):null,ye.createElement("div",{"data-content":"",className:Ar(X==null?void 0:X.content,(u=m==null?void 0:m.classNames)==null?void 0:u.content)},ye.createElement("div",{"data-title":"",className:Ar(X==null?void 0:X.title,(c=m==null?void 0:m.classNames)==null?void 0:c.title)},typeof m.title=="function"?m.title():m.title),m.description?ye.createElement("div",{"data-description":"",className:Ar(U,Fe,X==null?void 0:X.description,(f=m==null?void 0:m.classNames)==null?void 0:f.description)},typeof m.description=="function"?m.description():m.description):null),k.isValidElement(m.cancel)?m.cancel:m.cancel&&Hc(m.cancel)?ye.createElement("button",{"data-button":!0,"data-cancel":!0,style:m.cancelButtonStyle||M,onClick:Ye=>{var gt,_t;Hc(m.cancel)&&ce&&((_t=(gt=m.cancel).onClick)==null||_t.call(gt,Ye),Kt())},className:Ar(X==null?void 0:X.cancelButton,(p=m==null?void 0:m.classNames)==null?void 0:p.cancelButton)},m.cancel.label):null,k.isValidElement(m.action)?m.action:m.action&&Hc(m.action)?ye.createElement("button",{"data-button":!0,"data-action":!0,style:m.actionButtonStyle||H,onClick:Ye=>{var gt,_t;Hc(m.action)&&((_t=(gt=m.action).onClick)==null||_t.call(gt,Ye),!Ye.defaultPrevented&&Kt())},className:Ar(X==null?void 0:X.actionButton,(g=m==null?void 0:m.classNames)==null?void 0:g.actionButton)},m.action.label):null))};function VR(){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 eY(e,t){let n={};return[e,t].forEach((r,a)=>{let i=a===1,l=i?"--mobile-offset":"--offset",u=i?WW:VW;function c(f){["top","right","bottom","left"].forEach(p=>{n[`${l}-${p}`]=typeof f=="number"?`${f}px`:f})}typeof r=="number"||typeof r=="string"?c(r):typeof r=="object"?["top","right","bottom","left"].forEach(f=>{r[f]===void 0?n[`${l}-${f}`]=u:n[`${l}-${f}`]=typeof r[f]=="number"?`${r[f]}px`:r[f]}):c(u)}),n}var tY=k.forwardRef(function(e,t){let{invert:n,position:r="bottom-right",hotkey:a=["altKey","KeyT"],expand:i,closeButton:l,className:u,offset:c,mobileOffset:f,theme:p="light",richColors:g,duration:b,style:m,visibleToasts:S=qW,toastOptions:v,dir:A=VR(),gap:R=KW,loadingIcon:x,icons:_,containerAriaLabel:C="Notifications",pauseWhenPageIsHidden:N}=e,[T,O]=ye.useState([]),z=ye.useMemo(()=>Array.from(new Set([r].concat(T.filter(B=>B.position).map(B=>B.position)))),[T,r]),[I,M]=ye.useState([]),[H,q]=ye.useState(!1),[U,W]=ye.useState(!1),[Z,j]=ye.useState(p!=="system"?p:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),G=ye.useRef(null),P=a.join("+").replace(/Key/g,"").replace(/Digit/g,""),X=ye.useRef(null),D=ye.useRef(!1),V=ye.useCallback(B=>{O(L=>{var Y;return(Y=L.find(Q=>Q.id===B.id))!=null&&Y.delete||Fn.dismiss(B.id),L.filter(({id:Q})=>Q!==B.id)})},[]);return ye.useEffect(()=>Fn.subscribe(B=>{if(B.dismiss){O(L=>L.map(Y=>Y.id===B.id?{...Y,delete:!0}:Y));return}setTimeout(()=>{pP.flushSync(()=>{O(L=>{let Y=L.findIndex(Q=>Q.id===B.id);return Y!==-1?[...L.slice(0,Y),{...L[Y],...B},...L.slice(Y+1)]:[B,...L]})})})}),[]),ye.useEffect(()=>{if(p!=="system"){j(p);return}if(p==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?j("dark"):j("light")),typeof window>"u")return;let B=window.matchMedia("(prefers-color-scheme: dark)");try{B.addEventListener("change",({matches:L})=>{j(L?"dark":"light")})}catch{B.addListener(({matches:Y})=>{try{j(Y?"dark":"light")}catch(Q){console.error(Q)}})}},[p]),ye.useEffect(()=>{T.length<=1&&q(!1)},[T]),ye.useEffect(()=>{let B=L=>{var Y,Q;a.every(se=>L[se]||L.code===se)&&(q(!0),(Y=G.current)==null||Y.focus()),L.code==="Escape"&&(document.activeElement===G.current||(Q=G.current)!=null&&Q.contains(document.activeElement))&&q(!1)};return document.addEventListener("keydown",B),()=>document.removeEventListener("keydown",B)},[a]),ye.useEffect(()=>{if(G.current)return()=>{X.current&&(X.current.focus({preventScroll:!0}),X.current=null,D.current=!1)}},[G.current]),ye.createElement("section",{ref:t,"aria-label":`${C} ${P}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},z.map((B,L)=>{var Y;let[Q,se]=B.split("-");return T.length?ye.createElement("ol",{key:B,dir:A==="auto"?VR():A,tabIndex:-1,ref:G,className:u,"data-sonner-toaster":!0,"data-theme":Z,"data-y-position":Q,"data-lifted":H&&T.length>1&&!i,"data-x-position":se,style:{"--front-toast-height":`${((Y=I[0])==null?void 0:Y.height)||0}px`,"--width":`${YW}px`,"--gap":`${R}px`,...m,...eY(c,f)},onBlur:re=>{D.current&&!re.currentTarget.contains(re.relatedTarget)&&(D.current=!1,X.current&&(X.current.focus({preventScroll:!0}),X.current=null))},onFocus:re=>{re.target instanceof HTMLElement&&re.target.dataset.dismissible==="false"||D.current||(D.current=!0,X.current=re.relatedTarget)},onMouseEnter:()=>q(!0),onMouseMove:()=>q(!0),onMouseLeave:()=>{U||q(!1)},onDragEnd:()=>q(!1),onPointerDown:re=>{re.target instanceof HTMLElement&&re.target.dataset.dismissible==="false"||W(!0)},onPointerUp:()=>W(!1)},T.filter(re=>!re.position&&L===0||re.position===B).map((re,le)=>{var Ae,ae;return ye.createElement(JW,{key:re.id,icons:_,index:le,toast:re,defaultRichColors:g,duration:(Ae=v==null?void 0:v.duration)!=null?Ae:b,className:v==null?void 0:v.className,descriptionClassName:v==null?void 0:v.descriptionClassName,invert:n,visibleToasts:S,closeButton:(ae=v==null?void 0:v.closeButton)!=null?ae:l,interacting:U,position:B,style:v==null?void 0:v.style,unstyled:v==null?void 0:v.unstyled,classNames:v==null?void 0:v.classNames,cancelButtonStyle:v==null?void 0:v.cancelButtonStyle,actionButtonStyle:v==null?void 0:v.actionButtonStyle,removeToast:V,toasts:T.filter(we=>we.position==re.position),heights:I.filter(we=>we.position==re.position),setHeights:M,expandByDefault:i,gap:R,loadingIcon:x,expanded:H,pauseWhenPageIsHidden:N,swipeDirections:e.swipeDirections})})):null}))});const nY=()=>{const[e,t]=k.useState(!0),n=Ke.use.apiKey(),[r,a]=k.useState(""),i=Pn.use.message();k.useEffect(()=>{a(n||"")},[n,e]),k.useEffect(()=>{i&&(i.includes(oP)||i.includes(iP))&&t(!0)},[i,t]);const l=k.useCallback(async()=>{if(Ke.setState({apiKey:r||null}),await Pn.getState().check()){t(!1);return}vn.error("API Key is invalid")},[r]),u=k.useCallback(c=>{a(c.target.value)},[a]);return w.jsx(AW,{open:e,onOpenChange:t,children:w.jsxs(UB,{children:[w.jsxs(jB,{children:[w.jsx(GB,{children:"API Key is required"}),w.jsx(HB,{children:"Please enter your API key"})]}),w.jsxs("form",{className:"flex gap-2",onSubmit:c=>c.preventDefault(),children:[w.jsx(Eo,{type:"password",value:r,onChange:u,placeholder:"Enter your API key",className:"max-h-full w-full min-w-0",autoComplete:"off"}),w.jsx(Lt,{onClick:l,variant:"outline",size:"sm",children:"Save"})]})]})})};var a0="Popover",[$B,tve]=mr(a0,[Cl]),mu=Cl(),[rY,wo]=$B(a0),qB=e=>{const{__scopePopover:t,children:n,open:r,defaultOpen:a,onOpenChange:i,modal:l=!1}=e,u=mu(t),c=k.useRef(null),[f,p]=k.useState(!1),[g=!1,b]=Oa({prop:r,defaultProp:a,onChange:i});return w.jsx(Qk,{...u,children:w.jsx(rY,{scope:t,contentId:En(),triggerRef:c,open:g,onOpenChange:b,onOpenToggle:k.useCallback(()=>b(m=>!m),[b]),hasCustomAnchor:f,onCustomAnchorAdd:k.useCallback(()=>p(!0),[]),onCustomAnchorRemove:k.useCallback(()=>p(!1),[]),modal:l,children:n})})};qB.displayName=a0;var VB="PopoverAnchor",aY=k.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,a=wo(VB,n),i=mu(n),{onCustomAnchorAdd:l,onCustomAnchorRemove:u}=a;return k.useEffect(()=>(l(),()=>u()),[l,u]),w.jsx(vf,{...i,...r,ref:t})});aY.displayName=VB;var WB="PopoverTrigger",YB=k.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,a=wo(WB,n),i=mu(n),l=ft(t,a.triggerRef),u=w.jsx(Xe.button,{type:"button","aria-haspopup":"dialog","aria-expanded":a.open,"aria-controls":a.contentId,"data-state":JB(a.open),...r,ref:l,onClick:We(e.onClick,a.onOpenToggle)});return a.hasCustomAnchor?u:w.jsx(vf,{asChild:!0,...i,children:u})});YB.displayName=WB;var o0="PopoverPortal",[oY,iY]=$B(o0,{forceMount:void 0}),KB=e=>{const{__scopePopover:t,forceMount:n,children:r,container:a}=e,i=wo(o0,t);return w.jsx(oY,{scope:t,forceMount:n,children:w.jsx(Jn,{present:n||i.open,children:w.jsx(df,{asChild:!0,container:a,children:r})})})};KB.displayName=o0;var bl="PopoverContent",XB=k.forwardRef((e,t)=>{const n=iY(bl,e.__scopePopover),{forceMount:r=n.forceMount,...a}=e,i=wo(bl,e.__scopePopover);return w.jsx(Jn,{present:r||i.open,children:i.modal?w.jsx(lY,{...a,ref:t}):w.jsx(sY,{...a,ref:t})})});XB.displayName=bl;var lY=k.forwardRef((e,t)=>{const n=wo(bl,e.__scopePopover),r=k.useRef(null),a=ft(t,r),i=k.useRef(!1);return k.useEffect(()=>{const l=r.current;if(l)return Ik(l)},[]),w.jsx(pf,{as:bo,allowPinchZoom:!0,children:w.jsx(ZB,{...e,ref:a,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:We(e.onCloseAutoFocus,l=>{var u;l.preventDefault(),i.current||(u=n.triggerRef.current)==null||u.focus()}),onPointerDownOutside:We(e.onPointerDownOutside,l=>{const u=l.detail.originalEvent,c=u.button===0&&u.ctrlKey===!0,f=u.button===2||c;i.current=f},{checkForDefaultPrevented:!1}),onFocusOutside:We(e.onFocusOutside,l=>l.preventDefault(),{checkForDefaultPrevented:!1})})})}),sY=k.forwardRef((e,t)=>{const n=wo(bl,e.__scopePopover),r=k.useRef(!1),a=k.useRef(!1);return w.jsx(ZB,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var l,u;(l=e.onCloseAutoFocus)==null||l.call(e,i),i.defaultPrevented||(r.current||(u=n.triggerRef.current)==null||u.focus(),i.preventDefault()),r.current=!1,a.current=!1},onInteractOutside:i=>{var c,f;(c=e.onInteractOutside)==null||c.call(e,i),i.defaultPrevented||(r.current=!0,i.detail.originalEvent.type==="pointerdown"&&(a.current=!0));const l=i.target;((f=n.triggerRef.current)==null?void 0:f.contains(l))&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&a.current&&i.preventDefault()}})}),ZB=k.forwardRef((e,t)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:a,onCloseAutoFocus:i,disableOutsidePointerEvents:l,onEscapeKeyDown:u,onPointerDownOutside:c,onFocusOutside:f,onInteractOutside:p,...g}=e,b=wo(bl,n),m=mu(n);return Dk(),w.jsx(cf,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:a,onUnmountAutoFocus:i,children:w.jsx(gu,{asChild:!0,disableOutsidePointerEvents:l,onInteractOutside:p,onEscapeKeyDown:u,onPointerDownOutside:c,onFocusOutside:f,onDismiss:()=>b.onOpenChange(!1),children:w.jsx(Jk,{"data-state":JB(b.open),role:"dialog",id:b.contentId,...m,...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)"}})})})}),QB="PopoverClose",uY=k.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,a=wo(QB,n);return w.jsx(Xe.button,{type:"button",...r,ref:t,onClick:We(e.onClick,()=>a.onOpenChange(!1))})});uY.displayName=QB;var cY="PopoverArrow",dY=k.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,a=mu(n);return w.jsx(e0,{...a,...r,ref:t})});dY.displayName=cY;function JB(e){return e?"open":"closed"}var fY=qB,pY=YB,gY=KB,eU=XB;const kf=fY,Af=pY,bu=k.forwardRef(({className:e,align:t="center",sideOffset:n=4,...r},a)=>w.jsx(gY,{children:w.jsx(eU,{ref:a,align:t,sideOffset:n,className:Me("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 rounded-md border p-4 shadow-md outline-none",e),...r})}));bu.displayName=eU.displayName;const hY=({status:e})=>e?w.jsxs("div",{className:"min-w-[300px] space-y-3 text-sm",children:[w.jsxs("div",{className:"space-y-1",children:[w.jsx("h4",{className:"font-medium",children:"Storage Info"}),w.jsxs("div",{className:"text-muted-foreground grid grid-cols-2 gap-1",children:[w.jsx("span",{children:"Working Directory:"}),w.jsx("span",{className:"truncate",children:e.working_directory}),w.jsx("span",{children:"Input Directory:"}),w.jsx("span",{className:"truncate",children:e.input_directory})]})]}),w.jsxs("div",{className:"space-y-1",children:[w.jsx("h4",{className:"font-medium",children:"LLM Configuration"}),w.jsxs("div",{className:"text-muted-foreground grid grid-cols-2 gap-1",children:[w.jsx("span",{children:"LLM Binding:"}),w.jsx("span",{children:e.configuration.llm_binding}),w.jsx("span",{children:"LLM Binding Host:"}),w.jsx("span",{children:e.configuration.llm_binding_host}),w.jsx("span",{children:"LLM Model:"}),w.jsx("span",{children:e.configuration.llm_model}),w.jsx("span",{children:"Max Tokens:"}),w.jsx("span",{children:e.configuration.max_tokens})]})]}),w.jsxs("div",{className:"space-y-1",children:[w.jsx("h4",{className:"font-medium",children:"Embedding Configuration"}),w.jsxs("div",{className:"text-muted-foreground grid grid-cols-2 gap-1",children:[w.jsx("span",{children:"Embedding Binding:"}),w.jsx("span",{children:e.configuration.embedding_binding}),w.jsx("span",{children:"Embedding Binding Host:"}),w.jsx("span",{children:e.configuration.embedding_binding_host}),w.jsx("span",{children:"Embedding Model:"}),w.jsx("span",{children:e.configuration.embedding_model})]})]}),w.jsxs("div",{className:"space-y-1",children:[w.jsx("h4",{className:"font-medium",children:"Storage Configuration"}),w.jsxs("div",{className:"text-muted-foreground grid grid-cols-2 gap-1",children:[w.jsx("span",{children:"KV Storage:"}),w.jsx("span",{children:e.configuration.kv_storage}),w.jsx("span",{children:"Doc Status Storage:"}),w.jsx("span",{children:e.configuration.doc_status_storage}),w.jsx("span",{children:"Graph Storage:"}),w.jsx("span",{children:e.configuration.graph_storage}),w.jsx("span",{children:"Vector Storage:"}),w.jsx("span",{children:e.configuration.vector_storage})]})]})]}):w.jsx("div",{className:"text-muted-foreground text-sm",children:"Status information unavailable"}),mY=()=>{const e=Pn.use.health(),t=Pn.use.lastCheckTime(),n=Pn.use.status(),[r,a]=k.useState(!1);return k.useEffect(()=>{a(!0);const i=setTimeout(()=>a(!1),300);return()=>clearTimeout(i)},[t]),w.jsx("div",{className:"fixed right-4 bottom-4 flex items-center gap-2 opacity-80 select-none",children:w.jsxs(kf,{children:[w.jsx(Af,{asChild:!0,children:w.jsxs("div",{className:"flex cursor-help items-center gap-2",children:[w.jsx("div",{className:Me("h-3 w-3 rounded-full transition-all duration-300","shadow-[0_0_8px_rgba(0,0,0,0.2)]",e?"bg-green-500":"bg-red-500",r&&"scale-125",r&&e&&"shadow-[0_0_12px_rgba(34,197,94,0.4)]",r&&!e&&"shadow-[0_0_12px_rgba(239,68,68,0.4)]")}),w.jsx("span",{className:"text-muted-foreground text-xs",children:e?"Connected":"Disconnected"})]})}),w.jsx(bu,{className:"w-auto",side:"top",align:"end",children:w.jsx(hY,{status:n})})]})})},i0=()=>{const e=k.useContext(Cz);if(e===void 0)throw new Error("useTheme must be used within a ThemeProvider");return e};function bY(){const{theme:e,setTheme:t}=i0(),n=k.useCallback(()=>t("light"),[t]),r=k.useCallback(()=>t("dark"),[t]);return e==="dark"?w.jsx(Lt,{onClick:n,variant:Yr,tooltip:"Switch to light theme",size:"icon",side:"bottom",children:w.jsx(Kq,{})}):w.jsx(Lt,{onClick:r,variant:Yr,tooltip:"Switch to dark theme",size:"icon",side:"bottom",children:w.jsx(u8,{})})}function tU(e){const t=e+"CollectionProvider",[n,r]=mr(t),[a,i]=n(t,{collectionRef:{current:null},itemMap:new Map}),l=m=>{const{scope:S,children:v}=m,A=ye.useRef(null),R=ye.useRef(new Map).current;return w.jsx(a,{scope:S,itemMap:R,collectionRef:A,children:v})};l.displayName=t;const u=e+"CollectionSlot",c=ye.forwardRef((m,S)=>{const{scope:v,children:A}=m,R=i(u,v),x=ft(S,R.collectionRef);return w.jsx(bo,{ref:x,children:A})});c.displayName=u;const f=e+"CollectionItemSlot",p="data-radix-collection-item",g=ye.forwardRef((m,S)=>{const{scope:v,children:A,...R}=m,x=ye.useRef(null),_=ft(S,x),C=i(f,v);return ye.useEffect(()=>(C.itemMap.set(x,{ref:x,...R}),()=>void C.itemMap.delete(x))),w.jsx(bo,{[p]:"",ref:_,children:A})});g.displayName=f;function b(m){const S=i(e+"CollectionConsumer",m);return ye.useCallback(()=>{const A=S.collectionRef.current;if(!A)return[];const R=Array.from(A.querySelectorAll(`[${p}]`));return Array.from(S.itemMap.values()).sort((C,N)=>R.indexOf(C.ref.current)-R.indexOf(N.ref.current))},[S.collectionRef,S.itemMap])}return[{Provider:l,Slot:c,ItemSlot:g},b,r]}var yY=k.createContext(void 0);function Tf(e){const t=k.useContext(yY);return e||t||"ltr"}var wh="rovingFocusGroup.onEntryFocus",vY={bubbles:!1,cancelable:!0},_f="RovingFocusGroup",[Ox,nU,SY]=tU(_f),[EY,rU]=mr(_f,[SY]),[wY,xY]=EY(_f),aU=k.forwardRef((e,t)=>w.jsx(Ox.Provider,{scope:e.__scopeRovingFocusGroup,children:w.jsx(Ox.Slot,{scope:e.__scopeRovingFocusGroup,children:w.jsx(kY,{...e,ref:t})})}));aU.displayName=_f;var kY=k.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:a=!1,dir:i,currentTabStopId:l,defaultCurrentTabStopId:u,onCurrentTabStopIdChange:c,onEntryFocus:f,preventScrollOnEntryFocus:p=!1,...g}=e,b=k.useRef(null),m=ft(t,b),S=Tf(i),[v=null,A]=Oa({prop:l,defaultProp:u,onChange:c}),[R,x]=k.useState(!1),_=pn(f),C=nU(n),N=k.useRef(!1),[T,O]=k.useState(0);return k.useEffect(()=>{const z=b.current;if(z)return z.addEventListener(wh,_),()=>z.removeEventListener(wh,_)},[_]),w.jsx(wY,{scope:n,orientation:r,dir:S,loop:a,currentTabStopId:v,onItemFocus:k.useCallback(z=>A(z),[A]),onItemShiftTab:k.useCallback(()=>x(!0),[]),onFocusableItemAdd:k.useCallback(()=>O(z=>z+1),[]),onFocusableItemRemove:k.useCallback(()=>O(z=>z-1),[]),children:w.jsx(Xe.div,{tabIndex:R||T===0?-1:0,"data-orientation":r,...g,ref:m,style:{outline:"none",...e.style},onMouseDown:We(e.onMouseDown,()=>{N.current=!0}),onFocus:We(e.onFocus,z=>{const I=!N.current;if(z.target===z.currentTarget&&I&&!R){const M=new CustomEvent(wh,vY);if(z.currentTarget.dispatchEvent(M),!M.defaultPrevented){const H=C().filter(j=>j.focusable),q=H.find(j=>j.active),U=H.find(j=>j.id===v),Z=[q,U,...H].filter(Boolean).map(j=>j.ref.current);lU(Z,p)}}N.current=!1}),onBlur:We(e.onBlur,()=>x(!1))})})}),oU="RovingFocusGroupItem",iU=k.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:a=!1,tabStopId:i,...l}=e,u=En(),c=i||u,f=xY(oU,n),p=f.currentTabStopId===c,g=nU(n),{onFocusableItemAdd:b,onFocusableItemRemove:m}=f;return k.useEffect(()=>{if(r)return b(),()=>m()},[r,b,m]),w.jsx(Ox.ItemSlot,{scope:n,id:c,focusable:r,active:a,children:w.jsx(Xe.span,{tabIndex:p?0:-1,"data-orientation":f.orientation,...l,ref:t,onMouseDown:We(e.onMouseDown,S=>{r?f.onItemFocus(c):S.preventDefault()}),onFocus:We(e.onFocus,()=>f.onItemFocus(c)),onKeyDown:We(e.onKeyDown,S=>{if(S.key==="Tab"&&S.shiftKey){f.onItemShiftTab();return}if(S.target!==S.currentTarget)return;const v=_Y(S,f.orientation,f.dir);if(v!==void 0){if(S.metaKey||S.ctrlKey||S.altKey||S.shiftKey)return;S.preventDefault();let R=g().filter(x=>x.focusable).map(x=>x.ref.current);if(v==="last")R.reverse();else if(v==="prev"||v==="next"){v==="prev"&&R.reverse();const x=R.indexOf(S.currentTarget);R=f.loop?RY(R,x+1):R.slice(x+1)}setTimeout(()=>lU(R))}})})})});iU.displayName=oU;var AY={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function TY(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function _Y(e,t,n){const r=TY(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return AY[r]}function lU(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function RY(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var CY=aU,NY=iU,l0="Tabs",[OY,nve]=mr(l0,[rU]),sU=rU(),[DY,s0]=OY(l0),uU=k.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:a,defaultValue:i,orientation:l="horizontal",dir:u,activationMode:c="automatic",...f}=e,p=Tf(u),[g,b]=Oa({prop:r,onChange:a,defaultProp:i});return w.jsx(DY,{scope:n,baseId:En(),value:g,onValueChange:b,orientation:l,dir:p,activationMode:c,children:w.jsx(Xe.div,{dir:p,"data-orientation":l,...f,ref:t})})});uU.displayName=l0;var cU="TabsList",dU=k.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...a}=e,i=s0(cU,n),l=sU(n);return w.jsx(CY,{asChild:!0,...l,orientation:i.orientation,dir:i.dir,loop:r,children:w.jsx(Xe.div,{role:"tablist","aria-orientation":i.orientation,...a,ref:t})})});dU.displayName=cU;var fU="TabsTrigger",pU=k.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:a=!1,...i}=e,l=s0(fU,n),u=sU(n),c=mU(l.baseId,r),f=bU(l.baseId,r),p=r===l.value;return w.jsx(NY,{asChild:!0,...u,focusable:!a,active:p,children:w.jsx(Xe.button,{type:"button",role:"tab","aria-selected":p,"aria-controls":f,"data-state":p?"active":"inactive","data-disabled":a?"":void 0,disabled:a,id:c,...i,ref:t,onMouseDown:We(e.onMouseDown,g=>{!a&&g.button===0&&g.ctrlKey===!1?l.onValueChange(r):g.preventDefault()}),onKeyDown:We(e.onKeyDown,g=>{[" ","Enter"].includes(g.key)&&l.onValueChange(r)}),onFocus:We(e.onFocus,()=>{const g=l.activationMode!=="manual";!p&&!a&&g&&l.onValueChange(r)})})})});pU.displayName=fU;var gU="TabsContent",hU=k.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:a,children:i,...l}=e,u=s0(gU,n),c=mU(u.baseId,r),f=bU(u.baseId,r),p=r===u.value,g=k.useRef(p);return k.useEffect(()=>{const b=requestAnimationFrame(()=>g.current=!1);return()=>cancelAnimationFrame(b)},[]),w.jsx(Jn,{present:a||p,children:({present:b})=>w.jsx(Xe.div,{"data-state":p?"active":"inactive","data-orientation":u.orientation,role:"tabpanel","aria-labelledby":c,hidden:!b,id:f,tabIndex:0,...l,ref:t,style:{...e.style,animationDuration:g.current?"0s":void 0},children:b&&i})})});hU.displayName=gU;function mU(e,t){return`${e}-trigger-${t}`}function bU(e,t){return`${e}-content-${t}`}var IY=uU,yU=dU,vU=pU,SU=hU;const LY=IY,EU=k.forwardRef(({className:e,...t},n)=>w.jsx(yU,{ref:n,className:Me("bg-muted text-muted-foreground inline-flex h-10 items-center justify-center rounded-md p-1",e),...t}));EU.displayName=yU.displayName;const wU=k.forwardRef(({className:e,...t},n)=>w.jsx(vU,{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}));wU.displayName=vU.displayName;const qs=k.forwardRef(({className:e,...t},n)=>w.jsx(SU,{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}));qs.displayName=SU.displayName;function $c({value:e,currentTab:t,children:n}){return w.jsx(wU,{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 MY(){const e=Ke.use.currentTab();return w.jsx("div",{className:"flex h-8 self-center",children:w.jsxs(EU,{className:"h-full gap-2",children:[w.jsx($c,{value:"documents",currentTab:e,children:"Documents"}),w.jsx($c,{value:"knowledge-graph",currentTab:e,children:"Knowledge Graph"}),w.jsx($c,{value:"retrieval",currentTab:e,children:"Retrieval"}),w.jsx($c,{value:"api",currentTab:e,children:"API"})]})})}function FY(){return w.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:[w.jsxs("a",{href:"/",className:"mr-6 flex items-center gap-2",children:[w.jsx(p8,{className:"size-4 text-emerald-400","aria-hidden":"true"}),w.jsx("span",{className:"font-bold md:inline-block",children:lR.name})]}),w.jsx("div",{className:"flex h-10 flex-1 justify-center",children:w.jsx(MY,{})}),w.jsxs("nav",{className:"flex items-center",children:[w.jsx(Lt,{variant:"ghost",size:"icon",side:"bottom",tooltip:"Project Repository",children:w.jsx("a",{href:lR.github,target:"_blank",rel:"noopener noreferrer",children:w.jsx(Pq,{className:"size-4","aria-hidden":"true"})})}),w.jsx(bY,{})]})]})}var qc={exports:{}},WR;function zY(){if(WR)return qc.exports;WR=1;var e=typeof Reflect=="object"?Reflect:null,t=e&&typeof e.apply=="function"?e.apply:function(N,T,O){return Function.prototype.apply.call(N,T,O)},n;e&&typeof e.ownKeys=="function"?n=e.ownKeys:Object.getOwnPropertySymbols?n=function(N){return Object.getOwnPropertyNames(N).concat(Object.getOwnPropertySymbols(N))}:n=function(N){return Object.getOwnPropertyNames(N)};function r(C){console&&console.warn&&console.warn(C)}var a=Number.isNaN||function(N){return N!==N};function i(){i.init.call(this)}qc.exports=i,qc.exports.once=R,i.EventEmitter=i,i.prototype._events=void 0,i.prototype._eventsCount=0,i.prototype._maxListeners=void 0;var l=10;function u(C){if(typeof C!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof C)}Object.defineProperty(i,"defaultMaxListeners",{enumerable:!0,get:function(){return l},set:function(C){if(typeof C!="number"||C<0||a(C))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+C+".");l=C}}),i.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},i.prototype.setMaxListeners=function(N){if(typeof N!="number"||N<0||a(N))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+N+".");return this._maxListeners=N,this};function c(C){return C._maxListeners===void 0?i.defaultMaxListeners:C._maxListeners}i.prototype.getMaxListeners=function(){return c(this)},i.prototype.emit=function(N){for(var T=[],O=1;O0&&(M=T[0]),M instanceof Error)throw M;var H=new Error("Unhandled error."+(M?" ("+M.message+")":""));throw H.context=M,H}var q=I[N];if(q===void 0)return!1;if(typeof q=="function")t(q,this,T);else for(var U=q.length,W=S(q,U),O=0;O0&&M.length>z&&!M.warned){M.warned=!0;var H=new Error("Possible EventEmitter memory leak detected. "+M.length+" "+String(N)+" listeners added. Use emitter.setMaxListeners() to increase limit");H.name="MaxListenersExceededWarning",H.emitter=C,H.type=N,H.count=M.length,r(H)}return C}i.prototype.addListener=function(N,T){return f(this,N,T,!1)},i.prototype.on=i.prototype.addListener,i.prototype.prependListener=function(N,T){return f(this,N,T,!0)};function p(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function g(C,N,T){var O={fired:!1,wrapFn:void 0,target:C,type:N,listener:T},z=p.bind(O);return z.listener=T,O.wrapFn=z,z}i.prototype.once=function(N,T){return u(T),this.on(N,g(this,N,T)),this},i.prototype.prependOnceListener=function(N,T){return u(T),this.prependListener(N,g(this,N,T)),this},i.prototype.removeListener=function(N,T){var O,z,I,M,H;if(u(T),z=this._events,z===void 0)return this;if(O=z[N],O===void 0)return this;if(O===T||O.listener===T)--this._eventsCount===0?this._events=Object.create(null):(delete z[N],z.removeListener&&this.emit("removeListener",N,O.listener||T));else if(typeof O!="function"){for(I=-1,M=O.length-1;M>=0;M--)if(O[M]===T||O[M].listener===T){H=O[M].listener,I=M;break}if(I<0)return this;I===0?O.shift():v(O,I),O.length===1&&(z[N]=O[0]),z.removeListener!==void 0&&this.emit("removeListener",N,H||T)}return this},i.prototype.off=i.prototype.removeListener,i.prototype.removeAllListeners=function(N){var T,O,z;if(O=this._events,O===void 0)return this;if(O.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):O[N]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete O[N]),this;if(arguments.length===0){var I=Object.keys(O),M;for(z=0;z=0;z--)this.removeListener(N,T[z]);return this};function b(C,N,T){var O=C._events;if(O===void 0)return[];var z=O[N];return z===void 0?[]:typeof z=="function"?T?[z.listener||z]:[z]:T?A(z):S(z,z.length)}i.prototype.listeners=function(N){return b(this,N,!0)},i.prototype.rawListeners=function(N){return b(this,N,!1)},i.listenerCount=function(C,N){return typeof C.listenerCount=="function"?C.listenerCount(N):m.call(C,N)},i.prototype.listenerCount=m;function m(C){var N=this._events;if(N!==void 0){var T=N[C];if(typeof T=="function")return 1;if(T!==void 0)return T.length}return 0}i.prototype.eventNames=function(){return this._eventsCount>0?n(this._events):[]};function S(C,N){for(var T=new Array(N),O=0;Oe++}function Na(){const e=arguments;let t=null,n=-1;return{[Symbol.iterator](){return this},next(){let r=null;do{if(t===null){if(n++,n>=e.length)return{done:!0};t=e[n][Symbol.iterator]()}if(r=t.next(),r.done){t=null;continue}break}while(!0);return r}}}function Nl(){return{[Symbol.iterator](){return this},next(){return{done:!0}}}}class u0 extends Error{constructor(t){super(),this.name="GraphError",this.message=t}}class Le extends u0{constructor(t){super(t),this.name="InvalidArgumentsGraphError",typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,Le.prototype.constructor)}}class De extends u0{constructor(t){super(t),this.name="NotFoundGraphError",typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,De.prototype.constructor)}}class Ze extends u0{constructor(t){super(t),this.name="UsageGraphError",typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,Ze.prototype.constructor)}}function AU(e,t){this.key=e,this.attributes=t,this.clear()}AU.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 TU(e,t){this.key=e,this.attributes=t,this.clear()}TU.prototype.clear=function(){this.inDegree=0,this.outDegree=0,this.directedLoops=0,this.in={},this.out={}};function _U(e,t){this.key=e,this.attributes=t,this.clear()}_U.prototype.clear=function(){this.undirectedDegree=0,this.undirectedLoops=0,this.undirected={}};function Ol(e,t,n,r,a){this.key=t,this.attributes=a,this.undirected=e,this.source=n,this.target=r}Ol.prototype.attach=function(){let e="out",t="in";this.undirected&&(e=t="undirected");const n=this.source.key,r=this.target.key;this.source[e][r]=this,!(this.undirected&&n===r)&&(this.target[t][n]=this)};Ol.prototype.attachMulti=function(){let e="out",t="in";const n=this.source.key,r=this.target.key;this.undirected&&(e=t="undirected");const a=this.source[e],i=a[r];if(typeof i>"u"){a[r]=this,this.undirected&&n===r||(this.target[t][n]=this);return}i.previous=this,this.next=i,a[r]=this,this.target[t][n]=this};Ol.prototype.detach=function(){const e=this.source.key,t=this.target.key;let n="out",r="in";this.undirected&&(n=r="undirected"),delete this.source[n][t],delete this.target[r][e]};Ol.prototype.detachMulti=function(){const e=this.source.key,t=this.target.key;let n="out",r="in";this.undirected&&(n=r="undirected"),this.previous===void 0?this.next===void 0?(delete this.source[n][t],delete this.target[r][e]):(this.next.previous=void 0,this.source[n][t]=this.next,this.target[r][e]=this.next):(this.previous.next=this.next,this.next!==void 0&&(this.next.previous=this.previous))};const RU=0,CU=1,UY=2,NU=3;function Ma(e,t,n,r,a,i,l){let u,c,f,p;if(r=""+r,n===RU){if(u=e._nodes.get(r),!u)throw new De(`Graph.${t}: could not find the "${r}" node in the graph.`);f=a,p=i}else if(n===NU){if(a=""+a,c=e._edges.get(a),!c)throw new De(`Graph.${t}: could not find the "${a}" edge in the graph.`);const g=c.source.key,b=c.target.key;if(r===g)u=c.target;else if(r===b)u=c.source;else throw new De(`Graph.${t}: the "${r}" node is not attached to the "${a}" edge (${g}, ${b}).`);f=i,p=l}else{if(c=e._edges.get(r),!c)throw new De(`Graph.${t}: could not find the "${r}" edge in the graph.`);n===CU?u=c.source:u=c.target,f=a,p=i}return[u,f,p]}function jY(e,t,n){e.prototype[t]=function(r,a,i){const[l,u]=Ma(this,t,n,r,a,i);return l.attributes[u]}}function GY(e,t,n){e.prototype[t]=function(r,a){const[i]=Ma(this,t,n,r,a);return i.attributes}}function HY(e,t,n){e.prototype[t]=function(r,a,i){const[l,u]=Ma(this,t,n,r,a,i);return l.attributes.hasOwnProperty(u)}}function $Y(e,t,n){e.prototype[t]=function(r,a,i,l){const[u,c,f]=Ma(this,t,n,r,a,i,l);return u.attributes[c]=f,this.emit("nodeAttributesUpdated",{key:u.key,type:"set",attributes:u.attributes,name:c}),this}}function qY(e,t,n){e.prototype[t]=function(r,a,i,l){const[u,c,f]=Ma(this,t,n,r,a,i,l);if(typeof f!="function")throw new Le(`Graph.${t}: updater should be a function.`);const p=u.attributes,g=f(p[c]);return p[c]=g,this.emit("nodeAttributesUpdated",{key:u.key,type:"set",attributes:u.attributes,name:c}),this}}function VY(e,t,n){e.prototype[t]=function(r,a,i){const[l,u]=Ma(this,t,n,r,a,i);return delete l.attributes[u],this.emit("nodeAttributesUpdated",{key:l.key,type:"remove",attributes:l.attributes,name:u}),this}}function WY(e,t,n){e.prototype[t]=function(r,a,i){const[l,u]=Ma(this,t,n,r,a,i);if(!gn(u))throw new Le(`Graph.${t}: provided attributes are not a plain object.`);return l.attributes=u,this.emit("nodeAttributesUpdated",{key:l.key,type:"replace",attributes:l.attributes}),this}}function YY(e,t,n){e.prototype[t]=function(r,a,i){const[l,u]=Ma(this,t,n,r,a,i);if(!gn(u))throw new Le(`Graph.${t}: provided attributes are not a plain object.`);return Qt(l.attributes,u),this.emit("nodeAttributesUpdated",{key:l.key,type:"merge",attributes:l.attributes,data:u}),this}}function KY(e,t,n){e.prototype[t]=function(r,a,i){const[l,u]=Ma(this,t,n,r,a,i);if(typeof u!="function")throw new Le(`Graph.${t}: provided updater is not a function.`);return l.attributes=u(l.attributes),this.emit("nodeAttributesUpdated",{key:l.key,type:"update",attributes:l.attributes}),this}}const XY=[{name:e=>`get${e}Attribute`,attacher:jY},{name:e=>`get${e}Attributes`,attacher:GY},{name:e=>`has${e}Attribute`,attacher:HY},{name:e=>`set${e}Attribute`,attacher:$Y},{name:e=>`update${e}Attribute`,attacher:qY},{name:e=>`remove${e}Attribute`,attacher:VY},{name:e=>`replace${e}Attributes`,attacher:WY},{name:e=>`merge${e}Attributes`,attacher:YY},{name:e=>`update${e}Attributes`,attacher:KY}];function ZY(e){XY.forEach(function({name:t,attacher:n}){n(e,t("Node"),RU),n(e,t("Source"),CU),n(e,t("Target"),UY),n(e,t("Opposite"),NU)})}function QY(e,t,n){e.prototype[t]=function(r,a){let i;if(this.type!=="mixed"&&n!=="mixed"&&n!==this.type)throw new Ze(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new Ze(`Graph.${t}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const l=""+r,u=""+a;if(a=arguments[2],i=hr(this,l,u,n),!i)throw new De(`Graph.${t}: could not find an edge for the given path ("${l}" - "${u}").`)}else{if(n!=="mixed")throw new Ze(`Graph.${t}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(r=""+r,i=this._edges.get(r),!i)throw new De(`Graph.${t}: could not find the "${r}" edge in the graph.`)}return i.attributes[a]}}function JY(e,t,n){e.prototype[t]=function(r){let a;if(this.type!=="mixed"&&n!=="mixed"&&n!==this.type)throw new Ze(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>1){if(this.multi)throw new Ze(`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 i=""+r,l=""+arguments[1];if(a=hr(this,i,l,n),!a)throw new De(`Graph.${t}: could not find an edge for the given path ("${i}" - "${l}").`)}else{if(n!=="mixed")throw new Ze(`Graph.${t}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(r=""+r,a=this._edges.get(r),!a)throw new De(`Graph.${t}: could not find the "${r}" edge in the graph.`)}return a.attributes}}function eK(e,t,n){e.prototype[t]=function(r,a){let i;if(this.type!=="mixed"&&n!=="mixed"&&n!==this.type)throw new Ze(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new Ze(`Graph.${t}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const l=""+r,u=""+a;if(a=arguments[2],i=hr(this,l,u,n),!i)throw new De(`Graph.${t}: could not find an edge for the given path ("${l}" - "${u}").`)}else{if(n!=="mixed")throw new Ze(`Graph.${t}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(r=""+r,i=this._edges.get(r),!i)throw new De(`Graph.${t}: could not find the "${r}" edge in the graph.`)}return i.attributes.hasOwnProperty(a)}}function tK(e,t,n){e.prototype[t]=function(r,a,i){let l;if(this.type!=="mixed"&&n!=="mixed"&&n!==this.type)throw new Ze(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>3){if(this.multi)throw new Ze(`Graph.${t}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const u=""+r,c=""+a;if(a=arguments[2],i=arguments[3],l=hr(this,u,c,n),!l)throw new De(`Graph.${t}: could not find an edge for the given path ("${u}" - "${c}").`)}else{if(n!=="mixed")throw new Ze(`Graph.${t}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(r=""+r,l=this._edges.get(r),!l)throw new De(`Graph.${t}: could not find the "${r}" edge in the graph.`)}return l.attributes[a]=i,this.emit("edgeAttributesUpdated",{key:l.key,type:"set",attributes:l.attributes,name:a}),this}}function nK(e,t,n){e.prototype[t]=function(r,a,i){let l;if(this.type!=="mixed"&&n!=="mixed"&&n!==this.type)throw new Ze(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>3){if(this.multi)throw new Ze(`Graph.${t}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const u=""+r,c=""+a;if(a=arguments[2],i=arguments[3],l=hr(this,u,c,n),!l)throw new De(`Graph.${t}: could not find an edge for the given path ("${u}" - "${c}").`)}else{if(n!=="mixed")throw new Ze(`Graph.${t}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(r=""+r,l=this._edges.get(r),!l)throw new De(`Graph.${t}: could not find the "${r}" edge in the graph.`)}if(typeof i!="function")throw new Le(`Graph.${t}: updater should be a function.`);return l.attributes[a]=i(l.attributes[a]),this.emit("edgeAttributesUpdated",{key:l.key,type:"set",attributes:l.attributes,name:a}),this}}function rK(e,t,n){e.prototype[t]=function(r,a){let i;if(this.type!=="mixed"&&n!=="mixed"&&n!==this.type)throw new Ze(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new Ze(`Graph.${t}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const l=""+r,u=""+a;if(a=arguments[2],i=hr(this,l,u,n),!i)throw new De(`Graph.${t}: could not find an edge for the given path ("${l}" - "${u}").`)}else{if(n!=="mixed")throw new Ze(`Graph.${t}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(r=""+r,i=this._edges.get(r),!i)throw new De(`Graph.${t}: could not find the "${r}" edge in the graph.`)}return delete i.attributes[a],this.emit("edgeAttributesUpdated",{key:i.key,type:"remove",attributes:i.attributes,name:a}),this}}function aK(e,t,n){e.prototype[t]=function(r,a){let i;if(this.type!=="mixed"&&n!=="mixed"&&n!==this.type)throw new Ze(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new Ze(`Graph.${t}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const l=""+r,u=""+a;if(a=arguments[2],i=hr(this,l,u,n),!i)throw new De(`Graph.${t}: could not find an edge for the given path ("${l}" - "${u}").`)}else{if(n!=="mixed")throw new Ze(`Graph.${t}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(r=""+r,i=this._edges.get(r),!i)throw new De(`Graph.${t}: could not find the "${r}" edge in the graph.`)}if(!gn(a))throw new Le(`Graph.${t}: provided attributes are not a plain object.`);return i.attributes=a,this.emit("edgeAttributesUpdated",{key:i.key,type:"replace",attributes:i.attributes}),this}}function oK(e,t,n){e.prototype[t]=function(r,a){let i;if(this.type!=="mixed"&&n!=="mixed"&&n!==this.type)throw new Ze(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new Ze(`Graph.${t}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const l=""+r,u=""+a;if(a=arguments[2],i=hr(this,l,u,n),!i)throw new De(`Graph.${t}: could not find an edge for the given path ("${l}" - "${u}").`)}else{if(n!=="mixed")throw new Ze(`Graph.${t}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(r=""+r,i=this._edges.get(r),!i)throw new De(`Graph.${t}: could not find the "${r}" edge in the graph.`)}if(!gn(a))throw new Le(`Graph.${t}: provided attributes are not a plain object.`);return Qt(i.attributes,a),this.emit("edgeAttributesUpdated",{key:i.key,type:"merge",attributes:i.attributes,data:a}),this}}function iK(e,t,n){e.prototype[t]=function(r,a){let i;if(this.type!=="mixed"&&n!=="mixed"&&n!==this.type)throw new Ze(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new Ze(`Graph.${t}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const l=""+r,u=""+a;if(a=arguments[2],i=hr(this,l,u,n),!i)throw new De(`Graph.${t}: could not find an edge for the given path ("${l}" - "${u}").`)}else{if(n!=="mixed")throw new Ze(`Graph.${t}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(r=""+r,i=this._edges.get(r),!i)throw new De(`Graph.${t}: could not find the "${r}" edge in the graph.`)}if(typeof a!="function")throw new Le(`Graph.${t}: provided updater is not a function.`);return i.attributes=a(i.attributes),this.emit("edgeAttributesUpdated",{key:i.key,type:"update",attributes:i.attributes}),this}}const lK=[{name:e=>`get${e}Attribute`,attacher:QY},{name:e=>`get${e}Attributes`,attacher:JY},{name:e=>`has${e}Attribute`,attacher:eK},{name:e=>`set${e}Attribute`,attacher:tK},{name:e=>`update${e}Attribute`,attacher:nK},{name:e=>`remove${e}Attribute`,attacher:rK},{name:e=>`replace${e}Attributes`,attacher:aK},{name:e=>`merge${e}Attributes`,attacher:oK},{name:e=>`update${e}Attributes`,attacher:iK}];function sK(e){lK.forEach(function({name:t,attacher:n}){n(e,t("Edge"),"mixed"),n(e,t("DirectedEdge"),"directed"),n(e,t("UndirectedEdge"),"undirected")})}const uK=[{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 cK(e,t,n,r){let a=!1;for(const i in t){if(i===r)continue;const l=t[i];if(a=n(l.key,l.attributes,l.source.key,l.target.key,l.source.attributes,l.target.attributes,l.undirected),e&&a)return l.key}}function dK(e,t,n,r){let a,i,l,u=!1;for(const c in t)if(c!==r){a=t[c];do{if(i=a.source,l=a.target,u=n(a.key,a.attributes,i.key,l.key,i.attributes,l.attributes,a.undirected),e&&u)return a.key;a=a.next}while(a!==void 0)}}function xh(e,t){const n=Object.keys(e),r=n.length;let a,i=0;return{[Symbol.iterator](){return this},next(){do if(a)a=a.next;else{if(i>=r)return{done:!0};const l=n[i++];if(l===t){a=void 0;continue}a=e[l]}while(!a);return{done:!1,value:{edge:a.key,attributes:a.attributes,source:a.source.key,target:a.target.key,sourceAttributes:a.source.attributes,targetAttributes:a.target.attributes,undirected:a.undirected}}}}}function fK(e,t,n,r){const a=t[n];if(!a)return;const i=a.source,l=a.target;if(r(a.key,a.attributes,i.key,l.key,i.attributes,l.attributes,a.undirected)&&e)return a.key}function pK(e,t,n,r){let a=t[n];if(!a)return;let i=!1;do{if(i=r(a.key,a.attributes,a.source.key,a.target.key,a.source.attributes,a.target.attributes,a.undirected),e&&i)return a.key;a=a.next}while(a!==void 0)}function kh(e,t){let n=e[t];if(n.next!==void 0)return{[Symbol.iterator](){return this},next(){if(!n)return{done:!0};const a={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:a}}};let r=!1;return{[Symbol.iterator](){return this},next(){return r===!0?{done:!0}:(r=!0,{done:!1,value:{edge:n.key,attributes:n.attributes,source:n.source.key,target:n.target.key,sourceAttributes:n.source.attributes,targetAttributes:n.target.attributes,undirected:n.undirected}})}}}function gK(e,t){if(e.size===0)return[];if(t==="mixed"||t===e.type)return Array.from(e._edges.keys());const n=t==="undirected"?e.undirectedSize:e.directedSize,r=new Array(n),a=t==="undirected",i=e._edges.values();let l=0,u,c;for(;u=i.next(),u.done!==!0;)c=u.value,c.undirected===a&&(r[l++]=c.key);return r}function OU(e,t,n,r){if(t.size===0)return;const a=n!=="mixed"&&n!==t.type,i=n==="undirected";let l,u,c=!1;const f=t._edges.values();for(;l=f.next(),l.done!==!0;){if(u=l.value,a&&u.undirected!==i)continue;const{key:p,attributes:g,source:b,target:m}=u;if(c=r(p,g,b.key,m.key,b.attributes,m.attributes,u.undirected),e&&c)return p}}function hK(e,t){if(e.size===0)return Nl();const n=t!=="mixed"&&t!==e.type,r=t==="undirected",a=e._edges.values();return{[Symbol.iterator](){return this},next(){let i,l;for(;;){if(i=a.next(),i.done)return i;if(l=i.value,!(n&&l.undirected!==r))break}return{value:{edge:l.key,attributes:l.attributes,source:l.source.key,target:l.target.key,sourceAttributes:l.source.attributes,targetAttributes:l.target.attributes,undirected:l.undirected},done:!1}}}}function c0(e,t,n,r,a,i){const l=t?dK:cK;let u;if(n!=="undirected"&&(r!=="out"&&(u=l(e,a.in,i),e&&u)||r!=="in"&&(u=l(e,a.out,i,r?void 0:a.key),e&&u))||n!=="directed"&&(u=l(e,a.undirected,i),e&&u))return u}function mK(e,t,n,r){const a=[];return c0(!1,e,t,n,r,function(i){a.push(i)}),a}function bK(e,t,n){let r=Nl();return e!=="undirected"&&(t!=="out"&&typeof n.in<"u"&&(r=Na(r,xh(n.in))),t!=="in"&&typeof n.out<"u"&&(r=Na(r,xh(n.out,t?void 0:n.key)))),e!=="directed"&&typeof n.undirected<"u"&&(r=Na(r,xh(n.undirected))),r}function d0(e,t,n,r,a,i,l){const u=n?pK:fK;let c;if(t!=="undirected"&&(typeof a.in<"u"&&r!=="out"&&(c=u(e,a.in,i,l),e&&c)||typeof a.out<"u"&&r!=="in"&&(r||a.key!==i)&&(c=u(e,a.out,i,l),e&&c))||t!=="directed"&&typeof a.undirected<"u"&&(c=u(e,a.undirected,i,l),e&&c))return c}function yK(e,t,n,r,a){const i=[];return d0(!1,e,t,n,r,a,function(l){i.push(l)}),i}function vK(e,t,n,r){let a=Nl();return e!=="undirected"&&(typeof n.in<"u"&&t!=="out"&&r in n.in&&(a=Na(a,kh(n.in,r))),typeof n.out<"u"&&t!=="in"&&r in n.out&&(t||n.key!==r)&&(a=Na(a,kh(n.out,r)))),e!=="directed"&&typeof n.undirected<"u"&&r in n.undirected&&(a=Na(a,kh(n.undirected,r))),a}function SK(e,t){const{name:n,type:r,direction:a}=t;e.prototype[n]=function(i,l){if(r!=="mixed"&&this.type!=="mixed"&&r!==this.type)return[];if(!arguments.length)return gK(this,r);if(arguments.length===1){i=""+i;const u=this._nodes.get(i);if(typeof u>"u")throw new De(`Graph.${n}: could not find the "${i}" node in the graph.`);return mK(this.multi,r==="mixed"?this.type:r,a,u)}if(arguments.length===2){i=""+i,l=""+l;const u=this._nodes.get(i);if(!u)throw new De(`Graph.${n}: could not find the "${i}" source node in the graph.`);if(!this._nodes.has(l))throw new De(`Graph.${n}: could not find the "${l}" target node in the graph.`);return yK(r,this.multi,a,u,l)}throw new Le(`Graph.${n}: too many arguments (expecting 0, 1 or 2 and got ${arguments.length}).`)}}function EK(e,t){const{name:n,type:r,direction:a}=t,i="forEach"+n[0].toUpperCase()+n.slice(1,-1);e.prototype[i]=function(f,p,g){if(!(r!=="mixed"&&this.type!=="mixed"&&r!==this.type)){if(arguments.length===1)return g=f,OU(!1,this,r,g);if(arguments.length===2){f=""+f,g=p;const b=this._nodes.get(f);if(typeof b>"u")throw new De(`Graph.${i}: could not find the "${f}" node in the graph.`);return c0(!1,this.multi,r==="mixed"?this.type:r,a,b,g)}if(arguments.length===3){f=""+f,p=""+p;const b=this._nodes.get(f);if(!b)throw new De(`Graph.${i}: could not find the "${f}" source node in the graph.`);if(!this._nodes.has(p))throw new De(`Graph.${i}: could not find the "${p}" target node in the graph.`);return d0(!1,r,this.multi,a,b,p,g)}throw new Le(`Graph.${i}: too many arguments (expecting 1, 2 or 3 and got ${arguments.length}).`)}};const l="map"+n[0].toUpperCase()+n.slice(1);e.prototype[l]=function(){const f=Array.prototype.slice.call(arguments),p=f.pop();let g;if(f.length===0){let b=0;r!=="directed"&&(b+=this.undirectedSize),r!=="undirected"&&(b+=this.directedSize),g=new Array(b);let m=0;f.push((S,v,A,R,x,_,C)=>{g[m++]=p(S,v,A,R,x,_,C)})}else g=[],f.push((b,m,S,v,A,R,x)=>{g.push(p(b,m,S,v,A,R,x))});return this[i].apply(this,f),g};const u="filter"+n[0].toUpperCase()+n.slice(1);e.prototype[u]=function(){const f=Array.prototype.slice.call(arguments),p=f.pop(),g=[];return f.push((b,m,S,v,A,R,x)=>{p(b,m,S,v,A,R,x)&&g.push(b)}),this[i].apply(this,f),g};const c="reduce"+n[0].toUpperCase()+n.slice(1);e.prototype[c]=function(){let f=Array.prototype.slice.call(arguments);if(f.length<2||f.length>4)throw new Le(`Graph.${c}: invalid number of arguments (expecting 2, 3 or 4 and got ${f.length}).`);if(typeof f[f.length-1]=="function"&&typeof f[f.length-2]!="function")throw new Le(`Graph.${c}: missing initial value. You must provide it because the callback takes more than one argument and we cannot infer the initial value from the first iteration, as you could with a simple array.`);let p,g;f.length===2?(p=f[0],g=f[1],f=[]):f.length===3?(p=f[1],g=f[2],f=[f[0]]):f.length===4&&(p=f[2],g=f[3],f=[f[0],f[1]]);let b=g;return f.push((m,S,v,A,R,x,_)=>{b=p(b,m,S,v,A,R,x,_)}),this[i].apply(this,f),b}}function wK(e,t){const{name:n,type:r,direction:a}=t,i="find"+n[0].toUpperCase()+n.slice(1,-1);e.prototype[i]=function(c,f,p){if(r!=="mixed"&&this.type!=="mixed"&&r!==this.type)return!1;if(arguments.length===1)return p=c,OU(!0,this,r,p);if(arguments.length===2){c=""+c,p=f;const g=this._nodes.get(c);if(typeof g>"u")throw new De(`Graph.${i}: could not find the "${c}" node in the graph.`);return c0(!0,this.multi,r==="mixed"?this.type:r,a,g,p)}if(arguments.length===3){c=""+c,f=""+f;const g=this._nodes.get(c);if(!g)throw new De(`Graph.${i}: could not find the "${c}" source node in the graph.`);if(!this._nodes.has(f))throw new De(`Graph.${i}: could not find the "${f}" target node in the graph.`);return d0(!0,r,this.multi,a,g,f,p)}throw new Le(`Graph.${i}: too many arguments (expecting 1, 2 or 3 and got ${arguments.length}).`)};const l="some"+n[0].toUpperCase()+n.slice(1,-1);e.prototype[l]=function(){const c=Array.prototype.slice.call(arguments),f=c.pop();return c.push((g,b,m,S,v,A,R)=>f(g,b,m,S,v,A,R)),!!this[i].apply(this,c)};const u="every"+n[0].toUpperCase()+n.slice(1,-1);e.prototype[u]=function(){const c=Array.prototype.slice.call(arguments),f=c.pop();return c.push((g,b,m,S,v,A,R)=>!f(g,b,m,S,v,A,R)),!this[i].apply(this,c)}}function xK(e,t){const{name:n,type:r,direction:a}=t,i=n.slice(0,-1)+"Entries";e.prototype[i]=function(l,u){if(r!=="mixed"&&this.type!=="mixed"&&r!==this.type)return Nl();if(!arguments.length)return hK(this,r);if(arguments.length===1){l=""+l;const c=this._nodes.get(l);if(!c)throw new De(`Graph.${i}: could not find the "${l}" node in the graph.`);return bK(r,a,c)}if(arguments.length===2){l=""+l,u=""+u;const c=this._nodes.get(l);if(!c)throw new De(`Graph.${i}: could not find the "${l}" source node in the graph.`);if(!this._nodes.has(u))throw new De(`Graph.${i}: could not find the "${u}" target node in the graph.`);return vK(r,a,c,u)}throw new Le(`Graph.${i}: too many arguments (expecting 0, 1 or 2 and got ${arguments.length}).`)}}function kK(e){uK.forEach(t=>{SK(e,t),EK(e,t),wK(e,t),xK(e,t)})}const AK=[{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 Rf(){this.A=null,this.B=null}Rf.prototype.wrap=function(e){this.A===null?this.A=e:this.B===null&&(this.B=e)};Rf.prototype.has=function(e){return this.A!==null&&e in this.A||this.B!==null&&e in this.B};function Ms(e,t,n,r,a){for(const i in r){const l=r[i],u=l.source,c=l.target,f=u===n?c:u;if(t&&t.has(f.key))continue;const p=a(f.key,f.attributes);if(e&&p)return f.key}}function f0(e,t,n,r,a){if(t!=="mixed"){if(t==="undirected")return Ms(e,null,r,r.undirected,a);if(typeof n=="string")return Ms(e,null,r,r[n],a)}const i=new Rf;let l;if(t!=="undirected"){if(n!=="out"){if(l=Ms(e,null,r,r.in,a),e&&l)return l;i.wrap(r.in)}if(n!=="in"){if(l=Ms(e,i,r,r.out,a),e&&l)return l;i.wrap(r.out)}}if(t!=="directed"&&(l=Ms(e,i,r,r.undirected,a),e&&l))return l}function TK(e,t,n){if(e!=="mixed"){if(e==="undirected")return Object.keys(n.undirected);if(typeof t=="string")return Object.keys(n[t])}const r=[];return f0(!1,e,t,n,function(a){r.push(a)}),r}function Fs(e,t,n){const r=Object.keys(n),a=r.length;let i=0;return{[Symbol.iterator](){return this},next(){let l=null;do{if(i>=a)return e&&e.wrap(n),{done:!0};const u=n[r[i++]],c=u.source,f=u.target;if(l=c===t?f:c,e&&e.has(l.key)){l=null;continue}}while(l===null);return{done:!1,value:{neighbor:l.key,attributes:l.attributes}}}}}function _K(e,t,n){if(e!=="mixed"){if(e==="undirected")return Fs(null,n,n.undirected);if(typeof t=="string")return Fs(null,n,n[t])}let r=Nl();const a=new Rf;return e!=="undirected"&&(t!=="out"&&(r=Na(r,Fs(a,n,n.in))),t!=="in"&&(r=Na(r,Fs(a,n,n.out)))),e!=="directed"&&(r=Na(r,Fs(a,n,n.undirected))),r}function RK(e,t){const{name:n,type:r,direction:a}=t;e.prototype[n]=function(i){if(r!=="mixed"&&this.type!=="mixed"&&r!==this.type)return[];i=""+i;const l=this._nodes.get(i);if(typeof l>"u")throw new De(`Graph.${n}: could not find the "${i}" node in the graph.`);return TK(r==="mixed"?this.type:r,a,l)}}function CK(e,t){const{name:n,type:r,direction:a}=t,i="forEach"+n[0].toUpperCase()+n.slice(1,-1);e.prototype[i]=function(f,p){if(r!=="mixed"&&this.type!=="mixed"&&r!==this.type)return;f=""+f;const g=this._nodes.get(f);if(typeof g>"u")throw new De(`Graph.${i}: could not find the "${f}" node in the graph.`);f0(!1,r==="mixed"?this.type:r,a,g,p)};const l="map"+n[0].toUpperCase()+n.slice(1);e.prototype[l]=function(f,p){const g=[];return this[i](f,(b,m)=>{g.push(p(b,m))}),g};const u="filter"+n[0].toUpperCase()+n.slice(1);e.prototype[u]=function(f,p){const g=[];return this[i](f,(b,m)=>{p(b,m)&&g.push(b)}),g};const c="reduce"+n[0].toUpperCase()+n.slice(1);e.prototype[c]=function(f,p,g){if(arguments.length<3)throw new Le(`Graph.${c}: 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 b=g;return this[i](f,(m,S)=>{b=p(b,m,S)}),b}}function NK(e,t){const{name:n,type:r,direction:a}=t,i=n[0].toUpperCase()+n.slice(1,-1),l="find"+i;e.prototype[l]=function(f,p){if(r!=="mixed"&&this.type!=="mixed"&&r!==this.type)return;f=""+f;const g=this._nodes.get(f);if(typeof g>"u")throw new De(`Graph.${l}: could not find the "${f}" node in the graph.`);return f0(!0,r==="mixed"?this.type:r,a,g,p)};const u="some"+i;e.prototype[u]=function(f,p){return!!this[l](f,p)};const c="every"+i;e.prototype[c]=function(f,p){return!this[l](f,(b,m)=>!p(b,m))}}function OK(e,t){const{name:n,type:r,direction:a}=t,i=n.slice(0,-1)+"Entries";e.prototype[i]=function(l){if(r!=="mixed"&&this.type!=="mixed"&&r!==this.type)return Nl();l=""+l;const u=this._nodes.get(l);if(typeof u>"u")throw new De(`Graph.${i}: could not find the "${l}" node in the graph.`);return _K(r==="mixed"?this.type:r,a,u)}}function DK(e){AK.forEach(t=>{RK(e,t),CK(e,t),NK(e,t),OK(e,t)})}function Vc(e,t,n,r,a){const i=r._nodes.values(),l=r.type;let u,c,f,p,g,b;for(;u=i.next(),u.done!==!0;){let m=!1;if(c=u.value,l!=="undirected"){p=c.out;for(f in p){g=p[f];do b=g.target,m=!0,a(c.key,b.key,c.attributes,b.attributes,g.key,g.attributes,g.undirected),g=g.next;while(g)}}if(l!=="directed"){p=c.undirected;for(f in p)if(!(t&&c.key>f)){g=p[f];do b=g.target,b.key!==f&&(b=g.source),m=!0,a(c.key,b.key,c.attributes,b.attributes,g.key,g.attributes,g.undirected),g=g.next;while(g)}}n&&!m&&a(c.key,null,c.attributes,null,null,null,null)}}function IK(e,t){const n={key:e};return kU(t.attributes)||(n.attributes=Qt({},t.attributes)),n}function LK(e,t,n){const r={key:t,source:n.source.key,target:n.target.key};return kU(n.attributes)||(r.attributes=Qt({},n.attributes)),e==="mixed"&&n.undirected&&(r.undirected=!0),r}function MK(e){if(!gn(e))throw new Le('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 Le("Graph.import: serialized node is missing its key.");if("attributes"in e&&(!gn(e.attributes)||e.attributes===null))throw new Le("Graph.import: invalid attributes. Attributes should be a plain object, null or omitted.")}function FK(e){if(!gn(e))throw new Le('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 Le("Graph.import: serialized edge is missing its source.");if(!("target"in e))throw new Le("Graph.import: serialized edge is missing its target.");if("attributes"in e&&(!gn(e.attributes)||e.attributes===null))throw new Le("Graph.import: invalid attributes. Attributes should be a plain object, null or omitted.");if("undirected"in e&&typeof e.undirected!="boolean")throw new Le("Graph.import: invalid undirectedness information. Undirected should be boolean or omitted.")}const zK=BY(),PK=new Set(["directed","undirected","mixed"]),KR=new Set(["domain","_events","_eventsCount","_maxListeners"]),BK=[{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"}],UK={allowSelfLoops:!0,multi:!1,type:"mixed"};function jK(e,t,n){if(n&&!gn(n))throw new Le(`Graph.addNode: invalid attributes. Expecting an object but got "${n}"`);if(t=""+t,n=n||{},e._nodes.has(t))throw new Ze(`Graph.addNode: the "${t}" node already exist in the graph.`);const r=new e.NodeDataClass(t,n);return e._nodes.set(t,r),e.emit("nodeAdded",{key:t,attributes:n}),r}function XR(e,t,n){const r=new e.NodeDataClass(t,n);return e._nodes.set(t,r),e.emit("nodeAdded",{key:t,attributes:n}),r}function DU(e,t,n,r,a,i,l,u){if(!r&&e.type==="undirected")throw new Ze(`Graph.${t}: you cannot add a directed edge to an undirected graph. Use the #.addEdge or #.addUndirectedEdge instead.`);if(r&&e.type==="directed")throw new Ze(`Graph.${t}: you cannot add an undirected edge to a directed graph. Use the #.addEdge or #.addDirectedEdge instead.`);if(u&&!gn(u))throw new Le(`Graph.${t}: invalid attributes. Expecting an object but got "${u}"`);if(i=""+i,l=""+l,u=u||{},!e.allowSelfLoops&&i===l)throw new Ze(`Graph.${t}: source & target are the same ("${i}"), thus creating a loop explicitly forbidden by this graph 'allowSelfLoops' option set to false.`);const c=e._nodes.get(i),f=e._nodes.get(l);if(!c)throw new De(`Graph.${t}: source node "${i}" not found.`);if(!f)throw new De(`Graph.${t}: target node "${l}" not found.`);const p={key:null,undirected:r,source:i,target:l,attributes:u};if(n)a=e._edgeKeyGenerator();else if(a=""+a,e._edges.has(a))throw new Ze(`Graph.${t}: the "${a}" edge already exists in the graph.`);if(!e.multi&&(r?typeof c.undirected[l]<"u":typeof c.out[l]<"u"))throw new Ze(`Graph.${t}: an edge linking "${i}" to "${l}" already exists. If you really want to add multiple edges linking those nodes, you should create a multi graph by using the 'multi' option.`);const g=new Ol(r,a,c,f,u);e._edges.set(a,g);const b=i===l;return r?(c.undirectedDegree++,f.undirectedDegree++,b&&(c.undirectedLoops++,e._undirectedSelfLoopCount++)):(c.outDegree++,f.inDegree++,b&&(c.directedLoops++,e._directedSelfLoopCount++)),e.multi?g.attachMulti():g.attach(),r?e._undirectedSize++:e._directedSize++,p.key=a,e.emit("edgeAdded",p),a}function GK(e,t,n,r,a,i,l,u,c){if(!r&&e.type==="undirected")throw new Ze(`Graph.${t}: you cannot merge/update a directed edge to an undirected graph. Use the #.mergeEdge/#.updateEdge or #.addUndirectedEdge instead.`);if(r&&e.type==="directed")throw new Ze(`Graph.${t}: you cannot merge/update an undirected edge to a directed graph. Use the #.mergeEdge/#.updateEdge or #.addDirectedEdge instead.`);if(u){if(c){if(typeof u!="function")throw new Le(`Graph.${t}: invalid updater function. Expecting a function but got "${u}"`)}else if(!gn(u))throw new Le(`Graph.${t}: invalid attributes. Expecting an object but got "${u}"`)}i=""+i,l=""+l;let f;if(c&&(f=u,u=void 0),!e.allowSelfLoops&&i===l)throw new Ze(`Graph.${t}: source & target are the same ("${i}"), thus creating a loop explicitly forbidden by this graph 'allowSelfLoops' option set to false.`);let p=e._nodes.get(i),g=e._nodes.get(l),b,m;if(!n&&(b=e._edges.get(a),b)){if((b.source.key!==i||b.target.key!==l)&&(!r||b.source.key!==l||b.target.key!==i))throw new Ze(`Graph.${t}: inconsistency detected when attempting to merge the "${a}" edge with "${i}" source & "${l}" target vs. ("${b.source.key}", "${b.target.key}").`);m=b}if(!m&&!e.multi&&p&&(m=r?p.undirected[l]:p.out[l]),m){const x=[m.key,!1,!1,!1];if(c?!f:!u)return x;if(c){const _=m.attributes;m.attributes=f(_),e.emit("edgeAttributesUpdated",{type:"replace",key:m.key,attributes:m.attributes})}else Qt(m.attributes,u),e.emit("edgeAttributesUpdated",{type:"merge",key:m.key,attributes:m.attributes,data:u});return x}u=u||{},c&&f&&(u=f(u));const S={key:null,undirected:r,source:i,target:l,attributes:u};if(n)a=e._edgeKeyGenerator();else if(a=""+a,e._edges.has(a))throw new Ze(`Graph.${t}: the "${a}" edge already exists in the graph.`);let v=!1,A=!1;p||(p=XR(e,i,{}),v=!0,i===l&&(g=p,A=!0)),g||(g=XR(e,l,{}),A=!0),b=new Ol(r,a,p,g,u),e._edges.set(a,b);const R=i===l;return r?(p.undirectedDegree++,g.undirectedDegree++,R&&(p.undirectedLoops++,e._undirectedSelfLoopCount++)):(p.outDegree++,g.inDegree++,R&&(p.directedLoops++,e._directedSelfLoopCount++)),e.multi?b.attachMulti():b.attach(),r?e._undirectedSize++:e._directedSize++,S.key=a,e.emit("edgeAdded",S),[a,!0,v,A]}function Qi(e,t){e._edges.delete(t.key);const{source:n,target:r,attributes:a}=t,i=t.undirected,l=n===r;i?(n.undirectedDegree--,r.undirectedDegree--,l&&(n.undirectedLoops--,e._undirectedSelfLoopCount--)):(n.outDegree--,r.inDegree--,l&&(n.directedLoops--,e._directedSelfLoopCount--)),e.multi?t.detachMulti():t.detach(),i?e._undirectedSize--:e._directedSize--,e.emit("edgeDropped",{key:t.key,attributes:a,source:n.key,target:r.key,undirected:i})}class Tt extends xU.EventEmitter{constructor(t){if(super(),t=Qt({},UK,t),typeof t.multi!="boolean")throw new Le(`Graph.constructor: invalid 'multi' option. Expecting a boolean but got "${t.multi}".`);if(!PK.has(t.type))throw new Le(`Graph.constructor: invalid 'type' option. Should be one of "mixed", "directed" or "undirected" but got "${t.type}".`);if(typeof t.allowSelfLoops!="boolean")throw new Le(`Graph.constructor: invalid 'allowSelfLoops' option. Expecting a boolean but got "${t.allowSelfLoops}".`);const n=t.type==="mixed"?AU:t.type==="directed"?TU:_U;pr(this,"NodeDataClass",n);const r="geid_"+zK()+"_";let a=0;const i=()=>{let l;do l=r+a++;while(this._edges.has(l));return l};pr(this,"_attributes",{}),pr(this,"_nodes",new Map),pr(this,"_edges",new Map),pr(this,"_directedSize",0),pr(this,"_undirectedSize",0),pr(this,"_directedSelfLoopCount",0),pr(this,"_undirectedSelfLoopCount",0),pr(this,"_edgeKeyGenerator",i),pr(this,"_options",t),KR.forEach(l=>pr(this,l,this[l])),Tr(this,"order",()=>this._nodes.size),Tr(this,"size",()=>this._edges.size),Tr(this,"directedSize",()=>this._directedSize),Tr(this,"undirectedSize",()=>this._undirectedSize),Tr(this,"selfLoopCount",()=>this._directedSelfLoopCount+this._undirectedSelfLoopCount),Tr(this,"directedSelfLoopCount",()=>this._directedSelfLoopCount),Tr(this,"undirectedSelfLoopCount",()=>this._undirectedSelfLoopCount),Tr(this,"multi",this._options.multi),Tr(this,"type",this._options.type),Tr(this,"allowSelfLoops",this._options.allowSelfLoops),Tr(this,"implementation",()=>"graphology")}_resetInstanceCounters(){this._directedSize=0,this._undirectedSize=0,this._directedSelfLoopCount=0,this._undirectedSelfLoopCount=0}hasNode(t){return this._nodes.has(""+t)}hasDirectedEdge(t,n){if(this.type==="undirected")return!1;if(arguments.length===1){const r=""+t,a=this._edges.get(r);return!!a&&!a.undirected}else if(arguments.length===2){t=""+t,n=""+n;const r=this._nodes.get(t);return r?r.out.hasOwnProperty(n):!1}throw new Le(`Graph.hasDirectedEdge: invalid arity (${arguments.length}, instead of 1 or 2). You can either ask for an edge id or for the existence of an edge between a source & a target.`)}hasUndirectedEdge(t,n){if(this.type==="directed")return!1;if(arguments.length===1){const r=""+t,a=this._edges.get(r);return!!a&&a.undirected}else if(arguments.length===2){t=""+t,n=""+n;const r=this._nodes.get(t);return r?r.undirected.hasOwnProperty(n):!1}throw new Le(`Graph.hasDirectedEdge: invalid arity (${arguments.length}, instead of 1 or 2). You can either ask for an edge id or for the existence of an edge between a source & a target.`)}hasEdge(t,n){if(arguments.length===1){const r=""+t;return this._edges.has(r)}else if(arguments.length===2){t=""+t,n=""+n;const r=this._nodes.get(t);return r?typeof r.out<"u"&&r.out.hasOwnProperty(n)||typeof r.undirected<"u"&&r.undirected.hasOwnProperty(n):!1}throw new Le(`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 Ze("Graph.directedEdge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.directedEdges instead.");const r=this._nodes.get(t);if(!r)throw new De(`Graph.directedEdge: could not find the "${t}" source node in the graph.`);if(!this._nodes.has(n))throw new De(`Graph.directedEdge: could not find the "${n}" target node in the graph.`);const a=r.out&&r.out[n]||void 0;if(a)return a.key}undirectedEdge(t,n){if(this.type==="directed")return;if(t=""+t,n=""+n,this.multi)throw new Ze("Graph.undirectedEdge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.undirectedEdges instead.");const r=this._nodes.get(t);if(!r)throw new De(`Graph.undirectedEdge: could not find the "${t}" source node in the graph.`);if(!this._nodes.has(n))throw new De(`Graph.undirectedEdge: could not find the "${n}" target node in the graph.`);const a=r.undirected&&r.undirected[n]||void 0;if(a)return a.key}edge(t,n){if(this.multi)throw new Ze("Graph.edge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.edges instead.");t=""+t,n=""+n;const r=this._nodes.get(t);if(!r)throw new De(`Graph.edge: could not find the "${t}" source node in the graph.`);if(!this._nodes.has(n))throw new De(`Graph.edge: could not find the "${n}" target node in the graph.`);const a=r.out&&r.out[n]||r.undirected&&r.undirected[n]||void 0;if(a)return a.key}areDirectedNeighbors(t,n){t=""+t,n=""+n;const r=this._nodes.get(t);if(!r)throw new De(`Graph.areDirectedNeighbors: could not find the "${t}" node in the graph.`);return this.type==="undirected"?!1:n in r.in||n in r.out}areOutNeighbors(t,n){t=""+t,n=""+n;const r=this._nodes.get(t);if(!r)throw new De(`Graph.areOutNeighbors: could not find the "${t}" node in the graph.`);return this.type==="undirected"?!1:n in r.out}areInNeighbors(t,n){t=""+t,n=""+n;const r=this._nodes.get(t);if(!r)throw new De(`Graph.areInNeighbors: could not find the "${t}" node in the graph.`);return this.type==="undirected"?!1:n in r.in}areUndirectedNeighbors(t,n){t=""+t,n=""+n;const r=this._nodes.get(t);if(!r)throw new De(`Graph.areUndirectedNeighbors: could not find the "${t}" node in the graph.`);return this.type==="directed"?!1:n in r.undirected}areNeighbors(t,n){t=""+t,n=""+n;const r=this._nodes.get(t);if(!r)throw new De(`Graph.areNeighbors: could not find the "${t}" node in the graph.`);return this.type!=="undirected"&&(n in r.in||n in r.out)||this.type!=="directed"&&n in r.undirected}areInboundNeighbors(t,n){t=""+t,n=""+n;const r=this._nodes.get(t);if(!r)throw new De(`Graph.areInboundNeighbors: could not find the "${t}" node in the graph.`);return this.type!=="undirected"&&n in r.in||this.type!=="directed"&&n in r.undirected}areOutboundNeighbors(t,n){t=""+t,n=""+n;const r=this._nodes.get(t);if(!r)throw new De(`Graph.areOutboundNeighbors: could not find the "${t}" node in the graph.`);return this.type!=="undirected"&&n in r.out||this.type!=="directed"&&n in r.undirected}inDegree(t){t=""+t;const n=this._nodes.get(t);if(!n)throw new De(`Graph.inDegree: could not find the "${t}" node in the graph.`);return this.type==="undirected"?0:n.inDegree}outDegree(t){t=""+t;const n=this._nodes.get(t);if(!n)throw new De(`Graph.outDegree: could not find the "${t}" node in the graph.`);return this.type==="undirected"?0:n.outDegree}directedDegree(t){t=""+t;const n=this._nodes.get(t);if(!n)throw new De(`Graph.directedDegree: could not find the "${t}" node in the graph.`);return this.type==="undirected"?0:n.inDegree+n.outDegree}undirectedDegree(t){t=""+t;const n=this._nodes.get(t);if(!n)throw new De(`Graph.undirectedDegree: could not find the "${t}" node in the graph.`);return this.type==="directed"?0:n.undirectedDegree}inboundDegree(t){t=""+t;const n=this._nodes.get(t);if(!n)throw new De(`Graph.inboundDegree: could not find the "${t}" node in the graph.`);let r=0;return this.type!=="directed"&&(r+=n.undirectedDegree),this.type!=="undirected"&&(r+=n.inDegree),r}outboundDegree(t){t=""+t;const n=this._nodes.get(t);if(!n)throw new De(`Graph.outboundDegree: could not find the "${t}" node in the graph.`);let r=0;return this.type!=="directed"&&(r+=n.undirectedDegree),this.type!=="undirected"&&(r+=n.outDegree),r}degree(t){t=""+t;const n=this._nodes.get(t);if(!n)throw new De(`Graph.degree: could not find the "${t}" node in the graph.`);let r=0;return this.type!=="directed"&&(r+=n.undirectedDegree),this.type!=="undirected"&&(r+=n.inDegree+n.outDegree),r}inDegreeWithoutSelfLoops(t){t=""+t;const n=this._nodes.get(t);if(!n)throw new De(`Graph.inDegreeWithoutSelfLoops: could not find the "${t}" node in the graph.`);return this.type==="undirected"?0:n.inDegree-n.directedLoops}outDegreeWithoutSelfLoops(t){t=""+t;const n=this._nodes.get(t);if(!n)throw new De(`Graph.outDegreeWithoutSelfLoops: could not find the "${t}" node in the graph.`);return this.type==="undirected"?0:n.outDegree-n.directedLoops}directedDegreeWithoutSelfLoops(t){t=""+t;const n=this._nodes.get(t);if(!n)throw new De(`Graph.directedDegreeWithoutSelfLoops: could not find the "${t}" node in the graph.`);return this.type==="undirected"?0:n.inDegree+n.outDegree-n.directedLoops*2}undirectedDegreeWithoutSelfLoops(t){t=""+t;const n=this._nodes.get(t);if(!n)throw new De(`Graph.undirectedDegreeWithoutSelfLoops: could not find the "${t}" node in the graph.`);return this.type==="directed"?0:n.undirectedDegree-n.undirectedLoops*2}inboundDegreeWithoutSelfLoops(t){t=""+t;const n=this._nodes.get(t);if(!n)throw new De(`Graph.inboundDegreeWithoutSelfLoops: could not find the "${t}" node in the graph.`);let r=0,a=0;return this.type!=="directed"&&(r+=n.undirectedDegree,a+=n.undirectedLoops*2),this.type!=="undirected"&&(r+=n.inDegree,a+=n.directedLoops),r-a}outboundDegreeWithoutSelfLoops(t){t=""+t;const n=this._nodes.get(t);if(!n)throw new De(`Graph.outboundDegreeWithoutSelfLoops: could not find the "${t}" node in the graph.`);let r=0,a=0;return this.type!=="directed"&&(r+=n.undirectedDegree,a+=n.undirectedLoops*2),this.type!=="undirected"&&(r+=n.outDegree,a+=n.directedLoops),r-a}degreeWithoutSelfLoops(t){t=""+t;const n=this._nodes.get(t);if(!n)throw new De(`Graph.degreeWithoutSelfLoops: could not find the "${t}" node in the graph.`);let r=0,a=0;return this.type!=="directed"&&(r+=n.undirectedDegree,a+=n.undirectedLoops*2),this.type!=="undirected"&&(r+=n.inDegree+n.outDegree,a+=n.directedLoops*2),r-a}source(t){t=""+t;const n=this._edges.get(t);if(!n)throw new De(`Graph.source: could not find the "${t}" edge in the graph.`);return n.source.key}target(t){t=""+t;const n=this._edges.get(t);if(!n)throw new De(`Graph.target: could not find the "${t}" edge in the graph.`);return n.target.key}extremities(t){t=""+t;const n=this._edges.get(t);if(!n)throw new De(`Graph.extremities: could not find the "${t}" edge in the graph.`);return[n.source.key,n.target.key]}opposite(t,n){t=""+t,n=""+n;const r=this._edges.get(n);if(!r)throw new De(`Graph.opposite: could not find the "${n}" edge in the graph.`);const a=r.source.key,i=r.target.key;if(t===a)return i;if(t===i)return a;throw new De(`Graph.opposite: the "${t}" node is not attached to the "${n}" edge (${a}, ${i}).`)}hasExtremity(t,n){t=""+t,n=""+n;const r=this._edges.get(t);if(!r)throw new De(`Graph.hasExtremity: could not find the "${t}" edge in the graph.`);return r.source.key===n||r.target.key===n}isUndirected(t){t=""+t;const n=this._edges.get(t);if(!n)throw new De(`Graph.isUndirected: could not find the "${t}" edge in the graph.`);return n.undirected}isDirected(t){t=""+t;const n=this._edges.get(t);if(!n)throw new De(`Graph.isDirected: could not find the "${t}" edge in the graph.`);return!n.undirected}isSelfLoop(t){t=""+t;const n=this._edges.get(t);if(!n)throw new De(`Graph.isSelfLoop: could not find the "${t}" edge in the graph.`);return n.source===n.target}addNode(t,n){return jK(this,t,n).key}mergeNode(t,n){if(n&&!gn(n))throw new Le(`Graph.mergeNode: invalid attributes. Expecting an object but got "${n}"`);t=""+t,n=n||{};let r=this._nodes.get(t);return r?(n&&(Qt(r.attributes,n),this.emit("nodeAttributesUpdated",{type:"merge",key:t,attributes:r.attributes,data:n})),[t,!1]):(r=new this.NodeDataClass(t,n),this._nodes.set(t,r),this.emit("nodeAdded",{key:t,attributes:n}),[t,!0])}updateNode(t,n){if(n&&typeof n!="function")throw new Le(`Graph.updateNode: invalid updater function. Expecting a function but got "${n}"`);t=""+t;let r=this._nodes.get(t);if(r){if(n){const i=r.attributes;r.attributes=n(i),this.emit("nodeAttributesUpdated",{type:"replace",key:t,attributes:r.attributes})}return[t,!1]}const a=n?n({}):{};return r=new this.NodeDataClass(t,a),this._nodes.set(t,r),this.emit("nodeAdded",{key:t,attributes:a}),[t,!0]}dropNode(t){t=""+t;const n=this._nodes.get(t);if(!n)throw new De(`Graph.dropNode: could not find the "${t}" node in the graph.`);let r;if(this.type!=="undirected"){for(const a in n.out){r=n.out[a];do Qi(this,r),r=r.next;while(r)}for(const a in n.in){r=n.in[a];do Qi(this,r),r=r.next;while(r)}}if(this.type!=="directed")for(const a in n.undirected){r=n.undirected[a];do Qi(this,r),r=r.next;while(r)}this._nodes.delete(t),this.emit("nodeDropped",{key:t,attributes:n.attributes})}dropEdge(t){let n;if(arguments.length>1){const r=""+arguments[0],a=""+arguments[1];if(n=hr(this,r,a,this.type),!n)throw new De(`Graph.dropEdge: could not find the "${r}" -> "${a}" edge in the graph.`)}else if(t=""+t,n=this._edges.get(t),!n)throw new De(`Graph.dropEdge: could not find the "${t}" edge in the graph.`);return Qi(this,n),this}dropDirectedEdge(t,n){if(arguments.length<2)throw new Ze("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 Ze("Graph.dropDirectedEdge: cannot use a {source,target} combo when dropping an edge in a MultiGraph since we cannot infer the one you want to delete as there could be multiple ones.");t=""+t,n=""+n;const r=hr(this,t,n,"directed");if(!r)throw new De(`Graph.dropDirectedEdge: could not find a "${t}" -> "${n}" edge in the graph.`);return Qi(this,r),this}dropUndirectedEdge(t,n){if(arguments.length<2)throw new Ze("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 Ze("Graph.dropUndirectedEdge: cannot use a {source,target} combo when dropping an edge in a MultiGraph since we cannot infer the one you want to delete as there could be multiple ones.");const r=hr(this,t,n,"undirected");if(!r)throw new De(`Graph.dropUndirectedEdge: could not find a "${t}" -> "${n}" edge in the graph.`);return Qi(this,r),this}clear(){this._edges.clear(),this._nodes.clear(),this._resetInstanceCounters(),this.emit("cleared")}clearEdges(){const t=this._nodes.values();let n;for(;n=t.next(),n.done!==!0;)n.value.clear();this._edges.clear(),this._resetInstanceCounters(),this.emit("edgesCleared")}getAttribute(t){return this._attributes[t]}getAttributes(){return this._attributes}hasAttribute(t){return this._attributes.hasOwnProperty(t)}setAttribute(t,n){return this._attributes[t]=n,this.emit("attributesUpdated",{type:"set",attributes:this._attributes,name:t}),this}updateAttribute(t,n){if(typeof n!="function")throw new Le("Graph.updateAttribute: updater should be a function.");const r=this._attributes[t];return this._attributes[t]=n(r),this.emit("attributesUpdated",{type:"set",attributes:this._attributes,name:t}),this}removeAttribute(t){return delete this._attributes[t],this.emit("attributesUpdated",{type:"remove",attributes:this._attributes,name:t}),this}replaceAttributes(t){if(!gn(t))throw new Le("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(!gn(t))throw new Le("Graph.mergeAttributes: provided attributes are not a plain object.");return Qt(this._attributes,t),this.emit("attributesUpdated",{type:"merge",attributes:this._attributes,data:t}),this}updateAttributes(t){if(typeof t!="function")throw new Le("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 Le("Graph.updateEachNodeAttributes: expecting an updater function.");if(n&&!YR(n))throw new Le("Graph.updateEachNodeAttributes: invalid hints. Expecting an object having the following shape: {attributes?: [string]}");const r=this._nodes.values();let a,i;for(;a=r.next(),a.done!==!0;)i=a.value,i.attributes=t(i.key,i.attributes);this.emit("eachNodeAttributesUpdated",{hints:n||null})}updateEachEdgeAttributes(t,n){if(typeof t!="function")throw new Le("Graph.updateEachEdgeAttributes: expecting an updater function.");if(n&&!YR(n))throw new Le("Graph.updateEachEdgeAttributes: invalid hints. Expecting an object having the following shape: {attributes?: [string]}");const r=this._edges.values();let a,i,l,u;for(;a=r.next(),a.done!==!0;)i=a.value,l=i.source,u=i.target,i.attributes=t(i.key,i.attributes,l.key,u.key,l.attributes,u.attributes,i.undirected);this.emit("eachEdgeAttributesUpdated",{hints:n||null})}forEachAdjacencyEntry(t){if(typeof t!="function")throw new Le("Graph.forEachAdjacencyEntry: expecting a callback.");Vc(!1,!1,!1,this,t)}forEachAdjacencyEntryWithOrphans(t){if(typeof t!="function")throw new Le("Graph.forEachAdjacencyEntryWithOrphans: expecting a callback.");Vc(!1,!1,!0,this,t)}forEachAssymetricAdjacencyEntry(t){if(typeof t!="function")throw new Le("Graph.forEachAssymetricAdjacencyEntry: expecting a callback.");Vc(!1,!0,!1,this,t)}forEachAssymetricAdjacencyEntryWithOrphans(t){if(typeof t!="function")throw new Le("Graph.forEachAssymetricAdjacencyEntryWithOrphans: expecting a callback.");Vc(!1,!0,!0,this,t)}nodes(){return Array.from(this._nodes.keys())}forEachNode(t){if(typeof t!="function")throw new Le("Graph.forEachNode: expecting a callback.");const n=this._nodes.values();let r,a;for(;r=n.next(),r.done!==!0;)a=r.value,t(a.key,a.attributes)}findNode(t){if(typeof t!="function")throw new Le("Graph.findNode: expecting a callback.");const n=this._nodes.values();let r,a;for(;r=n.next(),r.done!==!0;)if(a=r.value,t(a.key,a.attributes))return a.key}mapNodes(t){if(typeof t!="function")throw new Le("Graph.mapNode: expecting a callback.");const n=this._nodes.values();let r,a;const i=new Array(this.order);let l=0;for(;r=n.next(),r.done!==!0;)a=r.value,i[l++]=t(a.key,a.attributes);return i}someNode(t){if(typeof t!="function")throw new Le("Graph.someNode: expecting a callback.");const n=this._nodes.values();let r,a;for(;r=n.next(),r.done!==!0;)if(a=r.value,t(a.key,a.attributes))return!0;return!1}everyNode(t){if(typeof t!="function")throw new Le("Graph.everyNode: expecting a callback.");const n=this._nodes.values();let r,a;for(;r=n.next(),r.done!==!0;)if(a=r.value,!t(a.key,a.attributes))return!1;return!0}filterNodes(t){if(typeof t!="function")throw new Le("Graph.filterNodes: expecting a callback.");const n=this._nodes.values();let r,a;const i=[];for(;r=n.next(),r.done!==!0;)a=r.value,t(a.key,a.attributes)&&i.push(a.key);return i}reduceNodes(t,n){if(typeof t!="function")throw new Le("Graph.reduceNodes: expecting a callback.");if(arguments.length<2)throw new Le("Graph.reduceNodes: missing initial value. You must provide it because the callback takes more than one argument and we cannot infer the initial value from the first iteration, as you could with a simple array.");let r=n;const a=this._nodes.values();let i,l;for(;i=a.next(),i.done!==!0;)l=i.value,r=t(r,l.key,l.attributes);return r}nodeEntries(){const t=this._nodes.values();return{[Symbol.iterator](){return this},next(){const n=t.next();if(n.done)return n;const r=n.value;return{value:{node:r.key,attributes:r.attributes},done:!1}}}}export(){const t=new Array(this._nodes.size);let n=0;this._nodes.forEach((a,i)=>{t[n++]=IK(i,a)});const r=new Array(this._edges.size);return n=0,this._edges.forEach((a,i)=>{r[n++]=LK(this.type,i,a)}),{options:{type:this.type,multi:this.multi,allowSelfLoops:this.allowSelfLoops},attributes:this.getAttributes(),nodes:t,edges:r}}import(t,n=!1){if(t instanceof Tt)return t.forEachNode((c,f)=>{n?this.mergeNode(c,f):this.addNode(c,f)}),t.forEachEdge((c,f,p,g,b,m,S)=>{n?S?this.mergeUndirectedEdgeWithKey(c,p,g,f):this.mergeDirectedEdgeWithKey(c,p,g,f):S?this.addUndirectedEdgeWithKey(c,p,g,f):this.addDirectedEdgeWithKey(c,p,g,f)}),this;if(!gn(t))throw new Le("Graph.import: invalid argument. Expecting a serialized graph or, alternatively, a Graph instance.");if(t.attributes){if(!gn(t.attributes))throw new Le("Graph.import: invalid attributes. Expecting a plain object.");n?this.mergeAttributes(t.attributes):this.replaceAttributes(t.attributes)}let r,a,i,l,u;if(t.nodes){if(i=t.nodes,!Array.isArray(i))throw new Le("Graph.import: invalid nodes. Expecting an array.");for(r=0,a=i.length;r{const i=Qt({},r.attributes);r=new n.NodeDataClass(a,i),n._nodes.set(a,r)}),n}copy(t){if(t=t||{},typeof t.type=="string"&&t.type!==this.type&&t.type!=="mixed")throw new Ze(`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 Ze("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 Ze("Graph.copy: cannot create an incompatible copy from a graph allowing self loops to one that does not because this would mean losing information about the current graph.");const n=this.emptyCopy(t),r=this._edges.values();let a,i;for(;a=r.next(),a.done!==!0;)i=a.value,DU(n,"copy",!1,i.undirected,i.key,i.source.key,i.target.key,Qt({},i.attributes));return n}toJSON(){return this.export()}toString(){return"[object Graph]"}inspect(){const t={};this._nodes.forEach((i,l)=>{t[l]=i.attributes});const n={},r={};this._edges.forEach((i,l)=>{const u=i.undirected?"--":"->";let c="",f=i.source.key,p=i.target.key,g;i.undirected&&f>p&&(g=f,f=p,p=g);const b=`(${f})${u}(${p})`;l.startsWith("geid_")?this.multi&&(typeof r[b]>"u"?r[b]=0:r[b]++,c+=`${r[b]}. `):c+=`[${l}]: `,c+=b,n[c]=i.attributes});const a={};for(const i in this)this.hasOwnProperty(i)&&!KR.has(i)&&typeof this[i]!="function"&&typeof i!="symbol"&&(a[i]=this[i]);return a.attributes=this._attributes,a.nodes=t,a.edges=n,pr(a,"constructor",this.constructor),a}}typeof Symbol<"u"&&(Tt.prototype[Symbol.for("nodejs.util.inspect.custom")]=Tt.prototype.inspect);BK.forEach(e=>{["add","merge","update"].forEach(t=>{const n=e.name(t),r=t==="add"?DU:GK;e.generateKey?Tt.prototype[n]=function(a,i,l){return r(this,n,!0,(e.type||this.type)==="undirected",null,a,i,l,t==="update")}:Tt.prototype[n]=function(a,i,l,u){return r(this,n,!1,(e.type||this.type)==="undirected",a,i,l,u,t==="update")}})});ZY(Tt);sK(Tt);kK(Tt);DK(Tt);class tu extends Tt{constructor(t){const n=Qt({type:"directed"},t);if("multi"in n&&n.multi!==!1)throw new Le("DirectedGraph.from: inconsistent indication that the graph should be multi in given options!");if(n.type!=="directed")throw new Le('DirectedGraph.from: inconsistent "'+n.type+'" type in given options!');super(n)}}class IU extends Tt{constructor(t){const n=Qt({type:"undirected"},t);if("multi"in n&&n.multi!==!1)throw new Le("UndirectedGraph.from: inconsistent indication that the graph should be multi in given options!");if(n.type!=="undirected")throw new Le('UndirectedGraph.from: inconsistent "'+n.type+'" type in given options!');super(n)}}class LU extends Tt{constructor(t){const n=Qt({multi:!0},t);if("multi"in n&&n.multi!==!0)throw new Le("MultiGraph.from: inconsistent indication that the graph should be simple in given options!");super(n)}}class MU extends Tt{constructor(t){const n=Qt({type:"directed",multi:!0},t);if("multi"in n&&n.multi!==!0)throw new Le("MultiDirectedGraph.from: inconsistent indication that the graph should be simple in given options!");if(n.type!=="directed")throw new Le('MultiDirectedGraph.from: inconsistent "'+n.type+'" type in given options!');super(n)}}class FU extends Tt{constructor(t){const n=Qt({type:"undirected",multi:!0},t);if("multi"in n&&n.multi!==!0)throw new Le("MultiUndirectedGraph.from: inconsistent indication that the graph should be simple in given options!");if(n.type!=="undirected")throw new Le('MultiUndirectedGraph.from: inconsistent "'+n.type+'" type in given options!');super(n)}}function Dl(e){e.from=function(t,n){const r=Qt({},t.options,n),a=new e(r);return a.import(t),a}}Dl(Tt);Dl(tu);Dl(IU);Dl(LU);Dl(MU);Dl(FU);Tt.Graph=Tt;Tt.DirectedGraph=tu;Tt.UndirectedGraph=IU;Tt.MultiGraph=LU;Tt.MultiDirectedGraph=MU;Tt.MultiUndirectedGraph=FU;Tt.InvalidArgumentsGraphError=Le;Tt.NotFoundGraphError=De;Tt.UsageGraphError=Ze;function HK(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function Ws(e){var t=HK(e,"string");return typeof t=="symbol"?t:t+""}function on(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ZR(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,r=Array(t);n>8&255,i=n>>16&255,l=n>>24&255;return[r,a,i,l]}var Th={};function GU(e){if(typeof Th[e]<"u")return Th[e];var t=(e&16711680)>>>16,n=(e&65280)>>>8,r=e&255,a=255,i=jU(t,n,r,a);return Th[e]=i,i}function QR(e,t,n,r){return n+(t<<8)+(e<<16)}function JR(e,t,n,r,a,i){var l=Math.floor(n/i*a),u=Math.floor(e.drawingBufferHeight/i-r/i*a),c=new Uint8Array(4);e.bindFramebuffer(e.FRAMEBUFFER,t),e.readPixels(l,u,1,1,e.RGBA,e.UNSIGNED_BYTE,c);var f=vl(c,4),p=f[0],g=f[1],b=f[2],m=f[3];return[p,g,b,m]}function _e(e,t,n){return(t=Ws(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function eC(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function Be(e){for(var t=1;tC){var T="…";for(f=f+T,N=e.measureText(f).width;N>C&&f.length>1;)f=f.slice(0,-2)+T,N=e.measureText(f).width;if(f.length<4)return}var O;x>0?_>0?O=Math.acos(x/C):O=Math.asin(_/C):_>0?O=Math.acos(x/C)+Math.PI:O=Math.asin(x/C)+Math.PI/2,e.save(),e.translate(A,R),e.rotate(O),e.fillText(f,-N/2,t.size/2+i),e.restore()}}}function WU(e,t,n){if(t.label){var r=n.labelSize,a=n.labelFont,i=n.labelWeight,l=n.labelColor.attribute?t[n.labelColor.attribute]||n.labelColor.color||"#000":n.labelColor.color;e.fillStyle=l,e.font="".concat(i," ").concat(r,"px ").concat(a),e.fillText(t.label,t.x+t.size+3,t.y+r/3)}}function iX(e,t,n){var r=n.labelSize,a=n.labelFont,i=n.labelWeight;e.font="".concat(i," ").concat(r,"px ").concat(a),e.fillStyle="#FFF",e.shadowOffsetX=0,e.shadowOffsetY=0,e.shadowBlur=8,e.shadowColor="#000";var l=2;if(typeof t.label=="string"){var u=e.measureText(t.label).width,c=Math.round(u+5),f=Math.round(r+2*l),p=Math.max(t.size,r/2)+l,g=Math.asin(f/2/p),b=Math.sqrt(Math.abs(Math.pow(p,2)-Math.pow(f/2,2)));e.beginPath(),e.moveTo(t.x+b,t.y+f/2),e.lineTo(t.x+p+c,t.y+f/2),e.lineTo(t.x+p+c,t.y-f/2),e.lineTo(t.x+b,t.y-f/2),e.arc(t.x,t.y,p,g,-g),e.closePath(),e.fill()}else e.beginPath(),e.arc(t.x,t.y,t.size+l,0,Math.PI*2),e.closePath(),e.fill();e.shadowOffsetX=0,e.shadowOffsetY=0,e.shadowBlur=0,WU(e,t,n)}var lX=` +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 +} +`,sX=lX,uX=` +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; +} +`,cX=uX,YU=WebGLRenderingContext,aC=YU.UNSIGNED_BYTE,Rh=YU.FLOAT,dX=["u_sizeRatio","u_correctionRatio","u_matrix"],vu=function(e){function t(){return on(this,t),Bn(this,t,arguments)}return Un(t,e),ln(t,[{key:"getDefinition",value:function(){return{VERTICES:3,VERTEX_SHADER_SOURCE:cX,FRAGMENT_SHADER_SOURCE:sX,METHOD:WebGLRenderingContext.TRIANGLES,UNIFORMS:dX,ATTRIBUTES:[{name:"a_position",size:2,type:Rh},{name:"a_size",size:1,type:Rh},{name:"a_color",size:4,type:aC,normalized:!0},{name:"a_id",size:4,type:aC,normalized:!0}],CONSTANT_ATTRIBUTES:[{name:"a_angle",size:1,type:Rh}],CONSTANT_DATA:[[t.ANGLE_1],[t.ANGLE_2],[t.ANGLE_3]]}}},{key:"processVisibleItem",value:function(r,a,i){var l=this.array,u=Qr(i.color);l[a++]=i.x,l[a++]=i.y,l[a++]=i.size,l[a++]=u,l[a++]=r}},{key:"setUniforms",value:function(r,a){var i=a.gl,l=a.uniformLocations,u=l.u_sizeRatio,c=l.u_correctionRatio,f=l.u_matrix;i.uniform1f(c,r.correctionRatio),i.uniform1f(u,r.sizeRatio),i.uniformMatrix3fv(f,!1,r.matrix)}}])}(p0);_e(vu,"ANGLE_1",0);_e(vu,"ANGLE_2",2*Math.PI/3);_e(vu,"ANGLE_3",4*Math.PI/3);var fX=` +precision mediump float; + +varying vec4 v_color; + +void main(void) { + gl_FragColor = v_color; +} +`,pX=fX,gX=` +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; +} +`,hX=gX,KU=WebGLRenderingContext,oC=KU.UNSIGNED_BYTE,Yc=KU.FLOAT,mX=["u_matrix","u_sizeRatio","u_correctionRatio","u_minEdgeThickness","u_lengthToThicknessRatio","u_widenessToThicknessRatio"],Su={extremity:"target",lengthToThicknessRatio:2.5,widenessToThicknessRatio:2};function Pd(e){var t=Be(Be({},Su),e||{});return function(n){function r(){return on(this,r),Bn(this,r,arguments)}return Un(r,n),ln(r,[{key:"getDefinition",value:function(){return{VERTICES:3,VERTEX_SHADER_SOURCE:hX,FRAGMENT_SHADER_SOURCE:pX,METHOD:WebGLRenderingContext.TRIANGLES,UNIFORMS:mX,ATTRIBUTES:[{name:"a_position",size:2,type:Yc},{name:"a_normal",size:2,type:Yc},{name:"a_radius",size:1,type:Yc},{name:"a_color",size:4,type:oC,normalized:!0},{name:"a_id",size:4,type:oC,normalized:!0}],CONSTANT_ATTRIBUTES:[{name:"a_barycentric",size:3,type:Yc}],CONSTANT_DATA:[[1,0,0],[0,1,0],[0,0,1]]}}},{key:"processVisibleItem",value:function(i,l,u,c,f){if(t.extremity==="source"){var p=[c,u];u=p[0],c=p[1]}var g=f.size||1,b=c.size||1,m=u.x,S=u.y,v=c.x,A=c.y,R=Qr(f.color),x=v-m,_=A-S,C=x*x+_*_,N=0,T=0;C&&(C=1/Math.sqrt(C),N=-_*C*g,T=x*C*g);var O=this.array;O[l++]=v,O[l++]=A,O[l++]=-N,O[l++]=-T,O[l++]=b,O[l++]=R,O[l++]=i}},{key:"setUniforms",value:function(i,l){var u=l.gl,c=l.uniformLocations,f=c.u_matrix,p=c.u_sizeRatio,g=c.u_correctionRatio,b=c.u_minEdgeThickness,m=c.u_lengthToThicknessRatio,S=c.u_widenessToThicknessRatio;u.uniformMatrix3fv(f,!1,i.matrix),u.uniform1f(p,i.sizeRatio),u.uniform1f(g,i.correctionRatio),u.uniform1f(b,i.minEdgeThickness),u.uniform1f(m,t.lengthToThicknessRatio),u.uniform1f(S,t.widenessToThicknessRatio)}}])}(yu)}Pd();var bX=` +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 +} +`,g0=bX,yX=` +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; +} +`,vX=yX,XU=WebGLRenderingContext,iC=XU.UNSIGNED_BYTE,Ko=XU.FLOAT,SX=["u_matrix","u_zoomRatio","u_sizeRatio","u_correctionRatio","u_pixelRatio","u_feather","u_minEdgeThickness","u_lengthToThicknessRatio"],EX={lengthToThicknessRatio:Su.lengthToThicknessRatio};function ZU(e){var t=Be(Be({},EX),{});return function(n){function r(){return on(this,r),Bn(this,r,arguments)}return Un(r,n),ln(r,[{key:"getDefinition",value:function(){return{VERTICES:6,VERTEX_SHADER_SOURCE:vX,FRAGMENT_SHADER_SOURCE:g0,METHOD:WebGLRenderingContext.TRIANGLES,UNIFORMS:SX,ATTRIBUTES:[{name:"a_positionStart",size:2,type:Ko},{name:"a_positionEnd",size:2,type:Ko},{name:"a_normal",size:2,type:Ko},{name:"a_color",size:4,type:iC,normalized:!0},{name:"a_id",size:4,type:iC,normalized:!0},{name:"a_radius",size:1,type:Ko}],CONSTANT_ATTRIBUTES:[{name:"a_positionCoef",size:1,type:Ko},{name:"a_normalCoef",size:1,type:Ko},{name:"a_radiusCoef",size:1,type:Ko}],CONSTANT_DATA:[[0,1,0],[0,-1,0],[1,1,1],[1,1,1],[0,-1,0],[1,-1,-1]]}}},{key:"processVisibleItem",value:function(i,l,u,c,f){var p=f.size||1,g=u.x,b=u.y,m=c.x,S=c.y,v=Qr(f.color),A=m-g,R=S-b,x=c.size||1,_=A*A+R*R,C=0,N=0;_&&(_=1/Math.sqrt(_),C=-R*_*p,N=A*_*p);var T=this.array;T[l++]=g,T[l++]=b,T[l++]=m,T[l++]=S,T[l++]=C,T[l++]=N,T[l++]=v,T[l++]=i,T[l++]=x}},{key:"setUniforms",value:function(i,l){var u=l.gl,c=l.uniformLocations,f=c.u_matrix,p=c.u_zoomRatio,g=c.u_feather,b=c.u_pixelRatio,m=c.u_correctionRatio,S=c.u_sizeRatio,v=c.u_minEdgeThickness,A=c.u_lengthToThicknessRatio;u.uniformMatrix3fv(f,!1,i.matrix),u.uniform1f(p,i.zoomRatio),u.uniform1f(S,i.sizeRatio),u.uniform1f(m,i.correctionRatio),u.uniform1f(b,i.pixelRatio),u.uniform1f(g,i.antiAliasingFeather),u.uniform1f(v,i.minEdgeThickness),u.uniform1f(A,t.lengthToThicknessRatio)}}])}(yu)}ZU();function wX(e){return VU([ZU(),Pd(e)])}var xX=wX(),QU=xX,kX=` +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; +} +`,AX=kX,JU=WebGLRenderingContext,lC=JU.UNSIGNED_BYTE,zs=JU.FLOAT,TX=["u_matrix","u_zoomRatio","u_sizeRatio","u_correctionRatio","u_pixelRatio","u_feather","u_minEdgeThickness"],_X=function(e){function t(){return on(this,t),Bn(this,t,arguments)}return Un(t,e),ln(t,[{key:"getDefinition",value:function(){return{VERTICES:6,VERTEX_SHADER_SOURCE:AX,FRAGMENT_SHADER_SOURCE:g0,METHOD:WebGLRenderingContext.TRIANGLES,UNIFORMS:TX,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:lC,normalized:!0},{name:"a_id",size:4,type:lC,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(r,a,i,l,u){var c=u.size||1,f=i.x,p=i.y,g=l.x,b=l.y,m=Qr(u.color),S=g-f,v=b-p,A=S*S+v*v,R=0,x=0;A&&(A=1/Math.sqrt(A),R=-v*A*c,x=S*A*c);var _=this.array;_[a++]=f,_[a++]=p,_[a++]=g,_[a++]=b,_[a++]=R,_[a++]=x,_[a++]=m,_[a++]=r}},{key:"setUniforms",value:function(r,a){var i=a.gl,l=a.uniformLocations,u=l.u_matrix,c=l.u_zoomRatio,f=l.u_feather,p=l.u_pixelRatio,g=l.u_correctionRatio,b=l.u_sizeRatio,m=l.u_minEdgeThickness;i.uniformMatrix3fv(u,!1,r.matrix),i.uniform1f(c,r.zoomRatio),i.uniform1f(b,r.sizeRatio),i.uniform1f(g,r.correctionRatio),i.uniform1f(p,r.pixelRatio),i.uniform1f(f,r.antiAliasingFeather),i.uniform1f(m,r.minEdgeThickness)}}])}(yu),h0=function(e){function t(){var n;return on(this,t),n=Bn(this,t),n.rawEmitter=n,n}return Un(t,e),ln(t)}(xU.EventEmitter),Ch,sC;function Jr(){return sC||(sC=1,Ch=function(t){return t!==null&&typeof t=="object"&&typeof t.addUndirectedEdgeWithKey=="function"&&typeof t.dropNode=="function"&&typeof t.multi=="boolean"}),Ch}var RX=Jr();const CX=an(RX);var NX=function(t){return t},OX=function(t){return t*t},DX=function(t){return t*(2-t)},IX=function(t){return(t*=2)<1?.5*t*t:-.5*(--t*(t-2)-1)},LX=function(t){return t*t*t},MX=function(t){return--t*t*t+1},FX=function(t){return(t*=2)<1?.5*t*t*t:.5*((t-=2)*t*t+2)},e3={linear:NX,quadraticIn:OX,quadraticOut:DX,quadraticInOut:IX,cubicIn:LX,cubicOut:MX,cubicInOut:FX},t3={easing:"quadraticInOut",duration:150};function zX(e,t,n,r){var a=Object.assign({},t3,n),i=typeof a.easing=="function"?a.easing:e3[a.easing],l=Date.now(),u={};for(var c in t){var f=t[c];u[c]={};for(var p in f)u[c][p]=e.getNodeAttribute(c,p)}var g=null,b=function(){g=null;var S=(Date.now()-l)/a.duration;if(S>=1){for(var v in t){var A=t[v];for(var R in A)e.setNodeAttribute(v,R,A[R])}return}S=i(S);for(var x in t){var _=t[x],C=u[x];for(var N in _)e.setNodeAttribute(x,N,_[N]*S+C[N]*(1-S))}g=requestAnimationFrame(b)};return b(),function(){g&&cancelAnimationFrame(g)}}function _r(){return Float32Array.of(1,0,0,0,1,0,0,0,1)}function Kc(e,t,n){return e[0]=t,e[4]=typeof n=="number"?n:t,e}function uC(e,t){var n=Math.sin(t),r=Math.cos(t);return e[0]=r,e[1]=n,e[3]=-n,e[4]=r,e}function cC(e,t,n){return e[6]=t,e[7]=n,e}function io(e,t){var n=e[0],r=e[1],a=e[2],i=e[3],l=e[4],u=e[5],c=e[6],f=e[7],p=e[8],g=t[0],b=t[1],m=t[2],S=t[3],v=t[4],A=t[5],R=t[6],x=t[7],_=t[8];return e[0]=g*n+b*i+m*c,e[1]=g*r+b*l+m*f,e[2]=g*a+b*u+m*p,e[3]=S*n+v*i+A*c,e[4]=S*r+v*l+A*f,e[5]=S*a+v*u+A*p,e[6]=R*n+x*i+_*c,e[7]=R*r+x*l+_*f,e[8]=R*a+x*u+_*p,e}function Mx(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,r=e[0],a=e[1],i=e[3],l=e[4],u=e[6],c=e[7],f=t.x,p=t.y;return{x:f*r+p*i+u*n,y:f*a+p*l+c*n}}function PX(e,t){var n=e.height/e.width,r=t.height/t.width;return n<1&&r>1||n>1&&r<1?1:Math.min(Math.max(r,1/r),Math.max(1/n,n))}function Ps(e,t,n,r,a){var i=e.angle,l=e.ratio,u=e.x,c=e.y,f=t.width,p=t.height,g=_r(),b=Math.min(f,p)-2*r,m=PX(t,n);return a?(io(g,cC(_r(),u,c)),io(g,Kc(_r(),l)),io(g,uC(_r(),i)),io(g,Kc(_r(),f/b/2/m,p/b/2/m))):(io(g,Kc(_r(),2*(b/f)*m,2*(b/p)*m)),io(g,uC(_r(),-i)),io(g,Kc(_r(),1/l)),io(g,cC(_r(),-u,-c))),g}function BX(e,t,n){var r=Mx(e,{x:Math.cos(t.angle),y:Math.sin(t.angle)},0),a=r.x,i=r.y;return 1/Math.sqrt(Math.pow(a,2)+Math.pow(i,2))/n.width}function UX(e){if(!e.order)return{x:[0,1],y:[0,1]};var t=1/0,n=-1/0,r=1/0,a=-1/0;return e.forEachNode(function(i,l){var u=l.x,c=l.y;un&&(n=u),ca&&(a=c)}),{x:[t,n],y:[r,a]}}function jX(e){if(!CX(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 GX(e,t,n){var r=document.createElement(e);if(t)for(var a in t)r.style[a]=t[a];if(n)for(var i in n)r.setAttribute(i,n[i]);return r}function dC(){return typeof window.devicePixelRatio<"u"?window.devicePixelRatio:1}function fC(e,t,n){return n.sort(function(r,a){var i=t(r)||0,l=t(a)||0;return il?1:0})}function pC(e){var t=vl(e.x,2),n=t[0],r=t[1],a=vl(e.y,2),i=a[0],l=a[1],u=Math.max(r-n,l-i),c=(r+n)/2,f=(l+i)/2;(u===0||Math.abs(u)===1/0||isNaN(u))&&(u=1),isNaN(c)&&(c=0),isNaN(f)&&(f=0);var p=function(b){return{x:.5+(b.x-c)/u,y:.5+(b.y-f)/u}};return p.applyTo=function(g){g.x=.5+(g.x-c)/u,g.y=.5+(g.y-f)/u},p.inverse=function(g){return{x:c+u*(g.x-.5),y:f+u*(g.y-.5)}},p.ratio=u,p}function Fx(e){"@babel/helpers - typeof";return Fx=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},Fx(e)}function gC(e,t){var n=t.size;if(n!==0){var r=e.length;e.length+=n;var a=0;t.forEach(function(i){e[r+a]=i,a++})}}function Nh(e){e=e||{};for(var t=0,n=arguments.length<=1?0:arguments.length-1;t1&&arguments[1]!==void 0?arguments[1]:{},l=arguments.length>2?arguments[2]:void 0;if(!l)return new Promise(function(m){return a.animate(r,i,m)});if(this.enabled){var u=Be(Be({},t3),i),c=this.validateState(r),f=typeof u.easing=="function"?u.easing:e3[u.easing],p=Date.now(),g=this.getState(),b=function(){var S=(Date.now()-p)/u.duration;if(S>=1){a.nextFrame=null,a.setState(c),a.animationCallback&&(a.animationCallback.call(null),a.animationCallback=void 0);return}var v=f(S),A={};typeof c.x=="number"&&(A.x=g.x+(c.x-g.x)*v),typeof c.y=="number"&&(A.y=g.y+(c.y-g.y)*v),a.enabledRotation&&typeof c.angle=="number"&&(A.angle=g.angle+(c.angle-g.angle)*v),typeof c.ratio=="number"&&(A.ratio=g.ratio+(c.ratio-g.ratio)*v),a.setState(A),a.nextFrame=requestAnimationFrame(b)};this.nextFrame?(cancelAnimationFrame(this.nextFrame),this.animationCallback&&this.animationCallback.call(null),this.nextFrame=requestAnimationFrame(b)):b(),this.animationCallback=l}}},{key:"animatedZoom",value:function(r){return r?typeof r=="number"?this.animate({ratio:this.ratio/r}):this.animate({ratio:this.ratio/(r.factor||Xc)},r):this.animate({ratio:this.ratio/Xc})}},{key:"animatedUnzoom",value:function(r){return r?typeof r=="number"?this.animate({ratio:this.ratio*r}):this.animate({ratio:this.ratio*(r.factor||Xc)},r):this.animate({ratio:this.ratio*Xc})}},{key:"animatedReset",value:function(r){return this.animate({x:.5,y:.5,ratio:1,angle:0},r)}},{key:"copy",value:function(){return t.from(this.getState())}}],[{key:"from",value:function(r){var a=new t;return a.setState(r)}}])}(h0);function Cr(e,t){var n=t.getBoundingClientRect();return{x:e.clientX-n.left,y:e.clientY-n.top}}function Aa(e,t){var n=Be(Be({},Cr(e,t)),{},{sigmaDefaultPrevented:!1,preventSigmaDefault:function(){n.sigmaDefaultPrevented=!0},original:e});return n}function Bs(e){var t="x"in e?e:Be(Be({},e.touches[0]||e.previousTouches[0]),{},{original:e.original,sigmaDefaultPrevented:e.sigmaDefaultPrevented,preventSigmaDefault:function(){e.sigmaDefaultPrevented=!0,t.sigmaDefaultPrevented=!0}});return t}function VX(e,t){return Be(Be({},Aa(e,t)),{},{delta:n3(e)})}var WX=2;function vd(e){for(var t=[],n=0,r=Math.min(e.length,WX);n0;a.draggedEvents=0,g&&a.renderer.getSetting("hideEdgesOnMove")&&a.renderer.refresh()},0),this.emit("mouseup",Aa(r,this.container))}}},{key:"handleMove",value:function(r){var a=this;if(this.enabled){var i=Aa(r,this.container);if(this.emit("mousemovebody",i),(r.target===this.container||r.composedPath()[0]===this.container)&&this.emit("mousemove",i),!i.sigmaDefaultPrevented&&this.isMouseDown){this.isMoving=!0,this.draggedEvents++,typeof this.movingTimeout=="number"&&clearTimeout(this.movingTimeout),this.movingTimeout=window.setTimeout(function(){a.movingTimeout=null,a.isMoving=!1},this.settings.dragTimeout);var l=this.renderer.getCamera(),u=Cr(r,this.container),c=u.x,f=u.y,p=this.renderer.viewportToFramedGraph({x:this.lastMouseX,y:this.lastMouseY}),g=this.renderer.viewportToFramedGraph({x:c,y:f}),b=p.x-g.x,m=p.y-g.y,S=l.getState(),v=S.x+b,A=S.y+m;l.setState({x:v,y:A}),this.lastMouseX=c,this.lastMouseY=f,r.preventDefault(),r.stopPropagation()}}}},{key:"handleLeave",value:function(r){this.emit("mouseleave",Aa(r,this.container))}},{key:"handleEnter",value:function(r){this.emit("mouseenter",Aa(r,this.container))}},{key:"handleWheel",value:function(r){var a=this,i=this.renderer.getCamera();if(!(!this.enabled||!i.enabledZooming)){var l=n3(r);if(l){var u=VX(r,this.container);if(this.emit("wheel",u),u.sigmaDefaultPrevented){r.preventDefault(),r.stopPropagation();return}var c=i.getState().ratio,f=l>0?1/this.settings.zoomingRatio:this.settings.zoomingRatio,p=i.getBoundedRatio(c*f),g=l>0?1:-1,b=Date.now();c!==p&&(r.preventDefault(),r.stopPropagation(),!(this.currentWheelDirection===g&&this.lastWheelTriggerTime&&b-this.lastWheelTriggerTimer.size?-1:n.sizer.key?1:-1}}])}(),yC=function(){function e(){on(this,e),_e(this,"width",0),_e(this,"height",0),_e(this,"cellSize",0),_e(this,"columns",0),_e(this,"rows",0),_e(this,"cells",{})}return ln(e,[{key:"resizeAndClear",value:function(n,r){this.width=n.width,this.height=n.height,this.cellSize=r,this.columns=Math.ceil(n.width/r),this.rows=Math.ceil(n.height/r),this.cells={}}},{key:"getIndex",value:function(n){var r=Math.floor(n.x/this.cellSize),a=Math.floor(n.y/this.cellSize);return a*this.columns+r}},{key:"add",value:function(n,r,a){var i=new bC(n,r),l=this.getIndex(a),u=this.cells[l];u||(u=[],this.cells[l]=u),u.push(i)}},{key:"organize",value:function(){for(var n in this.cells){var r=this.cells[n];r.sort(bC.compare)}}},{key:"getLabelsToDisplay",value:function(n,r){var a=this.cellSize*this.cellSize,i=a/n/n,l=i*r/a,u=Math.ceil(l),c=[];for(var f in this.cells)for(var p=this.cells[f],g=0;g2&&arguments[2]!==void 0?arguments[2]:{};if(on(this,t),a=Bn(this,t),_e(a,"elements",{}),_e(a,"canvasContexts",{}),_e(a,"webGLContexts",{}),_e(a,"pickingLayers",new Set),_e(a,"textures",{}),_e(a,"frameBuffers",{}),_e(a,"activeListeners",{}),_e(a,"labelGrid",new yC),_e(a,"nodeDataCache",{}),_e(a,"edgeDataCache",{}),_e(a,"nodeProgramIndex",{}),_e(a,"edgeProgramIndex",{}),_e(a,"nodesWithForcedLabels",new Set),_e(a,"edgesWithForcedLabels",new Set),_e(a,"nodeExtent",{x:[0,1],y:[0,1]}),_e(a,"nodeZExtent",[1/0,-1/0]),_e(a,"edgeZExtent",[1/0,-1/0]),_e(a,"matrix",_r()),_e(a,"invMatrix",_r()),_e(a,"correctionRatio",1),_e(a,"customBBox",null),_e(a,"normalizationFunction",pC({x:[0,1],y:[0,1]})),_e(a,"graphToViewportRatio",1),_e(a,"itemIDsIndex",{}),_e(a,"nodeIndices",{}),_e(a,"edgeIndices",{}),_e(a,"width",0),_e(a,"height",0),_e(a,"pixelRatio",dC()),_e(a,"pickingDownSizingRatio",2*a.pixelRatio),_e(a,"displayedNodeLabels",new Set),_e(a,"displayedEdgeLabels",new Set),_e(a,"highlightedNodes",new Set),_e(a,"hoveredNode",null),_e(a,"hoveredEdge",null),_e(a,"renderFrame",null),_e(a,"renderHighlightedNodesFrame",null),_e(a,"needToProcess",!1),_e(a,"checkEdgesEventsFrame",null),_e(a,"nodePrograms",{}),_e(a,"nodeHoverPrograms",{}),_e(a,"edgePrograms",{}),a.settings=qX(i),Oh(a.settings),jX(n),!(r instanceof HTMLElement))throw new Error("Sigma: container should be an html element.");a.graph=n,a.container=r,a.createWebGLContext("edges",{picking:i.enableEdgeEvents}),a.createCanvasContext("edgeLabels"),a.createWebGLContext("nodes",{picking:!0}),a.createCanvasContext("labels"),a.createCanvasContext("hovers"),a.createWebGLContext("hoverNodes"),a.createCanvasContext("mouse",{style:{touchAction:"none",userSelect:"none"}}),a.resize();for(var l in a.settings.nodeProgramClasses)a.registerNodeProgram(l,a.settings.nodeProgramClasses[l],a.settings.nodeHoverProgramClasses[l]);for(var u in a.settings.edgeProgramClasses)a.registerEdgeProgram(u,a.settings.edgeProgramClasses[u]);return a.camera=new hC,a.bindCameraHandlers(),a.mouseCaptor=new XX(a.elements.mouse,a),a.mouseCaptor.setSettings(a.settings),a.touchCaptor=new JX(a.elements.mouse,a),a.touchCaptor.setSettings(a.settings),a.bindEventHandlers(),a.bindGraphHandlers(),a.handleSettingsUpdate(),a.refresh(),a}return Un(t,e),ln(t,[{key:"registerNodeProgram",value:function(r,a,i){return this.nodePrograms[r]&&this.nodePrograms[r].kill(),this.nodeHoverPrograms[r]&&this.nodeHoverPrograms[r].kill(),this.nodePrograms[r]=new a(this.webGLContexts.nodes,this.frameBuffers.nodes,this),this.nodeHoverPrograms[r]=new(i||a)(this.webGLContexts.hoverNodes,null,this),this}},{key:"registerEdgeProgram",value:function(r,a){return this.edgePrograms[r]&&this.edgePrograms[r].kill(),this.edgePrograms[r]=new a(this.webGLContexts.edges,this.frameBuffers.edges,this),this}},{key:"unregisterNodeProgram",value:function(r){if(this.nodePrograms[r]){var a=this.nodePrograms,i=a[r],l=Dh(a,[r].map(Ws));i.kill(),this.nodePrograms=l}if(this.nodeHoverPrograms[r]){var u=this.nodeHoverPrograms,c=u[r],f=Dh(u,[r].map(Ws));c.kill(),this.nodePrograms=f}return this}},{key:"unregisterEdgeProgram",value:function(r){if(this.edgePrograms[r]){var a=this.edgePrograms,i=a[r],l=Dh(a,[r].map(Ws));i.kill(),this.edgePrograms=l}return this}},{key:"resetWebGLTexture",value:function(r){var a=this.webGLContexts[r],i=this.frameBuffers[r],l=this.textures[r];l&&a.deleteTexture(l);var u=a.createTexture();return a.bindFramebuffer(a.FRAMEBUFFER,i),a.bindTexture(a.TEXTURE_2D,u),a.texImage2D(a.TEXTURE_2D,0,a.RGBA,this.width,this.height,0,a.RGBA,a.UNSIGNED_BYTE,null),a.framebufferTexture2D(a.FRAMEBUFFER,a.COLOR_ATTACHMENT0,a.TEXTURE_2D,u,0),this.textures[r]=u,this}},{key:"bindCameraHandlers",value:function(){var r=this;return this.activeListeners.camera=function(){r.scheduleRender()},this.camera.on("updated",this.activeListeners.camera),this}},{key:"unbindCameraHandlers",value:function(){return this.camera.removeListener("updated",this.activeListeners.camera),this}},{key:"getNodeAtPosition",value:function(r){var a=r.x,i=r.y,l=JR(this.webGLContexts.nodes,this.frameBuffers.nodes,a,i,this.pixelRatio,this.pickingDownSizingRatio),u=QR.apply(void 0,mC(l)),c=this.itemIDsIndex[u];return c&&c.type==="node"?c.id:null}},{key:"bindEventHandlers",value:function(){var r=this;this.activeListeners.handleResize=function(){r.scheduleRefresh()},window.addEventListener("resize",this.activeListeners.handleResize),this.activeListeners.handleMove=function(i){var l=Bs(i),u={event:l,preventSigmaDefault:function(){l.preventSigmaDefault()}},c=r.getNodeAtPosition(l);if(c&&r.hoveredNode!==c&&!r.nodeDataCache[c].hidden){r.hoveredNode&&r.emit("leaveNode",Be(Be({},u),{},{node:r.hoveredNode})),r.hoveredNode=c,r.emit("enterNode",Be(Be({},u),{},{node:c})),r.scheduleHighlightedNodesRender();return}if(r.hoveredNode&&r.getNodeAtPosition(l)!==r.hoveredNode){var f=r.hoveredNode;r.hoveredNode=null,r.emit("leaveNode",Be(Be({},u),{},{node:f})),r.scheduleHighlightedNodesRender();return}if(r.settings.enableEdgeEvents){var p=r.hoveredNode?null:r.getEdgeAtPoint(u.event.x,u.event.y);p!==r.hoveredEdge&&(r.hoveredEdge&&r.emit("leaveEdge",Be(Be({},u),{},{edge:r.hoveredEdge})),p&&r.emit("enterEdge",Be(Be({},u),{},{edge:p})),r.hoveredEdge=p)}},this.activeListeners.handleMoveBody=function(i){var l=Bs(i);r.emit("moveBody",{event:l,preventSigmaDefault:function(){l.preventSigmaDefault()}})},this.activeListeners.handleLeave=function(i){var l=Bs(i),u={event:l,preventSigmaDefault:function(){l.preventSigmaDefault()}};r.hoveredNode&&(r.emit("leaveNode",Be(Be({},u),{},{node:r.hoveredNode})),r.scheduleHighlightedNodesRender()),r.settings.enableEdgeEvents&&r.hoveredEdge&&(r.emit("leaveEdge",Be(Be({},u),{},{edge:r.hoveredEdge})),r.scheduleHighlightedNodesRender()),r.emit("leaveStage",Be({},u))},this.activeListeners.handleEnter=function(i){var l=Bs(i),u={event:l,preventSigmaDefault:function(){l.preventSigmaDefault()}};r.emit("enterStage",Be({},u))};var a=function(l){return function(u){var c=Bs(u),f={event:c,preventSigmaDefault:function(){c.preventSigmaDefault()}},p=r.getNodeAtPosition(c);if(p)return r.emit("".concat(l,"Node"),Be(Be({},f),{},{node:p}));if(r.settings.enableEdgeEvents){var g=r.getEdgeAtPoint(c.x,c.y);if(g)return r.emit("".concat(l,"Edge"),Be(Be({},f),{},{edge:g}))}return r.emit("".concat(l,"Stage"),f)}};return this.activeListeners.handleClick=a("click"),this.activeListeners.handleRightClick=a("rightClick"),this.activeListeners.handleDoubleClick=a("doubleClick"),this.activeListeners.handleWheel=a("wheel"),this.activeListeners.handleDown=a("down"),this.activeListeners.handleUp=a("up"),this.mouseCaptor.on("mousemove",this.activeListeners.handleMove),this.mouseCaptor.on("mousemovebody",this.activeListeners.handleMoveBody),this.mouseCaptor.on("click",this.activeListeners.handleClick),this.mouseCaptor.on("rightClick",this.activeListeners.handleRightClick),this.mouseCaptor.on("doubleClick",this.activeListeners.handleDoubleClick),this.mouseCaptor.on("wheel",this.activeListeners.handleWheel),this.mouseCaptor.on("mousedown",this.activeListeners.handleDown),this.mouseCaptor.on("mouseup",this.activeListeners.handleUp),this.mouseCaptor.on("mouseleave",this.activeListeners.handleLeave),this.mouseCaptor.on("mouseenter",this.activeListeners.handleEnter),this.touchCaptor.on("touchdown",this.activeListeners.handleDown),this.touchCaptor.on("touchdown",this.activeListeners.handleMove),this.touchCaptor.on("touchup",this.activeListeners.handleUp),this.touchCaptor.on("touchmove",this.activeListeners.handleMove),this.touchCaptor.on("tap",this.activeListeners.handleClick),this.touchCaptor.on("doubletap",this.activeListeners.handleDoubleClick),this.touchCaptor.on("touchmove",this.activeListeners.handleMoveBody),this}},{key:"bindGraphHandlers",value:function(){var r=this,a=this.graph,i=new Set(["x","y","zIndex","type"]);return this.activeListeners.eachNodeAttributesUpdatedGraphUpdate=function(l){var u,c=(u=l.hints)===null||u===void 0?void 0:u.attributes;r.graph.forEachNode(function(p){return r.updateNode(p)});var f=!c||c.some(function(p){return i.has(p)});r.refresh({partialGraph:{nodes:a.nodes()},skipIndexation:!f,schedule:!0})},this.activeListeners.eachEdgeAttributesUpdatedGraphUpdate=function(l){var u,c=(u=l.hints)===null||u===void 0?void 0:u.attributes;r.graph.forEachEdge(function(p){return r.updateEdge(p)});var f=c&&["zIndex","type"].some(function(p){return c==null?void 0:c.includes(p)});r.refresh({partialGraph:{edges:a.edges()},skipIndexation:!f,schedule:!0})},this.activeListeners.addNodeGraphUpdate=function(l){var u=l.key;r.addNode(u),r.refresh({partialGraph:{nodes:[u]},skipIndexation:!1,schedule:!0})},this.activeListeners.updateNodeGraphUpdate=function(l){var u=l.key;r.refresh({partialGraph:{nodes:[u]},skipIndexation:!1,schedule:!0})},this.activeListeners.dropNodeGraphUpdate=function(l){var u=l.key;r.removeNode(u),r.refresh({schedule:!0})},this.activeListeners.addEdgeGraphUpdate=function(l){var u=l.key;r.addEdge(u),r.refresh({partialGraph:{edges:[u]},schedule:!0})},this.activeListeners.updateEdgeGraphUpdate=function(l){var u=l.key;r.refresh({partialGraph:{edges:[u]},skipIndexation:!1,schedule:!0})},this.activeListeners.dropEdgeGraphUpdate=function(l){var u=l.key;r.removeEdge(u),r.refresh({schedule:!0})},this.activeListeners.clearEdgesGraphUpdate=function(){r.clearEdgeState(),r.clearEdgeIndices(),r.refresh({schedule:!0})},this.activeListeners.clearGraphUpdate=function(){r.clearEdgeState(),r.clearNodeState(),r.clearEdgeIndices(),r.clearNodeIndices(),r.refresh({schedule:!0})},a.on("nodeAdded",this.activeListeners.addNodeGraphUpdate),a.on("nodeDropped",this.activeListeners.dropNodeGraphUpdate),a.on("nodeAttributesUpdated",this.activeListeners.updateNodeGraphUpdate),a.on("eachNodeAttributesUpdated",this.activeListeners.eachNodeAttributesUpdatedGraphUpdate),a.on("edgeAdded",this.activeListeners.addEdgeGraphUpdate),a.on("edgeDropped",this.activeListeners.dropEdgeGraphUpdate),a.on("edgeAttributesUpdated",this.activeListeners.updateEdgeGraphUpdate),a.on("eachEdgeAttributesUpdated",this.activeListeners.eachEdgeAttributesUpdatedGraphUpdate),a.on("edgesCleared",this.activeListeners.clearEdgesGraphUpdate),a.on("cleared",this.activeListeners.clearGraphUpdate),this}},{key:"unbindGraphHandlers",value:function(){var r=this.graph;r.removeListener("nodeAdded",this.activeListeners.addNodeGraphUpdate),r.removeListener("nodeDropped",this.activeListeners.dropNodeGraphUpdate),r.removeListener("nodeAttributesUpdated",this.activeListeners.updateNodeGraphUpdate),r.removeListener("eachNodeAttributesUpdated",this.activeListeners.eachNodeAttributesUpdatedGraphUpdate),r.removeListener("edgeAdded",this.activeListeners.addEdgeGraphUpdate),r.removeListener("edgeDropped",this.activeListeners.dropEdgeGraphUpdate),r.removeListener("edgeAttributesUpdated",this.activeListeners.updateEdgeGraphUpdate),r.removeListener("eachEdgeAttributesUpdated",this.activeListeners.eachEdgeAttributesUpdatedGraphUpdate),r.removeListener("edgesCleared",this.activeListeners.clearEdgesGraphUpdate),r.removeListener("cleared",this.activeListeners.clearGraphUpdate)}},{key:"getEdgeAtPoint",value:function(r,a){var i=JR(this.webGLContexts.edges,this.frameBuffers.edges,r,a,this.pixelRatio,this.pickingDownSizingRatio),l=QR.apply(void 0,mC(i)),u=this.itemIDsIndex[l];return u&&u.type==="edge"?u.id:null}},{key:"process",value:function(){var r=this;this.emit("beforeProcess");var a=this.graph,i=this.settings,l=this.getDimensions();if(this.nodeExtent=UX(this.graph),!this.settings.autoRescale){var u=l.width,c=l.height,f=this.nodeExtent,p=f.x,g=f.y;this.nodeExtent={x:[(p[0]+p[1])/2-u/2,(p[0]+p[1])/2+u/2],y:[(g[0]+g[1])/2-c/2,(g[0]+g[1])/2+c/2]}}this.normalizationFunction=pC(this.customBBox||this.nodeExtent);var b=new hC,m=Ps(b.getState(),l,this.getGraphDimensions(),this.getStagePadding());this.labelGrid.resizeAndClear(l,i.labelGridCellSize);for(var S={},v={},A={},R={},x=1,_=a.nodes(),C=0,N=_.length;C1&&arguments[1]!==void 0?arguments[1]:{},i=a.tolerance,l=i===void 0?0:i,u=a.boundaries,c=Be({},r),f=u||this.nodeExtent,p=vl(f.x,2),g=p[0],b=p[1],m=vl(f.y,2),S=m[0],v=m[1],A=[this.graphToViewport({x:g,y:S},{cameraState:r}),this.graphToViewport({x:b,y:S},{cameraState:r}),this.graphToViewport({x:g,y:v},{cameraState:r}),this.graphToViewport({x:b,y:v},{cameraState:r})],R=1/0,x=-1/0,_=1/0,C=-1/0;A.forEach(function(W){var Z=W.x,j=W.y;R=Math.min(R,Z),x=Math.max(x,Z),_=Math.min(_,j),C=Math.max(C,j)});var N=x-R,T=C-_,O=this.getDimensions(),z=O.width,I=O.height,M=0,H=0;if(N>=z?xl&&(M=R-l):x>z+l?M=x-(z+l):R<-l&&(M=R+l),T>=I?Cl&&(H=_-l):C>I+l?H=C-(I+l):_<-l&&(H=_+l),M||H){var q=this.viewportToFramedGraph({x:0,y:0},{cameraState:r}),U=this.viewportToFramedGraph({x:M,y:H},{cameraState:r});M=U.x-q.x,H=U.y-q.y,c.x+=M,c.y+=H}return c}},{key:"renderLabels",value:function(){if(!this.settings.renderLabels)return this;var r=this.camera.getState(),a=this.labelGrid.getLabelsToDisplay(r.ratio,this.settings.labelDensity);gC(a,this.nodesWithForcedLabels),this.displayedNodeLabels=new Set;for(var i=this.canvasContexts.labels,l=0,u=a.length;lthis.width+oZ||b<-50||b>this.height+iZ)){this.displayedNodeLabels.add(c);var S=this.settings.defaultDrawNodeLabel,v=this.nodePrograms[f.type],A=(v==null?void 0:v.drawLabel)||S;A(i,Be(Be({key:c},f),{},{size:m,x:g,y:b}),this.settings)}}}return this}},{key:"renderEdgeLabels",value:function(){if(!this.settings.renderEdgeLabels)return this;var r=this.canvasContexts.edgeLabels;r.clearRect(0,0,this.width,this.height);var a=aZ({graph:this.graph,hoveredNode:this.hoveredNode,displayedNodeLabels:this.displayedNodeLabels,highlightedNodes:this.highlightedNodes});gC(a,this.edgesWithForcedLabels);for(var i=new Set,l=0,u=a.length;lthis.nodeZExtent[1]&&(this.nodeZExtent[1]=i.zIndex))}},{key:"updateNode",value:function(r){this.addNode(r);var a=this.nodeDataCache[r];this.normalizationFunction.applyTo(a)}},{key:"removeNode",value:function(r){delete this.nodeDataCache[r],delete this.nodeProgramIndex[r],this.highlightedNodes.delete(r),this.hoveredNode===r&&(this.hoveredNode=null),this.nodesWithForcedLabels.delete(r)}},{key:"addEdge",value:function(r){var a=Object.assign({},this.graph.getEdgeAttributes(r));this.settings.edgeReducer&&(a=this.settings.edgeReducer(r,a));var i=sZ(this.settings,r,a);this.edgeDataCache[r]=i,this.edgesWithForcedLabels.delete(r),i.forceLabel&&!i.hidden&&this.edgesWithForcedLabels.add(r),this.settings.zIndex&&(i.zIndex
"u"?i:d};typeof i=="function"&&(s=i);var u=function(d){return s(d[r])},f=function(){return s(void 0)};return typeof r=="string"?(o.fromAttributes=u,o.fromGraph=function(d,p){return u(d.getNodeAttributes(p))},o.fromEntry=function(d,p){return u(p)}):typeof r=="function"?(o.fromAttributes=function(){throw new Error("graphology-utils/getters/createNodeValueGetter: irrelevant usage.")},o.fromGraph=function(d,p){return s(r(p,d.getNodeAttributes(p)))},o.fromEntry=function(d,p){return s(r(d,p))}):(o.fromAttributes=f,o.fromGraph=f,o.fromEntry=f),o}function n(r,i){var o={},s=function(d){return typeof d>"u"?i:d};typeof i=="function"&&(s=i);var u=function(d){return s(d[r])},f=function(){return s(void 0)};return typeof r=="string"?(o.fromAttributes=u,o.fromGraph=function(d,p){return u(d.getEdgeAttributes(p))},o.fromEntry=function(d,p){return u(p)},o.fromPartialEntry=o.fromEntry,o.fromMinimalEntry=o.fromEntry):typeof r=="function"?(o.fromAttributes=function(){throw new Error("graphology-utils/getters/createEdgeValueGetter: irrelevant usage.")},o.fromGraph=function(d,p){var m=d.extremities(p);return s(r(p,d.getEdgeAttributes(p),m[0],m[1],d.getNodeAttributes(m[0]),d.getNodeAttributes(m[1]),d.isUndirected(p)))},o.fromEntry=function(d,p,m,v,g,w,x){return s(r(d,p,m,v,g,w,x))},o.fromPartialEntry=function(d,p,m,v){return s(r(d,p,m,v))},o.fromMinimalEntry=function(d,p){return s(r(d,p))}):(o.fromAttributes=f,o.fromGraph=f,o.fromEntry=f,o.fromMinimalEntry=f),o}return Ls.createNodeValueGetter=t,Ls.createEdgeValueGetter=n,Ls.createEdgeWeightGetter=function(r){return n(r,e)},Ls}var Sm,DS;function jA(){if(DS)return Sm;DS=1;const{createNodeValueGetter:e,createEdgeValueGetter:t}=Ey();return Sm=function(r,i,o){const{nodeXAttribute:s,nodeYAttribute:u}=o,{attraction:f,repulsion:d,gravity:p,inertia:m,maxMove:v}=o.settings;let{shouldSkipNode:g,shouldSkipEdge:w,isNodeFixed:x}=o;x=e(x),g=e(g,!1),w=t(w,!1);const k=r.filterNodes((T,N)=>!g.fromEntry(T,N)),C=k.length;for(let T=0;T{if(D===z||g.fromEntry(D,R)||g.fromEntry(z,B)||w.fromEntry(T,N,D,z,R,B,P))return;const j=i[D],V=i[z],q=V.x-j.x,I=V.y-j.y,Y=Math.sqrt(q*q+I*I)||1,Z=f*Y*q,U=f*Y*I;j.dx+=Z,j.dy+=U,V.dx-=Z,V.dy-=U}),p)for(let T=0;Tv&&(D.dx*=v/z,D.dy*=v/z),x.fromGraph(r,N)?D.fixed=!0:(D.x+=D.dx,D.y+=D.dy,D.fixed=!1)}return{converged:_}},Sm}var $c={},NS;function MA(){return NS||(NS=1,$c.assignLayoutChanges=function(e,t,n){const{nodeXAttribute:r,nodeYAttribute:i}=n;e.updateEachNodeAttributes((o,s)=>{const u=t[o];return!u||u.fixed||(s[r]=u.x,s[i]=u.y),s},{attributes:["x","y"]})},$c.collectLayoutChanges=function(e){const t={};for(const n in e){const r=e[n];t[n]={x:r.x,y:r.y}}return t}),$c}var Em,OS;function PA(){return OS||(OS=1,Em={nodeXAttribute:"x",nodeYAttribute:"y",isNodeFixed:"fixed",shouldSkipNode:null,shouldSkipEdge:null,settings:{attraction:5e-4,repulsion:.1,gravity:1e-4,inertia:.6,maxMove:200}}),Em}var _m,LS;function mU(){if(LS)return _m;LS=1;const e=Wr(),t=pu(),n=jA(),r=MA(),i=PA();function o(u,f,d){if(!e(f))throw new Error("graphology-layout-force: the given graph is not a valid graphology instance.");typeof d=="number"?d={maxIterations:d}:d=d||{};const p=d.maxIterations;if(d=t(d,i),typeof p!="number"||p<=0)throw new Error("graphology-layout-force: you should provide a positive number of maximum iterations.");const m={};let v=null,g;for(g=0;gthis.runFrame())},o.prototype.stop=function(){return this.running=!1,this.frameID!==null&&(window.cancelAnimationFrame(this.frameID),this.frameID=null),this},o.prototype.start=function(){if(this.killed)throw new Error("graphology-layout-force/worker.start: layout was killed.");this.running||(this.running=!0,this.runFrame())},o.prototype.kill=function(){this.stop(),delete this.nodeStates,this.killed=!0},km=o,km}var bU=yU();const xU=fn(bU);function wU(e={maxIterations:100}){return kl(vU,e)}function SU(e={}){return Sy(xU,e)}var Cm,jS;function EU(){if(jS)return Cm;jS=1;var e=0,t=1,n=2,r=3,i=4,o=5,s=6,u=7,f=8,d=9,p=0,m=1,v=2,g=0,w=1,x=2,k=3,C=4,_=5,T=6,N=7,D=8,z=3,R=10,B=3,P=9,j=10;return Cm=function(q,I,Y){var Z,U,G,F,K,A,$,M,O,X,re=I.length,ue=Y.length,ae=q.adjustSizes,oe=q.barnesHutTheta*q.barnesHutTheta,Ce,he,Ee,we,Pe,Ae,xe,ee=[];for(G=0;GNe?(ge-=(ve-Ne)/2,Se=ge+ve):(ce-=(Ne-ve)/2,Te=ce+Ne),ee[0+g]=-1,ee[0+w]=(ce+Te)/2,ee[0+x]=(ge+Se)/2,ee[0+k]=Math.max(Te-ce,Se-ge),ee[0+C]=-1,ee[0+_]=-1,ee[0+T]=0,ee[0+N]=0,ee[0+D]=0,Z=1,G=0;G=0){I[G+e]=0)if(Ae=Math.pow(I[G+e]-ee[U+N],2)+Math.pow(I[G+t]-ee[U+D],2),X=ee[U+k],4*X*X/Ae0?(xe=he*I[G+s]*ee[U+T]/Ae,I[G+n]+=Ee*xe,I[G+r]+=we*xe):Ae<0&&(xe=-he*I[G+s]*ee[U+T]/Math.sqrt(Ae),I[G+n]+=Ee*xe,I[G+r]+=we*xe):Ae>0&&(xe=he*I[G+s]*ee[U+T]/Ae,I[G+n]+=Ee*xe,I[G+r]+=we*xe),U=ee[U+C],U<0)break;continue}else{U=ee[U+_];continue}else{if(A=ee[U+g],A>=0&&A!==G&&(Ee=I[G+e]-I[A+e],we=I[G+t]-I[A+t],Ae=Ee*Ee+we*we,ae===!0?Ae>0?(xe=he*I[G+s]*I[A+s]/Ae,I[G+n]+=Ee*xe,I[G+r]+=we*xe):Ae<0&&(xe=-he*I[G+s]*I[A+s]/Math.sqrt(Ae),I[G+n]+=Ee*xe,I[G+r]+=we*xe):Ae>0&&(xe=he*I[G+s]*I[A+s]/Ae,I[G+n]+=Ee*xe,I[G+r]+=we*xe)),U=ee[U+C],U<0)break;continue}else for(he=q.scalingRatio,F=0;F0?(xe=he*I[F+s]*I[K+s]/Ae/Ae,I[F+n]+=Ee*xe,I[F+r]+=we*xe,I[K+n]-=Ee*xe,I[K+r]-=we*xe):Ae<0&&(xe=100*he*I[F+s]*I[K+s],I[F+n]+=Ee*xe,I[F+r]+=we*xe,I[K+n]-=Ee*xe,I[K+r]-=we*xe)):(Ae=Math.sqrt(Ee*Ee+we*we),Ae>0&&(xe=he*I[F+s]*I[K+s]/Ae/Ae,I[F+n]+=Ee*xe,I[F+r]+=we*xe,I[K+n]-=Ee*xe,I[K+r]-=we*xe));for(O=q.gravity/q.scalingRatio,he=q.scalingRatio,G=0;G0&&(xe=he*I[G+s]*O):Ae>0&&(xe=he*I[G+s]*O/Ae),I[G+n]-=Ee*xe,I[G+r]-=we*xe;for(he=1*(q.outboundAttractionDistribution?Ce:1),$=0;$0&&(xe=-he*Pe*Math.log(1+Ae)/Ae/I[F+s]):Ae>0&&(xe=-he*Pe*Math.log(1+Ae)/Ae):q.outboundAttractionDistribution?Ae>0&&(xe=-he*Pe/I[F+s]):Ae>0&&(xe=-he*Pe)):(Ae=Math.sqrt(Math.pow(Ee,2)+Math.pow(we,2)),q.linLogMode?q.outboundAttractionDistribution?Ae>0&&(xe=-he*Pe*Math.log(1+Ae)/Ae/I[F+s]):Ae>0&&(xe=-he*Pe*Math.log(1+Ae)/Ae):q.outboundAttractionDistribution?(Ae=1,xe=-he*Pe/I[F+s]):(Ae=1,xe=-he*Pe)),Ae>0&&(I[F+n]+=Ee*xe,I[F+r]+=we*xe,I[K+n]-=Ee*xe,I[K+r]-=we*xe);var te,de,Oe,$e,Ye,vt;if(ae===!0)for(G=0;Gj&&(I[G+n]=I[G+n]*j/te,I[G+r]=I[G+r]*j/te),de=I[G+s]*Math.sqrt((I[G+i]-I[G+n])*(I[G+i]-I[G+n])+(I[G+o]-I[G+r])*(I[G+o]-I[G+r])),Oe=Math.sqrt((I[G+i]+I[G+n])*(I[G+i]+I[G+n])+(I[G+o]+I[G+r])*(I[G+o]+I[G+r]))/2,$e=.1*Math.log(1+Oe)/(1+Math.sqrt(de)),Ye=I[G+e]+I[G+n]*($e/q.slowDown),I[G+e]=Ye,vt=I[G+t]+I[G+r]*($e/q.slowDown),I[G+t]=vt);else for(G=0;G=0)?{message:"the `scalingRatio` setting should be a number >= 0."}:"strongGravityMode"in n&&typeof n.strongGravityMode!="boolean"?{message:"the `strongGravityMode` setting should be a boolean."}:"gravity"in n&&!(typeof n.gravity=="number"&&n.gravity>=0)?{message:"the `gravity` setting should be a number >= 0."}:"slowDown"in n&&!(typeof n.slowDown=="number"||n.slowDown>=0)?{message:"the `slowDown` setting should be a number >= 0."}:"barnesHutOptimize"in n&&typeof n.barnesHutOptimize!="boolean"?{message:"the `barnesHutOptimize` setting should be a boolean."}:"barnesHutTheta"in n&&!(typeof n.barnesHutTheta=="number"&&n.barnesHutTheta>=0)?{message:"the `barnesHutTheta` setting should be a number >= 0."}:null},vi.graphToByteArrays=function(n,r){var i=n.order,o=n.size,s={},u,f=new Float32Array(i*e),d=new Float32Array(o*t);return u=0,n.forEachNode(function(p,m){s[p]=u,f[u]=m.x,f[u+1]=m.y,f[u+2]=0,f[u+3]=0,f[u+4]=0,f[u+5]=0,f[u+6]=1,f[u+7]=1,f[u+8]=m.size||1,f[u+9]=m.fixed?1:0,u+=e}),u=0,n.forEachEdge(function(p,m,v,g,w,x,k){var C=s[v],_=s[g],T=r(p,m,v,g,w,x,k);f[C+6]+=T,f[_+6]+=T,d[u]=C,d[u+1]=_,d[u+2]=T,u+=t}),{nodes:f,edges:d}},vi.assignLayoutChanges=function(n,r,i){var o=0;n.updateEachNodeAttributes(function(s,u){return u.x=r[o],u.y=r[o+1],o+=e,i?i(s,u):u})},vi.readGraphPositions=function(n,r){var i=0;n.forEachNode(function(o,s){r[i]=s.x,r[i+1]=s.y,i+=e})},vi.collectLayoutChanges=function(n,r,i){for(var o=n.nodes(),s={},u=0,f=0,d=r.length;u2e3,strongGravityMode:!0,gravity:.05,scalingRatio:10,slowDown:1+Math.log(d)}}var u=o.bind(null,!1);return u.assign=o.bind(null,!0),u.inferSettings=s,Am=u,Am}var kU=_U();const CU=fn(kU);var Rm,IS;function TU(){return IS||(IS=1,Rm=function(){var t,n,r={};(function(){var o=0,s=1,u=2,f=3,d=4,p=5,m=6,v=7,g=8,w=9,x=0,k=1,C=2,_=0,T=1,N=2,D=3,z=4,R=5,B=6,P=7,j=8,V=3,q=10,I=3,Y=9,Z=10;r.exports=function(G,F,K){var A,$,M,O,X,re,ue,ae,oe,Ce,he=F.length,Ee=K.length,we=G.adjustSizes,Pe=G.barnesHutTheta*G.barnesHutTheta,Ae,xe,ee,ce,Te,ge,Se,ie=[];for(M=0;MYe?(ve-=($e-Ye)/2,Ne=ve+$e):(He-=(Ye-$e)/2,Ge=He+Ye),ie[0+_]=-1,ie[0+T]=(He+Ge)/2,ie[0+N]=(ve+Ne)/2,ie[0+D]=Math.max(Ge-He,Ne-ve),ie[0+z]=-1,ie[0+R]=-1,ie[0+B]=0,ie[0+P]=0,ie[0+j]=0,A=1,M=0;M=0){F[M+o]=0)if(ge=Math.pow(F[M+o]-ie[$+P],2)+Math.pow(F[M+s]-ie[$+j],2),Ce=ie[$+D],4*Ce*Ce/ge0?(Se=xe*F[M+m]*ie[$+B]/ge,F[M+u]+=ee*Se,F[M+f]+=ce*Se):ge<0&&(Se=-xe*F[M+m]*ie[$+B]/Math.sqrt(ge),F[M+u]+=ee*Se,F[M+f]+=ce*Se):ge>0&&(Se=xe*F[M+m]*ie[$+B]/ge,F[M+u]+=ee*Se,F[M+f]+=ce*Se),$=ie[$+z],$<0)break;continue}else{$=ie[$+R];continue}else{if(re=ie[$+_],re>=0&&re!==M&&(ee=F[M+o]-F[re+o],ce=F[M+s]-F[re+s],ge=ee*ee+ce*ce,we===!0?ge>0?(Se=xe*F[M+m]*F[re+m]/ge,F[M+u]+=ee*Se,F[M+f]+=ce*Se):ge<0&&(Se=-xe*F[M+m]*F[re+m]/Math.sqrt(ge),F[M+u]+=ee*Se,F[M+f]+=ce*Se):ge>0&&(Se=xe*F[M+m]*F[re+m]/ge,F[M+u]+=ee*Se,F[M+f]+=ce*Se)),$=ie[$+z],$<0)break;continue}else for(xe=G.scalingRatio,O=0;O0?(Se=xe*F[O+m]*F[X+m]/ge/ge,F[O+u]+=ee*Se,F[O+f]+=ce*Se,F[X+u]-=ee*Se,F[X+f]-=ce*Se):ge<0&&(Se=100*xe*F[O+m]*F[X+m],F[O+u]+=ee*Se,F[O+f]+=ce*Se,F[X+u]-=ee*Se,F[X+f]-=ce*Se)):(ge=Math.sqrt(ee*ee+ce*ce),ge>0&&(Se=xe*F[O+m]*F[X+m]/ge/ge,F[O+u]+=ee*Se,F[O+f]+=ce*Se,F[X+u]-=ee*Se,F[X+f]-=ce*Se));for(oe=G.gravity/G.scalingRatio,xe=G.scalingRatio,M=0;M0&&(Se=xe*F[M+m]*oe):ge>0&&(Se=xe*F[M+m]*oe/ge),F[M+u]-=ee*Se,F[M+f]-=ce*Se;for(xe=1*(G.outboundAttractionDistribution?Ae:1),ue=0;ue0&&(Se=-xe*Te*Math.log(1+ge)/ge/F[O+m]):ge>0&&(Se=-xe*Te*Math.log(1+ge)/ge):G.outboundAttractionDistribution?ge>0&&(Se=-xe*Te/F[O+m]):ge>0&&(Se=-xe*Te)):(ge=Math.sqrt(Math.pow(ee,2)+Math.pow(ce,2)),G.linLogMode?G.outboundAttractionDistribution?ge>0&&(Se=-xe*Te*Math.log(1+ge)/ge/F[O+m]):ge>0&&(Se=-xe*Te*Math.log(1+ge)/ge):G.outboundAttractionDistribution?(ge=1,Se=-xe*Te/F[O+m]):(ge=1,Se=-xe*Te)),ge>0&&(F[O+u]+=ee*Se,F[O+f]+=ce*Se,F[X+u]-=ee*Se,F[X+f]-=ce*Se);var vt,Mt,bt,rt,qt,at;if(we===!0)for(M=0;MZ&&(F[M+u]=F[M+u]*Z/vt,F[M+f]=F[M+f]*Z/vt),Mt=F[M+m]*Math.sqrt((F[M+d]-F[M+u])*(F[M+d]-F[M+u])+(F[M+p]-F[M+f])*(F[M+p]-F[M+f])),bt=Math.sqrt((F[M+d]+F[M+u])*(F[M+d]+F[M+u])+(F[M+p]+F[M+f])*(F[M+p]+F[M+f]))/2,rt=.1*Math.log(1+bt)/(1+Math.sqrt(Mt)),qt=F[M+o]+F[M+u]*(rt/G.slowDown),F[M+o]=qt,at=F[M+s]+F[M+f]*(rt/G.slowDown),F[M+s]=at);else for(M=0;M1&&Ee.has(Se))&&(F>1&&Ee.add(Se),xe=f[Pe+e],ce=f[Pe+t],ge=f[Pe+n],ie=xe-Ae,He=ce-ee,Ge=Math.sqrt(ie*ie+He*He),ve=Ge0?(R[Pe]+=ie/Ge*(1+Te),B[Pe]+=He/Ge*(1+Te)):(R[Pe]+=I*o(),B[Pe]+=Y*o())));for(w=0,x=0;w1&&xe.has(ve))&&(M>1&&xe.add(ve),ge=v[ce+i],ie=v[ce+o],Ge=v[ce+s],Ne=ge-Te,te=ie-Se,de=Math.sqrt(Ne*Ne+te*te),Oe=de0?(V[ce]+=Ne/de*(1+He),q[ce]+=te/de*(1+He)):(V[ce]+=G*d(),q[ce]+=F*d())));for(_=0,T=0;_=0;)m=Xg(e,t,n,r,d+1,o+1,s),m>p&&(d===i?m*=WS:ZU.test(e.charAt(d-1))?(m*=YU,g=e.slice(i,d-1).match(QU),g&&i>0&&(m*=Math.pow(Fm,g.length))):JU.test(e.charAt(d-1))?(m*=qU,w=e.slice(i,d-1).match(HA),w&&i>0&&(m*=Math.pow(Fm,w.length))):(m*=WU,i>0&&(m*=Math.pow(Fm,d-i))),e.charAt(d)!==t.charAt(o)&&(m*=XU)),(mm&&(m=v*Pm)),m>p&&(p=m),d=n.indexOf(f,d+1);return s[u]=p,p}function XS(e){return e.toLowerCase().replace(HA," ")}function e6(e,t,n){return e=n&&n.length>0?`${e+" "+n.join(" ")}`:e,Xg(e,t,XS(e),XS(t),0,0,{})}var Im={exports:{}},Gm={};/** - * @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 KS;function t6(){if(KS)return Gm;KS=1;var e=$f();function t(m,v){return m===v&&(m!==0||1/m===1/v)||m!==m&&v!==v}var n=typeof Object.is=="function"?Object.is:t,r=e.useState,i=e.useEffect,o=e.useLayoutEffect,s=e.useDebugValue;function u(m,v){var g=v(),w=r({inst:{value:g,getSnapshot:v}}),x=w[0].inst,k=w[1];return o(function(){x.value=g,x.getSnapshot=v,f(x)&&k({inst:x})},[m,g,v]),i(function(){return f(x)&&k({inst:x}),m(function(){f(x)&&k({inst:x})})},[m]),s(g),g}function f(m){var v=m.getSnapshot;m=m.value;try{var g=v();return!n(m,g)}catch{return!0}}function d(m,v){return v()}var p=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?d:u;return Gm.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:p,Gm}var ZS;function n6(){return ZS||(ZS=1,Im.exports=t6()),Im.exports}var r6=n6(),zs='[cmdk-group=""]',Bm='[cmdk-group-items=""]',i6='[cmdk-group-heading=""]',_y='[cmdk-item=""]',QS=`${_y}:not([aria-disabled="true"])`,Kg="cmdk-item-select",Ha="data-value",a6=(e,t,n)=>e6(e,t,n),$A=E.createContext(void 0),mu=()=>E.useContext($A),VA=E.createContext(void 0),ky=()=>E.useContext(VA),qA=E.createContext(void 0),YA=E.forwardRef((e,t)=>{let n=Qo(()=>{var M,O;return{search:"",value:(O=(M=e.value)!=null?M:e.defaultValue)!=null?O:"",filtered:{count:0,items:new Map,groups:new Set}}}),r=Qo(()=>new Set),i=Qo(()=>new Map),o=Qo(()=>new Map),s=Qo(()=>new Set),u=WA(e),{label:f,children:d,value:p,onValueChange:m,filter:v,shouldFilter:g,loop:w,disablePointerSelection:x=!1,vimBindings:k=!0,...C}=e,_=bn(),T=bn(),N=bn(),D=E.useRef(null),z=g6();Qa(()=>{if(p!==void 0){let M=p.trim();n.current.value=M,R.emit()}},[p]),Qa(()=>{z(6,I)},[]);let R=E.useMemo(()=>({subscribe:M=>(s.current.add(M),()=>s.current.delete(M)),snapshot:()=>n.current,setState:(M,O,X)=>{var re,ue,ae;if(!Object.is(n.current[M],O)){if(n.current[M]=O,M==="search")q(),j(),z(1,V);else if(M==="value"&&(X||z(5,I),((re=u.current)==null?void 0:re.value)!==void 0)){let oe=O??"";(ae=(ue=u.current).onValueChange)==null||ae.call(ue,oe);return}R.emit()}},emit:()=>{s.current.forEach(M=>M())}}),[]),B=E.useMemo(()=>({value:(M,O,X)=>{var re;O!==((re=o.current.get(M))==null?void 0:re.value)&&(o.current.set(M,{value:O,keywords:X}),n.current.filtered.items.set(M,P(O,X)),z(2,()=>{j(),R.emit()}))},item:(M,O)=>(r.current.add(M),O&&(i.current.has(O)?i.current.get(O).add(M):i.current.set(O,new Set([M]))),z(3,()=>{q(),j(),n.current.value||V(),R.emit()}),()=>{o.current.delete(M),r.current.delete(M),n.current.filtered.items.delete(M);let X=Y();z(4,()=>{q(),(X==null?void 0:X.getAttribute("id"))===M&&V(),R.emit()})}),group:M=>(i.current.has(M)||i.current.set(M,new Set),()=>{o.current.delete(M),i.current.delete(M)}),filter:()=>u.current.shouldFilter,label:f||e["aria-label"],getDisablePointerSelection:()=>u.current.disablePointerSelection,listId:_,inputId:N,labelId:T,listInnerRef:D}),[]);function P(M,O){var X,re;let ue=(re=(X=u.current)==null?void 0:X.filter)!=null?re:a6;return M?ue(M,n.current.search,O):0}function j(){if(!n.current.search||u.current.shouldFilter===!1)return;let M=n.current.filtered.items,O=[];n.current.filtered.groups.forEach(re=>{let ue=i.current.get(re),ae=0;ue.forEach(oe=>{let Ce=M.get(oe);ae=Math.max(Ce,ae)}),O.push([re,ae])});let X=D.current;Z().sort((re,ue)=>{var ae,oe;let Ce=re.getAttribute("id"),he=ue.getAttribute("id");return((ae=M.get(he))!=null?ae:0)-((oe=M.get(Ce))!=null?oe:0)}).forEach(re=>{let ue=re.closest(Bm);ue?ue.appendChild(re.parentElement===ue?re:re.closest(`${Bm} > *`)):X.appendChild(re.parentElement===X?re:re.closest(`${Bm} > *`))}),O.sort((re,ue)=>ue[1]-re[1]).forEach(re=>{var ue;let ae=(ue=D.current)==null?void 0:ue.querySelector(`${zs}[${Ha}="${encodeURIComponent(re[0])}"]`);ae==null||ae.parentElement.appendChild(ae)})}function V(){let M=Z().find(X=>X.getAttribute("aria-disabled")!=="true"),O=M==null?void 0:M.getAttribute(Ha);R.setState("value",O||void 0)}function q(){var M,O,X,re;if(!n.current.search||u.current.shouldFilter===!1){n.current.filtered.count=r.current.size;return}n.current.filtered.groups=new Set;let ue=0;for(let ae of r.current){let oe=(O=(M=o.current.get(ae))==null?void 0:M.value)!=null?O:"",Ce=(re=(X=o.current.get(ae))==null?void 0:X.keywords)!=null?re:[],he=P(oe,Ce);n.current.filtered.items.set(ae,he),he>0&&ue++}for(let[ae,oe]of i.current)for(let Ce of oe)if(n.current.filtered.items.get(Ce)>0){n.current.filtered.groups.add(ae);break}n.current.filtered.count=ue}function I(){var M,O,X;let re=Y();re&&(((M=re.parentElement)==null?void 0:M.firstChild)===re&&((X=(O=re.closest(zs))==null?void 0:O.querySelector(i6))==null||X.scrollIntoView({block:"nearest"})),re.scrollIntoView({block:"nearest"}))}function Y(){var M;return(M=D.current)==null?void 0:M.querySelector(`${_y}[aria-selected="true"]`)}function Z(){var M;return Array.from(((M=D.current)==null?void 0:M.querySelectorAll(QS))||[])}function U(M){let O=Z()[M];O&&R.setState("value",O.getAttribute(Ha))}function G(M){var O;let X=Y(),re=Z(),ue=re.findIndex(oe=>oe===X),ae=re[ue+M];(O=u.current)!=null&&O.loop&&(ae=ue+M<0?re[re.length-1]:ue+M===re.length?re[0]:re[ue+M]),ae&&R.setState("value",ae.getAttribute(Ha))}function F(M){let O=Y(),X=O==null?void 0:O.closest(zs),re;for(;X&&!re;)X=M>0?p6(X,zs):m6(X,zs),re=X==null?void 0:X.querySelector(QS);re?R.setState("value",re.getAttribute(Ha)):G(M)}let K=()=>U(Z().length-1),A=M=>{M.preventDefault(),M.metaKey?K():M.altKey?F(1):G(1)},$=M=>{M.preventDefault(),M.metaKey?U(0):M.altKey?F(-1):G(-1)};return E.createElement(We.div,{ref:t,tabIndex:-1,...C,"cmdk-root":"",onKeyDown:M=>{var O;if((O=C.onKeyDown)==null||O.call(C,M),!M.defaultPrevented)switch(M.key){case"n":case"j":{k&&M.ctrlKey&&A(M);break}case"ArrowDown":{A(M);break}case"p":case"k":{k&&M.ctrlKey&&$(M);break}case"ArrowUp":{$(M);break}case"Home":{M.preventDefault(),U(0);break}case"End":{M.preventDefault(),K();break}case"Enter":if(!M.nativeEvent.isComposing&&M.keyCode!==229){M.preventDefault();let X=Y();if(X){let re=new Event(Kg);X.dispatchEvent(re)}}}}},E.createElement("label",{"cmdk-label":"",htmlFor:B.inputId,id:B.labelId,style:y6},f),vd(e,M=>E.createElement(VA.Provider,{value:R},E.createElement($A.Provider,{value:B},M))))}),o6=E.forwardRef((e,t)=>{var n,r;let i=bn(),o=E.useRef(null),s=E.useContext(qA),u=mu(),f=WA(e),d=(r=(n=f.current)==null?void 0:n.forceMount)!=null?r:s==null?void 0:s.forceMount;Qa(()=>{if(!d)return u.item(i,s==null?void 0:s.id)},[d]);let p=XA(i,o,[e.value,e.children,o],e.keywords),m=ky(),v=Ja(z=>z.value&&z.value===p.current),g=Ja(z=>d||u.filter()===!1?!0:z.search?z.filtered.items.get(i)>0:!0);E.useEffect(()=>{let z=o.current;if(!(!z||e.disabled))return z.addEventListener(Kg,w),()=>z.removeEventListener(Kg,w)},[g,e.onSelect,e.disabled]);function w(){var z,R;x(),(R=(z=f.current).onSelect)==null||R.call(z,p.current)}function x(){m.setState("value",p.current,!0)}if(!g)return null;let{disabled:k,value:C,onSelect:_,forceMount:T,keywords:N,...D}=e;return E.createElement(We.div,{ref:Xs([o,t]),...D,id:i,"cmdk-item":"",role:"option","aria-disabled":!!k,"aria-selected":!!v,"data-disabled":!!k,"data-selected":!!v,onPointerMove:k||u.getDisablePointerSelection()?void 0:x,onClick:k?void 0:w},e.children)}),l6=E.forwardRef((e,t)=>{let{heading:n,children:r,forceMount:i,...o}=e,s=bn(),u=E.useRef(null),f=E.useRef(null),d=bn(),p=mu(),m=Ja(g=>i||p.filter()===!1?!0:g.search?g.filtered.groups.has(s):!0);Qa(()=>p.group(s),[]),XA(s,u,[e.value,e.heading,f]);let v=E.useMemo(()=>({id:s,forceMount:i}),[i]);return E.createElement(We.div,{ref:Xs([u,t]),...o,"cmdk-group":"",role:"presentation",hidden:m?void 0:!0},n&&E.createElement("div",{ref:f,"cmdk-group-heading":"","aria-hidden":!0,id:d},n),vd(e,g=>E.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?d:void 0},E.createElement(qA.Provider,{value:v},g))))}),s6=E.forwardRef((e,t)=>{let{alwaysRender:n,...r}=e,i=E.useRef(null),o=Ja(s=>!s.search);return!n&&!o?null:E.createElement(We.div,{ref:Xs([i,t]),...r,"cmdk-separator":"",role:"separator"})}),u6=E.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,i=e.value!=null,o=ky(),s=Ja(p=>p.search),u=Ja(p=>p.value),f=mu(),d=E.useMemo(()=>{var p;let m=(p=f.listInnerRef.current)==null?void 0:p.querySelector(`${_y}[${Ha}="${encodeURIComponent(u)}"]`);return m==null?void 0:m.getAttribute("id")},[]);return E.useEffect(()=>{e.value!=null&&o.setState("search",e.value)},[e.value]),E.createElement(We.input,{ref:t,...r,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":f.listId,"aria-labelledby":f.labelId,"aria-activedescendant":d,id:f.inputId,type:"text",value:i?e.value:s,onChange:p=>{i||o.setState("search",p.target.value),n==null||n(p.target.value)}})}),c6=E.forwardRef((e,t)=>{let{children:n,label:r="Suggestions",...i}=e,o=E.useRef(null),s=E.useRef(null),u=mu();return E.useEffect(()=>{if(s.current&&o.current){let f=s.current,d=o.current,p,m=new ResizeObserver(()=>{p=requestAnimationFrame(()=>{let v=f.offsetHeight;d.style.setProperty("--cmdk-list-height",v.toFixed(1)+"px")})});return m.observe(f),()=>{cancelAnimationFrame(p),m.unobserve(f)}}},[]),E.createElement(We.div,{ref:Xs([o,t]),...i,"cmdk-list":"",role:"listbox","aria-label":r,id:u.listId},vd(e,f=>E.createElement("div",{ref:Xs([s,u.listInnerRef]),"cmdk-list-sizer":""},f)))}),f6=E.forwardRef((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:i,contentClassName:o,container:s,...u}=e;return E.createElement(Uv,{open:n,onOpenChange:r},E.createElement(Hv,{container:s},E.createElement(td,{"cmdk-overlay":"",className:i}),E.createElement(nd,{"aria-label":e.label,"cmdk-dialog":"",className:o},E.createElement(YA,{ref:t,...u}))))}),d6=E.forwardRef((e,t)=>Ja(n=>n.filtered.count===0)?E.createElement(We.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),h6=E.forwardRef((e,t)=>{let{progress:n,children:r,label:i="Loading...",...o}=e;return E.createElement(We.div,{ref:t,...o,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":i},vd(e,s=>E.createElement("div",{"aria-hidden":!0},s)))}),In=Object.assign(YA,{List:c6,Item:o6,Input:u6,Group:l6,Separator:s6,Dialog:f6,Empty:d6,Loading:h6});function p6(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function m6(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function WA(e){let t=E.useRef(e);return Qa(()=>{t.current=e}),t}var Qa=typeof window>"u"?E.useEffect:E.useLayoutEffect;function Qo(e){let t=E.useRef();return t.current===void 0&&(t.current=e()),t}function Xs(e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}function Ja(e){let t=ky(),n=()=>e(t.snapshot());return r6.useSyncExternalStore(t.subscribe,n,n)}function XA(e,t,n,r=[]){let i=E.useRef(),o=mu();return Qa(()=>{var s;let u=(()=>{var d;for(let p of n){if(typeof p=="string")return p.trim();if(typeof p=="object"&&"current"in p)return p.current?(d=p.current.textContent)==null?void 0:d.trim():i.current}})(),f=r.map(d=>d.trim());o.value(e,u,f),(s=t.current)==null||s.setAttribute(Ha,u),i.current=u}),i}var g6=()=>{let[e,t]=E.useState(),n=Qo(()=>new Map);return Qa(()=>{n.current.forEach(r=>r()),n.current=new Map},[e]),(r,i)=>{n.current.set(r,i),t({})}};function v6(e){let t=e.type;return typeof t=="function"?t(e.props):"render"in t?t.render(e.props):e}function vd({asChild:e,children:t},n){return e&&E.isValidElement(t)?E.cloneElement(v6(t),{ref:t.ref},n(t.props.children)):n(t)}var y6={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};const KA=Uv,ZA=eC,b6=Hv,QA=E.forwardRef(({className:e,...t},n)=>S.jsx(td,{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}));QA.displayName=td.displayName;const Cy=E.forwardRef(({className:e,children:t,...n},r)=>S.jsxs(b6,{children:[S.jsx(QA,{}),S.jsxs(nd,{ref:r,className:Me("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-top-[48%] fixed top-[50%] left-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border p-6 shadow-lg duration-200 sm:rounded-lg",e),...n,children:[t,S.jsxs(qv,{className:"ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-sm opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-none disabled:pointer-events-none",children:[S.jsx(Ek,{className:"h-4 w-4"}),S.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));Cy.displayName=nd.displayName;const Ty=({className:e,...t})=>S.jsx("div",{className:Me("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});Ty.displayName="DialogHeader";const Ay=E.forwardRef(({className:e,...t},n)=>S.jsx($v,{ref:n,className:Me("text-lg leading-none font-semibold tracking-tight",e),...t}));Ay.displayName=$v.displayName;const Ry=E.forwardRef(({className:e,...t},n)=>S.jsx(Vv,{ref:n,className:Me("text-muted-foreground text-sm",e),...t}));Ry.displayName=Vv.displayName;const yd=E.forwardRef(({className:e,...t},n)=>S.jsx(In,{ref:n,className:Me("bg-popover text-popover-foreground flex h-full w-full flex-col overflow-hidden rounded-md",e),...t}));yd.displayName=In.displayName;const Dy=E.forwardRef(({className:e,...t},n)=>S.jsxs("div",{className:"flex items-center border-b px-3","cmdk-input-wrapper":"",children:[S.jsx(XM,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),S.jsx(In.Input,{ref:n,className:Me("placeholder:text-muted-foreground flex h-11 w-full rounded-md bg-transparent py-3 text-sm outline-none disabled:cursor-not-allowed disabled:opacity-50",e),...t})]}));Dy.displayName=In.Input.displayName;const bd=E.forwardRef(({className:e,...t},n)=>S.jsx(In.List,{ref:n,className:Me("max-h-[300px] overflow-x-hidden overflow-y-auto",e),...t}));bd.displayName=In.List.displayName;const Ny=E.forwardRef((e,t)=>S.jsx(In.Empty,{ref:t,className:"py-6 text-center text-sm",...e}));Ny.displayName=In.Empty.displayName;const Cl=E.forwardRef(({className:e,...t},n)=>S.jsx(In.Group,{ref:n,className:Me("text-foreground [&_[cmdk-group-heading]]:text-muted-foreground overflow-hidden p-1 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium",e),...t}));Cl.displayName=In.Group.displayName;const x6=E.forwardRef(({className:e,...t},n)=>S.jsx(In.Separator,{ref:n,className:Me("bg-border -mx-1 h-px",e),...t}));x6.displayName=In.Separator.displayName;const Tl=E.forwardRef(({className:e,...t},n)=>S.jsx(In.Item,{ref:n,className:Me("data-[selected='true']:bg-accent data-[selected=true]:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",e),...t}));Tl.displayName=In.Item.displayName;const w6=({layout:e,autoRunFor:t})=>{const n=pr(),{stop:r,start:i,isRunning:o}=e;return E.useEffect(()=>{if(!n)return;let s=null;return t!==void 0&&t>-1&&n.getGraph().order>0&&(i(),s=t>0?window.setTimeout(()=>{r()},t):null),()=>{r(),s&&clearTimeout(s)}},[t,i,r,n]),S.jsx(Ot,{size:"icon",onClick:()=>o?r():i(),tooltip:o?"Stop the layout animation":"Start the layout animation",variant:Hr,children:o?S.jsx(HM,{}):S.jsx(VM,{})})},S6=()=>{const e=pr(),[t,n]=E.useState("Circular"),[r,i]=E.useState(!1),o=pU(),s=cU(),u=VU(),f=GU({settings:{margin:1}}),d=wU({maxIterations:20}),p=GA({iterations:20}),m=BU(),v=SU(),g=NU(),w=E.useMemo(()=>({Circular:{layout:o},Circlepack:{layout:s},Random:{layout:u},Noverlaps:{layout:f,worker:m},"Force Directed":{layout:d,worker:v},"Force Atlas":{layout:p,worker:g}}),[s,o,d,p,f,u,v,m,g]),x=E.useCallback(k=>{console.debug(k);const{positions:C}=w[k].layout;RG(e.getGraph(),C(),{duration:500}),n(k)},[w,e]);return S.jsxs(S.Fragment,{children:[S.jsx("div",{children:w[t]&&"worker"in w[t]&&S.jsx(w6,{layout:w[t].worker})}),S.jsx("div",{children:S.jsxs(fd,{open:r,onOpenChange:i,children:[S.jsx(dd,{asChild:!0,children:S.jsx(Ot,{size:"icon",variant:Hr,onClick:()=>i(k=>!k),tooltip:"Layout Graph",children:S.jsx(OM,{})})}),S.jsx(uu,{side:"right",align:"center",className:"p-1",children:S.jsx(yd,{children:S.jsx(bd,{children:S.jsx(Cl,{children:Object.keys(w).map(k=>S.jsx(Tl,{onSelect:()=>{x(k)},className:"cursor-pointer text-xs",children:k},k))})})})})]})})]})};var cf={exports:{}},E6=cf.exports,JS;function _6(){return JS||(JS=1,function(e){(function(t,n,r){function i(f){var d=this,p=u();d.next=function(){var m=2091639*d.s0+d.c*23283064365386963e-26;return d.s0=d.s1,d.s1=d.s2,d.s2=m-(d.c=m|0)},d.c=1,d.s0=p(" "),d.s1=p(" "),d.s2=p(" "),d.s0-=p(f),d.s0<0&&(d.s0+=1),d.s1-=p(f),d.s1<0&&(d.s1+=1),d.s2-=p(f),d.s2<0&&(d.s2+=1),p=null}function o(f,d){return d.c=f.c,d.s0=f.s0,d.s1=f.s1,d.s2=f.s2,d}function s(f,d){var p=new i(f),m=d&&d.state,v=p.next;return v.int32=function(){return p.next()*4294967296|0},v.double=function(){return v()+(v()*2097152|0)*11102230246251565e-32},v.quick=v,m&&(typeof m=="object"&&o(m,p),v.state=function(){return o(p,{})}),v}function u(){var f=4022871197,d=function(p){p=String(p);for(var m=0;m>>0,v-=f,v*=f,f=v>>>0,v-=f,f+=v*4294967296}return(f>>>0)*23283064365386963e-26};return d}n&&n.exports?n.exports=s:this.alea=s})(E6,e)}(cf)),cf.exports}var ff={exports:{}},k6=ff.exports,eE;function C6(){return eE||(eE=1,function(e){(function(t,n,r){function i(u){var f=this,d="";f.x=0,f.y=0,f.z=0,f.w=0,f.next=function(){var m=f.x^f.x<<11;return f.x=f.y,f.y=f.z,f.z=f.w,f.w^=f.w>>>19^m^m>>>8},u===(u|0)?f.x=u:d+=u;for(var p=0;p>>0)/4294967296};return m.double=function(){do var v=d.next()>>>11,g=(d.next()>>>0)/4294967296,w=(v+g)/(1<<21);while(w===0);return w},m.int32=d.next,m.quick=m,p&&(typeof p=="object"&&o(p,d),m.state=function(){return o(d,{})}),m}n&&n.exports?n.exports=s:this.xor128=s})(k6,e)}(ff)),ff.exports}var df={exports:{}},T6=df.exports,tE;function A6(){return tE||(tE=1,function(e){(function(t,n,r){function i(u){var f=this,d="";f.next=function(){var m=f.x^f.x>>>2;return f.x=f.y,f.y=f.z,f.z=f.w,f.w=f.v,(f.d=f.d+362437|0)+(f.v=f.v^f.v<<4^(m^m<<1))|0},f.x=0,f.y=0,f.z=0,f.w=0,f.v=0,u===(u|0)?f.x=u:d+=u;for(var p=0;p>>4),f.next()}function o(u,f){return f.x=u.x,f.y=u.y,f.z=u.z,f.w=u.w,f.v=u.v,f.d=u.d,f}function s(u,f){var d=new i(u),p=f&&f.state,m=function(){return(d.next()>>>0)/4294967296};return m.double=function(){do var v=d.next()>>>11,g=(d.next()>>>0)/4294967296,w=(v+g)/(1<<21);while(w===0);return w},m.int32=d.next,m.quick=m,p&&(typeof p=="object"&&o(p,d),m.state=function(){return o(d,{})}),m}n&&n.exports?n.exports=s:this.xorwow=s})(T6,e)}(df)),df.exports}var hf={exports:{}},R6=hf.exports,nE;function D6(){return nE||(nE=1,function(e){(function(t,n,r){function i(u){var f=this;f.next=function(){var p=f.x,m=f.i,v,g;return v=p[m],v^=v>>>7,g=v^v<<24,v=p[m+1&7],g^=v^v>>>10,v=p[m+3&7],g^=v^v>>>3,v=p[m+4&7],g^=v^v<<7,v=p[m+7&7],v=v^v<<13,g^=v^v<<9,p[m]=g,f.i=m+1&7,g};function d(p,m){var v,g=[];if(m===(m|0))g[0]=m;else for(m=""+m,v=0;v0;--v)p.next()}d(f,u)}function o(u,f){return f.x=u.x.slice(),f.i=u.i,f}function s(u,f){u==null&&(u=+new Date);var d=new i(u),p=f&&f.state,m=function(){return(d.next()>>>0)/4294967296};return m.double=function(){do var v=d.next()>>>11,g=(d.next()>>>0)/4294967296,w=(v+g)/(1<<21);while(w===0);return w},m.int32=d.next,m.quick=m,p&&(p.x&&o(p,d),m.state=function(){return o(d,{})}),m}n&&n.exports?n.exports=s:this.xorshift7=s})(R6,e)}(hf)),hf.exports}var pf={exports:{}},N6=pf.exports,rE;function O6(){return rE||(rE=1,function(e){(function(t,n,r){function i(u){var f=this;f.next=function(){var p=f.w,m=f.X,v=f.i,g,w;return f.w=p=p+1640531527|0,w=m[v+34&127],g=m[v=v+1&127],w^=w<<13,g^=g<<17,w^=w>>>15,g^=g>>>12,w=m[v]=w^g,f.i=v,w+(p^p>>>16)|0};function d(p,m){var v,g,w,x,k,C=[],_=128;for(m===(m|0)?(g=m,m=null):(m=m+"\0",g=0,_=Math.max(_,m.length)),w=0,x=-32;x<_;++x)m&&(g^=m.charCodeAt((x+32)%m.length)),x===0&&(k=g),g^=g<<10,g^=g>>>15,g^=g<<4,g^=g>>>13,x>=0&&(k=k+1640531527|0,v=C[x&127]^=g+k,w=v==0?w+1:0);for(w>=128&&(C[(m&&m.length||0)&127]=-1),w=127,x=4*128;x>0;--x)g=C[w+34&127],v=C[w=w+1&127],g^=g<<13,v^=v<<17,g^=g>>>15,v^=v>>>12,C[w]=g^v;p.w=k,p.X=C,p.i=w}d(f,u)}function o(u,f){return f.i=u.i,f.w=u.w,f.X=u.X.slice(),f}function s(u,f){u==null&&(u=+new Date);var d=new i(u),p=f&&f.state,m=function(){return(d.next()>>>0)/4294967296};return m.double=function(){do var v=d.next()>>>11,g=(d.next()>>>0)/4294967296,w=(v+g)/(1<<21);while(w===0);return w},m.int32=d.next,m.quick=m,p&&(p.X&&o(p,d),m.state=function(){return o(d,{})}),m}n&&n.exports?n.exports=s:this.xor4096=s})(N6,e)}(pf)),pf.exports}var mf={exports:{}},L6=mf.exports,iE;function z6(){return iE||(iE=1,function(e){(function(t,n,r){function i(u){var f=this,d="";f.next=function(){var m=f.b,v=f.c,g=f.d,w=f.a;return m=m<<25^m>>>7^v,v=v-g|0,g=g<<24^g>>>8^w,w=w-m|0,f.b=m=m<<20^m>>>12^v,f.c=v=v-g|0,f.d=g<<16^v>>>16^w,f.a=w-m|0},f.a=0,f.b=0,f.c=-1640531527,f.d=1367130551,u===Math.floor(u)?(f.a=u/4294967296|0,f.b=u|0):d+=u;for(var p=0;p>>0)/4294967296};return m.double=function(){do var v=d.next()>>>11,g=(d.next()>>>0)/4294967296,w=(v+g)/(1<<21);while(w===0);return w},m.int32=d.next,m.quick=m,p&&(typeof p=="object"&&o(p,d),m.state=function(){return o(d,{})}),m}n&&n.exports?n.exports=s:this.tychei=s})(L6,e)}(mf)),mf.exports}var gf={exports:{}};const j6={},M6=Object.freeze(Object.defineProperty({__proto__:null,default:j6},Symbol.toStringTag,{value:"Module"})),P6=lL(M6);var F6=gf.exports,aE;function I6(){return aE||(aE=1,function(e){(function(t,n,r){var i=256,o=6,s=52,u="random",f=r.pow(i,o),d=r.pow(2,s),p=d*2,m=i-1,v;function g(N,D,z){var R=[];D=D==!0?{entropy:!0}:D||{};var B=C(k(D.entropy?[N,T(n)]:N??_(),3),R),P=new w(R),j=function(){for(var V=P.g(o),q=f,I=0;V=p;)V/=2,q/=2,I>>>=1;return(V+I)/q};return j.int32=function(){return P.g(4)|0},j.quick=function(){return P.g(4)/4294967296},j.double=j,C(T(P.S),n),(D.pass||z||function(V,q,I,Y){return Y&&(Y.S&&x(Y,P),V.state=function(){return x(P,{})}),I?(r[u]=V,q):V})(j,B,"global"in D?D.global:this==r,D.state)}function w(N){var D,z=N.length,R=this,B=0,P=R.i=R.j=0,j=R.S=[];for(z||(N=[z++]);B{if(!e||!Array.isArray(e.nodes)||!Array.isArray(e.edges))return!1;for(const t of e.nodes)if(!t.id||!t.labels||!t.properties)return!1;for(const t of e.edges)if(!t.id||!t.source||!t.target)return!1;for(const t of e.edges){const n=e.getNode(t.source),r=e.getNode(t.target);if(n==null||r==null)return!1}return!0},$6=async e=>{let t=null;try{t=await nM(e)}catch(r){return Mn.getState().setErrorMessage(Cr(r),"Query Graphs Error!"),null}let n=null;if(t){const r={},i={};for(let f=0;f0){const f=bz-Qw;for(const d of t.nodes)d.size=Math.round(Qw+f*Math.pow((d.degree-o)/u,.5))}n=new nU,n.nodes=t.nodes,n.edges=t.edges,n.nodeIdMap=r,n.edgeIdMap=i,H6(n)||(n=null,console.error("Invalid graph data")),console.log("Graph data loaded")}return n},V6=e=>{const t=new Ws;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:mz,borderSize:.2});for(const n of(e==null?void 0:e.edges)??[])n.dynamicId=t.addDirectedEdge(n.source,n.target,{label:n.type||void 0});return t},lE={label:""},JA=()=>{const e=Qe.use.queryLabel(),t=yt.use.rawGraph(),n=yt.use.sigmaGraph(),r=E.useCallback(s=>(t==null?void 0:t.getNode(s))||null,[t]),i=E.useCallback((s,u=!0)=>(t==null?void 0:t.getEdge(s,u))||null,[t]);return E.useEffect(()=>{if(e){if(lE.label!==e){lE.label=e;const s=yt.getState();s.reset(),$6(e).then(u=>{s.setSigmaGraph(V6(u)),u==null||u.buildDynamicMap(),s.setRawGraph(u)})}}else{const s=yt.getState();s.reset(),s.setSigmaGraph(new Ws)}},[e]),{lightrageGraph:E.useCallback(()=>{if(n)return n;const s=new Ws;return yt.getState().setSigmaGraph(s),s},[n]),getNode:r,getEdge:i}},Vc=e=>!!(e.type.startsWith("mouse")&&e.buttons!==0),q6=({disableHoverEffect:e})=>{const{lightrageGraph:t}=JA(),n=pr(),r=bA(),i=yA(),o=rB(),{assign:s}=GA({iterations:20}),{theme:u}=hT(),f=Qe.use.enableHideUnselectedEdges(),d=yt.use.selectedNode(),p=yt.use.focusedNode(),m=yt.use.selectedEdge(),v=yt.use.focusedEdge();return E.useEffect(()=>{const g=t();o(g),g.__force_applied||(s(),Object.assign(g,{__force_applied:!0}));const{setFocusedNode:w,setSelectedNode:x,setFocusedEdge:k,setSelectedEdge:C,clearSelection:_}=yt.getState();r({enterNode:T=>{Vc(T.event.original)||w(T.node)},leaveNode:T=>{Vc(T.event.original)||w(null)},clickNode:T=>{x(T.node),C(null)},clickEdge:T=>{C(T.edge),x(null)},enterEdge:T=>{Vc(T.event.original)||k(T.edge)},leaveEdge:T=>{Vc(T.event.original)||k(null)},clickStage:()=>_()})},[s,o,r,t]),E.useEffect(()=>{const g=u==="dark",w=g?dz:void 0,x=g?vz:void 0;i({nodeReducer:(k,C)=>{const _=n.getGraph(),T={...C,highlighted:C.highlighted||!1,labelColor:w};if(!e){T.highlighted=!1;const N=p||d,D=v||m;if(N)(k===N||_.neighbors(N).includes(k))&&(T.highlighted=!0,k===d&&(T.borderColor=gz));else if(D)_.extremities(D).includes(k)&&(T.highlighted=!0,T.size=3);else return T;T.highlighted?g&&(T.labelColor=hz):T.color=pz}return T},edgeReducer:(k,C)=>{const _=n.getGraph(),T={...C,hidden:!1,labelColor:w,color:x};if(!e){const N=p||d;N?f?_.extremities(k).includes(N)||(T.hidden=!0):_.extremities(k).includes(N)&&(T.color=Zw):(v||m)&&(k===m?T.color=yz:k===v?T.color=Zw:f&&(T.hidden=!0))}return T}})},[d,p,m,v,i,n,e,u,f]),null},Y6=()=>{const{zoomIn:e,zoomOut:t,reset:n}=xA({duration:200,factor:1.5}),r=E.useCallback(()=>e(),[e]),i=E.useCallback(()=>t(),[t]),o=E.useCallback(()=>n(),[n]);return S.jsxs(S.Fragment,{children:[S.jsx(Ot,{variant:Hr,onClick:r,tooltip:"Zoom In",size:"icon",children:S.jsx(lP,{})}),S.jsx(Ot,{variant:Hr,onClick:i,tooltip:"Zoom Out",size:"icon",children:S.jsx(uP,{})}),S.jsx(Ot,{variant:Hr,onClick:o,tooltip:"Reset Zoom",size:"icon",children:S.jsx(AM,{})})]})},W6=()=>{const{isFullScreen:e,toggle:t}=iB();return S.jsx(S.Fragment,{children:e?S.jsx(Ot,{variant:Hr,onClick:t,tooltip:"Windowed",size:"icon",children:S.jsx(IM,{})}):S.jsx(Ot,{variant:Hr,onClick:t,tooltip:"Full Screen",size:"icon",children:S.jsx(PM,{})})})};function eR(e){const t=E.useRef({value:e,previous:e});return E.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var Oy="Checkbox",[X6,pK]=hr(Oy),[K6,Z6]=X6(Oy),tR=E.forwardRef((e,t)=>{const{__scopeCheckbox:n,name:r,checked:i,defaultChecked:o,required:s,disabled:u,value:f="on",onCheckedChange:d,form:p,...m}=e,[v,g]=E.useState(null),w=dt(t,N=>g(N)),x=E.useRef(!1),k=v?p||!!v.closest("form"):!0,[C=!1,_]=_i({prop:i,defaultProp:o,onChange:d}),T=E.useRef(C);return E.useEffect(()=>{const N=v==null?void 0:v.form;if(N){const D=()=>_(T.current);return N.addEventListener("reset",D),()=>N.removeEventListener("reset",D)}},[v,_]),S.jsxs(K6,{scope:n,state:C,disabled:u,children:[S.jsx(We.button,{type:"button",role:"checkbox","aria-checked":la(C)?"mixed":C,"aria-required":s,"data-state":iR(C),"data-disabled":u?"":void 0,disabled:u,value:f,...m,ref:w,onKeyDown:qe(e.onKeyDown,N=>{N.key==="Enter"&&N.preventDefault()}),onClick:qe(e.onClick,N=>{_(D=>la(D)?!0:!D),k&&(x.current=N.isPropagationStopped(),x.current||N.stopPropagation())})}),k&&S.jsx(Q6,{control:v,bubbles:!x.current,name:r,value:f,checked:C,required:s,disabled:u,form:p,style:{transform:"translateX(-100%)"},defaultChecked:la(o)?!1:o})]})});tR.displayName=Oy;var nR="CheckboxIndicator",rR=E.forwardRef((e,t)=>{const{__scopeCheckbox:n,forceMount:r,...i}=e,o=Z6(nR,n);return S.jsx(Zn,{present:r||la(o.state)||o.state===!0,children:S.jsx(We.span,{"data-state":iR(o.state),"data-disabled":o.disabled?"":void 0,...i,ref:t,style:{pointerEvents:"none",...e.style}})})});rR.displayName=nR;var Q6=e=>{const{control:t,checked:n,bubbles:r=!0,defaultChecked:i,...o}=e,s=E.useRef(null),u=eR(n),f=DC(t);E.useEffect(()=>{const p=s.current,m=window.HTMLInputElement.prototype,g=Object.getOwnPropertyDescriptor(m,"checked").set;if(u!==n&&g){const w=new Event("click",{bubbles:r});p.indeterminate=la(n),g.call(p,la(n)?!1:n),p.dispatchEvent(w)}},[u,n,r]);const d=E.useRef(la(n)?!1:n);return S.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:i??d.current,...o,tabIndex:-1,ref:s,style:{...e.style,...f,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function la(e){return e==="indeterminate"}function iR(e){return la(e)?"indeterminate":e?"checked":"unchecked"}var aR=tR,J6=rR;const Bs=E.forwardRef(({className:e,...t},n)=>S.jsx(aR,{ref:n,className:Me("peer border-primary ring-offset-background focus-visible:ring-ring data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground h-4 w-4 shrink-0 rounded-sm border focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50",e),...t,children:S.jsx(J6,{className:Me("flex items-center justify-center text-current"),children:S.jsx(Lv,{className:"h-4 w-4"})})}));Bs.displayName=aR.displayName;var eH="Separator",sE="horizontal",tH=["horizontal","vertical"],oR=E.forwardRef((e,t)=>{const{decorative:n,orientation:r=sE,...i}=e,o=nH(r)?r:sE,u=n?{role:"none"}:{"aria-orientation":o==="vertical"?o:void 0,role:"separator"};return S.jsx(We.div,{"data-orientation":o,...u,...i,ref:t})});oR.displayName=eH;function nH(e){return tH.includes(e)}var lR=oR;const Fs=E.forwardRef(({className:e,orientation:t="horizontal",decorative:n=!0,...r},i)=>S.jsx(lR,{ref:i,decorative:n,orientation:t,className:Me("bg-border shrink-0",t==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",e),...r}));Fs.displayName=lR.displayName;const na=({checked:e,onCheckedChange:t,label:n})=>S.jsxs("div",{className:"flex items-center gap-2",children:[S.jsx(Bs,{checked:e,onCheckedChange:t}),S.jsx("label",{htmlFor:"terms",className:"text-sm leading-none font-medium peer-disabled:cursor-not-allowed peer-disabled:opacity-70",children:n})]});function rH(){const[e,t]=E.useState(!1),[n,r]=E.useState(""),i=Qe.use.showPropertyPanel(),o=Qe.use.showNodeSearchBar(),s=Qe.use.showNodeLabel(),u=Qe.use.enableEdgeEvents(),f=Qe.use.enableNodeDrag(),d=Qe.use.enableHideUnselectedEdges(),p=Qe.use.showEdgeLabel(),m=Qe.use.enableHealthCheck(),v=Qe.use.apiKey();E.useEffect(()=>{r(v||"")},[v,e]);const g=E.useCallback(()=>Qe.setState(R=>({enableNodeDrag:!R.enableNodeDrag})),[]),w=E.useCallback(()=>Qe.setState(R=>({enableEdgeEvents:!R.enableEdgeEvents})),[]),x=E.useCallback(()=>Qe.setState(R=>({enableHideUnselectedEdges:!R.enableHideUnselectedEdges})),[]),k=E.useCallback(()=>Qe.setState(R=>({showEdgeLabel:!R.showEdgeLabel})),[]),C=E.useCallback(()=>Qe.setState(R=>({showPropertyPanel:!R.showPropertyPanel})),[]),_=E.useCallback(()=>Qe.setState(R=>({showNodeSearchBar:!R.showNodeSearchBar})),[]),T=E.useCallback(()=>Qe.setState(R=>({showNodeLabel:!R.showNodeLabel})),[]),N=E.useCallback(()=>Qe.setState(R=>({enableHealthCheck:!R.enableHealthCheck})),[]),D=E.useCallback(async()=>{Qe.setState({apiKey:n||null}),await Mn.getState().check(),t(!1)},[n]),z=E.useCallback(R=>{r(R.target.value)},[r]);return S.jsxs(fd,{open:e,onOpenChange:t,children:[S.jsx(dd,{asChild:!0,children:S.jsx(Ot,{variant:Hr,tooltip:"Settings",size:"icon",children:S.jsx(JM,{})})}),S.jsx(uu,{side:"right",align:"start",className:"mb-2 p-2",onCloseAutoFocus:R=>R.preventDefault(),children:S.jsxs("div",{className:"flex flex-col gap-2",children:[S.jsx(na,{checked:i,onCheckedChange:C,label:"Show Property Panel"}),S.jsx(na,{checked:o,onCheckedChange:_,label:"Show Search Bar"}),S.jsx(Fs,{}),S.jsx(na,{checked:s,onCheckedChange:T,label:"Show Node Label"}),S.jsx(na,{checked:f,onCheckedChange:g,label:"Node Draggable"}),S.jsx(Fs,{}),S.jsx(na,{checked:p,onCheckedChange:k,label:"Show Edge Label"}),S.jsx(na,{checked:d,onCheckedChange:x,label:"Hide Unselected Edges"}),S.jsx(na,{checked:u,onCheckedChange:w,label:"Edge Events"}),S.jsx(Fs,{}),S.jsx(na,{checked:m,onCheckedChange:N,label:"Health Check"}),S.jsx(Fs,{}),S.jsxs("div",{className:"flex flex-col gap-2",children:[S.jsx("label",{className:"text-sm font-medium",children:"API Key"}),S.jsxs("form",{className:"flex h-6 gap-2",onSubmit:R=>R.preventDefault(),children:[S.jsx("div",{className:"w-0 flex-1",children:S.jsx(Za,{type:"password",value:n,onChange:z,placeholder:"Enter your API key",className:"max-h-full w-full min-w-0",autoComplete:"off"})}),S.jsx(Ot,{onClick:D,variant:"outline",size:"sm",className:"max-h-full shrink-0",children:"Save"})]})]})]})})]})}const iH="ENTRIES",sR="KEYS",uR="VALUES",sn="";class Hm{constructor(t,n){const r=t._tree,i=Array.from(r.keys());this.set=t,this._type=n,this._path=i.length>0?[{node:r,keys:i}]:[]}next(){const t=this.dive();return this.backtrack(),t}dive(){if(this._path.length===0)return{done:!0,value:void 0};const{node:t,keys:n}=Wo(this._path);if(Wo(n)===sn)return{done:!1,value:this.result()};const r=t.get(Wo(n));return this._path.push({node:r,keys:Array.from(r.keys())}),this.dive()}backtrack(){if(this._path.length===0)return;const t=Wo(this._path).keys;t.pop(),!(t.length>0)&&(this._path.pop(),this.backtrack())}key(){return this.set._prefix+this._path.map(({keys:t})=>Wo(t)).filter(t=>t!==sn).join("")}value(){return Wo(this._path).node.get(sn)}result(){switch(this._type){case uR:return this.value();case sR:return this.key();default:return[this.key(),this.value()]}}[Symbol.iterator](){return this}}const Wo=e=>e[e.length-1],aH=(e,t,n)=>{const r=new Map;if(t===void 0)return r;const i=t.length+1,o=i+n,s=new Uint8Array(o*i).fill(n+1);for(let u=0;u{const f=o*s;e:for(const d of e.keys())if(d===sn){const p=i[f-1];p<=n&&r.set(u,[e.get(d),p])}else{let p=o;for(let m=0;mn)continue e}cR(e.get(d),t,n,r,i,p,s,u+d)}};class oa{constructor(t=new Map,n=""){this._size=void 0,this._tree=t,this._prefix=n}atPrefix(t){if(!t.startsWith(this._prefix))throw new Error("Mismatched prefix");const[n,r]=Df(this._tree,t.slice(this._prefix.length));if(n===void 0){const[i,o]=Ly(r);for(const s of i.keys())if(s!==sn&&s.startsWith(o)){const u=new Map;return u.set(s.slice(o.length),i.get(s)),new oa(u,t)}}return new oa(n,t)}clear(){this._size=void 0,this._tree.clear()}delete(t){return this._size=void 0,oH(this._tree,t)}entries(){return new Hm(this,iH)}forEach(t){for(const[n,r]of this)t(n,r,this)}fuzzyGet(t,n){return aH(this._tree,t,n)}get(t){const n=Zg(this._tree,t);return n!==void 0?n.get(sn):void 0}has(t){const n=Zg(this._tree,t);return n!==void 0&&n.has(sn)}keys(){return new Hm(this,sR)}set(t,n){if(typeof t!="string")throw new Error("key must be a string");return this._size=void 0,$m(this._tree,t).set(sn,n),this}get size(){if(this._size)return this._size;this._size=0;const t=this.entries();for(;!t.next().done;)this._size+=1;return this._size}update(t,n){if(typeof t!="string")throw new Error("key must be a string");this._size=void 0;const r=$m(this._tree,t);return r.set(sn,n(r.get(sn))),this}fetch(t,n){if(typeof t!="string")throw new Error("key must be a string");this._size=void 0;const r=$m(this._tree,t);let i=r.get(sn);return i===void 0&&r.set(sn,i=n()),i}values(){return new Hm(this,uR)}[Symbol.iterator](){return this.entries()}static from(t){const n=new oa;for(const[r,i]of t)n.set(r,i);return n}static fromObject(t){return oa.from(Object.entries(t))}}const Df=(e,t,n=[])=>{if(t.length===0||e==null)return[e,n];for(const r of e.keys())if(r!==sn&&t.startsWith(r))return n.push([e,r]),Df(e.get(r),t.slice(r.length),n);return n.push([e,t]),Df(void 0,"",n)},Zg=(e,t)=>{if(t.length===0||e==null)return e;for(const n of e.keys())if(n!==sn&&t.startsWith(n))return Zg(e.get(n),t.slice(n.length))},$m=(e,t)=>{const n=t.length;e:for(let r=0;e&&r{const[n,r]=Df(e,t);if(n!==void 0){if(n.delete(sn),n.size===0)fR(r);else if(n.size===1){const[i,o]=n.entries().next().value;dR(r,i,o)}}},fR=e=>{if(e.length===0)return;const[t,n]=Ly(e);if(t.delete(n),t.size===0)fR(e.slice(0,-1));else if(t.size===1){const[r,i]=t.entries().next().value;r!==sn&&dR(e.slice(0,-1),r,i)}},dR=(e,t,n)=>{if(e.length===0)return;const[r,i]=Ly(e);r.set(i+t,n),r.delete(i)},Ly=e=>e[e.length-1],zy="or",hR="and",lH="and_not";class sa{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?Ym:t.autoVacuum;this._options={...qm,...t,autoVacuum:n,searchOptions:{...uE,...t.searchOptions||{}},autoSuggestOptions:{...dH,...t.autoSuggestOptions||{}}},this._index=new oa,this._documentCount=0,this._documentIds=new Map,this._idToShortId=new Map,this._fieldIds={},this._fieldLength=new Map,this._avgFieldLength=[],this._nextId=0,this._storedFields=new Map,this._dirtCount=0,this._currentVacuum=null,this._enqueuedVacuum=null,this._enqueuedVacuumConditions=Jg,this.addFields(this._options.fields)}add(t){const{extractField:n,tokenize:r,processTerm:i,fields:o,idField:s}=this._options,u=n(t,s);if(u==null)throw new Error(`MiniSearch: document does not have ID field "${s}"`);if(this._idToShortId.has(u))throw new Error(`MiniSearch: duplicate ID ${u}`);const f=this.addDocumentId(u);this.saveStoredFields(f,t);for(const d of o){const p=n(t,d);if(p==null)continue;const m=r(p.toString(),d),v=this._fieldIds[d],g=new Set(m).size;this.addFieldLength(f,v,this._documentCount-1,g);for(const w of m){const x=i(w,d);if(Array.isArray(x))for(const k of x)this.addTerm(v,f,k);else x&&this.addTerm(v,f,x)}}}addAll(t){for(const n of t)this.add(n)}addAllAsync(t,n={}){const{chunkSize:r=10}=n,i={chunk:[],promise:Promise.resolve()},{chunk:o,promise:s}=t.reduce(({chunk:u,promise:f},d,p)=>(u.push(d),(p+1)%r===0?{chunk:[],promise:f.then(()=>new Promise(m=>setTimeout(m,0))).then(()=>this.addAll(u))}:{chunk:u,promise:f}),i);return s.then(()=>this.addAll(o))}remove(t){const{tokenize:n,processTerm:r,extractField:i,fields:o,idField:s}=this._options,u=i(t,s);if(u==null)throw new Error(`MiniSearch: document does not have ID field "${s}"`);const f=this._idToShortId.get(u);if(f==null)throw new Error(`MiniSearch: cannot remove document with ID ${u}: it is not in the index`);for(const d of o){const p=i(t,d);if(p==null)continue;const m=n(p.toString(),d),v=this._fieldIds[d],g=new Set(m).size;this.removeFieldLength(f,v,this._documentCount,g);for(const w of m){const x=r(w,d);if(Array.isArray(x))for(const k of x)this.removeTerm(v,f,k);else x&&this.removeTerm(v,f,x)}}this._storedFields.delete(f),this._documentIds.delete(f),this._idToShortId.delete(u),this._fieldLength.delete(f),this._documentCount-=1}removeAll(t){if(t)for(const n of t)this.remove(n);else{if(arguments.length>0)throw new Error("Expected documents to be present. Omit the argument to remove all documents.");this._index=new oa,this._documentCount=0,this._documentIds=new Map,this._idToShortId=new Map,this._fieldLength=new Map,this._avgFieldLength=[],this._storedFields=new Map,this._nextId=0}}discard(t){const n=this._idToShortId.get(t);if(n==null)throw new Error(`MiniSearch: cannot discard document with ID ${t}: it is not in the index`);this._idToShortId.delete(t),this._documentIds.delete(n),this._storedFields.delete(n),(this._fieldLength.get(n)||[]).forEach((r,i)=>{this.removeFieldLength(n,i,this._documentCount,r)}),this._fieldLength.delete(n),this._documentCount-=1,this._dirtCount+=1,this.maybeAutoVacuum()}maybeAutoVacuum(){if(this._options.autoVacuum===!1)return;const{minDirtFactor:t,minDirtCount:n,batchSize:r,batchWait:i}=this._options.autoVacuum;this.conditionalVacuum({batchSize:r,batchWait:i},{minDirtCount:n,minDirtFactor:t})}discardAll(t){const n=this._options.autoVacuum;try{this._options.autoVacuum=!1;for(const r of t)this.discard(r)}finally{this._options.autoVacuum=n}this.maybeAutoVacuum()}replace(t){const{idField:n,extractField:r}=this._options,i=r(t,n);this.discard(i),this.add(t)}vacuum(t={}){return this.conditionalVacuum(t)}conditionalVacuum(t,n){return this._currentVacuum?(this._enqueuedVacuumConditions=this._enqueuedVacuumConditions&&n,this._enqueuedVacuum!=null?this._enqueuedVacuum:(this._enqueuedVacuum=this._currentVacuum.then(()=>{const r=this._enqueuedVacuumConditions;return this._enqueuedVacuumConditions=Jg,this.performVacuuming(t,r)}),this._enqueuedVacuum)):this.vacuumConditionsMet(n)===!1?Promise.resolve():(this._currentVacuum=this.performVacuuming(t),this._currentVacuum)}async performVacuuming(t,n){const r=this._dirtCount;if(this.vacuumConditionsMet(n)){const i=t.batchSize||Qg.batchSize,o=t.batchWait||Qg.batchWait;let s=1;for(const[u,f]of this._index){for(const[d,p]of f)for(const[m]of p)this._documentIds.has(m)||(p.size<=1?f.delete(d):p.delete(m));this._index.get(u).size===0&&this._index.delete(u),s%i===0&&await new Promise(d=>setTimeout(d,o)),s+=1}this._dirtCount-=r}await null,this._currentVacuum=this._enqueuedVacuum,this._enqueuedVacuum=null}vacuumConditionsMet(t){if(t==null)return!0;let{minDirtCount:n,minDirtFactor:r}=t;return n=n||Ym.minDirtCount,r=r||Ym.minDirtFactor,this.dirtCount>=n&&this.dirtFactor>=r}get isVacuuming(){return this._currentVacuum!=null}get dirtCount(){return this._dirtCount}get dirtFactor(){return this._dirtCount/(1+this._documentCount+this._dirtCount)}has(t){return this._idToShortId.has(t)}getStoredFields(t){const n=this._idToShortId.get(t);if(n!=null)return this._storedFields.get(n)}search(t,n={}){const{searchOptions:r}=this._options,i={...r,...n},o=this.executeQuery(t,n),s=[];for(const[u,{score:f,terms:d,match:p}]of o){const m=d.length||1,v={id:this._documentIds.get(u),score:f*m,terms:Object.keys(p),queryTerms:d,match:p};Object.assign(v,this._storedFields.get(u)),(i.filter==null||i.filter(v))&&s.push(v)}return t===sa.wildcard&&i.boostDocument==null||s.sort(fE),s}autoSuggest(t,n={}){n={...this._options.autoSuggestOptions,...n};const r=new Map;for(const{score:o,terms:s}of this.search(t,n)){const u=s.join(" "),f=r.get(u);f!=null?(f.score+=o,f.count+=1):r.set(u,{score:o,terms:s,count:1})}const i=[];for(const[o,{score:s,terms:u,count:f}]of r)i.push({suggestion:o,terms:u,score:s/f});return i.sort(fE),i}get documentCount(){return this._documentCount}get termCount(){return this._index.size}static loadJSON(t,n){if(n==null)throw new Error("MiniSearch: loadJSON should be given the same options used when serializing the index");return this.loadJS(JSON.parse(t),n)}static async loadJSONAsync(t,n){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(qm.hasOwnProperty(t))return Vm(qm,t);throw new Error(`MiniSearch: unknown option "${t}"`)}static loadJS(t,n){const{index:r,documentIds:i,fieldLength:o,storedFields:s,serializationVersion:u}=t,f=this.instantiateMiniSearch(t,n);f._documentIds=qc(i),f._fieldLength=qc(o),f._storedFields=qc(s);for(const[d,p]of f._documentIds)f._idToShortId.set(p,d);for(const[d,p]of r){const m=new Map;for(const v of Object.keys(p)){let g=p[v];u===1&&(g=g.ds),m.set(parseInt(v,10),qc(g))}f._index.set(d,m)}return f}static async loadJSAsync(t,n){const{index:r,documentIds:i,fieldLength:o,storedFields:s,serializationVersion:u}=t,f=this.instantiateMiniSearch(t,n);f._documentIds=await Yc(i),f._fieldLength=await Yc(o),f._storedFields=await Yc(s);for(const[p,m]of f._documentIds)f._idToShortId.set(m,p);let d=0;for(const[p,m]of r){const v=new Map;for(const g of Object.keys(m)){let w=m[g];u===1&&(w=w.ds),v.set(parseInt(g,10),await Yc(w))}++d%1e3===0&&await pR(0),f._index.set(p,v)}return f}static instantiateMiniSearch(t,n){const{documentCount:r,nextId:i,fieldIds:o,averageFieldLength:s,dirtCount:u,serializationVersion:f}=t;if(f!==1&&f!==2)throw new Error("MiniSearch: cannot deserialize an index created with an incompatible version");const d=new sa(n);return d._documentCount=r,d._nextId=i,d._idToShortId=new Map,d._fieldIds=o,d._avgFieldLength=s,d._dirtCount=u||0,d._index=new oa,d}executeQuery(t,n={}){if(t===sa.wildcard)return this.executeWildcardQuery(n);if(typeof t!="string"){const v={...n,...t,queries:void 0},g=t.queries.map(w=>this.executeQuery(w,v));return this.combineResults(g,v.combineWith)}const{tokenize:r,processTerm:i,searchOptions:o}=this._options,s={tokenize:r,processTerm:i,...o,...n},{tokenize:u,processTerm:f}=s,m=u(t).flatMap(v=>f(v)).filter(v=>!!v).map(fH(s)).map(v=>this.executeQuerySpec(v,s));return this.combineResults(m,s.combineWith)}executeQuerySpec(t,n){const r={...this._options.searchOptions,...n},i=(r.fields||this._options.fields).reduce((x,k)=>({...x,[k]:Vm(r.boost,k)||1}),{}),{boostDocument:o,weights:s,maxFuzzy:u,bm25:f}=r,{fuzzy:d,prefix:p}={...uE.weights,...s},m=this._index.get(t.term),v=this.termResults(t.term,t.term,1,t.termBoost,m,i,o,f);let g,w;if(t.prefix&&(g=this._index.atPrefix(t.term)),t.fuzzy){const x=t.fuzzy===!0?.2:t.fuzzy,k=x<1?Math.min(u,Math.round(t.term.length*x)):x;k&&(w=this._index.fuzzyGet(t.term,k))}if(g)for(const[x,k]of g){const C=x.length-t.term.length;if(!C)continue;w==null||w.delete(x);const _=p*x.length/(x.length+.3*C);this.termResults(t.term,x,_,t.termBoost,k,i,o,f,v)}if(w)for(const x of w.keys()){const[k,C]=w.get(x);if(!C)continue;const _=d*x.length/(x.length+C);this.termResults(t.term,x,_,t.termBoost,k,i,o,f,v)}return v}executeWildcardQuery(t){const n=new Map,r={...this._options.searchOptions,...t};for(const[i,o]of this._documentIds){const s=r.boostDocument?r.boostDocument(o,"",this._storedFields.get(i)):1;n.set(i,{score:s,terms:[],match:{}})}return n}combineResults(t,n=zy){if(t.length===0)return new Map;const r=n.toLowerCase(),i=sH[r];if(!i)throw new Error(`Invalid combination operator: ${n}`);return t.reduce(i)||new Map}toJSON(){const t=[];for(const[n,r]of this._index){const i={};for(const[o,s]of r)i[o]=Object.fromEntries(s);t.push([n,i])}return{documentCount:this._documentCount,nextId:this._nextId,documentIds:Object.fromEntries(this._documentIds),fieldIds:this._fieldIds,fieldLength:Object.fromEntries(this._fieldLength),averageFieldLength:this._avgFieldLength,storedFields:Object.fromEntries(this._storedFields),dirtCount:this._dirtCount,index:t,serializationVersion:2}}termResults(t,n,r,i,o,s,u,f,d=new Map){if(o==null)return d;for(const p of Object.keys(s)){const m=s[p],v=this._fieldIds[p],g=o.get(v);if(g==null)continue;let w=g.size;const x=this._avgFieldLength[v];for(const k of g.keys()){if(!this._documentIds.has(k)){this.removeTerm(v,k,n),w-=1;continue}const C=u?u(this._documentIds.get(k),n,this._storedFields.get(k)):1;if(!C)continue;const _=g.get(k),T=this._fieldLength.get(k)[v],N=cH(_,w,this._documentCount,T,x,f),D=r*i*m*C*N,z=d.get(k);if(z){z.score+=D,hH(z.terms,t);const R=Vm(z.match,n);R?R.push(p):z.match[n]=[p]}else d.set(k,{score:D,terms:[t],match:{[n]:[p]}})}}return d}addTerm(t,n,r){const i=this._index.fetch(r,dE);let o=i.get(t);if(o==null)o=new Map,o.set(n,1),i.set(t,o);else{const s=o.get(n);o.set(n,(s||0)+1)}}removeTerm(t,n,r){if(!this._index.has(r)){this.warnDocumentChanged(n,t,r);return}const i=this._index.fetch(r,dE),o=i.get(t);o==null||o.get(n)==null?this.warnDocumentChanged(n,t,r):o.get(n)<=1?o.size<=1?i.delete(t):o.delete(n):o.set(n,o.get(n)-1),this._index.get(r).size===0&&this._index.delete(r)}warnDocumentChanged(t,n,r){for(const i of Object.keys(this._fieldIds))if(this._fieldIds[i]===n){this._options.logger("warn",`MiniSearch: document with ID ${this._documentIds.get(t)} has changed before removal: term "${r}" was not present in field "${i}". Removing a document after it has changed can corrupt the index!`,"version_conflict");return}}addDocumentId(t){const n=this._nextId;return this._idToShortId.set(t,n),this._documentIds.set(n,t),this._documentCount+=1,this._nextId+=1,n}addFields(t){for(let n=0;nObject.prototype.hasOwnProperty.call(e,t)?e[t]:void 0,sH={[zy]:(e,t)=>{for(const n of t.keys()){const r=e.get(n);if(r==null)e.set(n,t.get(n));else{const{score:i,terms:o,match:s}=t.get(n);r.score=r.score+i,r.match=Object.assign(r.match,s),cE(r.terms,o)}}return e},[hR]:(e,t)=>{const n=new Map;for(const r of t.keys()){const i=e.get(r);if(i==null)continue;const{score:o,terms:s,match:u}=t.get(r);cE(i.terms,s),n.set(r,{score:i.score+o,terms:i.terms,match:Object.assign(i.match,u)})}return n},[lH]:(e,t)=>{for(const n of t.keys())e.delete(n);return e}},uH={k:1.2,b:.7,d:.5},cH=(e,t,n,r,i,o)=>{const{k:s,b:u,d:f}=o;return Math.log(1+(n-t+.5)/(t+.5))*(f+e*(s+1)/(e+s*(1-u+u*r/i)))},fH=e=>(t,n,r)=>{const i=typeof e.fuzzy=="function"?e.fuzzy(t,n,r):e.fuzzy||!1,o=typeof e.prefix=="function"?e.prefix(t,n,r):e.prefix===!0,s=typeof e.boostTerm=="function"?e.boostTerm(t,n,r):1;return{term:t,fuzzy:i,prefix:o,termBoost:s}},qm={idField:"id",extractField:(e,t)=>e[t],tokenize:e=>e.split(pH),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},uE={combineWith:zy,prefix:!1,fuzzy:!1,maxFuzzy:6,boost:{},weights:{fuzzy:.45,prefix:.375},bm25:uH},dH={combineWith:hR,prefix:(e,t,n)=>t===n.length-1},Qg={batchSize:1e3,batchWait:10},Jg={minDirtFactor:.1,minDirtCount:20},Ym={...Qg,...Jg},hH=(e,t)=>{e.includes(t)||e.push(t)},cE=(e,t)=>{for(const n of t)e.includes(n)||e.push(n)},fE=({score:e},{score:t})=>t-e,dE=()=>new Map,qc=e=>{const t=new Map;for(const n of Object.keys(e))t.set(parseInt(n,10),e[n]);return t},Yc=async e=>{const t=new Map;let n=0;for(const r of Object.keys(e))t.set(parseInt(r,10),e[r]),++n%1e3===0&&await pR(0);return t},pR=e=>new Promise(t=>setTimeout(t,e)),pH=/[\n\r\p{Z}\p{P}]+/u,mH={index:new sa({fields:[]})};E.createContext(mH);const ev=({label:e,color:t,hidden:n,labels:r={}})=>be.createElement("div",{className:"node"},be.createElement("span",{className:"render "+(n?"circle":"disc"),style:{backgroundColor:t||"#000"}}),be.createElement("span",{className:`label ${n?"text-muted":""} ${e?"":"text-italic"}`},e||r.no_label||"No label")),gH=({id:e,labels:t})=>{const n=pr(),r=E.useMemo(()=>{const i=n.getGraph().getNodeAttributes(e),o=n.getSetting("nodeReducer");return Object.assign(Object.assign({color:n.getSetting("defaultNodeColor")},i),o?o(e,i):{})},[n,e]);return be.createElement(ev,Object.assign({},r,{labels:t}))},vH=({label:e,color:t,source:n,target:r,hidden:i,directed:o,labels:s={}})=>be.createElement("div",{className:"edge"},be.createElement(ev,Object.assign({},n,{labels:s})),be.createElement("div",{className:"body"},be.createElement("div",{className:"render"},be.createElement("span",{className:i?"dotted":"dash",style:{borderColor:t||"#000"}})," ",o&&be.createElement("span",{className:"arrow",style:{borderTopColor:t||"#000"}})),be.createElement("span",{className:`label ${i?"text-muted":""} ${e?"":"fst-italic"}`},e||s.no_label||"No label")),be.createElement(ev,Object.assign({},r,{labels:s}))),yH=({id:e,labels:t})=>{const n=pr(),r=E.useMemo(()=>{const i=n.getGraph().getEdgeAttributes(e),o=n.getSetting("nodeReducer"),s=n.getSetting("edgeReducer"),u=n.getGraph().getNodeAttributes(n.getGraph().source(e)),f=n.getGraph().getNodeAttributes(n.getGraph().target(e));return Object.assign(Object.assign(Object.assign({color:n.getSetting("defaultEdgeColor"),directed:n.getGraph().isDirected(e)},i),s?s(e,i):{}),{source:Object.assign(Object.assign({color:n.getSetting("defaultNodeColor")},u),o?o(e,u):{}),target:Object.assign(Object.assign({color:n.getSetting("defaultNodeColor")},f),o?o(e,f):{})})},[n,e]);return be.createElement(vH,Object.assign({},r,{labels:t}))};function jy(e,t){const[n,r]=E.useState(e);return E.useEffect(()=>{const i=setTimeout(()=>{r(e)},t);return()=>{clearTimeout(i)}},[e,t]),n}function bH({fetcher:e,preload:t,filterFn:n,renderOption:r,getOptionValue:i,notFound:o,loadingSkeleton:s,label:u,placeholder:f="Select...",value:d,onChange:p,onFocus:m,disabled:v=!1,className:g,noResultsMessage:w}){const[x,k]=E.useState(!1),[C,_]=E.useState(!1),[T,N]=E.useState([]),[D,z]=E.useState(!1),[R,B]=E.useState(null),[P,j]=E.useState(d),[V,q]=E.useState(null),[I,Y]=E.useState(""),Z=jy(I,t?0:150),[U,G]=E.useState([]);E.useEffect(()=>{k(!0),j(d)},[d]),E.useEffect(()=>{x||(async()=>{try{z(!0),B(null);const $=d!==null?await e(d):[];G($),N($)}catch($){B($ instanceof Error?$.message:"Failed to fetch options")}finally{z(!1)}})()},[x,e,d]),E.useEffect(()=>{const A=async()=>{try{z(!0),B(null);const $=await e(Z);G($),N($)}catch($){B($ instanceof Error?$.message:"Failed to fetch options")}finally{z(!1)}};x&&t?t&&N(Z?U.filter($=>n?n($,Z):!0):U):A()},[e,Z,x,t,n]);const F=E.useCallback(A=>{A!==P&&(j(A),p(A)),_(!1)},[P,j,_,p]),K=E.useCallback(A=>{A!==V&&(q(A),m(A))},[V,q,m]);return S.jsx("div",{className:Me(v&&"cursor-not-allowed opacity-50",g),onFocus:()=>{_(!0)},onBlur:()=>_(!1),children:S.jsxs(yd,{shouldFilter:!1,className:"bg-transparent",children:[S.jsxs("div",{children:[S.jsx(Dy,{placeholder:f,value:I,className:"max-h-8",onValueChange:A=>{Y(A),A&&!C&&_(!0)}}),D&&T.length>0&&S.jsx("div",{className:"absolute top-1/2 right-2 flex -translate-y-1/2 transform items-center",children:S.jsx(Sk,{className:"h-4 w-4 animate-spin"})})]}),S.jsxs(bd,{hidden:!C||Z.length===0,children:[R&&S.jsx("div",{className:"text-destructive p-4 text-center",children:R}),D&&T.length===0&&(s||S.jsx(xH,{})),!D&&!R&&T.length===0&&(o||S.jsx(Ny,{children:w??`No ${u.toLowerCase()} found.`})),S.jsx(Cl,{children:T.map((A,$)=>S.jsxs(S.Fragment,{children:[S.jsx(Tl,{value:i(A),onSelect:F,onMouseEnter:()=>K(i(A)),className:"truncate",children:r(A)},i(A)+`${$}`),$!==T.length-1&&S.jsx("div",{className:"bg-foreground/10 h-[1px]"},$)]}))})]})]})})}function xH(){return S.jsx(Cl,{children:S.jsx(Tl,{disabled:!0,children:S.jsxs("div",{className:"flex w-full items-center gap-2",children:[S.jsx("div",{className:"bg-muted h-6 w-6 animate-pulse rounded-full"}),S.jsxs("div",{className:"flex flex-1 flex-col gap-1",children:[S.jsx("div",{className:"bg-muted h-4 w-24 animate-pulse rounded"}),S.jsx("div",{className:"bg-muted h-3 w-16 animate-pulse rounded"})]})]})})})}function wH(e){return S.jsxs("div",{children:[e.type==="nodes"&&S.jsx(gH,{id:e.id}),e.type==="edges"&&S.jsx(yH,{id:e.id}),e.type==="message"&&S.jsx("div",{children:e.message})]})}const Wm="__message_item",Wc={graph:null,searchEngine:null},SH=({onChange:e,onFocus:t,value:n})=>{const r=yt.use.sigmaGraph(),i=E.useMemo(()=>{if(Wc.graph==r)return Wc.searchEngine;if(!r||r.nodes().length==0)return;Wc.graph=r;const s=new sa({idField:"id",fields:["label"],searchOptions:{prefix:!0,fuzzy:.2,boost:{label:2}}}),u=r.nodes().map(f=>({id:f,label:r.getNodeAttribute(f,"label")}));return s.addAll(u),Wc.searchEngine=s,s},[r]),o=E.useCallback(async s=>{if(t&&t(null),!s||!i)return[];const u=i.search(s).map(f=>({id:f.id,type:"nodes"}));return u.length<=$p?u:[...u.slice(0,$p),{type:"message",id:Wm,message:`And ${u.length-$p} others`}]},[i,t]);return S.jsx(bH,{className:"bg-background/60 w-24 rounded-xl border-1 opacity-60 backdrop-blur-lg transition-all hover:w-fit hover:opacity-100",fetcher:o,renderOption:wH,getOptionValue:s=>s.id,value:n&&n.type!=="message"?n.id:null,onChange:s=>{s!==Wm&&e(s?{id:s,type:"nodes"}:null)},onFocus:s=>{s!==Wm&&t&&t(s?{id:s,type:"nodes"}:null)},label:"item",placeholder:"Search nodes..."})},EH=({...e})=>S.jsx(SH,{...e});function _H({fetcher:e,preload:t,filterFn:n,renderOption:r,getOptionValue:i,getDisplayValue:o,notFound:s,loadingSkeleton:u,label:f,placeholder:d="Select...",value:p,onChange:m,disabled:v=!1,className:g,triggerClassName:w,searchInputClassName:x,noResultsMessage:k,triggerTooltip:C,clearable:_=!0}){const[T,N]=E.useState(!1),[D,z]=E.useState(!1),[R,B]=E.useState([]),[P,j]=E.useState(!1),[V,q]=E.useState(null),[I,Y]=E.useState(p),[Z,U]=E.useState(null),[G,F]=E.useState(""),K=jy(G,t?0:150),[A,$]=E.useState([]);E.useEffect(()=>{N(!0),Y(p)},[p]),E.useEffect(()=>{if(p&&R.length>0){const O=R.find(X=>i(X)===p);O&&U(O)}},[p,R,i]),E.useEffect(()=>{T||(async()=>{try{j(!0),q(null);const X=await e(p);$(X),B(X)}catch(X){q(X instanceof Error?X.message:"Failed to fetch options")}finally{j(!1)}})()},[T,e,p]),E.useEffect(()=>{const O=async()=>{try{j(!0),q(null);const X=await e(K);$(X),B(X)}catch(X){q(X instanceof Error?X.message:"Failed to fetch options")}finally{j(!1)}};T&&t?t&&B(K?A.filter(X=>n?n(X,K):!0):A):O()},[e,K,T,t,n]);const M=E.useCallback(O=>{const X=_&&O===I?"":O;Y(X),U(R.find(re=>i(re)===X)||null),m(X),z(!1)},[I,m,_,R,i]);return S.jsxs(fd,{open:D,onOpenChange:z,children:[S.jsx(dd,{asChild:!0,children:S.jsxs(Ot,{variant:"outline",role:"combobox","aria-expanded":D,className:Me("justify-between",v&&"cursor-not-allowed opacity-50",w),disabled:v,tooltip:C,side:"bottom",children:[Z?o(Z):d,S.jsx(bM,{className:"opacity-50",size:10})]})}),S.jsx(uu,{className:Me("p-0",g),onCloseAutoFocus:O=>O.preventDefault(),children:S.jsxs(yd,{shouldFilter:!1,children:[S.jsxs("div",{className:"relative w-full border-b",children:[S.jsx(Dy,{placeholder:`Search ${f.toLowerCase()}...`,value:G,onValueChange:O=>{F(O)},className:x}),P&&R.length>0&&S.jsx("div",{className:"absolute top-1/2 right-2 flex -translate-y-1/2 transform items-center",children:S.jsx(Sk,{className:"h-4 w-4 animate-spin"})})]}),S.jsxs(bd,{children:[V&&S.jsx("div",{className:"text-destructive p-4 text-center",children:V}),P&&R.length===0&&(u||S.jsx(kH,{})),!P&&!V&&R.length===0&&(s||S.jsx(Ny,{children:k??`No ${f.toLowerCase()} found.`})),S.jsx(Cl,{children:R.map(O=>S.jsxs(Tl,{value:i(O),onSelect:M,className:"truncate",children:[r(O),S.jsx(Lv,{className:Me("ml-auto h-3 w-3",I===i(O)?"opacity-100":"opacity-0")})]},i(O)))})]})]})})]})}function kH(){return S.jsx(Cl,{children:S.jsx(Tl,{disabled:!0,children:S.jsxs("div",{className:"flex w-full items-center gap-2",children:[S.jsx("div",{className:"bg-muted h-6 w-6 animate-pulse rounded-full"}),S.jsxs("div",{className:"flex flex-1 flex-col gap-1",children:[S.jsx("div",{className:"bg-muted h-4 w-24 animate-pulse rounded"}),S.jsx("div",{className:"bg-muted h-3 w-16 animate-pulse rounded"})]})]})})})}const CH=()=>{const e=Qe.use.queryLabel(),[t,n]=E.useState({labels:[],searchEngine:null}),[r,i]=E.useState(!1),o=E.useCallback(async u=>{let f=t.labels,d=t.searchEngine;if(!r||!d){f=["*"].concat(await rM()),f.includes(Qe.getState().queryLabel)||Qe.getState().setQueryLabel(f[0]),d=new sa({idField:"id",fields:["value"],searchOptions:{prefix:!0,fuzzy:.2,boost:{label:2}}});const p=f.map((m,v)=>({id:v,value:m}));d.addAll(p),n({labels:f,searchEngine:d}),i(!0)}return u?d.search(u).map(p=>f[p.id]):f},[t,r,n,i]),s=E.useCallback(u=>{Qe.getState().setQueryLabel(u)},[]);return S.jsx(_H,{className:"ml-2",triggerClassName:"max-h-8",searchInputClassName:"max-h-8",triggerTooltip:"Select query label",fetcher:o,renderOption:u=>S.jsx("div",{children:u}),getOptionValue:u=>u,getDisplayValue:u=>S.jsx("div",{children:u}),notFound:S.jsx("div",{className:"py-6 text-center text-sm",children:"No labels found"}),label:"Label",placeholder:"Search labels...",value:e!==null?e:"",onChange:s})},Ln=({text:e,className:t,tooltipClassName:n,tooltip:r,side:i,onClick:o})=>r?S.jsx(WC,{delayDuration:200,children:S.jsxs(XC,{children:[S.jsx(KC,{asChild:!0,children:S.jsx("label",{className:Me(t,o!==void 0?"cursor-pointer":void 0),onClick:o,children:e})}),S.jsx(ly,{side:i,className:n,children:r})]})}):S.jsx("label",{className:Me(t,o!==void 0?"cursor-pointer":void 0),onClick:o,children:e}),TH=()=>{const{getNode:e,getEdge:t}=JA(),n=yt.use.selectedNode(),r=yt.use.focusedNode(),i=yt.use.selectedEdge(),o=yt.use.focusedEdge(),[s,u]=E.useState(null),[f,d]=E.useState(null);return E.useEffect(()=>{let p=null,m=null;r?(p="node",m=e(r)):n?(p="node",m=e(n)):o?(p="edge",m=t(o,!0)):i&&(p="edge",m=t(i,!0)),m?(p=="node"?u(AH(m)):u(RH(m)),d(p)):(u(null),d(null))},[r,n,o,i,u,d,e,t]),s?S.jsx("div",{className:"bg-background/80 max-w-xs rounded-lg border-2 p-2 text-xs backdrop-blur-lg",children:f=="node"?S.jsx(DH,{node:s}):S.jsx(NH,{edge:s})}):S.jsx(S.Fragment,{})},AH=e=>{const t=yt.getState(),n=[];if(t.sigmaGraph&&t.rawGraph)for(const r of t.sigmaGraph.edges(e.id)){const i=t.rawGraph.getEdge(r,!0);if(i){const o=e.id===i.source,s=o?i.target:i.source,u=t.rawGraph.getNode(s);u&&n.push({type:o?"Target":"Source",id:s,label:u.labels.join(", ")})}}return{...e,relationships:n}},RH=e=>{var i,o;const t=yt.getState(),n=(i=t.rawGraph)==null?void 0:i.getNode(e.source),r=(o=t.rawGraph)==null?void 0:o.getNode(e.target);return{...e,sourceNode:n,targetNode:r}},Ur=({name:e,value:t,onClick:n,tooltip:r})=>S.jsxs("div",{className:"flex items-center gap-2",children:[S.jsx("label",{className:"text-primary/60 tracking-wide",children:e}),":",S.jsx(Ln,{className:"hover:bg-primary/20 rounded p-1 text-ellipsis",tooltipClassName:"max-w-80",text:t,tooltip:r||t,side:"left",onClick:n})]}),DH=({node:e})=>S.jsxs("div",{className:"flex flex-col gap-2",children:[S.jsx("label",{className:"text-md pl-1 font-bold tracking-wide text-sky-300",children:"Node"}),S.jsxs("div",{className:"bg-primary/5 max-h-96 overflow-auto rounded p-1",children:[S.jsx(Ur,{name:"Id",value:e.id}),S.jsx(Ur,{name:"Labels",value:e.labels.join(", "),onClick:()=>{yt.getState().setSelectedNode(e.id,!0)}}),S.jsx(Ur,{name:"Degree",value:e.degree})]}),S.jsx("label",{className:"text-md pl-1 font-bold tracking-wide text-yellow-400/90",children:"Properties"}),S.jsx("div",{className:"bg-primary/5 max-h-96 overflow-auto rounded p-1",children:Object.keys(e.properties).sort().map(t=>S.jsx(Ur,{name:t,value:e.properties[t]},t))}),e.relationships.length>0&&S.jsxs(S.Fragment,{children:[S.jsx("label",{className:"text-md pl-1 font-bold tracking-wide text-teal-600/90",children:"Relationships"}),S.jsx("div",{className:"bg-primary/5 max-h-96 overflow-auto rounded p-1",children:e.relationships.map(({type:t,id:n,label:r})=>S.jsx(Ur,{name:t,value:r,onClick:()=>{yt.getState().setSelectedNode(n,!0)}},n))})]})]}),NH=({edge:e})=>S.jsxs("div",{className:"flex flex-col gap-2",children:[S.jsx("label",{className:"text-md pl-1 font-bold tracking-wide text-teal-600",children:"Relationship"}),S.jsxs("div",{className:"bg-primary/5 max-h-96 overflow-auto rounded p-1",children:[S.jsx(Ur,{name:"Id",value:e.id}),e.type&&S.jsx(Ur,{name:"Type",value:e.type}),S.jsx(Ur,{name:"Source",value:e.sourceNode?e.sourceNode.labels.join(", "):e.source,onClick:()=>{yt.getState().setSelectedNode(e.source,!0)}}),S.jsx(Ur,{name:"Target",value:e.targetNode?e.targetNode.labels.join(", "):e.target,onClick:()=>{yt.getState().setSelectedNode(e.target,!0)}})]}),S.jsx("label",{className:"text-md pl-1 font-bold tracking-wide text-yellow-400/90",children:"Properties"}),S.jsx("div",{className:"bg-primary/5 max-h-96 overflow-auto rounded p-1",children:Object.keys(e.properties).sort().map(t=>S.jsx(Ur,{name:t,value:e.properties[t]},t))})]}),hE={allowInvalidContainer:!0,defaultNodeType:"default",defaultEdgeType:"curvedArrow",renderEdgeLabels:!1,edgeProgramClasses:{arrow:fA,curvedArrow:tU,curvedNoArrow:eU},nodeProgramClasses:{default:PB,circel:fu,point:fB},labelGridCellSize:60,labelRenderedSizeThreshold:12,enableEdgeEvents:!0,labelColor:{color:"#000",attribute:"labelColor"},edgeLabelColor:{color:"#000",attribute:"labelColor"},edgeLabelSize:8,labelSize:12},OH=()=>{const e=bA(),t=pr(),[n,r]=E.useState(null);return E.useEffect(()=>{e({downNode:i=>{r(i.node),t.getGraph().setNodeAttribute(i.node,"highlighted",!0)},mousemovebody:i=>{if(!n)return;const o=t.viewportToGraph(i);t.getGraph().setNodeAttribute(n,"x",o.x),t.getGraph().setNodeAttribute(n,"y",o.y),i.preventSigmaDefault(),i.original.preventDefault(),i.original.stopPropagation()},mouseup:()=>{n&&(r(null),t.getGraph().removeNodeAttribute(n,"highlighted"))},mousedown:()=>{t.getCustomBBox()||t.setCustomBBox(t.getBBox())}})},[e,t,n]),null},LH=()=>{const[e,t]=E.useState(hE),n=yt.use.selectedNode(),r=yt.use.focusedNode(),i=yt.use.moveToSelectedNode(),o=Qe.use.showPropertyPanel(),s=Qe.use.showNodeSearchBar(),u=Qe.use.showNodeLabel(),f=Qe.use.enableEdgeEvents(),d=Qe.use.enableNodeDrag(),p=Qe.use.showEdgeLabel();E.useEffect(()=>{t({...hE,enableEdgeEvents:f,renderEdgeLabels:p,renderLabels:u})},[u,f,p]);const m=E.useCallback(x=>{x===null?yt.getState().setFocusedNode(null):x.type==="nodes"&&yt.getState().setFocusedNode(x.id)},[]),v=E.useCallback(x=>{x===null?yt.getState().setSelectedNode(null):x.type==="nodes"&&yt.getState().setSelectedNode(x.id,!0)},[]),g=E.useMemo(()=>r??n,[r,n]),w=E.useMemo(()=>n?{type:"nodes",id:n}:null,[n]);return S.jsxs(aB,{settings:e,className:"!bg-background !size-full overflow-hidden",children:[S.jsx(q6,{}),d&&S.jsx(OH,{}),S.jsx(iU,{node:g,move:i}),S.jsxs("div",{className:"absolute top-2 left-2 flex items-start gap-2",children:[S.jsx(CH,{}),s&&S.jsx(EH,{value:w,onFocus:m,onChange:v})]}),S.jsxs("div",{className:"bg-background/60 absolute bottom-2 left-2 flex flex-col rounded-xl border-2 backdrop-blur-lg",children:[S.jsx(rH,{}),S.jsx(Y6,{}),S.jsx(S6,{}),S.jsx(W6,{})]}),o&&S.jsx("div",{className:"absolute top-2 right-2",children:S.jsx(TH,{})})]})},mR=E.forwardRef(({className:e,...t},n)=>S.jsx("div",{className:"relative w-full overflow-auto",children:S.jsx("table",{ref:n,className:Me("w-full caption-bottom text-sm",e),...t})}));mR.displayName="Table";const gR=E.forwardRef(({className:e,...t},n)=>S.jsx("thead",{ref:n,className:Me("[&_tr]:border-b",e),...t}));gR.displayName="TableHeader";const vR=E.forwardRef(({className:e,...t},n)=>S.jsx("tbody",{ref:n,className:Me("[&_tr:last-child]:border-0",e),...t}));vR.displayName="TableBody";const zH=E.forwardRef(({className:e,...t},n)=>S.jsx("tfoot",{ref:n,className:Me("bg-muted/50 border-t font-medium [&>tr]:last:border-b-0",e),...t}));zH.displayName="TableFooter";const tv=E.forwardRef(({className:e,...t},n)=>S.jsx("tr",{ref:n,className:Me("hover:bg-muted/50 data-[state=selected]:bg-muted border-b transition-colors",e),...t}));tv.displayName="TableRow";const bi=E.forwardRef(({className:e,...t},n)=>S.jsx("th",{ref:n,className:Me("text-muted-foreground h-10 px-2 text-left align-middle font-medium [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...t}));bi.displayName="TableHead";const xi=E.forwardRef(({className:e,...t},n)=>S.jsx("td",{ref:n,className:Me("p-2 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...t}));xi.displayName="TableCell";const jH=E.forwardRef(({className:e,...t},n)=>S.jsx("caption",{ref:n,className:Me("text-muted-foreground mt-4 text-sm",e),...t}));jH.displayName="TableCaption";const Ks=E.forwardRef(({className:e,...t},n)=>S.jsx("div",{ref:n,className:Me("bg-card text-card-foreground rounded-xl border shadow",e),...t}));Ks.displayName="Card";const Nf=E.forwardRef(({className:e,...t},n)=>S.jsx("div",{ref:n,className:Me("flex flex-col space-y-1.5 p-6",e),...t}));Nf.displayName="CardHeader";const Zs=E.forwardRef(({className:e,...t},n)=>S.jsx("div",{ref:n,className:Me("leading-none font-semibold tracking-tight",e),...t}));Zs.displayName="CardTitle";const xd=E.forwardRef(({className:e,...t},n)=>S.jsx("div",{ref:n,className:Me("text-muted-foreground text-sm",e),...t}));xd.displayName="CardDescription";const Of=E.forwardRef(({className:e,...t},n)=>S.jsx("div",{ref:n,className:Me("p-6 pt-0",e),...t}));Of.displayName="CardContent";const MH=E.forwardRef(({className:e,...t},n)=>S.jsx("div",{ref:n,className:Me("flex items-center p-6 pt-0",e),...t}));MH.displayName="CardFooter";function PH({title:e,description:t,icon:n=CM,action:r,className:i,...o}){return S.jsxs(Ks,{className:Me("flex w-full flex-col items-center justify-center space-y-6 bg-transparent p-16",i),...o,children:[S.jsx("div",{className:"mr-4 shrink-0 rounded-full border border-dashed p-4",children:S.jsx(n,{className:"text-muted-foreground size-8","aria-hidden":"true"})}),S.jsxs("div",{className:"flex flex-col items-center gap-1.5 text-center",children:[S.jsx(Zs,{children:e}),t?S.jsx(xd,{children:t}):null]}),r||null]})}var Xm={exports:{}},Km,pE;function FH(){if(pE)return Km;pE=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return Km=e,Km}var Zm,mE;function IH(){if(mE)return Zm;mE=1;var e=FH();function t(){}function n(){}return n.resetWarningCache=t,Zm=function(){function r(s,u,f,d,p,m){if(m!==e){var v=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw v.name="Invariant Violation",v}}r.isRequired=r;function i(){return r}var o={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:i,element:r,elementType:r,instanceOf:i,node:r,objectOf:i,oneOf:i,oneOfType:i,shape:i,exact:i,checkPropTypes:n,resetWarningCache:t};return o.PropTypes=o,o},Zm}var gE;function GH(){return gE||(gE=1,Xm.exports=IH()()),Xm.exports}var BH=GH();const Ct=fn(BH),UH=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 dl(e,t,n){const r=HH(e),{webkitRelativePath:i}=e,o=typeof t=="string"?t:typeof i=="string"&&i.length>0?i:`./${e.name}`;return typeof r.path!="string"&&vE(r,"path",o),vE(r,"relativePath",o),r}function HH(e){const{name:t}=e;if(t&&t.lastIndexOf(".")!==-1&&!e.type){const r=t.split(".").pop().toLowerCase(),i=UH.get(r);i&&Object.defineProperty(e,"type",{value:i,writable:!1,configurable:!1,enumerable:!0})}return e}function vE(e,t,n){Object.defineProperty(e,t,{value:n,writable:!1,configurable:!1,enumerable:!0})}const $H=[".DS_Store","Thumbs.db"];function VH(e){return no(this,void 0,void 0,function*(){return Lf(e)&&qH(e.dataTransfer)?KH(e.dataTransfer,e.type):YH(e)?WH(e):Array.isArray(e)&&e.every(t=>"getFile"in t&&typeof t.getFile=="function")?XH(e):[]})}function qH(e){return Lf(e)}function YH(e){return Lf(e)&&Lf(e.target)}function Lf(e){return typeof e=="object"&&e!==null}function WH(e){return nv(e.target.files).map(t=>dl(t))}function XH(e){return no(this,void 0,void 0,function*(){return(yield Promise.all(e.map(n=>n.getFile()))).map(n=>dl(n))})}function KH(e,t){return no(this,void 0,void 0,function*(){if(e.items){const n=nv(e.items).filter(i=>i.kind==="file");if(t!=="drop")return n;const r=yield Promise.all(n.map(ZH));return yE(yR(r))}return yE(nv(e.files).map(n=>dl(n)))})}function yE(e){return e.filter(t=>$H.indexOf(t.name)===-1)}function nv(e){if(e===null)return[];const t=[];for(let n=0;n[...t,...Array.isArray(n)?yR(n):[n]],[])}function bE(e,t){return no(this,void 0,void 0,function*(){var n;if(globalThis.isSecureContext&&typeof e.getAsFileSystemHandle=="function"){const o=yield e.getAsFileSystemHandle();if(o===null)throw new Error(`${e} is not a File`);if(o!==void 0){const s=yield o.getFile();return s.handle=o,dl(s)}}const r=e.getAsFile();if(!r)throw new Error(`${e} is not a File`);return dl(r,(n=t==null?void 0:t.fullPath)!==null&&n!==void 0?n:void 0)})}function QH(e){return no(this,void 0,void 0,function*(){return e.isDirectory?bR(e):JH(e)})}function bR(e){const t=e.createReader();return new Promise((n,r)=>{const i=[];function o(){t.readEntries(s=>no(this,void 0,void 0,function*(){if(s.length){const u=Promise.all(s.map(QH));i.push(u),o()}else try{const u=yield Promise.all(i);n(u)}catch(u){r(u)}}),s=>{r(s)})}o()})}function JH(e){return no(this,void 0,void 0,function*(){return new Promise((t,n)=>{e.file(r=>{const i=dl(r,e.fullPath);t(i)},r=>{n(r)})})})}var Xc={},xE;function e$(){return xE||(xE=1,Xc.__esModule=!0,Xc.default=function(e,t){if(e&&t){var n=Array.isArray(t)?t:t.split(",");if(n.length===0)return!0;var r=e.name||"",i=(e.type||"").toLowerCase(),o=i.replace(/\/.*$/,"");return n.some(function(s){var u=s.trim().toLowerCase();return u.charAt(0)==="."?r.toLowerCase().endsWith(u):u.endsWith("/*")?o===u.replace(/\/.*$/,""):i===u})}return!0}),Xc}var t$=e$();const Qm=fn(t$);function wE(e){return i$(e)||r$(e)||wR(e)||n$()}function n$(){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 r$(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function i$(e){if(Array.isArray(e))return rv(e)}function SE(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function EE(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&arguments[0]!==void 0?arguments[0]:"",n=t.split(","),r=n.length>1?"one of ".concat(n.join(", ")):n[0];return{code:u$,message:"File type must be ".concat(r)}},_E=function(t){return{code:c$,message:"File is larger than ".concat(t," ").concat(t===1?"byte":"bytes")}},kE=function(t){return{code:f$,message:"File is smaller than ".concat(t," ").concat(t===1?"byte":"bytes")}},p$={code:d$,message:"Too many files"};function SR(e,t){var n=e.type==="application/x-moz-file"||s$(e,t);return[n,n?null:h$(t)]}function ER(e,t,n){if($a(e.size))if($a(t)&&$a(n)){if(e.size>n)return[!1,_E(n)];if(e.sizen)return[!1,_E(n)]}return[!0,null]}function $a(e){return e!=null}function m$(e){var t=e.files,n=e.accept,r=e.minSize,i=e.maxSize,o=e.multiple,s=e.maxFiles,u=e.validator;return!o&&t.length>1||o&&s>=1&&t.length>s?!1:t.every(function(f){var d=SR(f,n),p=Qs(d,1),m=p[0],v=ER(f,r,i),g=Qs(v,1),w=g[0],x=u?u(f):null;return m&&w&&!x})}function zf(e){return typeof e.isPropagationStopped=="function"?e.isPropagationStopped():typeof e.cancelBubble<"u"?e.cancelBubble:!1}function Kc(e){return e.dataTransfer?Array.prototype.some.call(e.dataTransfer.types,function(t){return t==="Files"||t==="application/x-moz-file"}):!!e.target&&!!e.target.files}function CE(e){e.preventDefault()}function g$(e){return e.indexOf("MSIE")!==-1||e.indexOf("Trident/")!==-1}function v$(e){return e.indexOf("Edge/")!==-1}function y$(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:window.navigator.userAgent;return g$(e)||v$(e)}function Ir(){for(var e=arguments.length,t=new Array(e),n=0;n1?i-1:0),s=1;se.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function j$(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,o;for(o=0;o=0)&&(n[i]=e[i]);return n}var wd=E.forwardRef(function(e,t){var n=e.children,r=jf(e,_$),i=M$(r),o=i.open,s=jf(i,k$);return E.useImperativeHandle(t,function(){return{open:o}},[o]),be.createElement(E.Fragment,null,n(jt(jt({},s),{},{open:o})))});wd.displayName="Dropzone";var TR={disabled:!1,getFilesFromEvent:VH,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};wd.defaultProps=TR;wd.propTypes={children:Ct.func,accept:Ct.objectOf(Ct.arrayOf(Ct.string)),multiple:Ct.bool,preventDropOnDocument:Ct.bool,noClick:Ct.bool,noKeyboard:Ct.bool,noDrag:Ct.bool,noDragEventsBubbling:Ct.bool,minSize:Ct.number,maxSize:Ct.number,maxFiles:Ct.number,disabled:Ct.bool,getFilesFromEvent:Ct.func,onFileDialogCancel:Ct.func,onFileDialogOpen:Ct.func,useFsAccessApi:Ct.bool,autoFocus:Ct.bool,onDragEnter:Ct.func,onDragLeave:Ct.func,onDragOver:Ct.func,onDrop:Ct.func,onDropAccepted:Ct.func,onDropRejected:Ct.func,onError:Ct.func,validator:Ct.func};var ov={isFocused:!1,isFileDialogActive:!1,isDragActive:!1,isDragAccept:!1,isDragReject:!1,acceptedFiles:[],fileRejections:[]};function M$(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=jt(jt({},TR),e),n=t.accept,r=t.disabled,i=t.getFilesFromEvent,o=t.maxSize,s=t.minSize,u=t.multiple,f=t.maxFiles,d=t.onDragEnter,p=t.onDragLeave,m=t.onDragOver,v=t.onDrop,g=t.onDropAccepted,w=t.onDropRejected,x=t.onFileDialogCancel,k=t.onFileDialogOpen,C=t.useFsAccessApi,_=t.autoFocus,T=t.preventDropOnDocument,N=t.noClick,D=t.noKeyboard,z=t.noDrag,R=t.noDragEventsBubbling,B=t.onError,P=t.validator,j=E.useMemo(function(){return w$(n)},[n]),V=E.useMemo(function(){return x$(n)},[n]),q=E.useMemo(function(){return typeof k=="function"?k:AE},[k]),I=E.useMemo(function(){return typeof x=="function"?x:AE},[x]),Y=E.useRef(null),Z=E.useRef(null),U=E.useReducer(P$,ov),G=Jm(U,2),F=G[0],K=G[1],A=F.isFocused,$=F.isFileDialogActive,M=E.useRef(typeof window<"u"&&window.isSecureContext&&C&&b$()),O=function(){!M.current&&$&&setTimeout(function(){if(Z.current){var Ne=Z.current.files;Ne.length||(K({type:"closeDialog"}),I())}},300)};E.useEffect(function(){return window.addEventListener("focus",O,!1),function(){window.removeEventListener("focus",O,!1)}},[Z,$,I,M]);var X=E.useRef([]),re=function(Ne){Y.current&&Y.current.contains(Ne.target)||(Ne.preventDefault(),X.current=[])};E.useEffect(function(){return T&&(document.addEventListener("dragover",CE,!1),document.addEventListener("drop",re,!1)),function(){T&&(document.removeEventListener("dragover",CE),document.removeEventListener("drop",re))}},[Y,T]),E.useEffect(function(){return!r&&_&&Y.current&&Y.current.focus(),function(){}},[Y,_,r]);var ue=E.useCallback(function(ve){B?B(ve):console.error(ve)},[B]),ae=E.useCallback(function(ve){ve.preventDefault(),ve.persist(),Se(ve),X.current=[].concat(A$(X.current),[ve.target]),Kc(ve)&&Promise.resolve(i(ve)).then(function(Ne){if(!(zf(ve)&&!R)){var te=Ne.length,de=te>0&&m$({files:Ne,accept:j,minSize:s,maxSize:o,multiple:u,maxFiles:f,validator:P}),Oe=te>0&&!de;K({isDragAccept:de,isDragReject:Oe,isDragActive:!0,type:"setDraggedFiles"}),d&&d(ve)}}).catch(function(Ne){return ue(Ne)})},[i,d,ue,R,j,s,o,u,f,P]),oe=E.useCallback(function(ve){ve.preventDefault(),ve.persist(),Se(ve);var Ne=Kc(ve);if(Ne&&ve.dataTransfer)try{ve.dataTransfer.dropEffect="copy"}catch{}return Ne&&m&&m(ve),!1},[m,R]),Ce=E.useCallback(function(ve){ve.preventDefault(),ve.persist(),Se(ve);var Ne=X.current.filter(function(de){return Y.current&&Y.current.contains(de)}),te=Ne.indexOf(ve.target);te!==-1&&Ne.splice(te,1),X.current=Ne,!(Ne.length>0)&&(K({type:"setDraggedFiles",isDragActive:!1,isDragAccept:!1,isDragReject:!1}),Kc(ve)&&p&&p(ve))},[Y,p,R]),he=E.useCallback(function(ve,Ne){var te=[],de=[];ve.forEach(function(Oe){var $e=SR(Oe,j),Ye=Jm($e,2),vt=Ye[0],Mt=Ye[1],bt=ER(Oe,s,o),rt=Jm(bt,2),qt=rt[0],at=rt[1],At=P?P(Oe):null;if(vt&&qt&&!At)te.push(Oe);else{var rn=[Mt,at];At&&(rn=rn.concat(At)),de.push({file:Oe,errors:rn.filter(function(io){return io})})}}),(!u&&te.length>1||u&&f>=1&&te.length>f)&&(te.forEach(function(Oe){de.push({file:Oe,errors:[p$]})}),te.splice(0)),K({acceptedFiles:te,fileRejections:de,isDragReject:de.length>0,type:"setFiles"}),v&&v(te,de,Ne),de.length>0&&w&&w(de,Ne),te.length>0&&g&&g(te,Ne)},[K,u,j,s,o,f,v,g,w,P]),Ee=E.useCallback(function(ve){ve.preventDefault(),ve.persist(),Se(ve),X.current=[],Kc(ve)&&Promise.resolve(i(ve)).then(function(Ne){zf(ve)&&!R||he(Ne,ve)}).catch(function(Ne){return ue(Ne)}),K({type:"reset"})},[i,he,ue,R]),we=E.useCallback(function(){if(M.current){K({type:"openDialog"}),q();var ve={multiple:u,types:V};window.showOpenFilePicker(ve).then(function(Ne){return i(Ne)}).then(function(Ne){he(Ne,null),K({type:"closeDialog"})}).catch(function(Ne){S$(Ne)?(I(Ne),K({type:"closeDialog"})):E$(Ne)?(M.current=!1,Z.current?(Z.current.value=null,Z.current.click()):ue(new Error("Cannot open the file picker because the https://developer.mozilla.org/en-US/docs/Web/API/File_System_Access_API is not supported and no was provided."))):ue(Ne)});return}Z.current&&(K({type:"openDialog"}),q(),Z.current.value=null,Z.current.click())},[K,q,I,C,he,ue,V,u]),Pe=E.useCallback(function(ve){!Y.current||!Y.current.isEqualNode(ve.target)||(ve.key===" "||ve.key==="Enter"||ve.keyCode===32||ve.keyCode===13)&&(ve.preventDefault(),we())},[Y,we]),Ae=E.useCallback(function(){K({type:"focus"})},[]),xe=E.useCallback(function(){K({type:"blur"})},[]),ee=E.useCallback(function(){N||(y$()?setTimeout(we,0):we())},[N,we]),ce=function(Ne){return r?null:Ne},Te=function(Ne){return D?null:ce(Ne)},ge=function(Ne){return z?null:ce(Ne)},Se=function(Ne){R&&Ne.stopPropagation()},ie=E.useMemo(function(){return function(){var ve=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},Ne=ve.refKey,te=Ne===void 0?"ref":Ne,de=ve.role,Oe=ve.onKeyDown,$e=ve.onFocus,Ye=ve.onBlur,vt=ve.onClick,Mt=ve.onDragEnter,bt=ve.onDragOver,rt=ve.onDragLeave,qt=ve.onDrop,at=jf(ve,C$);return jt(jt(av({onKeyDown:Te(Ir(Oe,Pe)),onFocus:Te(Ir($e,Ae)),onBlur:Te(Ir(Ye,xe)),onClick:ce(Ir(vt,ee)),onDragEnter:ge(Ir(Mt,ae)),onDragOver:ge(Ir(bt,oe)),onDragLeave:ge(Ir(rt,Ce)),onDrop:ge(Ir(qt,Ee)),role:typeof de=="string"&&de!==""?de:"presentation"},te,Y),!r&&!D?{tabIndex:0}:{}),at)}},[Y,Pe,Ae,xe,ee,ae,oe,Ce,Ee,D,z,r]),He=E.useCallback(function(ve){ve.stopPropagation()},[]),Ge=E.useMemo(function(){return function(){var ve=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},Ne=ve.refKey,te=Ne===void 0?"ref":Ne,de=ve.onChange,Oe=ve.onClick,$e=jf(ve,T$),Ye=av({accept:j,multiple:u,type:"file",style:{border:0,clip:"rect(0, 0, 0, 0)",clipPath:"inset(50%)",height:"1px",margin:"0 -1px -1px 0",overflow:"hidden",padding:0,position:"absolute",width:"1px",whiteSpace:"nowrap"},onChange:ce(Ir(de,Ee)),onClick:ce(Ir(Oe,He)),tabIndex:-1},te,Z);return jt(jt({},Ye),$e)}},[Z,n,u,Ee,r]);return jt(jt({},F),{},{isFocused:A&&!r,getRootProps:ie,getInputProps:Ge,rootRef:Y,inputRef:Z,open:ce(we)})}function P$(e,t){switch(t.type){case"focus":return jt(jt({},e),{},{isFocused:!0});case"blur":return jt(jt({},e),{},{isFocused:!1});case"openDialog":return jt(jt({},ov),{},{isFileDialogActive:!0});case"closeDialog":return jt(jt({},e),{},{isFileDialogActive:!1});case"setDraggedFiles":return jt(jt({},e),{},{isDragActive:t.isDragActive,isDragAccept:t.isDragAccept,isDragReject:t.isDragReject});case"setFiles":return jt(jt({},e),{},{acceptedFiles:t.acceptedFiles,fileRejections:t.fileRejections,isDragReject:t.isDragReject});case"reset":return jt({},ov);default:return e}}function AE(){}var My="Progress",Py=100,[F$,mK]=hr(My),[I$,G$]=F$(My),AR=E.forwardRef((e,t)=>{const{__scopeProgress:n,value:r=null,max:i,getValueLabel:o=B$,...s}=e;(i||i===0)&&!RE(i)&&console.error(U$(`${i}`,"Progress"));const u=RE(i)?i:Py;r!==null&&!DE(r,u)&&console.error(H$(`${r}`,"Progress"));const f=DE(r,u)?r:null,d=Mf(f)?o(f,u):void 0;return S.jsx(I$,{scope:n,value:f,max:u,children:S.jsx(We.div,{"aria-valuemax":u,"aria-valuemin":0,"aria-valuenow":Mf(f)?f:void 0,"aria-valuetext":d,role:"progressbar","data-state":NR(f,u),"data-value":f??void 0,"data-max":u,...s,ref:t})})});AR.displayName=My;var RR="ProgressIndicator",DR=E.forwardRef((e,t)=>{const{__scopeProgress:n,...r}=e,i=G$(RR,n);return S.jsx(We.div,{"data-state":NR(i.value,i.max),"data-value":i.value??void 0,"data-max":i.max,...r,ref:t})});DR.displayName=RR;function B$(e,t){return`${Math.round(e/t*100)}%`}function NR(e,t){return e==null?"indeterminate":e===t?"complete":"loading"}function Mf(e){return typeof e=="number"}function RE(e){return Mf(e)&&!isNaN(e)&&e>0}function DE(e,t){return Mf(e)&&!isNaN(e)&&e<=t&&e>=0}function U$(e,t){return`Invalid prop \`max\` of value \`${e}\` supplied to \`${t}\`. Only numbers greater than 0 are valid max values. Defaulting to \`${Py}\`.`}function H$(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 ${Py} if no \`max\` prop is set) - - \`null\` or \`undefined\` if the progress is indeterminate. - -Defaulting to \`null\`.`}var OR=AR,$$=DR;const LR=E.forwardRef(({className:e,value:t,...n},r)=>S.jsx(OR,{ref:r,className:Me("bg-secondary relative h-4 w-full overflow-hidden rounded-full",e),...n,children:S.jsx($$,{className:"bg-primary h-full w-full flex-1 transition-all",style:{transform:`translateX(-${100-(t||0)}%)`}})}));LR.displayName=OR.displayName;function lv(e,[t,n]){return Math.min(n,Math.max(t,e))}function V$(e,t){return E.useReducer((n,r)=>t[n][r]??n,e)}var Fy="ScrollArea",[zR,gK]=hr(Fy),[q$,mr]=zR(Fy),jR=E.forwardRef((e,t)=>{const{__scopeScrollArea:n,type:r="hover",dir:i,scrollHideDelay:o=600,...s}=e,[u,f]=E.useState(null),[d,p]=E.useState(null),[m,v]=E.useState(null),[g,w]=E.useState(null),[x,k]=E.useState(null),[C,_]=E.useState(0),[T,N]=E.useState(0),[D,z]=E.useState(!1),[R,B]=E.useState(!1),P=dt(t,V=>f(V)),j=hd(i);return S.jsx(q$,{scope:n,type:r,dir:j,scrollHideDelay:o,scrollArea:u,viewport:d,onViewportChange:p,content:m,onContentChange:v,scrollbarX:g,onScrollbarXChange:w,scrollbarXEnabled:D,onScrollbarXEnabledChange:z,scrollbarY:x,onScrollbarYChange:k,scrollbarYEnabled:R,onScrollbarYEnabledChange:B,onCornerWidthChange:_,onCornerHeightChange:N,children:S.jsx(We.div,{dir:j,...s,ref:P,style:{position:"relative","--radix-scroll-area-corner-width":C+"px","--radix-scroll-area-corner-height":T+"px",...e.style}})})});jR.displayName=Fy;var MR="ScrollAreaViewport",PR=E.forwardRef((e,t)=>{const{__scopeScrollArea:n,children:r,nonce:i,...o}=e,s=mr(MR,n),u=E.useRef(null),f=dt(t,u,s.onViewportChange);return S.jsxs(S.Fragment,{children:[S.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:i}),S.jsx(We.div,{"data-radix-scroll-area-viewport":"",...o,ref:f,style:{overflowX:s.scrollbarXEnabled?"scroll":"hidden",overflowY:s.scrollbarYEnabled?"scroll":"hidden",...e.style},children:S.jsx("div",{ref:s.onContentChange,style:{minWidth:"100%",display:"table"},children:r})})]})});PR.displayName=MR;var Xr="ScrollAreaScrollbar",Iy=E.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=mr(Xr,e.__scopeScrollArea),{onScrollbarXEnabledChange:o,onScrollbarYEnabledChange:s}=i,u=e.orientation==="horizontal";return E.useEffect(()=>(u?o(!0):s(!0),()=>{u?o(!1):s(!1)}),[u,o,s]),i.type==="hover"?S.jsx(Y$,{...r,ref:t,forceMount:n}):i.type==="scroll"?S.jsx(W$,{...r,ref:t,forceMount:n}):i.type==="auto"?S.jsx(FR,{...r,ref:t,forceMount:n}):i.type==="always"?S.jsx(Gy,{...r,ref:t}):null});Iy.displayName=Xr;var Y$=E.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=mr(Xr,e.__scopeScrollArea),[o,s]=E.useState(!1);return E.useEffect(()=>{const u=i.scrollArea;let f=0;if(u){const d=()=>{window.clearTimeout(f),s(!0)},p=()=>{f=window.setTimeout(()=>s(!1),i.scrollHideDelay)};return u.addEventListener("pointerenter",d),u.addEventListener("pointerleave",p),()=>{window.clearTimeout(f),u.removeEventListener("pointerenter",d),u.removeEventListener("pointerleave",p)}}},[i.scrollArea,i.scrollHideDelay]),S.jsx(Zn,{present:n||o,children:S.jsx(FR,{"data-state":o?"visible":"hidden",...r,ref:t})})}),W$=E.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=mr(Xr,e.__scopeScrollArea),o=e.orientation==="horizontal",s=Ed(()=>f("SCROLL_END"),100),[u,f]=V$("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return E.useEffect(()=>{if(u==="idle"){const d=window.setTimeout(()=>f("HIDE"),i.scrollHideDelay);return()=>window.clearTimeout(d)}},[u,i.scrollHideDelay,f]),E.useEffect(()=>{const d=i.viewport,p=o?"scrollLeft":"scrollTop";if(d){let m=d[p];const v=()=>{const g=d[p];m!==g&&(f("SCROLL"),s()),m=g};return d.addEventListener("scroll",v),()=>d.removeEventListener("scroll",v)}},[i.viewport,o,f,s]),S.jsx(Zn,{present:n||u!=="hidden",children:S.jsx(Gy,{"data-state":u==="hidden"?"hidden":"visible",...r,ref:t,onPointerEnter:qe(e.onPointerEnter,()=>f("POINTER_ENTER")),onPointerLeave:qe(e.onPointerLeave,()=>f("POINTER_LEAVE"))})})}),FR=E.forwardRef((e,t)=>{const n=mr(Xr,e.__scopeScrollArea),{forceMount:r,...i}=e,[o,s]=E.useState(!1),u=e.orientation==="horizontal",f=Ed(()=>{if(n.viewport){const d=n.viewport.offsetWidth{const{orientation:n="vertical",...r}=e,i=mr(Xr,e.__scopeScrollArea),o=E.useRef(null),s=E.useRef(0),[u,f]=E.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),d=HR(u.viewport,u.content),p={...r,sizes:u,onSizesChange:f,hasThumb:d>0&&d<1,onThumbChange:v=>o.current=v,onThumbPointerUp:()=>s.current=0,onThumbPointerDown:v=>s.current=v};function m(v,g){return e9(v,s.current,u,g)}return n==="horizontal"?S.jsx(X$,{...p,ref:t,onThumbPositionChange:()=>{if(i.viewport&&o.current){const v=i.viewport.scrollLeft,g=NE(v,u,i.dir);o.current.style.transform=`translate3d(${g}px, 0, 0)`}},onWheelScroll:v=>{i.viewport&&(i.viewport.scrollLeft=v)},onDragScroll:v=>{i.viewport&&(i.viewport.scrollLeft=m(v,i.dir))}}):n==="vertical"?S.jsx(K$,{...p,ref:t,onThumbPositionChange:()=>{if(i.viewport&&o.current){const v=i.viewport.scrollTop,g=NE(v,u);o.current.style.transform=`translate3d(0, ${g}px, 0)`}},onWheelScroll:v=>{i.viewport&&(i.viewport.scrollTop=v)},onDragScroll:v=>{i.viewport&&(i.viewport.scrollTop=m(v))}}):null}),X$=E.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...i}=e,o=mr(Xr,e.__scopeScrollArea),[s,u]=E.useState(),f=E.useRef(null),d=dt(t,f,o.onScrollbarXChange);return E.useEffect(()=>{f.current&&u(getComputedStyle(f.current))},[f]),S.jsx(GR,{"data-orientation":"horizontal",...i,ref:d,sizes:n,style:{bottom:0,left:o.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:o.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":Sd(n)+"px",...e.style},onThumbPointerDown:p=>e.onThumbPointerDown(p.x),onDragScroll:p=>e.onDragScroll(p.x),onWheelScroll:(p,m)=>{if(o.viewport){const v=o.viewport.scrollLeft+p.deltaX;e.onWheelScroll(v),VR(v,m)&&p.preventDefault()}},onResize:()=>{f.current&&o.viewport&&s&&r({content:o.viewport.scrollWidth,viewport:o.viewport.offsetWidth,scrollbar:{size:f.current.clientWidth,paddingStart:Ff(s.paddingLeft),paddingEnd:Ff(s.paddingRight)}})}})}),K$=E.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...i}=e,o=mr(Xr,e.__scopeScrollArea),[s,u]=E.useState(),f=E.useRef(null),d=dt(t,f,o.onScrollbarYChange);return E.useEffect(()=>{f.current&&u(getComputedStyle(f.current))},[f]),S.jsx(GR,{"data-orientation":"vertical",...i,ref:d,sizes:n,style:{top:0,right:o.dir==="ltr"?0:void 0,left:o.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":Sd(n)+"px",...e.style},onThumbPointerDown:p=>e.onThumbPointerDown(p.y),onDragScroll:p=>e.onDragScroll(p.y),onWheelScroll:(p,m)=>{if(o.viewport){const v=o.viewport.scrollTop+p.deltaY;e.onWheelScroll(v),VR(v,m)&&p.preventDefault()}},onResize:()=>{f.current&&o.viewport&&s&&r({content:o.viewport.scrollHeight,viewport:o.viewport.offsetHeight,scrollbar:{size:f.current.clientHeight,paddingStart:Ff(s.paddingTop),paddingEnd:Ff(s.paddingBottom)}})}})}),[Z$,IR]=zR(Xr),GR=E.forwardRef((e,t)=>{const{__scopeScrollArea:n,sizes:r,hasThumb:i,onThumbChange:o,onThumbPointerUp:s,onThumbPointerDown:u,onThumbPositionChange:f,onDragScroll:d,onWheelScroll:p,onResize:m,...v}=e,g=mr(Xr,n),[w,x]=E.useState(null),k=dt(t,P=>x(P)),C=E.useRef(null),_=E.useRef(""),T=g.viewport,N=r.content-r.viewport,D=un(p),z=un(f),R=Ed(m,10);function B(P){if(C.current){const j=P.clientX-C.current.left,V=P.clientY-C.current.top;d({x:j,y:V})}}return E.useEffect(()=>{const P=j=>{const V=j.target;(w==null?void 0:w.contains(V))&&D(j,N)};return document.addEventListener("wheel",P,{passive:!1}),()=>document.removeEventListener("wheel",P,{passive:!1})},[T,w,N,D]),E.useEffect(z,[r,z]),hl(w,R),hl(g.content,R),S.jsx(Z$,{scope:n,scrollbar:w,hasThumb:i,onThumbChange:un(o),onThumbPointerUp:un(s),onThumbPositionChange:z,onThumbPointerDown:un(u),children:S.jsx(We.div,{...v,ref:k,style:{position:"absolute",...v.style},onPointerDown:qe(e.onPointerDown,P=>{P.button===0&&(P.target.setPointerCapture(P.pointerId),C.current=w.getBoundingClientRect(),_.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",g.viewport&&(g.viewport.style.scrollBehavior="auto"),B(P))}),onPointerMove:qe(e.onPointerMove,B),onPointerUp:qe(e.onPointerUp,P=>{const j=P.target;j.hasPointerCapture(P.pointerId)&&j.releasePointerCapture(P.pointerId),document.body.style.webkitUserSelect=_.current,g.viewport&&(g.viewport.style.scrollBehavior=""),C.current=null})})})}),Pf="ScrollAreaThumb",BR=E.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=IR(Pf,e.__scopeScrollArea);return S.jsx(Zn,{present:n||i.hasThumb,children:S.jsx(Q$,{ref:t,...r})})}),Q$=E.forwardRef((e,t)=>{const{__scopeScrollArea:n,style:r,...i}=e,o=mr(Pf,n),s=IR(Pf,n),{onThumbPositionChange:u}=s,f=dt(t,m=>s.onThumbChange(m)),d=E.useRef(void 0),p=Ed(()=>{d.current&&(d.current(),d.current=void 0)},100);return E.useEffect(()=>{const m=o.viewport;if(m){const v=()=>{if(p(),!d.current){const g=t9(m,u);d.current=g,u()}};return u(),m.addEventListener("scroll",v),()=>m.removeEventListener("scroll",v)}},[o.viewport,p,u]),S.jsx(We.div,{"data-state":s.hasThumb?"visible":"hidden",...i,ref:f,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...r},onPointerDownCapture:qe(e.onPointerDownCapture,m=>{const g=m.target.getBoundingClientRect(),w=m.clientX-g.left,x=m.clientY-g.top;s.onThumbPointerDown({x:w,y:x})}),onPointerUp:qe(e.onPointerUp,s.onThumbPointerUp)})});BR.displayName=Pf;var By="ScrollAreaCorner",UR=E.forwardRef((e,t)=>{const n=mr(By,e.__scopeScrollArea),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&r?S.jsx(J$,{...e,ref:t}):null});UR.displayName=By;var J$=E.forwardRef((e,t)=>{const{__scopeScrollArea:n,...r}=e,i=mr(By,n),[o,s]=E.useState(0),[u,f]=E.useState(0),d=!!(o&&u);return hl(i.scrollbarX,()=>{var m;const p=((m=i.scrollbarX)==null?void 0:m.offsetHeight)||0;i.onCornerHeightChange(p),f(p)}),hl(i.scrollbarY,()=>{var m;const p=((m=i.scrollbarY)==null?void 0:m.offsetWidth)||0;i.onCornerWidthChange(p),s(p)}),d?S.jsx(We.div,{...r,ref:t,style:{width:o,height:u,position:"absolute",right:i.dir==="ltr"?0:void 0,left:i.dir==="rtl"?0:void 0,bottom:0,...e.style}}):null});function Ff(e){return e?parseInt(e,10):0}function HR(e,t){const n=e/t;return isNaN(n)?0:n}function Sd(e){const t=HR(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function e9(e,t,n,r="ltr"){const i=Sd(n),o=i/2,s=t||o,u=i-s,f=n.scrollbar.paddingStart+s,d=n.scrollbar.size-n.scrollbar.paddingEnd-u,p=n.content-n.viewport,m=r==="ltr"?[0,p]:[p*-1,0];return $R([f,d],m)(e)}function NE(e,t,n="ltr"){const r=Sd(t),i=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,o=t.scrollbar.size-i,s=t.content-t.viewport,u=o-r,f=n==="ltr"?[0,s]:[s*-1,0],d=lv(e,f);return $R([0,s],[0,u])(d)}function $R(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}function VR(e,t){return e>0&&e{})=>{let n={left:e.scrollLeft,top:e.scrollTop},r=0;return function i(){const o={left:e.scrollLeft,top:e.scrollTop},s=n.left!==o.left,u=n.top!==o.top;(s||u)&&t(),n=o,r=window.requestAnimationFrame(i)}(),()=>window.cancelAnimationFrame(r)};function Ed(e,t){const n=un(e),r=E.useRef(0);return E.useEffect(()=>()=>window.clearTimeout(r.current),[]),E.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(n,t)},[n,t])}function hl(e,t){const n=un(t);xn(()=>{let r=0;if(e){const i=new ResizeObserver(()=>{cancelAnimationFrame(r),r=window.requestAnimationFrame(n)});return i.observe(e),()=>{window.cancelAnimationFrame(r),i.unobserve(e)}}},[e,n])}var qR=jR,n9=PR,r9=UR;const YR=E.forwardRef(({className:e,children:t,...n},r)=>S.jsxs(qR,{ref:r,className:Me("relative overflow-hidden",e),...n,children:[S.jsx(n9,{className:"h-full w-full rounded-[inherit]",children:t}),S.jsx(WR,{}),S.jsx(r9,{})]}));YR.displayName=qR.displayName;const WR=E.forwardRef(({className:e,orientation:t="vertical",...n},r)=>S.jsx(Iy,{ref:r,orientation:t,className:Me("flex touch-none transition-colors select-none",t==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-[1px]",t==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",e),...n,children:S.jsx(BR,{className:"bg-border relative flex-1 rounded-full"})}));WR.displayName=Iy.displayName;function sv(e,t={}){const{decimals:n=0,sizeType:r="normal"}=t,i=["Bytes","KB","MB","GB","TB"],o=["Bytes","KiB","MiB","GiB","TiB"];if(e===0)return"0 Byte";const s=Math.floor(Math.log(e)/Math.log(1024));return`${(e/Math.pow(1024,s)).toFixed(n)} ${r==="accurate"?o[s]??"Bytes":i[s]??"Bytes"}`}function i9(e){const{value:t,onValueChange:n,onUpload:r,progresses:i,accept:o=wz,maxSize:s=1024*1024*200,maxFileCount:u=1,multiple:f=!1,disabled:d=!1,description:p,className:m,...v}=e,[g,w]=_i({prop:t,onChange:n}),x=E.useCallback((_,T)=>{if(!f&&u===1&&_.length>1){vn.error("Cannot upload more than 1 file at a time");return}if(((g==null?void 0:g.length)??0)+_.length>u){vn.error(`Cannot upload more than ${u} files`);return}const N=_.map(z=>Object.assign(z,{preview:URL.createObjectURL(z)})),D=g?[...g,...N]:N;if(w(D),T.length>0&&T.forEach(({file:z})=>{vn.error(`File ${z.name} was rejected`)}),r&&D.length>0&&D.length<=u){const z=D.length>0?`${D.length} files`:"file";vn.promise(r(D),{loading:`Uploading ${z}...`,success:()=>(w([]),`${z} uploaded`),error:`Failed to upload ${z}`})}},[g,u,f,r,w]);function k(_){if(!g)return;const T=g.filter((N,D)=>D!==_);w(T),n==null||n(T)}E.useEffect(()=>()=>{g&&g.forEach(_=>{XR(_)&&URL.revokeObjectURL(_.preview)})},[]);const C=d||((g==null?void 0:g.length)??0)>=u;return S.jsxs("div",{className:"relative flex flex-col gap-6 overflow-hidden",children:[S.jsx(wd,{onDrop:x,accept:o,maxSize:s,maxFiles:u,multiple:u>1||f,disabled:C,children:({getRootProps:_,getInputProps:T,isDragActive:N})=>S.jsxs("div",{..._(),className:Me("group border-muted-foreground/25 hover:bg-muted/25 relative grid h-52 w-full cursor-pointer place-items-center rounded-lg border-2 border-dashed px-5 py-2.5 text-center transition","ring-offset-background focus-visible:ring-ring focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-none",N&&"border-muted-foreground/50",C&&"pointer-events-none opacity-60",m),...v,children:[S.jsx("input",{...T()}),N?S.jsxs("div",{className:"flex flex-col items-center justify-center gap-4 sm:px-5",children:[S.jsx("div",{className:"rounded-full border border-dashed p-3",children:S.jsx(Ag,{className:"text-muted-foreground size-7","aria-hidden":"true"})}),S.jsx("p",{className:"text-muted-foreground font-medium",children:"Drop the files here"})]}):S.jsxs("div",{className:"flex flex-col items-center justify-center gap-4 sm:px-5",children:[S.jsx("div",{className:"rounded-full border border-dashed p-3",children:S.jsx(Ag,{className:"text-muted-foreground size-7","aria-hidden":"true"})}),S.jsxs("div",{className:"flex flex-col gap-px",children:[S.jsx("p",{className:"text-muted-foreground font-medium",children:"Drag and drop files here, or click to select files"}),p?S.jsx("p",{className:"text-muted-foreground/70 text-sm",children:p}):S.jsxs("p",{className:"text-muted-foreground/70 text-sm",children:["You can upload",u>1?` ${u===1/0?"multiple":u} - files (up to ${sv(s)} each)`:` a file with ${sv(s)}`,"Supported formats: TXT, MD, DOCX, PDF, PPTX, RTF, ODT, EPUB, HTML, HTM, TEX, JSON, XML, YAML, YML, CSV, LOG, CONF, INI, PROPERTIES, SQL, BAT, SH, C, CPP, PY, JAVA, JS, TS, SWIFT, GO, RB, PHP, CSS, SCSS, LESS"]})]})]})]})}),g!=null&&g.length?S.jsx(YR,{className:"h-fit w-full px-3",children:S.jsx("div",{className:"flex max-h-48 flex-col gap-4",children:g==null?void 0:g.map((_,T)=>S.jsx(a9,{file:_,onRemove:()=>k(T),progress:i==null?void 0:i[_.name]},T))})}):null]})}function a9({file:e,progress:t,onRemove:n}){return S.jsxs("div",{className:"relative flex items-center gap-2.5",children:[S.jsxs("div",{className:"flex flex-1 gap-2.5",children:[XR(e)?S.jsx(o9,{file:e}):null,S.jsxs("div",{className:"flex w-full flex-col gap-2",children:[S.jsxs("div",{className:"flex flex-col gap-px",children:[S.jsx("p",{className:"text-foreground/80 line-clamp-1 text-sm font-medium",children:e.name}),S.jsx("p",{className:"text-muted-foreground text-xs",children:sv(e.size)})]}),t?S.jsx(LR,{value:t}):null]})]}),S.jsx("div",{className:"flex items-center gap-2",children:S.jsxs(Ot,{type:"button",variant:"outline",size:"icon",className:"size-7",onClick:n,children:[S.jsx(Ek,{className:"size-4","aria-hidden":"true"}),S.jsx("span",{className:"sr-only",children:"Remove file"})]})})]})}function XR(e){return"preview"in e&&typeof e.preview=="string"}function o9({file:e}){return e.type.startsWith("image/")?S.jsx("div",{className:"aspect-square shrink-0 rounded-md object-cover"}):S.jsx(_M,{className:"text-muted-foreground size-10","aria-hidden":"true"})}function l9(){const[e,t]=E.useState(!1),[n,r]=E.useState(!1),[i,o]=E.useState({}),s=E.useCallback(async u=>{r(!0);try{await Promise.all(u.map(async f=>{try{const d=await uM(f,p=>{console.debug(`Uploading ${f.name}: ${p}%`),o(m=>({...m,[f.name]:p}))});d.status==="success"?vn.success(`Upload Success: -${f.name} uploaded successfully`):vn.error(`Upload Failed: -${f.name} -${d.message}`)}catch(d){vn.error(`Upload Failed: -${f.name} -${Cr(d)}`)}}))}catch(f){vn.error(`Upload Failed -`+Cr(f))}finally{r(!1)}},[r,o]);return S.jsxs(KA,{open:e,onOpenChange:u=>{n&&!u||t(u)},children:[S.jsx(ZA,{asChild:!0,children:S.jsxs(Ot,{variant:"default",side:"bottom",tooltip:"Upload documents",size:"sm",children:[S.jsx(Ag,{})," Upload"]})}),S.jsxs(Cy,{className:"sm:max-w-xl",onCloseAutoFocus:u=>u.preventDefault(),children:[S.jsxs(Ty,{children:[S.jsx(Ay,{children:"Upload documents"}),S.jsx(Ry,{children:"Drag and drop your documents here or click to browse."})]}),S.jsx(i9,{maxFileCount:1/0,maxSize:200*1024*1024,description:"supported types: TXT, MD, DOCX, PDF, PPTX, RTF, ODT, EPUB, HTML, HTM, TEX, JSON, XML, YAML, YML, CSV, LOG, CONF, INI, PROPERTIES, SQL, BAT, SH, C, CPP, PY, JAVA, JS, TS, SWIFT, GO, RB, PHP, CSS, SCSS, LESS",onUpload:s,progresses:i,disabled:n})]})]})}function s9(){const[e,t]=E.useState(!1),n=E.useCallback(async()=>{try{const r=await cM();r.status==="success"?(vn.success("Documents cleared successfully"),t(!1)):vn.error(`Clear Documents Failed: -${r.message}`)}catch(r){vn.error(`Clear Documents Failed: -`+Cr(r))}},[t]);return S.jsxs(KA,{open:e,onOpenChange:t,children:[S.jsx(ZA,{asChild:!0,children:S.jsxs(Ot,{variant:"outline",side:"bottom",tooltip:"Clear documents",size:"sm",children:[S.jsx(wk,{})," Clear"]})}),S.jsxs(Cy,{className:"sm:max-w-xl",onCloseAutoFocus:r=>r.preventDefault(),children:[S.jsxs(Ty,{children:[S.jsx(Ay,{children:"Clear documents"}),S.jsx(Ry,{children:"Do you really want to clear all documents?"})]}),S.jsx(Ot,{variant:"destructive",onClick:n,children:"YES"})]})]})}function u9(){const e=Mn.use.health(),[t,n]=E.useState(null),r=E.useCallback(async()=>{try{const o=await aM();o&&o.statuses&&Object.values(o.statuses).reduce((u,f)=>u+f.length,0)>0?n(o):n(null)}catch(o){vn.error(`Failed to load documents -`+Cr(o))}},[n]);E.useEffect(()=>{r()},[]);const i=E.useCallback(async()=>{try{const{status:o}=await oM();vn.message(o)}catch(o){vn.error(`Failed to load documents -`+Cr(o))}},[]);return E.useEffect(()=>{const o=setInterval(async()=>{if(e)try{await r()}catch(s){vn.error(`Failed to get scan progress -`+Cr(s))}},5e3);return()=>clearInterval(o)},[e,r]),S.jsxs(Ks,{className:"!size-full !rounded-none !border-none",children:[S.jsx(Nf,{children:S.jsx(Zs,{className:"text-lg",children:"Document Management"})}),S.jsxs(Of,{className:"space-y-4",children:[S.jsxs("div",{className:"flex gap-2",children:[S.jsxs(Ot,{variant:"outline",onClick:i,side:"bottom",tooltip:"Scan documents",size:"sm",children:[S.jsx(YM,{})," Scan"]}),S.jsx("div",{className:"flex-1"}),S.jsx(s9,{}),S.jsx(l9,{})]}),S.jsxs(Ks,{children:[S.jsxs(Nf,{children:[S.jsx(Zs,{children:"Uploaded documents"}),S.jsx(xd,{children:"view the uploaded documents here"})]}),S.jsxs(Of,{children:[!t&&S.jsx(PH,{title:"No documents uploaded",description:"upload documents to see them here"}),t&&S.jsxs(mR,{children:[S.jsx(gR,{children:S.jsxs(tv,{children:[S.jsx(bi,{children:"ID"}),S.jsx(bi,{children:"Summary"}),S.jsx(bi,{children:"Status"}),S.jsx(bi,{children:"Length"}),S.jsx(bi,{children:"Chunks"}),S.jsx(bi,{children:"Created"}),S.jsx(bi,{children:"Updated"}),S.jsx(bi,{children:"Metadata"})]})}),S.jsx(vR,{className:"text-sm",children:Object.entries(t.statuses).map(([o,s])=>s.map(u=>S.jsxs(tv,{children:[S.jsx(xi,{className:"truncate font-mono",children:u.id}),S.jsx(xi,{className:"max-w-xs min-w-24 truncate",children:S.jsx(Ln,{text:u.content_summary,tooltip:u.content_summary,tooltipClassName:"max-w-none overflow-visible block"})}),S.jsxs(xi,{children:[o==="processed"&&S.jsx("span",{className:"text-green-600",children:"Completed"}),o==="processing"&&S.jsx("span",{className:"text-blue-600",children:"Processing"}),o==="pending"&&S.jsx("span",{className:"text-yellow-600",children:"Pending"}),o==="failed"&&S.jsx("span",{className:"text-red-600",children:"Failed"}),u.error&&S.jsx("span",{className:"ml-2 text-red-500",title:u.error,children:"⚠️"})]}),S.jsx(xi,{children:u.content_length??"-"}),S.jsx(xi,{children:u.chunks_count??"-"}),S.jsx(xi,{className:"truncate",children:new Date(u.created_at).toLocaleString()}),S.jsx(xi,{className:"truncate",children:new Date(u.updated_at).toLocaleString()}),S.jsx(xi,{className:"max-w-xs truncate",children:u.metadata?JSON.stringify(u.metadata):"-"})]},u.id)))})]})]})]})]})]})}function KR(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i=u?i=i+OE("0",s-u):i=(i.substring(0,s)||"0")+"."+i.substring(s),n+i}function LE(e,t,n){if(["","-"].indexOf(e)!==-1)return e;var r=(e.indexOf(".")!==-1||n)&&t,i=Uy(e),o=i.beforeDecimal,s=i.afterDecimal,u=i.hasNegation,f=parseFloat("0."+(s||"0")),d=s.length<=t?"0."+s:f.toFixed(t),p=d.split("."),m=o;o&&Number(p[0])&&(m=o.split("").reverse().reduce(function(x,k,C){return x.length>C?(Number(x[0])+Number(k)).toString()+x.substring(1,x.length):k+x},p[0]));var v=JR(p[1]||"",t,n),g=u?"-":"",w=r?".":"";return""+g+m+w+v}function Va(e,t){if(e.value=e.value,e!==null){if(e.createTextRange){var n=e.createTextRange();return n.move("character",t),n.select(),!0}return e.selectionStart||e.selectionStart===0?(e.focus(),e.setSelectionRange(t,t),!0):(e.focus(),!1)}}var t2=c9(function(e,t){for(var n=0,r=0,i=e.length,o=t.length;e[n]===t[n]&&nn&&i-r>n;)r++;return{from:{start:n,end:i-r},to:{start:n,end:o-r}}}),g9=function(e,t){var n=Math.min(e.selectionStart,t);return{from:{start:n,end:e.selectionEnd},to:{start:n,end:t}}};function v9(e,t,n){return Math.min(Math.max(e,t),n)}function eg(e){return Math.max(e.selectionStart,e.selectionEnd)}function y9(){return typeof navigator<"u"&&!(navigator.platform&&/iPhone|iPod/.test(navigator.platform))}function b9(e){return{from:{start:0,end:0},to:{start:0,end:e.length},lastValue:""}}function x9(e){var t=e.currentValue,n=e.formattedValue,r=e.currentValueIndex,i=e.formattedValueIndex;return t[r]===n[i]}function w9(e,t,n,r,i,o,s){s===void 0&&(s=x9);var u=i.findIndex(function(N){return N}),f=e.slice(0,u);!t&&!n.startsWith(f)&&(t=f,n=f+n,r=r+f.length);for(var d=n.length,p=e.length,m={},v=new Array(d),g=0;g0&&v[C]===-1;)C--;var T=C===-1||v[C]===-1?0:v[C]+1;return T>_?_:r-T<_-r?T:_}function zE(e,t,n,r){var i=e.length;if(t=v9(t,0,i),r==="left"){for(;t>=0&&!n[t];)t--;t===-1&&(t=n.indexOf(!0))}else{for(;t<=i&&!n[t];)t++;t>i&&(t=n.lastIndexOf(!0))}return t===-1&&(t=i),t}function S9(e){for(var t=Array.from({length:e.length+1}).map(function(){return!0}),n=0,r=t.length;nR.length-s.length||zV||m>e.length-s.length)&&(j=m),e=e.substring(0,j),e=C9(T?"-"+e:e,i),e=(e.match(T9(w))||[]).join("");var q=e.indexOf(w);e=e.replace(new RegExp(QR(w),"g"),function(G,F){return F===q?".":""});var I=Uy(e,i),Y=I.beforeDecimal,Z=I.afterDecimal,U=I.addNegation;return d.end-d.start$?!1:A>=re.start&&A{const[x,k]=E.useState(v??r),C=E.useCallback(()=>{k(D=>D===void 0?e??1:Math.min(D+(e??1),o))},[e,o]),_=E.useCallback(()=>{k(D=>D===void 0?-(e??1):Math.max(D-(e??1),i))},[e,i]);E.useEffect(()=>{v!==void 0&&k(v)},[v]);const T=D=>{const z=D.floatValue===void 0?void 0:D.floatValue;k(z),s&&s(z)},N=()=>{x!==void 0&&(xo&&(k(o),w.current.value=String(o)))};return S.jsxs("div",{className:"relative flex",children:[S.jsx(L9,{value:x,onValueChange:T,thousandSeparator:t,decimalScale:f,fixedDecimalScale:u,allowNegative:i<0,valueIsNumericString:!0,onBlur:N,max:o,min:i,suffix:p,prefix:m,customInput:D=>S.jsx(Za,{...D,className:Me("w-full",d)}),placeholder:n,className:"[appearance:textfield] [&::-webkit-inner-spin-button]:appearance-none [&::-webkit-outer-spin-button]:appearance-none",getInputRef:w,...g}),S.jsxs("div",{className:"absolute top-0 right-0 bottom-0 flex flex-col",children:[S.jsx(Ot,{"aria-label":"Increase value",className:"border-input h-1/2 rounded-l-none rounded-br-none border-b border-l px-2 focus-visible:relative",variant:"outline",onClick:C,disabled:x===o,children:S.jsx(xk,{size:15})}),S.jsx(Ot,{"aria-label":"Decrease value",className:"border-input h-1/2 rounded-l-none rounded-tr-none border-b border-l px-2 focus-visible:relative",variant:"outline",onClick:_,disabled:x===i,children:S.jsx(zv,{size:15})})]})]})});Jo.displayName="NumberInput";var z9=[" ","Enter","ArrowUp","ArrowDown"],j9=[" ","Enter"],gu="Select",[kd,Cd,M9]=pT(gu),[Al,vK]=hr(gu,[M9,wl]),Td=wl(),[P9,pa]=Al(gu),[F9,I9]=Al(gu),r2=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:i,onOpenChange:o,value:s,defaultValue:u,onValueChange:f,dir:d,name:p,autoComplete:m,disabled:v,required:g,form:w}=e,x=Td(t),[k,C]=E.useState(null),[_,T]=E.useState(null),[N,D]=E.useState(!1),z=hd(d),[R=!1,B]=_i({prop:r,defaultProp:i,onChange:o}),[P,j]=_i({prop:s,defaultProp:u,onChange:f}),V=E.useRef(null),q=k?w||!!k.closest("form"):!0,[I,Y]=E.useState(new Set),Z=Array.from(I).map(U=>U.props.value).join(";");return S.jsx(ny,{...x,children:S.jsxs(P9,{required:g,scope:t,trigger:k,onTriggerChange:C,valueNode:_,onValueNodeChange:T,valueNodeHasChildren:N,onValueNodeHasChildrenChange:D,contentId:bn(),value:P,onValueChange:j,open:R,onOpenChange:B,dir:z,triggerPointerDownPosRef:V,disabled:v,children:[S.jsx(kd.Provider,{scope:t,children:S.jsx(F9,{scope:e.__scopeSelect,onNativeOptionAdd:E.useCallback(U=>{Y(G=>new Set(G).add(U))},[]),onNativeOptionRemove:E.useCallback(U=>{Y(G=>{const F=new Set(G);return F.delete(U),F})},[]),children:n})}),q?S.jsxs(R2,{"aria-hidden":!0,required:g,tabIndex:-1,name:p,autoComplete:m,value:P,onChange:U=>j(U.target.value),disabled:v,form:w,children:[P===void 0?S.jsx("option",{value:""}):null,Array.from(I)]},Z):null]})})};r2.displayName=gu;var i2="SelectTrigger",a2=E.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...i}=e,o=Td(n),s=pa(i2,n),u=s.disabled||r,f=dt(t,s.onTriggerChange),d=Cd(n),p=E.useRef("touch"),[m,v,g]=D2(x=>{const k=d().filter(T=>!T.disabled),C=k.find(T=>T.value===s.value),_=N2(k,x,C);_!==void 0&&s.onValueChange(_.value)}),w=x=>{u||(s.onOpenChange(!0),g()),x&&(s.triggerPointerDownPosRef.current={x:Math.round(x.pageX),y:Math.round(x.pageY)})};return S.jsx(od,{asChild:!0,...o,children:S.jsx(We.button,{type:"button",role:"combobox","aria-controls":s.contentId,"aria-expanded":s.open,"aria-required":s.required,"aria-autocomplete":"none",dir:s.dir,"data-state":s.open?"open":"closed",disabled:u,"data-disabled":u?"":void 0,"data-placeholder":A2(s.value)?"":void 0,...i,ref:f,onClick:qe(i.onClick,x=>{x.currentTarget.focus(),p.current!=="mouse"&&w(x)}),onPointerDown:qe(i.onPointerDown,x=>{p.current=x.pointerType;const k=x.target;k.hasPointerCapture(x.pointerId)&&k.releasePointerCapture(x.pointerId),x.button===0&&x.ctrlKey===!1&&x.pointerType==="mouse"&&(w(x),x.preventDefault())}),onKeyDown:qe(i.onKeyDown,x=>{const k=m.current!=="";!(x.ctrlKey||x.altKey||x.metaKey)&&x.key.length===1&&v(x.key),!(k&&x.key===" ")&&z9.includes(x.key)&&(w(),x.preventDefault())})})})});a2.displayName=i2;var o2="SelectValue",l2=E.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:i,children:o,placeholder:s="",...u}=e,f=pa(o2,n),{onValueNodeHasChildrenChange:d}=f,p=o!==void 0,m=dt(t,f.onValueNodeChange);return xn(()=>{d(p)},[d,p]),S.jsx(We.span,{...u,ref:m,style:{pointerEvents:"none"},children:A2(f.value)?S.jsx(S.Fragment,{children:s}):o})});l2.displayName=o2;var G9="SelectIcon",s2=E.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...i}=e;return S.jsx(We.span,{"aria-hidden":!0,...i,ref:t,children:r||"▼"})});s2.displayName=G9;var B9="SelectPortal",u2=e=>S.jsx(Qf,{asChild:!0,...e});u2.displayName=B9;var eo="SelectContent",c2=E.forwardRef((e,t)=>{const n=pa(eo,e.__scopeSelect),[r,i]=E.useState();if(xn(()=>{i(new DocumentFragment)},[]),!n.open){const o=r;return o?au.createPortal(S.jsx(f2,{scope:e.__scopeSelect,children:S.jsx(kd.Slot,{scope:e.__scopeSelect,children:S.jsx("div",{children:e.children})})}),o):null}return S.jsx(d2,{...e,ref:t})});c2.displayName=eo;var _r=10,[f2,ma]=Al(eo),U9="SelectContentImpl",d2=E.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:i,onEscapeKeyDown:o,onPointerDownOutside:s,side:u,sideOffset:f,align:d,alignOffset:p,arrowPadding:m,collisionBoundary:v,collisionPadding:g,sticky:w,hideWhenDetached:x,avoidCollisions:k,...C}=e,_=pa(eo,n),[T,N]=E.useState(null),[D,z]=E.useState(null),R=dt(t,ae=>N(ae)),[B,P]=E.useState(null),[j,V]=E.useState(null),q=Cd(n),[I,Y]=E.useState(!1),Z=E.useRef(!1);E.useEffect(()=>{if(T)return Pv(T)},[T]),Mv();const U=E.useCallback(ae=>{const[oe,...Ce]=q().map(we=>we.ref.current),[he]=Ce.slice(-1),Ee=document.activeElement;for(const we of ae)if(we===Ee||(we==null||we.scrollIntoView({block:"nearest"}),we===oe&&D&&(D.scrollTop=0),we===he&&D&&(D.scrollTop=D.scrollHeight),we==null||we.focus(),document.activeElement!==Ee))return},[q,D]),G=E.useCallback(()=>U([B,T]),[U,B,T]);E.useEffect(()=>{I&&G()},[I,G]);const{onOpenChange:F,triggerPointerDownPosRef:K}=_;E.useEffect(()=>{if(T){let ae={x:0,y:0};const oe=he=>{var Ee,we;ae={x:Math.abs(Math.round(he.pageX)-(((Ee=K.current)==null?void 0:Ee.x)??0)),y:Math.abs(Math.round(he.pageY)-(((we=K.current)==null?void 0:we.y)??0))}},Ce=he=>{ae.x<=10&&ae.y<=10?he.preventDefault():T.contains(he.target)||F(!1),document.removeEventListener("pointermove",oe),K.current=null};return K.current!==null&&(document.addEventListener("pointermove",oe),document.addEventListener("pointerup",Ce,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",oe),document.removeEventListener("pointerup",Ce,{capture:!0})}}},[T,F,K]),E.useEffect(()=>{const ae=()=>F(!1);return window.addEventListener("blur",ae),window.addEventListener("resize",ae),()=>{window.removeEventListener("blur",ae),window.removeEventListener("resize",ae)}},[F]);const[A,$]=D2(ae=>{const oe=q().filter(Ee=>!Ee.disabled),Ce=oe.find(Ee=>Ee.ref.current===document.activeElement),he=N2(oe,ae,Ce);he&&setTimeout(()=>he.ref.current.focus())}),M=E.useCallback((ae,oe,Ce)=>{const he=!Z.current&&!Ce;(_.value!==void 0&&_.value===oe||he)&&(P(ae),he&&(Z.current=!0))},[_.value]),O=E.useCallback(()=>T==null?void 0:T.focus(),[T]),X=E.useCallback((ae,oe,Ce)=>{const he=!Z.current&&!Ce;(_.value!==void 0&&_.value===oe||he)&&V(ae)},[_.value]),re=r==="popper"?uv:h2,ue=re===uv?{side:u,sideOffset:f,align:d,alignOffset:p,arrowPadding:m,collisionBoundary:v,collisionPadding:g,sticky:w,hideWhenDetached:x,avoidCollisions:k}:{};return S.jsx(f2,{scope:n,content:T,viewport:D,onViewportChange:z,itemRefCallback:M,selectedItem:B,onItemLeave:O,itemTextRefCallback:X,focusSelectedItem:G,selectedItemText:j,position:r,isPositioned:I,searchRef:A,children:S.jsx(ed,{as:ua,allowPinchZoom:!0,children:S.jsx(Zf,{asChild:!0,trapped:_.open,onMountAutoFocus:ae=>{ae.preventDefault()},onUnmountAutoFocus:qe(i,ae=>{var oe;(oe=_.trigger)==null||oe.focus({preventScroll:!0}),ae.preventDefault()}),children:S.jsx(ou,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:o,onPointerDownOutside:s,onFocusOutside:ae=>ae.preventDefault(),onDismiss:()=>_.onOpenChange(!1),children:S.jsx(re,{role:"listbox",id:_.contentId,"data-state":_.open?"open":"closed",dir:_.dir,onContextMenu:ae=>ae.preventDefault(),...C,...ue,onPlaced:()=>Y(!0),ref:R,style:{display:"flex",flexDirection:"column",outline:"none",...C.style},onKeyDown:qe(C.onKeyDown,ae=>{const oe=ae.ctrlKey||ae.altKey||ae.metaKey;if(ae.key==="Tab"&&ae.preventDefault(),!oe&&ae.key.length===1&&$(ae.key),["ArrowUp","ArrowDown","Home","End"].includes(ae.key)){let he=q().filter(Ee=>!Ee.disabled).map(Ee=>Ee.ref.current);if(["ArrowUp","End"].includes(ae.key)&&(he=he.slice().reverse()),["ArrowUp","ArrowDown"].includes(ae.key)){const Ee=ae.target,we=he.indexOf(Ee);he=he.slice(we+1)}setTimeout(()=>U(he)),ae.preventDefault()}})})})})})})});d2.displayName=U9;var H9="SelectItemAlignedPosition",h2=E.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...i}=e,o=pa(eo,n),s=ma(eo,n),[u,f]=E.useState(null),[d,p]=E.useState(null),m=dt(t,R=>p(R)),v=Cd(n),g=E.useRef(!1),w=E.useRef(!0),{viewport:x,selectedItem:k,selectedItemText:C,focusSelectedItem:_}=s,T=E.useCallback(()=>{if(o.trigger&&o.valueNode&&u&&d&&x&&k&&C){const R=o.trigger.getBoundingClientRect(),B=d.getBoundingClientRect(),P=o.valueNode.getBoundingClientRect(),j=C.getBoundingClientRect();if(o.dir!=="rtl"){const Ee=j.left-B.left,we=P.left-Ee,Pe=R.left-we,Ae=R.width+Pe,xe=Math.max(Ae,B.width),ee=window.innerWidth-_r,ce=lv(we,[_r,Math.max(_r,ee-xe)]);u.style.minWidth=Ae+"px",u.style.left=ce+"px"}else{const Ee=B.right-j.right,we=window.innerWidth-P.right-Ee,Pe=window.innerWidth-R.right-we,Ae=R.width+Pe,xe=Math.max(Ae,B.width),ee=window.innerWidth-_r,ce=lv(we,[_r,Math.max(_r,ee-xe)]);u.style.minWidth=Ae+"px",u.style.right=ce+"px"}const V=v(),q=window.innerHeight-_r*2,I=x.scrollHeight,Y=window.getComputedStyle(d),Z=parseInt(Y.borderTopWidth,10),U=parseInt(Y.paddingTop,10),G=parseInt(Y.borderBottomWidth,10),F=parseInt(Y.paddingBottom,10),K=Z+U+I+F+G,A=Math.min(k.offsetHeight*5,K),$=window.getComputedStyle(x),M=parseInt($.paddingTop,10),O=parseInt($.paddingBottom,10),X=R.top+R.height/2-_r,re=q-X,ue=k.offsetHeight/2,ae=k.offsetTop+ue,oe=Z+U+ae,Ce=K-oe;if(oe<=X){const Ee=V.length>0&&k===V[V.length-1].ref.current;u.style.bottom="0px";const we=d.clientHeight-x.offsetTop-x.offsetHeight,Pe=Math.max(re,ue+(Ee?O:0)+we+G),Ae=oe+Pe;u.style.height=Ae+"px"}else{const Ee=V.length>0&&k===V[0].ref.current;u.style.top="0px";const Pe=Math.max(X,Z+x.offsetTop+(Ee?M:0)+ue)+Ce;u.style.height=Pe+"px",x.scrollTop=oe-X+x.offsetTop}u.style.margin=`${_r}px 0`,u.style.minHeight=A+"px",u.style.maxHeight=q+"px",r==null||r(),requestAnimationFrame(()=>g.current=!0)}},[v,o.trigger,o.valueNode,u,d,x,k,C,o.dir,r]);xn(()=>T(),[T]);const[N,D]=E.useState();xn(()=>{d&&D(window.getComputedStyle(d).zIndex)},[d]);const z=E.useCallback(R=>{R&&w.current===!0&&(T(),_==null||_(),w.current=!1)},[T,_]);return S.jsx(V9,{scope:n,contentWrapper:u,shouldExpandOnScrollRef:g,onScrollButtonChange:z,children:S.jsx("div",{ref:f,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:N},children:S.jsx(We.div,{...i,ref:m,style:{boxSizing:"border-box",maxHeight:"100%",...i.style}})})})});h2.displayName=H9;var $9="SelectPopperPosition",uv=E.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:i=_r,...o}=e,s=Td(n);return S.jsx(ry,{...s,...o,ref:t,align:r,collisionPadding:i,style:{boxSizing:"border-box",...o.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});uv.displayName=$9;var[V9,Hy]=Al(eo,{}),cv="SelectViewport",p2=E.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...i}=e,o=ma(cv,n),s=Hy(cv,n),u=dt(t,o.onViewportChange),f=E.useRef(0);return S.jsxs(S.Fragment,{children:[S.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:r}),S.jsx(kd.Slot,{scope:n,children:S.jsx(We.div,{"data-radix-select-viewport":"",role:"presentation",...i,ref:u,style:{position:"relative",flex:1,overflow:"hidden auto",...i.style},onScroll:qe(i.onScroll,d=>{const p=d.currentTarget,{contentWrapper:m,shouldExpandOnScrollRef:v}=s;if(v!=null&&v.current&&m){const g=Math.abs(f.current-p.scrollTop);if(g>0){const w=window.innerHeight-_r*2,x=parseFloat(m.style.minHeight),k=parseFloat(m.style.height),C=Math.max(x,k);if(C0?N:0,m.style.justifyContent="flex-end")}}}f.current=p.scrollTop})})})]})});p2.displayName=cv;var m2="SelectGroup",[q9,Y9]=Al(m2),g2=E.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=bn();return S.jsx(q9,{scope:n,id:i,children:S.jsx(We.div,{role:"group","aria-labelledby":i,...r,ref:t})})});g2.displayName=m2;var v2="SelectLabel",y2=E.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=Y9(v2,n);return S.jsx(We.div,{id:i.id,...r,ref:t})});y2.displayName=v2;var If="SelectItem",[W9,b2]=Al(If),x2=E.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:i=!1,textValue:o,...s}=e,u=pa(If,n),f=ma(If,n),d=u.value===r,[p,m]=E.useState(o??""),[v,g]=E.useState(!1),w=dt(t,_=>{var T;return(T=f.itemRefCallback)==null?void 0:T.call(f,_,r,i)}),x=bn(),k=E.useRef("touch"),C=()=>{i||(u.onValueChange(r),u.onOpenChange(!1))};if(r==="")throw new Error("A must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return S.jsx(W9,{scope:n,value:r,disabled:i,textId:x,isSelected:d,onItemTextChange:E.useCallback(_=>{m(T=>T||((_==null?void 0:_.textContent)??"").trim())},[]),children:S.jsx(kd.ItemSlot,{scope:n,value:r,disabled:i,textValue:p,children:S.jsx(We.div,{role:"option","aria-labelledby":x,"data-highlighted":v?"":void 0,"aria-selected":d&&v,"data-state":d?"checked":"unchecked","aria-disabled":i||void 0,"data-disabled":i?"":void 0,tabIndex:i?void 0:-1,...s,ref:w,onFocus:qe(s.onFocus,()=>g(!0)),onBlur:qe(s.onBlur,()=>g(!1)),onClick:qe(s.onClick,()=>{k.current!=="mouse"&&C()}),onPointerUp:qe(s.onPointerUp,()=>{k.current==="mouse"&&C()}),onPointerDown:qe(s.onPointerDown,_=>{k.current=_.pointerType}),onPointerMove:qe(s.onPointerMove,_=>{var T;k.current=_.pointerType,i?(T=f.onItemLeave)==null||T.call(f):k.current==="mouse"&&_.currentTarget.focus({preventScroll:!0})}),onPointerLeave:qe(s.onPointerLeave,_=>{var T;_.currentTarget===document.activeElement&&((T=f.onItemLeave)==null||T.call(f))}),onKeyDown:qe(s.onKeyDown,_=>{var N;((N=f.searchRef)==null?void 0:N.current)!==""&&_.key===" "||(j9.includes(_.key)&&C(),_.key===" "&&_.preventDefault())})})})})});x2.displayName=If;var Is="SelectItemText",w2=E.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:i,...o}=e,s=pa(Is,n),u=ma(Is,n),f=b2(Is,n),d=I9(Is,n),[p,m]=E.useState(null),v=dt(t,C=>m(C),f.onItemTextChange,C=>{var _;return(_=u.itemTextRefCallback)==null?void 0:_.call(u,C,f.value,f.disabled)}),g=p==null?void 0:p.textContent,w=E.useMemo(()=>S.jsx("option",{value:f.value,disabled:f.disabled,children:g},f.value),[f.disabled,f.value,g]),{onNativeOptionAdd:x,onNativeOptionRemove:k}=d;return xn(()=>(x(w),()=>k(w)),[x,k,w]),S.jsxs(S.Fragment,{children:[S.jsx(We.span,{id:f.textId,...o,ref:v}),f.isSelected&&s.valueNode&&!s.valueNodeHasChildren?au.createPortal(o.children,s.valueNode):null]})});w2.displayName=Is;var S2="SelectItemIndicator",E2=E.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return b2(S2,n).isSelected?S.jsx(We.span,{"aria-hidden":!0,...r,ref:t}):null});E2.displayName=S2;var fv="SelectScrollUpButton",_2=E.forwardRef((e,t)=>{const n=ma(fv,e.__scopeSelect),r=Hy(fv,e.__scopeSelect),[i,o]=E.useState(!1),s=dt(t,r.onScrollButtonChange);return xn(()=>{if(n.viewport&&n.isPositioned){let u=function(){const d=f.scrollTop>0;o(d)};const f=n.viewport;return u(),f.addEventListener("scroll",u),()=>f.removeEventListener("scroll",u)}},[n.viewport,n.isPositioned]),i?S.jsx(C2,{...e,ref:s,onAutoScroll:()=>{const{viewport:u,selectedItem:f}=n;u&&f&&(u.scrollTop=u.scrollTop-f.offsetHeight)}}):null});_2.displayName=fv;var dv="SelectScrollDownButton",k2=E.forwardRef((e,t)=>{const n=ma(dv,e.__scopeSelect),r=Hy(dv,e.__scopeSelect),[i,o]=E.useState(!1),s=dt(t,r.onScrollButtonChange);return xn(()=>{if(n.viewport&&n.isPositioned){let u=function(){const d=f.scrollHeight-f.clientHeight,p=Math.ceil(f.scrollTop)f.removeEventListener("scroll",u)}},[n.viewport,n.isPositioned]),i?S.jsx(C2,{...e,ref:s,onAutoScroll:()=>{const{viewport:u,selectedItem:f}=n;u&&f&&(u.scrollTop=u.scrollTop+f.offsetHeight)}}):null});k2.displayName=dv;var C2=E.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...i}=e,o=ma("SelectScrollButton",n),s=E.useRef(null),u=Cd(n),f=E.useCallback(()=>{s.current!==null&&(window.clearInterval(s.current),s.current=null)},[]);return E.useEffect(()=>()=>f(),[f]),xn(()=>{var p;const d=u().find(m=>m.ref.current===document.activeElement);(p=d==null?void 0:d.ref.current)==null||p.scrollIntoView({block:"nearest"})},[u]),S.jsx(We.div,{"aria-hidden":!0,...i,ref:t,style:{flexShrink:0,...i.style},onPointerDown:qe(i.onPointerDown,()=>{s.current===null&&(s.current=window.setInterval(r,50))}),onPointerMove:qe(i.onPointerMove,()=>{var d;(d=o.onItemLeave)==null||d.call(o),s.current===null&&(s.current=window.setInterval(r,50))}),onPointerLeave:qe(i.onPointerLeave,()=>{f()})})}),X9="SelectSeparator",T2=E.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return S.jsx(We.div,{"aria-hidden":!0,...r,ref:t})});T2.displayName=X9;var hv="SelectArrow",K9=E.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=Td(n),o=pa(hv,n),s=ma(hv,n);return o.open&&s.position==="popper"?S.jsx(iy,{...i,...r,ref:t}):null});K9.displayName=hv;function A2(e){return e===""||e===void 0}var R2=E.forwardRef((e,t)=>{const{value:n,...r}=e,i=E.useRef(null),o=dt(t,i),s=eR(n);return E.useEffect(()=>{const u=i.current,f=window.HTMLSelectElement.prototype,p=Object.getOwnPropertyDescriptor(f,"value").set;if(s!==n&&p){const m=new Event("change",{bubbles:!0});p.call(u,n),u.dispatchEvent(m)}},[s,n]),S.jsx(ay,{asChild:!0,children:S.jsx("select",{...r,ref:o,defaultValue:n})})});R2.displayName="BubbleSelect";function D2(e){const t=un(e),n=E.useRef(""),r=E.useRef(0),i=E.useCallback(s=>{const u=n.current+s;t(u),function f(d){n.current=d,window.clearTimeout(r.current),d!==""&&(r.current=window.setTimeout(()=>f(""),1e3))}(u)},[t]),o=E.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return E.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,i,o]}function N2(e,t,n){const i=t.length>1&&Array.from(t).every(d=>d===t[0])?t[0]:t,o=n?e.indexOf(n):-1;let s=Z9(e,Math.max(o,0));i.length===1&&(s=s.filter(d=>d!==n));const f=s.find(d=>d.textValue.toLowerCase().startsWith(i.toLowerCase()));return f!==n?f:void 0}function Z9(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var Q9=r2,O2=a2,J9=l2,e8=s2,t8=u2,L2=c2,n8=p2,r8=g2,z2=y2,j2=x2,i8=w2,a8=E2,M2=_2,P2=k2,F2=T2;const ME=Q9,PE=r8,FE=J9,pv=E.forwardRef(({className:e,children:t,...n},r)=>S.jsxs(O2,{ref:r,className:Me("border-input bg-background ring-offset-background placeholder:text-muted-foreground focus:ring-ring flex h-10 w-full items-center justify-between rounded-md border px-3 py-2 text-sm focus:ring-2 focus:ring-offset-2 focus:outline-none disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",e),...n,children:[t,S.jsx(e8,{asChild:!0,children:S.jsx(zv,{className:"h-4 w-4 opacity-50"})})]}));pv.displayName=O2.displayName;const I2=E.forwardRef(({className:e,...t},n)=>S.jsx(M2,{ref:n,className:Me("flex cursor-default items-center justify-center py-1",e),...t,children:S.jsx(xk,{className:"h-4 w-4"})}));I2.displayName=M2.displayName;const G2=E.forwardRef(({className:e,...t},n)=>S.jsx(P2,{ref:n,className:Me("flex cursor-default items-center justify-center py-1",e),...t,children:S.jsx(zv,{className:"h-4 w-4"})}));G2.displayName=P2.displayName;const mv=E.forwardRef(({className:e,children:t,position:n="popper",...r},i)=>S.jsx(t8,{children:S.jsxs(L2,{ref:i,className:Me("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border shadow-md",n==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:n,...r,children:[S.jsx(I2,{}),S.jsx(n8,{className:Me("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),S.jsx(G2,{})]})}));mv.displayName=L2.displayName;const o8=E.forwardRef(({className:e,...t},n)=>S.jsx(z2,{ref:n,className:Me("py-1.5 pr-2 pl-8 text-sm font-semibold",e),...t}));o8.displayName=z2.displayName;const wi=E.forwardRef(({className:e,children:t,...n},r)=>S.jsxs(j2,{ref:r,className:Me("focus:bg-accent focus:text-accent-foreground relative flex w-full cursor-default items-center rounded-sm py-1.5 pr-2 pl-8 text-sm outline-none select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...n,children:[S.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:S.jsx(a8,{children:S.jsx(Lv,{className:"h-4 w-4"})})}),S.jsx(i8,{children:t})]}));wi.displayName=j2.displayName;const l8=E.forwardRef(({className:e,...t},n)=>S.jsx(F2,{ref:n,className:Me("bg-muted -mx-1 my-1 h-px",e),...t}));l8.displayName=F2.displayName;function s8(){var n,r;const e=Qe(i=>i.querySettings),t=E.useCallback((i,o)=>{Qe.getState().updateQuerySettings({[i]:o})},[]);return S.jsxs(Ks,{className:"flex shrink-0 flex-col",children:[S.jsxs(Nf,{className:"px-4 pt-4 pb-2",children:[S.jsx(Zs,{children:"Parameters"}),S.jsx(xd,{children:"Configure your query parameters"})]}),S.jsx(Of,{className:"m-0 flex grow flex-col p-0 text-xs",children:S.jsx("div",{className:"relative size-full",children:S.jsxs("div",{className:"absolute inset-0 flex flex-col gap-2 overflow-auto px-2",children:[S.jsxs(S.Fragment,{children:[S.jsx(Ln,{className:"ml-1",text:"Query Mode",tooltip:"Select the retrieval strategy:\\n• Naive: Basic search without advanced techniques\\n• Local: Context-dependent information retrieval\\n• Global: Utilizes global knowledge base\\n• Hybrid: Combines local and global retrieval\\n• Mix: Integrates knowledge graph with vector retrieval",side:"left"}),S.jsxs(ME,{value:e.mode,onValueChange:i=>t("mode",i),children:[S.jsx(pv,{className:"hover:bg-primary/5 h-9 cursor-pointer focus:ring-0 focus:ring-offset-0 focus:outline-0 active:right-0",children:S.jsx(FE,{})}),S.jsx(mv,{children:S.jsxs(PE,{children:[S.jsx(wi,{value:"naive",children:"Naive"}),S.jsx(wi,{value:"local",children:"Local"}),S.jsx(wi,{value:"global",children:"Global"}),S.jsx(wi,{value:"hybrid",children:"Hybrid"}),S.jsx(wi,{value:"mix",children:"Mix"})]})})]})]}),S.jsxs(S.Fragment,{children:[S.jsx(Ln,{className:"ml-1",text:"Response Format",tooltip:"Defines the response format. Examples:\\n• Multiple Paragraphs\\n• Single Paragraph\\n• Bullet Points",side:"left"}),S.jsxs(ME,{value:e.response_type,onValueChange:i=>t("response_type",i),children:[S.jsx(pv,{className:"hover:bg-primary/5 h-9 cursor-pointer focus:ring-0 focus:ring-offset-0 focus:outline-0 active:right-0",children:S.jsx(FE,{})}),S.jsx(mv,{children:S.jsxs(PE,{children:[S.jsx(wi,{value:"Multiple Paragraphs",children:"Multiple Paragraphs"}),S.jsx(wi,{value:"Single Paragraph",children:"Single Paragraph"}),S.jsx(wi,{value:"Bullet Points",children:"Bullet Points"})]})})]})]}),S.jsxs(S.Fragment,{children:[S.jsx(Ln,{className:"ml-1",text:"Top K Results",tooltip:"Number of top items to retrieve. Represents entities in 'local' mode and relationships in 'global' mode",side:"left"}),S.jsx(Jo,{id:"top_k",stepper:1,value:e.top_k,onValueChange:i=>t("top_k",i),min:1,placeholder:"Number of results"})]}),S.jsxs(S.Fragment,{children:[S.jsxs(S.Fragment,{children:[S.jsx(Ln,{className:"ml-1",text:"Max Tokens for Text Unit",tooltip:"Maximum number of tokens allowed for each retrieved text chunk",side:"left"}),S.jsx(Jo,{id:"max_token_for_text_unit",stepper:500,value:e.max_token_for_text_unit,onValueChange:i=>t("max_token_for_text_unit",i),min:1,placeholder:"Max tokens for text unit"})]}),S.jsxs(S.Fragment,{children:[S.jsx(Ln,{text:"Max Tokens for Global Context",tooltip:"Maximum number of tokens allocated for relationship descriptions in global retrieval",side:"left"}),S.jsx(Jo,{id:"max_token_for_global_context",stepper:500,value:e.max_token_for_global_context,onValueChange:i=>t("max_token_for_global_context",i),min:1,placeholder:"Max tokens for global context"})]}),S.jsxs(S.Fragment,{children:[S.jsx(Ln,{className:"ml-1",text:"Max Tokens for Local Context",tooltip:"Maximum number of tokens allocated for entity descriptions in local retrieval",side:"left"}),S.jsx(Jo,{id:"max_token_for_local_context",stepper:500,value:e.max_token_for_local_context,onValueChange:i=>t("max_token_for_local_context",i),min:1,placeholder:"Max tokens for local context"})]})]}),S.jsxs(S.Fragment,{children:[S.jsx(Ln,{className:"ml-1",text:"History Turns",tooltip:"Number of complete conversation turns (user-assistant pairs) to consider in the response context",side:"left"}),S.jsx(Jo,{className:"!border-input",id:"history_turns",stepper:1,type:"text",value:e.history_turns,onValueChange:i=>t("history_turns",i),min:0,placeholder:"Number of history turns"})]}),S.jsxs(S.Fragment,{children:[S.jsxs(S.Fragment,{children:[S.jsx(Ln,{className:"ml-1",text:"High-Level Keywords",tooltip:"List of high-level keywords to prioritize in retrieval. Separate with commas",side:"left"}),S.jsx(Za,{id:"hl_keywords",type:"text",value:(n=e.hl_keywords)==null?void 0:n.join(", "),onChange:i=>{const o=i.target.value.split(",").map(s=>s.trim()).filter(s=>s!=="");t("hl_keywords",o)},placeholder:"Enter keywords"})]}),S.jsxs(S.Fragment,{children:[S.jsx(Ln,{className:"ml-1",text:"Low-Level Keywords",tooltip:"List of low-level keywords to refine retrieval focus. Separate with commas",side:"left"}),S.jsx(Za,{id:"ll_keywords",type:"text",value:(r=e.ll_keywords)==null?void 0:r.join(", "),onChange:i=>{const o=i.target.value.split(",").map(s=>s.trim()).filter(s=>s!=="");t("ll_keywords",o)},placeholder:"Enter keywords"})]})]}),S.jsxs(S.Fragment,{children:[S.jsxs("div",{className:"flex items-center gap-2",children:[S.jsx(Ln,{className:"ml-1",text:"Only Need Context",tooltip:"If True, only returns the retrieved context without generating a response",side:"left"}),S.jsx("div",{className:"grow"}),S.jsx(Bs,{className:"mr-1 cursor-pointer",id:"only_need_context",checked:e.only_need_context,onCheckedChange:i=>t("only_need_context",i)})]}),S.jsxs("div",{className:"flex items-center gap-2",children:[S.jsx(Ln,{className:"ml-1",text:"Only Need Prompt",tooltip:"If True, only returns the generated prompt without producing a response",side:"left"}),S.jsx("div",{className:"grow"}),S.jsx(Bs,{className:"mr-1 cursor-pointer",id:"only_need_prompt",checked:e.only_need_prompt,onCheckedChange:i=>t("only_need_prompt",i)})]}),S.jsxs("div",{className:"flex items-center gap-2",children:[S.jsx(Ln,{className:"ml-1",text:"Stream Response",tooltip:"If True, enables streaming output for real-time responses",side:"left"}),S.jsx("div",{className:"grow"}),S.jsx(Bs,{className:"mr-1 cursor-pointer",id:"stream",checked:e.stream,onCheckedChange:i=>t("stream",i)})]})]})]})})})]})}function u8(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const c8=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,f8=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,d8={};function IE(e,t){return(d8.jsx?f8:c8).test(e)}const h8=/[ \t\n\f\r]/g;function p8(e){return typeof e=="object"?e.type==="text"?GE(e.value):!1:GE(e)}function GE(e){return e.replace(h8,"")===""}class vu{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}vu.prototype.normal={};vu.prototype.property={};vu.prototype.space=void 0;function B2(e,t){const n={},r={};for(const i of e)Object.assign(n,i.property),Object.assign(r,i.normal);return new vu(n,r,t)}function gv(e){return e.toLowerCase()}class Gn{constructor(t,n){this.attribute=n,this.property=t}}Gn.prototype.attribute="";Gn.prototype.booleanish=!1;Gn.prototype.boolean=!1;Gn.prototype.commaOrSpaceSeparated=!1;Gn.prototype.commaSeparated=!1;Gn.prototype.defined=!1;Gn.prototype.mustUseProperty=!1;Gn.prototype.number=!1;Gn.prototype.overloadedBoolean=!1;Gn.prototype.property="";Gn.prototype.spaceSeparated=!1;Gn.prototype.space=void 0;let m8=0;const et=ro(),Vt=ro(),U2=ro(),Re=ro(),Nt=ro(),ol=ro(),qn=ro();function ro(){return 2**++m8}const vv=Object.freeze(Object.defineProperty({__proto__:null,boolean:et,booleanish:Vt,commaOrSpaceSeparated:qn,commaSeparated:ol,number:Re,overloadedBoolean:U2,spaceSeparated:Nt},Symbol.toStringTag,{value:"Module"})),tg=Object.keys(vv);class $y extends Gn{constructor(t,n,r,i){let o=-1;if(super(t,n),BE(this,"space",i),typeof r=="number")for(;++o4&&n.slice(0,4)==="data"&&x8.test(t)){if(t.charAt(4)==="-"){const o=t.slice(5).replace(UE,E8);r="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=t.slice(4);if(!UE.test(o)){let s=o.replace(b8,S8);s.charAt(0)!=="-"&&(s="-"+s),t="data"+s}}i=$y}return new i(r,t)}function S8(e){return"-"+e.toLowerCase()}function E8(e){return e.charAt(1).toUpperCase()}const _8=B2([H2,g8,q2,Y2,W2],"html"),Vy=B2([H2,v8,q2,Y2,W2],"svg");function k8(e){return e.join(" ").trim()}var Xo={},ng,HE;function C8(){if(HE)return ng;HE=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,i=/^:\s*/,o=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,s=/^[;\s]*/,u=/^\s+|\s+$/g,f=` -`,d="/",p="*",m="",v="comment",g="declaration";ng=function(x,k){if(typeof x!="string")throw new TypeError("First argument must be a string");if(!x)return[];k=k||{};var C=1,_=1;function T(I){var Y=I.match(t);Y&&(C+=Y.length);var Z=I.lastIndexOf(f);_=~Z?I.length-Z:_+I.length}function N(){var I={line:C,column:_};return function(Y){return Y.position=new D(I),B(),Y}}function D(I){this.start=I,this.end={line:C,column:_},this.source=k.source}D.prototype.content=x;function z(I){var Y=new Error(k.source+":"+C+":"+_+": "+I);if(Y.reason=I,Y.filename=k.source,Y.line=C,Y.column=_,Y.source=x,!k.silent)throw Y}function R(I){var Y=I.exec(x);if(Y){var Z=Y[0];return T(Z),x=x.slice(Z.length),Y}}function B(){R(n)}function P(I){var Y;for(I=I||[];Y=j();)Y!==!1&&I.push(Y);return I}function j(){var I=N();if(!(d!=x.charAt(0)||p!=x.charAt(1))){for(var Y=2;m!=x.charAt(Y)&&(p!=x.charAt(Y)||d!=x.charAt(Y+1));)++Y;if(Y+=2,m===x.charAt(Y-1))return z("End of comment missing");var Z=x.slice(2,Y-2);return _+=2,T(Z),x=x.slice(Y),_+=2,I({type:v,comment:Z})}}function V(){var I=N(),Y=R(r);if(Y){if(j(),!R(i))return z("property missing ':'");var Z=R(o),U=I({type:g,property:w(Y[0].replace(e,m)),value:Z?w(Z[0].replace(e,m)):m});return R(s),U}}function q(){var I=[];P(I);for(var Y;Y=V();)Y!==!1&&(I.push(Y),P(I));return I}return B(),q()};function w(x){return x?x.replace(u,m):m}return ng}var $E;function T8(){if($E)return Xo;$E=1;var e=Xo&&Xo.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Xo,"__esModule",{value:!0}),Xo.default=n;var t=e(C8());function n(r,i){var o=null;if(!r||typeof r!="string")return o;var s=(0,t.default)(r),u=typeof i=="function";return s.forEach(function(f){if(f.type==="declaration"){var d=f.property,p=f.value;u?i(d,p,f):p&&(o=o||{},o[d]=p)}}),o}return Xo}var A8=T8();const VE=fn(A8),R8=VE.default||VE,X2=K2("end"),qy=K2("start");function K2(e){return t;function t(n){const r=n&&n.position&&n.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function D8(e){const t=qy(e),n=X2(e);if(t&&n)return{start:t,end:n}}function Us(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?qE(e.position):"start"in e||"end"in e?qE(e):"line"in e||"column"in e?yv(e):""}function yv(e){return YE(e&&e.line)+":"+YE(e&&e.column)}function qE(e){return yv(e&&e.start)+"-"+yv(e&&e.end)}function YE(e){return e&&typeof e=="number"?e:1}class wn extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let i="",o={},s=!1;if(n&&("line"in n&&"column"in n?o={place:n}:"start"in n&&"end"in n?o={place:n}:"type"in n?o={ancestors:[n],place:n.position}:o={...n}),typeof t=="string"?i=t:!o.cause&&t&&(s=!0,i=t.message,o.cause=t),!o.ruleId&&!o.source&&typeof r=="string"){const f=r.indexOf(":");f===-1?o.ruleId=r:(o.source=r.slice(0,f),o.ruleId=r.slice(f+1))}if(!o.place&&o.ancestors&&o.ancestors){const f=o.ancestors[o.ancestors.length-1];f&&(o.place=f.position)}const u=o.place&&"start"in o.place?o.place.start:o.place;this.ancestors=o.ancestors||void 0,this.cause=o.cause||void 0,this.column=u?u.column:void 0,this.fatal=void 0,this.file,this.message=i,this.line=u?u.line:void 0,this.name=Us(o.place)||"1:1",this.place=o.place||void 0,this.reason=this.message,this.ruleId=o.ruleId||void 0,this.source=o.source||void 0,this.stack=s&&o.cause&&typeof o.cause.stack=="string"?o.cause.stack:"",this.actual,this.expected,this.note,this.url}}wn.prototype.file="";wn.prototype.name="";wn.prototype.reason="";wn.prototype.message="";wn.prototype.stack="";wn.prototype.column=void 0;wn.prototype.line=void 0;wn.prototype.ancestors=void 0;wn.prototype.cause=void 0;wn.prototype.fatal=void 0;wn.prototype.place=void 0;wn.prototype.ruleId=void 0;wn.prototype.source=void 0;const Yy={}.hasOwnProperty,N8=new Map,O8=/[A-Z]/g,L8=/-([a-z])/g,z8=new Set(["table","tbody","thead","tfoot","tr"]),j8=new Set(["td","th"]),Z2="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function Q2(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let r;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=H8(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=U8(n,t.jsx,t.jsxs)}const i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?Vy:_8,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},o=J2(i,e,void 0);return o&&typeof o!="string"?o:i.create(e,i.Fragment,{children:o||void 0},void 0)}function J2(e,t,n){if(t.type==="element")return M8(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return P8(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return I8(e,t,n);if(t.type==="mdxjsEsm")return F8(e,t);if(t.type==="root")return G8(e,t,n);if(t.type==="text")return B8(e,t)}function M8(e,t,n){const r=e.schema;let i=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=Vy,e.schema=i),e.ancestors.push(t);const o=tD(e,t.tagName,!1),s=$8(e,t);let u=Xy(e,t);return z8.has(t.tagName)&&(u=u.filter(function(f){return typeof f=="string"?!p8(f):!0})),eD(e,s,o,t),Wy(s,u),e.ancestors.pop(),e.schema=r,e.create(t,o,s,n)}function P8(e,t){if(t.data&&t.data.estree&&e.evaluater){const r=t.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}tu(e,t.position)}function F8(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);tu(e,t.position)}function I8(e,t,n){const r=e.schema;let i=r;t.name==="svg"&&r.space==="html"&&(i=Vy,e.schema=i),e.ancestors.push(t);const o=t.name===null?e.Fragment:tD(e,t.name,!0),s=V8(e,t),u=Xy(e,t);return eD(e,s,o,t),Wy(s,u),e.ancestors.pop(),e.schema=r,e.create(t,o,s,n)}function G8(e,t,n){const r={};return Wy(r,Xy(e,t)),e.create(t,e.Fragment,r,n)}function B8(e,t){return t.value}function eD(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function Wy(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function U8(e,t,n){return r;function r(i,o,s,u){const d=Array.isArray(s.children)?n:t;return u?d(o,s,u):d(o,s)}}function H8(e,t){return n;function n(r,i,o,s){const u=Array.isArray(o.children),f=qy(r);return t(i,o,s,u,{columnNumber:f?f.column-1:void 0,fileName:e,lineNumber:f?f.line:void 0},void 0)}}function $8(e,t){const n={};let r,i;for(i in t.properties)if(i!=="children"&&Yy.call(t.properties,i)){const o=q8(e,i,t.properties[i]);if(o){const[s,u]=o;e.tableCellAlignToStyle&&s==="align"&&typeof u=="string"&&j8.has(t.tagName)?r=u:n[s]=u}}if(r){const o=n.style||(n.style={});o[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function V8(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const o=r.data.estree.body[0];o.type;const s=o.expression;s.type;const u=s.properties[0];u.type,Object.assign(n,e.evaluater.evaluateExpression(u.argument))}else tu(e,t.position);else{const i=r.name;let o;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const u=r.value.data.estree.body[0];u.type,o=e.evaluater.evaluateExpression(u.expression)}else tu(e,t.position);else o=r.value===null?!0:r.value;n[i]=o}return n}function Xy(e,t){const n=[];let r=-1;const i=e.passKeys?new Map:N8;for(;++ri?0:i+t:t=t>i?i:t,n=n>0?n:0,r.length<1e4)s=Array.from(r),s.unshift(t,n),e.splice(...s);else for(n&&e.splice(t,n);o0?(Kn(e,e.length,0,t),e):t}const KE={}.hasOwnProperty;function rD(e){const t={};let n=-1;for(;++n13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function Tr(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const kn=ga(/[A-Za-z]/),yn=ga(/[\dA-Za-z]/),n7=ga(/[#-'*+\--9=?A-Z^-~]/);function Gf(e){return e!==null&&(e<32||e===127)}const bv=ga(/\d/),r7=ga(/[\dA-Fa-f]/),i7=ga(/[!-/:-@[-`{-~]/);function Ue(e){return e!==null&&e<-2}function Tt(e){return e!==null&&(e<0||e===32)}function ut(e){return e===-2||e===-1||e===32}const Ad=ga(new RegExp("\\p{P}|\\p{S}","u")),to=ga(/\s/);function ga(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function Dl(e){const t=[];let n=-1,r=0,i=0;for(;++n55295&&o<57344){const u=e.charCodeAt(n+1);o<56320&&u>56319&&u<57344?(s=String.fromCharCode(o,u),i=1):s="�"}else s=String.fromCharCode(o);s&&(t.push(e.slice(r,n),encodeURIComponent(s)),r=n+i+1,s=""),i&&(n+=i,i=0)}return t.join("")+e.slice(r)}function lt(e,t,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let o=0;return s;function s(f){return ut(f)?(e.enter(n),u(f)):t(f)}function u(f){return ut(f)&&o++s))return;const R=t.events.length;let B=R,P,j;for(;B--;)if(t.events[B][0]==="exit"&&t.events[B][1].type==="chunkFlow"){if(P){j=t.events[B][1].end;break}P=!0}for(C(r),z=R;zT;){const D=n[N];t.containerState=D[1],D[0].exit.call(t,e)}n.length=T}function _(){i.write([null]),o=void 0,i=void 0,t.containerState._closeFlow=void 0}}function u7(e,t,n){return lt(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function pl(e){if(e===null||Tt(e)||to(e))return 1;if(Ad(e))return 2}function Rd(e,t,n){const r=[];let i=-1;for(;++i1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const m={...e[r][1].end},v={...e[n][1].start};QE(m,-f),QE(v,f),s={type:f>1?"strongSequence":"emphasisSequence",start:m,end:{...e[r][1].end}},u={type:f>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:v},o={type:f>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},i={type:f>1?"strong":"emphasis",start:{...s.start},end:{...u.end}},e[r][1].end={...s.start},e[n][1].start={...u.end},d=[],e[r][1].end.offset-e[r][1].start.offset&&(d=fr(d,[["enter",e[r][1],t],["exit",e[r][1],t]])),d=fr(d,[["enter",i,t],["enter",s,t],["exit",s,t],["enter",o,t]]),d=fr(d,Rd(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),d=fr(d,[["exit",o,t],["enter",u,t],["exit",u,t],["exit",i,t]]),e[n][1].end.offset-e[n][1].start.offset?(p=2,d=fr(d,[["enter",e[n][1],t],["exit",e[n][1],t]])):p=0,Kn(e,r-1,n-r+3,d),n=r+d.length-p-2;break}}for(n=-1;++n0&&ut(z)?lt(e,_,"linePrefix",o+1)(z):_(z)}function _(z){return z===null||Ue(z)?e.check(JE,x,N)(z):(e.enter("codeFlowValue"),T(z))}function T(z){return z===null||Ue(z)?(e.exit("codeFlowValue"),_(z)):(e.consume(z),T)}function N(z){return e.exit("codeFenced"),t(z)}function D(z,R,B){let P=0;return j;function j(Z){return z.enter("lineEnding"),z.consume(Z),z.exit("lineEnding"),V}function V(Z){return z.enter("codeFencedFence"),ut(Z)?lt(z,q,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(Z):q(Z)}function q(Z){return Z===u?(z.enter("codeFencedFenceSequence"),I(Z)):B(Z)}function I(Z){return Z===u?(P++,z.consume(Z),I):P>=s?(z.exit("codeFencedFenceSequence"),ut(Z)?lt(z,Y,"whitespace")(Z):Y(Z)):B(Z)}function Y(Z){return Z===null||Ue(Z)?(z.exit("codeFencedFence"),R(Z)):B(Z)}}}function w7(e,t,n){const r=this;return i;function i(s){return s===null?n(s):(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),o)}function o(s){return r.parser.lazy[r.now().line]?n(s):t(s)}}const ig={name:"codeIndented",tokenize:E7},S7={partial:!0,tokenize:_7};function E7(e,t,n){const r=this;return i;function i(d){return e.enter("codeIndented"),lt(e,o,"linePrefix",5)(d)}function o(d){const p=r.events[r.events.length-1];return p&&p[1].type==="linePrefix"&&p[2].sliceSerialize(p[1],!0).length>=4?s(d):n(d)}function s(d){return d===null?f(d):Ue(d)?e.attempt(S7,s,f)(d):(e.enter("codeFlowValue"),u(d))}function u(d){return d===null||Ue(d)?(e.exit("codeFlowValue"),s(d)):(e.consume(d),u)}function f(d){return e.exit("codeIndented"),t(d)}}function _7(e,t,n){const r=this;return i;function i(s){return r.parser.lazy[r.now().line]?n(s):Ue(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),i):lt(e,o,"linePrefix",5)(s)}function o(s){const u=r.events[r.events.length-1];return u&&u[1].type==="linePrefix"&&u[2].sliceSerialize(u[1],!0).length>=4?t(s):Ue(s)?i(s):n(s)}}const k7={name:"codeText",previous:T7,resolve:C7,tokenize:A7};function C7(e){let t=e.length-4,n=3,r,i;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return tthis.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(t,n,r){const i=n||0;this.setCursor(Math.trunc(t));const o=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&js(this.left,r),o.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),js(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),js(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t=4?t(s):e.interrupt(r.parser.constructs.flow,n,t)(s)}}function uD(e,t,n,r,i,o,s,u,f){const d=f||Number.POSITIVE_INFINITY;let p=0;return m;function m(C){return C===60?(e.enter(r),e.enter(i),e.enter(o),e.consume(C),e.exit(o),v):C===null||C===32||C===41||Gf(C)?n(C):(e.enter(r),e.enter(s),e.enter(u),e.enter("chunkString",{contentType:"string"}),x(C))}function v(C){return C===62?(e.enter(o),e.consume(C),e.exit(o),e.exit(i),e.exit(r),t):(e.enter(u),e.enter("chunkString",{contentType:"string"}),g(C))}function g(C){return C===62?(e.exit("chunkString"),e.exit(u),v(C)):C===null||C===60||Ue(C)?n(C):(e.consume(C),C===92?w:g)}function w(C){return C===60||C===62||C===92?(e.consume(C),g):g(C)}function x(C){return!p&&(C===null||C===41||Tt(C))?(e.exit("chunkString"),e.exit(u),e.exit(s),e.exit(r),t(C)):p999||g===null||g===91||g===93&&!f||g===94&&!u&&"_hiddenFootnoteSupport"in s.parser.constructs?n(g):g===93?(e.exit(o),e.enter(i),e.consume(g),e.exit(i),e.exit(r),t):Ue(g)?(e.enter("lineEnding"),e.consume(g),e.exit("lineEnding"),p):(e.enter("chunkString",{contentType:"string"}),m(g))}function m(g){return g===null||g===91||g===93||Ue(g)||u++>999?(e.exit("chunkString"),p(g)):(e.consume(g),f||(f=!ut(g)),g===92?v:m)}function v(g){return g===91||g===92||g===93?(e.consume(g),u++,m):m(g)}}function fD(e,t,n,r,i,o){let s;return u;function u(v){return v===34||v===39||v===40?(e.enter(r),e.enter(i),e.consume(v),e.exit(i),s=v===40?41:v,f):n(v)}function f(v){return v===s?(e.enter(i),e.consume(v),e.exit(i),e.exit(r),t):(e.enter(o),d(v))}function d(v){return v===s?(e.exit(o),f(s)):v===null?n(v):Ue(v)?(e.enter("lineEnding"),e.consume(v),e.exit("lineEnding"),lt(e,d,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),p(v))}function p(v){return v===s||v===null||Ue(v)?(e.exit("chunkString"),d(v)):(e.consume(v),v===92?m:p)}function m(v){return v===s||v===92?(e.consume(v),p):p(v)}}function Hs(e,t){let n;return r;function r(i){return Ue(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):ut(i)?lt(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}const M7={name:"definition",tokenize:F7},P7={partial:!0,tokenize:I7};function F7(e,t,n){const r=this;let i;return o;function o(g){return e.enter("definition"),s(g)}function s(g){return cD.call(r,e,u,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(g)}function u(g){return i=Tr(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),g===58?(e.enter("definitionMarker"),e.consume(g),e.exit("definitionMarker"),f):n(g)}function f(g){return Tt(g)?Hs(e,d)(g):d(g)}function d(g){return uD(e,p,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(g)}function p(g){return e.attempt(P7,m,m)(g)}function m(g){return ut(g)?lt(e,v,"whitespace")(g):v(g)}function v(g){return g===null||Ue(g)?(e.exit("definition"),r.parser.defined.push(i),t(g)):n(g)}}function I7(e,t,n){return r;function r(u){return Tt(u)?Hs(e,i)(u):n(u)}function i(u){return fD(e,o,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(u)}function o(u){return ut(u)?lt(e,s,"whitespace")(u):s(u)}function s(u){return u===null||Ue(u)?t(u):n(u)}}const G7={name:"hardBreakEscape",tokenize:B7};function B7(e,t,n){return r;function r(o){return e.enter("hardBreakEscape"),e.consume(o),i}function i(o){return Ue(o)?(e.exit("hardBreakEscape"),t(o)):n(o)}}const U7={name:"headingAtx",resolve:H7,tokenize:$7};function H7(e,t){let n=e.length-2,r=3,i,o;return e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(i={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},o={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},Kn(e,r,n-r+1,[["enter",i,t],["enter",o,t],["exit",o,t],["exit",i,t]])),e}function $7(e,t,n){let r=0;return i;function i(p){return e.enter("atxHeading"),o(p)}function o(p){return e.enter("atxHeadingSequence"),s(p)}function s(p){return p===35&&r++<6?(e.consume(p),s):p===null||Tt(p)?(e.exit("atxHeadingSequence"),u(p)):n(p)}function u(p){return p===35?(e.enter("atxHeadingSequence"),f(p)):p===null||Ue(p)?(e.exit("atxHeading"),t(p)):ut(p)?lt(e,u,"whitespace")(p):(e.enter("atxHeadingText"),d(p))}function f(p){return p===35?(e.consume(p),f):(e.exit("atxHeadingSequence"),u(p))}function d(p){return p===null||p===35||Tt(p)?(e.exit("atxHeadingText"),u(p)):(e.consume(p),d)}}const V7=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],t_=["pre","script","style","textarea"],q7={concrete:!0,name:"htmlFlow",resolveTo:X7,tokenize:K7},Y7={partial:!0,tokenize:Q7},W7={partial:!0,tokenize:Z7};function X7(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function K7(e,t,n){const r=this;let i,o,s,u,f;return d;function d(O){return p(O)}function p(O){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(O),m}function m(O){return O===33?(e.consume(O),v):O===47?(e.consume(O),o=!0,x):O===63?(e.consume(O),i=3,r.interrupt?t:A):kn(O)?(e.consume(O),s=String.fromCharCode(O),k):n(O)}function v(O){return O===45?(e.consume(O),i=2,g):O===91?(e.consume(O),i=5,u=0,w):kn(O)?(e.consume(O),i=4,r.interrupt?t:A):n(O)}function g(O){return O===45?(e.consume(O),r.interrupt?t:A):n(O)}function w(O){const X="CDATA[";return O===X.charCodeAt(u++)?(e.consume(O),u===X.length?r.interrupt?t:q:w):n(O)}function x(O){return kn(O)?(e.consume(O),s=String.fromCharCode(O),k):n(O)}function k(O){if(O===null||O===47||O===62||Tt(O)){const X=O===47,re=s.toLowerCase();return!X&&!o&&t_.includes(re)?(i=1,r.interrupt?t(O):q(O)):V7.includes(s.toLowerCase())?(i=6,X?(e.consume(O),C):r.interrupt?t(O):q(O)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(O):o?_(O):T(O))}return O===45||yn(O)?(e.consume(O),s+=String.fromCharCode(O),k):n(O)}function C(O){return O===62?(e.consume(O),r.interrupt?t:q):n(O)}function _(O){return ut(O)?(e.consume(O),_):j(O)}function T(O){return O===47?(e.consume(O),j):O===58||O===95||kn(O)?(e.consume(O),N):ut(O)?(e.consume(O),T):j(O)}function N(O){return O===45||O===46||O===58||O===95||yn(O)?(e.consume(O),N):D(O)}function D(O){return O===61?(e.consume(O),z):ut(O)?(e.consume(O),D):T(O)}function z(O){return O===null||O===60||O===61||O===62||O===96?n(O):O===34||O===39?(e.consume(O),f=O,R):ut(O)?(e.consume(O),z):B(O)}function R(O){return O===f?(e.consume(O),f=null,P):O===null||Ue(O)?n(O):(e.consume(O),R)}function B(O){return O===null||O===34||O===39||O===47||O===60||O===61||O===62||O===96||Tt(O)?D(O):(e.consume(O),B)}function P(O){return O===47||O===62||ut(O)?T(O):n(O)}function j(O){return O===62?(e.consume(O),V):n(O)}function V(O){return O===null||Ue(O)?q(O):ut(O)?(e.consume(O),V):n(O)}function q(O){return O===45&&i===2?(e.consume(O),U):O===60&&i===1?(e.consume(O),G):O===62&&i===4?(e.consume(O),$):O===63&&i===3?(e.consume(O),A):O===93&&i===5?(e.consume(O),K):Ue(O)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(Y7,M,I)(O)):O===null||Ue(O)?(e.exit("htmlFlowData"),I(O)):(e.consume(O),q)}function I(O){return e.check(W7,Y,M)(O)}function Y(O){return e.enter("lineEnding"),e.consume(O),e.exit("lineEnding"),Z}function Z(O){return O===null||Ue(O)?I(O):(e.enter("htmlFlowData"),q(O))}function U(O){return O===45?(e.consume(O),A):q(O)}function G(O){return O===47?(e.consume(O),s="",F):q(O)}function F(O){if(O===62){const X=s.toLowerCase();return t_.includes(X)?(e.consume(O),$):q(O)}return kn(O)&&s.length<8?(e.consume(O),s+=String.fromCharCode(O),F):q(O)}function K(O){return O===93?(e.consume(O),A):q(O)}function A(O){return O===62?(e.consume(O),$):O===45&&i===2?(e.consume(O),A):q(O)}function $(O){return O===null||Ue(O)?(e.exit("htmlFlowData"),M(O)):(e.consume(O),$)}function M(O){return e.exit("htmlFlow"),t(O)}}function Z7(e,t,n){const r=this;return i;function i(s){return Ue(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),o):n(s)}function o(s){return r.parser.lazy[r.now().line]?n(s):t(s)}}function Q7(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(yu,t,n)}}const J7={name:"htmlText",tokenize:eV};function eV(e,t,n){const r=this;let i,o,s;return u;function u(A){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(A),f}function f(A){return A===33?(e.consume(A),d):A===47?(e.consume(A),D):A===63?(e.consume(A),T):kn(A)?(e.consume(A),B):n(A)}function d(A){return A===45?(e.consume(A),p):A===91?(e.consume(A),o=0,w):kn(A)?(e.consume(A),_):n(A)}function p(A){return A===45?(e.consume(A),g):n(A)}function m(A){return A===null?n(A):A===45?(e.consume(A),v):Ue(A)?(s=m,G(A)):(e.consume(A),m)}function v(A){return A===45?(e.consume(A),g):m(A)}function g(A){return A===62?U(A):A===45?v(A):m(A)}function w(A){const $="CDATA[";return A===$.charCodeAt(o++)?(e.consume(A),o===$.length?x:w):n(A)}function x(A){return A===null?n(A):A===93?(e.consume(A),k):Ue(A)?(s=x,G(A)):(e.consume(A),x)}function k(A){return A===93?(e.consume(A),C):x(A)}function C(A){return A===62?U(A):A===93?(e.consume(A),C):x(A)}function _(A){return A===null||A===62?U(A):Ue(A)?(s=_,G(A)):(e.consume(A),_)}function T(A){return A===null?n(A):A===63?(e.consume(A),N):Ue(A)?(s=T,G(A)):(e.consume(A),T)}function N(A){return A===62?U(A):T(A)}function D(A){return kn(A)?(e.consume(A),z):n(A)}function z(A){return A===45||yn(A)?(e.consume(A),z):R(A)}function R(A){return Ue(A)?(s=R,G(A)):ut(A)?(e.consume(A),R):U(A)}function B(A){return A===45||yn(A)?(e.consume(A),B):A===47||A===62||Tt(A)?P(A):n(A)}function P(A){return A===47?(e.consume(A),U):A===58||A===95||kn(A)?(e.consume(A),j):Ue(A)?(s=P,G(A)):ut(A)?(e.consume(A),P):U(A)}function j(A){return A===45||A===46||A===58||A===95||yn(A)?(e.consume(A),j):V(A)}function V(A){return A===61?(e.consume(A),q):Ue(A)?(s=V,G(A)):ut(A)?(e.consume(A),V):P(A)}function q(A){return A===null||A===60||A===61||A===62||A===96?n(A):A===34||A===39?(e.consume(A),i=A,I):Ue(A)?(s=q,G(A)):ut(A)?(e.consume(A),q):(e.consume(A),Y)}function I(A){return A===i?(e.consume(A),i=void 0,Z):A===null?n(A):Ue(A)?(s=I,G(A)):(e.consume(A),I)}function Y(A){return A===null||A===34||A===39||A===60||A===61||A===96?n(A):A===47||A===62||Tt(A)?P(A):(e.consume(A),Y)}function Z(A){return A===47||A===62||Tt(A)?P(A):n(A)}function U(A){return A===62?(e.consume(A),e.exit("htmlTextData"),e.exit("htmlText"),t):n(A)}function G(A){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(A),e.exit("lineEnding"),F}function F(A){return ut(A)?lt(e,K,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(A):K(A)}function K(A){return e.enter("htmlTextData"),s(A)}}const Qy={name:"labelEnd",resolveAll:iV,resolveTo:aV,tokenize:oV},tV={tokenize:lV},nV={tokenize:sV},rV={tokenize:uV};function iV(e){let t=-1;const n=[];for(;++t=3&&(d===null||Ue(d))?(e.exit("thematicBreak"),t(d)):n(d)}function f(d){return d===i?(e.consume(d),r++,f):(e.exit("thematicBreakSequence"),ut(d)?lt(e,u,"whitespace")(d):u(d))}}const On={continuation:{tokenize:bV},exit:wV,name:"list",tokenize:yV},gV={partial:!0,tokenize:SV},vV={partial:!0,tokenize:xV};function yV(e,t,n){const r=this,i=r.events[r.events.length-1];let o=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,s=0;return u;function u(g){const w=r.containerState.type||(g===42||g===43||g===45?"listUnordered":"listOrdered");if(w==="listUnordered"?!r.containerState.marker||g===r.containerState.marker:bv(g)){if(r.containerState.type||(r.containerState.type=w,e.enter(w,{_container:!0})),w==="listUnordered")return e.enter("listItemPrefix"),g===42||g===45?e.check(vf,n,d)(g):d(g);if(!r.interrupt||g===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),f(g)}return n(g)}function f(g){return bv(g)&&++s<10?(e.consume(g),f):(!r.interrupt||s<2)&&(r.containerState.marker?g===r.containerState.marker:g===41||g===46)?(e.exit("listItemValue"),d(g)):n(g)}function d(g){return e.enter("listItemMarker"),e.consume(g),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||g,e.check(yu,r.interrupt?n:p,e.attempt(gV,v,m))}function p(g){return r.containerState.initialBlankLine=!0,o++,v(g)}function m(g){return ut(g)?(e.enter("listItemPrefixWhitespace"),e.consume(g),e.exit("listItemPrefixWhitespace"),v):n(g)}function v(g){return r.containerState.size=o+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(g)}}function bV(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(yu,i,o);function i(u){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,lt(e,t,"listItemIndent",r.containerState.size+1)(u)}function o(u){return r.containerState.furtherBlankLines||!ut(u)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,s(u)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(vV,t,s)(u))}function s(u){return r.containerState._closeFlow=!0,r.interrupt=void 0,lt(e,e.attempt(On,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(u)}}function xV(e,t,n){const r=this;return lt(e,i,"listItemIndent",r.containerState.size+1);function i(o){const s=r.events[r.events.length-1];return s&&s[1].type==="listItemIndent"&&s[2].sliceSerialize(s[1],!0).length===r.containerState.size?t(o):n(o)}}function wV(e){e.exit(this.containerState.type)}function SV(e,t,n){const r=this;return lt(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(o){const s=r.events[r.events.length-1];return!ut(o)&&s&&s[1].type==="listItemPrefixWhitespace"?t(o):n(o)}}const n_={name:"setextUnderline",resolveTo:EV,tokenize:_V};function EV(e,t){let n=e.length,r,i,o;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(i=n)}else e[n][1].type==="content"&&e.splice(n,1),!o&&e[n][1].type==="definition"&&(o=n);const s={type:"setextHeading",start:{...e[i][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type="setextHeadingText",o?(e.splice(i,0,["enter",s,t]),e.splice(o+1,0,["exit",e[r][1],t]),e[r][1].end={...e[o][1].end}):e[r][1]=s,e.push(["exit",s,t]),e}function _V(e,t,n){const r=this;let i;return o;function o(d){let p=r.events.length,m;for(;p--;)if(r.events[p][1].type!=="lineEnding"&&r.events[p][1].type!=="linePrefix"&&r.events[p][1].type!=="content"){m=r.events[p][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||m)?(e.enter("setextHeadingLine"),i=d,s(d)):n(d)}function s(d){return e.enter("setextHeadingLineSequence"),u(d)}function u(d){return d===i?(e.consume(d),u):(e.exit("setextHeadingLineSequence"),ut(d)?lt(e,f,"lineSuffix")(d):f(d))}function f(d){return d===null||Ue(d)?(e.exit("setextHeadingLine"),t(d)):n(d)}}const kV={tokenize:CV};function CV(e){const t=this,n=e.attempt(yu,r,e.attempt(this.parser.constructs.flowInitial,i,lt(e,e.attempt(this.parser.constructs.flow,i,e.attempt(N7,i)),"linePrefix")));return n;function r(o){if(o===null){e.consume(o);return}return e.enter("lineEndingBlank"),e.consume(o),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function i(o){if(o===null){e.consume(o);return}return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const TV={resolveAll:hD()},AV=dD("string"),RV=dD("text");function dD(e){return{resolveAll:hD(e==="text"?DV:void 0),tokenize:t};function t(n){const r=this,i=this.parser.constructs[e],o=n.attempt(i,s,u);return s;function s(p){return d(p)?o(p):u(p)}function u(p){if(p===null){n.consume(p);return}return n.enter("data"),n.consume(p),f}function f(p){return d(p)?(n.exit("data"),o(p)):(n.consume(p),f)}function d(p){if(p===null)return!0;const m=i[p];let v=-1;if(m)for(;++v-1){const u=s[0];typeof u=="string"?s[0]=u.slice(r):s.shift()}o>0&&s.push(e[i].slice(0,o))}return s}function HV(e,t){let n=-1;const r=[];let i;for(;++n0){const vt=Oe.tokenStack[Oe.tokenStack.length-1];(vt[1]||i_).call(Oe,void 0,vt[0])}for(de.position={start:ra(te.length>0?te[0][1].start:{line:1,column:1,offset:0}),end:ra(te.length>0?te[te.length-2][1].end:{line:1,column:1,offset:0})},Ye=-1;++Ye1?"-"+u:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(s)}]};e.patch(t,f);const d={type:"element",tagName:"sup",properties:{},children:[f]};return e.patch(t,d),e.applyData(t,d)}function oq(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function lq(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function gD(e,t){const n=t.referenceType;let r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+r}];const i=e.all(t),o=i[0];o&&o.type==="text"?o.value="["+o.value:i.unshift({type:"text",value:"["});const s=i[i.length-1];return s&&s.type==="text"?s.value+=r:i.push({type:"text",value:r}),i}function sq(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return gD(e,t);const i={src:Dl(r.url||""),alt:t.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);const o={type:"element",tagName:"img",properties:i,children:[]};return e.patch(t,o),e.applyData(t,o)}function uq(e,t){const n={src:Dl(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function cq(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function fq(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return gD(e,t);const i={href:Dl(r.url||"")};r.title!==null&&r.title!==void 0&&(i.title=r.title);const o={type:"element",tagName:"a",properties:i,children:e.all(t)};return e.patch(t,o),e.applyData(t,o)}function dq(e,t){const n={href:Dl(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function hq(e,t,n){const r=e.all(t),i=n?pq(n):vD(t),o={},s=[];if(typeof t.checked=="boolean"){const p=r[0];let m;p&&p.type==="element"&&p.tagName==="p"?m=p:(m={type:"element",tagName:"p",properties:{},children:[]},r.unshift(m)),m.children.length>0&&m.children.unshift({type:"text",value:" "}),m.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),o.className=["task-list-item"]}let u=-1;for(;++u1}function mq(e,t){const n={},r=e.all(t);let i=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++i0){const s={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},u=qy(t.children[1]),f=X2(t.children[t.children.length-1]);u&&f&&(s.position={start:u,end:f}),i.push(s)}const o={type:"element",tagName:"table",properties:{},children:e.wrap(i,!0)};return e.patch(t,o),e.applyData(t,o)}function xq(e,t,n){const r=n?n.children:void 0,o=(r?r.indexOf(t):1)===0?"th":"td",s=n&&n.type==="table"?n.align:void 0,u=s?s.length:t.children.length;let f=-1;const d=[];for(;++f0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return o.push(l_(t.slice(i),i>0,!1)),o.join("")}function l_(e,t,n){let r=0,i=e.length;if(t){let o=e.codePointAt(r);for(;o===a_||o===o_;)r++,o=e.codePointAt(r)}if(n){let o=e.codePointAt(i-1);for(;o===a_||o===o_;)i--,o=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}function Eq(e,t){const n={type:"text",value:Sq(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function _q(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const kq={blockquote:eq,break:tq,code:nq,delete:rq,emphasis:iq,footnoteReference:aq,heading:oq,html:lq,imageReference:sq,image:uq,inlineCode:cq,linkReference:fq,link:dq,listItem:hq,list:mq,paragraph:gq,root:vq,strong:yq,table:bq,tableCell:wq,tableRow:xq,text:Eq,thematicBreak:_q,toml:Zc,yaml:Zc,definition:Zc,footnoteDefinition:Zc};function Zc(){}const yD=-1,Dd=0,$s=1,Bf=2,Jy=3,eb=4,tb=5,nb=6,bD=7,xD=8,s_=typeof self=="object"?self:globalThis,Cq=(e,t)=>{const n=(i,o)=>(e.set(o,i),i),r=i=>{if(e.has(i))return e.get(i);const[o,s]=t[i];switch(o){case Dd:case yD:return n(s,i);case $s:{const u=n([],i);for(const f of s)u.push(r(f));return u}case Bf:{const u=n({},i);for(const[f,d]of s)u[r(f)]=r(d);return u}case Jy:return n(new Date(s),i);case eb:{const{source:u,flags:f}=s;return n(new RegExp(u,f),i)}case tb:{const u=n(new Map,i);for(const[f,d]of s)u.set(r(f),r(d));return u}case nb:{const u=n(new Set,i);for(const f of s)u.add(r(f));return u}case bD:{const{name:u,message:f}=s;return n(new s_[u](f),i)}case xD:return n(BigInt(s),i);case"BigInt":return n(Object(BigInt(s)),i);case"ArrayBuffer":return n(new Uint8Array(s).buffer,s);case"DataView":{const{buffer:u}=new Uint8Array(s);return n(new DataView(u),s)}}return n(new s_[o](s),i)};return r},u_=e=>Cq(new Map,e)(0),Ko="",{toString:Tq}={},{keys:Aq}=Object,Ms=e=>{const t=typeof e;if(t!=="object"||!e)return[Dd,t];const n=Tq.call(e).slice(8,-1);switch(n){case"Array":return[$s,Ko];case"Object":return[Bf,Ko];case"Date":return[Jy,Ko];case"RegExp":return[eb,Ko];case"Map":return[tb,Ko];case"Set":return[nb,Ko];case"DataView":return[$s,n]}return n.includes("Array")?[$s,n]:n.includes("Error")?[bD,n]:[Bf,n]},Qc=([e,t])=>e===Dd&&(t==="function"||t==="symbol"),Rq=(e,t,n,r)=>{const i=(s,u)=>{const f=r.push(s)-1;return n.set(u,f),f},o=s=>{if(n.has(s))return n.get(s);let[u,f]=Ms(s);switch(u){case Dd:{let p=s;switch(f){case"bigint":u=xD,p=s.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+f);p=null;break;case"undefined":return i([yD],s)}return i([u,p],s)}case $s:{if(f){let v=s;return f==="DataView"?v=new Uint8Array(s.buffer):f==="ArrayBuffer"&&(v=new Uint8Array(s)),i([f,[...v]],s)}const p=[],m=i([u,p],s);for(const v of s)p.push(o(v));return m}case Bf:{if(f)switch(f){case"BigInt":return i([f,s.toString()],s);case"Boolean":case"Number":case"String":return i([f,s.valueOf()],s)}if(t&&"toJSON"in s)return o(s.toJSON());const p=[],m=i([u,p],s);for(const v of Aq(s))(e||!Qc(Ms(s[v])))&&p.push([o(v),o(s[v])]);return m}case Jy:return i([u,s.toISOString()],s);case eb:{const{source:p,flags:m}=s;return i([u,{source:p,flags:m}],s)}case tb:{const p=[],m=i([u,p],s);for(const[v,g]of s)(e||!(Qc(Ms(v))||Qc(Ms(g))))&&p.push([o(v),o(g)]);return m}case nb:{const p=[],m=i([u,p],s);for(const v of s)(e||!Qc(Ms(v)))&&p.push(o(v));return m}}const{message:d}=s;return i([u,{name:f,message:d}],s)};return o},c_=(e,{json:t,lossy:n}={})=>{const r=[];return Rq(!(t||n),!!t,new Map,r)(e),r},Uf=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?u_(c_(e,t)):structuredClone(e):(e,t)=>u_(c_(e,t));function Dq(e,t){const n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function Nq(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function Oq(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||Dq,r=e.options.footnoteBackLabel||Nq,i=e.options.footnoteLabel||"Footnotes",o=e.options.footnoteLabelTagName||"h2",s=e.options.footnoteLabelProperties||{className:["sr-only"]},u=[];let f=-1;for(;++f0&&w.push({type:"text",value:" "});let _=typeof n=="string"?n:n(f,g);typeof _=="string"&&(_={type:"text",value:_}),w.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+v+(g>1?"-"+g:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(f,g),className:["data-footnote-backref"]},children:Array.isArray(_)?_:[_]})}const k=p[p.length-1];if(k&&k.type==="element"&&k.tagName==="p"){const _=k.children[k.children.length-1];_&&_.type==="text"?_.value+=" ":k.children.push({type:"text",value:" "}),k.children.push(...w)}else p.push(...w);const C={type:"element",tagName:"li",properties:{id:t+"fn-"+v},children:e.wrap(p,!0)};e.patch(d,C),u.push(C)}if(u.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:o,properties:{...Uf(s),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:` -`},{type:"element",tagName:"ol",properties:{},children:e.wrap(u,!0)},{type:"text",value:` -`}]}}const Nd=function(e){if(e==null)return Mq;if(typeof e=="function")return Od(e);if(typeof e=="object")return Array.isArray(e)?Lq(e):zq(e);if(typeof e=="string")return jq(e);throw new Error("Expected function, string, or object as test")};function Lq(e){const t=[];let n=-1;for(;++n":""))+")"})}return v;function v(){let g=wD,w,x,k;if((!t||o(f,d,p[p.length-1]||void 0))&&(g=Gq(n(f,p)),g[0]===wv))return g;if("children"in f&&f.children){const C=f;if(C.children&&g[0]!==Iq)for(x=(r?C.children.length:-1)+s,k=p.concat(C);x>-1&&x0&&n.push({type:"text",value:` -`}),n}function f_(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function d_(e,t){const n=Uq(e,t),r=n.one(e,void 0),i=Oq(n),o=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return i&&o.children.push({type:"text",value:` -`},i),o}function Yq(e,t){return e&&"run"in e?async function(n,r){const i=d_(n,{file:r,...t});await e.run(i,r)}:function(n,r){return d_(n,{file:r,...e||t})}}function h_(e){if(e)throw e}var og,p_;function Wq(){if(p_)return og;p_=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=function(d){return typeof Array.isArray=="function"?Array.isArray(d):t.call(d)==="[object Array]"},o=function(d){if(!d||t.call(d)!=="[object Object]")return!1;var p=e.call(d,"constructor"),m=d.constructor&&d.constructor.prototype&&e.call(d.constructor.prototype,"isPrototypeOf");if(d.constructor&&!p&&!m)return!1;var v;for(v in d);return typeof v>"u"||e.call(d,v)},s=function(d,p){n&&p.name==="__proto__"?n(d,p.name,{enumerable:!0,configurable:!0,value:p.newValue,writable:!0}):d[p.name]=p.newValue},u=function(d,p){if(p==="__proto__")if(e.call(d,p)){if(r)return r(d,p).value}else return;return d[p]};return og=function f(){var d,p,m,v,g,w,x=arguments[0],k=1,C=arguments.length,_=!1;for(typeof x=="boolean"&&(_=x,x=arguments[1]||{},k=2),(x==null||typeof x!="object"&&typeof x!="function")&&(x={});ks.length;let f;u&&s.push(i);try{f=e.apply(this,s)}catch(d){const p=d;if(u&&n)throw p;return i(p)}u||(f&&f.then&&typeof f.then=="function"?f.then(o,i):f instanceof Error?i(f):o(f))}function i(s,...u){n||(n=!0,t(s,...u))}function o(s){i(null,s)}}const Gr={basename:Qq,dirname:Jq,extname:eY,join:tY,sep:"/"};function Qq(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');bu(e);let n=0,r=-1,i=e.length,o;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(o){n=i+1;break}}else r<0&&(o=!0,r=i+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let s=-1,u=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(o){n=i+1;break}}else s<0&&(o=!0,s=i+1),u>-1&&(e.codePointAt(i)===t.codePointAt(u--)?u<0&&(r=i):(u=-1,r=s));return n===r?r=s:r<0&&(r=e.length),e.slice(n,r)}function Jq(e){if(bu(e),e.length===0)return".";let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||(r=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function eY(e){bu(e);let t=e.length,n=-1,r=0,i=-1,o=0,s;for(;t--;){const u=e.codePointAt(t);if(u===47){if(s){r=t+1;break}continue}n<0&&(s=!0,n=t+1),u===46?i<0?i=t:o!==1&&(o=1):i>-1&&(o=-1)}return i<0||n<0||o===0||o===1&&i===n-1&&i===r+1?"":e.slice(i,n)}function tY(...e){let t=-1,n;for(;++t0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function rY(e,t){let n="",r=0,i=-1,o=0,s=-1,u,f;for(;++s<=e.length;){if(s2){if(f=n.lastIndexOf("/"),f!==n.length-1){f<0?(n="",r=0):(n=n.slice(0,f),r=n.length-1-n.lastIndexOf("/")),i=s,o=0;continue}}else if(n.length>0){n="",r=0,i=s,o=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(i+1,s):n=e.slice(i+1,s),r=s-i-1;i=s,o=0}else u===46&&o>-1?o++:o=-1}return n}function bu(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const iY={cwd:aY};function aY(){return"/"}function _v(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function oY(e){if(typeof e=="string")e=new URL(e);else if(!_v(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return lY(e)}function lY(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const t=e.pathname;let n=-1;for(;++n0){let[g,...w]=p;const x=r[v][1];Ev(x)&&Ev(g)&&(g=lg(!0,x,g)),r[v]=[d,g,...w]}}}}const fY=new ib().freeze();function fg(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function dg(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function hg(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function g_(e){if(!Ev(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function v_(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function Jc(e){return dY(e)?e:new ED(e)}function dY(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function hY(e){return typeof e=="string"||pY(e)}function pY(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const mY="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",y_=[],b_={allowDangerousHtml:!0},gY=/^(https?|ircs?|mailto|xmpp)$/i,vY=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function yY(e){const t=e.allowedElements,n=e.allowElement,r=e.children||"",i=e.className,o=e.components,s=e.disallowedElements,u=e.rehypePlugins||y_,f=e.remarkPlugins||y_,d=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...b_}:b_,p=e.skipHtml,m=e.unwrapDisallowed,v=e.urlTransform||bY,g=fY().use(JV).use(f).use(Yq,d).use(u),w=new ED;typeof r=="string"&&(w.value=r);for(const _ of vY)Object.hasOwn(e,_.from)&&(""+_.from+(_.to?"use `"+_.to+"` instead":"remove it")+mY+_.id,void 0);const x=g.parse(w);let k=g.runSync(x,w);return i&&(k={type:"element",tagName:"div",properties:{className:i},children:k.type==="root"?k.children:[k]}),rb(k,C),Q2(k,{Fragment:S.Fragment,components:o,ignoreInvalidStyle:!0,jsx:S.jsx,jsxs:S.jsxs,passKeys:!0,passNode:!0});function C(_,T,N){if(_.type==="raw"&&N&&typeof T=="number")return p?N.children.splice(T,1):N.children[T]={type:"text",value:_.value},T;if(_.type==="element"){let D;for(D in rg)if(Object.hasOwn(rg,D)&&Object.hasOwn(_.properties,D)){const z=_.properties[D],R=rg[D];(R===null||R.includes(_.tagName))&&(_.properties[D]=v(String(z||""),D,_))}}if(_.type==="element"){let D=t?!t.includes(_.tagName):s?s.includes(_.tagName):!1;if(!D&&n&&typeof T=="number"&&(D=!n(_,T,N)),D&&N&&typeof T=="number")return m&&_.children?N.children.splice(T,1,..._.children):N.children.splice(T,1),T}}}function bY(e){const t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),i=e.indexOf("/");return t===-1||i!==-1&&t>i||n!==-1&&t>n||r!==-1&&t>r||gY.test(e.slice(0,t))?e:""}function x_(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let r=0,i=n.indexOf(t);for(;i!==-1;)r++,i=n.indexOf(t,i+t.length);return r}function xY(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function wY(e,t,n){const i=Nd((n||{}).ignore||[]),o=SY(t);let s=-1;for(;++s0?{type:"text",value:z}:void 0),z===!1?v.lastIndex=N+1:(w!==N&&_.push({type:"text",value:d.value.slice(w,N)}),Array.isArray(z)?_.push(...z):z&&_.push(z),w=N+T[0].length,C=!0),!v.global)break;T=v.exec(d.value)}return C?(w?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(")");const i=x_(e,"(");let o=x_(e,")");for(;r!==-1&&i>o;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),o++;return[e,n]}function _D(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||to(n)||Ad(n))&&(!t||n!==47)}kD.peek=VY;function PY(){this.buffer()}function FY(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function IY(){this.buffer()}function GY(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function BY(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Tr(this.sliceSerialize(e)).toLowerCase(),n.label=t}function UY(e){this.exit(e)}function HY(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Tr(this.sliceSerialize(e)).toLowerCase(),n.label=t}function $Y(e){this.exit(e)}function VY(){return"["}function kD(e,t,n,r){const i=n.createTracker(r);let o=i.move("[^");const s=n.enter("footnoteReference"),u=n.enter("reference");return o+=i.move(n.safe(n.associationId(e),{after:"]",before:o})),u(),s(),o+=i.move("]"),o}function qY(){return{enter:{gfmFootnoteCallString:PY,gfmFootnoteCall:FY,gfmFootnoteDefinitionLabelString:IY,gfmFootnoteDefinition:GY},exit:{gfmFootnoteCallString:BY,gfmFootnoteCall:UY,gfmFootnoteDefinitionLabelString:HY,gfmFootnoteDefinition:$Y}}}function YY(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:kD},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(r,i,o,s){const u=o.createTracker(s);let f=u.move("[^");const d=o.enter("footnoteDefinition"),p=o.enter("label");return f+=u.move(o.safe(o.associationId(r),{before:f,after:"]"})),p(),f+=u.move("]:"),r.children&&r.children.length>0&&(u.shift(4),f+=u.move((t?` -`:" ")+o.indentLines(o.containerFlow(r,u.current()),t?CD:WY))),d(),f}}function WY(e,t,n){return t===0?e:CD(e,t,n)}function CD(e,t,n){return(n?"":" ")+e}const XY=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];TD.peek=eW;function KY(){return{canContainEols:["delete"],enter:{strikethrough:QY},exit:{strikethrough:JY}}}function ZY(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:XY}],handlers:{delete:TD}}}function QY(e){this.enter({type:"delete",children:[]},e)}function JY(e){this.exit(e)}function TD(e,t,n,r){const i=n.createTracker(r),o=n.enter("strikethrough");let s=i.move("~~");return s+=n.containerPhrasing(e,{...i.current(),before:s,after:"~"}),s+=i.move("~~"),o(),s}function eW(){return"~"}function tW(e){return e.length}function nW(e,t){const n=t||{},r=(n.align||[]).concat(),i=n.stringLength||tW,o=[],s=[],u=[],f=[];let d=0,p=-1;for(;++pd&&(d=e[p].length);++Cf[C])&&(f[C]=T)}x.push(_)}s[p]=x,u[p]=k}let m=-1;if(typeof r=="object"&&"length"in r)for(;++mf[m]&&(f[m]=_),g[m]=_),v[m]=T}s.splice(1,0,v),u.splice(1,0,g),p=-1;const w=[];for(;++p "),o.shift(2);const s=n.indentLines(n.containerFlow(e,o.current()),aW);return i(),s}function aW(e,t,n){return">"+(n?"":" ")+e}function oW(e,t){return S_(e,t.inConstruct,!0)&&!S_(e,t.notInConstruct,!1)}function S_(e,t,n){if(typeof t=="string"&&(t=[t]),!t||t.length===0)return n;let r=-1;for(;++rs&&(s=o):o=1,i=r+t.length,r=n.indexOf(t,i);return s}function lW(e,t){return!!(t.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function sW(e){const t=e.options.fence||"`";if(t!=="`"&&t!=="~")throw new Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function uW(e,t,n,r){const i=sW(n),o=e.value||"",s=i==="`"?"GraveAccent":"Tilde";if(lW(e,n)){const m=n.enter("codeIndented"),v=n.indentLines(o,cW);return m(),v}const u=n.createTracker(r),f=i.repeat(Math.max(AD(o,i)+1,3)),d=n.enter("codeFenced");let p=u.move(f);if(e.lang){const m=n.enter(`codeFencedLang${s}`);p+=u.move(n.safe(e.lang,{before:p,after:" ",encode:["`"],...u.current()})),m()}if(e.lang&&e.meta){const m=n.enter(`codeFencedMeta${s}`);p+=u.move(" "),p+=u.move(n.safe(e.meta,{before:p,after:` -`,encode:["`"],...u.current()})),m()}return p+=u.move(` -`),o&&(p+=u.move(o+` -`)),p+=u.move(f),d(),p}function cW(e,t,n){return(n?"":" ")+e}function ab(e){const t=e.options.quote||'"';if(t!=='"'&&t!=="'")throw new Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function fW(e,t,n,r){const i=ab(n),o=i==='"'?"Quote":"Apostrophe",s=n.enter("definition");let u=n.enter("label");const f=n.createTracker(r);let d=f.move("[");return d+=f.move(n.safe(n.associationId(e),{before:d,after:"]",...f.current()})),d+=f.move("]: "),u(),!e.url||/[\0- \u007F]/.test(e.url)?(u=n.enter("destinationLiteral"),d+=f.move("<"),d+=f.move(n.safe(e.url,{before:d,after:">",...f.current()})),d+=f.move(">")):(u=n.enter("destinationRaw"),d+=f.move(n.safe(e.url,{before:d,after:e.title?" ":` -`,...f.current()}))),u(),e.title&&(u=n.enter(`title${o}`),d+=f.move(" "+i),d+=f.move(n.safe(e.title,{before:d,after:i,...f.current()})),d+=f.move(i),u()),s(),d}function dW(e){const t=e.options.emphasis||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function nu(e){return""+e.toString(16).toUpperCase()+";"}function Hf(e,t,n){const r=pl(e),i=pl(t);return r===void 0?i===void 0?n==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}RD.peek=hW;function RD(e,t,n,r){const i=dW(n),o=n.enter("emphasis"),s=n.createTracker(r),u=s.move(i);let f=s.move(n.containerPhrasing(e,{after:i,before:u,...s.current()}));const d=f.charCodeAt(0),p=Hf(r.before.charCodeAt(r.before.length-1),d,i);p.inside&&(f=nu(d)+f.slice(1));const m=f.charCodeAt(f.length-1),v=Hf(r.after.charCodeAt(0),m,i);v.inside&&(f=f.slice(0,-1)+nu(m));const g=s.move(i);return o(),n.attentionEncodeSurroundingInfo={after:v.outside,before:p.outside},u+f+g}function hW(e,t,n){return n.options.emphasis||"*"}function pW(e,t){let n=!1;return rb(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return n=!0,wv}),!!((!e.depth||e.depth<3)&&Ky(e)&&(t.options.setext||n))}function mW(e,t,n,r){const i=Math.max(Math.min(6,e.depth||1),1),o=n.createTracker(r);if(pW(e,n)){const p=n.enter("headingSetext"),m=n.enter("phrasing"),v=n.containerPhrasing(e,{...o.current(),before:` -`,after:` -`});return m(),p(),v+` -`+(i===1?"=":"-").repeat(v.length-(Math.max(v.lastIndexOf("\r"),v.lastIndexOf(` -`))+1))}const s="#".repeat(i),u=n.enter("headingAtx"),f=n.enter("phrasing");o.move(s+" ");let d=n.containerPhrasing(e,{before:"# ",after:` -`,...o.current()});return/^[\t ]/.test(d)&&(d=nu(d.charCodeAt(0))+d.slice(1)),d=d?s+" "+d:s,n.options.closeAtx&&(d+=" "+s),f(),u(),d}DD.peek=gW;function DD(e){return e.value||""}function gW(){return"<"}ND.peek=vW;function ND(e,t,n,r){const i=ab(n),o=i==='"'?"Quote":"Apostrophe",s=n.enter("image");let u=n.enter("label");const f=n.createTracker(r);let d=f.move("![");return d+=f.move(n.safe(e.alt,{before:d,after:"]",...f.current()})),d+=f.move("]("),u(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(u=n.enter("destinationLiteral"),d+=f.move("<"),d+=f.move(n.safe(e.url,{before:d,after:">",...f.current()})),d+=f.move(">")):(u=n.enter("destinationRaw"),d+=f.move(n.safe(e.url,{before:d,after:e.title?" ":")",...f.current()}))),u(),e.title&&(u=n.enter(`title${o}`),d+=f.move(" "+i),d+=f.move(n.safe(e.title,{before:d,after:i,...f.current()})),d+=f.move(i),u()),d+=f.move(")"),s(),d}function vW(){return"!"}OD.peek=yW;function OD(e,t,n,r){const i=e.referenceType,o=n.enter("imageReference");let s=n.enter("label");const u=n.createTracker(r);let f=u.move("![");const d=n.safe(e.alt,{before:f,after:"]",...u.current()});f+=u.move(d+"]["),s();const p=n.stack;n.stack=[],s=n.enter("reference");const m=n.safe(n.associationId(e),{before:f,after:"]",...u.current()});return s(),n.stack=p,o(),i==="full"||!d||d!==m?f+=u.move(m+"]"):i==="shortcut"?f=f.slice(0,-1):f+=u.move("]"),f}function yW(){return"!"}LD.peek=bW;function LD(e,t,n){let r=e.value||"",i="`",o=-1;for(;new RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++o\u007F]/.test(e.url))}jD.peek=xW;function jD(e,t,n,r){const i=ab(n),o=i==='"'?"Quote":"Apostrophe",s=n.createTracker(r);let u,f;if(zD(e,n)){const p=n.stack;n.stack=[],u=n.enter("autolink");let m=s.move("<");return m+=s.move(n.containerPhrasing(e,{before:m,after:">",...s.current()})),m+=s.move(">"),u(),n.stack=p,m}u=n.enter("link"),f=n.enter("label");let d=s.move("[");return d+=s.move(n.containerPhrasing(e,{before:d,after:"](",...s.current()})),d+=s.move("]("),f(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(f=n.enter("destinationLiteral"),d+=s.move("<"),d+=s.move(n.safe(e.url,{before:d,after:">",...s.current()})),d+=s.move(">")):(f=n.enter("destinationRaw"),d+=s.move(n.safe(e.url,{before:d,after:e.title?" ":")",...s.current()}))),f(),e.title&&(f=n.enter(`title${o}`),d+=s.move(" "+i),d+=s.move(n.safe(e.title,{before:d,after:i,...s.current()})),d+=s.move(i),f()),d+=s.move(")"),u(),d}function xW(e,t,n){return zD(e,n)?"<":"["}MD.peek=wW;function MD(e,t,n,r){const i=e.referenceType,o=n.enter("linkReference");let s=n.enter("label");const u=n.createTracker(r);let f=u.move("[");const d=n.containerPhrasing(e,{before:f,after:"]",...u.current()});f+=u.move(d+"]["),s();const p=n.stack;n.stack=[],s=n.enter("reference");const m=n.safe(n.associationId(e),{before:f,after:"]",...u.current()});return s(),n.stack=p,o(),i==="full"||!d||d!==m?f+=u.move(m+"]"):i==="shortcut"?f=f.slice(0,-1):f+=u.move("]"),f}function wW(){return"["}function ob(e){const t=e.options.bullet||"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function SW(e){const t=ob(e),n=e.options.bulletOther;if(!n)return t==="*"?"-":"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw new Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function EW(e){const t=e.options.bulletOrdered||".";if(t!=="."&&t!==")")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function PD(e){const t=e.options.rule||"*";if(t!=="*"&&t!=="-"&&t!=="_")throw new Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function _W(e,t,n,r){const i=n.enter("list"),o=n.bulletCurrent;let s=e.ordered?EW(n):ob(n);const u=e.ordered?s==="."?")":".":SW(n);let f=t&&n.bulletLastUsed?s===n.bulletLastUsed:!1;if(!e.ordered){const p=e.children?e.children[0]:void 0;if((s==="*"||s==="-")&&p&&(!p.children||!p.children[0])&&n.stack[n.stack.length-1]==="list"&&n.stack[n.stack.length-2]==="listItem"&&n.stack[n.stack.length-3]==="list"&&n.stack[n.stack.length-4]==="listItem"&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(f=!0),PD(n)===s&&p){let m=-1;for(;++m-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+o);let s=o.length+1;(i==="tab"||i==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(s=Math.ceil(s/4)*4);const u=n.createTracker(r);u.move(o+" ".repeat(s-o.length)),u.shift(s);const f=n.enter("listItem"),d=n.indentLines(n.containerFlow(e,u.current()),p);return f(),d;function p(m,v,g){return v?(g?"":" ".repeat(s))+m:(g?o:o+" ".repeat(s-o.length))+m}}function TW(e,t,n,r){const i=n.enter("paragraph"),o=n.enter("phrasing"),s=n.containerPhrasing(e,r);return o(),i(),s}const AW=Nd(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function RW(e,t,n,r){return(e.children.some(function(s){return AW(s)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function DW(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}FD.peek=NW;function FD(e,t,n,r){const i=DW(n),o=n.enter("strong"),s=n.createTracker(r),u=s.move(i+i);let f=s.move(n.containerPhrasing(e,{after:i,before:u,...s.current()}));const d=f.charCodeAt(0),p=Hf(r.before.charCodeAt(r.before.length-1),d,i);p.inside&&(f=nu(d)+f.slice(1));const m=f.charCodeAt(f.length-1),v=Hf(r.after.charCodeAt(0),m,i);v.inside&&(f=f.slice(0,-1)+nu(m));const g=s.move(i+i);return o(),n.attentionEncodeSurroundingInfo={after:v.outside,before:p.outside},u+f+g}function NW(e,t,n){return n.options.strong||"*"}function OW(e,t,n,r){return n.safe(e.value,r)}function LW(e){const t=e.options.ruleRepetition||3;if(t<3)throw new Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function zW(e,t,n){const r=(PD(n)+(n.options.ruleSpaces?" ":"")).repeat(LW(n));return n.options.ruleSpaces?r.slice(0,-1):r}const ID={blockquote:iW,break:E_,code:uW,definition:fW,emphasis:RD,hardBreak:E_,heading:mW,html:DD,image:ND,imageReference:OD,inlineCode:LD,link:jD,linkReference:MD,list:_W,listItem:CW,paragraph:TW,root:RW,strong:FD,text:OW,thematicBreak:zW};function jW(){return{enter:{table:MW,tableData:__,tableHeader:__,tableRow:FW},exit:{codeText:IW,table:PW,tableData:vg,tableHeader:vg,tableRow:vg}}}function MW(e){const t=e._align;this.enter({type:"table",align:t.map(function(n){return n==="none"?null:n}),children:[]},e),this.data.inTable=!0}function PW(e){this.exit(e),this.data.inTable=void 0}function FW(e){this.enter({type:"tableRow",children:[]},e)}function vg(e){this.exit(e)}function __(e){this.enter({type:"tableCell",children:[]},e)}function IW(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,GW));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function GW(e,t){return t==="|"?t:e}function BW(e){const t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,o=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:` -`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:v,table:s,tableCell:f,tableRow:u}};function s(g,w,x,k){return d(p(g,x,k),g.align)}function u(g,w,x,k){const C=m(g,x,k),_=d([C]);return _.slice(0,_.indexOf(` -`))}function f(g,w,x,k){const C=x.enter("tableCell"),_=x.enter("phrasing"),T=x.containerPhrasing(g,{...k,before:o,after:o});return _(),C(),T}function d(g,w){return nW(g,{align:w,alignDelimiters:r,padding:n,stringLength:i})}function p(g,w,x){const k=g.children;let C=-1;const _=[],T=w.enter("table");for(;++C0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const aX={tokenize:hX,partial:!0};function oX(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:cX,continuation:{tokenize:fX},exit:dX}},text:{91:{name:"gfmFootnoteCall",tokenize:uX},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:lX,resolveTo:sX}}}}function lX(e,t,n){const r=this;let i=r.events.length;const o=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let s;for(;i--;){const f=r.events[i][1];if(f.type==="labelImage"){s=f;break}if(f.type==="gfmFootnoteCall"||f.type==="labelLink"||f.type==="label"||f.type==="image"||f.type==="link")break}return u;function u(f){if(!s||!s._balanced)return n(f);const d=Tr(r.sliceSerialize({start:s.end,end:r.now()}));return d.codePointAt(0)!==94||!o.includes(d.slice(1))?n(f):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(f),e.exit("gfmFootnoteCallLabelMarker"),t(f))}}function sX(e,t){let n=e.length;for(;n--;)if(e[n][1].type==="labelImage"&&e[n][0]==="enter"){e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;const o={type:"gfmFootnoteCallString",start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},s={type:"chunkString",contentType:"string",start:Object.assign({},o.start),end:Object.assign({},o.end)},u=[e[n+1],e[n+2],["enter",r,t],e[n+3],e[n+4],["enter",i,t],["exit",i,t],["enter",o,t],["enter",s,t],["exit",s,t],["exit",o,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(n,e.length-n+1,...u),e}function uX(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let o=0,s;return u;function u(m){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(m),e.exit("gfmFootnoteCallLabelMarker"),f}function f(m){return m!==94?n(m):(e.enter("gfmFootnoteCallMarker"),e.consume(m),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",d)}function d(m){if(o>999||m===93&&!s||m===null||m===91||Tt(m))return n(m);if(m===93){e.exit("chunkString");const v=e.exit("gfmFootnoteCallString");return i.includes(Tr(r.sliceSerialize(v)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(m),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(m)}return Tt(m)||(s=!0),o++,e.consume(m),m===92?p:d}function p(m){return m===91||m===92||m===93?(e.consume(m),o++,d):d(m)}}function cX(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let o,s=0,u;return f;function f(w){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(w),e.exit("gfmFootnoteDefinitionLabelMarker"),d}function d(w){return w===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(w),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",p):n(w)}function p(w){if(s>999||w===93&&!u||w===null||w===91||Tt(w))return n(w);if(w===93){e.exit("chunkString");const x=e.exit("gfmFootnoteDefinitionLabelString");return o=Tr(r.sliceSerialize(x)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(w),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),v}return Tt(w)||(u=!0),s++,e.consume(w),w===92?m:p}function m(w){return w===91||w===92||w===93?(e.consume(w),s++,p):p(w)}function v(w){return w===58?(e.enter("definitionMarker"),e.consume(w),e.exit("definitionMarker"),i.includes(o)||i.push(o),lt(e,g,"gfmFootnoteDefinitionWhitespace")):n(w)}function g(w){return t(w)}}function fX(e,t,n){return e.check(yu,t,e.attempt(aX,t,n))}function dX(e){e.exit("gfmFootnoteDefinition")}function hX(e,t,n){const r=this;return lt(e,i,"gfmFootnoteDefinitionIndent",5);function i(o){const s=r.events[r.events.length-1];return s&&s[1].type==="gfmFootnoteDefinitionIndent"&&s[2].sliceSerialize(s[1],!0).length===4?t(o):n(o)}}function pX(e){let n=(e||{}).singleTilde;const r={name:"strikethrough",tokenize:o,resolveAll:i};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function i(s,u){let f=-1;for(;++f1?f(w):(s.consume(w),m++,g);if(m<2&&!n)return f(w);const k=s.exit("strikethroughSequenceTemporary"),C=pl(w);return k._open=!C||C===2&&!!x,k._close=!x||x===2&&!!C,u(w)}}}class mX{constructor(){this.map=[]}add(t,n,r){gX(this,t,n,r)}consume(t){if(this.map.sort(function(o,s){return o[0]-s[0]}),this.map.length===0)return;let n=this.map.length;const r=[];for(;n>0;)n-=1,r.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];r.push(t.slice()),t.length=0;let i=r.pop();for(;i;){for(const o of i)t.push(o);i=r.pop()}this.map.length=0}}function gX(e,t,n,r){let i=0;if(!(n===0&&r.length===0)){for(;i-1;){const Y=r.events[V][1].type;if(Y==="lineEnding"||Y==="linePrefix")V--;else break}const q=V>-1?r.events[V][1].type:null,I=q==="tableHead"||q==="tableRow"?z:f;return I===z&&r.parser.lazy[r.now().line]?n(j):I(j)}function f(j){return e.enter("tableHead"),e.enter("tableRow"),d(j)}function d(j){return j===124||(s=!0,o+=1),p(j)}function p(j){return j===null?n(j):Ue(j)?o>1?(o=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(j),e.exit("lineEnding"),g):n(j):ut(j)?lt(e,p,"whitespace")(j):(o+=1,s&&(s=!1,i+=1),j===124?(e.enter("tableCellDivider"),e.consume(j),e.exit("tableCellDivider"),s=!0,p):(e.enter("data"),m(j)))}function m(j){return j===null||j===124||Tt(j)?(e.exit("data"),p(j)):(e.consume(j),j===92?v:m)}function v(j){return j===92||j===124?(e.consume(j),m):m(j)}function g(j){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(j):(e.enter("tableDelimiterRow"),s=!1,ut(j)?lt(e,w,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(j):w(j))}function w(j){return j===45||j===58?k(j):j===124?(s=!0,e.enter("tableCellDivider"),e.consume(j),e.exit("tableCellDivider"),x):D(j)}function x(j){return ut(j)?lt(e,k,"whitespace")(j):k(j)}function k(j){return j===58?(o+=1,s=!0,e.enter("tableDelimiterMarker"),e.consume(j),e.exit("tableDelimiterMarker"),C):j===45?(o+=1,C(j)):j===null||Ue(j)?N(j):D(j)}function C(j){return j===45?(e.enter("tableDelimiterFiller"),_(j)):D(j)}function _(j){return j===45?(e.consume(j),_):j===58?(s=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(j),e.exit("tableDelimiterMarker"),T):(e.exit("tableDelimiterFiller"),T(j))}function T(j){return ut(j)?lt(e,N,"whitespace")(j):N(j)}function N(j){return j===124?w(j):j===null||Ue(j)?!s||i!==o?D(j):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(j)):D(j)}function D(j){return n(j)}function z(j){return e.enter("tableRow"),R(j)}function R(j){return j===124?(e.enter("tableCellDivider"),e.consume(j),e.exit("tableCellDivider"),R):j===null||Ue(j)?(e.exit("tableRow"),t(j)):ut(j)?lt(e,R,"whitespace")(j):(e.enter("data"),B(j))}function B(j){return j===null||j===124||Tt(j)?(e.exit("data"),R(j)):(e.consume(j),j===92?P:B)}function P(j){return j===92||j===124?(e.consume(j),B):B(j)}}function xX(e,t){let n=-1,r=!0,i=0,o=[0,0,0,0],s=[0,0,0,0],u=!1,f=0,d,p,m;const v=new mX;for(;++nn[2]+1){const w=n[2]+1,x=n[3]-n[2]-1;e.add(w,x,[])}}e.add(n[3]+1,0,[["exit",m,t]])}return i!==void 0&&(o.end=Object.assign({},el(t.events,i)),e.add(i,0,[["exit",o,t]]),o=void 0),o}function C_(e,t,n,r,i){const o=[],s=el(t.events,n);i&&(i.end=Object.assign({},s),o.push(["exit",i,t])),r.end=Object.assign({},s),o.push(["exit",r,t]),e.add(n+1,0,o)}function el(e,t){const n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}const wX={name:"tasklistCheck",tokenize:EX};function SX(){return{text:{91:wX}}}function EX(e,t,n){const r=this;return i;function i(f){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(f):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(f),e.exit("taskListCheckMarker"),o)}function o(f){return Tt(f)?(e.enter("taskListCheckValueUnchecked"),e.consume(f),e.exit("taskListCheckValueUnchecked"),s):f===88||f===120?(e.enter("taskListCheckValueChecked"),e.consume(f),e.exit("taskListCheckValueChecked"),s):n(f)}function s(f){return f===93?(e.enter("taskListCheckMarker"),e.consume(f),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),u):n(f)}function u(f){return Ue(f)?t(f):ut(f)?e.check({tokenize:_X},t,n)(f):n(f)}}function _X(e,t,n){return lt(e,r,"whitespace");function r(i){return i===null?n(i):t(i)}}function kX(e){return rD([KW(),oX(),pX(e),yX(),SX()])}const CX={};function TX(e){const t=this,n=e||CX,r=t.data(),i=r.micromarkExtensions||(r.micromarkExtensions=[]),o=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),s=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);i.push(kX(n)),o.push(qW()),s.push(YW(n))}function AX(e){const t=this;t.compiler=n;function n(r,i){return Q2(r,{filePath:i.path,...e})}}function RX(){return{enter:{mathFlow:e,mathFlowFenceMeta:t,mathText:o},exit:{mathFlow:i,mathFlowFence:r,mathFlowFenceMeta:n,mathFlowValue:u,mathText:s,mathTextData:u}};function e(f){const d={type:"element",tagName:"code",properties:{className:["language-math","math-display"]},children:[]};this.enter({type:"math",meta:null,value:"",data:{hName:"pre",hChildren:[d]}},f)}function t(){this.buffer()}function n(){const f=this.resume(),d=this.stack[this.stack.length-1];d.type,d.meta=f}function r(){this.data.mathFlowInside||(this.buffer(),this.data.mathFlowInside=!0)}function i(f){const d=this.resume().replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),p=this.stack[this.stack.length-1];p.type,this.exit(f),p.value=d;const m=p.data.hChildren[0];m.type,m.tagName,m.children.push({type:"text",value:d}),this.data.mathFlowInside=void 0}function o(f){this.enter({type:"inlineMath",value:"",data:{hName:"code",hProperties:{className:["language-math","math-inline"]},hChildren:[]}},f),this.buffer()}function s(f){const d=this.resume(),p=this.stack[this.stack.length-1];p.type,this.exit(f),p.value=d,p.data.hChildren.push({type:"text",value:d})}function u(f){this.config.enter.data.call(this,f),this.config.exit.data.call(this,f)}}function DX(e){let t=(e||{}).singleDollarTextMath;return t==null&&(t=!0),r.peek=i,{unsafe:[{character:"\r",inConstruct:"mathFlowMeta"},{character:` -`,inConstruct:"mathFlowMeta"},{character:"$",after:t?void 0:"\\$",inConstruct:"phrasing"},{character:"$",inConstruct:"mathFlowMeta"},{atBreak:!0,character:"$",after:"\\$"}],handlers:{math:n,inlineMath:r}};function n(o,s,u,f){const d=o.value||"",p=u.createTracker(f),m="$".repeat(Math.max(AD(d,"$")+1,2)),v=u.enter("mathFlow");let g=p.move(m);if(o.meta){const w=u.enter("mathFlowMeta");g+=p.move(u.safe(o.meta,{after:` -`,before:g,encode:["$"],...p.current()})),w()}return g+=p.move(` -`),d&&(g+=p.move(d+` -`)),g+=p.move(m),v(),g}function r(o,s,u){let f=o.value||"",d=1;for(t||d++;new RegExp("(^|[^$])"+"\\$".repeat(d)+"([^$]|$)").test(f);)d++;const p="$".repeat(d);/[^ \r\n]/.test(f)&&(/^[ \r\n]/.test(f)&&/[ \r\n]$/.test(f)||/^\$|\$$/.test(f))&&(f=" "+f+" ");let m=-1;for(;++mS.jsx(yY,{className:"prose lg:prose-xs dark:prose-invert max-w-none text-base",remarkPlugins:[TX,IX],rehypePlugins:[AX],skipHtml:!1,children:e.content});function BX(){const[e,t]=E.useState(()=>Qe.getState().retrievalHistory||[]),[n,r]=E.useState(""),[i,o]=E.useState(!1),s=E.useRef(null),u=E.useCallback(()=>{var m;(m=s.current)==null||m.scrollIntoView({behavior:"smooth"})},[]),f=E.useCallback(async m=>{if(m.preventDefault(),!n.trim()||i)return;const v={content:n,role:"user"},g={content:"",role:"assistant"},w=[...e];t([...w,v,g]),r(""),o(!0);const x=(_,T)=>{g.content+=_,t(N=>{const D=[...N],z=D[D.length-1];return z.role==="assistant"&&(z.content=g.content,z.isError=T),D})},k=Qe.getState(),C={...k.querySettings,query:v.content,conversation_history:w.filter(_=>_.isError!==!0).map(_=>({role:_.role,content:_.content}))};try{if(k.querySettings.stream){let _="";await sM(C,x,T=>{_+=T}),_&&(g.content&&(_=g.content+` -`+_),x(_,!0))}else{const _=await lM(C);x(_.response)}}catch(_){x(`Error: Failed to get response -${Cr(_)}`,!0)}finally{o(!1),Qe.getState().setRetrievalHistory([...w,v,g])}},[n,i,e,t]),d=jy(e,100);E.useEffect(()=>u(),[d,u]);const p=E.useCallback(()=>{t([]),Qe.getState().setRetrievalHistory([])},[t]);return S.jsxs("div",{className:"flex size-full gap-2 px-2 pb-12",children:[S.jsxs("div",{className:"flex grow flex-col gap-4",children:[S.jsx("div",{className:"relative grow",children:S.jsx("div",{className:"bg-primary-foreground/60 absolute inset-0 flex flex-col overflow-auto rounded-lg border p-2",children:S.jsxs("div",{className:"flex min-h-0 flex-1 flex-col gap-2",children:[e.length===0?S.jsx("div",{className:"text-muted-foreground flex h-full items-center justify-center text-lg",children:"Start a retrieval by typing your query below"}):e.map((m,v)=>S.jsx("div",{className:`flex ${m.role==="user"?"justify-end":"justify-start"}`,children:S.jsxs("div",{className:`max-w-[80%] rounded-lg px-4 py-2 ${m.role==="user"?"bg-primary text-primary-foreground":m.isError?"bg-red-100 text-red-600 dark:bg-red-950 dark:text-red-400":"bg-muted"}`,children:[S.jsx("pre",{className:"break-words whitespace-pre-wrap",children:S.jsx(GX,{message:m})}),m.content.length===0&&S.jsx(jM,{className:"animate-spin duration-2000"})]})},v)),S.jsx("div",{ref:s,className:"pb-1"})]})})}),S.jsxs("form",{onSubmit:f,className:"flex shrink-0 items-center gap-2",children:[S.jsxs(Ot,{type:"button",variant:"outline",onClick:p,disabled:i,size:"sm",children:[S.jsx(wk,{}),"Clear"]}),S.jsx(Za,{className:"flex-1",value:n,onChange:m=>r(m.target.value),placeholder:"Type your query...",disabled:i}),S.jsxs(Ot,{type:"submit",variant:"default",disabled:i,size:"sm",children:[S.jsx(ZM,{}),"Send"]})]})]}),S.jsx(s8,{})]})}function UX(){return S.jsx("iframe",{src:G_+"/docs",className:"size-full"})}function HX(){const e=Mn.use.message(),t=Qe.use.enableHealthCheck(),[n]=E.useState(()=>Qe.getState().currentTab),[r,i]=E.useState(!1);E.useEffect(()=>{if(!t)return;Mn.getState().check();const s=setInterval(async()=>{await Mn.getState().check()},xz*1e3);return()=>clearInterval(s)},[t]);const o=E.useCallback(s=>Qe.getState().setCurrentTab(s),[]);return E.useEffect(()=>{if(e&&(e.includes(vk)||e.includes(yk))){i(!0);return}i(!1)},[e,i]),S.jsx(_z,{children:S.jsxs("main",{className:"flex h-screen w-screen overflow-x-hidden",children:[S.jsxs(C3,{defaultValue:n,className:"!m-0 flex grow flex-col !p-0",onValueChange:o,children:[S.jsx(A3,{}),S.jsxs("div",{className:"relative grow",children:[S.jsx(Ps,{value:"documents",className:"absolute top-0 right-0 bottom-0 left-0",children:S.jsx(u9,{})}),S.jsx(Ps,{value:"knowledge-graph",className:"absolute top-0 right-0 bottom-0 left-0",children:S.jsx(LH,{})}),S.jsx(Ps,{value:"retrieval",className:"absolute top-0 right-0 bottom-0 left-0",children:S.jsx(BX,{})}),S.jsx(Ps,{value:"api",className:"absolute top-0 right-0 bottom-0 left-0",children:S.jsx(UX,{})})]})]}),t&&S.jsx(s3,{}),e!==null&&!r&&S.jsx(cP,{}),r&&S.jsx(WI,{}),S.jsx(YI,{})]})})}vL.createRoot(document.getElementById("root")).render(S.jsx(E.StrictMode,{children:S.jsx(HX,{})})); diff --git a/lightrag/api/webui/assets/index-CLsJV-0i.css b/lightrag/api/webui/assets/index-CLsJV-0i.css deleted file mode 100644 index 0e1032b4..00000000 --- a/lightrag/api/webui/assets/index-CLsJV-0i.css +++ /dev/null @@ -1 +0,0 @@ -/*! tailwindcss v4.0.7 | 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!important}.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}.list-item{display:list-item}.table{display:table}.table-cell{display:table-cell}.table-row{display:table-row}.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-40{height:calc(var(--spacing)*40)}.h-52{height:calc(var(--spacing)*52)}.h-84{height:calc(var(--spacing)*84)}.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-100{background-color:var(--color-red-100)}.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)}.lowercase{text-transform:lowercase}.uppercase{text-transform:uppercase}.italic{font-style:italic}.ordinal{--tw-ordinal:ordinal;font-variant-numeric:var(--tw-ordinal,)var(--tw-slashed-zero,)var(--tw-numeric-figure,)var(--tw-numeric-spacing,)var(--tw-numeric-fraction,)}.overline{text-decoration-line:overline}.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}.ring{--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)}.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)}.dark\:bg-red-950:is(.dark *){background-color:var(--color-red-950)}.dark\:text-red-400:is(.dark *){color:var(--color-red-400)}.\[\&_\[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-ordinal{syntax:"*";inherits:false}@property --tw-slashed-zero{syntax:"*";inherits:false}@property --tw-numeric-figure{syntax:"*";inherits:false}@property --tw-numeric-spacing{syntax:"*";inherits:false}@property --tw-numeric-fraction{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-drop-shadow{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-DbuMPJAD.js b/lightrag/api/webui/assets/index-DbuMPJAD.js new file mode 100644 index 00000000..5cc7b4c2 --- /dev/null +++ b/lightrag/api/webui/assets/index-DbuMPJAD.js @@ -0,0 +1,1120 @@ +var cH=Object.defineProperty;var dH=(e,t,n)=>t in e?cH(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Ea=(e,t,n)=>dH(e,typeof t!="symbol"?t+"":t,n);function fH(e,t){for(var n=0;nr[a]})}}}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 a of document.querySelectorAll('link[rel="modulepreload"]'))r(a);new MutationObserver(a=>{for(const i of a)if(i.type==="childList")for(const l of i.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&r(l)}).observe(document,{childList:!0,subtree:!0});function n(a){const i={};return a.integrity&&(i.integrity=a.integrity),a.referrerPolicy&&(i.referrerPolicy=a.referrerPolicy),a.crossOrigin==="use-credentials"?i.credentials="include":a.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(a){if(a.ep)return;a.ep=!0;const i=n(a);fetch(a.href,i)}})();var Cd=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function an(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function pH(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var n=function r(){return this instanceof r?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(r){var a=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,a.get?a:{enumerable:!0,get:function(){return e[r]}})}),n}var eh={exports:{}},Ds={};/** + * @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 $1;function gH(){if($1)return Ds;$1=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(r,a,i){var l=null;if(i!==void 0&&(l=""+i),a.key!==void 0&&(l=""+a.key),"key"in a){i={};for(var u in a)u!=="key"&&(i[u]=a[u])}else i=a;return a=i.ref,{$$typeof:e,type:r,key:l,ref:a!==void 0?a:null,props:i}}return Ds.Fragment=t,Ds.jsx=n,Ds.jsxs=n,Ds}var q1;function hH(){return q1||(q1=1,eh.exports=gH()),eh.exports}var w=hH(),th={exports:{}},at={};/** + * @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 V1;function mH(){if(V1)return at;V1=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),i=Symbol.for("react.consumer"),l=Symbol.for("react.context"),u=Symbol.for("react.forward_ref"),c=Symbol.for("react.suspense"),f=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),g=Symbol.iterator;function b(D){return D===null||typeof D!="object"?null:(D=g&&D[g]||D["@@iterator"],typeof D=="function"?D:null)}var m={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},S=Object.assign,v={};function A(D,V,B){this.props=D,this.context=V,this.refs=v,this.updater=B||m}A.prototype.isReactComponent={},A.prototype.setState=function(D,V){if(typeof D!="object"&&typeof D!="function"&&D!=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,D,V,"setState")},A.prototype.forceUpdate=function(D){this.updater.enqueueForceUpdate(this,D,"forceUpdate")};function R(){}R.prototype=A.prototype;function x(D,V,B){this.props=D,this.context=V,this.refs=v,this.updater=B||m}var _=x.prototype=new R;_.constructor=x,S(_,A.prototype),_.isPureReactComponent=!0;var C=Array.isArray,N={H:null,A:null,T:null,S:null},T=Object.prototype.hasOwnProperty;function O(D,V,B,L,Y,Q){return B=Q.ref,{$$typeof:e,type:D,key:V,ref:B!==void 0?B:null,props:Q}}function z(D,V){return O(D.type,V,void 0,void 0,void 0,D.props)}function I(D){return typeof D=="object"&&D!==null&&D.$$typeof===e}function M(D){var V={"=":"=0",":":"=2"};return"$"+D.replace(/[=:]/g,function(B){return V[B]})}var H=/\/+/g;function q(D,V){return typeof D=="object"&&D!==null&&D.key!=null?M(""+D.key):V.toString(36)}function U(){}function W(D){switch(D.status){case"fulfilled":return D.value;case"rejected":throw D.reason;default:switch(typeof D.status=="string"?D.then(U,U):(D.status="pending",D.then(function(V){D.status==="pending"&&(D.status="fulfilled",D.value=V)},function(V){D.status==="pending"&&(D.status="rejected",D.reason=V)})),D.status){case"fulfilled":return D.value;case"rejected":throw D.reason}}throw D}function Z(D,V,B,L,Y){var Q=typeof D;(Q==="undefined"||Q==="boolean")&&(D=null);var se=!1;if(D===null)se=!0;else switch(Q){case"bigint":case"string":case"number":se=!0;break;case"object":switch(D.$$typeof){case e:case t:se=!0;break;case p:return se=D._init,Z(se(D._payload),V,B,L,Y)}}if(se)return Y=Y(D),se=L===""?"."+q(D,0):L,C(Y)?(B="",se!=null&&(B=se.replace(H,"$&/")+"/"),Z(Y,V,B,"",function(Ae){return Ae})):Y!=null&&(I(Y)&&(Y=z(Y,B+(Y.key==null||D&&D.key===Y.key?"":(""+Y.key).replace(H,"$&/")+"/")+se)),V.push(Y)),1;se=0;var re=L===""?".":L+":";if(C(D))for(var le=0;le>>1,D=j[X];if(0>>1;Xa(L,P))Ya(Q,L)?(j[X]=Q,j[Y]=P,X=Y):(j[X]=L,j[B]=P,X=B);else if(Ya(Q,P))j[X]=Q,j[Y]=P,X=Y;else break e}}return G}function a(j,G){var P=j.sortIndex-G.sortIndex;return P!==0?P:j.id-G.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var l=Date,u=l.now();e.unstable_now=function(){return l.now()-u}}var c=[],f=[],p=1,g=null,b=3,m=!1,S=!1,v=!1,A=typeof setTimeout=="function"?setTimeout:null,R=typeof clearTimeout=="function"?clearTimeout:null,x=typeof setImmediate<"u"?setImmediate:null;function _(j){for(var G=n(f);G!==null;){if(G.callback===null)r(f);else if(G.startTime<=j)r(f),G.sortIndex=G.expirationTime,t(c,G);else break;G=n(f)}}function C(j){if(v=!1,_(j),!S)if(n(c)!==null)S=!0,W();else{var G=n(f);G!==null&&Z(C,G.startTime-j)}}var N=!1,T=-1,O=5,z=-1;function I(){return!(e.unstable_now()-zj&&I());){var X=g.callback;if(typeof X=="function"){g.callback=null,b=g.priorityLevel;var D=X(g.expirationTime<=j);if(j=e.unstable_now(),typeof D=="function"){g.callback=D,_(j),G=!0;break t}g===n(c)&&r(c),_(j)}else r(c);g=n(c)}if(g!==null)G=!0;else{var V=n(f);V!==null&&Z(C,V.startTime-j),G=!1}}break e}finally{g=null,b=P,m=!1}G=void 0}}finally{G?H():N=!1}}}var H;if(typeof x=="function")H=function(){x(M)};else if(typeof MessageChannel<"u"){var q=new MessageChannel,U=q.port2;q.port1.onmessage=M,H=function(){U.postMessage(null)}}else H=function(){A(M,0)};function W(){N||(N=!0,H())}function Z(j,G){T=A(function(){j(e.unstable_now())},G)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(j){j.callback=null},e.unstable_continueExecution=function(){S||m||(S=!0,W())},e.unstable_forceFrameRate=function(j){0>j||125X?(j.sortIndex=P,t(f,j),n(c)===null&&j===n(f)&&(v?(R(T),T=-1):v=!0,Z(C,P-X))):(j.sortIndex=D,t(c,j),S||m||(S=!0,W())),j},e.unstable_shouldYield=I,e.unstable_wrapCallback=function(j){var G=b;return function(){var P=b;b=G;try{return j.apply(this,arguments)}finally{b=P}}}}(ah)),ah}var K1;function vH(){return K1||(K1=1,rh.exports=yH()),rh.exports}var oh={exports:{}},bn={};/** + * @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 X1;function SH(){if(X1)return bn;X1=1;var e=nf();function t(c){var f="https://react.dev/errors/"+c;if(1"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),oh.exports=SH(),oh.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 Q1;function EH(){if(Q1)return Is;Q1=1;var e=vH(),t=nf(),n=mz();function r(o){var s="https://react.dev/errors/"+o;if(1)":-1y||K[h]!==ne[y]){var be=` +`+K[h].replace(" at new "," at ");return o.displayName&&be.includes("")&&(be=be.replace("",o.displayName)),be}while(1<=h&&0<=y);break}}}finally{W=!1,Error.prepareStackTrace=d}return(d=o?o.displayName||o.name:"")?U(d):""}function j(o){switch(o.tag){case 26:case 27:case 5:return U(o.type);case 16:return U("Lazy");case 13:return U("Suspense");case 19:return U("SuspenseList");case 0:case 15:return o=Z(o.type,!1),o;case 11:return o=Z(o.type.render,!1),o;case 1:return o=Z(o.type,!0),o;default:return""}}function G(o){try{var s="";do s+=j(o),o=o.return;while(o);return s}catch(d){return` +Error generating stack: `+d.message+` +`+d.stack}}function P(o){var s=o,d=o;if(o.alternate)for(;s.return;)s=s.return;else{o=s;do s=o,s.flags&4098&&(d=s.return),o=s.return;while(o)}return s.tag===3?d:null}function X(o){if(o.tag===13){var s=o.memoizedState;if(s===null&&(o=o.alternate,o!==null&&(s=o.memoizedState)),s!==null)return s.dehydrated}return null}function D(o){if(P(o)!==o)throw Error(r(188))}function V(o){var s=o.alternate;if(!s){if(s=P(o),s===null)throw Error(r(188));return s!==o?null:o}for(var d=o,h=s;;){var y=d.return;if(y===null)break;var E=y.alternate;if(E===null){if(h=y.return,h!==null){d=h;continue}break}if(y.child===E.child){for(E=y.child;E;){if(E===d)return D(y),o;if(E===h)return D(y),s;E=E.sibling}throw Error(r(188))}if(d.return!==h.return)d=y,h=E;else{for(var F=!1,$=y.child;$;){if($===d){F=!0,d=y,h=E;break}if($===h){F=!0,h=y,d=E;break}$=$.sibling}if(!F){for($=E.child;$;){if($===d){F=!0,d=E,h=y;break}if($===h){F=!0,h=E,d=y;break}$=$.sibling}if(!F)throw Error(r(189))}}if(d.alternate!==h)throw Error(r(190))}if(d.tag!==3)throw Error(r(188));return d.stateNode.current===d?o:s}function B(o){var s=o.tag;if(s===5||s===26||s===27||s===6)return o;for(o=o.child;o!==null;){if(s=B(o),s!==null)return s;o=o.sibling}return null}var L=Array.isArray,Y=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Q={pending:!1,data:null,method:null,action:null},se=[],re=-1;function le(o){return{current:o}}function Ae(o){0>re||(o.current=se[re],se[re]=null,re--)}function ae(o,s){re++,se[re]=o.current,o.current=s}var we=le(null),xe=le(null),Ie=le(null),Ce=le(null);function Ee(o,s){switch(ae(Ie,s),ae(xe,o),ae(we,null),o=s.nodeType,o){case 9:case 11:s=(s=s.documentElement)&&(s=s.namespaceURI)?v1(s):0;break;default:if(o=o===8?s.parentNode:s,s=o.tagName,o=o.namespaceURI)o=v1(o),s=S1(o,s);else switch(s){case"svg":s=1;break;case"math":s=2;break;default:s=0}}Ae(we),ae(we,s)}function J(){Ae(we),Ae(xe),Ae(Ie)}function fe(o){o.memoizedState!==null&&ae(Ce,o);var s=we.current,d=S1(s,o.type);s!==d&&(ae(xe,o),ae(we,d))}function ke(o){xe.current===o&&(Ae(we),Ae(xe)),Ce.current===o&&(Ae(Ce),_s._currentValue=Q)}var me=Object.prototype.hasOwnProperty,ve=e.unstable_scheduleCallback,ie=e.unstable_cancelCallback,ze=e.unstable_shouldYield,Pe=e.unstable_requestPaint,he=e.unstable_now,Ne=e.unstable_getCurrentPriorityLevel,ee=e.unstable_ImmediatePriority,ce=e.unstable_UserBlockingPriority,Re=e.unstable_NormalPriority,Fe=e.unstable_LowPriority,qe=e.unstable_IdlePriority,mt=e.log,St=e.unstable_setDisableYieldValue,pt=null,Je=null;function wt(o){if(Je&&typeof Je.onCommitFiberRoot=="function")try{Je.onCommitFiberRoot(pt,o,void 0,(o.current.flags&128)===128)}catch{}}function rt(o){if(typeof mt=="function"&&St(o),Je&&typeof Je.setStrictMode=="function")try{Je.setStrictMode(pt,o)}catch{}}var bt=Math.clz32?Math.clz32:Mt,Bt=Math.log,sn=Math.LN2;function Mt(o){return o>>>=0,o===0?32:31-(Bt(o)/sn|0)|0}var er=128,zr=4194304;function Kt(o){var s=o&42;if(s!==0)return s;switch(o&-o){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 o&4194176;case 4194304:case 8388608:case 16777216:case 33554432:return o&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return o}}function na(o,s){var d=o.pendingLanes;if(d===0)return 0;var h=0,y=o.suspendedLanes,E=o.pingedLanes,F=o.warmLanes;o=o.finishedLanes!==0;var $=d&134217727;return $!==0?(d=$&~y,d!==0?h=Kt(d):(E&=$,E!==0?h=Kt(E):o||(F=$&~F,F!==0&&(h=Kt(F))))):($=d&~y,$!==0?h=Kt($):E!==0?h=Kt(E):o||(F=d&~F,F!==0&&(h=Kt(F)))),h===0?0:s!==0&&s!==h&&!(s&y)&&(y=h&-h,F=s&-s,y>=F||y===32&&(F&4194176)!==0)?s:h}function Ye(o,s){return(o.pendingLanes&~(o.suspendedLanes&~o.pingedLanes)&s)===0}function gt(o,s){switch(o){case 1:case 2:case 4:case 8:return s+250;case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return s+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function _t(){var o=er;return er<<=1,!(er&4194176)&&(er=128),o}function Rn(){var o=zr;return zr<<=1,!(zr&62914560)&&(zr=4194304),o}function kn(o){for(var s=[],d=0;31>d;d++)s.push(o);return s}function Cn(o,s){o.pendingLanes|=s,s!==268435456&&(o.suspendedLanes=0,o.pingedLanes=0,o.warmLanes=0)}function ra(o,s,d,h,y,E){var F=o.pendingLanes;o.pendingLanes=d,o.suspendedLanes=0,o.pingedLanes=0,o.warmLanes=0,o.expiredLanes&=d,o.entangledLanes&=d,o.errorRecoveryDisabledLanes&=d,o.shellSuspendCounter=0;var $=o.entanglements,K=o.expirationTimes,ne=o.hiddenUpdates;for(d=F&~d;0"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),rG=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]*$"),SA={},EA={};function aG(o){return me.call(EA,o)?!0:me.call(SA,o)?!1:rG.test(o)?EA[o]=!0:(SA[o]=!0,!1)}function Cu(o,s,d){if(aG(s))if(d===null)o.removeAttribute(s);else{switch(typeof d){case"undefined":case"function":case"symbol":o.removeAttribute(s);return;case"boolean":var h=s.toLowerCase().slice(0,5);if(h!=="data-"&&h!=="aria-"){o.removeAttribute(s);return}}o.setAttribute(s,""+d)}}function Nu(o,s,d){if(d===null)o.removeAttribute(s);else{switch(typeof d){case"undefined":case"function":case"symbol":case"boolean":o.removeAttribute(s);return}o.setAttribute(s,""+d)}}function oa(o,s,d,h){if(h===null)o.removeAttribute(d);else{switch(typeof h){case"undefined":case"function":case"symbol":case"boolean":o.removeAttribute(d);return}o.setAttributeNS(s,d,""+h)}}function tr(o){switch(typeof o){case"bigint":case"boolean":case"number":case"string":case"undefined":return o;case"object":return o;default:return""}}function wA(o){var s=o.type;return(o=o.nodeName)&&o.toLowerCase()==="input"&&(s==="checkbox"||s==="radio")}function oG(o){var s=wA(o)?"checked":"value",d=Object.getOwnPropertyDescriptor(o.constructor.prototype,s),h=""+o[s];if(!o.hasOwnProperty(s)&&typeof d<"u"&&typeof d.get=="function"&&typeof d.set=="function"){var y=d.get,E=d.set;return Object.defineProperty(o,s,{configurable:!0,get:function(){return y.call(this)},set:function(F){h=""+F,E.call(this,F)}}),Object.defineProperty(o,s,{enumerable:d.enumerable}),{getValue:function(){return h},setValue:function(F){h=""+F},stopTracking:function(){o._valueTracker=null,delete o[s]}}}}function Ou(o){o._valueTracker||(o._valueTracker=oG(o))}function xA(o){if(!o)return!1;var s=o._valueTracker;if(!s)return!0;var d=s.getValue(),h="";return o&&(h=wA(o)?o.checked?"true":"false":o.value),o=h,o!==d?(s.setValue(o),!0):!1}function Du(o){if(o=o||(typeof document<"u"?document:void 0),typeof o>"u")return null;try{return o.activeElement||o.body}catch{return o.body}}var iG=/[\n"\\]/g;function nr(o){return o.replace(iG,function(s){return"\\"+s.charCodeAt(0).toString(16)+" "})}function Qf(o,s,d,h,y,E,F,$){o.name="",F!=null&&typeof F!="function"&&typeof F!="symbol"&&typeof F!="boolean"?o.type=F:o.removeAttribute("type"),s!=null?F==="number"?(s===0&&o.value===""||o.value!=s)&&(o.value=""+tr(s)):o.value!==""+tr(s)&&(o.value=""+tr(s)):F!=="submit"&&F!=="reset"||o.removeAttribute("value"),s!=null?Jf(o,F,tr(s)):d!=null?Jf(o,F,tr(d)):h!=null&&o.removeAttribute("value"),y==null&&E!=null&&(o.defaultChecked=!!E),y!=null&&(o.checked=y&&typeof y!="function"&&typeof y!="symbol"),$!=null&&typeof $!="function"&&typeof $!="symbol"&&typeof $!="boolean"?o.name=""+tr($):o.removeAttribute("name")}function kA(o,s,d,h,y,E,F,$){if(E!=null&&typeof E!="function"&&typeof E!="symbol"&&typeof E!="boolean"&&(o.type=E),s!=null||d!=null){if(!(E!=="submit"&&E!=="reset"||s!=null))return;d=d!=null?""+tr(d):"",s=s!=null?""+tr(s):d,$||s===o.value||(o.value=s),o.defaultValue=s}h=h??y,h=typeof h!="function"&&typeof h!="symbol"&&!!h,o.checked=$?o.checked:!!h,o.defaultChecked=!!h,F!=null&&typeof F!="function"&&typeof F!="symbol"&&typeof F!="boolean"&&(o.name=F)}function Jf(o,s,d){s==="number"&&Du(o.ownerDocument)===o||o.defaultValue===""+d||(o.defaultValue=""+d)}function bi(o,s,d,h){if(o=o.options,s){s={};for(var y=0;y=ql),zA=" ",PA=!1;function BA(o,s){switch(o){case"keyup":return LG.indexOf(s.keyCode)!==-1;case"keydown":return s.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function UA(o){return o=o.detail,typeof o=="object"&&"data"in o?o.data:null}var Ei=!1;function FG(o,s){switch(o){case"compositionend":return UA(s);case"keypress":return s.which!==32?null:(PA=!0,zA);case"textInput":return o=s.data,o===zA&&PA?null:o;default:return null}}function zG(o,s){if(Ei)return o==="compositionend"||!cp&&BA(o,s)?(o=OA(),Lu=op=Pa=null,Ei=!1,o):null;switch(o){case"paste":return null;case"keypress":if(!(s.ctrlKey||s.altKey||s.metaKey)||s.ctrlKey&&s.altKey){if(s.char&&1=s)return{node:d,offset:s-o};o=h}e:{for(;d;){if(d.nextSibling){d=d.nextSibling;break e}d=d.parentNode}d=void 0}d=YA(d)}}function XA(o,s){return o&&s?o===s?!0:o&&o.nodeType===3?!1:s&&s.nodeType===3?XA(o,s.parentNode):"contains"in o?o.contains(s):o.compareDocumentPosition?!!(o.compareDocumentPosition(s)&16):!1:!1}function ZA(o){o=o!=null&&o.ownerDocument!=null&&o.ownerDocument.defaultView!=null?o.ownerDocument.defaultView:window;for(var s=Du(o.document);s instanceof o.HTMLIFrameElement;){try{var d=typeof s.contentWindow.location.href=="string"}catch{d=!1}if(d)o=s.contentWindow;else break;s=Du(o.document)}return s}function pp(o){var s=o&&o.nodeName&&o.nodeName.toLowerCase();return s&&(s==="input"&&(o.type==="text"||o.type==="search"||o.type==="tel"||o.type==="url"||o.type==="password")||s==="textarea"||o.contentEditable==="true")}function qG(o,s){var d=ZA(s);s=o.focusedElem;var h=o.selectionRange;if(d!==s&&s&&s.ownerDocument&&XA(s.ownerDocument.documentElement,s)){if(h!==null&&pp(s)){if(o=h.start,d=h.end,d===void 0&&(d=o),"selectionStart"in s)s.selectionStart=o,s.selectionEnd=Math.min(d,s.value.length);else if(d=(o=s.ownerDocument||document)&&o.defaultView||window,d.getSelection){d=d.getSelection();var y=s.textContent.length,E=Math.min(h.start,y);h=h.end===void 0?E:Math.min(h.end,y),!d.extend&&E>h&&(y=h,h=E,E=y),y=KA(s,E);var F=KA(s,h);y&&F&&(d.rangeCount!==1||d.anchorNode!==y.node||d.anchorOffset!==y.offset||d.focusNode!==F.node||d.focusOffset!==F.offset)&&(o=o.createRange(),o.setStart(y.node,y.offset),d.removeAllRanges(),E>h?(d.addRange(o),d.extend(F.node,F.offset)):(o.setEnd(F.node,F.offset),d.addRange(o)))}}for(o=[],d=s;d=d.parentNode;)d.nodeType===1&&o.push({element:d,left:d.scrollLeft,top:d.scrollTop});for(typeof s.focus=="function"&&s.focus(),s=0;s=document.documentMode,wi=null,gp=null,Kl=null,hp=!1;function QA(o,s,d){var h=d.window===d?d.document:d.nodeType===9?d:d.ownerDocument;hp||wi==null||wi!==Du(h)||(h=wi,"selectionStart"in h&&pp(h)?h={start:h.selectionStart,end:h.selectionEnd}:(h=(h.ownerDocument&&h.ownerDocument.defaultView||window).getSelection(),h={anchorNode:h.anchorNode,anchorOffset:h.anchorOffset,focusNode:h.focusNode,focusOffset:h.focusOffset}),Kl&&Yl(Kl,h)||(Kl=h,h=Ec(gp,"onSelect"),0>=F,y-=F,ia=1<<32-bt(s)+y|d<Qe?(nn=Ve,Ve=null):nn=Ve.sibling;var vt=de(oe,Ve,ue[Qe],Se);if(vt===null){Ve===null&&(Ve=nn);break}o&&Ve&&vt.alternate===null&&s(oe,Ve),te=E(vt,te,Qe),it===null?Ue=vt:it.sibling=vt,it=vt,Ve=nn}if(Qe===ue.length)return d(oe,Ve),yt&&Do(oe,Qe),Ue;if(Ve===null){for(;QeQe?(nn=Ve,Ve=null):nn=Ve.sibling;var ao=de(oe,Ve,vt.value,Se);if(ao===null){Ve===null&&(Ve=nn);break}o&&Ve&&ao.alternate===null&&s(oe,Ve),te=E(ao,te,Qe),it===null?Ue=ao:it.sibling=ao,it=ao,Ve=nn}if(vt.done)return d(oe,Ve),yt&&Do(oe,Qe),Ue;if(Ve===null){for(;!vt.done;Qe++,vt=ue.next())vt=Te(oe,vt.value,Se),vt!==null&&(te=E(vt,te,Qe),it===null?Ue=vt:it.sibling=vt,it=vt);return yt&&Do(oe,Qe),Ue}for(Ve=h(Ve);!vt.done;Qe++,vt=ue.next())vt=ge(Ve,oe,Qe,vt.value,Se),vt!==null&&(o&&vt.alternate!==null&&Ve.delete(vt.key===null?Qe:vt.key),te=E(vt,te,Qe),it===null?Ue=vt:it.sibling=vt,it=vt);return o&&Ve.forEach(function(uH){return s(oe,uH)}),yt&&Do(oe,Qe),Ue}function Gt(oe,te,ue,Se){if(typeof ue=="object"&&ue!==null&&ue.type===c&&ue.key===null&&(ue=ue.props.children),typeof ue=="object"&&ue!==null){switch(ue.$$typeof){case l:e:{for(var Ue=ue.key;te!==null;){if(te.key===Ue){if(Ue=ue.type,Ue===c){if(te.tag===7){d(oe,te.sibling),Se=y(te,ue.props.children),Se.return=oe,oe=Se;break e}}else if(te.elementType===Ue||typeof Ue=="object"&&Ue!==null&&Ue.$$typeof===x&&hT(Ue)===te.type){d(oe,te.sibling),Se=y(te,ue.props),ns(Se,ue),Se.return=oe,oe=Se;break e}d(oe,te);break}else s(oe,te);te=te.sibling}ue.type===c?(Se=Ho(ue.props.children,oe.mode,Se,ue.key),Se.return=oe,oe=Se):(Se=dc(ue.type,ue.key,ue.props,null,oe.mode,Se),ns(Se,ue),Se.return=oe,oe=Se)}return F(oe);case u:e:{for(Ue=ue.key;te!==null;){if(te.key===Ue)if(te.tag===4&&te.stateNode.containerInfo===ue.containerInfo&&te.stateNode.implementation===ue.implementation){d(oe,te.sibling),Se=y(te,ue.children||[]),Se.return=oe,oe=Se;break e}else{d(oe,te);break}else s(oe,te);te=te.sibling}Se=bg(ue,oe.mode,Se),Se.return=oe,oe=Se}return F(oe);case x:return Ue=ue._init,ue=Ue(ue._payload),Gt(oe,te,ue,Se)}if(L(ue))return He(oe,te,ue,Se);if(T(ue)){if(Ue=T(ue),typeof Ue!="function")throw Error(r(150));return ue=Ue.call(ue),et(oe,te,ue,Se)}if(typeof ue.then=="function")return Gt(oe,te,Vu(ue),Se);if(ue.$$typeof===m)return Gt(oe,te,sc(oe,ue),Se);Wu(oe,ue)}return typeof ue=="string"&&ue!==""||typeof ue=="number"||typeof ue=="bigint"?(ue=""+ue,te!==null&&te.tag===6?(d(oe,te.sibling),Se=y(te,ue),Se.return=oe,oe=Se):(d(oe,te),Se=mg(ue,oe.mode,Se),Se.return=oe,oe=Se),F(oe)):d(oe,te)}return function(oe,te,ue,Se){try{ts=0;var Ue=Gt(oe,te,ue,Se);return Ri=null,Ue}catch(Ve){if(Ve===Jl)throw Ve;var it=cr(29,Ve,null,oe.mode);return it.lanes=Se,it.return=oe,it}finally{}}}var Lo=mT(!0),bT=mT(!1),Ci=le(null),Yu=le(0);function yT(o,s){o=ya,ae(Yu,o),ae(Ci,s),ya=o|s.baseLanes}function xp(){ae(Yu,ya),ae(Ci,Ci.current)}function kp(){ya=Yu.current,Ae(Ci),Ae(Yu)}var lr=le(null),Br=null;function Ua(o){var s=o.alternate;ae(Xt,Xt.current&1),ae(lr,o),Br===null&&(s===null||Ci.current!==null||s.memoizedState!==null)&&(Br=o)}function vT(o){if(o.tag===22){if(ae(Xt,Xt.current),ae(lr,o),Br===null){var s=o.alternate;s!==null&&s.memoizedState!==null&&(Br=o)}}else ja()}function ja(){ae(Xt,Xt.current),ae(lr,lr.current)}function sa(o){Ae(lr),Br===o&&(Br=null),Ae(Xt)}var Xt=le(0);function Ku(o){for(var s=o;s!==null;){if(s.tag===13){var d=s.memoizedState;if(d!==null&&(d=d.dehydrated,d===null||d.data==="$?"||d.data==="$!"))return s}else if(s.tag===19&&s.memoizedProps.revealOrder!==void 0){if(s.flags&128)return s}else if(s.child!==null){s.child.return=s,s=s.child;continue}if(s===o)break;for(;s.sibling===null;){if(s.return===null||s.return===o)return null;s=s.return}s.sibling.return=s.return,s=s.sibling}return null}var XG=typeof AbortController<"u"?AbortController:function(){var o=[],s=this.signal={aborted:!1,addEventListener:function(d,h){o.push(h)}};this.abort=function(){s.aborted=!0,o.forEach(function(d){return d()})}},ZG=e.unstable_scheduleCallback,QG=e.unstable_NormalPriority,Zt={$$typeof:m,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Ap(){return{controller:new XG,data:new Map,refCount:0}}function rs(o){o.refCount--,o.refCount===0&&ZG(QG,function(){o.controller.abort()})}var as=null,Tp=0,Ni=0,Oi=null;function JG(o,s){if(as===null){var d=as=[];Tp=0,Ni=Dg(),Oi={status:"pending",value:void 0,then:function(h){d.push(h)}}}return Tp++,s.then(ST,ST),s}function ST(){if(--Tp===0&&as!==null){Oi!==null&&(Oi.status="fulfilled");var o=as;as=null,Ni=0,Oi=null;for(var s=0;sE?E:8;var F=I.T,$={};I.T=$,Hp(o,!1,s,d);try{var K=y(),ne=I.S;if(ne!==null&&ne($,K),K!==null&&typeof K=="object"&&typeof K.then=="function"){var be=e6(K,h);ls(o,s,be,Wn(o))}else ls(o,s,h,Wn(o))}catch(Te){ls(o,s,{then:function(){},status:"rejected",reason:Te},Wn())}finally{Y.p=E,I.T=F}}function o6(){}function jp(o,s,d,h){if(o.tag!==5)throw Error(r(476));var y=ZT(o).queue;XT(o,y,s,Q,d===null?o6:function(){return QT(o),d(h)})}function ZT(o){var s=o.memoizedState;if(s!==null)return s;s={memoizedState:Q,baseState:Q,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ua,lastRenderedState:Q},next:null};var d={};return s.next={memoizedState:d,baseState:d,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ua,lastRenderedState:d},next:null},o.memoizedState=s,o=o.alternate,o!==null&&(o.memoizedState=s),s}function QT(o){var s=ZT(o).next.queue;ls(o,s,{},Wn())}function Gp(){return mn(_s)}function JT(){return Vt().memoizedState}function e_(){return Vt().memoizedState}function i6(o){for(var s=o.return;s!==null;){switch(s.tag){case 24:case 3:var d=Wn();o=Va(d);var h=Wa(s,o,d);h!==null&&(Tn(h,s,d),cs(h,s,d)),s={cache:Ap()},o.payload=s;return}s=s.return}}function l6(o,s,d){var h=Wn();d={lane:h,revertLane:0,action:d,hasEagerState:!1,eagerState:null,next:null},ac(o)?n_(s,d):(d=yp(o,s,d,h),d!==null&&(Tn(d,o,h),r_(d,s,h)))}function t_(o,s,d){var h=Wn();ls(o,s,d,h)}function ls(o,s,d,h){var y={lane:h,revertLane:0,action:d,hasEagerState:!1,eagerState:null,next:null};if(ac(o))n_(s,y);else{var E=o.alternate;if(o.lanes===0&&(E===null||E.lanes===0)&&(E=s.lastRenderedReducer,E!==null))try{var F=s.lastRenderedState,$=E(F,d);if(y.hasEagerState=!0,y.eagerState=$,Hn($,F))return ju(o,s,y,0),Ot===null&&Uu(),!1}catch{}finally{}if(d=yp(o,s,y,h),d!==null)return Tn(d,o,h),r_(d,s,h),!0}return!1}function Hp(o,s,d,h){if(h={lane:2,revertLane:Dg(),action:h,hasEagerState:!1,eagerState:null,next:null},ac(o)){if(s)throw Error(r(479))}else s=yp(o,d,h,2),s!==null&&Tn(s,o,2)}function ac(o){var s=o.alternate;return o===ot||s!==null&&s===ot}function n_(o,s){Di=Zu=!0;var d=o.pending;d===null?s.next=s:(s.next=d.next,d.next=s),o.pending=s}function r_(o,s,d){if(d&4194176){var h=s.lanes;h&=o.pendingLanes,d|=h,s.lanes=d,Sr(o,d)}}var Ur={readContext:mn,use:ec,useCallback:Ht,useContext:Ht,useEffect:Ht,useImperativeHandle:Ht,useLayoutEffect:Ht,useInsertionEffect:Ht,useMemo:Ht,useReducer:Ht,useRef:Ht,useState:Ht,useDebugValue:Ht,useDeferredValue:Ht,useTransition:Ht,useSyncExternalStore:Ht,useId:Ht};Ur.useCacheRefresh=Ht,Ur.useMemoCache=Ht,Ur.useHostTransitionStatus=Ht,Ur.useFormState=Ht,Ur.useActionState=Ht,Ur.useOptimistic=Ht;var zo={readContext:mn,use:ec,useCallback:function(o,s){return In().memoizedState=[o,s===void 0?null:s],o},useContext:mn,useEffect:GT,useImperativeHandle:function(o,s,d){d=d!=null?d.concat([o]):null,nc(4194308,4,qT.bind(null,s,o),d)},useLayoutEffect:function(o,s){return nc(4194308,4,o,s)},useInsertionEffect:function(o,s){nc(4,2,o,s)},useMemo:function(o,s){var d=In();s=s===void 0?null:s;var h=o();if(Fo){rt(!0);try{o()}finally{rt(!1)}}return d.memoizedState=[h,s],h},useReducer:function(o,s,d){var h=In();if(d!==void 0){var y=d(s);if(Fo){rt(!0);try{d(s)}finally{rt(!1)}}}else y=s;return h.memoizedState=h.baseState=y,o={pending:null,lanes:0,dispatch:null,lastRenderedReducer:o,lastRenderedState:y},h.queue=o,o=o.dispatch=l6.bind(null,ot,o),[h.memoizedState,o]},useRef:function(o){var s=In();return o={current:o},s.memoizedState=o},useState:function(o){o=Fp(o);var s=o.queue,d=t_.bind(null,ot,s);return s.dispatch=d,[o.memoizedState,d]},useDebugValue:Bp,useDeferredValue:function(o,s){var d=In();return Up(d,o,s)},useTransition:function(){var o=Fp(!1);return o=XT.bind(null,ot,o.queue,!0,!1),In().memoizedState=o,[!1,o]},useSyncExternalStore:function(o,s,d){var h=ot,y=In();if(yt){if(d===void 0)throw Error(r(407));d=d()}else{if(d=s(),Ot===null)throw Error(r(349));ht&60||TT(h,s,d)}y.memoizedState=d;var E={value:d,getSnapshot:s};return y.queue=E,GT(RT.bind(null,h,E,o),[o]),h.flags|=2048,Li(9,_T.bind(null,h,E,d,s),{destroy:void 0},null),d},useId:function(){var o=In(),s=Ot.identifierPrefix;if(yt){var d=la,h=ia;d=(h&~(1<<32-bt(h)-1)).toString(32)+d,s=":"+s+"R"+d,d=Qu++,0 title"))),dn(E,h,d),E[hn]=o,Jt(E),h=E;break e;case"link":var F=N1("link","href",y).get(h+(d.href||""));if(F){for(var $=0;$<\/script>",o=o.removeChild(o.firstChild);break;case"select":o=typeof h.is=="string"?y.createElement("select",{is:h.is}):y.createElement("select"),h.multiple?o.multiple=!0:h.size&&(o.size=h.size);break;default:o=typeof h.is=="string"?y.createElement(d,{is:h.is}):y.createElement(d)}}o[hn]=s,o[On]=h;e:for(y=s.child;y!==null;){if(y.tag===5||y.tag===6)o.appendChild(y.stateNode);else if(y.tag!==4&&y.tag!==27&&y.child!==null){y.child.return=y,y=y.child;continue}if(y===s)break e;for(;y.sibling===null;){if(y.return===null||y.return===s)break e;y=y.return}y.sibling.return=y.return,y=y.sibling}s.stateNode=o;e:switch(dn(o,d,h),d){case"button":case"input":case"select":case"textarea":o=!!h.autoFocus;break e;case"img":o=!0;break e;default:o=!1}o&&ma(s)}}return Ft(s),s.flags&=-16777217,null;case 6:if(o&&s.stateNode!=null)o.memoizedProps!==h&&ma(s);else{if(typeof h!="string"&&s.stateNode===null)throw Error(r(166));if(o=Ie.current,Xl(s)){if(o=s.stateNode,d=s.memoizedProps,h=null,y=An,y!==null)switch(y.tag){case 27:case 5:h=y.memoizedProps}o[hn]=s,o=!!(o.nodeValue===d||h!==null&&h.suppressHydrationWarning===!0||y1(o.nodeValue,d)),o||Io(s)}else o=xc(o).createTextNode(h),o[hn]=s,s.stateNode=o}return Ft(s),null;case 13:if(h=s.memoizedState,o===null||o.memoizedState!==null&&o.memoizedState.dehydrated!==null){if(y=Xl(s),h!==null&&h.dehydrated!==null){if(o===null){if(!y)throw Error(r(318));if(y=s.memoizedState,y=y!==null?y.dehydrated:null,!y)throw Error(r(317));y[hn]=s}else Zl(),!(s.flags&128)&&(s.memoizedState=null),s.flags|=4;Ft(s),y=!1}else wr!==null&&(Ag(wr),wr=null),y=!0;if(!y)return s.flags&256?(sa(s),s):(sa(s),null)}if(sa(s),s.flags&128)return s.lanes=d,s;if(d=h!==null,o=o!==null&&o.memoizedState!==null,d){h=s.child,y=null,h.alternate!==null&&h.alternate.memoizedState!==null&&h.alternate.memoizedState.cachePool!==null&&(y=h.alternate.memoizedState.cachePool.pool);var E=null;h.memoizedState!==null&&h.memoizedState.cachePool!==null&&(E=h.memoizedState.cachePool.pool),E!==y&&(h.flags|=2048)}return d!==o&&d&&(s.child.flags|=8192),fc(s,s.updateQueue),Ft(s),null;case 4:return J(),o===null&&Fg(s.stateNode.containerInfo),Ft(s),null;case 10:return fa(s.type),Ft(s),null;case 19:if(Ae(Xt),y=s.memoizedState,y===null)return Ft(s),null;if(h=(s.flags&128)!==0,E=y.rendering,E===null)if(h)bs(y,!1);else{if(jt!==0||o!==null&&o.flags&128)for(o=s.child;o!==null;){if(E=Ku(o),E!==null){for(s.flags|=128,bs(y,!1),o=E.updateQueue,s.updateQueue=o,fc(s,o),s.subtreeFlags=0,o=d,d=s.child;d!==null;)V_(d,o),d=d.sibling;return ae(Xt,Xt.current&1|2),s.child}o=o.sibling}y.tail!==null&&he()>pc&&(s.flags|=128,h=!0,bs(y,!1),s.lanes=4194304)}else{if(!h)if(o=Ku(E),o!==null){if(s.flags|=128,h=!0,o=o.updateQueue,s.updateQueue=o,fc(s,o),bs(y,!0),y.tail===null&&y.tailMode==="hidden"&&!E.alternate&&!yt)return Ft(s),null}else 2*he()-y.renderingStartTime>pc&&d!==536870912&&(s.flags|=128,h=!0,bs(y,!1),s.lanes=4194304);y.isBackwards?(E.sibling=s.child,s.child=E):(o=y.last,o!==null?o.sibling=E:s.child=E,y.last=E)}return y.tail!==null?(s=y.tail,y.rendering=s,y.tail=s.sibling,y.renderingStartTime=he(),s.sibling=null,o=Xt.current,ae(Xt,h?o&1|2:o&1),s):(Ft(s),null);case 22:case 23:return sa(s),kp(),h=s.memoizedState!==null,o!==null?o.memoizedState!==null!==h&&(s.flags|=8192):h&&(s.flags|=8192),h?d&536870912&&!(s.flags&128)&&(Ft(s),s.subtreeFlags&6&&(s.flags|=8192)):Ft(s),d=s.updateQueue,d!==null&&fc(s,d.retryQueue),d=null,o!==null&&o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(d=o.memoizedState.cachePool.pool),h=null,s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(h=s.memoizedState.cachePool.pool),h!==d&&(s.flags|=2048),o!==null&&Ae(Mo),null;case 24:return d=null,o!==null&&(d=o.memoizedState.cache),s.memoizedState.cache!==d&&(s.flags|=2048),fa(Zt),Ft(s),null;case 25:return null}throw Error(r(156,s.tag))}function g6(o,s){switch(Sp(s),s.tag){case 1:return o=s.flags,o&65536?(s.flags=o&-65537|128,s):null;case 3:return fa(Zt),J(),o=s.flags,o&65536&&!(o&128)?(s.flags=o&-65537|128,s):null;case 26:case 27:case 5:return ke(s),null;case 13:if(sa(s),o=s.memoizedState,o!==null&&o.dehydrated!==null){if(s.alternate===null)throw Error(r(340));Zl()}return o=s.flags,o&65536?(s.flags=o&-65537|128,s):null;case 19:return Ae(Xt),null;case 4:return J(),null;case 10:return fa(s.type),null;case 22:case 23:return sa(s),kp(),o!==null&&Ae(Mo),o=s.flags,o&65536?(s.flags=o&-65537|128,s):null;case 24:return fa(Zt),null;case 25:return null;default:return null}}function K_(o,s){switch(Sp(s),s.tag){case 3:fa(Zt),J();break;case 26:case 27:case 5:ke(s);break;case 4:J();break;case 13:sa(s);break;case 19:Ae(Xt);break;case 10:fa(s.type);break;case 22:case 23:sa(s),kp(),o!==null&&Ae(Mo);break;case 24:fa(Zt)}}var h6={getCacheForType:function(o){var s=mn(Zt),d=s.data.get(o);return d===void 0&&(d=o(),s.data.set(o,d)),d}},m6=typeof WeakMap=="function"?WeakMap:Map,zt=0,Ot=null,st=null,ht=0,Dt=0,Vn=null,ba=!1,Pi=!1,yg=!1,ya=0,jt=0,Qa=0,$o=0,vg=0,dr=0,Bi=0,ys=null,jr=null,Sg=!1,Eg=0,pc=1/0,gc=null,Ja=null,hc=!1,qo=null,vs=0,wg=0,xg=null,Ss=0,kg=null;function Wn(){if(zt&2&&ht!==0)return ht&-ht;if(I.T!==null){var o=Ni;return o!==0?o:Dg()}return mA()}function X_(){dr===0&&(dr=!(ht&536870912)||yt?_t():536870912);var o=lr.current;return o!==null&&(o.flags|=32),dr}function Tn(o,s,d){(o===Ot&&Dt===2||o.cancelPendingCommit!==null)&&(Ui(o,0),va(o,ht,dr,!1)),Cn(o,d),(!(zt&2)||o!==Ot)&&(o===Ot&&(!(zt&2)&&($o|=d),jt===4&&va(o,ht,dr,!1)),Gr(o))}function Z_(o,s,d){if(zt&6)throw Error(r(327));var h=!d&&(s&60)===0&&(s&o.expiredLanes)===0||Ye(o,s),y=h?v6(o,s):Rg(o,s,!0),E=h;do{if(y===0){Pi&&!h&&va(o,s,0,!1);break}else if(y===6)va(o,s,0,!ba);else{if(d=o.current.alternate,E&&!b6(d)){y=Rg(o,s,!1),E=!1;continue}if(y===2){if(E=s,o.errorRecoveryDisabledLanes&E)var F=0;else F=o.pendingLanes&-536870913,F=F!==0?F:F&536870912?536870912:0;if(F!==0){s=F;e:{var $=o;y=ys;var K=$.current.memoizedState.isDehydrated;if(K&&(Ui($,F).flags|=256),F=Rg($,F,!1),F!==2){if(yg&&!K){$.errorRecoveryDisabledLanes|=E,$o|=E,y=4;break e}E=jr,jr=y,E!==null&&Ag(E)}y=F}if(E=!1,y!==2)continue}}if(y===1){Ui(o,0),va(o,s,0,!0);break}e:{switch(h=o,y){case 0:case 1:throw Error(r(345));case 4:if((s&4194176)===s){va(h,s,dr,!ba);break e}break;case 2:jr=null;break;case 3:case 5:break;default:throw Error(r(329))}if(h.finishedWork=d,h.finishedLanes=s,(s&62914560)===s&&(E=Eg+300-he(),10d?32:d,I.T=null,qo===null)var E=!1;else{d=xg,xg=null;var F=qo,$=vs;if(qo=null,vs=0,zt&6)throw Error(r(331));var K=zt;if(zt|=4,$_(F.current),j_(F,F.current,$,d),zt=K,Es(0,!1),Je&&typeof Je.onPostCommitFiberRoot=="function")try{Je.onPostCommitFiberRoot(pt,F)}catch{}E=!0}return E}finally{Y.p=y,I.T=h,i1(o,s)}}return!1}function l1(o,s,d){s=ar(d,s),s=Vp(o.stateNode,s,2),o=Wa(o,s,2),o!==null&&(Cn(o,2),Gr(o))}function Rt(o,s,d){if(o.tag===3)l1(o,o,d);else for(;s!==null;){if(s.tag===3){l1(s,o,d);break}else if(s.tag===1){var h=s.stateNode;if(typeof s.type.getDerivedStateFromError=="function"||typeof h.componentDidCatch=="function"&&(Ja===null||!Ja.has(h))){o=ar(d,o),d=c_(2),h=Wa(s,d,2),h!==null&&(d_(d,h,s,o),Cn(h,2),Gr(h));break}}s=s.return}}function Cg(o,s,d){var h=o.pingCache;if(h===null){h=o.pingCache=new m6;var y=new Set;h.set(s,y)}else y=h.get(s),y===void 0&&(y=new Set,h.set(s,y));y.has(d)||(yg=!0,y.add(d),o=w6.bind(null,o,s,d),s.then(o,o))}function w6(o,s,d){var h=o.pingCache;h!==null&&h.delete(s),o.pingedLanes|=o.suspendedLanes&d,o.warmLanes&=~d,Ot===o&&(ht&d)===d&&(jt===4||jt===3&&(ht&62914560)===ht&&300>he()-Eg?!(zt&2)&&Ui(o,0):vg|=d,Bi===ht&&(Bi=0)),Gr(o)}function s1(o,s){s===0&&(s=Rn()),o=Ba(o,s),o!==null&&(Cn(o,s),Gr(o))}function x6(o){var s=o.memoizedState,d=0;s!==null&&(d=s.retryLane),s1(o,d)}function k6(o,s){var d=0;switch(o.tag){case 13:var h=o.stateNode,y=o.memoizedState;y!==null&&(d=y.retryLane);break;case 19:h=o.stateNode;break;case 22:h=o.stateNode._retryCache;break;default:throw Error(r(314))}h!==null&&h.delete(s),s1(o,d)}function A6(o,s){return ve(o,s)}var yc=null,Hi=null,Ng=!1,vc=!1,Og=!1,Vo=0;function Gr(o){o!==Hi&&o.next===null&&(Hi===null?yc=Hi=o:Hi=Hi.next=o),vc=!0,Ng||(Ng=!0,_6(T6))}function Es(o,s){if(!Og&&vc){Og=!0;do for(var d=!1,h=yc;h!==null;){if(o!==0){var y=h.pendingLanes;if(y===0)var E=0;else{var F=h.suspendedLanes,$=h.pingedLanes;E=(1<<31-bt(42|o)+1)-1,E&=y&~(F&~$),E=E&201326677?E&201326677|1:E?E|2:0}E!==0&&(d=!0,d1(h,E))}else E=ht,E=na(h,h===Ot?E:0),!(E&3)||Ye(h,E)||(d=!0,d1(h,E));h=h.next}while(d);Og=!1}}function T6(){vc=Ng=!1;var o=0;Vo!==0&&(M6()&&(o=Vo),Vo=0);for(var s=he(),d=null,h=yc;h!==null;){var y=h.next,E=u1(h,s);E===0?(h.next=null,d===null?yc=y:d.next=y,y===null&&(Hi=d)):(d=h,(o!==0||E&3)&&(vc=!0)),h=y}Es(o)}function u1(o,s){for(var d=o.suspendedLanes,h=o.pingedLanes,y=o.expirationTimes,E=o.pendingLanes&-62914561;0"u"?null:document;function T1(o,s,d){var h=qi;if(h&&typeof s=="string"&&s){var y=nr(s);y='link[rel="'+o+'"][href="'+y+'"]',typeof d=="string"&&(y+='[crossorigin="'+d+'"]'),A1.has(y)||(A1.add(y),o={rel:o,crossOrigin:d,href:s},h.querySelector(y)===null&&(s=h.createElement("link"),dn(s,"link",o),Jt(s),h.head.appendChild(s)))}}function H6(o){Sa.D(o),T1("dns-prefetch",o,null)}function $6(o,s){Sa.C(o,s),T1("preconnect",o,s)}function q6(o,s,d){Sa.L(o,s,d);var h=qi;if(h&&o&&s){var y='link[rel="preload"][as="'+nr(s)+'"]';s==="image"&&d&&d.imageSrcSet?(y+='[imagesrcset="'+nr(d.imageSrcSet)+'"]',typeof d.imageSizes=="string"&&(y+='[imagesizes="'+nr(d.imageSizes)+'"]')):y+='[href="'+nr(o)+'"]';var E=y;switch(s){case"style":E=Vi(o);break;case"script":E=Wi(o)}fr.has(E)||(o=M({rel:"preload",href:s==="image"&&d&&d.imageSrcSet?void 0:o,as:s},d),fr.set(E,o),h.querySelector(y)!==null||s==="style"&&h.querySelector(ks(E))||s==="script"&&h.querySelector(As(E))||(s=h.createElement("link"),dn(s,"link",o),Jt(s),h.head.appendChild(s)))}}function V6(o,s){Sa.m(o,s);var d=qi;if(d&&o){var h=s&&typeof s.as=="string"?s.as:"script",y='link[rel="modulepreload"][as="'+nr(h)+'"][href="'+nr(o)+'"]',E=y;switch(h){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":E=Wi(o)}if(!fr.has(E)&&(o=M({rel:"modulepreload",href:o},s),fr.set(E,o),d.querySelector(y)===null)){switch(h){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(d.querySelector(As(E)))return}h=d.createElement("link"),dn(h,"link",o),Jt(h),d.head.appendChild(h)}}}function W6(o,s,d){Sa.S(o,s,d);var h=qi;if(h&&o){var y=hi(h).hoistableStyles,E=Vi(o);s=s||"default";var F=y.get(E);if(!F){var $={loading:0,preload:null};if(F=h.querySelector(ks(E)))$.loading=5;else{o=M({rel:"stylesheet",href:o,"data-precedence":s},d),(d=fr.get(E))&&qg(o,d);var K=F=h.createElement("link");Jt(K),dn(K,"link",o),K._p=new Promise(function(ne,be){K.onload=ne,K.onerror=be}),K.addEventListener("load",function(){$.loading|=1}),K.addEventListener("error",function(){$.loading|=2}),$.loading|=4,Ac(F,s,h)}F={type:"stylesheet",instance:F,count:1,state:$},y.set(E,F)}}}function Y6(o,s){Sa.X(o,s);var d=qi;if(d&&o){var h=hi(d).hoistableScripts,y=Wi(o),E=h.get(y);E||(E=d.querySelector(As(y)),E||(o=M({src:o,async:!0},s),(s=fr.get(y))&&Vg(o,s),E=d.createElement("script"),Jt(E),dn(E,"link",o),d.head.appendChild(E)),E={type:"script",instance:E,count:1,state:null},h.set(y,E))}}function K6(o,s){Sa.M(o,s);var d=qi;if(d&&o){var h=hi(d).hoistableScripts,y=Wi(o),E=h.get(y);E||(E=d.querySelector(As(y)),E||(o=M({src:o,async:!0,type:"module"},s),(s=fr.get(y))&&Vg(o,s),E=d.createElement("script"),Jt(E),dn(E,"link",o),d.head.appendChild(E)),E={type:"script",instance:E,count:1,state:null},h.set(y,E))}}function _1(o,s,d,h){var y=(y=Ie.current)?kc(y):null;if(!y)throw Error(r(446));switch(o){case"meta":case"title":return null;case"style":return typeof d.precedence=="string"&&typeof d.href=="string"?(s=Vi(d.href),d=hi(y).hoistableStyles,h=d.get(s),h||(h={type:"style",instance:null,count:0,state:null},d.set(s,h)),h):{type:"void",instance:null,count:0,state:null};case"link":if(d.rel==="stylesheet"&&typeof d.href=="string"&&typeof d.precedence=="string"){o=Vi(d.href);var E=hi(y).hoistableStyles,F=E.get(o);if(F||(y=y.ownerDocument||y,F={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},E.set(o,F),(E=y.querySelector(ks(o)))&&!E._p&&(F.instance=E,F.state.loading=5),fr.has(o)||(d={rel:"preload",as:"style",href:d.href,crossOrigin:d.crossOrigin,integrity:d.integrity,media:d.media,hrefLang:d.hrefLang,referrerPolicy:d.referrerPolicy},fr.set(o,d),E||X6(y,o,d,F.state))),s&&h===null)throw Error(r(528,""));return F}if(s&&h!==null)throw Error(r(529,""));return null;case"script":return s=d.async,d=d.src,typeof d=="string"&&s&&typeof s!="function"&&typeof s!="symbol"?(s=Wi(d),d=hi(y).hoistableScripts,h=d.get(s),h||(h={type:"script",instance:null,count:0,state:null},d.set(s,h)),h):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,o))}}function Vi(o){return'href="'+nr(o)+'"'}function ks(o){return'link[rel="stylesheet"]['+o+"]"}function R1(o){return M({},o,{"data-precedence":o.precedence,precedence:null})}function X6(o,s,d,h){o.querySelector('link[rel="preload"][as="style"]['+s+"]")?h.loading=1:(s=o.createElement("link"),h.preload=s,s.addEventListener("load",function(){return h.loading|=1}),s.addEventListener("error",function(){return h.loading|=2}),dn(s,"link",d),Jt(s),o.head.appendChild(s))}function Wi(o){return'[src="'+nr(o)+'"]'}function As(o){return"script[async]"+o}function C1(o,s,d){if(s.count++,s.instance===null)switch(s.type){case"style":var h=o.querySelector('style[data-href~="'+nr(d.href)+'"]');if(h)return s.instance=h,Jt(h),h;var y=M({},d,{"data-href":d.href,"data-precedence":d.precedence,href:null,precedence:null});return h=(o.ownerDocument||o).createElement("style"),Jt(h),dn(h,"style",y),Ac(h,d.precedence,o),s.instance=h;case"stylesheet":y=Vi(d.href);var E=o.querySelector(ks(y));if(E)return s.state.loading|=4,s.instance=E,Jt(E),E;h=R1(d),(y=fr.get(y))&&qg(h,y),E=(o.ownerDocument||o).createElement("link"),Jt(E);var F=E;return F._p=new Promise(function($,K){F.onload=$,F.onerror=K}),dn(E,"link",h),s.state.loading|=4,Ac(E,d.precedence,o),s.instance=E;case"script":return E=Wi(d.src),(y=o.querySelector(As(E)))?(s.instance=y,Jt(y),y):(h=d,(y=fr.get(E))&&(h=M({},d),Vg(h,y)),o=o.ownerDocument||o,y=o.createElement("script"),Jt(y),dn(y,"link",h),o.head.appendChild(y),s.instance=y);case"void":return null;default:throw Error(r(443,s.type))}else s.type==="stylesheet"&&!(s.state.loading&4)&&(h=s.instance,s.state.loading|=4,Ac(h,d.precedence,o));return s.instance}function Ac(o,s,d){for(var h=d.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),y=h.length?h[h.length-1]:null,E=y,F=0;F title"):null)}function Z6(o,s,d){if(d===1||s.itemProp!=null)return!1;switch(o){case"meta":case"title":return!0;case"style":if(typeof s.precedence!="string"||typeof s.href!="string"||s.href==="")break;return!0;case"link":if(typeof s.rel!="string"||typeof s.href!="string"||s.href===""||s.onLoad||s.onError)break;switch(s.rel){case"stylesheet":return o=s.disabled,typeof s.precedence=="string"&&o==null;default:return!0}case"script":if(s.async&&typeof s.async!="function"&&typeof s.async!="symbol"&&!s.onLoad&&!s.onError&&s.src&&typeof s.src=="string")return!0}return!1}function D1(o){return!(o.type==="stylesheet"&&!(o.state.loading&3))}var Ts=null;function Q6(){}function J6(o,s,d){if(Ts===null)throw Error(r(475));var h=Ts;if(s.type==="stylesheet"&&(typeof d.media!="string"||matchMedia(d.media).matches!==!1)&&!(s.state.loading&4)){if(s.instance===null){var y=Vi(d.href),E=o.querySelector(ks(y));if(E){o=E._p,o!==null&&typeof o=="object"&&typeof o.then=="function"&&(h.count++,h=_c.bind(h),o.then(h,h)),s.state.loading|=4,s.instance=E,Jt(E);return}E=o.ownerDocument||o,d=R1(d),(y=fr.get(y))&&qg(d,y),E=E.createElement("link"),Jt(E);var F=E;F._p=new Promise(function($,K){F.onload=$,F.onerror=K}),dn(E,"link",d),s.instance=E}h.stylesheets===null&&(h.stylesheets=new Map),h.stylesheets.set(s,o),(o=s.state.preload)&&!(s.state.loading&3)&&(h.count++,s=_c.bind(h),o.addEventListener("load",s),o.addEventListener("error",s))}}function eH(){if(Ts===null)throw Error(r(475));var o=Ts;return o.stylesheets&&o.count===0&&Wg(o,o.stylesheets),0"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),nh.exports=EH(),nh.exports}var xH=wH();const eR=e=>{let t;const n=new Set,r=(f,p)=>{const g=typeof f=="function"?f(t):f;if(!Object.is(g,t)){const b=t;t=p??(typeof g!="object"||g===null)?g:Object.assign({},t,g),n.forEach(m=>m(t,b))}},a=()=>t,u={setState:r,getState:a,getInitialState:()=>c,subscribe:f=>(n.add(f),()=>n.delete(f))},c=t=e(r,a,u);return u},kH=e=>e?eR(e):eR,AH=e=>e;function TH(e,t=AH){const n=ye.useSyncExternalStore(e.subscribe,()=>t(e.getState()),()=>t(e.getInitialState()));return ye.useDebugValue(n),n}const _H=e=>{const t=kH(e),n=r=>TH(t,r);return Object.assign(n,t),n},wk=e=>_H;function bz(e,t){let n;try{n=e()}catch{return}return{getItem:a=>{var i;const l=c=>c===null?null:JSON.parse(c,void 0),u=(i=n.getItem(a))!=null?i:null;return u instanceof Promise?u.then(l):l(u)},setItem:(a,i)=>n.setItem(a,JSON.stringify(i,void 0)),removeItem:a=>n.removeItem(a)}}const dx=e=>t=>{try{const n=e(t);return n instanceof Promise?n:{then(r){return dx(r)(n)},catch(r){return this}}}catch(n){return{then(r){return this},catch(r){return dx(r)(n)}}}},RH=(e,t)=>(n,r,a)=>{let i={storage:bz(()=>localStorage),partialize:v=>v,version:0,merge:(v,A)=>({...A,...v}),...t},l=!1;const u=new Set,c=new Set;let f=i.storage;if(!f)return e((...v)=>{console.warn(`[zustand persist middleware] Unable to update item '${i.name}', the given storage is currently unavailable.`),n(...v)},r,a);const p=()=>{const v=i.partialize({...r()});return f.setItem(i.name,{state:v,version:i.version})},g=a.setState;a.setState=(v,A)=>{g(v,A),p()};const b=e((...v)=>{n(...v),p()},r,a);a.getInitialState=()=>b;let m;const S=()=>{var v,A;if(!f)return;l=!1,u.forEach(x=>{var _;return x((_=r())!=null?_:b)});const R=((A=i.onRehydrateStorage)==null?void 0:A.call(i,(v=r())!=null?v:b))||void 0;return dx(f.getItem.bind(f))(i.name).then(x=>{if(x)if(typeof x.version=="number"&&x.version!==i.version){if(i.migrate){const _=i.migrate(x.state,x.version);return _ instanceof Promise?_.then(C=>[!0,C]):[!0,_]}console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,x.state];return[!1,void 0]}).then(x=>{var _;const[C,N]=x;if(m=i.merge(N,(_=r())!=null?_:b),n(m,!0),C)return p()}).then(()=>{R==null||R(m,void 0),m=r(),l=!0,c.forEach(x=>x(m))}).catch(x=>{R==null||R(void 0,x)})};return a.persist={setOptions:v=>{i={...i,...v},v.storage&&(f=v.storage)},clearStorage:()=>{f==null||f.removeItem(i.name)},getOptions:()=>i,rehydrate:()=>S(),hasHydrated:()=>l,onHydrate:v=>(u.add(v),()=>{u.delete(v)}),onFinishHydration:v=>(c.add(v),()=>{c.delete(v)})},i.skipHydration||S(),m||b},CH=RH;function yz(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var a=e.length;for(t=0;t{const t=DH(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:l=>{const u=l.split(xk);return u[0]===""&&u.length!==1&&u.shift(),Sz(u,t)||OH(l)},getConflictingClassGroupIds:(l,u)=>{const c=n[l]||[];return u&&r[l]?[...c,...r[l]]:c}}},Sz=(e,t)=>{var l;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),a=r?Sz(e.slice(1),r):void 0;if(a)return a;if(t.validators.length===0)return;const i=e.join(xk);return(l=t.validators.find(({validator:u})=>u(i)))==null?void 0:l.classGroupId},tR=/^\[(.+)\]$/,OH=e=>{if(tR.test(e)){const t=tR.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},DH=e=>{const{theme:t,classGroups:n}=e,r={nextPart:new Map,validators:[]};for(const a in n)fx(n[a],r,a,t);return r},fx=(e,t,n,r)=>{e.forEach(a=>{if(typeof a=="string"){const i=a===""?t:nR(t,a);i.classGroupId=n;return}if(typeof a=="function"){if(IH(a)){fx(a(r),t,n,r);return}t.validators.push({validator:a,classGroupId:n});return}Object.entries(a).forEach(([i,l])=>{fx(l,nR(t,i),n,r)})})},nR=(e,t)=>{let n=e;return t.split(xk).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},IH=e=>e.isThemeGetter,LH=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const a=(i,l)=>{n.set(i,l),t++,t>e&&(t=0,r=n,n=new Map)};return{get(i){let l=n.get(i);if(l!==void 0)return l;if((l=r.get(i))!==void 0)return a(i,l),l},set(i,l){n.has(i)?n.set(i,l):a(i,l)}}},px="!",gx=":",MH=gx.length,FH=e=>{const{prefix:t,experimentalParseClassName:n}=e;let r=a=>{const i=[];let l=0,u=0,c=0,f;for(let S=0;Sc?f-c:void 0;return{modifiers:i,hasImportantModifier:b,baseClassName:g,maybePostfixModifierPosition:m}};if(t){const a=t+gx,i=r;r=l=>l.startsWith(a)?i(l.substring(a.length)):{isExternal:!0,modifiers:[],hasImportantModifier:!1,baseClassName:l,maybePostfixModifierPosition:void 0}}if(n){const a=r;r=i=>n({className:i,parseClassName:a})}return r},zH=e=>e.endsWith(px)?e.substring(0,e.length-1):e.startsWith(px)?e.substring(1):e,PH=e=>{const t=Object.fromEntries(e.orderSensitiveModifiers.map(r=>[r,!0]));return r=>{if(r.length<=1)return r;const a=[];let i=[];return r.forEach(l=>{l[0]==="["||t[l]?(a.push(...i.sort(),l),i=[]):i.push(l)}),a.push(...i.sort()),a}},BH=e=>({cache:LH(e.cacheSize),parseClassName:FH(e),sortModifiers:PH(e),...NH(e)}),UH=/\s+/,jH=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:a,sortModifiers:i}=t,l=[],u=e.trim().split(UH);let c="";for(let f=u.length-1;f>=0;f-=1){const p=u[f],{isExternal:g,modifiers:b,hasImportantModifier:m,baseClassName:S,maybePostfixModifierPosition:v}=n(p);if(g){c=p+(c.length>0?" "+c:c);continue}let A=!!v,R=r(A?S.substring(0,v):S);if(!R){if(!A){c=p+(c.length>0?" "+c:c);continue}if(R=r(S),!R){c=p+(c.length>0?" "+c:c);continue}A=!1}const x=i(b).join(":"),_=m?x+px:x,C=_+R;if(l.includes(C))continue;l.push(C);const N=a(R,A);for(let T=0;T0?" "+c:c)}return c};function GH(){let e=0,t,n,r="";for(;e{if(typeof e=="string")return e;let t,n="";for(let r=0;rg(p),e());return n=BH(f),r=n.cache.get,a=n.cache.set,i=u,u(c)}function u(c){const f=r(c);if(f)return f;const p=jH(c,n);return a(c,p),p}return function(){return i(GH.apply(null,arguments))}}const rn=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},wz=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,xz=/^\((?:(\w[\w-]*):)?(.+)\)$/i,$H=/^\d+\/\d+$/,qH=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,VH=/\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$/,WH=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,YH=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,KH=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Yi=e=>$H.test(e),ct=e=>!!e&&!Number.isNaN(Number(e)),Wo=e=>!!e&&Number.isInteger(Number(e)),rR=e=>e.endsWith("%")&&ct(e.slice(0,-1)),oo=e=>qH.test(e),XH=()=>!0,ZH=e=>VH.test(e)&&!WH.test(e),kk=()=>!1,QH=e=>YH.test(e),JH=e=>KH.test(e),e9=e=>!je(e)&&!Ge(e),t9=e=>xl(e,Tz,kk),je=e=>wz.test(e),Yo=e=>xl(e,_z,ZH),ih=e=>xl(e,f9,ct),n9=e=>xl(e,kz,kk),r9=e=>xl(e,Az,JH),a9=e=>xl(e,kk,QH),Ge=e=>xz.test(e),Fc=e=>kl(e,_z),o9=e=>kl(e,p9),i9=e=>kl(e,kz),l9=e=>kl(e,Tz),s9=e=>kl(e,Az),u9=e=>kl(e,g9,!0),xl=(e,t,n)=>{const r=wz.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},kl=(e,t,n=!1)=>{const r=xz.exec(e);return r?r[1]?t(r[1]):n:!1},kz=e=>e==="position",c9=new Set(["image","url"]),Az=e=>c9.has(e),d9=new Set(["length","size","percentage"]),Tz=e=>d9.has(e),_z=e=>e==="length",f9=e=>e==="number",p9=e=>e==="family-name",g9=e=>e==="shadow",h9=()=>{const e=rn("color"),t=rn("font"),n=rn("text"),r=rn("font-weight"),a=rn("tracking"),i=rn("leading"),l=rn("breakpoint"),u=rn("container"),c=rn("spacing"),f=rn("radius"),p=rn("shadow"),g=rn("inset-shadow"),b=rn("drop-shadow"),m=rn("blur"),S=rn("perspective"),v=rn("aspect"),A=rn("ease"),R=rn("animate"),x=()=>["auto","avoid","all","avoid-page","page","left","right","column"],_=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],C=()=>["auto","hidden","clip","visible","scroll"],N=()=>["auto","contain","none"],T=()=>[Ge,je,c],O=()=>[Yi,"full","auto",...T()],z=()=>[Wo,"none","subgrid",Ge,je],I=()=>["auto",{span:["full",Wo,Ge,je]},Ge,je],M=()=>[Wo,"auto",Ge,je],H=()=>["auto","min","max","fr",Ge,je],q=()=>["start","end","center","between","around","evenly","stretch","baseline"],U=()=>["start","end","center","stretch"],W=()=>["auto",...T()],Z=()=>[Yi,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...T()],j=()=>[e,Ge,je],G=()=>[rR,Yo],P=()=>["","none","full",f,Ge,je],X=()=>["",ct,Fc,Yo],D=()=>["solid","dashed","dotted","double"],V=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],B=()=>["","none",m,Ge,je],L=()=>["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",Ge,je],Y=()=>["none",ct,Ge,je],Q=()=>["none",ct,Ge,je],se=()=>[ct,Ge,je],re=()=>[Yi,"full",...T()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[oo],breakpoint:[oo],color:[XH],container:[oo],"drop-shadow":[oo],ease:["in","out","in-out"],font:[e9],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[oo],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[oo],shadow:[oo],spacing:["px",ct],text:[oo],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Yi,je,Ge,v]}],container:["container"],columns:[{columns:[ct,je,Ge,u]}],"break-after":[{"break-after":x()}],"break-before":[{"break-before":x()}],"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:[..._(),je,Ge]}],overflow:[{overflow:C()}],"overflow-x":[{"overflow-x":C()}],"overflow-y":[{"overflow-y":C()}],overscroll:[{overscroll:N()}],"overscroll-x":[{"overscroll-x":N()}],"overscroll-y":[{"overscroll-y":N()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:O()}],"inset-x":[{"inset-x":O()}],"inset-y":[{"inset-y":O()}],start:[{start:O()}],end:[{end:O()}],top:[{top:O()}],right:[{right:O()}],bottom:[{bottom:O()}],left:[{left:O()}],visibility:["visible","invisible","collapse"],z:[{z:[Wo,"auto",Ge,je]}],basis:[{basis:[Yi,"full","auto",u,...T()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[ct,Yi,"auto","initial","none",je]}],grow:[{grow:["",ct,Ge,je]}],shrink:[{shrink:["",ct,Ge,je]}],order:[{order:[Wo,"first","last","none",Ge,je]}],"grid-cols":[{"grid-cols":z()}],"col-start-end":[{col:I()}],"col-start":[{"col-start":M()}],"col-end":[{"col-end":M()}],"grid-rows":[{"grid-rows":z()}],"row-start-end":[{row:I()}],"row-start":[{"row-start":M()}],"row-end":[{"row-end":M()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":H()}],"auto-rows":[{"auto-rows":H()}],gap:[{gap:T()}],"gap-x":[{"gap-x":T()}],"gap-y":[{"gap-y":T()}],"justify-content":[{justify:[...q(),"normal"]}],"justify-items":[{"justify-items":[...U(),"normal"]}],"justify-self":[{"justify-self":["auto",...U()]}],"align-content":[{content:["normal",...q()]}],"align-items":[{items:[...U(),"baseline"]}],"align-self":[{self:["auto",...U(),"baseline"]}],"place-content":[{"place-content":q()}],"place-items":[{"place-items":[...U(),"baseline"]}],"place-self":[{"place-self":["auto",...U()]}],p:[{p:T()}],px:[{px:T()}],py:[{py:T()}],ps:[{ps:T()}],pe:[{pe:T()}],pt:[{pt:T()}],pr:[{pr:T()}],pb:[{pb:T()}],pl:[{pl:T()}],m:[{m:W()}],mx:[{mx:W()}],my:[{my:W()}],ms:[{ms:W()}],me:[{me:W()}],mt:[{mt:W()}],mr:[{mr:W()}],mb:[{mb:W()}],ml:[{ml:W()}],"space-x":[{"space-x":T()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":T()}],"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:[l]},...Z()]}],h:[{h:["screen",...Z()]}],"min-h":[{"min-h":["screen","none",...Z()]}],"max-h":[{"max-h":["screen",...Z()]}],"font-size":[{text:["base",n,Fc,Yo]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,Ge,ih]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",rR,je]}],"font-family":[{font:[o9,je,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:[a,Ge,je]}],"line-clamp":[{"line-clamp":[ct,"none",Ge,ih]}],leading:[{leading:[i,...T()]}],"list-image":[{"list-image":["none",Ge,je]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Ge,je]}],"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:[...D(),"wavy"]}],"text-decoration-thickness":[{decoration:[ct,"from-font","auto",Ge,Yo]}],"text-decoration-color":[{decoration:j()}],"underline-offset":[{"underline-offset":[ct,"auto",Ge,je]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:T()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Ge,je]}],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",Ge,je]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[..._(),i9,n9]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","space","round"]}]}],"bg-size":[{bg:["auto","cover","contain",l9,t9]}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Wo,Ge,je],radial:["",Ge,je],conic:[Wo,Ge,je]},s9,r9]}],"bg-color":[{bg:j()}],"gradient-from-pos":[{from:G()}],"gradient-via-pos":[{via:G()}],"gradient-to-pos":[{to:G()}],"gradient-from":[{from:j()}],"gradient-via":[{via:j()}],"gradient-to":[{to:j()}],rounded:[{rounded:P()}],"rounded-s":[{"rounded-s":P()}],"rounded-e":[{"rounded-e":P()}],"rounded-t":[{"rounded-t":P()}],"rounded-r":[{"rounded-r":P()}],"rounded-b":[{"rounded-b":P()}],"rounded-l":[{"rounded-l":P()}],"rounded-ss":[{"rounded-ss":P()}],"rounded-se":[{"rounded-se":P()}],"rounded-ee":[{"rounded-ee":P()}],"rounded-es":[{"rounded-es":P()}],"rounded-tl":[{"rounded-tl":P()}],"rounded-tr":[{"rounded-tr":P()}],"rounded-br":[{"rounded-br":P()}],"rounded-bl":[{"rounded-bl":P()}],"border-w":[{border:X()}],"border-w-x":[{"border-x":X()}],"border-w-y":[{"border-y":X()}],"border-w-s":[{"border-s":X()}],"border-w-e":[{"border-e":X()}],"border-w-t":[{"border-t":X()}],"border-w-r":[{"border-r":X()}],"border-w-b":[{"border-b":X()}],"border-w-l":[{"border-l":X()}],"divide-x":[{"divide-x":X()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":X()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...D(),"hidden","none"]}],"divide-style":[{divide:[...D(),"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:[...D(),"none","hidden"]}],"outline-offset":[{"outline-offset":[ct,Ge,je]}],"outline-w":[{outline:["",ct,Fc,Yo]}],"outline-color":[{outline:[e]}],shadow:[{shadow:["","none",p,u9,a9]}],"shadow-color":[{shadow:j()}],"inset-shadow":[{"inset-shadow":["none",Ge,je,g]}],"inset-shadow-color":[{"inset-shadow":j()}],"ring-w":[{ring:X()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:j()}],"ring-offset-w":[{"ring-offset":[ct,Yo]}],"ring-offset-color":[{"ring-offset":j()}],"inset-ring-w":[{"inset-ring":X()}],"inset-ring-color":[{"inset-ring":j()}],opacity:[{opacity:[ct,Ge,je]}],"mix-blend":[{"mix-blend":[...V(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":V()}],filter:[{filter:["","none",Ge,je]}],blur:[{blur:B()}],brightness:[{brightness:[ct,Ge,je]}],contrast:[{contrast:[ct,Ge,je]}],"drop-shadow":[{"drop-shadow":["","none",b,Ge,je]}],grayscale:[{grayscale:["",ct,Ge,je]}],"hue-rotate":[{"hue-rotate":[ct,Ge,je]}],invert:[{invert:["",ct,Ge,je]}],saturate:[{saturate:[ct,Ge,je]}],sepia:[{sepia:["",ct,Ge,je]}],"backdrop-filter":[{"backdrop-filter":["","none",Ge,je]}],"backdrop-blur":[{"backdrop-blur":B()}],"backdrop-brightness":[{"backdrop-brightness":[ct,Ge,je]}],"backdrop-contrast":[{"backdrop-contrast":[ct,Ge,je]}],"backdrop-grayscale":[{"backdrop-grayscale":["",ct,Ge,je]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[ct,Ge,je]}],"backdrop-invert":[{"backdrop-invert":["",ct,Ge,je]}],"backdrop-opacity":[{"backdrop-opacity":[ct,Ge,je]}],"backdrop-saturate":[{"backdrop-saturate":[ct,Ge,je]}],"backdrop-sepia":[{"backdrop-sepia":["",ct,Ge,je]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":T()}],"border-spacing-x":[{"border-spacing-x":T()}],"border-spacing-y":[{"border-spacing-y":T()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",Ge,je]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[ct,"initial",Ge,je]}],ease:[{ease:["linear","initial",A,Ge,je]}],delay:[{delay:[ct,Ge,je]}],animate:[{animate:["none",R,Ge,je]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[S,Ge,je]}],"perspective-origin":[{"perspective-origin":L()}],rotate:[{rotate:Y()}],"rotate-x":[{"rotate-x":Y()}],"rotate-y":[{"rotate-y":Y()}],"rotate-z":[{"rotate-z":Y()}],scale:[{scale:Q()}],"scale-x":[{"scale-x":Q()}],"scale-y":[{"scale-y":Q()}],"scale-z":[{"scale-z":Q()}],"scale-3d":["scale-3d"],skew:[{skew:se()}],"skew-x":[{"skew-x":se()}],"skew-y":[{"skew-y":se()}],transform:[{transform:[Ge,je,"","none","gpu","cpu"]}],"transform-origin":[{origin:L()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:re()}],"translate-x":[{"translate-x":re()}],"translate-y":[{"translate-y":re()}],"translate-z":[{"translate-z":re()}],"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",Ge,je]}],"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":T()}],"scroll-mx":[{"scroll-mx":T()}],"scroll-my":[{"scroll-my":T()}],"scroll-ms":[{"scroll-ms":T()}],"scroll-me":[{"scroll-me":T()}],"scroll-mt":[{"scroll-mt":T()}],"scroll-mr":[{"scroll-mr":T()}],"scroll-mb":[{"scroll-mb":T()}],"scroll-ml":[{"scroll-ml":T()}],"scroll-p":[{"scroll-p":T()}],"scroll-px":[{"scroll-px":T()}],"scroll-py":[{"scroll-py":T()}],"scroll-ps":[{"scroll-ps":T()}],"scroll-pe":[{"scroll-pe":T()}],"scroll-pt":[{"scroll-pt":T()}],"scroll-pr":[{"scroll-pr":T()}],"scroll-pb":[{"scroll-pb":T()}],"scroll-pl":[{"scroll-pl":T()}],"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",Ge,je]}],fill:[{fill:["none",...j()]}],"stroke-w":[{stroke:[ct,Fc,Yo,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","*","**"]}},m9=HH(h9);function Me(...e){return m9(vz(e))}function b9(){const e="0123456789abcdef";let t="#";for(let n=0;n<6;n++)t+=e.charAt(Math.floor(Math.random()*16));return t}function Nr(e){return e instanceof Error?e.message:`${e}`}const Ak=e=>{const t=e;t.use={};for(const n of Object.keys(t.getState()))t.use[n]=()=>t(r=>r[n]);return t},Rz="",Yr="ghost",y9="#B2EBF2",v9="#000",S9="#E2E2E2",E9="#EEEEEE",w9="#F57F17",x9="#969696",k9="#F57F17",aR="#B2EBF2",lh=20,sh=40,oR=4,A9=20,T9=15,iR="*",_9={"text/plain":[".txt",".md",".html",".htm",".tex",".json",".xml",".yaml",".yml",".rtf",".odt",".epub",".csv",".log",".conf",".ini",".properties",".sql",".bat",".sh",".c",".cpp",".py",".java",".js",".ts",".swift",".go",".rb",".php",".css",".scss",".less"],"application/pdf":[".pdf"],"application/msword":[".doc"],"application/vnd.openxmlformats-officedocument.wordprocessingml.document":[".docx"],"application/vnd.openxmlformats-officedocument.presentationml.presentation":[".pptx"]},lR={name:"LightRAG",github:"https://github.com/HKUDS/LightRAG"},R9=wk()(CH(e=>({theme:"system",showPropertyPanel:!0,showNodeSearchBar:!0,showNodeLabel:!0,enableNodeDrag:!0,showEdgeLabel:!1,enableHideUnselectedEdges:!0,enableEdgeEvents:!1,graphQueryMaxDepth:3,graphLayoutMaxIterations:10,queryLabel:iR,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}),setGraphLayoutMaxIterations:t=>e({graphLayoutMaxIterations:t}),setQueryLabel:t=>e({queryLabel:t}),setGraphQueryMaxDepth:t=>e({graphQueryMaxDepth: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:bz(()=>localStorage),version:7,migrate:(e,t)=>(t<2&&(e.showEdgeLabel=!1),t<3&&(e.queryLabel=iR),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=[]),t<7&&(e.graphQueryMaxDepth=3,e.graphLayoutMaxIterations=10),e)})),Ke=Ak(R9),C9={theme:"system",setTheme:()=>null},Cz=k.createContext(C9);function N9({children:e,...t}){const[n,r]=k.useState(Ke.getState().theme);k.useEffect(()=>{const i=window.document.documentElement;if(i.classList.remove("light","dark"),n==="system"){const l=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";i.classList.add(l),r(l);return}i.classList.add(n)},[n]);const a={theme:n,setTheme:i=>{Ke.getState().setTheme(i),r(i)}};return w.jsx(Cz.Provider,{...t,value:a,children:e})}const sR=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,uR=vz,Nz=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return uR(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:a,defaultVariants:i}=t,l=Object.keys(a).map(f=>{const p=n==null?void 0:n[f],g=i==null?void 0:i[f];if(p===null)return null;const b=sR(p)||sR(g);return a[f][b]}),u=n&&Object.entries(n).reduce((f,p)=>{let[g,b]=p;return b===void 0||(f[g]=b),f},{}),c=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((f,p)=>{let{class:g,className:b,...m}=p;return Object.entries(m).every(S=>{let[v,A]=S;return Array.isArray(A)?A.includes({...i,...u}[v]):{...i,...u}[v]===A})?[...f,g,b]:f},[]);return uR(e,l,c,n==null?void 0:n.class,n==null?void 0:n.className)},O9=Nz("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"}}),Oz=k.forwardRef(({className:e,variant:t,...n},r)=>w.jsx("div",{ref:r,role:"alert",className:Me(O9({variant:t}),e),...n}));Oz.displayName="Alert";const Dz=k.forwardRef(({className:e,...t},n)=>w.jsx("h5",{ref:n,className:Me("mb-1 leading-none font-medium tracking-tight",e),...t}));Dz.displayName="AlertTitle";const Iz=k.forwardRef(({className:e,...t},n)=>w.jsx("div",{ref:n,className:Me("text-sm [&_p]:leading-relaxed",e),...t}));Iz.displayName="AlertDescription";function Lz(e,t){return function(){return e.apply(t,arguments)}}const{toString:D9}=Object.prototype,{getPrototypeOf:Tk}=Object,rf=(e=>t=>{const n=D9.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),Lr=e=>(e=e.toLowerCase(),t=>rf(t)===e),af=e=>t=>typeof t===e,{isArray:Al}=Array,Qs=af("undefined");function I9(e){return e!==null&&!Qs(e)&&e.constructor!==null&&!Qs(e.constructor)&&Xn(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const Mz=Lr("ArrayBuffer");function L9(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&Mz(e.buffer),t}const M9=af("string"),Xn=af("function"),Fz=af("number"),of=e=>e!==null&&typeof e=="object",F9=e=>e===!0||e===!1,fd=e=>{if(rf(e)!=="object")return!1;const t=Tk(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)},z9=Lr("Date"),P9=Lr("File"),B9=Lr("Blob"),U9=Lr("FileList"),j9=e=>of(e)&&Xn(e.pipe),G9=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||Xn(e.append)&&((t=rf(e))==="formdata"||t==="object"&&Xn(e.toString)&&e.toString()==="[object FormData]"))},H9=Lr("URLSearchParams"),[$9,q9,V9,W9]=["ReadableStream","Request","Response","Headers"].map(Lr),Y9=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function du(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let r,a;if(typeof e!="object"&&(e=[e]),Al(e))for(r=0,a=e.length;r0;)if(a=n[r],t===a.toLowerCase())return a;return null}const ti=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,Pz=e=>!Qs(e)&&e!==ti;function hx(){const{caseless:e}=Pz(this)&&this||{},t={},n=(r,a)=>{const i=e&&zz(t,a)||a;fd(t[i])&&fd(r)?t[i]=hx(t[i],r):fd(r)?t[i]=hx({},r):Al(r)?t[i]=r.slice():t[i]=r};for(let r=0,a=arguments.length;r(du(t,(a,i)=>{n&&Xn(a)?e[i]=Lz(a,n):e[i]=a},{allOwnKeys:r}),e),X9=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),Z9=(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},Q9=(e,t,n,r)=>{let a,i,l;const u={};if(t=t||{},e==null)return t;do{for(a=Object.getOwnPropertyNames(e),i=a.length;i-- >0;)l=a[i],(!r||r(l,e,t))&&!u[l]&&(t[l]=e[l],u[l]=!0);e=n!==!1&&Tk(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},J9=(e,t,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return r!==-1&&r===n},e$=e=>{if(!e)return null;if(Al(e))return e;let t=e.length;if(!Fz(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},t$=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&Tk(Uint8Array)),n$=(e,t)=>{const r=(e&&e[Symbol.iterator]).call(e);let a;for(;(a=r.next())&&!a.done;){const i=a.value;t.call(e,i[0],i[1])}},r$=(e,t)=>{let n;const r=[];for(;(n=e.exec(t))!==null;)r.push(n);return r},a$=Lr("HTMLFormElement"),o$=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,a){return r.toUpperCase()+a}),cR=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),i$=Lr("RegExp"),Bz=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};du(n,(a,i)=>{let l;(l=t(a,i,e))!==!1&&(r[i]=l||a)}),Object.defineProperties(e,r)},l$=e=>{Bz(e,(t,n)=>{if(Xn(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=e[n];if(Xn(r)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},s$=(e,t)=>{const n={},r=a=>{a.forEach(i=>{n[i]=!0})};return Al(e)?r(e):r(String(e).split(t)),n},u$=()=>{},c$=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t,uh="abcdefghijklmnopqrstuvwxyz",dR="0123456789",Uz={DIGIT:dR,ALPHA:uh,ALPHA_DIGIT:uh+uh.toUpperCase()+dR},d$=(e=16,t=Uz.ALPHA_DIGIT)=>{let n="";const{length:r}=t;for(;e--;)n+=t[Math.random()*r|0];return n};function f$(e){return!!(e&&Xn(e.append)&&e[Symbol.toStringTag]==="FormData"&&e[Symbol.iterator])}const p$=e=>{const t=new Array(10),n=(r,a)=>{if(of(r)){if(t.indexOf(r)>=0)return;if(!("toJSON"in r)){t[a]=r;const i=Al(r)?[]:{};return du(r,(l,u)=>{const c=n(l,a+1);!Qs(c)&&(i[u]=c)}),t[a]=void 0,i}}return r};return n(e,0)},g$=Lr("AsyncFunction"),h$=e=>e&&(of(e)||Xn(e))&&Xn(e.then)&&Xn(e.catch),jz=((e,t)=>e?setImmediate:t?((n,r)=>(ti.addEventListener("message",({source:a,data:i})=>{a===ti&&i===n&&r.length&&r.shift()()},!1),a=>{r.push(a),ti.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",Xn(ti.postMessage)),m$=typeof queueMicrotask<"u"?queueMicrotask.bind(ti):typeof process<"u"&&process.nextTick||jz,pe={isArray:Al,isArrayBuffer:Mz,isBuffer:I9,isFormData:G9,isArrayBufferView:L9,isString:M9,isNumber:Fz,isBoolean:F9,isObject:of,isPlainObject:fd,isReadableStream:$9,isRequest:q9,isResponse:V9,isHeaders:W9,isUndefined:Qs,isDate:z9,isFile:P9,isBlob:B9,isRegExp:i$,isFunction:Xn,isStream:j9,isURLSearchParams:H9,isTypedArray:t$,isFileList:U9,forEach:du,merge:hx,extend:K9,trim:Y9,stripBOM:X9,inherits:Z9,toFlatObject:Q9,kindOf:rf,kindOfTest:Lr,endsWith:J9,toArray:e$,forEachEntry:n$,matchAll:r$,isHTMLForm:a$,hasOwnProperty:cR,hasOwnProp:cR,reduceDescriptors:Bz,freezeMethods:l$,toObjectSet:s$,toCamelCase:o$,noop:u$,toFiniteNumber:c$,findKey:zz,global:ti,isContextDefined:Pz,ALPHABET:Uz,generateString:d$,isSpecCompliantForm:f$,toJSONObject:p$,isAsyncFn:g$,isThenable:h$,setImmediate:jz,asap:m$};function nt(e,t,n,r,a){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),a&&(this.response=a,this.status=a.status?a.status:null)}pe.inherits(nt,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:pe.toJSONObject(this.config),code:this.code,status:this.status}}});const Gz=nt.prototype,Hz={};["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=>{Hz[e]={value:e}});Object.defineProperties(nt,Hz);Object.defineProperty(Gz,"isAxiosError",{value:!0});nt.from=(e,t,n,r,a,i)=>{const l=Object.create(Gz);return pe.toFlatObject(e,l,function(c){return c!==Error.prototype},u=>u!=="isAxiosError"),nt.call(l,e.message,t,n,r,a),l.cause=e,l.name=e.name,i&&Object.assign(l,i),l};const b$=null;function mx(e){return pe.isPlainObject(e)||pe.isArray(e)}function $z(e){return pe.endsWith(e,"[]")?e.slice(0,-2):e}function fR(e,t,n){return e?e.concat(t).map(function(a,i){return a=$z(a),!n&&i?"["+a+"]":a}).join(n?".":""):t}function y$(e){return pe.isArray(e)&&!e.some(mx)}const v$=pe.toFlatObject(pe,{},null,function(t){return/^is[A-Z]/.test(t)});function lf(e,t,n){if(!pe.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,n=pe.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(v,A){return!pe.isUndefined(A[v])});const r=n.metaTokens,a=n.visitor||p,i=n.dots,l=n.indexes,c=(n.Blob||typeof Blob<"u"&&Blob)&&pe.isSpecCompliantForm(t);if(!pe.isFunction(a))throw new TypeError("visitor must be a function");function f(S){if(S===null)return"";if(pe.isDate(S))return S.toISOString();if(!c&&pe.isBlob(S))throw new nt("Blob is not supported. Use a Buffer instead.");return pe.isArrayBuffer(S)||pe.isTypedArray(S)?c&&typeof Blob=="function"?new Blob([S]):Buffer.from(S):S}function p(S,v,A){let R=S;if(S&&!A&&typeof S=="object"){if(pe.endsWith(v,"{}"))v=r?v:v.slice(0,-2),S=JSON.stringify(S);else if(pe.isArray(S)&&y$(S)||(pe.isFileList(S)||pe.endsWith(v,"[]"))&&(R=pe.toArray(S)))return v=$z(v),R.forEach(function(_,C){!(pe.isUndefined(_)||_===null)&&t.append(l===!0?fR([v],C,i):l===null?v:v+"[]",f(_))}),!1}return mx(S)?!0:(t.append(fR(A,v,i),f(S)),!1)}const g=[],b=Object.assign(v$,{defaultVisitor:p,convertValue:f,isVisitable:mx});function m(S,v){if(!pe.isUndefined(S)){if(g.indexOf(S)!==-1)throw Error("Circular reference detected in "+v.join("."));g.push(S),pe.forEach(S,function(R,x){(!(pe.isUndefined(R)||R===null)&&a.call(t,R,pe.isString(x)?x.trim():x,v,b))===!0&&m(R,v?v.concat(x):[x])}),g.pop()}}if(!pe.isObject(e))throw new TypeError("data must be an object");return m(e),t}function pR(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(r){return t[r]})}function _k(e,t){this._pairs=[],e&&lf(e,this,t)}const qz=_k.prototype;qz.append=function(t,n){this._pairs.push([t,n])};qz.toString=function(t){const n=t?function(r){return t.call(this,r,pR)}:pR;return this._pairs.map(function(a){return n(a[0])+"="+n(a[1])},"").join("&")};function S$(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Vz(e,t,n){if(!t)return e;const r=n&&n.encode||S$;pe.isFunction(n)&&(n={serialize:n});const a=n&&n.serialize;let i;if(a?i=a(t,n):i=pe.isURLSearchParams(t)?t.toString():new _k(t,n).toString(r),i){const l=e.indexOf("#");l!==-1&&(e=e.slice(0,l)),e+=(e.indexOf("?")===-1?"?":"&")+i}return e}class gR{constructor(){this.handlers=[]}use(t,n,r){return this.handlers.push({fulfilled:t,rejected:n,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){pe.forEach(this.handlers,function(r){r!==null&&t(r)})}}const Wz={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},E$=typeof URLSearchParams<"u"?URLSearchParams:_k,w$=typeof FormData<"u"?FormData:null,x$=typeof Blob<"u"?Blob:null,k$={isBrowser:!0,classes:{URLSearchParams:E$,FormData:w$,Blob:x$},protocols:["http","https","file","blob","url","data"]},Rk=typeof window<"u"&&typeof document<"u",bx=typeof navigator=="object"&&navigator||void 0,A$=Rk&&(!bx||["ReactNative","NativeScript","NS"].indexOf(bx.product)<0),T$=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",_$=Rk&&window.location.href||"http://localhost",R$=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:Rk,hasStandardBrowserEnv:A$,hasStandardBrowserWebWorkerEnv:T$,navigator:bx,origin:_$},Symbol.toStringTag,{value:"Module"})),yn={...R$,...k$};function C$(e,t){return lf(e,new yn.classes.URLSearchParams,Object.assign({visitor:function(n,r,a,i){return yn.isNode&&pe.isBuffer(n)?(this.append(r,n.toString("base64")),!1):i.defaultVisitor.apply(this,arguments)}},t))}function N$(e){return pe.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function O$(e){const t={},n=Object.keys(e);let r;const a=n.length;let i;for(r=0;r=n.length;return l=!l&&pe.isArray(a)?a.length:l,c?(pe.hasOwnProp(a,l)?a[l]=[a[l],r]:a[l]=r,!u):((!a[l]||!pe.isObject(a[l]))&&(a[l]=[]),t(n,r,a[l],i)&&pe.isArray(a[l])&&(a[l]=O$(a[l])),!u)}if(pe.isFormData(e)&&pe.isFunction(e.entries)){const n={};return pe.forEachEntry(e,(r,a)=>{t(N$(r),a,n,0)}),n}return null}function D$(e,t,n){if(pe.isString(e))try{return(t||JSON.parse)(e),pe.trim(e)}catch(r){if(r.name!=="SyntaxError")throw r}return(n||JSON.stringify)(e)}const fu={transitional:Wz,adapter:["xhr","http","fetch"],transformRequest:[function(t,n){const r=n.getContentType()||"",a=r.indexOf("application/json")>-1,i=pe.isObject(t);if(i&&pe.isHTMLForm(t)&&(t=new FormData(t)),pe.isFormData(t))return a?JSON.stringify(Yz(t)):t;if(pe.isArrayBuffer(t)||pe.isBuffer(t)||pe.isStream(t)||pe.isFile(t)||pe.isBlob(t)||pe.isReadableStream(t))return t;if(pe.isArrayBufferView(t))return t.buffer;if(pe.isURLSearchParams(t))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let u;if(i){if(r.indexOf("application/x-www-form-urlencoded")>-1)return C$(t,this.formSerializer).toString();if((u=pe.isFileList(t))||r.indexOf("multipart/form-data")>-1){const c=this.env&&this.env.FormData;return lf(u?{"files[]":t}:t,c&&new c,this.formSerializer)}}return i||a?(n.setContentType("application/json",!1),D$(t)):t}],transformResponse:[function(t){const n=this.transitional||fu.transitional,r=n&&n.forcedJSONParsing,a=this.responseType==="json";if(pe.isResponse(t)||pe.isReadableStream(t))return t;if(t&&pe.isString(t)&&(r&&!this.responseType||a)){const l=!(n&&n.silentJSONParsing)&&a;try{return JSON.parse(t)}catch(u){if(l)throw u.name==="SyntaxError"?nt.from(u,nt.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:yn.classes.FormData,Blob:yn.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};pe.forEach(["delete","get","head","post","put","patch"],e=>{fu.headers[e]={}});const I$=pe.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"]),L$=e=>{const t={};let n,r,a;return e&&e.split(` +`).forEach(function(l){a=l.indexOf(":"),n=l.substring(0,a).trim().toLowerCase(),r=l.substring(a+1).trim(),!(!n||t[n]&&I$[n])&&(n==="set-cookie"?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)}),t},hR=Symbol("internals");function Ls(e){return e&&String(e).trim().toLowerCase()}function pd(e){return e===!1||e==null?e:pe.isArray(e)?e.map(pd):String(e)}function M$(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}const F$=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function ch(e,t,n,r,a){if(pe.isFunction(r))return r.call(this,t,n);if(a&&(t=n),!!pe.isString(t)){if(pe.isString(r))return t.indexOf(r)!==-1;if(pe.isRegExp(r))return r.test(t)}}function z$(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,r)=>n.toUpperCase()+r)}function P$(e,t){const n=pe.toCamelCase(" "+t);["get","set","has"].forEach(r=>{Object.defineProperty(e,r+n,{value:function(a,i,l){return this[r].call(this,t,a,i,l)},configurable:!0})})}let zn=class{constructor(t){t&&this.set(t)}set(t,n,r){const a=this;function i(u,c,f){const p=Ls(c);if(!p)throw new Error("header name must be a non-empty string");const g=pe.findKey(a,p);(!g||a[g]===void 0||f===!0||f===void 0&&a[g]!==!1)&&(a[g||c]=pd(u))}const l=(u,c)=>pe.forEach(u,(f,p)=>i(f,p,c));if(pe.isPlainObject(t)||t instanceof this.constructor)l(t,n);else if(pe.isString(t)&&(t=t.trim())&&!F$(t))l(L$(t),n);else if(pe.isHeaders(t))for(const[u,c]of t.entries())i(c,u,r);else t!=null&&i(n,t,r);return this}get(t,n){if(t=Ls(t),t){const r=pe.findKey(this,t);if(r){const a=this[r];if(!n)return a;if(n===!0)return M$(a);if(pe.isFunction(n))return n.call(this,a,r);if(pe.isRegExp(n))return n.exec(a);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,n){if(t=Ls(t),t){const r=pe.findKey(this,t);return!!(r&&this[r]!==void 0&&(!n||ch(this,this[r],r,n)))}return!1}delete(t,n){const r=this;let a=!1;function i(l){if(l=Ls(l),l){const u=pe.findKey(r,l);u&&(!n||ch(r,r[u],u,n))&&(delete r[u],a=!0)}}return pe.isArray(t)?t.forEach(i):i(t),a}clear(t){const n=Object.keys(this);let r=n.length,a=!1;for(;r--;){const i=n[r];(!t||ch(this,this[i],i,t,!0))&&(delete this[i],a=!0)}return a}normalize(t){const n=this,r={};return pe.forEach(this,(a,i)=>{const l=pe.findKey(r,i);if(l){n[l]=pd(a),delete n[i];return}const u=t?z$(i):String(i).trim();u!==i&&delete n[i],n[u]=pd(a),r[u]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const n=Object.create(null);return pe.forEach(this,(r,a)=>{r!=null&&r!==!1&&(n[a]=t&&pe.isArray(r)?r.join(", "):r)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,n])=>t+": "+n).join(` +`)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...n){const r=new this(t);return n.forEach(a=>r.set(a)),r}static accessor(t){const r=(this[hR]=this[hR]={accessors:{}}).accessors,a=this.prototype;function i(l){const u=Ls(l);r[u]||(P$(a,l),r[u]=!0)}return pe.isArray(t)?t.forEach(i):i(t),this}};zn.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);pe.reduceDescriptors(zn.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(r){this[n]=r}}});pe.freezeMethods(zn);function dh(e,t){const n=this||fu,r=t||n,a=zn.from(r.headers);let i=r.data;return pe.forEach(e,function(u){i=u.call(n,i,a.normalize(),t?t.status:void 0)}),a.normalize(),i}function Kz(e){return!!(e&&e.__CANCEL__)}function Tl(e,t,n){nt.call(this,e??"canceled",nt.ERR_CANCELED,t,n),this.name="CanceledError"}pe.inherits(Tl,nt,{__CANCEL__:!0});function Xz(e,t,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new nt("Request failed with status code "+n.status,[nt.ERR_BAD_REQUEST,nt.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function B$(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function U$(e,t){e=e||10;const n=new Array(e),r=new Array(e);let a=0,i=0,l;return t=t!==void 0?t:1e3,function(c){const f=Date.now(),p=r[i];l||(l=f),n[a]=c,r[a]=f;let g=i,b=0;for(;g!==a;)b+=n[g++],g=g%e;if(a=(a+1)%e,a===i&&(i=(i+1)%e),f-l{n=p,a=null,i&&(clearTimeout(i),i=null),e.apply(null,f)};return[(...f)=>{const p=Date.now(),g=p-n;g>=r?l(f,p):(a=f,i||(i=setTimeout(()=>{i=null,l(a)},r-g)))},()=>a&&l(a)]}const Nd=(e,t,n=3)=>{let r=0;const a=U$(50,250);return j$(i=>{const l=i.loaded,u=i.lengthComputable?i.total:void 0,c=l-r,f=a(c),p=l<=u;r=l;const g={loaded:l,total:u,progress:u?l/u:void 0,bytes:c,rate:f||void 0,estimated:f&&u&&p?(u-l)/f:void 0,event:i,lengthComputable:u!=null,[t?"download":"upload"]:!0};e(g)},n)},mR=(e,t)=>{const n=e!=null;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},bR=e=>(...t)=>pe.asap(()=>e(...t)),G$=yn.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,yn.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(yn.origin),yn.navigator&&/(msie|trident)/i.test(yn.navigator.userAgent)):()=>!0,H$=yn.hasStandardBrowserEnv?{write(e,t,n,r,a,i){const l=[e+"="+encodeURIComponent(t)];pe.isNumber(n)&&l.push("expires="+new Date(n).toGMTString()),pe.isString(r)&&l.push("path="+r),pe.isString(a)&&l.push("domain="+a),i===!0&&l.push("secure"),document.cookie=l.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function $$(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function q$(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function Zz(e,t){return e&&!$$(t)?q$(e,t):t}const yR=e=>e instanceof zn?{...e}:e;function ri(e,t){t=t||{};const n={};function r(f,p,g,b){return pe.isPlainObject(f)&&pe.isPlainObject(p)?pe.merge.call({caseless:b},f,p):pe.isPlainObject(p)?pe.merge({},p):pe.isArray(p)?p.slice():p}function a(f,p,g,b){if(pe.isUndefined(p)){if(!pe.isUndefined(f))return r(void 0,f,g,b)}else return r(f,p,g,b)}function i(f,p){if(!pe.isUndefined(p))return r(void 0,p)}function l(f,p){if(pe.isUndefined(p)){if(!pe.isUndefined(f))return r(void 0,f)}else return r(void 0,p)}function u(f,p,g){if(g in t)return r(f,p);if(g in e)return r(void 0,f)}const c={url:i,method:i,data:i,baseURL:l,transformRequest:l,transformResponse:l,paramsSerializer:l,timeout:l,timeoutMessage:l,withCredentials:l,withXSRFToken:l,adapter:l,responseType:l,xsrfCookieName:l,xsrfHeaderName:l,onUploadProgress:l,onDownloadProgress:l,decompress:l,maxContentLength:l,maxBodyLength:l,beforeRedirect:l,transport:l,httpAgent:l,httpsAgent:l,cancelToken:l,socketPath:l,responseEncoding:l,validateStatus:u,headers:(f,p,g)=>a(yR(f),yR(p),g,!0)};return pe.forEach(Object.keys(Object.assign({},e,t)),function(p){const g=c[p]||a,b=g(e[p],t[p],p);pe.isUndefined(b)&&g!==u||(n[p]=b)}),n}const Qz=e=>{const t=ri({},e);let{data:n,withXSRFToken:r,xsrfHeaderName:a,xsrfCookieName:i,headers:l,auth:u}=t;t.headers=l=zn.from(l),t.url=Vz(Zz(t.baseURL,t.url),e.params,e.paramsSerializer),u&&l.set("Authorization","Basic "+btoa((u.username||"")+":"+(u.password?unescape(encodeURIComponent(u.password)):"")));let c;if(pe.isFormData(n)){if(yn.hasStandardBrowserEnv||yn.hasStandardBrowserWebWorkerEnv)l.setContentType(void 0);else if((c=l.getContentType())!==!1){const[f,...p]=c?c.split(";").map(g=>g.trim()).filter(Boolean):[];l.setContentType([f||"multipart/form-data",...p].join("; "))}}if(yn.hasStandardBrowserEnv&&(r&&pe.isFunction(r)&&(r=r(t)),r||r!==!1&&G$(t.url))){const f=a&&i&&H$.read(i);f&&l.set(a,f)}return t},V$=typeof XMLHttpRequest<"u",W$=V$&&function(e){return new Promise(function(n,r){const a=Qz(e);let i=a.data;const l=zn.from(a.headers).normalize();let{responseType:u,onUploadProgress:c,onDownloadProgress:f}=a,p,g,b,m,S;function v(){m&&m(),S&&S(),a.cancelToken&&a.cancelToken.unsubscribe(p),a.signal&&a.signal.removeEventListener("abort",p)}let A=new XMLHttpRequest;A.open(a.method.toUpperCase(),a.url,!0),A.timeout=a.timeout;function R(){if(!A)return;const _=zn.from("getAllResponseHeaders"in A&&A.getAllResponseHeaders()),N={data:!u||u==="text"||u==="json"?A.responseText:A.response,status:A.status,statusText:A.statusText,headers:_,config:e,request:A};Xz(function(O){n(O),v()},function(O){r(O),v()},N),A=null}"onloadend"in A?A.onloadend=R:A.onreadystatechange=function(){!A||A.readyState!==4||A.status===0&&!(A.responseURL&&A.responseURL.indexOf("file:")===0)||setTimeout(R)},A.onabort=function(){A&&(r(new nt("Request aborted",nt.ECONNABORTED,e,A)),A=null)},A.onerror=function(){r(new nt("Network Error",nt.ERR_NETWORK,e,A)),A=null},A.ontimeout=function(){let C=a.timeout?"timeout of "+a.timeout+"ms exceeded":"timeout exceeded";const N=a.transitional||Wz;a.timeoutErrorMessage&&(C=a.timeoutErrorMessage),r(new nt(C,N.clarifyTimeoutError?nt.ETIMEDOUT:nt.ECONNABORTED,e,A)),A=null},i===void 0&&l.setContentType(null),"setRequestHeader"in A&&pe.forEach(l.toJSON(),function(C,N){A.setRequestHeader(N,C)}),pe.isUndefined(a.withCredentials)||(A.withCredentials=!!a.withCredentials),u&&u!=="json"&&(A.responseType=a.responseType),f&&([b,S]=Nd(f,!0),A.addEventListener("progress",b)),c&&A.upload&&([g,m]=Nd(c),A.upload.addEventListener("progress",g),A.upload.addEventListener("loadend",m)),(a.cancelToken||a.signal)&&(p=_=>{A&&(r(!_||_.type?new Tl(null,e,A):_),A.abort(),A=null)},a.cancelToken&&a.cancelToken.subscribe(p),a.signal&&(a.signal.aborted?p():a.signal.addEventListener("abort",p)));const x=B$(a.url);if(x&&yn.protocols.indexOf(x)===-1){r(new nt("Unsupported protocol "+x+":",nt.ERR_BAD_REQUEST,e));return}A.send(i||null)})},Y$=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let r=new AbortController,a;const i=function(f){if(!a){a=!0,u();const p=f instanceof Error?f:this.reason;r.abort(p instanceof nt?p:new Tl(p instanceof Error?p.message:p))}};let l=t&&setTimeout(()=>{l=null,i(new nt(`timeout ${t} of ms exceeded`,nt.ETIMEDOUT))},t);const u=()=>{e&&(l&&clearTimeout(l),l=null,e.forEach(f=>{f.unsubscribe?f.unsubscribe(i):f.removeEventListener("abort",i)}),e=null)};e.forEach(f=>f.addEventListener("abort",i));const{signal:c}=r;return c.unsubscribe=()=>pe.asap(u),c}},K$=function*(e,t){let n=e.byteLength;if(n{const a=X$(e,t);let i=0,l,u=c=>{l||(l=!0,r&&r(c))};return new ReadableStream({async pull(c){try{const{done:f,value:p}=await a.next();if(f){u(),c.close();return}let g=p.byteLength;if(n){let b=i+=g;n(b)}c.enqueue(new Uint8Array(p))}catch(f){throw u(f),f}},cancel(c){return u(c),a.return()}},{highWaterMark:2})},sf=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",Jz=sf&&typeof ReadableStream=="function",Q$=sf&&(typeof TextEncoder=="function"?(e=>t=>e.encode(t))(new TextEncoder):async e=>new Uint8Array(await new Response(e).arrayBuffer())),eP=(e,...t)=>{try{return!!e(...t)}catch{return!1}},J$=Jz&&eP(()=>{let e=!1;const t=new Request(yn.origin,{body:new ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t}),SR=64*1024,yx=Jz&&eP(()=>pe.isReadableStream(new Response("").body)),Od={stream:yx&&(e=>e.body)};sf&&(e=>{["text","arrayBuffer","blob","formData","stream"].forEach(t=>{!Od[t]&&(Od[t]=pe.isFunction(e[t])?n=>n[t]():(n,r)=>{throw new nt(`Response type '${t}' is not supported`,nt.ERR_NOT_SUPPORT,r)})})})(new Response);const eq=async e=>{if(e==null)return 0;if(pe.isBlob(e))return e.size;if(pe.isSpecCompliantForm(e))return(await new Request(yn.origin,{method:"POST",body:e}).arrayBuffer()).byteLength;if(pe.isArrayBufferView(e)||pe.isArrayBuffer(e))return e.byteLength;if(pe.isURLSearchParams(e)&&(e=e+""),pe.isString(e))return(await Q$(e)).byteLength},tq=async(e,t)=>{const n=pe.toFiniteNumber(e.getContentLength());return n??eq(t)},nq=sf&&(async e=>{let{url:t,method:n,data:r,signal:a,cancelToken:i,timeout:l,onDownloadProgress:u,onUploadProgress:c,responseType:f,headers:p,withCredentials:g="same-origin",fetchOptions:b}=Qz(e);f=f?(f+"").toLowerCase():"text";let m=Y$([a,i&&i.toAbortSignal()],l),S;const v=m&&m.unsubscribe&&(()=>{m.unsubscribe()});let A;try{if(c&&J$&&n!=="get"&&n!=="head"&&(A=await tq(p,r))!==0){let N=new Request(t,{method:"POST",body:r,duplex:"half"}),T;if(pe.isFormData(r)&&(T=N.headers.get("content-type"))&&p.setContentType(T),N.body){const[O,z]=mR(A,Nd(bR(c)));r=vR(N.body,SR,O,z)}}pe.isString(g)||(g=g?"include":"omit");const R="credentials"in Request.prototype;S=new Request(t,{...b,signal:m,method:n.toUpperCase(),headers:p.normalize().toJSON(),body:r,duplex:"half",credentials:R?g:void 0});let x=await fetch(S);const _=yx&&(f==="stream"||f==="response");if(yx&&(u||_&&v)){const N={};["status","statusText","headers"].forEach(I=>{N[I]=x[I]});const T=pe.toFiniteNumber(x.headers.get("content-length")),[O,z]=u&&mR(T,Nd(bR(u),!0))||[];x=new Response(vR(x.body,SR,O,()=>{z&&z(),v&&v()}),N)}f=f||"text";let C=await Od[pe.findKey(Od,f)||"text"](x,e);return!_&&v&&v(),await new Promise((N,T)=>{Xz(N,T,{data:C,headers:zn.from(x.headers),status:x.status,statusText:x.statusText,config:e,request:S})})}catch(R){throw v&&v(),R&&R.name==="TypeError"&&/fetch/i.test(R.message)?Object.assign(new nt("Network Error",nt.ERR_NETWORK,e,S),{cause:R.cause||R}):nt.from(R,R&&R.code,e,S)}}),vx={http:b$,xhr:W$,fetch:nq};pe.forEach(vx,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const ER=e=>`- ${e}`,rq=e=>pe.isFunction(e)||e===null||e===!1,tP={getAdapter:e=>{e=pe.isArray(e)?e:[e];const{length:t}=e;let n,r;const a={};for(let i=0;i`adapter ${u} `+(c===!1?"is not supported by the environment":"is not available in the build"));let l=t?i.length>1?`since : +`+i.map(ER).join(` +`):" "+ER(i[0]):"as no adapter specified";throw new nt("There is no suitable adapter to dispatch the request "+l,"ERR_NOT_SUPPORT")}return r},adapters:vx};function fh(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Tl(null,e)}function wR(e){return fh(e),e.headers=zn.from(e.headers),e.data=dh.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),tP.getAdapter(e.adapter||fu.adapter)(e).then(function(r){return fh(e),r.data=dh.call(e,e.transformResponse,r),r.headers=zn.from(r.headers),r},function(r){return Kz(r)||(fh(e),r&&r.response&&(r.response.data=dh.call(e,e.transformResponse,r.response),r.response.headers=zn.from(r.response.headers))),Promise.reject(r)})}const nP="1.7.9",uf={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{uf[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const xR={};uf.transitional=function(t,n,r){function a(i,l){return"[Axios v"+nP+"] Transitional option '"+i+"'"+l+(r?". "+r:"")}return(i,l,u)=>{if(t===!1)throw new nt(a(l," has been removed"+(n?" in "+n:"")),nt.ERR_DEPRECATED);return n&&!xR[l]&&(xR[l]=!0,console.warn(a(l," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(i,l,u):!0}};uf.spelling=function(t){return(n,r)=>(console.warn(`${r} is likely a misspelling of ${t}`),!0)};function aq(e,t,n){if(typeof e!="object")throw new nt("options must be an object",nt.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let a=r.length;for(;a-- >0;){const i=r[a],l=t[i];if(l){const u=e[i],c=u===void 0||l(u,i,e);if(c!==!0)throw new nt("option "+i+" must be "+c,nt.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new nt("Unknown option "+i,nt.ERR_BAD_OPTION)}}const gd={assertOptions:aq,validators:uf},Hr=gd.validators;let ni=class{constructor(t){this.defaults=t,this.interceptors={request:new gR,response:new gR}}async request(t,n){try{return await this._request(t,n)}catch(r){if(r instanceof Error){let a={};Error.captureStackTrace?Error.captureStackTrace(a):a=new Error;const i=a.stack?a.stack.replace(/^.+\n/,""):"";try{r.stack?i&&!String(r.stack).endsWith(i.replace(/^.+\n.+\n/,""))&&(r.stack+=` +`+i):r.stack=i}catch{}}throw r}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=ri(this.defaults,n);const{transitional:r,paramsSerializer:a,headers:i}=n;r!==void 0&&gd.assertOptions(r,{silentJSONParsing:Hr.transitional(Hr.boolean),forcedJSONParsing:Hr.transitional(Hr.boolean),clarifyTimeoutError:Hr.transitional(Hr.boolean)},!1),a!=null&&(pe.isFunction(a)?n.paramsSerializer={serialize:a}:gd.assertOptions(a,{encode:Hr.function,serialize:Hr.function},!0)),gd.assertOptions(n,{baseUrl:Hr.spelling("baseURL"),withXsrfToken:Hr.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let l=i&&pe.merge(i.common,i[n.method]);i&&pe.forEach(["delete","get","head","post","put","patch","common"],S=>{delete i[S]}),n.headers=zn.concat(l,i);const u=[];let c=!0;this.interceptors.request.forEach(function(v){typeof v.runWhen=="function"&&v.runWhen(n)===!1||(c=c&&v.synchronous,u.unshift(v.fulfilled,v.rejected))});const f=[];this.interceptors.response.forEach(function(v){f.push(v.fulfilled,v.rejected)});let p,g=0,b;if(!c){const S=[wR.bind(this),void 0];for(S.unshift.apply(S,u),S.push.apply(S,f),b=S.length,p=Promise.resolve(n);g{if(!r._listeners)return;let i=r._listeners.length;for(;i-- >0;)r._listeners[i](a);r._listeners=null}),this.promise.then=a=>{let i;const l=new Promise(u=>{r.subscribe(u),i=u}).then(a);return l.cancel=function(){r.unsubscribe(i)},l},t(function(i,l,u){r.reason||(r.reason=new Tl(i,l,u),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const t=new AbortController,n=r=>{t.abort(r)};return this.subscribe(n),t.signal.unsubscribe=()=>this.unsubscribe(n),t.signal}static source(){let t;return{token:new rP(function(a){t=a}),cancel:t}}};function iq(e){return function(n){return e.apply(null,n)}}function lq(e){return pe.isObject(e)&&e.isAxiosError===!0}const Sx={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(Sx).forEach(([e,t])=>{Sx[t]=e});function aP(e){const t=new ni(e),n=Lz(ni.prototype.request,t);return pe.extend(n,ni.prototype,t,{allOwnKeys:!0}),pe.extend(n,t,null,{allOwnKeys:!0}),n.create=function(a){return aP(ri(e,a))},n}const $t=aP(fu);$t.Axios=ni;$t.CanceledError=Tl;$t.CancelToken=oq;$t.isCancel=Kz;$t.VERSION=nP;$t.toFormData=lf;$t.AxiosError=nt;$t.Cancel=$t.CanceledError;$t.all=function(t){return Promise.all(t)};$t.spread=iq;$t.isAxiosError=lq;$t.mergeConfig=ri;$t.AxiosHeaders=zn;$t.formToJSON=e=>Yz(pe.isHTMLForm(e)?new FormData(e):e);$t.getAdapter=tP.getAdapter;$t.HttpStatusCode=Sx;$t.default=$t;const{Axios:Fye,AxiosError:zye,CanceledError:Pye,isCancel:Bye,CancelToken:Uye,VERSION:jye,all:Gye,Cancel:Hye,isAxiosError:$ye,spread:qye,toFormData:Vye,AxiosHeaders:Wye,HttpStatusCode:Yye,formToJSON:Kye,getAdapter:Xye,mergeConfig:Zye}=$t,oP="Invalid API Key",iP="API Key required",Mr=$t.create({baseURL:Rz,headers:{"Content-Type":"application/json"}});Mr.interceptors.request.use(e=>{const t=Ke.getState().apiKey;return t&&(e.headers["X-API-Key"]=t),e});Mr.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 sq=async(e,t)=>(await Mr.get(`/graphs?label=${e}&max_depth=${t}`)).data,uq=async()=>(await Mr.get("/graph/label/list")).data,cq=async()=>{try{return(await Mr.get("/health")).data}catch(e){return{status:"error",message:Nr(e)}}},dq=async()=>(await Mr.get("/documents")).data,fq=async()=>(await Mr.post("/documents/scan")).data,pq=async e=>(await Mr.post("/query",e)).data,gq=async(e,t,n)=>{try{let r="";if(await Mr.post("/query/stream",e,{responseType:"text",headers:{Accept:"application/x-ndjson"},transformResponse:[a=>{r+=a;const i=r.split(` +`);r=i.pop()||"";for(const l of i)if(l.trim())try{const u=JSON.parse(l);u.response?t(u.response):u.error&&n&&n(u.error)}catch(u){console.error("Error parsing stream chunk:",u),n&&n("Error parsing server response")}return a}]}).catch(a=>{n&&n(Nr(a))}),r.trim())try{const a=JSON.parse(r);a.response?t(a.response):a.error&&n&&n(a.error)}catch(a){console.error("Error parsing final chunk:",a),n&&n("Error parsing server response")}}catch(r){const a=Nr(r);console.error("Stream request failed:",a),n&&n(a)}},hq=async(e,t)=>{const n=new FormData;return n.append("file",e),(await Mr.post("/documents/upload",n,{headers:{"Content-Type":"multipart/form-data"},onUploadProgress:t!==void 0?a=>{const i=Math.round(a.loaded*100/a.total);t(i)}:void 0})).data},mq=async()=>(await Mr.delete("/documents")).data,bq=wk()(e=>({health:!0,message:null,messageTitle:null,lastCheckTime:Date.now(),status:null,check:async()=>{const t=await cq();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})}})),Pn=Ak(bq);/** + * @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 yq=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),lP=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim();/** + * @license lucide-react v0.475.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */var vq={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 Sq=k.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:a="",children:i,iconNode:l,...u},c)=>k.createElement("svg",{ref:c,...vq,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:lP("lucide",a),...u},[...l.map(([f,p])=>k.createElement(f,p)),...Array.isArray(i)?i:[i]]));/** + * @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 xt=(e,t)=>{const n=k.forwardRef(({className:r,...a},i)=>k.createElement(Sq,{ref:i,iconNode:t,className:lP(`lucide-${yq(e)}`,r),...a}));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 Eq=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Ck=xt("Check",Eq);/** + * @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 wq=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],Nk=xt("ChevronDown",wq);/** + * @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 xq=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],sP=xt("ChevronUp",xq);/** + * @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 kq=[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]],Aq=xt("ChevronsUpDown",kq);/** + * @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 Tq=[["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"}]],_q=xt("CircleAlert",Tq);/** + * @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 Rq=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],Cq=xt("Copy",Rq);/** + * @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 Nq=[["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"}]],uP=xt("Eraser",Nq);/** + * @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 Oq=[["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"}]],Dq=xt("FileText",Oq);/** + * @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 Iq=[["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"}]],Lq=xt("Files",Iq);/** + * @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 Mq=[["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"}]],Fq=xt("Fullscreen",Mq);/** + * @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 zq=[["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"}]],Pq=xt("Github",zq);/** + * @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 Bq=[["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"}]],Uq=xt("Grip",Bq);/** + * @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 jq=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],cP=xt("LoaderCircle",jq);/** + * @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 Gq=[["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"}]],Hq=xt("Loader",Gq);/** + * @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 $q=[["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"}]],qq=xt("Maximize",$q);/** + * @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 Vq=[["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"}]],Wq=xt("Minimize",Vq);/** + * @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 Yq=[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]],Kq=xt("Moon",Yq);/** + * @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 Xq=[["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"}]],Zq=xt("Pause",Xq);/** + * @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 Qq=[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]],Jq=xt("Play",Qq);/** + * @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 e8=[["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"}]],t8=xt("RefreshCw",e8);/** + * @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 n8=[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]],r8=xt("Search",n8);/** + * @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 a8=[["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"}]],o8=xt("Send",a8);/** + * @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 i8=[["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"}]],l8=xt("Settings",i8);/** + * @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 s8=[["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"}]],u8=xt("Sun",s8);/** + * @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 c8=[["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"}]],Ex=xt("Upload",c8);/** + * @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 d8=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],dP=xt("X",d8);/** + * @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 f8=[["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"}]],p8=xt("Zap",f8);/** + * @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 g8=[["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"}]],h8=xt("ZoomIn",g8);/** + * @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 m8=[["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"}]],b8=xt("ZoomOut",m8),y8=()=>{const e=Pn.use.health(),t=Pn.use.message(),n=Pn.use.messageTitle(),[r,a]=k.useState(!1);return k.useEffect(()=>{setTimeout(()=>{a(!0)},50)},[]),w.jsxs(Oz,{className:Me("bg-background/90 absolute top-12 left-1/2 flex w-auto max-w-lg -translate-x-1/2 transform items-center gap-4 shadow-md backdrop-blur-lg transition-all duration-500 ease-in-out",r?"translate-y-0 opacity-100":"-translate-y-20 opacity-0",!e&&"bg-red-700 text-white"),children:[!e&&w.jsx("div",{children:w.jsx(_q,{className:"size-4"})}),w.jsxs("div",{children:[w.jsx(Dz,{className:"font-bold",children:n}),w.jsx(Iz,{children:t})]})]})};function v8(e,t){const n=k.createContext(t),r=i=>{const{children:l,...u}=i,c=k.useMemo(()=>u,Object.values(u));return w.jsx(n.Provider,{value:c,children:l})};r.displayName=e+"Provider";function a(i){const l=k.useContext(n);if(l)return l;if(t!==void 0)return t;throw new Error(`\`${i}\` must be used within \`${e}\``)}return[r,a]}function mr(e,t=[]){let n=[];function r(i,l){const u=k.createContext(l),c=n.length;n=[...n,l];const f=g=>{var R;const{scope:b,children:m,...S}=g,v=((R=b==null?void 0:b[e])==null?void 0:R[c])||u,A=k.useMemo(()=>S,Object.values(S));return w.jsx(v.Provider,{value:A,children:m})};f.displayName=i+"Provider";function p(g,b){var v;const m=((v=b==null?void 0:b[e])==null?void 0:v[c])||u,S=k.useContext(m);if(S)return S;if(l!==void 0)return l;throw new Error(`\`${g}\` must be used within \`${i}\``)}return[f,p]}const a=()=>{const i=n.map(l=>k.createContext(l));return function(u){const c=(u==null?void 0:u[e])||i;return k.useMemo(()=>({[`__scope${e}`]:{...u,[e]:c}}),[u,c])}};return a.scopeName=e,[r,S8(a,...t)]}function S8(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(a=>({useScope:a(),scopeName:a.scopeName}));return function(i){const l=r.reduce((u,{useScope:c,scopeName:f})=>{const g=c(i)[`__scope${f}`];return{...u,...g}},{});return k.useMemo(()=>({[`__scope${t.scopeName}`]:l}),[l])}};return n.scopeName=t.scopeName,n}function kR(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function fP(...e){return t=>{let n=!1;const r=e.map(a=>{const i=kR(a,t);return!n&&typeof i=="function"&&(n=!0),i});if(n)return()=>{for(let a=0;a{},E8=bH.useId||(()=>{}),w8=0;function En(e){const[t,n]=k.useState(E8());return wn(()=>{n(r=>r??String(w8++))},[e]),t?`radix-${t}`:""}function pn(e){const t=k.useRef(e);return k.useEffect(()=>{t.current=e}),k.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function Oa({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,a]=x8({defaultProp:t,onChange:n}),i=e!==void 0,l=i?e:r,u=pn(n),c=k.useCallback(f=>{if(i){const g=typeof f=="function"?f(e):f;g!==e&&u(g)}else a(f)},[i,e,a,u]);return[l,c]}function x8({defaultProp:e,onChange:t}){const n=k.useState(e),[r]=n,a=k.useRef(r),i=pn(t);return k.useEffect(()=>{a.current!==r&&(i(r),a.current=r)},[r,a,i]),n}var pu=mz();const pP=an(pu);var bo=k.forwardRef((e,t)=>{const{children:n,...r}=e,a=k.Children.toArray(n),i=a.find(k8);if(i){const l=i.props.children,u=a.map(c=>c===i?k.Children.count(l)>1?k.Children.only(null):k.isValidElement(l)?l.props.children:null:c);return w.jsx(wx,{...r,ref:t,children:k.isValidElement(l)?k.cloneElement(l,void 0,u):null})}return w.jsx(wx,{...r,ref:t,children:n})});bo.displayName="Slot";var wx=k.forwardRef((e,t)=>{const{children:n,...r}=e;if(k.isValidElement(n)){const a=T8(n),i=A8(r,n.props);return n.type!==k.Fragment&&(i.ref=t?fP(t,a):a),k.cloneElement(n,i)}return k.Children.count(n)>1?k.Children.only(null):null});wx.displayName="SlotClone";var Ok=({children:e})=>w.jsx(w.Fragment,{children:e});function k8(e){return k.isValidElement(e)&&e.type===Ok}function A8(e,t){const n={...t};for(const r in t){const a=e[r],i=t[r];/^on[A-Z]/.test(r)?a&&i?n[r]=(...u)=>{i(...u),a(...u)}:a&&(n[r]=a):r==="style"?n[r]={...a,...i}:r==="className"&&(n[r]=[a,i].filter(Boolean).join(" "))}return{...e,...n}}function T8(e){var r,a;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(a=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:a.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var _8=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],Xe=_8.reduce((e,t)=>{const n=k.forwardRef((r,a)=>{const{asChild:i,...l}=r,u=i?bo:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),w.jsx(u,{...l,ref:a})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function R8(e,t){e&&pu.flushSync(()=>e.dispatchEvent(t))}function C8(e,t=globalThis==null?void 0:globalThis.document){const n=pn(e);k.useEffect(()=>{const r=a=>{a.key==="Escape"&&n(a)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var N8="DismissableLayer",xx="dismissableLayer.update",O8="dismissableLayer.pointerDownOutside",D8="dismissableLayer.focusOutside",AR,gP=k.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),gu=k.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:a,onFocusOutside:i,onInteractOutside:l,onDismiss:u,...c}=e,f=k.useContext(gP),[p,g]=k.useState(null),b=(p==null?void 0:p.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,m]=k.useState({}),S=ft(t,O=>g(O)),v=Array.from(f.layers),[A]=[...f.layersWithOutsidePointerEventsDisabled].slice(-1),R=v.indexOf(A),x=p?v.indexOf(p):-1,_=f.layersWithOutsidePointerEventsDisabled.size>0,C=x>=R,N=M8(O=>{const z=O.target,I=[...f.branches].some(M=>M.contains(z));!C||I||(a==null||a(O),l==null||l(O),O.defaultPrevented||u==null||u())},b),T=F8(O=>{const z=O.target;[...f.branches].some(M=>M.contains(z))||(i==null||i(O),l==null||l(O),O.defaultPrevented||u==null||u())},b);return C8(O=>{x===f.layers.size-1&&(r==null||r(O),!O.defaultPrevented&&u&&(O.preventDefault(),u()))},b),k.useEffect(()=>{if(p)return n&&(f.layersWithOutsidePointerEventsDisabled.size===0&&(AR=b.body.style.pointerEvents,b.body.style.pointerEvents="none"),f.layersWithOutsidePointerEventsDisabled.add(p)),f.layers.add(p),TR(),()=>{n&&f.layersWithOutsidePointerEventsDisabled.size===1&&(b.body.style.pointerEvents=AR)}},[p,b,n,f]),k.useEffect(()=>()=>{p&&(f.layers.delete(p),f.layersWithOutsidePointerEventsDisabled.delete(p),TR())},[p,f]),k.useEffect(()=>{const O=()=>m({});return document.addEventListener(xx,O),()=>document.removeEventListener(xx,O)},[]),w.jsx(Xe.div,{...c,ref:S,style:{pointerEvents:_?C?"auto":"none":void 0,...e.style},onFocusCapture:We(e.onFocusCapture,T.onFocusCapture),onBlurCapture:We(e.onBlurCapture,T.onBlurCapture),onPointerDownCapture:We(e.onPointerDownCapture,N.onPointerDownCapture)})});gu.displayName=N8;var I8="DismissableLayerBranch",L8=k.forwardRef((e,t)=>{const n=k.useContext(gP),r=k.useRef(null),a=ft(t,r);return k.useEffect(()=>{const i=r.current;if(i)return n.branches.add(i),()=>{n.branches.delete(i)}},[n.branches]),w.jsx(Xe.div,{...e,ref:a})});L8.displayName=I8;function M8(e,t=globalThis==null?void 0:globalThis.document){const n=pn(e),r=k.useRef(!1),a=k.useRef(()=>{});return k.useEffect(()=>{const i=u=>{if(u.target&&!r.current){let c=function(){hP(O8,n,f,{discrete:!0})};const f={originalEvent:u};u.pointerType==="touch"?(t.removeEventListener("click",a.current),a.current=c,t.addEventListener("click",a.current,{once:!0})):c()}else t.removeEventListener("click",a.current);r.current=!1},l=window.setTimeout(()=>{t.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(l),t.removeEventListener("pointerdown",i),t.removeEventListener("click",a.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function F8(e,t=globalThis==null?void 0:globalThis.document){const n=pn(e),r=k.useRef(!1);return k.useEffect(()=>{const a=i=>{i.target&&!r.current&&hP(D8,n,{originalEvent:i},{discrete:!1})};return t.addEventListener("focusin",a),()=>t.removeEventListener("focusin",a)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function TR(){const e=new CustomEvent(xx);document.dispatchEvent(e)}function hP(e,t,n,{discrete:r}){const a=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&a.addEventListener(e,t,{once:!0}),r?R8(a,i):a.dispatchEvent(i)}var ph="focusScope.autoFocusOnMount",gh="focusScope.autoFocusOnUnmount",_R={bubbles:!1,cancelable:!0},z8="FocusScope",cf=k.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:a,onUnmountAutoFocus:i,...l}=e,[u,c]=k.useState(null),f=pn(a),p=pn(i),g=k.useRef(null),b=ft(t,v=>c(v)),m=k.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;k.useEffect(()=>{if(r){let v=function(_){if(m.paused||!u)return;const C=_.target;u.contains(C)?g.current=C:co(g.current,{select:!0})},A=function(_){if(m.paused||!u)return;const C=_.relatedTarget;C!==null&&(u.contains(C)||co(g.current,{select:!0}))},R=function(_){if(document.activeElement===document.body)for(const N of _)N.removedNodes.length>0&&co(u)};document.addEventListener("focusin",v),document.addEventListener("focusout",A);const x=new MutationObserver(R);return u&&x.observe(u,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",v),document.removeEventListener("focusout",A),x.disconnect()}}},[r,u,m.paused]),k.useEffect(()=>{if(u){CR.add(m);const v=document.activeElement;if(!u.contains(v)){const R=new CustomEvent(ph,_R);u.addEventListener(ph,f),u.dispatchEvent(R),R.defaultPrevented||(P8(H8(mP(u)),{select:!0}),document.activeElement===v&&co(u))}return()=>{u.removeEventListener(ph,f),setTimeout(()=>{const R=new CustomEvent(gh,_R);u.addEventListener(gh,p),u.dispatchEvent(R),R.defaultPrevented||co(v??document.body,{select:!0}),u.removeEventListener(gh,p),CR.remove(m)},0)}}},[u,f,p,m]);const S=k.useCallback(v=>{if(!n&&!r||m.paused)return;const A=v.key==="Tab"&&!v.altKey&&!v.ctrlKey&&!v.metaKey,R=document.activeElement;if(A&&R){const x=v.currentTarget,[_,C]=B8(x);_&&C?!v.shiftKey&&R===C?(v.preventDefault(),n&&co(_,{select:!0})):v.shiftKey&&R===_&&(v.preventDefault(),n&&co(C,{select:!0})):R===x&&v.preventDefault()}},[n,r,m.paused]);return w.jsx(Xe.div,{tabIndex:-1,...l,ref:b,onKeyDown:S})});cf.displayName=z8;function P8(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(co(r,{select:t}),document.activeElement!==n)return}function B8(e){const t=mP(e),n=RR(t,e),r=RR(t.reverse(),e);return[n,r]}function mP(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const a=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||a?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function RR(e,t){for(const n of e)if(!U8(n,{upTo:t}))return n}function U8(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 j8(e){return e instanceof HTMLInputElement&&"select"in e}function co(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&j8(e)&&t&&e.select()}}var CR=G8();function G8(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=NR(e,t),e.unshift(t)},remove(t){var n;e=NR(e,t),(n=e[0])==null||n.resume()}}}function NR(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function H8(e){return e.filter(t=>t.tagName!=="A")}var $8="Portal",df=k.forwardRef((e,t)=>{var u;const{container:n,...r}=e,[a,i]=k.useState(!1);wn(()=>i(!0),[]);const l=n||a&&((u=globalThis==null?void 0:globalThis.document)==null?void 0:u.body);return l?pP.createPortal(w.jsx(Xe.div,{...r,ref:t}),l):null});df.displayName=$8;function q8(e,t){return k.useReducer((n,r)=>t[n][r]??n,e)}var Jn=e=>{const{present:t,children:n}=e,r=V8(t),a=typeof n=="function"?n({present:r.isPresent}):k.Children.only(n),i=ft(r.ref,W8(a));return typeof n=="function"||r.isPresent?k.cloneElement(a,{ref:i}):null};Jn.displayName="Presence";function V8(e){const[t,n]=k.useState(),r=k.useRef({}),a=k.useRef(e),i=k.useRef("none"),l=e?"mounted":"unmounted",[u,c]=q8(l,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return k.useEffect(()=>{const f=zc(r.current);i.current=u==="mounted"?f:"none"},[u]),wn(()=>{const f=r.current,p=a.current;if(p!==e){const b=i.current,m=zc(f);e?c("MOUNT"):m==="none"||(f==null?void 0:f.display)==="none"?c("UNMOUNT"):c(p&&b!==m?"ANIMATION_OUT":"UNMOUNT"),a.current=e}},[e,c]),wn(()=>{if(t){let f;const p=t.ownerDocument.defaultView??window,g=m=>{const v=zc(r.current).includes(m.animationName);if(m.target===t&&v&&(c("ANIMATION_END"),!a.current)){const A=t.style.animationFillMode;t.style.animationFillMode="forwards",f=p.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=A)})}},b=m=>{m.target===t&&(i.current=zc(r.current))};return t.addEventListener("animationstart",b),t.addEventListener("animationcancel",g),t.addEventListener("animationend",g),()=>{p.clearTimeout(f),t.removeEventListener("animationstart",b),t.removeEventListener("animationcancel",g),t.removeEventListener("animationend",g)}}else c("ANIMATION_END")},[t,c]),{isPresent:["mounted","unmountSuspended"].includes(u),ref:k.useCallback(f=>{f&&(r.current=getComputedStyle(f)),n(f)},[])}}function zc(e){return(e==null?void 0:e.animationName)||"none"}function W8(e){var r,a;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(a=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:a.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var hh=0;function Dk(){k.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??OR()),document.body.insertAdjacentElement("beforeend",e[1]??OR()),hh++,()=>{hh===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),hh--}},[])}function OR(){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 Vr=function(){return Vr=Object.assign||function(t){for(var n,r=1,a=arguments.length;r"u")return c7;var t=d7(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},p7=SP(),ul="data-scroll-locked",g7=function(e,t,n,r){var a=e.left,i=e.top,l=e.right,u=e.gap;return n===void 0&&(n="margin"),` + .`.concat(K8,` { + overflow: hidden `).concat(r,`; + padding-right: `).concat(u,"px ").concat(r,`; + } + body[`).concat(ul,`] { + overflow: hidden `).concat(r,`; + overscroll-behavior: contain; + `).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&` + padding-left: `.concat(a,`px; + padding-top: `).concat(i,`px; + padding-right: `).concat(l,`px; + margin-left:0; + margin-top:0; + margin-right: `).concat(u,"px ").concat(r,`; + `),n==="padding"&&"padding-right: ".concat(u,"px ").concat(r,";")].filter(Boolean).join(""),` + } + + .`).concat(hd,` { + right: `).concat(u,"px ").concat(r,`; + } + + .`).concat(md,` { + margin-right: `).concat(u,"px ").concat(r,`; + } + + .`).concat(hd," .").concat(hd,` { + right: 0 `).concat(r,`; + } + + .`).concat(md," .").concat(md,` { + margin-right: 0 `).concat(r,`; + } + + body[`).concat(ul,`] { + `).concat(X8,": ").concat(u,`px; + } +`)},IR=function(){var e=parseInt(document.body.getAttribute(ul)||"0",10);return isFinite(e)?e:0},h7=function(){k.useEffect(function(){return document.body.setAttribute(ul,(IR()+1).toString()),function(){var e=IR()-1;e<=0?document.body.removeAttribute(ul):document.body.setAttribute(ul,e.toString())}},[])},m7=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,a=r===void 0?"margin":r;h7();var i=k.useMemo(function(){return f7(a)},[a]);return k.createElement(p7,{styles:g7(i,!t,a,n?"":"!important")})},kx=!1;if(typeof window<"u")try{var Pc=Object.defineProperty({},"passive",{get:function(){return kx=!0,!0}});window.addEventListener("test",Pc,Pc),window.removeEventListener("test",Pc,Pc)}catch{kx=!1}var Ki=kx?{passive:!1}:!1,b7=function(e){return e.tagName==="TEXTAREA"},EP=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!b7(e)&&n[t]==="visible")},y7=function(e){return EP(e,"overflowY")},v7=function(e){return EP(e,"overflowX")},LR=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var a=wP(e,r);if(a){var i=xP(e,r),l=i[1],u=i[2];if(l>u)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},S7=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},E7=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},wP=function(e,t){return e==="v"?y7(t):v7(t)},xP=function(e,t){return e==="v"?S7(t):E7(t)},w7=function(e,t){return e==="h"&&t==="rtl"?-1:1},x7=function(e,t,n,r,a){var i=w7(e,window.getComputedStyle(t).direction),l=i*r,u=n.target,c=t.contains(u),f=!1,p=l>0,g=0,b=0;do{var m=xP(e,u),S=m[0],v=m[1],A=m[2],R=v-A-i*S;(S||R)&&wP(e,u)&&(g+=R,b+=S),u instanceof ShadowRoot?u=u.host:u=u.parentNode}while(!c&&u!==document.body||c&&(t.contains(u)||t===u));return(p&&Math.abs(g)<1||!p&&Math.abs(b)<1)&&(f=!0),f},Bc=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},MR=function(e){return[e.deltaX,e.deltaY]},FR=function(e){return e&&"current"in e?e.current:e},k7=function(e,t){return e[0]===t[0]&&e[1]===t[1]},A7=function(e){return` + .block-interactivity-`.concat(e,` {pointer-events: none;} + .allow-interactivity-`).concat(e,` {pointer-events: all;} +`)},T7=0,Xi=[];function _7(e){var t=k.useRef([]),n=k.useRef([0,0]),r=k.useRef(),a=k.useState(T7++)[0],i=k.useState(SP)[0],l=k.useRef(e);k.useEffect(function(){l.current=e},[e]),k.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(a));var v=Y8([e.lockRef.current],(e.shards||[]).map(FR),!0).filter(Boolean);return v.forEach(function(A){return A.classList.add("allow-interactivity-".concat(a))}),function(){document.body.classList.remove("block-interactivity-".concat(a)),v.forEach(function(A){return A.classList.remove("allow-interactivity-".concat(a))})}}},[e.inert,e.lockRef.current,e.shards]);var u=k.useCallback(function(v,A){if("touches"in v&&v.touches.length===2||v.type==="wheel"&&v.ctrlKey)return!l.current.allowPinchZoom;var R=Bc(v),x=n.current,_="deltaX"in v?v.deltaX:x[0]-R[0],C="deltaY"in v?v.deltaY:x[1]-R[1],N,T=v.target,O=Math.abs(_)>Math.abs(C)?"h":"v";if("touches"in v&&O==="h"&&T.type==="range")return!1;var z=LR(O,T);if(!z)return!0;if(z?N=O:(N=O==="v"?"h":"v",z=LR(O,T)),!z)return!1;if(!r.current&&"changedTouches"in v&&(_||C)&&(r.current=N),!N)return!0;var I=r.current||N;return x7(I,A,v,I==="h"?_:C)},[]),c=k.useCallback(function(v){var A=v;if(!(!Xi.length||Xi[Xi.length-1]!==i)){var R="deltaY"in A?MR(A):Bc(A),x=t.current.filter(function(N){return N.name===A.type&&(N.target===A.target||A.target===N.shadowParent)&&k7(N.delta,R)})[0];if(x&&x.should){A.cancelable&&A.preventDefault();return}if(!x){var _=(l.current.shards||[]).map(FR).filter(Boolean).filter(function(N){return N.contains(A.target)}),C=_.length>0?u(A,_[0]):!l.current.noIsolation;C&&A.cancelable&&A.preventDefault()}}},[]),f=k.useCallback(function(v,A,R,x){var _={name:v,delta:A,target:R,should:x,shadowParent:R7(R)};t.current.push(_),setTimeout(function(){t.current=t.current.filter(function(C){return C!==_})},1)},[]),p=k.useCallback(function(v){n.current=Bc(v),r.current=void 0},[]),g=k.useCallback(function(v){f(v.type,MR(v),v.target,u(v,e.lockRef.current))},[]),b=k.useCallback(function(v){f(v.type,Bc(v),v.target,u(v,e.lockRef.current))},[]);k.useEffect(function(){return Xi.push(i),e.setCallbacks({onScrollCapture:g,onWheelCapture:g,onTouchMoveCapture:b}),document.addEventListener("wheel",c,Ki),document.addEventListener("touchmove",c,Ki),document.addEventListener("touchstart",p,Ki),function(){Xi=Xi.filter(function(v){return v!==i}),document.removeEventListener("wheel",c,Ki),document.removeEventListener("touchmove",c,Ki),document.removeEventListener("touchstart",p,Ki)}},[]);var m=e.removeScrollBar,S=e.inert;return k.createElement(k.Fragment,null,S?k.createElement(i,{styles:A7(a)}):null,m?k.createElement(m7,{gapMode:e.gapMode}):null)}function R7(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const C7=r7(vP,_7);var pf=k.forwardRef(function(e,t){return k.createElement(ff,Vr({},e,{ref:t,sideCar:C7}))});pf.classNames=ff.classNames;var N7=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Zi=new WeakMap,Uc=new WeakMap,jc={},vh=0,kP=function(e){return e&&(e.host||kP(e.parentNode))},O7=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=kP(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},D7=function(e,t,n,r){var a=O7(t,Array.isArray(e)?e:[e]);jc[n]||(jc[n]=new WeakMap);var i=jc[n],l=[],u=new Set,c=new Set(a),f=function(g){!g||u.has(g)||(u.add(g),f(g.parentNode))};a.forEach(f);var p=function(g){!g||c.has(g)||Array.prototype.forEach.call(g.children,function(b){if(u.has(b))p(b);else try{var m=b.getAttribute(r),S=m!==null&&m!=="false",v=(Zi.get(b)||0)+1,A=(i.get(b)||0)+1;Zi.set(b,v),i.set(b,A),l.push(b),v===1&&S&&Uc.set(b,!0),A===1&&b.setAttribute(n,"true"),S||b.setAttribute(r,"true")}catch(R){console.error("aria-hidden: cannot operate on ",b,R)}})};return p(t),u.clear(),vh++,function(){l.forEach(function(g){var b=Zi.get(g)-1,m=i.get(g)-1;Zi.set(g,b),i.set(g,m),b||(Uc.has(g)||g.removeAttribute(r),Uc.delete(g)),m||g.removeAttribute(n)}),vh--,vh||(Zi=new WeakMap,Zi=new WeakMap,Uc=new WeakMap,jc={})}},Ik=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),a=N7(e);return a?(r.push.apply(r,Array.from(a.querySelectorAll("[aria-live]"))),D7(r,a,n,"aria-hidden")):function(){return null}},Lk="Dialog",[AP,TP]=mr(Lk),[I7,Fr]=AP(Lk),_P=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:a,onOpenChange:i,modal:l=!0}=e,u=k.useRef(null),c=k.useRef(null),[f=!1,p]=Oa({prop:r,defaultProp:a,onChange:i});return w.jsx(I7,{scope:t,triggerRef:u,contentRef:c,contentId:En(),titleId:En(),descriptionId:En(),open:f,onOpenChange:p,onOpenToggle:k.useCallback(()=>p(g=>!g),[p]),modal:l,children:n})};_P.displayName=Lk;var RP="DialogTrigger",CP=k.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,a=Fr(RP,n),i=ft(t,a.triggerRef);return w.jsx(Xe.button,{type:"button","aria-haspopup":"dialog","aria-expanded":a.open,"aria-controls":a.contentId,"data-state":zk(a.open),...r,ref:i,onClick:We(e.onClick,a.onOpenToggle)})});CP.displayName=RP;var Mk="DialogPortal",[L7,NP]=AP(Mk,{forceMount:void 0}),OP=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:a}=e,i=Fr(Mk,t);return w.jsx(L7,{scope:t,forceMount:n,children:k.Children.map(r,l=>w.jsx(Jn,{present:n||i.open,children:w.jsx(df,{asChild:!0,container:a,children:l})}))})};OP.displayName=Mk;var Dd="DialogOverlay",DP=k.forwardRef((e,t)=>{const n=NP(Dd,e.__scopeDialog),{forceMount:r=n.forceMount,...a}=e,i=Fr(Dd,e.__scopeDialog);return i.modal?w.jsx(Jn,{present:r||i.open,children:w.jsx(M7,{...a,ref:t})}):null});DP.displayName=Dd;var M7=k.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,a=Fr(Dd,n);return w.jsx(pf,{as:bo,allowPinchZoom:!0,shards:[a.contentRef],children:w.jsx(Xe.div,{"data-state":zk(a.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),ai="DialogContent",IP=k.forwardRef((e,t)=>{const n=NP(ai,e.__scopeDialog),{forceMount:r=n.forceMount,...a}=e,i=Fr(ai,e.__scopeDialog);return w.jsx(Jn,{present:r||i.open,children:i.modal?w.jsx(F7,{...a,ref:t}):w.jsx(z7,{...a,ref:t})})});IP.displayName=ai;var F7=k.forwardRef((e,t)=>{const n=Fr(ai,e.__scopeDialog),r=k.useRef(null),a=ft(t,n.contentRef,r);return k.useEffect(()=>{const i=r.current;if(i)return Ik(i)},[]),w.jsx(LP,{...e,ref:a,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:We(e.onCloseAutoFocus,i=>{var l;i.preventDefault(),(l=n.triggerRef.current)==null||l.focus()}),onPointerDownOutside:We(e.onPointerDownOutside,i=>{const l=i.detail.originalEvent,u=l.button===0&&l.ctrlKey===!0;(l.button===2||u)&&i.preventDefault()}),onFocusOutside:We(e.onFocusOutside,i=>i.preventDefault())})}),z7=k.forwardRef((e,t)=>{const n=Fr(ai,e.__scopeDialog),r=k.useRef(!1),a=k.useRef(!1);return w.jsx(LP,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var l,u;(l=e.onCloseAutoFocus)==null||l.call(e,i),i.defaultPrevented||(r.current||(u=n.triggerRef.current)==null||u.focus(),i.preventDefault()),r.current=!1,a.current=!1},onInteractOutside:i=>{var c,f;(c=e.onInteractOutside)==null||c.call(e,i),i.defaultPrevented||(r.current=!0,i.detail.originalEvent.type==="pointerdown"&&(a.current=!0));const l=i.target;((f=n.triggerRef.current)==null?void 0:f.contains(l))&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&a.current&&i.preventDefault()}})}),LP=k.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:a,onCloseAutoFocus:i,...l}=e,u=Fr(ai,n),c=k.useRef(null),f=ft(t,c);return Dk(),w.jsxs(w.Fragment,{children:[w.jsx(cf,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:a,onUnmountAutoFocus:i,children:w.jsx(gu,{role:"dialog",id:u.contentId,"aria-describedby":u.descriptionId,"aria-labelledby":u.titleId,"data-state":zk(u.open),...l,ref:f,onDismiss:()=>u.onOpenChange(!1)})}),w.jsxs(w.Fragment,{children:[w.jsx(B7,{titleId:u.titleId}),w.jsx(j7,{contentRef:c,descriptionId:u.descriptionId})]})]})}),Fk="DialogTitle",MP=k.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,a=Fr(Fk,n);return w.jsx(Xe.h2,{id:a.titleId,...r,ref:t})});MP.displayName=Fk;var FP="DialogDescription",zP=k.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,a=Fr(FP,n);return w.jsx(Xe.p,{id:a.descriptionId,...r,ref:t})});zP.displayName=FP;var PP="DialogClose",BP=k.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,a=Fr(PP,n);return w.jsx(Xe.button,{type:"button",...r,ref:t,onClick:We(e.onClick,()=>a.onOpenChange(!1))})});BP.displayName=PP;function zk(e){return e?"open":"closed"}var UP="DialogTitleWarning",[P7,jP]=v8(UP,{contentName:ai,titleName:Fk,docsSlug:"dialog"}),B7=({titleId:e})=>{const t=jP(UP),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 k.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},U7="DialogDescriptionWarning",j7=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${jP(U7).contentName}}.`;return k.useEffect(()=>{var i;const a=(i=e.current)==null?void 0:i.getAttribute("aria-describedby");t&&a&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},Pk=_P,GP=CP,Bk=OP,gf=DP,hf=IP,Uk=MP,jk=zP,Gk=BP,HP="AlertDialog",[G7,Qye]=mr(HP,[TP]),La=TP(),$P=e=>{const{__scopeAlertDialog:t,...n}=e,r=La(t);return w.jsx(Pk,{...r,...n,modal:!0})};$P.displayName=HP;var H7="AlertDialogTrigger",$7=k.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,a=La(n);return w.jsx(GP,{...a,...r,ref:t})});$7.displayName=H7;var q7="AlertDialogPortal",qP=e=>{const{__scopeAlertDialog:t,...n}=e,r=La(t);return w.jsx(Bk,{...r,...n})};qP.displayName=q7;var V7="AlertDialogOverlay",VP=k.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,a=La(n);return w.jsx(gf,{...a,...r,ref:t})});VP.displayName=V7;var cl="AlertDialogContent",[W7,Y7]=G7(cl),WP=k.forwardRef((e,t)=>{const{__scopeAlertDialog:n,children:r,...a}=e,i=La(n),l=k.useRef(null),u=ft(t,l),c=k.useRef(null);return w.jsx(P7,{contentName:cl,titleName:YP,docsSlug:"alert-dialog",children:w.jsx(W7,{scope:n,cancelRef:c,children:w.jsxs(hf,{role:"alertdialog",...i,...a,ref:u,onOpenAutoFocus:We(a.onOpenAutoFocus,f=>{var p;f.preventDefault(),(p=c.current)==null||p.focus({preventScroll:!0})}),onPointerDownOutside:f=>f.preventDefault(),onInteractOutside:f=>f.preventDefault(),children:[w.jsx(Ok,{children:r}),w.jsx(X7,{contentRef:l})]})})})});WP.displayName=cl;var YP="AlertDialogTitle",KP=k.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,a=La(n);return w.jsx(Uk,{...a,...r,ref:t})});KP.displayName=YP;var XP="AlertDialogDescription",ZP=k.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,a=La(n);return w.jsx(jk,{...a,...r,ref:t})});ZP.displayName=XP;var K7="AlertDialogAction",QP=k.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,a=La(n);return w.jsx(Gk,{...a,...r,ref:t})});QP.displayName=K7;var JP="AlertDialogCancel",eB=k.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,{cancelRef:a}=Y7(JP,n),i=La(n),l=ft(t,a);return w.jsx(Gk,{...i,...r,ref:l})});eB.displayName=JP;var X7=({contentRef:e})=>{const t=`\`${cl}\` requires a description for the component to be accessible for screen reader users. + +You can add a description to the \`${cl}\` by passing a \`${XP}\` 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 \`${cl}\`. 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 k.useEffect(()=>{var r;document.getElementById((r=e.current)==null?void 0:r.getAttribute("aria-describedby"))||console.warn(t)},[t,e]),null},Z7=$P,Q7=qP,tB=VP,nB=WP,rB=QP,aB=eB,oB=KP,iB=ZP;const J7=["top","right","bottom","left"],yo=Math.min,Kn=Math.max,Id=Math.round,Gc=Math.floor,Kr=e=>({x:e,y:e}),eV={left:"right",right:"left",bottom:"top",top:"bottom"},tV={start:"end",end:"start"};function Ax(e,t,n){return Kn(e,yo(t,n))}function Da(e,t){return typeof e=="function"?e(t):e}function Ia(e){return e.split("-")[0]}function _l(e){return e.split("-")[1]}function Hk(e){return e==="x"?"y":"x"}function $k(e){return e==="y"?"height":"width"}function vo(e){return["top","bottom"].includes(Ia(e))?"y":"x"}function qk(e){return Hk(vo(e))}function nV(e,t,n){n===void 0&&(n=!1);const r=_l(e),a=qk(e),i=$k(a);let l=a==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(l=Ld(l)),[l,Ld(l)]}function rV(e){const t=Ld(e);return[Tx(e),t,Tx(t)]}function Tx(e){return e.replace(/start|end/g,t=>tV[t])}function aV(e,t,n){const r=["left","right"],a=["right","left"],i=["top","bottom"],l=["bottom","top"];switch(e){case"top":case"bottom":return n?t?a:r:t?r:a;case"left":case"right":return t?i:l;default:return[]}}function oV(e,t,n,r){const a=_l(e);let i=aV(Ia(e),n==="start",r);return a&&(i=i.map(l=>l+"-"+a),t&&(i=i.concat(i.map(Tx)))),i}function Ld(e){return e.replace(/left|right|bottom|top/g,t=>eV[t])}function iV(e){return{top:0,right:0,bottom:0,left:0,...e}}function lB(e){return typeof e!="number"?iV(e):{top:e,right:e,bottom:e,left:e}}function Md(e){const{x:t,y:n,width:r,height:a}=e;return{width:r,height:a,top:n,left:t,right:t+r,bottom:n+a,x:t,y:n}}function zR(e,t,n){let{reference:r,floating:a}=e;const i=vo(t),l=qk(t),u=$k(l),c=Ia(t),f=i==="y",p=r.x+r.width/2-a.width/2,g=r.y+r.height/2-a.height/2,b=r[u]/2-a[u]/2;let m;switch(c){case"top":m={x:p,y:r.y-a.height};break;case"bottom":m={x:p,y:r.y+r.height};break;case"right":m={x:r.x+r.width,y:g};break;case"left":m={x:r.x-a.width,y:g};break;default:m={x:r.x,y:r.y}}switch(_l(t)){case"start":m[l]-=b*(n&&f?-1:1);break;case"end":m[l]+=b*(n&&f?-1:1);break}return m}const lV=async(e,t,n)=>{const{placement:r="bottom",strategy:a="absolute",middleware:i=[],platform:l}=n,u=i.filter(Boolean),c=await(l.isRTL==null?void 0:l.isRTL(t));let f=await l.getElementRects({reference:e,floating:t,strategy:a}),{x:p,y:g}=zR(f,r,c),b=r,m={},S=0;for(let v=0;v({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:a,rects:i,platform:l,elements:u,middlewareData:c}=t,{element:f,padding:p=0}=Da(e,t)||{};if(f==null)return{};const g=lB(p),b={x:n,y:r},m=qk(a),S=$k(m),v=await l.getDimensions(f),A=m==="y",R=A?"top":"left",x=A?"bottom":"right",_=A?"clientHeight":"clientWidth",C=i.reference[S]+i.reference[m]-b[m]-i.floating[S],N=b[m]-i.reference[m],T=await(l.getOffsetParent==null?void 0:l.getOffsetParent(f));let O=T?T[_]:0;(!O||!await(l.isElement==null?void 0:l.isElement(T)))&&(O=u.floating[_]||i.floating[S]);const z=C/2-N/2,I=O/2-v[S]/2-1,M=yo(g[R],I),H=yo(g[x],I),q=M,U=O-v[S]-H,W=O/2-v[S]/2+z,Z=Ax(q,W,U),j=!c.arrow&&_l(a)!=null&&W!==Z&&i.reference[S]/2-(WW<=0)){var H,q;const W=(((H=i.flip)==null?void 0:H.index)||0)+1,Z=O[W];if(Z)return{data:{index:W,overflows:M},reset:{placement:Z}};let j=(q=M.filter(G=>G.overflows[0]<=0).sort((G,P)=>G.overflows[1]-P.overflows[1])[0])==null?void 0:q.placement;if(!j)switch(m){case"bestFit":{var U;const G=(U=M.filter(P=>{if(T){const X=vo(P.placement);return X===x||X==="y"}return!0}).map(P=>[P.placement,P.overflows.filter(X=>X>0).reduce((X,D)=>X+D,0)]).sort((P,X)=>P[1]-X[1])[0])==null?void 0:U[0];G&&(j=G);break}case"initialPlacement":j=u;break}if(a!==j)return{reset:{placement:j}}}return{}}}};function PR(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function BR(e){return J7.some(t=>e[t]>=0)}const cV=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...a}=Da(e,t);switch(r){case"referenceHidden":{const i=await Js(t,{...a,elementContext:"reference"}),l=PR(i,n.reference);return{data:{referenceHiddenOffsets:l,referenceHidden:BR(l)}}}case"escaped":{const i=await Js(t,{...a,altBoundary:!0}),l=PR(i,n.floating);return{data:{escapedOffsets:l,escaped:BR(l)}}}default:return{}}}}};async function dV(e,t){const{placement:n,platform:r,elements:a}=e,i=await(r.isRTL==null?void 0:r.isRTL(a.floating)),l=Ia(n),u=_l(n),c=vo(n)==="y",f=["left","top"].includes(l)?-1:1,p=i&&c?-1:1,g=Da(t,e);let{mainAxis:b,crossAxis:m,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"&&(m=u==="end"?S*-1:S),c?{x:m*p,y:b*f}:{x:b*f,y:m*p}}const fV=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:a,y:i,placement:l,middlewareData:u}=t,c=await dV(t,e);return l===((n=u.offset)==null?void 0:n.placement)&&(r=u.arrow)!=null&&r.alignmentOffset?{}:{x:a+c.x,y:i+c.y,data:{...c,placement:l}}}}},pV=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:a}=t,{mainAxis:i=!0,crossAxis:l=!1,limiter:u={fn:A=>{let{x:R,y:x}=A;return{x:R,y:x}}},...c}=Da(e,t),f={x:n,y:r},p=await Js(t,c),g=vo(Ia(a)),b=Hk(g);let m=f[b],S=f[g];if(i){const A=b==="y"?"top":"left",R=b==="y"?"bottom":"right",x=m+p[A],_=m-p[R];m=Ax(x,m,_)}if(l){const A=g==="y"?"top":"left",R=g==="y"?"bottom":"right",x=S+p[A],_=S-p[R];S=Ax(x,S,_)}const v=u.fn({...t,[b]:m,[g]:S});return{...v,data:{x:v.x-n,y:v.y-r,enabled:{[b]:i,[g]:l}}}}}},gV=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:a,rects:i,middlewareData:l}=t,{offset:u=0,mainAxis:c=!0,crossAxis:f=!0}=Da(e,t),p={x:n,y:r},g=vo(a),b=Hk(g);let m=p[b],S=p[g];const v=Da(u,t),A=typeof v=="number"?{mainAxis:v,crossAxis:0}:{mainAxis:0,crossAxis:0,...v};if(c){const _=b==="y"?"height":"width",C=i.reference[b]-i.floating[_]+A.mainAxis,N=i.reference[b]+i.reference[_]-A.mainAxis;mN&&(m=N)}if(f){var R,x;const _=b==="y"?"width":"height",C=["top","left"].includes(Ia(a)),N=i.reference[g]-i.floating[_]+(C&&((R=l.offset)==null?void 0:R[g])||0)+(C?0:A.crossAxis),T=i.reference[g]+i.reference[_]+(C?0:((x=l.offset)==null?void 0:x[g])||0)-(C?A.crossAxis:0);ST&&(S=T)}return{[b]:m,[g]:S}}}},hV=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:a,rects:i,platform:l,elements:u}=t,{apply:c=()=>{},...f}=Da(e,t),p=await Js(t,f),g=Ia(a),b=_l(a),m=vo(a)==="y",{width:S,height:v}=i.floating;let A,R;g==="top"||g==="bottom"?(A=g,R=b===(await(l.isRTL==null?void 0:l.isRTL(u.floating))?"start":"end")?"left":"right"):(R=g,A=b==="end"?"top":"bottom");const x=v-p.top-p.bottom,_=S-p.left-p.right,C=yo(v-p[A],x),N=yo(S-p[R],_),T=!t.middlewareData.shift;let O=C,z=N;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(z=_),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(O=x),T&&!b){const M=Kn(p.left,0),H=Kn(p.right,0),q=Kn(p.top,0),U=Kn(p.bottom,0);m?z=S-2*(M!==0||H!==0?M+H:Kn(p.left,p.right)):O=v-2*(q!==0||U!==0?q+U:Kn(p.top,p.bottom))}await c({...t,availableWidth:z,availableHeight:O});const I=await l.getDimensions(u.floating);return S!==I.width||v!==I.height?{reset:{rects:!0}}:{}}}};function mf(){return typeof window<"u"}function Rl(e){return sB(e)?(e.nodeName||"").toLowerCase():"#document"}function Zn(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Zr(e){var t;return(t=(sB(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function sB(e){return mf()?e instanceof Node||e instanceof Zn(e).Node:!1}function Dr(e){return mf()?e instanceof Element||e instanceof Zn(e).Element:!1}function Xr(e){return mf()?e instanceof HTMLElement||e instanceof Zn(e).HTMLElement:!1}function UR(e){return!mf()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Zn(e).ShadowRoot}function hu(e){const{overflow:t,overflowX:n,overflowY:r,display:a}=Ir(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(a)}function mV(e){return["table","td","th"].includes(Rl(e))}function bf(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function Vk(e){const t=Wk(),n=Dr(e)?Ir(e):e;return["transform","translate","scale","rotate","perspective"].some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||["transform","translate","scale","rotate","perspective","filter"].some(r=>(n.willChange||"").includes(r))||["paint","layout","strict","content"].some(r=>(n.contain||"").includes(r))}function bV(e){let t=So(e);for(;Xr(t)&&!hl(t);){if(Vk(t))return t;if(bf(t))return null;t=So(t)}return null}function Wk(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function hl(e){return["html","body","#document"].includes(Rl(e))}function Ir(e){return Zn(e).getComputedStyle(e)}function yf(e){return Dr(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function So(e){if(Rl(e)==="html")return e;const t=e.assignedSlot||e.parentNode||UR(e)&&e.host||Zr(e);return UR(t)?t.host:t}function uB(e){const t=So(e);return hl(t)?e.ownerDocument?e.ownerDocument.body:e.body:Xr(t)&&hu(t)?t:uB(t)}function eu(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const a=uB(e),i=a===((r=e.ownerDocument)==null?void 0:r.body),l=Zn(a);if(i){const u=_x(l);return t.concat(l,l.visualViewport||[],hu(a)?a:[],u&&n?eu(u):[])}return t.concat(a,eu(a,[],n))}function _x(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function cB(e){const t=Ir(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const a=Xr(e),i=a?e.offsetWidth:n,l=a?e.offsetHeight:r,u=Id(n)!==i||Id(r)!==l;return u&&(n=i,r=l),{width:n,height:r,$:u}}function Yk(e){return Dr(e)?e:e.contextElement}function dl(e){const t=Yk(e);if(!Xr(t))return Kr(1);const n=t.getBoundingClientRect(),{width:r,height:a,$:i}=cB(t);let l=(i?Id(n.width):n.width)/r,u=(i?Id(n.height):n.height)/a;return(!l||!Number.isFinite(l))&&(l=1),(!u||!Number.isFinite(u))&&(u=1),{x:l,y:u}}const yV=Kr(0);function dB(e){const t=Zn(e);return!Wk()||!t.visualViewport?yV:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function vV(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Zn(e)?!1:t}function oi(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const a=e.getBoundingClientRect(),i=Yk(e);let l=Kr(1);t&&(r?Dr(r)&&(l=dl(r)):l=dl(e));const u=vV(i,n,r)?dB(i):Kr(0);let c=(a.left+u.x)/l.x,f=(a.top+u.y)/l.y,p=a.width/l.x,g=a.height/l.y;if(i){const b=Zn(i),m=r&&Dr(r)?Zn(r):r;let S=b,v=_x(S);for(;v&&r&&m!==S;){const A=dl(v),R=v.getBoundingClientRect(),x=Ir(v),_=R.left+(v.clientLeft+parseFloat(x.paddingLeft))*A.x,C=R.top+(v.clientTop+parseFloat(x.paddingTop))*A.y;c*=A.x,f*=A.y,p*=A.x,g*=A.y,c+=_,f+=C,S=Zn(v),v=_x(S)}}return Md({width:p,height:g,x:c,y:f})}function Kk(e,t){const n=yf(e).scrollLeft;return t?t.left+n:oi(Zr(e)).left+n}function fB(e,t,n){n===void 0&&(n=!1);const r=e.getBoundingClientRect(),a=r.left+t.scrollLeft-(n?0:Kk(e,r)),i=r.top+t.scrollTop;return{x:a,y:i}}function SV(e){let{elements:t,rect:n,offsetParent:r,strategy:a}=e;const i=a==="fixed",l=Zr(r),u=t?bf(t.floating):!1;if(r===l||u&&i)return n;let c={scrollLeft:0,scrollTop:0},f=Kr(1);const p=Kr(0),g=Xr(r);if((g||!g&&!i)&&((Rl(r)!=="body"||hu(l))&&(c=yf(r)),Xr(r))){const m=oi(r);f=dl(r),p.x=m.x+r.clientLeft,p.y=m.y+r.clientTop}const b=l&&!g&&!i?fB(l,c,!0):Kr(0);return{width:n.width*f.x,height:n.height*f.y,x:n.x*f.x-c.scrollLeft*f.x+p.x+b.x,y:n.y*f.y-c.scrollTop*f.y+p.y+b.y}}function EV(e){return Array.from(e.getClientRects())}function wV(e){const t=Zr(e),n=yf(e),r=e.ownerDocument.body,a=Kn(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=Kn(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let l=-n.scrollLeft+Kk(e);const u=-n.scrollTop;return Ir(r).direction==="rtl"&&(l+=Kn(t.clientWidth,r.clientWidth)-a),{width:a,height:i,x:l,y:u}}function xV(e,t){const n=Zn(e),r=Zr(e),a=n.visualViewport;let i=r.clientWidth,l=r.clientHeight,u=0,c=0;if(a){i=a.width,l=a.height;const f=Wk();(!f||f&&t==="fixed")&&(u=a.offsetLeft,c=a.offsetTop)}return{width:i,height:l,x:u,y:c}}function kV(e,t){const n=oi(e,!0,t==="fixed"),r=n.top+e.clientTop,a=n.left+e.clientLeft,i=Xr(e)?dl(e):Kr(1),l=e.clientWidth*i.x,u=e.clientHeight*i.y,c=a*i.x,f=r*i.y;return{width:l,height:u,x:c,y:f}}function jR(e,t,n){let r;if(t==="viewport")r=xV(e,n);else if(t==="document")r=wV(Zr(e));else if(Dr(t))r=kV(t,n);else{const a=dB(e);r={x:t.x-a.x,y:t.y-a.y,width:t.width,height:t.height}}return Md(r)}function pB(e,t){const n=So(e);return n===t||!Dr(n)||hl(n)?!1:Ir(n).position==="fixed"||pB(n,t)}function AV(e,t){const n=t.get(e);if(n)return n;let r=eu(e,[],!1).filter(u=>Dr(u)&&Rl(u)!=="body"),a=null;const i=Ir(e).position==="fixed";let l=i?So(e):e;for(;Dr(l)&&!hl(l);){const u=Ir(l),c=Vk(l);!c&&u.position==="fixed"&&(a=null),(i?!c&&!a:!c&&u.position==="static"&&!!a&&["absolute","fixed"].includes(a.position)||hu(l)&&!c&&pB(e,l))?r=r.filter(p=>p!==l):a=u,l=So(l)}return t.set(e,r),r}function TV(e){let{element:t,boundary:n,rootBoundary:r,strategy:a}=e;const l=[...n==="clippingAncestors"?bf(t)?[]:AV(t,this._c):[].concat(n),r],u=l[0],c=l.reduce((f,p)=>{const g=jR(t,p,a);return f.top=Kn(g.top,f.top),f.right=yo(g.right,f.right),f.bottom=yo(g.bottom,f.bottom),f.left=Kn(g.left,f.left),f},jR(t,u,a));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function _V(e){const{width:t,height:n}=cB(e);return{width:t,height:n}}function RV(e,t,n){const r=Xr(t),a=Zr(t),i=n==="fixed",l=oi(e,!0,i,t);let u={scrollLeft:0,scrollTop:0};const c=Kr(0);if(r||!r&&!i)if((Rl(t)!=="body"||hu(a))&&(u=yf(t)),r){const b=oi(t,!0,i,t);c.x=b.x+t.clientLeft,c.y=b.y+t.clientTop}else a&&(c.x=Kk(a));const f=a&&!r&&!i?fB(a,u):Kr(0),p=l.left+u.scrollLeft-c.x-f.x,g=l.top+u.scrollTop-c.y-f.y;return{x:p,y:g,width:l.width,height:l.height}}function Sh(e){return Ir(e).position==="static"}function GR(e,t){if(!Xr(e)||Ir(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Zr(e)===n&&(n=n.ownerDocument.body),n}function gB(e,t){const n=Zn(e);if(bf(e))return n;if(!Xr(e)){let a=So(e);for(;a&&!hl(a);){if(Dr(a)&&!Sh(a))return a;a=So(a)}return n}let r=GR(e,t);for(;r&&mV(r)&&Sh(r);)r=GR(r,t);return r&&hl(r)&&Sh(r)&&!Vk(r)?n:r||bV(e)||n}const CV=async function(e){const t=this.getOffsetParent||gB,n=this.getDimensions,r=await n(e.floating);return{reference:RV(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function NV(e){return Ir(e).direction==="rtl"}const OV={convertOffsetParentRelativeRectToViewportRelativeRect:SV,getDocumentElement:Zr,getClippingRect:TV,getOffsetParent:gB,getElementRects:CV,getClientRects:EV,getDimensions:_V,getScale:dl,isElement:Dr,isRTL:NV};function hB(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function DV(e,t){let n=null,r;const a=Zr(e);function i(){var u;clearTimeout(r),(u=n)==null||u.disconnect(),n=null}function l(u,c){u===void 0&&(u=!1),c===void 0&&(c=1),i();const f=e.getBoundingClientRect(),{left:p,top:g,width:b,height:m}=f;if(u||t(),!b||!m)return;const S=Gc(g),v=Gc(a.clientWidth-(p+b)),A=Gc(a.clientHeight-(g+m)),R=Gc(p),_={rootMargin:-S+"px "+-v+"px "+-A+"px "+-R+"px",threshold:Kn(0,yo(1,c))||1};let C=!0;function N(T){const O=T[0].intersectionRatio;if(O!==c){if(!C)return l();O?l(!1,O):r=setTimeout(()=>{l(!1,1e-7)},1e3)}O===1&&!hB(f,e.getBoundingClientRect())&&l(),C=!1}try{n=new IntersectionObserver(N,{..._,root:a.ownerDocument})}catch{n=new IntersectionObserver(N,_)}n.observe(e)}return l(!0),i}function IV(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:a=!0,ancestorResize:i=!0,elementResize:l=typeof ResizeObserver=="function",layoutShift:u=typeof IntersectionObserver=="function",animationFrame:c=!1}=r,f=Yk(e),p=a||i?[...f?eu(f):[],...eu(t)]:[];p.forEach(R=>{a&&R.addEventListener("scroll",n,{passive:!0}),i&&R.addEventListener("resize",n)});const g=f&&u?DV(f,n):null;let b=-1,m=null;l&&(m=new ResizeObserver(R=>{let[x]=R;x&&x.target===f&&m&&(m.unobserve(t),cancelAnimationFrame(b),b=requestAnimationFrame(()=>{var _;(_=m)==null||_.observe(t)})),n()}),f&&!c&&m.observe(f),m.observe(t));let S,v=c?oi(e):null;c&&A();function A(){const R=oi(e);v&&!hB(v,R)&&n(),v=R,S=requestAnimationFrame(A)}return n(),()=>{var R;p.forEach(x=>{a&&x.removeEventListener("scroll",n),i&&x.removeEventListener("resize",n)}),g==null||g(),(R=m)==null||R.disconnect(),m=null,c&&cancelAnimationFrame(S)}}const LV=fV,MV=pV,FV=uV,zV=hV,PV=cV,HR=sV,BV=gV,UV=(e,t,n)=>{const r=new Map,a={platform:OV,...n},i={...a.platform,_c:r};return lV(e,t,{...a,platform:i})};var bd=typeof document<"u"?k.useLayoutEffect:k.useEffect;function Fd(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,a;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!Fd(e[r],t[r]))return!1;return!0}if(a=Object.keys(e),n=a.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,a[r]))return!1;for(r=n;r--!==0;){const i=a[r];if(!(i==="_owner"&&e.$$typeof)&&!Fd(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function mB(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function $R(e,t){const n=mB(e);return Math.round(t*n)/n}function Eh(e){const t=k.useRef(e);return bd(()=>{t.current=e}),t}function jV(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:a,elements:{reference:i,floating:l}={},transform:u=!0,whileElementsMounted:c,open:f}=e,[p,g]=k.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[b,m]=k.useState(r);Fd(b,r)||m(r);const[S,v]=k.useState(null),[A,R]=k.useState(null),x=k.useCallback(P=>{P!==T.current&&(T.current=P,v(P))},[]),_=k.useCallback(P=>{P!==O.current&&(O.current=P,R(P))},[]),C=i||S,N=l||A,T=k.useRef(null),O=k.useRef(null),z=k.useRef(p),I=c!=null,M=Eh(c),H=Eh(a),q=Eh(f),U=k.useCallback(()=>{if(!T.current||!O.current)return;const P={placement:t,strategy:n,middleware:b};H.current&&(P.platform=H.current),UV(T.current,O.current,P).then(X=>{const D={...X,isPositioned:q.current!==!1};W.current&&!Fd(z.current,D)&&(z.current=D,pu.flushSync(()=>{g(D)}))})},[b,t,n,H,q]);bd(()=>{f===!1&&z.current.isPositioned&&(z.current.isPositioned=!1,g(P=>({...P,isPositioned:!1})))},[f]);const W=k.useRef(!1);bd(()=>(W.current=!0,()=>{W.current=!1}),[]),bd(()=>{if(C&&(T.current=C),N&&(O.current=N),C&&N){if(M.current)return M.current(C,N,U);U()}},[C,N,U,M,I]);const Z=k.useMemo(()=>({reference:T,floating:O,setReference:x,setFloating:_}),[x,_]),j=k.useMemo(()=>({reference:C,floating:N}),[C,N]),G=k.useMemo(()=>{const P={position:n,left:0,top:0};if(!j.floating)return P;const X=$R(j.floating,p.x),D=$R(j.floating,p.y);return u?{...P,transform:"translate("+X+"px, "+D+"px)",...mB(j.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:X,top:D}},[n,u,j.floating,p.x,p.y]);return k.useMemo(()=>({...p,update:U,refs:Z,elements:j,floatingStyles:G}),[p,U,Z,j,G])}const GV=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:a}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?HR({element:r.current,padding:a}).fn(n):{}:r?HR({element:r,padding:a}).fn(n):{}}}},HV=(e,t)=>({...LV(e),options:[e,t]}),$V=(e,t)=>({...MV(e),options:[e,t]}),qV=(e,t)=>({...BV(e),options:[e,t]}),VV=(e,t)=>({...FV(e),options:[e,t]}),WV=(e,t)=>({...zV(e),options:[e,t]}),YV=(e,t)=>({...PV(e),options:[e,t]}),KV=(e,t)=>({...GV(e),options:[e,t]});var XV="Arrow",bB=k.forwardRef((e,t)=>{const{children:n,width:r=10,height:a=5,...i}=e;return w.jsx(Xe.svg,{...i,ref:t,width:r,height:a,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:w.jsx("polygon",{points:"0,0 30,0 15,10"})})});bB.displayName=XV;var ZV=bB;function yB(e){const[t,n]=k.useState(void 0);return wn(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(a=>{if(!Array.isArray(a)||!a.length)return;const i=a[0];let l,u;if("borderBoxSize"in i){const c=i.borderBoxSize,f=Array.isArray(c)?c[0]:c;l=f.inlineSize,u=f.blockSize}else l=e.offsetWidth,u=e.offsetHeight;n({width:l,height:u})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var Xk="Popper",[vB,Cl]=mr(Xk),[QV,SB]=vB(Xk),EB=e=>{const{__scopePopper:t,children:n}=e,[r,a]=k.useState(null);return w.jsx(QV,{scope:t,anchor:r,onAnchorChange:a,children:n})};EB.displayName=Xk;var wB="PopperAnchor",xB=k.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...a}=e,i=SB(wB,n),l=k.useRef(null),u=ft(t,l);return k.useEffect(()=>{i.onAnchorChange((r==null?void 0:r.current)||l.current)}),r?null:w.jsx(Xe.div,{...a,ref:u})});xB.displayName=wB;var Zk="PopperContent",[JV,eW]=vB(Zk),kB=k.forwardRef((e,t)=>{var re,le,Ae,ae,we,xe;const{__scopePopper:n,side:r="bottom",sideOffset:a=0,align:i="center",alignOffset:l=0,arrowPadding:u=0,avoidCollisions:c=!0,collisionBoundary:f=[],collisionPadding:p=0,sticky:g="partial",hideWhenDetached:b=!1,updatePositionStrategy:m="optimized",onPlaced:S,...v}=e,A=SB(Zk,n),[R,x]=k.useState(null),_=ft(t,Ie=>x(Ie)),[C,N]=k.useState(null),T=yB(C),O=(T==null?void 0:T.width)??0,z=(T==null?void 0:T.height)??0,I=r+(i!=="center"?"-"+i:""),M=typeof p=="number"?p:{top:0,right:0,bottom:0,left:0,...p},H=Array.isArray(f)?f:[f],q=H.length>0,U={padding:M,boundary:H.filter(nW),altBoundary:q},{refs:W,floatingStyles:Z,placement:j,isPositioned:G,middlewareData:P}=jV({strategy:"fixed",placement:I,whileElementsMounted:(...Ie)=>IV(...Ie,{animationFrame:m==="always"}),elements:{reference:A.anchor},middleware:[HV({mainAxis:a+z,alignmentAxis:l}),c&&$V({mainAxis:!0,crossAxis:!1,limiter:g==="partial"?qV():void 0,...U}),c&&VV({...U}),WV({...U,apply:({elements:Ie,rects:Ce,availableWidth:Ee,availableHeight:J})=>{const{width:fe,height:ke}=Ce.reference,me=Ie.floating.style;me.setProperty("--radix-popper-available-width",`${Ee}px`),me.setProperty("--radix-popper-available-height",`${J}px`),me.setProperty("--radix-popper-anchor-width",`${fe}px`),me.setProperty("--radix-popper-anchor-height",`${ke}px`)}}),C&&KV({element:C,padding:u}),rW({arrowWidth:O,arrowHeight:z}),b&&YV({strategy:"referenceHidden",...U})]}),[X,D]=_B(j),V=pn(S);wn(()=>{G&&(V==null||V())},[G,V]);const B=(re=P.arrow)==null?void 0:re.x,L=(le=P.arrow)==null?void 0:le.y,Y=((Ae=P.arrow)==null?void 0:Ae.centerOffset)!==0,[Q,se]=k.useState();return wn(()=>{R&&se(window.getComputedStyle(R).zIndex)},[R]),w.jsx("div",{ref:W.setFloating,"data-radix-popper-content-wrapper":"",style:{...Z,transform:G?Z.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:Q,"--radix-popper-transform-origin":[(ae=P.transformOrigin)==null?void 0:ae.x,(we=P.transformOrigin)==null?void 0:we.y].join(" "),...((xe=P.hide)==null?void 0:xe.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:w.jsx(JV,{scope:n,placedSide:X,onArrowChange:N,arrowX:B,arrowY:L,shouldHideArrow:Y,children:w.jsx(Xe.div,{"data-side":X,"data-align":D,...v,ref:_,style:{...v.style,animation:G?void 0:"none"}})})})});kB.displayName=Zk;var AB="PopperArrow",tW={top:"bottom",right:"left",bottom:"top",left:"right"},TB=k.forwardRef(function(t,n){const{__scopePopper:r,...a}=t,i=eW(AB,r),l=tW[i.placedSide];return w.jsx("span",{ref:i.onArrowChange,style:{position:"absolute",left:i.arrowX,top:i.arrowY,[l]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[i.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[i.placedSide],visibility:i.shouldHideArrow?"hidden":void 0},children:w.jsx(ZV,{...a,ref:n,style:{...a.style,display:"block"}})})});TB.displayName=AB;function nW(e){return e!==null}var rW=e=>({name:"transformOrigin",options:e,fn(t){var A,R,x;const{placement:n,rects:r,middlewareData:a}=t,l=((A=a.arrow)==null?void 0:A.centerOffset)!==0,u=l?0:e.arrowWidth,c=l?0:e.arrowHeight,[f,p]=_B(n),g={start:"0%",center:"50%",end:"100%"}[p],b=(((R=a.arrow)==null?void 0:R.x)??0)+u/2,m=(((x=a.arrow)==null?void 0:x.y)??0)+c/2;let S="",v="";return f==="bottom"?(S=l?g:`${b}px`,v=`${-c}px`):f==="top"?(S=l?g:`${b}px`,v=`${r.floating.height+c}px`):f==="right"?(S=`${-c}px`,v=l?g:`${m}px`):f==="left"&&(S=`${r.floating.width+c}px`,v=l?g:`${m}px`),{data:{x:S,y:v}}}});function _B(e){const[t,n="center"]=e.split("-");return[t,n]}var Qk=EB,vf=xB,Jk=kB,e0=TB,aW="VisuallyHidden",t0=k.forwardRef((e,t)=>w.jsx(Xe.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}}));t0.displayName=aW;var oW=t0,[Sf,Jye]=mr("Tooltip",[Cl]),Ef=Cl(),RB="TooltipProvider",iW=700,Rx="tooltip.open",[lW,n0]=Sf(RB),CB=e=>{const{__scopeTooltip:t,delayDuration:n=iW,skipDelayDuration:r=300,disableHoverableContent:a=!1,children:i}=e,[l,u]=k.useState(!0),c=k.useRef(!1),f=k.useRef(0);return k.useEffect(()=>{const p=f.current;return()=>window.clearTimeout(p)},[]),w.jsx(lW,{scope:t,isOpenDelayed:l,delayDuration:n,onOpen:k.useCallback(()=>{window.clearTimeout(f.current),u(!1)},[]),onClose:k.useCallback(()=>{window.clearTimeout(f.current),f.current=window.setTimeout(()=>u(!0),r)},[r]),isPointerInTransitRef:c,onPointerInTransitChange:k.useCallback(p=>{c.current=p},[]),disableHoverableContent:a,children:i})};CB.displayName=RB;var wf="Tooltip",[sW,xf]=Sf(wf),NB=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:a=!1,onOpenChange:i,disableHoverableContent:l,delayDuration:u}=e,c=n0(wf,e.__scopeTooltip),f=Ef(t),[p,g]=k.useState(null),b=En(),m=k.useRef(0),S=l??c.disableHoverableContent,v=u??c.delayDuration,A=k.useRef(!1),[R=!1,x]=Oa({prop:r,defaultProp:a,onChange:O=>{O?(c.onOpen(),document.dispatchEvent(new CustomEvent(Rx))):c.onClose(),i==null||i(O)}}),_=k.useMemo(()=>R?A.current?"delayed-open":"instant-open":"closed",[R]),C=k.useCallback(()=>{window.clearTimeout(m.current),m.current=0,A.current=!1,x(!0)},[x]),N=k.useCallback(()=>{window.clearTimeout(m.current),m.current=0,x(!1)},[x]),T=k.useCallback(()=>{window.clearTimeout(m.current),m.current=window.setTimeout(()=>{A.current=!0,x(!0),m.current=0},v)},[v,x]);return k.useEffect(()=>()=>{m.current&&(window.clearTimeout(m.current),m.current=0)},[]),w.jsx(Qk,{...f,children:w.jsx(sW,{scope:t,contentId:b,open:R,stateAttribute:_,trigger:p,onTriggerChange:g,onTriggerEnter:k.useCallback(()=>{c.isOpenDelayed?T():C()},[c.isOpenDelayed,T,C]),onTriggerLeave:k.useCallback(()=>{S?N():(window.clearTimeout(m.current),m.current=0)},[N,S]),onOpen:C,onClose:N,disableHoverableContent:S,children:n})})};NB.displayName=wf;var Cx="TooltipTrigger",OB=k.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,a=xf(Cx,n),i=n0(Cx,n),l=Ef(n),u=k.useRef(null),c=ft(t,u,a.onTriggerChange),f=k.useRef(!1),p=k.useRef(!1),g=k.useCallback(()=>f.current=!1,[]);return k.useEffect(()=>()=>document.removeEventListener("pointerup",g),[g]),w.jsx(vf,{asChild:!0,...l,children:w.jsx(Xe.button,{"aria-describedby":a.open?a.contentId:void 0,"data-state":a.stateAttribute,...r,ref:c,onPointerMove:We(e.onPointerMove,b=>{b.pointerType!=="touch"&&!p.current&&!i.isPointerInTransitRef.current&&(a.onTriggerEnter(),p.current=!0)}),onPointerLeave:We(e.onPointerLeave,()=>{a.onTriggerLeave(),p.current=!1}),onPointerDown:We(e.onPointerDown,()=>{f.current=!0,document.addEventListener("pointerup",g,{once:!0})}),onFocus:We(e.onFocus,()=>{f.current||a.onOpen()}),onBlur:We(e.onBlur,a.onClose),onClick:We(e.onClick,a.onClose)})})});OB.displayName=Cx;var uW="TooltipPortal",[eve,cW]=Sf(uW,{forceMount:void 0}),ml="TooltipContent",DB=k.forwardRef((e,t)=>{const n=cW(ml,e.__scopeTooltip),{forceMount:r=n.forceMount,side:a="top",...i}=e,l=xf(ml,e.__scopeTooltip);return w.jsx(Jn,{present:r||l.open,children:l.disableHoverableContent?w.jsx(IB,{side:a,...i,ref:t}):w.jsx(dW,{side:a,...i,ref:t})})}),dW=k.forwardRef((e,t)=>{const n=xf(ml,e.__scopeTooltip),r=n0(ml,e.__scopeTooltip),a=k.useRef(null),i=ft(t,a),[l,u]=k.useState(null),{trigger:c,onClose:f}=n,p=a.current,{onPointerInTransitChange:g}=r,b=k.useCallback(()=>{u(null),g(!1)},[g]),m=k.useCallback((S,v)=>{const A=S.currentTarget,R={x:S.clientX,y:S.clientY},x=hW(R,A.getBoundingClientRect()),_=mW(R,x),C=bW(v.getBoundingClientRect()),N=vW([..._,...C]);u(N),g(!0)},[g]);return k.useEffect(()=>()=>b(),[b]),k.useEffect(()=>{if(c&&p){const S=A=>m(A,p),v=A=>m(A,c);return c.addEventListener("pointerleave",S),p.addEventListener("pointerleave",v),()=>{c.removeEventListener("pointerleave",S),p.removeEventListener("pointerleave",v)}}},[c,p,m,b]),k.useEffect(()=>{if(l){const S=v=>{const A=v.target,R={x:v.clientX,y:v.clientY},x=(c==null?void 0:c.contains(A))||(p==null?void 0:p.contains(A)),_=!yW(R,l);x?b():_&&(b(),f())};return document.addEventListener("pointermove",S),()=>document.removeEventListener("pointermove",S)}},[c,p,l,f,b]),w.jsx(IB,{...e,ref:i})}),[fW,pW]=Sf(wf,{isInside:!1}),IB=k.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":a,onEscapeKeyDown:i,onPointerDownOutside:l,...u}=e,c=xf(ml,n),f=Ef(n),{onClose:p}=c;return k.useEffect(()=>(document.addEventListener(Rx,p),()=>document.removeEventListener(Rx,p)),[p]),k.useEffect(()=>{if(c.trigger){const g=b=>{const m=b.target;m!=null&&m.contains(c.trigger)&&p()};return window.addEventListener("scroll",g,{capture:!0}),()=>window.removeEventListener("scroll",g,{capture:!0})}},[c.trigger,p]),w.jsx(gu,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:i,onPointerDownOutside:l,onFocusOutside:g=>g.preventDefault(),onDismiss:p,children:w.jsxs(Jk,{"data-state":c.stateAttribute,...f,...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:[w.jsx(Ok,{children:r}),w.jsx(fW,{scope:n,isInside:!0,children:w.jsx(oW,{id:c.contentId,role:"tooltip",children:a||r})})]})})});DB.displayName=ml;var LB="TooltipArrow",gW=k.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,a=Ef(n);return pW(LB,n).isInside?null:w.jsx(e0,{...a,...r,ref:t})});gW.displayName=LB;function hW(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),a=Math.abs(t.right-e.x),i=Math.abs(t.left-e.x);switch(Math.min(n,r,a,i)){case i:return"left";case a:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function mW(e,t,n=5){const r=[];switch(t){case"top":r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}function bW(e){const{top:t,right:n,bottom:r,left:a}=e;return[{x:a,y:t},{x:n,y:t},{x:n,y:r},{x:a,y:r}]}function yW(e,t){const{x:n,y:r}=e;let a=!1;for(let i=0,l=t.length-1;ir!=p>r&&n<(f-u)*(r-c)/(p-c)+u&&(a=!a)}return a}function vW(e){const t=e.slice();return t.sort((n,r)=>n.xr.x?1:n.yr.y?1:0),SW(t)}function SW(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r=2;){const i=t[t.length-1],l=t[t.length-2];if((i.x-l.x)*(a.y-l.y)>=(i.y-l.y)*(a.x-l.x))t.pop();else break}t.push(a)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const a=e[r];for(;n.length>=2;){const i=n[n.length-1],l=n[n.length-2];if((i.x-l.x)*(a.y-l.y)>=(i.y-l.y)*(a.x-l.x))n.pop();else break}n.push(a)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var EW=CB,wW=NB,xW=OB,MB=DB;const FB=EW,zB=wW,PB=xW,kW=e=>typeof e!="string"?e:e.split("\\n").map((t,n)=>w.jsxs(k.Fragment,{children:[t,nw.jsx(MB,{ref:a,sideOffset:t,className:Me("bg-popover text-popover-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 mx-1 max-w-sm overflow-hidden rounded-md border px-3 py-2 text-sm shadow-md",e),...r,children:typeof n=="string"?kW(n):n}));r0.displayName=MB.displayName;const zd=Nz("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"}}),Lt=k.forwardRef(({className:e,variant:t,tooltip:n,size:r,side:a="right",asChild:i=!1,...l},u)=>{const c=i?bo:"button";return n?w.jsx(FB,{children:w.jsxs(zB,{children:[w.jsx(PB,{asChild:!0,children:w.jsx(c,{className:Me(zd({variant:t,size:r,className:e}),"cursor-pointer"),ref:u,...l})}),w.jsx(r0,{side:a,children:n})]})}):w.jsx(c,{className:Me(zd({variant:t,size:r,className:e}),"cursor-pointer"),ref:u,...l})});Lt.displayName="Button";const AW=Z7,TW=Q7,BB=k.forwardRef(({className:e,...t},n)=>w.jsx(tB,{className:Me("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/80",e),...t,ref:n}));BB.displayName=tB.displayName;const UB=k.forwardRef(({className:e,...t},n)=>w.jsxs(TW,{children:[w.jsx(BB,{}),w.jsx(nB,{ref:n,className:Me("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-top-[48%] fixed top-[50%] left-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border p-6 shadow-lg duration-200 sm:rounded-lg",e),...t})]}));UB.displayName=nB.displayName;const jB=({className:e,...t})=>w.jsx("div",{className:Me("flex flex-col space-y-2 text-center sm:text-left",e),...t});jB.displayName="AlertDialogHeader";const GB=k.forwardRef(({className:e,...t},n)=>w.jsx(oB,{ref:n,className:Me("text-lg font-semibold",e),...t}));GB.displayName=oB.displayName;const HB=k.forwardRef(({className:e,...t},n)=>w.jsx(iB,{ref:n,className:Me("text-muted-foreground text-sm",e),...t}));HB.displayName=iB.displayName;const _W=k.forwardRef(({className:e,...t},n)=>w.jsx(rB,{ref:n,className:Me(zd(),e),...t}));_W.displayName=rB.displayName;const RW=k.forwardRef(({className:e,...t},n)=>w.jsx(aB,{ref:n,className:Me(zd({variant:"outline"}),"mt-2 sm:mt-0",e),...t}));RW.displayName=aB.displayName;const Eo=k.forwardRef(({className:e,type:t,...n},r)=>w.jsx("input",{type:t,className:Me("border-input file:text-foreground placeholder:text-muted-foreground focus-visible:ring-ring flex h-9 rounded-md border bg-transparent px-3 py-1 text-base shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium focus-visible:ring-1 focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),ref:r,...n}));Eo.displayName="Input";var CW=e=>{switch(e){case"success":return DW;case"info":return LW;case"warning":return IW;case"error":return MW;default:return null}},NW=Array(12).fill(0),OW=({visible:e,className:t})=>ye.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},ye.createElement("div",{className:"sonner-spinner"},NW.map((n,r)=>ye.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),DW=ye.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},ye.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"})),IW=ye.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},ye.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"})),LW=ye.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},ye.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"})),MW=ye.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},ye.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"})),FW=ye.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"},ye.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),ye.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),zW=()=>{let[e,t]=ye.useState(document.hidden);return ye.useEffect(()=>{let n=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),e},Nx=1,PW=class{constructor(){this.subscribe=e=>(this.subscribers.push(e),()=>{let t=this.subscribers.indexOf(e);this.subscribers.splice(t,1)}),this.publish=e=>{this.subscribers.forEach(t=>t(e))},this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e]},this.create=e=>{var t;let{message:n,...r}=e,a=typeof(e==null?void 0:e.id)=="number"||((t=e.id)==null?void 0:t.length)>0?e.id:Nx++,i=this.toasts.find(u=>u.id===a),l=e.dismissible===void 0?!0:e.dismissible;return this.dismissedToasts.has(a)&&this.dismissedToasts.delete(a),i?this.toasts=this.toasts.map(u=>u.id===a?(this.publish({...u,...e,id:a,title:n}),{...u,...e,id:a,dismissible:l,title:n}):u):this.addToast({title:n,...r,dismissible:l,id:a}),a},this.dismiss=e=>(this.dismissedToasts.add(e),e||this.toasts.forEach(t=>{this.subscribers.forEach(n=>n({id:t.id,dismiss:!0}))}),this.subscribers.forEach(t=>t({id:e,dismiss:!0})),e),this.message=(e,t)=>this.create({...t,message:e}),this.error=(e,t)=>this.create({...t,message:e,type:"error"}),this.success=(e,t)=>this.create({...t,type:"success",message:e}),this.info=(e,t)=>this.create({...t,type:"info",message:e}),this.warning=(e,t)=>this.create({...t,type:"warning",message:e}),this.loading=(e,t)=>this.create({...t,type:"loading",message:e}),this.promise=(e,t)=>{if(!t)return;let n;t.loading!==void 0&&(n=this.create({...t,promise:e,type:"loading",message:t.loading,description:typeof t.description!="function"?t.description:void 0}));let r=e instanceof Promise?e:e(),a=n!==void 0,i,l=r.then(async c=>{if(i=["resolve",c],ye.isValidElement(c))a=!1,this.create({id:n,type:"default",message:c});else if(UW(c)&&!c.ok){a=!1;let f=typeof t.error=="function"?await t.error(`HTTP error! status: ${c.status}`):t.error,p=typeof t.description=="function"?await t.description(`HTTP error! status: ${c.status}`):t.description;this.create({id:n,type:"error",message:f,description:p})}else if(t.success!==void 0){a=!1;let f=typeof t.success=="function"?await t.success(c):t.success,p=typeof t.description=="function"?await t.description(c):t.description;this.create({id:n,type:"success",message:f,description:p})}}).catch(async c=>{if(i=["reject",c],t.error!==void 0){a=!1;let f=typeof t.error=="function"?await t.error(c):t.error,p=typeof t.description=="function"?await t.description(c):t.description;this.create({id:n,type:"error",message:f,description:p})}}).finally(()=>{var c;a&&(this.dismiss(n),n=void 0),(c=t.finally)==null||c.call(t)}),u=()=>new Promise((c,f)=>l.then(()=>i[0]==="reject"?f(i[1]):c(i[1])).catch(f));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)||Nx++;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}},Fn=new PW,BW=(e,t)=>{let n=(t==null?void 0:t.id)||Nx++;return Fn.addToast({title:e,...t,id:n}),n},UW=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",jW=BW,GW=()=>Fn.toasts,HW=()=>Fn.getActiveToasts(),vn=Object.assign(jW,{success:Fn.success,info:Fn.info,warning:Fn.warning,error:Fn.error,custom:Fn.custom,message:Fn.message,promise:Fn.promise,dismiss:Fn.dismiss,loading:Fn.loading},{getHistory:GW,getToasts:HW});function $W(e,{insertAt:t}={}){if(typeof document>"u")return;let n=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",t==="top"&&n.firstChild?n.insertBefore(r,n.firstChild):n.appendChild(r),r.styleSheet?r.styleSheet.cssText=e:r.appendChild(document.createTextNode(e))}$W(`: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 Hc(e){return e.label!==void 0}var qW=3,VW="32px",WW="16px",qR=4e3,YW=356,KW=14,XW=20,ZW=200;function Ar(...e){return e.filter(Boolean).join(" ")}function QW(e){let[t,n]=e.split("-"),r=[];return t&&r.push(t),n&&r.push(n),r}var JW=e=>{var t,n,r,a,i,l,u,c,f,p,g;let{invert:b,toast:m,unstyled:S,interacting:v,setHeights:A,visibleToasts:R,heights:x,index:_,toasts:C,expanded:N,removeToast:T,defaultRichColors:O,closeButton:z,style:I,cancelButtonStyle:M,actionButtonStyle:H,className:q="",descriptionClassName:U="",duration:W,position:Z,gap:j,loadingIcon:G,expandByDefault:P,classNames:X,icons:D,closeButtonAriaLabel:V="Close toast",pauseWhenPageIsHidden:B}=e,[L,Y]=ye.useState(null),[Q,se]=ye.useState(null),[re,le]=ye.useState(!1),[Ae,ae]=ye.useState(!1),[we,xe]=ye.useState(!1),[Ie,Ce]=ye.useState(!1),[Ee,J]=ye.useState(!1),[fe,ke]=ye.useState(0),[me,ve]=ye.useState(0),ie=ye.useRef(m.duration||W||qR),ze=ye.useRef(null),Pe=ye.useRef(null),he=_===0,Ne=_+1<=R,ee=m.type,ce=m.dismissible!==!1,Re=m.className||"",Fe=m.descriptionClassName||"",qe=ye.useMemo(()=>x.findIndex(Ye=>Ye.toastId===m.id)||0,[x,m.id]),mt=ye.useMemo(()=>{var Ye;return(Ye=m.closeButton)!=null?Ye:z},[m.closeButton,z]),St=ye.useMemo(()=>m.duration||W||qR,[m.duration,W]),pt=ye.useRef(0),Je=ye.useRef(0),wt=ye.useRef(0),rt=ye.useRef(null),[bt,Bt]=Z.split("-"),sn=ye.useMemo(()=>x.reduce((Ye,gt,_t)=>_t>=qe?Ye:Ye+gt.height,0),[x,qe]),Mt=zW(),er=m.invert||b,zr=ee==="loading";Je.current=ye.useMemo(()=>qe*j+sn,[qe,sn]),ye.useEffect(()=>{ie.current=St},[St]),ye.useEffect(()=>{le(!0)},[]),ye.useEffect(()=>{let Ye=Pe.current;if(Ye){let gt=Ye.getBoundingClientRect().height;return ve(gt),A(_t=>[{toastId:m.id,height:gt,position:m.position},..._t]),()=>A(_t=>_t.filter(Rn=>Rn.toastId!==m.id))}},[A,m.id]),ye.useLayoutEffect(()=>{if(!re)return;let Ye=Pe.current,gt=Ye.style.height;Ye.style.height="auto";let _t=Ye.getBoundingClientRect().height;Ye.style.height=gt,ve(_t),A(Rn=>Rn.find(kn=>kn.toastId===m.id)?Rn.map(kn=>kn.toastId===m.id?{...kn,height:_t}:kn):[{toastId:m.id,height:_t,position:m.position},...Rn])},[re,m.title,m.description,A,m.id]);let Kt=ye.useCallback(()=>{ae(!0),ke(Je.current),A(Ye=>Ye.filter(gt=>gt.toastId!==m.id)),setTimeout(()=>{T(m)},ZW)},[m,T,A,Je]);ye.useEffect(()=>{if(m.promise&&ee==="loading"||m.duration===1/0||m.type==="loading")return;let Ye;return N||v||B&&Mt?(()=>{if(wt.current{var gt;(gt=m.onAutoClose)==null||gt.call(m,m),Kt()},ie.current)),()=>clearTimeout(Ye)},[N,v,m,ee,B,Mt,Kt]),ye.useEffect(()=>{m.delete&&Kt()},[Kt,m.delete]);function na(){var Ye,gt,_t;return D!=null&&D.loading?ye.createElement("div",{className:Ar(X==null?void 0:X.loader,(Ye=m==null?void 0:m.classNames)==null?void 0:Ye.loader,"sonner-loader"),"data-visible":ee==="loading"},D.loading):G?ye.createElement("div",{className:Ar(X==null?void 0:X.loader,(gt=m==null?void 0:m.classNames)==null?void 0:gt.loader,"sonner-loader"),"data-visible":ee==="loading"},G):ye.createElement(OW,{className:Ar(X==null?void 0:X.loader,(_t=m==null?void 0:m.classNames)==null?void 0:_t.loader),visible:ee==="loading"})}return ye.createElement("li",{tabIndex:0,ref:Pe,className:Ar(q,Re,X==null?void 0:X.toast,(t=m==null?void 0:m.classNames)==null?void 0:t.toast,X==null?void 0:X.default,X==null?void 0:X[ee],(n=m==null?void 0:m.classNames)==null?void 0:n[ee]),"data-sonner-toast":"","data-rich-colors":(r=m.richColors)!=null?r:O,"data-styled":!(m.jsx||m.unstyled||S),"data-mounted":re,"data-promise":!!m.promise,"data-swiped":Ee,"data-removed":Ae,"data-visible":Ne,"data-y-position":bt,"data-x-position":Bt,"data-index":_,"data-front":he,"data-swiping":we,"data-dismissible":ce,"data-type":ee,"data-invert":er,"data-swipe-out":Ie,"data-swipe-direction":Q,"data-expanded":!!(N||P&&re),style:{"--index":_,"--toasts-before":_,"--z-index":C.length-_,"--offset":`${Ae?fe:Je.current}px`,"--initial-height":P?"auto":`${me}px`,...I,...m.style},onDragEnd:()=>{xe(!1),Y(null),rt.current=null},onPointerDown:Ye=>{zr||!ce||(ze.current=new Date,ke(Je.current),Ye.target.setPointerCapture(Ye.pointerId),Ye.target.tagName!=="BUTTON"&&(xe(!0),rt.current={x:Ye.clientX,y:Ye.clientY}))},onPointerUp:()=>{var Ye,gt,_t,Rn;if(Ie||!ce)return;rt.current=null;let kn=Number(((Ye=Pe.current)==null?void 0:Ye.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),Cn=Number(((gt=Pe.current)==null?void 0:gt.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),ra=new Date().getTime()-((_t=ze.current)==null?void 0:_t.getTime()),Nn=L==="x"?kn:Cn,Sr=Math.abs(Nn)/ra;if(Math.abs(Nn)>=XW||Sr>.11){ke(Je.current),(Rn=m.onDismiss)==null||Rn.call(m,m),se(L==="x"?kn>0?"right":"left":Cn>0?"down":"up"),Kt(),Ce(!0),J(!1);return}xe(!1),Y(null)},onPointerMove:Ye=>{var gt,_t,Rn,kn;if(!rt.current||!ce||((gt=window.getSelection())==null?void 0:gt.toString().length)>0)return;let Cn=Ye.clientY-rt.current.y,ra=Ye.clientX-rt.current.x,Nn=(_t=e.swipeDirections)!=null?_t:QW(Z);!L&&(Math.abs(ra)>1||Math.abs(Cn)>1)&&Y(Math.abs(ra)>Math.abs(Cn)?"x":"y");let Sr={x:0,y:0};L==="y"?(Nn.includes("top")||Nn.includes("bottom"))&&(Nn.includes("top")&&Cn<0||Nn.includes("bottom")&&Cn>0)&&(Sr.y=Cn):L==="x"&&(Nn.includes("left")||Nn.includes("right"))&&(Nn.includes("left")&&ra<0||Nn.includes("right")&&ra>0)&&(Sr.x=ra),(Math.abs(Sr.x)>0||Math.abs(Sr.y)>0)&&J(!0),(Rn=Pe.current)==null||Rn.style.setProperty("--swipe-amount-x",`${Sr.x}px`),(kn=Pe.current)==null||kn.style.setProperty("--swipe-amount-y",`${Sr.y}px`)}},mt&&!m.jsx?ye.createElement("button",{"aria-label":V,"data-disabled":zr,"data-close-button":!0,onClick:zr||!ce?()=>{}:()=>{var Ye;Kt(),(Ye=m.onDismiss)==null||Ye.call(m,m)},className:Ar(X==null?void 0:X.closeButton,(a=m==null?void 0:m.classNames)==null?void 0:a.closeButton)},(i=D==null?void 0:D.close)!=null?i:FW):null,m.jsx||k.isValidElement(m.title)?m.jsx?m.jsx:typeof m.title=="function"?m.title():m.title:ye.createElement(ye.Fragment,null,ee||m.icon||m.promise?ye.createElement("div",{"data-icon":"",className:Ar(X==null?void 0:X.icon,(l=m==null?void 0:m.classNames)==null?void 0:l.icon)},m.promise||m.type==="loading"&&!m.icon?m.icon||na():null,m.type!=="loading"?m.icon||(D==null?void 0:D[ee])||CW(ee):null):null,ye.createElement("div",{"data-content":"",className:Ar(X==null?void 0:X.content,(u=m==null?void 0:m.classNames)==null?void 0:u.content)},ye.createElement("div",{"data-title":"",className:Ar(X==null?void 0:X.title,(c=m==null?void 0:m.classNames)==null?void 0:c.title)},typeof m.title=="function"?m.title():m.title),m.description?ye.createElement("div",{"data-description":"",className:Ar(U,Fe,X==null?void 0:X.description,(f=m==null?void 0:m.classNames)==null?void 0:f.description)},typeof m.description=="function"?m.description():m.description):null),k.isValidElement(m.cancel)?m.cancel:m.cancel&&Hc(m.cancel)?ye.createElement("button",{"data-button":!0,"data-cancel":!0,style:m.cancelButtonStyle||M,onClick:Ye=>{var gt,_t;Hc(m.cancel)&&ce&&((_t=(gt=m.cancel).onClick)==null||_t.call(gt,Ye),Kt())},className:Ar(X==null?void 0:X.cancelButton,(p=m==null?void 0:m.classNames)==null?void 0:p.cancelButton)},m.cancel.label):null,k.isValidElement(m.action)?m.action:m.action&&Hc(m.action)?ye.createElement("button",{"data-button":!0,"data-action":!0,style:m.actionButtonStyle||H,onClick:Ye=>{var gt,_t;Hc(m.action)&&((_t=(gt=m.action).onClick)==null||_t.call(gt,Ye),!Ye.defaultPrevented&&Kt())},className:Ar(X==null?void 0:X.actionButton,(g=m==null?void 0:m.classNames)==null?void 0:g.actionButton)},m.action.label):null))};function VR(){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 eY(e,t){let n={};return[e,t].forEach((r,a)=>{let i=a===1,l=i?"--mobile-offset":"--offset",u=i?WW:VW;function c(f){["top","right","bottom","left"].forEach(p=>{n[`${l}-${p}`]=typeof f=="number"?`${f}px`:f})}typeof r=="number"||typeof r=="string"?c(r):typeof r=="object"?["top","right","bottom","left"].forEach(f=>{r[f]===void 0?n[`${l}-${f}`]=u:n[`${l}-${f}`]=typeof r[f]=="number"?`${r[f]}px`:r[f]}):c(u)}),n}var tY=k.forwardRef(function(e,t){let{invert:n,position:r="bottom-right",hotkey:a=["altKey","KeyT"],expand:i,closeButton:l,className:u,offset:c,mobileOffset:f,theme:p="light",richColors:g,duration:b,style:m,visibleToasts:S=qW,toastOptions:v,dir:A=VR(),gap:R=KW,loadingIcon:x,icons:_,containerAriaLabel:C="Notifications",pauseWhenPageIsHidden:N}=e,[T,O]=ye.useState([]),z=ye.useMemo(()=>Array.from(new Set([r].concat(T.filter(B=>B.position).map(B=>B.position)))),[T,r]),[I,M]=ye.useState([]),[H,q]=ye.useState(!1),[U,W]=ye.useState(!1),[Z,j]=ye.useState(p!=="system"?p:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),G=ye.useRef(null),P=a.join("+").replace(/Key/g,"").replace(/Digit/g,""),X=ye.useRef(null),D=ye.useRef(!1),V=ye.useCallback(B=>{O(L=>{var Y;return(Y=L.find(Q=>Q.id===B.id))!=null&&Y.delete||Fn.dismiss(B.id),L.filter(({id:Q})=>Q!==B.id)})},[]);return ye.useEffect(()=>Fn.subscribe(B=>{if(B.dismiss){O(L=>L.map(Y=>Y.id===B.id?{...Y,delete:!0}:Y));return}setTimeout(()=>{pP.flushSync(()=>{O(L=>{let Y=L.findIndex(Q=>Q.id===B.id);return Y!==-1?[...L.slice(0,Y),{...L[Y],...B},...L.slice(Y+1)]:[B,...L]})})})}),[]),ye.useEffect(()=>{if(p!=="system"){j(p);return}if(p==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?j("dark"):j("light")),typeof window>"u")return;let B=window.matchMedia("(prefers-color-scheme: dark)");try{B.addEventListener("change",({matches:L})=>{j(L?"dark":"light")})}catch{B.addListener(({matches:Y})=>{try{j(Y?"dark":"light")}catch(Q){console.error(Q)}})}},[p]),ye.useEffect(()=>{T.length<=1&&q(!1)},[T]),ye.useEffect(()=>{let B=L=>{var Y,Q;a.every(se=>L[se]||L.code===se)&&(q(!0),(Y=G.current)==null||Y.focus()),L.code==="Escape"&&(document.activeElement===G.current||(Q=G.current)!=null&&Q.contains(document.activeElement))&&q(!1)};return document.addEventListener("keydown",B),()=>document.removeEventListener("keydown",B)},[a]),ye.useEffect(()=>{if(G.current)return()=>{X.current&&(X.current.focus({preventScroll:!0}),X.current=null,D.current=!1)}},[G.current]),ye.createElement("section",{ref:t,"aria-label":`${C} ${P}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},z.map((B,L)=>{var Y;let[Q,se]=B.split("-");return T.length?ye.createElement("ol",{key:B,dir:A==="auto"?VR():A,tabIndex:-1,ref:G,className:u,"data-sonner-toaster":!0,"data-theme":Z,"data-y-position":Q,"data-lifted":H&&T.length>1&&!i,"data-x-position":se,style:{"--front-toast-height":`${((Y=I[0])==null?void 0:Y.height)||0}px`,"--width":`${YW}px`,"--gap":`${R}px`,...m,...eY(c,f)},onBlur:re=>{D.current&&!re.currentTarget.contains(re.relatedTarget)&&(D.current=!1,X.current&&(X.current.focus({preventScroll:!0}),X.current=null))},onFocus:re=>{re.target instanceof HTMLElement&&re.target.dataset.dismissible==="false"||D.current||(D.current=!0,X.current=re.relatedTarget)},onMouseEnter:()=>q(!0),onMouseMove:()=>q(!0),onMouseLeave:()=>{U||q(!1)},onDragEnd:()=>q(!1),onPointerDown:re=>{re.target instanceof HTMLElement&&re.target.dataset.dismissible==="false"||W(!0)},onPointerUp:()=>W(!1)},T.filter(re=>!re.position&&L===0||re.position===B).map((re,le)=>{var Ae,ae;return ye.createElement(JW,{key:re.id,icons:_,index:le,toast:re,defaultRichColors:g,duration:(Ae=v==null?void 0:v.duration)!=null?Ae:b,className:v==null?void 0:v.className,descriptionClassName:v==null?void 0:v.descriptionClassName,invert:n,visibleToasts:S,closeButton:(ae=v==null?void 0:v.closeButton)!=null?ae:l,interacting:U,position:B,style:v==null?void 0:v.style,unstyled:v==null?void 0:v.unstyled,classNames:v==null?void 0:v.classNames,cancelButtonStyle:v==null?void 0:v.cancelButtonStyle,actionButtonStyle:v==null?void 0:v.actionButtonStyle,removeToast:V,toasts:T.filter(we=>we.position==re.position),heights:I.filter(we=>we.position==re.position),setHeights:M,expandByDefault:i,gap:R,loadingIcon:x,expanded:H,pauseWhenPageIsHidden:N,swipeDirections:e.swipeDirections})})):null}))});const nY=()=>{const[e,t]=k.useState(!0),n=Ke.use.apiKey(),[r,a]=k.useState(""),i=Pn.use.message();k.useEffect(()=>{a(n||"")},[n,e]),k.useEffect(()=>{i&&(i.includes(oP)||i.includes(iP))&&t(!0)},[i,t]);const l=k.useCallback(async()=>{if(Ke.setState({apiKey:r||null}),await Pn.getState().check()){t(!1);return}vn.error("API Key is invalid")},[r]),u=k.useCallback(c=>{a(c.target.value)},[a]);return w.jsx(AW,{open:e,onOpenChange:t,children:w.jsxs(UB,{children:[w.jsxs(jB,{children:[w.jsx(GB,{children:"API Key is required"}),w.jsx(HB,{children:"Please enter your API key"})]}),w.jsxs("form",{className:"flex gap-2",onSubmit:c=>c.preventDefault(),children:[w.jsx(Eo,{type:"password",value:r,onChange:u,placeholder:"Enter your API key",className:"max-h-full w-full min-w-0",autoComplete:"off"}),w.jsx(Lt,{onClick:l,variant:"outline",size:"sm",children:"Save"})]})]})})};var a0="Popover",[$B,tve]=mr(a0,[Cl]),mu=Cl(),[rY,wo]=$B(a0),qB=e=>{const{__scopePopover:t,children:n,open:r,defaultOpen:a,onOpenChange:i,modal:l=!1}=e,u=mu(t),c=k.useRef(null),[f,p]=k.useState(!1),[g=!1,b]=Oa({prop:r,defaultProp:a,onChange:i});return w.jsx(Qk,{...u,children:w.jsx(rY,{scope:t,contentId:En(),triggerRef:c,open:g,onOpenChange:b,onOpenToggle:k.useCallback(()=>b(m=>!m),[b]),hasCustomAnchor:f,onCustomAnchorAdd:k.useCallback(()=>p(!0),[]),onCustomAnchorRemove:k.useCallback(()=>p(!1),[]),modal:l,children:n})})};qB.displayName=a0;var VB="PopoverAnchor",aY=k.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,a=wo(VB,n),i=mu(n),{onCustomAnchorAdd:l,onCustomAnchorRemove:u}=a;return k.useEffect(()=>(l(),()=>u()),[l,u]),w.jsx(vf,{...i,...r,ref:t})});aY.displayName=VB;var WB="PopoverTrigger",YB=k.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,a=wo(WB,n),i=mu(n),l=ft(t,a.triggerRef),u=w.jsx(Xe.button,{type:"button","aria-haspopup":"dialog","aria-expanded":a.open,"aria-controls":a.contentId,"data-state":JB(a.open),...r,ref:l,onClick:We(e.onClick,a.onOpenToggle)});return a.hasCustomAnchor?u:w.jsx(vf,{asChild:!0,...i,children:u})});YB.displayName=WB;var o0="PopoverPortal",[oY,iY]=$B(o0,{forceMount:void 0}),KB=e=>{const{__scopePopover:t,forceMount:n,children:r,container:a}=e,i=wo(o0,t);return w.jsx(oY,{scope:t,forceMount:n,children:w.jsx(Jn,{present:n||i.open,children:w.jsx(df,{asChild:!0,container:a,children:r})})})};KB.displayName=o0;var bl="PopoverContent",XB=k.forwardRef((e,t)=>{const n=iY(bl,e.__scopePopover),{forceMount:r=n.forceMount,...a}=e,i=wo(bl,e.__scopePopover);return w.jsx(Jn,{present:r||i.open,children:i.modal?w.jsx(lY,{...a,ref:t}):w.jsx(sY,{...a,ref:t})})});XB.displayName=bl;var lY=k.forwardRef((e,t)=>{const n=wo(bl,e.__scopePopover),r=k.useRef(null),a=ft(t,r),i=k.useRef(!1);return k.useEffect(()=>{const l=r.current;if(l)return Ik(l)},[]),w.jsx(pf,{as:bo,allowPinchZoom:!0,children:w.jsx(ZB,{...e,ref:a,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:We(e.onCloseAutoFocus,l=>{var u;l.preventDefault(),i.current||(u=n.triggerRef.current)==null||u.focus()}),onPointerDownOutside:We(e.onPointerDownOutside,l=>{const u=l.detail.originalEvent,c=u.button===0&&u.ctrlKey===!0,f=u.button===2||c;i.current=f},{checkForDefaultPrevented:!1}),onFocusOutside:We(e.onFocusOutside,l=>l.preventDefault(),{checkForDefaultPrevented:!1})})})}),sY=k.forwardRef((e,t)=>{const n=wo(bl,e.__scopePopover),r=k.useRef(!1),a=k.useRef(!1);return w.jsx(ZB,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var l,u;(l=e.onCloseAutoFocus)==null||l.call(e,i),i.defaultPrevented||(r.current||(u=n.triggerRef.current)==null||u.focus(),i.preventDefault()),r.current=!1,a.current=!1},onInteractOutside:i=>{var c,f;(c=e.onInteractOutside)==null||c.call(e,i),i.defaultPrevented||(r.current=!0,i.detail.originalEvent.type==="pointerdown"&&(a.current=!0));const l=i.target;((f=n.triggerRef.current)==null?void 0:f.contains(l))&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&a.current&&i.preventDefault()}})}),ZB=k.forwardRef((e,t)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:a,onCloseAutoFocus:i,disableOutsidePointerEvents:l,onEscapeKeyDown:u,onPointerDownOutside:c,onFocusOutside:f,onInteractOutside:p,...g}=e,b=wo(bl,n),m=mu(n);return Dk(),w.jsx(cf,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:a,onUnmountAutoFocus:i,children:w.jsx(gu,{asChild:!0,disableOutsidePointerEvents:l,onInteractOutside:p,onEscapeKeyDown:u,onPointerDownOutside:c,onFocusOutside:f,onDismiss:()=>b.onOpenChange(!1),children:w.jsx(Jk,{"data-state":JB(b.open),role:"dialog",id:b.contentId,...m,...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)"}})})})}),QB="PopoverClose",uY=k.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,a=wo(QB,n);return w.jsx(Xe.button,{type:"button",...r,ref:t,onClick:We(e.onClick,()=>a.onOpenChange(!1))})});uY.displayName=QB;var cY="PopoverArrow",dY=k.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,a=mu(n);return w.jsx(e0,{...a,...r,ref:t})});dY.displayName=cY;function JB(e){return e?"open":"closed"}var fY=qB,pY=YB,gY=KB,eU=XB;const kf=fY,Af=pY,bu=k.forwardRef(({className:e,align:t="center",sideOffset:n=4,...r},a)=>w.jsx(gY,{children:w.jsx(eU,{ref:a,align:t,sideOffset:n,className:Me("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 rounded-md border p-4 shadow-md outline-none",e),...r})}));bu.displayName=eU.displayName;const hY=({status:e})=>e?w.jsxs("div",{className:"min-w-[300px] space-y-3 text-sm",children:[w.jsxs("div",{className:"space-y-1",children:[w.jsx("h4",{className:"font-medium",children:"Storage Info"}),w.jsxs("div",{className:"text-muted-foreground grid grid-cols-2 gap-1",children:[w.jsx("span",{children:"Working Directory:"}),w.jsx("span",{className:"truncate",children:e.working_directory}),w.jsx("span",{children:"Input Directory:"}),w.jsx("span",{className:"truncate",children:e.input_directory})]})]}),w.jsxs("div",{className:"space-y-1",children:[w.jsx("h4",{className:"font-medium",children:"LLM Configuration"}),w.jsxs("div",{className:"text-muted-foreground grid grid-cols-2 gap-1",children:[w.jsx("span",{children:"LLM Binding:"}),w.jsx("span",{children:e.configuration.llm_binding}),w.jsx("span",{children:"LLM Binding Host:"}),w.jsx("span",{children:e.configuration.llm_binding_host}),w.jsx("span",{children:"LLM Model:"}),w.jsx("span",{children:e.configuration.llm_model}),w.jsx("span",{children:"Max Tokens:"}),w.jsx("span",{children:e.configuration.max_tokens})]})]}),w.jsxs("div",{className:"space-y-1",children:[w.jsx("h4",{className:"font-medium",children:"Embedding Configuration"}),w.jsxs("div",{className:"text-muted-foreground grid grid-cols-2 gap-1",children:[w.jsx("span",{children:"Embedding Binding:"}),w.jsx("span",{children:e.configuration.embedding_binding}),w.jsx("span",{children:"Embedding Binding Host:"}),w.jsx("span",{children:e.configuration.embedding_binding_host}),w.jsx("span",{children:"Embedding Model:"}),w.jsx("span",{children:e.configuration.embedding_model})]})]}),w.jsxs("div",{className:"space-y-1",children:[w.jsx("h4",{className:"font-medium",children:"Storage Configuration"}),w.jsxs("div",{className:"text-muted-foreground grid grid-cols-2 gap-1",children:[w.jsx("span",{children:"KV Storage:"}),w.jsx("span",{children:e.configuration.kv_storage}),w.jsx("span",{children:"Doc Status Storage:"}),w.jsx("span",{children:e.configuration.doc_status_storage}),w.jsx("span",{children:"Graph Storage:"}),w.jsx("span",{children:e.configuration.graph_storage}),w.jsx("span",{children:"Vector Storage:"}),w.jsx("span",{children:e.configuration.vector_storage})]})]})]}):w.jsx("div",{className:"text-muted-foreground text-sm",children:"Status information unavailable"}),mY=()=>{const e=Pn.use.health(),t=Pn.use.lastCheckTime(),n=Pn.use.status(),[r,a]=k.useState(!1);return k.useEffect(()=>{a(!0);const i=setTimeout(()=>a(!1),300);return()=>clearTimeout(i)},[t]),w.jsx("div",{className:"fixed right-4 bottom-4 flex items-center gap-2 opacity-80 select-none",children:w.jsxs(kf,{children:[w.jsx(Af,{asChild:!0,children:w.jsxs("div",{className:"flex cursor-help items-center gap-2",children:[w.jsx("div",{className:Me("h-3 w-3 rounded-full transition-all duration-300","shadow-[0_0_8px_rgba(0,0,0,0.2)]",e?"bg-green-500":"bg-red-500",r&&"scale-125",r&&e&&"shadow-[0_0_12px_rgba(34,197,94,0.4)]",r&&!e&&"shadow-[0_0_12px_rgba(239,68,68,0.4)]")}),w.jsx("span",{className:"text-muted-foreground text-xs",children:e?"Connected":"Disconnected"})]})}),w.jsx(bu,{className:"w-auto",side:"top",align:"end",children:w.jsx(hY,{status:n})})]})})},i0=()=>{const e=k.useContext(Cz);if(e===void 0)throw new Error("useTheme must be used within a ThemeProvider");return e};function bY(){const{theme:e,setTheme:t}=i0(),n=k.useCallback(()=>t("light"),[t]),r=k.useCallback(()=>t("dark"),[t]);return e==="dark"?w.jsx(Lt,{onClick:n,variant:Yr,tooltip:"Switch to light theme",size:"icon",side:"bottom",children:w.jsx(Kq,{})}):w.jsx(Lt,{onClick:r,variant:Yr,tooltip:"Switch to dark theme",size:"icon",side:"bottom",children:w.jsx(u8,{})})}function tU(e){const t=e+"CollectionProvider",[n,r]=mr(t),[a,i]=n(t,{collectionRef:{current:null},itemMap:new Map}),l=m=>{const{scope:S,children:v}=m,A=ye.useRef(null),R=ye.useRef(new Map).current;return w.jsx(a,{scope:S,itemMap:R,collectionRef:A,children:v})};l.displayName=t;const u=e+"CollectionSlot",c=ye.forwardRef((m,S)=>{const{scope:v,children:A}=m,R=i(u,v),x=ft(S,R.collectionRef);return w.jsx(bo,{ref:x,children:A})});c.displayName=u;const f=e+"CollectionItemSlot",p="data-radix-collection-item",g=ye.forwardRef((m,S)=>{const{scope:v,children:A,...R}=m,x=ye.useRef(null),_=ft(S,x),C=i(f,v);return ye.useEffect(()=>(C.itemMap.set(x,{ref:x,...R}),()=>void C.itemMap.delete(x))),w.jsx(bo,{[p]:"",ref:_,children:A})});g.displayName=f;function b(m){const S=i(e+"CollectionConsumer",m);return ye.useCallback(()=>{const A=S.collectionRef.current;if(!A)return[];const R=Array.from(A.querySelectorAll(`[${p}]`));return Array.from(S.itemMap.values()).sort((C,N)=>R.indexOf(C.ref.current)-R.indexOf(N.ref.current))},[S.collectionRef,S.itemMap])}return[{Provider:l,Slot:c,ItemSlot:g},b,r]}var yY=k.createContext(void 0);function Tf(e){const t=k.useContext(yY);return e||t||"ltr"}var wh="rovingFocusGroup.onEntryFocus",vY={bubbles:!1,cancelable:!0},_f="RovingFocusGroup",[Ox,nU,SY]=tU(_f),[EY,rU]=mr(_f,[SY]),[wY,xY]=EY(_f),aU=k.forwardRef((e,t)=>w.jsx(Ox.Provider,{scope:e.__scopeRovingFocusGroup,children:w.jsx(Ox.Slot,{scope:e.__scopeRovingFocusGroup,children:w.jsx(kY,{...e,ref:t})})}));aU.displayName=_f;var kY=k.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:a=!1,dir:i,currentTabStopId:l,defaultCurrentTabStopId:u,onCurrentTabStopIdChange:c,onEntryFocus:f,preventScrollOnEntryFocus:p=!1,...g}=e,b=k.useRef(null),m=ft(t,b),S=Tf(i),[v=null,A]=Oa({prop:l,defaultProp:u,onChange:c}),[R,x]=k.useState(!1),_=pn(f),C=nU(n),N=k.useRef(!1),[T,O]=k.useState(0);return k.useEffect(()=>{const z=b.current;if(z)return z.addEventListener(wh,_),()=>z.removeEventListener(wh,_)},[_]),w.jsx(wY,{scope:n,orientation:r,dir:S,loop:a,currentTabStopId:v,onItemFocus:k.useCallback(z=>A(z),[A]),onItemShiftTab:k.useCallback(()=>x(!0),[]),onFocusableItemAdd:k.useCallback(()=>O(z=>z+1),[]),onFocusableItemRemove:k.useCallback(()=>O(z=>z-1),[]),children:w.jsx(Xe.div,{tabIndex:R||T===0?-1:0,"data-orientation":r,...g,ref:m,style:{outline:"none",...e.style},onMouseDown:We(e.onMouseDown,()=>{N.current=!0}),onFocus:We(e.onFocus,z=>{const I=!N.current;if(z.target===z.currentTarget&&I&&!R){const M=new CustomEvent(wh,vY);if(z.currentTarget.dispatchEvent(M),!M.defaultPrevented){const H=C().filter(j=>j.focusable),q=H.find(j=>j.active),U=H.find(j=>j.id===v),Z=[q,U,...H].filter(Boolean).map(j=>j.ref.current);lU(Z,p)}}N.current=!1}),onBlur:We(e.onBlur,()=>x(!1))})})}),oU="RovingFocusGroupItem",iU=k.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:a=!1,tabStopId:i,...l}=e,u=En(),c=i||u,f=xY(oU,n),p=f.currentTabStopId===c,g=nU(n),{onFocusableItemAdd:b,onFocusableItemRemove:m}=f;return k.useEffect(()=>{if(r)return b(),()=>m()},[r,b,m]),w.jsx(Ox.ItemSlot,{scope:n,id:c,focusable:r,active:a,children:w.jsx(Xe.span,{tabIndex:p?0:-1,"data-orientation":f.orientation,...l,ref:t,onMouseDown:We(e.onMouseDown,S=>{r?f.onItemFocus(c):S.preventDefault()}),onFocus:We(e.onFocus,()=>f.onItemFocus(c)),onKeyDown:We(e.onKeyDown,S=>{if(S.key==="Tab"&&S.shiftKey){f.onItemShiftTab();return}if(S.target!==S.currentTarget)return;const v=_Y(S,f.orientation,f.dir);if(v!==void 0){if(S.metaKey||S.ctrlKey||S.altKey||S.shiftKey)return;S.preventDefault();let R=g().filter(x=>x.focusable).map(x=>x.ref.current);if(v==="last")R.reverse();else if(v==="prev"||v==="next"){v==="prev"&&R.reverse();const x=R.indexOf(S.currentTarget);R=f.loop?RY(R,x+1):R.slice(x+1)}setTimeout(()=>lU(R))}})})})});iU.displayName=oU;var AY={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function TY(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function _Y(e,t,n){const r=TY(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return AY[r]}function lU(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function RY(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var CY=aU,NY=iU,l0="Tabs",[OY,nve]=mr(l0,[rU]),sU=rU(),[DY,s0]=OY(l0),uU=k.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:a,defaultValue:i,orientation:l="horizontal",dir:u,activationMode:c="automatic",...f}=e,p=Tf(u),[g,b]=Oa({prop:r,onChange:a,defaultProp:i});return w.jsx(DY,{scope:n,baseId:En(),value:g,onValueChange:b,orientation:l,dir:p,activationMode:c,children:w.jsx(Xe.div,{dir:p,"data-orientation":l,...f,ref:t})})});uU.displayName=l0;var cU="TabsList",dU=k.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...a}=e,i=s0(cU,n),l=sU(n);return w.jsx(CY,{asChild:!0,...l,orientation:i.orientation,dir:i.dir,loop:r,children:w.jsx(Xe.div,{role:"tablist","aria-orientation":i.orientation,...a,ref:t})})});dU.displayName=cU;var fU="TabsTrigger",pU=k.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:a=!1,...i}=e,l=s0(fU,n),u=sU(n),c=mU(l.baseId,r),f=bU(l.baseId,r),p=r===l.value;return w.jsx(NY,{asChild:!0,...u,focusable:!a,active:p,children:w.jsx(Xe.button,{type:"button",role:"tab","aria-selected":p,"aria-controls":f,"data-state":p?"active":"inactive","data-disabled":a?"":void 0,disabled:a,id:c,...i,ref:t,onMouseDown:We(e.onMouseDown,g=>{!a&&g.button===0&&g.ctrlKey===!1?l.onValueChange(r):g.preventDefault()}),onKeyDown:We(e.onKeyDown,g=>{[" ","Enter"].includes(g.key)&&l.onValueChange(r)}),onFocus:We(e.onFocus,()=>{const g=l.activationMode!=="manual";!p&&!a&&g&&l.onValueChange(r)})})})});pU.displayName=fU;var gU="TabsContent",hU=k.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:a,children:i,...l}=e,u=s0(gU,n),c=mU(u.baseId,r),f=bU(u.baseId,r),p=r===u.value,g=k.useRef(p);return k.useEffect(()=>{const b=requestAnimationFrame(()=>g.current=!1);return()=>cancelAnimationFrame(b)},[]),w.jsx(Jn,{present:a||p,children:({present:b})=>w.jsx(Xe.div,{"data-state":p?"active":"inactive","data-orientation":u.orientation,role:"tabpanel","aria-labelledby":c,hidden:!b,id:f,tabIndex:0,...l,ref:t,style:{...e.style,animationDuration:g.current?"0s":void 0},children:b&&i})})});hU.displayName=gU;function mU(e,t){return`${e}-trigger-${t}`}function bU(e,t){return`${e}-content-${t}`}var IY=uU,yU=dU,vU=pU,SU=hU;const LY=IY,EU=k.forwardRef(({className:e,...t},n)=>w.jsx(yU,{ref:n,className:Me("bg-muted text-muted-foreground inline-flex h-10 items-center justify-center rounded-md p-1",e),...t}));EU.displayName=yU.displayName;const wU=k.forwardRef(({className:e,...t},n)=>w.jsx(vU,{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}));wU.displayName=vU.displayName;const qs=k.forwardRef(({className:e,...t},n)=>w.jsx(SU,{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}));qs.displayName=SU.displayName;function $c({value:e,currentTab:t,children:n}){return w.jsx(wU,{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 MY(){const e=Ke.use.currentTab();return w.jsx("div",{className:"flex h-8 self-center",children:w.jsxs(EU,{className:"h-full gap-2",children:[w.jsx($c,{value:"documents",currentTab:e,children:"Documents"}),w.jsx($c,{value:"knowledge-graph",currentTab:e,children:"Knowledge Graph"}),w.jsx($c,{value:"retrieval",currentTab:e,children:"Retrieval"}),w.jsx($c,{value:"api",currentTab:e,children:"API"})]})})}function FY(){return w.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:[w.jsxs("a",{href:"/",className:"mr-6 flex items-center gap-2",children:[w.jsx(p8,{className:"size-4 text-emerald-400","aria-hidden":"true"}),w.jsx("span",{className:"font-bold md:inline-block",children:lR.name})]}),w.jsx("div",{className:"flex h-10 flex-1 justify-center",children:w.jsx(MY,{})}),w.jsxs("nav",{className:"flex items-center",children:[w.jsx(Lt,{variant:"ghost",size:"icon",side:"bottom",tooltip:"Project Repository",children:w.jsx("a",{href:lR.github,target:"_blank",rel:"noopener noreferrer",children:w.jsx(Pq,{className:"size-4","aria-hidden":"true"})})}),w.jsx(bY,{})]})]})}var qc={exports:{}},WR;function zY(){if(WR)return qc.exports;WR=1;var e=typeof Reflect=="object"?Reflect:null,t=e&&typeof e.apply=="function"?e.apply:function(N,T,O){return Function.prototype.apply.call(N,T,O)},n;e&&typeof e.ownKeys=="function"?n=e.ownKeys:Object.getOwnPropertySymbols?n=function(N){return Object.getOwnPropertyNames(N).concat(Object.getOwnPropertySymbols(N))}:n=function(N){return Object.getOwnPropertyNames(N)};function r(C){console&&console.warn&&console.warn(C)}var a=Number.isNaN||function(N){return N!==N};function i(){i.init.call(this)}qc.exports=i,qc.exports.once=R,i.EventEmitter=i,i.prototype._events=void 0,i.prototype._eventsCount=0,i.prototype._maxListeners=void 0;var l=10;function u(C){if(typeof C!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof C)}Object.defineProperty(i,"defaultMaxListeners",{enumerable:!0,get:function(){return l},set:function(C){if(typeof C!="number"||C<0||a(C))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+C+".");l=C}}),i.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},i.prototype.setMaxListeners=function(N){if(typeof N!="number"||N<0||a(N))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+N+".");return this._maxListeners=N,this};function c(C){return C._maxListeners===void 0?i.defaultMaxListeners:C._maxListeners}i.prototype.getMaxListeners=function(){return c(this)},i.prototype.emit=function(N){for(var T=[],O=1;O0&&(M=T[0]),M instanceof Error)throw M;var H=new Error("Unhandled error."+(M?" ("+M.message+")":""));throw H.context=M,H}var q=I[N];if(q===void 0)return!1;if(typeof q=="function")t(q,this,T);else for(var U=q.length,W=S(q,U),O=0;O0&&M.length>z&&!M.warned){M.warned=!0;var H=new Error("Possible EventEmitter memory leak detected. "+M.length+" "+String(N)+" listeners added. Use emitter.setMaxListeners() to increase limit");H.name="MaxListenersExceededWarning",H.emitter=C,H.type=N,H.count=M.length,r(H)}return C}i.prototype.addListener=function(N,T){return f(this,N,T,!1)},i.prototype.on=i.prototype.addListener,i.prototype.prependListener=function(N,T){return f(this,N,T,!0)};function p(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function g(C,N,T){var O={fired:!1,wrapFn:void 0,target:C,type:N,listener:T},z=p.bind(O);return z.listener=T,O.wrapFn=z,z}i.prototype.once=function(N,T){return u(T),this.on(N,g(this,N,T)),this},i.prototype.prependOnceListener=function(N,T){return u(T),this.prependListener(N,g(this,N,T)),this},i.prototype.removeListener=function(N,T){var O,z,I,M,H;if(u(T),z=this._events,z===void 0)return this;if(O=z[N],O===void 0)return this;if(O===T||O.listener===T)--this._eventsCount===0?this._events=Object.create(null):(delete z[N],z.removeListener&&this.emit("removeListener",N,O.listener||T));else if(typeof O!="function"){for(I=-1,M=O.length-1;M>=0;M--)if(O[M]===T||O[M].listener===T){H=O[M].listener,I=M;break}if(I<0)return this;I===0?O.shift():v(O,I),O.length===1&&(z[N]=O[0]),z.removeListener!==void 0&&this.emit("removeListener",N,H||T)}return this},i.prototype.off=i.prototype.removeListener,i.prototype.removeAllListeners=function(N){var T,O,z;if(O=this._events,O===void 0)return this;if(O.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):O[N]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete O[N]),this;if(arguments.length===0){var I=Object.keys(O),M;for(z=0;z=0;z--)this.removeListener(N,T[z]);return this};function b(C,N,T){var O=C._events;if(O===void 0)return[];var z=O[N];return z===void 0?[]:typeof z=="function"?T?[z.listener||z]:[z]:T?A(z):S(z,z.length)}i.prototype.listeners=function(N){return b(this,N,!0)},i.prototype.rawListeners=function(N){return b(this,N,!1)},i.listenerCount=function(C,N){return typeof C.listenerCount=="function"?C.listenerCount(N):m.call(C,N)},i.prototype.listenerCount=m;function m(C){var N=this._events;if(N!==void 0){var T=N[C];if(typeof T=="function")return 1;if(T!==void 0)return T.length}return 0}i.prototype.eventNames=function(){return this._eventsCount>0?n(this._events):[]};function S(C,N){for(var T=new Array(N),O=0;Oe++}function Na(){const e=arguments;let t=null,n=-1;return{[Symbol.iterator](){return this},next(){let r=null;do{if(t===null){if(n++,n>=e.length)return{done:!0};t=e[n][Symbol.iterator]()}if(r=t.next(),r.done){t=null;continue}break}while(!0);return r}}}function Nl(){return{[Symbol.iterator](){return this},next(){return{done:!0}}}}class u0 extends Error{constructor(t){super(),this.name="GraphError",this.message=t}}class Le extends u0{constructor(t){super(t),this.name="InvalidArgumentsGraphError",typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,Le.prototype.constructor)}}class De extends u0{constructor(t){super(t),this.name="NotFoundGraphError",typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,De.prototype.constructor)}}class Ze extends u0{constructor(t){super(t),this.name="UsageGraphError",typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,Ze.prototype.constructor)}}function AU(e,t){this.key=e,this.attributes=t,this.clear()}AU.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 TU(e,t){this.key=e,this.attributes=t,this.clear()}TU.prototype.clear=function(){this.inDegree=0,this.outDegree=0,this.directedLoops=0,this.in={},this.out={}};function _U(e,t){this.key=e,this.attributes=t,this.clear()}_U.prototype.clear=function(){this.undirectedDegree=0,this.undirectedLoops=0,this.undirected={}};function Ol(e,t,n,r,a){this.key=t,this.attributes=a,this.undirected=e,this.source=n,this.target=r}Ol.prototype.attach=function(){let e="out",t="in";this.undirected&&(e=t="undirected");const n=this.source.key,r=this.target.key;this.source[e][r]=this,!(this.undirected&&n===r)&&(this.target[t][n]=this)};Ol.prototype.attachMulti=function(){let e="out",t="in";const n=this.source.key,r=this.target.key;this.undirected&&(e=t="undirected");const a=this.source[e],i=a[r];if(typeof i>"u"){a[r]=this,this.undirected&&n===r||(this.target[t][n]=this);return}i.previous=this,this.next=i,a[r]=this,this.target[t][n]=this};Ol.prototype.detach=function(){const e=this.source.key,t=this.target.key;let n="out",r="in";this.undirected&&(n=r="undirected"),delete this.source[n][t],delete this.target[r][e]};Ol.prototype.detachMulti=function(){const e=this.source.key,t=this.target.key;let n="out",r="in";this.undirected&&(n=r="undirected"),this.previous===void 0?this.next===void 0?(delete this.source[n][t],delete this.target[r][e]):(this.next.previous=void 0,this.source[n][t]=this.next,this.target[r][e]=this.next):(this.previous.next=this.next,this.next!==void 0&&(this.next.previous=this.previous))};const RU=0,CU=1,UY=2,NU=3;function Ma(e,t,n,r,a,i,l){let u,c,f,p;if(r=""+r,n===RU){if(u=e._nodes.get(r),!u)throw new De(`Graph.${t}: could not find the "${r}" node in the graph.`);f=a,p=i}else if(n===NU){if(a=""+a,c=e._edges.get(a),!c)throw new De(`Graph.${t}: could not find the "${a}" edge in the graph.`);const g=c.source.key,b=c.target.key;if(r===g)u=c.target;else if(r===b)u=c.source;else throw new De(`Graph.${t}: the "${r}" node is not attached to the "${a}" edge (${g}, ${b}).`);f=i,p=l}else{if(c=e._edges.get(r),!c)throw new De(`Graph.${t}: could not find the "${r}" edge in the graph.`);n===CU?u=c.source:u=c.target,f=a,p=i}return[u,f,p]}function jY(e,t,n){e.prototype[t]=function(r,a,i){const[l,u]=Ma(this,t,n,r,a,i);return l.attributes[u]}}function GY(e,t,n){e.prototype[t]=function(r,a){const[i]=Ma(this,t,n,r,a);return i.attributes}}function HY(e,t,n){e.prototype[t]=function(r,a,i){const[l,u]=Ma(this,t,n,r,a,i);return l.attributes.hasOwnProperty(u)}}function $Y(e,t,n){e.prototype[t]=function(r,a,i,l){const[u,c,f]=Ma(this,t,n,r,a,i,l);return u.attributes[c]=f,this.emit("nodeAttributesUpdated",{key:u.key,type:"set",attributes:u.attributes,name:c}),this}}function qY(e,t,n){e.prototype[t]=function(r,a,i,l){const[u,c,f]=Ma(this,t,n,r,a,i,l);if(typeof f!="function")throw new Le(`Graph.${t}: updater should be a function.`);const p=u.attributes,g=f(p[c]);return p[c]=g,this.emit("nodeAttributesUpdated",{key:u.key,type:"set",attributes:u.attributes,name:c}),this}}function VY(e,t,n){e.prototype[t]=function(r,a,i){const[l,u]=Ma(this,t,n,r,a,i);return delete l.attributes[u],this.emit("nodeAttributesUpdated",{key:l.key,type:"remove",attributes:l.attributes,name:u}),this}}function WY(e,t,n){e.prototype[t]=function(r,a,i){const[l,u]=Ma(this,t,n,r,a,i);if(!gn(u))throw new Le(`Graph.${t}: provided attributes are not a plain object.`);return l.attributes=u,this.emit("nodeAttributesUpdated",{key:l.key,type:"replace",attributes:l.attributes}),this}}function YY(e,t,n){e.prototype[t]=function(r,a,i){const[l,u]=Ma(this,t,n,r,a,i);if(!gn(u))throw new Le(`Graph.${t}: provided attributes are not a plain object.`);return Qt(l.attributes,u),this.emit("nodeAttributesUpdated",{key:l.key,type:"merge",attributes:l.attributes,data:u}),this}}function KY(e,t,n){e.prototype[t]=function(r,a,i){const[l,u]=Ma(this,t,n,r,a,i);if(typeof u!="function")throw new Le(`Graph.${t}: provided updater is not a function.`);return l.attributes=u(l.attributes),this.emit("nodeAttributesUpdated",{key:l.key,type:"update",attributes:l.attributes}),this}}const XY=[{name:e=>`get${e}Attribute`,attacher:jY},{name:e=>`get${e}Attributes`,attacher:GY},{name:e=>`has${e}Attribute`,attacher:HY},{name:e=>`set${e}Attribute`,attacher:$Y},{name:e=>`update${e}Attribute`,attacher:qY},{name:e=>`remove${e}Attribute`,attacher:VY},{name:e=>`replace${e}Attributes`,attacher:WY},{name:e=>`merge${e}Attributes`,attacher:YY},{name:e=>`update${e}Attributes`,attacher:KY}];function ZY(e){XY.forEach(function({name:t,attacher:n}){n(e,t("Node"),RU),n(e,t("Source"),CU),n(e,t("Target"),UY),n(e,t("Opposite"),NU)})}function QY(e,t,n){e.prototype[t]=function(r,a){let i;if(this.type!=="mixed"&&n!=="mixed"&&n!==this.type)throw new Ze(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new Ze(`Graph.${t}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const l=""+r,u=""+a;if(a=arguments[2],i=hr(this,l,u,n),!i)throw new De(`Graph.${t}: could not find an edge for the given path ("${l}" - "${u}").`)}else{if(n!=="mixed")throw new Ze(`Graph.${t}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(r=""+r,i=this._edges.get(r),!i)throw new De(`Graph.${t}: could not find the "${r}" edge in the graph.`)}return i.attributes[a]}}function JY(e,t,n){e.prototype[t]=function(r){let a;if(this.type!=="mixed"&&n!=="mixed"&&n!==this.type)throw new Ze(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>1){if(this.multi)throw new Ze(`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 i=""+r,l=""+arguments[1];if(a=hr(this,i,l,n),!a)throw new De(`Graph.${t}: could not find an edge for the given path ("${i}" - "${l}").`)}else{if(n!=="mixed")throw new Ze(`Graph.${t}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(r=""+r,a=this._edges.get(r),!a)throw new De(`Graph.${t}: could not find the "${r}" edge in the graph.`)}return a.attributes}}function eK(e,t,n){e.prototype[t]=function(r,a){let i;if(this.type!=="mixed"&&n!=="mixed"&&n!==this.type)throw new Ze(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new Ze(`Graph.${t}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const l=""+r,u=""+a;if(a=arguments[2],i=hr(this,l,u,n),!i)throw new De(`Graph.${t}: could not find an edge for the given path ("${l}" - "${u}").`)}else{if(n!=="mixed")throw new Ze(`Graph.${t}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(r=""+r,i=this._edges.get(r),!i)throw new De(`Graph.${t}: could not find the "${r}" edge in the graph.`)}return i.attributes.hasOwnProperty(a)}}function tK(e,t,n){e.prototype[t]=function(r,a,i){let l;if(this.type!=="mixed"&&n!=="mixed"&&n!==this.type)throw new Ze(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>3){if(this.multi)throw new Ze(`Graph.${t}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const u=""+r,c=""+a;if(a=arguments[2],i=arguments[3],l=hr(this,u,c,n),!l)throw new De(`Graph.${t}: could not find an edge for the given path ("${u}" - "${c}").`)}else{if(n!=="mixed")throw new Ze(`Graph.${t}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(r=""+r,l=this._edges.get(r),!l)throw new De(`Graph.${t}: could not find the "${r}" edge in the graph.`)}return l.attributes[a]=i,this.emit("edgeAttributesUpdated",{key:l.key,type:"set",attributes:l.attributes,name:a}),this}}function nK(e,t,n){e.prototype[t]=function(r,a,i){let l;if(this.type!=="mixed"&&n!=="mixed"&&n!==this.type)throw new Ze(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>3){if(this.multi)throw new Ze(`Graph.${t}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const u=""+r,c=""+a;if(a=arguments[2],i=arguments[3],l=hr(this,u,c,n),!l)throw new De(`Graph.${t}: could not find an edge for the given path ("${u}" - "${c}").`)}else{if(n!=="mixed")throw new Ze(`Graph.${t}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(r=""+r,l=this._edges.get(r),!l)throw new De(`Graph.${t}: could not find the "${r}" edge in the graph.`)}if(typeof i!="function")throw new Le(`Graph.${t}: updater should be a function.`);return l.attributes[a]=i(l.attributes[a]),this.emit("edgeAttributesUpdated",{key:l.key,type:"set",attributes:l.attributes,name:a}),this}}function rK(e,t,n){e.prototype[t]=function(r,a){let i;if(this.type!=="mixed"&&n!=="mixed"&&n!==this.type)throw new Ze(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new Ze(`Graph.${t}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const l=""+r,u=""+a;if(a=arguments[2],i=hr(this,l,u,n),!i)throw new De(`Graph.${t}: could not find an edge for the given path ("${l}" - "${u}").`)}else{if(n!=="mixed")throw new Ze(`Graph.${t}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(r=""+r,i=this._edges.get(r),!i)throw new De(`Graph.${t}: could not find the "${r}" edge in the graph.`)}return delete i.attributes[a],this.emit("edgeAttributesUpdated",{key:i.key,type:"remove",attributes:i.attributes,name:a}),this}}function aK(e,t,n){e.prototype[t]=function(r,a){let i;if(this.type!=="mixed"&&n!=="mixed"&&n!==this.type)throw new Ze(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new Ze(`Graph.${t}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const l=""+r,u=""+a;if(a=arguments[2],i=hr(this,l,u,n),!i)throw new De(`Graph.${t}: could not find an edge for the given path ("${l}" - "${u}").`)}else{if(n!=="mixed")throw new Ze(`Graph.${t}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(r=""+r,i=this._edges.get(r),!i)throw new De(`Graph.${t}: could not find the "${r}" edge in the graph.`)}if(!gn(a))throw new Le(`Graph.${t}: provided attributes are not a plain object.`);return i.attributes=a,this.emit("edgeAttributesUpdated",{key:i.key,type:"replace",attributes:i.attributes}),this}}function oK(e,t,n){e.prototype[t]=function(r,a){let i;if(this.type!=="mixed"&&n!=="mixed"&&n!==this.type)throw new Ze(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new Ze(`Graph.${t}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const l=""+r,u=""+a;if(a=arguments[2],i=hr(this,l,u,n),!i)throw new De(`Graph.${t}: could not find an edge for the given path ("${l}" - "${u}").`)}else{if(n!=="mixed")throw new Ze(`Graph.${t}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(r=""+r,i=this._edges.get(r),!i)throw new De(`Graph.${t}: could not find the "${r}" edge in the graph.`)}if(!gn(a))throw new Le(`Graph.${t}: provided attributes are not a plain object.`);return Qt(i.attributes,a),this.emit("edgeAttributesUpdated",{key:i.key,type:"merge",attributes:i.attributes,data:a}),this}}function iK(e,t,n){e.prototype[t]=function(r,a){let i;if(this.type!=="mixed"&&n!=="mixed"&&n!==this.type)throw new Ze(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new Ze(`Graph.${t}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const l=""+r,u=""+a;if(a=arguments[2],i=hr(this,l,u,n),!i)throw new De(`Graph.${t}: could not find an edge for the given path ("${l}" - "${u}").`)}else{if(n!=="mixed")throw new Ze(`Graph.${t}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(r=""+r,i=this._edges.get(r),!i)throw new De(`Graph.${t}: could not find the "${r}" edge in the graph.`)}if(typeof a!="function")throw new Le(`Graph.${t}: provided updater is not a function.`);return i.attributes=a(i.attributes),this.emit("edgeAttributesUpdated",{key:i.key,type:"update",attributes:i.attributes}),this}}const lK=[{name:e=>`get${e}Attribute`,attacher:QY},{name:e=>`get${e}Attributes`,attacher:JY},{name:e=>`has${e}Attribute`,attacher:eK},{name:e=>`set${e}Attribute`,attacher:tK},{name:e=>`update${e}Attribute`,attacher:nK},{name:e=>`remove${e}Attribute`,attacher:rK},{name:e=>`replace${e}Attributes`,attacher:aK},{name:e=>`merge${e}Attributes`,attacher:oK},{name:e=>`update${e}Attributes`,attacher:iK}];function sK(e){lK.forEach(function({name:t,attacher:n}){n(e,t("Edge"),"mixed"),n(e,t("DirectedEdge"),"directed"),n(e,t("UndirectedEdge"),"undirected")})}const uK=[{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 cK(e,t,n,r){let a=!1;for(const i in t){if(i===r)continue;const l=t[i];if(a=n(l.key,l.attributes,l.source.key,l.target.key,l.source.attributes,l.target.attributes,l.undirected),e&&a)return l.key}}function dK(e,t,n,r){let a,i,l,u=!1;for(const c in t)if(c!==r){a=t[c];do{if(i=a.source,l=a.target,u=n(a.key,a.attributes,i.key,l.key,i.attributes,l.attributes,a.undirected),e&&u)return a.key;a=a.next}while(a!==void 0)}}function xh(e,t){const n=Object.keys(e),r=n.length;let a,i=0;return{[Symbol.iterator](){return this},next(){do if(a)a=a.next;else{if(i>=r)return{done:!0};const l=n[i++];if(l===t){a=void 0;continue}a=e[l]}while(!a);return{done:!1,value:{edge:a.key,attributes:a.attributes,source:a.source.key,target:a.target.key,sourceAttributes:a.source.attributes,targetAttributes:a.target.attributes,undirected:a.undirected}}}}}function fK(e,t,n,r){const a=t[n];if(!a)return;const i=a.source,l=a.target;if(r(a.key,a.attributes,i.key,l.key,i.attributes,l.attributes,a.undirected)&&e)return a.key}function pK(e,t,n,r){let a=t[n];if(!a)return;let i=!1;do{if(i=r(a.key,a.attributes,a.source.key,a.target.key,a.source.attributes,a.target.attributes,a.undirected),e&&i)return a.key;a=a.next}while(a!==void 0)}function kh(e,t){let n=e[t];if(n.next!==void 0)return{[Symbol.iterator](){return this},next(){if(!n)return{done:!0};const a={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:a}}};let r=!1;return{[Symbol.iterator](){return this},next(){return r===!0?{done:!0}:(r=!0,{done:!1,value:{edge:n.key,attributes:n.attributes,source:n.source.key,target:n.target.key,sourceAttributes:n.source.attributes,targetAttributes:n.target.attributes,undirected:n.undirected}})}}}function gK(e,t){if(e.size===0)return[];if(t==="mixed"||t===e.type)return Array.from(e._edges.keys());const n=t==="undirected"?e.undirectedSize:e.directedSize,r=new Array(n),a=t==="undirected",i=e._edges.values();let l=0,u,c;for(;u=i.next(),u.done!==!0;)c=u.value,c.undirected===a&&(r[l++]=c.key);return r}function OU(e,t,n,r){if(t.size===0)return;const a=n!=="mixed"&&n!==t.type,i=n==="undirected";let l,u,c=!1;const f=t._edges.values();for(;l=f.next(),l.done!==!0;){if(u=l.value,a&&u.undirected!==i)continue;const{key:p,attributes:g,source:b,target:m}=u;if(c=r(p,g,b.key,m.key,b.attributes,m.attributes,u.undirected),e&&c)return p}}function hK(e,t){if(e.size===0)return Nl();const n=t!=="mixed"&&t!==e.type,r=t==="undirected",a=e._edges.values();return{[Symbol.iterator](){return this},next(){let i,l;for(;;){if(i=a.next(),i.done)return i;if(l=i.value,!(n&&l.undirected!==r))break}return{value:{edge:l.key,attributes:l.attributes,source:l.source.key,target:l.target.key,sourceAttributes:l.source.attributes,targetAttributes:l.target.attributes,undirected:l.undirected},done:!1}}}}function c0(e,t,n,r,a,i){const l=t?dK:cK;let u;if(n!=="undirected"&&(r!=="out"&&(u=l(e,a.in,i),e&&u)||r!=="in"&&(u=l(e,a.out,i,r?void 0:a.key),e&&u))||n!=="directed"&&(u=l(e,a.undirected,i),e&&u))return u}function mK(e,t,n,r){const a=[];return c0(!1,e,t,n,r,function(i){a.push(i)}),a}function bK(e,t,n){let r=Nl();return e!=="undirected"&&(t!=="out"&&typeof n.in<"u"&&(r=Na(r,xh(n.in))),t!=="in"&&typeof n.out<"u"&&(r=Na(r,xh(n.out,t?void 0:n.key)))),e!=="directed"&&typeof n.undirected<"u"&&(r=Na(r,xh(n.undirected))),r}function d0(e,t,n,r,a,i,l){const u=n?pK:fK;let c;if(t!=="undirected"&&(typeof a.in<"u"&&r!=="out"&&(c=u(e,a.in,i,l),e&&c)||typeof a.out<"u"&&r!=="in"&&(r||a.key!==i)&&(c=u(e,a.out,i,l),e&&c))||t!=="directed"&&typeof a.undirected<"u"&&(c=u(e,a.undirected,i,l),e&&c))return c}function yK(e,t,n,r,a){const i=[];return d0(!1,e,t,n,r,a,function(l){i.push(l)}),i}function vK(e,t,n,r){let a=Nl();return e!=="undirected"&&(typeof n.in<"u"&&t!=="out"&&r in n.in&&(a=Na(a,kh(n.in,r))),typeof n.out<"u"&&t!=="in"&&r in n.out&&(t||n.key!==r)&&(a=Na(a,kh(n.out,r)))),e!=="directed"&&typeof n.undirected<"u"&&r in n.undirected&&(a=Na(a,kh(n.undirected,r))),a}function SK(e,t){const{name:n,type:r,direction:a}=t;e.prototype[n]=function(i,l){if(r!=="mixed"&&this.type!=="mixed"&&r!==this.type)return[];if(!arguments.length)return gK(this,r);if(arguments.length===1){i=""+i;const u=this._nodes.get(i);if(typeof u>"u")throw new De(`Graph.${n}: could not find the "${i}" node in the graph.`);return mK(this.multi,r==="mixed"?this.type:r,a,u)}if(arguments.length===2){i=""+i,l=""+l;const u=this._nodes.get(i);if(!u)throw new De(`Graph.${n}: could not find the "${i}" source node in the graph.`);if(!this._nodes.has(l))throw new De(`Graph.${n}: could not find the "${l}" target node in the graph.`);return yK(r,this.multi,a,u,l)}throw new Le(`Graph.${n}: too many arguments (expecting 0, 1 or 2 and got ${arguments.length}).`)}}function EK(e,t){const{name:n,type:r,direction:a}=t,i="forEach"+n[0].toUpperCase()+n.slice(1,-1);e.prototype[i]=function(f,p,g){if(!(r!=="mixed"&&this.type!=="mixed"&&r!==this.type)){if(arguments.length===1)return g=f,OU(!1,this,r,g);if(arguments.length===2){f=""+f,g=p;const b=this._nodes.get(f);if(typeof b>"u")throw new De(`Graph.${i}: could not find the "${f}" node in the graph.`);return c0(!1,this.multi,r==="mixed"?this.type:r,a,b,g)}if(arguments.length===3){f=""+f,p=""+p;const b=this._nodes.get(f);if(!b)throw new De(`Graph.${i}: could not find the "${f}" source node in the graph.`);if(!this._nodes.has(p))throw new De(`Graph.${i}: could not find the "${p}" target node in the graph.`);return d0(!1,r,this.multi,a,b,p,g)}throw new Le(`Graph.${i}: too many arguments (expecting 1, 2 or 3 and got ${arguments.length}).`)}};const l="map"+n[0].toUpperCase()+n.slice(1);e.prototype[l]=function(){const f=Array.prototype.slice.call(arguments),p=f.pop();let g;if(f.length===0){let b=0;r!=="directed"&&(b+=this.undirectedSize),r!=="undirected"&&(b+=this.directedSize),g=new Array(b);let m=0;f.push((S,v,A,R,x,_,C)=>{g[m++]=p(S,v,A,R,x,_,C)})}else g=[],f.push((b,m,S,v,A,R,x)=>{g.push(p(b,m,S,v,A,R,x))});return this[i].apply(this,f),g};const u="filter"+n[0].toUpperCase()+n.slice(1);e.prototype[u]=function(){const f=Array.prototype.slice.call(arguments),p=f.pop(),g=[];return f.push((b,m,S,v,A,R,x)=>{p(b,m,S,v,A,R,x)&&g.push(b)}),this[i].apply(this,f),g};const c="reduce"+n[0].toUpperCase()+n.slice(1);e.prototype[c]=function(){let f=Array.prototype.slice.call(arguments);if(f.length<2||f.length>4)throw new Le(`Graph.${c}: invalid number of arguments (expecting 2, 3 or 4 and got ${f.length}).`);if(typeof f[f.length-1]=="function"&&typeof f[f.length-2]!="function")throw new Le(`Graph.${c}: missing initial value. You must provide it because the callback takes more than one argument and we cannot infer the initial value from the first iteration, as you could with a simple array.`);let p,g;f.length===2?(p=f[0],g=f[1],f=[]):f.length===3?(p=f[1],g=f[2],f=[f[0]]):f.length===4&&(p=f[2],g=f[3],f=[f[0],f[1]]);let b=g;return f.push((m,S,v,A,R,x,_)=>{b=p(b,m,S,v,A,R,x,_)}),this[i].apply(this,f),b}}function wK(e,t){const{name:n,type:r,direction:a}=t,i="find"+n[0].toUpperCase()+n.slice(1,-1);e.prototype[i]=function(c,f,p){if(r!=="mixed"&&this.type!=="mixed"&&r!==this.type)return!1;if(arguments.length===1)return p=c,OU(!0,this,r,p);if(arguments.length===2){c=""+c,p=f;const g=this._nodes.get(c);if(typeof g>"u")throw new De(`Graph.${i}: could not find the "${c}" node in the graph.`);return c0(!0,this.multi,r==="mixed"?this.type:r,a,g,p)}if(arguments.length===3){c=""+c,f=""+f;const g=this._nodes.get(c);if(!g)throw new De(`Graph.${i}: could not find the "${c}" source node in the graph.`);if(!this._nodes.has(f))throw new De(`Graph.${i}: could not find the "${f}" target node in the graph.`);return d0(!0,r,this.multi,a,g,f,p)}throw new Le(`Graph.${i}: too many arguments (expecting 1, 2 or 3 and got ${arguments.length}).`)};const l="some"+n[0].toUpperCase()+n.slice(1,-1);e.prototype[l]=function(){const c=Array.prototype.slice.call(arguments),f=c.pop();return c.push((g,b,m,S,v,A,R)=>f(g,b,m,S,v,A,R)),!!this[i].apply(this,c)};const u="every"+n[0].toUpperCase()+n.slice(1,-1);e.prototype[u]=function(){const c=Array.prototype.slice.call(arguments),f=c.pop();return c.push((g,b,m,S,v,A,R)=>!f(g,b,m,S,v,A,R)),!this[i].apply(this,c)}}function xK(e,t){const{name:n,type:r,direction:a}=t,i=n.slice(0,-1)+"Entries";e.prototype[i]=function(l,u){if(r!=="mixed"&&this.type!=="mixed"&&r!==this.type)return Nl();if(!arguments.length)return hK(this,r);if(arguments.length===1){l=""+l;const c=this._nodes.get(l);if(!c)throw new De(`Graph.${i}: could not find the "${l}" node in the graph.`);return bK(r,a,c)}if(arguments.length===2){l=""+l,u=""+u;const c=this._nodes.get(l);if(!c)throw new De(`Graph.${i}: could not find the "${l}" source node in the graph.`);if(!this._nodes.has(u))throw new De(`Graph.${i}: could not find the "${u}" target node in the graph.`);return vK(r,a,c,u)}throw new Le(`Graph.${i}: too many arguments (expecting 0, 1 or 2 and got ${arguments.length}).`)}}function kK(e){uK.forEach(t=>{SK(e,t),EK(e,t),wK(e,t),xK(e,t)})}const AK=[{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 Rf(){this.A=null,this.B=null}Rf.prototype.wrap=function(e){this.A===null?this.A=e:this.B===null&&(this.B=e)};Rf.prototype.has=function(e){return this.A!==null&&e in this.A||this.B!==null&&e in this.B};function Ms(e,t,n,r,a){for(const i in r){const l=r[i],u=l.source,c=l.target,f=u===n?c:u;if(t&&t.has(f.key))continue;const p=a(f.key,f.attributes);if(e&&p)return f.key}}function f0(e,t,n,r,a){if(t!=="mixed"){if(t==="undirected")return Ms(e,null,r,r.undirected,a);if(typeof n=="string")return Ms(e,null,r,r[n],a)}const i=new Rf;let l;if(t!=="undirected"){if(n!=="out"){if(l=Ms(e,null,r,r.in,a),e&&l)return l;i.wrap(r.in)}if(n!=="in"){if(l=Ms(e,i,r,r.out,a),e&&l)return l;i.wrap(r.out)}}if(t!=="directed"&&(l=Ms(e,i,r,r.undirected,a),e&&l))return l}function TK(e,t,n){if(e!=="mixed"){if(e==="undirected")return Object.keys(n.undirected);if(typeof t=="string")return Object.keys(n[t])}const r=[];return f0(!1,e,t,n,function(a){r.push(a)}),r}function Fs(e,t,n){const r=Object.keys(n),a=r.length;let i=0;return{[Symbol.iterator](){return this},next(){let l=null;do{if(i>=a)return e&&e.wrap(n),{done:!0};const u=n[r[i++]],c=u.source,f=u.target;if(l=c===t?f:c,e&&e.has(l.key)){l=null;continue}}while(l===null);return{done:!1,value:{neighbor:l.key,attributes:l.attributes}}}}}function _K(e,t,n){if(e!=="mixed"){if(e==="undirected")return Fs(null,n,n.undirected);if(typeof t=="string")return Fs(null,n,n[t])}let r=Nl();const a=new Rf;return e!=="undirected"&&(t!=="out"&&(r=Na(r,Fs(a,n,n.in))),t!=="in"&&(r=Na(r,Fs(a,n,n.out)))),e!=="directed"&&(r=Na(r,Fs(a,n,n.undirected))),r}function RK(e,t){const{name:n,type:r,direction:a}=t;e.prototype[n]=function(i){if(r!=="mixed"&&this.type!=="mixed"&&r!==this.type)return[];i=""+i;const l=this._nodes.get(i);if(typeof l>"u")throw new De(`Graph.${n}: could not find the "${i}" node in the graph.`);return TK(r==="mixed"?this.type:r,a,l)}}function CK(e,t){const{name:n,type:r,direction:a}=t,i="forEach"+n[0].toUpperCase()+n.slice(1,-1);e.prototype[i]=function(f,p){if(r!=="mixed"&&this.type!=="mixed"&&r!==this.type)return;f=""+f;const g=this._nodes.get(f);if(typeof g>"u")throw new De(`Graph.${i}: could not find the "${f}" node in the graph.`);f0(!1,r==="mixed"?this.type:r,a,g,p)};const l="map"+n[0].toUpperCase()+n.slice(1);e.prototype[l]=function(f,p){const g=[];return this[i](f,(b,m)=>{g.push(p(b,m))}),g};const u="filter"+n[0].toUpperCase()+n.slice(1);e.prototype[u]=function(f,p){const g=[];return this[i](f,(b,m)=>{p(b,m)&&g.push(b)}),g};const c="reduce"+n[0].toUpperCase()+n.slice(1);e.prototype[c]=function(f,p,g){if(arguments.length<3)throw new Le(`Graph.${c}: 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 b=g;return this[i](f,(m,S)=>{b=p(b,m,S)}),b}}function NK(e,t){const{name:n,type:r,direction:a}=t,i=n[0].toUpperCase()+n.slice(1,-1),l="find"+i;e.prototype[l]=function(f,p){if(r!=="mixed"&&this.type!=="mixed"&&r!==this.type)return;f=""+f;const g=this._nodes.get(f);if(typeof g>"u")throw new De(`Graph.${l}: could not find the "${f}" node in the graph.`);return f0(!0,r==="mixed"?this.type:r,a,g,p)};const u="some"+i;e.prototype[u]=function(f,p){return!!this[l](f,p)};const c="every"+i;e.prototype[c]=function(f,p){return!this[l](f,(b,m)=>!p(b,m))}}function OK(e,t){const{name:n,type:r,direction:a}=t,i=n.slice(0,-1)+"Entries";e.prototype[i]=function(l){if(r!=="mixed"&&this.type!=="mixed"&&r!==this.type)return Nl();l=""+l;const u=this._nodes.get(l);if(typeof u>"u")throw new De(`Graph.${i}: could not find the "${l}" node in the graph.`);return _K(r==="mixed"?this.type:r,a,u)}}function DK(e){AK.forEach(t=>{RK(e,t),CK(e,t),NK(e,t),OK(e,t)})}function Vc(e,t,n,r,a){const i=r._nodes.values(),l=r.type;let u,c,f,p,g,b;for(;u=i.next(),u.done!==!0;){let m=!1;if(c=u.value,l!=="undirected"){p=c.out;for(f in p){g=p[f];do b=g.target,m=!0,a(c.key,b.key,c.attributes,b.attributes,g.key,g.attributes,g.undirected),g=g.next;while(g)}}if(l!=="directed"){p=c.undirected;for(f in p)if(!(t&&c.key>f)){g=p[f];do b=g.target,b.key!==f&&(b=g.source),m=!0,a(c.key,b.key,c.attributes,b.attributes,g.key,g.attributes,g.undirected),g=g.next;while(g)}}n&&!m&&a(c.key,null,c.attributes,null,null,null,null)}}function IK(e,t){const n={key:e};return kU(t.attributes)||(n.attributes=Qt({},t.attributes)),n}function LK(e,t,n){const r={key:t,source:n.source.key,target:n.target.key};return kU(n.attributes)||(r.attributes=Qt({},n.attributes)),e==="mixed"&&n.undirected&&(r.undirected=!0),r}function MK(e){if(!gn(e))throw new Le('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 Le("Graph.import: serialized node is missing its key.");if("attributes"in e&&(!gn(e.attributes)||e.attributes===null))throw new Le("Graph.import: invalid attributes. Attributes should be a plain object, null or omitted.")}function FK(e){if(!gn(e))throw new Le('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 Le("Graph.import: serialized edge is missing its source.");if(!("target"in e))throw new Le("Graph.import: serialized edge is missing its target.");if("attributes"in e&&(!gn(e.attributes)||e.attributes===null))throw new Le("Graph.import: invalid attributes. Attributes should be a plain object, null or omitted.");if("undirected"in e&&typeof e.undirected!="boolean")throw new Le("Graph.import: invalid undirectedness information. Undirected should be boolean or omitted.")}const zK=BY(),PK=new Set(["directed","undirected","mixed"]),KR=new Set(["domain","_events","_eventsCount","_maxListeners"]),BK=[{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"}],UK={allowSelfLoops:!0,multi:!1,type:"mixed"};function jK(e,t,n){if(n&&!gn(n))throw new Le(`Graph.addNode: invalid attributes. Expecting an object but got "${n}"`);if(t=""+t,n=n||{},e._nodes.has(t))throw new Ze(`Graph.addNode: the "${t}" node already exist in the graph.`);const r=new e.NodeDataClass(t,n);return e._nodes.set(t,r),e.emit("nodeAdded",{key:t,attributes:n}),r}function XR(e,t,n){const r=new e.NodeDataClass(t,n);return e._nodes.set(t,r),e.emit("nodeAdded",{key:t,attributes:n}),r}function DU(e,t,n,r,a,i,l,u){if(!r&&e.type==="undirected")throw new Ze(`Graph.${t}: you cannot add a directed edge to an undirected graph. Use the #.addEdge or #.addUndirectedEdge instead.`);if(r&&e.type==="directed")throw new Ze(`Graph.${t}: you cannot add an undirected edge to a directed graph. Use the #.addEdge or #.addDirectedEdge instead.`);if(u&&!gn(u))throw new Le(`Graph.${t}: invalid attributes. Expecting an object but got "${u}"`);if(i=""+i,l=""+l,u=u||{},!e.allowSelfLoops&&i===l)throw new Ze(`Graph.${t}: source & target are the same ("${i}"), thus creating a loop explicitly forbidden by this graph 'allowSelfLoops' option set to false.`);const c=e._nodes.get(i),f=e._nodes.get(l);if(!c)throw new De(`Graph.${t}: source node "${i}" not found.`);if(!f)throw new De(`Graph.${t}: target node "${l}" not found.`);const p={key:null,undirected:r,source:i,target:l,attributes:u};if(n)a=e._edgeKeyGenerator();else if(a=""+a,e._edges.has(a))throw new Ze(`Graph.${t}: the "${a}" edge already exists in the graph.`);if(!e.multi&&(r?typeof c.undirected[l]<"u":typeof c.out[l]<"u"))throw new Ze(`Graph.${t}: an edge linking "${i}" to "${l}" already exists. If you really want to add multiple edges linking those nodes, you should create a multi graph by using the 'multi' option.`);const g=new Ol(r,a,c,f,u);e._edges.set(a,g);const b=i===l;return r?(c.undirectedDegree++,f.undirectedDegree++,b&&(c.undirectedLoops++,e._undirectedSelfLoopCount++)):(c.outDegree++,f.inDegree++,b&&(c.directedLoops++,e._directedSelfLoopCount++)),e.multi?g.attachMulti():g.attach(),r?e._undirectedSize++:e._directedSize++,p.key=a,e.emit("edgeAdded",p),a}function GK(e,t,n,r,a,i,l,u,c){if(!r&&e.type==="undirected")throw new Ze(`Graph.${t}: you cannot merge/update a directed edge to an undirected graph. Use the #.mergeEdge/#.updateEdge or #.addUndirectedEdge instead.`);if(r&&e.type==="directed")throw new Ze(`Graph.${t}: you cannot merge/update an undirected edge to a directed graph. Use the #.mergeEdge/#.updateEdge or #.addDirectedEdge instead.`);if(u){if(c){if(typeof u!="function")throw new Le(`Graph.${t}: invalid updater function. Expecting a function but got "${u}"`)}else if(!gn(u))throw new Le(`Graph.${t}: invalid attributes. Expecting an object but got "${u}"`)}i=""+i,l=""+l;let f;if(c&&(f=u,u=void 0),!e.allowSelfLoops&&i===l)throw new Ze(`Graph.${t}: source & target are the same ("${i}"), thus creating a loop explicitly forbidden by this graph 'allowSelfLoops' option set to false.`);let p=e._nodes.get(i),g=e._nodes.get(l),b,m;if(!n&&(b=e._edges.get(a),b)){if((b.source.key!==i||b.target.key!==l)&&(!r||b.source.key!==l||b.target.key!==i))throw new Ze(`Graph.${t}: inconsistency detected when attempting to merge the "${a}" edge with "${i}" source & "${l}" target vs. ("${b.source.key}", "${b.target.key}").`);m=b}if(!m&&!e.multi&&p&&(m=r?p.undirected[l]:p.out[l]),m){const x=[m.key,!1,!1,!1];if(c?!f:!u)return x;if(c){const _=m.attributes;m.attributes=f(_),e.emit("edgeAttributesUpdated",{type:"replace",key:m.key,attributes:m.attributes})}else Qt(m.attributes,u),e.emit("edgeAttributesUpdated",{type:"merge",key:m.key,attributes:m.attributes,data:u});return x}u=u||{},c&&f&&(u=f(u));const S={key:null,undirected:r,source:i,target:l,attributes:u};if(n)a=e._edgeKeyGenerator();else if(a=""+a,e._edges.has(a))throw new Ze(`Graph.${t}: the "${a}" edge already exists in the graph.`);let v=!1,A=!1;p||(p=XR(e,i,{}),v=!0,i===l&&(g=p,A=!0)),g||(g=XR(e,l,{}),A=!0),b=new Ol(r,a,p,g,u),e._edges.set(a,b);const R=i===l;return r?(p.undirectedDegree++,g.undirectedDegree++,R&&(p.undirectedLoops++,e._undirectedSelfLoopCount++)):(p.outDegree++,g.inDegree++,R&&(p.directedLoops++,e._directedSelfLoopCount++)),e.multi?b.attachMulti():b.attach(),r?e._undirectedSize++:e._directedSize++,S.key=a,e.emit("edgeAdded",S),[a,!0,v,A]}function Qi(e,t){e._edges.delete(t.key);const{source:n,target:r,attributes:a}=t,i=t.undirected,l=n===r;i?(n.undirectedDegree--,r.undirectedDegree--,l&&(n.undirectedLoops--,e._undirectedSelfLoopCount--)):(n.outDegree--,r.inDegree--,l&&(n.directedLoops--,e._directedSelfLoopCount--)),e.multi?t.detachMulti():t.detach(),i?e._undirectedSize--:e._directedSize--,e.emit("edgeDropped",{key:t.key,attributes:a,source:n.key,target:r.key,undirected:i})}class Tt extends xU.EventEmitter{constructor(t){if(super(),t=Qt({},UK,t),typeof t.multi!="boolean")throw new Le(`Graph.constructor: invalid 'multi' option. Expecting a boolean but got "${t.multi}".`);if(!PK.has(t.type))throw new Le(`Graph.constructor: invalid 'type' option. Should be one of "mixed", "directed" or "undirected" but got "${t.type}".`);if(typeof t.allowSelfLoops!="boolean")throw new Le(`Graph.constructor: invalid 'allowSelfLoops' option. Expecting a boolean but got "${t.allowSelfLoops}".`);const n=t.type==="mixed"?AU:t.type==="directed"?TU:_U;pr(this,"NodeDataClass",n);const r="geid_"+zK()+"_";let a=0;const i=()=>{let l;do l=r+a++;while(this._edges.has(l));return l};pr(this,"_attributes",{}),pr(this,"_nodes",new Map),pr(this,"_edges",new Map),pr(this,"_directedSize",0),pr(this,"_undirectedSize",0),pr(this,"_directedSelfLoopCount",0),pr(this,"_undirectedSelfLoopCount",0),pr(this,"_edgeKeyGenerator",i),pr(this,"_options",t),KR.forEach(l=>pr(this,l,this[l])),Tr(this,"order",()=>this._nodes.size),Tr(this,"size",()=>this._edges.size),Tr(this,"directedSize",()=>this._directedSize),Tr(this,"undirectedSize",()=>this._undirectedSize),Tr(this,"selfLoopCount",()=>this._directedSelfLoopCount+this._undirectedSelfLoopCount),Tr(this,"directedSelfLoopCount",()=>this._directedSelfLoopCount),Tr(this,"undirectedSelfLoopCount",()=>this._undirectedSelfLoopCount),Tr(this,"multi",this._options.multi),Tr(this,"type",this._options.type),Tr(this,"allowSelfLoops",this._options.allowSelfLoops),Tr(this,"implementation",()=>"graphology")}_resetInstanceCounters(){this._directedSize=0,this._undirectedSize=0,this._directedSelfLoopCount=0,this._undirectedSelfLoopCount=0}hasNode(t){return this._nodes.has(""+t)}hasDirectedEdge(t,n){if(this.type==="undirected")return!1;if(arguments.length===1){const r=""+t,a=this._edges.get(r);return!!a&&!a.undirected}else if(arguments.length===2){t=""+t,n=""+n;const r=this._nodes.get(t);return r?r.out.hasOwnProperty(n):!1}throw new Le(`Graph.hasDirectedEdge: invalid arity (${arguments.length}, instead of 1 or 2). You can either ask for an edge id or for the existence of an edge between a source & a target.`)}hasUndirectedEdge(t,n){if(this.type==="directed")return!1;if(arguments.length===1){const r=""+t,a=this._edges.get(r);return!!a&&a.undirected}else if(arguments.length===2){t=""+t,n=""+n;const r=this._nodes.get(t);return r?r.undirected.hasOwnProperty(n):!1}throw new Le(`Graph.hasDirectedEdge: invalid arity (${arguments.length}, instead of 1 or 2). You can either ask for an edge id or for the existence of an edge between a source & a target.`)}hasEdge(t,n){if(arguments.length===1){const r=""+t;return this._edges.has(r)}else if(arguments.length===2){t=""+t,n=""+n;const r=this._nodes.get(t);return r?typeof r.out<"u"&&r.out.hasOwnProperty(n)||typeof r.undirected<"u"&&r.undirected.hasOwnProperty(n):!1}throw new Le(`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 Ze("Graph.directedEdge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.directedEdges instead.");const r=this._nodes.get(t);if(!r)throw new De(`Graph.directedEdge: could not find the "${t}" source node in the graph.`);if(!this._nodes.has(n))throw new De(`Graph.directedEdge: could not find the "${n}" target node in the graph.`);const a=r.out&&r.out[n]||void 0;if(a)return a.key}undirectedEdge(t,n){if(this.type==="directed")return;if(t=""+t,n=""+n,this.multi)throw new Ze("Graph.undirectedEdge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.undirectedEdges instead.");const r=this._nodes.get(t);if(!r)throw new De(`Graph.undirectedEdge: could not find the "${t}" source node in the graph.`);if(!this._nodes.has(n))throw new De(`Graph.undirectedEdge: could not find the "${n}" target node in the graph.`);const a=r.undirected&&r.undirected[n]||void 0;if(a)return a.key}edge(t,n){if(this.multi)throw new Ze("Graph.edge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.edges instead.");t=""+t,n=""+n;const r=this._nodes.get(t);if(!r)throw new De(`Graph.edge: could not find the "${t}" source node in the graph.`);if(!this._nodes.has(n))throw new De(`Graph.edge: could not find the "${n}" target node in the graph.`);const a=r.out&&r.out[n]||r.undirected&&r.undirected[n]||void 0;if(a)return a.key}areDirectedNeighbors(t,n){t=""+t,n=""+n;const r=this._nodes.get(t);if(!r)throw new De(`Graph.areDirectedNeighbors: could not find the "${t}" node in the graph.`);return this.type==="undirected"?!1:n in r.in||n in r.out}areOutNeighbors(t,n){t=""+t,n=""+n;const r=this._nodes.get(t);if(!r)throw new De(`Graph.areOutNeighbors: could not find the "${t}" node in the graph.`);return this.type==="undirected"?!1:n in r.out}areInNeighbors(t,n){t=""+t,n=""+n;const r=this._nodes.get(t);if(!r)throw new De(`Graph.areInNeighbors: could not find the "${t}" node in the graph.`);return this.type==="undirected"?!1:n in r.in}areUndirectedNeighbors(t,n){t=""+t,n=""+n;const r=this._nodes.get(t);if(!r)throw new De(`Graph.areUndirectedNeighbors: could not find the "${t}" node in the graph.`);return this.type==="directed"?!1:n in r.undirected}areNeighbors(t,n){t=""+t,n=""+n;const r=this._nodes.get(t);if(!r)throw new De(`Graph.areNeighbors: could not find the "${t}" node in the graph.`);return this.type!=="undirected"&&(n in r.in||n in r.out)||this.type!=="directed"&&n in r.undirected}areInboundNeighbors(t,n){t=""+t,n=""+n;const r=this._nodes.get(t);if(!r)throw new De(`Graph.areInboundNeighbors: could not find the "${t}" node in the graph.`);return this.type!=="undirected"&&n in r.in||this.type!=="directed"&&n in r.undirected}areOutboundNeighbors(t,n){t=""+t,n=""+n;const r=this._nodes.get(t);if(!r)throw new De(`Graph.areOutboundNeighbors: could not find the "${t}" node in the graph.`);return this.type!=="undirected"&&n in r.out||this.type!=="directed"&&n in r.undirected}inDegree(t){t=""+t;const n=this._nodes.get(t);if(!n)throw new De(`Graph.inDegree: could not find the "${t}" node in the graph.`);return this.type==="undirected"?0:n.inDegree}outDegree(t){t=""+t;const n=this._nodes.get(t);if(!n)throw new De(`Graph.outDegree: could not find the "${t}" node in the graph.`);return this.type==="undirected"?0:n.outDegree}directedDegree(t){t=""+t;const n=this._nodes.get(t);if(!n)throw new De(`Graph.directedDegree: could not find the "${t}" node in the graph.`);return this.type==="undirected"?0:n.inDegree+n.outDegree}undirectedDegree(t){t=""+t;const n=this._nodes.get(t);if(!n)throw new De(`Graph.undirectedDegree: could not find the "${t}" node in the graph.`);return this.type==="directed"?0:n.undirectedDegree}inboundDegree(t){t=""+t;const n=this._nodes.get(t);if(!n)throw new De(`Graph.inboundDegree: could not find the "${t}" node in the graph.`);let r=0;return this.type!=="directed"&&(r+=n.undirectedDegree),this.type!=="undirected"&&(r+=n.inDegree),r}outboundDegree(t){t=""+t;const n=this._nodes.get(t);if(!n)throw new De(`Graph.outboundDegree: could not find the "${t}" node in the graph.`);let r=0;return this.type!=="directed"&&(r+=n.undirectedDegree),this.type!=="undirected"&&(r+=n.outDegree),r}degree(t){t=""+t;const n=this._nodes.get(t);if(!n)throw new De(`Graph.degree: could not find the "${t}" node in the graph.`);let r=0;return this.type!=="directed"&&(r+=n.undirectedDegree),this.type!=="undirected"&&(r+=n.inDegree+n.outDegree),r}inDegreeWithoutSelfLoops(t){t=""+t;const n=this._nodes.get(t);if(!n)throw new De(`Graph.inDegreeWithoutSelfLoops: could not find the "${t}" node in the graph.`);return this.type==="undirected"?0:n.inDegree-n.directedLoops}outDegreeWithoutSelfLoops(t){t=""+t;const n=this._nodes.get(t);if(!n)throw new De(`Graph.outDegreeWithoutSelfLoops: could not find the "${t}" node in the graph.`);return this.type==="undirected"?0:n.outDegree-n.directedLoops}directedDegreeWithoutSelfLoops(t){t=""+t;const n=this._nodes.get(t);if(!n)throw new De(`Graph.directedDegreeWithoutSelfLoops: could not find the "${t}" node in the graph.`);return this.type==="undirected"?0:n.inDegree+n.outDegree-n.directedLoops*2}undirectedDegreeWithoutSelfLoops(t){t=""+t;const n=this._nodes.get(t);if(!n)throw new De(`Graph.undirectedDegreeWithoutSelfLoops: could not find the "${t}" node in the graph.`);return this.type==="directed"?0:n.undirectedDegree-n.undirectedLoops*2}inboundDegreeWithoutSelfLoops(t){t=""+t;const n=this._nodes.get(t);if(!n)throw new De(`Graph.inboundDegreeWithoutSelfLoops: could not find the "${t}" node in the graph.`);let r=0,a=0;return this.type!=="directed"&&(r+=n.undirectedDegree,a+=n.undirectedLoops*2),this.type!=="undirected"&&(r+=n.inDegree,a+=n.directedLoops),r-a}outboundDegreeWithoutSelfLoops(t){t=""+t;const n=this._nodes.get(t);if(!n)throw new De(`Graph.outboundDegreeWithoutSelfLoops: could not find the "${t}" node in the graph.`);let r=0,a=0;return this.type!=="directed"&&(r+=n.undirectedDegree,a+=n.undirectedLoops*2),this.type!=="undirected"&&(r+=n.outDegree,a+=n.directedLoops),r-a}degreeWithoutSelfLoops(t){t=""+t;const n=this._nodes.get(t);if(!n)throw new De(`Graph.degreeWithoutSelfLoops: could not find the "${t}" node in the graph.`);let r=0,a=0;return this.type!=="directed"&&(r+=n.undirectedDegree,a+=n.undirectedLoops*2),this.type!=="undirected"&&(r+=n.inDegree+n.outDegree,a+=n.directedLoops*2),r-a}source(t){t=""+t;const n=this._edges.get(t);if(!n)throw new De(`Graph.source: could not find the "${t}" edge in the graph.`);return n.source.key}target(t){t=""+t;const n=this._edges.get(t);if(!n)throw new De(`Graph.target: could not find the "${t}" edge in the graph.`);return n.target.key}extremities(t){t=""+t;const n=this._edges.get(t);if(!n)throw new De(`Graph.extremities: could not find the "${t}" edge in the graph.`);return[n.source.key,n.target.key]}opposite(t,n){t=""+t,n=""+n;const r=this._edges.get(n);if(!r)throw new De(`Graph.opposite: could not find the "${n}" edge in the graph.`);const a=r.source.key,i=r.target.key;if(t===a)return i;if(t===i)return a;throw new De(`Graph.opposite: the "${t}" node is not attached to the "${n}" edge (${a}, ${i}).`)}hasExtremity(t,n){t=""+t,n=""+n;const r=this._edges.get(t);if(!r)throw new De(`Graph.hasExtremity: could not find the "${t}" edge in the graph.`);return r.source.key===n||r.target.key===n}isUndirected(t){t=""+t;const n=this._edges.get(t);if(!n)throw new De(`Graph.isUndirected: could not find the "${t}" edge in the graph.`);return n.undirected}isDirected(t){t=""+t;const n=this._edges.get(t);if(!n)throw new De(`Graph.isDirected: could not find the "${t}" edge in the graph.`);return!n.undirected}isSelfLoop(t){t=""+t;const n=this._edges.get(t);if(!n)throw new De(`Graph.isSelfLoop: could not find the "${t}" edge in the graph.`);return n.source===n.target}addNode(t,n){return jK(this,t,n).key}mergeNode(t,n){if(n&&!gn(n))throw new Le(`Graph.mergeNode: invalid attributes. Expecting an object but got "${n}"`);t=""+t,n=n||{};let r=this._nodes.get(t);return r?(n&&(Qt(r.attributes,n),this.emit("nodeAttributesUpdated",{type:"merge",key:t,attributes:r.attributes,data:n})),[t,!1]):(r=new this.NodeDataClass(t,n),this._nodes.set(t,r),this.emit("nodeAdded",{key:t,attributes:n}),[t,!0])}updateNode(t,n){if(n&&typeof n!="function")throw new Le(`Graph.updateNode: invalid updater function. Expecting a function but got "${n}"`);t=""+t;let r=this._nodes.get(t);if(r){if(n){const i=r.attributes;r.attributes=n(i),this.emit("nodeAttributesUpdated",{type:"replace",key:t,attributes:r.attributes})}return[t,!1]}const a=n?n({}):{};return r=new this.NodeDataClass(t,a),this._nodes.set(t,r),this.emit("nodeAdded",{key:t,attributes:a}),[t,!0]}dropNode(t){t=""+t;const n=this._nodes.get(t);if(!n)throw new De(`Graph.dropNode: could not find the "${t}" node in the graph.`);let r;if(this.type!=="undirected"){for(const a in n.out){r=n.out[a];do Qi(this,r),r=r.next;while(r)}for(const a in n.in){r=n.in[a];do Qi(this,r),r=r.next;while(r)}}if(this.type!=="directed")for(const a in n.undirected){r=n.undirected[a];do Qi(this,r),r=r.next;while(r)}this._nodes.delete(t),this.emit("nodeDropped",{key:t,attributes:n.attributes})}dropEdge(t){let n;if(arguments.length>1){const r=""+arguments[0],a=""+arguments[1];if(n=hr(this,r,a,this.type),!n)throw new De(`Graph.dropEdge: could not find the "${r}" -> "${a}" edge in the graph.`)}else if(t=""+t,n=this._edges.get(t),!n)throw new De(`Graph.dropEdge: could not find the "${t}" edge in the graph.`);return Qi(this,n),this}dropDirectedEdge(t,n){if(arguments.length<2)throw new Ze("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 Ze("Graph.dropDirectedEdge: cannot use a {source,target} combo when dropping an edge in a MultiGraph since we cannot infer the one you want to delete as there could be multiple ones.");t=""+t,n=""+n;const r=hr(this,t,n,"directed");if(!r)throw new De(`Graph.dropDirectedEdge: could not find a "${t}" -> "${n}" edge in the graph.`);return Qi(this,r),this}dropUndirectedEdge(t,n){if(arguments.length<2)throw new Ze("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 Ze("Graph.dropUndirectedEdge: cannot use a {source,target} combo when dropping an edge in a MultiGraph since we cannot infer the one you want to delete as there could be multiple ones.");const r=hr(this,t,n,"undirected");if(!r)throw new De(`Graph.dropUndirectedEdge: could not find a "${t}" -> "${n}" edge in the graph.`);return Qi(this,r),this}clear(){this._edges.clear(),this._nodes.clear(),this._resetInstanceCounters(),this.emit("cleared")}clearEdges(){const t=this._nodes.values();let n;for(;n=t.next(),n.done!==!0;)n.value.clear();this._edges.clear(),this._resetInstanceCounters(),this.emit("edgesCleared")}getAttribute(t){return this._attributes[t]}getAttributes(){return this._attributes}hasAttribute(t){return this._attributes.hasOwnProperty(t)}setAttribute(t,n){return this._attributes[t]=n,this.emit("attributesUpdated",{type:"set",attributes:this._attributes,name:t}),this}updateAttribute(t,n){if(typeof n!="function")throw new Le("Graph.updateAttribute: updater should be a function.");const r=this._attributes[t];return this._attributes[t]=n(r),this.emit("attributesUpdated",{type:"set",attributes:this._attributes,name:t}),this}removeAttribute(t){return delete this._attributes[t],this.emit("attributesUpdated",{type:"remove",attributes:this._attributes,name:t}),this}replaceAttributes(t){if(!gn(t))throw new Le("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(!gn(t))throw new Le("Graph.mergeAttributes: provided attributes are not a plain object.");return Qt(this._attributes,t),this.emit("attributesUpdated",{type:"merge",attributes:this._attributes,data:t}),this}updateAttributes(t){if(typeof t!="function")throw new Le("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 Le("Graph.updateEachNodeAttributes: expecting an updater function.");if(n&&!YR(n))throw new Le("Graph.updateEachNodeAttributes: invalid hints. Expecting an object having the following shape: {attributes?: [string]}");const r=this._nodes.values();let a,i;for(;a=r.next(),a.done!==!0;)i=a.value,i.attributes=t(i.key,i.attributes);this.emit("eachNodeAttributesUpdated",{hints:n||null})}updateEachEdgeAttributes(t,n){if(typeof t!="function")throw new Le("Graph.updateEachEdgeAttributes: expecting an updater function.");if(n&&!YR(n))throw new Le("Graph.updateEachEdgeAttributes: invalid hints. Expecting an object having the following shape: {attributes?: [string]}");const r=this._edges.values();let a,i,l,u;for(;a=r.next(),a.done!==!0;)i=a.value,l=i.source,u=i.target,i.attributes=t(i.key,i.attributes,l.key,u.key,l.attributes,u.attributes,i.undirected);this.emit("eachEdgeAttributesUpdated",{hints:n||null})}forEachAdjacencyEntry(t){if(typeof t!="function")throw new Le("Graph.forEachAdjacencyEntry: expecting a callback.");Vc(!1,!1,!1,this,t)}forEachAdjacencyEntryWithOrphans(t){if(typeof t!="function")throw new Le("Graph.forEachAdjacencyEntryWithOrphans: expecting a callback.");Vc(!1,!1,!0,this,t)}forEachAssymetricAdjacencyEntry(t){if(typeof t!="function")throw new Le("Graph.forEachAssymetricAdjacencyEntry: expecting a callback.");Vc(!1,!0,!1,this,t)}forEachAssymetricAdjacencyEntryWithOrphans(t){if(typeof t!="function")throw new Le("Graph.forEachAssymetricAdjacencyEntryWithOrphans: expecting a callback.");Vc(!1,!0,!0,this,t)}nodes(){return Array.from(this._nodes.keys())}forEachNode(t){if(typeof t!="function")throw new Le("Graph.forEachNode: expecting a callback.");const n=this._nodes.values();let r,a;for(;r=n.next(),r.done!==!0;)a=r.value,t(a.key,a.attributes)}findNode(t){if(typeof t!="function")throw new Le("Graph.findNode: expecting a callback.");const n=this._nodes.values();let r,a;for(;r=n.next(),r.done!==!0;)if(a=r.value,t(a.key,a.attributes))return a.key}mapNodes(t){if(typeof t!="function")throw new Le("Graph.mapNode: expecting a callback.");const n=this._nodes.values();let r,a;const i=new Array(this.order);let l=0;for(;r=n.next(),r.done!==!0;)a=r.value,i[l++]=t(a.key,a.attributes);return i}someNode(t){if(typeof t!="function")throw new Le("Graph.someNode: expecting a callback.");const n=this._nodes.values();let r,a;for(;r=n.next(),r.done!==!0;)if(a=r.value,t(a.key,a.attributes))return!0;return!1}everyNode(t){if(typeof t!="function")throw new Le("Graph.everyNode: expecting a callback.");const n=this._nodes.values();let r,a;for(;r=n.next(),r.done!==!0;)if(a=r.value,!t(a.key,a.attributes))return!1;return!0}filterNodes(t){if(typeof t!="function")throw new Le("Graph.filterNodes: expecting a callback.");const n=this._nodes.values();let r,a;const i=[];for(;r=n.next(),r.done!==!0;)a=r.value,t(a.key,a.attributes)&&i.push(a.key);return i}reduceNodes(t,n){if(typeof t!="function")throw new Le("Graph.reduceNodes: expecting a callback.");if(arguments.length<2)throw new Le("Graph.reduceNodes: missing initial value. You must provide it because the callback takes more than one argument and we cannot infer the initial value from the first iteration, as you could with a simple array.");let r=n;const a=this._nodes.values();let i,l;for(;i=a.next(),i.done!==!0;)l=i.value,r=t(r,l.key,l.attributes);return r}nodeEntries(){const t=this._nodes.values();return{[Symbol.iterator](){return this},next(){const n=t.next();if(n.done)return n;const r=n.value;return{value:{node:r.key,attributes:r.attributes},done:!1}}}}export(){const t=new Array(this._nodes.size);let n=0;this._nodes.forEach((a,i)=>{t[n++]=IK(i,a)});const r=new Array(this._edges.size);return n=0,this._edges.forEach((a,i)=>{r[n++]=LK(this.type,i,a)}),{options:{type:this.type,multi:this.multi,allowSelfLoops:this.allowSelfLoops},attributes:this.getAttributes(),nodes:t,edges:r}}import(t,n=!1){if(t instanceof Tt)return t.forEachNode((c,f)=>{n?this.mergeNode(c,f):this.addNode(c,f)}),t.forEachEdge((c,f,p,g,b,m,S)=>{n?S?this.mergeUndirectedEdgeWithKey(c,p,g,f):this.mergeDirectedEdgeWithKey(c,p,g,f):S?this.addUndirectedEdgeWithKey(c,p,g,f):this.addDirectedEdgeWithKey(c,p,g,f)}),this;if(!gn(t))throw new Le("Graph.import: invalid argument. Expecting a serialized graph or, alternatively, a Graph instance.");if(t.attributes){if(!gn(t.attributes))throw new Le("Graph.import: invalid attributes. Expecting a plain object.");n?this.mergeAttributes(t.attributes):this.replaceAttributes(t.attributes)}let r,a,i,l,u;if(t.nodes){if(i=t.nodes,!Array.isArray(i))throw new Le("Graph.import: invalid nodes. Expecting an array.");for(r=0,a=i.length;r{const i=Qt({},r.attributes);r=new n.NodeDataClass(a,i),n._nodes.set(a,r)}),n}copy(t){if(t=t||{},typeof t.type=="string"&&t.type!==this.type&&t.type!=="mixed")throw new Ze(`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 Ze("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 Ze("Graph.copy: cannot create an incompatible copy from a graph allowing self loops to one that does not because this would mean losing information about the current graph.");const n=this.emptyCopy(t),r=this._edges.values();let a,i;for(;a=r.next(),a.done!==!0;)i=a.value,DU(n,"copy",!1,i.undirected,i.key,i.source.key,i.target.key,Qt({},i.attributes));return n}toJSON(){return this.export()}toString(){return"[object Graph]"}inspect(){const t={};this._nodes.forEach((i,l)=>{t[l]=i.attributes});const n={},r={};this._edges.forEach((i,l)=>{const u=i.undirected?"--":"->";let c="",f=i.source.key,p=i.target.key,g;i.undirected&&f>p&&(g=f,f=p,p=g);const b=`(${f})${u}(${p})`;l.startsWith("geid_")?this.multi&&(typeof r[b]>"u"?r[b]=0:r[b]++,c+=`${r[b]}. `):c+=`[${l}]: `,c+=b,n[c]=i.attributes});const a={};for(const i in this)this.hasOwnProperty(i)&&!KR.has(i)&&typeof this[i]!="function"&&typeof i!="symbol"&&(a[i]=this[i]);return a.attributes=this._attributes,a.nodes=t,a.edges=n,pr(a,"constructor",this.constructor),a}}typeof Symbol<"u"&&(Tt.prototype[Symbol.for("nodejs.util.inspect.custom")]=Tt.prototype.inspect);BK.forEach(e=>{["add","merge","update"].forEach(t=>{const n=e.name(t),r=t==="add"?DU:GK;e.generateKey?Tt.prototype[n]=function(a,i,l){return r(this,n,!0,(e.type||this.type)==="undirected",null,a,i,l,t==="update")}:Tt.prototype[n]=function(a,i,l,u){return r(this,n,!1,(e.type||this.type)==="undirected",a,i,l,u,t==="update")}})});ZY(Tt);sK(Tt);kK(Tt);DK(Tt);class tu extends Tt{constructor(t){const n=Qt({type:"directed"},t);if("multi"in n&&n.multi!==!1)throw new Le("DirectedGraph.from: inconsistent indication that the graph should be multi in given options!");if(n.type!=="directed")throw new Le('DirectedGraph.from: inconsistent "'+n.type+'" type in given options!');super(n)}}class IU extends Tt{constructor(t){const n=Qt({type:"undirected"},t);if("multi"in n&&n.multi!==!1)throw new Le("UndirectedGraph.from: inconsistent indication that the graph should be multi in given options!");if(n.type!=="undirected")throw new Le('UndirectedGraph.from: inconsistent "'+n.type+'" type in given options!');super(n)}}class LU extends Tt{constructor(t){const n=Qt({multi:!0},t);if("multi"in n&&n.multi!==!0)throw new Le("MultiGraph.from: inconsistent indication that the graph should be simple in given options!");super(n)}}class MU extends Tt{constructor(t){const n=Qt({type:"directed",multi:!0},t);if("multi"in n&&n.multi!==!0)throw new Le("MultiDirectedGraph.from: inconsistent indication that the graph should be simple in given options!");if(n.type!=="directed")throw new Le('MultiDirectedGraph.from: inconsistent "'+n.type+'" type in given options!');super(n)}}class FU extends Tt{constructor(t){const n=Qt({type:"undirected",multi:!0},t);if("multi"in n&&n.multi!==!0)throw new Le("MultiUndirectedGraph.from: inconsistent indication that the graph should be simple in given options!");if(n.type!=="undirected")throw new Le('MultiUndirectedGraph.from: inconsistent "'+n.type+'" type in given options!');super(n)}}function Dl(e){e.from=function(t,n){const r=Qt({},t.options,n),a=new e(r);return a.import(t),a}}Dl(Tt);Dl(tu);Dl(IU);Dl(LU);Dl(MU);Dl(FU);Tt.Graph=Tt;Tt.DirectedGraph=tu;Tt.UndirectedGraph=IU;Tt.MultiGraph=LU;Tt.MultiDirectedGraph=MU;Tt.MultiUndirectedGraph=FU;Tt.InvalidArgumentsGraphError=Le;Tt.NotFoundGraphError=De;Tt.UsageGraphError=Ze;function HK(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function Ws(e){var t=HK(e,"string");return typeof t=="symbol"?t:t+""}function on(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ZR(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,r=Array(t);n>8&255,i=n>>16&255,l=n>>24&255;return[r,a,i,l]}var Th={};function GU(e){if(typeof Th[e]<"u")return Th[e];var t=(e&16711680)>>>16,n=(e&65280)>>>8,r=e&255,a=255,i=jU(t,n,r,a);return Th[e]=i,i}function QR(e,t,n,r){return n+(t<<8)+(e<<16)}function JR(e,t,n,r,a,i){var l=Math.floor(n/i*a),u=Math.floor(e.drawingBufferHeight/i-r/i*a),c=new Uint8Array(4);e.bindFramebuffer(e.FRAMEBUFFER,t),e.readPixels(l,u,1,1,e.RGBA,e.UNSIGNED_BYTE,c);var f=vl(c,4),p=f[0],g=f[1],b=f[2],m=f[3];return[p,g,b,m]}function _e(e,t,n){return(t=Ws(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function eC(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function Be(e){for(var t=1;tC){var T="…";for(f=f+T,N=e.measureText(f).width;N>C&&f.length>1;)f=f.slice(0,-2)+T,N=e.measureText(f).width;if(f.length<4)return}var O;x>0?_>0?O=Math.acos(x/C):O=Math.asin(_/C):_>0?O=Math.acos(x/C)+Math.PI:O=Math.asin(x/C)+Math.PI/2,e.save(),e.translate(A,R),e.rotate(O),e.fillText(f,-N/2,t.size/2+i),e.restore()}}}function WU(e,t,n){if(t.label){var r=n.labelSize,a=n.labelFont,i=n.labelWeight,l=n.labelColor.attribute?t[n.labelColor.attribute]||n.labelColor.color||"#000":n.labelColor.color;e.fillStyle=l,e.font="".concat(i," ").concat(r,"px ").concat(a),e.fillText(t.label,t.x+t.size+3,t.y+r/3)}}function iX(e,t,n){var r=n.labelSize,a=n.labelFont,i=n.labelWeight;e.font="".concat(i," ").concat(r,"px ").concat(a),e.fillStyle="#FFF",e.shadowOffsetX=0,e.shadowOffsetY=0,e.shadowBlur=8,e.shadowColor="#000";var l=2;if(typeof t.label=="string"){var u=e.measureText(t.label).width,c=Math.round(u+5),f=Math.round(r+2*l),p=Math.max(t.size,r/2)+l,g=Math.asin(f/2/p),b=Math.sqrt(Math.abs(Math.pow(p,2)-Math.pow(f/2,2)));e.beginPath(),e.moveTo(t.x+b,t.y+f/2),e.lineTo(t.x+p+c,t.y+f/2),e.lineTo(t.x+p+c,t.y-f/2),e.lineTo(t.x+b,t.y-f/2),e.arc(t.x,t.y,p,g,-g),e.closePath(),e.fill()}else e.beginPath(),e.arc(t.x,t.y,t.size+l,0,Math.PI*2),e.closePath(),e.fill();e.shadowOffsetX=0,e.shadowOffsetY=0,e.shadowBlur=0,WU(e,t,n)}var lX=` +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 +} +`,sX=lX,uX=` +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; +} +`,cX=uX,YU=WebGLRenderingContext,aC=YU.UNSIGNED_BYTE,Rh=YU.FLOAT,dX=["u_sizeRatio","u_correctionRatio","u_matrix"],vu=function(e){function t(){return on(this,t),Bn(this,t,arguments)}return Un(t,e),ln(t,[{key:"getDefinition",value:function(){return{VERTICES:3,VERTEX_SHADER_SOURCE:cX,FRAGMENT_SHADER_SOURCE:sX,METHOD:WebGLRenderingContext.TRIANGLES,UNIFORMS:dX,ATTRIBUTES:[{name:"a_position",size:2,type:Rh},{name:"a_size",size:1,type:Rh},{name:"a_color",size:4,type:aC,normalized:!0},{name:"a_id",size:4,type:aC,normalized:!0}],CONSTANT_ATTRIBUTES:[{name:"a_angle",size:1,type:Rh}],CONSTANT_DATA:[[t.ANGLE_1],[t.ANGLE_2],[t.ANGLE_3]]}}},{key:"processVisibleItem",value:function(r,a,i){var l=this.array,u=Qr(i.color);l[a++]=i.x,l[a++]=i.y,l[a++]=i.size,l[a++]=u,l[a++]=r}},{key:"setUniforms",value:function(r,a){var i=a.gl,l=a.uniformLocations,u=l.u_sizeRatio,c=l.u_correctionRatio,f=l.u_matrix;i.uniform1f(c,r.correctionRatio),i.uniform1f(u,r.sizeRatio),i.uniformMatrix3fv(f,!1,r.matrix)}}])}(p0);_e(vu,"ANGLE_1",0);_e(vu,"ANGLE_2",2*Math.PI/3);_e(vu,"ANGLE_3",4*Math.PI/3);var fX=` +precision mediump float; + +varying vec4 v_color; + +void main(void) { + gl_FragColor = v_color; +} +`,pX=fX,gX=` +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; +} +`,hX=gX,KU=WebGLRenderingContext,oC=KU.UNSIGNED_BYTE,Yc=KU.FLOAT,mX=["u_matrix","u_sizeRatio","u_correctionRatio","u_minEdgeThickness","u_lengthToThicknessRatio","u_widenessToThicknessRatio"],Su={extremity:"target",lengthToThicknessRatio:2.5,widenessToThicknessRatio:2};function Pd(e){var t=Be(Be({},Su),e||{});return function(n){function r(){return on(this,r),Bn(this,r,arguments)}return Un(r,n),ln(r,[{key:"getDefinition",value:function(){return{VERTICES:3,VERTEX_SHADER_SOURCE:hX,FRAGMENT_SHADER_SOURCE:pX,METHOD:WebGLRenderingContext.TRIANGLES,UNIFORMS:mX,ATTRIBUTES:[{name:"a_position",size:2,type:Yc},{name:"a_normal",size:2,type:Yc},{name:"a_radius",size:1,type:Yc},{name:"a_color",size:4,type:oC,normalized:!0},{name:"a_id",size:4,type:oC,normalized:!0}],CONSTANT_ATTRIBUTES:[{name:"a_barycentric",size:3,type:Yc}],CONSTANT_DATA:[[1,0,0],[0,1,0],[0,0,1]]}}},{key:"processVisibleItem",value:function(i,l,u,c,f){if(t.extremity==="source"){var p=[c,u];u=p[0],c=p[1]}var g=f.size||1,b=c.size||1,m=u.x,S=u.y,v=c.x,A=c.y,R=Qr(f.color),x=v-m,_=A-S,C=x*x+_*_,N=0,T=0;C&&(C=1/Math.sqrt(C),N=-_*C*g,T=x*C*g);var O=this.array;O[l++]=v,O[l++]=A,O[l++]=-N,O[l++]=-T,O[l++]=b,O[l++]=R,O[l++]=i}},{key:"setUniforms",value:function(i,l){var u=l.gl,c=l.uniformLocations,f=c.u_matrix,p=c.u_sizeRatio,g=c.u_correctionRatio,b=c.u_minEdgeThickness,m=c.u_lengthToThicknessRatio,S=c.u_widenessToThicknessRatio;u.uniformMatrix3fv(f,!1,i.matrix),u.uniform1f(p,i.sizeRatio),u.uniform1f(g,i.correctionRatio),u.uniform1f(b,i.minEdgeThickness),u.uniform1f(m,t.lengthToThicknessRatio),u.uniform1f(S,t.widenessToThicknessRatio)}}])}(yu)}Pd();var bX=` +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 +} +`,g0=bX,yX=` +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; +} +`,vX=yX,XU=WebGLRenderingContext,iC=XU.UNSIGNED_BYTE,Ko=XU.FLOAT,SX=["u_matrix","u_zoomRatio","u_sizeRatio","u_correctionRatio","u_pixelRatio","u_feather","u_minEdgeThickness","u_lengthToThicknessRatio"],EX={lengthToThicknessRatio:Su.lengthToThicknessRatio};function ZU(e){var t=Be(Be({},EX),{});return function(n){function r(){return on(this,r),Bn(this,r,arguments)}return Un(r,n),ln(r,[{key:"getDefinition",value:function(){return{VERTICES:6,VERTEX_SHADER_SOURCE:vX,FRAGMENT_SHADER_SOURCE:g0,METHOD:WebGLRenderingContext.TRIANGLES,UNIFORMS:SX,ATTRIBUTES:[{name:"a_positionStart",size:2,type:Ko},{name:"a_positionEnd",size:2,type:Ko},{name:"a_normal",size:2,type:Ko},{name:"a_color",size:4,type:iC,normalized:!0},{name:"a_id",size:4,type:iC,normalized:!0},{name:"a_radius",size:1,type:Ko}],CONSTANT_ATTRIBUTES:[{name:"a_positionCoef",size:1,type:Ko},{name:"a_normalCoef",size:1,type:Ko},{name:"a_radiusCoef",size:1,type:Ko}],CONSTANT_DATA:[[0,1,0],[0,-1,0],[1,1,1],[1,1,1],[0,-1,0],[1,-1,-1]]}}},{key:"processVisibleItem",value:function(i,l,u,c,f){var p=f.size||1,g=u.x,b=u.y,m=c.x,S=c.y,v=Qr(f.color),A=m-g,R=S-b,x=c.size||1,_=A*A+R*R,C=0,N=0;_&&(_=1/Math.sqrt(_),C=-R*_*p,N=A*_*p);var T=this.array;T[l++]=g,T[l++]=b,T[l++]=m,T[l++]=S,T[l++]=C,T[l++]=N,T[l++]=v,T[l++]=i,T[l++]=x}},{key:"setUniforms",value:function(i,l){var u=l.gl,c=l.uniformLocations,f=c.u_matrix,p=c.u_zoomRatio,g=c.u_feather,b=c.u_pixelRatio,m=c.u_correctionRatio,S=c.u_sizeRatio,v=c.u_minEdgeThickness,A=c.u_lengthToThicknessRatio;u.uniformMatrix3fv(f,!1,i.matrix),u.uniform1f(p,i.zoomRatio),u.uniform1f(S,i.sizeRatio),u.uniform1f(m,i.correctionRatio),u.uniform1f(b,i.pixelRatio),u.uniform1f(g,i.antiAliasingFeather),u.uniform1f(v,i.minEdgeThickness),u.uniform1f(A,t.lengthToThicknessRatio)}}])}(yu)}ZU();function wX(e){return VU([ZU(),Pd(e)])}var xX=wX(),QU=xX,kX=` +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; +} +`,AX=kX,JU=WebGLRenderingContext,lC=JU.UNSIGNED_BYTE,zs=JU.FLOAT,TX=["u_matrix","u_zoomRatio","u_sizeRatio","u_correctionRatio","u_pixelRatio","u_feather","u_minEdgeThickness"],_X=function(e){function t(){return on(this,t),Bn(this,t,arguments)}return Un(t,e),ln(t,[{key:"getDefinition",value:function(){return{VERTICES:6,VERTEX_SHADER_SOURCE:AX,FRAGMENT_SHADER_SOURCE:g0,METHOD:WebGLRenderingContext.TRIANGLES,UNIFORMS:TX,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:lC,normalized:!0},{name:"a_id",size:4,type:lC,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(r,a,i,l,u){var c=u.size||1,f=i.x,p=i.y,g=l.x,b=l.y,m=Qr(u.color),S=g-f,v=b-p,A=S*S+v*v,R=0,x=0;A&&(A=1/Math.sqrt(A),R=-v*A*c,x=S*A*c);var _=this.array;_[a++]=f,_[a++]=p,_[a++]=g,_[a++]=b,_[a++]=R,_[a++]=x,_[a++]=m,_[a++]=r}},{key:"setUniforms",value:function(r,a){var i=a.gl,l=a.uniformLocations,u=l.u_matrix,c=l.u_zoomRatio,f=l.u_feather,p=l.u_pixelRatio,g=l.u_correctionRatio,b=l.u_sizeRatio,m=l.u_minEdgeThickness;i.uniformMatrix3fv(u,!1,r.matrix),i.uniform1f(c,r.zoomRatio),i.uniform1f(b,r.sizeRatio),i.uniform1f(g,r.correctionRatio),i.uniform1f(p,r.pixelRatio),i.uniform1f(f,r.antiAliasingFeather),i.uniform1f(m,r.minEdgeThickness)}}])}(yu),h0=function(e){function t(){var n;return on(this,t),n=Bn(this,t),n.rawEmitter=n,n}return Un(t,e),ln(t)}(xU.EventEmitter),Ch,sC;function Jr(){return sC||(sC=1,Ch=function(t){return t!==null&&typeof t=="object"&&typeof t.addUndirectedEdgeWithKey=="function"&&typeof t.dropNode=="function"&&typeof t.multi=="boolean"}),Ch}var RX=Jr();const CX=an(RX);var NX=function(t){return t},OX=function(t){return t*t},DX=function(t){return t*(2-t)},IX=function(t){return(t*=2)<1?.5*t*t:-.5*(--t*(t-2)-1)},LX=function(t){return t*t*t},MX=function(t){return--t*t*t+1},FX=function(t){return(t*=2)<1?.5*t*t*t:.5*((t-=2)*t*t+2)},e3={linear:NX,quadraticIn:OX,quadraticOut:DX,quadraticInOut:IX,cubicIn:LX,cubicOut:MX,cubicInOut:FX},t3={easing:"quadraticInOut",duration:150};function zX(e,t,n,r){var a=Object.assign({},t3,n),i=typeof a.easing=="function"?a.easing:e3[a.easing],l=Date.now(),u={};for(var c in t){var f=t[c];u[c]={};for(var p in f)u[c][p]=e.getNodeAttribute(c,p)}var g=null,b=function(){g=null;var S=(Date.now()-l)/a.duration;if(S>=1){for(var v in t){var A=t[v];for(var R in A)e.setNodeAttribute(v,R,A[R])}return}S=i(S);for(var x in t){var _=t[x],C=u[x];for(var N in _)e.setNodeAttribute(x,N,_[N]*S+C[N]*(1-S))}g=requestAnimationFrame(b)};return b(),function(){g&&cancelAnimationFrame(g)}}function _r(){return Float32Array.of(1,0,0,0,1,0,0,0,1)}function Kc(e,t,n){return e[0]=t,e[4]=typeof n=="number"?n:t,e}function uC(e,t){var n=Math.sin(t),r=Math.cos(t);return e[0]=r,e[1]=n,e[3]=-n,e[4]=r,e}function cC(e,t,n){return e[6]=t,e[7]=n,e}function io(e,t){var n=e[0],r=e[1],a=e[2],i=e[3],l=e[4],u=e[5],c=e[6],f=e[7],p=e[8],g=t[0],b=t[1],m=t[2],S=t[3],v=t[4],A=t[5],R=t[6],x=t[7],_=t[8];return e[0]=g*n+b*i+m*c,e[1]=g*r+b*l+m*f,e[2]=g*a+b*u+m*p,e[3]=S*n+v*i+A*c,e[4]=S*r+v*l+A*f,e[5]=S*a+v*u+A*p,e[6]=R*n+x*i+_*c,e[7]=R*r+x*l+_*f,e[8]=R*a+x*u+_*p,e}function Mx(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,r=e[0],a=e[1],i=e[3],l=e[4],u=e[6],c=e[7],f=t.x,p=t.y;return{x:f*r+p*i+u*n,y:f*a+p*l+c*n}}function PX(e,t){var n=e.height/e.width,r=t.height/t.width;return n<1&&r>1||n>1&&r<1?1:Math.min(Math.max(r,1/r),Math.max(1/n,n))}function Ps(e,t,n,r,a){var i=e.angle,l=e.ratio,u=e.x,c=e.y,f=t.width,p=t.height,g=_r(),b=Math.min(f,p)-2*r,m=PX(t,n);return a?(io(g,cC(_r(),u,c)),io(g,Kc(_r(),l)),io(g,uC(_r(),i)),io(g,Kc(_r(),f/b/2/m,p/b/2/m))):(io(g,Kc(_r(),2*(b/f)*m,2*(b/p)*m)),io(g,uC(_r(),-i)),io(g,Kc(_r(),1/l)),io(g,cC(_r(),-u,-c))),g}function BX(e,t,n){var r=Mx(e,{x:Math.cos(t.angle),y:Math.sin(t.angle)},0),a=r.x,i=r.y;return 1/Math.sqrt(Math.pow(a,2)+Math.pow(i,2))/n.width}function UX(e){if(!e.order)return{x:[0,1],y:[0,1]};var t=1/0,n=-1/0,r=1/0,a=-1/0;return e.forEachNode(function(i,l){var u=l.x,c=l.y;un&&(n=u),ca&&(a=c)}),{x:[t,n],y:[r,a]}}function jX(e){if(!CX(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 GX(e,t,n){var r=document.createElement(e);if(t)for(var a in t)r.style[a]=t[a];if(n)for(var i in n)r.setAttribute(i,n[i]);return r}function dC(){return typeof window.devicePixelRatio<"u"?window.devicePixelRatio:1}function fC(e,t,n){return n.sort(function(r,a){var i=t(r)||0,l=t(a)||0;return il?1:0})}function pC(e){var t=vl(e.x,2),n=t[0],r=t[1],a=vl(e.y,2),i=a[0],l=a[1],u=Math.max(r-n,l-i),c=(r+n)/2,f=(l+i)/2;(u===0||Math.abs(u)===1/0||isNaN(u))&&(u=1),isNaN(c)&&(c=0),isNaN(f)&&(f=0);var p=function(b){return{x:.5+(b.x-c)/u,y:.5+(b.y-f)/u}};return p.applyTo=function(g){g.x=.5+(g.x-c)/u,g.y=.5+(g.y-f)/u},p.inverse=function(g){return{x:c+u*(g.x-.5),y:f+u*(g.y-.5)}},p.ratio=u,p}function Fx(e){"@babel/helpers - typeof";return Fx=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},Fx(e)}function gC(e,t){var n=t.size;if(n!==0){var r=e.length;e.length+=n;var a=0;t.forEach(function(i){e[r+a]=i,a++})}}function Nh(e){e=e||{};for(var t=0,n=arguments.length<=1?0:arguments.length-1;t1&&arguments[1]!==void 0?arguments[1]:{},l=arguments.length>2?arguments[2]:void 0;if(!l)return new Promise(function(m){return a.animate(r,i,m)});if(this.enabled){var u=Be(Be({},t3),i),c=this.validateState(r),f=typeof u.easing=="function"?u.easing:e3[u.easing],p=Date.now(),g=this.getState(),b=function(){var S=(Date.now()-p)/u.duration;if(S>=1){a.nextFrame=null,a.setState(c),a.animationCallback&&(a.animationCallback.call(null),a.animationCallback=void 0);return}var v=f(S),A={};typeof c.x=="number"&&(A.x=g.x+(c.x-g.x)*v),typeof c.y=="number"&&(A.y=g.y+(c.y-g.y)*v),a.enabledRotation&&typeof c.angle=="number"&&(A.angle=g.angle+(c.angle-g.angle)*v),typeof c.ratio=="number"&&(A.ratio=g.ratio+(c.ratio-g.ratio)*v),a.setState(A),a.nextFrame=requestAnimationFrame(b)};this.nextFrame?(cancelAnimationFrame(this.nextFrame),this.animationCallback&&this.animationCallback.call(null),this.nextFrame=requestAnimationFrame(b)):b(),this.animationCallback=l}}},{key:"animatedZoom",value:function(r){return r?typeof r=="number"?this.animate({ratio:this.ratio/r}):this.animate({ratio:this.ratio/(r.factor||Xc)},r):this.animate({ratio:this.ratio/Xc})}},{key:"animatedUnzoom",value:function(r){return r?typeof r=="number"?this.animate({ratio:this.ratio*r}):this.animate({ratio:this.ratio*(r.factor||Xc)},r):this.animate({ratio:this.ratio*Xc})}},{key:"animatedReset",value:function(r){return this.animate({x:.5,y:.5,ratio:1,angle:0},r)}},{key:"copy",value:function(){return t.from(this.getState())}}],[{key:"from",value:function(r){var a=new t;return a.setState(r)}}])}(h0);function Cr(e,t){var n=t.getBoundingClientRect();return{x:e.clientX-n.left,y:e.clientY-n.top}}function Aa(e,t){var n=Be(Be({},Cr(e,t)),{},{sigmaDefaultPrevented:!1,preventSigmaDefault:function(){n.sigmaDefaultPrevented=!0},original:e});return n}function Bs(e){var t="x"in e?e:Be(Be({},e.touches[0]||e.previousTouches[0]),{},{original:e.original,sigmaDefaultPrevented:e.sigmaDefaultPrevented,preventSigmaDefault:function(){e.sigmaDefaultPrevented=!0,t.sigmaDefaultPrevented=!0}});return t}function VX(e,t){return Be(Be({},Aa(e,t)),{},{delta:n3(e)})}var WX=2;function vd(e){for(var t=[],n=0,r=Math.min(e.length,WX);n0;a.draggedEvents=0,g&&a.renderer.getSetting("hideEdgesOnMove")&&a.renderer.refresh()},0),this.emit("mouseup",Aa(r,this.container))}}},{key:"handleMove",value:function(r){var a=this;if(this.enabled){var i=Aa(r,this.container);if(this.emit("mousemovebody",i),(r.target===this.container||r.composedPath()[0]===this.container)&&this.emit("mousemove",i),!i.sigmaDefaultPrevented&&this.isMouseDown){this.isMoving=!0,this.draggedEvents++,typeof this.movingTimeout=="number"&&clearTimeout(this.movingTimeout),this.movingTimeout=window.setTimeout(function(){a.movingTimeout=null,a.isMoving=!1},this.settings.dragTimeout);var l=this.renderer.getCamera(),u=Cr(r,this.container),c=u.x,f=u.y,p=this.renderer.viewportToFramedGraph({x:this.lastMouseX,y:this.lastMouseY}),g=this.renderer.viewportToFramedGraph({x:c,y:f}),b=p.x-g.x,m=p.y-g.y,S=l.getState(),v=S.x+b,A=S.y+m;l.setState({x:v,y:A}),this.lastMouseX=c,this.lastMouseY=f,r.preventDefault(),r.stopPropagation()}}}},{key:"handleLeave",value:function(r){this.emit("mouseleave",Aa(r,this.container))}},{key:"handleEnter",value:function(r){this.emit("mouseenter",Aa(r,this.container))}},{key:"handleWheel",value:function(r){var a=this,i=this.renderer.getCamera();if(!(!this.enabled||!i.enabledZooming)){var l=n3(r);if(l){var u=VX(r,this.container);if(this.emit("wheel",u),u.sigmaDefaultPrevented){r.preventDefault(),r.stopPropagation();return}var c=i.getState().ratio,f=l>0?1/this.settings.zoomingRatio:this.settings.zoomingRatio,p=i.getBoundedRatio(c*f),g=l>0?1:-1,b=Date.now();c!==p&&(r.preventDefault(),r.stopPropagation(),!(this.currentWheelDirection===g&&this.lastWheelTriggerTime&&b-this.lastWheelTriggerTimer.size?-1:n.sizer.key?1:-1}}])}(),yC=function(){function e(){on(this,e),_e(this,"width",0),_e(this,"height",0),_e(this,"cellSize",0),_e(this,"columns",0),_e(this,"rows",0),_e(this,"cells",{})}return ln(e,[{key:"resizeAndClear",value:function(n,r){this.width=n.width,this.height=n.height,this.cellSize=r,this.columns=Math.ceil(n.width/r),this.rows=Math.ceil(n.height/r),this.cells={}}},{key:"getIndex",value:function(n){var r=Math.floor(n.x/this.cellSize),a=Math.floor(n.y/this.cellSize);return a*this.columns+r}},{key:"add",value:function(n,r,a){var i=new bC(n,r),l=this.getIndex(a),u=this.cells[l];u||(u=[],this.cells[l]=u),u.push(i)}},{key:"organize",value:function(){for(var n in this.cells){var r=this.cells[n];r.sort(bC.compare)}}},{key:"getLabelsToDisplay",value:function(n,r){var a=this.cellSize*this.cellSize,i=a/n/n,l=i*r/a,u=Math.ceil(l),c=[];for(var f in this.cells)for(var p=this.cells[f],g=0;g2&&arguments[2]!==void 0?arguments[2]:{};if(on(this,t),a=Bn(this,t),_e(a,"elements",{}),_e(a,"canvasContexts",{}),_e(a,"webGLContexts",{}),_e(a,"pickingLayers",new Set),_e(a,"textures",{}),_e(a,"frameBuffers",{}),_e(a,"activeListeners",{}),_e(a,"labelGrid",new yC),_e(a,"nodeDataCache",{}),_e(a,"edgeDataCache",{}),_e(a,"nodeProgramIndex",{}),_e(a,"edgeProgramIndex",{}),_e(a,"nodesWithForcedLabels",new Set),_e(a,"edgesWithForcedLabels",new Set),_e(a,"nodeExtent",{x:[0,1],y:[0,1]}),_e(a,"nodeZExtent",[1/0,-1/0]),_e(a,"edgeZExtent",[1/0,-1/0]),_e(a,"matrix",_r()),_e(a,"invMatrix",_r()),_e(a,"correctionRatio",1),_e(a,"customBBox",null),_e(a,"normalizationFunction",pC({x:[0,1],y:[0,1]})),_e(a,"graphToViewportRatio",1),_e(a,"itemIDsIndex",{}),_e(a,"nodeIndices",{}),_e(a,"edgeIndices",{}),_e(a,"width",0),_e(a,"height",0),_e(a,"pixelRatio",dC()),_e(a,"pickingDownSizingRatio",2*a.pixelRatio),_e(a,"displayedNodeLabels",new Set),_e(a,"displayedEdgeLabels",new Set),_e(a,"highlightedNodes",new Set),_e(a,"hoveredNode",null),_e(a,"hoveredEdge",null),_e(a,"renderFrame",null),_e(a,"renderHighlightedNodesFrame",null),_e(a,"needToProcess",!1),_e(a,"checkEdgesEventsFrame",null),_e(a,"nodePrograms",{}),_e(a,"nodeHoverPrograms",{}),_e(a,"edgePrograms",{}),a.settings=qX(i),Oh(a.settings),jX(n),!(r instanceof HTMLElement))throw new Error("Sigma: container should be an html element.");a.graph=n,a.container=r,a.createWebGLContext("edges",{picking:i.enableEdgeEvents}),a.createCanvasContext("edgeLabels"),a.createWebGLContext("nodes",{picking:!0}),a.createCanvasContext("labels"),a.createCanvasContext("hovers"),a.createWebGLContext("hoverNodes"),a.createCanvasContext("mouse",{style:{touchAction:"none",userSelect:"none"}}),a.resize();for(var l in a.settings.nodeProgramClasses)a.registerNodeProgram(l,a.settings.nodeProgramClasses[l],a.settings.nodeHoverProgramClasses[l]);for(var u in a.settings.edgeProgramClasses)a.registerEdgeProgram(u,a.settings.edgeProgramClasses[u]);return a.camera=new hC,a.bindCameraHandlers(),a.mouseCaptor=new XX(a.elements.mouse,a),a.mouseCaptor.setSettings(a.settings),a.touchCaptor=new JX(a.elements.mouse,a),a.touchCaptor.setSettings(a.settings),a.bindEventHandlers(),a.bindGraphHandlers(),a.handleSettingsUpdate(),a.refresh(),a}return Un(t,e),ln(t,[{key:"registerNodeProgram",value:function(r,a,i){return this.nodePrograms[r]&&this.nodePrograms[r].kill(),this.nodeHoverPrograms[r]&&this.nodeHoverPrograms[r].kill(),this.nodePrograms[r]=new a(this.webGLContexts.nodes,this.frameBuffers.nodes,this),this.nodeHoverPrograms[r]=new(i||a)(this.webGLContexts.hoverNodes,null,this),this}},{key:"registerEdgeProgram",value:function(r,a){return this.edgePrograms[r]&&this.edgePrograms[r].kill(),this.edgePrograms[r]=new a(this.webGLContexts.edges,this.frameBuffers.edges,this),this}},{key:"unregisterNodeProgram",value:function(r){if(this.nodePrograms[r]){var a=this.nodePrograms,i=a[r],l=Dh(a,[r].map(Ws));i.kill(),this.nodePrograms=l}if(this.nodeHoverPrograms[r]){var u=this.nodeHoverPrograms,c=u[r],f=Dh(u,[r].map(Ws));c.kill(),this.nodePrograms=f}return this}},{key:"unregisterEdgeProgram",value:function(r){if(this.edgePrograms[r]){var a=this.edgePrograms,i=a[r],l=Dh(a,[r].map(Ws));i.kill(),this.edgePrograms=l}return this}},{key:"resetWebGLTexture",value:function(r){var a=this.webGLContexts[r],i=this.frameBuffers[r],l=this.textures[r];l&&a.deleteTexture(l);var u=a.createTexture();return a.bindFramebuffer(a.FRAMEBUFFER,i),a.bindTexture(a.TEXTURE_2D,u),a.texImage2D(a.TEXTURE_2D,0,a.RGBA,this.width,this.height,0,a.RGBA,a.UNSIGNED_BYTE,null),a.framebufferTexture2D(a.FRAMEBUFFER,a.COLOR_ATTACHMENT0,a.TEXTURE_2D,u,0),this.textures[r]=u,this}},{key:"bindCameraHandlers",value:function(){var r=this;return this.activeListeners.camera=function(){r.scheduleRender()},this.camera.on("updated",this.activeListeners.camera),this}},{key:"unbindCameraHandlers",value:function(){return this.camera.removeListener("updated",this.activeListeners.camera),this}},{key:"getNodeAtPosition",value:function(r){var a=r.x,i=r.y,l=JR(this.webGLContexts.nodes,this.frameBuffers.nodes,a,i,this.pixelRatio,this.pickingDownSizingRatio),u=QR.apply(void 0,mC(l)),c=this.itemIDsIndex[u];return c&&c.type==="node"?c.id:null}},{key:"bindEventHandlers",value:function(){var r=this;this.activeListeners.handleResize=function(){r.scheduleRefresh()},window.addEventListener("resize",this.activeListeners.handleResize),this.activeListeners.handleMove=function(i){var l=Bs(i),u={event:l,preventSigmaDefault:function(){l.preventSigmaDefault()}},c=r.getNodeAtPosition(l);if(c&&r.hoveredNode!==c&&!r.nodeDataCache[c].hidden){r.hoveredNode&&r.emit("leaveNode",Be(Be({},u),{},{node:r.hoveredNode})),r.hoveredNode=c,r.emit("enterNode",Be(Be({},u),{},{node:c})),r.scheduleHighlightedNodesRender();return}if(r.hoveredNode&&r.getNodeAtPosition(l)!==r.hoveredNode){var f=r.hoveredNode;r.hoveredNode=null,r.emit("leaveNode",Be(Be({},u),{},{node:f})),r.scheduleHighlightedNodesRender();return}if(r.settings.enableEdgeEvents){var p=r.hoveredNode?null:r.getEdgeAtPoint(u.event.x,u.event.y);p!==r.hoveredEdge&&(r.hoveredEdge&&r.emit("leaveEdge",Be(Be({},u),{},{edge:r.hoveredEdge})),p&&r.emit("enterEdge",Be(Be({},u),{},{edge:p})),r.hoveredEdge=p)}},this.activeListeners.handleMoveBody=function(i){var l=Bs(i);r.emit("moveBody",{event:l,preventSigmaDefault:function(){l.preventSigmaDefault()}})},this.activeListeners.handleLeave=function(i){var l=Bs(i),u={event:l,preventSigmaDefault:function(){l.preventSigmaDefault()}};r.hoveredNode&&(r.emit("leaveNode",Be(Be({},u),{},{node:r.hoveredNode})),r.scheduleHighlightedNodesRender()),r.settings.enableEdgeEvents&&r.hoveredEdge&&(r.emit("leaveEdge",Be(Be({},u),{},{edge:r.hoveredEdge})),r.scheduleHighlightedNodesRender()),r.emit("leaveStage",Be({},u))},this.activeListeners.handleEnter=function(i){var l=Bs(i),u={event:l,preventSigmaDefault:function(){l.preventSigmaDefault()}};r.emit("enterStage",Be({},u))};var a=function(l){return function(u){var c=Bs(u),f={event:c,preventSigmaDefault:function(){c.preventSigmaDefault()}},p=r.getNodeAtPosition(c);if(p)return r.emit("".concat(l,"Node"),Be(Be({},f),{},{node:p}));if(r.settings.enableEdgeEvents){var g=r.getEdgeAtPoint(c.x,c.y);if(g)return r.emit("".concat(l,"Edge"),Be(Be({},f),{},{edge:g}))}return r.emit("".concat(l,"Stage"),f)}};return this.activeListeners.handleClick=a("click"),this.activeListeners.handleRightClick=a("rightClick"),this.activeListeners.handleDoubleClick=a("doubleClick"),this.activeListeners.handleWheel=a("wheel"),this.activeListeners.handleDown=a("down"),this.activeListeners.handleUp=a("up"),this.mouseCaptor.on("mousemove",this.activeListeners.handleMove),this.mouseCaptor.on("mousemovebody",this.activeListeners.handleMoveBody),this.mouseCaptor.on("click",this.activeListeners.handleClick),this.mouseCaptor.on("rightClick",this.activeListeners.handleRightClick),this.mouseCaptor.on("doubleClick",this.activeListeners.handleDoubleClick),this.mouseCaptor.on("wheel",this.activeListeners.handleWheel),this.mouseCaptor.on("mousedown",this.activeListeners.handleDown),this.mouseCaptor.on("mouseup",this.activeListeners.handleUp),this.mouseCaptor.on("mouseleave",this.activeListeners.handleLeave),this.mouseCaptor.on("mouseenter",this.activeListeners.handleEnter),this.touchCaptor.on("touchdown",this.activeListeners.handleDown),this.touchCaptor.on("touchdown",this.activeListeners.handleMove),this.touchCaptor.on("touchup",this.activeListeners.handleUp),this.touchCaptor.on("touchmove",this.activeListeners.handleMove),this.touchCaptor.on("tap",this.activeListeners.handleClick),this.touchCaptor.on("doubletap",this.activeListeners.handleDoubleClick),this.touchCaptor.on("touchmove",this.activeListeners.handleMoveBody),this}},{key:"bindGraphHandlers",value:function(){var r=this,a=this.graph,i=new Set(["x","y","zIndex","type"]);return this.activeListeners.eachNodeAttributesUpdatedGraphUpdate=function(l){var u,c=(u=l.hints)===null||u===void 0?void 0:u.attributes;r.graph.forEachNode(function(p){return r.updateNode(p)});var f=!c||c.some(function(p){return i.has(p)});r.refresh({partialGraph:{nodes:a.nodes()},skipIndexation:!f,schedule:!0})},this.activeListeners.eachEdgeAttributesUpdatedGraphUpdate=function(l){var u,c=(u=l.hints)===null||u===void 0?void 0:u.attributes;r.graph.forEachEdge(function(p){return r.updateEdge(p)});var f=c&&["zIndex","type"].some(function(p){return c==null?void 0:c.includes(p)});r.refresh({partialGraph:{edges:a.edges()},skipIndexation:!f,schedule:!0})},this.activeListeners.addNodeGraphUpdate=function(l){var u=l.key;r.addNode(u),r.refresh({partialGraph:{nodes:[u]},skipIndexation:!1,schedule:!0})},this.activeListeners.updateNodeGraphUpdate=function(l){var u=l.key;r.refresh({partialGraph:{nodes:[u]},skipIndexation:!1,schedule:!0})},this.activeListeners.dropNodeGraphUpdate=function(l){var u=l.key;r.removeNode(u),r.refresh({schedule:!0})},this.activeListeners.addEdgeGraphUpdate=function(l){var u=l.key;r.addEdge(u),r.refresh({partialGraph:{edges:[u]},schedule:!0})},this.activeListeners.updateEdgeGraphUpdate=function(l){var u=l.key;r.refresh({partialGraph:{edges:[u]},skipIndexation:!1,schedule:!0})},this.activeListeners.dropEdgeGraphUpdate=function(l){var u=l.key;r.removeEdge(u),r.refresh({schedule:!0})},this.activeListeners.clearEdgesGraphUpdate=function(){r.clearEdgeState(),r.clearEdgeIndices(),r.refresh({schedule:!0})},this.activeListeners.clearGraphUpdate=function(){r.clearEdgeState(),r.clearNodeState(),r.clearEdgeIndices(),r.clearNodeIndices(),r.refresh({schedule:!0})},a.on("nodeAdded",this.activeListeners.addNodeGraphUpdate),a.on("nodeDropped",this.activeListeners.dropNodeGraphUpdate),a.on("nodeAttributesUpdated",this.activeListeners.updateNodeGraphUpdate),a.on("eachNodeAttributesUpdated",this.activeListeners.eachNodeAttributesUpdatedGraphUpdate),a.on("edgeAdded",this.activeListeners.addEdgeGraphUpdate),a.on("edgeDropped",this.activeListeners.dropEdgeGraphUpdate),a.on("edgeAttributesUpdated",this.activeListeners.updateEdgeGraphUpdate),a.on("eachEdgeAttributesUpdated",this.activeListeners.eachEdgeAttributesUpdatedGraphUpdate),a.on("edgesCleared",this.activeListeners.clearEdgesGraphUpdate),a.on("cleared",this.activeListeners.clearGraphUpdate),this}},{key:"unbindGraphHandlers",value:function(){var r=this.graph;r.removeListener("nodeAdded",this.activeListeners.addNodeGraphUpdate),r.removeListener("nodeDropped",this.activeListeners.dropNodeGraphUpdate),r.removeListener("nodeAttributesUpdated",this.activeListeners.updateNodeGraphUpdate),r.removeListener("eachNodeAttributesUpdated",this.activeListeners.eachNodeAttributesUpdatedGraphUpdate),r.removeListener("edgeAdded",this.activeListeners.addEdgeGraphUpdate),r.removeListener("edgeDropped",this.activeListeners.dropEdgeGraphUpdate),r.removeListener("edgeAttributesUpdated",this.activeListeners.updateEdgeGraphUpdate),r.removeListener("eachEdgeAttributesUpdated",this.activeListeners.eachEdgeAttributesUpdatedGraphUpdate),r.removeListener("edgesCleared",this.activeListeners.clearEdgesGraphUpdate),r.removeListener("cleared",this.activeListeners.clearGraphUpdate)}},{key:"getEdgeAtPoint",value:function(r,a){var i=JR(this.webGLContexts.edges,this.frameBuffers.edges,r,a,this.pixelRatio,this.pickingDownSizingRatio),l=QR.apply(void 0,mC(i)),u=this.itemIDsIndex[l];return u&&u.type==="edge"?u.id:null}},{key:"process",value:function(){var r=this;this.emit("beforeProcess");var a=this.graph,i=this.settings,l=this.getDimensions();if(this.nodeExtent=UX(this.graph),!this.settings.autoRescale){var u=l.width,c=l.height,f=this.nodeExtent,p=f.x,g=f.y;this.nodeExtent={x:[(p[0]+p[1])/2-u/2,(p[0]+p[1])/2+u/2],y:[(g[0]+g[1])/2-c/2,(g[0]+g[1])/2+c/2]}}this.normalizationFunction=pC(this.customBBox||this.nodeExtent);var b=new hC,m=Ps(b.getState(),l,this.getGraphDimensions(),this.getStagePadding());this.labelGrid.resizeAndClear(l,i.labelGridCellSize);for(var S={},v={},A={},R={},x=1,_=a.nodes(),C=0,N=_.length;C1&&arguments[1]!==void 0?arguments[1]:{},i=a.tolerance,l=i===void 0?0:i,u=a.boundaries,c=Be({},r),f=u||this.nodeExtent,p=vl(f.x,2),g=p[0],b=p[1],m=vl(f.y,2),S=m[0],v=m[1],A=[this.graphToViewport({x:g,y:S},{cameraState:r}),this.graphToViewport({x:b,y:S},{cameraState:r}),this.graphToViewport({x:g,y:v},{cameraState:r}),this.graphToViewport({x:b,y:v},{cameraState:r})],R=1/0,x=-1/0,_=1/0,C=-1/0;A.forEach(function(W){var Z=W.x,j=W.y;R=Math.min(R,Z),x=Math.max(x,Z),_=Math.min(_,j),C=Math.max(C,j)});var N=x-R,T=C-_,O=this.getDimensions(),z=O.width,I=O.height,M=0,H=0;if(N>=z?xl&&(M=R-l):x>z+l?M=x-(z+l):R<-l&&(M=R+l),T>=I?Cl&&(H=_-l):C>I+l?H=C-(I+l):_<-l&&(H=_+l),M||H){var q=this.viewportToFramedGraph({x:0,y:0},{cameraState:r}),U=this.viewportToFramedGraph({x:M,y:H},{cameraState:r});M=U.x-q.x,H=U.y-q.y,c.x+=M,c.y+=H}return c}},{key:"renderLabels",value:function(){if(!this.settings.renderLabels)return this;var r=this.camera.getState(),a=this.labelGrid.getLabelsToDisplay(r.ratio,this.settings.labelDensity);gC(a,this.nodesWithForcedLabels),this.displayedNodeLabels=new Set;for(var i=this.canvasContexts.labels,l=0,u=a.length;lthis.width+oZ||b<-50||b>this.height+iZ)){this.displayedNodeLabels.add(c);var S=this.settings.defaultDrawNodeLabel,v=this.nodePrograms[f.type],A=(v==null?void 0:v.drawLabel)||S;A(i,Be(Be({key:c},f),{},{size:m,x:g,y:b}),this.settings)}}}return this}},{key:"renderEdgeLabels",value:function(){if(!this.settings.renderEdgeLabels)return this;var r=this.canvasContexts.edgeLabels;r.clearRect(0,0,this.width,this.height);var a=aZ({graph:this.graph,hoveredNode:this.hoveredNode,displayedNodeLabels:this.displayedNodeLabels,highlightedNodes:this.highlightedNodes});gC(a,this.edgesWithForcedLabels);for(var i=new Set,l=0,u=a.length;lthis.nodeZExtent[1]&&(this.nodeZExtent[1]=i.zIndex))}},{key:"updateNode",value:function(r){this.addNode(r);var a=this.nodeDataCache[r];this.normalizationFunction.applyTo(a)}},{key:"removeNode",value:function(r){delete this.nodeDataCache[r],delete this.nodeProgramIndex[r],this.highlightedNodes.delete(r),this.hoveredNode===r&&(this.hoveredNode=null),this.nodesWithForcedLabels.delete(r)}},{key:"addEdge",value:function(r){var a=Object.assign({},this.graph.getEdgeAttributes(r));this.settings.edgeReducer&&(a=this.settings.edgeReducer(r,a));var i=sZ(this.settings,r,a);this.edgeDataCache[r]=i,this.edgesWithForcedLabels.delete(r),i.forceLabel&&!i.hidden&&this.edgesWithForcedLabels.add(r),this.settings.zIndex&&(i.zIndex
this.runFrame())},o.prototype.stop=function(){return this.running=!1,this.frameID!==null&&(window.cancelAnimationFrame(this.frameID),this.frameID=null),this},o.prototype.start=function(){if(this.killed)throw new Error("graphology-layout-force/worker.start: layout was killed.");this.running||(this.running=!0,this.runFrame())},o.prototype.kill=function(){this.stop(),delete this.nodeStates,this.killed=!0},km=o,km}var bU=yU();const xU=fn(bU);function wU(e={maxIterations:100}){return kl(vU,e)}function SU(e={}){return Sy(xU,e)}var Cm,jS;function EU(){if(jS)return Cm;jS=1;var e=0,t=1,n=2,r=3,i=4,o=5,s=6,u=7,f=8,d=9,p=0,m=1,v=2,g=0,w=1,x=2,k=3,C=4,_=5,T=6,N=7,D=8,z=3,R=10,B=3,P=9,j=10;return Cm=function(q,I,Y){var Z,U,G,F,K,A,$,M,O,X,re=I.length,ue=Y.length,ae=q.adjustSizes,oe=q.barnesHutTheta*q.barnesHutTheta,Ce,he,Ee,we,Pe,Ae,xe,ee=[];for(G=0;GNe?(ge-=(ve-Ne)/2,Se=ge+ve):(ce-=(Ne-ve)/2,Te=ce+Ne),ee[0+g]=-1,ee[0+w]=(ce+Te)/2,ee[0+x]=(ge+Se)/2,ee[0+k]=Math.max(Te-ce,Se-ge),ee[0+C]=-1,ee[0+_]=-1,ee[0+T]=0,ee[0+N]=0,ee[0+D]=0,Z=1,G=0;G=0){I[G+e]=0)if(Ae=Math.pow(I[G+e]-ee[U+N],2)+Math.pow(I[G+t]-ee[U+D],2),X=ee[U+k],4*X*X/Ae0?(xe=he*I[G+s]*ee[U+T]/Ae,I[G+n]+=Ee*xe,I[G+r]+=we*xe):Ae<0&&(xe=-he*I[G+s]*ee[U+T]/Math.sqrt(Ae),I[G+n]+=Ee*xe,I[G+r]+=we*xe):Ae>0&&(xe=he*I[G+s]*ee[U+T]/Ae,I[G+n]+=Ee*xe,I[G+r]+=we*xe),U=ee[U+C],U<0)break;continue}else{U=ee[U+_];continue}else{if(A=ee[U+g],A>=0&&A!==G&&(Ee=I[G+e]-I[A+e],we=I[G+t]-I[A+t],Ae=Ee*Ee+we*we,ae===!0?Ae>0?(xe=he*I[G+s]*I[A+s]/Ae,I[G+n]+=Ee*xe,I[G+r]+=we*xe):Ae<0&&(xe=-he*I[G+s]*I[A+s]/Math.sqrt(Ae),I[G+n]+=Ee*xe,I[G+r]+=we*xe):Ae>0&&(xe=he*I[G+s]*I[A+s]/Ae,I[G+n]+=Ee*xe,I[G+r]+=we*xe)),U=ee[U+C],U<0)break;continue}else for(he=q.scalingRatio,F=0;F0?(xe=he*I[F+s]*I[K+s]/Ae/Ae,I[F+n]+=Ee*xe,I[F+r]+=we*xe,I[K+n]-=Ee*xe,I[K+r]-=we*xe):Ae<0&&(xe=100*he*I[F+s]*I[K+s],I[F+n]+=Ee*xe,I[F+r]+=we*xe,I[K+n]-=Ee*xe,I[K+r]-=we*xe)):(Ae=Math.sqrt(Ee*Ee+we*we),Ae>0&&(xe=he*I[F+s]*I[K+s]/Ae/Ae,I[F+n]+=Ee*xe,I[F+r]+=we*xe,I[K+n]-=Ee*xe,I[K+r]-=we*xe));for(O=q.gravity/q.scalingRatio,he=q.scalingRatio,G=0;G0&&(xe=he*I[G+s]*O):Ae>0&&(xe=he*I[G+s]*O/Ae),I[G+n]-=Ee*xe,I[G+r]-=we*xe;for(he=1*(q.outboundAttractionDistribution?Ce:1),$=0;$0&&(xe=-he*Pe*Math.log(1+Ae)/Ae/I[F+s]):Ae>0&&(xe=-he*Pe*Math.log(1+Ae)/Ae):q.outboundAttractionDistribution?Ae>0&&(xe=-he*Pe/I[F+s]):Ae>0&&(xe=-he*Pe)):(Ae=Math.sqrt(Math.pow(Ee,2)+Math.pow(we,2)),q.linLogMode?q.outboundAttractionDistribution?Ae>0&&(xe=-he*Pe*Math.log(1+Ae)/Ae/I[F+s]):Ae>0&&(xe=-he*Pe*Math.log(1+Ae)/Ae):q.outboundAttractionDistribution?(Ae=1,xe=-he*Pe/I[F+s]):(Ae=1,xe=-he*Pe)),Ae>0&&(I[F+n]+=Ee*xe,I[F+r]+=we*xe,I[K+n]-=Ee*xe,I[K+r]-=we*xe);var te,de,Oe,$e,Ye,vt;if(ae===!0)for(G=0;Gj&&(I[G+n]=I[G+n]*j/te,I[G+r]=I[G+r]*j/te),de=I[G+s]*Math.sqrt((I[G+i]-I[G+n])*(I[G+i]-I[G+n])+(I[G+o]-I[G+r])*(I[G+o]-I[G+r])),Oe=Math.sqrt((I[G+i]+I[G+n])*(I[G+i]+I[G+n])+(I[G+o]+I[G+r])*(I[G+o]+I[G+r]))/2,$e=.1*Math.log(1+Oe)/(1+Math.sqrt(de)),Ye=I[G+e]+I[G+n]*($e/q.slowDown),I[G+e]=Ye,vt=I[G+t]+I[G+r]*($e/q.slowDown),I[G+t]=vt);else for(G=0;G=0)?{message:"the `scalingRatio` setting should be a number >= 0."}:"strongGravityMode"in n&&typeof n.strongGravityMode!="boolean"?{message:"the `strongGravityMode` setting should be a boolean."}:"gravity"in n&&!(typeof n.gravity=="number"&&n.gravity>=0)?{message:"the `gravity` setting should be a number >= 0."}:"slowDown"in n&&!(typeof n.slowDown=="number"||n.slowDown>=0)?{message:"the `slowDown` setting should be a number >= 0."}:"barnesHutOptimize"in n&&typeof n.barnesHutOptimize!="boolean"?{message:"the `barnesHutOptimize` setting should be a boolean."}:"barnesHutTheta"in n&&!(typeof n.barnesHutTheta=="number"&&n.barnesHutTheta>=0)?{message:"the `barnesHutTheta` setting should be a number >= 0."}:null},vi.graphToByteArrays=function(n,r){var i=n.order,o=n.size,s={},u,f=new Float32Array(i*e),d=new Float32Array(o*t);return u=0,n.forEachNode(function(p,m){s[p]=u,f[u]=m.x,f[u+1]=m.y,f[u+2]=0,f[u+3]=0,f[u+4]=0,f[u+5]=0,f[u+6]=1,f[u+7]=1,f[u+8]=m.size||1,f[u+9]=m.fixed?1:0,u+=e}),u=0,n.forEachEdge(function(p,m,v,g,w,x,k){var C=s[v],_=s[g],T=r(p,m,v,g,w,x,k);f[C+6]+=T,f[_+6]+=T,d[u]=C,d[u+1]=_,d[u+2]=T,u+=t}),{nodes:f,edges:d}},vi.assignLayoutChanges=function(n,r,i){var o=0;n.updateEachNodeAttributes(function(s,u){return u.x=r[o],u.y=r[o+1],o+=e,i?i(s,u):u})},vi.readGraphPositions=function(n,r){var i=0;n.forEachNode(function(o,s){r[i]=s.x,r[i+1]=s.y,i+=e})},vi.collectLayoutChanges=function(n,r,i){for(var o=n.nodes(),s={},u=0,f=0,d=r.length;u2e3,strongGravityMode:!0,gravity:.05,scalingRatio:10,slowDown:1+Math.log(d)}}var u=o.bind(null,!1);return u.assign=o.bind(null,!0),u.inferSettings=s,Am=u,Am}var kU=_U();const CU=fn(kU);var Rm,IS;function TU(){return IS||(IS=1,Rm=function(){var t,n,r={};(function(){var o=0,s=1,u=2,f=3,d=4,p=5,m=6,v=7,g=8,w=9,x=0,k=1,C=2,_=0,T=1,N=2,D=3,z=4,R=5,B=6,P=7,j=8,V=3,q=10,I=3,Y=9,Z=10;r.exports=function(G,F,K){var A,$,M,O,X,re,ue,ae,oe,Ce,he=F.length,Ee=K.length,we=G.adjustSizes,Pe=G.barnesHutTheta*G.barnesHutTheta,Ae,xe,ee,ce,Te,ge,Se,ie=[];for(M=0;MYe?(ve-=($e-Ye)/2,Ne=ve+$e):(He-=(Ye-$e)/2,Ge=He+Ye),ie[0+_]=-1,ie[0+T]=(He+Ge)/2,ie[0+N]=(ve+Ne)/2,ie[0+D]=Math.max(Ge-He,Ne-ve),ie[0+z]=-1,ie[0+R]=-1,ie[0+B]=0,ie[0+P]=0,ie[0+j]=0,A=1,M=0;M=0){F[M+o]=0)if(ge=Math.pow(F[M+o]-ie[$+P],2)+Math.pow(F[M+s]-ie[$+j],2),Ce=ie[$+D],4*Ce*Ce/ge0?(Se=xe*F[M+m]*ie[$+B]/ge,F[M+u]+=ee*Se,F[M+f]+=ce*Se):ge<0&&(Se=-xe*F[M+m]*ie[$+B]/Math.sqrt(ge),F[M+u]+=ee*Se,F[M+f]+=ce*Se):ge>0&&(Se=xe*F[M+m]*ie[$+B]/ge,F[M+u]+=ee*Se,F[M+f]+=ce*Se),$=ie[$+z],$<0)break;continue}else{$=ie[$+R];continue}else{if(re=ie[$+_],re>=0&&re!==M&&(ee=F[M+o]-F[re+o],ce=F[M+s]-F[re+s],ge=ee*ee+ce*ce,we===!0?ge>0?(Se=xe*F[M+m]*F[re+m]/ge,F[M+u]+=ee*Se,F[M+f]+=ce*Se):ge<0&&(Se=-xe*F[M+m]*F[re+m]/Math.sqrt(ge),F[M+u]+=ee*Se,F[M+f]+=ce*Se):ge>0&&(Se=xe*F[M+m]*F[re+m]/ge,F[M+u]+=ee*Se,F[M+f]+=ce*Se)),$=ie[$+z],$<0)break;continue}else for(xe=G.scalingRatio,O=0;O0?(Se=xe*F[O+m]*F[X+m]/ge/ge,F[O+u]+=ee*Se,F[O+f]+=ce*Se,F[X+u]-=ee*Se,F[X+f]-=ce*Se):ge<0&&(Se=100*xe*F[O+m]*F[X+m],F[O+u]+=ee*Se,F[O+f]+=ce*Se,F[X+u]-=ee*Se,F[X+f]-=ce*Se)):(ge=Math.sqrt(ee*ee+ce*ce),ge>0&&(Se=xe*F[O+m]*F[X+m]/ge/ge,F[O+u]+=ee*Se,F[O+f]+=ce*Se,F[X+u]-=ee*Se,F[X+f]-=ce*Se));for(oe=G.gravity/G.scalingRatio,xe=G.scalingRatio,M=0;M0&&(Se=xe*F[M+m]*oe):ge>0&&(Se=xe*F[M+m]*oe/ge),F[M+u]-=ee*Se,F[M+f]-=ce*Se;for(xe=1*(G.outboundAttractionDistribution?Ae:1),ue=0;ue0&&(Se=-xe*Te*Math.log(1+ge)/ge/F[O+m]):ge>0&&(Se=-xe*Te*Math.log(1+ge)/ge):G.outboundAttractionDistribution?ge>0&&(Se=-xe*Te/F[O+m]):ge>0&&(Se=-xe*Te)):(ge=Math.sqrt(Math.pow(ee,2)+Math.pow(ce,2)),G.linLogMode?G.outboundAttractionDistribution?ge>0&&(Se=-xe*Te*Math.log(1+ge)/ge/F[O+m]):ge>0&&(Se=-xe*Te*Math.log(1+ge)/ge):G.outboundAttractionDistribution?(ge=1,Se=-xe*Te/F[O+m]):(ge=1,Se=-xe*Te)),ge>0&&(F[O+u]+=ee*Se,F[O+f]+=ce*Se,F[X+u]-=ee*Se,F[X+f]-=ce*Se);var vt,Mt,bt,rt,qt,at;if(we===!0)for(M=0;MZ&&(F[M+u]=F[M+u]*Z/vt,F[M+f]=F[M+f]*Z/vt),Mt=F[M+m]*Math.sqrt((F[M+d]-F[M+u])*(F[M+d]-F[M+u])+(F[M+p]-F[M+f])*(F[M+p]-F[M+f])),bt=Math.sqrt((F[M+d]+F[M+u])*(F[M+d]+F[M+u])+(F[M+p]+F[M+f])*(F[M+p]+F[M+f]))/2,rt=.1*Math.log(1+bt)/(1+Math.sqrt(Mt)),qt=F[M+o]+F[M+u]*(rt/G.slowDown),F[M+o]=qt,at=F[M+s]+F[M+f]*(rt/G.slowDown),F[M+s]=at);else for(M=0;M1&&Ee.has(Se))&&(F>1&&Ee.add(Se),xe=f[Pe+e],ce=f[Pe+t],ge=f[Pe+n],ie=xe-Ae,He=ce-ee,Ge=Math.sqrt(ie*ie+He*He),ve=Ge0?(R[Pe]+=ie/Ge*(1+Te),B[Pe]+=He/Ge*(1+Te)):(R[Pe]+=I*o(),B[Pe]+=Y*o())));for(w=0,x=0;w1&&xe.has(ve))&&(M>1&&xe.add(ve),ge=v[ce+i],ie=v[ce+o],Ge=v[ce+s],Ne=ge-Te,te=ie-Se,de=Math.sqrt(Ne*Ne+te*te),Oe=de0?(V[ce]+=Ne/de*(1+He),q[ce]+=te/de*(1+He)):(V[ce]+=G*d(),q[ce]+=F*d())));for(_=0,T=0;_=0;)m=Xg(e,t,n,r,d+1,o+1,s),m>p&&(d===i?m*=WS:ZU.test(e.charAt(d-1))?(m*=YU,g=e.slice(i,d-1).match(QU),g&&i>0&&(m*=Math.pow(Fm,g.length))):JU.test(e.charAt(d-1))?(m*=qU,w=e.slice(i,d-1).match(HA),w&&i>0&&(m*=Math.pow(Fm,w.length))):(m*=WU,i>0&&(m*=Math.pow(Fm,d-i))),e.charAt(d)!==t.charAt(o)&&(m*=XU)),(mm&&(m=v*Pm)),m>p&&(p=m),d=n.indexOf(f,d+1);return s[u]=p,p}function XS(e){return e.toLowerCase().replace(HA," ")}function e6(e,t,n){return e=n&&n.length>0?`${e+" "+n.join(" ")}`:e,Xg(e,t,XS(e),XS(t),0,0,{})}var Im={exports:{}},Gm={};/** - * @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 KS;function t6(){if(KS)return Gm;KS=1;var e=$f();function t(m,v){return m===v&&(m!==0||1/m===1/v)||m!==m&&v!==v}var n=typeof Object.is=="function"?Object.is:t,r=e.useState,i=e.useEffect,o=e.useLayoutEffect,s=e.useDebugValue;function u(m,v){var g=v(),w=r({inst:{value:g,getSnapshot:v}}),x=w[0].inst,k=w[1];return o(function(){x.value=g,x.getSnapshot=v,f(x)&&k({inst:x})},[m,g,v]),i(function(){return f(x)&&k({inst:x}),m(function(){f(x)&&k({inst:x})})},[m]),s(g),g}function f(m){var v=m.getSnapshot;m=m.value;try{var g=v();return!n(m,g)}catch{return!0}}function d(m,v){return v()}var p=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?d:u;return Gm.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:p,Gm}var ZS;function n6(){return ZS||(ZS=1,Im.exports=t6()),Im.exports}var r6=n6(),zs='[cmdk-group=""]',Bm='[cmdk-group-items=""]',i6='[cmdk-group-heading=""]',_y='[cmdk-item=""]',QS=`${_y}:not([aria-disabled="true"])`,Kg="cmdk-item-select",Ha="data-value",a6=(e,t,n)=>e6(e,t,n),$A=E.createContext(void 0),mu=()=>E.useContext($A),VA=E.createContext(void 0),ky=()=>E.useContext(VA),qA=E.createContext(void 0),YA=E.forwardRef((e,t)=>{let n=Qo(()=>{var M,O;return{search:"",value:(O=(M=e.value)!=null?M:e.defaultValue)!=null?O:"",filtered:{count:0,items:new Map,groups:new Set}}}),r=Qo(()=>new Set),i=Qo(()=>new Map),o=Qo(()=>new Map),s=Qo(()=>new Set),u=WA(e),{label:f,children:d,value:p,onValueChange:m,filter:v,shouldFilter:g,loop:w,disablePointerSelection:x=!1,vimBindings:k=!0,...C}=e,_=bn(),T=bn(),N=bn(),D=E.useRef(null),z=g6();Qa(()=>{if(p!==void 0){let M=p.trim();n.current.value=M,R.emit()}},[p]),Qa(()=>{z(6,I)},[]);let R=E.useMemo(()=>({subscribe:M=>(s.current.add(M),()=>s.current.delete(M)),snapshot:()=>n.current,setState:(M,O,X)=>{var re,ue,ae;if(!Object.is(n.current[M],O)){if(n.current[M]=O,M==="search")q(),j(),z(1,V);else if(M==="value"&&(X||z(5,I),((re=u.current)==null?void 0:re.value)!==void 0)){let oe=O??"";(ae=(ue=u.current).onValueChange)==null||ae.call(ue,oe);return}R.emit()}},emit:()=>{s.current.forEach(M=>M())}}),[]),B=E.useMemo(()=>({value:(M,O,X)=>{var re;O!==((re=o.current.get(M))==null?void 0:re.value)&&(o.current.set(M,{value:O,keywords:X}),n.current.filtered.items.set(M,P(O,X)),z(2,()=>{j(),R.emit()}))},item:(M,O)=>(r.current.add(M),O&&(i.current.has(O)?i.current.get(O).add(M):i.current.set(O,new Set([M]))),z(3,()=>{q(),j(),n.current.value||V(),R.emit()}),()=>{o.current.delete(M),r.current.delete(M),n.current.filtered.items.delete(M);let X=Y();z(4,()=>{q(),(X==null?void 0:X.getAttribute("id"))===M&&V(),R.emit()})}),group:M=>(i.current.has(M)||i.current.set(M,new Set),()=>{o.current.delete(M),i.current.delete(M)}),filter:()=>u.current.shouldFilter,label:f||e["aria-label"],getDisablePointerSelection:()=>u.current.disablePointerSelection,listId:_,inputId:N,labelId:T,listInnerRef:D}),[]);function P(M,O){var X,re;let ue=(re=(X=u.current)==null?void 0:X.filter)!=null?re:a6;return M?ue(M,n.current.search,O):0}function j(){if(!n.current.search||u.current.shouldFilter===!1)return;let M=n.current.filtered.items,O=[];n.current.filtered.groups.forEach(re=>{let ue=i.current.get(re),ae=0;ue.forEach(oe=>{let Ce=M.get(oe);ae=Math.max(Ce,ae)}),O.push([re,ae])});let X=D.current;Z().sort((re,ue)=>{var ae,oe;let Ce=re.getAttribute("id"),he=ue.getAttribute("id");return((ae=M.get(he))!=null?ae:0)-((oe=M.get(Ce))!=null?oe:0)}).forEach(re=>{let ue=re.closest(Bm);ue?ue.appendChild(re.parentElement===ue?re:re.closest(`${Bm} > *`)):X.appendChild(re.parentElement===X?re:re.closest(`${Bm} > *`))}),O.sort((re,ue)=>ue[1]-re[1]).forEach(re=>{var ue;let ae=(ue=D.current)==null?void 0:ue.querySelector(`${zs}[${Ha}="${encodeURIComponent(re[0])}"]`);ae==null||ae.parentElement.appendChild(ae)})}function V(){let M=Z().find(X=>X.getAttribute("aria-disabled")!=="true"),O=M==null?void 0:M.getAttribute(Ha);R.setState("value",O||void 0)}function q(){var M,O,X,re;if(!n.current.search||u.current.shouldFilter===!1){n.current.filtered.count=r.current.size;return}n.current.filtered.groups=new Set;let ue=0;for(let ae of r.current){let oe=(O=(M=o.current.get(ae))==null?void 0:M.value)!=null?O:"",Ce=(re=(X=o.current.get(ae))==null?void 0:X.keywords)!=null?re:[],he=P(oe,Ce);n.current.filtered.items.set(ae,he),he>0&&ue++}for(let[ae,oe]of i.current)for(let Ce of oe)if(n.current.filtered.items.get(Ce)>0){n.current.filtered.groups.add(ae);break}n.current.filtered.count=ue}function I(){var M,O,X;let re=Y();re&&(((M=re.parentElement)==null?void 0:M.firstChild)===re&&((X=(O=re.closest(zs))==null?void 0:O.querySelector(i6))==null||X.scrollIntoView({block:"nearest"})),re.scrollIntoView({block:"nearest"}))}function Y(){var M;return(M=D.current)==null?void 0:M.querySelector(`${_y}[aria-selected="true"]`)}function Z(){var M;return Array.from(((M=D.current)==null?void 0:M.querySelectorAll(QS))||[])}function U(M){let O=Z()[M];O&&R.setState("value",O.getAttribute(Ha))}function G(M){var O;let X=Y(),re=Z(),ue=re.findIndex(oe=>oe===X),ae=re[ue+M];(O=u.current)!=null&&O.loop&&(ae=ue+M<0?re[re.length-1]:ue+M===re.length?re[0]:re[ue+M]),ae&&R.setState("value",ae.getAttribute(Ha))}function F(M){let O=Y(),X=O==null?void 0:O.closest(zs),re;for(;X&&!re;)X=M>0?p6(X,zs):m6(X,zs),re=X==null?void 0:X.querySelector(QS);re?R.setState("value",re.getAttribute(Ha)):G(M)}let K=()=>U(Z().length-1),A=M=>{M.preventDefault(),M.metaKey?K():M.altKey?F(1):G(1)},$=M=>{M.preventDefault(),M.metaKey?U(0):M.altKey?F(-1):G(-1)};return E.createElement(We.div,{ref:t,tabIndex:-1,...C,"cmdk-root":"",onKeyDown:M=>{var O;if((O=C.onKeyDown)==null||O.call(C,M),!M.defaultPrevented)switch(M.key){case"n":case"j":{k&&M.ctrlKey&&A(M);break}case"ArrowDown":{A(M);break}case"p":case"k":{k&&M.ctrlKey&&$(M);break}case"ArrowUp":{$(M);break}case"Home":{M.preventDefault(),U(0);break}case"End":{M.preventDefault(),K();break}case"Enter":if(!M.nativeEvent.isComposing&&M.keyCode!==229){M.preventDefault();let X=Y();if(X){let re=new Event(Kg);X.dispatchEvent(re)}}}}},E.createElement("label",{"cmdk-label":"",htmlFor:B.inputId,id:B.labelId,style:y6},f),vd(e,M=>E.createElement(VA.Provider,{value:R},E.createElement($A.Provider,{value:B},M))))}),o6=E.forwardRef((e,t)=>{var n,r;let i=bn(),o=E.useRef(null),s=E.useContext(qA),u=mu(),f=WA(e),d=(r=(n=f.current)==null?void 0:n.forceMount)!=null?r:s==null?void 0:s.forceMount;Qa(()=>{if(!d)return u.item(i,s==null?void 0:s.id)},[d]);let p=XA(i,o,[e.value,e.children,o],e.keywords),m=ky(),v=Ja(z=>z.value&&z.value===p.current),g=Ja(z=>d||u.filter()===!1?!0:z.search?z.filtered.items.get(i)>0:!0);E.useEffect(()=>{let z=o.current;if(!(!z||e.disabled))return z.addEventListener(Kg,w),()=>z.removeEventListener(Kg,w)},[g,e.onSelect,e.disabled]);function w(){var z,R;x(),(R=(z=f.current).onSelect)==null||R.call(z,p.current)}function x(){m.setState("value",p.current,!0)}if(!g)return null;let{disabled:k,value:C,onSelect:_,forceMount:T,keywords:N,...D}=e;return E.createElement(We.div,{ref:Xs([o,t]),...D,id:i,"cmdk-item":"",role:"option","aria-disabled":!!k,"aria-selected":!!v,"data-disabled":!!k,"data-selected":!!v,onPointerMove:k||u.getDisablePointerSelection()?void 0:x,onClick:k?void 0:w},e.children)}),l6=E.forwardRef((e,t)=>{let{heading:n,children:r,forceMount:i,...o}=e,s=bn(),u=E.useRef(null),f=E.useRef(null),d=bn(),p=mu(),m=Ja(g=>i||p.filter()===!1?!0:g.search?g.filtered.groups.has(s):!0);Qa(()=>p.group(s),[]),XA(s,u,[e.value,e.heading,f]);let v=E.useMemo(()=>({id:s,forceMount:i}),[i]);return E.createElement(We.div,{ref:Xs([u,t]),...o,"cmdk-group":"",role:"presentation",hidden:m?void 0:!0},n&&E.createElement("div",{ref:f,"cmdk-group-heading":"","aria-hidden":!0,id:d},n),vd(e,g=>E.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?d:void 0},E.createElement(qA.Provider,{value:v},g))))}),s6=E.forwardRef((e,t)=>{let{alwaysRender:n,...r}=e,i=E.useRef(null),o=Ja(s=>!s.search);return!n&&!o?null:E.createElement(We.div,{ref:Xs([i,t]),...r,"cmdk-separator":"",role:"separator"})}),u6=E.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,i=e.value!=null,o=ky(),s=Ja(p=>p.search),u=Ja(p=>p.value),f=mu(),d=E.useMemo(()=>{var p;let m=(p=f.listInnerRef.current)==null?void 0:p.querySelector(`${_y}[${Ha}="${encodeURIComponent(u)}"]`);return m==null?void 0:m.getAttribute("id")},[]);return E.useEffect(()=>{e.value!=null&&o.setState("search",e.value)},[e.value]),E.createElement(We.input,{ref:t,...r,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":f.listId,"aria-labelledby":f.labelId,"aria-activedescendant":d,id:f.inputId,type:"text",value:i?e.value:s,onChange:p=>{i||o.setState("search",p.target.value),n==null||n(p.target.value)}})}),c6=E.forwardRef((e,t)=>{let{children:n,label:r="Suggestions",...i}=e,o=E.useRef(null),s=E.useRef(null),u=mu();return E.useEffect(()=>{if(s.current&&o.current){let f=s.current,d=o.current,p,m=new ResizeObserver(()=>{p=requestAnimationFrame(()=>{let v=f.offsetHeight;d.style.setProperty("--cmdk-list-height",v.toFixed(1)+"px")})});return m.observe(f),()=>{cancelAnimationFrame(p),m.unobserve(f)}}},[]),E.createElement(We.div,{ref:Xs([o,t]),...i,"cmdk-list":"",role:"listbox","aria-label":r,id:u.listId},vd(e,f=>E.createElement("div",{ref:Xs([s,u.listInnerRef]),"cmdk-list-sizer":""},f)))}),f6=E.forwardRef((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:i,contentClassName:o,container:s,...u}=e;return E.createElement(Uv,{open:n,onOpenChange:r},E.createElement(Hv,{container:s},E.createElement(td,{"cmdk-overlay":"",className:i}),E.createElement(nd,{"aria-label":e.label,"cmdk-dialog":"",className:o},E.createElement(YA,{ref:t,...u}))))}),d6=E.forwardRef((e,t)=>Ja(n=>n.filtered.count===0)?E.createElement(We.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),h6=E.forwardRef((e,t)=>{let{progress:n,children:r,label:i="Loading...",...o}=e;return E.createElement(We.div,{ref:t,...o,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":i},vd(e,s=>E.createElement("div",{"aria-hidden":!0},s)))}),In=Object.assign(YA,{List:c6,Item:o6,Input:u6,Group:l6,Separator:s6,Dialog:f6,Empty:d6,Loading:h6});function p6(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function m6(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function WA(e){let t=E.useRef(e);return Qa(()=>{t.current=e}),t}var Qa=typeof window>"u"?E.useEffect:E.useLayoutEffect;function Qo(e){let t=E.useRef();return t.current===void 0&&(t.current=e()),t}function Xs(e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}function Ja(e){let t=ky(),n=()=>e(t.snapshot());return r6.useSyncExternalStore(t.subscribe,n,n)}function XA(e,t,n,r=[]){let i=E.useRef(),o=mu();return Qa(()=>{var s;let u=(()=>{var d;for(let p of n){if(typeof p=="string")return p.trim();if(typeof p=="object"&&"current"in p)return p.current?(d=p.current.textContent)==null?void 0:d.trim():i.current}})(),f=r.map(d=>d.trim());o.value(e,u,f),(s=t.current)==null||s.setAttribute(Ha,u),i.current=u}),i}var g6=()=>{let[e,t]=E.useState(),n=Qo(()=>new Map);return Qa(()=>{n.current.forEach(r=>r()),n.current=new Map},[e]),(r,i)=>{n.current.set(r,i),t({})}};function v6(e){let t=e.type;return typeof t=="function"?t(e.props):"render"in t?t.render(e.props):e}function vd({asChild:e,children:t},n){return e&&E.isValidElement(t)?E.cloneElement(v6(t),{ref:t.ref},n(t.props.children)):n(t)}var y6={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};const KA=Uv,ZA=eC,b6=Hv,QA=E.forwardRef(({className:e,...t},n)=>S.jsx(td,{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}));QA.displayName=td.displayName;const Cy=E.forwardRef(({className:e,children:t,...n},r)=>S.jsxs(b6,{children:[S.jsx(QA,{}),S.jsxs(nd,{ref:r,className:Me("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-top-[48%] fixed top-[50%] left-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border p-6 shadow-lg duration-200 sm:rounded-lg",e),...n,children:[t,S.jsxs(qv,{className:"ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-sm opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-none disabled:pointer-events-none",children:[S.jsx(Ek,{className:"h-4 w-4"}),S.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));Cy.displayName=nd.displayName;const Ty=({className:e,...t})=>S.jsx("div",{className:Me("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});Ty.displayName="DialogHeader";const Ay=E.forwardRef(({className:e,...t},n)=>S.jsx($v,{ref:n,className:Me("text-lg leading-none font-semibold tracking-tight",e),...t}));Ay.displayName=$v.displayName;const Ry=E.forwardRef(({className:e,...t},n)=>S.jsx(Vv,{ref:n,className:Me("text-muted-foreground text-sm",e),...t}));Ry.displayName=Vv.displayName;const yd=E.forwardRef(({className:e,...t},n)=>S.jsx(In,{ref:n,className:Me("bg-popover text-popover-foreground flex h-full w-full flex-col overflow-hidden rounded-md",e),...t}));yd.displayName=In.displayName;const Dy=E.forwardRef(({className:e,...t},n)=>S.jsxs("div",{className:"flex items-center border-b px-3","cmdk-input-wrapper":"",children:[S.jsx(XM,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),S.jsx(In.Input,{ref:n,className:Me("placeholder:text-muted-foreground flex h-11 w-full rounded-md bg-transparent py-3 text-sm outline-none disabled:cursor-not-allowed disabled:opacity-50",e),...t})]}));Dy.displayName=In.Input.displayName;const bd=E.forwardRef(({className:e,...t},n)=>S.jsx(In.List,{ref:n,className:Me("max-h-[300px] overflow-x-hidden overflow-y-auto",e),...t}));bd.displayName=In.List.displayName;const Ny=E.forwardRef((e,t)=>S.jsx(In.Empty,{ref:t,className:"py-6 text-center text-sm",...e}));Ny.displayName=In.Empty.displayName;const Cl=E.forwardRef(({className:e,...t},n)=>S.jsx(In.Group,{ref:n,className:Me("text-foreground [&_[cmdk-group-heading]]:text-muted-foreground overflow-hidden p-1 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium",e),...t}));Cl.displayName=In.Group.displayName;const x6=E.forwardRef(({className:e,...t},n)=>S.jsx(In.Separator,{ref:n,className:Me("bg-border -mx-1 h-px",e),...t}));x6.displayName=In.Separator.displayName;const Tl=E.forwardRef(({className:e,...t},n)=>S.jsx(In.Item,{ref:n,className:Me("data-[selected='true']:bg-accent data-[selected=true]:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",e),...t}));Tl.displayName=In.Item.displayName;const w6=({layout:e,autoRunFor:t})=>{const n=pr(),{stop:r,start:i,isRunning:o}=e;return E.useEffect(()=>{if(!n)return;let s=null;return t!==void 0&&t>-1&&n.getGraph().order>0&&(i(),s=t>0?window.setTimeout(()=>{r()},t):null),()=>{r(),s&&clearTimeout(s)}},[t,i,r,n]),S.jsx(Ot,{size:"icon",onClick:()=>o?r():i(),tooltip:o?"Stop the layout animation":"Start the layout animation",variant:Hr,children:o?S.jsx(HM,{}):S.jsx(VM,{})})},S6=()=>{const e=pr(),[t,n]=E.useState("Circular"),[r,i]=E.useState(!1),o=pU(),s=cU(),u=VU(),f=GU({settings:{margin:1}}),d=wU({maxIterations:20}),p=GA({iterations:20}),m=BU(),v=SU(),g=NU(),w=E.useMemo(()=>({Circular:{layout:o},Circlepack:{layout:s},Random:{layout:u},Noverlaps:{layout:f,worker:m},"Force Directed":{layout:d,worker:v},"Force Atlas":{layout:p,worker:g}}),[s,o,d,p,f,u,v,m,g]),x=E.useCallback(k=>{console.debug(k);const{positions:C}=w[k].layout;RG(e.getGraph(),C(),{duration:500}),n(k)},[w,e]);return S.jsxs(S.Fragment,{children:[S.jsx("div",{children:w[t]&&"worker"in w[t]&&S.jsx(w6,{layout:w[t].worker})}),S.jsx("div",{children:S.jsxs(fd,{open:r,onOpenChange:i,children:[S.jsx(dd,{asChild:!0,children:S.jsx(Ot,{size:"icon",variant:Hr,onClick:()=>i(k=>!k),tooltip:"Layout Graph",children:S.jsx(OM,{})})}),S.jsx(uu,{side:"right",align:"center",className:"p-1",children:S.jsx(yd,{children:S.jsx(bd,{children:S.jsx(Cl,{children:Object.keys(w).map(k=>S.jsx(Tl,{onSelect:()=>{x(k)},className:"cursor-pointer text-xs",children:k},k))})})})})]})})]})};var cf={exports:{}},E6=cf.exports,JS;function _6(){return JS||(JS=1,function(e){(function(t,n,r){function i(f){var d=this,p=u();d.next=function(){var m=2091639*d.s0+d.c*23283064365386963e-26;return d.s0=d.s1,d.s1=d.s2,d.s2=m-(d.c=m|0)},d.c=1,d.s0=p(" "),d.s1=p(" "),d.s2=p(" "),d.s0-=p(f),d.s0<0&&(d.s0+=1),d.s1-=p(f),d.s1<0&&(d.s1+=1),d.s2-=p(f),d.s2<0&&(d.s2+=1),p=null}function o(f,d){return d.c=f.c,d.s0=f.s0,d.s1=f.s1,d.s2=f.s2,d}function s(f,d){var p=new i(f),m=d&&d.state,v=p.next;return v.int32=function(){return p.next()*4294967296|0},v.double=function(){return v()+(v()*2097152|0)*11102230246251565e-32},v.quick=v,m&&(typeof m=="object"&&o(m,p),v.state=function(){return o(p,{})}),v}function u(){var f=4022871197,d=function(p){p=String(p);for(var m=0;m>>0,v-=f,v*=f,f=v>>>0,v-=f,f+=v*4294967296}return(f>>>0)*23283064365386963e-26};return d}n&&n.exports?n.exports=s:this.alea=s})(E6,e)}(cf)),cf.exports}var ff={exports:{}},k6=ff.exports,eE;function C6(){return eE||(eE=1,function(e){(function(t,n,r){function i(u){var f=this,d="";f.x=0,f.y=0,f.z=0,f.w=0,f.next=function(){var m=f.x^f.x<<11;return f.x=f.y,f.y=f.z,f.z=f.w,f.w^=f.w>>>19^m^m>>>8},u===(u|0)?f.x=u:d+=u;for(var p=0;p>>0)/4294967296};return m.double=function(){do var v=d.next()>>>11,g=(d.next()>>>0)/4294967296,w=(v+g)/(1<<21);while(w===0);return w},m.int32=d.next,m.quick=m,p&&(typeof p=="object"&&o(p,d),m.state=function(){return o(d,{})}),m}n&&n.exports?n.exports=s:this.xor128=s})(k6,e)}(ff)),ff.exports}var df={exports:{}},T6=df.exports,tE;function A6(){return tE||(tE=1,function(e){(function(t,n,r){function i(u){var f=this,d="";f.next=function(){var m=f.x^f.x>>>2;return f.x=f.y,f.y=f.z,f.z=f.w,f.w=f.v,(f.d=f.d+362437|0)+(f.v=f.v^f.v<<4^(m^m<<1))|0},f.x=0,f.y=0,f.z=0,f.w=0,f.v=0,u===(u|0)?f.x=u:d+=u;for(var p=0;p>>4),f.next()}function o(u,f){return f.x=u.x,f.y=u.y,f.z=u.z,f.w=u.w,f.v=u.v,f.d=u.d,f}function s(u,f){var d=new i(u),p=f&&f.state,m=function(){return(d.next()>>>0)/4294967296};return m.double=function(){do var v=d.next()>>>11,g=(d.next()>>>0)/4294967296,w=(v+g)/(1<<21);while(w===0);return w},m.int32=d.next,m.quick=m,p&&(typeof p=="object"&&o(p,d),m.state=function(){return o(d,{})}),m}n&&n.exports?n.exports=s:this.xorwow=s})(T6,e)}(df)),df.exports}var hf={exports:{}},R6=hf.exports,nE;function D6(){return nE||(nE=1,function(e){(function(t,n,r){function i(u){var f=this;f.next=function(){var p=f.x,m=f.i,v,g;return v=p[m],v^=v>>>7,g=v^v<<24,v=p[m+1&7],g^=v^v>>>10,v=p[m+3&7],g^=v^v>>>3,v=p[m+4&7],g^=v^v<<7,v=p[m+7&7],v=v^v<<13,g^=v^v<<9,p[m]=g,f.i=m+1&7,g};function d(p,m){var v,g=[];if(m===(m|0))g[0]=m;else for(m=""+m,v=0;v0;--v)p.next()}d(f,u)}function o(u,f){return f.x=u.x.slice(),f.i=u.i,f}function s(u,f){u==null&&(u=+new Date);var d=new i(u),p=f&&f.state,m=function(){return(d.next()>>>0)/4294967296};return m.double=function(){do var v=d.next()>>>11,g=(d.next()>>>0)/4294967296,w=(v+g)/(1<<21);while(w===0);return w},m.int32=d.next,m.quick=m,p&&(p.x&&o(p,d),m.state=function(){return o(d,{})}),m}n&&n.exports?n.exports=s:this.xorshift7=s})(R6,e)}(hf)),hf.exports}var pf={exports:{}},N6=pf.exports,rE;function O6(){return rE||(rE=1,function(e){(function(t,n,r){function i(u){var f=this;f.next=function(){var p=f.w,m=f.X,v=f.i,g,w;return f.w=p=p+1640531527|0,w=m[v+34&127],g=m[v=v+1&127],w^=w<<13,g^=g<<17,w^=w>>>15,g^=g>>>12,w=m[v]=w^g,f.i=v,w+(p^p>>>16)|0};function d(p,m){var v,g,w,x,k,C=[],_=128;for(m===(m|0)?(g=m,m=null):(m=m+"\0",g=0,_=Math.max(_,m.length)),w=0,x=-32;x<_;++x)m&&(g^=m.charCodeAt((x+32)%m.length)),x===0&&(k=g),g^=g<<10,g^=g>>>15,g^=g<<4,g^=g>>>13,x>=0&&(k=k+1640531527|0,v=C[x&127]^=g+k,w=v==0?w+1:0);for(w>=128&&(C[(m&&m.length||0)&127]=-1),w=127,x=4*128;x>0;--x)g=C[w+34&127],v=C[w=w+1&127],g^=g<<13,v^=v<<17,g^=g>>>15,v^=v>>>12,C[w]=g^v;p.w=k,p.X=C,p.i=w}d(f,u)}function o(u,f){return f.i=u.i,f.w=u.w,f.X=u.X.slice(),f}function s(u,f){u==null&&(u=+new Date);var d=new i(u),p=f&&f.state,m=function(){return(d.next()>>>0)/4294967296};return m.double=function(){do var v=d.next()>>>11,g=(d.next()>>>0)/4294967296,w=(v+g)/(1<<21);while(w===0);return w},m.int32=d.next,m.quick=m,p&&(p.X&&o(p,d),m.state=function(){return o(d,{})}),m}n&&n.exports?n.exports=s:this.xor4096=s})(N6,e)}(pf)),pf.exports}var mf={exports:{}},L6=mf.exports,iE;function z6(){return iE||(iE=1,function(e){(function(t,n,r){function i(u){var f=this,d="";f.next=function(){var m=f.b,v=f.c,g=f.d,w=f.a;return m=m<<25^m>>>7^v,v=v-g|0,g=g<<24^g>>>8^w,w=w-m|0,f.b=m=m<<20^m>>>12^v,f.c=v=v-g|0,f.d=g<<16^v>>>16^w,f.a=w-m|0},f.a=0,f.b=0,f.c=-1640531527,f.d=1367130551,u===Math.floor(u)?(f.a=u/4294967296|0,f.b=u|0):d+=u;for(var p=0;p>>0)/4294967296};return m.double=function(){do var v=d.next()>>>11,g=(d.next()>>>0)/4294967296,w=(v+g)/(1<<21);while(w===0);return w},m.int32=d.next,m.quick=m,p&&(typeof p=="object"&&o(p,d),m.state=function(){return o(d,{})}),m}n&&n.exports?n.exports=s:this.tychei=s})(L6,e)}(mf)),mf.exports}var gf={exports:{}};const j6={},M6=Object.freeze(Object.defineProperty({__proto__:null,default:j6},Symbol.toStringTag,{value:"Module"})),P6=lL(M6);var F6=gf.exports,aE;function I6(){return aE||(aE=1,function(e){(function(t,n,r){var i=256,o=6,s=52,u="random",f=r.pow(i,o),d=r.pow(2,s),p=d*2,m=i-1,v;function g(N,D,z){var R=[];D=D==!0?{entropy:!0}:D||{};var B=C(k(D.entropy?[N,T(n)]:N??_(),3),R),P=new w(R),j=function(){for(var V=P.g(o),q=f,I=0;V=p;)V/=2,q/=2,I>>>=1;return(V+I)/q};return j.int32=function(){return P.g(4)|0},j.quick=function(){return P.g(4)/4294967296},j.double=j,C(T(P.S),n),(D.pass||z||function(V,q,I,Y){return Y&&(Y.S&&x(Y,P),V.state=function(){return x(P,{})}),I?(r[u]=V,q):V})(j,B,"global"in D?D.global:this==r,D.state)}function w(N){var D,z=N.length,R=this,B=0,P=R.i=R.j=0,j=R.S=[];for(z||(N=[z++]);B{if(!e||!Array.isArray(e.nodes)||!Array.isArray(e.edges))return!1;for(const t of e.nodes)if(!t.id||!t.labels||!t.properties)return!1;for(const t of e.edges)if(!t.id||!t.source||!t.target)return!1;for(const t of e.edges){const n=e.getNode(t.source),r=e.getNode(t.target);if(n==null||r==null)return!1}return!0},$6=async e=>{let t=null;try{t=await nM(e)}catch(r){return Mn.getState().setErrorMessage(Cr(r),"Query Graphs Error!"),null}let n=null;if(t){const r={},i={};for(let f=0;f0){const f=bz-Qw;for(const d of t.nodes)d.size=Math.round(Qw+f*Math.pow((d.degree-o)/u,.5))}n=new nU,n.nodes=t.nodes,n.edges=t.edges,n.nodeIdMap=r,n.edgeIdMap=i,H6(n)||(n=null,console.error("Invalid graph data")),console.log("Graph data loaded")}return n},V6=e=>{const t=new Ws;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:mz,borderSize:.2});for(const n of(e==null?void 0:e.edges)??[])n.dynamicId=t.addDirectedEdge(n.source,n.target,{label:n.type||void 0});return t},lE={label:""},JA=()=>{const e=Qe.use.queryLabel(),t=yt.use.rawGraph(),n=yt.use.sigmaGraph(),r=E.useCallback(s=>(t==null?void 0:t.getNode(s))||null,[t]),i=E.useCallback((s,u=!0)=>(t==null?void 0:t.getEdge(s,u))||null,[t]);return E.useEffect(()=>{if(e){if(lE.label!==e){lE.label=e;const s=yt.getState();s.reset(),$6(e).then(u=>{s.setSigmaGraph(V6(u)),u==null||u.buildDynamicMap(),s.setRawGraph(u)})}}else{const s=yt.getState();s.reset(),s.setSigmaGraph(new Ws)}},[e]),{lightrageGraph:E.useCallback(()=>{if(n)return n;const s=new Ws;return yt.getState().setSigmaGraph(s),s},[n]),getNode:r,getEdge:i}},Vc=e=>!!(e.type.startsWith("mouse")&&e.buttons!==0),q6=({disableHoverEffect:e})=>{const{lightrageGraph:t}=JA(),n=pr(),r=bA(),i=yA(),o=rB(),{assign:s}=GA({iterations:20}),{theme:u}=hT(),f=Qe.use.enableHideUnselectedEdges(),d=yt.use.selectedNode(),p=yt.use.focusedNode(),m=yt.use.selectedEdge(),v=yt.use.focusedEdge();return E.useEffect(()=>{const g=t();o(g),g.__force_applied||(s(),Object.assign(g,{__force_applied:!0}));const{setFocusedNode:w,setSelectedNode:x,setFocusedEdge:k,setSelectedEdge:C,clearSelection:_}=yt.getState();r({enterNode:T=>{Vc(T.event.original)||w(T.node)},leaveNode:T=>{Vc(T.event.original)||w(null)},clickNode:T=>{x(T.node),C(null)},clickEdge:T=>{C(T.edge),x(null)},enterEdge:T=>{Vc(T.event.original)||k(T.edge)},leaveEdge:T=>{Vc(T.event.original)||k(null)},clickStage:()=>_()})},[s,o,r,t]),E.useEffect(()=>{const g=u==="dark",w=g?dz:void 0,x=g?vz:void 0;i({nodeReducer:(k,C)=>{const _=n.getGraph(),T={...C,highlighted:C.highlighted||!1,labelColor:w};if(!e){T.highlighted=!1;const N=p||d,D=v||m;if(N)(k===N||_.neighbors(N).includes(k))&&(T.highlighted=!0,k===d&&(T.borderColor=gz));else if(D)_.extremities(D).includes(k)&&(T.highlighted=!0,T.size=3);else return T;T.highlighted?g&&(T.labelColor=hz):T.color=pz}return T},edgeReducer:(k,C)=>{const _=n.getGraph(),T={...C,hidden:!1,labelColor:w,color:x};if(!e){const N=p||d;N?f?_.extremities(k).includes(N)||(T.hidden=!0):_.extremities(k).includes(N)&&(T.color=Zw):(v||m)&&(k===m?T.color=yz:k===v?T.color=Zw:f&&(T.hidden=!0))}return T}})},[d,p,m,v,i,n,e,u,f]),null},Y6=()=>{const{zoomIn:e,zoomOut:t,reset:n}=xA({duration:200,factor:1.5}),r=E.useCallback(()=>e(),[e]),i=E.useCallback(()=>t(),[t]),o=E.useCallback(()=>n(),[n]);return S.jsxs(S.Fragment,{children:[S.jsx(Ot,{variant:Hr,onClick:r,tooltip:"Zoom In",size:"icon",children:S.jsx(lP,{})}),S.jsx(Ot,{variant:Hr,onClick:i,tooltip:"Zoom Out",size:"icon",children:S.jsx(uP,{})}),S.jsx(Ot,{variant:Hr,onClick:o,tooltip:"Reset Zoom",size:"icon",children:S.jsx(AM,{})})]})},W6=()=>{const{isFullScreen:e,toggle:t}=iB();return S.jsx(S.Fragment,{children:e?S.jsx(Ot,{variant:Hr,onClick:t,tooltip:"Windowed",size:"icon",children:S.jsx(IM,{})}):S.jsx(Ot,{variant:Hr,onClick:t,tooltip:"Full Screen",size:"icon",children:S.jsx(PM,{})})})};function eR(e){const t=E.useRef({value:e,previous:e});return E.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var Oy="Checkbox",[X6,pK]=hr(Oy),[K6,Z6]=X6(Oy),tR=E.forwardRef((e,t)=>{const{__scopeCheckbox:n,name:r,checked:i,defaultChecked:o,required:s,disabled:u,value:f="on",onCheckedChange:d,form:p,...m}=e,[v,g]=E.useState(null),w=dt(t,N=>g(N)),x=E.useRef(!1),k=v?p||!!v.closest("form"):!0,[C=!1,_]=_i({prop:i,defaultProp:o,onChange:d}),T=E.useRef(C);return E.useEffect(()=>{const N=v==null?void 0:v.form;if(N){const D=()=>_(T.current);return N.addEventListener("reset",D),()=>N.removeEventListener("reset",D)}},[v,_]),S.jsxs(K6,{scope:n,state:C,disabled:u,children:[S.jsx(We.button,{type:"button",role:"checkbox","aria-checked":la(C)?"mixed":C,"aria-required":s,"data-state":iR(C),"data-disabled":u?"":void 0,disabled:u,value:f,...m,ref:w,onKeyDown:qe(e.onKeyDown,N=>{N.key==="Enter"&&N.preventDefault()}),onClick:qe(e.onClick,N=>{_(D=>la(D)?!0:!D),k&&(x.current=N.isPropagationStopped(),x.current||N.stopPropagation())})}),k&&S.jsx(Q6,{control:v,bubbles:!x.current,name:r,value:f,checked:C,required:s,disabled:u,form:p,style:{transform:"translateX(-100%)"},defaultChecked:la(o)?!1:o})]})});tR.displayName=Oy;var nR="CheckboxIndicator",rR=E.forwardRef((e,t)=>{const{__scopeCheckbox:n,forceMount:r,...i}=e,o=Z6(nR,n);return S.jsx(Zn,{present:r||la(o.state)||o.state===!0,children:S.jsx(We.span,{"data-state":iR(o.state),"data-disabled":o.disabled?"":void 0,...i,ref:t,style:{pointerEvents:"none",...e.style}})})});rR.displayName=nR;var Q6=e=>{const{control:t,checked:n,bubbles:r=!0,defaultChecked:i,...o}=e,s=E.useRef(null),u=eR(n),f=DC(t);E.useEffect(()=>{const p=s.current,m=window.HTMLInputElement.prototype,g=Object.getOwnPropertyDescriptor(m,"checked").set;if(u!==n&&g){const w=new Event("click",{bubbles:r});p.indeterminate=la(n),g.call(p,la(n)?!1:n),p.dispatchEvent(w)}},[u,n,r]);const d=E.useRef(la(n)?!1:n);return S.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:i??d.current,...o,tabIndex:-1,ref:s,style:{...e.style,...f,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function la(e){return e==="indeterminate"}function iR(e){return la(e)?"indeterminate":e?"checked":"unchecked"}var aR=tR,J6=rR;const Bs=E.forwardRef(({className:e,...t},n)=>S.jsx(aR,{ref:n,className:Me("peer border-primary ring-offset-background focus-visible:ring-ring data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground h-4 w-4 shrink-0 rounded-sm border focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50",e),...t,children:S.jsx(J6,{className:Me("flex items-center justify-center text-current"),children:S.jsx(Lv,{className:"h-4 w-4"})})}));Bs.displayName=aR.displayName;var eH="Separator",sE="horizontal",tH=["horizontal","vertical"],oR=E.forwardRef((e,t)=>{const{decorative:n,orientation:r=sE,...i}=e,o=nH(r)?r:sE,u=n?{role:"none"}:{"aria-orientation":o==="vertical"?o:void 0,role:"separator"};return S.jsx(We.div,{"data-orientation":o,...u,...i,ref:t})});oR.displayName=eH;function nH(e){return tH.includes(e)}var lR=oR;const Fs=E.forwardRef(({className:e,orientation:t="horizontal",decorative:n=!0,...r},i)=>S.jsx(lR,{ref:i,decorative:n,orientation:t,className:Me("bg-border shrink-0",t==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",e),...r}));Fs.displayName=lR.displayName;const na=({checked:e,onCheckedChange:t,label:n})=>S.jsxs("div",{className:"flex items-center gap-2",children:[S.jsx(Bs,{checked:e,onCheckedChange:t}),S.jsx("label",{htmlFor:"terms",className:"text-sm leading-none font-medium peer-disabled:cursor-not-allowed peer-disabled:opacity-70",children:n})]});function rH(){const[e,t]=E.useState(!1),[n,r]=E.useState(""),i=Qe.use.showPropertyPanel(),o=Qe.use.showNodeSearchBar(),s=Qe.use.showNodeLabel(),u=Qe.use.enableEdgeEvents(),f=Qe.use.enableNodeDrag(),d=Qe.use.enableHideUnselectedEdges(),p=Qe.use.showEdgeLabel(),m=Qe.use.enableHealthCheck(),v=Qe.use.apiKey();E.useEffect(()=>{r(v||"")},[v,e]);const g=E.useCallback(()=>Qe.setState(R=>({enableNodeDrag:!R.enableNodeDrag})),[]),w=E.useCallback(()=>Qe.setState(R=>({enableEdgeEvents:!R.enableEdgeEvents})),[]),x=E.useCallback(()=>Qe.setState(R=>({enableHideUnselectedEdges:!R.enableHideUnselectedEdges})),[]),k=E.useCallback(()=>Qe.setState(R=>({showEdgeLabel:!R.showEdgeLabel})),[]),C=E.useCallback(()=>Qe.setState(R=>({showPropertyPanel:!R.showPropertyPanel})),[]),_=E.useCallback(()=>Qe.setState(R=>({showNodeSearchBar:!R.showNodeSearchBar})),[]),T=E.useCallback(()=>Qe.setState(R=>({showNodeLabel:!R.showNodeLabel})),[]),N=E.useCallback(()=>Qe.setState(R=>({enableHealthCheck:!R.enableHealthCheck})),[]),D=E.useCallback(async()=>{Qe.setState({apiKey:n||null}),await Mn.getState().check(),t(!1)},[n]),z=E.useCallback(R=>{r(R.target.value)},[r]);return S.jsxs(fd,{open:e,onOpenChange:t,children:[S.jsx(dd,{asChild:!0,children:S.jsx(Ot,{variant:Hr,tooltip:"Settings",size:"icon",children:S.jsx(JM,{})})}),S.jsx(uu,{side:"right",align:"start",className:"mb-2 p-2",onCloseAutoFocus:R=>R.preventDefault(),children:S.jsxs("div",{className:"flex flex-col gap-2",children:[S.jsx(na,{checked:i,onCheckedChange:C,label:"Show Property Panel"}),S.jsx(na,{checked:o,onCheckedChange:_,label:"Show Search Bar"}),S.jsx(Fs,{}),S.jsx(na,{checked:s,onCheckedChange:T,label:"Show Node Label"}),S.jsx(na,{checked:f,onCheckedChange:g,label:"Node Draggable"}),S.jsx(Fs,{}),S.jsx(na,{checked:p,onCheckedChange:k,label:"Show Edge Label"}),S.jsx(na,{checked:d,onCheckedChange:x,label:"Hide Unselected Edges"}),S.jsx(na,{checked:u,onCheckedChange:w,label:"Edge Events"}),S.jsx(Fs,{}),S.jsx(na,{checked:m,onCheckedChange:N,label:"Health Check"}),S.jsx(Fs,{}),S.jsxs("div",{className:"flex flex-col gap-2",children:[S.jsx("label",{className:"text-sm font-medium",children:"API Key"}),S.jsxs("form",{className:"flex h-6 gap-2",onSubmit:R=>R.preventDefault(),children:[S.jsx("div",{className:"w-0 flex-1",children:S.jsx(Za,{type:"password",value:n,onChange:z,placeholder:"Enter your API key",className:"max-h-full w-full min-w-0",autoComplete:"off"})}),S.jsx(Ot,{onClick:D,variant:"outline",size:"sm",className:"max-h-full shrink-0",children:"Save"})]})]})]})})]})}const iH="ENTRIES",sR="KEYS",uR="VALUES",sn="";class Hm{constructor(t,n){const r=t._tree,i=Array.from(r.keys());this.set=t,this._type=n,this._path=i.length>0?[{node:r,keys:i}]:[]}next(){const t=this.dive();return this.backtrack(),t}dive(){if(this._path.length===0)return{done:!0,value:void 0};const{node:t,keys:n}=Wo(this._path);if(Wo(n)===sn)return{done:!1,value:this.result()};const r=t.get(Wo(n));return this._path.push({node:r,keys:Array.from(r.keys())}),this.dive()}backtrack(){if(this._path.length===0)return;const t=Wo(this._path).keys;t.pop(),!(t.length>0)&&(this._path.pop(),this.backtrack())}key(){return this.set._prefix+this._path.map(({keys:t})=>Wo(t)).filter(t=>t!==sn).join("")}value(){return Wo(this._path).node.get(sn)}result(){switch(this._type){case uR:return this.value();case sR:return this.key();default:return[this.key(),this.value()]}}[Symbol.iterator](){return this}}const Wo=e=>e[e.length-1],aH=(e,t,n)=>{const r=new Map;if(t===void 0)return r;const i=t.length+1,o=i+n,s=new Uint8Array(o*i).fill(n+1);for(let u=0;u{const f=o*s;e:for(const d of e.keys())if(d===sn){const p=i[f-1];p<=n&&r.set(u,[e.get(d),p])}else{let p=o;for(let m=0;mn)continue e}cR(e.get(d),t,n,r,i,p,s,u+d)}};class oa{constructor(t=new Map,n=""){this._size=void 0,this._tree=t,this._prefix=n}atPrefix(t){if(!t.startsWith(this._prefix))throw new Error("Mismatched prefix");const[n,r]=Df(this._tree,t.slice(this._prefix.length));if(n===void 0){const[i,o]=Ly(r);for(const s of i.keys())if(s!==sn&&s.startsWith(o)){const u=new Map;return u.set(s.slice(o.length),i.get(s)),new oa(u,t)}}return new oa(n,t)}clear(){this._size=void 0,this._tree.clear()}delete(t){return this._size=void 0,oH(this._tree,t)}entries(){return new Hm(this,iH)}forEach(t){for(const[n,r]of this)t(n,r,this)}fuzzyGet(t,n){return aH(this._tree,t,n)}get(t){const n=Zg(this._tree,t);return n!==void 0?n.get(sn):void 0}has(t){const n=Zg(this._tree,t);return n!==void 0&&n.has(sn)}keys(){return new Hm(this,sR)}set(t,n){if(typeof t!="string")throw new Error("key must be a string");return this._size=void 0,$m(this._tree,t).set(sn,n),this}get size(){if(this._size)return this._size;this._size=0;const t=this.entries();for(;!t.next().done;)this._size+=1;return this._size}update(t,n){if(typeof t!="string")throw new Error("key must be a string");this._size=void 0;const r=$m(this._tree,t);return r.set(sn,n(r.get(sn))),this}fetch(t,n){if(typeof t!="string")throw new Error("key must be a string");this._size=void 0;const r=$m(this._tree,t);let i=r.get(sn);return i===void 0&&r.set(sn,i=n()),i}values(){return new Hm(this,uR)}[Symbol.iterator](){return this.entries()}static from(t){const n=new oa;for(const[r,i]of t)n.set(r,i);return n}static fromObject(t){return oa.from(Object.entries(t))}}const Df=(e,t,n=[])=>{if(t.length===0||e==null)return[e,n];for(const r of e.keys())if(r!==sn&&t.startsWith(r))return n.push([e,r]),Df(e.get(r),t.slice(r.length),n);return n.push([e,t]),Df(void 0,"",n)},Zg=(e,t)=>{if(t.length===0||e==null)return e;for(const n of e.keys())if(n!==sn&&t.startsWith(n))return Zg(e.get(n),t.slice(n.length))},$m=(e,t)=>{const n=t.length;e:for(let r=0;e&&r{const[n,r]=Df(e,t);if(n!==void 0){if(n.delete(sn),n.size===0)fR(r);else if(n.size===1){const[i,o]=n.entries().next().value;dR(r,i,o)}}},fR=e=>{if(e.length===0)return;const[t,n]=Ly(e);if(t.delete(n),t.size===0)fR(e.slice(0,-1));else if(t.size===1){const[r,i]=t.entries().next().value;r!==sn&&dR(e.slice(0,-1),r,i)}},dR=(e,t,n)=>{if(e.length===0)return;const[r,i]=Ly(e);r.set(i+t,n),r.delete(i)},Ly=e=>e[e.length-1],zy="or",hR="and",lH="and_not";class sa{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?Ym:t.autoVacuum;this._options={...qm,...t,autoVacuum:n,searchOptions:{...uE,...t.searchOptions||{}},autoSuggestOptions:{...dH,...t.autoSuggestOptions||{}}},this._index=new oa,this._documentCount=0,this._documentIds=new Map,this._idToShortId=new Map,this._fieldIds={},this._fieldLength=new Map,this._avgFieldLength=[],this._nextId=0,this._storedFields=new Map,this._dirtCount=0,this._currentVacuum=null,this._enqueuedVacuum=null,this._enqueuedVacuumConditions=Jg,this.addFields(this._options.fields)}add(t){const{extractField:n,tokenize:r,processTerm:i,fields:o,idField:s}=this._options,u=n(t,s);if(u==null)throw new Error(`MiniSearch: document does not have ID field "${s}"`);if(this._idToShortId.has(u))throw new Error(`MiniSearch: duplicate ID ${u}`);const f=this.addDocumentId(u);this.saveStoredFields(f,t);for(const d of o){const p=n(t,d);if(p==null)continue;const m=r(p.toString(),d),v=this._fieldIds[d],g=new Set(m).size;this.addFieldLength(f,v,this._documentCount-1,g);for(const w of m){const x=i(w,d);if(Array.isArray(x))for(const k of x)this.addTerm(v,f,k);else x&&this.addTerm(v,f,x)}}}addAll(t){for(const n of t)this.add(n)}addAllAsync(t,n={}){const{chunkSize:r=10}=n,i={chunk:[],promise:Promise.resolve()},{chunk:o,promise:s}=t.reduce(({chunk:u,promise:f},d,p)=>(u.push(d),(p+1)%r===0?{chunk:[],promise:f.then(()=>new Promise(m=>setTimeout(m,0))).then(()=>this.addAll(u))}:{chunk:u,promise:f}),i);return s.then(()=>this.addAll(o))}remove(t){const{tokenize:n,processTerm:r,extractField:i,fields:o,idField:s}=this._options,u=i(t,s);if(u==null)throw new Error(`MiniSearch: document does not have ID field "${s}"`);const f=this._idToShortId.get(u);if(f==null)throw new Error(`MiniSearch: cannot remove document with ID ${u}: it is not in the index`);for(const d of o){const p=i(t,d);if(p==null)continue;const m=n(p.toString(),d),v=this._fieldIds[d],g=new Set(m).size;this.removeFieldLength(f,v,this._documentCount,g);for(const w of m){const x=r(w,d);if(Array.isArray(x))for(const k of x)this.removeTerm(v,f,k);else x&&this.removeTerm(v,f,x)}}this._storedFields.delete(f),this._documentIds.delete(f),this._idToShortId.delete(u),this._fieldLength.delete(f),this._documentCount-=1}removeAll(t){if(t)for(const n of t)this.remove(n);else{if(arguments.length>0)throw new Error("Expected documents to be present. Omit the argument to remove all documents.");this._index=new oa,this._documentCount=0,this._documentIds=new Map,this._idToShortId=new Map,this._fieldLength=new Map,this._avgFieldLength=[],this._storedFields=new Map,this._nextId=0}}discard(t){const n=this._idToShortId.get(t);if(n==null)throw new Error(`MiniSearch: cannot discard document with ID ${t}: it is not in the index`);this._idToShortId.delete(t),this._documentIds.delete(n),this._storedFields.delete(n),(this._fieldLength.get(n)||[]).forEach((r,i)=>{this.removeFieldLength(n,i,this._documentCount,r)}),this._fieldLength.delete(n),this._documentCount-=1,this._dirtCount+=1,this.maybeAutoVacuum()}maybeAutoVacuum(){if(this._options.autoVacuum===!1)return;const{minDirtFactor:t,minDirtCount:n,batchSize:r,batchWait:i}=this._options.autoVacuum;this.conditionalVacuum({batchSize:r,batchWait:i},{minDirtCount:n,minDirtFactor:t})}discardAll(t){const n=this._options.autoVacuum;try{this._options.autoVacuum=!1;for(const r of t)this.discard(r)}finally{this._options.autoVacuum=n}this.maybeAutoVacuum()}replace(t){const{idField:n,extractField:r}=this._options,i=r(t,n);this.discard(i),this.add(t)}vacuum(t={}){return this.conditionalVacuum(t)}conditionalVacuum(t,n){return this._currentVacuum?(this._enqueuedVacuumConditions=this._enqueuedVacuumConditions&&n,this._enqueuedVacuum!=null?this._enqueuedVacuum:(this._enqueuedVacuum=this._currentVacuum.then(()=>{const r=this._enqueuedVacuumConditions;return this._enqueuedVacuumConditions=Jg,this.performVacuuming(t,r)}),this._enqueuedVacuum)):this.vacuumConditionsMet(n)===!1?Promise.resolve():(this._currentVacuum=this.performVacuuming(t),this._currentVacuum)}async performVacuuming(t,n){const r=this._dirtCount;if(this.vacuumConditionsMet(n)){const i=t.batchSize||Qg.batchSize,o=t.batchWait||Qg.batchWait;let s=1;for(const[u,f]of this._index){for(const[d,p]of f)for(const[m]of p)this._documentIds.has(m)||(p.size<=1?f.delete(d):p.delete(m));this._index.get(u).size===0&&this._index.delete(u),s%i===0&&await new Promise(d=>setTimeout(d,o)),s+=1}this._dirtCount-=r}await null,this._currentVacuum=this._enqueuedVacuum,this._enqueuedVacuum=null}vacuumConditionsMet(t){if(t==null)return!0;let{minDirtCount:n,minDirtFactor:r}=t;return n=n||Ym.minDirtCount,r=r||Ym.minDirtFactor,this.dirtCount>=n&&this.dirtFactor>=r}get isVacuuming(){return this._currentVacuum!=null}get dirtCount(){return this._dirtCount}get dirtFactor(){return this._dirtCount/(1+this._documentCount+this._dirtCount)}has(t){return this._idToShortId.has(t)}getStoredFields(t){const n=this._idToShortId.get(t);if(n!=null)return this._storedFields.get(n)}search(t,n={}){const{searchOptions:r}=this._options,i={...r,...n},o=this.executeQuery(t,n),s=[];for(const[u,{score:f,terms:d,match:p}]of o){const m=d.length||1,v={id:this._documentIds.get(u),score:f*m,terms:Object.keys(p),queryTerms:d,match:p};Object.assign(v,this._storedFields.get(u)),(i.filter==null||i.filter(v))&&s.push(v)}return t===sa.wildcard&&i.boostDocument==null||s.sort(fE),s}autoSuggest(t,n={}){n={...this._options.autoSuggestOptions,...n};const r=new Map;for(const{score:o,terms:s}of this.search(t,n)){const u=s.join(" "),f=r.get(u);f!=null?(f.score+=o,f.count+=1):r.set(u,{score:o,terms:s,count:1})}const i=[];for(const[o,{score:s,terms:u,count:f}]of r)i.push({suggestion:o,terms:u,score:s/f});return i.sort(fE),i}get documentCount(){return this._documentCount}get termCount(){return this._index.size}static loadJSON(t,n){if(n==null)throw new Error("MiniSearch: loadJSON should be given the same options used when serializing the index");return this.loadJS(JSON.parse(t),n)}static async loadJSONAsync(t,n){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(qm.hasOwnProperty(t))return Vm(qm,t);throw new Error(`MiniSearch: unknown option "${t}"`)}static loadJS(t,n){const{index:r,documentIds:i,fieldLength:o,storedFields:s,serializationVersion:u}=t,f=this.instantiateMiniSearch(t,n);f._documentIds=qc(i),f._fieldLength=qc(o),f._storedFields=qc(s);for(const[d,p]of f._documentIds)f._idToShortId.set(p,d);for(const[d,p]of r){const m=new Map;for(const v of Object.keys(p)){let g=p[v];u===1&&(g=g.ds),m.set(parseInt(v,10),qc(g))}f._index.set(d,m)}return f}static async loadJSAsync(t,n){const{index:r,documentIds:i,fieldLength:o,storedFields:s,serializationVersion:u}=t,f=this.instantiateMiniSearch(t,n);f._documentIds=await Yc(i),f._fieldLength=await Yc(o),f._storedFields=await Yc(s);for(const[p,m]of f._documentIds)f._idToShortId.set(m,p);let d=0;for(const[p,m]of r){const v=new Map;for(const g of Object.keys(m)){let w=m[g];u===1&&(w=w.ds),v.set(parseInt(g,10),await Yc(w))}++d%1e3===0&&await pR(0),f._index.set(p,v)}return f}static instantiateMiniSearch(t,n){const{documentCount:r,nextId:i,fieldIds:o,averageFieldLength:s,dirtCount:u,serializationVersion:f}=t;if(f!==1&&f!==2)throw new Error("MiniSearch: cannot deserialize an index created with an incompatible version");const d=new sa(n);return d._documentCount=r,d._nextId=i,d._idToShortId=new Map,d._fieldIds=o,d._avgFieldLength=s,d._dirtCount=u||0,d._index=new oa,d}executeQuery(t,n={}){if(t===sa.wildcard)return this.executeWildcardQuery(n);if(typeof t!="string"){const v={...n,...t,queries:void 0},g=t.queries.map(w=>this.executeQuery(w,v));return this.combineResults(g,v.combineWith)}const{tokenize:r,processTerm:i,searchOptions:o}=this._options,s={tokenize:r,processTerm:i,...o,...n},{tokenize:u,processTerm:f}=s,m=u(t).flatMap(v=>f(v)).filter(v=>!!v).map(fH(s)).map(v=>this.executeQuerySpec(v,s));return this.combineResults(m,s.combineWith)}executeQuerySpec(t,n){const r={...this._options.searchOptions,...n},i=(r.fields||this._options.fields).reduce((x,k)=>({...x,[k]:Vm(r.boost,k)||1}),{}),{boostDocument:o,weights:s,maxFuzzy:u,bm25:f}=r,{fuzzy:d,prefix:p}={...uE.weights,...s},m=this._index.get(t.term),v=this.termResults(t.term,t.term,1,t.termBoost,m,i,o,f);let g,w;if(t.prefix&&(g=this._index.atPrefix(t.term)),t.fuzzy){const x=t.fuzzy===!0?.2:t.fuzzy,k=x<1?Math.min(u,Math.round(t.term.length*x)):x;k&&(w=this._index.fuzzyGet(t.term,k))}if(g)for(const[x,k]of g){const C=x.length-t.term.length;if(!C)continue;w==null||w.delete(x);const _=p*x.length/(x.length+.3*C);this.termResults(t.term,x,_,t.termBoost,k,i,o,f,v)}if(w)for(const x of w.keys()){const[k,C]=w.get(x);if(!C)continue;const _=d*x.length/(x.length+C);this.termResults(t.term,x,_,t.termBoost,k,i,o,f,v)}return v}executeWildcardQuery(t){const n=new Map,r={...this._options.searchOptions,...t};for(const[i,o]of this._documentIds){const s=r.boostDocument?r.boostDocument(o,"",this._storedFields.get(i)):1;n.set(i,{score:s,terms:[],match:{}})}return n}combineResults(t,n=zy){if(t.length===0)return new Map;const r=n.toLowerCase(),i=sH[r];if(!i)throw new Error(`Invalid combination operator: ${n}`);return t.reduce(i)||new Map}toJSON(){const t=[];for(const[n,r]of this._index){const i={};for(const[o,s]of r)i[o]=Object.fromEntries(s);t.push([n,i])}return{documentCount:this._documentCount,nextId:this._nextId,documentIds:Object.fromEntries(this._documentIds),fieldIds:this._fieldIds,fieldLength:Object.fromEntries(this._fieldLength),averageFieldLength:this._avgFieldLength,storedFields:Object.fromEntries(this._storedFields),dirtCount:this._dirtCount,index:t,serializationVersion:2}}termResults(t,n,r,i,o,s,u,f,d=new Map){if(o==null)return d;for(const p of Object.keys(s)){const m=s[p],v=this._fieldIds[p],g=o.get(v);if(g==null)continue;let w=g.size;const x=this._avgFieldLength[v];for(const k of g.keys()){if(!this._documentIds.has(k)){this.removeTerm(v,k,n),w-=1;continue}const C=u?u(this._documentIds.get(k),n,this._storedFields.get(k)):1;if(!C)continue;const _=g.get(k),T=this._fieldLength.get(k)[v],N=cH(_,w,this._documentCount,T,x,f),D=r*i*m*C*N,z=d.get(k);if(z){z.score+=D,hH(z.terms,t);const R=Vm(z.match,n);R?R.push(p):z.match[n]=[p]}else d.set(k,{score:D,terms:[t],match:{[n]:[p]}})}}return d}addTerm(t,n,r){const i=this._index.fetch(r,dE);let o=i.get(t);if(o==null)o=new Map,o.set(n,1),i.set(t,o);else{const s=o.get(n);o.set(n,(s||0)+1)}}removeTerm(t,n,r){if(!this._index.has(r)){this.warnDocumentChanged(n,t,r);return}const i=this._index.fetch(r,dE),o=i.get(t);o==null||o.get(n)==null?this.warnDocumentChanged(n,t,r):o.get(n)<=1?o.size<=1?i.delete(t):o.delete(n):o.set(n,o.get(n)-1),this._index.get(r).size===0&&this._index.delete(r)}warnDocumentChanged(t,n,r){for(const i of Object.keys(this._fieldIds))if(this._fieldIds[i]===n){this._options.logger("warn",`MiniSearch: document with ID ${this._documentIds.get(t)} has changed before removal: term "${r}" was not present in field "${i}". Removing a document after it has changed can corrupt the index!`,"version_conflict");return}}addDocumentId(t){const n=this._nextId;return this._idToShortId.set(t,n),this._documentIds.set(n,t),this._documentCount+=1,this._nextId+=1,n}addFields(t){for(let n=0;nObject.prototype.hasOwnProperty.call(e,t)?e[t]:void 0,sH={[zy]:(e,t)=>{for(const n of t.keys()){const r=e.get(n);if(r==null)e.set(n,t.get(n));else{const{score:i,terms:o,match:s}=t.get(n);r.score=r.score+i,r.match=Object.assign(r.match,s),cE(r.terms,o)}}return e},[hR]:(e,t)=>{const n=new Map;for(const r of t.keys()){const i=e.get(r);if(i==null)continue;const{score:o,terms:s,match:u}=t.get(r);cE(i.terms,s),n.set(r,{score:i.score+o,terms:i.terms,match:Object.assign(i.match,u)})}return n},[lH]:(e,t)=>{for(const n of t.keys())e.delete(n);return e}},uH={k:1.2,b:.7,d:.5},cH=(e,t,n,r,i,o)=>{const{k:s,b:u,d:f}=o;return Math.log(1+(n-t+.5)/(t+.5))*(f+e*(s+1)/(e+s*(1-u+u*r/i)))},fH=e=>(t,n,r)=>{const i=typeof e.fuzzy=="function"?e.fuzzy(t,n,r):e.fuzzy||!1,o=typeof e.prefix=="function"?e.prefix(t,n,r):e.prefix===!0,s=typeof e.boostTerm=="function"?e.boostTerm(t,n,r):1;return{term:t,fuzzy:i,prefix:o,termBoost:s}},qm={idField:"id",extractField:(e,t)=>e[t],tokenize:e=>e.split(pH),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},uE={combineWith:zy,prefix:!1,fuzzy:!1,maxFuzzy:6,boost:{},weights:{fuzzy:.45,prefix:.375},bm25:uH},dH={combineWith:hR,prefix:(e,t,n)=>t===n.length-1},Qg={batchSize:1e3,batchWait:10},Jg={minDirtFactor:.1,minDirtCount:20},Ym={...Qg,...Jg},hH=(e,t)=>{e.includes(t)||e.push(t)},cE=(e,t)=>{for(const n of t)e.includes(n)||e.push(n)},fE=({score:e},{score:t})=>t-e,dE=()=>new Map,qc=e=>{const t=new Map;for(const n of Object.keys(e))t.set(parseInt(n,10),e[n]);return t},Yc=async e=>{const t=new Map;let n=0;for(const r of Object.keys(e))t.set(parseInt(r,10),e[r]),++n%1e3===0&&await pR(0);return t},pR=e=>new Promise(t=>setTimeout(t,e)),pH=/[\n\r\p{Z}\p{P}]+/u,mH={index:new sa({fields:[]})};E.createContext(mH);const ev=({label:e,color:t,hidden:n,labels:r={}})=>be.createElement("div",{className:"node"},be.createElement("span",{className:"render "+(n?"circle":"disc"),style:{backgroundColor:t||"#000"}}),be.createElement("span",{className:`label ${n?"text-muted":""} ${e?"":"text-italic"}`},e||r.no_label||"No label")),gH=({id:e,labels:t})=>{const n=pr(),r=E.useMemo(()=>{const i=n.getGraph().getNodeAttributes(e),o=n.getSetting("nodeReducer");return Object.assign(Object.assign({color:n.getSetting("defaultNodeColor")},i),o?o(e,i):{})},[n,e]);return be.createElement(ev,Object.assign({},r,{labels:t}))},vH=({label:e,color:t,source:n,target:r,hidden:i,directed:o,labels:s={}})=>be.createElement("div",{className:"edge"},be.createElement(ev,Object.assign({},n,{labels:s})),be.createElement("div",{className:"body"},be.createElement("div",{className:"render"},be.createElement("span",{className:i?"dotted":"dash",style:{borderColor:t||"#000"}})," ",o&&be.createElement("span",{className:"arrow",style:{borderTopColor:t||"#000"}})),be.createElement("span",{className:`label ${i?"text-muted":""} ${e?"":"fst-italic"}`},e||s.no_label||"No label")),be.createElement(ev,Object.assign({},r,{labels:s}))),yH=({id:e,labels:t})=>{const n=pr(),r=E.useMemo(()=>{const i=n.getGraph().getEdgeAttributes(e),o=n.getSetting("nodeReducer"),s=n.getSetting("edgeReducer"),u=n.getGraph().getNodeAttributes(n.getGraph().source(e)),f=n.getGraph().getNodeAttributes(n.getGraph().target(e));return Object.assign(Object.assign(Object.assign({color:n.getSetting("defaultEdgeColor"),directed:n.getGraph().isDirected(e)},i),s?s(e,i):{}),{source:Object.assign(Object.assign({color:n.getSetting("defaultNodeColor")},u),o?o(e,u):{}),target:Object.assign(Object.assign({color:n.getSetting("defaultNodeColor")},f),o?o(e,f):{})})},[n,e]);return be.createElement(vH,Object.assign({},r,{labels:t}))};function jy(e,t){const[n,r]=E.useState(e);return E.useEffect(()=>{const i=setTimeout(()=>{r(e)},t);return()=>{clearTimeout(i)}},[e,t]),n}function bH({fetcher:e,preload:t,filterFn:n,renderOption:r,getOptionValue:i,notFound:o,loadingSkeleton:s,label:u,placeholder:f="Select...",value:d,onChange:p,onFocus:m,disabled:v=!1,className:g,noResultsMessage:w}){const[x,k]=E.useState(!1),[C,_]=E.useState(!1),[T,N]=E.useState([]),[D,z]=E.useState(!1),[R,B]=E.useState(null),[P,j]=E.useState(d),[V,q]=E.useState(null),[I,Y]=E.useState(""),Z=jy(I,t?0:150),[U,G]=E.useState([]);E.useEffect(()=>{k(!0),j(d)},[d]),E.useEffect(()=>{x||(async()=>{try{z(!0),B(null);const $=d!==null?await e(d):[];G($),N($)}catch($){B($ instanceof Error?$.message:"Failed to fetch options")}finally{z(!1)}})()},[x,e,d]),E.useEffect(()=>{const A=async()=>{try{z(!0),B(null);const $=await e(Z);G($),N($)}catch($){B($ instanceof Error?$.message:"Failed to fetch options")}finally{z(!1)}};x&&t?t&&N(Z?U.filter($=>n?n($,Z):!0):U):A()},[e,Z,x,t,n]);const F=E.useCallback(A=>{A!==P&&(j(A),p(A)),_(!1)},[P,j,_,p]),K=E.useCallback(A=>{A!==V&&(q(A),m(A))},[V,q,m]);return S.jsx("div",{className:Me(v&&"cursor-not-allowed opacity-50",g),onFocus:()=>{_(!0)},onBlur:()=>_(!1),children:S.jsxs(yd,{shouldFilter:!1,className:"bg-transparent",children:[S.jsxs("div",{children:[S.jsx(Dy,{placeholder:f,value:I,className:"max-h-8",onValueChange:A=>{Y(A),A&&!C&&_(!0)}}),D&&T.length>0&&S.jsx("div",{className:"absolute top-1/2 right-2 flex -translate-y-1/2 transform items-center",children:S.jsx(Sk,{className:"h-4 w-4 animate-spin"})})]}),S.jsxs(bd,{hidden:!C||Z.length===0,children:[R&&S.jsx("div",{className:"text-destructive p-4 text-center",children:R}),D&&T.length===0&&(s||S.jsx(xH,{})),!D&&!R&&T.length===0&&(o||S.jsx(Ny,{children:w??`No ${u.toLowerCase()} found.`})),S.jsx(Cl,{children:T.map((A,$)=>S.jsxs(S.Fragment,{children:[S.jsx(Tl,{value:i(A),onSelect:F,onMouseEnter:()=>K(i(A)),className:"truncate",children:r(A)},i(A)+`${$}`),$!==T.length-1&&S.jsx("div",{className:"bg-foreground/10 h-[1px]"},$)]}))})]})]})})}function xH(){return S.jsx(Cl,{children:S.jsx(Tl,{disabled:!0,children:S.jsxs("div",{className:"flex w-full items-center gap-2",children:[S.jsx("div",{className:"bg-muted h-6 w-6 animate-pulse rounded-full"}),S.jsxs("div",{className:"flex flex-1 flex-col gap-1",children:[S.jsx("div",{className:"bg-muted h-4 w-24 animate-pulse rounded"}),S.jsx("div",{className:"bg-muted h-3 w-16 animate-pulse rounded"})]})]})})})}function wH(e){return S.jsxs("div",{children:[e.type==="nodes"&&S.jsx(gH,{id:e.id}),e.type==="edges"&&S.jsx(yH,{id:e.id}),e.type==="message"&&S.jsx("div",{children:e.message})]})}const Wm="__message_item",Wc={graph:null,searchEngine:null},SH=({onChange:e,onFocus:t,value:n})=>{const r=yt.use.sigmaGraph(),i=E.useMemo(()=>{if(Wc.graph==r)return Wc.searchEngine;if(!r||r.nodes().length==0)return;Wc.graph=r;const s=new sa({idField:"id",fields:["label"],searchOptions:{prefix:!0,fuzzy:.2,boost:{label:2}}}),u=r.nodes().map(f=>({id:f,label:r.getNodeAttribute(f,"label")}));return s.addAll(u),Wc.searchEngine=s,s},[r]),o=E.useCallback(async s=>{if(t&&t(null),!s||!i)return[];const u=i.search(s).map(f=>({id:f.id,type:"nodes"}));return u.length<=$p?u:[...u.slice(0,$p),{type:"message",id:Wm,message:`And ${u.length-$p} others`}]},[i,t]);return S.jsx(bH,{className:"bg-background/60 w-24 rounded-xl border-1 opacity-60 backdrop-blur-lg transition-all hover:w-fit hover:opacity-100",fetcher:o,renderOption:wH,getOptionValue:s=>s.id,value:n&&n.type!=="message"?n.id:null,onChange:s=>{s!==Wm&&e(s?{id:s,type:"nodes"}:null)},onFocus:s=>{s!==Wm&&t&&t(s?{id:s,type:"nodes"}:null)},label:"item",placeholder:"Search nodes..."})},EH=({...e})=>S.jsx(SH,{...e});function _H({fetcher:e,preload:t,filterFn:n,renderOption:r,getOptionValue:i,getDisplayValue:o,notFound:s,loadingSkeleton:u,label:f,placeholder:d="Select...",value:p,onChange:m,disabled:v=!1,className:g,triggerClassName:w,searchInputClassName:x,noResultsMessage:k,triggerTooltip:C,clearable:_=!0}){const[T,N]=E.useState(!1),[D,z]=E.useState(!1),[R,B]=E.useState([]),[P,j]=E.useState(!1),[V,q]=E.useState(null),[I,Y]=E.useState(p),[Z,U]=E.useState(null),[G,F]=E.useState(""),K=jy(G,t?0:150),[A,$]=E.useState([]);E.useEffect(()=>{N(!0),Y(p)},[p]),E.useEffect(()=>{if(p&&R.length>0){const O=R.find(X=>i(X)===p);O&&U(O)}},[p,R,i]),E.useEffect(()=>{T||(async()=>{try{j(!0),q(null);const X=await e(p);$(X),B(X)}catch(X){q(X instanceof Error?X.message:"Failed to fetch options")}finally{j(!1)}})()},[T,e,p]),E.useEffect(()=>{const O=async()=>{try{j(!0),q(null);const X=await e(K);$(X),B(X)}catch(X){q(X instanceof Error?X.message:"Failed to fetch options")}finally{j(!1)}};T&&t?t&&B(K?A.filter(X=>n?n(X,K):!0):A):O()},[e,K,T,t,n]);const M=E.useCallback(O=>{const X=_&&O===I?"":O;Y(X),U(R.find(re=>i(re)===X)||null),m(X),z(!1)},[I,m,_,R,i]);return S.jsxs(fd,{open:D,onOpenChange:z,children:[S.jsx(dd,{asChild:!0,children:S.jsxs(Ot,{variant:"outline",role:"combobox","aria-expanded":D,className:Me("justify-between",v&&"cursor-not-allowed opacity-50",w),disabled:v,tooltip:C,side:"bottom",children:[Z?o(Z):d,S.jsx(bM,{className:"opacity-50",size:10})]})}),S.jsx(uu,{className:Me("p-0",g),onCloseAutoFocus:O=>O.preventDefault(),children:S.jsxs(yd,{shouldFilter:!1,children:[S.jsxs("div",{className:"relative w-full border-b",children:[S.jsx(Dy,{placeholder:`Search ${f.toLowerCase()}...`,value:G,onValueChange:O=>{F(O)},className:x}),P&&R.length>0&&S.jsx("div",{className:"absolute top-1/2 right-2 flex -translate-y-1/2 transform items-center",children:S.jsx(Sk,{className:"h-4 w-4 animate-spin"})})]}),S.jsxs(bd,{children:[V&&S.jsx("div",{className:"text-destructive p-4 text-center",children:V}),P&&R.length===0&&(u||S.jsx(kH,{})),!P&&!V&&R.length===0&&(s||S.jsx(Ny,{children:k??`No ${f.toLowerCase()} found.`})),S.jsx(Cl,{children:R.map(O=>S.jsxs(Tl,{value:i(O),onSelect:M,className:"truncate",children:[r(O),S.jsx(Lv,{className:Me("ml-auto h-3 w-3",I===i(O)?"opacity-100":"opacity-0")})]},i(O)))})]})]})})]})}function kH(){return S.jsx(Cl,{children:S.jsx(Tl,{disabled:!0,children:S.jsxs("div",{className:"flex w-full items-center gap-2",children:[S.jsx("div",{className:"bg-muted h-6 w-6 animate-pulse rounded-full"}),S.jsxs("div",{className:"flex flex-1 flex-col gap-1",children:[S.jsx("div",{className:"bg-muted h-4 w-24 animate-pulse rounded"}),S.jsx("div",{className:"bg-muted h-3 w-16 animate-pulse rounded"})]})]})})})}const CH=()=>{const e=Qe.use.queryLabel(),[t,n]=E.useState({labels:[],searchEngine:null}),[r,i]=E.useState(!1),o=E.useCallback(async u=>{let f=t.labels,d=t.searchEngine;if(!r||!d){f=["*"].concat(await rM()),f.includes(Qe.getState().queryLabel)||Qe.getState().setQueryLabel(f[0]),d=new sa({idField:"id",fields:["value"],searchOptions:{prefix:!0,fuzzy:.2,boost:{label:2}}});const p=f.map((m,v)=>({id:v,value:m}));d.addAll(p),n({labels:f,searchEngine:d}),i(!0)}return u?d.search(u).map(p=>f[p.id]):f},[t,r,n,i]),s=E.useCallback(u=>{Qe.getState().setQueryLabel(u)},[]);return S.jsx(_H,{className:"ml-2",triggerClassName:"max-h-8",searchInputClassName:"max-h-8",triggerTooltip:"Select query label",fetcher:o,renderOption:u=>S.jsx("div",{children:u}),getOptionValue:u=>u,getDisplayValue:u=>S.jsx("div",{children:u}),notFound:S.jsx("div",{className:"py-6 text-center text-sm",children:"No labels found"}),label:"Label",placeholder:"Search labels...",value:e!==null?e:"",onChange:s})},Ln=({text:e,className:t,tooltipClassName:n,tooltip:r,side:i,onClick:o})=>r?S.jsx(WC,{delayDuration:200,children:S.jsxs(XC,{children:[S.jsx(KC,{asChild:!0,children:S.jsx("label",{className:Me(t,o!==void 0?"cursor-pointer":void 0),onClick:o,children:e})}),S.jsx(ly,{side:i,className:n,children:r})]})}):S.jsx("label",{className:Me(t,o!==void 0?"cursor-pointer":void 0),onClick:o,children:e}),TH=()=>{const{getNode:e,getEdge:t}=JA(),n=yt.use.selectedNode(),r=yt.use.focusedNode(),i=yt.use.selectedEdge(),o=yt.use.focusedEdge(),[s,u]=E.useState(null),[f,d]=E.useState(null);return E.useEffect(()=>{let p=null,m=null;r?(p="node",m=e(r)):n?(p="node",m=e(n)):o?(p="edge",m=t(o,!0)):i&&(p="edge",m=t(i,!0)),m?(p=="node"?u(AH(m)):u(RH(m)),d(p)):(u(null),d(null))},[r,n,o,i,u,d,e,t]),s?S.jsx("div",{className:"bg-background/80 max-w-xs rounded-lg border-2 p-2 text-xs backdrop-blur-lg",children:f=="node"?S.jsx(DH,{node:s}):S.jsx(NH,{edge:s})}):S.jsx(S.Fragment,{})},AH=e=>{const t=yt.getState(),n=[];if(t.sigmaGraph&&t.rawGraph)for(const r of t.sigmaGraph.edges(e.id)){const i=t.rawGraph.getEdge(r,!0);if(i){const o=e.id===i.source,s=o?i.target:i.source,u=t.rawGraph.getNode(s);u&&n.push({type:o?"Target":"Source",id:s,label:u.labels.join(", ")})}}return{...e,relationships:n}},RH=e=>{var i,o;const t=yt.getState(),n=(i=t.rawGraph)==null?void 0:i.getNode(e.source),r=(o=t.rawGraph)==null?void 0:o.getNode(e.target);return{...e,sourceNode:n,targetNode:r}},Ur=({name:e,value:t,onClick:n,tooltip:r})=>S.jsxs("div",{className:"flex items-center gap-2",children:[S.jsx("label",{className:"text-primary/60 tracking-wide",children:e}),":",S.jsx(Ln,{className:"hover:bg-primary/20 rounded p-1 text-ellipsis",tooltipClassName:"max-w-80",text:t,tooltip:r||t,side:"left",onClick:n})]}),DH=({node:e})=>S.jsxs("div",{className:"flex flex-col gap-2",children:[S.jsx("label",{className:"text-md pl-1 font-bold tracking-wide text-sky-300",children:"Node"}),S.jsxs("div",{className:"bg-primary/5 max-h-96 overflow-auto rounded p-1",children:[S.jsx(Ur,{name:"Id",value:e.id}),S.jsx(Ur,{name:"Labels",value:e.labels.join(", "),onClick:()=>{yt.getState().setSelectedNode(e.id,!0)}}),S.jsx(Ur,{name:"Degree",value:e.degree})]}),S.jsx("label",{className:"text-md pl-1 font-bold tracking-wide text-yellow-400/90",children:"Properties"}),S.jsx("div",{className:"bg-primary/5 max-h-96 overflow-auto rounded p-1",children:Object.keys(e.properties).sort().map(t=>S.jsx(Ur,{name:t,value:e.properties[t]},t))}),e.relationships.length>0&&S.jsxs(S.Fragment,{children:[S.jsx("label",{className:"text-md pl-1 font-bold tracking-wide text-teal-600/90",children:"Relationships"}),S.jsx("div",{className:"bg-primary/5 max-h-96 overflow-auto rounded p-1",children:e.relationships.map(({type:t,id:n,label:r})=>S.jsx(Ur,{name:t,value:r,onClick:()=>{yt.getState().setSelectedNode(n,!0)}},n))})]})]}),NH=({edge:e})=>S.jsxs("div",{className:"flex flex-col gap-2",children:[S.jsx("label",{className:"text-md pl-1 font-bold tracking-wide text-teal-600",children:"Relationship"}),S.jsxs("div",{className:"bg-primary/5 max-h-96 overflow-auto rounded p-1",children:[S.jsx(Ur,{name:"Id",value:e.id}),e.type&&S.jsx(Ur,{name:"Type",value:e.type}),S.jsx(Ur,{name:"Source",value:e.sourceNode?e.sourceNode.labels.join(", "):e.source,onClick:()=>{yt.getState().setSelectedNode(e.source,!0)}}),S.jsx(Ur,{name:"Target",value:e.targetNode?e.targetNode.labels.join(", "):e.target,onClick:()=>{yt.getState().setSelectedNode(e.target,!0)}})]}),S.jsx("label",{className:"text-md pl-1 font-bold tracking-wide text-yellow-400/90",children:"Properties"}),S.jsx("div",{className:"bg-primary/5 max-h-96 overflow-auto rounded p-1",children:Object.keys(e.properties).sort().map(t=>S.jsx(Ur,{name:t,value:e.properties[t]},t))})]}),hE={allowInvalidContainer:!0,defaultNodeType:"default",defaultEdgeType:"curvedArrow",renderEdgeLabels:!1,edgeProgramClasses:{arrow:fA,curvedArrow:tU,curvedNoArrow:eU},nodeProgramClasses:{default:PB,circel:fu,point:fB},labelGridCellSize:60,labelRenderedSizeThreshold:12,enableEdgeEvents:!0,labelColor:{color:"#000",attribute:"labelColor"},edgeLabelColor:{color:"#000",attribute:"labelColor"},edgeLabelSize:8,labelSize:12},OH=()=>{const e=bA(),t=pr(),[n,r]=E.useState(null);return E.useEffect(()=>{e({downNode:i=>{r(i.node),t.getGraph().setNodeAttribute(i.node,"highlighted",!0)},mousemovebody:i=>{if(!n)return;const o=t.viewportToGraph(i);t.getGraph().setNodeAttribute(n,"x",o.x),t.getGraph().setNodeAttribute(n,"y",o.y),i.preventSigmaDefault(),i.original.preventDefault(),i.original.stopPropagation()},mouseup:()=>{n&&(r(null),t.getGraph().removeNodeAttribute(n,"highlighted"))},mousedown:()=>{t.getCustomBBox()||t.setCustomBBox(t.getBBox())}})},[e,t,n]),null},LH=()=>{const[e,t]=E.useState(hE),n=yt.use.selectedNode(),r=yt.use.focusedNode(),i=yt.use.moveToSelectedNode(),o=Qe.use.showPropertyPanel(),s=Qe.use.showNodeSearchBar(),u=Qe.use.showNodeLabel(),f=Qe.use.enableEdgeEvents(),d=Qe.use.enableNodeDrag(),p=Qe.use.showEdgeLabel();E.useEffect(()=>{t({...hE,enableEdgeEvents:f,renderEdgeLabels:p,renderLabels:u})},[u,f,p]);const m=E.useCallback(x=>{x===null?yt.getState().setFocusedNode(null):x.type==="nodes"&&yt.getState().setFocusedNode(x.id)},[]),v=E.useCallback(x=>{x===null?yt.getState().setSelectedNode(null):x.type==="nodes"&&yt.getState().setSelectedNode(x.id,!0)},[]),g=E.useMemo(()=>r??n,[r,n]),w=E.useMemo(()=>n?{type:"nodes",id:n}:null,[n]);return S.jsxs(aB,{settings:e,className:"!bg-background !size-full overflow-hidden",children:[S.jsx(q6,{}),d&&S.jsx(OH,{}),S.jsx(iU,{node:g,move:i}),S.jsxs("div",{className:"absolute top-2 left-2 flex items-start gap-2",children:[S.jsx(CH,{}),s&&S.jsx(EH,{value:w,onFocus:m,onChange:v})]}),S.jsxs("div",{className:"bg-background/60 absolute bottom-2 left-2 flex flex-col rounded-xl border-2 backdrop-blur-lg",children:[S.jsx(rH,{}),S.jsx(Y6,{}),S.jsx(S6,{}),S.jsx(W6,{})]}),o&&S.jsx("div",{className:"absolute top-2 right-2",children:S.jsx(TH,{})})]})},mR=E.forwardRef(({className:e,...t},n)=>S.jsx("div",{className:"relative w-full overflow-auto",children:S.jsx("table",{ref:n,className:Me("w-full caption-bottom text-sm",e),...t})}));mR.displayName="Table";const gR=E.forwardRef(({className:e,...t},n)=>S.jsx("thead",{ref:n,className:Me("[&_tr]:border-b",e),...t}));gR.displayName="TableHeader";const vR=E.forwardRef(({className:e,...t},n)=>S.jsx("tbody",{ref:n,className:Me("[&_tr:last-child]:border-0",e),...t}));vR.displayName="TableBody";const zH=E.forwardRef(({className:e,...t},n)=>S.jsx("tfoot",{ref:n,className:Me("bg-muted/50 border-t font-medium [&>tr]:last:border-b-0",e),...t}));zH.displayName="TableFooter";const tv=E.forwardRef(({className:e,...t},n)=>S.jsx("tr",{ref:n,className:Me("hover:bg-muted/50 data-[state=selected]:bg-muted border-b transition-colors",e),...t}));tv.displayName="TableRow";const bi=E.forwardRef(({className:e,...t},n)=>S.jsx("th",{ref:n,className:Me("text-muted-foreground h-10 px-2 text-left align-middle font-medium [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...t}));bi.displayName="TableHead";const xi=E.forwardRef(({className:e,...t},n)=>S.jsx("td",{ref:n,className:Me("p-2 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...t}));xi.displayName="TableCell";const jH=E.forwardRef(({className:e,...t},n)=>S.jsx("caption",{ref:n,className:Me("text-muted-foreground mt-4 text-sm",e),...t}));jH.displayName="TableCaption";const Ks=E.forwardRef(({className:e,...t},n)=>S.jsx("div",{ref:n,className:Me("bg-card text-card-foreground rounded-xl border shadow",e),...t}));Ks.displayName="Card";const Nf=E.forwardRef(({className:e,...t},n)=>S.jsx("div",{ref:n,className:Me("flex flex-col space-y-1.5 p-6",e),...t}));Nf.displayName="CardHeader";const Zs=E.forwardRef(({className:e,...t},n)=>S.jsx("div",{ref:n,className:Me("leading-none font-semibold tracking-tight",e),...t}));Zs.displayName="CardTitle";const xd=E.forwardRef(({className:e,...t},n)=>S.jsx("div",{ref:n,className:Me("text-muted-foreground text-sm",e),...t}));xd.displayName="CardDescription";const Of=E.forwardRef(({className:e,...t},n)=>S.jsx("div",{ref:n,className:Me("p-6 pt-0",e),...t}));Of.displayName="CardContent";const MH=E.forwardRef(({className:e,...t},n)=>S.jsx("div",{ref:n,className:Me("flex items-center p-6 pt-0",e),...t}));MH.displayName="CardFooter";function PH({title:e,description:t,icon:n=CM,action:r,className:i,...o}){return S.jsxs(Ks,{className:Me("flex w-full flex-col items-center justify-center space-y-6 bg-transparent p-16",i),...o,children:[S.jsx("div",{className:"mr-4 shrink-0 rounded-full border border-dashed p-4",children:S.jsx(n,{className:"text-muted-foreground size-8","aria-hidden":"true"})}),S.jsxs("div",{className:"flex flex-col items-center gap-1.5 text-center",children:[S.jsx(Zs,{children:e}),t?S.jsx(xd,{children:t}):null]}),r||null]})}var Xm={exports:{}},Km,pE;function FH(){if(pE)return Km;pE=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return Km=e,Km}var Zm,mE;function IH(){if(mE)return Zm;mE=1;var e=FH();function t(){}function n(){}return n.resetWarningCache=t,Zm=function(){function r(s,u,f,d,p,m){if(m!==e){var v=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw v.name="Invariant Violation",v}}r.isRequired=r;function i(){return r}var o={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:i,element:r,elementType:r,instanceOf:i,node:r,objectOf:i,oneOf:i,oneOfType:i,shape:i,exact:i,checkPropTypes:n,resetWarningCache:t};return o.PropTypes=o,o},Zm}var gE;function GH(){return gE||(gE=1,Xm.exports=IH()()),Xm.exports}var BH=GH();const Ct=fn(BH),UH=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 dl(e,t,n){const r=HH(e),{webkitRelativePath:i}=e,o=typeof t=="string"?t:typeof i=="string"&&i.length>0?i:`./${e.name}`;return typeof r.path!="string"&&vE(r,"path",o),vE(r,"relativePath",o),r}function HH(e){const{name:t}=e;if(t&&t.lastIndexOf(".")!==-1&&!e.type){const r=t.split(".").pop().toLowerCase(),i=UH.get(r);i&&Object.defineProperty(e,"type",{value:i,writable:!1,configurable:!1,enumerable:!0})}return e}function vE(e,t,n){Object.defineProperty(e,t,{value:n,writable:!1,configurable:!1,enumerable:!0})}const $H=[".DS_Store","Thumbs.db"];function VH(e){return no(this,void 0,void 0,function*(){return Lf(e)&&qH(e.dataTransfer)?KH(e.dataTransfer,e.type):YH(e)?WH(e):Array.isArray(e)&&e.every(t=>"getFile"in t&&typeof t.getFile=="function")?XH(e):[]})}function qH(e){return Lf(e)}function YH(e){return Lf(e)&&Lf(e.target)}function Lf(e){return typeof e=="object"&&e!==null}function WH(e){return nv(e.target.files).map(t=>dl(t))}function XH(e){return no(this,void 0,void 0,function*(){return(yield Promise.all(e.map(n=>n.getFile()))).map(n=>dl(n))})}function KH(e,t){return no(this,void 0,void 0,function*(){if(e.items){const n=nv(e.items).filter(i=>i.kind==="file");if(t!=="drop")return n;const r=yield Promise.all(n.map(ZH));return yE(yR(r))}return yE(nv(e.files).map(n=>dl(n)))})}function yE(e){return e.filter(t=>$H.indexOf(t.name)===-1)}function nv(e){if(e===null)return[];const t=[];for(let n=0;n[...t,...Array.isArray(n)?yR(n):[n]],[])}function bE(e,t){return no(this,void 0,void 0,function*(){var n;if(globalThis.isSecureContext&&typeof e.getAsFileSystemHandle=="function"){const o=yield e.getAsFileSystemHandle();if(o===null)throw new Error(`${e} is not a File`);if(o!==void 0){const s=yield o.getFile();return s.handle=o,dl(s)}}const r=e.getAsFile();if(!r)throw new Error(`${e} is not a File`);return dl(r,(n=t==null?void 0:t.fullPath)!==null&&n!==void 0?n:void 0)})}function QH(e){return no(this,void 0,void 0,function*(){return e.isDirectory?bR(e):JH(e)})}function bR(e){const t=e.createReader();return new Promise((n,r)=>{const i=[];function o(){t.readEntries(s=>no(this,void 0,void 0,function*(){if(s.length){const u=Promise.all(s.map(QH));i.push(u),o()}else try{const u=yield Promise.all(i);n(u)}catch(u){r(u)}}),s=>{r(s)})}o()})}function JH(e){return no(this,void 0,void 0,function*(){return new Promise((t,n)=>{e.file(r=>{const i=dl(r,e.fullPath);t(i)},r=>{n(r)})})})}var Xc={},xE;function e$(){return xE||(xE=1,Xc.__esModule=!0,Xc.default=function(e,t){if(e&&t){var n=Array.isArray(t)?t:t.split(",");if(n.length===0)return!0;var r=e.name||"",i=(e.type||"").toLowerCase(),o=i.replace(/\/.*$/,"");return n.some(function(s){var u=s.trim().toLowerCase();return u.charAt(0)==="."?r.toLowerCase().endsWith(u):u.endsWith("/*")?o===u.replace(/\/.*$/,""):i===u})}return!0}),Xc}var t$=e$();const Qm=fn(t$);function wE(e){return i$(e)||r$(e)||wR(e)||n$()}function n$(){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 r$(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function i$(e){if(Array.isArray(e))return rv(e)}function SE(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function EE(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&arguments[0]!==void 0?arguments[0]:"",n=t.split(","),r=n.length>1?"one of ".concat(n.join(", ")):n[0];return{code:u$,message:"File type must be ".concat(r)}},_E=function(t){return{code:c$,message:"File is larger than ".concat(t," ").concat(t===1?"byte":"bytes")}},kE=function(t){return{code:f$,message:"File is smaller than ".concat(t," ").concat(t===1?"byte":"bytes")}},p$={code:d$,message:"Too many files"};function SR(e,t){var n=e.type==="application/x-moz-file"||s$(e,t);return[n,n?null:h$(t)]}function ER(e,t,n){if($a(e.size))if($a(t)&&$a(n)){if(e.size>n)return[!1,_E(n)];if(e.sizen)return[!1,_E(n)]}return[!0,null]}function $a(e){return e!=null}function m$(e){var t=e.files,n=e.accept,r=e.minSize,i=e.maxSize,o=e.multiple,s=e.maxFiles,u=e.validator;return!o&&t.length>1||o&&s>=1&&t.length>s?!1:t.every(function(f){var d=SR(f,n),p=Qs(d,1),m=p[0],v=ER(f,r,i),g=Qs(v,1),w=g[0],x=u?u(f):null;return m&&w&&!x})}function zf(e){return typeof e.isPropagationStopped=="function"?e.isPropagationStopped():typeof e.cancelBubble<"u"?e.cancelBubble:!1}function Kc(e){return e.dataTransfer?Array.prototype.some.call(e.dataTransfer.types,function(t){return t==="Files"||t==="application/x-moz-file"}):!!e.target&&!!e.target.files}function CE(e){e.preventDefault()}function g$(e){return e.indexOf("MSIE")!==-1||e.indexOf("Trident/")!==-1}function v$(e){return e.indexOf("Edge/")!==-1}function y$(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:window.navigator.userAgent;return g$(e)||v$(e)}function Ir(){for(var e=arguments.length,t=new Array(e),n=0;n1?i-1:0),s=1;se.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function j$(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,o;for(o=0;o=0)&&(n[i]=e[i]);return n}var wd=E.forwardRef(function(e,t){var n=e.children,r=jf(e,_$),i=M$(r),o=i.open,s=jf(i,k$);return E.useImperativeHandle(t,function(){return{open:o}},[o]),be.createElement(E.Fragment,null,n(jt(jt({},s),{},{open:o})))});wd.displayName="Dropzone";var TR={disabled:!1,getFilesFromEvent:VH,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};wd.defaultProps=TR;wd.propTypes={children:Ct.func,accept:Ct.objectOf(Ct.arrayOf(Ct.string)),multiple:Ct.bool,preventDropOnDocument:Ct.bool,noClick:Ct.bool,noKeyboard:Ct.bool,noDrag:Ct.bool,noDragEventsBubbling:Ct.bool,minSize:Ct.number,maxSize:Ct.number,maxFiles:Ct.number,disabled:Ct.bool,getFilesFromEvent:Ct.func,onFileDialogCancel:Ct.func,onFileDialogOpen:Ct.func,useFsAccessApi:Ct.bool,autoFocus:Ct.bool,onDragEnter:Ct.func,onDragLeave:Ct.func,onDragOver:Ct.func,onDrop:Ct.func,onDropAccepted:Ct.func,onDropRejected:Ct.func,onError:Ct.func,validator:Ct.func};var ov={isFocused:!1,isFileDialogActive:!1,isDragActive:!1,isDragAccept:!1,isDragReject:!1,acceptedFiles:[],fileRejections:[]};function M$(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=jt(jt({},TR),e),n=t.accept,r=t.disabled,i=t.getFilesFromEvent,o=t.maxSize,s=t.minSize,u=t.multiple,f=t.maxFiles,d=t.onDragEnter,p=t.onDragLeave,m=t.onDragOver,v=t.onDrop,g=t.onDropAccepted,w=t.onDropRejected,x=t.onFileDialogCancel,k=t.onFileDialogOpen,C=t.useFsAccessApi,_=t.autoFocus,T=t.preventDropOnDocument,N=t.noClick,D=t.noKeyboard,z=t.noDrag,R=t.noDragEventsBubbling,B=t.onError,P=t.validator,j=E.useMemo(function(){return w$(n)},[n]),V=E.useMemo(function(){return x$(n)},[n]),q=E.useMemo(function(){return typeof k=="function"?k:AE},[k]),I=E.useMemo(function(){return typeof x=="function"?x:AE},[x]),Y=E.useRef(null),Z=E.useRef(null),U=E.useReducer(P$,ov),G=Jm(U,2),F=G[0],K=G[1],A=F.isFocused,$=F.isFileDialogActive,M=E.useRef(typeof window<"u"&&window.isSecureContext&&C&&b$()),O=function(){!M.current&&$&&setTimeout(function(){if(Z.current){var Ne=Z.current.files;Ne.length||(K({type:"closeDialog"}),I())}},300)};E.useEffect(function(){return window.addEventListener("focus",O,!1),function(){window.removeEventListener("focus",O,!1)}},[Z,$,I,M]);var X=E.useRef([]),re=function(Ne){Y.current&&Y.current.contains(Ne.target)||(Ne.preventDefault(),X.current=[])};E.useEffect(function(){return T&&(document.addEventListener("dragover",CE,!1),document.addEventListener("drop",re,!1)),function(){T&&(document.removeEventListener("dragover",CE),document.removeEventListener("drop",re))}},[Y,T]),E.useEffect(function(){return!r&&_&&Y.current&&Y.current.focus(),function(){}},[Y,_,r]);var ue=E.useCallback(function(ve){B?B(ve):console.error(ve)},[B]),ae=E.useCallback(function(ve){ve.preventDefault(),ve.persist(),Se(ve),X.current=[].concat(A$(X.current),[ve.target]),Kc(ve)&&Promise.resolve(i(ve)).then(function(Ne){if(!(zf(ve)&&!R)){var te=Ne.length,de=te>0&&m$({files:Ne,accept:j,minSize:s,maxSize:o,multiple:u,maxFiles:f,validator:P}),Oe=te>0&&!de;K({isDragAccept:de,isDragReject:Oe,isDragActive:!0,type:"setDraggedFiles"}),d&&d(ve)}}).catch(function(Ne){return ue(Ne)})},[i,d,ue,R,j,s,o,u,f,P]),oe=E.useCallback(function(ve){ve.preventDefault(),ve.persist(),Se(ve);var Ne=Kc(ve);if(Ne&&ve.dataTransfer)try{ve.dataTransfer.dropEffect="copy"}catch{}return Ne&&m&&m(ve),!1},[m,R]),Ce=E.useCallback(function(ve){ve.preventDefault(),ve.persist(),Se(ve);var Ne=X.current.filter(function(de){return Y.current&&Y.current.contains(de)}),te=Ne.indexOf(ve.target);te!==-1&&Ne.splice(te,1),X.current=Ne,!(Ne.length>0)&&(K({type:"setDraggedFiles",isDragActive:!1,isDragAccept:!1,isDragReject:!1}),Kc(ve)&&p&&p(ve))},[Y,p,R]),he=E.useCallback(function(ve,Ne){var te=[],de=[];ve.forEach(function(Oe){var $e=SR(Oe,j),Ye=Jm($e,2),vt=Ye[0],Mt=Ye[1],bt=ER(Oe,s,o),rt=Jm(bt,2),qt=rt[0],at=rt[1],At=P?P(Oe):null;if(vt&&qt&&!At)te.push(Oe);else{var rn=[Mt,at];At&&(rn=rn.concat(At)),de.push({file:Oe,errors:rn.filter(function(io){return io})})}}),(!u&&te.length>1||u&&f>=1&&te.length>f)&&(te.forEach(function(Oe){de.push({file:Oe,errors:[p$]})}),te.splice(0)),K({acceptedFiles:te,fileRejections:de,isDragReject:de.length>0,type:"setFiles"}),v&&v(te,de,Ne),de.length>0&&w&&w(de,Ne),te.length>0&&g&&g(te,Ne)},[K,u,j,s,o,f,v,g,w,P]),Ee=E.useCallback(function(ve){ve.preventDefault(),ve.persist(),Se(ve),X.current=[],Kc(ve)&&Promise.resolve(i(ve)).then(function(Ne){zf(ve)&&!R||he(Ne,ve)}).catch(function(Ne){return ue(Ne)}),K({type:"reset"})},[i,he,ue,R]),we=E.useCallback(function(){if(M.current){K({type:"openDialog"}),q();var ve={multiple:u,types:V};window.showOpenFilePicker(ve).then(function(Ne){return i(Ne)}).then(function(Ne){he(Ne,null),K({type:"closeDialog"})}).catch(function(Ne){S$(Ne)?(I(Ne),K({type:"closeDialog"})):E$(Ne)?(M.current=!1,Z.current?(Z.current.value=null,Z.current.click()):ue(new Error("Cannot open the file picker because the https://developer.mozilla.org/en-US/docs/Web/API/File_System_Access_API is not supported and no was provided."))):ue(Ne)});return}Z.current&&(K({type:"openDialog"}),q(),Z.current.value=null,Z.current.click())},[K,q,I,C,he,ue,V,u]),Pe=E.useCallback(function(ve){!Y.current||!Y.current.isEqualNode(ve.target)||(ve.key===" "||ve.key==="Enter"||ve.keyCode===32||ve.keyCode===13)&&(ve.preventDefault(),we())},[Y,we]),Ae=E.useCallback(function(){K({type:"focus"})},[]),xe=E.useCallback(function(){K({type:"blur"})},[]),ee=E.useCallback(function(){N||(y$()?setTimeout(we,0):we())},[N,we]),ce=function(Ne){return r?null:Ne},Te=function(Ne){return D?null:ce(Ne)},ge=function(Ne){return z?null:ce(Ne)},Se=function(Ne){R&&Ne.stopPropagation()},ie=E.useMemo(function(){return function(){var ve=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},Ne=ve.refKey,te=Ne===void 0?"ref":Ne,de=ve.role,Oe=ve.onKeyDown,$e=ve.onFocus,Ye=ve.onBlur,vt=ve.onClick,Mt=ve.onDragEnter,bt=ve.onDragOver,rt=ve.onDragLeave,qt=ve.onDrop,at=jf(ve,C$);return jt(jt(av({onKeyDown:Te(Ir(Oe,Pe)),onFocus:Te(Ir($e,Ae)),onBlur:Te(Ir(Ye,xe)),onClick:ce(Ir(vt,ee)),onDragEnter:ge(Ir(Mt,ae)),onDragOver:ge(Ir(bt,oe)),onDragLeave:ge(Ir(rt,Ce)),onDrop:ge(Ir(qt,Ee)),role:typeof de=="string"&&de!==""?de:"presentation"},te,Y),!r&&!D?{tabIndex:0}:{}),at)}},[Y,Pe,Ae,xe,ee,ae,oe,Ce,Ee,D,z,r]),He=E.useCallback(function(ve){ve.stopPropagation()},[]),Ge=E.useMemo(function(){return function(){var ve=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},Ne=ve.refKey,te=Ne===void 0?"ref":Ne,de=ve.onChange,Oe=ve.onClick,$e=jf(ve,T$),Ye=av({accept:j,multiple:u,type:"file",style:{border:0,clip:"rect(0, 0, 0, 0)",clipPath:"inset(50%)",height:"1px",margin:"0 -1px -1px 0",overflow:"hidden",padding:0,position:"absolute",width:"1px",whiteSpace:"nowrap"},onChange:ce(Ir(de,Ee)),onClick:ce(Ir(Oe,He)),tabIndex:-1},te,Z);return jt(jt({},Ye),$e)}},[Z,n,u,Ee,r]);return jt(jt({},F),{},{isFocused:A&&!r,getRootProps:ie,getInputProps:Ge,rootRef:Y,inputRef:Z,open:ce(we)})}function P$(e,t){switch(t.type){case"focus":return jt(jt({},e),{},{isFocused:!0});case"blur":return jt(jt({},e),{},{isFocused:!1});case"openDialog":return jt(jt({},ov),{},{isFileDialogActive:!0});case"closeDialog":return jt(jt({},e),{},{isFileDialogActive:!1});case"setDraggedFiles":return jt(jt({},e),{},{isDragActive:t.isDragActive,isDragAccept:t.isDragAccept,isDragReject:t.isDragReject});case"setFiles":return jt(jt({},e),{},{acceptedFiles:t.acceptedFiles,fileRejections:t.fileRejections,isDragReject:t.isDragReject});case"reset":return jt({},ov);default:return e}}function AE(){}var My="Progress",Py=100,[F$,mK]=hr(My),[I$,G$]=F$(My),AR=E.forwardRef((e,t)=>{const{__scopeProgress:n,value:r=null,max:i,getValueLabel:o=B$,...s}=e;(i||i===0)&&!RE(i)&&console.error(U$(`${i}`,"Progress"));const u=RE(i)?i:Py;r!==null&&!DE(r,u)&&console.error(H$(`${r}`,"Progress"));const f=DE(r,u)?r:null,d=Mf(f)?o(f,u):void 0;return S.jsx(I$,{scope:n,value:f,max:u,children:S.jsx(We.div,{"aria-valuemax":u,"aria-valuemin":0,"aria-valuenow":Mf(f)?f:void 0,"aria-valuetext":d,role:"progressbar","data-state":NR(f,u),"data-value":f??void 0,"data-max":u,...s,ref:t})})});AR.displayName=My;var RR="ProgressIndicator",DR=E.forwardRef((e,t)=>{const{__scopeProgress:n,...r}=e,i=G$(RR,n);return S.jsx(We.div,{"data-state":NR(i.value,i.max),"data-value":i.value??void 0,"data-max":i.max,...r,ref:t})});DR.displayName=RR;function B$(e,t){return`${Math.round(e/t*100)}%`}function NR(e,t){return e==null?"indeterminate":e===t?"complete":"loading"}function Mf(e){return typeof e=="number"}function RE(e){return Mf(e)&&!isNaN(e)&&e>0}function DE(e,t){return Mf(e)&&!isNaN(e)&&e<=t&&e>=0}function U$(e,t){return`Invalid prop \`max\` of value \`${e}\` supplied to \`${t}\`. Only numbers greater than 0 are valid max values. Defaulting to \`${Py}\`.`}function H$(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 ${Py} if no \`max\` prop is set) - - \`null\` or \`undefined\` if the progress is indeterminate. - -Defaulting to \`null\`.`}var OR=AR,$$=DR;const LR=E.forwardRef(({className:e,value:t,...n},r)=>S.jsx(OR,{ref:r,className:Me("bg-secondary relative h-4 w-full overflow-hidden rounded-full",e),...n,children:S.jsx($$,{className:"bg-primary h-full w-full flex-1 transition-all",style:{transform:`translateX(-${100-(t||0)}%)`}})}));LR.displayName=OR.displayName;function lv(e,[t,n]){return Math.min(n,Math.max(t,e))}function V$(e,t){return E.useReducer((n,r)=>t[n][r]??n,e)}var Fy="ScrollArea",[zR,gK]=hr(Fy),[q$,mr]=zR(Fy),jR=E.forwardRef((e,t)=>{const{__scopeScrollArea:n,type:r="hover",dir:i,scrollHideDelay:o=600,...s}=e,[u,f]=E.useState(null),[d,p]=E.useState(null),[m,v]=E.useState(null),[g,w]=E.useState(null),[x,k]=E.useState(null),[C,_]=E.useState(0),[T,N]=E.useState(0),[D,z]=E.useState(!1),[R,B]=E.useState(!1),P=dt(t,V=>f(V)),j=hd(i);return S.jsx(q$,{scope:n,type:r,dir:j,scrollHideDelay:o,scrollArea:u,viewport:d,onViewportChange:p,content:m,onContentChange:v,scrollbarX:g,onScrollbarXChange:w,scrollbarXEnabled:D,onScrollbarXEnabledChange:z,scrollbarY:x,onScrollbarYChange:k,scrollbarYEnabled:R,onScrollbarYEnabledChange:B,onCornerWidthChange:_,onCornerHeightChange:N,children:S.jsx(We.div,{dir:j,...s,ref:P,style:{position:"relative","--radix-scroll-area-corner-width":C+"px","--radix-scroll-area-corner-height":T+"px",...e.style}})})});jR.displayName=Fy;var MR="ScrollAreaViewport",PR=E.forwardRef((e,t)=>{const{__scopeScrollArea:n,children:r,nonce:i,...o}=e,s=mr(MR,n),u=E.useRef(null),f=dt(t,u,s.onViewportChange);return S.jsxs(S.Fragment,{children:[S.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:i}),S.jsx(We.div,{"data-radix-scroll-area-viewport":"",...o,ref:f,style:{overflowX:s.scrollbarXEnabled?"scroll":"hidden",overflowY:s.scrollbarYEnabled?"scroll":"hidden",...e.style},children:S.jsx("div",{ref:s.onContentChange,style:{minWidth:"100%",display:"table"},children:r})})]})});PR.displayName=MR;var Xr="ScrollAreaScrollbar",Iy=E.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=mr(Xr,e.__scopeScrollArea),{onScrollbarXEnabledChange:o,onScrollbarYEnabledChange:s}=i,u=e.orientation==="horizontal";return E.useEffect(()=>(u?o(!0):s(!0),()=>{u?o(!1):s(!1)}),[u,o,s]),i.type==="hover"?S.jsx(Y$,{...r,ref:t,forceMount:n}):i.type==="scroll"?S.jsx(W$,{...r,ref:t,forceMount:n}):i.type==="auto"?S.jsx(FR,{...r,ref:t,forceMount:n}):i.type==="always"?S.jsx(Gy,{...r,ref:t}):null});Iy.displayName=Xr;var Y$=E.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=mr(Xr,e.__scopeScrollArea),[o,s]=E.useState(!1);return E.useEffect(()=>{const u=i.scrollArea;let f=0;if(u){const d=()=>{window.clearTimeout(f),s(!0)},p=()=>{f=window.setTimeout(()=>s(!1),i.scrollHideDelay)};return u.addEventListener("pointerenter",d),u.addEventListener("pointerleave",p),()=>{window.clearTimeout(f),u.removeEventListener("pointerenter",d),u.removeEventListener("pointerleave",p)}}},[i.scrollArea,i.scrollHideDelay]),S.jsx(Zn,{present:n||o,children:S.jsx(FR,{"data-state":o?"visible":"hidden",...r,ref:t})})}),W$=E.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=mr(Xr,e.__scopeScrollArea),o=e.orientation==="horizontal",s=Ed(()=>f("SCROLL_END"),100),[u,f]=V$("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return E.useEffect(()=>{if(u==="idle"){const d=window.setTimeout(()=>f("HIDE"),i.scrollHideDelay);return()=>window.clearTimeout(d)}},[u,i.scrollHideDelay,f]),E.useEffect(()=>{const d=i.viewport,p=o?"scrollLeft":"scrollTop";if(d){let m=d[p];const v=()=>{const g=d[p];m!==g&&(f("SCROLL"),s()),m=g};return d.addEventListener("scroll",v),()=>d.removeEventListener("scroll",v)}},[i.viewport,o,f,s]),S.jsx(Zn,{present:n||u!=="hidden",children:S.jsx(Gy,{"data-state":u==="hidden"?"hidden":"visible",...r,ref:t,onPointerEnter:qe(e.onPointerEnter,()=>f("POINTER_ENTER")),onPointerLeave:qe(e.onPointerLeave,()=>f("POINTER_LEAVE"))})})}),FR=E.forwardRef((e,t)=>{const n=mr(Xr,e.__scopeScrollArea),{forceMount:r,...i}=e,[o,s]=E.useState(!1),u=e.orientation==="horizontal",f=Ed(()=>{if(n.viewport){const d=n.viewport.offsetWidth{const{orientation:n="vertical",...r}=e,i=mr(Xr,e.__scopeScrollArea),o=E.useRef(null),s=E.useRef(0),[u,f]=E.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),d=HR(u.viewport,u.content),p={...r,sizes:u,onSizesChange:f,hasThumb:d>0&&d<1,onThumbChange:v=>o.current=v,onThumbPointerUp:()=>s.current=0,onThumbPointerDown:v=>s.current=v};function m(v,g){return e9(v,s.current,u,g)}return n==="horizontal"?S.jsx(X$,{...p,ref:t,onThumbPositionChange:()=>{if(i.viewport&&o.current){const v=i.viewport.scrollLeft,g=NE(v,u,i.dir);o.current.style.transform=`translate3d(${g}px, 0, 0)`}},onWheelScroll:v=>{i.viewport&&(i.viewport.scrollLeft=v)},onDragScroll:v=>{i.viewport&&(i.viewport.scrollLeft=m(v,i.dir))}}):n==="vertical"?S.jsx(K$,{...p,ref:t,onThumbPositionChange:()=>{if(i.viewport&&o.current){const v=i.viewport.scrollTop,g=NE(v,u);o.current.style.transform=`translate3d(0, ${g}px, 0)`}},onWheelScroll:v=>{i.viewport&&(i.viewport.scrollTop=v)},onDragScroll:v=>{i.viewport&&(i.viewport.scrollTop=m(v))}}):null}),X$=E.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...i}=e,o=mr(Xr,e.__scopeScrollArea),[s,u]=E.useState(),f=E.useRef(null),d=dt(t,f,o.onScrollbarXChange);return E.useEffect(()=>{f.current&&u(getComputedStyle(f.current))},[f]),S.jsx(GR,{"data-orientation":"horizontal",...i,ref:d,sizes:n,style:{bottom:0,left:o.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:o.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":Sd(n)+"px",...e.style},onThumbPointerDown:p=>e.onThumbPointerDown(p.x),onDragScroll:p=>e.onDragScroll(p.x),onWheelScroll:(p,m)=>{if(o.viewport){const v=o.viewport.scrollLeft+p.deltaX;e.onWheelScroll(v),VR(v,m)&&p.preventDefault()}},onResize:()=>{f.current&&o.viewport&&s&&r({content:o.viewport.scrollWidth,viewport:o.viewport.offsetWidth,scrollbar:{size:f.current.clientWidth,paddingStart:Ff(s.paddingLeft),paddingEnd:Ff(s.paddingRight)}})}})}),K$=E.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...i}=e,o=mr(Xr,e.__scopeScrollArea),[s,u]=E.useState(),f=E.useRef(null),d=dt(t,f,o.onScrollbarYChange);return E.useEffect(()=>{f.current&&u(getComputedStyle(f.current))},[f]),S.jsx(GR,{"data-orientation":"vertical",...i,ref:d,sizes:n,style:{top:0,right:o.dir==="ltr"?0:void 0,left:o.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":Sd(n)+"px",...e.style},onThumbPointerDown:p=>e.onThumbPointerDown(p.y),onDragScroll:p=>e.onDragScroll(p.y),onWheelScroll:(p,m)=>{if(o.viewport){const v=o.viewport.scrollTop+p.deltaY;e.onWheelScroll(v),VR(v,m)&&p.preventDefault()}},onResize:()=>{f.current&&o.viewport&&s&&r({content:o.viewport.scrollHeight,viewport:o.viewport.offsetHeight,scrollbar:{size:f.current.clientHeight,paddingStart:Ff(s.paddingTop),paddingEnd:Ff(s.paddingBottom)}})}})}),[Z$,IR]=zR(Xr),GR=E.forwardRef((e,t)=>{const{__scopeScrollArea:n,sizes:r,hasThumb:i,onThumbChange:o,onThumbPointerUp:s,onThumbPointerDown:u,onThumbPositionChange:f,onDragScroll:d,onWheelScroll:p,onResize:m,...v}=e,g=mr(Xr,n),[w,x]=E.useState(null),k=dt(t,P=>x(P)),C=E.useRef(null),_=E.useRef(""),T=g.viewport,N=r.content-r.viewport,D=un(p),z=un(f),R=Ed(m,10);function B(P){if(C.current){const j=P.clientX-C.current.left,V=P.clientY-C.current.top;d({x:j,y:V})}}return E.useEffect(()=>{const P=j=>{const V=j.target;(w==null?void 0:w.contains(V))&&D(j,N)};return document.addEventListener("wheel",P,{passive:!1}),()=>document.removeEventListener("wheel",P,{passive:!1})},[T,w,N,D]),E.useEffect(z,[r,z]),hl(w,R),hl(g.content,R),S.jsx(Z$,{scope:n,scrollbar:w,hasThumb:i,onThumbChange:un(o),onThumbPointerUp:un(s),onThumbPositionChange:z,onThumbPointerDown:un(u),children:S.jsx(We.div,{...v,ref:k,style:{position:"absolute",...v.style},onPointerDown:qe(e.onPointerDown,P=>{P.button===0&&(P.target.setPointerCapture(P.pointerId),C.current=w.getBoundingClientRect(),_.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",g.viewport&&(g.viewport.style.scrollBehavior="auto"),B(P))}),onPointerMove:qe(e.onPointerMove,B),onPointerUp:qe(e.onPointerUp,P=>{const j=P.target;j.hasPointerCapture(P.pointerId)&&j.releasePointerCapture(P.pointerId),document.body.style.webkitUserSelect=_.current,g.viewport&&(g.viewport.style.scrollBehavior=""),C.current=null})})})}),Pf="ScrollAreaThumb",BR=E.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=IR(Pf,e.__scopeScrollArea);return S.jsx(Zn,{present:n||i.hasThumb,children:S.jsx(Q$,{ref:t,...r})})}),Q$=E.forwardRef((e,t)=>{const{__scopeScrollArea:n,style:r,...i}=e,o=mr(Pf,n),s=IR(Pf,n),{onThumbPositionChange:u}=s,f=dt(t,m=>s.onThumbChange(m)),d=E.useRef(void 0),p=Ed(()=>{d.current&&(d.current(),d.current=void 0)},100);return E.useEffect(()=>{const m=o.viewport;if(m){const v=()=>{if(p(),!d.current){const g=t9(m,u);d.current=g,u()}};return u(),m.addEventListener("scroll",v),()=>m.removeEventListener("scroll",v)}},[o.viewport,p,u]),S.jsx(We.div,{"data-state":s.hasThumb?"visible":"hidden",...i,ref:f,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...r},onPointerDownCapture:qe(e.onPointerDownCapture,m=>{const g=m.target.getBoundingClientRect(),w=m.clientX-g.left,x=m.clientY-g.top;s.onThumbPointerDown({x:w,y:x})}),onPointerUp:qe(e.onPointerUp,s.onThumbPointerUp)})});BR.displayName=Pf;var By="ScrollAreaCorner",UR=E.forwardRef((e,t)=>{const n=mr(By,e.__scopeScrollArea),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&r?S.jsx(J$,{...e,ref:t}):null});UR.displayName=By;var J$=E.forwardRef((e,t)=>{const{__scopeScrollArea:n,...r}=e,i=mr(By,n),[o,s]=E.useState(0),[u,f]=E.useState(0),d=!!(o&&u);return hl(i.scrollbarX,()=>{var m;const p=((m=i.scrollbarX)==null?void 0:m.offsetHeight)||0;i.onCornerHeightChange(p),f(p)}),hl(i.scrollbarY,()=>{var m;const p=((m=i.scrollbarY)==null?void 0:m.offsetWidth)||0;i.onCornerWidthChange(p),s(p)}),d?S.jsx(We.div,{...r,ref:t,style:{width:o,height:u,position:"absolute",right:i.dir==="ltr"?0:void 0,left:i.dir==="rtl"?0:void 0,bottom:0,...e.style}}):null});function Ff(e){return e?parseInt(e,10):0}function HR(e,t){const n=e/t;return isNaN(n)?0:n}function Sd(e){const t=HR(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function e9(e,t,n,r="ltr"){const i=Sd(n),o=i/2,s=t||o,u=i-s,f=n.scrollbar.paddingStart+s,d=n.scrollbar.size-n.scrollbar.paddingEnd-u,p=n.content-n.viewport,m=r==="ltr"?[0,p]:[p*-1,0];return $R([f,d],m)(e)}function NE(e,t,n="ltr"){const r=Sd(t),i=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,o=t.scrollbar.size-i,s=t.content-t.viewport,u=o-r,f=n==="ltr"?[0,s]:[s*-1,0],d=lv(e,f);return $R([0,s],[0,u])(d)}function $R(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}function VR(e,t){return e>0&&e{})=>{let n={left:e.scrollLeft,top:e.scrollTop},r=0;return function i(){const o={left:e.scrollLeft,top:e.scrollTop},s=n.left!==o.left,u=n.top!==o.top;(s||u)&&t(),n=o,r=window.requestAnimationFrame(i)}(),()=>window.cancelAnimationFrame(r)};function Ed(e,t){const n=un(e),r=E.useRef(0);return E.useEffect(()=>()=>window.clearTimeout(r.current),[]),E.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(n,t)},[n,t])}function hl(e,t){const n=un(t);xn(()=>{let r=0;if(e){const i=new ResizeObserver(()=>{cancelAnimationFrame(r),r=window.requestAnimationFrame(n)});return i.observe(e),()=>{window.cancelAnimationFrame(r),i.unobserve(e)}}},[e,n])}var qR=jR,n9=PR,r9=UR;const YR=E.forwardRef(({className:e,children:t,...n},r)=>S.jsxs(qR,{ref:r,className:Me("relative overflow-hidden",e),...n,children:[S.jsx(n9,{className:"h-full w-full rounded-[inherit]",children:t}),S.jsx(WR,{}),S.jsx(r9,{})]}));YR.displayName=qR.displayName;const WR=E.forwardRef(({className:e,orientation:t="vertical",...n},r)=>S.jsx(Iy,{ref:r,orientation:t,className:Me("flex touch-none transition-colors select-none",t==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-[1px]",t==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",e),...n,children:S.jsx(BR,{className:"bg-border relative flex-1 rounded-full"})}));WR.displayName=Iy.displayName;function sv(e,t={}){const{decimals:n=0,sizeType:r="normal"}=t,i=["Bytes","KB","MB","GB","TB"],o=["Bytes","KiB","MiB","GiB","TiB"];if(e===0)return"0 Byte";const s=Math.floor(Math.log(e)/Math.log(1024));return`${(e/Math.pow(1024,s)).toFixed(n)} ${r==="accurate"?o[s]??"Bytes":i[s]??"Bytes"}`}function i9(e){const{value:t,onValueChange:n,onUpload:r,progresses:i,accept:o=wz,maxSize:s=1024*1024*200,maxFileCount:u=1,multiple:f=!1,disabled:d=!1,description:p,className:m,...v}=e,[g,w]=_i({prop:t,onChange:n}),x=E.useCallback((_,T)=>{if(!f&&u===1&&_.length>1){vn.error("Cannot upload more than 1 file at a time");return}if(((g==null?void 0:g.length)??0)+_.length>u){vn.error(`Cannot upload more than ${u} files`);return}const N=_.map(z=>Object.assign(z,{preview:URL.createObjectURL(z)})),D=g?[...g,...N]:N;if(w(D),T.length>0&&T.forEach(({file:z})=>{vn.error(`File ${z.name} was rejected`)}),r&&D.length>0&&D.length<=u){const z=D.length>0?`${D.length} files`:"file";vn.promise(r(D),{loading:`Uploading ${z}...`,success:()=>(w([]),`${z} uploaded`),error:`Failed to upload ${z}`})}},[g,u,f,r,w]);function k(_){if(!g)return;const T=g.filter((N,D)=>D!==_);w(T),n==null||n(T)}E.useEffect(()=>()=>{g&&g.forEach(_=>{XR(_)&&URL.revokeObjectURL(_.preview)})},[]);const C=d||((g==null?void 0:g.length)??0)>=u;return S.jsxs("div",{className:"relative flex flex-col gap-6 overflow-hidden",children:[S.jsx(wd,{onDrop:x,accept:o,maxSize:s,maxFiles:u,multiple:u>1||f,disabled:C,children:({getRootProps:_,getInputProps:T,isDragActive:N})=>S.jsxs("div",{..._(),className:Me("group border-muted-foreground/25 hover:bg-muted/25 relative grid h-52 w-full cursor-pointer place-items-center rounded-lg border-2 border-dashed px-5 py-2.5 text-center transition","ring-offset-background focus-visible:ring-ring focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-none",N&&"border-muted-foreground/50",C&&"pointer-events-none opacity-60",m),...v,children:[S.jsx("input",{...T()}),N?S.jsxs("div",{className:"flex flex-col items-center justify-center gap-4 sm:px-5",children:[S.jsx("div",{className:"rounded-full border border-dashed p-3",children:S.jsx(Ag,{className:"text-muted-foreground size-7","aria-hidden":"true"})}),S.jsx("p",{className:"text-muted-foreground font-medium",children:"Drop the files here"})]}):S.jsxs("div",{className:"flex flex-col items-center justify-center gap-4 sm:px-5",children:[S.jsx("div",{className:"rounded-full border border-dashed p-3",children:S.jsx(Ag,{className:"text-muted-foreground size-7","aria-hidden":"true"})}),S.jsxs("div",{className:"flex flex-col gap-px",children:[S.jsx("p",{className:"text-muted-foreground font-medium",children:"Drag and drop files here, or click to select files"}),p?S.jsx("p",{className:"text-muted-foreground/70 text-sm",children:p}):S.jsxs("p",{className:"text-muted-foreground/70 text-sm",children:["You can upload",u>1?` ${u===1/0?"multiple":u} - files (up to ${sv(s)} each)`:` a file with ${sv(s)}`,"Supported formats: TXT, MD, DOCX, PDF, PPTX, RTF, ODT, EPUB, HTML, HTM, TEX, JSON, XML, YAML, YML, CSV, LOG, CONF, INI, PROPERTIES, SQL, BAT, SH, C, CPP, PY, JAVA, JS, TS, SWIFT, GO, RB, PHP, CSS, SCSS, LESS"]})]})]})]})}),g!=null&&g.length?S.jsx(YR,{className:"h-fit w-full px-3",children:S.jsx("div",{className:"flex max-h-48 flex-col gap-4",children:g==null?void 0:g.map((_,T)=>S.jsx(a9,{file:_,onRemove:()=>k(T),progress:i==null?void 0:i[_.name]},T))})}):null]})}function a9({file:e,progress:t,onRemove:n}){return S.jsxs("div",{className:"relative flex items-center gap-2.5",children:[S.jsxs("div",{className:"flex flex-1 gap-2.5",children:[XR(e)?S.jsx(o9,{file:e}):null,S.jsxs("div",{className:"flex w-full flex-col gap-2",children:[S.jsxs("div",{className:"flex flex-col gap-px",children:[S.jsx("p",{className:"text-foreground/80 line-clamp-1 text-sm font-medium",children:e.name}),S.jsx("p",{className:"text-muted-foreground text-xs",children:sv(e.size)})]}),t?S.jsx(LR,{value:t}):null]})]}),S.jsx("div",{className:"flex items-center gap-2",children:S.jsxs(Ot,{type:"button",variant:"outline",size:"icon",className:"size-7",onClick:n,children:[S.jsx(Ek,{className:"size-4","aria-hidden":"true"}),S.jsx("span",{className:"sr-only",children:"Remove file"})]})})]})}function XR(e){return"preview"in e&&typeof e.preview=="string"}function o9({file:e}){return e.type.startsWith("image/")?S.jsx("div",{className:"aspect-square shrink-0 rounded-md object-cover"}):S.jsx(_M,{className:"text-muted-foreground size-10","aria-hidden":"true"})}function l9(){const[e,t]=E.useState(!1),[n,r]=E.useState(!1),[i,o]=E.useState({}),s=E.useCallback(async u=>{r(!0);try{await Promise.all(u.map(async f=>{try{const d=await uM(f,p=>{console.debug(`Uploading ${f.name}: ${p}%`),o(m=>({...m,[f.name]:p}))});d.status==="success"?vn.success(`Upload Success: -${f.name} uploaded successfully`):vn.error(`Upload Failed: -${f.name} -${d.message}`)}catch(d){vn.error(`Upload Failed: -${f.name} -${Cr(d)}`)}}))}catch(f){vn.error(`Upload Failed -`+Cr(f))}finally{r(!1)}},[r,o]);return S.jsxs(KA,{open:e,onOpenChange:u=>{n&&!u||t(u)},children:[S.jsx(ZA,{asChild:!0,children:S.jsxs(Ot,{variant:"default",side:"bottom",tooltip:"Upload documents",size:"sm",children:[S.jsx(Ag,{})," Upload"]})}),S.jsxs(Cy,{className:"sm:max-w-xl",onCloseAutoFocus:u=>u.preventDefault(),children:[S.jsxs(Ty,{children:[S.jsx(Ay,{children:"Upload documents"}),S.jsx(Ry,{children:"Drag and drop your documents here or click to browse."})]}),S.jsx(i9,{maxFileCount:1/0,maxSize:200*1024*1024,description:"supported types: TXT, MD, DOCX, PDF, PPTX, RTF, ODT, EPUB, HTML, HTM, TEX, JSON, XML, YAML, YML, CSV, LOG, CONF, INI, PROPERTIES, SQL, BAT, SH, C, CPP, PY, JAVA, JS, TS, SWIFT, GO, RB, PHP, CSS, SCSS, LESS",onUpload:s,progresses:i,disabled:n})]})]})}function s9(){const[e,t]=E.useState(!1),n=E.useCallback(async()=>{try{const r=await cM();r.status==="success"?(vn.success("Documents cleared successfully"),t(!1)):vn.error(`Clear Documents Failed: -${r.message}`)}catch(r){vn.error(`Clear Documents Failed: -`+Cr(r))}},[t]);return S.jsxs(KA,{open:e,onOpenChange:t,children:[S.jsx(ZA,{asChild:!0,children:S.jsxs(Ot,{variant:"outline",side:"bottom",tooltip:"Clear documents",size:"sm",children:[S.jsx(wk,{})," Clear"]})}),S.jsxs(Cy,{className:"sm:max-w-xl",onCloseAutoFocus:r=>r.preventDefault(),children:[S.jsxs(Ty,{children:[S.jsx(Ay,{children:"Clear documents"}),S.jsx(Ry,{children:"Do you really want to clear all documents?"})]}),S.jsx(Ot,{variant:"destructive",onClick:n,children:"YES"})]})]})}function u9(){const e=Mn.use.health(),[t,n]=E.useState(null),r=E.useCallback(async()=>{try{const o=await aM();o&&o.statuses&&Object.values(o.statuses).reduce((u,f)=>u+f.length,0)>0?n(o):n(null)}catch(o){vn.error(`Failed to load documents -`+Cr(o))}},[n]);E.useEffect(()=>{r()},[]);const i=E.useCallback(async()=>{try{const{status:o}=await oM();vn.message(o)}catch(o){vn.error(`Failed to load documents -`+Cr(o))}},[]);return E.useEffect(()=>{const o=setInterval(async()=>{if(e)try{await r()}catch(s){vn.error(`Failed to get scan progress -`+Cr(s))}},5e3);return()=>clearInterval(o)},[e,r]),S.jsxs(Ks,{className:"!size-full !rounded-none !border-none",children:[S.jsx(Nf,{children:S.jsx(Zs,{className:"text-lg",children:"Document Management"})}),S.jsxs(Of,{className:"space-y-4",children:[S.jsxs("div",{className:"flex gap-2",children:[S.jsxs(Ot,{variant:"outline",onClick:i,side:"bottom",tooltip:"Scan documents",size:"sm",children:[S.jsx(YM,{})," Scan"]}),S.jsx("div",{className:"flex-1"}),S.jsx(s9,{}),S.jsx(l9,{})]}),S.jsxs(Ks,{children:[S.jsxs(Nf,{children:[S.jsx(Zs,{children:"Uploaded documents"}),S.jsx(xd,{children:"view the uploaded documents here"})]}),S.jsxs(Of,{children:[!t&&S.jsx(PH,{title:"No documents uploaded",description:"upload documents to see them here"}),t&&S.jsxs(mR,{children:[S.jsx(gR,{children:S.jsxs(tv,{children:[S.jsx(bi,{children:"ID"}),S.jsx(bi,{children:"Summary"}),S.jsx(bi,{children:"Status"}),S.jsx(bi,{children:"Length"}),S.jsx(bi,{children:"Chunks"}),S.jsx(bi,{children:"Created"}),S.jsx(bi,{children:"Updated"}),S.jsx(bi,{children:"Metadata"})]})}),S.jsx(vR,{className:"text-sm",children:Object.entries(t.statuses).map(([o,s])=>s.map(u=>S.jsxs(tv,{children:[S.jsx(xi,{className:"truncate font-mono",children:u.id}),S.jsx(xi,{className:"max-w-xs min-w-24 truncate",children:S.jsx(Ln,{text:u.content_summary,tooltip:u.content_summary,tooltipClassName:"max-w-none overflow-visible block"})}),S.jsxs(xi,{children:[o==="processed"&&S.jsx("span",{className:"text-green-600",children:"Completed"}),o==="processing"&&S.jsx("span",{className:"text-blue-600",children:"Processing"}),o==="pending"&&S.jsx("span",{className:"text-yellow-600",children:"Pending"}),o==="failed"&&S.jsx("span",{className:"text-red-600",children:"Failed"}),u.error&&S.jsx("span",{className:"ml-2 text-red-500",title:u.error,children:"⚠️"})]}),S.jsx(xi,{children:u.content_length??"-"}),S.jsx(xi,{children:u.chunks_count??"-"}),S.jsx(xi,{className:"truncate",children:new Date(u.created_at).toLocaleString()}),S.jsx(xi,{className:"truncate",children:new Date(u.updated_at).toLocaleString()}),S.jsx(xi,{className:"max-w-xs truncate",children:u.metadata?JSON.stringify(u.metadata):"-"})]},u.id)))})]})]})]})]})]})}function KR(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i=u?i=i+OE("0",s-u):i=(i.substring(0,s)||"0")+"."+i.substring(s),n+i}function LE(e,t,n){if(["","-"].indexOf(e)!==-1)return e;var r=(e.indexOf(".")!==-1||n)&&t,i=Uy(e),o=i.beforeDecimal,s=i.afterDecimal,u=i.hasNegation,f=parseFloat("0."+(s||"0")),d=s.length<=t?"0."+s:f.toFixed(t),p=d.split("."),m=o;o&&Number(p[0])&&(m=o.split("").reverse().reduce(function(x,k,C){return x.length>C?(Number(x[0])+Number(k)).toString()+x.substring(1,x.length):k+x},p[0]));var v=JR(p[1]||"",t,n),g=u?"-":"",w=r?".":"";return""+g+m+w+v}function Va(e,t){if(e.value=e.value,e!==null){if(e.createTextRange){var n=e.createTextRange();return n.move("character",t),n.select(),!0}return e.selectionStart||e.selectionStart===0?(e.focus(),e.setSelectionRange(t,t),!0):(e.focus(),!1)}}var t2=c9(function(e,t){for(var n=0,r=0,i=e.length,o=t.length;e[n]===t[n]&&nn&&i-r>n;)r++;return{from:{start:n,end:i-r},to:{start:n,end:o-r}}}),g9=function(e,t){var n=Math.min(e.selectionStart,t);return{from:{start:n,end:e.selectionEnd},to:{start:n,end:t}}};function v9(e,t,n){return Math.min(Math.max(e,t),n)}function eg(e){return Math.max(e.selectionStart,e.selectionEnd)}function y9(){return typeof navigator<"u"&&!(navigator.platform&&/iPhone|iPod/.test(navigator.platform))}function b9(e){return{from:{start:0,end:0},to:{start:0,end:e.length},lastValue:""}}function x9(e){var t=e.currentValue,n=e.formattedValue,r=e.currentValueIndex,i=e.formattedValueIndex;return t[r]===n[i]}function w9(e,t,n,r,i,o,s){s===void 0&&(s=x9);var u=i.findIndex(function(N){return N}),f=e.slice(0,u);!t&&!n.startsWith(f)&&(t=f,n=f+n,r=r+f.length);for(var d=n.length,p=e.length,m={},v=new Array(d),g=0;g0&&v[C]===-1;)C--;var T=C===-1||v[C]===-1?0:v[C]+1;return T>_?_:r-T<_-r?T:_}function zE(e,t,n,r){var i=e.length;if(t=v9(t,0,i),r==="left"){for(;t>=0&&!n[t];)t--;t===-1&&(t=n.indexOf(!0))}else{for(;t<=i&&!n[t];)t++;t>i&&(t=n.lastIndexOf(!0))}return t===-1&&(t=i),t}function S9(e){for(var t=Array.from({length:e.length+1}).map(function(){return!0}),n=0,r=t.length;nR.length-s.length||zV||m>e.length-s.length)&&(j=m),e=e.substring(0,j),e=C9(T?"-"+e:e,i),e=(e.match(T9(w))||[]).join("");var q=e.indexOf(w);e=e.replace(new RegExp(QR(w),"g"),function(G,F){return F===q?".":""});var I=Uy(e,i),Y=I.beforeDecimal,Z=I.afterDecimal,U=I.addNegation;return d.end-d.start$?!1:A>=re.start&&A{const[x,k]=E.useState(v??r),C=E.useCallback(()=>{k(D=>D===void 0?e??1:Math.min(D+(e??1),o))},[e,o]),_=E.useCallback(()=>{k(D=>D===void 0?-(e??1):Math.max(D-(e??1),i))},[e,i]);E.useEffect(()=>{v!==void 0&&k(v)},[v]);const T=D=>{const z=D.floatValue===void 0?void 0:D.floatValue;k(z),s&&s(z)},N=()=>{x!==void 0&&(xo&&(k(o),w.current.value=String(o)))};return S.jsxs("div",{className:"relative flex",children:[S.jsx(L9,{value:x,onValueChange:T,thousandSeparator:t,decimalScale:f,fixedDecimalScale:u,allowNegative:i<0,valueIsNumericString:!0,onBlur:N,max:o,min:i,suffix:p,prefix:m,customInput:D=>S.jsx(Za,{...D,className:Me("w-full",d)}),placeholder:n,className:"[appearance:textfield] [&::-webkit-inner-spin-button]:appearance-none [&::-webkit-outer-spin-button]:appearance-none",getInputRef:w,...g}),S.jsxs("div",{className:"absolute top-0 right-0 bottom-0 flex flex-col",children:[S.jsx(Ot,{"aria-label":"Increase value",className:"border-input h-1/2 rounded-l-none rounded-br-none border-b border-l px-2 focus-visible:relative",variant:"outline",onClick:C,disabled:x===o,children:S.jsx(xk,{size:15})}),S.jsx(Ot,{"aria-label":"Decrease value",className:"border-input h-1/2 rounded-l-none rounded-tr-none border-b border-l px-2 focus-visible:relative",variant:"outline",onClick:_,disabled:x===i,children:S.jsx(zv,{size:15})})]})]})});Jo.displayName="NumberInput";var z9=[" ","Enter","ArrowUp","ArrowDown"],j9=[" ","Enter"],gu="Select",[kd,Cd,M9]=pT(gu),[Al,vK]=hr(gu,[M9,wl]),Td=wl(),[P9,pa]=Al(gu),[F9,I9]=Al(gu),r2=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:i,onOpenChange:o,value:s,defaultValue:u,onValueChange:f,dir:d,name:p,autoComplete:m,disabled:v,required:g,form:w}=e,x=Td(t),[k,C]=E.useState(null),[_,T]=E.useState(null),[N,D]=E.useState(!1),z=hd(d),[R=!1,B]=_i({prop:r,defaultProp:i,onChange:o}),[P,j]=_i({prop:s,defaultProp:u,onChange:f}),V=E.useRef(null),q=k?w||!!k.closest("form"):!0,[I,Y]=E.useState(new Set),Z=Array.from(I).map(U=>U.props.value).join(";");return S.jsx(ny,{...x,children:S.jsxs(P9,{required:g,scope:t,trigger:k,onTriggerChange:C,valueNode:_,onValueNodeChange:T,valueNodeHasChildren:N,onValueNodeHasChildrenChange:D,contentId:bn(),value:P,onValueChange:j,open:R,onOpenChange:B,dir:z,triggerPointerDownPosRef:V,disabled:v,children:[S.jsx(kd.Provider,{scope:t,children:S.jsx(F9,{scope:e.__scopeSelect,onNativeOptionAdd:E.useCallback(U=>{Y(G=>new Set(G).add(U))},[]),onNativeOptionRemove:E.useCallback(U=>{Y(G=>{const F=new Set(G);return F.delete(U),F})},[]),children:n})}),q?S.jsxs(R2,{"aria-hidden":!0,required:g,tabIndex:-1,name:p,autoComplete:m,value:P,onChange:U=>j(U.target.value),disabled:v,form:w,children:[P===void 0?S.jsx("option",{value:""}):null,Array.from(I)]},Z):null]})})};r2.displayName=gu;var i2="SelectTrigger",a2=E.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...i}=e,o=Td(n),s=pa(i2,n),u=s.disabled||r,f=dt(t,s.onTriggerChange),d=Cd(n),p=E.useRef("touch"),[m,v,g]=D2(x=>{const k=d().filter(T=>!T.disabled),C=k.find(T=>T.value===s.value),_=N2(k,x,C);_!==void 0&&s.onValueChange(_.value)}),w=x=>{u||(s.onOpenChange(!0),g()),x&&(s.triggerPointerDownPosRef.current={x:Math.round(x.pageX),y:Math.round(x.pageY)})};return S.jsx(od,{asChild:!0,...o,children:S.jsx(We.button,{type:"button",role:"combobox","aria-controls":s.contentId,"aria-expanded":s.open,"aria-required":s.required,"aria-autocomplete":"none",dir:s.dir,"data-state":s.open?"open":"closed",disabled:u,"data-disabled":u?"":void 0,"data-placeholder":A2(s.value)?"":void 0,...i,ref:f,onClick:qe(i.onClick,x=>{x.currentTarget.focus(),p.current!=="mouse"&&w(x)}),onPointerDown:qe(i.onPointerDown,x=>{p.current=x.pointerType;const k=x.target;k.hasPointerCapture(x.pointerId)&&k.releasePointerCapture(x.pointerId),x.button===0&&x.ctrlKey===!1&&x.pointerType==="mouse"&&(w(x),x.preventDefault())}),onKeyDown:qe(i.onKeyDown,x=>{const k=m.current!=="";!(x.ctrlKey||x.altKey||x.metaKey)&&x.key.length===1&&v(x.key),!(k&&x.key===" ")&&z9.includes(x.key)&&(w(),x.preventDefault())})})})});a2.displayName=i2;var o2="SelectValue",l2=E.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:i,children:o,placeholder:s="",...u}=e,f=pa(o2,n),{onValueNodeHasChildrenChange:d}=f,p=o!==void 0,m=dt(t,f.onValueNodeChange);return xn(()=>{d(p)},[d,p]),S.jsx(We.span,{...u,ref:m,style:{pointerEvents:"none"},children:A2(f.value)?S.jsx(S.Fragment,{children:s}):o})});l2.displayName=o2;var G9="SelectIcon",s2=E.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...i}=e;return S.jsx(We.span,{"aria-hidden":!0,...i,ref:t,children:r||"▼"})});s2.displayName=G9;var B9="SelectPortal",u2=e=>S.jsx(Qf,{asChild:!0,...e});u2.displayName=B9;var eo="SelectContent",c2=E.forwardRef((e,t)=>{const n=pa(eo,e.__scopeSelect),[r,i]=E.useState();if(xn(()=>{i(new DocumentFragment)},[]),!n.open){const o=r;return o?au.createPortal(S.jsx(f2,{scope:e.__scopeSelect,children:S.jsx(kd.Slot,{scope:e.__scopeSelect,children:S.jsx("div",{children:e.children})})}),o):null}return S.jsx(d2,{...e,ref:t})});c2.displayName=eo;var _r=10,[f2,ma]=Al(eo),U9="SelectContentImpl",d2=E.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:i,onEscapeKeyDown:o,onPointerDownOutside:s,side:u,sideOffset:f,align:d,alignOffset:p,arrowPadding:m,collisionBoundary:v,collisionPadding:g,sticky:w,hideWhenDetached:x,avoidCollisions:k,...C}=e,_=pa(eo,n),[T,N]=E.useState(null),[D,z]=E.useState(null),R=dt(t,ae=>N(ae)),[B,P]=E.useState(null),[j,V]=E.useState(null),q=Cd(n),[I,Y]=E.useState(!1),Z=E.useRef(!1);E.useEffect(()=>{if(T)return Pv(T)},[T]),Mv();const U=E.useCallback(ae=>{const[oe,...Ce]=q().map(we=>we.ref.current),[he]=Ce.slice(-1),Ee=document.activeElement;for(const we of ae)if(we===Ee||(we==null||we.scrollIntoView({block:"nearest"}),we===oe&&D&&(D.scrollTop=0),we===he&&D&&(D.scrollTop=D.scrollHeight),we==null||we.focus(),document.activeElement!==Ee))return},[q,D]),G=E.useCallback(()=>U([B,T]),[U,B,T]);E.useEffect(()=>{I&&G()},[I,G]);const{onOpenChange:F,triggerPointerDownPosRef:K}=_;E.useEffect(()=>{if(T){let ae={x:0,y:0};const oe=he=>{var Ee,we;ae={x:Math.abs(Math.round(he.pageX)-(((Ee=K.current)==null?void 0:Ee.x)??0)),y:Math.abs(Math.round(he.pageY)-(((we=K.current)==null?void 0:we.y)??0))}},Ce=he=>{ae.x<=10&&ae.y<=10?he.preventDefault():T.contains(he.target)||F(!1),document.removeEventListener("pointermove",oe),K.current=null};return K.current!==null&&(document.addEventListener("pointermove",oe),document.addEventListener("pointerup",Ce,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",oe),document.removeEventListener("pointerup",Ce,{capture:!0})}}},[T,F,K]),E.useEffect(()=>{const ae=()=>F(!1);return window.addEventListener("blur",ae),window.addEventListener("resize",ae),()=>{window.removeEventListener("blur",ae),window.removeEventListener("resize",ae)}},[F]);const[A,$]=D2(ae=>{const oe=q().filter(Ee=>!Ee.disabled),Ce=oe.find(Ee=>Ee.ref.current===document.activeElement),he=N2(oe,ae,Ce);he&&setTimeout(()=>he.ref.current.focus())}),M=E.useCallback((ae,oe,Ce)=>{const he=!Z.current&&!Ce;(_.value!==void 0&&_.value===oe||he)&&(P(ae),he&&(Z.current=!0))},[_.value]),O=E.useCallback(()=>T==null?void 0:T.focus(),[T]),X=E.useCallback((ae,oe,Ce)=>{const he=!Z.current&&!Ce;(_.value!==void 0&&_.value===oe||he)&&V(ae)},[_.value]),re=r==="popper"?uv:h2,ue=re===uv?{side:u,sideOffset:f,align:d,alignOffset:p,arrowPadding:m,collisionBoundary:v,collisionPadding:g,sticky:w,hideWhenDetached:x,avoidCollisions:k}:{};return S.jsx(f2,{scope:n,content:T,viewport:D,onViewportChange:z,itemRefCallback:M,selectedItem:B,onItemLeave:O,itemTextRefCallback:X,focusSelectedItem:G,selectedItemText:j,position:r,isPositioned:I,searchRef:A,children:S.jsx(ed,{as:ua,allowPinchZoom:!0,children:S.jsx(Zf,{asChild:!0,trapped:_.open,onMountAutoFocus:ae=>{ae.preventDefault()},onUnmountAutoFocus:qe(i,ae=>{var oe;(oe=_.trigger)==null||oe.focus({preventScroll:!0}),ae.preventDefault()}),children:S.jsx(ou,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:o,onPointerDownOutside:s,onFocusOutside:ae=>ae.preventDefault(),onDismiss:()=>_.onOpenChange(!1),children:S.jsx(re,{role:"listbox",id:_.contentId,"data-state":_.open?"open":"closed",dir:_.dir,onContextMenu:ae=>ae.preventDefault(),...C,...ue,onPlaced:()=>Y(!0),ref:R,style:{display:"flex",flexDirection:"column",outline:"none",...C.style},onKeyDown:qe(C.onKeyDown,ae=>{const oe=ae.ctrlKey||ae.altKey||ae.metaKey;if(ae.key==="Tab"&&ae.preventDefault(),!oe&&ae.key.length===1&&$(ae.key),["ArrowUp","ArrowDown","Home","End"].includes(ae.key)){let he=q().filter(Ee=>!Ee.disabled).map(Ee=>Ee.ref.current);if(["ArrowUp","End"].includes(ae.key)&&(he=he.slice().reverse()),["ArrowUp","ArrowDown"].includes(ae.key)){const Ee=ae.target,we=he.indexOf(Ee);he=he.slice(we+1)}setTimeout(()=>U(he)),ae.preventDefault()}})})})})})})});d2.displayName=U9;var H9="SelectItemAlignedPosition",h2=E.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...i}=e,o=pa(eo,n),s=ma(eo,n),[u,f]=E.useState(null),[d,p]=E.useState(null),m=dt(t,R=>p(R)),v=Cd(n),g=E.useRef(!1),w=E.useRef(!0),{viewport:x,selectedItem:k,selectedItemText:C,focusSelectedItem:_}=s,T=E.useCallback(()=>{if(o.trigger&&o.valueNode&&u&&d&&x&&k&&C){const R=o.trigger.getBoundingClientRect(),B=d.getBoundingClientRect(),P=o.valueNode.getBoundingClientRect(),j=C.getBoundingClientRect();if(o.dir!=="rtl"){const Ee=j.left-B.left,we=P.left-Ee,Pe=R.left-we,Ae=R.width+Pe,xe=Math.max(Ae,B.width),ee=window.innerWidth-_r,ce=lv(we,[_r,Math.max(_r,ee-xe)]);u.style.minWidth=Ae+"px",u.style.left=ce+"px"}else{const Ee=B.right-j.right,we=window.innerWidth-P.right-Ee,Pe=window.innerWidth-R.right-we,Ae=R.width+Pe,xe=Math.max(Ae,B.width),ee=window.innerWidth-_r,ce=lv(we,[_r,Math.max(_r,ee-xe)]);u.style.minWidth=Ae+"px",u.style.right=ce+"px"}const V=v(),q=window.innerHeight-_r*2,I=x.scrollHeight,Y=window.getComputedStyle(d),Z=parseInt(Y.borderTopWidth,10),U=parseInt(Y.paddingTop,10),G=parseInt(Y.borderBottomWidth,10),F=parseInt(Y.paddingBottom,10),K=Z+U+I+F+G,A=Math.min(k.offsetHeight*5,K),$=window.getComputedStyle(x),M=parseInt($.paddingTop,10),O=parseInt($.paddingBottom,10),X=R.top+R.height/2-_r,re=q-X,ue=k.offsetHeight/2,ae=k.offsetTop+ue,oe=Z+U+ae,Ce=K-oe;if(oe<=X){const Ee=V.length>0&&k===V[V.length-1].ref.current;u.style.bottom="0px";const we=d.clientHeight-x.offsetTop-x.offsetHeight,Pe=Math.max(re,ue+(Ee?O:0)+we+G),Ae=oe+Pe;u.style.height=Ae+"px"}else{const Ee=V.length>0&&k===V[0].ref.current;u.style.top="0px";const Pe=Math.max(X,Z+x.offsetTop+(Ee?M:0)+ue)+Ce;u.style.height=Pe+"px",x.scrollTop=oe-X+x.offsetTop}u.style.margin=`${_r}px 0`,u.style.minHeight=A+"px",u.style.maxHeight=q+"px",r==null||r(),requestAnimationFrame(()=>g.current=!0)}},[v,o.trigger,o.valueNode,u,d,x,k,C,o.dir,r]);xn(()=>T(),[T]);const[N,D]=E.useState();xn(()=>{d&&D(window.getComputedStyle(d).zIndex)},[d]);const z=E.useCallback(R=>{R&&w.current===!0&&(T(),_==null||_(),w.current=!1)},[T,_]);return S.jsx(V9,{scope:n,contentWrapper:u,shouldExpandOnScrollRef:g,onScrollButtonChange:z,children:S.jsx("div",{ref:f,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:N},children:S.jsx(We.div,{...i,ref:m,style:{boxSizing:"border-box",maxHeight:"100%",...i.style}})})})});h2.displayName=H9;var $9="SelectPopperPosition",uv=E.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:i=_r,...o}=e,s=Td(n);return S.jsx(ry,{...s,...o,ref:t,align:r,collisionPadding:i,style:{boxSizing:"border-box",...o.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});uv.displayName=$9;var[V9,Hy]=Al(eo,{}),cv="SelectViewport",p2=E.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...i}=e,o=ma(cv,n),s=Hy(cv,n),u=dt(t,o.onViewportChange),f=E.useRef(0);return S.jsxs(S.Fragment,{children:[S.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:r}),S.jsx(kd.Slot,{scope:n,children:S.jsx(We.div,{"data-radix-select-viewport":"",role:"presentation",...i,ref:u,style:{position:"relative",flex:1,overflow:"hidden auto",...i.style},onScroll:qe(i.onScroll,d=>{const p=d.currentTarget,{contentWrapper:m,shouldExpandOnScrollRef:v}=s;if(v!=null&&v.current&&m){const g=Math.abs(f.current-p.scrollTop);if(g>0){const w=window.innerHeight-_r*2,x=parseFloat(m.style.minHeight),k=parseFloat(m.style.height),C=Math.max(x,k);if(C0?N:0,m.style.justifyContent="flex-end")}}}f.current=p.scrollTop})})})]})});p2.displayName=cv;var m2="SelectGroup",[q9,Y9]=Al(m2),g2=E.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=bn();return S.jsx(q9,{scope:n,id:i,children:S.jsx(We.div,{role:"group","aria-labelledby":i,...r,ref:t})})});g2.displayName=m2;var v2="SelectLabel",y2=E.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=Y9(v2,n);return S.jsx(We.div,{id:i.id,...r,ref:t})});y2.displayName=v2;var If="SelectItem",[W9,b2]=Al(If),x2=E.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:i=!1,textValue:o,...s}=e,u=pa(If,n),f=ma(If,n),d=u.value===r,[p,m]=E.useState(o??""),[v,g]=E.useState(!1),w=dt(t,_=>{var T;return(T=f.itemRefCallback)==null?void 0:T.call(f,_,r,i)}),x=bn(),k=E.useRef("touch"),C=()=>{i||(u.onValueChange(r),u.onOpenChange(!1))};if(r==="")throw new Error("A must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return S.jsx(W9,{scope:n,value:r,disabled:i,textId:x,isSelected:d,onItemTextChange:E.useCallback(_=>{m(T=>T||((_==null?void 0:_.textContent)??"").trim())},[]),children:S.jsx(kd.ItemSlot,{scope:n,value:r,disabled:i,textValue:p,children:S.jsx(We.div,{role:"option","aria-labelledby":x,"data-highlighted":v?"":void 0,"aria-selected":d&&v,"data-state":d?"checked":"unchecked","aria-disabled":i||void 0,"data-disabled":i?"":void 0,tabIndex:i?void 0:-1,...s,ref:w,onFocus:qe(s.onFocus,()=>g(!0)),onBlur:qe(s.onBlur,()=>g(!1)),onClick:qe(s.onClick,()=>{k.current!=="mouse"&&C()}),onPointerUp:qe(s.onPointerUp,()=>{k.current==="mouse"&&C()}),onPointerDown:qe(s.onPointerDown,_=>{k.current=_.pointerType}),onPointerMove:qe(s.onPointerMove,_=>{var T;k.current=_.pointerType,i?(T=f.onItemLeave)==null||T.call(f):k.current==="mouse"&&_.currentTarget.focus({preventScroll:!0})}),onPointerLeave:qe(s.onPointerLeave,_=>{var T;_.currentTarget===document.activeElement&&((T=f.onItemLeave)==null||T.call(f))}),onKeyDown:qe(s.onKeyDown,_=>{var N;((N=f.searchRef)==null?void 0:N.current)!==""&&_.key===" "||(j9.includes(_.key)&&C(),_.key===" "&&_.preventDefault())})})})})});x2.displayName=If;var Is="SelectItemText",w2=E.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:i,...o}=e,s=pa(Is,n),u=ma(Is,n),f=b2(Is,n),d=I9(Is,n),[p,m]=E.useState(null),v=dt(t,C=>m(C),f.onItemTextChange,C=>{var _;return(_=u.itemTextRefCallback)==null?void 0:_.call(u,C,f.value,f.disabled)}),g=p==null?void 0:p.textContent,w=E.useMemo(()=>S.jsx("option",{value:f.value,disabled:f.disabled,children:g},f.value),[f.disabled,f.value,g]),{onNativeOptionAdd:x,onNativeOptionRemove:k}=d;return xn(()=>(x(w),()=>k(w)),[x,k,w]),S.jsxs(S.Fragment,{children:[S.jsx(We.span,{id:f.textId,...o,ref:v}),f.isSelected&&s.valueNode&&!s.valueNodeHasChildren?au.createPortal(o.children,s.valueNode):null]})});w2.displayName=Is;var S2="SelectItemIndicator",E2=E.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return b2(S2,n).isSelected?S.jsx(We.span,{"aria-hidden":!0,...r,ref:t}):null});E2.displayName=S2;var fv="SelectScrollUpButton",_2=E.forwardRef((e,t)=>{const n=ma(fv,e.__scopeSelect),r=Hy(fv,e.__scopeSelect),[i,o]=E.useState(!1),s=dt(t,r.onScrollButtonChange);return xn(()=>{if(n.viewport&&n.isPositioned){let u=function(){const d=f.scrollTop>0;o(d)};const f=n.viewport;return u(),f.addEventListener("scroll",u),()=>f.removeEventListener("scroll",u)}},[n.viewport,n.isPositioned]),i?S.jsx(C2,{...e,ref:s,onAutoScroll:()=>{const{viewport:u,selectedItem:f}=n;u&&f&&(u.scrollTop=u.scrollTop-f.offsetHeight)}}):null});_2.displayName=fv;var dv="SelectScrollDownButton",k2=E.forwardRef((e,t)=>{const n=ma(dv,e.__scopeSelect),r=Hy(dv,e.__scopeSelect),[i,o]=E.useState(!1),s=dt(t,r.onScrollButtonChange);return xn(()=>{if(n.viewport&&n.isPositioned){let u=function(){const d=f.scrollHeight-f.clientHeight,p=Math.ceil(f.scrollTop)f.removeEventListener("scroll",u)}},[n.viewport,n.isPositioned]),i?S.jsx(C2,{...e,ref:s,onAutoScroll:()=>{const{viewport:u,selectedItem:f}=n;u&&f&&(u.scrollTop=u.scrollTop+f.offsetHeight)}}):null});k2.displayName=dv;var C2=E.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...i}=e,o=ma("SelectScrollButton",n),s=E.useRef(null),u=Cd(n),f=E.useCallback(()=>{s.current!==null&&(window.clearInterval(s.current),s.current=null)},[]);return E.useEffect(()=>()=>f(),[f]),xn(()=>{var p;const d=u().find(m=>m.ref.current===document.activeElement);(p=d==null?void 0:d.ref.current)==null||p.scrollIntoView({block:"nearest"})},[u]),S.jsx(We.div,{"aria-hidden":!0,...i,ref:t,style:{flexShrink:0,...i.style},onPointerDown:qe(i.onPointerDown,()=>{s.current===null&&(s.current=window.setInterval(r,50))}),onPointerMove:qe(i.onPointerMove,()=>{var d;(d=o.onItemLeave)==null||d.call(o),s.current===null&&(s.current=window.setInterval(r,50))}),onPointerLeave:qe(i.onPointerLeave,()=>{f()})})}),X9="SelectSeparator",T2=E.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return S.jsx(We.div,{"aria-hidden":!0,...r,ref:t})});T2.displayName=X9;var hv="SelectArrow",K9=E.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=Td(n),o=pa(hv,n),s=ma(hv,n);return o.open&&s.position==="popper"?S.jsx(iy,{...i,...r,ref:t}):null});K9.displayName=hv;function A2(e){return e===""||e===void 0}var R2=E.forwardRef((e,t)=>{const{value:n,...r}=e,i=E.useRef(null),o=dt(t,i),s=eR(n);return E.useEffect(()=>{const u=i.current,f=window.HTMLSelectElement.prototype,p=Object.getOwnPropertyDescriptor(f,"value").set;if(s!==n&&p){const m=new Event("change",{bubbles:!0});p.call(u,n),u.dispatchEvent(m)}},[s,n]),S.jsx(ay,{asChild:!0,children:S.jsx("select",{...r,ref:o,defaultValue:n})})});R2.displayName="BubbleSelect";function D2(e){const t=un(e),n=E.useRef(""),r=E.useRef(0),i=E.useCallback(s=>{const u=n.current+s;t(u),function f(d){n.current=d,window.clearTimeout(r.current),d!==""&&(r.current=window.setTimeout(()=>f(""),1e3))}(u)},[t]),o=E.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return E.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,i,o]}function N2(e,t,n){const i=t.length>1&&Array.from(t).every(d=>d===t[0])?t[0]:t,o=n?e.indexOf(n):-1;let s=Z9(e,Math.max(o,0));i.length===1&&(s=s.filter(d=>d!==n));const f=s.find(d=>d.textValue.toLowerCase().startsWith(i.toLowerCase()));return f!==n?f:void 0}function Z9(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var Q9=r2,O2=a2,J9=l2,e8=s2,t8=u2,L2=c2,n8=p2,r8=g2,z2=y2,j2=x2,i8=w2,a8=E2,M2=_2,P2=k2,F2=T2;const ME=Q9,PE=r8,FE=J9,pv=E.forwardRef(({className:e,children:t,...n},r)=>S.jsxs(O2,{ref:r,className:Me("border-input bg-background ring-offset-background placeholder:text-muted-foreground focus:ring-ring flex h-10 w-full items-center justify-between rounded-md border px-3 py-2 text-sm focus:ring-2 focus:ring-offset-2 focus:outline-none disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",e),...n,children:[t,S.jsx(e8,{asChild:!0,children:S.jsx(zv,{className:"h-4 w-4 opacity-50"})})]}));pv.displayName=O2.displayName;const I2=E.forwardRef(({className:e,...t},n)=>S.jsx(M2,{ref:n,className:Me("flex cursor-default items-center justify-center py-1",e),...t,children:S.jsx(xk,{className:"h-4 w-4"})}));I2.displayName=M2.displayName;const G2=E.forwardRef(({className:e,...t},n)=>S.jsx(P2,{ref:n,className:Me("flex cursor-default items-center justify-center py-1",e),...t,children:S.jsx(zv,{className:"h-4 w-4"})}));G2.displayName=P2.displayName;const mv=E.forwardRef(({className:e,children:t,position:n="popper",...r},i)=>S.jsx(t8,{children:S.jsxs(L2,{ref:i,className:Me("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border shadow-md",n==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:n,...r,children:[S.jsx(I2,{}),S.jsx(n8,{className:Me("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),S.jsx(G2,{})]})}));mv.displayName=L2.displayName;const o8=E.forwardRef(({className:e,...t},n)=>S.jsx(z2,{ref:n,className:Me("py-1.5 pr-2 pl-8 text-sm font-semibold",e),...t}));o8.displayName=z2.displayName;const wi=E.forwardRef(({className:e,children:t,...n},r)=>S.jsxs(j2,{ref:r,className:Me("focus:bg-accent focus:text-accent-foreground relative flex w-full cursor-default items-center rounded-sm py-1.5 pr-2 pl-8 text-sm outline-none select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...n,children:[S.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:S.jsx(a8,{children:S.jsx(Lv,{className:"h-4 w-4"})})}),S.jsx(i8,{children:t})]}));wi.displayName=j2.displayName;const l8=E.forwardRef(({className:e,...t},n)=>S.jsx(F2,{ref:n,className:Me("bg-muted -mx-1 my-1 h-px",e),...t}));l8.displayName=F2.displayName;function s8(){var n,r;const e=Qe(i=>i.querySettings),t=E.useCallback((i,o)=>{Qe.getState().updateQuerySettings({[i]:o})},[]);return S.jsxs(Ks,{className:"flex shrink-0 flex-col",children:[S.jsxs(Nf,{className:"px-4 pt-4 pb-2",children:[S.jsx(Zs,{children:"Parameters"}),S.jsx(xd,{children:"Configure your query parameters"})]}),S.jsx(Of,{className:"m-0 flex grow flex-col p-0 text-xs",children:S.jsx("div",{className:"relative size-full",children:S.jsxs("div",{className:"absolute inset-0 flex flex-col gap-2 overflow-auto px-2",children:[S.jsxs(S.Fragment,{children:[S.jsx(Ln,{className:"ml-1",text:"Query Mode",tooltip:"Select the retrieval strategy:\\n• Naive: Basic search without advanced techniques\\n• Local: Context-dependent information retrieval\\n• Global: Utilizes global knowledge base\\n• Hybrid: Combines local and global retrieval\\n• Mix: Integrates knowledge graph with vector retrieval",side:"left"}),S.jsxs(ME,{value:e.mode,onValueChange:i=>t("mode",i),children:[S.jsx(pv,{className:"hover:bg-primary/5 h-9 cursor-pointer focus:ring-0 focus:ring-offset-0 focus:outline-0 active:right-0",children:S.jsx(FE,{})}),S.jsx(mv,{children:S.jsxs(PE,{children:[S.jsx(wi,{value:"naive",children:"Naive"}),S.jsx(wi,{value:"local",children:"Local"}),S.jsx(wi,{value:"global",children:"Global"}),S.jsx(wi,{value:"hybrid",children:"Hybrid"}),S.jsx(wi,{value:"mix",children:"Mix"})]})})]})]}),S.jsxs(S.Fragment,{children:[S.jsx(Ln,{className:"ml-1",text:"Response Format",tooltip:"Defines the response format. Examples:\\n• Multiple Paragraphs\\n• Single Paragraph\\n• Bullet Points",side:"left"}),S.jsxs(ME,{value:e.response_type,onValueChange:i=>t("response_type",i),children:[S.jsx(pv,{className:"hover:bg-primary/5 h-9 cursor-pointer focus:ring-0 focus:ring-offset-0 focus:outline-0 active:right-0",children:S.jsx(FE,{})}),S.jsx(mv,{children:S.jsxs(PE,{children:[S.jsx(wi,{value:"Multiple Paragraphs",children:"Multiple Paragraphs"}),S.jsx(wi,{value:"Single Paragraph",children:"Single Paragraph"}),S.jsx(wi,{value:"Bullet Points",children:"Bullet Points"})]})})]})]}),S.jsxs(S.Fragment,{children:[S.jsx(Ln,{className:"ml-1",text:"Top K Results",tooltip:"Number of top items to retrieve. Represents entities in 'local' mode and relationships in 'global' mode",side:"left"}),S.jsx(Jo,{id:"top_k",stepper:1,value:e.top_k,onValueChange:i=>t("top_k",i),min:1,placeholder:"Number of results"})]}),S.jsxs(S.Fragment,{children:[S.jsxs(S.Fragment,{children:[S.jsx(Ln,{className:"ml-1",text:"Max Tokens for Text Unit",tooltip:"Maximum number of tokens allowed for each retrieved text chunk",side:"left"}),S.jsx(Jo,{id:"max_token_for_text_unit",stepper:500,value:e.max_token_for_text_unit,onValueChange:i=>t("max_token_for_text_unit",i),min:1,placeholder:"Max tokens for text unit"})]}),S.jsxs(S.Fragment,{children:[S.jsx(Ln,{text:"Max Tokens for Global Context",tooltip:"Maximum number of tokens allocated for relationship descriptions in global retrieval",side:"left"}),S.jsx(Jo,{id:"max_token_for_global_context",stepper:500,value:e.max_token_for_global_context,onValueChange:i=>t("max_token_for_global_context",i),min:1,placeholder:"Max tokens for global context"})]}),S.jsxs(S.Fragment,{children:[S.jsx(Ln,{className:"ml-1",text:"Max Tokens for Local Context",tooltip:"Maximum number of tokens allocated for entity descriptions in local retrieval",side:"left"}),S.jsx(Jo,{id:"max_token_for_local_context",stepper:500,value:e.max_token_for_local_context,onValueChange:i=>t("max_token_for_local_context",i),min:1,placeholder:"Max tokens for local context"})]})]}),S.jsxs(S.Fragment,{children:[S.jsx(Ln,{className:"ml-1",text:"History Turns",tooltip:"Number of complete conversation turns (user-assistant pairs) to consider in the response context",side:"left"}),S.jsx(Jo,{className:"!border-input",id:"history_turns",stepper:1,type:"text",value:e.history_turns,onValueChange:i=>t("history_turns",i),min:0,placeholder:"Number of history turns"})]}),S.jsxs(S.Fragment,{children:[S.jsxs(S.Fragment,{children:[S.jsx(Ln,{className:"ml-1",text:"High-Level Keywords",tooltip:"List of high-level keywords to prioritize in retrieval. Separate with commas",side:"left"}),S.jsx(Za,{id:"hl_keywords",type:"text",value:(n=e.hl_keywords)==null?void 0:n.join(", "),onChange:i=>{const o=i.target.value.split(",").map(s=>s.trim()).filter(s=>s!=="");t("hl_keywords",o)},placeholder:"Enter keywords"})]}),S.jsxs(S.Fragment,{children:[S.jsx(Ln,{className:"ml-1",text:"Low-Level Keywords",tooltip:"List of low-level keywords to refine retrieval focus. Separate with commas",side:"left"}),S.jsx(Za,{id:"ll_keywords",type:"text",value:(r=e.ll_keywords)==null?void 0:r.join(", "),onChange:i=>{const o=i.target.value.split(",").map(s=>s.trim()).filter(s=>s!=="");t("ll_keywords",o)},placeholder:"Enter keywords"})]})]}),S.jsxs(S.Fragment,{children:[S.jsxs("div",{className:"flex items-center gap-2",children:[S.jsx(Ln,{className:"ml-1",text:"Only Need Context",tooltip:"If True, only returns the retrieved context without generating a response",side:"left"}),S.jsx("div",{className:"grow"}),S.jsx(Bs,{className:"mr-1 cursor-pointer",id:"only_need_context",checked:e.only_need_context,onCheckedChange:i=>t("only_need_context",i)})]}),S.jsxs("div",{className:"flex items-center gap-2",children:[S.jsx(Ln,{className:"ml-1",text:"Only Need Prompt",tooltip:"If True, only returns the generated prompt without producing a response",side:"left"}),S.jsx("div",{className:"grow"}),S.jsx(Bs,{className:"mr-1 cursor-pointer",id:"only_need_prompt",checked:e.only_need_prompt,onCheckedChange:i=>t("only_need_prompt",i)})]}),S.jsxs("div",{className:"flex items-center gap-2",children:[S.jsx(Ln,{className:"ml-1",text:"Stream Response",tooltip:"If True, enables streaming output for real-time responses",side:"left"}),S.jsx("div",{className:"grow"}),S.jsx(Bs,{className:"mr-1 cursor-pointer",id:"stream",checked:e.stream,onCheckedChange:i=>t("stream",i)})]})]})]})})})]})}function u8(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const c8=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,f8=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,d8={};function IE(e,t){return(d8.jsx?f8:c8).test(e)}const h8=/[ \t\n\f\r]/g;function p8(e){return typeof e=="object"?e.type==="text"?GE(e.value):!1:GE(e)}function GE(e){return e.replace(h8,"")===""}class vu{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}vu.prototype.normal={};vu.prototype.property={};vu.prototype.space=void 0;function B2(e,t){const n={},r={};for(const i of e)Object.assign(n,i.property),Object.assign(r,i.normal);return new vu(n,r,t)}function gv(e){return e.toLowerCase()}class Gn{constructor(t,n){this.attribute=n,this.property=t}}Gn.prototype.attribute="";Gn.prototype.booleanish=!1;Gn.prototype.boolean=!1;Gn.prototype.commaOrSpaceSeparated=!1;Gn.prototype.commaSeparated=!1;Gn.prototype.defined=!1;Gn.prototype.mustUseProperty=!1;Gn.prototype.number=!1;Gn.prototype.overloadedBoolean=!1;Gn.prototype.property="";Gn.prototype.spaceSeparated=!1;Gn.prototype.space=void 0;let m8=0;const et=ro(),Vt=ro(),U2=ro(),Re=ro(),Nt=ro(),ol=ro(),qn=ro();function ro(){return 2**++m8}const vv=Object.freeze(Object.defineProperty({__proto__:null,boolean:et,booleanish:Vt,commaOrSpaceSeparated:qn,commaSeparated:ol,number:Re,overloadedBoolean:U2,spaceSeparated:Nt},Symbol.toStringTag,{value:"Module"})),tg=Object.keys(vv);class $y extends Gn{constructor(t,n,r,i){let o=-1;if(super(t,n),BE(this,"space",i),typeof r=="number")for(;++o4&&n.slice(0,4)==="data"&&x8.test(t)){if(t.charAt(4)==="-"){const o=t.slice(5).replace(UE,E8);r="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=t.slice(4);if(!UE.test(o)){let s=o.replace(b8,S8);s.charAt(0)!=="-"&&(s="-"+s),t="data"+s}}i=$y}return new i(r,t)}function S8(e){return"-"+e.toLowerCase()}function E8(e){return e.charAt(1).toUpperCase()}const _8=B2([H2,g8,q2,Y2,W2],"html"),Vy=B2([H2,v8,q2,Y2,W2],"svg");function k8(e){return e.join(" ").trim()}var Xo={},ng,HE;function C8(){if(HE)return ng;HE=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,i=/^:\s*/,o=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,s=/^[;\s]*/,u=/^\s+|\s+$/g,f=` -`,d="/",p="*",m="",v="comment",g="declaration";ng=function(x,k){if(typeof x!="string")throw new TypeError("First argument must be a string");if(!x)return[];k=k||{};var C=1,_=1;function T(I){var Y=I.match(t);Y&&(C+=Y.length);var Z=I.lastIndexOf(f);_=~Z?I.length-Z:_+I.length}function N(){var I={line:C,column:_};return function(Y){return Y.position=new D(I),B(),Y}}function D(I){this.start=I,this.end={line:C,column:_},this.source=k.source}D.prototype.content=x;function z(I){var Y=new Error(k.source+":"+C+":"+_+": "+I);if(Y.reason=I,Y.filename=k.source,Y.line=C,Y.column=_,Y.source=x,!k.silent)throw Y}function R(I){var Y=I.exec(x);if(Y){var Z=Y[0];return T(Z),x=x.slice(Z.length),Y}}function B(){R(n)}function P(I){var Y;for(I=I||[];Y=j();)Y!==!1&&I.push(Y);return I}function j(){var I=N();if(!(d!=x.charAt(0)||p!=x.charAt(1))){for(var Y=2;m!=x.charAt(Y)&&(p!=x.charAt(Y)||d!=x.charAt(Y+1));)++Y;if(Y+=2,m===x.charAt(Y-1))return z("End of comment missing");var Z=x.slice(2,Y-2);return _+=2,T(Z),x=x.slice(Y),_+=2,I({type:v,comment:Z})}}function V(){var I=N(),Y=R(r);if(Y){if(j(),!R(i))return z("property missing ':'");var Z=R(o),U=I({type:g,property:w(Y[0].replace(e,m)),value:Z?w(Z[0].replace(e,m)):m});return R(s),U}}function q(){var I=[];P(I);for(var Y;Y=V();)Y!==!1&&(I.push(Y),P(I));return I}return B(),q()};function w(x){return x?x.replace(u,m):m}return ng}var $E;function T8(){if($E)return Xo;$E=1;var e=Xo&&Xo.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Xo,"__esModule",{value:!0}),Xo.default=n;var t=e(C8());function n(r,i){var o=null;if(!r||typeof r!="string")return o;var s=(0,t.default)(r),u=typeof i=="function";return s.forEach(function(f){if(f.type==="declaration"){var d=f.property,p=f.value;u?i(d,p,f):p&&(o=o||{},o[d]=p)}}),o}return Xo}var A8=T8();const VE=fn(A8),R8=VE.default||VE,X2=K2("end"),qy=K2("start");function K2(e){return t;function t(n){const r=n&&n.position&&n.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function D8(e){const t=qy(e),n=X2(e);if(t&&n)return{start:t,end:n}}function Us(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?qE(e.position):"start"in e||"end"in e?qE(e):"line"in e||"column"in e?yv(e):""}function yv(e){return YE(e&&e.line)+":"+YE(e&&e.column)}function qE(e){return yv(e&&e.start)+"-"+yv(e&&e.end)}function YE(e){return e&&typeof e=="number"?e:1}class wn extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let i="",o={},s=!1;if(n&&("line"in n&&"column"in n?o={place:n}:"start"in n&&"end"in n?o={place:n}:"type"in n?o={ancestors:[n],place:n.position}:o={...n}),typeof t=="string"?i=t:!o.cause&&t&&(s=!0,i=t.message,o.cause=t),!o.ruleId&&!o.source&&typeof r=="string"){const f=r.indexOf(":");f===-1?o.ruleId=r:(o.source=r.slice(0,f),o.ruleId=r.slice(f+1))}if(!o.place&&o.ancestors&&o.ancestors){const f=o.ancestors[o.ancestors.length-1];f&&(o.place=f.position)}const u=o.place&&"start"in o.place?o.place.start:o.place;this.ancestors=o.ancestors||void 0,this.cause=o.cause||void 0,this.column=u?u.column:void 0,this.fatal=void 0,this.file,this.message=i,this.line=u?u.line:void 0,this.name=Us(o.place)||"1:1",this.place=o.place||void 0,this.reason=this.message,this.ruleId=o.ruleId||void 0,this.source=o.source||void 0,this.stack=s&&o.cause&&typeof o.cause.stack=="string"?o.cause.stack:"",this.actual,this.expected,this.note,this.url}}wn.prototype.file="";wn.prototype.name="";wn.prototype.reason="";wn.prototype.message="";wn.prototype.stack="";wn.prototype.column=void 0;wn.prototype.line=void 0;wn.prototype.ancestors=void 0;wn.prototype.cause=void 0;wn.prototype.fatal=void 0;wn.prototype.place=void 0;wn.prototype.ruleId=void 0;wn.prototype.source=void 0;const Yy={}.hasOwnProperty,N8=new Map,O8=/[A-Z]/g,L8=/-([a-z])/g,z8=new Set(["table","tbody","thead","tfoot","tr"]),j8=new Set(["td","th"]),Z2="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function Q2(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let r;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=H8(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=U8(n,t.jsx,t.jsxs)}const i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?Vy:_8,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},o=J2(i,e,void 0);return o&&typeof o!="string"?o:i.create(e,i.Fragment,{children:o||void 0},void 0)}function J2(e,t,n){if(t.type==="element")return M8(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return P8(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return I8(e,t,n);if(t.type==="mdxjsEsm")return F8(e,t);if(t.type==="root")return G8(e,t,n);if(t.type==="text")return B8(e,t)}function M8(e,t,n){const r=e.schema;let i=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=Vy,e.schema=i),e.ancestors.push(t);const o=tD(e,t.tagName,!1),s=$8(e,t);let u=Xy(e,t);return z8.has(t.tagName)&&(u=u.filter(function(f){return typeof f=="string"?!p8(f):!0})),eD(e,s,o,t),Wy(s,u),e.ancestors.pop(),e.schema=r,e.create(t,o,s,n)}function P8(e,t){if(t.data&&t.data.estree&&e.evaluater){const r=t.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}tu(e,t.position)}function F8(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);tu(e,t.position)}function I8(e,t,n){const r=e.schema;let i=r;t.name==="svg"&&r.space==="html"&&(i=Vy,e.schema=i),e.ancestors.push(t);const o=t.name===null?e.Fragment:tD(e,t.name,!0),s=V8(e,t),u=Xy(e,t);return eD(e,s,o,t),Wy(s,u),e.ancestors.pop(),e.schema=r,e.create(t,o,s,n)}function G8(e,t,n){const r={};return Wy(r,Xy(e,t)),e.create(t,e.Fragment,r,n)}function B8(e,t){return t.value}function eD(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function Wy(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function U8(e,t,n){return r;function r(i,o,s,u){const d=Array.isArray(s.children)?n:t;return u?d(o,s,u):d(o,s)}}function H8(e,t){return n;function n(r,i,o,s){const u=Array.isArray(o.children),f=qy(r);return t(i,o,s,u,{columnNumber:f?f.column-1:void 0,fileName:e,lineNumber:f?f.line:void 0},void 0)}}function $8(e,t){const n={};let r,i;for(i in t.properties)if(i!=="children"&&Yy.call(t.properties,i)){const o=q8(e,i,t.properties[i]);if(o){const[s,u]=o;e.tableCellAlignToStyle&&s==="align"&&typeof u=="string"&&j8.has(t.tagName)?r=u:n[s]=u}}if(r){const o=n.style||(n.style={});o[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function V8(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const o=r.data.estree.body[0];o.type;const s=o.expression;s.type;const u=s.properties[0];u.type,Object.assign(n,e.evaluater.evaluateExpression(u.argument))}else tu(e,t.position);else{const i=r.name;let o;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const u=r.value.data.estree.body[0];u.type,o=e.evaluater.evaluateExpression(u.expression)}else tu(e,t.position);else o=r.value===null?!0:r.value;n[i]=o}return n}function Xy(e,t){const n=[];let r=-1;const i=e.passKeys?new Map:N8;for(;++ri?0:i+t:t=t>i?i:t,n=n>0?n:0,r.length<1e4)s=Array.from(r),s.unshift(t,n),e.splice(...s);else for(n&&e.splice(t,n);o0?(Kn(e,e.length,0,t),e):t}const KE={}.hasOwnProperty;function rD(e){const t={};let n=-1;for(;++n13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function Tr(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const kn=ga(/[A-Za-z]/),yn=ga(/[\dA-Za-z]/),n7=ga(/[#-'*+\--9=?A-Z^-~]/);function Gf(e){return e!==null&&(e<32||e===127)}const bv=ga(/\d/),r7=ga(/[\dA-Fa-f]/),i7=ga(/[!-/:-@[-`{-~]/);function Ue(e){return e!==null&&e<-2}function Tt(e){return e!==null&&(e<0||e===32)}function ut(e){return e===-2||e===-1||e===32}const Ad=ga(new RegExp("\\p{P}|\\p{S}","u")),to=ga(/\s/);function ga(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function Dl(e){const t=[];let n=-1,r=0,i=0;for(;++n55295&&o<57344){const u=e.charCodeAt(n+1);o<56320&&u>56319&&u<57344?(s=String.fromCharCode(o,u),i=1):s="�"}else s=String.fromCharCode(o);s&&(t.push(e.slice(r,n),encodeURIComponent(s)),r=n+i+1,s=""),i&&(n+=i,i=0)}return t.join("")+e.slice(r)}function lt(e,t,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let o=0;return s;function s(f){return ut(f)?(e.enter(n),u(f)):t(f)}function u(f){return ut(f)&&o++s))return;const R=t.events.length;let B=R,P,j;for(;B--;)if(t.events[B][0]==="exit"&&t.events[B][1].type==="chunkFlow"){if(P){j=t.events[B][1].end;break}P=!0}for(C(r),z=R;zT;){const D=n[N];t.containerState=D[1],D[0].exit.call(t,e)}n.length=T}function _(){i.write([null]),o=void 0,i=void 0,t.containerState._closeFlow=void 0}}function u7(e,t,n){return lt(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function pl(e){if(e===null||Tt(e)||to(e))return 1;if(Ad(e))return 2}function Rd(e,t,n){const r=[];let i=-1;for(;++i1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const m={...e[r][1].end},v={...e[n][1].start};QE(m,-f),QE(v,f),s={type:f>1?"strongSequence":"emphasisSequence",start:m,end:{...e[r][1].end}},u={type:f>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:v},o={type:f>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},i={type:f>1?"strong":"emphasis",start:{...s.start},end:{...u.end}},e[r][1].end={...s.start},e[n][1].start={...u.end},d=[],e[r][1].end.offset-e[r][1].start.offset&&(d=fr(d,[["enter",e[r][1],t],["exit",e[r][1],t]])),d=fr(d,[["enter",i,t],["enter",s,t],["exit",s,t],["enter",o,t]]),d=fr(d,Rd(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),d=fr(d,[["exit",o,t],["enter",u,t],["exit",u,t],["exit",i,t]]),e[n][1].end.offset-e[n][1].start.offset?(p=2,d=fr(d,[["enter",e[n][1],t],["exit",e[n][1],t]])):p=0,Kn(e,r-1,n-r+3,d),n=r+d.length-p-2;break}}for(n=-1;++n0&&ut(z)?lt(e,_,"linePrefix",o+1)(z):_(z)}function _(z){return z===null||Ue(z)?e.check(JE,x,N)(z):(e.enter("codeFlowValue"),T(z))}function T(z){return z===null||Ue(z)?(e.exit("codeFlowValue"),_(z)):(e.consume(z),T)}function N(z){return e.exit("codeFenced"),t(z)}function D(z,R,B){let P=0;return j;function j(Z){return z.enter("lineEnding"),z.consume(Z),z.exit("lineEnding"),V}function V(Z){return z.enter("codeFencedFence"),ut(Z)?lt(z,q,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(Z):q(Z)}function q(Z){return Z===u?(z.enter("codeFencedFenceSequence"),I(Z)):B(Z)}function I(Z){return Z===u?(P++,z.consume(Z),I):P>=s?(z.exit("codeFencedFenceSequence"),ut(Z)?lt(z,Y,"whitespace")(Z):Y(Z)):B(Z)}function Y(Z){return Z===null||Ue(Z)?(z.exit("codeFencedFence"),R(Z)):B(Z)}}}function w7(e,t,n){const r=this;return i;function i(s){return s===null?n(s):(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),o)}function o(s){return r.parser.lazy[r.now().line]?n(s):t(s)}}const ig={name:"codeIndented",tokenize:E7},S7={partial:!0,tokenize:_7};function E7(e,t,n){const r=this;return i;function i(d){return e.enter("codeIndented"),lt(e,o,"linePrefix",5)(d)}function o(d){const p=r.events[r.events.length-1];return p&&p[1].type==="linePrefix"&&p[2].sliceSerialize(p[1],!0).length>=4?s(d):n(d)}function s(d){return d===null?f(d):Ue(d)?e.attempt(S7,s,f)(d):(e.enter("codeFlowValue"),u(d))}function u(d){return d===null||Ue(d)?(e.exit("codeFlowValue"),s(d)):(e.consume(d),u)}function f(d){return e.exit("codeIndented"),t(d)}}function _7(e,t,n){const r=this;return i;function i(s){return r.parser.lazy[r.now().line]?n(s):Ue(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),i):lt(e,o,"linePrefix",5)(s)}function o(s){const u=r.events[r.events.length-1];return u&&u[1].type==="linePrefix"&&u[2].sliceSerialize(u[1],!0).length>=4?t(s):Ue(s)?i(s):n(s)}}const k7={name:"codeText",previous:T7,resolve:C7,tokenize:A7};function C7(e){let t=e.length-4,n=3,r,i;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return tthis.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(t,n,r){const i=n||0;this.setCursor(Math.trunc(t));const o=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&js(this.left,r),o.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),js(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),js(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t=4?t(s):e.interrupt(r.parser.constructs.flow,n,t)(s)}}function uD(e,t,n,r,i,o,s,u,f){const d=f||Number.POSITIVE_INFINITY;let p=0;return m;function m(C){return C===60?(e.enter(r),e.enter(i),e.enter(o),e.consume(C),e.exit(o),v):C===null||C===32||C===41||Gf(C)?n(C):(e.enter(r),e.enter(s),e.enter(u),e.enter("chunkString",{contentType:"string"}),x(C))}function v(C){return C===62?(e.enter(o),e.consume(C),e.exit(o),e.exit(i),e.exit(r),t):(e.enter(u),e.enter("chunkString",{contentType:"string"}),g(C))}function g(C){return C===62?(e.exit("chunkString"),e.exit(u),v(C)):C===null||C===60||Ue(C)?n(C):(e.consume(C),C===92?w:g)}function w(C){return C===60||C===62||C===92?(e.consume(C),g):g(C)}function x(C){return!p&&(C===null||C===41||Tt(C))?(e.exit("chunkString"),e.exit(u),e.exit(s),e.exit(r),t(C)):p999||g===null||g===91||g===93&&!f||g===94&&!u&&"_hiddenFootnoteSupport"in s.parser.constructs?n(g):g===93?(e.exit(o),e.enter(i),e.consume(g),e.exit(i),e.exit(r),t):Ue(g)?(e.enter("lineEnding"),e.consume(g),e.exit("lineEnding"),p):(e.enter("chunkString",{contentType:"string"}),m(g))}function m(g){return g===null||g===91||g===93||Ue(g)||u++>999?(e.exit("chunkString"),p(g)):(e.consume(g),f||(f=!ut(g)),g===92?v:m)}function v(g){return g===91||g===92||g===93?(e.consume(g),u++,m):m(g)}}function fD(e,t,n,r,i,o){let s;return u;function u(v){return v===34||v===39||v===40?(e.enter(r),e.enter(i),e.consume(v),e.exit(i),s=v===40?41:v,f):n(v)}function f(v){return v===s?(e.enter(i),e.consume(v),e.exit(i),e.exit(r),t):(e.enter(o),d(v))}function d(v){return v===s?(e.exit(o),f(s)):v===null?n(v):Ue(v)?(e.enter("lineEnding"),e.consume(v),e.exit("lineEnding"),lt(e,d,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),p(v))}function p(v){return v===s||v===null||Ue(v)?(e.exit("chunkString"),d(v)):(e.consume(v),v===92?m:p)}function m(v){return v===s||v===92?(e.consume(v),p):p(v)}}function Hs(e,t){let n;return r;function r(i){return Ue(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):ut(i)?lt(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}const M7={name:"definition",tokenize:F7},P7={partial:!0,tokenize:I7};function F7(e,t,n){const r=this;let i;return o;function o(g){return e.enter("definition"),s(g)}function s(g){return cD.call(r,e,u,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(g)}function u(g){return i=Tr(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),g===58?(e.enter("definitionMarker"),e.consume(g),e.exit("definitionMarker"),f):n(g)}function f(g){return Tt(g)?Hs(e,d)(g):d(g)}function d(g){return uD(e,p,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(g)}function p(g){return e.attempt(P7,m,m)(g)}function m(g){return ut(g)?lt(e,v,"whitespace")(g):v(g)}function v(g){return g===null||Ue(g)?(e.exit("definition"),r.parser.defined.push(i),t(g)):n(g)}}function I7(e,t,n){return r;function r(u){return Tt(u)?Hs(e,i)(u):n(u)}function i(u){return fD(e,o,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(u)}function o(u){return ut(u)?lt(e,s,"whitespace")(u):s(u)}function s(u){return u===null||Ue(u)?t(u):n(u)}}const G7={name:"hardBreakEscape",tokenize:B7};function B7(e,t,n){return r;function r(o){return e.enter("hardBreakEscape"),e.consume(o),i}function i(o){return Ue(o)?(e.exit("hardBreakEscape"),t(o)):n(o)}}const U7={name:"headingAtx",resolve:H7,tokenize:$7};function H7(e,t){let n=e.length-2,r=3,i,o;return e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(i={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},o={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},Kn(e,r,n-r+1,[["enter",i,t],["enter",o,t],["exit",o,t],["exit",i,t]])),e}function $7(e,t,n){let r=0;return i;function i(p){return e.enter("atxHeading"),o(p)}function o(p){return e.enter("atxHeadingSequence"),s(p)}function s(p){return p===35&&r++<6?(e.consume(p),s):p===null||Tt(p)?(e.exit("atxHeadingSequence"),u(p)):n(p)}function u(p){return p===35?(e.enter("atxHeadingSequence"),f(p)):p===null||Ue(p)?(e.exit("atxHeading"),t(p)):ut(p)?lt(e,u,"whitespace")(p):(e.enter("atxHeadingText"),d(p))}function f(p){return p===35?(e.consume(p),f):(e.exit("atxHeadingSequence"),u(p))}function d(p){return p===null||p===35||Tt(p)?(e.exit("atxHeadingText"),u(p)):(e.consume(p),d)}}const V7=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],t_=["pre","script","style","textarea"],q7={concrete:!0,name:"htmlFlow",resolveTo:X7,tokenize:K7},Y7={partial:!0,tokenize:Q7},W7={partial:!0,tokenize:Z7};function X7(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function K7(e,t,n){const r=this;let i,o,s,u,f;return d;function d(O){return p(O)}function p(O){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(O),m}function m(O){return O===33?(e.consume(O),v):O===47?(e.consume(O),o=!0,x):O===63?(e.consume(O),i=3,r.interrupt?t:A):kn(O)?(e.consume(O),s=String.fromCharCode(O),k):n(O)}function v(O){return O===45?(e.consume(O),i=2,g):O===91?(e.consume(O),i=5,u=0,w):kn(O)?(e.consume(O),i=4,r.interrupt?t:A):n(O)}function g(O){return O===45?(e.consume(O),r.interrupt?t:A):n(O)}function w(O){const X="CDATA[";return O===X.charCodeAt(u++)?(e.consume(O),u===X.length?r.interrupt?t:q:w):n(O)}function x(O){return kn(O)?(e.consume(O),s=String.fromCharCode(O),k):n(O)}function k(O){if(O===null||O===47||O===62||Tt(O)){const X=O===47,re=s.toLowerCase();return!X&&!o&&t_.includes(re)?(i=1,r.interrupt?t(O):q(O)):V7.includes(s.toLowerCase())?(i=6,X?(e.consume(O),C):r.interrupt?t(O):q(O)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(O):o?_(O):T(O))}return O===45||yn(O)?(e.consume(O),s+=String.fromCharCode(O),k):n(O)}function C(O){return O===62?(e.consume(O),r.interrupt?t:q):n(O)}function _(O){return ut(O)?(e.consume(O),_):j(O)}function T(O){return O===47?(e.consume(O),j):O===58||O===95||kn(O)?(e.consume(O),N):ut(O)?(e.consume(O),T):j(O)}function N(O){return O===45||O===46||O===58||O===95||yn(O)?(e.consume(O),N):D(O)}function D(O){return O===61?(e.consume(O),z):ut(O)?(e.consume(O),D):T(O)}function z(O){return O===null||O===60||O===61||O===62||O===96?n(O):O===34||O===39?(e.consume(O),f=O,R):ut(O)?(e.consume(O),z):B(O)}function R(O){return O===f?(e.consume(O),f=null,P):O===null||Ue(O)?n(O):(e.consume(O),R)}function B(O){return O===null||O===34||O===39||O===47||O===60||O===61||O===62||O===96||Tt(O)?D(O):(e.consume(O),B)}function P(O){return O===47||O===62||ut(O)?T(O):n(O)}function j(O){return O===62?(e.consume(O),V):n(O)}function V(O){return O===null||Ue(O)?q(O):ut(O)?(e.consume(O),V):n(O)}function q(O){return O===45&&i===2?(e.consume(O),U):O===60&&i===1?(e.consume(O),G):O===62&&i===4?(e.consume(O),$):O===63&&i===3?(e.consume(O),A):O===93&&i===5?(e.consume(O),K):Ue(O)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(Y7,M,I)(O)):O===null||Ue(O)?(e.exit("htmlFlowData"),I(O)):(e.consume(O),q)}function I(O){return e.check(W7,Y,M)(O)}function Y(O){return e.enter("lineEnding"),e.consume(O),e.exit("lineEnding"),Z}function Z(O){return O===null||Ue(O)?I(O):(e.enter("htmlFlowData"),q(O))}function U(O){return O===45?(e.consume(O),A):q(O)}function G(O){return O===47?(e.consume(O),s="",F):q(O)}function F(O){if(O===62){const X=s.toLowerCase();return t_.includes(X)?(e.consume(O),$):q(O)}return kn(O)&&s.length<8?(e.consume(O),s+=String.fromCharCode(O),F):q(O)}function K(O){return O===93?(e.consume(O),A):q(O)}function A(O){return O===62?(e.consume(O),$):O===45&&i===2?(e.consume(O),A):q(O)}function $(O){return O===null||Ue(O)?(e.exit("htmlFlowData"),M(O)):(e.consume(O),$)}function M(O){return e.exit("htmlFlow"),t(O)}}function Z7(e,t,n){const r=this;return i;function i(s){return Ue(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),o):n(s)}function o(s){return r.parser.lazy[r.now().line]?n(s):t(s)}}function Q7(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(yu,t,n)}}const J7={name:"htmlText",tokenize:eV};function eV(e,t,n){const r=this;let i,o,s;return u;function u(A){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(A),f}function f(A){return A===33?(e.consume(A),d):A===47?(e.consume(A),D):A===63?(e.consume(A),T):kn(A)?(e.consume(A),B):n(A)}function d(A){return A===45?(e.consume(A),p):A===91?(e.consume(A),o=0,w):kn(A)?(e.consume(A),_):n(A)}function p(A){return A===45?(e.consume(A),g):n(A)}function m(A){return A===null?n(A):A===45?(e.consume(A),v):Ue(A)?(s=m,G(A)):(e.consume(A),m)}function v(A){return A===45?(e.consume(A),g):m(A)}function g(A){return A===62?U(A):A===45?v(A):m(A)}function w(A){const $="CDATA[";return A===$.charCodeAt(o++)?(e.consume(A),o===$.length?x:w):n(A)}function x(A){return A===null?n(A):A===93?(e.consume(A),k):Ue(A)?(s=x,G(A)):(e.consume(A),x)}function k(A){return A===93?(e.consume(A),C):x(A)}function C(A){return A===62?U(A):A===93?(e.consume(A),C):x(A)}function _(A){return A===null||A===62?U(A):Ue(A)?(s=_,G(A)):(e.consume(A),_)}function T(A){return A===null?n(A):A===63?(e.consume(A),N):Ue(A)?(s=T,G(A)):(e.consume(A),T)}function N(A){return A===62?U(A):T(A)}function D(A){return kn(A)?(e.consume(A),z):n(A)}function z(A){return A===45||yn(A)?(e.consume(A),z):R(A)}function R(A){return Ue(A)?(s=R,G(A)):ut(A)?(e.consume(A),R):U(A)}function B(A){return A===45||yn(A)?(e.consume(A),B):A===47||A===62||Tt(A)?P(A):n(A)}function P(A){return A===47?(e.consume(A),U):A===58||A===95||kn(A)?(e.consume(A),j):Ue(A)?(s=P,G(A)):ut(A)?(e.consume(A),P):U(A)}function j(A){return A===45||A===46||A===58||A===95||yn(A)?(e.consume(A),j):V(A)}function V(A){return A===61?(e.consume(A),q):Ue(A)?(s=V,G(A)):ut(A)?(e.consume(A),V):P(A)}function q(A){return A===null||A===60||A===61||A===62||A===96?n(A):A===34||A===39?(e.consume(A),i=A,I):Ue(A)?(s=q,G(A)):ut(A)?(e.consume(A),q):(e.consume(A),Y)}function I(A){return A===i?(e.consume(A),i=void 0,Z):A===null?n(A):Ue(A)?(s=I,G(A)):(e.consume(A),I)}function Y(A){return A===null||A===34||A===39||A===60||A===61||A===96?n(A):A===47||A===62||Tt(A)?P(A):(e.consume(A),Y)}function Z(A){return A===47||A===62||Tt(A)?P(A):n(A)}function U(A){return A===62?(e.consume(A),e.exit("htmlTextData"),e.exit("htmlText"),t):n(A)}function G(A){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(A),e.exit("lineEnding"),F}function F(A){return ut(A)?lt(e,K,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(A):K(A)}function K(A){return e.enter("htmlTextData"),s(A)}}const Qy={name:"labelEnd",resolveAll:iV,resolveTo:aV,tokenize:oV},tV={tokenize:lV},nV={tokenize:sV},rV={tokenize:uV};function iV(e){let t=-1;const n=[];for(;++t=3&&(d===null||Ue(d))?(e.exit("thematicBreak"),t(d)):n(d)}function f(d){return d===i?(e.consume(d),r++,f):(e.exit("thematicBreakSequence"),ut(d)?lt(e,u,"whitespace")(d):u(d))}}const On={continuation:{tokenize:bV},exit:wV,name:"list",tokenize:yV},gV={partial:!0,tokenize:SV},vV={partial:!0,tokenize:xV};function yV(e,t,n){const r=this,i=r.events[r.events.length-1];let o=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,s=0;return u;function u(g){const w=r.containerState.type||(g===42||g===43||g===45?"listUnordered":"listOrdered");if(w==="listUnordered"?!r.containerState.marker||g===r.containerState.marker:bv(g)){if(r.containerState.type||(r.containerState.type=w,e.enter(w,{_container:!0})),w==="listUnordered")return e.enter("listItemPrefix"),g===42||g===45?e.check(vf,n,d)(g):d(g);if(!r.interrupt||g===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),f(g)}return n(g)}function f(g){return bv(g)&&++s<10?(e.consume(g),f):(!r.interrupt||s<2)&&(r.containerState.marker?g===r.containerState.marker:g===41||g===46)?(e.exit("listItemValue"),d(g)):n(g)}function d(g){return e.enter("listItemMarker"),e.consume(g),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||g,e.check(yu,r.interrupt?n:p,e.attempt(gV,v,m))}function p(g){return r.containerState.initialBlankLine=!0,o++,v(g)}function m(g){return ut(g)?(e.enter("listItemPrefixWhitespace"),e.consume(g),e.exit("listItemPrefixWhitespace"),v):n(g)}function v(g){return r.containerState.size=o+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(g)}}function bV(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(yu,i,o);function i(u){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,lt(e,t,"listItemIndent",r.containerState.size+1)(u)}function o(u){return r.containerState.furtherBlankLines||!ut(u)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,s(u)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(vV,t,s)(u))}function s(u){return r.containerState._closeFlow=!0,r.interrupt=void 0,lt(e,e.attempt(On,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(u)}}function xV(e,t,n){const r=this;return lt(e,i,"listItemIndent",r.containerState.size+1);function i(o){const s=r.events[r.events.length-1];return s&&s[1].type==="listItemIndent"&&s[2].sliceSerialize(s[1],!0).length===r.containerState.size?t(o):n(o)}}function wV(e){e.exit(this.containerState.type)}function SV(e,t,n){const r=this;return lt(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(o){const s=r.events[r.events.length-1];return!ut(o)&&s&&s[1].type==="listItemPrefixWhitespace"?t(o):n(o)}}const n_={name:"setextUnderline",resolveTo:EV,tokenize:_V};function EV(e,t){let n=e.length,r,i,o;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(i=n)}else e[n][1].type==="content"&&e.splice(n,1),!o&&e[n][1].type==="definition"&&(o=n);const s={type:"setextHeading",start:{...e[i][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type="setextHeadingText",o?(e.splice(i,0,["enter",s,t]),e.splice(o+1,0,["exit",e[r][1],t]),e[r][1].end={...e[o][1].end}):e[r][1]=s,e.push(["exit",s,t]),e}function _V(e,t,n){const r=this;let i;return o;function o(d){let p=r.events.length,m;for(;p--;)if(r.events[p][1].type!=="lineEnding"&&r.events[p][1].type!=="linePrefix"&&r.events[p][1].type!=="content"){m=r.events[p][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||m)?(e.enter("setextHeadingLine"),i=d,s(d)):n(d)}function s(d){return e.enter("setextHeadingLineSequence"),u(d)}function u(d){return d===i?(e.consume(d),u):(e.exit("setextHeadingLineSequence"),ut(d)?lt(e,f,"lineSuffix")(d):f(d))}function f(d){return d===null||Ue(d)?(e.exit("setextHeadingLine"),t(d)):n(d)}}const kV={tokenize:CV};function CV(e){const t=this,n=e.attempt(yu,r,e.attempt(this.parser.constructs.flowInitial,i,lt(e,e.attempt(this.parser.constructs.flow,i,e.attempt(N7,i)),"linePrefix")));return n;function r(o){if(o===null){e.consume(o);return}return e.enter("lineEndingBlank"),e.consume(o),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function i(o){if(o===null){e.consume(o);return}return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const TV={resolveAll:hD()},AV=dD("string"),RV=dD("text");function dD(e){return{resolveAll:hD(e==="text"?DV:void 0),tokenize:t};function t(n){const r=this,i=this.parser.constructs[e],o=n.attempt(i,s,u);return s;function s(p){return d(p)?o(p):u(p)}function u(p){if(p===null){n.consume(p);return}return n.enter("data"),n.consume(p),f}function f(p){return d(p)?(n.exit("data"),o(p)):(n.consume(p),f)}function d(p){if(p===null)return!0;const m=i[p];let v=-1;if(m)for(;++v-1){const u=s[0];typeof u=="string"?s[0]=u.slice(r):s.shift()}o>0&&s.push(e[i].slice(0,o))}return s}function HV(e,t){let n=-1;const r=[];let i;for(;++n0){const vt=Oe.tokenStack[Oe.tokenStack.length-1];(vt[1]||i_).call(Oe,void 0,vt[0])}for(de.position={start:ra(te.length>0?te[0][1].start:{line:1,column:1,offset:0}),end:ra(te.length>0?te[te.length-2][1].end:{line:1,column:1,offset:0})},Ye=-1;++Ye1?"-"+u:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(s)}]};e.patch(t,f);const d={type:"element",tagName:"sup",properties:{},children:[f]};return e.patch(t,d),e.applyData(t,d)}function oq(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function lq(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function gD(e,t){const n=t.referenceType;let r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+r}];const i=e.all(t),o=i[0];o&&o.type==="text"?o.value="["+o.value:i.unshift({type:"text",value:"["});const s=i[i.length-1];return s&&s.type==="text"?s.value+=r:i.push({type:"text",value:r}),i}function sq(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return gD(e,t);const i={src:Dl(r.url||""),alt:t.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);const o={type:"element",tagName:"img",properties:i,children:[]};return e.patch(t,o),e.applyData(t,o)}function uq(e,t){const n={src:Dl(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function cq(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function fq(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return gD(e,t);const i={href:Dl(r.url||"")};r.title!==null&&r.title!==void 0&&(i.title=r.title);const o={type:"element",tagName:"a",properties:i,children:e.all(t)};return e.patch(t,o),e.applyData(t,o)}function dq(e,t){const n={href:Dl(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function hq(e,t,n){const r=e.all(t),i=n?pq(n):vD(t),o={},s=[];if(typeof t.checked=="boolean"){const p=r[0];let m;p&&p.type==="element"&&p.tagName==="p"?m=p:(m={type:"element",tagName:"p",properties:{},children:[]},r.unshift(m)),m.children.length>0&&m.children.unshift({type:"text",value:" "}),m.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),o.className=["task-list-item"]}let u=-1;for(;++u1}function mq(e,t){const n={},r=e.all(t);let i=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++i0){const s={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},u=qy(t.children[1]),f=X2(t.children[t.children.length-1]);u&&f&&(s.position={start:u,end:f}),i.push(s)}const o={type:"element",tagName:"table",properties:{},children:e.wrap(i,!0)};return e.patch(t,o),e.applyData(t,o)}function xq(e,t,n){const r=n?n.children:void 0,o=(r?r.indexOf(t):1)===0?"th":"td",s=n&&n.type==="table"?n.align:void 0,u=s?s.length:t.children.length;let f=-1;const d=[];for(;++f0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return o.push(l_(t.slice(i),i>0,!1)),o.join("")}function l_(e,t,n){let r=0,i=e.length;if(t){let o=e.codePointAt(r);for(;o===a_||o===o_;)r++,o=e.codePointAt(r)}if(n){let o=e.codePointAt(i-1);for(;o===a_||o===o_;)i--,o=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}function Eq(e,t){const n={type:"text",value:Sq(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function _q(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const kq={blockquote:eq,break:tq,code:nq,delete:rq,emphasis:iq,footnoteReference:aq,heading:oq,html:lq,imageReference:sq,image:uq,inlineCode:cq,linkReference:fq,link:dq,listItem:hq,list:mq,paragraph:gq,root:vq,strong:yq,table:bq,tableCell:wq,tableRow:xq,text:Eq,thematicBreak:_q,toml:Zc,yaml:Zc,definition:Zc,footnoteDefinition:Zc};function Zc(){}const yD=-1,Dd=0,$s=1,Bf=2,Jy=3,eb=4,tb=5,nb=6,bD=7,xD=8,s_=typeof self=="object"?self:globalThis,Cq=(e,t)=>{const n=(i,o)=>(e.set(o,i),i),r=i=>{if(e.has(i))return e.get(i);const[o,s]=t[i];switch(o){case Dd:case yD:return n(s,i);case $s:{const u=n([],i);for(const f of s)u.push(r(f));return u}case Bf:{const u=n({},i);for(const[f,d]of s)u[r(f)]=r(d);return u}case Jy:return n(new Date(s),i);case eb:{const{source:u,flags:f}=s;return n(new RegExp(u,f),i)}case tb:{const u=n(new Map,i);for(const[f,d]of s)u.set(r(f),r(d));return u}case nb:{const u=n(new Set,i);for(const f of s)u.add(r(f));return u}case bD:{const{name:u,message:f}=s;return n(new s_[u](f),i)}case xD:return n(BigInt(s),i);case"BigInt":return n(Object(BigInt(s)),i);case"ArrayBuffer":return n(new Uint8Array(s).buffer,s);case"DataView":{const{buffer:u}=new Uint8Array(s);return n(new DataView(u),s)}}return n(new s_[o](s),i)};return r},u_=e=>Cq(new Map,e)(0),Ko="",{toString:Tq}={},{keys:Aq}=Object,Ms=e=>{const t=typeof e;if(t!=="object"||!e)return[Dd,t];const n=Tq.call(e).slice(8,-1);switch(n){case"Array":return[$s,Ko];case"Object":return[Bf,Ko];case"Date":return[Jy,Ko];case"RegExp":return[eb,Ko];case"Map":return[tb,Ko];case"Set":return[nb,Ko];case"DataView":return[$s,n]}return n.includes("Array")?[$s,n]:n.includes("Error")?[bD,n]:[Bf,n]},Qc=([e,t])=>e===Dd&&(t==="function"||t==="symbol"),Rq=(e,t,n,r)=>{const i=(s,u)=>{const f=r.push(s)-1;return n.set(u,f),f},o=s=>{if(n.has(s))return n.get(s);let[u,f]=Ms(s);switch(u){case Dd:{let p=s;switch(f){case"bigint":u=xD,p=s.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+f);p=null;break;case"undefined":return i([yD],s)}return i([u,p],s)}case $s:{if(f){let v=s;return f==="DataView"?v=new Uint8Array(s.buffer):f==="ArrayBuffer"&&(v=new Uint8Array(s)),i([f,[...v]],s)}const p=[],m=i([u,p],s);for(const v of s)p.push(o(v));return m}case Bf:{if(f)switch(f){case"BigInt":return i([f,s.toString()],s);case"Boolean":case"Number":case"String":return i([f,s.valueOf()],s)}if(t&&"toJSON"in s)return o(s.toJSON());const p=[],m=i([u,p],s);for(const v of Aq(s))(e||!Qc(Ms(s[v])))&&p.push([o(v),o(s[v])]);return m}case Jy:return i([u,s.toISOString()],s);case eb:{const{source:p,flags:m}=s;return i([u,{source:p,flags:m}],s)}case tb:{const p=[],m=i([u,p],s);for(const[v,g]of s)(e||!(Qc(Ms(v))||Qc(Ms(g))))&&p.push([o(v),o(g)]);return m}case nb:{const p=[],m=i([u,p],s);for(const v of s)(e||!Qc(Ms(v)))&&p.push(o(v));return m}}const{message:d}=s;return i([u,{name:f,message:d}],s)};return o},c_=(e,{json:t,lossy:n}={})=>{const r=[];return Rq(!(t||n),!!t,new Map,r)(e),r},Uf=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?u_(c_(e,t)):structuredClone(e):(e,t)=>u_(c_(e,t));function Dq(e,t){const n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function Nq(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function Oq(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||Dq,r=e.options.footnoteBackLabel||Nq,i=e.options.footnoteLabel||"Footnotes",o=e.options.footnoteLabelTagName||"h2",s=e.options.footnoteLabelProperties||{className:["sr-only"]},u=[];let f=-1;for(;++f0&&w.push({type:"text",value:" "});let _=typeof n=="string"?n:n(f,g);typeof _=="string"&&(_={type:"text",value:_}),w.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+v+(g>1?"-"+g:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(f,g),className:["data-footnote-backref"]},children:Array.isArray(_)?_:[_]})}const k=p[p.length-1];if(k&&k.type==="element"&&k.tagName==="p"){const _=k.children[k.children.length-1];_&&_.type==="text"?_.value+=" ":k.children.push({type:"text",value:" "}),k.children.push(...w)}else p.push(...w);const C={type:"element",tagName:"li",properties:{id:t+"fn-"+v},children:e.wrap(p,!0)};e.patch(d,C),u.push(C)}if(u.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:o,properties:{...Uf(s),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:` -`},{type:"element",tagName:"ol",properties:{},children:e.wrap(u,!0)},{type:"text",value:` -`}]}}const Nd=function(e){if(e==null)return Mq;if(typeof e=="function")return Od(e);if(typeof e=="object")return Array.isArray(e)?Lq(e):zq(e);if(typeof e=="string")return jq(e);throw new Error("Expected function, string, or object as test")};function Lq(e){const t=[];let n=-1;for(;++n":""))+")"})}return v;function v(){let g=wD,w,x,k;if((!t||o(f,d,p[p.length-1]||void 0))&&(g=Gq(n(f,p)),g[0]===wv))return g;if("children"in f&&f.children){const C=f;if(C.children&&g[0]!==Iq)for(x=(r?C.children.length:-1)+s,k=p.concat(C);x>-1&&x0&&n.push({type:"text",value:` -`}),n}function f_(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function d_(e,t){const n=Uq(e,t),r=n.one(e,void 0),i=Oq(n),o=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return i&&o.children.push({type:"text",value:` -`},i),o}function Yq(e,t){return e&&"run"in e?async function(n,r){const i=d_(n,{file:r,...t});await e.run(i,r)}:function(n,r){return d_(n,{file:r,...e||t})}}function h_(e){if(e)throw e}var og,p_;function Wq(){if(p_)return og;p_=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=function(d){return typeof Array.isArray=="function"?Array.isArray(d):t.call(d)==="[object Array]"},o=function(d){if(!d||t.call(d)!=="[object Object]")return!1;var p=e.call(d,"constructor"),m=d.constructor&&d.constructor.prototype&&e.call(d.constructor.prototype,"isPrototypeOf");if(d.constructor&&!p&&!m)return!1;var v;for(v in d);return typeof v>"u"||e.call(d,v)},s=function(d,p){n&&p.name==="__proto__"?n(d,p.name,{enumerable:!0,configurable:!0,value:p.newValue,writable:!0}):d[p.name]=p.newValue},u=function(d,p){if(p==="__proto__")if(e.call(d,p)){if(r)return r(d,p).value}else return;return d[p]};return og=function f(){var d,p,m,v,g,w,x=arguments[0],k=1,C=arguments.length,_=!1;for(typeof x=="boolean"&&(_=x,x=arguments[1]||{},k=2),(x==null||typeof x!="object"&&typeof x!="function")&&(x={});ks.length;let f;u&&s.push(i);try{f=e.apply(this,s)}catch(d){const p=d;if(u&&n)throw p;return i(p)}u||(f&&f.then&&typeof f.then=="function"?f.then(o,i):f instanceof Error?i(f):o(f))}function i(s,...u){n||(n=!0,t(s,...u))}function o(s){i(null,s)}}const Gr={basename:Qq,dirname:Jq,extname:eY,join:tY,sep:"/"};function Qq(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');bu(e);let n=0,r=-1,i=e.length,o;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(o){n=i+1;break}}else r<0&&(o=!0,r=i+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let s=-1,u=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(o){n=i+1;break}}else s<0&&(o=!0,s=i+1),u>-1&&(e.codePointAt(i)===t.codePointAt(u--)?u<0&&(r=i):(u=-1,r=s));return n===r?r=s:r<0&&(r=e.length),e.slice(n,r)}function Jq(e){if(bu(e),e.length===0)return".";let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||(r=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function eY(e){bu(e);let t=e.length,n=-1,r=0,i=-1,o=0,s;for(;t--;){const u=e.codePointAt(t);if(u===47){if(s){r=t+1;break}continue}n<0&&(s=!0,n=t+1),u===46?i<0?i=t:o!==1&&(o=1):i>-1&&(o=-1)}return i<0||n<0||o===0||o===1&&i===n-1&&i===r+1?"":e.slice(i,n)}function tY(...e){let t=-1,n;for(;++t0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function rY(e,t){let n="",r=0,i=-1,o=0,s=-1,u,f;for(;++s<=e.length;){if(s2){if(f=n.lastIndexOf("/"),f!==n.length-1){f<0?(n="",r=0):(n=n.slice(0,f),r=n.length-1-n.lastIndexOf("/")),i=s,o=0;continue}}else if(n.length>0){n="",r=0,i=s,o=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(i+1,s):n=e.slice(i+1,s),r=s-i-1;i=s,o=0}else u===46&&o>-1?o++:o=-1}return n}function bu(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const iY={cwd:aY};function aY(){return"/"}function _v(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function oY(e){if(typeof e=="string")e=new URL(e);else if(!_v(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return lY(e)}function lY(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const t=e.pathname;let n=-1;for(;++n0){let[g,...w]=p;const x=r[v][1];Ev(x)&&Ev(g)&&(g=lg(!0,x,g)),r[v]=[d,g,...w]}}}}const fY=new ib().freeze();function fg(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function dg(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function hg(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function g_(e){if(!Ev(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function v_(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function Jc(e){return dY(e)?e:new ED(e)}function dY(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function hY(e){return typeof e=="string"||pY(e)}function pY(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const mY="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",y_=[],b_={allowDangerousHtml:!0},gY=/^(https?|ircs?|mailto|xmpp)$/i,vY=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function yY(e){const t=e.allowedElements,n=e.allowElement,r=e.children||"",i=e.className,o=e.components,s=e.disallowedElements,u=e.rehypePlugins||y_,f=e.remarkPlugins||y_,d=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...b_}:b_,p=e.skipHtml,m=e.unwrapDisallowed,v=e.urlTransform||bY,g=fY().use(JV).use(f).use(Yq,d).use(u),w=new ED;typeof r=="string"&&(w.value=r);for(const _ of vY)Object.hasOwn(e,_.from)&&(""+_.from+(_.to?"use `"+_.to+"` instead":"remove it")+mY+_.id,void 0);const x=g.parse(w);let k=g.runSync(x,w);return i&&(k={type:"element",tagName:"div",properties:{className:i},children:k.type==="root"?k.children:[k]}),rb(k,C),Q2(k,{Fragment:S.Fragment,components:o,ignoreInvalidStyle:!0,jsx:S.jsx,jsxs:S.jsxs,passKeys:!0,passNode:!0});function C(_,T,N){if(_.type==="raw"&&N&&typeof T=="number")return p?N.children.splice(T,1):N.children[T]={type:"text",value:_.value},T;if(_.type==="element"){let D;for(D in rg)if(Object.hasOwn(rg,D)&&Object.hasOwn(_.properties,D)){const z=_.properties[D],R=rg[D];(R===null||R.includes(_.tagName))&&(_.properties[D]=v(String(z||""),D,_))}}if(_.type==="element"){let D=t?!t.includes(_.tagName):s?s.includes(_.tagName):!1;if(!D&&n&&typeof T=="number"&&(D=!n(_,T,N)),D&&N&&typeof T=="number")return m&&_.children?N.children.splice(T,1,..._.children):N.children.splice(T,1),T}}}function bY(e){const t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),i=e.indexOf("/");return t===-1||i!==-1&&t>i||n!==-1&&t>n||r!==-1&&t>r||gY.test(e.slice(0,t))?e:""}function x_(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let r=0,i=n.indexOf(t);for(;i!==-1;)r++,i=n.indexOf(t,i+t.length);return r}function xY(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function wY(e,t,n){const i=Nd((n||{}).ignore||[]),o=SY(t);let s=-1;for(;++s0?{type:"text",value:z}:void 0),z===!1?v.lastIndex=N+1:(w!==N&&_.push({type:"text",value:d.value.slice(w,N)}),Array.isArray(z)?_.push(...z):z&&_.push(z),w=N+T[0].length,C=!0),!v.global)break;T=v.exec(d.value)}return C?(w?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(")");const i=x_(e,"(");let o=x_(e,")");for(;r!==-1&&i>o;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),o++;return[e,n]}function _D(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||to(n)||Ad(n))&&(!t||n!==47)}kD.peek=VY;function PY(){this.buffer()}function FY(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function IY(){this.buffer()}function GY(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function BY(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Tr(this.sliceSerialize(e)).toLowerCase(),n.label=t}function UY(e){this.exit(e)}function HY(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Tr(this.sliceSerialize(e)).toLowerCase(),n.label=t}function $Y(e){this.exit(e)}function VY(){return"["}function kD(e,t,n,r){const i=n.createTracker(r);let o=i.move("[^");const s=n.enter("footnoteReference"),u=n.enter("reference");return o+=i.move(n.safe(n.associationId(e),{after:"]",before:o})),u(),s(),o+=i.move("]"),o}function qY(){return{enter:{gfmFootnoteCallString:PY,gfmFootnoteCall:FY,gfmFootnoteDefinitionLabelString:IY,gfmFootnoteDefinition:GY},exit:{gfmFootnoteCallString:BY,gfmFootnoteCall:UY,gfmFootnoteDefinitionLabelString:HY,gfmFootnoteDefinition:$Y}}}function YY(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:kD},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(r,i,o,s){const u=o.createTracker(s);let f=u.move("[^");const d=o.enter("footnoteDefinition"),p=o.enter("label");return f+=u.move(o.safe(o.associationId(r),{before:f,after:"]"})),p(),f+=u.move("]:"),r.children&&r.children.length>0&&(u.shift(4),f+=u.move((t?` -`:" ")+o.indentLines(o.containerFlow(r,u.current()),t?CD:WY))),d(),f}}function WY(e,t,n){return t===0?e:CD(e,t,n)}function CD(e,t,n){return(n?"":" ")+e}const XY=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];TD.peek=eW;function KY(){return{canContainEols:["delete"],enter:{strikethrough:QY},exit:{strikethrough:JY}}}function ZY(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:XY}],handlers:{delete:TD}}}function QY(e){this.enter({type:"delete",children:[]},e)}function JY(e){this.exit(e)}function TD(e,t,n,r){const i=n.createTracker(r),o=n.enter("strikethrough");let s=i.move("~~");return s+=n.containerPhrasing(e,{...i.current(),before:s,after:"~"}),s+=i.move("~~"),o(),s}function eW(){return"~"}function tW(e){return e.length}function nW(e,t){const n=t||{},r=(n.align||[]).concat(),i=n.stringLength||tW,o=[],s=[],u=[],f=[];let d=0,p=-1;for(;++pd&&(d=e[p].length);++Cf[C])&&(f[C]=T)}x.push(_)}s[p]=x,u[p]=k}let m=-1;if(typeof r=="object"&&"length"in r)for(;++mf[m]&&(f[m]=_),g[m]=_),v[m]=T}s.splice(1,0,v),u.splice(1,0,g),p=-1;const w=[];for(;++p "),o.shift(2);const s=n.indentLines(n.containerFlow(e,o.current()),aW);return i(),s}function aW(e,t,n){return">"+(n?"":" ")+e}function oW(e,t){return S_(e,t.inConstruct,!0)&&!S_(e,t.notInConstruct,!1)}function S_(e,t,n){if(typeof t=="string"&&(t=[t]),!t||t.length===0)return n;let r=-1;for(;++rs&&(s=o):o=1,i=r+t.length,r=n.indexOf(t,i);return s}function lW(e,t){return!!(t.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function sW(e){const t=e.options.fence||"`";if(t!=="`"&&t!=="~")throw new Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function uW(e,t,n,r){const i=sW(n),o=e.value||"",s=i==="`"?"GraveAccent":"Tilde";if(lW(e,n)){const m=n.enter("codeIndented"),v=n.indentLines(o,cW);return m(),v}const u=n.createTracker(r),f=i.repeat(Math.max(AD(o,i)+1,3)),d=n.enter("codeFenced");let p=u.move(f);if(e.lang){const m=n.enter(`codeFencedLang${s}`);p+=u.move(n.safe(e.lang,{before:p,after:" ",encode:["`"],...u.current()})),m()}if(e.lang&&e.meta){const m=n.enter(`codeFencedMeta${s}`);p+=u.move(" "),p+=u.move(n.safe(e.meta,{before:p,after:` -`,encode:["`"],...u.current()})),m()}return p+=u.move(` -`),o&&(p+=u.move(o+` -`)),p+=u.move(f),d(),p}function cW(e,t,n){return(n?"":" ")+e}function ab(e){const t=e.options.quote||'"';if(t!=='"'&&t!=="'")throw new Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function fW(e,t,n,r){const i=ab(n),o=i==='"'?"Quote":"Apostrophe",s=n.enter("definition");let u=n.enter("label");const f=n.createTracker(r);let d=f.move("[");return d+=f.move(n.safe(n.associationId(e),{before:d,after:"]",...f.current()})),d+=f.move("]: "),u(),!e.url||/[\0- \u007F]/.test(e.url)?(u=n.enter("destinationLiteral"),d+=f.move("<"),d+=f.move(n.safe(e.url,{before:d,after:">",...f.current()})),d+=f.move(">")):(u=n.enter("destinationRaw"),d+=f.move(n.safe(e.url,{before:d,after:e.title?" ":` -`,...f.current()}))),u(),e.title&&(u=n.enter(`title${o}`),d+=f.move(" "+i),d+=f.move(n.safe(e.title,{before:d,after:i,...f.current()})),d+=f.move(i),u()),s(),d}function dW(e){const t=e.options.emphasis||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function nu(e){return""+e.toString(16).toUpperCase()+";"}function Hf(e,t,n){const r=pl(e),i=pl(t);return r===void 0?i===void 0?n==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}RD.peek=hW;function RD(e,t,n,r){const i=dW(n),o=n.enter("emphasis"),s=n.createTracker(r),u=s.move(i);let f=s.move(n.containerPhrasing(e,{after:i,before:u,...s.current()}));const d=f.charCodeAt(0),p=Hf(r.before.charCodeAt(r.before.length-1),d,i);p.inside&&(f=nu(d)+f.slice(1));const m=f.charCodeAt(f.length-1),v=Hf(r.after.charCodeAt(0),m,i);v.inside&&(f=f.slice(0,-1)+nu(m));const g=s.move(i);return o(),n.attentionEncodeSurroundingInfo={after:v.outside,before:p.outside},u+f+g}function hW(e,t,n){return n.options.emphasis||"*"}function pW(e,t){let n=!1;return rb(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return n=!0,wv}),!!((!e.depth||e.depth<3)&&Ky(e)&&(t.options.setext||n))}function mW(e,t,n,r){const i=Math.max(Math.min(6,e.depth||1),1),o=n.createTracker(r);if(pW(e,n)){const p=n.enter("headingSetext"),m=n.enter("phrasing"),v=n.containerPhrasing(e,{...o.current(),before:` -`,after:` -`});return m(),p(),v+` -`+(i===1?"=":"-").repeat(v.length-(Math.max(v.lastIndexOf("\r"),v.lastIndexOf(` -`))+1))}const s="#".repeat(i),u=n.enter("headingAtx"),f=n.enter("phrasing");o.move(s+" ");let d=n.containerPhrasing(e,{before:"# ",after:` -`,...o.current()});return/^[\t ]/.test(d)&&(d=nu(d.charCodeAt(0))+d.slice(1)),d=d?s+" "+d:s,n.options.closeAtx&&(d+=" "+s),f(),u(),d}DD.peek=gW;function DD(e){return e.value||""}function gW(){return"<"}ND.peek=vW;function ND(e,t,n,r){const i=ab(n),o=i==='"'?"Quote":"Apostrophe",s=n.enter("image");let u=n.enter("label");const f=n.createTracker(r);let d=f.move("![");return d+=f.move(n.safe(e.alt,{before:d,after:"]",...f.current()})),d+=f.move("]("),u(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(u=n.enter("destinationLiteral"),d+=f.move("<"),d+=f.move(n.safe(e.url,{before:d,after:">",...f.current()})),d+=f.move(">")):(u=n.enter("destinationRaw"),d+=f.move(n.safe(e.url,{before:d,after:e.title?" ":")",...f.current()}))),u(),e.title&&(u=n.enter(`title${o}`),d+=f.move(" "+i),d+=f.move(n.safe(e.title,{before:d,after:i,...f.current()})),d+=f.move(i),u()),d+=f.move(")"),s(),d}function vW(){return"!"}OD.peek=yW;function OD(e,t,n,r){const i=e.referenceType,o=n.enter("imageReference");let s=n.enter("label");const u=n.createTracker(r);let f=u.move("![");const d=n.safe(e.alt,{before:f,after:"]",...u.current()});f+=u.move(d+"]["),s();const p=n.stack;n.stack=[],s=n.enter("reference");const m=n.safe(n.associationId(e),{before:f,after:"]",...u.current()});return s(),n.stack=p,o(),i==="full"||!d||d!==m?f+=u.move(m+"]"):i==="shortcut"?f=f.slice(0,-1):f+=u.move("]"),f}function yW(){return"!"}LD.peek=bW;function LD(e,t,n){let r=e.value||"",i="`",o=-1;for(;new RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++o\u007F]/.test(e.url))}jD.peek=xW;function jD(e,t,n,r){const i=ab(n),o=i==='"'?"Quote":"Apostrophe",s=n.createTracker(r);let u,f;if(zD(e,n)){const p=n.stack;n.stack=[],u=n.enter("autolink");let m=s.move("<");return m+=s.move(n.containerPhrasing(e,{before:m,after:">",...s.current()})),m+=s.move(">"),u(),n.stack=p,m}u=n.enter("link"),f=n.enter("label");let d=s.move("[");return d+=s.move(n.containerPhrasing(e,{before:d,after:"](",...s.current()})),d+=s.move("]("),f(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(f=n.enter("destinationLiteral"),d+=s.move("<"),d+=s.move(n.safe(e.url,{before:d,after:">",...s.current()})),d+=s.move(">")):(f=n.enter("destinationRaw"),d+=s.move(n.safe(e.url,{before:d,after:e.title?" ":")",...s.current()}))),f(),e.title&&(f=n.enter(`title${o}`),d+=s.move(" "+i),d+=s.move(n.safe(e.title,{before:d,after:i,...s.current()})),d+=s.move(i),f()),d+=s.move(")"),u(),d}function xW(e,t,n){return zD(e,n)?"<":"["}MD.peek=wW;function MD(e,t,n,r){const i=e.referenceType,o=n.enter("linkReference");let s=n.enter("label");const u=n.createTracker(r);let f=u.move("[");const d=n.containerPhrasing(e,{before:f,after:"]",...u.current()});f+=u.move(d+"]["),s();const p=n.stack;n.stack=[],s=n.enter("reference");const m=n.safe(n.associationId(e),{before:f,after:"]",...u.current()});return s(),n.stack=p,o(),i==="full"||!d||d!==m?f+=u.move(m+"]"):i==="shortcut"?f=f.slice(0,-1):f+=u.move("]"),f}function wW(){return"["}function ob(e){const t=e.options.bullet||"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function SW(e){const t=ob(e),n=e.options.bulletOther;if(!n)return t==="*"?"-":"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw new Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function EW(e){const t=e.options.bulletOrdered||".";if(t!=="."&&t!==")")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function PD(e){const t=e.options.rule||"*";if(t!=="*"&&t!=="-"&&t!=="_")throw new Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function _W(e,t,n,r){const i=n.enter("list"),o=n.bulletCurrent;let s=e.ordered?EW(n):ob(n);const u=e.ordered?s==="."?")":".":SW(n);let f=t&&n.bulletLastUsed?s===n.bulletLastUsed:!1;if(!e.ordered){const p=e.children?e.children[0]:void 0;if((s==="*"||s==="-")&&p&&(!p.children||!p.children[0])&&n.stack[n.stack.length-1]==="list"&&n.stack[n.stack.length-2]==="listItem"&&n.stack[n.stack.length-3]==="list"&&n.stack[n.stack.length-4]==="listItem"&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(f=!0),PD(n)===s&&p){let m=-1;for(;++m-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+o);let s=o.length+1;(i==="tab"||i==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(s=Math.ceil(s/4)*4);const u=n.createTracker(r);u.move(o+" ".repeat(s-o.length)),u.shift(s);const f=n.enter("listItem"),d=n.indentLines(n.containerFlow(e,u.current()),p);return f(),d;function p(m,v,g){return v?(g?"":" ".repeat(s))+m:(g?o:o+" ".repeat(s-o.length))+m}}function TW(e,t,n,r){const i=n.enter("paragraph"),o=n.enter("phrasing"),s=n.containerPhrasing(e,r);return o(),i(),s}const AW=Nd(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function RW(e,t,n,r){return(e.children.some(function(s){return AW(s)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function DW(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}FD.peek=NW;function FD(e,t,n,r){const i=DW(n),o=n.enter("strong"),s=n.createTracker(r),u=s.move(i+i);let f=s.move(n.containerPhrasing(e,{after:i,before:u,...s.current()}));const d=f.charCodeAt(0),p=Hf(r.before.charCodeAt(r.before.length-1),d,i);p.inside&&(f=nu(d)+f.slice(1));const m=f.charCodeAt(f.length-1),v=Hf(r.after.charCodeAt(0),m,i);v.inside&&(f=f.slice(0,-1)+nu(m));const g=s.move(i+i);return o(),n.attentionEncodeSurroundingInfo={after:v.outside,before:p.outside},u+f+g}function NW(e,t,n){return n.options.strong||"*"}function OW(e,t,n,r){return n.safe(e.value,r)}function LW(e){const t=e.options.ruleRepetition||3;if(t<3)throw new Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function zW(e,t,n){const r=(PD(n)+(n.options.ruleSpaces?" ":"")).repeat(LW(n));return n.options.ruleSpaces?r.slice(0,-1):r}const ID={blockquote:iW,break:E_,code:uW,definition:fW,emphasis:RD,hardBreak:E_,heading:mW,html:DD,image:ND,imageReference:OD,inlineCode:LD,link:jD,linkReference:MD,list:_W,listItem:CW,paragraph:TW,root:RW,strong:FD,text:OW,thematicBreak:zW};function jW(){return{enter:{table:MW,tableData:__,tableHeader:__,tableRow:FW},exit:{codeText:IW,table:PW,tableData:vg,tableHeader:vg,tableRow:vg}}}function MW(e){const t=e._align;this.enter({type:"table",align:t.map(function(n){return n==="none"?null:n}),children:[]},e),this.data.inTable=!0}function PW(e){this.exit(e),this.data.inTable=void 0}function FW(e){this.enter({type:"tableRow",children:[]},e)}function vg(e){this.exit(e)}function __(e){this.enter({type:"tableCell",children:[]},e)}function IW(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,GW));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function GW(e,t){return t==="|"?t:e}function BW(e){const t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,o=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:` -`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:v,table:s,tableCell:f,tableRow:u}};function s(g,w,x,k){return d(p(g,x,k),g.align)}function u(g,w,x,k){const C=m(g,x,k),_=d([C]);return _.slice(0,_.indexOf(` -`))}function f(g,w,x,k){const C=x.enter("tableCell"),_=x.enter("phrasing"),T=x.containerPhrasing(g,{...k,before:o,after:o});return _(),C(),T}function d(g,w){return nW(g,{align:w,alignDelimiters:r,padding:n,stringLength:i})}function p(g,w,x){const k=g.children;let C=-1;const _=[],T=w.enter("table");for(;++C0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const aX={tokenize:hX,partial:!0};function oX(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:cX,continuation:{tokenize:fX},exit:dX}},text:{91:{name:"gfmFootnoteCall",tokenize:uX},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:lX,resolveTo:sX}}}}function lX(e,t,n){const r=this;let i=r.events.length;const o=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let s;for(;i--;){const f=r.events[i][1];if(f.type==="labelImage"){s=f;break}if(f.type==="gfmFootnoteCall"||f.type==="labelLink"||f.type==="label"||f.type==="image"||f.type==="link")break}return u;function u(f){if(!s||!s._balanced)return n(f);const d=Tr(r.sliceSerialize({start:s.end,end:r.now()}));return d.codePointAt(0)!==94||!o.includes(d.slice(1))?n(f):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(f),e.exit("gfmFootnoteCallLabelMarker"),t(f))}}function sX(e,t){let n=e.length;for(;n--;)if(e[n][1].type==="labelImage"&&e[n][0]==="enter"){e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;const o={type:"gfmFootnoteCallString",start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},s={type:"chunkString",contentType:"string",start:Object.assign({},o.start),end:Object.assign({},o.end)},u=[e[n+1],e[n+2],["enter",r,t],e[n+3],e[n+4],["enter",i,t],["exit",i,t],["enter",o,t],["enter",s,t],["exit",s,t],["exit",o,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(n,e.length-n+1,...u),e}function uX(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let o=0,s;return u;function u(m){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(m),e.exit("gfmFootnoteCallLabelMarker"),f}function f(m){return m!==94?n(m):(e.enter("gfmFootnoteCallMarker"),e.consume(m),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",d)}function d(m){if(o>999||m===93&&!s||m===null||m===91||Tt(m))return n(m);if(m===93){e.exit("chunkString");const v=e.exit("gfmFootnoteCallString");return i.includes(Tr(r.sliceSerialize(v)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(m),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(m)}return Tt(m)||(s=!0),o++,e.consume(m),m===92?p:d}function p(m){return m===91||m===92||m===93?(e.consume(m),o++,d):d(m)}}function cX(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let o,s=0,u;return f;function f(w){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(w),e.exit("gfmFootnoteDefinitionLabelMarker"),d}function d(w){return w===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(w),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",p):n(w)}function p(w){if(s>999||w===93&&!u||w===null||w===91||Tt(w))return n(w);if(w===93){e.exit("chunkString");const x=e.exit("gfmFootnoteDefinitionLabelString");return o=Tr(r.sliceSerialize(x)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(w),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),v}return Tt(w)||(u=!0),s++,e.consume(w),w===92?m:p}function m(w){return w===91||w===92||w===93?(e.consume(w),s++,p):p(w)}function v(w){return w===58?(e.enter("definitionMarker"),e.consume(w),e.exit("definitionMarker"),i.includes(o)||i.push(o),lt(e,g,"gfmFootnoteDefinitionWhitespace")):n(w)}function g(w){return t(w)}}function fX(e,t,n){return e.check(yu,t,e.attempt(aX,t,n))}function dX(e){e.exit("gfmFootnoteDefinition")}function hX(e,t,n){const r=this;return lt(e,i,"gfmFootnoteDefinitionIndent",5);function i(o){const s=r.events[r.events.length-1];return s&&s[1].type==="gfmFootnoteDefinitionIndent"&&s[2].sliceSerialize(s[1],!0).length===4?t(o):n(o)}}function pX(e){let n=(e||{}).singleTilde;const r={name:"strikethrough",tokenize:o,resolveAll:i};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function i(s,u){let f=-1;for(;++f1?f(w):(s.consume(w),m++,g);if(m<2&&!n)return f(w);const k=s.exit("strikethroughSequenceTemporary"),C=pl(w);return k._open=!C||C===2&&!!x,k._close=!x||x===2&&!!C,u(w)}}}class mX{constructor(){this.map=[]}add(t,n,r){gX(this,t,n,r)}consume(t){if(this.map.sort(function(o,s){return o[0]-s[0]}),this.map.length===0)return;let n=this.map.length;const r=[];for(;n>0;)n-=1,r.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];r.push(t.slice()),t.length=0;let i=r.pop();for(;i;){for(const o of i)t.push(o);i=r.pop()}this.map.length=0}}function gX(e,t,n,r){let i=0;if(!(n===0&&r.length===0)){for(;i-1;){const Y=r.events[V][1].type;if(Y==="lineEnding"||Y==="linePrefix")V--;else break}const q=V>-1?r.events[V][1].type:null,I=q==="tableHead"||q==="tableRow"?z:f;return I===z&&r.parser.lazy[r.now().line]?n(j):I(j)}function f(j){return e.enter("tableHead"),e.enter("tableRow"),d(j)}function d(j){return j===124||(s=!0,o+=1),p(j)}function p(j){return j===null?n(j):Ue(j)?o>1?(o=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(j),e.exit("lineEnding"),g):n(j):ut(j)?lt(e,p,"whitespace")(j):(o+=1,s&&(s=!1,i+=1),j===124?(e.enter("tableCellDivider"),e.consume(j),e.exit("tableCellDivider"),s=!0,p):(e.enter("data"),m(j)))}function m(j){return j===null||j===124||Tt(j)?(e.exit("data"),p(j)):(e.consume(j),j===92?v:m)}function v(j){return j===92||j===124?(e.consume(j),m):m(j)}function g(j){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(j):(e.enter("tableDelimiterRow"),s=!1,ut(j)?lt(e,w,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(j):w(j))}function w(j){return j===45||j===58?k(j):j===124?(s=!0,e.enter("tableCellDivider"),e.consume(j),e.exit("tableCellDivider"),x):D(j)}function x(j){return ut(j)?lt(e,k,"whitespace")(j):k(j)}function k(j){return j===58?(o+=1,s=!0,e.enter("tableDelimiterMarker"),e.consume(j),e.exit("tableDelimiterMarker"),C):j===45?(o+=1,C(j)):j===null||Ue(j)?N(j):D(j)}function C(j){return j===45?(e.enter("tableDelimiterFiller"),_(j)):D(j)}function _(j){return j===45?(e.consume(j),_):j===58?(s=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(j),e.exit("tableDelimiterMarker"),T):(e.exit("tableDelimiterFiller"),T(j))}function T(j){return ut(j)?lt(e,N,"whitespace")(j):N(j)}function N(j){return j===124?w(j):j===null||Ue(j)?!s||i!==o?D(j):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(j)):D(j)}function D(j){return n(j)}function z(j){return e.enter("tableRow"),R(j)}function R(j){return j===124?(e.enter("tableCellDivider"),e.consume(j),e.exit("tableCellDivider"),R):j===null||Ue(j)?(e.exit("tableRow"),t(j)):ut(j)?lt(e,R,"whitespace")(j):(e.enter("data"),B(j))}function B(j){return j===null||j===124||Tt(j)?(e.exit("data"),R(j)):(e.consume(j),j===92?P:B)}function P(j){return j===92||j===124?(e.consume(j),B):B(j)}}function xX(e,t){let n=-1,r=!0,i=0,o=[0,0,0,0],s=[0,0,0,0],u=!1,f=0,d,p,m;const v=new mX;for(;++nn[2]+1){const w=n[2]+1,x=n[3]-n[2]-1;e.add(w,x,[])}}e.add(n[3]+1,0,[["exit",m,t]])}return i!==void 0&&(o.end=Object.assign({},el(t.events,i)),e.add(i,0,[["exit",o,t]]),o=void 0),o}function C_(e,t,n,r,i){const o=[],s=el(t.events,n);i&&(i.end=Object.assign({},s),o.push(["exit",i,t])),r.end=Object.assign({},s),o.push(["exit",r,t]),e.add(n+1,0,o)}function el(e,t){const n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}const wX={name:"tasklistCheck",tokenize:EX};function SX(){return{text:{91:wX}}}function EX(e,t,n){const r=this;return i;function i(f){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(f):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(f),e.exit("taskListCheckMarker"),o)}function o(f){return Tt(f)?(e.enter("taskListCheckValueUnchecked"),e.consume(f),e.exit("taskListCheckValueUnchecked"),s):f===88||f===120?(e.enter("taskListCheckValueChecked"),e.consume(f),e.exit("taskListCheckValueChecked"),s):n(f)}function s(f){return f===93?(e.enter("taskListCheckMarker"),e.consume(f),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),u):n(f)}function u(f){return Ue(f)?t(f):ut(f)?e.check({tokenize:_X},t,n)(f):n(f)}}function _X(e,t,n){return lt(e,r,"whitespace");function r(i){return i===null?n(i):t(i)}}function kX(e){return rD([KW(),oX(),pX(e),yX(),SX()])}const CX={};function TX(e){const t=this,n=e||CX,r=t.data(),i=r.micromarkExtensions||(r.micromarkExtensions=[]),o=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),s=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);i.push(kX(n)),o.push(qW()),s.push(YW(n))}function AX(e){const t=this;t.compiler=n;function n(r,i){return Q2(r,{filePath:i.path,...e})}}function RX(){return{enter:{mathFlow:e,mathFlowFenceMeta:t,mathText:o},exit:{mathFlow:i,mathFlowFence:r,mathFlowFenceMeta:n,mathFlowValue:u,mathText:s,mathTextData:u}};function e(f){const d={type:"element",tagName:"code",properties:{className:["language-math","math-display"]},children:[]};this.enter({type:"math",meta:null,value:"",data:{hName:"pre",hChildren:[d]}},f)}function t(){this.buffer()}function n(){const f=this.resume(),d=this.stack[this.stack.length-1];d.type,d.meta=f}function r(){this.data.mathFlowInside||(this.buffer(),this.data.mathFlowInside=!0)}function i(f){const d=this.resume().replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),p=this.stack[this.stack.length-1];p.type,this.exit(f),p.value=d;const m=p.data.hChildren[0];m.type,m.tagName,m.children.push({type:"text",value:d}),this.data.mathFlowInside=void 0}function o(f){this.enter({type:"inlineMath",value:"",data:{hName:"code",hProperties:{className:["language-math","math-inline"]},hChildren:[]}},f),this.buffer()}function s(f){const d=this.resume(),p=this.stack[this.stack.length-1];p.type,this.exit(f),p.value=d,p.data.hChildren.push({type:"text",value:d})}function u(f){this.config.enter.data.call(this,f),this.config.exit.data.call(this,f)}}function DX(e){let t=(e||{}).singleDollarTextMath;return t==null&&(t=!0),r.peek=i,{unsafe:[{character:"\r",inConstruct:"mathFlowMeta"},{character:` -`,inConstruct:"mathFlowMeta"},{character:"$",after:t?void 0:"\\$",inConstruct:"phrasing"},{character:"$",inConstruct:"mathFlowMeta"},{atBreak:!0,character:"$",after:"\\$"}],handlers:{math:n,inlineMath:r}};function n(o,s,u,f){const d=o.value||"",p=u.createTracker(f),m="$".repeat(Math.max(AD(d,"$")+1,2)),v=u.enter("mathFlow");let g=p.move(m);if(o.meta){const w=u.enter("mathFlowMeta");g+=p.move(u.safe(o.meta,{after:` -`,before:g,encode:["$"],...p.current()})),w()}return g+=p.move(` -`),d&&(g+=p.move(d+` -`)),g+=p.move(m),v(),g}function r(o,s,u){let f=o.value||"",d=1;for(t||d++;new RegExp("(^|[^$])"+"\\$".repeat(d)+"([^$]|$)").test(f);)d++;const p="$".repeat(d);/[^ \r\n]/.test(f)&&(/^[ \r\n]/.test(f)&&/[ \r\n]$/.test(f)||/^\$|\$$/.test(f))&&(f=" "+f+" ");let m=-1;for(;++mS.jsx(yY,{className:"prose lg:prose-xs dark:prose-invert max-w-none text-base",remarkPlugins:[TX,IX],rehypePlugins:[AX],skipHtml:!1,children:e.content});function BX(){const[e,t]=E.useState(()=>Qe.getState().retrievalHistory||[]),[n,r]=E.useState(""),[i,o]=E.useState(!1),s=E.useRef(null),u=E.useCallback(()=>{var m;(m=s.current)==null||m.scrollIntoView({behavior:"smooth"})},[]),f=E.useCallback(async m=>{if(m.preventDefault(),!n.trim()||i)return;const v={content:n,role:"user"},g={content:"",role:"assistant"},w=[...e];t([...w,v,g]),r(""),o(!0);const x=(_,T)=>{g.content+=_,t(N=>{const D=[...N],z=D[D.length-1];return z.role==="assistant"&&(z.content=g.content,z.isError=T),D})},k=Qe.getState(),C={...k.querySettings,query:v.content,conversation_history:w.filter(_=>_.isError!==!0).map(_=>({role:_.role,content:_.content}))};try{if(k.querySettings.stream){let _="";await sM(C,x,T=>{_+=T}),_&&(g.content&&(_=g.content+` -`+_),x(_,!0))}else{const _=await lM(C);x(_.response)}}catch(_){x(`Error: Failed to get response -${Cr(_)}`,!0)}finally{o(!1),Qe.getState().setRetrievalHistory([...w,v,g])}},[n,i,e,t]),d=jy(e,100);E.useEffect(()=>u(),[d,u]);const p=E.useCallback(()=>{t([]),Qe.getState().setRetrievalHistory([])},[t]);return S.jsxs("div",{className:"flex size-full gap-2 px-2 pb-12",children:[S.jsxs("div",{className:"flex grow flex-col gap-4",children:[S.jsx("div",{className:"relative grow",children:S.jsx("div",{className:"bg-primary-foreground/60 absolute inset-0 flex flex-col overflow-auto rounded-lg border p-2",children:S.jsxs("div",{className:"flex min-h-0 flex-1 flex-col gap-2",children:[e.length===0?S.jsx("div",{className:"text-muted-foreground flex h-full items-center justify-center text-lg",children:"Start a retrieval by typing your query below"}):e.map((m,v)=>S.jsx("div",{className:`flex ${m.role==="user"?"justify-end":"justify-start"}`,children:S.jsxs("div",{className:`max-w-[80%] rounded-lg px-4 py-2 ${m.role==="user"?"bg-primary text-primary-foreground":m.isError?"bg-red-100 text-red-600 dark:bg-red-950 dark:text-red-400":"bg-muted"}`,children:[S.jsx("pre",{className:"break-words whitespace-pre-wrap",children:S.jsx(GX,{message:m})}),m.content.length===0&&S.jsx(jM,{className:"animate-spin duration-2000"})]})},v)),S.jsx("div",{ref:s,className:"pb-1"})]})})}),S.jsxs("form",{onSubmit:f,className:"flex shrink-0 items-center gap-2",children:[S.jsxs(Ot,{type:"button",variant:"outline",onClick:p,disabled:i,size:"sm",children:[S.jsx(wk,{}),"Clear"]}),S.jsx(Za,{className:"flex-1",value:n,onChange:m=>r(m.target.value),placeholder:"Type your query...",disabled:i}),S.jsxs(Ot,{type:"submit",variant:"default",disabled:i,size:"sm",children:[S.jsx(ZM,{}),"Send"]})]})]}),S.jsx(s8,{})]})}function UX(){return S.jsx("iframe",{src:G_+"/docs",className:"size-full"})}function HX(){const e=Mn.use.message(),t=Qe.use.enableHealthCheck(),[n]=E.useState(()=>Qe.getState().currentTab),[r,i]=E.useState(!1);E.useEffect(()=>{if(!t)return;Mn.getState().check();const s=setInterval(async()=>{await Mn.getState().check()},xz*1e3);return()=>clearInterval(s)},[t]);const o=E.useCallback(s=>Qe.getState().setCurrentTab(s),[]);return E.useEffect(()=>{if(e&&(e.includes(vk)||e.includes(yk))){i(!0);return}i(!1)},[e,i]),S.jsx(_z,{children:S.jsxs("main",{className:"flex h-screen w-screen overflow-x-hidden",children:[S.jsxs(C3,{defaultValue:n,className:"!m-0 flex grow flex-col !p-0",onValueChange:o,children:[S.jsx(A3,{}),S.jsxs("div",{className:"relative grow",children:[S.jsx(Ps,{value:"documents",className:"absolute top-0 right-0 bottom-0 left-0",children:S.jsx(u9,{})}),S.jsx(Ps,{value:"knowledge-graph",className:"absolute top-0 right-0 bottom-0 left-0",children:S.jsx(LH,{})}),S.jsx(Ps,{value:"retrieval",className:"absolute top-0 right-0 bottom-0 left-0",children:S.jsx(BX,{})}),S.jsx(Ps,{value:"api",className:"absolute top-0 right-0 bottom-0 left-0",children:S.jsx(UX,{})})]})]}),t&&S.jsx(s3,{}),e!==null&&!r&&S.jsx(cP,{}),r&&S.jsx(WI,{}),S.jsx(YI,{})]})})}vL.createRoot(document.getElementById("root")).render(S.jsx(E.StrictMode,{children:S.jsx(HX,{})})); diff --git a/lightrag/api/webui/assets/index-CLsJV-0i.css b/lightrag/api/webui/assets/index-CLsJV-0i.css deleted file mode 100644 index 0e1032b4..00000000 --- a/lightrag/api/webui/assets/index-CLsJV-0i.css +++ /dev/null @@ -1 +0,0 @@ -/*! tailwindcss v4.0.7 | 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!important}.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}.list-item{display:list-item}.table{display:table}.table-cell{display:table-cell}.table-row{display:table-row}.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-40{height:calc(var(--spacing)*40)}.h-52{height:calc(var(--spacing)*52)}.h-84{height:calc(var(--spacing)*84)}.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-100{background-color:var(--color-red-100)}.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)}.lowercase{text-transform:lowercase}.uppercase{text-transform:uppercase}.italic{font-style:italic}.ordinal{--tw-ordinal:ordinal;font-variant-numeric:var(--tw-ordinal,)var(--tw-slashed-zero,)var(--tw-numeric-figure,)var(--tw-numeric-spacing,)var(--tw-numeric-fraction,)}.overline{text-decoration-line:overline}.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}.ring{--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)}.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)}.dark\:bg-red-950:is(.dark *){background-color:var(--color-red-950)}.dark\:text-red-400:is(.dark *){color:var(--color-red-400)}.\[\&_\[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-ordinal{syntax:"*";inherits:false}@property --tw-slashed-zero{syntax:"*";inherits:false}@property --tw-numeric-figure{syntax:"*";inherits:false}@property --tw-numeric-spacing{syntax:"*";inherits:false}@property --tw-numeric-fraction{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-drop-shadow{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-DbuMPJAD.js b/lightrag/api/webui/assets/index-DbuMPJAD.js new file mode 100644 index 00000000..5cc7b4c2 --- /dev/null +++ b/lightrag/api/webui/assets/index-DbuMPJAD.js @@ -0,0 +1,1120 @@ +var cH=Object.defineProperty;var dH=(e,t,n)=>t in e?cH(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Ea=(e,t,n)=>dH(e,typeof t!="symbol"?t+"":t,n);function fH(e,t){for(var n=0;nr[a]})}}}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 a of document.querySelectorAll('link[rel="modulepreload"]'))r(a);new MutationObserver(a=>{for(const i of a)if(i.type==="childList")for(const l of i.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&r(l)}).observe(document,{childList:!0,subtree:!0});function n(a){const i={};return a.integrity&&(i.integrity=a.integrity),a.referrerPolicy&&(i.referrerPolicy=a.referrerPolicy),a.crossOrigin==="use-credentials"?i.credentials="include":a.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(a){if(a.ep)return;a.ep=!0;const i=n(a);fetch(a.href,i)}})();var Cd=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function an(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function pH(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var n=function r(){return this instanceof r?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(r){var a=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,a.get?a:{enumerable:!0,get:function(){return e[r]}})}),n}var eh={exports:{}},Ds={};/** + * @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 $1;function gH(){if($1)return Ds;$1=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(r,a,i){var l=null;if(i!==void 0&&(l=""+i),a.key!==void 0&&(l=""+a.key),"key"in a){i={};for(var u in a)u!=="key"&&(i[u]=a[u])}else i=a;return a=i.ref,{$$typeof:e,type:r,key:l,ref:a!==void 0?a:null,props:i}}return Ds.Fragment=t,Ds.jsx=n,Ds.jsxs=n,Ds}var q1;function hH(){return q1||(q1=1,eh.exports=gH()),eh.exports}var w=hH(),th={exports:{}},at={};/** + * @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 V1;function mH(){if(V1)return at;V1=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),i=Symbol.for("react.consumer"),l=Symbol.for("react.context"),u=Symbol.for("react.forward_ref"),c=Symbol.for("react.suspense"),f=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),g=Symbol.iterator;function b(D){return D===null||typeof D!="object"?null:(D=g&&D[g]||D["@@iterator"],typeof D=="function"?D:null)}var m={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},S=Object.assign,v={};function A(D,V,B){this.props=D,this.context=V,this.refs=v,this.updater=B||m}A.prototype.isReactComponent={},A.prototype.setState=function(D,V){if(typeof D!="object"&&typeof D!="function"&&D!=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,D,V,"setState")},A.prototype.forceUpdate=function(D){this.updater.enqueueForceUpdate(this,D,"forceUpdate")};function R(){}R.prototype=A.prototype;function x(D,V,B){this.props=D,this.context=V,this.refs=v,this.updater=B||m}var _=x.prototype=new R;_.constructor=x,S(_,A.prototype),_.isPureReactComponent=!0;var C=Array.isArray,N={H:null,A:null,T:null,S:null},T=Object.prototype.hasOwnProperty;function O(D,V,B,L,Y,Q){return B=Q.ref,{$$typeof:e,type:D,key:V,ref:B!==void 0?B:null,props:Q}}function z(D,V){return O(D.type,V,void 0,void 0,void 0,D.props)}function I(D){return typeof D=="object"&&D!==null&&D.$$typeof===e}function M(D){var V={"=":"=0",":":"=2"};return"$"+D.replace(/[=:]/g,function(B){return V[B]})}var H=/\/+/g;function q(D,V){return typeof D=="object"&&D!==null&&D.key!=null?M(""+D.key):V.toString(36)}function U(){}function W(D){switch(D.status){case"fulfilled":return D.value;case"rejected":throw D.reason;default:switch(typeof D.status=="string"?D.then(U,U):(D.status="pending",D.then(function(V){D.status==="pending"&&(D.status="fulfilled",D.value=V)},function(V){D.status==="pending"&&(D.status="rejected",D.reason=V)})),D.status){case"fulfilled":return D.value;case"rejected":throw D.reason}}throw D}function Z(D,V,B,L,Y){var Q=typeof D;(Q==="undefined"||Q==="boolean")&&(D=null);var se=!1;if(D===null)se=!0;else switch(Q){case"bigint":case"string":case"number":se=!0;break;case"object":switch(D.$$typeof){case e:case t:se=!0;break;case p:return se=D._init,Z(se(D._payload),V,B,L,Y)}}if(se)return Y=Y(D),se=L===""?"."+q(D,0):L,C(Y)?(B="",se!=null&&(B=se.replace(H,"$&/")+"/"),Z(Y,V,B,"",function(Ae){return Ae})):Y!=null&&(I(Y)&&(Y=z(Y,B+(Y.key==null||D&&D.key===Y.key?"":(""+Y.key).replace(H,"$&/")+"/")+se)),V.push(Y)),1;se=0;var re=L===""?".":L+":";if(C(D))for(var le=0;le>>1,D=j[X];if(0>>1;Xa(L,P))Ya(Q,L)?(j[X]=Q,j[Y]=P,X=Y):(j[X]=L,j[B]=P,X=B);else if(Ya(Q,P))j[X]=Q,j[Y]=P,X=Y;else break e}}return G}function a(j,G){var P=j.sortIndex-G.sortIndex;return P!==0?P:j.id-G.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var l=Date,u=l.now();e.unstable_now=function(){return l.now()-u}}var c=[],f=[],p=1,g=null,b=3,m=!1,S=!1,v=!1,A=typeof setTimeout=="function"?setTimeout:null,R=typeof clearTimeout=="function"?clearTimeout:null,x=typeof setImmediate<"u"?setImmediate:null;function _(j){for(var G=n(f);G!==null;){if(G.callback===null)r(f);else if(G.startTime<=j)r(f),G.sortIndex=G.expirationTime,t(c,G);else break;G=n(f)}}function C(j){if(v=!1,_(j),!S)if(n(c)!==null)S=!0,W();else{var G=n(f);G!==null&&Z(C,G.startTime-j)}}var N=!1,T=-1,O=5,z=-1;function I(){return!(e.unstable_now()-zj&&I());){var X=g.callback;if(typeof X=="function"){g.callback=null,b=g.priorityLevel;var D=X(g.expirationTime<=j);if(j=e.unstable_now(),typeof D=="function"){g.callback=D,_(j),G=!0;break t}g===n(c)&&r(c),_(j)}else r(c);g=n(c)}if(g!==null)G=!0;else{var V=n(f);V!==null&&Z(C,V.startTime-j),G=!1}}break e}finally{g=null,b=P,m=!1}G=void 0}}finally{G?H():N=!1}}}var H;if(typeof x=="function")H=function(){x(M)};else if(typeof MessageChannel<"u"){var q=new MessageChannel,U=q.port2;q.port1.onmessage=M,H=function(){U.postMessage(null)}}else H=function(){A(M,0)};function W(){N||(N=!0,H())}function Z(j,G){T=A(function(){j(e.unstable_now())},G)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(j){j.callback=null},e.unstable_continueExecution=function(){S||m||(S=!0,W())},e.unstable_forceFrameRate=function(j){0>j||125X?(j.sortIndex=P,t(f,j),n(c)===null&&j===n(f)&&(v?(R(T),T=-1):v=!0,Z(C,P-X))):(j.sortIndex=D,t(c,j),S||m||(S=!0,W())),j},e.unstable_shouldYield=I,e.unstable_wrapCallback=function(j){var G=b;return function(){var P=b;b=G;try{return j.apply(this,arguments)}finally{b=P}}}}(ah)),ah}var K1;function vH(){return K1||(K1=1,rh.exports=yH()),rh.exports}var oh={exports:{}},bn={};/** + * @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 X1;function SH(){if(X1)return bn;X1=1;var e=nf();function t(c){var f="https://react.dev/errors/"+c;if(1"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),oh.exports=SH(),oh.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 Q1;function EH(){if(Q1)return Is;Q1=1;var e=vH(),t=nf(),n=mz();function r(o){var s="https://react.dev/errors/"+o;if(1)":-1y||K[h]!==ne[y]){var be=` +`+K[h].replace(" at new "," at ");return o.displayName&&be.includes("")&&(be=be.replace("",o.displayName)),be}while(1<=h&&0<=y);break}}}finally{W=!1,Error.prepareStackTrace=d}return(d=o?o.displayName||o.name:"")?U(d):""}function j(o){switch(o.tag){case 26:case 27:case 5:return U(o.type);case 16:return U("Lazy");case 13:return U("Suspense");case 19:return U("SuspenseList");case 0:case 15:return o=Z(o.type,!1),o;case 11:return o=Z(o.type.render,!1),o;case 1:return o=Z(o.type,!0),o;default:return""}}function G(o){try{var s="";do s+=j(o),o=o.return;while(o);return s}catch(d){return` +Error generating stack: `+d.message+` +`+d.stack}}function P(o){var s=o,d=o;if(o.alternate)for(;s.return;)s=s.return;else{o=s;do s=o,s.flags&4098&&(d=s.return),o=s.return;while(o)}return s.tag===3?d:null}function X(o){if(o.tag===13){var s=o.memoizedState;if(s===null&&(o=o.alternate,o!==null&&(s=o.memoizedState)),s!==null)return s.dehydrated}return null}function D(o){if(P(o)!==o)throw Error(r(188))}function V(o){var s=o.alternate;if(!s){if(s=P(o),s===null)throw Error(r(188));return s!==o?null:o}for(var d=o,h=s;;){var y=d.return;if(y===null)break;var E=y.alternate;if(E===null){if(h=y.return,h!==null){d=h;continue}break}if(y.child===E.child){for(E=y.child;E;){if(E===d)return D(y),o;if(E===h)return D(y),s;E=E.sibling}throw Error(r(188))}if(d.return!==h.return)d=y,h=E;else{for(var F=!1,$=y.child;$;){if($===d){F=!0,d=y,h=E;break}if($===h){F=!0,h=y,d=E;break}$=$.sibling}if(!F){for($=E.child;$;){if($===d){F=!0,d=E,h=y;break}if($===h){F=!0,h=E,d=y;break}$=$.sibling}if(!F)throw Error(r(189))}}if(d.alternate!==h)throw Error(r(190))}if(d.tag!==3)throw Error(r(188));return d.stateNode.current===d?o:s}function B(o){var s=o.tag;if(s===5||s===26||s===27||s===6)return o;for(o=o.child;o!==null;){if(s=B(o),s!==null)return s;o=o.sibling}return null}var L=Array.isArray,Y=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Q={pending:!1,data:null,method:null,action:null},se=[],re=-1;function le(o){return{current:o}}function Ae(o){0>re||(o.current=se[re],se[re]=null,re--)}function ae(o,s){re++,se[re]=o.current,o.current=s}var we=le(null),xe=le(null),Ie=le(null),Ce=le(null);function Ee(o,s){switch(ae(Ie,s),ae(xe,o),ae(we,null),o=s.nodeType,o){case 9:case 11:s=(s=s.documentElement)&&(s=s.namespaceURI)?v1(s):0;break;default:if(o=o===8?s.parentNode:s,s=o.tagName,o=o.namespaceURI)o=v1(o),s=S1(o,s);else switch(s){case"svg":s=1;break;case"math":s=2;break;default:s=0}}Ae(we),ae(we,s)}function J(){Ae(we),Ae(xe),Ae(Ie)}function fe(o){o.memoizedState!==null&&ae(Ce,o);var s=we.current,d=S1(s,o.type);s!==d&&(ae(xe,o),ae(we,d))}function ke(o){xe.current===o&&(Ae(we),Ae(xe)),Ce.current===o&&(Ae(Ce),_s._currentValue=Q)}var me=Object.prototype.hasOwnProperty,ve=e.unstable_scheduleCallback,ie=e.unstable_cancelCallback,ze=e.unstable_shouldYield,Pe=e.unstable_requestPaint,he=e.unstable_now,Ne=e.unstable_getCurrentPriorityLevel,ee=e.unstable_ImmediatePriority,ce=e.unstable_UserBlockingPriority,Re=e.unstable_NormalPriority,Fe=e.unstable_LowPriority,qe=e.unstable_IdlePriority,mt=e.log,St=e.unstable_setDisableYieldValue,pt=null,Je=null;function wt(o){if(Je&&typeof Je.onCommitFiberRoot=="function")try{Je.onCommitFiberRoot(pt,o,void 0,(o.current.flags&128)===128)}catch{}}function rt(o){if(typeof mt=="function"&&St(o),Je&&typeof Je.setStrictMode=="function")try{Je.setStrictMode(pt,o)}catch{}}var bt=Math.clz32?Math.clz32:Mt,Bt=Math.log,sn=Math.LN2;function Mt(o){return o>>>=0,o===0?32:31-(Bt(o)/sn|0)|0}var er=128,zr=4194304;function Kt(o){var s=o&42;if(s!==0)return s;switch(o&-o){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 o&4194176;case 4194304:case 8388608:case 16777216:case 33554432:return o&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return o}}function na(o,s){var d=o.pendingLanes;if(d===0)return 0;var h=0,y=o.suspendedLanes,E=o.pingedLanes,F=o.warmLanes;o=o.finishedLanes!==0;var $=d&134217727;return $!==0?(d=$&~y,d!==0?h=Kt(d):(E&=$,E!==0?h=Kt(E):o||(F=$&~F,F!==0&&(h=Kt(F))))):($=d&~y,$!==0?h=Kt($):E!==0?h=Kt(E):o||(F=d&~F,F!==0&&(h=Kt(F)))),h===0?0:s!==0&&s!==h&&!(s&y)&&(y=h&-h,F=s&-s,y>=F||y===32&&(F&4194176)!==0)?s:h}function Ye(o,s){return(o.pendingLanes&~(o.suspendedLanes&~o.pingedLanes)&s)===0}function gt(o,s){switch(o){case 1:case 2:case 4:case 8:return s+250;case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return s+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function _t(){var o=er;return er<<=1,!(er&4194176)&&(er=128),o}function Rn(){var o=zr;return zr<<=1,!(zr&62914560)&&(zr=4194304),o}function kn(o){for(var s=[],d=0;31>d;d++)s.push(o);return s}function Cn(o,s){o.pendingLanes|=s,s!==268435456&&(o.suspendedLanes=0,o.pingedLanes=0,o.warmLanes=0)}function ra(o,s,d,h,y,E){var F=o.pendingLanes;o.pendingLanes=d,o.suspendedLanes=0,o.pingedLanes=0,o.warmLanes=0,o.expiredLanes&=d,o.entangledLanes&=d,o.errorRecoveryDisabledLanes&=d,o.shellSuspendCounter=0;var $=o.entanglements,K=o.expirationTimes,ne=o.hiddenUpdates;for(d=F&~d;0"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),rG=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]*$"),SA={},EA={};function aG(o){return me.call(EA,o)?!0:me.call(SA,o)?!1:rG.test(o)?EA[o]=!0:(SA[o]=!0,!1)}function Cu(o,s,d){if(aG(s))if(d===null)o.removeAttribute(s);else{switch(typeof d){case"undefined":case"function":case"symbol":o.removeAttribute(s);return;case"boolean":var h=s.toLowerCase().slice(0,5);if(h!=="data-"&&h!=="aria-"){o.removeAttribute(s);return}}o.setAttribute(s,""+d)}}function Nu(o,s,d){if(d===null)o.removeAttribute(s);else{switch(typeof d){case"undefined":case"function":case"symbol":case"boolean":o.removeAttribute(s);return}o.setAttribute(s,""+d)}}function oa(o,s,d,h){if(h===null)o.removeAttribute(d);else{switch(typeof h){case"undefined":case"function":case"symbol":case"boolean":o.removeAttribute(d);return}o.setAttributeNS(s,d,""+h)}}function tr(o){switch(typeof o){case"bigint":case"boolean":case"number":case"string":case"undefined":return o;case"object":return o;default:return""}}function wA(o){var s=o.type;return(o=o.nodeName)&&o.toLowerCase()==="input"&&(s==="checkbox"||s==="radio")}function oG(o){var s=wA(o)?"checked":"value",d=Object.getOwnPropertyDescriptor(o.constructor.prototype,s),h=""+o[s];if(!o.hasOwnProperty(s)&&typeof d<"u"&&typeof d.get=="function"&&typeof d.set=="function"){var y=d.get,E=d.set;return Object.defineProperty(o,s,{configurable:!0,get:function(){return y.call(this)},set:function(F){h=""+F,E.call(this,F)}}),Object.defineProperty(o,s,{enumerable:d.enumerable}),{getValue:function(){return h},setValue:function(F){h=""+F},stopTracking:function(){o._valueTracker=null,delete o[s]}}}}function Ou(o){o._valueTracker||(o._valueTracker=oG(o))}function xA(o){if(!o)return!1;var s=o._valueTracker;if(!s)return!0;var d=s.getValue(),h="";return o&&(h=wA(o)?o.checked?"true":"false":o.value),o=h,o!==d?(s.setValue(o),!0):!1}function Du(o){if(o=o||(typeof document<"u"?document:void 0),typeof o>"u")return null;try{return o.activeElement||o.body}catch{return o.body}}var iG=/[\n"\\]/g;function nr(o){return o.replace(iG,function(s){return"\\"+s.charCodeAt(0).toString(16)+" "})}function Qf(o,s,d,h,y,E,F,$){o.name="",F!=null&&typeof F!="function"&&typeof F!="symbol"&&typeof F!="boolean"?o.type=F:o.removeAttribute("type"),s!=null?F==="number"?(s===0&&o.value===""||o.value!=s)&&(o.value=""+tr(s)):o.value!==""+tr(s)&&(o.value=""+tr(s)):F!=="submit"&&F!=="reset"||o.removeAttribute("value"),s!=null?Jf(o,F,tr(s)):d!=null?Jf(o,F,tr(d)):h!=null&&o.removeAttribute("value"),y==null&&E!=null&&(o.defaultChecked=!!E),y!=null&&(o.checked=y&&typeof y!="function"&&typeof y!="symbol"),$!=null&&typeof $!="function"&&typeof $!="symbol"&&typeof $!="boolean"?o.name=""+tr($):o.removeAttribute("name")}function kA(o,s,d,h,y,E,F,$){if(E!=null&&typeof E!="function"&&typeof E!="symbol"&&typeof E!="boolean"&&(o.type=E),s!=null||d!=null){if(!(E!=="submit"&&E!=="reset"||s!=null))return;d=d!=null?""+tr(d):"",s=s!=null?""+tr(s):d,$||s===o.value||(o.value=s),o.defaultValue=s}h=h??y,h=typeof h!="function"&&typeof h!="symbol"&&!!h,o.checked=$?o.checked:!!h,o.defaultChecked=!!h,F!=null&&typeof F!="function"&&typeof F!="symbol"&&typeof F!="boolean"&&(o.name=F)}function Jf(o,s,d){s==="number"&&Du(o.ownerDocument)===o||o.defaultValue===""+d||(o.defaultValue=""+d)}function bi(o,s,d,h){if(o=o.options,s){s={};for(var y=0;y=ql),zA=" ",PA=!1;function BA(o,s){switch(o){case"keyup":return LG.indexOf(s.keyCode)!==-1;case"keydown":return s.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function UA(o){return o=o.detail,typeof o=="object"&&"data"in o?o.data:null}var Ei=!1;function FG(o,s){switch(o){case"compositionend":return UA(s);case"keypress":return s.which!==32?null:(PA=!0,zA);case"textInput":return o=s.data,o===zA&&PA?null:o;default:return null}}function zG(o,s){if(Ei)return o==="compositionend"||!cp&&BA(o,s)?(o=OA(),Lu=op=Pa=null,Ei=!1,o):null;switch(o){case"paste":return null;case"keypress":if(!(s.ctrlKey||s.altKey||s.metaKey)||s.ctrlKey&&s.altKey){if(s.char&&1=s)return{node:d,offset:s-o};o=h}e:{for(;d;){if(d.nextSibling){d=d.nextSibling;break e}d=d.parentNode}d=void 0}d=YA(d)}}function XA(o,s){return o&&s?o===s?!0:o&&o.nodeType===3?!1:s&&s.nodeType===3?XA(o,s.parentNode):"contains"in o?o.contains(s):o.compareDocumentPosition?!!(o.compareDocumentPosition(s)&16):!1:!1}function ZA(o){o=o!=null&&o.ownerDocument!=null&&o.ownerDocument.defaultView!=null?o.ownerDocument.defaultView:window;for(var s=Du(o.document);s instanceof o.HTMLIFrameElement;){try{var d=typeof s.contentWindow.location.href=="string"}catch{d=!1}if(d)o=s.contentWindow;else break;s=Du(o.document)}return s}function pp(o){var s=o&&o.nodeName&&o.nodeName.toLowerCase();return s&&(s==="input"&&(o.type==="text"||o.type==="search"||o.type==="tel"||o.type==="url"||o.type==="password")||s==="textarea"||o.contentEditable==="true")}function qG(o,s){var d=ZA(s);s=o.focusedElem;var h=o.selectionRange;if(d!==s&&s&&s.ownerDocument&&XA(s.ownerDocument.documentElement,s)){if(h!==null&&pp(s)){if(o=h.start,d=h.end,d===void 0&&(d=o),"selectionStart"in s)s.selectionStart=o,s.selectionEnd=Math.min(d,s.value.length);else if(d=(o=s.ownerDocument||document)&&o.defaultView||window,d.getSelection){d=d.getSelection();var y=s.textContent.length,E=Math.min(h.start,y);h=h.end===void 0?E:Math.min(h.end,y),!d.extend&&E>h&&(y=h,h=E,E=y),y=KA(s,E);var F=KA(s,h);y&&F&&(d.rangeCount!==1||d.anchorNode!==y.node||d.anchorOffset!==y.offset||d.focusNode!==F.node||d.focusOffset!==F.offset)&&(o=o.createRange(),o.setStart(y.node,y.offset),d.removeAllRanges(),E>h?(d.addRange(o),d.extend(F.node,F.offset)):(o.setEnd(F.node,F.offset),d.addRange(o)))}}for(o=[],d=s;d=d.parentNode;)d.nodeType===1&&o.push({element:d,left:d.scrollLeft,top:d.scrollTop});for(typeof s.focus=="function"&&s.focus(),s=0;s=document.documentMode,wi=null,gp=null,Kl=null,hp=!1;function QA(o,s,d){var h=d.window===d?d.document:d.nodeType===9?d:d.ownerDocument;hp||wi==null||wi!==Du(h)||(h=wi,"selectionStart"in h&&pp(h)?h={start:h.selectionStart,end:h.selectionEnd}:(h=(h.ownerDocument&&h.ownerDocument.defaultView||window).getSelection(),h={anchorNode:h.anchorNode,anchorOffset:h.anchorOffset,focusNode:h.focusNode,focusOffset:h.focusOffset}),Kl&&Yl(Kl,h)||(Kl=h,h=Ec(gp,"onSelect"),0>=F,y-=F,ia=1<<32-bt(s)+y|d<Qe?(nn=Ve,Ve=null):nn=Ve.sibling;var vt=de(oe,Ve,ue[Qe],Se);if(vt===null){Ve===null&&(Ve=nn);break}o&&Ve&&vt.alternate===null&&s(oe,Ve),te=E(vt,te,Qe),it===null?Ue=vt:it.sibling=vt,it=vt,Ve=nn}if(Qe===ue.length)return d(oe,Ve),yt&&Do(oe,Qe),Ue;if(Ve===null){for(;QeQe?(nn=Ve,Ve=null):nn=Ve.sibling;var ao=de(oe,Ve,vt.value,Se);if(ao===null){Ve===null&&(Ve=nn);break}o&&Ve&&ao.alternate===null&&s(oe,Ve),te=E(ao,te,Qe),it===null?Ue=ao:it.sibling=ao,it=ao,Ve=nn}if(vt.done)return d(oe,Ve),yt&&Do(oe,Qe),Ue;if(Ve===null){for(;!vt.done;Qe++,vt=ue.next())vt=Te(oe,vt.value,Se),vt!==null&&(te=E(vt,te,Qe),it===null?Ue=vt:it.sibling=vt,it=vt);return yt&&Do(oe,Qe),Ue}for(Ve=h(Ve);!vt.done;Qe++,vt=ue.next())vt=ge(Ve,oe,Qe,vt.value,Se),vt!==null&&(o&&vt.alternate!==null&&Ve.delete(vt.key===null?Qe:vt.key),te=E(vt,te,Qe),it===null?Ue=vt:it.sibling=vt,it=vt);return o&&Ve.forEach(function(uH){return s(oe,uH)}),yt&&Do(oe,Qe),Ue}function Gt(oe,te,ue,Se){if(typeof ue=="object"&&ue!==null&&ue.type===c&&ue.key===null&&(ue=ue.props.children),typeof ue=="object"&&ue!==null){switch(ue.$$typeof){case l:e:{for(var Ue=ue.key;te!==null;){if(te.key===Ue){if(Ue=ue.type,Ue===c){if(te.tag===7){d(oe,te.sibling),Se=y(te,ue.props.children),Se.return=oe,oe=Se;break e}}else if(te.elementType===Ue||typeof Ue=="object"&&Ue!==null&&Ue.$$typeof===x&&hT(Ue)===te.type){d(oe,te.sibling),Se=y(te,ue.props),ns(Se,ue),Se.return=oe,oe=Se;break e}d(oe,te);break}else s(oe,te);te=te.sibling}ue.type===c?(Se=Ho(ue.props.children,oe.mode,Se,ue.key),Se.return=oe,oe=Se):(Se=dc(ue.type,ue.key,ue.props,null,oe.mode,Se),ns(Se,ue),Se.return=oe,oe=Se)}return F(oe);case u:e:{for(Ue=ue.key;te!==null;){if(te.key===Ue)if(te.tag===4&&te.stateNode.containerInfo===ue.containerInfo&&te.stateNode.implementation===ue.implementation){d(oe,te.sibling),Se=y(te,ue.children||[]),Se.return=oe,oe=Se;break e}else{d(oe,te);break}else s(oe,te);te=te.sibling}Se=bg(ue,oe.mode,Se),Se.return=oe,oe=Se}return F(oe);case x:return Ue=ue._init,ue=Ue(ue._payload),Gt(oe,te,ue,Se)}if(L(ue))return He(oe,te,ue,Se);if(T(ue)){if(Ue=T(ue),typeof Ue!="function")throw Error(r(150));return ue=Ue.call(ue),et(oe,te,ue,Se)}if(typeof ue.then=="function")return Gt(oe,te,Vu(ue),Se);if(ue.$$typeof===m)return Gt(oe,te,sc(oe,ue),Se);Wu(oe,ue)}return typeof ue=="string"&&ue!==""||typeof ue=="number"||typeof ue=="bigint"?(ue=""+ue,te!==null&&te.tag===6?(d(oe,te.sibling),Se=y(te,ue),Se.return=oe,oe=Se):(d(oe,te),Se=mg(ue,oe.mode,Se),Se.return=oe,oe=Se),F(oe)):d(oe,te)}return function(oe,te,ue,Se){try{ts=0;var Ue=Gt(oe,te,ue,Se);return Ri=null,Ue}catch(Ve){if(Ve===Jl)throw Ve;var it=cr(29,Ve,null,oe.mode);return it.lanes=Se,it.return=oe,it}finally{}}}var Lo=mT(!0),bT=mT(!1),Ci=le(null),Yu=le(0);function yT(o,s){o=ya,ae(Yu,o),ae(Ci,s),ya=o|s.baseLanes}function xp(){ae(Yu,ya),ae(Ci,Ci.current)}function kp(){ya=Yu.current,Ae(Ci),Ae(Yu)}var lr=le(null),Br=null;function Ua(o){var s=o.alternate;ae(Xt,Xt.current&1),ae(lr,o),Br===null&&(s===null||Ci.current!==null||s.memoizedState!==null)&&(Br=o)}function vT(o){if(o.tag===22){if(ae(Xt,Xt.current),ae(lr,o),Br===null){var s=o.alternate;s!==null&&s.memoizedState!==null&&(Br=o)}}else ja()}function ja(){ae(Xt,Xt.current),ae(lr,lr.current)}function sa(o){Ae(lr),Br===o&&(Br=null),Ae(Xt)}var Xt=le(0);function Ku(o){for(var s=o;s!==null;){if(s.tag===13){var d=s.memoizedState;if(d!==null&&(d=d.dehydrated,d===null||d.data==="$?"||d.data==="$!"))return s}else if(s.tag===19&&s.memoizedProps.revealOrder!==void 0){if(s.flags&128)return s}else if(s.child!==null){s.child.return=s,s=s.child;continue}if(s===o)break;for(;s.sibling===null;){if(s.return===null||s.return===o)return null;s=s.return}s.sibling.return=s.return,s=s.sibling}return null}var XG=typeof AbortController<"u"?AbortController:function(){var o=[],s=this.signal={aborted:!1,addEventListener:function(d,h){o.push(h)}};this.abort=function(){s.aborted=!0,o.forEach(function(d){return d()})}},ZG=e.unstable_scheduleCallback,QG=e.unstable_NormalPriority,Zt={$$typeof:m,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Ap(){return{controller:new XG,data:new Map,refCount:0}}function rs(o){o.refCount--,o.refCount===0&&ZG(QG,function(){o.controller.abort()})}var as=null,Tp=0,Ni=0,Oi=null;function JG(o,s){if(as===null){var d=as=[];Tp=0,Ni=Dg(),Oi={status:"pending",value:void 0,then:function(h){d.push(h)}}}return Tp++,s.then(ST,ST),s}function ST(){if(--Tp===0&&as!==null){Oi!==null&&(Oi.status="fulfilled");var o=as;as=null,Ni=0,Oi=null;for(var s=0;sE?E:8;var F=I.T,$={};I.T=$,Hp(o,!1,s,d);try{var K=y(),ne=I.S;if(ne!==null&&ne($,K),K!==null&&typeof K=="object"&&typeof K.then=="function"){var be=e6(K,h);ls(o,s,be,Wn(o))}else ls(o,s,h,Wn(o))}catch(Te){ls(o,s,{then:function(){},status:"rejected",reason:Te},Wn())}finally{Y.p=E,I.T=F}}function o6(){}function jp(o,s,d,h){if(o.tag!==5)throw Error(r(476));var y=ZT(o).queue;XT(o,y,s,Q,d===null?o6:function(){return QT(o),d(h)})}function ZT(o){var s=o.memoizedState;if(s!==null)return s;s={memoizedState:Q,baseState:Q,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ua,lastRenderedState:Q},next:null};var d={};return s.next={memoizedState:d,baseState:d,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ua,lastRenderedState:d},next:null},o.memoizedState=s,o=o.alternate,o!==null&&(o.memoizedState=s),s}function QT(o){var s=ZT(o).next.queue;ls(o,s,{},Wn())}function Gp(){return mn(_s)}function JT(){return Vt().memoizedState}function e_(){return Vt().memoizedState}function i6(o){for(var s=o.return;s!==null;){switch(s.tag){case 24:case 3:var d=Wn();o=Va(d);var h=Wa(s,o,d);h!==null&&(Tn(h,s,d),cs(h,s,d)),s={cache:Ap()},o.payload=s;return}s=s.return}}function l6(o,s,d){var h=Wn();d={lane:h,revertLane:0,action:d,hasEagerState:!1,eagerState:null,next:null},ac(o)?n_(s,d):(d=yp(o,s,d,h),d!==null&&(Tn(d,o,h),r_(d,s,h)))}function t_(o,s,d){var h=Wn();ls(o,s,d,h)}function ls(o,s,d,h){var y={lane:h,revertLane:0,action:d,hasEagerState:!1,eagerState:null,next:null};if(ac(o))n_(s,y);else{var E=o.alternate;if(o.lanes===0&&(E===null||E.lanes===0)&&(E=s.lastRenderedReducer,E!==null))try{var F=s.lastRenderedState,$=E(F,d);if(y.hasEagerState=!0,y.eagerState=$,Hn($,F))return ju(o,s,y,0),Ot===null&&Uu(),!1}catch{}finally{}if(d=yp(o,s,y,h),d!==null)return Tn(d,o,h),r_(d,s,h),!0}return!1}function Hp(o,s,d,h){if(h={lane:2,revertLane:Dg(),action:h,hasEagerState:!1,eagerState:null,next:null},ac(o)){if(s)throw Error(r(479))}else s=yp(o,d,h,2),s!==null&&Tn(s,o,2)}function ac(o){var s=o.alternate;return o===ot||s!==null&&s===ot}function n_(o,s){Di=Zu=!0;var d=o.pending;d===null?s.next=s:(s.next=d.next,d.next=s),o.pending=s}function r_(o,s,d){if(d&4194176){var h=s.lanes;h&=o.pendingLanes,d|=h,s.lanes=d,Sr(o,d)}}var Ur={readContext:mn,use:ec,useCallback:Ht,useContext:Ht,useEffect:Ht,useImperativeHandle:Ht,useLayoutEffect:Ht,useInsertionEffect:Ht,useMemo:Ht,useReducer:Ht,useRef:Ht,useState:Ht,useDebugValue:Ht,useDeferredValue:Ht,useTransition:Ht,useSyncExternalStore:Ht,useId:Ht};Ur.useCacheRefresh=Ht,Ur.useMemoCache=Ht,Ur.useHostTransitionStatus=Ht,Ur.useFormState=Ht,Ur.useActionState=Ht,Ur.useOptimistic=Ht;var zo={readContext:mn,use:ec,useCallback:function(o,s){return In().memoizedState=[o,s===void 0?null:s],o},useContext:mn,useEffect:GT,useImperativeHandle:function(o,s,d){d=d!=null?d.concat([o]):null,nc(4194308,4,qT.bind(null,s,o),d)},useLayoutEffect:function(o,s){return nc(4194308,4,o,s)},useInsertionEffect:function(o,s){nc(4,2,o,s)},useMemo:function(o,s){var d=In();s=s===void 0?null:s;var h=o();if(Fo){rt(!0);try{o()}finally{rt(!1)}}return d.memoizedState=[h,s],h},useReducer:function(o,s,d){var h=In();if(d!==void 0){var y=d(s);if(Fo){rt(!0);try{d(s)}finally{rt(!1)}}}else y=s;return h.memoizedState=h.baseState=y,o={pending:null,lanes:0,dispatch:null,lastRenderedReducer:o,lastRenderedState:y},h.queue=o,o=o.dispatch=l6.bind(null,ot,o),[h.memoizedState,o]},useRef:function(o){var s=In();return o={current:o},s.memoizedState=o},useState:function(o){o=Fp(o);var s=o.queue,d=t_.bind(null,ot,s);return s.dispatch=d,[o.memoizedState,d]},useDebugValue:Bp,useDeferredValue:function(o,s){var d=In();return Up(d,o,s)},useTransition:function(){var o=Fp(!1);return o=XT.bind(null,ot,o.queue,!0,!1),In().memoizedState=o,[!1,o]},useSyncExternalStore:function(o,s,d){var h=ot,y=In();if(yt){if(d===void 0)throw Error(r(407));d=d()}else{if(d=s(),Ot===null)throw Error(r(349));ht&60||TT(h,s,d)}y.memoizedState=d;var E={value:d,getSnapshot:s};return y.queue=E,GT(RT.bind(null,h,E,o),[o]),h.flags|=2048,Li(9,_T.bind(null,h,E,d,s),{destroy:void 0},null),d},useId:function(){var o=In(),s=Ot.identifierPrefix;if(yt){var d=la,h=ia;d=(h&~(1<<32-bt(h)-1)).toString(32)+d,s=":"+s+"R"+d,d=Qu++,0 title"))),dn(E,h,d),E[hn]=o,Jt(E),h=E;break e;case"link":var F=N1("link","href",y).get(h+(d.href||""));if(F){for(var $=0;$<\/script>",o=o.removeChild(o.firstChild);break;case"select":o=typeof h.is=="string"?y.createElement("select",{is:h.is}):y.createElement("select"),h.multiple?o.multiple=!0:h.size&&(o.size=h.size);break;default:o=typeof h.is=="string"?y.createElement(d,{is:h.is}):y.createElement(d)}}o[hn]=s,o[On]=h;e:for(y=s.child;y!==null;){if(y.tag===5||y.tag===6)o.appendChild(y.stateNode);else if(y.tag!==4&&y.tag!==27&&y.child!==null){y.child.return=y,y=y.child;continue}if(y===s)break e;for(;y.sibling===null;){if(y.return===null||y.return===s)break e;y=y.return}y.sibling.return=y.return,y=y.sibling}s.stateNode=o;e:switch(dn(o,d,h),d){case"button":case"input":case"select":case"textarea":o=!!h.autoFocus;break e;case"img":o=!0;break e;default:o=!1}o&&ma(s)}}return Ft(s),s.flags&=-16777217,null;case 6:if(o&&s.stateNode!=null)o.memoizedProps!==h&&ma(s);else{if(typeof h!="string"&&s.stateNode===null)throw Error(r(166));if(o=Ie.current,Xl(s)){if(o=s.stateNode,d=s.memoizedProps,h=null,y=An,y!==null)switch(y.tag){case 27:case 5:h=y.memoizedProps}o[hn]=s,o=!!(o.nodeValue===d||h!==null&&h.suppressHydrationWarning===!0||y1(o.nodeValue,d)),o||Io(s)}else o=xc(o).createTextNode(h),o[hn]=s,s.stateNode=o}return Ft(s),null;case 13:if(h=s.memoizedState,o===null||o.memoizedState!==null&&o.memoizedState.dehydrated!==null){if(y=Xl(s),h!==null&&h.dehydrated!==null){if(o===null){if(!y)throw Error(r(318));if(y=s.memoizedState,y=y!==null?y.dehydrated:null,!y)throw Error(r(317));y[hn]=s}else Zl(),!(s.flags&128)&&(s.memoizedState=null),s.flags|=4;Ft(s),y=!1}else wr!==null&&(Ag(wr),wr=null),y=!0;if(!y)return s.flags&256?(sa(s),s):(sa(s),null)}if(sa(s),s.flags&128)return s.lanes=d,s;if(d=h!==null,o=o!==null&&o.memoizedState!==null,d){h=s.child,y=null,h.alternate!==null&&h.alternate.memoizedState!==null&&h.alternate.memoizedState.cachePool!==null&&(y=h.alternate.memoizedState.cachePool.pool);var E=null;h.memoizedState!==null&&h.memoizedState.cachePool!==null&&(E=h.memoizedState.cachePool.pool),E!==y&&(h.flags|=2048)}return d!==o&&d&&(s.child.flags|=8192),fc(s,s.updateQueue),Ft(s),null;case 4:return J(),o===null&&Fg(s.stateNode.containerInfo),Ft(s),null;case 10:return fa(s.type),Ft(s),null;case 19:if(Ae(Xt),y=s.memoizedState,y===null)return Ft(s),null;if(h=(s.flags&128)!==0,E=y.rendering,E===null)if(h)bs(y,!1);else{if(jt!==0||o!==null&&o.flags&128)for(o=s.child;o!==null;){if(E=Ku(o),E!==null){for(s.flags|=128,bs(y,!1),o=E.updateQueue,s.updateQueue=o,fc(s,o),s.subtreeFlags=0,o=d,d=s.child;d!==null;)V_(d,o),d=d.sibling;return ae(Xt,Xt.current&1|2),s.child}o=o.sibling}y.tail!==null&&he()>pc&&(s.flags|=128,h=!0,bs(y,!1),s.lanes=4194304)}else{if(!h)if(o=Ku(E),o!==null){if(s.flags|=128,h=!0,o=o.updateQueue,s.updateQueue=o,fc(s,o),bs(y,!0),y.tail===null&&y.tailMode==="hidden"&&!E.alternate&&!yt)return Ft(s),null}else 2*he()-y.renderingStartTime>pc&&d!==536870912&&(s.flags|=128,h=!0,bs(y,!1),s.lanes=4194304);y.isBackwards?(E.sibling=s.child,s.child=E):(o=y.last,o!==null?o.sibling=E:s.child=E,y.last=E)}return y.tail!==null?(s=y.tail,y.rendering=s,y.tail=s.sibling,y.renderingStartTime=he(),s.sibling=null,o=Xt.current,ae(Xt,h?o&1|2:o&1),s):(Ft(s),null);case 22:case 23:return sa(s),kp(),h=s.memoizedState!==null,o!==null?o.memoizedState!==null!==h&&(s.flags|=8192):h&&(s.flags|=8192),h?d&536870912&&!(s.flags&128)&&(Ft(s),s.subtreeFlags&6&&(s.flags|=8192)):Ft(s),d=s.updateQueue,d!==null&&fc(s,d.retryQueue),d=null,o!==null&&o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(d=o.memoizedState.cachePool.pool),h=null,s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(h=s.memoizedState.cachePool.pool),h!==d&&(s.flags|=2048),o!==null&&Ae(Mo),null;case 24:return d=null,o!==null&&(d=o.memoizedState.cache),s.memoizedState.cache!==d&&(s.flags|=2048),fa(Zt),Ft(s),null;case 25:return null}throw Error(r(156,s.tag))}function g6(o,s){switch(Sp(s),s.tag){case 1:return o=s.flags,o&65536?(s.flags=o&-65537|128,s):null;case 3:return fa(Zt),J(),o=s.flags,o&65536&&!(o&128)?(s.flags=o&-65537|128,s):null;case 26:case 27:case 5:return ke(s),null;case 13:if(sa(s),o=s.memoizedState,o!==null&&o.dehydrated!==null){if(s.alternate===null)throw Error(r(340));Zl()}return o=s.flags,o&65536?(s.flags=o&-65537|128,s):null;case 19:return Ae(Xt),null;case 4:return J(),null;case 10:return fa(s.type),null;case 22:case 23:return sa(s),kp(),o!==null&&Ae(Mo),o=s.flags,o&65536?(s.flags=o&-65537|128,s):null;case 24:return fa(Zt),null;case 25:return null;default:return null}}function K_(o,s){switch(Sp(s),s.tag){case 3:fa(Zt),J();break;case 26:case 27:case 5:ke(s);break;case 4:J();break;case 13:sa(s);break;case 19:Ae(Xt);break;case 10:fa(s.type);break;case 22:case 23:sa(s),kp(),o!==null&&Ae(Mo);break;case 24:fa(Zt)}}var h6={getCacheForType:function(o){var s=mn(Zt),d=s.data.get(o);return d===void 0&&(d=o(),s.data.set(o,d)),d}},m6=typeof WeakMap=="function"?WeakMap:Map,zt=0,Ot=null,st=null,ht=0,Dt=0,Vn=null,ba=!1,Pi=!1,yg=!1,ya=0,jt=0,Qa=0,$o=0,vg=0,dr=0,Bi=0,ys=null,jr=null,Sg=!1,Eg=0,pc=1/0,gc=null,Ja=null,hc=!1,qo=null,vs=0,wg=0,xg=null,Ss=0,kg=null;function Wn(){if(zt&2&&ht!==0)return ht&-ht;if(I.T!==null){var o=Ni;return o!==0?o:Dg()}return mA()}function X_(){dr===0&&(dr=!(ht&536870912)||yt?_t():536870912);var o=lr.current;return o!==null&&(o.flags|=32),dr}function Tn(o,s,d){(o===Ot&&Dt===2||o.cancelPendingCommit!==null)&&(Ui(o,0),va(o,ht,dr,!1)),Cn(o,d),(!(zt&2)||o!==Ot)&&(o===Ot&&(!(zt&2)&&($o|=d),jt===4&&va(o,ht,dr,!1)),Gr(o))}function Z_(o,s,d){if(zt&6)throw Error(r(327));var h=!d&&(s&60)===0&&(s&o.expiredLanes)===0||Ye(o,s),y=h?v6(o,s):Rg(o,s,!0),E=h;do{if(y===0){Pi&&!h&&va(o,s,0,!1);break}else if(y===6)va(o,s,0,!ba);else{if(d=o.current.alternate,E&&!b6(d)){y=Rg(o,s,!1),E=!1;continue}if(y===2){if(E=s,o.errorRecoveryDisabledLanes&E)var F=0;else F=o.pendingLanes&-536870913,F=F!==0?F:F&536870912?536870912:0;if(F!==0){s=F;e:{var $=o;y=ys;var K=$.current.memoizedState.isDehydrated;if(K&&(Ui($,F).flags|=256),F=Rg($,F,!1),F!==2){if(yg&&!K){$.errorRecoveryDisabledLanes|=E,$o|=E,y=4;break e}E=jr,jr=y,E!==null&&Ag(E)}y=F}if(E=!1,y!==2)continue}}if(y===1){Ui(o,0),va(o,s,0,!0);break}e:{switch(h=o,y){case 0:case 1:throw Error(r(345));case 4:if((s&4194176)===s){va(h,s,dr,!ba);break e}break;case 2:jr=null;break;case 3:case 5:break;default:throw Error(r(329))}if(h.finishedWork=d,h.finishedLanes=s,(s&62914560)===s&&(E=Eg+300-he(),10d?32:d,I.T=null,qo===null)var E=!1;else{d=xg,xg=null;var F=qo,$=vs;if(qo=null,vs=0,zt&6)throw Error(r(331));var K=zt;if(zt|=4,$_(F.current),j_(F,F.current,$,d),zt=K,Es(0,!1),Je&&typeof Je.onPostCommitFiberRoot=="function")try{Je.onPostCommitFiberRoot(pt,F)}catch{}E=!0}return E}finally{Y.p=y,I.T=h,i1(o,s)}}return!1}function l1(o,s,d){s=ar(d,s),s=Vp(o.stateNode,s,2),o=Wa(o,s,2),o!==null&&(Cn(o,2),Gr(o))}function Rt(o,s,d){if(o.tag===3)l1(o,o,d);else for(;s!==null;){if(s.tag===3){l1(s,o,d);break}else if(s.tag===1){var h=s.stateNode;if(typeof s.type.getDerivedStateFromError=="function"||typeof h.componentDidCatch=="function"&&(Ja===null||!Ja.has(h))){o=ar(d,o),d=c_(2),h=Wa(s,d,2),h!==null&&(d_(d,h,s,o),Cn(h,2),Gr(h));break}}s=s.return}}function Cg(o,s,d){var h=o.pingCache;if(h===null){h=o.pingCache=new m6;var y=new Set;h.set(s,y)}else y=h.get(s),y===void 0&&(y=new Set,h.set(s,y));y.has(d)||(yg=!0,y.add(d),o=w6.bind(null,o,s,d),s.then(o,o))}function w6(o,s,d){var h=o.pingCache;h!==null&&h.delete(s),o.pingedLanes|=o.suspendedLanes&d,o.warmLanes&=~d,Ot===o&&(ht&d)===d&&(jt===4||jt===3&&(ht&62914560)===ht&&300>he()-Eg?!(zt&2)&&Ui(o,0):vg|=d,Bi===ht&&(Bi=0)),Gr(o)}function s1(o,s){s===0&&(s=Rn()),o=Ba(o,s),o!==null&&(Cn(o,s),Gr(o))}function x6(o){var s=o.memoizedState,d=0;s!==null&&(d=s.retryLane),s1(o,d)}function k6(o,s){var d=0;switch(o.tag){case 13:var h=o.stateNode,y=o.memoizedState;y!==null&&(d=y.retryLane);break;case 19:h=o.stateNode;break;case 22:h=o.stateNode._retryCache;break;default:throw Error(r(314))}h!==null&&h.delete(s),s1(o,d)}function A6(o,s){return ve(o,s)}var yc=null,Hi=null,Ng=!1,vc=!1,Og=!1,Vo=0;function Gr(o){o!==Hi&&o.next===null&&(Hi===null?yc=Hi=o:Hi=Hi.next=o),vc=!0,Ng||(Ng=!0,_6(T6))}function Es(o,s){if(!Og&&vc){Og=!0;do for(var d=!1,h=yc;h!==null;){if(o!==0){var y=h.pendingLanes;if(y===0)var E=0;else{var F=h.suspendedLanes,$=h.pingedLanes;E=(1<<31-bt(42|o)+1)-1,E&=y&~(F&~$),E=E&201326677?E&201326677|1:E?E|2:0}E!==0&&(d=!0,d1(h,E))}else E=ht,E=na(h,h===Ot?E:0),!(E&3)||Ye(h,E)||(d=!0,d1(h,E));h=h.next}while(d);Og=!1}}function T6(){vc=Ng=!1;var o=0;Vo!==0&&(M6()&&(o=Vo),Vo=0);for(var s=he(),d=null,h=yc;h!==null;){var y=h.next,E=u1(h,s);E===0?(h.next=null,d===null?yc=y:d.next=y,y===null&&(Hi=d)):(d=h,(o!==0||E&3)&&(vc=!0)),h=y}Es(o)}function u1(o,s){for(var d=o.suspendedLanes,h=o.pingedLanes,y=o.expirationTimes,E=o.pendingLanes&-62914561;0"u"?null:document;function T1(o,s,d){var h=qi;if(h&&typeof s=="string"&&s){var y=nr(s);y='link[rel="'+o+'"][href="'+y+'"]',typeof d=="string"&&(y+='[crossorigin="'+d+'"]'),A1.has(y)||(A1.add(y),o={rel:o,crossOrigin:d,href:s},h.querySelector(y)===null&&(s=h.createElement("link"),dn(s,"link",o),Jt(s),h.head.appendChild(s)))}}function H6(o){Sa.D(o),T1("dns-prefetch",o,null)}function $6(o,s){Sa.C(o,s),T1("preconnect",o,s)}function q6(o,s,d){Sa.L(o,s,d);var h=qi;if(h&&o&&s){var y='link[rel="preload"][as="'+nr(s)+'"]';s==="image"&&d&&d.imageSrcSet?(y+='[imagesrcset="'+nr(d.imageSrcSet)+'"]',typeof d.imageSizes=="string"&&(y+='[imagesizes="'+nr(d.imageSizes)+'"]')):y+='[href="'+nr(o)+'"]';var E=y;switch(s){case"style":E=Vi(o);break;case"script":E=Wi(o)}fr.has(E)||(o=M({rel:"preload",href:s==="image"&&d&&d.imageSrcSet?void 0:o,as:s},d),fr.set(E,o),h.querySelector(y)!==null||s==="style"&&h.querySelector(ks(E))||s==="script"&&h.querySelector(As(E))||(s=h.createElement("link"),dn(s,"link",o),Jt(s),h.head.appendChild(s)))}}function V6(o,s){Sa.m(o,s);var d=qi;if(d&&o){var h=s&&typeof s.as=="string"?s.as:"script",y='link[rel="modulepreload"][as="'+nr(h)+'"][href="'+nr(o)+'"]',E=y;switch(h){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":E=Wi(o)}if(!fr.has(E)&&(o=M({rel:"modulepreload",href:o},s),fr.set(E,o),d.querySelector(y)===null)){switch(h){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(d.querySelector(As(E)))return}h=d.createElement("link"),dn(h,"link",o),Jt(h),d.head.appendChild(h)}}}function W6(o,s,d){Sa.S(o,s,d);var h=qi;if(h&&o){var y=hi(h).hoistableStyles,E=Vi(o);s=s||"default";var F=y.get(E);if(!F){var $={loading:0,preload:null};if(F=h.querySelector(ks(E)))$.loading=5;else{o=M({rel:"stylesheet",href:o,"data-precedence":s},d),(d=fr.get(E))&&qg(o,d);var K=F=h.createElement("link");Jt(K),dn(K,"link",o),K._p=new Promise(function(ne,be){K.onload=ne,K.onerror=be}),K.addEventListener("load",function(){$.loading|=1}),K.addEventListener("error",function(){$.loading|=2}),$.loading|=4,Ac(F,s,h)}F={type:"stylesheet",instance:F,count:1,state:$},y.set(E,F)}}}function Y6(o,s){Sa.X(o,s);var d=qi;if(d&&o){var h=hi(d).hoistableScripts,y=Wi(o),E=h.get(y);E||(E=d.querySelector(As(y)),E||(o=M({src:o,async:!0},s),(s=fr.get(y))&&Vg(o,s),E=d.createElement("script"),Jt(E),dn(E,"link",o),d.head.appendChild(E)),E={type:"script",instance:E,count:1,state:null},h.set(y,E))}}function K6(o,s){Sa.M(o,s);var d=qi;if(d&&o){var h=hi(d).hoistableScripts,y=Wi(o),E=h.get(y);E||(E=d.querySelector(As(y)),E||(o=M({src:o,async:!0,type:"module"},s),(s=fr.get(y))&&Vg(o,s),E=d.createElement("script"),Jt(E),dn(E,"link",o),d.head.appendChild(E)),E={type:"script",instance:E,count:1,state:null},h.set(y,E))}}function _1(o,s,d,h){var y=(y=Ie.current)?kc(y):null;if(!y)throw Error(r(446));switch(o){case"meta":case"title":return null;case"style":return typeof d.precedence=="string"&&typeof d.href=="string"?(s=Vi(d.href),d=hi(y).hoistableStyles,h=d.get(s),h||(h={type:"style",instance:null,count:0,state:null},d.set(s,h)),h):{type:"void",instance:null,count:0,state:null};case"link":if(d.rel==="stylesheet"&&typeof d.href=="string"&&typeof d.precedence=="string"){o=Vi(d.href);var E=hi(y).hoistableStyles,F=E.get(o);if(F||(y=y.ownerDocument||y,F={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},E.set(o,F),(E=y.querySelector(ks(o)))&&!E._p&&(F.instance=E,F.state.loading=5),fr.has(o)||(d={rel:"preload",as:"style",href:d.href,crossOrigin:d.crossOrigin,integrity:d.integrity,media:d.media,hrefLang:d.hrefLang,referrerPolicy:d.referrerPolicy},fr.set(o,d),E||X6(y,o,d,F.state))),s&&h===null)throw Error(r(528,""));return F}if(s&&h!==null)throw Error(r(529,""));return null;case"script":return s=d.async,d=d.src,typeof d=="string"&&s&&typeof s!="function"&&typeof s!="symbol"?(s=Wi(d),d=hi(y).hoistableScripts,h=d.get(s),h||(h={type:"script",instance:null,count:0,state:null},d.set(s,h)),h):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,o))}}function Vi(o){return'href="'+nr(o)+'"'}function ks(o){return'link[rel="stylesheet"]['+o+"]"}function R1(o){return M({},o,{"data-precedence":o.precedence,precedence:null})}function X6(o,s,d,h){o.querySelector('link[rel="preload"][as="style"]['+s+"]")?h.loading=1:(s=o.createElement("link"),h.preload=s,s.addEventListener("load",function(){return h.loading|=1}),s.addEventListener("error",function(){return h.loading|=2}),dn(s,"link",d),Jt(s),o.head.appendChild(s))}function Wi(o){return'[src="'+nr(o)+'"]'}function As(o){return"script[async]"+o}function C1(o,s,d){if(s.count++,s.instance===null)switch(s.type){case"style":var h=o.querySelector('style[data-href~="'+nr(d.href)+'"]');if(h)return s.instance=h,Jt(h),h;var y=M({},d,{"data-href":d.href,"data-precedence":d.precedence,href:null,precedence:null});return h=(o.ownerDocument||o).createElement("style"),Jt(h),dn(h,"style",y),Ac(h,d.precedence,o),s.instance=h;case"stylesheet":y=Vi(d.href);var E=o.querySelector(ks(y));if(E)return s.state.loading|=4,s.instance=E,Jt(E),E;h=R1(d),(y=fr.get(y))&&qg(h,y),E=(o.ownerDocument||o).createElement("link"),Jt(E);var F=E;return F._p=new Promise(function($,K){F.onload=$,F.onerror=K}),dn(E,"link",h),s.state.loading|=4,Ac(E,d.precedence,o),s.instance=E;case"script":return E=Wi(d.src),(y=o.querySelector(As(E)))?(s.instance=y,Jt(y),y):(h=d,(y=fr.get(E))&&(h=M({},d),Vg(h,y)),o=o.ownerDocument||o,y=o.createElement("script"),Jt(y),dn(y,"link",h),o.head.appendChild(y),s.instance=y);case"void":return null;default:throw Error(r(443,s.type))}else s.type==="stylesheet"&&!(s.state.loading&4)&&(h=s.instance,s.state.loading|=4,Ac(h,d.precedence,o));return s.instance}function Ac(o,s,d){for(var h=d.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),y=h.length?h[h.length-1]:null,E=y,F=0;F title"):null)}function Z6(o,s,d){if(d===1||s.itemProp!=null)return!1;switch(o){case"meta":case"title":return!0;case"style":if(typeof s.precedence!="string"||typeof s.href!="string"||s.href==="")break;return!0;case"link":if(typeof s.rel!="string"||typeof s.href!="string"||s.href===""||s.onLoad||s.onError)break;switch(s.rel){case"stylesheet":return o=s.disabled,typeof s.precedence=="string"&&o==null;default:return!0}case"script":if(s.async&&typeof s.async!="function"&&typeof s.async!="symbol"&&!s.onLoad&&!s.onError&&s.src&&typeof s.src=="string")return!0}return!1}function D1(o){return!(o.type==="stylesheet"&&!(o.state.loading&3))}var Ts=null;function Q6(){}function J6(o,s,d){if(Ts===null)throw Error(r(475));var h=Ts;if(s.type==="stylesheet"&&(typeof d.media!="string"||matchMedia(d.media).matches!==!1)&&!(s.state.loading&4)){if(s.instance===null){var y=Vi(d.href),E=o.querySelector(ks(y));if(E){o=E._p,o!==null&&typeof o=="object"&&typeof o.then=="function"&&(h.count++,h=_c.bind(h),o.then(h,h)),s.state.loading|=4,s.instance=E,Jt(E);return}E=o.ownerDocument||o,d=R1(d),(y=fr.get(y))&&qg(d,y),E=E.createElement("link"),Jt(E);var F=E;F._p=new Promise(function($,K){F.onload=$,F.onerror=K}),dn(E,"link",d),s.instance=E}h.stylesheets===null&&(h.stylesheets=new Map),h.stylesheets.set(s,o),(o=s.state.preload)&&!(s.state.loading&3)&&(h.count++,s=_c.bind(h),o.addEventListener("load",s),o.addEventListener("error",s))}}function eH(){if(Ts===null)throw Error(r(475));var o=Ts;return o.stylesheets&&o.count===0&&Wg(o,o.stylesheets),0"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),nh.exports=EH(),nh.exports}var xH=wH();const eR=e=>{let t;const n=new Set,r=(f,p)=>{const g=typeof f=="function"?f(t):f;if(!Object.is(g,t)){const b=t;t=p??(typeof g!="object"||g===null)?g:Object.assign({},t,g),n.forEach(m=>m(t,b))}},a=()=>t,u={setState:r,getState:a,getInitialState:()=>c,subscribe:f=>(n.add(f),()=>n.delete(f))},c=t=e(r,a,u);return u},kH=e=>e?eR(e):eR,AH=e=>e;function TH(e,t=AH){const n=ye.useSyncExternalStore(e.subscribe,()=>t(e.getState()),()=>t(e.getInitialState()));return ye.useDebugValue(n),n}const _H=e=>{const t=kH(e),n=r=>TH(t,r);return Object.assign(n,t),n},wk=e=>_H;function bz(e,t){let n;try{n=e()}catch{return}return{getItem:a=>{var i;const l=c=>c===null?null:JSON.parse(c,void 0),u=(i=n.getItem(a))!=null?i:null;return u instanceof Promise?u.then(l):l(u)},setItem:(a,i)=>n.setItem(a,JSON.stringify(i,void 0)),removeItem:a=>n.removeItem(a)}}const dx=e=>t=>{try{const n=e(t);return n instanceof Promise?n:{then(r){return dx(r)(n)},catch(r){return this}}}catch(n){return{then(r){return this},catch(r){return dx(r)(n)}}}},RH=(e,t)=>(n,r,a)=>{let i={storage:bz(()=>localStorage),partialize:v=>v,version:0,merge:(v,A)=>({...A,...v}),...t},l=!1;const u=new Set,c=new Set;let f=i.storage;if(!f)return e((...v)=>{console.warn(`[zustand persist middleware] Unable to update item '${i.name}', the given storage is currently unavailable.`),n(...v)},r,a);const p=()=>{const v=i.partialize({...r()});return f.setItem(i.name,{state:v,version:i.version})},g=a.setState;a.setState=(v,A)=>{g(v,A),p()};const b=e((...v)=>{n(...v),p()},r,a);a.getInitialState=()=>b;let m;const S=()=>{var v,A;if(!f)return;l=!1,u.forEach(x=>{var _;return x((_=r())!=null?_:b)});const R=((A=i.onRehydrateStorage)==null?void 0:A.call(i,(v=r())!=null?v:b))||void 0;return dx(f.getItem.bind(f))(i.name).then(x=>{if(x)if(typeof x.version=="number"&&x.version!==i.version){if(i.migrate){const _=i.migrate(x.state,x.version);return _ instanceof Promise?_.then(C=>[!0,C]):[!0,_]}console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,x.state];return[!1,void 0]}).then(x=>{var _;const[C,N]=x;if(m=i.merge(N,(_=r())!=null?_:b),n(m,!0),C)return p()}).then(()=>{R==null||R(m,void 0),m=r(),l=!0,c.forEach(x=>x(m))}).catch(x=>{R==null||R(void 0,x)})};return a.persist={setOptions:v=>{i={...i,...v},v.storage&&(f=v.storage)},clearStorage:()=>{f==null||f.removeItem(i.name)},getOptions:()=>i,rehydrate:()=>S(),hasHydrated:()=>l,onHydrate:v=>(u.add(v),()=>{u.delete(v)}),onFinishHydration:v=>(c.add(v),()=>{c.delete(v)})},i.skipHydration||S(),m||b},CH=RH;function yz(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var a=e.length;for(t=0;t{const t=DH(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:l=>{const u=l.split(xk);return u[0]===""&&u.length!==1&&u.shift(),Sz(u,t)||OH(l)},getConflictingClassGroupIds:(l,u)=>{const c=n[l]||[];return u&&r[l]?[...c,...r[l]]:c}}},Sz=(e,t)=>{var l;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),a=r?Sz(e.slice(1),r):void 0;if(a)return a;if(t.validators.length===0)return;const i=e.join(xk);return(l=t.validators.find(({validator:u})=>u(i)))==null?void 0:l.classGroupId},tR=/^\[(.+)\]$/,OH=e=>{if(tR.test(e)){const t=tR.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},DH=e=>{const{theme:t,classGroups:n}=e,r={nextPart:new Map,validators:[]};for(const a in n)fx(n[a],r,a,t);return r},fx=(e,t,n,r)=>{e.forEach(a=>{if(typeof a=="string"){const i=a===""?t:nR(t,a);i.classGroupId=n;return}if(typeof a=="function"){if(IH(a)){fx(a(r),t,n,r);return}t.validators.push({validator:a,classGroupId:n});return}Object.entries(a).forEach(([i,l])=>{fx(l,nR(t,i),n,r)})})},nR=(e,t)=>{let n=e;return t.split(xk).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},IH=e=>e.isThemeGetter,LH=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const a=(i,l)=>{n.set(i,l),t++,t>e&&(t=0,r=n,n=new Map)};return{get(i){let l=n.get(i);if(l!==void 0)return l;if((l=r.get(i))!==void 0)return a(i,l),l},set(i,l){n.has(i)?n.set(i,l):a(i,l)}}},px="!",gx=":",MH=gx.length,FH=e=>{const{prefix:t,experimentalParseClassName:n}=e;let r=a=>{const i=[];let l=0,u=0,c=0,f;for(let S=0;Sc?f-c:void 0;return{modifiers:i,hasImportantModifier:b,baseClassName:g,maybePostfixModifierPosition:m}};if(t){const a=t+gx,i=r;r=l=>l.startsWith(a)?i(l.substring(a.length)):{isExternal:!0,modifiers:[],hasImportantModifier:!1,baseClassName:l,maybePostfixModifierPosition:void 0}}if(n){const a=r;r=i=>n({className:i,parseClassName:a})}return r},zH=e=>e.endsWith(px)?e.substring(0,e.length-1):e.startsWith(px)?e.substring(1):e,PH=e=>{const t=Object.fromEntries(e.orderSensitiveModifiers.map(r=>[r,!0]));return r=>{if(r.length<=1)return r;const a=[];let i=[];return r.forEach(l=>{l[0]==="["||t[l]?(a.push(...i.sort(),l),i=[]):i.push(l)}),a.push(...i.sort()),a}},BH=e=>({cache:LH(e.cacheSize),parseClassName:FH(e),sortModifiers:PH(e),...NH(e)}),UH=/\s+/,jH=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:a,sortModifiers:i}=t,l=[],u=e.trim().split(UH);let c="";for(let f=u.length-1;f>=0;f-=1){const p=u[f],{isExternal:g,modifiers:b,hasImportantModifier:m,baseClassName:S,maybePostfixModifierPosition:v}=n(p);if(g){c=p+(c.length>0?" "+c:c);continue}let A=!!v,R=r(A?S.substring(0,v):S);if(!R){if(!A){c=p+(c.length>0?" "+c:c);continue}if(R=r(S),!R){c=p+(c.length>0?" "+c:c);continue}A=!1}const x=i(b).join(":"),_=m?x+px:x,C=_+R;if(l.includes(C))continue;l.push(C);const N=a(R,A);for(let T=0;T0?" "+c:c)}return c};function GH(){let e=0,t,n,r="";for(;e{if(typeof e=="string")return e;let t,n="";for(let r=0;rg(p),e());return n=BH(f),r=n.cache.get,a=n.cache.set,i=u,u(c)}function u(c){const f=r(c);if(f)return f;const p=jH(c,n);return a(c,p),p}return function(){return i(GH.apply(null,arguments))}}const rn=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},wz=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,xz=/^\((?:(\w[\w-]*):)?(.+)\)$/i,$H=/^\d+\/\d+$/,qH=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,VH=/\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$/,WH=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,YH=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,KH=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Yi=e=>$H.test(e),ct=e=>!!e&&!Number.isNaN(Number(e)),Wo=e=>!!e&&Number.isInteger(Number(e)),rR=e=>e.endsWith("%")&&ct(e.slice(0,-1)),oo=e=>qH.test(e),XH=()=>!0,ZH=e=>VH.test(e)&&!WH.test(e),kk=()=>!1,QH=e=>YH.test(e),JH=e=>KH.test(e),e9=e=>!je(e)&&!Ge(e),t9=e=>xl(e,Tz,kk),je=e=>wz.test(e),Yo=e=>xl(e,_z,ZH),ih=e=>xl(e,f9,ct),n9=e=>xl(e,kz,kk),r9=e=>xl(e,Az,JH),a9=e=>xl(e,kk,QH),Ge=e=>xz.test(e),Fc=e=>kl(e,_z),o9=e=>kl(e,p9),i9=e=>kl(e,kz),l9=e=>kl(e,Tz),s9=e=>kl(e,Az),u9=e=>kl(e,g9,!0),xl=(e,t,n)=>{const r=wz.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},kl=(e,t,n=!1)=>{const r=xz.exec(e);return r?r[1]?t(r[1]):n:!1},kz=e=>e==="position",c9=new Set(["image","url"]),Az=e=>c9.has(e),d9=new Set(["length","size","percentage"]),Tz=e=>d9.has(e),_z=e=>e==="length",f9=e=>e==="number",p9=e=>e==="family-name",g9=e=>e==="shadow",h9=()=>{const e=rn("color"),t=rn("font"),n=rn("text"),r=rn("font-weight"),a=rn("tracking"),i=rn("leading"),l=rn("breakpoint"),u=rn("container"),c=rn("spacing"),f=rn("radius"),p=rn("shadow"),g=rn("inset-shadow"),b=rn("drop-shadow"),m=rn("blur"),S=rn("perspective"),v=rn("aspect"),A=rn("ease"),R=rn("animate"),x=()=>["auto","avoid","all","avoid-page","page","left","right","column"],_=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],C=()=>["auto","hidden","clip","visible","scroll"],N=()=>["auto","contain","none"],T=()=>[Ge,je,c],O=()=>[Yi,"full","auto",...T()],z=()=>[Wo,"none","subgrid",Ge,je],I=()=>["auto",{span:["full",Wo,Ge,je]},Ge,je],M=()=>[Wo,"auto",Ge,je],H=()=>["auto","min","max","fr",Ge,je],q=()=>["start","end","center","between","around","evenly","stretch","baseline"],U=()=>["start","end","center","stretch"],W=()=>["auto",...T()],Z=()=>[Yi,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...T()],j=()=>[e,Ge,je],G=()=>[rR,Yo],P=()=>["","none","full",f,Ge,je],X=()=>["",ct,Fc,Yo],D=()=>["solid","dashed","dotted","double"],V=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],B=()=>["","none",m,Ge,je],L=()=>["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",Ge,je],Y=()=>["none",ct,Ge,je],Q=()=>["none",ct,Ge,je],se=()=>[ct,Ge,je],re=()=>[Yi,"full",...T()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[oo],breakpoint:[oo],color:[XH],container:[oo],"drop-shadow":[oo],ease:["in","out","in-out"],font:[e9],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[oo],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[oo],shadow:[oo],spacing:["px",ct],text:[oo],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Yi,je,Ge,v]}],container:["container"],columns:[{columns:[ct,je,Ge,u]}],"break-after":[{"break-after":x()}],"break-before":[{"break-before":x()}],"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:[..._(),je,Ge]}],overflow:[{overflow:C()}],"overflow-x":[{"overflow-x":C()}],"overflow-y":[{"overflow-y":C()}],overscroll:[{overscroll:N()}],"overscroll-x":[{"overscroll-x":N()}],"overscroll-y":[{"overscroll-y":N()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:O()}],"inset-x":[{"inset-x":O()}],"inset-y":[{"inset-y":O()}],start:[{start:O()}],end:[{end:O()}],top:[{top:O()}],right:[{right:O()}],bottom:[{bottom:O()}],left:[{left:O()}],visibility:["visible","invisible","collapse"],z:[{z:[Wo,"auto",Ge,je]}],basis:[{basis:[Yi,"full","auto",u,...T()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[ct,Yi,"auto","initial","none",je]}],grow:[{grow:["",ct,Ge,je]}],shrink:[{shrink:["",ct,Ge,je]}],order:[{order:[Wo,"first","last","none",Ge,je]}],"grid-cols":[{"grid-cols":z()}],"col-start-end":[{col:I()}],"col-start":[{"col-start":M()}],"col-end":[{"col-end":M()}],"grid-rows":[{"grid-rows":z()}],"row-start-end":[{row:I()}],"row-start":[{"row-start":M()}],"row-end":[{"row-end":M()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":H()}],"auto-rows":[{"auto-rows":H()}],gap:[{gap:T()}],"gap-x":[{"gap-x":T()}],"gap-y":[{"gap-y":T()}],"justify-content":[{justify:[...q(),"normal"]}],"justify-items":[{"justify-items":[...U(),"normal"]}],"justify-self":[{"justify-self":["auto",...U()]}],"align-content":[{content:["normal",...q()]}],"align-items":[{items:[...U(),"baseline"]}],"align-self":[{self:["auto",...U(),"baseline"]}],"place-content":[{"place-content":q()}],"place-items":[{"place-items":[...U(),"baseline"]}],"place-self":[{"place-self":["auto",...U()]}],p:[{p:T()}],px:[{px:T()}],py:[{py:T()}],ps:[{ps:T()}],pe:[{pe:T()}],pt:[{pt:T()}],pr:[{pr:T()}],pb:[{pb:T()}],pl:[{pl:T()}],m:[{m:W()}],mx:[{mx:W()}],my:[{my:W()}],ms:[{ms:W()}],me:[{me:W()}],mt:[{mt:W()}],mr:[{mr:W()}],mb:[{mb:W()}],ml:[{ml:W()}],"space-x":[{"space-x":T()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":T()}],"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:[l]},...Z()]}],h:[{h:["screen",...Z()]}],"min-h":[{"min-h":["screen","none",...Z()]}],"max-h":[{"max-h":["screen",...Z()]}],"font-size":[{text:["base",n,Fc,Yo]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,Ge,ih]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",rR,je]}],"font-family":[{font:[o9,je,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:[a,Ge,je]}],"line-clamp":[{"line-clamp":[ct,"none",Ge,ih]}],leading:[{leading:[i,...T()]}],"list-image":[{"list-image":["none",Ge,je]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Ge,je]}],"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:[...D(),"wavy"]}],"text-decoration-thickness":[{decoration:[ct,"from-font","auto",Ge,Yo]}],"text-decoration-color":[{decoration:j()}],"underline-offset":[{"underline-offset":[ct,"auto",Ge,je]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:T()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Ge,je]}],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",Ge,je]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[..._(),i9,n9]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","space","round"]}]}],"bg-size":[{bg:["auto","cover","contain",l9,t9]}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Wo,Ge,je],radial:["",Ge,je],conic:[Wo,Ge,je]},s9,r9]}],"bg-color":[{bg:j()}],"gradient-from-pos":[{from:G()}],"gradient-via-pos":[{via:G()}],"gradient-to-pos":[{to:G()}],"gradient-from":[{from:j()}],"gradient-via":[{via:j()}],"gradient-to":[{to:j()}],rounded:[{rounded:P()}],"rounded-s":[{"rounded-s":P()}],"rounded-e":[{"rounded-e":P()}],"rounded-t":[{"rounded-t":P()}],"rounded-r":[{"rounded-r":P()}],"rounded-b":[{"rounded-b":P()}],"rounded-l":[{"rounded-l":P()}],"rounded-ss":[{"rounded-ss":P()}],"rounded-se":[{"rounded-se":P()}],"rounded-ee":[{"rounded-ee":P()}],"rounded-es":[{"rounded-es":P()}],"rounded-tl":[{"rounded-tl":P()}],"rounded-tr":[{"rounded-tr":P()}],"rounded-br":[{"rounded-br":P()}],"rounded-bl":[{"rounded-bl":P()}],"border-w":[{border:X()}],"border-w-x":[{"border-x":X()}],"border-w-y":[{"border-y":X()}],"border-w-s":[{"border-s":X()}],"border-w-e":[{"border-e":X()}],"border-w-t":[{"border-t":X()}],"border-w-r":[{"border-r":X()}],"border-w-b":[{"border-b":X()}],"border-w-l":[{"border-l":X()}],"divide-x":[{"divide-x":X()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":X()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...D(),"hidden","none"]}],"divide-style":[{divide:[...D(),"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:[...D(),"none","hidden"]}],"outline-offset":[{"outline-offset":[ct,Ge,je]}],"outline-w":[{outline:["",ct,Fc,Yo]}],"outline-color":[{outline:[e]}],shadow:[{shadow:["","none",p,u9,a9]}],"shadow-color":[{shadow:j()}],"inset-shadow":[{"inset-shadow":["none",Ge,je,g]}],"inset-shadow-color":[{"inset-shadow":j()}],"ring-w":[{ring:X()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:j()}],"ring-offset-w":[{"ring-offset":[ct,Yo]}],"ring-offset-color":[{"ring-offset":j()}],"inset-ring-w":[{"inset-ring":X()}],"inset-ring-color":[{"inset-ring":j()}],opacity:[{opacity:[ct,Ge,je]}],"mix-blend":[{"mix-blend":[...V(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":V()}],filter:[{filter:["","none",Ge,je]}],blur:[{blur:B()}],brightness:[{brightness:[ct,Ge,je]}],contrast:[{contrast:[ct,Ge,je]}],"drop-shadow":[{"drop-shadow":["","none",b,Ge,je]}],grayscale:[{grayscale:["",ct,Ge,je]}],"hue-rotate":[{"hue-rotate":[ct,Ge,je]}],invert:[{invert:["",ct,Ge,je]}],saturate:[{saturate:[ct,Ge,je]}],sepia:[{sepia:["",ct,Ge,je]}],"backdrop-filter":[{"backdrop-filter":["","none",Ge,je]}],"backdrop-blur":[{"backdrop-blur":B()}],"backdrop-brightness":[{"backdrop-brightness":[ct,Ge,je]}],"backdrop-contrast":[{"backdrop-contrast":[ct,Ge,je]}],"backdrop-grayscale":[{"backdrop-grayscale":["",ct,Ge,je]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[ct,Ge,je]}],"backdrop-invert":[{"backdrop-invert":["",ct,Ge,je]}],"backdrop-opacity":[{"backdrop-opacity":[ct,Ge,je]}],"backdrop-saturate":[{"backdrop-saturate":[ct,Ge,je]}],"backdrop-sepia":[{"backdrop-sepia":["",ct,Ge,je]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":T()}],"border-spacing-x":[{"border-spacing-x":T()}],"border-spacing-y":[{"border-spacing-y":T()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",Ge,je]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[ct,"initial",Ge,je]}],ease:[{ease:["linear","initial",A,Ge,je]}],delay:[{delay:[ct,Ge,je]}],animate:[{animate:["none",R,Ge,je]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[S,Ge,je]}],"perspective-origin":[{"perspective-origin":L()}],rotate:[{rotate:Y()}],"rotate-x":[{"rotate-x":Y()}],"rotate-y":[{"rotate-y":Y()}],"rotate-z":[{"rotate-z":Y()}],scale:[{scale:Q()}],"scale-x":[{"scale-x":Q()}],"scale-y":[{"scale-y":Q()}],"scale-z":[{"scale-z":Q()}],"scale-3d":["scale-3d"],skew:[{skew:se()}],"skew-x":[{"skew-x":se()}],"skew-y":[{"skew-y":se()}],transform:[{transform:[Ge,je,"","none","gpu","cpu"]}],"transform-origin":[{origin:L()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:re()}],"translate-x":[{"translate-x":re()}],"translate-y":[{"translate-y":re()}],"translate-z":[{"translate-z":re()}],"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",Ge,je]}],"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":T()}],"scroll-mx":[{"scroll-mx":T()}],"scroll-my":[{"scroll-my":T()}],"scroll-ms":[{"scroll-ms":T()}],"scroll-me":[{"scroll-me":T()}],"scroll-mt":[{"scroll-mt":T()}],"scroll-mr":[{"scroll-mr":T()}],"scroll-mb":[{"scroll-mb":T()}],"scroll-ml":[{"scroll-ml":T()}],"scroll-p":[{"scroll-p":T()}],"scroll-px":[{"scroll-px":T()}],"scroll-py":[{"scroll-py":T()}],"scroll-ps":[{"scroll-ps":T()}],"scroll-pe":[{"scroll-pe":T()}],"scroll-pt":[{"scroll-pt":T()}],"scroll-pr":[{"scroll-pr":T()}],"scroll-pb":[{"scroll-pb":T()}],"scroll-pl":[{"scroll-pl":T()}],"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",Ge,je]}],fill:[{fill:["none",...j()]}],"stroke-w":[{stroke:[ct,Fc,Yo,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","*","**"]}},m9=HH(h9);function Me(...e){return m9(vz(e))}function b9(){const e="0123456789abcdef";let t="#";for(let n=0;n<6;n++)t+=e.charAt(Math.floor(Math.random()*16));return t}function Nr(e){return e instanceof Error?e.message:`${e}`}const Ak=e=>{const t=e;t.use={};for(const n of Object.keys(t.getState()))t.use[n]=()=>t(r=>r[n]);return t},Rz="",Yr="ghost",y9="#B2EBF2",v9="#000",S9="#E2E2E2",E9="#EEEEEE",w9="#F57F17",x9="#969696",k9="#F57F17",aR="#B2EBF2",lh=20,sh=40,oR=4,A9=20,T9=15,iR="*",_9={"text/plain":[".txt",".md",".html",".htm",".tex",".json",".xml",".yaml",".yml",".rtf",".odt",".epub",".csv",".log",".conf",".ini",".properties",".sql",".bat",".sh",".c",".cpp",".py",".java",".js",".ts",".swift",".go",".rb",".php",".css",".scss",".less"],"application/pdf":[".pdf"],"application/msword":[".doc"],"application/vnd.openxmlformats-officedocument.wordprocessingml.document":[".docx"],"application/vnd.openxmlformats-officedocument.presentationml.presentation":[".pptx"]},lR={name:"LightRAG",github:"https://github.com/HKUDS/LightRAG"},R9=wk()(CH(e=>({theme:"system",showPropertyPanel:!0,showNodeSearchBar:!0,showNodeLabel:!0,enableNodeDrag:!0,showEdgeLabel:!1,enableHideUnselectedEdges:!0,enableEdgeEvents:!1,graphQueryMaxDepth:3,graphLayoutMaxIterations:10,queryLabel:iR,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}),setGraphLayoutMaxIterations:t=>e({graphLayoutMaxIterations:t}),setQueryLabel:t=>e({queryLabel:t}),setGraphQueryMaxDepth:t=>e({graphQueryMaxDepth: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:bz(()=>localStorage),version:7,migrate:(e,t)=>(t<2&&(e.showEdgeLabel=!1),t<3&&(e.queryLabel=iR),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=[]),t<7&&(e.graphQueryMaxDepth=3,e.graphLayoutMaxIterations=10),e)})),Ke=Ak(R9),C9={theme:"system",setTheme:()=>null},Cz=k.createContext(C9);function N9({children:e,...t}){const[n,r]=k.useState(Ke.getState().theme);k.useEffect(()=>{const i=window.document.documentElement;if(i.classList.remove("light","dark"),n==="system"){const l=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";i.classList.add(l),r(l);return}i.classList.add(n)},[n]);const a={theme:n,setTheme:i=>{Ke.getState().setTheme(i),r(i)}};return w.jsx(Cz.Provider,{...t,value:a,children:e})}const sR=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,uR=vz,Nz=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return uR(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:a,defaultVariants:i}=t,l=Object.keys(a).map(f=>{const p=n==null?void 0:n[f],g=i==null?void 0:i[f];if(p===null)return null;const b=sR(p)||sR(g);return a[f][b]}),u=n&&Object.entries(n).reduce((f,p)=>{let[g,b]=p;return b===void 0||(f[g]=b),f},{}),c=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((f,p)=>{let{class:g,className:b,...m}=p;return Object.entries(m).every(S=>{let[v,A]=S;return Array.isArray(A)?A.includes({...i,...u}[v]):{...i,...u}[v]===A})?[...f,g,b]:f},[]);return uR(e,l,c,n==null?void 0:n.class,n==null?void 0:n.className)},O9=Nz("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"}}),Oz=k.forwardRef(({className:e,variant:t,...n},r)=>w.jsx("div",{ref:r,role:"alert",className:Me(O9({variant:t}),e),...n}));Oz.displayName="Alert";const Dz=k.forwardRef(({className:e,...t},n)=>w.jsx("h5",{ref:n,className:Me("mb-1 leading-none font-medium tracking-tight",e),...t}));Dz.displayName="AlertTitle";const Iz=k.forwardRef(({className:e,...t},n)=>w.jsx("div",{ref:n,className:Me("text-sm [&_p]:leading-relaxed",e),...t}));Iz.displayName="AlertDescription";function Lz(e,t){return function(){return e.apply(t,arguments)}}const{toString:D9}=Object.prototype,{getPrototypeOf:Tk}=Object,rf=(e=>t=>{const n=D9.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),Lr=e=>(e=e.toLowerCase(),t=>rf(t)===e),af=e=>t=>typeof t===e,{isArray:Al}=Array,Qs=af("undefined");function I9(e){return e!==null&&!Qs(e)&&e.constructor!==null&&!Qs(e.constructor)&&Xn(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const Mz=Lr("ArrayBuffer");function L9(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&Mz(e.buffer),t}const M9=af("string"),Xn=af("function"),Fz=af("number"),of=e=>e!==null&&typeof e=="object",F9=e=>e===!0||e===!1,fd=e=>{if(rf(e)!=="object")return!1;const t=Tk(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)},z9=Lr("Date"),P9=Lr("File"),B9=Lr("Blob"),U9=Lr("FileList"),j9=e=>of(e)&&Xn(e.pipe),G9=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||Xn(e.append)&&((t=rf(e))==="formdata"||t==="object"&&Xn(e.toString)&&e.toString()==="[object FormData]"))},H9=Lr("URLSearchParams"),[$9,q9,V9,W9]=["ReadableStream","Request","Response","Headers"].map(Lr),Y9=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function du(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let r,a;if(typeof e!="object"&&(e=[e]),Al(e))for(r=0,a=e.length;r0;)if(a=n[r],t===a.toLowerCase())return a;return null}const ti=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,Pz=e=>!Qs(e)&&e!==ti;function hx(){const{caseless:e}=Pz(this)&&this||{},t={},n=(r,a)=>{const i=e&&zz(t,a)||a;fd(t[i])&&fd(r)?t[i]=hx(t[i],r):fd(r)?t[i]=hx({},r):Al(r)?t[i]=r.slice():t[i]=r};for(let r=0,a=arguments.length;r(du(t,(a,i)=>{n&&Xn(a)?e[i]=Lz(a,n):e[i]=a},{allOwnKeys:r}),e),X9=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),Z9=(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},Q9=(e,t,n,r)=>{let a,i,l;const u={};if(t=t||{},e==null)return t;do{for(a=Object.getOwnPropertyNames(e),i=a.length;i-- >0;)l=a[i],(!r||r(l,e,t))&&!u[l]&&(t[l]=e[l],u[l]=!0);e=n!==!1&&Tk(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},J9=(e,t,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return r!==-1&&r===n},e$=e=>{if(!e)return null;if(Al(e))return e;let t=e.length;if(!Fz(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},t$=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&Tk(Uint8Array)),n$=(e,t)=>{const r=(e&&e[Symbol.iterator]).call(e);let a;for(;(a=r.next())&&!a.done;){const i=a.value;t.call(e,i[0],i[1])}},r$=(e,t)=>{let n;const r=[];for(;(n=e.exec(t))!==null;)r.push(n);return r},a$=Lr("HTMLFormElement"),o$=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,a){return r.toUpperCase()+a}),cR=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),i$=Lr("RegExp"),Bz=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};du(n,(a,i)=>{let l;(l=t(a,i,e))!==!1&&(r[i]=l||a)}),Object.defineProperties(e,r)},l$=e=>{Bz(e,(t,n)=>{if(Xn(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=e[n];if(Xn(r)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},s$=(e,t)=>{const n={},r=a=>{a.forEach(i=>{n[i]=!0})};return Al(e)?r(e):r(String(e).split(t)),n},u$=()=>{},c$=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t,uh="abcdefghijklmnopqrstuvwxyz",dR="0123456789",Uz={DIGIT:dR,ALPHA:uh,ALPHA_DIGIT:uh+uh.toUpperCase()+dR},d$=(e=16,t=Uz.ALPHA_DIGIT)=>{let n="";const{length:r}=t;for(;e--;)n+=t[Math.random()*r|0];return n};function f$(e){return!!(e&&Xn(e.append)&&e[Symbol.toStringTag]==="FormData"&&e[Symbol.iterator])}const p$=e=>{const t=new Array(10),n=(r,a)=>{if(of(r)){if(t.indexOf(r)>=0)return;if(!("toJSON"in r)){t[a]=r;const i=Al(r)?[]:{};return du(r,(l,u)=>{const c=n(l,a+1);!Qs(c)&&(i[u]=c)}),t[a]=void 0,i}}return r};return n(e,0)},g$=Lr("AsyncFunction"),h$=e=>e&&(of(e)||Xn(e))&&Xn(e.then)&&Xn(e.catch),jz=((e,t)=>e?setImmediate:t?((n,r)=>(ti.addEventListener("message",({source:a,data:i})=>{a===ti&&i===n&&r.length&&r.shift()()},!1),a=>{r.push(a),ti.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",Xn(ti.postMessage)),m$=typeof queueMicrotask<"u"?queueMicrotask.bind(ti):typeof process<"u"&&process.nextTick||jz,pe={isArray:Al,isArrayBuffer:Mz,isBuffer:I9,isFormData:G9,isArrayBufferView:L9,isString:M9,isNumber:Fz,isBoolean:F9,isObject:of,isPlainObject:fd,isReadableStream:$9,isRequest:q9,isResponse:V9,isHeaders:W9,isUndefined:Qs,isDate:z9,isFile:P9,isBlob:B9,isRegExp:i$,isFunction:Xn,isStream:j9,isURLSearchParams:H9,isTypedArray:t$,isFileList:U9,forEach:du,merge:hx,extend:K9,trim:Y9,stripBOM:X9,inherits:Z9,toFlatObject:Q9,kindOf:rf,kindOfTest:Lr,endsWith:J9,toArray:e$,forEachEntry:n$,matchAll:r$,isHTMLForm:a$,hasOwnProperty:cR,hasOwnProp:cR,reduceDescriptors:Bz,freezeMethods:l$,toObjectSet:s$,toCamelCase:o$,noop:u$,toFiniteNumber:c$,findKey:zz,global:ti,isContextDefined:Pz,ALPHABET:Uz,generateString:d$,isSpecCompliantForm:f$,toJSONObject:p$,isAsyncFn:g$,isThenable:h$,setImmediate:jz,asap:m$};function nt(e,t,n,r,a){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),a&&(this.response=a,this.status=a.status?a.status:null)}pe.inherits(nt,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:pe.toJSONObject(this.config),code:this.code,status:this.status}}});const Gz=nt.prototype,Hz={};["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=>{Hz[e]={value:e}});Object.defineProperties(nt,Hz);Object.defineProperty(Gz,"isAxiosError",{value:!0});nt.from=(e,t,n,r,a,i)=>{const l=Object.create(Gz);return pe.toFlatObject(e,l,function(c){return c!==Error.prototype},u=>u!=="isAxiosError"),nt.call(l,e.message,t,n,r,a),l.cause=e,l.name=e.name,i&&Object.assign(l,i),l};const b$=null;function mx(e){return pe.isPlainObject(e)||pe.isArray(e)}function $z(e){return pe.endsWith(e,"[]")?e.slice(0,-2):e}function fR(e,t,n){return e?e.concat(t).map(function(a,i){return a=$z(a),!n&&i?"["+a+"]":a}).join(n?".":""):t}function y$(e){return pe.isArray(e)&&!e.some(mx)}const v$=pe.toFlatObject(pe,{},null,function(t){return/^is[A-Z]/.test(t)});function lf(e,t,n){if(!pe.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,n=pe.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(v,A){return!pe.isUndefined(A[v])});const r=n.metaTokens,a=n.visitor||p,i=n.dots,l=n.indexes,c=(n.Blob||typeof Blob<"u"&&Blob)&&pe.isSpecCompliantForm(t);if(!pe.isFunction(a))throw new TypeError("visitor must be a function");function f(S){if(S===null)return"";if(pe.isDate(S))return S.toISOString();if(!c&&pe.isBlob(S))throw new nt("Blob is not supported. Use a Buffer instead.");return pe.isArrayBuffer(S)||pe.isTypedArray(S)?c&&typeof Blob=="function"?new Blob([S]):Buffer.from(S):S}function p(S,v,A){let R=S;if(S&&!A&&typeof S=="object"){if(pe.endsWith(v,"{}"))v=r?v:v.slice(0,-2),S=JSON.stringify(S);else if(pe.isArray(S)&&y$(S)||(pe.isFileList(S)||pe.endsWith(v,"[]"))&&(R=pe.toArray(S)))return v=$z(v),R.forEach(function(_,C){!(pe.isUndefined(_)||_===null)&&t.append(l===!0?fR([v],C,i):l===null?v:v+"[]",f(_))}),!1}return mx(S)?!0:(t.append(fR(A,v,i),f(S)),!1)}const g=[],b=Object.assign(v$,{defaultVisitor:p,convertValue:f,isVisitable:mx});function m(S,v){if(!pe.isUndefined(S)){if(g.indexOf(S)!==-1)throw Error("Circular reference detected in "+v.join("."));g.push(S),pe.forEach(S,function(R,x){(!(pe.isUndefined(R)||R===null)&&a.call(t,R,pe.isString(x)?x.trim():x,v,b))===!0&&m(R,v?v.concat(x):[x])}),g.pop()}}if(!pe.isObject(e))throw new TypeError("data must be an object");return m(e),t}function pR(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(r){return t[r]})}function _k(e,t){this._pairs=[],e&&lf(e,this,t)}const qz=_k.prototype;qz.append=function(t,n){this._pairs.push([t,n])};qz.toString=function(t){const n=t?function(r){return t.call(this,r,pR)}:pR;return this._pairs.map(function(a){return n(a[0])+"="+n(a[1])},"").join("&")};function S$(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Vz(e,t,n){if(!t)return e;const r=n&&n.encode||S$;pe.isFunction(n)&&(n={serialize:n});const a=n&&n.serialize;let i;if(a?i=a(t,n):i=pe.isURLSearchParams(t)?t.toString():new _k(t,n).toString(r),i){const l=e.indexOf("#");l!==-1&&(e=e.slice(0,l)),e+=(e.indexOf("?")===-1?"?":"&")+i}return e}class gR{constructor(){this.handlers=[]}use(t,n,r){return this.handlers.push({fulfilled:t,rejected:n,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){pe.forEach(this.handlers,function(r){r!==null&&t(r)})}}const Wz={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},E$=typeof URLSearchParams<"u"?URLSearchParams:_k,w$=typeof FormData<"u"?FormData:null,x$=typeof Blob<"u"?Blob:null,k$={isBrowser:!0,classes:{URLSearchParams:E$,FormData:w$,Blob:x$},protocols:["http","https","file","blob","url","data"]},Rk=typeof window<"u"&&typeof document<"u",bx=typeof navigator=="object"&&navigator||void 0,A$=Rk&&(!bx||["ReactNative","NativeScript","NS"].indexOf(bx.product)<0),T$=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",_$=Rk&&window.location.href||"http://localhost",R$=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:Rk,hasStandardBrowserEnv:A$,hasStandardBrowserWebWorkerEnv:T$,navigator:bx,origin:_$},Symbol.toStringTag,{value:"Module"})),yn={...R$,...k$};function C$(e,t){return lf(e,new yn.classes.URLSearchParams,Object.assign({visitor:function(n,r,a,i){return yn.isNode&&pe.isBuffer(n)?(this.append(r,n.toString("base64")),!1):i.defaultVisitor.apply(this,arguments)}},t))}function N$(e){return pe.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function O$(e){const t={},n=Object.keys(e);let r;const a=n.length;let i;for(r=0;r=n.length;return l=!l&&pe.isArray(a)?a.length:l,c?(pe.hasOwnProp(a,l)?a[l]=[a[l],r]:a[l]=r,!u):((!a[l]||!pe.isObject(a[l]))&&(a[l]=[]),t(n,r,a[l],i)&&pe.isArray(a[l])&&(a[l]=O$(a[l])),!u)}if(pe.isFormData(e)&&pe.isFunction(e.entries)){const n={};return pe.forEachEntry(e,(r,a)=>{t(N$(r),a,n,0)}),n}return null}function D$(e,t,n){if(pe.isString(e))try{return(t||JSON.parse)(e),pe.trim(e)}catch(r){if(r.name!=="SyntaxError")throw r}return(n||JSON.stringify)(e)}const fu={transitional:Wz,adapter:["xhr","http","fetch"],transformRequest:[function(t,n){const r=n.getContentType()||"",a=r.indexOf("application/json")>-1,i=pe.isObject(t);if(i&&pe.isHTMLForm(t)&&(t=new FormData(t)),pe.isFormData(t))return a?JSON.stringify(Yz(t)):t;if(pe.isArrayBuffer(t)||pe.isBuffer(t)||pe.isStream(t)||pe.isFile(t)||pe.isBlob(t)||pe.isReadableStream(t))return t;if(pe.isArrayBufferView(t))return t.buffer;if(pe.isURLSearchParams(t))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let u;if(i){if(r.indexOf("application/x-www-form-urlencoded")>-1)return C$(t,this.formSerializer).toString();if((u=pe.isFileList(t))||r.indexOf("multipart/form-data")>-1){const c=this.env&&this.env.FormData;return lf(u?{"files[]":t}:t,c&&new c,this.formSerializer)}}return i||a?(n.setContentType("application/json",!1),D$(t)):t}],transformResponse:[function(t){const n=this.transitional||fu.transitional,r=n&&n.forcedJSONParsing,a=this.responseType==="json";if(pe.isResponse(t)||pe.isReadableStream(t))return t;if(t&&pe.isString(t)&&(r&&!this.responseType||a)){const l=!(n&&n.silentJSONParsing)&&a;try{return JSON.parse(t)}catch(u){if(l)throw u.name==="SyntaxError"?nt.from(u,nt.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:yn.classes.FormData,Blob:yn.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};pe.forEach(["delete","get","head","post","put","patch"],e=>{fu.headers[e]={}});const I$=pe.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"]),L$=e=>{const t={};let n,r,a;return e&&e.split(` +`).forEach(function(l){a=l.indexOf(":"),n=l.substring(0,a).trim().toLowerCase(),r=l.substring(a+1).trim(),!(!n||t[n]&&I$[n])&&(n==="set-cookie"?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)}),t},hR=Symbol("internals");function Ls(e){return e&&String(e).trim().toLowerCase()}function pd(e){return e===!1||e==null?e:pe.isArray(e)?e.map(pd):String(e)}function M$(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}const F$=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function ch(e,t,n,r,a){if(pe.isFunction(r))return r.call(this,t,n);if(a&&(t=n),!!pe.isString(t)){if(pe.isString(r))return t.indexOf(r)!==-1;if(pe.isRegExp(r))return r.test(t)}}function z$(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,r)=>n.toUpperCase()+r)}function P$(e,t){const n=pe.toCamelCase(" "+t);["get","set","has"].forEach(r=>{Object.defineProperty(e,r+n,{value:function(a,i,l){return this[r].call(this,t,a,i,l)},configurable:!0})})}let zn=class{constructor(t){t&&this.set(t)}set(t,n,r){const a=this;function i(u,c,f){const p=Ls(c);if(!p)throw new Error("header name must be a non-empty string");const g=pe.findKey(a,p);(!g||a[g]===void 0||f===!0||f===void 0&&a[g]!==!1)&&(a[g||c]=pd(u))}const l=(u,c)=>pe.forEach(u,(f,p)=>i(f,p,c));if(pe.isPlainObject(t)||t instanceof this.constructor)l(t,n);else if(pe.isString(t)&&(t=t.trim())&&!F$(t))l(L$(t),n);else if(pe.isHeaders(t))for(const[u,c]of t.entries())i(c,u,r);else t!=null&&i(n,t,r);return this}get(t,n){if(t=Ls(t),t){const r=pe.findKey(this,t);if(r){const a=this[r];if(!n)return a;if(n===!0)return M$(a);if(pe.isFunction(n))return n.call(this,a,r);if(pe.isRegExp(n))return n.exec(a);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,n){if(t=Ls(t),t){const r=pe.findKey(this,t);return!!(r&&this[r]!==void 0&&(!n||ch(this,this[r],r,n)))}return!1}delete(t,n){const r=this;let a=!1;function i(l){if(l=Ls(l),l){const u=pe.findKey(r,l);u&&(!n||ch(r,r[u],u,n))&&(delete r[u],a=!0)}}return pe.isArray(t)?t.forEach(i):i(t),a}clear(t){const n=Object.keys(this);let r=n.length,a=!1;for(;r--;){const i=n[r];(!t||ch(this,this[i],i,t,!0))&&(delete this[i],a=!0)}return a}normalize(t){const n=this,r={};return pe.forEach(this,(a,i)=>{const l=pe.findKey(r,i);if(l){n[l]=pd(a),delete n[i];return}const u=t?z$(i):String(i).trim();u!==i&&delete n[i],n[u]=pd(a),r[u]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const n=Object.create(null);return pe.forEach(this,(r,a)=>{r!=null&&r!==!1&&(n[a]=t&&pe.isArray(r)?r.join(", "):r)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,n])=>t+": "+n).join(` +`)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...n){const r=new this(t);return n.forEach(a=>r.set(a)),r}static accessor(t){const r=(this[hR]=this[hR]={accessors:{}}).accessors,a=this.prototype;function i(l){const u=Ls(l);r[u]||(P$(a,l),r[u]=!0)}return pe.isArray(t)?t.forEach(i):i(t),this}};zn.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);pe.reduceDescriptors(zn.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(r){this[n]=r}}});pe.freezeMethods(zn);function dh(e,t){const n=this||fu,r=t||n,a=zn.from(r.headers);let i=r.data;return pe.forEach(e,function(u){i=u.call(n,i,a.normalize(),t?t.status:void 0)}),a.normalize(),i}function Kz(e){return!!(e&&e.__CANCEL__)}function Tl(e,t,n){nt.call(this,e??"canceled",nt.ERR_CANCELED,t,n),this.name="CanceledError"}pe.inherits(Tl,nt,{__CANCEL__:!0});function Xz(e,t,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new nt("Request failed with status code "+n.status,[nt.ERR_BAD_REQUEST,nt.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function B$(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function U$(e,t){e=e||10;const n=new Array(e),r=new Array(e);let a=0,i=0,l;return t=t!==void 0?t:1e3,function(c){const f=Date.now(),p=r[i];l||(l=f),n[a]=c,r[a]=f;let g=i,b=0;for(;g!==a;)b+=n[g++],g=g%e;if(a=(a+1)%e,a===i&&(i=(i+1)%e),f-l{n=p,a=null,i&&(clearTimeout(i),i=null),e.apply(null,f)};return[(...f)=>{const p=Date.now(),g=p-n;g>=r?l(f,p):(a=f,i||(i=setTimeout(()=>{i=null,l(a)},r-g)))},()=>a&&l(a)]}const Nd=(e,t,n=3)=>{let r=0;const a=U$(50,250);return j$(i=>{const l=i.loaded,u=i.lengthComputable?i.total:void 0,c=l-r,f=a(c),p=l<=u;r=l;const g={loaded:l,total:u,progress:u?l/u:void 0,bytes:c,rate:f||void 0,estimated:f&&u&&p?(u-l)/f:void 0,event:i,lengthComputable:u!=null,[t?"download":"upload"]:!0};e(g)},n)},mR=(e,t)=>{const n=e!=null;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},bR=e=>(...t)=>pe.asap(()=>e(...t)),G$=yn.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,yn.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(yn.origin),yn.navigator&&/(msie|trident)/i.test(yn.navigator.userAgent)):()=>!0,H$=yn.hasStandardBrowserEnv?{write(e,t,n,r,a,i){const l=[e+"="+encodeURIComponent(t)];pe.isNumber(n)&&l.push("expires="+new Date(n).toGMTString()),pe.isString(r)&&l.push("path="+r),pe.isString(a)&&l.push("domain="+a),i===!0&&l.push("secure"),document.cookie=l.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function $$(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function q$(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function Zz(e,t){return e&&!$$(t)?q$(e,t):t}const yR=e=>e instanceof zn?{...e}:e;function ri(e,t){t=t||{};const n={};function r(f,p,g,b){return pe.isPlainObject(f)&&pe.isPlainObject(p)?pe.merge.call({caseless:b},f,p):pe.isPlainObject(p)?pe.merge({},p):pe.isArray(p)?p.slice():p}function a(f,p,g,b){if(pe.isUndefined(p)){if(!pe.isUndefined(f))return r(void 0,f,g,b)}else return r(f,p,g,b)}function i(f,p){if(!pe.isUndefined(p))return r(void 0,p)}function l(f,p){if(pe.isUndefined(p)){if(!pe.isUndefined(f))return r(void 0,f)}else return r(void 0,p)}function u(f,p,g){if(g in t)return r(f,p);if(g in e)return r(void 0,f)}const c={url:i,method:i,data:i,baseURL:l,transformRequest:l,transformResponse:l,paramsSerializer:l,timeout:l,timeoutMessage:l,withCredentials:l,withXSRFToken:l,adapter:l,responseType:l,xsrfCookieName:l,xsrfHeaderName:l,onUploadProgress:l,onDownloadProgress:l,decompress:l,maxContentLength:l,maxBodyLength:l,beforeRedirect:l,transport:l,httpAgent:l,httpsAgent:l,cancelToken:l,socketPath:l,responseEncoding:l,validateStatus:u,headers:(f,p,g)=>a(yR(f),yR(p),g,!0)};return pe.forEach(Object.keys(Object.assign({},e,t)),function(p){const g=c[p]||a,b=g(e[p],t[p],p);pe.isUndefined(b)&&g!==u||(n[p]=b)}),n}const Qz=e=>{const t=ri({},e);let{data:n,withXSRFToken:r,xsrfHeaderName:a,xsrfCookieName:i,headers:l,auth:u}=t;t.headers=l=zn.from(l),t.url=Vz(Zz(t.baseURL,t.url),e.params,e.paramsSerializer),u&&l.set("Authorization","Basic "+btoa((u.username||"")+":"+(u.password?unescape(encodeURIComponent(u.password)):"")));let c;if(pe.isFormData(n)){if(yn.hasStandardBrowserEnv||yn.hasStandardBrowserWebWorkerEnv)l.setContentType(void 0);else if((c=l.getContentType())!==!1){const[f,...p]=c?c.split(";").map(g=>g.trim()).filter(Boolean):[];l.setContentType([f||"multipart/form-data",...p].join("; "))}}if(yn.hasStandardBrowserEnv&&(r&&pe.isFunction(r)&&(r=r(t)),r||r!==!1&&G$(t.url))){const f=a&&i&&H$.read(i);f&&l.set(a,f)}return t},V$=typeof XMLHttpRequest<"u",W$=V$&&function(e){return new Promise(function(n,r){const a=Qz(e);let i=a.data;const l=zn.from(a.headers).normalize();let{responseType:u,onUploadProgress:c,onDownloadProgress:f}=a,p,g,b,m,S;function v(){m&&m(),S&&S(),a.cancelToken&&a.cancelToken.unsubscribe(p),a.signal&&a.signal.removeEventListener("abort",p)}let A=new XMLHttpRequest;A.open(a.method.toUpperCase(),a.url,!0),A.timeout=a.timeout;function R(){if(!A)return;const _=zn.from("getAllResponseHeaders"in A&&A.getAllResponseHeaders()),N={data:!u||u==="text"||u==="json"?A.responseText:A.response,status:A.status,statusText:A.statusText,headers:_,config:e,request:A};Xz(function(O){n(O),v()},function(O){r(O),v()},N),A=null}"onloadend"in A?A.onloadend=R:A.onreadystatechange=function(){!A||A.readyState!==4||A.status===0&&!(A.responseURL&&A.responseURL.indexOf("file:")===0)||setTimeout(R)},A.onabort=function(){A&&(r(new nt("Request aborted",nt.ECONNABORTED,e,A)),A=null)},A.onerror=function(){r(new nt("Network Error",nt.ERR_NETWORK,e,A)),A=null},A.ontimeout=function(){let C=a.timeout?"timeout of "+a.timeout+"ms exceeded":"timeout exceeded";const N=a.transitional||Wz;a.timeoutErrorMessage&&(C=a.timeoutErrorMessage),r(new nt(C,N.clarifyTimeoutError?nt.ETIMEDOUT:nt.ECONNABORTED,e,A)),A=null},i===void 0&&l.setContentType(null),"setRequestHeader"in A&&pe.forEach(l.toJSON(),function(C,N){A.setRequestHeader(N,C)}),pe.isUndefined(a.withCredentials)||(A.withCredentials=!!a.withCredentials),u&&u!=="json"&&(A.responseType=a.responseType),f&&([b,S]=Nd(f,!0),A.addEventListener("progress",b)),c&&A.upload&&([g,m]=Nd(c),A.upload.addEventListener("progress",g),A.upload.addEventListener("loadend",m)),(a.cancelToken||a.signal)&&(p=_=>{A&&(r(!_||_.type?new Tl(null,e,A):_),A.abort(),A=null)},a.cancelToken&&a.cancelToken.subscribe(p),a.signal&&(a.signal.aborted?p():a.signal.addEventListener("abort",p)));const x=B$(a.url);if(x&&yn.protocols.indexOf(x)===-1){r(new nt("Unsupported protocol "+x+":",nt.ERR_BAD_REQUEST,e));return}A.send(i||null)})},Y$=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let r=new AbortController,a;const i=function(f){if(!a){a=!0,u();const p=f instanceof Error?f:this.reason;r.abort(p instanceof nt?p:new Tl(p instanceof Error?p.message:p))}};let l=t&&setTimeout(()=>{l=null,i(new nt(`timeout ${t} of ms exceeded`,nt.ETIMEDOUT))},t);const u=()=>{e&&(l&&clearTimeout(l),l=null,e.forEach(f=>{f.unsubscribe?f.unsubscribe(i):f.removeEventListener("abort",i)}),e=null)};e.forEach(f=>f.addEventListener("abort",i));const{signal:c}=r;return c.unsubscribe=()=>pe.asap(u),c}},K$=function*(e,t){let n=e.byteLength;if(n{const a=X$(e,t);let i=0,l,u=c=>{l||(l=!0,r&&r(c))};return new ReadableStream({async pull(c){try{const{done:f,value:p}=await a.next();if(f){u(),c.close();return}let g=p.byteLength;if(n){let b=i+=g;n(b)}c.enqueue(new Uint8Array(p))}catch(f){throw u(f),f}},cancel(c){return u(c),a.return()}},{highWaterMark:2})},sf=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",Jz=sf&&typeof ReadableStream=="function",Q$=sf&&(typeof TextEncoder=="function"?(e=>t=>e.encode(t))(new TextEncoder):async e=>new Uint8Array(await new Response(e).arrayBuffer())),eP=(e,...t)=>{try{return!!e(...t)}catch{return!1}},J$=Jz&&eP(()=>{let e=!1;const t=new Request(yn.origin,{body:new ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t}),SR=64*1024,yx=Jz&&eP(()=>pe.isReadableStream(new Response("").body)),Od={stream:yx&&(e=>e.body)};sf&&(e=>{["text","arrayBuffer","blob","formData","stream"].forEach(t=>{!Od[t]&&(Od[t]=pe.isFunction(e[t])?n=>n[t]():(n,r)=>{throw new nt(`Response type '${t}' is not supported`,nt.ERR_NOT_SUPPORT,r)})})})(new Response);const eq=async e=>{if(e==null)return 0;if(pe.isBlob(e))return e.size;if(pe.isSpecCompliantForm(e))return(await new Request(yn.origin,{method:"POST",body:e}).arrayBuffer()).byteLength;if(pe.isArrayBufferView(e)||pe.isArrayBuffer(e))return e.byteLength;if(pe.isURLSearchParams(e)&&(e=e+""),pe.isString(e))return(await Q$(e)).byteLength},tq=async(e,t)=>{const n=pe.toFiniteNumber(e.getContentLength());return n??eq(t)},nq=sf&&(async e=>{let{url:t,method:n,data:r,signal:a,cancelToken:i,timeout:l,onDownloadProgress:u,onUploadProgress:c,responseType:f,headers:p,withCredentials:g="same-origin",fetchOptions:b}=Qz(e);f=f?(f+"").toLowerCase():"text";let m=Y$([a,i&&i.toAbortSignal()],l),S;const v=m&&m.unsubscribe&&(()=>{m.unsubscribe()});let A;try{if(c&&J$&&n!=="get"&&n!=="head"&&(A=await tq(p,r))!==0){let N=new Request(t,{method:"POST",body:r,duplex:"half"}),T;if(pe.isFormData(r)&&(T=N.headers.get("content-type"))&&p.setContentType(T),N.body){const[O,z]=mR(A,Nd(bR(c)));r=vR(N.body,SR,O,z)}}pe.isString(g)||(g=g?"include":"omit");const R="credentials"in Request.prototype;S=new Request(t,{...b,signal:m,method:n.toUpperCase(),headers:p.normalize().toJSON(),body:r,duplex:"half",credentials:R?g:void 0});let x=await fetch(S);const _=yx&&(f==="stream"||f==="response");if(yx&&(u||_&&v)){const N={};["status","statusText","headers"].forEach(I=>{N[I]=x[I]});const T=pe.toFiniteNumber(x.headers.get("content-length")),[O,z]=u&&mR(T,Nd(bR(u),!0))||[];x=new Response(vR(x.body,SR,O,()=>{z&&z(),v&&v()}),N)}f=f||"text";let C=await Od[pe.findKey(Od,f)||"text"](x,e);return!_&&v&&v(),await new Promise((N,T)=>{Xz(N,T,{data:C,headers:zn.from(x.headers),status:x.status,statusText:x.statusText,config:e,request:S})})}catch(R){throw v&&v(),R&&R.name==="TypeError"&&/fetch/i.test(R.message)?Object.assign(new nt("Network Error",nt.ERR_NETWORK,e,S),{cause:R.cause||R}):nt.from(R,R&&R.code,e,S)}}),vx={http:b$,xhr:W$,fetch:nq};pe.forEach(vx,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const ER=e=>`- ${e}`,rq=e=>pe.isFunction(e)||e===null||e===!1,tP={getAdapter:e=>{e=pe.isArray(e)?e:[e];const{length:t}=e;let n,r;const a={};for(let i=0;i`adapter ${u} `+(c===!1?"is not supported by the environment":"is not available in the build"));let l=t?i.length>1?`since : +`+i.map(ER).join(` +`):" "+ER(i[0]):"as no adapter specified";throw new nt("There is no suitable adapter to dispatch the request "+l,"ERR_NOT_SUPPORT")}return r},adapters:vx};function fh(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Tl(null,e)}function wR(e){return fh(e),e.headers=zn.from(e.headers),e.data=dh.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),tP.getAdapter(e.adapter||fu.adapter)(e).then(function(r){return fh(e),r.data=dh.call(e,e.transformResponse,r),r.headers=zn.from(r.headers),r},function(r){return Kz(r)||(fh(e),r&&r.response&&(r.response.data=dh.call(e,e.transformResponse,r.response),r.response.headers=zn.from(r.response.headers))),Promise.reject(r)})}const nP="1.7.9",uf={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{uf[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const xR={};uf.transitional=function(t,n,r){function a(i,l){return"[Axios v"+nP+"] Transitional option '"+i+"'"+l+(r?". "+r:"")}return(i,l,u)=>{if(t===!1)throw new nt(a(l," has been removed"+(n?" in "+n:"")),nt.ERR_DEPRECATED);return n&&!xR[l]&&(xR[l]=!0,console.warn(a(l," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(i,l,u):!0}};uf.spelling=function(t){return(n,r)=>(console.warn(`${r} is likely a misspelling of ${t}`),!0)};function aq(e,t,n){if(typeof e!="object")throw new nt("options must be an object",nt.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let a=r.length;for(;a-- >0;){const i=r[a],l=t[i];if(l){const u=e[i],c=u===void 0||l(u,i,e);if(c!==!0)throw new nt("option "+i+" must be "+c,nt.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new nt("Unknown option "+i,nt.ERR_BAD_OPTION)}}const gd={assertOptions:aq,validators:uf},Hr=gd.validators;let ni=class{constructor(t){this.defaults=t,this.interceptors={request:new gR,response:new gR}}async request(t,n){try{return await this._request(t,n)}catch(r){if(r instanceof Error){let a={};Error.captureStackTrace?Error.captureStackTrace(a):a=new Error;const i=a.stack?a.stack.replace(/^.+\n/,""):"";try{r.stack?i&&!String(r.stack).endsWith(i.replace(/^.+\n.+\n/,""))&&(r.stack+=` +`+i):r.stack=i}catch{}}throw r}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=ri(this.defaults,n);const{transitional:r,paramsSerializer:a,headers:i}=n;r!==void 0&&gd.assertOptions(r,{silentJSONParsing:Hr.transitional(Hr.boolean),forcedJSONParsing:Hr.transitional(Hr.boolean),clarifyTimeoutError:Hr.transitional(Hr.boolean)},!1),a!=null&&(pe.isFunction(a)?n.paramsSerializer={serialize:a}:gd.assertOptions(a,{encode:Hr.function,serialize:Hr.function},!0)),gd.assertOptions(n,{baseUrl:Hr.spelling("baseURL"),withXsrfToken:Hr.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let l=i&&pe.merge(i.common,i[n.method]);i&&pe.forEach(["delete","get","head","post","put","patch","common"],S=>{delete i[S]}),n.headers=zn.concat(l,i);const u=[];let c=!0;this.interceptors.request.forEach(function(v){typeof v.runWhen=="function"&&v.runWhen(n)===!1||(c=c&&v.synchronous,u.unshift(v.fulfilled,v.rejected))});const f=[];this.interceptors.response.forEach(function(v){f.push(v.fulfilled,v.rejected)});let p,g=0,b;if(!c){const S=[wR.bind(this),void 0];for(S.unshift.apply(S,u),S.push.apply(S,f),b=S.length,p=Promise.resolve(n);g{if(!r._listeners)return;let i=r._listeners.length;for(;i-- >0;)r._listeners[i](a);r._listeners=null}),this.promise.then=a=>{let i;const l=new Promise(u=>{r.subscribe(u),i=u}).then(a);return l.cancel=function(){r.unsubscribe(i)},l},t(function(i,l,u){r.reason||(r.reason=new Tl(i,l,u),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const t=new AbortController,n=r=>{t.abort(r)};return this.subscribe(n),t.signal.unsubscribe=()=>this.unsubscribe(n),t.signal}static source(){let t;return{token:new rP(function(a){t=a}),cancel:t}}};function iq(e){return function(n){return e.apply(null,n)}}function lq(e){return pe.isObject(e)&&e.isAxiosError===!0}const Sx={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(Sx).forEach(([e,t])=>{Sx[t]=e});function aP(e){const t=new ni(e),n=Lz(ni.prototype.request,t);return pe.extend(n,ni.prototype,t,{allOwnKeys:!0}),pe.extend(n,t,null,{allOwnKeys:!0}),n.create=function(a){return aP(ri(e,a))},n}const $t=aP(fu);$t.Axios=ni;$t.CanceledError=Tl;$t.CancelToken=oq;$t.isCancel=Kz;$t.VERSION=nP;$t.toFormData=lf;$t.AxiosError=nt;$t.Cancel=$t.CanceledError;$t.all=function(t){return Promise.all(t)};$t.spread=iq;$t.isAxiosError=lq;$t.mergeConfig=ri;$t.AxiosHeaders=zn;$t.formToJSON=e=>Yz(pe.isHTMLForm(e)?new FormData(e):e);$t.getAdapter=tP.getAdapter;$t.HttpStatusCode=Sx;$t.default=$t;const{Axios:Fye,AxiosError:zye,CanceledError:Pye,isCancel:Bye,CancelToken:Uye,VERSION:jye,all:Gye,Cancel:Hye,isAxiosError:$ye,spread:qye,toFormData:Vye,AxiosHeaders:Wye,HttpStatusCode:Yye,formToJSON:Kye,getAdapter:Xye,mergeConfig:Zye}=$t,oP="Invalid API Key",iP="API Key required",Mr=$t.create({baseURL:Rz,headers:{"Content-Type":"application/json"}});Mr.interceptors.request.use(e=>{const t=Ke.getState().apiKey;return t&&(e.headers["X-API-Key"]=t),e});Mr.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 sq=async(e,t)=>(await Mr.get(`/graphs?label=${e}&max_depth=${t}`)).data,uq=async()=>(await Mr.get("/graph/label/list")).data,cq=async()=>{try{return(await Mr.get("/health")).data}catch(e){return{status:"error",message:Nr(e)}}},dq=async()=>(await Mr.get("/documents")).data,fq=async()=>(await Mr.post("/documents/scan")).data,pq=async e=>(await Mr.post("/query",e)).data,gq=async(e,t,n)=>{try{let r="";if(await Mr.post("/query/stream",e,{responseType:"text",headers:{Accept:"application/x-ndjson"},transformResponse:[a=>{r+=a;const i=r.split(` +`);r=i.pop()||"";for(const l of i)if(l.trim())try{const u=JSON.parse(l);u.response?t(u.response):u.error&&n&&n(u.error)}catch(u){console.error("Error parsing stream chunk:",u),n&&n("Error parsing server response")}return a}]}).catch(a=>{n&&n(Nr(a))}),r.trim())try{const a=JSON.parse(r);a.response?t(a.response):a.error&&n&&n(a.error)}catch(a){console.error("Error parsing final chunk:",a),n&&n("Error parsing server response")}}catch(r){const a=Nr(r);console.error("Stream request failed:",a),n&&n(a)}},hq=async(e,t)=>{const n=new FormData;return n.append("file",e),(await Mr.post("/documents/upload",n,{headers:{"Content-Type":"multipart/form-data"},onUploadProgress:t!==void 0?a=>{const i=Math.round(a.loaded*100/a.total);t(i)}:void 0})).data},mq=async()=>(await Mr.delete("/documents")).data,bq=wk()(e=>({health:!0,message:null,messageTitle:null,lastCheckTime:Date.now(),status:null,check:async()=>{const t=await cq();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})}})),Pn=Ak(bq);/** + * @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 yq=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),lP=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim();/** + * @license lucide-react v0.475.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */var vq={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 Sq=k.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:a="",children:i,iconNode:l,...u},c)=>k.createElement("svg",{ref:c,...vq,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:lP("lucide",a),...u},[...l.map(([f,p])=>k.createElement(f,p)),...Array.isArray(i)?i:[i]]));/** + * @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 xt=(e,t)=>{const n=k.forwardRef(({className:r,...a},i)=>k.createElement(Sq,{ref:i,iconNode:t,className:lP(`lucide-${yq(e)}`,r),...a}));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 Eq=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Ck=xt("Check",Eq);/** + * @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 wq=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],Nk=xt("ChevronDown",wq);/** + * @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 xq=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],sP=xt("ChevronUp",xq);/** + * @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 kq=[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]],Aq=xt("ChevronsUpDown",kq);/** + * @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 Tq=[["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"}]],_q=xt("CircleAlert",Tq);/** + * @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 Rq=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],Cq=xt("Copy",Rq);/** + * @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 Nq=[["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"}]],uP=xt("Eraser",Nq);/** + * @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 Oq=[["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"}]],Dq=xt("FileText",Oq);/** + * @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 Iq=[["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"}]],Lq=xt("Files",Iq);/** + * @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 Mq=[["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"}]],Fq=xt("Fullscreen",Mq);/** + * @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 zq=[["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"}]],Pq=xt("Github",zq);/** + * @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 Bq=[["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"}]],Uq=xt("Grip",Bq);/** + * @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 jq=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],cP=xt("LoaderCircle",jq);/** + * @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 Gq=[["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"}]],Hq=xt("Loader",Gq);/** + * @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 $q=[["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"}]],qq=xt("Maximize",$q);/** + * @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 Vq=[["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"}]],Wq=xt("Minimize",Vq);/** + * @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 Yq=[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]],Kq=xt("Moon",Yq);/** + * @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 Xq=[["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"}]],Zq=xt("Pause",Xq);/** + * @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 Qq=[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]],Jq=xt("Play",Qq);/** + * @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 e8=[["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"}]],t8=xt("RefreshCw",e8);/** + * @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 n8=[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]],r8=xt("Search",n8);/** + * @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 a8=[["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"}]],o8=xt("Send",a8);/** + * @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 i8=[["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"}]],l8=xt("Settings",i8);/** + * @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 s8=[["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"}]],u8=xt("Sun",s8);/** + * @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 c8=[["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"}]],Ex=xt("Upload",c8);/** + * @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 d8=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],dP=xt("X",d8);/** + * @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 f8=[["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"}]],p8=xt("Zap",f8);/** + * @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 g8=[["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"}]],h8=xt("ZoomIn",g8);/** + * @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 m8=[["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"}]],b8=xt("ZoomOut",m8),y8=()=>{const e=Pn.use.health(),t=Pn.use.message(),n=Pn.use.messageTitle(),[r,a]=k.useState(!1);return k.useEffect(()=>{setTimeout(()=>{a(!0)},50)},[]),w.jsxs(Oz,{className:Me("bg-background/90 absolute top-12 left-1/2 flex w-auto max-w-lg -translate-x-1/2 transform items-center gap-4 shadow-md backdrop-blur-lg transition-all duration-500 ease-in-out",r?"translate-y-0 opacity-100":"-translate-y-20 opacity-0",!e&&"bg-red-700 text-white"),children:[!e&&w.jsx("div",{children:w.jsx(_q,{className:"size-4"})}),w.jsxs("div",{children:[w.jsx(Dz,{className:"font-bold",children:n}),w.jsx(Iz,{children:t})]})]})};function v8(e,t){const n=k.createContext(t),r=i=>{const{children:l,...u}=i,c=k.useMemo(()=>u,Object.values(u));return w.jsx(n.Provider,{value:c,children:l})};r.displayName=e+"Provider";function a(i){const l=k.useContext(n);if(l)return l;if(t!==void 0)return t;throw new Error(`\`${i}\` must be used within \`${e}\``)}return[r,a]}function mr(e,t=[]){let n=[];function r(i,l){const u=k.createContext(l),c=n.length;n=[...n,l];const f=g=>{var R;const{scope:b,children:m,...S}=g,v=((R=b==null?void 0:b[e])==null?void 0:R[c])||u,A=k.useMemo(()=>S,Object.values(S));return w.jsx(v.Provider,{value:A,children:m})};f.displayName=i+"Provider";function p(g,b){var v;const m=((v=b==null?void 0:b[e])==null?void 0:v[c])||u,S=k.useContext(m);if(S)return S;if(l!==void 0)return l;throw new Error(`\`${g}\` must be used within \`${i}\``)}return[f,p]}const a=()=>{const i=n.map(l=>k.createContext(l));return function(u){const c=(u==null?void 0:u[e])||i;return k.useMemo(()=>({[`__scope${e}`]:{...u,[e]:c}}),[u,c])}};return a.scopeName=e,[r,S8(a,...t)]}function S8(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(a=>({useScope:a(),scopeName:a.scopeName}));return function(i){const l=r.reduce((u,{useScope:c,scopeName:f})=>{const g=c(i)[`__scope${f}`];return{...u,...g}},{});return k.useMemo(()=>({[`__scope${t.scopeName}`]:l}),[l])}};return n.scopeName=t.scopeName,n}function kR(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function fP(...e){return t=>{let n=!1;const r=e.map(a=>{const i=kR(a,t);return!n&&typeof i=="function"&&(n=!0),i});if(n)return()=>{for(let a=0;a{},E8=bH.useId||(()=>{}),w8=0;function En(e){const[t,n]=k.useState(E8());return wn(()=>{n(r=>r??String(w8++))},[e]),t?`radix-${t}`:""}function pn(e){const t=k.useRef(e);return k.useEffect(()=>{t.current=e}),k.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function Oa({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,a]=x8({defaultProp:t,onChange:n}),i=e!==void 0,l=i?e:r,u=pn(n),c=k.useCallback(f=>{if(i){const g=typeof f=="function"?f(e):f;g!==e&&u(g)}else a(f)},[i,e,a,u]);return[l,c]}function x8({defaultProp:e,onChange:t}){const n=k.useState(e),[r]=n,a=k.useRef(r),i=pn(t);return k.useEffect(()=>{a.current!==r&&(i(r),a.current=r)},[r,a,i]),n}var pu=mz();const pP=an(pu);var bo=k.forwardRef((e,t)=>{const{children:n,...r}=e,a=k.Children.toArray(n),i=a.find(k8);if(i){const l=i.props.children,u=a.map(c=>c===i?k.Children.count(l)>1?k.Children.only(null):k.isValidElement(l)?l.props.children:null:c);return w.jsx(wx,{...r,ref:t,children:k.isValidElement(l)?k.cloneElement(l,void 0,u):null})}return w.jsx(wx,{...r,ref:t,children:n})});bo.displayName="Slot";var wx=k.forwardRef((e,t)=>{const{children:n,...r}=e;if(k.isValidElement(n)){const a=T8(n),i=A8(r,n.props);return n.type!==k.Fragment&&(i.ref=t?fP(t,a):a),k.cloneElement(n,i)}return k.Children.count(n)>1?k.Children.only(null):null});wx.displayName="SlotClone";var Ok=({children:e})=>w.jsx(w.Fragment,{children:e});function k8(e){return k.isValidElement(e)&&e.type===Ok}function A8(e,t){const n={...t};for(const r in t){const a=e[r],i=t[r];/^on[A-Z]/.test(r)?a&&i?n[r]=(...u)=>{i(...u),a(...u)}:a&&(n[r]=a):r==="style"?n[r]={...a,...i}:r==="className"&&(n[r]=[a,i].filter(Boolean).join(" "))}return{...e,...n}}function T8(e){var r,a;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(a=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:a.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var _8=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],Xe=_8.reduce((e,t)=>{const n=k.forwardRef((r,a)=>{const{asChild:i,...l}=r,u=i?bo:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),w.jsx(u,{...l,ref:a})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function R8(e,t){e&&pu.flushSync(()=>e.dispatchEvent(t))}function C8(e,t=globalThis==null?void 0:globalThis.document){const n=pn(e);k.useEffect(()=>{const r=a=>{a.key==="Escape"&&n(a)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var N8="DismissableLayer",xx="dismissableLayer.update",O8="dismissableLayer.pointerDownOutside",D8="dismissableLayer.focusOutside",AR,gP=k.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),gu=k.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:a,onFocusOutside:i,onInteractOutside:l,onDismiss:u,...c}=e,f=k.useContext(gP),[p,g]=k.useState(null),b=(p==null?void 0:p.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,m]=k.useState({}),S=ft(t,O=>g(O)),v=Array.from(f.layers),[A]=[...f.layersWithOutsidePointerEventsDisabled].slice(-1),R=v.indexOf(A),x=p?v.indexOf(p):-1,_=f.layersWithOutsidePointerEventsDisabled.size>0,C=x>=R,N=M8(O=>{const z=O.target,I=[...f.branches].some(M=>M.contains(z));!C||I||(a==null||a(O),l==null||l(O),O.defaultPrevented||u==null||u())},b),T=F8(O=>{const z=O.target;[...f.branches].some(M=>M.contains(z))||(i==null||i(O),l==null||l(O),O.defaultPrevented||u==null||u())},b);return C8(O=>{x===f.layers.size-1&&(r==null||r(O),!O.defaultPrevented&&u&&(O.preventDefault(),u()))},b),k.useEffect(()=>{if(p)return n&&(f.layersWithOutsidePointerEventsDisabled.size===0&&(AR=b.body.style.pointerEvents,b.body.style.pointerEvents="none"),f.layersWithOutsidePointerEventsDisabled.add(p)),f.layers.add(p),TR(),()=>{n&&f.layersWithOutsidePointerEventsDisabled.size===1&&(b.body.style.pointerEvents=AR)}},[p,b,n,f]),k.useEffect(()=>()=>{p&&(f.layers.delete(p),f.layersWithOutsidePointerEventsDisabled.delete(p),TR())},[p,f]),k.useEffect(()=>{const O=()=>m({});return document.addEventListener(xx,O),()=>document.removeEventListener(xx,O)},[]),w.jsx(Xe.div,{...c,ref:S,style:{pointerEvents:_?C?"auto":"none":void 0,...e.style},onFocusCapture:We(e.onFocusCapture,T.onFocusCapture),onBlurCapture:We(e.onBlurCapture,T.onBlurCapture),onPointerDownCapture:We(e.onPointerDownCapture,N.onPointerDownCapture)})});gu.displayName=N8;var I8="DismissableLayerBranch",L8=k.forwardRef((e,t)=>{const n=k.useContext(gP),r=k.useRef(null),a=ft(t,r);return k.useEffect(()=>{const i=r.current;if(i)return n.branches.add(i),()=>{n.branches.delete(i)}},[n.branches]),w.jsx(Xe.div,{...e,ref:a})});L8.displayName=I8;function M8(e,t=globalThis==null?void 0:globalThis.document){const n=pn(e),r=k.useRef(!1),a=k.useRef(()=>{});return k.useEffect(()=>{const i=u=>{if(u.target&&!r.current){let c=function(){hP(O8,n,f,{discrete:!0})};const f={originalEvent:u};u.pointerType==="touch"?(t.removeEventListener("click",a.current),a.current=c,t.addEventListener("click",a.current,{once:!0})):c()}else t.removeEventListener("click",a.current);r.current=!1},l=window.setTimeout(()=>{t.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(l),t.removeEventListener("pointerdown",i),t.removeEventListener("click",a.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function F8(e,t=globalThis==null?void 0:globalThis.document){const n=pn(e),r=k.useRef(!1);return k.useEffect(()=>{const a=i=>{i.target&&!r.current&&hP(D8,n,{originalEvent:i},{discrete:!1})};return t.addEventListener("focusin",a),()=>t.removeEventListener("focusin",a)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function TR(){const e=new CustomEvent(xx);document.dispatchEvent(e)}function hP(e,t,n,{discrete:r}){const a=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&a.addEventListener(e,t,{once:!0}),r?R8(a,i):a.dispatchEvent(i)}var ph="focusScope.autoFocusOnMount",gh="focusScope.autoFocusOnUnmount",_R={bubbles:!1,cancelable:!0},z8="FocusScope",cf=k.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:a,onUnmountAutoFocus:i,...l}=e,[u,c]=k.useState(null),f=pn(a),p=pn(i),g=k.useRef(null),b=ft(t,v=>c(v)),m=k.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;k.useEffect(()=>{if(r){let v=function(_){if(m.paused||!u)return;const C=_.target;u.contains(C)?g.current=C:co(g.current,{select:!0})},A=function(_){if(m.paused||!u)return;const C=_.relatedTarget;C!==null&&(u.contains(C)||co(g.current,{select:!0}))},R=function(_){if(document.activeElement===document.body)for(const N of _)N.removedNodes.length>0&&co(u)};document.addEventListener("focusin",v),document.addEventListener("focusout",A);const x=new MutationObserver(R);return u&&x.observe(u,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",v),document.removeEventListener("focusout",A),x.disconnect()}}},[r,u,m.paused]),k.useEffect(()=>{if(u){CR.add(m);const v=document.activeElement;if(!u.contains(v)){const R=new CustomEvent(ph,_R);u.addEventListener(ph,f),u.dispatchEvent(R),R.defaultPrevented||(P8(H8(mP(u)),{select:!0}),document.activeElement===v&&co(u))}return()=>{u.removeEventListener(ph,f),setTimeout(()=>{const R=new CustomEvent(gh,_R);u.addEventListener(gh,p),u.dispatchEvent(R),R.defaultPrevented||co(v??document.body,{select:!0}),u.removeEventListener(gh,p),CR.remove(m)},0)}}},[u,f,p,m]);const S=k.useCallback(v=>{if(!n&&!r||m.paused)return;const A=v.key==="Tab"&&!v.altKey&&!v.ctrlKey&&!v.metaKey,R=document.activeElement;if(A&&R){const x=v.currentTarget,[_,C]=B8(x);_&&C?!v.shiftKey&&R===C?(v.preventDefault(),n&&co(_,{select:!0})):v.shiftKey&&R===_&&(v.preventDefault(),n&&co(C,{select:!0})):R===x&&v.preventDefault()}},[n,r,m.paused]);return w.jsx(Xe.div,{tabIndex:-1,...l,ref:b,onKeyDown:S})});cf.displayName=z8;function P8(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(co(r,{select:t}),document.activeElement!==n)return}function B8(e){const t=mP(e),n=RR(t,e),r=RR(t.reverse(),e);return[n,r]}function mP(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const a=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||a?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function RR(e,t){for(const n of e)if(!U8(n,{upTo:t}))return n}function U8(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 j8(e){return e instanceof HTMLInputElement&&"select"in e}function co(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&j8(e)&&t&&e.select()}}var CR=G8();function G8(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=NR(e,t),e.unshift(t)},remove(t){var n;e=NR(e,t),(n=e[0])==null||n.resume()}}}function NR(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function H8(e){return e.filter(t=>t.tagName!=="A")}var $8="Portal",df=k.forwardRef((e,t)=>{var u;const{container:n,...r}=e,[a,i]=k.useState(!1);wn(()=>i(!0),[]);const l=n||a&&((u=globalThis==null?void 0:globalThis.document)==null?void 0:u.body);return l?pP.createPortal(w.jsx(Xe.div,{...r,ref:t}),l):null});df.displayName=$8;function q8(e,t){return k.useReducer((n,r)=>t[n][r]??n,e)}var Jn=e=>{const{present:t,children:n}=e,r=V8(t),a=typeof n=="function"?n({present:r.isPresent}):k.Children.only(n),i=ft(r.ref,W8(a));return typeof n=="function"||r.isPresent?k.cloneElement(a,{ref:i}):null};Jn.displayName="Presence";function V8(e){const[t,n]=k.useState(),r=k.useRef({}),a=k.useRef(e),i=k.useRef("none"),l=e?"mounted":"unmounted",[u,c]=q8(l,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return k.useEffect(()=>{const f=zc(r.current);i.current=u==="mounted"?f:"none"},[u]),wn(()=>{const f=r.current,p=a.current;if(p!==e){const b=i.current,m=zc(f);e?c("MOUNT"):m==="none"||(f==null?void 0:f.display)==="none"?c("UNMOUNT"):c(p&&b!==m?"ANIMATION_OUT":"UNMOUNT"),a.current=e}},[e,c]),wn(()=>{if(t){let f;const p=t.ownerDocument.defaultView??window,g=m=>{const v=zc(r.current).includes(m.animationName);if(m.target===t&&v&&(c("ANIMATION_END"),!a.current)){const A=t.style.animationFillMode;t.style.animationFillMode="forwards",f=p.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=A)})}},b=m=>{m.target===t&&(i.current=zc(r.current))};return t.addEventListener("animationstart",b),t.addEventListener("animationcancel",g),t.addEventListener("animationend",g),()=>{p.clearTimeout(f),t.removeEventListener("animationstart",b),t.removeEventListener("animationcancel",g),t.removeEventListener("animationend",g)}}else c("ANIMATION_END")},[t,c]),{isPresent:["mounted","unmountSuspended"].includes(u),ref:k.useCallback(f=>{f&&(r.current=getComputedStyle(f)),n(f)},[])}}function zc(e){return(e==null?void 0:e.animationName)||"none"}function W8(e){var r,a;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(a=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:a.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var hh=0;function Dk(){k.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??OR()),document.body.insertAdjacentElement("beforeend",e[1]??OR()),hh++,()=>{hh===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),hh--}},[])}function OR(){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 Vr=function(){return Vr=Object.assign||function(t){for(var n,r=1,a=arguments.length;r"u")return c7;var t=d7(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},p7=SP(),ul="data-scroll-locked",g7=function(e,t,n,r){var a=e.left,i=e.top,l=e.right,u=e.gap;return n===void 0&&(n="margin"),` + .`.concat(K8,` { + overflow: hidden `).concat(r,`; + padding-right: `).concat(u,"px ").concat(r,`; + } + body[`).concat(ul,`] { + overflow: hidden `).concat(r,`; + overscroll-behavior: contain; + `).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&` + padding-left: `.concat(a,`px; + padding-top: `).concat(i,`px; + padding-right: `).concat(l,`px; + margin-left:0; + margin-top:0; + margin-right: `).concat(u,"px ").concat(r,`; + `),n==="padding"&&"padding-right: ".concat(u,"px ").concat(r,";")].filter(Boolean).join(""),` + } + + .`).concat(hd,` { + right: `).concat(u,"px ").concat(r,`; + } + + .`).concat(md,` { + margin-right: `).concat(u,"px ").concat(r,`; + } + + .`).concat(hd," .").concat(hd,` { + right: 0 `).concat(r,`; + } + + .`).concat(md," .").concat(md,` { + margin-right: 0 `).concat(r,`; + } + + body[`).concat(ul,`] { + `).concat(X8,": ").concat(u,`px; + } +`)},IR=function(){var e=parseInt(document.body.getAttribute(ul)||"0",10);return isFinite(e)?e:0},h7=function(){k.useEffect(function(){return document.body.setAttribute(ul,(IR()+1).toString()),function(){var e=IR()-1;e<=0?document.body.removeAttribute(ul):document.body.setAttribute(ul,e.toString())}},[])},m7=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,a=r===void 0?"margin":r;h7();var i=k.useMemo(function(){return f7(a)},[a]);return k.createElement(p7,{styles:g7(i,!t,a,n?"":"!important")})},kx=!1;if(typeof window<"u")try{var Pc=Object.defineProperty({},"passive",{get:function(){return kx=!0,!0}});window.addEventListener("test",Pc,Pc),window.removeEventListener("test",Pc,Pc)}catch{kx=!1}var Ki=kx?{passive:!1}:!1,b7=function(e){return e.tagName==="TEXTAREA"},EP=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!b7(e)&&n[t]==="visible")},y7=function(e){return EP(e,"overflowY")},v7=function(e){return EP(e,"overflowX")},LR=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var a=wP(e,r);if(a){var i=xP(e,r),l=i[1],u=i[2];if(l>u)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},S7=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},E7=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},wP=function(e,t){return e==="v"?y7(t):v7(t)},xP=function(e,t){return e==="v"?S7(t):E7(t)},w7=function(e,t){return e==="h"&&t==="rtl"?-1:1},x7=function(e,t,n,r,a){var i=w7(e,window.getComputedStyle(t).direction),l=i*r,u=n.target,c=t.contains(u),f=!1,p=l>0,g=0,b=0;do{var m=xP(e,u),S=m[0],v=m[1],A=m[2],R=v-A-i*S;(S||R)&&wP(e,u)&&(g+=R,b+=S),u instanceof ShadowRoot?u=u.host:u=u.parentNode}while(!c&&u!==document.body||c&&(t.contains(u)||t===u));return(p&&Math.abs(g)<1||!p&&Math.abs(b)<1)&&(f=!0),f},Bc=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},MR=function(e){return[e.deltaX,e.deltaY]},FR=function(e){return e&&"current"in e?e.current:e},k7=function(e,t){return e[0]===t[0]&&e[1]===t[1]},A7=function(e){return` + .block-interactivity-`.concat(e,` {pointer-events: none;} + .allow-interactivity-`).concat(e,` {pointer-events: all;} +`)},T7=0,Xi=[];function _7(e){var t=k.useRef([]),n=k.useRef([0,0]),r=k.useRef(),a=k.useState(T7++)[0],i=k.useState(SP)[0],l=k.useRef(e);k.useEffect(function(){l.current=e},[e]),k.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(a));var v=Y8([e.lockRef.current],(e.shards||[]).map(FR),!0).filter(Boolean);return v.forEach(function(A){return A.classList.add("allow-interactivity-".concat(a))}),function(){document.body.classList.remove("block-interactivity-".concat(a)),v.forEach(function(A){return A.classList.remove("allow-interactivity-".concat(a))})}}},[e.inert,e.lockRef.current,e.shards]);var u=k.useCallback(function(v,A){if("touches"in v&&v.touches.length===2||v.type==="wheel"&&v.ctrlKey)return!l.current.allowPinchZoom;var R=Bc(v),x=n.current,_="deltaX"in v?v.deltaX:x[0]-R[0],C="deltaY"in v?v.deltaY:x[1]-R[1],N,T=v.target,O=Math.abs(_)>Math.abs(C)?"h":"v";if("touches"in v&&O==="h"&&T.type==="range")return!1;var z=LR(O,T);if(!z)return!0;if(z?N=O:(N=O==="v"?"h":"v",z=LR(O,T)),!z)return!1;if(!r.current&&"changedTouches"in v&&(_||C)&&(r.current=N),!N)return!0;var I=r.current||N;return x7(I,A,v,I==="h"?_:C)},[]),c=k.useCallback(function(v){var A=v;if(!(!Xi.length||Xi[Xi.length-1]!==i)){var R="deltaY"in A?MR(A):Bc(A),x=t.current.filter(function(N){return N.name===A.type&&(N.target===A.target||A.target===N.shadowParent)&&k7(N.delta,R)})[0];if(x&&x.should){A.cancelable&&A.preventDefault();return}if(!x){var _=(l.current.shards||[]).map(FR).filter(Boolean).filter(function(N){return N.contains(A.target)}),C=_.length>0?u(A,_[0]):!l.current.noIsolation;C&&A.cancelable&&A.preventDefault()}}},[]),f=k.useCallback(function(v,A,R,x){var _={name:v,delta:A,target:R,should:x,shadowParent:R7(R)};t.current.push(_),setTimeout(function(){t.current=t.current.filter(function(C){return C!==_})},1)},[]),p=k.useCallback(function(v){n.current=Bc(v),r.current=void 0},[]),g=k.useCallback(function(v){f(v.type,MR(v),v.target,u(v,e.lockRef.current))},[]),b=k.useCallback(function(v){f(v.type,Bc(v),v.target,u(v,e.lockRef.current))},[]);k.useEffect(function(){return Xi.push(i),e.setCallbacks({onScrollCapture:g,onWheelCapture:g,onTouchMoveCapture:b}),document.addEventListener("wheel",c,Ki),document.addEventListener("touchmove",c,Ki),document.addEventListener("touchstart",p,Ki),function(){Xi=Xi.filter(function(v){return v!==i}),document.removeEventListener("wheel",c,Ki),document.removeEventListener("touchmove",c,Ki),document.removeEventListener("touchstart",p,Ki)}},[]);var m=e.removeScrollBar,S=e.inert;return k.createElement(k.Fragment,null,S?k.createElement(i,{styles:A7(a)}):null,m?k.createElement(m7,{gapMode:e.gapMode}):null)}function R7(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const C7=r7(vP,_7);var pf=k.forwardRef(function(e,t){return k.createElement(ff,Vr({},e,{ref:t,sideCar:C7}))});pf.classNames=ff.classNames;var N7=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Zi=new WeakMap,Uc=new WeakMap,jc={},vh=0,kP=function(e){return e&&(e.host||kP(e.parentNode))},O7=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=kP(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},D7=function(e,t,n,r){var a=O7(t,Array.isArray(e)?e:[e]);jc[n]||(jc[n]=new WeakMap);var i=jc[n],l=[],u=new Set,c=new Set(a),f=function(g){!g||u.has(g)||(u.add(g),f(g.parentNode))};a.forEach(f);var p=function(g){!g||c.has(g)||Array.prototype.forEach.call(g.children,function(b){if(u.has(b))p(b);else try{var m=b.getAttribute(r),S=m!==null&&m!=="false",v=(Zi.get(b)||0)+1,A=(i.get(b)||0)+1;Zi.set(b,v),i.set(b,A),l.push(b),v===1&&S&&Uc.set(b,!0),A===1&&b.setAttribute(n,"true"),S||b.setAttribute(r,"true")}catch(R){console.error("aria-hidden: cannot operate on ",b,R)}})};return p(t),u.clear(),vh++,function(){l.forEach(function(g){var b=Zi.get(g)-1,m=i.get(g)-1;Zi.set(g,b),i.set(g,m),b||(Uc.has(g)||g.removeAttribute(r),Uc.delete(g)),m||g.removeAttribute(n)}),vh--,vh||(Zi=new WeakMap,Zi=new WeakMap,Uc=new WeakMap,jc={})}},Ik=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),a=N7(e);return a?(r.push.apply(r,Array.from(a.querySelectorAll("[aria-live]"))),D7(r,a,n,"aria-hidden")):function(){return null}},Lk="Dialog",[AP,TP]=mr(Lk),[I7,Fr]=AP(Lk),_P=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:a,onOpenChange:i,modal:l=!0}=e,u=k.useRef(null),c=k.useRef(null),[f=!1,p]=Oa({prop:r,defaultProp:a,onChange:i});return w.jsx(I7,{scope:t,triggerRef:u,contentRef:c,contentId:En(),titleId:En(),descriptionId:En(),open:f,onOpenChange:p,onOpenToggle:k.useCallback(()=>p(g=>!g),[p]),modal:l,children:n})};_P.displayName=Lk;var RP="DialogTrigger",CP=k.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,a=Fr(RP,n),i=ft(t,a.triggerRef);return w.jsx(Xe.button,{type:"button","aria-haspopup":"dialog","aria-expanded":a.open,"aria-controls":a.contentId,"data-state":zk(a.open),...r,ref:i,onClick:We(e.onClick,a.onOpenToggle)})});CP.displayName=RP;var Mk="DialogPortal",[L7,NP]=AP(Mk,{forceMount:void 0}),OP=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:a}=e,i=Fr(Mk,t);return w.jsx(L7,{scope:t,forceMount:n,children:k.Children.map(r,l=>w.jsx(Jn,{present:n||i.open,children:w.jsx(df,{asChild:!0,container:a,children:l})}))})};OP.displayName=Mk;var Dd="DialogOverlay",DP=k.forwardRef((e,t)=>{const n=NP(Dd,e.__scopeDialog),{forceMount:r=n.forceMount,...a}=e,i=Fr(Dd,e.__scopeDialog);return i.modal?w.jsx(Jn,{present:r||i.open,children:w.jsx(M7,{...a,ref:t})}):null});DP.displayName=Dd;var M7=k.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,a=Fr(Dd,n);return w.jsx(pf,{as:bo,allowPinchZoom:!0,shards:[a.contentRef],children:w.jsx(Xe.div,{"data-state":zk(a.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),ai="DialogContent",IP=k.forwardRef((e,t)=>{const n=NP(ai,e.__scopeDialog),{forceMount:r=n.forceMount,...a}=e,i=Fr(ai,e.__scopeDialog);return w.jsx(Jn,{present:r||i.open,children:i.modal?w.jsx(F7,{...a,ref:t}):w.jsx(z7,{...a,ref:t})})});IP.displayName=ai;var F7=k.forwardRef((e,t)=>{const n=Fr(ai,e.__scopeDialog),r=k.useRef(null),a=ft(t,n.contentRef,r);return k.useEffect(()=>{const i=r.current;if(i)return Ik(i)},[]),w.jsx(LP,{...e,ref:a,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:We(e.onCloseAutoFocus,i=>{var l;i.preventDefault(),(l=n.triggerRef.current)==null||l.focus()}),onPointerDownOutside:We(e.onPointerDownOutside,i=>{const l=i.detail.originalEvent,u=l.button===0&&l.ctrlKey===!0;(l.button===2||u)&&i.preventDefault()}),onFocusOutside:We(e.onFocusOutside,i=>i.preventDefault())})}),z7=k.forwardRef((e,t)=>{const n=Fr(ai,e.__scopeDialog),r=k.useRef(!1),a=k.useRef(!1);return w.jsx(LP,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var l,u;(l=e.onCloseAutoFocus)==null||l.call(e,i),i.defaultPrevented||(r.current||(u=n.triggerRef.current)==null||u.focus(),i.preventDefault()),r.current=!1,a.current=!1},onInteractOutside:i=>{var c,f;(c=e.onInteractOutside)==null||c.call(e,i),i.defaultPrevented||(r.current=!0,i.detail.originalEvent.type==="pointerdown"&&(a.current=!0));const l=i.target;((f=n.triggerRef.current)==null?void 0:f.contains(l))&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&a.current&&i.preventDefault()}})}),LP=k.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:a,onCloseAutoFocus:i,...l}=e,u=Fr(ai,n),c=k.useRef(null),f=ft(t,c);return Dk(),w.jsxs(w.Fragment,{children:[w.jsx(cf,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:a,onUnmountAutoFocus:i,children:w.jsx(gu,{role:"dialog",id:u.contentId,"aria-describedby":u.descriptionId,"aria-labelledby":u.titleId,"data-state":zk(u.open),...l,ref:f,onDismiss:()=>u.onOpenChange(!1)})}),w.jsxs(w.Fragment,{children:[w.jsx(B7,{titleId:u.titleId}),w.jsx(j7,{contentRef:c,descriptionId:u.descriptionId})]})]})}),Fk="DialogTitle",MP=k.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,a=Fr(Fk,n);return w.jsx(Xe.h2,{id:a.titleId,...r,ref:t})});MP.displayName=Fk;var FP="DialogDescription",zP=k.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,a=Fr(FP,n);return w.jsx(Xe.p,{id:a.descriptionId,...r,ref:t})});zP.displayName=FP;var PP="DialogClose",BP=k.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,a=Fr(PP,n);return w.jsx(Xe.button,{type:"button",...r,ref:t,onClick:We(e.onClick,()=>a.onOpenChange(!1))})});BP.displayName=PP;function zk(e){return e?"open":"closed"}var UP="DialogTitleWarning",[P7,jP]=v8(UP,{contentName:ai,titleName:Fk,docsSlug:"dialog"}),B7=({titleId:e})=>{const t=jP(UP),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 k.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},U7="DialogDescriptionWarning",j7=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${jP(U7).contentName}}.`;return k.useEffect(()=>{var i;const a=(i=e.current)==null?void 0:i.getAttribute("aria-describedby");t&&a&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},Pk=_P,GP=CP,Bk=OP,gf=DP,hf=IP,Uk=MP,jk=zP,Gk=BP,HP="AlertDialog",[G7,Qye]=mr(HP,[TP]),La=TP(),$P=e=>{const{__scopeAlertDialog:t,...n}=e,r=La(t);return w.jsx(Pk,{...r,...n,modal:!0})};$P.displayName=HP;var H7="AlertDialogTrigger",$7=k.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,a=La(n);return w.jsx(GP,{...a,...r,ref:t})});$7.displayName=H7;var q7="AlertDialogPortal",qP=e=>{const{__scopeAlertDialog:t,...n}=e,r=La(t);return w.jsx(Bk,{...r,...n})};qP.displayName=q7;var V7="AlertDialogOverlay",VP=k.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,a=La(n);return w.jsx(gf,{...a,...r,ref:t})});VP.displayName=V7;var cl="AlertDialogContent",[W7,Y7]=G7(cl),WP=k.forwardRef((e,t)=>{const{__scopeAlertDialog:n,children:r,...a}=e,i=La(n),l=k.useRef(null),u=ft(t,l),c=k.useRef(null);return w.jsx(P7,{contentName:cl,titleName:YP,docsSlug:"alert-dialog",children:w.jsx(W7,{scope:n,cancelRef:c,children:w.jsxs(hf,{role:"alertdialog",...i,...a,ref:u,onOpenAutoFocus:We(a.onOpenAutoFocus,f=>{var p;f.preventDefault(),(p=c.current)==null||p.focus({preventScroll:!0})}),onPointerDownOutside:f=>f.preventDefault(),onInteractOutside:f=>f.preventDefault(),children:[w.jsx(Ok,{children:r}),w.jsx(X7,{contentRef:l})]})})})});WP.displayName=cl;var YP="AlertDialogTitle",KP=k.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,a=La(n);return w.jsx(Uk,{...a,...r,ref:t})});KP.displayName=YP;var XP="AlertDialogDescription",ZP=k.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,a=La(n);return w.jsx(jk,{...a,...r,ref:t})});ZP.displayName=XP;var K7="AlertDialogAction",QP=k.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,a=La(n);return w.jsx(Gk,{...a,...r,ref:t})});QP.displayName=K7;var JP="AlertDialogCancel",eB=k.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,{cancelRef:a}=Y7(JP,n),i=La(n),l=ft(t,a);return w.jsx(Gk,{...i,...r,ref:l})});eB.displayName=JP;var X7=({contentRef:e})=>{const t=`\`${cl}\` requires a description for the component to be accessible for screen reader users. + +You can add a description to the \`${cl}\` by passing a \`${XP}\` 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 \`${cl}\`. 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 k.useEffect(()=>{var r;document.getElementById((r=e.current)==null?void 0:r.getAttribute("aria-describedby"))||console.warn(t)},[t,e]),null},Z7=$P,Q7=qP,tB=VP,nB=WP,rB=QP,aB=eB,oB=KP,iB=ZP;const J7=["top","right","bottom","left"],yo=Math.min,Kn=Math.max,Id=Math.round,Gc=Math.floor,Kr=e=>({x:e,y:e}),eV={left:"right",right:"left",bottom:"top",top:"bottom"},tV={start:"end",end:"start"};function Ax(e,t,n){return Kn(e,yo(t,n))}function Da(e,t){return typeof e=="function"?e(t):e}function Ia(e){return e.split("-")[0]}function _l(e){return e.split("-")[1]}function Hk(e){return e==="x"?"y":"x"}function $k(e){return e==="y"?"height":"width"}function vo(e){return["top","bottom"].includes(Ia(e))?"y":"x"}function qk(e){return Hk(vo(e))}function nV(e,t,n){n===void 0&&(n=!1);const r=_l(e),a=qk(e),i=$k(a);let l=a==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(l=Ld(l)),[l,Ld(l)]}function rV(e){const t=Ld(e);return[Tx(e),t,Tx(t)]}function Tx(e){return e.replace(/start|end/g,t=>tV[t])}function aV(e,t,n){const r=["left","right"],a=["right","left"],i=["top","bottom"],l=["bottom","top"];switch(e){case"top":case"bottom":return n?t?a:r:t?r:a;case"left":case"right":return t?i:l;default:return[]}}function oV(e,t,n,r){const a=_l(e);let i=aV(Ia(e),n==="start",r);return a&&(i=i.map(l=>l+"-"+a),t&&(i=i.concat(i.map(Tx)))),i}function Ld(e){return e.replace(/left|right|bottom|top/g,t=>eV[t])}function iV(e){return{top:0,right:0,bottom:0,left:0,...e}}function lB(e){return typeof e!="number"?iV(e):{top:e,right:e,bottom:e,left:e}}function Md(e){const{x:t,y:n,width:r,height:a}=e;return{width:r,height:a,top:n,left:t,right:t+r,bottom:n+a,x:t,y:n}}function zR(e,t,n){let{reference:r,floating:a}=e;const i=vo(t),l=qk(t),u=$k(l),c=Ia(t),f=i==="y",p=r.x+r.width/2-a.width/2,g=r.y+r.height/2-a.height/2,b=r[u]/2-a[u]/2;let m;switch(c){case"top":m={x:p,y:r.y-a.height};break;case"bottom":m={x:p,y:r.y+r.height};break;case"right":m={x:r.x+r.width,y:g};break;case"left":m={x:r.x-a.width,y:g};break;default:m={x:r.x,y:r.y}}switch(_l(t)){case"start":m[l]-=b*(n&&f?-1:1);break;case"end":m[l]+=b*(n&&f?-1:1);break}return m}const lV=async(e,t,n)=>{const{placement:r="bottom",strategy:a="absolute",middleware:i=[],platform:l}=n,u=i.filter(Boolean),c=await(l.isRTL==null?void 0:l.isRTL(t));let f=await l.getElementRects({reference:e,floating:t,strategy:a}),{x:p,y:g}=zR(f,r,c),b=r,m={},S=0;for(let v=0;v({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:a,rects:i,platform:l,elements:u,middlewareData:c}=t,{element:f,padding:p=0}=Da(e,t)||{};if(f==null)return{};const g=lB(p),b={x:n,y:r},m=qk(a),S=$k(m),v=await l.getDimensions(f),A=m==="y",R=A?"top":"left",x=A?"bottom":"right",_=A?"clientHeight":"clientWidth",C=i.reference[S]+i.reference[m]-b[m]-i.floating[S],N=b[m]-i.reference[m],T=await(l.getOffsetParent==null?void 0:l.getOffsetParent(f));let O=T?T[_]:0;(!O||!await(l.isElement==null?void 0:l.isElement(T)))&&(O=u.floating[_]||i.floating[S]);const z=C/2-N/2,I=O/2-v[S]/2-1,M=yo(g[R],I),H=yo(g[x],I),q=M,U=O-v[S]-H,W=O/2-v[S]/2+z,Z=Ax(q,W,U),j=!c.arrow&&_l(a)!=null&&W!==Z&&i.reference[S]/2-(WW<=0)){var H,q;const W=(((H=i.flip)==null?void 0:H.index)||0)+1,Z=O[W];if(Z)return{data:{index:W,overflows:M},reset:{placement:Z}};let j=(q=M.filter(G=>G.overflows[0]<=0).sort((G,P)=>G.overflows[1]-P.overflows[1])[0])==null?void 0:q.placement;if(!j)switch(m){case"bestFit":{var U;const G=(U=M.filter(P=>{if(T){const X=vo(P.placement);return X===x||X==="y"}return!0}).map(P=>[P.placement,P.overflows.filter(X=>X>0).reduce((X,D)=>X+D,0)]).sort((P,X)=>P[1]-X[1])[0])==null?void 0:U[0];G&&(j=G);break}case"initialPlacement":j=u;break}if(a!==j)return{reset:{placement:j}}}return{}}}};function PR(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function BR(e){return J7.some(t=>e[t]>=0)}const cV=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...a}=Da(e,t);switch(r){case"referenceHidden":{const i=await Js(t,{...a,elementContext:"reference"}),l=PR(i,n.reference);return{data:{referenceHiddenOffsets:l,referenceHidden:BR(l)}}}case"escaped":{const i=await Js(t,{...a,altBoundary:!0}),l=PR(i,n.floating);return{data:{escapedOffsets:l,escaped:BR(l)}}}default:return{}}}}};async function dV(e,t){const{placement:n,platform:r,elements:a}=e,i=await(r.isRTL==null?void 0:r.isRTL(a.floating)),l=Ia(n),u=_l(n),c=vo(n)==="y",f=["left","top"].includes(l)?-1:1,p=i&&c?-1:1,g=Da(t,e);let{mainAxis:b,crossAxis:m,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"&&(m=u==="end"?S*-1:S),c?{x:m*p,y:b*f}:{x:b*f,y:m*p}}const fV=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:a,y:i,placement:l,middlewareData:u}=t,c=await dV(t,e);return l===((n=u.offset)==null?void 0:n.placement)&&(r=u.arrow)!=null&&r.alignmentOffset?{}:{x:a+c.x,y:i+c.y,data:{...c,placement:l}}}}},pV=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:a}=t,{mainAxis:i=!0,crossAxis:l=!1,limiter:u={fn:A=>{let{x:R,y:x}=A;return{x:R,y:x}}},...c}=Da(e,t),f={x:n,y:r},p=await Js(t,c),g=vo(Ia(a)),b=Hk(g);let m=f[b],S=f[g];if(i){const A=b==="y"?"top":"left",R=b==="y"?"bottom":"right",x=m+p[A],_=m-p[R];m=Ax(x,m,_)}if(l){const A=g==="y"?"top":"left",R=g==="y"?"bottom":"right",x=S+p[A],_=S-p[R];S=Ax(x,S,_)}const v=u.fn({...t,[b]:m,[g]:S});return{...v,data:{x:v.x-n,y:v.y-r,enabled:{[b]:i,[g]:l}}}}}},gV=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:a,rects:i,middlewareData:l}=t,{offset:u=0,mainAxis:c=!0,crossAxis:f=!0}=Da(e,t),p={x:n,y:r},g=vo(a),b=Hk(g);let m=p[b],S=p[g];const v=Da(u,t),A=typeof v=="number"?{mainAxis:v,crossAxis:0}:{mainAxis:0,crossAxis:0,...v};if(c){const _=b==="y"?"height":"width",C=i.reference[b]-i.floating[_]+A.mainAxis,N=i.reference[b]+i.reference[_]-A.mainAxis;mN&&(m=N)}if(f){var R,x;const _=b==="y"?"width":"height",C=["top","left"].includes(Ia(a)),N=i.reference[g]-i.floating[_]+(C&&((R=l.offset)==null?void 0:R[g])||0)+(C?0:A.crossAxis),T=i.reference[g]+i.reference[_]+(C?0:((x=l.offset)==null?void 0:x[g])||0)-(C?A.crossAxis:0);ST&&(S=T)}return{[b]:m,[g]:S}}}},hV=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:a,rects:i,platform:l,elements:u}=t,{apply:c=()=>{},...f}=Da(e,t),p=await Js(t,f),g=Ia(a),b=_l(a),m=vo(a)==="y",{width:S,height:v}=i.floating;let A,R;g==="top"||g==="bottom"?(A=g,R=b===(await(l.isRTL==null?void 0:l.isRTL(u.floating))?"start":"end")?"left":"right"):(R=g,A=b==="end"?"top":"bottom");const x=v-p.top-p.bottom,_=S-p.left-p.right,C=yo(v-p[A],x),N=yo(S-p[R],_),T=!t.middlewareData.shift;let O=C,z=N;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(z=_),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(O=x),T&&!b){const M=Kn(p.left,0),H=Kn(p.right,0),q=Kn(p.top,0),U=Kn(p.bottom,0);m?z=S-2*(M!==0||H!==0?M+H:Kn(p.left,p.right)):O=v-2*(q!==0||U!==0?q+U:Kn(p.top,p.bottom))}await c({...t,availableWidth:z,availableHeight:O});const I=await l.getDimensions(u.floating);return S!==I.width||v!==I.height?{reset:{rects:!0}}:{}}}};function mf(){return typeof window<"u"}function Rl(e){return sB(e)?(e.nodeName||"").toLowerCase():"#document"}function Zn(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Zr(e){var t;return(t=(sB(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function sB(e){return mf()?e instanceof Node||e instanceof Zn(e).Node:!1}function Dr(e){return mf()?e instanceof Element||e instanceof Zn(e).Element:!1}function Xr(e){return mf()?e instanceof HTMLElement||e instanceof Zn(e).HTMLElement:!1}function UR(e){return!mf()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Zn(e).ShadowRoot}function hu(e){const{overflow:t,overflowX:n,overflowY:r,display:a}=Ir(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(a)}function mV(e){return["table","td","th"].includes(Rl(e))}function bf(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function Vk(e){const t=Wk(),n=Dr(e)?Ir(e):e;return["transform","translate","scale","rotate","perspective"].some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||["transform","translate","scale","rotate","perspective","filter"].some(r=>(n.willChange||"").includes(r))||["paint","layout","strict","content"].some(r=>(n.contain||"").includes(r))}function bV(e){let t=So(e);for(;Xr(t)&&!hl(t);){if(Vk(t))return t;if(bf(t))return null;t=So(t)}return null}function Wk(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function hl(e){return["html","body","#document"].includes(Rl(e))}function Ir(e){return Zn(e).getComputedStyle(e)}function yf(e){return Dr(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function So(e){if(Rl(e)==="html")return e;const t=e.assignedSlot||e.parentNode||UR(e)&&e.host||Zr(e);return UR(t)?t.host:t}function uB(e){const t=So(e);return hl(t)?e.ownerDocument?e.ownerDocument.body:e.body:Xr(t)&&hu(t)?t:uB(t)}function eu(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const a=uB(e),i=a===((r=e.ownerDocument)==null?void 0:r.body),l=Zn(a);if(i){const u=_x(l);return t.concat(l,l.visualViewport||[],hu(a)?a:[],u&&n?eu(u):[])}return t.concat(a,eu(a,[],n))}function _x(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function cB(e){const t=Ir(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const a=Xr(e),i=a?e.offsetWidth:n,l=a?e.offsetHeight:r,u=Id(n)!==i||Id(r)!==l;return u&&(n=i,r=l),{width:n,height:r,$:u}}function Yk(e){return Dr(e)?e:e.contextElement}function dl(e){const t=Yk(e);if(!Xr(t))return Kr(1);const n=t.getBoundingClientRect(),{width:r,height:a,$:i}=cB(t);let l=(i?Id(n.width):n.width)/r,u=(i?Id(n.height):n.height)/a;return(!l||!Number.isFinite(l))&&(l=1),(!u||!Number.isFinite(u))&&(u=1),{x:l,y:u}}const yV=Kr(0);function dB(e){const t=Zn(e);return!Wk()||!t.visualViewport?yV:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function vV(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Zn(e)?!1:t}function oi(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const a=e.getBoundingClientRect(),i=Yk(e);let l=Kr(1);t&&(r?Dr(r)&&(l=dl(r)):l=dl(e));const u=vV(i,n,r)?dB(i):Kr(0);let c=(a.left+u.x)/l.x,f=(a.top+u.y)/l.y,p=a.width/l.x,g=a.height/l.y;if(i){const b=Zn(i),m=r&&Dr(r)?Zn(r):r;let S=b,v=_x(S);for(;v&&r&&m!==S;){const A=dl(v),R=v.getBoundingClientRect(),x=Ir(v),_=R.left+(v.clientLeft+parseFloat(x.paddingLeft))*A.x,C=R.top+(v.clientTop+parseFloat(x.paddingTop))*A.y;c*=A.x,f*=A.y,p*=A.x,g*=A.y,c+=_,f+=C,S=Zn(v),v=_x(S)}}return Md({width:p,height:g,x:c,y:f})}function Kk(e,t){const n=yf(e).scrollLeft;return t?t.left+n:oi(Zr(e)).left+n}function fB(e,t,n){n===void 0&&(n=!1);const r=e.getBoundingClientRect(),a=r.left+t.scrollLeft-(n?0:Kk(e,r)),i=r.top+t.scrollTop;return{x:a,y:i}}function SV(e){let{elements:t,rect:n,offsetParent:r,strategy:a}=e;const i=a==="fixed",l=Zr(r),u=t?bf(t.floating):!1;if(r===l||u&&i)return n;let c={scrollLeft:0,scrollTop:0},f=Kr(1);const p=Kr(0),g=Xr(r);if((g||!g&&!i)&&((Rl(r)!=="body"||hu(l))&&(c=yf(r)),Xr(r))){const m=oi(r);f=dl(r),p.x=m.x+r.clientLeft,p.y=m.y+r.clientTop}const b=l&&!g&&!i?fB(l,c,!0):Kr(0);return{width:n.width*f.x,height:n.height*f.y,x:n.x*f.x-c.scrollLeft*f.x+p.x+b.x,y:n.y*f.y-c.scrollTop*f.y+p.y+b.y}}function EV(e){return Array.from(e.getClientRects())}function wV(e){const t=Zr(e),n=yf(e),r=e.ownerDocument.body,a=Kn(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=Kn(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let l=-n.scrollLeft+Kk(e);const u=-n.scrollTop;return Ir(r).direction==="rtl"&&(l+=Kn(t.clientWidth,r.clientWidth)-a),{width:a,height:i,x:l,y:u}}function xV(e,t){const n=Zn(e),r=Zr(e),a=n.visualViewport;let i=r.clientWidth,l=r.clientHeight,u=0,c=0;if(a){i=a.width,l=a.height;const f=Wk();(!f||f&&t==="fixed")&&(u=a.offsetLeft,c=a.offsetTop)}return{width:i,height:l,x:u,y:c}}function kV(e,t){const n=oi(e,!0,t==="fixed"),r=n.top+e.clientTop,a=n.left+e.clientLeft,i=Xr(e)?dl(e):Kr(1),l=e.clientWidth*i.x,u=e.clientHeight*i.y,c=a*i.x,f=r*i.y;return{width:l,height:u,x:c,y:f}}function jR(e,t,n){let r;if(t==="viewport")r=xV(e,n);else if(t==="document")r=wV(Zr(e));else if(Dr(t))r=kV(t,n);else{const a=dB(e);r={x:t.x-a.x,y:t.y-a.y,width:t.width,height:t.height}}return Md(r)}function pB(e,t){const n=So(e);return n===t||!Dr(n)||hl(n)?!1:Ir(n).position==="fixed"||pB(n,t)}function AV(e,t){const n=t.get(e);if(n)return n;let r=eu(e,[],!1).filter(u=>Dr(u)&&Rl(u)!=="body"),a=null;const i=Ir(e).position==="fixed";let l=i?So(e):e;for(;Dr(l)&&!hl(l);){const u=Ir(l),c=Vk(l);!c&&u.position==="fixed"&&(a=null),(i?!c&&!a:!c&&u.position==="static"&&!!a&&["absolute","fixed"].includes(a.position)||hu(l)&&!c&&pB(e,l))?r=r.filter(p=>p!==l):a=u,l=So(l)}return t.set(e,r),r}function TV(e){let{element:t,boundary:n,rootBoundary:r,strategy:a}=e;const l=[...n==="clippingAncestors"?bf(t)?[]:AV(t,this._c):[].concat(n),r],u=l[0],c=l.reduce((f,p)=>{const g=jR(t,p,a);return f.top=Kn(g.top,f.top),f.right=yo(g.right,f.right),f.bottom=yo(g.bottom,f.bottom),f.left=Kn(g.left,f.left),f},jR(t,u,a));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function _V(e){const{width:t,height:n}=cB(e);return{width:t,height:n}}function RV(e,t,n){const r=Xr(t),a=Zr(t),i=n==="fixed",l=oi(e,!0,i,t);let u={scrollLeft:0,scrollTop:0};const c=Kr(0);if(r||!r&&!i)if((Rl(t)!=="body"||hu(a))&&(u=yf(t)),r){const b=oi(t,!0,i,t);c.x=b.x+t.clientLeft,c.y=b.y+t.clientTop}else a&&(c.x=Kk(a));const f=a&&!r&&!i?fB(a,u):Kr(0),p=l.left+u.scrollLeft-c.x-f.x,g=l.top+u.scrollTop-c.y-f.y;return{x:p,y:g,width:l.width,height:l.height}}function Sh(e){return Ir(e).position==="static"}function GR(e,t){if(!Xr(e)||Ir(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Zr(e)===n&&(n=n.ownerDocument.body),n}function gB(e,t){const n=Zn(e);if(bf(e))return n;if(!Xr(e)){let a=So(e);for(;a&&!hl(a);){if(Dr(a)&&!Sh(a))return a;a=So(a)}return n}let r=GR(e,t);for(;r&&mV(r)&&Sh(r);)r=GR(r,t);return r&&hl(r)&&Sh(r)&&!Vk(r)?n:r||bV(e)||n}const CV=async function(e){const t=this.getOffsetParent||gB,n=this.getDimensions,r=await n(e.floating);return{reference:RV(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function NV(e){return Ir(e).direction==="rtl"}const OV={convertOffsetParentRelativeRectToViewportRelativeRect:SV,getDocumentElement:Zr,getClippingRect:TV,getOffsetParent:gB,getElementRects:CV,getClientRects:EV,getDimensions:_V,getScale:dl,isElement:Dr,isRTL:NV};function hB(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function DV(e,t){let n=null,r;const a=Zr(e);function i(){var u;clearTimeout(r),(u=n)==null||u.disconnect(),n=null}function l(u,c){u===void 0&&(u=!1),c===void 0&&(c=1),i();const f=e.getBoundingClientRect(),{left:p,top:g,width:b,height:m}=f;if(u||t(),!b||!m)return;const S=Gc(g),v=Gc(a.clientWidth-(p+b)),A=Gc(a.clientHeight-(g+m)),R=Gc(p),_={rootMargin:-S+"px "+-v+"px "+-A+"px "+-R+"px",threshold:Kn(0,yo(1,c))||1};let C=!0;function N(T){const O=T[0].intersectionRatio;if(O!==c){if(!C)return l();O?l(!1,O):r=setTimeout(()=>{l(!1,1e-7)},1e3)}O===1&&!hB(f,e.getBoundingClientRect())&&l(),C=!1}try{n=new IntersectionObserver(N,{..._,root:a.ownerDocument})}catch{n=new IntersectionObserver(N,_)}n.observe(e)}return l(!0),i}function IV(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:a=!0,ancestorResize:i=!0,elementResize:l=typeof ResizeObserver=="function",layoutShift:u=typeof IntersectionObserver=="function",animationFrame:c=!1}=r,f=Yk(e),p=a||i?[...f?eu(f):[],...eu(t)]:[];p.forEach(R=>{a&&R.addEventListener("scroll",n,{passive:!0}),i&&R.addEventListener("resize",n)});const g=f&&u?DV(f,n):null;let b=-1,m=null;l&&(m=new ResizeObserver(R=>{let[x]=R;x&&x.target===f&&m&&(m.unobserve(t),cancelAnimationFrame(b),b=requestAnimationFrame(()=>{var _;(_=m)==null||_.observe(t)})),n()}),f&&!c&&m.observe(f),m.observe(t));let S,v=c?oi(e):null;c&&A();function A(){const R=oi(e);v&&!hB(v,R)&&n(),v=R,S=requestAnimationFrame(A)}return n(),()=>{var R;p.forEach(x=>{a&&x.removeEventListener("scroll",n),i&&x.removeEventListener("resize",n)}),g==null||g(),(R=m)==null||R.disconnect(),m=null,c&&cancelAnimationFrame(S)}}const LV=fV,MV=pV,FV=uV,zV=hV,PV=cV,HR=sV,BV=gV,UV=(e,t,n)=>{const r=new Map,a={platform:OV,...n},i={...a.platform,_c:r};return lV(e,t,{...a,platform:i})};var bd=typeof document<"u"?k.useLayoutEffect:k.useEffect;function Fd(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,a;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!Fd(e[r],t[r]))return!1;return!0}if(a=Object.keys(e),n=a.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,a[r]))return!1;for(r=n;r--!==0;){const i=a[r];if(!(i==="_owner"&&e.$$typeof)&&!Fd(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function mB(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function $R(e,t){const n=mB(e);return Math.round(t*n)/n}function Eh(e){const t=k.useRef(e);return bd(()=>{t.current=e}),t}function jV(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:a,elements:{reference:i,floating:l}={},transform:u=!0,whileElementsMounted:c,open:f}=e,[p,g]=k.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[b,m]=k.useState(r);Fd(b,r)||m(r);const[S,v]=k.useState(null),[A,R]=k.useState(null),x=k.useCallback(P=>{P!==T.current&&(T.current=P,v(P))},[]),_=k.useCallback(P=>{P!==O.current&&(O.current=P,R(P))},[]),C=i||S,N=l||A,T=k.useRef(null),O=k.useRef(null),z=k.useRef(p),I=c!=null,M=Eh(c),H=Eh(a),q=Eh(f),U=k.useCallback(()=>{if(!T.current||!O.current)return;const P={placement:t,strategy:n,middleware:b};H.current&&(P.platform=H.current),UV(T.current,O.current,P).then(X=>{const D={...X,isPositioned:q.current!==!1};W.current&&!Fd(z.current,D)&&(z.current=D,pu.flushSync(()=>{g(D)}))})},[b,t,n,H,q]);bd(()=>{f===!1&&z.current.isPositioned&&(z.current.isPositioned=!1,g(P=>({...P,isPositioned:!1})))},[f]);const W=k.useRef(!1);bd(()=>(W.current=!0,()=>{W.current=!1}),[]),bd(()=>{if(C&&(T.current=C),N&&(O.current=N),C&&N){if(M.current)return M.current(C,N,U);U()}},[C,N,U,M,I]);const Z=k.useMemo(()=>({reference:T,floating:O,setReference:x,setFloating:_}),[x,_]),j=k.useMemo(()=>({reference:C,floating:N}),[C,N]),G=k.useMemo(()=>{const P={position:n,left:0,top:0};if(!j.floating)return P;const X=$R(j.floating,p.x),D=$R(j.floating,p.y);return u?{...P,transform:"translate("+X+"px, "+D+"px)",...mB(j.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:X,top:D}},[n,u,j.floating,p.x,p.y]);return k.useMemo(()=>({...p,update:U,refs:Z,elements:j,floatingStyles:G}),[p,U,Z,j,G])}const GV=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:a}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?HR({element:r.current,padding:a}).fn(n):{}:r?HR({element:r,padding:a}).fn(n):{}}}},HV=(e,t)=>({...LV(e),options:[e,t]}),$V=(e,t)=>({...MV(e),options:[e,t]}),qV=(e,t)=>({...BV(e),options:[e,t]}),VV=(e,t)=>({...FV(e),options:[e,t]}),WV=(e,t)=>({...zV(e),options:[e,t]}),YV=(e,t)=>({...PV(e),options:[e,t]}),KV=(e,t)=>({...GV(e),options:[e,t]});var XV="Arrow",bB=k.forwardRef((e,t)=>{const{children:n,width:r=10,height:a=5,...i}=e;return w.jsx(Xe.svg,{...i,ref:t,width:r,height:a,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:w.jsx("polygon",{points:"0,0 30,0 15,10"})})});bB.displayName=XV;var ZV=bB;function yB(e){const[t,n]=k.useState(void 0);return wn(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(a=>{if(!Array.isArray(a)||!a.length)return;const i=a[0];let l,u;if("borderBoxSize"in i){const c=i.borderBoxSize,f=Array.isArray(c)?c[0]:c;l=f.inlineSize,u=f.blockSize}else l=e.offsetWidth,u=e.offsetHeight;n({width:l,height:u})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var Xk="Popper",[vB,Cl]=mr(Xk),[QV,SB]=vB(Xk),EB=e=>{const{__scopePopper:t,children:n}=e,[r,a]=k.useState(null);return w.jsx(QV,{scope:t,anchor:r,onAnchorChange:a,children:n})};EB.displayName=Xk;var wB="PopperAnchor",xB=k.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...a}=e,i=SB(wB,n),l=k.useRef(null),u=ft(t,l);return k.useEffect(()=>{i.onAnchorChange((r==null?void 0:r.current)||l.current)}),r?null:w.jsx(Xe.div,{...a,ref:u})});xB.displayName=wB;var Zk="PopperContent",[JV,eW]=vB(Zk),kB=k.forwardRef((e,t)=>{var re,le,Ae,ae,we,xe;const{__scopePopper:n,side:r="bottom",sideOffset:a=0,align:i="center",alignOffset:l=0,arrowPadding:u=0,avoidCollisions:c=!0,collisionBoundary:f=[],collisionPadding:p=0,sticky:g="partial",hideWhenDetached:b=!1,updatePositionStrategy:m="optimized",onPlaced:S,...v}=e,A=SB(Zk,n),[R,x]=k.useState(null),_=ft(t,Ie=>x(Ie)),[C,N]=k.useState(null),T=yB(C),O=(T==null?void 0:T.width)??0,z=(T==null?void 0:T.height)??0,I=r+(i!=="center"?"-"+i:""),M=typeof p=="number"?p:{top:0,right:0,bottom:0,left:0,...p},H=Array.isArray(f)?f:[f],q=H.length>0,U={padding:M,boundary:H.filter(nW),altBoundary:q},{refs:W,floatingStyles:Z,placement:j,isPositioned:G,middlewareData:P}=jV({strategy:"fixed",placement:I,whileElementsMounted:(...Ie)=>IV(...Ie,{animationFrame:m==="always"}),elements:{reference:A.anchor},middleware:[HV({mainAxis:a+z,alignmentAxis:l}),c&&$V({mainAxis:!0,crossAxis:!1,limiter:g==="partial"?qV():void 0,...U}),c&&VV({...U}),WV({...U,apply:({elements:Ie,rects:Ce,availableWidth:Ee,availableHeight:J})=>{const{width:fe,height:ke}=Ce.reference,me=Ie.floating.style;me.setProperty("--radix-popper-available-width",`${Ee}px`),me.setProperty("--radix-popper-available-height",`${J}px`),me.setProperty("--radix-popper-anchor-width",`${fe}px`),me.setProperty("--radix-popper-anchor-height",`${ke}px`)}}),C&&KV({element:C,padding:u}),rW({arrowWidth:O,arrowHeight:z}),b&&YV({strategy:"referenceHidden",...U})]}),[X,D]=_B(j),V=pn(S);wn(()=>{G&&(V==null||V())},[G,V]);const B=(re=P.arrow)==null?void 0:re.x,L=(le=P.arrow)==null?void 0:le.y,Y=((Ae=P.arrow)==null?void 0:Ae.centerOffset)!==0,[Q,se]=k.useState();return wn(()=>{R&&se(window.getComputedStyle(R).zIndex)},[R]),w.jsx("div",{ref:W.setFloating,"data-radix-popper-content-wrapper":"",style:{...Z,transform:G?Z.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:Q,"--radix-popper-transform-origin":[(ae=P.transformOrigin)==null?void 0:ae.x,(we=P.transformOrigin)==null?void 0:we.y].join(" "),...((xe=P.hide)==null?void 0:xe.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:w.jsx(JV,{scope:n,placedSide:X,onArrowChange:N,arrowX:B,arrowY:L,shouldHideArrow:Y,children:w.jsx(Xe.div,{"data-side":X,"data-align":D,...v,ref:_,style:{...v.style,animation:G?void 0:"none"}})})})});kB.displayName=Zk;var AB="PopperArrow",tW={top:"bottom",right:"left",bottom:"top",left:"right"},TB=k.forwardRef(function(t,n){const{__scopePopper:r,...a}=t,i=eW(AB,r),l=tW[i.placedSide];return w.jsx("span",{ref:i.onArrowChange,style:{position:"absolute",left:i.arrowX,top:i.arrowY,[l]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[i.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[i.placedSide],visibility:i.shouldHideArrow?"hidden":void 0},children:w.jsx(ZV,{...a,ref:n,style:{...a.style,display:"block"}})})});TB.displayName=AB;function nW(e){return e!==null}var rW=e=>({name:"transformOrigin",options:e,fn(t){var A,R,x;const{placement:n,rects:r,middlewareData:a}=t,l=((A=a.arrow)==null?void 0:A.centerOffset)!==0,u=l?0:e.arrowWidth,c=l?0:e.arrowHeight,[f,p]=_B(n),g={start:"0%",center:"50%",end:"100%"}[p],b=(((R=a.arrow)==null?void 0:R.x)??0)+u/2,m=(((x=a.arrow)==null?void 0:x.y)??0)+c/2;let S="",v="";return f==="bottom"?(S=l?g:`${b}px`,v=`${-c}px`):f==="top"?(S=l?g:`${b}px`,v=`${r.floating.height+c}px`):f==="right"?(S=`${-c}px`,v=l?g:`${m}px`):f==="left"&&(S=`${r.floating.width+c}px`,v=l?g:`${m}px`),{data:{x:S,y:v}}}});function _B(e){const[t,n="center"]=e.split("-");return[t,n]}var Qk=EB,vf=xB,Jk=kB,e0=TB,aW="VisuallyHidden",t0=k.forwardRef((e,t)=>w.jsx(Xe.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}}));t0.displayName=aW;var oW=t0,[Sf,Jye]=mr("Tooltip",[Cl]),Ef=Cl(),RB="TooltipProvider",iW=700,Rx="tooltip.open",[lW,n0]=Sf(RB),CB=e=>{const{__scopeTooltip:t,delayDuration:n=iW,skipDelayDuration:r=300,disableHoverableContent:a=!1,children:i}=e,[l,u]=k.useState(!0),c=k.useRef(!1),f=k.useRef(0);return k.useEffect(()=>{const p=f.current;return()=>window.clearTimeout(p)},[]),w.jsx(lW,{scope:t,isOpenDelayed:l,delayDuration:n,onOpen:k.useCallback(()=>{window.clearTimeout(f.current),u(!1)},[]),onClose:k.useCallback(()=>{window.clearTimeout(f.current),f.current=window.setTimeout(()=>u(!0),r)},[r]),isPointerInTransitRef:c,onPointerInTransitChange:k.useCallback(p=>{c.current=p},[]),disableHoverableContent:a,children:i})};CB.displayName=RB;var wf="Tooltip",[sW,xf]=Sf(wf),NB=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:a=!1,onOpenChange:i,disableHoverableContent:l,delayDuration:u}=e,c=n0(wf,e.__scopeTooltip),f=Ef(t),[p,g]=k.useState(null),b=En(),m=k.useRef(0),S=l??c.disableHoverableContent,v=u??c.delayDuration,A=k.useRef(!1),[R=!1,x]=Oa({prop:r,defaultProp:a,onChange:O=>{O?(c.onOpen(),document.dispatchEvent(new CustomEvent(Rx))):c.onClose(),i==null||i(O)}}),_=k.useMemo(()=>R?A.current?"delayed-open":"instant-open":"closed",[R]),C=k.useCallback(()=>{window.clearTimeout(m.current),m.current=0,A.current=!1,x(!0)},[x]),N=k.useCallback(()=>{window.clearTimeout(m.current),m.current=0,x(!1)},[x]),T=k.useCallback(()=>{window.clearTimeout(m.current),m.current=window.setTimeout(()=>{A.current=!0,x(!0),m.current=0},v)},[v,x]);return k.useEffect(()=>()=>{m.current&&(window.clearTimeout(m.current),m.current=0)},[]),w.jsx(Qk,{...f,children:w.jsx(sW,{scope:t,contentId:b,open:R,stateAttribute:_,trigger:p,onTriggerChange:g,onTriggerEnter:k.useCallback(()=>{c.isOpenDelayed?T():C()},[c.isOpenDelayed,T,C]),onTriggerLeave:k.useCallback(()=>{S?N():(window.clearTimeout(m.current),m.current=0)},[N,S]),onOpen:C,onClose:N,disableHoverableContent:S,children:n})})};NB.displayName=wf;var Cx="TooltipTrigger",OB=k.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,a=xf(Cx,n),i=n0(Cx,n),l=Ef(n),u=k.useRef(null),c=ft(t,u,a.onTriggerChange),f=k.useRef(!1),p=k.useRef(!1),g=k.useCallback(()=>f.current=!1,[]);return k.useEffect(()=>()=>document.removeEventListener("pointerup",g),[g]),w.jsx(vf,{asChild:!0,...l,children:w.jsx(Xe.button,{"aria-describedby":a.open?a.contentId:void 0,"data-state":a.stateAttribute,...r,ref:c,onPointerMove:We(e.onPointerMove,b=>{b.pointerType!=="touch"&&!p.current&&!i.isPointerInTransitRef.current&&(a.onTriggerEnter(),p.current=!0)}),onPointerLeave:We(e.onPointerLeave,()=>{a.onTriggerLeave(),p.current=!1}),onPointerDown:We(e.onPointerDown,()=>{f.current=!0,document.addEventListener("pointerup",g,{once:!0})}),onFocus:We(e.onFocus,()=>{f.current||a.onOpen()}),onBlur:We(e.onBlur,a.onClose),onClick:We(e.onClick,a.onClose)})})});OB.displayName=Cx;var uW="TooltipPortal",[eve,cW]=Sf(uW,{forceMount:void 0}),ml="TooltipContent",DB=k.forwardRef((e,t)=>{const n=cW(ml,e.__scopeTooltip),{forceMount:r=n.forceMount,side:a="top",...i}=e,l=xf(ml,e.__scopeTooltip);return w.jsx(Jn,{present:r||l.open,children:l.disableHoverableContent?w.jsx(IB,{side:a,...i,ref:t}):w.jsx(dW,{side:a,...i,ref:t})})}),dW=k.forwardRef((e,t)=>{const n=xf(ml,e.__scopeTooltip),r=n0(ml,e.__scopeTooltip),a=k.useRef(null),i=ft(t,a),[l,u]=k.useState(null),{trigger:c,onClose:f}=n,p=a.current,{onPointerInTransitChange:g}=r,b=k.useCallback(()=>{u(null),g(!1)},[g]),m=k.useCallback((S,v)=>{const A=S.currentTarget,R={x:S.clientX,y:S.clientY},x=hW(R,A.getBoundingClientRect()),_=mW(R,x),C=bW(v.getBoundingClientRect()),N=vW([..._,...C]);u(N),g(!0)},[g]);return k.useEffect(()=>()=>b(),[b]),k.useEffect(()=>{if(c&&p){const S=A=>m(A,p),v=A=>m(A,c);return c.addEventListener("pointerleave",S),p.addEventListener("pointerleave",v),()=>{c.removeEventListener("pointerleave",S),p.removeEventListener("pointerleave",v)}}},[c,p,m,b]),k.useEffect(()=>{if(l){const S=v=>{const A=v.target,R={x:v.clientX,y:v.clientY},x=(c==null?void 0:c.contains(A))||(p==null?void 0:p.contains(A)),_=!yW(R,l);x?b():_&&(b(),f())};return document.addEventListener("pointermove",S),()=>document.removeEventListener("pointermove",S)}},[c,p,l,f,b]),w.jsx(IB,{...e,ref:i})}),[fW,pW]=Sf(wf,{isInside:!1}),IB=k.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":a,onEscapeKeyDown:i,onPointerDownOutside:l,...u}=e,c=xf(ml,n),f=Ef(n),{onClose:p}=c;return k.useEffect(()=>(document.addEventListener(Rx,p),()=>document.removeEventListener(Rx,p)),[p]),k.useEffect(()=>{if(c.trigger){const g=b=>{const m=b.target;m!=null&&m.contains(c.trigger)&&p()};return window.addEventListener("scroll",g,{capture:!0}),()=>window.removeEventListener("scroll",g,{capture:!0})}},[c.trigger,p]),w.jsx(gu,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:i,onPointerDownOutside:l,onFocusOutside:g=>g.preventDefault(),onDismiss:p,children:w.jsxs(Jk,{"data-state":c.stateAttribute,...f,...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:[w.jsx(Ok,{children:r}),w.jsx(fW,{scope:n,isInside:!0,children:w.jsx(oW,{id:c.contentId,role:"tooltip",children:a||r})})]})})});DB.displayName=ml;var LB="TooltipArrow",gW=k.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,a=Ef(n);return pW(LB,n).isInside?null:w.jsx(e0,{...a,...r,ref:t})});gW.displayName=LB;function hW(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),a=Math.abs(t.right-e.x),i=Math.abs(t.left-e.x);switch(Math.min(n,r,a,i)){case i:return"left";case a:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function mW(e,t,n=5){const r=[];switch(t){case"top":r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}function bW(e){const{top:t,right:n,bottom:r,left:a}=e;return[{x:a,y:t},{x:n,y:t},{x:n,y:r},{x:a,y:r}]}function yW(e,t){const{x:n,y:r}=e;let a=!1;for(let i=0,l=t.length-1;ir!=p>r&&n<(f-u)*(r-c)/(p-c)+u&&(a=!a)}return a}function vW(e){const t=e.slice();return t.sort((n,r)=>n.xr.x?1:n.yr.y?1:0),SW(t)}function SW(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r=2;){const i=t[t.length-1],l=t[t.length-2];if((i.x-l.x)*(a.y-l.y)>=(i.y-l.y)*(a.x-l.x))t.pop();else break}t.push(a)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const a=e[r];for(;n.length>=2;){const i=n[n.length-1],l=n[n.length-2];if((i.x-l.x)*(a.y-l.y)>=(i.y-l.y)*(a.x-l.x))n.pop();else break}n.push(a)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var EW=CB,wW=NB,xW=OB,MB=DB;const FB=EW,zB=wW,PB=xW,kW=e=>typeof e!="string"?e:e.split("\\n").map((t,n)=>w.jsxs(k.Fragment,{children:[t,nw.jsx(MB,{ref:a,sideOffset:t,className:Me("bg-popover text-popover-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 mx-1 max-w-sm overflow-hidden rounded-md border px-3 py-2 text-sm shadow-md",e),...r,children:typeof n=="string"?kW(n):n}));r0.displayName=MB.displayName;const zd=Nz("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"}}),Lt=k.forwardRef(({className:e,variant:t,tooltip:n,size:r,side:a="right",asChild:i=!1,...l},u)=>{const c=i?bo:"button";return n?w.jsx(FB,{children:w.jsxs(zB,{children:[w.jsx(PB,{asChild:!0,children:w.jsx(c,{className:Me(zd({variant:t,size:r,className:e}),"cursor-pointer"),ref:u,...l})}),w.jsx(r0,{side:a,children:n})]})}):w.jsx(c,{className:Me(zd({variant:t,size:r,className:e}),"cursor-pointer"),ref:u,...l})});Lt.displayName="Button";const AW=Z7,TW=Q7,BB=k.forwardRef(({className:e,...t},n)=>w.jsx(tB,{className:Me("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/80",e),...t,ref:n}));BB.displayName=tB.displayName;const UB=k.forwardRef(({className:e,...t},n)=>w.jsxs(TW,{children:[w.jsx(BB,{}),w.jsx(nB,{ref:n,className:Me("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-top-[48%] fixed top-[50%] left-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border p-6 shadow-lg duration-200 sm:rounded-lg",e),...t})]}));UB.displayName=nB.displayName;const jB=({className:e,...t})=>w.jsx("div",{className:Me("flex flex-col space-y-2 text-center sm:text-left",e),...t});jB.displayName="AlertDialogHeader";const GB=k.forwardRef(({className:e,...t},n)=>w.jsx(oB,{ref:n,className:Me("text-lg font-semibold",e),...t}));GB.displayName=oB.displayName;const HB=k.forwardRef(({className:e,...t},n)=>w.jsx(iB,{ref:n,className:Me("text-muted-foreground text-sm",e),...t}));HB.displayName=iB.displayName;const _W=k.forwardRef(({className:e,...t},n)=>w.jsx(rB,{ref:n,className:Me(zd(),e),...t}));_W.displayName=rB.displayName;const RW=k.forwardRef(({className:e,...t},n)=>w.jsx(aB,{ref:n,className:Me(zd({variant:"outline"}),"mt-2 sm:mt-0",e),...t}));RW.displayName=aB.displayName;const Eo=k.forwardRef(({className:e,type:t,...n},r)=>w.jsx("input",{type:t,className:Me("border-input file:text-foreground placeholder:text-muted-foreground focus-visible:ring-ring flex h-9 rounded-md border bg-transparent px-3 py-1 text-base shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium focus-visible:ring-1 focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),ref:r,...n}));Eo.displayName="Input";var CW=e=>{switch(e){case"success":return DW;case"info":return LW;case"warning":return IW;case"error":return MW;default:return null}},NW=Array(12).fill(0),OW=({visible:e,className:t})=>ye.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},ye.createElement("div",{className:"sonner-spinner"},NW.map((n,r)=>ye.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),DW=ye.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},ye.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"})),IW=ye.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},ye.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"})),LW=ye.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},ye.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"})),MW=ye.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},ye.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"})),FW=ye.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"},ye.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),ye.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),zW=()=>{let[e,t]=ye.useState(document.hidden);return ye.useEffect(()=>{let n=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),e},Nx=1,PW=class{constructor(){this.subscribe=e=>(this.subscribers.push(e),()=>{let t=this.subscribers.indexOf(e);this.subscribers.splice(t,1)}),this.publish=e=>{this.subscribers.forEach(t=>t(e))},this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e]},this.create=e=>{var t;let{message:n,...r}=e,a=typeof(e==null?void 0:e.id)=="number"||((t=e.id)==null?void 0:t.length)>0?e.id:Nx++,i=this.toasts.find(u=>u.id===a),l=e.dismissible===void 0?!0:e.dismissible;return this.dismissedToasts.has(a)&&this.dismissedToasts.delete(a),i?this.toasts=this.toasts.map(u=>u.id===a?(this.publish({...u,...e,id:a,title:n}),{...u,...e,id:a,dismissible:l,title:n}):u):this.addToast({title:n,...r,dismissible:l,id:a}),a},this.dismiss=e=>(this.dismissedToasts.add(e),e||this.toasts.forEach(t=>{this.subscribers.forEach(n=>n({id:t.id,dismiss:!0}))}),this.subscribers.forEach(t=>t({id:e,dismiss:!0})),e),this.message=(e,t)=>this.create({...t,message:e}),this.error=(e,t)=>this.create({...t,message:e,type:"error"}),this.success=(e,t)=>this.create({...t,type:"success",message:e}),this.info=(e,t)=>this.create({...t,type:"info",message:e}),this.warning=(e,t)=>this.create({...t,type:"warning",message:e}),this.loading=(e,t)=>this.create({...t,type:"loading",message:e}),this.promise=(e,t)=>{if(!t)return;let n;t.loading!==void 0&&(n=this.create({...t,promise:e,type:"loading",message:t.loading,description:typeof t.description!="function"?t.description:void 0}));let r=e instanceof Promise?e:e(),a=n!==void 0,i,l=r.then(async c=>{if(i=["resolve",c],ye.isValidElement(c))a=!1,this.create({id:n,type:"default",message:c});else if(UW(c)&&!c.ok){a=!1;let f=typeof t.error=="function"?await t.error(`HTTP error! status: ${c.status}`):t.error,p=typeof t.description=="function"?await t.description(`HTTP error! status: ${c.status}`):t.description;this.create({id:n,type:"error",message:f,description:p})}else if(t.success!==void 0){a=!1;let f=typeof t.success=="function"?await t.success(c):t.success,p=typeof t.description=="function"?await t.description(c):t.description;this.create({id:n,type:"success",message:f,description:p})}}).catch(async c=>{if(i=["reject",c],t.error!==void 0){a=!1;let f=typeof t.error=="function"?await t.error(c):t.error,p=typeof t.description=="function"?await t.description(c):t.description;this.create({id:n,type:"error",message:f,description:p})}}).finally(()=>{var c;a&&(this.dismiss(n),n=void 0),(c=t.finally)==null||c.call(t)}),u=()=>new Promise((c,f)=>l.then(()=>i[0]==="reject"?f(i[1]):c(i[1])).catch(f));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)||Nx++;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}},Fn=new PW,BW=(e,t)=>{let n=(t==null?void 0:t.id)||Nx++;return Fn.addToast({title:e,...t,id:n}),n},UW=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",jW=BW,GW=()=>Fn.toasts,HW=()=>Fn.getActiveToasts(),vn=Object.assign(jW,{success:Fn.success,info:Fn.info,warning:Fn.warning,error:Fn.error,custom:Fn.custom,message:Fn.message,promise:Fn.promise,dismiss:Fn.dismiss,loading:Fn.loading},{getHistory:GW,getToasts:HW});function $W(e,{insertAt:t}={}){if(typeof document>"u")return;let n=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",t==="top"&&n.firstChild?n.insertBefore(r,n.firstChild):n.appendChild(r),r.styleSheet?r.styleSheet.cssText=e:r.appendChild(document.createTextNode(e))}$W(`: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 Hc(e){return e.label!==void 0}var qW=3,VW="32px",WW="16px",qR=4e3,YW=356,KW=14,XW=20,ZW=200;function Ar(...e){return e.filter(Boolean).join(" ")}function QW(e){let[t,n]=e.split("-"),r=[];return t&&r.push(t),n&&r.push(n),r}var JW=e=>{var t,n,r,a,i,l,u,c,f,p,g;let{invert:b,toast:m,unstyled:S,interacting:v,setHeights:A,visibleToasts:R,heights:x,index:_,toasts:C,expanded:N,removeToast:T,defaultRichColors:O,closeButton:z,style:I,cancelButtonStyle:M,actionButtonStyle:H,className:q="",descriptionClassName:U="",duration:W,position:Z,gap:j,loadingIcon:G,expandByDefault:P,classNames:X,icons:D,closeButtonAriaLabel:V="Close toast",pauseWhenPageIsHidden:B}=e,[L,Y]=ye.useState(null),[Q,se]=ye.useState(null),[re,le]=ye.useState(!1),[Ae,ae]=ye.useState(!1),[we,xe]=ye.useState(!1),[Ie,Ce]=ye.useState(!1),[Ee,J]=ye.useState(!1),[fe,ke]=ye.useState(0),[me,ve]=ye.useState(0),ie=ye.useRef(m.duration||W||qR),ze=ye.useRef(null),Pe=ye.useRef(null),he=_===0,Ne=_+1<=R,ee=m.type,ce=m.dismissible!==!1,Re=m.className||"",Fe=m.descriptionClassName||"",qe=ye.useMemo(()=>x.findIndex(Ye=>Ye.toastId===m.id)||0,[x,m.id]),mt=ye.useMemo(()=>{var Ye;return(Ye=m.closeButton)!=null?Ye:z},[m.closeButton,z]),St=ye.useMemo(()=>m.duration||W||qR,[m.duration,W]),pt=ye.useRef(0),Je=ye.useRef(0),wt=ye.useRef(0),rt=ye.useRef(null),[bt,Bt]=Z.split("-"),sn=ye.useMemo(()=>x.reduce((Ye,gt,_t)=>_t>=qe?Ye:Ye+gt.height,0),[x,qe]),Mt=zW(),er=m.invert||b,zr=ee==="loading";Je.current=ye.useMemo(()=>qe*j+sn,[qe,sn]),ye.useEffect(()=>{ie.current=St},[St]),ye.useEffect(()=>{le(!0)},[]),ye.useEffect(()=>{let Ye=Pe.current;if(Ye){let gt=Ye.getBoundingClientRect().height;return ve(gt),A(_t=>[{toastId:m.id,height:gt,position:m.position},..._t]),()=>A(_t=>_t.filter(Rn=>Rn.toastId!==m.id))}},[A,m.id]),ye.useLayoutEffect(()=>{if(!re)return;let Ye=Pe.current,gt=Ye.style.height;Ye.style.height="auto";let _t=Ye.getBoundingClientRect().height;Ye.style.height=gt,ve(_t),A(Rn=>Rn.find(kn=>kn.toastId===m.id)?Rn.map(kn=>kn.toastId===m.id?{...kn,height:_t}:kn):[{toastId:m.id,height:_t,position:m.position},...Rn])},[re,m.title,m.description,A,m.id]);let Kt=ye.useCallback(()=>{ae(!0),ke(Je.current),A(Ye=>Ye.filter(gt=>gt.toastId!==m.id)),setTimeout(()=>{T(m)},ZW)},[m,T,A,Je]);ye.useEffect(()=>{if(m.promise&&ee==="loading"||m.duration===1/0||m.type==="loading")return;let Ye;return N||v||B&&Mt?(()=>{if(wt.current{var gt;(gt=m.onAutoClose)==null||gt.call(m,m),Kt()},ie.current)),()=>clearTimeout(Ye)},[N,v,m,ee,B,Mt,Kt]),ye.useEffect(()=>{m.delete&&Kt()},[Kt,m.delete]);function na(){var Ye,gt,_t;return D!=null&&D.loading?ye.createElement("div",{className:Ar(X==null?void 0:X.loader,(Ye=m==null?void 0:m.classNames)==null?void 0:Ye.loader,"sonner-loader"),"data-visible":ee==="loading"},D.loading):G?ye.createElement("div",{className:Ar(X==null?void 0:X.loader,(gt=m==null?void 0:m.classNames)==null?void 0:gt.loader,"sonner-loader"),"data-visible":ee==="loading"},G):ye.createElement(OW,{className:Ar(X==null?void 0:X.loader,(_t=m==null?void 0:m.classNames)==null?void 0:_t.loader),visible:ee==="loading"})}return ye.createElement("li",{tabIndex:0,ref:Pe,className:Ar(q,Re,X==null?void 0:X.toast,(t=m==null?void 0:m.classNames)==null?void 0:t.toast,X==null?void 0:X.default,X==null?void 0:X[ee],(n=m==null?void 0:m.classNames)==null?void 0:n[ee]),"data-sonner-toast":"","data-rich-colors":(r=m.richColors)!=null?r:O,"data-styled":!(m.jsx||m.unstyled||S),"data-mounted":re,"data-promise":!!m.promise,"data-swiped":Ee,"data-removed":Ae,"data-visible":Ne,"data-y-position":bt,"data-x-position":Bt,"data-index":_,"data-front":he,"data-swiping":we,"data-dismissible":ce,"data-type":ee,"data-invert":er,"data-swipe-out":Ie,"data-swipe-direction":Q,"data-expanded":!!(N||P&&re),style:{"--index":_,"--toasts-before":_,"--z-index":C.length-_,"--offset":`${Ae?fe:Je.current}px`,"--initial-height":P?"auto":`${me}px`,...I,...m.style},onDragEnd:()=>{xe(!1),Y(null),rt.current=null},onPointerDown:Ye=>{zr||!ce||(ze.current=new Date,ke(Je.current),Ye.target.setPointerCapture(Ye.pointerId),Ye.target.tagName!=="BUTTON"&&(xe(!0),rt.current={x:Ye.clientX,y:Ye.clientY}))},onPointerUp:()=>{var Ye,gt,_t,Rn;if(Ie||!ce)return;rt.current=null;let kn=Number(((Ye=Pe.current)==null?void 0:Ye.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),Cn=Number(((gt=Pe.current)==null?void 0:gt.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),ra=new Date().getTime()-((_t=ze.current)==null?void 0:_t.getTime()),Nn=L==="x"?kn:Cn,Sr=Math.abs(Nn)/ra;if(Math.abs(Nn)>=XW||Sr>.11){ke(Je.current),(Rn=m.onDismiss)==null||Rn.call(m,m),se(L==="x"?kn>0?"right":"left":Cn>0?"down":"up"),Kt(),Ce(!0),J(!1);return}xe(!1),Y(null)},onPointerMove:Ye=>{var gt,_t,Rn,kn;if(!rt.current||!ce||((gt=window.getSelection())==null?void 0:gt.toString().length)>0)return;let Cn=Ye.clientY-rt.current.y,ra=Ye.clientX-rt.current.x,Nn=(_t=e.swipeDirections)!=null?_t:QW(Z);!L&&(Math.abs(ra)>1||Math.abs(Cn)>1)&&Y(Math.abs(ra)>Math.abs(Cn)?"x":"y");let Sr={x:0,y:0};L==="y"?(Nn.includes("top")||Nn.includes("bottom"))&&(Nn.includes("top")&&Cn<0||Nn.includes("bottom")&&Cn>0)&&(Sr.y=Cn):L==="x"&&(Nn.includes("left")||Nn.includes("right"))&&(Nn.includes("left")&&ra<0||Nn.includes("right")&&ra>0)&&(Sr.x=ra),(Math.abs(Sr.x)>0||Math.abs(Sr.y)>0)&&J(!0),(Rn=Pe.current)==null||Rn.style.setProperty("--swipe-amount-x",`${Sr.x}px`),(kn=Pe.current)==null||kn.style.setProperty("--swipe-amount-y",`${Sr.y}px`)}},mt&&!m.jsx?ye.createElement("button",{"aria-label":V,"data-disabled":zr,"data-close-button":!0,onClick:zr||!ce?()=>{}:()=>{var Ye;Kt(),(Ye=m.onDismiss)==null||Ye.call(m,m)},className:Ar(X==null?void 0:X.closeButton,(a=m==null?void 0:m.classNames)==null?void 0:a.closeButton)},(i=D==null?void 0:D.close)!=null?i:FW):null,m.jsx||k.isValidElement(m.title)?m.jsx?m.jsx:typeof m.title=="function"?m.title():m.title:ye.createElement(ye.Fragment,null,ee||m.icon||m.promise?ye.createElement("div",{"data-icon":"",className:Ar(X==null?void 0:X.icon,(l=m==null?void 0:m.classNames)==null?void 0:l.icon)},m.promise||m.type==="loading"&&!m.icon?m.icon||na():null,m.type!=="loading"?m.icon||(D==null?void 0:D[ee])||CW(ee):null):null,ye.createElement("div",{"data-content":"",className:Ar(X==null?void 0:X.content,(u=m==null?void 0:m.classNames)==null?void 0:u.content)},ye.createElement("div",{"data-title":"",className:Ar(X==null?void 0:X.title,(c=m==null?void 0:m.classNames)==null?void 0:c.title)},typeof m.title=="function"?m.title():m.title),m.description?ye.createElement("div",{"data-description":"",className:Ar(U,Fe,X==null?void 0:X.description,(f=m==null?void 0:m.classNames)==null?void 0:f.description)},typeof m.description=="function"?m.description():m.description):null),k.isValidElement(m.cancel)?m.cancel:m.cancel&&Hc(m.cancel)?ye.createElement("button",{"data-button":!0,"data-cancel":!0,style:m.cancelButtonStyle||M,onClick:Ye=>{var gt,_t;Hc(m.cancel)&&ce&&((_t=(gt=m.cancel).onClick)==null||_t.call(gt,Ye),Kt())},className:Ar(X==null?void 0:X.cancelButton,(p=m==null?void 0:m.classNames)==null?void 0:p.cancelButton)},m.cancel.label):null,k.isValidElement(m.action)?m.action:m.action&&Hc(m.action)?ye.createElement("button",{"data-button":!0,"data-action":!0,style:m.actionButtonStyle||H,onClick:Ye=>{var gt,_t;Hc(m.action)&&((_t=(gt=m.action).onClick)==null||_t.call(gt,Ye),!Ye.defaultPrevented&&Kt())},className:Ar(X==null?void 0:X.actionButton,(g=m==null?void 0:m.classNames)==null?void 0:g.actionButton)},m.action.label):null))};function VR(){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 eY(e,t){let n={};return[e,t].forEach((r,a)=>{let i=a===1,l=i?"--mobile-offset":"--offset",u=i?WW:VW;function c(f){["top","right","bottom","left"].forEach(p=>{n[`${l}-${p}`]=typeof f=="number"?`${f}px`:f})}typeof r=="number"||typeof r=="string"?c(r):typeof r=="object"?["top","right","bottom","left"].forEach(f=>{r[f]===void 0?n[`${l}-${f}`]=u:n[`${l}-${f}`]=typeof r[f]=="number"?`${r[f]}px`:r[f]}):c(u)}),n}var tY=k.forwardRef(function(e,t){let{invert:n,position:r="bottom-right",hotkey:a=["altKey","KeyT"],expand:i,closeButton:l,className:u,offset:c,mobileOffset:f,theme:p="light",richColors:g,duration:b,style:m,visibleToasts:S=qW,toastOptions:v,dir:A=VR(),gap:R=KW,loadingIcon:x,icons:_,containerAriaLabel:C="Notifications",pauseWhenPageIsHidden:N}=e,[T,O]=ye.useState([]),z=ye.useMemo(()=>Array.from(new Set([r].concat(T.filter(B=>B.position).map(B=>B.position)))),[T,r]),[I,M]=ye.useState([]),[H,q]=ye.useState(!1),[U,W]=ye.useState(!1),[Z,j]=ye.useState(p!=="system"?p:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),G=ye.useRef(null),P=a.join("+").replace(/Key/g,"").replace(/Digit/g,""),X=ye.useRef(null),D=ye.useRef(!1),V=ye.useCallback(B=>{O(L=>{var Y;return(Y=L.find(Q=>Q.id===B.id))!=null&&Y.delete||Fn.dismiss(B.id),L.filter(({id:Q})=>Q!==B.id)})},[]);return ye.useEffect(()=>Fn.subscribe(B=>{if(B.dismiss){O(L=>L.map(Y=>Y.id===B.id?{...Y,delete:!0}:Y));return}setTimeout(()=>{pP.flushSync(()=>{O(L=>{let Y=L.findIndex(Q=>Q.id===B.id);return Y!==-1?[...L.slice(0,Y),{...L[Y],...B},...L.slice(Y+1)]:[B,...L]})})})}),[]),ye.useEffect(()=>{if(p!=="system"){j(p);return}if(p==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?j("dark"):j("light")),typeof window>"u")return;let B=window.matchMedia("(prefers-color-scheme: dark)");try{B.addEventListener("change",({matches:L})=>{j(L?"dark":"light")})}catch{B.addListener(({matches:Y})=>{try{j(Y?"dark":"light")}catch(Q){console.error(Q)}})}},[p]),ye.useEffect(()=>{T.length<=1&&q(!1)},[T]),ye.useEffect(()=>{let B=L=>{var Y,Q;a.every(se=>L[se]||L.code===se)&&(q(!0),(Y=G.current)==null||Y.focus()),L.code==="Escape"&&(document.activeElement===G.current||(Q=G.current)!=null&&Q.contains(document.activeElement))&&q(!1)};return document.addEventListener("keydown",B),()=>document.removeEventListener("keydown",B)},[a]),ye.useEffect(()=>{if(G.current)return()=>{X.current&&(X.current.focus({preventScroll:!0}),X.current=null,D.current=!1)}},[G.current]),ye.createElement("section",{ref:t,"aria-label":`${C} ${P}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},z.map((B,L)=>{var Y;let[Q,se]=B.split("-");return T.length?ye.createElement("ol",{key:B,dir:A==="auto"?VR():A,tabIndex:-1,ref:G,className:u,"data-sonner-toaster":!0,"data-theme":Z,"data-y-position":Q,"data-lifted":H&&T.length>1&&!i,"data-x-position":se,style:{"--front-toast-height":`${((Y=I[0])==null?void 0:Y.height)||0}px`,"--width":`${YW}px`,"--gap":`${R}px`,...m,...eY(c,f)},onBlur:re=>{D.current&&!re.currentTarget.contains(re.relatedTarget)&&(D.current=!1,X.current&&(X.current.focus({preventScroll:!0}),X.current=null))},onFocus:re=>{re.target instanceof HTMLElement&&re.target.dataset.dismissible==="false"||D.current||(D.current=!0,X.current=re.relatedTarget)},onMouseEnter:()=>q(!0),onMouseMove:()=>q(!0),onMouseLeave:()=>{U||q(!1)},onDragEnd:()=>q(!1),onPointerDown:re=>{re.target instanceof HTMLElement&&re.target.dataset.dismissible==="false"||W(!0)},onPointerUp:()=>W(!1)},T.filter(re=>!re.position&&L===0||re.position===B).map((re,le)=>{var Ae,ae;return ye.createElement(JW,{key:re.id,icons:_,index:le,toast:re,defaultRichColors:g,duration:(Ae=v==null?void 0:v.duration)!=null?Ae:b,className:v==null?void 0:v.className,descriptionClassName:v==null?void 0:v.descriptionClassName,invert:n,visibleToasts:S,closeButton:(ae=v==null?void 0:v.closeButton)!=null?ae:l,interacting:U,position:B,style:v==null?void 0:v.style,unstyled:v==null?void 0:v.unstyled,classNames:v==null?void 0:v.classNames,cancelButtonStyle:v==null?void 0:v.cancelButtonStyle,actionButtonStyle:v==null?void 0:v.actionButtonStyle,removeToast:V,toasts:T.filter(we=>we.position==re.position),heights:I.filter(we=>we.position==re.position),setHeights:M,expandByDefault:i,gap:R,loadingIcon:x,expanded:H,pauseWhenPageIsHidden:N,swipeDirections:e.swipeDirections})})):null}))});const nY=()=>{const[e,t]=k.useState(!0),n=Ke.use.apiKey(),[r,a]=k.useState(""),i=Pn.use.message();k.useEffect(()=>{a(n||"")},[n,e]),k.useEffect(()=>{i&&(i.includes(oP)||i.includes(iP))&&t(!0)},[i,t]);const l=k.useCallback(async()=>{if(Ke.setState({apiKey:r||null}),await Pn.getState().check()){t(!1);return}vn.error("API Key is invalid")},[r]),u=k.useCallback(c=>{a(c.target.value)},[a]);return w.jsx(AW,{open:e,onOpenChange:t,children:w.jsxs(UB,{children:[w.jsxs(jB,{children:[w.jsx(GB,{children:"API Key is required"}),w.jsx(HB,{children:"Please enter your API key"})]}),w.jsxs("form",{className:"flex gap-2",onSubmit:c=>c.preventDefault(),children:[w.jsx(Eo,{type:"password",value:r,onChange:u,placeholder:"Enter your API key",className:"max-h-full w-full min-w-0",autoComplete:"off"}),w.jsx(Lt,{onClick:l,variant:"outline",size:"sm",children:"Save"})]})]})})};var a0="Popover",[$B,tve]=mr(a0,[Cl]),mu=Cl(),[rY,wo]=$B(a0),qB=e=>{const{__scopePopover:t,children:n,open:r,defaultOpen:a,onOpenChange:i,modal:l=!1}=e,u=mu(t),c=k.useRef(null),[f,p]=k.useState(!1),[g=!1,b]=Oa({prop:r,defaultProp:a,onChange:i});return w.jsx(Qk,{...u,children:w.jsx(rY,{scope:t,contentId:En(),triggerRef:c,open:g,onOpenChange:b,onOpenToggle:k.useCallback(()=>b(m=>!m),[b]),hasCustomAnchor:f,onCustomAnchorAdd:k.useCallback(()=>p(!0),[]),onCustomAnchorRemove:k.useCallback(()=>p(!1),[]),modal:l,children:n})})};qB.displayName=a0;var VB="PopoverAnchor",aY=k.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,a=wo(VB,n),i=mu(n),{onCustomAnchorAdd:l,onCustomAnchorRemove:u}=a;return k.useEffect(()=>(l(),()=>u()),[l,u]),w.jsx(vf,{...i,...r,ref:t})});aY.displayName=VB;var WB="PopoverTrigger",YB=k.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,a=wo(WB,n),i=mu(n),l=ft(t,a.triggerRef),u=w.jsx(Xe.button,{type:"button","aria-haspopup":"dialog","aria-expanded":a.open,"aria-controls":a.contentId,"data-state":JB(a.open),...r,ref:l,onClick:We(e.onClick,a.onOpenToggle)});return a.hasCustomAnchor?u:w.jsx(vf,{asChild:!0,...i,children:u})});YB.displayName=WB;var o0="PopoverPortal",[oY,iY]=$B(o0,{forceMount:void 0}),KB=e=>{const{__scopePopover:t,forceMount:n,children:r,container:a}=e,i=wo(o0,t);return w.jsx(oY,{scope:t,forceMount:n,children:w.jsx(Jn,{present:n||i.open,children:w.jsx(df,{asChild:!0,container:a,children:r})})})};KB.displayName=o0;var bl="PopoverContent",XB=k.forwardRef((e,t)=>{const n=iY(bl,e.__scopePopover),{forceMount:r=n.forceMount,...a}=e,i=wo(bl,e.__scopePopover);return w.jsx(Jn,{present:r||i.open,children:i.modal?w.jsx(lY,{...a,ref:t}):w.jsx(sY,{...a,ref:t})})});XB.displayName=bl;var lY=k.forwardRef((e,t)=>{const n=wo(bl,e.__scopePopover),r=k.useRef(null),a=ft(t,r),i=k.useRef(!1);return k.useEffect(()=>{const l=r.current;if(l)return Ik(l)},[]),w.jsx(pf,{as:bo,allowPinchZoom:!0,children:w.jsx(ZB,{...e,ref:a,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:We(e.onCloseAutoFocus,l=>{var u;l.preventDefault(),i.current||(u=n.triggerRef.current)==null||u.focus()}),onPointerDownOutside:We(e.onPointerDownOutside,l=>{const u=l.detail.originalEvent,c=u.button===0&&u.ctrlKey===!0,f=u.button===2||c;i.current=f},{checkForDefaultPrevented:!1}),onFocusOutside:We(e.onFocusOutside,l=>l.preventDefault(),{checkForDefaultPrevented:!1})})})}),sY=k.forwardRef((e,t)=>{const n=wo(bl,e.__scopePopover),r=k.useRef(!1),a=k.useRef(!1);return w.jsx(ZB,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var l,u;(l=e.onCloseAutoFocus)==null||l.call(e,i),i.defaultPrevented||(r.current||(u=n.triggerRef.current)==null||u.focus(),i.preventDefault()),r.current=!1,a.current=!1},onInteractOutside:i=>{var c,f;(c=e.onInteractOutside)==null||c.call(e,i),i.defaultPrevented||(r.current=!0,i.detail.originalEvent.type==="pointerdown"&&(a.current=!0));const l=i.target;((f=n.triggerRef.current)==null?void 0:f.contains(l))&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&a.current&&i.preventDefault()}})}),ZB=k.forwardRef((e,t)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:a,onCloseAutoFocus:i,disableOutsidePointerEvents:l,onEscapeKeyDown:u,onPointerDownOutside:c,onFocusOutside:f,onInteractOutside:p,...g}=e,b=wo(bl,n),m=mu(n);return Dk(),w.jsx(cf,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:a,onUnmountAutoFocus:i,children:w.jsx(gu,{asChild:!0,disableOutsidePointerEvents:l,onInteractOutside:p,onEscapeKeyDown:u,onPointerDownOutside:c,onFocusOutside:f,onDismiss:()=>b.onOpenChange(!1),children:w.jsx(Jk,{"data-state":JB(b.open),role:"dialog",id:b.contentId,...m,...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)"}})})})}),QB="PopoverClose",uY=k.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,a=wo(QB,n);return w.jsx(Xe.button,{type:"button",...r,ref:t,onClick:We(e.onClick,()=>a.onOpenChange(!1))})});uY.displayName=QB;var cY="PopoverArrow",dY=k.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,a=mu(n);return w.jsx(e0,{...a,...r,ref:t})});dY.displayName=cY;function JB(e){return e?"open":"closed"}var fY=qB,pY=YB,gY=KB,eU=XB;const kf=fY,Af=pY,bu=k.forwardRef(({className:e,align:t="center",sideOffset:n=4,...r},a)=>w.jsx(gY,{children:w.jsx(eU,{ref:a,align:t,sideOffset:n,className:Me("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 rounded-md border p-4 shadow-md outline-none",e),...r})}));bu.displayName=eU.displayName;const hY=({status:e})=>e?w.jsxs("div",{className:"min-w-[300px] space-y-3 text-sm",children:[w.jsxs("div",{className:"space-y-1",children:[w.jsx("h4",{className:"font-medium",children:"Storage Info"}),w.jsxs("div",{className:"text-muted-foreground grid grid-cols-2 gap-1",children:[w.jsx("span",{children:"Working Directory:"}),w.jsx("span",{className:"truncate",children:e.working_directory}),w.jsx("span",{children:"Input Directory:"}),w.jsx("span",{className:"truncate",children:e.input_directory})]})]}),w.jsxs("div",{className:"space-y-1",children:[w.jsx("h4",{className:"font-medium",children:"LLM Configuration"}),w.jsxs("div",{className:"text-muted-foreground grid grid-cols-2 gap-1",children:[w.jsx("span",{children:"LLM Binding:"}),w.jsx("span",{children:e.configuration.llm_binding}),w.jsx("span",{children:"LLM Binding Host:"}),w.jsx("span",{children:e.configuration.llm_binding_host}),w.jsx("span",{children:"LLM Model:"}),w.jsx("span",{children:e.configuration.llm_model}),w.jsx("span",{children:"Max Tokens:"}),w.jsx("span",{children:e.configuration.max_tokens})]})]}),w.jsxs("div",{className:"space-y-1",children:[w.jsx("h4",{className:"font-medium",children:"Embedding Configuration"}),w.jsxs("div",{className:"text-muted-foreground grid grid-cols-2 gap-1",children:[w.jsx("span",{children:"Embedding Binding:"}),w.jsx("span",{children:e.configuration.embedding_binding}),w.jsx("span",{children:"Embedding Binding Host:"}),w.jsx("span",{children:e.configuration.embedding_binding_host}),w.jsx("span",{children:"Embedding Model:"}),w.jsx("span",{children:e.configuration.embedding_model})]})]}),w.jsxs("div",{className:"space-y-1",children:[w.jsx("h4",{className:"font-medium",children:"Storage Configuration"}),w.jsxs("div",{className:"text-muted-foreground grid grid-cols-2 gap-1",children:[w.jsx("span",{children:"KV Storage:"}),w.jsx("span",{children:e.configuration.kv_storage}),w.jsx("span",{children:"Doc Status Storage:"}),w.jsx("span",{children:e.configuration.doc_status_storage}),w.jsx("span",{children:"Graph Storage:"}),w.jsx("span",{children:e.configuration.graph_storage}),w.jsx("span",{children:"Vector Storage:"}),w.jsx("span",{children:e.configuration.vector_storage})]})]})]}):w.jsx("div",{className:"text-muted-foreground text-sm",children:"Status information unavailable"}),mY=()=>{const e=Pn.use.health(),t=Pn.use.lastCheckTime(),n=Pn.use.status(),[r,a]=k.useState(!1);return k.useEffect(()=>{a(!0);const i=setTimeout(()=>a(!1),300);return()=>clearTimeout(i)},[t]),w.jsx("div",{className:"fixed right-4 bottom-4 flex items-center gap-2 opacity-80 select-none",children:w.jsxs(kf,{children:[w.jsx(Af,{asChild:!0,children:w.jsxs("div",{className:"flex cursor-help items-center gap-2",children:[w.jsx("div",{className:Me("h-3 w-3 rounded-full transition-all duration-300","shadow-[0_0_8px_rgba(0,0,0,0.2)]",e?"bg-green-500":"bg-red-500",r&&"scale-125",r&&e&&"shadow-[0_0_12px_rgba(34,197,94,0.4)]",r&&!e&&"shadow-[0_0_12px_rgba(239,68,68,0.4)]")}),w.jsx("span",{className:"text-muted-foreground text-xs",children:e?"Connected":"Disconnected"})]})}),w.jsx(bu,{className:"w-auto",side:"top",align:"end",children:w.jsx(hY,{status:n})})]})})},i0=()=>{const e=k.useContext(Cz);if(e===void 0)throw new Error("useTheme must be used within a ThemeProvider");return e};function bY(){const{theme:e,setTheme:t}=i0(),n=k.useCallback(()=>t("light"),[t]),r=k.useCallback(()=>t("dark"),[t]);return e==="dark"?w.jsx(Lt,{onClick:n,variant:Yr,tooltip:"Switch to light theme",size:"icon",side:"bottom",children:w.jsx(Kq,{})}):w.jsx(Lt,{onClick:r,variant:Yr,tooltip:"Switch to dark theme",size:"icon",side:"bottom",children:w.jsx(u8,{})})}function tU(e){const t=e+"CollectionProvider",[n,r]=mr(t),[a,i]=n(t,{collectionRef:{current:null},itemMap:new Map}),l=m=>{const{scope:S,children:v}=m,A=ye.useRef(null),R=ye.useRef(new Map).current;return w.jsx(a,{scope:S,itemMap:R,collectionRef:A,children:v})};l.displayName=t;const u=e+"CollectionSlot",c=ye.forwardRef((m,S)=>{const{scope:v,children:A}=m,R=i(u,v),x=ft(S,R.collectionRef);return w.jsx(bo,{ref:x,children:A})});c.displayName=u;const f=e+"CollectionItemSlot",p="data-radix-collection-item",g=ye.forwardRef((m,S)=>{const{scope:v,children:A,...R}=m,x=ye.useRef(null),_=ft(S,x),C=i(f,v);return ye.useEffect(()=>(C.itemMap.set(x,{ref:x,...R}),()=>void C.itemMap.delete(x))),w.jsx(bo,{[p]:"",ref:_,children:A})});g.displayName=f;function b(m){const S=i(e+"CollectionConsumer",m);return ye.useCallback(()=>{const A=S.collectionRef.current;if(!A)return[];const R=Array.from(A.querySelectorAll(`[${p}]`));return Array.from(S.itemMap.values()).sort((C,N)=>R.indexOf(C.ref.current)-R.indexOf(N.ref.current))},[S.collectionRef,S.itemMap])}return[{Provider:l,Slot:c,ItemSlot:g},b,r]}var yY=k.createContext(void 0);function Tf(e){const t=k.useContext(yY);return e||t||"ltr"}var wh="rovingFocusGroup.onEntryFocus",vY={bubbles:!1,cancelable:!0},_f="RovingFocusGroup",[Ox,nU,SY]=tU(_f),[EY,rU]=mr(_f,[SY]),[wY,xY]=EY(_f),aU=k.forwardRef((e,t)=>w.jsx(Ox.Provider,{scope:e.__scopeRovingFocusGroup,children:w.jsx(Ox.Slot,{scope:e.__scopeRovingFocusGroup,children:w.jsx(kY,{...e,ref:t})})}));aU.displayName=_f;var kY=k.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:a=!1,dir:i,currentTabStopId:l,defaultCurrentTabStopId:u,onCurrentTabStopIdChange:c,onEntryFocus:f,preventScrollOnEntryFocus:p=!1,...g}=e,b=k.useRef(null),m=ft(t,b),S=Tf(i),[v=null,A]=Oa({prop:l,defaultProp:u,onChange:c}),[R,x]=k.useState(!1),_=pn(f),C=nU(n),N=k.useRef(!1),[T,O]=k.useState(0);return k.useEffect(()=>{const z=b.current;if(z)return z.addEventListener(wh,_),()=>z.removeEventListener(wh,_)},[_]),w.jsx(wY,{scope:n,orientation:r,dir:S,loop:a,currentTabStopId:v,onItemFocus:k.useCallback(z=>A(z),[A]),onItemShiftTab:k.useCallback(()=>x(!0),[]),onFocusableItemAdd:k.useCallback(()=>O(z=>z+1),[]),onFocusableItemRemove:k.useCallback(()=>O(z=>z-1),[]),children:w.jsx(Xe.div,{tabIndex:R||T===0?-1:0,"data-orientation":r,...g,ref:m,style:{outline:"none",...e.style},onMouseDown:We(e.onMouseDown,()=>{N.current=!0}),onFocus:We(e.onFocus,z=>{const I=!N.current;if(z.target===z.currentTarget&&I&&!R){const M=new CustomEvent(wh,vY);if(z.currentTarget.dispatchEvent(M),!M.defaultPrevented){const H=C().filter(j=>j.focusable),q=H.find(j=>j.active),U=H.find(j=>j.id===v),Z=[q,U,...H].filter(Boolean).map(j=>j.ref.current);lU(Z,p)}}N.current=!1}),onBlur:We(e.onBlur,()=>x(!1))})})}),oU="RovingFocusGroupItem",iU=k.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:a=!1,tabStopId:i,...l}=e,u=En(),c=i||u,f=xY(oU,n),p=f.currentTabStopId===c,g=nU(n),{onFocusableItemAdd:b,onFocusableItemRemove:m}=f;return k.useEffect(()=>{if(r)return b(),()=>m()},[r,b,m]),w.jsx(Ox.ItemSlot,{scope:n,id:c,focusable:r,active:a,children:w.jsx(Xe.span,{tabIndex:p?0:-1,"data-orientation":f.orientation,...l,ref:t,onMouseDown:We(e.onMouseDown,S=>{r?f.onItemFocus(c):S.preventDefault()}),onFocus:We(e.onFocus,()=>f.onItemFocus(c)),onKeyDown:We(e.onKeyDown,S=>{if(S.key==="Tab"&&S.shiftKey){f.onItemShiftTab();return}if(S.target!==S.currentTarget)return;const v=_Y(S,f.orientation,f.dir);if(v!==void 0){if(S.metaKey||S.ctrlKey||S.altKey||S.shiftKey)return;S.preventDefault();let R=g().filter(x=>x.focusable).map(x=>x.ref.current);if(v==="last")R.reverse();else if(v==="prev"||v==="next"){v==="prev"&&R.reverse();const x=R.indexOf(S.currentTarget);R=f.loop?RY(R,x+1):R.slice(x+1)}setTimeout(()=>lU(R))}})})})});iU.displayName=oU;var AY={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function TY(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function _Y(e,t,n){const r=TY(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return AY[r]}function lU(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function RY(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var CY=aU,NY=iU,l0="Tabs",[OY,nve]=mr(l0,[rU]),sU=rU(),[DY,s0]=OY(l0),uU=k.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:a,defaultValue:i,orientation:l="horizontal",dir:u,activationMode:c="automatic",...f}=e,p=Tf(u),[g,b]=Oa({prop:r,onChange:a,defaultProp:i});return w.jsx(DY,{scope:n,baseId:En(),value:g,onValueChange:b,orientation:l,dir:p,activationMode:c,children:w.jsx(Xe.div,{dir:p,"data-orientation":l,...f,ref:t})})});uU.displayName=l0;var cU="TabsList",dU=k.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...a}=e,i=s0(cU,n),l=sU(n);return w.jsx(CY,{asChild:!0,...l,orientation:i.orientation,dir:i.dir,loop:r,children:w.jsx(Xe.div,{role:"tablist","aria-orientation":i.orientation,...a,ref:t})})});dU.displayName=cU;var fU="TabsTrigger",pU=k.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:a=!1,...i}=e,l=s0(fU,n),u=sU(n),c=mU(l.baseId,r),f=bU(l.baseId,r),p=r===l.value;return w.jsx(NY,{asChild:!0,...u,focusable:!a,active:p,children:w.jsx(Xe.button,{type:"button",role:"tab","aria-selected":p,"aria-controls":f,"data-state":p?"active":"inactive","data-disabled":a?"":void 0,disabled:a,id:c,...i,ref:t,onMouseDown:We(e.onMouseDown,g=>{!a&&g.button===0&&g.ctrlKey===!1?l.onValueChange(r):g.preventDefault()}),onKeyDown:We(e.onKeyDown,g=>{[" ","Enter"].includes(g.key)&&l.onValueChange(r)}),onFocus:We(e.onFocus,()=>{const g=l.activationMode!=="manual";!p&&!a&&g&&l.onValueChange(r)})})})});pU.displayName=fU;var gU="TabsContent",hU=k.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:a,children:i,...l}=e,u=s0(gU,n),c=mU(u.baseId,r),f=bU(u.baseId,r),p=r===u.value,g=k.useRef(p);return k.useEffect(()=>{const b=requestAnimationFrame(()=>g.current=!1);return()=>cancelAnimationFrame(b)},[]),w.jsx(Jn,{present:a||p,children:({present:b})=>w.jsx(Xe.div,{"data-state":p?"active":"inactive","data-orientation":u.orientation,role:"tabpanel","aria-labelledby":c,hidden:!b,id:f,tabIndex:0,...l,ref:t,style:{...e.style,animationDuration:g.current?"0s":void 0},children:b&&i})})});hU.displayName=gU;function mU(e,t){return`${e}-trigger-${t}`}function bU(e,t){return`${e}-content-${t}`}var IY=uU,yU=dU,vU=pU,SU=hU;const LY=IY,EU=k.forwardRef(({className:e,...t},n)=>w.jsx(yU,{ref:n,className:Me("bg-muted text-muted-foreground inline-flex h-10 items-center justify-center rounded-md p-1",e),...t}));EU.displayName=yU.displayName;const wU=k.forwardRef(({className:e,...t},n)=>w.jsx(vU,{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}));wU.displayName=vU.displayName;const qs=k.forwardRef(({className:e,...t},n)=>w.jsx(SU,{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}));qs.displayName=SU.displayName;function $c({value:e,currentTab:t,children:n}){return w.jsx(wU,{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 MY(){const e=Ke.use.currentTab();return w.jsx("div",{className:"flex h-8 self-center",children:w.jsxs(EU,{className:"h-full gap-2",children:[w.jsx($c,{value:"documents",currentTab:e,children:"Documents"}),w.jsx($c,{value:"knowledge-graph",currentTab:e,children:"Knowledge Graph"}),w.jsx($c,{value:"retrieval",currentTab:e,children:"Retrieval"}),w.jsx($c,{value:"api",currentTab:e,children:"API"})]})})}function FY(){return w.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:[w.jsxs("a",{href:"/",className:"mr-6 flex items-center gap-2",children:[w.jsx(p8,{className:"size-4 text-emerald-400","aria-hidden":"true"}),w.jsx("span",{className:"font-bold md:inline-block",children:lR.name})]}),w.jsx("div",{className:"flex h-10 flex-1 justify-center",children:w.jsx(MY,{})}),w.jsxs("nav",{className:"flex items-center",children:[w.jsx(Lt,{variant:"ghost",size:"icon",side:"bottom",tooltip:"Project Repository",children:w.jsx("a",{href:lR.github,target:"_blank",rel:"noopener noreferrer",children:w.jsx(Pq,{className:"size-4","aria-hidden":"true"})})}),w.jsx(bY,{})]})]})}var qc={exports:{}},WR;function zY(){if(WR)return qc.exports;WR=1;var e=typeof Reflect=="object"?Reflect:null,t=e&&typeof e.apply=="function"?e.apply:function(N,T,O){return Function.prototype.apply.call(N,T,O)},n;e&&typeof e.ownKeys=="function"?n=e.ownKeys:Object.getOwnPropertySymbols?n=function(N){return Object.getOwnPropertyNames(N).concat(Object.getOwnPropertySymbols(N))}:n=function(N){return Object.getOwnPropertyNames(N)};function r(C){console&&console.warn&&console.warn(C)}var a=Number.isNaN||function(N){return N!==N};function i(){i.init.call(this)}qc.exports=i,qc.exports.once=R,i.EventEmitter=i,i.prototype._events=void 0,i.prototype._eventsCount=0,i.prototype._maxListeners=void 0;var l=10;function u(C){if(typeof C!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof C)}Object.defineProperty(i,"defaultMaxListeners",{enumerable:!0,get:function(){return l},set:function(C){if(typeof C!="number"||C<0||a(C))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+C+".");l=C}}),i.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},i.prototype.setMaxListeners=function(N){if(typeof N!="number"||N<0||a(N))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+N+".");return this._maxListeners=N,this};function c(C){return C._maxListeners===void 0?i.defaultMaxListeners:C._maxListeners}i.prototype.getMaxListeners=function(){return c(this)},i.prototype.emit=function(N){for(var T=[],O=1;O0&&(M=T[0]),M instanceof Error)throw M;var H=new Error("Unhandled error."+(M?" ("+M.message+")":""));throw H.context=M,H}var q=I[N];if(q===void 0)return!1;if(typeof q=="function")t(q,this,T);else for(var U=q.length,W=S(q,U),O=0;O0&&M.length>z&&!M.warned){M.warned=!0;var H=new Error("Possible EventEmitter memory leak detected. "+M.length+" "+String(N)+" listeners added. Use emitter.setMaxListeners() to increase limit");H.name="MaxListenersExceededWarning",H.emitter=C,H.type=N,H.count=M.length,r(H)}return C}i.prototype.addListener=function(N,T){return f(this,N,T,!1)},i.prototype.on=i.prototype.addListener,i.prototype.prependListener=function(N,T){return f(this,N,T,!0)};function p(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function g(C,N,T){var O={fired:!1,wrapFn:void 0,target:C,type:N,listener:T},z=p.bind(O);return z.listener=T,O.wrapFn=z,z}i.prototype.once=function(N,T){return u(T),this.on(N,g(this,N,T)),this},i.prototype.prependOnceListener=function(N,T){return u(T),this.prependListener(N,g(this,N,T)),this},i.prototype.removeListener=function(N,T){var O,z,I,M,H;if(u(T),z=this._events,z===void 0)return this;if(O=z[N],O===void 0)return this;if(O===T||O.listener===T)--this._eventsCount===0?this._events=Object.create(null):(delete z[N],z.removeListener&&this.emit("removeListener",N,O.listener||T));else if(typeof O!="function"){for(I=-1,M=O.length-1;M>=0;M--)if(O[M]===T||O[M].listener===T){H=O[M].listener,I=M;break}if(I<0)return this;I===0?O.shift():v(O,I),O.length===1&&(z[N]=O[0]),z.removeListener!==void 0&&this.emit("removeListener",N,H||T)}return this},i.prototype.off=i.prototype.removeListener,i.prototype.removeAllListeners=function(N){var T,O,z;if(O=this._events,O===void 0)return this;if(O.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):O[N]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete O[N]),this;if(arguments.length===0){var I=Object.keys(O),M;for(z=0;z=0;z--)this.removeListener(N,T[z]);return this};function b(C,N,T){var O=C._events;if(O===void 0)return[];var z=O[N];return z===void 0?[]:typeof z=="function"?T?[z.listener||z]:[z]:T?A(z):S(z,z.length)}i.prototype.listeners=function(N){return b(this,N,!0)},i.prototype.rawListeners=function(N){return b(this,N,!1)},i.listenerCount=function(C,N){return typeof C.listenerCount=="function"?C.listenerCount(N):m.call(C,N)},i.prototype.listenerCount=m;function m(C){var N=this._events;if(N!==void 0){var T=N[C];if(typeof T=="function")return 1;if(T!==void 0)return T.length}return 0}i.prototype.eventNames=function(){return this._eventsCount>0?n(this._events):[]};function S(C,N){for(var T=new Array(N),O=0;Oe++}function Na(){const e=arguments;let t=null,n=-1;return{[Symbol.iterator](){return this},next(){let r=null;do{if(t===null){if(n++,n>=e.length)return{done:!0};t=e[n][Symbol.iterator]()}if(r=t.next(),r.done){t=null;continue}break}while(!0);return r}}}function Nl(){return{[Symbol.iterator](){return this},next(){return{done:!0}}}}class u0 extends Error{constructor(t){super(),this.name="GraphError",this.message=t}}class Le extends u0{constructor(t){super(t),this.name="InvalidArgumentsGraphError",typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,Le.prototype.constructor)}}class De extends u0{constructor(t){super(t),this.name="NotFoundGraphError",typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,De.prototype.constructor)}}class Ze extends u0{constructor(t){super(t),this.name="UsageGraphError",typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,Ze.prototype.constructor)}}function AU(e,t){this.key=e,this.attributes=t,this.clear()}AU.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 TU(e,t){this.key=e,this.attributes=t,this.clear()}TU.prototype.clear=function(){this.inDegree=0,this.outDegree=0,this.directedLoops=0,this.in={},this.out={}};function _U(e,t){this.key=e,this.attributes=t,this.clear()}_U.prototype.clear=function(){this.undirectedDegree=0,this.undirectedLoops=0,this.undirected={}};function Ol(e,t,n,r,a){this.key=t,this.attributes=a,this.undirected=e,this.source=n,this.target=r}Ol.prototype.attach=function(){let e="out",t="in";this.undirected&&(e=t="undirected");const n=this.source.key,r=this.target.key;this.source[e][r]=this,!(this.undirected&&n===r)&&(this.target[t][n]=this)};Ol.prototype.attachMulti=function(){let e="out",t="in";const n=this.source.key,r=this.target.key;this.undirected&&(e=t="undirected");const a=this.source[e],i=a[r];if(typeof i>"u"){a[r]=this,this.undirected&&n===r||(this.target[t][n]=this);return}i.previous=this,this.next=i,a[r]=this,this.target[t][n]=this};Ol.prototype.detach=function(){const e=this.source.key,t=this.target.key;let n="out",r="in";this.undirected&&(n=r="undirected"),delete this.source[n][t],delete this.target[r][e]};Ol.prototype.detachMulti=function(){const e=this.source.key,t=this.target.key;let n="out",r="in";this.undirected&&(n=r="undirected"),this.previous===void 0?this.next===void 0?(delete this.source[n][t],delete this.target[r][e]):(this.next.previous=void 0,this.source[n][t]=this.next,this.target[r][e]=this.next):(this.previous.next=this.next,this.next!==void 0&&(this.next.previous=this.previous))};const RU=0,CU=1,UY=2,NU=3;function Ma(e,t,n,r,a,i,l){let u,c,f,p;if(r=""+r,n===RU){if(u=e._nodes.get(r),!u)throw new De(`Graph.${t}: could not find the "${r}" node in the graph.`);f=a,p=i}else if(n===NU){if(a=""+a,c=e._edges.get(a),!c)throw new De(`Graph.${t}: could not find the "${a}" edge in the graph.`);const g=c.source.key,b=c.target.key;if(r===g)u=c.target;else if(r===b)u=c.source;else throw new De(`Graph.${t}: the "${r}" node is not attached to the "${a}" edge (${g}, ${b}).`);f=i,p=l}else{if(c=e._edges.get(r),!c)throw new De(`Graph.${t}: could not find the "${r}" edge in the graph.`);n===CU?u=c.source:u=c.target,f=a,p=i}return[u,f,p]}function jY(e,t,n){e.prototype[t]=function(r,a,i){const[l,u]=Ma(this,t,n,r,a,i);return l.attributes[u]}}function GY(e,t,n){e.prototype[t]=function(r,a){const[i]=Ma(this,t,n,r,a);return i.attributes}}function HY(e,t,n){e.prototype[t]=function(r,a,i){const[l,u]=Ma(this,t,n,r,a,i);return l.attributes.hasOwnProperty(u)}}function $Y(e,t,n){e.prototype[t]=function(r,a,i,l){const[u,c,f]=Ma(this,t,n,r,a,i,l);return u.attributes[c]=f,this.emit("nodeAttributesUpdated",{key:u.key,type:"set",attributes:u.attributes,name:c}),this}}function qY(e,t,n){e.prototype[t]=function(r,a,i,l){const[u,c,f]=Ma(this,t,n,r,a,i,l);if(typeof f!="function")throw new Le(`Graph.${t}: updater should be a function.`);const p=u.attributes,g=f(p[c]);return p[c]=g,this.emit("nodeAttributesUpdated",{key:u.key,type:"set",attributes:u.attributes,name:c}),this}}function VY(e,t,n){e.prototype[t]=function(r,a,i){const[l,u]=Ma(this,t,n,r,a,i);return delete l.attributes[u],this.emit("nodeAttributesUpdated",{key:l.key,type:"remove",attributes:l.attributes,name:u}),this}}function WY(e,t,n){e.prototype[t]=function(r,a,i){const[l,u]=Ma(this,t,n,r,a,i);if(!gn(u))throw new Le(`Graph.${t}: provided attributes are not a plain object.`);return l.attributes=u,this.emit("nodeAttributesUpdated",{key:l.key,type:"replace",attributes:l.attributes}),this}}function YY(e,t,n){e.prototype[t]=function(r,a,i){const[l,u]=Ma(this,t,n,r,a,i);if(!gn(u))throw new Le(`Graph.${t}: provided attributes are not a plain object.`);return Qt(l.attributes,u),this.emit("nodeAttributesUpdated",{key:l.key,type:"merge",attributes:l.attributes,data:u}),this}}function KY(e,t,n){e.prototype[t]=function(r,a,i){const[l,u]=Ma(this,t,n,r,a,i);if(typeof u!="function")throw new Le(`Graph.${t}: provided updater is not a function.`);return l.attributes=u(l.attributes),this.emit("nodeAttributesUpdated",{key:l.key,type:"update",attributes:l.attributes}),this}}const XY=[{name:e=>`get${e}Attribute`,attacher:jY},{name:e=>`get${e}Attributes`,attacher:GY},{name:e=>`has${e}Attribute`,attacher:HY},{name:e=>`set${e}Attribute`,attacher:$Y},{name:e=>`update${e}Attribute`,attacher:qY},{name:e=>`remove${e}Attribute`,attacher:VY},{name:e=>`replace${e}Attributes`,attacher:WY},{name:e=>`merge${e}Attributes`,attacher:YY},{name:e=>`update${e}Attributes`,attacher:KY}];function ZY(e){XY.forEach(function({name:t,attacher:n}){n(e,t("Node"),RU),n(e,t("Source"),CU),n(e,t("Target"),UY),n(e,t("Opposite"),NU)})}function QY(e,t,n){e.prototype[t]=function(r,a){let i;if(this.type!=="mixed"&&n!=="mixed"&&n!==this.type)throw new Ze(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new Ze(`Graph.${t}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const l=""+r,u=""+a;if(a=arguments[2],i=hr(this,l,u,n),!i)throw new De(`Graph.${t}: could not find an edge for the given path ("${l}" - "${u}").`)}else{if(n!=="mixed")throw new Ze(`Graph.${t}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(r=""+r,i=this._edges.get(r),!i)throw new De(`Graph.${t}: could not find the "${r}" edge in the graph.`)}return i.attributes[a]}}function JY(e,t,n){e.prototype[t]=function(r){let a;if(this.type!=="mixed"&&n!=="mixed"&&n!==this.type)throw new Ze(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>1){if(this.multi)throw new Ze(`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 i=""+r,l=""+arguments[1];if(a=hr(this,i,l,n),!a)throw new De(`Graph.${t}: could not find an edge for the given path ("${i}" - "${l}").`)}else{if(n!=="mixed")throw new Ze(`Graph.${t}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(r=""+r,a=this._edges.get(r),!a)throw new De(`Graph.${t}: could not find the "${r}" edge in the graph.`)}return a.attributes}}function eK(e,t,n){e.prototype[t]=function(r,a){let i;if(this.type!=="mixed"&&n!=="mixed"&&n!==this.type)throw new Ze(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new Ze(`Graph.${t}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const l=""+r,u=""+a;if(a=arguments[2],i=hr(this,l,u,n),!i)throw new De(`Graph.${t}: could not find an edge for the given path ("${l}" - "${u}").`)}else{if(n!=="mixed")throw new Ze(`Graph.${t}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(r=""+r,i=this._edges.get(r),!i)throw new De(`Graph.${t}: could not find the "${r}" edge in the graph.`)}return i.attributes.hasOwnProperty(a)}}function tK(e,t,n){e.prototype[t]=function(r,a,i){let l;if(this.type!=="mixed"&&n!=="mixed"&&n!==this.type)throw new Ze(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>3){if(this.multi)throw new Ze(`Graph.${t}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const u=""+r,c=""+a;if(a=arguments[2],i=arguments[3],l=hr(this,u,c,n),!l)throw new De(`Graph.${t}: could not find an edge for the given path ("${u}" - "${c}").`)}else{if(n!=="mixed")throw new Ze(`Graph.${t}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(r=""+r,l=this._edges.get(r),!l)throw new De(`Graph.${t}: could not find the "${r}" edge in the graph.`)}return l.attributes[a]=i,this.emit("edgeAttributesUpdated",{key:l.key,type:"set",attributes:l.attributes,name:a}),this}}function nK(e,t,n){e.prototype[t]=function(r,a,i){let l;if(this.type!=="mixed"&&n!=="mixed"&&n!==this.type)throw new Ze(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>3){if(this.multi)throw new Ze(`Graph.${t}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const u=""+r,c=""+a;if(a=arguments[2],i=arguments[3],l=hr(this,u,c,n),!l)throw new De(`Graph.${t}: could not find an edge for the given path ("${u}" - "${c}").`)}else{if(n!=="mixed")throw new Ze(`Graph.${t}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(r=""+r,l=this._edges.get(r),!l)throw new De(`Graph.${t}: could not find the "${r}" edge in the graph.`)}if(typeof i!="function")throw new Le(`Graph.${t}: updater should be a function.`);return l.attributes[a]=i(l.attributes[a]),this.emit("edgeAttributesUpdated",{key:l.key,type:"set",attributes:l.attributes,name:a}),this}}function rK(e,t,n){e.prototype[t]=function(r,a){let i;if(this.type!=="mixed"&&n!=="mixed"&&n!==this.type)throw new Ze(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new Ze(`Graph.${t}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const l=""+r,u=""+a;if(a=arguments[2],i=hr(this,l,u,n),!i)throw new De(`Graph.${t}: could not find an edge for the given path ("${l}" - "${u}").`)}else{if(n!=="mixed")throw new Ze(`Graph.${t}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(r=""+r,i=this._edges.get(r),!i)throw new De(`Graph.${t}: could not find the "${r}" edge in the graph.`)}return delete i.attributes[a],this.emit("edgeAttributesUpdated",{key:i.key,type:"remove",attributes:i.attributes,name:a}),this}}function aK(e,t,n){e.prototype[t]=function(r,a){let i;if(this.type!=="mixed"&&n!=="mixed"&&n!==this.type)throw new Ze(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new Ze(`Graph.${t}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const l=""+r,u=""+a;if(a=arguments[2],i=hr(this,l,u,n),!i)throw new De(`Graph.${t}: could not find an edge for the given path ("${l}" - "${u}").`)}else{if(n!=="mixed")throw new Ze(`Graph.${t}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(r=""+r,i=this._edges.get(r),!i)throw new De(`Graph.${t}: could not find the "${r}" edge in the graph.`)}if(!gn(a))throw new Le(`Graph.${t}: provided attributes are not a plain object.`);return i.attributes=a,this.emit("edgeAttributesUpdated",{key:i.key,type:"replace",attributes:i.attributes}),this}}function oK(e,t,n){e.prototype[t]=function(r,a){let i;if(this.type!=="mixed"&&n!=="mixed"&&n!==this.type)throw new Ze(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new Ze(`Graph.${t}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const l=""+r,u=""+a;if(a=arguments[2],i=hr(this,l,u,n),!i)throw new De(`Graph.${t}: could not find an edge for the given path ("${l}" - "${u}").`)}else{if(n!=="mixed")throw new Ze(`Graph.${t}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(r=""+r,i=this._edges.get(r),!i)throw new De(`Graph.${t}: could not find the "${r}" edge in the graph.`)}if(!gn(a))throw new Le(`Graph.${t}: provided attributes are not a plain object.`);return Qt(i.attributes,a),this.emit("edgeAttributesUpdated",{key:i.key,type:"merge",attributes:i.attributes,data:a}),this}}function iK(e,t,n){e.prototype[t]=function(r,a){let i;if(this.type!=="mixed"&&n!=="mixed"&&n!==this.type)throw new Ze(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new Ze(`Graph.${t}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const l=""+r,u=""+a;if(a=arguments[2],i=hr(this,l,u,n),!i)throw new De(`Graph.${t}: could not find an edge for the given path ("${l}" - "${u}").`)}else{if(n!=="mixed")throw new Ze(`Graph.${t}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(r=""+r,i=this._edges.get(r),!i)throw new De(`Graph.${t}: could not find the "${r}" edge in the graph.`)}if(typeof a!="function")throw new Le(`Graph.${t}: provided updater is not a function.`);return i.attributes=a(i.attributes),this.emit("edgeAttributesUpdated",{key:i.key,type:"update",attributes:i.attributes}),this}}const lK=[{name:e=>`get${e}Attribute`,attacher:QY},{name:e=>`get${e}Attributes`,attacher:JY},{name:e=>`has${e}Attribute`,attacher:eK},{name:e=>`set${e}Attribute`,attacher:tK},{name:e=>`update${e}Attribute`,attacher:nK},{name:e=>`remove${e}Attribute`,attacher:rK},{name:e=>`replace${e}Attributes`,attacher:aK},{name:e=>`merge${e}Attributes`,attacher:oK},{name:e=>`update${e}Attributes`,attacher:iK}];function sK(e){lK.forEach(function({name:t,attacher:n}){n(e,t("Edge"),"mixed"),n(e,t("DirectedEdge"),"directed"),n(e,t("UndirectedEdge"),"undirected")})}const uK=[{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 cK(e,t,n,r){let a=!1;for(const i in t){if(i===r)continue;const l=t[i];if(a=n(l.key,l.attributes,l.source.key,l.target.key,l.source.attributes,l.target.attributes,l.undirected),e&&a)return l.key}}function dK(e,t,n,r){let a,i,l,u=!1;for(const c in t)if(c!==r){a=t[c];do{if(i=a.source,l=a.target,u=n(a.key,a.attributes,i.key,l.key,i.attributes,l.attributes,a.undirected),e&&u)return a.key;a=a.next}while(a!==void 0)}}function xh(e,t){const n=Object.keys(e),r=n.length;let a,i=0;return{[Symbol.iterator](){return this},next(){do if(a)a=a.next;else{if(i>=r)return{done:!0};const l=n[i++];if(l===t){a=void 0;continue}a=e[l]}while(!a);return{done:!1,value:{edge:a.key,attributes:a.attributes,source:a.source.key,target:a.target.key,sourceAttributes:a.source.attributes,targetAttributes:a.target.attributes,undirected:a.undirected}}}}}function fK(e,t,n,r){const a=t[n];if(!a)return;const i=a.source,l=a.target;if(r(a.key,a.attributes,i.key,l.key,i.attributes,l.attributes,a.undirected)&&e)return a.key}function pK(e,t,n,r){let a=t[n];if(!a)return;let i=!1;do{if(i=r(a.key,a.attributes,a.source.key,a.target.key,a.source.attributes,a.target.attributes,a.undirected),e&&i)return a.key;a=a.next}while(a!==void 0)}function kh(e,t){let n=e[t];if(n.next!==void 0)return{[Symbol.iterator](){return this},next(){if(!n)return{done:!0};const a={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:a}}};let r=!1;return{[Symbol.iterator](){return this},next(){return r===!0?{done:!0}:(r=!0,{done:!1,value:{edge:n.key,attributes:n.attributes,source:n.source.key,target:n.target.key,sourceAttributes:n.source.attributes,targetAttributes:n.target.attributes,undirected:n.undirected}})}}}function gK(e,t){if(e.size===0)return[];if(t==="mixed"||t===e.type)return Array.from(e._edges.keys());const n=t==="undirected"?e.undirectedSize:e.directedSize,r=new Array(n),a=t==="undirected",i=e._edges.values();let l=0,u,c;for(;u=i.next(),u.done!==!0;)c=u.value,c.undirected===a&&(r[l++]=c.key);return r}function OU(e,t,n,r){if(t.size===0)return;const a=n!=="mixed"&&n!==t.type,i=n==="undirected";let l,u,c=!1;const f=t._edges.values();for(;l=f.next(),l.done!==!0;){if(u=l.value,a&&u.undirected!==i)continue;const{key:p,attributes:g,source:b,target:m}=u;if(c=r(p,g,b.key,m.key,b.attributes,m.attributes,u.undirected),e&&c)return p}}function hK(e,t){if(e.size===0)return Nl();const n=t!=="mixed"&&t!==e.type,r=t==="undirected",a=e._edges.values();return{[Symbol.iterator](){return this},next(){let i,l;for(;;){if(i=a.next(),i.done)return i;if(l=i.value,!(n&&l.undirected!==r))break}return{value:{edge:l.key,attributes:l.attributes,source:l.source.key,target:l.target.key,sourceAttributes:l.source.attributes,targetAttributes:l.target.attributes,undirected:l.undirected},done:!1}}}}function c0(e,t,n,r,a,i){const l=t?dK:cK;let u;if(n!=="undirected"&&(r!=="out"&&(u=l(e,a.in,i),e&&u)||r!=="in"&&(u=l(e,a.out,i,r?void 0:a.key),e&&u))||n!=="directed"&&(u=l(e,a.undirected,i),e&&u))return u}function mK(e,t,n,r){const a=[];return c0(!1,e,t,n,r,function(i){a.push(i)}),a}function bK(e,t,n){let r=Nl();return e!=="undirected"&&(t!=="out"&&typeof n.in<"u"&&(r=Na(r,xh(n.in))),t!=="in"&&typeof n.out<"u"&&(r=Na(r,xh(n.out,t?void 0:n.key)))),e!=="directed"&&typeof n.undirected<"u"&&(r=Na(r,xh(n.undirected))),r}function d0(e,t,n,r,a,i,l){const u=n?pK:fK;let c;if(t!=="undirected"&&(typeof a.in<"u"&&r!=="out"&&(c=u(e,a.in,i,l),e&&c)||typeof a.out<"u"&&r!=="in"&&(r||a.key!==i)&&(c=u(e,a.out,i,l),e&&c))||t!=="directed"&&typeof a.undirected<"u"&&(c=u(e,a.undirected,i,l),e&&c))return c}function yK(e,t,n,r,a){const i=[];return d0(!1,e,t,n,r,a,function(l){i.push(l)}),i}function vK(e,t,n,r){let a=Nl();return e!=="undirected"&&(typeof n.in<"u"&&t!=="out"&&r in n.in&&(a=Na(a,kh(n.in,r))),typeof n.out<"u"&&t!=="in"&&r in n.out&&(t||n.key!==r)&&(a=Na(a,kh(n.out,r)))),e!=="directed"&&typeof n.undirected<"u"&&r in n.undirected&&(a=Na(a,kh(n.undirected,r))),a}function SK(e,t){const{name:n,type:r,direction:a}=t;e.prototype[n]=function(i,l){if(r!=="mixed"&&this.type!=="mixed"&&r!==this.type)return[];if(!arguments.length)return gK(this,r);if(arguments.length===1){i=""+i;const u=this._nodes.get(i);if(typeof u>"u")throw new De(`Graph.${n}: could not find the "${i}" node in the graph.`);return mK(this.multi,r==="mixed"?this.type:r,a,u)}if(arguments.length===2){i=""+i,l=""+l;const u=this._nodes.get(i);if(!u)throw new De(`Graph.${n}: could not find the "${i}" source node in the graph.`);if(!this._nodes.has(l))throw new De(`Graph.${n}: could not find the "${l}" target node in the graph.`);return yK(r,this.multi,a,u,l)}throw new Le(`Graph.${n}: too many arguments (expecting 0, 1 or 2 and got ${arguments.length}).`)}}function EK(e,t){const{name:n,type:r,direction:a}=t,i="forEach"+n[0].toUpperCase()+n.slice(1,-1);e.prototype[i]=function(f,p,g){if(!(r!=="mixed"&&this.type!=="mixed"&&r!==this.type)){if(arguments.length===1)return g=f,OU(!1,this,r,g);if(arguments.length===2){f=""+f,g=p;const b=this._nodes.get(f);if(typeof b>"u")throw new De(`Graph.${i}: could not find the "${f}" node in the graph.`);return c0(!1,this.multi,r==="mixed"?this.type:r,a,b,g)}if(arguments.length===3){f=""+f,p=""+p;const b=this._nodes.get(f);if(!b)throw new De(`Graph.${i}: could not find the "${f}" source node in the graph.`);if(!this._nodes.has(p))throw new De(`Graph.${i}: could not find the "${p}" target node in the graph.`);return d0(!1,r,this.multi,a,b,p,g)}throw new Le(`Graph.${i}: too many arguments (expecting 1, 2 or 3 and got ${arguments.length}).`)}};const l="map"+n[0].toUpperCase()+n.slice(1);e.prototype[l]=function(){const f=Array.prototype.slice.call(arguments),p=f.pop();let g;if(f.length===0){let b=0;r!=="directed"&&(b+=this.undirectedSize),r!=="undirected"&&(b+=this.directedSize),g=new Array(b);let m=0;f.push((S,v,A,R,x,_,C)=>{g[m++]=p(S,v,A,R,x,_,C)})}else g=[],f.push((b,m,S,v,A,R,x)=>{g.push(p(b,m,S,v,A,R,x))});return this[i].apply(this,f),g};const u="filter"+n[0].toUpperCase()+n.slice(1);e.prototype[u]=function(){const f=Array.prototype.slice.call(arguments),p=f.pop(),g=[];return f.push((b,m,S,v,A,R,x)=>{p(b,m,S,v,A,R,x)&&g.push(b)}),this[i].apply(this,f),g};const c="reduce"+n[0].toUpperCase()+n.slice(1);e.prototype[c]=function(){let f=Array.prototype.slice.call(arguments);if(f.length<2||f.length>4)throw new Le(`Graph.${c}: invalid number of arguments (expecting 2, 3 or 4 and got ${f.length}).`);if(typeof f[f.length-1]=="function"&&typeof f[f.length-2]!="function")throw new Le(`Graph.${c}: missing initial value. You must provide it because the callback takes more than one argument and we cannot infer the initial value from the first iteration, as you could with a simple array.`);let p,g;f.length===2?(p=f[0],g=f[1],f=[]):f.length===3?(p=f[1],g=f[2],f=[f[0]]):f.length===4&&(p=f[2],g=f[3],f=[f[0],f[1]]);let b=g;return f.push((m,S,v,A,R,x,_)=>{b=p(b,m,S,v,A,R,x,_)}),this[i].apply(this,f),b}}function wK(e,t){const{name:n,type:r,direction:a}=t,i="find"+n[0].toUpperCase()+n.slice(1,-1);e.prototype[i]=function(c,f,p){if(r!=="mixed"&&this.type!=="mixed"&&r!==this.type)return!1;if(arguments.length===1)return p=c,OU(!0,this,r,p);if(arguments.length===2){c=""+c,p=f;const g=this._nodes.get(c);if(typeof g>"u")throw new De(`Graph.${i}: could not find the "${c}" node in the graph.`);return c0(!0,this.multi,r==="mixed"?this.type:r,a,g,p)}if(arguments.length===3){c=""+c,f=""+f;const g=this._nodes.get(c);if(!g)throw new De(`Graph.${i}: could not find the "${c}" source node in the graph.`);if(!this._nodes.has(f))throw new De(`Graph.${i}: could not find the "${f}" target node in the graph.`);return d0(!0,r,this.multi,a,g,f,p)}throw new Le(`Graph.${i}: too many arguments (expecting 1, 2 or 3 and got ${arguments.length}).`)};const l="some"+n[0].toUpperCase()+n.slice(1,-1);e.prototype[l]=function(){const c=Array.prototype.slice.call(arguments),f=c.pop();return c.push((g,b,m,S,v,A,R)=>f(g,b,m,S,v,A,R)),!!this[i].apply(this,c)};const u="every"+n[0].toUpperCase()+n.slice(1,-1);e.prototype[u]=function(){const c=Array.prototype.slice.call(arguments),f=c.pop();return c.push((g,b,m,S,v,A,R)=>!f(g,b,m,S,v,A,R)),!this[i].apply(this,c)}}function xK(e,t){const{name:n,type:r,direction:a}=t,i=n.slice(0,-1)+"Entries";e.prototype[i]=function(l,u){if(r!=="mixed"&&this.type!=="mixed"&&r!==this.type)return Nl();if(!arguments.length)return hK(this,r);if(arguments.length===1){l=""+l;const c=this._nodes.get(l);if(!c)throw new De(`Graph.${i}: could not find the "${l}" node in the graph.`);return bK(r,a,c)}if(arguments.length===2){l=""+l,u=""+u;const c=this._nodes.get(l);if(!c)throw new De(`Graph.${i}: could not find the "${l}" source node in the graph.`);if(!this._nodes.has(u))throw new De(`Graph.${i}: could not find the "${u}" target node in the graph.`);return vK(r,a,c,u)}throw new Le(`Graph.${i}: too many arguments (expecting 0, 1 or 2 and got ${arguments.length}).`)}}function kK(e){uK.forEach(t=>{SK(e,t),EK(e,t),wK(e,t),xK(e,t)})}const AK=[{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 Rf(){this.A=null,this.B=null}Rf.prototype.wrap=function(e){this.A===null?this.A=e:this.B===null&&(this.B=e)};Rf.prototype.has=function(e){return this.A!==null&&e in this.A||this.B!==null&&e in this.B};function Ms(e,t,n,r,a){for(const i in r){const l=r[i],u=l.source,c=l.target,f=u===n?c:u;if(t&&t.has(f.key))continue;const p=a(f.key,f.attributes);if(e&&p)return f.key}}function f0(e,t,n,r,a){if(t!=="mixed"){if(t==="undirected")return Ms(e,null,r,r.undirected,a);if(typeof n=="string")return Ms(e,null,r,r[n],a)}const i=new Rf;let l;if(t!=="undirected"){if(n!=="out"){if(l=Ms(e,null,r,r.in,a),e&&l)return l;i.wrap(r.in)}if(n!=="in"){if(l=Ms(e,i,r,r.out,a),e&&l)return l;i.wrap(r.out)}}if(t!=="directed"&&(l=Ms(e,i,r,r.undirected,a),e&&l))return l}function TK(e,t,n){if(e!=="mixed"){if(e==="undirected")return Object.keys(n.undirected);if(typeof t=="string")return Object.keys(n[t])}const r=[];return f0(!1,e,t,n,function(a){r.push(a)}),r}function Fs(e,t,n){const r=Object.keys(n),a=r.length;let i=0;return{[Symbol.iterator](){return this},next(){let l=null;do{if(i>=a)return e&&e.wrap(n),{done:!0};const u=n[r[i++]],c=u.source,f=u.target;if(l=c===t?f:c,e&&e.has(l.key)){l=null;continue}}while(l===null);return{done:!1,value:{neighbor:l.key,attributes:l.attributes}}}}}function _K(e,t,n){if(e!=="mixed"){if(e==="undirected")return Fs(null,n,n.undirected);if(typeof t=="string")return Fs(null,n,n[t])}let r=Nl();const a=new Rf;return e!=="undirected"&&(t!=="out"&&(r=Na(r,Fs(a,n,n.in))),t!=="in"&&(r=Na(r,Fs(a,n,n.out)))),e!=="directed"&&(r=Na(r,Fs(a,n,n.undirected))),r}function RK(e,t){const{name:n,type:r,direction:a}=t;e.prototype[n]=function(i){if(r!=="mixed"&&this.type!=="mixed"&&r!==this.type)return[];i=""+i;const l=this._nodes.get(i);if(typeof l>"u")throw new De(`Graph.${n}: could not find the "${i}" node in the graph.`);return TK(r==="mixed"?this.type:r,a,l)}}function CK(e,t){const{name:n,type:r,direction:a}=t,i="forEach"+n[0].toUpperCase()+n.slice(1,-1);e.prototype[i]=function(f,p){if(r!=="mixed"&&this.type!=="mixed"&&r!==this.type)return;f=""+f;const g=this._nodes.get(f);if(typeof g>"u")throw new De(`Graph.${i}: could not find the "${f}" node in the graph.`);f0(!1,r==="mixed"?this.type:r,a,g,p)};const l="map"+n[0].toUpperCase()+n.slice(1);e.prototype[l]=function(f,p){const g=[];return this[i](f,(b,m)=>{g.push(p(b,m))}),g};const u="filter"+n[0].toUpperCase()+n.slice(1);e.prototype[u]=function(f,p){const g=[];return this[i](f,(b,m)=>{p(b,m)&&g.push(b)}),g};const c="reduce"+n[0].toUpperCase()+n.slice(1);e.prototype[c]=function(f,p,g){if(arguments.length<3)throw new Le(`Graph.${c}: 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 b=g;return this[i](f,(m,S)=>{b=p(b,m,S)}),b}}function NK(e,t){const{name:n,type:r,direction:a}=t,i=n[0].toUpperCase()+n.slice(1,-1),l="find"+i;e.prototype[l]=function(f,p){if(r!=="mixed"&&this.type!=="mixed"&&r!==this.type)return;f=""+f;const g=this._nodes.get(f);if(typeof g>"u")throw new De(`Graph.${l}: could not find the "${f}" node in the graph.`);return f0(!0,r==="mixed"?this.type:r,a,g,p)};const u="some"+i;e.prototype[u]=function(f,p){return!!this[l](f,p)};const c="every"+i;e.prototype[c]=function(f,p){return!this[l](f,(b,m)=>!p(b,m))}}function OK(e,t){const{name:n,type:r,direction:a}=t,i=n.slice(0,-1)+"Entries";e.prototype[i]=function(l){if(r!=="mixed"&&this.type!=="mixed"&&r!==this.type)return Nl();l=""+l;const u=this._nodes.get(l);if(typeof u>"u")throw new De(`Graph.${i}: could not find the "${l}" node in the graph.`);return _K(r==="mixed"?this.type:r,a,u)}}function DK(e){AK.forEach(t=>{RK(e,t),CK(e,t),NK(e,t),OK(e,t)})}function Vc(e,t,n,r,a){const i=r._nodes.values(),l=r.type;let u,c,f,p,g,b;for(;u=i.next(),u.done!==!0;){let m=!1;if(c=u.value,l!=="undirected"){p=c.out;for(f in p){g=p[f];do b=g.target,m=!0,a(c.key,b.key,c.attributes,b.attributes,g.key,g.attributes,g.undirected),g=g.next;while(g)}}if(l!=="directed"){p=c.undirected;for(f in p)if(!(t&&c.key>f)){g=p[f];do b=g.target,b.key!==f&&(b=g.source),m=!0,a(c.key,b.key,c.attributes,b.attributes,g.key,g.attributes,g.undirected),g=g.next;while(g)}}n&&!m&&a(c.key,null,c.attributes,null,null,null,null)}}function IK(e,t){const n={key:e};return kU(t.attributes)||(n.attributes=Qt({},t.attributes)),n}function LK(e,t,n){const r={key:t,source:n.source.key,target:n.target.key};return kU(n.attributes)||(r.attributes=Qt({},n.attributes)),e==="mixed"&&n.undirected&&(r.undirected=!0),r}function MK(e){if(!gn(e))throw new Le('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 Le("Graph.import: serialized node is missing its key.");if("attributes"in e&&(!gn(e.attributes)||e.attributes===null))throw new Le("Graph.import: invalid attributes. Attributes should be a plain object, null or omitted.")}function FK(e){if(!gn(e))throw new Le('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 Le("Graph.import: serialized edge is missing its source.");if(!("target"in e))throw new Le("Graph.import: serialized edge is missing its target.");if("attributes"in e&&(!gn(e.attributes)||e.attributes===null))throw new Le("Graph.import: invalid attributes. Attributes should be a plain object, null or omitted.");if("undirected"in e&&typeof e.undirected!="boolean")throw new Le("Graph.import: invalid undirectedness information. Undirected should be boolean or omitted.")}const zK=BY(),PK=new Set(["directed","undirected","mixed"]),KR=new Set(["domain","_events","_eventsCount","_maxListeners"]),BK=[{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"}],UK={allowSelfLoops:!0,multi:!1,type:"mixed"};function jK(e,t,n){if(n&&!gn(n))throw new Le(`Graph.addNode: invalid attributes. Expecting an object but got "${n}"`);if(t=""+t,n=n||{},e._nodes.has(t))throw new Ze(`Graph.addNode: the "${t}" node already exist in the graph.`);const r=new e.NodeDataClass(t,n);return e._nodes.set(t,r),e.emit("nodeAdded",{key:t,attributes:n}),r}function XR(e,t,n){const r=new e.NodeDataClass(t,n);return e._nodes.set(t,r),e.emit("nodeAdded",{key:t,attributes:n}),r}function DU(e,t,n,r,a,i,l,u){if(!r&&e.type==="undirected")throw new Ze(`Graph.${t}: you cannot add a directed edge to an undirected graph. Use the #.addEdge or #.addUndirectedEdge instead.`);if(r&&e.type==="directed")throw new Ze(`Graph.${t}: you cannot add an undirected edge to a directed graph. Use the #.addEdge or #.addDirectedEdge instead.`);if(u&&!gn(u))throw new Le(`Graph.${t}: invalid attributes. Expecting an object but got "${u}"`);if(i=""+i,l=""+l,u=u||{},!e.allowSelfLoops&&i===l)throw new Ze(`Graph.${t}: source & target are the same ("${i}"), thus creating a loop explicitly forbidden by this graph 'allowSelfLoops' option set to false.`);const c=e._nodes.get(i),f=e._nodes.get(l);if(!c)throw new De(`Graph.${t}: source node "${i}" not found.`);if(!f)throw new De(`Graph.${t}: target node "${l}" not found.`);const p={key:null,undirected:r,source:i,target:l,attributes:u};if(n)a=e._edgeKeyGenerator();else if(a=""+a,e._edges.has(a))throw new Ze(`Graph.${t}: the "${a}" edge already exists in the graph.`);if(!e.multi&&(r?typeof c.undirected[l]<"u":typeof c.out[l]<"u"))throw new Ze(`Graph.${t}: an edge linking "${i}" to "${l}" already exists. If you really want to add multiple edges linking those nodes, you should create a multi graph by using the 'multi' option.`);const g=new Ol(r,a,c,f,u);e._edges.set(a,g);const b=i===l;return r?(c.undirectedDegree++,f.undirectedDegree++,b&&(c.undirectedLoops++,e._undirectedSelfLoopCount++)):(c.outDegree++,f.inDegree++,b&&(c.directedLoops++,e._directedSelfLoopCount++)),e.multi?g.attachMulti():g.attach(),r?e._undirectedSize++:e._directedSize++,p.key=a,e.emit("edgeAdded",p),a}function GK(e,t,n,r,a,i,l,u,c){if(!r&&e.type==="undirected")throw new Ze(`Graph.${t}: you cannot merge/update a directed edge to an undirected graph. Use the #.mergeEdge/#.updateEdge or #.addUndirectedEdge instead.`);if(r&&e.type==="directed")throw new Ze(`Graph.${t}: you cannot merge/update an undirected edge to a directed graph. Use the #.mergeEdge/#.updateEdge or #.addDirectedEdge instead.`);if(u){if(c){if(typeof u!="function")throw new Le(`Graph.${t}: invalid updater function. Expecting a function but got "${u}"`)}else if(!gn(u))throw new Le(`Graph.${t}: invalid attributes. Expecting an object but got "${u}"`)}i=""+i,l=""+l;let f;if(c&&(f=u,u=void 0),!e.allowSelfLoops&&i===l)throw new Ze(`Graph.${t}: source & target are the same ("${i}"), thus creating a loop explicitly forbidden by this graph 'allowSelfLoops' option set to false.`);let p=e._nodes.get(i),g=e._nodes.get(l),b,m;if(!n&&(b=e._edges.get(a),b)){if((b.source.key!==i||b.target.key!==l)&&(!r||b.source.key!==l||b.target.key!==i))throw new Ze(`Graph.${t}: inconsistency detected when attempting to merge the "${a}" edge with "${i}" source & "${l}" target vs. ("${b.source.key}", "${b.target.key}").`);m=b}if(!m&&!e.multi&&p&&(m=r?p.undirected[l]:p.out[l]),m){const x=[m.key,!1,!1,!1];if(c?!f:!u)return x;if(c){const _=m.attributes;m.attributes=f(_),e.emit("edgeAttributesUpdated",{type:"replace",key:m.key,attributes:m.attributes})}else Qt(m.attributes,u),e.emit("edgeAttributesUpdated",{type:"merge",key:m.key,attributes:m.attributes,data:u});return x}u=u||{},c&&f&&(u=f(u));const S={key:null,undirected:r,source:i,target:l,attributes:u};if(n)a=e._edgeKeyGenerator();else if(a=""+a,e._edges.has(a))throw new Ze(`Graph.${t}: the "${a}" edge already exists in the graph.`);let v=!1,A=!1;p||(p=XR(e,i,{}),v=!0,i===l&&(g=p,A=!0)),g||(g=XR(e,l,{}),A=!0),b=new Ol(r,a,p,g,u),e._edges.set(a,b);const R=i===l;return r?(p.undirectedDegree++,g.undirectedDegree++,R&&(p.undirectedLoops++,e._undirectedSelfLoopCount++)):(p.outDegree++,g.inDegree++,R&&(p.directedLoops++,e._directedSelfLoopCount++)),e.multi?b.attachMulti():b.attach(),r?e._undirectedSize++:e._directedSize++,S.key=a,e.emit("edgeAdded",S),[a,!0,v,A]}function Qi(e,t){e._edges.delete(t.key);const{source:n,target:r,attributes:a}=t,i=t.undirected,l=n===r;i?(n.undirectedDegree--,r.undirectedDegree--,l&&(n.undirectedLoops--,e._undirectedSelfLoopCount--)):(n.outDegree--,r.inDegree--,l&&(n.directedLoops--,e._directedSelfLoopCount--)),e.multi?t.detachMulti():t.detach(),i?e._undirectedSize--:e._directedSize--,e.emit("edgeDropped",{key:t.key,attributes:a,source:n.key,target:r.key,undirected:i})}class Tt extends xU.EventEmitter{constructor(t){if(super(),t=Qt({},UK,t),typeof t.multi!="boolean")throw new Le(`Graph.constructor: invalid 'multi' option. Expecting a boolean but got "${t.multi}".`);if(!PK.has(t.type))throw new Le(`Graph.constructor: invalid 'type' option. Should be one of "mixed", "directed" or "undirected" but got "${t.type}".`);if(typeof t.allowSelfLoops!="boolean")throw new Le(`Graph.constructor: invalid 'allowSelfLoops' option. Expecting a boolean but got "${t.allowSelfLoops}".`);const n=t.type==="mixed"?AU:t.type==="directed"?TU:_U;pr(this,"NodeDataClass",n);const r="geid_"+zK()+"_";let a=0;const i=()=>{let l;do l=r+a++;while(this._edges.has(l));return l};pr(this,"_attributes",{}),pr(this,"_nodes",new Map),pr(this,"_edges",new Map),pr(this,"_directedSize",0),pr(this,"_undirectedSize",0),pr(this,"_directedSelfLoopCount",0),pr(this,"_undirectedSelfLoopCount",0),pr(this,"_edgeKeyGenerator",i),pr(this,"_options",t),KR.forEach(l=>pr(this,l,this[l])),Tr(this,"order",()=>this._nodes.size),Tr(this,"size",()=>this._edges.size),Tr(this,"directedSize",()=>this._directedSize),Tr(this,"undirectedSize",()=>this._undirectedSize),Tr(this,"selfLoopCount",()=>this._directedSelfLoopCount+this._undirectedSelfLoopCount),Tr(this,"directedSelfLoopCount",()=>this._directedSelfLoopCount),Tr(this,"undirectedSelfLoopCount",()=>this._undirectedSelfLoopCount),Tr(this,"multi",this._options.multi),Tr(this,"type",this._options.type),Tr(this,"allowSelfLoops",this._options.allowSelfLoops),Tr(this,"implementation",()=>"graphology")}_resetInstanceCounters(){this._directedSize=0,this._undirectedSize=0,this._directedSelfLoopCount=0,this._undirectedSelfLoopCount=0}hasNode(t){return this._nodes.has(""+t)}hasDirectedEdge(t,n){if(this.type==="undirected")return!1;if(arguments.length===1){const r=""+t,a=this._edges.get(r);return!!a&&!a.undirected}else if(arguments.length===2){t=""+t,n=""+n;const r=this._nodes.get(t);return r?r.out.hasOwnProperty(n):!1}throw new Le(`Graph.hasDirectedEdge: invalid arity (${arguments.length}, instead of 1 or 2). You can either ask for an edge id or for the existence of an edge between a source & a target.`)}hasUndirectedEdge(t,n){if(this.type==="directed")return!1;if(arguments.length===1){const r=""+t,a=this._edges.get(r);return!!a&&a.undirected}else if(arguments.length===2){t=""+t,n=""+n;const r=this._nodes.get(t);return r?r.undirected.hasOwnProperty(n):!1}throw new Le(`Graph.hasDirectedEdge: invalid arity (${arguments.length}, instead of 1 or 2). You can either ask for an edge id or for the existence of an edge between a source & a target.`)}hasEdge(t,n){if(arguments.length===1){const r=""+t;return this._edges.has(r)}else if(arguments.length===2){t=""+t,n=""+n;const r=this._nodes.get(t);return r?typeof r.out<"u"&&r.out.hasOwnProperty(n)||typeof r.undirected<"u"&&r.undirected.hasOwnProperty(n):!1}throw new Le(`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 Ze("Graph.directedEdge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.directedEdges instead.");const r=this._nodes.get(t);if(!r)throw new De(`Graph.directedEdge: could not find the "${t}" source node in the graph.`);if(!this._nodes.has(n))throw new De(`Graph.directedEdge: could not find the "${n}" target node in the graph.`);const a=r.out&&r.out[n]||void 0;if(a)return a.key}undirectedEdge(t,n){if(this.type==="directed")return;if(t=""+t,n=""+n,this.multi)throw new Ze("Graph.undirectedEdge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.undirectedEdges instead.");const r=this._nodes.get(t);if(!r)throw new De(`Graph.undirectedEdge: could not find the "${t}" source node in the graph.`);if(!this._nodes.has(n))throw new De(`Graph.undirectedEdge: could not find the "${n}" target node in the graph.`);const a=r.undirected&&r.undirected[n]||void 0;if(a)return a.key}edge(t,n){if(this.multi)throw new Ze("Graph.edge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.edges instead.");t=""+t,n=""+n;const r=this._nodes.get(t);if(!r)throw new De(`Graph.edge: could not find the "${t}" source node in the graph.`);if(!this._nodes.has(n))throw new De(`Graph.edge: could not find the "${n}" target node in the graph.`);const a=r.out&&r.out[n]||r.undirected&&r.undirected[n]||void 0;if(a)return a.key}areDirectedNeighbors(t,n){t=""+t,n=""+n;const r=this._nodes.get(t);if(!r)throw new De(`Graph.areDirectedNeighbors: could not find the "${t}" node in the graph.`);return this.type==="undirected"?!1:n in r.in||n in r.out}areOutNeighbors(t,n){t=""+t,n=""+n;const r=this._nodes.get(t);if(!r)throw new De(`Graph.areOutNeighbors: could not find the "${t}" node in the graph.`);return this.type==="undirected"?!1:n in r.out}areInNeighbors(t,n){t=""+t,n=""+n;const r=this._nodes.get(t);if(!r)throw new De(`Graph.areInNeighbors: could not find the "${t}" node in the graph.`);return this.type==="undirected"?!1:n in r.in}areUndirectedNeighbors(t,n){t=""+t,n=""+n;const r=this._nodes.get(t);if(!r)throw new De(`Graph.areUndirectedNeighbors: could not find the "${t}" node in the graph.`);return this.type==="directed"?!1:n in r.undirected}areNeighbors(t,n){t=""+t,n=""+n;const r=this._nodes.get(t);if(!r)throw new De(`Graph.areNeighbors: could not find the "${t}" node in the graph.`);return this.type!=="undirected"&&(n in r.in||n in r.out)||this.type!=="directed"&&n in r.undirected}areInboundNeighbors(t,n){t=""+t,n=""+n;const r=this._nodes.get(t);if(!r)throw new De(`Graph.areInboundNeighbors: could not find the "${t}" node in the graph.`);return this.type!=="undirected"&&n in r.in||this.type!=="directed"&&n in r.undirected}areOutboundNeighbors(t,n){t=""+t,n=""+n;const r=this._nodes.get(t);if(!r)throw new De(`Graph.areOutboundNeighbors: could not find the "${t}" node in the graph.`);return this.type!=="undirected"&&n in r.out||this.type!=="directed"&&n in r.undirected}inDegree(t){t=""+t;const n=this._nodes.get(t);if(!n)throw new De(`Graph.inDegree: could not find the "${t}" node in the graph.`);return this.type==="undirected"?0:n.inDegree}outDegree(t){t=""+t;const n=this._nodes.get(t);if(!n)throw new De(`Graph.outDegree: could not find the "${t}" node in the graph.`);return this.type==="undirected"?0:n.outDegree}directedDegree(t){t=""+t;const n=this._nodes.get(t);if(!n)throw new De(`Graph.directedDegree: could not find the "${t}" node in the graph.`);return this.type==="undirected"?0:n.inDegree+n.outDegree}undirectedDegree(t){t=""+t;const n=this._nodes.get(t);if(!n)throw new De(`Graph.undirectedDegree: could not find the "${t}" node in the graph.`);return this.type==="directed"?0:n.undirectedDegree}inboundDegree(t){t=""+t;const n=this._nodes.get(t);if(!n)throw new De(`Graph.inboundDegree: could not find the "${t}" node in the graph.`);let r=0;return this.type!=="directed"&&(r+=n.undirectedDegree),this.type!=="undirected"&&(r+=n.inDegree),r}outboundDegree(t){t=""+t;const n=this._nodes.get(t);if(!n)throw new De(`Graph.outboundDegree: could not find the "${t}" node in the graph.`);let r=0;return this.type!=="directed"&&(r+=n.undirectedDegree),this.type!=="undirected"&&(r+=n.outDegree),r}degree(t){t=""+t;const n=this._nodes.get(t);if(!n)throw new De(`Graph.degree: could not find the "${t}" node in the graph.`);let r=0;return this.type!=="directed"&&(r+=n.undirectedDegree),this.type!=="undirected"&&(r+=n.inDegree+n.outDegree),r}inDegreeWithoutSelfLoops(t){t=""+t;const n=this._nodes.get(t);if(!n)throw new De(`Graph.inDegreeWithoutSelfLoops: could not find the "${t}" node in the graph.`);return this.type==="undirected"?0:n.inDegree-n.directedLoops}outDegreeWithoutSelfLoops(t){t=""+t;const n=this._nodes.get(t);if(!n)throw new De(`Graph.outDegreeWithoutSelfLoops: could not find the "${t}" node in the graph.`);return this.type==="undirected"?0:n.outDegree-n.directedLoops}directedDegreeWithoutSelfLoops(t){t=""+t;const n=this._nodes.get(t);if(!n)throw new De(`Graph.directedDegreeWithoutSelfLoops: could not find the "${t}" node in the graph.`);return this.type==="undirected"?0:n.inDegree+n.outDegree-n.directedLoops*2}undirectedDegreeWithoutSelfLoops(t){t=""+t;const n=this._nodes.get(t);if(!n)throw new De(`Graph.undirectedDegreeWithoutSelfLoops: could not find the "${t}" node in the graph.`);return this.type==="directed"?0:n.undirectedDegree-n.undirectedLoops*2}inboundDegreeWithoutSelfLoops(t){t=""+t;const n=this._nodes.get(t);if(!n)throw new De(`Graph.inboundDegreeWithoutSelfLoops: could not find the "${t}" node in the graph.`);let r=0,a=0;return this.type!=="directed"&&(r+=n.undirectedDegree,a+=n.undirectedLoops*2),this.type!=="undirected"&&(r+=n.inDegree,a+=n.directedLoops),r-a}outboundDegreeWithoutSelfLoops(t){t=""+t;const n=this._nodes.get(t);if(!n)throw new De(`Graph.outboundDegreeWithoutSelfLoops: could not find the "${t}" node in the graph.`);let r=0,a=0;return this.type!=="directed"&&(r+=n.undirectedDegree,a+=n.undirectedLoops*2),this.type!=="undirected"&&(r+=n.outDegree,a+=n.directedLoops),r-a}degreeWithoutSelfLoops(t){t=""+t;const n=this._nodes.get(t);if(!n)throw new De(`Graph.degreeWithoutSelfLoops: could not find the "${t}" node in the graph.`);let r=0,a=0;return this.type!=="directed"&&(r+=n.undirectedDegree,a+=n.undirectedLoops*2),this.type!=="undirected"&&(r+=n.inDegree+n.outDegree,a+=n.directedLoops*2),r-a}source(t){t=""+t;const n=this._edges.get(t);if(!n)throw new De(`Graph.source: could not find the "${t}" edge in the graph.`);return n.source.key}target(t){t=""+t;const n=this._edges.get(t);if(!n)throw new De(`Graph.target: could not find the "${t}" edge in the graph.`);return n.target.key}extremities(t){t=""+t;const n=this._edges.get(t);if(!n)throw new De(`Graph.extremities: could not find the "${t}" edge in the graph.`);return[n.source.key,n.target.key]}opposite(t,n){t=""+t,n=""+n;const r=this._edges.get(n);if(!r)throw new De(`Graph.opposite: could not find the "${n}" edge in the graph.`);const a=r.source.key,i=r.target.key;if(t===a)return i;if(t===i)return a;throw new De(`Graph.opposite: the "${t}" node is not attached to the "${n}" edge (${a}, ${i}).`)}hasExtremity(t,n){t=""+t,n=""+n;const r=this._edges.get(t);if(!r)throw new De(`Graph.hasExtremity: could not find the "${t}" edge in the graph.`);return r.source.key===n||r.target.key===n}isUndirected(t){t=""+t;const n=this._edges.get(t);if(!n)throw new De(`Graph.isUndirected: could not find the "${t}" edge in the graph.`);return n.undirected}isDirected(t){t=""+t;const n=this._edges.get(t);if(!n)throw new De(`Graph.isDirected: could not find the "${t}" edge in the graph.`);return!n.undirected}isSelfLoop(t){t=""+t;const n=this._edges.get(t);if(!n)throw new De(`Graph.isSelfLoop: could not find the "${t}" edge in the graph.`);return n.source===n.target}addNode(t,n){return jK(this,t,n).key}mergeNode(t,n){if(n&&!gn(n))throw new Le(`Graph.mergeNode: invalid attributes. Expecting an object but got "${n}"`);t=""+t,n=n||{};let r=this._nodes.get(t);return r?(n&&(Qt(r.attributes,n),this.emit("nodeAttributesUpdated",{type:"merge",key:t,attributes:r.attributes,data:n})),[t,!1]):(r=new this.NodeDataClass(t,n),this._nodes.set(t,r),this.emit("nodeAdded",{key:t,attributes:n}),[t,!0])}updateNode(t,n){if(n&&typeof n!="function")throw new Le(`Graph.updateNode: invalid updater function. Expecting a function but got "${n}"`);t=""+t;let r=this._nodes.get(t);if(r){if(n){const i=r.attributes;r.attributes=n(i),this.emit("nodeAttributesUpdated",{type:"replace",key:t,attributes:r.attributes})}return[t,!1]}const a=n?n({}):{};return r=new this.NodeDataClass(t,a),this._nodes.set(t,r),this.emit("nodeAdded",{key:t,attributes:a}),[t,!0]}dropNode(t){t=""+t;const n=this._nodes.get(t);if(!n)throw new De(`Graph.dropNode: could not find the "${t}" node in the graph.`);let r;if(this.type!=="undirected"){for(const a in n.out){r=n.out[a];do Qi(this,r),r=r.next;while(r)}for(const a in n.in){r=n.in[a];do Qi(this,r),r=r.next;while(r)}}if(this.type!=="directed")for(const a in n.undirected){r=n.undirected[a];do Qi(this,r),r=r.next;while(r)}this._nodes.delete(t),this.emit("nodeDropped",{key:t,attributes:n.attributes})}dropEdge(t){let n;if(arguments.length>1){const r=""+arguments[0],a=""+arguments[1];if(n=hr(this,r,a,this.type),!n)throw new De(`Graph.dropEdge: could not find the "${r}" -> "${a}" edge in the graph.`)}else if(t=""+t,n=this._edges.get(t),!n)throw new De(`Graph.dropEdge: could not find the "${t}" edge in the graph.`);return Qi(this,n),this}dropDirectedEdge(t,n){if(arguments.length<2)throw new Ze("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 Ze("Graph.dropDirectedEdge: cannot use a {source,target} combo when dropping an edge in a MultiGraph since we cannot infer the one you want to delete as there could be multiple ones.");t=""+t,n=""+n;const r=hr(this,t,n,"directed");if(!r)throw new De(`Graph.dropDirectedEdge: could not find a "${t}" -> "${n}" edge in the graph.`);return Qi(this,r),this}dropUndirectedEdge(t,n){if(arguments.length<2)throw new Ze("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 Ze("Graph.dropUndirectedEdge: cannot use a {source,target} combo when dropping an edge in a MultiGraph since we cannot infer the one you want to delete as there could be multiple ones.");const r=hr(this,t,n,"undirected");if(!r)throw new De(`Graph.dropUndirectedEdge: could not find a "${t}" -> "${n}" edge in the graph.`);return Qi(this,r),this}clear(){this._edges.clear(),this._nodes.clear(),this._resetInstanceCounters(),this.emit("cleared")}clearEdges(){const t=this._nodes.values();let n;for(;n=t.next(),n.done!==!0;)n.value.clear();this._edges.clear(),this._resetInstanceCounters(),this.emit("edgesCleared")}getAttribute(t){return this._attributes[t]}getAttributes(){return this._attributes}hasAttribute(t){return this._attributes.hasOwnProperty(t)}setAttribute(t,n){return this._attributes[t]=n,this.emit("attributesUpdated",{type:"set",attributes:this._attributes,name:t}),this}updateAttribute(t,n){if(typeof n!="function")throw new Le("Graph.updateAttribute: updater should be a function.");const r=this._attributes[t];return this._attributes[t]=n(r),this.emit("attributesUpdated",{type:"set",attributes:this._attributes,name:t}),this}removeAttribute(t){return delete this._attributes[t],this.emit("attributesUpdated",{type:"remove",attributes:this._attributes,name:t}),this}replaceAttributes(t){if(!gn(t))throw new Le("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(!gn(t))throw new Le("Graph.mergeAttributes: provided attributes are not a plain object.");return Qt(this._attributes,t),this.emit("attributesUpdated",{type:"merge",attributes:this._attributes,data:t}),this}updateAttributes(t){if(typeof t!="function")throw new Le("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 Le("Graph.updateEachNodeAttributes: expecting an updater function.");if(n&&!YR(n))throw new Le("Graph.updateEachNodeAttributes: invalid hints. Expecting an object having the following shape: {attributes?: [string]}");const r=this._nodes.values();let a,i;for(;a=r.next(),a.done!==!0;)i=a.value,i.attributes=t(i.key,i.attributes);this.emit("eachNodeAttributesUpdated",{hints:n||null})}updateEachEdgeAttributes(t,n){if(typeof t!="function")throw new Le("Graph.updateEachEdgeAttributes: expecting an updater function.");if(n&&!YR(n))throw new Le("Graph.updateEachEdgeAttributes: invalid hints. Expecting an object having the following shape: {attributes?: [string]}");const r=this._edges.values();let a,i,l,u;for(;a=r.next(),a.done!==!0;)i=a.value,l=i.source,u=i.target,i.attributes=t(i.key,i.attributes,l.key,u.key,l.attributes,u.attributes,i.undirected);this.emit("eachEdgeAttributesUpdated",{hints:n||null})}forEachAdjacencyEntry(t){if(typeof t!="function")throw new Le("Graph.forEachAdjacencyEntry: expecting a callback.");Vc(!1,!1,!1,this,t)}forEachAdjacencyEntryWithOrphans(t){if(typeof t!="function")throw new Le("Graph.forEachAdjacencyEntryWithOrphans: expecting a callback.");Vc(!1,!1,!0,this,t)}forEachAssymetricAdjacencyEntry(t){if(typeof t!="function")throw new Le("Graph.forEachAssymetricAdjacencyEntry: expecting a callback.");Vc(!1,!0,!1,this,t)}forEachAssymetricAdjacencyEntryWithOrphans(t){if(typeof t!="function")throw new Le("Graph.forEachAssymetricAdjacencyEntryWithOrphans: expecting a callback.");Vc(!1,!0,!0,this,t)}nodes(){return Array.from(this._nodes.keys())}forEachNode(t){if(typeof t!="function")throw new Le("Graph.forEachNode: expecting a callback.");const n=this._nodes.values();let r,a;for(;r=n.next(),r.done!==!0;)a=r.value,t(a.key,a.attributes)}findNode(t){if(typeof t!="function")throw new Le("Graph.findNode: expecting a callback.");const n=this._nodes.values();let r,a;for(;r=n.next(),r.done!==!0;)if(a=r.value,t(a.key,a.attributes))return a.key}mapNodes(t){if(typeof t!="function")throw new Le("Graph.mapNode: expecting a callback.");const n=this._nodes.values();let r,a;const i=new Array(this.order);let l=0;for(;r=n.next(),r.done!==!0;)a=r.value,i[l++]=t(a.key,a.attributes);return i}someNode(t){if(typeof t!="function")throw new Le("Graph.someNode: expecting a callback.");const n=this._nodes.values();let r,a;for(;r=n.next(),r.done!==!0;)if(a=r.value,t(a.key,a.attributes))return!0;return!1}everyNode(t){if(typeof t!="function")throw new Le("Graph.everyNode: expecting a callback.");const n=this._nodes.values();let r,a;for(;r=n.next(),r.done!==!0;)if(a=r.value,!t(a.key,a.attributes))return!1;return!0}filterNodes(t){if(typeof t!="function")throw new Le("Graph.filterNodes: expecting a callback.");const n=this._nodes.values();let r,a;const i=[];for(;r=n.next(),r.done!==!0;)a=r.value,t(a.key,a.attributes)&&i.push(a.key);return i}reduceNodes(t,n){if(typeof t!="function")throw new Le("Graph.reduceNodes: expecting a callback.");if(arguments.length<2)throw new Le("Graph.reduceNodes: missing initial value. You must provide it because the callback takes more than one argument and we cannot infer the initial value from the first iteration, as you could with a simple array.");let r=n;const a=this._nodes.values();let i,l;for(;i=a.next(),i.done!==!0;)l=i.value,r=t(r,l.key,l.attributes);return r}nodeEntries(){const t=this._nodes.values();return{[Symbol.iterator](){return this},next(){const n=t.next();if(n.done)return n;const r=n.value;return{value:{node:r.key,attributes:r.attributes},done:!1}}}}export(){const t=new Array(this._nodes.size);let n=0;this._nodes.forEach((a,i)=>{t[n++]=IK(i,a)});const r=new Array(this._edges.size);return n=0,this._edges.forEach((a,i)=>{r[n++]=LK(this.type,i,a)}),{options:{type:this.type,multi:this.multi,allowSelfLoops:this.allowSelfLoops},attributes:this.getAttributes(),nodes:t,edges:r}}import(t,n=!1){if(t instanceof Tt)return t.forEachNode((c,f)=>{n?this.mergeNode(c,f):this.addNode(c,f)}),t.forEachEdge((c,f,p,g,b,m,S)=>{n?S?this.mergeUndirectedEdgeWithKey(c,p,g,f):this.mergeDirectedEdgeWithKey(c,p,g,f):S?this.addUndirectedEdgeWithKey(c,p,g,f):this.addDirectedEdgeWithKey(c,p,g,f)}),this;if(!gn(t))throw new Le("Graph.import: invalid argument. Expecting a serialized graph or, alternatively, a Graph instance.");if(t.attributes){if(!gn(t.attributes))throw new Le("Graph.import: invalid attributes. Expecting a plain object.");n?this.mergeAttributes(t.attributes):this.replaceAttributes(t.attributes)}let r,a,i,l,u;if(t.nodes){if(i=t.nodes,!Array.isArray(i))throw new Le("Graph.import: invalid nodes. Expecting an array.");for(r=0,a=i.length;r{const i=Qt({},r.attributes);r=new n.NodeDataClass(a,i),n._nodes.set(a,r)}),n}copy(t){if(t=t||{},typeof t.type=="string"&&t.type!==this.type&&t.type!=="mixed")throw new Ze(`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 Ze("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 Ze("Graph.copy: cannot create an incompatible copy from a graph allowing self loops to one that does not because this would mean losing information about the current graph.");const n=this.emptyCopy(t),r=this._edges.values();let a,i;for(;a=r.next(),a.done!==!0;)i=a.value,DU(n,"copy",!1,i.undirected,i.key,i.source.key,i.target.key,Qt({},i.attributes));return n}toJSON(){return this.export()}toString(){return"[object Graph]"}inspect(){const t={};this._nodes.forEach((i,l)=>{t[l]=i.attributes});const n={},r={};this._edges.forEach((i,l)=>{const u=i.undirected?"--":"->";let c="",f=i.source.key,p=i.target.key,g;i.undirected&&f>p&&(g=f,f=p,p=g);const b=`(${f})${u}(${p})`;l.startsWith("geid_")?this.multi&&(typeof r[b]>"u"?r[b]=0:r[b]++,c+=`${r[b]}. `):c+=`[${l}]: `,c+=b,n[c]=i.attributes});const a={};for(const i in this)this.hasOwnProperty(i)&&!KR.has(i)&&typeof this[i]!="function"&&typeof i!="symbol"&&(a[i]=this[i]);return a.attributes=this._attributes,a.nodes=t,a.edges=n,pr(a,"constructor",this.constructor),a}}typeof Symbol<"u"&&(Tt.prototype[Symbol.for("nodejs.util.inspect.custom")]=Tt.prototype.inspect);BK.forEach(e=>{["add","merge","update"].forEach(t=>{const n=e.name(t),r=t==="add"?DU:GK;e.generateKey?Tt.prototype[n]=function(a,i,l){return r(this,n,!0,(e.type||this.type)==="undirected",null,a,i,l,t==="update")}:Tt.prototype[n]=function(a,i,l,u){return r(this,n,!1,(e.type||this.type)==="undirected",a,i,l,u,t==="update")}})});ZY(Tt);sK(Tt);kK(Tt);DK(Tt);class tu extends Tt{constructor(t){const n=Qt({type:"directed"},t);if("multi"in n&&n.multi!==!1)throw new Le("DirectedGraph.from: inconsistent indication that the graph should be multi in given options!");if(n.type!=="directed")throw new Le('DirectedGraph.from: inconsistent "'+n.type+'" type in given options!');super(n)}}class IU extends Tt{constructor(t){const n=Qt({type:"undirected"},t);if("multi"in n&&n.multi!==!1)throw new Le("UndirectedGraph.from: inconsistent indication that the graph should be multi in given options!");if(n.type!=="undirected")throw new Le('UndirectedGraph.from: inconsistent "'+n.type+'" type in given options!');super(n)}}class LU extends Tt{constructor(t){const n=Qt({multi:!0},t);if("multi"in n&&n.multi!==!0)throw new Le("MultiGraph.from: inconsistent indication that the graph should be simple in given options!");super(n)}}class MU extends Tt{constructor(t){const n=Qt({type:"directed",multi:!0},t);if("multi"in n&&n.multi!==!0)throw new Le("MultiDirectedGraph.from: inconsistent indication that the graph should be simple in given options!");if(n.type!=="directed")throw new Le('MultiDirectedGraph.from: inconsistent "'+n.type+'" type in given options!');super(n)}}class FU extends Tt{constructor(t){const n=Qt({type:"undirected",multi:!0},t);if("multi"in n&&n.multi!==!0)throw new Le("MultiUndirectedGraph.from: inconsistent indication that the graph should be simple in given options!");if(n.type!=="undirected")throw new Le('MultiUndirectedGraph.from: inconsistent "'+n.type+'" type in given options!');super(n)}}function Dl(e){e.from=function(t,n){const r=Qt({},t.options,n),a=new e(r);return a.import(t),a}}Dl(Tt);Dl(tu);Dl(IU);Dl(LU);Dl(MU);Dl(FU);Tt.Graph=Tt;Tt.DirectedGraph=tu;Tt.UndirectedGraph=IU;Tt.MultiGraph=LU;Tt.MultiDirectedGraph=MU;Tt.MultiUndirectedGraph=FU;Tt.InvalidArgumentsGraphError=Le;Tt.NotFoundGraphError=De;Tt.UsageGraphError=Ze;function HK(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function Ws(e){var t=HK(e,"string");return typeof t=="symbol"?t:t+""}function on(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ZR(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,r=Array(t);n>8&255,i=n>>16&255,l=n>>24&255;return[r,a,i,l]}var Th={};function GU(e){if(typeof Th[e]<"u")return Th[e];var t=(e&16711680)>>>16,n=(e&65280)>>>8,r=e&255,a=255,i=jU(t,n,r,a);return Th[e]=i,i}function QR(e,t,n,r){return n+(t<<8)+(e<<16)}function JR(e,t,n,r,a,i){var l=Math.floor(n/i*a),u=Math.floor(e.drawingBufferHeight/i-r/i*a),c=new Uint8Array(4);e.bindFramebuffer(e.FRAMEBUFFER,t),e.readPixels(l,u,1,1,e.RGBA,e.UNSIGNED_BYTE,c);var f=vl(c,4),p=f[0],g=f[1],b=f[2],m=f[3];return[p,g,b,m]}function _e(e,t,n){return(t=Ws(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function eC(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function Be(e){for(var t=1;tC){var T="…";for(f=f+T,N=e.measureText(f).width;N>C&&f.length>1;)f=f.slice(0,-2)+T,N=e.measureText(f).width;if(f.length<4)return}var O;x>0?_>0?O=Math.acos(x/C):O=Math.asin(_/C):_>0?O=Math.acos(x/C)+Math.PI:O=Math.asin(x/C)+Math.PI/2,e.save(),e.translate(A,R),e.rotate(O),e.fillText(f,-N/2,t.size/2+i),e.restore()}}}function WU(e,t,n){if(t.label){var r=n.labelSize,a=n.labelFont,i=n.labelWeight,l=n.labelColor.attribute?t[n.labelColor.attribute]||n.labelColor.color||"#000":n.labelColor.color;e.fillStyle=l,e.font="".concat(i," ").concat(r,"px ").concat(a),e.fillText(t.label,t.x+t.size+3,t.y+r/3)}}function iX(e,t,n){var r=n.labelSize,a=n.labelFont,i=n.labelWeight;e.font="".concat(i," ").concat(r,"px ").concat(a),e.fillStyle="#FFF",e.shadowOffsetX=0,e.shadowOffsetY=0,e.shadowBlur=8,e.shadowColor="#000";var l=2;if(typeof t.label=="string"){var u=e.measureText(t.label).width,c=Math.round(u+5),f=Math.round(r+2*l),p=Math.max(t.size,r/2)+l,g=Math.asin(f/2/p),b=Math.sqrt(Math.abs(Math.pow(p,2)-Math.pow(f/2,2)));e.beginPath(),e.moveTo(t.x+b,t.y+f/2),e.lineTo(t.x+p+c,t.y+f/2),e.lineTo(t.x+p+c,t.y-f/2),e.lineTo(t.x+b,t.y-f/2),e.arc(t.x,t.y,p,g,-g),e.closePath(),e.fill()}else e.beginPath(),e.arc(t.x,t.y,t.size+l,0,Math.PI*2),e.closePath(),e.fill();e.shadowOffsetX=0,e.shadowOffsetY=0,e.shadowBlur=0,WU(e,t,n)}var lX=` +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 +} +`,sX=lX,uX=` +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; +} +`,cX=uX,YU=WebGLRenderingContext,aC=YU.UNSIGNED_BYTE,Rh=YU.FLOAT,dX=["u_sizeRatio","u_correctionRatio","u_matrix"],vu=function(e){function t(){return on(this,t),Bn(this,t,arguments)}return Un(t,e),ln(t,[{key:"getDefinition",value:function(){return{VERTICES:3,VERTEX_SHADER_SOURCE:cX,FRAGMENT_SHADER_SOURCE:sX,METHOD:WebGLRenderingContext.TRIANGLES,UNIFORMS:dX,ATTRIBUTES:[{name:"a_position",size:2,type:Rh},{name:"a_size",size:1,type:Rh},{name:"a_color",size:4,type:aC,normalized:!0},{name:"a_id",size:4,type:aC,normalized:!0}],CONSTANT_ATTRIBUTES:[{name:"a_angle",size:1,type:Rh}],CONSTANT_DATA:[[t.ANGLE_1],[t.ANGLE_2],[t.ANGLE_3]]}}},{key:"processVisibleItem",value:function(r,a,i){var l=this.array,u=Qr(i.color);l[a++]=i.x,l[a++]=i.y,l[a++]=i.size,l[a++]=u,l[a++]=r}},{key:"setUniforms",value:function(r,a){var i=a.gl,l=a.uniformLocations,u=l.u_sizeRatio,c=l.u_correctionRatio,f=l.u_matrix;i.uniform1f(c,r.correctionRatio),i.uniform1f(u,r.sizeRatio),i.uniformMatrix3fv(f,!1,r.matrix)}}])}(p0);_e(vu,"ANGLE_1",0);_e(vu,"ANGLE_2",2*Math.PI/3);_e(vu,"ANGLE_3",4*Math.PI/3);var fX=` +precision mediump float; + +varying vec4 v_color; + +void main(void) { + gl_FragColor = v_color; +} +`,pX=fX,gX=` +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; +} +`,hX=gX,KU=WebGLRenderingContext,oC=KU.UNSIGNED_BYTE,Yc=KU.FLOAT,mX=["u_matrix","u_sizeRatio","u_correctionRatio","u_minEdgeThickness","u_lengthToThicknessRatio","u_widenessToThicknessRatio"],Su={extremity:"target",lengthToThicknessRatio:2.5,widenessToThicknessRatio:2};function Pd(e){var t=Be(Be({},Su),e||{});return function(n){function r(){return on(this,r),Bn(this,r,arguments)}return Un(r,n),ln(r,[{key:"getDefinition",value:function(){return{VERTICES:3,VERTEX_SHADER_SOURCE:hX,FRAGMENT_SHADER_SOURCE:pX,METHOD:WebGLRenderingContext.TRIANGLES,UNIFORMS:mX,ATTRIBUTES:[{name:"a_position",size:2,type:Yc},{name:"a_normal",size:2,type:Yc},{name:"a_radius",size:1,type:Yc},{name:"a_color",size:4,type:oC,normalized:!0},{name:"a_id",size:4,type:oC,normalized:!0}],CONSTANT_ATTRIBUTES:[{name:"a_barycentric",size:3,type:Yc}],CONSTANT_DATA:[[1,0,0],[0,1,0],[0,0,1]]}}},{key:"processVisibleItem",value:function(i,l,u,c,f){if(t.extremity==="source"){var p=[c,u];u=p[0],c=p[1]}var g=f.size||1,b=c.size||1,m=u.x,S=u.y,v=c.x,A=c.y,R=Qr(f.color),x=v-m,_=A-S,C=x*x+_*_,N=0,T=0;C&&(C=1/Math.sqrt(C),N=-_*C*g,T=x*C*g);var O=this.array;O[l++]=v,O[l++]=A,O[l++]=-N,O[l++]=-T,O[l++]=b,O[l++]=R,O[l++]=i}},{key:"setUniforms",value:function(i,l){var u=l.gl,c=l.uniformLocations,f=c.u_matrix,p=c.u_sizeRatio,g=c.u_correctionRatio,b=c.u_minEdgeThickness,m=c.u_lengthToThicknessRatio,S=c.u_widenessToThicknessRatio;u.uniformMatrix3fv(f,!1,i.matrix),u.uniform1f(p,i.sizeRatio),u.uniform1f(g,i.correctionRatio),u.uniform1f(b,i.minEdgeThickness),u.uniform1f(m,t.lengthToThicknessRatio),u.uniform1f(S,t.widenessToThicknessRatio)}}])}(yu)}Pd();var bX=` +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 +} +`,g0=bX,yX=` +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; +} +`,vX=yX,XU=WebGLRenderingContext,iC=XU.UNSIGNED_BYTE,Ko=XU.FLOAT,SX=["u_matrix","u_zoomRatio","u_sizeRatio","u_correctionRatio","u_pixelRatio","u_feather","u_minEdgeThickness","u_lengthToThicknessRatio"],EX={lengthToThicknessRatio:Su.lengthToThicknessRatio};function ZU(e){var t=Be(Be({},EX),{});return function(n){function r(){return on(this,r),Bn(this,r,arguments)}return Un(r,n),ln(r,[{key:"getDefinition",value:function(){return{VERTICES:6,VERTEX_SHADER_SOURCE:vX,FRAGMENT_SHADER_SOURCE:g0,METHOD:WebGLRenderingContext.TRIANGLES,UNIFORMS:SX,ATTRIBUTES:[{name:"a_positionStart",size:2,type:Ko},{name:"a_positionEnd",size:2,type:Ko},{name:"a_normal",size:2,type:Ko},{name:"a_color",size:4,type:iC,normalized:!0},{name:"a_id",size:4,type:iC,normalized:!0},{name:"a_radius",size:1,type:Ko}],CONSTANT_ATTRIBUTES:[{name:"a_positionCoef",size:1,type:Ko},{name:"a_normalCoef",size:1,type:Ko},{name:"a_radiusCoef",size:1,type:Ko}],CONSTANT_DATA:[[0,1,0],[0,-1,0],[1,1,1],[1,1,1],[0,-1,0],[1,-1,-1]]}}},{key:"processVisibleItem",value:function(i,l,u,c,f){var p=f.size||1,g=u.x,b=u.y,m=c.x,S=c.y,v=Qr(f.color),A=m-g,R=S-b,x=c.size||1,_=A*A+R*R,C=0,N=0;_&&(_=1/Math.sqrt(_),C=-R*_*p,N=A*_*p);var T=this.array;T[l++]=g,T[l++]=b,T[l++]=m,T[l++]=S,T[l++]=C,T[l++]=N,T[l++]=v,T[l++]=i,T[l++]=x}},{key:"setUniforms",value:function(i,l){var u=l.gl,c=l.uniformLocations,f=c.u_matrix,p=c.u_zoomRatio,g=c.u_feather,b=c.u_pixelRatio,m=c.u_correctionRatio,S=c.u_sizeRatio,v=c.u_minEdgeThickness,A=c.u_lengthToThicknessRatio;u.uniformMatrix3fv(f,!1,i.matrix),u.uniform1f(p,i.zoomRatio),u.uniform1f(S,i.sizeRatio),u.uniform1f(m,i.correctionRatio),u.uniform1f(b,i.pixelRatio),u.uniform1f(g,i.antiAliasingFeather),u.uniform1f(v,i.minEdgeThickness),u.uniform1f(A,t.lengthToThicknessRatio)}}])}(yu)}ZU();function wX(e){return VU([ZU(),Pd(e)])}var xX=wX(),QU=xX,kX=` +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; +} +`,AX=kX,JU=WebGLRenderingContext,lC=JU.UNSIGNED_BYTE,zs=JU.FLOAT,TX=["u_matrix","u_zoomRatio","u_sizeRatio","u_correctionRatio","u_pixelRatio","u_feather","u_minEdgeThickness"],_X=function(e){function t(){return on(this,t),Bn(this,t,arguments)}return Un(t,e),ln(t,[{key:"getDefinition",value:function(){return{VERTICES:6,VERTEX_SHADER_SOURCE:AX,FRAGMENT_SHADER_SOURCE:g0,METHOD:WebGLRenderingContext.TRIANGLES,UNIFORMS:TX,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:lC,normalized:!0},{name:"a_id",size:4,type:lC,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(r,a,i,l,u){var c=u.size||1,f=i.x,p=i.y,g=l.x,b=l.y,m=Qr(u.color),S=g-f,v=b-p,A=S*S+v*v,R=0,x=0;A&&(A=1/Math.sqrt(A),R=-v*A*c,x=S*A*c);var _=this.array;_[a++]=f,_[a++]=p,_[a++]=g,_[a++]=b,_[a++]=R,_[a++]=x,_[a++]=m,_[a++]=r}},{key:"setUniforms",value:function(r,a){var i=a.gl,l=a.uniformLocations,u=l.u_matrix,c=l.u_zoomRatio,f=l.u_feather,p=l.u_pixelRatio,g=l.u_correctionRatio,b=l.u_sizeRatio,m=l.u_minEdgeThickness;i.uniformMatrix3fv(u,!1,r.matrix),i.uniform1f(c,r.zoomRatio),i.uniform1f(b,r.sizeRatio),i.uniform1f(g,r.correctionRatio),i.uniform1f(p,r.pixelRatio),i.uniform1f(f,r.antiAliasingFeather),i.uniform1f(m,r.minEdgeThickness)}}])}(yu),h0=function(e){function t(){var n;return on(this,t),n=Bn(this,t),n.rawEmitter=n,n}return Un(t,e),ln(t)}(xU.EventEmitter),Ch,sC;function Jr(){return sC||(sC=1,Ch=function(t){return t!==null&&typeof t=="object"&&typeof t.addUndirectedEdgeWithKey=="function"&&typeof t.dropNode=="function"&&typeof t.multi=="boolean"}),Ch}var RX=Jr();const CX=an(RX);var NX=function(t){return t},OX=function(t){return t*t},DX=function(t){return t*(2-t)},IX=function(t){return(t*=2)<1?.5*t*t:-.5*(--t*(t-2)-1)},LX=function(t){return t*t*t},MX=function(t){return--t*t*t+1},FX=function(t){return(t*=2)<1?.5*t*t*t:.5*((t-=2)*t*t+2)},e3={linear:NX,quadraticIn:OX,quadraticOut:DX,quadraticInOut:IX,cubicIn:LX,cubicOut:MX,cubicInOut:FX},t3={easing:"quadraticInOut",duration:150};function zX(e,t,n,r){var a=Object.assign({},t3,n),i=typeof a.easing=="function"?a.easing:e3[a.easing],l=Date.now(),u={};for(var c in t){var f=t[c];u[c]={};for(var p in f)u[c][p]=e.getNodeAttribute(c,p)}var g=null,b=function(){g=null;var S=(Date.now()-l)/a.duration;if(S>=1){for(var v in t){var A=t[v];for(var R in A)e.setNodeAttribute(v,R,A[R])}return}S=i(S);for(var x in t){var _=t[x],C=u[x];for(var N in _)e.setNodeAttribute(x,N,_[N]*S+C[N]*(1-S))}g=requestAnimationFrame(b)};return b(),function(){g&&cancelAnimationFrame(g)}}function _r(){return Float32Array.of(1,0,0,0,1,0,0,0,1)}function Kc(e,t,n){return e[0]=t,e[4]=typeof n=="number"?n:t,e}function uC(e,t){var n=Math.sin(t),r=Math.cos(t);return e[0]=r,e[1]=n,e[3]=-n,e[4]=r,e}function cC(e,t,n){return e[6]=t,e[7]=n,e}function io(e,t){var n=e[0],r=e[1],a=e[2],i=e[3],l=e[4],u=e[5],c=e[6],f=e[7],p=e[8],g=t[0],b=t[1],m=t[2],S=t[3],v=t[4],A=t[5],R=t[6],x=t[7],_=t[8];return e[0]=g*n+b*i+m*c,e[1]=g*r+b*l+m*f,e[2]=g*a+b*u+m*p,e[3]=S*n+v*i+A*c,e[4]=S*r+v*l+A*f,e[5]=S*a+v*u+A*p,e[6]=R*n+x*i+_*c,e[7]=R*r+x*l+_*f,e[8]=R*a+x*u+_*p,e}function Mx(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,r=e[0],a=e[1],i=e[3],l=e[4],u=e[6],c=e[7],f=t.x,p=t.y;return{x:f*r+p*i+u*n,y:f*a+p*l+c*n}}function PX(e,t){var n=e.height/e.width,r=t.height/t.width;return n<1&&r>1||n>1&&r<1?1:Math.min(Math.max(r,1/r),Math.max(1/n,n))}function Ps(e,t,n,r,a){var i=e.angle,l=e.ratio,u=e.x,c=e.y,f=t.width,p=t.height,g=_r(),b=Math.min(f,p)-2*r,m=PX(t,n);return a?(io(g,cC(_r(),u,c)),io(g,Kc(_r(),l)),io(g,uC(_r(),i)),io(g,Kc(_r(),f/b/2/m,p/b/2/m))):(io(g,Kc(_r(),2*(b/f)*m,2*(b/p)*m)),io(g,uC(_r(),-i)),io(g,Kc(_r(),1/l)),io(g,cC(_r(),-u,-c))),g}function BX(e,t,n){var r=Mx(e,{x:Math.cos(t.angle),y:Math.sin(t.angle)},0),a=r.x,i=r.y;return 1/Math.sqrt(Math.pow(a,2)+Math.pow(i,2))/n.width}function UX(e){if(!e.order)return{x:[0,1],y:[0,1]};var t=1/0,n=-1/0,r=1/0,a=-1/0;return e.forEachNode(function(i,l){var u=l.x,c=l.y;un&&(n=u),ca&&(a=c)}),{x:[t,n],y:[r,a]}}function jX(e){if(!CX(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 GX(e,t,n){var r=document.createElement(e);if(t)for(var a in t)r.style[a]=t[a];if(n)for(var i in n)r.setAttribute(i,n[i]);return r}function dC(){return typeof window.devicePixelRatio<"u"?window.devicePixelRatio:1}function fC(e,t,n){return n.sort(function(r,a){var i=t(r)||0,l=t(a)||0;return il?1:0})}function pC(e){var t=vl(e.x,2),n=t[0],r=t[1],a=vl(e.y,2),i=a[0],l=a[1],u=Math.max(r-n,l-i),c=(r+n)/2,f=(l+i)/2;(u===0||Math.abs(u)===1/0||isNaN(u))&&(u=1),isNaN(c)&&(c=0),isNaN(f)&&(f=0);var p=function(b){return{x:.5+(b.x-c)/u,y:.5+(b.y-f)/u}};return p.applyTo=function(g){g.x=.5+(g.x-c)/u,g.y=.5+(g.y-f)/u},p.inverse=function(g){return{x:c+u*(g.x-.5),y:f+u*(g.y-.5)}},p.ratio=u,p}function Fx(e){"@babel/helpers - typeof";return Fx=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},Fx(e)}function gC(e,t){var n=t.size;if(n!==0){var r=e.length;e.length+=n;var a=0;t.forEach(function(i){e[r+a]=i,a++})}}function Nh(e){e=e||{};for(var t=0,n=arguments.length<=1?0:arguments.length-1;t1&&arguments[1]!==void 0?arguments[1]:{},l=arguments.length>2?arguments[2]:void 0;if(!l)return new Promise(function(m){return a.animate(r,i,m)});if(this.enabled){var u=Be(Be({},t3),i),c=this.validateState(r),f=typeof u.easing=="function"?u.easing:e3[u.easing],p=Date.now(),g=this.getState(),b=function(){var S=(Date.now()-p)/u.duration;if(S>=1){a.nextFrame=null,a.setState(c),a.animationCallback&&(a.animationCallback.call(null),a.animationCallback=void 0);return}var v=f(S),A={};typeof c.x=="number"&&(A.x=g.x+(c.x-g.x)*v),typeof c.y=="number"&&(A.y=g.y+(c.y-g.y)*v),a.enabledRotation&&typeof c.angle=="number"&&(A.angle=g.angle+(c.angle-g.angle)*v),typeof c.ratio=="number"&&(A.ratio=g.ratio+(c.ratio-g.ratio)*v),a.setState(A),a.nextFrame=requestAnimationFrame(b)};this.nextFrame?(cancelAnimationFrame(this.nextFrame),this.animationCallback&&this.animationCallback.call(null),this.nextFrame=requestAnimationFrame(b)):b(),this.animationCallback=l}}},{key:"animatedZoom",value:function(r){return r?typeof r=="number"?this.animate({ratio:this.ratio/r}):this.animate({ratio:this.ratio/(r.factor||Xc)},r):this.animate({ratio:this.ratio/Xc})}},{key:"animatedUnzoom",value:function(r){return r?typeof r=="number"?this.animate({ratio:this.ratio*r}):this.animate({ratio:this.ratio*(r.factor||Xc)},r):this.animate({ratio:this.ratio*Xc})}},{key:"animatedReset",value:function(r){return this.animate({x:.5,y:.5,ratio:1,angle:0},r)}},{key:"copy",value:function(){return t.from(this.getState())}}],[{key:"from",value:function(r){var a=new t;return a.setState(r)}}])}(h0);function Cr(e,t){var n=t.getBoundingClientRect();return{x:e.clientX-n.left,y:e.clientY-n.top}}function Aa(e,t){var n=Be(Be({},Cr(e,t)),{},{sigmaDefaultPrevented:!1,preventSigmaDefault:function(){n.sigmaDefaultPrevented=!0},original:e});return n}function Bs(e){var t="x"in e?e:Be(Be({},e.touches[0]||e.previousTouches[0]),{},{original:e.original,sigmaDefaultPrevented:e.sigmaDefaultPrevented,preventSigmaDefault:function(){e.sigmaDefaultPrevented=!0,t.sigmaDefaultPrevented=!0}});return t}function VX(e,t){return Be(Be({},Aa(e,t)),{},{delta:n3(e)})}var WX=2;function vd(e){for(var t=[],n=0,r=Math.min(e.length,WX);n0;a.draggedEvents=0,g&&a.renderer.getSetting("hideEdgesOnMove")&&a.renderer.refresh()},0),this.emit("mouseup",Aa(r,this.container))}}},{key:"handleMove",value:function(r){var a=this;if(this.enabled){var i=Aa(r,this.container);if(this.emit("mousemovebody",i),(r.target===this.container||r.composedPath()[0]===this.container)&&this.emit("mousemove",i),!i.sigmaDefaultPrevented&&this.isMouseDown){this.isMoving=!0,this.draggedEvents++,typeof this.movingTimeout=="number"&&clearTimeout(this.movingTimeout),this.movingTimeout=window.setTimeout(function(){a.movingTimeout=null,a.isMoving=!1},this.settings.dragTimeout);var l=this.renderer.getCamera(),u=Cr(r,this.container),c=u.x,f=u.y,p=this.renderer.viewportToFramedGraph({x:this.lastMouseX,y:this.lastMouseY}),g=this.renderer.viewportToFramedGraph({x:c,y:f}),b=p.x-g.x,m=p.y-g.y,S=l.getState(),v=S.x+b,A=S.y+m;l.setState({x:v,y:A}),this.lastMouseX=c,this.lastMouseY=f,r.preventDefault(),r.stopPropagation()}}}},{key:"handleLeave",value:function(r){this.emit("mouseleave",Aa(r,this.container))}},{key:"handleEnter",value:function(r){this.emit("mouseenter",Aa(r,this.container))}},{key:"handleWheel",value:function(r){var a=this,i=this.renderer.getCamera();if(!(!this.enabled||!i.enabledZooming)){var l=n3(r);if(l){var u=VX(r,this.container);if(this.emit("wheel",u),u.sigmaDefaultPrevented){r.preventDefault(),r.stopPropagation();return}var c=i.getState().ratio,f=l>0?1/this.settings.zoomingRatio:this.settings.zoomingRatio,p=i.getBoundedRatio(c*f),g=l>0?1:-1,b=Date.now();c!==p&&(r.preventDefault(),r.stopPropagation(),!(this.currentWheelDirection===g&&this.lastWheelTriggerTime&&b-this.lastWheelTriggerTimer.size?-1:n.sizer.key?1:-1}}])}(),yC=function(){function e(){on(this,e),_e(this,"width",0),_e(this,"height",0),_e(this,"cellSize",0),_e(this,"columns",0),_e(this,"rows",0),_e(this,"cells",{})}return ln(e,[{key:"resizeAndClear",value:function(n,r){this.width=n.width,this.height=n.height,this.cellSize=r,this.columns=Math.ceil(n.width/r),this.rows=Math.ceil(n.height/r),this.cells={}}},{key:"getIndex",value:function(n){var r=Math.floor(n.x/this.cellSize),a=Math.floor(n.y/this.cellSize);return a*this.columns+r}},{key:"add",value:function(n,r,a){var i=new bC(n,r),l=this.getIndex(a),u=this.cells[l];u||(u=[],this.cells[l]=u),u.push(i)}},{key:"organize",value:function(){for(var n in this.cells){var r=this.cells[n];r.sort(bC.compare)}}},{key:"getLabelsToDisplay",value:function(n,r){var a=this.cellSize*this.cellSize,i=a/n/n,l=i*r/a,u=Math.ceil(l),c=[];for(var f in this.cells)for(var p=this.cells[f],g=0;g2&&arguments[2]!==void 0?arguments[2]:{};if(on(this,t),a=Bn(this,t),_e(a,"elements",{}),_e(a,"canvasContexts",{}),_e(a,"webGLContexts",{}),_e(a,"pickingLayers",new Set),_e(a,"textures",{}),_e(a,"frameBuffers",{}),_e(a,"activeListeners",{}),_e(a,"labelGrid",new yC),_e(a,"nodeDataCache",{}),_e(a,"edgeDataCache",{}),_e(a,"nodeProgramIndex",{}),_e(a,"edgeProgramIndex",{}),_e(a,"nodesWithForcedLabels",new Set),_e(a,"edgesWithForcedLabels",new Set),_e(a,"nodeExtent",{x:[0,1],y:[0,1]}),_e(a,"nodeZExtent",[1/0,-1/0]),_e(a,"edgeZExtent",[1/0,-1/0]),_e(a,"matrix",_r()),_e(a,"invMatrix",_r()),_e(a,"correctionRatio",1),_e(a,"customBBox",null),_e(a,"normalizationFunction",pC({x:[0,1],y:[0,1]})),_e(a,"graphToViewportRatio",1),_e(a,"itemIDsIndex",{}),_e(a,"nodeIndices",{}),_e(a,"edgeIndices",{}),_e(a,"width",0),_e(a,"height",0),_e(a,"pixelRatio",dC()),_e(a,"pickingDownSizingRatio",2*a.pixelRatio),_e(a,"displayedNodeLabels",new Set),_e(a,"displayedEdgeLabels",new Set),_e(a,"highlightedNodes",new Set),_e(a,"hoveredNode",null),_e(a,"hoveredEdge",null),_e(a,"renderFrame",null),_e(a,"renderHighlightedNodesFrame",null),_e(a,"needToProcess",!1),_e(a,"checkEdgesEventsFrame",null),_e(a,"nodePrograms",{}),_e(a,"nodeHoverPrograms",{}),_e(a,"edgePrograms",{}),a.settings=qX(i),Oh(a.settings),jX(n),!(r instanceof HTMLElement))throw new Error("Sigma: container should be an html element.");a.graph=n,a.container=r,a.createWebGLContext("edges",{picking:i.enableEdgeEvents}),a.createCanvasContext("edgeLabels"),a.createWebGLContext("nodes",{picking:!0}),a.createCanvasContext("labels"),a.createCanvasContext("hovers"),a.createWebGLContext("hoverNodes"),a.createCanvasContext("mouse",{style:{touchAction:"none",userSelect:"none"}}),a.resize();for(var l in a.settings.nodeProgramClasses)a.registerNodeProgram(l,a.settings.nodeProgramClasses[l],a.settings.nodeHoverProgramClasses[l]);for(var u in a.settings.edgeProgramClasses)a.registerEdgeProgram(u,a.settings.edgeProgramClasses[u]);return a.camera=new hC,a.bindCameraHandlers(),a.mouseCaptor=new XX(a.elements.mouse,a),a.mouseCaptor.setSettings(a.settings),a.touchCaptor=new JX(a.elements.mouse,a),a.touchCaptor.setSettings(a.settings),a.bindEventHandlers(),a.bindGraphHandlers(),a.handleSettingsUpdate(),a.refresh(),a}return Un(t,e),ln(t,[{key:"registerNodeProgram",value:function(r,a,i){return this.nodePrograms[r]&&this.nodePrograms[r].kill(),this.nodeHoverPrograms[r]&&this.nodeHoverPrograms[r].kill(),this.nodePrograms[r]=new a(this.webGLContexts.nodes,this.frameBuffers.nodes,this),this.nodeHoverPrograms[r]=new(i||a)(this.webGLContexts.hoverNodes,null,this),this}},{key:"registerEdgeProgram",value:function(r,a){return this.edgePrograms[r]&&this.edgePrograms[r].kill(),this.edgePrograms[r]=new a(this.webGLContexts.edges,this.frameBuffers.edges,this),this}},{key:"unregisterNodeProgram",value:function(r){if(this.nodePrograms[r]){var a=this.nodePrograms,i=a[r],l=Dh(a,[r].map(Ws));i.kill(),this.nodePrograms=l}if(this.nodeHoverPrograms[r]){var u=this.nodeHoverPrograms,c=u[r],f=Dh(u,[r].map(Ws));c.kill(),this.nodePrograms=f}return this}},{key:"unregisterEdgeProgram",value:function(r){if(this.edgePrograms[r]){var a=this.edgePrograms,i=a[r],l=Dh(a,[r].map(Ws));i.kill(),this.edgePrograms=l}return this}},{key:"resetWebGLTexture",value:function(r){var a=this.webGLContexts[r],i=this.frameBuffers[r],l=this.textures[r];l&&a.deleteTexture(l);var u=a.createTexture();return a.bindFramebuffer(a.FRAMEBUFFER,i),a.bindTexture(a.TEXTURE_2D,u),a.texImage2D(a.TEXTURE_2D,0,a.RGBA,this.width,this.height,0,a.RGBA,a.UNSIGNED_BYTE,null),a.framebufferTexture2D(a.FRAMEBUFFER,a.COLOR_ATTACHMENT0,a.TEXTURE_2D,u,0),this.textures[r]=u,this}},{key:"bindCameraHandlers",value:function(){var r=this;return this.activeListeners.camera=function(){r.scheduleRender()},this.camera.on("updated",this.activeListeners.camera),this}},{key:"unbindCameraHandlers",value:function(){return this.camera.removeListener("updated",this.activeListeners.camera),this}},{key:"getNodeAtPosition",value:function(r){var a=r.x,i=r.y,l=JR(this.webGLContexts.nodes,this.frameBuffers.nodes,a,i,this.pixelRatio,this.pickingDownSizingRatio),u=QR.apply(void 0,mC(l)),c=this.itemIDsIndex[u];return c&&c.type==="node"?c.id:null}},{key:"bindEventHandlers",value:function(){var r=this;this.activeListeners.handleResize=function(){r.scheduleRefresh()},window.addEventListener("resize",this.activeListeners.handleResize),this.activeListeners.handleMove=function(i){var l=Bs(i),u={event:l,preventSigmaDefault:function(){l.preventSigmaDefault()}},c=r.getNodeAtPosition(l);if(c&&r.hoveredNode!==c&&!r.nodeDataCache[c].hidden){r.hoveredNode&&r.emit("leaveNode",Be(Be({},u),{},{node:r.hoveredNode})),r.hoveredNode=c,r.emit("enterNode",Be(Be({},u),{},{node:c})),r.scheduleHighlightedNodesRender();return}if(r.hoveredNode&&r.getNodeAtPosition(l)!==r.hoveredNode){var f=r.hoveredNode;r.hoveredNode=null,r.emit("leaveNode",Be(Be({},u),{},{node:f})),r.scheduleHighlightedNodesRender();return}if(r.settings.enableEdgeEvents){var p=r.hoveredNode?null:r.getEdgeAtPoint(u.event.x,u.event.y);p!==r.hoveredEdge&&(r.hoveredEdge&&r.emit("leaveEdge",Be(Be({},u),{},{edge:r.hoveredEdge})),p&&r.emit("enterEdge",Be(Be({},u),{},{edge:p})),r.hoveredEdge=p)}},this.activeListeners.handleMoveBody=function(i){var l=Bs(i);r.emit("moveBody",{event:l,preventSigmaDefault:function(){l.preventSigmaDefault()}})},this.activeListeners.handleLeave=function(i){var l=Bs(i),u={event:l,preventSigmaDefault:function(){l.preventSigmaDefault()}};r.hoveredNode&&(r.emit("leaveNode",Be(Be({},u),{},{node:r.hoveredNode})),r.scheduleHighlightedNodesRender()),r.settings.enableEdgeEvents&&r.hoveredEdge&&(r.emit("leaveEdge",Be(Be({},u),{},{edge:r.hoveredEdge})),r.scheduleHighlightedNodesRender()),r.emit("leaveStage",Be({},u))},this.activeListeners.handleEnter=function(i){var l=Bs(i),u={event:l,preventSigmaDefault:function(){l.preventSigmaDefault()}};r.emit("enterStage",Be({},u))};var a=function(l){return function(u){var c=Bs(u),f={event:c,preventSigmaDefault:function(){c.preventSigmaDefault()}},p=r.getNodeAtPosition(c);if(p)return r.emit("".concat(l,"Node"),Be(Be({},f),{},{node:p}));if(r.settings.enableEdgeEvents){var g=r.getEdgeAtPoint(c.x,c.y);if(g)return r.emit("".concat(l,"Edge"),Be(Be({},f),{},{edge:g}))}return r.emit("".concat(l,"Stage"),f)}};return this.activeListeners.handleClick=a("click"),this.activeListeners.handleRightClick=a("rightClick"),this.activeListeners.handleDoubleClick=a("doubleClick"),this.activeListeners.handleWheel=a("wheel"),this.activeListeners.handleDown=a("down"),this.activeListeners.handleUp=a("up"),this.mouseCaptor.on("mousemove",this.activeListeners.handleMove),this.mouseCaptor.on("mousemovebody",this.activeListeners.handleMoveBody),this.mouseCaptor.on("click",this.activeListeners.handleClick),this.mouseCaptor.on("rightClick",this.activeListeners.handleRightClick),this.mouseCaptor.on("doubleClick",this.activeListeners.handleDoubleClick),this.mouseCaptor.on("wheel",this.activeListeners.handleWheel),this.mouseCaptor.on("mousedown",this.activeListeners.handleDown),this.mouseCaptor.on("mouseup",this.activeListeners.handleUp),this.mouseCaptor.on("mouseleave",this.activeListeners.handleLeave),this.mouseCaptor.on("mouseenter",this.activeListeners.handleEnter),this.touchCaptor.on("touchdown",this.activeListeners.handleDown),this.touchCaptor.on("touchdown",this.activeListeners.handleMove),this.touchCaptor.on("touchup",this.activeListeners.handleUp),this.touchCaptor.on("touchmove",this.activeListeners.handleMove),this.touchCaptor.on("tap",this.activeListeners.handleClick),this.touchCaptor.on("doubletap",this.activeListeners.handleDoubleClick),this.touchCaptor.on("touchmove",this.activeListeners.handleMoveBody),this}},{key:"bindGraphHandlers",value:function(){var r=this,a=this.graph,i=new Set(["x","y","zIndex","type"]);return this.activeListeners.eachNodeAttributesUpdatedGraphUpdate=function(l){var u,c=(u=l.hints)===null||u===void 0?void 0:u.attributes;r.graph.forEachNode(function(p){return r.updateNode(p)});var f=!c||c.some(function(p){return i.has(p)});r.refresh({partialGraph:{nodes:a.nodes()},skipIndexation:!f,schedule:!0})},this.activeListeners.eachEdgeAttributesUpdatedGraphUpdate=function(l){var u,c=(u=l.hints)===null||u===void 0?void 0:u.attributes;r.graph.forEachEdge(function(p){return r.updateEdge(p)});var f=c&&["zIndex","type"].some(function(p){return c==null?void 0:c.includes(p)});r.refresh({partialGraph:{edges:a.edges()},skipIndexation:!f,schedule:!0})},this.activeListeners.addNodeGraphUpdate=function(l){var u=l.key;r.addNode(u),r.refresh({partialGraph:{nodes:[u]},skipIndexation:!1,schedule:!0})},this.activeListeners.updateNodeGraphUpdate=function(l){var u=l.key;r.refresh({partialGraph:{nodes:[u]},skipIndexation:!1,schedule:!0})},this.activeListeners.dropNodeGraphUpdate=function(l){var u=l.key;r.removeNode(u),r.refresh({schedule:!0})},this.activeListeners.addEdgeGraphUpdate=function(l){var u=l.key;r.addEdge(u),r.refresh({partialGraph:{edges:[u]},schedule:!0})},this.activeListeners.updateEdgeGraphUpdate=function(l){var u=l.key;r.refresh({partialGraph:{edges:[u]},skipIndexation:!1,schedule:!0})},this.activeListeners.dropEdgeGraphUpdate=function(l){var u=l.key;r.removeEdge(u),r.refresh({schedule:!0})},this.activeListeners.clearEdgesGraphUpdate=function(){r.clearEdgeState(),r.clearEdgeIndices(),r.refresh({schedule:!0})},this.activeListeners.clearGraphUpdate=function(){r.clearEdgeState(),r.clearNodeState(),r.clearEdgeIndices(),r.clearNodeIndices(),r.refresh({schedule:!0})},a.on("nodeAdded",this.activeListeners.addNodeGraphUpdate),a.on("nodeDropped",this.activeListeners.dropNodeGraphUpdate),a.on("nodeAttributesUpdated",this.activeListeners.updateNodeGraphUpdate),a.on("eachNodeAttributesUpdated",this.activeListeners.eachNodeAttributesUpdatedGraphUpdate),a.on("edgeAdded",this.activeListeners.addEdgeGraphUpdate),a.on("edgeDropped",this.activeListeners.dropEdgeGraphUpdate),a.on("edgeAttributesUpdated",this.activeListeners.updateEdgeGraphUpdate),a.on("eachEdgeAttributesUpdated",this.activeListeners.eachEdgeAttributesUpdatedGraphUpdate),a.on("edgesCleared",this.activeListeners.clearEdgesGraphUpdate),a.on("cleared",this.activeListeners.clearGraphUpdate),this}},{key:"unbindGraphHandlers",value:function(){var r=this.graph;r.removeListener("nodeAdded",this.activeListeners.addNodeGraphUpdate),r.removeListener("nodeDropped",this.activeListeners.dropNodeGraphUpdate),r.removeListener("nodeAttributesUpdated",this.activeListeners.updateNodeGraphUpdate),r.removeListener("eachNodeAttributesUpdated",this.activeListeners.eachNodeAttributesUpdatedGraphUpdate),r.removeListener("edgeAdded",this.activeListeners.addEdgeGraphUpdate),r.removeListener("edgeDropped",this.activeListeners.dropEdgeGraphUpdate),r.removeListener("edgeAttributesUpdated",this.activeListeners.updateEdgeGraphUpdate),r.removeListener("eachEdgeAttributesUpdated",this.activeListeners.eachEdgeAttributesUpdatedGraphUpdate),r.removeListener("edgesCleared",this.activeListeners.clearEdgesGraphUpdate),r.removeListener("cleared",this.activeListeners.clearGraphUpdate)}},{key:"getEdgeAtPoint",value:function(r,a){var i=JR(this.webGLContexts.edges,this.frameBuffers.edges,r,a,this.pixelRatio,this.pickingDownSizingRatio),l=QR.apply(void 0,mC(i)),u=this.itemIDsIndex[l];return u&&u.type==="edge"?u.id:null}},{key:"process",value:function(){var r=this;this.emit("beforeProcess");var a=this.graph,i=this.settings,l=this.getDimensions();if(this.nodeExtent=UX(this.graph),!this.settings.autoRescale){var u=l.width,c=l.height,f=this.nodeExtent,p=f.x,g=f.y;this.nodeExtent={x:[(p[0]+p[1])/2-u/2,(p[0]+p[1])/2+u/2],y:[(g[0]+g[1])/2-c/2,(g[0]+g[1])/2+c/2]}}this.normalizationFunction=pC(this.customBBox||this.nodeExtent);var b=new hC,m=Ps(b.getState(),l,this.getGraphDimensions(),this.getStagePadding());this.labelGrid.resizeAndClear(l,i.labelGridCellSize);for(var S={},v={},A={},R={},x=1,_=a.nodes(),C=0,N=_.length;C1&&arguments[1]!==void 0?arguments[1]:{},i=a.tolerance,l=i===void 0?0:i,u=a.boundaries,c=Be({},r),f=u||this.nodeExtent,p=vl(f.x,2),g=p[0],b=p[1],m=vl(f.y,2),S=m[0],v=m[1],A=[this.graphToViewport({x:g,y:S},{cameraState:r}),this.graphToViewport({x:b,y:S},{cameraState:r}),this.graphToViewport({x:g,y:v},{cameraState:r}),this.graphToViewport({x:b,y:v},{cameraState:r})],R=1/0,x=-1/0,_=1/0,C=-1/0;A.forEach(function(W){var Z=W.x,j=W.y;R=Math.min(R,Z),x=Math.max(x,Z),_=Math.min(_,j),C=Math.max(C,j)});var N=x-R,T=C-_,O=this.getDimensions(),z=O.width,I=O.height,M=0,H=0;if(N>=z?xl&&(M=R-l):x>z+l?M=x-(z+l):R<-l&&(M=R+l),T>=I?Cl&&(H=_-l):C>I+l?H=C-(I+l):_<-l&&(H=_+l),M||H){var q=this.viewportToFramedGraph({x:0,y:0},{cameraState:r}),U=this.viewportToFramedGraph({x:M,y:H},{cameraState:r});M=U.x-q.x,H=U.y-q.y,c.x+=M,c.y+=H}return c}},{key:"renderLabels",value:function(){if(!this.settings.renderLabels)return this;var r=this.camera.getState(),a=this.labelGrid.getLabelsToDisplay(r.ratio,this.settings.labelDensity);gC(a,this.nodesWithForcedLabels),this.displayedNodeLabels=new Set;for(var i=this.canvasContexts.labels,l=0,u=a.length;lthis.width+oZ||b<-50||b>this.height+iZ)){this.displayedNodeLabels.add(c);var S=this.settings.defaultDrawNodeLabel,v=this.nodePrograms[f.type],A=(v==null?void 0:v.drawLabel)||S;A(i,Be(Be({key:c},f),{},{size:m,x:g,y:b}),this.settings)}}}return this}},{key:"renderEdgeLabels",value:function(){if(!this.settings.renderEdgeLabels)return this;var r=this.canvasContexts.edgeLabels;r.clearRect(0,0,this.width,this.height);var a=aZ({graph:this.graph,hoveredNode:this.hoveredNode,displayedNodeLabels:this.displayedNodeLabels,highlightedNodes:this.highlightedNodes});gC(a,this.edgesWithForcedLabels);for(var i=new Set,l=0,u=a.length;lthis.nodeZExtent[1]&&(this.nodeZExtent[1]=i.zIndex))}},{key:"updateNode",value:function(r){this.addNode(r);var a=this.nodeDataCache[r];this.normalizationFunction.applyTo(a)}},{key:"removeNode",value:function(r){delete this.nodeDataCache[r],delete this.nodeProgramIndex[r],this.highlightedNodes.delete(r),this.hoveredNode===r&&(this.hoveredNode=null),this.nodesWithForcedLabels.delete(r)}},{key:"addEdge",value:function(r){var a=Object.assign({},this.graph.getEdgeAttributes(r));this.settings.edgeReducer&&(a=this.settings.edgeReducer(r,a));var i=sZ(this.settings,r,a);this.edgeDataCache[r]=i,this.edgesWithForcedLabels.delete(r),i.forceLabel&&!i.hidden&&this.edgesWithForcedLabels.add(r),this.settings.zIndex&&(i.zIndex
=0;)m=Xg(e,t,n,r,d+1,o+1,s),m>p&&(d===i?m*=WS:ZU.test(e.charAt(d-1))?(m*=YU,g=e.slice(i,d-1).match(QU),g&&i>0&&(m*=Math.pow(Fm,g.length))):JU.test(e.charAt(d-1))?(m*=qU,w=e.slice(i,d-1).match(HA),w&&i>0&&(m*=Math.pow(Fm,w.length))):(m*=WU,i>0&&(m*=Math.pow(Fm,d-i))),e.charAt(d)!==t.charAt(o)&&(m*=XU)),(mm&&(m=v*Pm)),m>p&&(p=m),d=n.indexOf(f,d+1);return s[u]=p,p}function XS(e){return e.toLowerCase().replace(HA," ")}function e6(e,t,n){return e=n&&n.length>0?`${e+" "+n.join(" ")}`:e,Xg(e,t,XS(e),XS(t),0,0,{})}var Im={exports:{}},Gm={};/** - * @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 KS;function t6(){if(KS)return Gm;KS=1;var e=$f();function t(m,v){return m===v&&(m!==0||1/m===1/v)||m!==m&&v!==v}var n=typeof Object.is=="function"?Object.is:t,r=e.useState,i=e.useEffect,o=e.useLayoutEffect,s=e.useDebugValue;function u(m,v){var g=v(),w=r({inst:{value:g,getSnapshot:v}}),x=w[0].inst,k=w[1];return o(function(){x.value=g,x.getSnapshot=v,f(x)&&k({inst:x})},[m,g,v]),i(function(){return f(x)&&k({inst:x}),m(function(){f(x)&&k({inst:x})})},[m]),s(g),g}function f(m){var v=m.getSnapshot;m=m.value;try{var g=v();return!n(m,g)}catch{return!0}}function d(m,v){return v()}var p=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?d:u;return Gm.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:p,Gm}var ZS;function n6(){return ZS||(ZS=1,Im.exports=t6()),Im.exports}var r6=n6(),zs='[cmdk-group=""]',Bm='[cmdk-group-items=""]',i6='[cmdk-group-heading=""]',_y='[cmdk-item=""]',QS=`${_y}:not([aria-disabled="true"])`,Kg="cmdk-item-select",Ha="data-value",a6=(e,t,n)=>e6(e,t,n),$A=E.createContext(void 0),mu=()=>E.useContext($A),VA=E.createContext(void 0),ky=()=>E.useContext(VA),qA=E.createContext(void 0),YA=E.forwardRef((e,t)=>{let n=Qo(()=>{var M,O;return{search:"",value:(O=(M=e.value)!=null?M:e.defaultValue)!=null?O:"",filtered:{count:0,items:new Map,groups:new Set}}}),r=Qo(()=>new Set),i=Qo(()=>new Map),o=Qo(()=>new Map),s=Qo(()=>new Set),u=WA(e),{label:f,children:d,value:p,onValueChange:m,filter:v,shouldFilter:g,loop:w,disablePointerSelection:x=!1,vimBindings:k=!0,...C}=e,_=bn(),T=bn(),N=bn(),D=E.useRef(null),z=g6();Qa(()=>{if(p!==void 0){let M=p.trim();n.current.value=M,R.emit()}},[p]),Qa(()=>{z(6,I)},[]);let R=E.useMemo(()=>({subscribe:M=>(s.current.add(M),()=>s.current.delete(M)),snapshot:()=>n.current,setState:(M,O,X)=>{var re,ue,ae;if(!Object.is(n.current[M],O)){if(n.current[M]=O,M==="search")q(),j(),z(1,V);else if(M==="value"&&(X||z(5,I),((re=u.current)==null?void 0:re.value)!==void 0)){let oe=O??"";(ae=(ue=u.current).onValueChange)==null||ae.call(ue,oe);return}R.emit()}},emit:()=>{s.current.forEach(M=>M())}}),[]),B=E.useMemo(()=>({value:(M,O,X)=>{var re;O!==((re=o.current.get(M))==null?void 0:re.value)&&(o.current.set(M,{value:O,keywords:X}),n.current.filtered.items.set(M,P(O,X)),z(2,()=>{j(),R.emit()}))},item:(M,O)=>(r.current.add(M),O&&(i.current.has(O)?i.current.get(O).add(M):i.current.set(O,new Set([M]))),z(3,()=>{q(),j(),n.current.value||V(),R.emit()}),()=>{o.current.delete(M),r.current.delete(M),n.current.filtered.items.delete(M);let X=Y();z(4,()=>{q(),(X==null?void 0:X.getAttribute("id"))===M&&V(),R.emit()})}),group:M=>(i.current.has(M)||i.current.set(M,new Set),()=>{o.current.delete(M),i.current.delete(M)}),filter:()=>u.current.shouldFilter,label:f||e["aria-label"],getDisablePointerSelection:()=>u.current.disablePointerSelection,listId:_,inputId:N,labelId:T,listInnerRef:D}),[]);function P(M,O){var X,re;let ue=(re=(X=u.current)==null?void 0:X.filter)!=null?re:a6;return M?ue(M,n.current.search,O):0}function j(){if(!n.current.search||u.current.shouldFilter===!1)return;let M=n.current.filtered.items,O=[];n.current.filtered.groups.forEach(re=>{let ue=i.current.get(re),ae=0;ue.forEach(oe=>{let Ce=M.get(oe);ae=Math.max(Ce,ae)}),O.push([re,ae])});let X=D.current;Z().sort((re,ue)=>{var ae,oe;let Ce=re.getAttribute("id"),he=ue.getAttribute("id");return((ae=M.get(he))!=null?ae:0)-((oe=M.get(Ce))!=null?oe:0)}).forEach(re=>{let ue=re.closest(Bm);ue?ue.appendChild(re.parentElement===ue?re:re.closest(`${Bm} > *`)):X.appendChild(re.parentElement===X?re:re.closest(`${Bm} > *`))}),O.sort((re,ue)=>ue[1]-re[1]).forEach(re=>{var ue;let ae=(ue=D.current)==null?void 0:ue.querySelector(`${zs}[${Ha}="${encodeURIComponent(re[0])}"]`);ae==null||ae.parentElement.appendChild(ae)})}function V(){let M=Z().find(X=>X.getAttribute("aria-disabled")!=="true"),O=M==null?void 0:M.getAttribute(Ha);R.setState("value",O||void 0)}function q(){var M,O,X,re;if(!n.current.search||u.current.shouldFilter===!1){n.current.filtered.count=r.current.size;return}n.current.filtered.groups=new Set;let ue=0;for(let ae of r.current){let oe=(O=(M=o.current.get(ae))==null?void 0:M.value)!=null?O:"",Ce=(re=(X=o.current.get(ae))==null?void 0:X.keywords)!=null?re:[],he=P(oe,Ce);n.current.filtered.items.set(ae,he),he>0&&ue++}for(let[ae,oe]of i.current)for(let Ce of oe)if(n.current.filtered.items.get(Ce)>0){n.current.filtered.groups.add(ae);break}n.current.filtered.count=ue}function I(){var M,O,X;let re=Y();re&&(((M=re.parentElement)==null?void 0:M.firstChild)===re&&((X=(O=re.closest(zs))==null?void 0:O.querySelector(i6))==null||X.scrollIntoView({block:"nearest"})),re.scrollIntoView({block:"nearest"}))}function Y(){var M;return(M=D.current)==null?void 0:M.querySelector(`${_y}[aria-selected="true"]`)}function Z(){var M;return Array.from(((M=D.current)==null?void 0:M.querySelectorAll(QS))||[])}function U(M){let O=Z()[M];O&&R.setState("value",O.getAttribute(Ha))}function G(M){var O;let X=Y(),re=Z(),ue=re.findIndex(oe=>oe===X),ae=re[ue+M];(O=u.current)!=null&&O.loop&&(ae=ue+M<0?re[re.length-1]:ue+M===re.length?re[0]:re[ue+M]),ae&&R.setState("value",ae.getAttribute(Ha))}function F(M){let O=Y(),X=O==null?void 0:O.closest(zs),re;for(;X&&!re;)X=M>0?p6(X,zs):m6(X,zs),re=X==null?void 0:X.querySelector(QS);re?R.setState("value",re.getAttribute(Ha)):G(M)}let K=()=>U(Z().length-1),A=M=>{M.preventDefault(),M.metaKey?K():M.altKey?F(1):G(1)},$=M=>{M.preventDefault(),M.metaKey?U(0):M.altKey?F(-1):G(-1)};return E.createElement(We.div,{ref:t,tabIndex:-1,...C,"cmdk-root":"",onKeyDown:M=>{var O;if((O=C.onKeyDown)==null||O.call(C,M),!M.defaultPrevented)switch(M.key){case"n":case"j":{k&&M.ctrlKey&&A(M);break}case"ArrowDown":{A(M);break}case"p":case"k":{k&&M.ctrlKey&&$(M);break}case"ArrowUp":{$(M);break}case"Home":{M.preventDefault(),U(0);break}case"End":{M.preventDefault(),K();break}case"Enter":if(!M.nativeEvent.isComposing&&M.keyCode!==229){M.preventDefault();let X=Y();if(X){let re=new Event(Kg);X.dispatchEvent(re)}}}}},E.createElement("label",{"cmdk-label":"",htmlFor:B.inputId,id:B.labelId,style:y6},f),vd(e,M=>E.createElement(VA.Provider,{value:R},E.createElement($A.Provider,{value:B},M))))}),o6=E.forwardRef((e,t)=>{var n,r;let i=bn(),o=E.useRef(null),s=E.useContext(qA),u=mu(),f=WA(e),d=(r=(n=f.current)==null?void 0:n.forceMount)!=null?r:s==null?void 0:s.forceMount;Qa(()=>{if(!d)return u.item(i,s==null?void 0:s.id)},[d]);let p=XA(i,o,[e.value,e.children,o],e.keywords),m=ky(),v=Ja(z=>z.value&&z.value===p.current),g=Ja(z=>d||u.filter()===!1?!0:z.search?z.filtered.items.get(i)>0:!0);E.useEffect(()=>{let z=o.current;if(!(!z||e.disabled))return z.addEventListener(Kg,w),()=>z.removeEventListener(Kg,w)},[g,e.onSelect,e.disabled]);function w(){var z,R;x(),(R=(z=f.current).onSelect)==null||R.call(z,p.current)}function x(){m.setState("value",p.current,!0)}if(!g)return null;let{disabled:k,value:C,onSelect:_,forceMount:T,keywords:N,...D}=e;return E.createElement(We.div,{ref:Xs([o,t]),...D,id:i,"cmdk-item":"",role:"option","aria-disabled":!!k,"aria-selected":!!v,"data-disabled":!!k,"data-selected":!!v,onPointerMove:k||u.getDisablePointerSelection()?void 0:x,onClick:k?void 0:w},e.children)}),l6=E.forwardRef((e,t)=>{let{heading:n,children:r,forceMount:i,...o}=e,s=bn(),u=E.useRef(null),f=E.useRef(null),d=bn(),p=mu(),m=Ja(g=>i||p.filter()===!1?!0:g.search?g.filtered.groups.has(s):!0);Qa(()=>p.group(s),[]),XA(s,u,[e.value,e.heading,f]);let v=E.useMemo(()=>({id:s,forceMount:i}),[i]);return E.createElement(We.div,{ref:Xs([u,t]),...o,"cmdk-group":"",role:"presentation",hidden:m?void 0:!0},n&&E.createElement("div",{ref:f,"cmdk-group-heading":"","aria-hidden":!0,id:d},n),vd(e,g=>E.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?d:void 0},E.createElement(qA.Provider,{value:v},g))))}),s6=E.forwardRef((e,t)=>{let{alwaysRender:n,...r}=e,i=E.useRef(null),o=Ja(s=>!s.search);return!n&&!o?null:E.createElement(We.div,{ref:Xs([i,t]),...r,"cmdk-separator":"",role:"separator"})}),u6=E.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,i=e.value!=null,o=ky(),s=Ja(p=>p.search),u=Ja(p=>p.value),f=mu(),d=E.useMemo(()=>{var p;let m=(p=f.listInnerRef.current)==null?void 0:p.querySelector(`${_y}[${Ha}="${encodeURIComponent(u)}"]`);return m==null?void 0:m.getAttribute("id")},[]);return E.useEffect(()=>{e.value!=null&&o.setState("search",e.value)},[e.value]),E.createElement(We.input,{ref:t,...r,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":f.listId,"aria-labelledby":f.labelId,"aria-activedescendant":d,id:f.inputId,type:"text",value:i?e.value:s,onChange:p=>{i||o.setState("search",p.target.value),n==null||n(p.target.value)}})}),c6=E.forwardRef((e,t)=>{let{children:n,label:r="Suggestions",...i}=e,o=E.useRef(null),s=E.useRef(null),u=mu();return E.useEffect(()=>{if(s.current&&o.current){let f=s.current,d=o.current,p,m=new ResizeObserver(()=>{p=requestAnimationFrame(()=>{let v=f.offsetHeight;d.style.setProperty("--cmdk-list-height",v.toFixed(1)+"px")})});return m.observe(f),()=>{cancelAnimationFrame(p),m.unobserve(f)}}},[]),E.createElement(We.div,{ref:Xs([o,t]),...i,"cmdk-list":"",role:"listbox","aria-label":r,id:u.listId},vd(e,f=>E.createElement("div",{ref:Xs([s,u.listInnerRef]),"cmdk-list-sizer":""},f)))}),f6=E.forwardRef((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:i,contentClassName:o,container:s,...u}=e;return E.createElement(Uv,{open:n,onOpenChange:r},E.createElement(Hv,{container:s},E.createElement(td,{"cmdk-overlay":"",className:i}),E.createElement(nd,{"aria-label":e.label,"cmdk-dialog":"",className:o},E.createElement(YA,{ref:t,...u}))))}),d6=E.forwardRef((e,t)=>Ja(n=>n.filtered.count===0)?E.createElement(We.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),h6=E.forwardRef((e,t)=>{let{progress:n,children:r,label:i="Loading...",...o}=e;return E.createElement(We.div,{ref:t,...o,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":i},vd(e,s=>E.createElement("div",{"aria-hidden":!0},s)))}),In=Object.assign(YA,{List:c6,Item:o6,Input:u6,Group:l6,Separator:s6,Dialog:f6,Empty:d6,Loading:h6});function p6(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function m6(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function WA(e){let t=E.useRef(e);return Qa(()=>{t.current=e}),t}var Qa=typeof window>"u"?E.useEffect:E.useLayoutEffect;function Qo(e){let t=E.useRef();return t.current===void 0&&(t.current=e()),t}function Xs(e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}function Ja(e){let t=ky(),n=()=>e(t.snapshot());return r6.useSyncExternalStore(t.subscribe,n,n)}function XA(e,t,n,r=[]){let i=E.useRef(),o=mu();return Qa(()=>{var s;let u=(()=>{var d;for(let p of n){if(typeof p=="string")return p.trim();if(typeof p=="object"&&"current"in p)return p.current?(d=p.current.textContent)==null?void 0:d.trim():i.current}})(),f=r.map(d=>d.trim());o.value(e,u,f),(s=t.current)==null||s.setAttribute(Ha,u),i.current=u}),i}var g6=()=>{let[e,t]=E.useState(),n=Qo(()=>new Map);return Qa(()=>{n.current.forEach(r=>r()),n.current=new Map},[e]),(r,i)=>{n.current.set(r,i),t({})}};function v6(e){let t=e.type;return typeof t=="function"?t(e.props):"render"in t?t.render(e.props):e}function vd({asChild:e,children:t},n){return e&&E.isValidElement(t)?E.cloneElement(v6(t),{ref:t.ref},n(t.props.children)):n(t)}var y6={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};const KA=Uv,ZA=eC,b6=Hv,QA=E.forwardRef(({className:e,...t},n)=>S.jsx(td,{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}));QA.displayName=td.displayName;const Cy=E.forwardRef(({className:e,children:t,...n},r)=>S.jsxs(b6,{children:[S.jsx(QA,{}),S.jsxs(nd,{ref:r,className:Me("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-top-[48%] fixed top-[50%] left-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border p-6 shadow-lg duration-200 sm:rounded-lg",e),...n,children:[t,S.jsxs(qv,{className:"ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-sm opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-none disabled:pointer-events-none",children:[S.jsx(Ek,{className:"h-4 w-4"}),S.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));Cy.displayName=nd.displayName;const Ty=({className:e,...t})=>S.jsx("div",{className:Me("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});Ty.displayName="DialogHeader";const Ay=E.forwardRef(({className:e,...t},n)=>S.jsx($v,{ref:n,className:Me("text-lg leading-none font-semibold tracking-tight",e),...t}));Ay.displayName=$v.displayName;const Ry=E.forwardRef(({className:e,...t},n)=>S.jsx(Vv,{ref:n,className:Me("text-muted-foreground text-sm",e),...t}));Ry.displayName=Vv.displayName;const yd=E.forwardRef(({className:e,...t},n)=>S.jsx(In,{ref:n,className:Me("bg-popover text-popover-foreground flex h-full w-full flex-col overflow-hidden rounded-md",e),...t}));yd.displayName=In.displayName;const Dy=E.forwardRef(({className:e,...t},n)=>S.jsxs("div",{className:"flex items-center border-b px-3","cmdk-input-wrapper":"",children:[S.jsx(XM,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),S.jsx(In.Input,{ref:n,className:Me("placeholder:text-muted-foreground flex h-11 w-full rounded-md bg-transparent py-3 text-sm outline-none disabled:cursor-not-allowed disabled:opacity-50",e),...t})]}));Dy.displayName=In.Input.displayName;const bd=E.forwardRef(({className:e,...t},n)=>S.jsx(In.List,{ref:n,className:Me("max-h-[300px] overflow-x-hidden overflow-y-auto",e),...t}));bd.displayName=In.List.displayName;const Ny=E.forwardRef((e,t)=>S.jsx(In.Empty,{ref:t,className:"py-6 text-center text-sm",...e}));Ny.displayName=In.Empty.displayName;const Cl=E.forwardRef(({className:e,...t},n)=>S.jsx(In.Group,{ref:n,className:Me("text-foreground [&_[cmdk-group-heading]]:text-muted-foreground overflow-hidden p-1 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium",e),...t}));Cl.displayName=In.Group.displayName;const x6=E.forwardRef(({className:e,...t},n)=>S.jsx(In.Separator,{ref:n,className:Me("bg-border -mx-1 h-px",e),...t}));x6.displayName=In.Separator.displayName;const Tl=E.forwardRef(({className:e,...t},n)=>S.jsx(In.Item,{ref:n,className:Me("data-[selected='true']:bg-accent data-[selected=true]:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",e),...t}));Tl.displayName=In.Item.displayName;const w6=({layout:e,autoRunFor:t})=>{const n=pr(),{stop:r,start:i,isRunning:o}=e;return E.useEffect(()=>{if(!n)return;let s=null;return t!==void 0&&t>-1&&n.getGraph().order>0&&(i(),s=t>0?window.setTimeout(()=>{r()},t):null),()=>{r(),s&&clearTimeout(s)}},[t,i,r,n]),S.jsx(Ot,{size:"icon",onClick:()=>o?r():i(),tooltip:o?"Stop the layout animation":"Start the layout animation",variant:Hr,children:o?S.jsx(HM,{}):S.jsx(VM,{})})},S6=()=>{const e=pr(),[t,n]=E.useState("Circular"),[r,i]=E.useState(!1),o=pU(),s=cU(),u=VU(),f=GU({settings:{margin:1}}),d=wU({maxIterations:20}),p=GA({iterations:20}),m=BU(),v=SU(),g=NU(),w=E.useMemo(()=>({Circular:{layout:o},Circlepack:{layout:s},Random:{layout:u},Noverlaps:{layout:f,worker:m},"Force Directed":{layout:d,worker:v},"Force Atlas":{layout:p,worker:g}}),[s,o,d,p,f,u,v,m,g]),x=E.useCallback(k=>{console.debug(k);const{positions:C}=w[k].layout;RG(e.getGraph(),C(),{duration:500}),n(k)},[w,e]);return S.jsxs(S.Fragment,{children:[S.jsx("div",{children:w[t]&&"worker"in w[t]&&S.jsx(w6,{layout:w[t].worker})}),S.jsx("div",{children:S.jsxs(fd,{open:r,onOpenChange:i,children:[S.jsx(dd,{asChild:!0,children:S.jsx(Ot,{size:"icon",variant:Hr,onClick:()=>i(k=>!k),tooltip:"Layout Graph",children:S.jsx(OM,{})})}),S.jsx(uu,{side:"right",align:"center",className:"p-1",children:S.jsx(yd,{children:S.jsx(bd,{children:S.jsx(Cl,{children:Object.keys(w).map(k=>S.jsx(Tl,{onSelect:()=>{x(k)},className:"cursor-pointer text-xs",children:k},k))})})})})]})})]})};var cf={exports:{}},E6=cf.exports,JS;function _6(){return JS||(JS=1,function(e){(function(t,n,r){function i(f){var d=this,p=u();d.next=function(){var m=2091639*d.s0+d.c*23283064365386963e-26;return d.s0=d.s1,d.s1=d.s2,d.s2=m-(d.c=m|0)},d.c=1,d.s0=p(" "),d.s1=p(" "),d.s2=p(" "),d.s0-=p(f),d.s0<0&&(d.s0+=1),d.s1-=p(f),d.s1<0&&(d.s1+=1),d.s2-=p(f),d.s2<0&&(d.s2+=1),p=null}function o(f,d){return d.c=f.c,d.s0=f.s0,d.s1=f.s1,d.s2=f.s2,d}function s(f,d){var p=new i(f),m=d&&d.state,v=p.next;return v.int32=function(){return p.next()*4294967296|0},v.double=function(){return v()+(v()*2097152|0)*11102230246251565e-32},v.quick=v,m&&(typeof m=="object"&&o(m,p),v.state=function(){return o(p,{})}),v}function u(){var f=4022871197,d=function(p){p=String(p);for(var m=0;m>>0,v-=f,v*=f,f=v>>>0,v-=f,f+=v*4294967296}return(f>>>0)*23283064365386963e-26};return d}n&&n.exports?n.exports=s:this.alea=s})(E6,e)}(cf)),cf.exports}var ff={exports:{}},k6=ff.exports,eE;function C6(){return eE||(eE=1,function(e){(function(t,n,r){function i(u){var f=this,d="";f.x=0,f.y=0,f.z=0,f.w=0,f.next=function(){var m=f.x^f.x<<11;return f.x=f.y,f.y=f.z,f.z=f.w,f.w^=f.w>>>19^m^m>>>8},u===(u|0)?f.x=u:d+=u;for(var p=0;p>>0)/4294967296};return m.double=function(){do var v=d.next()>>>11,g=(d.next()>>>0)/4294967296,w=(v+g)/(1<<21);while(w===0);return w},m.int32=d.next,m.quick=m,p&&(typeof p=="object"&&o(p,d),m.state=function(){return o(d,{})}),m}n&&n.exports?n.exports=s:this.xor128=s})(k6,e)}(ff)),ff.exports}var df={exports:{}},T6=df.exports,tE;function A6(){return tE||(tE=1,function(e){(function(t,n,r){function i(u){var f=this,d="";f.next=function(){var m=f.x^f.x>>>2;return f.x=f.y,f.y=f.z,f.z=f.w,f.w=f.v,(f.d=f.d+362437|0)+(f.v=f.v^f.v<<4^(m^m<<1))|0},f.x=0,f.y=0,f.z=0,f.w=0,f.v=0,u===(u|0)?f.x=u:d+=u;for(var p=0;p>>4),f.next()}function o(u,f){return f.x=u.x,f.y=u.y,f.z=u.z,f.w=u.w,f.v=u.v,f.d=u.d,f}function s(u,f){var d=new i(u),p=f&&f.state,m=function(){return(d.next()>>>0)/4294967296};return m.double=function(){do var v=d.next()>>>11,g=(d.next()>>>0)/4294967296,w=(v+g)/(1<<21);while(w===0);return w},m.int32=d.next,m.quick=m,p&&(typeof p=="object"&&o(p,d),m.state=function(){return o(d,{})}),m}n&&n.exports?n.exports=s:this.xorwow=s})(T6,e)}(df)),df.exports}var hf={exports:{}},R6=hf.exports,nE;function D6(){return nE||(nE=1,function(e){(function(t,n,r){function i(u){var f=this;f.next=function(){var p=f.x,m=f.i,v,g;return v=p[m],v^=v>>>7,g=v^v<<24,v=p[m+1&7],g^=v^v>>>10,v=p[m+3&7],g^=v^v>>>3,v=p[m+4&7],g^=v^v<<7,v=p[m+7&7],v=v^v<<13,g^=v^v<<9,p[m]=g,f.i=m+1&7,g};function d(p,m){var v,g=[];if(m===(m|0))g[0]=m;else for(m=""+m,v=0;v0;--v)p.next()}d(f,u)}function o(u,f){return f.x=u.x.slice(),f.i=u.i,f}function s(u,f){u==null&&(u=+new Date);var d=new i(u),p=f&&f.state,m=function(){return(d.next()>>>0)/4294967296};return m.double=function(){do var v=d.next()>>>11,g=(d.next()>>>0)/4294967296,w=(v+g)/(1<<21);while(w===0);return w},m.int32=d.next,m.quick=m,p&&(p.x&&o(p,d),m.state=function(){return o(d,{})}),m}n&&n.exports?n.exports=s:this.xorshift7=s})(R6,e)}(hf)),hf.exports}var pf={exports:{}},N6=pf.exports,rE;function O6(){return rE||(rE=1,function(e){(function(t,n,r){function i(u){var f=this;f.next=function(){var p=f.w,m=f.X,v=f.i,g,w;return f.w=p=p+1640531527|0,w=m[v+34&127],g=m[v=v+1&127],w^=w<<13,g^=g<<17,w^=w>>>15,g^=g>>>12,w=m[v]=w^g,f.i=v,w+(p^p>>>16)|0};function d(p,m){var v,g,w,x,k,C=[],_=128;for(m===(m|0)?(g=m,m=null):(m=m+"\0",g=0,_=Math.max(_,m.length)),w=0,x=-32;x<_;++x)m&&(g^=m.charCodeAt((x+32)%m.length)),x===0&&(k=g),g^=g<<10,g^=g>>>15,g^=g<<4,g^=g>>>13,x>=0&&(k=k+1640531527|0,v=C[x&127]^=g+k,w=v==0?w+1:0);for(w>=128&&(C[(m&&m.length||0)&127]=-1),w=127,x=4*128;x>0;--x)g=C[w+34&127],v=C[w=w+1&127],g^=g<<13,v^=v<<17,g^=g>>>15,v^=v>>>12,C[w]=g^v;p.w=k,p.X=C,p.i=w}d(f,u)}function o(u,f){return f.i=u.i,f.w=u.w,f.X=u.X.slice(),f}function s(u,f){u==null&&(u=+new Date);var d=new i(u),p=f&&f.state,m=function(){return(d.next()>>>0)/4294967296};return m.double=function(){do var v=d.next()>>>11,g=(d.next()>>>0)/4294967296,w=(v+g)/(1<<21);while(w===0);return w},m.int32=d.next,m.quick=m,p&&(p.X&&o(p,d),m.state=function(){return o(d,{})}),m}n&&n.exports?n.exports=s:this.xor4096=s})(N6,e)}(pf)),pf.exports}var mf={exports:{}},L6=mf.exports,iE;function z6(){return iE||(iE=1,function(e){(function(t,n,r){function i(u){var f=this,d="";f.next=function(){var m=f.b,v=f.c,g=f.d,w=f.a;return m=m<<25^m>>>7^v,v=v-g|0,g=g<<24^g>>>8^w,w=w-m|0,f.b=m=m<<20^m>>>12^v,f.c=v=v-g|0,f.d=g<<16^v>>>16^w,f.a=w-m|0},f.a=0,f.b=0,f.c=-1640531527,f.d=1367130551,u===Math.floor(u)?(f.a=u/4294967296|0,f.b=u|0):d+=u;for(var p=0;p>>0)/4294967296};return m.double=function(){do var v=d.next()>>>11,g=(d.next()>>>0)/4294967296,w=(v+g)/(1<<21);while(w===0);return w},m.int32=d.next,m.quick=m,p&&(typeof p=="object"&&o(p,d),m.state=function(){return o(d,{})}),m}n&&n.exports?n.exports=s:this.tychei=s})(L6,e)}(mf)),mf.exports}var gf={exports:{}};const j6={},M6=Object.freeze(Object.defineProperty({__proto__:null,default:j6},Symbol.toStringTag,{value:"Module"})),P6=lL(M6);var F6=gf.exports,aE;function I6(){return aE||(aE=1,function(e){(function(t,n,r){var i=256,o=6,s=52,u="random",f=r.pow(i,o),d=r.pow(2,s),p=d*2,m=i-1,v;function g(N,D,z){var R=[];D=D==!0?{entropy:!0}:D||{};var B=C(k(D.entropy?[N,T(n)]:N??_(),3),R),P=new w(R),j=function(){for(var V=P.g(o),q=f,I=0;V=p;)V/=2,q/=2,I>>>=1;return(V+I)/q};return j.int32=function(){return P.g(4)|0},j.quick=function(){return P.g(4)/4294967296},j.double=j,C(T(P.S),n),(D.pass||z||function(V,q,I,Y){return Y&&(Y.S&&x(Y,P),V.state=function(){return x(P,{})}),I?(r[u]=V,q):V})(j,B,"global"in D?D.global:this==r,D.state)}function w(N){var D,z=N.length,R=this,B=0,P=R.i=R.j=0,j=R.S=[];for(z||(N=[z++]);B{if(!e||!Array.isArray(e.nodes)||!Array.isArray(e.edges))return!1;for(const t of e.nodes)if(!t.id||!t.labels||!t.properties)return!1;for(const t of e.edges)if(!t.id||!t.source||!t.target)return!1;for(const t of e.edges){const n=e.getNode(t.source),r=e.getNode(t.target);if(n==null||r==null)return!1}return!0},$6=async e=>{let t=null;try{t=await nM(e)}catch(r){return Mn.getState().setErrorMessage(Cr(r),"Query Graphs Error!"),null}let n=null;if(t){const r={},i={};for(let f=0;f0){const f=bz-Qw;for(const d of t.nodes)d.size=Math.round(Qw+f*Math.pow((d.degree-o)/u,.5))}n=new nU,n.nodes=t.nodes,n.edges=t.edges,n.nodeIdMap=r,n.edgeIdMap=i,H6(n)||(n=null,console.error("Invalid graph data")),console.log("Graph data loaded")}return n},V6=e=>{const t=new Ws;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:mz,borderSize:.2});for(const n of(e==null?void 0:e.edges)??[])n.dynamicId=t.addDirectedEdge(n.source,n.target,{label:n.type||void 0});return t},lE={label:""},JA=()=>{const e=Qe.use.queryLabel(),t=yt.use.rawGraph(),n=yt.use.sigmaGraph(),r=E.useCallback(s=>(t==null?void 0:t.getNode(s))||null,[t]),i=E.useCallback((s,u=!0)=>(t==null?void 0:t.getEdge(s,u))||null,[t]);return E.useEffect(()=>{if(e){if(lE.label!==e){lE.label=e;const s=yt.getState();s.reset(),$6(e).then(u=>{s.setSigmaGraph(V6(u)),u==null||u.buildDynamicMap(),s.setRawGraph(u)})}}else{const s=yt.getState();s.reset(),s.setSigmaGraph(new Ws)}},[e]),{lightrageGraph:E.useCallback(()=>{if(n)return n;const s=new Ws;return yt.getState().setSigmaGraph(s),s},[n]),getNode:r,getEdge:i}},Vc=e=>!!(e.type.startsWith("mouse")&&e.buttons!==0),q6=({disableHoverEffect:e})=>{const{lightrageGraph:t}=JA(),n=pr(),r=bA(),i=yA(),o=rB(),{assign:s}=GA({iterations:20}),{theme:u}=hT(),f=Qe.use.enableHideUnselectedEdges(),d=yt.use.selectedNode(),p=yt.use.focusedNode(),m=yt.use.selectedEdge(),v=yt.use.focusedEdge();return E.useEffect(()=>{const g=t();o(g),g.__force_applied||(s(),Object.assign(g,{__force_applied:!0}));const{setFocusedNode:w,setSelectedNode:x,setFocusedEdge:k,setSelectedEdge:C,clearSelection:_}=yt.getState();r({enterNode:T=>{Vc(T.event.original)||w(T.node)},leaveNode:T=>{Vc(T.event.original)||w(null)},clickNode:T=>{x(T.node),C(null)},clickEdge:T=>{C(T.edge),x(null)},enterEdge:T=>{Vc(T.event.original)||k(T.edge)},leaveEdge:T=>{Vc(T.event.original)||k(null)},clickStage:()=>_()})},[s,o,r,t]),E.useEffect(()=>{const g=u==="dark",w=g?dz:void 0,x=g?vz:void 0;i({nodeReducer:(k,C)=>{const _=n.getGraph(),T={...C,highlighted:C.highlighted||!1,labelColor:w};if(!e){T.highlighted=!1;const N=p||d,D=v||m;if(N)(k===N||_.neighbors(N).includes(k))&&(T.highlighted=!0,k===d&&(T.borderColor=gz));else if(D)_.extremities(D).includes(k)&&(T.highlighted=!0,T.size=3);else return T;T.highlighted?g&&(T.labelColor=hz):T.color=pz}return T},edgeReducer:(k,C)=>{const _=n.getGraph(),T={...C,hidden:!1,labelColor:w,color:x};if(!e){const N=p||d;N?f?_.extremities(k).includes(N)||(T.hidden=!0):_.extremities(k).includes(N)&&(T.color=Zw):(v||m)&&(k===m?T.color=yz:k===v?T.color=Zw:f&&(T.hidden=!0))}return T}})},[d,p,m,v,i,n,e,u,f]),null},Y6=()=>{const{zoomIn:e,zoomOut:t,reset:n}=xA({duration:200,factor:1.5}),r=E.useCallback(()=>e(),[e]),i=E.useCallback(()=>t(),[t]),o=E.useCallback(()=>n(),[n]);return S.jsxs(S.Fragment,{children:[S.jsx(Ot,{variant:Hr,onClick:r,tooltip:"Zoom In",size:"icon",children:S.jsx(lP,{})}),S.jsx(Ot,{variant:Hr,onClick:i,tooltip:"Zoom Out",size:"icon",children:S.jsx(uP,{})}),S.jsx(Ot,{variant:Hr,onClick:o,tooltip:"Reset Zoom",size:"icon",children:S.jsx(AM,{})})]})},W6=()=>{const{isFullScreen:e,toggle:t}=iB();return S.jsx(S.Fragment,{children:e?S.jsx(Ot,{variant:Hr,onClick:t,tooltip:"Windowed",size:"icon",children:S.jsx(IM,{})}):S.jsx(Ot,{variant:Hr,onClick:t,tooltip:"Full Screen",size:"icon",children:S.jsx(PM,{})})})};function eR(e){const t=E.useRef({value:e,previous:e});return E.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var Oy="Checkbox",[X6,pK]=hr(Oy),[K6,Z6]=X6(Oy),tR=E.forwardRef((e,t)=>{const{__scopeCheckbox:n,name:r,checked:i,defaultChecked:o,required:s,disabled:u,value:f="on",onCheckedChange:d,form:p,...m}=e,[v,g]=E.useState(null),w=dt(t,N=>g(N)),x=E.useRef(!1),k=v?p||!!v.closest("form"):!0,[C=!1,_]=_i({prop:i,defaultProp:o,onChange:d}),T=E.useRef(C);return E.useEffect(()=>{const N=v==null?void 0:v.form;if(N){const D=()=>_(T.current);return N.addEventListener("reset",D),()=>N.removeEventListener("reset",D)}},[v,_]),S.jsxs(K6,{scope:n,state:C,disabled:u,children:[S.jsx(We.button,{type:"button",role:"checkbox","aria-checked":la(C)?"mixed":C,"aria-required":s,"data-state":iR(C),"data-disabled":u?"":void 0,disabled:u,value:f,...m,ref:w,onKeyDown:qe(e.onKeyDown,N=>{N.key==="Enter"&&N.preventDefault()}),onClick:qe(e.onClick,N=>{_(D=>la(D)?!0:!D),k&&(x.current=N.isPropagationStopped(),x.current||N.stopPropagation())})}),k&&S.jsx(Q6,{control:v,bubbles:!x.current,name:r,value:f,checked:C,required:s,disabled:u,form:p,style:{transform:"translateX(-100%)"},defaultChecked:la(o)?!1:o})]})});tR.displayName=Oy;var nR="CheckboxIndicator",rR=E.forwardRef((e,t)=>{const{__scopeCheckbox:n,forceMount:r,...i}=e,o=Z6(nR,n);return S.jsx(Zn,{present:r||la(o.state)||o.state===!0,children:S.jsx(We.span,{"data-state":iR(o.state),"data-disabled":o.disabled?"":void 0,...i,ref:t,style:{pointerEvents:"none",...e.style}})})});rR.displayName=nR;var Q6=e=>{const{control:t,checked:n,bubbles:r=!0,defaultChecked:i,...o}=e,s=E.useRef(null),u=eR(n),f=DC(t);E.useEffect(()=>{const p=s.current,m=window.HTMLInputElement.prototype,g=Object.getOwnPropertyDescriptor(m,"checked").set;if(u!==n&&g){const w=new Event("click",{bubbles:r});p.indeterminate=la(n),g.call(p,la(n)?!1:n),p.dispatchEvent(w)}},[u,n,r]);const d=E.useRef(la(n)?!1:n);return S.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:i??d.current,...o,tabIndex:-1,ref:s,style:{...e.style,...f,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function la(e){return e==="indeterminate"}function iR(e){return la(e)?"indeterminate":e?"checked":"unchecked"}var aR=tR,J6=rR;const Bs=E.forwardRef(({className:e,...t},n)=>S.jsx(aR,{ref:n,className:Me("peer border-primary ring-offset-background focus-visible:ring-ring data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground h-4 w-4 shrink-0 rounded-sm border focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50",e),...t,children:S.jsx(J6,{className:Me("flex items-center justify-center text-current"),children:S.jsx(Lv,{className:"h-4 w-4"})})}));Bs.displayName=aR.displayName;var eH="Separator",sE="horizontal",tH=["horizontal","vertical"],oR=E.forwardRef((e,t)=>{const{decorative:n,orientation:r=sE,...i}=e,o=nH(r)?r:sE,u=n?{role:"none"}:{"aria-orientation":o==="vertical"?o:void 0,role:"separator"};return S.jsx(We.div,{"data-orientation":o,...u,...i,ref:t})});oR.displayName=eH;function nH(e){return tH.includes(e)}var lR=oR;const Fs=E.forwardRef(({className:e,orientation:t="horizontal",decorative:n=!0,...r},i)=>S.jsx(lR,{ref:i,decorative:n,orientation:t,className:Me("bg-border shrink-0",t==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",e),...r}));Fs.displayName=lR.displayName;const na=({checked:e,onCheckedChange:t,label:n})=>S.jsxs("div",{className:"flex items-center gap-2",children:[S.jsx(Bs,{checked:e,onCheckedChange:t}),S.jsx("label",{htmlFor:"terms",className:"text-sm leading-none font-medium peer-disabled:cursor-not-allowed peer-disabled:opacity-70",children:n})]});function rH(){const[e,t]=E.useState(!1),[n,r]=E.useState(""),i=Qe.use.showPropertyPanel(),o=Qe.use.showNodeSearchBar(),s=Qe.use.showNodeLabel(),u=Qe.use.enableEdgeEvents(),f=Qe.use.enableNodeDrag(),d=Qe.use.enableHideUnselectedEdges(),p=Qe.use.showEdgeLabel(),m=Qe.use.enableHealthCheck(),v=Qe.use.apiKey();E.useEffect(()=>{r(v||"")},[v,e]);const g=E.useCallback(()=>Qe.setState(R=>({enableNodeDrag:!R.enableNodeDrag})),[]),w=E.useCallback(()=>Qe.setState(R=>({enableEdgeEvents:!R.enableEdgeEvents})),[]),x=E.useCallback(()=>Qe.setState(R=>({enableHideUnselectedEdges:!R.enableHideUnselectedEdges})),[]),k=E.useCallback(()=>Qe.setState(R=>({showEdgeLabel:!R.showEdgeLabel})),[]),C=E.useCallback(()=>Qe.setState(R=>({showPropertyPanel:!R.showPropertyPanel})),[]),_=E.useCallback(()=>Qe.setState(R=>({showNodeSearchBar:!R.showNodeSearchBar})),[]),T=E.useCallback(()=>Qe.setState(R=>({showNodeLabel:!R.showNodeLabel})),[]),N=E.useCallback(()=>Qe.setState(R=>({enableHealthCheck:!R.enableHealthCheck})),[]),D=E.useCallback(async()=>{Qe.setState({apiKey:n||null}),await Mn.getState().check(),t(!1)},[n]),z=E.useCallback(R=>{r(R.target.value)},[r]);return S.jsxs(fd,{open:e,onOpenChange:t,children:[S.jsx(dd,{asChild:!0,children:S.jsx(Ot,{variant:Hr,tooltip:"Settings",size:"icon",children:S.jsx(JM,{})})}),S.jsx(uu,{side:"right",align:"start",className:"mb-2 p-2",onCloseAutoFocus:R=>R.preventDefault(),children:S.jsxs("div",{className:"flex flex-col gap-2",children:[S.jsx(na,{checked:i,onCheckedChange:C,label:"Show Property Panel"}),S.jsx(na,{checked:o,onCheckedChange:_,label:"Show Search Bar"}),S.jsx(Fs,{}),S.jsx(na,{checked:s,onCheckedChange:T,label:"Show Node Label"}),S.jsx(na,{checked:f,onCheckedChange:g,label:"Node Draggable"}),S.jsx(Fs,{}),S.jsx(na,{checked:p,onCheckedChange:k,label:"Show Edge Label"}),S.jsx(na,{checked:d,onCheckedChange:x,label:"Hide Unselected Edges"}),S.jsx(na,{checked:u,onCheckedChange:w,label:"Edge Events"}),S.jsx(Fs,{}),S.jsx(na,{checked:m,onCheckedChange:N,label:"Health Check"}),S.jsx(Fs,{}),S.jsxs("div",{className:"flex flex-col gap-2",children:[S.jsx("label",{className:"text-sm font-medium",children:"API Key"}),S.jsxs("form",{className:"flex h-6 gap-2",onSubmit:R=>R.preventDefault(),children:[S.jsx("div",{className:"w-0 flex-1",children:S.jsx(Za,{type:"password",value:n,onChange:z,placeholder:"Enter your API key",className:"max-h-full w-full min-w-0",autoComplete:"off"})}),S.jsx(Ot,{onClick:D,variant:"outline",size:"sm",className:"max-h-full shrink-0",children:"Save"})]})]})]})})]})}const iH="ENTRIES",sR="KEYS",uR="VALUES",sn="";class Hm{constructor(t,n){const r=t._tree,i=Array.from(r.keys());this.set=t,this._type=n,this._path=i.length>0?[{node:r,keys:i}]:[]}next(){const t=this.dive();return this.backtrack(),t}dive(){if(this._path.length===0)return{done:!0,value:void 0};const{node:t,keys:n}=Wo(this._path);if(Wo(n)===sn)return{done:!1,value:this.result()};const r=t.get(Wo(n));return this._path.push({node:r,keys:Array.from(r.keys())}),this.dive()}backtrack(){if(this._path.length===0)return;const t=Wo(this._path).keys;t.pop(),!(t.length>0)&&(this._path.pop(),this.backtrack())}key(){return this.set._prefix+this._path.map(({keys:t})=>Wo(t)).filter(t=>t!==sn).join("")}value(){return Wo(this._path).node.get(sn)}result(){switch(this._type){case uR:return this.value();case sR:return this.key();default:return[this.key(),this.value()]}}[Symbol.iterator](){return this}}const Wo=e=>e[e.length-1],aH=(e,t,n)=>{const r=new Map;if(t===void 0)return r;const i=t.length+1,o=i+n,s=new Uint8Array(o*i).fill(n+1);for(let u=0;u{const f=o*s;e:for(const d of e.keys())if(d===sn){const p=i[f-1];p<=n&&r.set(u,[e.get(d),p])}else{let p=o;for(let m=0;mn)continue e}cR(e.get(d),t,n,r,i,p,s,u+d)}};class oa{constructor(t=new Map,n=""){this._size=void 0,this._tree=t,this._prefix=n}atPrefix(t){if(!t.startsWith(this._prefix))throw new Error("Mismatched prefix");const[n,r]=Df(this._tree,t.slice(this._prefix.length));if(n===void 0){const[i,o]=Ly(r);for(const s of i.keys())if(s!==sn&&s.startsWith(o)){const u=new Map;return u.set(s.slice(o.length),i.get(s)),new oa(u,t)}}return new oa(n,t)}clear(){this._size=void 0,this._tree.clear()}delete(t){return this._size=void 0,oH(this._tree,t)}entries(){return new Hm(this,iH)}forEach(t){for(const[n,r]of this)t(n,r,this)}fuzzyGet(t,n){return aH(this._tree,t,n)}get(t){const n=Zg(this._tree,t);return n!==void 0?n.get(sn):void 0}has(t){const n=Zg(this._tree,t);return n!==void 0&&n.has(sn)}keys(){return new Hm(this,sR)}set(t,n){if(typeof t!="string")throw new Error("key must be a string");return this._size=void 0,$m(this._tree,t).set(sn,n),this}get size(){if(this._size)return this._size;this._size=0;const t=this.entries();for(;!t.next().done;)this._size+=1;return this._size}update(t,n){if(typeof t!="string")throw new Error("key must be a string");this._size=void 0;const r=$m(this._tree,t);return r.set(sn,n(r.get(sn))),this}fetch(t,n){if(typeof t!="string")throw new Error("key must be a string");this._size=void 0;const r=$m(this._tree,t);let i=r.get(sn);return i===void 0&&r.set(sn,i=n()),i}values(){return new Hm(this,uR)}[Symbol.iterator](){return this.entries()}static from(t){const n=new oa;for(const[r,i]of t)n.set(r,i);return n}static fromObject(t){return oa.from(Object.entries(t))}}const Df=(e,t,n=[])=>{if(t.length===0||e==null)return[e,n];for(const r of e.keys())if(r!==sn&&t.startsWith(r))return n.push([e,r]),Df(e.get(r),t.slice(r.length),n);return n.push([e,t]),Df(void 0,"",n)},Zg=(e,t)=>{if(t.length===0||e==null)return e;for(const n of e.keys())if(n!==sn&&t.startsWith(n))return Zg(e.get(n),t.slice(n.length))},$m=(e,t)=>{const n=t.length;e:for(let r=0;e&&r{const[n,r]=Df(e,t);if(n!==void 0){if(n.delete(sn),n.size===0)fR(r);else if(n.size===1){const[i,o]=n.entries().next().value;dR(r,i,o)}}},fR=e=>{if(e.length===0)return;const[t,n]=Ly(e);if(t.delete(n),t.size===0)fR(e.slice(0,-1));else if(t.size===1){const[r,i]=t.entries().next().value;r!==sn&&dR(e.slice(0,-1),r,i)}},dR=(e,t,n)=>{if(e.length===0)return;const[r,i]=Ly(e);r.set(i+t,n),r.delete(i)},Ly=e=>e[e.length-1],zy="or",hR="and",lH="and_not";class sa{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?Ym:t.autoVacuum;this._options={...qm,...t,autoVacuum:n,searchOptions:{...uE,...t.searchOptions||{}},autoSuggestOptions:{...dH,...t.autoSuggestOptions||{}}},this._index=new oa,this._documentCount=0,this._documentIds=new Map,this._idToShortId=new Map,this._fieldIds={},this._fieldLength=new Map,this._avgFieldLength=[],this._nextId=0,this._storedFields=new Map,this._dirtCount=0,this._currentVacuum=null,this._enqueuedVacuum=null,this._enqueuedVacuumConditions=Jg,this.addFields(this._options.fields)}add(t){const{extractField:n,tokenize:r,processTerm:i,fields:o,idField:s}=this._options,u=n(t,s);if(u==null)throw new Error(`MiniSearch: document does not have ID field "${s}"`);if(this._idToShortId.has(u))throw new Error(`MiniSearch: duplicate ID ${u}`);const f=this.addDocumentId(u);this.saveStoredFields(f,t);for(const d of o){const p=n(t,d);if(p==null)continue;const m=r(p.toString(),d),v=this._fieldIds[d],g=new Set(m).size;this.addFieldLength(f,v,this._documentCount-1,g);for(const w of m){const x=i(w,d);if(Array.isArray(x))for(const k of x)this.addTerm(v,f,k);else x&&this.addTerm(v,f,x)}}}addAll(t){for(const n of t)this.add(n)}addAllAsync(t,n={}){const{chunkSize:r=10}=n,i={chunk:[],promise:Promise.resolve()},{chunk:o,promise:s}=t.reduce(({chunk:u,promise:f},d,p)=>(u.push(d),(p+1)%r===0?{chunk:[],promise:f.then(()=>new Promise(m=>setTimeout(m,0))).then(()=>this.addAll(u))}:{chunk:u,promise:f}),i);return s.then(()=>this.addAll(o))}remove(t){const{tokenize:n,processTerm:r,extractField:i,fields:o,idField:s}=this._options,u=i(t,s);if(u==null)throw new Error(`MiniSearch: document does not have ID field "${s}"`);const f=this._idToShortId.get(u);if(f==null)throw new Error(`MiniSearch: cannot remove document with ID ${u}: it is not in the index`);for(const d of o){const p=i(t,d);if(p==null)continue;const m=n(p.toString(),d),v=this._fieldIds[d],g=new Set(m).size;this.removeFieldLength(f,v,this._documentCount,g);for(const w of m){const x=r(w,d);if(Array.isArray(x))for(const k of x)this.removeTerm(v,f,k);else x&&this.removeTerm(v,f,x)}}this._storedFields.delete(f),this._documentIds.delete(f),this._idToShortId.delete(u),this._fieldLength.delete(f),this._documentCount-=1}removeAll(t){if(t)for(const n of t)this.remove(n);else{if(arguments.length>0)throw new Error("Expected documents to be present. Omit the argument to remove all documents.");this._index=new oa,this._documentCount=0,this._documentIds=new Map,this._idToShortId=new Map,this._fieldLength=new Map,this._avgFieldLength=[],this._storedFields=new Map,this._nextId=0}}discard(t){const n=this._idToShortId.get(t);if(n==null)throw new Error(`MiniSearch: cannot discard document with ID ${t}: it is not in the index`);this._idToShortId.delete(t),this._documentIds.delete(n),this._storedFields.delete(n),(this._fieldLength.get(n)||[]).forEach((r,i)=>{this.removeFieldLength(n,i,this._documentCount,r)}),this._fieldLength.delete(n),this._documentCount-=1,this._dirtCount+=1,this.maybeAutoVacuum()}maybeAutoVacuum(){if(this._options.autoVacuum===!1)return;const{minDirtFactor:t,minDirtCount:n,batchSize:r,batchWait:i}=this._options.autoVacuum;this.conditionalVacuum({batchSize:r,batchWait:i},{minDirtCount:n,minDirtFactor:t})}discardAll(t){const n=this._options.autoVacuum;try{this._options.autoVacuum=!1;for(const r of t)this.discard(r)}finally{this._options.autoVacuum=n}this.maybeAutoVacuum()}replace(t){const{idField:n,extractField:r}=this._options,i=r(t,n);this.discard(i),this.add(t)}vacuum(t={}){return this.conditionalVacuum(t)}conditionalVacuum(t,n){return this._currentVacuum?(this._enqueuedVacuumConditions=this._enqueuedVacuumConditions&&n,this._enqueuedVacuum!=null?this._enqueuedVacuum:(this._enqueuedVacuum=this._currentVacuum.then(()=>{const r=this._enqueuedVacuumConditions;return this._enqueuedVacuumConditions=Jg,this.performVacuuming(t,r)}),this._enqueuedVacuum)):this.vacuumConditionsMet(n)===!1?Promise.resolve():(this._currentVacuum=this.performVacuuming(t),this._currentVacuum)}async performVacuuming(t,n){const r=this._dirtCount;if(this.vacuumConditionsMet(n)){const i=t.batchSize||Qg.batchSize,o=t.batchWait||Qg.batchWait;let s=1;for(const[u,f]of this._index){for(const[d,p]of f)for(const[m]of p)this._documentIds.has(m)||(p.size<=1?f.delete(d):p.delete(m));this._index.get(u).size===0&&this._index.delete(u),s%i===0&&await new Promise(d=>setTimeout(d,o)),s+=1}this._dirtCount-=r}await null,this._currentVacuum=this._enqueuedVacuum,this._enqueuedVacuum=null}vacuumConditionsMet(t){if(t==null)return!0;let{minDirtCount:n,minDirtFactor:r}=t;return n=n||Ym.minDirtCount,r=r||Ym.minDirtFactor,this.dirtCount>=n&&this.dirtFactor>=r}get isVacuuming(){return this._currentVacuum!=null}get dirtCount(){return this._dirtCount}get dirtFactor(){return this._dirtCount/(1+this._documentCount+this._dirtCount)}has(t){return this._idToShortId.has(t)}getStoredFields(t){const n=this._idToShortId.get(t);if(n!=null)return this._storedFields.get(n)}search(t,n={}){const{searchOptions:r}=this._options,i={...r,...n},o=this.executeQuery(t,n),s=[];for(const[u,{score:f,terms:d,match:p}]of o){const m=d.length||1,v={id:this._documentIds.get(u),score:f*m,terms:Object.keys(p),queryTerms:d,match:p};Object.assign(v,this._storedFields.get(u)),(i.filter==null||i.filter(v))&&s.push(v)}return t===sa.wildcard&&i.boostDocument==null||s.sort(fE),s}autoSuggest(t,n={}){n={...this._options.autoSuggestOptions,...n};const r=new Map;for(const{score:o,terms:s}of this.search(t,n)){const u=s.join(" "),f=r.get(u);f!=null?(f.score+=o,f.count+=1):r.set(u,{score:o,terms:s,count:1})}const i=[];for(const[o,{score:s,terms:u,count:f}]of r)i.push({suggestion:o,terms:u,score:s/f});return i.sort(fE),i}get documentCount(){return this._documentCount}get termCount(){return this._index.size}static loadJSON(t,n){if(n==null)throw new Error("MiniSearch: loadJSON should be given the same options used when serializing the index");return this.loadJS(JSON.parse(t),n)}static async loadJSONAsync(t,n){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(qm.hasOwnProperty(t))return Vm(qm,t);throw new Error(`MiniSearch: unknown option "${t}"`)}static loadJS(t,n){const{index:r,documentIds:i,fieldLength:o,storedFields:s,serializationVersion:u}=t,f=this.instantiateMiniSearch(t,n);f._documentIds=qc(i),f._fieldLength=qc(o),f._storedFields=qc(s);for(const[d,p]of f._documentIds)f._idToShortId.set(p,d);for(const[d,p]of r){const m=new Map;for(const v of Object.keys(p)){let g=p[v];u===1&&(g=g.ds),m.set(parseInt(v,10),qc(g))}f._index.set(d,m)}return f}static async loadJSAsync(t,n){const{index:r,documentIds:i,fieldLength:o,storedFields:s,serializationVersion:u}=t,f=this.instantiateMiniSearch(t,n);f._documentIds=await Yc(i),f._fieldLength=await Yc(o),f._storedFields=await Yc(s);for(const[p,m]of f._documentIds)f._idToShortId.set(m,p);let d=0;for(const[p,m]of r){const v=new Map;for(const g of Object.keys(m)){let w=m[g];u===1&&(w=w.ds),v.set(parseInt(g,10),await Yc(w))}++d%1e3===0&&await pR(0),f._index.set(p,v)}return f}static instantiateMiniSearch(t,n){const{documentCount:r,nextId:i,fieldIds:o,averageFieldLength:s,dirtCount:u,serializationVersion:f}=t;if(f!==1&&f!==2)throw new Error("MiniSearch: cannot deserialize an index created with an incompatible version");const d=new sa(n);return d._documentCount=r,d._nextId=i,d._idToShortId=new Map,d._fieldIds=o,d._avgFieldLength=s,d._dirtCount=u||0,d._index=new oa,d}executeQuery(t,n={}){if(t===sa.wildcard)return this.executeWildcardQuery(n);if(typeof t!="string"){const v={...n,...t,queries:void 0},g=t.queries.map(w=>this.executeQuery(w,v));return this.combineResults(g,v.combineWith)}const{tokenize:r,processTerm:i,searchOptions:o}=this._options,s={tokenize:r,processTerm:i,...o,...n},{tokenize:u,processTerm:f}=s,m=u(t).flatMap(v=>f(v)).filter(v=>!!v).map(fH(s)).map(v=>this.executeQuerySpec(v,s));return this.combineResults(m,s.combineWith)}executeQuerySpec(t,n){const r={...this._options.searchOptions,...n},i=(r.fields||this._options.fields).reduce((x,k)=>({...x,[k]:Vm(r.boost,k)||1}),{}),{boostDocument:o,weights:s,maxFuzzy:u,bm25:f}=r,{fuzzy:d,prefix:p}={...uE.weights,...s},m=this._index.get(t.term),v=this.termResults(t.term,t.term,1,t.termBoost,m,i,o,f);let g,w;if(t.prefix&&(g=this._index.atPrefix(t.term)),t.fuzzy){const x=t.fuzzy===!0?.2:t.fuzzy,k=x<1?Math.min(u,Math.round(t.term.length*x)):x;k&&(w=this._index.fuzzyGet(t.term,k))}if(g)for(const[x,k]of g){const C=x.length-t.term.length;if(!C)continue;w==null||w.delete(x);const _=p*x.length/(x.length+.3*C);this.termResults(t.term,x,_,t.termBoost,k,i,o,f,v)}if(w)for(const x of w.keys()){const[k,C]=w.get(x);if(!C)continue;const _=d*x.length/(x.length+C);this.termResults(t.term,x,_,t.termBoost,k,i,o,f,v)}return v}executeWildcardQuery(t){const n=new Map,r={...this._options.searchOptions,...t};for(const[i,o]of this._documentIds){const s=r.boostDocument?r.boostDocument(o,"",this._storedFields.get(i)):1;n.set(i,{score:s,terms:[],match:{}})}return n}combineResults(t,n=zy){if(t.length===0)return new Map;const r=n.toLowerCase(),i=sH[r];if(!i)throw new Error(`Invalid combination operator: ${n}`);return t.reduce(i)||new Map}toJSON(){const t=[];for(const[n,r]of this._index){const i={};for(const[o,s]of r)i[o]=Object.fromEntries(s);t.push([n,i])}return{documentCount:this._documentCount,nextId:this._nextId,documentIds:Object.fromEntries(this._documentIds),fieldIds:this._fieldIds,fieldLength:Object.fromEntries(this._fieldLength),averageFieldLength:this._avgFieldLength,storedFields:Object.fromEntries(this._storedFields),dirtCount:this._dirtCount,index:t,serializationVersion:2}}termResults(t,n,r,i,o,s,u,f,d=new Map){if(o==null)return d;for(const p of Object.keys(s)){const m=s[p],v=this._fieldIds[p],g=o.get(v);if(g==null)continue;let w=g.size;const x=this._avgFieldLength[v];for(const k of g.keys()){if(!this._documentIds.has(k)){this.removeTerm(v,k,n),w-=1;continue}const C=u?u(this._documentIds.get(k),n,this._storedFields.get(k)):1;if(!C)continue;const _=g.get(k),T=this._fieldLength.get(k)[v],N=cH(_,w,this._documentCount,T,x,f),D=r*i*m*C*N,z=d.get(k);if(z){z.score+=D,hH(z.terms,t);const R=Vm(z.match,n);R?R.push(p):z.match[n]=[p]}else d.set(k,{score:D,terms:[t],match:{[n]:[p]}})}}return d}addTerm(t,n,r){const i=this._index.fetch(r,dE);let o=i.get(t);if(o==null)o=new Map,o.set(n,1),i.set(t,o);else{const s=o.get(n);o.set(n,(s||0)+1)}}removeTerm(t,n,r){if(!this._index.has(r)){this.warnDocumentChanged(n,t,r);return}const i=this._index.fetch(r,dE),o=i.get(t);o==null||o.get(n)==null?this.warnDocumentChanged(n,t,r):o.get(n)<=1?o.size<=1?i.delete(t):o.delete(n):o.set(n,o.get(n)-1),this._index.get(r).size===0&&this._index.delete(r)}warnDocumentChanged(t,n,r){for(const i of Object.keys(this._fieldIds))if(this._fieldIds[i]===n){this._options.logger("warn",`MiniSearch: document with ID ${this._documentIds.get(t)} has changed before removal: term "${r}" was not present in field "${i}". Removing a document after it has changed can corrupt the index!`,"version_conflict");return}}addDocumentId(t){const n=this._nextId;return this._idToShortId.set(t,n),this._documentIds.set(n,t),this._documentCount+=1,this._nextId+=1,n}addFields(t){for(let n=0;nObject.prototype.hasOwnProperty.call(e,t)?e[t]:void 0,sH={[zy]:(e,t)=>{for(const n of t.keys()){const r=e.get(n);if(r==null)e.set(n,t.get(n));else{const{score:i,terms:o,match:s}=t.get(n);r.score=r.score+i,r.match=Object.assign(r.match,s),cE(r.terms,o)}}return e},[hR]:(e,t)=>{const n=new Map;for(const r of t.keys()){const i=e.get(r);if(i==null)continue;const{score:o,terms:s,match:u}=t.get(r);cE(i.terms,s),n.set(r,{score:i.score+o,terms:i.terms,match:Object.assign(i.match,u)})}return n},[lH]:(e,t)=>{for(const n of t.keys())e.delete(n);return e}},uH={k:1.2,b:.7,d:.5},cH=(e,t,n,r,i,o)=>{const{k:s,b:u,d:f}=o;return Math.log(1+(n-t+.5)/(t+.5))*(f+e*(s+1)/(e+s*(1-u+u*r/i)))},fH=e=>(t,n,r)=>{const i=typeof e.fuzzy=="function"?e.fuzzy(t,n,r):e.fuzzy||!1,o=typeof e.prefix=="function"?e.prefix(t,n,r):e.prefix===!0,s=typeof e.boostTerm=="function"?e.boostTerm(t,n,r):1;return{term:t,fuzzy:i,prefix:o,termBoost:s}},qm={idField:"id",extractField:(e,t)=>e[t],tokenize:e=>e.split(pH),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},uE={combineWith:zy,prefix:!1,fuzzy:!1,maxFuzzy:6,boost:{},weights:{fuzzy:.45,prefix:.375},bm25:uH},dH={combineWith:hR,prefix:(e,t,n)=>t===n.length-1},Qg={batchSize:1e3,batchWait:10},Jg={minDirtFactor:.1,minDirtCount:20},Ym={...Qg,...Jg},hH=(e,t)=>{e.includes(t)||e.push(t)},cE=(e,t)=>{for(const n of t)e.includes(n)||e.push(n)},fE=({score:e},{score:t})=>t-e,dE=()=>new Map,qc=e=>{const t=new Map;for(const n of Object.keys(e))t.set(parseInt(n,10),e[n]);return t},Yc=async e=>{const t=new Map;let n=0;for(const r of Object.keys(e))t.set(parseInt(r,10),e[r]),++n%1e3===0&&await pR(0);return t},pR=e=>new Promise(t=>setTimeout(t,e)),pH=/[\n\r\p{Z}\p{P}]+/u,mH={index:new sa({fields:[]})};E.createContext(mH);const ev=({label:e,color:t,hidden:n,labels:r={}})=>be.createElement("div",{className:"node"},be.createElement("span",{className:"render "+(n?"circle":"disc"),style:{backgroundColor:t||"#000"}}),be.createElement("span",{className:`label ${n?"text-muted":""} ${e?"":"text-italic"}`},e||r.no_label||"No label")),gH=({id:e,labels:t})=>{const n=pr(),r=E.useMemo(()=>{const i=n.getGraph().getNodeAttributes(e),o=n.getSetting("nodeReducer");return Object.assign(Object.assign({color:n.getSetting("defaultNodeColor")},i),o?o(e,i):{})},[n,e]);return be.createElement(ev,Object.assign({},r,{labels:t}))},vH=({label:e,color:t,source:n,target:r,hidden:i,directed:o,labels:s={}})=>be.createElement("div",{className:"edge"},be.createElement(ev,Object.assign({},n,{labels:s})),be.createElement("div",{className:"body"},be.createElement("div",{className:"render"},be.createElement("span",{className:i?"dotted":"dash",style:{borderColor:t||"#000"}})," ",o&&be.createElement("span",{className:"arrow",style:{borderTopColor:t||"#000"}})),be.createElement("span",{className:`label ${i?"text-muted":""} ${e?"":"fst-italic"}`},e||s.no_label||"No label")),be.createElement(ev,Object.assign({},r,{labels:s}))),yH=({id:e,labels:t})=>{const n=pr(),r=E.useMemo(()=>{const i=n.getGraph().getEdgeAttributes(e),o=n.getSetting("nodeReducer"),s=n.getSetting("edgeReducer"),u=n.getGraph().getNodeAttributes(n.getGraph().source(e)),f=n.getGraph().getNodeAttributes(n.getGraph().target(e));return Object.assign(Object.assign(Object.assign({color:n.getSetting("defaultEdgeColor"),directed:n.getGraph().isDirected(e)},i),s?s(e,i):{}),{source:Object.assign(Object.assign({color:n.getSetting("defaultNodeColor")},u),o?o(e,u):{}),target:Object.assign(Object.assign({color:n.getSetting("defaultNodeColor")},f),o?o(e,f):{})})},[n,e]);return be.createElement(vH,Object.assign({},r,{labels:t}))};function jy(e,t){const[n,r]=E.useState(e);return E.useEffect(()=>{const i=setTimeout(()=>{r(e)},t);return()=>{clearTimeout(i)}},[e,t]),n}function bH({fetcher:e,preload:t,filterFn:n,renderOption:r,getOptionValue:i,notFound:o,loadingSkeleton:s,label:u,placeholder:f="Select...",value:d,onChange:p,onFocus:m,disabled:v=!1,className:g,noResultsMessage:w}){const[x,k]=E.useState(!1),[C,_]=E.useState(!1),[T,N]=E.useState([]),[D,z]=E.useState(!1),[R,B]=E.useState(null),[P,j]=E.useState(d),[V,q]=E.useState(null),[I,Y]=E.useState(""),Z=jy(I,t?0:150),[U,G]=E.useState([]);E.useEffect(()=>{k(!0),j(d)},[d]),E.useEffect(()=>{x||(async()=>{try{z(!0),B(null);const $=d!==null?await e(d):[];G($),N($)}catch($){B($ instanceof Error?$.message:"Failed to fetch options")}finally{z(!1)}})()},[x,e,d]),E.useEffect(()=>{const A=async()=>{try{z(!0),B(null);const $=await e(Z);G($),N($)}catch($){B($ instanceof Error?$.message:"Failed to fetch options")}finally{z(!1)}};x&&t?t&&N(Z?U.filter($=>n?n($,Z):!0):U):A()},[e,Z,x,t,n]);const F=E.useCallback(A=>{A!==P&&(j(A),p(A)),_(!1)},[P,j,_,p]),K=E.useCallback(A=>{A!==V&&(q(A),m(A))},[V,q,m]);return S.jsx("div",{className:Me(v&&"cursor-not-allowed opacity-50",g),onFocus:()=>{_(!0)},onBlur:()=>_(!1),children:S.jsxs(yd,{shouldFilter:!1,className:"bg-transparent",children:[S.jsxs("div",{children:[S.jsx(Dy,{placeholder:f,value:I,className:"max-h-8",onValueChange:A=>{Y(A),A&&!C&&_(!0)}}),D&&T.length>0&&S.jsx("div",{className:"absolute top-1/2 right-2 flex -translate-y-1/2 transform items-center",children:S.jsx(Sk,{className:"h-4 w-4 animate-spin"})})]}),S.jsxs(bd,{hidden:!C||Z.length===0,children:[R&&S.jsx("div",{className:"text-destructive p-4 text-center",children:R}),D&&T.length===0&&(s||S.jsx(xH,{})),!D&&!R&&T.length===0&&(o||S.jsx(Ny,{children:w??`No ${u.toLowerCase()} found.`})),S.jsx(Cl,{children:T.map((A,$)=>S.jsxs(S.Fragment,{children:[S.jsx(Tl,{value:i(A),onSelect:F,onMouseEnter:()=>K(i(A)),className:"truncate",children:r(A)},i(A)+`${$}`),$!==T.length-1&&S.jsx("div",{className:"bg-foreground/10 h-[1px]"},$)]}))})]})]})})}function xH(){return S.jsx(Cl,{children:S.jsx(Tl,{disabled:!0,children:S.jsxs("div",{className:"flex w-full items-center gap-2",children:[S.jsx("div",{className:"bg-muted h-6 w-6 animate-pulse rounded-full"}),S.jsxs("div",{className:"flex flex-1 flex-col gap-1",children:[S.jsx("div",{className:"bg-muted h-4 w-24 animate-pulse rounded"}),S.jsx("div",{className:"bg-muted h-3 w-16 animate-pulse rounded"})]})]})})})}function wH(e){return S.jsxs("div",{children:[e.type==="nodes"&&S.jsx(gH,{id:e.id}),e.type==="edges"&&S.jsx(yH,{id:e.id}),e.type==="message"&&S.jsx("div",{children:e.message})]})}const Wm="__message_item",Wc={graph:null,searchEngine:null},SH=({onChange:e,onFocus:t,value:n})=>{const r=yt.use.sigmaGraph(),i=E.useMemo(()=>{if(Wc.graph==r)return Wc.searchEngine;if(!r||r.nodes().length==0)return;Wc.graph=r;const s=new sa({idField:"id",fields:["label"],searchOptions:{prefix:!0,fuzzy:.2,boost:{label:2}}}),u=r.nodes().map(f=>({id:f,label:r.getNodeAttribute(f,"label")}));return s.addAll(u),Wc.searchEngine=s,s},[r]),o=E.useCallback(async s=>{if(t&&t(null),!s||!i)return[];const u=i.search(s).map(f=>({id:f.id,type:"nodes"}));return u.length<=$p?u:[...u.slice(0,$p),{type:"message",id:Wm,message:`And ${u.length-$p} others`}]},[i,t]);return S.jsx(bH,{className:"bg-background/60 w-24 rounded-xl border-1 opacity-60 backdrop-blur-lg transition-all hover:w-fit hover:opacity-100",fetcher:o,renderOption:wH,getOptionValue:s=>s.id,value:n&&n.type!=="message"?n.id:null,onChange:s=>{s!==Wm&&e(s?{id:s,type:"nodes"}:null)},onFocus:s=>{s!==Wm&&t&&t(s?{id:s,type:"nodes"}:null)},label:"item",placeholder:"Search nodes..."})},EH=({...e})=>S.jsx(SH,{...e});function _H({fetcher:e,preload:t,filterFn:n,renderOption:r,getOptionValue:i,getDisplayValue:o,notFound:s,loadingSkeleton:u,label:f,placeholder:d="Select...",value:p,onChange:m,disabled:v=!1,className:g,triggerClassName:w,searchInputClassName:x,noResultsMessage:k,triggerTooltip:C,clearable:_=!0}){const[T,N]=E.useState(!1),[D,z]=E.useState(!1),[R,B]=E.useState([]),[P,j]=E.useState(!1),[V,q]=E.useState(null),[I,Y]=E.useState(p),[Z,U]=E.useState(null),[G,F]=E.useState(""),K=jy(G,t?0:150),[A,$]=E.useState([]);E.useEffect(()=>{N(!0),Y(p)},[p]),E.useEffect(()=>{if(p&&R.length>0){const O=R.find(X=>i(X)===p);O&&U(O)}},[p,R,i]),E.useEffect(()=>{T||(async()=>{try{j(!0),q(null);const X=await e(p);$(X),B(X)}catch(X){q(X instanceof Error?X.message:"Failed to fetch options")}finally{j(!1)}})()},[T,e,p]),E.useEffect(()=>{const O=async()=>{try{j(!0),q(null);const X=await e(K);$(X),B(X)}catch(X){q(X instanceof Error?X.message:"Failed to fetch options")}finally{j(!1)}};T&&t?t&&B(K?A.filter(X=>n?n(X,K):!0):A):O()},[e,K,T,t,n]);const M=E.useCallback(O=>{const X=_&&O===I?"":O;Y(X),U(R.find(re=>i(re)===X)||null),m(X),z(!1)},[I,m,_,R,i]);return S.jsxs(fd,{open:D,onOpenChange:z,children:[S.jsx(dd,{asChild:!0,children:S.jsxs(Ot,{variant:"outline",role:"combobox","aria-expanded":D,className:Me("justify-between",v&&"cursor-not-allowed opacity-50",w),disabled:v,tooltip:C,side:"bottom",children:[Z?o(Z):d,S.jsx(bM,{className:"opacity-50",size:10})]})}),S.jsx(uu,{className:Me("p-0",g),onCloseAutoFocus:O=>O.preventDefault(),children:S.jsxs(yd,{shouldFilter:!1,children:[S.jsxs("div",{className:"relative w-full border-b",children:[S.jsx(Dy,{placeholder:`Search ${f.toLowerCase()}...`,value:G,onValueChange:O=>{F(O)},className:x}),P&&R.length>0&&S.jsx("div",{className:"absolute top-1/2 right-2 flex -translate-y-1/2 transform items-center",children:S.jsx(Sk,{className:"h-4 w-4 animate-spin"})})]}),S.jsxs(bd,{children:[V&&S.jsx("div",{className:"text-destructive p-4 text-center",children:V}),P&&R.length===0&&(u||S.jsx(kH,{})),!P&&!V&&R.length===0&&(s||S.jsx(Ny,{children:k??`No ${f.toLowerCase()} found.`})),S.jsx(Cl,{children:R.map(O=>S.jsxs(Tl,{value:i(O),onSelect:M,className:"truncate",children:[r(O),S.jsx(Lv,{className:Me("ml-auto h-3 w-3",I===i(O)?"opacity-100":"opacity-0")})]},i(O)))})]})]})})]})}function kH(){return S.jsx(Cl,{children:S.jsx(Tl,{disabled:!0,children:S.jsxs("div",{className:"flex w-full items-center gap-2",children:[S.jsx("div",{className:"bg-muted h-6 w-6 animate-pulse rounded-full"}),S.jsxs("div",{className:"flex flex-1 flex-col gap-1",children:[S.jsx("div",{className:"bg-muted h-4 w-24 animate-pulse rounded"}),S.jsx("div",{className:"bg-muted h-3 w-16 animate-pulse rounded"})]})]})})})}const CH=()=>{const e=Qe.use.queryLabel(),[t,n]=E.useState({labels:[],searchEngine:null}),[r,i]=E.useState(!1),o=E.useCallback(async u=>{let f=t.labels,d=t.searchEngine;if(!r||!d){f=["*"].concat(await rM()),f.includes(Qe.getState().queryLabel)||Qe.getState().setQueryLabel(f[0]),d=new sa({idField:"id",fields:["value"],searchOptions:{prefix:!0,fuzzy:.2,boost:{label:2}}});const p=f.map((m,v)=>({id:v,value:m}));d.addAll(p),n({labels:f,searchEngine:d}),i(!0)}return u?d.search(u).map(p=>f[p.id]):f},[t,r,n,i]),s=E.useCallback(u=>{Qe.getState().setQueryLabel(u)},[]);return S.jsx(_H,{className:"ml-2",triggerClassName:"max-h-8",searchInputClassName:"max-h-8",triggerTooltip:"Select query label",fetcher:o,renderOption:u=>S.jsx("div",{children:u}),getOptionValue:u=>u,getDisplayValue:u=>S.jsx("div",{children:u}),notFound:S.jsx("div",{className:"py-6 text-center text-sm",children:"No labels found"}),label:"Label",placeholder:"Search labels...",value:e!==null?e:"",onChange:s})},Ln=({text:e,className:t,tooltipClassName:n,tooltip:r,side:i,onClick:o})=>r?S.jsx(WC,{delayDuration:200,children:S.jsxs(XC,{children:[S.jsx(KC,{asChild:!0,children:S.jsx("label",{className:Me(t,o!==void 0?"cursor-pointer":void 0),onClick:o,children:e})}),S.jsx(ly,{side:i,className:n,children:r})]})}):S.jsx("label",{className:Me(t,o!==void 0?"cursor-pointer":void 0),onClick:o,children:e}),TH=()=>{const{getNode:e,getEdge:t}=JA(),n=yt.use.selectedNode(),r=yt.use.focusedNode(),i=yt.use.selectedEdge(),o=yt.use.focusedEdge(),[s,u]=E.useState(null),[f,d]=E.useState(null);return E.useEffect(()=>{let p=null,m=null;r?(p="node",m=e(r)):n?(p="node",m=e(n)):o?(p="edge",m=t(o,!0)):i&&(p="edge",m=t(i,!0)),m?(p=="node"?u(AH(m)):u(RH(m)),d(p)):(u(null),d(null))},[r,n,o,i,u,d,e,t]),s?S.jsx("div",{className:"bg-background/80 max-w-xs rounded-lg border-2 p-2 text-xs backdrop-blur-lg",children:f=="node"?S.jsx(DH,{node:s}):S.jsx(NH,{edge:s})}):S.jsx(S.Fragment,{})},AH=e=>{const t=yt.getState(),n=[];if(t.sigmaGraph&&t.rawGraph)for(const r of t.sigmaGraph.edges(e.id)){const i=t.rawGraph.getEdge(r,!0);if(i){const o=e.id===i.source,s=o?i.target:i.source,u=t.rawGraph.getNode(s);u&&n.push({type:o?"Target":"Source",id:s,label:u.labels.join(", ")})}}return{...e,relationships:n}},RH=e=>{var i,o;const t=yt.getState(),n=(i=t.rawGraph)==null?void 0:i.getNode(e.source),r=(o=t.rawGraph)==null?void 0:o.getNode(e.target);return{...e,sourceNode:n,targetNode:r}},Ur=({name:e,value:t,onClick:n,tooltip:r})=>S.jsxs("div",{className:"flex items-center gap-2",children:[S.jsx("label",{className:"text-primary/60 tracking-wide",children:e}),":",S.jsx(Ln,{className:"hover:bg-primary/20 rounded p-1 text-ellipsis",tooltipClassName:"max-w-80",text:t,tooltip:r||t,side:"left",onClick:n})]}),DH=({node:e})=>S.jsxs("div",{className:"flex flex-col gap-2",children:[S.jsx("label",{className:"text-md pl-1 font-bold tracking-wide text-sky-300",children:"Node"}),S.jsxs("div",{className:"bg-primary/5 max-h-96 overflow-auto rounded p-1",children:[S.jsx(Ur,{name:"Id",value:e.id}),S.jsx(Ur,{name:"Labels",value:e.labels.join(", "),onClick:()=>{yt.getState().setSelectedNode(e.id,!0)}}),S.jsx(Ur,{name:"Degree",value:e.degree})]}),S.jsx("label",{className:"text-md pl-1 font-bold tracking-wide text-yellow-400/90",children:"Properties"}),S.jsx("div",{className:"bg-primary/5 max-h-96 overflow-auto rounded p-1",children:Object.keys(e.properties).sort().map(t=>S.jsx(Ur,{name:t,value:e.properties[t]},t))}),e.relationships.length>0&&S.jsxs(S.Fragment,{children:[S.jsx("label",{className:"text-md pl-1 font-bold tracking-wide text-teal-600/90",children:"Relationships"}),S.jsx("div",{className:"bg-primary/5 max-h-96 overflow-auto rounded p-1",children:e.relationships.map(({type:t,id:n,label:r})=>S.jsx(Ur,{name:t,value:r,onClick:()=>{yt.getState().setSelectedNode(n,!0)}},n))})]})]}),NH=({edge:e})=>S.jsxs("div",{className:"flex flex-col gap-2",children:[S.jsx("label",{className:"text-md pl-1 font-bold tracking-wide text-teal-600",children:"Relationship"}),S.jsxs("div",{className:"bg-primary/5 max-h-96 overflow-auto rounded p-1",children:[S.jsx(Ur,{name:"Id",value:e.id}),e.type&&S.jsx(Ur,{name:"Type",value:e.type}),S.jsx(Ur,{name:"Source",value:e.sourceNode?e.sourceNode.labels.join(", "):e.source,onClick:()=>{yt.getState().setSelectedNode(e.source,!0)}}),S.jsx(Ur,{name:"Target",value:e.targetNode?e.targetNode.labels.join(", "):e.target,onClick:()=>{yt.getState().setSelectedNode(e.target,!0)}})]}),S.jsx("label",{className:"text-md pl-1 font-bold tracking-wide text-yellow-400/90",children:"Properties"}),S.jsx("div",{className:"bg-primary/5 max-h-96 overflow-auto rounded p-1",children:Object.keys(e.properties).sort().map(t=>S.jsx(Ur,{name:t,value:e.properties[t]},t))})]}),hE={allowInvalidContainer:!0,defaultNodeType:"default",defaultEdgeType:"curvedArrow",renderEdgeLabels:!1,edgeProgramClasses:{arrow:fA,curvedArrow:tU,curvedNoArrow:eU},nodeProgramClasses:{default:PB,circel:fu,point:fB},labelGridCellSize:60,labelRenderedSizeThreshold:12,enableEdgeEvents:!0,labelColor:{color:"#000",attribute:"labelColor"},edgeLabelColor:{color:"#000",attribute:"labelColor"},edgeLabelSize:8,labelSize:12},OH=()=>{const e=bA(),t=pr(),[n,r]=E.useState(null);return E.useEffect(()=>{e({downNode:i=>{r(i.node),t.getGraph().setNodeAttribute(i.node,"highlighted",!0)},mousemovebody:i=>{if(!n)return;const o=t.viewportToGraph(i);t.getGraph().setNodeAttribute(n,"x",o.x),t.getGraph().setNodeAttribute(n,"y",o.y),i.preventSigmaDefault(),i.original.preventDefault(),i.original.stopPropagation()},mouseup:()=>{n&&(r(null),t.getGraph().removeNodeAttribute(n,"highlighted"))},mousedown:()=>{t.getCustomBBox()||t.setCustomBBox(t.getBBox())}})},[e,t,n]),null},LH=()=>{const[e,t]=E.useState(hE),n=yt.use.selectedNode(),r=yt.use.focusedNode(),i=yt.use.moveToSelectedNode(),o=Qe.use.showPropertyPanel(),s=Qe.use.showNodeSearchBar(),u=Qe.use.showNodeLabel(),f=Qe.use.enableEdgeEvents(),d=Qe.use.enableNodeDrag(),p=Qe.use.showEdgeLabel();E.useEffect(()=>{t({...hE,enableEdgeEvents:f,renderEdgeLabels:p,renderLabels:u})},[u,f,p]);const m=E.useCallback(x=>{x===null?yt.getState().setFocusedNode(null):x.type==="nodes"&&yt.getState().setFocusedNode(x.id)},[]),v=E.useCallback(x=>{x===null?yt.getState().setSelectedNode(null):x.type==="nodes"&&yt.getState().setSelectedNode(x.id,!0)},[]),g=E.useMemo(()=>r??n,[r,n]),w=E.useMemo(()=>n?{type:"nodes",id:n}:null,[n]);return S.jsxs(aB,{settings:e,className:"!bg-background !size-full overflow-hidden",children:[S.jsx(q6,{}),d&&S.jsx(OH,{}),S.jsx(iU,{node:g,move:i}),S.jsxs("div",{className:"absolute top-2 left-2 flex items-start gap-2",children:[S.jsx(CH,{}),s&&S.jsx(EH,{value:w,onFocus:m,onChange:v})]}),S.jsxs("div",{className:"bg-background/60 absolute bottom-2 left-2 flex flex-col rounded-xl border-2 backdrop-blur-lg",children:[S.jsx(rH,{}),S.jsx(Y6,{}),S.jsx(S6,{}),S.jsx(W6,{})]}),o&&S.jsx("div",{className:"absolute top-2 right-2",children:S.jsx(TH,{})})]})},mR=E.forwardRef(({className:e,...t},n)=>S.jsx("div",{className:"relative w-full overflow-auto",children:S.jsx("table",{ref:n,className:Me("w-full caption-bottom text-sm",e),...t})}));mR.displayName="Table";const gR=E.forwardRef(({className:e,...t},n)=>S.jsx("thead",{ref:n,className:Me("[&_tr]:border-b",e),...t}));gR.displayName="TableHeader";const vR=E.forwardRef(({className:e,...t},n)=>S.jsx("tbody",{ref:n,className:Me("[&_tr:last-child]:border-0",e),...t}));vR.displayName="TableBody";const zH=E.forwardRef(({className:e,...t},n)=>S.jsx("tfoot",{ref:n,className:Me("bg-muted/50 border-t font-medium [&>tr]:last:border-b-0",e),...t}));zH.displayName="TableFooter";const tv=E.forwardRef(({className:e,...t},n)=>S.jsx("tr",{ref:n,className:Me("hover:bg-muted/50 data-[state=selected]:bg-muted border-b transition-colors",e),...t}));tv.displayName="TableRow";const bi=E.forwardRef(({className:e,...t},n)=>S.jsx("th",{ref:n,className:Me("text-muted-foreground h-10 px-2 text-left align-middle font-medium [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...t}));bi.displayName="TableHead";const xi=E.forwardRef(({className:e,...t},n)=>S.jsx("td",{ref:n,className:Me("p-2 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...t}));xi.displayName="TableCell";const jH=E.forwardRef(({className:e,...t},n)=>S.jsx("caption",{ref:n,className:Me("text-muted-foreground mt-4 text-sm",e),...t}));jH.displayName="TableCaption";const Ks=E.forwardRef(({className:e,...t},n)=>S.jsx("div",{ref:n,className:Me("bg-card text-card-foreground rounded-xl border shadow",e),...t}));Ks.displayName="Card";const Nf=E.forwardRef(({className:e,...t},n)=>S.jsx("div",{ref:n,className:Me("flex flex-col space-y-1.5 p-6",e),...t}));Nf.displayName="CardHeader";const Zs=E.forwardRef(({className:e,...t},n)=>S.jsx("div",{ref:n,className:Me("leading-none font-semibold tracking-tight",e),...t}));Zs.displayName="CardTitle";const xd=E.forwardRef(({className:e,...t},n)=>S.jsx("div",{ref:n,className:Me("text-muted-foreground text-sm",e),...t}));xd.displayName="CardDescription";const Of=E.forwardRef(({className:e,...t},n)=>S.jsx("div",{ref:n,className:Me("p-6 pt-0",e),...t}));Of.displayName="CardContent";const MH=E.forwardRef(({className:e,...t},n)=>S.jsx("div",{ref:n,className:Me("flex items-center p-6 pt-0",e),...t}));MH.displayName="CardFooter";function PH({title:e,description:t,icon:n=CM,action:r,className:i,...o}){return S.jsxs(Ks,{className:Me("flex w-full flex-col items-center justify-center space-y-6 bg-transparent p-16",i),...o,children:[S.jsx("div",{className:"mr-4 shrink-0 rounded-full border border-dashed p-4",children:S.jsx(n,{className:"text-muted-foreground size-8","aria-hidden":"true"})}),S.jsxs("div",{className:"flex flex-col items-center gap-1.5 text-center",children:[S.jsx(Zs,{children:e}),t?S.jsx(xd,{children:t}):null]}),r||null]})}var Xm={exports:{}},Km,pE;function FH(){if(pE)return Km;pE=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return Km=e,Km}var Zm,mE;function IH(){if(mE)return Zm;mE=1;var e=FH();function t(){}function n(){}return n.resetWarningCache=t,Zm=function(){function r(s,u,f,d,p,m){if(m!==e){var v=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw v.name="Invariant Violation",v}}r.isRequired=r;function i(){return r}var o={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:i,element:r,elementType:r,instanceOf:i,node:r,objectOf:i,oneOf:i,oneOfType:i,shape:i,exact:i,checkPropTypes:n,resetWarningCache:t};return o.PropTypes=o,o},Zm}var gE;function GH(){return gE||(gE=1,Xm.exports=IH()()),Xm.exports}var BH=GH();const Ct=fn(BH),UH=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 dl(e,t,n){const r=HH(e),{webkitRelativePath:i}=e,o=typeof t=="string"?t:typeof i=="string"&&i.length>0?i:`./${e.name}`;return typeof r.path!="string"&&vE(r,"path",o),vE(r,"relativePath",o),r}function HH(e){const{name:t}=e;if(t&&t.lastIndexOf(".")!==-1&&!e.type){const r=t.split(".").pop().toLowerCase(),i=UH.get(r);i&&Object.defineProperty(e,"type",{value:i,writable:!1,configurable:!1,enumerable:!0})}return e}function vE(e,t,n){Object.defineProperty(e,t,{value:n,writable:!1,configurable:!1,enumerable:!0})}const $H=[".DS_Store","Thumbs.db"];function VH(e){return no(this,void 0,void 0,function*(){return Lf(e)&&qH(e.dataTransfer)?KH(e.dataTransfer,e.type):YH(e)?WH(e):Array.isArray(e)&&e.every(t=>"getFile"in t&&typeof t.getFile=="function")?XH(e):[]})}function qH(e){return Lf(e)}function YH(e){return Lf(e)&&Lf(e.target)}function Lf(e){return typeof e=="object"&&e!==null}function WH(e){return nv(e.target.files).map(t=>dl(t))}function XH(e){return no(this,void 0,void 0,function*(){return(yield Promise.all(e.map(n=>n.getFile()))).map(n=>dl(n))})}function KH(e,t){return no(this,void 0,void 0,function*(){if(e.items){const n=nv(e.items).filter(i=>i.kind==="file");if(t!=="drop")return n;const r=yield Promise.all(n.map(ZH));return yE(yR(r))}return yE(nv(e.files).map(n=>dl(n)))})}function yE(e){return e.filter(t=>$H.indexOf(t.name)===-1)}function nv(e){if(e===null)return[];const t=[];for(let n=0;n[...t,...Array.isArray(n)?yR(n):[n]],[])}function bE(e,t){return no(this,void 0,void 0,function*(){var n;if(globalThis.isSecureContext&&typeof e.getAsFileSystemHandle=="function"){const o=yield e.getAsFileSystemHandle();if(o===null)throw new Error(`${e} is not a File`);if(o!==void 0){const s=yield o.getFile();return s.handle=o,dl(s)}}const r=e.getAsFile();if(!r)throw new Error(`${e} is not a File`);return dl(r,(n=t==null?void 0:t.fullPath)!==null&&n!==void 0?n:void 0)})}function QH(e){return no(this,void 0,void 0,function*(){return e.isDirectory?bR(e):JH(e)})}function bR(e){const t=e.createReader();return new Promise((n,r)=>{const i=[];function o(){t.readEntries(s=>no(this,void 0,void 0,function*(){if(s.length){const u=Promise.all(s.map(QH));i.push(u),o()}else try{const u=yield Promise.all(i);n(u)}catch(u){r(u)}}),s=>{r(s)})}o()})}function JH(e){return no(this,void 0,void 0,function*(){return new Promise((t,n)=>{e.file(r=>{const i=dl(r,e.fullPath);t(i)},r=>{n(r)})})})}var Xc={},xE;function e$(){return xE||(xE=1,Xc.__esModule=!0,Xc.default=function(e,t){if(e&&t){var n=Array.isArray(t)?t:t.split(",");if(n.length===0)return!0;var r=e.name||"",i=(e.type||"").toLowerCase(),o=i.replace(/\/.*$/,"");return n.some(function(s){var u=s.trim().toLowerCase();return u.charAt(0)==="."?r.toLowerCase().endsWith(u):u.endsWith("/*")?o===u.replace(/\/.*$/,""):i===u})}return!0}),Xc}var t$=e$();const Qm=fn(t$);function wE(e){return i$(e)||r$(e)||wR(e)||n$()}function n$(){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 r$(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function i$(e){if(Array.isArray(e))return rv(e)}function SE(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function EE(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&arguments[0]!==void 0?arguments[0]:"",n=t.split(","),r=n.length>1?"one of ".concat(n.join(", ")):n[0];return{code:u$,message:"File type must be ".concat(r)}},_E=function(t){return{code:c$,message:"File is larger than ".concat(t," ").concat(t===1?"byte":"bytes")}},kE=function(t){return{code:f$,message:"File is smaller than ".concat(t," ").concat(t===1?"byte":"bytes")}},p$={code:d$,message:"Too many files"};function SR(e,t){var n=e.type==="application/x-moz-file"||s$(e,t);return[n,n?null:h$(t)]}function ER(e,t,n){if($a(e.size))if($a(t)&&$a(n)){if(e.size>n)return[!1,_E(n)];if(e.sizen)return[!1,_E(n)]}return[!0,null]}function $a(e){return e!=null}function m$(e){var t=e.files,n=e.accept,r=e.minSize,i=e.maxSize,o=e.multiple,s=e.maxFiles,u=e.validator;return!o&&t.length>1||o&&s>=1&&t.length>s?!1:t.every(function(f){var d=SR(f,n),p=Qs(d,1),m=p[0],v=ER(f,r,i),g=Qs(v,1),w=g[0],x=u?u(f):null;return m&&w&&!x})}function zf(e){return typeof e.isPropagationStopped=="function"?e.isPropagationStopped():typeof e.cancelBubble<"u"?e.cancelBubble:!1}function Kc(e){return e.dataTransfer?Array.prototype.some.call(e.dataTransfer.types,function(t){return t==="Files"||t==="application/x-moz-file"}):!!e.target&&!!e.target.files}function CE(e){e.preventDefault()}function g$(e){return e.indexOf("MSIE")!==-1||e.indexOf("Trident/")!==-1}function v$(e){return e.indexOf("Edge/")!==-1}function y$(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:window.navigator.userAgent;return g$(e)||v$(e)}function Ir(){for(var e=arguments.length,t=new Array(e),n=0;n1?i-1:0),s=1;se.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function j$(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,o;for(o=0;o=0)&&(n[i]=e[i]);return n}var wd=E.forwardRef(function(e,t){var n=e.children,r=jf(e,_$),i=M$(r),o=i.open,s=jf(i,k$);return E.useImperativeHandle(t,function(){return{open:o}},[o]),be.createElement(E.Fragment,null,n(jt(jt({},s),{},{open:o})))});wd.displayName="Dropzone";var TR={disabled:!1,getFilesFromEvent:VH,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};wd.defaultProps=TR;wd.propTypes={children:Ct.func,accept:Ct.objectOf(Ct.arrayOf(Ct.string)),multiple:Ct.bool,preventDropOnDocument:Ct.bool,noClick:Ct.bool,noKeyboard:Ct.bool,noDrag:Ct.bool,noDragEventsBubbling:Ct.bool,minSize:Ct.number,maxSize:Ct.number,maxFiles:Ct.number,disabled:Ct.bool,getFilesFromEvent:Ct.func,onFileDialogCancel:Ct.func,onFileDialogOpen:Ct.func,useFsAccessApi:Ct.bool,autoFocus:Ct.bool,onDragEnter:Ct.func,onDragLeave:Ct.func,onDragOver:Ct.func,onDrop:Ct.func,onDropAccepted:Ct.func,onDropRejected:Ct.func,onError:Ct.func,validator:Ct.func};var ov={isFocused:!1,isFileDialogActive:!1,isDragActive:!1,isDragAccept:!1,isDragReject:!1,acceptedFiles:[],fileRejections:[]};function M$(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=jt(jt({},TR),e),n=t.accept,r=t.disabled,i=t.getFilesFromEvent,o=t.maxSize,s=t.minSize,u=t.multiple,f=t.maxFiles,d=t.onDragEnter,p=t.onDragLeave,m=t.onDragOver,v=t.onDrop,g=t.onDropAccepted,w=t.onDropRejected,x=t.onFileDialogCancel,k=t.onFileDialogOpen,C=t.useFsAccessApi,_=t.autoFocus,T=t.preventDropOnDocument,N=t.noClick,D=t.noKeyboard,z=t.noDrag,R=t.noDragEventsBubbling,B=t.onError,P=t.validator,j=E.useMemo(function(){return w$(n)},[n]),V=E.useMemo(function(){return x$(n)},[n]),q=E.useMemo(function(){return typeof k=="function"?k:AE},[k]),I=E.useMemo(function(){return typeof x=="function"?x:AE},[x]),Y=E.useRef(null),Z=E.useRef(null),U=E.useReducer(P$,ov),G=Jm(U,2),F=G[0],K=G[1],A=F.isFocused,$=F.isFileDialogActive,M=E.useRef(typeof window<"u"&&window.isSecureContext&&C&&b$()),O=function(){!M.current&&$&&setTimeout(function(){if(Z.current){var Ne=Z.current.files;Ne.length||(K({type:"closeDialog"}),I())}},300)};E.useEffect(function(){return window.addEventListener("focus",O,!1),function(){window.removeEventListener("focus",O,!1)}},[Z,$,I,M]);var X=E.useRef([]),re=function(Ne){Y.current&&Y.current.contains(Ne.target)||(Ne.preventDefault(),X.current=[])};E.useEffect(function(){return T&&(document.addEventListener("dragover",CE,!1),document.addEventListener("drop",re,!1)),function(){T&&(document.removeEventListener("dragover",CE),document.removeEventListener("drop",re))}},[Y,T]),E.useEffect(function(){return!r&&_&&Y.current&&Y.current.focus(),function(){}},[Y,_,r]);var ue=E.useCallback(function(ve){B?B(ve):console.error(ve)},[B]),ae=E.useCallback(function(ve){ve.preventDefault(),ve.persist(),Se(ve),X.current=[].concat(A$(X.current),[ve.target]),Kc(ve)&&Promise.resolve(i(ve)).then(function(Ne){if(!(zf(ve)&&!R)){var te=Ne.length,de=te>0&&m$({files:Ne,accept:j,minSize:s,maxSize:o,multiple:u,maxFiles:f,validator:P}),Oe=te>0&&!de;K({isDragAccept:de,isDragReject:Oe,isDragActive:!0,type:"setDraggedFiles"}),d&&d(ve)}}).catch(function(Ne){return ue(Ne)})},[i,d,ue,R,j,s,o,u,f,P]),oe=E.useCallback(function(ve){ve.preventDefault(),ve.persist(),Se(ve);var Ne=Kc(ve);if(Ne&&ve.dataTransfer)try{ve.dataTransfer.dropEffect="copy"}catch{}return Ne&&m&&m(ve),!1},[m,R]),Ce=E.useCallback(function(ve){ve.preventDefault(),ve.persist(),Se(ve);var Ne=X.current.filter(function(de){return Y.current&&Y.current.contains(de)}),te=Ne.indexOf(ve.target);te!==-1&&Ne.splice(te,1),X.current=Ne,!(Ne.length>0)&&(K({type:"setDraggedFiles",isDragActive:!1,isDragAccept:!1,isDragReject:!1}),Kc(ve)&&p&&p(ve))},[Y,p,R]),he=E.useCallback(function(ve,Ne){var te=[],de=[];ve.forEach(function(Oe){var $e=SR(Oe,j),Ye=Jm($e,2),vt=Ye[0],Mt=Ye[1],bt=ER(Oe,s,o),rt=Jm(bt,2),qt=rt[0],at=rt[1],At=P?P(Oe):null;if(vt&&qt&&!At)te.push(Oe);else{var rn=[Mt,at];At&&(rn=rn.concat(At)),de.push({file:Oe,errors:rn.filter(function(io){return io})})}}),(!u&&te.length>1||u&&f>=1&&te.length>f)&&(te.forEach(function(Oe){de.push({file:Oe,errors:[p$]})}),te.splice(0)),K({acceptedFiles:te,fileRejections:de,isDragReject:de.length>0,type:"setFiles"}),v&&v(te,de,Ne),de.length>0&&w&&w(de,Ne),te.length>0&&g&&g(te,Ne)},[K,u,j,s,o,f,v,g,w,P]),Ee=E.useCallback(function(ve){ve.preventDefault(),ve.persist(),Se(ve),X.current=[],Kc(ve)&&Promise.resolve(i(ve)).then(function(Ne){zf(ve)&&!R||he(Ne,ve)}).catch(function(Ne){return ue(Ne)}),K({type:"reset"})},[i,he,ue,R]),we=E.useCallback(function(){if(M.current){K({type:"openDialog"}),q();var ve={multiple:u,types:V};window.showOpenFilePicker(ve).then(function(Ne){return i(Ne)}).then(function(Ne){he(Ne,null),K({type:"closeDialog"})}).catch(function(Ne){S$(Ne)?(I(Ne),K({type:"closeDialog"})):E$(Ne)?(M.current=!1,Z.current?(Z.current.value=null,Z.current.click()):ue(new Error("Cannot open the file picker because the https://developer.mozilla.org/en-US/docs/Web/API/File_System_Access_API is not supported and no was provided."))):ue(Ne)});return}Z.current&&(K({type:"openDialog"}),q(),Z.current.value=null,Z.current.click())},[K,q,I,C,he,ue,V,u]),Pe=E.useCallback(function(ve){!Y.current||!Y.current.isEqualNode(ve.target)||(ve.key===" "||ve.key==="Enter"||ve.keyCode===32||ve.keyCode===13)&&(ve.preventDefault(),we())},[Y,we]),Ae=E.useCallback(function(){K({type:"focus"})},[]),xe=E.useCallback(function(){K({type:"blur"})},[]),ee=E.useCallback(function(){N||(y$()?setTimeout(we,0):we())},[N,we]),ce=function(Ne){return r?null:Ne},Te=function(Ne){return D?null:ce(Ne)},ge=function(Ne){return z?null:ce(Ne)},Se=function(Ne){R&&Ne.stopPropagation()},ie=E.useMemo(function(){return function(){var ve=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},Ne=ve.refKey,te=Ne===void 0?"ref":Ne,de=ve.role,Oe=ve.onKeyDown,$e=ve.onFocus,Ye=ve.onBlur,vt=ve.onClick,Mt=ve.onDragEnter,bt=ve.onDragOver,rt=ve.onDragLeave,qt=ve.onDrop,at=jf(ve,C$);return jt(jt(av({onKeyDown:Te(Ir(Oe,Pe)),onFocus:Te(Ir($e,Ae)),onBlur:Te(Ir(Ye,xe)),onClick:ce(Ir(vt,ee)),onDragEnter:ge(Ir(Mt,ae)),onDragOver:ge(Ir(bt,oe)),onDragLeave:ge(Ir(rt,Ce)),onDrop:ge(Ir(qt,Ee)),role:typeof de=="string"&&de!==""?de:"presentation"},te,Y),!r&&!D?{tabIndex:0}:{}),at)}},[Y,Pe,Ae,xe,ee,ae,oe,Ce,Ee,D,z,r]),He=E.useCallback(function(ve){ve.stopPropagation()},[]),Ge=E.useMemo(function(){return function(){var ve=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},Ne=ve.refKey,te=Ne===void 0?"ref":Ne,de=ve.onChange,Oe=ve.onClick,$e=jf(ve,T$),Ye=av({accept:j,multiple:u,type:"file",style:{border:0,clip:"rect(0, 0, 0, 0)",clipPath:"inset(50%)",height:"1px",margin:"0 -1px -1px 0",overflow:"hidden",padding:0,position:"absolute",width:"1px",whiteSpace:"nowrap"},onChange:ce(Ir(de,Ee)),onClick:ce(Ir(Oe,He)),tabIndex:-1},te,Z);return jt(jt({},Ye),$e)}},[Z,n,u,Ee,r]);return jt(jt({},F),{},{isFocused:A&&!r,getRootProps:ie,getInputProps:Ge,rootRef:Y,inputRef:Z,open:ce(we)})}function P$(e,t){switch(t.type){case"focus":return jt(jt({},e),{},{isFocused:!0});case"blur":return jt(jt({},e),{},{isFocused:!1});case"openDialog":return jt(jt({},ov),{},{isFileDialogActive:!0});case"closeDialog":return jt(jt({},e),{},{isFileDialogActive:!1});case"setDraggedFiles":return jt(jt({},e),{},{isDragActive:t.isDragActive,isDragAccept:t.isDragAccept,isDragReject:t.isDragReject});case"setFiles":return jt(jt({},e),{},{acceptedFiles:t.acceptedFiles,fileRejections:t.fileRejections,isDragReject:t.isDragReject});case"reset":return jt({},ov);default:return e}}function AE(){}var My="Progress",Py=100,[F$,mK]=hr(My),[I$,G$]=F$(My),AR=E.forwardRef((e,t)=>{const{__scopeProgress:n,value:r=null,max:i,getValueLabel:o=B$,...s}=e;(i||i===0)&&!RE(i)&&console.error(U$(`${i}`,"Progress"));const u=RE(i)?i:Py;r!==null&&!DE(r,u)&&console.error(H$(`${r}`,"Progress"));const f=DE(r,u)?r:null,d=Mf(f)?o(f,u):void 0;return S.jsx(I$,{scope:n,value:f,max:u,children:S.jsx(We.div,{"aria-valuemax":u,"aria-valuemin":0,"aria-valuenow":Mf(f)?f:void 0,"aria-valuetext":d,role:"progressbar","data-state":NR(f,u),"data-value":f??void 0,"data-max":u,...s,ref:t})})});AR.displayName=My;var RR="ProgressIndicator",DR=E.forwardRef((e,t)=>{const{__scopeProgress:n,...r}=e,i=G$(RR,n);return S.jsx(We.div,{"data-state":NR(i.value,i.max),"data-value":i.value??void 0,"data-max":i.max,...r,ref:t})});DR.displayName=RR;function B$(e,t){return`${Math.round(e/t*100)}%`}function NR(e,t){return e==null?"indeterminate":e===t?"complete":"loading"}function Mf(e){return typeof e=="number"}function RE(e){return Mf(e)&&!isNaN(e)&&e>0}function DE(e,t){return Mf(e)&&!isNaN(e)&&e<=t&&e>=0}function U$(e,t){return`Invalid prop \`max\` of value \`${e}\` supplied to \`${t}\`. Only numbers greater than 0 are valid max values. Defaulting to \`${Py}\`.`}function H$(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 ${Py} if no \`max\` prop is set) - - \`null\` or \`undefined\` if the progress is indeterminate. - -Defaulting to \`null\`.`}var OR=AR,$$=DR;const LR=E.forwardRef(({className:e,value:t,...n},r)=>S.jsx(OR,{ref:r,className:Me("bg-secondary relative h-4 w-full overflow-hidden rounded-full",e),...n,children:S.jsx($$,{className:"bg-primary h-full w-full flex-1 transition-all",style:{transform:`translateX(-${100-(t||0)}%)`}})}));LR.displayName=OR.displayName;function lv(e,[t,n]){return Math.min(n,Math.max(t,e))}function V$(e,t){return E.useReducer((n,r)=>t[n][r]??n,e)}var Fy="ScrollArea",[zR,gK]=hr(Fy),[q$,mr]=zR(Fy),jR=E.forwardRef((e,t)=>{const{__scopeScrollArea:n,type:r="hover",dir:i,scrollHideDelay:o=600,...s}=e,[u,f]=E.useState(null),[d,p]=E.useState(null),[m,v]=E.useState(null),[g,w]=E.useState(null),[x,k]=E.useState(null),[C,_]=E.useState(0),[T,N]=E.useState(0),[D,z]=E.useState(!1),[R,B]=E.useState(!1),P=dt(t,V=>f(V)),j=hd(i);return S.jsx(q$,{scope:n,type:r,dir:j,scrollHideDelay:o,scrollArea:u,viewport:d,onViewportChange:p,content:m,onContentChange:v,scrollbarX:g,onScrollbarXChange:w,scrollbarXEnabled:D,onScrollbarXEnabledChange:z,scrollbarY:x,onScrollbarYChange:k,scrollbarYEnabled:R,onScrollbarYEnabledChange:B,onCornerWidthChange:_,onCornerHeightChange:N,children:S.jsx(We.div,{dir:j,...s,ref:P,style:{position:"relative","--radix-scroll-area-corner-width":C+"px","--radix-scroll-area-corner-height":T+"px",...e.style}})})});jR.displayName=Fy;var MR="ScrollAreaViewport",PR=E.forwardRef((e,t)=>{const{__scopeScrollArea:n,children:r,nonce:i,...o}=e,s=mr(MR,n),u=E.useRef(null),f=dt(t,u,s.onViewportChange);return S.jsxs(S.Fragment,{children:[S.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:i}),S.jsx(We.div,{"data-radix-scroll-area-viewport":"",...o,ref:f,style:{overflowX:s.scrollbarXEnabled?"scroll":"hidden",overflowY:s.scrollbarYEnabled?"scroll":"hidden",...e.style},children:S.jsx("div",{ref:s.onContentChange,style:{minWidth:"100%",display:"table"},children:r})})]})});PR.displayName=MR;var Xr="ScrollAreaScrollbar",Iy=E.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=mr(Xr,e.__scopeScrollArea),{onScrollbarXEnabledChange:o,onScrollbarYEnabledChange:s}=i,u=e.orientation==="horizontal";return E.useEffect(()=>(u?o(!0):s(!0),()=>{u?o(!1):s(!1)}),[u,o,s]),i.type==="hover"?S.jsx(Y$,{...r,ref:t,forceMount:n}):i.type==="scroll"?S.jsx(W$,{...r,ref:t,forceMount:n}):i.type==="auto"?S.jsx(FR,{...r,ref:t,forceMount:n}):i.type==="always"?S.jsx(Gy,{...r,ref:t}):null});Iy.displayName=Xr;var Y$=E.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=mr(Xr,e.__scopeScrollArea),[o,s]=E.useState(!1);return E.useEffect(()=>{const u=i.scrollArea;let f=0;if(u){const d=()=>{window.clearTimeout(f),s(!0)},p=()=>{f=window.setTimeout(()=>s(!1),i.scrollHideDelay)};return u.addEventListener("pointerenter",d),u.addEventListener("pointerleave",p),()=>{window.clearTimeout(f),u.removeEventListener("pointerenter",d),u.removeEventListener("pointerleave",p)}}},[i.scrollArea,i.scrollHideDelay]),S.jsx(Zn,{present:n||o,children:S.jsx(FR,{"data-state":o?"visible":"hidden",...r,ref:t})})}),W$=E.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=mr(Xr,e.__scopeScrollArea),o=e.orientation==="horizontal",s=Ed(()=>f("SCROLL_END"),100),[u,f]=V$("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return E.useEffect(()=>{if(u==="idle"){const d=window.setTimeout(()=>f("HIDE"),i.scrollHideDelay);return()=>window.clearTimeout(d)}},[u,i.scrollHideDelay,f]),E.useEffect(()=>{const d=i.viewport,p=o?"scrollLeft":"scrollTop";if(d){let m=d[p];const v=()=>{const g=d[p];m!==g&&(f("SCROLL"),s()),m=g};return d.addEventListener("scroll",v),()=>d.removeEventListener("scroll",v)}},[i.viewport,o,f,s]),S.jsx(Zn,{present:n||u!=="hidden",children:S.jsx(Gy,{"data-state":u==="hidden"?"hidden":"visible",...r,ref:t,onPointerEnter:qe(e.onPointerEnter,()=>f("POINTER_ENTER")),onPointerLeave:qe(e.onPointerLeave,()=>f("POINTER_LEAVE"))})})}),FR=E.forwardRef((e,t)=>{const n=mr(Xr,e.__scopeScrollArea),{forceMount:r,...i}=e,[o,s]=E.useState(!1),u=e.orientation==="horizontal",f=Ed(()=>{if(n.viewport){const d=n.viewport.offsetWidth{const{orientation:n="vertical",...r}=e,i=mr(Xr,e.__scopeScrollArea),o=E.useRef(null),s=E.useRef(0),[u,f]=E.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),d=HR(u.viewport,u.content),p={...r,sizes:u,onSizesChange:f,hasThumb:d>0&&d<1,onThumbChange:v=>o.current=v,onThumbPointerUp:()=>s.current=0,onThumbPointerDown:v=>s.current=v};function m(v,g){return e9(v,s.current,u,g)}return n==="horizontal"?S.jsx(X$,{...p,ref:t,onThumbPositionChange:()=>{if(i.viewport&&o.current){const v=i.viewport.scrollLeft,g=NE(v,u,i.dir);o.current.style.transform=`translate3d(${g}px, 0, 0)`}},onWheelScroll:v=>{i.viewport&&(i.viewport.scrollLeft=v)},onDragScroll:v=>{i.viewport&&(i.viewport.scrollLeft=m(v,i.dir))}}):n==="vertical"?S.jsx(K$,{...p,ref:t,onThumbPositionChange:()=>{if(i.viewport&&o.current){const v=i.viewport.scrollTop,g=NE(v,u);o.current.style.transform=`translate3d(0, ${g}px, 0)`}},onWheelScroll:v=>{i.viewport&&(i.viewport.scrollTop=v)},onDragScroll:v=>{i.viewport&&(i.viewport.scrollTop=m(v))}}):null}),X$=E.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...i}=e,o=mr(Xr,e.__scopeScrollArea),[s,u]=E.useState(),f=E.useRef(null),d=dt(t,f,o.onScrollbarXChange);return E.useEffect(()=>{f.current&&u(getComputedStyle(f.current))},[f]),S.jsx(GR,{"data-orientation":"horizontal",...i,ref:d,sizes:n,style:{bottom:0,left:o.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:o.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":Sd(n)+"px",...e.style},onThumbPointerDown:p=>e.onThumbPointerDown(p.x),onDragScroll:p=>e.onDragScroll(p.x),onWheelScroll:(p,m)=>{if(o.viewport){const v=o.viewport.scrollLeft+p.deltaX;e.onWheelScroll(v),VR(v,m)&&p.preventDefault()}},onResize:()=>{f.current&&o.viewport&&s&&r({content:o.viewport.scrollWidth,viewport:o.viewport.offsetWidth,scrollbar:{size:f.current.clientWidth,paddingStart:Ff(s.paddingLeft),paddingEnd:Ff(s.paddingRight)}})}})}),K$=E.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...i}=e,o=mr(Xr,e.__scopeScrollArea),[s,u]=E.useState(),f=E.useRef(null),d=dt(t,f,o.onScrollbarYChange);return E.useEffect(()=>{f.current&&u(getComputedStyle(f.current))},[f]),S.jsx(GR,{"data-orientation":"vertical",...i,ref:d,sizes:n,style:{top:0,right:o.dir==="ltr"?0:void 0,left:o.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":Sd(n)+"px",...e.style},onThumbPointerDown:p=>e.onThumbPointerDown(p.y),onDragScroll:p=>e.onDragScroll(p.y),onWheelScroll:(p,m)=>{if(o.viewport){const v=o.viewport.scrollTop+p.deltaY;e.onWheelScroll(v),VR(v,m)&&p.preventDefault()}},onResize:()=>{f.current&&o.viewport&&s&&r({content:o.viewport.scrollHeight,viewport:o.viewport.offsetHeight,scrollbar:{size:f.current.clientHeight,paddingStart:Ff(s.paddingTop),paddingEnd:Ff(s.paddingBottom)}})}})}),[Z$,IR]=zR(Xr),GR=E.forwardRef((e,t)=>{const{__scopeScrollArea:n,sizes:r,hasThumb:i,onThumbChange:o,onThumbPointerUp:s,onThumbPointerDown:u,onThumbPositionChange:f,onDragScroll:d,onWheelScroll:p,onResize:m,...v}=e,g=mr(Xr,n),[w,x]=E.useState(null),k=dt(t,P=>x(P)),C=E.useRef(null),_=E.useRef(""),T=g.viewport,N=r.content-r.viewport,D=un(p),z=un(f),R=Ed(m,10);function B(P){if(C.current){const j=P.clientX-C.current.left,V=P.clientY-C.current.top;d({x:j,y:V})}}return E.useEffect(()=>{const P=j=>{const V=j.target;(w==null?void 0:w.contains(V))&&D(j,N)};return document.addEventListener("wheel",P,{passive:!1}),()=>document.removeEventListener("wheel",P,{passive:!1})},[T,w,N,D]),E.useEffect(z,[r,z]),hl(w,R),hl(g.content,R),S.jsx(Z$,{scope:n,scrollbar:w,hasThumb:i,onThumbChange:un(o),onThumbPointerUp:un(s),onThumbPositionChange:z,onThumbPointerDown:un(u),children:S.jsx(We.div,{...v,ref:k,style:{position:"absolute",...v.style},onPointerDown:qe(e.onPointerDown,P=>{P.button===0&&(P.target.setPointerCapture(P.pointerId),C.current=w.getBoundingClientRect(),_.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",g.viewport&&(g.viewport.style.scrollBehavior="auto"),B(P))}),onPointerMove:qe(e.onPointerMove,B),onPointerUp:qe(e.onPointerUp,P=>{const j=P.target;j.hasPointerCapture(P.pointerId)&&j.releasePointerCapture(P.pointerId),document.body.style.webkitUserSelect=_.current,g.viewport&&(g.viewport.style.scrollBehavior=""),C.current=null})})})}),Pf="ScrollAreaThumb",BR=E.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=IR(Pf,e.__scopeScrollArea);return S.jsx(Zn,{present:n||i.hasThumb,children:S.jsx(Q$,{ref:t,...r})})}),Q$=E.forwardRef((e,t)=>{const{__scopeScrollArea:n,style:r,...i}=e,o=mr(Pf,n),s=IR(Pf,n),{onThumbPositionChange:u}=s,f=dt(t,m=>s.onThumbChange(m)),d=E.useRef(void 0),p=Ed(()=>{d.current&&(d.current(),d.current=void 0)},100);return E.useEffect(()=>{const m=o.viewport;if(m){const v=()=>{if(p(),!d.current){const g=t9(m,u);d.current=g,u()}};return u(),m.addEventListener("scroll",v),()=>m.removeEventListener("scroll",v)}},[o.viewport,p,u]),S.jsx(We.div,{"data-state":s.hasThumb?"visible":"hidden",...i,ref:f,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...r},onPointerDownCapture:qe(e.onPointerDownCapture,m=>{const g=m.target.getBoundingClientRect(),w=m.clientX-g.left,x=m.clientY-g.top;s.onThumbPointerDown({x:w,y:x})}),onPointerUp:qe(e.onPointerUp,s.onThumbPointerUp)})});BR.displayName=Pf;var By="ScrollAreaCorner",UR=E.forwardRef((e,t)=>{const n=mr(By,e.__scopeScrollArea),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&r?S.jsx(J$,{...e,ref:t}):null});UR.displayName=By;var J$=E.forwardRef((e,t)=>{const{__scopeScrollArea:n,...r}=e,i=mr(By,n),[o,s]=E.useState(0),[u,f]=E.useState(0),d=!!(o&&u);return hl(i.scrollbarX,()=>{var m;const p=((m=i.scrollbarX)==null?void 0:m.offsetHeight)||0;i.onCornerHeightChange(p),f(p)}),hl(i.scrollbarY,()=>{var m;const p=((m=i.scrollbarY)==null?void 0:m.offsetWidth)||0;i.onCornerWidthChange(p),s(p)}),d?S.jsx(We.div,{...r,ref:t,style:{width:o,height:u,position:"absolute",right:i.dir==="ltr"?0:void 0,left:i.dir==="rtl"?0:void 0,bottom:0,...e.style}}):null});function Ff(e){return e?parseInt(e,10):0}function HR(e,t){const n=e/t;return isNaN(n)?0:n}function Sd(e){const t=HR(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function e9(e,t,n,r="ltr"){const i=Sd(n),o=i/2,s=t||o,u=i-s,f=n.scrollbar.paddingStart+s,d=n.scrollbar.size-n.scrollbar.paddingEnd-u,p=n.content-n.viewport,m=r==="ltr"?[0,p]:[p*-1,0];return $R([f,d],m)(e)}function NE(e,t,n="ltr"){const r=Sd(t),i=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,o=t.scrollbar.size-i,s=t.content-t.viewport,u=o-r,f=n==="ltr"?[0,s]:[s*-1,0],d=lv(e,f);return $R([0,s],[0,u])(d)}function $R(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}function VR(e,t){return e>0&&e{})=>{let n={left:e.scrollLeft,top:e.scrollTop},r=0;return function i(){const o={left:e.scrollLeft,top:e.scrollTop},s=n.left!==o.left,u=n.top!==o.top;(s||u)&&t(),n=o,r=window.requestAnimationFrame(i)}(),()=>window.cancelAnimationFrame(r)};function Ed(e,t){const n=un(e),r=E.useRef(0);return E.useEffect(()=>()=>window.clearTimeout(r.current),[]),E.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(n,t)},[n,t])}function hl(e,t){const n=un(t);xn(()=>{let r=0;if(e){const i=new ResizeObserver(()=>{cancelAnimationFrame(r),r=window.requestAnimationFrame(n)});return i.observe(e),()=>{window.cancelAnimationFrame(r),i.unobserve(e)}}},[e,n])}var qR=jR,n9=PR,r9=UR;const YR=E.forwardRef(({className:e,children:t,...n},r)=>S.jsxs(qR,{ref:r,className:Me("relative overflow-hidden",e),...n,children:[S.jsx(n9,{className:"h-full w-full rounded-[inherit]",children:t}),S.jsx(WR,{}),S.jsx(r9,{})]}));YR.displayName=qR.displayName;const WR=E.forwardRef(({className:e,orientation:t="vertical",...n},r)=>S.jsx(Iy,{ref:r,orientation:t,className:Me("flex touch-none transition-colors select-none",t==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-[1px]",t==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",e),...n,children:S.jsx(BR,{className:"bg-border relative flex-1 rounded-full"})}));WR.displayName=Iy.displayName;function sv(e,t={}){const{decimals:n=0,sizeType:r="normal"}=t,i=["Bytes","KB","MB","GB","TB"],o=["Bytes","KiB","MiB","GiB","TiB"];if(e===0)return"0 Byte";const s=Math.floor(Math.log(e)/Math.log(1024));return`${(e/Math.pow(1024,s)).toFixed(n)} ${r==="accurate"?o[s]??"Bytes":i[s]??"Bytes"}`}function i9(e){const{value:t,onValueChange:n,onUpload:r,progresses:i,accept:o=wz,maxSize:s=1024*1024*200,maxFileCount:u=1,multiple:f=!1,disabled:d=!1,description:p,className:m,...v}=e,[g,w]=_i({prop:t,onChange:n}),x=E.useCallback((_,T)=>{if(!f&&u===1&&_.length>1){vn.error("Cannot upload more than 1 file at a time");return}if(((g==null?void 0:g.length)??0)+_.length>u){vn.error(`Cannot upload more than ${u} files`);return}const N=_.map(z=>Object.assign(z,{preview:URL.createObjectURL(z)})),D=g?[...g,...N]:N;if(w(D),T.length>0&&T.forEach(({file:z})=>{vn.error(`File ${z.name} was rejected`)}),r&&D.length>0&&D.length<=u){const z=D.length>0?`${D.length} files`:"file";vn.promise(r(D),{loading:`Uploading ${z}...`,success:()=>(w([]),`${z} uploaded`),error:`Failed to upload ${z}`})}},[g,u,f,r,w]);function k(_){if(!g)return;const T=g.filter((N,D)=>D!==_);w(T),n==null||n(T)}E.useEffect(()=>()=>{g&&g.forEach(_=>{XR(_)&&URL.revokeObjectURL(_.preview)})},[]);const C=d||((g==null?void 0:g.length)??0)>=u;return S.jsxs("div",{className:"relative flex flex-col gap-6 overflow-hidden",children:[S.jsx(wd,{onDrop:x,accept:o,maxSize:s,maxFiles:u,multiple:u>1||f,disabled:C,children:({getRootProps:_,getInputProps:T,isDragActive:N})=>S.jsxs("div",{..._(),className:Me("group border-muted-foreground/25 hover:bg-muted/25 relative grid h-52 w-full cursor-pointer place-items-center rounded-lg border-2 border-dashed px-5 py-2.5 text-center transition","ring-offset-background focus-visible:ring-ring focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-none",N&&"border-muted-foreground/50",C&&"pointer-events-none opacity-60",m),...v,children:[S.jsx("input",{...T()}),N?S.jsxs("div",{className:"flex flex-col items-center justify-center gap-4 sm:px-5",children:[S.jsx("div",{className:"rounded-full border border-dashed p-3",children:S.jsx(Ag,{className:"text-muted-foreground size-7","aria-hidden":"true"})}),S.jsx("p",{className:"text-muted-foreground font-medium",children:"Drop the files here"})]}):S.jsxs("div",{className:"flex flex-col items-center justify-center gap-4 sm:px-5",children:[S.jsx("div",{className:"rounded-full border border-dashed p-3",children:S.jsx(Ag,{className:"text-muted-foreground size-7","aria-hidden":"true"})}),S.jsxs("div",{className:"flex flex-col gap-px",children:[S.jsx("p",{className:"text-muted-foreground font-medium",children:"Drag and drop files here, or click to select files"}),p?S.jsx("p",{className:"text-muted-foreground/70 text-sm",children:p}):S.jsxs("p",{className:"text-muted-foreground/70 text-sm",children:["You can upload",u>1?` ${u===1/0?"multiple":u} - files (up to ${sv(s)} each)`:` a file with ${sv(s)}`,"Supported formats: TXT, MD, DOCX, PDF, PPTX, RTF, ODT, EPUB, HTML, HTM, TEX, JSON, XML, YAML, YML, CSV, LOG, CONF, INI, PROPERTIES, SQL, BAT, SH, C, CPP, PY, JAVA, JS, TS, SWIFT, GO, RB, PHP, CSS, SCSS, LESS"]})]})]})]})}),g!=null&&g.length?S.jsx(YR,{className:"h-fit w-full px-3",children:S.jsx("div",{className:"flex max-h-48 flex-col gap-4",children:g==null?void 0:g.map((_,T)=>S.jsx(a9,{file:_,onRemove:()=>k(T),progress:i==null?void 0:i[_.name]},T))})}):null]})}function a9({file:e,progress:t,onRemove:n}){return S.jsxs("div",{className:"relative flex items-center gap-2.5",children:[S.jsxs("div",{className:"flex flex-1 gap-2.5",children:[XR(e)?S.jsx(o9,{file:e}):null,S.jsxs("div",{className:"flex w-full flex-col gap-2",children:[S.jsxs("div",{className:"flex flex-col gap-px",children:[S.jsx("p",{className:"text-foreground/80 line-clamp-1 text-sm font-medium",children:e.name}),S.jsx("p",{className:"text-muted-foreground text-xs",children:sv(e.size)})]}),t?S.jsx(LR,{value:t}):null]})]}),S.jsx("div",{className:"flex items-center gap-2",children:S.jsxs(Ot,{type:"button",variant:"outline",size:"icon",className:"size-7",onClick:n,children:[S.jsx(Ek,{className:"size-4","aria-hidden":"true"}),S.jsx("span",{className:"sr-only",children:"Remove file"})]})})]})}function XR(e){return"preview"in e&&typeof e.preview=="string"}function o9({file:e}){return e.type.startsWith("image/")?S.jsx("div",{className:"aspect-square shrink-0 rounded-md object-cover"}):S.jsx(_M,{className:"text-muted-foreground size-10","aria-hidden":"true"})}function l9(){const[e,t]=E.useState(!1),[n,r]=E.useState(!1),[i,o]=E.useState({}),s=E.useCallback(async u=>{r(!0);try{await Promise.all(u.map(async f=>{try{const d=await uM(f,p=>{console.debug(`Uploading ${f.name}: ${p}%`),o(m=>({...m,[f.name]:p}))});d.status==="success"?vn.success(`Upload Success: -${f.name} uploaded successfully`):vn.error(`Upload Failed: -${f.name} -${d.message}`)}catch(d){vn.error(`Upload Failed: -${f.name} -${Cr(d)}`)}}))}catch(f){vn.error(`Upload Failed -`+Cr(f))}finally{r(!1)}},[r,o]);return S.jsxs(KA,{open:e,onOpenChange:u=>{n&&!u||t(u)},children:[S.jsx(ZA,{asChild:!0,children:S.jsxs(Ot,{variant:"default",side:"bottom",tooltip:"Upload documents",size:"sm",children:[S.jsx(Ag,{})," Upload"]})}),S.jsxs(Cy,{className:"sm:max-w-xl",onCloseAutoFocus:u=>u.preventDefault(),children:[S.jsxs(Ty,{children:[S.jsx(Ay,{children:"Upload documents"}),S.jsx(Ry,{children:"Drag and drop your documents here or click to browse."})]}),S.jsx(i9,{maxFileCount:1/0,maxSize:200*1024*1024,description:"supported types: TXT, MD, DOCX, PDF, PPTX, RTF, ODT, EPUB, HTML, HTM, TEX, JSON, XML, YAML, YML, CSV, LOG, CONF, INI, PROPERTIES, SQL, BAT, SH, C, CPP, PY, JAVA, JS, TS, SWIFT, GO, RB, PHP, CSS, SCSS, LESS",onUpload:s,progresses:i,disabled:n})]})]})}function s9(){const[e,t]=E.useState(!1),n=E.useCallback(async()=>{try{const r=await cM();r.status==="success"?(vn.success("Documents cleared successfully"),t(!1)):vn.error(`Clear Documents Failed: -${r.message}`)}catch(r){vn.error(`Clear Documents Failed: -`+Cr(r))}},[t]);return S.jsxs(KA,{open:e,onOpenChange:t,children:[S.jsx(ZA,{asChild:!0,children:S.jsxs(Ot,{variant:"outline",side:"bottom",tooltip:"Clear documents",size:"sm",children:[S.jsx(wk,{})," Clear"]})}),S.jsxs(Cy,{className:"sm:max-w-xl",onCloseAutoFocus:r=>r.preventDefault(),children:[S.jsxs(Ty,{children:[S.jsx(Ay,{children:"Clear documents"}),S.jsx(Ry,{children:"Do you really want to clear all documents?"})]}),S.jsx(Ot,{variant:"destructive",onClick:n,children:"YES"})]})]})}function u9(){const e=Mn.use.health(),[t,n]=E.useState(null),r=E.useCallback(async()=>{try{const o=await aM();o&&o.statuses&&Object.values(o.statuses).reduce((u,f)=>u+f.length,0)>0?n(o):n(null)}catch(o){vn.error(`Failed to load documents -`+Cr(o))}},[n]);E.useEffect(()=>{r()},[]);const i=E.useCallback(async()=>{try{const{status:o}=await oM();vn.message(o)}catch(o){vn.error(`Failed to load documents -`+Cr(o))}},[]);return E.useEffect(()=>{const o=setInterval(async()=>{if(e)try{await r()}catch(s){vn.error(`Failed to get scan progress -`+Cr(s))}},5e3);return()=>clearInterval(o)},[e,r]),S.jsxs(Ks,{className:"!size-full !rounded-none !border-none",children:[S.jsx(Nf,{children:S.jsx(Zs,{className:"text-lg",children:"Document Management"})}),S.jsxs(Of,{className:"space-y-4",children:[S.jsxs("div",{className:"flex gap-2",children:[S.jsxs(Ot,{variant:"outline",onClick:i,side:"bottom",tooltip:"Scan documents",size:"sm",children:[S.jsx(YM,{})," Scan"]}),S.jsx("div",{className:"flex-1"}),S.jsx(s9,{}),S.jsx(l9,{})]}),S.jsxs(Ks,{children:[S.jsxs(Nf,{children:[S.jsx(Zs,{children:"Uploaded documents"}),S.jsx(xd,{children:"view the uploaded documents here"})]}),S.jsxs(Of,{children:[!t&&S.jsx(PH,{title:"No documents uploaded",description:"upload documents to see them here"}),t&&S.jsxs(mR,{children:[S.jsx(gR,{children:S.jsxs(tv,{children:[S.jsx(bi,{children:"ID"}),S.jsx(bi,{children:"Summary"}),S.jsx(bi,{children:"Status"}),S.jsx(bi,{children:"Length"}),S.jsx(bi,{children:"Chunks"}),S.jsx(bi,{children:"Created"}),S.jsx(bi,{children:"Updated"}),S.jsx(bi,{children:"Metadata"})]})}),S.jsx(vR,{className:"text-sm",children:Object.entries(t.statuses).map(([o,s])=>s.map(u=>S.jsxs(tv,{children:[S.jsx(xi,{className:"truncate font-mono",children:u.id}),S.jsx(xi,{className:"max-w-xs min-w-24 truncate",children:S.jsx(Ln,{text:u.content_summary,tooltip:u.content_summary,tooltipClassName:"max-w-none overflow-visible block"})}),S.jsxs(xi,{children:[o==="processed"&&S.jsx("span",{className:"text-green-600",children:"Completed"}),o==="processing"&&S.jsx("span",{className:"text-blue-600",children:"Processing"}),o==="pending"&&S.jsx("span",{className:"text-yellow-600",children:"Pending"}),o==="failed"&&S.jsx("span",{className:"text-red-600",children:"Failed"}),u.error&&S.jsx("span",{className:"ml-2 text-red-500",title:u.error,children:"⚠️"})]}),S.jsx(xi,{children:u.content_length??"-"}),S.jsx(xi,{children:u.chunks_count??"-"}),S.jsx(xi,{className:"truncate",children:new Date(u.created_at).toLocaleString()}),S.jsx(xi,{className:"truncate",children:new Date(u.updated_at).toLocaleString()}),S.jsx(xi,{className:"max-w-xs truncate",children:u.metadata?JSON.stringify(u.metadata):"-"})]},u.id)))})]})]})]})]})]})}function KR(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i=u?i=i+OE("0",s-u):i=(i.substring(0,s)||"0")+"."+i.substring(s),n+i}function LE(e,t,n){if(["","-"].indexOf(e)!==-1)return e;var r=(e.indexOf(".")!==-1||n)&&t,i=Uy(e),o=i.beforeDecimal,s=i.afterDecimal,u=i.hasNegation,f=parseFloat("0."+(s||"0")),d=s.length<=t?"0."+s:f.toFixed(t),p=d.split("."),m=o;o&&Number(p[0])&&(m=o.split("").reverse().reduce(function(x,k,C){return x.length>C?(Number(x[0])+Number(k)).toString()+x.substring(1,x.length):k+x},p[0]));var v=JR(p[1]||"",t,n),g=u?"-":"",w=r?".":"";return""+g+m+w+v}function Va(e,t){if(e.value=e.value,e!==null){if(e.createTextRange){var n=e.createTextRange();return n.move("character",t),n.select(),!0}return e.selectionStart||e.selectionStart===0?(e.focus(),e.setSelectionRange(t,t),!0):(e.focus(),!1)}}var t2=c9(function(e,t){for(var n=0,r=0,i=e.length,o=t.length;e[n]===t[n]&&nn&&i-r>n;)r++;return{from:{start:n,end:i-r},to:{start:n,end:o-r}}}),g9=function(e,t){var n=Math.min(e.selectionStart,t);return{from:{start:n,end:e.selectionEnd},to:{start:n,end:t}}};function v9(e,t,n){return Math.min(Math.max(e,t),n)}function eg(e){return Math.max(e.selectionStart,e.selectionEnd)}function y9(){return typeof navigator<"u"&&!(navigator.platform&&/iPhone|iPod/.test(navigator.platform))}function b9(e){return{from:{start:0,end:0},to:{start:0,end:e.length},lastValue:""}}function x9(e){var t=e.currentValue,n=e.formattedValue,r=e.currentValueIndex,i=e.formattedValueIndex;return t[r]===n[i]}function w9(e,t,n,r,i,o,s){s===void 0&&(s=x9);var u=i.findIndex(function(N){return N}),f=e.slice(0,u);!t&&!n.startsWith(f)&&(t=f,n=f+n,r=r+f.length);for(var d=n.length,p=e.length,m={},v=new Array(d),g=0;g0&&v[C]===-1;)C--;var T=C===-1||v[C]===-1?0:v[C]+1;return T>_?_:r-T<_-r?T:_}function zE(e,t,n,r){var i=e.length;if(t=v9(t,0,i),r==="left"){for(;t>=0&&!n[t];)t--;t===-1&&(t=n.indexOf(!0))}else{for(;t<=i&&!n[t];)t++;t>i&&(t=n.lastIndexOf(!0))}return t===-1&&(t=i),t}function S9(e){for(var t=Array.from({length:e.length+1}).map(function(){return!0}),n=0,r=t.length;nR.length-s.length||zV||m>e.length-s.length)&&(j=m),e=e.substring(0,j),e=C9(T?"-"+e:e,i),e=(e.match(T9(w))||[]).join("");var q=e.indexOf(w);e=e.replace(new RegExp(QR(w),"g"),function(G,F){return F===q?".":""});var I=Uy(e,i),Y=I.beforeDecimal,Z=I.afterDecimal,U=I.addNegation;return d.end-d.start$?!1:A>=re.start&&A{const[x,k]=E.useState(v??r),C=E.useCallback(()=>{k(D=>D===void 0?e??1:Math.min(D+(e??1),o))},[e,o]),_=E.useCallback(()=>{k(D=>D===void 0?-(e??1):Math.max(D-(e??1),i))},[e,i]);E.useEffect(()=>{v!==void 0&&k(v)},[v]);const T=D=>{const z=D.floatValue===void 0?void 0:D.floatValue;k(z),s&&s(z)},N=()=>{x!==void 0&&(xo&&(k(o),w.current.value=String(o)))};return S.jsxs("div",{className:"relative flex",children:[S.jsx(L9,{value:x,onValueChange:T,thousandSeparator:t,decimalScale:f,fixedDecimalScale:u,allowNegative:i<0,valueIsNumericString:!0,onBlur:N,max:o,min:i,suffix:p,prefix:m,customInput:D=>S.jsx(Za,{...D,className:Me("w-full",d)}),placeholder:n,className:"[appearance:textfield] [&::-webkit-inner-spin-button]:appearance-none [&::-webkit-outer-spin-button]:appearance-none",getInputRef:w,...g}),S.jsxs("div",{className:"absolute top-0 right-0 bottom-0 flex flex-col",children:[S.jsx(Ot,{"aria-label":"Increase value",className:"border-input h-1/2 rounded-l-none rounded-br-none border-b border-l px-2 focus-visible:relative",variant:"outline",onClick:C,disabled:x===o,children:S.jsx(xk,{size:15})}),S.jsx(Ot,{"aria-label":"Decrease value",className:"border-input h-1/2 rounded-l-none rounded-tr-none border-b border-l px-2 focus-visible:relative",variant:"outline",onClick:_,disabled:x===i,children:S.jsx(zv,{size:15})})]})]})});Jo.displayName="NumberInput";var z9=[" ","Enter","ArrowUp","ArrowDown"],j9=[" ","Enter"],gu="Select",[kd,Cd,M9]=pT(gu),[Al,vK]=hr(gu,[M9,wl]),Td=wl(),[P9,pa]=Al(gu),[F9,I9]=Al(gu),r2=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:i,onOpenChange:o,value:s,defaultValue:u,onValueChange:f,dir:d,name:p,autoComplete:m,disabled:v,required:g,form:w}=e,x=Td(t),[k,C]=E.useState(null),[_,T]=E.useState(null),[N,D]=E.useState(!1),z=hd(d),[R=!1,B]=_i({prop:r,defaultProp:i,onChange:o}),[P,j]=_i({prop:s,defaultProp:u,onChange:f}),V=E.useRef(null),q=k?w||!!k.closest("form"):!0,[I,Y]=E.useState(new Set),Z=Array.from(I).map(U=>U.props.value).join(";");return S.jsx(ny,{...x,children:S.jsxs(P9,{required:g,scope:t,trigger:k,onTriggerChange:C,valueNode:_,onValueNodeChange:T,valueNodeHasChildren:N,onValueNodeHasChildrenChange:D,contentId:bn(),value:P,onValueChange:j,open:R,onOpenChange:B,dir:z,triggerPointerDownPosRef:V,disabled:v,children:[S.jsx(kd.Provider,{scope:t,children:S.jsx(F9,{scope:e.__scopeSelect,onNativeOptionAdd:E.useCallback(U=>{Y(G=>new Set(G).add(U))},[]),onNativeOptionRemove:E.useCallback(U=>{Y(G=>{const F=new Set(G);return F.delete(U),F})},[]),children:n})}),q?S.jsxs(R2,{"aria-hidden":!0,required:g,tabIndex:-1,name:p,autoComplete:m,value:P,onChange:U=>j(U.target.value),disabled:v,form:w,children:[P===void 0?S.jsx("option",{value:""}):null,Array.from(I)]},Z):null]})})};r2.displayName=gu;var i2="SelectTrigger",a2=E.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...i}=e,o=Td(n),s=pa(i2,n),u=s.disabled||r,f=dt(t,s.onTriggerChange),d=Cd(n),p=E.useRef("touch"),[m,v,g]=D2(x=>{const k=d().filter(T=>!T.disabled),C=k.find(T=>T.value===s.value),_=N2(k,x,C);_!==void 0&&s.onValueChange(_.value)}),w=x=>{u||(s.onOpenChange(!0),g()),x&&(s.triggerPointerDownPosRef.current={x:Math.round(x.pageX),y:Math.round(x.pageY)})};return S.jsx(od,{asChild:!0,...o,children:S.jsx(We.button,{type:"button",role:"combobox","aria-controls":s.contentId,"aria-expanded":s.open,"aria-required":s.required,"aria-autocomplete":"none",dir:s.dir,"data-state":s.open?"open":"closed",disabled:u,"data-disabled":u?"":void 0,"data-placeholder":A2(s.value)?"":void 0,...i,ref:f,onClick:qe(i.onClick,x=>{x.currentTarget.focus(),p.current!=="mouse"&&w(x)}),onPointerDown:qe(i.onPointerDown,x=>{p.current=x.pointerType;const k=x.target;k.hasPointerCapture(x.pointerId)&&k.releasePointerCapture(x.pointerId),x.button===0&&x.ctrlKey===!1&&x.pointerType==="mouse"&&(w(x),x.preventDefault())}),onKeyDown:qe(i.onKeyDown,x=>{const k=m.current!=="";!(x.ctrlKey||x.altKey||x.metaKey)&&x.key.length===1&&v(x.key),!(k&&x.key===" ")&&z9.includes(x.key)&&(w(),x.preventDefault())})})})});a2.displayName=i2;var o2="SelectValue",l2=E.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:i,children:o,placeholder:s="",...u}=e,f=pa(o2,n),{onValueNodeHasChildrenChange:d}=f,p=o!==void 0,m=dt(t,f.onValueNodeChange);return xn(()=>{d(p)},[d,p]),S.jsx(We.span,{...u,ref:m,style:{pointerEvents:"none"},children:A2(f.value)?S.jsx(S.Fragment,{children:s}):o})});l2.displayName=o2;var G9="SelectIcon",s2=E.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...i}=e;return S.jsx(We.span,{"aria-hidden":!0,...i,ref:t,children:r||"▼"})});s2.displayName=G9;var B9="SelectPortal",u2=e=>S.jsx(Qf,{asChild:!0,...e});u2.displayName=B9;var eo="SelectContent",c2=E.forwardRef((e,t)=>{const n=pa(eo,e.__scopeSelect),[r,i]=E.useState();if(xn(()=>{i(new DocumentFragment)},[]),!n.open){const o=r;return o?au.createPortal(S.jsx(f2,{scope:e.__scopeSelect,children:S.jsx(kd.Slot,{scope:e.__scopeSelect,children:S.jsx("div",{children:e.children})})}),o):null}return S.jsx(d2,{...e,ref:t})});c2.displayName=eo;var _r=10,[f2,ma]=Al(eo),U9="SelectContentImpl",d2=E.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:i,onEscapeKeyDown:o,onPointerDownOutside:s,side:u,sideOffset:f,align:d,alignOffset:p,arrowPadding:m,collisionBoundary:v,collisionPadding:g,sticky:w,hideWhenDetached:x,avoidCollisions:k,...C}=e,_=pa(eo,n),[T,N]=E.useState(null),[D,z]=E.useState(null),R=dt(t,ae=>N(ae)),[B,P]=E.useState(null),[j,V]=E.useState(null),q=Cd(n),[I,Y]=E.useState(!1),Z=E.useRef(!1);E.useEffect(()=>{if(T)return Pv(T)},[T]),Mv();const U=E.useCallback(ae=>{const[oe,...Ce]=q().map(we=>we.ref.current),[he]=Ce.slice(-1),Ee=document.activeElement;for(const we of ae)if(we===Ee||(we==null||we.scrollIntoView({block:"nearest"}),we===oe&&D&&(D.scrollTop=0),we===he&&D&&(D.scrollTop=D.scrollHeight),we==null||we.focus(),document.activeElement!==Ee))return},[q,D]),G=E.useCallback(()=>U([B,T]),[U,B,T]);E.useEffect(()=>{I&&G()},[I,G]);const{onOpenChange:F,triggerPointerDownPosRef:K}=_;E.useEffect(()=>{if(T){let ae={x:0,y:0};const oe=he=>{var Ee,we;ae={x:Math.abs(Math.round(he.pageX)-(((Ee=K.current)==null?void 0:Ee.x)??0)),y:Math.abs(Math.round(he.pageY)-(((we=K.current)==null?void 0:we.y)??0))}},Ce=he=>{ae.x<=10&&ae.y<=10?he.preventDefault():T.contains(he.target)||F(!1),document.removeEventListener("pointermove",oe),K.current=null};return K.current!==null&&(document.addEventListener("pointermove",oe),document.addEventListener("pointerup",Ce,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",oe),document.removeEventListener("pointerup",Ce,{capture:!0})}}},[T,F,K]),E.useEffect(()=>{const ae=()=>F(!1);return window.addEventListener("blur",ae),window.addEventListener("resize",ae),()=>{window.removeEventListener("blur",ae),window.removeEventListener("resize",ae)}},[F]);const[A,$]=D2(ae=>{const oe=q().filter(Ee=>!Ee.disabled),Ce=oe.find(Ee=>Ee.ref.current===document.activeElement),he=N2(oe,ae,Ce);he&&setTimeout(()=>he.ref.current.focus())}),M=E.useCallback((ae,oe,Ce)=>{const he=!Z.current&&!Ce;(_.value!==void 0&&_.value===oe||he)&&(P(ae),he&&(Z.current=!0))},[_.value]),O=E.useCallback(()=>T==null?void 0:T.focus(),[T]),X=E.useCallback((ae,oe,Ce)=>{const he=!Z.current&&!Ce;(_.value!==void 0&&_.value===oe||he)&&V(ae)},[_.value]),re=r==="popper"?uv:h2,ue=re===uv?{side:u,sideOffset:f,align:d,alignOffset:p,arrowPadding:m,collisionBoundary:v,collisionPadding:g,sticky:w,hideWhenDetached:x,avoidCollisions:k}:{};return S.jsx(f2,{scope:n,content:T,viewport:D,onViewportChange:z,itemRefCallback:M,selectedItem:B,onItemLeave:O,itemTextRefCallback:X,focusSelectedItem:G,selectedItemText:j,position:r,isPositioned:I,searchRef:A,children:S.jsx(ed,{as:ua,allowPinchZoom:!0,children:S.jsx(Zf,{asChild:!0,trapped:_.open,onMountAutoFocus:ae=>{ae.preventDefault()},onUnmountAutoFocus:qe(i,ae=>{var oe;(oe=_.trigger)==null||oe.focus({preventScroll:!0}),ae.preventDefault()}),children:S.jsx(ou,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:o,onPointerDownOutside:s,onFocusOutside:ae=>ae.preventDefault(),onDismiss:()=>_.onOpenChange(!1),children:S.jsx(re,{role:"listbox",id:_.contentId,"data-state":_.open?"open":"closed",dir:_.dir,onContextMenu:ae=>ae.preventDefault(),...C,...ue,onPlaced:()=>Y(!0),ref:R,style:{display:"flex",flexDirection:"column",outline:"none",...C.style},onKeyDown:qe(C.onKeyDown,ae=>{const oe=ae.ctrlKey||ae.altKey||ae.metaKey;if(ae.key==="Tab"&&ae.preventDefault(),!oe&&ae.key.length===1&&$(ae.key),["ArrowUp","ArrowDown","Home","End"].includes(ae.key)){let he=q().filter(Ee=>!Ee.disabled).map(Ee=>Ee.ref.current);if(["ArrowUp","End"].includes(ae.key)&&(he=he.slice().reverse()),["ArrowUp","ArrowDown"].includes(ae.key)){const Ee=ae.target,we=he.indexOf(Ee);he=he.slice(we+1)}setTimeout(()=>U(he)),ae.preventDefault()}})})})})})})});d2.displayName=U9;var H9="SelectItemAlignedPosition",h2=E.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...i}=e,o=pa(eo,n),s=ma(eo,n),[u,f]=E.useState(null),[d,p]=E.useState(null),m=dt(t,R=>p(R)),v=Cd(n),g=E.useRef(!1),w=E.useRef(!0),{viewport:x,selectedItem:k,selectedItemText:C,focusSelectedItem:_}=s,T=E.useCallback(()=>{if(o.trigger&&o.valueNode&&u&&d&&x&&k&&C){const R=o.trigger.getBoundingClientRect(),B=d.getBoundingClientRect(),P=o.valueNode.getBoundingClientRect(),j=C.getBoundingClientRect();if(o.dir!=="rtl"){const Ee=j.left-B.left,we=P.left-Ee,Pe=R.left-we,Ae=R.width+Pe,xe=Math.max(Ae,B.width),ee=window.innerWidth-_r,ce=lv(we,[_r,Math.max(_r,ee-xe)]);u.style.minWidth=Ae+"px",u.style.left=ce+"px"}else{const Ee=B.right-j.right,we=window.innerWidth-P.right-Ee,Pe=window.innerWidth-R.right-we,Ae=R.width+Pe,xe=Math.max(Ae,B.width),ee=window.innerWidth-_r,ce=lv(we,[_r,Math.max(_r,ee-xe)]);u.style.minWidth=Ae+"px",u.style.right=ce+"px"}const V=v(),q=window.innerHeight-_r*2,I=x.scrollHeight,Y=window.getComputedStyle(d),Z=parseInt(Y.borderTopWidth,10),U=parseInt(Y.paddingTop,10),G=parseInt(Y.borderBottomWidth,10),F=parseInt(Y.paddingBottom,10),K=Z+U+I+F+G,A=Math.min(k.offsetHeight*5,K),$=window.getComputedStyle(x),M=parseInt($.paddingTop,10),O=parseInt($.paddingBottom,10),X=R.top+R.height/2-_r,re=q-X,ue=k.offsetHeight/2,ae=k.offsetTop+ue,oe=Z+U+ae,Ce=K-oe;if(oe<=X){const Ee=V.length>0&&k===V[V.length-1].ref.current;u.style.bottom="0px";const we=d.clientHeight-x.offsetTop-x.offsetHeight,Pe=Math.max(re,ue+(Ee?O:0)+we+G),Ae=oe+Pe;u.style.height=Ae+"px"}else{const Ee=V.length>0&&k===V[0].ref.current;u.style.top="0px";const Pe=Math.max(X,Z+x.offsetTop+(Ee?M:0)+ue)+Ce;u.style.height=Pe+"px",x.scrollTop=oe-X+x.offsetTop}u.style.margin=`${_r}px 0`,u.style.minHeight=A+"px",u.style.maxHeight=q+"px",r==null||r(),requestAnimationFrame(()=>g.current=!0)}},[v,o.trigger,o.valueNode,u,d,x,k,C,o.dir,r]);xn(()=>T(),[T]);const[N,D]=E.useState();xn(()=>{d&&D(window.getComputedStyle(d).zIndex)},[d]);const z=E.useCallback(R=>{R&&w.current===!0&&(T(),_==null||_(),w.current=!1)},[T,_]);return S.jsx(V9,{scope:n,contentWrapper:u,shouldExpandOnScrollRef:g,onScrollButtonChange:z,children:S.jsx("div",{ref:f,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:N},children:S.jsx(We.div,{...i,ref:m,style:{boxSizing:"border-box",maxHeight:"100%",...i.style}})})})});h2.displayName=H9;var $9="SelectPopperPosition",uv=E.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:i=_r,...o}=e,s=Td(n);return S.jsx(ry,{...s,...o,ref:t,align:r,collisionPadding:i,style:{boxSizing:"border-box",...o.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});uv.displayName=$9;var[V9,Hy]=Al(eo,{}),cv="SelectViewport",p2=E.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...i}=e,o=ma(cv,n),s=Hy(cv,n),u=dt(t,o.onViewportChange),f=E.useRef(0);return S.jsxs(S.Fragment,{children:[S.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:r}),S.jsx(kd.Slot,{scope:n,children:S.jsx(We.div,{"data-radix-select-viewport":"",role:"presentation",...i,ref:u,style:{position:"relative",flex:1,overflow:"hidden auto",...i.style},onScroll:qe(i.onScroll,d=>{const p=d.currentTarget,{contentWrapper:m,shouldExpandOnScrollRef:v}=s;if(v!=null&&v.current&&m){const g=Math.abs(f.current-p.scrollTop);if(g>0){const w=window.innerHeight-_r*2,x=parseFloat(m.style.minHeight),k=parseFloat(m.style.height),C=Math.max(x,k);if(C0?N:0,m.style.justifyContent="flex-end")}}}f.current=p.scrollTop})})})]})});p2.displayName=cv;var m2="SelectGroup",[q9,Y9]=Al(m2),g2=E.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=bn();return S.jsx(q9,{scope:n,id:i,children:S.jsx(We.div,{role:"group","aria-labelledby":i,...r,ref:t})})});g2.displayName=m2;var v2="SelectLabel",y2=E.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=Y9(v2,n);return S.jsx(We.div,{id:i.id,...r,ref:t})});y2.displayName=v2;var If="SelectItem",[W9,b2]=Al(If),x2=E.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:i=!1,textValue:o,...s}=e,u=pa(If,n),f=ma(If,n),d=u.value===r,[p,m]=E.useState(o??""),[v,g]=E.useState(!1),w=dt(t,_=>{var T;return(T=f.itemRefCallback)==null?void 0:T.call(f,_,r,i)}),x=bn(),k=E.useRef("touch"),C=()=>{i||(u.onValueChange(r),u.onOpenChange(!1))};if(r==="")throw new Error("A must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return S.jsx(W9,{scope:n,value:r,disabled:i,textId:x,isSelected:d,onItemTextChange:E.useCallback(_=>{m(T=>T||((_==null?void 0:_.textContent)??"").trim())},[]),children:S.jsx(kd.ItemSlot,{scope:n,value:r,disabled:i,textValue:p,children:S.jsx(We.div,{role:"option","aria-labelledby":x,"data-highlighted":v?"":void 0,"aria-selected":d&&v,"data-state":d?"checked":"unchecked","aria-disabled":i||void 0,"data-disabled":i?"":void 0,tabIndex:i?void 0:-1,...s,ref:w,onFocus:qe(s.onFocus,()=>g(!0)),onBlur:qe(s.onBlur,()=>g(!1)),onClick:qe(s.onClick,()=>{k.current!=="mouse"&&C()}),onPointerUp:qe(s.onPointerUp,()=>{k.current==="mouse"&&C()}),onPointerDown:qe(s.onPointerDown,_=>{k.current=_.pointerType}),onPointerMove:qe(s.onPointerMove,_=>{var T;k.current=_.pointerType,i?(T=f.onItemLeave)==null||T.call(f):k.current==="mouse"&&_.currentTarget.focus({preventScroll:!0})}),onPointerLeave:qe(s.onPointerLeave,_=>{var T;_.currentTarget===document.activeElement&&((T=f.onItemLeave)==null||T.call(f))}),onKeyDown:qe(s.onKeyDown,_=>{var N;((N=f.searchRef)==null?void 0:N.current)!==""&&_.key===" "||(j9.includes(_.key)&&C(),_.key===" "&&_.preventDefault())})})})})});x2.displayName=If;var Is="SelectItemText",w2=E.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:i,...o}=e,s=pa(Is,n),u=ma(Is,n),f=b2(Is,n),d=I9(Is,n),[p,m]=E.useState(null),v=dt(t,C=>m(C),f.onItemTextChange,C=>{var _;return(_=u.itemTextRefCallback)==null?void 0:_.call(u,C,f.value,f.disabled)}),g=p==null?void 0:p.textContent,w=E.useMemo(()=>S.jsx("option",{value:f.value,disabled:f.disabled,children:g},f.value),[f.disabled,f.value,g]),{onNativeOptionAdd:x,onNativeOptionRemove:k}=d;return xn(()=>(x(w),()=>k(w)),[x,k,w]),S.jsxs(S.Fragment,{children:[S.jsx(We.span,{id:f.textId,...o,ref:v}),f.isSelected&&s.valueNode&&!s.valueNodeHasChildren?au.createPortal(o.children,s.valueNode):null]})});w2.displayName=Is;var S2="SelectItemIndicator",E2=E.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return b2(S2,n).isSelected?S.jsx(We.span,{"aria-hidden":!0,...r,ref:t}):null});E2.displayName=S2;var fv="SelectScrollUpButton",_2=E.forwardRef((e,t)=>{const n=ma(fv,e.__scopeSelect),r=Hy(fv,e.__scopeSelect),[i,o]=E.useState(!1),s=dt(t,r.onScrollButtonChange);return xn(()=>{if(n.viewport&&n.isPositioned){let u=function(){const d=f.scrollTop>0;o(d)};const f=n.viewport;return u(),f.addEventListener("scroll",u),()=>f.removeEventListener("scroll",u)}},[n.viewport,n.isPositioned]),i?S.jsx(C2,{...e,ref:s,onAutoScroll:()=>{const{viewport:u,selectedItem:f}=n;u&&f&&(u.scrollTop=u.scrollTop-f.offsetHeight)}}):null});_2.displayName=fv;var dv="SelectScrollDownButton",k2=E.forwardRef((e,t)=>{const n=ma(dv,e.__scopeSelect),r=Hy(dv,e.__scopeSelect),[i,o]=E.useState(!1),s=dt(t,r.onScrollButtonChange);return xn(()=>{if(n.viewport&&n.isPositioned){let u=function(){const d=f.scrollHeight-f.clientHeight,p=Math.ceil(f.scrollTop)f.removeEventListener("scroll",u)}},[n.viewport,n.isPositioned]),i?S.jsx(C2,{...e,ref:s,onAutoScroll:()=>{const{viewport:u,selectedItem:f}=n;u&&f&&(u.scrollTop=u.scrollTop+f.offsetHeight)}}):null});k2.displayName=dv;var C2=E.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...i}=e,o=ma("SelectScrollButton",n),s=E.useRef(null),u=Cd(n),f=E.useCallback(()=>{s.current!==null&&(window.clearInterval(s.current),s.current=null)},[]);return E.useEffect(()=>()=>f(),[f]),xn(()=>{var p;const d=u().find(m=>m.ref.current===document.activeElement);(p=d==null?void 0:d.ref.current)==null||p.scrollIntoView({block:"nearest"})},[u]),S.jsx(We.div,{"aria-hidden":!0,...i,ref:t,style:{flexShrink:0,...i.style},onPointerDown:qe(i.onPointerDown,()=>{s.current===null&&(s.current=window.setInterval(r,50))}),onPointerMove:qe(i.onPointerMove,()=>{var d;(d=o.onItemLeave)==null||d.call(o),s.current===null&&(s.current=window.setInterval(r,50))}),onPointerLeave:qe(i.onPointerLeave,()=>{f()})})}),X9="SelectSeparator",T2=E.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return S.jsx(We.div,{"aria-hidden":!0,...r,ref:t})});T2.displayName=X9;var hv="SelectArrow",K9=E.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=Td(n),o=pa(hv,n),s=ma(hv,n);return o.open&&s.position==="popper"?S.jsx(iy,{...i,...r,ref:t}):null});K9.displayName=hv;function A2(e){return e===""||e===void 0}var R2=E.forwardRef((e,t)=>{const{value:n,...r}=e,i=E.useRef(null),o=dt(t,i),s=eR(n);return E.useEffect(()=>{const u=i.current,f=window.HTMLSelectElement.prototype,p=Object.getOwnPropertyDescriptor(f,"value").set;if(s!==n&&p){const m=new Event("change",{bubbles:!0});p.call(u,n),u.dispatchEvent(m)}},[s,n]),S.jsx(ay,{asChild:!0,children:S.jsx("select",{...r,ref:o,defaultValue:n})})});R2.displayName="BubbleSelect";function D2(e){const t=un(e),n=E.useRef(""),r=E.useRef(0),i=E.useCallback(s=>{const u=n.current+s;t(u),function f(d){n.current=d,window.clearTimeout(r.current),d!==""&&(r.current=window.setTimeout(()=>f(""),1e3))}(u)},[t]),o=E.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return E.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,i,o]}function N2(e,t,n){const i=t.length>1&&Array.from(t).every(d=>d===t[0])?t[0]:t,o=n?e.indexOf(n):-1;let s=Z9(e,Math.max(o,0));i.length===1&&(s=s.filter(d=>d!==n));const f=s.find(d=>d.textValue.toLowerCase().startsWith(i.toLowerCase()));return f!==n?f:void 0}function Z9(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var Q9=r2,O2=a2,J9=l2,e8=s2,t8=u2,L2=c2,n8=p2,r8=g2,z2=y2,j2=x2,i8=w2,a8=E2,M2=_2,P2=k2,F2=T2;const ME=Q9,PE=r8,FE=J9,pv=E.forwardRef(({className:e,children:t,...n},r)=>S.jsxs(O2,{ref:r,className:Me("border-input bg-background ring-offset-background placeholder:text-muted-foreground focus:ring-ring flex h-10 w-full items-center justify-between rounded-md border px-3 py-2 text-sm focus:ring-2 focus:ring-offset-2 focus:outline-none disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",e),...n,children:[t,S.jsx(e8,{asChild:!0,children:S.jsx(zv,{className:"h-4 w-4 opacity-50"})})]}));pv.displayName=O2.displayName;const I2=E.forwardRef(({className:e,...t},n)=>S.jsx(M2,{ref:n,className:Me("flex cursor-default items-center justify-center py-1",e),...t,children:S.jsx(xk,{className:"h-4 w-4"})}));I2.displayName=M2.displayName;const G2=E.forwardRef(({className:e,...t},n)=>S.jsx(P2,{ref:n,className:Me("flex cursor-default items-center justify-center py-1",e),...t,children:S.jsx(zv,{className:"h-4 w-4"})}));G2.displayName=P2.displayName;const mv=E.forwardRef(({className:e,children:t,position:n="popper",...r},i)=>S.jsx(t8,{children:S.jsxs(L2,{ref:i,className:Me("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border shadow-md",n==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:n,...r,children:[S.jsx(I2,{}),S.jsx(n8,{className:Me("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),S.jsx(G2,{})]})}));mv.displayName=L2.displayName;const o8=E.forwardRef(({className:e,...t},n)=>S.jsx(z2,{ref:n,className:Me("py-1.5 pr-2 pl-8 text-sm font-semibold",e),...t}));o8.displayName=z2.displayName;const wi=E.forwardRef(({className:e,children:t,...n},r)=>S.jsxs(j2,{ref:r,className:Me("focus:bg-accent focus:text-accent-foreground relative flex w-full cursor-default items-center rounded-sm py-1.5 pr-2 pl-8 text-sm outline-none select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...n,children:[S.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:S.jsx(a8,{children:S.jsx(Lv,{className:"h-4 w-4"})})}),S.jsx(i8,{children:t})]}));wi.displayName=j2.displayName;const l8=E.forwardRef(({className:e,...t},n)=>S.jsx(F2,{ref:n,className:Me("bg-muted -mx-1 my-1 h-px",e),...t}));l8.displayName=F2.displayName;function s8(){var n,r;const e=Qe(i=>i.querySettings),t=E.useCallback((i,o)=>{Qe.getState().updateQuerySettings({[i]:o})},[]);return S.jsxs(Ks,{className:"flex shrink-0 flex-col",children:[S.jsxs(Nf,{className:"px-4 pt-4 pb-2",children:[S.jsx(Zs,{children:"Parameters"}),S.jsx(xd,{children:"Configure your query parameters"})]}),S.jsx(Of,{className:"m-0 flex grow flex-col p-0 text-xs",children:S.jsx("div",{className:"relative size-full",children:S.jsxs("div",{className:"absolute inset-0 flex flex-col gap-2 overflow-auto px-2",children:[S.jsxs(S.Fragment,{children:[S.jsx(Ln,{className:"ml-1",text:"Query Mode",tooltip:"Select the retrieval strategy:\\n• Naive: Basic search without advanced techniques\\n• Local: Context-dependent information retrieval\\n• Global: Utilizes global knowledge base\\n• Hybrid: Combines local and global retrieval\\n• Mix: Integrates knowledge graph with vector retrieval",side:"left"}),S.jsxs(ME,{value:e.mode,onValueChange:i=>t("mode",i),children:[S.jsx(pv,{className:"hover:bg-primary/5 h-9 cursor-pointer focus:ring-0 focus:ring-offset-0 focus:outline-0 active:right-0",children:S.jsx(FE,{})}),S.jsx(mv,{children:S.jsxs(PE,{children:[S.jsx(wi,{value:"naive",children:"Naive"}),S.jsx(wi,{value:"local",children:"Local"}),S.jsx(wi,{value:"global",children:"Global"}),S.jsx(wi,{value:"hybrid",children:"Hybrid"}),S.jsx(wi,{value:"mix",children:"Mix"})]})})]})]}),S.jsxs(S.Fragment,{children:[S.jsx(Ln,{className:"ml-1",text:"Response Format",tooltip:"Defines the response format. Examples:\\n• Multiple Paragraphs\\n• Single Paragraph\\n• Bullet Points",side:"left"}),S.jsxs(ME,{value:e.response_type,onValueChange:i=>t("response_type",i),children:[S.jsx(pv,{className:"hover:bg-primary/5 h-9 cursor-pointer focus:ring-0 focus:ring-offset-0 focus:outline-0 active:right-0",children:S.jsx(FE,{})}),S.jsx(mv,{children:S.jsxs(PE,{children:[S.jsx(wi,{value:"Multiple Paragraphs",children:"Multiple Paragraphs"}),S.jsx(wi,{value:"Single Paragraph",children:"Single Paragraph"}),S.jsx(wi,{value:"Bullet Points",children:"Bullet Points"})]})})]})]}),S.jsxs(S.Fragment,{children:[S.jsx(Ln,{className:"ml-1",text:"Top K Results",tooltip:"Number of top items to retrieve. Represents entities in 'local' mode and relationships in 'global' mode",side:"left"}),S.jsx(Jo,{id:"top_k",stepper:1,value:e.top_k,onValueChange:i=>t("top_k",i),min:1,placeholder:"Number of results"})]}),S.jsxs(S.Fragment,{children:[S.jsxs(S.Fragment,{children:[S.jsx(Ln,{className:"ml-1",text:"Max Tokens for Text Unit",tooltip:"Maximum number of tokens allowed for each retrieved text chunk",side:"left"}),S.jsx(Jo,{id:"max_token_for_text_unit",stepper:500,value:e.max_token_for_text_unit,onValueChange:i=>t("max_token_for_text_unit",i),min:1,placeholder:"Max tokens for text unit"})]}),S.jsxs(S.Fragment,{children:[S.jsx(Ln,{text:"Max Tokens for Global Context",tooltip:"Maximum number of tokens allocated for relationship descriptions in global retrieval",side:"left"}),S.jsx(Jo,{id:"max_token_for_global_context",stepper:500,value:e.max_token_for_global_context,onValueChange:i=>t("max_token_for_global_context",i),min:1,placeholder:"Max tokens for global context"})]}),S.jsxs(S.Fragment,{children:[S.jsx(Ln,{className:"ml-1",text:"Max Tokens for Local Context",tooltip:"Maximum number of tokens allocated for entity descriptions in local retrieval",side:"left"}),S.jsx(Jo,{id:"max_token_for_local_context",stepper:500,value:e.max_token_for_local_context,onValueChange:i=>t("max_token_for_local_context",i),min:1,placeholder:"Max tokens for local context"})]})]}),S.jsxs(S.Fragment,{children:[S.jsx(Ln,{className:"ml-1",text:"History Turns",tooltip:"Number of complete conversation turns (user-assistant pairs) to consider in the response context",side:"left"}),S.jsx(Jo,{className:"!border-input",id:"history_turns",stepper:1,type:"text",value:e.history_turns,onValueChange:i=>t("history_turns",i),min:0,placeholder:"Number of history turns"})]}),S.jsxs(S.Fragment,{children:[S.jsxs(S.Fragment,{children:[S.jsx(Ln,{className:"ml-1",text:"High-Level Keywords",tooltip:"List of high-level keywords to prioritize in retrieval. Separate with commas",side:"left"}),S.jsx(Za,{id:"hl_keywords",type:"text",value:(n=e.hl_keywords)==null?void 0:n.join(", "),onChange:i=>{const o=i.target.value.split(",").map(s=>s.trim()).filter(s=>s!=="");t("hl_keywords",o)},placeholder:"Enter keywords"})]}),S.jsxs(S.Fragment,{children:[S.jsx(Ln,{className:"ml-1",text:"Low-Level Keywords",tooltip:"List of low-level keywords to refine retrieval focus. Separate with commas",side:"left"}),S.jsx(Za,{id:"ll_keywords",type:"text",value:(r=e.ll_keywords)==null?void 0:r.join(", "),onChange:i=>{const o=i.target.value.split(",").map(s=>s.trim()).filter(s=>s!=="");t("ll_keywords",o)},placeholder:"Enter keywords"})]})]}),S.jsxs(S.Fragment,{children:[S.jsxs("div",{className:"flex items-center gap-2",children:[S.jsx(Ln,{className:"ml-1",text:"Only Need Context",tooltip:"If True, only returns the retrieved context without generating a response",side:"left"}),S.jsx("div",{className:"grow"}),S.jsx(Bs,{className:"mr-1 cursor-pointer",id:"only_need_context",checked:e.only_need_context,onCheckedChange:i=>t("only_need_context",i)})]}),S.jsxs("div",{className:"flex items-center gap-2",children:[S.jsx(Ln,{className:"ml-1",text:"Only Need Prompt",tooltip:"If True, only returns the generated prompt without producing a response",side:"left"}),S.jsx("div",{className:"grow"}),S.jsx(Bs,{className:"mr-1 cursor-pointer",id:"only_need_prompt",checked:e.only_need_prompt,onCheckedChange:i=>t("only_need_prompt",i)})]}),S.jsxs("div",{className:"flex items-center gap-2",children:[S.jsx(Ln,{className:"ml-1",text:"Stream Response",tooltip:"If True, enables streaming output for real-time responses",side:"left"}),S.jsx("div",{className:"grow"}),S.jsx(Bs,{className:"mr-1 cursor-pointer",id:"stream",checked:e.stream,onCheckedChange:i=>t("stream",i)})]})]})]})})})]})}function u8(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const c8=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,f8=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,d8={};function IE(e,t){return(d8.jsx?f8:c8).test(e)}const h8=/[ \t\n\f\r]/g;function p8(e){return typeof e=="object"?e.type==="text"?GE(e.value):!1:GE(e)}function GE(e){return e.replace(h8,"")===""}class vu{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}vu.prototype.normal={};vu.prototype.property={};vu.prototype.space=void 0;function B2(e,t){const n={},r={};for(const i of e)Object.assign(n,i.property),Object.assign(r,i.normal);return new vu(n,r,t)}function gv(e){return e.toLowerCase()}class Gn{constructor(t,n){this.attribute=n,this.property=t}}Gn.prototype.attribute="";Gn.prototype.booleanish=!1;Gn.prototype.boolean=!1;Gn.prototype.commaOrSpaceSeparated=!1;Gn.prototype.commaSeparated=!1;Gn.prototype.defined=!1;Gn.prototype.mustUseProperty=!1;Gn.prototype.number=!1;Gn.prototype.overloadedBoolean=!1;Gn.prototype.property="";Gn.prototype.spaceSeparated=!1;Gn.prototype.space=void 0;let m8=0;const et=ro(),Vt=ro(),U2=ro(),Re=ro(),Nt=ro(),ol=ro(),qn=ro();function ro(){return 2**++m8}const vv=Object.freeze(Object.defineProperty({__proto__:null,boolean:et,booleanish:Vt,commaOrSpaceSeparated:qn,commaSeparated:ol,number:Re,overloadedBoolean:U2,spaceSeparated:Nt},Symbol.toStringTag,{value:"Module"})),tg=Object.keys(vv);class $y extends Gn{constructor(t,n,r,i){let o=-1;if(super(t,n),BE(this,"space",i),typeof r=="number")for(;++o4&&n.slice(0,4)==="data"&&x8.test(t)){if(t.charAt(4)==="-"){const o=t.slice(5).replace(UE,E8);r="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=t.slice(4);if(!UE.test(o)){let s=o.replace(b8,S8);s.charAt(0)!=="-"&&(s="-"+s),t="data"+s}}i=$y}return new i(r,t)}function S8(e){return"-"+e.toLowerCase()}function E8(e){return e.charAt(1).toUpperCase()}const _8=B2([H2,g8,q2,Y2,W2],"html"),Vy=B2([H2,v8,q2,Y2,W2],"svg");function k8(e){return e.join(" ").trim()}var Xo={},ng,HE;function C8(){if(HE)return ng;HE=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,i=/^:\s*/,o=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,s=/^[;\s]*/,u=/^\s+|\s+$/g,f=` -`,d="/",p="*",m="",v="comment",g="declaration";ng=function(x,k){if(typeof x!="string")throw new TypeError("First argument must be a string");if(!x)return[];k=k||{};var C=1,_=1;function T(I){var Y=I.match(t);Y&&(C+=Y.length);var Z=I.lastIndexOf(f);_=~Z?I.length-Z:_+I.length}function N(){var I={line:C,column:_};return function(Y){return Y.position=new D(I),B(),Y}}function D(I){this.start=I,this.end={line:C,column:_},this.source=k.source}D.prototype.content=x;function z(I){var Y=new Error(k.source+":"+C+":"+_+": "+I);if(Y.reason=I,Y.filename=k.source,Y.line=C,Y.column=_,Y.source=x,!k.silent)throw Y}function R(I){var Y=I.exec(x);if(Y){var Z=Y[0];return T(Z),x=x.slice(Z.length),Y}}function B(){R(n)}function P(I){var Y;for(I=I||[];Y=j();)Y!==!1&&I.push(Y);return I}function j(){var I=N();if(!(d!=x.charAt(0)||p!=x.charAt(1))){for(var Y=2;m!=x.charAt(Y)&&(p!=x.charAt(Y)||d!=x.charAt(Y+1));)++Y;if(Y+=2,m===x.charAt(Y-1))return z("End of comment missing");var Z=x.slice(2,Y-2);return _+=2,T(Z),x=x.slice(Y),_+=2,I({type:v,comment:Z})}}function V(){var I=N(),Y=R(r);if(Y){if(j(),!R(i))return z("property missing ':'");var Z=R(o),U=I({type:g,property:w(Y[0].replace(e,m)),value:Z?w(Z[0].replace(e,m)):m});return R(s),U}}function q(){var I=[];P(I);for(var Y;Y=V();)Y!==!1&&(I.push(Y),P(I));return I}return B(),q()};function w(x){return x?x.replace(u,m):m}return ng}var $E;function T8(){if($E)return Xo;$E=1;var e=Xo&&Xo.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Xo,"__esModule",{value:!0}),Xo.default=n;var t=e(C8());function n(r,i){var o=null;if(!r||typeof r!="string")return o;var s=(0,t.default)(r),u=typeof i=="function";return s.forEach(function(f){if(f.type==="declaration"){var d=f.property,p=f.value;u?i(d,p,f):p&&(o=o||{},o[d]=p)}}),o}return Xo}var A8=T8();const VE=fn(A8),R8=VE.default||VE,X2=K2("end"),qy=K2("start");function K2(e){return t;function t(n){const r=n&&n.position&&n.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function D8(e){const t=qy(e),n=X2(e);if(t&&n)return{start:t,end:n}}function Us(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?qE(e.position):"start"in e||"end"in e?qE(e):"line"in e||"column"in e?yv(e):""}function yv(e){return YE(e&&e.line)+":"+YE(e&&e.column)}function qE(e){return yv(e&&e.start)+"-"+yv(e&&e.end)}function YE(e){return e&&typeof e=="number"?e:1}class wn extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let i="",o={},s=!1;if(n&&("line"in n&&"column"in n?o={place:n}:"start"in n&&"end"in n?o={place:n}:"type"in n?o={ancestors:[n],place:n.position}:o={...n}),typeof t=="string"?i=t:!o.cause&&t&&(s=!0,i=t.message,o.cause=t),!o.ruleId&&!o.source&&typeof r=="string"){const f=r.indexOf(":");f===-1?o.ruleId=r:(o.source=r.slice(0,f),o.ruleId=r.slice(f+1))}if(!o.place&&o.ancestors&&o.ancestors){const f=o.ancestors[o.ancestors.length-1];f&&(o.place=f.position)}const u=o.place&&"start"in o.place?o.place.start:o.place;this.ancestors=o.ancestors||void 0,this.cause=o.cause||void 0,this.column=u?u.column:void 0,this.fatal=void 0,this.file,this.message=i,this.line=u?u.line:void 0,this.name=Us(o.place)||"1:1",this.place=o.place||void 0,this.reason=this.message,this.ruleId=o.ruleId||void 0,this.source=o.source||void 0,this.stack=s&&o.cause&&typeof o.cause.stack=="string"?o.cause.stack:"",this.actual,this.expected,this.note,this.url}}wn.prototype.file="";wn.prototype.name="";wn.prototype.reason="";wn.prototype.message="";wn.prototype.stack="";wn.prototype.column=void 0;wn.prototype.line=void 0;wn.prototype.ancestors=void 0;wn.prototype.cause=void 0;wn.prototype.fatal=void 0;wn.prototype.place=void 0;wn.prototype.ruleId=void 0;wn.prototype.source=void 0;const Yy={}.hasOwnProperty,N8=new Map,O8=/[A-Z]/g,L8=/-([a-z])/g,z8=new Set(["table","tbody","thead","tfoot","tr"]),j8=new Set(["td","th"]),Z2="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function Q2(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let r;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=H8(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=U8(n,t.jsx,t.jsxs)}const i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?Vy:_8,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},o=J2(i,e,void 0);return o&&typeof o!="string"?o:i.create(e,i.Fragment,{children:o||void 0},void 0)}function J2(e,t,n){if(t.type==="element")return M8(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return P8(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return I8(e,t,n);if(t.type==="mdxjsEsm")return F8(e,t);if(t.type==="root")return G8(e,t,n);if(t.type==="text")return B8(e,t)}function M8(e,t,n){const r=e.schema;let i=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=Vy,e.schema=i),e.ancestors.push(t);const o=tD(e,t.tagName,!1),s=$8(e,t);let u=Xy(e,t);return z8.has(t.tagName)&&(u=u.filter(function(f){return typeof f=="string"?!p8(f):!0})),eD(e,s,o,t),Wy(s,u),e.ancestors.pop(),e.schema=r,e.create(t,o,s,n)}function P8(e,t){if(t.data&&t.data.estree&&e.evaluater){const r=t.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}tu(e,t.position)}function F8(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);tu(e,t.position)}function I8(e,t,n){const r=e.schema;let i=r;t.name==="svg"&&r.space==="html"&&(i=Vy,e.schema=i),e.ancestors.push(t);const o=t.name===null?e.Fragment:tD(e,t.name,!0),s=V8(e,t),u=Xy(e,t);return eD(e,s,o,t),Wy(s,u),e.ancestors.pop(),e.schema=r,e.create(t,o,s,n)}function G8(e,t,n){const r={};return Wy(r,Xy(e,t)),e.create(t,e.Fragment,r,n)}function B8(e,t){return t.value}function eD(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function Wy(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function U8(e,t,n){return r;function r(i,o,s,u){const d=Array.isArray(s.children)?n:t;return u?d(o,s,u):d(o,s)}}function H8(e,t){return n;function n(r,i,o,s){const u=Array.isArray(o.children),f=qy(r);return t(i,o,s,u,{columnNumber:f?f.column-1:void 0,fileName:e,lineNumber:f?f.line:void 0},void 0)}}function $8(e,t){const n={};let r,i;for(i in t.properties)if(i!=="children"&&Yy.call(t.properties,i)){const o=q8(e,i,t.properties[i]);if(o){const[s,u]=o;e.tableCellAlignToStyle&&s==="align"&&typeof u=="string"&&j8.has(t.tagName)?r=u:n[s]=u}}if(r){const o=n.style||(n.style={});o[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function V8(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const o=r.data.estree.body[0];o.type;const s=o.expression;s.type;const u=s.properties[0];u.type,Object.assign(n,e.evaluater.evaluateExpression(u.argument))}else tu(e,t.position);else{const i=r.name;let o;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const u=r.value.data.estree.body[0];u.type,o=e.evaluater.evaluateExpression(u.expression)}else tu(e,t.position);else o=r.value===null?!0:r.value;n[i]=o}return n}function Xy(e,t){const n=[];let r=-1;const i=e.passKeys?new Map:N8;for(;++ri?0:i+t:t=t>i?i:t,n=n>0?n:0,r.length<1e4)s=Array.from(r),s.unshift(t,n),e.splice(...s);else for(n&&e.splice(t,n);o0?(Kn(e,e.length,0,t),e):t}const KE={}.hasOwnProperty;function rD(e){const t={};let n=-1;for(;++n13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function Tr(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const kn=ga(/[A-Za-z]/),yn=ga(/[\dA-Za-z]/),n7=ga(/[#-'*+\--9=?A-Z^-~]/);function Gf(e){return e!==null&&(e<32||e===127)}const bv=ga(/\d/),r7=ga(/[\dA-Fa-f]/),i7=ga(/[!-/:-@[-`{-~]/);function Ue(e){return e!==null&&e<-2}function Tt(e){return e!==null&&(e<0||e===32)}function ut(e){return e===-2||e===-1||e===32}const Ad=ga(new RegExp("\\p{P}|\\p{S}","u")),to=ga(/\s/);function ga(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function Dl(e){const t=[];let n=-1,r=0,i=0;for(;++n55295&&o<57344){const u=e.charCodeAt(n+1);o<56320&&u>56319&&u<57344?(s=String.fromCharCode(o,u),i=1):s="�"}else s=String.fromCharCode(o);s&&(t.push(e.slice(r,n),encodeURIComponent(s)),r=n+i+1,s=""),i&&(n+=i,i=0)}return t.join("")+e.slice(r)}function lt(e,t,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let o=0;return s;function s(f){return ut(f)?(e.enter(n),u(f)):t(f)}function u(f){return ut(f)&&o++s))return;const R=t.events.length;let B=R,P,j;for(;B--;)if(t.events[B][0]==="exit"&&t.events[B][1].type==="chunkFlow"){if(P){j=t.events[B][1].end;break}P=!0}for(C(r),z=R;zT;){const D=n[N];t.containerState=D[1],D[0].exit.call(t,e)}n.length=T}function _(){i.write([null]),o=void 0,i=void 0,t.containerState._closeFlow=void 0}}function u7(e,t,n){return lt(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function pl(e){if(e===null||Tt(e)||to(e))return 1;if(Ad(e))return 2}function Rd(e,t,n){const r=[];let i=-1;for(;++i1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const m={...e[r][1].end},v={...e[n][1].start};QE(m,-f),QE(v,f),s={type:f>1?"strongSequence":"emphasisSequence",start:m,end:{...e[r][1].end}},u={type:f>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:v},o={type:f>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},i={type:f>1?"strong":"emphasis",start:{...s.start},end:{...u.end}},e[r][1].end={...s.start},e[n][1].start={...u.end},d=[],e[r][1].end.offset-e[r][1].start.offset&&(d=fr(d,[["enter",e[r][1],t],["exit",e[r][1],t]])),d=fr(d,[["enter",i,t],["enter",s,t],["exit",s,t],["enter",o,t]]),d=fr(d,Rd(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),d=fr(d,[["exit",o,t],["enter",u,t],["exit",u,t],["exit",i,t]]),e[n][1].end.offset-e[n][1].start.offset?(p=2,d=fr(d,[["enter",e[n][1],t],["exit",e[n][1],t]])):p=0,Kn(e,r-1,n-r+3,d),n=r+d.length-p-2;break}}for(n=-1;++n0&&ut(z)?lt(e,_,"linePrefix",o+1)(z):_(z)}function _(z){return z===null||Ue(z)?e.check(JE,x,N)(z):(e.enter("codeFlowValue"),T(z))}function T(z){return z===null||Ue(z)?(e.exit("codeFlowValue"),_(z)):(e.consume(z),T)}function N(z){return e.exit("codeFenced"),t(z)}function D(z,R,B){let P=0;return j;function j(Z){return z.enter("lineEnding"),z.consume(Z),z.exit("lineEnding"),V}function V(Z){return z.enter("codeFencedFence"),ut(Z)?lt(z,q,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(Z):q(Z)}function q(Z){return Z===u?(z.enter("codeFencedFenceSequence"),I(Z)):B(Z)}function I(Z){return Z===u?(P++,z.consume(Z),I):P>=s?(z.exit("codeFencedFenceSequence"),ut(Z)?lt(z,Y,"whitespace")(Z):Y(Z)):B(Z)}function Y(Z){return Z===null||Ue(Z)?(z.exit("codeFencedFence"),R(Z)):B(Z)}}}function w7(e,t,n){const r=this;return i;function i(s){return s===null?n(s):(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),o)}function o(s){return r.parser.lazy[r.now().line]?n(s):t(s)}}const ig={name:"codeIndented",tokenize:E7},S7={partial:!0,tokenize:_7};function E7(e,t,n){const r=this;return i;function i(d){return e.enter("codeIndented"),lt(e,o,"linePrefix",5)(d)}function o(d){const p=r.events[r.events.length-1];return p&&p[1].type==="linePrefix"&&p[2].sliceSerialize(p[1],!0).length>=4?s(d):n(d)}function s(d){return d===null?f(d):Ue(d)?e.attempt(S7,s,f)(d):(e.enter("codeFlowValue"),u(d))}function u(d){return d===null||Ue(d)?(e.exit("codeFlowValue"),s(d)):(e.consume(d),u)}function f(d){return e.exit("codeIndented"),t(d)}}function _7(e,t,n){const r=this;return i;function i(s){return r.parser.lazy[r.now().line]?n(s):Ue(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),i):lt(e,o,"linePrefix",5)(s)}function o(s){const u=r.events[r.events.length-1];return u&&u[1].type==="linePrefix"&&u[2].sliceSerialize(u[1],!0).length>=4?t(s):Ue(s)?i(s):n(s)}}const k7={name:"codeText",previous:T7,resolve:C7,tokenize:A7};function C7(e){let t=e.length-4,n=3,r,i;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return tthis.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(t,n,r){const i=n||0;this.setCursor(Math.trunc(t));const o=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&js(this.left,r),o.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),js(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),js(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t=4?t(s):e.interrupt(r.parser.constructs.flow,n,t)(s)}}function uD(e,t,n,r,i,o,s,u,f){const d=f||Number.POSITIVE_INFINITY;let p=0;return m;function m(C){return C===60?(e.enter(r),e.enter(i),e.enter(o),e.consume(C),e.exit(o),v):C===null||C===32||C===41||Gf(C)?n(C):(e.enter(r),e.enter(s),e.enter(u),e.enter("chunkString",{contentType:"string"}),x(C))}function v(C){return C===62?(e.enter(o),e.consume(C),e.exit(o),e.exit(i),e.exit(r),t):(e.enter(u),e.enter("chunkString",{contentType:"string"}),g(C))}function g(C){return C===62?(e.exit("chunkString"),e.exit(u),v(C)):C===null||C===60||Ue(C)?n(C):(e.consume(C),C===92?w:g)}function w(C){return C===60||C===62||C===92?(e.consume(C),g):g(C)}function x(C){return!p&&(C===null||C===41||Tt(C))?(e.exit("chunkString"),e.exit(u),e.exit(s),e.exit(r),t(C)):p999||g===null||g===91||g===93&&!f||g===94&&!u&&"_hiddenFootnoteSupport"in s.parser.constructs?n(g):g===93?(e.exit(o),e.enter(i),e.consume(g),e.exit(i),e.exit(r),t):Ue(g)?(e.enter("lineEnding"),e.consume(g),e.exit("lineEnding"),p):(e.enter("chunkString",{contentType:"string"}),m(g))}function m(g){return g===null||g===91||g===93||Ue(g)||u++>999?(e.exit("chunkString"),p(g)):(e.consume(g),f||(f=!ut(g)),g===92?v:m)}function v(g){return g===91||g===92||g===93?(e.consume(g),u++,m):m(g)}}function fD(e,t,n,r,i,o){let s;return u;function u(v){return v===34||v===39||v===40?(e.enter(r),e.enter(i),e.consume(v),e.exit(i),s=v===40?41:v,f):n(v)}function f(v){return v===s?(e.enter(i),e.consume(v),e.exit(i),e.exit(r),t):(e.enter(o),d(v))}function d(v){return v===s?(e.exit(o),f(s)):v===null?n(v):Ue(v)?(e.enter("lineEnding"),e.consume(v),e.exit("lineEnding"),lt(e,d,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),p(v))}function p(v){return v===s||v===null||Ue(v)?(e.exit("chunkString"),d(v)):(e.consume(v),v===92?m:p)}function m(v){return v===s||v===92?(e.consume(v),p):p(v)}}function Hs(e,t){let n;return r;function r(i){return Ue(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):ut(i)?lt(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}const M7={name:"definition",tokenize:F7},P7={partial:!0,tokenize:I7};function F7(e,t,n){const r=this;let i;return o;function o(g){return e.enter("definition"),s(g)}function s(g){return cD.call(r,e,u,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(g)}function u(g){return i=Tr(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),g===58?(e.enter("definitionMarker"),e.consume(g),e.exit("definitionMarker"),f):n(g)}function f(g){return Tt(g)?Hs(e,d)(g):d(g)}function d(g){return uD(e,p,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(g)}function p(g){return e.attempt(P7,m,m)(g)}function m(g){return ut(g)?lt(e,v,"whitespace")(g):v(g)}function v(g){return g===null||Ue(g)?(e.exit("definition"),r.parser.defined.push(i),t(g)):n(g)}}function I7(e,t,n){return r;function r(u){return Tt(u)?Hs(e,i)(u):n(u)}function i(u){return fD(e,o,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(u)}function o(u){return ut(u)?lt(e,s,"whitespace")(u):s(u)}function s(u){return u===null||Ue(u)?t(u):n(u)}}const G7={name:"hardBreakEscape",tokenize:B7};function B7(e,t,n){return r;function r(o){return e.enter("hardBreakEscape"),e.consume(o),i}function i(o){return Ue(o)?(e.exit("hardBreakEscape"),t(o)):n(o)}}const U7={name:"headingAtx",resolve:H7,tokenize:$7};function H7(e,t){let n=e.length-2,r=3,i,o;return e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(i={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},o={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},Kn(e,r,n-r+1,[["enter",i,t],["enter",o,t],["exit",o,t],["exit",i,t]])),e}function $7(e,t,n){let r=0;return i;function i(p){return e.enter("atxHeading"),o(p)}function o(p){return e.enter("atxHeadingSequence"),s(p)}function s(p){return p===35&&r++<6?(e.consume(p),s):p===null||Tt(p)?(e.exit("atxHeadingSequence"),u(p)):n(p)}function u(p){return p===35?(e.enter("atxHeadingSequence"),f(p)):p===null||Ue(p)?(e.exit("atxHeading"),t(p)):ut(p)?lt(e,u,"whitespace")(p):(e.enter("atxHeadingText"),d(p))}function f(p){return p===35?(e.consume(p),f):(e.exit("atxHeadingSequence"),u(p))}function d(p){return p===null||p===35||Tt(p)?(e.exit("atxHeadingText"),u(p)):(e.consume(p),d)}}const V7=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],t_=["pre","script","style","textarea"],q7={concrete:!0,name:"htmlFlow",resolveTo:X7,tokenize:K7},Y7={partial:!0,tokenize:Q7},W7={partial:!0,tokenize:Z7};function X7(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function K7(e,t,n){const r=this;let i,o,s,u,f;return d;function d(O){return p(O)}function p(O){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(O),m}function m(O){return O===33?(e.consume(O),v):O===47?(e.consume(O),o=!0,x):O===63?(e.consume(O),i=3,r.interrupt?t:A):kn(O)?(e.consume(O),s=String.fromCharCode(O),k):n(O)}function v(O){return O===45?(e.consume(O),i=2,g):O===91?(e.consume(O),i=5,u=0,w):kn(O)?(e.consume(O),i=4,r.interrupt?t:A):n(O)}function g(O){return O===45?(e.consume(O),r.interrupt?t:A):n(O)}function w(O){const X="CDATA[";return O===X.charCodeAt(u++)?(e.consume(O),u===X.length?r.interrupt?t:q:w):n(O)}function x(O){return kn(O)?(e.consume(O),s=String.fromCharCode(O),k):n(O)}function k(O){if(O===null||O===47||O===62||Tt(O)){const X=O===47,re=s.toLowerCase();return!X&&!o&&t_.includes(re)?(i=1,r.interrupt?t(O):q(O)):V7.includes(s.toLowerCase())?(i=6,X?(e.consume(O),C):r.interrupt?t(O):q(O)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(O):o?_(O):T(O))}return O===45||yn(O)?(e.consume(O),s+=String.fromCharCode(O),k):n(O)}function C(O){return O===62?(e.consume(O),r.interrupt?t:q):n(O)}function _(O){return ut(O)?(e.consume(O),_):j(O)}function T(O){return O===47?(e.consume(O),j):O===58||O===95||kn(O)?(e.consume(O),N):ut(O)?(e.consume(O),T):j(O)}function N(O){return O===45||O===46||O===58||O===95||yn(O)?(e.consume(O),N):D(O)}function D(O){return O===61?(e.consume(O),z):ut(O)?(e.consume(O),D):T(O)}function z(O){return O===null||O===60||O===61||O===62||O===96?n(O):O===34||O===39?(e.consume(O),f=O,R):ut(O)?(e.consume(O),z):B(O)}function R(O){return O===f?(e.consume(O),f=null,P):O===null||Ue(O)?n(O):(e.consume(O),R)}function B(O){return O===null||O===34||O===39||O===47||O===60||O===61||O===62||O===96||Tt(O)?D(O):(e.consume(O),B)}function P(O){return O===47||O===62||ut(O)?T(O):n(O)}function j(O){return O===62?(e.consume(O),V):n(O)}function V(O){return O===null||Ue(O)?q(O):ut(O)?(e.consume(O),V):n(O)}function q(O){return O===45&&i===2?(e.consume(O),U):O===60&&i===1?(e.consume(O),G):O===62&&i===4?(e.consume(O),$):O===63&&i===3?(e.consume(O),A):O===93&&i===5?(e.consume(O),K):Ue(O)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(Y7,M,I)(O)):O===null||Ue(O)?(e.exit("htmlFlowData"),I(O)):(e.consume(O),q)}function I(O){return e.check(W7,Y,M)(O)}function Y(O){return e.enter("lineEnding"),e.consume(O),e.exit("lineEnding"),Z}function Z(O){return O===null||Ue(O)?I(O):(e.enter("htmlFlowData"),q(O))}function U(O){return O===45?(e.consume(O),A):q(O)}function G(O){return O===47?(e.consume(O),s="",F):q(O)}function F(O){if(O===62){const X=s.toLowerCase();return t_.includes(X)?(e.consume(O),$):q(O)}return kn(O)&&s.length<8?(e.consume(O),s+=String.fromCharCode(O),F):q(O)}function K(O){return O===93?(e.consume(O),A):q(O)}function A(O){return O===62?(e.consume(O),$):O===45&&i===2?(e.consume(O),A):q(O)}function $(O){return O===null||Ue(O)?(e.exit("htmlFlowData"),M(O)):(e.consume(O),$)}function M(O){return e.exit("htmlFlow"),t(O)}}function Z7(e,t,n){const r=this;return i;function i(s){return Ue(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),o):n(s)}function o(s){return r.parser.lazy[r.now().line]?n(s):t(s)}}function Q7(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(yu,t,n)}}const J7={name:"htmlText",tokenize:eV};function eV(e,t,n){const r=this;let i,o,s;return u;function u(A){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(A),f}function f(A){return A===33?(e.consume(A),d):A===47?(e.consume(A),D):A===63?(e.consume(A),T):kn(A)?(e.consume(A),B):n(A)}function d(A){return A===45?(e.consume(A),p):A===91?(e.consume(A),o=0,w):kn(A)?(e.consume(A),_):n(A)}function p(A){return A===45?(e.consume(A),g):n(A)}function m(A){return A===null?n(A):A===45?(e.consume(A),v):Ue(A)?(s=m,G(A)):(e.consume(A),m)}function v(A){return A===45?(e.consume(A),g):m(A)}function g(A){return A===62?U(A):A===45?v(A):m(A)}function w(A){const $="CDATA[";return A===$.charCodeAt(o++)?(e.consume(A),o===$.length?x:w):n(A)}function x(A){return A===null?n(A):A===93?(e.consume(A),k):Ue(A)?(s=x,G(A)):(e.consume(A),x)}function k(A){return A===93?(e.consume(A),C):x(A)}function C(A){return A===62?U(A):A===93?(e.consume(A),C):x(A)}function _(A){return A===null||A===62?U(A):Ue(A)?(s=_,G(A)):(e.consume(A),_)}function T(A){return A===null?n(A):A===63?(e.consume(A),N):Ue(A)?(s=T,G(A)):(e.consume(A),T)}function N(A){return A===62?U(A):T(A)}function D(A){return kn(A)?(e.consume(A),z):n(A)}function z(A){return A===45||yn(A)?(e.consume(A),z):R(A)}function R(A){return Ue(A)?(s=R,G(A)):ut(A)?(e.consume(A),R):U(A)}function B(A){return A===45||yn(A)?(e.consume(A),B):A===47||A===62||Tt(A)?P(A):n(A)}function P(A){return A===47?(e.consume(A),U):A===58||A===95||kn(A)?(e.consume(A),j):Ue(A)?(s=P,G(A)):ut(A)?(e.consume(A),P):U(A)}function j(A){return A===45||A===46||A===58||A===95||yn(A)?(e.consume(A),j):V(A)}function V(A){return A===61?(e.consume(A),q):Ue(A)?(s=V,G(A)):ut(A)?(e.consume(A),V):P(A)}function q(A){return A===null||A===60||A===61||A===62||A===96?n(A):A===34||A===39?(e.consume(A),i=A,I):Ue(A)?(s=q,G(A)):ut(A)?(e.consume(A),q):(e.consume(A),Y)}function I(A){return A===i?(e.consume(A),i=void 0,Z):A===null?n(A):Ue(A)?(s=I,G(A)):(e.consume(A),I)}function Y(A){return A===null||A===34||A===39||A===60||A===61||A===96?n(A):A===47||A===62||Tt(A)?P(A):(e.consume(A),Y)}function Z(A){return A===47||A===62||Tt(A)?P(A):n(A)}function U(A){return A===62?(e.consume(A),e.exit("htmlTextData"),e.exit("htmlText"),t):n(A)}function G(A){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(A),e.exit("lineEnding"),F}function F(A){return ut(A)?lt(e,K,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(A):K(A)}function K(A){return e.enter("htmlTextData"),s(A)}}const Qy={name:"labelEnd",resolveAll:iV,resolveTo:aV,tokenize:oV},tV={tokenize:lV},nV={tokenize:sV},rV={tokenize:uV};function iV(e){let t=-1;const n=[];for(;++t=3&&(d===null||Ue(d))?(e.exit("thematicBreak"),t(d)):n(d)}function f(d){return d===i?(e.consume(d),r++,f):(e.exit("thematicBreakSequence"),ut(d)?lt(e,u,"whitespace")(d):u(d))}}const On={continuation:{tokenize:bV},exit:wV,name:"list",tokenize:yV},gV={partial:!0,tokenize:SV},vV={partial:!0,tokenize:xV};function yV(e,t,n){const r=this,i=r.events[r.events.length-1];let o=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,s=0;return u;function u(g){const w=r.containerState.type||(g===42||g===43||g===45?"listUnordered":"listOrdered");if(w==="listUnordered"?!r.containerState.marker||g===r.containerState.marker:bv(g)){if(r.containerState.type||(r.containerState.type=w,e.enter(w,{_container:!0})),w==="listUnordered")return e.enter("listItemPrefix"),g===42||g===45?e.check(vf,n,d)(g):d(g);if(!r.interrupt||g===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),f(g)}return n(g)}function f(g){return bv(g)&&++s<10?(e.consume(g),f):(!r.interrupt||s<2)&&(r.containerState.marker?g===r.containerState.marker:g===41||g===46)?(e.exit("listItemValue"),d(g)):n(g)}function d(g){return e.enter("listItemMarker"),e.consume(g),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||g,e.check(yu,r.interrupt?n:p,e.attempt(gV,v,m))}function p(g){return r.containerState.initialBlankLine=!0,o++,v(g)}function m(g){return ut(g)?(e.enter("listItemPrefixWhitespace"),e.consume(g),e.exit("listItemPrefixWhitespace"),v):n(g)}function v(g){return r.containerState.size=o+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(g)}}function bV(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(yu,i,o);function i(u){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,lt(e,t,"listItemIndent",r.containerState.size+1)(u)}function o(u){return r.containerState.furtherBlankLines||!ut(u)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,s(u)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(vV,t,s)(u))}function s(u){return r.containerState._closeFlow=!0,r.interrupt=void 0,lt(e,e.attempt(On,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(u)}}function xV(e,t,n){const r=this;return lt(e,i,"listItemIndent",r.containerState.size+1);function i(o){const s=r.events[r.events.length-1];return s&&s[1].type==="listItemIndent"&&s[2].sliceSerialize(s[1],!0).length===r.containerState.size?t(o):n(o)}}function wV(e){e.exit(this.containerState.type)}function SV(e,t,n){const r=this;return lt(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(o){const s=r.events[r.events.length-1];return!ut(o)&&s&&s[1].type==="listItemPrefixWhitespace"?t(o):n(o)}}const n_={name:"setextUnderline",resolveTo:EV,tokenize:_V};function EV(e,t){let n=e.length,r,i,o;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(i=n)}else e[n][1].type==="content"&&e.splice(n,1),!o&&e[n][1].type==="definition"&&(o=n);const s={type:"setextHeading",start:{...e[i][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type="setextHeadingText",o?(e.splice(i,0,["enter",s,t]),e.splice(o+1,0,["exit",e[r][1],t]),e[r][1].end={...e[o][1].end}):e[r][1]=s,e.push(["exit",s,t]),e}function _V(e,t,n){const r=this;let i;return o;function o(d){let p=r.events.length,m;for(;p--;)if(r.events[p][1].type!=="lineEnding"&&r.events[p][1].type!=="linePrefix"&&r.events[p][1].type!=="content"){m=r.events[p][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||m)?(e.enter("setextHeadingLine"),i=d,s(d)):n(d)}function s(d){return e.enter("setextHeadingLineSequence"),u(d)}function u(d){return d===i?(e.consume(d),u):(e.exit("setextHeadingLineSequence"),ut(d)?lt(e,f,"lineSuffix")(d):f(d))}function f(d){return d===null||Ue(d)?(e.exit("setextHeadingLine"),t(d)):n(d)}}const kV={tokenize:CV};function CV(e){const t=this,n=e.attempt(yu,r,e.attempt(this.parser.constructs.flowInitial,i,lt(e,e.attempt(this.parser.constructs.flow,i,e.attempt(N7,i)),"linePrefix")));return n;function r(o){if(o===null){e.consume(o);return}return e.enter("lineEndingBlank"),e.consume(o),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function i(o){if(o===null){e.consume(o);return}return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const TV={resolveAll:hD()},AV=dD("string"),RV=dD("text");function dD(e){return{resolveAll:hD(e==="text"?DV:void 0),tokenize:t};function t(n){const r=this,i=this.parser.constructs[e],o=n.attempt(i,s,u);return s;function s(p){return d(p)?o(p):u(p)}function u(p){if(p===null){n.consume(p);return}return n.enter("data"),n.consume(p),f}function f(p){return d(p)?(n.exit("data"),o(p)):(n.consume(p),f)}function d(p){if(p===null)return!0;const m=i[p];let v=-1;if(m)for(;++v-1){const u=s[0];typeof u=="string"?s[0]=u.slice(r):s.shift()}o>0&&s.push(e[i].slice(0,o))}return s}function HV(e,t){let n=-1;const r=[];let i;for(;++n0){const vt=Oe.tokenStack[Oe.tokenStack.length-1];(vt[1]||i_).call(Oe,void 0,vt[0])}for(de.position={start:ra(te.length>0?te[0][1].start:{line:1,column:1,offset:0}),end:ra(te.length>0?te[te.length-2][1].end:{line:1,column:1,offset:0})},Ye=-1;++Ye1?"-"+u:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(s)}]};e.patch(t,f);const d={type:"element",tagName:"sup",properties:{},children:[f]};return e.patch(t,d),e.applyData(t,d)}function oq(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function lq(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function gD(e,t){const n=t.referenceType;let r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+r}];const i=e.all(t),o=i[0];o&&o.type==="text"?o.value="["+o.value:i.unshift({type:"text",value:"["});const s=i[i.length-1];return s&&s.type==="text"?s.value+=r:i.push({type:"text",value:r}),i}function sq(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return gD(e,t);const i={src:Dl(r.url||""),alt:t.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);const o={type:"element",tagName:"img",properties:i,children:[]};return e.patch(t,o),e.applyData(t,o)}function uq(e,t){const n={src:Dl(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function cq(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function fq(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return gD(e,t);const i={href:Dl(r.url||"")};r.title!==null&&r.title!==void 0&&(i.title=r.title);const o={type:"element",tagName:"a",properties:i,children:e.all(t)};return e.patch(t,o),e.applyData(t,o)}function dq(e,t){const n={href:Dl(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function hq(e,t,n){const r=e.all(t),i=n?pq(n):vD(t),o={},s=[];if(typeof t.checked=="boolean"){const p=r[0];let m;p&&p.type==="element"&&p.tagName==="p"?m=p:(m={type:"element",tagName:"p",properties:{},children:[]},r.unshift(m)),m.children.length>0&&m.children.unshift({type:"text",value:" "}),m.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),o.className=["task-list-item"]}let u=-1;for(;++u1}function mq(e,t){const n={},r=e.all(t);let i=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++i0){const s={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},u=qy(t.children[1]),f=X2(t.children[t.children.length-1]);u&&f&&(s.position={start:u,end:f}),i.push(s)}const o={type:"element",tagName:"table",properties:{},children:e.wrap(i,!0)};return e.patch(t,o),e.applyData(t,o)}function xq(e,t,n){const r=n?n.children:void 0,o=(r?r.indexOf(t):1)===0?"th":"td",s=n&&n.type==="table"?n.align:void 0,u=s?s.length:t.children.length;let f=-1;const d=[];for(;++f0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return o.push(l_(t.slice(i),i>0,!1)),o.join("")}function l_(e,t,n){let r=0,i=e.length;if(t){let o=e.codePointAt(r);for(;o===a_||o===o_;)r++,o=e.codePointAt(r)}if(n){let o=e.codePointAt(i-1);for(;o===a_||o===o_;)i--,o=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}function Eq(e,t){const n={type:"text",value:Sq(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function _q(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const kq={blockquote:eq,break:tq,code:nq,delete:rq,emphasis:iq,footnoteReference:aq,heading:oq,html:lq,imageReference:sq,image:uq,inlineCode:cq,linkReference:fq,link:dq,listItem:hq,list:mq,paragraph:gq,root:vq,strong:yq,table:bq,tableCell:wq,tableRow:xq,text:Eq,thematicBreak:_q,toml:Zc,yaml:Zc,definition:Zc,footnoteDefinition:Zc};function Zc(){}const yD=-1,Dd=0,$s=1,Bf=2,Jy=3,eb=4,tb=5,nb=6,bD=7,xD=8,s_=typeof self=="object"?self:globalThis,Cq=(e,t)=>{const n=(i,o)=>(e.set(o,i),i),r=i=>{if(e.has(i))return e.get(i);const[o,s]=t[i];switch(o){case Dd:case yD:return n(s,i);case $s:{const u=n([],i);for(const f of s)u.push(r(f));return u}case Bf:{const u=n({},i);for(const[f,d]of s)u[r(f)]=r(d);return u}case Jy:return n(new Date(s),i);case eb:{const{source:u,flags:f}=s;return n(new RegExp(u,f),i)}case tb:{const u=n(new Map,i);for(const[f,d]of s)u.set(r(f),r(d));return u}case nb:{const u=n(new Set,i);for(const f of s)u.add(r(f));return u}case bD:{const{name:u,message:f}=s;return n(new s_[u](f),i)}case xD:return n(BigInt(s),i);case"BigInt":return n(Object(BigInt(s)),i);case"ArrayBuffer":return n(new Uint8Array(s).buffer,s);case"DataView":{const{buffer:u}=new Uint8Array(s);return n(new DataView(u),s)}}return n(new s_[o](s),i)};return r},u_=e=>Cq(new Map,e)(0),Ko="",{toString:Tq}={},{keys:Aq}=Object,Ms=e=>{const t=typeof e;if(t!=="object"||!e)return[Dd,t];const n=Tq.call(e).slice(8,-1);switch(n){case"Array":return[$s,Ko];case"Object":return[Bf,Ko];case"Date":return[Jy,Ko];case"RegExp":return[eb,Ko];case"Map":return[tb,Ko];case"Set":return[nb,Ko];case"DataView":return[$s,n]}return n.includes("Array")?[$s,n]:n.includes("Error")?[bD,n]:[Bf,n]},Qc=([e,t])=>e===Dd&&(t==="function"||t==="symbol"),Rq=(e,t,n,r)=>{const i=(s,u)=>{const f=r.push(s)-1;return n.set(u,f),f},o=s=>{if(n.has(s))return n.get(s);let[u,f]=Ms(s);switch(u){case Dd:{let p=s;switch(f){case"bigint":u=xD,p=s.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+f);p=null;break;case"undefined":return i([yD],s)}return i([u,p],s)}case $s:{if(f){let v=s;return f==="DataView"?v=new Uint8Array(s.buffer):f==="ArrayBuffer"&&(v=new Uint8Array(s)),i([f,[...v]],s)}const p=[],m=i([u,p],s);for(const v of s)p.push(o(v));return m}case Bf:{if(f)switch(f){case"BigInt":return i([f,s.toString()],s);case"Boolean":case"Number":case"String":return i([f,s.valueOf()],s)}if(t&&"toJSON"in s)return o(s.toJSON());const p=[],m=i([u,p],s);for(const v of Aq(s))(e||!Qc(Ms(s[v])))&&p.push([o(v),o(s[v])]);return m}case Jy:return i([u,s.toISOString()],s);case eb:{const{source:p,flags:m}=s;return i([u,{source:p,flags:m}],s)}case tb:{const p=[],m=i([u,p],s);for(const[v,g]of s)(e||!(Qc(Ms(v))||Qc(Ms(g))))&&p.push([o(v),o(g)]);return m}case nb:{const p=[],m=i([u,p],s);for(const v of s)(e||!Qc(Ms(v)))&&p.push(o(v));return m}}const{message:d}=s;return i([u,{name:f,message:d}],s)};return o},c_=(e,{json:t,lossy:n}={})=>{const r=[];return Rq(!(t||n),!!t,new Map,r)(e),r},Uf=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?u_(c_(e,t)):structuredClone(e):(e,t)=>u_(c_(e,t));function Dq(e,t){const n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function Nq(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function Oq(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||Dq,r=e.options.footnoteBackLabel||Nq,i=e.options.footnoteLabel||"Footnotes",o=e.options.footnoteLabelTagName||"h2",s=e.options.footnoteLabelProperties||{className:["sr-only"]},u=[];let f=-1;for(;++f0&&w.push({type:"text",value:" "});let _=typeof n=="string"?n:n(f,g);typeof _=="string"&&(_={type:"text",value:_}),w.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+v+(g>1?"-"+g:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(f,g),className:["data-footnote-backref"]},children:Array.isArray(_)?_:[_]})}const k=p[p.length-1];if(k&&k.type==="element"&&k.tagName==="p"){const _=k.children[k.children.length-1];_&&_.type==="text"?_.value+=" ":k.children.push({type:"text",value:" "}),k.children.push(...w)}else p.push(...w);const C={type:"element",tagName:"li",properties:{id:t+"fn-"+v},children:e.wrap(p,!0)};e.patch(d,C),u.push(C)}if(u.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:o,properties:{...Uf(s),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:` -`},{type:"element",tagName:"ol",properties:{},children:e.wrap(u,!0)},{type:"text",value:` -`}]}}const Nd=function(e){if(e==null)return Mq;if(typeof e=="function")return Od(e);if(typeof e=="object")return Array.isArray(e)?Lq(e):zq(e);if(typeof e=="string")return jq(e);throw new Error("Expected function, string, or object as test")};function Lq(e){const t=[];let n=-1;for(;++n":""))+")"})}return v;function v(){let g=wD,w,x,k;if((!t||o(f,d,p[p.length-1]||void 0))&&(g=Gq(n(f,p)),g[0]===wv))return g;if("children"in f&&f.children){const C=f;if(C.children&&g[0]!==Iq)for(x=(r?C.children.length:-1)+s,k=p.concat(C);x>-1&&x0&&n.push({type:"text",value:` -`}),n}function f_(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function d_(e,t){const n=Uq(e,t),r=n.one(e,void 0),i=Oq(n),o=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return i&&o.children.push({type:"text",value:` -`},i),o}function Yq(e,t){return e&&"run"in e?async function(n,r){const i=d_(n,{file:r,...t});await e.run(i,r)}:function(n,r){return d_(n,{file:r,...e||t})}}function h_(e){if(e)throw e}var og,p_;function Wq(){if(p_)return og;p_=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=function(d){return typeof Array.isArray=="function"?Array.isArray(d):t.call(d)==="[object Array]"},o=function(d){if(!d||t.call(d)!=="[object Object]")return!1;var p=e.call(d,"constructor"),m=d.constructor&&d.constructor.prototype&&e.call(d.constructor.prototype,"isPrototypeOf");if(d.constructor&&!p&&!m)return!1;var v;for(v in d);return typeof v>"u"||e.call(d,v)},s=function(d,p){n&&p.name==="__proto__"?n(d,p.name,{enumerable:!0,configurable:!0,value:p.newValue,writable:!0}):d[p.name]=p.newValue},u=function(d,p){if(p==="__proto__")if(e.call(d,p)){if(r)return r(d,p).value}else return;return d[p]};return og=function f(){var d,p,m,v,g,w,x=arguments[0],k=1,C=arguments.length,_=!1;for(typeof x=="boolean"&&(_=x,x=arguments[1]||{},k=2),(x==null||typeof x!="object"&&typeof x!="function")&&(x={});ks.length;let f;u&&s.push(i);try{f=e.apply(this,s)}catch(d){const p=d;if(u&&n)throw p;return i(p)}u||(f&&f.then&&typeof f.then=="function"?f.then(o,i):f instanceof Error?i(f):o(f))}function i(s,...u){n||(n=!0,t(s,...u))}function o(s){i(null,s)}}const Gr={basename:Qq,dirname:Jq,extname:eY,join:tY,sep:"/"};function Qq(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');bu(e);let n=0,r=-1,i=e.length,o;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(o){n=i+1;break}}else r<0&&(o=!0,r=i+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let s=-1,u=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(o){n=i+1;break}}else s<0&&(o=!0,s=i+1),u>-1&&(e.codePointAt(i)===t.codePointAt(u--)?u<0&&(r=i):(u=-1,r=s));return n===r?r=s:r<0&&(r=e.length),e.slice(n,r)}function Jq(e){if(bu(e),e.length===0)return".";let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||(r=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function eY(e){bu(e);let t=e.length,n=-1,r=0,i=-1,o=0,s;for(;t--;){const u=e.codePointAt(t);if(u===47){if(s){r=t+1;break}continue}n<0&&(s=!0,n=t+1),u===46?i<0?i=t:o!==1&&(o=1):i>-1&&(o=-1)}return i<0||n<0||o===0||o===1&&i===n-1&&i===r+1?"":e.slice(i,n)}function tY(...e){let t=-1,n;for(;++t0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function rY(e,t){let n="",r=0,i=-1,o=0,s=-1,u,f;for(;++s<=e.length;){if(s2){if(f=n.lastIndexOf("/"),f!==n.length-1){f<0?(n="",r=0):(n=n.slice(0,f),r=n.length-1-n.lastIndexOf("/")),i=s,o=0;continue}}else if(n.length>0){n="",r=0,i=s,o=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(i+1,s):n=e.slice(i+1,s),r=s-i-1;i=s,o=0}else u===46&&o>-1?o++:o=-1}return n}function bu(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const iY={cwd:aY};function aY(){return"/"}function _v(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function oY(e){if(typeof e=="string")e=new URL(e);else if(!_v(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return lY(e)}function lY(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const t=e.pathname;let n=-1;for(;++n0){let[g,...w]=p;const x=r[v][1];Ev(x)&&Ev(g)&&(g=lg(!0,x,g)),r[v]=[d,g,...w]}}}}const fY=new ib().freeze();function fg(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function dg(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function hg(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function g_(e){if(!Ev(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function v_(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function Jc(e){return dY(e)?e:new ED(e)}function dY(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function hY(e){return typeof e=="string"||pY(e)}function pY(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const mY="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",y_=[],b_={allowDangerousHtml:!0},gY=/^(https?|ircs?|mailto|xmpp)$/i,vY=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function yY(e){const t=e.allowedElements,n=e.allowElement,r=e.children||"",i=e.className,o=e.components,s=e.disallowedElements,u=e.rehypePlugins||y_,f=e.remarkPlugins||y_,d=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...b_}:b_,p=e.skipHtml,m=e.unwrapDisallowed,v=e.urlTransform||bY,g=fY().use(JV).use(f).use(Yq,d).use(u),w=new ED;typeof r=="string"&&(w.value=r);for(const _ of vY)Object.hasOwn(e,_.from)&&(""+_.from+(_.to?"use `"+_.to+"` instead":"remove it")+mY+_.id,void 0);const x=g.parse(w);let k=g.runSync(x,w);return i&&(k={type:"element",tagName:"div",properties:{className:i},children:k.type==="root"?k.children:[k]}),rb(k,C),Q2(k,{Fragment:S.Fragment,components:o,ignoreInvalidStyle:!0,jsx:S.jsx,jsxs:S.jsxs,passKeys:!0,passNode:!0});function C(_,T,N){if(_.type==="raw"&&N&&typeof T=="number")return p?N.children.splice(T,1):N.children[T]={type:"text",value:_.value},T;if(_.type==="element"){let D;for(D in rg)if(Object.hasOwn(rg,D)&&Object.hasOwn(_.properties,D)){const z=_.properties[D],R=rg[D];(R===null||R.includes(_.tagName))&&(_.properties[D]=v(String(z||""),D,_))}}if(_.type==="element"){let D=t?!t.includes(_.tagName):s?s.includes(_.tagName):!1;if(!D&&n&&typeof T=="number"&&(D=!n(_,T,N)),D&&N&&typeof T=="number")return m&&_.children?N.children.splice(T,1,..._.children):N.children.splice(T,1),T}}}function bY(e){const t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),i=e.indexOf("/");return t===-1||i!==-1&&t>i||n!==-1&&t>n||r!==-1&&t>r||gY.test(e.slice(0,t))?e:""}function x_(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let r=0,i=n.indexOf(t);for(;i!==-1;)r++,i=n.indexOf(t,i+t.length);return r}function xY(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function wY(e,t,n){const i=Nd((n||{}).ignore||[]),o=SY(t);let s=-1;for(;++s0?{type:"text",value:z}:void 0),z===!1?v.lastIndex=N+1:(w!==N&&_.push({type:"text",value:d.value.slice(w,N)}),Array.isArray(z)?_.push(...z):z&&_.push(z),w=N+T[0].length,C=!0),!v.global)break;T=v.exec(d.value)}return C?(w?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(")");const i=x_(e,"(");let o=x_(e,")");for(;r!==-1&&i>o;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),o++;return[e,n]}function _D(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||to(n)||Ad(n))&&(!t||n!==47)}kD.peek=VY;function PY(){this.buffer()}function FY(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function IY(){this.buffer()}function GY(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function BY(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Tr(this.sliceSerialize(e)).toLowerCase(),n.label=t}function UY(e){this.exit(e)}function HY(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Tr(this.sliceSerialize(e)).toLowerCase(),n.label=t}function $Y(e){this.exit(e)}function VY(){return"["}function kD(e,t,n,r){const i=n.createTracker(r);let o=i.move("[^");const s=n.enter("footnoteReference"),u=n.enter("reference");return o+=i.move(n.safe(n.associationId(e),{after:"]",before:o})),u(),s(),o+=i.move("]"),o}function qY(){return{enter:{gfmFootnoteCallString:PY,gfmFootnoteCall:FY,gfmFootnoteDefinitionLabelString:IY,gfmFootnoteDefinition:GY},exit:{gfmFootnoteCallString:BY,gfmFootnoteCall:UY,gfmFootnoteDefinitionLabelString:HY,gfmFootnoteDefinition:$Y}}}function YY(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:kD},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(r,i,o,s){const u=o.createTracker(s);let f=u.move("[^");const d=o.enter("footnoteDefinition"),p=o.enter("label");return f+=u.move(o.safe(o.associationId(r),{before:f,after:"]"})),p(),f+=u.move("]:"),r.children&&r.children.length>0&&(u.shift(4),f+=u.move((t?` -`:" ")+o.indentLines(o.containerFlow(r,u.current()),t?CD:WY))),d(),f}}function WY(e,t,n){return t===0?e:CD(e,t,n)}function CD(e,t,n){return(n?"":" ")+e}const XY=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];TD.peek=eW;function KY(){return{canContainEols:["delete"],enter:{strikethrough:QY},exit:{strikethrough:JY}}}function ZY(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:XY}],handlers:{delete:TD}}}function QY(e){this.enter({type:"delete",children:[]},e)}function JY(e){this.exit(e)}function TD(e,t,n,r){const i=n.createTracker(r),o=n.enter("strikethrough");let s=i.move("~~");return s+=n.containerPhrasing(e,{...i.current(),before:s,after:"~"}),s+=i.move("~~"),o(),s}function eW(){return"~"}function tW(e){return e.length}function nW(e,t){const n=t||{},r=(n.align||[]).concat(),i=n.stringLength||tW,o=[],s=[],u=[],f=[];let d=0,p=-1;for(;++pd&&(d=e[p].length);++Cf[C])&&(f[C]=T)}x.push(_)}s[p]=x,u[p]=k}let m=-1;if(typeof r=="object"&&"length"in r)for(;++mf[m]&&(f[m]=_),g[m]=_),v[m]=T}s.splice(1,0,v),u.splice(1,0,g),p=-1;const w=[];for(;++p "),o.shift(2);const s=n.indentLines(n.containerFlow(e,o.current()),aW);return i(),s}function aW(e,t,n){return">"+(n?"":" ")+e}function oW(e,t){return S_(e,t.inConstruct,!0)&&!S_(e,t.notInConstruct,!1)}function S_(e,t,n){if(typeof t=="string"&&(t=[t]),!t||t.length===0)return n;let r=-1;for(;++rs&&(s=o):o=1,i=r+t.length,r=n.indexOf(t,i);return s}function lW(e,t){return!!(t.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function sW(e){const t=e.options.fence||"`";if(t!=="`"&&t!=="~")throw new Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function uW(e,t,n,r){const i=sW(n),o=e.value||"",s=i==="`"?"GraveAccent":"Tilde";if(lW(e,n)){const m=n.enter("codeIndented"),v=n.indentLines(o,cW);return m(),v}const u=n.createTracker(r),f=i.repeat(Math.max(AD(o,i)+1,3)),d=n.enter("codeFenced");let p=u.move(f);if(e.lang){const m=n.enter(`codeFencedLang${s}`);p+=u.move(n.safe(e.lang,{before:p,after:" ",encode:["`"],...u.current()})),m()}if(e.lang&&e.meta){const m=n.enter(`codeFencedMeta${s}`);p+=u.move(" "),p+=u.move(n.safe(e.meta,{before:p,after:` -`,encode:["`"],...u.current()})),m()}return p+=u.move(` -`),o&&(p+=u.move(o+` -`)),p+=u.move(f),d(),p}function cW(e,t,n){return(n?"":" ")+e}function ab(e){const t=e.options.quote||'"';if(t!=='"'&&t!=="'")throw new Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function fW(e,t,n,r){const i=ab(n),o=i==='"'?"Quote":"Apostrophe",s=n.enter("definition");let u=n.enter("label");const f=n.createTracker(r);let d=f.move("[");return d+=f.move(n.safe(n.associationId(e),{before:d,after:"]",...f.current()})),d+=f.move("]: "),u(),!e.url||/[\0- \u007F]/.test(e.url)?(u=n.enter("destinationLiteral"),d+=f.move("<"),d+=f.move(n.safe(e.url,{before:d,after:">",...f.current()})),d+=f.move(">")):(u=n.enter("destinationRaw"),d+=f.move(n.safe(e.url,{before:d,after:e.title?" ":` -`,...f.current()}))),u(),e.title&&(u=n.enter(`title${o}`),d+=f.move(" "+i),d+=f.move(n.safe(e.title,{before:d,after:i,...f.current()})),d+=f.move(i),u()),s(),d}function dW(e){const t=e.options.emphasis||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function nu(e){return""+e.toString(16).toUpperCase()+";"}function Hf(e,t,n){const r=pl(e),i=pl(t);return r===void 0?i===void 0?n==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}RD.peek=hW;function RD(e,t,n,r){const i=dW(n),o=n.enter("emphasis"),s=n.createTracker(r),u=s.move(i);let f=s.move(n.containerPhrasing(e,{after:i,before:u,...s.current()}));const d=f.charCodeAt(0),p=Hf(r.before.charCodeAt(r.before.length-1),d,i);p.inside&&(f=nu(d)+f.slice(1));const m=f.charCodeAt(f.length-1),v=Hf(r.after.charCodeAt(0),m,i);v.inside&&(f=f.slice(0,-1)+nu(m));const g=s.move(i);return o(),n.attentionEncodeSurroundingInfo={after:v.outside,before:p.outside},u+f+g}function hW(e,t,n){return n.options.emphasis||"*"}function pW(e,t){let n=!1;return rb(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return n=!0,wv}),!!((!e.depth||e.depth<3)&&Ky(e)&&(t.options.setext||n))}function mW(e,t,n,r){const i=Math.max(Math.min(6,e.depth||1),1),o=n.createTracker(r);if(pW(e,n)){const p=n.enter("headingSetext"),m=n.enter("phrasing"),v=n.containerPhrasing(e,{...o.current(),before:` -`,after:` -`});return m(),p(),v+` -`+(i===1?"=":"-").repeat(v.length-(Math.max(v.lastIndexOf("\r"),v.lastIndexOf(` -`))+1))}const s="#".repeat(i),u=n.enter("headingAtx"),f=n.enter("phrasing");o.move(s+" ");let d=n.containerPhrasing(e,{before:"# ",after:` -`,...o.current()});return/^[\t ]/.test(d)&&(d=nu(d.charCodeAt(0))+d.slice(1)),d=d?s+" "+d:s,n.options.closeAtx&&(d+=" "+s),f(),u(),d}DD.peek=gW;function DD(e){return e.value||""}function gW(){return"<"}ND.peek=vW;function ND(e,t,n,r){const i=ab(n),o=i==='"'?"Quote":"Apostrophe",s=n.enter("image");let u=n.enter("label");const f=n.createTracker(r);let d=f.move("![");return d+=f.move(n.safe(e.alt,{before:d,after:"]",...f.current()})),d+=f.move("]("),u(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(u=n.enter("destinationLiteral"),d+=f.move("<"),d+=f.move(n.safe(e.url,{before:d,after:">",...f.current()})),d+=f.move(">")):(u=n.enter("destinationRaw"),d+=f.move(n.safe(e.url,{before:d,after:e.title?" ":")",...f.current()}))),u(),e.title&&(u=n.enter(`title${o}`),d+=f.move(" "+i),d+=f.move(n.safe(e.title,{before:d,after:i,...f.current()})),d+=f.move(i),u()),d+=f.move(")"),s(),d}function vW(){return"!"}OD.peek=yW;function OD(e,t,n,r){const i=e.referenceType,o=n.enter("imageReference");let s=n.enter("label");const u=n.createTracker(r);let f=u.move("![");const d=n.safe(e.alt,{before:f,after:"]",...u.current()});f+=u.move(d+"]["),s();const p=n.stack;n.stack=[],s=n.enter("reference");const m=n.safe(n.associationId(e),{before:f,after:"]",...u.current()});return s(),n.stack=p,o(),i==="full"||!d||d!==m?f+=u.move(m+"]"):i==="shortcut"?f=f.slice(0,-1):f+=u.move("]"),f}function yW(){return"!"}LD.peek=bW;function LD(e,t,n){let r=e.value||"",i="`",o=-1;for(;new RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++o\u007F]/.test(e.url))}jD.peek=xW;function jD(e,t,n,r){const i=ab(n),o=i==='"'?"Quote":"Apostrophe",s=n.createTracker(r);let u,f;if(zD(e,n)){const p=n.stack;n.stack=[],u=n.enter("autolink");let m=s.move("<");return m+=s.move(n.containerPhrasing(e,{before:m,after:">",...s.current()})),m+=s.move(">"),u(),n.stack=p,m}u=n.enter("link"),f=n.enter("label");let d=s.move("[");return d+=s.move(n.containerPhrasing(e,{before:d,after:"](",...s.current()})),d+=s.move("]("),f(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(f=n.enter("destinationLiteral"),d+=s.move("<"),d+=s.move(n.safe(e.url,{before:d,after:">",...s.current()})),d+=s.move(">")):(f=n.enter("destinationRaw"),d+=s.move(n.safe(e.url,{before:d,after:e.title?" ":")",...s.current()}))),f(),e.title&&(f=n.enter(`title${o}`),d+=s.move(" "+i),d+=s.move(n.safe(e.title,{before:d,after:i,...s.current()})),d+=s.move(i),f()),d+=s.move(")"),u(),d}function xW(e,t,n){return zD(e,n)?"<":"["}MD.peek=wW;function MD(e,t,n,r){const i=e.referenceType,o=n.enter("linkReference");let s=n.enter("label");const u=n.createTracker(r);let f=u.move("[");const d=n.containerPhrasing(e,{before:f,after:"]",...u.current()});f+=u.move(d+"]["),s();const p=n.stack;n.stack=[],s=n.enter("reference");const m=n.safe(n.associationId(e),{before:f,after:"]",...u.current()});return s(),n.stack=p,o(),i==="full"||!d||d!==m?f+=u.move(m+"]"):i==="shortcut"?f=f.slice(0,-1):f+=u.move("]"),f}function wW(){return"["}function ob(e){const t=e.options.bullet||"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function SW(e){const t=ob(e),n=e.options.bulletOther;if(!n)return t==="*"?"-":"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw new Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function EW(e){const t=e.options.bulletOrdered||".";if(t!=="."&&t!==")")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function PD(e){const t=e.options.rule||"*";if(t!=="*"&&t!=="-"&&t!=="_")throw new Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function _W(e,t,n,r){const i=n.enter("list"),o=n.bulletCurrent;let s=e.ordered?EW(n):ob(n);const u=e.ordered?s==="."?")":".":SW(n);let f=t&&n.bulletLastUsed?s===n.bulletLastUsed:!1;if(!e.ordered){const p=e.children?e.children[0]:void 0;if((s==="*"||s==="-")&&p&&(!p.children||!p.children[0])&&n.stack[n.stack.length-1]==="list"&&n.stack[n.stack.length-2]==="listItem"&&n.stack[n.stack.length-3]==="list"&&n.stack[n.stack.length-4]==="listItem"&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(f=!0),PD(n)===s&&p){let m=-1;for(;++m-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+o);let s=o.length+1;(i==="tab"||i==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(s=Math.ceil(s/4)*4);const u=n.createTracker(r);u.move(o+" ".repeat(s-o.length)),u.shift(s);const f=n.enter("listItem"),d=n.indentLines(n.containerFlow(e,u.current()),p);return f(),d;function p(m,v,g){return v?(g?"":" ".repeat(s))+m:(g?o:o+" ".repeat(s-o.length))+m}}function TW(e,t,n,r){const i=n.enter("paragraph"),o=n.enter("phrasing"),s=n.containerPhrasing(e,r);return o(),i(),s}const AW=Nd(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function RW(e,t,n,r){return(e.children.some(function(s){return AW(s)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function DW(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}FD.peek=NW;function FD(e,t,n,r){const i=DW(n),o=n.enter("strong"),s=n.createTracker(r),u=s.move(i+i);let f=s.move(n.containerPhrasing(e,{after:i,before:u,...s.current()}));const d=f.charCodeAt(0),p=Hf(r.before.charCodeAt(r.before.length-1),d,i);p.inside&&(f=nu(d)+f.slice(1));const m=f.charCodeAt(f.length-1),v=Hf(r.after.charCodeAt(0),m,i);v.inside&&(f=f.slice(0,-1)+nu(m));const g=s.move(i+i);return o(),n.attentionEncodeSurroundingInfo={after:v.outside,before:p.outside},u+f+g}function NW(e,t,n){return n.options.strong||"*"}function OW(e,t,n,r){return n.safe(e.value,r)}function LW(e){const t=e.options.ruleRepetition||3;if(t<3)throw new Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function zW(e,t,n){const r=(PD(n)+(n.options.ruleSpaces?" ":"")).repeat(LW(n));return n.options.ruleSpaces?r.slice(0,-1):r}const ID={blockquote:iW,break:E_,code:uW,definition:fW,emphasis:RD,hardBreak:E_,heading:mW,html:DD,image:ND,imageReference:OD,inlineCode:LD,link:jD,linkReference:MD,list:_W,listItem:CW,paragraph:TW,root:RW,strong:FD,text:OW,thematicBreak:zW};function jW(){return{enter:{table:MW,tableData:__,tableHeader:__,tableRow:FW},exit:{codeText:IW,table:PW,tableData:vg,tableHeader:vg,tableRow:vg}}}function MW(e){const t=e._align;this.enter({type:"table",align:t.map(function(n){return n==="none"?null:n}),children:[]},e),this.data.inTable=!0}function PW(e){this.exit(e),this.data.inTable=void 0}function FW(e){this.enter({type:"tableRow",children:[]},e)}function vg(e){this.exit(e)}function __(e){this.enter({type:"tableCell",children:[]},e)}function IW(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,GW));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function GW(e,t){return t==="|"?t:e}function BW(e){const t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,o=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:` -`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:v,table:s,tableCell:f,tableRow:u}};function s(g,w,x,k){return d(p(g,x,k),g.align)}function u(g,w,x,k){const C=m(g,x,k),_=d([C]);return _.slice(0,_.indexOf(` -`))}function f(g,w,x,k){const C=x.enter("tableCell"),_=x.enter("phrasing"),T=x.containerPhrasing(g,{...k,before:o,after:o});return _(),C(),T}function d(g,w){return nW(g,{align:w,alignDelimiters:r,padding:n,stringLength:i})}function p(g,w,x){const k=g.children;let C=-1;const _=[],T=w.enter("table");for(;++C0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const aX={tokenize:hX,partial:!0};function oX(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:cX,continuation:{tokenize:fX},exit:dX}},text:{91:{name:"gfmFootnoteCall",tokenize:uX},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:lX,resolveTo:sX}}}}function lX(e,t,n){const r=this;let i=r.events.length;const o=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let s;for(;i--;){const f=r.events[i][1];if(f.type==="labelImage"){s=f;break}if(f.type==="gfmFootnoteCall"||f.type==="labelLink"||f.type==="label"||f.type==="image"||f.type==="link")break}return u;function u(f){if(!s||!s._balanced)return n(f);const d=Tr(r.sliceSerialize({start:s.end,end:r.now()}));return d.codePointAt(0)!==94||!o.includes(d.slice(1))?n(f):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(f),e.exit("gfmFootnoteCallLabelMarker"),t(f))}}function sX(e,t){let n=e.length;for(;n--;)if(e[n][1].type==="labelImage"&&e[n][0]==="enter"){e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;const o={type:"gfmFootnoteCallString",start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},s={type:"chunkString",contentType:"string",start:Object.assign({},o.start),end:Object.assign({},o.end)},u=[e[n+1],e[n+2],["enter",r,t],e[n+3],e[n+4],["enter",i,t],["exit",i,t],["enter",o,t],["enter",s,t],["exit",s,t],["exit",o,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(n,e.length-n+1,...u),e}function uX(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let o=0,s;return u;function u(m){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(m),e.exit("gfmFootnoteCallLabelMarker"),f}function f(m){return m!==94?n(m):(e.enter("gfmFootnoteCallMarker"),e.consume(m),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",d)}function d(m){if(o>999||m===93&&!s||m===null||m===91||Tt(m))return n(m);if(m===93){e.exit("chunkString");const v=e.exit("gfmFootnoteCallString");return i.includes(Tr(r.sliceSerialize(v)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(m),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(m)}return Tt(m)||(s=!0),o++,e.consume(m),m===92?p:d}function p(m){return m===91||m===92||m===93?(e.consume(m),o++,d):d(m)}}function cX(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let o,s=0,u;return f;function f(w){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(w),e.exit("gfmFootnoteDefinitionLabelMarker"),d}function d(w){return w===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(w),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",p):n(w)}function p(w){if(s>999||w===93&&!u||w===null||w===91||Tt(w))return n(w);if(w===93){e.exit("chunkString");const x=e.exit("gfmFootnoteDefinitionLabelString");return o=Tr(r.sliceSerialize(x)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(w),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),v}return Tt(w)||(u=!0),s++,e.consume(w),w===92?m:p}function m(w){return w===91||w===92||w===93?(e.consume(w),s++,p):p(w)}function v(w){return w===58?(e.enter("definitionMarker"),e.consume(w),e.exit("definitionMarker"),i.includes(o)||i.push(o),lt(e,g,"gfmFootnoteDefinitionWhitespace")):n(w)}function g(w){return t(w)}}function fX(e,t,n){return e.check(yu,t,e.attempt(aX,t,n))}function dX(e){e.exit("gfmFootnoteDefinition")}function hX(e,t,n){const r=this;return lt(e,i,"gfmFootnoteDefinitionIndent",5);function i(o){const s=r.events[r.events.length-1];return s&&s[1].type==="gfmFootnoteDefinitionIndent"&&s[2].sliceSerialize(s[1],!0).length===4?t(o):n(o)}}function pX(e){let n=(e||{}).singleTilde;const r={name:"strikethrough",tokenize:o,resolveAll:i};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function i(s,u){let f=-1;for(;++f1?f(w):(s.consume(w),m++,g);if(m<2&&!n)return f(w);const k=s.exit("strikethroughSequenceTemporary"),C=pl(w);return k._open=!C||C===2&&!!x,k._close=!x||x===2&&!!C,u(w)}}}class mX{constructor(){this.map=[]}add(t,n,r){gX(this,t,n,r)}consume(t){if(this.map.sort(function(o,s){return o[0]-s[0]}),this.map.length===0)return;let n=this.map.length;const r=[];for(;n>0;)n-=1,r.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];r.push(t.slice()),t.length=0;let i=r.pop();for(;i;){for(const o of i)t.push(o);i=r.pop()}this.map.length=0}}function gX(e,t,n,r){let i=0;if(!(n===0&&r.length===0)){for(;i-1;){const Y=r.events[V][1].type;if(Y==="lineEnding"||Y==="linePrefix")V--;else break}const q=V>-1?r.events[V][1].type:null,I=q==="tableHead"||q==="tableRow"?z:f;return I===z&&r.parser.lazy[r.now().line]?n(j):I(j)}function f(j){return e.enter("tableHead"),e.enter("tableRow"),d(j)}function d(j){return j===124||(s=!0,o+=1),p(j)}function p(j){return j===null?n(j):Ue(j)?o>1?(o=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(j),e.exit("lineEnding"),g):n(j):ut(j)?lt(e,p,"whitespace")(j):(o+=1,s&&(s=!1,i+=1),j===124?(e.enter("tableCellDivider"),e.consume(j),e.exit("tableCellDivider"),s=!0,p):(e.enter("data"),m(j)))}function m(j){return j===null||j===124||Tt(j)?(e.exit("data"),p(j)):(e.consume(j),j===92?v:m)}function v(j){return j===92||j===124?(e.consume(j),m):m(j)}function g(j){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(j):(e.enter("tableDelimiterRow"),s=!1,ut(j)?lt(e,w,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(j):w(j))}function w(j){return j===45||j===58?k(j):j===124?(s=!0,e.enter("tableCellDivider"),e.consume(j),e.exit("tableCellDivider"),x):D(j)}function x(j){return ut(j)?lt(e,k,"whitespace")(j):k(j)}function k(j){return j===58?(o+=1,s=!0,e.enter("tableDelimiterMarker"),e.consume(j),e.exit("tableDelimiterMarker"),C):j===45?(o+=1,C(j)):j===null||Ue(j)?N(j):D(j)}function C(j){return j===45?(e.enter("tableDelimiterFiller"),_(j)):D(j)}function _(j){return j===45?(e.consume(j),_):j===58?(s=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(j),e.exit("tableDelimiterMarker"),T):(e.exit("tableDelimiterFiller"),T(j))}function T(j){return ut(j)?lt(e,N,"whitespace")(j):N(j)}function N(j){return j===124?w(j):j===null||Ue(j)?!s||i!==o?D(j):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(j)):D(j)}function D(j){return n(j)}function z(j){return e.enter("tableRow"),R(j)}function R(j){return j===124?(e.enter("tableCellDivider"),e.consume(j),e.exit("tableCellDivider"),R):j===null||Ue(j)?(e.exit("tableRow"),t(j)):ut(j)?lt(e,R,"whitespace")(j):(e.enter("data"),B(j))}function B(j){return j===null||j===124||Tt(j)?(e.exit("data"),R(j)):(e.consume(j),j===92?P:B)}function P(j){return j===92||j===124?(e.consume(j),B):B(j)}}function xX(e,t){let n=-1,r=!0,i=0,o=[0,0,0,0],s=[0,0,0,0],u=!1,f=0,d,p,m;const v=new mX;for(;++nn[2]+1){const w=n[2]+1,x=n[3]-n[2]-1;e.add(w,x,[])}}e.add(n[3]+1,0,[["exit",m,t]])}return i!==void 0&&(o.end=Object.assign({},el(t.events,i)),e.add(i,0,[["exit",o,t]]),o=void 0),o}function C_(e,t,n,r,i){const o=[],s=el(t.events,n);i&&(i.end=Object.assign({},s),o.push(["exit",i,t])),r.end=Object.assign({},s),o.push(["exit",r,t]),e.add(n+1,0,o)}function el(e,t){const n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}const wX={name:"tasklistCheck",tokenize:EX};function SX(){return{text:{91:wX}}}function EX(e,t,n){const r=this;return i;function i(f){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(f):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(f),e.exit("taskListCheckMarker"),o)}function o(f){return Tt(f)?(e.enter("taskListCheckValueUnchecked"),e.consume(f),e.exit("taskListCheckValueUnchecked"),s):f===88||f===120?(e.enter("taskListCheckValueChecked"),e.consume(f),e.exit("taskListCheckValueChecked"),s):n(f)}function s(f){return f===93?(e.enter("taskListCheckMarker"),e.consume(f),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),u):n(f)}function u(f){return Ue(f)?t(f):ut(f)?e.check({tokenize:_X},t,n)(f):n(f)}}function _X(e,t,n){return lt(e,r,"whitespace");function r(i){return i===null?n(i):t(i)}}function kX(e){return rD([KW(),oX(),pX(e),yX(),SX()])}const CX={};function TX(e){const t=this,n=e||CX,r=t.data(),i=r.micromarkExtensions||(r.micromarkExtensions=[]),o=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),s=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);i.push(kX(n)),o.push(qW()),s.push(YW(n))}function AX(e){const t=this;t.compiler=n;function n(r,i){return Q2(r,{filePath:i.path,...e})}}function RX(){return{enter:{mathFlow:e,mathFlowFenceMeta:t,mathText:o},exit:{mathFlow:i,mathFlowFence:r,mathFlowFenceMeta:n,mathFlowValue:u,mathText:s,mathTextData:u}};function e(f){const d={type:"element",tagName:"code",properties:{className:["language-math","math-display"]},children:[]};this.enter({type:"math",meta:null,value:"",data:{hName:"pre",hChildren:[d]}},f)}function t(){this.buffer()}function n(){const f=this.resume(),d=this.stack[this.stack.length-1];d.type,d.meta=f}function r(){this.data.mathFlowInside||(this.buffer(),this.data.mathFlowInside=!0)}function i(f){const d=this.resume().replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),p=this.stack[this.stack.length-1];p.type,this.exit(f),p.value=d;const m=p.data.hChildren[0];m.type,m.tagName,m.children.push({type:"text",value:d}),this.data.mathFlowInside=void 0}function o(f){this.enter({type:"inlineMath",value:"",data:{hName:"code",hProperties:{className:["language-math","math-inline"]},hChildren:[]}},f),this.buffer()}function s(f){const d=this.resume(),p=this.stack[this.stack.length-1];p.type,this.exit(f),p.value=d,p.data.hChildren.push({type:"text",value:d})}function u(f){this.config.enter.data.call(this,f),this.config.exit.data.call(this,f)}}function DX(e){let t=(e||{}).singleDollarTextMath;return t==null&&(t=!0),r.peek=i,{unsafe:[{character:"\r",inConstruct:"mathFlowMeta"},{character:` -`,inConstruct:"mathFlowMeta"},{character:"$",after:t?void 0:"\\$",inConstruct:"phrasing"},{character:"$",inConstruct:"mathFlowMeta"},{atBreak:!0,character:"$",after:"\\$"}],handlers:{math:n,inlineMath:r}};function n(o,s,u,f){const d=o.value||"",p=u.createTracker(f),m="$".repeat(Math.max(AD(d,"$")+1,2)),v=u.enter("mathFlow");let g=p.move(m);if(o.meta){const w=u.enter("mathFlowMeta");g+=p.move(u.safe(o.meta,{after:` -`,before:g,encode:["$"],...p.current()})),w()}return g+=p.move(` -`),d&&(g+=p.move(d+` -`)),g+=p.move(m),v(),g}function r(o,s,u){let f=o.value||"",d=1;for(t||d++;new RegExp("(^|[^$])"+"\\$".repeat(d)+"([^$]|$)").test(f);)d++;const p="$".repeat(d);/[^ \r\n]/.test(f)&&(/^[ \r\n]/.test(f)&&/[ \r\n]$/.test(f)||/^\$|\$$/.test(f))&&(f=" "+f+" ");let m=-1;for(;++mS.jsx(yY,{className:"prose lg:prose-xs dark:prose-invert max-w-none text-base",remarkPlugins:[TX,IX],rehypePlugins:[AX],skipHtml:!1,children:e.content});function BX(){const[e,t]=E.useState(()=>Qe.getState().retrievalHistory||[]),[n,r]=E.useState(""),[i,o]=E.useState(!1),s=E.useRef(null),u=E.useCallback(()=>{var m;(m=s.current)==null||m.scrollIntoView({behavior:"smooth"})},[]),f=E.useCallback(async m=>{if(m.preventDefault(),!n.trim()||i)return;const v={content:n,role:"user"},g={content:"",role:"assistant"},w=[...e];t([...w,v,g]),r(""),o(!0);const x=(_,T)=>{g.content+=_,t(N=>{const D=[...N],z=D[D.length-1];return z.role==="assistant"&&(z.content=g.content,z.isError=T),D})},k=Qe.getState(),C={...k.querySettings,query:v.content,conversation_history:w.filter(_=>_.isError!==!0).map(_=>({role:_.role,content:_.content}))};try{if(k.querySettings.stream){let _="";await sM(C,x,T=>{_+=T}),_&&(g.content&&(_=g.content+` -`+_),x(_,!0))}else{const _=await lM(C);x(_.response)}}catch(_){x(`Error: Failed to get response -${Cr(_)}`,!0)}finally{o(!1),Qe.getState().setRetrievalHistory([...w,v,g])}},[n,i,e,t]),d=jy(e,100);E.useEffect(()=>u(),[d,u]);const p=E.useCallback(()=>{t([]),Qe.getState().setRetrievalHistory([])},[t]);return S.jsxs("div",{className:"flex size-full gap-2 px-2 pb-12",children:[S.jsxs("div",{className:"flex grow flex-col gap-4",children:[S.jsx("div",{className:"relative grow",children:S.jsx("div",{className:"bg-primary-foreground/60 absolute inset-0 flex flex-col overflow-auto rounded-lg border p-2",children:S.jsxs("div",{className:"flex min-h-0 flex-1 flex-col gap-2",children:[e.length===0?S.jsx("div",{className:"text-muted-foreground flex h-full items-center justify-center text-lg",children:"Start a retrieval by typing your query below"}):e.map((m,v)=>S.jsx("div",{className:`flex ${m.role==="user"?"justify-end":"justify-start"}`,children:S.jsxs("div",{className:`max-w-[80%] rounded-lg px-4 py-2 ${m.role==="user"?"bg-primary text-primary-foreground":m.isError?"bg-red-100 text-red-600 dark:bg-red-950 dark:text-red-400":"bg-muted"}`,children:[S.jsx("pre",{className:"break-words whitespace-pre-wrap",children:S.jsx(GX,{message:m})}),m.content.length===0&&S.jsx(jM,{className:"animate-spin duration-2000"})]})},v)),S.jsx("div",{ref:s,className:"pb-1"})]})})}),S.jsxs("form",{onSubmit:f,className:"flex shrink-0 items-center gap-2",children:[S.jsxs(Ot,{type:"button",variant:"outline",onClick:p,disabled:i,size:"sm",children:[S.jsx(wk,{}),"Clear"]}),S.jsx(Za,{className:"flex-1",value:n,onChange:m=>r(m.target.value),placeholder:"Type your query...",disabled:i}),S.jsxs(Ot,{type:"submit",variant:"default",disabled:i,size:"sm",children:[S.jsx(ZM,{}),"Send"]})]})]}),S.jsx(s8,{})]})}function UX(){return S.jsx("iframe",{src:G_+"/docs",className:"size-full"})}function HX(){const e=Mn.use.message(),t=Qe.use.enableHealthCheck(),[n]=E.useState(()=>Qe.getState().currentTab),[r,i]=E.useState(!1);E.useEffect(()=>{if(!t)return;Mn.getState().check();const s=setInterval(async()=>{await Mn.getState().check()},xz*1e3);return()=>clearInterval(s)},[t]);const o=E.useCallback(s=>Qe.getState().setCurrentTab(s),[]);return E.useEffect(()=>{if(e&&(e.includes(vk)||e.includes(yk))){i(!0);return}i(!1)},[e,i]),S.jsx(_z,{children:S.jsxs("main",{className:"flex h-screen w-screen overflow-x-hidden",children:[S.jsxs(C3,{defaultValue:n,className:"!m-0 flex grow flex-col !p-0",onValueChange:o,children:[S.jsx(A3,{}),S.jsxs("div",{className:"relative grow",children:[S.jsx(Ps,{value:"documents",className:"absolute top-0 right-0 bottom-0 left-0",children:S.jsx(u9,{})}),S.jsx(Ps,{value:"knowledge-graph",className:"absolute top-0 right-0 bottom-0 left-0",children:S.jsx(LH,{})}),S.jsx(Ps,{value:"retrieval",className:"absolute top-0 right-0 bottom-0 left-0",children:S.jsx(BX,{})}),S.jsx(Ps,{value:"api",className:"absolute top-0 right-0 bottom-0 left-0",children:S.jsx(UX,{})})]})]}),t&&S.jsx(s3,{}),e!==null&&!r&&S.jsx(cP,{}),r&&S.jsx(WI,{}),S.jsx(YI,{})]})})}vL.createRoot(document.getElementById("root")).render(S.jsx(E.StrictMode,{children:S.jsx(HX,{})})); diff --git a/lightrag/api/webui/assets/index-CLsJV-0i.css b/lightrag/api/webui/assets/index-CLsJV-0i.css deleted file mode 100644 index 0e1032b4..00000000 --- a/lightrag/api/webui/assets/index-CLsJV-0i.css +++ /dev/null @@ -1 +0,0 @@ -/*! tailwindcss v4.0.7 | 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!important}.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}.list-item{display:list-item}.table{display:table}.table-cell{display:table-cell}.table-row{display:table-row}.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-40{height:calc(var(--spacing)*40)}.h-52{height:calc(var(--spacing)*52)}.h-84{height:calc(var(--spacing)*84)}.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-100{background-color:var(--color-red-100)}.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)}.lowercase{text-transform:lowercase}.uppercase{text-transform:uppercase}.italic{font-style:italic}.ordinal{--tw-ordinal:ordinal;font-variant-numeric:var(--tw-ordinal,)var(--tw-slashed-zero,)var(--tw-numeric-figure,)var(--tw-numeric-spacing,)var(--tw-numeric-fraction,)}.overline{text-decoration-line:overline}.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}.ring{--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)}.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)}.dark\:bg-red-950:is(.dark *){background-color:var(--color-red-950)}.dark\:text-red-400:is(.dark *){color:var(--color-red-400)}.\[\&_\[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-ordinal{syntax:"*";inherits:false}@property --tw-slashed-zero{syntax:"*";inherits:false}@property --tw-numeric-figure{syntax:"*";inherits:false}@property --tw-numeric-spacing{syntax:"*";inherits:false}@property --tw-numeric-fraction{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-drop-shadow{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-DbuMPJAD.js b/lightrag/api/webui/assets/index-DbuMPJAD.js new file mode 100644 index 00000000..5cc7b4c2 --- /dev/null +++ b/lightrag/api/webui/assets/index-DbuMPJAD.js @@ -0,0 +1,1120 @@ +var cH=Object.defineProperty;var dH=(e,t,n)=>t in e?cH(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Ea=(e,t,n)=>dH(e,typeof t!="symbol"?t+"":t,n);function fH(e,t){for(var n=0;nr[a]})}}}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 a of document.querySelectorAll('link[rel="modulepreload"]'))r(a);new MutationObserver(a=>{for(const i of a)if(i.type==="childList")for(const l of i.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&r(l)}).observe(document,{childList:!0,subtree:!0});function n(a){const i={};return a.integrity&&(i.integrity=a.integrity),a.referrerPolicy&&(i.referrerPolicy=a.referrerPolicy),a.crossOrigin==="use-credentials"?i.credentials="include":a.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(a){if(a.ep)return;a.ep=!0;const i=n(a);fetch(a.href,i)}})();var Cd=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function an(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function pH(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var n=function r(){return this instanceof r?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(r){var a=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,a.get?a:{enumerable:!0,get:function(){return e[r]}})}),n}var eh={exports:{}},Ds={};/** + * @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 $1;function gH(){if($1)return Ds;$1=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(r,a,i){var l=null;if(i!==void 0&&(l=""+i),a.key!==void 0&&(l=""+a.key),"key"in a){i={};for(var u in a)u!=="key"&&(i[u]=a[u])}else i=a;return a=i.ref,{$$typeof:e,type:r,key:l,ref:a!==void 0?a:null,props:i}}return Ds.Fragment=t,Ds.jsx=n,Ds.jsxs=n,Ds}var q1;function hH(){return q1||(q1=1,eh.exports=gH()),eh.exports}var w=hH(),th={exports:{}},at={};/** + * @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 V1;function mH(){if(V1)return at;V1=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),i=Symbol.for("react.consumer"),l=Symbol.for("react.context"),u=Symbol.for("react.forward_ref"),c=Symbol.for("react.suspense"),f=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),g=Symbol.iterator;function b(D){return D===null||typeof D!="object"?null:(D=g&&D[g]||D["@@iterator"],typeof D=="function"?D:null)}var m={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},S=Object.assign,v={};function A(D,V,B){this.props=D,this.context=V,this.refs=v,this.updater=B||m}A.prototype.isReactComponent={},A.prototype.setState=function(D,V){if(typeof D!="object"&&typeof D!="function"&&D!=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,D,V,"setState")},A.prototype.forceUpdate=function(D){this.updater.enqueueForceUpdate(this,D,"forceUpdate")};function R(){}R.prototype=A.prototype;function x(D,V,B){this.props=D,this.context=V,this.refs=v,this.updater=B||m}var _=x.prototype=new R;_.constructor=x,S(_,A.prototype),_.isPureReactComponent=!0;var C=Array.isArray,N={H:null,A:null,T:null,S:null},T=Object.prototype.hasOwnProperty;function O(D,V,B,L,Y,Q){return B=Q.ref,{$$typeof:e,type:D,key:V,ref:B!==void 0?B:null,props:Q}}function z(D,V){return O(D.type,V,void 0,void 0,void 0,D.props)}function I(D){return typeof D=="object"&&D!==null&&D.$$typeof===e}function M(D){var V={"=":"=0",":":"=2"};return"$"+D.replace(/[=:]/g,function(B){return V[B]})}var H=/\/+/g;function q(D,V){return typeof D=="object"&&D!==null&&D.key!=null?M(""+D.key):V.toString(36)}function U(){}function W(D){switch(D.status){case"fulfilled":return D.value;case"rejected":throw D.reason;default:switch(typeof D.status=="string"?D.then(U,U):(D.status="pending",D.then(function(V){D.status==="pending"&&(D.status="fulfilled",D.value=V)},function(V){D.status==="pending"&&(D.status="rejected",D.reason=V)})),D.status){case"fulfilled":return D.value;case"rejected":throw D.reason}}throw D}function Z(D,V,B,L,Y){var Q=typeof D;(Q==="undefined"||Q==="boolean")&&(D=null);var se=!1;if(D===null)se=!0;else switch(Q){case"bigint":case"string":case"number":se=!0;break;case"object":switch(D.$$typeof){case e:case t:se=!0;break;case p:return se=D._init,Z(se(D._payload),V,B,L,Y)}}if(se)return Y=Y(D),se=L===""?"."+q(D,0):L,C(Y)?(B="",se!=null&&(B=se.replace(H,"$&/")+"/"),Z(Y,V,B,"",function(Ae){return Ae})):Y!=null&&(I(Y)&&(Y=z(Y,B+(Y.key==null||D&&D.key===Y.key?"":(""+Y.key).replace(H,"$&/")+"/")+se)),V.push(Y)),1;se=0;var re=L===""?".":L+":";if(C(D))for(var le=0;le>>1,D=j[X];if(0>>1;Xa(L,P))Ya(Q,L)?(j[X]=Q,j[Y]=P,X=Y):(j[X]=L,j[B]=P,X=B);else if(Ya(Q,P))j[X]=Q,j[Y]=P,X=Y;else break e}}return G}function a(j,G){var P=j.sortIndex-G.sortIndex;return P!==0?P:j.id-G.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var l=Date,u=l.now();e.unstable_now=function(){return l.now()-u}}var c=[],f=[],p=1,g=null,b=3,m=!1,S=!1,v=!1,A=typeof setTimeout=="function"?setTimeout:null,R=typeof clearTimeout=="function"?clearTimeout:null,x=typeof setImmediate<"u"?setImmediate:null;function _(j){for(var G=n(f);G!==null;){if(G.callback===null)r(f);else if(G.startTime<=j)r(f),G.sortIndex=G.expirationTime,t(c,G);else break;G=n(f)}}function C(j){if(v=!1,_(j),!S)if(n(c)!==null)S=!0,W();else{var G=n(f);G!==null&&Z(C,G.startTime-j)}}var N=!1,T=-1,O=5,z=-1;function I(){return!(e.unstable_now()-zj&&I());){var X=g.callback;if(typeof X=="function"){g.callback=null,b=g.priorityLevel;var D=X(g.expirationTime<=j);if(j=e.unstable_now(),typeof D=="function"){g.callback=D,_(j),G=!0;break t}g===n(c)&&r(c),_(j)}else r(c);g=n(c)}if(g!==null)G=!0;else{var V=n(f);V!==null&&Z(C,V.startTime-j),G=!1}}break e}finally{g=null,b=P,m=!1}G=void 0}}finally{G?H():N=!1}}}var H;if(typeof x=="function")H=function(){x(M)};else if(typeof MessageChannel<"u"){var q=new MessageChannel,U=q.port2;q.port1.onmessage=M,H=function(){U.postMessage(null)}}else H=function(){A(M,0)};function W(){N||(N=!0,H())}function Z(j,G){T=A(function(){j(e.unstable_now())},G)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(j){j.callback=null},e.unstable_continueExecution=function(){S||m||(S=!0,W())},e.unstable_forceFrameRate=function(j){0>j||125X?(j.sortIndex=P,t(f,j),n(c)===null&&j===n(f)&&(v?(R(T),T=-1):v=!0,Z(C,P-X))):(j.sortIndex=D,t(c,j),S||m||(S=!0,W())),j},e.unstable_shouldYield=I,e.unstable_wrapCallback=function(j){var G=b;return function(){var P=b;b=G;try{return j.apply(this,arguments)}finally{b=P}}}}(ah)),ah}var K1;function vH(){return K1||(K1=1,rh.exports=yH()),rh.exports}var oh={exports:{}},bn={};/** + * @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 X1;function SH(){if(X1)return bn;X1=1;var e=nf();function t(c){var f="https://react.dev/errors/"+c;if(1"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),oh.exports=SH(),oh.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 Q1;function EH(){if(Q1)return Is;Q1=1;var e=vH(),t=nf(),n=mz();function r(o){var s="https://react.dev/errors/"+o;if(1)":-1y||K[h]!==ne[y]){var be=` +`+K[h].replace(" at new "," at ");return o.displayName&&be.includes("")&&(be=be.replace("",o.displayName)),be}while(1<=h&&0<=y);break}}}finally{W=!1,Error.prepareStackTrace=d}return(d=o?o.displayName||o.name:"")?U(d):""}function j(o){switch(o.tag){case 26:case 27:case 5:return U(o.type);case 16:return U("Lazy");case 13:return U("Suspense");case 19:return U("SuspenseList");case 0:case 15:return o=Z(o.type,!1),o;case 11:return o=Z(o.type.render,!1),o;case 1:return o=Z(o.type,!0),o;default:return""}}function G(o){try{var s="";do s+=j(o),o=o.return;while(o);return s}catch(d){return` +Error generating stack: `+d.message+` +`+d.stack}}function P(o){var s=o,d=o;if(o.alternate)for(;s.return;)s=s.return;else{o=s;do s=o,s.flags&4098&&(d=s.return),o=s.return;while(o)}return s.tag===3?d:null}function X(o){if(o.tag===13){var s=o.memoizedState;if(s===null&&(o=o.alternate,o!==null&&(s=o.memoizedState)),s!==null)return s.dehydrated}return null}function D(o){if(P(o)!==o)throw Error(r(188))}function V(o){var s=o.alternate;if(!s){if(s=P(o),s===null)throw Error(r(188));return s!==o?null:o}for(var d=o,h=s;;){var y=d.return;if(y===null)break;var E=y.alternate;if(E===null){if(h=y.return,h!==null){d=h;continue}break}if(y.child===E.child){for(E=y.child;E;){if(E===d)return D(y),o;if(E===h)return D(y),s;E=E.sibling}throw Error(r(188))}if(d.return!==h.return)d=y,h=E;else{for(var F=!1,$=y.child;$;){if($===d){F=!0,d=y,h=E;break}if($===h){F=!0,h=y,d=E;break}$=$.sibling}if(!F){for($=E.child;$;){if($===d){F=!0,d=E,h=y;break}if($===h){F=!0,h=E,d=y;break}$=$.sibling}if(!F)throw Error(r(189))}}if(d.alternate!==h)throw Error(r(190))}if(d.tag!==3)throw Error(r(188));return d.stateNode.current===d?o:s}function B(o){var s=o.tag;if(s===5||s===26||s===27||s===6)return o;for(o=o.child;o!==null;){if(s=B(o),s!==null)return s;o=o.sibling}return null}var L=Array.isArray,Y=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Q={pending:!1,data:null,method:null,action:null},se=[],re=-1;function le(o){return{current:o}}function Ae(o){0>re||(o.current=se[re],se[re]=null,re--)}function ae(o,s){re++,se[re]=o.current,o.current=s}var we=le(null),xe=le(null),Ie=le(null),Ce=le(null);function Ee(o,s){switch(ae(Ie,s),ae(xe,o),ae(we,null),o=s.nodeType,o){case 9:case 11:s=(s=s.documentElement)&&(s=s.namespaceURI)?v1(s):0;break;default:if(o=o===8?s.parentNode:s,s=o.tagName,o=o.namespaceURI)o=v1(o),s=S1(o,s);else switch(s){case"svg":s=1;break;case"math":s=2;break;default:s=0}}Ae(we),ae(we,s)}function J(){Ae(we),Ae(xe),Ae(Ie)}function fe(o){o.memoizedState!==null&&ae(Ce,o);var s=we.current,d=S1(s,o.type);s!==d&&(ae(xe,o),ae(we,d))}function ke(o){xe.current===o&&(Ae(we),Ae(xe)),Ce.current===o&&(Ae(Ce),_s._currentValue=Q)}var me=Object.prototype.hasOwnProperty,ve=e.unstable_scheduleCallback,ie=e.unstable_cancelCallback,ze=e.unstable_shouldYield,Pe=e.unstable_requestPaint,he=e.unstable_now,Ne=e.unstable_getCurrentPriorityLevel,ee=e.unstable_ImmediatePriority,ce=e.unstable_UserBlockingPriority,Re=e.unstable_NormalPriority,Fe=e.unstable_LowPriority,qe=e.unstable_IdlePriority,mt=e.log,St=e.unstable_setDisableYieldValue,pt=null,Je=null;function wt(o){if(Je&&typeof Je.onCommitFiberRoot=="function")try{Je.onCommitFiberRoot(pt,o,void 0,(o.current.flags&128)===128)}catch{}}function rt(o){if(typeof mt=="function"&&St(o),Je&&typeof Je.setStrictMode=="function")try{Je.setStrictMode(pt,o)}catch{}}var bt=Math.clz32?Math.clz32:Mt,Bt=Math.log,sn=Math.LN2;function Mt(o){return o>>>=0,o===0?32:31-(Bt(o)/sn|0)|0}var er=128,zr=4194304;function Kt(o){var s=o&42;if(s!==0)return s;switch(o&-o){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 o&4194176;case 4194304:case 8388608:case 16777216:case 33554432:return o&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return o}}function na(o,s){var d=o.pendingLanes;if(d===0)return 0;var h=0,y=o.suspendedLanes,E=o.pingedLanes,F=o.warmLanes;o=o.finishedLanes!==0;var $=d&134217727;return $!==0?(d=$&~y,d!==0?h=Kt(d):(E&=$,E!==0?h=Kt(E):o||(F=$&~F,F!==0&&(h=Kt(F))))):($=d&~y,$!==0?h=Kt($):E!==0?h=Kt(E):o||(F=d&~F,F!==0&&(h=Kt(F)))),h===0?0:s!==0&&s!==h&&!(s&y)&&(y=h&-h,F=s&-s,y>=F||y===32&&(F&4194176)!==0)?s:h}function Ye(o,s){return(o.pendingLanes&~(o.suspendedLanes&~o.pingedLanes)&s)===0}function gt(o,s){switch(o){case 1:case 2:case 4:case 8:return s+250;case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return s+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function _t(){var o=er;return er<<=1,!(er&4194176)&&(er=128),o}function Rn(){var o=zr;return zr<<=1,!(zr&62914560)&&(zr=4194304),o}function kn(o){for(var s=[],d=0;31>d;d++)s.push(o);return s}function Cn(o,s){o.pendingLanes|=s,s!==268435456&&(o.suspendedLanes=0,o.pingedLanes=0,o.warmLanes=0)}function ra(o,s,d,h,y,E){var F=o.pendingLanes;o.pendingLanes=d,o.suspendedLanes=0,o.pingedLanes=0,o.warmLanes=0,o.expiredLanes&=d,o.entangledLanes&=d,o.errorRecoveryDisabledLanes&=d,o.shellSuspendCounter=0;var $=o.entanglements,K=o.expirationTimes,ne=o.hiddenUpdates;for(d=F&~d;0"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),rG=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]*$"),SA={},EA={};function aG(o){return me.call(EA,o)?!0:me.call(SA,o)?!1:rG.test(o)?EA[o]=!0:(SA[o]=!0,!1)}function Cu(o,s,d){if(aG(s))if(d===null)o.removeAttribute(s);else{switch(typeof d){case"undefined":case"function":case"symbol":o.removeAttribute(s);return;case"boolean":var h=s.toLowerCase().slice(0,5);if(h!=="data-"&&h!=="aria-"){o.removeAttribute(s);return}}o.setAttribute(s,""+d)}}function Nu(o,s,d){if(d===null)o.removeAttribute(s);else{switch(typeof d){case"undefined":case"function":case"symbol":case"boolean":o.removeAttribute(s);return}o.setAttribute(s,""+d)}}function oa(o,s,d,h){if(h===null)o.removeAttribute(d);else{switch(typeof h){case"undefined":case"function":case"symbol":case"boolean":o.removeAttribute(d);return}o.setAttributeNS(s,d,""+h)}}function tr(o){switch(typeof o){case"bigint":case"boolean":case"number":case"string":case"undefined":return o;case"object":return o;default:return""}}function wA(o){var s=o.type;return(o=o.nodeName)&&o.toLowerCase()==="input"&&(s==="checkbox"||s==="radio")}function oG(o){var s=wA(o)?"checked":"value",d=Object.getOwnPropertyDescriptor(o.constructor.prototype,s),h=""+o[s];if(!o.hasOwnProperty(s)&&typeof d<"u"&&typeof d.get=="function"&&typeof d.set=="function"){var y=d.get,E=d.set;return Object.defineProperty(o,s,{configurable:!0,get:function(){return y.call(this)},set:function(F){h=""+F,E.call(this,F)}}),Object.defineProperty(o,s,{enumerable:d.enumerable}),{getValue:function(){return h},setValue:function(F){h=""+F},stopTracking:function(){o._valueTracker=null,delete o[s]}}}}function Ou(o){o._valueTracker||(o._valueTracker=oG(o))}function xA(o){if(!o)return!1;var s=o._valueTracker;if(!s)return!0;var d=s.getValue(),h="";return o&&(h=wA(o)?o.checked?"true":"false":o.value),o=h,o!==d?(s.setValue(o),!0):!1}function Du(o){if(o=o||(typeof document<"u"?document:void 0),typeof o>"u")return null;try{return o.activeElement||o.body}catch{return o.body}}var iG=/[\n"\\]/g;function nr(o){return o.replace(iG,function(s){return"\\"+s.charCodeAt(0).toString(16)+" "})}function Qf(o,s,d,h,y,E,F,$){o.name="",F!=null&&typeof F!="function"&&typeof F!="symbol"&&typeof F!="boolean"?o.type=F:o.removeAttribute("type"),s!=null?F==="number"?(s===0&&o.value===""||o.value!=s)&&(o.value=""+tr(s)):o.value!==""+tr(s)&&(o.value=""+tr(s)):F!=="submit"&&F!=="reset"||o.removeAttribute("value"),s!=null?Jf(o,F,tr(s)):d!=null?Jf(o,F,tr(d)):h!=null&&o.removeAttribute("value"),y==null&&E!=null&&(o.defaultChecked=!!E),y!=null&&(o.checked=y&&typeof y!="function"&&typeof y!="symbol"),$!=null&&typeof $!="function"&&typeof $!="symbol"&&typeof $!="boolean"?o.name=""+tr($):o.removeAttribute("name")}function kA(o,s,d,h,y,E,F,$){if(E!=null&&typeof E!="function"&&typeof E!="symbol"&&typeof E!="boolean"&&(o.type=E),s!=null||d!=null){if(!(E!=="submit"&&E!=="reset"||s!=null))return;d=d!=null?""+tr(d):"",s=s!=null?""+tr(s):d,$||s===o.value||(o.value=s),o.defaultValue=s}h=h??y,h=typeof h!="function"&&typeof h!="symbol"&&!!h,o.checked=$?o.checked:!!h,o.defaultChecked=!!h,F!=null&&typeof F!="function"&&typeof F!="symbol"&&typeof F!="boolean"&&(o.name=F)}function Jf(o,s,d){s==="number"&&Du(o.ownerDocument)===o||o.defaultValue===""+d||(o.defaultValue=""+d)}function bi(o,s,d,h){if(o=o.options,s){s={};for(var y=0;y=ql),zA=" ",PA=!1;function BA(o,s){switch(o){case"keyup":return LG.indexOf(s.keyCode)!==-1;case"keydown":return s.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function UA(o){return o=o.detail,typeof o=="object"&&"data"in o?o.data:null}var Ei=!1;function FG(o,s){switch(o){case"compositionend":return UA(s);case"keypress":return s.which!==32?null:(PA=!0,zA);case"textInput":return o=s.data,o===zA&&PA?null:o;default:return null}}function zG(o,s){if(Ei)return o==="compositionend"||!cp&&BA(o,s)?(o=OA(),Lu=op=Pa=null,Ei=!1,o):null;switch(o){case"paste":return null;case"keypress":if(!(s.ctrlKey||s.altKey||s.metaKey)||s.ctrlKey&&s.altKey){if(s.char&&1=s)return{node:d,offset:s-o};o=h}e:{for(;d;){if(d.nextSibling){d=d.nextSibling;break e}d=d.parentNode}d=void 0}d=YA(d)}}function XA(o,s){return o&&s?o===s?!0:o&&o.nodeType===3?!1:s&&s.nodeType===3?XA(o,s.parentNode):"contains"in o?o.contains(s):o.compareDocumentPosition?!!(o.compareDocumentPosition(s)&16):!1:!1}function ZA(o){o=o!=null&&o.ownerDocument!=null&&o.ownerDocument.defaultView!=null?o.ownerDocument.defaultView:window;for(var s=Du(o.document);s instanceof o.HTMLIFrameElement;){try{var d=typeof s.contentWindow.location.href=="string"}catch{d=!1}if(d)o=s.contentWindow;else break;s=Du(o.document)}return s}function pp(o){var s=o&&o.nodeName&&o.nodeName.toLowerCase();return s&&(s==="input"&&(o.type==="text"||o.type==="search"||o.type==="tel"||o.type==="url"||o.type==="password")||s==="textarea"||o.contentEditable==="true")}function qG(o,s){var d=ZA(s);s=o.focusedElem;var h=o.selectionRange;if(d!==s&&s&&s.ownerDocument&&XA(s.ownerDocument.documentElement,s)){if(h!==null&&pp(s)){if(o=h.start,d=h.end,d===void 0&&(d=o),"selectionStart"in s)s.selectionStart=o,s.selectionEnd=Math.min(d,s.value.length);else if(d=(o=s.ownerDocument||document)&&o.defaultView||window,d.getSelection){d=d.getSelection();var y=s.textContent.length,E=Math.min(h.start,y);h=h.end===void 0?E:Math.min(h.end,y),!d.extend&&E>h&&(y=h,h=E,E=y),y=KA(s,E);var F=KA(s,h);y&&F&&(d.rangeCount!==1||d.anchorNode!==y.node||d.anchorOffset!==y.offset||d.focusNode!==F.node||d.focusOffset!==F.offset)&&(o=o.createRange(),o.setStart(y.node,y.offset),d.removeAllRanges(),E>h?(d.addRange(o),d.extend(F.node,F.offset)):(o.setEnd(F.node,F.offset),d.addRange(o)))}}for(o=[],d=s;d=d.parentNode;)d.nodeType===1&&o.push({element:d,left:d.scrollLeft,top:d.scrollTop});for(typeof s.focus=="function"&&s.focus(),s=0;s=document.documentMode,wi=null,gp=null,Kl=null,hp=!1;function QA(o,s,d){var h=d.window===d?d.document:d.nodeType===9?d:d.ownerDocument;hp||wi==null||wi!==Du(h)||(h=wi,"selectionStart"in h&&pp(h)?h={start:h.selectionStart,end:h.selectionEnd}:(h=(h.ownerDocument&&h.ownerDocument.defaultView||window).getSelection(),h={anchorNode:h.anchorNode,anchorOffset:h.anchorOffset,focusNode:h.focusNode,focusOffset:h.focusOffset}),Kl&&Yl(Kl,h)||(Kl=h,h=Ec(gp,"onSelect"),0>=F,y-=F,ia=1<<32-bt(s)+y|d<Qe?(nn=Ve,Ve=null):nn=Ve.sibling;var vt=de(oe,Ve,ue[Qe],Se);if(vt===null){Ve===null&&(Ve=nn);break}o&&Ve&&vt.alternate===null&&s(oe,Ve),te=E(vt,te,Qe),it===null?Ue=vt:it.sibling=vt,it=vt,Ve=nn}if(Qe===ue.length)return d(oe,Ve),yt&&Do(oe,Qe),Ue;if(Ve===null){for(;QeQe?(nn=Ve,Ve=null):nn=Ve.sibling;var ao=de(oe,Ve,vt.value,Se);if(ao===null){Ve===null&&(Ve=nn);break}o&&Ve&&ao.alternate===null&&s(oe,Ve),te=E(ao,te,Qe),it===null?Ue=ao:it.sibling=ao,it=ao,Ve=nn}if(vt.done)return d(oe,Ve),yt&&Do(oe,Qe),Ue;if(Ve===null){for(;!vt.done;Qe++,vt=ue.next())vt=Te(oe,vt.value,Se),vt!==null&&(te=E(vt,te,Qe),it===null?Ue=vt:it.sibling=vt,it=vt);return yt&&Do(oe,Qe),Ue}for(Ve=h(Ve);!vt.done;Qe++,vt=ue.next())vt=ge(Ve,oe,Qe,vt.value,Se),vt!==null&&(o&&vt.alternate!==null&&Ve.delete(vt.key===null?Qe:vt.key),te=E(vt,te,Qe),it===null?Ue=vt:it.sibling=vt,it=vt);return o&&Ve.forEach(function(uH){return s(oe,uH)}),yt&&Do(oe,Qe),Ue}function Gt(oe,te,ue,Se){if(typeof ue=="object"&&ue!==null&&ue.type===c&&ue.key===null&&(ue=ue.props.children),typeof ue=="object"&&ue!==null){switch(ue.$$typeof){case l:e:{for(var Ue=ue.key;te!==null;){if(te.key===Ue){if(Ue=ue.type,Ue===c){if(te.tag===7){d(oe,te.sibling),Se=y(te,ue.props.children),Se.return=oe,oe=Se;break e}}else if(te.elementType===Ue||typeof Ue=="object"&&Ue!==null&&Ue.$$typeof===x&&hT(Ue)===te.type){d(oe,te.sibling),Se=y(te,ue.props),ns(Se,ue),Se.return=oe,oe=Se;break e}d(oe,te);break}else s(oe,te);te=te.sibling}ue.type===c?(Se=Ho(ue.props.children,oe.mode,Se,ue.key),Se.return=oe,oe=Se):(Se=dc(ue.type,ue.key,ue.props,null,oe.mode,Se),ns(Se,ue),Se.return=oe,oe=Se)}return F(oe);case u:e:{for(Ue=ue.key;te!==null;){if(te.key===Ue)if(te.tag===4&&te.stateNode.containerInfo===ue.containerInfo&&te.stateNode.implementation===ue.implementation){d(oe,te.sibling),Se=y(te,ue.children||[]),Se.return=oe,oe=Se;break e}else{d(oe,te);break}else s(oe,te);te=te.sibling}Se=bg(ue,oe.mode,Se),Se.return=oe,oe=Se}return F(oe);case x:return Ue=ue._init,ue=Ue(ue._payload),Gt(oe,te,ue,Se)}if(L(ue))return He(oe,te,ue,Se);if(T(ue)){if(Ue=T(ue),typeof Ue!="function")throw Error(r(150));return ue=Ue.call(ue),et(oe,te,ue,Se)}if(typeof ue.then=="function")return Gt(oe,te,Vu(ue),Se);if(ue.$$typeof===m)return Gt(oe,te,sc(oe,ue),Se);Wu(oe,ue)}return typeof ue=="string"&&ue!==""||typeof ue=="number"||typeof ue=="bigint"?(ue=""+ue,te!==null&&te.tag===6?(d(oe,te.sibling),Se=y(te,ue),Se.return=oe,oe=Se):(d(oe,te),Se=mg(ue,oe.mode,Se),Se.return=oe,oe=Se),F(oe)):d(oe,te)}return function(oe,te,ue,Se){try{ts=0;var Ue=Gt(oe,te,ue,Se);return Ri=null,Ue}catch(Ve){if(Ve===Jl)throw Ve;var it=cr(29,Ve,null,oe.mode);return it.lanes=Se,it.return=oe,it}finally{}}}var Lo=mT(!0),bT=mT(!1),Ci=le(null),Yu=le(0);function yT(o,s){o=ya,ae(Yu,o),ae(Ci,s),ya=o|s.baseLanes}function xp(){ae(Yu,ya),ae(Ci,Ci.current)}function kp(){ya=Yu.current,Ae(Ci),Ae(Yu)}var lr=le(null),Br=null;function Ua(o){var s=o.alternate;ae(Xt,Xt.current&1),ae(lr,o),Br===null&&(s===null||Ci.current!==null||s.memoizedState!==null)&&(Br=o)}function vT(o){if(o.tag===22){if(ae(Xt,Xt.current),ae(lr,o),Br===null){var s=o.alternate;s!==null&&s.memoizedState!==null&&(Br=o)}}else ja()}function ja(){ae(Xt,Xt.current),ae(lr,lr.current)}function sa(o){Ae(lr),Br===o&&(Br=null),Ae(Xt)}var Xt=le(0);function Ku(o){for(var s=o;s!==null;){if(s.tag===13){var d=s.memoizedState;if(d!==null&&(d=d.dehydrated,d===null||d.data==="$?"||d.data==="$!"))return s}else if(s.tag===19&&s.memoizedProps.revealOrder!==void 0){if(s.flags&128)return s}else if(s.child!==null){s.child.return=s,s=s.child;continue}if(s===o)break;for(;s.sibling===null;){if(s.return===null||s.return===o)return null;s=s.return}s.sibling.return=s.return,s=s.sibling}return null}var XG=typeof AbortController<"u"?AbortController:function(){var o=[],s=this.signal={aborted:!1,addEventListener:function(d,h){o.push(h)}};this.abort=function(){s.aborted=!0,o.forEach(function(d){return d()})}},ZG=e.unstable_scheduleCallback,QG=e.unstable_NormalPriority,Zt={$$typeof:m,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Ap(){return{controller:new XG,data:new Map,refCount:0}}function rs(o){o.refCount--,o.refCount===0&&ZG(QG,function(){o.controller.abort()})}var as=null,Tp=0,Ni=0,Oi=null;function JG(o,s){if(as===null){var d=as=[];Tp=0,Ni=Dg(),Oi={status:"pending",value:void 0,then:function(h){d.push(h)}}}return Tp++,s.then(ST,ST),s}function ST(){if(--Tp===0&&as!==null){Oi!==null&&(Oi.status="fulfilled");var o=as;as=null,Ni=0,Oi=null;for(var s=0;sE?E:8;var F=I.T,$={};I.T=$,Hp(o,!1,s,d);try{var K=y(),ne=I.S;if(ne!==null&&ne($,K),K!==null&&typeof K=="object"&&typeof K.then=="function"){var be=e6(K,h);ls(o,s,be,Wn(o))}else ls(o,s,h,Wn(o))}catch(Te){ls(o,s,{then:function(){},status:"rejected",reason:Te},Wn())}finally{Y.p=E,I.T=F}}function o6(){}function jp(o,s,d,h){if(o.tag!==5)throw Error(r(476));var y=ZT(o).queue;XT(o,y,s,Q,d===null?o6:function(){return QT(o),d(h)})}function ZT(o){var s=o.memoizedState;if(s!==null)return s;s={memoizedState:Q,baseState:Q,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ua,lastRenderedState:Q},next:null};var d={};return s.next={memoizedState:d,baseState:d,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ua,lastRenderedState:d},next:null},o.memoizedState=s,o=o.alternate,o!==null&&(o.memoizedState=s),s}function QT(o){var s=ZT(o).next.queue;ls(o,s,{},Wn())}function Gp(){return mn(_s)}function JT(){return Vt().memoizedState}function e_(){return Vt().memoizedState}function i6(o){for(var s=o.return;s!==null;){switch(s.tag){case 24:case 3:var d=Wn();o=Va(d);var h=Wa(s,o,d);h!==null&&(Tn(h,s,d),cs(h,s,d)),s={cache:Ap()},o.payload=s;return}s=s.return}}function l6(o,s,d){var h=Wn();d={lane:h,revertLane:0,action:d,hasEagerState:!1,eagerState:null,next:null},ac(o)?n_(s,d):(d=yp(o,s,d,h),d!==null&&(Tn(d,o,h),r_(d,s,h)))}function t_(o,s,d){var h=Wn();ls(o,s,d,h)}function ls(o,s,d,h){var y={lane:h,revertLane:0,action:d,hasEagerState:!1,eagerState:null,next:null};if(ac(o))n_(s,y);else{var E=o.alternate;if(o.lanes===0&&(E===null||E.lanes===0)&&(E=s.lastRenderedReducer,E!==null))try{var F=s.lastRenderedState,$=E(F,d);if(y.hasEagerState=!0,y.eagerState=$,Hn($,F))return ju(o,s,y,0),Ot===null&&Uu(),!1}catch{}finally{}if(d=yp(o,s,y,h),d!==null)return Tn(d,o,h),r_(d,s,h),!0}return!1}function Hp(o,s,d,h){if(h={lane:2,revertLane:Dg(),action:h,hasEagerState:!1,eagerState:null,next:null},ac(o)){if(s)throw Error(r(479))}else s=yp(o,d,h,2),s!==null&&Tn(s,o,2)}function ac(o){var s=o.alternate;return o===ot||s!==null&&s===ot}function n_(o,s){Di=Zu=!0;var d=o.pending;d===null?s.next=s:(s.next=d.next,d.next=s),o.pending=s}function r_(o,s,d){if(d&4194176){var h=s.lanes;h&=o.pendingLanes,d|=h,s.lanes=d,Sr(o,d)}}var Ur={readContext:mn,use:ec,useCallback:Ht,useContext:Ht,useEffect:Ht,useImperativeHandle:Ht,useLayoutEffect:Ht,useInsertionEffect:Ht,useMemo:Ht,useReducer:Ht,useRef:Ht,useState:Ht,useDebugValue:Ht,useDeferredValue:Ht,useTransition:Ht,useSyncExternalStore:Ht,useId:Ht};Ur.useCacheRefresh=Ht,Ur.useMemoCache=Ht,Ur.useHostTransitionStatus=Ht,Ur.useFormState=Ht,Ur.useActionState=Ht,Ur.useOptimistic=Ht;var zo={readContext:mn,use:ec,useCallback:function(o,s){return In().memoizedState=[o,s===void 0?null:s],o},useContext:mn,useEffect:GT,useImperativeHandle:function(o,s,d){d=d!=null?d.concat([o]):null,nc(4194308,4,qT.bind(null,s,o),d)},useLayoutEffect:function(o,s){return nc(4194308,4,o,s)},useInsertionEffect:function(o,s){nc(4,2,o,s)},useMemo:function(o,s){var d=In();s=s===void 0?null:s;var h=o();if(Fo){rt(!0);try{o()}finally{rt(!1)}}return d.memoizedState=[h,s],h},useReducer:function(o,s,d){var h=In();if(d!==void 0){var y=d(s);if(Fo){rt(!0);try{d(s)}finally{rt(!1)}}}else y=s;return h.memoizedState=h.baseState=y,o={pending:null,lanes:0,dispatch:null,lastRenderedReducer:o,lastRenderedState:y},h.queue=o,o=o.dispatch=l6.bind(null,ot,o),[h.memoizedState,o]},useRef:function(o){var s=In();return o={current:o},s.memoizedState=o},useState:function(o){o=Fp(o);var s=o.queue,d=t_.bind(null,ot,s);return s.dispatch=d,[o.memoizedState,d]},useDebugValue:Bp,useDeferredValue:function(o,s){var d=In();return Up(d,o,s)},useTransition:function(){var o=Fp(!1);return o=XT.bind(null,ot,o.queue,!0,!1),In().memoizedState=o,[!1,o]},useSyncExternalStore:function(o,s,d){var h=ot,y=In();if(yt){if(d===void 0)throw Error(r(407));d=d()}else{if(d=s(),Ot===null)throw Error(r(349));ht&60||TT(h,s,d)}y.memoizedState=d;var E={value:d,getSnapshot:s};return y.queue=E,GT(RT.bind(null,h,E,o),[o]),h.flags|=2048,Li(9,_T.bind(null,h,E,d,s),{destroy:void 0},null),d},useId:function(){var o=In(),s=Ot.identifierPrefix;if(yt){var d=la,h=ia;d=(h&~(1<<32-bt(h)-1)).toString(32)+d,s=":"+s+"R"+d,d=Qu++,0 title"))),dn(E,h,d),E[hn]=o,Jt(E),h=E;break e;case"link":var F=N1("link","href",y).get(h+(d.href||""));if(F){for(var $=0;$<\/script>",o=o.removeChild(o.firstChild);break;case"select":o=typeof h.is=="string"?y.createElement("select",{is:h.is}):y.createElement("select"),h.multiple?o.multiple=!0:h.size&&(o.size=h.size);break;default:o=typeof h.is=="string"?y.createElement(d,{is:h.is}):y.createElement(d)}}o[hn]=s,o[On]=h;e:for(y=s.child;y!==null;){if(y.tag===5||y.tag===6)o.appendChild(y.stateNode);else if(y.tag!==4&&y.tag!==27&&y.child!==null){y.child.return=y,y=y.child;continue}if(y===s)break e;for(;y.sibling===null;){if(y.return===null||y.return===s)break e;y=y.return}y.sibling.return=y.return,y=y.sibling}s.stateNode=o;e:switch(dn(o,d,h),d){case"button":case"input":case"select":case"textarea":o=!!h.autoFocus;break e;case"img":o=!0;break e;default:o=!1}o&&ma(s)}}return Ft(s),s.flags&=-16777217,null;case 6:if(o&&s.stateNode!=null)o.memoizedProps!==h&&ma(s);else{if(typeof h!="string"&&s.stateNode===null)throw Error(r(166));if(o=Ie.current,Xl(s)){if(o=s.stateNode,d=s.memoizedProps,h=null,y=An,y!==null)switch(y.tag){case 27:case 5:h=y.memoizedProps}o[hn]=s,o=!!(o.nodeValue===d||h!==null&&h.suppressHydrationWarning===!0||y1(o.nodeValue,d)),o||Io(s)}else o=xc(o).createTextNode(h),o[hn]=s,s.stateNode=o}return Ft(s),null;case 13:if(h=s.memoizedState,o===null||o.memoizedState!==null&&o.memoizedState.dehydrated!==null){if(y=Xl(s),h!==null&&h.dehydrated!==null){if(o===null){if(!y)throw Error(r(318));if(y=s.memoizedState,y=y!==null?y.dehydrated:null,!y)throw Error(r(317));y[hn]=s}else Zl(),!(s.flags&128)&&(s.memoizedState=null),s.flags|=4;Ft(s),y=!1}else wr!==null&&(Ag(wr),wr=null),y=!0;if(!y)return s.flags&256?(sa(s),s):(sa(s),null)}if(sa(s),s.flags&128)return s.lanes=d,s;if(d=h!==null,o=o!==null&&o.memoizedState!==null,d){h=s.child,y=null,h.alternate!==null&&h.alternate.memoizedState!==null&&h.alternate.memoizedState.cachePool!==null&&(y=h.alternate.memoizedState.cachePool.pool);var E=null;h.memoizedState!==null&&h.memoizedState.cachePool!==null&&(E=h.memoizedState.cachePool.pool),E!==y&&(h.flags|=2048)}return d!==o&&d&&(s.child.flags|=8192),fc(s,s.updateQueue),Ft(s),null;case 4:return J(),o===null&&Fg(s.stateNode.containerInfo),Ft(s),null;case 10:return fa(s.type),Ft(s),null;case 19:if(Ae(Xt),y=s.memoizedState,y===null)return Ft(s),null;if(h=(s.flags&128)!==0,E=y.rendering,E===null)if(h)bs(y,!1);else{if(jt!==0||o!==null&&o.flags&128)for(o=s.child;o!==null;){if(E=Ku(o),E!==null){for(s.flags|=128,bs(y,!1),o=E.updateQueue,s.updateQueue=o,fc(s,o),s.subtreeFlags=0,o=d,d=s.child;d!==null;)V_(d,o),d=d.sibling;return ae(Xt,Xt.current&1|2),s.child}o=o.sibling}y.tail!==null&&he()>pc&&(s.flags|=128,h=!0,bs(y,!1),s.lanes=4194304)}else{if(!h)if(o=Ku(E),o!==null){if(s.flags|=128,h=!0,o=o.updateQueue,s.updateQueue=o,fc(s,o),bs(y,!0),y.tail===null&&y.tailMode==="hidden"&&!E.alternate&&!yt)return Ft(s),null}else 2*he()-y.renderingStartTime>pc&&d!==536870912&&(s.flags|=128,h=!0,bs(y,!1),s.lanes=4194304);y.isBackwards?(E.sibling=s.child,s.child=E):(o=y.last,o!==null?o.sibling=E:s.child=E,y.last=E)}return y.tail!==null?(s=y.tail,y.rendering=s,y.tail=s.sibling,y.renderingStartTime=he(),s.sibling=null,o=Xt.current,ae(Xt,h?o&1|2:o&1),s):(Ft(s),null);case 22:case 23:return sa(s),kp(),h=s.memoizedState!==null,o!==null?o.memoizedState!==null!==h&&(s.flags|=8192):h&&(s.flags|=8192),h?d&536870912&&!(s.flags&128)&&(Ft(s),s.subtreeFlags&6&&(s.flags|=8192)):Ft(s),d=s.updateQueue,d!==null&&fc(s,d.retryQueue),d=null,o!==null&&o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(d=o.memoizedState.cachePool.pool),h=null,s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(h=s.memoizedState.cachePool.pool),h!==d&&(s.flags|=2048),o!==null&&Ae(Mo),null;case 24:return d=null,o!==null&&(d=o.memoizedState.cache),s.memoizedState.cache!==d&&(s.flags|=2048),fa(Zt),Ft(s),null;case 25:return null}throw Error(r(156,s.tag))}function g6(o,s){switch(Sp(s),s.tag){case 1:return o=s.flags,o&65536?(s.flags=o&-65537|128,s):null;case 3:return fa(Zt),J(),o=s.flags,o&65536&&!(o&128)?(s.flags=o&-65537|128,s):null;case 26:case 27:case 5:return ke(s),null;case 13:if(sa(s),o=s.memoizedState,o!==null&&o.dehydrated!==null){if(s.alternate===null)throw Error(r(340));Zl()}return o=s.flags,o&65536?(s.flags=o&-65537|128,s):null;case 19:return Ae(Xt),null;case 4:return J(),null;case 10:return fa(s.type),null;case 22:case 23:return sa(s),kp(),o!==null&&Ae(Mo),o=s.flags,o&65536?(s.flags=o&-65537|128,s):null;case 24:return fa(Zt),null;case 25:return null;default:return null}}function K_(o,s){switch(Sp(s),s.tag){case 3:fa(Zt),J();break;case 26:case 27:case 5:ke(s);break;case 4:J();break;case 13:sa(s);break;case 19:Ae(Xt);break;case 10:fa(s.type);break;case 22:case 23:sa(s),kp(),o!==null&&Ae(Mo);break;case 24:fa(Zt)}}var h6={getCacheForType:function(o){var s=mn(Zt),d=s.data.get(o);return d===void 0&&(d=o(),s.data.set(o,d)),d}},m6=typeof WeakMap=="function"?WeakMap:Map,zt=0,Ot=null,st=null,ht=0,Dt=0,Vn=null,ba=!1,Pi=!1,yg=!1,ya=0,jt=0,Qa=0,$o=0,vg=0,dr=0,Bi=0,ys=null,jr=null,Sg=!1,Eg=0,pc=1/0,gc=null,Ja=null,hc=!1,qo=null,vs=0,wg=0,xg=null,Ss=0,kg=null;function Wn(){if(zt&2&&ht!==0)return ht&-ht;if(I.T!==null){var o=Ni;return o!==0?o:Dg()}return mA()}function X_(){dr===0&&(dr=!(ht&536870912)||yt?_t():536870912);var o=lr.current;return o!==null&&(o.flags|=32),dr}function Tn(o,s,d){(o===Ot&&Dt===2||o.cancelPendingCommit!==null)&&(Ui(o,0),va(o,ht,dr,!1)),Cn(o,d),(!(zt&2)||o!==Ot)&&(o===Ot&&(!(zt&2)&&($o|=d),jt===4&&va(o,ht,dr,!1)),Gr(o))}function Z_(o,s,d){if(zt&6)throw Error(r(327));var h=!d&&(s&60)===0&&(s&o.expiredLanes)===0||Ye(o,s),y=h?v6(o,s):Rg(o,s,!0),E=h;do{if(y===0){Pi&&!h&&va(o,s,0,!1);break}else if(y===6)va(o,s,0,!ba);else{if(d=o.current.alternate,E&&!b6(d)){y=Rg(o,s,!1),E=!1;continue}if(y===2){if(E=s,o.errorRecoveryDisabledLanes&E)var F=0;else F=o.pendingLanes&-536870913,F=F!==0?F:F&536870912?536870912:0;if(F!==0){s=F;e:{var $=o;y=ys;var K=$.current.memoizedState.isDehydrated;if(K&&(Ui($,F).flags|=256),F=Rg($,F,!1),F!==2){if(yg&&!K){$.errorRecoveryDisabledLanes|=E,$o|=E,y=4;break e}E=jr,jr=y,E!==null&&Ag(E)}y=F}if(E=!1,y!==2)continue}}if(y===1){Ui(o,0),va(o,s,0,!0);break}e:{switch(h=o,y){case 0:case 1:throw Error(r(345));case 4:if((s&4194176)===s){va(h,s,dr,!ba);break e}break;case 2:jr=null;break;case 3:case 5:break;default:throw Error(r(329))}if(h.finishedWork=d,h.finishedLanes=s,(s&62914560)===s&&(E=Eg+300-he(),10d?32:d,I.T=null,qo===null)var E=!1;else{d=xg,xg=null;var F=qo,$=vs;if(qo=null,vs=0,zt&6)throw Error(r(331));var K=zt;if(zt|=4,$_(F.current),j_(F,F.current,$,d),zt=K,Es(0,!1),Je&&typeof Je.onPostCommitFiberRoot=="function")try{Je.onPostCommitFiberRoot(pt,F)}catch{}E=!0}return E}finally{Y.p=y,I.T=h,i1(o,s)}}return!1}function l1(o,s,d){s=ar(d,s),s=Vp(o.stateNode,s,2),o=Wa(o,s,2),o!==null&&(Cn(o,2),Gr(o))}function Rt(o,s,d){if(o.tag===3)l1(o,o,d);else for(;s!==null;){if(s.tag===3){l1(s,o,d);break}else if(s.tag===1){var h=s.stateNode;if(typeof s.type.getDerivedStateFromError=="function"||typeof h.componentDidCatch=="function"&&(Ja===null||!Ja.has(h))){o=ar(d,o),d=c_(2),h=Wa(s,d,2),h!==null&&(d_(d,h,s,o),Cn(h,2),Gr(h));break}}s=s.return}}function Cg(o,s,d){var h=o.pingCache;if(h===null){h=o.pingCache=new m6;var y=new Set;h.set(s,y)}else y=h.get(s),y===void 0&&(y=new Set,h.set(s,y));y.has(d)||(yg=!0,y.add(d),o=w6.bind(null,o,s,d),s.then(o,o))}function w6(o,s,d){var h=o.pingCache;h!==null&&h.delete(s),o.pingedLanes|=o.suspendedLanes&d,o.warmLanes&=~d,Ot===o&&(ht&d)===d&&(jt===4||jt===3&&(ht&62914560)===ht&&300>he()-Eg?!(zt&2)&&Ui(o,0):vg|=d,Bi===ht&&(Bi=0)),Gr(o)}function s1(o,s){s===0&&(s=Rn()),o=Ba(o,s),o!==null&&(Cn(o,s),Gr(o))}function x6(o){var s=o.memoizedState,d=0;s!==null&&(d=s.retryLane),s1(o,d)}function k6(o,s){var d=0;switch(o.tag){case 13:var h=o.stateNode,y=o.memoizedState;y!==null&&(d=y.retryLane);break;case 19:h=o.stateNode;break;case 22:h=o.stateNode._retryCache;break;default:throw Error(r(314))}h!==null&&h.delete(s),s1(o,d)}function A6(o,s){return ve(o,s)}var yc=null,Hi=null,Ng=!1,vc=!1,Og=!1,Vo=0;function Gr(o){o!==Hi&&o.next===null&&(Hi===null?yc=Hi=o:Hi=Hi.next=o),vc=!0,Ng||(Ng=!0,_6(T6))}function Es(o,s){if(!Og&&vc){Og=!0;do for(var d=!1,h=yc;h!==null;){if(o!==0){var y=h.pendingLanes;if(y===0)var E=0;else{var F=h.suspendedLanes,$=h.pingedLanes;E=(1<<31-bt(42|o)+1)-1,E&=y&~(F&~$),E=E&201326677?E&201326677|1:E?E|2:0}E!==0&&(d=!0,d1(h,E))}else E=ht,E=na(h,h===Ot?E:0),!(E&3)||Ye(h,E)||(d=!0,d1(h,E));h=h.next}while(d);Og=!1}}function T6(){vc=Ng=!1;var o=0;Vo!==0&&(M6()&&(o=Vo),Vo=0);for(var s=he(),d=null,h=yc;h!==null;){var y=h.next,E=u1(h,s);E===0?(h.next=null,d===null?yc=y:d.next=y,y===null&&(Hi=d)):(d=h,(o!==0||E&3)&&(vc=!0)),h=y}Es(o)}function u1(o,s){for(var d=o.suspendedLanes,h=o.pingedLanes,y=o.expirationTimes,E=o.pendingLanes&-62914561;0"u"?null:document;function T1(o,s,d){var h=qi;if(h&&typeof s=="string"&&s){var y=nr(s);y='link[rel="'+o+'"][href="'+y+'"]',typeof d=="string"&&(y+='[crossorigin="'+d+'"]'),A1.has(y)||(A1.add(y),o={rel:o,crossOrigin:d,href:s},h.querySelector(y)===null&&(s=h.createElement("link"),dn(s,"link",o),Jt(s),h.head.appendChild(s)))}}function H6(o){Sa.D(o),T1("dns-prefetch",o,null)}function $6(o,s){Sa.C(o,s),T1("preconnect",o,s)}function q6(o,s,d){Sa.L(o,s,d);var h=qi;if(h&&o&&s){var y='link[rel="preload"][as="'+nr(s)+'"]';s==="image"&&d&&d.imageSrcSet?(y+='[imagesrcset="'+nr(d.imageSrcSet)+'"]',typeof d.imageSizes=="string"&&(y+='[imagesizes="'+nr(d.imageSizes)+'"]')):y+='[href="'+nr(o)+'"]';var E=y;switch(s){case"style":E=Vi(o);break;case"script":E=Wi(o)}fr.has(E)||(o=M({rel:"preload",href:s==="image"&&d&&d.imageSrcSet?void 0:o,as:s},d),fr.set(E,o),h.querySelector(y)!==null||s==="style"&&h.querySelector(ks(E))||s==="script"&&h.querySelector(As(E))||(s=h.createElement("link"),dn(s,"link",o),Jt(s),h.head.appendChild(s)))}}function V6(o,s){Sa.m(o,s);var d=qi;if(d&&o){var h=s&&typeof s.as=="string"?s.as:"script",y='link[rel="modulepreload"][as="'+nr(h)+'"][href="'+nr(o)+'"]',E=y;switch(h){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":E=Wi(o)}if(!fr.has(E)&&(o=M({rel:"modulepreload",href:o},s),fr.set(E,o),d.querySelector(y)===null)){switch(h){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(d.querySelector(As(E)))return}h=d.createElement("link"),dn(h,"link",o),Jt(h),d.head.appendChild(h)}}}function W6(o,s,d){Sa.S(o,s,d);var h=qi;if(h&&o){var y=hi(h).hoistableStyles,E=Vi(o);s=s||"default";var F=y.get(E);if(!F){var $={loading:0,preload:null};if(F=h.querySelector(ks(E)))$.loading=5;else{o=M({rel:"stylesheet",href:o,"data-precedence":s},d),(d=fr.get(E))&&qg(o,d);var K=F=h.createElement("link");Jt(K),dn(K,"link",o),K._p=new Promise(function(ne,be){K.onload=ne,K.onerror=be}),K.addEventListener("load",function(){$.loading|=1}),K.addEventListener("error",function(){$.loading|=2}),$.loading|=4,Ac(F,s,h)}F={type:"stylesheet",instance:F,count:1,state:$},y.set(E,F)}}}function Y6(o,s){Sa.X(o,s);var d=qi;if(d&&o){var h=hi(d).hoistableScripts,y=Wi(o),E=h.get(y);E||(E=d.querySelector(As(y)),E||(o=M({src:o,async:!0},s),(s=fr.get(y))&&Vg(o,s),E=d.createElement("script"),Jt(E),dn(E,"link",o),d.head.appendChild(E)),E={type:"script",instance:E,count:1,state:null},h.set(y,E))}}function K6(o,s){Sa.M(o,s);var d=qi;if(d&&o){var h=hi(d).hoistableScripts,y=Wi(o),E=h.get(y);E||(E=d.querySelector(As(y)),E||(o=M({src:o,async:!0,type:"module"},s),(s=fr.get(y))&&Vg(o,s),E=d.createElement("script"),Jt(E),dn(E,"link",o),d.head.appendChild(E)),E={type:"script",instance:E,count:1,state:null},h.set(y,E))}}function _1(o,s,d,h){var y=(y=Ie.current)?kc(y):null;if(!y)throw Error(r(446));switch(o){case"meta":case"title":return null;case"style":return typeof d.precedence=="string"&&typeof d.href=="string"?(s=Vi(d.href),d=hi(y).hoistableStyles,h=d.get(s),h||(h={type:"style",instance:null,count:0,state:null},d.set(s,h)),h):{type:"void",instance:null,count:0,state:null};case"link":if(d.rel==="stylesheet"&&typeof d.href=="string"&&typeof d.precedence=="string"){o=Vi(d.href);var E=hi(y).hoistableStyles,F=E.get(o);if(F||(y=y.ownerDocument||y,F={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},E.set(o,F),(E=y.querySelector(ks(o)))&&!E._p&&(F.instance=E,F.state.loading=5),fr.has(o)||(d={rel:"preload",as:"style",href:d.href,crossOrigin:d.crossOrigin,integrity:d.integrity,media:d.media,hrefLang:d.hrefLang,referrerPolicy:d.referrerPolicy},fr.set(o,d),E||X6(y,o,d,F.state))),s&&h===null)throw Error(r(528,""));return F}if(s&&h!==null)throw Error(r(529,""));return null;case"script":return s=d.async,d=d.src,typeof d=="string"&&s&&typeof s!="function"&&typeof s!="symbol"?(s=Wi(d),d=hi(y).hoistableScripts,h=d.get(s),h||(h={type:"script",instance:null,count:0,state:null},d.set(s,h)),h):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,o))}}function Vi(o){return'href="'+nr(o)+'"'}function ks(o){return'link[rel="stylesheet"]['+o+"]"}function R1(o){return M({},o,{"data-precedence":o.precedence,precedence:null})}function X6(o,s,d,h){o.querySelector('link[rel="preload"][as="style"]['+s+"]")?h.loading=1:(s=o.createElement("link"),h.preload=s,s.addEventListener("load",function(){return h.loading|=1}),s.addEventListener("error",function(){return h.loading|=2}),dn(s,"link",d),Jt(s),o.head.appendChild(s))}function Wi(o){return'[src="'+nr(o)+'"]'}function As(o){return"script[async]"+o}function C1(o,s,d){if(s.count++,s.instance===null)switch(s.type){case"style":var h=o.querySelector('style[data-href~="'+nr(d.href)+'"]');if(h)return s.instance=h,Jt(h),h;var y=M({},d,{"data-href":d.href,"data-precedence":d.precedence,href:null,precedence:null});return h=(o.ownerDocument||o).createElement("style"),Jt(h),dn(h,"style",y),Ac(h,d.precedence,o),s.instance=h;case"stylesheet":y=Vi(d.href);var E=o.querySelector(ks(y));if(E)return s.state.loading|=4,s.instance=E,Jt(E),E;h=R1(d),(y=fr.get(y))&&qg(h,y),E=(o.ownerDocument||o).createElement("link"),Jt(E);var F=E;return F._p=new Promise(function($,K){F.onload=$,F.onerror=K}),dn(E,"link",h),s.state.loading|=4,Ac(E,d.precedence,o),s.instance=E;case"script":return E=Wi(d.src),(y=o.querySelector(As(E)))?(s.instance=y,Jt(y),y):(h=d,(y=fr.get(E))&&(h=M({},d),Vg(h,y)),o=o.ownerDocument||o,y=o.createElement("script"),Jt(y),dn(y,"link",h),o.head.appendChild(y),s.instance=y);case"void":return null;default:throw Error(r(443,s.type))}else s.type==="stylesheet"&&!(s.state.loading&4)&&(h=s.instance,s.state.loading|=4,Ac(h,d.precedence,o));return s.instance}function Ac(o,s,d){for(var h=d.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),y=h.length?h[h.length-1]:null,E=y,F=0;F title"):null)}function Z6(o,s,d){if(d===1||s.itemProp!=null)return!1;switch(o){case"meta":case"title":return!0;case"style":if(typeof s.precedence!="string"||typeof s.href!="string"||s.href==="")break;return!0;case"link":if(typeof s.rel!="string"||typeof s.href!="string"||s.href===""||s.onLoad||s.onError)break;switch(s.rel){case"stylesheet":return o=s.disabled,typeof s.precedence=="string"&&o==null;default:return!0}case"script":if(s.async&&typeof s.async!="function"&&typeof s.async!="symbol"&&!s.onLoad&&!s.onError&&s.src&&typeof s.src=="string")return!0}return!1}function D1(o){return!(o.type==="stylesheet"&&!(o.state.loading&3))}var Ts=null;function Q6(){}function J6(o,s,d){if(Ts===null)throw Error(r(475));var h=Ts;if(s.type==="stylesheet"&&(typeof d.media!="string"||matchMedia(d.media).matches!==!1)&&!(s.state.loading&4)){if(s.instance===null){var y=Vi(d.href),E=o.querySelector(ks(y));if(E){o=E._p,o!==null&&typeof o=="object"&&typeof o.then=="function"&&(h.count++,h=_c.bind(h),o.then(h,h)),s.state.loading|=4,s.instance=E,Jt(E);return}E=o.ownerDocument||o,d=R1(d),(y=fr.get(y))&&qg(d,y),E=E.createElement("link"),Jt(E);var F=E;F._p=new Promise(function($,K){F.onload=$,F.onerror=K}),dn(E,"link",d),s.instance=E}h.stylesheets===null&&(h.stylesheets=new Map),h.stylesheets.set(s,o),(o=s.state.preload)&&!(s.state.loading&3)&&(h.count++,s=_c.bind(h),o.addEventListener("load",s),o.addEventListener("error",s))}}function eH(){if(Ts===null)throw Error(r(475));var o=Ts;return o.stylesheets&&o.count===0&&Wg(o,o.stylesheets),0"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),nh.exports=EH(),nh.exports}var xH=wH();const eR=e=>{let t;const n=new Set,r=(f,p)=>{const g=typeof f=="function"?f(t):f;if(!Object.is(g,t)){const b=t;t=p??(typeof g!="object"||g===null)?g:Object.assign({},t,g),n.forEach(m=>m(t,b))}},a=()=>t,u={setState:r,getState:a,getInitialState:()=>c,subscribe:f=>(n.add(f),()=>n.delete(f))},c=t=e(r,a,u);return u},kH=e=>e?eR(e):eR,AH=e=>e;function TH(e,t=AH){const n=ye.useSyncExternalStore(e.subscribe,()=>t(e.getState()),()=>t(e.getInitialState()));return ye.useDebugValue(n),n}const _H=e=>{const t=kH(e),n=r=>TH(t,r);return Object.assign(n,t),n},wk=e=>_H;function bz(e,t){let n;try{n=e()}catch{return}return{getItem:a=>{var i;const l=c=>c===null?null:JSON.parse(c,void 0),u=(i=n.getItem(a))!=null?i:null;return u instanceof Promise?u.then(l):l(u)},setItem:(a,i)=>n.setItem(a,JSON.stringify(i,void 0)),removeItem:a=>n.removeItem(a)}}const dx=e=>t=>{try{const n=e(t);return n instanceof Promise?n:{then(r){return dx(r)(n)},catch(r){return this}}}catch(n){return{then(r){return this},catch(r){return dx(r)(n)}}}},RH=(e,t)=>(n,r,a)=>{let i={storage:bz(()=>localStorage),partialize:v=>v,version:0,merge:(v,A)=>({...A,...v}),...t},l=!1;const u=new Set,c=new Set;let f=i.storage;if(!f)return e((...v)=>{console.warn(`[zustand persist middleware] Unable to update item '${i.name}', the given storage is currently unavailable.`),n(...v)},r,a);const p=()=>{const v=i.partialize({...r()});return f.setItem(i.name,{state:v,version:i.version})},g=a.setState;a.setState=(v,A)=>{g(v,A),p()};const b=e((...v)=>{n(...v),p()},r,a);a.getInitialState=()=>b;let m;const S=()=>{var v,A;if(!f)return;l=!1,u.forEach(x=>{var _;return x((_=r())!=null?_:b)});const R=((A=i.onRehydrateStorage)==null?void 0:A.call(i,(v=r())!=null?v:b))||void 0;return dx(f.getItem.bind(f))(i.name).then(x=>{if(x)if(typeof x.version=="number"&&x.version!==i.version){if(i.migrate){const _=i.migrate(x.state,x.version);return _ instanceof Promise?_.then(C=>[!0,C]):[!0,_]}console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,x.state];return[!1,void 0]}).then(x=>{var _;const[C,N]=x;if(m=i.merge(N,(_=r())!=null?_:b),n(m,!0),C)return p()}).then(()=>{R==null||R(m,void 0),m=r(),l=!0,c.forEach(x=>x(m))}).catch(x=>{R==null||R(void 0,x)})};return a.persist={setOptions:v=>{i={...i,...v},v.storage&&(f=v.storage)},clearStorage:()=>{f==null||f.removeItem(i.name)},getOptions:()=>i,rehydrate:()=>S(),hasHydrated:()=>l,onHydrate:v=>(u.add(v),()=>{u.delete(v)}),onFinishHydration:v=>(c.add(v),()=>{c.delete(v)})},i.skipHydration||S(),m||b},CH=RH;function yz(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var a=e.length;for(t=0;t{const t=DH(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:l=>{const u=l.split(xk);return u[0]===""&&u.length!==1&&u.shift(),Sz(u,t)||OH(l)},getConflictingClassGroupIds:(l,u)=>{const c=n[l]||[];return u&&r[l]?[...c,...r[l]]:c}}},Sz=(e,t)=>{var l;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),a=r?Sz(e.slice(1),r):void 0;if(a)return a;if(t.validators.length===0)return;const i=e.join(xk);return(l=t.validators.find(({validator:u})=>u(i)))==null?void 0:l.classGroupId},tR=/^\[(.+)\]$/,OH=e=>{if(tR.test(e)){const t=tR.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},DH=e=>{const{theme:t,classGroups:n}=e,r={nextPart:new Map,validators:[]};for(const a in n)fx(n[a],r,a,t);return r},fx=(e,t,n,r)=>{e.forEach(a=>{if(typeof a=="string"){const i=a===""?t:nR(t,a);i.classGroupId=n;return}if(typeof a=="function"){if(IH(a)){fx(a(r),t,n,r);return}t.validators.push({validator:a,classGroupId:n});return}Object.entries(a).forEach(([i,l])=>{fx(l,nR(t,i),n,r)})})},nR=(e,t)=>{let n=e;return t.split(xk).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},IH=e=>e.isThemeGetter,LH=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const a=(i,l)=>{n.set(i,l),t++,t>e&&(t=0,r=n,n=new Map)};return{get(i){let l=n.get(i);if(l!==void 0)return l;if((l=r.get(i))!==void 0)return a(i,l),l},set(i,l){n.has(i)?n.set(i,l):a(i,l)}}},px="!",gx=":",MH=gx.length,FH=e=>{const{prefix:t,experimentalParseClassName:n}=e;let r=a=>{const i=[];let l=0,u=0,c=0,f;for(let S=0;Sc?f-c:void 0;return{modifiers:i,hasImportantModifier:b,baseClassName:g,maybePostfixModifierPosition:m}};if(t){const a=t+gx,i=r;r=l=>l.startsWith(a)?i(l.substring(a.length)):{isExternal:!0,modifiers:[],hasImportantModifier:!1,baseClassName:l,maybePostfixModifierPosition:void 0}}if(n){const a=r;r=i=>n({className:i,parseClassName:a})}return r},zH=e=>e.endsWith(px)?e.substring(0,e.length-1):e.startsWith(px)?e.substring(1):e,PH=e=>{const t=Object.fromEntries(e.orderSensitiveModifiers.map(r=>[r,!0]));return r=>{if(r.length<=1)return r;const a=[];let i=[];return r.forEach(l=>{l[0]==="["||t[l]?(a.push(...i.sort(),l),i=[]):i.push(l)}),a.push(...i.sort()),a}},BH=e=>({cache:LH(e.cacheSize),parseClassName:FH(e),sortModifiers:PH(e),...NH(e)}),UH=/\s+/,jH=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:a,sortModifiers:i}=t,l=[],u=e.trim().split(UH);let c="";for(let f=u.length-1;f>=0;f-=1){const p=u[f],{isExternal:g,modifiers:b,hasImportantModifier:m,baseClassName:S,maybePostfixModifierPosition:v}=n(p);if(g){c=p+(c.length>0?" "+c:c);continue}let A=!!v,R=r(A?S.substring(0,v):S);if(!R){if(!A){c=p+(c.length>0?" "+c:c);continue}if(R=r(S),!R){c=p+(c.length>0?" "+c:c);continue}A=!1}const x=i(b).join(":"),_=m?x+px:x,C=_+R;if(l.includes(C))continue;l.push(C);const N=a(R,A);for(let T=0;T0?" "+c:c)}return c};function GH(){let e=0,t,n,r="";for(;e{if(typeof e=="string")return e;let t,n="";for(let r=0;rg(p),e());return n=BH(f),r=n.cache.get,a=n.cache.set,i=u,u(c)}function u(c){const f=r(c);if(f)return f;const p=jH(c,n);return a(c,p),p}return function(){return i(GH.apply(null,arguments))}}const rn=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},wz=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,xz=/^\((?:(\w[\w-]*):)?(.+)\)$/i,$H=/^\d+\/\d+$/,qH=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,VH=/\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$/,WH=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,YH=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,KH=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Yi=e=>$H.test(e),ct=e=>!!e&&!Number.isNaN(Number(e)),Wo=e=>!!e&&Number.isInteger(Number(e)),rR=e=>e.endsWith("%")&&ct(e.slice(0,-1)),oo=e=>qH.test(e),XH=()=>!0,ZH=e=>VH.test(e)&&!WH.test(e),kk=()=>!1,QH=e=>YH.test(e),JH=e=>KH.test(e),e9=e=>!je(e)&&!Ge(e),t9=e=>xl(e,Tz,kk),je=e=>wz.test(e),Yo=e=>xl(e,_z,ZH),ih=e=>xl(e,f9,ct),n9=e=>xl(e,kz,kk),r9=e=>xl(e,Az,JH),a9=e=>xl(e,kk,QH),Ge=e=>xz.test(e),Fc=e=>kl(e,_z),o9=e=>kl(e,p9),i9=e=>kl(e,kz),l9=e=>kl(e,Tz),s9=e=>kl(e,Az),u9=e=>kl(e,g9,!0),xl=(e,t,n)=>{const r=wz.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},kl=(e,t,n=!1)=>{const r=xz.exec(e);return r?r[1]?t(r[1]):n:!1},kz=e=>e==="position",c9=new Set(["image","url"]),Az=e=>c9.has(e),d9=new Set(["length","size","percentage"]),Tz=e=>d9.has(e),_z=e=>e==="length",f9=e=>e==="number",p9=e=>e==="family-name",g9=e=>e==="shadow",h9=()=>{const e=rn("color"),t=rn("font"),n=rn("text"),r=rn("font-weight"),a=rn("tracking"),i=rn("leading"),l=rn("breakpoint"),u=rn("container"),c=rn("spacing"),f=rn("radius"),p=rn("shadow"),g=rn("inset-shadow"),b=rn("drop-shadow"),m=rn("blur"),S=rn("perspective"),v=rn("aspect"),A=rn("ease"),R=rn("animate"),x=()=>["auto","avoid","all","avoid-page","page","left","right","column"],_=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],C=()=>["auto","hidden","clip","visible","scroll"],N=()=>["auto","contain","none"],T=()=>[Ge,je,c],O=()=>[Yi,"full","auto",...T()],z=()=>[Wo,"none","subgrid",Ge,je],I=()=>["auto",{span:["full",Wo,Ge,je]},Ge,je],M=()=>[Wo,"auto",Ge,je],H=()=>["auto","min","max","fr",Ge,je],q=()=>["start","end","center","between","around","evenly","stretch","baseline"],U=()=>["start","end","center","stretch"],W=()=>["auto",...T()],Z=()=>[Yi,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...T()],j=()=>[e,Ge,je],G=()=>[rR,Yo],P=()=>["","none","full",f,Ge,je],X=()=>["",ct,Fc,Yo],D=()=>["solid","dashed","dotted","double"],V=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],B=()=>["","none",m,Ge,je],L=()=>["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",Ge,je],Y=()=>["none",ct,Ge,je],Q=()=>["none",ct,Ge,je],se=()=>[ct,Ge,je],re=()=>[Yi,"full",...T()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[oo],breakpoint:[oo],color:[XH],container:[oo],"drop-shadow":[oo],ease:["in","out","in-out"],font:[e9],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[oo],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[oo],shadow:[oo],spacing:["px",ct],text:[oo],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Yi,je,Ge,v]}],container:["container"],columns:[{columns:[ct,je,Ge,u]}],"break-after":[{"break-after":x()}],"break-before":[{"break-before":x()}],"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:[..._(),je,Ge]}],overflow:[{overflow:C()}],"overflow-x":[{"overflow-x":C()}],"overflow-y":[{"overflow-y":C()}],overscroll:[{overscroll:N()}],"overscroll-x":[{"overscroll-x":N()}],"overscroll-y":[{"overscroll-y":N()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:O()}],"inset-x":[{"inset-x":O()}],"inset-y":[{"inset-y":O()}],start:[{start:O()}],end:[{end:O()}],top:[{top:O()}],right:[{right:O()}],bottom:[{bottom:O()}],left:[{left:O()}],visibility:["visible","invisible","collapse"],z:[{z:[Wo,"auto",Ge,je]}],basis:[{basis:[Yi,"full","auto",u,...T()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[ct,Yi,"auto","initial","none",je]}],grow:[{grow:["",ct,Ge,je]}],shrink:[{shrink:["",ct,Ge,je]}],order:[{order:[Wo,"first","last","none",Ge,je]}],"grid-cols":[{"grid-cols":z()}],"col-start-end":[{col:I()}],"col-start":[{"col-start":M()}],"col-end":[{"col-end":M()}],"grid-rows":[{"grid-rows":z()}],"row-start-end":[{row:I()}],"row-start":[{"row-start":M()}],"row-end":[{"row-end":M()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":H()}],"auto-rows":[{"auto-rows":H()}],gap:[{gap:T()}],"gap-x":[{"gap-x":T()}],"gap-y":[{"gap-y":T()}],"justify-content":[{justify:[...q(),"normal"]}],"justify-items":[{"justify-items":[...U(),"normal"]}],"justify-self":[{"justify-self":["auto",...U()]}],"align-content":[{content:["normal",...q()]}],"align-items":[{items:[...U(),"baseline"]}],"align-self":[{self:["auto",...U(),"baseline"]}],"place-content":[{"place-content":q()}],"place-items":[{"place-items":[...U(),"baseline"]}],"place-self":[{"place-self":["auto",...U()]}],p:[{p:T()}],px:[{px:T()}],py:[{py:T()}],ps:[{ps:T()}],pe:[{pe:T()}],pt:[{pt:T()}],pr:[{pr:T()}],pb:[{pb:T()}],pl:[{pl:T()}],m:[{m:W()}],mx:[{mx:W()}],my:[{my:W()}],ms:[{ms:W()}],me:[{me:W()}],mt:[{mt:W()}],mr:[{mr:W()}],mb:[{mb:W()}],ml:[{ml:W()}],"space-x":[{"space-x":T()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":T()}],"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:[l]},...Z()]}],h:[{h:["screen",...Z()]}],"min-h":[{"min-h":["screen","none",...Z()]}],"max-h":[{"max-h":["screen",...Z()]}],"font-size":[{text:["base",n,Fc,Yo]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,Ge,ih]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",rR,je]}],"font-family":[{font:[o9,je,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:[a,Ge,je]}],"line-clamp":[{"line-clamp":[ct,"none",Ge,ih]}],leading:[{leading:[i,...T()]}],"list-image":[{"list-image":["none",Ge,je]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Ge,je]}],"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:[...D(),"wavy"]}],"text-decoration-thickness":[{decoration:[ct,"from-font","auto",Ge,Yo]}],"text-decoration-color":[{decoration:j()}],"underline-offset":[{"underline-offset":[ct,"auto",Ge,je]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:T()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Ge,je]}],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",Ge,je]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[..._(),i9,n9]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","space","round"]}]}],"bg-size":[{bg:["auto","cover","contain",l9,t9]}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Wo,Ge,je],radial:["",Ge,je],conic:[Wo,Ge,je]},s9,r9]}],"bg-color":[{bg:j()}],"gradient-from-pos":[{from:G()}],"gradient-via-pos":[{via:G()}],"gradient-to-pos":[{to:G()}],"gradient-from":[{from:j()}],"gradient-via":[{via:j()}],"gradient-to":[{to:j()}],rounded:[{rounded:P()}],"rounded-s":[{"rounded-s":P()}],"rounded-e":[{"rounded-e":P()}],"rounded-t":[{"rounded-t":P()}],"rounded-r":[{"rounded-r":P()}],"rounded-b":[{"rounded-b":P()}],"rounded-l":[{"rounded-l":P()}],"rounded-ss":[{"rounded-ss":P()}],"rounded-se":[{"rounded-se":P()}],"rounded-ee":[{"rounded-ee":P()}],"rounded-es":[{"rounded-es":P()}],"rounded-tl":[{"rounded-tl":P()}],"rounded-tr":[{"rounded-tr":P()}],"rounded-br":[{"rounded-br":P()}],"rounded-bl":[{"rounded-bl":P()}],"border-w":[{border:X()}],"border-w-x":[{"border-x":X()}],"border-w-y":[{"border-y":X()}],"border-w-s":[{"border-s":X()}],"border-w-e":[{"border-e":X()}],"border-w-t":[{"border-t":X()}],"border-w-r":[{"border-r":X()}],"border-w-b":[{"border-b":X()}],"border-w-l":[{"border-l":X()}],"divide-x":[{"divide-x":X()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":X()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...D(),"hidden","none"]}],"divide-style":[{divide:[...D(),"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:[...D(),"none","hidden"]}],"outline-offset":[{"outline-offset":[ct,Ge,je]}],"outline-w":[{outline:["",ct,Fc,Yo]}],"outline-color":[{outline:[e]}],shadow:[{shadow:["","none",p,u9,a9]}],"shadow-color":[{shadow:j()}],"inset-shadow":[{"inset-shadow":["none",Ge,je,g]}],"inset-shadow-color":[{"inset-shadow":j()}],"ring-w":[{ring:X()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:j()}],"ring-offset-w":[{"ring-offset":[ct,Yo]}],"ring-offset-color":[{"ring-offset":j()}],"inset-ring-w":[{"inset-ring":X()}],"inset-ring-color":[{"inset-ring":j()}],opacity:[{opacity:[ct,Ge,je]}],"mix-blend":[{"mix-blend":[...V(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":V()}],filter:[{filter:["","none",Ge,je]}],blur:[{blur:B()}],brightness:[{brightness:[ct,Ge,je]}],contrast:[{contrast:[ct,Ge,je]}],"drop-shadow":[{"drop-shadow":["","none",b,Ge,je]}],grayscale:[{grayscale:["",ct,Ge,je]}],"hue-rotate":[{"hue-rotate":[ct,Ge,je]}],invert:[{invert:["",ct,Ge,je]}],saturate:[{saturate:[ct,Ge,je]}],sepia:[{sepia:["",ct,Ge,je]}],"backdrop-filter":[{"backdrop-filter":["","none",Ge,je]}],"backdrop-blur":[{"backdrop-blur":B()}],"backdrop-brightness":[{"backdrop-brightness":[ct,Ge,je]}],"backdrop-contrast":[{"backdrop-contrast":[ct,Ge,je]}],"backdrop-grayscale":[{"backdrop-grayscale":["",ct,Ge,je]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[ct,Ge,je]}],"backdrop-invert":[{"backdrop-invert":["",ct,Ge,je]}],"backdrop-opacity":[{"backdrop-opacity":[ct,Ge,je]}],"backdrop-saturate":[{"backdrop-saturate":[ct,Ge,je]}],"backdrop-sepia":[{"backdrop-sepia":["",ct,Ge,je]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":T()}],"border-spacing-x":[{"border-spacing-x":T()}],"border-spacing-y":[{"border-spacing-y":T()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",Ge,je]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[ct,"initial",Ge,je]}],ease:[{ease:["linear","initial",A,Ge,je]}],delay:[{delay:[ct,Ge,je]}],animate:[{animate:["none",R,Ge,je]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[S,Ge,je]}],"perspective-origin":[{"perspective-origin":L()}],rotate:[{rotate:Y()}],"rotate-x":[{"rotate-x":Y()}],"rotate-y":[{"rotate-y":Y()}],"rotate-z":[{"rotate-z":Y()}],scale:[{scale:Q()}],"scale-x":[{"scale-x":Q()}],"scale-y":[{"scale-y":Q()}],"scale-z":[{"scale-z":Q()}],"scale-3d":["scale-3d"],skew:[{skew:se()}],"skew-x":[{"skew-x":se()}],"skew-y":[{"skew-y":se()}],transform:[{transform:[Ge,je,"","none","gpu","cpu"]}],"transform-origin":[{origin:L()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:re()}],"translate-x":[{"translate-x":re()}],"translate-y":[{"translate-y":re()}],"translate-z":[{"translate-z":re()}],"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",Ge,je]}],"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":T()}],"scroll-mx":[{"scroll-mx":T()}],"scroll-my":[{"scroll-my":T()}],"scroll-ms":[{"scroll-ms":T()}],"scroll-me":[{"scroll-me":T()}],"scroll-mt":[{"scroll-mt":T()}],"scroll-mr":[{"scroll-mr":T()}],"scroll-mb":[{"scroll-mb":T()}],"scroll-ml":[{"scroll-ml":T()}],"scroll-p":[{"scroll-p":T()}],"scroll-px":[{"scroll-px":T()}],"scroll-py":[{"scroll-py":T()}],"scroll-ps":[{"scroll-ps":T()}],"scroll-pe":[{"scroll-pe":T()}],"scroll-pt":[{"scroll-pt":T()}],"scroll-pr":[{"scroll-pr":T()}],"scroll-pb":[{"scroll-pb":T()}],"scroll-pl":[{"scroll-pl":T()}],"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",Ge,je]}],fill:[{fill:["none",...j()]}],"stroke-w":[{stroke:[ct,Fc,Yo,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","*","**"]}},m9=HH(h9);function Me(...e){return m9(vz(e))}function b9(){const e="0123456789abcdef";let t="#";for(let n=0;n<6;n++)t+=e.charAt(Math.floor(Math.random()*16));return t}function Nr(e){return e instanceof Error?e.message:`${e}`}const Ak=e=>{const t=e;t.use={};for(const n of Object.keys(t.getState()))t.use[n]=()=>t(r=>r[n]);return t},Rz="",Yr="ghost",y9="#B2EBF2",v9="#000",S9="#E2E2E2",E9="#EEEEEE",w9="#F57F17",x9="#969696",k9="#F57F17",aR="#B2EBF2",lh=20,sh=40,oR=4,A9=20,T9=15,iR="*",_9={"text/plain":[".txt",".md",".html",".htm",".tex",".json",".xml",".yaml",".yml",".rtf",".odt",".epub",".csv",".log",".conf",".ini",".properties",".sql",".bat",".sh",".c",".cpp",".py",".java",".js",".ts",".swift",".go",".rb",".php",".css",".scss",".less"],"application/pdf":[".pdf"],"application/msword":[".doc"],"application/vnd.openxmlformats-officedocument.wordprocessingml.document":[".docx"],"application/vnd.openxmlformats-officedocument.presentationml.presentation":[".pptx"]},lR={name:"LightRAG",github:"https://github.com/HKUDS/LightRAG"},R9=wk()(CH(e=>({theme:"system",showPropertyPanel:!0,showNodeSearchBar:!0,showNodeLabel:!0,enableNodeDrag:!0,showEdgeLabel:!1,enableHideUnselectedEdges:!0,enableEdgeEvents:!1,graphQueryMaxDepth:3,graphLayoutMaxIterations:10,queryLabel:iR,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}),setGraphLayoutMaxIterations:t=>e({graphLayoutMaxIterations:t}),setQueryLabel:t=>e({queryLabel:t}),setGraphQueryMaxDepth:t=>e({graphQueryMaxDepth: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:bz(()=>localStorage),version:7,migrate:(e,t)=>(t<2&&(e.showEdgeLabel=!1),t<3&&(e.queryLabel=iR),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=[]),t<7&&(e.graphQueryMaxDepth=3,e.graphLayoutMaxIterations=10),e)})),Ke=Ak(R9),C9={theme:"system",setTheme:()=>null},Cz=k.createContext(C9);function N9({children:e,...t}){const[n,r]=k.useState(Ke.getState().theme);k.useEffect(()=>{const i=window.document.documentElement;if(i.classList.remove("light","dark"),n==="system"){const l=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";i.classList.add(l),r(l);return}i.classList.add(n)},[n]);const a={theme:n,setTheme:i=>{Ke.getState().setTheme(i),r(i)}};return w.jsx(Cz.Provider,{...t,value:a,children:e})}const sR=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,uR=vz,Nz=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return uR(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:a,defaultVariants:i}=t,l=Object.keys(a).map(f=>{const p=n==null?void 0:n[f],g=i==null?void 0:i[f];if(p===null)return null;const b=sR(p)||sR(g);return a[f][b]}),u=n&&Object.entries(n).reduce((f,p)=>{let[g,b]=p;return b===void 0||(f[g]=b),f},{}),c=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((f,p)=>{let{class:g,className:b,...m}=p;return Object.entries(m).every(S=>{let[v,A]=S;return Array.isArray(A)?A.includes({...i,...u}[v]):{...i,...u}[v]===A})?[...f,g,b]:f},[]);return uR(e,l,c,n==null?void 0:n.class,n==null?void 0:n.className)},O9=Nz("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"}}),Oz=k.forwardRef(({className:e,variant:t,...n},r)=>w.jsx("div",{ref:r,role:"alert",className:Me(O9({variant:t}),e),...n}));Oz.displayName="Alert";const Dz=k.forwardRef(({className:e,...t},n)=>w.jsx("h5",{ref:n,className:Me("mb-1 leading-none font-medium tracking-tight",e),...t}));Dz.displayName="AlertTitle";const Iz=k.forwardRef(({className:e,...t},n)=>w.jsx("div",{ref:n,className:Me("text-sm [&_p]:leading-relaxed",e),...t}));Iz.displayName="AlertDescription";function Lz(e,t){return function(){return e.apply(t,arguments)}}const{toString:D9}=Object.prototype,{getPrototypeOf:Tk}=Object,rf=(e=>t=>{const n=D9.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),Lr=e=>(e=e.toLowerCase(),t=>rf(t)===e),af=e=>t=>typeof t===e,{isArray:Al}=Array,Qs=af("undefined");function I9(e){return e!==null&&!Qs(e)&&e.constructor!==null&&!Qs(e.constructor)&&Xn(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const Mz=Lr("ArrayBuffer");function L9(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&Mz(e.buffer),t}const M9=af("string"),Xn=af("function"),Fz=af("number"),of=e=>e!==null&&typeof e=="object",F9=e=>e===!0||e===!1,fd=e=>{if(rf(e)!=="object")return!1;const t=Tk(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)},z9=Lr("Date"),P9=Lr("File"),B9=Lr("Blob"),U9=Lr("FileList"),j9=e=>of(e)&&Xn(e.pipe),G9=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||Xn(e.append)&&((t=rf(e))==="formdata"||t==="object"&&Xn(e.toString)&&e.toString()==="[object FormData]"))},H9=Lr("URLSearchParams"),[$9,q9,V9,W9]=["ReadableStream","Request","Response","Headers"].map(Lr),Y9=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function du(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let r,a;if(typeof e!="object"&&(e=[e]),Al(e))for(r=0,a=e.length;r0;)if(a=n[r],t===a.toLowerCase())return a;return null}const ti=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,Pz=e=>!Qs(e)&&e!==ti;function hx(){const{caseless:e}=Pz(this)&&this||{},t={},n=(r,a)=>{const i=e&&zz(t,a)||a;fd(t[i])&&fd(r)?t[i]=hx(t[i],r):fd(r)?t[i]=hx({},r):Al(r)?t[i]=r.slice():t[i]=r};for(let r=0,a=arguments.length;r(du(t,(a,i)=>{n&&Xn(a)?e[i]=Lz(a,n):e[i]=a},{allOwnKeys:r}),e),X9=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),Z9=(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},Q9=(e,t,n,r)=>{let a,i,l;const u={};if(t=t||{},e==null)return t;do{for(a=Object.getOwnPropertyNames(e),i=a.length;i-- >0;)l=a[i],(!r||r(l,e,t))&&!u[l]&&(t[l]=e[l],u[l]=!0);e=n!==!1&&Tk(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},J9=(e,t,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return r!==-1&&r===n},e$=e=>{if(!e)return null;if(Al(e))return e;let t=e.length;if(!Fz(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},t$=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&Tk(Uint8Array)),n$=(e,t)=>{const r=(e&&e[Symbol.iterator]).call(e);let a;for(;(a=r.next())&&!a.done;){const i=a.value;t.call(e,i[0],i[1])}},r$=(e,t)=>{let n;const r=[];for(;(n=e.exec(t))!==null;)r.push(n);return r},a$=Lr("HTMLFormElement"),o$=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,a){return r.toUpperCase()+a}),cR=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),i$=Lr("RegExp"),Bz=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};du(n,(a,i)=>{let l;(l=t(a,i,e))!==!1&&(r[i]=l||a)}),Object.defineProperties(e,r)},l$=e=>{Bz(e,(t,n)=>{if(Xn(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=e[n];if(Xn(r)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},s$=(e,t)=>{const n={},r=a=>{a.forEach(i=>{n[i]=!0})};return Al(e)?r(e):r(String(e).split(t)),n},u$=()=>{},c$=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t,uh="abcdefghijklmnopqrstuvwxyz",dR="0123456789",Uz={DIGIT:dR,ALPHA:uh,ALPHA_DIGIT:uh+uh.toUpperCase()+dR},d$=(e=16,t=Uz.ALPHA_DIGIT)=>{let n="";const{length:r}=t;for(;e--;)n+=t[Math.random()*r|0];return n};function f$(e){return!!(e&&Xn(e.append)&&e[Symbol.toStringTag]==="FormData"&&e[Symbol.iterator])}const p$=e=>{const t=new Array(10),n=(r,a)=>{if(of(r)){if(t.indexOf(r)>=0)return;if(!("toJSON"in r)){t[a]=r;const i=Al(r)?[]:{};return du(r,(l,u)=>{const c=n(l,a+1);!Qs(c)&&(i[u]=c)}),t[a]=void 0,i}}return r};return n(e,0)},g$=Lr("AsyncFunction"),h$=e=>e&&(of(e)||Xn(e))&&Xn(e.then)&&Xn(e.catch),jz=((e,t)=>e?setImmediate:t?((n,r)=>(ti.addEventListener("message",({source:a,data:i})=>{a===ti&&i===n&&r.length&&r.shift()()},!1),a=>{r.push(a),ti.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",Xn(ti.postMessage)),m$=typeof queueMicrotask<"u"?queueMicrotask.bind(ti):typeof process<"u"&&process.nextTick||jz,pe={isArray:Al,isArrayBuffer:Mz,isBuffer:I9,isFormData:G9,isArrayBufferView:L9,isString:M9,isNumber:Fz,isBoolean:F9,isObject:of,isPlainObject:fd,isReadableStream:$9,isRequest:q9,isResponse:V9,isHeaders:W9,isUndefined:Qs,isDate:z9,isFile:P9,isBlob:B9,isRegExp:i$,isFunction:Xn,isStream:j9,isURLSearchParams:H9,isTypedArray:t$,isFileList:U9,forEach:du,merge:hx,extend:K9,trim:Y9,stripBOM:X9,inherits:Z9,toFlatObject:Q9,kindOf:rf,kindOfTest:Lr,endsWith:J9,toArray:e$,forEachEntry:n$,matchAll:r$,isHTMLForm:a$,hasOwnProperty:cR,hasOwnProp:cR,reduceDescriptors:Bz,freezeMethods:l$,toObjectSet:s$,toCamelCase:o$,noop:u$,toFiniteNumber:c$,findKey:zz,global:ti,isContextDefined:Pz,ALPHABET:Uz,generateString:d$,isSpecCompliantForm:f$,toJSONObject:p$,isAsyncFn:g$,isThenable:h$,setImmediate:jz,asap:m$};function nt(e,t,n,r,a){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),a&&(this.response=a,this.status=a.status?a.status:null)}pe.inherits(nt,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:pe.toJSONObject(this.config),code:this.code,status:this.status}}});const Gz=nt.prototype,Hz={};["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=>{Hz[e]={value:e}});Object.defineProperties(nt,Hz);Object.defineProperty(Gz,"isAxiosError",{value:!0});nt.from=(e,t,n,r,a,i)=>{const l=Object.create(Gz);return pe.toFlatObject(e,l,function(c){return c!==Error.prototype},u=>u!=="isAxiosError"),nt.call(l,e.message,t,n,r,a),l.cause=e,l.name=e.name,i&&Object.assign(l,i),l};const b$=null;function mx(e){return pe.isPlainObject(e)||pe.isArray(e)}function $z(e){return pe.endsWith(e,"[]")?e.slice(0,-2):e}function fR(e,t,n){return e?e.concat(t).map(function(a,i){return a=$z(a),!n&&i?"["+a+"]":a}).join(n?".":""):t}function y$(e){return pe.isArray(e)&&!e.some(mx)}const v$=pe.toFlatObject(pe,{},null,function(t){return/^is[A-Z]/.test(t)});function lf(e,t,n){if(!pe.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,n=pe.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(v,A){return!pe.isUndefined(A[v])});const r=n.metaTokens,a=n.visitor||p,i=n.dots,l=n.indexes,c=(n.Blob||typeof Blob<"u"&&Blob)&&pe.isSpecCompliantForm(t);if(!pe.isFunction(a))throw new TypeError("visitor must be a function");function f(S){if(S===null)return"";if(pe.isDate(S))return S.toISOString();if(!c&&pe.isBlob(S))throw new nt("Blob is not supported. Use a Buffer instead.");return pe.isArrayBuffer(S)||pe.isTypedArray(S)?c&&typeof Blob=="function"?new Blob([S]):Buffer.from(S):S}function p(S,v,A){let R=S;if(S&&!A&&typeof S=="object"){if(pe.endsWith(v,"{}"))v=r?v:v.slice(0,-2),S=JSON.stringify(S);else if(pe.isArray(S)&&y$(S)||(pe.isFileList(S)||pe.endsWith(v,"[]"))&&(R=pe.toArray(S)))return v=$z(v),R.forEach(function(_,C){!(pe.isUndefined(_)||_===null)&&t.append(l===!0?fR([v],C,i):l===null?v:v+"[]",f(_))}),!1}return mx(S)?!0:(t.append(fR(A,v,i),f(S)),!1)}const g=[],b=Object.assign(v$,{defaultVisitor:p,convertValue:f,isVisitable:mx});function m(S,v){if(!pe.isUndefined(S)){if(g.indexOf(S)!==-1)throw Error("Circular reference detected in "+v.join("."));g.push(S),pe.forEach(S,function(R,x){(!(pe.isUndefined(R)||R===null)&&a.call(t,R,pe.isString(x)?x.trim():x,v,b))===!0&&m(R,v?v.concat(x):[x])}),g.pop()}}if(!pe.isObject(e))throw new TypeError("data must be an object");return m(e),t}function pR(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(r){return t[r]})}function _k(e,t){this._pairs=[],e&&lf(e,this,t)}const qz=_k.prototype;qz.append=function(t,n){this._pairs.push([t,n])};qz.toString=function(t){const n=t?function(r){return t.call(this,r,pR)}:pR;return this._pairs.map(function(a){return n(a[0])+"="+n(a[1])},"").join("&")};function S$(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Vz(e,t,n){if(!t)return e;const r=n&&n.encode||S$;pe.isFunction(n)&&(n={serialize:n});const a=n&&n.serialize;let i;if(a?i=a(t,n):i=pe.isURLSearchParams(t)?t.toString():new _k(t,n).toString(r),i){const l=e.indexOf("#");l!==-1&&(e=e.slice(0,l)),e+=(e.indexOf("?")===-1?"?":"&")+i}return e}class gR{constructor(){this.handlers=[]}use(t,n,r){return this.handlers.push({fulfilled:t,rejected:n,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){pe.forEach(this.handlers,function(r){r!==null&&t(r)})}}const Wz={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},E$=typeof URLSearchParams<"u"?URLSearchParams:_k,w$=typeof FormData<"u"?FormData:null,x$=typeof Blob<"u"?Blob:null,k$={isBrowser:!0,classes:{URLSearchParams:E$,FormData:w$,Blob:x$},protocols:["http","https","file","blob","url","data"]},Rk=typeof window<"u"&&typeof document<"u",bx=typeof navigator=="object"&&navigator||void 0,A$=Rk&&(!bx||["ReactNative","NativeScript","NS"].indexOf(bx.product)<0),T$=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",_$=Rk&&window.location.href||"http://localhost",R$=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:Rk,hasStandardBrowserEnv:A$,hasStandardBrowserWebWorkerEnv:T$,navigator:bx,origin:_$},Symbol.toStringTag,{value:"Module"})),yn={...R$,...k$};function C$(e,t){return lf(e,new yn.classes.URLSearchParams,Object.assign({visitor:function(n,r,a,i){return yn.isNode&&pe.isBuffer(n)?(this.append(r,n.toString("base64")),!1):i.defaultVisitor.apply(this,arguments)}},t))}function N$(e){return pe.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function O$(e){const t={},n=Object.keys(e);let r;const a=n.length;let i;for(r=0;r=n.length;return l=!l&&pe.isArray(a)?a.length:l,c?(pe.hasOwnProp(a,l)?a[l]=[a[l],r]:a[l]=r,!u):((!a[l]||!pe.isObject(a[l]))&&(a[l]=[]),t(n,r,a[l],i)&&pe.isArray(a[l])&&(a[l]=O$(a[l])),!u)}if(pe.isFormData(e)&&pe.isFunction(e.entries)){const n={};return pe.forEachEntry(e,(r,a)=>{t(N$(r),a,n,0)}),n}return null}function D$(e,t,n){if(pe.isString(e))try{return(t||JSON.parse)(e),pe.trim(e)}catch(r){if(r.name!=="SyntaxError")throw r}return(n||JSON.stringify)(e)}const fu={transitional:Wz,adapter:["xhr","http","fetch"],transformRequest:[function(t,n){const r=n.getContentType()||"",a=r.indexOf("application/json")>-1,i=pe.isObject(t);if(i&&pe.isHTMLForm(t)&&(t=new FormData(t)),pe.isFormData(t))return a?JSON.stringify(Yz(t)):t;if(pe.isArrayBuffer(t)||pe.isBuffer(t)||pe.isStream(t)||pe.isFile(t)||pe.isBlob(t)||pe.isReadableStream(t))return t;if(pe.isArrayBufferView(t))return t.buffer;if(pe.isURLSearchParams(t))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let u;if(i){if(r.indexOf("application/x-www-form-urlencoded")>-1)return C$(t,this.formSerializer).toString();if((u=pe.isFileList(t))||r.indexOf("multipart/form-data")>-1){const c=this.env&&this.env.FormData;return lf(u?{"files[]":t}:t,c&&new c,this.formSerializer)}}return i||a?(n.setContentType("application/json",!1),D$(t)):t}],transformResponse:[function(t){const n=this.transitional||fu.transitional,r=n&&n.forcedJSONParsing,a=this.responseType==="json";if(pe.isResponse(t)||pe.isReadableStream(t))return t;if(t&&pe.isString(t)&&(r&&!this.responseType||a)){const l=!(n&&n.silentJSONParsing)&&a;try{return JSON.parse(t)}catch(u){if(l)throw u.name==="SyntaxError"?nt.from(u,nt.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:yn.classes.FormData,Blob:yn.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};pe.forEach(["delete","get","head","post","put","patch"],e=>{fu.headers[e]={}});const I$=pe.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"]),L$=e=>{const t={};let n,r,a;return e&&e.split(` +`).forEach(function(l){a=l.indexOf(":"),n=l.substring(0,a).trim().toLowerCase(),r=l.substring(a+1).trim(),!(!n||t[n]&&I$[n])&&(n==="set-cookie"?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)}),t},hR=Symbol("internals");function Ls(e){return e&&String(e).trim().toLowerCase()}function pd(e){return e===!1||e==null?e:pe.isArray(e)?e.map(pd):String(e)}function M$(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}const F$=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function ch(e,t,n,r,a){if(pe.isFunction(r))return r.call(this,t,n);if(a&&(t=n),!!pe.isString(t)){if(pe.isString(r))return t.indexOf(r)!==-1;if(pe.isRegExp(r))return r.test(t)}}function z$(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,r)=>n.toUpperCase()+r)}function P$(e,t){const n=pe.toCamelCase(" "+t);["get","set","has"].forEach(r=>{Object.defineProperty(e,r+n,{value:function(a,i,l){return this[r].call(this,t,a,i,l)},configurable:!0})})}let zn=class{constructor(t){t&&this.set(t)}set(t,n,r){const a=this;function i(u,c,f){const p=Ls(c);if(!p)throw new Error("header name must be a non-empty string");const g=pe.findKey(a,p);(!g||a[g]===void 0||f===!0||f===void 0&&a[g]!==!1)&&(a[g||c]=pd(u))}const l=(u,c)=>pe.forEach(u,(f,p)=>i(f,p,c));if(pe.isPlainObject(t)||t instanceof this.constructor)l(t,n);else if(pe.isString(t)&&(t=t.trim())&&!F$(t))l(L$(t),n);else if(pe.isHeaders(t))for(const[u,c]of t.entries())i(c,u,r);else t!=null&&i(n,t,r);return this}get(t,n){if(t=Ls(t),t){const r=pe.findKey(this,t);if(r){const a=this[r];if(!n)return a;if(n===!0)return M$(a);if(pe.isFunction(n))return n.call(this,a,r);if(pe.isRegExp(n))return n.exec(a);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,n){if(t=Ls(t),t){const r=pe.findKey(this,t);return!!(r&&this[r]!==void 0&&(!n||ch(this,this[r],r,n)))}return!1}delete(t,n){const r=this;let a=!1;function i(l){if(l=Ls(l),l){const u=pe.findKey(r,l);u&&(!n||ch(r,r[u],u,n))&&(delete r[u],a=!0)}}return pe.isArray(t)?t.forEach(i):i(t),a}clear(t){const n=Object.keys(this);let r=n.length,a=!1;for(;r--;){const i=n[r];(!t||ch(this,this[i],i,t,!0))&&(delete this[i],a=!0)}return a}normalize(t){const n=this,r={};return pe.forEach(this,(a,i)=>{const l=pe.findKey(r,i);if(l){n[l]=pd(a),delete n[i];return}const u=t?z$(i):String(i).trim();u!==i&&delete n[i],n[u]=pd(a),r[u]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const n=Object.create(null);return pe.forEach(this,(r,a)=>{r!=null&&r!==!1&&(n[a]=t&&pe.isArray(r)?r.join(", "):r)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,n])=>t+": "+n).join(` +`)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...n){const r=new this(t);return n.forEach(a=>r.set(a)),r}static accessor(t){const r=(this[hR]=this[hR]={accessors:{}}).accessors,a=this.prototype;function i(l){const u=Ls(l);r[u]||(P$(a,l),r[u]=!0)}return pe.isArray(t)?t.forEach(i):i(t),this}};zn.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);pe.reduceDescriptors(zn.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(r){this[n]=r}}});pe.freezeMethods(zn);function dh(e,t){const n=this||fu,r=t||n,a=zn.from(r.headers);let i=r.data;return pe.forEach(e,function(u){i=u.call(n,i,a.normalize(),t?t.status:void 0)}),a.normalize(),i}function Kz(e){return!!(e&&e.__CANCEL__)}function Tl(e,t,n){nt.call(this,e??"canceled",nt.ERR_CANCELED,t,n),this.name="CanceledError"}pe.inherits(Tl,nt,{__CANCEL__:!0});function Xz(e,t,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new nt("Request failed with status code "+n.status,[nt.ERR_BAD_REQUEST,nt.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function B$(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function U$(e,t){e=e||10;const n=new Array(e),r=new Array(e);let a=0,i=0,l;return t=t!==void 0?t:1e3,function(c){const f=Date.now(),p=r[i];l||(l=f),n[a]=c,r[a]=f;let g=i,b=0;for(;g!==a;)b+=n[g++],g=g%e;if(a=(a+1)%e,a===i&&(i=(i+1)%e),f-l{n=p,a=null,i&&(clearTimeout(i),i=null),e.apply(null,f)};return[(...f)=>{const p=Date.now(),g=p-n;g>=r?l(f,p):(a=f,i||(i=setTimeout(()=>{i=null,l(a)},r-g)))},()=>a&&l(a)]}const Nd=(e,t,n=3)=>{let r=0;const a=U$(50,250);return j$(i=>{const l=i.loaded,u=i.lengthComputable?i.total:void 0,c=l-r,f=a(c),p=l<=u;r=l;const g={loaded:l,total:u,progress:u?l/u:void 0,bytes:c,rate:f||void 0,estimated:f&&u&&p?(u-l)/f:void 0,event:i,lengthComputable:u!=null,[t?"download":"upload"]:!0};e(g)},n)},mR=(e,t)=>{const n=e!=null;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},bR=e=>(...t)=>pe.asap(()=>e(...t)),G$=yn.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,yn.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(yn.origin),yn.navigator&&/(msie|trident)/i.test(yn.navigator.userAgent)):()=>!0,H$=yn.hasStandardBrowserEnv?{write(e,t,n,r,a,i){const l=[e+"="+encodeURIComponent(t)];pe.isNumber(n)&&l.push("expires="+new Date(n).toGMTString()),pe.isString(r)&&l.push("path="+r),pe.isString(a)&&l.push("domain="+a),i===!0&&l.push("secure"),document.cookie=l.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function $$(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function q$(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function Zz(e,t){return e&&!$$(t)?q$(e,t):t}const yR=e=>e instanceof zn?{...e}:e;function ri(e,t){t=t||{};const n={};function r(f,p,g,b){return pe.isPlainObject(f)&&pe.isPlainObject(p)?pe.merge.call({caseless:b},f,p):pe.isPlainObject(p)?pe.merge({},p):pe.isArray(p)?p.slice():p}function a(f,p,g,b){if(pe.isUndefined(p)){if(!pe.isUndefined(f))return r(void 0,f,g,b)}else return r(f,p,g,b)}function i(f,p){if(!pe.isUndefined(p))return r(void 0,p)}function l(f,p){if(pe.isUndefined(p)){if(!pe.isUndefined(f))return r(void 0,f)}else return r(void 0,p)}function u(f,p,g){if(g in t)return r(f,p);if(g in e)return r(void 0,f)}const c={url:i,method:i,data:i,baseURL:l,transformRequest:l,transformResponse:l,paramsSerializer:l,timeout:l,timeoutMessage:l,withCredentials:l,withXSRFToken:l,adapter:l,responseType:l,xsrfCookieName:l,xsrfHeaderName:l,onUploadProgress:l,onDownloadProgress:l,decompress:l,maxContentLength:l,maxBodyLength:l,beforeRedirect:l,transport:l,httpAgent:l,httpsAgent:l,cancelToken:l,socketPath:l,responseEncoding:l,validateStatus:u,headers:(f,p,g)=>a(yR(f),yR(p),g,!0)};return pe.forEach(Object.keys(Object.assign({},e,t)),function(p){const g=c[p]||a,b=g(e[p],t[p],p);pe.isUndefined(b)&&g!==u||(n[p]=b)}),n}const Qz=e=>{const t=ri({},e);let{data:n,withXSRFToken:r,xsrfHeaderName:a,xsrfCookieName:i,headers:l,auth:u}=t;t.headers=l=zn.from(l),t.url=Vz(Zz(t.baseURL,t.url),e.params,e.paramsSerializer),u&&l.set("Authorization","Basic "+btoa((u.username||"")+":"+(u.password?unescape(encodeURIComponent(u.password)):"")));let c;if(pe.isFormData(n)){if(yn.hasStandardBrowserEnv||yn.hasStandardBrowserWebWorkerEnv)l.setContentType(void 0);else if((c=l.getContentType())!==!1){const[f,...p]=c?c.split(";").map(g=>g.trim()).filter(Boolean):[];l.setContentType([f||"multipart/form-data",...p].join("; "))}}if(yn.hasStandardBrowserEnv&&(r&&pe.isFunction(r)&&(r=r(t)),r||r!==!1&&G$(t.url))){const f=a&&i&&H$.read(i);f&&l.set(a,f)}return t},V$=typeof XMLHttpRequest<"u",W$=V$&&function(e){return new Promise(function(n,r){const a=Qz(e);let i=a.data;const l=zn.from(a.headers).normalize();let{responseType:u,onUploadProgress:c,onDownloadProgress:f}=a,p,g,b,m,S;function v(){m&&m(),S&&S(),a.cancelToken&&a.cancelToken.unsubscribe(p),a.signal&&a.signal.removeEventListener("abort",p)}let A=new XMLHttpRequest;A.open(a.method.toUpperCase(),a.url,!0),A.timeout=a.timeout;function R(){if(!A)return;const _=zn.from("getAllResponseHeaders"in A&&A.getAllResponseHeaders()),N={data:!u||u==="text"||u==="json"?A.responseText:A.response,status:A.status,statusText:A.statusText,headers:_,config:e,request:A};Xz(function(O){n(O),v()},function(O){r(O),v()},N),A=null}"onloadend"in A?A.onloadend=R:A.onreadystatechange=function(){!A||A.readyState!==4||A.status===0&&!(A.responseURL&&A.responseURL.indexOf("file:")===0)||setTimeout(R)},A.onabort=function(){A&&(r(new nt("Request aborted",nt.ECONNABORTED,e,A)),A=null)},A.onerror=function(){r(new nt("Network Error",nt.ERR_NETWORK,e,A)),A=null},A.ontimeout=function(){let C=a.timeout?"timeout of "+a.timeout+"ms exceeded":"timeout exceeded";const N=a.transitional||Wz;a.timeoutErrorMessage&&(C=a.timeoutErrorMessage),r(new nt(C,N.clarifyTimeoutError?nt.ETIMEDOUT:nt.ECONNABORTED,e,A)),A=null},i===void 0&&l.setContentType(null),"setRequestHeader"in A&&pe.forEach(l.toJSON(),function(C,N){A.setRequestHeader(N,C)}),pe.isUndefined(a.withCredentials)||(A.withCredentials=!!a.withCredentials),u&&u!=="json"&&(A.responseType=a.responseType),f&&([b,S]=Nd(f,!0),A.addEventListener("progress",b)),c&&A.upload&&([g,m]=Nd(c),A.upload.addEventListener("progress",g),A.upload.addEventListener("loadend",m)),(a.cancelToken||a.signal)&&(p=_=>{A&&(r(!_||_.type?new Tl(null,e,A):_),A.abort(),A=null)},a.cancelToken&&a.cancelToken.subscribe(p),a.signal&&(a.signal.aborted?p():a.signal.addEventListener("abort",p)));const x=B$(a.url);if(x&&yn.protocols.indexOf(x)===-1){r(new nt("Unsupported protocol "+x+":",nt.ERR_BAD_REQUEST,e));return}A.send(i||null)})},Y$=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let r=new AbortController,a;const i=function(f){if(!a){a=!0,u();const p=f instanceof Error?f:this.reason;r.abort(p instanceof nt?p:new Tl(p instanceof Error?p.message:p))}};let l=t&&setTimeout(()=>{l=null,i(new nt(`timeout ${t} of ms exceeded`,nt.ETIMEDOUT))},t);const u=()=>{e&&(l&&clearTimeout(l),l=null,e.forEach(f=>{f.unsubscribe?f.unsubscribe(i):f.removeEventListener("abort",i)}),e=null)};e.forEach(f=>f.addEventListener("abort",i));const{signal:c}=r;return c.unsubscribe=()=>pe.asap(u),c}},K$=function*(e,t){let n=e.byteLength;if(n{const a=X$(e,t);let i=0,l,u=c=>{l||(l=!0,r&&r(c))};return new ReadableStream({async pull(c){try{const{done:f,value:p}=await a.next();if(f){u(),c.close();return}let g=p.byteLength;if(n){let b=i+=g;n(b)}c.enqueue(new Uint8Array(p))}catch(f){throw u(f),f}},cancel(c){return u(c),a.return()}},{highWaterMark:2})},sf=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",Jz=sf&&typeof ReadableStream=="function",Q$=sf&&(typeof TextEncoder=="function"?(e=>t=>e.encode(t))(new TextEncoder):async e=>new Uint8Array(await new Response(e).arrayBuffer())),eP=(e,...t)=>{try{return!!e(...t)}catch{return!1}},J$=Jz&&eP(()=>{let e=!1;const t=new Request(yn.origin,{body:new ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t}),SR=64*1024,yx=Jz&&eP(()=>pe.isReadableStream(new Response("").body)),Od={stream:yx&&(e=>e.body)};sf&&(e=>{["text","arrayBuffer","blob","formData","stream"].forEach(t=>{!Od[t]&&(Od[t]=pe.isFunction(e[t])?n=>n[t]():(n,r)=>{throw new nt(`Response type '${t}' is not supported`,nt.ERR_NOT_SUPPORT,r)})})})(new Response);const eq=async e=>{if(e==null)return 0;if(pe.isBlob(e))return e.size;if(pe.isSpecCompliantForm(e))return(await new Request(yn.origin,{method:"POST",body:e}).arrayBuffer()).byteLength;if(pe.isArrayBufferView(e)||pe.isArrayBuffer(e))return e.byteLength;if(pe.isURLSearchParams(e)&&(e=e+""),pe.isString(e))return(await Q$(e)).byteLength},tq=async(e,t)=>{const n=pe.toFiniteNumber(e.getContentLength());return n??eq(t)},nq=sf&&(async e=>{let{url:t,method:n,data:r,signal:a,cancelToken:i,timeout:l,onDownloadProgress:u,onUploadProgress:c,responseType:f,headers:p,withCredentials:g="same-origin",fetchOptions:b}=Qz(e);f=f?(f+"").toLowerCase():"text";let m=Y$([a,i&&i.toAbortSignal()],l),S;const v=m&&m.unsubscribe&&(()=>{m.unsubscribe()});let A;try{if(c&&J$&&n!=="get"&&n!=="head"&&(A=await tq(p,r))!==0){let N=new Request(t,{method:"POST",body:r,duplex:"half"}),T;if(pe.isFormData(r)&&(T=N.headers.get("content-type"))&&p.setContentType(T),N.body){const[O,z]=mR(A,Nd(bR(c)));r=vR(N.body,SR,O,z)}}pe.isString(g)||(g=g?"include":"omit");const R="credentials"in Request.prototype;S=new Request(t,{...b,signal:m,method:n.toUpperCase(),headers:p.normalize().toJSON(),body:r,duplex:"half",credentials:R?g:void 0});let x=await fetch(S);const _=yx&&(f==="stream"||f==="response");if(yx&&(u||_&&v)){const N={};["status","statusText","headers"].forEach(I=>{N[I]=x[I]});const T=pe.toFiniteNumber(x.headers.get("content-length")),[O,z]=u&&mR(T,Nd(bR(u),!0))||[];x=new Response(vR(x.body,SR,O,()=>{z&&z(),v&&v()}),N)}f=f||"text";let C=await Od[pe.findKey(Od,f)||"text"](x,e);return!_&&v&&v(),await new Promise((N,T)=>{Xz(N,T,{data:C,headers:zn.from(x.headers),status:x.status,statusText:x.statusText,config:e,request:S})})}catch(R){throw v&&v(),R&&R.name==="TypeError"&&/fetch/i.test(R.message)?Object.assign(new nt("Network Error",nt.ERR_NETWORK,e,S),{cause:R.cause||R}):nt.from(R,R&&R.code,e,S)}}),vx={http:b$,xhr:W$,fetch:nq};pe.forEach(vx,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const ER=e=>`- ${e}`,rq=e=>pe.isFunction(e)||e===null||e===!1,tP={getAdapter:e=>{e=pe.isArray(e)?e:[e];const{length:t}=e;let n,r;const a={};for(let i=0;i`adapter ${u} `+(c===!1?"is not supported by the environment":"is not available in the build"));let l=t?i.length>1?`since : +`+i.map(ER).join(` +`):" "+ER(i[0]):"as no adapter specified";throw new nt("There is no suitable adapter to dispatch the request "+l,"ERR_NOT_SUPPORT")}return r},adapters:vx};function fh(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Tl(null,e)}function wR(e){return fh(e),e.headers=zn.from(e.headers),e.data=dh.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),tP.getAdapter(e.adapter||fu.adapter)(e).then(function(r){return fh(e),r.data=dh.call(e,e.transformResponse,r),r.headers=zn.from(r.headers),r},function(r){return Kz(r)||(fh(e),r&&r.response&&(r.response.data=dh.call(e,e.transformResponse,r.response),r.response.headers=zn.from(r.response.headers))),Promise.reject(r)})}const nP="1.7.9",uf={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{uf[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const xR={};uf.transitional=function(t,n,r){function a(i,l){return"[Axios v"+nP+"] Transitional option '"+i+"'"+l+(r?". "+r:"")}return(i,l,u)=>{if(t===!1)throw new nt(a(l," has been removed"+(n?" in "+n:"")),nt.ERR_DEPRECATED);return n&&!xR[l]&&(xR[l]=!0,console.warn(a(l," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(i,l,u):!0}};uf.spelling=function(t){return(n,r)=>(console.warn(`${r} is likely a misspelling of ${t}`),!0)};function aq(e,t,n){if(typeof e!="object")throw new nt("options must be an object",nt.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let a=r.length;for(;a-- >0;){const i=r[a],l=t[i];if(l){const u=e[i],c=u===void 0||l(u,i,e);if(c!==!0)throw new nt("option "+i+" must be "+c,nt.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new nt("Unknown option "+i,nt.ERR_BAD_OPTION)}}const gd={assertOptions:aq,validators:uf},Hr=gd.validators;let ni=class{constructor(t){this.defaults=t,this.interceptors={request:new gR,response:new gR}}async request(t,n){try{return await this._request(t,n)}catch(r){if(r instanceof Error){let a={};Error.captureStackTrace?Error.captureStackTrace(a):a=new Error;const i=a.stack?a.stack.replace(/^.+\n/,""):"";try{r.stack?i&&!String(r.stack).endsWith(i.replace(/^.+\n.+\n/,""))&&(r.stack+=` +`+i):r.stack=i}catch{}}throw r}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=ri(this.defaults,n);const{transitional:r,paramsSerializer:a,headers:i}=n;r!==void 0&&gd.assertOptions(r,{silentJSONParsing:Hr.transitional(Hr.boolean),forcedJSONParsing:Hr.transitional(Hr.boolean),clarifyTimeoutError:Hr.transitional(Hr.boolean)},!1),a!=null&&(pe.isFunction(a)?n.paramsSerializer={serialize:a}:gd.assertOptions(a,{encode:Hr.function,serialize:Hr.function},!0)),gd.assertOptions(n,{baseUrl:Hr.spelling("baseURL"),withXsrfToken:Hr.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let l=i&&pe.merge(i.common,i[n.method]);i&&pe.forEach(["delete","get","head","post","put","patch","common"],S=>{delete i[S]}),n.headers=zn.concat(l,i);const u=[];let c=!0;this.interceptors.request.forEach(function(v){typeof v.runWhen=="function"&&v.runWhen(n)===!1||(c=c&&v.synchronous,u.unshift(v.fulfilled,v.rejected))});const f=[];this.interceptors.response.forEach(function(v){f.push(v.fulfilled,v.rejected)});let p,g=0,b;if(!c){const S=[wR.bind(this),void 0];for(S.unshift.apply(S,u),S.push.apply(S,f),b=S.length,p=Promise.resolve(n);g{if(!r._listeners)return;let i=r._listeners.length;for(;i-- >0;)r._listeners[i](a);r._listeners=null}),this.promise.then=a=>{let i;const l=new Promise(u=>{r.subscribe(u),i=u}).then(a);return l.cancel=function(){r.unsubscribe(i)},l},t(function(i,l,u){r.reason||(r.reason=new Tl(i,l,u),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const t=new AbortController,n=r=>{t.abort(r)};return this.subscribe(n),t.signal.unsubscribe=()=>this.unsubscribe(n),t.signal}static source(){let t;return{token:new rP(function(a){t=a}),cancel:t}}};function iq(e){return function(n){return e.apply(null,n)}}function lq(e){return pe.isObject(e)&&e.isAxiosError===!0}const Sx={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(Sx).forEach(([e,t])=>{Sx[t]=e});function aP(e){const t=new ni(e),n=Lz(ni.prototype.request,t);return pe.extend(n,ni.prototype,t,{allOwnKeys:!0}),pe.extend(n,t,null,{allOwnKeys:!0}),n.create=function(a){return aP(ri(e,a))},n}const $t=aP(fu);$t.Axios=ni;$t.CanceledError=Tl;$t.CancelToken=oq;$t.isCancel=Kz;$t.VERSION=nP;$t.toFormData=lf;$t.AxiosError=nt;$t.Cancel=$t.CanceledError;$t.all=function(t){return Promise.all(t)};$t.spread=iq;$t.isAxiosError=lq;$t.mergeConfig=ri;$t.AxiosHeaders=zn;$t.formToJSON=e=>Yz(pe.isHTMLForm(e)?new FormData(e):e);$t.getAdapter=tP.getAdapter;$t.HttpStatusCode=Sx;$t.default=$t;const{Axios:Fye,AxiosError:zye,CanceledError:Pye,isCancel:Bye,CancelToken:Uye,VERSION:jye,all:Gye,Cancel:Hye,isAxiosError:$ye,spread:qye,toFormData:Vye,AxiosHeaders:Wye,HttpStatusCode:Yye,formToJSON:Kye,getAdapter:Xye,mergeConfig:Zye}=$t,oP="Invalid API Key",iP="API Key required",Mr=$t.create({baseURL:Rz,headers:{"Content-Type":"application/json"}});Mr.interceptors.request.use(e=>{const t=Ke.getState().apiKey;return t&&(e.headers["X-API-Key"]=t),e});Mr.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 sq=async(e,t)=>(await Mr.get(`/graphs?label=${e}&max_depth=${t}`)).data,uq=async()=>(await Mr.get("/graph/label/list")).data,cq=async()=>{try{return(await Mr.get("/health")).data}catch(e){return{status:"error",message:Nr(e)}}},dq=async()=>(await Mr.get("/documents")).data,fq=async()=>(await Mr.post("/documents/scan")).data,pq=async e=>(await Mr.post("/query",e)).data,gq=async(e,t,n)=>{try{let r="";if(await Mr.post("/query/stream",e,{responseType:"text",headers:{Accept:"application/x-ndjson"},transformResponse:[a=>{r+=a;const i=r.split(` +`);r=i.pop()||"";for(const l of i)if(l.trim())try{const u=JSON.parse(l);u.response?t(u.response):u.error&&n&&n(u.error)}catch(u){console.error("Error parsing stream chunk:",u),n&&n("Error parsing server response")}return a}]}).catch(a=>{n&&n(Nr(a))}),r.trim())try{const a=JSON.parse(r);a.response?t(a.response):a.error&&n&&n(a.error)}catch(a){console.error("Error parsing final chunk:",a),n&&n("Error parsing server response")}}catch(r){const a=Nr(r);console.error("Stream request failed:",a),n&&n(a)}},hq=async(e,t)=>{const n=new FormData;return n.append("file",e),(await Mr.post("/documents/upload",n,{headers:{"Content-Type":"multipart/form-data"},onUploadProgress:t!==void 0?a=>{const i=Math.round(a.loaded*100/a.total);t(i)}:void 0})).data},mq=async()=>(await Mr.delete("/documents")).data,bq=wk()(e=>({health:!0,message:null,messageTitle:null,lastCheckTime:Date.now(),status:null,check:async()=>{const t=await cq();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})}})),Pn=Ak(bq);/** + * @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 yq=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),lP=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim();/** + * @license lucide-react v0.475.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */var vq={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 Sq=k.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:a="",children:i,iconNode:l,...u},c)=>k.createElement("svg",{ref:c,...vq,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:lP("lucide",a),...u},[...l.map(([f,p])=>k.createElement(f,p)),...Array.isArray(i)?i:[i]]));/** + * @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 xt=(e,t)=>{const n=k.forwardRef(({className:r,...a},i)=>k.createElement(Sq,{ref:i,iconNode:t,className:lP(`lucide-${yq(e)}`,r),...a}));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 Eq=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Ck=xt("Check",Eq);/** + * @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 wq=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],Nk=xt("ChevronDown",wq);/** + * @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 xq=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],sP=xt("ChevronUp",xq);/** + * @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 kq=[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]],Aq=xt("ChevronsUpDown",kq);/** + * @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 Tq=[["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"}]],_q=xt("CircleAlert",Tq);/** + * @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 Rq=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],Cq=xt("Copy",Rq);/** + * @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 Nq=[["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"}]],uP=xt("Eraser",Nq);/** + * @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 Oq=[["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"}]],Dq=xt("FileText",Oq);/** + * @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 Iq=[["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"}]],Lq=xt("Files",Iq);/** + * @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 Mq=[["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"}]],Fq=xt("Fullscreen",Mq);/** + * @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 zq=[["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"}]],Pq=xt("Github",zq);/** + * @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 Bq=[["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"}]],Uq=xt("Grip",Bq);/** + * @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 jq=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],cP=xt("LoaderCircle",jq);/** + * @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 Gq=[["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"}]],Hq=xt("Loader",Gq);/** + * @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 $q=[["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"}]],qq=xt("Maximize",$q);/** + * @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 Vq=[["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"}]],Wq=xt("Minimize",Vq);/** + * @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 Yq=[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]],Kq=xt("Moon",Yq);/** + * @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 Xq=[["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"}]],Zq=xt("Pause",Xq);/** + * @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 Qq=[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]],Jq=xt("Play",Qq);/** + * @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 e8=[["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"}]],t8=xt("RefreshCw",e8);/** + * @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 n8=[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]],r8=xt("Search",n8);/** + * @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 a8=[["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"}]],o8=xt("Send",a8);/** + * @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 i8=[["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"}]],l8=xt("Settings",i8);/** + * @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 s8=[["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"}]],u8=xt("Sun",s8);/** + * @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 c8=[["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"}]],Ex=xt("Upload",c8);/** + * @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 d8=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],dP=xt("X",d8);/** + * @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 f8=[["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"}]],p8=xt("Zap",f8);/** + * @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 g8=[["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"}]],h8=xt("ZoomIn",g8);/** + * @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 m8=[["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"}]],b8=xt("ZoomOut",m8),y8=()=>{const e=Pn.use.health(),t=Pn.use.message(),n=Pn.use.messageTitle(),[r,a]=k.useState(!1);return k.useEffect(()=>{setTimeout(()=>{a(!0)},50)},[]),w.jsxs(Oz,{className:Me("bg-background/90 absolute top-12 left-1/2 flex w-auto max-w-lg -translate-x-1/2 transform items-center gap-4 shadow-md backdrop-blur-lg transition-all duration-500 ease-in-out",r?"translate-y-0 opacity-100":"-translate-y-20 opacity-0",!e&&"bg-red-700 text-white"),children:[!e&&w.jsx("div",{children:w.jsx(_q,{className:"size-4"})}),w.jsxs("div",{children:[w.jsx(Dz,{className:"font-bold",children:n}),w.jsx(Iz,{children:t})]})]})};function v8(e,t){const n=k.createContext(t),r=i=>{const{children:l,...u}=i,c=k.useMemo(()=>u,Object.values(u));return w.jsx(n.Provider,{value:c,children:l})};r.displayName=e+"Provider";function a(i){const l=k.useContext(n);if(l)return l;if(t!==void 0)return t;throw new Error(`\`${i}\` must be used within \`${e}\``)}return[r,a]}function mr(e,t=[]){let n=[];function r(i,l){const u=k.createContext(l),c=n.length;n=[...n,l];const f=g=>{var R;const{scope:b,children:m,...S}=g,v=((R=b==null?void 0:b[e])==null?void 0:R[c])||u,A=k.useMemo(()=>S,Object.values(S));return w.jsx(v.Provider,{value:A,children:m})};f.displayName=i+"Provider";function p(g,b){var v;const m=((v=b==null?void 0:b[e])==null?void 0:v[c])||u,S=k.useContext(m);if(S)return S;if(l!==void 0)return l;throw new Error(`\`${g}\` must be used within \`${i}\``)}return[f,p]}const a=()=>{const i=n.map(l=>k.createContext(l));return function(u){const c=(u==null?void 0:u[e])||i;return k.useMemo(()=>({[`__scope${e}`]:{...u,[e]:c}}),[u,c])}};return a.scopeName=e,[r,S8(a,...t)]}function S8(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(a=>({useScope:a(),scopeName:a.scopeName}));return function(i){const l=r.reduce((u,{useScope:c,scopeName:f})=>{const g=c(i)[`__scope${f}`];return{...u,...g}},{});return k.useMemo(()=>({[`__scope${t.scopeName}`]:l}),[l])}};return n.scopeName=t.scopeName,n}function kR(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function fP(...e){return t=>{let n=!1;const r=e.map(a=>{const i=kR(a,t);return!n&&typeof i=="function"&&(n=!0),i});if(n)return()=>{for(let a=0;a{},E8=bH.useId||(()=>{}),w8=0;function En(e){const[t,n]=k.useState(E8());return wn(()=>{n(r=>r??String(w8++))},[e]),t?`radix-${t}`:""}function pn(e){const t=k.useRef(e);return k.useEffect(()=>{t.current=e}),k.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function Oa({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,a]=x8({defaultProp:t,onChange:n}),i=e!==void 0,l=i?e:r,u=pn(n),c=k.useCallback(f=>{if(i){const g=typeof f=="function"?f(e):f;g!==e&&u(g)}else a(f)},[i,e,a,u]);return[l,c]}function x8({defaultProp:e,onChange:t}){const n=k.useState(e),[r]=n,a=k.useRef(r),i=pn(t);return k.useEffect(()=>{a.current!==r&&(i(r),a.current=r)},[r,a,i]),n}var pu=mz();const pP=an(pu);var bo=k.forwardRef((e,t)=>{const{children:n,...r}=e,a=k.Children.toArray(n),i=a.find(k8);if(i){const l=i.props.children,u=a.map(c=>c===i?k.Children.count(l)>1?k.Children.only(null):k.isValidElement(l)?l.props.children:null:c);return w.jsx(wx,{...r,ref:t,children:k.isValidElement(l)?k.cloneElement(l,void 0,u):null})}return w.jsx(wx,{...r,ref:t,children:n})});bo.displayName="Slot";var wx=k.forwardRef((e,t)=>{const{children:n,...r}=e;if(k.isValidElement(n)){const a=T8(n),i=A8(r,n.props);return n.type!==k.Fragment&&(i.ref=t?fP(t,a):a),k.cloneElement(n,i)}return k.Children.count(n)>1?k.Children.only(null):null});wx.displayName="SlotClone";var Ok=({children:e})=>w.jsx(w.Fragment,{children:e});function k8(e){return k.isValidElement(e)&&e.type===Ok}function A8(e,t){const n={...t};for(const r in t){const a=e[r],i=t[r];/^on[A-Z]/.test(r)?a&&i?n[r]=(...u)=>{i(...u),a(...u)}:a&&(n[r]=a):r==="style"?n[r]={...a,...i}:r==="className"&&(n[r]=[a,i].filter(Boolean).join(" "))}return{...e,...n}}function T8(e){var r,a;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(a=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:a.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var _8=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],Xe=_8.reduce((e,t)=>{const n=k.forwardRef((r,a)=>{const{asChild:i,...l}=r,u=i?bo:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),w.jsx(u,{...l,ref:a})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function R8(e,t){e&&pu.flushSync(()=>e.dispatchEvent(t))}function C8(e,t=globalThis==null?void 0:globalThis.document){const n=pn(e);k.useEffect(()=>{const r=a=>{a.key==="Escape"&&n(a)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var N8="DismissableLayer",xx="dismissableLayer.update",O8="dismissableLayer.pointerDownOutside",D8="dismissableLayer.focusOutside",AR,gP=k.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),gu=k.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:a,onFocusOutside:i,onInteractOutside:l,onDismiss:u,...c}=e,f=k.useContext(gP),[p,g]=k.useState(null),b=(p==null?void 0:p.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,m]=k.useState({}),S=ft(t,O=>g(O)),v=Array.from(f.layers),[A]=[...f.layersWithOutsidePointerEventsDisabled].slice(-1),R=v.indexOf(A),x=p?v.indexOf(p):-1,_=f.layersWithOutsidePointerEventsDisabled.size>0,C=x>=R,N=M8(O=>{const z=O.target,I=[...f.branches].some(M=>M.contains(z));!C||I||(a==null||a(O),l==null||l(O),O.defaultPrevented||u==null||u())},b),T=F8(O=>{const z=O.target;[...f.branches].some(M=>M.contains(z))||(i==null||i(O),l==null||l(O),O.defaultPrevented||u==null||u())},b);return C8(O=>{x===f.layers.size-1&&(r==null||r(O),!O.defaultPrevented&&u&&(O.preventDefault(),u()))},b),k.useEffect(()=>{if(p)return n&&(f.layersWithOutsidePointerEventsDisabled.size===0&&(AR=b.body.style.pointerEvents,b.body.style.pointerEvents="none"),f.layersWithOutsidePointerEventsDisabled.add(p)),f.layers.add(p),TR(),()=>{n&&f.layersWithOutsidePointerEventsDisabled.size===1&&(b.body.style.pointerEvents=AR)}},[p,b,n,f]),k.useEffect(()=>()=>{p&&(f.layers.delete(p),f.layersWithOutsidePointerEventsDisabled.delete(p),TR())},[p,f]),k.useEffect(()=>{const O=()=>m({});return document.addEventListener(xx,O),()=>document.removeEventListener(xx,O)},[]),w.jsx(Xe.div,{...c,ref:S,style:{pointerEvents:_?C?"auto":"none":void 0,...e.style},onFocusCapture:We(e.onFocusCapture,T.onFocusCapture),onBlurCapture:We(e.onBlurCapture,T.onBlurCapture),onPointerDownCapture:We(e.onPointerDownCapture,N.onPointerDownCapture)})});gu.displayName=N8;var I8="DismissableLayerBranch",L8=k.forwardRef((e,t)=>{const n=k.useContext(gP),r=k.useRef(null),a=ft(t,r);return k.useEffect(()=>{const i=r.current;if(i)return n.branches.add(i),()=>{n.branches.delete(i)}},[n.branches]),w.jsx(Xe.div,{...e,ref:a})});L8.displayName=I8;function M8(e,t=globalThis==null?void 0:globalThis.document){const n=pn(e),r=k.useRef(!1),a=k.useRef(()=>{});return k.useEffect(()=>{const i=u=>{if(u.target&&!r.current){let c=function(){hP(O8,n,f,{discrete:!0})};const f={originalEvent:u};u.pointerType==="touch"?(t.removeEventListener("click",a.current),a.current=c,t.addEventListener("click",a.current,{once:!0})):c()}else t.removeEventListener("click",a.current);r.current=!1},l=window.setTimeout(()=>{t.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(l),t.removeEventListener("pointerdown",i),t.removeEventListener("click",a.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function F8(e,t=globalThis==null?void 0:globalThis.document){const n=pn(e),r=k.useRef(!1);return k.useEffect(()=>{const a=i=>{i.target&&!r.current&&hP(D8,n,{originalEvent:i},{discrete:!1})};return t.addEventListener("focusin",a),()=>t.removeEventListener("focusin",a)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function TR(){const e=new CustomEvent(xx);document.dispatchEvent(e)}function hP(e,t,n,{discrete:r}){const a=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&a.addEventListener(e,t,{once:!0}),r?R8(a,i):a.dispatchEvent(i)}var ph="focusScope.autoFocusOnMount",gh="focusScope.autoFocusOnUnmount",_R={bubbles:!1,cancelable:!0},z8="FocusScope",cf=k.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:a,onUnmountAutoFocus:i,...l}=e,[u,c]=k.useState(null),f=pn(a),p=pn(i),g=k.useRef(null),b=ft(t,v=>c(v)),m=k.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;k.useEffect(()=>{if(r){let v=function(_){if(m.paused||!u)return;const C=_.target;u.contains(C)?g.current=C:co(g.current,{select:!0})},A=function(_){if(m.paused||!u)return;const C=_.relatedTarget;C!==null&&(u.contains(C)||co(g.current,{select:!0}))},R=function(_){if(document.activeElement===document.body)for(const N of _)N.removedNodes.length>0&&co(u)};document.addEventListener("focusin",v),document.addEventListener("focusout",A);const x=new MutationObserver(R);return u&&x.observe(u,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",v),document.removeEventListener("focusout",A),x.disconnect()}}},[r,u,m.paused]),k.useEffect(()=>{if(u){CR.add(m);const v=document.activeElement;if(!u.contains(v)){const R=new CustomEvent(ph,_R);u.addEventListener(ph,f),u.dispatchEvent(R),R.defaultPrevented||(P8(H8(mP(u)),{select:!0}),document.activeElement===v&&co(u))}return()=>{u.removeEventListener(ph,f),setTimeout(()=>{const R=new CustomEvent(gh,_R);u.addEventListener(gh,p),u.dispatchEvent(R),R.defaultPrevented||co(v??document.body,{select:!0}),u.removeEventListener(gh,p),CR.remove(m)},0)}}},[u,f,p,m]);const S=k.useCallback(v=>{if(!n&&!r||m.paused)return;const A=v.key==="Tab"&&!v.altKey&&!v.ctrlKey&&!v.metaKey,R=document.activeElement;if(A&&R){const x=v.currentTarget,[_,C]=B8(x);_&&C?!v.shiftKey&&R===C?(v.preventDefault(),n&&co(_,{select:!0})):v.shiftKey&&R===_&&(v.preventDefault(),n&&co(C,{select:!0})):R===x&&v.preventDefault()}},[n,r,m.paused]);return w.jsx(Xe.div,{tabIndex:-1,...l,ref:b,onKeyDown:S})});cf.displayName=z8;function P8(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(co(r,{select:t}),document.activeElement!==n)return}function B8(e){const t=mP(e),n=RR(t,e),r=RR(t.reverse(),e);return[n,r]}function mP(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const a=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||a?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function RR(e,t){for(const n of e)if(!U8(n,{upTo:t}))return n}function U8(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 j8(e){return e instanceof HTMLInputElement&&"select"in e}function co(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&j8(e)&&t&&e.select()}}var CR=G8();function G8(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=NR(e,t),e.unshift(t)},remove(t){var n;e=NR(e,t),(n=e[0])==null||n.resume()}}}function NR(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function H8(e){return e.filter(t=>t.tagName!=="A")}var $8="Portal",df=k.forwardRef((e,t)=>{var u;const{container:n,...r}=e,[a,i]=k.useState(!1);wn(()=>i(!0),[]);const l=n||a&&((u=globalThis==null?void 0:globalThis.document)==null?void 0:u.body);return l?pP.createPortal(w.jsx(Xe.div,{...r,ref:t}),l):null});df.displayName=$8;function q8(e,t){return k.useReducer((n,r)=>t[n][r]??n,e)}var Jn=e=>{const{present:t,children:n}=e,r=V8(t),a=typeof n=="function"?n({present:r.isPresent}):k.Children.only(n),i=ft(r.ref,W8(a));return typeof n=="function"||r.isPresent?k.cloneElement(a,{ref:i}):null};Jn.displayName="Presence";function V8(e){const[t,n]=k.useState(),r=k.useRef({}),a=k.useRef(e),i=k.useRef("none"),l=e?"mounted":"unmounted",[u,c]=q8(l,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return k.useEffect(()=>{const f=zc(r.current);i.current=u==="mounted"?f:"none"},[u]),wn(()=>{const f=r.current,p=a.current;if(p!==e){const b=i.current,m=zc(f);e?c("MOUNT"):m==="none"||(f==null?void 0:f.display)==="none"?c("UNMOUNT"):c(p&&b!==m?"ANIMATION_OUT":"UNMOUNT"),a.current=e}},[e,c]),wn(()=>{if(t){let f;const p=t.ownerDocument.defaultView??window,g=m=>{const v=zc(r.current).includes(m.animationName);if(m.target===t&&v&&(c("ANIMATION_END"),!a.current)){const A=t.style.animationFillMode;t.style.animationFillMode="forwards",f=p.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=A)})}},b=m=>{m.target===t&&(i.current=zc(r.current))};return t.addEventListener("animationstart",b),t.addEventListener("animationcancel",g),t.addEventListener("animationend",g),()=>{p.clearTimeout(f),t.removeEventListener("animationstart",b),t.removeEventListener("animationcancel",g),t.removeEventListener("animationend",g)}}else c("ANIMATION_END")},[t,c]),{isPresent:["mounted","unmountSuspended"].includes(u),ref:k.useCallback(f=>{f&&(r.current=getComputedStyle(f)),n(f)},[])}}function zc(e){return(e==null?void 0:e.animationName)||"none"}function W8(e){var r,a;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(a=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:a.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var hh=0;function Dk(){k.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??OR()),document.body.insertAdjacentElement("beforeend",e[1]??OR()),hh++,()=>{hh===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),hh--}},[])}function OR(){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 Vr=function(){return Vr=Object.assign||function(t){for(var n,r=1,a=arguments.length;r"u")return c7;var t=d7(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},p7=SP(),ul="data-scroll-locked",g7=function(e,t,n,r){var a=e.left,i=e.top,l=e.right,u=e.gap;return n===void 0&&(n="margin"),` + .`.concat(K8,` { + overflow: hidden `).concat(r,`; + padding-right: `).concat(u,"px ").concat(r,`; + } + body[`).concat(ul,`] { + overflow: hidden `).concat(r,`; + overscroll-behavior: contain; + `).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&` + padding-left: `.concat(a,`px; + padding-top: `).concat(i,`px; + padding-right: `).concat(l,`px; + margin-left:0; + margin-top:0; + margin-right: `).concat(u,"px ").concat(r,`; + `),n==="padding"&&"padding-right: ".concat(u,"px ").concat(r,";")].filter(Boolean).join(""),` + } + + .`).concat(hd,` { + right: `).concat(u,"px ").concat(r,`; + } + + .`).concat(md,` { + margin-right: `).concat(u,"px ").concat(r,`; + } + + .`).concat(hd," .").concat(hd,` { + right: 0 `).concat(r,`; + } + + .`).concat(md," .").concat(md,` { + margin-right: 0 `).concat(r,`; + } + + body[`).concat(ul,`] { + `).concat(X8,": ").concat(u,`px; + } +`)},IR=function(){var e=parseInt(document.body.getAttribute(ul)||"0",10);return isFinite(e)?e:0},h7=function(){k.useEffect(function(){return document.body.setAttribute(ul,(IR()+1).toString()),function(){var e=IR()-1;e<=0?document.body.removeAttribute(ul):document.body.setAttribute(ul,e.toString())}},[])},m7=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,a=r===void 0?"margin":r;h7();var i=k.useMemo(function(){return f7(a)},[a]);return k.createElement(p7,{styles:g7(i,!t,a,n?"":"!important")})},kx=!1;if(typeof window<"u")try{var Pc=Object.defineProperty({},"passive",{get:function(){return kx=!0,!0}});window.addEventListener("test",Pc,Pc),window.removeEventListener("test",Pc,Pc)}catch{kx=!1}var Ki=kx?{passive:!1}:!1,b7=function(e){return e.tagName==="TEXTAREA"},EP=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!b7(e)&&n[t]==="visible")},y7=function(e){return EP(e,"overflowY")},v7=function(e){return EP(e,"overflowX")},LR=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var a=wP(e,r);if(a){var i=xP(e,r),l=i[1],u=i[2];if(l>u)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},S7=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},E7=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},wP=function(e,t){return e==="v"?y7(t):v7(t)},xP=function(e,t){return e==="v"?S7(t):E7(t)},w7=function(e,t){return e==="h"&&t==="rtl"?-1:1},x7=function(e,t,n,r,a){var i=w7(e,window.getComputedStyle(t).direction),l=i*r,u=n.target,c=t.contains(u),f=!1,p=l>0,g=0,b=0;do{var m=xP(e,u),S=m[0],v=m[1],A=m[2],R=v-A-i*S;(S||R)&&wP(e,u)&&(g+=R,b+=S),u instanceof ShadowRoot?u=u.host:u=u.parentNode}while(!c&&u!==document.body||c&&(t.contains(u)||t===u));return(p&&Math.abs(g)<1||!p&&Math.abs(b)<1)&&(f=!0),f},Bc=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},MR=function(e){return[e.deltaX,e.deltaY]},FR=function(e){return e&&"current"in e?e.current:e},k7=function(e,t){return e[0]===t[0]&&e[1]===t[1]},A7=function(e){return` + .block-interactivity-`.concat(e,` {pointer-events: none;} + .allow-interactivity-`).concat(e,` {pointer-events: all;} +`)},T7=0,Xi=[];function _7(e){var t=k.useRef([]),n=k.useRef([0,0]),r=k.useRef(),a=k.useState(T7++)[0],i=k.useState(SP)[0],l=k.useRef(e);k.useEffect(function(){l.current=e},[e]),k.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(a));var v=Y8([e.lockRef.current],(e.shards||[]).map(FR),!0).filter(Boolean);return v.forEach(function(A){return A.classList.add("allow-interactivity-".concat(a))}),function(){document.body.classList.remove("block-interactivity-".concat(a)),v.forEach(function(A){return A.classList.remove("allow-interactivity-".concat(a))})}}},[e.inert,e.lockRef.current,e.shards]);var u=k.useCallback(function(v,A){if("touches"in v&&v.touches.length===2||v.type==="wheel"&&v.ctrlKey)return!l.current.allowPinchZoom;var R=Bc(v),x=n.current,_="deltaX"in v?v.deltaX:x[0]-R[0],C="deltaY"in v?v.deltaY:x[1]-R[1],N,T=v.target,O=Math.abs(_)>Math.abs(C)?"h":"v";if("touches"in v&&O==="h"&&T.type==="range")return!1;var z=LR(O,T);if(!z)return!0;if(z?N=O:(N=O==="v"?"h":"v",z=LR(O,T)),!z)return!1;if(!r.current&&"changedTouches"in v&&(_||C)&&(r.current=N),!N)return!0;var I=r.current||N;return x7(I,A,v,I==="h"?_:C)},[]),c=k.useCallback(function(v){var A=v;if(!(!Xi.length||Xi[Xi.length-1]!==i)){var R="deltaY"in A?MR(A):Bc(A),x=t.current.filter(function(N){return N.name===A.type&&(N.target===A.target||A.target===N.shadowParent)&&k7(N.delta,R)})[0];if(x&&x.should){A.cancelable&&A.preventDefault();return}if(!x){var _=(l.current.shards||[]).map(FR).filter(Boolean).filter(function(N){return N.contains(A.target)}),C=_.length>0?u(A,_[0]):!l.current.noIsolation;C&&A.cancelable&&A.preventDefault()}}},[]),f=k.useCallback(function(v,A,R,x){var _={name:v,delta:A,target:R,should:x,shadowParent:R7(R)};t.current.push(_),setTimeout(function(){t.current=t.current.filter(function(C){return C!==_})},1)},[]),p=k.useCallback(function(v){n.current=Bc(v),r.current=void 0},[]),g=k.useCallback(function(v){f(v.type,MR(v),v.target,u(v,e.lockRef.current))},[]),b=k.useCallback(function(v){f(v.type,Bc(v),v.target,u(v,e.lockRef.current))},[]);k.useEffect(function(){return Xi.push(i),e.setCallbacks({onScrollCapture:g,onWheelCapture:g,onTouchMoveCapture:b}),document.addEventListener("wheel",c,Ki),document.addEventListener("touchmove",c,Ki),document.addEventListener("touchstart",p,Ki),function(){Xi=Xi.filter(function(v){return v!==i}),document.removeEventListener("wheel",c,Ki),document.removeEventListener("touchmove",c,Ki),document.removeEventListener("touchstart",p,Ki)}},[]);var m=e.removeScrollBar,S=e.inert;return k.createElement(k.Fragment,null,S?k.createElement(i,{styles:A7(a)}):null,m?k.createElement(m7,{gapMode:e.gapMode}):null)}function R7(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const C7=r7(vP,_7);var pf=k.forwardRef(function(e,t){return k.createElement(ff,Vr({},e,{ref:t,sideCar:C7}))});pf.classNames=ff.classNames;var N7=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Zi=new WeakMap,Uc=new WeakMap,jc={},vh=0,kP=function(e){return e&&(e.host||kP(e.parentNode))},O7=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=kP(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},D7=function(e,t,n,r){var a=O7(t,Array.isArray(e)?e:[e]);jc[n]||(jc[n]=new WeakMap);var i=jc[n],l=[],u=new Set,c=new Set(a),f=function(g){!g||u.has(g)||(u.add(g),f(g.parentNode))};a.forEach(f);var p=function(g){!g||c.has(g)||Array.prototype.forEach.call(g.children,function(b){if(u.has(b))p(b);else try{var m=b.getAttribute(r),S=m!==null&&m!=="false",v=(Zi.get(b)||0)+1,A=(i.get(b)||0)+1;Zi.set(b,v),i.set(b,A),l.push(b),v===1&&S&&Uc.set(b,!0),A===1&&b.setAttribute(n,"true"),S||b.setAttribute(r,"true")}catch(R){console.error("aria-hidden: cannot operate on ",b,R)}})};return p(t),u.clear(),vh++,function(){l.forEach(function(g){var b=Zi.get(g)-1,m=i.get(g)-1;Zi.set(g,b),i.set(g,m),b||(Uc.has(g)||g.removeAttribute(r),Uc.delete(g)),m||g.removeAttribute(n)}),vh--,vh||(Zi=new WeakMap,Zi=new WeakMap,Uc=new WeakMap,jc={})}},Ik=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),a=N7(e);return a?(r.push.apply(r,Array.from(a.querySelectorAll("[aria-live]"))),D7(r,a,n,"aria-hidden")):function(){return null}},Lk="Dialog",[AP,TP]=mr(Lk),[I7,Fr]=AP(Lk),_P=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:a,onOpenChange:i,modal:l=!0}=e,u=k.useRef(null),c=k.useRef(null),[f=!1,p]=Oa({prop:r,defaultProp:a,onChange:i});return w.jsx(I7,{scope:t,triggerRef:u,contentRef:c,contentId:En(),titleId:En(),descriptionId:En(),open:f,onOpenChange:p,onOpenToggle:k.useCallback(()=>p(g=>!g),[p]),modal:l,children:n})};_P.displayName=Lk;var RP="DialogTrigger",CP=k.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,a=Fr(RP,n),i=ft(t,a.triggerRef);return w.jsx(Xe.button,{type:"button","aria-haspopup":"dialog","aria-expanded":a.open,"aria-controls":a.contentId,"data-state":zk(a.open),...r,ref:i,onClick:We(e.onClick,a.onOpenToggle)})});CP.displayName=RP;var Mk="DialogPortal",[L7,NP]=AP(Mk,{forceMount:void 0}),OP=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:a}=e,i=Fr(Mk,t);return w.jsx(L7,{scope:t,forceMount:n,children:k.Children.map(r,l=>w.jsx(Jn,{present:n||i.open,children:w.jsx(df,{asChild:!0,container:a,children:l})}))})};OP.displayName=Mk;var Dd="DialogOverlay",DP=k.forwardRef((e,t)=>{const n=NP(Dd,e.__scopeDialog),{forceMount:r=n.forceMount,...a}=e,i=Fr(Dd,e.__scopeDialog);return i.modal?w.jsx(Jn,{present:r||i.open,children:w.jsx(M7,{...a,ref:t})}):null});DP.displayName=Dd;var M7=k.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,a=Fr(Dd,n);return w.jsx(pf,{as:bo,allowPinchZoom:!0,shards:[a.contentRef],children:w.jsx(Xe.div,{"data-state":zk(a.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),ai="DialogContent",IP=k.forwardRef((e,t)=>{const n=NP(ai,e.__scopeDialog),{forceMount:r=n.forceMount,...a}=e,i=Fr(ai,e.__scopeDialog);return w.jsx(Jn,{present:r||i.open,children:i.modal?w.jsx(F7,{...a,ref:t}):w.jsx(z7,{...a,ref:t})})});IP.displayName=ai;var F7=k.forwardRef((e,t)=>{const n=Fr(ai,e.__scopeDialog),r=k.useRef(null),a=ft(t,n.contentRef,r);return k.useEffect(()=>{const i=r.current;if(i)return Ik(i)},[]),w.jsx(LP,{...e,ref:a,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:We(e.onCloseAutoFocus,i=>{var l;i.preventDefault(),(l=n.triggerRef.current)==null||l.focus()}),onPointerDownOutside:We(e.onPointerDownOutside,i=>{const l=i.detail.originalEvent,u=l.button===0&&l.ctrlKey===!0;(l.button===2||u)&&i.preventDefault()}),onFocusOutside:We(e.onFocusOutside,i=>i.preventDefault())})}),z7=k.forwardRef((e,t)=>{const n=Fr(ai,e.__scopeDialog),r=k.useRef(!1),a=k.useRef(!1);return w.jsx(LP,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var l,u;(l=e.onCloseAutoFocus)==null||l.call(e,i),i.defaultPrevented||(r.current||(u=n.triggerRef.current)==null||u.focus(),i.preventDefault()),r.current=!1,a.current=!1},onInteractOutside:i=>{var c,f;(c=e.onInteractOutside)==null||c.call(e,i),i.defaultPrevented||(r.current=!0,i.detail.originalEvent.type==="pointerdown"&&(a.current=!0));const l=i.target;((f=n.triggerRef.current)==null?void 0:f.contains(l))&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&a.current&&i.preventDefault()}})}),LP=k.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:a,onCloseAutoFocus:i,...l}=e,u=Fr(ai,n),c=k.useRef(null),f=ft(t,c);return Dk(),w.jsxs(w.Fragment,{children:[w.jsx(cf,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:a,onUnmountAutoFocus:i,children:w.jsx(gu,{role:"dialog",id:u.contentId,"aria-describedby":u.descriptionId,"aria-labelledby":u.titleId,"data-state":zk(u.open),...l,ref:f,onDismiss:()=>u.onOpenChange(!1)})}),w.jsxs(w.Fragment,{children:[w.jsx(B7,{titleId:u.titleId}),w.jsx(j7,{contentRef:c,descriptionId:u.descriptionId})]})]})}),Fk="DialogTitle",MP=k.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,a=Fr(Fk,n);return w.jsx(Xe.h2,{id:a.titleId,...r,ref:t})});MP.displayName=Fk;var FP="DialogDescription",zP=k.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,a=Fr(FP,n);return w.jsx(Xe.p,{id:a.descriptionId,...r,ref:t})});zP.displayName=FP;var PP="DialogClose",BP=k.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,a=Fr(PP,n);return w.jsx(Xe.button,{type:"button",...r,ref:t,onClick:We(e.onClick,()=>a.onOpenChange(!1))})});BP.displayName=PP;function zk(e){return e?"open":"closed"}var UP="DialogTitleWarning",[P7,jP]=v8(UP,{contentName:ai,titleName:Fk,docsSlug:"dialog"}),B7=({titleId:e})=>{const t=jP(UP),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 k.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},U7="DialogDescriptionWarning",j7=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${jP(U7).contentName}}.`;return k.useEffect(()=>{var i;const a=(i=e.current)==null?void 0:i.getAttribute("aria-describedby");t&&a&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},Pk=_P,GP=CP,Bk=OP,gf=DP,hf=IP,Uk=MP,jk=zP,Gk=BP,HP="AlertDialog",[G7,Qye]=mr(HP,[TP]),La=TP(),$P=e=>{const{__scopeAlertDialog:t,...n}=e,r=La(t);return w.jsx(Pk,{...r,...n,modal:!0})};$P.displayName=HP;var H7="AlertDialogTrigger",$7=k.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,a=La(n);return w.jsx(GP,{...a,...r,ref:t})});$7.displayName=H7;var q7="AlertDialogPortal",qP=e=>{const{__scopeAlertDialog:t,...n}=e,r=La(t);return w.jsx(Bk,{...r,...n})};qP.displayName=q7;var V7="AlertDialogOverlay",VP=k.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,a=La(n);return w.jsx(gf,{...a,...r,ref:t})});VP.displayName=V7;var cl="AlertDialogContent",[W7,Y7]=G7(cl),WP=k.forwardRef((e,t)=>{const{__scopeAlertDialog:n,children:r,...a}=e,i=La(n),l=k.useRef(null),u=ft(t,l),c=k.useRef(null);return w.jsx(P7,{contentName:cl,titleName:YP,docsSlug:"alert-dialog",children:w.jsx(W7,{scope:n,cancelRef:c,children:w.jsxs(hf,{role:"alertdialog",...i,...a,ref:u,onOpenAutoFocus:We(a.onOpenAutoFocus,f=>{var p;f.preventDefault(),(p=c.current)==null||p.focus({preventScroll:!0})}),onPointerDownOutside:f=>f.preventDefault(),onInteractOutside:f=>f.preventDefault(),children:[w.jsx(Ok,{children:r}),w.jsx(X7,{contentRef:l})]})})})});WP.displayName=cl;var YP="AlertDialogTitle",KP=k.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,a=La(n);return w.jsx(Uk,{...a,...r,ref:t})});KP.displayName=YP;var XP="AlertDialogDescription",ZP=k.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,a=La(n);return w.jsx(jk,{...a,...r,ref:t})});ZP.displayName=XP;var K7="AlertDialogAction",QP=k.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,a=La(n);return w.jsx(Gk,{...a,...r,ref:t})});QP.displayName=K7;var JP="AlertDialogCancel",eB=k.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,{cancelRef:a}=Y7(JP,n),i=La(n),l=ft(t,a);return w.jsx(Gk,{...i,...r,ref:l})});eB.displayName=JP;var X7=({contentRef:e})=>{const t=`\`${cl}\` requires a description for the component to be accessible for screen reader users. + +You can add a description to the \`${cl}\` by passing a \`${XP}\` 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 \`${cl}\`. 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 k.useEffect(()=>{var r;document.getElementById((r=e.current)==null?void 0:r.getAttribute("aria-describedby"))||console.warn(t)},[t,e]),null},Z7=$P,Q7=qP,tB=VP,nB=WP,rB=QP,aB=eB,oB=KP,iB=ZP;const J7=["top","right","bottom","left"],yo=Math.min,Kn=Math.max,Id=Math.round,Gc=Math.floor,Kr=e=>({x:e,y:e}),eV={left:"right",right:"left",bottom:"top",top:"bottom"},tV={start:"end",end:"start"};function Ax(e,t,n){return Kn(e,yo(t,n))}function Da(e,t){return typeof e=="function"?e(t):e}function Ia(e){return e.split("-")[0]}function _l(e){return e.split("-")[1]}function Hk(e){return e==="x"?"y":"x"}function $k(e){return e==="y"?"height":"width"}function vo(e){return["top","bottom"].includes(Ia(e))?"y":"x"}function qk(e){return Hk(vo(e))}function nV(e,t,n){n===void 0&&(n=!1);const r=_l(e),a=qk(e),i=$k(a);let l=a==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(l=Ld(l)),[l,Ld(l)]}function rV(e){const t=Ld(e);return[Tx(e),t,Tx(t)]}function Tx(e){return e.replace(/start|end/g,t=>tV[t])}function aV(e,t,n){const r=["left","right"],a=["right","left"],i=["top","bottom"],l=["bottom","top"];switch(e){case"top":case"bottom":return n?t?a:r:t?r:a;case"left":case"right":return t?i:l;default:return[]}}function oV(e,t,n,r){const a=_l(e);let i=aV(Ia(e),n==="start",r);return a&&(i=i.map(l=>l+"-"+a),t&&(i=i.concat(i.map(Tx)))),i}function Ld(e){return e.replace(/left|right|bottom|top/g,t=>eV[t])}function iV(e){return{top:0,right:0,bottom:0,left:0,...e}}function lB(e){return typeof e!="number"?iV(e):{top:e,right:e,bottom:e,left:e}}function Md(e){const{x:t,y:n,width:r,height:a}=e;return{width:r,height:a,top:n,left:t,right:t+r,bottom:n+a,x:t,y:n}}function zR(e,t,n){let{reference:r,floating:a}=e;const i=vo(t),l=qk(t),u=$k(l),c=Ia(t),f=i==="y",p=r.x+r.width/2-a.width/2,g=r.y+r.height/2-a.height/2,b=r[u]/2-a[u]/2;let m;switch(c){case"top":m={x:p,y:r.y-a.height};break;case"bottom":m={x:p,y:r.y+r.height};break;case"right":m={x:r.x+r.width,y:g};break;case"left":m={x:r.x-a.width,y:g};break;default:m={x:r.x,y:r.y}}switch(_l(t)){case"start":m[l]-=b*(n&&f?-1:1);break;case"end":m[l]+=b*(n&&f?-1:1);break}return m}const lV=async(e,t,n)=>{const{placement:r="bottom",strategy:a="absolute",middleware:i=[],platform:l}=n,u=i.filter(Boolean),c=await(l.isRTL==null?void 0:l.isRTL(t));let f=await l.getElementRects({reference:e,floating:t,strategy:a}),{x:p,y:g}=zR(f,r,c),b=r,m={},S=0;for(let v=0;v({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:a,rects:i,platform:l,elements:u,middlewareData:c}=t,{element:f,padding:p=0}=Da(e,t)||{};if(f==null)return{};const g=lB(p),b={x:n,y:r},m=qk(a),S=$k(m),v=await l.getDimensions(f),A=m==="y",R=A?"top":"left",x=A?"bottom":"right",_=A?"clientHeight":"clientWidth",C=i.reference[S]+i.reference[m]-b[m]-i.floating[S],N=b[m]-i.reference[m],T=await(l.getOffsetParent==null?void 0:l.getOffsetParent(f));let O=T?T[_]:0;(!O||!await(l.isElement==null?void 0:l.isElement(T)))&&(O=u.floating[_]||i.floating[S]);const z=C/2-N/2,I=O/2-v[S]/2-1,M=yo(g[R],I),H=yo(g[x],I),q=M,U=O-v[S]-H,W=O/2-v[S]/2+z,Z=Ax(q,W,U),j=!c.arrow&&_l(a)!=null&&W!==Z&&i.reference[S]/2-(WW<=0)){var H,q;const W=(((H=i.flip)==null?void 0:H.index)||0)+1,Z=O[W];if(Z)return{data:{index:W,overflows:M},reset:{placement:Z}};let j=(q=M.filter(G=>G.overflows[0]<=0).sort((G,P)=>G.overflows[1]-P.overflows[1])[0])==null?void 0:q.placement;if(!j)switch(m){case"bestFit":{var U;const G=(U=M.filter(P=>{if(T){const X=vo(P.placement);return X===x||X==="y"}return!0}).map(P=>[P.placement,P.overflows.filter(X=>X>0).reduce((X,D)=>X+D,0)]).sort((P,X)=>P[1]-X[1])[0])==null?void 0:U[0];G&&(j=G);break}case"initialPlacement":j=u;break}if(a!==j)return{reset:{placement:j}}}return{}}}};function PR(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function BR(e){return J7.some(t=>e[t]>=0)}const cV=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...a}=Da(e,t);switch(r){case"referenceHidden":{const i=await Js(t,{...a,elementContext:"reference"}),l=PR(i,n.reference);return{data:{referenceHiddenOffsets:l,referenceHidden:BR(l)}}}case"escaped":{const i=await Js(t,{...a,altBoundary:!0}),l=PR(i,n.floating);return{data:{escapedOffsets:l,escaped:BR(l)}}}default:return{}}}}};async function dV(e,t){const{placement:n,platform:r,elements:a}=e,i=await(r.isRTL==null?void 0:r.isRTL(a.floating)),l=Ia(n),u=_l(n),c=vo(n)==="y",f=["left","top"].includes(l)?-1:1,p=i&&c?-1:1,g=Da(t,e);let{mainAxis:b,crossAxis:m,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"&&(m=u==="end"?S*-1:S),c?{x:m*p,y:b*f}:{x:b*f,y:m*p}}const fV=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:a,y:i,placement:l,middlewareData:u}=t,c=await dV(t,e);return l===((n=u.offset)==null?void 0:n.placement)&&(r=u.arrow)!=null&&r.alignmentOffset?{}:{x:a+c.x,y:i+c.y,data:{...c,placement:l}}}}},pV=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:a}=t,{mainAxis:i=!0,crossAxis:l=!1,limiter:u={fn:A=>{let{x:R,y:x}=A;return{x:R,y:x}}},...c}=Da(e,t),f={x:n,y:r},p=await Js(t,c),g=vo(Ia(a)),b=Hk(g);let m=f[b],S=f[g];if(i){const A=b==="y"?"top":"left",R=b==="y"?"bottom":"right",x=m+p[A],_=m-p[R];m=Ax(x,m,_)}if(l){const A=g==="y"?"top":"left",R=g==="y"?"bottom":"right",x=S+p[A],_=S-p[R];S=Ax(x,S,_)}const v=u.fn({...t,[b]:m,[g]:S});return{...v,data:{x:v.x-n,y:v.y-r,enabled:{[b]:i,[g]:l}}}}}},gV=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:a,rects:i,middlewareData:l}=t,{offset:u=0,mainAxis:c=!0,crossAxis:f=!0}=Da(e,t),p={x:n,y:r},g=vo(a),b=Hk(g);let m=p[b],S=p[g];const v=Da(u,t),A=typeof v=="number"?{mainAxis:v,crossAxis:0}:{mainAxis:0,crossAxis:0,...v};if(c){const _=b==="y"?"height":"width",C=i.reference[b]-i.floating[_]+A.mainAxis,N=i.reference[b]+i.reference[_]-A.mainAxis;mN&&(m=N)}if(f){var R,x;const _=b==="y"?"width":"height",C=["top","left"].includes(Ia(a)),N=i.reference[g]-i.floating[_]+(C&&((R=l.offset)==null?void 0:R[g])||0)+(C?0:A.crossAxis),T=i.reference[g]+i.reference[_]+(C?0:((x=l.offset)==null?void 0:x[g])||0)-(C?A.crossAxis:0);ST&&(S=T)}return{[b]:m,[g]:S}}}},hV=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:a,rects:i,platform:l,elements:u}=t,{apply:c=()=>{},...f}=Da(e,t),p=await Js(t,f),g=Ia(a),b=_l(a),m=vo(a)==="y",{width:S,height:v}=i.floating;let A,R;g==="top"||g==="bottom"?(A=g,R=b===(await(l.isRTL==null?void 0:l.isRTL(u.floating))?"start":"end")?"left":"right"):(R=g,A=b==="end"?"top":"bottom");const x=v-p.top-p.bottom,_=S-p.left-p.right,C=yo(v-p[A],x),N=yo(S-p[R],_),T=!t.middlewareData.shift;let O=C,z=N;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(z=_),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(O=x),T&&!b){const M=Kn(p.left,0),H=Kn(p.right,0),q=Kn(p.top,0),U=Kn(p.bottom,0);m?z=S-2*(M!==0||H!==0?M+H:Kn(p.left,p.right)):O=v-2*(q!==0||U!==0?q+U:Kn(p.top,p.bottom))}await c({...t,availableWidth:z,availableHeight:O});const I=await l.getDimensions(u.floating);return S!==I.width||v!==I.height?{reset:{rects:!0}}:{}}}};function mf(){return typeof window<"u"}function Rl(e){return sB(e)?(e.nodeName||"").toLowerCase():"#document"}function Zn(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Zr(e){var t;return(t=(sB(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function sB(e){return mf()?e instanceof Node||e instanceof Zn(e).Node:!1}function Dr(e){return mf()?e instanceof Element||e instanceof Zn(e).Element:!1}function Xr(e){return mf()?e instanceof HTMLElement||e instanceof Zn(e).HTMLElement:!1}function UR(e){return!mf()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Zn(e).ShadowRoot}function hu(e){const{overflow:t,overflowX:n,overflowY:r,display:a}=Ir(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(a)}function mV(e){return["table","td","th"].includes(Rl(e))}function bf(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function Vk(e){const t=Wk(),n=Dr(e)?Ir(e):e;return["transform","translate","scale","rotate","perspective"].some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||["transform","translate","scale","rotate","perspective","filter"].some(r=>(n.willChange||"").includes(r))||["paint","layout","strict","content"].some(r=>(n.contain||"").includes(r))}function bV(e){let t=So(e);for(;Xr(t)&&!hl(t);){if(Vk(t))return t;if(bf(t))return null;t=So(t)}return null}function Wk(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function hl(e){return["html","body","#document"].includes(Rl(e))}function Ir(e){return Zn(e).getComputedStyle(e)}function yf(e){return Dr(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function So(e){if(Rl(e)==="html")return e;const t=e.assignedSlot||e.parentNode||UR(e)&&e.host||Zr(e);return UR(t)?t.host:t}function uB(e){const t=So(e);return hl(t)?e.ownerDocument?e.ownerDocument.body:e.body:Xr(t)&&hu(t)?t:uB(t)}function eu(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const a=uB(e),i=a===((r=e.ownerDocument)==null?void 0:r.body),l=Zn(a);if(i){const u=_x(l);return t.concat(l,l.visualViewport||[],hu(a)?a:[],u&&n?eu(u):[])}return t.concat(a,eu(a,[],n))}function _x(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function cB(e){const t=Ir(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const a=Xr(e),i=a?e.offsetWidth:n,l=a?e.offsetHeight:r,u=Id(n)!==i||Id(r)!==l;return u&&(n=i,r=l),{width:n,height:r,$:u}}function Yk(e){return Dr(e)?e:e.contextElement}function dl(e){const t=Yk(e);if(!Xr(t))return Kr(1);const n=t.getBoundingClientRect(),{width:r,height:a,$:i}=cB(t);let l=(i?Id(n.width):n.width)/r,u=(i?Id(n.height):n.height)/a;return(!l||!Number.isFinite(l))&&(l=1),(!u||!Number.isFinite(u))&&(u=1),{x:l,y:u}}const yV=Kr(0);function dB(e){const t=Zn(e);return!Wk()||!t.visualViewport?yV:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function vV(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Zn(e)?!1:t}function oi(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const a=e.getBoundingClientRect(),i=Yk(e);let l=Kr(1);t&&(r?Dr(r)&&(l=dl(r)):l=dl(e));const u=vV(i,n,r)?dB(i):Kr(0);let c=(a.left+u.x)/l.x,f=(a.top+u.y)/l.y,p=a.width/l.x,g=a.height/l.y;if(i){const b=Zn(i),m=r&&Dr(r)?Zn(r):r;let S=b,v=_x(S);for(;v&&r&&m!==S;){const A=dl(v),R=v.getBoundingClientRect(),x=Ir(v),_=R.left+(v.clientLeft+parseFloat(x.paddingLeft))*A.x,C=R.top+(v.clientTop+parseFloat(x.paddingTop))*A.y;c*=A.x,f*=A.y,p*=A.x,g*=A.y,c+=_,f+=C,S=Zn(v),v=_x(S)}}return Md({width:p,height:g,x:c,y:f})}function Kk(e,t){const n=yf(e).scrollLeft;return t?t.left+n:oi(Zr(e)).left+n}function fB(e,t,n){n===void 0&&(n=!1);const r=e.getBoundingClientRect(),a=r.left+t.scrollLeft-(n?0:Kk(e,r)),i=r.top+t.scrollTop;return{x:a,y:i}}function SV(e){let{elements:t,rect:n,offsetParent:r,strategy:a}=e;const i=a==="fixed",l=Zr(r),u=t?bf(t.floating):!1;if(r===l||u&&i)return n;let c={scrollLeft:0,scrollTop:0},f=Kr(1);const p=Kr(0),g=Xr(r);if((g||!g&&!i)&&((Rl(r)!=="body"||hu(l))&&(c=yf(r)),Xr(r))){const m=oi(r);f=dl(r),p.x=m.x+r.clientLeft,p.y=m.y+r.clientTop}const b=l&&!g&&!i?fB(l,c,!0):Kr(0);return{width:n.width*f.x,height:n.height*f.y,x:n.x*f.x-c.scrollLeft*f.x+p.x+b.x,y:n.y*f.y-c.scrollTop*f.y+p.y+b.y}}function EV(e){return Array.from(e.getClientRects())}function wV(e){const t=Zr(e),n=yf(e),r=e.ownerDocument.body,a=Kn(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=Kn(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let l=-n.scrollLeft+Kk(e);const u=-n.scrollTop;return Ir(r).direction==="rtl"&&(l+=Kn(t.clientWidth,r.clientWidth)-a),{width:a,height:i,x:l,y:u}}function xV(e,t){const n=Zn(e),r=Zr(e),a=n.visualViewport;let i=r.clientWidth,l=r.clientHeight,u=0,c=0;if(a){i=a.width,l=a.height;const f=Wk();(!f||f&&t==="fixed")&&(u=a.offsetLeft,c=a.offsetTop)}return{width:i,height:l,x:u,y:c}}function kV(e,t){const n=oi(e,!0,t==="fixed"),r=n.top+e.clientTop,a=n.left+e.clientLeft,i=Xr(e)?dl(e):Kr(1),l=e.clientWidth*i.x,u=e.clientHeight*i.y,c=a*i.x,f=r*i.y;return{width:l,height:u,x:c,y:f}}function jR(e,t,n){let r;if(t==="viewport")r=xV(e,n);else if(t==="document")r=wV(Zr(e));else if(Dr(t))r=kV(t,n);else{const a=dB(e);r={x:t.x-a.x,y:t.y-a.y,width:t.width,height:t.height}}return Md(r)}function pB(e,t){const n=So(e);return n===t||!Dr(n)||hl(n)?!1:Ir(n).position==="fixed"||pB(n,t)}function AV(e,t){const n=t.get(e);if(n)return n;let r=eu(e,[],!1).filter(u=>Dr(u)&&Rl(u)!=="body"),a=null;const i=Ir(e).position==="fixed";let l=i?So(e):e;for(;Dr(l)&&!hl(l);){const u=Ir(l),c=Vk(l);!c&&u.position==="fixed"&&(a=null),(i?!c&&!a:!c&&u.position==="static"&&!!a&&["absolute","fixed"].includes(a.position)||hu(l)&&!c&&pB(e,l))?r=r.filter(p=>p!==l):a=u,l=So(l)}return t.set(e,r),r}function TV(e){let{element:t,boundary:n,rootBoundary:r,strategy:a}=e;const l=[...n==="clippingAncestors"?bf(t)?[]:AV(t,this._c):[].concat(n),r],u=l[0],c=l.reduce((f,p)=>{const g=jR(t,p,a);return f.top=Kn(g.top,f.top),f.right=yo(g.right,f.right),f.bottom=yo(g.bottom,f.bottom),f.left=Kn(g.left,f.left),f},jR(t,u,a));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function _V(e){const{width:t,height:n}=cB(e);return{width:t,height:n}}function RV(e,t,n){const r=Xr(t),a=Zr(t),i=n==="fixed",l=oi(e,!0,i,t);let u={scrollLeft:0,scrollTop:0};const c=Kr(0);if(r||!r&&!i)if((Rl(t)!=="body"||hu(a))&&(u=yf(t)),r){const b=oi(t,!0,i,t);c.x=b.x+t.clientLeft,c.y=b.y+t.clientTop}else a&&(c.x=Kk(a));const f=a&&!r&&!i?fB(a,u):Kr(0),p=l.left+u.scrollLeft-c.x-f.x,g=l.top+u.scrollTop-c.y-f.y;return{x:p,y:g,width:l.width,height:l.height}}function Sh(e){return Ir(e).position==="static"}function GR(e,t){if(!Xr(e)||Ir(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Zr(e)===n&&(n=n.ownerDocument.body),n}function gB(e,t){const n=Zn(e);if(bf(e))return n;if(!Xr(e)){let a=So(e);for(;a&&!hl(a);){if(Dr(a)&&!Sh(a))return a;a=So(a)}return n}let r=GR(e,t);for(;r&&mV(r)&&Sh(r);)r=GR(r,t);return r&&hl(r)&&Sh(r)&&!Vk(r)?n:r||bV(e)||n}const CV=async function(e){const t=this.getOffsetParent||gB,n=this.getDimensions,r=await n(e.floating);return{reference:RV(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function NV(e){return Ir(e).direction==="rtl"}const OV={convertOffsetParentRelativeRectToViewportRelativeRect:SV,getDocumentElement:Zr,getClippingRect:TV,getOffsetParent:gB,getElementRects:CV,getClientRects:EV,getDimensions:_V,getScale:dl,isElement:Dr,isRTL:NV};function hB(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function DV(e,t){let n=null,r;const a=Zr(e);function i(){var u;clearTimeout(r),(u=n)==null||u.disconnect(),n=null}function l(u,c){u===void 0&&(u=!1),c===void 0&&(c=1),i();const f=e.getBoundingClientRect(),{left:p,top:g,width:b,height:m}=f;if(u||t(),!b||!m)return;const S=Gc(g),v=Gc(a.clientWidth-(p+b)),A=Gc(a.clientHeight-(g+m)),R=Gc(p),_={rootMargin:-S+"px "+-v+"px "+-A+"px "+-R+"px",threshold:Kn(0,yo(1,c))||1};let C=!0;function N(T){const O=T[0].intersectionRatio;if(O!==c){if(!C)return l();O?l(!1,O):r=setTimeout(()=>{l(!1,1e-7)},1e3)}O===1&&!hB(f,e.getBoundingClientRect())&&l(),C=!1}try{n=new IntersectionObserver(N,{..._,root:a.ownerDocument})}catch{n=new IntersectionObserver(N,_)}n.observe(e)}return l(!0),i}function IV(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:a=!0,ancestorResize:i=!0,elementResize:l=typeof ResizeObserver=="function",layoutShift:u=typeof IntersectionObserver=="function",animationFrame:c=!1}=r,f=Yk(e),p=a||i?[...f?eu(f):[],...eu(t)]:[];p.forEach(R=>{a&&R.addEventListener("scroll",n,{passive:!0}),i&&R.addEventListener("resize",n)});const g=f&&u?DV(f,n):null;let b=-1,m=null;l&&(m=new ResizeObserver(R=>{let[x]=R;x&&x.target===f&&m&&(m.unobserve(t),cancelAnimationFrame(b),b=requestAnimationFrame(()=>{var _;(_=m)==null||_.observe(t)})),n()}),f&&!c&&m.observe(f),m.observe(t));let S,v=c?oi(e):null;c&&A();function A(){const R=oi(e);v&&!hB(v,R)&&n(),v=R,S=requestAnimationFrame(A)}return n(),()=>{var R;p.forEach(x=>{a&&x.removeEventListener("scroll",n),i&&x.removeEventListener("resize",n)}),g==null||g(),(R=m)==null||R.disconnect(),m=null,c&&cancelAnimationFrame(S)}}const LV=fV,MV=pV,FV=uV,zV=hV,PV=cV,HR=sV,BV=gV,UV=(e,t,n)=>{const r=new Map,a={platform:OV,...n},i={...a.platform,_c:r};return lV(e,t,{...a,platform:i})};var bd=typeof document<"u"?k.useLayoutEffect:k.useEffect;function Fd(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,a;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!Fd(e[r],t[r]))return!1;return!0}if(a=Object.keys(e),n=a.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,a[r]))return!1;for(r=n;r--!==0;){const i=a[r];if(!(i==="_owner"&&e.$$typeof)&&!Fd(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function mB(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function $R(e,t){const n=mB(e);return Math.round(t*n)/n}function Eh(e){const t=k.useRef(e);return bd(()=>{t.current=e}),t}function jV(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:a,elements:{reference:i,floating:l}={},transform:u=!0,whileElementsMounted:c,open:f}=e,[p,g]=k.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[b,m]=k.useState(r);Fd(b,r)||m(r);const[S,v]=k.useState(null),[A,R]=k.useState(null),x=k.useCallback(P=>{P!==T.current&&(T.current=P,v(P))},[]),_=k.useCallback(P=>{P!==O.current&&(O.current=P,R(P))},[]),C=i||S,N=l||A,T=k.useRef(null),O=k.useRef(null),z=k.useRef(p),I=c!=null,M=Eh(c),H=Eh(a),q=Eh(f),U=k.useCallback(()=>{if(!T.current||!O.current)return;const P={placement:t,strategy:n,middleware:b};H.current&&(P.platform=H.current),UV(T.current,O.current,P).then(X=>{const D={...X,isPositioned:q.current!==!1};W.current&&!Fd(z.current,D)&&(z.current=D,pu.flushSync(()=>{g(D)}))})},[b,t,n,H,q]);bd(()=>{f===!1&&z.current.isPositioned&&(z.current.isPositioned=!1,g(P=>({...P,isPositioned:!1})))},[f]);const W=k.useRef(!1);bd(()=>(W.current=!0,()=>{W.current=!1}),[]),bd(()=>{if(C&&(T.current=C),N&&(O.current=N),C&&N){if(M.current)return M.current(C,N,U);U()}},[C,N,U,M,I]);const Z=k.useMemo(()=>({reference:T,floating:O,setReference:x,setFloating:_}),[x,_]),j=k.useMemo(()=>({reference:C,floating:N}),[C,N]),G=k.useMemo(()=>{const P={position:n,left:0,top:0};if(!j.floating)return P;const X=$R(j.floating,p.x),D=$R(j.floating,p.y);return u?{...P,transform:"translate("+X+"px, "+D+"px)",...mB(j.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:X,top:D}},[n,u,j.floating,p.x,p.y]);return k.useMemo(()=>({...p,update:U,refs:Z,elements:j,floatingStyles:G}),[p,U,Z,j,G])}const GV=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:a}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?HR({element:r.current,padding:a}).fn(n):{}:r?HR({element:r,padding:a}).fn(n):{}}}},HV=(e,t)=>({...LV(e),options:[e,t]}),$V=(e,t)=>({...MV(e),options:[e,t]}),qV=(e,t)=>({...BV(e),options:[e,t]}),VV=(e,t)=>({...FV(e),options:[e,t]}),WV=(e,t)=>({...zV(e),options:[e,t]}),YV=(e,t)=>({...PV(e),options:[e,t]}),KV=(e,t)=>({...GV(e),options:[e,t]});var XV="Arrow",bB=k.forwardRef((e,t)=>{const{children:n,width:r=10,height:a=5,...i}=e;return w.jsx(Xe.svg,{...i,ref:t,width:r,height:a,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:w.jsx("polygon",{points:"0,0 30,0 15,10"})})});bB.displayName=XV;var ZV=bB;function yB(e){const[t,n]=k.useState(void 0);return wn(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(a=>{if(!Array.isArray(a)||!a.length)return;const i=a[0];let l,u;if("borderBoxSize"in i){const c=i.borderBoxSize,f=Array.isArray(c)?c[0]:c;l=f.inlineSize,u=f.blockSize}else l=e.offsetWidth,u=e.offsetHeight;n({width:l,height:u})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var Xk="Popper",[vB,Cl]=mr(Xk),[QV,SB]=vB(Xk),EB=e=>{const{__scopePopper:t,children:n}=e,[r,a]=k.useState(null);return w.jsx(QV,{scope:t,anchor:r,onAnchorChange:a,children:n})};EB.displayName=Xk;var wB="PopperAnchor",xB=k.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...a}=e,i=SB(wB,n),l=k.useRef(null),u=ft(t,l);return k.useEffect(()=>{i.onAnchorChange((r==null?void 0:r.current)||l.current)}),r?null:w.jsx(Xe.div,{...a,ref:u})});xB.displayName=wB;var Zk="PopperContent",[JV,eW]=vB(Zk),kB=k.forwardRef((e,t)=>{var re,le,Ae,ae,we,xe;const{__scopePopper:n,side:r="bottom",sideOffset:a=0,align:i="center",alignOffset:l=0,arrowPadding:u=0,avoidCollisions:c=!0,collisionBoundary:f=[],collisionPadding:p=0,sticky:g="partial",hideWhenDetached:b=!1,updatePositionStrategy:m="optimized",onPlaced:S,...v}=e,A=SB(Zk,n),[R,x]=k.useState(null),_=ft(t,Ie=>x(Ie)),[C,N]=k.useState(null),T=yB(C),O=(T==null?void 0:T.width)??0,z=(T==null?void 0:T.height)??0,I=r+(i!=="center"?"-"+i:""),M=typeof p=="number"?p:{top:0,right:0,bottom:0,left:0,...p},H=Array.isArray(f)?f:[f],q=H.length>0,U={padding:M,boundary:H.filter(nW),altBoundary:q},{refs:W,floatingStyles:Z,placement:j,isPositioned:G,middlewareData:P}=jV({strategy:"fixed",placement:I,whileElementsMounted:(...Ie)=>IV(...Ie,{animationFrame:m==="always"}),elements:{reference:A.anchor},middleware:[HV({mainAxis:a+z,alignmentAxis:l}),c&&$V({mainAxis:!0,crossAxis:!1,limiter:g==="partial"?qV():void 0,...U}),c&&VV({...U}),WV({...U,apply:({elements:Ie,rects:Ce,availableWidth:Ee,availableHeight:J})=>{const{width:fe,height:ke}=Ce.reference,me=Ie.floating.style;me.setProperty("--radix-popper-available-width",`${Ee}px`),me.setProperty("--radix-popper-available-height",`${J}px`),me.setProperty("--radix-popper-anchor-width",`${fe}px`),me.setProperty("--radix-popper-anchor-height",`${ke}px`)}}),C&&KV({element:C,padding:u}),rW({arrowWidth:O,arrowHeight:z}),b&&YV({strategy:"referenceHidden",...U})]}),[X,D]=_B(j),V=pn(S);wn(()=>{G&&(V==null||V())},[G,V]);const B=(re=P.arrow)==null?void 0:re.x,L=(le=P.arrow)==null?void 0:le.y,Y=((Ae=P.arrow)==null?void 0:Ae.centerOffset)!==0,[Q,se]=k.useState();return wn(()=>{R&&se(window.getComputedStyle(R).zIndex)},[R]),w.jsx("div",{ref:W.setFloating,"data-radix-popper-content-wrapper":"",style:{...Z,transform:G?Z.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:Q,"--radix-popper-transform-origin":[(ae=P.transformOrigin)==null?void 0:ae.x,(we=P.transformOrigin)==null?void 0:we.y].join(" "),...((xe=P.hide)==null?void 0:xe.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:w.jsx(JV,{scope:n,placedSide:X,onArrowChange:N,arrowX:B,arrowY:L,shouldHideArrow:Y,children:w.jsx(Xe.div,{"data-side":X,"data-align":D,...v,ref:_,style:{...v.style,animation:G?void 0:"none"}})})})});kB.displayName=Zk;var AB="PopperArrow",tW={top:"bottom",right:"left",bottom:"top",left:"right"},TB=k.forwardRef(function(t,n){const{__scopePopper:r,...a}=t,i=eW(AB,r),l=tW[i.placedSide];return w.jsx("span",{ref:i.onArrowChange,style:{position:"absolute",left:i.arrowX,top:i.arrowY,[l]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[i.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[i.placedSide],visibility:i.shouldHideArrow?"hidden":void 0},children:w.jsx(ZV,{...a,ref:n,style:{...a.style,display:"block"}})})});TB.displayName=AB;function nW(e){return e!==null}var rW=e=>({name:"transformOrigin",options:e,fn(t){var A,R,x;const{placement:n,rects:r,middlewareData:a}=t,l=((A=a.arrow)==null?void 0:A.centerOffset)!==0,u=l?0:e.arrowWidth,c=l?0:e.arrowHeight,[f,p]=_B(n),g={start:"0%",center:"50%",end:"100%"}[p],b=(((R=a.arrow)==null?void 0:R.x)??0)+u/2,m=(((x=a.arrow)==null?void 0:x.y)??0)+c/2;let S="",v="";return f==="bottom"?(S=l?g:`${b}px`,v=`${-c}px`):f==="top"?(S=l?g:`${b}px`,v=`${r.floating.height+c}px`):f==="right"?(S=`${-c}px`,v=l?g:`${m}px`):f==="left"&&(S=`${r.floating.width+c}px`,v=l?g:`${m}px`),{data:{x:S,y:v}}}});function _B(e){const[t,n="center"]=e.split("-");return[t,n]}var Qk=EB,vf=xB,Jk=kB,e0=TB,aW="VisuallyHidden",t0=k.forwardRef((e,t)=>w.jsx(Xe.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}}));t0.displayName=aW;var oW=t0,[Sf,Jye]=mr("Tooltip",[Cl]),Ef=Cl(),RB="TooltipProvider",iW=700,Rx="tooltip.open",[lW,n0]=Sf(RB),CB=e=>{const{__scopeTooltip:t,delayDuration:n=iW,skipDelayDuration:r=300,disableHoverableContent:a=!1,children:i}=e,[l,u]=k.useState(!0),c=k.useRef(!1),f=k.useRef(0);return k.useEffect(()=>{const p=f.current;return()=>window.clearTimeout(p)},[]),w.jsx(lW,{scope:t,isOpenDelayed:l,delayDuration:n,onOpen:k.useCallback(()=>{window.clearTimeout(f.current),u(!1)},[]),onClose:k.useCallback(()=>{window.clearTimeout(f.current),f.current=window.setTimeout(()=>u(!0),r)},[r]),isPointerInTransitRef:c,onPointerInTransitChange:k.useCallback(p=>{c.current=p},[]),disableHoverableContent:a,children:i})};CB.displayName=RB;var wf="Tooltip",[sW,xf]=Sf(wf),NB=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:a=!1,onOpenChange:i,disableHoverableContent:l,delayDuration:u}=e,c=n0(wf,e.__scopeTooltip),f=Ef(t),[p,g]=k.useState(null),b=En(),m=k.useRef(0),S=l??c.disableHoverableContent,v=u??c.delayDuration,A=k.useRef(!1),[R=!1,x]=Oa({prop:r,defaultProp:a,onChange:O=>{O?(c.onOpen(),document.dispatchEvent(new CustomEvent(Rx))):c.onClose(),i==null||i(O)}}),_=k.useMemo(()=>R?A.current?"delayed-open":"instant-open":"closed",[R]),C=k.useCallback(()=>{window.clearTimeout(m.current),m.current=0,A.current=!1,x(!0)},[x]),N=k.useCallback(()=>{window.clearTimeout(m.current),m.current=0,x(!1)},[x]),T=k.useCallback(()=>{window.clearTimeout(m.current),m.current=window.setTimeout(()=>{A.current=!0,x(!0),m.current=0},v)},[v,x]);return k.useEffect(()=>()=>{m.current&&(window.clearTimeout(m.current),m.current=0)},[]),w.jsx(Qk,{...f,children:w.jsx(sW,{scope:t,contentId:b,open:R,stateAttribute:_,trigger:p,onTriggerChange:g,onTriggerEnter:k.useCallback(()=>{c.isOpenDelayed?T():C()},[c.isOpenDelayed,T,C]),onTriggerLeave:k.useCallback(()=>{S?N():(window.clearTimeout(m.current),m.current=0)},[N,S]),onOpen:C,onClose:N,disableHoverableContent:S,children:n})})};NB.displayName=wf;var Cx="TooltipTrigger",OB=k.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,a=xf(Cx,n),i=n0(Cx,n),l=Ef(n),u=k.useRef(null),c=ft(t,u,a.onTriggerChange),f=k.useRef(!1),p=k.useRef(!1),g=k.useCallback(()=>f.current=!1,[]);return k.useEffect(()=>()=>document.removeEventListener("pointerup",g),[g]),w.jsx(vf,{asChild:!0,...l,children:w.jsx(Xe.button,{"aria-describedby":a.open?a.contentId:void 0,"data-state":a.stateAttribute,...r,ref:c,onPointerMove:We(e.onPointerMove,b=>{b.pointerType!=="touch"&&!p.current&&!i.isPointerInTransitRef.current&&(a.onTriggerEnter(),p.current=!0)}),onPointerLeave:We(e.onPointerLeave,()=>{a.onTriggerLeave(),p.current=!1}),onPointerDown:We(e.onPointerDown,()=>{f.current=!0,document.addEventListener("pointerup",g,{once:!0})}),onFocus:We(e.onFocus,()=>{f.current||a.onOpen()}),onBlur:We(e.onBlur,a.onClose),onClick:We(e.onClick,a.onClose)})})});OB.displayName=Cx;var uW="TooltipPortal",[eve,cW]=Sf(uW,{forceMount:void 0}),ml="TooltipContent",DB=k.forwardRef((e,t)=>{const n=cW(ml,e.__scopeTooltip),{forceMount:r=n.forceMount,side:a="top",...i}=e,l=xf(ml,e.__scopeTooltip);return w.jsx(Jn,{present:r||l.open,children:l.disableHoverableContent?w.jsx(IB,{side:a,...i,ref:t}):w.jsx(dW,{side:a,...i,ref:t})})}),dW=k.forwardRef((e,t)=>{const n=xf(ml,e.__scopeTooltip),r=n0(ml,e.__scopeTooltip),a=k.useRef(null),i=ft(t,a),[l,u]=k.useState(null),{trigger:c,onClose:f}=n,p=a.current,{onPointerInTransitChange:g}=r,b=k.useCallback(()=>{u(null),g(!1)},[g]),m=k.useCallback((S,v)=>{const A=S.currentTarget,R={x:S.clientX,y:S.clientY},x=hW(R,A.getBoundingClientRect()),_=mW(R,x),C=bW(v.getBoundingClientRect()),N=vW([..._,...C]);u(N),g(!0)},[g]);return k.useEffect(()=>()=>b(),[b]),k.useEffect(()=>{if(c&&p){const S=A=>m(A,p),v=A=>m(A,c);return c.addEventListener("pointerleave",S),p.addEventListener("pointerleave",v),()=>{c.removeEventListener("pointerleave",S),p.removeEventListener("pointerleave",v)}}},[c,p,m,b]),k.useEffect(()=>{if(l){const S=v=>{const A=v.target,R={x:v.clientX,y:v.clientY},x=(c==null?void 0:c.contains(A))||(p==null?void 0:p.contains(A)),_=!yW(R,l);x?b():_&&(b(),f())};return document.addEventListener("pointermove",S),()=>document.removeEventListener("pointermove",S)}},[c,p,l,f,b]),w.jsx(IB,{...e,ref:i})}),[fW,pW]=Sf(wf,{isInside:!1}),IB=k.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":a,onEscapeKeyDown:i,onPointerDownOutside:l,...u}=e,c=xf(ml,n),f=Ef(n),{onClose:p}=c;return k.useEffect(()=>(document.addEventListener(Rx,p),()=>document.removeEventListener(Rx,p)),[p]),k.useEffect(()=>{if(c.trigger){const g=b=>{const m=b.target;m!=null&&m.contains(c.trigger)&&p()};return window.addEventListener("scroll",g,{capture:!0}),()=>window.removeEventListener("scroll",g,{capture:!0})}},[c.trigger,p]),w.jsx(gu,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:i,onPointerDownOutside:l,onFocusOutside:g=>g.preventDefault(),onDismiss:p,children:w.jsxs(Jk,{"data-state":c.stateAttribute,...f,...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:[w.jsx(Ok,{children:r}),w.jsx(fW,{scope:n,isInside:!0,children:w.jsx(oW,{id:c.contentId,role:"tooltip",children:a||r})})]})})});DB.displayName=ml;var LB="TooltipArrow",gW=k.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,a=Ef(n);return pW(LB,n).isInside?null:w.jsx(e0,{...a,...r,ref:t})});gW.displayName=LB;function hW(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),a=Math.abs(t.right-e.x),i=Math.abs(t.left-e.x);switch(Math.min(n,r,a,i)){case i:return"left";case a:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function mW(e,t,n=5){const r=[];switch(t){case"top":r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}function bW(e){const{top:t,right:n,bottom:r,left:a}=e;return[{x:a,y:t},{x:n,y:t},{x:n,y:r},{x:a,y:r}]}function yW(e,t){const{x:n,y:r}=e;let a=!1;for(let i=0,l=t.length-1;ir!=p>r&&n<(f-u)*(r-c)/(p-c)+u&&(a=!a)}return a}function vW(e){const t=e.slice();return t.sort((n,r)=>n.xr.x?1:n.yr.y?1:0),SW(t)}function SW(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r=2;){const i=t[t.length-1],l=t[t.length-2];if((i.x-l.x)*(a.y-l.y)>=(i.y-l.y)*(a.x-l.x))t.pop();else break}t.push(a)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const a=e[r];for(;n.length>=2;){const i=n[n.length-1],l=n[n.length-2];if((i.x-l.x)*(a.y-l.y)>=(i.y-l.y)*(a.x-l.x))n.pop();else break}n.push(a)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var EW=CB,wW=NB,xW=OB,MB=DB;const FB=EW,zB=wW,PB=xW,kW=e=>typeof e!="string"?e:e.split("\\n").map((t,n)=>w.jsxs(k.Fragment,{children:[t,nw.jsx(MB,{ref:a,sideOffset:t,className:Me("bg-popover text-popover-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 mx-1 max-w-sm overflow-hidden rounded-md border px-3 py-2 text-sm shadow-md",e),...r,children:typeof n=="string"?kW(n):n}));r0.displayName=MB.displayName;const zd=Nz("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"}}),Lt=k.forwardRef(({className:e,variant:t,tooltip:n,size:r,side:a="right",asChild:i=!1,...l},u)=>{const c=i?bo:"button";return n?w.jsx(FB,{children:w.jsxs(zB,{children:[w.jsx(PB,{asChild:!0,children:w.jsx(c,{className:Me(zd({variant:t,size:r,className:e}),"cursor-pointer"),ref:u,...l})}),w.jsx(r0,{side:a,children:n})]})}):w.jsx(c,{className:Me(zd({variant:t,size:r,className:e}),"cursor-pointer"),ref:u,...l})});Lt.displayName="Button";const AW=Z7,TW=Q7,BB=k.forwardRef(({className:e,...t},n)=>w.jsx(tB,{className:Me("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/80",e),...t,ref:n}));BB.displayName=tB.displayName;const UB=k.forwardRef(({className:e,...t},n)=>w.jsxs(TW,{children:[w.jsx(BB,{}),w.jsx(nB,{ref:n,className:Me("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-top-[48%] fixed top-[50%] left-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border p-6 shadow-lg duration-200 sm:rounded-lg",e),...t})]}));UB.displayName=nB.displayName;const jB=({className:e,...t})=>w.jsx("div",{className:Me("flex flex-col space-y-2 text-center sm:text-left",e),...t});jB.displayName="AlertDialogHeader";const GB=k.forwardRef(({className:e,...t},n)=>w.jsx(oB,{ref:n,className:Me("text-lg font-semibold",e),...t}));GB.displayName=oB.displayName;const HB=k.forwardRef(({className:e,...t},n)=>w.jsx(iB,{ref:n,className:Me("text-muted-foreground text-sm",e),...t}));HB.displayName=iB.displayName;const _W=k.forwardRef(({className:e,...t},n)=>w.jsx(rB,{ref:n,className:Me(zd(),e),...t}));_W.displayName=rB.displayName;const RW=k.forwardRef(({className:e,...t},n)=>w.jsx(aB,{ref:n,className:Me(zd({variant:"outline"}),"mt-2 sm:mt-0",e),...t}));RW.displayName=aB.displayName;const Eo=k.forwardRef(({className:e,type:t,...n},r)=>w.jsx("input",{type:t,className:Me("border-input file:text-foreground placeholder:text-muted-foreground focus-visible:ring-ring flex h-9 rounded-md border bg-transparent px-3 py-1 text-base shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium focus-visible:ring-1 focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),ref:r,...n}));Eo.displayName="Input";var CW=e=>{switch(e){case"success":return DW;case"info":return LW;case"warning":return IW;case"error":return MW;default:return null}},NW=Array(12).fill(0),OW=({visible:e,className:t})=>ye.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},ye.createElement("div",{className:"sonner-spinner"},NW.map((n,r)=>ye.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),DW=ye.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},ye.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"})),IW=ye.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},ye.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"})),LW=ye.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},ye.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"})),MW=ye.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},ye.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"})),FW=ye.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"},ye.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),ye.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),zW=()=>{let[e,t]=ye.useState(document.hidden);return ye.useEffect(()=>{let n=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),e},Nx=1,PW=class{constructor(){this.subscribe=e=>(this.subscribers.push(e),()=>{let t=this.subscribers.indexOf(e);this.subscribers.splice(t,1)}),this.publish=e=>{this.subscribers.forEach(t=>t(e))},this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e]},this.create=e=>{var t;let{message:n,...r}=e,a=typeof(e==null?void 0:e.id)=="number"||((t=e.id)==null?void 0:t.length)>0?e.id:Nx++,i=this.toasts.find(u=>u.id===a),l=e.dismissible===void 0?!0:e.dismissible;return this.dismissedToasts.has(a)&&this.dismissedToasts.delete(a),i?this.toasts=this.toasts.map(u=>u.id===a?(this.publish({...u,...e,id:a,title:n}),{...u,...e,id:a,dismissible:l,title:n}):u):this.addToast({title:n,...r,dismissible:l,id:a}),a},this.dismiss=e=>(this.dismissedToasts.add(e),e||this.toasts.forEach(t=>{this.subscribers.forEach(n=>n({id:t.id,dismiss:!0}))}),this.subscribers.forEach(t=>t({id:e,dismiss:!0})),e),this.message=(e,t)=>this.create({...t,message:e}),this.error=(e,t)=>this.create({...t,message:e,type:"error"}),this.success=(e,t)=>this.create({...t,type:"success",message:e}),this.info=(e,t)=>this.create({...t,type:"info",message:e}),this.warning=(e,t)=>this.create({...t,type:"warning",message:e}),this.loading=(e,t)=>this.create({...t,type:"loading",message:e}),this.promise=(e,t)=>{if(!t)return;let n;t.loading!==void 0&&(n=this.create({...t,promise:e,type:"loading",message:t.loading,description:typeof t.description!="function"?t.description:void 0}));let r=e instanceof Promise?e:e(),a=n!==void 0,i,l=r.then(async c=>{if(i=["resolve",c],ye.isValidElement(c))a=!1,this.create({id:n,type:"default",message:c});else if(UW(c)&&!c.ok){a=!1;let f=typeof t.error=="function"?await t.error(`HTTP error! status: ${c.status}`):t.error,p=typeof t.description=="function"?await t.description(`HTTP error! status: ${c.status}`):t.description;this.create({id:n,type:"error",message:f,description:p})}else if(t.success!==void 0){a=!1;let f=typeof t.success=="function"?await t.success(c):t.success,p=typeof t.description=="function"?await t.description(c):t.description;this.create({id:n,type:"success",message:f,description:p})}}).catch(async c=>{if(i=["reject",c],t.error!==void 0){a=!1;let f=typeof t.error=="function"?await t.error(c):t.error,p=typeof t.description=="function"?await t.description(c):t.description;this.create({id:n,type:"error",message:f,description:p})}}).finally(()=>{var c;a&&(this.dismiss(n),n=void 0),(c=t.finally)==null||c.call(t)}),u=()=>new Promise((c,f)=>l.then(()=>i[0]==="reject"?f(i[1]):c(i[1])).catch(f));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)||Nx++;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}},Fn=new PW,BW=(e,t)=>{let n=(t==null?void 0:t.id)||Nx++;return Fn.addToast({title:e,...t,id:n}),n},UW=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",jW=BW,GW=()=>Fn.toasts,HW=()=>Fn.getActiveToasts(),vn=Object.assign(jW,{success:Fn.success,info:Fn.info,warning:Fn.warning,error:Fn.error,custom:Fn.custom,message:Fn.message,promise:Fn.promise,dismiss:Fn.dismiss,loading:Fn.loading},{getHistory:GW,getToasts:HW});function $W(e,{insertAt:t}={}){if(typeof document>"u")return;let n=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",t==="top"&&n.firstChild?n.insertBefore(r,n.firstChild):n.appendChild(r),r.styleSheet?r.styleSheet.cssText=e:r.appendChild(document.createTextNode(e))}$W(`: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 Hc(e){return e.label!==void 0}var qW=3,VW="32px",WW="16px",qR=4e3,YW=356,KW=14,XW=20,ZW=200;function Ar(...e){return e.filter(Boolean).join(" ")}function QW(e){let[t,n]=e.split("-"),r=[];return t&&r.push(t),n&&r.push(n),r}var JW=e=>{var t,n,r,a,i,l,u,c,f,p,g;let{invert:b,toast:m,unstyled:S,interacting:v,setHeights:A,visibleToasts:R,heights:x,index:_,toasts:C,expanded:N,removeToast:T,defaultRichColors:O,closeButton:z,style:I,cancelButtonStyle:M,actionButtonStyle:H,className:q="",descriptionClassName:U="",duration:W,position:Z,gap:j,loadingIcon:G,expandByDefault:P,classNames:X,icons:D,closeButtonAriaLabel:V="Close toast",pauseWhenPageIsHidden:B}=e,[L,Y]=ye.useState(null),[Q,se]=ye.useState(null),[re,le]=ye.useState(!1),[Ae,ae]=ye.useState(!1),[we,xe]=ye.useState(!1),[Ie,Ce]=ye.useState(!1),[Ee,J]=ye.useState(!1),[fe,ke]=ye.useState(0),[me,ve]=ye.useState(0),ie=ye.useRef(m.duration||W||qR),ze=ye.useRef(null),Pe=ye.useRef(null),he=_===0,Ne=_+1<=R,ee=m.type,ce=m.dismissible!==!1,Re=m.className||"",Fe=m.descriptionClassName||"",qe=ye.useMemo(()=>x.findIndex(Ye=>Ye.toastId===m.id)||0,[x,m.id]),mt=ye.useMemo(()=>{var Ye;return(Ye=m.closeButton)!=null?Ye:z},[m.closeButton,z]),St=ye.useMemo(()=>m.duration||W||qR,[m.duration,W]),pt=ye.useRef(0),Je=ye.useRef(0),wt=ye.useRef(0),rt=ye.useRef(null),[bt,Bt]=Z.split("-"),sn=ye.useMemo(()=>x.reduce((Ye,gt,_t)=>_t>=qe?Ye:Ye+gt.height,0),[x,qe]),Mt=zW(),er=m.invert||b,zr=ee==="loading";Je.current=ye.useMemo(()=>qe*j+sn,[qe,sn]),ye.useEffect(()=>{ie.current=St},[St]),ye.useEffect(()=>{le(!0)},[]),ye.useEffect(()=>{let Ye=Pe.current;if(Ye){let gt=Ye.getBoundingClientRect().height;return ve(gt),A(_t=>[{toastId:m.id,height:gt,position:m.position},..._t]),()=>A(_t=>_t.filter(Rn=>Rn.toastId!==m.id))}},[A,m.id]),ye.useLayoutEffect(()=>{if(!re)return;let Ye=Pe.current,gt=Ye.style.height;Ye.style.height="auto";let _t=Ye.getBoundingClientRect().height;Ye.style.height=gt,ve(_t),A(Rn=>Rn.find(kn=>kn.toastId===m.id)?Rn.map(kn=>kn.toastId===m.id?{...kn,height:_t}:kn):[{toastId:m.id,height:_t,position:m.position},...Rn])},[re,m.title,m.description,A,m.id]);let Kt=ye.useCallback(()=>{ae(!0),ke(Je.current),A(Ye=>Ye.filter(gt=>gt.toastId!==m.id)),setTimeout(()=>{T(m)},ZW)},[m,T,A,Je]);ye.useEffect(()=>{if(m.promise&&ee==="loading"||m.duration===1/0||m.type==="loading")return;let Ye;return N||v||B&&Mt?(()=>{if(wt.current{var gt;(gt=m.onAutoClose)==null||gt.call(m,m),Kt()},ie.current)),()=>clearTimeout(Ye)},[N,v,m,ee,B,Mt,Kt]),ye.useEffect(()=>{m.delete&&Kt()},[Kt,m.delete]);function na(){var Ye,gt,_t;return D!=null&&D.loading?ye.createElement("div",{className:Ar(X==null?void 0:X.loader,(Ye=m==null?void 0:m.classNames)==null?void 0:Ye.loader,"sonner-loader"),"data-visible":ee==="loading"},D.loading):G?ye.createElement("div",{className:Ar(X==null?void 0:X.loader,(gt=m==null?void 0:m.classNames)==null?void 0:gt.loader,"sonner-loader"),"data-visible":ee==="loading"},G):ye.createElement(OW,{className:Ar(X==null?void 0:X.loader,(_t=m==null?void 0:m.classNames)==null?void 0:_t.loader),visible:ee==="loading"})}return ye.createElement("li",{tabIndex:0,ref:Pe,className:Ar(q,Re,X==null?void 0:X.toast,(t=m==null?void 0:m.classNames)==null?void 0:t.toast,X==null?void 0:X.default,X==null?void 0:X[ee],(n=m==null?void 0:m.classNames)==null?void 0:n[ee]),"data-sonner-toast":"","data-rich-colors":(r=m.richColors)!=null?r:O,"data-styled":!(m.jsx||m.unstyled||S),"data-mounted":re,"data-promise":!!m.promise,"data-swiped":Ee,"data-removed":Ae,"data-visible":Ne,"data-y-position":bt,"data-x-position":Bt,"data-index":_,"data-front":he,"data-swiping":we,"data-dismissible":ce,"data-type":ee,"data-invert":er,"data-swipe-out":Ie,"data-swipe-direction":Q,"data-expanded":!!(N||P&&re),style:{"--index":_,"--toasts-before":_,"--z-index":C.length-_,"--offset":`${Ae?fe:Je.current}px`,"--initial-height":P?"auto":`${me}px`,...I,...m.style},onDragEnd:()=>{xe(!1),Y(null),rt.current=null},onPointerDown:Ye=>{zr||!ce||(ze.current=new Date,ke(Je.current),Ye.target.setPointerCapture(Ye.pointerId),Ye.target.tagName!=="BUTTON"&&(xe(!0),rt.current={x:Ye.clientX,y:Ye.clientY}))},onPointerUp:()=>{var Ye,gt,_t,Rn;if(Ie||!ce)return;rt.current=null;let kn=Number(((Ye=Pe.current)==null?void 0:Ye.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),Cn=Number(((gt=Pe.current)==null?void 0:gt.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),ra=new Date().getTime()-((_t=ze.current)==null?void 0:_t.getTime()),Nn=L==="x"?kn:Cn,Sr=Math.abs(Nn)/ra;if(Math.abs(Nn)>=XW||Sr>.11){ke(Je.current),(Rn=m.onDismiss)==null||Rn.call(m,m),se(L==="x"?kn>0?"right":"left":Cn>0?"down":"up"),Kt(),Ce(!0),J(!1);return}xe(!1),Y(null)},onPointerMove:Ye=>{var gt,_t,Rn,kn;if(!rt.current||!ce||((gt=window.getSelection())==null?void 0:gt.toString().length)>0)return;let Cn=Ye.clientY-rt.current.y,ra=Ye.clientX-rt.current.x,Nn=(_t=e.swipeDirections)!=null?_t:QW(Z);!L&&(Math.abs(ra)>1||Math.abs(Cn)>1)&&Y(Math.abs(ra)>Math.abs(Cn)?"x":"y");let Sr={x:0,y:0};L==="y"?(Nn.includes("top")||Nn.includes("bottom"))&&(Nn.includes("top")&&Cn<0||Nn.includes("bottom")&&Cn>0)&&(Sr.y=Cn):L==="x"&&(Nn.includes("left")||Nn.includes("right"))&&(Nn.includes("left")&&ra<0||Nn.includes("right")&&ra>0)&&(Sr.x=ra),(Math.abs(Sr.x)>0||Math.abs(Sr.y)>0)&&J(!0),(Rn=Pe.current)==null||Rn.style.setProperty("--swipe-amount-x",`${Sr.x}px`),(kn=Pe.current)==null||kn.style.setProperty("--swipe-amount-y",`${Sr.y}px`)}},mt&&!m.jsx?ye.createElement("button",{"aria-label":V,"data-disabled":zr,"data-close-button":!0,onClick:zr||!ce?()=>{}:()=>{var Ye;Kt(),(Ye=m.onDismiss)==null||Ye.call(m,m)},className:Ar(X==null?void 0:X.closeButton,(a=m==null?void 0:m.classNames)==null?void 0:a.closeButton)},(i=D==null?void 0:D.close)!=null?i:FW):null,m.jsx||k.isValidElement(m.title)?m.jsx?m.jsx:typeof m.title=="function"?m.title():m.title:ye.createElement(ye.Fragment,null,ee||m.icon||m.promise?ye.createElement("div",{"data-icon":"",className:Ar(X==null?void 0:X.icon,(l=m==null?void 0:m.classNames)==null?void 0:l.icon)},m.promise||m.type==="loading"&&!m.icon?m.icon||na():null,m.type!=="loading"?m.icon||(D==null?void 0:D[ee])||CW(ee):null):null,ye.createElement("div",{"data-content":"",className:Ar(X==null?void 0:X.content,(u=m==null?void 0:m.classNames)==null?void 0:u.content)},ye.createElement("div",{"data-title":"",className:Ar(X==null?void 0:X.title,(c=m==null?void 0:m.classNames)==null?void 0:c.title)},typeof m.title=="function"?m.title():m.title),m.description?ye.createElement("div",{"data-description":"",className:Ar(U,Fe,X==null?void 0:X.description,(f=m==null?void 0:m.classNames)==null?void 0:f.description)},typeof m.description=="function"?m.description():m.description):null),k.isValidElement(m.cancel)?m.cancel:m.cancel&&Hc(m.cancel)?ye.createElement("button",{"data-button":!0,"data-cancel":!0,style:m.cancelButtonStyle||M,onClick:Ye=>{var gt,_t;Hc(m.cancel)&&ce&&((_t=(gt=m.cancel).onClick)==null||_t.call(gt,Ye),Kt())},className:Ar(X==null?void 0:X.cancelButton,(p=m==null?void 0:m.classNames)==null?void 0:p.cancelButton)},m.cancel.label):null,k.isValidElement(m.action)?m.action:m.action&&Hc(m.action)?ye.createElement("button",{"data-button":!0,"data-action":!0,style:m.actionButtonStyle||H,onClick:Ye=>{var gt,_t;Hc(m.action)&&((_t=(gt=m.action).onClick)==null||_t.call(gt,Ye),!Ye.defaultPrevented&&Kt())},className:Ar(X==null?void 0:X.actionButton,(g=m==null?void 0:m.classNames)==null?void 0:g.actionButton)},m.action.label):null))};function VR(){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 eY(e,t){let n={};return[e,t].forEach((r,a)=>{let i=a===1,l=i?"--mobile-offset":"--offset",u=i?WW:VW;function c(f){["top","right","bottom","left"].forEach(p=>{n[`${l}-${p}`]=typeof f=="number"?`${f}px`:f})}typeof r=="number"||typeof r=="string"?c(r):typeof r=="object"?["top","right","bottom","left"].forEach(f=>{r[f]===void 0?n[`${l}-${f}`]=u:n[`${l}-${f}`]=typeof r[f]=="number"?`${r[f]}px`:r[f]}):c(u)}),n}var tY=k.forwardRef(function(e,t){let{invert:n,position:r="bottom-right",hotkey:a=["altKey","KeyT"],expand:i,closeButton:l,className:u,offset:c,mobileOffset:f,theme:p="light",richColors:g,duration:b,style:m,visibleToasts:S=qW,toastOptions:v,dir:A=VR(),gap:R=KW,loadingIcon:x,icons:_,containerAriaLabel:C="Notifications",pauseWhenPageIsHidden:N}=e,[T,O]=ye.useState([]),z=ye.useMemo(()=>Array.from(new Set([r].concat(T.filter(B=>B.position).map(B=>B.position)))),[T,r]),[I,M]=ye.useState([]),[H,q]=ye.useState(!1),[U,W]=ye.useState(!1),[Z,j]=ye.useState(p!=="system"?p:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),G=ye.useRef(null),P=a.join("+").replace(/Key/g,"").replace(/Digit/g,""),X=ye.useRef(null),D=ye.useRef(!1),V=ye.useCallback(B=>{O(L=>{var Y;return(Y=L.find(Q=>Q.id===B.id))!=null&&Y.delete||Fn.dismiss(B.id),L.filter(({id:Q})=>Q!==B.id)})},[]);return ye.useEffect(()=>Fn.subscribe(B=>{if(B.dismiss){O(L=>L.map(Y=>Y.id===B.id?{...Y,delete:!0}:Y));return}setTimeout(()=>{pP.flushSync(()=>{O(L=>{let Y=L.findIndex(Q=>Q.id===B.id);return Y!==-1?[...L.slice(0,Y),{...L[Y],...B},...L.slice(Y+1)]:[B,...L]})})})}),[]),ye.useEffect(()=>{if(p!=="system"){j(p);return}if(p==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?j("dark"):j("light")),typeof window>"u")return;let B=window.matchMedia("(prefers-color-scheme: dark)");try{B.addEventListener("change",({matches:L})=>{j(L?"dark":"light")})}catch{B.addListener(({matches:Y})=>{try{j(Y?"dark":"light")}catch(Q){console.error(Q)}})}},[p]),ye.useEffect(()=>{T.length<=1&&q(!1)},[T]),ye.useEffect(()=>{let B=L=>{var Y,Q;a.every(se=>L[se]||L.code===se)&&(q(!0),(Y=G.current)==null||Y.focus()),L.code==="Escape"&&(document.activeElement===G.current||(Q=G.current)!=null&&Q.contains(document.activeElement))&&q(!1)};return document.addEventListener("keydown",B),()=>document.removeEventListener("keydown",B)},[a]),ye.useEffect(()=>{if(G.current)return()=>{X.current&&(X.current.focus({preventScroll:!0}),X.current=null,D.current=!1)}},[G.current]),ye.createElement("section",{ref:t,"aria-label":`${C} ${P}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},z.map((B,L)=>{var Y;let[Q,se]=B.split("-");return T.length?ye.createElement("ol",{key:B,dir:A==="auto"?VR():A,tabIndex:-1,ref:G,className:u,"data-sonner-toaster":!0,"data-theme":Z,"data-y-position":Q,"data-lifted":H&&T.length>1&&!i,"data-x-position":se,style:{"--front-toast-height":`${((Y=I[0])==null?void 0:Y.height)||0}px`,"--width":`${YW}px`,"--gap":`${R}px`,...m,...eY(c,f)},onBlur:re=>{D.current&&!re.currentTarget.contains(re.relatedTarget)&&(D.current=!1,X.current&&(X.current.focus({preventScroll:!0}),X.current=null))},onFocus:re=>{re.target instanceof HTMLElement&&re.target.dataset.dismissible==="false"||D.current||(D.current=!0,X.current=re.relatedTarget)},onMouseEnter:()=>q(!0),onMouseMove:()=>q(!0),onMouseLeave:()=>{U||q(!1)},onDragEnd:()=>q(!1),onPointerDown:re=>{re.target instanceof HTMLElement&&re.target.dataset.dismissible==="false"||W(!0)},onPointerUp:()=>W(!1)},T.filter(re=>!re.position&&L===0||re.position===B).map((re,le)=>{var Ae,ae;return ye.createElement(JW,{key:re.id,icons:_,index:le,toast:re,defaultRichColors:g,duration:(Ae=v==null?void 0:v.duration)!=null?Ae:b,className:v==null?void 0:v.className,descriptionClassName:v==null?void 0:v.descriptionClassName,invert:n,visibleToasts:S,closeButton:(ae=v==null?void 0:v.closeButton)!=null?ae:l,interacting:U,position:B,style:v==null?void 0:v.style,unstyled:v==null?void 0:v.unstyled,classNames:v==null?void 0:v.classNames,cancelButtonStyle:v==null?void 0:v.cancelButtonStyle,actionButtonStyle:v==null?void 0:v.actionButtonStyle,removeToast:V,toasts:T.filter(we=>we.position==re.position),heights:I.filter(we=>we.position==re.position),setHeights:M,expandByDefault:i,gap:R,loadingIcon:x,expanded:H,pauseWhenPageIsHidden:N,swipeDirections:e.swipeDirections})})):null}))});const nY=()=>{const[e,t]=k.useState(!0),n=Ke.use.apiKey(),[r,a]=k.useState(""),i=Pn.use.message();k.useEffect(()=>{a(n||"")},[n,e]),k.useEffect(()=>{i&&(i.includes(oP)||i.includes(iP))&&t(!0)},[i,t]);const l=k.useCallback(async()=>{if(Ke.setState({apiKey:r||null}),await Pn.getState().check()){t(!1);return}vn.error("API Key is invalid")},[r]),u=k.useCallback(c=>{a(c.target.value)},[a]);return w.jsx(AW,{open:e,onOpenChange:t,children:w.jsxs(UB,{children:[w.jsxs(jB,{children:[w.jsx(GB,{children:"API Key is required"}),w.jsx(HB,{children:"Please enter your API key"})]}),w.jsxs("form",{className:"flex gap-2",onSubmit:c=>c.preventDefault(),children:[w.jsx(Eo,{type:"password",value:r,onChange:u,placeholder:"Enter your API key",className:"max-h-full w-full min-w-0",autoComplete:"off"}),w.jsx(Lt,{onClick:l,variant:"outline",size:"sm",children:"Save"})]})]})})};var a0="Popover",[$B,tve]=mr(a0,[Cl]),mu=Cl(),[rY,wo]=$B(a0),qB=e=>{const{__scopePopover:t,children:n,open:r,defaultOpen:a,onOpenChange:i,modal:l=!1}=e,u=mu(t),c=k.useRef(null),[f,p]=k.useState(!1),[g=!1,b]=Oa({prop:r,defaultProp:a,onChange:i});return w.jsx(Qk,{...u,children:w.jsx(rY,{scope:t,contentId:En(),triggerRef:c,open:g,onOpenChange:b,onOpenToggle:k.useCallback(()=>b(m=>!m),[b]),hasCustomAnchor:f,onCustomAnchorAdd:k.useCallback(()=>p(!0),[]),onCustomAnchorRemove:k.useCallback(()=>p(!1),[]),modal:l,children:n})})};qB.displayName=a0;var VB="PopoverAnchor",aY=k.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,a=wo(VB,n),i=mu(n),{onCustomAnchorAdd:l,onCustomAnchorRemove:u}=a;return k.useEffect(()=>(l(),()=>u()),[l,u]),w.jsx(vf,{...i,...r,ref:t})});aY.displayName=VB;var WB="PopoverTrigger",YB=k.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,a=wo(WB,n),i=mu(n),l=ft(t,a.triggerRef),u=w.jsx(Xe.button,{type:"button","aria-haspopup":"dialog","aria-expanded":a.open,"aria-controls":a.contentId,"data-state":JB(a.open),...r,ref:l,onClick:We(e.onClick,a.onOpenToggle)});return a.hasCustomAnchor?u:w.jsx(vf,{asChild:!0,...i,children:u})});YB.displayName=WB;var o0="PopoverPortal",[oY,iY]=$B(o0,{forceMount:void 0}),KB=e=>{const{__scopePopover:t,forceMount:n,children:r,container:a}=e,i=wo(o0,t);return w.jsx(oY,{scope:t,forceMount:n,children:w.jsx(Jn,{present:n||i.open,children:w.jsx(df,{asChild:!0,container:a,children:r})})})};KB.displayName=o0;var bl="PopoverContent",XB=k.forwardRef((e,t)=>{const n=iY(bl,e.__scopePopover),{forceMount:r=n.forceMount,...a}=e,i=wo(bl,e.__scopePopover);return w.jsx(Jn,{present:r||i.open,children:i.modal?w.jsx(lY,{...a,ref:t}):w.jsx(sY,{...a,ref:t})})});XB.displayName=bl;var lY=k.forwardRef((e,t)=>{const n=wo(bl,e.__scopePopover),r=k.useRef(null),a=ft(t,r),i=k.useRef(!1);return k.useEffect(()=>{const l=r.current;if(l)return Ik(l)},[]),w.jsx(pf,{as:bo,allowPinchZoom:!0,children:w.jsx(ZB,{...e,ref:a,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:We(e.onCloseAutoFocus,l=>{var u;l.preventDefault(),i.current||(u=n.triggerRef.current)==null||u.focus()}),onPointerDownOutside:We(e.onPointerDownOutside,l=>{const u=l.detail.originalEvent,c=u.button===0&&u.ctrlKey===!0,f=u.button===2||c;i.current=f},{checkForDefaultPrevented:!1}),onFocusOutside:We(e.onFocusOutside,l=>l.preventDefault(),{checkForDefaultPrevented:!1})})})}),sY=k.forwardRef((e,t)=>{const n=wo(bl,e.__scopePopover),r=k.useRef(!1),a=k.useRef(!1);return w.jsx(ZB,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var l,u;(l=e.onCloseAutoFocus)==null||l.call(e,i),i.defaultPrevented||(r.current||(u=n.triggerRef.current)==null||u.focus(),i.preventDefault()),r.current=!1,a.current=!1},onInteractOutside:i=>{var c,f;(c=e.onInteractOutside)==null||c.call(e,i),i.defaultPrevented||(r.current=!0,i.detail.originalEvent.type==="pointerdown"&&(a.current=!0));const l=i.target;((f=n.triggerRef.current)==null?void 0:f.contains(l))&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&a.current&&i.preventDefault()}})}),ZB=k.forwardRef((e,t)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:a,onCloseAutoFocus:i,disableOutsidePointerEvents:l,onEscapeKeyDown:u,onPointerDownOutside:c,onFocusOutside:f,onInteractOutside:p,...g}=e,b=wo(bl,n),m=mu(n);return Dk(),w.jsx(cf,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:a,onUnmountAutoFocus:i,children:w.jsx(gu,{asChild:!0,disableOutsidePointerEvents:l,onInteractOutside:p,onEscapeKeyDown:u,onPointerDownOutside:c,onFocusOutside:f,onDismiss:()=>b.onOpenChange(!1),children:w.jsx(Jk,{"data-state":JB(b.open),role:"dialog",id:b.contentId,...m,...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)"}})})})}),QB="PopoverClose",uY=k.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,a=wo(QB,n);return w.jsx(Xe.button,{type:"button",...r,ref:t,onClick:We(e.onClick,()=>a.onOpenChange(!1))})});uY.displayName=QB;var cY="PopoverArrow",dY=k.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,a=mu(n);return w.jsx(e0,{...a,...r,ref:t})});dY.displayName=cY;function JB(e){return e?"open":"closed"}var fY=qB,pY=YB,gY=KB,eU=XB;const kf=fY,Af=pY,bu=k.forwardRef(({className:e,align:t="center",sideOffset:n=4,...r},a)=>w.jsx(gY,{children:w.jsx(eU,{ref:a,align:t,sideOffset:n,className:Me("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 rounded-md border p-4 shadow-md outline-none",e),...r})}));bu.displayName=eU.displayName;const hY=({status:e})=>e?w.jsxs("div",{className:"min-w-[300px] space-y-3 text-sm",children:[w.jsxs("div",{className:"space-y-1",children:[w.jsx("h4",{className:"font-medium",children:"Storage Info"}),w.jsxs("div",{className:"text-muted-foreground grid grid-cols-2 gap-1",children:[w.jsx("span",{children:"Working Directory:"}),w.jsx("span",{className:"truncate",children:e.working_directory}),w.jsx("span",{children:"Input Directory:"}),w.jsx("span",{className:"truncate",children:e.input_directory})]})]}),w.jsxs("div",{className:"space-y-1",children:[w.jsx("h4",{className:"font-medium",children:"LLM Configuration"}),w.jsxs("div",{className:"text-muted-foreground grid grid-cols-2 gap-1",children:[w.jsx("span",{children:"LLM Binding:"}),w.jsx("span",{children:e.configuration.llm_binding}),w.jsx("span",{children:"LLM Binding Host:"}),w.jsx("span",{children:e.configuration.llm_binding_host}),w.jsx("span",{children:"LLM Model:"}),w.jsx("span",{children:e.configuration.llm_model}),w.jsx("span",{children:"Max Tokens:"}),w.jsx("span",{children:e.configuration.max_tokens})]})]}),w.jsxs("div",{className:"space-y-1",children:[w.jsx("h4",{className:"font-medium",children:"Embedding Configuration"}),w.jsxs("div",{className:"text-muted-foreground grid grid-cols-2 gap-1",children:[w.jsx("span",{children:"Embedding Binding:"}),w.jsx("span",{children:e.configuration.embedding_binding}),w.jsx("span",{children:"Embedding Binding Host:"}),w.jsx("span",{children:e.configuration.embedding_binding_host}),w.jsx("span",{children:"Embedding Model:"}),w.jsx("span",{children:e.configuration.embedding_model})]})]}),w.jsxs("div",{className:"space-y-1",children:[w.jsx("h4",{className:"font-medium",children:"Storage Configuration"}),w.jsxs("div",{className:"text-muted-foreground grid grid-cols-2 gap-1",children:[w.jsx("span",{children:"KV Storage:"}),w.jsx("span",{children:e.configuration.kv_storage}),w.jsx("span",{children:"Doc Status Storage:"}),w.jsx("span",{children:e.configuration.doc_status_storage}),w.jsx("span",{children:"Graph Storage:"}),w.jsx("span",{children:e.configuration.graph_storage}),w.jsx("span",{children:"Vector Storage:"}),w.jsx("span",{children:e.configuration.vector_storage})]})]})]}):w.jsx("div",{className:"text-muted-foreground text-sm",children:"Status information unavailable"}),mY=()=>{const e=Pn.use.health(),t=Pn.use.lastCheckTime(),n=Pn.use.status(),[r,a]=k.useState(!1);return k.useEffect(()=>{a(!0);const i=setTimeout(()=>a(!1),300);return()=>clearTimeout(i)},[t]),w.jsx("div",{className:"fixed right-4 bottom-4 flex items-center gap-2 opacity-80 select-none",children:w.jsxs(kf,{children:[w.jsx(Af,{asChild:!0,children:w.jsxs("div",{className:"flex cursor-help items-center gap-2",children:[w.jsx("div",{className:Me("h-3 w-3 rounded-full transition-all duration-300","shadow-[0_0_8px_rgba(0,0,0,0.2)]",e?"bg-green-500":"bg-red-500",r&&"scale-125",r&&e&&"shadow-[0_0_12px_rgba(34,197,94,0.4)]",r&&!e&&"shadow-[0_0_12px_rgba(239,68,68,0.4)]")}),w.jsx("span",{className:"text-muted-foreground text-xs",children:e?"Connected":"Disconnected"})]})}),w.jsx(bu,{className:"w-auto",side:"top",align:"end",children:w.jsx(hY,{status:n})})]})})},i0=()=>{const e=k.useContext(Cz);if(e===void 0)throw new Error("useTheme must be used within a ThemeProvider");return e};function bY(){const{theme:e,setTheme:t}=i0(),n=k.useCallback(()=>t("light"),[t]),r=k.useCallback(()=>t("dark"),[t]);return e==="dark"?w.jsx(Lt,{onClick:n,variant:Yr,tooltip:"Switch to light theme",size:"icon",side:"bottom",children:w.jsx(Kq,{})}):w.jsx(Lt,{onClick:r,variant:Yr,tooltip:"Switch to dark theme",size:"icon",side:"bottom",children:w.jsx(u8,{})})}function tU(e){const t=e+"CollectionProvider",[n,r]=mr(t),[a,i]=n(t,{collectionRef:{current:null},itemMap:new Map}),l=m=>{const{scope:S,children:v}=m,A=ye.useRef(null),R=ye.useRef(new Map).current;return w.jsx(a,{scope:S,itemMap:R,collectionRef:A,children:v})};l.displayName=t;const u=e+"CollectionSlot",c=ye.forwardRef((m,S)=>{const{scope:v,children:A}=m,R=i(u,v),x=ft(S,R.collectionRef);return w.jsx(bo,{ref:x,children:A})});c.displayName=u;const f=e+"CollectionItemSlot",p="data-radix-collection-item",g=ye.forwardRef((m,S)=>{const{scope:v,children:A,...R}=m,x=ye.useRef(null),_=ft(S,x),C=i(f,v);return ye.useEffect(()=>(C.itemMap.set(x,{ref:x,...R}),()=>void C.itemMap.delete(x))),w.jsx(bo,{[p]:"",ref:_,children:A})});g.displayName=f;function b(m){const S=i(e+"CollectionConsumer",m);return ye.useCallback(()=>{const A=S.collectionRef.current;if(!A)return[];const R=Array.from(A.querySelectorAll(`[${p}]`));return Array.from(S.itemMap.values()).sort((C,N)=>R.indexOf(C.ref.current)-R.indexOf(N.ref.current))},[S.collectionRef,S.itemMap])}return[{Provider:l,Slot:c,ItemSlot:g},b,r]}var yY=k.createContext(void 0);function Tf(e){const t=k.useContext(yY);return e||t||"ltr"}var wh="rovingFocusGroup.onEntryFocus",vY={bubbles:!1,cancelable:!0},_f="RovingFocusGroup",[Ox,nU,SY]=tU(_f),[EY,rU]=mr(_f,[SY]),[wY,xY]=EY(_f),aU=k.forwardRef((e,t)=>w.jsx(Ox.Provider,{scope:e.__scopeRovingFocusGroup,children:w.jsx(Ox.Slot,{scope:e.__scopeRovingFocusGroup,children:w.jsx(kY,{...e,ref:t})})}));aU.displayName=_f;var kY=k.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:a=!1,dir:i,currentTabStopId:l,defaultCurrentTabStopId:u,onCurrentTabStopIdChange:c,onEntryFocus:f,preventScrollOnEntryFocus:p=!1,...g}=e,b=k.useRef(null),m=ft(t,b),S=Tf(i),[v=null,A]=Oa({prop:l,defaultProp:u,onChange:c}),[R,x]=k.useState(!1),_=pn(f),C=nU(n),N=k.useRef(!1),[T,O]=k.useState(0);return k.useEffect(()=>{const z=b.current;if(z)return z.addEventListener(wh,_),()=>z.removeEventListener(wh,_)},[_]),w.jsx(wY,{scope:n,orientation:r,dir:S,loop:a,currentTabStopId:v,onItemFocus:k.useCallback(z=>A(z),[A]),onItemShiftTab:k.useCallback(()=>x(!0),[]),onFocusableItemAdd:k.useCallback(()=>O(z=>z+1),[]),onFocusableItemRemove:k.useCallback(()=>O(z=>z-1),[]),children:w.jsx(Xe.div,{tabIndex:R||T===0?-1:0,"data-orientation":r,...g,ref:m,style:{outline:"none",...e.style},onMouseDown:We(e.onMouseDown,()=>{N.current=!0}),onFocus:We(e.onFocus,z=>{const I=!N.current;if(z.target===z.currentTarget&&I&&!R){const M=new CustomEvent(wh,vY);if(z.currentTarget.dispatchEvent(M),!M.defaultPrevented){const H=C().filter(j=>j.focusable),q=H.find(j=>j.active),U=H.find(j=>j.id===v),Z=[q,U,...H].filter(Boolean).map(j=>j.ref.current);lU(Z,p)}}N.current=!1}),onBlur:We(e.onBlur,()=>x(!1))})})}),oU="RovingFocusGroupItem",iU=k.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:a=!1,tabStopId:i,...l}=e,u=En(),c=i||u,f=xY(oU,n),p=f.currentTabStopId===c,g=nU(n),{onFocusableItemAdd:b,onFocusableItemRemove:m}=f;return k.useEffect(()=>{if(r)return b(),()=>m()},[r,b,m]),w.jsx(Ox.ItemSlot,{scope:n,id:c,focusable:r,active:a,children:w.jsx(Xe.span,{tabIndex:p?0:-1,"data-orientation":f.orientation,...l,ref:t,onMouseDown:We(e.onMouseDown,S=>{r?f.onItemFocus(c):S.preventDefault()}),onFocus:We(e.onFocus,()=>f.onItemFocus(c)),onKeyDown:We(e.onKeyDown,S=>{if(S.key==="Tab"&&S.shiftKey){f.onItemShiftTab();return}if(S.target!==S.currentTarget)return;const v=_Y(S,f.orientation,f.dir);if(v!==void 0){if(S.metaKey||S.ctrlKey||S.altKey||S.shiftKey)return;S.preventDefault();let R=g().filter(x=>x.focusable).map(x=>x.ref.current);if(v==="last")R.reverse();else if(v==="prev"||v==="next"){v==="prev"&&R.reverse();const x=R.indexOf(S.currentTarget);R=f.loop?RY(R,x+1):R.slice(x+1)}setTimeout(()=>lU(R))}})})})});iU.displayName=oU;var AY={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function TY(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function _Y(e,t,n){const r=TY(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return AY[r]}function lU(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function RY(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var CY=aU,NY=iU,l0="Tabs",[OY,nve]=mr(l0,[rU]),sU=rU(),[DY,s0]=OY(l0),uU=k.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:a,defaultValue:i,orientation:l="horizontal",dir:u,activationMode:c="automatic",...f}=e,p=Tf(u),[g,b]=Oa({prop:r,onChange:a,defaultProp:i});return w.jsx(DY,{scope:n,baseId:En(),value:g,onValueChange:b,orientation:l,dir:p,activationMode:c,children:w.jsx(Xe.div,{dir:p,"data-orientation":l,...f,ref:t})})});uU.displayName=l0;var cU="TabsList",dU=k.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...a}=e,i=s0(cU,n),l=sU(n);return w.jsx(CY,{asChild:!0,...l,orientation:i.orientation,dir:i.dir,loop:r,children:w.jsx(Xe.div,{role:"tablist","aria-orientation":i.orientation,...a,ref:t})})});dU.displayName=cU;var fU="TabsTrigger",pU=k.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:a=!1,...i}=e,l=s0(fU,n),u=sU(n),c=mU(l.baseId,r),f=bU(l.baseId,r),p=r===l.value;return w.jsx(NY,{asChild:!0,...u,focusable:!a,active:p,children:w.jsx(Xe.button,{type:"button",role:"tab","aria-selected":p,"aria-controls":f,"data-state":p?"active":"inactive","data-disabled":a?"":void 0,disabled:a,id:c,...i,ref:t,onMouseDown:We(e.onMouseDown,g=>{!a&&g.button===0&&g.ctrlKey===!1?l.onValueChange(r):g.preventDefault()}),onKeyDown:We(e.onKeyDown,g=>{[" ","Enter"].includes(g.key)&&l.onValueChange(r)}),onFocus:We(e.onFocus,()=>{const g=l.activationMode!=="manual";!p&&!a&&g&&l.onValueChange(r)})})})});pU.displayName=fU;var gU="TabsContent",hU=k.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:a,children:i,...l}=e,u=s0(gU,n),c=mU(u.baseId,r),f=bU(u.baseId,r),p=r===u.value,g=k.useRef(p);return k.useEffect(()=>{const b=requestAnimationFrame(()=>g.current=!1);return()=>cancelAnimationFrame(b)},[]),w.jsx(Jn,{present:a||p,children:({present:b})=>w.jsx(Xe.div,{"data-state":p?"active":"inactive","data-orientation":u.orientation,role:"tabpanel","aria-labelledby":c,hidden:!b,id:f,tabIndex:0,...l,ref:t,style:{...e.style,animationDuration:g.current?"0s":void 0},children:b&&i})})});hU.displayName=gU;function mU(e,t){return`${e}-trigger-${t}`}function bU(e,t){return`${e}-content-${t}`}var IY=uU,yU=dU,vU=pU,SU=hU;const LY=IY,EU=k.forwardRef(({className:e,...t},n)=>w.jsx(yU,{ref:n,className:Me("bg-muted text-muted-foreground inline-flex h-10 items-center justify-center rounded-md p-1",e),...t}));EU.displayName=yU.displayName;const wU=k.forwardRef(({className:e,...t},n)=>w.jsx(vU,{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}));wU.displayName=vU.displayName;const qs=k.forwardRef(({className:e,...t},n)=>w.jsx(SU,{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}));qs.displayName=SU.displayName;function $c({value:e,currentTab:t,children:n}){return w.jsx(wU,{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 MY(){const e=Ke.use.currentTab();return w.jsx("div",{className:"flex h-8 self-center",children:w.jsxs(EU,{className:"h-full gap-2",children:[w.jsx($c,{value:"documents",currentTab:e,children:"Documents"}),w.jsx($c,{value:"knowledge-graph",currentTab:e,children:"Knowledge Graph"}),w.jsx($c,{value:"retrieval",currentTab:e,children:"Retrieval"}),w.jsx($c,{value:"api",currentTab:e,children:"API"})]})})}function FY(){return w.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:[w.jsxs("a",{href:"/",className:"mr-6 flex items-center gap-2",children:[w.jsx(p8,{className:"size-4 text-emerald-400","aria-hidden":"true"}),w.jsx("span",{className:"font-bold md:inline-block",children:lR.name})]}),w.jsx("div",{className:"flex h-10 flex-1 justify-center",children:w.jsx(MY,{})}),w.jsxs("nav",{className:"flex items-center",children:[w.jsx(Lt,{variant:"ghost",size:"icon",side:"bottom",tooltip:"Project Repository",children:w.jsx("a",{href:lR.github,target:"_blank",rel:"noopener noreferrer",children:w.jsx(Pq,{className:"size-4","aria-hidden":"true"})})}),w.jsx(bY,{})]})]})}var qc={exports:{}},WR;function zY(){if(WR)return qc.exports;WR=1;var e=typeof Reflect=="object"?Reflect:null,t=e&&typeof e.apply=="function"?e.apply:function(N,T,O){return Function.prototype.apply.call(N,T,O)},n;e&&typeof e.ownKeys=="function"?n=e.ownKeys:Object.getOwnPropertySymbols?n=function(N){return Object.getOwnPropertyNames(N).concat(Object.getOwnPropertySymbols(N))}:n=function(N){return Object.getOwnPropertyNames(N)};function r(C){console&&console.warn&&console.warn(C)}var a=Number.isNaN||function(N){return N!==N};function i(){i.init.call(this)}qc.exports=i,qc.exports.once=R,i.EventEmitter=i,i.prototype._events=void 0,i.prototype._eventsCount=0,i.prototype._maxListeners=void 0;var l=10;function u(C){if(typeof C!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof C)}Object.defineProperty(i,"defaultMaxListeners",{enumerable:!0,get:function(){return l},set:function(C){if(typeof C!="number"||C<0||a(C))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+C+".");l=C}}),i.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},i.prototype.setMaxListeners=function(N){if(typeof N!="number"||N<0||a(N))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+N+".");return this._maxListeners=N,this};function c(C){return C._maxListeners===void 0?i.defaultMaxListeners:C._maxListeners}i.prototype.getMaxListeners=function(){return c(this)},i.prototype.emit=function(N){for(var T=[],O=1;O0&&(M=T[0]),M instanceof Error)throw M;var H=new Error("Unhandled error."+(M?" ("+M.message+")":""));throw H.context=M,H}var q=I[N];if(q===void 0)return!1;if(typeof q=="function")t(q,this,T);else for(var U=q.length,W=S(q,U),O=0;O0&&M.length>z&&!M.warned){M.warned=!0;var H=new Error("Possible EventEmitter memory leak detected. "+M.length+" "+String(N)+" listeners added. Use emitter.setMaxListeners() to increase limit");H.name="MaxListenersExceededWarning",H.emitter=C,H.type=N,H.count=M.length,r(H)}return C}i.prototype.addListener=function(N,T){return f(this,N,T,!1)},i.prototype.on=i.prototype.addListener,i.prototype.prependListener=function(N,T){return f(this,N,T,!0)};function p(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function g(C,N,T){var O={fired:!1,wrapFn:void 0,target:C,type:N,listener:T},z=p.bind(O);return z.listener=T,O.wrapFn=z,z}i.prototype.once=function(N,T){return u(T),this.on(N,g(this,N,T)),this},i.prototype.prependOnceListener=function(N,T){return u(T),this.prependListener(N,g(this,N,T)),this},i.prototype.removeListener=function(N,T){var O,z,I,M,H;if(u(T),z=this._events,z===void 0)return this;if(O=z[N],O===void 0)return this;if(O===T||O.listener===T)--this._eventsCount===0?this._events=Object.create(null):(delete z[N],z.removeListener&&this.emit("removeListener",N,O.listener||T));else if(typeof O!="function"){for(I=-1,M=O.length-1;M>=0;M--)if(O[M]===T||O[M].listener===T){H=O[M].listener,I=M;break}if(I<0)return this;I===0?O.shift():v(O,I),O.length===1&&(z[N]=O[0]),z.removeListener!==void 0&&this.emit("removeListener",N,H||T)}return this},i.prototype.off=i.prototype.removeListener,i.prototype.removeAllListeners=function(N){var T,O,z;if(O=this._events,O===void 0)return this;if(O.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):O[N]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete O[N]),this;if(arguments.length===0){var I=Object.keys(O),M;for(z=0;z=0;z--)this.removeListener(N,T[z]);return this};function b(C,N,T){var O=C._events;if(O===void 0)return[];var z=O[N];return z===void 0?[]:typeof z=="function"?T?[z.listener||z]:[z]:T?A(z):S(z,z.length)}i.prototype.listeners=function(N){return b(this,N,!0)},i.prototype.rawListeners=function(N){return b(this,N,!1)},i.listenerCount=function(C,N){return typeof C.listenerCount=="function"?C.listenerCount(N):m.call(C,N)},i.prototype.listenerCount=m;function m(C){var N=this._events;if(N!==void 0){var T=N[C];if(typeof T=="function")return 1;if(T!==void 0)return T.length}return 0}i.prototype.eventNames=function(){return this._eventsCount>0?n(this._events):[]};function S(C,N){for(var T=new Array(N),O=0;Oe++}function Na(){const e=arguments;let t=null,n=-1;return{[Symbol.iterator](){return this},next(){let r=null;do{if(t===null){if(n++,n>=e.length)return{done:!0};t=e[n][Symbol.iterator]()}if(r=t.next(),r.done){t=null;continue}break}while(!0);return r}}}function Nl(){return{[Symbol.iterator](){return this},next(){return{done:!0}}}}class u0 extends Error{constructor(t){super(),this.name="GraphError",this.message=t}}class Le extends u0{constructor(t){super(t),this.name="InvalidArgumentsGraphError",typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,Le.prototype.constructor)}}class De extends u0{constructor(t){super(t),this.name="NotFoundGraphError",typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,De.prototype.constructor)}}class Ze extends u0{constructor(t){super(t),this.name="UsageGraphError",typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,Ze.prototype.constructor)}}function AU(e,t){this.key=e,this.attributes=t,this.clear()}AU.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 TU(e,t){this.key=e,this.attributes=t,this.clear()}TU.prototype.clear=function(){this.inDegree=0,this.outDegree=0,this.directedLoops=0,this.in={},this.out={}};function _U(e,t){this.key=e,this.attributes=t,this.clear()}_U.prototype.clear=function(){this.undirectedDegree=0,this.undirectedLoops=0,this.undirected={}};function Ol(e,t,n,r,a){this.key=t,this.attributes=a,this.undirected=e,this.source=n,this.target=r}Ol.prototype.attach=function(){let e="out",t="in";this.undirected&&(e=t="undirected");const n=this.source.key,r=this.target.key;this.source[e][r]=this,!(this.undirected&&n===r)&&(this.target[t][n]=this)};Ol.prototype.attachMulti=function(){let e="out",t="in";const n=this.source.key,r=this.target.key;this.undirected&&(e=t="undirected");const a=this.source[e],i=a[r];if(typeof i>"u"){a[r]=this,this.undirected&&n===r||(this.target[t][n]=this);return}i.previous=this,this.next=i,a[r]=this,this.target[t][n]=this};Ol.prototype.detach=function(){const e=this.source.key,t=this.target.key;let n="out",r="in";this.undirected&&(n=r="undirected"),delete this.source[n][t],delete this.target[r][e]};Ol.prototype.detachMulti=function(){const e=this.source.key,t=this.target.key;let n="out",r="in";this.undirected&&(n=r="undirected"),this.previous===void 0?this.next===void 0?(delete this.source[n][t],delete this.target[r][e]):(this.next.previous=void 0,this.source[n][t]=this.next,this.target[r][e]=this.next):(this.previous.next=this.next,this.next!==void 0&&(this.next.previous=this.previous))};const RU=0,CU=1,UY=2,NU=3;function Ma(e,t,n,r,a,i,l){let u,c,f,p;if(r=""+r,n===RU){if(u=e._nodes.get(r),!u)throw new De(`Graph.${t}: could not find the "${r}" node in the graph.`);f=a,p=i}else if(n===NU){if(a=""+a,c=e._edges.get(a),!c)throw new De(`Graph.${t}: could not find the "${a}" edge in the graph.`);const g=c.source.key,b=c.target.key;if(r===g)u=c.target;else if(r===b)u=c.source;else throw new De(`Graph.${t}: the "${r}" node is not attached to the "${a}" edge (${g}, ${b}).`);f=i,p=l}else{if(c=e._edges.get(r),!c)throw new De(`Graph.${t}: could not find the "${r}" edge in the graph.`);n===CU?u=c.source:u=c.target,f=a,p=i}return[u,f,p]}function jY(e,t,n){e.prototype[t]=function(r,a,i){const[l,u]=Ma(this,t,n,r,a,i);return l.attributes[u]}}function GY(e,t,n){e.prototype[t]=function(r,a){const[i]=Ma(this,t,n,r,a);return i.attributes}}function HY(e,t,n){e.prototype[t]=function(r,a,i){const[l,u]=Ma(this,t,n,r,a,i);return l.attributes.hasOwnProperty(u)}}function $Y(e,t,n){e.prototype[t]=function(r,a,i,l){const[u,c,f]=Ma(this,t,n,r,a,i,l);return u.attributes[c]=f,this.emit("nodeAttributesUpdated",{key:u.key,type:"set",attributes:u.attributes,name:c}),this}}function qY(e,t,n){e.prototype[t]=function(r,a,i,l){const[u,c,f]=Ma(this,t,n,r,a,i,l);if(typeof f!="function")throw new Le(`Graph.${t}: updater should be a function.`);const p=u.attributes,g=f(p[c]);return p[c]=g,this.emit("nodeAttributesUpdated",{key:u.key,type:"set",attributes:u.attributes,name:c}),this}}function VY(e,t,n){e.prototype[t]=function(r,a,i){const[l,u]=Ma(this,t,n,r,a,i);return delete l.attributes[u],this.emit("nodeAttributesUpdated",{key:l.key,type:"remove",attributes:l.attributes,name:u}),this}}function WY(e,t,n){e.prototype[t]=function(r,a,i){const[l,u]=Ma(this,t,n,r,a,i);if(!gn(u))throw new Le(`Graph.${t}: provided attributes are not a plain object.`);return l.attributes=u,this.emit("nodeAttributesUpdated",{key:l.key,type:"replace",attributes:l.attributes}),this}}function YY(e,t,n){e.prototype[t]=function(r,a,i){const[l,u]=Ma(this,t,n,r,a,i);if(!gn(u))throw new Le(`Graph.${t}: provided attributes are not a plain object.`);return Qt(l.attributes,u),this.emit("nodeAttributesUpdated",{key:l.key,type:"merge",attributes:l.attributes,data:u}),this}}function KY(e,t,n){e.prototype[t]=function(r,a,i){const[l,u]=Ma(this,t,n,r,a,i);if(typeof u!="function")throw new Le(`Graph.${t}: provided updater is not a function.`);return l.attributes=u(l.attributes),this.emit("nodeAttributesUpdated",{key:l.key,type:"update",attributes:l.attributes}),this}}const XY=[{name:e=>`get${e}Attribute`,attacher:jY},{name:e=>`get${e}Attributes`,attacher:GY},{name:e=>`has${e}Attribute`,attacher:HY},{name:e=>`set${e}Attribute`,attacher:$Y},{name:e=>`update${e}Attribute`,attacher:qY},{name:e=>`remove${e}Attribute`,attacher:VY},{name:e=>`replace${e}Attributes`,attacher:WY},{name:e=>`merge${e}Attributes`,attacher:YY},{name:e=>`update${e}Attributes`,attacher:KY}];function ZY(e){XY.forEach(function({name:t,attacher:n}){n(e,t("Node"),RU),n(e,t("Source"),CU),n(e,t("Target"),UY),n(e,t("Opposite"),NU)})}function QY(e,t,n){e.prototype[t]=function(r,a){let i;if(this.type!=="mixed"&&n!=="mixed"&&n!==this.type)throw new Ze(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new Ze(`Graph.${t}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const l=""+r,u=""+a;if(a=arguments[2],i=hr(this,l,u,n),!i)throw new De(`Graph.${t}: could not find an edge for the given path ("${l}" - "${u}").`)}else{if(n!=="mixed")throw new Ze(`Graph.${t}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(r=""+r,i=this._edges.get(r),!i)throw new De(`Graph.${t}: could not find the "${r}" edge in the graph.`)}return i.attributes[a]}}function JY(e,t,n){e.prototype[t]=function(r){let a;if(this.type!=="mixed"&&n!=="mixed"&&n!==this.type)throw new Ze(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>1){if(this.multi)throw new Ze(`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 i=""+r,l=""+arguments[1];if(a=hr(this,i,l,n),!a)throw new De(`Graph.${t}: could not find an edge for the given path ("${i}" - "${l}").`)}else{if(n!=="mixed")throw new Ze(`Graph.${t}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(r=""+r,a=this._edges.get(r),!a)throw new De(`Graph.${t}: could not find the "${r}" edge in the graph.`)}return a.attributes}}function eK(e,t,n){e.prototype[t]=function(r,a){let i;if(this.type!=="mixed"&&n!=="mixed"&&n!==this.type)throw new Ze(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new Ze(`Graph.${t}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const l=""+r,u=""+a;if(a=arguments[2],i=hr(this,l,u,n),!i)throw new De(`Graph.${t}: could not find an edge for the given path ("${l}" - "${u}").`)}else{if(n!=="mixed")throw new Ze(`Graph.${t}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(r=""+r,i=this._edges.get(r),!i)throw new De(`Graph.${t}: could not find the "${r}" edge in the graph.`)}return i.attributes.hasOwnProperty(a)}}function tK(e,t,n){e.prototype[t]=function(r,a,i){let l;if(this.type!=="mixed"&&n!=="mixed"&&n!==this.type)throw new Ze(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>3){if(this.multi)throw new Ze(`Graph.${t}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const u=""+r,c=""+a;if(a=arguments[2],i=arguments[3],l=hr(this,u,c,n),!l)throw new De(`Graph.${t}: could not find an edge for the given path ("${u}" - "${c}").`)}else{if(n!=="mixed")throw new Ze(`Graph.${t}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(r=""+r,l=this._edges.get(r),!l)throw new De(`Graph.${t}: could not find the "${r}" edge in the graph.`)}return l.attributes[a]=i,this.emit("edgeAttributesUpdated",{key:l.key,type:"set",attributes:l.attributes,name:a}),this}}function nK(e,t,n){e.prototype[t]=function(r,a,i){let l;if(this.type!=="mixed"&&n!=="mixed"&&n!==this.type)throw new Ze(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>3){if(this.multi)throw new Ze(`Graph.${t}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const u=""+r,c=""+a;if(a=arguments[2],i=arguments[3],l=hr(this,u,c,n),!l)throw new De(`Graph.${t}: could not find an edge for the given path ("${u}" - "${c}").`)}else{if(n!=="mixed")throw new Ze(`Graph.${t}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(r=""+r,l=this._edges.get(r),!l)throw new De(`Graph.${t}: could not find the "${r}" edge in the graph.`)}if(typeof i!="function")throw new Le(`Graph.${t}: updater should be a function.`);return l.attributes[a]=i(l.attributes[a]),this.emit("edgeAttributesUpdated",{key:l.key,type:"set",attributes:l.attributes,name:a}),this}}function rK(e,t,n){e.prototype[t]=function(r,a){let i;if(this.type!=="mixed"&&n!=="mixed"&&n!==this.type)throw new Ze(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new Ze(`Graph.${t}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const l=""+r,u=""+a;if(a=arguments[2],i=hr(this,l,u,n),!i)throw new De(`Graph.${t}: could not find an edge for the given path ("${l}" - "${u}").`)}else{if(n!=="mixed")throw new Ze(`Graph.${t}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(r=""+r,i=this._edges.get(r),!i)throw new De(`Graph.${t}: could not find the "${r}" edge in the graph.`)}return delete i.attributes[a],this.emit("edgeAttributesUpdated",{key:i.key,type:"remove",attributes:i.attributes,name:a}),this}}function aK(e,t,n){e.prototype[t]=function(r,a){let i;if(this.type!=="mixed"&&n!=="mixed"&&n!==this.type)throw new Ze(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new Ze(`Graph.${t}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const l=""+r,u=""+a;if(a=arguments[2],i=hr(this,l,u,n),!i)throw new De(`Graph.${t}: could not find an edge for the given path ("${l}" - "${u}").`)}else{if(n!=="mixed")throw new Ze(`Graph.${t}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(r=""+r,i=this._edges.get(r),!i)throw new De(`Graph.${t}: could not find the "${r}" edge in the graph.`)}if(!gn(a))throw new Le(`Graph.${t}: provided attributes are not a plain object.`);return i.attributes=a,this.emit("edgeAttributesUpdated",{key:i.key,type:"replace",attributes:i.attributes}),this}}function oK(e,t,n){e.prototype[t]=function(r,a){let i;if(this.type!=="mixed"&&n!=="mixed"&&n!==this.type)throw new Ze(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new Ze(`Graph.${t}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const l=""+r,u=""+a;if(a=arguments[2],i=hr(this,l,u,n),!i)throw new De(`Graph.${t}: could not find an edge for the given path ("${l}" - "${u}").`)}else{if(n!=="mixed")throw new Ze(`Graph.${t}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(r=""+r,i=this._edges.get(r),!i)throw new De(`Graph.${t}: could not find the "${r}" edge in the graph.`)}if(!gn(a))throw new Le(`Graph.${t}: provided attributes are not a plain object.`);return Qt(i.attributes,a),this.emit("edgeAttributesUpdated",{key:i.key,type:"merge",attributes:i.attributes,data:a}),this}}function iK(e,t,n){e.prototype[t]=function(r,a){let i;if(this.type!=="mixed"&&n!=="mixed"&&n!==this.type)throw new Ze(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new Ze(`Graph.${t}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const l=""+r,u=""+a;if(a=arguments[2],i=hr(this,l,u,n),!i)throw new De(`Graph.${t}: could not find an edge for the given path ("${l}" - "${u}").`)}else{if(n!=="mixed")throw new Ze(`Graph.${t}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(r=""+r,i=this._edges.get(r),!i)throw new De(`Graph.${t}: could not find the "${r}" edge in the graph.`)}if(typeof a!="function")throw new Le(`Graph.${t}: provided updater is not a function.`);return i.attributes=a(i.attributes),this.emit("edgeAttributesUpdated",{key:i.key,type:"update",attributes:i.attributes}),this}}const lK=[{name:e=>`get${e}Attribute`,attacher:QY},{name:e=>`get${e}Attributes`,attacher:JY},{name:e=>`has${e}Attribute`,attacher:eK},{name:e=>`set${e}Attribute`,attacher:tK},{name:e=>`update${e}Attribute`,attacher:nK},{name:e=>`remove${e}Attribute`,attacher:rK},{name:e=>`replace${e}Attributes`,attacher:aK},{name:e=>`merge${e}Attributes`,attacher:oK},{name:e=>`update${e}Attributes`,attacher:iK}];function sK(e){lK.forEach(function({name:t,attacher:n}){n(e,t("Edge"),"mixed"),n(e,t("DirectedEdge"),"directed"),n(e,t("UndirectedEdge"),"undirected")})}const uK=[{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 cK(e,t,n,r){let a=!1;for(const i in t){if(i===r)continue;const l=t[i];if(a=n(l.key,l.attributes,l.source.key,l.target.key,l.source.attributes,l.target.attributes,l.undirected),e&&a)return l.key}}function dK(e,t,n,r){let a,i,l,u=!1;for(const c in t)if(c!==r){a=t[c];do{if(i=a.source,l=a.target,u=n(a.key,a.attributes,i.key,l.key,i.attributes,l.attributes,a.undirected),e&&u)return a.key;a=a.next}while(a!==void 0)}}function xh(e,t){const n=Object.keys(e),r=n.length;let a,i=0;return{[Symbol.iterator](){return this},next(){do if(a)a=a.next;else{if(i>=r)return{done:!0};const l=n[i++];if(l===t){a=void 0;continue}a=e[l]}while(!a);return{done:!1,value:{edge:a.key,attributes:a.attributes,source:a.source.key,target:a.target.key,sourceAttributes:a.source.attributes,targetAttributes:a.target.attributes,undirected:a.undirected}}}}}function fK(e,t,n,r){const a=t[n];if(!a)return;const i=a.source,l=a.target;if(r(a.key,a.attributes,i.key,l.key,i.attributes,l.attributes,a.undirected)&&e)return a.key}function pK(e,t,n,r){let a=t[n];if(!a)return;let i=!1;do{if(i=r(a.key,a.attributes,a.source.key,a.target.key,a.source.attributes,a.target.attributes,a.undirected),e&&i)return a.key;a=a.next}while(a!==void 0)}function kh(e,t){let n=e[t];if(n.next!==void 0)return{[Symbol.iterator](){return this},next(){if(!n)return{done:!0};const a={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:a}}};let r=!1;return{[Symbol.iterator](){return this},next(){return r===!0?{done:!0}:(r=!0,{done:!1,value:{edge:n.key,attributes:n.attributes,source:n.source.key,target:n.target.key,sourceAttributes:n.source.attributes,targetAttributes:n.target.attributes,undirected:n.undirected}})}}}function gK(e,t){if(e.size===0)return[];if(t==="mixed"||t===e.type)return Array.from(e._edges.keys());const n=t==="undirected"?e.undirectedSize:e.directedSize,r=new Array(n),a=t==="undirected",i=e._edges.values();let l=0,u,c;for(;u=i.next(),u.done!==!0;)c=u.value,c.undirected===a&&(r[l++]=c.key);return r}function OU(e,t,n,r){if(t.size===0)return;const a=n!=="mixed"&&n!==t.type,i=n==="undirected";let l,u,c=!1;const f=t._edges.values();for(;l=f.next(),l.done!==!0;){if(u=l.value,a&&u.undirected!==i)continue;const{key:p,attributes:g,source:b,target:m}=u;if(c=r(p,g,b.key,m.key,b.attributes,m.attributes,u.undirected),e&&c)return p}}function hK(e,t){if(e.size===0)return Nl();const n=t!=="mixed"&&t!==e.type,r=t==="undirected",a=e._edges.values();return{[Symbol.iterator](){return this},next(){let i,l;for(;;){if(i=a.next(),i.done)return i;if(l=i.value,!(n&&l.undirected!==r))break}return{value:{edge:l.key,attributes:l.attributes,source:l.source.key,target:l.target.key,sourceAttributes:l.source.attributes,targetAttributes:l.target.attributes,undirected:l.undirected},done:!1}}}}function c0(e,t,n,r,a,i){const l=t?dK:cK;let u;if(n!=="undirected"&&(r!=="out"&&(u=l(e,a.in,i),e&&u)||r!=="in"&&(u=l(e,a.out,i,r?void 0:a.key),e&&u))||n!=="directed"&&(u=l(e,a.undirected,i),e&&u))return u}function mK(e,t,n,r){const a=[];return c0(!1,e,t,n,r,function(i){a.push(i)}),a}function bK(e,t,n){let r=Nl();return e!=="undirected"&&(t!=="out"&&typeof n.in<"u"&&(r=Na(r,xh(n.in))),t!=="in"&&typeof n.out<"u"&&(r=Na(r,xh(n.out,t?void 0:n.key)))),e!=="directed"&&typeof n.undirected<"u"&&(r=Na(r,xh(n.undirected))),r}function d0(e,t,n,r,a,i,l){const u=n?pK:fK;let c;if(t!=="undirected"&&(typeof a.in<"u"&&r!=="out"&&(c=u(e,a.in,i,l),e&&c)||typeof a.out<"u"&&r!=="in"&&(r||a.key!==i)&&(c=u(e,a.out,i,l),e&&c))||t!=="directed"&&typeof a.undirected<"u"&&(c=u(e,a.undirected,i,l),e&&c))return c}function yK(e,t,n,r,a){const i=[];return d0(!1,e,t,n,r,a,function(l){i.push(l)}),i}function vK(e,t,n,r){let a=Nl();return e!=="undirected"&&(typeof n.in<"u"&&t!=="out"&&r in n.in&&(a=Na(a,kh(n.in,r))),typeof n.out<"u"&&t!=="in"&&r in n.out&&(t||n.key!==r)&&(a=Na(a,kh(n.out,r)))),e!=="directed"&&typeof n.undirected<"u"&&r in n.undirected&&(a=Na(a,kh(n.undirected,r))),a}function SK(e,t){const{name:n,type:r,direction:a}=t;e.prototype[n]=function(i,l){if(r!=="mixed"&&this.type!=="mixed"&&r!==this.type)return[];if(!arguments.length)return gK(this,r);if(arguments.length===1){i=""+i;const u=this._nodes.get(i);if(typeof u>"u")throw new De(`Graph.${n}: could not find the "${i}" node in the graph.`);return mK(this.multi,r==="mixed"?this.type:r,a,u)}if(arguments.length===2){i=""+i,l=""+l;const u=this._nodes.get(i);if(!u)throw new De(`Graph.${n}: could not find the "${i}" source node in the graph.`);if(!this._nodes.has(l))throw new De(`Graph.${n}: could not find the "${l}" target node in the graph.`);return yK(r,this.multi,a,u,l)}throw new Le(`Graph.${n}: too many arguments (expecting 0, 1 or 2 and got ${arguments.length}).`)}}function EK(e,t){const{name:n,type:r,direction:a}=t,i="forEach"+n[0].toUpperCase()+n.slice(1,-1);e.prototype[i]=function(f,p,g){if(!(r!=="mixed"&&this.type!=="mixed"&&r!==this.type)){if(arguments.length===1)return g=f,OU(!1,this,r,g);if(arguments.length===2){f=""+f,g=p;const b=this._nodes.get(f);if(typeof b>"u")throw new De(`Graph.${i}: could not find the "${f}" node in the graph.`);return c0(!1,this.multi,r==="mixed"?this.type:r,a,b,g)}if(arguments.length===3){f=""+f,p=""+p;const b=this._nodes.get(f);if(!b)throw new De(`Graph.${i}: could not find the "${f}" source node in the graph.`);if(!this._nodes.has(p))throw new De(`Graph.${i}: could not find the "${p}" target node in the graph.`);return d0(!1,r,this.multi,a,b,p,g)}throw new Le(`Graph.${i}: too many arguments (expecting 1, 2 or 3 and got ${arguments.length}).`)}};const l="map"+n[0].toUpperCase()+n.slice(1);e.prototype[l]=function(){const f=Array.prototype.slice.call(arguments),p=f.pop();let g;if(f.length===0){let b=0;r!=="directed"&&(b+=this.undirectedSize),r!=="undirected"&&(b+=this.directedSize),g=new Array(b);let m=0;f.push((S,v,A,R,x,_,C)=>{g[m++]=p(S,v,A,R,x,_,C)})}else g=[],f.push((b,m,S,v,A,R,x)=>{g.push(p(b,m,S,v,A,R,x))});return this[i].apply(this,f),g};const u="filter"+n[0].toUpperCase()+n.slice(1);e.prototype[u]=function(){const f=Array.prototype.slice.call(arguments),p=f.pop(),g=[];return f.push((b,m,S,v,A,R,x)=>{p(b,m,S,v,A,R,x)&&g.push(b)}),this[i].apply(this,f),g};const c="reduce"+n[0].toUpperCase()+n.slice(1);e.prototype[c]=function(){let f=Array.prototype.slice.call(arguments);if(f.length<2||f.length>4)throw new Le(`Graph.${c}: invalid number of arguments (expecting 2, 3 or 4 and got ${f.length}).`);if(typeof f[f.length-1]=="function"&&typeof f[f.length-2]!="function")throw new Le(`Graph.${c}: missing initial value. You must provide it because the callback takes more than one argument and we cannot infer the initial value from the first iteration, as you could with a simple array.`);let p,g;f.length===2?(p=f[0],g=f[1],f=[]):f.length===3?(p=f[1],g=f[2],f=[f[0]]):f.length===4&&(p=f[2],g=f[3],f=[f[0],f[1]]);let b=g;return f.push((m,S,v,A,R,x,_)=>{b=p(b,m,S,v,A,R,x,_)}),this[i].apply(this,f),b}}function wK(e,t){const{name:n,type:r,direction:a}=t,i="find"+n[0].toUpperCase()+n.slice(1,-1);e.prototype[i]=function(c,f,p){if(r!=="mixed"&&this.type!=="mixed"&&r!==this.type)return!1;if(arguments.length===1)return p=c,OU(!0,this,r,p);if(arguments.length===2){c=""+c,p=f;const g=this._nodes.get(c);if(typeof g>"u")throw new De(`Graph.${i}: could not find the "${c}" node in the graph.`);return c0(!0,this.multi,r==="mixed"?this.type:r,a,g,p)}if(arguments.length===3){c=""+c,f=""+f;const g=this._nodes.get(c);if(!g)throw new De(`Graph.${i}: could not find the "${c}" source node in the graph.`);if(!this._nodes.has(f))throw new De(`Graph.${i}: could not find the "${f}" target node in the graph.`);return d0(!0,r,this.multi,a,g,f,p)}throw new Le(`Graph.${i}: too many arguments (expecting 1, 2 or 3 and got ${arguments.length}).`)};const l="some"+n[0].toUpperCase()+n.slice(1,-1);e.prototype[l]=function(){const c=Array.prototype.slice.call(arguments),f=c.pop();return c.push((g,b,m,S,v,A,R)=>f(g,b,m,S,v,A,R)),!!this[i].apply(this,c)};const u="every"+n[0].toUpperCase()+n.slice(1,-1);e.prototype[u]=function(){const c=Array.prototype.slice.call(arguments),f=c.pop();return c.push((g,b,m,S,v,A,R)=>!f(g,b,m,S,v,A,R)),!this[i].apply(this,c)}}function xK(e,t){const{name:n,type:r,direction:a}=t,i=n.slice(0,-1)+"Entries";e.prototype[i]=function(l,u){if(r!=="mixed"&&this.type!=="mixed"&&r!==this.type)return Nl();if(!arguments.length)return hK(this,r);if(arguments.length===1){l=""+l;const c=this._nodes.get(l);if(!c)throw new De(`Graph.${i}: could not find the "${l}" node in the graph.`);return bK(r,a,c)}if(arguments.length===2){l=""+l,u=""+u;const c=this._nodes.get(l);if(!c)throw new De(`Graph.${i}: could not find the "${l}" source node in the graph.`);if(!this._nodes.has(u))throw new De(`Graph.${i}: could not find the "${u}" target node in the graph.`);return vK(r,a,c,u)}throw new Le(`Graph.${i}: too many arguments (expecting 0, 1 or 2 and got ${arguments.length}).`)}}function kK(e){uK.forEach(t=>{SK(e,t),EK(e,t),wK(e,t),xK(e,t)})}const AK=[{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 Rf(){this.A=null,this.B=null}Rf.prototype.wrap=function(e){this.A===null?this.A=e:this.B===null&&(this.B=e)};Rf.prototype.has=function(e){return this.A!==null&&e in this.A||this.B!==null&&e in this.B};function Ms(e,t,n,r,a){for(const i in r){const l=r[i],u=l.source,c=l.target,f=u===n?c:u;if(t&&t.has(f.key))continue;const p=a(f.key,f.attributes);if(e&&p)return f.key}}function f0(e,t,n,r,a){if(t!=="mixed"){if(t==="undirected")return Ms(e,null,r,r.undirected,a);if(typeof n=="string")return Ms(e,null,r,r[n],a)}const i=new Rf;let l;if(t!=="undirected"){if(n!=="out"){if(l=Ms(e,null,r,r.in,a),e&&l)return l;i.wrap(r.in)}if(n!=="in"){if(l=Ms(e,i,r,r.out,a),e&&l)return l;i.wrap(r.out)}}if(t!=="directed"&&(l=Ms(e,i,r,r.undirected,a),e&&l))return l}function TK(e,t,n){if(e!=="mixed"){if(e==="undirected")return Object.keys(n.undirected);if(typeof t=="string")return Object.keys(n[t])}const r=[];return f0(!1,e,t,n,function(a){r.push(a)}),r}function Fs(e,t,n){const r=Object.keys(n),a=r.length;let i=0;return{[Symbol.iterator](){return this},next(){let l=null;do{if(i>=a)return e&&e.wrap(n),{done:!0};const u=n[r[i++]],c=u.source,f=u.target;if(l=c===t?f:c,e&&e.has(l.key)){l=null;continue}}while(l===null);return{done:!1,value:{neighbor:l.key,attributes:l.attributes}}}}}function _K(e,t,n){if(e!=="mixed"){if(e==="undirected")return Fs(null,n,n.undirected);if(typeof t=="string")return Fs(null,n,n[t])}let r=Nl();const a=new Rf;return e!=="undirected"&&(t!=="out"&&(r=Na(r,Fs(a,n,n.in))),t!=="in"&&(r=Na(r,Fs(a,n,n.out)))),e!=="directed"&&(r=Na(r,Fs(a,n,n.undirected))),r}function RK(e,t){const{name:n,type:r,direction:a}=t;e.prototype[n]=function(i){if(r!=="mixed"&&this.type!=="mixed"&&r!==this.type)return[];i=""+i;const l=this._nodes.get(i);if(typeof l>"u")throw new De(`Graph.${n}: could not find the "${i}" node in the graph.`);return TK(r==="mixed"?this.type:r,a,l)}}function CK(e,t){const{name:n,type:r,direction:a}=t,i="forEach"+n[0].toUpperCase()+n.slice(1,-1);e.prototype[i]=function(f,p){if(r!=="mixed"&&this.type!=="mixed"&&r!==this.type)return;f=""+f;const g=this._nodes.get(f);if(typeof g>"u")throw new De(`Graph.${i}: could not find the "${f}" node in the graph.`);f0(!1,r==="mixed"?this.type:r,a,g,p)};const l="map"+n[0].toUpperCase()+n.slice(1);e.prototype[l]=function(f,p){const g=[];return this[i](f,(b,m)=>{g.push(p(b,m))}),g};const u="filter"+n[0].toUpperCase()+n.slice(1);e.prototype[u]=function(f,p){const g=[];return this[i](f,(b,m)=>{p(b,m)&&g.push(b)}),g};const c="reduce"+n[0].toUpperCase()+n.slice(1);e.prototype[c]=function(f,p,g){if(arguments.length<3)throw new Le(`Graph.${c}: 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 b=g;return this[i](f,(m,S)=>{b=p(b,m,S)}),b}}function NK(e,t){const{name:n,type:r,direction:a}=t,i=n[0].toUpperCase()+n.slice(1,-1),l="find"+i;e.prototype[l]=function(f,p){if(r!=="mixed"&&this.type!=="mixed"&&r!==this.type)return;f=""+f;const g=this._nodes.get(f);if(typeof g>"u")throw new De(`Graph.${l}: could not find the "${f}" node in the graph.`);return f0(!0,r==="mixed"?this.type:r,a,g,p)};const u="some"+i;e.prototype[u]=function(f,p){return!!this[l](f,p)};const c="every"+i;e.prototype[c]=function(f,p){return!this[l](f,(b,m)=>!p(b,m))}}function OK(e,t){const{name:n,type:r,direction:a}=t,i=n.slice(0,-1)+"Entries";e.prototype[i]=function(l){if(r!=="mixed"&&this.type!=="mixed"&&r!==this.type)return Nl();l=""+l;const u=this._nodes.get(l);if(typeof u>"u")throw new De(`Graph.${i}: could not find the "${l}" node in the graph.`);return _K(r==="mixed"?this.type:r,a,u)}}function DK(e){AK.forEach(t=>{RK(e,t),CK(e,t),NK(e,t),OK(e,t)})}function Vc(e,t,n,r,a){const i=r._nodes.values(),l=r.type;let u,c,f,p,g,b;for(;u=i.next(),u.done!==!0;){let m=!1;if(c=u.value,l!=="undirected"){p=c.out;for(f in p){g=p[f];do b=g.target,m=!0,a(c.key,b.key,c.attributes,b.attributes,g.key,g.attributes,g.undirected),g=g.next;while(g)}}if(l!=="directed"){p=c.undirected;for(f in p)if(!(t&&c.key>f)){g=p[f];do b=g.target,b.key!==f&&(b=g.source),m=!0,a(c.key,b.key,c.attributes,b.attributes,g.key,g.attributes,g.undirected),g=g.next;while(g)}}n&&!m&&a(c.key,null,c.attributes,null,null,null,null)}}function IK(e,t){const n={key:e};return kU(t.attributes)||(n.attributes=Qt({},t.attributes)),n}function LK(e,t,n){const r={key:t,source:n.source.key,target:n.target.key};return kU(n.attributes)||(r.attributes=Qt({},n.attributes)),e==="mixed"&&n.undirected&&(r.undirected=!0),r}function MK(e){if(!gn(e))throw new Le('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 Le("Graph.import: serialized node is missing its key.");if("attributes"in e&&(!gn(e.attributes)||e.attributes===null))throw new Le("Graph.import: invalid attributes. Attributes should be a plain object, null or omitted.")}function FK(e){if(!gn(e))throw new Le('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 Le("Graph.import: serialized edge is missing its source.");if(!("target"in e))throw new Le("Graph.import: serialized edge is missing its target.");if("attributes"in e&&(!gn(e.attributes)||e.attributes===null))throw new Le("Graph.import: invalid attributes. Attributes should be a plain object, null or omitted.");if("undirected"in e&&typeof e.undirected!="boolean")throw new Le("Graph.import: invalid undirectedness information. Undirected should be boolean or omitted.")}const zK=BY(),PK=new Set(["directed","undirected","mixed"]),KR=new Set(["domain","_events","_eventsCount","_maxListeners"]),BK=[{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"}],UK={allowSelfLoops:!0,multi:!1,type:"mixed"};function jK(e,t,n){if(n&&!gn(n))throw new Le(`Graph.addNode: invalid attributes. Expecting an object but got "${n}"`);if(t=""+t,n=n||{},e._nodes.has(t))throw new Ze(`Graph.addNode: the "${t}" node already exist in the graph.`);const r=new e.NodeDataClass(t,n);return e._nodes.set(t,r),e.emit("nodeAdded",{key:t,attributes:n}),r}function XR(e,t,n){const r=new e.NodeDataClass(t,n);return e._nodes.set(t,r),e.emit("nodeAdded",{key:t,attributes:n}),r}function DU(e,t,n,r,a,i,l,u){if(!r&&e.type==="undirected")throw new Ze(`Graph.${t}: you cannot add a directed edge to an undirected graph. Use the #.addEdge or #.addUndirectedEdge instead.`);if(r&&e.type==="directed")throw new Ze(`Graph.${t}: you cannot add an undirected edge to a directed graph. Use the #.addEdge or #.addDirectedEdge instead.`);if(u&&!gn(u))throw new Le(`Graph.${t}: invalid attributes. Expecting an object but got "${u}"`);if(i=""+i,l=""+l,u=u||{},!e.allowSelfLoops&&i===l)throw new Ze(`Graph.${t}: source & target are the same ("${i}"), thus creating a loop explicitly forbidden by this graph 'allowSelfLoops' option set to false.`);const c=e._nodes.get(i),f=e._nodes.get(l);if(!c)throw new De(`Graph.${t}: source node "${i}" not found.`);if(!f)throw new De(`Graph.${t}: target node "${l}" not found.`);const p={key:null,undirected:r,source:i,target:l,attributes:u};if(n)a=e._edgeKeyGenerator();else if(a=""+a,e._edges.has(a))throw new Ze(`Graph.${t}: the "${a}" edge already exists in the graph.`);if(!e.multi&&(r?typeof c.undirected[l]<"u":typeof c.out[l]<"u"))throw new Ze(`Graph.${t}: an edge linking "${i}" to "${l}" already exists. If you really want to add multiple edges linking those nodes, you should create a multi graph by using the 'multi' option.`);const g=new Ol(r,a,c,f,u);e._edges.set(a,g);const b=i===l;return r?(c.undirectedDegree++,f.undirectedDegree++,b&&(c.undirectedLoops++,e._undirectedSelfLoopCount++)):(c.outDegree++,f.inDegree++,b&&(c.directedLoops++,e._directedSelfLoopCount++)),e.multi?g.attachMulti():g.attach(),r?e._undirectedSize++:e._directedSize++,p.key=a,e.emit("edgeAdded",p),a}function GK(e,t,n,r,a,i,l,u,c){if(!r&&e.type==="undirected")throw new Ze(`Graph.${t}: you cannot merge/update a directed edge to an undirected graph. Use the #.mergeEdge/#.updateEdge or #.addUndirectedEdge instead.`);if(r&&e.type==="directed")throw new Ze(`Graph.${t}: you cannot merge/update an undirected edge to a directed graph. Use the #.mergeEdge/#.updateEdge or #.addDirectedEdge instead.`);if(u){if(c){if(typeof u!="function")throw new Le(`Graph.${t}: invalid updater function. Expecting a function but got "${u}"`)}else if(!gn(u))throw new Le(`Graph.${t}: invalid attributes. Expecting an object but got "${u}"`)}i=""+i,l=""+l;let f;if(c&&(f=u,u=void 0),!e.allowSelfLoops&&i===l)throw new Ze(`Graph.${t}: source & target are the same ("${i}"), thus creating a loop explicitly forbidden by this graph 'allowSelfLoops' option set to false.`);let p=e._nodes.get(i),g=e._nodes.get(l),b,m;if(!n&&(b=e._edges.get(a),b)){if((b.source.key!==i||b.target.key!==l)&&(!r||b.source.key!==l||b.target.key!==i))throw new Ze(`Graph.${t}: inconsistency detected when attempting to merge the "${a}" edge with "${i}" source & "${l}" target vs. ("${b.source.key}", "${b.target.key}").`);m=b}if(!m&&!e.multi&&p&&(m=r?p.undirected[l]:p.out[l]),m){const x=[m.key,!1,!1,!1];if(c?!f:!u)return x;if(c){const _=m.attributes;m.attributes=f(_),e.emit("edgeAttributesUpdated",{type:"replace",key:m.key,attributes:m.attributes})}else Qt(m.attributes,u),e.emit("edgeAttributesUpdated",{type:"merge",key:m.key,attributes:m.attributes,data:u});return x}u=u||{},c&&f&&(u=f(u));const S={key:null,undirected:r,source:i,target:l,attributes:u};if(n)a=e._edgeKeyGenerator();else if(a=""+a,e._edges.has(a))throw new Ze(`Graph.${t}: the "${a}" edge already exists in the graph.`);let v=!1,A=!1;p||(p=XR(e,i,{}),v=!0,i===l&&(g=p,A=!0)),g||(g=XR(e,l,{}),A=!0),b=new Ol(r,a,p,g,u),e._edges.set(a,b);const R=i===l;return r?(p.undirectedDegree++,g.undirectedDegree++,R&&(p.undirectedLoops++,e._undirectedSelfLoopCount++)):(p.outDegree++,g.inDegree++,R&&(p.directedLoops++,e._directedSelfLoopCount++)),e.multi?b.attachMulti():b.attach(),r?e._undirectedSize++:e._directedSize++,S.key=a,e.emit("edgeAdded",S),[a,!0,v,A]}function Qi(e,t){e._edges.delete(t.key);const{source:n,target:r,attributes:a}=t,i=t.undirected,l=n===r;i?(n.undirectedDegree--,r.undirectedDegree--,l&&(n.undirectedLoops--,e._undirectedSelfLoopCount--)):(n.outDegree--,r.inDegree--,l&&(n.directedLoops--,e._directedSelfLoopCount--)),e.multi?t.detachMulti():t.detach(),i?e._undirectedSize--:e._directedSize--,e.emit("edgeDropped",{key:t.key,attributes:a,source:n.key,target:r.key,undirected:i})}class Tt extends xU.EventEmitter{constructor(t){if(super(),t=Qt({},UK,t),typeof t.multi!="boolean")throw new Le(`Graph.constructor: invalid 'multi' option. Expecting a boolean but got "${t.multi}".`);if(!PK.has(t.type))throw new Le(`Graph.constructor: invalid 'type' option. Should be one of "mixed", "directed" or "undirected" but got "${t.type}".`);if(typeof t.allowSelfLoops!="boolean")throw new Le(`Graph.constructor: invalid 'allowSelfLoops' option. Expecting a boolean but got "${t.allowSelfLoops}".`);const n=t.type==="mixed"?AU:t.type==="directed"?TU:_U;pr(this,"NodeDataClass",n);const r="geid_"+zK()+"_";let a=0;const i=()=>{let l;do l=r+a++;while(this._edges.has(l));return l};pr(this,"_attributes",{}),pr(this,"_nodes",new Map),pr(this,"_edges",new Map),pr(this,"_directedSize",0),pr(this,"_undirectedSize",0),pr(this,"_directedSelfLoopCount",0),pr(this,"_undirectedSelfLoopCount",0),pr(this,"_edgeKeyGenerator",i),pr(this,"_options",t),KR.forEach(l=>pr(this,l,this[l])),Tr(this,"order",()=>this._nodes.size),Tr(this,"size",()=>this._edges.size),Tr(this,"directedSize",()=>this._directedSize),Tr(this,"undirectedSize",()=>this._undirectedSize),Tr(this,"selfLoopCount",()=>this._directedSelfLoopCount+this._undirectedSelfLoopCount),Tr(this,"directedSelfLoopCount",()=>this._directedSelfLoopCount),Tr(this,"undirectedSelfLoopCount",()=>this._undirectedSelfLoopCount),Tr(this,"multi",this._options.multi),Tr(this,"type",this._options.type),Tr(this,"allowSelfLoops",this._options.allowSelfLoops),Tr(this,"implementation",()=>"graphology")}_resetInstanceCounters(){this._directedSize=0,this._undirectedSize=0,this._directedSelfLoopCount=0,this._undirectedSelfLoopCount=0}hasNode(t){return this._nodes.has(""+t)}hasDirectedEdge(t,n){if(this.type==="undirected")return!1;if(arguments.length===1){const r=""+t,a=this._edges.get(r);return!!a&&!a.undirected}else if(arguments.length===2){t=""+t,n=""+n;const r=this._nodes.get(t);return r?r.out.hasOwnProperty(n):!1}throw new Le(`Graph.hasDirectedEdge: invalid arity (${arguments.length}, instead of 1 or 2). You can either ask for an edge id or for the existence of an edge between a source & a target.`)}hasUndirectedEdge(t,n){if(this.type==="directed")return!1;if(arguments.length===1){const r=""+t,a=this._edges.get(r);return!!a&&a.undirected}else if(arguments.length===2){t=""+t,n=""+n;const r=this._nodes.get(t);return r?r.undirected.hasOwnProperty(n):!1}throw new Le(`Graph.hasDirectedEdge: invalid arity (${arguments.length}, instead of 1 or 2). You can either ask for an edge id or for the existence of an edge between a source & a target.`)}hasEdge(t,n){if(arguments.length===1){const r=""+t;return this._edges.has(r)}else if(arguments.length===2){t=""+t,n=""+n;const r=this._nodes.get(t);return r?typeof r.out<"u"&&r.out.hasOwnProperty(n)||typeof r.undirected<"u"&&r.undirected.hasOwnProperty(n):!1}throw new Le(`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 Ze("Graph.directedEdge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.directedEdges instead.");const r=this._nodes.get(t);if(!r)throw new De(`Graph.directedEdge: could not find the "${t}" source node in the graph.`);if(!this._nodes.has(n))throw new De(`Graph.directedEdge: could not find the "${n}" target node in the graph.`);const a=r.out&&r.out[n]||void 0;if(a)return a.key}undirectedEdge(t,n){if(this.type==="directed")return;if(t=""+t,n=""+n,this.multi)throw new Ze("Graph.undirectedEdge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.undirectedEdges instead.");const r=this._nodes.get(t);if(!r)throw new De(`Graph.undirectedEdge: could not find the "${t}" source node in the graph.`);if(!this._nodes.has(n))throw new De(`Graph.undirectedEdge: could not find the "${n}" target node in the graph.`);const a=r.undirected&&r.undirected[n]||void 0;if(a)return a.key}edge(t,n){if(this.multi)throw new Ze("Graph.edge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.edges instead.");t=""+t,n=""+n;const r=this._nodes.get(t);if(!r)throw new De(`Graph.edge: could not find the "${t}" source node in the graph.`);if(!this._nodes.has(n))throw new De(`Graph.edge: could not find the "${n}" target node in the graph.`);const a=r.out&&r.out[n]||r.undirected&&r.undirected[n]||void 0;if(a)return a.key}areDirectedNeighbors(t,n){t=""+t,n=""+n;const r=this._nodes.get(t);if(!r)throw new De(`Graph.areDirectedNeighbors: could not find the "${t}" node in the graph.`);return this.type==="undirected"?!1:n in r.in||n in r.out}areOutNeighbors(t,n){t=""+t,n=""+n;const r=this._nodes.get(t);if(!r)throw new De(`Graph.areOutNeighbors: could not find the "${t}" node in the graph.`);return this.type==="undirected"?!1:n in r.out}areInNeighbors(t,n){t=""+t,n=""+n;const r=this._nodes.get(t);if(!r)throw new De(`Graph.areInNeighbors: could not find the "${t}" node in the graph.`);return this.type==="undirected"?!1:n in r.in}areUndirectedNeighbors(t,n){t=""+t,n=""+n;const r=this._nodes.get(t);if(!r)throw new De(`Graph.areUndirectedNeighbors: could not find the "${t}" node in the graph.`);return this.type==="directed"?!1:n in r.undirected}areNeighbors(t,n){t=""+t,n=""+n;const r=this._nodes.get(t);if(!r)throw new De(`Graph.areNeighbors: could not find the "${t}" node in the graph.`);return this.type!=="undirected"&&(n in r.in||n in r.out)||this.type!=="directed"&&n in r.undirected}areInboundNeighbors(t,n){t=""+t,n=""+n;const r=this._nodes.get(t);if(!r)throw new De(`Graph.areInboundNeighbors: could not find the "${t}" node in the graph.`);return this.type!=="undirected"&&n in r.in||this.type!=="directed"&&n in r.undirected}areOutboundNeighbors(t,n){t=""+t,n=""+n;const r=this._nodes.get(t);if(!r)throw new De(`Graph.areOutboundNeighbors: could not find the "${t}" node in the graph.`);return this.type!=="undirected"&&n in r.out||this.type!=="directed"&&n in r.undirected}inDegree(t){t=""+t;const n=this._nodes.get(t);if(!n)throw new De(`Graph.inDegree: could not find the "${t}" node in the graph.`);return this.type==="undirected"?0:n.inDegree}outDegree(t){t=""+t;const n=this._nodes.get(t);if(!n)throw new De(`Graph.outDegree: could not find the "${t}" node in the graph.`);return this.type==="undirected"?0:n.outDegree}directedDegree(t){t=""+t;const n=this._nodes.get(t);if(!n)throw new De(`Graph.directedDegree: could not find the "${t}" node in the graph.`);return this.type==="undirected"?0:n.inDegree+n.outDegree}undirectedDegree(t){t=""+t;const n=this._nodes.get(t);if(!n)throw new De(`Graph.undirectedDegree: could not find the "${t}" node in the graph.`);return this.type==="directed"?0:n.undirectedDegree}inboundDegree(t){t=""+t;const n=this._nodes.get(t);if(!n)throw new De(`Graph.inboundDegree: could not find the "${t}" node in the graph.`);let r=0;return this.type!=="directed"&&(r+=n.undirectedDegree),this.type!=="undirected"&&(r+=n.inDegree),r}outboundDegree(t){t=""+t;const n=this._nodes.get(t);if(!n)throw new De(`Graph.outboundDegree: could not find the "${t}" node in the graph.`);let r=0;return this.type!=="directed"&&(r+=n.undirectedDegree),this.type!=="undirected"&&(r+=n.outDegree),r}degree(t){t=""+t;const n=this._nodes.get(t);if(!n)throw new De(`Graph.degree: could not find the "${t}" node in the graph.`);let r=0;return this.type!=="directed"&&(r+=n.undirectedDegree),this.type!=="undirected"&&(r+=n.inDegree+n.outDegree),r}inDegreeWithoutSelfLoops(t){t=""+t;const n=this._nodes.get(t);if(!n)throw new De(`Graph.inDegreeWithoutSelfLoops: could not find the "${t}" node in the graph.`);return this.type==="undirected"?0:n.inDegree-n.directedLoops}outDegreeWithoutSelfLoops(t){t=""+t;const n=this._nodes.get(t);if(!n)throw new De(`Graph.outDegreeWithoutSelfLoops: could not find the "${t}" node in the graph.`);return this.type==="undirected"?0:n.outDegree-n.directedLoops}directedDegreeWithoutSelfLoops(t){t=""+t;const n=this._nodes.get(t);if(!n)throw new De(`Graph.directedDegreeWithoutSelfLoops: could not find the "${t}" node in the graph.`);return this.type==="undirected"?0:n.inDegree+n.outDegree-n.directedLoops*2}undirectedDegreeWithoutSelfLoops(t){t=""+t;const n=this._nodes.get(t);if(!n)throw new De(`Graph.undirectedDegreeWithoutSelfLoops: could not find the "${t}" node in the graph.`);return this.type==="directed"?0:n.undirectedDegree-n.undirectedLoops*2}inboundDegreeWithoutSelfLoops(t){t=""+t;const n=this._nodes.get(t);if(!n)throw new De(`Graph.inboundDegreeWithoutSelfLoops: could not find the "${t}" node in the graph.`);let r=0,a=0;return this.type!=="directed"&&(r+=n.undirectedDegree,a+=n.undirectedLoops*2),this.type!=="undirected"&&(r+=n.inDegree,a+=n.directedLoops),r-a}outboundDegreeWithoutSelfLoops(t){t=""+t;const n=this._nodes.get(t);if(!n)throw new De(`Graph.outboundDegreeWithoutSelfLoops: could not find the "${t}" node in the graph.`);let r=0,a=0;return this.type!=="directed"&&(r+=n.undirectedDegree,a+=n.undirectedLoops*2),this.type!=="undirected"&&(r+=n.outDegree,a+=n.directedLoops),r-a}degreeWithoutSelfLoops(t){t=""+t;const n=this._nodes.get(t);if(!n)throw new De(`Graph.degreeWithoutSelfLoops: could not find the "${t}" node in the graph.`);let r=0,a=0;return this.type!=="directed"&&(r+=n.undirectedDegree,a+=n.undirectedLoops*2),this.type!=="undirected"&&(r+=n.inDegree+n.outDegree,a+=n.directedLoops*2),r-a}source(t){t=""+t;const n=this._edges.get(t);if(!n)throw new De(`Graph.source: could not find the "${t}" edge in the graph.`);return n.source.key}target(t){t=""+t;const n=this._edges.get(t);if(!n)throw new De(`Graph.target: could not find the "${t}" edge in the graph.`);return n.target.key}extremities(t){t=""+t;const n=this._edges.get(t);if(!n)throw new De(`Graph.extremities: could not find the "${t}" edge in the graph.`);return[n.source.key,n.target.key]}opposite(t,n){t=""+t,n=""+n;const r=this._edges.get(n);if(!r)throw new De(`Graph.opposite: could not find the "${n}" edge in the graph.`);const a=r.source.key,i=r.target.key;if(t===a)return i;if(t===i)return a;throw new De(`Graph.opposite: the "${t}" node is not attached to the "${n}" edge (${a}, ${i}).`)}hasExtremity(t,n){t=""+t,n=""+n;const r=this._edges.get(t);if(!r)throw new De(`Graph.hasExtremity: could not find the "${t}" edge in the graph.`);return r.source.key===n||r.target.key===n}isUndirected(t){t=""+t;const n=this._edges.get(t);if(!n)throw new De(`Graph.isUndirected: could not find the "${t}" edge in the graph.`);return n.undirected}isDirected(t){t=""+t;const n=this._edges.get(t);if(!n)throw new De(`Graph.isDirected: could not find the "${t}" edge in the graph.`);return!n.undirected}isSelfLoop(t){t=""+t;const n=this._edges.get(t);if(!n)throw new De(`Graph.isSelfLoop: could not find the "${t}" edge in the graph.`);return n.source===n.target}addNode(t,n){return jK(this,t,n).key}mergeNode(t,n){if(n&&!gn(n))throw new Le(`Graph.mergeNode: invalid attributes. Expecting an object but got "${n}"`);t=""+t,n=n||{};let r=this._nodes.get(t);return r?(n&&(Qt(r.attributes,n),this.emit("nodeAttributesUpdated",{type:"merge",key:t,attributes:r.attributes,data:n})),[t,!1]):(r=new this.NodeDataClass(t,n),this._nodes.set(t,r),this.emit("nodeAdded",{key:t,attributes:n}),[t,!0])}updateNode(t,n){if(n&&typeof n!="function")throw new Le(`Graph.updateNode: invalid updater function. Expecting a function but got "${n}"`);t=""+t;let r=this._nodes.get(t);if(r){if(n){const i=r.attributes;r.attributes=n(i),this.emit("nodeAttributesUpdated",{type:"replace",key:t,attributes:r.attributes})}return[t,!1]}const a=n?n({}):{};return r=new this.NodeDataClass(t,a),this._nodes.set(t,r),this.emit("nodeAdded",{key:t,attributes:a}),[t,!0]}dropNode(t){t=""+t;const n=this._nodes.get(t);if(!n)throw new De(`Graph.dropNode: could not find the "${t}" node in the graph.`);let r;if(this.type!=="undirected"){for(const a in n.out){r=n.out[a];do Qi(this,r),r=r.next;while(r)}for(const a in n.in){r=n.in[a];do Qi(this,r),r=r.next;while(r)}}if(this.type!=="directed")for(const a in n.undirected){r=n.undirected[a];do Qi(this,r),r=r.next;while(r)}this._nodes.delete(t),this.emit("nodeDropped",{key:t,attributes:n.attributes})}dropEdge(t){let n;if(arguments.length>1){const r=""+arguments[0],a=""+arguments[1];if(n=hr(this,r,a,this.type),!n)throw new De(`Graph.dropEdge: could not find the "${r}" -> "${a}" edge in the graph.`)}else if(t=""+t,n=this._edges.get(t),!n)throw new De(`Graph.dropEdge: could not find the "${t}" edge in the graph.`);return Qi(this,n),this}dropDirectedEdge(t,n){if(arguments.length<2)throw new Ze("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 Ze("Graph.dropDirectedEdge: cannot use a {source,target} combo when dropping an edge in a MultiGraph since we cannot infer the one you want to delete as there could be multiple ones.");t=""+t,n=""+n;const r=hr(this,t,n,"directed");if(!r)throw new De(`Graph.dropDirectedEdge: could not find a "${t}" -> "${n}" edge in the graph.`);return Qi(this,r),this}dropUndirectedEdge(t,n){if(arguments.length<2)throw new Ze("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 Ze("Graph.dropUndirectedEdge: cannot use a {source,target} combo when dropping an edge in a MultiGraph since we cannot infer the one you want to delete as there could be multiple ones.");const r=hr(this,t,n,"undirected");if(!r)throw new De(`Graph.dropUndirectedEdge: could not find a "${t}" -> "${n}" edge in the graph.`);return Qi(this,r),this}clear(){this._edges.clear(),this._nodes.clear(),this._resetInstanceCounters(),this.emit("cleared")}clearEdges(){const t=this._nodes.values();let n;for(;n=t.next(),n.done!==!0;)n.value.clear();this._edges.clear(),this._resetInstanceCounters(),this.emit("edgesCleared")}getAttribute(t){return this._attributes[t]}getAttributes(){return this._attributes}hasAttribute(t){return this._attributes.hasOwnProperty(t)}setAttribute(t,n){return this._attributes[t]=n,this.emit("attributesUpdated",{type:"set",attributes:this._attributes,name:t}),this}updateAttribute(t,n){if(typeof n!="function")throw new Le("Graph.updateAttribute: updater should be a function.");const r=this._attributes[t];return this._attributes[t]=n(r),this.emit("attributesUpdated",{type:"set",attributes:this._attributes,name:t}),this}removeAttribute(t){return delete this._attributes[t],this.emit("attributesUpdated",{type:"remove",attributes:this._attributes,name:t}),this}replaceAttributes(t){if(!gn(t))throw new Le("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(!gn(t))throw new Le("Graph.mergeAttributes: provided attributes are not a plain object.");return Qt(this._attributes,t),this.emit("attributesUpdated",{type:"merge",attributes:this._attributes,data:t}),this}updateAttributes(t){if(typeof t!="function")throw new Le("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 Le("Graph.updateEachNodeAttributes: expecting an updater function.");if(n&&!YR(n))throw new Le("Graph.updateEachNodeAttributes: invalid hints. Expecting an object having the following shape: {attributes?: [string]}");const r=this._nodes.values();let a,i;for(;a=r.next(),a.done!==!0;)i=a.value,i.attributes=t(i.key,i.attributes);this.emit("eachNodeAttributesUpdated",{hints:n||null})}updateEachEdgeAttributes(t,n){if(typeof t!="function")throw new Le("Graph.updateEachEdgeAttributes: expecting an updater function.");if(n&&!YR(n))throw new Le("Graph.updateEachEdgeAttributes: invalid hints. Expecting an object having the following shape: {attributes?: [string]}");const r=this._edges.values();let a,i,l,u;for(;a=r.next(),a.done!==!0;)i=a.value,l=i.source,u=i.target,i.attributes=t(i.key,i.attributes,l.key,u.key,l.attributes,u.attributes,i.undirected);this.emit("eachEdgeAttributesUpdated",{hints:n||null})}forEachAdjacencyEntry(t){if(typeof t!="function")throw new Le("Graph.forEachAdjacencyEntry: expecting a callback.");Vc(!1,!1,!1,this,t)}forEachAdjacencyEntryWithOrphans(t){if(typeof t!="function")throw new Le("Graph.forEachAdjacencyEntryWithOrphans: expecting a callback.");Vc(!1,!1,!0,this,t)}forEachAssymetricAdjacencyEntry(t){if(typeof t!="function")throw new Le("Graph.forEachAssymetricAdjacencyEntry: expecting a callback.");Vc(!1,!0,!1,this,t)}forEachAssymetricAdjacencyEntryWithOrphans(t){if(typeof t!="function")throw new Le("Graph.forEachAssymetricAdjacencyEntryWithOrphans: expecting a callback.");Vc(!1,!0,!0,this,t)}nodes(){return Array.from(this._nodes.keys())}forEachNode(t){if(typeof t!="function")throw new Le("Graph.forEachNode: expecting a callback.");const n=this._nodes.values();let r,a;for(;r=n.next(),r.done!==!0;)a=r.value,t(a.key,a.attributes)}findNode(t){if(typeof t!="function")throw new Le("Graph.findNode: expecting a callback.");const n=this._nodes.values();let r,a;for(;r=n.next(),r.done!==!0;)if(a=r.value,t(a.key,a.attributes))return a.key}mapNodes(t){if(typeof t!="function")throw new Le("Graph.mapNode: expecting a callback.");const n=this._nodes.values();let r,a;const i=new Array(this.order);let l=0;for(;r=n.next(),r.done!==!0;)a=r.value,i[l++]=t(a.key,a.attributes);return i}someNode(t){if(typeof t!="function")throw new Le("Graph.someNode: expecting a callback.");const n=this._nodes.values();let r,a;for(;r=n.next(),r.done!==!0;)if(a=r.value,t(a.key,a.attributes))return!0;return!1}everyNode(t){if(typeof t!="function")throw new Le("Graph.everyNode: expecting a callback.");const n=this._nodes.values();let r,a;for(;r=n.next(),r.done!==!0;)if(a=r.value,!t(a.key,a.attributes))return!1;return!0}filterNodes(t){if(typeof t!="function")throw new Le("Graph.filterNodes: expecting a callback.");const n=this._nodes.values();let r,a;const i=[];for(;r=n.next(),r.done!==!0;)a=r.value,t(a.key,a.attributes)&&i.push(a.key);return i}reduceNodes(t,n){if(typeof t!="function")throw new Le("Graph.reduceNodes: expecting a callback.");if(arguments.length<2)throw new Le("Graph.reduceNodes: missing initial value. You must provide it because the callback takes more than one argument and we cannot infer the initial value from the first iteration, as you could with a simple array.");let r=n;const a=this._nodes.values();let i,l;for(;i=a.next(),i.done!==!0;)l=i.value,r=t(r,l.key,l.attributes);return r}nodeEntries(){const t=this._nodes.values();return{[Symbol.iterator](){return this},next(){const n=t.next();if(n.done)return n;const r=n.value;return{value:{node:r.key,attributes:r.attributes},done:!1}}}}export(){const t=new Array(this._nodes.size);let n=0;this._nodes.forEach((a,i)=>{t[n++]=IK(i,a)});const r=new Array(this._edges.size);return n=0,this._edges.forEach((a,i)=>{r[n++]=LK(this.type,i,a)}),{options:{type:this.type,multi:this.multi,allowSelfLoops:this.allowSelfLoops},attributes:this.getAttributes(),nodes:t,edges:r}}import(t,n=!1){if(t instanceof Tt)return t.forEachNode((c,f)=>{n?this.mergeNode(c,f):this.addNode(c,f)}),t.forEachEdge((c,f,p,g,b,m,S)=>{n?S?this.mergeUndirectedEdgeWithKey(c,p,g,f):this.mergeDirectedEdgeWithKey(c,p,g,f):S?this.addUndirectedEdgeWithKey(c,p,g,f):this.addDirectedEdgeWithKey(c,p,g,f)}),this;if(!gn(t))throw new Le("Graph.import: invalid argument. Expecting a serialized graph or, alternatively, a Graph instance.");if(t.attributes){if(!gn(t.attributes))throw new Le("Graph.import: invalid attributes. Expecting a plain object.");n?this.mergeAttributes(t.attributes):this.replaceAttributes(t.attributes)}let r,a,i,l,u;if(t.nodes){if(i=t.nodes,!Array.isArray(i))throw new Le("Graph.import: invalid nodes. Expecting an array.");for(r=0,a=i.length;r{const i=Qt({},r.attributes);r=new n.NodeDataClass(a,i),n._nodes.set(a,r)}),n}copy(t){if(t=t||{},typeof t.type=="string"&&t.type!==this.type&&t.type!=="mixed")throw new Ze(`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 Ze("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 Ze("Graph.copy: cannot create an incompatible copy from a graph allowing self loops to one that does not because this would mean losing information about the current graph.");const n=this.emptyCopy(t),r=this._edges.values();let a,i;for(;a=r.next(),a.done!==!0;)i=a.value,DU(n,"copy",!1,i.undirected,i.key,i.source.key,i.target.key,Qt({},i.attributes));return n}toJSON(){return this.export()}toString(){return"[object Graph]"}inspect(){const t={};this._nodes.forEach((i,l)=>{t[l]=i.attributes});const n={},r={};this._edges.forEach((i,l)=>{const u=i.undirected?"--":"->";let c="",f=i.source.key,p=i.target.key,g;i.undirected&&f>p&&(g=f,f=p,p=g);const b=`(${f})${u}(${p})`;l.startsWith("geid_")?this.multi&&(typeof r[b]>"u"?r[b]=0:r[b]++,c+=`${r[b]}. `):c+=`[${l}]: `,c+=b,n[c]=i.attributes});const a={};for(const i in this)this.hasOwnProperty(i)&&!KR.has(i)&&typeof this[i]!="function"&&typeof i!="symbol"&&(a[i]=this[i]);return a.attributes=this._attributes,a.nodes=t,a.edges=n,pr(a,"constructor",this.constructor),a}}typeof Symbol<"u"&&(Tt.prototype[Symbol.for("nodejs.util.inspect.custom")]=Tt.prototype.inspect);BK.forEach(e=>{["add","merge","update"].forEach(t=>{const n=e.name(t),r=t==="add"?DU:GK;e.generateKey?Tt.prototype[n]=function(a,i,l){return r(this,n,!0,(e.type||this.type)==="undirected",null,a,i,l,t==="update")}:Tt.prototype[n]=function(a,i,l,u){return r(this,n,!1,(e.type||this.type)==="undirected",a,i,l,u,t==="update")}})});ZY(Tt);sK(Tt);kK(Tt);DK(Tt);class tu extends Tt{constructor(t){const n=Qt({type:"directed"},t);if("multi"in n&&n.multi!==!1)throw new Le("DirectedGraph.from: inconsistent indication that the graph should be multi in given options!");if(n.type!=="directed")throw new Le('DirectedGraph.from: inconsistent "'+n.type+'" type in given options!');super(n)}}class IU extends Tt{constructor(t){const n=Qt({type:"undirected"},t);if("multi"in n&&n.multi!==!1)throw new Le("UndirectedGraph.from: inconsistent indication that the graph should be multi in given options!");if(n.type!=="undirected")throw new Le('UndirectedGraph.from: inconsistent "'+n.type+'" type in given options!');super(n)}}class LU extends Tt{constructor(t){const n=Qt({multi:!0},t);if("multi"in n&&n.multi!==!0)throw new Le("MultiGraph.from: inconsistent indication that the graph should be simple in given options!");super(n)}}class MU extends Tt{constructor(t){const n=Qt({type:"directed",multi:!0},t);if("multi"in n&&n.multi!==!0)throw new Le("MultiDirectedGraph.from: inconsistent indication that the graph should be simple in given options!");if(n.type!=="directed")throw new Le('MultiDirectedGraph.from: inconsistent "'+n.type+'" type in given options!');super(n)}}class FU extends Tt{constructor(t){const n=Qt({type:"undirected",multi:!0},t);if("multi"in n&&n.multi!==!0)throw new Le("MultiUndirectedGraph.from: inconsistent indication that the graph should be simple in given options!");if(n.type!=="undirected")throw new Le('MultiUndirectedGraph.from: inconsistent "'+n.type+'" type in given options!');super(n)}}function Dl(e){e.from=function(t,n){const r=Qt({},t.options,n),a=new e(r);return a.import(t),a}}Dl(Tt);Dl(tu);Dl(IU);Dl(LU);Dl(MU);Dl(FU);Tt.Graph=Tt;Tt.DirectedGraph=tu;Tt.UndirectedGraph=IU;Tt.MultiGraph=LU;Tt.MultiDirectedGraph=MU;Tt.MultiUndirectedGraph=FU;Tt.InvalidArgumentsGraphError=Le;Tt.NotFoundGraphError=De;Tt.UsageGraphError=Ze;function HK(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function Ws(e){var t=HK(e,"string");return typeof t=="symbol"?t:t+""}function on(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ZR(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,r=Array(t);n>8&255,i=n>>16&255,l=n>>24&255;return[r,a,i,l]}var Th={};function GU(e){if(typeof Th[e]<"u")return Th[e];var t=(e&16711680)>>>16,n=(e&65280)>>>8,r=e&255,a=255,i=jU(t,n,r,a);return Th[e]=i,i}function QR(e,t,n,r){return n+(t<<8)+(e<<16)}function JR(e,t,n,r,a,i){var l=Math.floor(n/i*a),u=Math.floor(e.drawingBufferHeight/i-r/i*a),c=new Uint8Array(4);e.bindFramebuffer(e.FRAMEBUFFER,t),e.readPixels(l,u,1,1,e.RGBA,e.UNSIGNED_BYTE,c);var f=vl(c,4),p=f[0],g=f[1],b=f[2],m=f[3];return[p,g,b,m]}function _e(e,t,n){return(t=Ws(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function eC(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function Be(e){for(var t=1;tC){var T="…";for(f=f+T,N=e.measureText(f).width;N>C&&f.length>1;)f=f.slice(0,-2)+T,N=e.measureText(f).width;if(f.length<4)return}var O;x>0?_>0?O=Math.acos(x/C):O=Math.asin(_/C):_>0?O=Math.acos(x/C)+Math.PI:O=Math.asin(x/C)+Math.PI/2,e.save(),e.translate(A,R),e.rotate(O),e.fillText(f,-N/2,t.size/2+i),e.restore()}}}function WU(e,t,n){if(t.label){var r=n.labelSize,a=n.labelFont,i=n.labelWeight,l=n.labelColor.attribute?t[n.labelColor.attribute]||n.labelColor.color||"#000":n.labelColor.color;e.fillStyle=l,e.font="".concat(i," ").concat(r,"px ").concat(a),e.fillText(t.label,t.x+t.size+3,t.y+r/3)}}function iX(e,t,n){var r=n.labelSize,a=n.labelFont,i=n.labelWeight;e.font="".concat(i," ").concat(r,"px ").concat(a),e.fillStyle="#FFF",e.shadowOffsetX=0,e.shadowOffsetY=0,e.shadowBlur=8,e.shadowColor="#000";var l=2;if(typeof t.label=="string"){var u=e.measureText(t.label).width,c=Math.round(u+5),f=Math.round(r+2*l),p=Math.max(t.size,r/2)+l,g=Math.asin(f/2/p),b=Math.sqrt(Math.abs(Math.pow(p,2)-Math.pow(f/2,2)));e.beginPath(),e.moveTo(t.x+b,t.y+f/2),e.lineTo(t.x+p+c,t.y+f/2),e.lineTo(t.x+p+c,t.y-f/2),e.lineTo(t.x+b,t.y-f/2),e.arc(t.x,t.y,p,g,-g),e.closePath(),e.fill()}else e.beginPath(),e.arc(t.x,t.y,t.size+l,0,Math.PI*2),e.closePath(),e.fill();e.shadowOffsetX=0,e.shadowOffsetY=0,e.shadowBlur=0,WU(e,t,n)}var lX=` +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 +} +`,sX=lX,uX=` +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; +} +`,cX=uX,YU=WebGLRenderingContext,aC=YU.UNSIGNED_BYTE,Rh=YU.FLOAT,dX=["u_sizeRatio","u_correctionRatio","u_matrix"],vu=function(e){function t(){return on(this,t),Bn(this,t,arguments)}return Un(t,e),ln(t,[{key:"getDefinition",value:function(){return{VERTICES:3,VERTEX_SHADER_SOURCE:cX,FRAGMENT_SHADER_SOURCE:sX,METHOD:WebGLRenderingContext.TRIANGLES,UNIFORMS:dX,ATTRIBUTES:[{name:"a_position",size:2,type:Rh},{name:"a_size",size:1,type:Rh},{name:"a_color",size:4,type:aC,normalized:!0},{name:"a_id",size:4,type:aC,normalized:!0}],CONSTANT_ATTRIBUTES:[{name:"a_angle",size:1,type:Rh}],CONSTANT_DATA:[[t.ANGLE_1],[t.ANGLE_2],[t.ANGLE_3]]}}},{key:"processVisibleItem",value:function(r,a,i){var l=this.array,u=Qr(i.color);l[a++]=i.x,l[a++]=i.y,l[a++]=i.size,l[a++]=u,l[a++]=r}},{key:"setUniforms",value:function(r,a){var i=a.gl,l=a.uniformLocations,u=l.u_sizeRatio,c=l.u_correctionRatio,f=l.u_matrix;i.uniform1f(c,r.correctionRatio),i.uniform1f(u,r.sizeRatio),i.uniformMatrix3fv(f,!1,r.matrix)}}])}(p0);_e(vu,"ANGLE_1",0);_e(vu,"ANGLE_2",2*Math.PI/3);_e(vu,"ANGLE_3",4*Math.PI/3);var fX=` +precision mediump float; + +varying vec4 v_color; + +void main(void) { + gl_FragColor = v_color; +} +`,pX=fX,gX=` +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; +} +`,hX=gX,KU=WebGLRenderingContext,oC=KU.UNSIGNED_BYTE,Yc=KU.FLOAT,mX=["u_matrix","u_sizeRatio","u_correctionRatio","u_minEdgeThickness","u_lengthToThicknessRatio","u_widenessToThicknessRatio"],Su={extremity:"target",lengthToThicknessRatio:2.5,widenessToThicknessRatio:2};function Pd(e){var t=Be(Be({},Su),e||{});return function(n){function r(){return on(this,r),Bn(this,r,arguments)}return Un(r,n),ln(r,[{key:"getDefinition",value:function(){return{VERTICES:3,VERTEX_SHADER_SOURCE:hX,FRAGMENT_SHADER_SOURCE:pX,METHOD:WebGLRenderingContext.TRIANGLES,UNIFORMS:mX,ATTRIBUTES:[{name:"a_position",size:2,type:Yc},{name:"a_normal",size:2,type:Yc},{name:"a_radius",size:1,type:Yc},{name:"a_color",size:4,type:oC,normalized:!0},{name:"a_id",size:4,type:oC,normalized:!0}],CONSTANT_ATTRIBUTES:[{name:"a_barycentric",size:3,type:Yc}],CONSTANT_DATA:[[1,0,0],[0,1,0],[0,0,1]]}}},{key:"processVisibleItem",value:function(i,l,u,c,f){if(t.extremity==="source"){var p=[c,u];u=p[0],c=p[1]}var g=f.size||1,b=c.size||1,m=u.x,S=u.y,v=c.x,A=c.y,R=Qr(f.color),x=v-m,_=A-S,C=x*x+_*_,N=0,T=0;C&&(C=1/Math.sqrt(C),N=-_*C*g,T=x*C*g);var O=this.array;O[l++]=v,O[l++]=A,O[l++]=-N,O[l++]=-T,O[l++]=b,O[l++]=R,O[l++]=i}},{key:"setUniforms",value:function(i,l){var u=l.gl,c=l.uniformLocations,f=c.u_matrix,p=c.u_sizeRatio,g=c.u_correctionRatio,b=c.u_minEdgeThickness,m=c.u_lengthToThicknessRatio,S=c.u_widenessToThicknessRatio;u.uniformMatrix3fv(f,!1,i.matrix),u.uniform1f(p,i.sizeRatio),u.uniform1f(g,i.correctionRatio),u.uniform1f(b,i.minEdgeThickness),u.uniform1f(m,t.lengthToThicknessRatio),u.uniform1f(S,t.widenessToThicknessRatio)}}])}(yu)}Pd();var bX=` +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 +} +`,g0=bX,yX=` +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; +} +`,vX=yX,XU=WebGLRenderingContext,iC=XU.UNSIGNED_BYTE,Ko=XU.FLOAT,SX=["u_matrix","u_zoomRatio","u_sizeRatio","u_correctionRatio","u_pixelRatio","u_feather","u_minEdgeThickness","u_lengthToThicknessRatio"],EX={lengthToThicknessRatio:Su.lengthToThicknessRatio};function ZU(e){var t=Be(Be({},EX),{});return function(n){function r(){return on(this,r),Bn(this,r,arguments)}return Un(r,n),ln(r,[{key:"getDefinition",value:function(){return{VERTICES:6,VERTEX_SHADER_SOURCE:vX,FRAGMENT_SHADER_SOURCE:g0,METHOD:WebGLRenderingContext.TRIANGLES,UNIFORMS:SX,ATTRIBUTES:[{name:"a_positionStart",size:2,type:Ko},{name:"a_positionEnd",size:2,type:Ko},{name:"a_normal",size:2,type:Ko},{name:"a_color",size:4,type:iC,normalized:!0},{name:"a_id",size:4,type:iC,normalized:!0},{name:"a_radius",size:1,type:Ko}],CONSTANT_ATTRIBUTES:[{name:"a_positionCoef",size:1,type:Ko},{name:"a_normalCoef",size:1,type:Ko},{name:"a_radiusCoef",size:1,type:Ko}],CONSTANT_DATA:[[0,1,0],[0,-1,0],[1,1,1],[1,1,1],[0,-1,0],[1,-1,-1]]}}},{key:"processVisibleItem",value:function(i,l,u,c,f){var p=f.size||1,g=u.x,b=u.y,m=c.x,S=c.y,v=Qr(f.color),A=m-g,R=S-b,x=c.size||1,_=A*A+R*R,C=0,N=0;_&&(_=1/Math.sqrt(_),C=-R*_*p,N=A*_*p);var T=this.array;T[l++]=g,T[l++]=b,T[l++]=m,T[l++]=S,T[l++]=C,T[l++]=N,T[l++]=v,T[l++]=i,T[l++]=x}},{key:"setUniforms",value:function(i,l){var u=l.gl,c=l.uniformLocations,f=c.u_matrix,p=c.u_zoomRatio,g=c.u_feather,b=c.u_pixelRatio,m=c.u_correctionRatio,S=c.u_sizeRatio,v=c.u_minEdgeThickness,A=c.u_lengthToThicknessRatio;u.uniformMatrix3fv(f,!1,i.matrix),u.uniform1f(p,i.zoomRatio),u.uniform1f(S,i.sizeRatio),u.uniform1f(m,i.correctionRatio),u.uniform1f(b,i.pixelRatio),u.uniform1f(g,i.antiAliasingFeather),u.uniform1f(v,i.minEdgeThickness),u.uniform1f(A,t.lengthToThicknessRatio)}}])}(yu)}ZU();function wX(e){return VU([ZU(),Pd(e)])}var xX=wX(),QU=xX,kX=` +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; +} +`,AX=kX,JU=WebGLRenderingContext,lC=JU.UNSIGNED_BYTE,zs=JU.FLOAT,TX=["u_matrix","u_zoomRatio","u_sizeRatio","u_correctionRatio","u_pixelRatio","u_feather","u_minEdgeThickness"],_X=function(e){function t(){return on(this,t),Bn(this,t,arguments)}return Un(t,e),ln(t,[{key:"getDefinition",value:function(){return{VERTICES:6,VERTEX_SHADER_SOURCE:AX,FRAGMENT_SHADER_SOURCE:g0,METHOD:WebGLRenderingContext.TRIANGLES,UNIFORMS:TX,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:lC,normalized:!0},{name:"a_id",size:4,type:lC,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(r,a,i,l,u){var c=u.size||1,f=i.x,p=i.y,g=l.x,b=l.y,m=Qr(u.color),S=g-f,v=b-p,A=S*S+v*v,R=0,x=0;A&&(A=1/Math.sqrt(A),R=-v*A*c,x=S*A*c);var _=this.array;_[a++]=f,_[a++]=p,_[a++]=g,_[a++]=b,_[a++]=R,_[a++]=x,_[a++]=m,_[a++]=r}},{key:"setUniforms",value:function(r,a){var i=a.gl,l=a.uniformLocations,u=l.u_matrix,c=l.u_zoomRatio,f=l.u_feather,p=l.u_pixelRatio,g=l.u_correctionRatio,b=l.u_sizeRatio,m=l.u_minEdgeThickness;i.uniformMatrix3fv(u,!1,r.matrix),i.uniform1f(c,r.zoomRatio),i.uniform1f(b,r.sizeRatio),i.uniform1f(g,r.correctionRatio),i.uniform1f(p,r.pixelRatio),i.uniform1f(f,r.antiAliasingFeather),i.uniform1f(m,r.minEdgeThickness)}}])}(yu),h0=function(e){function t(){var n;return on(this,t),n=Bn(this,t),n.rawEmitter=n,n}return Un(t,e),ln(t)}(xU.EventEmitter),Ch,sC;function Jr(){return sC||(sC=1,Ch=function(t){return t!==null&&typeof t=="object"&&typeof t.addUndirectedEdgeWithKey=="function"&&typeof t.dropNode=="function"&&typeof t.multi=="boolean"}),Ch}var RX=Jr();const CX=an(RX);var NX=function(t){return t},OX=function(t){return t*t},DX=function(t){return t*(2-t)},IX=function(t){return(t*=2)<1?.5*t*t:-.5*(--t*(t-2)-1)},LX=function(t){return t*t*t},MX=function(t){return--t*t*t+1},FX=function(t){return(t*=2)<1?.5*t*t*t:.5*((t-=2)*t*t+2)},e3={linear:NX,quadraticIn:OX,quadraticOut:DX,quadraticInOut:IX,cubicIn:LX,cubicOut:MX,cubicInOut:FX},t3={easing:"quadraticInOut",duration:150};function zX(e,t,n,r){var a=Object.assign({},t3,n),i=typeof a.easing=="function"?a.easing:e3[a.easing],l=Date.now(),u={};for(var c in t){var f=t[c];u[c]={};for(var p in f)u[c][p]=e.getNodeAttribute(c,p)}var g=null,b=function(){g=null;var S=(Date.now()-l)/a.duration;if(S>=1){for(var v in t){var A=t[v];for(var R in A)e.setNodeAttribute(v,R,A[R])}return}S=i(S);for(var x in t){var _=t[x],C=u[x];for(var N in _)e.setNodeAttribute(x,N,_[N]*S+C[N]*(1-S))}g=requestAnimationFrame(b)};return b(),function(){g&&cancelAnimationFrame(g)}}function _r(){return Float32Array.of(1,0,0,0,1,0,0,0,1)}function Kc(e,t,n){return e[0]=t,e[4]=typeof n=="number"?n:t,e}function uC(e,t){var n=Math.sin(t),r=Math.cos(t);return e[0]=r,e[1]=n,e[3]=-n,e[4]=r,e}function cC(e,t,n){return e[6]=t,e[7]=n,e}function io(e,t){var n=e[0],r=e[1],a=e[2],i=e[3],l=e[4],u=e[5],c=e[6],f=e[7],p=e[8],g=t[0],b=t[1],m=t[2],S=t[3],v=t[4],A=t[5],R=t[6],x=t[7],_=t[8];return e[0]=g*n+b*i+m*c,e[1]=g*r+b*l+m*f,e[2]=g*a+b*u+m*p,e[3]=S*n+v*i+A*c,e[4]=S*r+v*l+A*f,e[5]=S*a+v*u+A*p,e[6]=R*n+x*i+_*c,e[7]=R*r+x*l+_*f,e[8]=R*a+x*u+_*p,e}function Mx(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,r=e[0],a=e[1],i=e[3],l=e[4],u=e[6],c=e[7],f=t.x,p=t.y;return{x:f*r+p*i+u*n,y:f*a+p*l+c*n}}function PX(e,t){var n=e.height/e.width,r=t.height/t.width;return n<1&&r>1||n>1&&r<1?1:Math.min(Math.max(r,1/r),Math.max(1/n,n))}function Ps(e,t,n,r,a){var i=e.angle,l=e.ratio,u=e.x,c=e.y,f=t.width,p=t.height,g=_r(),b=Math.min(f,p)-2*r,m=PX(t,n);return a?(io(g,cC(_r(),u,c)),io(g,Kc(_r(),l)),io(g,uC(_r(),i)),io(g,Kc(_r(),f/b/2/m,p/b/2/m))):(io(g,Kc(_r(),2*(b/f)*m,2*(b/p)*m)),io(g,uC(_r(),-i)),io(g,Kc(_r(),1/l)),io(g,cC(_r(),-u,-c))),g}function BX(e,t,n){var r=Mx(e,{x:Math.cos(t.angle),y:Math.sin(t.angle)},0),a=r.x,i=r.y;return 1/Math.sqrt(Math.pow(a,2)+Math.pow(i,2))/n.width}function UX(e){if(!e.order)return{x:[0,1],y:[0,1]};var t=1/0,n=-1/0,r=1/0,a=-1/0;return e.forEachNode(function(i,l){var u=l.x,c=l.y;un&&(n=u),ca&&(a=c)}),{x:[t,n],y:[r,a]}}function jX(e){if(!CX(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 GX(e,t,n){var r=document.createElement(e);if(t)for(var a in t)r.style[a]=t[a];if(n)for(var i in n)r.setAttribute(i,n[i]);return r}function dC(){return typeof window.devicePixelRatio<"u"?window.devicePixelRatio:1}function fC(e,t,n){return n.sort(function(r,a){var i=t(r)||0,l=t(a)||0;return il?1:0})}function pC(e){var t=vl(e.x,2),n=t[0],r=t[1],a=vl(e.y,2),i=a[0],l=a[1],u=Math.max(r-n,l-i),c=(r+n)/2,f=(l+i)/2;(u===0||Math.abs(u)===1/0||isNaN(u))&&(u=1),isNaN(c)&&(c=0),isNaN(f)&&(f=0);var p=function(b){return{x:.5+(b.x-c)/u,y:.5+(b.y-f)/u}};return p.applyTo=function(g){g.x=.5+(g.x-c)/u,g.y=.5+(g.y-f)/u},p.inverse=function(g){return{x:c+u*(g.x-.5),y:f+u*(g.y-.5)}},p.ratio=u,p}function Fx(e){"@babel/helpers - typeof";return Fx=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},Fx(e)}function gC(e,t){var n=t.size;if(n!==0){var r=e.length;e.length+=n;var a=0;t.forEach(function(i){e[r+a]=i,a++})}}function Nh(e){e=e||{};for(var t=0,n=arguments.length<=1?0:arguments.length-1;t1&&arguments[1]!==void 0?arguments[1]:{},l=arguments.length>2?arguments[2]:void 0;if(!l)return new Promise(function(m){return a.animate(r,i,m)});if(this.enabled){var u=Be(Be({},t3),i),c=this.validateState(r),f=typeof u.easing=="function"?u.easing:e3[u.easing],p=Date.now(),g=this.getState(),b=function(){var S=(Date.now()-p)/u.duration;if(S>=1){a.nextFrame=null,a.setState(c),a.animationCallback&&(a.animationCallback.call(null),a.animationCallback=void 0);return}var v=f(S),A={};typeof c.x=="number"&&(A.x=g.x+(c.x-g.x)*v),typeof c.y=="number"&&(A.y=g.y+(c.y-g.y)*v),a.enabledRotation&&typeof c.angle=="number"&&(A.angle=g.angle+(c.angle-g.angle)*v),typeof c.ratio=="number"&&(A.ratio=g.ratio+(c.ratio-g.ratio)*v),a.setState(A),a.nextFrame=requestAnimationFrame(b)};this.nextFrame?(cancelAnimationFrame(this.nextFrame),this.animationCallback&&this.animationCallback.call(null),this.nextFrame=requestAnimationFrame(b)):b(),this.animationCallback=l}}},{key:"animatedZoom",value:function(r){return r?typeof r=="number"?this.animate({ratio:this.ratio/r}):this.animate({ratio:this.ratio/(r.factor||Xc)},r):this.animate({ratio:this.ratio/Xc})}},{key:"animatedUnzoom",value:function(r){return r?typeof r=="number"?this.animate({ratio:this.ratio*r}):this.animate({ratio:this.ratio*(r.factor||Xc)},r):this.animate({ratio:this.ratio*Xc})}},{key:"animatedReset",value:function(r){return this.animate({x:.5,y:.5,ratio:1,angle:0},r)}},{key:"copy",value:function(){return t.from(this.getState())}}],[{key:"from",value:function(r){var a=new t;return a.setState(r)}}])}(h0);function Cr(e,t){var n=t.getBoundingClientRect();return{x:e.clientX-n.left,y:e.clientY-n.top}}function Aa(e,t){var n=Be(Be({},Cr(e,t)),{},{sigmaDefaultPrevented:!1,preventSigmaDefault:function(){n.sigmaDefaultPrevented=!0},original:e});return n}function Bs(e){var t="x"in e?e:Be(Be({},e.touches[0]||e.previousTouches[0]),{},{original:e.original,sigmaDefaultPrevented:e.sigmaDefaultPrevented,preventSigmaDefault:function(){e.sigmaDefaultPrevented=!0,t.sigmaDefaultPrevented=!0}});return t}function VX(e,t){return Be(Be({},Aa(e,t)),{},{delta:n3(e)})}var WX=2;function vd(e){for(var t=[],n=0,r=Math.min(e.length,WX);n0;a.draggedEvents=0,g&&a.renderer.getSetting("hideEdgesOnMove")&&a.renderer.refresh()},0),this.emit("mouseup",Aa(r,this.container))}}},{key:"handleMove",value:function(r){var a=this;if(this.enabled){var i=Aa(r,this.container);if(this.emit("mousemovebody",i),(r.target===this.container||r.composedPath()[0]===this.container)&&this.emit("mousemove",i),!i.sigmaDefaultPrevented&&this.isMouseDown){this.isMoving=!0,this.draggedEvents++,typeof this.movingTimeout=="number"&&clearTimeout(this.movingTimeout),this.movingTimeout=window.setTimeout(function(){a.movingTimeout=null,a.isMoving=!1},this.settings.dragTimeout);var l=this.renderer.getCamera(),u=Cr(r,this.container),c=u.x,f=u.y,p=this.renderer.viewportToFramedGraph({x:this.lastMouseX,y:this.lastMouseY}),g=this.renderer.viewportToFramedGraph({x:c,y:f}),b=p.x-g.x,m=p.y-g.y,S=l.getState(),v=S.x+b,A=S.y+m;l.setState({x:v,y:A}),this.lastMouseX=c,this.lastMouseY=f,r.preventDefault(),r.stopPropagation()}}}},{key:"handleLeave",value:function(r){this.emit("mouseleave",Aa(r,this.container))}},{key:"handleEnter",value:function(r){this.emit("mouseenter",Aa(r,this.container))}},{key:"handleWheel",value:function(r){var a=this,i=this.renderer.getCamera();if(!(!this.enabled||!i.enabledZooming)){var l=n3(r);if(l){var u=VX(r,this.container);if(this.emit("wheel",u),u.sigmaDefaultPrevented){r.preventDefault(),r.stopPropagation();return}var c=i.getState().ratio,f=l>0?1/this.settings.zoomingRatio:this.settings.zoomingRatio,p=i.getBoundedRatio(c*f),g=l>0?1:-1,b=Date.now();c!==p&&(r.preventDefault(),r.stopPropagation(),!(this.currentWheelDirection===g&&this.lastWheelTriggerTime&&b-this.lastWheelTriggerTimer.size?-1:n.sizer.key?1:-1}}])}(),yC=function(){function e(){on(this,e),_e(this,"width",0),_e(this,"height",0),_e(this,"cellSize",0),_e(this,"columns",0),_e(this,"rows",0),_e(this,"cells",{})}return ln(e,[{key:"resizeAndClear",value:function(n,r){this.width=n.width,this.height=n.height,this.cellSize=r,this.columns=Math.ceil(n.width/r),this.rows=Math.ceil(n.height/r),this.cells={}}},{key:"getIndex",value:function(n){var r=Math.floor(n.x/this.cellSize),a=Math.floor(n.y/this.cellSize);return a*this.columns+r}},{key:"add",value:function(n,r,a){var i=new bC(n,r),l=this.getIndex(a),u=this.cells[l];u||(u=[],this.cells[l]=u),u.push(i)}},{key:"organize",value:function(){for(var n in this.cells){var r=this.cells[n];r.sort(bC.compare)}}},{key:"getLabelsToDisplay",value:function(n,r){var a=this.cellSize*this.cellSize,i=a/n/n,l=i*r/a,u=Math.ceil(l),c=[];for(var f in this.cells)for(var p=this.cells[f],g=0;g2&&arguments[2]!==void 0?arguments[2]:{};if(on(this,t),a=Bn(this,t),_e(a,"elements",{}),_e(a,"canvasContexts",{}),_e(a,"webGLContexts",{}),_e(a,"pickingLayers",new Set),_e(a,"textures",{}),_e(a,"frameBuffers",{}),_e(a,"activeListeners",{}),_e(a,"labelGrid",new yC),_e(a,"nodeDataCache",{}),_e(a,"edgeDataCache",{}),_e(a,"nodeProgramIndex",{}),_e(a,"edgeProgramIndex",{}),_e(a,"nodesWithForcedLabels",new Set),_e(a,"edgesWithForcedLabels",new Set),_e(a,"nodeExtent",{x:[0,1],y:[0,1]}),_e(a,"nodeZExtent",[1/0,-1/0]),_e(a,"edgeZExtent",[1/0,-1/0]),_e(a,"matrix",_r()),_e(a,"invMatrix",_r()),_e(a,"correctionRatio",1),_e(a,"customBBox",null),_e(a,"normalizationFunction",pC({x:[0,1],y:[0,1]})),_e(a,"graphToViewportRatio",1),_e(a,"itemIDsIndex",{}),_e(a,"nodeIndices",{}),_e(a,"edgeIndices",{}),_e(a,"width",0),_e(a,"height",0),_e(a,"pixelRatio",dC()),_e(a,"pickingDownSizingRatio",2*a.pixelRatio),_e(a,"displayedNodeLabels",new Set),_e(a,"displayedEdgeLabels",new Set),_e(a,"highlightedNodes",new Set),_e(a,"hoveredNode",null),_e(a,"hoveredEdge",null),_e(a,"renderFrame",null),_e(a,"renderHighlightedNodesFrame",null),_e(a,"needToProcess",!1),_e(a,"checkEdgesEventsFrame",null),_e(a,"nodePrograms",{}),_e(a,"nodeHoverPrograms",{}),_e(a,"edgePrograms",{}),a.settings=qX(i),Oh(a.settings),jX(n),!(r instanceof HTMLElement))throw new Error("Sigma: container should be an html element.");a.graph=n,a.container=r,a.createWebGLContext("edges",{picking:i.enableEdgeEvents}),a.createCanvasContext("edgeLabels"),a.createWebGLContext("nodes",{picking:!0}),a.createCanvasContext("labels"),a.createCanvasContext("hovers"),a.createWebGLContext("hoverNodes"),a.createCanvasContext("mouse",{style:{touchAction:"none",userSelect:"none"}}),a.resize();for(var l in a.settings.nodeProgramClasses)a.registerNodeProgram(l,a.settings.nodeProgramClasses[l],a.settings.nodeHoverProgramClasses[l]);for(var u in a.settings.edgeProgramClasses)a.registerEdgeProgram(u,a.settings.edgeProgramClasses[u]);return a.camera=new hC,a.bindCameraHandlers(),a.mouseCaptor=new XX(a.elements.mouse,a),a.mouseCaptor.setSettings(a.settings),a.touchCaptor=new JX(a.elements.mouse,a),a.touchCaptor.setSettings(a.settings),a.bindEventHandlers(),a.bindGraphHandlers(),a.handleSettingsUpdate(),a.refresh(),a}return Un(t,e),ln(t,[{key:"registerNodeProgram",value:function(r,a,i){return this.nodePrograms[r]&&this.nodePrograms[r].kill(),this.nodeHoverPrograms[r]&&this.nodeHoverPrograms[r].kill(),this.nodePrograms[r]=new a(this.webGLContexts.nodes,this.frameBuffers.nodes,this),this.nodeHoverPrograms[r]=new(i||a)(this.webGLContexts.hoverNodes,null,this),this}},{key:"registerEdgeProgram",value:function(r,a){return this.edgePrograms[r]&&this.edgePrograms[r].kill(),this.edgePrograms[r]=new a(this.webGLContexts.edges,this.frameBuffers.edges,this),this}},{key:"unregisterNodeProgram",value:function(r){if(this.nodePrograms[r]){var a=this.nodePrograms,i=a[r],l=Dh(a,[r].map(Ws));i.kill(),this.nodePrograms=l}if(this.nodeHoverPrograms[r]){var u=this.nodeHoverPrograms,c=u[r],f=Dh(u,[r].map(Ws));c.kill(),this.nodePrograms=f}return this}},{key:"unregisterEdgeProgram",value:function(r){if(this.edgePrograms[r]){var a=this.edgePrograms,i=a[r],l=Dh(a,[r].map(Ws));i.kill(),this.edgePrograms=l}return this}},{key:"resetWebGLTexture",value:function(r){var a=this.webGLContexts[r],i=this.frameBuffers[r],l=this.textures[r];l&&a.deleteTexture(l);var u=a.createTexture();return a.bindFramebuffer(a.FRAMEBUFFER,i),a.bindTexture(a.TEXTURE_2D,u),a.texImage2D(a.TEXTURE_2D,0,a.RGBA,this.width,this.height,0,a.RGBA,a.UNSIGNED_BYTE,null),a.framebufferTexture2D(a.FRAMEBUFFER,a.COLOR_ATTACHMENT0,a.TEXTURE_2D,u,0),this.textures[r]=u,this}},{key:"bindCameraHandlers",value:function(){var r=this;return this.activeListeners.camera=function(){r.scheduleRender()},this.camera.on("updated",this.activeListeners.camera),this}},{key:"unbindCameraHandlers",value:function(){return this.camera.removeListener("updated",this.activeListeners.camera),this}},{key:"getNodeAtPosition",value:function(r){var a=r.x,i=r.y,l=JR(this.webGLContexts.nodes,this.frameBuffers.nodes,a,i,this.pixelRatio,this.pickingDownSizingRatio),u=QR.apply(void 0,mC(l)),c=this.itemIDsIndex[u];return c&&c.type==="node"?c.id:null}},{key:"bindEventHandlers",value:function(){var r=this;this.activeListeners.handleResize=function(){r.scheduleRefresh()},window.addEventListener("resize",this.activeListeners.handleResize),this.activeListeners.handleMove=function(i){var l=Bs(i),u={event:l,preventSigmaDefault:function(){l.preventSigmaDefault()}},c=r.getNodeAtPosition(l);if(c&&r.hoveredNode!==c&&!r.nodeDataCache[c].hidden){r.hoveredNode&&r.emit("leaveNode",Be(Be({},u),{},{node:r.hoveredNode})),r.hoveredNode=c,r.emit("enterNode",Be(Be({},u),{},{node:c})),r.scheduleHighlightedNodesRender();return}if(r.hoveredNode&&r.getNodeAtPosition(l)!==r.hoveredNode){var f=r.hoveredNode;r.hoveredNode=null,r.emit("leaveNode",Be(Be({},u),{},{node:f})),r.scheduleHighlightedNodesRender();return}if(r.settings.enableEdgeEvents){var p=r.hoveredNode?null:r.getEdgeAtPoint(u.event.x,u.event.y);p!==r.hoveredEdge&&(r.hoveredEdge&&r.emit("leaveEdge",Be(Be({},u),{},{edge:r.hoveredEdge})),p&&r.emit("enterEdge",Be(Be({},u),{},{edge:p})),r.hoveredEdge=p)}},this.activeListeners.handleMoveBody=function(i){var l=Bs(i);r.emit("moveBody",{event:l,preventSigmaDefault:function(){l.preventSigmaDefault()}})},this.activeListeners.handleLeave=function(i){var l=Bs(i),u={event:l,preventSigmaDefault:function(){l.preventSigmaDefault()}};r.hoveredNode&&(r.emit("leaveNode",Be(Be({},u),{},{node:r.hoveredNode})),r.scheduleHighlightedNodesRender()),r.settings.enableEdgeEvents&&r.hoveredEdge&&(r.emit("leaveEdge",Be(Be({},u),{},{edge:r.hoveredEdge})),r.scheduleHighlightedNodesRender()),r.emit("leaveStage",Be({},u))},this.activeListeners.handleEnter=function(i){var l=Bs(i),u={event:l,preventSigmaDefault:function(){l.preventSigmaDefault()}};r.emit("enterStage",Be({},u))};var a=function(l){return function(u){var c=Bs(u),f={event:c,preventSigmaDefault:function(){c.preventSigmaDefault()}},p=r.getNodeAtPosition(c);if(p)return r.emit("".concat(l,"Node"),Be(Be({},f),{},{node:p}));if(r.settings.enableEdgeEvents){var g=r.getEdgeAtPoint(c.x,c.y);if(g)return r.emit("".concat(l,"Edge"),Be(Be({},f),{},{edge:g}))}return r.emit("".concat(l,"Stage"),f)}};return this.activeListeners.handleClick=a("click"),this.activeListeners.handleRightClick=a("rightClick"),this.activeListeners.handleDoubleClick=a("doubleClick"),this.activeListeners.handleWheel=a("wheel"),this.activeListeners.handleDown=a("down"),this.activeListeners.handleUp=a("up"),this.mouseCaptor.on("mousemove",this.activeListeners.handleMove),this.mouseCaptor.on("mousemovebody",this.activeListeners.handleMoveBody),this.mouseCaptor.on("click",this.activeListeners.handleClick),this.mouseCaptor.on("rightClick",this.activeListeners.handleRightClick),this.mouseCaptor.on("doubleClick",this.activeListeners.handleDoubleClick),this.mouseCaptor.on("wheel",this.activeListeners.handleWheel),this.mouseCaptor.on("mousedown",this.activeListeners.handleDown),this.mouseCaptor.on("mouseup",this.activeListeners.handleUp),this.mouseCaptor.on("mouseleave",this.activeListeners.handleLeave),this.mouseCaptor.on("mouseenter",this.activeListeners.handleEnter),this.touchCaptor.on("touchdown",this.activeListeners.handleDown),this.touchCaptor.on("touchdown",this.activeListeners.handleMove),this.touchCaptor.on("touchup",this.activeListeners.handleUp),this.touchCaptor.on("touchmove",this.activeListeners.handleMove),this.touchCaptor.on("tap",this.activeListeners.handleClick),this.touchCaptor.on("doubletap",this.activeListeners.handleDoubleClick),this.touchCaptor.on("touchmove",this.activeListeners.handleMoveBody),this}},{key:"bindGraphHandlers",value:function(){var r=this,a=this.graph,i=new Set(["x","y","zIndex","type"]);return this.activeListeners.eachNodeAttributesUpdatedGraphUpdate=function(l){var u,c=(u=l.hints)===null||u===void 0?void 0:u.attributes;r.graph.forEachNode(function(p){return r.updateNode(p)});var f=!c||c.some(function(p){return i.has(p)});r.refresh({partialGraph:{nodes:a.nodes()},skipIndexation:!f,schedule:!0})},this.activeListeners.eachEdgeAttributesUpdatedGraphUpdate=function(l){var u,c=(u=l.hints)===null||u===void 0?void 0:u.attributes;r.graph.forEachEdge(function(p){return r.updateEdge(p)});var f=c&&["zIndex","type"].some(function(p){return c==null?void 0:c.includes(p)});r.refresh({partialGraph:{edges:a.edges()},skipIndexation:!f,schedule:!0})},this.activeListeners.addNodeGraphUpdate=function(l){var u=l.key;r.addNode(u),r.refresh({partialGraph:{nodes:[u]},skipIndexation:!1,schedule:!0})},this.activeListeners.updateNodeGraphUpdate=function(l){var u=l.key;r.refresh({partialGraph:{nodes:[u]},skipIndexation:!1,schedule:!0})},this.activeListeners.dropNodeGraphUpdate=function(l){var u=l.key;r.removeNode(u),r.refresh({schedule:!0})},this.activeListeners.addEdgeGraphUpdate=function(l){var u=l.key;r.addEdge(u),r.refresh({partialGraph:{edges:[u]},schedule:!0})},this.activeListeners.updateEdgeGraphUpdate=function(l){var u=l.key;r.refresh({partialGraph:{edges:[u]},skipIndexation:!1,schedule:!0})},this.activeListeners.dropEdgeGraphUpdate=function(l){var u=l.key;r.removeEdge(u),r.refresh({schedule:!0})},this.activeListeners.clearEdgesGraphUpdate=function(){r.clearEdgeState(),r.clearEdgeIndices(),r.refresh({schedule:!0})},this.activeListeners.clearGraphUpdate=function(){r.clearEdgeState(),r.clearNodeState(),r.clearEdgeIndices(),r.clearNodeIndices(),r.refresh({schedule:!0})},a.on("nodeAdded",this.activeListeners.addNodeGraphUpdate),a.on("nodeDropped",this.activeListeners.dropNodeGraphUpdate),a.on("nodeAttributesUpdated",this.activeListeners.updateNodeGraphUpdate),a.on("eachNodeAttributesUpdated",this.activeListeners.eachNodeAttributesUpdatedGraphUpdate),a.on("edgeAdded",this.activeListeners.addEdgeGraphUpdate),a.on("edgeDropped",this.activeListeners.dropEdgeGraphUpdate),a.on("edgeAttributesUpdated",this.activeListeners.updateEdgeGraphUpdate),a.on("eachEdgeAttributesUpdated",this.activeListeners.eachEdgeAttributesUpdatedGraphUpdate),a.on("edgesCleared",this.activeListeners.clearEdgesGraphUpdate),a.on("cleared",this.activeListeners.clearGraphUpdate),this}},{key:"unbindGraphHandlers",value:function(){var r=this.graph;r.removeListener("nodeAdded",this.activeListeners.addNodeGraphUpdate),r.removeListener("nodeDropped",this.activeListeners.dropNodeGraphUpdate),r.removeListener("nodeAttributesUpdated",this.activeListeners.updateNodeGraphUpdate),r.removeListener("eachNodeAttributesUpdated",this.activeListeners.eachNodeAttributesUpdatedGraphUpdate),r.removeListener("edgeAdded",this.activeListeners.addEdgeGraphUpdate),r.removeListener("edgeDropped",this.activeListeners.dropEdgeGraphUpdate),r.removeListener("edgeAttributesUpdated",this.activeListeners.updateEdgeGraphUpdate),r.removeListener("eachEdgeAttributesUpdated",this.activeListeners.eachEdgeAttributesUpdatedGraphUpdate),r.removeListener("edgesCleared",this.activeListeners.clearEdgesGraphUpdate),r.removeListener("cleared",this.activeListeners.clearGraphUpdate)}},{key:"getEdgeAtPoint",value:function(r,a){var i=JR(this.webGLContexts.edges,this.frameBuffers.edges,r,a,this.pixelRatio,this.pickingDownSizingRatio),l=QR.apply(void 0,mC(i)),u=this.itemIDsIndex[l];return u&&u.type==="edge"?u.id:null}},{key:"process",value:function(){var r=this;this.emit("beforeProcess");var a=this.graph,i=this.settings,l=this.getDimensions();if(this.nodeExtent=UX(this.graph),!this.settings.autoRescale){var u=l.width,c=l.height,f=this.nodeExtent,p=f.x,g=f.y;this.nodeExtent={x:[(p[0]+p[1])/2-u/2,(p[0]+p[1])/2+u/2],y:[(g[0]+g[1])/2-c/2,(g[0]+g[1])/2+c/2]}}this.normalizationFunction=pC(this.customBBox||this.nodeExtent);var b=new hC,m=Ps(b.getState(),l,this.getGraphDimensions(),this.getStagePadding());this.labelGrid.resizeAndClear(l,i.labelGridCellSize);for(var S={},v={},A={},R={},x=1,_=a.nodes(),C=0,N=_.length;C1&&arguments[1]!==void 0?arguments[1]:{},i=a.tolerance,l=i===void 0?0:i,u=a.boundaries,c=Be({},r),f=u||this.nodeExtent,p=vl(f.x,2),g=p[0],b=p[1],m=vl(f.y,2),S=m[0],v=m[1],A=[this.graphToViewport({x:g,y:S},{cameraState:r}),this.graphToViewport({x:b,y:S},{cameraState:r}),this.graphToViewport({x:g,y:v},{cameraState:r}),this.graphToViewport({x:b,y:v},{cameraState:r})],R=1/0,x=-1/0,_=1/0,C=-1/0;A.forEach(function(W){var Z=W.x,j=W.y;R=Math.min(R,Z),x=Math.max(x,Z),_=Math.min(_,j),C=Math.max(C,j)});var N=x-R,T=C-_,O=this.getDimensions(),z=O.width,I=O.height,M=0,H=0;if(N>=z?xl&&(M=R-l):x>z+l?M=x-(z+l):R<-l&&(M=R+l),T>=I?Cl&&(H=_-l):C>I+l?H=C-(I+l):_<-l&&(H=_+l),M||H){var q=this.viewportToFramedGraph({x:0,y:0},{cameraState:r}),U=this.viewportToFramedGraph({x:M,y:H},{cameraState:r});M=U.x-q.x,H=U.y-q.y,c.x+=M,c.y+=H}return c}},{key:"renderLabels",value:function(){if(!this.settings.renderLabels)return this;var r=this.camera.getState(),a=this.labelGrid.getLabelsToDisplay(r.ratio,this.settings.labelDensity);gC(a,this.nodesWithForcedLabels),this.displayedNodeLabels=new Set;for(var i=this.canvasContexts.labels,l=0,u=a.length;lthis.width+oZ||b<-50||b>this.height+iZ)){this.displayedNodeLabels.add(c);var S=this.settings.defaultDrawNodeLabel,v=this.nodePrograms[f.type],A=(v==null?void 0:v.drawLabel)||S;A(i,Be(Be({key:c},f),{},{size:m,x:g,y:b}),this.settings)}}}return this}},{key:"renderEdgeLabels",value:function(){if(!this.settings.renderEdgeLabels)return this;var r=this.canvasContexts.edgeLabels;r.clearRect(0,0,this.width,this.height);var a=aZ({graph:this.graph,hoveredNode:this.hoveredNode,displayedNodeLabels:this.displayedNodeLabels,highlightedNodes:this.highlightedNodes});gC(a,this.edgesWithForcedLabels);for(var i=new Set,l=0,u=a.length;lthis.nodeZExtent[1]&&(this.nodeZExtent[1]=i.zIndex))}},{key:"updateNode",value:function(r){this.addNode(r);var a=this.nodeDataCache[r];this.normalizationFunction.applyTo(a)}},{key:"removeNode",value:function(r){delete this.nodeDataCache[r],delete this.nodeProgramIndex[r],this.highlightedNodes.delete(r),this.hoveredNode===r&&(this.hoveredNode=null),this.nodesWithForcedLabels.delete(r)}},{key:"addEdge",value:function(r){var a=Object.assign({},this.graph.getEdgeAttributes(r));this.settings.edgeReducer&&(a=this.settings.edgeReducer(r,a));var i=sZ(this.settings,r,a);this.edgeDataCache[r]=i,this.edgesWithForcedLabels.delete(r),i.forceLabel&&!i.hidden&&this.edgesWithForcedLabels.add(r),this.settings.zIndex&&(i.zIndex
W<=0)){var H,q;const W=(((H=i.flip)==null?void 0:H.index)||0)+1,Z=O[W];if(Z)return{data:{index:W,overflows:M},reset:{placement:Z}};let j=(q=M.filter(G=>G.overflows[0]<=0).sort((G,P)=>G.overflows[1]-P.overflows[1])[0])==null?void 0:q.placement;if(!j)switch(m){case"bestFit":{var U;const G=(U=M.filter(P=>{if(T){const X=vo(P.placement);return X===x||X==="y"}return!0}).map(P=>[P.placement,P.overflows.filter(X=>X>0).reduce((X,D)=>X+D,0)]).sort((P,X)=>P[1]-X[1])[0])==null?void 0:U[0];G&&(j=G);break}case"initialPlacement":j=u;break}if(a!==j)return{reset:{placement:j}}}return{}}}};function PR(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function BR(e){return J7.some(t=>e[t]>=0)}const cV=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...a}=Da(e,t);switch(r){case"referenceHidden":{const i=await Js(t,{...a,elementContext:"reference"}),l=PR(i,n.reference);return{data:{referenceHiddenOffsets:l,referenceHidden:BR(l)}}}case"escaped":{const i=await Js(t,{...a,altBoundary:!0}),l=PR(i,n.floating);return{data:{escapedOffsets:l,escaped:BR(l)}}}default:return{}}}}};async function dV(e,t){const{placement:n,platform:r,elements:a}=e,i=await(r.isRTL==null?void 0:r.isRTL(a.floating)),l=Ia(n),u=_l(n),c=vo(n)==="y",f=["left","top"].includes(l)?-1:1,p=i&&c?-1:1,g=Da(t,e);let{mainAxis:b,crossAxis:m,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"&&(m=u==="end"?S*-1:S),c?{x:m*p,y:b*f}:{x:b*f,y:m*p}}const fV=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:a,y:i,placement:l,middlewareData:u}=t,c=await dV(t,e);return l===((n=u.offset)==null?void 0:n.placement)&&(r=u.arrow)!=null&&r.alignmentOffset?{}:{x:a+c.x,y:i+c.y,data:{...c,placement:l}}}}},pV=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:a}=t,{mainAxis:i=!0,crossAxis:l=!1,limiter:u={fn:A=>{let{x:R,y:x}=A;return{x:R,y:x}}},...c}=Da(e,t),f={x:n,y:r},p=await Js(t,c),g=vo(Ia(a)),b=Hk(g);let m=f[b],S=f[g];if(i){const A=b==="y"?"top":"left",R=b==="y"?"bottom":"right",x=m+p[A],_=m-p[R];m=Ax(x,m,_)}if(l){const A=g==="y"?"top":"left",R=g==="y"?"bottom":"right",x=S+p[A],_=S-p[R];S=Ax(x,S,_)}const v=u.fn({...t,[b]:m,[g]:S});return{...v,data:{x:v.x-n,y:v.y-r,enabled:{[b]:i,[g]:l}}}}}},gV=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:a,rects:i,middlewareData:l}=t,{offset:u=0,mainAxis:c=!0,crossAxis:f=!0}=Da(e,t),p={x:n,y:r},g=vo(a),b=Hk(g);let m=p[b],S=p[g];const v=Da(u,t),A=typeof v=="number"?{mainAxis:v,crossAxis:0}:{mainAxis:0,crossAxis:0,...v};if(c){const _=b==="y"?"height":"width",C=i.reference[b]-i.floating[_]+A.mainAxis,N=i.reference[b]+i.reference[_]-A.mainAxis;mN&&(m=N)}if(f){var R,x;const _=b==="y"?"width":"height",C=["top","left"].includes(Ia(a)),N=i.reference[g]-i.floating[_]+(C&&((R=l.offset)==null?void 0:R[g])||0)+(C?0:A.crossAxis),T=i.reference[g]+i.reference[_]+(C?0:((x=l.offset)==null?void 0:x[g])||0)-(C?A.crossAxis:0);ST&&(S=T)}return{[b]:m,[g]:S}}}},hV=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:a,rects:i,platform:l,elements:u}=t,{apply:c=()=>{},...f}=Da(e,t),p=await Js(t,f),g=Ia(a),b=_l(a),m=vo(a)==="y",{width:S,height:v}=i.floating;let A,R;g==="top"||g==="bottom"?(A=g,R=b===(await(l.isRTL==null?void 0:l.isRTL(u.floating))?"start":"end")?"left":"right"):(R=g,A=b==="end"?"top":"bottom");const x=v-p.top-p.bottom,_=S-p.left-p.right,C=yo(v-p[A],x),N=yo(S-p[R],_),T=!t.middlewareData.shift;let O=C,z=N;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(z=_),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(O=x),T&&!b){const M=Kn(p.left,0),H=Kn(p.right,0),q=Kn(p.top,0),U=Kn(p.bottom,0);m?z=S-2*(M!==0||H!==0?M+H:Kn(p.left,p.right)):O=v-2*(q!==0||U!==0?q+U:Kn(p.top,p.bottom))}await c({...t,availableWidth:z,availableHeight:O});const I=await l.getDimensions(u.floating);return S!==I.width||v!==I.height?{reset:{rects:!0}}:{}}}};function mf(){return typeof window<"u"}function Rl(e){return sB(e)?(e.nodeName||"").toLowerCase():"#document"}function Zn(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Zr(e){var t;return(t=(sB(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function sB(e){return mf()?e instanceof Node||e instanceof Zn(e).Node:!1}function Dr(e){return mf()?e instanceof Element||e instanceof Zn(e).Element:!1}function Xr(e){return mf()?e instanceof HTMLElement||e instanceof Zn(e).HTMLElement:!1}function UR(e){return!mf()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Zn(e).ShadowRoot}function hu(e){const{overflow:t,overflowX:n,overflowY:r,display:a}=Ir(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(a)}function mV(e){return["table","td","th"].includes(Rl(e))}function bf(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function Vk(e){const t=Wk(),n=Dr(e)?Ir(e):e;return["transform","translate","scale","rotate","perspective"].some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||["transform","translate","scale","rotate","perspective","filter"].some(r=>(n.willChange||"").includes(r))||["paint","layout","strict","content"].some(r=>(n.contain||"").includes(r))}function bV(e){let t=So(e);for(;Xr(t)&&!hl(t);){if(Vk(t))return t;if(bf(t))return null;t=So(t)}return null}function Wk(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function hl(e){return["html","body","#document"].includes(Rl(e))}function Ir(e){return Zn(e).getComputedStyle(e)}function yf(e){return Dr(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function So(e){if(Rl(e)==="html")return e;const t=e.assignedSlot||e.parentNode||UR(e)&&e.host||Zr(e);return UR(t)?t.host:t}function uB(e){const t=So(e);return hl(t)?e.ownerDocument?e.ownerDocument.body:e.body:Xr(t)&&hu(t)?t:uB(t)}function eu(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const a=uB(e),i=a===((r=e.ownerDocument)==null?void 0:r.body),l=Zn(a);if(i){const u=_x(l);return t.concat(l,l.visualViewport||[],hu(a)?a:[],u&&n?eu(u):[])}return t.concat(a,eu(a,[],n))}function _x(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function cB(e){const t=Ir(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const a=Xr(e),i=a?e.offsetWidth:n,l=a?e.offsetHeight:r,u=Id(n)!==i||Id(r)!==l;return u&&(n=i,r=l),{width:n,height:r,$:u}}function Yk(e){return Dr(e)?e:e.contextElement}function dl(e){const t=Yk(e);if(!Xr(t))return Kr(1);const n=t.getBoundingClientRect(),{width:r,height:a,$:i}=cB(t);let l=(i?Id(n.width):n.width)/r,u=(i?Id(n.height):n.height)/a;return(!l||!Number.isFinite(l))&&(l=1),(!u||!Number.isFinite(u))&&(u=1),{x:l,y:u}}const yV=Kr(0);function dB(e){const t=Zn(e);return!Wk()||!t.visualViewport?yV:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function vV(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Zn(e)?!1:t}function oi(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const a=e.getBoundingClientRect(),i=Yk(e);let l=Kr(1);t&&(r?Dr(r)&&(l=dl(r)):l=dl(e));const u=vV(i,n,r)?dB(i):Kr(0);let c=(a.left+u.x)/l.x,f=(a.top+u.y)/l.y,p=a.width/l.x,g=a.height/l.y;if(i){const b=Zn(i),m=r&&Dr(r)?Zn(r):r;let S=b,v=_x(S);for(;v&&r&&m!==S;){const A=dl(v),R=v.getBoundingClientRect(),x=Ir(v),_=R.left+(v.clientLeft+parseFloat(x.paddingLeft))*A.x,C=R.top+(v.clientTop+parseFloat(x.paddingTop))*A.y;c*=A.x,f*=A.y,p*=A.x,g*=A.y,c+=_,f+=C,S=Zn(v),v=_x(S)}}return Md({width:p,height:g,x:c,y:f})}function Kk(e,t){const n=yf(e).scrollLeft;return t?t.left+n:oi(Zr(e)).left+n}function fB(e,t,n){n===void 0&&(n=!1);const r=e.getBoundingClientRect(),a=r.left+t.scrollLeft-(n?0:Kk(e,r)),i=r.top+t.scrollTop;return{x:a,y:i}}function SV(e){let{elements:t,rect:n,offsetParent:r,strategy:a}=e;const i=a==="fixed",l=Zr(r),u=t?bf(t.floating):!1;if(r===l||u&&i)return n;let c={scrollLeft:0,scrollTop:0},f=Kr(1);const p=Kr(0),g=Xr(r);if((g||!g&&!i)&&((Rl(r)!=="body"||hu(l))&&(c=yf(r)),Xr(r))){const m=oi(r);f=dl(r),p.x=m.x+r.clientLeft,p.y=m.y+r.clientTop}const b=l&&!g&&!i?fB(l,c,!0):Kr(0);return{width:n.width*f.x,height:n.height*f.y,x:n.x*f.x-c.scrollLeft*f.x+p.x+b.x,y:n.y*f.y-c.scrollTop*f.y+p.y+b.y}}function EV(e){return Array.from(e.getClientRects())}function wV(e){const t=Zr(e),n=yf(e),r=e.ownerDocument.body,a=Kn(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=Kn(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let l=-n.scrollLeft+Kk(e);const u=-n.scrollTop;return Ir(r).direction==="rtl"&&(l+=Kn(t.clientWidth,r.clientWidth)-a),{width:a,height:i,x:l,y:u}}function xV(e,t){const n=Zn(e),r=Zr(e),a=n.visualViewport;let i=r.clientWidth,l=r.clientHeight,u=0,c=0;if(a){i=a.width,l=a.height;const f=Wk();(!f||f&&t==="fixed")&&(u=a.offsetLeft,c=a.offsetTop)}return{width:i,height:l,x:u,y:c}}function kV(e,t){const n=oi(e,!0,t==="fixed"),r=n.top+e.clientTop,a=n.left+e.clientLeft,i=Xr(e)?dl(e):Kr(1),l=e.clientWidth*i.x,u=e.clientHeight*i.y,c=a*i.x,f=r*i.y;return{width:l,height:u,x:c,y:f}}function jR(e,t,n){let r;if(t==="viewport")r=xV(e,n);else if(t==="document")r=wV(Zr(e));else if(Dr(t))r=kV(t,n);else{const a=dB(e);r={x:t.x-a.x,y:t.y-a.y,width:t.width,height:t.height}}return Md(r)}function pB(e,t){const n=So(e);return n===t||!Dr(n)||hl(n)?!1:Ir(n).position==="fixed"||pB(n,t)}function AV(e,t){const n=t.get(e);if(n)return n;let r=eu(e,[],!1).filter(u=>Dr(u)&&Rl(u)!=="body"),a=null;const i=Ir(e).position==="fixed";let l=i?So(e):e;for(;Dr(l)&&!hl(l);){const u=Ir(l),c=Vk(l);!c&&u.position==="fixed"&&(a=null),(i?!c&&!a:!c&&u.position==="static"&&!!a&&["absolute","fixed"].includes(a.position)||hu(l)&&!c&&pB(e,l))?r=r.filter(p=>p!==l):a=u,l=So(l)}return t.set(e,r),r}function TV(e){let{element:t,boundary:n,rootBoundary:r,strategy:a}=e;const l=[...n==="clippingAncestors"?bf(t)?[]:AV(t,this._c):[].concat(n),r],u=l[0],c=l.reduce((f,p)=>{const g=jR(t,p,a);return f.top=Kn(g.top,f.top),f.right=yo(g.right,f.right),f.bottom=yo(g.bottom,f.bottom),f.left=Kn(g.left,f.left),f},jR(t,u,a));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function _V(e){const{width:t,height:n}=cB(e);return{width:t,height:n}}function RV(e,t,n){const r=Xr(t),a=Zr(t),i=n==="fixed",l=oi(e,!0,i,t);let u={scrollLeft:0,scrollTop:0};const c=Kr(0);if(r||!r&&!i)if((Rl(t)!=="body"||hu(a))&&(u=yf(t)),r){const b=oi(t,!0,i,t);c.x=b.x+t.clientLeft,c.y=b.y+t.clientTop}else a&&(c.x=Kk(a));const f=a&&!r&&!i?fB(a,u):Kr(0),p=l.left+u.scrollLeft-c.x-f.x,g=l.top+u.scrollTop-c.y-f.y;return{x:p,y:g,width:l.width,height:l.height}}function Sh(e){return Ir(e).position==="static"}function GR(e,t){if(!Xr(e)||Ir(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Zr(e)===n&&(n=n.ownerDocument.body),n}function gB(e,t){const n=Zn(e);if(bf(e))return n;if(!Xr(e)){let a=So(e);for(;a&&!hl(a);){if(Dr(a)&&!Sh(a))return a;a=So(a)}return n}let r=GR(e,t);for(;r&&mV(r)&&Sh(r);)r=GR(r,t);return r&&hl(r)&&Sh(r)&&!Vk(r)?n:r||bV(e)||n}const CV=async function(e){const t=this.getOffsetParent||gB,n=this.getDimensions,r=await n(e.floating);return{reference:RV(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function NV(e){return Ir(e).direction==="rtl"}const OV={convertOffsetParentRelativeRectToViewportRelativeRect:SV,getDocumentElement:Zr,getClippingRect:TV,getOffsetParent:gB,getElementRects:CV,getClientRects:EV,getDimensions:_V,getScale:dl,isElement:Dr,isRTL:NV};function hB(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function DV(e,t){let n=null,r;const a=Zr(e);function i(){var u;clearTimeout(r),(u=n)==null||u.disconnect(),n=null}function l(u,c){u===void 0&&(u=!1),c===void 0&&(c=1),i();const f=e.getBoundingClientRect(),{left:p,top:g,width:b,height:m}=f;if(u||t(),!b||!m)return;const S=Gc(g),v=Gc(a.clientWidth-(p+b)),A=Gc(a.clientHeight-(g+m)),R=Gc(p),_={rootMargin:-S+"px "+-v+"px "+-A+"px "+-R+"px",threshold:Kn(0,yo(1,c))||1};let C=!0;function N(T){const O=T[0].intersectionRatio;if(O!==c){if(!C)return l();O?l(!1,O):r=setTimeout(()=>{l(!1,1e-7)},1e3)}O===1&&!hB(f,e.getBoundingClientRect())&&l(),C=!1}try{n=new IntersectionObserver(N,{..._,root:a.ownerDocument})}catch{n=new IntersectionObserver(N,_)}n.observe(e)}return l(!0),i}function IV(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:a=!0,ancestorResize:i=!0,elementResize:l=typeof ResizeObserver=="function",layoutShift:u=typeof IntersectionObserver=="function",animationFrame:c=!1}=r,f=Yk(e),p=a||i?[...f?eu(f):[],...eu(t)]:[];p.forEach(R=>{a&&R.addEventListener("scroll",n,{passive:!0}),i&&R.addEventListener("resize",n)});const g=f&&u?DV(f,n):null;let b=-1,m=null;l&&(m=new ResizeObserver(R=>{let[x]=R;x&&x.target===f&&m&&(m.unobserve(t),cancelAnimationFrame(b),b=requestAnimationFrame(()=>{var _;(_=m)==null||_.observe(t)})),n()}),f&&!c&&m.observe(f),m.observe(t));let S,v=c?oi(e):null;c&&A();function A(){const R=oi(e);v&&!hB(v,R)&&n(),v=R,S=requestAnimationFrame(A)}return n(),()=>{var R;p.forEach(x=>{a&&x.removeEventListener("scroll",n),i&&x.removeEventListener("resize",n)}),g==null||g(),(R=m)==null||R.disconnect(),m=null,c&&cancelAnimationFrame(S)}}const LV=fV,MV=pV,FV=uV,zV=hV,PV=cV,HR=sV,BV=gV,UV=(e,t,n)=>{const r=new Map,a={platform:OV,...n},i={...a.platform,_c:r};return lV(e,t,{...a,platform:i})};var bd=typeof document<"u"?k.useLayoutEffect:k.useEffect;function Fd(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,a;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!Fd(e[r],t[r]))return!1;return!0}if(a=Object.keys(e),n=a.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,a[r]))return!1;for(r=n;r--!==0;){const i=a[r];if(!(i==="_owner"&&e.$$typeof)&&!Fd(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function mB(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function $R(e,t){const n=mB(e);return Math.round(t*n)/n}function Eh(e){const t=k.useRef(e);return bd(()=>{t.current=e}),t}function jV(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:a,elements:{reference:i,floating:l}={},transform:u=!0,whileElementsMounted:c,open:f}=e,[p,g]=k.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[b,m]=k.useState(r);Fd(b,r)||m(r);const[S,v]=k.useState(null),[A,R]=k.useState(null),x=k.useCallback(P=>{P!==T.current&&(T.current=P,v(P))},[]),_=k.useCallback(P=>{P!==O.current&&(O.current=P,R(P))},[]),C=i||S,N=l||A,T=k.useRef(null),O=k.useRef(null),z=k.useRef(p),I=c!=null,M=Eh(c),H=Eh(a),q=Eh(f),U=k.useCallback(()=>{if(!T.current||!O.current)return;const P={placement:t,strategy:n,middleware:b};H.current&&(P.platform=H.current),UV(T.current,O.current,P).then(X=>{const D={...X,isPositioned:q.current!==!1};W.current&&!Fd(z.current,D)&&(z.current=D,pu.flushSync(()=>{g(D)}))})},[b,t,n,H,q]);bd(()=>{f===!1&&z.current.isPositioned&&(z.current.isPositioned=!1,g(P=>({...P,isPositioned:!1})))},[f]);const W=k.useRef(!1);bd(()=>(W.current=!0,()=>{W.current=!1}),[]),bd(()=>{if(C&&(T.current=C),N&&(O.current=N),C&&N){if(M.current)return M.current(C,N,U);U()}},[C,N,U,M,I]);const Z=k.useMemo(()=>({reference:T,floating:O,setReference:x,setFloating:_}),[x,_]),j=k.useMemo(()=>({reference:C,floating:N}),[C,N]),G=k.useMemo(()=>{const P={position:n,left:0,top:0};if(!j.floating)return P;const X=$R(j.floating,p.x),D=$R(j.floating,p.y);return u?{...P,transform:"translate("+X+"px, "+D+"px)",...mB(j.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:X,top:D}},[n,u,j.floating,p.x,p.y]);return k.useMemo(()=>({...p,update:U,refs:Z,elements:j,floatingStyles:G}),[p,U,Z,j,G])}const GV=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:a}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?HR({element:r.current,padding:a}).fn(n):{}:r?HR({element:r,padding:a}).fn(n):{}}}},HV=(e,t)=>({...LV(e),options:[e,t]}),$V=(e,t)=>({...MV(e),options:[e,t]}),qV=(e,t)=>({...BV(e),options:[e,t]}),VV=(e,t)=>({...FV(e),options:[e,t]}),WV=(e,t)=>({...zV(e),options:[e,t]}),YV=(e,t)=>({...PV(e),options:[e,t]}),KV=(e,t)=>({...GV(e),options:[e,t]});var XV="Arrow",bB=k.forwardRef((e,t)=>{const{children:n,width:r=10,height:a=5,...i}=e;return w.jsx(Xe.svg,{...i,ref:t,width:r,height:a,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:w.jsx("polygon",{points:"0,0 30,0 15,10"})})});bB.displayName=XV;var ZV=bB;function yB(e){const[t,n]=k.useState(void 0);return wn(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(a=>{if(!Array.isArray(a)||!a.length)return;const i=a[0];let l,u;if("borderBoxSize"in i){const c=i.borderBoxSize,f=Array.isArray(c)?c[0]:c;l=f.inlineSize,u=f.blockSize}else l=e.offsetWidth,u=e.offsetHeight;n({width:l,height:u})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var Xk="Popper",[vB,Cl]=mr(Xk),[QV,SB]=vB(Xk),EB=e=>{const{__scopePopper:t,children:n}=e,[r,a]=k.useState(null);return w.jsx(QV,{scope:t,anchor:r,onAnchorChange:a,children:n})};EB.displayName=Xk;var wB="PopperAnchor",xB=k.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...a}=e,i=SB(wB,n),l=k.useRef(null),u=ft(t,l);return k.useEffect(()=>{i.onAnchorChange((r==null?void 0:r.current)||l.current)}),r?null:w.jsx(Xe.div,{...a,ref:u})});xB.displayName=wB;var Zk="PopperContent",[JV,eW]=vB(Zk),kB=k.forwardRef((e,t)=>{var re,le,Ae,ae,we,xe;const{__scopePopper:n,side:r="bottom",sideOffset:a=0,align:i="center",alignOffset:l=0,arrowPadding:u=0,avoidCollisions:c=!0,collisionBoundary:f=[],collisionPadding:p=0,sticky:g="partial",hideWhenDetached:b=!1,updatePositionStrategy:m="optimized",onPlaced:S,...v}=e,A=SB(Zk,n),[R,x]=k.useState(null),_=ft(t,Ie=>x(Ie)),[C,N]=k.useState(null),T=yB(C),O=(T==null?void 0:T.width)??0,z=(T==null?void 0:T.height)??0,I=r+(i!=="center"?"-"+i:""),M=typeof p=="number"?p:{top:0,right:0,bottom:0,left:0,...p},H=Array.isArray(f)?f:[f],q=H.length>0,U={padding:M,boundary:H.filter(nW),altBoundary:q},{refs:W,floatingStyles:Z,placement:j,isPositioned:G,middlewareData:P}=jV({strategy:"fixed",placement:I,whileElementsMounted:(...Ie)=>IV(...Ie,{animationFrame:m==="always"}),elements:{reference:A.anchor},middleware:[HV({mainAxis:a+z,alignmentAxis:l}),c&&$V({mainAxis:!0,crossAxis:!1,limiter:g==="partial"?qV():void 0,...U}),c&&VV({...U}),WV({...U,apply:({elements:Ie,rects:Ce,availableWidth:Ee,availableHeight:J})=>{const{width:fe,height:ke}=Ce.reference,me=Ie.floating.style;me.setProperty("--radix-popper-available-width",`${Ee}px`),me.setProperty("--radix-popper-available-height",`${J}px`),me.setProperty("--radix-popper-anchor-width",`${fe}px`),me.setProperty("--radix-popper-anchor-height",`${ke}px`)}}),C&&KV({element:C,padding:u}),rW({arrowWidth:O,arrowHeight:z}),b&&YV({strategy:"referenceHidden",...U})]}),[X,D]=_B(j),V=pn(S);wn(()=>{G&&(V==null||V())},[G,V]);const B=(re=P.arrow)==null?void 0:re.x,L=(le=P.arrow)==null?void 0:le.y,Y=((Ae=P.arrow)==null?void 0:Ae.centerOffset)!==0,[Q,se]=k.useState();return wn(()=>{R&&se(window.getComputedStyle(R).zIndex)},[R]),w.jsx("div",{ref:W.setFloating,"data-radix-popper-content-wrapper":"",style:{...Z,transform:G?Z.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:Q,"--radix-popper-transform-origin":[(ae=P.transformOrigin)==null?void 0:ae.x,(we=P.transformOrigin)==null?void 0:we.y].join(" "),...((xe=P.hide)==null?void 0:xe.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:w.jsx(JV,{scope:n,placedSide:X,onArrowChange:N,arrowX:B,arrowY:L,shouldHideArrow:Y,children:w.jsx(Xe.div,{"data-side":X,"data-align":D,...v,ref:_,style:{...v.style,animation:G?void 0:"none"}})})})});kB.displayName=Zk;var AB="PopperArrow",tW={top:"bottom",right:"left",bottom:"top",left:"right"},TB=k.forwardRef(function(t,n){const{__scopePopper:r,...a}=t,i=eW(AB,r),l=tW[i.placedSide];return w.jsx("span",{ref:i.onArrowChange,style:{position:"absolute",left:i.arrowX,top:i.arrowY,[l]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[i.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[i.placedSide],visibility:i.shouldHideArrow?"hidden":void 0},children:w.jsx(ZV,{...a,ref:n,style:{...a.style,display:"block"}})})});TB.displayName=AB;function nW(e){return e!==null}var rW=e=>({name:"transformOrigin",options:e,fn(t){var A,R,x;const{placement:n,rects:r,middlewareData:a}=t,l=((A=a.arrow)==null?void 0:A.centerOffset)!==0,u=l?0:e.arrowWidth,c=l?0:e.arrowHeight,[f,p]=_B(n),g={start:"0%",center:"50%",end:"100%"}[p],b=(((R=a.arrow)==null?void 0:R.x)??0)+u/2,m=(((x=a.arrow)==null?void 0:x.y)??0)+c/2;let S="",v="";return f==="bottom"?(S=l?g:`${b}px`,v=`${-c}px`):f==="top"?(S=l?g:`${b}px`,v=`${r.floating.height+c}px`):f==="right"?(S=`${-c}px`,v=l?g:`${m}px`):f==="left"&&(S=`${r.floating.width+c}px`,v=l?g:`${m}px`),{data:{x:S,y:v}}}});function _B(e){const[t,n="center"]=e.split("-");return[t,n]}var Qk=EB,vf=xB,Jk=kB,e0=TB,aW="VisuallyHidden",t0=k.forwardRef((e,t)=>w.jsx(Xe.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}}));t0.displayName=aW;var oW=t0,[Sf,Jye]=mr("Tooltip",[Cl]),Ef=Cl(),RB="TooltipProvider",iW=700,Rx="tooltip.open",[lW,n0]=Sf(RB),CB=e=>{const{__scopeTooltip:t,delayDuration:n=iW,skipDelayDuration:r=300,disableHoverableContent:a=!1,children:i}=e,[l,u]=k.useState(!0),c=k.useRef(!1),f=k.useRef(0);return k.useEffect(()=>{const p=f.current;return()=>window.clearTimeout(p)},[]),w.jsx(lW,{scope:t,isOpenDelayed:l,delayDuration:n,onOpen:k.useCallback(()=>{window.clearTimeout(f.current),u(!1)},[]),onClose:k.useCallback(()=>{window.clearTimeout(f.current),f.current=window.setTimeout(()=>u(!0),r)},[r]),isPointerInTransitRef:c,onPointerInTransitChange:k.useCallback(p=>{c.current=p},[]),disableHoverableContent:a,children:i})};CB.displayName=RB;var wf="Tooltip",[sW,xf]=Sf(wf),NB=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:a=!1,onOpenChange:i,disableHoverableContent:l,delayDuration:u}=e,c=n0(wf,e.__scopeTooltip),f=Ef(t),[p,g]=k.useState(null),b=En(),m=k.useRef(0),S=l??c.disableHoverableContent,v=u??c.delayDuration,A=k.useRef(!1),[R=!1,x]=Oa({prop:r,defaultProp:a,onChange:O=>{O?(c.onOpen(),document.dispatchEvent(new CustomEvent(Rx))):c.onClose(),i==null||i(O)}}),_=k.useMemo(()=>R?A.current?"delayed-open":"instant-open":"closed",[R]),C=k.useCallback(()=>{window.clearTimeout(m.current),m.current=0,A.current=!1,x(!0)},[x]),N=k.useCallback(()=>{window.clearTimeout(m.current),m.current=0,x(!1)},[x]),T=k.useCallback(()=>{window.clearTimeout(m.current),m.current=window.setTimeout(()=>{A.current=!0,x(!0),m.current=0},v)},[v,x]);return k.useEffect(()=>()=>{m.current&&(window.clearTimeout(m.current),m.current=0)},[]),w.jsx(Qk,{...f,children:w.jsx(sW,{scope:t,contentId:b,open:R,stateAttribute:_,trigger:p,onTriggerChange:g,onTriggerEnter:k.useCallback(()=>{c.isOpenDelayed?T():C()},[c.isOpenDelayed,T,C]),onTriggerLeave:k.useCallback(()=>{S?N():(window.clearTimeout(m.current),m.current=0)},[N,S]),onOpen:C,onClose:N,disableHoverableContent:S,children:n})})};NB.displayName=wf;var Cx="TooltipTrigger",OB=k.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,a=xf(Cx,n),i=n0(Cx,n),l=Ef(n),u=k.useRef(null),c=ft(t,u,a.onTriggerChange),f=k.useRef(!1),p=k.useRef(!1),g=k.useCallback(()=>f.current=!1,[]);return k.useEffect(()=>()=>document.removeEventListener("pointerup",g),[g]),w.jsx(vf,{asChild:!0,...l,children:w.jsx(Xe.button,{"aria-describedby":a.open?a.contentId:void 0,"data-state":a.stateAttribute,...r,ref:c,onPointerMove:We(e.onPointerMove,b=>{b.pointerType!=="touch"&&!p.current&&!i.isPointerInTransitRef.current&&(a.onTriggerEnter(),p.current=!0)}),onPointerLeave:We(e.onPointerLeave,()=>{a.onTriggerLeave(),p.current=!1}),onPointerDown:We(e.onPointerDown,()=>{f.current=!0,document.addEventListener("pointerup",g,{once:!0})}),onFocus:We(e.onFocus,()=>{f.current||a.onOpen()}),onBlur:We(e.onBlur,a.onClose),onClick:We(e.onClick,a.onClose)})})});OB.displayName=Cx;var uW="TooltipPortal",[eve,cW]=Sf(uW,{forceMount:void 0}),ml="TooltipContent",DB=k.forwardRef((e,t)=>{const n=cW(ml,e.__scopeTooltip),{forceMount:r=n.forceMount,side:a="top",...i}=e,l=xf(ml,e.__scopeTooltip);return w.jsx(Jn,{present:r||l.open,children:l.disableHoverableContent?w.jsx(IB,{side:a,...i,ref:t}):w.jsx(dW,{side:a,...i,ref:t})})}),dW=k.forwardRef((e,t)=>{const n=xf(ml,e.__scopeTooltip),r=n0(ml,e.__scopeTooltip),a=k.useRef(null),i=ft(t,a),[l,u]=k.useState(null),{trigger:c,onClose:f}=n,p=a.current,{onPointerInTransitChange:g}=r,b=k.useCallback(()=>{u(null),g(!1)},[g]),m=k.useCallback((S,v)=>{const A=S.currentTarget,R={x:S.clientX,y:S.clientY},x=hW(R,A.getBoundingClientRect()),_=mW(R,x),C=bW(v.getBoundingClientRect()),N=vW([..._,...C]);u(N),g(!0)},[g]);return k.useEffect(()=>()=>b(),[b]),k.useEffect(()=>{if(c&&p){const S=A=>m(A,p),v=A=>m(A,c);return c.addEventListener("pointerleave",S),p.addEventListener("pointerleave",v),()=>{c.removeEventListener("pointerleave",S),p.removeEventListener("pointerleave",v)}}},[c,p,m,b]),k.useEffect(()=>{if(l){const S=v=>{const A=v.target,R={x:v.clientX,y:v.clientY},x=(c==null?void 0:c.contains(A))||(p==null?void 0:p.contains(A)),_=!yW(R,l);x?b():_&&(b(),f())};return document.addEventListener("pointermove",S),()=>document.removeEventListener("pointermove",S)}},[c,p,l,f,b]),w.jsx(IB,{...e,ref:i})}),[fW,pW]=Sf(wf,{isInside:!1}),IB=k.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":a,onEscapeKeyDown:i,onPointerDownOutside:l,...u}=e,c=xf(ml,n),f=Ef(n),{onClose:p}=c;return k.useEffect(()=>(document.addEventListener(Rx,p),()=>document.removeEventListener(Rx,p)),[p]),k.useEffect(()=>{if(c.trigger){const g=b=>{const m=b.target;m!=null&&m.contains(c.trigger)&&p()};return window.addEventListener("scroll",g,{capture:!0}),()=>window.removeEventListener("scroll",g,{capture:!0})}},[c.trigger,p]),w.jsx(gu,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:i,onPointerDownOutside:l,onFocusOutside:g=>g.preventDefault(),onDismiss:p,children:w.jsxs(Jk,{"data-state":c.stateAttribute,...f,...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:[w.jsx(Ok,{children:r}),w.jsx(fW,{scope:n,isInside:!0,children:w.jsx(oW,{id:c.contentId,role:"tooltip",children:a||r})})]})})});DB.displayName=ml;var LB="TooltipArrow",gW=k.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,a=Ef(n);return pW(LB,n).isInside?null:w.jsx(e0,{...a,...r,ref:t})});gW.displayName=LB;function hW(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),a=Math.abs(t.right-e.x),i=Math.abs(t.left-e.x);switch(Math.min(n,r,a,i)){case i:return"left";case a:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function mW(e,t,n=5){const r=[];switch(t){case"top":r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}function bW(e){const{top:t,right:n,bottom:r,left:a}=e;return[{x:a,y:t},{x:n,y:t},{x:n,y:r},{x:a,y:r}]}function yW(e,t){const{x:n,y:r}=e;let a=!1;for(let i=0,l=t.length-1;ir!=p>r&&n<(f-u)*(r-c)/(p-c)+u&&(a=!a)}return a}function vW(e){const t=e.slice();return t.sort((n,r)=>n.xr.x?1:n.yr.y?1:0),SW(t)}function SW(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r=2;){const i=t[t.length-1],l=t[t.length-2];if((i.x-l.x)*(a.y-l.y)>=(i.y-l.y)*(a.x-l.x))t.pop();else break}t.push(a)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const a=e[r];for(;n.length>=2;){const i=n[n.length-1],l=n[n.length-2];if((i.x-l.x)*(a.y-l.y)>=(i.y-l.y)*(a.x-l.x))n.pop();else break}n.push(a)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var EW=CB,wW=NB,xW=OB,MB=DB;const FB=EW,zB=wW,PB=xW,kW=e=>typeof e!="string"?e:e.split("\\n").map((t,n)=>w.jsxs(k.Fragment,{children:[t,nw.jsx(MB,{ref:a,sideOffset:t,className:Me("bg-popover text-popover-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 mx-1 max-w-sm overflow-hidden rounded-md border px-3 py-2 text-sm shadow-md",e),...r,children:typeof n=="string"?kW(n):n}));r0.displayName=MB.displayName;const zd=Nz("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"}}),Lt=k.forwardRef(({className:e,variant:t,tooltip:n,size:r,side:a="right",asChild:i=!1,...l},u)=>{const c=i?bo:"button";return n?w.jsx(FB,{children:w.jsxs(zB,{children:[w.jsx(PB,{asChild:!0,children:w.jsx(c,{className:Me(zd({variant:t,size:r,className:e}),"cursor-pointer"),ref:u,...l})}),w.jsx(r0,{side:a,children:n})]})}):w.jsx(c,{className:Me(zd({variant:t,size:r,className:e}),"cursor-pointer"),ref:u,...l})});Lt.displayName="Button";const AW=Z7,TW=Q7,BB=k.forwardRef(({className:e,...t},n)=>w.jsx(tB,{className:Me("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/80",e),...t,ref:n}));BB.displayName=tB.displayName;const UB=k.forwardRef(({className:e,...t},n)=>w.jsxs(TW,{children:[w.jsx(BB,{}),w.jsx(nB,{ref:n,className:Me("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-top-[48%] fixed top-[50%] left-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border p-6 shadow-lg duration-200 sm:rounded-lg",e),...t})]}));UB.displayName=nB.displayName;const jB=({className:e,...t})=>w.jsx("div",{className:Me("flex flex-col space-y-2 text-center sm:text-left",e),...t});jB.displayName="AlertDialogHeader";const GB=k.forwardRef(({className:e,...t},n)=>w.jsx(oB,{ref:n,className:Me("text-lg font-semibold",e),...t}));GB.displayName=oB.displayName;const HB=k.forwardRef(({className:e,...t},n)=>w.jsx(iB,{ref:n,className:Me("text-muted-foreground text-sm",e),...t}));HB.displayName=iB.displayName;const _W=k.forwardRef(({className:e,...t},n)=>w.jsx(rB,{ref:n,className:Me(zd(),e),...t}));_W.displayName=rB.displayName;const RW=k.forwardRef(({className:e,...t},n)=>w.jsx(aB,{ref:n,className:Me(zd({variant:"outline"}),"mt-2 sm:mt-0",e),...t}));RW.displayName=aB.displayName;const Eo=k.forwardRef(({className:e,type:t,...n},r)=>w.jsx("input",{type:t,className:Me("border-input file:text-foreground placeholder:text-muted-foreground focus-visible:ring-ring flex h-9 rounded-md border bg-transparent px-3 py-1 text-base shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium focus-visible:ring-1 focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),ref:r,...n}));Eo.displayName="Input";var CW=e=>{switch(e){case"success":return DW;case"info":return LW;case"warning":return IW;case"error":return MW;default:return null}},NW=Array(12).fill(0),OW=({visible:e,className:t})=>ye.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},ye.createElement("div",{className:"sonner-spinner"},NW.map((n,r)=>ye.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),DW=ye.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},ye.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"})),IW=ye.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},ye.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"})),LW=ye.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},ye.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"})),MW=ye.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},ye.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"})),FW=ye.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"},ye.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),ye.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),zW=()=>{let[e,t]=ye.useState(document.hidden);return ye.useEffect(()=>{let n=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),e},Nx=1,PW=class{constructor(){this.subscribe=e=>(this.subscribers.push(e),()=>{let t=this.subscribers.indexOf(e);this.subscribers.splice(t,1)}),this.publish=e=>{this.subscribers.forEach(t=>t(e))},this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e]},this.create=e=>{var t;let{message:n,...r}=e,a=typeof(e==null?void 0:e.id)=="number"||((t=e.id)==null?void 0:t.length)>0?e.id:Nx++,i=this.toasts.find(u=>u.id===a),l=e.dismissible===void 0?!0:e.dismissible;return this.dismissedToasts.has(a)&&this.dismissedToasts.delete(a),i?this.toasts=this.toasts.map(u=>u.id===a?(this.publish({...u,...e,id:a,title:n}),{...u,...e,id:a,dismissible:l,title:n}):u):this.addToast({title:n,...r,dismissible:l,id:a}),a},this.dismiss=e=>(this.dismissedToasts.add(e),e||this.toasts.forEach(t=>{this.subscribers.forEach(n=>n({id:t.id,dismiss:!0}))}),this.subscribers.forEach(t=>t({id:e,dismiss:!0})),e),this.message=(e,t)=>this.create({...t,message:e}),this.error=(e,t)=>this.create({...t,message:e,type:"error"}),this.success=(e,t)=>this.create({...t,type:"success",message:e}),this.info=(e,t)=>this.create({...t,type:"info",message:e}),this.warning=(e,t)=>this.create({...t,type:"warning",message:e}),this.loading=(e,t)=>this.create({...t,type:"loading",message:e}),this.promise=(e,t)=>{if(!t)return;let n;t.loading!==void 0&&(n=this.create({...t,promise:e,type:"loading",message:t.loading,description:typeof t.description!="function"?t.description:void 0}));let r=e instanceof Promise?e:e(),a=n!==void 0,i,l=r.then(async c=>{if(i=["resolve",c],ye.isValidElement(c))a=!1,this.create({id:n,type:"default",message:c});else if(UW(c)&&!c.ok){a=!1;let f=typeof t.error=="function"?await t.error(`HTTP error! status: ${c.status}`):t.error,p=typeof t.description=="function"?await t.description(`HTTP error! status: ${c.status}`):t.description;this.create({id:n,type:"error",message:f,description:p})}else if(t.success!==void 0){a=!1;let f=typeof t.success=="function"?await t.success(c):t.success,p=typeof t.description=="function"?await t.description(c):t.description;this.create({id:n,type:"success",message:f,description:p})}}).catch(async c=>{if(i=["reject",c],t.error!==void 0){a=!1;let f=typeof t.error=="function"?await t.error(c):t.error,p=typeof t.description=="function"?await t.description(c):t.description;this.create({id:n,type:"error",message:f,description:p})}}).finally(()=>{var c;a&&(this.dismiss(n),n=void 0),(c=t.finally)==null||c.call(t)}),u=()=>new Promise((c,f)=>l.then(()=>i[0]==="reject"?f(i[1]):c(i[1])).catch(f));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)||Nx++;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}},Fn=new PW,BW=(e,t)=>{let n=(t==null?void 0:t.id)||Nx++;return Fn.addToast({title:e,...t,id:n}),n},UW=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",jW=BW,GW=()=>Fn.toasts,HW=()=>Fn.getActiveToasts(),vn=Object.assign(jW,{success:Fn.success,info:Fn.info,warning:Fn.warning,error:Fn.error,custom:Fn.custom,message:Fn.message,promise:Fn.promise,dismiss:Fn.dismiss,loading:Fn.loading},{getHistory:GW,getToasts:HW});function $W(e,{insertAt:t}={}){if(typeof document>"u")return;let n=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",t==="top"&&n.firstChild?n.insertBefore(r,n.firstChild):n.appendChild(r),r.styleSheet?r.styleSheet.cssText=e:r.appendChild(document.createTextNode(e))}$W(`: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 Hc(e){return e.label!==void 0}var qW=3,VW="32px",WW="16px",qR=4e3,YW=356,KW=14,XW=20,ZW=200;function Ar(...e){return e.filter(Boolean).join(" ")}function QW(e){let[t,n]=e.split("-"),r=[];return t&&r.push(t),n&&r.push(n),r}var JW=e=>{var t,n,r,a,i,l,u,c,f,p,g;let{invert:b,toast:m,unstyled:S,interacting:v,setHeights:A,visibleToasts:R,heights:x,index:_,toasts:C,expanded:N,removeToast:T,defaultRichColors:O,closeButton:z,style:I,cancelButtonStyle:M,actionButtonStyle:H,className:q="",descriptionClassName:U="",duration:W,position:Z,gap:j,loadingIcon:G,expandByDefault:P,classNames:X,icons:D,closeButtonAriaLabel:V="Close toast",pauseWhenPageIsHidden:B}=e,[L,Y]=ye.useState(null),[Q,se]=ye.useState(null),[re,le]=ye.useState(!1),[Ae,ae]=ye.useState(!1),[we,xe]=ye.useState(!1),[Ie,Ce]=ye.useState(!1),[Ee,J]=ye.useState(!1),[fe,ke]=ye.useState(0),[me,ve]=ye.useState(0),ie=ye.useRef(m.duration||W||qR),ze=ye.useRef(null),Pe=ye.useRef(null),he=_===0,Ne=_+1<=R,ee=m.type,ce=m.dismissible!==!1,Re=m.className||"",Fe=m.descriptionClassName||"",qe=ye.useMemo(()=>x.findIndex(Ye=>Ye.toastId===m.id)||0,[x,m.id]),mt=ye.useMemo(()=>{var Ye;return(Ye=m.closeButton)!=null?Ye:z},[m.closeButton,z]),St=ye.useMemo(()=>m.duration||W||qR,[m.duration,W]),pt=ye.useRef(0),Je=ye.useRef(0),wt=ye.useRef(0),rt=ye.useRef(null),[bt,Bt]=Z.split("-"),sn=ye.useMemo(()=>x.reduce((Ye,gt,_t)=>_t>=qe?Ye:Ye+gt.height,0),[x,qe]),Mt=zW(),er=m.invert||b,zr=ee==="loading";Je.current=ye.useMemo(()=>qe*j+sn,[qe,sn]),ye.useEffect(()=>{ie.current=St},[St]),ye.useEffect(()=>{le(!0)},[]),ye.useEffect(()=>{let Ye=Pe.current;if(Ye){let gt=Ye.getBoundingClientRect().height;return ve(gt),A(_t=>[{toastId:m.id,height:gt,position:m.position},..._t]),()=>A(_t=>_t.filter(Rn=>Rn.toastId!==m.id))}},[A,m.id]),ye.useLayoutEffect(()=>{if(!re)return;let Ye=Pe.current,gt=Ye.style.height;Ye.style.height="auto";let _t=Ye.getBoundingClientRect().height;Ye.style.height=gt,ve(_t),A(Rn=>Rn.find(kn=>kn.toastId===m.id)?Rn.map(kn=>kn.toastId===m.id?{...kn,height:_t}:kn):[{toastId:m.id,height:_t,position:m.position},...Rn])},[re,m.title,m.description,A,m.id]);let Kt=ye.useCallback(()=>{ae(!0),ke(Je.current),A(Ye=>Ye.filter(gt=>gt.toastId!==m.id)),setTimeout(()=>{T(m)},ZW)},[m,T,A,Je]);ye.useEffect(()=>{if(m.promise&&ee==="loading"||m.duration===1/0||m.type==="loading")return;let Ye;return N||v||B&&Mt?(()=>{if(wt.current{var gt;(gt=m.onAutoClose)==null||gt.call(m,m),Kt()},ie.current)),()=>clearTimeout(Ye)},[N,v,m,ee,B,Mt,Kt]),ye.useEffect(()=>{m.delete&&Kt()},[Kt,m.delete]);function na(){var Ye,gt,_t;return D!=null&&D.loading?ye.createElement("div",{className:Ar(X==null?void 0:X.loader,(Ye=m==null?void 0:m.classNames)==null?void 0:Ye.loader,"sonner-loader"),"data-visible":ee==="loading"},D.loading):G?ye.createElement("div",{className:Ar(X==null?void 0:X.loader,(gt=m==null?void 0:m.classNames)==null?void 0:gt.loader,"sonner-loader"),"data-visible":ee==="loading"},G):ye.createElement(OW,{className:Ar(X==null?void 0:X.loader,(_t=m==null?void 0:m.classNames)==null?void 0:_t.loader),visible:ee==="loading"})}return ye.createElement("li",{tabIndex:0,ref:Pe,className:Ar(q,Re,X==null?void 0:X.toast,(t=m==null?void 0:m.classNames)==null?void 0:t.toast,X==null?void 0:X.default,X==null?void 0:X[ee],(n=m==null?void 0:m.classNames)==null?void 0:n[ee]),"data-sonner-toast":"","data-rich-colors":(r=m.richColors)!=null?r:O,"data-styled":!(m.jsx||m.unstyled||S),"data-mounted":re,"data-promise":!!m.promise,"data-swiped":Ee,"data-removed":Ae,"data-visible":Ne,"data-y-position":bt,"data-x-position":Bt,"data-index":_,"data-front":he,"data-swiping":we,"data-dismissible":ce,"data-type":ee,"data-invert":er,"data-swipe-out":Ie,"data-swipe-direction":Q,"data-expanded":!!(N||P&&re),style:{"--index":_,"--toasts-before":_,"--z-index":C.length-_,"--offset":`${Ae?fe:Je.current}px`,"--initial-height":P?"auto":`${me}px`,...I,...m.style},onDragEnd:()=>{xe(!1),Y(null),rt.current=null},onPointerDown:Ye=>{zr||!ce||(ze.current=new Date,ke(Je.current),Ye.target.setPointerCapture(Ye.pointerId),Ye.target.tagName!=="BUTTON"&&(xe(!0),rt.current={x:Ye.clientX,y:Ye.clientY}))},onPointerUp:()=>{var Ye,gt,_t,Rn;if(Ie||!ce)return;rt.current=null;let kn=Number(((Ye=Pe.current)==null?void 0:Ye.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),Cn=Number(((gt=Pe.current)==null?void 0:gt.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),ra=new Date().getTime()-((_t=ze.current)==null?void 0:_t.getTime()),Nn=L==="x"?kn:Cn,Sr=Math.abs(Nn)/ra;if(Math.abs(Nn)>=XW||Sr>.11){ke(Je.current),(Rn=m.onDismiss)==null||Rn.call(m,m),se(L==="x"?kn>0?"right":"left":Cn>0?"down":"up"),Kt(),Ce(!0),J(!1);return}xe(!1),Y(null)},onPointerMove:Ye=>{var gt,_t,Rn,kn;if(!rt.current||!ce||((gt=window.getSelection())==null?void 0:gt.toString().length)>0)return;let Cn=Ye.clientY-rt.current.y,ra=Ye.clientX-rt.current.x,Nn=(_t=e.swipeDirections)!=null?_t:QW(Z);!L&&(Math.abs(ra)>1||Math.abs(Cn)>1)&&Y(Math.abs(ra)>Math.abs(Cn)?"x":"y");let Sr={x:0,y:0};L==="y"?(Nn.includes("top")||Nn.includes("bottom"))&&(Nn.includes("top")&&Cn<0||Nn.includes("bottom")&&Cn>0)&&(Sr.y=Cn):L==="x"&&(Nn.includes("left")||Nn.includes("right"))&&(Nn.includes("left")&&ra<0||Nn.includes("right")&&ra>0)&&(Sr.x=ra),(Math.abs(Sr.x)>0||Math.abs(Sr.y)>0)&&J(!0),(Rn=Pe.current)==null||Rn.style.setProperty("--swipe-amount-x",`${Sr.x}px`),(kn=Pe.current)==null||kn.style.setProperty("--swipe-amount-y",`${Sr.y}px`)}},mt&&!m.jsx?ye.createElement("button",{"aria-label":V,"data-disabled":zr,"data-close-button":!0,onClick:zr||!ce?()=>{}:()=>{var Ye;Kt(),(Ye=m.onDismiss)==null||Ye.call(m,m)},className:Ar(X==null?void 0:X.closeButton,(a=m==null?void 0:m.classNames)==null?void 0:a.closeButton)},(i=D==null?void 0:D.close)!=null?i:FW):null,m.jsx||k.isValidElement(m.title)?m.jsx?m.jsx:typeof m.title=="function"?m.title():m.title:ye.createElement(ye.Fragment,null,ee||m.icon||m.promise?ye.createElement("div",{"data-icon":"",className:Ar(X==null?void 0:X.icon,(l=m==null?void 0:m.classNames)==null?void 0:l.icon)},m.promise||m.type==="loading"&&!m.icon?m.icon||na():null,m.type!=="loading"?m.icon||(D==null?void 0:D[ee])||CW(ee):null):null,ye.createElement("div",{"data-content":"",className:Ar(X==null?void 0:X.content,(u=m==null?void 0:m.classNames)==null?void 0:u.content)},ye.createElement("div",{"data-title":"",className:Ar(X==null?void 0:X.title,(c=m==null?void 0:m.classNames)==null?void 0:c.title)},typeof m.title=="function"?m.title():m.title),m.description?ye.createElement("div",{"data-description":"",className:Ar(U,Fe,X==null?void 0:X.description,(f=m==null?void 0:m.classNames)==null?void 0:f.description)},typeof m.description=="function"?m.description():m.description):null),k.isValidElement(m.cancel)?m.cancel:m.cancel&&Hc(m.cancel)?ye.createElement("button",{"data-button":!0,"data-cancel":!0,style:m.cancelButtonStyle||M,onClick:Ye=>{var gt,_t;Hc(m.cancel)&&ce&&((_t=(gt=m.cancel).onClick)==null||_t.call(gt,Ye),Kt())},className:Ar(X==null?void 0:X.cancelButton,(p=m==null?void 0:m.classNames)==null?void 0:p.cancelButton)},m.cancel.label):null,k.isValidElement(m.action)?m.action:m.action&&Hc(m.action)?ye.createElement("button",{"data-button":!0,"data-action":!0,style:m.actionButtonStyle||H,onClick:Ye=>{var gt,_t;Hc(m.action)&&((_t=(gt=m.action).onClick)==null||_t.call(gt,Ye),!Ye.defaultPrevented&&Kt())},className:Ar(X==null?void 0:X.actionButton,(g=m==null?void 0:m.classNames)==null?void 0:g.actionButton)},m.action.label):null))};function VR(){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 eY(e,t){let n={};return[e,t].forEach((r,a)=>{let i=a===1,l=i?"--mobile-offset":"--offset",u=i?WW:VW;function c(f){["top","right","bottom","left"].forEach(p=>{n[`${l}-${p}`]=typeof f=="number"?`${f}px`:f})}typeof r=="number"||typeof r=="string"?c(r):typeof r=="object"?["top","right","bottom","left"].forEach(f=>{r[f]===void 0?n[`${l}-${f}`]=u:n[`${l}-${f}`]=typeof r[f]=="number"?`${r[f]}px`:r[f]}):c(u)}),n}var tY=k.forwardRef(function(e,t){let{invert:n,position:r="bottom-right",hotkey:a=["altKey","KeyT"],expand:i,closeButton:l,className:u,offset:c,mobileOffset:f,theme:p="light",richColors:g,duration:b,style:m,visibleToasts:S=qW,toastOptions:v,dir:A=VR(),gap:R=KW,loadingIcon:x,icons:_,containerAriaLabel:C="Notifications",pauseWhenPageIsHidden:N}=e,[T,O]=ye.useState([]),z=ye.useMemo(()=>Array.from(new Set([r].concat(T.filter(B=>B.position).map(B=>B.position)))),[T,r]),[I,M]=ye.useState([]),[H,q]=ye.useState(!1),[U,W]=ye.useState(!1),[Z,j]=ye.useState(p!=="system"?p:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),G=ye.useRef(null),P=a.join("+").replace(/Key/g,"").replace(/Digit/g,""),X=ye.useRef(null),D=ye.useRef(!1),V=ye.useCallback(B=>{O(L=>{var Y;return(Y=L.find(Q=>Q.id===B.id))!=null&&Y.delete||Fn.dismiss(B.id),L.filter(({id:Q})=>Q!==B.id)})},[]);return ye.useEffect(()=>Fn.subscribe(B=>{if(B.dismiss){O(L=>L.map(Y=>Y.id===B.id?{...Y,delete:!0}:Y));return}setTimeout(()=>{pP.flushSync(()=>{O(L=>{let Y=L.findIndex(Q=>Q.id===B.id);return Y!==-1?[...L.slice(0,Y),{...L[Y],...B},...L.slice(Y+1)]:[B,...L]})})})}),[]),ye.useEffect(()=>{if(p!=="system"){j(p);return}if(p==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?j("dark"):j("light")),typeof window>"u")return;let B=window.matchMedia("(prefers-color-scheme: dark)");try{B.addEventListener("change",({matches:L})=>{j(L?"dark":"light")})}catch{B.addListener(({matches:Y})=>{try{j(Y?"dark":"light")}catch(Q){console.error(Q)}})}},[p]),ye.useEffect(()=>{T.length<=1&&q(!1)},[T]),ye.useEffect(()=>{let B=L=>{var Y,Q;a.every(se=>L[se]||L.code===se)&&(q(!0),(Y=G.current)==null||Y.focus()),L.code==="Escape"&&(document.activeElement===G.current||(Q=G.current)!=null&&Q.contains(document.activeElement))&&q(!1)};return document.addEventListener("keydown",B),()=>document.removeEventListener("keydown",B)},[a]),ye.useEffect(()=>{if(G.current)return()=>{X.current&&(X.current.focus({preventScroll:!0}),X.current=null,D.current=!1)}},[G.current]),ye.createElement("section",{ref:t,"aria-label":`${C} ${P}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},z.map((B,L)=>{var Y;let[Q,se]=B.split("-");return T.length?ye.createElement("ol",{key:B,dir:A==="auto"?VR():A,tabIndex:-1,ref:G,className:u,"data-sonner-toaster":!0,"data-theme":Z,"data-y-position":Q,"data-lifted":H&&T.length>1&&!i,"data-x-position":se,style:{"--front-toast-height":`${((Y=I[0])==null?void 0:Y.height)||0}px`,"--width":`${YW}px`,"--gap":`${R}px`,...m,...eY(c,f)},onBlur:re=>{D.current&&!re.currentTarget.contains(re.relatedTarget)&&(D.current=!1,X.current&&(X.current.focus({preventScroll:!0}),X.current=null))},onFocus:re=>{re.target instanceof HTMLElement&&re.target.dataset.dismissible==="false"||D.current||(D.current=!0,X.current=re.relatedTarget)},onMouseEnter:()=>q(!0),onMouseMove:()=>q(!0),onMouseLeave:()=>{U||q(!1)},onDragEnd:()=>q(!1),onPointerDown:re=>{re.target instanceof HTMLElement&&re.target.dataset.dismissible==="false"||W(!0)},onPointerUp:()=>W(!1)},T.filter(re=>!re.position&&L===0||re.position===B).map((re,le)=>{var Ae,ae;return ye.createElement(JW,{key:re.id,icons:_,index:le,toast:re,defaultRichColors:g,duration:(Ae=v==null?void 0:v.duration)!=null?Ae:b,className:v==null?void 0:v.className,descriptionClassName:v==null?void 0:v.descriptionClassName,invert:n,visibleToasts:S,closeButton:(ae=v==null?void 0:v.closeButton)!=null?ae:l,interacting:U,position:B,style:v==null?void 0:v.style,unstyled:v==null?void 0:v.unstyled,classNames:v==null?void 0:v.classNames,cancelButtonStyle:v==null?void 0:v.cancelButtonStyle,actionButtonStyle:v==null?void 0:v.actionButtonStyle,removeToast:V,toasts:T.filter(we=>we.position==re.position),heights:I.filter(we=>we.position==re.position),setHeights:M,expandByDefault:i,gap:R,loadingIcon:x,expanded:H,pauseWhenPageIsHidden:N,swipeDirections:e.swipeDirections})})):null}))});const nY=()=>{const[e,t]=k.useState(!0),n=Ke.use.apiKey(),[r,a]=k.useState(""),i=Pn.use.message();k.useEffect(()=>{a(n||"")},[n,e]),k.useEffect(()=>{i&&(i.includes(oP)||i.includes(iP))&&t(!0)},[i,t]);const l=k.useCallback(async()=>{if(Ke.setState({apiKey:r||null}),await Pn.getState().check()){t(!1);return}vn.error("API Key is invalid")},[r]),u=k.useCallback(c=>{a(c.target.value)},[a]);return w.jsx(AW,{open:e,onOpenChange:t,children:w.jsxs(UB,{children:[w.jsxs(jB,{children:[w.jsx(GB,{children:"API Key is required"}),w.jsx(HB,{children:"Please enter your API key"})]}),w.jsxs("form",{className:"flex gap-2",onSubmit:c=>c.preventDefault(),children:[w.jsx(Eo,{type:"password",value:r,onChange:u,placeholder:"Enter your API key",className:"max-h-full w-full min-w-0",autoComplete:"off"}),w.jsx(Lt,{onClick:l,variant:"outline",size:"sm",children:"Save"})]})]})})};var a0="Popover",[$B,tve]=mr(a0,[Cl]),mu=Cl(),[rY,wo]=$B(a0),qB=e=>{const{__scopePopover:t,children:n,open:r,defaultOpen:a,onOpenChange:i,modal:l=!1}=e,u=mu(t),c=k.useRef(null),[f,p]=k.useState(!1),[g=!1,b]=Oa({prop:r,defaultProp:a,onChange:i});return w.jsx(Qk,{...u,children:w.jsx(rY,{scope:t,contentId:En(),triggerRef:c,open:g,onOpenChange:b,onOpenToggle:k.useCallback(()=>b(m=>!m),[b]),hasCustomAnchor:f,onCustomAnchorAdd:k.useCallback(()=>p(!0),[]),onCustomAnchorRemove:k.useCallback(()=>p(!1),[]),modal:l,children:n})})};qB.displayName=a0;var VB="PopoverAnchor",aY=k.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,a=wo(VB,n),i=mu(n),{onCustomAnchorAdd:l,onCustomAnchorRemove:u}=a;return k.useEffect(()=>(l(),()=>u()),[l,u]),w.jsx(vf,{...i,...r,ref:t})});aY.displayName=VB;var WB="PopoverTrigger",YB=k.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,a=wo(WB,n),i=mu(n),l=ft(t,a.triggerRef),u=w.jsx(Xe.button,{type:"button","aria-haspopup":"dialog","aria-expanded":a.open,"aria-controls":a.contentId,"data-state":JB(a.open),...r,ref:l,onClick:We(e.onClick,a.onOpenToggle)});return a.hasCustomAnchor?u:w.jsx(vf,{asChild:!0,...i,children:u})});YB.displayName=WB;var o0="PopoverPortal",[oY,iY]=$B(o0,{forceMount:void 0}),KB=e=>{const{__scopePopover:t,forceMount:n,children:r,container:a}=e,i=wo(o0,t);return w.jsx(oY,{scope:t,forceMount:n,children:w.jsx(Jn,{present:n||i.open,children:w.jsx(df,{asChild:!0,container:a,children:r})})})};KB.displayName=o0;var bl="PopoverContent",XB=k.forwardRef((e,t)=>{const n=iY(bl,e.__scopePopover),{forceMount:r=n.forceMount,...a}=e,i=wo(bl,e.__scopePopover);return w.jsx(Jn,{present:r||i.open,children:i.modal?w.jsx(lY,{...a,ref:t}):w.jsx(sY,{...a,ref:t})})});XB.displayName=bl;var lY=k.forwardRef((e,t)=>{const n=wo(bl,e.__scopePopover),r=k.useRef(null),a=ft(t,r),i=k.useRef(!1);return k.useEffect(()=>{const l=r.current;if(l)return Ik(l)},[]),w.jsx(pf,{as:bo,allowPinchZoom:!0,children:w.jsx(ZB,{...e,ref:a,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:We(e.onCloseAutoFocus,l=>{var u;l.preventDefault(),i.current||(u=n.triggerRef.current)==null||u.focus()}),onPointerDownOutside:We(e.onPointerDownOutside,l=>{const u=l.detail.originalEvent,c=u.button===0&&u.ctrlKey===!0,f=u.button===2||c;i.current=f},{checkForDefaultPrevented:!1}),onFocusOutside:We(e.onFocusOutside,l=>l.preventDefault(),{checkForDefaultPrevented:!1})})})}),sY=k.forwardRef((e,t)=>{const n=wo(bl,e.__scopePopover),r=k.useRef(!1),a=k.useRef(!1);return w.jsx(ZB,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var l,u;(l=e.onCloseAutoFocus)==null||l.call(e,i),i.defaultPrevented||(r.current||(u=n.triggerRef.current)==null||u.focus(),i.preventDefault()),r.current=!1,a.current=!1},onInteractOutside:i=>{var c,f;(c=e.onInteractOutside)==null||c.call(e,i),i.defaultPrevented||(r.current=!0,i.detail.originalEvent.type==="pointerdown"&&(a.current=!0));const l=i.target;((f=n.triggerRef.current)==null?void 0:f.contains(l))&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&a.current&&i.preventDefault()}})}),ZB=k.forwardRef((e,t)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:a,onCloseAutoFocus:i,disableOutsidePointerEvents:l,onEscapeKeyDown:u,onPointerDownOutside:c,onFocusOutside:f,onInteractOutside:p,...g}=e,b=wo(bl,n),m=mu(n);return Dk(),w.jsx(cf,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:a,onUnmountAutoFocus:i,children:w.jsx(gu,{asChild:!0,disableOutsidePointerEvents:l,onInteractOutside:p,onEscapeKeyDown:u,onPointerDownOutside:c,onFocusOutside:f,onDismiss:()=>b.onOpenChange(!1),children:w.jsx(Jk,{"data-state":JB(b.open),role:"dialog",id:b.contentId,...m,...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)"}})})})}),QB="PopoverClose",uY=k.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,a=wo(QB,n);return w.jsx(Xe.button,{type:"button",...r,ref:t,onClick:We(e.onClick,()=>a.onOpenChange(!1))})});uY.displayName=QB;var cY="PopoverArrow",dY=k.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,a=mu(n);return w.jsx(e0,{...a,...r,ref:t})});dY.displayName=cY;function JB(e){return e?"open":"closed"}var fY=qB,pY=YB,gY=KB,eU=XB;const kf=fY,Af=pY,bu=k.forwardRef(({className:e,align:t="center",sideOffset:n=4,...r},a)=>w.jsx(gY,{children:w.jsx(eU,{ref:a,align:t,sideOffset:n,className:Me("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 rounded-md border p-4 shadow-md outline-none",e),...r})}));bu.displayName=eU.displayName;const hY=({status:e})=>e?w.jsxs("div",{className:"min-w-[300px] space-y-3 text-sm",children:[w.jsxs("div",{className:"space-y-1",children:[w.jsx("h4",{className:"font-medium",children:"Storage Info"}),w.jsxs("div",{className:"text-muted-foreground grid grid-cols-2 gap-1",children:[w.jsx("span",{children:"Working Directory:"}),w.jsx("span",{className:"truncate",children:e.working_directory}),w.jsx("span",{children:"Input Directory:"}),w.jsx("span",{className:"truncate",children:e.input_directory})]})]}),w.jsxs("div",{className:"space-y-1",children:[w.jsx("h4",{className:"font-medium",children:"LLM Configuration"}),w.jsxs("div",{className:"text-muted-foreground grid grid-cols-2 gap-1",children:[w.jsx("span",{children:"LLM Binding:"}),w.jsx("span",{children:e.configuration.llm_binding}),w.jsx("span",{children:"LLM Binding Host:"}),w.jsx("span",{children:e.configuration.llm_binding_host}),w.jsx("span",{children:"LLM Model:"}),w.jsx("span",{children:e.configuration.llm_model}),w.jsx("span",{children:"Max Tokens:"}),w.jsx("span",{children:e.configuration.max_tokens})]})]}),w.jsxs("div",{className:"space-y-1",children:[w.jsx("h4",{className:"font-medium",children:"Embedding Configuration"}),w.jsxs("div",{className:"text-muted-foreground grid grid-cols-2 gap-1",children:[w.jsx("span",{children:"Embedding Binding:"}),w.jsx("span",{children:e.configuration.embedding_binding}),w.jsx("span",{children:"Embedding Binding Host:"}),w.jsx("span",{children:e.configuration.embedding_binding_host}),w.jsx("span",{children:"Embedding Model:"}),w.jsx("span",{children:e.configuration.embedding_model})]})]}),w.jsxs("div",{className:"space-y-1",children:[w.jsx("h4",{className:"font-medium",children:"Storage Configuration"}),w.jsxs("div",{className:"text-muted-foreground grid grid-cols-2 gap-1",children:[w.jsx("span",{children:"KV Storage:"}),w.jsx("span",{children:e.configuration.kv_storage}),w.jsx("span",{children:"Doc Status Storage:"}),w.jsx("span",{children:e.configuration.doc_status_storage}),w.jsx("span",{children:"Graph Storage:"}),w.jsx("span",{children:e.configuration.graph_storage}),w.jsx("span",{children:"Vector Storage:"}),w.jsx("span",{children:e.configuration.vector_storage})]})]})]}):w.jsx("div",{className:"text-muted-foreground text-sm",children:"Status information unavailable"}),mY=()=>{const e=Pn.use.health(),t=Pn.use.lastCheckTime(),n=Pn.use.status(),[r,a]=k.useState(!1);return k.useEffect(()=>{a(!0);const i=setTimeout(()=>a(!1),300);return()=>clearTimeout(i)},[t]),w.jsx("div",{className:"fixed right-4 bottom-4 flex items-center gap-2 opacity-80 select-none",children:w.jsxs(kf,{children:[w.jsx(Af,{asChild:!0,children:w.jsxs("div",{className:"flex cursor-help items-center gap-2",children:[w.jsx("div",{className:Me("h-3 w-3 rounded-full transition-all duration-300","shadow-[0_0_8px_rgba(0,0,0,0.2)]",e?"bg-green-500":"bg-red-500",r&&"scale-125",r&&e&&"shadow-[0_0_12px_rgba(34,197,94,0.4)]",r&&!e&&"shadow-[0_0_12px_rgba(239,68,68,0.4)]")}),w.jsx("span",{className:"text-muted-foreground text-xs",children:e?"Connected":"Disconnected"})]})}),w.jsx(bu,{className:"w-auto",side:"top",align:"end",children:w.jsx(hY,{status:n})})]})})},i0=()=>{const e=k.useContext(Cz);if(e===void 0)throw new Error("useTheme must be used within a ThemeProvider");return e};function bY(){const{theme:e,setTheme:t}=i0(),n=k.useCallback(()=>t("light"),[t]),r=k.useCallback(()=>t("dark"),[t]);return e==="dark"?w.jsx(Lt,{onClick:n,variant:Yr,tooltip:"Switch to light theme",size:"icon",side:"bottom",children:w.jsx(Kq,{})}):w.jsx(Lt,{onClick:r,variant:Yr,tooltip:"Switch to dark theme",size:"icon",side:"bottom",children:w.jsx(u8,{})})}function tU(e){const t=e+"CollectionProvider",[n,r]=mr(t),[a,i]=n(t,{collectionRef:{current:null},itemMap:new Map}),l=m=>{const{scope:S,children:v}=m,A=ye.useRef(null),R=ye.useRef(new Map).current;return w.jsx(a,{scope:S,itemMap:R,collectionRef:A,children:v})};l.displayName=t;const u=e+"CollectionSlot",c=ye.forwardRef((m,S)=>{const{scope:v,children:A}=m,R=i(u,v),x=ft(S,R.collectionRef);return w.jsx(bo,{ref:x,children:A})});c.displayName=u;const f=e+"CollectionItemSlot",p="data-radix-collection-item",g=ye.forwardRef((m,S)=>{const{scope:v,children:A,...R}=m,x=ye.useRef(null),_=ft(S,x),C=i(f,v);return ye.useEffect(()=>(C.itemMap.set(x,{ref:x,...R}),()=>void C.itemMap.delete(x))),w.jsx(bo,{[p]:"",ref:_,children:A})});g.displayName=f;function b(m){const S=i(e+"CollectionConsumer",m);return ye.useCallback(()=>{const A=S.collectionRef.current;if(!A)return[];const R=Array.from(A.querySelectorAll(`[${p}]`));return Array.from(S.itemMap.values()).sort((C,N)=>R.indexOf(C.ref.current)-R.indexOf(N.ref.current))},[S.collectionRef,S.itemMap])}return[{Provider:l,Slot:c,ItemSlot:g},b,r]}var yY=k.createContext(void 0);function Tf(e){const t=k.useContext(yY);return e||t||"ltr"}var wh="rovingFocusGroup.onEntryFocus",vY={bubbles:!1,cancelable:!0},_f="RovingFocusGroup",[Ox,nU,SY]=tU(_f),[EY,rU]=mr(_f,[SY]),[wY,xY]=EY(_f),aU=k.forwardRef((e,t)=>w.jsx(Ox.Provider,{scope:e.__scopeRovingFocusGroup,children:w.jsx(Ox.Slot,{scope:e.__scopeRovingFocusGroup,children:w.jsx(kY,{...e,ref:t})})}));aU.displayName=_f;var kY=k.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:a=!1,dir:i,currentTabStopId:l,defaultCurrentTabStopId:u,onCurrentTabStopIdChange:c,onEntryFocus:f,preventScrollOnEntryFocus:p=!1,...g}=e,b=k.useRef(null),m=ft(t,b),S=Tf(i),[v=null,A]=Oa({prop:l,defaultProp:u,onChange:c}),[R,x]=k.useState(!1),_=pn(f),C=nU(n),N=k.useRef(!1),[T,O]=k.useState(0);return k.useEffect(()=>{const z=b.current;if(z)return z.addEventListener(wh,_),()=>z.removeEventListener(wh,_)},[_]),w.jsx(wY,{scope:n,orientation:r,dir:S,loop:a,currentTabStopId:v,onItemFocus:k.useCallback(z=>A(z),[A]),onItemShiftTab:k.useCallback(()=>x(!0),[]),onFocusableItemAdd:k.useCallback(()=>O(z=>z+1),[]),onFocusableItemRemove:k.useCallback(()=>O(z=>z-1),[]),children:w.jsx(Xe.div,{tabIndex:R||T===0?-1:0,"data-orientation":r,...g,ref:m,style:{outline:"none",...e.style},onMouseDown:We(e.onMouseDown,()=>{N.current=!0}),onFocus:We(e.onFocus,z=>{const I=!N.current;if(z.target===z.currentTarget&&I&&!R){const M=new CustomEvent(wh,vY);if(z.currentTarget.dispatchEvent(M),!M.defaultPrevented){const H=C().filter(j=>j.focusable),q=H.find(j=>j.active),U=H.find(j=>j.id===v),Z=[q,U,...H].filter(Boolean).map(j=>j.ref.current);lU(Z,p)}}N.current=!1}),onBlur:We(e.onBlur,()=>x(!1))})})}),oU="RovingFocusGroupItem",iU=k.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:a=!1,tabStopId:i,...l}=e,u=En(),c=i||u,f=xY(oU,n),p=f.currentTabStopId===c,g=nU(n),{onFocusableItemAdd:b,onFocusableItemRemove:m}=f;return k.useEffect(()=>{if(r)return b(),()=>m()},[r,b,m]),w.jsx(Ox.ItemSlot,{scope:n,id:c,focusable:r,active:a,children:w.jsx(Xe.span,{tabIndex:p?0:-1,"data-orientation":f.orientation,...l,ref:t,onMouseDown:We(e.onMouseDown,S=>{r?f.onItemFocus(c):S.preventDefault()}),onFocus:We(e.onFocus,()=>f.onItemFocus(c)),onKeyDown:We(e.onKeyDown,S=>{if(S.key==="Tab"&&S.shiftKey){f.onItemShiftTab();return}if(S.target!==S.currentTarget)return;const v=_Y(S,f.orientation,f.dir);if(v!==void 0){if(S.metaKey||S.ctrlKey||S.altKey||S.shiftKey)return;S.preventDefault();let R=g().filter(x=>x.focusable).map(x=>x.ref.current);if(v==="last")R.reverse();else if(v==="prev"||v==="next"){v==="prev"&&R.reverse();const x=R.indexOf(S.currentTarget);R=f.loop?RY(R,x+1):R.slice(x+1)}setTimeout(()=>lU(R))}})})})});iU.displayName=oU;var AY={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function TY(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function _Y(e,t,n){const r=TY(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return AY[r]}function lU(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function RY(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var CY=aU,NY=iU,l0="Tabs",[OY,nve]=mr(l0,[rU]),sU=rU(),[DY,s0]=OY(l0),uU=k.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:a,defaultValue:i,orientation:l="horizontal",dir:u,activationMode:c="automatic",...f}=e,p=Tf(u),[g,b]=Oa({prop:r,onChange:a,defaultProp:i});return w.jsx(DY,{scope:n,baseId:En(),value:g,onValueChange:b,orientation:l,dir:p,activationMode:c,children:w.jsx(Xe.div,{dir:p,"data-orientation":l,...f,ref:t})})});uU.displayName=l0;var cU="TabsList",dU=k.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...a}=e,i=s0(cU,n),l=sU(n);return w.jsx(CY,{asChild:!0,...l,orientation:i.orientation,dir:i.dir,loop:r,children:w.jsx(Xe.div,{role:"tablist","aria-orientation":i.orientation,...a,ref:t})})});dU.displayName=cU;var fU="TabsTrigger",pU=k.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:a=!1,...i}=e,l=s0(fU,n),u=sU(n),c=mU(l.baseId,r),f=bU(l.baseId,r),p=r===l.value;return w.jsx(NY,{asChild:!0,...u,focusable:!a,active:p,children:w.jsx(Xe.button,{type:"button",role:"tab","aria-selected":p,"aria-controls":f,"data-state":p?"active":"inactive","data-disabled":a?"":void 0,disabled:a,id:c,...i,ref:t,onMouseDown:We(e.onMouseDown,g=>{!a&&g.button===0&&g.ctrlKey===!1?l.onValueChange(r):g.preventDefault()}),onKeyDown:We(e.onKeyDown,g=>{[" ","Enter"].includes(g.key)&&l.onValueChange(r)}),onFocus:We(e.onFocus,()=>{const g=l.activationMode!=="manual";!p&&!a&&g&&l.onValueChange(r)})})})});pU.displayName=fU;var gU="TabsContent",hU=k.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:a,children:i,...l}=e,u=s0(gU,n),c=mU(u.baseId,r),f=bU(u.baseId,r),p=r===u.value,g=k.useRef(p);return k.useEffect(()=>{const b=requestAnimationFrame(()=>g.current=!1);return()=>cancelAnimationFrame(b)},[]),w.jsx(Jn,{present:a||p,children:({present:b})=>w.jsx(Xe.div,{"data-state":p?"active":"inactive","data-orientation":u.orientation,role:"tabpanel","aria-labelledby":c,hidden:!b,id:f,tabIndex:0,...l,ref:t,style:{...e.style,animationDuration:g.current?"0s":void 0},children:b&&i})})});hU.displayName=gU;function mU(e,t){return`${e}-trigger-${t}`}function bU(e,t){return`${e}-content-${t}`}var IY=uU,yU=dU,vU=pU,SU=hU;const LY=IY,EU=k.forwardRef(({className:e,...t},n)=>w.jsx(yU,{ref:n,className:Me("bg-muted text-muted-foreground inline-flex h-10 items-center justify-center rounded-md p-1",e),...t}));EU.displayName=yU.displayName;const wU=k.forwardRef(({className:e,...t},n)=>w.jsx(vU,{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}));wU.displayName=vU.displayName;const qs=k.forwardRef(({className:e,...t},n)=>w.jsx(SU,{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}));qs.displayName=SU.displayName;function $c({value:e,currentTab:t,children:n}){return w.jsx(wU,{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 MY(){const e=Ke.use.currentTab();return w.jsx("div",{className:"flex h-8 self-center",children:w.jsxs(EU,{className:"h-full gap-2",children:[w.jsx($c,{value:"documents",currentTab:e,children:"Documents"}),w.jsx($c,{value:"knowledge-graph",currentTab:e,children:"Knowledge Graph"}),w.jsx($c,{value:"retrieval",currentTab:e,children:"Retrieval"}),w.jsx($c,{value:"api",currentTab:e,children:"API"})]})})}function FY(){return w.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:[w.jsxs("a",{href:"/",className:"mr-6 flex items-center gap-2",children:[w.jsx(p8,{className:"size-4 text-emerald-400","aria-hidden":"true"}),w.jsx("span",{className:"font-bold md:inline-block",children:lR.name})]}),w.jsx("div",{className:"flex h-10 flex-1 justify-center",children:w.jsx(MY,{})}),w.jsxs("nav",{className:"flex items-center",children:[w.jsx(Lt,{variant:"ghost",size:"icon",side:"bottom",tooltip:"Project Repository",children:w.jsx("a",{href:lR.github,target:"_blank",rel:"noopener noreferrer",children:w.jsx(Pq,{className:"size-4","aria-hidden":"true"})})}),w.jsx(bY,{})]})]})}var qc={exports:{}},WR;function zY(){if(WR)return qc.exports;WR=1;var e=typeof Reflect=="object"?Reflect:null,t=e&&typeof e.apply=="function"?e.apply:function(N,T,O){return Function.prototype.apply.call(N,T,O)},n;e&&typeof e.ownKeys=="function"?n=e.ownKeys:Object.getOwnPropertySymbols?n=function(N){return Object.getOwnPropertyNames(N).concat(Object.getOwnPropertySymbols(N))}:n=function(N){return Object.getOwnPropertyNames(N)};function r(C){console&&console.warn&&console.warn(C)}var a=Number.isNaN||function(N){return N!==N};function i(){i.init.call(this)}qc.exports=i,qc.exports.once=R,i.EventEmitter=i,i.prototype._events=void 0,i.prototype._eventsCount=0,i.prototype._maxListeners=void 0;var l=10;function u(C){if(typeof C!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof C)}Object.defineProperty(i,"defaultMaxListeners",{enumerable:!0,get:function(){return l},set:function(C){if(typeof C!="number"||C<0||a(C))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+C+".");l=C}}),i.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},i.prototype.setMaxListeners=function(N){if(typeof N!="number"||N<0||a(N))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+N+".");return this._maxListeners=N,this};function c(C){return C._maxListeners===void 0?i.defaultMaxListeners:C._maxListeners}i.prototype.getMaxListeners=function(){return c(this)},i.prototype.emit=function(N){for(var T=[],O=1;O0&&(M=T[0]),M instanceof Error)throw M;var H=new Error("Unhandled error."+(M?" ("+M.message+")":""));throw H.context=M,H}var q=I[N];if(q===void 0)return!1;if(typeof q=="function")t(q,this,T);else for(var U=q.length,W=S(q,U),O=0;O0&&M.length>z&&!M.warned){M.warned=!0;var H=new Error("Possible EventEmitter memory leak detected. "+M.length+" "+String(N)+" listeners added. Use emitter.setMaxListeners() to increase limit");H.name="MaxListenersExceededWarning",H.emitter=C,H.type=N,H.count=M.length,r(H)}return C}i.prototype.addListener=function(N,T){return f(this,N,T,!1)},i.prototype.on=i.prototype.addListener,i.prototype.prependListener=function(N,T){return f(this,N,T,!0)};function p(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function g(C,N,T){var O={fired:!1,wrapFn:void 0,target:C,type:N,listener:T},z=p.bind(O);return z.listener=T,O.wrapFn=z,z}i.prototype.once=function(N,T){return u(T),this.on(N,g(this,N,T)),this},i.prototype.prependOnceListener=function(N,T){return u(T),this.prependListener(N,g(this,N,T)),this},i.prototype.removeListener=function(N,T){var O,z,I,M,H;if(u(T),z=this._events,z===void 0)return this;if(O=z[N],O===void 0)return this;if(O===T||O.listener===T)--this._eventsCount===0?this._events=Object.create(null):(delete z[N],z.removeListener&&this.emit("removeListener",N,O.listener||T));else if(typeof O!="function"){for(I=-1,M=O.length-1;M>=0;M--)if(O[M]===T||O[M].listener===T){H=O[M].listener,I=M;break}if(I<0)return this;I===0?O.shift():v(O,I),O.length===1&&(z[N]=O[0]),z.removeListener!==void 0&&this.emit("removeListener",N,H||T)}return this},i.prototype.off=i.prototype.removeListener,i.prototype.removeAllListeners=function(N){var T,O,z;if(O=this._events,O===void 0)return this;if(O.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):O[N]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete O[N]),this;if(arguments.length===0){var I=Object.keys(O),M;for(z=0;z=0;z--)this.removeListener(N,T[z]);return this};function b(C,N,T){var O=C._events;if(O===void 0)return[];var z=O[N];return z===void 0?[]:typeof z=="function"?T?[z.listener||z]:[z]:T?A(z):S(z,z.length)}i.prototype.listeners=function(N){return b(this,N,!0)},i.prototype.rawListeners=function(N){return b(this,N,!1)},i.listenerCount=function(C,N){return typeof C.listenerCount=="function"?C.listenerCount(N):m.call(C,N)},i.prototype.listenerCount=m;function m(C){var N=this._events;if(N!==void 0){var T=N[C];if(typeof T=="function")return 1;if(T!==void 0)return T.length}return 0}i.prototype.eventNames=function(){return this._eventsCount>0?n(this._events):[]};function S(C,N){for(var T=new Array(N),O=0;Oe++}function Na(){const e=arguments;let t=null,n=-1;return{[Symbol.iterator](){return this},next(){let r=null;do{if(t===null){if(n++,n>=e.length)return{done:!0};t=e[n][Symbol.iterator]()}if(r=t.next(),r.done){t=null;continue}break}while(!0);return r}}}function Nl(){return{[Symbol.iterator](){return this},next(){return{done:!0}}}}class u0 extends Error{constructor(t){super(),this.name="GraphError",this.message=t}}class Le extends u0{constructor(t){super(t),this.name="InvalidArgumentsGraphError",typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,Le.prototype.constructor)}}class De extends u0{constructor(t){super(t),this.name="NotFoundGraphError",typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,De.prototype.constructor)}}class Ze extends u0{constructor(t){super(t),this.name="UsageGraphError",typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,Ze.prototype.constructor)}}function AU(e,t){this.key=e,this.attributes=t,this.clear()}AU.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 TU(e,t){this.key=e,this.attributes=t,this.clear()}TU.prototype.clear=function(){this.inDegree=0,this.outDegree=0,this.directedLoops=0,this.in={},this.out={}};function _U(e,t){this.key=e,this.attributes=t,this.clear()}_U.prototype.clear=function(){this.undirectedDegree=0,this.undirectedLoops=0,this.undirected={}};function Ol(e,t,n,r,a){this.key=t,this.attributes=a,this.undirected=e,this.source=n,this.target=r}Ol.prototype.attach=function(){let e="out",t="in";this.undirected&&(e=t="undirected");const n=this.source.key,r=this.target.key;this.source[e][r]=this,!(this.undirected&&n===r)&&(this.target[t][n]=this)};Ol.prototype.attachMulti=function(){let e="out",t="in";const n=this.source.key,r=this.target.key;this.undirected&&(e=t="undirected");const a=this.source[e],i=a[r];if(typeof i>"u"){a[r]=this,this.undirected&&n===r||(this.target[t][n]=this);return}i.previous=this,this.next=i,a[r]=this,this.target[t][n]=this};Ol.prototype.detach=function(){const e=this.source.key,t=this.target.key;let n="out",r="in";this.undirected&&(n=r="undirected"),delete this.source[n][t],delete this.target[r][e]};Ol.prototype.detachMulti=function(){const e=this.source.key,t=this.target.key;let n="out",r="in";this.undirected&&(n=r="undirected"),this.previous===void 0?this.next===void 0?(delete this.source[n][t],delete this.target[r][e]):(this.next.previous=void 0,this.source[n][t]=this.next,this.target[r][e]=this.next):(this.previous.next=this.next,this.next!==void 0&&(this.next.previous=this.previous))};const RU=0,CU=1,UY=2,NU=3;function Ma(e,t,n,r,a,i,l){let u,c,f,p;if(r=""+r,n===RU){if(u=e._nodes.get(r),!u)throw new De(`Graph.${t}: could not find the "${r}" node in the graph.`);f=a,p=i}else if(n===NU){if(a=""+a,c=e._edges.get(a),!c)throw new De(`Graph.${t}: could not find the "${a}" edge in the graph.`);const g=c.source.key,b=c.target.key;if(r===g)u=c.target;else if(r===b)u=c.source;else throw new De(`Graph.${t}: the "${r}" node is not attached to the "${a}" edge (${g}, ${b}).`);f=i,p=l}else{if(c=e._edges.get(r),!c)throw new De(`Graph.${t}: could not find the "${r}" edge in the graph.`);n===CU?u=c.source:u=c.target,f=a,p=i}return[u,f,p]}function jY(e,t,n){e.prototype[t]=function(r,a,i){const[l,u]=Ma(this,t,n,r,a,i);return l.attributes[u]}}function GY(e,t,n){e.prototype[t]=function(r,a){const[i]=Ma(this,t,n,r,a);return i.attributes}}function HY(e,t,n){e.prototype[t]=function(r,a,i){const[l,u]=Ma(this,t,n,r,a,i);return l.attributes.hasOwnProperty(u)}}function $Y(e,t,n){e.prototype[t]=function(r,a,i,l){const[u,c,f]=Ma(this,t,n,r,a,i,l);return u.attributes[c]=f,this.emit("nodeAttributesUpdated",{key:u.key,type:"set",attributes:u.attributes,name:c}),this}}function qY(e,t,n){e.prototype[t]=function(r,a,i,l){const[u,c,f]=Ma(this,t,n,r,a,i,l);if(typeof f!="function")throw new Le(`Graph.${t}: updater should be a function.`);const p=u.attributes,g=f(p[c]);return p[c]=g,this.emit("nodeAttributesUpdated",{key:u.key,type:"set",attributes:u.attributes,name:c}),this}}function VY(e,t,n){e.prototype[t]=function(r,a,i){const[l,u]=Ma(this,t,n,r,a,i);return delete l.attributes[u],this.emit("nodeAttributesUpdated",{key:l.key,type:"remove",attributes:l.attributes,name:u}),this}}function WY(e,t,n){e.prototype[t]=function(r,a,i){const[l,u]=Ma(this,t,n,r,a,i);if(!gn(u))throw new Le(`Graph.${t}: provided attributes are not a plain object.`);return l.attributes=u,this.emit("nodeAttributesUpdated",{key:l.key,type:"replace",attributes:l.attributes}),this}}function YY(e,t,n){e.prototype[t]=function(r,a,i){const[l,u]=Ma(this,t,n,r,a,i);if(!gn(u))throw new Le(`Graph.${t}: provided attributes are not a plain object.`);return Qt(l.attributes,u),this.emit("nodeAttributesUpdated",{key:l.key,type:"merge",attributes:l.attributes,data:u}),this}}function KY(e,t,n){e.prototype[t]=function(r,a,i){const[l,u]=Ma(this,t,n,r,a,i);if(typeof u!="function")throw new Le(`Graph.${t}: provided updater is not a function.`);return l.attributes=u(l.attributes),this.emit("nodeAttributesUpdated",{key:l.key,type:"update",attributes:l.attributes}),this}}const XY=[{name:e=>`get${e}Attribute`,attacher:jY},{name:e=>`get${e}Attributes`,attacher:GY},{name:e=>`has${e}Attribute`,attacher:HY},{name:e=>`set${e}Attribute`,attacher:$Y},{name:e=>`update${e}Attribute`,attacher:qY},{name:e=>`remove${e}Attribute`,attacher:VY},{name:e=>`replace${e}Attributes`,attacher:WY},{name:e=>`merge${e}Attributes`,attacher:YY},{name:e=>`update${e}Attributes`,attacher:KY}];function ZY(e){XY.forEach(function({name:t,attacher:n}){n(e,t("Node"),RU),n(e,t("Source"),CU),n(e,t("Target"),UY),n(e,t("Opposite"),NU)})}function QY(e,t,n){e.prototype[t]=function(r,a){let i;if(this.type!=="mixed"&&n!=="mixed"&&n!==this.type)throw new Ze(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new Ze(`Graph.${t}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const l=""+r,u=""+a;if(a=arguments[2],i=hr(this,l,u,n),!i)throw new De(`Graph.${t}: could not find an edge for the given path ("${l}" - "${u}").`)}else{if(n!=="mixed")throw new Ze(`Graph.${t}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(r=""+r,i=this._edges.get(r),!i)throw new De(`Graph.${t}: could not find the "${r}" edge in the graph.`)}return i.attributes[a]}}function JY(e,t,n){e.prototype[t]=function(r){let a;if(this.type!=="mixed"&&n!=="mixed"&&n!==this.type)throw new Ze(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>1){if(this.multi)throw new Ze(`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 i=""+r,l=""+arguments[1];if(a=hr(this,i,l,n),!a)throw new De(`Graph.${t}: could not find an edge for the given path ("${i}" - "${l}").`)}else{if(n!=="mixed")throw new Ze(`Graph.${t}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(r=""+r,a=this._edges.get(r),!a)throw new De(`Graph.${t}: could not find the "${r}" edge in the graph.`)}return a.attributes}}function eK(e,t,n){e.prototype[t]=function(r,a){let i;if(this.type!=="mixed"&&n!=="mixed"&&n!==this.type)throw new Ze(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new Ze(`Graph.${t}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const l=""+r,u=""+a;if(a=arguments[2],i=hr(this,l,u,n),!i)throw new De(`Graph.${t}: could not find an edge for the given path ("${l}" - "${u}").`)}else{if(n!=="mixed")throw new Ze(`Graph.${t}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(r=""+r,i=this._edges.get(r),!i)throw new De(`Graph.${t}: could not find the "${r}" edge in the graph.`)}return i.attributes.hasOwnProperty(a)}}function tK(e,t,n){e.prototype[t]=function(r,a,i){let l;if(this.type!=="mixed"&&n!=="mixed"&&n!==this.type)throw new Ze(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>3){if(this.multi)throw new Ze(`Graph.${t}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const u=""+r,c=""+a;if(a=arguments[2],i=arguments[3],l=hr(this,u,c,n),!l)throw new De(`Graph.${t}: could not find an edge for the given path ("${u}" - "${c}").`)}else{if(n!=="mixed")throw new Ze(`Graph.${t}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(r=""+r,l=this._edges.get(r),!l)throw new De(`Graph.${t}: could not find the "${r}" edge in the graph.`)}return l.attributes[a]=i,this.emit("edgeAttributesUpdated",{key:l.key,type:"set",attributes:l.attributes,name:a}),this}}function nK(e,t,n){e.prototype[t]=function(r,a,i){let l;if(this.type!=="mixed"&&n!=="mixed"&&n!==this.type)throw new Ze(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>3){if(this.multi)throw new Ze(`Graph.${t}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const u=""+r,c=""+a;if(a=arguments[2],i=arguments[3],l=hr(this,u,c,n),!l)throw new De(`Graph.${t}: could not find an edge for the given path ("${u}" - "${c}").`)}else{if(n!=="mixed")throw new Ze(`Graph.${t}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(r=""+r,l=this._edges.get(r),!l)throw new De(`Graph.${t}: could not find the "${r}" edge in the graph.`)}if(typeof i!="function")throw new Le(`Graph.${t}: updater should be a function.`);return l.attributes[a]=i(l.attributes[a]),this.emit("edgeAttributesUpdated",{key:l.key,type:"set",attributes:l.attributes,name:a}),this}}function rK(e,t,n){e.prototype[t]=function(r,a){let i;if(this.type!=="mixed"&&n!=="mixed"&&n!==this.type)throw new Ze(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new Ze(`Graph.${t}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const l=""+r,u=""+a;if(a=arguments[2],i=hr(this,l,u,n),!i)throw new De(`Graph.${t}: could not find an edge for the given path ("${l}" - "${u}").`)}else{if(n!=="mixed")throw new Ze(`Graph.${t}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(r=""+r,i=this._edges.get(r),!i)throw new De(`Graph.${t}: could not find the "${r}" edge in the graph.`)}return delete i.attributes[a],this.emit("edgeAttributesUpdated",{key:i.key,type:"remove",attributes:i.attributes,name:a}),this}}function aK(e,t,n){e.prototype[t]=function(r,a){let i;if(this.type!=="mixed"&&n!=="mixed"&&n!==this.type)throw new Ze(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new Ze(`Graph.${t}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const l=""+r,u=""+a;if(a=arguments[2],i=hr(this,l,u,n),!i)throw new De(`Graph.${t}: could not find an edge for the given path ("${l}" - "${u}").`)}else{if(n!=="mixed")throw new Ze(`Graph.${t}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(r=""+r,i=this._edges.get(r),!i)throw new De(`Graph.${t}: could not find the "${r}" edge in the graph.`)}if(!gn(a))throw new Le(`Graph.${t}: provided attributes are not a plain object.`);return i.attributes=a,this.emit("edgeAttributesUpdated",{key:i.key,type:"replace",attributes:i.attributes}),this}}function oK(e,t,n){e.prototype[t]=function(r,a){let i;if(this.type!=="mixed"&&n!=="mixed"&&n!==this.type)throw new Ze(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new Ze(`Graph.${t}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const l=""+r,u=""+a;if(a=arguments[2],i=hr(this,l,u,n),!i)throw new De(`Graph.${t}: could not find an edge for the given path ("${l}" - "${u}").`)}else{if(n!=="mixed")throw new Ze(`Graph.${t}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(r=""+r,i=this._edges.get(r),!i)throw new De(`Graph.${t}: could not find the "${r}" edge in the graph.`)}if(!gn(a))throw new Le(`Graph.${t}: provided attributes are not a plain object.`);return Qt(i.attributes,a),this.emit("edgeAttributesUpdated",{key:i.key,type:"merge",attributes:i.attributes,data:a}),this}}function iK(e,t,n){e.prototype[t]=function(r,a){let i;if(this.type!=="mixed"&&n!=="mixed"&&n!==this.type)throw new Ze(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new Ze(`Graph.${t}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const l=""+r,u=""+a;if(a=arguments[2],i=hr(this,l,u,n),!i)throw new De(`Graph.${t}: could not find an edge for the given path ("${l}" - "${u}").`)}else{if(n!=="mixed")throw new Ze(`Graph.${t}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(r=""+r,i=this._edges.get(r),!i)throw new De(`Graph.${t}: could not find the "${r}" edge in the graph.`)}if(typeof a!="function")throw new Le(`Graph.${t}: provided updater is not a function.`);return i.attributes=a(i.attributes),this.emit("edgeAttributesUpdated",{key:i.key,type:"update",attributes:i.attributes}),this}}const lK=[{name:e=>`get${e}Attribute`,attacher:QY},{name:e=>`get${e}Attributes`,attacher:JY},{name:e=>`has${e}Attribute`,attacher:eK},{name:e=>`set${e}Attribute`,attacher:tK},{name:e=>`update${e}Attribute`,attacher:nK},{name:e=>`remove${e}Attribute`,attacher:rK},{name:e=>`replace${e}Attributes`,attacher:aK},{name:e=>`merge${e}Attributes`,attacher:oK},{name:e=>`update${e}Attributes`,attacher:iK}];function sK(e){lK.forEach(function({name:t,attacher:n}){n(e,t("Edge"),"mixed"),n(e,t("DirectedEdge"),"directed"),n(e,t("UndirectedEdge"),"undirected")})}const uK=[{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 cK(e,t,n,r){let a=!1;for(const i in t){if(i===r)continue;const l=t[i];if(a=n(l.key,l.attributes,l.source.key,l.target.key,l.source.attributes,l.target.attributes,l.undirected),e&&a)return l.key}}function dK(e,t,n,r){let a,i,l,u=!1;for(const c in t)if(c!==r){a=t[c];do{if(i=a.source,l=a.target,u=n(a.key,a.attributes,i.key,l.key,i.attributes,l.attributes,a.undirected),e&&u)return a.key;a=a.next}while(a!==void 0)}}function xh(e,t){const n=Object.keys(e),r=n.length;let a,i=0;return{[Symbol.iterator](){return this},next(){do if(a)a=a.next;else{if(i>=r)return{done:!0};const l=n[i++];if(l===t){a=void 0;continue}a=e[l]}while(!a);return{done:!1,value:{edge:a.key,attributes:a.attributes,source:a.source.key,target:a.target.key,sourceAttributes:a.source.attributes,targetAttributes:a.target.attributes,undirected:a.undirected}}}}}function fK(e,t,n,r){const a=t[n];if(!a)return;const i=a.source,l=a.target;if(r(a.key,a.attributes,i.key,l.key,i.attributes,l.attributes,a.undirected)&&e)return a.key}function pK(e,t,n,r){let a=t[n];if(!a)return;let i=!1;do{if(i=r(a.key,a.attributes,a.source.key,a.target.key,a.source.attributes,a.target.attributes,a.undirected),e&&i)return a.key;a=a.next}while(a!==void 0)}function kh(e,t){let n=e[t];if(n.next!==void 0)return{[Symbol.iterator](){return this},next(){if(!n)return{done:!0};const a={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:a}}};let r=!1;return{[Symbol.iterator](){return this},next(){return r===!0?{done:!0}:(r=!0,{done:!1,value:{edge:n.key,attributes:n.attributes,source:n.source.key,target:n.target.key,sourceAttributes:n.source.attributes,targetAttributes:n.target.attributes,undirected:n.undirected}})}}}function gK(e,t){if(e.size===0)return[];if(t==="mixed"||t===e.type)return Array.from(e._edges.keys());const n=t==="undirected"?e.undirectedSize:e.directedSize,r=new Array(n),a=t==="undirected",i=e._edges.values();let l=0,u,c;for(;u=i.next(),u.done!==!0;)c=u.value,c.undirected===a&&(r[l++]=c.key);return r}function OU(e,t,n,r){if(t.size===0)return;const a=n!=="mixed"&&n!==t.type,i=n==="undirected";let l,u,c=!1;const f=t._edges.values();for(;l=f.next(),l.done!==!0;){if(u=l.value,a&&u.undirected!==i)continue;const{key:p,attributes:g,source:b,target:m}=u;if(c=r(p,g,b.key,m.key,b.attributes,m.attributes,u.undirected),e&&c)return p}}function hK(e,t){if(e.size===0)return Nl();const n=t!=="mixed"&&t!==e.type,r=t==="undirected",a=e._edges.values();return{[Symbol.iterator](){return this},next(){let i,l;for(;;){if(i=a.next(),i.done)return i;if(l=i.value,!(n&&l.undirected!==r))break}return{value:{edge:l.key,attributes:l.attributes,source:l.source.key,target:l.target.key,sourceAttributes:l.source.attributes,targetAttributes:l.target.attributes,undirected:l.undirected},done:!1}}}}function c0(e,t,n,r,a,i){const l=t?dK:cK;let u;if(n!=="undirected"&&(r!=="out"&&(u=l(e,a.in,i),e&&u)||r!=="in"&&(u=l(e,a.out,i,r?void 0:a.key),e&&u))||n!=="directed"&&(u=l(e,a.undirected,i),e&&u))return u}function mK(e,t,n,r){const a=[];return c0(!1,e,t,n,r,function(i){a.push(i)}),a}function bK(e,t,n){let r=Nl();return e!=="undirected"&&(t!=="out"&&typeof n.in<"u"&&(r=Na(r,xh(n.in))),t!=="in"&&typeof n.out<"u"&&(r=Na(r,xh(n.out,t?void 0:n.key)))),e!=="directed"&&typeof n.undirected<"u"&&(r=Na(r,xh(n.undirected))),r}function d0(e,t,n,r,a,i,l){const u=n?pK:fK;let c;if(t!=="undirected"&&(typeof a.in<"u"&&r!=="out"&&(c=u(e,a.in,i,l),e&&c)||typeof a.out<"u"&&r!=="in"&&(r||a.key!==i)&&(c=u(e,a.out,i,l),e&&c))||t!=="directed"&&typeof a.undirected<"u"&&(c=u(e,a.undirected,i,l),e&&c))return c}function yK(e,t,n,r,a){const i=[];return d0(!1,e,t,n,r,a,function(l){i.push(l)}),i}function vK(e,t,n,r){let a=Nl();return e!=="undirected"&&(typeof n.in<"u"&&t!=="out"&&r in n.in&&(a=Na(a,kh(n.in,r))),typeof n.out<"u"&&t!=="in"&&r in n.out&&(t||n.key!==r)&&(a=Na(a,kh(n.out,r)))),e!=="directed"&&typeof n.undirected<"u"&&r in n.undirected&&(a=Na(a,kh(n.undirected,r))),a}function SK(e,t){const{name:n,type:r,direction:a}=t;e.prototype[n]=function(i,l){if(r!=="mixed"&&this.type!=="mixed"&&r!==this.type)return[];if(!arguments.length)return gK(this,r);if(arguments.length===1){i=""+i;const u=this._nodes.get(i);if(typeof u>"u")throw new De(`Graph.${n}: could not find the "${i}" node in the graph.`);return mK(this.multi,r==="mixed"?this.type:r,a,u)}if(arguments.length===2){i=""+i,l=""+l;const u=this._nodes.get(i);if(!u)throw new De(`Graph.${n}: could not find the "${i}" source node in the graph.`);if(!this._nodes.has(l))throw new De(`Graph.${n}: could not find the "${l}" target node in the graph.`);return yK(r,this.multi,a,u,l)}throw new Le(`Graph.${n}: too many arguments (expecting 0, 1 or 2 and got ${arguments.length}).`)}}function EK(e,t){const{name:n,type:r,direction:a}=t,i="forEach"+n[0].toUpperCase()+n.slice(1,-1);e.prototype[i]=function(f,p,g){if(!(r!=="mixed"&&this.type!=="mixed"&&r!==this.type)){if(arguments.length===1)return g=f,OU(!1,this,r,g);if(arguments.length===2){f=""+f,g=p;const b=this._nodes.get(f);if(typeof b>"u")throw new De(`Graph.${i}: could not find the "${f}" node in the graph.`);return c0(!1,this.multi,r==="mixed"?this.type:r,a,b,g)}if(arguments.length===3){f=""+f,p=""+p;const b=this._nodes.get(f);if(!b)throw new De(`Graph.${i}: could not find the "${f}" source node in the graph.`);if(!this._nodes.has(p))throw new De(`Graph.${i}: could not find the "${p}" target node in the graph.`);return d0(!1,r,this.multi,a,b,p,g)}throw new Le(`Graph.${i}: too many arguments (expecting 1, 2 or 3 and got ${arguments.length}).`)}};const l="map"+n[0].toUpperCase()+n.slice(1);e.prototype[l]=function(){const f=Array.prototype.slice.call(arguments),p=f.pop();let g;if(f.length===0){let b=0;r!=="directed"&&(b+=this.undirectedSize),r!=="undirected"&&(b+=this.directedSize),g=new Array(b);let m=0;f.push((S,v,A,R,x,_,C)=>{g[m++]=p(S,v,A,R,x,_,C)})}else g=[],f.push((b,m,S,v,A,R,x)=>{g.push(p(b,m,S,v,A,R,x))});return this[i].apply(this,f),g};const u="filter"+n[0].toUpperCase()+n.slice(1);e.prototype[u]=function(){const f=Array.prototype.slice.call(arguments),p=f.pop(),g=[];return f.push((b,m,S,v,A,R,x)=>{p(b,m,S,v,A,R,x)&&g.push(b)}),this[i].apply(this,f),g};const c="reduce"+n[0].toUpperCase()+n.slice(1);e.prototype[c]=function(){let f=Array.prototype.slice.call(arguments);if(f.length<2||f.length>4)throw new Le(`Graph.${c}: invalid number of arguments (expecting 2, 3 or 4 and got ${f.length}).`);if(typeof f[f.length-1]=="function"&&typeof f[f.length-2]!="function")throw new Le(`Graph.${c}: missing initial value. You must provide it because the callback takes more than one argument and we cannot infer the initial value from the first iteration, as you could with a simple array.`);let p,g;f.length===2?(p=f[0],g=f[1],f=[]):f.length===3?(p=f[1],g=f[2],f=[f[0]]):f.length===4&&(p=f[2],g=f[3],f=[f[0],f[1]]);let b=g;return f.push((m,S,v,A,R,x,_)=>{b=p(b,m,S,v,A,R,x,_)}),this[i].apply(this,f),b}}function wK(e,t){const{name:n,type:r,direction:a}=t,i="find"+n[0].toUpperCase()+n.slice(1,-1);e.prototype[i]=function(c,f,p){if(r!=="mixed"&&this.type!=="mixed"&&r!==this.type)return!1;if(arguments.length===1)return p=c,OU(!0,this,r,p);if(arguments.length===2){c=""+c,p=f;const g=this._nodes.get(c);if(typeof g>"u")throw new De(`Graph.${i}: could not find the "${c}" node in the graph.`);return c0(!0,this.multi,r==="mixed"?this.type:r,a,g,p)}if(arguments.length===3){c=""+c,f=""+f;const g=this._nodes.get(c);if(!g)throw new De(`Graph.${i}: could not find the "${c}" source node in the graph.`);if(!this._nodes.has(f))throw new De(`Graph.${i}: could not find the "${f}" target node in the graph.`);return d0(!0,r,this.multi,a,g,f,p)}throw new Le(`Graph.${i}: too many arguments (expecting 1, 2 or 3 and got ${arguments.length}).`)};const l="some"+n[0].toUpperCase()+n.slice(1,-1);e.prototype[l]=function(){const c=Array.prototype.slice.call(arguments),f=c.pop();return c.push((g,b,m,S,v,A,R)=>f(g,b,m,S,v,A,R)),!!this[i].apply(this,c)};const u="every"+n[0].toUpperCase()+n.slice(1,-1);e.prototype[u]=function(){const c=Array.prototype.slice.call(arguments),f=c.pop();return c.push((g,b,m,S,v,A,R)=>!f(g,b,m,S,v,A,R)),!this[i].apply(this,c)}}function xK(e,t){const{name:n,type:r,direction:a}=t,i=n.slice(0,-1)+"Entries";e.prototype[i]=function(l,u){if(r!=="mixed"&&this.type!=="mixed"&&r!==this.type)return Nl();if(!arguments.length)return hK(this,r);if(arguments.length===1){l=""+l;const c=this._nodes.get(l);if(!c)throw new De(`Graph.${i}: could not find the "${l}" node in the graph.`);return bK(r,a,c)}if(arguments.length===2){l=""+l,u=""+u;const c=this._nodes.get(l);if(!c)throw new De(`Graph.${i}: could not find the "${l}" source node in the graph.`);if(!this._nodes.has(u))throw new De(`Graph.${i}: could not find the "${u}" target node in the graph.`);return vK(r,a,c,u)}throw new Le(`Graph.${i}: too many arguments (expecting 0, 1 or 2 and got ${arguments.length}).`)}}function kK(e){uK.forEach(t=>{SK(e,t),EK(e,t),wK(e,t),xK(e,t)})}const AK=[{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 Rf(){this.A=null,this.B=null}Rf.prototype.wrap=function(e){this.A===null?this.A=e:this.B===null&&(this.B=e)};Rf.prototype.has=function(e){return this.A!==null&&e in this.A||this.B!==null&&e in this.B};function Ms(e,t,n,r,a){for(const i in r){const l=r[i],u=l.source,c=l.target,f=u===n?c:u;if(t&&t.has(f.key))continue;const p=a(f.key,f.attributes);if(e&&p)return f.key}}function f0(e,t,n,r,a){if(t!=="mixed"){if(t==="undirected")return Ms(e,null,r,r.undirected,a);if(typeof n=="string")return Ms(e,null,r,r[n],a)}const i=new Rf;let l;if(t!=="undirected"){if(n!=="out"){if(l=Ms(e,null,r,r.in,a),e&&l)return l;i.wrap(r.in)}if(n!=="in"){if(l=Ms(e,i,r,r.out,a),e&&l)return l;i.wrap(r.out)}}if(t!=="directed"&&(l=Ms(e,i,r,r.undirected,a),e&&l))return l}function TK(e,t,n){if(e!=="mixed"){if(e==="undirected")return Object.keys(n.undirected);if(typeof t=="string")return Object.keys(n[t])}const r=[];return f0(!1,e,t,n,function(a){r.push(a)}),r}function Fs(e,t,n){const r=Object.keys(n),a=r.length;let i=0;return{[Symbol.iterator](){return this},next(){let l=null;do{if(i>=a)return e&&e.wrap(n),{done:!0};const u=n[r[i++]],c=u.source,f=u.target;if(l=c===t?f:c,e&&e.has(l.key)){l=null;continue}}while(l===null);return{done:!1,value:{neighbor:l.key,attributes:l.attributes}}}}}function _K(e,t,n){if(e!=="mixed"){if(e==="undirected")return Fs(null,n,n.undirected);if(typeof t=="string")return Fs(null,n,n[t])}let r=Nl();const a=new Rf;return e!=="undirected"&&(t!=="out"&&(r=Na(r,Fs(a,n,n.in))),t!=="in"&&(r=Na(r,Fs(a,n,n.out)))),e!=="directed"&&(r=Na(r,Fs(a,n,n.undirected))),r}function RK(e,t){const{name:n,type:r,direction:a}=t;e.prototype[n]=function(i){if(r!=="mixed"&&this.type!=="mixed"&&r!==this.type)return[];i=""+i;const l=this._nodes.get(i);if(typeof l>"u")throw new De(`Graph.${n}: could not find the "${i}" node in the graph.`);return TK(r==="mixed"?this.type:r,a,l)}}function CK(e,t){const{name:n,type:r,direction:a}=t,i="forEach"+n[0].toUpperCase()+n.slice(1,-1);e.prototype[i]=function(f,p){if(r!=="mixed"&&this.type!=="mixed"&&r!==this.type)return;f=""+f;const g=this._nodes.get(f);if(typeof g>"u")throw new De(`Graph.${i}: could not find the "${f}" node in the graph.`);f0(!1,r==="mixed"?this.type:r,a,g,p)};const l="map"+n[0].toUpperCase()+n.slice(1);e.prototype[l]=function(f,p){const g=[];return this[i](f,(b,m)=>{g.push(p(b,m))}),g};const u="filter"+n[0].toUpperCase()+n.slice(1);e.prototype[u]=function(f,p){const g=[];return this[i](f,(b,m)=>{p(b,m)&&g.push(b)}),g};const c="reduce"+n[0].toUpperCase()+n.slice(1);e.prototype[c]=function(f,p,g){if(arguments.length<3)throw new Le(`Graph.${c}: 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 b=g;return this[i](f,(m,S)=>{b=p(b,m,S)}),b}}function NK(e,t){const{name:n,type:r,direction:a}=t,i=n[0].toUpperCase()+n.slice(1,-1),l="find"+i;e.prototype[l]=function(f,p){if(r!=="mixed"&&this.type!=="mixed"&&r!==this.type)return;f=""+f;const g=this._nodes.get(f);if(typeof g>"u")throw new De(`Graph.${l}: could not find the "${f}" node in the graph.`);return f0(!0,r==="mixed"?this.type:r,a,g,p)};const u="some"+i;e.prototype[u]=function(f,p){return!!this[l](f,p)};const c="every"+i;e.prototype[c]=function(f,p){return!this[l](f,(b,m)=>!p(b,m))}}function OK(e,t){const{name:n,type:r,direction:a}=t,i=n.slice(0,-1)+"Entries";e.prototype[i]=function(l){if(r!=="mixed"&&this.type!=="mixed"&&r!==this.type)return Nl();l=""+l;const u=this._nodes.get(l);if(typeof u>"u")throw new De(`Graph.${i}: could not find the "${l}" node in the graph.`);return _K(r==="mixed"?this.type:r,a,u)}}function DK(e){AK.forEach(t=>{RK(e,t),CK(e,t),NK(e,t),OK(e,t)})}function Vc(e,t,n,r,a){const i=r._nodes.values(),l=r.type;let u,c,f,p,g,b;for(;u=i.next(),u.done!==!0;){let m=!1;if(c=u.value,l!=="undirected"){p=c.out;for(f in p){g=p[f];do b=g.target,m=!0,a(c.key,b.key,c.attributes,b.attributes,g.key,g.attributes,g.undirected),g=g.next;while(g)}}if(l!=="directed"){p=c.undirected;for(f in p)if(!(t&&c.key>f)){g=p[f];do b=g.target,b.key!==f&&(b=g.source),m=!0,a(c.key,b.key,c.attributes,b.attributes,g.key,g.attributes,g.undirected),g=g.next;while(g)}}n&&!m&&a(c.key,null,c.attributes,null,null,null,null)}}function IK(e,t){const n={key:e};return kU(t.attributes)||(n.attributes=Qt({},t.attributes)),n}function LK(e,t,n){const r={key:t,source:n.source.key,target:n.target.key};return kU(n.attributes)||(r.attributes=Qt({},n.attributes)),e==="mixed"&&n.undirected&&(r.undirected=!0),r}function MK(e){if(!gn(e))throw new Le('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 Le("Graph.import: serialized node is missing its key.");if("attributes"in e&&(!gn(e.attributes)||e.attributes===null))throw new Le("Graph.import: invalid attributes. Attributes should be a plain object, null or omitted.")}function FK(e){if(!gn(e))throw new Le('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 Le("Graph.import: serialized edge is missing its source.");if(!("target"in e))throw new Le("Graph.import: serialized edge is missing its target.");if("attributes"in e&&(!gn(e.attributes)||e.attributes===null))throw new Le("Graph.import: invalid attributes. Attributes should be a plain object, null or omitted.");if("undirected"in e&&typeof e.undirected!="boolean")throw new Le("Graph.import: invalid undirectedness information. Undirected should be boolean or omitted.")}const zK=BY(),PK=new Set(["directed","undirected","mixed"]),KR=new Set(["domain","_events","_eventsCount","_maxListeners"]),BK=[{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"}],UK={allowSelfLoops:!0,multi:!1,type:"mixed"};function jK(e,t,n){if(n&&!gn(n))throw new Le(`Graph.addNode: invalid attributes. Expecting an object but got "${n}"`);if(t=""+t,n=n||{},e._nodes.has(t))throw new Ze(`Graph.addNode: the "${t}" node already exist in the graph.`);const r=new e.NodeDataClass(t,n);return e._nodes.set(t,r),e.emit("nodeAdded",{key:t,attributes:n}),r}function XR(e,t,n){const r=new e.NodeDataClass(t,n);return e._nodes.set(t,r),e.emit("nodeAdded",{key:t,attributes:n}),r}function DU(e,t,n,r,a,i,l,u){if(!r&&e.type==="undirected")throw new Ze(`Graph.${t}: you cannot add a directed edge to an undirected graph. Use the #.addEdge or #.addUndirectedEdge instead.`);if(r&&e.type==="directed")throw new Ze(`Graph.${t}: you cannot add an undirected edge to a directed graph. Use the #.addEdge or #.addDirectedEdge instead.`);if(u&&!gn(u))throw new Le(`Graph.${t}: invalid attributes. Expecting an object but got "${u}"`);if(i=""+i,l=""+l,u=u||{},!e.allowSelfLoops&&i===l)throw new Ze(`Graph.${t}: source & target are the same ("${i}"), thus creating a loop explicitly forbidden by this graph 'allowSelfLoops' option set to false.`);const c=e._nodes.get(i),f=e._nodes.get(l);if(!c)throw new De(`Graph.${t}: source node "${i}" not found.`);if(!f)throw new De(`Graph.${t}: target node "${l}" not found.`);const p={key:null,undirected:r,source:i,target:l,attributes:u};if(n)a=e._edgeKeyGenerator();else if(a=""+a,e._edges.has(a))throw new Ze(`Graph.${t}: the "${a}" edge already exists in the graph.`);if(!e.multi&&(r?typeof c.undirected[l]<"u":typeof c.out[l]<"u"))throw new Ze(`Graph.${t}: an edge linking "${i}" to "${l}" already exists. If you really want to add multiple edges linking those nodes, you should create a multi graph by using the 'multi' option.`);const g=new Ol(r,a,c,f,u);e._edges.set(a,g);const b=i===l;return r?(c.undirectedDegree++,f.undirectedDegree++,b&&(c.undirectedLoops++,e._undirectedSelfLoopCount++)):(c.outDegree++,f.inDegree++,b&&(c.directedLoops++,e._directedSelfLoopCount++)),e.multi?g.attachMulti():g.attach(),r?e._undirectedSize++:e._directedSize++,p.key=a,e.emit("edgeAdded",p),a}function GK(e,t,n,r,a,i,l,u,c){if(!r&&e.type==="undirected")throw new Ze(`Graph.${t}: you cannot merge/update a directed edge to an undirected graph. Use the #.mergeEdge/#.updateEdge or #.addUndirectedEdge instead.`);if(r&&e.type==="directed")throw new Ze(`Graph.${t}: you cannot merge/update an undirected edge to a directed graph. Use the #.mergeEdge/#.updateEdge or #.addDirectedEdge instead.`);if(u){if(c){if(typeof u!="function")throw new Le(`Graph.${t}: invalid updater function. Expecting a function but got "${u}"`)}else if(!gn(u))throw new Le(`Graph.${t}: invalid attributes. Expecting an object but got "${u}"`)}i=""+i,l=""+l;let f;if(c&&(f=u,u=void 0),!e.allowSelfLoops&&i===l)throw new Ze(`Graph.${t}: source & target are the same ("${i}"), thus creating a loop explicitly forbidden by this graph 'allowSelfLoops' option set to false.`);let p=e._nodes.get(i),g=e._nodes.get(l),b,m;if(!n&&(b=e._edges.get(a),b)){if((b.source.key!==i||b.target.key!==l)&&(!r||b.source.key!==l||b.target.key!==i))throw new Ze(`Graph.${t}: inconsistency detected when attempting to merge the "${a}" edge with "${i}" source & "${l}" target vs. ("${b.source.key}", "${b.target.key}").`);m=b}if(!m&&!e.multi&&p&&(m=r?p.undirected[l]:p.out[l]),m){const x=[m.key,!1,!1,!1];if(c?!f:!u)return x;if(c){const _=m.attributes;m.attributes=f(_),e.emit("edgeAttributesUpdated",{type:"replace",key:m.key,attributes:m.attributes})}else Qt(m.attributes,u),e.emit("edgeAttributesUpdated",{type:"merge",key:m.key,attributes:m.attributes,data:u});return x}u=u||{},c&&f&&(u=f(u));const S={key:null,undirected:r,source:i,target:l,attributes:u};if(n)a=e._edgeKeyGenerator();else if(a=""+a,e._edges.has(a))throw new Ze(`Graph.${t}: the "${a}" edge already exists in the graph.`);let v=!1,A=!1;p||(p=XR(e,i,{}),v=!0,i===l&&(g=p,A=!0)),g||(g=XR(e,l,{}),A=!0),b=new Ol(r,a,p,g,u),e._edges.set(a,b);const R=i===l;return r?(p.undirectedDegree++,g.undirectedDegree++,R&&(p.undirectedLoops++,e._undirectedSelfLoopCount++)):(p.outDegree++,g.inDegree++,R&&(p.directedLoops++,e._directedSelfLoopCount++)),e.multi?b.attachMulti():b.attach(),r?e._undirectedSize++:e._directedSize++,S.key=a,e.emit("edgeAdded",S),[a,!0,v,A]}function Qi(e,t){e._edges.delete(t.key);const{source:n,target:r,attributes:a}=t,i=t.undirected,l=n===r;i?(n.undirectedDegree--,r.undirectedDegree--,l&&(n.undirectedLoops--,e._undirectedSelfLoopCount--)):(n.outDegree--,r.inDegree--,l&&(n.directedLoops--,e._directedSelfLoopCount--)),e.multi?t.detachMulti():t.detach(),i?e._undirectedSize--:e._directedSize--,e.emit("edgeDropped",{key:t.key,attributes:a,source:n.key,target:r.key,undirected:i})}class Tt extends xU.EventEmitter{constructor(t){if(super(),t=Qt({},UK,t),typeof t.multi!="boolean")throw new Le(`Graph.constructor: invalid 'multi' option. Expecting a boolean but got "${t.multi}".`);if(!PK.has(t.type))throw new Le(`Graph.constructor: invalid 'type' option. Should be one of "mixed", "directed" or "undirected" but got "${t.type}".`);if(typeof t.allowSelfLoops!="boolean")throw new Le(`Graph.constructor: invalid 'allowSelfLoops' option. Expecting a boolean but got "${t.allowSelfLoops}".`);const n=t.type==="mixed"?AU:t.type==="directed"?TU:_U;pr(this,"NodeDataClass",n);const r="geid_"+zK()+"_";let a=0;const i=()=>{let l;do l=r+a++;while(this._edges.has(l));return l};pr(this,"_attributes",{}),pr(this,"_nodes",new Map),pr(this,"_edges",new Map),pr(this,"_directedSize",0),pr(this,"_undirectedSize",0),pr(this,"_directedSelfLoopCount",0),pr(this,"_undirectedSelfLoopCount",0),pr(this,"_edgeKeyGenerator",i),pr(this,"_options",t),KR.forEach(l=>pr(this,l,this[l])),Tr(this,"order",()=>this._nodes.size),Tr(this,"size",()=>this._edges.size),Tr(this,"directedSize",()=>this._directedSize),Tr(this,"undirectedSize",()=>this._undirectedSize),Tr(this,"selfLoopCount",()=>this._directedSelfLoopCount+this._undirectedSelfLoopCount),Tr(this,"directedSelfLoopCount",()=>this._directedSelfLoopCount),Tr(this,"undirectedSelfLoopCount",()=>this._undirectedSelfLoopCount),Tr(this,"multi",this._options.multi),Tr(this,"type",this._options.type),Tr(this,"allowSelfLoops",this._options.allowSelfLoops),Tr(this,"implementation",()=>"graphology")}_resetInstanceCounters(){this._directedSize=0,this._undirectedSize=0,this._directedSelfLoopCount=0,this._undirectedSelfLoopCount=0}hasNode(t){return this._nodes.has(""+t)}hasDirectedEdge(t,n){if(this.type==="undirected")return!1;if(arguments.length===1){const r=""+t,a=this._edges.get(r);return!!a&&!a.undirected}else if(arguments.length===2){t=""+t,n=""+n;const r=this._nodes.get(t);return r?r.out.hasOwnProperty(n):!1}throw new Le(`Graph.hasDirectedEdge: invalid arity (${arguments.length}, instead of 1 or 2). You can either ask for an edge id or for the existence of an edge between a source & a target.`)}hasUndirectedEdge(t,n){if(this.type==="directed")return!1;if(arguments.length===1){const r=""+t,a=this._edges.get(r);return!!a&&a.undirected}else if(arguments.length===2){t=""+t,n=""+n;const r=this._nodes.get(t);return r?r.undirected.hasOwnProperty(n):!1}throw new Le(`Graph.hasDirectedEdge: invalid arity (${arguments.length}, instead of 1 or 2). You can either ask for an edge id or for the existence of an edge between a source & a target.`)}hasEdge(t,n){if(arguments.length===1){const r=""+t;return this._edges.has(r)}else if(arguments.length===2){t=""+t,n=""+n;const r=this._nodes.get(t);return r?typeof r.out<"u"&&r.out.hasOwnProperty(n)||typeof r.undirected<"u"&&r.undirected.hasOwnProperty(n):!1}throw new Le(`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 Ze("Graph.directedEdge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.directedEdges instead.");const r=this._nodes.get(t);if(!r)throw new De(`Graph.directedEdge: could not find the "${t}" source node in the graph.`);if(!this._nodes.has(n))throw new De(`Graph.directedEdge: could not find the "${n}" target node in the graph.`);const a=r.out&&r.out[n]||void 0;if(a)return a.key}undirectedEdge(t,n){if(this.type==="directed")return;if(t=""+t,n=""+n,this.multi)throw new Ze("Graph.undirectedEdge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.undirectedEdges instead.");const r=this._nodes.get(t);if(!r)throw new De(`Graph.undirectedEdge: could not find the "${t}" source node in the graph.`);if(!this._nodes.has(n))throw new De(`Graph.undirectedEdge: could not find the "${n}" target node in the graph.`);const a=r.undirected&&r.undirected[n]||void 0;if(a)return a.key}edge(t,n){if(this.multi)throw new Ze("Graph.edge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.edges instead.");t=""+t,n=""+n;const r=this._nodes.get(t);if(!r)throw new De(`Graph.edge: could not find the "${t}" source node in the graph.`);if(!this._nodes.has(n))throw new De(`Graph.edge: could not find the "${n}" target node in the graph.`);const a=r.out&&r.out[n]||r.undirected&&r.undirected[n]||void 0;if(a)return a.key}areDirectedNeighbors(t,n){t=""+t,n=""+n;const r=this._nodes.get(t);if(!r)throw new De(`Graph.areDirectedNeighbors: could not find the "${t}" node in the graph.`);return this.type==="undirected"?!1:n in r.in||n in r.out}areOutNeighbors(t,n){t=""+t,n=""+n;const r=this._nodes.get(t);if(!r)throw new De(`Graph.areOutNeighbors: could not find the "${t}" node in the graph.`);return this.type==="undirected"?!1:n in r.out}areInNeighbors(t,n){t=""+t,n=""+n;const r=this._nodes.get(t);if(!r)throw new De(`Graph.areInNeighbors: could not find the "${t}" node in the graph.`);return this.type==="undirected"?!1:n in r.in}areUndirectedNeighbors(t,n){t=""+t,n=""+n;const r=this._nodes.get(t);if(!r)throw new De(`Graph.areUndirectedNeighbors: could not find the "${t}" node in the graph.`);return this.type==="directed"?!1:n in r.undirected}areNeighbors(t,n){t=""+t,n=""+n;const r=this._nodes.get(t);if(!r)throw new De(`Graph.areNeighbors: could not find the "${t}" node in the graph.`);return this.type!=="undirected"&&(n in r.in||n in r.out)||this.type!=="directed"&&n in r.undirected}areInboundNeighbors(t,n){t=""+t,n=""+n;const r=this._nodes.get(t);if(!r)throw new De(`Graph.areInboundNeighbors: could not find the "${t}" node in the graph.`);return this.type!=="undirected"&&n in r.in||this.type!=="directed"&&n in r.undirected}areOutboundNeighbors(t,n){t=""+t,n=""+n;const r=this._nodes.get(t);if(!r)throw new De(`Graph.areOutboundNeighbors: could not find the "${t}" node in the graph.`);return this.type!=="undirected"&&n in r.out||this.type!=="directed"&&n in r.undirected}inDegree(t){t=""+t;const n=this._nodes.get(t);if(!n)throw new De(`Graph.inDegree: could not find the "${t}" node in the graph.`);return this.type==="undirected"?0:n.inDegree}outDegree(t){t=""+t;const n=this._nodes.get(t);if(!n)throw new De(`Graph.outDegree: could not find the "${t}" node in the graph.`);return this.type==="undirected"?0:n.outDegree}directedDegree(t){t=""+t;const n=this._nodes.get(t);if(!n)throw new De(`Graph.directedDegree: could not find the "${t}" node in the graph.`);return this.type==="undirected"?0:n.inDegree+n.outDegree}undirectedDegree(t){t=""+t;const n=this._nodes.get(t);if(!n)throw new De(`Graph.undirectedDegree: could not find the "${t}" node in the graph.`);return this.type==="directed"?0:n.undirectedDegree}inboundDegree(t){t=""+t;const n=this._nodes.get(t);if(!n)throw new De(`Graph.inboundDegree: could not find the "${t}" node in the graph.`);let r=0;return this.type!=="directed"&&(r+=n.undirectedDegree),this.type!=="undirected"&&(r+=n.inDegree),r}outboundDegree(t){t=""+t;const n=this._nodes.get(t);if(!n)throw new De(`Graph.outboundDegree: could not find the "${t}" node in the graph.`);let r=0;return this.type!=="directed"&&(r+=n.undirectedDegree),this.type!=="undirected"&&(r+=n.outDegree),r}degree(t){t=""+t;const n=this._nodes.get(t);if(!n)throw new De(`Graph.degree: could not find the "${t}" node in the graph.`);let r=0;return this.type!=="directed"&&(r+=n.undirectedDegree),this.type!=="undirected"&&(r+=n.inDegree+n.outDegree),r}inDegreeWithoutSelfLoops(t){t=""+t;const n=this._nodes.get(t);if(!n)throw new De(`Graph.inDegreeWithoutSelfLoops: could not find the "${t}" node in the graph.`);return this.type==="undirected"?0:n.inDegree-n.directedLoops}outDegreeWithoutSelfLoops(t){t=""+t;const n=this._nodes.get(t);if(!n)throw new De(`Graph.outDegreeWithoutSelfLoops: could not find the "${t}" node in the graph.`);return this.type==="undirected"?0:n.outDegree-n.directedLoops}directedDegreeWithoutSelfLoops(t){t=""+t;const n=this._nodes.get(t);if(!n)throw new De(`Graph.directedDegreeWithoutSelfLoops: could not find the "${t}" node in the graph.`);return this.type==="undirected"?0:n.inDegree+n.outDegree-n.directedLoops*2}undirectedDegreeWithoutSelfLoops(t){t=""+t;const n=this._nodes.get(t);if(!n)throw new De(`Graph.undirectedDegreeWithoutSelfLoops: could not find the "${t}" node in the graph.`);return this.type==="directed"?0:n.undirectedDegree-n.undirectedLoops*2}inboundDegreeWithoutSelfLoops(t){t=""+t;const n=this._nodes.get(t);if(!n)throw new De(`Graph.inboundDegreeWithoutSelfLoops: could not find the "${t}" node in the graph.`);let r=0,a=0;return this.type!=="directed"&&(r+=n.undirectedDegree,a+=n.undirectedLoops*2),this.type!=="undirected"&&(r+=n.inDegree,a+=n.directedLoops),r-a}outboundDegreeWithoutSelfLoops(t){t=""+t;const n=this._nodes.get(t);if(!n)throw new De(`Graph.outboundDegreeWithoutSelfLoops: could not find the "${t}" node in the graph.`);let r=0,a=0;return this.type!=="directed"&&(r+=n.undirectedDegree,a+=n.undirectedLoops*2),this.type!=="undirected"&&(r+=n.outDegree,a+=n.directedLoops),r-a}degreeWithoutSelfLoops(t){t=""+t;const n=this._nodes.get(t);if(!n)throw new De(`Graph.degreeWithoutSelfLoops: could not find the "${t}" node in the graph.`);let r=0,a=0;return this.type!=="directed"&&(r+=n.undirectedDegree,a+=n.undirectedLoops*2),this.type!=="undirected"&&(r+=n.inDegree+n.outDegree,a+=n.directedLoops*2),r-a}source(t){t=""+t;const n=this._edges.get(t);if(!n)throw new De(`Graph.source: could not find the "${t}" edge in the graph.`);return n.source.key}target(t){t=""+t;const n=this._edges.get(t);if(!n)throw new De(`Graph.target: could not find the "${t}" edge in the graph.`);return n.target.key}extremities(t){t=""+t;const n=this._edges.get(t);if(!n)throw new De(`Graph.extremities: could not find the "${t}" edge in the graph.`);return[n.source.key,n.target.key]}opposite(t,n){t=""+t,n=""+n;const r=this._edges.get(n);if(!r)throw new De(`Graph.opposite: could not find the "${n}" edge in the graph.`);const a=r.source.key,i=r.target.key;if(t===a)return i;if(t===i)return a;throw new De(`Graph.opposite: the "${t}" node is not attached to the "${n}" edge (${a}, ${i}).`)}hasExtremity(t,n){t=""+t,n=""+n;const r=this._edges.get(t);if(!r)throw new De(`Graph.hasExtremity: could not find the "${t}" edge in the graph.`);return r.source.key===n||r.target.key===n}isUndirected(t){t=""+t;const n=this._edges.get(t);if(!n)throw new De(`Graph.isUndirected: could not find the "${t}" edge in the graph.`);return n.undirected}isDirected(t){t=""+t;const n=this._edges.get(t);if(!n)throw new De(`Graph.isDirected: could not find the "${t}" edge in the graph.`);return!n.undirected}isSelfLoop(t){t=""+t;const n=this._edges.get(t);if(!n)throw new De(`Graph.isSelfLoop: could not find the "${t}" edge in the graph.`);return n.source===n.target}addNode(t,n){return jK(this,t,n).key}mergeNode(t,n){if(n&&!gn(n))throw new Le(`Graph.mergeNode: invalid attributes. Expecting an object but got "${n}"`);t=""+t,n=n||{};let r=this._nodes.get(t);return r?(n&&(Qt(r.attributes,n),this.emit("nodeAttributesUpdated",{type:"merge",key:t,attributes:r.attributes,data:n})),[t,!1]):(r=new this.NodeDataClass(t,n),this._nodes.set(t,r),this.emit("nodeAdded",{key:t,attributes:n}),[t,!0])}updateNode(t,n){if(n&&typeof n!="function")throw new Le(`Graph.updateNode: invalid updater function. Expecting a function but got "${n}"`);t=""+t;let r=this._nodes.get(t);if(r){if(n){const i=r.attributes;r.attributes=n(i),this.emit("nodeAttributesUpdated",{type:"replace",key:t,attributes:r.attributes})}return[t,!1]}const a=n?n({}):{};return r=new this.NodeDataClass(t,a),this._nodes.set(t,r),this.emit("nodeAdded",{key:t,attributes:a}),[t,!0]}dropNode(t){t=""+t;const n=this._nodes.get(t);if(!n)throw new De(`Graph.dropNode: could not find the "${t}" node in the graph.`);let r;if(this.type!=="undirected"){for(const a in n.out){r=n.out[a];do Qi(this,r),r=r.next;while(r)}for(const a in n.in){r=n.in[a];do Qi(this,r),r=r.next;while(r)}}if(this.type!=="directed")for(const a in n.undirected){r=n.undirected[a];do Qi(this,r),r=r.next;while(r)}this._nodes.delete(t),this.emit("nodeDropped",{key:t,attributes:n.attributes})}dropEdge(t){let n;if(arguments.length>1){const r=""+arguments[0],a=""+arguments[1];if(n=hr(this,r,a,this.type),!n)throw new De(`Graph.dropEdge: could not find the "${r}" -> "${a}" edge in the graph.`)}else if(t=""+t,n=this._edges.get(t),!n)throw new De(`Graph.dropEdge: could not find the "${t}" edge in the graph.`);return Qi(this,n),this}dropDirectedEdge(t,n){if(arguments.length<2)throw new Ze("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 Ze("Graph.dropDirectedEdge: cannot use a {source,target} combo when dropping an edge in a MultiGraph since we cannot infer the one you want to delete as there could be multiple ones.");t=""+t,n=""+n;const r=hr(this,t,n,"directed");if(!r)throw new De(`Graph.dropDirectedEdge: could not find a "${t}" -> "${n}" edge in the graph.`);return Qi(this,r),this}dropUndirectedEdge(t,n){if(arguments.length<2)throw new Ze("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 Ze("Graph.dropUndirectedEdge: cannot use a {source,target} combo when dropping an edge in a MultiGraph since we cannot infer the one you want to delete as there could be multiple ones.");const r=hr(this,t,n,"undirected");if(!r)throw new De(`Graph.dropUndirectedEdge: could not find a "${t}" -> "${n}" edge in the graph.`);return Qi(this,r),this}clear(){this._edges.clear(),this._nodes.clear(),this._resetInstanceCounters(),this.emit("cleared")}clearEdges(){const t=this._nodes.values();let n;for(;n=t.next(),n.done!==!0;)n.value.clear();this._edges.clear(),this._resetInstanceCounters(),this.emit("edgesCleared")}getAttribute(t){return this._attributes[t]}getAttributes(){return this._attributes}hasAttribute(t){return this._attributes.hasOwnProperty(t)}setAttribute(t,n){return this._attributes[t]=n,this.emit("attributesUpdated",{type:"set",attributes:this._attributes,name:t}),this}updateAttribute(t,n){if(typeof n!="function")throw new Le("Graph.updateAttribute: updater should be a function.");const r=this._attributes[t];return this._attributes[t]=n(r),this.emit("attributesUpdated",{type:"set",attributes:this._attributes,name:t}),this}removeAttribute(t){return delete this._attributes[t],this.emit("attributesUpdated",{type:"remove",attributes:this._attributes,name:t}),this}replaceAttributes(t){if(!gn(t))throw new Le("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(!gn(t))throw new Le("Graph.mergeAttributes: provided attributes are not a plain object.");return Qt(this._attributes,t),this.emit("attributesUpdated",{type:"merge",attributes:this._attributes,data:t}),this}updateAttributes(t){if(typeof t!="function")throw new Le("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 Le("Graph.updateEachNodeAttributes: expecting an updater function.");if(n&&!YR(n))throw new Le("Graph.updateEachNodeAttributes: invalid hints. Expecting an object having the following shape: {attributes?: [string]}");const r=this._nodes.values();let a,i;for(;a=r.next(),a.done!==!0;)i=a.value,i.attributes=t(i.key,i.attributes);this.emit("eachNodeAttributesUpdated",{hints:n||null})}updateEachEdgeAttributes(t,n){if(typeof t!="function")throw new Le("Graph.updateEachEdgeAttributes: expecting an updater function.");if(n&&!YR(n))throw new Le("Graph.updateEachEdgeAttributes: invalid hints. Expecting an object having the following shape: {attributes?: [string]}");const r=this._edges.values();let a,i,l,u;for(;a=r.next(),a.done!==!0;)i=a.value,l=i.source,u=i.target,i.attributes=t(i.key,i.attributes,l.key,u.key,l.attributes,u.attributes,i.undirected);this.emit("eachEdgeAttributesUpdated",{hints:n||null})}forEachAdjacencyEntry(t){if(typeof t!="function")throw new Le("Graph.forEachAdjacencyEntry: expecting a callback.");Vc(!1,!1,!1,this,t)}forEachAdjacencyEntryWithOrphans(t){if(typeof t!="function")throw new Le("Graph.forEachAdjacencyEntryWithOrphans: expecting a callback.");Vc(!1,!1,!0,this,t)}forEachAssymetricAdjacencyEntry(t){if(typeof t!="function")throw new Le("Graph.forEachAssymetricAdjacencyEntry: expecting a callback.");Vc(!1,!0,!1,this,t)}forEachAssymetricAdjacencyEntryWithOrphans(t){if(typeof t!="function")throw new Le("Graph.forEachAssymetricAdjacencyEntryWithOrphans: expecting a callback.");Vc(!1,!0,!0,this,t)}nodes(){return Array.from(this._nodes.keys())}forEachNode(t){if(typeof t!="function")throw new Le("Graph.forEachNode: expecting a callback.");const n=this._nodes.values();let r,a;for(;r=n.next(),r.done!==!0;)a=r.value,t(a.key,a.attributes)}findNode(t){if(typeof t!="function")throw new Le("Graph.findNode: expecting a callback.");const n=this._nodes.values();let r,a;for(;r=n.next(),r.done!==!0;)if(a=r.value,t(a.key,a.attributes))return a.key}mapNodes(t){if(typeof t!="function")throw new Le("Graph.mapNode: expecting a callback.");const n=this._nodes.values();let r,a;const i=new Array(this.order);let l=0;for(;r=n.next(),r.done!==!0;)a=r.value,i[l++]=t(a.key,a.attributes);return i}someNode(t){if(typeof t!="function")throw new Le("Graph.someNode: expecting a callback.");const n=this._nodes.values();let r,a;for(;r=n.next(),r.done!==!0;)if(a=r.value,t(a.key,a.attributes))return!0;return!1}everyNode(t){if(typeof t!="function")throw new Le("Graph.everyNode: expecting a callback.");const n=this._nodes.values();let r,a;for(;r=n.next(),r.done!==!0;)if(a=r.value,!t(a.key,a.attributes))return!1;return!0}filterNodes(t){if(typeof t!="function")throw new Le("Graph.filterNodes: expecting a callback.");const n=this._nodes.values();let r,a;const i=[];for(;r=n.next(),r.done!==!0;)a=r.value,t(a.key,a.attributes)&&i.push(a.key);return i}reduceNodes(t,n){if(typeof t!="function")throw new Le("Graph.reduceNodes: expecting a callback.");if(arguments.length<2)throw new Le("Graph.reduceNodes: missing initial value. You must provide it because the callback takes more than one argument and we cannot infer the initial value from the first iteration, as you could with a simple array.");let r=n;const a=this._nodes.values();let i,l;for(;i=a.next(),i.done!==!0;)l=i.value,r=t(r,l.key,l.attributes);return r}nodeEntries(){const t=this._nodes.values();return{[Symbol.iterator](){return this},next(){const n=t.next();if(n.done)return n;const r=n.value;return{value:{node:r.key,attributes:r.attributes},done:!1}}}}export(){const t=new Array(this._nodes.size);let n=0;this._nodes.forEach((a,i)=>{t[n++]=IK(i,a)});const r=new Array(this._edges.size);return n=0,this._edges.forEach((a,i)=>{r[n++]=LK(this.type,i,a)}),{options:{type:this.type,multi:this.multi,allowSelfLoops:this.allowSelfLoops},attributes:this.getAttributes(),nodes:t,edges:r}}import(t,n=!1){if(t instanceof Tt)return t.forEachNode((c,f)=>{n?this.mergeNode(c,f):this.addNode(c,f)}),t.forEachEdge((c,f,p,g,b,m,S)=>{n?S?this.mergeUndirectedEdgeWithKey(c,p,g,f):this.mergeDirectedEdgeWithKey(c,p,g,f):S?this.addUndirectedEdgeWithKey(c,p,g,f):this.addDirectedEdgeWithKey(c,p,g,f)}),this;if(!gn(t))throw new Le("Graph.import: invalid argument. Expecting a serialized graph or, alternatively, a Graph instance.");if(t.attributes){if(!gn(t.attributes))throw new Le("Graph.import: invalid attributes. Expecting a plain object.");n?this.mergeAttributes(t.attributes):this.replaceAttributes(t.attributes)}let r,a,i,l,u;if(t.nodes){if(i=t.nodes,!Array.isArray(i))throw new Le("Graph.import: invalid nodes. Expecting an array.");for(r=0,a=i.length;r{const i=Qt({},r.attributes);r=new n.NodeDataClass(a,i),n._nodes.set(a,r)}),n}copy(t){if(t=t||{},typeof t.type=="string"&&t.type!==this.type&&t.type!=="mixed")throw new Ze(`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 Ze("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 Ze("Graph.copy: cannot create an incompatible copy from a graph allowing self loops to one that does not because this would mean losing information about the current graph.");const n=this.emptyCopy(t),r=this._edges.values();let a,i;for(;a=r.next(),a.done!==!0;)i=a.value,DU(n,"copy",!1,i.undirected,i.key,i.source.key,i.target.key,Qt({},i.attributes));return n}toJSON(){return this.export()}toString(){return"[object Graph]"}inspect(){const t={};this._nodes.forEach((i,l)=>{t[l]=i.attributes});const n={},r={};this._edges.forEach((i,l)=>{const u=i.undirected?"--":"->";let c="",f=i.source.key,p=i.target.key,g;i.undirected&&f>p&&(g=f,f=p,p=g);const b=`(${f})${u}(${p})`;l.startsWith("geid_")?this.multi&&(typeof r[b]>"u"?r[b]=0:r[b]++,c+=`${r[b]}. `):c+=`[${l}]: `,c+=b,n[c]=i.attributes});const a={};for(const i in this)this.hasOwnProperty(i)&&!KR.has(i)&&typeof this[i]!="function"&&typeof i!="symbol"&&(a[i]=this[i]);return a.attributes=this._attributes,a.nodes=t,a.edges=n,pr(a,"constructor",this.constructor),a}}typeof Symbol<"u"&&(Tt.prototype[Symbol.for("nodejs.util.inspect.custom")]=Tt.prototype.inspect);BK.forEach(e=>{["add","merge","update"].forEach(t=>{const n=e.name(t),r=t==="add"?DU:GK;e.generateKey?Tt.prototype[n]=function(a,i,l){return r(this,n,!0,(e.type||this.type)==="undirected",null,a,i,l,t==="update")}:Tt.prototype[n]=function(a,i,l,u){return r(this,n,!1,(e.type||this.type)==="undirected",a,i,l,u,t==="update")}})});ZY(Tt);sK(Tt);kK(Tt);DK(Tt);class tu extends Tt{constructor(t){const n=Qt({type:"directed"},t);if("multi"in n&&n.multi!==!1)throw new Le("DirectedGraph.from: inconsistent indication that the graph should be multi in given options!");if(n.type!=="directed")throw new Le('DirectedGraph.from: inconsistent "'+n.type+'" type in given options!');super(n)}}class IU extends Tt{constructor(t){const n=Qt({type:"undirected"},t);if("multi"in n&&n.multi!==!1)throw new Le("UndirectedGraph.from: inconsistent indication that the graph should be multi in given options!");if(n.type!=="undirected")throw new Le('UndirectedGraph.from: inconsistent "'+n.type+'" type in given options!');super(n)}}class LU extends Tt{constructor(t){const n=Qt({multi:!0},t);if("multi"in n&&n.multi!==!0)throw new Le("MultiGraph.from: inconsistent indication that the graph should be simple in given options!");super(n)}}class MU extends Tt{constructor(t){const n=Qt({type:"directed",multi:!0},t);if("multi"in n&&n.multi!==!0)throw new Le("MultiDirectedGraph.from: inconsistent indication that the graph should be simple in given options!");if(n.type!=="directed")throw new Le('MultiDirectedGraph.from: inconsistent "'+n.type+'" type in given options!');super(n)}}class FU extends Tt{constructor(t){const n=Qt({type:"undirected",multi:!0},t);if("multi"in n&&n.multi!==!0)throw new Le("MultiUndirectedGraph.from: inconsistent indication that the graph should be simple in given options!");if(n.type!=="undirected")throw new Le('MultiUndirectedGraph.from: inconsistent "'+n.type+'" type in given options!');super(n)}}function Dl(e){e.from=function(t,n){const r=Qt({},t.options,n),a=new e(r);return a.import(t),a}}Dl(Tt);Dl(tu);Dl(IU);Dl(LU);Dl(MU);Dl(FU);Tt.Graph=Tt;Tt.DirectedGraph=tu;Tt.UndirectedGraph=IU;Tt.MultiGraph=LU;Tt.MultiDirectedGraph=MU;Tt.MultiUndirectedGraph=FU;Tt.InvalidArgumentsGraphError=Le;Tt.NotFoundGraphError=De;Tt.UsageGraphError=Ze;function HK(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function Ws(e){var t=HK(e,"string");return typeof t=="symbol"?t:t+""}function on(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ZR(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,r=Array(t);n>8&255,i=n>>16&255,l=n>>24&255;return[r,a,i,l]}var Th={};function GU(e){if(typeof Th[e]<"u")return Th[e];var t=(e&16711680)>>>16,n=(e&65280)>>>8,r=e&255,a=255,i=jU(t,n,r,a);return Th[e]=i,i}function QR(e,t,n,r){return n+(t<<8)+(e<<16)}function JR(e,t,n,r,a,i){var l=Math.floor(n/i*a),u=Math.floor(e.drawingBufferHeight/i-r/i*a),c=new Uint8Array(4);e.bindFramebuffer(e.FRAMEBUFFER,t),e.readPixels(l,u,1,1,e.RGBA,e.UNSIGNED_BYTE,c);var f=vl(c,4),p=f[0],g=f[1],b=f[2],m=f[3];return[p,g,b,m]}function _e(e,t,n){return(t=Ws(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function eC(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function Be(e){for(var t=1;tC){var T="…";for(f=f+T,N=e.measureText(f).width;N>C&&f.length>1;)f=f.slice(0,-2)+T,N=e.measureText(f).width;if(f.length<4)return}var O;x>0?_>0?O=Math.acos(x/C):O=Math.asin(_/C):_>0?O=Math.acos(x/C)+Math.PI:O=Math.asin(x/C)+Math.PI/2,e.save(),e.translate(A,R),e.rotate(O),e.fillText(f,-N/2,t.size/2+i),e.restore()}}}function WU(e,t,n){if(t.label){var r=n.labelSize,a=n.labelFont,i=n.labelWeight,l=n.labelColor.attribute?t[n.labelColor.attribute]||n.labelColor.color||"#000":n.labelColor.color;e.fillStyle=l,e.font="".concat(i," ").concat(r,"px ").concat(a),e.fillText(t.label,t.x+t.size+3,t.y+r/3)}}function iX(e,t,n){var r=n.labelSize,a=n.labelFont,i=n.labelWeight;e.font="".concat(i," ").concat(r,"px ").concat(a),e.fillStyle="#FFF",e.shadowOffsetX=0,e.shadowOffsetY=0,e.shadowBlur=8,e.shadowColor="#000";var l=2;if(typeof t.label=="string"){var u=e.measureText(t.label).width,c=Math.round(u+5),f=Math.round(r+2*l),p=Math.max(t.size,r/2)+l,g=Math.asin(f/2/p),b=Math.sqrt(Math.abs(Math.pow(p,2)-Math.pow(f/2,2)));e.beginPath(),e.moveTo(t.x+b,t.y+f/2),e.lineTo(t.x+p+c,t.y+f/2),e.lineTo(t.x+p+c,t.y-f/2),e.lineTo(t.x+b,t.y-f/2),e.arc(t.x,t.y,p,g,-g),e.closePath(),e.fill()}else e.beginPath(),e.arc(t.x,t.y,t.size+l,0,Math.PI*2),e.closePath(),e.fill();e.shadowOffsetX=0,e.shadowOffsetY=0,e.shadowBlur=0,WU(e,t,n)}var lX=` +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 +} +`,sX=lX,uX=` +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; +} +`,cX=uX,YU=WebGLRenderingContext,aC=YU.UNSIGNED_BYTE,Rh=YU.FLOAT,dX=["u_sizeRatio","u_correctionRatio","u_matrix"],vu=function(e){function t(){return on(this,t),Bn(this,t,arguments)}return Un(t,e),ln(t,[{key:"getDefinition",value:function(){return{VERTICES:3,VERTEX_SHADER_SOURCE:cX,FRAGMENT_SHADER_SOURCE:sX,METHOD:WebGLRenderingContext.TRIANGLES,UNIFORMS:dX,ATTRIBUTES:[{name:"a_position",size:2,type:Rh},{name:"a_size",size:1,type:Rh},{name:"a_color",size:4,type:aC,normalized:!0},{name:"a_id",size:4,type:aC,normalized:!0}],CONSTANT_ATTRIBUTES:[{name:"a_angle",size:1,type:Rh}],CONSTANT_DATA:[[t.ANGLE_1],[t.ANGLE_2],[t.ANGLE_3]]}}},{key:"processVisibleItem",value:function(r,a,i){var l=this.array,u=Qr(i.color);l[a++]=i.x,l[a++]=i.y,l[a++]=i.size,l[a++]=u,l[a++]=r}},{key:"setUniforms",value:function(r,a){var i=a.gl,l=a.uniformLocations,u=l.u_sizeRatio,c=l.u_correctionRatio,f=l.u_matrix;i.uniform1f(c,r.correctionRatio),i.uniform1f(u,r.sizeRatio),i.uniformMatrix3fv(f,!1,r.matrix)}}])}(p0);_e(vu,"ANGLE_1",0);_e(vu,"ANGLE_2",2*Math.PI/3);_e(vu,"ANGLE_3",4*Math.PI/3);var fX=` +precision mediump float; + +varying vec4 v_color; + +void main(void) { + gl_FragColor = v_color; +} +`,pX=fX,gX=` +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; +} +`,hX=gX,KU=WebGLRenderingContext,oC=KU.UNSIGNED_BYTE,Yc=KU.FLOAT,mX=["u_matrix","u_sizeRatio","u_correctionRatio","u_minEdgeThickness","u_lengthToThicknessRatio","u_widenessToThicknessRatio"],Su={extremity:"target",lengthToThicknessRatio:2.5,widenessToThicknessRatio:2};function Pd(e){var t=Be(Be({},Su),e||{});return function(n){function r(){return on(this,r),Bn(this,r,arguments)}return Un(r,n),ln(r,[{key:"getDefinition",value:function(){return{VERTICES:3,VERTEX_SHADER_SOURCE:hX,FRAGMENT_SHADER_SOURCE:pX,METHOD:WebGLRenderingContext.TRIANGLES,UNIFORMS:mX,ATTRIBUTES:[{name:"a_position",size:2,type:Yc},{name:"a_normal",size:2,type:Yc},{name:"a_radius",size:1,type:Yc},{name:"a_color",size:4,type:oC,normalized:!0},{name:"a_id",size:4,type:oC,normalized:!0}],CONSTANT_ATTRIBUTES:[{name:"a_barycentric",size:3,type:Yc}],CONSTANT_DATA:[[1,0,0],[0,1,0],[0,0,1]]}}},{key:"processVisibleItem",value:function(i,l,u,c,f){if(t.extremity==="source"){var p=[c,u];u=p[0],c=p[1]}var g=f.size||1,b=c.size||1,m=u.x,S=u.y,v=c.x,A=c.y,R=Qr(f.color),x=v-m,_=A-S,C=x*x+_*_,N=0,T=0;C&&(C=1/Math.sqrt(C),N=-_*C*g,T=x*C*g);var O=this.array;O[l++]=v,O[l++]=A,O[l++]=-N,O[l++]=-T,O[l++]=b,O[l++]=R,O[l++]=i}},{key:"setUniforms",value:function(i,l){var u=l.gl,c=l.uniformLocations,f=c.u_matrix,p=c.u_sizeRatio,g=c.u_correctionRatio,b=c.u_minEdgeThickness,m=c.u_lengthToThicknessRatio,S=c.u_widenessToThicknessRatio;u.uniformMatrix3fv(f,!1,i.matrix),u.uniform1f(p,i.sizeRatio),u.uniform1f(g,i.correctionRatio),u.uniform1f(b,i.minEdgeThickness),u.uniform1f(m,t.lengthToThicknessRatio),u.uniform1f(S,t.widenessToThicknessRatio)}}])}(yu)}Pd();var bX=` +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 +} +`,g0=bX,yX=` +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; +} +`,vX=yX,XU=WebGLRenderingContext,iC=XU.UNSIGNED_BYTE,Ko=XU.FLOAT,SX=["u_matrix","u_zoomRatio","u_sizeRatio","u_correctionRatio","u_pixelRatio","u_feather","u_minEdgeThickness","u_lengthToThicknessRatio"],EX={lengthToThicknessRatio:Su.lengthToThicknessRatio};function ZU(e){var t=Be(Be({},EX),{});return function(n){function r(){return on(this,r),Bn(this,r,arguments)}return Un(r,n),ln(r,[{key:"getDefinition",value:function(){return{VERTICES:6,VERTEX_SHADER_SOURCE:vX,FRAGMENT_SHADER_SOURCE:g0,METHOD:WebGLRenderingContext.TRIANGLES,UNIFORMS:SX,ATTRIBUTES:[{name:"a_positionStart",size:2,type:Ko},{name:"a_positionEnd",size:2,type:Ko},{name:"a_normal",size:2,type:Ko},{name:"a_color",size:4,type:iC,normalized:!0},{name:"a_id",size:4,type:iC,normalized:!0},{name:"a_radius",size:1,type:Ko}],CONSTANT_ATTRIBUTES:[{name:"a_positionCoef",size:1,type:Ko},{name:"a_normalCoef",size:1,type:Ko},{name:"a_radiusCoef",size:1,type:Ko}],CONSTANT_DATA:[[0,1,0],[0,-1,0],[1,1,1],[1,1,1],[0,-1,0],[1,-1,-1]]}}},{key:"processVisibleItem",value:function(i,l,u,c,f){var p=f.size||1,g=u.x,b=u.y,m=c.x,S=c.y,v=Qr(f.color),A=m-g,R=S-b,x=c.size||1,_=A*A+R*R,C=0,N=0;_&&(_=1/Math.sqrt(_),C=-R*_*p,N=A*_*p);var T=this.array;T[l++]=g,T[l++]=b,T[l++]=m,T[l++]=S,T[l++]=C,T[l++]=N,T[l++]=v,T[l++]=i,T[l++]=x}},{key:"setUniforms",value:function(i,l){var u=l.gl,c=l.uniformLocations,f=c.u_matrix,p=c.u_zoomRatio,g=c.u_feather,b=c.u_pixelRatio,m=c.u_correctionRatio,S=c.u_sizeRatio,v=c.u_minEdgeThickness,A=c.u_lengthToThicknessRatio;u.uniformMatrix3fv(f,!1,i.matrix),u.uniform1f(p,i.zoomRatio),u.uniform1f(S,i.sizeRatio),u.uniform1f(m,i.correctionRatio),u.uniform1f(b,i.pixelRatio),u.uniform1f(g,i.antiAliasingFeather),u.uniform1f(v,i.minEdgeThickness),u.uniform1f(A,t.lengthToThicknessRatio)}}])}(yu)}ZU();function wX(e){return VU([ZU(),Pd(e)])}var xX=wX(),QU=xX,kX=` +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; +} +`,AX=kX,JU=WebGLRenderingContext,lC=JU.UNSIGNED_BYTE,zs=JU.FLOAT,TX=["u_matrix","u_zoomRatio","u_sizeRatio","u_correctionRatio","u_pixelRatio","u_feather","u_minEdgeThickness"],_X=function(e){function t(){return on(this,t),Bn(this,t,arguments)}return Un(t,e),ln(t,[{key:"getDefinition",value:function(){return{VERTICES:6,VERTEX_SHADER_SOURCE:AX,FRAGMENT_SHADER_SOURCE:g0,METHOD:WebGLRenderingContext.TRIANGLES,UNIFORMS:TX,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:lC,normalized:!0},{name:"a_id",size:4,type:lC,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(r,a,i,l,u){var c=u.size||1,f=i.x,p=i.y,g=l.x,b=l.y,m=Qr(u.color),S=g-f,v=b-p,A=S*S+v*v,R=0,x=0;A&&(A=1/Math.sqrt(A),R=-v*A*c,x=S*A*c);var _=this.array;_[a++]=f,_[a++]=p,_[a++]=g,_[a++]=b,_[a++]=R,_[a++]=x,_[a++]=m,_[a++]=r}},{key:"setUniforms",value:function(r,a){var i=a.gl,l=a.uniformLocations,u=l.u_matrix,c=l.u_zoomRatio,f=l.u_feather,p=l.u_pixelRatio,g=l.u_correctionRatio,b=l.u_sizeRatio,m=l.u_minEdgeThickness;i.uniformMatrix3fv(u,!1,r.matrix),i.uniform1f(c,r.zoomRatio),i.uniform1f(b,r.sizeRatio),i.uniform1f(g,r.correctionRatio),i.uniform1f(p,r.pixelRatio),i.uniform1f(f,r.antiAliasingFeather),i.uniform1f(m,r.minEdgeThickness)}}])}(yu),h0=function(e){function t(){var n;return on(this,t),n=Bn(this,t),n.rawEmitter=n,n}return Un(t,e),ln(t)}(xU.EventEmitter),Ch,sC;function Jr(){return sC||(sC=1,Ch=function(t){return t!==null&&typeof t=="object"&&typeof t.addUndirectedEdgeWithKey=="function"&&typeof t.dropNode=="function"&&typeof t.multi=="boolean"}),Ch}var RX=Jr();const CX=an(RX);var NX=function(t){return t},OX=function(t){return t*t},DX=function(t){return t*(2-t)},IX=function(t){return(t*=2)<1?.5*t*t:-.5*(--t*(t-2)-1)},LX=function(t){return t*t*t},MX=function(t){return--t*t*t+1},FX=function(t){return(t*=2)<1?.5*t*t*t:.5*((t-=2)*t*t+2)},e3={linear:NX,quadraticIn:OX,quadraticOut:DX,quadraticInOut:IX,cubicIn:LX,cubicOut:MX,cubicInOut:FX},t3={easing:"quadraticInOut",duration:150};function zX(e,t,n,r){var a=Object.assign({},t3,n),i=typeof a.easing=="function"?a.easing:e3[a.easing],l=Date.now(),u={};for(var c in t){var f=t[c];u[c]={};for(var p in f)u[c][p]=e.getNodeAttribute(c,p)}var g=null,b=function(){g=null;var S=(Date.now()-l)/a.duration;if(S>=1){for(var v in t){var A=t[v];for(var R in A)e.setNodeAttribute(v,R,A[R])}return}S=i(S);for(var x in t){var _=t[x],C=u[x];for(var N in _)e.setNodeAttribute(x,N,_[N]*S+C[N]*(1-S))}g=requestAnimationFrame(b)};return b(),function(){g&&cancelAnimationFrame(g)}}function _r(){return Float32Array.of(1,0,0,0,1,0,0,0,1)}function Kc(e,t,n){return e[0]=t,e[4]=typeof n=="number"?n:t,e}function uC(e,t){var n=Math.sin(t),r=Math.cos(t);return e[0]=r,e[1]=n,e[3]=-n,e[4]=r,e}function cC(e,t,n){return e[6]=t,e[7]=n,e}function io(e,t){var n=e[0],r=e[1],a=e[2],i=e[3],l=e[4],u=e[5],c=e[6],f=e[7],p=e[8],g=t[0],b=t[1],m=t[2],S=t[3],v=t[4],A=t[5],R=t[6],x=t[7],_=t[8];return e[0]=g*n+b*i+m*c,e[1]=g*r+b*l+m*f,e[2]=g*a+b*u+m*p,e[3]=S*n+v*i+A*c,e[4]=S*r+v*l+A*f,e[5]=S*a+v*u+A*p,e[6]=R*n+x*i+_*c,e[7]=R*r+x*l+_*f,e[8]=R*a+x*u+_*p,e}function Mx(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,r=e[0],a=e[1],i=e[3],l=e[4],u=e[6],c=e[7],f=t.x,p=t.y;return{x:f*r+p*i+u*n,y:f*a+p*l+c*n}}function PX(e,t){var n=e.height/e.width,r=t.height/t.width;return n<1&&r>1||n>1&&r<1?1:Math.min(Math.max(r,1/r),Math.max(1/n,n))}function Ps(e,t,n,r,a){var i=e.angle,l=e.ratio,u=e.x,c=e.y,f=t.width,p=t.height,g=_r(),b=Math.min(f,p)-2*r,m=PX(t,n);return a?(io(g,cC(_r(),u,c)),io(g,Kc(_r(),l)),io(g,uC(_r(),i)),io(g,Kc(_r(),f/b/2/m,p/b/2/m))):(io(g,Kc(_r(),2*(b/f)*m,2*(b/p)*m)),io(g,uC(_r(),-i)),io(g,Kc(_r(),1/l)),io(g,cC(_r(),-u,-c))),g}function BX(e,t,n){var r=Mx(e,{x:Math.cos(t.angle),y:Math.sin(t.angle)},0),a=r.x,i=r.y;return 1/Math.sqrt(Math.pow(a,2)+Math.pow(i,2))/n.width}function UX(e){if(!e.order)return{x:[0,1],y:[0,1]};var t=1/0,n=-1/0,r=1/0,a=-1/0;return e.forEachNode(function(i,l){var u=l.x,c=l.y;un&&(n=u),ca&&(a=c)}),{x:[t,n],y:[r,a]}}function jX(e){if(!CX(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 GX(e,t,n){var r=document.createElement(e);if(t)for(var a in t)r.style[a]=t[a];if(n)for(var i in n)r.setAttribute(i,n[i]);return r}function dC(){return typeof window.devicePixelRatio<"u"?window.devicePixelRatio:1}function fC(e,t,n){return n.sort(function(r,a){var i=t(r)||0,l=t(a)||0;return il?1:0})}function pC(e){var t=vl(e.x,2),n=t[0],r=t[1],a=vl(e.y,2),i=a[0],l=a[1],u=Math.max(r-n,l-i),c=(r+n)/2,f=(l+i)/2;(u===0||Math.abs(u)===1/0||isNaN(u))&&(u=1),isNaN(c)&&(c=0),isNaN(f)&&(f=0);var p=function(b){return{x:.5+(b.x-c)/u,y:.5+(b.y-f)/u}};return p.applyTo=function(g){g.x=.5+(g.x-c)/u,g.y=.5+(g.y-f)/u},p.inverse=function(g){return{x:c+u*(g.x-.5),y:f+u*(g.y-.5)}},p.ratio=u,p}function Fx(e){"@babel/helpers - typeof";return Fx=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},Fx(e)}function gC(e,t){var n=t.size;if(n!==0){var r=e.length;e.length+=n;var a=0;t.forEach(function(i){e[r+a]=i,a++})}}function Nh(e){e=e||{};for(var t=0,n=arguments.length<=1?0:arguments.length-1;t1&&arguments[1]!==void 0?arguments[1]:{},l=arguments.length>2?arguments[2]:void 0;if(!l)return new Promise(function(m){return a.animate(r,i,m)});if(this.enabled){var u=Be(Be({},t3),i),c=this.validateState(r),f=typeof u.easing=="function"?u.easing:e3[u.easing],p=Date.now(),g=this.getState(),b=function(){var S=(Date.now()-p)/u.duration;if(S>=1){a.nextFrame=null,a.setState(c),a.animationCallback&&(a.animationCallback.call(null),a.animationCallback=void 0);return}var v=f(S),A={};typeof c.x=="number"&&(A.x=g.x+(c.x-g.x)*v),typeof c.y=="number"&&(A.y=g.y+(c.y-g.y)*v),a.enabledRotation&&typeof c.angle=="number"&&(A.angle=g.angle+(c.angle-g.angle)*v),typeof c.ratio=="number"&&(A.ratio=g.ratio+(c.ratio-g.ratio)*v),a.setState(A),a.nextFrame=requestAnimationFrame(b)};this.nextFrame?(cancelAnimationFrame(this.nextFrame),this.animationCallback&&this.animationCallback.call(null),this.nextFrame=requestAnimationFrame(b)):b(),this.animationCallback=l}}},{key:"animatedZoom",value:function(r){return r?typeof r=="number"?this.animate({ratio:this.ratio/r}):this.animate({ratio:this.ratio/(r.factor||Xc)},r):this.animate({ratio:this.ratio/Xc})}},{key:"animatedUnzoom",value:function(r){return r?typeof r=="number"?this.animate({ratio:this.ratio*r}):this.animate({ratio:this.ratio*(r.factor||Xc)},r):this.animate({ratio:this.ratio*Xc})}},{key:"animatedReset",value:function(r){return this.animate({x:.5,y:.5,ratio:1,angle:0},r)}},{key:"copy",value:function(){return t.from(this.getState())}}],[{key:"from",value:function(r){var a=new t;return a.setState(r)}}])}(h0);function Cr(e,t){var n=t.getBoundingClientRect();return{x:e.clientX-n.left,y:e.clientY-n.top}}function Aa(e,t){var n=Be(Be({},Cr(e,t)),{},{sigmaDefaultPrevented:!1,preventSigmaDefault:function(){n.sigmaDefaultPrevented=!0},original:e});return n}function Bs(e){var t="x"in e?e:Be(Be({},e.touches[0]||e.previousTouches[0]),{},{original:e.original,sigmaDefaultPrevented:e.sigmaDefaultPrevented,preventSigmaDefault:function(){e.sigmaDefaultPrevented=!0,t.sigmaDefaultPrevented=!0}});return t}function VX(e,t){return Be(Be({},Aa(e,t)),{},{delta:n3(e)})}var WX=2;function vd(e){for(var t=[],n=0,r=Math.min(e.length,WX);n0;a.draggedEvents=0,g&&a.renderer.getSetting("hideEdgesOnMove")&&a.renderer.refresh()},0),this.emit("mouseup",Aa(r,this.container))}}},{key:"handleMove",value:function(r){var a=this;if(this.enabled){var i=Aa(r,this.container);if(this.emit("mousemovebody",i),(r.target===this.container||r.composedPath()[0]===this.container)&&this.emit("mousemove",i),!i.sigmaDefaultPrevented&&this.isMouseDown){this.isMoving=!0,this.draggedEvents++,typeof this.movingTimeout=="number"&&clearTimeout(this.movingTimeout),this.movingTimeout=window.setTimeout(function(){a.movingTimeout=null,a.isMoving=!1},this.settings.dragTimeout);var l=this.renderer.getCamera(),u=Cr(r,this.container),c=u.x,f=u.y,p=this.renderer.viewportToFramedGraph({x:this.lastMouseX,y:this.lastMouseY}),g=this.renderer.viewportToFramedGraph({x:c,y:f}),b=p.x-g.x,m=p.y-g.y,S=l.getState(),v=S.x+b,A=S.y+m;l.setState({x:v,y:A}),this.lastMouseX=c,this.lastMouseY=f,r.preventDefault(),r.stopPropagation()}}}},{key:"handleLeave",value:function(r){this.emit("mouseleave",Aa(r,this.container))}},{key:"handleEnter",value:function(r){this.emit("mouseenter",Aa(r,this.container))}},{key:"handleWheel",value:function(r){var a=this,i=this.renderer.getCamera();if(!(!this.enabled||!i.enabledZooming)){var l=n3(r);if(l){var u=VX(r,this.container);if(this.emit("wheel",u),u.sigmaDefaultPrevented){r.preventDefault(),r.stopPropagation();return}var c=i.getState().ratio,f=l>0?1/this.settings.zoomingRatio:this.settings.zoomingRatio,p=i.getBoundedRatio(c*f),g=l>0?1:-1,b=Date.now();c!==p&&(r.preventDefault(),r.stopPropagation(),!(this.currentWheelDirection===g&&this.lastWheelTriggerTime&&b-this.lastWheelTriggerTimer.size?-1:n.sizer.key?1:-1}}])}(),yC=function(){function e(){on(this,e),_e(this,"width",0),_e(this,"height",0),_e(this,"cellSize",0),_e(this,"columns",0),_e(this,"rows",0),_e(this,"cells",{})}return ln(e,[{key:"resizeAndClear",value:function(n,r){this.width=n.width,this.height=n.height,this.cellSize=r,this.columns=Math.ceil(n.width/r),this.rows=Math.ceil(n.height/r),this.cells={}}},{key:"getIndex",value:function(n){var r=Math.floor(n.x/this.cellSize),a=Math.floor(n.y/this.cellSize);return a*this.columns+r}},{key:"add",value:function(n,r,a){var i=new bC(n,r),l=this.getIndex(a),u=this.cells[l];u||(u=[],this.cells[l]=u),u.push(i)}},{key:"organize",value:function(){for(var n in this.cells){var r=this.cells[n];r.sort(bC.compare)}}},{key:"getLabelsToDisplay",value:function(n,r){var a=this.cellSize*this.cellSize,i=a/n/n,l=i*r/a,u=Math.ceil(l),c=[];for(var f in this.cells)for(var p=this.cells[f],g=0;g2&&arguments[2]!==void 0?arguments[2]:{};if(on(this,t),a=Bn(this,t),_e(a,"elements",{}),_e(a,"canvasContexts",{}),_e(a,"webGLContexts",{}),_e(a,"pickingLayers",new Set),_e(a,"textures",{}),_e(a,"frameBuffers",{}),_e(a,"activeListeners",{}),_e(a,"labelGrid",new yC),_e(a,"nodeDataCache",{}),_e(a,"edgeDataCache",{}),_e(a,"nodeProgramIndex",{}),_e(a,"edgeProgramIndex",{}),_e(a,"nodesWithForcedLabels",new Set),_e(a,"edgesWithForcedLabels",new Set),_e(a,"nodeExtent",{x:[0,1],y:[0,1]}),_e(a,"nodeZExtent",[1/0,-1/0]),_e(a,"edgeZExtent",[1/0,-1/0]),_e(a,"matrix",_r()),_e(a,"invMatrix",_r()),_e(a,"correctionRatio",1),_e(a,"customBBox",null),_e(a,"normalizationFunction",pC({x:[0,1],y:[0,1]})),_e(a,"graphToViewportRatio",1),_e(a,"itemIDsIndex",{}),_e(a,"nodeIndices",{}),_e(a,"edgeIndices",{}),_e(a,"width",0),_e(a,"height",0),_e(a,"pixelRatio",dC()),_e(a,"pickingDownSizingRatio",2*a.pixelRatio),_e(a,"displayedNodeLabels",new Set),_e(a,"displayedEdgeLabels",new Set),_e(a,"highlightedNodes",new Set),_e(a,"hoveredNode",null),_e(a,"hoveredEdge",null),_e(a,"renderFrame",null),_e(a,"renderHighlightedNodesFrame",null),_e(a,"needToProcess",!1),_e(a,"checkEdgesEventsFrame",null),_e(a,"nodePrograms",{}),_e(a,"nodeHoverPrograms",{}),_e(a,"edgePrograms",{}),a.settings=qX(i),Oh(a.settings),jX(n),!(r instanceof HTMLElement))throw new Error("Sigma: container should be an html element.");a.graph=n,a.container=r,a.createWebGLContext("edges",{picking:i.enableEdgeEvents}),a.createCanvasContext("edgeLabels"),a.createWebGLContext("nodes",{picking:!0}),a.createCanvasContext("labels"),a.createCanvasContext("hovers"),a.createWebGLContext("hoverNodes"),a.createCanvasContext("mouse",{style:{touchAction:"none",userSelect:"none"}}),a.resize();for(var l in a.settings.nodeProgramClasses)a.registerNodeProgram(l,a.settings.nodeProgramClasses[l],a.settings.nodeHoverProgramClasses[l]);for(var u in a.settings.edgeProgramClasses)a.registerEdgeProgram(u,a.settings.edgeProgramClasses[u]);return a.camera=new hC,a.bindCameraHandlers(),a.mouseCaptor=new XX(a.elements.mouse,a),a.mouseCaptor.setSettings(a.settings),a.touchCaptor=new JX(a.elements.mouse,a),a.touchCaptor.setSettings(a.settings),a.bindEventHandlers(),a.bindGraphHandlers(),a.handleSettingsUpdate(),a.refresh(),a}return Un(t,e),ln(t,[{key:"registerNodeProgram",value:function(r,a,i){return this.nodePrograms[r]&&this.nodePrograms[r].kill(),this.nodeHoverPrograms[r]&&this.nodeHoverPrograms[r].kill(),this.nodePrograms[r]=new a(this.webGLContexts.nodes,this.frameBuffers.nodes,this),this.nodeHoverPrograms[r]=new(i||a)(this.webGLContexts.hoverNodes,null,this),this}},{key:"registerEdgeProgram",value:function(r,a){return this.edgePrograms[r]&&this.edgePrograms[r].kill(),this.edgePrograms[r]=new a(this.webGLContexts.edges,this.frameBuffers.edges,this),this}},{key:"unregisterNodeProgram",value:function(r){if(this.nodePrograms[r]){var a=this.nodePrograms,i=a[r],l=Dh(a,[r].map(Ws));i.kill(),this.nodePrograms=l}if(this.nodeHoverPrograms[r]){var u=this.nodeHoverPrograms,c=u[r],f=Dh(u,[r].map(Ws));c.kill(),this.nodePrograms=f}return this}},{key:"unregisterEdgeProgram",value:function(r){if(this.edgePrograms[r]){var a=this.edgePrograms,i=a[r],l=Dh(a,[r].map(Ws));i.kill(),this.edgePrograms=l}return this}},{key:"resetWebGLTexture",value:function(r){var a=this.webGLContexts[r],i=this.frameBuffers[r],l=this.textures[r];l&&a.deleteTexture(l);var u=a.createTexture();return a.bindFramebuffer(a.FRAMEBUFFER,i),a.bindTexture(a.TEXTURE_2D,u),a.texImage2D(a.TEXTURE_2D,0,a.RGBA,this.width,this.height,0,a.RGBA,a.UNSIGNED_BYTE,null),a.framebufferTexture2D(a.FRAMEBUFFER,a.COLOR_ATTACHMENT0,a.TEXTURE_2D,u,0),this.textures[r]=u,this}},{key:"bindCameraHandlers",value:function(){var r=this;return this.activeListeners.camera=function(){r.scheduleRender()},this.camera.on("updated",this.activeListeners.camera),this}},{key:"unbindCameraHandlers",value:function(){return this.camera.removeListener("updated",this.activeListeners.camera),this}},{key:"getNodeAtPosition",value:function(r){var a=r.x,i=r.y,l=JR(this.webGLContexts.nodes,this.frameBuffers.nodes,a,i,this.pixelRatio,this.pickingDownSizingRatio),u=QR.apply(void 0,mC(l)),c=this.itemIDsIndex[u];return c&&c.type==="node"?c.id:null}},{key:"bindEventHandlers",value:function(){var r=this;this.activeListeners.handleResize=function(){r.scheduleRefresh()},window.addEventListener("resize",this.activeListeners.handleResize),this.activeListeners.handleMove=function(i){var l=Bs(i),u={event:l,preventSigmaDefault:function(){l.preventSigmaDefault()}},c=r.getNodeAtPosition(l);if(c&&r.hoveredNode!==c&&!r.nodeDataCache[c].hidden){r.hoveredNode&&r.emit("leaveNode",Be(Be({},u),{},{node:r.hoveredNode})),r.hoveredNode=c,r.emit("enterNode",Be(Be({},u),{},{node:c})),r.scheduleHighlightedNodesRender();return}if(r.hoveredNode&&r.getNodeAtPosition(l)!==r.hoveredNode){var f=r.hoveredNode;r.hoveredNode=null,r.emit("leaveNode",Be(Be({},u),{},{node:f})),r.scheduleHighlightedNodesRender();return}if(r.settings.enableEdgeEvents){var p=r.hoveredNode?null:r.getEdgeAtPoint(u.event.x,u.event.y);p!==r.hoveredEdge&&(r.hoveredEdge&&r.emit("leaveEdge",Be(Be({},u),{},{edge:r.hoveredEdge})),p&&r.emit("enterEdge",Be(Be({},u),{},{edge:p})),r.hoveredEdge=p)}},this.activeListeners.handleMoveBody=function(i){var l=Bs(i);r.emit("moveBody",{event:l,preventSigmaDefault:function(){l.preventSigmaDefault()}})},this.activeListeners.handleLeave=function(i){var l=Bs(i),u={event:l,preventSigmaDefault:function(){l.preventSigmaDefault()}};r.hoveredNode&&(r.emit("leaveNode",Be(Be({},u),{},{node:r.hoveredNode})),r.scheduleHighlightedNodesRender()),r.settings.enableEdgeEvents&&r.hoveredEdge&&(r.emit("leaveEdge",Be(Be({},u),{},{edge:r.hoveredEdge})),r.scheduleHighlightedNodesRender()),r.emit("leaveStage",Be({},u))},this.activeListeners.handleEnter=function(i){var l=Bs(i),u={event:l,preventSigmaDefault:function(){l.preventSigmaDefault()}};r.emit("enterStage",Be({},u))};var a=function(l){return function(u){var c=Bs(u),f={event:c,preventSigmaDefault:function(){c.preventSigmaDefault()}},p=r.getNodeAtPosition(c);if(p)return r.emit("".concat(l,"Node"),Be(Be({},f),{},{node:p}));if(r.settings.enableEdgeEvents){var g=r.getEdgeAtPoint(c.x,c.y);if(g)return r.emit("".concat(l,"Edge"),Be(Be({},f),{},{edge:g}))}return r.emit("".concat(l,"Stage"),f)}};return this.activeListeners.handleClick=a("click"),this.activeListeners.handleRightClick=a("rightClick"),this.activeListeners.handleDoubleClick=a("doubleClick"),this.activeListeners.handleWheel=a("wheel"),this.activeListeners.handleDown=a("down"),this.activeListeners.handleUp=a("up"),this.mouseCaptor.on("mousemove",this.activeListeners.handleMove),this.mouseCaptor.on("mousemovebody",this.activeListeners.handleMoveBody),this.mouseCaptor.on("click",this.activeListeners.handleClick),this.mouseCaptor.on("rightClick",this.activeListeners.handleRightClick),this.mouseCaptor.on("doubleClick",this.activeListeners.handleDoubleClick),this.mouseCaptor.on("wheel",this.activeListeners.handleWheel),this.mouseCaptor.on("mousedown",this.activeListeners.handleDown),this.mouseCaptor.on("mouseup",this.activeListeners.handleUp),this.mouseCaptor.on("mouseleave",this.activeListeners.handleLeave),this.mouseCaptor.on("mouseenter",this.activeListeners.handleEnter),this.touchCaptor.on("touchdown",this.activeListeners.handleDown),this.touchCaptor.on("touchdown",this.activeListeners.handleMove),this.touchCaptor.on("touchup",this.activeListeners.handleUp),this.touchCaptor.on("touchmove",this.activeListeners.handleMove),this.touchCaptor.on("tap",this.activeListeners.handleClick),this.touchCaptor.on("doubletap",this.activeListeners.handleDoubleClick),this.touchCaptor.on("touchmove",this.activeListeners.handleMoveBody),this}},{key:"bindGraphHandlers",value:function(){var r=this,a=this.graph,i=new Set(["x","y","zIndex","type"]);return this.activeListeners.eachNodeAttributesUpdatedGraphUpdate=function(l){var u,c=(u=l.hints)===null||u===void 0?void 0:u.attributes;r.graph.forEachNode(function(p){return r.updateNode(p)});var f=!c||c.some(function(p){return i.has(p)});r.refresh({partialGraph:{nodes:a.nodes()},skipIndexation:!f,schedule:!0})},this.activeListeners.eachEdgeAttributesUpdatedGraphUpdate=function(l){var u,c=(u=l.hints)===null||u===void 0?void 0:u.attributes;r.graph.forEachEdge(function(p){return r.updateEdge(p)});var f=c&&["zIndex","type"].some(function(p){return c==null?void 0:c.includes(p)});r.refresh({partialGraph:{edges:a.edges()},skipIndexation:!f,schedule:!0})},this.activeListeners.addNodeGraphUpdate=function(l){var u=l.key;r.addNode(u),r.refresh({partialGraph:{nodes:[u]},skipIndexation:!1,schedule:!0})},this.activeListeners.updateNodeGraphUpdate=function(l){var u=l.key;r.refresh({partialGraph:{nodes:[u]},skipIndexation:!1,schedule:!0})},this.activeListeners.dropNodeGraphUpdate=function(l){var u=l.key;r.removeNode(u),r.refresh({schedule:!0})},this.activeListeners.addEdgeGraphUpdate=function(l){var u=l.key;r.addEdge(u),r.refresh({partialGraph:{edges:[u]},schedule:!0})},this.activeListeners.updateEdgeGraphUpdate=function(l){var u=l.key;r.refresh({partialGraph:{edges:[u]},skipIndexation:!1,schedule:!0})},this.activeListeners.dropEdgeGraphUpdate=function(l){var u=l.key;r.removeEdge(u),r.refresh({schedule:!0})},this.activeListeners.clearEdgesGraphUpdate=function(){r.clearEdgeState(),r.clearEdgeIndices(),r.refresh({schedule:!0})},this.activeListeners.clearGraphUpdate=function(){r.clearEdgeState(),r.clearNodeState(),r.clearEdgeIndices(),r.clearNodeIndices(),r.refresh({schedule:!0})},a.on("nodeAdded",this.activeListeners.addNodeGraphUpdate),a.on("nodeDropped",this.activeListeners.dropNodeGraphUpdate),a.on("nodeAttributesUpdated",this.activeListeners.updateNodeGraphUpdate),a.on("eachNodeAttributesUpdated",this.activeListeners.eachNodeAttributesUpdatedGraphUpdate),a.on("edgeAdded",this.activeListeners.addEdgeGraphUpdate),a.on("edgeDropped",this.activeListeners.dropEdgeGraphUpdate),a.on("edgeAttributesUpdated",this.activeListeners.updateEdgeGraphUpdate),a.on("eachEdgeAttributesUpdated",this.activeListeners.eachEdgeAttributesUpdatedGraphUpdate),a.on("edgesCleared",this.activeListeners.clearEdgesGraphUpdate),a.on("cleared",this.activeListeners.clearGraphUpdate),this}},{key:"unbindGraphHandlers",value:function(){var r=this.graph;r.removeListener("nodeAdded",this.activeListeners.addNodeGraphUpdate),r.removeListener("nodeDropped",this.activeListeners.dropNodeGraphUpdate),r.removeListener("nodeAttributesUpdated",this.activeListeners.updateNodeGraphUpdate),r.removeListener("eachNodeAttributesUpdated",this.activeListeners.eachNodeAttributesUpdatedGraphUpdate),r.removeListener("edgeAdded",this.activeListeners.addEdgeGraphUpdate),r.removeListener("edgeDropped",this.activeListeners.dropEdgeGraphUpdate),r.removeListener("edgeAttributesUpdated",this.activeListeners.updateEdgeGraphUpdate),r.removeListener("eachEdgeAttributesUpdated",this.activeListeners.eachEdgeAttributesUpdatedGraphUpdate),r.removeListener("edgesCleared",this.activeListeners.clearEdgesGraphUpdate),r.removeListener("cleared",this.activeListeners.clearGraphUpdate)}},{key:"getEdgeAtPoint",value:function(r,a){var i=JR(this.webGLContexts.edges,this.frameBuffers.edges,r,a,this.pixelRatio,this.pickingDownSizingRatio),l=QR.apply(void 0,mC(i)),u=this.itemIDsIndex[l];return u&&u.type==="edge"?u.id:null}},{key:"process",value:function(){var r=this;this.emit("beforeProcess");var a=this.graph,i=this.settings,l=this.getDimensions();if(this.nodeExtent=UX(this.graph),!this.settings.autoRescale){var u=l.width,c=l.height,f=this.nodeExtent,p=f.x,g=f.y;this.nodeExtent={x:[(p[0]+p[1])/2-u/2,(p[0]+p[1])/2+u/2],y:[(g[0]+g[1])/2-c/2,(g[0]+g[1])/2+c/2]}}this.normalizationFunction=pC(this.customBBox||this.nodeExtent);var b=new hC,m=Ps(b.getState(),l,this.getGraphDimensions(),this.getStagePadding());this.labelGrid.resizeAndClear(l,i.labelGridCellSize);for(var S={},v={},A={},R={},x=1,_=a.nodes(),C=0,N=_.length;C1&&arguments[1]!==void 0?arguments[1]:{},i=a.tolerance,l=i===void 0?0:i,u=a.boundaries,c=Be({},r),f=u||this.nodeExtent,p=vl(f.x,2),g=p[0],b=p[1],m=vl(f.y,2),S=m[0],v=m[1],A=[this.graphToViewport({x:g,y:S},{cameraState:r}),this.graphToViewport({x:b,y:S},{cameraState:r}),this.graphToViewport({x:g,y:v},{cameraState:r}),this.graphToViewport({x:b,y:v},{cameraState:r})],R=1/0,x=-1/0,_=1/0,C=-1/0;A.forEach(function(W){var Z=W.x,j=W.y;R=Math.min(R,Z),x=Math.max(x,Z),_=Math.min(_,j),C=Math.max(C,j)});var N=x-R,T=C-_,O=this.getDimensions(),z=O.width,I=O.height,M=0,H=0;if(N>=z?xl&&(M=R-l):x>z+l?M=x-(z+l):R<-l&&(M=R+l),T>=I?Cl&&(H=_-l):C>I+l?H=C-(I+l):_<-l&&(H=_+l),M||H){var q=this.viewportToFramedGraph({x:0,y:0},{cameraState:r}),U=this.viewportToFramedGraph({x:M,y:H},{cameraState:r});M=U.x-q.x,H=U.y-q.y,c.x+=M,c.y+=H}return c}},{key:"renderLabels",value:function(){if(!this.settings.renderLabels)return this;var r=this.camera.getState(),a=this.labelGrid.getLabelsToDisplay(r.ratio,this.settings.labelDensity);gC(a,this.nodesWithForcedLabels),this.displayedNodeLabels=new Set;for(var i=this.canvasContexts.labels,l=0,u=a.length;lthis.width+oZ||b<-50||b>this.height+iZ)){this.displayedNodeLabels.add(c);var S=this.settings.defaultDrawNodeLabel,v=this.nodePrograms[f.type],A=(v==null?void 0:v.drawLabel)||S;A(i,Be(Be({key:c},f),{},{size:m,x:g,y:b}),this.settings)}}}return this}},{key:"renderEdgeLabels",value:function(){if(!this.settings.renderEdgeLabels)return this;var r=this.canvasContexts.edgeLabels;r.clearRect(0,0,this.width,this.height);var a=aZ({graph:this.graph,hoveredNode:this.hoveredNode,displayedNodeLabels:this.displayedNodeLabels,highlightedNodes:this.highlightedNodes});gC(a,this.edgesWithForcedLabels);for(var i=new Set,l=0,u=a.length;lthis.nodeZExtent[1]&&(this.nodeZExtent[1]=i.zIndex))}},{key:"updateNode",value:function(r){this.addNode(r);var a=this.nodeDataCache[r];this.normalizationFunction.applyTo(a)}},{key:"removeNode",value:function(r){delete this.nodeDataCache[r],delete this.nodeProgramIndex[r],this.highlightedNodes.delete(r),this.hoveredNode===r&&(this.hoveredNode=null),this.nodesWithForcedLabels.delete(r)}},{key:"addEdge",value:function(r){var a=Object.assign({},this.graph.getEdgeAttributes(r));this.settings.edgeReducer&&(a=this.settings.edgeReducer(r,a));var i=sZ(this.settings,r,a);this.edgeDataCache[r]=i,this.edgesWithForcedLabels.delete(r),i.forceLabel&&!i.hidden&&this.edgesWithForcedLabels.add(r),this.settings.zIndex&&(i.zIndex