@cyber-harbour/ui 2.0.49 → 2.0.51
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-XMGFZKNY.mjs → PdfDriver-7VZZUN7X.mjs} +3 -3
- package/dist/{PdfDriver-XMGFZKNY.mjs.map → PdfDriver-7VZZUN7X.mjs.map} +1 -1
- package/dist/{PdfDriver-TFX6EQFN.js → PdfDriver-VUIDQV2Z.js} +3 -3
- package/dist/{PdfDriver-TFX6EQFN.js.map → PdfDriver-VUIDQV2Z.js.map} +1 -1
- package/dist/{chunk-YDKJRUAI.mjs → chunk-5EVUUSQ3.mjs} +69 -69
- package/dist/chunk-5EVUUSQ3.mjs.map +1 -0
- package/dist/{chunk-ILBNDLIL.js → chunk-TAKANP3V.js} +128 -128
- package/dist/chunk-TAKANP3V.js.map +1 -0
- package/dist/index.css +1 -1
- package/dist/index.css.map +1 -1
- package/dist/index.d.mts +16 -2
- package/dist/index.d.ts +16 -2
- package/dist/index.js +19 -19
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +18 -18
- 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/chunk-ILBNDLIL.js.map +0 -1
- package/dist/chunk-YDKJRUAI.mjs.map +0 -1
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {a,w,x,u,c,l,z,Pa,mb,ma,Wa,yb,y,ib,G,gb,H}from'./chunk-
|
|
1
|
+
import {a,w,x,u,c,l,z,Pa,mb,ma,Wa,yb,y,ib,G,gb,H}from'./chunk-5EVUUSQ3.mjs';export{qb as Alert,A as AlertIcon,za as AndroidIcon,B as ApiIcon,C as ArrowCircleTopRightIcon,D as ArrowRightIcon,ia as BallsMenu,mb as Box,q as BreakpointProvider,E as BugReportIcon,Na as BurgerMenuIcon,sa as BusIcon,z as Button,F as CalendarIcon,ta as CarIcon,Gb as ChatField,ja as CheckIcon,sb as Checkbox,ka as ChevronDownIcon,G as ChevronLeftIcon,H as ChevronRightIcon,la as ChevronUpIcon,Oa as ClockIcon,I as CloseCircleIcon,J as ClosedLockIcon,zb as ContentLoader,db as ContextMenu,eb as ContextMenuDelimiter,qa as CrossIcon,K as DataSetsIcon,L as DeepSearchIcon,M as DisabledVisibleIcon,N as DocsIcon,O as DownloadIcon,vb as Drawer,xb as DrawerBody,wb as DrawerHeader,P as EditUserIcon,ob as EmptyData,Q as EnableVisibleIcon,R as EnterArrowLeftIcon,jb as FileField,xa as FileIcon,S as FiltersIcon,Ia as FlashIcon,kb as FlexContainer,lb as FlexItem,Ba as FolderAlertIcon,Ja as FolderInfoIcon,_a as Header,$a as HeaderDelimeter,ab as HeaderSection,T as HomepageIcon,Qa as ImageIcon,oa as InfoCircleFilledIcon,U as InfoCircleIcon,ib as Input,ya as IosIcon,rb as Label,nb as Line,tb as LinerProgress,Xa as ListMenu,Ya as ListMenuItem,Za as ListMenuSection,V as MapRadarIcon,ra as MaximizeIcon,Aa as MicrosoftIcon,Pa as MinusIcon,Bb as Modal,Db as ModalBody,Eb as ModalFooter,Cb as ModalHeader,W as MoonIcon,X as OpenLockIcon,Y as OrganizationIcon,Ab as Overlay,cb 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,Hb as ProgressLoader,Ca as RelationIcon,Da as RelationPointsIcon,Ka as RotateLeftIcon,La as RotateRightIcon,hb as RowActionsMenu,ca as SandBoxIcon,da as SearchIcon,gb as Select,wa as ShipIcon,Sa as Sidebar,Ra as SidebarContext,Ua as SidebarDelimeter,Ta as SidebarItem,Va as SidebarSection,ea as StatisticIcon,fa as SunIcon,ub as Switch,bb as Table,pb as Tag,Fb as TailwindExample,s as ThemeProvider,yb as Tooltip,Wa 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,fb as useContextMenuControl,y as useTheme}from'./chunk-5EVUUSQ3.mjs';import xr,{styled,useTheme}from'styled-components';export{ServerStyleSheet,StyleSheetManager}from'styled-components';import {jsx,jsxs,Fragment as Fragment$1}from'react/jsx-runtime';import Lt,{useState,useRef,useCallback,useEffect,Fragment,forwardRef,useMemo,useImperativeHandle,useLayoutEffect,memo}from'react';import Ir from'lodash.clonedeep';import {scaleOrdinal,schemeCategory10,forceSimulation,forceLink,forceManyBody,forceX,forceY,forceCenter,forceCollide}from'd3';import wr from'react-content-loader';import {renderAsync}from'docx-preview';import {Prism}from'react-syntax-highlighter';import {darcula}from'react-syntax-highlighter/dist/esm/styles/prism';import lo from'react-markdown';import uo from'remark-gfm';import po from'copy-to-clipboard';import {parse,isValid,getYear,format,getMonth,startOfWeek,getWeeksInMonth,startOfMonth,previousMonday,differenceInDays}from'date-fns';import {Popover}from'react-tiny-popover';var oi=a(({children:r,className:o})=>jsx(nr,{className:o,children:r}),"PageLayout"),nr=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,mb,ma,Wa,yb,y,ib,G,gb,H}from'./chunk-YDKJRUAI.mjs';expo
|
|
|
9
9
|
& > header {
|
|
10
10
|
grid-area: header;
|
|
11
11
|
}
|
|
12
|
-
`;var
|
|
12
|
+
`;var ci=a(({children:r,className:o})=>jsx(sr,{className:o,children:r}),"PageContent"),sr=styled.main`
|
|
13
13
|
grid-area: content;
|
|
14
14
|
min-width: 0;
|
|
15
15
|
background: ${({theme:r})=>r.colors.backgroundBase};
|
|
16
|
-
`;var
|
|
16
|
+
`;var hi=a(({children:r,className:o,top:c=0})=>jsx(dr,{className:o,$top:c,onClick:p=>p.stopPropagation(),children:r}),"SubNav"),dr=styled.div(({theme:r,$top:o})=>`
|
|
17
17
|
display: flex;
|
|
18
18
|
flex-direction: column;
|
|
19
19
|
justify-content: space-between;
|
|
@@ -33,37 +33,37 @@ import {a,w,x,u,c,l,z,Pa,mb,ma,Wa,yb,y,ib,G,gb,H}from'./chunk-YDKJRUAI.mjs';expo
|
|
|
33
33
|
position: sticky;
|
|
34
34
|
border-right: 1px solid ${r.colors.stroke.light};
|
|
35
35
|
}
|
|
36
|
-
`);var
|
|
37
|
-
${u(r,"padding-inline",
|
|
36
|
+
`);var Pi=w(({maxWidth:r,...o})=>jsx(hr,{...o,$maxWidth:r})),hr=x(styled.div(({theme:r,$maxWidth:o,px:c$1=20})=>`
|
|
37
|
+
${u(r,"padding-inline",c$1)}
|
|
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
|
|
41
|
+
`),{ignoreStyles:["padding-inline"]});var vr=20,br="splitter_columns_widths",St=a((r,o,c)=>{let p=localStorage.getItem(r);if(p)try{let h=JSON.parse(p);if(Array.isArray(h)&&h.length===o)return h}catch{}else if(c.length===o)return c;return Array(o).fill(100/o)},"getSavedWidths"),Ii=a(({columns:r,initialWidths:o,layoutClassname:c="",splitterClassname:p="",minWidth:h=vr,storageKey:b=br})=>{let[g,S]=useState(()=>St(b,r.length,o)),I=useRef(null),R=useRef(null),A=useRef(h),x=useRef(g),T=useCallback(E=>{if(R.current===null||!I.current)return;let M=I.current.getBoundingClientRect(),D=M.width,K=E-M.left,q=[...x.current],de=R.current,Z=de+1,ue=q.slice(0,de).reduce((ve,De)=>ve+De,0),pe=K/D*100-ue,ke=q[de]+q[Z]-pe;pe>=A.current&&ke>=A.current&&(q[de]=pe,q[Z]=ke,S(q),x.current=q);},[]),V=useCallback(E=>T(E.clientX),[T]),t=useCallback(E=>{E.preventDefault(),T(E.touches[0].clientX);},[T]),$=useCallback(()=>{R.current=null,localStorage.setItem(b,JSON.stringify(x.current)),document.removeEventListener("mousemove",V),document.removeEventListener("mouseup",$),document.removeEventListener("touchmove",t),document.removeEventListener("touchend",$);},[V,t,b]),U=useCallback(E=>M=>{M.preventDefault(),R.current=E,document.addEventListener("mousemove",V,{passive:false}),document.addEventListener("mouseup",$);},[V,$]),k=useCallback(E=>M=>{M.preventDefault(),R.current=E,document.addEventListener("touchmove",t,{passive:false}),document.addEventListener("touchend",$);},[t,$]);return useEffect(()=>{let E=St(b,r.length,o);x.current=E,S(E);},[r.length,o,b]),jsx("div",{ref:I,className:`flex select-none ${c}`,children:r.map(({content:E,className:M},D)=>jsxs(Fragment,{children:[jsx("div",{className:M,style:{flex:`${g[D]} 1 0%`},children:E}),D<r.length-1&&jsx("div",{onMouseDown:U(D),onTouchStart:k(D),className:`hidden lg:flex! lg:sticky lg:top-0 border-s border-gray-200 ${p}`,children:jsx("span",{className:"absolute top-1/2 start-1/2 -translate-x-1/2 -translate-y-1/2 block w-4 h-6 flex justify-center items-center bg-white border border-gray-200 text-gray-400 rounded-md cursor-col-resize hover:bg-gray-100",children:jsxs("svg",{className:"shrink-0 size-3.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"})]})})})]},`${D}`))})},"SplitterLayout");var Dr=xr.div`
|
|
42
42
|
width: 100%;
|
|
43
43
|
height: 100%;
|
|
44
44
|
display: flex;
|
|
45
45
|
align-items: center;
|
|
46
46
|
justify-content: center;
|
|
47
|
-
`,gr=a(({width:r=280,height:o=280})=>{let d=useTheme();return jsx(hr,{children:jsxs(dr,{foregroundColor:d.contentLoader.foreground,backgroundColor:d.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"),wt=gr;var Se=typeof window<"u"&&window.devicePixelRatio||1;function Lr(r){return !r||r.length===0?[]:r.map(o=>{let d=new Image;d.src=o.img;let g=new Image;return g.src=o.hoverImg,{...o,normalImg:d,hoverImg:g}})}a(Lr,"prepareButtonImages");var j={fontSize:3,nodeSizeBase:30,nodeAreaFactor:2,textPaddingFactor:.9,gridSpacing:20,dotSize:1,maxZoom:4},Rr=forwardRef(({loading:r,width:o,height:d,graphData:g,buttons:y=[],onNodeClick:w,onBackgroundClick:f,onNodeHover:P,onLinkHover:L,onLinkClick:B},H)=>{let D=useTheme(),[I,Z]=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*Se,height:d*Se,animation:{id:null,buttonIndex:null},spinnerAngle:0}),{nodes:X,links:G}=useMemo(()=>wr(g),[g]),[k,V]=useState([]),T=useRef(null),M=useRef(null),K=useRef(null),te=scaleOrdinal(schemeCategory10),Vt=useCallback(()=>{if(!T.current)return false;try{let e=T.current.getContext("2d");return e?(K.current=e,!0):(console.error("Failed to get 2D context"),!1)}catch(e){return console.error("Error initializing Canvas 2D context:",e),false}},[]),Q=useCallback(()=>M.current?M.current.nodes():null,[]),me=useCallback(()=>{if(!M.current)return null;let e=M.current.force("link");return e?e.links():null},[]),Ve=useCallback(e=>{e.save(),e.setTransform(1,0,0,1,0,0);let{width:a,height:n}=t.current,i=j.gridSpacing,s=j.dotSize;e.fillStyle=D.graph2D.grid.dotColor;for(let u=i/2;u<=a;u+=i)for(let c=i/2;c<=n;c+=i)e.beginPath(),e.arc(u,c,s,0,2*Math.PI),e.fill();e.restore();},[D.graph2D.grid.dotColor,j.gridSpacing,j.dotSize]),qt=useCallback((e,a,n)=>{if(!e)return "";if(n.measureText(e).width<=a)return e;let s=e,u="...";for(;n.measureText(s+u).width>a&&s.length>0;)s=s.slice(0,-1);return s+u},[]),Ie=a(e=>{let n=Math.min(e,j.maxZoom)/j.maxZoom;return Math.max(j.fontSize*n,j.fontSize)},"calculateFontSize"),qe=useCallback(e=>{let a=me(),n=Q();!a||a.length===0||!n||n.length===0||(e.lineWidth=.5,e.globalAlpha=1,a.forEach(i=>{let s=typeof i.source=="object"?i.source:n.find(re=>re.id===i.source),u=typeof i.target=="object"?i.target:n.find(re=>re.id===i.target);if(!s||!u)return;let c={x:s.x||0,y:s.y||0},l={x:u.x||0,y:u.y||0},h=l.x-c.x,b=l.y-c.y,v=Math.sqrt(h*h+b*b),R=h/v,C=b/v,$=j.nodeSizeBase/2,z=j.nodeSizeBase/2,F=4,p={x:c.x+R*$,y:c.y+C*$},S={x:l.x-R*(z+F),y:l.y-C*(z+F)},x={x:l.x-R*(z+1),y:l.y-C*(z+1)},O=t.current.highlightLinks.has(i),A=O?D.graph2D.link.highlighted:D.graph2D.link.normal,W=O?1.5:.5,q=c.x+(l.x-c.x)/2,ne=c.y+(l.y-c.y)/2,ae=Math.atan2(b,h);if(i.label){let re=t.current.transform.k,ie=Ie(re);e.font=`${ie}px Sans-Serif`;let nt=e.measureText(i.label).width,at=10;e.beginPath(),e.moveTo(p.x,p.y);let it=v/2-(nt+at)/2,st={x:c.x+R*it,y:c.y+C*it};e.lineTo(st.x,st.y),e.strokeStyle=A,e.lineWidth=W,e.stroke(),e.beginPath();let ct=v/2+(nt+at)/2,lt={x:c.x+R*ct,y:c.y+C*ct};e.moveTo(lt.x,lt.y),e.lineTo(S.x,S.y),e.strokeStyle=A,e.lineWidth=W,e.stroke();}else e.beginPath(),e.moveTo(p.x,p.y),e.lineTo(S.x,S.y),e.strokeStyle=A,e.lineWidth=W,e.stroke();let he=2;if(e.save(),e.translate(x.x,x.y),e.rotate(ae),e.beginPath(),e.moveTo(0,0),e.lineTo(-4,he),e.lineTo(-4,0),e.lineTo(-4,-2),e.closePath(),e.fillStyle=A,e.fill(),e.restore(),i.label){let re=t.current.transform.k,ie=Ie(re);e.font=`${ie}px Sans-Serif`,e.textAlign="center",e.textBaseline="middle",e.save(),e.translate(q,ne),Math.abs(ae)>Math.PI/2?e.rotate(ae+Math.PI):e.rotate(ae),e.fillStyle=O?D.graph2D.link.highlightedTextColor:D.graph2D.link.textColor,e.fillText(i.label,0,0),e.restore();}}));},[j,D.graph2D.link]),Ue=a((e,a,n,i,s,u,c)=>{try{if(u!=null){let l=s*.8;e.font=`${l}px sans-serif`,e.textBaseline="middle",e.textAlign="left";let h=new Intl.NumberFormat("en",{notation:"compact",maximumFractionDigits:1,minimumFractionDigits:0,compactDisplay:"short"}).format(u),b=e.measureText(h).width,v=s*.3,C=(s+v+b)/2;e.drawImage(a,n-C,i-s/2,s,s),e.fillStyle=c||"#99989C",e.fillText(h,n-C+s+v,i);}else e.drawImage(a,n-s/2,i-s/2,s,s);}catch(l){console.warn("Error rendering icon:",l);}},"drawIconWithOptionalCounter"),Ze=useCallback((e,a)=>{if(!k||k.length===0||!e||!e.x||!e.y)return;let{x:n,y:i}=e,s=j.nodeSizeBase*j.nodeAreaFactor/2;a.save();let u=Math.min(k.length,8),c=Math.min(Math.PI*2/u,Math.PI);for(let l$1=0;l$1<u;l$1++){let h=l$1*c,b=(l$1+1)*c,v=t.current.hoveredButtonIndex===l$1;a.beginPath(),a.arc(n,i,s,h,b,false),a.lineTo(n,i),a.closePath(),a.lineWidth=1,a.strokeStyle=D.graph2D?.button?.stroke||"#FFFFFF",a.stroke(),a.fillStyle=v?D.graph2D?.button?.hoverFill||"rgba(255, 255, 255, 0.3)":D.graph2D?.button?.normalFill||"rgba(255, 255, 255, 0.1)",a.fill();let R=s*.2,C=(h+b)/2,$=s-j.nodeSizeBase/2+R,z=n+Math.cos(C)*$,F=i+Math.sin(C)*$,p=k[l$1];if(p.loading){let S=R/2,x=R/12;a.save(),a.translate(z,F),a.rotate(t.current.spinnerAngle);for(let O=0;O<12;O++){let A=Math.PI*2*O/12,W=O/12,q=Math.cos(A)*S,ne=Math.sin(A)*S;a.beginPath(),a.fillStyle=l(D.graph2D?.button?.spinnerColor,W),a.arc(q,ne,x,0,Math.PI*2),a.fill();}a.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(_),t.current.animation.buttonIndex=l$1;}else {t.current.animation.id&&t.current.animation.buttonIndex===l$1&&(cancelAnimationFrame(t.current.animation.id),t.current.animation.id=null,t.current.animation.buttonIndex=null);let S=v?p.hoverImg:p.normalImg,x=p.getCount?p.getCount(e):null;S.complete?Ue(a,S,z,F,R,x,D.graph2D?.button?.textColor):S.onload=()=>{K.current&&Ue(a,S,z,F,R,x,D.graph2D?.button?.textColor);};}}a.restore();},[k,D.graph2D?.button]),Je=useCallback(e=>{let a=Q();!a||a.length===0||(e.globalAlpha=1,a.forEach(n=>{let{x:i,y:s,color:u,fontColor:c,label:l}=n,h=t.current.highlightNodes.has(n)||n===t.current.hoveredNode||n===t.current.draggedNode,b=n===t.current.selectedNode,v=j.nodeSizeBase,R=j.nodeSizeBase/2;if(h&&!b){let C=j.nodeSizeBase*j.nodeAreaFactor*.75/2;e.beginPath(),e.arc(i,s,C,0,2*Math.PI,false),e.fillStyle=D.graph2D.ring.highlightFill,e.fill();}if(b)if(y&&y.length>0)Ze(n,e);else {let C=j.nodeSizeBase*j.nodeAreaFactor/2;e.beginPath(),e.arc(i,s,C,0,2*Math.PI,false),e.fillStyle=D.graph2D.ring.selectionFill||D.graph2D.ring.highlightFill,e.fill();}if(e.beginPath(),e.arc(i,s,R,0,2*Math.PI),e.fillStyle=u||te(n.group||"0"),e.fill(),l){e.save(),e.translate(i,s);let C=t.current.transform.k,$=Ie(C),z=v*j.textPaddingFactor;e.font=`${$}px Sans-Serif`,e.textAlign="center",e.textBaseline="middle",e.fillStyle=c||"#000";let F=qt(l,z,e);e.fillText(F,0,0),e.restore();}}));},[D.graph2D.ring,y,Ze]),_=useCallback(()=>{let e=K.current;e&&(e.clearRect(0,0,t.current.width,t.current.height),Ve(e),e.save(),e.setTransform(t.current.transform.k,0,0,t.current.transform.k,t.current.transform.x,t.current.transform.y),qe(e),Je(e),e.restore());},[qe,Je,Ve]),Ke=useCallback((e,a=[],n)=>{let i=me()||[],s=Q()||[];if(!M.current||!e.length)return;let{width:u,height:c}=t.current,l=n?.smoothAppearance??false,h=n?.transitionDuration??1e3,b=new Set(s.map(p=>p.id)),v=e.filter(p=>!b.has(p.id)),R=new Set(i.map(p=>`${typeof p.source=="object"?p.source.id:p.source}-${typeof p.target=="object"?p.target.id:p.target}`)),C=a.filter(p=>{let S=`${typeof p.source=="object"?p.source.id:p.source}-${typeof p.target=="object"?p.target.id:p.target}`;return !R.has(S)});if(v.length===0&&C.length===0)return;let $=[...s,...v],z=[...i,...C];l&&(v.forEach(p=>{let S=C.filter(x=>{let O=typeof x.source=="object"?x.source.id:x.source,A=typeof x.target=="object"?x.target.id:x.target;return O===p.id&&b.has(A)||A===p.id&&b.has(O)});if(S.length>0){let x=S[0],O=typeof x.source=="object"?x.source.id===p.id?x.target:x.source.id:x.source===p.id?x.target:x.source,A=$.find(W=>W.id===O);if(A&&A.x!==void 0&&A.y!==void 0){let W=30+Math.random()*20,q=Math.random()*Math.PI*2;p.x=A.x+Math.cos(q)*W,p.y=A.y+Math.sin(q)*W,p.vx=0,p.vy=0;}}else {let x=u/2,O=c/2,A=Math.min(u,c)/4,W=Math.random()*Math.PI*2;p.x=x+Math.cos(W)*(A*Math.random()),p.y=O+Math.sin(W)*(A*Math.random()),p.vx=0,p.vy=0;}}),s.forEach(p=>{p.fx=p.x,p.fy=p.y;})),M.current.nodes($);let F=M.current.force("link");F&&F.links(z),C.forEach(p=>{let S=typeof p.source=="object"?p.source:$.find(O=>O.id===p.source),x=typeof p.target=="object"?p.target:$.find(O=>O.id===p.target);!S||!x||(!S.neighbors&&(S.neighbors=[]),!x.neighbors&&(x.neighbors=[]),S.neighbors.push(x),x.neighbors.push(S),!S.links&&(S.links=[]),!x.links&&(x.links=[]),S.links.push(p),x.links.push(p));}),l?(M.current.alphaTarget(.3),M.current.alpha(.3),M.current.velocityDecay(.7),M.current.restart(),setTimeout(()=>{s.forEach(p=>{p.fx=void 0,p.fy=void 0;}),M.current?.alphaTarget(0),M.current?.alpha(.1),M.current?.velocityDecay(.6);},h)):M.current.alpha(.1).restart(),_();},[X,_]),Qe=useCallback(e=>{let a=Q(),n=me();if(!M.current||!e.length||!a||a.length===0||!n||n.length===0)return;let i=new Set(e);if(t.current.selectedNode&&t.current.selectedNode.id!==void 0&&i.has(t.current.selectedNode.id)&&(t.current.selectedNode=null),t.current.hoveredNode&&t.current.hoveredNode.id!==void 0&&i.has(t.current.hoveredNode.id)&&(t.current.hoveredNode=null,t.current.highlightNodes=new Set,t.current.highlightLinks=new Set),t.current.hoveredLink){let l=typeof t.current.hoveredLink.source=="object"?t.current.hoveredLink.source.id:t.current.hoveredLink.source,h=typeof t.current.hoveredLink.target=="object"?t.current.hoveredLink.target.id:t.current.hoveredLink.target;(l!==void 0&&i.has(l)||h!==void 0&&i.has(h))&&(t.current.hoveredLink=null,t.current.highlightNodes=new Set,t.current.highlightLinks=new Set);}t.current.draggedNode&&t.current.draggedNode.id!==void 0&&i.has(t.current.draggedNode.id)&&(t.current.draggedNode=null);let s=a.filter(l=>l.id!==void 0&&!i.has(l.id)),u=n.filter(l=>{let h=typeof l.source=="object"?l.source.id:l.source,b=typeof l.target=="object"?l.target.id:l.target;return h!==void 0&&!i.has(h)&&b!==void 0&&!i.has(b)});s.forEach(l=>{l.neighbors=[],l.links=[];}),u.forEach(l=>{let h=typeof l.source=="object"?l.source:s.find(v=>v.id===l.source),b=typeof l.target=="object"?l.target:s.find(v=>v.id===l.target);!h||!b||(h.neighbors=h.neighbors||[],b.neighbors=b.neighbors||[],h.neighbors.push(b),b.neighbors.push(h),h.links=h.links||[],b.links=b.links||[],h.links.push(l),b.links.push(l));}),M.current.nodes(s);let c=M.current.force("link");c&&c.links(u),_();},[_]),ye=useCallback((e=0,a$1=20)=>{let n=Q();if(!K.current||!T.current||!n||!n.length)return;let s=1/0,u=1/0,c=-1/0,l=-1/0;if(n.forEach(h=>{if(h.x===void 0||h.y===void 0)return;let b=h.x,v=h.y;s=Math.min(s,b),u=Math.min(u,v),c=Math.max(c,b),l=Math.max(l,v);}),isFinite(s)&&isFinite(c)&&isFinite(u)&&isFinite(l)){let{width:h,height:b}=t.current;s-=a$1,u-=a$1,c+=a$1,l+=a$1;let v=c-s,R=l-u,C=v>0?h/v:1,$=R>0?b/R:1,z=Math.min(C,$,10),F=s+v/2,p=u+R/2,S={k:z,x:h/2-F*z,y:b/2-p*z};if(e>0){let x={...t.current.transform},O=Date.now(),A=a(()=>{let W=Math.min(1,(Date.now()-O)/e),q=W===1?1:1-Math.pow(1-W,3),ne={k:x.k+(S.k-x.k)*q,x:x.x+(S.x-x.x)*q,y:x.y+(S.y-x.y)*q};t.current.transform=ne,_(),W<1&&requestAnimationFrame(A);},"animateZoom");requestAnimationFrame(A);}else t.current.transform=S,_();}},[]),be=useCallback((e,a)=>{let n=Q();if(!n||n.length===0)return null;let i=j.nodeSizeBase/2,s=typeof window<"u"&&window.devicePixelRatio||1,u=(e*s-t.current.transform.x)/t.current.transform.k,c=(a*s-t.current.transform.y)/t.current.transform.k;return n.find(l=>{let h=(l.x||0)-u,b=(l.y||0)-c;return Math.sqrt(h*h+b*b)<=i})||null},[]),ve=useCallback((e,a)=>{let n=me(),i=Q();if(!n||n.length===0||!i||i.length===0)return null;let s=typeof window<"u"&&window.devicePixelRatio||1,u=(e*s-t.current.transform.x)/t.current.transform.k,c=(a*s-t.current.transform.y)/t.current.transform.k,l=5;return n.find(h=>{let b=typeof h.source=="object"?h.source:i.find(ie=>ie.id===h.source),v=typeof h.target=="object"?h.target:i.find(ie=>ie.id===h.target);if(!b||!v)return false;let R=b.x||0,C=b.y||0,$=v.x||0,z=v.y||0,F=u-R,p=c-C,S=$-R,x=z-C,O=F*S+p*x,A=S*S+x*x;if(A===0)return false;let W=O/A;W=Math.max(0,Math.min(1,W));let q=R+W*S,ne=C+W*x,ae=u-q,he=c-ne;return Math.sqrt(ae*ae+he*he)<=l})||null},[]),et=useCallback((e,a,n,i,s,u,c)=>{let l=e-n,h=a-i,b=Math.sqrt(l*l+h*h),v=Math.atan2(h,l);v<0&&(v+=2*Math.PI);let $=b>=s*.5&&b<=s*1,z=false;return u===Math.PI&&c===Math.PI*2?z=v>=Math.PI&&v<=Math.PI*2:u===0&&c===Math.PI?z=v>=0&&v<=Math.PI:z=u<=c&&v>=u&&v<=c||u>c&&(v>=u||v<=c),$&&z},[]),Le=useCallback(e=>{if(e===t.current.hoveredNode)return;let a=new Set,n=new Set;e&&(a.add(e),e.neighbors&&e.neighbors.forEach(i=>a.add(i)),e.links&&e.links.forEach(i=>n.add(i))),t.current.hoveredNode=e,P&&P(e),t.current.highlightNodes=a,t.current.highlightLinks=n;},[P]),Re=useCallback(e=>{if(e===t.current.hoveredLink)return;let a=new Set,n=new Set;if(e){n.add(e);let i=Q();if(i){let s=typeof e.source=="object"?e.source:i.find(c=>c.id===e.source),u=typeof e.target=="object"?e.target:i.find(c=>c.id===e.target);s&&a.add(s),u&&a.add(u);}}t.current.hoveredLink=e,L&&L(e),t.current.highlightNodes=a,t.current.highlightLinks=n;},[L,Q]),tt=useCallback(e=>{B&&B(e);},[B]),rt=useCallback(e=>{t.current.selectedNode=e,w&&w(e);},[w]),ot=useCallback(()=>{t.current.selectedNode=null,f&&f();},[f]),Ee=useCallback(e=>{if(!T.current||!M.current)return;let a=T.current.getBoundingClientRect(),n=e.clientX-a.left,i=e.clientY-a.top;t.current.mouseStartPos={x:n,y:i},t.current.isDragging=false;let s=be(n,i);s?(t.current.draggedNode=s,s.fx=s.x,s.fy=s.y):(t.current.isPanning=true,t.current.lastMousePos={x:n,y:i});},[be]),we=useCallback((e,a)=>{let n=null;if(T.current&&t.current&&k.length>0){let i=j.nodeSizeBase*j.nodeAreaFactor/2,s=T.current.getBoundingClientRect(),u=T.current.width/s.width,c=T.current.height/s.height,l=e*u,h=a*c,b=(l-t.current.transform.x)/t.current.transform.k,v=(h-t.current.transform.y)/t.current.transform.k,R=t.current.selectedNode?.x||0,C=t.current.selectedNode?.y||0,$=Math.min(k.length,8),z=Math.min(Math.PI*2/$,Math.PI);for(let F=0;F<$;F++){let p=F*z,S=(F+1)*z;if(et(b,v,R,C,i,p,S)){n=F;break}}}return n},[k]),ze=useCallback(e=>{if(!T.current)return;let a=T.current.getBoundingClientRect(),n=e.clientX-a.left,i=e.clientY-a.top;if(t.current.draggedNode&&t.current.mouseStartPos&&M.current){let c=t.current.mouseStartPos.x,l=t.current.mouseStartPos.y,h=n-c,b=i-l;Math.sqrt(h*h+b*b)>3&&(t.current.isDragging=true,M.current.alphaTarget()===0&&M.current.alphaTarget(0).restart());let C=typeof window<"u"&&window.devicePixelRatio||1,$=(n*C-t.current.transform.x)/t.current.transform.k,z=(i*C-t.current.transform.y)/t.current.transform.k;t.current.draggedNode.fx=$,t.current.draggedNode.fy=z;return}if(t.current.isPanning&&t.current.mouseStartPos){let c=n-t.current.lastMousePos.x,l=i-t.current.lastMousePos.y,h=t.current.mouseStartPos.x,b=t.current.mouseStartPos.y;Math.sqrt(Math.pow(n-h,2)+Math.pow(i-b,2))>3&&(t.current.isDragging=true),t.current.transform={...t.current.transform,x:t.current.transform.x+c,y:t.current.transform.y+l},t.current.lastMousePos={x:n,y:i},_();return}let s,u;if(t.current.selectedNode&&T.current&&k.length>0){let c=we(n,i);c!==null&&(u=t.current.selectedNode),c!==t.current.hoveredButtonIndex&&(s=true),t.current.hoveredButtonIndex=c;}else t.current.hoveredButtonIndex!==null&&(t.current.hoveredButtonIndex=null);if(!u&&(u=be(n,i),!u)){let c=ve(n,i),l=c!==t.current.hoveredLink;if(c&&t.current.hoveredNode&&Le(null),Re(c),T.current&&(T.current.style.cursor=c?"pointer":"default"),l){_();return}}u&&t.current.hoveredLink&&Re(null),u!==t.current.hoveredNode&&(s=true),Le(u),T.current&&(T.current.style.cursor=u?"pointer":"default"),s&&_();},[k,be,ve,Le,Re,_,et,we]),Ut=useCallback(e=>{t.current.mustBeStoppedPropagation&&(e.stopPropagation(),e.preventDefault()),t.current.mustBeStoppedPropagation=false;},[]),xe=useCallback(e=>{let a=t.current.isDragging;if(a&&(t.current.mustBeStoppedPropagation=true),!a&&t.current.mouseStartPos){let n=T.current?.getBoundingClientRect();if(n){let i=e.clientX-n.left,s=e.clientY-n.top;k.length>0&&t.current.hoveredButtonIndex===null&&(t.current.hoveredButtonIndex=we(i,s));let u=false;if(t.current.selectedNode&&t.current.hoveredButtonIndex!==null&&y[t.current.hoveredButtonIndex]){let c=y[t.current.hoveredButtonIndex];c&&c.onClick&&(c.onClick(t.current.selectedNode),u=true,t.current.hoveredButtonIndex=null);}if(!u&&t.current.draggedNode)rt(t.current.draggedNode);else if(!u&&!t.current.draggedNode){let c=ve(i,s);c?tt(c):ot();}}}if(t.current.draggedNode&&M.current){if(a){M.current.alphaTarget(0);let n=.05,i=.04,s=.6;M.current.alpha(n).alphaDecay(i),M.current.velocityDecay(s);}else M.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),_();},[y,_,rt,ot,ve,tt,we,k]),je=useCallback(e=>{if(e.stopPropagation(),e.preventDefault(),!T.current)return;let a=T.current.getBoundingClientRect(),n=e.clientX-a.left,i=e.clientY-a.top,u=-e.deltaY>0?1.1:1/1.1,c=t.current.transform,l=c.k*u;if(l<.01||l>10)return;let h=c.k*u,b=n-(n-c.x)*u,v=i-(i-c.y)*u;t.current.transform={k:h,x:b,y:v},_();},[_]),Be=a((e,a)=>{let n=e.touches[0];if(n){let i={clientX:n.clientX,clientY:n.clientY};a(i);}},"convertTouchToMouseEvent"),Zt=useCallback(e=>{Be(e,Ee);},[Ee]),Fe=useCallback(e=>{t.current.mustBeStoppedPropagation&&(e.preventDefault(),e.stopPropagation()),t.current.mustBeStoppedPropagation=false,Be(e,xe);},[xe]),Jt=useCallback(e=>{Be(e,ze);},[ze]);return useImperativeHandle(H,()=>({zoomToFit:ye,addNodes:Ke,removeNodes:Qe}),[ye,Ke,Qe]),useEffect(()=>{let e=T.current,{width:a,height:n}=t.current;if(!e)return;Vt(),Z(true);let i=a/2,s=n/2,u=j.nodeSizeBase,c=u/2,l=u*2.5;M.current&&M.current.stop();let h=M.current=forceSimulation(X).force("link",forceLink(G).id(b=>b.id).distance(l).strength(.9)).force("charge",forceManyBody().strength(-u/10*200).theta(.5).distanceMin(u*2)).force("x",forceX().strength(.03)).force("y",forceY().strength(.03)).force("center",forceCenter(i,s).strength(.05)).force("collide",forceCollide().radius(c*2).iterations(2).strength(1)).velocityDecay(.6);return ()=>{h.stop();}},[X,G]),useLayoutEffect(()=>{let e=T.current;e&&(t.current.width=o*Se,t.current.height=d*Se,e.width=t.current.width,e.height=t.current.height);},[o,d]),useEffect(()=>{if(M.current){let e=M.current;e.on("tick",()=>{_();}),e.on("end",()=>{I&&(ye(0,20),setTimeout(()=>{Z(false);},200));});}I||_();},[X,G,I,_,ye]),useEffect(()=>{!X||!G||G.forEach(e=>{let a=typeof e.source=="object"?e.source:X.find(i=>i.id===e.source),n=typeof e.target=="object"?e.target:X.find(i=>i.id===e.target);!a||!n||(!a.neighbors&&(a.neighbors=[]),!n.neighbors&&(n.neighbors=[]),a.neighbors.push(n),n.neighbors.push(a),!a.links&&(a.links=[]),!n.links&&(n.links=[]),a.links.push(e),n.links.push(e));});},[X,G]),useEffect(()=>{y&&y.length>0&&V(Lr(y));},[y]),useEffect(()=>{let e=T.current;if(!(!e||typeof window>"u"))return e.addEventListener("wheel",je,{passive:false}),e.addEventListener("touchend",Fe,{passive:false}),()=>{e.removeEventListener("wheel",je),e.removeEventListener("touchend",Fe);}},[je,Fe]),jsxs(Er,{children:[(r||I)&&jsx(wt,{width:o,height:d}),jsx(zr,{ref:T,style:{width:o,height:d,display:r||I?"none":"block"},onMouseDown:Ee,onMouseMove:ze,onMouseUp:xe,onMouseLeave:xe,onClick:Ut,onTouchStart:Zt,onTouchMove:Jt})]})}),Er=styled.div`
|
|
47
|
+
`,Pr=a(({width:r=280,height:o=280})=>{let c=useTheme();return jsx(Dr,{children:jsxs(wr,{foregroundColor:c.contentLoader.foreground,backgroundColor:c.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"),Ct=Pr;var Ee=typeof window<"u"&&window.devicePixelRatio||1;function Wr(r){return !r||r.length===0?[]:r.map(o=>{let c=new Image;c.src=o.img;let p=new Image;return p.src=o.hoverImg,{...o,normalImg:c,hoverImg:p}})}a(Wr,"prepareButtonImages");var F={fontSize:3,nodeSizeBase:30,nodeAreaFactor:2,textPaddingFactor:.9,gridSpacing:20,dotSize:1,maxZoom:4},Hr=forwardRef(({loading:r,width:o,height:c,graphData:p,buttons:h=[],onNodeClick:b,onBackgroundClick:g,onNodeHover:S,onLinkHover:I,onLinkClick:R},A)=>{let x=useTheme(),[T,V]=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*Ee,height:c*Ee,animation:{id:null,buttonIndex:null},spinnerAngle:0}),{nodes:$,links:U}=useMemo(()=>Ir(p),[p]),[k,E]=useState([]),M=useRef(null),D=useRef(null),K=useRef(null),q=scaleOrdinal(schemeCategory10),de=useCallback(()=>{if(!M.current)return false;try{let e=M.current.getContext("2d");return e?(K.current=e,!0):(console.error("Failed to get 2D context"),!1)}catch(e){return console.error("Error initializing Canvas 2D context:",e),false}},[]),Z=useCallback(()=>D.current?D.current.nodes():null,[]),ue=useCallback(()=>{if(!D.current)return null;let e=D.current.force("link");return e?e.links():null},[]),pe=useCallback(e=>{e.save(),e.setTransform(1,0,0,1,0,0);let{width:a,height:n}=t.current,i=F.gridSpacing,s=F.dotSize;e.fillStyle=x.graph2D.grid.dotColor;for(let u=i/2;u<=a;u+=i)for(let l=i/2;l<=n;l+=i)e.beginPath(),e.arc(u,l,s,0,2*Math.PI),e.fill();e.restore();},[x.graph2D.grid.dotColor,F.gridSpacing,F.dotSize]),ke=useCallback((e,a,n)=>{if(!e)return "";if(n.measureText(e).width<=a)return e;let s=e,u="...";for(;n.measureText(s+u).width>a&&s.length>0;)s=s.slice(0,-1);return s+u},[]),ve=a(e=>{let n=Math.min(e,F.maxZoom)/F.maxZoom;return Math.max(F.fontSize*n,F.fontSize)},"calculateFontSize"),De=useCallback(e=>{let a=ue(),n=Z();!a||a.length===0||!n||n.length===0||(e.lineWidth=.5,e.globalAlpha=1,a.forEach(i=>{let s=typeof i.source=="object"?i.source:n.find(oe=>oe.id===i.source),u=typeof i.target=="object"?i.target:n.find(oe=>oe.id===i.target);if(!s||!u)return;let l={x:s.x||0,y:s.y||0},d={x:u.x||0,y:u.y||0},y=d.x-l.x,v=d.y-l.y,w=Math.sqrt(y*y+v*v),z=y/w,N=v/w,H=F.nodeSizeBase/2,B=F.nodeSizeBase/2,O=4,f={x:l.x+z*H,y:l.y+N*H},C={x:d.x-z*(B+O),y:d.y-N*(B+O)},P={x:d.x-z*(B+1),y:d.y-N*(B+1)},X=t.current.highlightLinks.has(i),W=X?x.graph2D.link.highlighted:x.graph2D.link.normal,Y=X?1.5:.5,J=l.x+(d.x-l.x)/2,ae=l.y+(d.y-l.y)/2,ie=Math.atan2(v,y);if(i.label){let oe=t.current.transform.k,se=ve(oe);e.font=`${se}px Sans-Serif`;let lt=e.measureText(i.label).width,dt=10;e.beginPath(),e.moveTo(f.x,f.y);let ut=w/2-(lt+dt)/2,pt={x:l.x+z*ut,y:l.y+N*ut};e.lineTo(pt.x,pt.y),e.strokeStyle=W,e.lineWidth=Y,e.stroke(),e.beginPath();let ht=w/2+(lt+dt)/2,gt={x:l.x+z*ht,y:l.y+N*ht};e.moveTo(gt.x,gt.y),e.lineTo(C.x,C.y),e.strokeStyle=W,e.lineWidth=Y,e.stroke();}else e.beginPath(),e.moveTo(f.x,f.y),e.lineTo(C.x,C.y),e.strokeStyle=W,e.lineWidth=Y,e.stroke();let be=2;if(e.save(),e.translate(P.x,P.y),e.rotate(ie),e.beginPath(),e.moveTo(0,0),e.lineTo(-4,be),e.lineTo(-4,0),e.lineTo(-4,-2),e.closePath(),e.fillStyle=W,e.fill(),e.restore(),i.label){let oe=t.current.transform.k,se=ve(oe);e.font=`${se}px Sans-Serif`,e.textAlign="center",e.textBaseline="middle",e.save(),e.translate(J,ae),Math.abs(ie)>Math.PI/2?e.rotate(ie+Math.PI):e.rotate(ie),e.fillStyle=X?x.graph2D.link.highlightedTextColor:x.graph2D.link.textColor,e.fillText(i.label,0,0),e.restore();}}));},[F,x.graph2D.link]),et=a((e,a,n,i,s,u,l)=>{try{if(u!=null){let d=s*.8;e.font=`${d}px sans-serif`,e.textBaseline="middle",e.textAlign="left";let y=new Intl.NumberFormat("en",{notation:"compact",maximumFractionDigits:1,minimumFractionDigits:0,compactDisplay:"short"}).format(u),v=e.measureText(y).width,w=s*.3,N=(s+w+v)/2;e.drawImage(a,n-N,i-s/2,s,s),e.fillStyle=l||"#99989C",e.fillText(y,n-N+s+w,i);}else e.drawImage(a,n-s/2,i-s/2,s,s);}catch(d){console.warn("Error rendering icon:",d);}},"drawIconWithOptionalCounter"),tt=useCallback((e,a)=>{if(!k||k.length===0||!e||!e.x||!e.y)return;let{x:n,y:i}=e,s=F.nodeSizeBase*F.nodeAreaFactor/2;a.save();let u=Math.min(k.length,8),l$1=Math.min(Math.PI*2/u,Math.PI);for(let d=0;d<u;d++){let y=d*l$1,v=(d+1)*l$1,w=t.current.hoveredButtonIndex===d;a.beginPath(),a.arc(n,i,s,y,v,false),a.lineTo(n,i),a.closePath(),a.lineWidth=1,a.strokeStyle=x.graph2D?.button?.stroke||"#FFFFFF",a.stroke(),a.fillStyle=w?x.graph2D?.button?.hoverFill||"rgba(255, 255, 255, 0.3)":x.graph2D?.button?.normalFill||"rgba(255, 255, 255, 0.1)",a.fill();let z=s*.2,N=(y+v)/2,H=s-F.nodeSizeBase/2+z,B=n+Math.cos(N)*H,O=i+Math.sin(N)*H,f=k[d];if(f.loading){let C=z/2,P=z/12;a.save(),a.translate(B,O),a.rotate(t.current.spinnerAngle);for(let X=0;X<12;X++){let W=Math.PI*2*X/12,Y=X/12,J=Math.cos(W)*C,ae=Math.sin(W)*C;a.beginPath(),a.fillStyle=l(x.graph2D?.button?.spinnerColor,Y),a.arc(J,ae,P,0,Math.PI*2),a.fill();}a.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(G),t.current.animation.buttonIndex=d;}else {t.current.animation.id&&t.current.animation.buttonIndex===d&&(cancelAnimationFrame(t.current.animation.id),t.current.animation.id=null,t.current.animation.buttonIndex=null);let C=w?f.hoverImg:f.normalImg,P=f.getCount?f.getCount(e):null;C.complete?et(a,C,B,O,z,P,x.graph2D?.button?.textColor):C.onload=()=>{K.current&&et(a,C,B,O,z,P,x.graph2D?.button?.textColor);};}}a.restore();},[k,x.graph2D?.button]),rt=useCallback(e=>{let a=Z();!a||a.length===0||(e.globalAlpha=1,a.forEach(n=>{let{x:i,y:s,color:u,fontColor:l,label:d}=n,y=t.current.highlightNodes.has(n)||n===t.current.hoveredNode||n===t.current.draggedNode,v=n===t.current.selectedNode,w=F.nodeSizeBase,z=F.nodeSizeBase/2;if(y&&!v){let N=F.nodeSizeBase*F.nodeAreaFactor*.75/2;e.beginPath(),e.arc(i,s,N,0,2*Math.PI,false),e.fillStyle=x.graph2D.ring.highlightFill,e.fill();}if(v)if(h&&h.length>0)tt(n,e);else {let N=F.nodeSizeBase*F.nodeAreaFactor/2;e.beginPath(),e.arc(i,s,N,0,2*Math.PI,false),e.fillStyle=x.graph2D.ring.selectionFill||x.graph2D.ring.highlightFill,e.fill();}if(e.beginPath(),e.arc(i,s,z,0,2*Math.PI),e.fillStyle=u||q(n.group||"0"),e.fill(),d){e.save(),e.translate(i,s);let N=t.current.transform.k,H=ve(N),B=w*F.textPaddingFactor;e.font=`${H}px Sans-Serif`,e.textAlign="center",e.textBaseline="middle",e.fillStyle=l||"#000";let O=ke(d,B,e);e.fillText(O,0,0),e.restore();}}));},[x.graph2D.ring,h,tt]),G=useCallback(()=>{let e=K.current;e&&(e.clearRect(0,0,t.current.width,t.current.height),pe(e),e.save(),e.setTransform(t.current.transform.k,0,0,t.current.transform.k,t.current.transform.x,t.current.transform.y),De(e),rt(e),e.restore());},[De,rt,pe]),ot=useCallback((e,a=[],n)=>{let i=ue()||[],s=Z()||[];if(!D.current||!e.length)return;let{width:u,height:l}=t.current,d=n?.smoothAppearance??false,y=n?.transitionDuration??1e3,v=new Set(s.map(f=>f.id)),w=e.filter(f=>!v.has(f.id)),z=new Set(i.map(f=>`${typeof f.source=="object"?f.source.id:f.source}-${typeof f.target=="object"?f.target.id:f.target}`)),N=a.filter(f=>{let C=`${typeof f.source=="object"?f.source.id:f.source}-${typeof f.target=="object"?f.target.id:f.target}`;return !z.has(C)});if(w.length===0&&N.length===0)return;let H=[...s,...w],B=[...i,...N];d&&(w.forEach(f=>{let C=N.filter(P=>{let X=typeof P.source=="object"?P.source.id:P.source,W=typeof P.target=="object"?P.target.id:P.target;return X===f.id&&v.has(W)||W===f.id&&v.has(X)});if(C.length>0){let P=C[0],X=typeof P.source=="object"?P.source.id===f.id?P.target:P.source.id:P.source===f.id?P.target:P.source,W=H.find(Y=>Y.id===X);if(W&&W.x!==void 0&&W.y!==void 0){let Y=30+Math.random()*20,J=Math.random()*Math.PI*2;f.x=W.x+Math.cos(J)*Y,f.y=W.y+Math.sin(J)*Y,f.vx=0,f.vy=0;}}else {let P=u/2,X=l/2,W=Math.min(u,l)/4,Y=Math.random()*Math.PI*2;f.x=P+Math.cos(Y)*(W*Math.random()),f.y=X+Math.sin(Y)*(W*Math.random()),f.vx=0,f.vy=0;}}),s.forEach(f=>{f.fx=f.x,f.fy=f.y;})),D.current.nodes(H);let O=D.current.force("link");O&&O.links(B),N.forEach(f=>{let C=typeof f.source=="object"?f.source:H.find(X=>X.id===f.source),P=typeof f.target=="object"?f.target:H.find(X=>X.id===f.target);!C||!P||(!C.neighbors&&(C.neighbors=[]),!P.neighbors&&(P.neighbors=[]),C.neighbors.push(P),P.neighbors.push(C),!C.links&&(C.links=[]),!P.links&&(P.links=[]),C.links.push(f),P.links.push(f));}),d?(D.current.alphaTarget(.3),D.current.alpha(.3),D.current.velocityDecay(.7),D.current.restart(),setTimeout(()=>{s.forEach(f=>{f.fx=void 0,f.fy=void 0;}),D.current?.alphaTarget(0),D.current?.alpha(.1),D.current?.velocityDecay(.6);},y)):D.current.alpha(.1).restart(),G();},[$,G]),nt=useCallback(e=>{let a=Z(),n=ue();if(!D.current||!e.length||!a||a.length===0||!n||n.length===0)return;let i=new Set(e);if(t.current.selectedNode&&t.current.selectedNode.id!==void 0&&i.has(t.current.selectedNode.id)&&(t.current.selectedNode=null),t.current.hoveredNode&&t.current.hoveredNode.id!==void 0&&i.has(t.current.hoveredNode.id)&&(t.current.hoveredNode=null,t.current.highlightNodes=new Set,t.current.highlightLinks=new Set),t.current.hoveredLink){let d=typeof t.current.hoveredLink.source=="object"?t.current.hoveredLink.source.id:t.current.hoveredLink.source,y=typeof t.current.hoveredLink.target=="object"?t.current.hoveredLink.target.id:t.current.hoveredLink.target;(d!==void 0&&i.has(d)||y!==void 0&&i.has(y))&&(t.current.hoveredLink=null,t.current.highlightNodes=new Set,t.current.highlightLinks=new Set);}t.current.draggedNode&&t.current.draggedNode.id!==void 0&&i.has(t.current.draggedNode.id)&&(t.current.draggedNode=null);let s=a.filter(d=>d.id!==void 0&&!i.has(d.id)),u=n.filter(d=>{let y=typeof d.source=="object"?d.source.id:d.source,v=typeof d.target=="object"?d.target.id:d.target;return y!==void 0&&!i.has(y)&&v!==void 0&&!i.has(v)});s.forEach(d=>{d.neighbors=[],d.links=[];}),u.forEach(d=>{let y=typeof d.source=="object"?d.source:s.find(w=>w.id===d.source),v=typeof d.target=="object"?d.target:s.find(w=>w.id===d.target);!y||!v||(y.neighbors=y.neighbors||[],v.neighbors=v.neighbors||[],y.neighbors.push(v),v.neighbors.push(y),y.links=y.links||[],v.links=v.links||[],y.links.push(d),v.links.push(d));}),D.current.nodes(s);let l=D.current.force("link");l&&l.links(u),G();},[G]),Pe=useCallback((e=0,a$1=20)=>{let n=Z();if(!K.current||!M.current||!n||!n.length)return;let s=1/0,u=1/0,l=-1/0,d=-1/0;if(n.forEach(y=>{if(y.x===void 0||y.y===void 0)return;let v=y.x,w=y.y;s=Math.min(s,v),u=Math.min(u,w),l=Math.max(l,v),d=Math.max(d,w);}),isFinite(s)&&isFinite(l)&&isFinite(u)&&isFinite(d)){let{width:y,height:v}=t.current;s-=a$1,u-=a$1,l+=a$1,d+=a$1;let w=l-s,z=d-u,N=w>0?y/w:1,H=z>0?v/z:1,B=Math.min(N,H,10),O=s+w/2,f=u+z/2,C={k:B,x:y/2-O*B,y:v/2-f*B};if(e>0){let P={...t.current.transform},X=Date.now(),W=a(()=>{let Y=Math.min(1,(Date.now()-X)/e),J=Y===1?1:1-Math.pow(1-Y,3),ae={k:P.k+(C.k-P.k)*J,x:P.x+(C.x-P.x)*J,y:P.y+(C.y-P.y)*J};t.current.transform=ae,G(),Y<1&&requestAnimationFrame(W);},"animateZoom");requestAnimationFrame(W);}else t.current.transform=C,G();}},[]),Se=useCallback((e,a)=>{let n=Z();if(!n||n.length===0)return null;let i=F.nodeSizeBase/2,s=typeof window<"u"&&window.devicePixelRatio||1,u=(e*s-t.current.transform.x)/t.current.transform.k,l=(a*s-t.current.transform.y)/t.current.transform.k;return n.find(d=>{let y=(d.x||0)-u,v=(d.y||0)-l;return Math.sqrt(y*y+v*v)<=i})||null},[]),Me=useCallback((e,a)=>{let n=ue(),i=Z();if(!n||n.length===0||!i||i.length===0)return null;let s=typeof window<"u"&&window.devicePixelRatio||1,u=(e*s-t.current.transform.x)/t.current.transform.k,l=(a*s-t.current.transform.y)/t.current.transform.k,d=5;return n.find(y=>{let v=typeof y.source=="object"?y.source:i.find(se=>se.id===y.source),w=typeof y.target=="object"?y.target:i.find(se=>se.id===y.target);if(!v||!w)return false;let z=v.x||0,N=v.y||0,H=w.x||0,B=w.y||0,O=u-z,f=l-N,C=H-z,P=B-N,X=O*C+f*P,W=C*C+P*P;if(W===0)return false;let Y=X/W;Y=Math.max(0,Math.min(1,Y));let J=z+Y*C,ae=N+Y*P,ie=u-J,be=l-ae;return Math.sqrt(ie*ie+be*be)<=d})||null},[]),at=useCallback((e,a,n,i,s,u,l)=>{let d=e-n,y=a-i,v=Math.sqrt(d*d+y*y),w=Math.atan2(y,d);w<0&&(w+=2*Math.PI);let H=v>=s*.5&&v<=s*1,B=false;return u===Math.PI&&l===Math.PI*2?B=w>=Math.PI&&w<=Math.PI*2:u===0&&l===Math.PI?B=w>=0&&w<=Math.PI:B=u<=l&&w>=u&&w<=l||u>l&&(w>=u||w<=l),H&&B},[]),Ae=useCallback(e=>{if(e===t.current.hoveredNode)return;let a=new Set,n=new Set;e&&(a.add(e),e.neighbors&&e.neighbors.forEach(i=>a.add(i)),e.links&&e.links.forEach(i=>n.add(i))),t.current.hoveredNode=e,S&&S(e),t.current.highlightNodes=a,t.current.highlightLinks=n;},[S]),$e=useCallback(e=>{if(e===t.current.hoveredLink)return;let a=new Set,n=new Set;if(e){n.add(e);let i=Z();if(i){let s=typeof e.source=="object"?e.source:i.find(l=>l.id===e.source),u=typeof e.target=="object"?e.target:i.find(l=>l.id===e.target);s&&a.add(s),u&&a.add(u);}}t.current.hoveredLink=e,I&&I(e),t.current.highlightNodes=a,t.current.highlightLinks=n;},[I,Z]),it=useCallback(e=>{R&&R(e);},[R]),st=useCallback(e=>{t.current.selectedNode=e,b&&b(e);},[b]),ct=useCallback(()=>{t.current.selectedNode=null,g&&g();},[g]),Oe=useCallback(e=>{if(!M.current||!D.current)return;let a=M.current.getBoundingClientRect(),n=e.clientX-a.left,i=e.clientY-a.top;t.current.mouseStartPos={x:n,y:i},t.current.isDragging=false;let s=Se(n,i);s?(t.current.draggedNode=s,s.fx=s.x,s.fy=s.y):(t.current.isPanning=true,t.current.lastMousePos={x:n,y:i});},[Se]),Ce=useCallback((e,a)=>{let n=null;if(M.current&&t.current&&k.length>0){let i=F.nodeSizeBase*F.nodeAreaFactor/2,s=M.current.getBoundingClientRect(),u=M.current.width/s.width,l=M.current.height/s.height,d=e*u,y=a*l,v=(d-t.current.transform.x)/t.current.transform.k,w=(y-t.current.transform.y)/t.current.transform.k,z=t.current.selectedNode?.x||0,N=t.current.selectedNode?.y||0,H=Math.min(k.length,8),B=Math.min(Math.PI*2/H,Math.PI);for(let O=0;O<H;O++){let f=O*B,C=(O+1)*B;if(at(v,w,z,N,i,f,C)){n=O;break}}}return n},[k]),We=useCallback(e=>{if(!M.current)return;let a=M.current.getBoundingClientRect(),n=e.clientX-a.left,i=e.clientY-a.top;if(t.current.draggedNode&&t.current.mouseStartPos&&D.current){let l=t.current.mouseStartPos.x,d=t.current.mouseStartPos.y,y=n-l,v=i-d;Math.sqrt(y*y+v*v)>3&&(t.current.isDragging=true,D.current.alphaTarget()===0&&D.current.alphaTarget(0).restart());let N=typeof window<"u"&&window.devicePixelRatio||1,H=(n*N-t.current.transform.x)/t.current.transform.k,B=(i*N-t.current.transform.y)/t.current.transform.k;t.current.draggedNode.fx=H,t.current.draggedNode.fy=B;return}if(t.current.isPanning&&t.current.mouseStartPos){let l=n-t.current.lastMousePos.x,d=i-t.current.lastMousePos.y,y=t.current.mouseStartPos.x,v=t.current.mouseStartPos.y;Math.sqrt(Math.pow(n-y,2)+Math.pow(i-v,2))>3&&(t.current.isDragging=true),t.current.transform={...t.current.transform,x:t.current.transform.x+l,y:t.current.transform.y+d},t.current.lastMousePos={x:n,y:i},G();return}let s,u;if(t.current.selectedNode&&M.current&&k.length>0){let l=Ce(n,i);l!==null&&(u=t.current.selectedNode),l!==t.current.hoveredButtonIndex&&(s=true),t.current.hoveredButtonIndex=l;}else t.current.hoveredButtonIndex!==null&&(t.current.hoveredButtonIndex=null);if(!u&&(u=Se(n,i),!u)){let l=Me(n,i),d=l!==t.current.hoveredLink;if(l&&t.current.hoveredNode&&Ae(null),$e(l),M.current&&(M.current.style.cursor=l?"pointer":"default"),d){G();return}}u&&t.current.hoveredLink&&$e(null),u!==t.current.hoveredNode&&(s=true),Ae(u),M.current&&(M.current.style.cursor=u?"pointer":"default"),s&&G();},[k,Se,Me,Ae,$e,G,at,Ce]),er=useCallback(e=>{t.current.mustBeStoppedPropagation&&(e.stopPropagation(),e.preventDefault()),t.current.mustBeStoppedPropagation=false;},[]),Te=useCallback(e=>{let a=t.current.isDragging;if(a&&(t.current.mustBeStoppedPropagation=true),!a&&t.current.mouseStartPos){let n=M.current?.getBoundingClientRect();if(n){let i=e.clientX-n.left,s=e.clientY-n.top;k.length>0&&t.current.hoveredButtonIndex===null&&(t.current.hoveredButtonIndex=Ce(i,s));let u=false;if(t.current.selectedNode&&t.current.hoveredButtonIndex!==null&&h[t.current.hoveredButtonIndex]){let l=h[t.current.hoveredButtonIndex];l&&l.onClick&&(l.onClick(t.current.selectedNode),u=true,t.current.hoveredButtonIndex=null);}if(!u&&t.current.draggedNode)st(t.current.draggedNode);else if(!u&&!t.current.draggedNode){let l=Me(i,s);l?it(l):ct();}}}if(t.current.draggedNode&&D.current){if(a){D.current.alphaTarget(0);let n=.05,i=.04,s=.6;D.current.alpha(n).alphaDecay(i),D.current.velocityDecay(s);}else D.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),G();},[h,G,st,ct,Me,it,Ce,k]),He=useCallback(e=>{if(e.stopPropagation(),e.preventDefault(),!M.current)return;let a=M.current.getBoundingClientRect(),n=e.clientX-a.left,i=e.clientY-a.top,u=-e.deltaY>0?1.1:1/1.1,l=t.current.transform,d=l.k*u;if(d<.01||d>10)return;let y=l.k*u,v=n-(n-l.x)*u,w=i-(i-l.y)*u;t.current.transform={k:y,x:v,y:w},G();},[G]),Xe=a((e,a)=>{let n=e.touches[0];if(n){let i={clientX:n.clientX,clientY:n.clientY};a(i);}},"convertTouchToMouseEvent"),tr=useCallback(e=>{Xe(e,Oe);},[Oe]),Ye=useCallback(e=>{t.current.mustBeStoppedPropagation&&(e.preventDefault(),e.stopPropagation()),t.current.mustBeStoppedPropagation=false,Xe(e,Te);},[Te]),rr=useCallback(e=>{Xe(e,We);},[We]);return useImperativeHandle(A,()=>({zoomToFit:Pe,addNodes:ot,removeNodes:nt}),[Pe,ot,nt]),useEffect(()=>{let e=M.current,{width:a,height:n}=t.current;if(!e)return;de(),V(true);let i=a/2,s=n/2,u=F.nodeSizeBase,l=u/2,d=u*2.5;D.current&&D.current.stop();let y=D.current=forceSimulation($).force("link",forceLink(U).id(v=>v.id).distance(d).strength(.9)).force("charge",forceManyBody().strength(-u/10*200).theta(.5).distanceMin(u*2)).force("x",forceX().strength(.03)).force("y",forceY().strength(.03)).force("center",forceCenter(i,s).strength(.05)).force("collide",forceCollide().radius(l*2).iterations(2).strength(1)).velocityDecay(.6);return ()=>{y.stop();}},[$,U]),useLayoutEffect(()=>{let e=M.current;e&&(t.current.width=o*Ee,t.current.height=c*Ee,e.width=t.current.width,e.height=t.current.height);},[o,c]),useEffect(()=>{if(D.current){let e=D.current;e.on("tick",()=>{G();}),e.on("end",()=>{T&&(Pe(0,20),setTimeout(()=>{V(false);},200));});}T||G();},[$,U,T,G,Pe]),useEffect(()=>{!$||!U||U.forEach(e=>{let a=typeof e.source=="object"?e.source:$.find(i=>i.id===e.source),n=typeof e.target=="object"?e.target:$.find(i=>i.id===e.target);!a||!n||(!a.neighbors&&(a.neighbors=[]),!n.neighbors&&(n.neighbors=[]),a.neighbors.push(n),n.neighbors.push(a),!a.links&&(a.links=[]),!n.links&&(n.links=[]),a.links.push(e),n.links.push(e));});},[$,U]),useEffect(()=>{h&&h.length>0&&E(Wr(h));},[h]),useEffect(()=>{let e=M.current;if(!(!e||typeof window>"u"))return e.addEventListener("wheel",He,{passive:false}),e.addEventListener("touchend",Ye,{passive:false}),()=>{e.removeEventListener("wheel",He),e.removeEventListener("touchend",Ye);}},[He,Ye]),jsxs(Xr,{children:[(r||T)&&jsx(Ct,{width:o,height:c}),jsx(Yr,{ref:M,style:{width:o,height:c,display:r||T?"none":"block"},onMouseDown:Oe,onMouseMove:We,onMouseUp:Te,onMouseLeave:Te,onClick:er,onTouchStart:tr,onTouchMove:rr})]})}),Xr=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
|
-
`,
|
|
54
|
+
`,Yr=styled.canvas``;Hr.displayName="Graph2D";var ss=w(({isActive:r,position:o,top:c=0,left:p=0,right:h,bottom:b,...g})=>jsx(Vr,{$isActive:r,$position:o,$top:c,$left:p,$right:h,$bottom:b,...g})),Vr=xr.div(({$isActive:r,$top:o,$left:c$1,$right:p,$bottom:h,$position:b,theme:g})=>`
|
|
55
55
|
${r?`
|
|
56
|
-
position: ${
|
|
56
|
+
position: ${b};
|
|
57
57
|
z-index: 1000;
|
|
58
|
-
${typeof o=="number"?`top: ${c(o,
|
|
59
|
-
${typeof
|
|
60
|
-
${typeof
|
|
61
|
-
${typeof
|
|
58
|
+
${typeof o=="number"?`top: ${c(o,g.baseSize)};`:""}
|
|
59
|
+
${typeof c$1=="number"?`left: ${c(c$1,g.baseSize)};`:""}
|
|
60
|
+
${typeof p=="number"?`right: ${c(p,g.baseSize)};`:""}
|
|
61
|
+
${typeof h=="number"?`bottom: ${c(h,g.baseSize)};`:""}
|
|
62
62
|
|
|
63
63
|
`:""}
|
|
64
64
|
|
|
65
65
|
min-width: 0;
|
|
66
|
-
`);var Mt=a(({url:r})=>{let[o,d]=useState(1),[g,y]=useState(),w=Pt.useRef(null),f=Pt.useRef(null),P=a(()=>{d(B=>Math.min(B+.25,4));},"handleZoomIn");return jsxs("div",{ref:f,className:"h-full w-full flex flex-col",children:[jsxs("div",{className:"flex justify-center items-stretch p-5.5 gap-1 border-b border-gray-200 relative ",children:[jsx(z,{variant:"outlined","aria-label":"zoom-out",color:"secondary",size:"small",icon:jsx(Pa,{style:{width:20,height:20}}),onClick:a(()=>{d(B=>Math.max(B-.25,.25));},"handleZoomOut"),disabled:o<=.25,p:5}),jsxs(mb,{py:5,px:8,children:[o*100,"%"]}),jsx(z,{variant:"outlined","aria-label":"zoom-in",size:"small",color:"secondary",icon:jsx(ma,{style:{width:14,height:14}}),onClick:P,disabled:o>=4,p:8})]}),jsx("div",{className:"h-full w-full overflow-auto",children:jsx("img",{src:r,ref:w,alt:"image",className:"block w-auto max-w-none object-contain",style:{transition:"all 0.2s ease-in-out",marginInline:"auto",marginBlock:10,flexShrink:0,...g==="width"&&{width:`calc(${o*100}% - 20px)`},...g==="height"&&{height:`calc(${o*100}% - 20px)`}},onLoad:()=>{if(w.current&&f.current){let B=w.current.width,H=w.current.height,D=B<H?"height":"width";y(D);}}})})]})},"ImageDriver");var Tt=a(({url:r})=>jsx("div",{className:"flex flex-col justify-center items-center w-full h-full p-5.5",children:jsx("audio",{controls:true,src:r,className:"w-full"})}),"AudioDriver");var Oe=a(({url:r})=>{let[o,d]=useState(null),[g,y]=useState(false),[w,f]=useState(true),[P,L]=useState(null);return useEffect(()=>{y(true);},[]),useEffect(()=>{if(!g)return;a(async()=>{try{let H=await import('./PdfDriver-XMGFZKNY.mjs');d(()=>H.PdfDriver),f(!1);}catch(H){console.error("Failed to load PDF driver:",H),L("Failed to load PDF viewer"),f(false);}},"loadPdfDriver")();},[g]),g?w?jsx("div",{className:"flex items-center justify-center h-full w-full",children:jsx("div",{className:"text-gray-500",children:"Loading PDF viewer..."})}):P||!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:P||"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 Lt=50,Wr=1e4,Rt=a(({url:r,blob:o})=>{let d=useRef(null),[g,y]=useState(null),[w,f]=useState(true);return useEffect(()=>{a(async()=>{if(d.current)try{if(f(!0),y(null),!o&&r&&(o=await(await fetch(r)).blob()),!o){y("\u041D\u0435 \u043D\u0430\u0434\u0430\u043D\u043E \u0434\u043B\u044F DOCX \u0444\u0430\u0439\u043B\u0443");return}if(o.size/(1024*1024)>Lt){y(`\u0424\u0430\u0439\u043B \u0437\u0430\u043D\u0430\u0434\u0442\u043E \u0432\u0435\u043B\u0438\u043A\u0438\u0439 (> ${Lt} \u041C\u0411)`);return}d.current.innerHTML="";let B=renderAsync(o,d.current,void 0,{debug:!0,experimental:!0,hideWrapperOnPrint:!0}),H=new Promise((D,I)=>setTimeout(()=>I(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")),Wr));await Promise.race([B,H]),f(!1);}catch(L){y(L?.message||"\u041D\u0435 \u0432\u0434\u0430\u043B\u043E\u0441\u044F \u0432\u0456\u0434\u043A\u0440\u0438\u0442\u0438 DOCX \u0444\u0430\u0439\u043B"),f(false);}},"renderDocument")();},[r,o]),jsxs(Fragment,{children:[!!g&&!w&&jsx("div",{className:"text-red-500 p-5",children:g}),w&&jsx("div",{className:"flex items-center justify-center p-5",children:"\u0417\u0430\u0432\u0430\u043D\u0442\u0430\u0436\u0435\u043D\u043D\u044F..."}),jsx("div",{ref:d,className:"w-full h-full overflow-auto [&_table]:max-w-full! [&>div.docx-wrapper]:w-fit",style:{boxSizing:"border-box"}})]})},"DocxDriver");var qr=a(r=>({js:"javascript",jsx:"jsx",ts:"typescript",tsx:"tsx",json:"json",html:"html",css:"css",scss:"scss",py:"python",java:"java",cpp:"cpp",c:"c",cs:"csharp",php:"php",rb:"ruby",go:"go",rs:"rust",swift:"swift",kt:"kotlin",xml:"xml",yaml:"yaml",yml:"yaml",md:"markdown",sql:"sql",sh:"bash",bash:"bash",txt:"text"})[r]||"text","getLanguageFromExtension"),Et=a(({url:r,extension:o})=>{let[d,g]=useState(""),[y,w]=useState(true),[f,P]=useState(null);if(useEffect(()=>{a(async()=>{try{w(!0),P(null);let D=await fetch(r);if(!D.ok)throw new Error(`Failed to load file: ${D.statusText}`);let I=await D.text();g(I);}catch(D){P(D instanceof Error?D.message:"Failed to load text content");}finally{w(false);}},"loadTextContent")();},[r]),y)return jsx("div",{className:"flex items-center justify-center p-8",children:jsx("div",{className:"text-gray-500",children:"Loading text content..."})});if(f)return jsx("div",{className:"flex items-center justify-center p-8",children:jsxs("div",{className:"text-red-500",children:["Error: ",f]})});let L=qr(o);return jsx("div",{className:"h-full w-full overflow-auto",children:L!=="text"?jsx(Prism,{className:"min-h-full! m-0! py-0!",language:L,style:darcula,showLineNumbers:true,wrapLines:true,children:d}):jsx("pre",{className:"whitespace-pre-wrap p-4 text-sm font-mono bg-gray-50 min-h-full",children:d})})},"TextDriver");var jt=a(({url:r})=>jsx("div",{className:"flex flex-col justify-center items-center w-full h-full",children:jsx("video",{controls:true,src:r,className:"w-full max-h-full"})}),"VideoDriver");var Bt=memo(a(function({extension:o,blob:d,path:g,buffer:y,not_supported_message:w=" Sorry, this file type isn\u2019t supported yet."}){console.log("Driver props:",{extension:o,blob:d,path:g,buffer:y});let f=o.toLocaleLowerCase().trim(),P;if(g?P=g:d&&(P=URL.createObjectURL(d)),P){if(["jpeg","jpg","png","gif","bmp","webp"].includes(f))return jsx(Mt,{url:P});if(["mp3","wav","ogg","flac"].includes(f))return jsx(Tt,{url:P});if(["mp4","webm"].includes(f))return jsx(jt,{url:P});if(o==="pdf")return jsx(Oe,{url:P});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(f))return jsx(Et,{url:P,extension:f})}return f==="docx"?jsx(Rt,{url:P,blob:d}):jsx("div",{className:"h-full flex flex-col justify-center items-center",children:jsx(mb,{className:"mx-5",children:jsx(Wa,{variant:"h2",color:"text.light",weight:500,className:"text-center",children:w})})})},"Driver"));var Bs=a(r=>jsx("div",{className:"h-full w-full",children:jsx(Bt,{...r})}),"FileViewer");var $t=250,qs=a(({text:r,speed:o=50,onDone:d,markdown:g=false,markdownComponents:y={},className:w,...f})=>{let[P,L]=useState(""),B=useRef(null),H=useRef(null);return useEffect(()=>{let D=false;if(o>0){L(""),B.current=performance.now();let I=a(Z=>{if(D||!B.current)return;let t=Z-B.current,X=t/o>$t?o/2:o,G=t/o>$t?1.5:1,k=Math.floor(t/X*G);if(k>=r.length){L(r),D=true,d?.();return}L(r.slice(0,k)),H.current=requestAnimationFrame(I);},"tick");H.current=requestAnimationFrame(I);}else L(r),d?.();return ()=>{H.current&&cancelAnimationFrame(H.current);}},[r,o,d]),g?jsx("div",{className:w,children:jsx(Qr,{remarkPlugins:[eo],components:y,...f,children:P})}):jsx(Wa,{className:w,...f,children:P})},"Typewriter");var ao={timeout:2e3,message:"Copied!"},nc=a(({text:r,children:o,format:d="text/plain",tooltip:g})=>{let[y,w]=useState(false),f=useRef(null),P={...ao,...g},L=a(async()=>{"clipboard"in navigator?await navigator.clipboard.writeText(r):to(r,{format:d}),w(true),f.current&&clearTimeout(f.current),f.current=setTimeout(()=>w(false),P.timeout);},"handleCopy");return useEffect(()=>()=>{f.current&&clearTimeout(f.current);},[]),jsx(yb,{onMouseLeave:()=>w(false),className:y?"visible":"hidden",content:P.message,children:o({copy:L})})},"CopyToClipboard");var Ot=a(r=>new Date(r?Array.isArray(r)?r[1]||r[0]||new Date:r:new Date),"getInitValue"),Ne=a((r,o)=>{let d;if(o){let y=parse(r||"",o,new Date);if(isValid(y)&&getYear(y)>=1970)return y}let g=new Date(r||"");return isNaN(g.getTime())?d:g},"parseDate"),fo=a((r,o)=>{let d=r?Ne(r,o):void 0;return d&&o?format(d,o):r},"renderDate"),yc=a(({value:r,range:o,inline:d=false,minDate:g=new Date(getYear(new Date)-5,0,1),maxDate:y=new Date(getYear(new Date)+5,11,31),format:w="dd.MM.yyyy",onChange:f,...P})=>{let[L,B]=useState(getMonth(Ot(r))),[H,D]=useState(getYear(Ot(r))),I=useMemo(()=>{if(r){if(Array.isArray(r)){let t=Ne(r[0],w),X=Ne(r[1],w);return [t,X]}return Ne(r,w)}},[r]),Z=useCallback(t=>{if(o){let X=!!(I&&Array.isArray(I)&&I[0]),G=!!(I&&Array.isArray(I)&&I[1]);!X||X&&G?f?.([t.toString(),""]):X&&!G&&(t<I[0]?f?.([t.toString(),I[0].toString()]):f?.([I[0].toString(),t.toString()]));}else f?.(t.toString());},[o,I,f]);return d?jsx(Ht,{month:L,year:H,minDate:g,maxDate:y,selectedDate:I,onSelectDate:Z,onChangeMonth:B,onChangeYear:D}):o?jsx(mo,{range:true,value:r,onChange:f,...P}):jsx(yo,{value:r,onChange:f,minDate:g,maxDate:y,month:L,year:H,selectedDate:I,onChangeMonth:B,onChangeYear:D,onSelectDate:Z,formatStr:w,...P})},"DatePicker"),mo=a(({minDate:r,maxDate:o,value:d,onChange:g})=>null,"DatePickerGroupInput"),yo=a(({placeholder:r,value:o,onChange:d,inputProps:g,...y$1})=>{let[w,f]=useState(false),P=y();return jsx(Popover,{positions:["bottom","top","right","left"],align:"start",isOpen:w,onClickOutside:()=>f(false),content:jsx(mb,{children:jsx(Ht,{...y$1})}),containerStyle:{zIndex:`${P.zIndex.popover}`},children:jsx("div",{onClick:()=>f(true),children:jsx(ib,{...g,placeholder:r,value:fo(o,y$1.formatStr),onChange:L=>d?.(L.target.value)})})})},"DatePickerInput"),Ht=a(({month:r,year:o,selectedDate:d,minDate:g,maxDate:y,onSelectDate:w,onChangeMonth:f,onChangeYear:P})=>{let L=useMemo(()=>new Array(12).fill(null).map((k,V)=>{let T=new Date(0,V);return {value:V+1,inputDisplay:format(T,"MMMM")}}),[]),B=useMemo(()=>{let k=getYear(g),T=getYear(y)-k+1;return new Array(T).fill(null).map((M,K)=>{let te=k+K;return {value:te,inputDisplay:te.toString()}})},[g,y]),H$1=useMemo(()=>new Array(7).fill(null).map((k,V)=>{let T=startOfWeek(new Date,{weekStartsOn:V});return format(T,"EEE")}),[]),D=useMemo(()=>{let k=getWeeksInMonth(new Date(o,r)),V=startOfMonth(new Date(o,r)),T=previousMonday(V),M=differenceInDays(V,T);return new Array(k*7).fill(null).map((K,te)=>new Date(o,r,te-M+1))},[r,o]),I=useCallback(()=>{r===0?(P(o-1),f(11)):f(r-1);},[r,o]),Z=useCallback(()=>{r===11?(P(o+1),f(0)):f(r+1);},[r,o]),t=useMemo(()=>g?!(o<getYear(g)||o===getYear(g)&&r<=getMonth(g)):true,[r,o,g]),X=useMemo(()=>y?!(o>getYear(y)||o===getYear(y)&&r>=getMonth(y)):true,[r,o,y]),G$1=useCallback(k=>{k.stopPropagation();},[]);return jsxs("div",{className:"flex flex-col date-picker-calendar",onClick:G$1,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:I}),jsxs("div",{className:"flex-1 flex justify-center gap-1",children:[jsx(gb,{placeholder:"",hasBorder:false,selected:r+1,options:L,onSelect:k=>f(k-1),maxWidth:150,maxHeight:300}),jsx(gb,{placeholder:"",hasBorder:false,selected:o,options:B,onSelect:k=>P(k),maxWidth:100,maxHeight:300})]}),X&&jsx(z,{size:"small",variant:"empty",icon:jsx(H,{}),onClick:Z})]}),jsx("div",{className:"grid grid-cols-7 gap-2",children:H$1.map(k=>jsx("div",{className:"text-center",children:k},k))}),jsx("div",{className:"grid grid-cols-7 gap-2 mt-2",children:D.map(k=>{let V=getMonth(k)===r,T=format(k,"yyyy-MM-dd")===format(new Date,"yyyy-MM-dd"),M=d&&(Array.isArray(d)&&(d[0]&&format(k,"yyyy-MM-dd")===format(d[0],"yyyy-MM-dd")||d[1]&&format(k,"yyyy-MM-dd")===format(d[1],"yyyy-MM-dd"))||!Array.isArray(d)&&format(k,"yyyy-MM-dd")===format(d,"yyyy-MM-dd")),K=d&&Array.isArray(d)&&d[0]&&d[1]&&k>d[0]&&k<d[1],te=g&&differenceInDays(k,g)<0||y&&differenceInDays(k,y)>0||!V;return jsx(bo,{date:k,isCurrentMonth:V,isCurrentDay:T,isSelected:!!M,isInRange:!!K,isDisabled:!!te,onSelectDate:w},k.toISOString())})})]})},"DatePickerCalendar"),bo=a(({date:r,isCurrentMonth:o,isCurrentDay:d,isSelected:g,isInRange:y,isDisabled:w,onSelectDate:f})=>jsx("div",{className:`text-center p-2 cursor-pointer rounded ${w?"text-gray-400 cursor-not-allowed":g?"bg-blue-500 text-white":y?"bg-blue-100":d?"text-blue-500":o?"text-black":"text-gray-400"} ${w?"":g?"hover:bg-blue-600":"hover:bg-gray-100"}`,onClick:a(L=>{w||f(r);},"handleClick"),children:format(r,"d")}),"CalendarDay");var xo=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"),ko=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"),Do=a(r=>{switch(r){case "bottom":return "translate-y-4";case "top":default:return "-translate-y-4"}},"getTransitionStarting"),_t=a(({id:r,color:o="default",message:d,duration:g,transitionDirection:y,cancelable:w=true,onClose:f})=>{let[P,L]=useState(false),[B,H]=useState(false),D=useRef(null),I=useCallback(()=>{L(true),D.current=setTimeout(()=>{f(r);},300);},[r,f]);return useEffect(()=>{if(H(true),g&&g<1/0){let Z=setTimeout(()=>{I();},g);return ()=>clearTimeout(Z)}},[g,I]),useEffect(()=>()=>{D.current&&clearTimeout(D.current);},[]),jsx("div",{className:`max-w-xs
|
|
66
|
+
`);var Et=a(({url:r})=>{let[o,c]=useState(1),[p,h]=useState(),b=Lt.useRef(null),g=Lt.useRef(null),S=a(()=>{c(R=>Math.min(R+.25,4));},"handleZoomIn");return jsxs("div",{ref:g,className:"h-full w-full flex flex-col",children:[jsxs("div",{className:"flex justify-center items-stretch p-5.5 gap-1 border-b border-gray-200 relative ",children:[jsx(z,{variant:"outlined","aria-label":"zoom-out",color:"secondary",size:"small",icon:jsx(Pa,{style:{width:20,height:20}}),onClick:a(()=>{c(R=>Math.max(R-.25,.25));},"handleZoomOut"),disabled:o<=.25,p:5}),jsxs(mb,{py:5,px:8,children:[o*100,"%"]}),jsx(z,{variant:"outlined","aria-label":"zoom-in",size:"small",color:"secondary",icon:jsx(ma,{style:{width:14,height:14}}),onClick:S,disabled:o>=4,p:8})]}),jsx("div",{className:"h-full w-full overflow-auto",children:jsx("img",{src:r,ref:b,alt:"image",className:"block w-auto max-w-none object-contain",style:{transition:"all 0.2s ease-in-out",marginInline:"auto",marginBlock:10,flexShrink:0,...p==="width"&&{width:`calc(${o*100}% - 20px)`},...p==="height"&&{height:`calc(${o*100}% - 20px)`}},onLoad:()=>{if(b.current&&g.current){let R=b.current.width,A=b.current.height,x=R<A?"height":"width";h(x);}}})})]})},"ImageDriver");var jt=a(({url:r})=>jsx("div",{className:"flex flex-col justify-center items-center w-full h-full p-5.5",children:jsx("audio",{controls:true,src:r,className:"w-full"})}),"AudioDriver");var Ve=a(({url:r})=>{let[o,c]=useState(null),[p,h]=useState(false),[b,g]=useState(true),[S,I]=useState(null);return useEffect(()=>{h(true);},[]),useEffect(()=>{if(!p)return;a(async()=>{try{let A=await import('./PdfDriver-7VZZUN7X.mjs');c(()=>A.PdfDriver),g(!1);}catch(A){console.error("Failed to load PDF driver:",A),I("Failed to load PDF viewer"),g(false);}},"loadPdfDriver")();},[p]),p?b?jsx("div",{className:"flex items-center justify-center h-full w-full",children:jsx("div",{className:"text-gray-500",children:"Loading PDF viewer..."})}):S||!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:S||"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 At=50,Qr=1e4,$t=a(({url:r,blob:o})=>{let c=useRef(null),[p,h]=useState(null),[b,g]=useState(true);return useEffect(()=>{a(async()=>{if(c.current)try{if(g(!0),h(null),!o&&r&&(o=await(await fetch(r)).blob()),!o){h("\u041D\u0435 \u043D\u0430\u0434\u0430\u043D\u043E \u0434\u043B\u044F DOCX \u0444\u0430\u0439\u043B\u0443");return}if(o.size/(1024*1024)>At){h(`\u0424\u0430\u0439\u043B \u0437\u0430\u043D\u0430\u0434\u0442\u043E \u0432\u0435\u043B\u0438\u043A\u0438\u0439 (> ${At} \u041C\u0411)`);return}c.current.innerHTML="";let R=renderAsync(o,c.current,void 0,{debug:!0,experimental:!0,hideWrapperOnPrint:!0}),A=new Promise((x,T)=>setTimeout(()=>T(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")),Qr));await Promise.race([R,A]),g(!1);}catch(I){h(I?.message||"\u041D\u0435 \u0432\u0434\u0430\u043B\u043E\u0441\u044F \u0432\u0456\u0434\u043A\u0440\u0438\u0442\u0438 DOCX \u0444\u0430\u0439\u043B"),g(false);}},"renderDocument")();},[r,o]),jsxs(Fragment$1,{children:[!!p&&!b&&jsx("div",{className:"text-red-500 p-5",children:p}),b&&jsx("div",{className:"flex items-center justify-center p-5",children:"\u0417\u0430\u0432\u0430\u043D\u0442\u0430\u0436\u0435\u043D\u043D\u044F..."}),jsx("div",{ref:c,className:"w-full h-full overflow-auto [&_table]:max-w-full! [&>div.docx-wrapper]:w-fit",style:{boxSizing:"border-box"}})]})},"DocxDriver");var no=a(r=>({js:"javascript",jsx:"jsx",ts:"typescript",tsx:"tsx",json:"json",html:"html",css:"css",scss:"scss",py:"python",java:"java",cpp:"cpp",c:"c",cs:"csharp",php:"php",rb:"ruby",go:"go",rs:"rust",swift:"swift",kt:"kotlin",xml:"xml",yaml:"yaml",yml:"yaml",md:"markdown",sql:"sql",sh:"bash",bash:"bash",txt:"text"})[r]||"text","getLanguageFromExtension"),Ot=a(({url:r,extension:o})=>{let[c,p]=useState(""),[h,b]=useState(true),[g,S]=useState(null);if(useEffect(()=>{a(async()=>{try{b(!0),S(null);let x=await fetch(r);if(!x.ok)throw new Error(`Failed to load file: ${x.statusText}`);let T=await x.text();p(T);}catch(x){S(x instanceof Error?x.message:"Failed to load text content");}finally{b(false);}},"loadTextContent")();},[r]),h)return jsx("div",{className:"flex items-center justify-center p-8",children:jsx("div",{className:"text-gray-500",children:"Loading text content..."})});if(g)return jsx("div",{className:"flex items-center justify-center p-8",children:jsxs("div",{className:"text-red-500",children:["Error: ",g]})});let I=no(o);return jsx("div",{className:"h-full w-full overflow-auto",children:I!=="text"?jsx(Prism,{className:"min-h-full! m-0! py-0!",language:I,style:darcula,showLineNumbers:true,wrapLines:true,children:c}):jsx("pre",{className:"whitespace-pre-wrap p-4 text-sm font-mono bg-gray-50 min-h-full",children:c})})},"TextDriver");var Ht=a(({url:r})=>jsx("div",{className:"flex flex-col justify-center items-center w-full h-full",children:jsx("video",{controls:true,src:r,className:"w-full max-h-full"})}),"VideoDriver");var Xt=memo(a(function({extension:o,blob:c,path:p,buffer:h,not_supported_message:b=" Sorry, this file type isn\u2019t supported yet."}){console.log("Driver props:",{extension:o,blob:c,path:p,buffer:h});let g=o.toLocaleLowerCase().trim(),S;if(p?S=p:c&&(S=URL.createObjectURL(c)),S){if(["jpeg","jpg","png","gif","bmp","webp"].includes(g))return jsx(Et,{url:S});if(["mp3","wav","ogg","flac"].includes(g))return jsx(jt,{url:S});if(["mp4","webm"].includes(g))return jsx(Ht,{url:S});if(o==="pdf")return jsx(Ve,{url:S});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(g))return jsx(Ot,{url:S,extension:g})}return g==="docx"?jsx($t,{url:S,blob:c}):jsx("div",{className:"h-full flex flex-col justify-center items-center",children:jsx(mb,{className:"mx-5",children:jsx(Wa,{variant:"h2",color:"text.light",weight:500,className:"text-center",children:b})})})},"Driver"));var ec=a(r=>jsx("div",{className:"h-full w-full",children:jsx(Xt,{...r})}),"FileViewer");var Gt=250,pc=a(({text:r,speed:o=50,onDone:c,markdown:p=false,markdownComponents:h={},className:b,...g})=>{let[S,I]=useState(""),R=useRef(null),A=useRef(null);return useEffect(()=>{let x=false;if(o>0){I(""),R.current=performance.now();let T=a(V=>{if(x||!R.current)return;let t=V-R.current,$=t/o>Gt?o/2:o,U=t/o>Gt?1.5:1,k=Math.floor(t/$*U);if(k>=r.length){I(r),x=true,c?.();return}I(r.slice(0,k)),A.current=requestAnimationFrame(T);},"tick");A.current=requestAnimationFrame(T);}else I(r),c?.();return ()=>{A.current&&cancelAnimationFrame(A.current);}},[r,o,c]),p?jsx("div",{className:b,children:jsx(lo,{remarkPlugins:[uo],components:h,...g,children:S})}):jsx(Wa,{className:b,...g,children:S})},"Typewriter");var mo={timeout:2e3,message:"Copied!"},kc=a(({text:r,children:o,format:c="text/plain",tooltip:p})=>{let[h,b]=useState(false),g=useRef(null),S={...mo,...p},I=a(async()=>{"clipboard"in navigator?await navigator.clipboard.writeText(r):po(r,{format:c}),b(true),g.current&&clearTimeout(g.current),g.current=setTimeout(()=>b(false),S.timeout);},"handleCopy");return useEffect(()=>()=>{g.current&&clearTimeout(g.current);},[]),jsx(yb,{onMouseLeave:()=>b(false),className:h?"visible":"hidden",content:S.message,children:o({copy:I})})},"CopyToClipboard");var Vt=a(r=>new Date(r?Array.isArray(r)?r[1]||r[0]||new Date:r:new Date),"getInitValue"),Fe=a((r,o)=>{let c;if(o){let h=parse(r||"",o,new Date);if(isValid(h)&&getYear(h)>=1970)return h}let p=new Date(r||"");return isNaN(p.getTime())?c:p},"parseDate"),So=a((r,o)=>{let c=r?Fe(r,o):void 0;return c&&o?format(c,o):r},"renderDate"),jc=a(({value:r,range:o,inline:c=false,minDate:p=new Date(getYear(new Date)-5,0,1),maxDate:h=new Date(getYear(new Date)+5,11,31),format:b="dd.MM.yyyy",onChange:g,...S})=>{let[I,R]=useState(getMonth(Vt(r))),[A,x]=useState(getYear(Vt(r))),T=useMemo(()=>{if(r){if(Array.isArray(r)){let t=Fe(r[0],b),$=Fe(r[1],b);return [t,$]}return Fe(r,b)}},[r]),V=useCallback(t=>{if(o){let $=!!(T&&Array.isArray(T)&&T[0]),U=!!(T&&Array.isArray(T)&&T[1]);!$||$&&U?g?.([t.toString(),""]):$&&!U&&(t<T[0]?g?.([t.toString(),T[0].toString()]):g?.([T[0].toString(),t.toString()]));}else g?.(t.toString());},[o,T,g]);return c?jsx(qt,{month:I,year:A,minDate:p,maxDate:h,selectedDate:T,onSelectDate:V,onChangeMonth:R,onChangeYear:x}):o?jsx(Mo,{range:true,value:r,onChange:g,...S}):jsx(Co,{value:r,onChange:g,minDate:p,maxDate:h,month:I,year:A,selectedDate:T,onChangeMonth:R,onChangeYear:x,onSelectDate:V,formatStr:b,...S})},"DatePicker"),Mo=a(({minDate:r,maxDate:o,value:c,onChange:p})=>null,"DatePickerGroupInput"),Co=a(({placeholder:r,value:o,onChange:c,inputProps:p,...h})=>{let[b,g]=useState(false),S=y();return jsx(Popover,{positions:["bottom","top","right","left"],align:"start",isOpen:b,onClickOutside:()=>g(false),content:jsx(mb,{children:jsx(qt,{...h})}),containerStyle:{zIndex:`${S.zIndex.popover}`},children:jsx("div",{onClick:()=>g(true),children:jsx(ib,{...p,placeholder:r,value:So(o,h.formatStr),onChange:I=>c?.(I.target.value)})})})},"DatePickerInput"),qt=a(({month:r,year:o,selectedDate:c,minDate:p,maxDate:h,onSelectDate:b,onChangeMonth:g,onChangeYear:S})=>{let I=useMemo(()=>new Array(12).fill(null).map((k,E)=>{let M=new Date(0,E);return {value:E+1,inputDisplay:format(M,"MMMM")}}),[]),R=useMemo(()=>{let k=getYear(p),M=getYear(h)-k+1;return new Array(M).fill(null).map((D,K)=>{let q=k+K;return {value:q,inputDisplay:q.toString()}})},[p,h]),A=useMemo(()=>new Array(7).fill(null).map((k,E)=>{let M=startOfWeek(new Date,{weekStartsOn:E});return format(M,"EEE")}),[]),x=useMemo(()=>{let k=getWeeksInMonth(new Date(o,r)),E=startOfMonth(new Date(o,r)),M=previousMonday(E),D=differenceInDays(E,M);return new Array(k*7).fill(null).map((K,q)=>new Date(o,r,q-D+1))},[r,o]),T=useCallback(()=>{r===0?(S(o-1),g(11)):g(r-1);},[r,o]),V=useCallback(()=>{r===11?(S(o+1),g(0)):g(r+1);},[r,o]),t=useMemo(()=>p?!(o<getYear(p)||o===getYear(p)&&r<=getMonth(p)):true,[r,o,p]),$=useMemo(()=>h?!(o>getYear(h)||o===getYear(h)&&r>=getMonth(h)):true,[r,o,h]),U=useCallback(k=>{k.stopPropagation();},[]);return jsxs("div",{className:"flex flex-col date-picker-calendar",onClick:U,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:T}),jsxs("div",{className:"flex-1 flex justify-center gap-1",children:[jsx(gb,{placeholder:"",hasBorder:false,selected:r+1,options:I,onSelect:k=>g(k-1),maxWidth:150,maxHeight:300}),jsx(gb,{placeholder:"",hasBorder:false,selected:o,options:R,onSelect:k=>S(k),maxWidth:100,maxHeight:300})]}),$&&jsx(z,{size:"small",variant:"empty",icon:jsx(H,{}),onClick:V})]}),jsx("div",{className:"grid grid-cols-7 gap-2",children:A.map(k=>jsx("div",{className:"text-center",children:k},k))}),jsx("div",{className:"grid grid-cols-7 gap-2 mt-2",children:x.map(k=>{let E=getMonth(k)===r,M=format(k,"yyyy-MM-dd")===format(new Date,"yyyy-MM-dd"),D=c&&(Array.isArray(c)&&(c[0]&&format(k,"yyyy-MM-dd")===format(c[0],"yyyy-MM-dd")||c[1]&&format(k,"yyyy-MM-dd")===format(c[1],"yyyy-MM-dd"))||!Array.isArray(c)&&format(k,"yyyy-MM-dd")===format(c,"yyyy-MM-dd")),K=c&&Array.isArray(c)&&c[0]&&c[1]&&k>c[0]&&k<c[1],q=p&&differenceInDays(k,p)<0||h&&differenceInDays(k,h)>0||!E;return jsx(To,{date:k,isCurrentMonth:E,isCurrentDay:M,isSelected:!!D,isInRange:!!K,isDisabled:!!q,onSelectDate:b},k.toISOString())})})]})},"DatePickerCalendar"),To=a(({date:r,isCurrentMonth:o,isCurrentDay:c,isSelected:p,isInRange:h,isDisabled:b,onSelectDate:g})=>jsx("div",{className:`text-center p-2 cursor-pointer rounded ${b?"text-gray-400 cursor-not-allowed":p?"bg-blue-500 text-white":h?"bg-blue-100":c?"text-blue-500":o?"text-black":"text-gray-400"} ${b?"":p?"hover:bg-blue-600":"hover:bg-gray-100"}`,onClick:a(I=>{b||g(r);},"handleClick"),children:format(r,"d")}),"CalendarDay");var Lo=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"),Ro=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"),Eo=a(r=>{switch(r){case "bottom":return "translate-y-4";case "top":default:return "-translate-y-4"}},"getTransitionStarting"),Qt=a(({id:r,color:o="default",message:c,duration:p,transitionDirection:h,cancelable:b=true,onClose:g})=>{let[S,I]=useState(false),[R,A]=useState(false),x=useRef(null),T=useCallback(()=>{I(true),x.current=setTimeout(()=>{g(r);},300);},[r,g]);return useEffect(()=>{if(A(true),p&&p<1/0){let V=setTimeout(()=>{T();},p);return ()=>clearTimeout(V)}},[p,T]),useEffect(()=>()=>{x.current&&clearTimeout(x.current);},[]),jsx("div",{className:`max-w-xs
|
|
67
67
|
border
|
|
68
68
|
w-full
|
|
69
69
|
text-sm
|
|
@@ -71,8 +71,8 @@ ${r?`
|
|
|
71
71
|
transition-all
|
|
72
72
|
ease-in-out
|
|
73
73
|
duration-300
|
|
74
|
-
${
|
|
75
|
-
${
|
|
76
|
-
${
|
|
77
|
-
export{
|
|
74
|
+
${S||!R?"opacity-0":"opacity-100"}
|
|
75
|
+
${R?"translate-y-0":Eo(h)}
|
|
76
|
+
${Lo(o)} ${Ro(o)}`,children:jsxs("div",{className:"flex p-4 ",children:[c,b&&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:T,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 jo=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"),qc=a(({items:r,onClose:o,position:c="top-right",offset:p=4})=>{let h=useMemo(()=>c.startsWith("top")?"top":"bottom",[c]);return jsx("div",{className:`fixed flex min-w-0 max-w-xs w-full flex-col z-50 gap-2 ${jo(c,p)}`,children:r.map(b=>jsx(Qt,{transitionDirection:h,...b,onClose:o},b.id))})},"ToastsList");
|
|
77
|
+
export{Pi as Container,kc as CopyToClipboard,jc as DatePicker,qt as DatePickerCalendar,ec as FileViewer,ss as FullscreenCard,Hr as Graph2D,ci as PageContent,oi as PageLayout,Ii as SplitterLayout,dr as Styled,nr as StyledContainer,sr as StyledMain,hi as SubNav,qc as ToastsList,pc as Typewriter};//# sourceMappingURL=index.mjs.map
|
|
78
78
|
//# sourceMappingURL=index.mjs.map
|