import{e as T,q as j,du as S}from"./index-BuFgUdF6.js";/**
 * @license lucide-react v0.559.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const v=[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],ot=T("eye-off",v);/**
 * @license lucide-react v0.559.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const R=[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]],rt=T("grip-vertical",R);class D{constructor(){this.componentControls=new Set}subscribe(t){return this.componentControls.add(t),()=>this.componentControls.delete(t)}start(t,e){this.componentControls.forEach(o=>{o.start(t.nativeEvent||t,e)})}cancel(){this.componentControls.forEach(t=>{t.cancel()})}stop(){this.componentControls.forEach(t=>{t.stop()})}}const G=()=>new D;function it(){return j(G)}const V=1e-8,W=100,b=3,q=4,E=5,F=20,L=.001,x=.3,P=30,Y=.05,z=.7,C=.3;function p(n,t){let e=0;for(let o=0;o<n.length;o++)e+=n[o]*t[o];return e}function H(n){return Math.sqrt(p(n,n))}function I(n){const t=H(n);if(t>0)for(let e=0;e<n.length;e++)n[e]/=t}function A(n,t){const e=p(n,t);for(let o=0;o<n.length;o++)n[o]-=e*t[o]}function K(n,t){const e=n.length,o=new Array(e).fill(0);for(let i=0;i<e;i++)for(let c=0;c<e;c++)o[i]+=n[i][c]*t[c];return o}function U(n){const t=Math.exp(-n/P);return Math.max(Y,t)}function X(n,t,e,o){const i=t.length,c=new Map(t.map((s,l)=>[s,l])),f=Array(i).fill(null).map(()=>Array(i).fill(0));for(const s of n){const l=c.get(s.fromHash),r=c.get(s.toHash);if(l!==void 0&&r!==void 0&&l!==r){const u=s.strength*s.certainCount;let a=1;if(e){const M=e.get(s.fromHash),d=e.get(s.toHash);if(M&&d){const O=S(M[0],M[1],d[0],d[1])/1e3;a=U(O)}}let h=1;if(o){const M=[s.fromHash,s.toHash].sort().join("-");h=1-(o.get(M)??0)*z}const g=s.symmetryRatio??0,_=C+(1-C)*g,m=Math.pow(u,1-x)*Math.pow(a,x)*h*_;f[l][r]=m,f[r][l]=m}}return f}function N(n){const t=n.length,e=Array(t).fill(null).map(()=>Array(t).fill(0));for(let o=0;o<t;o++){let i=0;for(let c=0;c<t;c++)i+=n[o][c],e[o][c]=-n[o][c];e[o][o]=i}return e}function k(n){const t=n.length,e=Array(t).fill(1/Math.sqrt(t));let o=0;for(let l=0;l<t;l++){let r=0;for(let u=0;u<t;u++)r+=Math.abs(n[l][u]);o=Math.max(o,r)}const i=Array(t).fill(null).map(()=>Array(t).fill(0));for(let l=0;l<t;l++){for(let r=0;r<t;r++)i[l][r]=-n[l][r];i[l][l]=o+i[l][l]}let c=Array(t).fill(0).map((l,r)=>Math.sin(r*12.9898)*43758.5453%1-.5);A(c,e),I(c);let f=0;for(let l=0;l<W;l++){const r=K(i,c);A(r,e);const u=p(r,r)/p(c,r);if(I(r),c=r,Math.abs(u-f)<V){const a=o-u;return{vector:c,eigenvalue:a}}f=u}const s=o-f;return{vector:c,eigenvalue:s}}function B(n,t){if(n.length<2)return 0;const e=[];for(const f of n){const s=t.get(f);s&&e.push(s)}if(e.length<2)return 0;const o=Math.min(e.length,20),i=e.length<=o?e:Z(e,o);let c=0;for(let f=0;f<i.length;f++)for(let s=f+1;s<i.length;s++){const l=S(i[f][0],i[f][1],i[s][0],i[s][1])/1e3;c=Math.max(c,l)}return c}function Z(n,t){if(t>=n.length)return n;const e=[],o=n.length/t;for(let i=0;i<t;i++)e.push(n[Math.floor(i*o)]);return e}function $(n,t,e,o){const i=t.length;if(i<b)return null;const c=new Set(t),f=n.filter(g=>c.has(g.fromHash)&&c.has(g.toHash));if(f.length===0)return null;const s=X(f,t,e,o),l=N(s),{vector:r,eigenvalue:u}=k(l);if(u<L)return null;const a=[],h=[];for(let g=0;g<i;g++)r[g]<0?a.push(t[g]):h.push(t[g]);return a.length<E||h.length<E?null:{group0:a,group1:h,fiedlerValue:u}}function ct(n,t,e,o){const i=t.length;if(i<b)return{communities:new Map([[0,t]]),nodePartitions:t.map(a=>({hash:a,community:0,fiedlerValue:0})),numCommunities:1,fiedlerValue:0,isConnected:i<=1};const c=[];let f=1/0;const s=[[t,0]];for(;s.length>0;){const[a,h]=s.shift();if((e?B(a,e):0)>F&&h<q&&a.length>=E*2){const m=$(n,a,e,o);if(m){f=Math.min(f,m.fiedlerValue),s.push([m.group0,h+1]),s.push([m.group1,h+1]);continue}}c.push(a)}const l=new Map,r=[],u=new Map;for(let a=0;a<c.length;a++){l.set(a,c[a]);for(const h of c[a])u.set(h,a)}for(const a of t)r.push({hash:a,community:u.get(a)??0,fiedlerValue:0});return{communities:l,nodePartitions:r,numCommunities:c.length,fiedlerValue:f===1/0?0:f,isConnected:!0}}function lt(n){const t=["rgba(139, 92, 246, 0.25)","rgba(16, 185, 129, 0.25)","rgba(245, 158, 11, 0.25)","rgba(239, 68, 68, 0.25)","rgba(59, 130, 246, 0.25)","rgba(236, 72, 153, 0.25)","rgba(20, 184, 166, 0.25)","rgba(249, 115, 22, 0.25)"];return t[n%t.length]}function st(n,t){if(t.length<b)return 0;const e=t.length,o=new Map(t.map((s,l)=>[s,l])),i=Array(e).fill(null).map(()=>Array(e).fill(0));for(const s of n){const l=o.get(s.fromHash),r=o.get(s.toHash);l!==void 0&&r!==void 0&&l!==r&&(i[l][r]=1,i[r][l]=1)}const c=N(i),{eigenvalue:f}=k(c);return Math.max(0,f)}function ft(n){const t=["rgba(139, 92, 246, 0.6)","rgba(16, 185, 129, 0.6)","rgba(245, 158, 11, 0.6)","rgba(239, 68, 68, 0.6)","rgba(59, 130, 246, 0.6)","rgba(236, 72, 153, 0.6)","rgba(20, 184, 166, 0.6)","rgba(249, 115, 22, 0.6)"];return t[n%t.length]}function at(n,t){let e,o;if(t===void 0)for(const i of n)i!=null&&(e===void 0?i>=i&&(e=o=i):(e>i&&(e=i),o<i&&(o=i)));else{let i=-1;for(let c of n)(c=t(c,++i,n))!=null&&(e===void 0?c>=c&&(e=o=c):(e>c&&(e=c),o<c&&(o=c)))}return[e,o]}const J=Math.sqrt(50),Q=Math.sqrt(10),tt=Math.sqrt(2);function y(n,t,e){const o=(t-n)/Math.max(0,e),i=Math.floor(Math.log10(o)),c=o/Math.pow(10,i),f=c>=J?10:c>=Q?5:c>=tt?2:1;let s,l,r;return i<0?(r=Math.pow(10,-i)/f,s=Math.round(n*r),l=Math.round(t*r),s/r<n&&++s,l/r>t&&--l,r=-r):(r=Math.pow(10,i)*f,s=Math.round(n/r),l=Math.round(t/r),s*r<n&&++s,l*r>t&&--l),l<s&&.5<=e&&e<2?y(n,t,e*2):[s,l,r]}function ut(n,t,e){if(t=+t,n=+n,e=+e,!(e>0))return[];if(n===t)return[n];const o=t<n,[i,c,f]=o?y(t,n,e):y(n,t,e);if(!(c>=i))return[];const s=c-i+1,l=new Array(s);if(o)if(f<0)for(let r=0;r<s;++r)l[r]=(c-r)/-f;else for(let r=0;r<s;++r)l[r]=(c-r)*f;else if(f<0)for(let r=0;r<s;++r)l[r]=(i+r)/-f;else for(let r=0;r<s;++r)l[r]=(i+r)*f;return l}function w(n,t,e){return t=+t,n=+n,e=+e,y(n,t,e)[2]}function ht(n,t,e){t=+t,n=+n,e=+e;const o=t<n,i=o?w(t,n,e):w(n,t,e);return(o?-1:1)*(i<0?1/-i:i)}function gt(n,t){let e;for(const o of n)o!=null&&(e<o||e===void 0&&o>=o)&&(e=o);return e}export{ot as E,rt as G,ut as a,w as b,st as c,lt as d,at as e,ct as f,ft as g,gt as m,ht as t,it as u};
