@cyber-harbour/ui 2.2.9-beta.0 → 2.2.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/PdfDriver-BYZATCUO.mjs +2 -0
- package/dist/PdfDriver-BYZATCUO.mjs.map +1 -0
- package/dist/PdfDriver-X7QLKZSJ.js +2 -0
- package/dist/PdfDriver-X7QLKZSJ.js.map +1 -0
- package/dist/{chunk-K5OEK7KJ.mjs → chunk-QGB7ELQG.mjs} +230 -230
- package/dist/chunk-QGB7ELQG.mjs.map +1 -0
- package/dist/{chunk-VNCKTJME.js → chunk-XZLHJGFA.js} +126 -126
- package/dist/chunk-XZLHJGFA.js.map +1 -0
- package/dist/index.css +1 -1
- package/dist/index.css.map +1 -1
- package/dist/index.js +41 -41
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +33 -33
- package/dist/index.mjs.map +1 -1
- package/dist/styles/tailwind.css +1 -1
- package/dist/styles/tailwind.css.map +1 -1
- package/package.json +1 -1
- package/dist/PdfDriver-FBZLULAL.js +0 -2
- package/dist/PdfDriver-FBZLULAL.js.map +0 -1
- package/dist/PdfDriver-ZDVOQI63.mjs +0 -2
- package/dist/PdfDriver-ZDVOQI63.mjs.map +0 -1
- package/dist/chunk-K5OEK7KJ.mjs.map +0 -1
- package/dist/chunk-VNCKTJME.js.map +0 -1
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {a,w,x,u,c,l,z,Pa
|
|
1
|
+
import {a,w,x,u,c,l,z,Pa as Pa$1,Ya,ma,ra,pb,Cb,y,kb,G,ib,H,lb}from'./chunk-QGB7ELQG.mjs';export{tb as Alert,A as AlertIcon,za as AndroidIcon,B as ApiIcon,C as ArrowCircleTopRightIcon,D as ArrowRightIcon,ia as BallsMenu,pb as Box,q as BreakpointProvider,E as BugReportIcon,Na as BurgerMenuIcon,sa as BusIcon,z as Button,F as CalendarIcon,ta as CarIcon,Kb as ChatField,ja as CheckIcon,vb as Checkbox,ka as ChevronDownIcon,G as ChevronLeftIcon,H as ChevronRightIcon,la as ChevronUpIcon,Oa as ClockIcon,I as CloseCircleIcon,J as ClosedLockIcon,Db as ContentLoader,fb as ContextMenu,gb as ContextMenuDelimiter,qa as CrossIcon,K as DataSetsIcon,L as DeepSearchIcon,M as DisabledVisibleIcon,N as DocsIcon,O as DownloadIcon,yb as Drawer,Ab as DrawerBody,zb as DrawerHeader,P as EditUserIcon,rb as EmptyData,Q as EnableVisibleIcon,R as EnterArrowLeftIcon,Ra as FaceSearchIcon,mb as FileField,xa as FileIcon,S as FiltersIcon,Ia as FlashIcon,nb as FlexContainer,ob as FlexItem,Ba as FolderAlertIcon,Ja as FolderInfoIcon,ab as Header,bb as HeaderDelimeter,cb as HeaderSection,T as HomepageIcon,Qa as ImageIcon,oa as InfoCircleFilledIcon,U as InfoCircleIcon,kb as Input,ya as IosIcon,ub as Label,qb as Line,wb as LinerProgress,Za as ListMenu,_a as ListMenuItem,$a as ListMenuSection,V as MapRadarIcon,ra as MaximizeIcon,Sa as MessageAsteriskIcon,Aa as MicrosoftIcon,Pa as MinusIcon,Fb as Modal,Hb as ModalBody,Ib as ModalFooter,Gb as ModalHeader,W as MoonIcon,X as OpenLockIcon,Y as OrganizationIcon,Eb as Overlay,eb as Pagination,Ea as PassportIcon,Z as PasswordFinderIcon,Ga as PencilIcon,_ as PhonebookIcon,va as PlaneIcon,ma as PlusIcon,Fa as PointIcon,$ as PrintIcon,aa as Profiler2Icon,ba as ProfilerIcon,Lb as ProgressLoader,Ca as RelationIcon,Da as RelationPointsIcon,Ka as RotateLeftIcon,La as RotateRightIcon,jb as RowActionsMenu,ca as SandBoxIcon,da as SearchIcon,ib as Select,wa as ShipIcon,Ua as Sidebar,Ta as SidebarContext,Wa as SidebarDelimeter,Va as SidebarItem,Xa as SidebarSection,ea as StatisticIcon,Cb as StyledTooltipContent,fa as SunIcon,xb as Switch,db as Table,sb as Tag,Jb as TailwindExample,s as ThemeProvider,Bb as Tooltip,Ya as Typography,pa as UnfoldIcon,ga as UpRightArrowCircleIcon,Ma as UploadImageIcon,Ha as UserInCircleIcon,na as UsersIcon,ha as VectorIcon,ua as WayIcon,f as convertPaletteToRem,w as createComponent,x as createStyledComponent,p as darkTheme,o as darkThemePx,t as destructSpaceProps,u as generatePropertySpaceStyle,k as getBreakpoint,h as getButtonSizeStyles,g as getButtonStyles,i as getInputStyles,v as getResponsiveProps,j as getTypographyStyles,l as hexToRgba,n as lightTheme,m as lightThemePx,e as propToRem,c as pxToRem,d as remToPx,b as resolveThemeColor,r as useBreakpoint,hb as useContextMenuControl,y as useTheme}from'./chunk-QGB7ELQG.mjs';import xo,{styled,useTheme,keyframes,css as css$1}from'styled-components';export{ServerStyleSheet,StyleSheetManager}from'styled-components';import {jsx,jsxs}from'react/jsx-runtime';import {useState,useRef,useCallback,useEffect,Fragment,forwardRef,useMemo,useImperativeHandle,useLayoutEffect,memo}from'react';import No from'lodash.clonedeep';import {scaleOrdinal,schemeCategory10,forceSimulation,forceLink,forceManyBody,forceX,forceY,forceCenter,forceCollide}from'd3';import wo from'react-content-loader';import {renderAsync}from'docx-preview';import tn from'lodash.throttle';import nn from'@uiw/react-codemirror';import {vscodeDark,vscodeLight}from'@uiw/codemirror-theme-vscode';import {javascript}from'@codemirror/lang-javascript';import {json}from'@codemirror/lang-json';import {html}from'@codemirror/lang-html';import {css}from'@codemirror/lang-css';import {python}from'@codemirror/lang-python';import {java}from'@codemirror/lang-java';import {cpp}from'@codemirror/lang-cpp';import {php}from'@codemirror/lang-php';import {rust}from'@codemirror/lang-rust';import {xml}from'@codemirror/lang-xml';import {yaml}from'@codemirror/lang-yaml';import {markdown}from'@codemirror/lang-markdown';import {sql}from'@codemirror/lang-sql';import mn from'react-markdown';import bn from'remark-gfm';import {TableVirtuoso}from'react-virtuoso';import Bt from'papaparse';import oa from'copy-to-clipboard';import {Popover}from'react-tiny-popover';import {parse,isValid,getYear,format,getMonth,startOfWeek,startOfMonth,endOfMonth,getDay,previousSunday,nextSaturday,differenceInDays}from'date-fns';import {createPortal}from'react-dom';var Ks=a(({children:r,className:o})=>jsx(oo,{className:o,children:r}),"PageLayout"),oo=styled.div`
|
|
2
2
|
display: grid;
|
|
3
3
|
min-height: 100dvh;
|
|
4
4
|
position: relative;
|
|
@@ -9,11 +9,11 @@ import {a,w,x,u,c,l,z,Pa,Ya,ma as ma$1,ra,pb,Cb,y,kb,G,ib,H,lb}from'./chunk-K5OE
|
|
|
9
9
|
& > header {
|
|
10
10
|
grid-area: header;
|
|
11
11
|
}
|
|
12
|
-
`;var
|
|
12
|
+
`;var rc=a(({children:r,className:o})=>jsx(io,{className:o,children:r}),"PageContent"),io=styled.main`
|
|
13
13
|
grid-area: content;
|
|
14
14
|
min-width: 0;
|
|
15
15
|
background: ${({theme:r})=>r.colors.backgroundBase};
|
|
16
|
-
`;var
|
|
16
|
+
`;var sc=a(({children:r,className:o,top:n=0})=>jsx(lo,{className:o,$top:n,onClick:a=>a.stopPropagation(),children:r}),"SubNav"),lo=styled.div(({theme:r,$top:o})=>`
|
|
17
17
|
display: flex;
|
|
18
18
|
flex-direction: column;
|
|
19
19
|
justify-content: space-between;
|
|
@@ -33,27 +33,27 @@ import {a,w,x,u,c,l,z,Pa,Ya,ma as ma$1,ra,pb,Cb,y,kb,G,ib,H,lb}from'./chunk-K5OE
|
|
|
33
33
|
position: sticky;
|
|
34
34
|
border-right: 1px solid ${r.colors.stroke.light};
|
|
35
35
|
}
|
|
36
|
-
`);var
|
|
36
|
+
`);var vc=w(({maxWidth:r,...o})=>jsx(ho,{...o,$maxWidth:r})),ho=x(styled.div(({theme:r,$maxWidth:o,px:n=20})=>`
|
|
37
37
|
${u(r,"padding-inline",n)}
|
|
38
38
|
width: 100%;
|
|
39
39
|
min-width: 0;
|
|
40
40
|
max-width: ${typeof o=="number"?c(o,r.baseSize):o||"100%"};
|
|
41
|
-
`),{ignoreStyles:["padding-inline"]});var vo=20,yo="splitter_columns_widths",
|
|
41
|
+
`),{ignoreStyles:["padding-inline"]});var vo=20,yo="splitter_columns_widths",ur=a((r,o,n)=>{let a=localStorage.getItem(r);if(a)try{let d=JSON.parse(a);if(Array.isArray(d)&&d.length===o)return d}catch{}else if(n.length===o)return n;return Array(o).fill(100/o)},"getSavedWidths"),Dc=a(({columns:r,initialWidths:o,layoutClassname:n="",splitterClassname:a="",minWidth:d=vo,storageKey:s=yo})=>{let[h,x]=useState(()=>ur(s,r.length,o)),k=useRef(null),N=useRef(null),M=useRef(d),f=useRef(h),L=useCallback(F=>{if(N.current===null||!k.current)return;let P=k.current.getBoundingClientRect(),T=P.width,$=F-P.left,Y=[...f.current],ne=N.current,re=ne+1,se=Y.slice(0,ne).reduce((we,ve)=>we+ve,0),ye=$/T*100-se,le=Y[ne]+Y[re]-ye;ye>=M.current&&le>=M.current&&(Y[ne]=ye,Y[re]=le,x(Y),f.current=Y);},[]),B=useCallback(F=>L(F.clientX),[L]),t=useCallback(F=>{F.preventDefault(),L(F.touches[0].clientX);},[L]),I=useCallback(()=>{N.current=null,localStorage.setItem(s,JSON.stringify(f.current)),document.removeEventListener("mousemove",B),document.removeEventListener("mouseup",I),document.removeEventListener("touchmove",t),document.removeEventListener("touchend",I);},[B,t,s]),S=useCallback(F=>P=>{P.preventDefault(),N.current=F,document.addEventListener("mousemove",B,{passive:false}),document.addEventListener("mouseup",I);},[B,I]),p=useCallback(F=>P=>{P.preventDefault(),N.current=F,document.addEventListener("touchmove",t,{passive:false}),document.addEventListener("touchend",I);},[t,I]);return useEffect(()=>{let F=ur(s,r.length,o);f.current=F,x(F);},[r.length,o,s]),jsx("div",{ref:k,className:`flex select-none ${n}`,children:r.map(({content:F,className:P},T)=>jsxs(Fragment,{children:[jsx("div",{className:P,style:{flex:`${h[T]} 1 0%`},children:F}),T<r.length-1&&jsx("div",{onMouseDown:S(T),onTouchStart:p(T),className:`hidden lg:flex! lg:sticky lg:top-0 border-s border-gray-200 dark:border-neutral-700 ${a}`,children:jsx("span",{className:"absolute top-1/2 start-1/2 -translate-x-1/2 -translate-y-1/2 block w-5 h-8 flex justify-center items-center bg-white dark:bg-neutral-800 border border-gray-200 dark:border-neutral-700 text-gray-400 dark:text-neutral-500 rounded-md cursor-col-resize hover:bg-gray-100 dark:hover:bg-neutral-700",children:jsxs("svg",{className:"shrink-0 size-5",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",children:[jsx("circle",{cx:"9",cy:"12",r:"1"}),jsx("circle",{cx:"9",cy:"5",r:"1"}),jsx("circle",{cx:"9",cy:"19",r:"1"}),jsx("circle",{cx:"15",cy:"12",r:"1"}),jsx("circle",{cx:"15",cy:"5",r:"1"}),jsx("circle",{cx:"15",cy:"19",r:"1"})]})})})]},`${T}`))})},"SplitterLayout");var So=xo.div`
|
|
42
42
|
width: 100%;
|
|
43
43
|
height: 100%;
|
|
44
44
|
display: flex;
|
|
45
45
|
align-items: center;
|
|
46
46
|
justify-content: center;
|
|
47
|
-
`,Do=a(({width:r=280,height:o=280})=>{let n=useTheme();return jsx(So,{children:jsxs(wo,{foregroundColor:n.contentLoader.foreground,backgroundColor:n.contentLoader.background,width:r,height:o,viewBox:"0 0 280 280",children:[jsx("path",{d:"m55 38-0.97266 0.22852 7.0801 30.092-18.355-20.979-0.75195 0.6582 19.596 22.395 0.43164 1.834 0.97266-0.22852 0.75195-0.6582-0.37695-0.42969 9.625-27.912-0.94531-0.32617-9.4375 27.371-0.10547-0.12109zm8 34-0.78516 0.61914 0.0957 0.12305-12.311 13.258 0.73242 0.67969 12.205-13.145 14.277 18.084 0.78516-0.61914-14.373-18.207 0.10547-0.11328zm15 19-0.48438 0.875 46.992 25.996 8e-3 4e-3 20.506 11.592-28.182 4.5449 0.15998 0.98819 29.418-4.7441 0.25 0.14062-12.555 24.143 0.88672 0.46094 13-25 15 25 26 30v18l-11 18 0.85352 0.52148 9.8008-16.039-4.6543 33.518 0.99023 0.13867 4.7793-34.408 7.2305 16.27 0.91406-0.40625-7.9141-17.807v-17.104l18 12.316 0.56445-0.82617-18.896-12.928-25.855-29.836-14.633-24.387 0.01562-0.02344h23.805v-1h-23.152l13.848-21.234 55.201-28.791-0.45898-0.88476 0.77734 0.62305 11.402-14.25 16.668-11.842-0.58008-0.81641-16.785 11.928-11.486 14.355-55.434 28.912-14.277 21.893-7.7617-27.166-0.96094 0.27344 7.7227 27.031-1.1191 0.17969-21.604-12.211zm140.43-12.912-6.957-17.338-0.92773 0.37305 6.957 17.338zm-6.957-17.338 0.72266 0.69336 16.232-16.896-0.7207-0.69336zm-3.4766 137.25 5 15 0.94922-0.31641-5-15zm-91-63-0.48047-0.87695-31 17 0.48047 0.87695zm-31 17 5 18 0.96289-0.26758-5-18zm0 0-0.70703-0.70703-12.898 12.898-17.881 9.9336 0.48633 0.875 18-10zm5 18-0.64062-0.76758-18 15 0.64062 0.76758z"}),jsx("circle",{cx:"229.92",cy:"63.7318",r:"5",transform:"rotate(173.661 229.92 63.7318)"}),jsx("circle",{cx:"227.711",cy:"43.8541",r:"5",transform:"rotate(173.661 227.711 43.8541)"}),jsx("circle",{cx:"211.478",cy:"60.7499",r:"5",transform:"rotate(173.661 211.478 60.7499)"}),jsx("circle",{cx:"218.434",cy:"78.0877",r:"5",transform:"rotate(173.661 218.434 78.0877)"}),jsx("circle",{cx:"246.705",cy:"51.8054",r:"5",transform:"rotate(173.661 246.705 51.8054)"}),jsx("circle",{cx:"42",cy:"48",r:"5"}),jsx("circle",{cx:"55",cy:"38",r:"5"}),jsx("circle",{cx:"73",cy:"43",r:"5"}),jsx("circle",{cx:"63",cy:"72",r:"5"}),jsx("circle",{cx:"50",cy:"86",r:"5"}),jsx("circle",{cx:"78",cy:"91",r:"5"}),jsx("circle",{cx:"73",cy:"165",r:"5"}),jsx("circle",{cx:"73",cy:"185",r:"5"}),jsx("circle",{cx:"91",cy:"170",r:"5"}),jsx("circle",{cx:"86",cy:"152",r:"5"}),jsx("circle",{cx:"148",cy:"130",r:"5"}),jsx("circle",{cx:"189",cy:"185",r:"5"}),jsx("circle",{cx:"163",cy:"107",r:"5"}),jsx("circle",{cx:"140",cy:"102",r:"5"}),jsx("circle",{cx:"117",cy:"135",r:"5"}),jsx("circle",{cx:"125",cy:"117",r:"5"}),jsx("circle",{cx:"208",cy:"198",r:"5"}),jsx("circle",{cx:"189",cy:"203",r:"5"}),jsx("circle",{cx:"198",cy:"221",r:"5"}),jsx("circle",{cx:"178",cy:"221",r:"5"}),jsx("circle",{cx:"184",cy:"239",r:"5"}),jsx("circle",{cx:"213",cy:"213",r:"5"}),jsx("circle",{cx:"173",cy:"130",r:"5"}),jsx("circle",{cx:"163",cy:"155",r:"5"}),jsx("circle",{cx:"135",cy:"155",r:"5"}),jsx("circle",{cx:"55",cy:"175",r:"5"})]})})},"GraphLoader"),pr=Do;var ft=typeof window<"u"&&window.devicePixelRatio||1;function Ho(r){return !r||r.length===0?[]:r.map(o=>{let n=new Image;n.src=o.img;let a=new Image;return a.src=o.hoverImg,{...o,normalImg:n,hoverImg:a}})}a(Ho,"prepareButtonImages");var te={fontSize:3,nodeSizeBase:30,nodeAreaFactor:2,textPaddingFactor:.9,gridSpacing:20,dotSize:1,maxZoom:4},Wo=forwardRef(({loading:r,width:o,height:n,graphData:a$1,buttons:d=[],onNodeClick:i,onBackgroundClick:h,onNodeHover:x,onLinkHover:k,onLinkClick:R},P)=>{let m=useTheme(),[E,A]=useState(true),t=useRef({transform:{x:0,y:0,k:1},isPanning:false,hoveredNode:null,hoveredLink:null,draggedNode:null,selectedNode:null,hoveredButtonIndex:null,highlightNodes:new Set,highlightLinks:new Set,lastMousePos:{x:0,y:0},mustBeStoppedPropagation:false,mouseStartPos:null,isDragging:false,width:o*ft,height:n*ft,animation:{id:null,buttonIndex:null},spinnerAngle:0}),{nodes:F,links:S}=useMemo(()=>Ro(a$1),[a$1]),[p,B]=useState([]),M=useRef(null),T=useRef(null),$=useRef(null),Y=scaleOrdinal(schemeCategory10),ne=useCallback(()=>{if(!M.current)return false;try{let e=M.current.getContext("2d");return e?($.current=e,!0):(console.error("Failed to get 2D context"),!1)}catch(e){return console.error("Error initializing Canvas 2D context:",e),false}},[]),re=useCallback(()=>T.current?T.current.nodes():null,[]),se=useCallback(()=>{if(!T.current)return null;let e=T.current.force("link");return e?e.links():null},[]),ye=useCallback(e=>{e.save(),e.setTransform(1,0,0,1,0,0);let{width:l,height:c}=t.current,u=te.gridSpacing,f=te.dotSize;e.fillStyle=m.graph2D.grid.dotColor;for(let w=u/2;w<=l;w+=u)for(let g=u/2;g<=c;g+=u)e.beginPath(),e.arc(w,g,f,0,2*Math.PI),e.fill();e.restore();},[m.graph2D.grid.dotColor,te.gridSpacing,te.dotSize]),le=useCallback((e,l,c)=>{if(!e)return "";if(c.measureText(e).width<=l)return e;let f=e,w="...";for(;c.measureText(f+w).width>l&&f.length>0;)f=f.slice(0,-1);return f+w},[]),we=a(e=>{let c=Math.min(e,te.maxZoom)/te.maxZoom;return Math.max(te.fontSize*c,te.fontSize)},"calculateFontSize"),ve=useCallback(e=>{let l=se(),c=re();!l||l.length===0||!c||c.length===0||(e.lineWidth=.5,e.globalAlpha=1,l.forEach(u=>{let f=typeof u.source=="object"?u.source:c.find(We=>We.id===u.source),w=typeof u.target=="object"?u.target:c.find(We=>We.id===u.target);if(!f||!w)return;let g={x:f.x||0,y:f.y||0},b={x:w.x||0,y:w.y||0},D=b.x-g.x,N=b.y-g.y,z=Math.sqrt(D*D+N*N),y=D/z,C=N/z,_=te.nodeSizeBase/2,I=te.nodeSizeBase/2,j=4,v={x:g.x+y*_,y:g.y+C*_},O={x:b.x-y*(I+j),y:b.y-C*(I+j)},L={x:b.x-y*(I+1),y:b.y-C*(I+1)},G=t.current.highlightLinks.has(u),K=G?m.graph2D.link.highlighted:m.graph2D.link.normal,ee=G?1.5:.5,ge=g.x+(b.x-g.x)/2,pe=g.y+(b.y-g.y)/2,he=Math.atan2(N,D);if(u.label){let We=t.current.transform.k,Ze=we(We);e.font=`${Ze}px Sans-Serif`;let Zt=e.measureText(u.label).width,Vt=10;e.beginPath(),e.moveTo(v.x,v.y);let Gt=z/2-(Zt+Vt)/2,Kt={x:g.x+y*Gt,y:g.y+C*Gt};e.lineTo(Kt.x,Kt.y),e.strokeStyle=K,e.lineWidth=ee,e.stroke(),e.beginPath();let Jt=z/2+(Zt+Vt)/2,Qt={x:g.x+y*Jt,y:g.y+C*Jt};e.moveTo(Qt.x,Qt.y),e.lineTo(O.x,O.y),e.strokeStyle=K,e.lineWidth=ee,e.stroke();}else e.beginPath(),e.moveTo(v.x,v.y),e.lineTo(O.x,O.y),e.strokeStyle=K,e.lineWidth=ee,e.stroke();let He=2;if(e.save(),e.translate(L.x,L.y),e.rotate(he),e.beginPath(),e.moveTo(0,0),e.lineTo(-j,He),e.lineTo(-j,0),e.lineTo(-j,-He),e.closePath(),e.fillStyle=K,e.fill(),e.restore(),u.label){let We=t.current.transform.k,Ze=we(We);e.font=`${Ze}px Sans-Serif`,e.textAlign="center",e.textBaseline="middle",e.save(),e.translate(ge,pe),Math.abs(he)>Math.PI/2?e.rotate(he+Math.PI):e.rotate(he),e.fillStyle=G?m.graph2D.link.highlightedTextColor:m.graph2D.link.textColor,e.fillText(u.label,0,0),e.restore();}}));},[te,m.graph2D.link]),q=a((e,l,c,u,f,w,g)=>{try{if(w!=null){let b=f*.8;e.font=`${b}px sans-serif`,e.textBaseline="middle",e.textAlign="left";let D=new Intl.NumberFormat("en",{notation:"compact",maximumFractionDigits:1,minimumFractionDigits:0,compactDisplay:"short"}).format(w),N=e.measureText(D).width,z=f*.3,C=(f+z+N)/2;e.drawImage(l,c-C,u-f/2,f,f),e.fillStyle=g||"#99989C",e.fillText(D,c-C+f+z,u);}else e.drawImage(l,c-f/2,u-f/2,f,f);}catch(b){console.warn("Error rendering icon:",b);}},"drawIconWithOptionalCounter"),H=useCallback((e,l$1)=>{if(!p||p.length===0||!e||!e.x||!e.y)return;let{x:c,y:u}=e,f=te.nodeSizeBase*te.nodeAreaFactor/2;l$1.save();let w=Math.min(p.length,8),g=Math.min(Math.PI*2/w,Math.PI);for(let b=0;b<w;b++){let D=b*g,N=(b+1)*g,z=t.current.hoveredButtonIndex===b;l$1.beginPath(),l$1.arc(c,u,f,D,N,false),l$1.lineTo(c,u),l$1.closePath(),l$1.lineWidth=1,l$1.strokeStyle=m.graph2D?.button?.stroke||"#FFFFFF",l$1.stroke(),l$1.fillStyle=z?m.graph2D?.button?.hoverFill||"rgba(255, 255, 255, 0.3)":m.graph2D?.button?.normalFill||"rgba(255, 255, 255, 0.1)",l$1.fill();let y=f*.2,C=(D+N)/2,_=f-te.nodeSizeBase/2+y,I=c+Math.cos(C)*_,j=u+Math.sin(C)*_,v=p[b];if(v.loading){let O=y/2,L=y/12;l$1.save(),l$1.translate(I,j),l$1.rotate(t.current.spinnerAngle);for(let G=0;G<12;G++){let K=Math.PI*2*G/12,ee=G/12,ge=Math.cos(K)*O,pe=Math.sin(K)*O;l$1.beginPath(),l$1.fillStyle=l(m.graph2D?.button?.spinnerColor,ee),l$1.arc(ge,pe,L,0,Math.PI*2),l$1.fill();}l$1.restore(),t.current.spinnerAngle+=.1,t.current.spinnerAngle>Math.PI*2&&(t.current.spinnerAngle-=Math.PI*2),t.current.animation.id!==null&&(cancelAnimationFrame(t.current.animation.id),t.current.animation.id=null,t.current.animation.buttonIndex=null),t.current.animation.id=requestAnimationFrame(W),t.current.animation.buttonIndex=b;}else {t.current.animation.id&&t.current.animation.buttonIndex===b&&(cancelAnimationFrame(t.current.animation.id),t.current.animation.id=null,t.current.animation.buttonIndex=null);let O=z?v.hoverImg:v.normalImg,L=v.getCount?v.getCount(e):null;O.complete?q(l$1,O,I,j,y,L,m.graph2D?.button?.textColor):O.onload=()=>{$.current&&q(l$1,O,I,j,y,L,m.graph2D?.button?.textColor);};}}l$1.restore();},[p,m.graph2D?.button]),V=useCallback(e=>{let l=re();!l||l.length===0||(e.globalAlpha=1,l.forEach(c=>{let{x:u,y:f,color:w,fontColor:g,label:b}=c,D=t.current.highlightNodes.has(c)||c===t.current.hoveredNode||c===t.current.draggedNode,N=c===t.current.selectedNode,z=te.nodeSizeBase,y=te.nodeSizeBase/2;if(D&&!N){let C=te.nodeSizeBase*te.nodeAreaFactor*.75/2;e.beginPath(),e.arc(u,f,C,0,2*Math.PI,false),e.fillStyle=m.graph2D.ring.highlightFill,e.fill();}if(N)if(d&&d.length>0)H(c,e);else {let C=te.nodeSizeBase*te.nodeAreaFactor/2;e.beginPath(),e.arc(u,f,C,0,2*Math.PI,false),e.fillStyle=m.graph2D.ring.selectionFill||m.graph2D.ring.highlightFill,e.fill();}if(e.beginPath(),e.arc(u,f,y,0,2*Math.PI),e.fillStyle=w||Y(c.group||"0"),e.fill(),b){e.save(),e.translate(u,f);let C=t.current.transform.k,_=we(C),I=z*te.textPaddingFactor;e.font=`${_}px Sans-Serif`,e.textAlign="center",e.textBaseline="middle",e.fillStyle=g||"#000";let j=le(b,I,e);e.fillText(j,0,0),e.restore();}}));},[m.graph2D.ring,d,H]),W=useCallback(()=>{let e=$.current;e&&(e.clearRect(0,0,t.current.width,t.current.height),ye(e),e.save(),e.setTransform(t.current.transform.k,0,0,t.current.transform.k,t.current.transform.x,t.current.transform.y),ve(e),V(e),e.restore());},[ve,V,ye]),Z=useCallback((e,l=[],c)=>{let u=se()||[],f=re()||[];if(!T.current||!e.length)return;let{width:w,height:g}=t.current,b=c?.smoothAppearance??false,D=c?.transitionDuration??1e3,N=new Set(f.map(v=>v.id)),z=e.filter(v=>!N.has(v.id)),y=new Set(u.map(v=>`${typeof v.source=="object"?v.source.id:v.source}-${typeof v.target=="object"?v.target.id:v.target}`)),C=l.filter(v=>{let O=`${typeof v.source=="object"?v.source.id:v.source}-${typeof v.target=="object"?v.target.id:v.target}`;return !y.has(O)});if(z.length===0&&C.length===0)return;let _=[...f,...z],I=[...u,...C];b&&(z.forEach(v=>{let O=C.filter(L=>{let G=typeof L.source=="object"?L.source.id:L.source,K=typeof L.target=="object"?L.target.id:L.target;return G===v.id&&N.has(K)||K===v.id&&N.has(G)});if(O.length>0){let L=O[0],G=typeof L.source=="object"?L.source.id===v.id?L.target:L.source.id:L.source===v.id?L.target:L.source,K=_.find(ee=>ee.id===G);if(K&&K.x!==void 0&&K.y!==void 0){let ee=30+Math.random()*20,ge=Math.random()*Math.PI*2;v.x=K.x+Math.cos(ge)*ee,v.y=K.y+Math.sin(ge)*ee,v.vx=0,v.vy=0;}}else {let L=w/2,G=g/2,K=Math.min(w,g)/4,ee=Math.random()*Math.PI*2;v.x=L+Math.cos(ee)*(K*Math.random()),v.y=G+Math.sin(ee)*(K*Math.random()),v.vx=0,v.vy=0;}}),f.forEach(v=>{v.fx=v.x,v.fy=v.y;})),T.current.nodes(_);let j=T.current.force("link");j&&j.links(I),C.forEach(v=>{let O=typeof v.source=="object"?v.source:_.find(G=>G.id===v.source),L=typeof v.target=="object"?v.target:_.find(G=>G.id===v.target);!O||!L||(!O.neighbors&&(O.neighbors=[]),!L.neighbors&&(L.neighbors=[]),O.neighbors.push(L),L.neighbors.push(O),!O.links&&(O.links=[]),!L.links&&(L.links=[]),O.links.push(v),L.links.push(v));}),b?(T.current.alphaTarget(.3),T.current.alpha(.3),T.current.velocityDecay(.7),T.current.restart(),setTimeout(()=>{f.forEach(v=>{v.fx=void 0,v.fy=void 0;}),T.current?.alphaTarget(0),T.current?.alpha(.1),T.current?.velocityDecay(.6);},D)):T.current.alpha(.1).restart(),W();},[F,W]),oe=useCallback(e=>{let l=re(),c=se();if(!T.current||!e.length||!l||l.length===0||!c||c.length===0)return;let u=new Set(e);if(t.current.selectedNode&&t.current.selectedNode.id!==void 0&&u.has(t.current.selectedNode.id)&&(t.current.selectedNode=null),t.current.hoveredNode&&t.current.hoveredNode.id!==void 0&&u.has(t.current.hoveredNode.id)&&(t.current.hoveredNode=null,t.current.highlightNodes=new Set,t.current.highlightLinks=new Set),t.current.hoveredLink){let b=typeof t.current.hoveredLink.source=="object"?t.current.hoveredLink.source.id:t.current.hoveredLink.source,D=typeof t.current.hoveredLink.target=="object"?t.current.hoveredLink.target.id:t.current.hoveredLink.target;(b!==void 0&&u.has(b)||D!==void 0&&u.has(D))&&(t.current.hoveredLink=null,t.current.highlightNodes=new Set,t.current.highlightLinks=new Set);}t.current.draggedNode&&t.current.draggedNode.id!==void 0&&u.has(t.current.draggedNode.id)&&(t.current.draggedNode=null);let f=l.filter(b=>b.id!==void 0&&!u.has(b.id)),w=c.filter(b=>{let D=typeof b.source=="object"?b.source.id:b.source,N=typeof b.target=="object"?b.target.id:b.target;return D!==void 0&&!u.has(D)&&N!==void 0&&!u.has(N)});f.forEach(b=>{b.neighbors=[],b.links=[];}),w.forEach(b=>{let D=typeof b.source=="object"?b.source:f.find(z=>z.id===b.source),N=typeof b.target=="object"?b.target:f.find(z=>z.id===b.target);!D||!N||(D.neighbors=D.neighbors||[],N.neighbors=N.neighbors||[],D.neighbors.push(N),N.neighbors.push(D),D.links=D.links||[],N.links=N.links||[],D.links.push(b),N.links.push(b));}),T.current.nodes(f);let g=T.current.force("link");g&&g.links(w),W();},[W]),ae=useCallback((e=0,l=20)=>{let c=re();if(!$.current||!M.current||!c||!c.length)return;let f=1/0,w=1/0,g=-1/0,b=-1/0;if(c.forEach(D=>{if(D.x===void 0||D.y===void 0)return;let N=D.x,z=D.y;f=Math.min(f,N),w=Math.min(w,z),g=Math.max(g,N),b=Math.max(b,z);}),isFinite(f)&&isFinite(g)&&isFinite(w)&&isFinite(b)){let{width:D,height:N}=t.current;f-=l,w-=l,g+=l,b+=l;let z=g-f,y=b-w,C=z>0?D/z:1,_=y>0?N/y:1,I=Math.min(C,_,10),j=f+z/2,v=w+y/2,O={k:I,x:D/2-j*I,y:N/2-v*I};if(e>0){let L={...t.current.transform},G=Date.now(),K=a(()=>{let ee=Math.min(1,(Date.now()-G)/e),ge=ee===1?1:1-Math.pow(1-ee,3),pe={k:L.k+(O.k-L.k)*ge,x:L.x+(O.x-L.x)*ge,y:L.y+(O.y-L.y)*ge};t.current.transform=pe,W(),ee<1&&requestAnimationFrame(K);},"animateZoom");requestAnimationFrame(K);}else t.current.transform=O,W();}},[]),X=useCallback((e,l)=>{let c=re();if(!c||c.length===0)return null;let u=te.nodeSizeBase/2,f=typeof window<"u"&&window.devicePixelRatio||1,w=(e*f-t.current.transform.x)/t.current.transform.k,g=(l*f-t.current.transform.y)/t.current.transform.k;return c.find(b=>{let D=(b.x||0)-w,N=(b.y||0)-g;return Math.sqrt(D*D+N*N)<=u})||null},[]),Q=useCallback((e,l)=>{let c=se(),u=re();if(!c||c.length===0||!u||u.length===0)return null;let f=typeof window<"u"&&window.devicePixelRatio||1,w=(e*f-t.current.transform.x)/t.current.transform.k,g=(l*f-t.current.transform.y)/t.current.transform.k,b=5;return c.find(D=>{let N=typeof D.source=="object"?D.source:u.find(Ze=>Ze.id===D.source),z=typeof D.target=="object"?D.target:u.find(Ze=>Ze.id===D.target);if(!N||!z)return false;let y=N.x||0,C=N.y||0,_=z.x||0,I=z.y||0,j=w-y,v=g-C,O=_-y,L=I-C,G=j*O+v*L,K=O*O+L*L;if(K===0)return false;let ee=G/K;ee=Math.max(0,Math.min(1,ee));let ge=y+ee*O,pe=C+ee*L,he=w-ge,He=g-pe;return Math.sqrt(he*he+He*He)<=b})||null},[]),de=useCallback((e,l,c,u,f,w,g)=>{let b=e-c,D=l-u,N=Math.sqrt(b*b+D*D),z=Math.atan2(D,b);z<0&&(z+=2*Math.PI);let _=N>=f*.5&&N<=f*1,I=false;return w===Math.PI&&g===Math.PI*2?I=z>=Math.PI&&z<=Math.PI*2:w===0&&g===Math.PI?I=z>=0&&z<=Math.PI:I=w<=g&&z>=w&&z<=g||w>g&&(z>=w||z<=g),_&&I},[]),ce=useCallback(e=>{if(e===t.current.hoveredNode)return;let l=new Set,c=new Set;e&&(l.add(e),e.neighbors&&e.neighbors.forEach(u=>l.add(u)),e.links&&e.links.forEach(u=>c.add(u))),t.current.hoveredNode=e,x&&x(e),t.current.highlightNodes=l,t.current.highlightLinks=c;},[x]),ue=useCallback(e=>{if(e===t.current.hoveredLink)return;let l=new Set,c=new Set;if(e){c.add(e);let u=re();if(u){let f=typeof e.source=="object"?e.source:u.find(g=>g.id===e.source),w=typeof e.target=="object"?e.target:u.find(g=>g.id===e.target);f&&l.add(f),w&&l.add(w);}}t.current.hoveredLink=e,k&&k(e),t.current.highlightNodes=l,t.current.highlightLinks=c;},[k,re]),Se=useCallback(e=>{R&&R(e);},[R]),_e=useCallback(e=>{t.current.selectedNode=e,i&&i(e);},[i]),qe=useCallback(()=>{t.current.selectedNode=null,h&&h();},[h]),Ne=useCallback(e=>{if(!M.current||!T.current)return;let l=M.current.getBoundingClientRect(),c=e.clientX-l.left,u=e.clientY-l.top;t.current.mouseStartPos={x:c,y:u},t.current.isDragging=false;let f=X(c,u);f?(t.current.draggedNode=f,f.fx=f.x,f.fy=f.y):(t.current.isPanning=true,t.current.lastMousePos={x:c,y:u});},[X]),Be=useCallback((e,l)=>{let c=null;if(M.current&&t.current&&p.length>0){let u=te.nodeSizeBase*te.nodeAreaFactor/2,f=M.current.getBoundingClientRect(),w=M.current.width/f.width,g=M.current.height/f.height,b=e*w,D=l*g,N=(b-t.current.transform.x)/t.current.transform.k,z=(D-t.current.transform.y)/t.current.transform.k,y=t.current.selectedNode?.x||0,C=t.current.selectedNode?.y||0,_=Math.min(p.length,8),I=Math.min(Math.PI*2/_,Math.PI);for(let j=0;j<_;j++){let v=j*I,O=(j+1)*I;if(de(N,z,y,C,u,v,O)){c=j;break}}}return c},[p]),Ce=useCallback(e=>{if(!M.current)return;let l=M.current.getBoundingClientRect(),c=e.clientX-l.left,u=e.clientY-l.top;if(t.current.draggedNode&&t.current.mouseStartPos&&T.current){let g=t.current.mouseStartPos.x,b=t.current.mouseStartPos.y,D=c-g,N=u-b;Math.sqrt(D*D+N*N)>3&&(t.current.isDragging=true,T.current.alphaTarget()===0&&T.current.alphaTarget(0).restart());let C=typeof window<"u"&&window.devicePixelRatio||1,_=(c*C-t.current.transform.x)/t.current.transform.k,I=(u*C-t.current.transform.y)/t.current.transform.k;t.current.draggedNode.fx=_,t.current.draggedNode.fy=I;return}if(t.current.isPanning&&t.current.mouseStartPos){let g=c-t.current.lastMousePos.x,b=u-t.current.lastMousePos.y,D=t.current.mouseStartPos.x,N=t.current.mouseStartPos.y;Math.sqrt(Math.pow(c-D,2)+Math.pow(u-N,2))>3&&(t.current.isDragging=true),t.current.transform={...t.current.transform,x:t.current.transform.x+g,y:t.current.transform.y+b},t.current.lastMousePos={x:c,y:u},W();return}let f,w;if(t.current.selectedNode&&M.current&&p.length>0){let g=Be(c,u);g!==null&&(w=t.current.selectedNode),g!==t.current.hoveredButtonIndex&&(f=true),t.current.hoveredButtonIndex=g;}else t.current.hoveredButtonIndex!==null&&(t.current.hoveredButtonIndex=null);if(!w&&(w=X(c,u),!w)){let g=Q(c,u),b=g!==t.current.hoveredLink;if(g&&t.current.hoveredNode&&ce(null),ue(g),M.current&&(M.current.style.cursor=g?"pointer":"default"),b){W();return}}w&&t.current.hoveredLink&&ue(null),w!==t.current.hoveredNode&&(f=true),ce(w),M.current&&(M.current.style.cursor=w?"pointer":"default"),f&&W();},[p,X,Q,ce,ue,W,de,Be]),Pe=useCallback(e=>{t.current.mustBeStoppedPropagation&&(e.stopPropagation(),e.preventDefault()),t.current.mustBeStoppedPropagation=false;},[]),Re=useCallback(e=>{let l=t.current.isDragging;if(l&&(t.current.mustBeStoppedPropagation=true),!l&&t.current.mouseStartPos){let c=M.current?.getBoundingClientRect();if(c){let u=e.clientX-c.left,f=e.clientY-c.top;p.length>0&&t.current.hoveredButtonIndex===null&&(t.current.hoveredButtonIndex=Be(u,f));let w=false;if(t.current.selectedNode&&t.current.hoveredButtonIndex!==null&&d[t.current.hoveredButtonIndex]){let g=d[t.current.hoveredButtonIndex];g&&g.onClick&&(g.onClick(t.current.selectedNode),w=true,t.current.hoveredButtonIndex=null);}if(!w&&t.current.draggedNode)_e(t.current.draggedNode);else if(!w&&!t.current.draggedNode){let g=Q(u,f);g?Se(g):qe();}}}if(t.current.draggedNode&&T.current){if(l){T.current.alphaTarget(0);let c=.05,u=.04,f=.6;T.current.alpha(c).alphaDecay(u),T.current.velocityDecay(f);}else T.current.alphaTarget(0);t.current.draggedNode.fx=void 0,t.current.draggedNode.fy=void 0,t.current.draggedNode=null;}t.current.isDragging=false,t.current.mouseStartPos=null,t.current.isPanning&&(t.current.isPanning=false),W();},[d,W,_e,qe,Q,Se,Be,p]),Ue=useCallback(e=>{if(e.stopPropagation(),e.preventDefault(),!M.current)return;let l=M.current.getBoundingClientRect(),c=e.clientX-l.left,u=e.clientY-l.top,w=-e.deltaY>0?1.1:1/1.1,g=t.current.transform,b=g.k*w;if(b<.01||b>10)return;let D=g.k*w,N=c-(c-g.x)*w,z=u-(u-g.y)*w;t.current.transform={k:D,x:N,y:z},W();},[W]),Fe=a((e,l)=>{let c=e.touches[0];if(c){let u={clientX:c.clientX,clientY:c.clientY};l(u);}},"convertTouchToMouseEvent"),et=useCallback(e=>{Fe(e,Ne);},[Ne]),Oe=useCallback(e=>{t.current.mustBeStoppedPropagation&&(e.preventDefault(),e.stopPropagation()),t.current.mustBeStoppedPropagation=false,Fe(e,Re);},[Re]),Lt=useCallback(e=>{Fe(e,Ce);},[Ce]);return useImperativeHandle(P,()=>({zoomToFit:ae,addNodes:Z,removeNodes:oe}),[ae,Z,oe]),useEffect(()=>{let e=M.current,{width:l,height:c}=t.current;if(!e)return;ne(),A(true);let u=l/2,f=c/2,w=te.nodeSizeBase,g=w/2,b=w*2.5;T.current&&T.current.stop();let D=T.current=forceSimulation(F).force("link",forceLink(S).id(N=>N.id).distance(b).strength(.9)).force("charge",forceManyBody().strength(-w/10*200).theta(.5).distanceMin(w*2)).force("x",forceX().strength(.03)).force("y",forceY().strength(.03)).force("center",forceCenter(u,f).strength(.05)).force("collide",forceCollide().radius(g*2).iterations(2).strength(1)).velocityDecay(.6);return ()=>{D.stop();}},[F,S]),useLayoutEffect(()=>{let e=M.current;e&&(t.current.width=o*ft,t.current.height=n*ft,e.width=t.current.width,e.height=t.current.height);},[o,n]),useEffect(()=>{if(T.current){let e=T.current;e.on("tick",()=>{W();}),e.on("end",()=>{E&&(ae(0,20),setTimeout(()=>{A(false);},200));});}E||W();},[F,S,E,W,ae]),useEffect(()=>{!F||!S||S.forEach(e=>{let l=typeof e.source=="object"?e.source:F.find(u=>u.id===e.source),c=typeof e.target=="object"?e.target:F.find(u=>u.id===e.target);!l||!c||(!l.neighbors&&(l.neighbors=[]),!c.neighbors&&(c.neighbors=[]),l.neighbors.push(c),c.neighbors.push(l),!l.links&&(l.links=[]),!c.links&&(c.links=[]),l.links.push(e),c.links.push(e));});},[F,S]),useEffect(()=>{d&&d.length>0&&B(Ho(d));},[d]),useEffect(()=>{let e=M.current;if(!(!e||typeof window>"u"))return e.addEventListener("wheel",Ue,{passive:false}),e.addEventListener("touchend",Oe,{passive:false}),()=>{e.removeEventListener("wheel",Ue),e.removeEventListener("touchend",Oe);}},[Ue,Oe]),jsxs($o,{children:[(r||E)&&jsx(pr,{width:o,height:n}),jsx(Xo,{ref:M,style:{width:o,height:n,display:r||E?"none":"block"},onMouseDown:Ne,onMouseMove:Ce,onMouseUp:Re,onMouseLeave:Re,onClick:Pe,onTouchStart:et,onTouchMove:Lt})]})}),$o=styled.div`
|
|
47
|
+
`,Do=a(({width:r=280,height:o=280})=>{let n=useTheme();return jsx(So,{children:jsxs(wo,{foregroundColor:n.contentLoader.foreground,backgroundColor:n.contentLoader.background,width:r,height:o,viewBox:"0 0 280 280",children:[jsx("path",{d:"m55 38-0.97266 0.22852 7.0801 30.092-18.355-20.979-0.75195 0.6582 19.596 22.395 0.43164 1.834 0.97266-0.22852 0.75195-0.6582-0.37695-0.42969 9.625-27.912-0.94531-0.32617-9.4375 27.371-0.10547-0.12109zm8 34-0.78516 0.61914 0.0957 0.12305-12.311 13.258 0.73242 0.67969 12.205-13.145 14.277 18.084 0.78516-0.61914-14.373-18.207 0.10547-0.11328zm15 19-0.48438 0.875 46.992 25.996 8e-3 4e-3 20.506 11.592-28.182 4.5449 0.15998 0.98819 29.418-4.7441 0.25 0.14062-12.555 24.143 0.88672 0.46094 13-25 15 25 26 30v18l-11 18 0.85352 0.52148 9.8008-16.039-4.6543 33.518 0.99023 0.13867 4.7793-34.408 7.2305 16.27 0.91406-0.40625-7.9141-17.807v-17.104l18 12.316 0.56445-0.82617-18.896-12.928-25.855-29.836-14.633-24.387 0.01562-0.02344h23.805v-1h-23.152l13.848-21.234 55.201-28.791-0.45898-0.88476 0.77734 0.62305 11.402-14.25 16.668-11.842-0.58008-0.81641-16.785 11.928-11.486 14.355-55.434 28.912-14.277 21.893-7.7617-27.166-0.96094 0.27344 7.7227 27.031-1.1191 0.17969-21.604-12.211zm140.43-12.912-6.957-17.338-0.92773 0.37305 6.957 17.338zm-6.957-17.338 0.72266 0.69336 16.232-16.896-0.7207-0.69336zm-3.4766 137.25 5 15 0.94922-0.31641-5-15zm-91-63-0.48047-0.87695-31 17 0.48047 0.87695zm-31 17 5 18 0.96289-0.26758-5-18zm0 0-0.70703-0.70703-12.898 12.898-17.881 9.9336 0.48633 0.875 18-10zm5 18-0.64062-0.76758-18 15 0.64062 0.76758z"}),jsx("circle",{cx:"229.92",cy:"63.7318",r:"5",transform:"rotate(173.661 229.92 63.7318)"}),jsx("circle",{cx:"227.711",cy:"43.8541",r:"5",transform:"rotate(173.661 227.711 43.8541)"}),jsx("circle",{cx:"211.478",cy:"60.7499",r:"5",transform:"rotate(173.661 211.478 60.7499)"}),jsx("circle",{cx:"218.434",cy:"78.0877",r:"5",transform:"rotate(173.661 218.434 78.0877)"}),jsx("circle",{cx:"246.705",cy:"51.8054",r:"5",transform:"rotate(173.661 246.705 51.8054)"}),jsx("circle",{cx:"42",cy:"48",r:"5"}),jsx("circle",{cx:"55",cy:"38",r:"5"}),jsx("circle",{cx:"73",cy:"43",r:"5"}),jsx("circle",{cx:"63",cy:"72",r:"5"}),jsx("circle",{cx:"50",cy:"86",r:"5"}),jsx("circle",{cx:"78",cy:"91",r:"5"}),jsx("circle",{cx:"73",cy:"165",r:"5"}),jsx("circle",{cx:"73",cy:"185",r:"5"}),jsx("circle",{cx:"91",cy:"170",r:"5"}),jsx("circle",{cx:"86",cy:"152",r:"5"}),jsx("circle",{cx:"148",cy:"130",r:"5"}),jsx("circle",{cx:"189",cy:"185",r:"5"}),jsx("circle",{cx:"163",cy:"107",r:"5"}),jsx("circle",{cx:"140",cy:"102",r:"5"}),jsx("circle",{cx:"117",cy:"135",r:"5"}),jsx("circle",{cx:"125",cy:"117",r:"5"}),jsx("circle",{cx:"208",cy:"198",r:"5"}),jsx("circle",{cx:"189",cy:"203",r:"5"}),jsx("circle",{cx:"198",cy:"221",r:"5"}),jsx("circle",{cx:"178",cy:"221",r:"5"}),jsx("circle",{cx:"184",cy:"239",r:"5"}),jsx("circle",{cx:"213",cy:"213",r:"5"}),jsx("circle",{cx:"173",cy:"130",r:"5"}),jsx("circle",{cx:"163",cy:"155",r:"5"}),jsx("circle",{cx:"135",cy:"155",r:"5"}),jsx("circle",{cx:"55",cy:"175",r:"5"})]})})},"GraphLoader"),hr=Do;var ft=typeof window<"u"&&window.devicePixelRatio||1;function Ho(r){return !r||r.length===0?[]:r.map(o=>{let n=new Image;n.src=o.img;let a=new Image;return a.src=o.hoverImg,{...o,normalImg:n,hoverImg:a}})}a(Ho,"prepareButtonImages");var te={fontSize:3,nodeSizeBase:30,nodeAreaFactor:2,textPaddingFactor:.9,gridSpacing:20,dotSize:1,maxZoom:4},Wo=forwardRef(({loading:r,width:o,height:n,graphData:a$1,buttons:d=[],onNodeClick:s,onBackgroundClick:h,onNodeHover:x,onLinkHover:k,onLinkClick:N},M)=>{let f=useTheme(),[L,B]=useState(true),t=useRef({transform:{x:0,y:0,k:1},isPanning:false,hoveredNode:null,hoveredLink:null,draggedNode:null,selectedNode:null,hoveredButtonIndex:null,highlightNodes:new Set,highlightLinks:new Set,lastMousePos:{x:0,y:0},mustBeStoppedPropagation:false,mouseStartPos:null,isDragging:false,width:o*ft,height:n*ft,animation:{id:null,buttonIndex:null},spinnerAngle:0}),{nodes:I,links:S}=useMemo(()=>No(a$1),[a$1]),[p,F]=useState([]),P=useRef(null),T=useRef(null),$=useRef(null),Y=scaleOrdinal(schemeCategory10),ne=useCallback(()=>{if(!P.current)return false;try{let e=P.current.getContext("2d");return e?($.current=e,!0):(console.error("Failed to get 2D context"),!1)}catch(e){return console.error("Error initializing Canvas 2D context:",e),false}},[]),re=useCallback(()=>T.current?T.current.nodes():null,[]),se=useCallback(()=>{if(!T.current)return null;let e=T.current.force("link");return e?e.links():null},[]),ye=useCallback(e=>{e.save(),e.setTransform(1,0,0,1,0,0);let{width:l,height:c}=t.current,u=te.gridSpacing,g=te.dotSize;e.fillStyle=f.graph2D.grid.dotColor;for(let w=u/2;w<=l;w+=u)for(let m=u/2;m<=c;m+=u)e.beginPath(),e.arc(w,m,g,0,2*Math.PI),e.fill();e.restore();},[f.graph2D.grid.dotColor,te.gridSpacing,te.dotSize]),le=useCallback((e,l,c)=>{if(!e)return "";if(c.measureText(e).width<=l)return e;let g=e,w="...";for(;c.measureText(g+w).width>l&&g.length>0;)g=g.slice(0,-1);return g+w},[]),we=a(e=>{let c=Math.min(e,te.maxZoom)/te.maxZoom;return Math.max(te.fontSize*c,te.fontSize)},"calculateFontSize"),ve=useCallback(e=>{let l=se(),c=re();!l||l.length===0||!c||c.length===0||(e.lineWidth=.5,e.globalAlpha=1,l.forEach(u=>{let g=typeof u.source=="object"?u.source:c.find(We=>We.id===u.source),w=typeof u.target=="object"?u.target:c.find(We=>We.id===u.target);if(!g||!w)return;let m={x:g.x||0,y:g.y||0},b={x:w.x||0,y:w.y||0},D=b.x-m.x,E=b.y-m.y,_=Math.sqrt(D*D+E*E),y=D/_,C=E/_,A=te.nodeSizeBase/2,z=te.nodeSizeBase/2,j=4,v={x:m.x+y*A,y:m.y+C*A},O={x:b.x-y*(z+j),y:b.y-C*(z+j)},R={x:b.x-y*(z+1),y:b.y-C*(z+1)},G=t.current.highlightLinks.has(u),K=G?f.graph2D.link.highlighted:f.graph2D.link.normal,ee=G?1.5:.5,me=m.x+(b.x-m.x)/2,pe=m.y+(b.y-m.y)/2,he=Math.atan2(E,D);if(u.label){let We=t.current.transform.k,Ze=we(We);e.font=`${Ze}px Sans-Serif`;let Vt=e.measureText(u.label).width,Gt=10;e.beginPath(),e.moveTo(v.x,v.y);let Kt=_/2-(Vt+Gt)/2,Jt={x:m.x+y*Kt,y:m.y+C*Kt};e.lineTo(Jt.x,Jt.y),e.strokeStyle=K,e.lineWidth=ee,e.stroke(),e.beginPath();let Qt=_/2+(Vt+Gt)/2,er={x:m.x+y*Qt,y:m.y+C*Qt};e.moveTo(er.x,er.y),e.lineTo(O.x,O.y),e.strokeStyle=K,e.lineWidth=ee,e.stroke();}else e.beginPath(),e.moveTo(v.x,v.y),e.lineTo(O.x,O.y),e.strokeStyle=K,e.lineWidth=ee,e.stroke();let He=2;if(e.save(),e.translate(R.x,R.y),e.rotate(he),e.beginPath(),e.moveTo(0,0),e.lineTo(-j,He),e.lineTo(-j,0),e.lineTo(-j,-He),e.closePath(),e.fillStyle=K,e.fill(),e.restore(),u.label){let We=t.current.transform.k,Ze=we(We);e.font=`${Ze}px Sans-Serif`,e.textAlign="center",e.textBaseline="middle",e.save(),e.translate(me,pe),Math.abs(he)>Math.PI/2?e.rotate(he+Math.PI):e.rotate(he),e.fillStyle=G?f.graph2D.link.highlightedTextColor:f.graph2D.link.textColor,e.fillText(u.label,0,0),e.restore();}}));},[te,f.graph2D.link]),q=a((e,l,c,u,g,w,m)=>{try{if(w!=null){let b=g*.8;e.font=`${b}px sans-serif`,e.textBaseline="middle",e.textAlign="left";let D=new Intl.NumberFormat("en",{notation:"compact",maximumFractionDigits:1,minimumFractionDigits:0,compactDisplay:"short"}).format(w),E=e.measureText(D).width,_=g*.3,C=(g+_+E)/2;e.drawImage(l,c-C,u-g/2,g,g),e.fillStyle=m||"#99989C",e.fillText(D,c-C+g+_,u);}else e.drawImage(l,c-g/2,u-g/2,g,g);}catch(b){console.warn("Error rendering icon:",b);}},"drawIconWithOptionalCounter"),H=useCallback((e,l$1)=>{if(!p||p.length===0||!e||!e.x||!e.y)return;let{x:c,y:u}=e,g=te.nodeSizeBase*te.nodeAreaFactor/2;l$1.save();let w=Math.min(p.length,8),m=Math.min(Math.PI*2/w,Math.PI);for(let b=0;b<w;b++){let D=b*m,E=(b+1)*m,_=t.current.hoveredButtonIndex===b;l$1.beginPath(),l$1.arc(c,u,g,D,E,false),l$1.lineTo(c,u),l$1.closePath(),l$1.lineWidth=1,l$1.strokeStyle=f.graph2D?.button?.stroke||"#FFFFFF",l$1.stroke(),l$1.fillStyle=_?f.graph2D?.button?.hoverFill||"rgba(255, 255, 255, 0.3)":f.graph2D?.button?.normalFill||"rgba(255, 255, 255, 0.1)",l$1.fill();let y=g*.2,C=(D+E)/2,A=g-te.nodeSizeBase/2+y,z=c+Math.cos(C)*A,j=u+Math.sin(C)*A,v=p[b];if(v.loading){let O=y/2,R=y/12;l$1.save(),l$1.translate(z,j),l$1.rotate(t.current.spinnerAngle);for(let G=0;G<12;G++){let K=Math.PI*2*G/12,ee=G/12,me=Math.cos(K)*O,pe=Math.sin(K)*O;l$1.beginPath(),l$1.fillStyle=l(f.graph2D?.button?.spinnerColor,ee),l$1.arc(me,pe,R,0,Math.PI*2),l$1.fill();}l$1.restore(),t.current.spinnerAngle+=.1,t.current.spinnerAngle>Math.PI*2&&(t.current.spinnerAngle-=Math.PI*2),t.current.animation.id!==null&&(cancelAnimationFrame(t.current.animation.id),t.current.animation.id=null,t.current.animation.buttonIndex=null),t.current.animation.id=requestAnimationFrame(W),t.current.animation.buttonIndex=b;}else {t.current.animation.id&&t.current.animation.buttonIndex===b&&(cancelAnimationFrame(t.current.animation.id),t.current.animation.id=null,t.current.animation.buttonIndex=null);let O=_?v.hoverImg:v.normalImg,R=v.getCount?v.getCount(e):null;O.complete?q(l$1,O,z,j,y,R,f.graph2D?.button?.textColor):O.onload=()=>{$.current&&q(l$1,O,z,j,y,R,f.graph2D?.button?.textColor);};}}l$1.restore();},[p,f.graph2D?.button]),V=useCallback(e=>{let l=re();!l||l.length===0||(e.globalAlpha=1,l.forEach(c=>{let{x:u,y:g,color:w,fontColor:m,label:b}=c,D=t.current.highlightNodes.has(c)||c===t.current.hoveredNode||c===t.current.draggedNode,E=c===t.current.selectedNode,_=te.nodeSizeBase,y=te.nodeSizeBase/2;if(D&&!E){let C=te.nodeSizeBase*te.nodeAreaFactor*.75/2;e.beginPath(),e.arc(u,g,C,0,2*Math.PI,false),e.fillStyle=f.graph2D.ring.highlightFill,e.fill();}if(E)if(d&&d.length>0)H(c,e);else {let C=te.nodeSizeBase*te.nodeAreaFactor/2;e.beginPath(),e.arc(u,g,C,0,2*Math.PI,false),e.fillStyle=f.graph2D.ring.selectionFill||f.graph2D.ring.highlightFill,e.fill();}if(e.beginPath(),e.arc(u,g,y,0,2*Math.PI),e.fillStyle=w||Y(c.group||"0"),e.fill(),b){e.save(),e.translate(u,g);let C=t.current.transform.k,A=we(C),z=_*te.textPaddingFactor;e.font=`${A}px Sans-Serif`,e.textAlign="center",e.textBaseline="middle",e.fillStyle=m||"#000";let j=le(b,z,e);e.fillText(j,0,0),e.restore();}}));},[f.graph2D.ring,d,H]),W=useCallback(()=>{let e=$.current;e&&(e.clearRect(0,0,t.current.width,t.current.height),ye(e),e.save(),e.setTransform(t.current.transform.k,0,0,t.current.transform.k,t.current.transform.x,t.current.transform.y),ve(e),V(e),e.restore());},[ve,V,ye]),Z=useCallback((e,l=[],c)=>{let u=se()||[],g=re()||[];if(!T.current||!e.length)return;let{width:w,height:m}=t.current,b=c?.smoothAppearance??false,D=c?.transitionDuration??1e3,E=new Set(g.map(v=>v.id)),_=e.filter(v=>!E.has(v.id)),y=new Set(u.map(v=>`${typeof v.source=="object"?v.source.id:v.source}-${typeof v.target=="object"?v.target.id:v.target}`)),C=l.filter(v=>{let O=`${typeof v.source=="object"?v.source.id:v.source}-${typeof v.target=="object"?v.target.id:v.target}`;return !y.has(O)});if(_.length===0&&C.length===0)return;let A=[...g,..._],z=[...u,...C];b&&(_.forEach(v=>{let O=C.filter(R=>{let G=typeof R.source=="object"?R.source.id:R.source,K=typeof R.target=="object"?R.target.id:R.target;return G===v.id&&E.has(K)||K===v.id&&E.has(G)});if(O.length>0){let R=O[0],G=typeof R.source=="object"?R.source.id===v.id?R.target:R.source.id:R.source===v.id?R.target:R.source,K=A.find(ee=>ee.id===G);if(K&&K.x!==void 0&&K.y!==void 0){let ee=30+Math.random()*20,me=Math.random()*Math.PI*2;v.x=K.x+Math.cos(me)*ee,v.y=K.y+Math.sin(me)*ee,v.vx=0,v.vy=0;}}else {let R=w/2,G=m/2,K=Math.min(w,m)/4,ee=Math.random()*Math.PI*2;v.x=R+Math.cos(ee)*(K*Math.random()),v.y=G+Math.sin(ee)*(K*Math.random()),v.vx=0,v.vy=0;}}),g.forEach(v=>{v.fx=v.x,v.fy=v.y;})),T.current.nodes(A);let j=T.current.force("link");j&&j.links(z),C.forEach(v=>{let O=typeof v.source=="object"?v.source:A.find(G=>G.id===v.source),R=typeof v.target=="object"?v.target:A.find(G=>G.id===v.target);!O||!R||(!O.neighbors&&(O.neighbors=[]),!R.neighbors&&(R.neighbors=[]),O.neighbors.push(R),R.neighbors.push(O),!O.links&&(O.links=[]),!R.links&&(R.links=[]),O.links.push(v),R.links.push(v));}),b?(T.current.alphaTarget(.3),T.current.alpha(.3),T.current.velocityDecay(.7),T.current.restart(),setTimeout(()=>{g.forEach(v=>{v.fx=void 0,v.fy=void 0;}),T.current?.alphaTarget(0),T.current?.alpha(.1),T.current?.velocityDecay(.6);},D)):T.current.alpha(.1).restart(),W();},[I,W]),oe=useCallback(e=>{let l=re(),c=se();if(!T.current||!e.length||!l||l.length===0||!c||c.length===0)return;let u=new Set(e);if(t.current.selectedNode&&t.current.selectedNode.id!==void 0&&u.has(t.current.selectedNode.id)&&(t.current.selectedNode=null),t.current.hoveredNode&&t.current.hoveredNode.id!==void 0&&u.has(t.current.hoveredNode.id)&&(t.current.hoveredNode=null,t.current.highlightNodes=new Set,t.current.highlightLinks=new Set),t.current.hoveredLink){let b=typeof t.current.hoveredLink.source=="object"?t.current.hoveredLink.source.id:t.current.hoveredLink.source,D=typeof t.current.hoveredLink.target=="object"?t.current.hoveredLink.target.id:t.current.hoveredLink.target;(b!==void 0&&u.has(b)||D!==void 0&&u.has(D))&&(t.current.hoveredLink=null,t.current.highlightNodes=new Set,t.current.highlightLinks=new Set);}t.current.draggedNode&&t.current.draggedNode.id!==void 0&&u.has(t.current.draggedNode.id)&&(t.current.draggedNode=null);let g=l.filter(b=>b.id!==void 0&&!u.has(b.id)),w=c.filter(b=>{let D=typeof b.source=="object"?b.source.id:b.source,E=typeof b.target=="object"?b.target.id:b.target;return D!==void 0&&!u.has(D)&&E!==void 0&&!u.has(E)});g.forEach(b=>{b.neighbors=[],b.links=[];}),w.forEach(b=>{let D=typeof b.source=="object"?b.source:g.find(_=>_.id===b.source),E=typeof b.target=="object"?b.target:g.find(_=>_.id===b.target);!D||!E||(D.neighbors=D.neighbors||[],E.neighbors=E.neighbors||[],D.neighbors.push(E),E.neighbors.push(D),D.links=D.links||[],E.links=E.links||[],D.links.push(b),E.links.push(b));}),T.current.nodes(g);let m=T.current.force("link");m&&m.links(w),W();},[W]),ae=useCallback((e=0,l=20)=>{let c=re();if(!$.current||!P.current||!c||!c.length)return;let g=1/0,w=1/0,m=-1/0,b=-1/0;if(c.forEach(D=>{if(D.x===void 0||D.y===void 0)return;let E=D.x,_=D.y;g=Math.min(g,E),w=Math.min(w,_),m=Math.max(m,E),b=Math.max(b,_);}),isFinite(g)&&isFinite(m)&&isFinite(w)&&isFinite(b)){let{width:D,height:E}=t.current;g-=l,w-=l,m+=l,b+=l;let _=m-g,y=b-w,C=_>0?D/_:1,A=y>0?E/y:1,z=Math.min(C,A,10),j=g+_/2,v=w+y/2,O={k:z,x:D/2-j*z,y:E/2-v*z};if(e>0){let R={...t.current.transform},G=Date.now(),K=a(()=>{let ee=Math.min(1,(Date.now()-G)/e),me=ee===1?1:1-Math.pow(1-ee,3),pe={k:R.k+(O.k-R.k)*me,x:R.x+(O.x-R.x)*me,y:R.y+(O.y-R.y)*me};t.current.transform=pe,W(),ee<1&&requestAnimationFrame(K);},"animateZoom");requestAnimationFrame(K);}else t.current.transform=O,W();}},[]),X=useCallback((e,l)=>{let c=re();if(!c||c.length===0)return null;let u=te.nodeSizeBase/2,g=typeof window<"u"&&window.devicePixelRatio||1,w=(e*g-t.current.transform.x)/t.current.transform.k,m=(l*g-t.current.transform.y)/t.current.transform.k;return c.find(b=>{let D=(b.x||0)-w,E=(b.y||0)-m;return Math.sqrt(D*D+E*E)<=u})||null},[]),Q=useCallback((e,l)=>{let c=se(),u=re();if(!c||c.length===0||!u||u.length===0)return null;let g=typeof window<"u"&&window.devicePixelRatio||1,w=(e*g-t.current.transform.x)/t.current.transform.k,m=(l*g-t.current.transform.y)/t.current.transform.k,b=5;return c.find(D=>{let E=typeof D.source=="object"?D.source:u.find(Ze=>Ze.id===D.source),_=typeof D.target=="object"?D.target:u.find(Ze=>Ze.id===D.target);if(!E||!_)return false;let y=E.x||0,C=E.y||0,A=_.x||0,z=_.y||0,j=w-y,v=m-C,O=A-y,R=z-C,G=j*O+v*R,K=O*O+R*R;if(K===0)return false;let ee=G/K;ee=Math.max(0,Math.min(1,ee));let me=y+ee*O,pe=C+ee*R,he=w-me,He=m-pe;return Math.sqrt(he*he+He*He)<=b})||null},[]),de=useCallback((e,l,c,u,g,w,m)=>{let b=e-c,D=l-u,E=Math.sqrt(b*b+D*D),_=Math.atan2(D,b);_<0&&(_+=2*Math.PI);let A=E>=g*.5&&E<=g*1,z=false;return w===Math.PI&&m===Math.PI*2?z=_>=Math.PI&&_<=Math.PI*2:w===0&&m===Math.PI?z=_>=0&&_<=Math.PI:z=w<=m&&_>=w&&_<=m||w>m&&(_>=w||_<=m),A&&z},[]),ce=useCallback(e=>{if(e===t.current.hoveredNode)return;let l=new Set,c=new Set;e&&(l.add(e),e.neighbors&&e.neighbors.forEach(u=>l.add(u)),e.links&&e.links.forEach(u=>c.add(u))),t.current.hoveredNode=e,x&&x(e),t.current.highlightNodes=l,t.current.highlightLinks=c;},[x]),ue=useCallback(e=>{if(e===t.current.hoveredLink)return;let l=new Set,c=new Set;if(e){c.add(e);let u=re();if(u){let g=typeof e.source=="object"?e.source:u.find(m=>m.id===e.source),w=typeof e.target=="object"?e.target:u.find(m=>m.id===e.target);g&&l.add(g),w&&l.add(w);}}t.current.hoveredLink=e,k&&k(e),t.current.highlightNodes=l,t.current.highlightLinks=c;},[k,re]),Se=useCallback(e=>{N&&N(e);},[N]),_e=useCallback(e=>{t.current.selectedNode=e,s&&s(e);},[s]),qe=useCallback(()=>{t.current.selectedNode=null,h&&h();},[h]),Ee=useCallback(e=>{if(!P.current||!T.current)return;let l=P.current.getBoundingClientRect(),c=e.clientX-l.left,u=e.clientY-l.top;t.current.mouseStartPos={x:c,y:u},t.current.isDragging=false;let g=X(c,u);g?(t.current.draggedNode=g,g.fx=g.x,g.fy=g.y):(t.current.isPanning=true,t.current.lastMousePos={x:c,y:u});},[X]),Fe=useCallback((e,l)=>{let c=null;if(P.current&&t.current&&p.length>0){let u=te.nodeSizeBase*te.nodeAreaFactor/2,g=P.current.getBoundingClientRect(),w=P.current.width/g.width,m=P.current.height/g.height,b=e*w,D=l*m,E=(b-t.current.transform.x)/t.current.transform.k,_=(D-t.current.transform.y)/t.current.transform.k,y=t.current.selectedNode?.x||0,C=t.current.selectedNode?.y||0,A=Math.min(p.length,8),z=Math.min(Math.PI*2/A,Math.PI);for(let j=0;j<A;j++){let v=j*z,O=(j+1)*z;if(de(E,_,y,C,u,v,O)){c=j;break}}}return c},[p]),Ce=useCallback(e=>{if(!P.current)return;let l=P.current.getBoundingClientRect(),c=e.clientX-l.left,u=e.clientY-l.top;if(t.current.draggedNode&&t.current.mouseStartPos&&T.current){let m=t.current.mouseStartPos.x,b=t.current.mouseStartPos.y,D=c-m,E=u-b;Math.sqrt(D*D+E*E)>3&&(t.current.isDragging=true,T.current.alphaTarget()===0&&T.current.alphaTarget(0).restart());let C=typeof window<"u"&&window.devicePixelRatio||1,A=(c*C-t.current.transform.x)/t.current.transform.k,z=(u*C-t.current.transform.y)/t.current.transform.k;t.current.draggedNode.fx=A,t.current.draggedNode.fy=z;return}if(t.current.isPanning&&t.current.mouseStartPos){let m=c-t.current.lastMousePos.x,b=u-t.current.lastMousePos.y,D=t.current.mouseStartPos.x,E=t.current.mouseStartPos.y;Math.sqrt(Math.pow(c-D,2)+Math.pow(u-E,2))>3&&(t.current.isDragging=true),t.current.transform={...t.current.transform,x:t.current.transform.x+m,y:t.current.transform.y+b},t.current.lastMousePos={x:c,y:u},W();return}let g,w;if(t.current.selectedNode&&P.current&&p.length>0){let m=Fe(c,u);m!==null&&(w=t.current.selectedNode),m!==t.current.hoveredButtonIndex&&(g=true),t.current.hoveredButtonIndex=m;}else t.current.hoveredButtonIndex!==null&&(t.current.hoveredButtonIndex=null);if(!w&&(w=X(c,u),!w)){let m=Q(c,u),b=m!==t.current.hoveredLink;if(m&&t.current.hoveredNode&&ce(null),ue(m),P.current&&(P.current.style.cursor=m?"pointer":"default"),b){W();return}}w&&t.current.hoveredLink&&ue(null),w!==t.current.hoveredNode&&(g=true),ce(w),P.current&&(P.current.style.cursor=w?"pointer":"default"),g&&W();},[p,X,Q,ce,ue,W,de,Fe]),Me=useCallback(e=>{t.current.mustBeStoppedPropagation&&(e.stopPropagation(),e.preventDefault()),t.current.mustBeStoppedPropagation=false;},[]),Ne=useCallback(e=>{let l=t.current.isDragging;if(l&&(t.current.mustBeStoppedPropagation=true),!l&&t.current.mouseStartPos){let c=P.current?.getBoundingClientRect();if(c){let u=e.clientX-c.left,g=e.clientY-c.top;p.length>0&&t.current.hoveredButtonIndex===null&&(t.current.hoveredButtonIndex=Fe(u,g));let w=false;if(t.current.selectedNode&&t.current.hoveredButtonIndex!==null&&d[t.current.hoveredButtonIndex]){let m=d[t.current.hoveredButtonIndex];m&&m.onClick&&(m.onClick(t.current.selectedNode),w=true,t.current.hoveredButtonIndex=null);}if(!w&&t.current.draggedNode)_e(t.current.draggedNode);else if(!w&&!t.current.draggedNode){let m=Q(u,g);m?Se(m):qe();}}}if(t.current.draggedNode&&T.current){if(l){T.current.alphaTarget(0);let c=.05,u=.04,g=.6;T.current.alpha(c).alphaDecay(u),T.current.velocityDecay(g);}else T.current.alphaTarget(0);t.current.draggedNode.fx=void 0,t.current.draggedNode.fy=void 0,t.current.draggedNode=null;}t.current.isDragging=false,t.current.mouseStartPos=null,t.current.isPanning&&(t.current.isPanning=false),W();},[d,W,_e,qe,Q,Se,Fe,p]),Ue=useCallback(e=>{if(e.stopPropagation(),e.preventDefault(),!P.current)return;let l=P.current.getBoundingClientRect(),c=e.clientX-l.left,u=e.clientY-l.top,w=-e.deltaY>0?1.1:1/1.1,m=t.current.transform,b=m.k*w;if(b<.01||b>10)return;let D=m.k*w,E=c-(c-m.x)*w,_=u-(u-m.y)*w;t.current.transform={k:D,x:E,y:_},W();},[W]),Be=a((e,l)=>{let c=e.touches[0];if(c){let u={clientX:c.clientX,clientY:c.clientY};l(u);}},"convertTouchToMouseEvent"),et=useCallback(e=>{Be(e,Ee);},[Ee]),Oe=useCallback(e=>{t.current.mustBeStoppedPropagation&&(e.preventDefault(),e.stopPropagation()),t.current.mustBeStoppedPropagation=false,Be(e,Ne);},[Ne]),Lt=useCallback(e=>{Be(e,Ce);},[Ce]);return useImperativeHandle(M,()=>({zoomToFit:ae,addNodes:Z,removeNodes:oe}),[ae,Z,oe]),useEffect(()=>{let e=P.current,{width:l,height:c}=t.current;if(!e)return;ne(),B(true);let u=l/2,g=c/2,w=te.nodeSizeBase,m=w/2,b=w*2.5;T.current&&T.current.stop();let D=T.current=forceSimulation(I).force("link",forceLink(S).id(E=>E.id).distance(b).strength(.9)).force("charge",forceManyBody().strength(-w/10*200).theta(.5).distanceMin(w*2)).force("x",forceX().strength(.03)).force("y",forceY().strength(.03)).force("center",forceCenter(u,g).strength(.05)).force("collide",forceCollide().radius(m*2).iterations(2).strength(1)).velocityDecay(.6);return ()=>{D.stop();}},[I,S]),useLayoutEffect(()=>{let e=P.current;e&&(t.current.width=o*ft,t.current.height=n*ft,e.width=t.current.width,e.height=t.current.height);},[o,n]),useEffect(()=>{if(T.current){let e=T.current;e.on("tick",()=>{W();}),e.on("end",()=>{L&&(ae(0,20),setTimeout(()=>{B(false);},200));});}L||W();},[I,S,L,W,ae]),useEffect(()=>{!I||!S||S.forEach(e=>{let l=typeof e.source=="object"?e.source:I.find(u=>u.id===e.source),c=typeof e.target=="object"?e.target:I.find(u=>u.id===e.target);!l||!c||(!l.neighbors&&(l.neighbors=[]),!c.neighbors&&(c.neighbors=[]),l.neighbors.push(c),c.neighbors.push(l),!l.links&&(l.links=[]),!c.links&&(c.links=[]),l.links.push(e),c.links.push(e));});},[I,S]),useEffect(()=>{d&&d.length>0&&F(Ho(d));},[d]),useEffect(()=>{let e=P.current;if(!(!e||typeof window>"u"))return e.addEventListener("wheel",Ue,{passive:false}),e.addEventListener("touchend",Oe,{passive:false}),()=>{e.removeEventListener("wheel",Ue),e.removeEventListener("touchend",Oe);}},[Ue,Oe]),jsxs($o,{children:[(r||L)&&jsx(hr,{width:o,height:n}),jsx(Xo,{ref:P,style:{width:o,height:n,display:r||L?"none":"block"},onMouseDown:Ee,onMouseMove:Ce,onMouseUp:Ne,onMouseLeave:Ne,onClick:Me,onTouchStart:et,onTouchMove:Lt})]})}),$o=styled.div`
|
|
48
48
|
display: flex;
|
|
49
49
|
align-items: center;
|
|
50
50
|
justify-content: center;
|
|
51
51
|
width: 100%;
|
|
52
52
|
min-width: 0;
|
|
53
53
|
position: relative;
|
|
54
|
-
`,Xo=styled.canvas``;Wo.displayName="Graph2D";var
|
|
54
|
+
`,Xo=styled.canvas``;Wo.displayName="Graph2D";var tl=w(({isActive:r,position:o,top:n=0,left:a=0,right:d,bottom:s,...h})=>jsx(Uo,{$isActive:r,$position:o,$top:n,$left:a,$right:d,$bottom:s,...h})),Uo=xo.div(({$isActive:r,$top:o,$left:n,$right:a,$bottom:d,$position:s,theme:h})=>`
|
|
55
55
|
${r?`
|
|
56
|
-
position: ${
|
|
56
|
+
position: ${s};
|
|
57
57
|
z-index: 1000;
|
|
58
58
|
${typeof o=="number"?`top: ${c(o,h.baseSize)};`:""}
|
|
59
59
|
${typeof n=="number"?`left: ${c(n,h.baseSize)};`:""}
|
|
@@ -63,7 +63,7 @@ ${r?`
|
|
|
63
63
|
`:""}
|
|
64
64
|
|
|
65
65
|
min-width: 0;
|
|
66
|
-
`);var Go=[.1,.25,.5,.75,1,1.5,2,3,4,5],Ko=5,Jo=.1,Qo=140;function mt(r,o,n,a){return {x:r<n?(n-r)/2:0,y:o<a?(a-o)/2:0}}a(mt,"computePadding");var gr=a(({url:r,alt:o="image",naturalWidth:n,naturalHeight:a$1,zoomSteps:d=Go,maxZoom:i=Ko,minZoom:h=Jo,showMinimap:x=true,minimapWidth:k=Qo,className:R,onZoomChange:P})=>{let[m,E]=useState("adaptive"),[A,t]=useState(1),[F,S]=useState(false),p=useRef(false),[B,M]=useState(false),[T,$]=useState(false),[Y,ne]=useState({left:0,top:0}),re=useRef(0),[se,ye]=useState({width:0,height:0}),le=useRef({width:0,height:0}),we=useRef(null),ve=useRef(null),q=useRef({x:0,y:0,scrollLeft:0,scrollTop:0}),H=useRef(m),V=useRef(A),W=useRef(P);H.current=m,V.current=A,W.current=P;let Z=n||le.current.width,oe=a$1||le.current.height,ae=useMemo(()=>[...d].sort((y,C)=>y-C),[d]),X=useCallback(()=>se.width===0||Z===0?1:Math.min(se.width/Z,se.height/oe,1),[se,Z,oe]),Q=useCallback((y,C)=>{if(C==="in"){let I=ae.find(j=>j>y+.001);return I!==void 0?Math.min(I,i):y}let _=ae.findLast(I=>I<y-.001);return _!==void 0?Math.max(_,h):y},[ae,i,h]),de=useCallback(()=>H.current==="adaptive"?X():V.current,[X]),ce=useCallback(y=>{E("manual"),t(y),W.current?.(y,"manual");},[]),ue=useCallback(()=>{E("adaptive"),W.current?.(X(),"adaptive");},[X]),Se=useCallback(y=>{requestAnimationFrame(()=>{let C=ve.current;if(!C)return;let _=C.getBoundingClientRect(),I=Z*y,j=oe*y,v=mt(I,j,_.width,_.height);C.scrollLeft=I/2+v.x-_.width/2,C.scrollTop=j/2+v.y-_.height/2;});},[Z,oe]);useEffect(()=>{E("adaptive"),t(1),M(false),$(false),le.current={width:0,height:0};},[r]),useEffect(()=>{let y=ve.current;if(!y)return;let C=new ResizeObserver(_=>{let I=_[0];if(!I)return;let{width:j,height:v}=I.contentRect;ye(O=>O.width===j&&O.height===v?O:{width:j,height:v});});return C.observe(y),()=>C.disconnect()},[]),useEffect(()=>{let y=ve.current;if(!y)return;let C=a(()=>{cancelAnimationFrame(re.current),re.current=requestAnimationFrame(()=>{let _=y.scrollLeft,I=y.scrollTop;ne(j=>j.left===_&&j.top===I?j:{left:_,top:I});});},"handleScroll");return y.addEventListener("scroll",C,{passive:true}),()=>{y.removeEventListener("scroll",C),cancelAnimationFrame(re.current);}},[]),useEffect(()=>{let y=ve.current;if(!y||!B)return;let C=a(_=>{if(!(_.ctrlKey||_.metaKey))return;_.preventDefault();let I=de(),j=_.deltaY>0?"out":"in",v=Q(I,j),O=X();if(j==="out"&&v<=O){ue();return}let L=y.getBoundingClientRect(),G,K,ee=le.current.width||1,ge=le.current.height||1;if(H.current==="adaptive"){let pe=we.current;if(!pe)return;let he=pe.getBoundingClientRect();G=(_.clientX-he.left)/(he.width/ee),K=(_.clientY-he.top)/(he.height/ge);}else {let pe=ee*I,he=ge*I,He=mt(pe,he,L.width,L.height);G=(y.scrollLeft+_.clientX-L.left-He.x)/I,K=(y.scrollTop+_.clientY-L.top-He.y)/I;}ce(v),requestAnimationFrame(()=>{let pe=y.getBoundingClientRect(),he=mt(ee*v,ge*v,pe.width,pe.height);y.scrollLeft=G*v+he.x-(_.clientX-pe.left),y.scrollTop=K*v+he.y-(_.clientY-pe.top);});},"handleWheel");return y.addEventListener("wheel",C,{passive:false}),()=>y.removeEventListener("wheel",C)},[B,de,Q,X,ce,ue]),useEffect(()=>{if(m!=="manual")return;let y=ve.current;if(!y)return;let C=a(j=>{j.button===0&&(j.preventDefault(),p.current=true,S(true),q.current={x:j.clientX,y:j.clientY,scrollLeft:y.scrollLeft,scrollTop:y.scrollTop});},"handleMouseDown"),_=a(j=>{if(!p.current)return;let{x:v,y:O,scrollLeft:L,scrollTop:G}=q.current;y.scrollLeft=L-(j.clientX-v),y.scrollTop=G-(j.clientY-O);},"handleMouseMove"),I=a(()=>{p.current=false,S(false);},"handleMouseUp");return y.addEventListener("mousedown",C),window.addEventListener("mousemove",_),window.addEventListener("mouseup",I),()=>{y.removeEventListener("mousedown",C),window.removeEventListener("mousemove",_),window.removeEventListener("mouseup",I);}},[m]);let _e=useCallback(()=>{m==="manual"&&ue();},[m,ue]),qe=useCallback(()=>{let y=de(),C=Q(y,"in");C!==y&&(ce(C),Se(C));},[de,Q,ce,Se]),Ne=useCallback(()=>{let y=de(),C=Q(y,"out");if(C<=X()){ue();return}ce(C),Se(C);},[de,Q,X,ue,ce,Se]),Be=useCallback(()=>{ce(1),Se(1);},[ce,Se]),Ce=useCallback(()=>{let y=we.current;y&&(le.current={width:y.naturalWidth,height:y.naturalHeight},M(true),$(false));},[]),Pe=m==="adaptive"?X():A,Re=Z*Pe,Ue=oe*Pe,Fe=se.width,et=se.height,Oe=m==="manual"?mt(Re,Ue,Fe,et):{x:0,y:0},Lt=x&&m==="manual"&&(Re>Fe||Ue>et),e=Z>0?k/Z:0,l=oe*e,c=Fe>0?Fe/A*e:0,u=et>0?et/A*e:0,f=Math.max(0,Y.left-Oe.x)/A*e,w=Math.max(0,Y.top-Oe.y)/A*e,g=m==="adaptive"?"Fit":`${Math.round(A*100)}%`,b=Q(Pe,"in")!==Pe,D=m==="manual"||Pe>h,N=m==="adaptive"?{maxWidth:"100%",maxHeight:"100%",objectFit:"contain"}:{width:Re,height:Ue,maxWidth:"none",maxHeight:"none",marginLeft:Oe.x,marginTop:Oe.y,flexShrink:0},z$1={cursor:m==="manual"?F?"grabbing":"grab":"default"};return jsxs("div",{className:`h-full w-full flex flex-col min-h-0 min-w-0 overflow-hidden ${R??""}`,children:[jsxs("div",{className:"flex w-full items-center px-8.5 py-3 gap-1 shrink-0",children:[jsx(z,{variant:"outlined","aria-label":"zoom-out",color:"default",size:"small",icon:jsx(Pa,{style:{width:20,height:20}}),onClick:Ne,disabled:!D,p:7,className:"bg-white! hover:bg-blue-50! h-[38px]!"}),jsx("button",{type:"button",onClick:m==="manual"?ue:void 0,className:"flex items-center justify-center bg-white h-[38px] min-w-16 px-3 select-none border border-gray-300 rounded-md","aria-label":g,children:jsx(Ya,{style:{fontSize:12,fontWeight:500},children:g})}),jsx(z,{variant:"outlined","aria-label":"zoom-in",size:"small",color:"default",icon:jsx(ma$1,{style:{width:14,height:14}}),onClick:qe,disabled:!b,className:"bg-white! hover:bg-blue-50! h-[38px]!",p:10}),jsx(z,{variant:"outlined","aria-label":"fit-to-container",size:"small",color:m==="adaptive"?"primary":"default",icon:jsx(ra,{style:{width:14,height:14}}),onClick:ue,className:`${m==="adaptive"?"bg-blue-50!":"bg-white! hover:bg-blue-50!"} ml-auto h-[38px]!`,p:10}),jsx(z,{variant:"outlined","aria-label":"original-size",size:"small",color:m==="manual"&&A===1?"primary":"default",onClick:Be,className:`${m==="manual"&&A===1?"bg-blue-50!":"bg-white! hover:bg-blue-50!"} h-[38px]!`,p:10,children:jsx(Ya,{style:{fontSize:12,fontWeight:500,lineHeight:1},children:"1:1"})})]}),jsxs("div",{className:"flex-1 min-h-0 min-w-0 relative",children:[jsx("div",{ref:ve,className:`h-full w-full ${m==="adaptive"?"flex items-center justify-center overflow-hidden":"overflow-auto"}`,style:z$1,onDoubleClick:_e,children:T?jsx("div",{className:"flex items-center justify-center h-full w-full",children:jsx(Ya,{color:"text.lighter",children:"Failed to load image"})}):jsx("img",{ref:we,src:r,alt:o,draggable:false,className:"block select-none",style:N,onLoad:Ce,onError:()=>$(true)})}),Lt&&jsxs("div",{className:"absolute bottom-3 right-3 rounded-lg overflow-hidden shadow-lg pointer-events-none",style:{width:k,height:l,backdropFilter:"blur(8px)",background:"rgba(255,255,255,0.75)"},children:[jsx("img",{src:r,alt:"",draggable:false,className:"block w-full h-full object-contain"}),jsx("div",{className:"absolute border-2 border-blue-500 rounded-sm",style:{width:Math.min(c,k),height:Math.min(u,l),left:Math.max(0,Math.min(f,k-c)),top:Math.max(0,Math.min(w,l-u)),background:"rgba(59,130,246,0.1)"}})]})]})]})},"ImageDriver");var vr=a(({url:r})=>jsx("div",{className:"flex flex-col justify-center items-center w-full h-full py-5.5 px-8.5",children:jsx("audio",{controls:true,src:r,className:"w-full"})}),"AudioDriver");var zt=a(({url:r})=>{let[o,n]=useState(null),[a$1,d]=useState(false),[i,h]=useState(true),[x,k]=useState(null);return useEffect(()=>{d(true);},[]),useEffect(()=>{if(!a$1)return;a(async()=>{try{let P=await import('./PdfDriver-ZDVOQI63.mjs');n(()=>P.PdfDriver),h(!1);}catch(P){console.error("Failed to load PDF driver:",P),k("Failed to load PDF viewer"),h(false);}},"loadPdfDriver")();},[a$1]),a$1?i?jsx("div",{className:"flex items-center justify-center h-full w-full",children:jsx("div",{className:"text-gray-500",children:"Loading PDF viewer..."})}):x||!o?jsx("div",{className:"flex items-center justify-center h-full w-full",children:jsx("div",{className:"text-red-500 text-center",children:jsx("p",{children:x||"PDF viewer unavailable"})})}):jsx(o,{url:r}):jsx("div",{className:"flex items-center justify-center h-full w-full",children:jsx("div",{className:"text-gray-500",children:"Loading PDF viewer..."})})},"PdfDriverWrapper");var xr=50,rn=1e4,kr=a(({url:r,blob:o})=>{let n=useRef(null),a$1=useRef(null),[d,i]=useState(null),[h,x]=useState(true),[k,R]=useState(1),P=useRef(false),[m,E]=useState({width:0,height:0}),A=useRef(0),t=a(()=>{P.current=true,R(S=>Math.min(S+.25,4));},"handleZoomIn"),F=a(()=>{P.current=true,R(S=>Math.max(S-.25,.25));},"handleZoomOut");return useEffect(()=>{a(async()=>{if(a$1.current)try{x(!0),i(null);let p=o;if(!p&&r&&(p=await(await fetch(r)).blob()),!p){i("\u041D\u0435 \u043D\u0430\u0434\u0430\u043D\u043E \u0434\u043B\u044F DOCX \u0444\u0430\u0439\u043B\u0443");return}if(p.size/(1024*1024)>xr){i(`\u0424\u0430\u0439\u043B \u0437\u0430\u043D\u0430\u0434\u0442\u043E \u0432\u0435\u043B\u0438\u043A\u0438\u0439 (> ${xr} \u041C\u0411)`);return}a$1.current.innerHTML="";let M=renderAsync(p,a$1.current,void 0,{debug:!0,experimental:!0,hideWrapperOnPrint:!0,breakPages:!0,ignoreLastRenderedPageBreak:!1}),T=new Promise((Y,ne)=>setTimeout(()=>ne(new Error("\u0420\u0435\u043D\u0434\u0435\u0440\u0438\u043D\u0433 DOCX \u0437\u0430\u0439\u043D\u044F\u0432 \u043D\u0430\u0434\u0442\u043E \u0431\u0430\u0433\u0430\u0442\u043E \u0447\u0430\u0441\u0443")),rn));await Promise.race([M,T]),await new Promise(Y=>requestAnimationFrame(Y));let $=a$1.current.querySelector(".docx-wrapper");if($&&(A.current=$.offsetWidth,E({width:$.offsetWidth,height:$.offsetHeight})),n.current&&A.current>0){let Y=n.current.clientWidth,ne=Math.min(Y/A.current,1);R(ne);}x(!1);}catch(p){i(p?.message||"\u041D\u0435 \u0432\u0434\u0430\u043B\u043E\u0441\u044F \u0432\u0456\u0434\u043A\u0440\u0438\u0442\u0438 DOCX \u0444\u0430\u0439\u043B"),x(false);}},"renderDocument")();},[r,o]),useEffect(()=>{if(!n.current)return;let S=tn(B=>{if(!(P.current||A.current===0))for(let M of B){let T=M.contentRect.width,$=Math.min(T/A.current,1);R($);}},150),p=new ResizeObserver(S);return p.observe(n.current),()=>{p.disconnect(),S.cancel();}},[]),jsxs("div",{className:"h-full w-full flex flex-col px-0.5",children:[jsxs("div",{className:"flex justify-center items-stretch px-8 py-3 gap-1 border-b border-gray-200",children:[jsx(z,{variant:"outlined","aria-label":"zoom-out",color:"default",size:"small",icon:jsx(Pa,{style:{width:20,height:20}}),onClick:F,disabled:k<=.25,className:"bg-white! hover:bg-blue-50!",p:7}),jsxs(pb,{py:8,px:8,className:"flex items-center justify-between gap-1.5 min-w-21 rounded-[5px]!",children:[jsx(Ya,{color:"text.lighter",style:{fontSize:10},children:"Scale:"}),jsxs(Ya,{children:[Math.round(k*100),"%"]})]}),jsx(z,{variant:"outlined","aria-label":"zoom-in",size:"small",color:"default",icon:jsx(ma$1,{style:{width:14,height:14}}),onClick:t,disabled:k>=4,className:"bg-white! hover:bg-blue-50!",p:10})]}),!!d&&!h&&jsx("div",{className:"text-red-500 p-8",children:d}),h&&jsx("div",{className:"flex items-center justify-center p-8",children:"\u0417\u0430\u0432\u0430\u043D\u0442\u0430\u0436\u0435\u043D\u043D\u044F..."}),jsx("div",{ref:n,className:"w-full h-full overflow-auto [&::-webkit-scrollbar-thumb]:bg-gray-100 [&::-webkit-scrollbar-track]:bg-[gray]",style:{backgroundColor:"gray",scrollbarGutter:"stable both-edges",scrollbarColor:"#f1f1f1 gray"},children:jsx("div",{style:{width:m.width>0?m.width*k:void 0,height:m.height>0?m.height*k:void 0,overflow:"hidden",margin:"0 auto"},children:jsx("div",{ref:a$1,className:`[&>div.docx-wrapper_table_*]:wrap-break-word!
|
|
66
|
+
`);var Go=[.1,.25,.5,.75,1,1.5,2,3,4,5],Ko=5,Jo=.1,Qo=140;function mt(r,o,n,a){return {x:r<n?(n-r)/2:0,y:o<a?(a-o)/2:0}}a(mt,"computePadding");var br=a(({url:r,alt:o="image",naturalWidth:n,naturalHeight:a$1,zoomSteps:d=Go,maxZoom:s=Ko,minZoom:h=Jo,showMinimap:x=true,minimapWidth:k=Qo,className:N,onZoomChange:M})=>{let[f,L]=useState("adaptive"),[B,t]=useState(1),[I,S]=useState(false),p=useRef(false),[F,P]=useState(false),[T,$]=useState(false),[Y,ne]=useState({left:0,top:0}),re=useRef(0),[se,ye]=useState({width:0,height:0}),le=useRef({width:0,height:0}),we=useRef(null),ve=useRef(null),q=useRef({x:0,y:0,scrollLeft:0,scrollTop:0}),H=useRef(f),V=useRef(B),W=useRef(M);H.current=f,V.current=B,W.current=M;let Z=n||le.current.width,oe=a$1||le.current.height,ae=useMemo(()=>[...d].sort((y,C)=>y-C),[d]),X=useCallback(()=>se.width===0||Z===0?1:Math.min(se.width/Z,se.height/oe,1),[se,Z,oe]),Q=useCallback((y,C)=>{if(C==="in"){let z=ae.find(j=>j>y+.001);return z!==void 0?Math.min(z,s):y}let A=ae.findLast(z=>z<y-.001);return A!==void 0?Math.max(A,h):y},[ae,s,h]),de=useCallback(()=>H.current==="adaptive"?X():V.current,[X]),ce=useCallback(y=>{L("manual"),t(y),W.current?.(y,"manual");},[]),ue=useCallback(()=>{L("adaptive"),W.current?.(X(),"adaptive");},[X]),Se=useCallback(y=>{requestAnimationFrame(()=>{let C=ve.current;if(!C)return;let A=C.getBoundingClientRect(),z=Z*y,j=oe*y,v=mt(z,j,A.width,A.height);C.scrollLeft=z/2+v.x-A.width/2,C.scrollTop=j/2+v.y-A.height/2;});},[Z,oe]);useEffect(()=>{L("adaptive"),t(1),P(false),$(false),le.current={width:0,height:0};},[r]),useEffect(()=>{let y=ve.current;if(!y)return;let C=new ResizeObserver(A=>{let z=A[0];if(!z)return;let{width:j,height:v}=z.contentRect;ye(O=>O.width===j&&O.height===v?O:{width:j,height:v});});return C.observe(y),()=>C.disconnect()},[]),useEffect(()=>{let y=ve.current;if(!y)return;let C=a(()=>{cancelAnimationFrame(re.current),re.current=requestAnimationFrame(()=>{let A=y.scrollLeft,z=y.scrollTop;ne(j=>j.left===A&&j.top===z?j:{left:A,top:z});});},"handleScroll");return y.addEventListener("scroll",C,{passive:true}),()=>{y.removeEventListener("scroll",C),cancelAnimationFrame(re.current);}},[]),useEffect(()=>{let y=ve.current;if(!y||!F)return;let C=a(A=>{if(!(A.ctrlKey||A.metaKey))return;A.preventDefault();let z=de(),j=A.deltaY>0?"out":"in",v=Q(z,j),O=X();if(j==="out"&&v<=O){ue();return}let R=y.getBoundingClientRect(),G,K,ee=le.current.width||1,me=le.current.height||1;if(H.current==="adaptive"){let pe=we.current;if(!pe)return;let he=pe.getBoundingClientRect();G=(A.clientX-he.left)/(he.width/ee),K=(A.clientY-he.top)/(he.height/me);}else {let pe=ee*z,he=me*z,He=mt(pe,he,R.width,R.height);G=(y.scrollLeft+A.clientX-R.left-He.x)/z,K=(y.scrollTop+A.clientY-R.top-He.y)/z;}ce(v),requestAnimationFrame(()=>{let pe=y.getBoundingClientRect(),he=mt(ee*v,me*v,pe.width,pe.height);y.scrollLeft=G*v+he.x-(A.clientX-pe.left),y.scrollTop=K*v+he.y-(A.clientY-pe.top);});},"handleWheel");return y.addEventListener("wheel",C,{passive:false}),()=>y.removeEventListener("wheel",C)},[F,de,Q,X,ce,ue]),useEffect(()=>{if(f!=="manual")return;let y=ve.current;if(!y)return;let C=a(j=>{j.button===0&&(j.preventDefault(),p.current=true,S(true),q.current={x:j.clientX,y:j.clientY,scrollLeft:y.scrollLeft,scrollTop:y.scrollTop});},"handleMouseDown"),A=a(j=>{if(!p.current)return;let{x:v,y:O,scrollLeft:R,scrollTop:G}=q.current;y.scrollLeft=R-(j.clientX-v),y.scrollTop=G-(j.clientY-O);},"handleMouseMove"),z=a(()=>{p.current=false,S(false);},"handleMouseUp");return y.addEventListener("mousedown",C),window.addEventListener("mousemove",A),window.addEventListener("mouseup",z),()=>{y.removeEventListener("mousedown",C),window.removeEventListener("mousemove",A),window.removeEventListener("mouseup",z);}},[f]);let _e=useCallback(()=>{f==="manual"&&ue();},[f,ue]),qe=useCallback(()=>{let y=de(),C=Q(y,"in");C!==y&&(ce(C),Se(C));},[de,Q,ce,Se]),Ee=useCallback(()=>{let y=de(),C=Q(y,"out");if(C<=X()){ue();return}ce(C),Se(C);},[de,Q,X,ue,ce,Se]),Fe=useCallback(()=>{ce(1),Se(1);},[ce,Se]),Ce=useCallback(()=>{let y=we.current;y&&(le.current={width:y.naturalWidth,height:y.naturalHeight},P(true),$(false));},[]),Me=f==="adaptive"?X():B,Ne=Z*Me,Ue=oe*Me,Be=se.width,et=se.height,Oe=f==="manual"?mt(Ne,Ue,Be,et):{x:0,y:0},Lt=x&&f==="manual"&&(Ne>Be||Ue>et),e=Z>0?k/Z:0,l=oe*e,c=Be>0?Be/B*e:0,u=et>0?et/B*e:0,g=Math.max(0,Y.left-Oe.x)/B*e,w=Math.max(0,Y.top-Oe.y)/B*e,m=f==="adaptive"?"Fit":`${Math.round(B*100)}%`,b=Q(Me,"in")!==Me,D=f==="manual"||Me>h,E=f==="adaptive"?{maxWidth:"100%",maxHeight:"100%",objectFit:"contain"}:{width:Ne,height:Ue,maxWidth:"none",maxHeight:"none",marginLeft:Oe.x,marginTop:Oe.y,flexShrink:0},_={cursor:f==="manual"?I?"grabbing":"grab":"default"};return jsxs("div",{className:`h-full w-full flex flex-col min-h-0 min-w-0 overflow-hidden ${N??""}`,children:[jsxs("div",{className:"flex w-full items-center px-8.5 py-3 gap-1 shrink-0",children:[jsx(z,{variant:"outlined","aria-label":"zoom-out",color:"default",size:"small",icon:jsx(Pa$1,{style:{width:20,height:20}}),onClick:Ee,disabled:!D,p:7,className:"bg-white! dark:bg-neutral-800! hover:bg-blue-50! dark:hover:bg-neutral-700! h-[38px]!"}),jsx("button",{type:"button",onClick:f==="manual"?ue:void 0,className:"flex items-center justify-center bg-white dark:bg-neutral-800 h-[38px] min-w-16 px-3 select-none border border-gray-300 dark:border-neutral-600 rounded-md","aria-label":m,children:jsx(Ya,{style:{fontSize:12,fontWeight:500},children:m})}),jsx(z,{variant:"outlined","aria-label":"zoom-in",size:"small",color:"default",icon:jsx(ma,{style:{width:14,height:14}}),onClick:qe,disabled:!b,className:"bg-white! dark:bg-neutral-800! hover:bg-blue-50! dark:hover:bg-neutral-700! h-[38px]!",p:10}),jsx(z,{variant:"outlined","aria-label":"fit-to-container",size:"small",color:f==="adaptive"?"primary":"default",icon:jsx(ra,{style:{width:14,height:14}}),onClick:ue,className:`${f==="adaptive"?"bg-blue-50!":"bg-white! dark:bg-neutral-800! hover:bg-blue-50! dark:hover:bg-neutral-700!"} ml-auto h-[38px]!`,p:10}),jsx(z,{variant:"outlined","aria-label":"original-size",size:"small",color:f==="manual"&&B===1?"primary":"default",onClick:Fe,className:`${f==="manual"&&B===1?"bg-blue-50!":"bg-white! dark:bg-neutral-800! hover:bg-blue-50! dark:hover:bg-neutral-700!"} h-[38px]!`,py:10,px:11,children:jsx(Ya,{style:{fontSize:12,fontWeight:500,lineHeight:1},children:"1:1"})})]}),jsxs("div",{className:"flex-1 min-h-0 min-w-0 relative",children:[jsx("div",{ref:ve,className:`h-full w-full ${f==="adaptive"?"flex items-center justify-center overflow-hidden":"overflow-auto"}`,style:_,onDoubleClick:_e,children:T?jsx("div",{className:"flex items-center justify-center h-full w-full",children:jsx(Ya,{color:"text.lighter",children:"Failed to load image"})}):jsx("img",{ref:we,src:r,alt:o,draggable:false,className:"block select-none",style:E,onLoad:Ce,onError:()=>$(true)})}),Lt&&jsxs("div",{className:"absolute bottom-3 right-3 rounded-lg overflow-hidden shadow-lg pointer-events-none",style:{width:k,height:l,backdropFilter:"blur(8px)",background:"rgba(255,255,255,0.75)"},children:[jsx("img",{src:r,alt:"",draggable:false,className:"block w-full h-full object-contain"}),jsx("div",{className:"absolute border-2 border-blue-500 rounded-sm",style:{width:Math.min(c,k),height:Math.min(u,l),left:Math.max(0,Math.min(g,k-c)),top:Math.max(0,Math.min(w,l-u)),background:"rgba(59,130,246,0.1)"}})]})]})]})},"ImageDriver");var yr=a(({url:r})=>jsx("div",{className:"flex flex-col justify-center items-center w-full h-full py-5.5 px-8.5",children:jsx("audio",{controls:true,src:r,className:"w-full"})}),"AudioDriver");var zt=a(({url:r})=>{let[o,n]=useState(null),[a$1,d]=useState(false),[s,h]=useState(true),[x,k]=useState(null);return useEffect(()=>{d(true);},[]),useEffect(()=>{if(!a$1)return;a(async()=>{try{let M=await import('./PdfDriver-BYZATCUO.mjs');n(()=>M.PdfDriver),h(!1);}catch(M){console.error("Failed to load PDF driver:",M),k("Failed to load PDF viewer"),h(false);}},"loadPdfDriver")();},[a$1]),a$1?s?jsx("div",{className:"flex items-center justify-center h-full w-full",children:jsx("div",{className:"text-gray-500 dark:text-gray-400",children:"Loading PDF viewer..."})}):x||!o?jsx("div",{className:"flex items-center justify-center h-full w-full",children:jsx("div",{className:"text-red-500 text-center",children:jsx("p",{children:x||"PDF viewer unavailable"})})}):jsx(o,{url:r}):jsx("div",{className:"flex items-center justify-center h-full w-full",children:jsx("div",{className:"text-gray-500 dark:text-gray-400",children:"Loading PDF viewer..."})})},"PdfDriverWrapper");var kr=50,rn=1e4,Sr=a(({url:r,blob:o})=>{let n=useRef(null),a$1=useRef(null),[d,s]=useState(null),[h,x]=useState(true),[k,N]=useState(1),M=useRef(false),[f,L]=useState({width:0,height:0}),B=useRef(0),t=a(()=>{M.current=true,N(S=>Math.min(S+.25,4));},"handleZoomIn"),I=a(()=>{M.current=true,N(S=>Math.max(S-.25,.25));},"handleZoomOut");return useEffect(()=>{a(async()=>{if(a$1.current)try{x(!0),s(null);let p=o;if(!p&&r&&(p=await(await fetch(r)).blob()),!p){s("\u041D\u0435 \u043D\u0430\u0434\u0430\u043D\u043E \u0434\u043B\u044F DOCX \u0444\u0430\u0439\u043B\u0443");return}if(p.size/(1024*1024)>kr){s(`\u0424\u0430\u0439\u043B \u0437\u0430\u043D\u0430\u0434\u0442\u043E \u0432\u0435\u043B\u0438\u043A\u0438\u0439 (> ${kr} \u041C\u0411)`);return}a$1.current.innerHTML="";let P=renderAsync(p,a$1.current,void 0,{debug:!0,experimental:!0,hideWrapperOnPrint:!0,breakPages:!0,ignoreLastRenderedPageBreak:!1}),T=new Promise((Y,ne)=>setTimeout(()=>ne(new Error("\u0420\u0435\u043D\u0434\u0435\u0440\u0438\u043D\u0433 DOCX \u0437\u0430\u0439\u043D\u044F\u0432 \u043D\u0430\u0434\u0442\u043E \u0431\u0430\u0433\u0430\u0442\u043E \u0447\u0430\u0441\u0443")),rn));await Promise.race([P,T]),await new Promise(Y=>requestAnimationFrame(Y));let $=a$1.current.querySelector(".docx-wrapper");if($&&(B.current=$.offsetWidth,L({width:$.offsetWidth,height:$.offsetHeight})),n.current&&B.current>0){let Y=n.current.clientWidth,ne=Math.min(Y/B.current,1);N(ne);}x(!1);}catch(p){s(p?.message||"\u041D\u0435 \u0432\u0434\u0430\u043B\u043E\u0441\u044F \u0432\u0456\u0434\u043A\u0440\u0438\u0442\u0438 DOCX \u0444\u0430\u0439\u043B"),x(false);}},"renderDocument")();},[r,o]),useEffect(()=>{if(!n.current)return;let S=tn(F=>{if(!(M.current||B.current===0))for(let P of F){let T=P.contentRect.width,$=Math.min(T/B.current,1);N($);}},150),p=new ResizeObserver(S);return p.observe(n.current),()=>{p.disconnect(),S.cancel();}},[]),jsxs("div",{className:"h-full w-full flex flex-col px-0.5",children:[jsxs("div",{className:"flex justify-center items-stretch px-8 py-3 gap-1 border-b border-gray-200 dark:border-neutral-700",children:[jsx(z,{variant:"outlined","aria-label":"zoom-out",color:"default",size:"small",icon:jsx(Pa$1,{style:{width:20,height:20}}),onClick:I,disabled:k<=.25,className:"bg-white! dark:bg-neutral-800! hover:bg-blue-50! dark:hover:bg-neutral-700!",p:7}),jsxs(pb,{py:8,px:8,className:"flex items-center justify-between gap-1.5 min-w-21 rounded-[5px]!",children:[jsx(Ya,{color:"text.lighter",style:{fontSize:10},children:"Scale:"}),jsxs(Ya,{children:[Math.round(k*100),"%"]})]}),jsx(z,{variant:"outlined","aria-label":"zoom-in",size:"small",color:"default",icon:jsx(ma,{style:{width:14,height:14}}),onClick:t,disabled:k>=4,className:"bg-white! dark:bg-neutral-800! hover:bg-blue-50! dark:hover:bg-neutral-700!",p:10})]}),!!d&&!h&&jsx("div",{className:"text-red-500 p-8",children:d}),h&&jsx("div",{className:"flex items-center justify-center p-8",children:"\u0417\u0430\u0432\u0430\u043D\u0442\u0430\u0436\u0435\u043D\u043D\u044F..."}),jsx("div",{ref:n,className:"w-full h-full overflow-auto bg-gray-400 dark:bg-neutral-700 [&::-webkit-scrollbar-thumb]:bg-gray-100 dark:[&::-webkit-scrollbar-thumb]:bg-neutral-600 [&::-webkit-scrollbar-track]:bg-gray-400 dark:[&::-webkit-scrollbar-track]:bg-neutral-700",style:{scrollbarGutter:"stable both-edges"},children:jsx("div",{style:{width:f.width>0?f.width*k:void 0,height:f.height>0?f.height*k:void 0,overflow:"hidden",margin:"0 auto"},children:jsx("div",{ref:a$1,className:`[&>div.docx-wrapper_table_*]:wrap-break-word!
|
|
67
67
|
[&>div.docx-wrapper_table]:table-fixed!
|
|
68
68
|
[&>div.docx-wrapper_table_td]:w-fit!
|
|
69
69
|
[&>div.docx-wrapper_table_col]:w-fit!
|
|
@@ -79,11 +79,11 @@ ${r?`
|
|
|
79
79
|
[&>div.docx-wrapper]:box-border
|
|
80
80
|
[&>div.docx-wrapper]:min-w-fit!
|
|
81
81
|
[&>div.docx-wrapper]:w-full!
|
|
82
|
-
[&>div.docx-wrapper]:min-h-full`,style:{boxSizing:"border-box",wordBreak:"break-word",overflowWrap:"break-word",transform:`scale(${k})`,transformOrigin:"top left"}})})})]})},"DocxDriver");var
|
|
83
|
-
`||h==="\r"&&r[
|
|
84
|
-
`)){let x=
|
|
82
|
+
[&>div.docx-wrapper]:min-h-full`,style:{boxSizing:"border-box",wordBreak:"break-word",overflowWrap:"break-word",transform:`scale(${k})`,transformOrigin:"top left"}})})})]})},"DocxDriver");var vn=a(r=>({js:[javascript({jsx:false})],jsx:[javascript({jsx:true})],ts:[javascript({typescript:true,jsx:false})],tsx:[javascript({typescript:true,jsx:true})],json:[json()],html:[html()],css:[css()],scss:[css()],py:[python()],java:[java()],cpp:[cpp()],c:[cpp()],php:[php()],rs:[rust()],xml:[xml()],yaml:[yaml()],yml:[yaml()],md:[markdown()],sql:[sql()],sh:[markdown()],bash:[markdown()]})[r]||[],"getLanguageExtension");function yn(){let[r,o]=useState(()=>typeof document<"u"?document.documentElement.classList.contains("dark"):false);return useEffect(()=>{let n=new MutationObserver(()=>{o(document.documentElement.classList.contains("dark"));});return n.observe(document.documentElement,{attributes:true,attributeFilter:["class"]}),()=>n.disconnect()},[]),r}a(yn,"useIsDarkMode");var Pr=a(({url:r,extension:o})=>{let[n,a$1]=useState(""),[d,s]=useState(true),[h,x]=useState(null),[k,N]=useState(0),M=useRef(null),f=yn();if(useEffect(()=>{a(async()=>{try{s(!0),x(null);let I=await fetch(r);if(!I.ok)throw new Error(`Failed to load file: ${I.statusText}`);let S=await I.text();if(o==="json")try{S=JSON.stringify(JSON.parse(S),null,2);}catch{}a$1(S);}catch(I){x(I instanceof Error?I.message:"Failed to load text content");}finally{s(false);}},"loadTextContent")();},[r]),useEffect(()=>{let t=a(()=>{if(M.current){let I=M.current.clientHeight;N(I);}},"updateHeight");return t(),window.addEventListener("resize",t),()=>{window.removeEventListener("resize",t);}},[d]),d)return jsx("div",{className:"flex items-center justify-center p-8.5",children:jsx("div",{className:"text-gray-500 dark:text-gray-400",children:"Loading text content..."})});if(h)return jsx("div",{className:"flex items-center justify-center p-8.5",children:jsxs("div",{className:"text-red-500",children:["Error: ",h]})});if(o==="md")return jsx("div",{ref:M,className:"h-full w-full overflow-auto p-5 prose dark:prose-invert max-w-[100%] select-text prose-table px-8.5",style:{wordBreak:"break-word"},children:jsx(mn,{remarkPlugins:[bn],children:n})});let B=vn(o);return jsx("div",{ref:M,className:"h-full w-full",children:k>0&&jsx(nn,{value:n,theme:f?vscodeDark:vscodeLight,extensions:B,editable:false,height:`${k}px`,basicSetup:{lineNumbers:true,highlightActiveLineGutter:false,highlightActiveLine:false,foldGutter:true,dropCursor:false,indentOnInput:false,syntaxHighlighting:true,bracketMatching:true,closeBrackets:false,autocompletion:false,rectangularSelection:false,crosshairCursor:false,highlightSelectionMatches:false,closeBracketsKeymap:false,searchKeymap:false,foldKeymap:true,completionKeymap:false,lintKeymap:false}})})},"TextDriver");var Er=a(({url:r})=>jsx("div",{className:"flex flex-col justify-center items-center w-full h-full px-8.5",children:jsx("video",{controls:true,src:r,className:"w-full max-h-full"})}),"VideoDriver");var St=class{static{a(this,"LruChunkCache");}cache=new Map;pinned=new Set;maxSize;constructor(o=8){this.maxSize=o;}get(o){let n=this.cache.get(o);return n!==void 0&&(this.cache.delete(o),this.cache.set(o,n)),n}set(o,n){if(this.cache.delete(o),this.cache.size>=this.maxSize){for(let a of this.cache.keys())if(!this.pinned.has(a)){this.cache.delete(a);break}}this.cache.set(o,n);}pin(o){this.pinned.clear();for(let n of o)this.pinned.add(n);this.pinned.size>this.maxSize&&(this.maxSize=this.pinned.size+4);}clear(){this.cache.clear(),this.pinned.clear();}};var Ye="chunks",jt=class{static{a(this,"IndexedDBStore");}db;sessionId;dbName;constructor(o,n,a){this.db=o,this.sessionId=n,this.dbName=a;}async set(o,n){return new Promise((a,d)=>{let s=this.db.transaction(Ye,"readwrite");s.objectStore(Ye).put(n,o),s.oncomplete=()=>a(),s.onerror=()=>d(s.error);})}async get(o){return new Promise((n,a)=>{let s=this.db.transaction(Ye,"readonly").objectStore(Ye).get(o);s.onsuccess=()=>n(s.result??void 0),s.onerror=()=>a(s.error);})}async clear(){return new Promise((o,n)=>{let a=this.db.transaction(Ye,"readwrite");a.objectStore(Ye).clear(),a.oncomplete=()=>o(),a.onerror=()=>n(a.error);})}async destroy(){return this.db.close(),new Promise((o,n)=>{let a=indexedDB.deleteDatabase(this.dbName);a.onsuccess=()=>o(),a.onerror=()=>n(a.error),a.onblocked=()=>o();})}},Ft=class{static{a(this,"MemoryStore");}sessionId=null;chunks=new Map;async set(o,n){this.chunks.set(o,n);}async get(o){return this.chunks.get(o)}async clear(){this.chunks.clear();}async destroy(){this.chunks.clear();}};async function Nr(){let r=`${Date.now()}_${Math.random().toString(36).slice(2)}`,o=`csv-chunks-${r}`;try{let n=await new Promise((a,d)=>{let s=indexedDB.open(o,1);s.onupgradeneeded=()=>{let h=s.result;h.objectStoreNames.contains(Ye)||h.createObjectStore(Ye);},s.onsuccess=()=>a(s.result),s.onerror=()=>d(s.error);});return new jt(n,r,o)}catch{return console.warn("IndexedDB unavailable, falling back to in-memory storage"),new Ft}}a(Nr,"createChunkStore");function Dn(r){let o=[],n=false,a=0,d=0;for(let s=0;s<r.length;s++){let h=r[s];if(h==='"')n=!n;else if(!n&&(h===`
|
|
83
|
+
`||h==="\r"&&r[s+1]!==`
|
|
84
|
+
`)){let x=s,k=r.slice(a,x).replace(/\r$/,"");k&&o.push(k),a=s+1,d=s+1;}}return [o,r.slice(d)]}a(Dn,"splitCsvRows");function Cn(r,o){return r.stream?Promise.resolve(r.stream):r.blob?Promise.resolve(r.blob.stream()):r.url?fetch(r.url,{signal:o}).then(n=>{if(!n.ok)throw new Error(`HTTP ${n.status}`);return n.body}):Promise.reject(new Error("No source provided"))}a(Cn,"resolveStream");function Lr(r){let[o,n]=useState("idle"),[a,d]=useState(0),[s,h]=useState([]),[x,k]=useState(null),[N,M]=useState(0),[f,L]=useState(0),B=useRef(r),t=useRef(0),I=useRef(0),S=useRef(""),p=useRef(new St(10)),F=useRef(null),P=useRef(null),T=useRef(new Set),$=useRef(null),Y=useRef(false),ne=useCallback((H,V)=>{let W=H+`
|
|
85
85
|
`+V.join(`
|
|
86
|
-
`),{data:Z}=Bt.parse(W,{header:true,dynamicTyping:false,skipEmptyLines:true});return Z},[]),re=useCallback(async(H,V)=>{let W=
|
|
86
|
+
`),{data:Z}=Bt.parse(W,{header:true,dynamicTyping:false,skipEmptyLines:true});return Z},[]),re=useCallback(async(H,V)=>{let W=F.current;if(!W)return;let Z=Math.max(0,Math.floor(H/1e3)-2),oe=Math.min(t.current-1,Math.floor(V/1e3)+2),ae=false;for(let X=Z;X<=oe;X++)if(p.current.get(X)===void 0&&!T.current.has(X)){T.current.add(X);try{let Q=await W.get(X);if(Q&&S.current){let de=ne(S.current,Q);p.current.set(X,de),ae=!0;}}finally{T.current.delete(X);}}ae&&L(X=>X+1);},[ne]),se=useCallback(H=>{let V=Math.floor(H/1e3),W=H%1e3;return p.current.get(V)?.[W]},[f]),ye=useCallback(async()=>{Y.current=true;let H=new AbortController;P.current=H,await F.current?.destroy();let V=await Nr();F.current=V,t.current=0,I.current=0,S.current="",p.current.clear(),h([]),d(0),k(null),M(0),n("loading");let W=B.current;try{let Z=await Cn(W,H.signal);n("streaming");let oe=Z.getReader(),ae=new TextDecoder("utf-8"),X="",Q=[],de=!0,ce=0,ue=0,Se=W.blob?.size||0;for(;;){if(H.signal.aborted)return;let{done:_e,value:qe}=await oe.read();if(_e)break;ce+=qe.byteLength,Se&&M(ce/Se),X+=ae.decode(qe,{stream:!0});let[Ee,Fe]=Dn(X);if(Ee.length!==0){if(X=Fe,de&&Ee.length>0){S.current=Ee.shift().replace(/^\uFEFF/,"");let{data:Ce}=Bt.parse(S.current,{});Ce[0]&&h(Ce[0]),de=!1;}for(let Ce of Ee)if(Ce.trim()&&(Q.push(Ce),Q.length>=1e3)){let Me=t.current;if(await V.set(Me,Q),Me<3){let Ne=ne(S.current,Q);p.current.set(Me,Ne);}t.current+=1,ue+=Q.length,Q=[],I.current=ue,$.current||($.current=requestAnimationFrame(()=>{d(I.current),$.current=null;}));}}}if(X.trim())if(de){S.current=X;let{data:_e}=Bt.parse(S.current,{});_e[0]&&h(_e[0]);}else Q.push(X);Q.length>0&&(await V.set(t.current,Q),t.current+=1,ue+=Q.length),$.current&&(cancelAnimationFrame($.current),$.current=null),d(ue),M(1),n("done");}catch(Z){if(H.signal.aborted)return;let oe=Z instanceof Error?Z.message:"Unknown error";k(oe),n("partial_error");}finally{Y.current=false;}},[ne]),le=useRef(false);useEffect(()=>(le.current=true,Y.current||ye(),()=>{le.current=false,queueMicrotask(()=>{le.current||(P.current?.abort(),F.current?.destroy(),$.current&&cancelAnimationFrame($.current));});}),[ye]);let we=F.current?.sessionId??null,ve=t.current,q=useCallback(H=>{p.current.pin(H);},[]);return {state:o,headers:s,totalRows:a,getRow:se,error:x,progress:N,prefetchRange:re,sessionId:we,chunkCount:ve,pinChunks:q}}a(Lr,"useCsvStream");var Mn=`
|
|
87
87
|
const DB_VERSION = 1;
|
|
88
88
|
const STORE_NAME = 'chunks';
|
|
89
89
|
|
|
@@ -169,16 +169,16 @@ self.onmessage = async (e) => {
|
|
|
169
169
|
}
|
|
170
170
|
}
|
|
171
171
|
};
|
|
172
|
-
`,
|
|
172
|
+
`,st=null,ct=null;function Ot(){if(!st){let r=new Blob([Mn],{type:"application/javascript"});ct=URL.createObjectURL(r),st=new Worker(ct);}return st}a(Ot,"getSearchWorker");function Ir(){st?.terminate(),st=null,ct&&(URL.revokeObjectURL(ct),ct=null);}a(Ir,"terminateSearchWorker");function zr(r,o){let[n,a]=useState(""),[d,s]=useState("idle"),[h,x]=useState(null),[k,N]=useState({searched:0,total:0,found:0}),M=useRef(null),f=useCallback(t=>{if(!r||o===0)return;if(!t.trim()){x(null),s("idle"),N({searched:0,total:0,found:0});return}s("searching"),N({searched:0,total:o,found:0});let I=Ot();I.onmessage=S=>{let{type:p}=S.data;p==="progress"&&N({searched:S.data.searched,total:S.data.total,found:S.data.found}),p==="done"&&(x(S.data.matchedIndices),s("done")),p==="cancelled"&&s("idle"),p==="error"&&(s("idle"),console.error("Search worker error:",S.data.message));},I.postMessage({type:"cancel"}),I.postMessage({type:"search",sessionId:r,query:t,chunkCount:o,chunkSize:1e3});},[r,o]),L=useCallback(t=>{a(t),M.current&&clearTimeout(M.current),M.current=setTimeout(()=>{f(t);},300);},[f]),B=useCallback(()=>{a(""),x(null),s("idle"),N({searched:0,total:0,found:0}),Ot().postMessage({type:"cancel"});},[]);return useEffect(()=>()=>{M.current&&clearTimeout(M.current),Ir();},[]),{query:n,onQueryChange:L,clearSearch:B,searchState:d,matchedIndices:h,searchProgress:k}}a(zr,"useCsvSearch");var _n={loading:"Loading...",rows:"rows",retry:"Retry",searchPlaceholder:"Search...",searchFound:"found",searching:"Searching..."};function An(r,o,n){let a=1/0,d=-1/0,s=Math.min(n,r.length-1);for(let h=o;h<=s;h++){let x=r[h];x<a&&(a=x),x>d&&(d=x);}return {min:a,max:d}}a(An,"getMinMax");function jn(r,o,n){let a=Math.min(100,n),d=r.map(()=>[]);for(let s=0;s<a;s++){let h=o(s);if(h)for(let x=0;x<r.length;x++){let k=h[r[x]]??"";d[x].push(k.length);}}return r.map((s,h)=>{let x=s.length*9,k=d[h];if(k.length===0)return Math.min(Math.max(150,x+24),800);k.sort((B,t)=>B-t);let N=Math.floor(k.length*.9),f=k[N]*7.5+24,L=Math.max(x+24,f);return Math.min(Math.max(50,L),800)})}a(jn,"estimateColumnWidths");var $t=a(r=>{let{state:o,headers:n,totalRows:a$1,getRow:d,error:s,progress:h,prefetchRange:x,sessionId:k,chunkCount:N,pinChunks:M}=Lr(r),f={..._n,...r.labels},{query:L,onQueryChange:B,clearSearch:t,searchState:I,matchedIndices:S}=zr(k,N),p=S!==null,F=p?S.length:a$1,[P,T]=useState([]),$=useRef(null),Y=useRef(null),ne=useRef(false),re=useRef(false);useEffect(()=>{re.current=false,ne.current=false,T([]);},[k]),useEffect(()=>{if(n.length===0||ne.current||re.current||a$1===0)return;let q=d(0);!q||!n.some(H=>q[H]!==void 0)||(re.current=true,T(jn(n,d,a$1)));},[n,a$1,d]),useEffect(()=>()=>Y.current?.(),[]);let se=useCallback((q,H)=>{q.preventDefault(),ne.current=true;let V=q.clientX,W=P[H]??150;$.current={index:H,startX:V,startWidth:W};let Z=a(ae=>{if(!$.current)return;let X=ae.clientX-V,Q=Math.max(50,W+X);T(de=>{let ce=[...de];return ce[H]=Q,ce});},"onMouseMove"),oe=a(()=>{$.current=null,Y.current=null,document.removeEventListener("mousemove",Z),document.removeEventListener("mouseup",oe);},"onMouseUp");Y.current=oe,document.addEventListener("mousemove",Z),document.addEventListener("mouseup",oe);},[P]),ye=P.reduce((q,H)=>q+H,0),le=useCallback(()=>jsx(On,{children:n.map((q,H)=>jsxs(Hn,{style:{width:P[H]},children:[q,jsx(Wn,{onMouseDown:V=>se(V,H)})]},H))}),[n,P,se]),we=useCallback(q=>{if(p&&S){let H=1/0,V=-1/0,W=new Set,Z=Math.min(q.endIndex,S.length-1);for(let oe=q.startIndex;oe<=Z;oe++){let ae=S[oe];ae<H&&(H=ae),ae>V&&(V=ae),W.add(Math.floor(ae/1e3));}M(Array.from(W)),H!==1/0&&x(H,V);}else M([]),x(q.startIndex,q.endIndex);},[x,M,p,S]),ve=useCallback(q=>{let H=p&&S?S[q]:q,V=d(H);return V?n.map((W,Z)=>jsx(jr,{style:{width:P[Z]},children:V[W]??""},Z)):n.map((W,Z)=>jsx(jr,{style:{width:P[Z]},children:jsx(Yn,{})},Z))},[d,n,P,p,S]);return useEffect(()=>{if(F>0)if(p&&S){let{min:q,max:H}=An(S,0,50);q!==1/0&&x(q,H);}else x(0,50);},[F,p,S,x]),o==="idle"||o==="loading"||o==="streaming"?jsxs("div",{className:"flex flex-col items-center justify-center h-full gap-3",children:[jsx("div",{className:"h-10 w-10 rounded-full border-2 border-gray-200 dark:border-neutral-700 animate-spin border-s-transparent"}),o==="streaming"&&a$1>0&&jsxs(Ya,{variant:"body",color:"text.lighter",style:{fontSize:12},children:[f.loading," ",a$1.toLocaleString()," ",f.rows,h>0?` (${Math.round(h*100)}%)`:""]})]}):jsxs("div",{className:"h-full w-full flex flex-col",children:[jsxs("div",{className:"flex items-center justify-between px-4 py-2 gap-3",children:[jsx(Ya,{variant:"body",color:"text.lighter",style:{fontSize:12,whiteSpace:"nowrap"},children:`${F.toLocaleString()} ${p?f.searchFound:f.rows}${p?` / ${a$1.toLocaleString()}`:""}`}),jsxs(qn,{children:[jsx(Un,{type:"text",value:L,onChange:q=>B(q.target.value),placeholder:f.searchPlaceholder}),I==="searching"?jsx(Vn,{children:jsx(Kn,{})}):L?jsx(Zn,{onClick:t,type:"button",children:"\u2715"}):null]})]}),o==="partial_error"&&jsxs(pb,{className:"flex items-center justify-between mx-4 mb-2 px-3 py-2 rounded bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-900",children:[jsx(Ya,{variant:"body",className:"text-red-600 dark:text-red-400",style:{fontSize:12},children:s}),r.onRetry&&jsx(z,{onClick:()=>r.onRetry(s??""),variant:"outlined",size:"small",children:f.retry})]}),jsx("div",{className:"flex-1 min-h-0",children:n.length>0&&jsx(TableVirtuoso,{totalCount:F,increaseViewportBy:300,fixedHeaderContent:le,itemContent:ve,rangeChanged:we,style:{height:"100%"},components:{Table:a(({style:q,context:H,...V})=>jsx(Fn,{style:{...q,minWidth:"100%",width:ye},...V}),"Table"),TableHead:Bn,TableRow:a(({context:q,...H})=>jsx($n,{...H}),"TableRow")}},p?"filtered":"all")})]})},"CsvDriver"),Fn=styled.table(({theme:r})=>`
|
|
173
173
|
border-collapse: separate;
|
|
174
174
|
border-spacing: 0;
|
|
175
175
|
table-layout: fixed;
|
|
176
176
|
font-size: 13px;
|
|
177
177
|
background-color: ${r.colors.background};
|
|
178
|
-
`),
|
|
178
|
+
`),Bn=styled.thead(({theme:r})=>`
|
|
179
179
|
background-color: ${r.colors.background};
|
|
180
180
|
z-index: 1;
|
|
181
|
-
`),
|
|
181
|
+
`),On=styled.tr``,Hn=styled.th(({theme:r})=>`
|
|
182
182
|
position: relative;
|
|
183
183
|
text-align: left;
|
|
184
184
|
padding: 8px 12px;
|
|
@@ -193,7 +193,7 @@ self.onmessage = async (e) => {
|
|
|
193
193
|
&:last-child {
|
|
194
194
|
border-right: none;
|
|
195
195
|
}
|
|
196
|
-
`),
|
|
196
|
+
`),Wn=styled.div(({theme:r})=>`
|
|
197
197
|
position: absolute;
|
|
198
198
|
right: 0;
|
|
199
199
|
top: 0;
|
|
@@ -205,7 +205,7 @@ self.onmessage = async (e) => {
|
|
|
205
205
|
background-color: ${r.colors.primary?.light};
|
|
206
206
|
opacity: 0.4;
|
|
207
207
|
}
|
|
208
|
-
`)
|
|
208
|
+
`),$n=styled.tr(({theme:r})=>`
|
|
209
209
|
&:hover {
|
|
210
210
|
background-color: ${r.colors.backgroundBase};
|
|
211
211
|
}
|
|
@@ -219,20 +219,20 @@ self.onmessage = async (e) => {
|
|
|
219
219
|
&:last-child {
|
|
220
220
|
border-right: none;
|
|
221
221
|
}
|
|
222
|
-
`),
|
|
222
|
+
`),Xn=keyframes`
|
|
223
223
|
0%, 100% { opacity: 0.4; }
|
|
224
224
|
50% { opacity: 1; }
|
|
225
|
-
|
|
225
|
+
`,Yn=styled.div(({theme:r})=>css$1`
|
|
226
226
|
height: 12px;
|
|
227
227
|
width: 60%;
|
|
228
228
|
background: ${r.colors.stroke.light};
|
|
229
229
|
border-radius: 4px;
|
|
230
|
-
animation: ${
|
|
231
|
-
`),
|
|
230
|
+
animation: ${Xn} 1.5s ease-in-out infinite;
|
|
231
|
+
`),qn=styled.div`
|
|
232
232
|
position: relative;
|
|
233
233
|
width: 200px;
|
|
234
234
|
flex-shrink: 0;
|
|
235
|
-
`,
|
|
235
|
+
`,Un=styled.input(({theme:r})=>`
|
|
236
236
|
padding: 4px 24px 4px 8px;
|
|
237
237
|
font-size: 12px;
|
|
238
238
|
border: 1px solid ${r.colors.stroke.light};
|
|
@@ -242,7 +242,7 @@ self.onmessage = async (e) => {
|
|
|
242
242
|
&:focus {
|
|
243
243
|
border-color: ${r.colors.primary?.main};
|
|
244
244
|
}
|
|
245
|
-
`),
|
|
245
|
+
`),Zn=styled.button(({theme:r})=>`
|
|
246
246
|
position: absolute;
|
|
247
247
|
right: 6px;
|
|
248
248
|
top: 50%;
|
|
@@ -257,23 +257,23 @@ self.onmessage = async (e) => {
|
|
|
257
257
|
&:hover {
|
|
258
258
|
color: ${r.colors.text?.main};
|
|
259
259
|
}
|
|
260
|
-
`),
|
|
260
|
+
`),Vn=styled.div`
|
|
261
261
|
position: absolute;
|
|
262
262
|
right: 6px;
|
|
263
263
|
top: 50%;
|
|
264
264
|
transform: translateY(-50%);
|
|
265
265
|
display: flex;
|
|
266
266
|
align-items: center;
|
|
267
|
-
`,
|
|
267
|
+
`,Gn=keyframes`
|
|
268
268
|
to { transform: rotate(360deg); }
|
|
269
|
-
`,
|
|
269
|
+
`,Kn=styled.div(({theme:r})=>css$1`
|
|
270
270
|
width: 14px;
|
|
271
271
|
height: 14px;
|
|
272
272
|
border: 2px solid ${r.colors.stroke.light};
|
|
273
273
|
border-top-color: ${r.colors.text?.light};
|
|
274
274
|
border-radius: 50%;
|
|
275
|
-
animation: ${
|
|
276
|
-
`);var Wr=memo(a(function({extension:o,blob:n,path:a,buffer:d,stream:
|
|
275
|
+
animation: ${Gn} 0.6s linear infinite;
|
|
276
|
+
`);var Wr=memo(a(function({extension:o,blob:n,path:a,buffer:d,stream:s,csvLabels:h,onCsvRetry:x,not_supported_message:k=" Sorry, this file type isn\u2019t supported yet."}){let N=o.toLocaleLowerCase().trim(),M;if(a?M=a:n&&(M=URL.createObjectURL(n)),["csv","tsv"].includes(N))return jsx($t,{url:M,blob:n,stream:s,labels:h,onRetry:x});if(M){if(["jpeg","jpg","png","gif","bmp","webp"].includes(N))return jsx(br,{url:M});if(["mp3","wav","ogg","flac"].includes(N))return jsx(yr,{url:M});if(["mp4","webm"].includes(N))return jsx(Er,{url:M});if(o==="pdf")return jsx(zt,{url:M});if(["txt","js","jsx","ts","tsx","json","html","css","scss","py","java","cpp","c","cs","php","rb","go","rs","swift","kt","xml","yaml","yml","md","sql","sh","bash"].includes(N))return jsx(Pr,{url:M,extension:N})}return N==="docx"?jsx(Sr,{url:M,blob:n}):jsx("div",{className:"h-full flex flex-col justify-center items-center",children:jsx(pb,{className:"mx-5",children:jsx(Ya,{variant:"h2",color:"text.light",weight:500,className:"text-center",children:k})})})},"Driver"));var Xd=a(r=>jsx("div",{className:"h-full w-full",children:jsx(Wr,{...r})}),"FileViewer");var Yr=250,ru=a(({text:r,speed:o=50,onDone:n,markdown:a$1=false,markdownComponents:d={},className:s,...h})=>{let[x,k]=useState(""),N=useRef(null),M=useRef(null);return useEffect(()=>{let f=false;if(o>0){k(""),N.current=performance.now();let L=a(B=>{if(f||!N.current)return;let t=B-N.current,I=t/o>Yr?o/2:o,S=t/o>Yr?1.5:1,p=Math.floor(t/I*S);if(p>=r.length){k(r),f=true,n?.();return}k(r.slice(0,p)),M.current=requestAnimationFrame(L);},"tick");M.current=requestAnimationFrame(L);}else k(r),n?.();return ()=>{M.current&&cancelAnimationFrame(M.current);}},[r,o,n]),a$1?jsx("div",{className:s,children:jsx(mn,{remarkPlugins:[bn],components:d,...h,children:x})}):jsx(Ya,{className:s,...h,children:x})},"Typewriter");var ca={timeout:2e3,message:"Copied!"},gu=a(({text:r,children:o,format:n="text/plain",tooltip:a$1,positions:d=["top"],className:s})=>{let[h,x]=useState(false),k=useRef(null),N={...ca,...a$1},M=Array.isArray(d)?d[0]:d,f=a(async()=>{"clipboard"in navigator?await navigator.clipboard.writeText(r):oa(r,{format:n}),x(true),k.current&&clearTimeout(k.current),k.current=setTimeout(()=>x(false),N.timeout);},"handleCopy");return useEffect(()=>()=>{k.current&&clearTimeout(k.current);},[]),jsx(Popover,{padding:6,positions:d,isOpen:h,align:"center",onClickOutside:()=>x(false),content:!!a$1?.message&&jsx(Cb,{className:s,$position:M,$offset:6,children:a$1.message}),containerStyle:{zIndex:"9999"},children:jsx("div",{className:"inline-block",onMouseLeave:()=>x(false),children:o({copy:f})})})},"CopyToClipboard");var Ur=a(r=>new Date(r?Array.isArray(r)?r[1]||r[0]||new Date:r:new Date),"getInitValue"),Rt=a((r,o)=>{let n;if(o){let d=parse(r||"",o,new Date);if(isValid(d)&&getYear(d)>=1970)return d}let a=new Date(r||"");return isNaN(a.getTime())?n:a},"parseDate"),ba=a((r,o)=>{let n=r?Rt(r,o):void 0;return n&&o?format(n,o):r},"renderDate"),Pu=a(({value:r,range:o,inline:n=false,minDate:a=new Date(getYear(new Date)-5,0,1),maxDate:d=new Date(getYear(new Date)+5,11,31),format:s="dd.MM.yyyy",onChange:h,...x})=>{let[k,N]=useState(getMonth(Ur(r))),[M,f]=useState(getYear(Ur(r))),L=useMemo(()=>{if(r){if(Array.isArray(r)){let t=Rt(r[0],s),I=Rt(r[1],s);return [t,I]}return Rt(r,s)}},[r]),B=useCallback(t=>{if(o){let I=!!(L&&Array.isArray(L)&&L[0]),S=!!(L&&Array.isArray(L)&&L[1]);!I||I&&S?h?.([t.toString(),""]):I&&!S&&(t<L[0]?h?.([t.toString(),L[0].toString()]):h?.([L[0].toString(),t.toString()]));}else h?.(t.toString());},[o,L,h]);return n?jsx(Zr,{month:k,year:M,minDate:a,maxDate:d,selectedDate:L,onSelectDate:B,onChangeMonth:N,onChangeYear:f}):o?jsx(va,{range:true,value:r,onChange:h,...x}):jsx(ya,{value:r,onChange:h,minDate:a,maxDate:d,month:k,year:M,selectedDate:L,onChangeMonth:N,onChangeYear:f,onSelectDate:B,formatStr:s,...x})},"DatePicker"),va=a(({minDate:r,maxDate:o,value:n,onChange:a})=>null,"DatePickerGroupInput"),ya=a(({placeholder:r,value:o,onChange:n,inputProps:a,...d})=>{let[s,h]=useState(false),x=y();return jsx(Popover,{positions:["bottom","top","right","left"],align:"start",isOpen:s,onClickOutside:()=>h(false),content:jsx(pb,{children:jsx(Zr,{...d})}),containerStyle:{zIndex:`${x.zIndex.popover}`},children:jsx("div",{onClick:()=>h(true),children:jsx(kb,{...a,placeholder:r,value:ba(o,d.formatStr),onChange:k=>n?.(k.target.value)})})})},"DatePickerInput"),Zr=a(({month:r,year:o,selectedDate:n,minDate:a,maxDate:d,onSelectDate:s,onChangeMonth:h,onChangeYear:x})=>{let k=useMemo(()=>new Array(12).fill(null).map((p,F)=>{let P=new Date(0,F);return {value:F+1,inputDisplay:format(P,"MMMM")}}),[]),N=useMemo(()=>{let p=getYear(a),P=getYear(d)-p+1;return new Array(P).fill(null).map((T,$)=>{let Y=p+$;return {value:Y,inputDisplay:Y.toString()}})},[a,d]),M=useMemo(()=>new Array(7).fill(null).map((p,F)=>{let P=startOfWeek(new Date,{weekStartsOn:F});return format(P,"EEE")}),[]),f=useMemo(()=>{let p=startOfMonth(new Date(o,r)),F=endOfMonth(new Date(o,r)),P=getDay(p)===0?p:previousSunday(p),T=getDay(F)===6?F:nextSaturday(F),$=differenceInDays(T,P),Y=differenceInDays(p,P);return new Array($+1).fill(null).map((ne,re)=>new Date(o,r,re-Y+1))},[r,o]),L=useCallback(()=>{r===0?(x(o-1),h(11)):h(r-1);},[r,o]),B=useCallback(()=>{r===11?(x(o+1),h(0)):h(r+1);},[r,o]),t=useMemo(()=>a?!(o<getYear(a)||o===getYear(a)&&r<=getMonth(a)):true,[r,o,a]),I=useMemo(()=>d?!(o>getYear(d)||o===getYear(d)&&r>=getMonth(d)):true,[r,o,d]),S=useCallback(p=>{p.stopPropagation();},[]);return jsxs("div",{className:"flex flex-col date-picker-calendar",onClick:S,children:[jsxs("div",{className:"flex justify-center items-center gap-2 pb-3",children:[t&&jsx(z,{size:"small",variant:"empty",icon:jsx(G,{}),onClick:L}),jsxs("div",{className:"flex-1 flex justify-center gap-1",children:[jsx(ib,{placeholder:"",hasBorder:false,selected:r+1,options:k,onSelect:p=>h(p-1),maxWidth:150,maxHeight:300}),jsx(ib,{placeholder:"",hasBorder:false,selected:o,options:N,onSelect:p=>x(p),maxWidth:100,maxHeight:300})]}),I&&jsx(z,{size:"small",variant:"empty",icon:jsx(H,{}),onClick:B})]}),jsx("div",{className:"grid grid-cols-7 gap-2",children:M.map(p=>jsx("div",{className:"text-center",children:p},p))}),jsx("div",{className:"grid grid-cols-7 gap-2 mt-2",children:f.map(p=>{let F=getMonth(p)===r,P=format(p,"yyyy-MM-dd")===format(new Date,"yyyy-MM-dd"),T=n&&(Array.isArray(n)&&(n[0]&&format(p,"yyyy-MM-dd")===format(n[0],"yyyy-MM-dd")||n[1]&&format(p,"yyyy-MM-dd")===format(n[1],"yyyy-MM-dd"))||!Array.isArray(n)&&format(p,"yyyy-MM-dd")===format(n,"yyyy-MM-dd")),$=n&&Array.isArray(n)&&n[0]&&n[1]&&p>n[0]&&p<n[1],Y=a&&differenceInDays(p,a)<0||d&&differenceInDays(p,d)>0||!F;return jsx(wa,{date:p,isCurrentMonth:F,isCurrentDay:P,isSelected:!!T,isInRange:!!$,isDisabled:!!Y,onSelectDate:s},p.toISOString())})})]})},"DatePickerCalendar"),wa=a(({date:r,isCurrentMonth:o,isCurrentDay:n,isSelected:a$1,isInRange:d,isDisabled:s,onSelectDate:h})=>jsx("div",{className:`text-center p-2 cursor-pointer rounded ${s?"text-gray-400 dark:text-neutral-600 cursor-not-allowed":a$1?"bg-blue-500 text-white":d?"bg-blue-100 dark:bg-blue-900/30":n?"text-blue-500":o?"text-black dark:text-white":"text-gray-400 dark:text-neutral-600"} ${s?"":a$1?"hover:bg-blue-600":"hover:bg-gray-100 dark:hover:bg-neutral-700"}`,onClick:a(k=>{s||h(r);},"handleClick"),children:format(r,"d")}),"CalendarDay");var Sa=a(r=>{switch(r){case "primary":return "bg-blue-100 border-blue-200 dark:bg-blue-800/10 dark:border-blue-900";case "error":return "bg-red-100 border-red-200 dark:bg-red-800/10 dark:border-red-900";case "warning":return "bg-yellow-100 border-yellow-200 dark:bg-yellow-800/10 dark:border-yellow-900";case "success":return "bg-teal-100 border-teal-200 dark:bg-teal-800/10 dark:border-teal-900";case "default":default:return "bg-white border border-gray-200 dark:bg-neutral-800 dark:border-neutral-700"}},"getColorStyle"),Da=a(r=>{switch(r){case "primary":return "text-blue-800 dark:text-blue-500";case "error":return "text-red-800 dark:text-red-500";case "warning":return "text-yellow-800 dark:text-yellow-500";case "success":return "text-teal-800 dark:text-teal-500";case "default":default:return "text-gray-800 dark:text-white"}},"getTextColor"),Ca=a(r=>{switch(r){case "bottom":return "translate-y-4";case "top":default:return "-translate-y-4"}},"getTransitionStarting"),Jr=a(({id:r,color:o="default",message:n,duration:a,transitionDirection:d,cancelable:s=true,onClose:h})=>{let[x,k]=useState(false),[N,M]=useState(false),f=useRef(null),L=useCallback(()=>{k(true),f.current=setTimeout(()=>{h(r);},300);},[r,h]);return useEffect(()=>{if(M(true),a&&a<1/0){let B=setTimeout(()=>{L();},a);return ()=>clearTimeout(B)}},[a,L]),useEffect(()=>()=>{f.current&&clearTimeout(f.current);},[]),jsx("div",{className:`max-w-xs
|
|
277
277
|
border
|
|
278
278
|
w-full
|
|
279
279
|
text-sm
|
|
@@ -281,8 +281,8 @@ self.onmessage = async (e) => {
|
|
|
281
281
|
transition-all
|
|
282
282
|
ease-in-out
|
|
283
283
|
duration-300
|
|
284
|
-
${x||!
|
|
285
|
-
${
|
|
286
|
-
${
|
|
287
|
-
export{
|
|
284
|
+
${x||!N?"opacity-0":"opacity-100"}
|
|
285
|
+
${N?"translate-y-0":Ca(d)}
|
|
286
|
+
${Sa(o)} ${Da(o)}`,children:jsxs("div",{className:"flex p-4",style:{wordBreak:"break-word"},children:[n,s&&jsx("div",{className:"ms-auto",children:jsx("button",{type:"button",className:"inline-flex shrink-0 justify-center items-center size-5 rounded-lg opacity-50 hover:opacity-100 focus:outline-hidden focus:opacity-100 cursor-pointer","aria-label":"Close",onClick:L,children:jsxs("svg",{className:"shrink-0 size-4",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",children:[jsx("path",{d:"M18 6 6 18"}),jsx("path",{d:"m6 6 12 12"})]})})})]})})},"Toast");var Pa=a((r,o)=>{switch(r){case "top-right":return `top-${o} right-${o}`;case "top-left":return `top-${o} left-${o}`;case "bottom-right":return `bottom-${o} right-${o}`;case "bottom-left":return `bottom-${o} left-${o}`;default:return `top-${o} right-${o}`}},"getPosition"),Ou=a(({items:r,onClose:o,position:n="top-right",offset:a=4})=>{let d=useMemo(()=>n.startsWith("top")?"top":"bottom",[n]);return jsx("div",{className:`fixed flex min-w-0 max-w-xs w-full flex-col z-50 gap-2 ${Pa(n,a)}`,children:r.map(s=>jsx(Jr,{transitionDirection:d,...s,onClose:o},s.id))})},"ToastsList");var Gu=a(({onChange:r,disabled:o,multiple:n,dragText:a$1="Drop file to upload",className:d})=>{let[s,h]=useState(false),[x,k]=useState(false),[N,M]=useState(false);return useEffect(()=>{if(o)return;let f=0,L=a(S=>{S.preventDefault(),f++,f===1&&h(true);},"handleDragEnter"),B=a(S=>{S.preventDefault(),f--,f===0&&h(false);},"handleDragLeave"),t=a(S=>{S.preventDefault();},"handleDragOver"),I=a(async S=>{if(S.preventDefault(),f=0,h(false),!x)try{k(!0);let p=await lb(S.dataTransfer.items);r(n?p:p.length>0?[p[0]]:[]);}catch(p){console.error("\u041F\u043E\u043C\u0438\u043B\u043A\u0430 \u043F\u0440\u0438 \u0447\u0438\u0442\u0430\u043D\u043D\u0456 \u0444\u0430\u0439\u043B\u0456\u0432:",p);}finally{k(false);}},"handleDrop");return document.addEventListener("dragenter",L),document.addEventListener("dragleave",B),document.addEventListener("dragover",t),document.addEventListener("drop",I),()=>{document.removeEventListener("dragenter",L),document.removeEventListener("dragleave",B),document.removeEventListener("dragover",t),document.removeEventListener("drop",I);}},[o,x,n,r]),useEffect(()=>{M(true);},[]),N&&s?createPortal(jsx("div",{className:`fixed top-0 bottom-0 left-0 right-0 flex items-center justify-center bg-[rgba(251,250,250,0.9)] dark:bg-[rgba(12,10,18,0.9)] z-9999 ${d}`,children:jsx(Ya,{variant:"h3",className:"px-3 py-2 bg-white dark:bg-neutral-800 rounded-md border border-gray-200 dark:border-neutral-700",children:a$1})}),document.body):null},"GlobalDropZone");
|
|
287
|
+
export{vc as Container,gu as CopyToClipboard,Pu as DatePicker,Zr as DatePickerCalendar,Xd as FileViewer,tl as FullscreenCard,Gu as GlobalDropZone,Wo as Graph2D,rc as PageContent,Ks as PageLayout,Dc as SplitterLayout,lo as Styled,oo as StyledContainer,io as StyledMain,sc as SubNav,Ou as ToastsList,ru as Typewriter};//# sourceMappingURL=index.mjs.map
|
|
288
288
|
//# sourceMappingURL=index.mjs.map
|