define(["exports","./when-cbf8cd21","./Check-35e1a91d","./Math-6a1814d8","./Cartesian2-c451a606","./WebGLConstants-95ceb4e9","./ComponentDatatype-7ee14e67","./GeometryAttribute-6f280ece","./EllipsoidRhumbLine-8c93f67a"],function(e,T,t,W,P,n,I,B,N){"use strict";function r(e,t,n){n=n||2;var r,a,i,x,u,o,s,p=t&&t.length,h=p?t[0]*n:e.length,f=l(e,0,h,n,!0),y=[];if(!f||f.next===f.prev)return y;if(p&&(f=function(e,t,n,r){var a,i,x,u,o,s=[];for(a=0,i=t.length;a80*n){r=i=e[0],a=x=e[1];for(var v=n;vi.x?a.x>x.x?a.x:x.x:i.x>x.x?i.x:x.x,p=a.y>i.y?a.y>x.y?a.y:x.y:i.y>x.y?i.y:x.y,h=g(u,o,t,n,r),f=g(s,p,t,n,r),y=e.prevZ,v=e.nextZ;y&&y.z>=h&&v&&v.z<=f;){if(y!==e.prev&&y!==e.next&&b(a.x,a.y,i.x,i.y,x.x,x.y,y.x,y.y)&&0<=E(y.prev,y,y.next))return!1;if(y=y.prevZ,v!==e.prev&&v!==e.next&&b(a.x,a.y,i.x,i.y,x.x,x.y,v.x,v.y)&&0<=E(v.prev,v,v.next))return!1;v=v.nextZ}for(;y&&y.z>=h;){if(y!==e.prev&&y!==e.next&&b(a.x,a.y,i.x,i.y,x.x,x.y,y.x,y.y)&&0<=E(y.prev,y,y.next))return!1;y=y.prevZ}for(;v&&v.z<=f;){if(v!==e.prev&&v!==e.next&&b(a.x,a.y,i.x,i.y,x.x,x.y,v.x,v.y)&&0<=E(v.prev,v,v.next))return!1;v=v.nextZ}return!0}function f(e,t,n){var r=e;do{var a=r.prev,i=r.next.next;!v(a,i)&&M(a,r,r.next,i)&&Z(a,i)&&Z(i,a)&&(t.push(a.i/n),t.push(r.i/n),t.push(i.i/n),A(r),A(r.next),r=e=i),r=r.next}while(r!==e);return c(r)}function y(e,t,n,r,a,i){var x,u,o=e;do{for(var s=o.next.next;s!==o.prev;){if(o.i!==s.i&&(u=s,(x=o).next.i!==u.i&&x.prev.i!==u.i&&!function(e,t){var n=e;do{if(n.i!==e.i&&n.next.i!==e.i&&n.i!==t.i&&n.next.i!==t.i&&M(n,n.next,e,t))return!0;n=n.next}while(n!==e);return!1}(x,u)&&(Z(x,u)&&Z(u,x)&&function(e,t){var n=e,r=!1,a=(e.x+t.x)/2,i=(e.y+t.y)/2;for(;n.y>i!=n.next.y>i&&n.next.y!==n.y&&a<(n.next.x-n.x)*(i-n.y)/(n.next.y-n.y)+n.x&&(r=!r),n=n.next,n!==e;);return r}(x,u)&&(E(x.prev,x,u.prev)||E(x,u.prev,u))||v(x,u)&&0=r.next.y&&r.next.y!==r.y){var u=r.x+(i-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(u<=a&&x=r.x&&r.x>=p&&a!==r.x&&b(in.x||r.x===n.x&&(v=r,E((y=n).prev,y,v.prev)<0&&E(v.next,y,y.next)<0)))&&(n=r,f=o)),r=r.next,r!==s;);var y,v;return n}(e,t)){var n=S(t,e);c(n,n.next)}}function g(e,t,n,r,a){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-n)*a)|e<<8))|e<<4))|e<<2))|e<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-r)*a)|t<<8))|t<<4))|t<<2))|t<<1))<<1}function w(e){for(var t=e,n=e;(t.x=Math.min(e.x,n.x)&&t.y<=Math.max(e.y,n.y)&&t.y>=Math.min(e.y,n.y)}function s(e){return 0