!function(t,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports):"function"==typeof define&&define.amd?define(["exports"],n):n((t="undefined"!=typeof globalThis?globalThis:t||self).predicates={})}(this,(function(t){"use strict";const n=11102230246251565e-32,e=134217729,r=(3+8*n)*n;function o(t,n,e,r,o){let a,s,f,u,i=n[0],c=r[0],h=0,b=0;c>i==c>-i?(a=i,i=n[++h]):(a=c,c=r[++b]);let l=0;if(hi==c>-i?(s=i+a,f=a-(s-i),i=n[++h]):(s=c+a,f=a-(s-c),c=r[++b]),a=s,0!==f&&(o[l++]=f);hi==c>-i?(s=a+i,u=s-a,f=a-(s-u)+(i-u),i=n[++h]):(s=a+c,u=s-a,f=a-(s-u)+(c-u),c=r[++b]),a=s,0!==f&&(o[l++]=f);for(;h=Ut||-St>=Ut)return St;if(mt=t-Et,ut=t-(Et+mt)+(mt-W),mt=n-Jt,bt=n-(Jt+mt)+(mt-X),mt=s-Ot,pt=s-(Ot+mt)+(mt-Y),mt=u-Gt,it=u-(Gt+mt)+(mt-W),mt=N-Kt,lt=N-(Kt+mt)+(mt-X),mt=O-Pt,yt=O-(Pt+mt)+(mt-Y),mt=P-Ht,ct=P-(Ht+mt)+(mt-W),mt=Q-Lt,Mt=Q-(Lt+mt)+(mt-X),mt=R-Qt,xt=R-(Qt+mt)+(mt-Y),mt=S-It,ht=S-(It+mt)+(mt-W),mt=U-Nt,dt=U-(Nt+mt)+(mt-X),mt=V-Rt,gt=V-(Rt+mt)+(mt-Y),0===ut&&0===bt&&0===pt&&0===it&&0===lt&&0===yt&&0===ct&&0===Mt&&0===xt&&0===ht&&0===dt&&0===gt)return St;Ut=c*Z+r*Math.abs(St);const Vt=Et*lt+Kt*ut-(Jt*it+Gt*bt),Wt=Gt*Mt+Lt*it-(Kt*ct+Ht*lt),Xt=Ht*dt+Nt*ct-(Lt*ht+It*Mt),Yt=It*bt+Jt*ht-(Nt*ut+Et*dt),Zt=Et*Mt+Lt*ut-(Jt*ct+Ht*bt),$t=Gt*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N=y*g,O=L-N,P=p*j,Q=x*m,R=P-Q,S=d*d+g*g+w*w,U=p*p+m*m+A*A,V=y*y+T*T+F*F,W=x*x+j*j+k*k,X=V*(k*z+w*R+A*K)-W*(w*D-A*O+F*z)+(S*(A*H-F*R+k*D)-U*(F*K+k*O+w*H)),Y=Math.abs(w),Z=Math.abs(A),$=Math.abs(F),_=Math.abs(k),tt=Math.abs(q)+Math.abs(v),nt=Math.abs(B)+Math.abs(C),et=Math.abs(E)+Math.abs(G),rt=Math.abs(I)+Math.abs(J),ot=Math.abs(L)+Math.abs(N),at=Math.abs(P)+Math.abs(Q),ft=(et*Z+at*$+nt*_)*S+(rt*$+ot*_+et*Y)*U+(tt*_+at*Y+rt*Z)*V+(nt*Y+ot*Z+tt*$)*W,ut=17763568394002532e-31*ft;return X>ut||-X>ut?X:-st(t,n,e,r,o,a,s,f,u,i,c,h,b,l,M,ft)},t.inspherefast=function(t,n,e,r,o,a,s,f,u,i,c,h,b,l,M){const d=t-b,p=r-b,y=s-b,x=i-b,g=n-l,m=o-l,T=f-l,j=c-l,w=e-M,A=a-M,F=u-M,k=h-M,q=d*m-p*g,v=p*T-y*m,z=y*j-x*T,B=x*g-d*j,C=d*T-y*g,D=p*j-x*m;return(y*y+T*T+F*F)*(k*q+w*D+A*B)-(x*x+j*j+k*k)*(w*v-A*C+F*q)+((d*d+g*g+w*w)*(A*z-F*D+k*v)-(p*p+m*m+A*A)*(F*B+k*C+w*z))}}));