@aibee/crc-bmap 0.1.11 → 0.1.13
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/lib/bmap.cjs.min.js +1 -1
- package/lib/bmap.cjs.min.js.map +2 -2
- package/lib/bmap.esm.js +11 -7
- package/lib/bmap.esm.js.map +2 -2
- package/lib/bmap.esm.min.js +1 -1
- package/lib/bmap.esm.min.js.map +2 -2
- package/lib/bmap.min.js +9 -9
- package/lib/bmap.min.js.map +3 -3
- package/package.json +2 -3
package/lib/bmap.min.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";(()=>{var Qr=Object.create;var an=Object.defineProperty;var ti=Object.getOwnPropertyDescriptor;var ei=Object.getOwnPropertyNames;var ni=Object.getPrototypeOf,ri=Object.prototype.hasOwnProperty;var g=(s=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(s,{get:(e,t)=>(typeof require<"u"?require:e)[t]}):s)(function(s){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+s+'" is not supported')});var Mt=(s,e)=>()=>(e||s((e={exports:{}}).exports,e),e.exports);var ii=(s,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of ei(e))!ri.call(s,r)&&r!==t&&an(s,r,{get:()=>e[r],enumerable:!(n=ti(e,r))||n.enumerable});return s};var Xe=(s,e,t)=>(t=s!=null?Qr(ni(s)):{},ii(e||!s||!s.__esModule?an(t,"default",{value:s,enumerable:!0}):t,s));var vn=Mt((eo,yn)=>{yn.exports=function(e,t){return e[0]=t[0],e[1]=t[1],e}});var bn=Mt((no,En)=>{var xn=vn();En.exports=function(s,e){Array.isArray(e)||(e=[]),s.length>0&&e.push(xn([0,0],s[0]));for(var t=0;t<s.length-1;t++){var n=s[t],r=s[t+1],i=n[0],o=n[1],a=r[0],l=r[1],u=[.75*i+.25*a,.75*o+.25*l],c=[.25*i+.75*a,.25*o+.75*l];e.push(u),e.push(c)}return s.length>1&&e.push(xn([0,0],s[s.length-1])),e}});var Rn=Mt((ao,An)=>{var $e=class{constructor(){this.keys=new Set,this.queue=[]}sort(){this.queue.sort((e,t)=>e.priority-t.priority)}set(e,t){let n=Number(t);if(isNaN(n))throw new TypeError('"priority" must be a number');return this.keys.has(e)?this.queue.map(r=>(r.key===e&&Object.assign(r,{priority:n}),r)):(this.keys.add(e),this.queue.push({key:e,priority:n})),this.sort(),this.queue.length}next(){let e=this.queue.shift();return this.keys.delete(e.key),e}isEmpty(){return this.queue.length===0}has(e){return this.keys.has(e)}get(e){return this.queue.find(t=>t.key===e)}};An.exports=$e});var Nn=Mt((uo,Ln)=>{function In(s,e){let t=new Map;for(let[n,r]of s)n!==e&&r instanceof Map?t.set(n,In(r,e)):n!==e&&t.set(n,r);return t}Ln.exports=In});var Un=Mt((lo,On)=>{function li(s){let e=Number(s);return!(isNaN(e)||e<=0)}function Dn(s){let e=new Map;return Object.keys(s).forEach(n=>{let r=s[n];if(r!==null&&typeof r=="object"&&!Array.isArray(r))return e.set(n,Dn(r));if(!li(r))throw new Error(`Could not add node at key "${n}", make sure it's a valid node`,r);return e.set(n,Number(r))}),e}On.exports=Dn});var Gn=Mt((co,Bn)=>{function Fn(s){if(!(s instanceof Map))throw new Error(`Invalid graph: Expected Map instead found ${typeof s}`);s.forEach((e,t)=>{if(typeof e=="object"&&e instanceof Map){Fn(e);return}if(typeof e!="number"||e<=0)throw new Error(`Values must be numbers greater than 0. Found value ${e} at ${t}`)})}Bn.exports=Fn});var Ke=Mt((ho,Vn)=>{var ci=Rn(),hi=Nn(),zn=Un(),kn=Gn(),Ze=class{constructor(e){e instanceof Map?(kn(e),this.graph=e):e?this.graph=zn(e):this.graph=new Map}addNode(e,t){let n;return t instanceof Map?(kn(t),n=t):n=zn(t),this.graph.set(e,n),this}addVertex(e,t){return this.addNode(e,t)}removeNode(e){return this.graph=hi(this.graph,e),this}path(e,t,n={}){if(!this.graph.size)return n.cost?{path:null,cost:0}:null;let r=new Set,i=new ci,o=new Map,a=[],l=0,u=[];if(n.avoid&&(u=[].concat(n.avoid)),u.includes(e))throw new Error(`Starting node (${e}) cannot be avoided`);if(u.includes(t))throw new Error(`Ending node (${t}) cannot be avoided`);for(i.set(e,0);!i.isEmpty();){let c=i.next();if(c.key===t){l=c.priority;let f=c.key;for(;o.has(f);)a.push(f),f=o.get(f);break}r.add(c.key),(this.graph.get(c.key)||new Map).forEach((f,d)=>{if(r.has(d)||u.includes(d))return null;if(!i.has(d))return o.set(d,c.key),i.set(d,c.priority+f);let y=i.get(d).priority,p=c.priority+f;return p<y?(o.set(d,c.key),i.set(d,p)):null})}return a.length?(n.trim?a.shift():a=a.concat([e]),n.reverse||(a=a.reverse()),n.cost?{path:a,cost:l}:a):n.cost?{path:null,cost:0}:null}shortestPath(...e){return this.path(...e)}};Vn.exports=Ze});var Ie=g("three");var U=class{tasks={requestAnimation:new Set,timeout:new Set,interval:new Set};requestAnimationFrame(e){let t=window.requestAnimationFrame(()=>{this.tasks.requestAnimation.delete(t),e()});return this.tasks.requestAnimation.add(t),t}cancelAnimationFrame(e){this.tasks.requestAnimation.delete(e),window.cancelAnimationFrame(e)}setTimeout(e,t){let n=window.setTimeout(()=>{this.tasks.timeout.delete(n),e()},t);return this.tasks.timeout.add(n),n}clearTimeout(e){this.tasks.timeout.delete(e),window.clearTimeout(e)}setInterval(e,t){let n=window.setInterval(()=>{this.tasks.interval.delete(n),e()},t);return this.tasks.interval.add(n),n}clearInterval(e){this.tasks.interval.delete(e),window.clearInterval(e)}dispose(){this.tasks.requestAnimation.forEach(e=>{window.cancelAnimationFrame(e)}),this.tasks.requestAnimation.clear(),this.tasks.timeout.forEach(e=>{window.clearTimeout(e)}),this.tasks.timeout.clear(),this.tasks.interval.forEach(e=>{window.clearInterval(e)}),this.tasks.interval.clear()}};var j=g("three");function un(){let s=new j.Group,e=new j.AmbientLight(16777215,2.6);return s.add(e),s}function st(s,e=[]){let t=new j.Shape(s.map(n=>new j.Vector2(...n)));return e.length&&e.forEach(n=>{var r=new j.Path(n.map(i=>new j.Vector2(...i)));t.holes.push(r)}),t}function ln(s=16777215,e=1){let t=new j.DirectionalLight(s,e);return t.castShadow=!0,t.shadow.radius=8,t.shadow.bias=-.001,t.shadow.mapSize.set(256,256),t.shadow.camera.left=-200,t.shadow.camera.right=200,t.shadow.camera.top=200,t.shadow.camera.bottom=-200,t}function W(s,e){if(e&&s.children&&s.children.length&&s.children.forEach(t=>{W(t,e)}),s.isMesh){let t=s;t.geometry&&t.geometry.dispose(),t.material&&(Array.isArray(t.material)?t.material.forEach(n=>{n.dispose()}):t.material.dispose())}s.isLight&&s.dispose?.()}function cn(s){return/[\u4E00-\u9FA5]+/g.test(s)}var C=g("three"),Nt=g("@turf/turf");function x(s,e,t,n){let r=s.clone().project(e),i=t/2,o=n/2,a=Math.round(r.x*i+i),l=Math.round(-r.y*o+o);return{x:a,y:l}}function Jt(s){let e=(0,Nt.featureCollection)(s.map(n=>(0,Nt.point)(n)));return(0,Nt.center)(e).geometry.coordinates}function gt(s,e,t){return s.x>=e.x&&s.x<=t.x&&s.y>=e.y&&s.y<=t.y}function Ui(s){let e=0,t=new C.Vector3;for(let n=1;n<s.length;n++){let r=new C.Vector3(s[n-1][0],s[n-1][1],0),i=new C.Vector3(s[n][0],s[n][1],0),o=i.distanceTo(r);o>e&&(e=o,t=i.clone().sub(r).normalize())}return t}function F(s,e){return Math.sqrt((e[0]-s[0])**2+(e[1]-s[1])**2)}function at(s){let e=0;for(let t=0;t<s.length-1;t++)e+=F(s[t],s[t+1]);return e}function hn(s,e,t){let n=new C.Vector2(e[0]-s[0],e[1]-s[1]),r=new C.Vector2(e[0]-t[0],e[1]-t[1]),o=n.angleTo(r)*180/Math.PI,a=new C.Vector2(e[0]-s[0],e[1]-s[1]);return new C.Vector2(t[0]-s[0],t[1]-s[1]).cross(a)>0?o:-o}function pn(s,e){let t=Math.min(F(s[0][0],s[0][1]),F(s[0][2],s[0][1]))-1;e||(e=Jt(s[0]));let n=oi(e,t),r=new C.Vector2(s[0][0][0],s[0][0][1]),i=new C.Vector2(s[0][1][0],s[0][1][1]),o=new C.Vector2(s[0][2][0],s[0][2][1]),l=(r.distanceTo(i)>i.distanceTo(o)?i.clone().sub(r):o.clone().sub(i)).angleTo(new C.Vector2(0,1)),u=new C.Matrix3;return u.multiply(new C.Matrix3().translate(e[0],e[1])).multiply(new C.Matrix3().rotate(l)).multiply(new C.Matrix3().translate(-e[0],-e[1])),[n.map(c=>{let h=new C.Vector2(c[0],c[1]).applyMatrix3(u);return[h.x,h.y]})]}function oi(s,e){let t=e/2;return[[s[0]-t,s[1]+t],[s[0]+t,s[1]+t],[s[0]+t,s[1]-t],[s[0]-t,s[1]-t],[s[0]-t,s[1]+t]]}function Dt(s,e){let t=0,n=1/0,[r,i]=e;for(let o=0;o<s.length-1;o++){let[a,l]=s[o],[u,c]=s[o+1],h=Math.min(a,u)<=r&&r<=Math.max(a,u),f=Math.min(l,c)<=i&&i<=Math.max(l,c);if(h&&f){let d=Math.abs((u-a)*(i-l)-(c-l)*(r-a));d<n&&(n=d,t=o)}}return t}function fn(s,e){let t=s[0],n=s[1],r=!1;for(let i=0,o=e.length-1;i<e.length;o=i++){let a=e[i][0],l=e[i][1],u=e[o][0],c=e[o][1];l>n!=c>n&&t<(u-a)*(n-l)/(c-l)+a&&(r=!r)}return r}function Ot(s,e){return new Proxy(s,{get:(t,n,r)=>Reflect.get(t,n,r),set:(t,n,r,i)=>{let o=Reflect.get(t,n,i),a=Reflect.set(t,n,r,i);return o!==r&&e.dispatchEvent({type:`change-${n}`,value:r}),a}})}function wt(s,e){return Promise.race([s,new Promise((t,n)=>{setTimeout(()=>n(new Error("Promise timeout")),e)})])}function Qt(s){return document.createElementNS("http://www.w3.org/2000/svg",s)}function dn(s,e){let t=Qt("svg");return t.setAttribute("width",s),t.setAttribute("height",e),t.style.cssText="position: absolute; left: 0; top: 0; pointer-events: none;",t}function Xt(s="2",e){let t=Qt("circle");return t.setAttribute("r",s),t.setAttribute("fill",e),t}function te(s){let e=Qt("line");return e.setAttribute("stroke",s),e}function mt(s,e){let t=Qt("rect");return t.setAttribute("stroke",s),t.setAttribute("fill",e),t}function Tt(s,e,t){s.setAttribute("cx",`${e}`),s.setAttribute("cy",`${t}`)}function rt(s,e,t){e&&(s.setAttribute("x1",`${e.x}`),s.setAttribute("y1",`${e.y}`)),t&&(s.setAttribute("x2",`${t.x}`),s.setAttribute("y2",`${t.y}`))}function k(s,e,t,n,r){s.setAttribute("x",`${e}`),s.setAttribute("y",`${t}`),s.setAttribute("width",`${n}`),s.setAttribute("height",`${r}`)}function gn(){return Promise.resolve()}function ki(){return new Promise(s=>{requestAnimationFrame(s)})}function Hi(s){return parseInt(s.replace("#","0x"),16)}function Wi(s,e){let t=parseInt(s.substring(1,3),16),n=parseInt(s.substring(3,5),16),r=parseInt(s.substring(5,7),16),i=Math.round(t*e),o=Math.round(n*e),a=Math.round(r*e);return`#${(1<<24|i<<16|o<<8|a).toString(16).slice(1)}`}function ft(s,e=.85){let t,n,r;if(s.startsWith("#"))t=parseInt(s.substring(1,3),16),n=parseInt(s.substring(3,5),16),r=parseInt(s.substring(5,7),16);else{let o=s.slice(4,-1).split(",");t=parseInt(o[0].trim()),n=parseInt(o[1].trim()),r=parseInt(o[2].trim())}return t=Math.min(Math.floor(t*e),255),n=Math.min(Math.floor(n*e),255),r=Math.min(Math.floor(r*e),255),"#"+((1<<24)+(t<<16)+(n<<8)+r).toString(16).slice(1)}function qe(s,e){s=s.replace(/^#/,"");let t=parseInt(s.substring(0,2),16),n=parseInt(s.substring(2,4),16),r=parseInt(s.substring(4,6),16);return e!==void 0?`rgba(${t}, ${n}, ${r}, ${e})`:`rgb(${t}, ${n}, ${r})`}var Ut=navigator.userAgent.toUpperCase().indexOf("MAC")>=0,mn=(window.navigator.userAgent||"").toLocaleLowerCase(),qt=/ios|iphone/i.test(mn),qi=/android|adr|linux/gi.test(mn);function Ft(s){return Ut?s==="Meta":s==="Control"}var je="__once__",_n=class{events=new Map;on(e,t){if(typeof t!="function")return;let n=this.events.get(e);return n?n.add(t):this.events.set(e,new Set([t]))}once(e,t){if(typeof t!="function")return;let n=`${je}${e}`,r=this.events.get(n);return r?r.add(t):this.events.set(n,new Set([t]))}off(e,t){let n=this.events.get(e),r=this.events.get(`${je}${e}`);!n&&!r||(t===void 0&&(n?.clear(),r?.clear()),n?.has(t)&&n.delete(t),r?.has(t)&&r.delete(t))}offAll(){this.events.clear()}emit(e,...t){let n=this.events.get(e),r=this.events.get(`${je}${e}`);!n&&!r||(n?.forEach(i=>{typeof i=="function"&&i(...t)}),r?.forEach(i=>{typeof i=="function"&&i(...t)}),r?.clear())}};var jt=(t=>(t.SWITCH_FLOOR_BEFORE="switch_floor_before",t.SWITCH_FLOOR_AFTER="switch_floor_after",t))(jt||{});function Bt(s){return Object.keys(s).sort().map(e=>`${e}=${s[e]}`).join("&")}function Qi(s,e){return new Promise((t,n)=>{let r=new XMLHttpRequest;r.open("GET",s,!0),Object.keys(e.headers||{}).forEach(i=>{r.setRequestHeader(i,e.headers[i])}),e.responseType&&(r.responseType=e.responseType),r.onload=()=>{if(r.status>=200&&r.status<300)if(e.responseType==="arraybuffer")t(r.response);else try{let i=JSON.parse(r.responseText);t(i)}catch(i){n(i)}else n(r.statusText)},r.onerror=()=>{n(r.statusText)},r.send()})}var Gt=g("three"),Sn=Xe(bn(),1);function si(s,e){let t=s.clone().normalize(),n=e.clone().normalize();return Math.acos(t.dot(n))}function ai(s){let e=0;return s.reduce(([t,n],[r,i])=>(e+=Math.sqrt((r-t)**2+(i-n)**2),[r,i])),e/s.length}function Mn(s,e=.25){if(ai(s)<e)return s;let t=(0,Sn.default)(s);return Mn(t,e)}function wn(s,e=!1,t=!0,n=5,r=150,i=3){let o=[],a=!e;if(o.push(s[0]),s.length<2)return o;for(let u=0;u<s.length-2;u+=1){let c=s[u],h=s[u+1],f=s[u+2],d=new Gt.Vector2(c[0]-h[0],c[1]-h[1]),y=new Gt.Vector2(f[0]-h[0],f[1]-h[1]),p=si(d,y)/Math.PI*180,m=d.length()+y.length();(!a||p<r&&m>.01||m>n)&&(o.push(s[u+1]),a=!0)}if(o.push(s[s.length-1]),!t)return o;let l=[];l.push(o[0]);for(let u=0;u<o.length-2;u+=1){let c=new Gt.Vector2(o[u][0],o[u][1]),h=new Gt.Vector2(o[u+1][0],o[u+1][1]),f=new Gt.Vector2(o[u+2][0],o[u+2][1]),d=c.distanceTo(h)/2,y=f.distanceTo(h)/2,p=h.clone(),m=h.clone();p.add(c.clone().sub(h).normalize().multiplyScalar(d>i?i/2:d)),m.add(f.clone().sub(h).normalize().multiplyScalar(y>i?i/2:y));let b=[[p.x,p.y],[h.x,h.y],[m.x,m.y]];l.push(...Mn(b,i/25))}return l.push(o[o.length-1]),ui(l)}function ui(s){if(s.length<=1)return s;let e=[],t;return s.forEach(([n,r])=>{t?n===t[0]&&r===t[1]||(t=[n,r],e.push([n,r])):(t=[n,r],e.push([n,r]))}),e}function Tn(s,e,t){let n=Math.sqrt((t[0]-e[0])**2+(t[1]-e[1])**2);if(n===0)return{distance:Math.sqrt((s[0]-e[0])**2+(s[1]-e[1])**2),closestPoint:e.slice(0)};let r=Math.max(0,Math.min(1,((s[0]-e[0])*(t[0]-e[0])+(s[1]-e[1])*(t[1]-e[1]))/n**2)),i=[e[0]+r*(t[0]-e[0]),e[1]+r*(t[1]-e[1])];return{distance:Math.sqrt((s[0]-i[0])**2+(s[1]-i[1])**2),closestPoint:i}}function io(s,e,t){let[n,r]=s,[i,o]=e,a=Math.sqrt(Math.pow(i-n,2)+Math.pow(o-r,2));if(a===0||a<t)return[...e];let l=t/a,u=n+(i-n)*l,c=r+(o-r)*l;return[u,c]}var Cn=(u=>(u.START="start",u.END="end",u.FRONT="front",u.RIGHT="right",u.LEFT="left",u.RIGHT_FRONT="right_front",u.LEFT_FRONT="left_front",u.RIGHT_BACK="right_back",u.LEFT_BACK="left_back",u))(Cn||{});function Ye(s,e,t){let n=hn(s,e,t);return 180-Math.abs(n)<15?"front":n>135?"right_front":n<-135?"left_front":n<=135&&n>=60?"right":n>=-135&&n<=-60?"left":n<60&&n>0?"right_back":n>-60&&n<0?"left_back":"front"}function oo(s){if(!s.length)return[];let e=[{direction:"start",distance:F(s[0],s[1]),points:[s[0],s[1]]}];for(let t=2;t<s.length;t++){let n=Ye(s[t-2],s[t-1],s[t]);if(n==="front"){let r=e[e.length-1],i=F(s[t-1],s[t]);r.distance+=i,t!==2&&r.points.push(s[t-1])}else e.push({direction:n,distance:F(s[t-1],s[t]),points:[s[t-1],s[t]]})}return e.push({direction:"end",distance:0,points:[s[s.length-1]]}),e}function Pn(s,e){if(s.length<2)return-1;let t=0;for(let n=1;n<s.length;n++){let r=s[n-1],i=s[n],o=[e[0]-r[0],e[1]-r[1]],a=[i[0]-r[0],i[1]-r[1]],l=Math.min(i[0],r[0])<=e[0]&&e[0]<=Math.max(i[0],r[0]),u=Math.min(i[1],r[1])<=e[1]&&e[1]<=Math.max(i[1],r[1]);if(console.log(l,u),l&&u){let c=o[0]*a[1]-o[1]*a[0];if(Math.abs(c)<1e-6){let h=Math.sqrt((e[0]-r[0])**2+(e[1]-r[1])**2);return t+h}}t+=Math.sqrt((i[0]-r[0])**2+(i[1]-r[1])**2)}return-1}function ee(s,e){if(s.length<2)return s[0]??null;let t=0;for(let n=1;n<s.length;n++){let r=s[n-1],i=s[n],o=Math.sqrt((i[0]-r[0])**2+(i[1]-r[1])**2);if(t+=o,t>=e){let a=(e-(t-o))/o,l=r[0]+(i[0]-r[0])*a,u=r[1]+(i[1]-r[1])*a;return[l,u]}}return null}var ut=Xe(Ke(),1);var J="___",Hn=class{constructor(e=3){this.lift_priority=e}roadInfo=[];pointMap=new Map;nodeMap=new Map;facilityMap=new Map;straightLadderMap=new Map;escalatorMap=new Map;staircaseMap=new Map;lineMap=new Map;baseRoute=new ut.default;escalatorRoute=new ut.default;straightLadderRoute=new ut.default;initRoute(e){this.clear(),this.roadInfo=e,e.length&&(e.forEach(t=>{t.points.forEach(n=>{let r=`${t.floor}${J}${n.id}`;if(this.pointMap.set(r,n),this.nodeMap.set(`${n.floor}${J}${n.nodeId}`,r),n.type==="straightLadder"){let i=this.straightLadderMap.get(n.name)||[];i.push({...n}),this.straightLadderMap.set(n.name,i)}if(n.type==="staircase"){let i=this.staircaseMap.get(n.name)||[];i.push({...n}),this.staircaseMap.set(n.name,i)}if(n.type==="escalator"){let i=this.escalatorMap.get(n.name)||{};n.escalatorDirection==="exit"?i.end={floor:n.floor,id:n.id}:i.start={floor:n.floor,id:n.id},this.escalatorMap.set(n.name,i)}if(n.type==="facility"){let i=this.facilityMap.get(n.targetId)||[];i.push({...n}),this.facilityMap.set(n.targetId,i)}}),t.lines.filter(n=>n.direction!=="no").forEach(n=>{let r=`${t.floor}${J}${n.from}`,i=`${t.floor}${J}${n.to}`,o=this.pointMap.get(r)?.cds,a=this.pointMap.get(i)?.cds;if(o?.length&&a?.length){let l=F(o,a);this.addLineItem(r,i,l),n.direction==="double"&&this.addLineItem(i,r,l)}})}),this.initBaseRoute(),this.initEscalatorRoute(),this.initStraightLadderRoute())}addLineItem(e,t,n,r=this.lineMap){let i=r.get(e)||new Map;i.set(t,n),r.set(e,i)}addFacilityToLineMap(e,t,n,r){[...this.straightLadderMap,...this.staircaseMap].forEach(([i,o])=>{if(!(o.length<2))for(let a=0;a<o.length;a++){let l=`${o[a].floor}${J}${o[a].id}`;for(let u=0;u<o.length;u++)if(a!==u){let c=`${o[u].floor}${J}${o[u].id}`,h=this.pointMap.get(l)?.cds,f=this.pointMap.get(c)?.cds;if(h?.length&&f?.length)if(o[a].type==="straightLadder"){let d=t;this.addLineItem(l,c,d,r)}else{let d=n;this.addLineItem(l,c,d,r)}}}}),this.escalatorMap.forEach((i,o)=>{if(i.start&&i.end){let a=`${i.start.floor}${J}${i.start.id}`,l=`${i.end.floor}${J}${i.end.id}`,u=this.pointMap.get(a)?.cds,c=this.pointMap.get(l)?.cds;if(u?.length&&c?.length){let h=e;this.addLineItem(a,l,h,r)}}})}initBaseRoute(){let e=new Map([...this.lineMap]);this.addFacilityToLineMap(1,this.lift_priority,3e4,e),this.baseRoute=new ut.default(e)}initEscalatorRoute(){let e=new Map([...this.lineMap]),t=1e4;this.addFacilityToLineMap(1*t,this.lift_priority*t,3e4*t,e),this.escalatorRoute=new ut.default(e)}initStraightLadderRoute(){let e=new Map([...this.lineMap]),t=1e4;this.addFacilityToLineMap(3*t,1*t,3e4*t,e),this.straightLadderRoute=new ut.default(e)}checkStart(e){return!(!e.floor||!e.nodeId&&(!e.coord||e.coord.length<2))}checkEnd(e){return e.facility?!0:this.checkStart(e)}transformStart(e){if(e.nodeId){let t=this.nodeMap.get(`${e.floor}${J}${e.nodeId}`);if(t){let[n,r]=t.split(J);return{floor:n,id:r}}}if(e.coord?.length){let t=this.roadInfo.find(r=>r.floor===e.floor);if(!t)return null;let n=t.points.reduce((r,i)=>{let o=F(e.coord,i.cds);return o<r.min&&(r.min=o,r.point=i),r},{min:1/0,point:t.points[0]});return{floor:n.point.floor,id:n.point.id}}return null}transformEnd(e){if(e.floor){let t=this.transformStart(e);if(t)return t}return e.facility&&this.facilityMap.get(e.facility)?.length?{floor:e.floor,facility:e.facility}:null}getPath(e,t,n=""){if(!this.checkStart(e))return"start-error";if(!this.checkEnd(t))return"end-error";let r=this.transformStart(e);if(!r)return"no-start";let i=this.transformEnd(t);if(!i)return"no-end";let o=this.getBasePath.bind(this);switch(n){case"escalator":o=this.getEscalatorPath.bind(this);break;case"straightLadder":o=this.getStraightLadderPath.bind(this);break;default:o=this.getBasePath.bind(this);break}if(console.log(r,i),i.id)return o(r,i);if(i.facility){let a=this.facilityMap.get(i.facility).filter(u=>i.floor?u.floor===i.floor:!0);if(!a.length)return null;let l=a.map(u=>o(r,{floor:u.floor,id:u.id})).filter(u=>!!u);return l.reduce((u,c)=>{let h=c.reduce((f,d)=>f+at(d.points),0);return h<u.distance&&(u.distance=h,u.path=c),u},{distance:1/0,path:l[0]}).path}}getRoutePath(e,t,n){let r=`${e.floor}${J}${e.id}`,i=`${t.floor}${J}${t.id}`,o=n.path(r,i);if(console.log(r,i,o),!o)return null;let a=[];return o.map(l=>{let u=this.pointMap.get(l);if(u){let{floor:c}=u;if(a[a.length-1]?.floor===c){let h=a[a.length-1];h.points.push(u.cds),h.endType=u.type,h.destId=u.nodeId,h.distance=at(h.points)}else a.push({floor:c,points:[u.cds],endType:u.type,destId:u.nodeId,distance:0})}}),a}getBasePath(e,t){return this.getRoutePath(e,t,this.baseRoute)}getEscalatorPath(e,t){return this.getRoutePath(e,t,this.escalatorRoute)}getStraightLadderPath(e,t){return this.getRoutePath(e,t,this.straightLadderRoute)}clear(){this.roadInfo=[],this.pointMap.clear(),this.nodeMap.clear(),this.facilityMap.clear(),this.straightLadderMap.clear(),this.escalatorMap.clear(),this.staircaseMap.clear(),this.lineMap.clear(),this.baseRoute=new ut.default,this.escalatorRoute=new ut.default,this.straightLadderRoute=new ut.default}};var Q=Xe(Ke(),1);var ne=g("lodash"),B="___",Wn=class{constructor(e=3){this.lift_priority=e}roadInfo=[];facilities=[];pointMap=new Map;nodeMap=new Map;facilityMap=new Map;straightLadderMap=new Map;escalatorMap=new Map;rampMap=new Map;staircaseMap=new Map;parkingMap=new Map;lineMap=new Map;baseRoute=new Q.default;escalatorRoute=new Q.default;straightLadderRoute=new Q.default;forwardLineMap=new Map;forwardRoute=new Q.default;isFacilityByType(e){return["facility","escalator","straightLadder","staircase","ramp"].includes(e)}initFacilities(e){this.facilities=e.map(t=>{let n=[];try{n=JSON.parse(t.entry_end_floor)}catch{n=[]}let r=[];try{r=JSON.parse(t.entry_start_floor)}catch{r=[]}return{...t,entry_start_floor:r,entry_end_floor:n}})}initRoute(e,t){this.clear(),this.roadInfo=e,this.initFacilities(t),e.length&&(e.forEach(n=>{n.points.forEach(r=>{r.floor=n.floor;let i=`${n.floor}${B}${r.id}`;if(this.pointMap.set(i,r),this.nodeMap.set(`${n.floor}${B}${r.nodeId}`,i),this.isFacilityByType(r.type)){let o=this.facilities.find(a=>a.id===+r.targetId);if(o){switch(o.entry_infra_type){case"straightLadder":if(o.entry_end_floor.find(c=>c.floor===n.floor)&&o.entry_start_floor.find(c=>c.floor===n.floor)){let c=this.straightLadderMap.get(r.targetId)||[];c.push({...r}),this.straightLadderMap.set(r.targetId,c)}break;case"staircase":if(o.entry_end_floor.find(c=>c.floor===n.floor)&&o.entry_start_floor.find(c=>c.floor===n.floor)){let c=this.staircaseMap.get(r.targetId)||[];c.push({...r}),this.staircaseMap.set(r.targetId,c)}break;case"escalator":let l=this.escalatorMap.get(r.targetId)||[];if(o.entry_start_floor.find(c=>c.floor===n.floor)){let c=l.find(h=>h.end?.floor!==n.floor&&!h.start);c?c.start=r:l.push({start:r})}if(o.entry_end_floor.find(c=>c.floor===n.floor)){let c=l.find(h=>h.start?.floor!==n.floor&&!h.end);c?c.end=r:l.push({end:r})}this.escalatorMap.set(r.targetId,l);break;case"ramp":let u=this.rampMap.get(r.targetId)||[];if(o.entry_start_floor.find(c=>c.floor===n.floor)){let c=u.find(h=>h.end?.floor!==n.floor&&!h.start);c?c.start=r:u.push({start:r})}if(o.entry_end_floor.find(c=>c.floor===n.floor)){let c=u.find(h=>h.start?.floor!==n.floor&&!h.end);c?c.end=r:u.push({end:r})}this.rampMap.set(r.targetId,u);break}let a=this.facilityMap.get(r.targetId)||[];a.push({...r}),this.facilityMap.set(r.targetId,a)}}r.type==="parkingSpace"&&this.parkingMap.set(`${n.floor}${B}${r.name}`,r)}),n.lines.filter(r=>r.direction!=="no").forEach(r=>{let i=`${n.floor}${B}${r.from}`,o=`${n.floor}${B}${r.to}`,a=this.pointMap.get(i)?.cds,l=this.pointMap.get(o)?.cds;if(a?.length&&l?.length){let u=F(a,l);switch(this.addLineItem(i,o,u),this.addLineItem(o,i,u),r.direction){case"double":this.addLineItem(i,o,u,this.forwardLineMap),this.addLineItem(o,i,u,this.forwardLineMap);break;case"single":this.addLineItem(i,o,u,this.forwardLineMap);break;case"back":this.addLineItem(o,i,u,this.forwardLineMap);break}}})}),this.initBaseRoute(),this.initEscalatorRoute(),this.initStraightLadderRoute(),this.initForwardRoute())}addLineItem(e,t,n,r=this.lineMap){let i=r.get(e)||new Map;i.set(t,n),r.set(e,i)}addFacilityToLineMap(e,t,n,r){[...this.straightLadderMap,...this.staircaseMap].forEach(([i,o])=>{if(!(o.length<2))for(let a=0;a<o.length;a++){let l=`${o[a].floor}${B}${o[a].id}`;for(let u=0;u<o.length;u++)if(a!==u){let c=`${o[u].floor}${B}${o[u].id}`,h=this.pointMap.get(l)?.cds,f=this.pointMap.get(c)?.cds;if(h?.length&&f?.length)if(o[a].type==="straightLadder"){let d=t;this.addLineItem(l,c,d,r)}else{let d=n;this.addLineItem(l,c,d,r)}}}}),this.escalatorMap.forEach((i,o)=>{i.forEach(a=>{if(a.start&&a.end){let l=`${a.start.floor}${B}${a.start.id}`,u=`${a.end.floor}${B}${a.end.id}`,c=this.pointMap.get(l)?.cds,h=this.pointMap.get(u)?.cds;if(c?.length&&h?.length){let f=e;this.addLineItem(l,u,f,r)}}})})}initBaseRoute(){let e=new Map((0,ne.cloneDeep)([...this.lineMap]));this.addFacilityToLineMap(1,this.lift_priority,3e4,e),this.baseRoute=new Q.default(e)}initEscalatorRoute(){let e=new Map((0,ne.cloneDeep)([...this.lineMap])),t=1e4;this.addFacilityToLineMap(1*t,this.lift_priority*t,3e4*t,e),this.escalatorRoute=new Q.default(e)}initStraightLadderRoute(){let e=new Map((0,ne.cloneDeep)([...this.lineMap])),t=1e4;this.addFacilityToLineMap(3*t,1*t,3e4*t,e),this.straightLadderRoute=new Q.default(e)}initForwardRoute(){this.rampMap.forEach((e,t)=>{e.forEach(n=>{if(n.start&&n.end){let r=`${n.start.floor}${B}${n.start.id}`,i=`${n.end.floor}${B}${n.end.id}`,o=this.pointMap.get(r)?.cds,a=this.pointMap.get(i)?.cds;o?.length&&a?.length&&this.addLineItem(r,i,10,this.forwardLineMap)}})}),this.forwardRoute=new Q.default(this.forwardLineMap)}checkStart(e){return!(!e.floor||!e.nodeId&&(!e.coord||e.coord.length<2))}checkEnd(e){return e.facility||e.parkingSpace&&e.floor?!0:this.checkStart(e)}transformStart(e){if(e.nodeId){let t=this.nodeMap.get(`${e.floor}${B}${e.nodeId}`);if(t){let[n,r]=t.split(B);return{floor:n,id:r}}}if(e.coord?.length){let t=this.roadInfo.find(r=>r.floor===e.floor);if(!t)return null;let n=t.points.reduce((r,i)=>{let o=F(e.coord,i.cds);return o<r.min&&(r.min=o,r.point=i),r},{min:1/0,point:t.points[0]});return{floor:t.floor,id:n.point.id}}return null}transformEnd(e){if(e.floor){if(e.parkingSpace){let n=this.parkingMap.get(`${e.floor}${B}${e.parkingSpace}`);if(n)return{floor:e.floor,id:n.id}}let t=this.transformStart(e);if(t)return t}return e.facility&&this.facilityMap.get(e.facility)?.length?{floor:e.floor,facility:e.facility}:null}getPath(e,t,n=""){if(console.log(e,t,n),!this.checkStart(e))return"start-error";if(!this.checkEnd(t))return"end-error";let r=this.transformStart(e);if(!r)return"no-start";let i=this.transformEnd(t);if(!i)return"no-end";console.log("transformedStart",r,i);let o=this.getBasePath.bind(this);switch(n){case"escalator":o=this.getEscalatorPath.bind(this);break;case"straightLadder":o=this.getStraightLadderPath.bind(this);break;case"forward":o=this.getForwardPath.bind(this);break;default:o=this.getBasePath.bind(this);break}if(i.id)return o(r,i);if(i.facility){let a=this.facilityMap.get(i.facility).filter(u=>i.floor?u.floor===i.floor:!0);if(!a.length)return null;let l=a.map(u=>o(r,{floor:u.floor,id:u.id})).filter(u=>!!u);return l.reduce((u,c)=>{let h=c.reduce((f,d)=>f+at(d.points),0);return h<u.distance&&(u.distance=h,u.path=c),u},{distance:1/0,path:l[0]}).path}}getRoutePath(e,t,n){let r=`${e.floor}${B}${e.id}`,i=`${t.floor}${B}${t.id}`,o=n.path(r,i);if(!o)return null;let a=[];return o.map(l=>{let u=this.pointMap.get(l);if(u){let{floor:c}=u,h=u.type;if(this.isFacilityByType(u.type)){let f=this.facilities.find(d=>d.id===+u.targetId);f&&(h=f.entry_infra_type)}if(a[a.length-1]?.floor===c){let f=a[a.length-1];f.points.push(u.cds),f.endType=h,f.destId=u.nodeId,f.distance=at(f.points)}else a.push({floor:c,points:[u.cds],endType:h,destId:u.nodeId,distance:0})}}),a}getBasePath(e,t){return this.getRoutePath(e,t,this.baseRoute)}getEscalatorPath(e,t){return this.getRoutePath(e,t,this.escalatorRoute)}getStraightLadderPath(e,t){return this.getRoutePath(e,t,this.straightLadderRoute)}getForwardPath(e,t){return this.getRoutePath(e,t,this.forwardRoute)}clear(){this.roadInfo=[],this.pointMap.clear(),this.nodeMap.clear(),this.facilityMap.clear(),this.straightLadderMap.clear(),this.escalatorMap.clear(),this.staircaseMap.clear(),this.lineMap.clear(),this.baseRoute=new Q.default,this.escalatorRoute=new Q.default,this.straightLadderRoute=new Q.default}};var Ct=class{static keySet=new Set;static createKey(){return Math.random().toString(36).substring(2,15)+Math.random().toString(36).substring(2,15)}static genUniqueKey(){let e=this.createKey();for(;this.keySet.has(e);)e=this.createKey();return e}static removeKey(e){this.keySet.delete(e)}static dispose(){this.keySet.clear()}};function Xn(s){return s.replace(/[A-Z]/g,e=>"_"+e.toLowerCase()).replace(/^_/,"")}function lt(s,e,t){return new Promise((n,r)=>{let i=Ct.genUniqueKey(),o=({data:a})=>{a.type===`${e}_result`&&a.key===i&&(Ct.removeKey(i),self.removeEventListener("message",o),a.error?r(a.error):n(a.data))};s.addEventListener("message",o),s.postMessage({type:e,key:i,data:t})})}function Eo(s){let e={};for(let n in s)n.startsWith("on")&&(e[Xn(n.slice(2))]=s[n]);let t=async({data:n})=>{if(e[n.type])try{let r=await e[n.type](n.data);self.postMessage({type:`${n.type}_result`,key:n.key,data:r})}catch(r){self.postMessage({type:`${n.type}_result`,key:n.key,error:r})}else self.postMessage({type:`${n.type}_result`,key:n.key,error:"no_event"})};return self.addEventListener("message",t),()=>{self.removeEventListener("message",t)}}var it=g("three");function Mo(s,e=16711680){let t=new it.LineBasicMaterial({color:e}),n=new it.BufferGeometry().setFromPoints(s);return new it.Line(n,t)}function wo(s,e=16711680){let t=new it.LineBasicMaterial({color:e}),n=new it.BoxGeometry(1,1,1),r=new it.Mesh(n,t);return r.position.copy(s),r}function Y(s,e,t=0){s.forEach(n=>{n.geometry.coords=JSON.parse(JSON.stringify(n.geometry.cds)),n.geometry.type==="polygon"?(n.geometry.coords.map(r=>{Array.isArray(r)&&r.forEach(i=>{i[0]-=e[0],i[1]-=e[1]})}),n.geometry.otherCds&&(n.geometry.otherCoords=n.geometry.otherCds.map(r=>r.map(i=>ct(i,e)))),n.doors?.length&&n.doors.map(r=>{r.coord=ct(r.coordinate,e)})):n.geometry.coords=ct(n.geometry.cds,e)});for(let n=0;n<s.length;n++){let r=s[n];r.deltaHeight=1e-5*(t+n+1)}}function ct(s,e){return[s[0]-e[0],s[1]-e[1]]}var qn=g("@tweenjs/tween.js"),zt=class{pauseTween=!1;tweenStore=new Set;group=new qn.Group;constructor(){}update(){this.group.update()}pause(){this.pauseTween=!0,this.getAll().forEach(e=>{this.tweenStore.add(e),e.pause()})}continue(){this.pauseTween&&(this.tweenStore.forEach(e=>{e.resume()}),this.tweenStore.clear(),this.pauseTween=!1)}remove(e){this.group.remove(e)}getAll(){return this.group.getAll()}clear(){this.getAll().forEach(e=>e.stop()),this.group.removeAll()}dispose(){this.clear()}};var M=g("three");var hr=g("three");var v=g("three");var Yn=g("three/examples/jsm/lines/LineMaterial"),V=g("three");function jn(s){return`${s.x}-${s.y}-${s.z}`}var A=class{static lineMaterialMap=new Map;static meshStandardMaterialMap=new Map;static meshBasicMaterialMap=new Map;static shaderMaterialMap=new Map;static line2MaterialMap=new Map;static generateLineMaterialKey({color:e,opacity:t}){return`${e}-${t}`}static createLineMaterial({color:e,opacity:t}){let n=this.generateLineMaterialKey({color:e,opacity:t});if(this.lineMaterialMap.has(n))return this.lineMaterialMap.get(n);let r=new V.LineBasicMaterial({color:new V.Color(e).convertLinearToSRGB(),transparent:!0,opacity:t});return this.lineMaterialMap.set(n,r),r}static createMeshStandardMaterial({color:e,opacity:t}){let n=`${e}-${t}`;if(this.meshStandardMaterialMap.has(n))return this.meshStandardMaterialMap.get(n);let r=new V.MeshStandardMaterial({color:new V.Color(e).convertLinearToSRGB(),roughness:1,transparent:!0,opacity:t,depthWrite:!0});return this.meshStandardMaterialMap.set(n,r),r}static createMeshBasicMaterial({color:e,opacity:t}){let n=`${e}-${t}`;if(this.meshBasicMaterialMap.has(n))return this.meshBasicMaterialMap.get(n);let r=new V.MeshBasicMaterial({color:e,transparent:!0,opacity:t,depthWrite:!0});return this.meshBasicMaterialMap.set(n,r),r}static createShaderMaterial({gradualColor:e,center:t,maxValue:n,opacity:r,direction:i,max:o,min:a}){let l=`${e.toString()}-${jn(t)}-${n}-${r}-${jn(i)}`;if(this.shaderMaterialMap.has(l))return this.shaderMaterialMap.get(l);let u=`
|
|
1
|
+
"use strict";(()=>{var Qr=Object.create;var an=Object.defineProperty;var ti=Object.getOwnPropertyDescriptor;var ei=Object.getOwnPropertyNames;var ni=Object.getPrototypeOf,ri=Object.prototype.hasOwnProperty;var g=(s=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(s,{get:(n,t)=>(typeof require<"u"?require:n)[t]}):s)(function(s){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+s+'" is not supported')});var Mt=(s,n)=>()=>(n||s((n={exports:{}}).exports,n),n.exports);var ii=(s,n,t,e)=>{if(n&&typeof n=="object"||typeof n=="function")for(let r of ei(n))!ri.call(s,r)&&r!==t&&an(s,r,{get:()=>n[r],enumerable:!(e=ti(n,r))||e.enumerable});return s};var Xe=(s,n,t)=>(t=s!=null?Qr(ni(s)):{},ii(n||!s||!s.__esModule?an(t,"default",{value:s,enumerable:!0}):t,s));var vn=Mt((eo,yn)=>{yn.exports=function(n,t){return n[0]=t[0],n[1]=t[1],n}});var bn=Mt((no,En)=>{var xn=vn();En.exports=function(s,n){Array.isArray(n)||(n=[]),s.length>0&&n.push(xn([0,0],s[0]));for(var t=0;t<s.length-1;t++){var e=s[t],r=s[t+1],i=e[0],o=e[1],a=r[0],l=r[1],u=[.75*i+.25*a,.75*o+.25*l],c=[.25*i+.75*a,.25*o+.75*l];n.push(u),n.push(c)}return s.length>1&&n.push(xn([0,0],s[s.length-1])),n}});var Rn=Mt((ao,An)=>{var $e=class{constructor(){this.keys=new Set,this.queue=[]}sort(){this.queue.sort((n,t)=>n.priority-t.priority)}set(n,t){let e=Number(t);if(isNaN(e))throw new TypeError('"priority" must be a number');return this.keys.has(n)?this.queue.map(r=>(r.key===n&&Object.assign(r,{priority:e}),r)):(this.keys.add(n),this.queue.push({key:n,priority:e})),this.sort(),this.queue.length}next(){let n=this.queue.shift();return this.keys.delete(n.key),n}isEmpty(){return this.queue.length===0}has(n){return this.keys.has(n)}get(n){return this.queue.find(t=>t.key===n)}};An.exports=$e});var Nn=Mt((uo,Ln)=>{function In(s,n){let t=new Map;for(let[e,r]of s)e!==n&&r instanceof Map?t.set(e,In(r,n)):e!==n&&t.set(e,r);return t}Ln.exports=In});var Un=Mt((lo,On)=>{function li(s){let n=Number(s);return!(isNaN(n)||n<=0)}function Dn(s){let n=new Map;return Object.keys(s).forEach(e=>{let r=s[e];if(r!==null&&typeof r=="object"&&!Array.isArray(r))return n.set(e,Dn(r));if(!li(r))throw new Error(`Could not add node at key "${e}", make sure it's a valid node`,r);return n.set(e,Number(r))}),n}On.exports=Dn});var Gn=Mt((co,Bn)=>{function Fn(s){if(!(s instanceof Map))throw new Error(`Invalid graph: Expected Map instead found ${typeof s}`);s.forEach((n,t)=>{if(typeof n=="object"&&n instanceof Map){Fn(n);return}if(typeof n!="number"||n<=0)throw new Error(`Values must be numbers greater than 0. Found value ${n} at ${t}`)})}Bn.exports=Fn});var Ke=Mt((ho,Vn)=>{var ci=Rn(),hi=Nn(),zn=Un(),kn=Gn(),Ze=class{constructor(n){n instanceof Map?(kn(n),this.graph=n):n?this.graph=zn(n):this.graph=new Map}addNode(n,t){let e;return t instanceof Map?(kn(t),e=t):e=zn(t),this.graph.set(n,e),this}addVertex(n,t){return this.addNode(n,t)}removeNode(n){return this.graph=hi(this.graph,n),this}path(n,t,e={}){if(!this.graph.size)return e.cost?{path:null,cost:0}:null;let r=new Set,i=new ci,o=new Map,a=[],l=0,u=[];if(e.avoid&&(u=[].concat(e.avoid)),u.includes(n))throw new Error(`Starting node (${n}) cannot be avoided`);if(u.includes(t))throw new Error(`Ending node (${t}) cannot be avoided`);for(i.set(n,0);!i.isEmpty();){let c=i.next();if(c.key===t){l=c.priority;let f=c.key;for(;o.has(f);)a.push(f),f=o.get(f);break}r.add(c.key),(this.graph.get(c.key)||new Map).forEach((f,d)=>{if(r.has(d)||u.includes(d))return null;if(!i.has(d))return o.set(d,c.key),i.set(d,c.priority+f);let y=i.get(d).priority,p=c.priority+f;return p<y?(o.set(d,c.key),i.set(d,p)):null})}return a.length?(e.trim?a.shift():a=a.concat([n]),e.reverse||(a=a.reverse()),e.cost?{path:a,cost:l}:a):e.cost?{path:null,cost:0}:null}shortestPath(...n){return this.path(...n)}};Vn.exports=Ze});var Ie=g("three");var U=class{tasks={requestAnimation:new Set,timeout:new Set,interval:new Set};requestAnimationFrame(n){let t=window.requestAnimationFrame(()=>{this.tasks.requestAnimation.delete(t),n()});return this.tasks.requestAnimation.add(t),t}cancelAnimationFrame(n){this.tasks.requestAnimation.delete(n),window.cancelAnimationFrame(n)}setTimeout(n,t){let e=window.setTimeout(()=>{this.tasks.timeout.delete(e),n()},t);return this.tasks.timeout.add(e),e}clearTimeout(n){this.tasks.timeout.delete(n),window.clearTimeout(n)}setInterval(n,t){let e=window.setInterval(()=>{this.tasks.interval.delete(e),n()},t);return this.tasks.interval.add(e),e}clearInterval(n){this.tasks.interval.delete(n),window.clearInterval(n)}dispose(){this.tasks.requestAnimation.forEach(n=>{window.cancelAnimationFrame(n)}),this.tasks.requestAnimation.clear(),this.tasks.timeout.forEach(n=>{window.clearTimeout(n)}),this.tasks.timeout.clear(),this.tasks.interval.forEach(n=>{window.clearInterval(n)}),this.tasks.interval.clear()}};var j=g("three");function un(){let s=new j.Group,n=new j.AmbientLight(16777215,2.6);return s.add(n),s}function st(s,n=[]){let t=new j.Shape(s.map(e=>new j.Vector2(...e)));return n.length&&n.forEach(e=>{var r=new j.Path(e.map(i=>new j.Vector2(...i)));t.holes.push(r)}),t}function ln(s=16777215,n=1){let t=new j.DirectionalLight(s,n);return t.castShadow=!0,t.shadow.radius=8,t.shadow.bias=-.001,t.shadow.mapSize.set(256,256),t.shadow.camera.left=-200,t.shadow.camera.right=200,t.shadow.camera.top=200,t.shadow.camera.bottom=-200,t}function W(s,n){if(n&&s.children&&s.children.length&&s.children.forEach(t=>{W(t,n)}),s.isMesh){let t=s;t.geometry&&t.geometry.dispose(),t.material&&(Array.isArray(t.material)?t.material.forEach(e=>{e.dispose()}):t.material.dispose())}s.isLight&&s.dispose?.()}function cn(s){return/[\u4E00-\u9FA5]+/g.test(s)}var C=g("three"),Nt=g("@turf/turf");function x(s,n,t,e){let r=s.clone().project(n),i=t/2,o=e/2,a=Math.round(r.x*i+i),l=Math.round(-r.y*o+o);return{x:a,y:l}}function Jt(s){let n=(0,Nt.featureCollection)(s.map(e=>(0,Nt.point)(e)));return(0,Nt.center)(n).geometry.coordinates}function gt(s,n,t){return s.x>=n.x&&s.x<=t.x&&s.y>=n.y&&s.y<=t.y}function Ui(s){let n=0,t=new C.Vector3;for(let e=1;e<s.length;e++){let r=new C.Vector3(s[e-1][0],s[e-1][1],0),i=new C.Vector3(s[e][0],s[e][1],0),o=i.distanceTo(r);o>n&&(n=o,t=i.clone().sub(r).normalize())}return t}function F(s,n){return Math.sqrt((n[0]-s[0])**2+(n[1]-s[1])**2)}function at(s){let n=0;for(let t=0;t<s.length-1;t++)n+=F(s[t],s[t+1]);return n}function hn(s,n,t){let e=new C.Vector2(n[0]-s[0],n[1]-s[1]),r=new C.Vector2(n[0]-t[0],n[1]-t[1]),o=e.angleTo(r)*180/Math.PI,a=new C.Vector2(n[0]-s[0],n[1]-s[1]);return new C.Vector2(t[0]-s[0],t[1]-s[1]).cross(a)>0?o:-o}function pn(s,n){let t=Math.min(F(s[0][0],s[0][1]),F(s[0][2],s[0][1]))-1;n||(n=Jt(s[0]));let e=oi(n,t),r=new C.Vector2(s[0][0][0],s[0][0][1]),i=new C.Vector2(s[0][1][0],s[0][1][1]),o=new C.Vector2(s[0][2][0],s[0][2][1]),l=(r.distanceTo(i)>i.distanceTo(o)?i.clone().sub(r):o.clone().sub(i)).angleTo(new C.Vector2(0,1)),u=new C.Matrix3;return u.multiply(new C.Matrix3().translate(n[0],n[1])).multiply(new C.Matrix3().rotate(l)).multiply(new C.Matrix3().translate(-n[0],-n[1])),[e.map(c=>{let h=new C.Vector2(c[0],c[1]).applyMatrix3(u);return[h.x,h.y]})]}function oi(s,n){let t=n/2;return[[s[0]-t,s[1]+t],[s[0]+t,s[1]+t],[s[0]+t,s[1]-t],[s[0]-t,s[1]-t],[s[0]-t,s[1]+t]]}function Dt(s,n){let t=0,e=1/0,[r,i]=n;for(let o=0;o<s.length-1;o++){let[a,l]=s[o],[u,c]=s[o+1],h=Math.min(a,u)<=r&&r<=Math.max(a,u),f=Math.min(l,c)<=i&&i<=Math.max(l,c);if(h&&f){let d=Math.abs((u-a)*(i-l)-(c-l)*(r-a));d<e&&(e=d,t=o)}}return t}function fn(s,n){let t=s[0],e=s[1],r=!1;for(let i=0,o=n.length-1;i<n.length;o=i++){let a=n[i][0],l=n[i][1],u=n[o][0],c=n[o][1];l>e!=c>e&&t<(u-a)*(e-l)/(c-l)+a&&(r=!r)}return r}function Ot(s,n){return new Proxy(s,{get:(t,e,r)=>Reflect.get(t,e,r),set:(t,e,r,i)=>{let o=Reflect.get(t,e,i),a=Reflect.set(t,e,r,i);return o!==r&&n.dispatchEvent({type:`change-${e}`,value:r}),a}})}function wt(s,n){return Promise.race([s,new Promise((t,e)=>{setTimeout(()=>e(new Error("Promise timeout")),n)})])}function Qt(s){return document.createElementNS("http://www.w3.org/2000/svg",s)}function dn(s,n){let t=Qt("svg");return t.setAttribute("width",s),t.setAttribute("height",n),t.style.cssText="position: absolute; left: 0; top: 0; pointer-events: none;",t}function Xt(s="2",n){let t=Qt("circle");return t.setAttribute("r",s),t.setAttribute("fill",n),t}function te(s){let n=Qt("line");return n.setAttribute("stroke",s),n}function mt(s,n){let t=Qt("rect");return t.setAttribute("stroke",s),t.setAttribute("fill",n),t}function Tt(s,n,t){s.setAttribute("cx",`${n}`),s.setAttribute("cy",`${t}`)}function rt(s,n,t){n&&(s.setAttribute("x1",`${n.x}`),s.setAttribute("y1",`${n.y}`)),t&&(s.setAttribute("x2",`${t.x}`),s.setAttribute("y2",`${t.y}`))}function k(s,n,t,e,r){s.setAttribute("x",`${n}`),s.setAttribute("y",`${t}`),s.setAttribute("width",`${e}`),s.setAttribute("height",`${r}`)}function gn(){return Promise.resolve()}function ki(){return new Promise(s=>{requestAnimationFrame(s)})}function Hi(s){return parseInt(s.replace("#","0x"),16)}function Wi(s,n){let t=parseInt(s.substring(1,3),16),e=parseInt(s.substring(3,5),16),r=parseInt(s.substring(5,7),16),i=Math.round(t*n),o=Math.round(e*n),a=Math.round(r*n);return`#${(1<<24|i<<16|o<<8|a).toString(16).slice(1)}`}function ft(s,n=.85){let t,e,r;if(s.startsWith("#"))t=parseInt(s.substring(1,3),16),e=parseInt(s.substring(3,5),16),r=parseInt(s.substring(5,7),16);else{let o=s.slice(4,-1).split(",");t=parseInt(o[0].trim()),e=parseInt(o[1].trim()),r=parseInt(o[2].trim())}return t=Math.min(Math.floor(t*n),255),e=Math.min(Math.floor(e*n),255),r=Math.min(Math.floor(r*n),255),"#"+((1<<24)+(t<<16)+(e<<8)+r).toString(16).slice(1)}function qe(s,n){s=s.replace(/^#/,"");let t=parseInt(s.substring(0,2),16),e=parseInt(s.substring(2,4),16),r=parseInt(s.substring(4,6),16);return n!==void 0?`rgba(${t}, ${e}, ${r}, ${n})`:`rgb(${t}, ${e}, ${r})`}var Ut=navigator.userAgent.toUpperCase().indexOf("MAC")>=0,mn=(window.navigator.userAgent||"").toLocaleLowerCase(),qt=/ios|iphone/i.test(mn),qi=/android|adr|linux/gi.test(mn);function Ft(s){return Ut?s==="Meta":s==="Control"}var je="__once__",_n=class{events=new Map;on(n,t){if(typeof t!="function")return;let e=this.events.get(n);return e?e.add(t):this.events.set(n,new Set([t]))}once(n,t){if(typeof t!="function")return;let e=`${je}${n}`,r=this.events.get(e);return r?r.add(t):this.events.set(e,new Set([t]))}off(n,t){let e=this.events.get(n),r=this.events.get(`${je}${n}`);!e&&!r||(t===void 0&&(e?.clear(),r?.clear()),e?.has(t)&&e.delete(t),r?.has(t)&&r.delete(t))}offAll(){this.events.clear()}emit(n,...t){let e=this.events.get(n),r=this.events.get(`${je}${n}`);!e&&!r||(e?.forEach(i=>{typeof i=="function"&&i(...t)}),r?.forEach(i=>{typeof i=="function"&&i(...t)}),r?.clear())}};var jt=(t=>(t.SWITCH_FLOOR_BEFORE="switch_floor_before",t.SWITCH_FLOOR_AFTER="switch_floor_after",t))(jt||{});function Bt(s){return Object.keys(s).sort().map(n=>`${n}=${s[n]}`).join("&")}function Qi(s,n){return new Promise((t,e)=>{let r=new XMLHttpRequest;r.open("GET",s,!0),Object.keys(n.headers||{}).forEach(i=>{r.setRequestHeader(i,n.headers[i])}),n.responseType&&(r.responseType=n.responseType),r.onload=()=>{if(r.status>=200&&r.status<300)if(n.responseType==="arraybuffer")t(r.response);else try{let i=JSON.parse(r.responseText);t(i)}catch(i){e(i)}else e(r.statusText)},r.onerror=()=>{e(r.statusText)},r.send()})}var Gt=g("three"),Sn=Xe(bn(),1);function si(s,n){let t=s.clone().normalize(),e=n.clone().normalize();return Math.acos(t.dot(e))}function ai(s){let n=0;return s.reduce(([t,e],[r,i])=>(n+=Math.sqrt((r-t)**2+(i-e)**2),[r,i])),n/s.length}function Mn(s,n=.25){if(ai(s)<n)return s;let t=(0,Sn.default)(s);return Mn(t,n)}function wn(s,n=!1,t=!0,e=5,r=150,i=3){let o=[],a=!n;if(o.push(s[0]),s.length<2)return o;for(let u=0;u<s.length-2;u+=1){let c=s[u],h=s[u+1],f=s[u+2],d=new Gt.Vector2(c[0]-h[0],c[1]-h[1]),y=new Gt.Vector2(f[0]-h[0],f[1]-h[1]),p=si(d,y)/Math.PI*180,m=d.length()+y.length();(!a||p<r&&m>.01||m>e)&&(o.push(s[u+1]),a=!0)}if(o.push(s[s.length-1]),!t)return o;let l=[];l.push(o[0]);for(let u=0;u<o.length-2;u+=1){let c=new Gt.Vector2(o[u][0],o[u][1]),h=new Gt.Vector2(o[u+1][0],o[u+1][1]),f=new Gt.Vector2(o[u+2][0],o[u+2][1]),d=c.distanceTo(h)/2,y=f.distanceTo(h)/2,p=h.clone(),m=h.clone();p.add(c.clone().sub(h).normalize().multiplyScalar(d>i?i/2:d)),m.add(f.clone().sub(h).normalize().multiplyScalar(y>i?i/2:y));let b=[[p.x,p.y],[h.x,h.y],[m.x,m.y]];l.push(...Mn(b,i/25))}return l.push(o[o.length-1]),ui(l)}function ui(s){if(s.length<=1)return s;let n=[],t;return s.forEach(([e,r])=>{t?e===t[0]&&r===t[1]||(t=[e,r],n.push([e,r])):(t=[e,r],n.push([e,r]))}),n}function Tn(s,n,t){let e=Math.sqrt((t[0]-n[0])**2+(t[1]-n[1])**2);if(e===0)return{distance:Math.sqrt((s[0]-n[0])**2+(s[1]-n[1])**2),closestPoint:n.slice(0)};let r=Math.max(0,Math.min(1,((s[0]-n[0])*(t[0]-n[0])+(s[1]-n[1])*(t[1]-n[1]))/e**2)),i=[n[0]+r*(t[0]-n[0]),n[1]+r*(t[1]-n[1])];return{distance:Math.sqrt((s[0]-i[0])**2+(s[1]-i[1])**2),closestPoint:i}}function io(s,n,t){let[e,r]=s,[i,o]=n,a=Math.sqrt(Math.pow(i-e,2)+Math.pow(o-r,2));if(a===0||a<t)return[...n];let l=t/a,u=e+(i-e)*l,c=r+(o-r)*l;return[u,c]}var Cn=(u=>(u.START="start",u.END="end",u.FRONT="front",u.RIGHT="right",u.LEFT="left",u.RIGHT_FRONT="right_front",u.LEFT_FRONT="left_front",u.RIGHT_BACK="right_back",u.LEFT_BACK="left_back",u))(Cn||{});function Ye(s,n,t){let e=hn(s,n,t);return 180-Math.abs(e)<15?"front":e>135?"right_front":e<-135?"left_front":e<=135&&e>=60?"right":e>=-135&&e<=-60?"left":e<60&&e>0?"right_back":e>-60&&e<0?"left_back":"front"}function oo(s){if(!s.length)return[];let n=[{direction:"start",distance:F(s[0],s[1]),points:[s[0],s[1]]}];for(let t=2;t<s.length;t++){let e=Ye(s[t-2],s[t-1],s[t]);if(e==="front"){let r=n[n.length-1],i=F(s[t-1],s[t]);r.distance+=i,t!==2&&r.points.push(s[t-1])}else n.push({direction:e,distance:F(s[t-1],s[t]),points:[s[t-1],s[t]]})}return n.push({direction:"end",distance:0,points:[s[s.length-1]]}),n}function Pn(s,n){if(s.length<2)return-1;let t=0;for(let e=1;e<s.length;e++){let r=s[e-1],i=s[e],o=[n[0]-r[0],n[1]-r[1]],a=[i[0]-r[0],i[1]-r[1]],l=Math.min(i[0],r[0])<=n[0]&&n[0]<=Math.max(i[0],r[0]),u=Math.min(i[1],r[1])<=n[1]&&n[1]<=Math.max(i[1],r[1]);if(console.log(l,u),l&&u){let c=o[0]*a[1]-o[1]*a[0];if(Math.abs(c)<1e-6){let h=Math.sqrt((n[0]-r[0])**2+(n[1]-r[1])**2);return t+h}}t+=Math.sqrt((i[0]-r[0])**2+(i[1]-r[1])**2)}return-1}function ee(s,n){if(s.length<2)return s[0]??null;let t=0;for(let e=1;e<s.length;e++){let r=s[e-1],i=s[e],o=Math.sqrt((i[0]-r[0])**2+(i[1]-r[1])**2);if(t+=o,t>=n){let a=(n-(t-o))/o,l=r[0]+(i[0]-r[0])*a,u=r[1]+(i[1]-r[1])*a;return[l,u]}}return null}var ut=Xe(Ke(),1);var J="___",Hn=class{constructor(n=3){this.lift_priority=n}roadInfo=[];pointMap=new Map;nodeMap=new Map;facilityMap=new Map;straightLadderMap=new Map;escalatorMap=new Map;staircaseMap=new Map;lineMap=new Map;baseRoute=new ut.default;escalatorRoute=new ut.default;straightLadderRoute=new ut.default;initRoute(n){this.clear(),this.roadInfo=n,n.length&&(n.forEach(t=>{t.points.forEach(e=>{let r=`${t.floor}${J}${e.id}`;if(this.pointMap.set(r,e),this.nodeMap.set(`${e.floor}${J}${e.nodeId}`,r),e.type==="straightLadder"){let i=this.straightLadderMap.get(e.name)||[];i.push({...e}),this.straightLadderMap.set(e.name,i)}if(e.type==="staircase"){let i=this.staircaseMap.get(e.name)||[];i.push({...e}),this.staircaseMap.set(e.name,i)}if(e.type==="escalator"){let i=this.escalatorMap.get(e.name)||{};e.escalatorDirection==="exit"?i.end={floor:e.floor,id:e.id}:i.start={floor:e.floor,id:e.id},this.escalatorMap.set(e.name,i)}if(e.type==="facility"){let i=this.facilityMap.get(e.targetId)||[];i.push({...e}),this.facilityMap.set(e.targetId,i)}}),t.lines.filter(e=>e.direction!=="no").forEach(e=>{let r=`${t.floor}${J}${e.from}`,i=`${t.floor}${J}${e.to}`,o=this.pointMap.get(r)?.cds,a=this.pointMap.get(i)?.cds;if(o?.length&&a?.length){let l=F(o,a);this.addLineItem(r,i,l),e.direction==="double"&&this.addLineItem(i,r,l)}})}),this.initBaseRoute(),this.initEscalatorRoute(),this.initStraightLadderRoute())}addLineItem(n,t,e,r=this.lineMap){let i=r.get(n)||new Map;i.set(t,e),r.set(n,i)}addFacilityToLineMap(n,t,e,r){[...this.straightLadderMap,...this.staircaseMap].forEach(([i,o])=>{if(!(o.length<2))for(let a=0;a<o.length;a++){let l=`${o[a].floor}${J}${o[a].id}`;for(let u=0;u<o.length;u++)if(a!==u){let c=`${o[u].floor}${J}${o[u].id}`,h=this.pointMap.get(l)?.cds,f=this.pointMap.get(c)?.cds;if(h?.length&&f?.length)if(o[a].type==="straightLadder"){let d=t;this.addLineItem(l,c,d,r)}else{let d=e;this.addLineItem(l,c,d,r)}}}}),this.escalatorMap.forEach((i,o)=>{if(i.start&&i.end){let a=`${i.start.floor}${J}${i.start.id}`,l=`${i.end.floor}${J}${i.end.id}`,u=this.pointMap.get(a)?.cds,c=this.pointMap.get(l)?.cds;if(u?.length&&c?.length){let h=n;this.addLineItem(a,l,h,r)}}})}initBaseRoute(){let n=new Map([...this.lineMap]);this.addFacilityToLineMap(1,this.lift_priority,3e4,n),this.baseRoute=new ut.default(n)}initEscalatorRoute(){let n=new Map([...this.lineMap]),t=1e4;this.addFacilityToLineMap(1*t,this.lift_priority*t,3e4*t,n),this.escalatorRoute=new ut.default(n)}initStraightLadderRoute(){let n=new Map([...this.lineMap]),t=1e4;this.addFacilityToLineMap(3*t,1*t,3e4*t,n),this.straightLadderRoute=new ut.default(n)}checkStart(n){return!(!n.floor||!n.nodeId&&(!n.coord||n.coord.length<2))}checkEnd(n){return n.facility?!0:this.checkStart(n)}transformStart(n){if(n.nodeId){let t=this.nodeMap.get(`${n.floor}${J}${n.nodeId}`);if(t){let[e,r]=t.split(J);return{floor:e,id:r}}}if(n.coord?.length){let t=this.roadInfo.find(r=>r.floor===n.floor);if(!t)return null;let e=t.points.reduce((r,i)=>{let o=F(n.coord,i.cds);return o<r.min&&(r.min=o,r.point=i),r},{min:1/0,point:t.points[0]});return{floor:e.point.floor,id:e.point.id}}return null}transformEnd(n){if(n.floor){let t=this.transformStart(n);if(t)return t}return n.facility&&this.facilityMap.get(n.facility)?.length?{floor:n.floor,facility:n.facility}:null}getPath(n,t,e=""){if(!this.checkStart(n))return"start-error";if(!this.checkEnd(t))return"end-error";let r=this.transformStart(n);if(!r)return"no-start";let i=this.transformEnd(t);if(!i)return"no-end";let o=this.getBasePath.bind(this);switch(e){case"escalator":o=this.getEscalatorPath.bind(this);break;case"straightLadder":o=this.getStraightLadderPath.bind(this);break;default:o=this.getBasePath.bind(this);break}if(console.log(r,i),i.id)return o(r,i);if(i.facility){let a=this.facilityMap.get(i.facility).filter(u=>i.floor?u.floor===i.floor:!0);if(!a.length)return null;let l=a.map(u=>o(r,{floor:u.floor,id:u.id})).filter(u=>!!u);return l.reduce((u,c)=>{let h=c.reduce((f,d)=>f+at(d.points),0);return h<u.distance&&(u.distance=h,u.path=c),u},{distance:1/0,path:l[0]}).path}}getRoutePath(n,t,e){let r=`${n.floor}${J}${n.id}`,i=`${t.floor}${J}${t.id}`,o=e.path(r,i);if(console.log(r,i,o),!o)return null;let a=[];return o.map(l=>{let u=this.pointMap.get(l);if(u){let{floor:c}=u;if(a[a.length-1]?.floor===c){let h=a[a.length-1];h.points.push(u.cds),h.endType=u.type,h.destId=u.nodeId,h.distance=at(h.points)}else a.push({floor:c,points:[u.cds],endType:u.type,destId:u.nodeId,distance:0})}}),a}getBasePath(n,t){return this.getRoutePath(n,t,this.baseRoute)}getEscalatorPath(n,t){return this.getRoutePath(n,t,this.escalatorRoute)}getStraightLadderPath(n,t){return this.getRoutePath(n,t,this.straightLadderRoute)}clear(){this.roadInfo=[],this.pointMap.clear(),this.nodeMap.clear(),this.facilityMap.clear(),this.straightLadderMap.clear(),this.escalatorMap.clear(),this.staircaseMap.clear(),this.lineMap.clear(),this.baseRoute=new ut.default,this.escalatorRoute=new ut.default,this.straightLadderRoute=new ut.default}};var Q=Xe(Ke(),1);var ne=g("lodash"),B="___",Wn=class{constructor(n=3){this.lift_priority=n}roadInfo=[];facilities=[];pointMap=new Map;nodeMap=new Map;facilityMap=new Map;straightLadderMap=new Map;escalatorMap=new Map;rampMap=new Map;staircaseMap=new Map;parkingMap=new Map;lineMap=new Map;baseRoute=new Q.default;escalatorRoute=new Q.default;straightLadderRoute=new Q.default;forwardLineMap=new Map;forwardRoute=new Q.default;isFacilityByType(n){return["facility","escalator","straightLadder","staircase","ramp"].includes(n)}initFacilities(n){this.facilities=n.map(t=>{let e=[];try{e=JSON.parse(t.entry_end_floor)}catch{e=[]}let r=[];try{r=JSON.parse(t.entry_start_floor)}catch{r=[]}return{...t,entry_start_floor:r,entry_end_floor:e}})}initRoute(n,t){this.clear(),this.roadInfo=n,this.initFacilities(t),n.length&&(n.forEach(e=>{e.points.forEach(r=>{r.floor=e.floor;let i=`${e.floor}${B}${r.id}`;if(this.pointMap.set(i,r),this.nodeMap.set(`${e.floor}${B}${r.nodeId}`,i),this.isFacilityByType(r.type)){let o=this.facilities.find(a=>a.id===+r.targetId);if(o){switch(o.entry_infra_type){case"straightLadder":if(o.entry_end_floor.find(c=>c.floor===e.floor)&&o.entry_start_floor.find(c=>c.floor===e.floor)){let c=this.straightLadderMap.get(r.targetId)||[];c.push({...r}),this.straightLadderMap.set(r.targetId,c)}break;case"staircase":if(o.entry_end_floor.find(c=>c.floor===e.floor)&&o.entry_start_floor.find(c=>c.floor===e.floor)){let c=this.staircaseMap.get(r.targetId)||[];c.push({...r}),this.staircaseMap.set(r.targetId,c)}break;case"escalator":let l=this.escalatorMap.get(r.targetId)||[];if(o.entry_start_floor.find(c=>c.floor===e.floor)){let c=l.find(h=>h.end?.floor!==e.floor&&!h.start);c?c.start=r:l.push({start:r})}if(o.entry_end_floor.find(c=>c.floor===e.floor)){let c=l.find(h=>h.start?.floor!==e.floor&&!h.end);c?c.end=r:l.push({end:r})}this.escalatorMap.set(r.targetId,l);break;case"ramp":let u=this.rampMap.get(r.targetId)||[];if(o.entry_start_floor.find(c=>c.floor===e.floor)){let c=u.find(h=>h.end?.floor!==e.floor&&!h.start);c?c.start=r:u.push({start:r})}if(o.entry_end_floor.find(c=>c.floor===e.floor)){let c=u.find(h=>h.start?.floor!==e.floor&&!h.end);c?c.end=r:u.push({end:r})}this.rampMap.set(r.targetId,u);break}let a=this.facilityMap.get(r.targetId)||[];a.push({...r}),this.facilityMap.set(r.targetId,a)}}r.type==="parkingSpace"&&this.parkingMap.set(`${e.floor}${B}${r.name}`,r)}),e.lines.filter(r=>r.direction!=="no").forEach(r=>{let i=`${e.floor}${B}${r.from}`,o=`${e.floor}${B}${r.to}`,a=this.pointMap.get(i)?.cds,l=this.pointMap.get(o)?.cds;if(a?.length&&l?.length){let u=F(a,l);switch(this.addLineItem(i,o,u),this.addLineItem(o,i,u),r.direction){case"double":this.addLineItem(i,o,u,this.forwardLineMap),this.addLineItem(o,i,u,this.forwardLineMap);break;case"single":this.addLineItem(i,o,u,this.forwardLineMap);break;case"back":this.addLineItem(o,i,u,this.forwardLineMap);break}}})}),this.initBaseRoute(),this.initEscalatorRoute(),this.initStraightLadderRoute(),this.initForwardRoute())}addLineItem(n,t,e,r=this.lineMap){let i=r.get(n)||new Map;i.set(t,e),r.set(n,i)}addFacilityToLineMap(n,t,e,r){[...this.straightLadderMap,...this.staircaseMap].forEach(([i,o])=>{if(!(o.length<2))for(let a=0;a<o.length;a++){let l=`${o[a].floor}${B}${o[a].id}`;for(let u=0;u<o.length;u++)if(a!==u){let c=`${o[u].floor}${B}${o[u].id}`,h=this.pointMap.get(l)?.cds,f=this.pointMap.get(c)?.cds;if(h?.length&&f?.length)if(o[a].type==="straightLadder"){let d=t;this.addLineItem(l,c,d,r)}else{let d=e;this.addLineItem(l,c,d,r)}}}}),this.escalatorMap.forEach((i,o)=>{i.forEach(a=>{if(a.start&&a.end){let l=`${a.start.floor}${B}${a.start.id}`,u=`${a.end.floor}${B}${a.end.id}`,c=this.pointMap.get(l)?.cds,h=this.pointMap.get(u)?.cds;if(c?.length&&h?.length){let f=n;this.addLineItem(l,u,f,r)}}})})}initBaseRoute(){let n=new Map((0,ne.cloneDeep)([...this.lineMap]));this.addFacilityToLineMap(1,this.lift_priority,3e4,n),this.baseRoute=new Q.default(n)}initEscalatorRoute(){let n=new Map((0,ne.cloneDeep)([...this.lineMap])),t=1e4;this.addFacilityToLineMap(1*t,this.lift_priority*t,3e4*t,n),this.escalatorRoute=new Q.default(n)}initStraightLadderRoute(){let n=new Map((0,ne.cloneDeep)([...this.lineMap])),t=1e4;this.addFacilityToLineMap(3*t,1*t,3e4*t,n),this.straightLadderRoute=new Q.default(n)}initForwardRoute(){this.rampMap.forEach((n,t)=>{n.forEach(e=>{if(e.start&&e.end){let r=`${e.start.floor}${B}${e.start.id}`,i=`${e.end.floor}${B}${e.end.id}`,o=this.pointMap.get(r)?.cds,a=this.pointMap.get(i)?.cds;o?.length&&a?.length&&this.addLineItem(r,i,10,this.forwardLineMap)}})}),this.forwardRoute=new Q.default(this.forwardLineMap)}checkStart(n){return!(!n.floor||!n.nodeId&&(!n.coord||n.coord.length<2))}checkEnd(n){return n.facility||n.parkingSpace&&n.floor?!0:this.checkStart(n)}transformStart(n){if(n.nodeId){let t=this.nodeMap.get(`${n.floor}${B}${n.nodeId}`);if(t){let[e,r]=t.split(B);return{floor:e,id:r}}}if(n.coord?.length){let t=this.roadInfo.find(r=>r.floor===n.floor);if(!t)return null;let e=t.points.reduce((r,i)=>{let o=F(n.coord,i.cds);return o<r.min&&(r.min=o,r.point=i),r},{min:1/0,point:t.points[0]});return{floor:t.floor,id:e.point.id}}return null}transformEnd(n){if(n.floor){if(n.parkingSpace){let e=this.parkingMap.get(`${n.floor}${B}${n.parkingSpace}`);if(e)return{floor:n.floor,id:e.id}}let t=this.transformStart(n);if(t)return t}return n.facility&&this.facilityMap.get(n.facility)?.length?{floor:n.floor,facility:n.facility}:null}getPath(n,t,e=""){if(console.log(n,t,e),!this.checkStart(n))return"start-error";if(!this.checkEnd(t))return"end-error";let r=this.transformStart(n);if(!r)return"no-start";let i=this.transformEnd(t);if(!i)return"no-end";console.log("transformedStart",r,i);let o=this.getBasePath.bind(this);switch(e){case"escalator":o=this.getEscalatorPath.bind(this);break;case"straightLadder":o=this.getStraightLadderPath.bind(this);break;case"forward":o=this.getForwardPath.bind(this);break;default:o=this.getBasePath.bind(this);break}if(i.id)return o(r,i);if(i.facility){let a=this.facilityMap.get(i.facility).filter(u=>i.floor?u.floor===i.floor:!0);if(!a.length)return null;let l=a.map(u=>o(r,{floor:u.floor,id:u.id})).filter(u=>!!u);return l.reduce((u,c)=>{let h=c.reduce((f,d)=>f+at(d.points),0);return h<u.distance&&(u.distance=h,u.path=c),u},{distance:1/0,path:l[0]}).path}}getRoutePath(n,t,e){let r=`${n.floor}${B}${n.id}`,i=`${t.floor}${B}${t.id}`,o=e.path(r,i);if(!o)return null;let a=[];return o.map(l=>{let u=this.pointMap.get(l);if(u){let{floor:c}=u,h=u.type;if(this.isFacilityByType(u.type)){let f=this.facilities.find(d=>d.id===+u.targetId);f&&(h=f.entry_infra_type)}if(a[a.length-1]?.floor===c){let f=a[a.length-1];f.points.push(u.cds),f.endType=h,f.destId=u.nodeId,f.distance=at(f.points)}else a.push({floor:c,points:[u.cds],endType:h,destId:u.nodeId,distance:0})}}),a}getBasePath(n,t){return this.getRoutePath(n,t,this.baseRoute)}getEscalatorPath(n,t){return this.getRoutePath(n,t,this.escalatorRoute)}getStraightLadderPath(n,t){return this.getRoutePath(n,t,this.straightLadderRoute)}getForwardPath(n,t){return this.getRoutePath(n,t,this.forwardRoute)}clear(){this.roadInfo=[],this.pointMap.clear(),this.nodeMap.clear(),this.facilityMap.clear(),this.straightLadderMap.clear(),this.escalatorMap.clear(),this.staircaseMap.clear(),this.lineMap.clear(),this.baseRoute=new Q.default,this.escalatorRoute=new Q.default,this.straightLadderRoute=new Q.default}};var Ct=class{static keySet=new Set;static createKey(){return Math.random().toString(36).substring(2,15)+Math.random().toString(36).substring(2,15)}static genUniqueKey(){let n=this.createKey();for(;this.keySet.has(n);)n=this.createKey();return n}static removeKey(n){this.keySet.delete(n)}static dispose(){this.keySet.clear()}};function Xn(s){return s.replace(/[A-Z]/g,n=>"_"+n.toLowerCase()).replace(/^_/,"")}function lt(s,n,t){return new Promise((e,r)=>{let i=Ct.genUniqueKey(),o=({data:a})=>{a.type===`${n}_result`&&a.key===i&&(Ct.removeKey(i),self.removeEventListener("message",o),a.error?r(a.error):e(a.data))};s.addEventListener("message",o),s.postMessage({type:n,key:i,data:t})})}function Eo(s){let n={};for(let e in s)e.startsWith("on")&&(n[Xn(e.slice(2))]=s[e]);let t=async({data:e})=>{if(n[e.type])try{let r=await n[e.type](e.data);self.postMessage({type:`${e.type}_result`,key:e.key,data:r})}catch(r){self.postMessage({type:`${e.type}_result`,key:e.key,error:r})}else self.postMessage({type:`${e.type}_result`,key:e.key,error:"no_event"})};return self.addEventListener("message",t),()=>{self.removeEventListener("message",t)}}var it=g("three");function Mo(s,n=16711680){let t=new it.LineBasicMaterial({color:n}),e=new it.BufferGeometry().setFromPoints(s);return new it.Line(e,t)}function wo(s,n=16711680){let t=new it.LineBasicMaterial({color:n}),e=new it.BoxGeometry(1,1,1),r=new it.Mesh(e,t);return r.position.copy(s),r}function Y(s,n,t=0){s.forEach(e=>{e.geometry.coords=JSON.parse(JSON.stringify(e.geometry.cds)),e.geometry.type==="polygon"?(e.geometry.coords.map(r=>{Array.isArray(r)&&r.forEach(i=>{i[0]-=n[0],i[1]-=n[1]})}),e.geometry.otherCds&&(e.geometry.otherCoords=e.geometry.otherCds.map(r=>r.map(i=>ct(i,n)))),e.doors?.length&&e.doors.map(r=>{r.coord=ct(r.coordinate,n)})):e.geometry.coords=ct(e.geometry.cds,n)});for(let e=0;e<s.length;e++){let r=s[e];r.deltaHeight=1e-5*(t+e+1)}}function ct(s,n){return[s[0]-n[0],s[1]-n[1]]}var qn=g("@tweenjs/tween.js"),zt=class{pauseTween=!1;tweenStore=new Set;group=new qn.Group;constructor(){}update(){this.group.update()}pause(){this.pauseTween=!0,this.getAll().forEach(n=>{this.tweenStore.add(n),n.pause()})}continue(){this.pauseTween&&(this.tweenStore.forEach(n=>{n.resume()}),this.tweenStore.clear(),this.pauseTween=!1)}remove(n){this.group.remove(n)}getAll(){return this.group.getAll()}clear(){this.getAll().forEach(n=>n.stop()),this.group.removeAll()}dispose(){this.clear()}};var M=g("three");var hr=g("three");var v=g("three");var Yn=g("three/examples/jsm/lines/LineMaterial"),V=g("three");function jn(s){return`${s.x}-${s.y}-${s.z}`}var A=class{static lineMaterialMap=new Map;static meshStandardMaterialMap=new Map;static meshBasicMaterialMap=new Map;static shaderMaterialMap=new Map;static line2MaterialMap=new Map;static generateLineMaterialKey({color:n,opacity:t}){return`${n}-${t}`}static createLineMaterial({color:n,opacity:t}){let e=this.generateLineMaterialKey({color:n,opacity:t});if(this.lineMaterialMap.has(e))return this.lineMaterialMap.get(e);let r=new V.LineBasicMaterial({color:new V.Color(n).convertLinearToSRGB(),transparent:!0,opacity:t});return this.lineMaterialMap.set(e,r),r}static createMeshStandardMaterial({color:n,opacity:t}){let e=`${n}-${t}`;if(this.meshStandardMaterialMap.has(e))return this.meshStandardMaterialMap.get(e);let r=new V.MeshStandardMaterial({color:new V.Color(n).convertLinearToSRGB(),roughness:1,transparent:!0,opacity:t,depthWrite:!0});return this.meshStandardMaterialMap.set(e,r),r}static createMeshBasicMaterial({color:n,opacity:t}){let e=`${n}-${t}`;if(this.meshBasicMaterialMap.has(e))return this.meshBasicMaterialMap.get(e);let r=new V.MeshBasicMaterial({color:n,transparent:!0,opacity:t,depthWrite:!0});return this.meshBasicMaterialMap.set(e,r),r}static createShaderMaterial({gradualColor:n,center:t,maxValue:e,opacity:r,direction:i,max:o,min:a}){let l=`${n.toString()}-${jn(t)}-${e}-${r}-${jn(i)}`;if(this.shaderMaterialMap.has(l))return this.shaderMaterialMap.get(l);let u=`
|
|
2
2
|
uniform vec3 uColor;
|
|
3
3
|
uniform vec3 uGradualColor;
|
|
4
4
|
uniform vec3 center;
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
void main() {
|
|
36
36
|
gl_FragColor = vec4(vColor.x, vColor.y, vColor.z, opacity);
|
|
37
37
|
}
|
|
38
|
-
`,h=new V.ShaderMaterial({uniforms:{uColor:{value:new V.Color(e[0]).convertLinearToSRGB()},uGradualColor:{value:new V.Color(e[1]).convertLinearToSRGB()},center:{value:t},maxValue:{value:n},opacity:{value:r},uDirection:{value:i},uMax:{value:o},uMin:{value:a}},vertexShader:u,fragmentShader:c,side:V.DoubleSide});return this.shaderMaterialMap.set(l,h),h}static createLine2MaterialMap({color:e,width:t,dashed:n,resolution:r}){let i=`${e}-${t}-${n}-${r.x}-${r.y}`;if(this.line2MaterialMap.has(i))return this.line2MaterialMap.get(i);let o=new Yn.LineMaterial({color:parseInt(e.slice(1),16),dashed:n,linewidth:t,worldUnits:!0,dashSize:1,gapSize:3,dashScale:1,resolution:r});return this.line2MaterialMap.set(i,o),o}static dispose(){this.lineMaterialMap.forEach((e,t)=>{e.dispose()}),this.lineMaterialMap.clear(),this.meshStandardMaterialMap.forEach((e,t)=>{e.dispose()}),this.meshStandardMaterialMap.clear(),this.meshBasicMaterialMap.forEach((e,t)=>{e.dispose()}),this.meshBasicMaterialMap.clear(),this.shaderMaterialMap.forEach((e,t)=>{e.dispose()}),this.shaderMaterialMap.clear(),this.line2MaterialMap.forEach((e,t)=>{e.dispose()}),this.line2MaterialMap.clear()}};var Pt=g("three");var _t=class{static canvas=document.createElement("canvas");static ctx=this.canvas.getContext("2d");static cacheMap=new Map;static options={width:1024,height:64,font:"54px sans-serif",textBaseline:"hanging",lineWidth:12,fillStyle:"rgba(0,0,0,1)",strokeStyle:"white"};static getCanvas(){if(this.canvas)return this.canvas;{let e=document.createElement("canvas");return this.canvas=e,e}}static getCtx(){if(this.ctx)return this.ctx;let t=this.getCanvas().getContext("2d");return this.ctx=t,t}static getMergedOptions(e){return{...this.options,...e}}static setCtxStyle(e){let t=this.getCanvas(),n=this.getCtx();t.width=e.width,t.height=e.height,n.font=e.font,n.textBaseline=e.textBaseline,n.lineWidth=e.lineWidth,n.fillStyle=e.fillStyle,n.strokeStyle=e.strokeStyle}static getTextureByText(e,t){let n=this.getMergedOptions(t),r=Bt({...n,text:e});if(this.cacheMap.has(r))return this.cacheMap.get(r);let i=this.getCanvas(),o=this.getCtx();o.clearRect(0,0,i.width,i.height),this.setCtxStyle(n);let a=cn(e)?4:8;n.lineWidth&&o.strokeText(e,2,a),o.fillText(e,2,a);let l=Math.ceil(o.measureText(e).width);l=l%2===0?l:l+1,l+=2;let u=o.getImageData(0,0,l,64),c=new Pt.DataTexture(Uint8Array.from(u.data),l,64,Pt.RGBAFormat);return c.flipY=!0,c.minFilter=Pt.LinearFilter,c.magFilter=Pt.LinearFilter,this.cacheMap.set(r,c),c}static dispose(){this.ctx=null,this.canvas=null,this.cacheMap.forEach(e=>e.dispose()),this.cacheMap.clear()}};var At=g("three"),yt=class{static textureLoader=new At.TextureLoader;static urlTextureMap=new Map;static getTextureByUrl(e){if(this.urlTextureMap.has(e))return this.urlTextureMap.get(e);let t=this.textureLoader.loadAsync(e);return t.then(n=>{n.format=At.RGBAFormat,n.magFilter=At.LinearFilter,n.minFilter=At.LinearFilter,n.colorSpace="srgb",this.urlTextureMap.set(e,n)}),this.urlTextureMap.set(e,t),t}static dispose(){this.urlTextureMap.forEach(e=>{e instanceof Promise?e.then(t=>t.dispose()):e.dispose()}),this.urlTextureMap.clear()}};var $n=g("three/examples/jsm/loaders/GLTFLoader"),vt=class{static loader=new $n.GLTFLoader;static modelMap=new Map;static async loadModel(e){if(this.modelMap.has(e)){let n=this.modelMap.get(e);if(n instanceof Promise)n.then(r=>({...r,scene:r.scene.clone()}));else return{...n,scene:n.scene.clone()}}let t=new Promise((n,r)=>{this.loader.load(e,i=>{n(i),this.modelMap.set(e,i)},void 0,r)});return this.modelMap.set(e,t),t.then(n=>({...n,scene:n.scene.clone()}))}static dispose(){this.modelMap.forEach(e=>{e instanceof Promise?e.then(t=>W(t.scene)):W(e.scene)}),this.modelMap.clear()}};var Zn=g("lodash"),Je={id:"",height:.1,airHeight:0,area:0,group:"",fillColor:"#EFF4FB",strokeColor:"#ffffff",fillOpacity:1,strokeOpacity:1,strokeWidth:1,doors:[],locked:!1,visible:!0,geometry:{type:"polygon",cds:[],coords:[],curveCpt:[],curveIndex:[]},layerType:"",zIndex:0,stroke:!0,deltaHeight:0,userData:{},gradualColor:[],renderType:"single",colorFactor:.9},L=class extends v.Object3D{constructor(t,n){super();this.context=t;if(this.options=Ot((0,Zn.cloneDeep)({...Je,...n}),this),this.options.geometry.type==="point"){let[r,i]=this.options.geometry.coords;return this.position.set(r,i,this.options.height+this.options.airHeight),this}this.initDoor(),this.init(),this.visible=this.options.visible,this.addEventListener("change-fillColor",({value:r})=>{this.initMaterial(),this.initMesh()}),this.addEventListener("change-fillOpacity",({value:r})=>{this.initMaterial(),this.initMesh()}),this.addEventListener("change-height",({value:r})=>{this.dispose(),this.init()}),this.addEventListener("change-strokeColor",({value:r})=>{this.options.stroke&&(this.initLineMaterial(),this.createBorder())}),this.addEventListener("change-strokeOpacity",({value:r})=>{this.options.stroke&&(this.initLineMaterial(),this.createBorder())}),this.addEventListener("change-airHeight",({value:r})=>{this.position.z=r}),this.addEventListener("change-visible",({value:r})=>{this.visible=r}),this.addEventListener("change-stroke",({value:r})=>{if(r){if(this.line)return;this.initLineGeometry(),this.initLineMaterial(),this.createBorder()}else this.line&&(this.remove(this.line),this.lineGeometry?.dispose())}),this.addEventListener("change-renderType",()=>{this.initMaterial(),this.initMesh()}),this.addEventListener("change-gradualColor",()=>{this.initMaterial(),this.initMesh()})}geometry;material;mesh;line;lineMaterial;lineGeometry;options;getCenter(){if(this.options.geometry.type==="point")return this.position.clone();let t=new v.Vector3,n=new v.Box3;return n.setFromObject(this),n.getCenter(t),t}getSize(){if(this.options.geometry.type==="point")return new v.Vector3(0,0,0);let t=new v.Box3,n=new v.Vector3;return t.setFromObject(this),t.getSize(n),n}getPosition(){let t=this.getCenter();return t.setZ(t.z+this.options.height/2),t}init(){this.geometry=this.initGeometry(),this.initMaterial(),this.initMesh(),this.mesh.position.z=this.options.airHeight+this.options.deltaHeight,this.options.stroke&&this.options.strokeOpacity!==0&&(this.initLineMaterial(),this.initLineGeometry(),this.createBorder())}initDoor(){if(this.options.doors?.length&&this.options.geometry.type==="polygon"){let t=this.options.geometry.coords[0];this.options.doors.forEach(n=>{let r=n.type==="single"?.5:1,i=.5,o=Dt(t,n.coord),a=new v.Vector2(...n.coord),l=new v.Vector2(...t[o]).sub(new v.Vector2(...n.coord)).normalize(),u=new v.Vector2().addVectors(a,l.clone().multiplyScalar(r)),c=new v.Vector2().addVectors(a,l.clone().multiplyScalar(-r)),h=new v.Vector2(-l.y,l.x),f=new v.Vector2().addVectors(u,h.clone().multiplyScalar(i));fn([f.x,f.y],t)||(h.multiplyScalar(-1),f=new v.Vector2().addVectors(u,h.clone().multiplyScalar(i)));let d=new v.Vector2().addVectors(c,h.clone().multiplyScalar(i)),y=[[u.x,u.y],[f.x,f.y],[d.x,d.y],[c.x,c.y]];this.options.geometry.coords=[[...t.slice(0,o+1),...y,...t.slice(o+1)]],t=this.options.geometry.coords[0]})}}initGeometry(){let t=st(this.options.geometry.coords[0],this.options.geometry.coords.slice(1));return new v.ExtrudeGeometry(t,{steps:1,bevelEnabled:!1,depth:this.options.height,curveSegments:4})}initSingleMaterial(){let t=A.createMeshBasicMaterial({color:this.options.fillColor,opacity:this.options.fillOpacity});if(this.options.height<=.1)return this.material=t,t;let n=A.createMeshBasicMaterial({color:ft(this.options.fillColor),opacity:this.options.fillOpacity});return this.material=[t,n],[t,n]}getMaxAndMin(t,n){let r=new v.Box3().setFromObject(this),i=t.clone().add(n.clone().multiplyScalar(1e3)),o=new v.Ray(i,n.clone().multiplyScalar(-1)),a=new v.Vector3;o.intersectBox(r,a);let l=t.clone().add(n.clone().multiplyScalar(-1e3)),u=new v.Ray(l,n.clone()),c=new v.Vector3;return u.intersectBox(r,c),{max:c,min:a}}initGradualMaterial(){let{max:t,min:n}=new v.Box3().setFromObject(this),r=t.clone().sub(n),i=Math.max(r.x,r.y,r.z)/2,o=this.getPosition(),a=new v.Vector3(-1,.2,0).normalize(),{max:l,min:u}=this.getMaxAndMin(o,a),c=A.createShaderMaterial({gradualColor:this.options.gradualColor,center:this.getPosition(),maxValue:i,opacity:this.options.fillOpacity,direction:new v.Vector3(-1,.2,0),max:l,min:u});if(this.options.height<=.1)return this.material=c,c;let h=this.getCenter(),f=new v.Vector3(-1,.2,1).normalize(),{max:d,min:y}=this.getMaxAndMin(h,f),p=A.createShaderMaterial({gradualColor:[ft(this.options.gradualColor[0],this.options.colorFactor),ft(this.options.gradualColor[1],this.options.colorFactor)],center:this.getCenter(),maxValue:i,opacity:this.options.fillOpacity,direction:new v.Vector3(-1,.2,1),max:d,min:y});return this.material=[c,p],[c,p]}initMaterial(){return this.options.renderType==="gradual"?this.initGradualMaterial():this.initSingleMaterial()}initLineMaterial(){let t=A.createLineMaterial({color:this.options.strokeColor,opacity:this.options.strokeOpacity});return this.lineMaterial=t,t}initMesh(){this.mesh&&this.remove(this.mesh),this.mesh=new v.Mesh(this.geometry,this.material),this.add(this.mesh)}getBorderPoints(){let t=[],n=this.options.height+this.options.deltaHeight,{coords:r}=this.options.geometry;for(let i=0;i<r.length;i++){let o=r[i];for(let a=0;a<o.length;a++){let l=o[a],u=a+1===o.length?o[0]:o[a+1];t.push(new v.Vector3(l[0],l[1],n)),t.push(new v.Vector3(u[0],u[1],n))}}return t}initLineGeometry(){this.lineGeometry&&this.lineGeometry.dispose();let t=this.getBorderPoints(),n=new v.BufferGeometry().setFromPoints(t);this.lineGeometry=n}createBorder(){this.line&&this.remove(this.line);let t=new v.LineSegments(this.lineGeometry,this.lineMaterial);return t.position.z=this.options.airHeight+.01,this.line=t,this.add(t),t}raycast(t){if(!this.visible||this.options.geometry.type==="point")return!1;this.mesh.updateMatrixWorld(!0);let n=t.intersectObject(this.mesh);if(n[0]){let{point:r,distance:i}=n[0];return{position:r,distance:i}}return!1}dispose(){this.geometry?.dispose(),this.line?.geometry.dispose(),this.clear()}};var tt=g("three");var re=class extends tt.Object3D{directionalLight;plane;basicOpacity=.07;constructor(){super(),this.directionalLight=this.initLight(),this.initPlane()}initLight(){let e=ln(16777215,.5);return e.position.set(0,0,100),this.add(e),e}changeLightCamera(e){let t=e.x,n=e.y;this.directionalLight.shadow.camera.left=-t,this.directionalLight.shadow.camera.right=t,this.directionalLight.shadow.camera.top=n,this.directionalLight.shadow.camera.bottom=-n,this.directionalLight.shadow.camera.near=.5,this.directionalLight.shadow.camera.far=Math.max(t,n)}changeLightColor(e){this.directionalLight.color=new tt.Color(e)}setPosition(e){this.position.copy(e),this.directionalLight.position.set(-e.x/2,-e.y/2,100)}initPlane(e=1e3,t=1e3){let n=new tt.PlaneGeometry(e,t),r=new tt.ShadowMaterial({transparent:!0,opacity:0,side:tt.DoubleSide}),i=new tt.Mesh(n,r);return i.receiveShadow=!0,i.position.z=-10,this.add(i),this.plane=i,i}setTarget(e){this.directionalLight.target=e}transformOpacity(e){return e*this.basicOpacity}setOpacity(e){this.plane.material.opacity=this.transformOpacity(e)}dispose(){W(this,!0)}};var oe=g("three");var w=g("three");var Kn=g("lodash");var pi={autoUpdate:!0,appendToBody:!1,autoChangePlacement:!1},ie=class extends w.EventDispatcher{constructor(t,n={}){super();this.context=t;this.options={...pi,...n},this.registryEvent(),this.div=this.initDiv(),this.options.appendToBody?document.body.appendChild(this.div):this.context.container.appendChild(this.div)}div;element;position=new w.Vector3;clientPos={x:0,y:0};visible=!0;options;placement="top";observer=null;initObserver(){let t=new MutationObserver((0,Kn.debounce)(()=>{this.div&&this.usePlacement()},100));t.observe(this.div,{childList:!0,subtree:!0,attributes:!0}),this.observer=t}getPlacementPosition(){if(this.element instanceof L&&this.element.options.geometry.type==="polygon"){let{max:i,min:o}=new w.Box3().setFromObject(this.element),a=(i.x+o.x)/2,l=(i.y+o.y)/2;return{left:new w.Vector3(o.x,l,i.z),leftTop:new w.Vector3(o.x,i.y,i.z),top:new w.Vector3(a,i.y,i.z),rightTop:new w.Vector3(i.x,i.y,i.z),right:new w.Vector3(i.x,l,i.z),rightBottom:new w.Vector3(i.x,o.y,i.z),bottom:new w.Vector3(a,o.y,i.z),leftBottom:new w.Vector3(o.x,o.y,i.z),center:new w.Vector3(a,l,i.z)}}let{x:t,y:n,z:r}=this.element?.getPosition?.()||this.position;return{left:new w.Vector3(t,n,r),leftTop:new w.Vector3(t,n,r),top:new w.Vector3(t,n,r),rightTop:new w.Vector3(t,n,r),right:new w.Vector3(t,n,r),rightBottom:new w.Vector3(t,n,r),bottom:new w.Vector3(t,n,r),leftBottom:new w.Vector3(t,n,r),center:new w.Vector3(t,n,r)}}getPlacementScreenPosition(){let{width:t,height:n}=this.context.clientSize,r=this.getPlacementPosition();return Object.keys(r).reduce((i,o)=>{let{x:a,y:l}=x(r[o],this.context.camera,t,n);return i[o]={x:a,y:l},i},{})}checkOverflow(t,n){let{width:r,height:i}=this.context.clientSize;return n.x>0&&t.x<r&&n.y<i&&t.y>0}getPlacement(){let{clientWidth:t,clientHeight:n}=this.div,r=this.getPlacementScreenPosition(),i=t/2,o=n/2,a=[{type:"center",getBox(l,u){return{max:{x:i+l,y:u-n},min:{x:l-i,y:u}}}},{type:"left",getBox(l,u){return{max:{x:l,y:u-o},min:{x:l-t,y:u+o}}}},{type:"leftTop",getBox(l,u){return{max:{x:l,y:u-n},min:{x:l-t,y:u}}}},{type:"top",getBox(l,u){return{max:{x:l+i,y:u-n},min:{x:l-i,y:u}}}},{type:"rightTop",getBox(l,u){return{max:{x:l+t,y:u-n},min:{x:l,y:u}}}},{type:"right",getBox(l,u){return{max:{x:l+t,y:u-o},min:{x:l,y:u+o}}}},{type:"rightBottom",getBox(l,u){return{max:{x:l+t,y:u},min:{x:l,y:u+n}}}},{type:"bottom",getBox(l,u){return{max:{x:l+i,y:u},min:{x:l-i,y:u+n}}}},{type:"leftBottom",getBox(l,u){return{max:{x:l,y:u},min:{x:l-t,y:u+o}}}}];for(let l=0;l<a.length;l++){let u=a[l],c=r[u.type],{max:h,min:f}=u.getBox(c.x,c.y);if(this.checkOverflow(h,f))return{type:u.type,position:c}}return{type:"center",position:r.center}}initDiv(){let t=document.createElement("div");return t.style.position="absolute",t}usePlacement(){let t=this.getPlacement();this.div.className=`overlay_${t.type}`,this._updatePosition(t.position.x,t.position.y)}bindElement(t){this.element=t,this.options.autoChangePlacement&&this.initObserver(),this.onUpdate()}unBindElement(){this.element=void 0}setVisible(t,n="block"){t!==this.visible&&(this.div.style.display=t?n:"none",this.visible=t)}setOpacity(t){this.div.style.opacity=`${t}`}getPosition(){return this.element?typeof this.element.getPosition=="function"?this.element.getPosition():new w.Box3().setFromObject(this.element).getCenter(new w.Vector3):this.position}get withinDisplayRange(){let{x:t,y:n}=this.clientPos,{width:r,height:i}=this.context.clientSize;return t>=0&&t<=r&&n>=0&&n<=i}_updatePosition(t,n){this.clientPos={x:t,y:n};let{width:r,height:i,x:o,y:a}=this.context.clientSize;this.options.appendToBody&&(this.div.style.left=`${o}px`,this.div.style.top=`${a+i}px`),this.options.autoUpdate?this.div.style.transform=`translate3d(${t}px, ${-i+n}px, 0)`:this.dispatchEvent({type:"update-position",x:t,y:n,width:r,height:i})}updatePosition(t=!1){let n=this.getPosition(),{width:r,height:i}=this.context.clientSize,{x:o,y:a}=x(n,this.context.camera,r,i);this.clientPos.x===o&&this.clientPos.y===a&&!t||this._updatePosition(o,a)}onUpdate=()=>{this.options.autoChangePlacement?this.usePlacement():this.updatePosition()};registryEvent(){this.context.addEventListener("update",this.onUpdate)}unRegistryEvent(){this.context.removeEventListener("update",this.onUpdate)}dispose(){this.unRegistryEvent(),this.unBindElement(),this.observer?.disconnect(),this.div?.remove(),this.div=null}};var fi={texts:[{text:""}],level:1,icon_position:"bottom",collision_enable:!0,opacity:1,id:"",position:{x:0,y:0,z:0},icon_opacity:1,icon_border:{color:"#586EE0",width:0},background:"",collision_hide_icon:!0,built_in:!1,box_only_icon:!1},Rt=class extends oe.EventDispatcher{constructor(t,n){super();this.context=t;this.options=Ot({...fi,...n},this),this.position.set(n.position?.x||0,n.position?.y||0,n.position?.z||0),this.overlay=new ie(this.context,{autoUpdate:!1}),this.overlay.addEventListener("update-position",({x:r,y:i,height:o})=>{this.overlay.div.style.transform=`translate3d(calc(${r}px - 50%), calc(${-o+i}px - ${this.options.icon&&this.options.icon_position!=="center"?"100%":"50%"}), 0)`}),this.overlay.bindElement(this),this.registryEvent(),this.initDiv(),this.addEventListener("change-icon",({value:r})=>{r?this.img?this.img.setAttribute("src",r):(this.addIcon(),this._changePosition()):(this.img&&this.div.removeChild(this.img),this.img=void 0,this._changePosition(),this.resetSize())}),this.addEventListener("change-texts",({value:r})=>{let i=this.textDiv;if(i){let o=this.initText();this.div.replaceChild(o,i)}else this.addText();this.resetSize()}),this.addEventListener("change-opacity",({value:r})=>{this.overlay.setOpacity(r)}),this.addEventListener("change-icon_size",({value:r})=>{this.img&&(this.img.style.width=`${r?.[0]||32}px`,this.img.style.height=`${r?.[1]||32}px`,this.resetSize())}),this.addEventListener("change-icon_opacity",({value:r})=>{this.img&&(this.img.style.opacity=`${r}`)}),this.addEventListener("change-icon_border",({value:r})=>{this.img&&(this.img.style.border=`${r.width}px solid ${r.color}`)}),this.addEventListener("change-background",({value:r})=>{this.div.style.background=r})}div;textDiv;img;overlay;options;visible=!0;size={width:0,height:0};position=new oe.Vector3;userData={};showTextStatus=!0;disposed=!1;get withinDisplayRange(){return this.overlay.withinDisplayRange}async resetSize(){if(await gn(),!this.disposed)if(this.options.box_only_icon){if(!this.img)return;let{width:t,height:n}=this.img.getBoundingClientRect();this.size={width:t+2,height:n+2}}else{let{width:t,height:n}=this.div.getBoundingClientRect();this.size={width:t+2,height:n+2}}}renderHelperBox(){}get clientPos(){return this.overlay.clientPos}initDiv(){let t=document.createElement("div");return this.div=t,this.addText(),this.options.icon&&this.addIcon(),t.style.fontSize="12px",t.style.textShadow="#fff 1px 0 0, #fff 0 1px 0, #fff -1px 0 0, #fff 0 -1px 0",t.style.display="flex",t.style.flexDirection="column",t.style.justifyContent="center",t.style.alignItems="center",t.style.padding="4px",this.overlay.setOpacity(this.options.opacity),this.overlay.div.style.pointerEvents="none",this.overlay.div.style.userSelect="none",this.overlay.div.appendChild(t),this.resetSize(),t}addIcon(){if(!this.img){let t=this.initIcon();this.options.icon_position==="top"?this.div.firstChild?this.div.insertBefore(t,this.div.firstChild):this.div.appendChild(t):this.div.appendChild(t)}}addText(){let t=this.initText();this.options.icon_position==="top"?this.div.appendChild(t):this.div.firstChild?this.div.insertBefore(t,this.div.firstChild):this.div.appendChild(t)}getPosition(){return this.position}initText(){let t=document.createElement("div");return t.appendChild(this.createTextFragment()),t.style.textAlign="center",this.textDiv=t,t}createTextFragment(){let t=document.createDocumentFragment();return this.options.texts.forEach(n=>{let r=document.createElement("div");if(r.style.whiteSpace="nowrap",n.styles)for(let[i,o]of Object.entries(n.styles))r.style[i]=o;r.textContent=n.text,t.appendChild(r)}),t}initIcon(){let t=document.createElement("img");return t.setAttribute("src",this.options.icon),t.style.width=`${this.options.icon_size?.[0]||32}px`,t.style.height=`${this.options.icon_size?.[1]||32}px`,t.style.opacity=`${this.options.icon_opacity}px`,t.style.borderRadius="50%",this.options.icon_border.width&&(t.style.border=`${this.options.icon_border.width}px solid ${this.options.icon_border.color}`),t.onload=()=>{this.resetSize()},this.img=t,t}_changePosition=()=>{this.overlay.updatePosition(!0)};registryEvent(){}unRegistryEvent(){}setVisible(t){t!==this.visible&&(this.visible=t,this.changeOverlayVisible(t))}changeOverlayVisible(t){if(!(t===this.overlay.visible&&this.options.collision_hide_icon))if(this.options.collision_hide_icon)this.overlay.visible=t,this.overlay.div.style.visibility=t?"visible":"hidden";else{if(this.showTextStatus===t)return;this.textDiv.style.visibility=t?"visible":"hidden",this.showTextStatus=t}}parentSetVisible(t){this.visible&&this.changeOverlayVisible(t)}getBox(t=this.context.config.poi.boxScale){let{width:n,height:r}=this.size,i=n*t,o=r*t,{x:a,y:l}=this.overlay.clientPos;return{left:a-i/2,right:a+i/2,top:this.options.icon?l-o:l-o/2,bottom:this.options.icon?l:l+o/2}}getOriginBox(){return this.getBox(1)}isContain(t,n){if(!this.overlay.visible||!this.visible)return!1;let r=this.getOriginBox();return t>=r.left&&t<=r.right&&n>=r.top&&n<=r.bottom}dispose(){this.unRegistryEvent(),this.div=null,this.textDiv=null,this.img=void 0,this.overlay.dispose(),this.disposed=!0}};var X=g("three");var N=g("three"),Jn=g("@mars3d/heatmap.js"),xt=g("@turf/turf"),se=class extends N.Object3D{constructor(t){super();this.context=t;this.div=document.createElement("div")}heatmap;div;plane;clearHeatmap(){this.div.firstChild&&this.div.removeChild(this.div.firstChild),this.heatmap=void 0}loadData(t){this.clearHeatmap();let{width:n,height:r,leftTop:i,center:o}=this.getBox(t);this.heatmap=(0,Jn.create)({width:n,height:r,container:this.div,...this.context.config.heatMap}),this.heatmap.setData(this.transformData(t,i)),this.initPlane(n,r),this.position.set(o[0],o[1],this.position.z)}initPlane(t,n){this.plane&&this.remove(this.plane);let r=new N.PlaneGeometry(t,n),i=new N.Texture(this.div.firstChild);i.needsUpdate=!0;let o=new N.MeshBasicMaterial({transparent:!0,side:N.DoubleSide,map:i});o.needsUpdate=!0,this.plane=new N.Mesh(r,o),this.add(this.plane)}getTransMatrix({x:t,y:n}){return new N.Matrix3().makeScale(1,-1).multiply(new N.Matrix3().makeTranslation(0-t,0-n))}transformData(t,n){let r=this.getTransMatrix(n);return{data:t.data.map(o=>{let a=new N.Vector2(o.x,o.y).applyMatrix3(r);return{x:a.x,y:a.y,value:o.value}}),max:t.max,min:t.min}}getBox(t){let n=(0,xt.featureCollection)(t.data.map(u=>(0,xt.point)([u.x,u.y]))),r=(0,xt.bbox)(n),i=r[2]-r[0],o=r[3]-r[1],a={x:r[0],y:r[3]},l=(0,xt.center)(n);return{width:i,height:o,leftTop:a,center:l.geometry.coordinates}}dispose(){this.div=null,this.heatmap=void 0}};var ue=g("three");var ae=class extends ue.Object3D{constructor(t,n){super();this.context=t;this.options=n;this.position.copy(n.position||new ue.Vector3(0,0,0)),this.loadModel()}model=null;async loadModel(){let t=await vt.loadModel(this.options.modelUrl);t.scene.rotation.set(Math.PI/2,Math.PI/2,0),this.add(t.scene),this.model=t}dispose(){W(this),this.model=null}};var ce=g("three");var Qn=g("three");var G=class extends Qn.Object3D{constructor(t){super();this.context=t}dispose(){W(this),this.children.forEach(t=>t.dispose?.()),this.clear()}};var le=class extends G{graphicMap=new Map;constructor(e){super(e)}getCenter(){return new ce.Box3().setFromObject(this).getCenter(new ce.Vector3)}createGraphic(e){let t=new L(this.context,e);return this.add(t),this.graphicMap.set(e.id,t),t}removeGraphic(e){this.remove(e),this.graphicMap.delete(e.options.id),e.dispose()}removeGraphicById(e){this.graphicMap.has(e)&&this.removeGraphic(this.graphicMap.get(e))}getGraphicByNodeId(e){return this.graphicMap.get(e)||null}getGraphicByRaycaster(e){let t={distance:1e4,graphic:null,position:null},n=this.children.reduce((r,i)=>{if(i instanceof L){let o=i.raycast(e);if(o){let{distance:a}=o;if(a<r.distance)return{distance:o.distance,position:o.position,graphic:i}}return r}else return r},t);return n===t?{graphics:[],position:null}:{graphics:[n.graphic],position:n.position}}};var tr=g("lodash");var kt=class extends G{pois=[];debounceCollisionDetection;timer=new U;constructor(e){super(e),this.registryEvent(),this.debounceCollisionDetection=(0,tr.debounce)(this.collisionDetection,10)}clear(e=!1){return this.pois.forEach(t=>{t.options.built_in&&!e||t.dispose()}),this.pois=e?[]:this.pois.filter(t=>t.options.built_in),this}createPoi(e){let t=new Rt(this.context,e);return this.pushPoi(t),t.addEventListener("change-level",()=>this.changePoiLevelOrCollisionEnable(t)),t.addEventListener("change-collision_enable",()=>this.changePoiLevelOrCollisionEnable(t)),Promise.resolve().then(()=>{this.debounceCollisionDetection()}),t}changePoiLevelOrCollisionEnable(e){let t=this.pois.findIndex(n=>n===e);t!==-1&&(this.pois.splice(t,1),this.pushPoi(e))}removePoi(e){let t=this.pois.findIndex(n=>n===e);t!==-1&&(this.pois.splice(t,1),e.dispose())}removePoiById(e){let t=this.pois.find(n=>n.options.id===e);t&&this.removePoi(t)}getPoiById(e){return this.pois.find(n=>n.options.id===e)||null}pushPoi(e){if(!e.options.collision_enable){this.pois.unshift(e);return}if(e.options.level===0){this.pois.push(e);return}for(let t=0;t<this.pois.length;t++){let n=this.pois[t];if(n.options.collision_enable&&n.options.level<=e.options.level){this.pois.splice(t,0,e);return}}this.pois.push(e)}getPoiByDeviceXy(e,t){return this.pois.filter(r=>r instanceof Rt&&r.isContain(e,t))}onUpdate=()=>{this.timer.requestAnimationFrame(()=>{this.collisionDetection()})};collisionDetection(){let e=[];this.pois.filter(n=>n.visible&&n.withinDisplayRange).forEach((n,r)=>{let{left:i,right:o,top:a,bottom:l}=n.getBox();if(r===0||!n.options.collision_enable){e.push({left:i,right:o,top:a,bottom:l}),n.parentSetVisible(!0);return}let u=e.some(c=>c.left<o&&c.right>i&&c.top<l&&c.bottom>a);n.parentSetVisible(!u),u||e.push({left:i,right:o,top:a,bottom:l})})}registryEvent(){this.context.addEventListener("update",this.onUpdate)}unRegistryEvent(){this.context.removeEventListener("update",this.onUpdate)}dispose(){this.timer.dispose(),this.pois.forEach(e=>e.dispose()),this.pois.length=0,this.debounceCollisionDetection=()=>{},super.dispose(),this.unRegistryEvent()}};var er=g("lodash");var pe=g("three"),he=class extends G{pois=[];debounceCollisionDetection;timer=new U;constructor(e){super(e),this.registryEvent(),this.debounceCollisionDetection=(0,er.debounce)(this.collisionDetection,10)}clear(){return this.pois.forEach(e=>{e.dispose()}),this.pois=[],this}createPoi(e){let t=new $(this.context,e);return this.pushPoi(t),t.addEventListener("change-level",()=>this.changePoiLevelOrCollisionEnable(t)),t.addEventListener("change-collision_enable",()=>this.changePoiLevelOrCollisionEnable(t)),Promise.resolve().then(()=>{this.debounceCollisionDetection()}),t}changePoiLevelOrCollisionEnable(e){let t=this.pois.findIndex(n=>n===e);t!==-1&&(this.pois.splice(t,1),this.pushPoi(e))}removePoi(e){let t=this.pois.findIndex(n=>n===e);t!==-1&&(this.remove(e),this.pois.splice(t,1),e.dispose())}removePoiById(e){let t=this.pois.find(n=>n.options.id===e);t&&this.removePoi(t)}getPoiById(e){return this.pois.find(n=>n.options.id===e)||null}pushPoi(e){if(this.add(e),!e.options.collision_enable){this.pois.unshift(e);return}if(e.options.level===0){this.pois.push(e);return}for(let t=0;t<this.pois.length;t++){let n=this.pois[t];if(n.options.collision_enable&&n.options.level<=e.options.level){this.pois.splice(t,0,e);return}}this.pois.push(e)}getPoiByDeviceXy(e,t){let n=new pe.Vector2(e,t);return this.pois.filter(i=>i instanceof $&&i.canSelect&&i.box.containsPoint(n))}changeParkingSpaceVisibleByZoom=()=>{let e=this.parent?.parent;if(e&&e instanceof ht){let{clientSize:{width:t,height:n}}=this.context,{max:r,min:i}=e.box,a=Math.min(t/(r.x-i.x),n/(r.y-i.y))*(r.x-i.x)/45;this.pois.filter(l=>l.userData.type==="parkingSpace").map(l=>{let u=this.context.camera.zoom>=a;l.visible=u,u||l.parentSetVisible(u)})}};onUpdate=()=>{this.timer.requestAnimationFrame(()=>{this.collisionDetection()})};collisionDetection(){let e=[],{camera:t}=this.context;t.updateMatrixWorld();let n=o=>o<=1&&o>=-1,r=t.projectionMatrix.clone();r.multiply(t.matrixWorldInverse),this.pois.filter(o=>{if(o.visible){let a=new pe.Vector3().setFromMatrixPosition(o.matrixWorld);return a.applyMatrix4(r),o.screenPosition=a,n(a.x)&&n(a.y)&&n(a.z)}return!1}).forEach((o,a)=>{let l=o.getBox(o.screenPosition);if(a===0||!o.options.collision_enable){e.push(l),o.parentSetVisible(!0);return}let u=e.some(c=>c.intersectsBox(l));o.parentSetVisible(!u),u||e.push(l)})}registryEvent(){this.context.addEventListener("update",this.onUpdate),this.context.addEventListener("control-zoom-change",this.changeParkingSpaceVisibleByZoom)}unRegistryEvent(){this.context.removeEventListener("update",this.onUpdate),this.context.removeEventListener("control-zoom-change",this.changeParkingSpaceVisibleByZoom)}dispose(){this.timer.dispose(),this.pois.forEach(e=>e.dispose()),this.pois.length=0,this.debounceCollisionDetection=()=>{},super.dispose(),this.unRegistryEvent()}};var ht=class extends X.Object3D{constructor(t){super();this.context=t;this.groundLayer=new G(this.context),this.graphicLayer=new le(this.context),this.poiLayer=new kt(this.context),this.poiLayer2=new he(this.context),this.wallLayer=new G(this.context),this.textureLayer=new G(this.context),this.glbModelLayer=new G(this.context),this.laneLayer=new G(this.context),this.mergeGraphicLayer=new G(this.context),this.textTextureLayer=new G(this.context),this.groundUpper.add(this.graphicLayer),this.groundUpper.add(this.poiLayer),this.groundUpper.add(this.poiLayer2),this.groundUpper.add(this.wallLayer),this.groundUpper.add(this.textureLayer),this.groundUpper.add(this.glbModelLayer),this.groundUpper.add(this.laneLayer),this.groundUpper.add(this.mergeGraphicLayer),this.groundUpper.add(this.textTextureLayer),this.add(this.groundUpper),this.add(this.groundLayer),this.add(this.models)}graphicLayer;poiLayer;poiLayer2;wallLayer;textureLayer;glbModelLayer;laneLayer;mergeGraphicLayer;textTextureLayer;grounds=new Set;groundLayer;shadow=new re;heatmap;groundUpper=new X.Object3D;models=new X.Object3D;modelMap=new Map;groundMaxHeight=0;name="";key="";box=new X.Box3;getPosition(){return this.box.getCenter(new X.Vector3)}createGround(t){let n=new L(this.context,t);this.addGrounds([n])}addGrounds(t){t.forEach(n=>{this.grounds.has(n)||(n.mesh.castShadow=!0,this.grounds.add(n),this.groundLayer.add(n))}),this.changeGroundMaxHeight()}changeGroundMaxHeight(){let t=Array.from(this.grounds);this.groundMaxHeight=this.grounds.size>0?Math.max(...t.map(n=>n.options.height+n.options.airHeight+n.options.deltaHeight)):0,this.groundUpper.position.z=this.groundMaxHeight}get hasElement(){return!!(this.grounds.size||this.graphicLayer.children.length)}getCenter(){return new X.Box3().setFromObject(this).getCenter(new X.Vector3)}addModel(t){let n=new ae(this.context,t);return this.models.add(n),this.modelMap.set(t.id,n),n}addShadow(){let t=new X.Box3().setFromObject(this.groundUpper),n=t.getCenter(new X.Vector3),r=t.getSize(new X.Vector3);this.shadow.setPosition(n),this.shadow.changeLightCamera(r)}addGraphic(t){return this.graphicLayer.createGraphic(t)}addPoi(t){return this.poiLayer.createPoi(t)}addHeatmap(t){this.heatmap||(this.heatmap=new se(this.context),this.add(this.heatmap)),this.heatmap.loadData(t);let n=new X.Box3().setFromObject(this.graphicLayer);return this.heatmap.position.setZ(n.max.z),this.heatmap}removeHeatMap(){this.heatmap&&(this.remove(this.heatmap),this.heatmap.dispose(),this.heatmap=void 0)}setShadowOpacity(t){this.shadow.setOpacity(t)}setShadowVisible(t){this.shadow.visible=t}updateBox(){this.box.setFromObject(this)}dispose(){console.log("floor dispose",this.name),this.shadow.dispose(),this.groundLayer.dispose(),this.graphicLayer.dispose(),this.poiLayer.dispose(),this.poiLayer2.dispose(),this.wallLayer.dispose(),this.textureLayer.dispose(),this.glbModelLayer.dispose(),this.laneLayer.dispose(),this.mergeGraphicLayer.dispose(),this.textTextureLayer.dispose(),this.grounds.forEach(t=>t.dispose()),this.heatmap?.dispose(),this.groundUpper.clear(),this.models.children.forEach(t=>t.dispose()),this.models.clear(),this.modelMap.clear(),this.clear()}};var fe=g("three");var et=class extends fe.EventDispatcher{constructor(t){super();this.context=t;this.svg=dn(`${t.container.clientWidth}`,`${t.container.clientHeight}`),t.container.appendChild(this.svg),this._registryEvent()}points=[];svg;enable=!0;_onResize=({width:t,height:n})=>{this.svg&&(this.svg.setAttribute("width",`${t}`),this.svg.setAttribute("height",`${n}`))};_registryEvent(){this.context.addEventListener("resize",this._onResize)}_unRegistryEvent(){this.context.removeEventListener("resize",this._onResize)}setEnable(t){this.enable=t,t?this.svg.style.display="block":this.svg.style.display="none"}getIntersectByPointerEvent(t){let{camera:n,renderer:r}=this.context,{offsetX:i,offsetY:o}=t,{clientWidth:a,clientHeight:l}=r.domElement,u=i/a*2-1,c=1-o/l*2;return new fe.Vector3(u,c,0).unproject(n)}getSvgCoordinate(t){let{camera:n,container:r}=this.context;return x(t,n,r.clientWidth,r.clientHeight)}dispose(){this._unRegistryEvent(),this.context.container.removeChild(this.svg),this.svg=null}};var de=class extends et{constructor(t){super(t);this.context=t;let{config:{svg:{circle:n,line:r}}}=t;this.circles=[Xt(n.radius,n.fill),Xt(n.radius,n.fill)],this.line=te(r.stroke),this.svg.appendChild(this.circles[0]),this.svg.appendChild(this.circles[1]),this.svg.appendChild(this.line),this.registryEvent()}circles;line;setEnable(t){super.setEnable(t),t?this.registryEvent():this.unRegistryEvent()}registryEvent(){this.context.container.addEventListener("pointerenter",this.onPointermove),this.context.container.addEventListener("pointermove",this.onPointermove),this.context.container.addEventListener("pointerleave",this.onPointerleave),this.context.container.addEventListener("pointerdown",this.onPointerdown),this.context.addEventListener("update",this.onUpdate)}unRegistryEvent(){this.context.container.removeEventListener("pointerenter",this.onPointermove),this.context.container.removeEventListener("pointermove",this.onPointermove),this.context.container.removeEventListener("pointerleave",this.onPointerleave),this.context.container.removeEventListener("pointerdown",this.onPointerdown),this.context.removeEventListener("update",this.onUpdate)}onUpdate=()=>{if(this.points[0]){let t=this.getSvgCoordinate(this.points[0]);Tt(this.circles[0],t.x,t.y),rt(this.line,t)}if(this.points[1]){let t=this.getSvgCoordinate(this.points[1]);Tt(this.circles[1],t.x,t.y),rt(this.line,void 0,t)}};onPointermove=t=>{this.points.length===1&&(this.line.style.display="block",rt(this.line,void 0,{x:t.offsetX,y:t.offsetY}))};onPointerleave=()=>{this.points[1]||(this.line.style.display="none")};onPointerdown=t=>{if(this.points[1])return;let n=this.getIntersectByPointerEvent(t);if(n){let{offsetX:r,offsetY:i}=t,o=this.circles[this.points.length];Tt(o,r,i),this.points.length||rt(this.line,{x:r,y:i},{x:r,y:i}),this.addPoint(n)}};addPoint(t){if(this.points.push(t),this.points.length>=2){let n=this.calculatedDistance();this.dispatchEvent({type:"distance",distance:n})}}calculatedDistance(){let[{x:t,y:n},{x:r,y:i}]=this.points;return Math.sqrt((r-t)**2+(i-n)**2)}dispose(){super.dispose(),this.unRegistryEvent(),this.line=null,this.circles=[]}};var ge=class extends et{circles=[];lines=[];isClose=!1;constructor(e){super(e),this.registryEvent()}setEnable(e){super.setEnable(e),e?this.registryEvent():this.unRegistryEvent()}get lastLine(){return this.lines.slice(-1)[0]}addCircle(e){this.circles.push(e),this.svg.appendChild(e)}addLine(e){this.lines.push(e),this.svg.appendChild(e)}registryEvent(){this.context.container.addEventListener("pointerenter",this.onPointermove),this.context.container.addEventListener("pointermove",this.onPointermove),this.context.container.addEventListener("pointerleave",this.onPointerleave),this.context.container.addEventListener("pointerdown",this.onPointerdown),this.context.addEventListener("update",this.onUpdate)}unRegistryEvent(){this.context.container.removeEventListener("pointerenter",this.onPointermove),this.context.container.removeEventListener("pointermove",this.onPointermove),this.context.container.removeEventListener("pointerleave",this.onPointerleave),this.context.container.removeEventListener("pointerdown",this.onPointerdown),this.context.removeEventListener("update",this.onUpdate)}onUpdate=()=>{this.points.length&&this.points.forEach((e,t)=>{let n=this.getSvgCoordinate(e);this.circles[t]&&Tt(this.circles[t],n.x,n.y),t!==0&&rt(this.lines[t-1],void 0,n),this.lines[t]&&rt(this.lines[t],n)})};onPointermove=e=>{!this.lastLine||this.isClose||(this.lastLine.style.display="block",rt(this.lastLine,void 0,{x:e.offsetX,y:e.offsetY}))};onPointerleave=()=>{this.isClose||(this.lastLine.style.display="none")};onPointerdown=e=>{if(this.isClose)return;let t=this.getIntersectByPointerEvent(e);if(t){let{offsetX:n,offsetY:r}=e;this.checkAdsorb(n,r)?(this.isClose=!0,this.addPoint(this.points[0])):this.addPoint(t);let{circle:{fill:i,radius:o},line:{stroke:a}}=this.context.config.svg;if(!this.isClose){let l=Xt(o,i);Tt(l,n,r),this.addCircle(l)}if(this.lines.length&&rt(this.lastLine,void 0,{x:n,y:r}),!this.isClose){let l=te(a);rt(l,{x:n,y:r},{x:n,y:r}),this.addLine(l)}}};checkAdsorb(e,t){if(this.points.length<3)return!1;let n=this.circles[0],r=+n.getAttribute("cx"),i=+n.getAttribute("cy");return Math.sqrt((e-r)**2+(t-i)**2)<=5}addPoint(e){if(this.points.push(e),this.isClose){let t=this.calculatedArea();this.dispatchEvent({type:"area",area:t})}}calculatedArea(){let e=this.points.map(r=>[r.x,r.y]),t=0,n=e.length;for(let r=0;r<n;r++){let i=(r+1)%n;t+=e[r][0]*e[i][1]-e[i][0]*e[r][1]}return Math.abs(t/2)}dispose(){super.dispose(),this.unRegistryEvent(),this.lines=[],this.circles=[]}};var rr=g("three");var nr=class extends et{constructor(t){super(t);this.context=t;let{config:{svg:{line:n}}}=t;this.rect=mt(n.stroke,"transparent"),this.svg.appendChild(this.rect);for(let r=0;r<4;r++)this.cornerRect[r]=mt(n.stroke,"#ffffff"),this.centerRect[r]=mt(n.stroke,"#ffffff"),this.svg.appendChild(this.cornerRect[r]),this.svg.appendChild(this.centerRect[r]);this.registryEvent()}rect;cornerRect=[];centerRect=[];graphic;setEnable(t){super.setEnable(t),t?this.registryEvent():this.unRegistryEvent()}registryEvent(){this.context.addEventListener("update",this.onUpdate)}unRegistryEvent(){this.context.removeEventListener("update",this.onUpdate)}onUpdate=()=>{if(this.graphic){let t=new rr.Box3().setFromObject(this.graphic),{camera:n,container:{clientWidth:r,clientHeight:i}}=this.context,{min:o,max:a}=t,l=x(o,n,r,i),u=x(a,n,r,i);k(this.rect,l.x,u.y,Math.abs(u.x-l.x),Math.abs(u.y-l.y));let{x:c,y:h}=l,{x:f,y:d}=u,y=5,p=[{x:c-y,y:d-y},{x:f-y,y:d-y},{x:c-y,y:h-y},{x:f-y,y:h-y}];for(let S=0;S<p.length;S++)k(this.cornerRect[S],p[S].x,p[S].y,y*2,y*2);let m=4,b=(c+f)/2,E=(h+d)/2,z=[{x:b-m,y:d-m},{x:c-m,y:E-m},{x:f-m,y:E-m},{x:b-m,y:h-m}];for(let S=0;S<z.length;S++)k(this.centerRect[S],z[S].x,z[S].y,m*2,m*2)}else{k(this.rect,0,0,0,0);for(let t=0;t<this.cornerRect.length;t++)k(this.cornerRect[t],0,0,0,0),k(this.centerRect[t],0,0,0,0)}};selectGraphic(t){this.graphic=t}dispose(){super.dispose(),this.unRegistryEvent(),this.rect=null,this.cornerRect=[],this.centerRect=[]}};var P=g("three");var Qe=g("three/examples/jsm/utils/BufferGeometryUtils");var me=class extends P.Object3D{constructor(t,n){super();this.context=t;this.options=n;n.length&&this.init()}geometry;material;lineMaterial;lineGeometry;Mesh;LineMesh;initGeometry(){let t=this.options.map(n=>{let r=st(n.geometry.coords[0],n.geometry.coords.slice(1));return new P.ExtrudeGeometry(r,{steps:1,bevelEnabled:!1,depth:n.height,curveSegments:4})});this.geometry=(0,Qe.mergeGeometries)(t),t.forEach(n=>n.dispose())}initMaterial(){let t=`
|
|
38
|
+
`,h=new V.ShaderMaterial({uniforms:{uColor:{value:new V.Color(n[0]).convertLinearToSRGB()},uGradualColor:{value:new V.Color(n[1]).convertLinearToSRGB()},center:{value:t},maxValue:{value:e},opacity:{value:r},uDirection:{value:i},uMax:{value:o},uMin:{value:a}},vertexShader:u,fragmentShader:c,side:V.DoubleSide});return this.shaderMaterialMap.set(l,h),h}static createLine2MaterialMap({color:n,width:t,dashed:e,resolution:r}){let i=`${n}-${t}-${e}-${r.x}-${r.y}`;if(this.line2MaterialMap.has(i))return this.line2MaterialMap.get(i);let o=new Yn.LineMaterial({color:parseInt(n.slice(1),16),dashed:e,linewidth:t,worldUnits:!0,dashSize:1,gapSize:3,dashScale:1,resolution:r});return this.line2MaterialMap.set(i,o),o}static dispose(){this.lineMaterialMap.forEach((n,t)=>{n.dispose()}),this.lineMaterialMap.clear(),this.meshStandardMaterialMap.forEach((n,t)=>{n.dispose()}),this.meshStandardMaterialMap.clear(),this.meshBasicMaterialMap.forEach((n,t)=>{n.dispose()}),this.meshBasicMaterialMap.clear(),this.shaderMaterialMap.forEach((n,t)=>{n.dispose()}),this.shaderMaterialMap.clear(),this.line2MaterialMap.forEach((n,t)=>{n.dispose()}),this.line2MaterialMap.clear()}};var Pt=g("three");var _t=class{static canvas=document.createElement("canvas");static ctx=this.canvas.getContext("2d");static cacheMap=new Map;static options={width:1024,height:64,font:"54px sans-serif",textBaseline:"hanging",lineWidth:12,fillStyle:"rgba(0,0,0,1)",strokeStyle:"white"};static getCanvas(){if(this.canvas)return this.canvas;{let n=document.createElement("canvas");return this.canvas=n,n}}static getCtx(){if(this.ctx)return this.ctx;let t=this.getCanvas().getContext("2d");return this.ctx=t,t}static getMergedOptions(n){return{...this.options,...n}}static setCtxStyle(n){let t=this.getCanvas(),e=this.getCtx();t.width=n.width,t.height=n.height,e.font=n.font,e.textBaseline=n.textBaseline,e.lineWidth=n.lineWidth,e.fillStyle=n.fillStyle,e.strokeStyle=n.strokeStyle}static getTextureByText(n,t){let e=this.getMergedOptions(t),r=Bt({...e,text:n});if(this.cacheMap.has(r))return this.cacheMap.get(r);let i=this.getCanvas(),o=this.getCtx();o.clearRect(0,0,i.width,i.height),this.setCtxStyle(e);let a=cn(n)?4:8;e.lineWidth&&o.strokeText(n,2,a),o.fillText(n,2,a);let l=Math.ceil(o.measureText(n).width);l=l%2===0?l:l+1,l+=2;let u=o.getImageData(0,0,l,64),c=new Pt.DataTexture(Uint8Array.from(u.data),l,64,Pt.RGBAFormat);return c.flipY=!0,c.minFilter=Pt.LinearFilter,c.magFilter=Pt.LinearFilter,this.cacheMap.set(r,c),c}static dispose(){this.ctx=null,this.canvas=null,this.cacheMap.forEach(n=>n.dispose()),this.cacheMap.clear()}};var At=g("three"),yt=class{static textureLoader=new At.TextureLoader;static urlTextureMap=new Map;static getTextureByUrl(n){if(this.urlTextureMap.has(n))return this.urlTextureMap.get(n);let t=this.textureLoader.loadAsync(n);return t.then(e=>{e.format=At.RGBAFormat,e.magFilter=At.LinearFilter,e.minFilter=At.LinearFilter,e.colorSpace="srgb",this.urlTextureMap.set(n,e)}),this.urlTextureMap.set(n,t),t}static dispose(){this.urlTextureMap.forEach(n=>{n instanceof Promise?n.then(t=>t.dispose()):n.dispose()}),this.urlTextureMap.clear()}};var $n=g("three/examples/jsm/loaders/GLTFLoader"),vt=class{static loader=new $n.GLTFLoader;static modelMap=new Map;static async loadModel(n){if(this.modelMap.has(n)){let e=this.modelMap.get(n);if(e instanceof Promise)e.then(r=>({...r,scene:r.scene.clone()}));else return{...e,scene:e.scene.clone()}}let t=new Promise((e,r)=>{this.loader.load(n,i=>{e(i),this.modelMap.set(n,i)},void 0,r)});return this.modelMap.set(n,t),t.then(e=>({...e,scene:e.scene.clone()}))}static dispose(){this.modelMap.forEach(n=>{n instanceof Promise?n.then(t=>W(t.scene)):W(n.scene)}),this.modelMap.clear()}};var Zn=g("lodash"),Je={id:"",height:.1,airHeight:0,area:0,group:"",fillColor:"#EFF4FB",strokeColor:"#ffffff",fillOpacity:1,strokeOpacity:1,strokeWidth:1,doors:[],locked:!1,visible:!0,geometry:{type:"polygon",cds:[],coords:[],curveCpt:[],curveIndex:[]},layerType:"",zIndex:0,stroke:!0,deltaHeight:0,userData:{},gradualColor:[],renderType:"single",colorFactor:.9},L=class extends v.Object3D{constructor(t,e){super();this.context=t;if(this.options=Ot((0,Zn.cloneDeep)({...Je,...e}),this),this.options.geometry.type==="point"){let[r,i]=this.options.geometry.coords;return this.position.set(r,i,this.options.height+this.options.airHeight),this}this.initDoor(),this.init(),this.visible=this.options.visible,this.addEventListener("change-fillColor",({value:r})=>{this.initMaterial(),this.initMesh()}),this.addEventListener("change-fillOpacity",({value:r})=>{this.initMaterial(),this.initMesh()}),this.addEventListener("change-height",({value:r})=>{this.dispose(),this.init()}),this.addEventListener("change-strokeColor",({value:r})=>{this.options.stroke&&(this.initLineMaterial(),this.createBorder())}),this.addEventListener("change-strokeOpacity",({value:r})=>{this.options.stroke&&(this.initLineMaterial(),this.createBorder())}),this.addEventListener("change-airHeight",({value:r})=>{this.position.z=r}),this.addEventListener("change-visible",({value:r})=>{this.visible=r}),this.addEventListener("change-stroke",({value:r})=>{if(r){if(this.line)return;this.initLineGeometry(),this.initLineMaterial(),this.createBorder()}else this.line&&(this.remove(this.line),this.lineGeometry?.dispose())}),this.addEventListener("change-renderType",()=>{this.initMaterial(),this.initMesh()}),this.addEventListener("change-gradualColor",()=>{this.initMaterial(),this.initMesh()})}geometry;material;mesh;line;lineMaterial;lineGeometry;options;getCenter(){if(this.options.geometry.type==="point")return this.position.clone();let t=new v.Vector3,e=new v.Box3;return e.setFromObject(this),e.getCenter(t),t}getSize(){if(this.options.geometry.type==="point")return new v.Vector3(0,0,0);let t=new v.Box3,e=new v.Vector3;return t.setFromObject(this),t.getSize(e),e}getPosition(){let t=this.getCenter();return t.setZ(t.z+this.options.height/2),t}init(){this.geometry=this.initGeometry(),this.initMaterial(),this.initMesh(),this.mesh.position.z=this.options.airHeight+this.options.deltaHeight,this.options.stroke&&this.options.strokeOpacity!==0&&(this.initLineMaterial(),this.initLineGeometry(),this.createBorder())}initDoor(){if(this.options.doors?.length&&this.options.geometry.type==="polygon"){let t=this.options.geometry.coords[0];this.options.doors.forEach(e=>{let r=e.type==="single"?.5:1,i=.5,o=Dt(t,e.coord),a=new v.Vector2(...e.coord),l=new v.Vector2(...t[o]).sub(new v.Vector2(...e.coord)).normalize(),u=new v.Vector2().addVectors(a,l.clone().multiplyScalar(r)),c=new v.Vector2().addVectors(a,l.clone().multiplyScalar(-r)),h=new v.Vector2(-l.y,l.x),f=new v.Vector2().addVectors(u,h.clone().multiplyScalar(i));fn([f.x,f.y],t)||(h.multiplyScalar(-1),f=new v.Vector2().addVectors(u,h.clone().multiplyScalar(i)));let d=new v.Vector2().addVectors(c,h.clone().multiplyScalar(i)),y=[[u.x,u.y],[f.x,f.y],[d.x,d.y],[c.x,c.y]];this.options.geometry.coords=[[...t.slice(0,o+1),...y,...t.slice(o+1)]],t=this.options.geometry.coords[0]})}}initGeometry(){let t=st(this.options.geometry.coords[0],this.options.geometry.coords.slice(1));return new v.ExtrudeGeometry(t,{steps:1,bevelEnabled:!1,depth:this.options.height,curveSegments:4})}initSingleMaterial(){let t=A.createMeshBasicMaterial({color:this.options.fillColor,opacity:this.options.fillOpacity});if(this.options.height<=.1)return this.material=t,t;let e=A.createMeshBasicMaterial({color:ft(this.options.fillColor),opacity:this.options.fillOpacity});return this.material=[t,e],[t,e]}getMaxAndMin(t,e){let r=new v.Box3().setFromObject(this),i=t.clone().add(e.clone().multiplyScalar(1e3)),o=new v.Ray(i,e.clone().multiplyScalar(-1)),a=new v.Vector3;o.intersectBox(r,a);let l=t.clone().add(e.clone().multiplyScalar(-1e3)),u=new v.Ray(l,e.clone()),c=new v.Vector3;return u.intersectBox(r,c),{max:c,min:a}}initGradualMaterial(){let{max:t,min:e}=new v.Box3().setFromObject(this),r=t.clone().sub(e),i=Math.max(r.x,r.y,r.z)/2,o=this.getPosition(),a=new v.Vector3(-1,.2,0).normalize(),{max:l,min:u}=this.getMaxAndMin(o,a),c=A.createShaderMaterial({gradualColor:this.options.gradualColor,center:this.getPosition(),maxValue:i,opacity:this.options.fillOpacity,direction:new v.Vector3(-1,.2,0),max:l,min:u});if(this.options.height<=.1)return this.material=c,c;let h=this.getCenter(),f=new v.Vector3(-1,.2,1).normalize(),{max:d,min:y}=this.getMaxAndMin(h,f),p=A.createShaderMaterial({gradualColor:[ft(this.options.gradualColor[0],this.options.colorFactor),ft(this.options.gradualColor[1],this.options.colorFactor)],center:this.getCenter(),maxValue:i,opacity:this.options.fillOpacity,direction:new v.Vector3(-1,.2,1),max:d,min:y});return this.material=[c,p],[c,p]}initMaterial(){return this.options.renderType==="gradual"?this.initGradualMaterial():this.initSingleMaterial()}initLineMaterial(){let t=A.createLineMaterial({color:this.options.strokeColor,opacity:this.options.strokeOpacity});return this.lineMaterial=t,t}initMesh(){this.mesh&&this.remove(this.mesh),this.mesh=new v.Mesh(this.geometry,this.material),this.add(this.mesh)}getBorderPoints(){let t=[],e=this.options.height+this.options.deltaHeight,{coords:r}=this.options.geometry;for(let i=0;i<r.length;i++){let o=r[i];for(let a=0;a<o.length;a++){let l=o[a],u=a+1===o.length?o[0]:o[a+1];t.push(new v.Vector3(l[0],l[1],e)),t.push(new v.Vector3(u[0],u[1],e))}}return t}initLineGeometry(){this.lineGeometry&&this.lineGeometry.dispose();let t=this.getBorderPoints(),e=new v.BufferGeometry().setFromPoints(t);this.lineGeometry=e}createBorder(){this.line&&this.remove(this.line);let t=new v.LineSegments(this.lineGeometry,this.lineMaterial);return t.position.z=this.options.airHeight+.01,this.line=t,this.add(t),t}raycast(t){if(!this.visible||this.options.geometry.type==="point")return!1;this.mesh.updateMatrixWorld(!0);let e=t.intersectObject(this.mesh);if(e[0]){let{point:r,distance:i}=e[0];return{position:r,distance:i}}return!1}dispose(){this.geometry?.dispose(),this.line?.geometry.dispose(),this.clear()}};var tt=g("three");var re=class extends tt.Object3D{directionalLight;plane;basicOpacity=.07;constructor(){super(),this.directionalLight=this.initLight(),this.initPlane()}initLight(){let n=ln(16777215,.5);return n.position.set(0,0,100),this.add(n),n}changeLightCamera(n){let t=n.x,e=n.y;this.directionalLight.shadow.camera.left=-t,this.directionalLight.shadow.camera.right=t,this.directionalLight.shadow.camera.top=e,this.directionalLight.shadow.camera.bottom=-e,this.directionalLight.shadow.camera.near=.5,this.directionalLight.shadow.camera.far=Math.max(t,e)}changeLightColor(n){this.directionalLight.color=new tt.Color(n)}setPosition(n){this.position.copy(n),this.directionalLight.position.set(-n.x/2,-n.y/2,100)}initPlane(n=1e3,t=1e3){let e=new tt.PlaneGeometry(n,t),r=new tt.ShadowMaterial({transparent:!0,opacity:0,side:tt.DoubleSide}),i=new tt.Mesh(e,r);return i.receiveShadow=!0,i.position.z=-10,this.add(i),this.plane=i,i}setTarget(n){this.directionalLight.target=n}transformOpacity(n){return n*this.basicOpacity}setOpacity(n){this.plane.material.opacity=this.transformOpacity(n)}dispose(){W(this,!0)}};var oe=g("three");var w=g("three");var Kn=g("lodash");var pi={autoUpdate:!0,appendToBody:!1,autoChangePlacement:!1},ie=class extends w.EventDispatcher{constructor(t,e={}){super();this.context=t;this.options={...pi,...e},this.registryEvent(),this.div=this.initDiv(),this.options.appendToBody?document.body.appendChild(this.div):this.context.container.appendChild(this.div)}div;element;position=new w.Vector3;clientPos={x:0,y:0};visible=!0;options;placement="top";observer=null;initObserver(){let t=new MutationObserver((0,Kn.debounce)(()=>{this.div&&this.usePlacement()},100));t.observe(this.div,{childList:!0,subtree:!0,attributes:!0}),this.observer=t}getPlacementPosition(){if(this.element instanceof L&&this.element.options.geometry.type==="polygon"){let{max:i,min:o}=new w.Box3().setFromObject(this.element),a=(i.x+o.x)/2,l=(i.y+o.y)/2;return{left:new w.Vector3(o.x,l,i.z),leftTop:new w.Vector3(o.x,i.y,i.z),top:new w.Vector3(a,i.y,i.z),rightTop:new w.Vector3(i.x,i.y,i.z),right:new w.Vector3(i.x,l,i.z),rightBottom:new w.Vector3(i.x,o.y,i.z),bottom:new w.Vector3(a,o.y,i.z),leftBottom:new w.Vector3(o.x,o.y,i.z),center:new w.Vector3(a,l,i.z)}}let{x:t,y:e,z:r}=this.element?.getPosition?.()||this.position;return{left:new w.Vector3(t,e,r),leftTop:new w.Vector3(t,e,r),top:new w.Vector3(t,e,r),rightTop:new w.Vector3(t,e,r),right:new w.Vector3(t,e,r),rightBottom:new w.Vector3(t,e,r),bottom:new w.Vector3(t,e,r),leftBottom:new w.Vector3(t,e,r),center:new w.Vector3(t,e,r)}}getPlacementScreenPosition(){let{width:t,height:e}=this.context.clientSize,r=this.getPlacementPosition();return Object.keys(r).reduce((i,o)=>{let{x:a,y:l}=x(r[o],this.context.camera,t,e);return i[o]={x:a,y:l},i},{})}checkOverflow(t,e){let{width:r,height:i}=this.context.clientSize;return e.x>0&&t.x<r&&e.y<i&&t.y>0}getPlacement(){let{clientWidth:t,clientHeight:e}=this.div,r=this.getPlacementScreenPosition(),i=t/2,o=e/2,a=[{type:"center",getBox(l,u){return{max:{x:i+l,y:u-e},min:{x:l-i,y:u}}}},{type:"left",getBox(l,u){return{max:{x:l,y:u-o},min:{x:l-t,y:u+o}}}},{type:"leftTop",getBox(l,u){return{max:{x:l,y:u-e},min:{x:l-t,y:u}}}},{type:"top",getBox(l,u){return{max:{x:l+i,y:u-e},min:{x:l-i,y:u}}}},{type:"rightTop",getBox(l,u){return{max:{x:l+t,y:u-e},min:{x:l,y:u}}}},{type:"right",getBox(l,u){return{max:{x:l+t,y:u-o},min:{x:l,y:u+o}}}},{type:"rightBottom",getBox(l,u){return{max:{x:l+t,y:u},min:{x:l,y:u+e}}}},{type:"bottom",getBox(l,u){return{max:{x:l+i,y:u},min:{x:l-i,y:u+e}}}},{type:"leftBottom",getBox(l,u){return{max:{x:l,y:u},min:{x:l-t,y:u+o}}}}];for(let l=0;l<a.length;l++){let u=a[l],c=r[u.type],{max:h,min:f}=u.getBox(c.x,c.y);if(this.checkOverflow(h,f))return{type:u.type,position:c}}return{type:"center",position:r.center}}initDiv(){let t=document.createElement("div");return t.style.position="absolute",t}usePlacement(){let t=this.getPlacement();this.div.className=`overlay_${t.type}`,this._updatePosition(t.position.x,t.position.y)}bindElement(t){this.element=t,this.options.autoChangePlacement&&this.initObserver(),this.onUpdate()}unBindElement(){this.element=void 0}setVisible(t,e="block"){t!==this.visible&&(this.div.style.display=t?e:"none",this.visible=t)}setOpacity(t){this.div.style.opacity=`${t}`}getPosition(){return this.element?typeof this.element.getPosition=="function"?this.element.getPosition():new w.Box3().setFromObject(this.element).getCenter(new w.Vector3):this.position}get withinDisplayRange(){let{x:t,y:e}=this.clientPos,{width:r,height:i}=this.context.clientSize;return t>=0&&t<=r&&e>=0&&e<=i}_updatePosition(t,e){this.clientPos={x:t,y:e};let{width:r,height:i,x:o,y:a}=this.context.clientSize;this.options.appendToBody&&(this.div.style.left=`${o}px`,this.div.style.top=`${a+i}px`),this.options.autoUpdate?this.div.style.transform=`translate3d(${t}px, ${-i+e}px, 0)`:this.dispatchEvent({type:"update-position",x:t,y:e,width:r,height:i})}updatePosition(t=!1){let e=this.getPosition(),{width:r,height:i}=this.context.clientSize,{x:o,y:a}=x(e,this.context.camera,r,i);this.clientPos.x===o&&this.clientPos.y===a&&!t||this._updatePosition(o,a)}onUpdate=()=>{this.options.autoChangePlacement?this.usePlacement():this.updatePosition()};registryEvent(){this.context.addEventListener("update",this.onUpdate)}unRegistryEvent(){this.context.removeEventListener("update",this.onUpdate)}dispose(){this.unRegistryEvent(),this.unBindElement(),this.observer?.disconnect(),this.div?.remove(),this.div=null}};var fi={texts:[{text:""}],level:1,icon_position:"bottom",collision_enable:!0,opacity:1,id:"",position:{x:0,y:0,z:0},icon_opacity:1,icon_border:{color:"#586EE0",width:0},background:"",collision_hide_icon:!0,built_in:!1,box_only_icon:!1},Rt=class extends oe.EventDispatcher{constructor(t,e){super();this.context=t;this.options=Ot({...fi,...e},this),this.position.set(e.position?.x||0,e.position?.y||0,e.position?.z||0),this.overlay=new ie(this.context,{autoUpdate:!1}),this.overlay.addEventListener("update-position",({x:r,y:i,height:o})=>{this.overlay.div.style.transform=`translate3d(calc(${r}px - 50%), calc(${-o+i}px - ${this.options.icon&&this.options.icon_position!=="center"?"100%":"50%"}), 0)`}),this.overlay.bindElement(this),this.registryEvent(),this.initDiv(),this.addEventListener("change-icon",({value:r})=>{r?this.img?this.img.setAttribute("src",r):(this.addIcon(),this._changePosition()):(this.img&&this.div.removeChild(this.img),this.img=void 0,this._changePosition(),this.resetSize())}),this.addEventListener("change-texts",({value:r})=>{let i=this.textDiv;if(i){let o=this.initText();this.div.replaceChild(o,i)}else this.addText();this.resetSize()}),this.addEventListener("change-opacity",({value:r})=>{this.overlay.setOpacity(r)}),this.addEventListener("change-icon_size",({value:r})=>{this.img&&(this.img.style.width=`${r?.[0]||32}px`,this.img.style.height=`${r?.[1]||32}px`,this.resetSize())}),this.addEventListener("change-icon_opacity",({value:r})=>{this.img&&(this.img.style.opacity=`${r}`)}),this.addEventListener("change-icon_border",({value:r})=>{this.img&&(this.img.style.border=`${r.width}px solid ${r.color}`)}),this.addEventListener("change-background",({value:r})=>{this.div.style.background=r})}div;textDiv;img;overlay;options;visible=!0;size={width:0,height:0};position=new oe.Vector3;userData={};showTextStatus=!0;disposed=!1;get withinDisplayRange(){return this.overlay.withinDisplayRange}async resetSize(){if(await gn(),!this.disposed)if(this.options.box_only_icon){if(!this.img)return;let{width:t,height:e}=this.img.getBoundingClientRect();this.size={width:t+2,height:e+2}}else{let{width:t,height:e}=this.div.getBoundingClientRect();this.size={width:t+2,height:e+2}}}renderHelperBox(){}get clientPos(){return this.overlay.clientPos}initDiv(){let t=document.createElement("div");return this.div=t,this.addText(),this.options.icon&&this.addIcon(),t.style.fontSize="12px",t.style.textShadow="#fff 1px 0 0, #fff 0 1px 0, #fff -1px 0 0, #fff 0 -1px 0",t.style.display="flex",t.style.flexDirection="column",t.style.justifyContent="center",t.style.alignItems="center",t.style.padding="4px",this.overlay.setOpacity(this.options.opacity),this.overlay.div.style.pointerEvents="none",this.overlay.div.style.userSelect="none",this.overlay.div.appendChild(t),this.resetSize(),t}addIcon(){if(!this.img){let t=this.initIcon();this.options.icon_position==="top"?this.div.firstChild?this.div.insertBefore(t,this.div.firstChild):this.div.appendChild(t):this.div.appendChild(t)}}addText(){let t=this.initText();this.options.icon_position==="top"?this.div.appendChild(t):this.div.firstChild?this.div.insertBefore(t,this.div.firstChild):this.div.appendChild(t)}getPosition(){return this.position}initText(){let t=document.createElement("div");return t.appendChild(this.createTextFragment()),t.style.textAlign="center",this.textDiv=t,t}createTextFragment(){let t=document.createDocumentFragment();return this.options.texts.forEach(e=>{let r=document.createElement("div");if(r.style.whiteSpace="nowrap",e.styles)for(let[i,o]of Object.entries(e.styles))r.style[i]=o;r.textContent=e.text,t.appendChild(r)}),t}initIcon(){let t=document.createElement("img");return t.setAttribute("src",this.options.icon),t.style.width=`${this.options.icon_size?.[0]||32}px`,t.style.height=`${this.options.icon_size?.[1]||32}px`,t.style.opacity=`${this.options.icon_opacity}px`,t.style.borderRadius="50%",this.options.icon_border.width&&(t.style.border=`${this.options.icon_border.width}px solid ${this.options.icon_border.color}`),t.onload=()=>{this.resetSize()},this.img=t,t}_changePosition=()=>{this.overlay.updatePosition(!0)};registryEvent(){}unRegistryEvent(){}setVisible(t){t!==this.visible&&(this.visible=t,this.changeOverlayVisible(t))}changeOverlayVisible(t){if(!(t===this.overlay.visible&&this.options.collision_hide_icon))if(this.options.collision_hide_icon)this.overlay.visible=t,this.overlay.div.style.visibility=t?"visible":"hidden";else{if(this.showTextStatus===t)return;this.textDiv.style.visibility=t?"visible":"hidden",this.showTextStatus=t}}parentSetVisible(t){this.visible&&this.changeOverlayVisible(t)}getBox(t=this.context.config.poi.boxScale){let{width:e,height:r}=this.size,i=e*t,o=r*t,{x:a,y:l}=this.overlay.clientPos;return{left:a-i/2,right:a+i/2,top:this.options.icon?l-o:l-o/2,bottom:this.options.icon?l:l+o/2}}getOriginBox(){return this.getBox(1)}isContain(t,e){if(!this.overlay.visible||!this.visible)return!1;let r=this.getOriginBox();return t>=r.left&&t<=r.right&&e>=r.top&&e<=r.bottom}dispose(){this.unRegistryEvent(),this.div=null,this.textDiv=null,this.img=void 0,this.overlay.dispose(),this.disposed=!0}};var X=g("three");var N=g("three"),Jn=g("@mars3d/heatmap.js"),xt=g("@turf/turf"),se=class extends N.Object3D{constructor(t){super();this.context=t;this.div=document.createElement("div")}heatmap;div;plane;clearHeatmap(){this.div.firstChild&&this.div.removeChild(this.div.firstChild),this.heatmap=void 0}loadData(t){this.clearHeatmap();let{width:e,height:r,leftTop:i,center:o}=this.getBox(t);this.heatmap=(0,Jn.create)({width:e,height:r,container:this.div,...this.context.config.heatMap}),this.heatmap.setData(this.transformData(t,i)),this.initPlane(e,r),this.position.set(o[0],o[1],this.position.z)}initPlane(t,e){this.plane&&this.remove(this.plane);let r=new N.PlaneGeometry(t,e),i=new N.Texture(this.div.firstChild);i.needsUpdate=!0;let o=new N.MeshBasicMaterial({transparent:!0,side:N.DoubleSide,map:i});o.needsUpdate=!0,this.plane=new N.Mesh(r,o),this.add(this.plane)}getTransMatrix({x:t,y:e}){return new N.Matrix3().makeScale(1,-1).multiply(new N.Matrix3().makeTranslation(0-t,0-e))}transformData(t,e){let r=this.getTransMatrix(e);return{data:t.data.map(o=>{let a=new N.Vector2(o.x,o.y).applyMatrix3(r);return{x:a.x,y:a.y,value:o.value}}),max:t.max,min:t.min}}getBox(t){let e=(0,xt.featureCollection)(t.data.map(u=>(0,xt.point)([u.x,u.y]))),r=(0,xt.bbox)(e),i=r[2]-r[0],o=r[3]-r[1],a={x:r[0],y:r[3]},l=(0,xt.center)(e);return{width:i,height:o,leftTop:a,center:l.geometry.coordinates}}dispose(){this.div=null,this.heatmap=void 0}};var ue=g("three");var ae=class extends ue.Object3D{constructor(t,e){super();this.context=t;this.options=e;this.position.copy(e.position||new ue.Vector3(0,0,0)),this.loadModel()}model=null;async loadModel(){let t=await vt.loadModel(this.options.modelUrl);t.scene.rotation.set(Math.PI/2,Math.PI/2,0),this.add(t.scene),this.model=t}dispose(){W(this),this.model=null}};var ce=g("three");var Qn=g("three");var G=class extends Qn.Object3D{constructor(t){super();this.context=t}dispose(){W(this),this.children.forEach(t=>t.dispose?.()),this.clear()}};var le=class extends G{graphicMap=new Map;constructor(n){super(n)}getCenter(){return new ce.Box3().setFromObject(this).getCenter(new ce.Vector3)}createGraphic(n){let t=new L(this.context,n);return this.add(t),this.graphicMap.set(n.id,t),t}removeGraphic(n){this.remove(n),this.graphicMap.delete(n.options.id),n.dispose()}removeGraphicById(n){this.graphicMap.has(n)&&this.removeGraphic(this.graphicMap.get(n))}getGraphicByNodeId(n){return this.graphicMap.get(n)||null}getGraphicByRaycaster(n){let t={distance:1e4,graphic:null,position:null},e=this.children.reduce((r,i)=>{if(i instanceof L){let o=i.raycast(n);if(o){let{distance:a}=o;if(a<r.distance)return{distance:o.distance,position:o.position,graphic:i}}return r}else return r},t);return e===t?{graphics:[],position:null}:{graphics:[e.graphic],position:e.position}}};var tr=g("lodash");var kt=class extends G{pois=[];debounceCollisionDetection;timer=new U;constructor(n){super(n),this.registryEvent(),this.debounceCollisionDetection=(0,tr.debounce)(this.collisionDetection,10)}clear(n=!1){return this.pois.forEach(t=>{t.options.built_in&&!n||t.dispose()}),this.pois=n?[]:this.pois.filter(t=>t.options.built_in),this}createPoi(n){let t=new Rt(this.context,n);return this.pushPoi(t),t.addEventListener("change-level",()=>this.changePoiLevelOrCollisionEnable(t)),t.addEventListener("change-collision_enable",()=>this.changePoiLevelOrCollisionEnable(t)),Promise.resolve().then(()=>{this.debounceCollisionDetection()}),t}changePoiLevelOrCollisionEnable(n){let t=this.pois.findIndex(e=>e===n);t!==-1&&(this.pois.splice(t,1),this.pushPoi(n))}removePoi(n){let t=this.pois.findIndex(e=>e===n);t!==-1&&(this.pois.splice(t,1),n.dispose())}removePoiById(n){let t=this.pois.find(e=>e.options.id===n);t&&this.removePoi(t)}getPoiById(n){return this.pois.find(e=>e.options.id===n)||null}pushPoi(n){if(!n.options.collision_enable){this.pois.unshift(n);return}if(n.options.level===0){this.pois.push(n);return}for(let t=0;t<this.pois.length;t++){let e=this.pois[t];if(e.options.collision_enable&&e.options.level<=n.options.level){this.pois.splice(t,0,n);return}}this.pois.push(n)}getPoiByDeviceXy(n,t){return this.pois.filter(r=>r instanceof Rt&&r.isContain(n,t))}onUpdate=()=>{this.timer.requestAnimationFrame(()=>{this.collisionDetection()})};collisionDetection(){let n=[];this.pois.filter(e=>e.visible&&e.withinDisplayRange).forEach((e,r)=>{let{left:i,right:o,top:a,bottom:l}=e.getBox();if(r===0||!e.options.collision_enable){n.push({left:i,right:o,top:a,bottom:l}),e.parentSetVisible(!0);return}let u=n.some(c=>c.left<o&&c.right>i&&c.top<l&&c.bottom>a);e.parentSetVisible(!u),u||n.push({left:i,right:o,top:a,bottom:l})})}registryEvent(){this.context.addEventListener("update",this.onUpdate)}unRegistryEvent(){this.context.removeEventListener("update",this.onUpdate)}dispose(){this.timer.dispose(),this.pois.forEach(n=>n.dispose()),this.pois.length=0,this.debounceCollisionDetection=()=>{},super.dispose(),this.unRegistryEvent()}};var er=g("lodash");var pe=g("three"),he=class extends G{pois=[];debounceCollisionDetection;timer=new U;constructor(n){super(n),this.registryEvent(),this.debounceCollisionDetection=(0,er.debounce)(this.collisionDetection,10)}clear(){return this.pois.forEach(n=>{n.dispose()}),this.pois=[],this}createPoi(n){let t=new $(this.context,n);return this.pushPoi(t),t.addEventListener("change-level",()=>this.changePoiLevelOrCollisionEnable(t)),t.addEventListener("change-collision_enable",()=>this.changePoiLevelOrCollisionEnable(t)),Promise.resolve().then(()=>{this.debounceCollisionDetection()}),t}changePoiLevelOrCollisionEnable(n){let t=this.pois.findIndex(e=>e===n);t!==-1&&(this.pois.splice(t,1),this.pushPoi(n))}removePoi(n){let t=this.pois.findIndex(e=>e===n);t!==-1&&(this.remove(n),this.pois.splice(t,1),n.dispose())}removePoiById(n){let t=this.pois.find(e=>e.options.id===n);t&&this.removePoi(t)}getPoiById(n){return this.pois.find(e=>e.options.id===n)||null}pushPoi(n){if(this.add(n),!n.options.collision_enable){this.pois.unshift(n);return}if(n.options.level===0){this.pois.push(n);return}for(let t=0;t<this.pois.length;t++){let e=this.pois[t];if(e.options.collision_enable&&e.options.level<=n.options.level){this.pois.splice(t,0,n);return}}this.pois.push(n)}getPoiByDeviceXy(n,t){let e=new pe.Vector2(n,t);return this.pois.filter(i=>i instanceof $&&i.canSelect&&i.box.containsPoint(e))}changeParkingSpaceVisibleByZoom=()=>{let n=this.parent?.parent;if(n&&n instanceof ht){let{clientSize:{width:t,height:e}}=this.context,{max:r,min:i}=n.box,a=Math.min(t/(r.x-i.x),e/(r.y-i.y))*(r.x-i.x)/45;this.pois.filter(l=>l.userData.type==="parkingSpace").map(l=>{let u=this.context.camera.zoom>=a;l.visible=u,u||l.parentSetVisible(u)})}};onUpdate=()=>{this.timer.requestAnimationFrame(()=>{this.collisionDetection()})};collisionDetection(){let n=[],{camera:t}=this.context;t.updateMatrixWorld();let e=o=>o<=1&&o>=-1,r=t.projectionMatrix.clone();r.multiply(t.matrixWorldInverse),this.pois.filter(o=>{if(o.visible){let a=new pe.Vector3().setFromMatrixPosition(o.matrixWorld);return a.applyMatrix4(r),o.screenPosition=a,e(a.x)&&e(a.y)&&e(a.z)}return!1}).forEach((o,a)=>{let l=o.getBox(o.screenPosition);if(a===0||!o.options.collision_enable){n.push(l),o.parentSetVisible(!0);return}let u=n.some(c=>c.intersectsBox(l));o.parentSetVisible(!u),u||n.push(l)})}registryEvent(){this.context.addEventListener("update",this.onUpdate),this.context.addEventListener("control-zoom-change",this.changeParkingSpaceVisibleByZoom)}unRegistryEvent(){this.context.removeEventListener("update",this.onUpdate),this.context.removeEventListener("control-zoom-change",this.changeParkingSpaceVisibleByZoom)}dispose(){this.timer.dispose(),this.pois.forEach(n=>n.dispose()),this.pois.length=0,this.debounceCollisionDetection=()=>{},super.dispose(),this.unRegistryEvent()}};var ht=class extends X.Object3D{constructor(t){super();this.context=t;this.groundLayer=new G(this.context),this.graphicLayer=new le(this.context),this.poiLayer=new kt(this.context),this.poiLayer2=new he(this.context),this.wallLayer=new G(this.context),this.textureLayer=new G(this.context),this.glbModelLayer=new G(this.context),this.laneLayer=new G(this.context),this.mergeGraphicLayer=new G(this.context),this.textTextureLayer=new G(this.context),this.groundUpper.add(this.graphicLayer),this.groundUpper.add(this.poiLayer),this.groundUpper.add(this.poiLayer2),this.groundUpper.add(this.wallLayer),this.groundUpper.add(this.textureLayer),this.groundUpper.add(this.glbModelLayer),this.groundUpper.add(this.laneLayer),this.groundUpper.add(this.mergeGraphicLayer),this.groundUpper.add(this.textTextureLayer),this.add(this.groundUpper),this.add(this.groundLayer),this.add(this.models)}graphicLayer;poiLayer;poiLayer2;wallLayer;textureLayer;glbModelLayer;laneLayer;mergeGraphicLayer;textTextureLayer;grounds=new Set;groundLayer;shadow=new re;heatmap;groundUpper=new X.Object3D;models=new X.Object3D;modelMap=new Map;groundMaxHeight=0;name="";key="";box=new X.Box3;getPosition(){return this.box.getCenter(new X.Vector3)}createGround(t){let e=new L(this.context,t);this.addGrounds([e])}addGrounds(t){t.forEach(e=>{this.grounds.has(e)||(e.mesh.castShadow=!0,this.grounds.add(e),this.groundLayer.add(e))}),this.changeGroundMaxHeight()}changeGroundMaxHeight(){let t=Array.from(this.grounds);this.groundMaxHeight=this.grounds.size>0?Math.max(...t.map(e=>e.options.height+e.options.airHeight+e.options.deltaHeight)):0,this.groundUpper.position.z=this.groundMaxHeight}get hasElement(){return!!(this.grounds.size||this.graphicLayer.children.length)}getCenter(){return new X.Box3().setFromObject(this).getCenter(new X.Vector3)}addModel(t){let e=new ae(this.context,t);return this.models.add(e),this.modelMap.set(t.id,e),e}addShadow(){let t=new X.Box3().setFromObject(this.groundUpper),e=t.getCenter(new X.Vector3),r=t.getSize(new X.Vector3);this.shadow.setPosition(e),this.shadow.changeLightCamera(r)}addGraphic(t){return this.graphicLayer.createGraphic(t)}addPoi(t){return this.poiLayer.createPoi(t)}addHeatmap(t){this.heatmap||(this.heatmap=new se(this.context),this.add(this.heatmap)),this.heatmap.loadData(t);let e=new X.Box3().setFromObject(this.graphicLayer);return this.heatmap.position.setZ(e.max.z),this.heatmap}removeHeatMap(){this.heatmap&&(this.remove(this.heatmap),this.heatmap.dispose(),this.heatmap=void 0)}setShadowOpacity(t){this.shadow.setOpacity(t)}setShadowVisible(t){this.shadow.visible=t}updateBox(){this.box.setFromObject(this)}dispose(){console.log("floor dispose",this.name),this.shadow.dispose(),this.groundLayer.dispose(),this.graphicLayer.dispose(),this.poiLayer.dispose(),this.poiLayer2.dispose(),this.wallLayer.dispose(),this.textureLayer.dispose(),this.glbModelLayer.dispose(),this.laneLayer.dispose(),this.mergeGraphicLayer.dispose(),this.textTextureLayer.dispose(),this.grounds.forEach(t=>t.dispose()),this.heatmap?.dispose(),this.groundUpper.clear(),this.models.children.forEach(t=>t.dispose()),this.models.clear(),this.modelMap.clear(),this.clear()}};var fe=g("three");var et=class extends fe.EventDispatcher{constructor(t){super();this.context=t;this.svg=dn(`${t.container.clientWidth}`,`${t.container.clientHeight}`),t.container.appendChild(this.svg),this._registryEvent()}points=[];svg;enable=!0;_onResize=({width:t,height:e})=>{this.svg&&(this.svg.setAttribute("width",`${t}`),this.svg.setAttribute("height",`${e}`))};_registryEvent(){this.context.addEventListener("resize",this._onResize)}_unRegistryEvent(){this.context.removeEventListener("resize",this._onResize)}setEnable(t){this.enable=t,t?this.svg.style.display="block":this.svg.style.display="none"}getIntersectByPointerEvent(t){let{camera:e,renderer:r}=this.context,{offsetX:i,offsetY:o}=t,{clientWidth:a,clientHeight:l}=r.domElement,u=i/a*2-1,c=1-o/l*2;return new fe.Vector3(u,c,0).unproject(e)}getSvgCoordinate(t){let{camera:e,container:r}=this.context;return x(t,e,r.clientWidth,r.clientHeight)}dispose(){this._unRegistryEvent(),this.context.container.removeChild(this.svg),this.svg=null}};var de=class extends et{constructor(t){super(t);this.context=t;let{config:{svg:{circle:e,line:r}}}=t;this.circles=[Xt(e.radius,e.fill),Xt(e.radius,e.fill)],this.line=te(r.stroke),this.svg.appendChild(this.circles[0]),this.svg.appendChild(this.circles[1]),this.svg.appendChild(this.line),this.registryEvent()}circles;line;setEnable(t){super.setEnable(t),t?this.registryEvent():this.unRegistryEvent()}registryEvent(){this.context.container.addEventListener("pointerenter",this.onPointermove),this.context.container.addEventListener("pointermove",this.onPointermove),this.context.container.addEventListener("pointerleave",this.onPointerleave),this.context.container.addEventListener("pointerdown",this.onPointerdown),this.context.addEventListener("update",this.onUpdate)}unRegistryEvent(){this.context.container.removeEventListener("pointerenter",this.onPointermove),this.context.container.removeEventListener("pointermove",this.onPointermove),this.context.container.removeEventListener("pointerleave",this.onPointerleave),this.context.container.removeEventListener("pointerdown",this.onPointerdown),this.context.removeEventListener("update",this.onUpdate)}onUpdate=()=>{if(this.points[0]){let t=this.getSvgCoordinate(this.points[0]);Tt(this.circles[0],t.x,t.y),rt(this.line,t)}if(this.points[1]){let t=this.getSvgCoordinate(this.points[1]);Tt(this.circles[1],t.x,t.y),rt(this.line,void 0,t)}};onPointermove=t=>{this.points.length===1&&(this.line.style.display="block",rt(this.line,void 0,{x:t.offsetX,y:t.offsetY}))};onPointerleave=()=>{this.points[1]||(this.line.style.display="none")};onPointerdown=t=>{if(this.points[1])return;let e=this.getIntersectByPointerEvent(t);if(e){let{offsetX:r,offsetY:i}=t,o=this.circles[this.points.length];Tt(o,r,i),this.points.length||rt(this.line,{x:r,y:i},{x:r,y:i}),this.addPoint(e)}};addPoint(t){if(this.points.push(t),this.points.length>=2){let e=this.calculatedDistance();this.dispatchEvent({type:"distance",distance:e})}}calculatedDistance(){let[{x:t,y:e},{x:r,y:i}]=this.points;return Math.sqrt((r-t)**2+(i-e)**2)}dispose(){super.dispose(),this.unRegistryEvent(),this.line=null,this.circles=[]}};var ge=class extends et{circles=[];lines=[];isClose=!1;constructor(n){super(n),this.registryEvent()}setEnable(n){super.setEnable(n),n?this.registryEvent():this.unRegistryEvent()}get lastLine(){return this.lines.slice(-1)[0]}addCircle(n){this.circles.push(n),this.svg.appendChild(n)}addLine(n){this.lines.push(n),this.svg.appendChild(n)}registryEvent(){this.context.container.addEventListener("pointerenter",this.onPointermove),this.context.container.addEventListener("pointermove",this.onPointermove),this.context.container.addEventListener("pointerleave",this.onPointerleave),this.context.container.addEventListener("pointerdown",this.onPointerdown),this.context.addEventListener("update",this.onUpdate)}unRegistryEvent(){this.context.container.removeEventListener("pointerenter",this.onPointermove),this.context.container.removeEventListener("pointermove",this.onPointermove),this.context.container.removeEventListener("pointerleave",this.onPointerleave),this.context.container.removeEventListener("pointerdown",this.onPointerdown),this.context.removeEventListener("update",this.onUpdate)}onUpdate=()=>{this.points.length&&this.points.forEach((n,t)=>{let e=this.getSvgCoordinate(n);this.circles[t]&&Tt(this.circles[t],e.x,e.y),t!==0&&rt(this.lines[t-1],void 0,e),this.lines[t]&&rt(this.lines[t],e)})};onPointermove=n=>{!this.lastLine||this.isClose||(this.lastLine.style.display="block",rt(this.lastLine,void 0,{x:n.offsetX,y:n.offsetY}))};onPointerleave=()=>{this.isClose||(this.lastLine.style.display="none")};onPointerdown=n=>{if(this.isClose)return;let t=this.getIntersectByPointerEvent(n);if(t){let{offsetX:e,offsetY:r}=n;this.checkAdsorb(e,r)?(this.isClose=!0,this.addPoint(this.points[0])):this.addPoint(t);let{circle:{fill:i,radius:o},line:{stroke:a}}=this.context.config.svg;if(!this.isClose){let l=Xt(o,i);Tt(l,e,r),this.addCircle(l)}if(this.lines.length&&rt(this.lastLine,void 0,{x:e,y:r}),!this.isClose){let l=te(a);rt(l,{x:e,y:r},{x:e,y:r}),this.addLine(l)}}};checkAdsorb(n,t){if(this.points.length<3)return!1;let e=this.circles[0],r=+e.getAttribute("cx"),i=+e.getAttribute("cy");return Math.sqrt((n-r)**2+(t-i)**2)<=5}addPoint(n){if(this.points.push(n),this.isClose){let t=this.calculatedArea();this.dispatchEvent({type:"area",area:t})}}calculatedArea(){let n=this.points.map(r=>[r.x,r.y]),t=0,e=n.length;for(let r=0;r<e;r++){let i=(r+1)%e;t+=n[r][0]*n[i][1]-n[i][0]*n[r][1]}return Math.abs(t/2)}dispose(){super.dispose(),this.unRegistryEvent(),this.lines=[],this.circles=[]}};var rr=g("three");var nr=class extends et{constructor(t){super(t);this.context=t;let{config:{svg:{line:e}}}=t;this.rect=mt(e.stroke,"transparent"),this.svg.appendChild(this.rect);for(let r=0;r<4;r++)this.cornerRect[r]=mt(e.stroke,"#ffffff"),this.centerRect[r]=mt(e.stroke,"#ffffff"),this.svg.appendChild(this.cornerRect[r]),this.svg.appendChild(this.centerRect[r]);this.registryEvent()}rect;cornerRect=[];centerRect=[];graphic;setEnable(t){super.setEnable(t),t?this.registryEvent():this.unRegistryEvent()}registryEvent(){this.context.addEventListener("update",this.onUpdate)}unRegistryEvent(){this.context.removeEventListener("update",this.onUpdate)}onUpdate=()=>{if(this.graphic){let t=new rr.Box3().setFromObject(this.graphic),{camera:e,container:{clientWidth:r,clientHeight:i}}=this.context,{min:o,max:a}=t,l=x(o,e,r,i),u=x(a,e,r,i);k(this.rect,l.x,u.y,Math.abs(u.x-l.x),Math.abs(u.y-l.y));let{x:c,y:h}=l,{x:f,y:d}=u,y=5,p=[{x:c-y,y:d-y},{x:f-y,y:d-y},{x:c-y,y:h-y},{x:f-y,y:h-y}];for(let S=0;S<p.length;S++)k(this.cornerRect[S],p[S].x,p[S].y,y*2,y*2);let m=4,b=(c+f)/2,E=(h+d)/2,z=[{x:b-m,y:d-m},{x:c-m,y:E-m},{x:f-m,y:E-m},{x:b-m,y:h-m}];for(let S=0;S<z.length;S++)k(this.centerRect[S],z[S].x,z[S].y,m*2,m*2)}else{k(this.rect,0,0,0,0);for(let t=0;t<this.cornerRect.length;t++)k(this.cornerRect[t],0,0,0,0),k(this.centerRect[t],0,0,0,0)}};selectGraphic(t){this.graphic=t}dispose(){super.dispose(),this.unRegistryEvent(),this.rect=null,this.cornerRect=[],this.centerRect=[]}};var P=g("three");var Qe=g("three/examples/jsm/utils/BufferGeometryUtils");var me=class extends P.Object3D{constructor(t,e){super();this.context=t;this.options=e;e.length&&this.init()}geometry;material;lineMaterial;lineGeometry;Mesh;LineMesh;initGeometry(){let t=this.options.map(e=>{let r=st(e.geometry.coords[0],e.geometry.coords.slice(1));return new P.ExtrudeGeometry(r,{steps:1,bevelEnabled:!1,depth:e.height,curveSegments:4})});this.geometry=(0,Qe.mergeGeometries)(t),t.forEach(e=>e.dispose())}initMaterial(){let t=`
|
|
39
39
|
varying vec3 vPosition; // \u7528\u4E8E\u4F20\u9012\u9876\u70B9\u7684\u4F4D\u7F6E\u7ED9\u7247\u6BB5\u7740\u8272\u5668
|
|
40
40
|
uniform float maxZ; // \u58F0\u660E\u4E00\u4E2Auniform\u53D8\u91CF
|
|
41
41
|
uniform vec3 uColor;
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
vPosition = position; // \u5411\u7247\u6BB5\u7740\u8272\u5668\u4F20\u9012\u4F4D\u7F6E
|
|
47
47
|
gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);
|
|
48
48
|
}
|
|
49
|
-
`,
|
|
49
|
+
`,e=`
|
|
50
50
|
varying vec3 vPosition; // \u63A5\u6536\u9876\u70B9\u4F4D\u7F6E
|
|
51
51
|
uniform float maxZ;
|
|
52
52
|
uniform float minZ;
|
|
@@ -74,7 +74,7 @@
|
|
|
74
74
|
gl_FragColor = vec4(vColor, uOpacity); // \u5176\u4ED6\u9762\u989C\u8272\uFF09
|
|
75
75
|
}
|
|
76
76
|
}
|
|
77
|
-
`,r=-1/0,i=1/0,o=this.geometry.getAttribute("position");if(o)for(let l=0;l<o.count;l++){let u=o.getZ(l);u>r&&(r=u),u<i&&(i=u)}let a=new P.ShaderMaterial({uniforms:{maxZ:{value:r},uColor:{value:new P.Color(this.options[0].fillColor)},uGradualColor1:{value:new P.Color(ft(this.options[0].fillColor,.99))},uGradualColor2:{value:new P.Color(ft(this.options[0].fillColor,.9))},uOpacity:{value:this.options[0].fillOpacity},minZ:{value:i}},vertexShader:t,fragmentShader:
|
|
77
|
+
`,r=-1/0,i=1/0,o=this.geometry.getAttribute("position");if(o)for(let l=0;l<o.count;l++){let u=o.getZ(l);u>r&&(r=u),u<i&&(i=u)}let a=new P.ShaderMaterial({uniforms:{maxZ:{value:r},uColor:{value:new P.Color(this.options[0].fillColor)},uGradualColor1:{value:new P.Color(ft(this.options[0].fillColor,.99))},uGradualColor2:{value:new P.Color(ft(this.options[0].fillColor,.9))},uOpacity:{value:this.options[0].fillOpacity},minZ:{value:i}},vertexShader:t,fragmentShader:e,transparent:!0});this.material=a}initLineMaterial(){let{strokeColor:t,strokeOpacity:e}=this.options[0],r=A.createLineMaterial({color:t,opacity:e});return this.lineMaterial=r,r}getBorderPoints(t){let{height:e,deltaHeight:r,geometry:i}=t,o=[],a=e+(r||0),{coords:l}=i;for(let u=0;u<l.length;u++){let c=l[u];for(let h=0;h<c.length;h++){let f=c[h],d=h+1===c.length?c[0]:c[h+1];o.push(new P.Vector3(f[0],f[1],a)),o.push(new P.Vector3(d[0],d[1],a))}}return o}initLineGeometry(){let t=this.options.map(e=>{let r=this.getBorderPoints(e);return new P.BufferGeometry().setFromPoints(r)});this.lineGeometry=(0,Qe.mergeGeometries)(t)}createBorder(){let t=new P.LineSegments(this.lineGeometry,this.lineMaterial);return this.LineMesh=t,this.add(t),t}init(){this.initGeometry(),this.initMaterial();let t=new P.Mesh(this.geometry,this.material);this.add(t),this.options[0].strokeOpacity!==0&&(this.initLineMaterial(),this.initLineGeometry(),this.createBorder())}dispose(){this.geometry?.dispose(),this.material?.dispose(),this.lineGeometry?.dispose(),this.clear()}};var nt=g("three"),ir=g("three/examples/jsm/utils/BufferGeometryUtils");var di={uuid:"",iconUrl:"",name:"",airHeight:0,deltaHeight:0,height:0,geometry:{cds:[],type:"polygon",coords:[],curveCpt:[],curveIndex:[]},opacity:1,visible:!0},Yt=class extends nt.Object3D{constructor(t,e){super();this.context=t;this.options=e.map(r=>({...di,...r})),this.init()}options;mesh;async init(){let t=this.options.map(o=>{let{geometry:a}=o,l=st(a.coords[0],a.coords.slice(1)),u=new nt.ShapeGeometry(l,4),c=o.height+o.deltaHeight+o.airHeight,h=u.getAttribute("position");for(let d=0;d<h.count;d++)h.setZ(d,c);let f=[0,1,1,1,1,0,0,0];return u.setAttribute("uv",new nt.Float32BufferAttribute(f,2)),u}),e=(0,ir.mergeGeometries)(t,!0);t.forEach(o=>o.dispose());let r=await Promise.all(this.options.map(async o=>{let{iconUrl:a}=o,l=await yt.getTextureByUrl(a);return new nt.MeshBasicMaterial({map:l,alphaTest:1,side:nt.DoubleSide})})),i=new nt.Mesh(e,r);this.mesh=i,this.position.z+=.004,this.add(i)}dispose(){this.mesh?.geometry.dispose(),(this.mesh?.material).forEach(t=>t.dispose()),this.clear()}};var Et=g("three");var gi={url:"",geometry:{type:"polygon",cds:[],coords:[],curveCpt:[],curveIndex:[]},id:"",width:0,rotate:1,airHeight:1,deltaHeight:0,center_x:0,center_y:0},_e=class extends Et.Object3D{constructor(t,e){super();this.context=t;this.options=Object.assign({},gi,e),this.loadModel()}model=null;options;async loadModel(){let t=await vt.loadModel(this.options.url);t.scene.rotation.set(Math.PI/2,0,0);let r=new Et.Box3().setFromObject(t.scene).getSize(new Et.Vector3),i=Math.max(r.x,r.y),o=this.options.width/i;this.scale.set(o,o,o),this.meshSetMaterial(t.scene),this.add(t.scene),this.position.set(this.options.center_x,this.options.center_y,0),this.position.z+=this.options.airHeight+this.options.deltaHeight,this.model=t,this.rotateZ(this.options.rotate)}meshSetMaterial(t){t instanceof Et.Mesh&&(t.frustumCulled=!1,t.castShadow=!0,t.material.emissiveIntensity*=.95,t.material.emissive=t.material.color,t.material.emissiveMap=t.material.map),t.children.forEach(r=>{this.meshSetMaterial(r)})}dispose(){W(this),this.model=null}};var H=g("three");var tn=g("three/examples/jsm/utils/BufferGeometryUtils"),or=g("three/examples/jsm/lines/Line2"),sr=g("three/examples/jsm/lines/LineGeometry");var ye=class extends H.Object3D{constructor(t,e){super();this.context=t;this.options=e;e.length&&this.init()}geometry;material;lineMaterial;lineGeometry;Mesh;LineMesh;doubleLines=[];initGeometry(){let t=this.options.map(e=>{let r=st(e.geometry.coords[0].slice(0,-1),e.geometry.coords.slice(1)),i=new H.ShapeGeometry(r,4),o=i.getAttribute("position");for(let a=0;a<o.count;a++)o.setZ(a,e.airHeight+(e.deltaHeight||0));return i});this.geometry=(0,tn.mergeGeometries)(t),t.forEach(e=>e.dispose())}initMaterial(){let{fillColor:t,fillOpacity:e}=this.options[0],r=A.createMeshBasicMaterial({color:t,opacity:e});return this.material=r,r}initLineMaterial(){let{strokeColor:t,strokeOpacity:e}=this.options[0],r=A.createLineMaterial({color:t,opacity:e});return this.lineMaterial=r,r}getBorderPoints(t){let{deltaHeight:e,geometry:r}=t,i=[],o=e||0,{coords:a}=r;for(let l=0;l<a.length;l++){let u=a[l];for(let c=0;c<u.length;c++){let h=u[c],f=c+1===u.length?u[0]:u[c+1];i.push(new H.Vector3(h[0],h[1],o)),i.push(new H.Vector3(f[0],f[1],o))}}return i}initDoubleLine(){let t=this.options.filter(r=>r.double&&r.geometry.otherCoords?.[1]?.length);if(!t.length)return;let e=t.reduce((r,i)=>{let o=`${i.secondColor}-${i.dashed}`;return r[o]&&r[o].push(i),r[o]||(r[o]=[i]),r},{});this.doubleLines=Object.values(e).map(r=>{let i=A.createLine2MaterialMap({color:r[0].secondColor,width:.2,dashed:r[0].dashed,resolution:new H.Vector2(this.context.clientSize.width,this.context.clientSize.height)});return r.map(o=>{let a=new sr.LineGeometry,l=o.geometry.otherCoords[1].map(c=>[...c,o.airHeight+(o.deltaHeight||0)]).flat(2);a.setPositions(l);let u=new or.Line2(a,i);return u.computeLineDistances(),u.position.z+=.001,this.add(u),u})}).flat(2)}initLineGeometry(){let t=this.options.map(e=>{let r=this.getBorderPoints(e);return new H.BufferGeometry().setFromPoints(r)});this.lineGeometry=(0,tn.mergeGeometries)(t)}createBorder(){let t=new H.LineSegments(this.lineGeometry,this.lineMaterial);return this.LineMesh=t,this.add(t),t}init(){this.initGeometry(),this.initMaterial();let t=new H.Mesh(this.geometry,this.material);this.add(t),this.options[0].strokeOpacity!==0&&(this.initLineMaterial(),this.initLineGeometry(),this.createBorder()),this.initDoubleLine(),this.position.z+=.002+(this.options[0].deltaHeight||0)}dispose(){this.geometry?.dispose(),this.lineGeometry?.dispose(),this.doubleLines.map(t=>t.geometry.dispose()),this.clear()}};var R=g("three");var ar=g("three/examples/jsm/utils/BufferGeometryUtils");var ve=class extends R.Object3D{constructor(t,e){super();this.context=t;this.options=e.map(r=>({...Je,...r})),this.init()}geometry;material;mesh;line;lineMaterial;lineGeometry;options;init(){this.geometry=this.initGeometry(),this.initMaterial(),this.initMesh(),this.mesh.position.z=this.options[0].deltaHeight,this.options[0].strokeOpacity!==0&&(this.initLineMaterial(),this.initLineGeometry(),this.createBorder())}initGeometry(){let t=this.options.map(r=>{let i=st(r.geometry.coords[0],r.geometry.coords.slice(1));return new R.ExtrudeGeometry(i,{steps:1,bevelEnabled:!1,depth:r.height,curveSegments:4})}),e=(0,ar.mergeGeometries)(t);return t.forEach(r=>r.dispose()),e}initMaterial(){let t=`
|
|
78
78
|
varying vec3 vPosition; // \u7528\u4E8E\u4F20\u9012\u9876\u70B9\u7684\u4F4D\u7F6E\u7ED9\u7247\u6BB5\u7740\u8272\u5668
|
|
79
79
|
uniform float maxZ; // \u58F0\u660E\u4E00\u4E2Auniform\u53D8\u91CF
|
|
80
80
|
uniform vec3 uColor;
|
|
@@ -85,7 +85,7 @@
|
|
|
85
85
|
vPosition = position; // \u5411\u7247\u6BB5\u7740\u8272\u5668\u4F20\u9012\u4F4D\u7F6E
|
|
86
86
|
gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);
|
|
87
87
|
}
|
|
88
|
-
`,
|
|
88
|
+
`,e=`
|
|
89
89
|
varying vec3 vPosition; // \u63A5\u6536\u9876\u70B9\u4F4D\u7F6E
|
|
90
90
|
uniform float maxZ;
|
|
91
91
|
uniform vec3 uColor;
|
|
@@ -100,9 +100,9 @@
|
|
|
100
100
|
gl_FragColor = vec4(uColor2, uOpacity); // \u5176\u4ED6\u9762\u989C\u8272\uFF09
|
|
101
101
|
}
|
|
102
102
|
}
|
|
103
|
-
`,r=-1/0,i=this.geometry.getAttribute("position");if(i)for(let a=0;a<i.count;a++){let l=i.getZ(a);l>r&&(r=l)}let o=new R.ShaderMaterial({uniforms:{maxZ:{value:r},uColor:{value:new R.Color(this.options[0].fillColor).convertLinearToSRGB()},uColor2:{value:new R.Color(ft(this.options[0].fillColor)).convertLinearToSRGB()},uOpacity:{value:this.options[0].fillOpacity}},vertexShader:t,fragmentShader:n,transparent:!0});this.material=o}initLineMaterial(){let t=A.createLineMaterial({color:this.options[0].strokeColor,opacity:this.options[0].strokeOpacity});return this.lineMaterial=t,t}initMesh(){this.mesh&&this.remove(this.mesh),this.mesh=new R.Mesh(this.geometry,this.material),this.add(this.mesh)}getBorderPoints(){let t=[],n=this.options[0].height+this.options[0].deltaHeight;return this.options.map(r=>{let{coords:i}=r.geometry;for(let o=0;o<i.length;o++){let a=i[o];for(let l=0;l<a.length;l++){let u=a[l],c=l+1===a.length?a[0]:a[l+1];t.push(new R.Vector3(u[0],u[1],n)),t.push(new R.Vector3(c[0],c[1],n))}}}),t}initLineGeometry(){this.lineGeometry&&this.lineGeometry.dispose();let t=this.getBorderPoints(),n=new R.BufferGeometry().setFromPoints(t);this.lineGeometry=n}createBorder(){this.line&&this.remove(this.line);let t=new R.LineSegments(this.lineGeometry,this.lineMaterial);return t.position.z=.01,this.line=t,this.add(t),t}dispose(){this.geometry.dispose(),this.material.dispose(),this.line?.geometry.dispose(),this.clear()}};var D=g("three");var ur=g("lodash"),mi={text:"",icon:"",icon_size:[18,18],level:1,collision_enable:!0,opacity:1,id:"",position:{x:0,y:0,z:0},text_font_size:14,icon_rotate:0},$=class extends D.Object3D{constructor(t,n){super();this.context=t;this.options=Ot((0,ur.cloneDeep)({...mi,...n}),this),this.position.set(this.options.position.x,this.options.position.y,this.options.position.z),this.registryEvent(),this.init()}options;textAspect=1;spriteText;spriteIcon;box=new D.Box2;boxHelper;_initIconPromise=null;get durIconAndText(){return this.options.icon&&this.options.text?2:0}get offset(){return this.options.icon&&this.options.text?0:.5}get iconWidth(){return this.options.icon?this.options.icon_size[0]:0}get iconHeight(){return this.options.icon?this.options.icon_size[1]:0}get textWidth(){return this.options.text?this.options.text_font_size*this.textAspect:0}get textHeight(){return this.options.text?this.options.text_font_size:0}get deltaZ(){return .1}get canSelect(){return this.visible&&(this.spriteIcon?this.spriteIcon.visible:!0)&&(this.spriteText?this.spriteText.visible:!0)}registryEvent(){this.context.addEventListener("control-zoom-change",this._initScale),this.addEventListener("change-icon",async({value:t})=>{this._initIconPromise&&await this._initIconPromise,this.spriteIcon&&(this.remove(this.spriteIcon),this.spriteIcon=void 0),await this.initIcon(),this.initSize(),this._initScale({zoom:this.context.camera.zoom})}),this.addEventListener("change-text",({value:t})=>{this.spriteText&&(this.remove(this.spriteText),this.spriteText=void 0),this.initText(),this.initSize(),this._initScale({zoom:this.context.camera.zoom})}),this.addEventListener("change-icon_rotate",({value:t})=>{this.spriteIcon&&(this.spriteIcon.material.rotation=t/180*Math.PI)}),this.addEventListener("change-icon_size",({value:t})=>{this.spriteIcon&&this._initScale({zoom:this.context.camera.zoom})})}unRegistryEvent(){this.context.removeEventListener("control-zoom-change",this._initScale)}async initIcon(){if(this.options.icon)return this._initIconPromise=new Promise(async t=>{let n=await yt.getTextureByUrl(this.options.icon),r=new D.Sprite(new D.SpriteMaterial({map:n,transparent:!0,alphaTest:.2,depthTest:!1,rotation:this.options.icon_rotate/180*Math.PI}));r.visible=!1,r.renderOrder=1e5,n.needsUpdate=!0,this.add(r),this.spriteIcon=r,t(r)}).then(()=>{this._initIconPromise=null})}initText(){if(this.options.text){let t=_t.getTextureByText(this.options.text);this.textAspect=t.image.width/t.image.height;let n=new D.Sprite(new D.SpriteMaterial({map:t,transparent:!0,alphaTest:.2,depthTest:!1}));n.visible=!1,n.renderOrder=100001,t.needsUpdate=!0,this.spriteText=n,this.add(n)}}initSize(){let t=0,n=0,{icon:r,text:i}=this.options;r?i?(t=0,n=t*(this.iconHeight/this.textHeight)-this.iconHeight/this.textHeight-this.durIconAndText/this.textHeight):(t=.5,n=0):i?(n=.5,t=0):(t=0,n=0),this.spriteIcon?.center.set(.5,t),this.spriteText?.center.set(.5,n)}async init(){await this.initIcon(),this.initText(),this.initSize(),this._initScale({zoom:this.context.camera.zoom})}_initScale=({zoom:t})=>{if(this.spriteText){let n=this.textHeight/t;this.spriteText.scale.set(this.textAspect*n,n,.1)}this.spriteIcon&&this.spriteIcon?.scale.set(this.options.icon_size[0]/t,this.options.icon_size[1]/t,.1),this.resetZ()};resetZ(){let t=this.deltaZ;this.spriteIcon&&(this.spriteIcon.position.z=t),this.spriteText&&(this.spriteText.position.z=t)}getBox(t){let{clientSize:{width:n,height:r}}=this.context,i=n*(t.x+1)/2,o=r*(-t.y+1)/2;o+=this.offset*(this.iconHeight+this.durIconAndText+this.textHeight);let a=this.iconWidth/2,l=new D.Box2(new D.Vector2(i-a,o-this.iconHeight),new D.Vector2(i+a,o)),u=this.textWidth/2,c=new D.Box2(new D.Vector2(i-u,o-this.textHeight-this.durIconAndText-this.iconHeight),new D.Vector2(i+u,o-this.iconHeight-this.durIconAndText));return this.box=c.union(l),this.box}renderBoxHelper(){if(!this.boxHelper){let t=document.createElement("div");t.style.position="fixed",t.style.border="1px solid red",t.style.pointerEvents="none",this.boxHelper=t,this.context.container.appendChild(t)}this.boxHelper.style.left=this.box.min.x+"px",this.boxHelper.style.top=this.box.min.y+"px",this.boxHelper.style.width=this.box.max.x-this.box.min.x+"px",this.boxHelper.style.height=this.box.max.y-this.box.min.y+"px"}parentSetVisible(t){this.spriteText&&(this.spriteText.visible=t),this.spriteIcon&&(this.spriteIcon.visible=t),this.boxHelper&&(this.boxHelper.style.display=t?"block":"none")}dispose(){this.unRegistryEvent(),this.spriteText=void 0}};var Z=g("three"),lr=g("three/examples/jsm/utils/BufferGeometryUtils");var _i={airHeight:0,deltaHeight:0,height:0,geometry:{cds:[],type:"polygon",coords:[],curveCpt:[],curveIndex:[]},texts:[],fillColor:"#ffffff",fillOpacity:0,strokeColor:"#ffffff",strokeOpacity:0,secondHeight:0,secondRotate:0,center_x:0,center_y:0},xe=class extends Z.Object3D{constructor(t,n){super();this.context=t;this.options=n.map(r=>({..._i,...r})),this.init()}options;mesh;async init(){let t=this.options.map(a=>_t.getTextureByText(a.texts[0],{fillStyle:qe(a.fillColor,a.fillOpacity),strokeStyle:qe(a.strokeColor,a.strokeOpacity),lineWidth:6,font:"54px sans-serif"})),n=t.map((a,l)=>{let u=this.options[l],{width:c,height:h}=a.image,f=c/h,d=u.secondHeight*f,y=new Z.PlaneGeometry(d,u.secondHeight),p=new Z.Matrix4().makeTranslation(u.center_x,u.center_y,u.airHeight+u.deltaHeight+u.height).multiply(new Z.Matrix4().makeRotationZ(u.secondRotate));return y.applyMatrix4(p),y}),r=(0,lr.mergeGeometries)(n,!0);n.forEach(a=>a.dispose());let i=t.map(a=>{let l=new Z.MeshBasicMaterial({map:a,alphaTest:1,side:Z.DoubleSide});return a.needsUpdate=!0,l}),o=new Z.Mesh(r,i);this.mesh=o,this.position.z+=.004,this.add(o)}dispose(){this.mesh?.geometry.dispose(),(this.mesh?.material).forEach(t=>t.dispose()),this.clear()}};var cr=g("three"),Ee=class extends et{startPoint;endPoint;rect;frustum=new cr.Frustum;constructor(e){super(e);let{config:{selectBox:{fill:t,stroke:n}}}=e;this.rect=mt(n,t),this.svg.appendChild(this.rect),this.registryEvent()}setEnable(e){super.setEnable(e),k(this.rect,0,0,0,0),e?this.registryEvent():(this.startPoint=void 0,this.unRegistryEvent())}onPointerDown=e=>{if(!this.enable)return;let t=this.getIntersectByPointerEvent(e);t&&(this.startPoint=t),this.endPoint=void 0};onPointerMove=e=>{if(!this.enable||!this.startPoint)return;let t=this.getIntersectByPointerEvent(e);t&&(this.endPoint=t)};onPointerUp=e=>{if(!this.enable)return;let t=this.getIntersectByPointerEvent(e);t&&(this.endPoint=t),this.doSelect(),this.startPoint=void 0};onUpdate=()=>{if(this.startPoint){let e=this.getSvgCoordinate(this.startPoint),t={...e};this.endPoint&&(t=this.getSvgCoordinate(this.endPoint));let n={x:Math.min(e.x,t.x),y:Math.min(e.y,t.y)},r=Math.abs(t.x-e.x),i=Math.abs(t.y-e.y);k(this.rect,n.x,n.y,r,i)}else k(this.rect,0,0,0,0)};registryEvent(){this.context.container.addEventListener("pointerdown",this.onPointerDown),this.context.container.addEventListener("pointermove",this.onPointerMove),this.context.container.addEventListener("pointerup",this.onPointerUp),this.context.addEventListener("update",this.onUpdate)}unRegistryEvent(){this.context.container.removeEventListener("pointerdown",this.onPointerDown),this.context.container.removeEventListener("pointermove",this.onPointerMove),this.context.container.removeEventListener("pointerup",this.onPointerUp),this.context.removeEventListener("update",this.onUpdate)}doSelect(){if(this.startPoint&&this.endPoint){if(this.startPoint.distanceTo(this.endPoint)<.1)return;let{context:{camera:t,container:{clientWidth:n,clientHeight:r}}}=this,i=x(this.startPoint,t,n,r),o=x(this.endPoint,t,n,r),a={x:Math.min(i.x,o.x),y:Math.min(i.y,o.y)},l={x:Math.max(i.x,o.x),y:Math.max(i.y,o.y)},u=this.searchMapInFrustum(a,l);this.dispatchEvent({type:"selected",list:u})}}searchMapInFrustum(e,t){let{context:n}=this;return n.currentFloor?.graphicLayer.children.filter(r=>r instanceof L&&this.searchChildInFrustum(r,e,t))||[]}searchChildInFrustum(e,t,n){let{context:{camera:r,container:{clientWidth:i,clientHeight:o}}}=this;if(!e)return!1;if(!e.mesh){let f=e.getPosition();if(f){let d=x(f,r,i,o);return gt(d,t,n)}return!1}e.mesh.geometry.boundingBox||e.mesh.geometry.computeBoundingBox();let a=e.mesh.geometry.boundingBox;if(!a)return!1;let{min:l,max:u}=a,c=x(l,r,i,o),h=x(u,r,i,o);return!(!gt(c,t,n)||!gt(h,t,n))}dispose(){this.unRegistryEvent()}};var be=class extends hr.EventDispatcher{constructor(t){super();this.context=t;this.boxSelection=new Ee(t),this.boxSelection.setEnable(!1),this.registryEvent()}_list=new Set;boxSelection;prevPanStatus;prevRotateStatus;downPoint=null;isMultipleSelect=!1;get list(){return this._list}enableBoxSelection(){this.isMultipleSelect||!this.context.config.enableBoxSelect||(this.isMultipleSelect=!0,this.boxSelection.setEnable(!0),this.prevPanStatus=this.context.control.enablePan,this.prevRotateStatus=this.context.control.enableRotate,this.context.control.enablePan=!1,this.context.control.enableRotate=!1)}disableBoxSelection(){this.isMultipleSelect&&(this.isMultipleSelect=!1,this.boxSelection.setEnable(!1),this.context.control.enablePan=!!this.prevPanStatus,this.context.control.enableRotate=!!this.prevRotateStatus)}onPointerDown=t=>{this.downPoint={x:t.offsetX,y:t.offsetY}};onPointerUp=t=>{if(!this.downPoint)return;let{offsetX:n,offsetY:r}=t,{x:i,y:o}=this.downPoint;if(Math.sqrt((i-n)**2+(o-r)**2)>3)return;let{graphics:a}=this.context.getGraphicsByDeviceXy(n,r),l=new Set(a.map(c=>c.options.id));this.context.getPoisByDeviceXy(n,r).forEach(c=>{if(!l.has(c.options.id)){let h=this.context.currentFloor?.graphicLayer.graphicMap.get(c.options.id)||null;h&&h.options.geometry.type==="point"&&(a.push(h),l.add(c.options.id))}}),(Ut?t.metaKey:t.ctrlKey)||this._list.clear(),a.forEach(c=>this._list.add(c)),this.selectEnd(),this.downPoint=null};onPointerOut=t=>{this.disableBoxSelection()};onKeyDown=t=>{Ft(t.key)&&this.enableBoxSelection()};onKeyUp=t=>{Ft(t.key)&&this.disableBoxSelection()};onBoxSelected=({list:t})=>{this._list.clear(),t.forEach(n=>{this._list.add(n)}),this.selectEnd()};selectEnd(){this.dispatchEvent({type:"select",graphics:[...this._list],isMultipleSelect:this.isMultipleSelect})}registryEvent(){this.context.container.addEventListener("pointerdown",this.onPointerDown),this.context.container.addEventListener("pointerup",this.onPointerUp),this.context.container.addEventListener("pointerout",this.onPointerOut),this.context.container.addEventListener("pointercancel",this.onPointerOut),window.addEventListener("keydown",this.onKeyDown),window.addEventListener("keyup",this.onKeyUp),this.boxSelection.addEventListener("selected",this.onBoxSelected)}unRegistryEvent(){this.context.container.removeEventListener("pointerdown",this.onPointerDown),this.context.container.removeEventListener("pointerup",this.onPointerUp),this.context.container.removeEventListener("pointerout",this.onPointerOut),this.context.container.removeEventListener("pointercancel",this.onPointerOut),window.removeEventListener("keydown",this.onKeyDown),window.removeEventListener("keyup",this.onKeyUp),this.boxSelection.removeEventListener("selected",this.onBoxSelected)}clear(){this._list.clear()}remove(t){this._list.delete(t)}dispose(){this.unRegistryEvent()}};var Me=g("three");var Se=class extends Me.EventDispatcher{constructor(t){super();this.context=t;this.registryEvent()}curGraphics=new Set;timer=new U;graphicTimerMap=new Map;onPointerMove=({graphics:t,pois:n,e:r})=>{let i=n.map(u=>this.context.currentFloor?.graphicLayer.graphicMap.get(u.options.id)).filter(u=>u&&u.options.geometry.type==="point");if(!t.length&&!i.length&&this.curGraphics.size){this.curGraphics.clear(),this.handleHoverGraphicsChange();return}let{time:o}=this.context.config.hover,a=new Set;if(i.length){let u,c=1e4;i.forEach(h=>{let f=n.find(d=>d.options.id===h.options.id);if(f instanceof Rt){let{x:d,y}=f.clientPos,p=Math.sqrt((d-r.offsetX)**2+(y-r.offsetY)**2);p<c&&(c=p,u=h)}else if(f instanceof $){let{x:d,y}=f.box.getCenter(new Me.Vector2),p=Math.sqrt((d-r.offsetX)**2+(y-r.offsetY)**2);p<c&&(c=p,u=h)}}),a.add(u)}a.size||t.forEach(u=>a.add(u)),a.forEach(u=>{if(this.graphicTimerMap.get(u)||this.curGraphics.has(u))return;let c=this.timer.setTimeout(()=>{this.curGraphics.add(u),this.graphicTimerMap.delete(u),this.timer.clearTimeout(c),this.handleHoverGraphicsChange()},o);this.graphicTimerMap.set(u,c)}),this.graphicTimerMap.forEach((u,c)=>{a.has(c)||(this.timer.clearTimeout(u),this.graphicTimerMap.delete(c))});let l=this.curGraphics.size;this.curGraphics.forEach(u=>{a.has(u)||this.curGraphics.delete(u)}),l!==this.curGraphics.size&&this.handleHoverGraphicsChange()};onPointerLevel=()=>{this.curGraphics.clear(),this.handleHoverGraphicsChange()};onBodyPointerMove=t=>{if(this.curGraphics.size){let n=this.context.container.getBoundingClientRect();(t.clientX<n.left||t.clientX>n.right||t.clientY<n.top||t.clientY>n.bottom)&&this.onPointerLevel()}};handleHoverGraphicsChange(t=this.curGraphics){this.dispatchEvent({type:"hover-change",graphics:Array.from(t)})}registryEvent(){this.context.addEventListener("pointer-over",this.onPointerMove),this.context.addEventListener("pointer-move",this.onPointerMove),this.context.addEventListener("pointer-level",this.onPointerLevel),document.body.addEventListener("pointermove",this.onBodyPointerMove)}unRegistryEvent(){this.context.removeEventListener("pointer-over",this.onPointerMove),this.context.removeEventListener("pointer-move",this.onPointerMove),this.context.removeEventListener("pointer-level",this.onPointerLevel),document.body.removeEventListener("pointermove",this.onBodyPointerMove)}dispose(){this.unRegistryEvent(),this.timer.dispose()}};var It=g("three");var we=class{constructor(e){this.context=e;this.registryEvent(),this.changePrevCamera()}prevCamera={position:new It.Vector3,zoom:1,target:new It.Vector3};enable=!0;box=new It.Box3;updateBox(){this.box.setFromObject(this.context.scene)}setEnable(e){this.enable=e,e?this.registryEvent():this.unRegistryEvent()}changePrevCamera(){this.prevCamera={position:this.context.camera.position.clone(),zoom:this.context.camera.zoom,target:this.context.control.target.clone()}}backToPrevCamera(){this.setEnable(!1),this.context.camera.position.copy(this.prevCamera.position),this.context.camera.zoom=this.prevCamera.zoom,this.context.control.target.copy(this.prevCamera.target),this.context.control.update(),this.setEnable(!0)}registryEvent(){this.context.addEventListener("control-change",this.onCameraChange)}unRegistryEvent(){this.context.removeEventListener("control-change",this.onCameraChange)}getCurFloorScreenPosition(){if(!this.context.scene.children.filter(m=>m instanceof ht).length)return null;let t=this.box,{camera:n,clientSize:{width:r,height:i}}=this.context,{min:o,max:a}=t,l=x(o,n,r,i),u=x(a,n,r,i),c=x(new It.Vector3(o.x,a.y,a.z),n,r,i),h=x(new It.Vector3(a.x,o.y,o.z),n,r,i),f=Math.min(l.x,u.x,c.x,h.x),d=Math.max(l.x,u.x,c.x,h.x),y=Math.min(l.y,u.y,c.y,h.y),p=Math.max(l.y,u.y,c.y,h.y);return{left:f,right:d,top:y,bottom:p}}checkDistanceToScreenEdge({left:e,right:t,top:n,bottom:r}){let{width:i,height:o}=this.context.clientSize,[a,l,u,c]=this.context.config.cameraBound.padding,h=t>=c,f=i-e>=l,d=o-n>=u,y=r>=a;return h&&f&&d&&y}onCameraChange=()=>{let e=this.getCurFloorScreenPosition();if(e){let{left:t,right:n,top:r,bottom:i}=e;this.checkDistanceToScreenEdge({left:t,right:n,top:r,bottom:i})?this.changePrevCamera():this.backToPrevCamera()}};dispose(){this.unRegistryEvent()}};var en=g("three"),pr=g("three/examples/jsm/controls/MapControls"),Lt=g("@tweenjs/tween.js");var Te=class extends pr.MapControls{constructor(t,n,r){super(n,r);this.context=t;this.camera=n;this.domElement=r;this.enableDamping=!1,this.zoomSpeed=.5,this.prevCameraZoom=n.zoom,this.registryEvent()}prevCameraZoom=1;tweenGroup=new Lt.Group;offsetY=0;registryEvent(){this.addEventListener("change",()=>{let t=this.camera.zoom;t!==this.prevCameraZoom&&(this.prevCameraZoom=t,this.dispatchEvent({type:"change-zoom",zoom:t}))}),this.context.addEventListener("update",this.tweenUpdate)}tweenUpdate=()=>{this.tweenGroup.update()};setPolarAngle(t,n=!1){let{maxPolarAngle:r,minPolarAngle:i}=this,o=r===i;(n||t<=r&&t>=i)&&(this.maxPolarAngle=t,this.minPolarAngle=t,this.update()),o||(this.maxPolarAngle=r,this.minPolarAngle=i)}async setPolarAngleByDuration(t,n=!1,r=500){return r<=0?this.setPolarAngle(t,n):wt(new Promise(i=>{let o={polar:this.getPolarAngle()},a={polar:t},l=new Lt.Tween(o,this.tweenGroup).to(a,r).onUpdate(()=>{this.setPolarAngle(o.polar,n)}).onComplete(()=>{this.enabled=!0,this.tweenGroup.remove(l),i(!0)}).onStart(()=>{this.enabled=!1}).start()}),r+500)}setAzimuthalAngle(t,n){let{maxAzimuthAngle:r,minAzimuthAngle:i,maxPolarAngle:o,minPolarAngle:a}=this,l=r===i;if(n||t<=r&&t>=i){this.maxAzimuthAngle=t,this.minAzimuthAngle=t;let u=this.getPolarAngle();this.maxPolarAngle=u,this.minPolarAngle=u,this.update(),this.maxPolarAngle=o,this.minPolarAngle=a}l||(this.maxAzimuthAngle=r,this.minAzimuthAngle=i)}setAzimuthalAngleDuration(t,n=!1,r=500){return r<=0?this.setAzimuthalAngle(t,n):wt(new Promise(i=>{let o={azimuthal:this.getAzimuthalAngle()},a={azimuthal:t},l=new Lt.Tween(o,this.tweenGroup).to(a,r).onUpdate(()=>{this.setAzimuthalAngle(o.azimuthal,n)}).onComplete(()=>{this.enabled=!0,this.tweenGroup.remove(l),i(!0)}).onStart(()=>{this.enabled=!1}).start()}),r+500)}getCameraLookAt(){return new en.Vector3().subVectors(this.target,this.camera.position)}async setCameraPositionByTarget(t,n){let r=this.target.clone(),i=this.getCameraLookAt();if(!n){this.camera.position.copy(t.clone().sub(i)),this.target.copy(t.clone()),this.update();return}return wt(new Promise(o=>{let a=new Lt.Tween(r,this.tweenGroup).to(t,n).onUpdate(()=>{this.camera.position.copy(r.clone().sub(i)),this.target.copy(r.clone()),this.update()}).onComplete(()=>{this.tweenGroup.remove(a),this.camera.position.copy(t.clone().sub(i)),this.target.copy(t.clone()),this.update(),this.enabled=!0,o(!0)}).onStart(()=>{this.enabled=!1}).start()}),n+500)}setZoom(t,n,r=!1){let{minZoom:i,maxZoom:o}=this;(r||t>=i&&t<=o)&&(this.camera.position.copy(n.clone().sub(this.getCameraLookAt())),this.target.copy(n),this.camera.zoom=t,this.update())}setZoomByDuration(t,n,r=!1,i=500){let o=this.getCameraLookAt(),a={zoom:this.camera.zoom,target:this.target.clone()};return i?wt(new Promise(l=>{let u=new Lt.Tween(a,this.tweenGroup).to({zoom:t,target:n},i).onUpdate(()=>{this.setZoom(a.zoom,a.target,r)}).onComplete(()=>{this.tweenGroup.remove(u),this.enabled=!0,l(!0)}).onStart(()=>{this.enabled=!1}).start()}),i+500):this.setZoom(t,n,r)}setTargetByOffset(t,n=this.target.clone()){if(!t)return;let r=new en.Vector3;r.setFromMatrixColumn(this.camera.matrix,1),r.normalize(),r.multiplyScalar(t/this.camera.zoom),n.add(r),this.setCameraPositionByTarget(n,0)}dispose(){this.tweenGroup.getAll().forEach(t=>t.stop()),this.tweenGroup.removeAll()}};var Vt=g("three");var Ce=class extends Vt.WebGLRenderer{event=new Vt.EventDispatcher;scene;camera;enable=!0;timer=new U;constructor(e){super({antialias:!0,alpha:!0,...e}),this.autoClear=!0,this.setPixelRatio(window.devicePixelRatio),this.shadowMap.enabled=!0,this.shadowMap.autoUpdate=!0,this.shadowMap.type=Vt.PCFSoftShadowMap}setCameraAndScene(e,t){this.scene=e,this.camera=t}autoRender(){this.scene&&this.camera&&this.enable&&(this.event.dispatchEvent({type:"update"}),this.render(this.scene,this.camera)),this.timer.requestAnimationFrame(()=>{this.autoRender()})}pauseRender(){this.enable=!1}continueRender(){this.enable=!0}addEventListener(e,t){this.event.addEventListener(e,t)}removeEventListener(e,t){this.event.removeEventListener(e,t)}dispose(){this.timer.dispose(),this.enable=!1,super.dispose()}};var fr=g("three"),Pe=class extends fr.Scene{constructor(){super()}};var dr=g("three"),Ae=class extends dr.OrthographicCamera{constructor(e,t){super(-e/2,e/2,t/2,-t/2,-1e3,5e3),this.up.set(0,0,1),this.position.set(0,0,100),this.lookAt(0,0,0)}};var Re=class extends M.EventDispatcher{constructor(t,n){super();this.container=t;this.config=n;this.container.style.position="relative",this.container.style.overflow="hidden",this.init(),this.selection=new be(this),this.hoverHelper=new Se(this),this.resizeClientSize(),this.registryEvent()}scene=new Pe;renderer=new Ce;camera;control;lights=un();currentFloor;selection;hoverHelper;basicRatio;cameraBound;clientSize={width:0,height:0,x:0,y:0};renderRf=0;resizeClientSize(){let{x:t,y:n,width:r,height:i}=this.container.getBoundingClientRect();this.clientSize={width:r||this.container.clientWidth,height:i||this.container.clientHeight,x:t,y:n}}init(){let{clientWidth:t,clientHeight:n}=this.container;this.camera=new Ae(t,n),this.renderer.setSize(t,n),this.renderer.setCameraAndScene(this.scene,this.camera),this.renderer.autoRender(),this.control=new Te(this,this.camera,this.renderer.domElement),this.control.maxPolarAngle=this.config.control.maxPolar,this.container.appendChild(this.renderer.domElement),this.scene.add(this.lights),this.basicRatio=this.getRatio(),this.control.addEventListener("change",()=>{this.dispatchEvent({type:"change-ratio",px:(this.basicRatio||0)*this.camera.zoom}),this.dispatchEvent({type:"control-change"})}),this.control.addEventListener("change-zoom",({zoom:r})=>{this.dispatchEvent({type:"control-zoom-change",zoom:r})}),this.renderer.addEventListener("update",()=>{this.dispatchEvent({type:"update"})}),this.cameraBound=new we(this)}getRatio(t=new M.Vector3(0,0,0),n=new M.Vector3(100,0,0)){let{clientWidth:r,clientHeight:i}=this.container,o=x(t,this.camera,r,i),a=x(n,this.camera,r,i);return Math.ceil(Math.sqrt((a.x-o.x)**2+(a.y-o.y)**2))}changeAmbientLightColor(t){this.lights.children.forEach(n=>{n instanceof M.AmbientLight&&(n.color=new M.Color(t))})}switchFloor(t){this.currentFloor&&(this.scene.remove(this.currentFloor),this.currentFloor.dispose()),this.currentFloor=t,this.scene.add(t);let n=t.getCenter();n&&(this.lights.position.x=n.x,this.lights.position.y=n.y),this.cameraBound.updateBox()}onWindowResize=()=>{let{container:t,camera:n,renderer:r}=this,{clientWidth:i,clientHeight:o}=t;i=Math.max(1,i),o=Math.max(1,o),n.left=-i/2,n.right=i/2,n.top=o/2,n.bottom=-o/2,n.updateProjectionMatrix(),r.setSize(i,o),this.resizeClientSize(),this.dispatchEvent({type:"resize",width:i,height:o})};onClick=t=>{let{graphics:n,position:r}=this.getGraphicsByDeviceXy(t.offsetX,t.offsetY);n.length&&this.dispatchEvent({type:"graphic-click",graphics:n,position:r});let i=this.getPoisByDeviceXy(t.offsetX,t.offsetY);i.length&&this.dispatchEvent({type:"poi-click",pois:i})};getGraphicsByDeviceXy(t,n){let r=new M.Vector2;r.x=t/this.clientSize.width*2-1,r.y=n/this.clientSize.height*-2+1;let i=new M.Raycaster;return i.setFromCamera(r,this.camera),i.ray.origin.sub(i.ray.direction.clone().multiplyScalar(100)),this.currentFloor?.graphicLayer.getGraphicByRaycaster(i)||{graphics:[],position:null}}getPoisByDeviceXy(t,n){let r=this.currentFloor?.poiLayer.getPoiByDeviceXy(t,n),i=this.currentFloor?.poiLayer2.getPoiByDeviceXy(t,n);return(r||[]).concat(i||[])}onPointerover=t=>{let{graphics:n,position:r}=this.getGraphicsByDeviceXy(t.offsetX,t.offsetY),i=this.getPoisByDeviceXy(t.offsetX,t.offsetY);this.dispatchEvent({type:"pointer-over",e:t,graphics:n,pois:i,position:r})};onPointermove=t=>{let{graphics:n,position:r}=this.getGraphicsByDeviceXy(t.offsetX,t.offsetY),i=this.getPoisByDeviceXy(t.offsetX,t.offsetY);this.dispatchEvent({type:"pointer-move",e:t,graphics:n,pois:i,position:r})};onPointerleave=t=>{this.dispatchEvent({type:"pointer-level"})};onSelectionSelect=({graphics:t,isMultipleSelect:n})=>{this.dispatchEvent({type:"select-graphic",graphics:t,isMultipleSelect:n})};onHoverChange=({graphics:t})=>{this.dispatchEvent({type:"hover",graphics:t})};registryEvent(){window.addEventListener("resize",this.onWindowResize),this.container.addEventListener("click",this.onClick),this.container.addEventListener("pointerover",this.onPointerover),this.container.addEventListener("pointermove",this.onPointermove),this.container.addEventListener("pointerleave",this.onPointerleave),this.container.addEventListener("pointercancel",this.onPointerleave),this.container.addEventListener("pointerout",this.onPointerleave),this.selection.addEventListener("select",this.onSelectionSelect),this.hoverHelper.addEventListener("hover-change",this.onHoverChange)}unRegistryEvent(){window.removeEventListener("resize",this.onWindowResize),this.container.removeEventListener("click",this.onClick),this.container.removeEventListener("pointerover",this.onPointerover),this.container.removeEventListener("pointermove",this.onPointermove),this.container.removeEventListener("pointerleave",this.onPointerleave),this.container.removeEventListener("pointercancel",this.onPointerleave),this.container.removeEventListener("pointerout",this.onPointerleave),this.selection.removeEventListener("select",this.onSelectionSelect),this.hoverHelper.removeEventListener("hover-change",this.onHoverChange)}setPolarAngle(t,n=500){return this.control.setPolarAngleByDuration(t,!0,n)}setAzimuthalAngle(t,n=500){return this.control.setAzimuthalAngleDuration(t,!0,n)}getCameraLookAt(){return this.control.getCameraLookAt()}setZoom(t,n,r=500){return this.control.setZoomByDuration(t,n,!0,r)}getFitCameraToObjectZoom(t,n=[20,20,20,20],r=500,i=!0){let[o,a,l,u]=n,{clientSize:{width:c,height:h}}=this,f=this.control.getPolarAngle();i&&this.setPolarAngle(0,0);let d=new M.Box3().setFromObject(t);this.setPolarAngle(f,0);let{max:y,min:p}=d,m=new M.Vector3(p.x,y.y,y.z),b=new M.Vector3(y.x,y.y,y.z),E=new M.Vector3(y.x,p.y,p.z),z=new M.Vector3(p.x,p.y,p.z),S=x(m,this.camera,c,h),T=x(b,this.camera,c,h),O=x(z,this.camera,c,h),dt=x(E,this.camera,c,h),Wt=new M.Box2().setFromPoints([new M.Vector2(S.x,S.y),new M.Vector2(T.x,T.y),new M.Vector2(O.x,O.y),new M.Vector2(dt.x,dt.y)]).getSize(new M.Vector2),We=(c-a-u)/Wt.x,Zr=(h-o-l)/Wt.y,Kr=Math.min(We,Zr),Jr=new M.Vector3((y.x+p.x)/2,(y.y+p.y)/2,(y.z+p.z)/2);return{zoom:Kr*this.camera.zoom,center:Jr}}fitCameraToObject(t,n=[20,20,20,20],r=500,i=!0){let{zoom:o,center:a}=this.getFitCameraToObjectZoom(t,n,r,i);return this.setZoom(o,a,r)}getFitCameraToGroundZoom(t=[20,20,20,20],n=500,r=!0){if(this.currentFloor&&this.currentFloor.hasElement)return this.getFitCameraToObjectZoom(this.currentFloor.groundUpper,t,n,r).zoom}fitCameraToGround(t=[20,20,20,20],n=500,r=!0){return this.currentFloor&&this.currentFloor.hasElement?this.fitCameraToObject(this.currentFloor.groundUpper,t,n,r):Promise.resolve(!1)}async setCameraPosition(t,n){return this.control.setCameraPositionByTarget(t,n)}pauseRender(){this.renderer.pauseRender()}continueRender(){this.renderer.continueRender()}dispose(){this.control.dispose(),this.cameraBound.dispose(),this.selection.dispose(),this.hoverHelper.dispose(),this.unRegistryEvent(),this.renderer.domElement.remove(),this.renderer.dispose(),this.lights.children.forEach(t=>t.dispose()),W(this.scene)}};var gr=g("lodash"),yi={apiDomain:"",apiInfo:{},apiPath:{floorGraphic:"/api/inception-map/floor/get",floorRange:"/api/inception-map/range/get",equipmentList:"/api/inception-map/equipment/get",roadNetwork:"/api/inception-map/road_network/get"},enableBoxSelect:!0,resizeObserver:!1,initTransToMark:!1,heatMap:{radius:50,gradient:{0:"#8F9FCD",.5:"#6284FF",1:"#F95D5D"}},useFloorCache:!0,control:{maxPolar:1.2,defaultPolar:1.1,defaultAzimuthal:0},defaultPadding:[20,20,20,20],svg:{circle:{radius:"2",fill:"#1CADFF"},line:{stroke:"#1CADFF"}},selectBox:{stroke:"#1CADFF",fill:"rgba(28, 173, 255, 0.3)"},hover:{time:100},ground:{color:"#F6F6F6",opacity:1,height:.001,stroke:!1,strokeColor:"#E6E6E6",strokeOpacity:1},markGraphic:{color:"#EEF0F3",opacity:1,height:.001,stroke:!1,strokeColor:"#000",strokeOpacity:1},graphic:{fillOpacity:1},cameraBound:{padding:[150,150,150,150]},poi:{boxScale:1}};function mr(s){return(0,gr.merge)({},yi,s)}var yr=g("lodash");var vi=(t=>(t[t.D2=0]="D2",t[t.D3=1.1]="D3",t))(vi||{}),_r=class extends Ie.EventDispatcher{constructor(t,n={}){super();this.container=t;this.config=mr(n),this.context=new Re(t,this.config),this.registryEvent()}config;context;polarKeys=[];azimuthalKeys=[];svgLine;svgPolygon;basicZoom=1;prevCameraZoom=1;type="2d";currentBuildGround=null;observe=null;buildingCenter=[0,0];timer=new U;plugins=[];changeBuildingCenter(t,{brand:n,project:r}){let i=t?Jt(t.info.geometry.cds[0]):[0,0];this.buildingCenter=i,this.dispatchEvent({type:"center-change",center:i,project:r,brand:n})}use(t){t.bmap=this,this.plugins.push(t)}unUse(t){this.plugins=this.plugins.filter(n=>n!==t)}triggerHooks(t,n){this.dispatchEvent({type:t,data:n})}switchFloorByFloor(t,n=t.graphicLayer.children){this.triggerHooks("switch_floor_before",{curFloor:t,graphics:n}),this.context.switchFloor(t),this.initialFloorCamera(),this.triggerHooks("switch_floor_after",{curFloor:t,graphics:n})}initialFloorCamera(){this.context.cameraBound.setEnable(!1),this.context.control.minZoom=0,this.context.control.maxZoom=1/0,this.context.camera.zoom=1,this.context.setAzimuthalAngle(this.config.control.defaultAzimuthal,0),this.context.setPolarAngle(this.config.control.defaultPolar,0),this.context.fitCameraToGround(void 0,0);let t=this.context.camera.zoom;this.context.control.minZoom=t,this.context.control.maxZoom=t*30,this.type==="3d"&&this.context.fitCameraToGround(this.config.defaultPadding,0,!1),this.basicZoom=this.context.camera.zoom,this.context.control.addEventListener("change",this.onControlChange),this.onControlChange(),this.context.cameraBound.setEnable(!0),this.context.cameraBound.changePrevCamera()}onControlChange=()=>{let{camera:{zoom:t}}=this.context;t!==this.prevCameraZoom&&(this.dispatchEvent({type:"zoom-change",basicZoom:this.basicZoom,cameraZoom:this.context.camera.zoom}),this.prevCameraZoom=t)};addModel(t,n){if(t.options.geometry.type==="polygon"){let r=this.context.currentFloor?.addModel({...n,position:t.getPosition().setZ(.1),id:t.options.id});if(r){let{facilityAngle:i=0,facilityXScale:o=1,facilityYScale:a=1}=t.options.userData;r.rotateZ((180-i)/180*Math.PI),r.scale.set(o,a,1)}}}addHeatmap(t){return this.context.currentFloor?.addHeatmap(t)}getLegacyToGraphicMap(){return this.context.currentFloor?.userData.legacyToGraphicMap||new Map}getFloorAllGraphics(){return this.context.currentFloor?.graphicLayer.children.filter(t=>t instanceof L)||[]}createGraphicPoi(t,n){if(this.context.currentFloor){n.id===void 0&&(n.id=t.options.id);let r=t.getCenter();return this.context.currentFloor.addPoi({...n,position:{...r,z:r.z+t.options.height/2}})}return null}removeHeatMap(){this.context.currentFloor?.removeHeatMap()}translateElementToCenter(t,n=500){let r=t.getPosition();return this.context.setCameraPosition(r,n)}async translateElementToCenterX(t,n=500){return wt(new Promise(r=>{let i=this.context.control.target.clone(),o=t.getPosition();this.timer.requestAnimationFrame(()=>{let{clientSize:{width:a,height:l},camera:u}=this.context,h=x(o,u,a,l).x-a/2,f=new Ie.Vector3;f.setFromMatrixColumn(this.context.camera.matrix,0),f.normalize(),f.multiplyScalar(h/this.context.camera.zoom),i.add(f),this.context.setCameraPosition(i,n).then(r)})}),n+500)}getElementDeviceCoordinate(t){let n=t.position.clone(),{clientWidth:r,clientHeight:i}=this.container;return x(n,this.context.camera,r,i)}changeMapType(t,n=500){return this.type=t,t==="2d"?this.context.setPolarAngle(0,n):this.context.setPolarAngle(1.1,n)}async resetView(t=300){let n=t/3;await this.context.setAzimuthalAngle(this.config.control.defaultAzimuthal,n),await this.context.setPolarAngle(this.config.control.defaultPolar,n),await this.context.fitCameraToGround(this.config.defaultPadding,n,!1)}reduceMap(t=.5,n=500){let r=this.context.camera.zoom;return this.context.setZoom(r-t,this.context.control.target,n)}enlargeMap(t=.5,n=500){let r=this.context.camera.zoom;return this.context.setZoom(r+t,this.context.control.target,n)}onKeydown=t=>{this.polarKeys.includes(t.code)&&(this.context.control.maxPolarAngle=this.config.control.maxPolar,this.context.control.minPolarAngle=0),this.azimuthalKeys.includes(t.code)&&(this.context.control.maxAzimuthAngle=1/0,this.context.control.minAzimuthAngle=1/0)};onKeyUp=t=>{if(this.polarKeys.includes(t.code)){let n=this.context.control.getPolarAngle();this.context.control.maxPolarAngle=n,this.context.control.minPolarAngle=n}if(this.azimuthalKeys.includes(t.code)){let n=this.context.control.getAzimuthalAngle();this.context.control.maxAzimuthAngle=n,this.context.control.minAzimuthAngle=n}};registryEvent(){if(window.addEventListener("keydown",this.onKeydown),window.addEventListener("keyup",this.onKeyUp),this.config.resizeObserver){let t=new ResizeObserver((0,yr.debounce)(this.resize,5));t.observe(this.container),this.observe=t}}unRegistryEvent(){window.removeEventListener("keydown",this.onKeydown),window.removeEventListener("keyup",this.onKeyUp),this.observe?.disconnect(),this.observe=null}configurePolarShortcutKeys(t){this.polarKeys=t}configureAzimuthalShortcutKeys(t){this.azimuthalKeys=t}rotateMap(t=.1){let n=this.context.control.getAzimuthalAngle();this.context.setAzimuthalAngle(n+t,500)}async measureDistance(){return this.cancelDistance(),new Promise((t,n)=>{this.changeMapType("2d",0),this.context.control.enableRotate=!1,this.svgLine=new de(this.context);let r=this.svgLine.dispose.bind(this.svgLine);this.svgLine.dispose=function(){r(),n("cancel")},this.svgLine.addEventListener("distance",({distance:i})=>{t(i)})})}cancelDistance(){this.svgLine&&(this.svgLine.dispose(),this.svgLine=void 0,this.context.control.enableRotate=!0)}measureArea(){return this.cancelArea(),new Promise((t,n)=>{this.changeMapType("2d",0),this.context.control.enableRotate=!1,this.svgPolygon=new ge(this.context);let r=this.svgPolygon.dispose.bind(this.svgPolygon);this.svgPolygon.dispose=function(){r(),n("cancel")},this.svgPolygon.addEventListener("area",({area:i})=>{t(i)})})}cancelArea(){this.svgPolygon&&(this.svgPolygon.dispose(),this.svgPolygon=void 0,this.context.control.enableRotate=!0)}getGraphicByNodeId(t){return this.context.currentFloor?.graphicLayer.getGraphicByNodeId(t)||null}deleteGraphic(t){this.context.currentFloor?.graphicLayer.removeGraphic(t)}createGraphicByOptions(t){if(!t.transformToBuildingGround&&this.currentBuildGround){let n=Jt(this.currentBuildGround.info.geometry.cds[0]);if(t.geometry.type==="polygon")t.geometry.coords=JSON.parse(JSON.stringify(t.geometry.cds)),t.geometry.coords.map(r=>{Array.isArray(r)&&r.forEach(i=>{i[0]-=n[0],i[1]-=n[1]})});else{let[r,i]=t.geometry.cds;t.geometry.coords=[r-n[0],i-n[1]]}}return this.context.currentFloor?.graphicLayer.createGraphic(t)}removePoiById(t){this.context.currentFloor?.poiLayer.removePoiById(t),this.context.currentFloor?.poiLayer2.removePoiById(t)}getPoiById(t){return this.context.currentFloor?.poiLayer.getPoiById(t)||this.context.currentFloor?.poiLayer2.getPoiById(t)}getPois(){return[...(this.context.currentFloor?.poiLayer.pois||[]).filter(t=>!t.options.built_in),...this.context.currentFloor?.poiLayer2.pois||[]]}clearPoi(){this.context.currentFloor&&this.context.currentFloor.poiLayer.clear()}removeSelectGraphic(t){this.context.selection.remove(t)}resize=()=>{this.context.cameraBound.setEnable(!1),this.context.onWindowResize();let t=this.context.control.getAzimuthalAngle(),n=this.context.camera.zoom;this.context.control.minZoom=0,this.context.control.maxZoom=1/0,this.context.camera.zoom=1,this.context.setAzimuthalAngle(0,0);let r=this.context.getFitCameraToGroundZoom(void 0,0)||1;this.context.camera.zoom=n,this.context.control.minZoom=r,this.context.control.maxZoom=r*25,this.basicZoom=n,this.context.control.addEventListener("change",this.onControlChange),this.context.setAzimuthalAngle(t,0),this.context.cameraBound.setEnable(!0)};dispose(){this.timer.dispose(),this.plugins.forEach(t=>t.dispose()),this.context.dispose(),this.unRegistryEvent(),_t.dispose(),yt.dispose(),Ct.dispose(),vt.dispose(),A.dispose()}};var vr=g("three"),pt=class extends vr.EventDispatcher{bmap;constructor(e){super(),this.bmap=e}dispose(){}};var xr=class extends pt{equipmentList=[];equipmentMap=new Map;constructor(e){super(e),this.fetchEquipment(),this.bmap.addEventListener("switch_floor_after",this.onSwitchFloor)}async fetchEquipment(){let{apiDomain:e,apiPath:{equipmentList:t},apiInfo:n}=this.bmap.config,r=`${e}${t}`;await fetch(r,n).then(i=>i.json()).then(i=>i.data).then(i=>{this.equipmentList=i,this.equipmentMap=new Map(i.map(o=>[o.equipment_id,o]))}),this.dispatchEvent({type:"change-equipment-list",data:this.equipmentList}),this.bmap.context.currentFloor&&this.changeGraphicToEquipment(this.bmap.context.currentFloor.graphicLayer.children)}onSwitchFloor=({data:{graphics:e}})=>{this.equipmentList.length&&this.changeGraphicToEquipment(e)};getGraphicEquipment(e){return e.userData.data.info.userData.equipment}changeGraphicToEquipment(e){e.filter(t=>{let n=this.getGraphicEquipment(t);return n&&this.equipmentMap.has(n)}).forEach(t=>{let n=this.equipmentMap.get(this.getGraphicEquipment(t)),r=this.bmap.createGraphicPoi(t,{icon:n?.equipment_icon,built_in:!0,icon_size:[14,14]});r&&(r.userData.data=n,r.userData.type="equipment")})}dispose(){this.bmap.removeEventListener("switch_floor_after",this.onSwitchFloor),Array.from(this.bmap.context.currentFloor?.poiLayer.pois||[]).forEach(e=>{e.userData.type==="equipment"&&this.bmap.context.currentFloor?.poiLayer.removePoi(e)})}};var I=g("three");var _=g("three"),K=class extends _.BufferGeometry{constructor(){super(),this.isMeshLine=!0,this.type="MeshLine",this.positions=[],this.previous=[],this.next=[],this.side=[],this.width=[],this.indices_array=[],this.uvs=[],this.counters=[],this._points=[],this._geom=null,this.widthCallback=null,this.matrixWorld=new _.Matrix4,Object.defineProperties(this,{geometry:{enumerable:!0,get:function(){return this}},geom:{enumerable:!0,get:function(){return this._geom},set:function(e){this.setGeometry(e,this.widthCallback)}},points:{enumerable:!0,get:function(){return this._points},set:function(e){this.setPoints(e,this.widthCallback)}}})}};K.prototype.setMatrixWorld=function(s){this.matrixWorld=s};K.prototype.setGeometry=function(s,e){this._geometry=s,this.setPoints(s.getAttribute("position").array,e)};K.prototype.setPoints=function(s,e){if(!(s instanceof Float32Array)&&!(s instanceof Array)){console.error("ERROR: The BufferArray of points is not instancied correctly.");return}if(this._points=s,this.widthCallback=e,this.positions=[],this.counters=[],s.length&&s[0]instanceof _.Vector3)for(var t=0;t<s.length;t++){var n=s[t],r=t/s.length;this.positions.push(n.x,n.y,n.z),this.positions.push(n.x,n.y,n.z),this.counters.push(r),this.counters.push(r)}else for(var t=0;t<s.length;t+=3){var r=t/s.length;this.positions.push(s[t],s[t+1],s[t+2]),this.positions.push(s[t],s[t+1],s[t+2]),this.counters.push(r),this.counters.push(r)}this.process()};function xi(s,e){var t=new _.Matrix4,n=new _.Ray,r=new _.Sphere,i=new _.Vector3,o=this.geometry;if(o.boundingSphere||o.computeBoundingSphere(),r.copy(o.boundingSphere),r.applyMatrix4(this.matrixWorld),s.ray.intersectSphere(r,i)!==!1){t.copy(this.matrixWorld).invert(),n.copy(s.ray).applyMatrix4(t);var a=new _.Vector3,l=new _.Vector3,u=new _.Vector3,c=this instanceof _.LineSegments?2:1,h=o.index,f=o.attributes;if(h!==null)for(var d=h.array,y=f.position.array,p=f.width.array,m=0,b=d.length-1;m<b;m+=c){var E=d[m],z=d[m+1];a.fromArray(y,E*3),l.fromArray(y,z*3);var S=p[Math.floor(m/3)]!==void 0?p[Math.floor(m/3)]:1,T=s.params.Line.threshold+this.material.lineWidth*S/2,O=T*T,dt=n.distanceSqToSegment(a,l,i,u);if(!(dt>O)){i.applyMatrix4(this.matrixWorld);var St=s.ray.origin.distanceTo(i);St<s.near||St>s.far||(e.push({distance:St,point:u.clone().applyMatrix4(this.matrixWorld),index:m,face:null,faceIndex:null,object:this}),m=b)}}}}K.prototype.raycast=xi;K.prototype.compareV3=function(s,e){var t=s*6,n=e*6;return this.positions[t]===this.positions[n]&&this.positions[t+1]===this.positions[n+1]&&this.positions[t+2]===this.positions[n+2]};K.prototype.copyV3=function(s){var e=s*6;return[this.positions[e],this.positions[e+1],this.positions[e+2]]};K.prototype.getDistance=function(s){let e=0;for(let t=0;t<s;t++){let n=6*t,r=new _.Vector3(this.positions[n],this.positions[n+1],this.positions[n+2]),i=new _.Vector3(this.positions[n+6],this.positions[n+7],this.positions[n+8]),o=r.distanceTo(i);e+=o}return e};K.prototype.process=function(){var s=this.positions.length/6;this.previous=[],this.next=[],this.side=[],this.width=[],this.indices_array=[],this.uvs=[];var e;let t=this.getDistance(s-1);var n;this.compareV3(0,s-1)?n=this.copyV3(s-2):n=this.copyV3(0),this.previous.push(n[0],n[1],n[2]),this.previous.push(n[0],n[1],n[2]);for(var r=0;r<s;r++){if(this.side.push(1),this.side.push(-1),this.widthCallback?e=this.widthCallback(r/(s-1)):e=1,this.width.push(e),this.width.push(e),r===0)this.uvs.push(0,0),this.uvs.push(0,1);else if(r===s-1)this.uvs.push(1,0),this.uvs.push(1,1);else{let o=this.getDistance(r)/t;this.uvs.push(o,0),this.uvs.push(o,1)}if(r<s-1){n=this.copyV3(r),this.previous.push(n[0],n[1],n[2]),this.previous.push(n[0],n[1],n[2]);var i=r*2;this.indices_array.push(i,i+1,i+2),this.indices_array.push(i+2,i+1,i+3)}r>0&&(n=this.copyV3(r),this.next.push(n[0],n[1],n[2]),this.next.push(n[0],n[1],n[2]))}this.compareV3(s-1,0)?n=this.copyV3(1):n=this.copyV3(s-1),this.next.push(n[0],n[1],n[2]),this.next.push(n[0],n[1],n[2]),!this._attributes||this._attributes.position.count!==this.positions.length?this._attributes={position:new _.BufferAttribute(new Float32Array(this.positions),3),previous:new _.BufferAttribute(new Float32Array(this.previous),3),next:new _.BufferAttribute(new Float32Array(this.next),3),side:new _.BufferAttribute(new Float32Array(this.side),1),width:new _.BufferAttribute(new Float32Array(this.width),1),uv:new _.BufferAttribute(new Float32Array(this.uvs),2),index:new _.BufferAttribute(new Uint16Array(this.indices_array),1),counters:new _.BufferAttribute(new Float32Array(this.counters),1)}:(this._attributes.position.copyArray(new Float32Array(this.positions)),this._attributes.position.needsUpdate=!0,this._attributes.previous.copyArray(new Float32Array(this.previous)),this._attributes.previous.needsUpdate=!0,this._attributes.next.copyArray(new Float32Array(this.next)),this._attributes.next.needsUpdate=!0,this._attributes.side.copyArray(new Float32Array(this.side)),this._attributes.side.needsUpdate=!0,this._attributes.width.copyArray(new Float32Array(this.width)),this._attributes.width.needsUpdate=!0,this._attributes.uv.copyArray(new Float32Array(this.uvs)),this._attributes.uv.needsUpdate=!0,this._attributes.index.copyArray(new Uint16Array(this.indices_array)),this._attributes.index.needsUpdate=!0),this.setAttribute("position",this._attributes.position),this.setAttribute("previous",this._attributes.previous),this.setAttribute("next",this._attributes.next),this.setAttribute("side",this._attributes.side),this.setAttribute("width",this._attributes.width),this.setAttribute("uv",this._attributes.uv),this.setAttribute("counters",this._attributes.counters),this.setIndex(this._attributes.index),this.computeBoundingSphere(),this.computeBoundingBox()};function nn(s,e,t,n,r){var i;if(s=s.subarray||s.slice?s:s.buffer,t=t.subarray||t.slice?t:t.buffer,s=e?s.subarray?s.subarray(e,r&&e+r):s.slice(e,r&&e+r):s,t.set)t.set(s,n);else for(i=0;i<s.length;i++)t[i+n]=s[i];return t}K.prototype.advance=function(s){var e=this._attributes.position.array,t=this._attributes.previous.array,n=this._attributes.next.array,r=e.length;nn(e,0,t,0,r),nn(e,6,e,0,r-6),e[r-6]=s.x,e[r-5]=s.y,e[r-4]=s.z,e[r-3]=s.x,e[r-2]=s.y,e[r-1]=s.z,nn(e,6,n,0,r-6),n[r-6]=s.x,n[r-5]=s.y,n[r-4]=s.z,n[r-3]=s.x,n[r-2]=s.y,n[r-1]=s.z,this._attributes.position.needsUpdate=!0,this._attributes.previous.needsUpdate=!0,this._attributes.next.needsUpdate=!0};_.ShaderChunk.meshline_vert=["",_.ShaderChunk.logdepthbuf_pars_vertex,_.ShaderChunk.fog_pars_vertex,"","attribute vec3 previous;","attribute vec3 next;","attribute float side;","attribute float width;","attribute float counters;","","uniform vec2 resolution;","uniform float lineWidth;","uniform vec3 color;","uniform float opacity;","uniform float sizeAttenuation;","","varying vec2 vUV;","varying vec4 vColor;","varying float vCounters;","","vec2 fix( vec4 i, float aspect ) {",""," vec2 res = i.xy / i.w;"," res.x *= aspect;"," vCounters = counters;"," return res;","","}","","void main() {",""," float aspect = resolution.x / resolution.y;",""," vColor = vec4( color, opacity );"," vUV = uv;",""," mat4 m = projectionMatrix * modelViewMatrix;"," vec4 finalPosition = m * vec4( position, 1.0 );"," vec4 prevPos = m * vec4( previous, 1.0 );"," vec4 nextPos = m * vec4( next, 1.0 );",""," vec2 currentP = fix( finalPosition, aspect );"," vec2 prevP = fix( prevPos, aspect );"," vec2 nextP = fix( nextPos, aspect );",""," float w = lineWidth * width;",""," vec2 dir;"," if( nextP == currentP ) dir = normalize( currentP - prevP );"," else if( prevP == currentP ) dir = normalize( nextP - currentP );"," else {"," vec2 dir1 = normalize( currentP - prevP );"," vec2 dir2 = normalize( nextP - currentP );"," dir = normalize( dir1 + dir2 );",""," vec2 perp = vec2( -dir1.y, dir1.x );"," vec2 miter = vec2( -dir.y, dir.x );"," //w = clamp( w / dot( miter, perp ), 0., 4. * lineWidth * width );",""," }",""," //vec2 normal = ( cross( vec3( dir, 0. ), vec3( 0., 0., 1. ) ) ).xy;"," vec4 normal = vec4( -dir.y, dir.x, 0., 1. );"," normal.xy *= .5 * w;"," normal *= projectionMatrix;"," if( sizeAttenuation == 0. ) {"," normal.xy *= finalPosition.w;"," normal.xy /= ( vec4( resolution, 0., 1. ) * projectionMatrix ).xy;"," }",""," finalPosition.xy += normal.xy * side;",""," gl_Position = finalPosition;","",_.ShaderChunk.logdepthbuf_vertex,_.ShaderChunk.fog_vertex&&" vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );",_.ShaderChunk.fog_vertex,"}"].join(`
|
|
103
|
+
`,r=-1/0,i=this.geometry.getAttribute("position");if(i)for(let a=0;a<i.count;a++){let l=i.getZ(a);l>r&&(r=l)}let o=new R.ShaderMaterial({uniforms:{maxZ:{value:r},uColor:{value:new R.Color(this.options[0].fillColor).convertLinearToSRGB()},uColor2:{value:new R.Color(ft(this.options[0].fillColor)).convertLinearToSRGB()},uOpacity:{value:this.options[0].fillOpacity}},vertexShader:t,fragmentShader:e,transparent:!0});this.material=o}initLineMaterial(){let t=A.createLineMaterial({color:this.options[0].strokeColor,opacity:this.options[0].strokeOpacity});return this.lineMaterial=t,t}initMesh(){this.mesh&&this.remove(this.mesh),this.mesh=new R.Mesh(this.geometry,this.material),this.add(this.mesh)}getBorderPoints(){let t=[],e=this.options[0].height+this.options[0].deltaHeight;return this.options.map(r=>{let{coords:i}=r.geometry;for(let o=0;o<i.length;o++){let a=i[o];for(let l=0;l<a.length;l++){let u=a[l],c=l+1===a.length?a[0]:a[l+1];t.push(new R.Vector3(u[0],u[1],e)),t.push(new R.Vector3(c[0],c[1],e))}}}),t}initLineGeometry(){this.lineGeometry&&this.lineGeometry.dispose();let t=this.getBorderPoints(),e=new R.BufferGeometry().setFromPoints(t);this.lineGeometry=e}createBorder(){this.line&&this.remove(this.line);let t=new R.LineSegments(this.lineGeometry,this.lineMaterial);return t.position.z=.01,this.line=t,this.add(t),t}dispose(){this.geometry.dispose(),this.material.dispose(),this.line?.geometry.dispose(),this.clear()}};var D=g("three");var ur=g("lodash"),mi={text:"",icon:"",icon_size:[18,18],level:1,collision_enable:!0,opacity:1,id:"",position:{x:0,y:0,z:0},text_font_size:14,icon_rotate:0},$=class extends D.Object3D{constructor(t,e){super();this.context=t;this.options=Ot((0,ur.cloneDeep)({...mi,...e}),this),this.position.set(this.options.position.x,this.options.position.y,this.options.position.z),this.registryEvent(),this.init()}options;textAspect=1;spriteText;spriteIcon;box=new D.Box2;boxHelper;_initIconPromise=null;get durIconAndText(){return this.options.icon&&this.options.text?2:0}get offset(){return this.options.icon&&this.options.text?0:.5}get iconWidth(){return this.options.icon?this.options.icon_size[0]:0}get iconHeight(){return this.options.icon?this.options.icon_size[1]:0}get textWidth(){return this.options.text?this.options.text_font_size*this.textAspect:0}get textHeight(){return this.options.text?this.options.text_font_size:0}get deltaZ(){return .1}get canSelect(){return this.visible&&(this.spriteIcon?this.spriteIcon.visible:!0)&&(this.spriteText?this.spriteText.visible:!0)}registryEvent(){this.context.addEventListener("control-zoom-change",this._initScale),this.addEventListener("change-icon",async({value:t})=>{this._initIconPromise&&await this._initIconPromise,this.spriteIcon&&(this.remove(this.spriteIcon),this.spriteIcon=void 0),await this.initIcon(),this.initSize(),this._initScale({zoom:this.context.camera.zoom})}),this.addEventListener("change-text",({value:t})=>{this.spriteText&&(this.remove(this.spriteText),this.spriteText=void 0),this.initText(),this.initSize(),this._initScale({zoom:this.context.camera.zoom})}),this.addEventListener("change-icon_rotate",({value:t})=>{this.spriteIcon&&(this.spriteIcon.material.rotation=t/180*Math.PI)}),this.addEventListener("change-icon_size",({value:t})=>{this.spriteIcon&&this._initScale({zoom:this.context.camera.zoom})})}unRegistryEvent(){this.context.removeEventListener("control-zoom-change",this._initScale)}async initIcon(){if(this.options.icon)return this._initIconPromise=new Promise(async t=>{let e=await yt.getTextureByUrl(this.options.icon),r=new D.Sprite(new D.SpriteMaterial({map:e,transparent:!0,alphaTest:.2,depthTest:!1,rotation:this.options.icon_rotate/180*Math.PI}));r.visible=!1,r.renderOrder=1e5,e.needsUpdate=!0,this.add(r),this.spriteIcon=r,t(r)}).then(()=>{this._initIconPromise=null})}initText(){if(this.options.text){let t=_t.getTextureByText(this.options.text);this.textAspect=t.image.width/t.image.height;let e=new D.Sprite(new D.SpriteMaterial({map:t,transparent:!0,alphaTest:.2,depthTest:!1}));e.visible=!1,e.renderOrder=100001,t.needsUpdate=!0,this.spriteText=e,this.add(e)}}initSize(){let t=0,e=0,{icon:r,text:i}=this.options;r?i?(t=0,e=t*(this.iconHeight/this.textHeight)-this.iconHeight/this.textHeight-this.durIconAndText/this.textHeight):(t=.5,e=0):i?(e=.5,t=0):(t=0,e=0),this.spriteIcon?.center.set(.5,t),this.spriteText?.center.set(.5,e)}async init(){await this.initIcon(),this.initText(),this.initSize(),this._initScale({zoom:this.context.camera.zoom})}_initScale=({zoom:t})=>{if(this.spriteText){let e=this.textHeight/t;this.spriteText.scale.set(this.textAspect*e,e,.1)}this.spriteIcon&&this.spriteIcon?.scale.set(this.options.icon_size[0]/t,this.options.icon_size[1]/t,.1),this.resetZ()};resetZ(){let t=this.deltaZ;this.spriteIcon&&(this.spriteIcon.position.z=t),this.spriteText&&(this.spriteText.position.z=t)}getBox(t){let{clientSize:{width:e,height:r}}=this.context,i=e*(t.x+1)/2,o=r*(-t.y+1)/2;o+=this.offset*(this.iconHeight+this.durIconAndText+this.textHeight);let a=this.iconWidth/2,l=new D.Box2(new D.Vector2(i-a,o-this.iconHeight),new D.Vector2(i+a,o)),u=this.textWidth/2,c=new D.Box2(new D.Vector2(i-u,o-this.textHeight-this.durIconAndText-this.iconHeight),new D.Vector2(i+u,o-this.iconHeight-this.durIconAndText));return this.box=c.union(l),this.box}renderBoxHelper(){if(!this.boxHelper){let t=document.createElement("div");t.style.position="fixed",t.style.border="1px solid red",t.style.pointerEvents="none",this.boxHelper=t,this.context.container.appendChild(t)}this.boxHelper.style.left=this.box.min.x+"px",this.boxHelper.style.top=this.box.min.y+"px",this.boxHelper.style.width=this.box.max.x-this.box.min.x+"px",this.boxHelper.style.height=this.box.max.y-this.box.min.y+"px"}parentSetVisible(t){this.spriteText&&(this.spriteText.visible=t),this.spriteIcon&&(this.spriteIcon.visible=t),this.boxHelper&&(this.boxHelper.style.display=t?"block":"none")}dispose(){this.unRegistryEvent(),this.spriteText=void 0}};var Z=g("three"),lr=g("three/examples/jsm/utils/BufferGeometryUtils");var _i={airHeight:0,deltaHeight:0,height:0,geometry:{cds:[],type:"polygon",coords:[],curveCpt:[],curveIndex:[]},texts:[],fillColor:"#ffffff",fillOpacity:0,strokeColor:"#ffffff",strokeOpacity:0,secondHeight:0,secondRotate:0,center_x:0,center_y:0},xe=class extends Z.Object3D{constructor(t,e){super();this.context=t;this.options=e.map(r=>({..._i,...r})),this.init()}options;mesh;async init(){let t=this.options.map(a=>_t.getTextureByText(a.texts[0],{fillStyle:qe(a.fillColor,a.fillOpacity),strokeStyle:qe(a.strokeColor,a.strokeOpacity),lineWidth:6,font:"54px sans-serif"})),e=t.map((a,l)=>{let u=this.options[l],{width:c,height:h}=a.image,f=c/h,d=u.secondHeight*f,y=new Z.PlaneGeometry(d,u.secondHeight),p=new Z.Matrix4().makeTranslation(u.center_x,u.center_y,u.airHeight+u.deltaHeight+u.height).multiply(new Z.Matrix4().makeRotationZ(u.secondRotate));return y.applyMatrix4(p),y}),r=(0,lr.mergeGeometries)(e,!0);e.forEach(a=>a.dispose());let i=t.map(a=>{let l=new Z.MeshBasicMaterial({map:a,alphaTest:1,side:Z.DoubleSide});return a.needsUpdate=!0,l}),o=new Z.Mesh(r,i);this.mesh=o,this.position.z+=.004,this.add(o)}dispose(){this.mesh?.geometry.dispose(),(this.mesh?.material).forEach(t=>t.dispose()),this.clear()}};var cr=g("three"),Ee=class extends et{startPoint;endPoint;rect;frustum=new cr.Frustum;constructor(n){super(n);let{config:{selectBox:{fill:t,stroke:e}}}=n;this.rect=mt(e,t),this.svg.appendChild(this.rect),this.registryEvent()}setEnable(n){super.setEnable(n),k(this.rect,0,0,0,0),n?this.registryEvent():(this.startPoint=void 0,this.unRegistryEvent())}onPointerDown=n=>{if(!this.enable)return;let t=this.getIntersectByPointerEvent(n);t&&(this.startPoint=t),this.endPoint=void 0};onPointerMove=n=>{if(!this.enable||!this.startPoint)return;let t=this.getIntersectByPointerEvent(n);t&&(this.endPoint=t)};onPointerUp=n=>{if(!this.enable)return;let t=this.getIntersectByPointerEvent(n);t&&(this.endPoint=t),this.doSelect(),this.startPoint=void 0};onUpdate=()=>{if(this.startPoint){let n=this.getSvgCoordinate(this.startPoint),t={...n};this.endPoint&&(t=this.getSvgCoordinate(this.endPoint));let e={x:Math.min(n.x,t.x),y:Math.min(n.y,t.y)},r=Math.abs(t.x-n.x),i=Math.abs(t.y-n.y);k(this.rect,e.x,e.y,r,i)}else k(this.rect,0,0,0,0)};registryEvent(){this.context.container.addEventListener("pointerdown",this.onPointerDown),this.context.container.addEventListener("pointermove",this.onPointerMove),this.context.container.addEventListener("pointerup",this.onPointerUp),this.context.addEventListener("update",this.onUpdate)}unRegistryEvent(){this.context.container.removeEventListener("pointerdown",this.onPointerDown),this.context.container.removeEventListener("pointermove",this.onPointerMove),this.context.container.removeEventListener("pointerup",this.onPointerUp),this.context.removeEventListener("update",this.onUpdate)}doSelect(){if(this.startPoint&&this.endPoint){if(this.startPoint.distanceTo(this.endPoint)<.1)return;let{context:{camera:t,container:{clientWidth:e,clientHeight:r}}}=this,i=x(this.startPoint,t,e,r),o=x(this.endPoint,t,e,r),a={x:Math.min(i.x,o.x),y:Math.min(i.y,o.y)},l={x:Math.max(i.x,o.x),y:Math.max(i.y,o.y)},u=this.searchMapInFrustum(a,l);this.dispatchEvent({type:"selected",list:u})}}searchMapInFrustum(n,t){let{context:e}=this;return e.currentFloor?.graphicLayer.children.filter(r=>r instanceof L&&this.searchChildInFrustum(r,n,t))||[]}searchChildInFrustum(n,t,e){let{context:{camera:r,container:{clientWidth:i,clientHeight:o}}}=this;if(!n)return!1;if(!n.mesh){let f=n.getPosition();if(f){let d=x(f,r,i,o);return gt(d,t,e)}return!1}n.mesh.geometry.boundingBox||n.mesh.geometry.computeBoundingBox();let a=n.mesh.geometry.boundingBox;if(!a)return!1;let{min:l,max:u}=a,c=x(l,r,i,o),h=x(u,r,i,o);return!(!gt(c,t,e)||!gt(h,t,e))}dispose(){this.unRegistryEvent()}};var be=class extends hr.EventDispatcher{constructor(t){super();this.context=t;this.boxSelection=new Ee(t),this.boxSelection.setEnable(!1),this.registryEvent()}_list=new Set;boxSelection;prevPanStatus;prevRotateStatus;downPoint=null;isMultipleSelect=!1;get list(){return this._list}enableBoxSelection(){this.isMultipleSelect||!this.context.config.enableBoxSelect||(this.isMultipleSelect=!0,this.boxSelection.setEnable(!0),this.prevPanStatus=this.context.control.enablePan,this.prevRotateStatus=this.context.control.enableRotate,this.context.control.enablePan=!1,this.context.control.enableRotate=!1)}disableBoxSelection(){this.isMultipleSelect&&(this.isMultipleSelect=!1,this.boxSelection.setEnable(!1),this.context.control.enablePan=!!this.prevPanStatus,this.context.control.enableRotate=!!this.prevRotateStatus)}onPointerDown=t=>{this.downPoint={x:t.offsetX,y:t.offsetY}};onPointerUp=t=>{if(!this.downPoint)return;let{offsetX:e,offsetY:r}=t,{x:i,y:o}=this.downPoint;if(Math.sqrt((i-e)**2+(o-r)**2)>3)return;let{graphics:a}=this.context.getGraphicsByDeviceXy(e,r),l=new Set(a.map(c=>c.options.id));this.context.getPoisByDeviceXy(e,r).forEach(c=>{if(!l.has(c.options.id)){let h=this.context.currentFloor?.graphicLayer.graphicMap.get(c.options.id)||null;h&&h.options.geometry.type==="point"&&(a.push(h),l.add(c.options.id))}}),(Ut?t.metaKey:t.ctrlKey)||this._list.clear(),a.forEach(c=>this._list.add(c)),this.selectEnd(),this.downPoint=null};onPointerOut=t=>{this.disableBoxSelection()};onKeyDown=t=>{Ft(t.key)&&this.enableBoxSelection()};onKeyUp=t=>{Ft(t.key)&&this.disableBoxSelection()};onBoxSelected=({list:t})=>{this._list.clear(),t.forEach(e=>{this._list.add(e)}),this.selectEnd()};selectEnd(){this.dispatchEvent({type:"select",graphics:[...this._list],isMultipleSelect:this.isMultipleSelect})}registryEvent(){this.context.container.addEventListener("pointerdown",this.onPointerDown),this.context.container.addEventListener("pointerup",this.onPointerUp),this.context.container.addEventListener("pointerout",this.onPointerOut),this.context.container.addEventListener("pointercancel",this.onPointerOut),window.addEventListener("keydown",this.onKeyDown),window.addEventListener("keyup",this.onKeyUp),this.boxSelection.addEventListener("selected",this.onBoxSelected)}unRegistryEvent(){this.context.container.removeEventListener("pointerdown",this.onPointerDown),this.context.container.removeEventListener("pointerup",this.onPointerUp),this.context.container.removeEventListener("pointerout",this.onPointerOut),this.context.container.removeEventListener("pointercancel",this.onPointerOut),window.removeEventListener("keydown",this.onKeyDown),window.removeEventListener("keyup",this.onKeyUp),this.boxSelection.removeEventListener("selected",this.onBoxSelected)}clear(){this._list.clear()}remove(t){this._list.delete(t)}dispose(){this.unRegistryEvent()}};var Me=g("three");var Se=class extends Me.EventDispatcher{constructor(t){super();this.context=t;this.registryEvent()}curGraphics=new Set;timer=new U;graphicTimerMap=new Map;onPointerMove=({graphics:t,pois:e,e:r})=>{let i=e.map(u=>this.context.currentFloor?.graphicLayer.graphicMap.get(u.options.id)).filter(u=>u&&u.options.geometry.type==="point");if(!t.length&&!i.length&&this.curGraphics.size){this.curGraphics.clear(),this.handleHoverGraphicsChange();return}let{time:o}=this.context.config.hover,a=new Set;if(i.length){let u,c=1e4;i.forEach(h=>{let f=e.find(d=>d.options.id===h.options.id);if(f instanceof Rt){let{x:d,y}=f.clientPos,p=Math.sqrt((d-r.offsetX)**2+(y-r.offsetY)**2);p<c&&(c=p,u=h)}else if(f instanceof $){let{x:d,y}=f.box.getCenter(new Me.Vector2),p=Math.sqrt((d-r.offsetX)**2+(y-r.offsetY)**2);p<c&&(c=p,u=h)}}),a.add(u)}a.size||t.forEach(u=>a.add(u)),a.forEach(u=>{if(this.graphicTimerMap.get(u)||this.curGraphics.has(u))return;let c=this.timer.setTimeout(()=>{this.curGraphics.add(u),this.graphicTimerMap.delete(u),this.timer.clearTimeout(c),this.handleHoverGraphicsChange()},o);this.graphicTimerMap.set(u,c)}),this.graphicTimerMap.forEach((u,c)=>{a.has(c)||(this.timer.clearTimeout(u),this.graphicTimerMap.delete(c))});let l=this.curGraphics.size;this.curGraphics.forEach(u=>{a.has(u)||this.curGraphics.delete(u)}),l!==this.curGraphics.size&&this.handleHoverGraphicsChange()};onPointerLevel=()=>{this.curGraphics.clear(),this.handleHoverGraphicsChange()};onBodyPointerMove=t=>{if(this.curGraphics.size){let e=this.context.container.getBoundingClientRect();(t.clientX<e.left||t.clientX>e.right||t.clientY<e.top||t.clientY>e.bottom)&&this.onPointerLevel()}};handleHoverGraphicsChange(t=this.curGraphics){this.dispatchEvent({type:"hover-change",graphics:Array.from(t)})}registryEvent(){this.context.addEventListener("pointer-over",this.onPointerMove),this.context.addEventListener("pointer-move",this.onPointerMove),this.context.addEventListener("pointer-level",this.onPointerLevel),document.body.addEventListener("pointermove",this.onBodyPointerMove)}unRegistryEvent(){this.context.removeEventListener("pointer-over",this.onPointerMove),this.context.removeEventListener("pointer-move",this.onPointerMove),this.context.removeEventListener("pointer-level",this.onPointerLevel),document.body.removeEventListener("pointermove",this.onBodyPointerMove)}dispose(){this.unRegistryEvent(),this.timer.dispose()}};var It=g("three");var we=class{constructor(n){this.context=n;this.registryEvent(),this.changePrevCamera()}prevCamera={position:new It.Vector3,zoom:1,target:new It.Vector3};enable=!0;box=new It.Box3;updateBox(){this.box.setFromObject(this.context.scene)}setEnable(n){this.enable=n,n?this.registryEvent():this.unRegistryEvent()}changePrevCamera(){this.prevCamera={position:this.context.camera.position.clone(),zoom:this.context.camera.zoom,target:this.context.control.target.clone()}}backToPrevCamera(){this.setEnable(!1),this.context.camera.position.copy(this.prevCamera.position),this.context.camera.zoom=this.prevCamera.zoom,this.context.control.target.copy(this.prevCamera.target),this.context.control.update(),this.setEnable(!0)}registryEvent(){this.context.addEventListener("control-change",this.onCameraChange)}unRegistryEvent(){this.context.removeEventListener("control-change",this.onCameraChange)}getCurFloorScreenPosition(){if(!this.context.scene.children.filter(m=>m instanceof ht).length)return null;let t=this.box,{camera:e,clientSize:{width:r,height:i}}=this.context,{min:o,max:a}=t,l=x(o,e,r,i),u=x(a,e,r,i),c=x(new It.Vector3(o.x,a.y,a.z),e,r,i),h=x(new It.Vector3(a.x,o.y,o.z),e,r,i),f=Math.min(l.x,u.x,c.x,h.x),d=Math.max(l.x,u.x,c.x,h.x),y=Math.min(l.y,u.y,c.y,h.y),p=Math.max(l.y,u.y,c.y,h.y);return{left:f,right:d,top:y,bottom:p}}checkDistanceToScreenEdge({left:n,right:t,top:e,bottom:r}){let{width:i,height:o}=this.context.clientSize,[a,l,u,c]=this.context.config.cameraBound.padding,h=t>=c,f=i-n>=l,d=o-e>=u,y=r>=a;return h&&f&&d&&y}onCameraChange=()=>{let n=this.getCurFloorScreenPosition();if(n){let{left:t,right:e,top:r,bottom:i}=n;this.checkDistanceToScreenEdge({left:t,right:e,top:r,bottom:i})?this.changePrevCamera():this.backToPrevCamera()}};dispose(){this.unRegistryEvent()}};var en=g("three"),pr=g("three/examples/jsm/controls/MapControls"),Lt=g("@tweenjs/tween.js");var Te=class extends pr.MapControls{constructor(t,e,r){super(e,r);this.context=t;this.camera=e;this.domElement=r;this.enableDamping=!1,this.zoomSpeed=.5,this.prevCameraZoom=e.zoom,this.registryEvent()}prevCameraZoom=1;tweenGroup=new Lt.Group;offsetY=0;registryEvent(){this.addEventListener("change",()=>{let t=this.camera.zoom;t!==this.prevCameraZoom&&(this.prevCameraZoom=t,this.dispatchEvent({type:"change-zoom",zoom:t}))}),this.context.addEventListener("update",this.tweenUpdate)}tweenUpdate=()=>{this.tweenGroup.update()};setPolarAngle(t,e=!1){let{maxPolarAngle:r,minPolarAngle:i}=this,o=r===i;(e||t<=r&&t>=i)&&(this.maxPolarAngle=t,this.minPolarAngle=t,this.update()),o||(this.maxPolarAngle=r,this.minPolarAngle=i)}async setPolarAngleByDuration(t,e=!1,r=500){return r<=0?this.setPolarAngle(t,e):wt(new Promise(i=>{let o={polar:this.getPolarAngle()},a={polar:t},l=new Lt.Tween(o,this.tweenGroup).to(a,r).onUpdate(()=>{this.setPolarAngle(o.polar,e)}).onComplete(()=>{this.enabled=!0,this.tweenGroup.remove(l),i(!0)}).onStart(()=>{this.enabled=!1}).start()}),r+500)}setAzimuthalAngle(t,e){let{maxAzimuthAngle:r,minAzimuthAngle:i,maxPolarAngle:o,minPolarAngle:a}=this,l=r===i;if(e||t<=r&&t>=i){this.maxAzimuthAngle=t,this.minAzimuthAngle=t;let u=this.getPolarAngle();this.maxPolarAngle=u,this.minPolarAngle=u,this.update(),this.maxPolarAngle=o,this.minPolarAngle=a}l||(this.maxAzimuthAngle=r,this.minAzimuthAngle=i)}setAzimuthalAngleDuration(t,e=!1,r=500){return r<=0?this.setAzimuthalAngle(t,e):wt(new Promise(i=>{let o={azimuthal:this.getAzimuthalAngle()},a={azimuthal:t},l=new Lt.Tween(o,this.tweenGroup).to(a,r).onUpdate(()=>{this.setAzimuthalAngle(o.azimuthal,e)}).onComplete(()=>{this.enabled=!0,this.tweenGroup.remove(l),i(!0)}).onStart(()=>{this.enabled=!1}).start()}),r+500)}getCameraLookAt(){return new en.Vector3().subVectors(this.target,this.camera.position)}async setCameraPositionByTarget(t,e){let r=this.target.clone(),i=this.getCameraLookAt();if(!e){this.camera.position.copy(t.clone().sub(i)),this.target.copy(t.clone()),this.update();return}return wt(new Promise(o=>{let a=new Lt.Tween(r,this.tweenGroup).to(t,e).onUpdate(()=>{this.camera.position.copy(r.clone().sub(i)),this.target.copy(r.clone()),this.update()}).onComplete(()=>{this.tweenGroup.remove(a),this.camera.position.copy(t.clone().sub(i)),this.target.copy(t.clone()),this.update(),this.enabled=!0,o(!0)}).onStart(()=>{this.enabled=!1}).start()}),e+500)}setZoom(t,e,r=!1){let{minZoom:i,maxZoom:o}=this;(r||t>=i&&t<=o)&&(this.camera.position.copy(e.clone().sub(this.getCameraLookAt())),this.target.copy(e),this.camera.zoom=t,this.update())}setZoomByDuration(t,e,r=!1,i=500){let o=this.getCameraLookAt(),a={zoom:this.camera.zoom,target:this.target.clone()};return i?wt(new Promise(l=>{let u=new Lt.Tween(a,this.tweenGroup).to({zoom:t,target:e},i).onUpdate(()=>{this.setZoom(a.zoom,a.target,r)}).onComplete(()=>{this.tweenGroup.remove(u),this.enabled=!0,l(!0)}).onStart(()=>{this.enabled=!1}).start()}),i+500):this.setZoom(t,e,r)}setTargetByOffset(t,e=this.target.clone()){if(!t)return;let r=new en.Vector3;r.setFromMatrixColumn(this.camera.matrix,1),r.normalize(),r.multiplyScalar(t/this.camera.zoom),e.add(r),this.setCameraPositionByTarget(e,0)}dispose(){this.tweenGroup.getAll().forEach(t=>t.stop()),this.tweenGroup.removeAll()}};var Vt=g("three");var Ce=class extends Vt.WebGLRenderer{event=new Vt.EventDispatcher;scene;camera;enable=!0;timer=new U;constructor(n){super({antialias:!0,alpha:!0,...n}),this.autoClear=!0,this.setPixelRatio(window.devicePixelRatio),this.shadowMap.enabled=!0,this.shadowMap.autoUpdate=!0,this.shadowMap.type=Vt.PCFSoftShadowMap}setCameraAndScene(n,t){this.scene=n,this.camera=t}autoRender(){this.scene&&this.camera&&this.enable&&(this.event.dispatchEvent({type:"update"}),this.render(this.scene,this.camera)),this.timer.requestAnimationFrame(()=>{this.autoRender()})}pauseRender(){this.enable=!1}continueRender(){this.enable=!0}addEventListener(n,t){this.event.addEventListener(n,t)}removeEventListener(n,t){this.event.removeEventListener(n,t)}dispose(){this.timer.dispose(),this.enable=!1,super.dispose()}};var fr=g("three"),Pe=class extends fr.Scene{constructor(){super()}};var dr=g("three"),Ae=class extends dr.OrthographicCamera{constructor(n,t){super(-n/2,n/2,t/2,-t/2,-1e3,5e3),this.up.set(0,0,1),this.position.set(0,0,100),this.lookAt(0,0,0)}};var Re=class extends M.EventDispatcher{constructor(t,e){super();this.container=t;this.config=e;this.container.style.position="relative",this.container.style.overflow="hidden",this.init(),this.selection=new be(this),this.hoverHelper=new Se(this),this.resizeClientSize(),this.registryEvent()}scene=new Pe;renderer=new Ce;camera;control;lights=un();currentFloor;selection;hoverHelper;basicRatio;cameraBound;clientSize={width:0,height:0,x:0,y:0};renderRf=0;resizeClientSize(){let{x:t,y:e,width:r,height:i}=this.container.getBoundingClientRect();this.clientSize={width:r||this.container.clientWidth,height:i||this.container.clientHeight,x:t,y:e}}init(){let{clientWidth:t,clientHeight:e}=this.container;this.camera=new Ae(t,e),this.renderer.setSize(t,e),this.renderer.setCameraAndScene(this.scene,this.camera),this.renderer.autoRender(),this.control=new Te(this,this.camera,this.renderer.domElement),this.control.maxPolarAngle=this.config.control.maxPolar,this.container.appendChild(this.renderer.domElement),this.scene.add(this.lights),this.basicRatio=this.getRatio(),this.control.addEventListener("change",()=>{this.dispatchEvent({type:"change-ratio",px:(this.basicRatio||0)*this.camera.zoom}),this.dispatchEvent({type:"control-change"})}),this.control.addEventListener("change-zoom",({zoom:r})=>{this.dispatchEvent({type:"control-zoom-change",zoom:r})}),this.renderer.addEventListener("update",()=>{this.dispatchEvent({type:"update"})}),this.cameraBound=new we(this)}getRatio(t=new M.Vector3(0,0,0),e=new M.Vector3(100,0,0)){let{clientWidth:r,clientHeight:i}=this.container,o=x(t,this.camera,r,i),a=x(e,this.camera,r,i);return Math.ceil(Math.sqrt((a.x-o.x)**2+(a.y-o.y)**2))}changeAmbientLightColor(t){this.lights.children.forEach(e=>{e instanceof M.AmbientLight&&(e.color=new M.Color(t))})}switchFloor(t){this.currentFloor&&(this.scene.remove(this.currentFloor),this.currentFloor.dispose()),this.currentFloor=t,this.scene.add(t);let e=t.getCenter();e&&(this.lights.position.x=e.x,this.lights.position.y=e.y),this.cameraBound.updateBox()}onWindowResize=()=>{let{container:t,camera:e,renderer:r}=this,{clientWidth:i,clientHeight:o}=t;i=Math.max(1,i),o=Math.max(1,o),e.left=-i/2,e.right=i/2,e.top=o/2,e.bottom=-o/2,e.updateProjectionMatrix(),r.setSize(i,o),this.resizeClientSize(),this.dispatchEvent({type:"resize",width:i,height:o})};onClick=t=>{let{graphics:e,position:r}=this.getGraphicsByDeviceXy(t.offsetX,t.offsetY);e.length&&this.dispatchEvent({type:"graphic-click",graphics:e,position:r});let i=this.getPoisByDeviceXy(t.offsetX,t.offsetY);i.length&&this.dispatchEvent({type:"poi-click",pois:i})};getGraphicsByDeviceXy(t,e){let r=new M.Vector2;r.x=t/this.clientSize.width*2-1,r.y=e/this.clientSize.height*-2+1;let i=new M.Raycaster;return i.setFromCamera(r,this.camera),i.ray.origin.sub(i.ray.direction.clone().multiplyScalar(100)),this.currentFloor?.graphicLayer.getGraphicByRaycaster(i)||{graphics:[],position:null}}getPoisByDeviceXy(t,e){let r=this.currentFloor?.poiLayer.getPoiByDeviceXy(t,e),i=this.currentFloor?.poiLayer2.getPoiByDeviceXy(t,e);return(r||[]).concat(i||[])}onPointerover=t=>{let{graphics:e,position:r}=this.getGraphicsByDeviceXy(t.offsetX,t.offsetY),i=this.getPoisByDeviceXy(t.offsetX,t.offsetY);this.dispatchEvent({type:"pointer-over",e:t,graphics:e,pois:i,position:r})};onPointermove=t=>{let{graphics:e,position:r}=this.getGraphicsByDeviceXy(t.offsetX,t.offsetY),i=this.getPoisByDeviceXy(t.offsetX,t.offsetY);this.dispatchEvent({type:"pointer-move",e:t,graphics:e,pois:i,position:r})};onPointerleave=t=>{this.dispatchEvent({type:"pointer-level"})};onSelectionSelect=({graphics:t,isMultipleSelect:e})=>{this.dispatchEvent({type:"select-graphic",graphics:t,isMultipleSelect:e})};onHoverChange=({graphics:t})=>{this.dispatchEvent({type:"hover",graphics:t})};registryEvent(){window.addEventListener("resize",this.onWindowResize),this.container.addEventListener("click",this.onClick),this.container.addEventListener("pointerover",this.onPointerover),this.container.addEventListener("pointermove",this.onPointermove),this.container.addEventListener("pointerleave",this.onPointerleave),this.container.addEventListener("pointercancel",this.onPointerleave),this.container.addEventListener("pointerout",this.onPointerleave),this.selection.addEventListener("select",this.onSelectionSelect),this.hoverHelper.addEventListener("hover-change",this.onHoverChange)}unRegistryEvent(){window.removeEventListener("resize",this.onWindowResize),this.container.removeEventListener("click",this.onClick),this.container.removeEventListener("pointerover",this.onPointerover),this.container.removeEventListener("pointermove",this.onPointermove),this.container.removeEventListener("pointerleave",this.onPointerleave),this.container.removeEventListener("pointercancel",this.onPointerleave),this.container.removeEventListener("pointerout",this.onPointerleave),this.selection.removeEventListener("select",this.onSelectionSelect),this.hoverHelper.removeEventListener("hover-change",this.onHoverChange)}setPolarAngle(t,e=500){return this.control.setPolarAngleByDuration(t,!0,e)}setAzimuthalAngle(t,e=500){return this.control.setAzimuthalAngleDuration(t,!0,e)}getCameraLookAt(){return this.control.getCameraLookAt()}setZoom(t,e,r=500){return this.control.setZoomByDuration(t,e,!0,r)}getFitCameraToObjectZoom(t,e=[20,20,20,20],r=500,i=!0){let[o,a,l,u]=e,{clientSize:{width:c,height:h}}=this,f=this.control.getPolarAngle();i&&this.setPolarAngle(0,0);let d=new M.Box3().setFromObject(t);this.setPolarAngle(f,0);let{max:y,min:p}=d,m=new M.Vector3(p.x,y.y,y.z),b=new M.Vector3(y.x,y.y,y.z),E=new M.Vector3(y.x,p.y,p.z),z=new M.Vector3(p.x,p.y,p.z),S=x(m,this.camera,c,h),T=x(b,this.camera,c,h),O=x(z,this.camera,c,h),dt=x(E,this.camera,c,h),Wt=new M.Box2().setFromPoints([new M.Vector2(S.x,S.y),new M.Vector2(T.x,T.y),new M.Vector2(O.x,O.y),new M.Vector2(dt.x,dt.y)]).getSize(new M.Vector2),We=(c-a-u)/Wt.x,Zr=(h-o-l)/Wt.y,Kr=Math.min(We,Zr),Jr=new M.Vector3((y.x+p.x)/2,(y.y+p.y)/2,(y.z+p.z)/2);return{zoom:Kr*this.camera.zoom,center:Jr}}fitCameraToObject(t,e=[20,20,20,20],r=500,i=!0){let{zoom:o,center:a}=this.getFitCameraToObjectZoom(t,e,r,i);return this.setZoom(o,a,r)}getFitCameraToGroundZoom(t=[20,20,20,20],e=500,r=!0){if(this.currentFloor&&this.currentFloor.hasElement)return this.getFitCameraToObjectZoom(this.currentFloor.groundUpper,t,e,r).zoom}fitCameraToGround(t=[20,20,20,20],e=500,r=!0){return this.currentFloor&&this.currentFloor.hasElement?this.fitCameraToObject(this.currentFloor.groundUpper,t,e,r):Promise.resolve(!1)}async setCameraPosition(t,e){return this.control.setCameraPositionByTarget(t,e)}pauseRender(){this.renderer.pauseRender()}continueRender(){this.renderer.continueRender()}dispose(){this.control.dispose(),this.cameraBound.dispose(),this.selection.dispose(),this.hoverHelper.dispose(),this.unRegistryEvent(),this.renderer.domElement.remove(),this.renderer.dispose(),this.lights.children.forEach(t=>t.dispose()),W(this.scene)}};var gr=g("lodash"),yi={apiDomain:"",apiInfo:{},apiPath:{floorGraphic:"/api/inception-map/floor/get",floorRange:"/api/inception-map/range/get",equipmentList:"/api/inception-map/equipment/get",roadNetwork:"/api/inception-map/road_network/get"},enableBoxSelect:!0,resizeObserver:!1,initTransToMark:!1,heatMap:{radius:50,gradient:{0:"#8F9FCD",.5:"#6284FF",1:"#F95D5D"}},useFloorCache:!0,control:{maxPolar:1.2,defaultPolar:1.1,defaultAzimuthal:0},defaultPadding:[20,20,20,20],svg:{circle:{radius:"2",fill:"#1CADFF"},line:{stroke:"#1CADFF"}},selectBox:{stroke:"#1CADFF",fill:"rgba(28, 173, 255, 0.3)"},hover:{time:100},ground:{color:"#F6F6F6",opacity:1,height:.001,stroke:!1,strokeColor:"#E6E6E6",strokeOpacity:1},markGraphic:{color:"#EEF0F3",opacity:1,height:.001,stroke:!1,strokeColor:"#000",strokeOpacity:1},graphic:{fillOpacity:1},cameraBound:{padding:[150,150,150,150]},poi:{boxScale:1}};function mr(s){return(0,gr.merge)({},yi,s)}var yr=g("lodash");var vi=(t=>(t[t.D2=0]="D2",t[t.D3=1.1]="D3",t))(vi||{}),_r=class extends Ie.EventDispatcher{constructor(t,e={}){super();this.container=t;this.config=mr(e),this.context=new Re(t,this.config),this.registryEvent()}config;context;polarKeys=[];azimuthalKeys=[];svgLine;svgPolygon;basicZoom=1;prevCameraZoom=1;type="2d";currentBuildGround=null;observe=null;buildingCenter=[0,0];timer=new U;plugins=[];changeBuildingCenter(t,{brand:e,project:r}){let i=t?Jt(t.info.geometry.cds[0]):[0,0];this.buildingCenter=i,this.dispatchEvent({type:"center-change",center:i,project:r,brand:e})}use(t){t.bmap=this,this.plugins.push(t)}unUse(t){this.plugins=this.plugins.filter(e=>e!==t)}triggerHooks(t,e){this.dispatchEvent({type:t,data:e})}switchFloorByFloor(t,e=t.graphicLayer.children){this.triggerHooks("switch_floor_before",{curFloor:t,graphics:e}),this.context.switchFloor(t),this.initialFloorCamera(),this.triggerHooks("switch_floor_after",{curFloor:t,graphics:e})}initialFloorCamera(){this.context.cameraBound.setEnable(!1),this.context.control.minZoom=0,this.context.control.maxZoom=1/0,this.context.camera.zoom=1,this.context.setAzimuthalAngle(this.config.control.defaultAzimuthal,0),this.context.setPolarAngle(this.config.control.defaultPolar,0),this.context.fitCameraToGround(void 0,0);let t=this.context.camera.zoom;this.context.control.minZoom=t,this.context.control.maxZoom=t*30,this.type==="3d"&&this.context.fitCameraToGround(this.config.defaultPadding,0,!1),this.basicZoom=this.context.camera.zoom,this.context.control.addEventListener("change",this.onControlChange),this.onControlChange(),this.context.cameraBound.setEnable(!0),this.context.cameraBound.changePrevCamera()}onControlChange=()=>{let{camera:{zoom:t}}=this.context;t!==this.prevCameraZoom&&(this.dispatchEvent({type:"zoom-change",basicZoom:this.basicZoom,cameraZoom:this.context.camera.zoom}),this.prevCameraZoom=t)};addModel(t,e){if(t.options.geometry.type==="polygon"){let r=this.context.currentFloor?.addModel({...e,position:t.getPosition().setZ(.1),id:t.options.id});if(r){let{facilityAngle:i=0,facilityXScale:o=1,facilityYScale:a=1}=t.options.userData;r.rotateZ((180-i)/180*Math.PI),r.scale.set(o,a,1)}}}addHeatmap(t){return this.context.currentFloor?.addHeatmap(t)}getLegacyToGraphicMap(){return this.context.currentFloor?.userData.legacyToGraphicMap||new Map}getFloorAllGraphics(){return this.context.currentFloor?.graphicLayer.children.filter(t=>t instanceof L)||[]}createGraphicPoi(t,e){if(this.context.currentFloor){e.id===void 0&&(e.id=t.options.id);let r=t.getCenter();return this.context.currentFloor.addPoi({...e,position:{...r,z:r.z+t.options.height/2}})}return null}removeHeatMap(){this.context.currentFloor?.removeHeatMap()}translateElementToCenter(t,e=500){let r=t.getPosition();return this.context.setCameraPosition(r,e)}async translateElementToCenterX(t,e=500){return wt(new Promise(r=>{let i=this.context.control.target.clone(),o=t.getPosition();this.timer.requestAnimationFrame(()=>{let{clientSize:{width:a,height:l},camera:u}=this.context,h=x(o,u,a,l).x-a/2,f=new Ie.Vector3;f.setFromMatrixColumn(this.context.camera.matrix,0),f.normalize(),f.multiplyScalar(h/this.context.camera.zoom),i.add(f),this.context.setCameraPosition(i,e).then(r)})}),e+500)}getElementDeviceCoordinate(t){let e=t.position.clone(),{clientWidth:r,clientHeight:i}=this.container;return x(e,this.context.camera,r,i)}changeMapType(t,e=500){return this.type=t,t==="2d"?this.context.setPolarAngle(0,e):this.context.setPolarAngle(1.1,e)}async resetView(t=300){let e=t/3;await this.context.setAzimuthalAngle(this.config.control.defaultAzimuthal,e),await this.context.setPolarAngle(this.config.control.defaultPolar,e),await this.context.fitCameraToGround(this.config.defaultPadding,e,!1)}reduceMap(t=.5,e=500){let r=this.context.camera.zoom;return this.context.setZoom(r-t,this.context.control.target,e)}enlargeMap(t=.5,e=500){let r=this.context.camera.zoom;return this.context.setZoom(r+t,this.context.control.target,e)}onKeydown=t=>{this.polarKeys.includes(t.code)&&(this.context.control.maxPolarAngle=this.config.control.maxPolar,this.context.control.minPolarAngle=0),this.azimuthalKeys.includes(t.code)&&(this.context.control.maxAzimuthAngle=1/0,this.context.control.minAzimuthAngle=1/0)};onKeyUp=t=>{if(this.polarKeys.includes(t.code)){let e=this.context.control.getPolarAngle();this.context.control.maxPolarAngle=e,this.context.control.minPolarAngle=e}if(this.azimuthalKeys.includes(t.code)){let e=this.context.control.getAzimuthalAngle();this.context.control.maxAzimuthAngle=e,this.context.control.minAzimuthAngle=e}};registryEvent(){if(window.addEventListener("keydown",this.onKeydown),window.addEventListener("keyup",this.onKeyUp),this.config.resizeObserver){let t=new ResizeObserver((0,yr.debounce)(this.resize,5));t.observe(this.container),this.observe=t}}unRegistryEvent(){window.removeEventListener("keydown",this.onKeydown),window.removeEventListener("keyup",this.onKeyUp),this.observe?.disconnect(),this.observe=null}configurePolarShortcutKeys(t){this.polarKeys=t}configureAzimuthalShortcutKeys(t){this.azimuthalKeys=t}rotateMap(t=.1){let e=this.context.control.getAzimuthalAngle();this.context.setAzimuthalAngle(e+t,500)}async measureDistance(){return this.cancelDistance(),new Promise((t,e)=>{this.changeMapType("2d",0),this.context.control.enableRotate=!1,this.svgLine=new de(this.context);let r=this.svgLine.dispose.bind(this.svgLine);this.svgLine.dispose=function(){r(),e("cancel")},this.svgLine.addEventListener("distance",({distance:i})=>{t(i)})})}cancelDistance(){this.svgLine&&(this.svgLine.dispose(),this.svgLine=void 0,this.context.control.enableRotate=!0)}measureArea(){return this.cancelArea(),new Promise((t,e)=>{this.changeMapType("2d",0),this.context.control.enableRotate=!1,this.svgPolygon=new ge(this.context);let r=this.svgPolygon.dispose.bind(this.svgPolygon);this.svgPolygon.dispose=function(){r(),e("cancel")},this.svgPolygon.addEventListener("area",({area:i})=>{t(i)})})}cancelArea(){this.svgPolygon&&(this.svgPolygon.dispose(),this.svgPolygon=void 0,this.context.control.enableRotate=!0)}getGraphicByNodeId(t){return this.context.currentFloor?.graphicLayer.getGraphicByNodeId(t)||null}deleteGraphic(t){this.context.currentFloor?.graphicLayer.removeGraphic(t)}createGraphicByOptions(t){if(!t.transformToBuildingGround&&this.currentBuildGround){let e=Jt(this.currentBuildGround.info.geometry.cds[0]);if(t.geometry.type==="polygon")t.geometry.coords=JSON.parse(JSON.stringify(t.geometry.cds)),t.geometry.coords.map(r=>{Array.isArray(r)&&r.forEach(i=>{i[0]-=e[0],i[1]-=e[1]})});else{let[r,i]=t.geometry.cds;t.geometry.coords=[r-e[0],i-e[1]]}}return this.context.currentFloor?.graphicLayer.createGraphic(t)}removePoiById(t){this.context.currentFloor?.poiLayer.removePoiById(t),this.context.currentFloor?.poiLayer2.removePoiById(t)}getPoiById(t){return this.context.currentFloor?.poiLayer.getPoiById(t)||this.context.currentFloor?.poiLayer2.getPoiById(t)}getPois(){return[...(this.context.currentFloor?.poiLayer.pois||[]).filter(t=>!t.options.built_in),...this.context.currentFloor?.poiLayer2.pois||[]]}clearPoi(){this.context.currentFloor&&this.context.currentFloor.poiLayer.clear()}removeSelectGraphic(t){this.context.selection.remove(t)}resize=()=>{this.context.cameraBound.setEnable(!1),this.context.onWindowResize();let t=this.context.control.getAzimuthalAngle(),e=this.context.camera.zoom;this.context.control.minZoom=0,this.context.control.maxZoom=1/0,this.context.camera.zoom=1,this.context.setAzimuthalAngle(0,0);let r=this.context.getFitCameraToGroundZoom(void 0,0)||1;this.context.camera.zoom=e,this.context.control.minZoom=r,this.context.control.maxZoom=r*25,this.basicZoom=e,this.context.control.addEventListener("change",this.onControlChange),this.context.setAzimuthalAngle(t,0),this.context.cameraBound.setEnable(!0)};dispose(){this.timer.dispose(),this.plugins.forEach(t=>t.dispose()),this.context.dispose(),this.unRegistryEvent(),_t.dispose(),yt.dispose(),Ct.dispose(),vt.dispose(),A.dispose()}};var vr=g("three"),pt=class extends vr.EventDispatcher{bmap;constructor(n){super(),this.bmap=n}dispose(){}};var xr=class extends pt{equipmentList=[];equipmentMap=new Map;constructor(n){super(n),this.fetchEquipment(),this.bmap.addEventListener("switch_floor_after",this.onSwitchFloor)}async fetchEquipment(){let{apiDomain:n,apiPath:{equipmentList:t},apiInfo:e}=this.bmap.config,r=`${n}${t}`;await fetch(r,e).then(i=>i.json()).then(i=>i.data).then(i=>{this.equipmentList=i,this.equipmentMap=new Map(i.map(o=>[o.equipment_id,o]))}),this.dispatchEvent({type:"change-equipment-list",data:this.equipmentList}),this.bmap.context.currentFloor&&this.changeGraphicToEquipment(this.bmap.context.currentFloor.graphicLayer.children)}onSwitchFloor=({data:{graphics:n}})=>{this.equipmentList.length&&this.changeGraphicToEquipment(n)};getGraphicEquipment(n){return n.userData.data.info.userData.equipment}changeGraphicToEquipment(n){n.filter(t=>{let e=this.getGraphicEquipment(t);return e&&this.equipmentMap.has(e)}).forEach(t=>{let e=this.equipmentMap.get(this.getGraphicEquipment(t)),r=this.bmap.createGraphicPoi(t,{icon:e?.equipment_icon,built_in:!0,icon_size:[14,14]});r&&(r.userData.data=e,r.userData.type="equipment")})}dispose(){this.bmap.removeEventListener("switch_floor_after",this.onSwitchFloor),Array.from(this.bmap.context.currentFloor?.poiLayer.pois||[]).forEach(n=>{n.userData.type==="equipment"&&this.bmap.context.currentFloor?.poiLayer.removePoi(n)})}};var I=g("three");var _=g("three"),K=class extends _.BufferGeometry{constructor(){super(),this.isMeshLine=!0,this.type="MeshLine",this.positions=[],this.previous=[],this.next=[],this.side=[],this.width=[],this.indices_array=[],this.uvs=[],this.counters=[],this._points=[],this._geom=null,this.widthCallback=null,this.matrixWorld=new _.Matrix4,Object.defineProperties(this,{geometry:{enumerable:!0,get:function(){return this}},geom:{enumerable:!0,get:function(){return this._geom},set:function(n){this.setGeometry(n,this.widthCallback)}},points:{enumerable:!0,get:function(){return this._points},set:function(n){this.setPoints(n,this.widthCallback)}}})}};K.prototype.setMatrixWorld=function(s){this.matrixWorld=s};K.prototype.setGeometry=function(s,n){this._geometry=s,this.setPoints(s.getAttribute("position").array,n)};K.prototype.setPoints=function(s,n){if(!(s instanceof Float32Array)&&!(s instanceof Array)){console.error("ERROR: The BufferArray of points is not instancied correctly.");return}if(this._points=s,this.widthCallback=n,this.positions=[],this.counters=[],s.length&&s[0]instanceof _.Vector3)for(var t=0;t<s.length;t++){var e=s[t],r=t/s.length;this.positions.push(e.x,e.y,e.z),this.positions.push(e.x,e.y,e.z),this.counters.push(r),this.counters.push(r)}else for(var t=0;t<s.length;t+=3){var r=t/s.length;this.positions.push(s[t],s[t+1],s[t+2]),this.positions.push(s[t],s[t+1],s[t+2]),this.counters.push(r),this.counters.push(r)}this.process()};function xi(s,n){var t=new _.Matrix4,e=new _.Ray,r=new _.Sphere,i=new _.Vector3,o=this.geometry;if(o.boundingSphere||o.computeBoundingSphere(),r.copy(o.boundingSphere),r.applyMatrix4(this.matrixWorld),s.ray.intersectSphere(r,i)!==!1){t.copy(this.matrixWorld).invert(),e.copy(s.ray).applyMatrix4(t);var a=new _.Vector3,l=new _.Vector3,u=new _.Vector3,c=this instanceof _.LineSegments?2:1,h=o.index,f=o.attributes;if(h!==null)for(var d=h.array,y=f.position.array,p=f.width.array,m=0,b=d.length-1;m<b;m+=c){var E=d[m],z=d[m+1];a.fromArray(y,E*3),l.fromArray(y,z*3);var S=p[Math.floor(m/3)]!==void 0?p[Math.floor(m/3)]:1,T=s.params.Line.threshold+this.material.lineWidth*S/2,O=T*T,dt=e.distanceSqToSegment(a,l,i,u);if(!(dt>O)){i.applyMatrix4(this.matrixWorld);var St=s.ray.origin.distanceTo(i);St<s.near||St>s.far||(n.push({distance:St,point:u.clone().applyMatrix4(this.matrixWorld),index:m,face:null,faceIndex:null,object:this}),m=b)}}}}K.prototype.raycast=xi;K.prototype.compareV3=function(s,n){var t=s*6,e=n*6;return this.positions[t]===this.positions[e]&&this.positions[t+1]===this.positions[e+1]&&this.positions[t+2]===this.positions[e+2]};K.prototype.copyV3=function(s){var n=s*6;return[this.positions[n],this.positions[n+1],this.positions[n+2]]};K.prototype.getDistance=function(s){let n=0;for(let t=0;t<s;t++){let e=6*t,r=new _.Vector3(this.positions[e],this.positions[e+1],this.positions[e+2]),i=new _.Vector3(this.positions[e+6],this.positions[e+7],this.positions[e+8]),o=r.distanceTo(i);n+=o}return n};K.prototype.process=function(){var s=this.positions.length/6;this.previous=[],this.next=[],this.side=[],this.width=[],this.indices_array=[],this.uvs=[];var n;let t=this.getDistance(s-1);var e;this.compareV3(0,s-1)?e=this.copyV3(s-2):e=this.copyV3(0),this.previous.push(e[0],e[1],e[2]),this.previous.push(e[0],e[1],e[2]);for(var r=0;r<s;r++){if(this.side.push(1),this.side.push(-1),this.widthCallback?n=this.widthCallback(r/(s-1)):n=1,this.width.push(n),this.width.push(n),r===0)this.uvs.push(0,0),this.uvs.push(0,1);else if(r===s-1)this.uvs.push(1,0),this.uvs.push(1,1);else{let o=this.getDistance(r)/t;this.uvs.push(o,0),this.uvs.push(o,1)}if(r<s-1){e=this.copyV3(r),this.previous.push(e[0],e[1],e[2]),this.previous.push(e[0],e[1],e[2]);var i=r*2;this.indices_array.push(i,i+1,i+2),this.indices_array.push(i+2,i+1,i+3)}r>0&&(e=this.copyV3(r),this.next.push(e[0],e[1],e[2]),this.next.push(e[0],e[1],e[2]))}this.compareV3(s-1,0)?e=this.copyV3(1):e=this.copyV3(s-1),this.next.push(e[0],e[1],e[2]),this.next.push(e[0],e[1],e[2]),!this._attributes||this._attributes.position.count!==this.positions.length?this._attributes={position:new _.BufferAttribute(new Float32Array(this.positions),3),previous:new _.BufferAttribute(new Float32Array(this.previous),3),next:new _.BufferAttribute(new Float32Array(this.next),3),side:new _.BufferAttribute(new Float32Array(this.side),1),width:new _.BufferAttribute(new Float32Array(this.width),1),uv:new _.BufferAttribute(new Float32Array(this.uvs),2),index:new _.BufferAttribute(new Uint16Array(this.indices_array),1),counters:new _.BufferAttribute(new Float32Array(this.counters),1)}:(this._attributes.position.copyArray(new Float32Array(this.positions)),this._attributes.position.needsUpdate=!0,this._attributes.previous.copyArray(new Float32Array(this.previous)),this._attributes.previous.needsUpdate=!0,this._attributes.next.copyArray(new Float32Array(this.next)),this._attributes.next.needsUpdate=!0,this._attributes.side.copyArray(new Float32Array(this.side)),this._attributes.side.needsUpdate=!0,this._attributes.width.copyArray(new Float32Array(this.width)),this._attributes.width.needsUpdate=!0,this._attributes.uv.copyArray(new Float32Array(this.uvs)),this._attributes.uv.needsUpdate=!0,this._attributes.index.copyArray(new Uint16Array(this.indices_array)),this._attributes.index.needsUpdate=!0),this.setAttribute("position",this._attributes.position),this.setAttribute("previous",this._attributes.previous),this.setAttribute("next",this._attributes.next),this.setAttribute("side",this._attributes.side),this.setAttribute("width",this._attributes.width),this.setAttribute("uv",this._attributes.uv),this.setAttribute("counters",this._attributes.counters),this.setIndex(this._attributes.index),this.computeBoundingSphere(),this.computeBoundingBox()};function nn(s,n,t,e,r){var i;if(s=s.subarray||s.slice?s:s.buffer,t=t.subarray||t.slice?t:t.buffer,s=n?s.subarray?s.subarray(n,r&&n+r):s.slice(n,r&&n+r):s,t.set)t.set(s,e);else for(i=0;i<s.length;i++)t[i+e]=s[i];return t}K.prototype.advance=function(s){var n=this._attributes.position.array,t=this._attributes.previous.array,e=this._attributes.next.array,r=n.length;nn(n,0,t,0,r),nn(n,6,n,0,r-6),n[r-6]=s.x,n[r-5]=s.y,n[r-4]=s.z,n[r-3]=s.x,n[r-2]=s.y,n[r-1]=s.z,nn(n,6,e,0,r-6),e[r-6]=s.x,e[r-5]=s.y,e[r-4]=s.z,e[r-3]=s.x,e[r-2]=s.y,e[r-1]=s.z,this._attributes.position.needsUpdate=!0,this._attributes.previous.needsUpdate=!0,this._attributes.next.needsUpdate=!0};_.ShaderChunk.meshline_vert=["",_.ShaderChunk.logdepthbuf_pars_vertex,_.ShaderChunk.fog_pars_vertex,"","attribute vec3 previous;","attribute vec3 next;","attribute float side;","attribute float width;","attribute float counters;","","uniform vec2 resolution;","uniform float lineWidth;","uniform vec3 color;","uniform float opacity;","uniform float sizeAttenuation;","","varying vec2 vUV;","varying vec4 vColor;","varying float vCounters;","","vec2 fix( vec4 i, float aspect ) {",""," vec2 res = i.xy / i.w;"," res.x *= aspect;"," vCounters = counters;"," return res;","","}","","void main() {",""," float aspect = resolution.x / resolution.y;",""," vColor = vec4( color, opacity );"," vUV = uv;",""," mat4 m = projectionMatrix * modelViewMatrix;"," vec4 finalPosition = m * vec4( position, 1.0 );"," vec4 prevPos = m * vec4( previous, 1.0 );"," vec4 nextPos = m * vec4( next, 1.0 );",""," vec2 currentP = fix( finalPosition, aspect );"," vec2 prevP = fix( prevPos, aspect );"," vec2 nextP = fix( nextPos, aspect );",""," float w = lineWidth * width;",""," vec2 dir;"," if( nextP == currentP ) dir = normalize( currentP - prevP );"," else if( prevP == currentP ) dir = normalize( nextP - currentP );"," else {"," vec2 dir1 = normalize( currentP - prevP );"," vec2 dir2 = normalize( nextP - currentP );"," dir = normalize( dir1 + dir2 );",""," vec2 perp = vec2( -dir1.y, dir1.x );"," vec2 miter = vec2( -dir.y, dir.x );"," //w = clamp( w / dot( miter, perp ), 0., 4. * lineWidth * width );",""," }",""," //vec2 normal = ( cross( vec3( dir, 0. ), vec3( 0., 0., 1. ) ) ).xy;"," vec4 normal = vec4( -dir.y, dir.x, 0., 1. );"," normal.xy *= .5 * w;"," normal *= projectionMatrix;"," if( sizeAttenuation == 0. ) {"," normal.xy *= finalPosition.w;"," normal.xy /= ( vec4( resolution, 0., 1. ) * projectionMatrix ).xy;"," }",""," finalPosition.xy += normal.xy * side;",""," gl_Position = finalPosition;","",_.ShaderChunk.logdepthbuf_vertex,_.ShaderChunk.fog_vertex&&" vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );",_.ShaderChunk.fog_vertex,"}"].join(`
|
|
104
104
|
`);_.ShaderChunk.meshline_frag=["",_.ShaderChunk.fog_pars_fragment,_.ShaderChunk.logdepthbuf_pars_fragment,"","uniform sampler2D map;","uniform sampler2D alphaMap;","uniform float useMap;","uniform float useAlphaMap;","uniform float useDash;","uniform float dashArray;","uniform float dashOffset;","uniform float dashRatio;","uniform float visibility;","uniform float alphaTest;","uniform vec2 repeat;","uniform float thresholdRatio;","","varying vec2 vUV;","varying vec4 vColor;","varying float vCounters;","","void main() {","",_.ShaderChunk.logdepthbuf_fragment,""," vec4 c = vColor;"," if( useMap == 1. ) c *= texture2D( map, vUV * repeat );"," if( useAlphaMap == 1. ) c.a *= texture2D( alphaMap, vUV * repeat ).a;"," if( c.a < alphaTest ) discard;"," if( useDash == 1. ){"," c.a *= ceil(mod(vCounters + dashOffset, dashArray) - (dashArray * dashRatio));"," }"," gl_FragColor = c;"," gl_FragColor.a *= step(vCounters, visibility);","",_.ShaderChunk.fog_fragment,"if (vUV.x <= thresholdRatio) {","gl_FragColor = vec4(0.0, 0.0, 0.0, 0.0);","}","}"].join(`
|
|
105
|
-
`);var $t=class extends _.ShaderMaterial{constructor(e){super({uniforms:Object.assign({},_.UniformsLib.fog,{lineWidth:{value:1},map:{value:null},useMap:{value:0},alphaMap:{value:null},useAlphaMap:{value:0},color:{value:new _.Color(16777215)},opacity:{value:1},resolution:{value:new _.Vector2(1,1)},sizeAttenuation:{value:1},dashArray:{value:0},dashOffset:{value:0},dashRatio:{value:.5},useDash:{value:0},visibility:{value:1},alphaTest:{value:0},repeat:{value:new _.Vector2(1,1)},thresholdRatio:{value:0},transparent:{value:!0},depthTest:{vale:!1},depthWrite:{value:!1}}),vertexShader:_.ShaderChunk.meshline_vert,fragmentShader:_.ShaderChunk.meshline_frag}),this.isMeshLineMaterial=!0,this.type="MeshLineMaterial",Object.defineProperties(this,{lineWidth:{enumerable:!0,get:function(){return this.uniforms.lineWidth.value},set:function(t){this.uniforms.lineWidth.value=t}},map:{enumerable:!0,get:function(){return this.uniforms.map.value},set:function(t){this.uniforms.map.value=t}},useMap:{enumerable:!0,get:function(){return this.uniforms.useMap.value},set:function(t){this.uniforms.useMap.value=t}},alphaMap:{enumerable:!0,get:function(){return this.uniforms.alphaMap.value},set:function(t){this.uniforms.alphaMap.value=t}},useAlphaMap:{enumerable:!0,get:function(){return this.uniforms.useAlphaMap.value},set:function(t){this.uniforms.useAlphaMap.value=t}},color:{enumerable:!0,get:function(){return this.uniforms.color.value},set:function(t){this.uniforms.color.value=t}},opacity:{enumerable:!0,get:function(){return this.uniforms.opacity.value},set:function(t){this.uniforms.opacity.value=t}},resolution:{enumerable:!0,get:function(){return this.uniforms.resolution.value},set:function(t){this.uniforms.resolution.value.copy(t)}},sizeAttenuation:{enumerable:!0,get:function(){return this.uniforms.sizeAttenuation.value},set:function(t){this.uniforms.sizeAttenuation.value=t}},dashArray:{enumerable:!0,get:function(){return this.uniforms.dashArray.value},set:function(t){this.uniforms.dashArray.value=t,this.useDash=t!==0?1:0}},dashOffset:{enumerable:!0,get:function(){return this.uniforms.dashOffset.value},set:function(t){this.uniforms.dashOffset.value=t}},dashRatio:{enumerable:!0,get:function(){return this.uniforms.dashRatio.value},set:function(t){this.uniforms.dashRatio.value=t}},useDash:{enumerable:!0,get:function(){return this.uniforms.useDash.value},set:function(t){this.uniforms.useDash.value=t}},visibility:{enumerable:!0,get:function(){return this.uniforms.visibility.value},set:function(t){this.uniforms.visibility.value=t}},alphaTest:{enumerable:!0,get:function(){return this.uniforms.alphaTest.value},set:function(t){this.uniforms.alphaTest.value=t}},repeat:{enumerable:!0,get:function(){return this.uniforms.repeat.value},set:function(t){this.uniforms.repeat.value.copy(t)}},thresholdRatio:{enumerable:!0,get:function(){return this.uniforms.thresholdRatio.value},set:function(t){this.uniforms.thresholdRatio.value=t}}}),this.setValues(e)}};$t.prototype.copy=function(s){return _.ShaderMaterial.prototype.copy.call(this,s),this.lineWidth=s.lineWidth,this.map=s.map,this.useMap=s.useMap,this.alphaMap=s.alphaMap,this.useAlphaMap=s.useAlphaMap,this.color.copy(s.color),this.opacity=s.opacity,this.resolution.copy(s.resolution),this.sizeAttenuation=s.sizeAttenuation,this.dashArray.copy(s.dashArray),this.dashOffset.copy(s.dashOffset),this.dashRatio.copy(s.dashRatio),this.useDash=s.useDash,this.visibility=s.visibility,this.alphaTest=s.alphaTest,this.repeat.copy(s.repeat),this};var Er="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAAAQCAMAAACROYkbAAABrVBMVEVsjPdsjPdqi/doifdpivdrjPdsjPdsjPd/m/igtfqTq/lykfdri/dsjPdtjfe/zPv8/f/w8/6zw/p0kvdri/dsjPdtjffU3vz////////3+f62xfpzkfdri/dsjPdsjPeZr/nr8P7////////4+f62xfp0kvdri/dsjPdsjPdujveXrvne5v3////////3+f63x/t2lPdri/dsjPdsjPdsjPdri/eMpfjb4/3+/v/////4+v+7yft1k/dri/dsjPdsjPdri/eJovjl6/3////////3+f6Jo/lqivdsjPdri/dvjveluPry9f7////////i6f2BnPhqi/dsjPdrjPdvjveluPrv8v7////////l6/6Uq/lsjPdsjPdsjPdvjveluPrv8v7////////m6/6Uq/lsjPdsjPdsjPdsjPeZr/nv8v7////////s8f6XrvlsjPdsjPdtjffS2/z////////w9P6bsfltjfdsjPdtjffBz/v7/P/y9f6svvpxkPdrjPdsjPdsjPd+mviftPqVrPlykfdri/dsjPdsjPdri/doifdpifdrjPdsjPclkRlrAAAAx0lEQVQ4y2NgwAsYmZhZWNkYyAfsHJxc3Dy85BvAxy8gKCQsIkq2AWLiEpJS0jKycuQaIK+gqKSsoqqmrkGmAZpa2jq6evoGhkbG5BlgYmpmbmFpZW1ja0emE+wdHJ2cXVzd3D3INMDTy9vH188/IDCIPP3BIaFh4RGRUdExseQZEBefkJiUnJKalp5BngGZWdk5uXn5BemFZAZBUXFJaVl5RSWZ9jMwVFXX1NbVNzSSq5+hqbmlta29g2z9DJ1d3T29ffhUAABKPSh5Xst3GwAAAABJRU5ErkJggg==";var br={texture_url:Er,lineWidth:8,color:16777215},Le=class extends I.Object3D{constructor(t,n){super();this.navigation=t;this.config=Object.assign({},br,n),this.registryEvent(),this.prevCameraZoom=this.navigation.bmap.context.camera.zoom}mesh=null;geometry=null;material=null;texture=null;config=br;points=[];basicRepeat=1;prevCameraZoom=0;registryEvent(){this.navigation.bmap.context.addEventListener("control-change",this.onControlChange),this.navigation.bmap.context.addEventListener("update",this.onUpdate),this.navigation.bmap.context.addEventListener("resize",this.onResize)}unRegistryEvent(){this.navigation.bmap.context.removeEventListener("control-change",this.onControlChange),this.navigation.bmap.context.removeEventListener("update",this.onUpdate),this.navigation.bmap.context.removeEventListener("resize",this.onResize)}onControlChange=()=>{let t=this.navigation.bmap.context.camera.zoom;t!==this.prevCameraZoom&&(this.prevCameraZoom=t,this.changeRepeat())};onUpdate=()=>{this.texture};onResize=()=>{if(this.material){let{width:t,height:n}=this.navigation.bmap.context.clientSize;this.material.resolution.set(t,n)}};getRepeat(){let{points:t,navigation:{bmap:{context:{camera:n,clientSize:{width:r,height:i}}}}}=this,o=t.map(([l,u])=>x(new I.Vector3(l,u,0),n,r,i)).map(({x:l,y:u})=>[l,u]);return at(o)/32}changeRepeat(){if(!this.material)return;let t=this.getRepeat();this.material.repeat=new I.Vector2(t,1)}loadTexture(t){return new Promise((n,r)=>{new I.TextureLoader().load(t,n,void 0,r)})}transformPoints(t){let n=[];for(let r=0;r<t.length;r++)n.push(...t[r],0);return n}updatePoints(t){this.points=t,this.changeRepeat();let n=this.transformPoints(t);this.geometry&&this.geometry.setPoints(n)}movePath(t){this.material&&(this.material.thresholdRatio=t)}async create(t){let n=this.geometry=new K;if(this.updatePoints(t),!this.texture){let o=this.texture=await this.loadTexture(this.config.texture_url);o.wrapS=o.wrapT=I.RepeatWrapping}let r=this.material=new $t({useMap:!0,color:new I.Color(this.config.color),transparent:!0,resolution:new I.Vector2(this.navigation.bmap.context.clientSize.width,this.navigation.bmap.context.clientSize.height),depthTest:!0,sizeAttenuation:!1,lineWidth:this.config.lineWidth*2,map:this.texture,blending:I.NormalBlending,repeat:new I.Vector2(this.getRepeat(),1)}),i=this.mesh=new I.Mesh(n,r);return i.renderOrder=9,this.add(i),i}dispose(){this.unRegistryEvent(),this.clear(),this.geometry?.dispose(),this.material?.dispose(),this.texture?.dispose()}};var Zt=g("@tweenjs/tween.js"),bt=g("three");var Sr=g("three");var Mr=g("@tweenjs/tween.js"),bi={offsetDistance:15,offsetToResetTime:3e3,directionEmitThreshold:5,simulationSpeed:1},Ne=class extends Sr.EventDispatcher{constructor(t,n){super();this.navigation=t;this.options=Object.assign({},bi,n),this.registryEvent()}offset=!1;reset=!1;position=[0,0];routeIndex=0;pointIndex=0;paths=[];options;timer=new U;resetTimer=null;tweenUtil=new zt;simulationTween;get curRoutePath(){return this.paths[this.routeIndex]||null}get curRoutePathPoints(){return this.curRoutePath?.points||[]}registryEvent(){this.navigation.bmap.context.addEventListener("update",this.onUpdate),this.navigation.addEventListener("add-path",this.onAddPaths)}unRegistryEvent(){this.navigation.bmap.context.removeEventListener("update",this.onUpdate),this.navigation.removeEventListener("add-path",this.onAddPaths)}onAddPaths=({paths:t})=>{this.paths=t,this.resetStatus(t),this.emitNavigationStatus()};onUpdate=()=>{this.tweenUtil.update()};resetStatus(t){this.offset=!1,this.reset=!1,this.routeIndex=0,t.length&&(this.position=t[0].points[0])}emitNavigationStatus(){let t=this.getNavigationInfo();t&&this.dispatchEvent({type:"navigation-info",info:t})}adsorb(t,n){let{curRoutePathPoints:r,position:i,curRoutePath:o,paths:a,routeIndex:l}=this;if(!r.length)return null;let u=r;if(i){let p=Dt(r,i);u=u.slice(p+1),u.unshift(i)}let c=[{floor:o?.floor,points:u},...a.slice(l+1)].filter(p=>p.floor===t),{distance:h,closestPoint:f,index:d,i:y}=c.reduce((p,m,b)=>{let{distance:E,closestPoint:z,index:S}=m.points.reduce((T,O,dt,St)=>{if(!St[dt+1])return T;let{distance:Wt,closestPoint:We}=Tn(n,O,St[dt+1]);return Wt<T.distance?{distance:Wt,closestPoint:We,index:dt}:T},{distance:1/0,closestPoint:m.points[0],index:0});return E<p.distance?{distance:E,closestPoint:z,index:b,i:S}:p},{distance:1/0,closestPoint:u[0],index:0,i:0});return{distance:h,closestPoint:f,routeIndex:d+l,pointIndex:d===0?y+this.pointIndex:y}}toPosition(t,n){let r=this.adsorb(t,n);if(!r)return;let{distance:i,closestPoint:o,routeIndex:a,pointIndex:l}=r;i>this.options.offsetDistance?(this.offset=!0,this.resetTimer||(this.resetTimer=this.timer.setTimeout(()=>{this.reset=!0,this.resetTimer=null},this.options.offsetToResetTime))):(this.offset=!1,this.reset=!1,this.resetTimer&&this.timer.clearTimeout(this.resetTimer)),this.routeIndex=a,this.pointIndex=l,this.position=o,this.emitNavigationStatus()}startSimulation(){this.resetStatus(this.paths),this.emitNavigationStatus(),this.startCurRouteSimulation()}async startCurRouteSimulation(){let{curRoutePath:t}=this;if(!t)return;this.simulationTween&&this.tweenUtil.remove(this.simulationTween);let n=[];return new Promise(r=>{let i=[this.position,...this.curRoutePathPoints.slice(this.pointIndex+1)],o=this.getCurRouteRemainDistance(),a=o/this.options.simulationSpeed,l=this.simulationTween=new Mr.Tween({distance:0},this.tweenUtil.group).to({distance:o},a*1e3).onUpdate(u=>{let c=ee(i,u.distance);c&&(n.push({floor:t.floor,pos:c}),this.toPosition(t.floor,c))}).onComplete(()=>{this.tweenUtil.remove(l),this.routeIndex+1<this.paths.length?(this.routeIndex++,this.position=this.paths[this.routeIndex].points[0],this.pointIndex=0,r(this.startCurRouteSimulation())):(r(!0),console.log(n))}).start()})}changeSimulationSpeed(t){this.options.simulationSpeed=t,this.startCurRouteSimulation()}getCurRouteRemainDistance(){let{curRoutePathPoints:t,pointIndex:n,position:r}=this;if(!t.length)return 0;let i=[r,...t.slice(n+1)];return at(i)}getRemainDistance(){let t=this.getCurRouteRemainDistance();return{total:this.paths.slice(this.routeIndex+1).reduce((i,o)=>i+o.distance,0)+t,curRoute:t}}getNextDirDistance(){if(!this.position)return null;let{pointIndex:t,curRoutePathPoints:n,position:r}=this,i=n[t],o=n[t+1],a=n[t+2];if(!i||!o)return null;let l=F(r,o);return t===0&&F(i,r)<5?{dir:"start",distance:l}:a?{dir:Ye(i,o,a),distance:l}:{dir:"end",distance:l}}getNavigationInfo(){let{total:t,curRoute:n}=this.getRemainDistance(),r=this.getNextDirDistance();if(!r)return null;let{dir:i,distance:o}=r;return i==="end"&&o>15&&(i="front"),i!=="start"&&o>=this.options.directionEmitThreshold&&(i="front"),{distance:t,curRouteDistance:n,nextDirDistance:o,dir:i,pos:this.position,routeIndex:this.routeIndex,offset:this.offset,reset:this.reset}}dispose(){this.timer.dispose(),this.unRegistryEvent(),this.tweenUtil.clear()}};var Si={path:{},cheapMaximumDistance:20,needStartPoi:!1,startPoi:{},positionNavigation:{},offsetY:150,directionEmitThreshold:5,disablePathAnimation:!1,speed:1},wr=class extends pt{path=null;fetchRoadStatus=!1;paths=[];curPathIndex=0;curFloorPath=null;translatePath=null;currentPathPosition=null;options;pathTween=null;startPoi=null;movedDistance=0;pathStart=[0,0];tweenUtil=new zt;animationPathOptions={cPathIndex:0};cPath=[];positionNavigation;pathMoving=!1;nextPoint=null;constructor(e,t={},n){super(e),!n&&typeof t=="object"&&(n=t),this.options=Object.assign({},Si,n);let{apiDomain:r,apiPath:{roadNetwork:i},apiInfo:o}=this.bmap.config;this.positionNavigation=new Ne(this,{simulationSpeed:this.options.speed,...this.options.positionNavigation}),this.registryEvent()}get curFloorPathLength(){return this.curFloorPath?.distance??0}get curFloorPathPoints(){return this.curFloorPath?.points??[]}registryEvent(){this.bmap.context.addEventListener("update",this.onUpdate),this.bmap.addEventListener("switch_floor_after",this.onSwitchFloor),this.positionNavigation.addEventListener("navigation-info",this.onNavigationInfo)}onNavigationInfo=({info:e})=>{if(this.dispatchEvent({type:"navigation-info",info:e}),!e.offset){if(e.routeIndex!==this.curPathIndex)return;this.pathMoving?this.nextPoint=e.pos:(this.toPositionBySpeed(e.pos,this.options.speed),this.nextPoint=null)}};pauseAnimation(){this.tweenUtil.pause(),this.positionNavigation.tweenUtil.pause()}continueAnimation(){this.tweenUtil.continue(),this.positionNavigation.tweenUtil.continue()}unRegistryEvent(){this.bmap.context.removeEventListener("update",this.onUpdate),this.bmap.removeEventListener("switch_floor_after",this.onSwitchFloor),this.positionNavigation.removeEventListener("navigation-info",this.onNavigationInfo)}onUpdate=()=>{this.tweenUtil.update()};clearPath(){this.path&&(this.bmap.context.scene.remove(this.path),this.path.dispose(),this.path=null,this.tweenUtil.clear()),this.startPoi&&(this.bmap.context.currentFloor?.poiLayer2.removePoi(this.startPoi),this.startPoi=null),this.translatePath=null}setCurFloorPath(e){e===null?(this.curFloorPath=null,this.currentPathPosition=null):(this.curFloorPath=e,this.currentPathPosition=e.points[0]),this.movedDistance=0}setCurPathIndex(e){this.curPathIndex=e,this.paths[e]?.floor===this.bmap.context.currentFloor?.name?(this.setCurFloorPath(this.paths[e]),this.renderPath(this.translatePoints(this.curFloorPathPoints))):this.clearPath()}onSwitchFloor=({data:{curFloor:e}})=>{if(this.tweenUtil.clear(),this.nextPoint=null,this.pathMoving=!1,this.paths[this.curPathIndex]){let t=this.paths[this.curPathIndex];this.setCurFloorPath(t??null),t?this.renderPath(this.translatePoints(t.points)):this.clearPath()}else this.clearPath()};addPath(e,t=0){this.paths=e,this.curPathIndex=t;let n=this.bmap.context.currentFloor?.name,r=e[t];if(n&&r?.floor===n)if(this.setCurFloorPath(r),this.bmap.currentBuildGround)this.renderPath(this.translatePoints(r.points));else{let i=()=>{this.bmap.removeEventListener("center-change",i),this.renderPath(this.translatePoints(r.points))};this.bmap.addEventListener("center-change",i)}else this.clearPath();this.dispatchEvent({type:"add-path",paths:e})}translatePoints(e){let[t,n]=this.bmap.buildingCenter;return e.map(r=>[r[0]-t,r[1]-n])}renderPath(e){this.translatePath=e;let t=this.catmullRomCurve3(e);this.cPath=t,this.animationPathOptions={cPathIndex:0},this.pathStart=t[0],this.path?this.path.updatePoints(t):(this.path=new Le(this,this.options.path),this.path.create(t),this.path.position.z=this.bmap.context.currentFloor.groundMaxHeight+.5,this.bmap.context.scene.add(this.path)),this.startPoi&&(this.bmap.context.currentFloor?.poiLayer2.removePoi(this.startPoi),this.startPoi=null),this.options.needStartPoi&&(this.startPoi=new $(this.bmap.context,{...this.options.startPoi,id:"navigation_start_poi",position:{x:t[0][0],y:t[0][1],z:.51},collision_enable:!1})||null,this.bmap.context.currentFloor?.poiLayer2.pushPoi(this.startPoi)),this.dispatchEvent({type:"render-path",path:this.path})}catmullRomCurve3(e){return wn(e,!1,!0,.1,170,2.5)}getPathDirection(){if(!this.curFloorPath||!this.currentPathPosition||this.curFloorPathPoints.length<2)return null;let e=Dt(this.curFloorPathPoints,this.currentPathPosition),t=this.curFloorPathPoints[e],n=this.curFloorPathPoints[e+1],r=new bt.Vector3(n[0]-t[0],n[1]-t[1],0).normalize(),i=new bt.Vector3(0,1,0).normalize(),o=r.angleTo(i),a=new bt.Vector3().crossVectors(i,r);return(Object.is(a.y,0)?-1:1)*o}async changeCameraToPathUp(e=100){let t=this.getPathDirection();if(t===null)return;let n=this.bmap.context.control.getAzimuthalAngle();Math.abs(n-t)>Math.PI&&(n>0?t=Math.PI*2+t:t=t-Math.PI*2);let r=Math.abs(t-this.bmap.context.control.getAzimuthalAngle());if(r<.01)return;let{control:i}=this.bmap.context,o=e/Math.PI*6*r;return new Promise(a=>{let l={azimuthal:i.getAzimuthalAngle()},u={azimuthal:t},c=new Zt.Tween(l,this.tweenUtil.group).to(u,o).easing(Zt.Easing.Quadratic.InOut).onUpdate(async()=>{i.target.copy(this.startPoi.position),i.setAzimuthalAngle(l.azimuthal,!0),i.setTargetByOffset(this.options.offsetY)}).onComplete(()=>{i.enabled=!0,this.tweenUtil.remove(c),a(!0)}).onStart(()=>{i.enabled=!1}).start()})}async initNavigationCamera(){await this.translateCameraToStartPoi(300),await this.changeCameraToPathUp(300)}async translateCameraToStartPoi(e=100){if(!this.startPoi)return;let{clientSize:{width:t,height:n},camera:r,control:i}=this.bmap.context,o=Math.round(t/2),a=Math.round(n/2),l=i.target.clone(),u=x(this.startPoi.position,r,t,n),c=u.x-o,h=a-u.y+this.options.offsetY;if(!(Math.abs(c)<1&&Math.abs(h)<1)){if(Math.abs(c)>=1){let f=new bt.Vector3;f.setFromMatrixColumn(r.matrix,0),f.normalize(),f.multiplyScalar(c/r.zoom),l.add(new bt.Vector3(f.x,0,0))}if(Math.abs(h)>=1){let f=new bt.Vector3;f.setFromMatrixColumn(r.matrix,1),f.normalize(),f.multiplyScalar(h/r.zoom),l.add(new bt.Vector3(0,f.y,0))}return this.bmap.context.setCameraPosition(l,e)}}async initCameraZoom(e=100){if(!this.startPoi)return;let{clientSize:{width:t,height:n},currentFloor:r}=this.bmap.context,{max:i,min:o}=r.box,l=Math.min(t/(i.x-o.x),n/(i.y-o.y))*(i.x-o.x)/20;return this.bmap.context.setZoom(l,this.startPoi.position,e)}toPosition(e,t){this.positionNavigation.toPosition(e,t)}startSimulation(){this.positionNavigation.startSimulation()}setSimulationSpeed(e){this.positionNavigation.changeSimulationSpeed(e)}async toPositionBySpeed(e,t){let{currentPathPosition:n,curFloorPath:r,curFloorPathPoints:i}=this;if(!r||!n)return null;let o=this.movedDistance,a=Pn(i,e);if(o===-1||a===-1||a<=o)return null;let l=a-o;if(!l)return;let u=Math.min(l/t,3);return this.pathTween&&this.tweenUtil.clear(),this.pathMoving=!0,new Promise(c=>{let h=this.pathTween=new Zt.Tween({distance:0},this.tweenUtil.group).to({distance:l},u*1e3).onUpdate(async f=>{this.moveDistance(f.distance+o,h)}).onComplete(()=>{if(this.tweenUtil.remove(h),console.log("this.nextPoint",this.nextPoint),this.nextPoint){let f=this.nextPoint;return this.nextPoint=null,this.toPositionBySpeed(f,this.options.speed)}else c(!0)}).start()}).then(()=>{this.pathMoving=!1})}async moveDistance(e,t){this.movedDistance=e,this.path?.movePath(this.movedDistance/this.curFloorPathLength);let n=ee(this.curFloorPathPoints,this.movedDistance);if(n===null)return;this.currentPathPosition=n;let r=this.translatePoints([n])[0];this.startPoi&&(this.startPoi.position.setX(r[0]).setY(r[1]),this.options.disablePathAnimation||this.bmap.context.control.setTargetByOffset(this.options.offsetY,this.startPoi.position.clone())),this.options.disablePathAnimation||(t?.pause(),this.positionNavigation.tweenUtil.pause(),await this.changeCameraToPathUp(500/this.options.speed),this.positionNavigation.tweenUtil.continue(),t?.resume())}setStartPoiRotate(e){if(this.startPoi){let n=this.bmap.context.control.getAzimuthalAngle()*180/Math.PI;this.startPoi.options.icon_rotate=e-n}}dispose(){this.tweenUtil.dispose(),this.unRegistryEvent(),this.path?.dispose(),this.startPoi?.dispose(),this.positionNavigation.dispose()}};var Cr=g("three"),Tr=class extends pt{poiLayer;floors=[];group=new Cr.Group;constructor(e){super(e),this.poiLayer=new kt(e.context)}show(e){let t=e[0].userData.height;e.forEach(i=>{i.poiLayer.pois.forEach(o=>{this.poiLayer.pushPoi(o)}),i.poiLayer.pois.length=0,i.poiLayer.dispose(),i.position.z=t,t+=i.userData.height});let{scene:n,currentFloor:r}=this.bmap.context;r&&(n.remove(r),r.dispose()),this.group.add(this.poiLayer,...e),n.add(this.group),this.floors=e,this.bmap.context.cameraBound.updateBox()}hide(){let{scene:e}=this.bmap.context;e.remove(this.group),this.poiLayer.clear(!0),this.floors.forEach(t=>{t.dispose()}),this.floors=[],this.group.clear()}fitCamera(){let{context:e,config:t,type:n}=this.bmap;e.cameraBound.setEnable(!1),e.control.minZoom=0,e.control.maxZoom=1/0,e.camera.zoom=1,e.setAzimuthalAngle(t.control.defaultAzimuthal,0),e.setPolarAngle(t.control.defaultPolar,0),e.fitCameraToObject(this.group,void 0,0);let r=e.camera.zoom;e.control.minZoom=r,e.control.maxZoom=r*25,n==="3d"&&e.fitCameraToObject(this.group,t.defaultPadding,0,!1),this.bmap.basicZoom=e.camera.zoom,e.control.addEventListener("change",this.bmap.onControlChange.bind(this.bmap)),this.bmap.onControlChange(),e.cameraBound.setEnable(!0)}dispose(){this.poiLayer.dispose(),this.floors.forEach(e=>e.dispose()),this.floors=[]}};var Ar=g("three");function Kt(s){let e=new Blob([s],{type:"text/javascript"}),t=URL.createObjectURL(e),n=new Worker(t);return URL.revokeObjectURL(t),n}function rn(){return Kt(`var RP=Object.create;var Zd=Object.defineProperty,LP=Object.defineProperties,NP=Object.getOwnPropertyDescriptor,OP=Object.getOwnPropertyDescriptors,DP=Object.getOwnPropertyNames,Wv=Object.getOwnPropertySymbols,FP=Object.getPrototypeOf,qv=Object.prototype.hasOwnProperty,UP=Object.prototype.propertyIsEnumerable;var $d=(r,t,e)=>t in r?Zd(r,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[t]=e,Wc=(r,t)=>{for(var e in t||(t={}))qv.call(t,e)&&$d(r,e,t[e]);if(Wv)for(var e of Wv(t))UP.call(t,e)&&$d(r,e,t[e]);return r},Xv=(r,t)=>LP(r,OP(t));var ye=(r,t)=>()=>(t||r((t={exports:{}}).exports,t),t.exports);var BP=(r,t,e,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of DP(t))!qv.call(r,a)&&a!==e&&Zd(r,a,{get:()=>t[a],enumerable:!(o=NP(t,a))||o.enumerable});return r};var Er=(r,t,e)=>(e=r!=null?RP(FP(r)):{},BP(t||!r||!r.__esModule?Zd(e,"default",{value:r,enumerable:!0}):e,r));var Ei=(r,t,e)=>$d(r,typeof t!="symbol"?t+"":t,e);var $v=ye((lz,Yv)=>{var Jd=class{constructor(){this.keys=new Set,this.queue=[]}sort(){this.queue.sort((t,e)=>t.priority-e.priority)}set(t,e){let o=Number(e);if(isNaN(o))throw new TypeError('"priority" must be a number');return this.keys.has(t)?this.queue.map(a=>(a.key===t&&Object.assign(a,{priority:o}),a)):(this.keys.add(t),this.queue.push({key:t,priority:o})),this.sort(),this.queue.length}next(){let t=this.queue.shift();return this.keys.delete(t.key),t}isEmpty(){return this.queue.length===0}has(t){return this.keys.has(t)}get(t){return this.queue.find(e=>e.key===t)}};Yv.exports=Jd});var Kv=ye((cz,Jv)=>{function Zv(r,t){let e=new Map;for(let[o,a]of r)o!==t&&a instanceof Map?e.set(o,Zv(a,t)):o!==t&&e.set(o,a);return e}Jv.exports=Zv});var t_=ye((fz,jv)=>{function zP(r){let t=Number(r);return!(isNaN(t)||t<=0)}function Qv(r){let t=new Map;return Object.keys(r).forEach(o=>{let a=r[o];if(a!==null&&typeof a=="object"&&!Array.isArray(a))return t.set(o,Qv(a));if(!zP(a))throw new Error(\`Could not add node at key "\${o}", make sure it's a valid node\`,a);return t.set(o,Number(a))}),t}jv.exports=Qv});var r_=ye((hz,n_)=>{function e_(r){if(!(r instanceof Map))throw new Error(\`Invalid graph: Expected Map instead found \${typeof r}\`);r.forEach((t,e)=>{if(typeof t=="object"&&t instanceof Map){e_(t);return}if(typeof t!="number"||t<=0)throw new Error(\`Values must be numbers greater than 0. Found value \${t} at \${e}\`)})}n_.exports=e_});var a_=ye((pz,s_)=>{var kP=$v(),GP=Kv(),i_=t_(),o_=r_(),Kd=class{constructor(t){t instanceof Map?(o_(t),this.graph=t):t?this.graph=i_(t):this.graph=new Map}addNode(t,e){let o;return e instanceof Map?(o_(e),o=e):o=i_(e),this.graph.set(t,o),this}addVertex(t,e){return this.addNode(t,e)}removeNode(t){return this.graph=GP(this.graph,t),this}path(t,e,o={}){if(!this.graph.size)return o.cost?{path:null,cost:0}:null;let a=new Set,c=new kP,p=new Map,d=[],g=0,y=[];if(o.avoid&&(y=[].concat(o.avoid)),y.includes(t))throw new Error(\`Starting node (\${t}) cannot be avoided\`);if(y.includes(e))throw new Error(\`Ending node (\${e}) cannot be avoided\`);for(c.set(t,0);!c.isEmpty();){let _=c.next();if(_.key===e){g=_.priority;let x=_.key;for(;p.has(x);)d.push(x),x=p.get(x);break}a.add(_.key),(this.graph.get(_.key)||new Map).forEach((x,T)=>{if(a.has(T)||y.includes(T))return null;if(!c.has(T))return p.set(T,_.key),c.set(T,_.priority+x);let C=c.get(T).priority,I=_.priority+x;return I<C?(p.set(T,_.key),c.set(T,I)):null})}return d.length?(o.trim?d.shift():d=d.concat([t]),o.reverse||(d=d.reverse()),o.cost?{path:d,cost:g}:d):o.cost?{path:null,cost:0}:null}shortestPath(...t){return this.path(...t)}};s_.exports=Kd});var tp=ye((wz,K1)=>{"use strict";var J1=Object.getOwnPropertySymbols,HO=Object.prototype.hasOwnProperty,VO=Object.prototype.propertyIsEnumerable;function WO(r){if(r==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(r)}function qO(){try{if(!Object.assign)return!1;var r=new String("abc");if(r[5]="de",Object.getOwnPropertyNames(r)[0]==="5")return!1;for(var t={},e=0;e<10;e++)t["_"+String.fromCharCode(e)]=e;var o=Object.getOwnPropertyNames(t).map(function(c){return t[c]});if(o.join("")!=="0123456789")return!1;var a={};return"abcdefghijklmnopqrst".split("").forEach(function(c){a[c]=c}),Object.keys(Object.assign({},a)).join("")==="abcdefghijklmnopqrst"}catch(c){return!1}}K1.exports=qO()?Object.assign:function(r,t){for(var e,o=WO(r),a,c=1;c<arguments.length;c++){e=Object(arguments[c]);for(var p in e)HO.call(e,p)&&(o[p]=e[p]);if(J1){a=J1(e);for(var d=0;d<a.length;d++)VO.call(e,a[d])&&(o[a[d]]=e[a[d]])}}return o}});var Mm=ye((Em,wm)=>{(function(r,t){typeof Em=="object"&&typeof wm!="undefined"?wm.exports=t():typeof define=="function"&&define.amd?define(t):(r=r||self).RBush=t()})(Em,function(){"use strict";function r(M,E,L,A,z){(function G(Y,X,U,H,Q){for(;H>U;){if(H-U>600){var gt=H-U+1,$=X-U+1,Nt=Math.log(gt),j=.5*Math.exp(2*Nt/3),pt=.5*Math.sqrt(Nt*j*(gt-j)/gt)*($-gt/2<0?-1:1),Ct=Math.max(U,Math.floor(X-$*j/gt+pt)),Tt=Math.min(H,Math.floor(X+(gt-$)*j/gt+pt));G(Y,X,Ct,Tt,Q)}var ft=Y[X],dt=U,Z=H;for(t(Y,U,X),Q(Y[H],ft)>0&&t(Y,U,H);dt<Z;){for(t(Y,dt,Z),dt++,Z--;Q(Y[dt],ft)<0;)dt++;for(;Q(Y[Z],ft)>0;)Z--}Q(Y[U],ft)===0?t(Y,U,Z):t(Y,++Z,H),Z<=X&&(U=Z+1),X<=Z&&(H=Z-1)}})(M,E,L||0,A||M.length-1,z||e)}function t(M,E,L){var A=M[E];M[E]=M[L],M[L]=A}function e(M,E){return M<E?-1:M>E?1:0}var o=function(M){M===void 0&&(M=9),this._maxEntries=Math.max(4,M),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()};function a(M,E,L){if(!L)return E.indexOf(M);for(var A=0;A<E.length;A++)if(L(M,E[A]))return A;return-1}function c(M,E){p(M,0,M.children.length,E,M)}function p(M,E,L,A,z){z||(z=C(null)),z.minX=1/0,z.minY=1/0,z.maxX=-1/0,z.maxY=-1/0;for(var G=E;G<L;G++){var Y=M.children[G];d(z,M.leaf?A(Y):Y)}return z}function d(M,E){return M.minX=Math.min(M.minX,E.minX),M.minY=Math.min(M.minY,E.minY),M.maxX=Math.max(M.maxX,E.maxX),M.maxY=Math.max(M.maxY,E.maxY),M}function g(M,E){return M.minX-E.minX}function y(M,E){return M.minY-E.minY}function _(M){return(M.maxX-M.minX)*(M.maxY-M.minY)}function w(M){return M.maxX-M.minX+(M.maxY-M.minY)}function x(M,E){return M.minX<=E.minX&&M.minY<=E.minY&&E.maxX<=M.maxX&&E.maxY<=M.maxY}function T(M,E){return E.minX<=M.maxX&&E.minY<=M.maxY&&E.maxX>=M.minX&&E.maxY>=M.minY}function C(M){return{children:M,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function I(M,E,L,A,z){for(var G=[E,L];G.length;)if(!((L=G.pop())-(E=G.pop())<=A)){var Y=E+Math.ceil((L-E)/A/2)*A;r(M,Y,E,L,z),G.push(E,Y,Y,L)}}return o.prototype.all=function(){return this._all(this.data,[])},o.prototype.search=function(M){var E=this.data,L=[];if(!T(M,E))return L;for(var A=this.toBBox,z=[];E;){for(var G=0;G<E.children.length;G++){var Y=E.children[G],X=E.leaf?A(Y):Y;T(M,X)&&(E.leaf?L.push(Y):x(M,X)?this._all(Y,L):z.push(Y))}E=z.pop()}return L},o.prototype.collides=function(M){var E=this.data;if(!T(M,E))return!1;for(var L=[];E;){for(var A=0;A<E.children.length;A++){var z=E.children[A],G=E.leaf?this.toBBox(z):z;if(T(M,G)){if(E.leaf||x(M,G))return!0;L.push(z)}}E=L.pop()}return!1},o.prototype.load=function(M){if(!M||!M.length)return this;if(M.length<this._minEntries){for(var E=0;E<M.length;E++)this.insert(M[E]);return this}var L=this._build(M.slice(),0,M.length-1,0);if(this.data.children.length)if(this.data.height===L.height)this._splitRoot(this.data,L);else{if(this.data.height<L.height){var A=this.data;this.data=L,L=A}this._insert(L,this.data.height-L.height-1,!0)}else this.data=L;return this},o.prototype.insert=function(M){return M&&this._insert(M,this.data.height-1),this},o.prototype.clear=function(){return this.data=C([]),this},o.prototype.remove=function(M,E){if(!M)return this;for(var L,A,z,G=this.data,Y=this.toBBox(M),X=[],U=[];G||X.length;){if(G||(G=X.pop(),A=X[X.length-1],L=U.pop(),z=!0),G.leaf){var H=a(M,G.children,E);if(H!==-1)return G.children.splice(H,1),X.push(G),this._condense(X),this}z||G.leaf||!x(G,Y)?A?(L++,G=A.children[L],z=!1):G=null:(X.push(G),U.push(L),L=0,A=G,G=G.children[0])}return this},o.prototype.toBBox=function(M){return M},o.prototype.compareMinX=function(M,E){return M.minX-E.minX},o.prototype.compareMinY=function(M,E){return M.minY-E.minY},o.prototype.toJSON=function(){return this.data},o.prototype.fromJSON=function(M){return this.data=M,this},o.prototype._all=function(M,E){for(var L=[];M;)M.leaf?E.push.apply(E,M.children):L.push.apply(L,M.children),M=L.pop();return E},o.prototype._build=function(M,E,L,A){var z,G=L-E+1,Y=this._maxEntries;if(G<=Y)return c(z=C(M.slice(E,L+1)),this.toBBox),z;A||(A=Math.ceil(Math.log(G)/Math.log(Y)),Y=Math.ceil(G/Math.pow(Y,A-1))),(z=C([])).leaf=!1,z.height=A;var X=Math.ceil(G/Y),U=X*Math.ceil(Math.sqrt(Y));I(M,E,L,U,this.compareMinX);for(var H=E;H<=L;H+=U){var Q=Math.min(H+U-1,L);I(M,H,Q,X,this.compareMinY);for(var gt=H;gt<=Q;gt+=X){var $=Math.min(gt+X-1,Q);z.children.push(this._build(M,gt,$,A-1))}}return c(z,this.toBBox),z},o.prototype._chooseSubtree=function(M,E,L,A){for(;A.push(E),!E.leaf&&A.length-1!==L;){for(var z=1/0,G=1/0,Y=void 0,X=0;X<E.children.length;X++){var U=E.children[X],H=_(U),Q=(gt=M,$=U,(Math.max($.maxX,gt.maxX)-Math.min($.minX,gt.minX))*(Math.max($.maxY,gt.maxY)-Math.min($.minY,gt.minY))-H);Q<G?(G=Q,z=H<z?H:z,Y=U):Q===G&&H<z&&(z=H,Y=U)}E=Y||E.children[0]}var gt,$;return E},o.prototype._insert=function(M,E,L){var A=L?M:this.toBBox(M),z=[],G=this._chooseSubtree(A,this.data,E,z);for(G.children.push(M),d(G,A);E>=0&&z[E].children.length>this._maxEntries;)this._split(z,E),E--;this._adjustParentBBoxes(A,z,E)},o.prototype._split=function(M,E){var L=M[E],A=L.children.length,z=this._minEntries;this._chooseSplitAxis(L,z,A);var G=this._chooseSplitIndex(L,z,A),Y=C(L.children.splice(G,L.children.length-G));Y.height=L.height,Y.leaf=L.leaf,c(L,this.toBBox),c(Y,this.toBBox),E?M[E-1].children.push(Y):this._splitRoot(L,Y)},o.prototype._splitRoot=function(M,E){this.data=C([M,E]),this.data.height=M.height+1,this.data.leaf=!1,c(this.data,this.toBBox)},o.prototype._chooseSplitIndex=function(M,E,L){for(var A,z,G,Y,X,U,H,Q=1/0,gt=1/0,$=E;$<=L-E;$++){var Nt=p(M,0,$,this.toBBox),j=p(M,$,L,this.toBBox),pt=(z=Nt,G=j,Y=void 0,X=void 0,U=void 0,H=void 0,Y=Math.max(z.minX,G.minX),X=Math.max(z.minY,G.minY),U=Math.min(z.maxX,G.maxX),H=Math.min(z.maxY,G.maxY),Math.max(0,U-Y)*Math.max(0,H-X)),Ct=_(Nt)+_(j);pt<Q?(Q=pt,A=$,gt=Ct<gt?Ct:gt):pt===Q&&Ct<gt&&(gt=Ct,A=$)}return A||L-E},o.prototype._chooseSplitAxis=function(M,E,L){var A=M.leaf?this.compareMinX:g,z=M.leaf?this.compareMinY:y;this._allDistMargin(M,E,L,A)<this._allDistMargin(M,E,L,z)&&M.children.sort(A)},o.prototype._allDistMargin=function(M,E,L,A){M.children.sort(A);for(var z=this.toBBox,G=p(M,0,E,z),Y=p(M,L-E,L,z),X=w(G)+w(Y),U=E;U<L-E;U++){var H=M.children[U];d(G,M.leaf?z(H):H),X+=w(G)}for(var Q=L-E-1;Q>=E;Q--){var gt=M.children[Q];d(Y,M.leaf?z(gt):gt),X+=w(Y)}return X},o.prototype._adjustParentBBoxes=function(M,E,L){for(var A=L;A>=0;A--)d(E[A],M)},o.prototype._condense=function(M){for(var E=M.length-1,L=void 0;E>=0;E--)M[E].children.length===0?E>0?(L=M[E-1].children).splice(L.indexOf(M[E]),1):this.clear():c(M[E],this.toBBox)},o})});var Q1=ye((Sm,bm)=>{(function(r,t){typeof Sm=="object"&&typeof bm!="undefined"?bm.exports=t():typeof define=="function"&&define.amd?define(t):(r=r||self,r.TinyQueue=t())})(Sm,function(){"use strict";var r=function(o,a){if(o===void 0&&(o=[]),a===void 0&&(a=t),this.data=o,this.length=this.data.length,this.compare=a,this.length>0)for(var c=(this.length>>1)-1;c>=0;c--)this._down(c)};r.prototype.push=function(o){this.data.push(o),this.length++,this._up(this.length-1)},r.prototype.pop=function(){if(this.length!==0){var o=this.data[0],a=this.data.pop();return this.length--,this.length>0&&(this.data[0]=a,this._down(0)),o}},r.prototype.peek=function(){return this.data[0]},r.prototype._up=function(o){for(var a=this,c=a.data,p=a.compare,d=c[o];o>0;){var g=o-1>>1,y=c[g];if(p(d,y)>=0)break;c[o]=y,o=g}c[o]=d},r.prototype._down=function(o){for(var a=this,c=a.data,p=a.compare,d=this.length>>1,g=c[o];o<d;){var y=(o<<1)+1,_=c[y],w=y+1;if(w<this.length&&p(c[w],_)<0&&(y=w,_=c[w]),p(_,g)>=0)break;c[o]=_,o=y}c[o]=g};function t(e,o){return e<o?-1:e>o?1:0}return r})});var tx=ye((Cz,j1)=>{j1.exports=function(t,e,o,a){var c=t[0],p=t[1],d=!1;o===void 0&&(o=0),a===void 0&&(a=e.length);for(var g=(a-o)/2,y=0,_=g-1;y<g;_=y++){var w=e[o+y*2+0],x=e[o+y*2+1],T=e[o+_*2+0],C=e[o+_*2+1],I=x>p!=C>p&&c<(T-w)*(p-x)/(C-x)+w;I&&(d=!d)}return d}});var nx=ye((Pz,ex)=>{ex.exports=function(t,e,o,a){var c=t[0],p=t[1],d=!1;o===void 0&&(o=0),a===void 0&&(a=e.length);for(var g=a-o,y=0,_=g-1;y<g;_=y++){var w=e[y+o][0],x=e[y+o][1],T=e[_+o][0],C=e[_+o][1],I=x>p!=C>p&&c<(T-w)*(p-x)/(C-x)+w;I&&(d=!d)}return d}});var ox=ye((Iz,rp)=>{var rx=tx(),ix=nx();rp.exports=function(t,e,o,a){return e.length>0&&Array.isArray(e[0])?ix(t,e,o,a):rx(t,e,o,a)};rp.exports.nested=ix;rp.exports.flat=rx});var ax=ye((ip,sx)=>{(function(r,t){typeof ip=="object"&&typeof sx!="undefined"?t(ip):typeof define=="function"&&define.amd?define(["exports"],t):t((r=r||self).predicates={})})(ip,function(r){"use strict";let e=33306690738754706e-32;function o(T,C,I,M,E){let L,A,z,G,Y=C[0],X=M[0],U=0,H=0;X>Y==X>-Y?(L=Y,Y=C[++U]):(L=X,X=M[++H]);let Q=0;if(U<T&&H<I)for(X>Y==X>-Y?(z=L-((A=Y+L)-Y),Y=C[++U]):(z=L-((A=X+L)-X),X=M[++H]),L=A,z!==0&&(E[Q++]=z);U<T&&H<I;)X>Y==X>-Y?(z=L-((A=L+Y)-(G=A-L))+(Y-G),Y=C[++U]):(z=L-((A=L+X)-(G=A-L))+(X-G),X=M[++H]),L=A,z!==0&&(E[Q++]=z);for(;U<T;)z=L-((A=L+Y)-(G=A-L))+(Y-G),Y=C[++U],L=A,z!==0&&(E[Q++]=z);for(;H<I;)z=L-((A=L+X)-(G=A-L))+(X-G),X=M[++H],L=A,z!==0&&(E[Q++]=z);return L===0&&Q!==0||(E[Q++]=L),Q}function a(T){return new Float64Array(T)}let c=33306690738754716e-32,p=22204460492503146e-32,d=11093356479670487e-47,g=a(4),y=a(8),_=a(12),w=a(16),x=a(4);r.orient2d=function(T,C,I,M,E,L){let A=(C-L)*(I-E),z=(T-E)*(M-L),G=A-z;if(A===0||z===0||A>0!=z>0)return G;let Y=Math.abs(A+z);return Math.abs(G)>=c*Y?G:-function(X,U,H,Q,gt,$,Nt){let j,pt,Ct,Tt,ft,dt,Z,st,vt,zt,bt,qt,le,se,Zt,_e,Vt,pe,at=X-gt,He=H-gt,ae=U-$,ce=Q-$;ft=(Zt=(st=at-(Z=(dt=134217729*at)-(dt-at)))*(zt=ce-(vt=(dt=134217729*ce)-(dt-ce)))-((se=at*ce)-Z*vt-st*vt-Z*zt))-(bt=Zt-(Vt=(st=ae-(Z=(dt=134217729*ae)-(dt-ae)))*(zt=He-(vt=(dt=134217729*He)-(dt-He)))-((_e=ae*He)-Z*vt-st*vt-Z*zt))),g[0]=Zt-(bt+ft)+(ft-Vt),ft=(le=se-((qt=se+bt)-(ft=qt-se))+(bt-ft))-(bt=le-_e),g[1]=le-(bt+ft)+(ft-_e),ft=(pe=qt+bt)-qt,g[2]=qt-(pe-ft)+(bt-ft),g[3]=pe;let fe=function(J,rt){let D=rt[0];for(let N=1;N<J;N++)D+=rt[N];return D}(4,g),it=p*Nt;if(fe>=it||-fe>=it||(j=X-(at+(ft=X-at))+(ft-gt),Ct=H-(He+(ft=H-He))+(ft-gt),pt=U-(ae+(ft=U-ae))+(ft-$),Tt=Q-(ce+(ft=Q-ce))+(ft-$),j===0&&pt===0&&Ct===0&&Tt===0)||(it=d*Nt+e*Math.abs(fe),(fe+=at*Tt+ce*j-(ae*Ct+He*pt))>=it||-fe>=it))return fe;ft=(Zt=(st=j-(Z=(dt=134217729*j)-(dt-j)))*(zt=ce-(vt=(dt=134217729*ce)-(dt-ce)))-((se=j*ce)-Z*vt-st*vt-Z*zt))-(bt=Zt-(Vt=(st=pt-(Z=(dt=134217729*pt)-(dt-pt)))*(zt=He-(vt=(dt=134217729*He)-(dt-He)))-((_e=pt*He)-Z*vt-st*vt-Z*zt))),x[0]=Zt-(bt+ft)+(ft-Vt),ft=(le=se-((qt=se+bt)-(ft=qt-se))+(bt-ft))-(bt=le-_e),x[1]=le-(bt+ft)+(ft-_e),ft=(pe=qt+bt)-qt,x[2]=qt-(pe-ft)+(bt-ft),x[3]=pe;let B=o(4,g,4,x,y);ft=(Zt=(st=at-(Z=(dt=134217729*at)-(dt-at)))*(zt=Tt-(vt=(dt=134217729*Tt)-(dt-Tt)))-((se=at*Tt)-Z*vt-st*vt-Z*zt))-(bt=Zt-(Vt=(st=ae-(Z=(dt=134217729*ae)-(dt-ae)))*(zt=Ct-(vt=(dt=134217729*Ct)-(dt-Ct)))-((_e=ae*Ct)-Z*vt-st*vt-Z*zt))),x[0]=Zt-(bt+ft)+(ft-Vt),ft=(le=se-((qt=se+bt)-(ft=qt-se))+(bt-ft))-(bt=le-_e),x[1]=le-(bt+ft)+(ft-_e),ft=(pe=qt+bt)-qt,x[2]=qt-(pe-ft)+(bt-ft),x[3]=pe;let P=o(B,y,4,x,_);ft=(Zt=(st=j-(Z=(dt=134217729*j)-(dt-j)))*(zt=Tt-(vt=(dt=134217729*Tt)-(dt-Tt)))-((se=j*Tt)-Z*vt-st*vt-Z*zt))-(bt=Zt-(Vt=(st=pt-(Z=(dt=134217729*pt)-(dt-pt)))*(zt=Ct-(vt=(dt=134217729*Ct)-(dt-Ct)))-((_e=pt*Ct)-Z*vt-st*vt-Z*zt))),x[0]=Zt-(bt+ft)+(ft-Vt),ft=(le=se-((qt=se+bt)-(ft=qt-se))+(bt-ft))-(bt=le-_e),x[1]=le-(bt+ft)+(ft-_e),ft=(pe=qt+bt)-qt,x[2]=qt-(pe-ft)+(bt-ft),x[3]=pe;let F=o(P,_,4,x,w);return w[F-1]}(T,C,I,M,E,L,Y)},r.orient2dfast=function(T,C,I,M,E,L){return(C-L)*(I-E)-(T-E)*(M-L)},Object.defineProperty(r,"__esModule",{value:!0})})});var px=ye((Rz,Pm)=>{"use strict";var ux=Mm(),sp=Q1(),YO=ox(),$O=ax().orient2d;sp.default&&(sp=sp.default);Pm.exports=hx;Pm.exports.default=hx;function hx(r,t,e){t=Math.max(0,t===void 0?2:t),e=e||0;var o=jO(r),a=new ux(16);a.toBBox=function(L){return{minX:L[0],minY:L[1],maxX:L[0],maxY:L[1]}},a.compareMinX=function(L,A){return L[0]-A[0]},a.compareMinY=function(L,A){return L[1]-A[1]},a.load(r);for(var c=[],p=0,d;p<o.length;p++){var g=o[p];a.remove(g),d=fx(g,d),c.push(d)}var y=new ux(16);for(p=0;p<c.length;p++)y.insert(Tm(c[p]));for(var _=t*t,w=e*e;c.length;){var x=c.shift(),T=x.p,C=x.next.p,I=Am(T,C);if(!(I<w)){var M=I/_;g=ZO(a,x.prev.p,T,C,x.next.next.p,M,y),g&&Math.min(Am(g,T),Am(g,C))<=M&&(c.push(x),c.push(fx(g,x)),a.remove(g),y.remove(x),y.insert(Tm(x)),y.insert(Tm(x.next)))}}x=d;var E=[];do E.push(x.p),x=x.next;while(x!==d);return E.push(x.p),E}function ZO(r,t,e,o,a,c,p){for(var d=new sp([],JO),g=r.data;g;){for(var y=0;y<g.children.length;y++){var _=g.children[y],w=g.leaf?Cm(_,e,o):KO(e,o,_);w>c||d.push({node:_,dist:w})}for(;d.length&&!d.peek().node.children;){var x=d.pop(),T=x.node,C=Cm(T,t,e),I=Cm(T,o,a);if(x.dist<C&&x.dist<I&&cx(e,T,p)&&cx(o,T,p))return T}g=d.pop(),g&&(g=g.node)}return null}function JO(r,t){return r.dist-t.dist}function KO(r,t,e){if(lx(r,e)||lx(t,e))return 0;var o=op(r[0],r[1],t[0],t[1],e.minX,e.minY,e.maxX,e.minY);if(o===0)return 0;var a=op(r[0],r[1],t[0],t[1],e.minX,e.minY,e.minX,e.maxY);if(a===0)return 0;var c=op(r[0],r[1],t[0],t[1],e.maxX,e.minY,e.maxX,e.maxY);if(c===0)return 0;var p=op(r[0],r[1],t[0],t[1],e.minX,e.maxY,e.maxX,e.maxY);return p===0?0:Math.min(o,a,c,p)}function lx(r,t){return r[0]>=t.minX&&r[0]<=t.maxX&&r[1]>=t.minY&&r[1]<=t.maxY}function cx(r,t,e){for(var o=Math.min(r[0],t[0]),a=Math.min(r[1],t[1]),c=Math.max(r[0],t[0]),p=Math.max(r[1],t[1]),d=e.search({minX:o,minY:a,maxX:c,maxY:p}),g=0;g<d.length;g++)if(QO(d[g].p,d[g].next.p,r,t))return!1;return!0}function rc(r,t,e){return $O(r[0],r[1],t[0],t[1],e[0],e[1])}function QO(r,t,e,o){return r!==o&&t!==e&&rc(r,t,e)>0!=rc(r,t,o)>0&&rc(e,o,r)>0!=rc(e,o,t)>0}function Tm(r){var t=r.p,e=r.next.p;return r.minX=Math.min(t[0],e[0]),r.minY=Math.min(t[1],e[1]),r.maxX=Math.max(t[0],e[0]),r.maxY=Math.max(t[1],e[1]),r}function jO(r){for(var t=r[0],e=r[0],o=r[0],a=r[0],c=0;c<r.length;c++){var p=r[c];p[0]<t[0]&&(t=p),p[0]>o[0]&&(o=p),p[1]<e[1]&&(e=p),p[1]>a[1]&&(a=p)}var d=[t,e,o,a],g=d.slice();for(c=0;c<r.length;c++)YO(r[c],d)||g.push(r[c]);return eD(g)}function fx(r,t){var e={p:r,prev:null,next:null,minX:0,minY:0,maxX:0,maxY:0};return t?(e.next=t.next,e.prev=t,t.next.prev=e,t.next=e):(e.prev=e,e.next=e),e}function Am(r,t){var e=r[0]-t[0],o=r[1]-t[1];return e*e+o*o}function Cm(r,t,e){var o=t[0],a=t[1],c=e[0]-o,p=e[1]-a;if(c!==0||p!==0){var d=((r[0]-o)*c+(r[1]-a)*p)/(c*c+p*p);d>1?(o=e[0],a=e[1]):d>0&&(o+=c*d,a+=p*d)}return c=r[0]-o,p=r[1]-a,c*c+p*p}function op(r,t,e,o,a,c,p,d){var g=e-r,y=o-t,_=p-a,w=d-c,x=r-a,T=t-c,C=g*g+y*y,I=g*_+y*w,M=_*_+w*w,E=g*x+y*T,L=_*x+w*T,A=C*M-I*I,z,G,Y,X,U=A,H=A;A===0?(G=0,U=1,X=L,H=M):(G=I*L-M*E,X=C*L-I*E,G<0?(G=0,X=L,H=M):G>U&&(G=U,X=L+I,H=M)),X<0?(X=0,-E<0?G=0:-E>C?G=U:(G=-E,U=C)):X>H&&(X=H,-E+I<0?G=0:-E+I>C?G=U:(G=-E+I,U=C)),z=G===0?0:G/U,Y=X===0?0:X/H;var Q=(1-z)*r+z*e,gt=(1-z)*t+z*o,$=(1-Y)*a+Y*p,Nt=(1-Y)*c+Y*d,j=$-Q,pt=Nt-gt;return j*j+pt*pt}function tD(r,t){return r[0]===t[0]?r[1]-t[1]:r[0]-t[0]}function eD(r){r.sort(tD);for(var t=[],e=0;e<r.length;e++){for(;t.length>=2&&rc(t[t.length-2],t[t.length-1],r[e])<=0;)t.pop();t.push(r[e])}for(var o=[],a=r.length-1;a>=0;a--){for(;o.length>=2&&rc(o[o.length-2],o[o.length-1],r[a])<=0;)o.pop();o.push(r[a])}return o.pop(),t.pop(),t.concat(o)}});var _x=ye((Rm,Lm)=>{(function(r,t){typeof Rm=="object"&&typeof Lm!="undefined"?Lm.exports=t():typeof define=="function"&&define.amd?define(t):r.quickselect=t()})(Rm,function(){"use strict";function r(a,c,p,d,g){t(a,c,p||0,d||a.length-1,g||o)}function t(a,c,p,d,g){for(;d>p;){if(d-p>600){var y=d-p+1,_=c-p+1,w=Math.log(y),x=.5*Math.exp(2*w/3),T=.5*Math.sqrt(w*x*(y-x)/y)*(_-y/2<0?-1:1),C=Math.max(p,Math.floor(c-_*x/y+T)),I=Math.min(d,Math.floor(c+(y-_)*x/y+T));t(a,c,C,I,g)}var M=a[c],E=p,L=d;for(e(a,p,c),g(a[d],M)>0&&e(a,p,d);E<L;){for(e(a,E,L),E++,L--;g(a[E],M)<0;)E++;for(;g(a[L],M)>0;)L--}g(a[p],M)===0?e(a,p,L):(L++,e(a,L,d)),L<=c&&(p=L+1),c<=L&&(d=L-1)}}function e(a,c,p){var d=a[c];a[c]=a[p],a[p]=d}function o(a,c){return a<c?-1:a>c?1:0}return r})});var Fm=ye((rG,Dm)=>{"use strict";Dm.exports=uf;Dm.exports.default=uf;var dD=_x();function uf(r,t){if(!(this instanceof uf))return new uf(r,t);this._maxEntries=Math.max(4,r||9),this._minEntries=Math.max(2,Math.ceil(this._maxEntries*.4)),t&&this._initFormat(t),this.clear()}uf.prototype={all:function(){return this._all(this.data,[])},search:function(r){var t=this.data,e=[],o=this.toBBox;if(!up(r,t))return e;for(var a=[],c,p,d,g;t;){for(c=0,p=t.children.length;c<p;c++)d=t.children[c],g=t.leaf?o(d):d,up(r,g)&&(t.leaf?e.push(d):Om(r,g)?this._all(d,e):a.push(d));t=a.pop()}return e},collides:function(r){var t=this.data,e=this.toBBox;if(!up(r,t))return!1;for(var o=[],a,c,p,d;t;){for(a=0,c=t.children.length;a<c;a++)if(p=t.children[a],d=t.leaf?e(p):p,up(r,d)){if(t.leaf||Om(r,d))return!0;o.push(p)}t=o.pop()}return!1},load:function(r){if(!(r&&r.length))return this;if(r.length<this._minEntries){for(var t=0,e=r.length;t<e;t++)this.insert(r[t]);return this}var o=this._build(r.slice(),0,r.length-1,0);if(!this.data.children.length)this.data=o;else if(this.data.height===o.height)this._splitRoot(this.data,o);else{if(this.data.height<o.height){var a=this.data;this.data=o,o=a}this._insert(o,this.data.height-o.height-1,!0)}return this},insert:function(r){return r&&this._insert(r,this.data.height-1),this},clear:function(){return this.data=sc([]),this},remove:function(r,t){if(!r)return this;for(var e=this.data,o=this.toBBox(r),a=[],c=[],p,d,g,y;e||a.length;){if(e||(e=a.pop(),d=a[a.length-1],p=c.pop(),y=!0),e.leaf&&(g=gD(r,e.children,t),g!==-1))return e.children.splice(g,1),a.push(e),this._condense(a),this;!y&&!e.leaf&&Om(e,o)?(a.push(e),c.push(p),p=0,d=e,e=e.children[0]):d?(p++,e=d.children[p],y=!1):e=null}return this},toBBox:function(r){return r},compareMinX:xx,compareMinY:Ex,toJSON:function(){return this.data},fromJSON:function(r){return this.data=r,this},_all:function(r,t){for(var e=[];r;)r.leaf?t.push.apply(t,r.children):e.push.apply(e,r.children),r=e.pop();return t},_build:function(r,t,e,o){var a=e-t+1,c=this._maxEntries,p;if(a<=c)return p=sc(r.slice(t,e+1)),oc(p,this.toBBox),p;o||(o=Math.ceil(Math.log(a)/Math.log(c)),c=Math.ceil(a/Math.pow(c,o-1))),p=sc([]),p.leaf=!1,p.height=o;var d=Math.ceil(a/c),g=d*Math.ceil(Math.sqrt(c)),y,_,w,x;for(wx(r,t,e,g,this.compareMinX),y=t;y<=e;y+=g)for(w=Math.min(y+g-1,e),wx(r,y,w,d,this.compareMinY),_=y;_<=w;_+=d)x=Math.min(_+d-1,w),p.children.push(this._build(r,_,x,o-1));return oc(p,this.toBBox),p},_chooseSubtree:function(r,t,e,o){for(var a,c,p,d,g,y,_,w;o.push(t),!(t.leaf||o.length-1===e);){for(_=w=1/0,a=0,c=t.children.length;a<c;a++)p=t.children[a],g=Nm(p),y=mD(r,p)-g,y<w?(w=y,_=g<_?g:_,d=p):y===w&&g<_&&(_=g,d=p);t=d||t.children[0]}return t},_insert:function(r,t,e){var o=this.toBBox,a=e?r:o(r),c=[],p=this._chooseSubtree(a,this.data,t,c);for(p.children.push(r),af(p,a);t>=0&&c[t].children.length>this._maxEntries;)this._split(c,t),t--;this._adjustParentBBoxes(a,c,t)},_split:function(r,t){var e=r[t],o=e.children.length,a=this._minEntries;this._chooseSplitAxis(e,a,o);var c=this._chooseSplitIndex(e,a,o),p=sc(e.children.splice(c,e.children.length-c));p.height=e.height,p.leaf=e.leaf,oc(e,this.toBBox),oc(p,this.toBBox),t?r[t-1].children.push(p):this._splitRoot(e,p)},_splitRoot:function(r,t){this.data=sc([r,t]),this.data.height=r.height+1,this.data.leaf=!1,oc(this.data,this.toBBox)},_chooseSplitIndex:function(r,t,e){var o,a,c,p,d,g,y,_;for(g=y=1/0,o=t;o<=e-t;o++)a=sf(r,0,o,this.toBBox),c=sf(r,o,e,this.toBBox),p=yD(a,c),d=Nm(a)+Nm(c),p<g?(g=p,_=o,y=d<y?d:y):p===g&&d<y&&(y=d,_=o);return _},_chooseSplitAxis:function(r,t,e){var o=r.leaf?this.compareMinX:xx,a=r.leaf?this.compareMinY:Ex,c=this._allDistMargin(r,t,e,o),p=this._allDistMargin(r,t,e,a);c<p&&r.children.sort(o)},_allDistMargin:function(r,t,e,o){r.children.sort(o);var a=this.toBBox,c=sf(r,0,t,a),p=sf(r,e-t,e,a),d=ap(c)+ap(p),g,y;for(g=t;g<e-t;g++)y=r.children[g],af(c,r.leaf?a(y):y),d+=ap(c);for(g=e-t-1;g>=t;g--)y=r.children[g],af(p,r.leaf?a(y):y),d+=ap(p);return d},_adjustParentBBoxes:function(r,t,e){for(var o=e;o>=0;o--)af(t[o],r)},_condense:function(r){for(var t=r.length-1,e;t>=0;t--)r[t].children.length===0?t>0?(e=r[t-1].children,e.splice(e.indexOf(r[t]),1)):this.clear():oc(r[t],this.toBBox)},_initFormat:function(r){var t=["return a"," - b",";"];this.compareMinX=new Function("a","b",t.join(r[0])),this.compareMinY=new Function("a","b",t.join(r[1])),this.toBBox=new Function("a","return {minX: a"+r[0]+", minY: a"+r[1]+", maxX: a"+r[2]+", maxY: a"+r[3]+"};")}};function gD(r,t,e){if(!e)return t.indexOf(r);for(var o=0;o<t.length;o++)if(e(r,t[o]))return o;return-1}function oc(r,t){sf(r,0,r.children.length,t,r)}function sf(r,t,e,o,a){a||(a=sc(null)),a.minX=1/0,a.minY=1/0,a.maxX=-1/0,a.maxY=-1/0;for(var c=t,p;c<e;c++)p=r.children[c],af(a,r.leaf?o(p):p);return a}function af(r,t){return r.minX=Math.min(r.minX,t.minX),r.minY=Math.min(r.minY,t.minY),r.maxX=Math.max(r.maxX,t.maxX),r.maxY=Math.max(r.maxY,t.maxY),r}function xx(r,t){return r.minX-t.minX}function Ex(r,t){return r.minY-t.minY}function Nm(r){return(r.maxX-r.minX)*(r.maxY-r.minY)}function ap(r){return r.maxX-r.minX+(r.maxY-r.minY)}function mD(r,t){return(Math.max(t.maxX,r.maxX)-Math.min(t.minX,r.minX))*(Math.max(t.maxY,r.maxY)-Math.min(t.minY,r.minY))}function yD(r,t){var e=Math.max(r.minX,t.minX),o=Math.max(r.minY,t.minY),a=Math.min(r.maxX,t.maxX),c=Math.min(r.maxY,t.maxY);return Math.max(0,a-e)*Math.max(0,c-o)}function Om(r,t){return r.minX<=t.minX&&r.minY<=t.minY&&t.maxX<=r.maxX&&t.maxY<=r.maxY}function up(r,t){return t.minX<=r.maxX&&t.minY<=r.maxY&&t.maxX>=r.minX&&t.maxY>=r.minY}function sc(r){return{children:r,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function wx(r,t,e,o,a){for(var c=[t,e],p;c.length;)e=c.pop(),t=c.pop(),!(e-t<=o)&&(p=t+Math.ceil((e-t)/o/2)*o,dD(r,p,t,e,a),c.push(t,p,p,e))}});var Cx=ye((m5,Hm)=>{"use strict";Hm.exports=hp;Hm.exports.default=hp;function hp(r,t,e){e=e||2;var o=t&&t.length,a=o?t[0]*e:r.length,c=bx(r,0,a,e,!0),p=[];if(!c||c.next===c.prev)return p;var d,g,y,_,w,x,T;if(o&&(c=AD(r,t,c,e)),r.length>80*e){d=y=r[0],g=_=r[1];for(var C=e;C<a;C+=e)w=r[C],x=r[C+1],w<d&&(d=w),x<g&&(g=x),w>y&&(y=w),x>_&&(_=x);T=Math.max(y-d,_-g),T=T!==0?32767/T:0}return ff(c,p,e,d,g,T,0),p}function bx(r,t,e,o,a){var c,p;if(a===Gm(r,t,e,o)>0)for(c=t;c<e;c+=o)p=Sx(c,r[c],r[c+1],p);else for(c=e-o;c>=t;c-=o)p=Sx(c,r[c],r[c+1],p);return p&&pp(p,p.next)&&(pf(p),p=p.next),p}function sl(r,t){if(!r)return r;t||(t=r);var e=r,o;do if(o=!1,!e.steiner&&(pp(e,e.next)||Lr(e.prev,e,e.next)===0)){if(pf(e),e=t=e.prev,e===e.next)break;o=!0}else e=e.next;while(o||e!==t);return t}function ff(r,t,e,o,a,c,p){if(r){!p&&c&&LD(r,o,a,c);for(var d=r,g,y;r.prev!==r.next;){if(g=r.prev,y=r.next,c?SD(r,o,a,c):MD(r)){t.push(g.i/e|0),t.push(r.i/e|0),t.push(y.i/e|0),pf(r),r=y.next,d=y.next;continue}if(r=y,r===d){p?p===1?(r=bD(sl(r),t,e),ff(r,t,e,o,a,c,2)):p===2&&TD(r,t,e,o,a,c):ff(sl(r),t,e,o,a,c,1);break}}}}function MD(r){var t=r.prev,e=r,o=r.next;if(Lr(t,e,o)>=0)return!1;for(var a=t.x,c=e.x,p=o.x,d=t.y,g=e.y,y=o.y,_=a<c?a<p?a:p:c<p?c:p,w=d<g?d<y?d:y:g<y?g:y,x=a>c?a>p?a:p:c>p?c:p,T=d>g?d>y?d:y:g>y?g:y,C=o.next;C!==t;){if(C.x>=_&&C.x<=x&&C.y>=w&&C.y<=T&&lc(a,d,c,g,p,y,C.x,C.y)&&Lr(C.prev,C,C.next)>=0)return!1;C=C.next}return!0}function SD(r,t,e,o){var a=r.prev,c=r,p=r.next;if(Lr(a,c,p)>=0)return!1;for(var d=a.x,g=c.x,y=p.x,_=a.y,w=c.y,x=p.y,T=d<g?d<y?d:y:g<y?g:y,C=_<w?_<x?_:x:w<x?w:x,I=d>g?d>y?d:y:g>y?g:y,M=_>w?_>x?_:x:w>x?w:x,E=zm(T,C,t,e,o),L=zm(I,M,t,e,o),A=r.prevZ,z=r.nextZ;A&&A.z>=E&&z&&z.z<=L;){if(A.x>=T&&A.x<=I&&A.y>=C&&A.y<=M&&A!==a&&A!==p&&lc(d,_,g,w,y,x,A.x,A.y)&&Lr(A.prev,A,A.next)>=0||(A=A.prevZ,z.x>=T&&z.x<=I&&z.y>=C&&z.y<=M&&z!==a&&z!==p&&lc(d,_,g,w,y,x,z.x,z.y)&&Lr(z.prev,z,z.next)>=0))return!1;z=z.nextZ}for(;A&&A.z>=E;){if(A.x>=T&&A.x<=I&&A.y>=C&&A.y<=M&&A!==a&&A!==p&&lc(d,_,g,w,y,x,A.x,A.y)&&Lr(A.prev,A,A.next)>=0)return!1;A=A.prevZ}for(;z&&z.z<=L;){if(z.x>=T&&z.x<=I&&z.y>=C&&z.y<=M&&z!==a&&z!==p&&lc(d,_,g,w,y,x,z.x,z.y)&&Lr(z.prev,z,z.next)>=0)return!1;z=z.nextZ}return!0}function bD(r,t,e){var o=r;do{var a=o.prev,c=o.next.next;!pp(a,c)&&Tx(a,o,o.next,c)&&hf(a,c)&&hf(c,a)&&(t.push(a.i/e|0),t.push(o.i/e|0),t.push(c.i/e|0),pf(o),pf(o.next),o=r=c),o=o.next}while(o!==r);return sl(o)}function TD(r,t,e,o,a,c){var p=r;do{for(var d=p.next.next;d!==p.prev;){if(p.i!==d.i&&DD(p,d)){var g=Ax(p,d);p=sl(p,p.next),g=sl(g,g.next),ff(p,t,e,o,a,c,0),ff(g,t,e,o,a,c,0);return}d=d.next}p=p.next}while(p!==r)}function AD(r,t,e,o){var a=[],c,p,d,g,y;for(c=0,p=t.length;c<p;c++)d=t[c]*o,g=c<p-1?t[c+1]*o:r.length,y=bx(r,d,g,o,!1),y===y.next&&(y.steiner=!0),a.push(OD(y));for(a.sort(CD),c=0;c<a.length;c++)e=PD(a[c],e);return e}function CD(r,t){return r.x-t.x}function PD(r,t){var e=ID(r,t);if(!e)return t;var o=Ax(e,r);return sl(o,o.next),sl(e,e.next)}function ID(r,t){var e=t,o=r.x,a=r.y,c=-1/0,p;do{if(a<=e.y&&a>=e.next.y&&e.next.y!==e.y){var d=e.x+(a-e.y)*(e.next.x-e.x)/(e.next.y-e.y);if(d<=o&&d>c&&(c=d,p=e.x<e.next.x?e:e.next,d===o))return p}e=e.next}while(e!==t);if(!p)return null;var g=p,y=p.x,_=p.y,w=1/0,x;e=p;do o>=e.x&&e.x>=y&&o!==e.x&&lc(a<_?o:c,a,y,_,a<_?c:o,a,e.x,e.y)&&(x=Math.abs(a-e.y)/(o-e.x),hf(e,r)&&(x<w||x===w&&(e.x>p.x||e.x===p.x&&RD(p,e)))&&(p=e,w=x)),e=e.next;while(e!==g);return p}function RD(r,t){return Lr(r.prev,r,t.prev)<0&&Lr(t.next,r,r.next)<0}function LD(r,t,e,o){var a=r;do a.z===0&&(a.z=zm(a.x,a.y,t,e,o)),a.prevZ=a.prev,a.nextZ=a.next,a=a.next;while(a!==r);a.prevZ.nextZ=null,a.prevZ=null,ND(a)}function ND(r){var t,e,o,a,c,p,d,g,y=1;do{for(e=r,r=null,c=null,p=0;e;){for(p++,o=e,d=0,t=0;t<y&&(d++,o=o.nextZ,!!o);t++);for(g=y;d>0||g>0&&o;)d!==0&&(g===0||!o||e.z<=o.z)?(a=e,e=e.nextZ,d--):(a=o,o=o.nextZ,g--),c?c.nextZ=a:r=a,a.prevZ=c,c=a;e=o}c.nextZ=null,y*=2}while(p>1);return r}function zm(r,t,e,o,a){return r=(r-e)*a|0,t=(t-o)*a|0,r=(r|r<<8)&16711935,r=(r|r<<4)&252645135,r=(r|r<<2)&858993459,r=(r|r<<1)&1431655765,t=(t|t<<8)&16711935,t=(t|t<<4)&252645135,t=(t|t<<2)&858993459,t=(t|t<<1)&1431655765,r|t<<1}function OD(r){var t=r,e=r;do(t.x<e.x||t.x===e.x&&t.y<e.y)&&(e=t),t=t.next;while(t!==r);return e}function lc(r,t,e,o,a,c,p,d){return(a-p)*(t-d)>=(r-p)*(c-d)&&(r-p)*(o-d)>=(e-p)*(t-d)&&(e-p)*(c-d)>=(a-p)*(o-d)}function DD(r,t){return r.next.i!==t.i&&r.prev.i!==t.i&&!FD(r,t)&&(hf(r,t)&&hf(t,r)&&UD(r,t)&&(Lr(r.prev,r,t.prev)||Lr(r,t.prev,t))||pp(r,t)&&Lr(r.prev,r,r.next)>0&&Lr(t.prev,t,t.next)>0)}function Lr(r,t,e){return(t.y-r.y)*(e.x-t.x)-(t.x-r.x)*(e.y-t.y)}function pp(r,t){return r.x===t.x&&r.y===t.y}function Tx(r,t,e,o){var a=fp(Lr(r,t,e)),c=fp(Lr(r,t,o)),p=fp(Lr(e,o,r)),d=fp(Lr(e,o,t));return!!(a!==c&&p!==d||a===0&&cp(r,e,t)||c===0&&cp(r,o,t)||p===0&&cp(e,r,o)||d===0&&cp(e,t,o))}function cp(r,t,e){return t.x<=Math.max(r.x,e.x)&&t.x>=Math.min(r.x,e.x)&&t.y<=Math.max(r.y,e.y)&&t.y>=Math.min(r.y,e.y)}function fp(r){return r>0?1:r<0?-1:0}function FD(r,t){var e=r;do{if(e.i!==r.i&&e.next.i!==r.i&&e.i!==t.i&&e.next.i!==t.i&&Tx(e,e.next,r,t))return!0;e=e.next}while(e!==r);return!1}function hf(r,t){return Lr(r.prev,r,r.next)<0?Lr(r,t,r.next)>=0&&Lr(r,r.prev,t)>=0:Lr(r,t,r.prev)<0||Lr(r,r.next,t)<0}function UD(r,t){var e=r,o=!1,a=(r.x+t.x)/2,c=(r.y+t.y)/2;do e.y>c!=e.next.y>c&&e.next.y!==e.y&&a<(e.next.x-e.x)*(c-e.y)/(e.next.y-e.y)+e.x&&(o=!o),e=e.next;while(e!==r);return o}function Ax(r,t){var e=new km(r.i,r.x,r.y),o=new km(t.i,t.x,t.y),a=r.next,c=t.prev;return r.next=t,t.prev=r,e.next=a,a.prev=e,o.next=e,e.prev=o,c.next=o,o.prev=c,o}function Sx(r,t,e,o){var a=new km(r,t,e);return o?(a.next=o.next,a.prev=o,o.next.prev=a,o.next=a):(a.prev=a,a.next=a),a}function pf(r){r.next.prev=r.prev,r.prev.next=r.next,r.prevZ&&(r.prevZ.nextZ=r.nextZ),r.nextZ&&(r.nextZ.prevZ=r.prevZ)}function km(r,t,e){this.i=r,this.x=t,this.y=e,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}hp.deviation=function(r,t,e,o){var a=t&&t.length,c=a?t[0]*e:r.length,p=Math.abs(Gm(r,0,c,e));if(a)for(var d=0,g=t.length;d<g;d++){var y=t[d]*e,_=d<g-1?t[d+1]*e:r.length;p-=Math.abs(Gm(r,y,_,e))}var w=0;for(d=0;d<o.length;d+=3){var x=o[d]*e,T=o[d+1]*e,C=o[d+2]*e;w+=Math.abs((r[x]-r[C])*(r[T+1]-r[x+1])-(r[x]-r[T])*(r[C+1]-r[x+1]))}return p===0&&w===0?0:Math.abs((w-p)/p)};function Gm(r,t,e,o){for(var a=0,c=t,p=e-o;c<e;c+=o)a+=(r[p]-r[c])*(r[c+1]+r[p+1]),p=c;return a}hp.flatten=function(r){for(var t=r[0][0].length,e={vertices:[],holes:[],dimensions:t},o=0,a=0;a<r.length;a++){for(var c=0;c<r[a].length;c++)for(var p=0;p<t;p++)e.vertices.push(r[a][c][p]);a>0&&(o+=r[a-1].length,e.holes.push(o))}return e}});var Ym=ye(Ie=>{"use strict";Object.defineProperty(Ie,"__esModule",{value:!0});Ie.earthRadius=63710088e-1;Ie.factors={centimeters:Ie.earthRadius*100,centimetres:Ie.earthRadius*100,degrees:Ie.earthRadius/111325,feet:Ie.earthRadius*3.28084,inches:Ie.earthRadius*39.37,kilometers:Ie.earthRadius/1e3,kilometres:Ie.earthRadius/1e3,meters:Ie.earthRadius,metres:Ie.earthRadius,miles:Ie.earthRadius/1609.344,millimeters:Ie.earthRadius*1e3,millimetres:Ie.earthRadius*1e3,nauticalmiles:Ie.earthRadius/1852,radians:1,yards:Ie.earthRadius*1.0936};Ie.unitsFactors={centimeters:100,centimetres:100,degrees:1/111325,feet:3.28084,inches:39.37,kilometers:1/1e3,kilometres:1/1e3,meters:1,metres:1,miles:1/1609.344,millimeters:1e3,millimetres:1e3,nauticalmiles:1/1852,radians:1/Ie.earthRadius,yards:1.0936133};Ie.areaFactors={acres:247105e-9,centimeters:1e4,centimetres:1e4,feet:10.763910417,hectares:1e-4,inches:1550.003100006,kilometers:1e-6,kilometres:1e-6,meters:1,metres:1,miles:386e-9,millimeters:1e6,millimetres:1e6,yards:1.195990046};function Au(r,t,e){e===void 0&&(e={});var o={type:"Feature"};return(e.id===0||e.id)&&(o.id=e.id),e.bbox&&(o.bbox=e.bbox),o.properties=t||{},o.geometry=r,o}Ie.feature=Au;function zD(r,t,e){switch(e===void 0&&(e={}),r){case"Point":return Vm(t).geometry;case"LineString":return qm(t).geometry;case"Polygon":return Wm(t).geometry;case"MultiPoint":return Ix(t).geometry;case"MultiLineString":return Px(t).geometry;case"MultiPolygon":return Rx(t).geometry;default:throw new Error(r+" is invalid")}}Ie.geometry=zD;function Vm(r,t,e){if(e===void 0&&(e={}),!r)throw new Error("coordinates is required");if(!Array.isArray(r))throw new Error("coordinates must be an Array");if(r.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!dp(r[0])||!dp(r[1]))throw new Error("coordinates must contain numbers");var o={type:"Point",coordinates:r};return Au(o,t,e)}Ie.point=Vm;function kD(r,t,e){return e===void 0&&(e={}),gp(r.map(function(o){return Vm(o,t)}),e)}Ie.points=kD;function Wm(r,t,e){e===void 0&&(e={});for(var o=0,a=r;o<a.length;o++){var c=a[o];if(c.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");for(var p=0;p<c[c.length-1].length;p++)if(c[c.length-1][p]!==c[0][p])throw new Error("First and last Position are not equivalent.")}var d={type:"Polygon",coordinates:r};return Au(d,t,e)}Ie.polygon=Wm;function GD(r,t,e){return e===void 0&&(e={}),gp(r.map(function(o){return Wm(o,t)}),e)}Ie.polygons=GD;function qm(r,t,e){if(e===void 0&&(e={}),r.length<2)throw new Error("coordinates must be an array of two or more positions");var o={type:"LineString",coordinates:r};return Au(o,t,e)}Ie.lineString=qm;function HD(r,t,e){return e===void 0&&(e={}),gp(r.map(function(o){return qm(o,t)}),e)}Ie.lineStrings=HD;function gp(r,t){t===void 0&&(t={});var e={type:"FeatureCollection"};return t.id&&(e.id=t.id),t.bbox&&(e.bbox=t.bbox),e.features=r,e}Ie.featureCollection=gp;function Px(r,t,e){e===void 0&&(e={});var o={type:"MultiLineString",coordinates:r};return Au(o,t,e)}Ie.multiLineString=Px;function Ix(r,t,e){e===void 0&&(e={});var o={type:"MultiPoint",coordinates:r};return Au(o,t,e)}Ie.multiPoint=Ix;function Rx(r,t,e){e===void 0&&(e={});var o={type:"MultiPolygon",coordinates:r};return Au(o,t,e)}Ie.multiPolygon=Rx;function VD(r,t,e){e===void 0&&(e={});var o={type:"GeometryCollection",geometries:r};return Au(o,t,e)}Ie.geometryCollection=VD;function WD(r,t){if(t===void 0&&(t=0),t&&!(t>=0))throw new Error("precision must be a positive number");var e=Math.pow(10,t||0);return Math.round(r*e)/e}Ie.round=WD;function Lx(r,t){t===void 0&&(t="kilometers");var e=Ie.factors[t];if(!e)throw new Error(t+" units is invalid");return r*e}Ie.radiansToLength=Lx;function Xm(r,t){t===void 0&&(t="kilometers");var e=Ie.factors[t];if(!e)throw new Error(t+" units is invalid");return r/e}Ie.lengthToRadians=Xm;function qD(r,t){return Nx(Xm(r,t))}Ie.lengthToDegrees=qD;function XD(r){var t=r%360;return t<0&&(t+=360),t}Ie.bearingToAzimuth=XD;function Nx(r){var t=r%(2*Math.PI);return t*180/Math.PI}Ie.radiansToDegrees=Nx;function YD(r){var t=r%360;return t*Math.PI/180}Ie.degreesToRadians=YD;function $D(r,t,e){if(t===void 0&&(t="kilometers"),e===void 0&&(e="kilometers"),!(r>=0))throw new Error("length must be a positive number");return Lx(Xm(r,t),e)}Ie.convertLength=$D;function ZD(r,t,e){if(t===void 0&&(t="meters"),e===void 0&&(e="kilometers"),!(r>=0))throw new Error("area must be a positive number");var o=Ie.areaFactors[t];if(!o)throw new Error("invalid original units");var a=Ie.areaFactors[e];if(!a)throw new Error("invalid final units");return r/o*a}Ie.convertArea=ZD;function dp(r){return!isNaN(r)&&r!==null&&!Array.isArray(r)}Ie.isNumber=dp;function JD(r){return!!r&&r.constructor===Object}Ie.isObject=JD;function KD(r){if(!r)throw new Error("bbox is required");if(!Array.isArray(r))throw new Error("bbox must be an Array");if(r.length!==4&&r.length!==6)throw new Error("bbox must be an Array of 4 or 6 numbers");r.forEach(function(t){if(!dp(t))throw new Error("bbox must only contain numbers")})}Ie.validateBBox=KD;function QD(r){if(!r)throw new Error("id is required");if(["string","number"].indexOf(typeof r)===-1)throw new Error("id must be a number or a string")}Ie.validateId=QD});var Zm=ye(li=>{"use strict";Object.defineProperty(li,"__esModule",{value:!0});var ji=Ym();function df(r,t,e){if(r!==null)for(var o,a,c,p,d,g,y,_=0,w=0,x,T=r.type,C=T==="FeatureCollection",I=T==="Feature",M=C?r.features.length:1,E=0;E<M;E++){y=C?r.features[E].geometry:I?r.geometry:r,x=y?y.type==="GeometryCollection":!1,d=x?y.geometries.length:1;for(var L=0;L<d;L++){var A=0,z=0;if(p=x?y.geometries[L]:y,p!==null){g=p.coordinates;var G=p.type;switch(_=e&&(G==="Polygon"||G==="MultiPolygon")?1:0,G){case null:break;case"Point":if(t(g,w,E,A,z)===!1)return!1;w++,A++;break;case"LineString":case"MultiPoint":for(o=0;o<g.length;o++){if(t(g[o],w,E,A,z)===!1)return!1;w++,G==="MultiPoint"&&A++}G==="LineString"&&A++;break;case"Polygon":case"MultiLineString":for(o=0;o<g.length;o++){for(a=0;a<g[o].length-_;a++){if(t(g[o][a],w,E,A,z)===!1)return!1;w++}G==="MultiLineString"&&A++,G==="Polygon"&&z++}G==="Polygon"&&A++;break;case"MultiPolygon":for(o=0;o<g.length;o++){for(z=0,a=0;a<g[o].length;a++){for(c=0;c<g[o][a].length-_;c++){if(t(g[o][a][c],w,E,A,z)===!1)return!1;w++}z++}A++}break;case"GeometryCollection":for(o=0;o<p.geometries.length;o++)if(df(p.geometries[o],t,e)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function jD(r,t,e,o){var a=e;return df(r,function(c,p,d,g,y){p===0&&e===void 0?a=c:a=t(a,c,p,d,g,y)},o),a}function Ox(r,t){var e;switch(r.type){case"FeatureCollection":for(e=0;e<r.features.length&&t(r.features[e].properties,e)!==!1;e++);break;case"Feature":t(r.properties,0);break}}function t3(r,t,e){var o=e;return Ox(r,function(a,c){c===0&&e===void 0?o=a:o=t(o,a,c)}),o}function Dx(r,t){if(r.type==="Feature")t(r,0);else if(r.type==="FeatureCollection")for(var e=0;e<r.features.length&&t(r.features[e],e)!==!1;e++);}function e3(r,t,e){var o=e;return Dx(r,function(a,c){c===0&&e===void 0?o=a:o=t(o,a,c)}),o}function n3(r){var t=[];return df(r,function(e){t.push(e)}),t}function $m(r,t){var e,o,a,c,p,d,g,y,_,w,x=0,T=r.type==="FeatureCollection",C=r.type==="Feature",I=T?r.features.length:1;for(e=0;e<I;e++){for(d=T?r.features[e].geometry:C?r.geometry:r,y=T?r.features[e].properties:C?r.properties:{},_=T?r.features[e].bbox:C?r.bbox:void 0,w=T?r.features[e].id:C?r.id:void 0,g=d?d.type==="GeometryCollection":!1,p=g?d.geometries.length:1,a=0;a<p;a++){if(c=g?d.geometries[a]:d,c===null){if(t(null,x,y,_,w)===!1)return!1;continue}switch(c.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":{if(t(c,x,y,_,w)===!1)return!1;break}case"GeometryCollection":{for(o=0;o<c.geometries.length;o++)if(t(c.geometries[o],x,y,_,w)===!1)return!1;break}default:throw new Error("Unknown Geometry Type")}}x++}}function r3(r,t,e){var o=e;return $m(r,function(a,c,p,d,g){c===0&&e===void 0?o=a:o=t(o,a,c,p,d,g)}),o}function mp(r,t){$m(r,function(e,o,a,c,p){var d=e===null?null:e.type;switch(d){case null:case"Point":case"LineString":case"Polygon":return t(ji.feature(e,a,{bbox:c,id:p}),o,0)===!1?!1:void 0}var g;switch(d){case"MultiPoint":g="Point";break;case"MultiLineString":g="LineString";break;case"MultiPolygon":g="Polygon";break}for(var y=0;y<e.coordinates.length;y++){var _=e.coordinates[y],w={type:g,coordinates:_};if(t(ji.feature(w,a),o,y)===!1)return!1}})}function i3(r,t,e){var o=e;return mp(r,function(a,c,p){c===0&&p===0&&e===void 0?o=a:o=t(o,a,c,p)}),o}function Fx(r,t){mp(r,function(e,o,a){var c=0;if(e.geometry){var p=e.geometry.type;if(!(p==="Point"||p==="MultiPoint")){var d,g=0,y=0,_=0;if(df(e,function(w,x,T,C,I){if(d===void 0||o>g||C>y||I>_){d=w,g=o,y=C,_=I,c=0;return}var M=ji.lineString([d,w],e.properties);if(t(M,o,a,I,c)===!1)return!1;c++,d=w})===!1)return!1}}})}function o3(r,t,e){var o=e,a=!1;return Fx(r,function(c,p,d,g,y){a===!1&&e===void 0?o=c:o=t(o,c,p,d,g,y),a=!0}),o}function Ux(r,t){if(!r)throw new Error("geojson is required");mp(r,function(e,o,a){if(e.geometry!==null){var c=e.geometry.type,p=e.geometry.coordinates;switch(c){case"LineString":if(t(e,o,a,0,0)===!1)return!1;break;case"Polygon":for(var d=0;d<p.length;d++)if(t(ji.lineString(p[d],e.properties),o,a,d)===!1)return!1;break}}})}function s3(r,t,e){var o=e;return Ux(r,function(a,c,p,d){c===0&&e===void 0?o=a:o=t(o,a,c,p,d)}),o}function a3(r,t){if(t=t||{},!ji.isObject(t))throw new Error("options is invalid");var e=t.featureIndex||0,o=t.multiFeatureIndex||0,a=t.geometryIndex||0,c=t.segmentIndex||0,p=t.properties,d;switch(r.type){case"FeatureCollection":e<0&&(e=r.features.length+e),p=p||r.features[e].properties,d=r.features[e].geometry;break;case"Feature":p=p||r.properties,d=r.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":d=r;break;default:throw new Error("geojson is invalid")}if(d===null)return null;var g=d.coordinates;switch(d.type){case"Point":case"MultiPoint":return null;case"LineString":return c<0&&(c=g.length+c-1),ji.lineString([g[c],g[c+1]],p,t);case"Polygon":return a<0&&(a=g.length+a),c<0&&(c=g[a].length+c-1),ji.lineString([g[a][c],g[a][c+1]],p,t);case"MultiLineString":return o<0&&(o=g.length+o),c<0&&(c=g[o].length+c-1),ji.lineString([g[o][c],g[o][c+1]],p,t);case"MultiPolygon":return o<0&&(o=g.length+o),a<0&&(a=g[o].length+a),c<0&&(c=g[o][a].length-c-1),ji.lineString([g[o][a][c],g[o][a][c+1]],p,t)}throw new Error("geojson is invalid")}function u3(r,t){if(t=t||{},!ji.isObject(t))throw new Error("options is invalid");var e=t.featureIndex||0,o=t.multiFeatureIndex||0,a=t.geometryIndex||0,c=t.coordIndex||0,p=t.properties,d;switch(r.type){case"FeatureCollection":e<0&&(e=r.features.length+e),p=p||r.features[e].properties,d=r.features[e].geometry;break;case"Feature":p=p||r.properties,d=r.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":d=r;break;default:throw new Error("geojson is invalid")}if(d===null)return null;var g=d.coordinates;switch(d.type){case"Point":return ji.point(g,p,t);case"MultiPoint":return o<0&&(o=g.length+o),ji.point(g[o],p,t);case"LineString":return c<0&&(c=g.length+c),ji.point(g[c],p,t);case"Polygon":return a<0&&(a=g.length+a),c<0&&(c=g[a].length+c),ji.point(g[a][c],p,t);case"MultiLineString":return o<0&&(o=g.length+o),c<0&&(c=g[o].length+c),ji.point(g[o][c],p,t);case"MultiPolygon":return o<0&&(o=g.length+o),a<0&&(a=g[o].length+a),c<0&&(c=g[o][a].length-c),ji.point(g[o][a][c],p,t)}throw new Error("geojson is invalid")}li.coordAll=n3;li.coordEach=df;li.coordReduce=jD;li.featureEach=Dx;li.featureReduce=e3;li.findPoint=u3;li.findSegment=a3;li.flattenEach=mp;li.flattenReduce=i3;li.geomEach=$m;li.geomReduce=r3;li.lineEach=Ux;li.lineReduce=s3;li.propEach=Ox;li.propReduce=t3;li.segmentEach=Fx;li.segmentReduce=o3});var Bx=ye(Km=>{"use strict";Object.defineProperty(Km,"__esModule",{value:!0});var l3=Zm();function Jm(r){var t=[1/0,1/0,-1/0,-1/0];return l3.coordEach(r,function(e){t[0]>e[0]&&(t[0]=e[0]),t[1]>e[1]&&(t[1]=e[1]),t[2]<e[0]&&(t[2]=e[0]),t[3]<e[1]&&(t[3]=e[1])}),t}Jm.default=Jm;Km.default=Jm});var yp=ye((L5,Qm)=>{var ha=Mm(),kx=Ym(),Gx=Zm(),cc=Bx().default,c3=Gx.featureEach,I5=Gx.coordEach,R5=kx.polygon,zx=kx.featureCollection;function Hx(r){var t=new ha(r);return t.insert=function(e){if(e.type!=="Feature")throw new Error("invalid feature");return e.bbox=e.bbox?e.bbox:cc(e),ha.prototype.insert.call(this,e)},t.load=function(e){var o=[];return Array.isArray(e)?e.forEach(function(a){if(a.type!=="Feature")throw new Error("invalid features");a.bbox=a.bbox?a.bbox:cc(a),o.push(a)}):c3(e,function(a){if(a.type!=="Feature")throw new Error("invalid features");a.bbox=a.bbox?a.bbox:cc(a),o.push(a)}),ha.prototype.load.call(this,o)},t.remove=function(e,o){if(e.type!=="Feature")throw new Error("invalid feature");return e.bbox=e.bbox?e.bbox:cc(e),ha.prototype.remove.call(this,e,o)},t.clear=function(){return ha.prototype.clear.call(this)},t.search=function(e){var o=ha.prototype.search.call(this,this.toBBox(e));return zx(o)},t.collides=function(e){return ha.prototype.collides.call(this,this.toBBox(e))},t.all=function(){var e=ha.prototype.all.call(this);return zx(e)},t.toJSON=function(){return ha.prototype.toJSON.call(this)},t.fromJSON=function(e){return ha.prototype.fromJSON.call(this,e)},t.toBBox=function(e){var o;if(e.bbox)o=e.bbox;else if(Array.isArray(e)&&e.length===4)o=e;else if(Array.isArray(e)&&e.length===6)o=[e[0],e[1],e[3],e[4]];else if(e.type==="Feature")o=cc(e);else if(e.type==="FeatureCollection")o=cc(e);else throw new Error("invalid geojson");return{minX:o[0],minY:o[1],maxX:o[2],maxY:o[3]}},t}Qm.exports=Hx;Qm.exports.default=Hx});var i0=ye((GV,Qx)=>{"use strict";var Kx=Object.prototype.toString;Qx.exports=function(t){var e=Kx.call(t),o=e==="[object Arguments]";return o||(o=e!=="[object Array]"&&t!==null&&typeof t=="object"&&typeof t.length=="number"&&t.length>=0&&Kx.call(t.callee)==="[object Function]"),o}});var aE=ye((HV,sE)=>{"use strict";var oE;Object.keys||(yf=Object.prototype.hasOwnProperty,o0=Object.prototype.toString,jx=i0(),s0=Object.prototype.propertyIsEnumerable,tE=!s0.call({toString:null},"toString"),eE=s0.call(function(){},"prototype"),vf=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],wp=function(r){var t=r.constructor;return t&&t.prototype===r},nE={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},rE=function(){if(typeof window=="undefined")return!1;for(var r in window)try{if(!nE["$"+r]&&yf.call(window,r)&&window[r]!==null&&typeof window[r]=="object")try{wp(window[r])}catch(t){return!0}}catch(t){return!0}return!1}(),iE=function(r){if(typeof window=="undefined"||!rE)return wp(r);try{return wp(r)}catch(t){return!1}},oE=function(t){var e=t!==null&&typeof t=="object",o=o0.call(t)==="[object Function]",a=jx(t),c=e&&o0.call(t)==="[object String]",p=[];if(!e&&!o&&!a)throw new TypeError("Object.keys called on a non-object");var d=eE&&o;if(c&&t.length>0&&!yf.call(t,0))for(var g=0;g<t.length;++g)p.push(String(g));if(a&&t.length>0)for(var y=0;y<t.length;++y)p.push(String(y));else for(var _ in t)!(d&&_==="prototype")&&yf.call(t,_)&&p.push(String(_));if(tE)for(var w=iE(t),x=0;x<vf.length;++x)!(w&&vf[x]==="constructor")&&yf.call(t,vf[x])&&p.push(vf[x]);return p});var yf,o0,jx,s0,tE,eE,vf,wp,nE,rE,iE;sE.exports=oE});var a0=ye((VV,cE)=>{"use strict";var x3=Array.prototype.slice,E3=i0(),uE=Object.keys,Mp=uE?function(t){return uE(t)}:aE(),lE=Object.keys;Mp.shim=function(){if(Object.keys){var t=function(){var e=Object.keys(arguments);return e&&e.length===arguments.length}(1,2);t||(Object.keys=function(o){return E3(o)?lE(x3.call(o)):lE(o)})}else Object.keys=Mp;return Object.keys||Mp};cE.exports=Mp});var u0=ye((WV,fE)=>{"use strict";fE.exports=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var t={},e=Symbol("test"),o=Object(e);if(typeof e=="string"||Object.prototype.toString.call(e)!=="[object Symbol]"||Object.prototype.toString.call(o)!=="[object Symbol]")return!1;var a=42;t[e]=a;for(e in t)return!1;if(typeof Object.keys=="function"&&Object.keys(t).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(t).length!==0)return!1;var c=Object.getOwnPropertySymbols(t);if(c.length!==1||c[0]!==e||!Object.prototype.propertyIsEnumerable.call(t,e))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var p=Object.getOwnPropertyDescriptor(t,e);if(p.value!==a||p.enumerable!==!0)return!1}return!0}});var Sp=ye((qV,hE)=>{"use strict";var w3=u0();hE.exports=function(){return w3()&&!!Symbol.toStringTag}});var gE=ye((XV,dE)=>{"use strict";var pE=typeof Symbol!="undefined"&&Symbol,M3=u0();dE.exports=function(){return typeof pE!="function"||typeof Symbol!="function"||typeof pE("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:M3()}});var vE=ye((YV,yE)=>{"use strict";var mE={foo:{}},S3=Object;yE.exports=function(){return{__proto__:mE}.foo===mE.foo&&!({__proto__:null}instanceof S3)}});var EE=ye(($V,xE)=>{"use strict";var b3="Function.prototype.bind called on incompatible ",T3=Object.prototype.toString,A3=Math.max,C3="[object Function]",_E=function(t,e){for(var o=[],a=0;a<t.length;a+=1)o[a]=t[a];for(var c=0;c<e.length;c+=1)o[c+t.length]=e[c];return o},P3=function(t,e){for(var o=[],a=e||0,c=0;a<t.length;a+=1,c+=1)o[c]=t[a];return o},I3=function(r,t){for(var e="",o=0;o<r.length;o+=1)e+=r[o],o+1<r.length&&(e+=t);return e};xE.exports=function(t){var e=this;if(typeof e!="function"||T3.apply(e)!==C3)throw new TypeError(b3+e);for(var o=P3(arguments,1),a,c=function(){if(this instanceof a){var _=e.apply(this,_E(o,arguments));return Object(_)===_?_:this}return e.apply(t,_E(o,arguments))},p=A3(0,e.length-o.length),d=[],g=0;g<p;g++)d[g]="$"+g;if(a=Function("binder","return function ("+I3(d,",")+"){ return binder.apply(this,arguments); }")(c),e.prototype){var y=function(){};y.prototype=e.prototype,a.prototype=new y,y.prototype=null}return a}});var bp=ye((ZV,wE)=>{"use strict";var R3=EE();wE.exports=Function.prototype.bind||R3});var SE=ye((JV,ME)=>{"use strict";var L3=Function.prototype.call,N3=Object.prototype.hasOwnProperty,O3=bp();ME.exports=O3.call(L3,N3)});var ll=ye((KV,PE)=>{"use strict";var Bn,dc=SyntaxError,CE=Function,pc=TypeError,l0=function(r){try{return CE('"use strict"; return ('+r+").constructor;")()}catch(t){}},al=Object.getOwnPropertyDescriptor;if(al)try{al({},"")}catch(r){al=null}var c0=function(){throw new pc},D3=al?function(){try{return arguments.callee,c0}catch(r){try{return al(arguments,"callee").get}catch(t){return c0}}}():c0,fc=gE()(),F3=vE()(),Ti=Object.getPrototypeOf||(F3?function(r){return r.__proto__}:null),hc={},U3=typeof Uint8Array=="undefined"||!Ti?Bn:Ti(Uint8Array),ul={"%AggregateError%":typeof AggregateError=="undefined"?Bn:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer=="undefined"?Bn:ArrayBuffer,"%ArrayIteratorPrototype%":fc&&Ti?Ti([][Symbol.iterator]()):Bn,"%AsyncFromSyncIteratorPrototype%":Bn,"%AsyncFunction%":hc,"%AsyncGenerator%":hc,"%AsyncGeneratorFunction%":hc,"%AsyncIteratorPrototype%":hc,"%Atomics%":typeof Atomics=="undefined"?Bn:Atomics,"%BigInt%":typeof BigInt=="undefined"?Bn:BigInt,"%BigInt64Array%":typeof BigInt64Array=="undefined"?Bn:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array=="undefined"?Bn:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView=="undefined"?Bn:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":typeof Float32Array=="undefined"?Bn:Float32Array,"%Float64Array%":typeof Float64Array=="undefined"?Bn:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry=="undefined"?Bn:FinalizationRegistry,"%Function%":CE,"%GeneratorFunction%":hc,"%Int8Array%":typeof Int8Array=="undefined"?Bn:Int8Array,"%Int16Array%":typeof Int16Array=="undefined"?Bn:Int16Array,"%Int32Array%":typeof Int32Array=="undefined"?Bn:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":fc&&Ti?Ti(Ti([][Symbol.iterator]())):Bn,"%JSON%":typeof JSON=="object"?JSON:Bn,"%Map%":typeof Map=="undefined"?Bn:Map,"%MapIteratorPrototype%":typeof Map=="undefined"||!fc||!Ti?Bn:Ti(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise=="undefined"?Bn:Promise,"%Proxy%":typeof Proxy=="undefined"?Bn:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":typeof Reflect=="undefined"?Bn:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set=="undefined"?Bn:Set,"%SetIteratorPrototype%":typeof Set=="undefined"||!fc||!Ti?Bn:Ti(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer=="undefined"?Bn:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":fc&&Ti?Ti(""[Symbol.iterator]()):Bn,"%Symbol%":fc?Symbol:Bn,"%SyntaxError%":dc,"%ThrowTypeError%":D3,"%TypedArray%":U3,"%TypeError%":pc,"%Uint8Array%":typeof Uint8Array=="undefined"?Bn:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray=="undefined"?Bn:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array=="undefined"?Bn:Uint16Array,"%Uint32Array%":typeof Uint32Array=="undefined"?Bn:Uint32Array,"%URIError%":URIError,"%WeakMap%":typeof WeakMap=="undefined"?Bn:WeakMap,"%WeakRef%":typeof WeakRef=="undefined"?Bn:WeakRef,"%WeakSet%":typeof WeakSet=="undefined"?Bn:WeakSet};if(Ti)try{null.error}catch(r){bE=Ti(Ti(r)),ul["%Error.prototype%"]=bE}var bE,B3=function r(t){var e;if(t==="%AsyncFunction%")e=l0("async function () {}");else if(t==="%GeneratorFunction%")e=l0("function* () {}");else if(t==="%AsyncGeneratorFunction%")e=l0("async function* () {}");else if(t==="%AsyncGenerator%"){var o=r("%AsyncGeneratorFunction%");o&&(e=o.prototype)}else if(t==="%AsyncIteratorPrototype%"){var a=r("%AsyncGenerator%");a&&Ti&&(e=Ti(a.prototype))}return ul[t]=e,e},TE={"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},_f=bp(),Tp=SE(),z3=_f.call(Function.call,Array.prototype.concat),k3=_f.call(Function.apply,Array.prototype.splice),AE=_f.call(Function.call,String.prototype.replace),Ap=_f.call(Function.call,String.prototype.slice),G3=_f.call(Function.call,RegExp.prototype.exec),H3=/[^%.[\\]]+|\\[(?:(-?\\d+(?:\\.\\d+)?)|(["'])((?:(?!\\2)[^\\\\]|\\\\.)*?)\\2)\\]|(?=(?:\\.|\\[\\])(?:\\.|\\[\\]|%$))/g,V3=/\\\\(\\\\)?/g,W3=function(t){var e=Ap(t,0,1),o=Ap(t,-1);if(e==="%"&&o!=="%")throw new dc("invalid intrinsic syntax, expected closing \`%\`");if(o==="%"&&e!=="%")throw new dc("invalid intrinsic syntax, expected opening \`%\`");var a=[];return AE(t,H3,function(c,p,d,g){a[a.length]=d?AE(g,V3,"$1"):p||c}),a},q3=function(t,e){var o=t,a;if(Tp(TE,o)&&(a=TE[o],o="%"+a[0]+"%"),Tp(ul,o)){var c=ul[o];if(c===hc&&(c=B3(o)),typeof c=="undefined"&&!e)throw new pc("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:a,name:o,value:c}}throw new dc("intrinsic "+t+" does not exist!")};PE.exports=function(t,e){if(typeof t!="string"||t.length===0)throw new pc("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof e!="boolean")throw new pc('"allowMissing" argument must be a boolean');if(G3(/^%?[^%]*%?$/,t)===null)throw new dc("\`%\` may not be present anywhere but at the beginning and end of the intrinsic name");var o=W3(t),a=o.length>0?o[0]:"",c=q3("%"+a+"%",e),p=c.name,d=c.value,g=!1,y=c.alias;y&&(a=y[0],k3(o,z3([0,1],y)));for(var _=1,w=!0;_<o.length;_+=1){var x=o[_],T=Ap(x,0,1),C=Ap(x,-1);if((T==='"'||T==="'"||T==="\`"||C==='"'||C==="'"||C==="\`")&&T!==C)throw new dc("property names with quotes must have matching quotes");if((x==="constructor"||!w)&&(g=!0),a+="."+x,p="%"+a+"%",Tp(ul,p))d=ul[p];else if(d!=null){if(!(x in d)){if(!e)throw new pc("base intrinsic for "+t+" exists, but the property is not available.");return}if(al&&_+1>=o.length){var I=al(d,x);w=!!I,w&&"get"in I&&!("originalValue"in I.get)?d=I.get:d=d[x]}else w=Tp(d,x),d=d[x];w&&!g&&(ul[p]=d)}}return d}});var xf=ye((QV,IE)=>{"use strict";var X3=ll(),f0=X3("%Object.defineProperty%",!0),h0=function(){if(f0)try{return f0({},"a",{value:1}),!0}catch(t){return!1}return!1};h0.hasArrayLengthDefineBug=function(){if(!h0())return null;try{return f0([],"length",{value:1}).length!==1}catch(t){return!0}};IE.exports=h0});var p0=ye((jV,RE)=>{"use strict";var Y3=ll(),Cp=Y3("%Object.getOwnPropertyDescriptor%",!0);if(Cp)try{Cp([],"length")}catch(r){Cp=null}RE.exports=Cp});var Pp=ye((t6,NE)=>{"use strict";var $3=xf()(),d0=ll(),Ef=$3&&d0("%Object.defineProperty%",!0);if(Ef)try{Ef({},"a",{value:1})}catch(r){Ef=!1}var Z3=d0("%SyntaxError%"),gc=d0("%TypeError%"),LE=p0();NE.exports=function(t,e,o){if(!t||typeof t!="object"&&typeof t!="function")throw new gc("\`obj\` must be an object or a function\`");if(typeof e!="string"&&typeof e!="symbol")throw new gc("\`property\` must be a string or a symbol\`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new gc("\`nonEnumerable\`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new gc("\`nonWritable\`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new gc("\`nonConfigurable\`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new gc("\`loose\`, if provided, must be a boolean");var a=arguments.length>3?arguments[3]:null,c=arguments.length>4?arguments[4]:null,p=arguments.length>5?arguments[5]:null,d=arguments.length>6?arguments[6]:!1,g=!!LE&&LE(t,e);if(Ef)Ef(t,e,{configurable:p===null&&g?g.configurable:!p,enumerable:a===null&&g?g.enumerable:!a,value:o,writable:c===null&&g?g.writable:!c});else if(d||!a&&!c&&!p)t[e]=o;else throw new Z3("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")}});var zE=ye((e6,BE)=>{"use strict";var UE=ll(),OE=Pp(),J3=xf()(),DE=p0(),FE=UE("%TypeError%"),K3=UE("%Math.floor%");BE.exports=function(t,e){if(typeof t!="function")throw new FE("\`fn\` is not a function");if(typeof e!="number"||e<0||e>4294967295||K3(e)!==e)throw new FE("\`length\` must be a positive 32-bit integer");var o=arguments.length>2&&!!arguments[2],a=!0,c=!0;if("length"in t&&DE){var p=DE(t,"length");p&&!p.configurable&&(a=!1),p&&!p.writable&&(c=!1)}return(a||c||!o)&&(J3?OE(t,"length",e,!0,!0):OE(t,"length",e)),t}});var Rp=ye((n6,Ip)=>{"use strict";var g0=bp(),mc=ll(),Q3=zE(),j3=mc("%TypeError%"),GE=mc("%Function.prototype.apply%"),HE=mc("%Function.prototype.call%"),VE=mc("%Reflect.apply%",!0)||g0.call(HE,GE),wf=mc("%Object.defineProperty%",!0),tF=mc("%Math.max%");if(wf)try{wf({},"a",{value:1})}catch(r){wf=null}Ip.exports=function(t){if(typeof t!="function")throw new j3("a function is required");var e=VE(g0,HE,arguments);return Q3(e,1+tF(0,t.length-(arguments.length-1)),!0)};var kE=function(){return VE(g0,GE,arguments)};wf?wf(Ip.exports,"apply",{value:kE}):Ip.exports.apply=kE});var m0=ye((r6,XE)=>{"use strict";var WE=ll(),qE=Rp(),eF=qE(WE("String.prototype.indexOf"));XE.exports=function(t,e){var o=WE(t,!!e);return typeof o=="function"&&eF(t,".prototype.")>-1?qE(o):o}});var ZE=ye((i6,$E)=>{"use strict";var nF=Sp()(),rF=m0(),y0=rF("Object.prototype.toString"),Lp=function(t){return nF&&t&&typeof t=="object"&&Symbol.toStringTag in t?!1:y0(t)==="[object Arguments]"},YE=function(t){return Lp(t)?!0:t!==null&&typeof t=="object"&&typeof t.length=="number"&&t.length>=0&&y0(t)!=="[object Array]"&&y0(t.callee)==="[object Function]"},iF=function(){return Lp(arguments)}();Lp.isLegacyArguments=YE;$E.exports=iF?Lp:YE});var yc=ye((o6,jE)=>{"use strict";var oF=a0(),sF=typeof Symbol=="function"&&typeof Symbol("foo")=="symbol",aF=Object.prototype.toString,uF=Array.prototype.concat,JE=Pp(),lF=function(r){return typeof r=="function"&&aF.call(r)==="[object Function]"},KE=xf()(),cF=function(r,t,e,o){if(t in r){if(o===!0){if(r[t]===e)return}else if(!lF(o)||!o())return}KE?JE(r,t,e,!0):JE(r,t,e)},QE=function(r,t){var e=arguments.length>2?arguments[2]:{},o=oF(t);sF&&(o=uF.call(o,Object.getOwnPropertySymbols(t)));for(var a=0;a<o.length;a+=1)cF(r,o[a],t[o[a]],e[o[a]])};QE.supportsDescriptors=!!KE;jE.exports=QE});var v0=ye((s6,ew)=>{"use strict";var tw=function(r){return r!==r};ew.exports=function(t,e){return t===0&&e===0?1/t===1/e:!!(t===e||tw(t)&&tw(e))}});var _0=ye((a6,nw)=>{"use strict";var fF=v0();nw.exports=function(){return typeof Object.is=="function"?Object.is:fF}});var iw=ye((u6,rw)=>{"use strict";var hF=_0(),pF=yc();rw.exports=function(){var t=hF();return pF(Object,{is:t},{is:function(){return Object.is!==t}}),t}});var uw=ye((l6,aw)=>{"use strict";var dF=yc(),gF=Rp(),mF=v0(),ow=_0(),yF=iw(),sw=gF(ow(),Object);dF(sw,{getPolyfill:ow,implementation:mF,shim:yF});aw.exports=sw});var pw=ye((c6,hw)=>{"use strict";var x0=m0(),lw=Sp()(),cw,fw,E0,w0;lw&&(cw=x0("Object.prototype.hasOwnProperty"),fw=x0("RegExp.prototype.exec"),E0={},Np=function(){throw E0},w0={toString:Np,valueOf:Np},typeof Symbol.toPrimitive=="symbol"&&(w0[Symbol.toPrimitive]=Np));var Np,vF=x0("Object.prototype.toString"),_F=Object.getOwnPropertyDescriptor,xF="[object RegExp]";hw.exports=lw?function(t){if(!t||typeof t!="object")return!1;var e=_F(t,"lastIndex"),o=e&&cw(e,"value");if(!o)return!1;try{fw(t,w0)}catch(a){return a===E0}}:function(t){return!t||typeof t!="object"&&typeof t!="function"?!1:vF(t)===xF}});var gw=ye((f6,dw)=>{"use strict";var Sf=function(){return typeof function(){}.name=="string"},Mf=Object.getOwnPropertyDescriptor;if(Mf)try{Mf([],"length")}catch(r){Mf=null}Sf.functionsHaveConfigurableNames=function(){if(!Sf()||!Mf)return!1;var t=Mf(function(){},"name");return!!t&&!!t.configurable};var EF=Function.prototype.bind;Sf.boundFunctionsHaveNames=function(){return Sf()&&typeof EF=="function"&&function(){}.bind().name!==""};dw.exports=Sf});var vw=ye((h6,yw)=>{"use strict";var mw=Pp(),wF=xf()(),MF=gw().functionsHaveConfigurableNames(),SF=TypeError;yw.exports=function(t,e){if(typeof t!="function")throw new SF("\`fn\` is not a function");var o=arguments.length>2&&!!arguments[2];return(!o||MF)&&(wF?mw(t,"name",e,!0,!0):mw(t,"name",e)),t}});var M0=ye((p6,_w)=>{"use strict";var bF=vw(),TF=Object,AF=TypeError;_w.exports=bF(function(){if(this!=null&&this!==TF(this))throw new AF("RegExp.prototype.flags getter called on non-object");var t="";return this.hasIndices&&(t+="d"),this.global&&(t+="g"),this.ignoreCase&&(t+="i"),this.multiline&&(t+="m"),this.dotAll&&(t+="s"),this.unicode&&(t+="u"),this.unicodeSets&&(t+="v"),this.sticky&&(t+="y"),t},"get flags",!0)});var S0=ye((d6,xw)=>{"use strict";var CF=M0(),PF=yc().supportsDescriptors,IF=Object.getOwnPropertyDescriptor;xw.exports=function(){if(PF&&/a/mig.flags==="gim"){var t=IF(RegExp.prototype,"flags");if(t&&typeof t.get=="function"&&typeof RegExp.prototype.dotAll=="boolean"&&typeof RegExp.prototype.hasIndices=="boolean"){var e="",o={};if(Object.defineProperty(o,"hasIndices",{get:function(){e+="d"}}),Object.defineProperty(o,"sticky",{get:function(){e+="y"}}),e==="dy")return t.get}}return CF}});var Mw=ye((g6,ww)=>{"use strict";var RF=yc().supportsDescriptors,LF=S0(),NF=Object.getOwnPropertyDescriptor,OF=Object.defineProperty,DF=TypeError,Ew=Object.getPrototypeOf,FF=/a/;ww.exports=function(){if(!RF||!Ew)throw new DF("RegExp.prototype.flags requires a true ES5 environment that supports property descriptors");var t=LF(),e=Ew(FF),o=NF(e,"flags");return(!o||o.get!==t)&&OF(e,"flags",{configurable:!0,enumerable:!1,get:t}),t}});var Aw=ye((m6,Tw)=>{"use strict";var UF=yc(),BF=Rp(),zF=M0(),Sw=S0(),kF=Mw(),bw=BF(Sw());UF(bw,{getPolyfill:Sw,implementation:zF,shim:kF});Tw.exports=bw});var Pw=ye((y6,Cw)=>{"use strict";var GF=Date.prototype.getDay,HF=function(t){try{return GF.call(t),!0}catch(e){return!1}},VF=Object.prototype.toString,WF="[object Date]",qF=Sp()();Cw.exports=function(t){return typeof t!="object"||t===null?!1:qF?HF(t):VF.call(t)===WF}});var b0=ye((v6,kw)=>{var Iw=a0(),Rw=ZE(),Lw=uw(),Nw=pw(),Ow=Aw(),Dw=Pw(),Fw=Date.prototype.getTime;function zw(r,t,e){var o=e||{};return(o.strict?Lw(r,t):r===t)?!0:!r||!t||typeof r!="object"&&typeof t!="object"?o.strict?Lw(r,t):r==t:XF(r,t,o)}function Uw(r){return r==null}function Bw(r){return!(!r||typeof r!="object"||typeof r.length!="number"||typeof r.copy!="function"||typeof r.slice!="function"||r.length>0&&typeof r[0]!="number")}function XF(r,t,e){var o,a;if(typeof r!=typeof t||Uw(r)||Uw(t)||r.prototype!==t.prototype||Rw(r)!==Rw(t))return!1;var c=Nw(r),p=Nw(t);if(c!==p)return!1;if(c||p)return r.source===t.source&&Ow(r)===Ow(t);if(Dw(r)&&Dw(t))return Fw.call(r)===Fw.call(t);var d=Bw(r),g=Bw(t);if(d!==g)return!1;if(d||g){if(r.length!==t.length)return!1;for(o=0;o<r.length;o++)if(r[o]!==t[o])return!1;return!0}if(typeof r!=typeof t)return!1;try{var y=Iw(r),_=Iw(t)}catch(w){return!1}if(y.length!==_.length)return!1;for(y.sort(),_.sort(),o=y.length-1;o>=0;o--)if(y[o]!=_[o])return!1;for(o=y.length-1;o>=0;o--)if(a=y[o],!zw(r[a],t[a],e))return!1;return!0}kw.exports=zw});var U0=ye((SW,Yw)=>{var FU=b0(),pa=function(r){this.precision=r&&r.precision?r.precision:17,this.direction=r&&r.direction?r.direction:!1,this.pseudoNode=r&&r.pseudoNode?r.pseudoNode:!1,this.objectComparator=r&&r.objectComparator?r.objectComparator:UU};pa.prototype.compare=function(r,t){if(r.type!==t.type||!Xw(r,t))return!1;switch(r.type){case"Point":return this.compareCoord(r.coordinates,t.coordinates);case"LineString":return this.compareLine(r.coordinates,t.coordinates,0,!1);case"Polygon":return this.comparePolygon(r,t);case"Feature":return this.compareFeature(r,t);default:if(r.type.indexOf("Multi")===0){var e=this,o=qw(r),a=qw(t);return o.every(function(c){return this.some(function(p){return e.compare(c,p)})},a)}}return!1};function qw(r){return r.coordinates.map(function(t){return{type:r.type.replace("Multi",""),coordinates:t}})}function Xw(r,t){return r.hasOwnProperty("coordinates")?r.coordinates.length===t.coordinates.length:r.length===t.length}pa.prototype.compareCoord=function(r,t){if(r.length!==t.length)return!1;for(var e=0;e<r.length;e++)if(r[e].toFixed(this.precision)!==t[e].toFixed(this.precision))return!1;return!0};pa.prototype.compareLine=function(r,t,e,o){if(!Xw(r,t))return!1;var a=this.pseudoNode?r:this.removePseudo(r),c=this.pseudoNode?t:this.removePseudo(t);if(!(o&&!this.compareCoord(a[0],c[0])&&(c=this.fixStartIndex(c,a),!c))){var p=this.compareCoord(a[e],c[e]);return this.direction||p?this.comparePath(a,c):this.compareCoord(a[e],c[c.length-(1+e)])?this.comparePath(a.slice().reverse(),c):!1}};pa.prototype.fixStartIndex=function(r,t){for(var e,o=-1,a=0;a<r.length;a++)if(this.compareCoord(r[a],t[0])){o=a;break}return o>=0&&(e=[].concat(r.slice(o,r.length),r.slice(1,o+1))),e};pa.prototype.comparePath=function(r,t){var e=this;return r.every(function(o,a){return e.compareCoord(o,this[a])},t)};pa.prototype.comparePolygon=function(r,t){if(this.compareLine(r.coordinates[0],t.coordinates[0],1,!0)){var e=r.coordinates.slice(1,r.coordinates.length),o=t.coordinates.slice(1,t.coordinates.length),a=this;return e.every(function(c){return this.some(function(p){return a.compareLine(c,p,1,!0)})},o)}else return!1};pa.prototype.compareFeature=function(r,t){return r.id!==t.id||!this.objectComparator(r.properties,t.properties)||!this.compareBBox(r,t)?!1:this.compare(r.geometry,t.geometry)};pa.prototype.compareBBox=function(r,t){return!!(!r.bbox&&!t.bbox||r.bbox&&t.bbox&&this.compareCoord(r.bbox,t.bbox))};pa.prototype.removePseudo=function(r){return r};function UU(r,t){return FU(r,t,{strict:!0})}Yw.exports=pa});var $w=ye((FW,Fp)=>{function Pu(r,t,e,o){this.dataset=[],this.epsilon=1,this.minPts=2,this.distance=this._euclideanDistance,this.clusters=[],this.noise=[],this._visited=[],this._assigned=[],this._datasetLength=0,this._init(r,t,e,o)}Pu.prototype.run=function(r,t,e,o){this._init(r,t,e,o);for(var a=0;a<this._datasetLength;a++)if(this._visited[a]!==1){this._visited[a]=1;var c=this._regionQuery(a);if(c.length<this.minPts)this.noise.push(a);else{var p=this.clusters.length;this.clusters.push([]),this._addToCluster(a,p),this._expandCluster(p,c)}}return this.clusters};Pu.prototype._init=function(r,t,e,o){if(r){if(!(r instanceof Array))throw Error("Dataset must be of type array, "+typeof r+" given");this.dataset=r,this.clusters=[],this.noise=[],this._datasetLength=r.length,this._visited=new Array(this._datasetLength),this._assigned=new Array(this._datasetLength)}t&&(this.epsilon=t),e&&(this.minPts=e),o&&(this.distance=o)};Pu.prototype._expandCluster=function(r,t){for(var e=0;e<t.length;e++){var o=t[e];if(this._visited[o]!==1){this._visited[o]=1;var a=this._regionQuery(o);a.length>=this.minPts&&(t=this._mergeArrays(t,a))}this._assigned[o]!==1&&this._addToCluster(o,r)}};Pu.prototype._addToCluster=function(r,t){this.clusters[t].push(r),this._assigned[r]=1};Pu.prototype._regionQuery=function(r){for(var t=[],e=0;e<this._datasetLength;e++){var o=this.distance(this.dataset[r],this.dataset[e]);o<this.epsilon&&t.push(e)}return t};Pu.prototype._mergeArrays=function(r,t){for(var e=t.length,o=0;o<e;o++){var a=t[o];r.indexOf(a)<0&&r.push(a)}return r};Pu.prototype._euclideanDistance=function(r,t){for(var e=0,o=Math.min(r.length,t.length);o--;)e+=(r[o]-t[o])*(r[o]-t[o]);return Math.sqrt(e)};typeof Fp!="undefined"&&Fp.exports&&(Fp.exports=Pu)});var Zw=ye((UW,Up)=>{function Iu(r,t,e){this.k=3,this.dataset=[],this.assignments=[],this.centroids=[],this.init(r,t,e)}Iu.prototype.init=function(r,t,e){this.assignments=[],this.centroids=[],typeof r!="undefined"&&(this.dataset=r),typeof t!="undefined"&&(this.k=t),typeof e!="undefined"&&(this.distance=e)};Iu.prototype.run=function(r,t){this.init(r,t);for(var e=this.dataset.length,o=0;o<this.k;o++)this.centroids[o]=this.randomCentroid();for(var a=!0;a;){a=this.assign();for(var c=0;c<this.k;c++){for(var p=new Array(_),d=0,g=0;g<_;g++)p[g]=0;for(var y=0;y<e;y++){var _=this.dataset[y].length;if(c===this.assignments[y]){for(var g=0;g<_;g++)p[g]+=this.dataset[y][g];d++}}if(d>0){for(var g=0;g<_;g++)p[g]/=d;this.centroids[c]=p}else this.centroids[c]=this.randomCentroid(),a=!0}}return this.getClusters()};Iu.prototype.randomCentroid=function(){var r=this.dataset.length-1,t,e;do e=Math.round(Math.random()*r),t=this.dataset[e];while(this.centroids.indexOf(t)>=0);return t};Iu.prototype.assign=function(){for(var r=!1,t=this.dataset.length,e,o=0;o<t;o++)e=this.argmin(this.dataset[o],this.centroids,this.distance),e!=this.assignments[o]&&(this.assignments[o]=e,r=!0);return r};Iu.prototype.getClusters=function(){for(var r=new Array(this.k),t,e=0;e<this.assignments.length;e++)t=this.assignments[e],typeof r[t]=="undefined"&&(r[t]=[]),r[t].push(e);return r};Iu.prototype.argmin=function(r,t,e){for(var o=Number.MAX_VALUE,a=0,c=t.length,p,d=0;d<c;d++)p=e(r,t[d]),p<o&&(o=p,a=d);return a};Iu.prototype.distance=function(r,t){for(var e=0,o=Math.min(r.length,t.length);o--;){var a=r[o]-t[o];e+=a*a}return Math.sqrt(e)};typeof Up!="undefined"&&Up.exports&&(Up.exports=Iu)});var B0=ye((BW,Bp)=>{function da(r,t,e){this._queue=[],this._priorities=[],this._sorting="desc",this._init(r,t,e)}da.prototype.insert=function(r,t){for(var e=this._queue.length,o=e;o--;){var a=this._priorities[o];this._sorting==="desc"?t>a&&(e=o):t<a&&(e=o)}this._insertAt(r,t,e)};da.prototype.remove=function(r){for(var t=this._queue.length;t--;){var e=this._queue[t];if(r===e){this._queue.splice(t,1),this._priorities.splice(t,1);break}}};da.prototype.forEach=function(r){this._queue.forEach(r)};da.prototype.getElements=function(){return this._queue};da.prototype.getElementPriority=function(r){return this._priorities[r]};da.prototype.getPriorities=function(){return this._priorities};da.prototype.getElementsWithPriorities=function(){for(var r=[],t=0,e=this._queue.length;t<e;t++)r.push([this._queue[t],this._priorities[t]]);return r};da.prototype._init=function(r,t,e){if(r&&t){if(this._queue=[],this._priorities=[],r.length!==t.length)throw new Error("Arrays must have the same length");for(var o=0;o<r.length;o++)this.insert(r[o],t[o])}e&&(this._sorting=e)};da.prototype._insertAt=function(r,t,e){this._queue.length===e?(this._queue.push(r),this._priorities.push(t)):(this._queue.splice(e,0,r),this._priorities.splice(e,0,t))};typeof Bp!="undefined"&&Bp.exports&&(Bp.exports=da)});var Kw=ye((zW,_c)=>{typeof _c!="undefined"&&_c.exports&&(Jw=B0());var Jw;function Za(r,t,e,o){this.epsilon=1,this.minPts=1,this.distance=this._euclideanDistance,this._reachability=[],this._processed=[],this._coreDistance=0,this._orderedList=[],this._init(r,t,e,o)}Za.prototype.run=function(r,t,e,o){this._init(r,t,e,o);for(var a=0,c=this.dataset.length;a<c;a++)if(this._processed[a]!==1){this._processed[a]=1,this.clusters.push([a]);var p=this.clusters.length-1;this._orderedList.push(a);var d=new Jw(null,null,"asc"),g=this._regionQuery(a);this._distanceToCore(a)!==void 0&&(this._updateQueue(a,g,d),this._expandCluster(p,d))}return this.clusters};Za.prototype.getReachabilityPlot=function(){for(var r=[],t=0,e=this._orderedList.length;t<e;t++){var o=this._orderedList[t],a=this._reachability[o];r.push([o,a])}return r};Za.prototype._init=function(r,t,e,o){if(r){if(!(r instanceof Array))throw Error("Dataset must be of type array, "+typeof r+" given");this.dataset=r,this.clusters=[],this._reachability=new Array(this.dataset.length),this._processed=new Array(this.dataset.length),this._coreDistance=0,this._orderedList=[]}t&&(this.epsilon=t),e&&(this.minPts=e),o&&(this.distance=o)};Za.prototype._updateQueue=function(r,t,e){var o=this;this._coreDistance=this._distanceToCore(r),t.forEach(function(a){if(o._processed[a]===void 0){var c=o.distance(o.dataset[r],o.dataset[a]),p=Math.max(o._coreDistance,c);o._reachability[a]===void 0?(o._reachability[a]=p,e.insert(a,p)):p<o._reachability[a]&&(o._reachability[a]=p,e.remove(a),e.insert(a,p))}})};Za.prototype._expandCluster=function(r,t){for(var e=t.getElements(),o=0,a=e.length;o<a;o++){var c=e[o];if(this._processed[c]===void 0){var p=this._regionQuery(c);this._processed[c]=1,this.clusters[r].push(c),this._orderedList.push(c),this._distanceToCore(c)!==void 0&&(this._updateQueue(c,p,t),this._expandCluster(r,t))}}};Za.prototype._distanceToCore=function(r){for(var t=this.epsilon,e=0;e<t;e++){var o=this._regionQuery(r,e);if(o.length>=this.minPts)return e}};Za.prototype._regionQuery=function(r,t){t=t||this.epsilon;for(var e=[],o=0,a=this.dataset.length;o<a;o++)this.distance(this.dataset[r],this.dataset[o])<t&&e.push(o);return e};Za.prototype._euclideanDistance=function(r,t){for(var e=0,o=Math.min(r.length,t.length);o--;)e+=(r[o]-t[o])*(r[o]-t[o]);return Math.sqrt(e)};typeof _c!="undefined"&&_c.exports&&(_c.exports=Za)});var Qw=ye((kW,zp)=>{typeof zp!="undefined"&&zp.exports&&(zp.exports={DBSCAN:$w(),KMEANS:Zw(),OPTICS:Kw(),PriorityQueue:B0()})});var z0=ye((XW,tM)=>{"use strict";tM.exports={eudist:function(t,e,o){for(var a=t.length,c=0,p=0;p<a;p++){var d=(t[p]||0)-(e[p]||0);c+=d*d}return o?Math.sqrt(c):c},mandist:function(t,e,o){for(var a=t.length,c=0,p=0;p<a;p++)c+=Math.abs((t[p]||0)-(e[p]||0));return o?Math.sqrt(c):c},dist:function(t,e,o){var a=Math.abs(t-e);return o?a:a*a}}});var rM=ye((YW,nM)=>{"use strict";var eM=z0(),VU=eM.eudist,WU=eM.dist;nM.exports={kmrand:function(t,e){for(var o={},a=[],c=e<<2,p=t.length,d=t[0].length>0;a.length<e&&c-- >0;){var g=t[Math.floor(Math.random()*p)],y=d?g.join("_"):""+g;o[y]||(o[y]=!0,a.push(g))}if(a.length<e)throw new Error("Error initializating clusters");return a},kmpp:function(t,e){var o=t[0].length?VU:WU,a=[],c=t.length,p=t[0].length>0,d={},g=t[Math.floor(Math.random()*c)],y=p?g.join("_"):""+g;for(a.push(g),d[y]=!0;a.length<e;){for(var _=[],w=a.length,x=0,T=[],C=0;C<c;C++){for(var I=1/0,M=0;M<w;M++){var E=o(t[C],a[M]);E<=I&&(I=E)}_[C]=I}for(var L=0;L<c;L++)x+=_[L];for(var A=0;A<c;A++)T[A]={i:A,v:t[A],pr:_[A]/x,cs:0};T.sort(function(X,U){return X.pr-U.pr}),T[0].cs=T[0].pr;for(var z=1;z<c;z++)T[z].cs=T[z-1].cs+T[z].pr;for(var G=Math.random(),Y=0;Y<c-1&&T[Y++].cs<G;);a.push(T[Y-1].v)}return a}}});var uM=ye((JW,aM)=>{"use strict";var k0=z0(),sM=rM(),qU=k0.eudist,$W=k0.mandist,ZW=k0.dist,XU=sM.kmrand,YU=sM.kmpp,iM=1e4;function oM(r,t,e){e=e||[];for(var o=0;o<r;o++)e[o]=t;return e}function $U(r,t,e,o){var a=[],c=[],p=[],d=[],g=!1,y=o||iM,_=r.length,w=r[0].length,x=w>0,T=[];if(e)e=="kmrand"?a=XU(r,t):e=="kmpp"?a=YU(r,t):a=e;else for(var C={};a.length<t;){var I=Math.floor(Math.random()*_);C[I]||(C[I]=!0,a.push(r[I]))}do{oM(t,0,T);for(var M=0;M<_;M++){for(var E=1/0,L=0,A=0;A<t;A++){var d=x?qU(r[M],a[A]):Math.abs(r[M]-a[A]);d<=E&&(E=d,L=A)}p[M]=L,T[L]++}for(var z=[],c=[],G=0,Y=0;Y<t;Y++)z[Y]=x?oM(w,0,z[Y]):0,c[Y]=a[Y];if(x){for(var X=0;X<t;X++)a[X]=[];for(var U=0;U<_;U++)for(var H=p[U],Q=z[H],gt=r[U],$=0;$<w;$++)Q[$]+=gt[$];g=!0;for(var Nt=0;Nt<t;Nt++){for(var j=a[Nt],pt=z[Nt],Ct=c[Nt],Tt=T[Nt],ft=0;ft<w;ft++)j[ft]=pt[ft]/Tt||0;if(g){for(var dt=0;dt<w;dt++)if(Ct[dt]!=j[dt]){g=!1;break}}}}else{for(var Z=0;Z<_;Z++){var st=p[Z];z[st]+=r[Z]}for(var vt=0;vt<t;vt++)a[vt]=z[vt]/T[vt]||0;g=!0;for(var zt=0;zt<t;zt++)if(c[zt]!=a[zt]){g=!1;break}}g=g||--y<=0}while(!g);return{it:iM-y,k:t,idxs:p,centroids:a}}aM.exports=$U});var Sc=ye((X0,Y0)=>{(function(r,t){typeof X0=="object"&&typeof Y0!="undefined"?Y0.exports=t():typeof define=="function"&&define.amd?define(t):(r=typeof globalThis!="undefined"?globalThis:r||self,r.polygonClipping=t())})(X0,function(){"use strict";function r(it,B){if(!(it instanceof B))throw new TypeError("Cannot call a class as a function")}function t(it,B){for(var P=0;P<B.length;P++){var F=B[P];F.enumerable=F.enumerable||!1,F.configurable=!0,"value"in F&&(F.writable=!0),Object.defineProperty(it,F.key,F)}}function e(it,B,P){return B&&t(it.prototype,B),P&&t(it,P),it}var o=function(){function it(B,P){this.next=null,this.key=B,this.data=P,this.left=null,this.right=null}return it}();function a(it,B){return it>B?1:it<B?-1:0}function c(it,B,P){for(var F=new o(null,null),J=F,rt=F;;){var D=P(it,B.key);if(D<0){if(B.left===null)break;if(P(it,B.left.key)<0){var N=B.left;if(B.left=N.right,N.right=B,B=N,B.left===null)break}rt.left=B,rt=B,B=B.left}else if(D>0){if(B.right===null)break;if(P(it,B.right.key)>0){var N=B.right;if(B.right=N.left,N.left=B,B=N,B.right===null)break}J.right=B,J=B,B=B.right}else break}return J.right=B.left,rt.left=B.right,B.left=F.right,B.right=F.left,B}function p(it,B,P,F){var J=new o(it,B);if(P===null)return J.left=J.right=null,J;P=c(it,P,F);var rt=F(it,P.key);return rt<0?(J.left=P.left,J.right=P,P.left=null):rt>=0&&(J.right=P.right,J.left=P,P.right=null),J}function d(it,B,P){var F=null,J=null;if(B){B=c(it,B,P);var rt=P(B.key,it);rt===0?(F=B.left,J=B.right):rt<0?(J=B.right,B.right=null,F=B):(F=B.left,B.left=null,J=B)}return{left:F,right:J}}function g(it,B,P){return B===null?it:(it===null||(B=c(it.key,B,P),B.left=it),B)}function y(it,B,P,F,J){if(it){F(""+B+(P?"\\u2514\\u2500\\u2500 ":"\\u251C\\u2500\\u2500 ")+J(it)+\`
|
|
105
|
+
`);var $t=class extends _.ShaderMaterial{constructor(n){super({uniforms:Object.assign({},_.UniformsLib.fog,{lineWidth:{value:1},map:{value:null},useMap:{value:0},alphaMap:{value:null},useAlphaMap:{value:0},color:{value:new _.Color(16777215)},opacity:{value:1},resolution:{value:new _.Vector2(1,1)},sizeAttenuation:{value:1},dashArray:{value:0},dashOffset:{value:0},dashRatio:{value:.5},useDash:{value:0},visibility:{value:1},alphaTest:{value:0},repeat:{value:new _.Vector2(1,1)},thresholdRatio:{value:0},transparent:{value:!0},depthTest:{vale:!1},depthWrite:{value:!1}}),vertexShader:_.ShaderChunk.meshline_vert,fragmentShader:_.ShaderChunk.meshline_frag}),this.isMeshLineMaterial=!0,this.type="MeshLineMaterial",Object.defineProperties(this,{lineWidth:{enumerable:!0,get:function(){return this.uniforms.lineWidth.value},set:function(t){this.uniforms.lineWidth.value=t}},map:{enumerable:!0,get:function(){return this.uniforms.map.value},set:function(t){this.uniforms.map.value=t}},useMap:{enumerable:!0,get:function(){return this.uniforms.useMap.value},set:function(t){this.uniforms.useMap.value=t}},alphaMap:{enumerable:!0,get:function(){return this.uniforms.alphaMap.value},set:function(t){this.uniforms.alphaMap.value=t}},useAlphaMap:{enumerable:!0,get:function(){return this.uniforms.useAlphaMap.value},set:function(t){this.uniforms.useAlphaMap.value=t}},color:{enumerable:!0,get:function(){return this.uniforms.color.value},set:function(t){this.uniforms.color.value=t}},opacity:{enumerable:!0,get:function(){return this.uniforms.opacity.value},set:function(t){this.uniforms.opacity.value=t}},resolution:{enumerable:!0,get:function(){return this.uniforms.resolution.value},set:function(t){this.uniforms.resolution.value.copy(t)}},sizeAttenuation:{enumerable:!0,get:function(){return this.uniforms.sizeAttenuation.value},set:function(t){this.uniforms.sizeAttenuation.value=t}},dashArray:{enumerable:!0,get:function(){return this.uniforms.dashArray.value},set:function(t){this.uniforms.dashArray.value=t,this.useDash=t!==0?1:0}},dashOffset:{enumerable:!0,get:function(){return this.uniforms.dashOffset.value},set:function(t){this.uniforms.dashOffset.value=t}},dashRatio:{enumerable:!0,get:function(){return this.uniforms.dashRatio.value},set:function(t){this.uniforms.dashRatio.value=t}},useDash:{enumerable:!0,get:function(){return this.uniforms.useDash.value},set:function(t){this.uniforms.useDash.value=t}},visibility:{enumerable:!0,get:function(){return this.uniforms.visibility.value},set:function(t){this.uniforms.visibility.value=t}},alphaTest:{enumerable:!0,get:function(){return this.uniforms.alphaTest.value},set:function(t){this.uniforms.alphaTest.value=t}},repeat:{enumerable:!0,get:function(){return this.uniforms.repeat.value},set:function(t){this.uniforms.repeat.value.copy(t)}},thresholdRatio:{enumerable:!0,get:function(){return this.uniforms.thresholdRatio.value},set:function(t){this.uniforms.thresholdRatio.value=t}}}),this.setValues(n)}};$t.prototype.copy=function(s){return _.ShaderMaterial.prototype.copy.call(this,s),this.lineWidth=s.lineWidth,this.map=s.map,this.useMap=s.useMap,this.alphaMap=s.alphaMap,this.useAlphaMap=s.useAlphaMap,this.color.copy(s.color),this.opacity=s.opacity,this.resolution.copy(s.resolution),this.sizeAttenuation=s.sizeAttenuation,this.dashArray.copy(s.dashArray),this.dashOffset.copy(s.dashOffset),this.dashRatio.copy(s.dashRatio),this.useDash=s.useDash,this.visibility=s.visibility,this.alphaTest=s.alphaTest,this.repeat.copy(s.repeat),this};var Er="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAAAQCAMAAACROYkbAAABrVBMVEVsjPdsjPdqi/doifdpivdrjPdsjPdsjPd/m/igtfqTq/lykfdri/dsjPdtjfe/zPv8/f/w8/6zw/p0kvdri/dsjPdtjffU3vz////////3+f62xfpzkfdri/dsjPdsjPeZr/nr8P7////////4+f62xfp0kvdri/dsjPdsjPdujveXrvne5v3////////3+f63x/t2lPdri/dsjPdsjPdsjPdri/eMpfjb4/3+/v/////4+v+7yft1k/dri/dsjPdsjPdri/eJovjl6/3////////3+f6Jo/lqivdsjPdri/dvjveluPry9f7////////i6f2BnPhqi/dsjPdrjPdvjveluPrv8v7////////l6/6Uq/lsjPdsjPdsjPdvjveluPrv8v7////////m6/6Uq/lsjPdsjPdsjPdsjPeZr/nv8v7////////s8f6XrvlsjPdsjPdtjffS2/z////////w9P6bsfltjfdsjPdtjffBz/v7/P/y9f6svvpxkPdrjPdsjPdsjPd+mviftPqVrPlykfdri/dsjPdsjPdri/doifdpifdrjPdsjPclkRlrAAAAx0lEQVQ4y2NgwAsYmZhZWNkYyAfsHJxc3Dy85BvAxy8gKCQsIkq2AWLiEpJS0jKycuQaIK+gqKSsoqqmrkGmAZpa2jq6evoGhkbG5BlgYmpmbmFpZW1ja0emE+wdHJ2cXVzd3D3INMDTy9vH188/IDCIPP3BIaFh4RGRUdExseQZEBefkJiUnJKalp5BngGZWdk5uXn5BemFZAZBUXFJaVl5RSWZ9jMwVFXX1NbVNzSSq5+hqbmlta29g2z9DJ1d3T29ffhUAABKPSh5Xst3GwAAAABJRU5ErkJggg==";var br={texture_url:Er,lineWidth:8,color:16777215},Le=class extends I.Object3D{constructor(t,e){super();this.navigation=t;this.config=Object.assign({},br,e),this.registryEvent(),this.prevCameraZoom=this.navigation.bmap.context.camera.zoom}mesh=null;geometry=null;material=null;texture=null;config=br;points=[];basicRepeat=1;prevCameraZoom=0;registryEvent(){this.navigation.bmap.context.addEventListener("control-change",this.onControlChange),this.navigation.bmap.context.addEventListener("update",this.onUpdate),this.navigation.bmap.context.addEventListener("resize",this.onResize)}unRegistryEvent(){this.navigation.bmap.context.removeEventListener("control-change",this.onControlChange),this.navigation.bmap.context.removeEventListener("update",this.onUpdate),this.navigation.bmap.context.removeEventListener("resize",this.onResize)}onControlChange=()=>{let t=this.navigation.bmap.context.camera.zoom;t!==this.prevCameraZoom&&(this.prevCameraZoom=t,this.changeRepeat())};onUpdate=()=>{this.texture};onResize=()=>{if(this.material){let{width:t,height:e}=this.navigation.bmap.context.clientSize;this.material.resolution.set(t,e)}};getRepeat(){let{points:t,navigation:{bmap:{context:{camera:e,clientSize:{width:r,height:i}}}}}=this,o=t.map(([l,u])=>x(new I.Vector3(l,u,0),e,r,i)).map(({x:l,y:u})=>[l,u]);return at(o)/32}changeRepeat(){if(!this.material)return;let t=this.getRepeat();this.material.repeat=new I.Vector2(t,1)}loadTexture(t){return new Promise((e,r)=>{new I.TextureLoader().load(t,e,void 0,r)})}transformPoints(t){let e=[];for(let r=0;r<t.length;r++)e.push(...t[r],0);return e}updatePoints(t){this.points=t,this.changeRepeat();let e=this.transformPoints(t);this.geometry&&this.geometry.setPoints(e)}movePath(t){this.material&&(this.material.thresholdRatio=t)}async create(t){let e=this.geometry=new K;if(this.updatePoints(t),!this.texture){let o=this.texture=await this.loadTexture(this.config.texture_url);o.wrapS=o.wrapT=I.RepeatWrapping}let r=this.material=new $t({useMap:!0,color:new I.Color(this.config.color),transparent:!0,resolution:new I.Vector2(this.navigation.bmap.context.clientSize.width,this.navigation.bmap.context.clientSize.height),depthTest:!0,sizeAttenuation:!1,lineWidth:this.config.lineWidth*2,map:this.texture,blending:I.NormalBlending,repeat:new I.Vector2(this.getRepeat(),1)}),i=this.mesh=new I.Mesh(e,r);return i.renderOrder=9,this.add(i),i}dispose(){this.unRegistryEvent(),this.clear(),this.geometry?.dispose(),this.material?.dispose(),this.texture?.dispose()}};var Zt=g("@tweenjs/tween.js"),bt=g("three");var Sr=g("three");var Mr=g("@tweenjs/tween.js"),bi={offsetDistance:15,offsetToResetTime:3e3,directionEmitThreshold:5,simulationSpeed:1},Ne=class extends Sr.EventDispatcher{constructor(t,e){super();this.navigation=t;this.options=Object.assign({},bi,e),this.registryEvent()}offset=!1;reset=!1;position=[0,0];routeIndex=0;pointIndex=0;paths=[];options;timer=new U;resetTimer=null;tweenUtil=new zt;simulationTween;get curRoutePath(){return this.paths[this.routeIndex]||null}get curRoutePathPoints(){return this.curRoutePath?.points||[]}registryEvent(){this.navigation.bmap.context.addEventListener("update",this.onUpdate),this.navigation.addEventListener("add-path",this.onAddPaths)}unRegistryEvent(){this.navigation.bmap.context.removeEventListener("update",this.onUpdate),this.navigation.removeEventListener("add-path",this.onAddPaths)}onAddPaths=({paths:t})=>{this.paths=t,this.resetStatus(t),this.emitNavigationStatus()};onUpdate=()=>{this.tweenUtil.update()};resetStatus(t){this.offset=!1,this.reset=!1,this.routeIndex=0,t.length&&(this.position=t[0].points[0])}emitNavigationStatus(){let t=this.getNavigationInfo();t&&this.dispatchEvent({type:"navigation-info",info:t})}adsorb(t,e){let{curRoutePathPoints:r,position:i,curRoutePath:o,paths:a,routeIndex:l}=this;if(!r.length)return null;let u=r;if(i){let p=Dt(r,i);u=u.slice(p+1),u.unshift(i)}let c=[{floor:o?.floor,points:u},...a.slice(l+1)].filter(p=>p.floor===t),{distance:h,closestPoint:f,index:d,i:y}=c.reduce((p,m,b)=>{let{distance:E,closestPoint:z,index:S}=m.points.reduce((T,O,dt,St)=>{if(!St[dt+1])return T;let{distance:Wt,closestPoint:We}=Tn(e,O,St[dt+1]);return Wt<T.distance?{distance:Wt,closestPoint:We,index:dt}:T},{distance:1/0,closestPoint:m.points[0],index:0});return E<p.distance?{distance:E,closestPoint:z,index:b,i:S}:p},{distance:1/0,closestPoint:u[0],index:0,i:0});return{distance:h,closestPoint:f,routeIndex:d+l,pointIndex:d===0?y+this.pointIndex:y}}toPosition(t,e){let r=this.adsorb(t,e);if(!r)return;let{distance:i,closestPoint:o,routeIndex:a,pointIndex:l}=r;i>this.options.offsetDistance?(this.offset=!0,this.resetTimer||(this.resetTimer=this.timer.setTimeout(()=>{this.reset=!0,this.resetTimer=null},this.options.offsetToResetTime))):(this.offset=!1,this.reset=!1,this.resetTimer&&this.timer.clearTimeout(this.resetTimer)),this.routeIndex=a,this.pointIndex=l,this.position=o,this.emitNavigationStatus()}startSimulation(){this.resetStatus(this.paths),this.emitNavigationStatus(),this.startCurRouteSimulation()}async startCurRouteSimulation(){let{curRoutePath:t}=this;if(!t)return;this.simulationTween&&this.tweenUtil.remove(this.simulationTween);let e=[];return new Promise(r=>{let i=[this.position,...this.curRoutePathPoints.slice(this.pointIndex+1)],o=this.getCurRouteRemainDistance(),a=o/this.options.simulationSpeed,l=this.simulationTween=new Mr.Tween({distance:0},this.tweenUtil.group).to({distance:o},a*1e3).onUpdate(u=>{let c=ee(i,u.distance);c&&(e.push({floor:t.floor,pos:c}),this.toPosition(t.floor,c))}).onComplete(()=>{this.tweenUtil.remove(l),this.routeIndex+1<this.paths.length?(this.routeIndex++,this.position=this.paths[this.routeIndex].points[0],this.pointIndex=0,r(this.startCurRouteSimulation())):(r(!0),console.log(e))}).start()})}changeSimulationSpeed(t){this.options.simulationSpeed=t,this.startCurRouteSimulation()}getCurRouteRemainDistance(){let{curRoutePathPoints:t,pointIndex:e,position:r}=this;if(!t.length)return 0;let i=[r,...t.slice(e+1)];return at(i)}getRemainDistance(){let t=this.getCurRouteRemainDistance();return{total:this.paths.slice(this.routeIndex+1).reduce((i,o)=>i+o.distance,0)+t,curRoute:t}}getNextDirDistance(){if(!this.position)return null;let{pointIndex:t,curRoutePathPoints:e,position:r}=this,i=e[t],o=e[t+1],a=e[t+2];if(!i||!o)return null;let l=F(r,o);return t===0&&F(i,r)<5?{dir:"start",distance:l}:a?{dir:Ye(i,o,a),distance:l}:{dir:"end",distance:l}}getNavigationInfo(){let{total:t,curRoute:e}=this.getRemainDistance(),r=this.getNextDirDistance();if(!r)return null;let{dir:i,distance:o}=r;return i==="end"&&o>15&&(i="front"),i!=="start"&&o>=this.options.directionEmitThreshold&&(i="front"),{distance:t,curRouteDistance:e,nextDirDistance:o,dir:i,pos:this.position,routeIndex:this.routeIndex,offset:this.offset,reset:this.reset}}dispose(){this.timer.dispose(),this.unRegistryEvent(),this.tweenUtil.clear()}};var Si={path:{},cheapMaximumDistance:20,needStartPoi:!1,startPoi:{},positionNavigation:{},offsetY:150,directionEmitThreshold:5,disablePathAnimation:!1,speed:1},wr=class extends pt{path=null;fetchRoadStatus=!1;paths=[];curPathIndex=0;curFloorPath=null;translatePath=null;currentPathPosition=null;options;pathTween=null;startPoi=null;movedDistance=0;pathStart=[0,0];tweenUtil=new zt;animationPathOptions={cPathIndex:0};cPath=[];positionNavigation;pathMoving=!1;nextPoint=null;constructor(n,t={},e){super(n),!e&&typeof t=="object"&&(e=t),this.options=Object.assign({},Si,e);let{apiDomain:r,apiPath:{roadNetwork:i},apiInfo:o}=this.bmap.config;this.positionNavigation=new Ne(this,{simulationSpeed:this.options.speed,...this.options.positionNavigation}),this.registryEvent()}get curFloorPathLength(){return this.curFloorPath?.distance??0}get curFloorPathPoints(){return this.curFloorPath?.points??[]}registryEvent(){this.bmap.context.addEventListener("update",this.onUpdate),this.bmap.addEventListener("switch_floor_after",this.onSwitchFloor),this.positionNavigation.addEventListener("navigation-info",this.onNavigationInfo)}onNavigationInfo=({info:n})=>{if(this.dispatchEvent({type:"navigation-info",info:n}),!n.offset){if(n.routeIndex!==this.curPathIndex)return;this.pathMoving?this.nextPoint=n.pos:(this.toPositionBySpeed(n.pos,this.options.speed),this.nextPoint=null)}};pauseAnimation(){this.tweenUtil.pause(),this.positionNavigation.tweenUtil.pause()}continueAnimation(){this.tweenUtil.continue(),this.positionNavigation.tweenUtil.continue()}unRegistryEvent(){this.bmap.context.removeEventListener("update",this.onUpdate),this.bmap.removeEventListener("switch_floor_after",this.onSwitchFloor),this.positionNavigation.removeEventListener("navigation-info",this.onNavigationInfo)}onUpdate=()=>{this.tweenUtil.update()};clearPath(){this.path&&(this.bmap.context.scene.remove(this.path),this.path.dispose(),this.path=null,this.tweenUtil.clear()),this.startPoi&&(this.bmap.context.currentFloor?.poiLayer2.removePoi(this.startPoi),this.startPoi=null),this.translatePath=null}setCurFloorPath(n){n===null?(this.curFloorPath=null,this.currentPathPosition=null):(this.curFloorPath=n,this.currentPathPosition=n.points[0]),this.movedDistance=0}setCurPathIndex(n){this.curPathIndex=n,this.paths[n]?.floor===this.bmap.context.currentFloor?.name?(this.setCurFloorPath(this.paths[n]),this.renderPath(this.translatePoints(this.curFloorPathPoints))):this.clearPath()}onSwitchFloor=({data:{curFloor:n}})=>{if(this.tweenUtil.clear(),this.nextPoint=null,this.pathMoving=!1,this.paths[this.curPathIndex]){let t=this.paths[this.curPathIndex];this.setCurFloorPath(t??null),t?this.renderPath(this.translatePoints(t.points)):this.clearPath()}else this.clearPath()};addPath(n,t=0){this.paths=n,this.curPathIndex=t;let e=this.bmap.context.currentFloor?.name,r=n[t];if(e&&r?.floor===e)if(this.setCurFloorPath(r),this.bmap.currentBuildGround)this.renderPath(this.translatePoints(r.points));else{let i=()=>{this.bmap.removeEventListener("center-change",i),this.renderPath(this.translatePoints(r.points))};this.bmap.addEventListener("center-change",i)}else this.clearPath();this.dispatchEvent({type:"add-path",paths:n})}translatePoints(n){let[t,e]=this.bmap.buildingCenter;return n.map(r=>[r[0]-t,r[1]-e])}renderPath(n){this.translatePath=n;let t=this.catmullRomCurve3(n);this.cPath=t,this.animationPathOptions={cPathIndex:0},this.pathStart=t[0],this.path?this.path.updatePoints(t):(this.path=new Le(this,this.options.path),this.path.create(t),this.path.position.z=this.bmap.context.currentFloor.groundMaxHeight+.5,this.bmap.context.scene.add(this.path)),this.startPoi&&(this.bmap.context.currentFloor?.poiLayer2.removePoi(this.startPoi),this.startPoi=null),this.options.needStartPoi&&(this.startPoi=new $(this.bmap.context,{...this.options.startPoi,id:"navigation_start_poi",position:{x:t[0][0],y:t[0][1],z:.51},collision_enable:!1})||null,this.bmap.context.currentFloor?.poiLayer2.pushPoi(this.startPoi)),this.dispatchEvent({type:"render-path",path:this.path})}catmullRomCurve3(n){return wn(n,!1,!0,.1,170,2.5)}getPathDirection(){if(!this.curFloorPath||!this.currentPathPosition||this.curFloorPathPoints.length<2)return null;let n=Dt(this.curFloorPathPoints,this.currentPathPosition),t=this.curFloorPathPoints[n],e=this.curFloorPathPoints[n+1],r=new bt.Vector3(e[0]-t[0],e[1]-t[1],0).normalize(),i=new bt.Vector3(0,1,0).normalize(),o=r.angleTo(i),a=new bt.Vector3().crossVectors(i,r);return(Object.is(a.y,0)?-1:1)*o}async changeCameraToPathUp(n=100){let t=this.getPathDirection();if(t===null)return;let e=this.bmap.context.control.getAzimuthalAngle();Math.abs(e-t)>Math.PI&&(e>0?t=Math.PI*2+t:t=t-Math.PI*2);let r=Math.abs(t-this.bmap.context.control.getAzimuthalAngle());if(r<.01)return;let{control:i}=this.bmap.context,o=n/Math.PI*6*r;return new Promise(a=>{let l={azimuthal:i.getAzimuthalAngle()},u={azimuthal:t},c=new Zt.Tween(l,this.tweenUtil.group).to(u,o).easing(Zt.Easing.Quadratic.InOut).onUpdate(async()=>{i.target.copy(this.startPoi.position),i.setAzimuthalAngle(l.azimuthal,!0),i.setTargetByOffset(this.options.offsetY)}).onComplete(()=>{i.enabled=!0,this.tweenUtil.remove(c),a(!0)}).onStart(()=>{i.enabled=!1}).start()})}async initNavigationCamera(){await this.translateCameraToStartPoi(300),await this.changeCameraToPathUp(300)}async translateCameraToStartPoi(n=100){if(!this.startPoi)return;let{clientSize:{width:t,height:e},camera:r,control:i}=this.bmap.context,o=Math.round(t/2),a=Math.round(e/2),l=i.target.clone(),u=x(this.startPoi.position,r,t,e),c=u.x-o,h=a-u.y+this.options.offsetY;if(!(Math.abs(c)<1&&Math.abs(h)<1)){if(Math.abs(c)>=1){let f=new bt.Vector3;f.setFromMatrixColumn(r.matrix,0),f.normalize(),f.multiplyScalar(c/r.zoom),l.add(new bt.Vector3(f.x,0,0))}if(Math.abs(h)>=1){let f=new bt.Vector3;f.setFromMatrixColumn(r.matrix,1),f.normalize(),f.multiplyScalar(h/r.zoom),l.add(new bt.Vector3(0,f.y,0))}return this.bmap.context.setCameraPosition(l,n)}}async initCameraZoom(n=100){if(!this.startPoi)return;let{clientSize:{width:t,height:e},currentFloor:r}=this.bmap.context,{max:i,min:o}=r.box,l=Math.min(t/(i.x-o.x),e/(i.y-o.y))*(i.x-o.x)/20;return this.bmap.context.setZoom(l,this.startPoi.position,n)}toPosition(n,t){this.positionNavigation.toPosition(n,t)}startSimulation(){this.positionNavigation.startSimulation()}setSimulationSpeed(n){this.positionNavigation.changeSimulationSpeed(n)}async toPositionBySpeed(n,t){let{currentPathPosition:e,curFloorPath:r,curFloorPathPoints:i}=this;if(!r||!e)return null;let o=this.movedDistance,a=Pn(i,n);if(o===-1||a===-1||a<=o)return null;let l=a-o;if(!l)return;let u=Math.min(l/t,3);return this.pathTween&&this.tweenUtil.clear(),this.pathMoving=!0,new Promise(c=>{let h=this.pathTween=new Zt.Tween({distance:0},this.tweenUtil.group).to({distance:l},u*1e3).onUpdate(async f=>{this.moveDistance(f.distance+o,h)}).onComplete(()=>{if(this.tweenUtil.remove(h),console.log("this.nextPoint",this.nextPoint),this.nextPoint){let f=this.nextPoint;return this.nextPoint=null,this.toPositionBySpeed(f,this.options.speed)}else c(!0)}).start()}).then(()=>{this.pathMoving=!1})}async moveDistance(n,t){this.movedDistance=n,this.path?.movePath(this.movedDistance/this.curFloorPathLength);let e=ee(this.curFloorPathPoints,this.movedDistance);if(e===null)return;this.currentPathPosition=e;let r=this.translatePoints([e])[0];this.startPoi&&(this.startPoi.position.setX(r[0]).setY(r[1]),this.options.disablePathAnimation||this.bmap.context.control.setTargetByOffset(this.options.offsetY,this.startPoi.position.clone())),this.options.disablePathAnimation||(t?.pause(),this.positionNavigation.tweenUtil.pause(),await this.changeCameraToPathUp(500/this.options.speed),this.positionNavigation.tweenUtil.continue(),t?.resume())}setStartPoiRotate(n){if(this.startPoi){let e=this.bmap.context.control.getAzimuthalAngle()*180/Math.PI;this.startPoi.options.icon_rotate=n-e}}dispose(){this.tweenUtil.dispose(),this.unRegistryEvent(),this.path?.dispose(),this.startPoi?.dispose(),this.positionNavigation.dispose()}};var Cr=g("three"),Tr=class extends pt{poiLayer;floors=[];group=new Cr.Group;constructor(n){super(n),this.poiLayer=new kt(n.context)}show(n){let t=n[0].userData.height;n.forEach(i=>{i.poiLayer.pois.forEach(o=>{this.poiLayer.pushPoi(o)}),i.poiLayer.pois.length=0,i.poiLayer.dispose(),i.position.z=t,t+=i.userData.height});let{scene:e,currentFloor:r}=this.bmap.context;r&&(e.remove(r),r.dispose()),this.group.add(this.poiLayer,...n),e.add(this.group),this.floors=n,this.bmap.context.cameraBound.updateBox()}hide(){let{scene:n}=this.bmap.context;n.remove(this.group),this.poiLayer.clear(!0),this.floors.forEach(t=>{t.dispose()}),this.floors=[],this.group.clear()}fitCamera(){let{context:n,config:t,type:e}=this.bmap;n.cameraBound.setEnable(!1),n.control.minZoom=0,n.control.maxZoom=1/0,n.camera.zoom=1,n.setAzimuthalAngle(t.control.defaultAzimuthal,0),n.setPolarAngle(t.control.defaultPolar,0),n.fitCameraToObject(this.group,void 0,0);let r=n.camera.zoom;n.control.minZoom=r,n.control.maxZoom=r*25,e==="3d"&&n.fitCameraToObject(this.group,t.defaultPadding,0,!1),this.bmap.basicZoom=n.camera.zoom,n.control.addEventListener("change",this.bmap.onControlChange.bind(this.bmap)),this.bmap.onControlChange(),n.cameraBound.setEnable(!0)}dispose(){this.poiLayer.dispose(),this.floors.forEach(n=>n.dispose()),this.floors=[]}};var Ar=g("three");function Kt(s){let n=new Blob([s],{type:"text/javascript"}),t=URL.createObjectURL(n),e=new Worker(t);return URL.revokeObjectURL(t),e}function rn(){return Kt(`var RP=Object.create;var Zd=Object.defineProperty,LP=Object.defineProperties,NP=Object.getOwnPropertyDescriptor,OP=Object.getOwnPropertyDescriptors,DP=Object.getOwnPropertyNames,Wv=Object.getOwnPropertySymbols,FP=Object.getPrototypeOf,qv=Object.prototype.hasOwnProperty,UP=Object.prototype.propertyIsEnumerable;var $d=(r,t,e)=>t in r?Zd(r,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[t]=e,Wc=(r,t)=>{for(var e in t||(t={}))qv.call(t,e)&&$d(r,e,t[e]);if(Wv)for(var e of Wv(t))UP.call(t,e)&&$d(r,e,t[e]);return r},Xv=(r,t)=>LP(r,OP(t));var ye=(r,t)=>()=>(t||r((t={exports:{}}).exports,t),t.exports);var BP=(r,t,e,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of DP(t))!qv.call(r,a)&&a!==e&&Zd(r,a,{get:()=>t[a],enumerable:!(o=NP(t,a))||o.enumerable});return r};var Er=(r,t,e)=>(e=r!=null?RP(FP(r)):{},BP(t||!r||!r.__esModule?Zd(e,"default",{value:r,enumerable:!0}):e,r));var Ei=(r,t,e)=>$d(r,typeof t!="symbol"?t+"":t,e);var $v=ye((lz,Yv)=>{var Jd=class{constructor(){this.keys=new Set,this.queue=[]}sort(){this.queue.sort((t,e)=>t.priority-e.priority)}set(t,e){let o=Number(e);if(isNaN(o))throw new TypeError('"priority" must be a number');return this.keys.has(t)?this.queue.map(a=>(a.key===t&&Object.assign(a,{priority:o}),a)):(this.keys.add(t),this.queue.push({key:t,priority:o})),this.sort(),this.queue.length}next(){let t=this.queue.shift();return this.keys.delete(t.key),t}isEmpty(){return this.queue.length===0}has(t){return this.keys.has(t)}get(t){return this.queue.find(e=>e.key===t)}};Yv.exports=Jd});var Kv=ye((cz,Jv)=>{function Zv(r,t){let e=new Map;for(let[o,a]of r)o!==t&&a instanceof Map?e.set(o,Zv(a,t)):o!==t&&e.set(o,a);return e}Jv.exports=Zv});var t_=ye((fz,jv)=>{function zP(r){let t=Number(r);return!(isNaN(t)||t<=0)}function Qv(r){let t=new Map;return Object.keys(r).forEach(o=>{let a=r[o];if(a!==null&&typeof a=="object"&&!Array.isArray(a))return t.set(o,Qv(a));if(!zP(a))throw new Error(\`Could not add node at key "\${o}", make sure it's a valid node\`,a);return t.set(o,Number(a))}),t}jv.exports=Qv});var r_=ye((hz,n_)=>{function e_(r){if(!(r instanceof Map))throw new Error(\`Invalid graph: Expected Map instead found \${typeof r}\`);r.forEach((t,e)=>{if(typeof t=="object"&&t instanceof Map){e_(t);return}if(typeof t!="number"||t<=0)throw new Error(\`Values must be numbers greater than 0. Found value \${t} at \${e}\`)})}n_.exports=e_});var a_=ye((pz,s_)=>{var kP=$v(),GP=Kv(),i_=t_(),o_=r_(),Kd=class{constructor(t){t instanceof Map?(o_(t),this.graph=t):t?this.graph=i_(t):this.graph=new Map}addNode(t,e){let o;return e instanceof Map?(o_(e),o=e):o=i_(e),this.graph.set(t,o),this}addVertex(t,e){return this.addNode(t,e)}removeNode(t){return this.graph=GP(this.graph,t),this}path(t,e,o={}){if(!this.graph.size)return o.cost?{path:null,cost:0}:null;let a=new Set,c=new kP,p=new Map,d=[],g=0,y=[];if(o.avoid&&(y=[].concat(o.avoid)),y.includes(t))throw new Error(\`Starting node (\${t}) cannot be avoided\`);if(y.includes(e))throw new Error(\`Ending node (\${e}) cannot be avoided\`);for(c.set(t,0);!c.isEmpty();){let _=c.next();if(_.key===e){g=_.priority;let x=_.key;for(;p.has(x);)d.push(x),x=p.get(x);break}a.add(_.key),(this.graph.get(_.key)||new Map).forEach((x,T)=>{if(a.has(T)||y.includes(T))return null;if(!c.has(T))return p.set(T,_.key),c.set(T,_.priority+x);let C=c.get(T).priority,I=_.priority+x;return I<C?(p.set(T,_.key),c.set(T,I)):null})}return d.length?(o.trim?d.shift():d=d.concat([t]),o.reverse||(d=d.reverse()),o.cost?{path:d,cost:g}:d):o.cost?{path:null,cost:0}:null}shortestPath(...t){return this.path(...t)}};s_.exports=Kd});var tp=ye((wz,K1)=>{"use strict";var J1=Object.getOwnPropertySymbols,HO=Object.prototype.hasOwnProperty,VO=Object.prototype.propertyIsEnumerable;function WO(r){if(r==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(r)}function qO(){try{if(!Object.assign)return!1;var r=new String("abc");if(r[5]="de",Object.getOwnPropertyNames(r)[0]==="5")return!1;for(var t={},e=0;e<10;e++)t["_"+String.fromCharCode(e)]=e;var o=Object.getOwnPropertyNames(t).map(function(c){return t[c]});if(o.join("")!=="0123456789")return!1;var a={};return"abcdefghijklmnopqrst".split("").forEach(function(c){a[c]=c}),Object.keys(Object.assign({},a)).join("")==="abcdefghijklmnopqrst"}catch(c){return!1}}K1.exports=qO()?Object.assign:function(r,t){for(var e,o=WO(r),a,c=1;c<arguments.length;c++){e=Object(arguments[c]);for(var p in e)HO.call(e,p)&&(o[p]=e[p]);if(J1){a=J1(e);for(var d=0;d<a.length;d++)VO.call(e,a[d])&&(o[a[d]]=e[a[d]])}}return o}});var Mm=ye((Em,wm)=>{(function(r,t){typeof Em=="object"&&typeof wm!="undefined"?wm.exports=t():typeof define=="function"&&define.amd?define(t):(r=r||self).RBush=t()})(Em,function(){"use strict";function r(M,E,L,A,z){(function G(Y,X,U,H,Q){for(;H>U;){if(H-U>600){var gt=H-U+1,$=X-U+1,Nt=Math.log(gt),j=.5*Math.exp(2*Nt/3),pt=.5*Math.sqrt(Nt*j*(gt-j)/gt)*($-gt/2<0?-1:1),Ct=Math.max(U,Math.floor(X-$*j/gt+pt)),Tt=Math.min(H,Math.floor(X+(gt-$)*j/gt+pt));G(Y,X,Ct,Tt,Q)}var ft=Y[X],dt=U,Z=H;for(t(Y,U,X),Q(Y[H],ft)>0&&t(Y,U,H);dt<Z;){for(t(Y,dt,Z),dt++,Z--;Q(Y[dt],ft)<0;)dt++;for(;Q(Y[Z],ft)>0;)Z--}Q(Y[U],ft)===0?t(Y,U,Z):t(Y,++Z,H),Z<=X&&(U=Z+1),X<=Z&&(H=Z-1)}})(M,E,L||0,A||M.length-1,z||e)}function t(M,E,L){var A=M[E];M[E]=M[L],M[L]=A}function e(M,E){return M<E?-1:M>E?1:0}var o=function(M){M===void 0&&(M=9),this._maxEntries=Math.max(4,M),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()};function a(M,E,L){if(!L)return E.indexOf(M);for(var A=0;A<E.length;A++)if(L(M,E[A]))return A;return-1}function c(M,E){p(M,0,M.children.length,E,M)}function p(M,E,L,A,z){z||(z=C(null)),z.minX=1/0,z.minY=1/0,z.maxX=-1/0,z.maxY=-1/0;for(var G=E;G<L;G++){var Y=M.children[G];d(z,M.leaf?A(Y):Y)}return z}function d(M,E){return M.minX=Math.min(M.minX,E.minX),M.minY=Math.min(M.minY,E.minY),M.maxX=Math.max(M.maxX,E.maxX),M.maxY=Math.max(M.maxY,E.maxY),M}function g(M,E){return M.minX-E.minX}function y(M,E){return M.minY-E.minY}function _(M){return(M.maxX-M.minX)*(M.maxY-M.minY)}function w(M){return M.maxX-M.minX+(M.maxY-M.minY)}function x(M,E){return M.minX<=E.minX&&M.minY<=E.minY&&E.maxX<=M.maxX&&E.maxY<=M.maxY}function T(M,E){return E.minX<=M.maxX&&E.minY<=M.maxY&&E.maxX>=M.minX&&E.maxY>=M.minY}function C(M){return{children:M,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function I(M,E,L,A,z){for(var G=[E,L];G.length;)if(!((L=G.pop())-(E=G.pop())<=A)){var Y=E+Math.ceil((L-E)/A/2)*A;r(M,Y,E,L,z),G.push(E,Y,Y,L)}}return o.prototype.all=function(){return this._all(this.data,[])},o.prototype.search=function(M){var E=this.data,L=[];if(!T(M,E))return L;for(var A=this.toBBox,z=[];E;){for(var G=0;G<E.children.length;G++){var Y=E.children[G],X=E.leaf?A(Y):Y;T(M,X)&&(E.leaf?L.push(Y):x(M,X)?this._all(Y,L):z.push(Y))}E=z.pop()}return L},o.prototype.collides=function(M){var E=this.data;if(!T(M,E))return!1;for(var L=[];E;){for(var A=0;A<E.children.length;A++){var z=E.children[A],G=E.leaf?this.toBBox(z):z;if(T(M,G)){if(E.leaf||x(M,G))return!0;L.push(z)}}E=L.pop()}return!1},o.prototype.load=function(M){if(!M||!M.length)return this;if(M.length<this._minEntries){for(var E=0;E<M.length;E++)this.insert(M[E]);return this}var L=this._build(M.slice(),0,M.length-1,0);if(this.data.children.length)if(this.data.height===L.height)this._splitRoot(this.data,L);else{if(this.data.height<L.height){var A=this.data;this.data=L,L=A}this._insert(L,this.data.height-L.height-1,!0)}else this.data=L;return this},o.prototype.insert=function(M){return M&&this._insert(M,this.data.height-1),this},o.prototype.clear=function(){return this.data=C([]),this},o.prototype.remove=function(M,E){if(!M)return this;for(var L,A,z,G=this.data,Y=this.toBBox(M),X=[],U=[];G||X.length;){if(G||(G=X.pop(),A=X[X.length-1],L=U.pop(),z=!0),G.leaf){var H=a(M,G.children,E);if(H!==-1)return G.children.splice(H,1),X.push(G),this._condense(X),this}z||G.leaf||!x(G,Y)?A?(L++,G=A.children[L],z=!1):G=null:(X.push(G),U.push(L),L=0,A=G,G=G.children[0])}return this},o.prototype.toBBox=function(M){return M},o.prototype.compareMinX=function(M,E){return M.minX-E.minX},o.prototype.compareMinY=function(M,E){return M.minY-E.minY},o.prototype.toJSON=function(){return this.data},o.prototype.fromJSON=function(M){return this.data=M,this},o.prototype._all=function(M,E){for(var L=[];M;)M.leaf?E.push.apply(E,M.children):L.push.apply(L,M.children),M=L.pop();return E},o.prototype._build=function(M,E,L,A){var z,G=L-E+1,Y=this._maxEntries;if(G<=Y)return c(z=C(M.slice(E,L+1)),this.toBBox),z;A||(A=Math.ceil(Math.log(G)/Math.log(Y)),Y=Math.ceil(G/Math.pow(Y,A-1))),(z=C([])).leaf=!1,z.height=A;var X=Math.ceil(G/Y),U=X*Math.ceil(Math.sqrt(Y));I(M,E,L,U,this.compareMinX);for(var H=E;H<=L;H+=U){var Q=Math.min(H+U-1,L);I(M,H,Q,X,this.compareMinY);for(var gt=H;gt<=Q;gt+=X){var $=Math.min(gt+X-1,Q);z.children.push(this._build(M,gt,$,A-1))}}return c(z,this.toBBox),z},o.prototype._chooseSubtree=function(M,E,L,A){for(;A.push(E),!E.leaf&&A.length-1!==L;){for(var z=1/0,G=1/0,Y=void 0,X=0;X<E.children.length;X++){var U=E.children[X],H=_(U),Q=(gt=M,$=U,(Math.max($.maxX,gt.maxX)-Math.min($.minX,gt.minX))*(Math.max($.maxY,gt.maxY)-Math.min($.minY,gt.minY))-H);Q<G?(G=Q,z=H<z?H:z,Y=U):Q===G&&H<z&&(z=H,Y=U)}E=Y||E.children[0]}var gt,$;return E},o.prototype._insert=function(M,E,L){var A=L?M:this.toBBox(M),z=[],G=this._chooseSubtree(A,this.data,E,z);for(G.children.push(M),d(G,A);E>=0&&z[E].children.length>this._maxEntries;)this._split(z,E),E--;this._adjustParentBBoxes(A,z,E)},o.prototype._split=function(M,E){var L=M[E],A=L.children.length,z=this._minEntries;this._chooseSplitAxis(L,z,A);var G=this._chooseSplitIndex(L,z,A),Y=C(L.children.splice(G,L.children.length-G));Y.height=L.height,Y.leaf=L.leaf,c(L,this.toBBox),c(Y,this.toBBox),E?M[E-1].children.push(Y):this._splitRoot(L,Y)},o.prototype._splitRoot=function(M,E){this.data=C([M,E]),this.data.height=M.height+1,this.data.leaf=!1,c(this.data,this.toBBox)},o.prototype._chooseSplitIndex=function(M,E,L){for(var A,z,G,Y,X,U,H,Q=1/0,gt=1/0,$=E;$<=L-E;$++){var Nt=p(M,0,$,this.toBBox),j=p(M,$,L,this.toBBox),pt=(z=Nt,G=j,Y=void 0,X=void 0,U=void 0,H=void 0,Y=Math.max(z.minX,G.minX),X=Math.max(z.minY,G.minY),U=Math.min(z.maxX,G.maxX),H=Math.min(z.maxY,G.maxY),Math.max(0,U-Y)*Math.max(0,H-X)),Ct=_(Nt)+_(j);pt<Q?(Q=pt,A=$,gt=Ct<gt?Ct:gt):pt===Q&&Ct<gt&&(gt=Ct,A=$)}return A||L-E},o.prototype._chooseSplitAxis=function(M,E,L){var A=M.leaf?this.compareMinX:g,z=M.leaf?this.compareMinY:y;this._allDistMargin(M,E,L,A)<this._allDistMargin(M,E,L,z)&&M.children.sort(A)},o.prototype._allDistMargin=function(M,E,L,A){M.children.sort(A);for(var z=this.toBBox,G=p(M,0,E,z),Y=p(M,L-E,L,z),X=w(G)+w(Y),U=E;U<L-E;U++){var H=M.children[U];d(G,M.leaf?z(H):H),X+=w(G)}for(var Q=L-E-1;Q>=E;Q--){var gt=M.children[Q];d(Y,M.leaf?z(gt):gt),X+=w(Y)}return X},o.prototype._adjustParentBBoxes=function(M,E,L){for(var A=L;A>=0;A--)d(E[A],M)},o.prototype._condense=function(M){for(var E=M.length-1,L=void 0;E>=0;E--)M[E].children.length===0?E>0?(L=M[E-1].children).splice(L.indexOf(M[E]),1):this.clear():c(M[E],this.toBBox)},o})});var Q1=ye((Sm,bm)=>{(function(r,t){typeof Sm=="object"&&typeof bm!="undefined"?bm.exports=t():typeof define=="function"&&define.amd?define(t):(r=r||self,r.TinyQueue=t())})(Sm,function(){"use strict";var r=function(o,a){if(o===void 0&&(o=[]),a===void 0&&(a=t),this.data=o,this.length=this.data.length,this.compare=a,this.length>0)for(var c=(this.length>>1)-1;c>=0;c--)this._down(c)};r.prototype.push=function(o){this.data.push(o),this.length++,this._up(this.length-1)},r.prototype.pop=function(){if(this.length!==0){var o=this.data[0],a=this.data.pop();return this.length--,this.length>0&&(this.data[0]=a,this._down(0)),o}},r.prototype.peek=function(){return this.data[0]},r.prototype._up=function(o){for(var a=this,c=a.data,p=a.compare,d=c[o];o>0;){var g=o-1>>1,y=c[g];if(p(d,y)>=0)break;c[o]=y,o=g}c[o]=d},r.prototype._down=function(o){for(var a=this,c=a.data,p=a.compare,d=this.length>>1,g=c[o];o<d;){var y=(o<<1)+1,_=c[y],w=y+1;if(w<this.length&&p(c[w],_)<0&&(y=w,_=c[w]),p(_,g)>=0)break;c[o]=_,o=y}c[o]=g};function t(e,o){return e<o?-1:e>o?1:0}return r})});var tx=ye((Cz,j1)=>{j1.exports=function(t,e,o,a){var c=t[0],p=t[1],d=!1;o===void 0&&(o=0),a===void 0&&(a=e.length);for(var g=(a-o)/2,y=0,_=g-1;y<g;_=y++){var w=e[o+y*2+0],x=e[o+y*2+1],T=e[o+_*2+0],C=e[o+_*2+1],I=x>p!=C>p&&c<(T-w)*(p-x)/(C-x)+w;I&&(d=!d)}return d}});var nx=ye((Pz,ex)=>{ex.exports=function(t,e,o,a){var c=t[0],p=t[1],d=!1;o===void 0&&(o=0),a===void 0&&(a=e.length);for(var g=a-o,y=0,_=g-1;y<g;_=y++){var w=e[y+o][0],x=e[y+o][1],T=e[_+o][0],C=e[_+o][1],I=x>p!=C>p&&c<(T-w)*(p-x)/(C-x)+w;I&&(d=!d)}return d}});var ox=ye((Iz,rp)=>{var rx=tx(),ix=nx();rp.exports=function(t,e,o,a){return e.length>0&&Array.isArray(e[0])?ix(t,e,o,a):rx(t,e,o,a)};rp.exports.nested=ix;rp.exports.flat=rx});var ax=ye((ip,sx)=>{(function(r,t){typeof ip=="object"&&typeof sx!="undefined"?t(ip):typeof define=="function"&&define.amd?define(["exports"],t):t((r=r||self).predicates={})})(ip,function(r){"use strict";let e=33306690738754706e-32;function o(T,C,I,M,E){let L,A,z,G,Y=C[0],X=M[0],U=0,H=0;X>Y==X>-Y?(L=Y,Y=C[++U]):(L=X,X=M[++H]);let Q=0;if(U<T&&H<I)for(X>Y==X>-Y?(z=L-((A=Y+L)-Y),Y=C[++U]):(z=L-((A=X+L)-X),X=M[++H]),L=A,z!==0&&(E[Q++]=z);U<T&&H<I;)X>Y==X>-Y?(z=L-((A=L+Y)-(G=A-L))+(Y-G),Y=C[++U]):(z=L-((A=L+X)-(G=A-L))+(X-G),X=M[++H]),L=A,z!==0&&(E[Q++]=z);for(;U<T;)z=L-((A=L+Y)-(G=A-L))+(Y-G),Y=C[++U],L=A,z!==0&&(E[Q++]=z);for(;H<I;)z=L-((A=L+X)-(G=A-L))+(X-G),X=M[++H],L=A,z!==0&&(E[Q++]=z);return L===0&&Q!==0||(E[Q++]=L),Q}function a(T){return new Float64Array(T)}let c=33306690738754716e-32,p=22204460492503146e-32,d=11093356479670487e-47,g=a(4),y=a(8),_=a(12),w=a(16),x=a(4);r.orient2d=function(T,C,I,M,E,L){let A=(C-L)*(I-E),z=(T-E)*(M-L),G=A-z;if(A===0||z===0||A>0!=z>0)return G;let Y=Math.abs(A+z);return Math.abs(G)>=c*Y?G:-function(X,U,H,Q,gt,$,Nt){let j,pt,Ct,Tt,ft,dt,Z,st,vt,zt,bt,qt,le,se,Zt,_e,Vt,pe,at=X-gt,He=H-gt,ae=U-$,ce=Q-$;ft=(Zt=(st=at-(Z=(dt=134217729*at)-(dt-at)))*(zt=ce-(vt=(dt=134217729*ce)-(dt-ce)))-((se=at*ce)-Z*vt-st*vt-Z*zt))-(bt=Zt-(Vt=(st=ae-(Z=(dt=134217729*ae)-(dt-ae)))*(zt=He-(vt=(dt=134217729*He)-(dt-He)))-((_e=ae*He)-Z*vt-st*vt-Z*zt))),g[0]=Zt-(bt+ft)+(ft-Vt),ft=(le=se-((qt=se+bt)-(ft=qt-se))+(bt-ft))-(bt=le-_e),g[1]=le-(bt+ft)+(ft-_e),ft=(pe=qt+bt)-qt,g[2]=qt-(pe-ft)+(bt-ft),g[3]=pe;let fe=function(J,rt){let D=rt[0];for(let N=1;N<J;N++)D+=rt[N];return D}(4,g),it=p*Nt;if(fe>=it||-fe>=it||(j=X-(at+(ft=X-at))+(ft-gt),Ct=H-(He+(ft=H-He))+(ft-gt),pt=U-(ae+(ft=U-ae))+(ft-$),Tt=Q-(ce+(ft=Q-ce))+(ft-$),j===0&&pt===0&&Ct===0&&Tt===0)||(it=d*Nt+e*Math.abs(fe),(fe+=at*Tt+ce*j-(ae*Ct+He*pt))>=it||-fe>=it))return fe;ft=(Zt=(st=j-(Z=(dt=134217729*j)-(dt-j)))*(zt=ce-(vt=(dt=134217729*ce)-(dt-ce)))-((se=j*ce)-Z*vt-st*vt-Z*zt))-(bt=Zt-(Vt=(st=pt-(Z=(dt=134217729*pt)-(dt-pt)))*(zt=He-(vt=(dt=134217729*He)-(dt-He)))-((_e=pt*He)-Z*vt-st*vt-Z*zt))),x[0]=Zt-(bt+ft)+(ft-Vt),ft=(le=se-((qt=se+bt)-(ft=qt-se))+(bt-ft))-(bt=le-_e),x[1]=le-(bt+ft)+(ft-_e),ft=(pe=qt+bt)-qt,x[2]=qt-(pe-ft)+(bt-ft),x[3]=pe;let B=o(4,g,4,x,y);ft=(Zt=(st=at-(Z=(dt=134217729*at)-(dt-at)))*(zt=Tt-(vt=(dt=134217729*Tt)-(dt-Tt)))-((se=at*Tt)-Z*vt-st*vt-Z*zt))-(bt=Zt-(Vt=(st=ae-(Z=(dt=134217729*ae)-(dt-ae)))*(zt=Ct-(vt=(dt=134217729*Ct)-(dt-Ct)))-((_e=ae*Ct)-Z*vt-st*vt-Z*zt))),x[0]=Zt-(bt+ft)+(ft-Vt),ft=(le=se-((qt=se+bt)-(ft=qt-se))+(bt-ft))-(bt=le-_e),x[1]=le-(bt+ft)+(ft-_e),ft=(pe=qt+bt)-qt,x[2]=qt-(pe-ft)+(bt-ft),x[3]=pe;let P=o(B,y,4,x,_);ft=(Zt=(st=j-(Z=(dt=134217729*j)-(dt-j)))*(zt=Tt-(vt=(dt=134217729*Tt)-(dt-Tt)))-((se=j*Tt)-Z*vt-st*vt-Z*zt))-(bt=Zt-(Vt=(st=pt-(Z=(dt=134217729*pt)-(dt-pt)))*(zt=Ct-(vt=(dt=134217729*Ct)-(dt-Ct)))-((_e=pt*Ct)-Z*vt-st*vt-Z*zt))),x[0]=Zt-(bt+ft)+(ft-Vt),ft=(le=se-((qt=se+bt)-(ft=qt-se))+(bt-ft))-(bt=le-_e),x[1]=le-(bt+ft)+(ft-_e),ft=(pe=qt+bt)-qt,x[2]=qt-(pe-ft)+(bt-ft),x[3]=pe;let F=o(P,_,4,x,w);return w[F-1]}(T,C,I,M,E,L,Y)},r.orient2dfast=function(T,C,I,M,E,L){return(C-L)*(I-E)-(T-E)*(M-L)},Object.defineProperty(r,"__esModule",{value:!0})})});var px=ye((Rz,Pm)=>{"use strict";var ux=Mm(),sp=Q1(),YO=ox(),$O=ax().orient2d;sp.default&&(sp=sp.default);Pm.exports=hx;Pm.exports.default=hx;function hx(r,t,e){t=Math.max(0,t===void 0?2:t),e=e||0;var o=jO(r),a=new ux(16);a.toBBox=function(L){return{minX:L[0],minY:L[1],maxX:L[0],maxY:L[1]}},a.compareMinX=function(L,A){return L[0]-A[0]},a.compareMinY=function(L,A){return L[1]-A[1]},a.load(r);for(var c=[],p=0,d;p<o.length;p++){var g=o[p];a.remove(g),d=fx(g,d),c.push(d)}var y=new ux(16);for(p=0;p<c.length;p++)y.insert(Tm(c[p]));for(var _=t*t,w=e*e;c.length;){var x=c.shift(),T=x.p,C=x.next.p,I=Am(T,C);if(!(I<w)){var M=I/_;g=ZO(a,x.prev.p,T,C,x.next.next.p,M,y),g&&Math.min(Am(g,T),Am(g,C))<=M&&(c.push(x),c.push(fx(g,x)),a.remove(g),y.remove(x),y.insert(Tm(x)),y.insert(Tm(x.next)))}}x=d;var E=[];do E.push(x.p),x=x.next;while(x!==d);return E.push(x.p),E}function ZO(r,t,e,o,a,c,p){for(var d=new sp([],JO),g=r.data;g;){for(var y=0;y<g.children.length;y++){var _=g.children[y],w=g.leaf?Cm(_,e,o):KO(e,o,_);w>c||d.push({node:_,dist:w})}for(;d.length&&!d.peek().node.children;){var x=d.pop(),T=x.node,C=Cm(T,t,e),I=Cm(T,o,a);if(x.dist<C&&x.dist<I&&cx(e,T,p)&&cx(o,T,p))return T}g=d.pop(),g&&(g=g.node)}return null}function JO(r,t){return r.dist-t.dist}function KO(r,t,e){if(lx(r,e)||lx(t,e))return 0;var o=op(r[0],r[1],t[0],t[1],e.minX,e.minY,e.maxX,e.minY);if(o===0)return 0;var a=op(r[0],r[1],t[0],t[1],e.minX,e.minY,e.minX,e.maxY);if(a===0)return 0;var c=op(r[0],r[1],t[0],t[1],e.maxX,e.minY,e.maxX,e.maxY);if(c===0)return 0;var p=op(r[0],r[1],t[0],t[1],e.minX,e.maxY,e.maxX,e.maxY);return p===0?0:Math.min(o,a,c,p)}function lx(r,t){return r[0]>=t.minX&&r[0]<=t.maxX&&r[1]>=t.minY&&r[1]<=t.maxY}function cx(r,t,e){for(var o=Math.min(r[0],t[0]),a=Math.min(r[1],t[1]),c=Math.max(r[0],t[0]),p=Math.max(r[1],t[1]),d=e.search({minX:o,minY:a,maxX:c,maxY:p}),g=0;g<d.length;g++)if(QO(d[g].p,d[g].next.p,r,t))return!1;return!0}function rc(r,t,e){return $O(r[0],r[1],t[0],t[1],e[0],e[1])}function QO(r,t,e,o){return r!==o&&t!==e&&rc(r,t,e)>0!=rc(r,t,o)>0&&rc(e,o,r)>0!=rc(e,o,t)>0}function Tm(r){var t=r.p,e=r.next.p;return r.minX=Math.min(t[0],e[0]),r.minY=Math.min(t[1],e[1]),r.maxX=Math.max(t[0],e[0]),r.maxY=Math.max(t[1],e[1]),r}function jO(r){for(var t=r[0],e=r[0],o=r[0],a=r[0],c=0;c<r.length;c++){var p=r[c];p[0]<t[0]&&(t=p),p[0]>o[0]&&(o=p),p[1]<e[1]&&(e=p),p[1]>a[1]&&(a=p)}var d=[t,e,o,a],g=d.slice();for(c=0;c<r.length;c++)YO(r[c],d)||g.push(r[c]);return eD(g)}function fx(r,t){var e={p:r,prev:null,next:null,minX:0,minY:0,maxX:0,maxY:0};return t?(e.next=t.next,e.prev=t,t.next.prev=e,t.next=e):(e.prev=e,e.next=e),e}function Am(r,t){var e=r[0]-t[0],o=r[1]-t[1];return e*e+o*o}function Cm(r,t,e){var o=t[0],a=t[1],c=e[0]-o,p=e[1]-a;if(c!==0||p!==0){var d=((r[0]-o)*c+(r[1]-a)*p)/(c*c+p*p);d>1?(o=e[0],a=e[1]):d>0&&(o+=c*d,a+=p*d)}return c=r[0]-o,p=r[1]-a,c*c+p*p}function op(r,t,e,o,a,c,p,d){var g=e-r,y=o-t,_=p-a,w=d-c,x=r-a,T=t-c,C=g*g+y*y,I=g*_+y*w,M=_*_+w*w,E=g*x+y*T,L=_*x+w*T,A=C*M-I*I,z,G,Y,X,U=A,H=A;A===0?(G=0,U=1,X=L,H=M):(G=I*L-M*E,X=C*L-I*E,G<0?(G=0,X=L,H=M):G>U&&(G=U,X=L+I,H=M)),X<0?(X=0,-E<0?G=0:-E>C?G=U:(G=-E,U=C)):X>H&&(X=H,-E+I<0?G=0:-E+I>C?G=U:(G=-E+I,U=C)),z=G===0?0:G/U,Y=X===0?0:X/H;var Q=(1-z)*r+z*e,gt=(1-z)*t+z*o,$=(1-Y)*a+Y*p,Nt=(1-Y)*c+Y*d,j=$-Q,pt=Nt-gt;return j*j+pt*pt}function tD(r,t){return r[0]===t[0]?r[1]-t[1]:r[0]-t[0]}function eD(r){r.sort(tD);for(var t=[],e=0;e<r.length;e++){for(;t.length>=2&&rc(t[t.length-2],t[t.length-1],r[e])<=0;)t.pop();t.push(r[e])}for(var o=[],a=r.length-1;a>=0;a--){for(;o.length>=2&&rc(o[o.length-2],o[o.length-1],r[a])<=0;)o.pop();o.push(r[a])}return o.pop(),t.pop(),t.concat(o)}});var _x=ye((Rm,Lm)=>{(function(r,t){typeof Rm=="object"&&typeof Lm!="undefined"?Lm.exports=t():typeof define=="function"&&define.amd?define(t):r.quickselect=t()})(Rm,function(){"use strict";function r(a,c,p,d,g){t(a,c,p||0,d||a.length-1,g||o)}function t(a,c,p,d,g){for(;d>p;){if(d-p>600){var y=d-p+1,_=c-p+1,w=Math.log(y),x=.5*Math.exp(2*w/3),T=.5*Math.sqrt(w*x*(y-x)/y)*(_-y/2<0?-1:1),C=Math.max(p,Math.floor(c-_*x/y+T)),I=Math.min(d,Math.floor(c+(y-_)*x/y+T));t(a,c,C,I,g)}var M=a[c],E=p,L=d;for(e(a,p,c),g(a[d],M)>0&&e(a,p,d);E<L;){for(e(a,E,L),E++,L--;g(a[E],M)<0;)E++;for(;g(a[L],M)>0;)L--}g(a[p],M)===0?e(a,p,L):(L++,e(a,L,d)),L<=c&&(p=L+1),c<=L&&(d=L-1)}}function e(a,c,p){var d=a[c];a[c]=a[p],a[p]=d}function o(a,c){return a<c?-1:a>c?1:0}return r})});var Fm=ye((rG,Dm)=>{"use strict";Dm.exports=uf;Dm.exports.default=uf;var dD=_x();function uf(r,t){if(!(this instanceof uf))return new uf(r,t);this._maxEntries=Math.max(4,r||9),this._minEntries=Math.max(2,Math.ceil(this._maxEntries*.4)),t&&this._initFormat(t),this.clear()}uf.prototype={all:function(){return this._all(this.data,[])},search:function(r){var t=this.data,e=[],o=this.toBBox;if(!up(r,t))return e;for(var a=[],c,p,d,g;t;){for(c=0,p=t.children.length;c<p;c++)d=t.children[c],g=t.leaf?o(d):d,up(r,g)&&(t.leaf?e.push(d):Om(r,g)?this._all(d,e):a.push(d));t=a.pop()}return e},collides:function(r){var t=this.data,e=this.toBBox;if(!up(r,t))return!1;for(var o=[],a,c,p,d;t;){for(a=0,c=t.children.length;a<c;a++)if(p=t.children[a],d=t.leaf?e(p):p,up(r,d)){if(t.leaf||Om(r,d))return!0;o.push(p)}t=o.pop()}return!1},load:function(r){if(!(r&&r.length))return this;if(r.length<this._minEntries){for(var t=0,e=r.length;t<e;t++)this.insert(r[t]);return this}var o=this._build(r.slice(),0,r.length-1,0);if(!this.data.children.length)this.data=o;else if(this.data.height===o.height)this._splitRoot(this.data,o);else{if(this.data.height<o.height){var a=this.data;this.data=o,o=a}this._insert(o,this.data.height-o.height-1,!0)}return this},insert:function(r){return r&&this._insert(r,this.data.height-1),this},clear:function(){return this.data=sc([]),this},remove:function(r,t){if(!r)return this;for(var e=this.data,o=this.toBBox(r),a=[],c=[],p,d,g,y;e||a.length;){if(e||(e=a.pop(),d=a[a.length-1],p=c.pop(),y=!0),e.leaf&&(g=gD(r,e.children,t),g!==-1))return e.children.splice(g,1),a.push(e),this._condense(a),this;!y&&!e.leaf&&Om(e,o)?(a.push(e),c.push(p),p=0,d=e,e=e.children[0]):d?(p++,e=d.children[p],y=!1):e=null}return this},toBBox:function(r){return r},compareMinX:xx,compareMinY:Ex,toJSON:function(){return this.data},fromJSON:function(r){return this.data=r,this},_all:function(r,t){for(var e=[];r;)r.leaf?t.push.apply(t,r.children):e.push.apply(e,r.children),r=e.pop();return t},_build:function(r,t,e,o){var a=e-t+1,c=this._maxEntries,p;if(a<=c)return p=sc(r.slice(t,e+1)),oc(p,this.toBBox),p;o||(o=Math.ceil(Math.log(a)/Math.log(c)),c=Math.ceil(a/Math.pow(c,o-1))),p=sc([]),p.leaf=!1,p.height=o;var d=Math.ceil(a/c),g=d*Math.ceil(Math.sqrt(c)),y,_,w,x;for(wx(r,t,e,g,this.compareMinX),y=t;y<=e;y+=g)for(w=Math.min(y+g-1,e),wx(r,y,w,d,this.compareMinY),_=y;_<=w;_+=d)x=Math.min(_+d-1,w),p.children.push(this._build(r,_,x,o-1));return oc(p,this.toBBox),p},_chooseSubtree:function(r,t,e,o){for(var a,c,p,d,g,y,_,w;o.push(t),!(t.leaf||o.length-1===e);){for(_=w=1/0,a=0,c=t.children.length;a<c;a++)p=t.children[a],g=Nm(p),y=mD(r,p)-g,y<w?(w=y,_=g<_?g:_,d=p):y===w&&g<_&&(_=g,d=p);t=d||t.children[0]}return t},_insert:function(r,t,e){var o=this.toBBox,a=e?r:o(r),c=[],p=this._chooseSubtree(a,this.data,t,c);for(p.children.push(r),af(p,a);t>=0&&c[t].children.length>this._maxEntries;)this._split(c,t),t--;this._adjustParentBBoxes(a,c,t)},_split:function(r,t){var e=r[t],o=e.children.length,a=this._minEntries;this._chooseSplitAxis(e,a,o);var c=this._chooseSplitIndex(e,a,o),p=sc(e.children.splice(c,e.children.length-c));p.height=e.height,p.leaf=e.leaf,oc(e,this.toBBox),oc(p,this.toBBox),t?r[t-1].children.push(p):this._splitRoot(e,p)},_splitRoot:function(r,t){this.data=sc([r,t]),this.data.height=r.height+1,this.data.leaf=!1,oc(this.data,this.toBBox)},_chooseSplitIndex:function(r,t,e){var o,a,c,p,d,g,y,_;for(g=y=1/0,o=t;o<=e-t;o++)a=sf(r,0,o,this.toBBox),c=sf(r,o,e,this.toBBox),p=yD(a,c),d=Nm(a)+Nm(c),p<g?(g=p,_=o,y=d<y?d:y):p===g&&d<y&&(y=d,_=o);return _},_chooseSplitAxis:function(r,t,e){var o=r.leaf?this.compareMinX:xx,a=r.leaf?this.compareMinY:Ex,c=this._allDistMargin(r,t,e,o),p=this._allDistMargin(r,t,e,a);c<p&&r.children.sort(o)},_allDistMargin:function(r,t,e,o){r.children.sort(o);var a=this.toBBox,c=sf(r,0,t,a),p=sf(r,e-t,e,a),d=ap(c)+ap(p),g,y;for(g=t;g<e-t;g++)y=r.children[g],af(c,r.leaf?a(y):y),d+=ap(c);for(g=e-t-1;g>=t;g--)y=r.children[g],af(p,r.leaf?a(y):y),d+=ap(p);return d},_adjustParentBBoxes:function(r,t,e){for(var o=e;o>=0;o--)af(t[o],r)},_condense:function(r){for(var t=r.length-1,e;t>=0;t--)r[t].children.length===0?t>0?(e=r[t-1].children,e.splice(e.indexOf(r[t]),1)):this.clear():oc(r[t],this.toBBox)},_initFormat:function(r){var t=["return a"," - b",";"];this.compareMinX=new Function("a","b",t.join(r[0])),this.compareMinY=new Function("a","b",t.join(r[1])),this.toBBox=new Function("a","return {minX: a"+r[0]+", minY: a"+r[1]+", maxX: a"+r[2]+", maxY: a"+r[3]+"};")}};function gD(r,t,e){if(!e)return t.indexOf(r);for(var o=0;o<t.length;o++)if(e(r,t[o]))return o;return-1}function oc(r,t){sf(r,0,r.children.length,t,r)}function sf(r,t,e,o,a){a||(a=sc(null)),a.minX=1/0,a.minY=1/0,a.maxX=-1/0,a.maxY=-1/0;for(var c=t,p;c<e;c++)p=r.children[c],af(a,r.leaf?o(p):p);return a}function af(r,t){return r.minX=Math.min(r.minX,t.minX),r.minY=Math.min(r.minY,t.minY),r.maxX=Math.max(r.maxX,t.maxX),r.maxY=Math.max(r.maxY,t.maxY),r}function xx(r,t){return r.minX-t.minX}function Ex(r,t){return r.minY-t.minY}function Nm(r){return(r.maxX-r.minX)*(r.maxY-r.minY)}function ap(r){return r.maxX-r.minX+(r.maxY-r.minY)}function mD(r,t){return(Math.max(t.maxX,r.maxX)-Math.min(t.minX,r.minX))*(Math.max(t.maxY,r.maxY)-Math.min(t.minY,r.minY))}function yD(r,t){var e=Math.max(r.minX,t.minX),o=Math.max(r.minY,t.minY),a=Math.min(r.maxX,t.maxX),c=Math.min(r.maxY,t.maxY);return Math.max(0,a-e)*Math.max(0,c-o)}function Om(r,t){return r.minX<=t.minX&&r.minY<=t.minY&&t.maxX<=r.maxX&&t.maxY<=r.maxY}function up(r,t){return t.minX<=r.maxX&&t.minY<=r.maxY&&t.maxX>=r.minX&&t.maxY>=r.minY}function sc(r){return{children:r,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function wx(r,t,e,o,a){for(var c=[t,e],p;c.length;)e=c.pop(),t=c.pop(),!(e-t<=o)&&(p=t+Math.ceil((e-t)/o/2)*o,dD(r,p,t,e,a),c.push(t,p,p,e))}});var Cx=ye((m5,Hm)=>{"use strict";Hm.exports=hp;Hm.exports.default=hp;function hp(r,t,e){e=e||2;var o=t&&t.length,a=o?t[0]*e:r.length,c=bx(r,0,a,e,!0),p=[];if(!c||c.next===c.prev)return p;var d,g,y,_,w,x,T;if(o&&(c=AD(r,t,c,e)),r.length>80*e){d=y=r[0],g=_=r[1];for(var C=e;C<a;C+=e)w=r[C],x=r[C+1],w<d&&(d=w),x<g&&(g=x),w>y&&(y=w),x>_&&(_=x);T=Math.max(y-d,_-g),T=T!==0?32767/T:0}return ff(c,p,e,d,g,T,0),p}function bx(r,t,e,o,a){var c,p;if(a===Gm(r,t,e,o)>0)for(c=t;c<e;c+=o)p=Sx(c,r[c],r[c+1],p);else for(c=e-o;c>=t;c-=o)p=Sx(c,r[c],r[c+1],p);return p&&pp(p,p.next)&&(pf(p),p=p.next),p}function sl(r,t){if(!r)return r;t||(t=r);var e=r,o;do if(o=!1,!e.steiner&&(pp(e,e.next)||Lr(e.prev,e,e.next)===0)){if(pf(e),e=t=e.prev,e===e.next)break;o=!0}else e=e.next;while(o||e!==t);return t}function ff(r,t,e,o,a,c,p){if(r){!p&&c&&LD(r,o,a,c);for(var d=r,g,y;r.prev!==r.next;){if(g=r.prev,y=r.next,c?SD(r,o,a,c):MD(r)){t.push(g.i/e|0),t.push(r.i/e|0),t.push(y.i/e|0),pf(r),r=y.next,d=y.next;continue}if(r=y,r===d){p?p===1?(r=bD(sl(r),t,e),ff(r,t,e,o,a,c,2)):p===2&&TD(r,t,e,o,a,c):ff(sl(r),t,e,o,a,c,1);break}}}}function MD(r){var t=r.prev,e=r,o=r.next;if(Lr(t,e,o)>=0)return!1;for(var a=t.x,c=e.x,p=o.x,d=t.y,g=e.y,y=o.y,_=a<c?a<p?a:p:c<p?c:p,w=d<g?d<y?d:y:g<y?g:y,x=a>c?a>p?a:p:c>p?c:p,T=d>g?d>y?d:y:g>y?g:y,C=o.next;C!==t;){if(C.x>=_&&C.x<=x&&C.y>=w&&C.y<=T&&lc(a,d,c,g,p,y,C.x,C.y)&&Lr(C.prev,C,C.next)>=0)return!1;C=C.next}return!0}function SD(r,t,e,o){var a=r.prev,c=r,p=r.next;if(Lr(a,c,p)>=0)return!1;for(var d=a.x,g=c.x,y=p.x,_=a.y,w=c.y,x=p.y,T=d<g?d<y?d:y:g<y?g:y,C=_<w?_<x?_:x:w<x?w:x,I=d>g?d>y?d:y:g>y?g:y,M=_>w?_>x?_:x:w>x?w:x,E=zm(T,C,t,e,o),L=zm(I,M,t,e,o),A=r.prevZ,z=r.nextZ;A&&A.z>=E&&z&&z.z<=L;){if(A.x>=T&&A.x<=I&&A.y>=C&&A.y<=M&&A!==a&&A!==p&&lc(d,_,g,w,y,x,A.x,A.y)&&Lr(A.prev,A,A.next)>=0||(A=A.prevZ,z.x>=T&&z.x<=I&&z.y>=C&&z.y<=M&&z!==a&&z!==p&&lc(d,_,g,w,y,x,z.x,z.y)&&Lr(z.prev,z,z.next)>=0))return!1;z=z.nextZ}for(;A&&A.z>=E;){if(A.x>=T&&A.x<=I&&A.y>=C&&A.y<=M&&A!==a&&A!==p&&lc(d,_,g,w,y,x,A.x,A.y)&&Lr(A.prev,A,A.next)>=0)return!1;A=A.prevZ}for(;z&&z.z<=L;){if(z.x>=T&&z.x<=I&&z.y>=C&&z.y<=M&&z!==a&&z!==p&&lc(d,_,g,w,y,x,z.x,z.y)&&Lr(z.prev,z,z.next)>=0)return!1;z=z.nextZ}return!0}function bD(r,t,e){var o=r;do{var a=o.prev,c=o.next.next;!pp(a,c)&&Tx(a,o,o.next,c)&&hf(a,c)&&hf(c,a)&&(t.push(a.i/e|0),t.push(o.i/e|0),t.push(c.i/e|0),pf(o),pf(o.next),o=r=c),o=o.next}while(o!==r);return sl(o)}function TD(r,t,e,o,a,c){var p=r;do{for(var d=p.next.next;d!==p.prev;){if(p.i!==d.i&&DD(p,d)){var g=Ax(p,d);p=sl(p,p.next),g=sl(g,g.next),ff(p,t,e,o,a,c,0),ff(g,t,e,o,a,c,0);return}d=d.next}p=p.next}while(p!==r)}function AD(r,t,e,o){var a=[],c,p,d,g,y;for(c=0,p=t.length;c<p;c++)d=t[c]*o,g=c<p-1?t[c+1]*o:r.length,y=bx(r,d,g,o,!1),y===y.next&&(y.steiner=!0),a.push(OD(y));for(a.sort(CD),c=0;c<a.length;c++)e=PD(a[c],e);return e}function CD(r,t){return r.x-t.x}function PD(r,t){var e=ID(r,t);if(!e)return t;var o=Ax(e,r);return sl(o,o.next),sl(e,e.next)}function ID(r,t){var e=t,o=r.x,a=r.y,c=-1/0,p;do{if(a<=e.y&&a>=e.next.y&&e.next.y!==e.y){var d=e.x+(a-e.y)*(e.next.x-e.x)/(e.next.y-e.y);if(d<=o&&d>c&&(c=d,p=e.x<e.next.x?e:e.next,d===o))return p}e=e.next}while(e!==t);if(!p)return null;var g=p,y=p.x,_=p.y,w=1/0,x;e=p;do o>=e.x&&e.x>=y&&o!==e.x&&lc(a<_?o:c,a,y,_,a<_?c:o,a,e.x,e.y)&&(x=Math.abs(a-e.y)/(o-e.x),hf(e,r)&&(x<w||x===w&&(e.x>p.x||e.x===p.x&&RD(p,e)))&&(p=e,w=x)),e=e.next;while(e!==g);return p}function RD(r,t){return Lr(r.prev,r,t.prev)<0&&Lr(t.next,r,r.next)<0}function LD(r,t,e,o){var a=r;do a.z===0&&(a.z=zm(a.x,a.y,t,e,o)),a.prevZ=a.prev,a.nextZ=a.next,a=a.next;while(a!==r);a.prevZ.nextZ=null,a.prevZ=null,ND(a)}function ND(r){var t,e,o,a,c,p,d,g,y=1;do{for(e=r,r=null,c=null,p=0;e;){for(p++,o=e,d=0,t=0;t<y&&(d++,o=o.nextZ,!!o);t++);for(g=y;d>0||g>0&&o;)d!==0&&(g===0||!o||e.z<=o.z)?(a=e,e=e.nextZ,d--):(a=o,o=o.nextZ,g--),c?c.nextZ=a:r=a,a.prevZ=c,c=a;e=o}c.nextZ=null,y*=2}while(p>1);return r}function zm(r,t,e,o,a){return r=(r-e)*a|0,t=(t-o)*a|0,r=(r|r<<8)&16711935,r=(r|r<<4)&252645135,r=(r|r<<2)&858993459,r=(r|r<<1)&1431655765,t=(t|t<<8)&16711935,t=(t|t<<4)&252645135,t=(t|t<<2)&858993459,t=(t|t<<1)&1431655765,r|t<<1}function OD(r){var t=r,e=r;do(t.x<e.x||t.x===e.x&&t.y<e.y)&&(e=t),t=t.next;while(t!==r);return e}function lc(r,t,e,o,a,c,p,d){return(a-p)*(t-d)>=(r-p)*(c-d)&&(r-p)*(o-d)>=(e-p)*(t-d)&&(e-p)*(c-d)>=(a-p)*(o-d)}function DD(r,t){return r.next.i!==t.i&&r.prev.i!==t.i&&!FD(r,t)&&(hf(r,t)&&hf(t,r)&&UD(r,t)&&(Lr(r.prev,r,t.prev)||Lr(r,t.prev,t))||pp(r,t)&&Lr(r.prev,r,r.next)>0&&Lr(t.prev,t,t.next)>0)}function Lr(r,t,e){return(t.y-r.y)*(e.x-t.x)-(t.x-r.x)*(e.y-t.y)}function pp(r,t){return r.x===t.x&&r.y===t.y}function Tx(r,t,e,o){var a=fp(Lr(r,t,e)),c=fp(Lr(r,t,o)),p=fp(Lr(e,o,r)),d=fp(Lr(e,o,t));return!!(a!==c&&p!==d||a===0&&cp(r,e,t)||c===0&&cp(r,o,t)||p===0&&cp(e,r,o)||d===0&&cp(e,t,o))}function cp(r,t,e){return t.x<=Math.max(r.x,e.x)&&t.x>=Math.min(r.x,e.x)&&t.y<=Math.max(r.y,e.y)&&t.y>=Math.min(r.y,e.y)}function fp(r){return r>0?1:r<0?-1:0}function FD(r,t){var e=r;do{if(e.i!==r.i&&e.next.i!==r.i&&e.i!==t.i&&e.next.i!==t.i&&Tx(e,e.next,r,t))return!0;e=e.next}while(e!==r);return!1}function hf(r,t){return Lr(r.prev,r,r.next)<0?Lr(r,t,r.next)>=0&&Lr(r,r.prev,t)>=0:Lr(r,t,r.prev)<0||Lr(r,r.next,t)<0}function UD(r,t){var e=r,o=!1,a=(r.x+t.x)/2,c=(r.y+t.y)/2;do e.y>c!=e.next.y>c&&e.next.y!==e.y&&a<(e.next.x-e.x)*(c-e.y)/(e.next.y-e.y)+e.x&&(o=!o),e=e.next;while(e!==r);return o}function Ax(r,t){var e=new km(r.i,r.x,r.y),o=new km(t.i,t.x,t.y),a=r.next,c=t.prev;return r.next=t,t.prev=r,e.next=a,a.prev=e,o.next=e,e.prev=o,c.next=o,o.prev=c,o}function Sx(r,t,e,o){var a=new km(r,t,e);return o?(a.next=o.next,a.prev=o,o.next.prev=a,o.next=a):(a.prev=a,a.next=a),a}function pf(r){r.next.prev=r.prev,r.prev.next=r.next,r.prevZ&&(r.prevZ.nextZ=r.nextZ),r.nextZ&&(r.nextZ.prevZ=r.prevZ)}function km(r,t,e){this.i=r,this.x=t,this.y=e,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}hp.deviation=function(r,t,e,o){var a=t&&t.length,c=a?t[0]*e:r.length,p=Math.abs(Gm(r,0,c,e));if(a)for(var d=0,g=t.length;d<g;d++){var y=t[d]*e,_=d<g-1?t[d+1]*e:r.length;p-=Math.abs(Gm(r,y,_,e))}var w=0;for(d=0;d<o.length;d+=3){var x=o[d]*e,T=o[d+1]*e,C=o[d+2]*e;w+=Math.abs((r[x]-r[C])*(r[T+1]-r[x+1])-(r[x]-r[T])*(r[C+1]-r[x+1]))}return p===0&&w===0?0:Math.abs((w-p)/p)};function Gm(r,t,e,o){for(var a=0,c=t,p=e-o;c<e;c+=o)a+=(r[p]-r[c])*(r[c+1]+r[p+1]),p=c;return a}hp.flatten=function(r){for(var t=r[0][0].length,e={vertices:[],holes:[],dimensions:t},o=0,a=0;a<r.length;a++){for(var c=0;c<r[a].length;c++)for(var p=0;p<t;p++)e.vertices.push(r[a][c][p]);a>0&&(o+=r[a-1].length,e.holes.push(o))}return e}});var Ym=ye(Ie=>{"use strict";Object.defineProperty(Ie,"__esModule",{value:!0});Ie.earthRadius=63710088e-1;Ie.factors={centimeters:Ie.earthRadius*100,centimetres:Ie.earthRadius*100,degrees:Ie.earthRadius/111325,feet:Ie.earthRadius*3.28084,inches:Ie.earthRadius*39.37,kilometers:Ie.earthRadius/1e3,kilometres:Ie.earthRadius/1e3,meters:Ie.earthRadius,metres:Ie.earthRadius,miles:Ie.earthRadius/1609.344,millimeters:Ie.earthRadius*1e3,millimetres:Ie.earthRadius*1e3,nauticalmiles:Ie.earthRadius/1852,radians:1,yards:Ie.earthRadius*1.0936};Ie.unitsFactors={centimeters:100,centimetres:100,degrees:1/111325,feet:3.28084,inches:39.37,kilometers:1/1e3,kilometres:1/1e3,meters:1,metres:1,miles:1/1609.344,millimeters:1e3,millimetres:1e3,nauticalmiles:1/1852,radians:1/Ie.earthRadius,yards:1.0936133};Ie.areaFactors={acres:247105e-9,centimeters:1e4,centimetres:1e4,feet:10.763910417,hectares:1e-4,inches:1550.003100006,kilometers:1e-6,kilometres:1e-6,meters:1,metres:1,miles:386e-9,millimeters:1e6,millimetres:1e6,yards:1.195990046};function Au(r,t,e){e===void 0&&(e={});var o={type:"Feature"};return(e.id===0||e.id)&&(o.id=e.id),e.bbox&&(o.bbox=e.bbox),o.properties=t||{},o.geometry=r,o}Ie.feature=Au;function zD(r,t,e){switch(e===void 0&&(e={}),r){case"Point":return Vm(t).geometry;case"LineString":return qm(t).geometry;case"Polygon":return Wm(t).geometry;case"MultiPoint":return Ix(t).geometry;case"MultiLineString":return Px(t).geometry;case"MultiPolygon":return Rx(t).geometry;default:throw new Error(r+" is invalid")}}Ie.geometry=zD;function Vm(r,t,e){if(e===void 0&&(e={}),!r)throw new Error("coordinates is required");if(!Array.isArray(r))throw new Error("coordinates must be an Array");if(r.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!dp(r[0])||!dp(r[1]))throw new Error("coordinates must contain numbers");var o={type:"Point",coordinates:r};return Au(o,t,e)}Ie.point=Vm;function kD(r,t,e){return e===void 0&&(e={}),gp(r.map(function(o){return Vm(o,t)}),e)}Ie.points=kD;function Wm(r,t,e){e===void 0&&(e={});for(var o=0,a=r;o<a.length;o++){var c=a[o];if(c.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");for(var p=0;p<c[c.length-1].length;p++)if(c[c.length-1][p]!==c[0][p])throw new Error("First and last Position are not equivalent.")}var d={type:"Polygon",coordinates:r};return Au(d,t,e)}Ie.polygon=Wm;function GD(r,t,e){return e===void 0&&(e={}),gp(r.map(function(o){return Wm(o,t)}),e)}Ie.polygons=GD;function qm(r,t,e){if(e===void 0&&(e={}),r.length<2)throw new Error("coordinates must be an array of two or more positions");var o={type:"LineString",coordinates:r};return Au(o,t,e)}Ie.lineString=qm;function HD(r,t,e){return e===void 0&&(e={}),gp(r.map(function(o){return qm(o,t)}),e)}Ie.lineStrings=HD;function gp(r,t){t===void 0&&(t={});var e={type:"FeatureCollection"};return t.id&&(e.id=t.id),t.bbox&&(e.bbox=t.bbox),e.features=r,e}Ie.featureCollection=gp;function Px(r,t,e){e===void 0&&(e={});var o={type:"MultiLineString",coordinates:r};return Au(o,t,e)}Ie.multiLineString=Px;function Ix(r,t,e){e===void 0&&(e={});var o={type:"MultiPoint",coordinates:r};return Au(o,t,e)}Ie.multiPoint=Ix;function Rx(r,t,e){e===void 0&&(e={});var o={type:"MultiPolygon",coordinates:r};return Au(o,t,e)}Ie.multiPolygon=Rx;function VD(r,t,e){e===void 0&&(e={});var o={type:"GeometryCollection",geometries:r};return Au(o,t,e)}Ie.geometryCollection=VD;function WD(r,t){if(t===void 0&&(t=0),t&&!(t>=0))throw new Error("precision must be a positive number");var e=Math.pow(10,t||0);return Math.round(r*e)/e}Ie.round=WD;function Lx(r,t){t===void 0&&(t="kilometers");var e=Ie.factors[t];if(!e)throw new Error(t+" units is invalid");return r*e}Ie.radiansToLength=Lx;function Xm(r,t){t===void 0&&(t="kilometers");var e=Ie.factors[t];if(!e)throw new Error(t+" units is invalid");return r/e}Ie.lengthToRadians=Xm;function qD(r,t){return Nx(Xm(r,t))}Ie.lengthToDegrees=qD;function XD(r){var t=r%360;return t<0&&(t+=360),t}Ie.bearingToAzimuth=XD;function Nx(r){var t=r%(2*Math.PI);return t*180/Math.PI}Ie.radiansToDegrees=Nx;function YD(r){var t=r%360;return t*Math.PI/180}Ie.degreesToRadians=YD;function $D(r,t,e){if(t===void 0&&(t="kilometers"),e===void 0&&(e="kilometers"),!(r>=0))throw new Error("length must be a positive number");return Lx(Xm(r,t),e)}Ie.convertLength=$D;function ZD(r,t,e){if(t===void 0&&(t="meters"),e===void 0&&(e="kilometers"),!(r>=0))throw new Error("area must be a positive number");var o=Ie.areaFactors[t];if(!o)throw new Error("invalid original units");var a=Ie.areaFactors[e];if(!a)throw new Error("invalid final units");return r/o*a}Ie.convertArea=ZD;function dp(r){return!isNaN(r)&&r!==null&&!Array.isArray(r)}Ie.isNumber=dp;function JD(r){return!!r&&r.constructor===Object}Ie.isObject=JD;function KD(r){if(!r)throw new Error("bbox is required");if(!Array.isArray(r))throw new Error("bbox must be an Array");if(r.length!==4&&r.length!==6)throw new Error("bbox must be an Array of 4 or 6 numbers");r.forEach(function(t){if(!dp(t))throw new Error("bbox must only contain numbers")})}Ie.validateBBox=KD;function QD(r){if(!r)throw new Error("id is required");if(["string","number"].indexOf(typeof r)===-1)throw new Error("id must be a number or a string")}Ie.validateId=QD});var Zm=ye(li=>{"use strict";Object.defineProperty(li,"__esModule",{value:!0});var ji=Ym();function df(r,t,e){if(r!==null)for(var o,a,c,p,d,g,y,_=0,w=0,x,T=r.type,C=T==="FeatureCollection",I=T==="Feature",M=C?r.features.length:1,E=0;E<M;E++){y=C?r.features[E].geometry:I?r.geometry:r,x=y?y.type==="GeometryCollection":!1,d=x?y.geometries.length:1;for(var L=0;L<d;L++){var A=0,z=0;if(p=x?y.geometries[L]:y,p!==null){g=p.coordinates;var G=p.type;switch(_=e&&(G==="Polygon"||G==="MultiPolygon")?1:0,G){case null:break;case"Point":if(t(g,w,E,A,z)===!1)return!1;w++,A++;break;case"LineString":case"MultiPoint":for(o=0;o<g.length;o++){if(t(g[o],w,E,A,z)===!1)return!1;w++,G==="MultiPoint"&&A++}G==="LineString"&&A++;break;case"Polygon":case"MultiLineString":for(o=0;o<g.length;o++){for(a=0;a<g[o].length-_;a++){if(t(g[o][a],w,E,A,z)===!1)return!1;w++}G==="MultiLineString"&&A++,G==="Polygon"&&z++}G==="Polygon"&&A++;break;case"MultiPolygon":for(o=0;o<g.length;o++){for(z=0,a=0;a<g[o].length;a++){for(c=0;c<g[o][a].length-_;c++){if(t(g[o][a][c],w,E,A,z)===!1)return!1;w++}z++}A++}break;case"GeometryCollection":for(o=0;o<p.geometries.length;o++)if(df(p.geometries[o],t,e)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function jD(r,t,e,o){var a=e;return df(r,function(c,p,d,g,y){p===0&&e===void 0?a=c:a=t(a,c,p,d,g,y)},o),a}function Ox(r,t){var e;switch(r.type){case"FeatureCollection":for(e=0;e<r.features.length&&t(r.features[e].properties,e)!==!1;e++);break;case"Feature":t(r.properties,0);break}}function t3(r,t,e){var o=e;return Ox(r,function(a,c){c===0&&e===void 0?o=a:o=t(o,a,c)}),o}function Dx(r,t){if(r.type==="Feature")t(r,0);else if(r.type==="FeatureCollection")for(var e=0;e<r.features.length&&t(r.features[e],e)!==!1;e++);}function e3(r,t,e){var o=e;return Dx(r,function(a,c){c===0&&e===void 0?o=a:o=t(o,a,c)}),o}function n3(r){var t=[];return df(r,function(e){t.push(e)}),t}function $m(r,t){var e,o,a,c,p,d,g,y,_,w,x=0,T=r.type==="FeatureCollection",C=r.type==="Feature",I=T?r.features.length:1;for(e=0;e<I;e++){for(d=T?r.features[e].geometry:C?r.geometry:r,y=T?r.features[e].properties:C?r.properties:{},_=T?r.features[e].bbox:C?r.bbox:void 0,w=T?r.features[e].id:C?r.id:void 0,g=d?d.type==="GeometryCollection":!1,p=g?d.geometries.length:1,a=0;a<p;a++){if(c=g?d.geometries[a]:d,c===null){if(t(null,x,y,_,w)===!1)return!1;continue}switch(c.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":{if(t(c,x,y,_,w)===!1)return!1;break}case"GeometryCollection":{for(o=0;o<c.geometries.length;o++)if(t(c.geometries[o],x,y,_,w)===!1)return!1;break}default:throw new Error("Unknown Geometry Type")}}x++}}function r3(r,t,e){var o=e;return $m(r,function(a,c,p,d,g){c===0&&e===void 0?o=a:o=t(o,a,c,p,d,g)}),o}function mp(r,t){$m(r,function(e,o,a,c,p){var d=e===null?null:e.type;switch(d){case null:case"Point":case"LineString":case"Polygon":return t(ji.feature(e,a,{bbox:c,id:p}),o,0)===!1?!1:void 0}var g;switch(d){case"MultiPoint":g="Point";break;case"MultiLineString":g="LineString";break;case"MultiPolygon":g="Polygon";break}for(var y=0;y<e.coordinates.length;y++){var _=e.coordinates[y],w={type:g,coordinates:_};if(t(ji.feature(w,a),o,y)===!1)return!1}})}function i3(r,t,e){var o=e;return mp(r,function(a,c,p){c===0&&p===0&&e===void 0?o=a:o=t(o,a,c,p)}),o}function Fx(r,t){mp(r,function(e,o,a){var c=0;if(e.geometry){var p=e.geometry.type;if(!(p==="Point"||p==="MultiPoint")){var d,g=0,y=0,_=0;if(df(e,function(w,x,T,C,I){if(d===void 0||o>g||C>y||I>_){d=w,g=o,y=C,_=I,c=0;return}var M=ji.lineString([d,w],e.properties);if(t(M,o,a,I,c)===!1)return!1;c++,d=w})===!1)return!1}}})}function o3(r,t,e){var o=e,a=!1;return Fx(r,function(c,p,d,g,y){a===!1&&e===void 0?o=c:o=t(o,c,p,d,g,y),a=!0}),o}function Ux(r,t){if(!r)throw new Error("geojson is required");mp(r,function(e,o,a){if(e.geometry!==null){var c=e.geometry.type,p=e.geometry.coordinates;switch(c){case"LineString":if(t(e,o,a,0,0)===!1)return!1;break;case"Polygon":for(var d=0;d<p.length;d++)if(t(ji.lineString(p[d],e.properties),o,a,d)===!1)return!1;break}}})}function s3(r,t,e){var o=e;return Ux(r,function(a,c,p,d){c===0&&e===void 0?o=a:o=t(o,a,c,p,d)}),o}function a3(r,t){if(t=t||{},!ji.isObject(t))throw new Error("options is invalid");var e=t.featureIndex||0,o=t.multiFeatureIndex||0,a=t.geometryIndex||0,c=t.segmentIndex||0,p=t.properties,d;switch(r.type){case"FeatureCollection":e<0&&(e=r.features.length+e),p=p||r.features[e].properties,d=r.features[e].geometry;break;case"Feature":p=p||r.properties,d=r.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":d=r;break;default:throw new Error("geojson is invalid")}if(d===null)return null;var g=d.coordinates;switch(d.type){case"Point":case"MultiPoint":return null;case"LineString":return c<0&&(c=g.length+c-1),ji.lineString([g[c],g[c+1]],p,t);case"Polygon":return a<0&&(a=g.length+a),c<0&&(c=g[a].length+c-1),ji.lineString([g[a][c],g[a][c+1]],p,t);case"MultiLineString":return o<0&&(o=g.length+o),c<0&&(c=g[o].length+c-1),ji.lineString([g[o][c],g[o][c+1]],p,t);case"MultiPolygon":return o<0&&(o=g.length+o),a<0&&(a=g[o].length+a),c<0&&(c=g[o][a].length-c-1),ji.lineString([g[o][a][c],g[o][a][c+1]],p,t)}throw new Error("geojson is invalid")}function u3(r,t){if(t=t||{},!ji.isObject(t))throw new Error("options is invalid");var e=t.featureIndex||0,o=t.multiFeatureIndex||0,a=t.geometryIndex||0,c=t.coordIndex||0,p=t.properties,d;switch(r.type){case"FeatureCollection":e<0&&(e=r.features.length+e),p=p||r.features[e].properties,d=r.features[e].geometry;break;case"Feature":p=p||r.properties,d=r.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":d=r;break;default:throw new Error("geojson is invalid")}if(d===null)return null;var g=d.coordinates;switch(d.type){case"Point":return ji.point(g,p,t);case"MultiPoint":return o<0&&(o=g.length+o),ji.point(g[o],p,t);case"LineString":return c<0&&(c=g.length+c),ji.point(g[c],p,t);case"Polygon":return a<0&&(a=g.length+a),c<0&&(c=g[a].length+c),ji.point(g[a][c],p,t);case"MultiLineString":return o<0&&(o=g.length+o),c<0&&(c=g[o].length+c),ji.point(g[o][c],p,t);case"MultiPolygon":return o<0&&(o=g.length+o),a<0&&(a=g[o].length+a),c<0&&(c=g[o][a].length-c),ji.point(g[o][a][c],p,t)}throw new Error("geojson is invalid")}li.coordAll=n3;li.coordEach=df;li.coordReduce=jD;li.featureEach=Dx;li.featureReduce=e3;li.findPoint=u3;li.findSegment=a3;li.flattenEach=mp;li.flattenReduce=i3;li.geomEach=$m;li.geomReduce=r3;li.lineEach=Ux;li.lineReduce=s3;li.propEach=Ox;li.propReduce=t3;li.segmentEach=Fx;li.segmentReduce=o3});var Bx=ye(Km=>{"use strict";Object.defineProperty(Km,"__esModule",{value:!0});var l3=Zm();function Jm(r){var t=[1/0,1/0,-1/0,-1/0];return l3.coordEach(r,function(e){t[0]>e[0]&&(t[0]=e[0]),t[1]>e[1]&&(t[1]=e[1]),t[2]<e[0]&&(t[2]=e[0]),t[3]<e[1]&&(t[3]=e[1])}),t}Jm.default=Jm;Km.default=Jm});var yp=ye((L5,Qm)=>{var ha=Mm(),kx=Ym(),Gx=Zm(),cc=Bx().default,c3=Gx.featureEach,I5=Gx.coordEach,R5=kx.polygon,zx=kx.featureCollection;function Hx(r){var t=new ha(r);return t.insert=function(e){if(e.type!=="Feature")throw new Error("invalid feature");return e.bbox=e.bbox?e.bbox:cc(e),ha.prototype.insert.call(this,e)},t.load=function(e){var o=[];return Array.isArray(e)?e.forEach(function(a){if(a.type!=="Feature")throw new Error("invalid features");a.bbox=a.bbox?a.bbox:cc(a),o.push(a)}):c3(e,function(a){if(a.type!=="Feature")throw new Error("invalid features");a.bbox=a.bbox?a.bbox:cc(a),o.push(a)}),ha.prototype.load.call(this,o)},t.remove=function(e,o){if(e.type!=="Feature")throw new Error("invalid feature");return e.bbox=e.bbox?e.bbox:cc(e),ha.prototype.remove.call(this,e,o)},t.clear=function(){return ha.prototype.clear.call(this)},t.search=function(e){var o=ha.prototype.search.call(this,this.toBBox(e));return zx(o)},t.collides=function(e){return ha.prototype.collides.call(this,this.toBBox(e))},t.all=function(){var e=ha.prototype.all.call(this);return zx(e)},t.toJSON=function(){return ha.prototype.toJSON.call(this)},t.fromJSON=function(e){return ha.prototype.fromJSON.call(this,e)},t.toBBox=function(e){var o;if(e.bbox)o=e.bbox;else if(Array.isArray(e)&&e.length===4)o=e;else if(Array.isArray(e)&&e.length===6)o=[e[0],e[1],e[3],e[4]];else if(e.type==="Feature")o=cc(e);else if(e.type==="FeatureCollection")o=cc(e);else throw new Error("invalid geojson");return{minX:o[0],minY:o[1],maxX:o[2],maxY:o[3]}},t}Qm.exports=Hx;Qm.exports.default=Hx});var i0=ye((GV,Qx)=>{"use strict";var Kx=Object.prototype.toString;Qx.exports=function(t){var e=Kx.call(t),o=e==="[object Arguments]";return o||(o=e!=="[object Array]"&&t!==null&&typeof t=="object"&&typeof t.length=="number"&&t.length>=0&&Kx.call(t.callee)==="[object Function]"),o}});var aE=ye((HV,sE)=>{"use strict";var oE;Object.keys||(yf=Object.prototype.hasOwnProperty,o0=Object.prototype.toString,jx=i0(),s0=Object.prototype.propertyIsEnumerable,tE=!s0.call({toString:null},"toString"),eE=s0.call(function(){},"prototype"),vf=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],wp=function(r){var t=r.constructor;return t&&t.prototype===r},nE={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},rE=function(){if(typeof window=="undefined")return!1;for(var r in window)try{if(!nE["$"+r]&&yf.call(window,r)&&window[r]!==null&&typeof window[r]=="object")try{wp(window[r])}catch(t){return!0}}catch(t){return!0}return!1}(),iE=function(r){if(typeof window=="undefined"||!rE)return wp(r);try{return wp(r)}catch(t){return!1}},oE=function(t){var e=t!==null&&typeof t=="object",o=o0.call(t)==="[object Function]",a=jx(t),c=e&&o0.call(t)==="[object String]",p=[];if(!e&&!o&&!a)throw new TypeError("Object.keys called on a non-object");var d=eE&&o;if(c&&t.length>0&&!yf.call(t,0))for(var g=0;g<t.length;++g)p.push(String(g));if(a&&t.length>0)for(var y=0;y<t.length;++y)p.push(String(y));else for(var _ in t)!(d&&_==="prototype")&&yf.call(t,_)&&p.push(String(_));if(tE)for(var w=iE(t),x=0;x<vf.length;++x)!(w&&vf[x]==="constructor")&&yf.call(t,vf[x])&&p.push(vf[x]);return p});var yf,o0,jx,s0,tE,eE,vf,wp,nE,rE,iE;sE.exports=oE});var a0=ye((VV,cE)=>{"use strict";var x3=Array.prototype.slice,E3=i0(),uE=Object.keys,Mp=uE?function(t){return uE(t)}:aE(),lE=Object.keys;Mp.shim=function(){if(Object.keys){var t=function(){var e=Object.keys(arguments);return e&&e.length===arguments.length}(1,2);t||(Object.keys=function(o){return E3(o)?lE(x3.call(o)):lE(o)})}else Object.keys=Mp;return Object.keys||Mp};cE.exports=Mp});var u0=ye((WV,fE)=>{"use strict";fE.exports=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var t={},e=Symbol("test"),o=Object(e);if(typeof e=="string"||Object.prototype.toString.call(e)!=="[object Symbol]"||Object.prototype.toString.call(o)!=="[object Symbol]")return!1;var a=42;t[e]=a;for(e in t)return!1;if(typeof Object.keys=="function"&&Object.keys(t).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(t).length!==0)return!1;var c=Object.getOwnPropertySymbols(t);if(c.length!==1||c[0]!==e||!Object.prototype.propertyIsEnumerable.call(t,e))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var p=Object.getOwnPropertyDescriptor(t,e);if(p.value!==a||p.enumerable!==!0)return!1}return!0}});var Sp=ye((qV,hE)=>{"use strict";var w3=u0();hE.exports=function(){return w3()&&!!Symbol.toStringTag}});var gE=ye((XV,dE)=>{"use strict";var pE=typeof Symbol!="undefined"&&Symbol,M3=u0();dE.exports=function(){return typeof pE!="function"||typeof Symbol!="function"||typeof pE("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:M3()}});var vE=ye((YV,yE)=>{"use strict";var mE={foo:{}},S3=Object;yE.exports=function(){return{__proto__:mE}.foo===mE.foo&&!({__proto__:null}instanceof S3)}});var EE=ye(($V,xE)=>{"use strict";var b3="Function.prototype.bind called on incompatible ",T3=Object.prototype.toString,A3=Math.max,C3="[object Function]",_E=function(t,e){for(var o=[],a=0;a<t.length;a+=1)o[a]=t[a];for(var c=0;c<e.length;c+=1)o[c+t.length]=e[c];return o},P3=function(t,e){for(var o=[],a=e||0,c=0;a<t.length;a+=1,c+=1)o[c]=t[a];return o},I3=function(r,t){for(var e="",o=0;o<r.length;o+=1)e+=r[o],o+1<r.length&&(e+=t);return e};xE.exports=function(t){var e=this;if(typeof e!="function"||T3.apply(e)!==C3)throw new TypeError(b3+e);for(var o=P3(arguments,1),a,c=function(){if(this instanceof a){var _=e.apply(this,_E(o,arguments));return Object(_)===_?_:this}return e.apply(t,_E(o,arguments))},p=A3(0,e.length-o.length),d=[],g=0;g<p;g++)d[g]="$"+g;if(a=Function("binder","return function ("+I3(d,",")+"){ return binder.apply(this,arguments); }")(c),e.prototype){var y=function(){};y.prototype=e.prototype,a.prototype=new y,y.prototype=null}return a}});var bp=ye((ZV,wE)=>{"use strict";var R3=EE();wE.exports=Function.prototype.bind||R3});var SE=ye((JV,ME)=>{"use strict";var L3=Function.prototype.call,N3=Object.prototype.hasOwnProperty,O3=bp();ME.exports=O3.call(L3,N3)});var ll=ye((KV,PE)=>{"use strict";var Bn,dc=SyntaxError,CE=Function,pc=TypeError,l0=function(r){try{return CE('"use strict"; return ('+r+").constructor;")()}catch(t){}},al=Object.getOwnPropertyDescriptor;if(al)try{al({},"")}catch(r){al=null}var c0=function(){throw new pc},D3=al?function(){try{return arguments.callee,c0}catch(r){try{return al(arguments,"callee").get}catch(t){return c0}}}():c0,fc=gE()(),F3=vE()(),Ti=Object.getPrototypeOf||(F3?function(r){return r.__proto__}:null),hc={},U3=typeof Uint8Array=="undefined"||!Ti?Bn:Ti(Uint8Array),ul={"%AggregateError%":typeof AggregateError=="undefined"?Bn:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer=="undefined"?Bn:ArrayBuffer,"%ArrayIteratorPrototype%":fc&&Ti?Ti([][Symbol.iterator]()):Bn,"%AsyncFromSyncIteratorPrototype%":Bn,"%AsyncFunction%":hc,"%AsyncGenerator%":hc,"%AsyncGeneratorFunction%":hc,"%AsyncIteratorPrototype%":hc,"%Atomics%":typeof Atomics=="undefined"?Bn:Atomics,"%BigInt%":typeof BigInt=="undefined"?Bn:BigInt,"%BigInt64Array%":typeof BigInt64Array=="undefined"?Bn:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array=="undefined"?Bn:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView=="undefined"?Bn:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":typeof Float32Array=="undefined"?Bn:Float32Array,"%Float64Array%":typeof Float64Array=="undefined"?Bn:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry=="undefined"?Bn:FinalizationRegistry,"%Function%":CE,"%GeneratorFunction%":hc,"%Int8Array%":typeof Int8Array=="undefined"?Bn:Int8Array,"%Int16Array%":typeof Int16Array=="undefined"?Bn:Int16Array,"%Int32Array%":typeof Int32Array=="undefined"?Bn:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":fc&&Ti?Ti(Ti([][Symbol.iterator]())):Bn,"%JSON%":typeof JSON=="object"?JSON:Bn,"%Map%":typeof Map=="undefined"?Bn:Map,"%MapIteratorPrototype%":typeof Map=="undefined"||!fc||!Ti?Bn:Ti(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise=="undefined"?Bn:Promise,"%Proxy%":typeof Proxy=="undefined"?Bn:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":typeof Reflect=="undefined"?Bn:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set=="undefined"?Bn:Set,"%SetIteratorPrototype%":typeof Set=="undefined"||!fc||!Ti?Bn:Ti(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer=="undefined"?Bn:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":fc&&Ti?Ti(""[Symbol.iterator]()):Bn,"%Symbol%":fc?Symbol:Bn,"%SyntaxError%":dc,"%ThrowTypeError%":D3,"%TypedArray%":U3,"%TypeError%":pc,"%Uint8Array%":typeof Uint8Array=="undefined"?Bn:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray=="undefined"?Bn:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array=="undefined"?Bn:Uint16Array,"%Uint32Array%":typeof Uint32Array=="undefined"?Bn:Uint32Array,"%URIError%":URIError,"%WeakMap%":typeof WeakMap=="undefined"?Bn:WeakMap,"%WeakRef%":typeof WeakRef=="undefined"?Bn:WeakRef,"%WeakSet%":typeof WeakSet=="undefined"?Bn:WeakSet};if(Ti)try{null.error}catch(r){bE=Ti(Ti(r)),ul["%Error.prototype%"]=bE}var bE,B3=function r(t){var e;if(t==="%AsyncFunction%")e=l0("async function () {}");else if(t==="%GeneratorFunction%")e=l0("function* () {}");else if(t==="%AsyncGeneratorFunction%")e=l0("async function* () {}");else if(t==="%AsyncGenerator%"){var o=r("%AsyncGeneratorFunction%");o&&(e=o.prototype)}else if(t==="%AsyncIteratorPrototype%"){var a=r("%AsyncGenerator%");a&&Ti&&(e=Ti(a.prototype))}return ul[t]=e,e},TE={"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},_f=bp(),Tp=SE(),z3=_f.call(Function.call,Array.prototype.concat),k3=_f.call(Function.apply,Array.prototype.splice),AE=_f.call(Function.call,String.prototype.replace),Ap=_f.call(Function.call,String.prototype.slice),G3=_f.call(Function.call,RegExp.prototype.exec),H3=/[^%.[\\]]+|\\[(?:(-?\\d+(?:\\.\\d+)?)|(["'])((?:(?!\\2)[^\\\\]|\\\\.)*?)\\2)\\]|(?=(?:\\.|\\[\\])(?:\\.|\\[\\]|%$))/g,V3=/\\\\(\\\\)?/g,W3=function(t){var e=Ap(t,0,1),o=Ap(t,-1);if(e==="%"&&o!=="%")throw new dc("invalid intrinsic syntax, expected closing \`%\`");if(o==="%"&&e!=="%")throw new dc("invalid intrinsic syntax, expected opening \`%\`");var a=[];return AE(t,H3,function(c,p,d,g){a[a.length]=d?AE(g,V3,"$1"):p||c}),a},q3=function(t,e){var o=t,a;if(Tp(TE,o)&&(a=TE[o],o="%"+a[0]+"%"),Tp(ul,o)){var c=ul[o];if(c===hc&&(c=B3(o)),typeof c=="undefined"&&!e)throw new pc("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:a,name:o,value:c}}throw new dc("intrinsic "+t+" does not exist!")};PE.exports=function(t,e){if(typeof t!="string"||t.length===0)throw new pc("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof e!="boolean")throw new pc('"allowMissing" argument must be a boolean');if(G3(/^%?[^%]*%?$/,t)===null)throw new dc("\`%\` may not be present anywhere but at the beginning and end of the intrinsic name");var o=W3(t),a=o.length>0?o[0]:"",c=q3("%"+a+"%",e),p=c.name,d=c.value,g=!1,y=c.alias;y&&(a=y[0],k3(o,z3([0,1],y)));for(var _=1,w=!0;_<o.length;_+=1){var x=o[_],T=Ap(x,0,1),C=Ap(x,-1);if((T==='"'||T==="'"||T==="\`"||C==='"'||C==="'"||C==="\`")&&T!==C)throw new dc("property names with quotes must have matching quotes");if((x==="constructor"||!w)&&(g=!0),a+="."+x,p="%"+a+"%",Tp(ul,p))d=ul[p];else if(d!=null){if(!(x in d)){if(!e)throw new pc("base intrinsic for "+t+" exists, but the property is not available.");return}if(al&&_+1>=o.length){var I=al(d,x);w=!!I,w&&"get"in I&&!("originalValue"in I.get)?d=I.get:d=d[x]}else w=Tp(d,x),d=d[x];w&&!g&&(ul[p]=d)}}return d}});var xf=ye((QV,IE)=>{"use strict";var X3=ll(),f0=X3("%Object.defineProperty%",!0),h0=function(){if(f0)try{return f0({},"a",{value:1}),!0}catch(t){return!1}return!1};h0.hasArrayLengthDefineBug=function(){if(!h0())return null;try{return f0([],"length",{value:1}).length!==1}catch(t){return!0}};IE.exports=h0});var p0=ye((jV,RE)=>{"use strict";var Y3=ll(),Cp=Y3("%Object.getOwnPropertyDescriptor%",!0);if(Cp)try{Cp([],"length")}catch(r){Cp=null}RE.exports=Cp});var Pp=ye((t6,NE)=>{"use strict";var $3=xf()(),d0=ll(),Ef=$3&&d0("%Object.defineProperty%",!0);if(Ef)try{Ef({},"a",{value:1})}catch(r){Ef=!1}var Z3=d0("%SyntaxError%"),gc=d0("%TypeError%"),LE=p0();NE.exports=function(t,e,o){if(!t||typeof t!="object"&&typeof t!="function")throw new gc("\`obj\` must be an object or a function\`");if(typeof e!="string"&&typeof e!="symbol")throw new gc("\`property\` must be a string or a symbol\`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new gc("\`nonEnumerable\`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new gc("\`nonWritable\`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new gc("\`nonConfigurable\`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new gc("\`loose\`, if provided, must be a boolean");var a=arguments.length>3?arguments[3]:null,c=arguments.length>4?arguments[4]:null,p=arguments.length>5?arguments[5]:null,d=arguments.length>6?arguments[6]:!1,g=!!LE&&LE(t,e);if(Ef)Ef(t,e,{configurable:p===null&&g?g.configurable:!p,enumerable:a===null&&g?g.enumerable:!a,value:o,writable:c===null&&g?g.writable:!c});else if(d||!a&&!c&&!p)t[e]=o;else throw new Z3("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")}});var zE=ye((e6,BE)=>{"use strict";var UE=ll(),OE=Pp(),J3=xf()(),DE=p0(),FE=UE("%TypeError%"),K3=UE("%Math.floor%");BE.exports=function(t,e){if(typeof t!="function")throw new FE("\`fn\` is not a function");if(typeof e!="number"||e<0||e>4294967295||K3(e)!==e)throw new FE("\`length\` must be a positive 32-bit integer");var o=arguments.length>2&&!!arguments[2],a=!0,c=!0;if("length"in t&&DE){var p=DE(t,"length");p&&!p.configurable&&(a=!1),p&&!p.writable&&(c=!1)}return(a||c||!o)&&(J3?OE(t,"length",e,!0,!0):OE(t,"length",e)),t}});var Rp=ye((n6,Ip)=>{"use strict";var g0=bp(),mc=ll(),Q3=zE(),j3=mc("%TypeError%"),GE=mc("%Function.prototype.apply%"),HE=mc("%Function.prototype.call%"),VE=mc("%Reflect.apply%",!0)||g0.call(HE,GE),wf=mc("%Object.defineProperty%",!0),tF=mc("%Math.max%");if(wf)try{wf({},"a",{value:1})}catch(r){wf=null}Ip.exports=function(t){if(typeof t!="function")throw new j3("a function is required");var e=VE(g0,HE,arguments);return Q3(e,1+tF(0,t.length-(arguments.length-1)),!0)};var kE=function(){return VE(g0,GE,arguments)};wf?wf(Ip.exports,"apply",{value:kE}):Ip.exports.apply=kE});var m0=ye((r6,XE)=>{"use strict";var WE=ll(),qE=Rp(),eF=qE(WE("String.prototype.indexOf"));XE.exports=function(t,e){var o=WE(t,!!e);return typeof o=="function"&&eF(t,".prototype.")>-1?qE(o):o}});var ZE=ye((i6,$E)=>{"use strict";var nF=Sp()(),rF=m0(),y0=rF("Object.prototype.toString"),Lp=function(t){return nF&&t&&typeof t=="object"&&Symbol.toStringTag in t?!1:y0(t)==="[object Arguments]"},YE=function(t){return Lp(t)?!0:t!==null&&typeof t=="object"&&typeof t.length=="number"&&t.length>=0&&y0(t)!=="[object Array]"&&y0(t.callee)==="[object Function]"},iF=function(){return Lp(arguments)}();Lp.isLegacyArguments=YE;$E.exports=iF?Lp:YE});var yc=ye((o6,jE)=>{"use strict";var oF=a0(),sF=typeof Symbol=="function"&&typeof Symbol("foo")=="symbol",aF=Object.prototype.toString,uF=Array.prototype.concat,JE=Pp(),lF=function(r){return typeof r=="function"&&aF.call(r)==="[object Function]"},KE=xf()(),cF=function(r,t,e,o){if(t in r){if(o===!0){if(r[t]===e)return}else if(!lF(o)||!o())return}KE?JE(r,t,e,!0):JE(r,t,e)},QE=function(r,t){var e=arguments.length>2?arguments[2]:{},o=oF(t);sF&&(o=uF.call(o,Object.getOwnPropertySymbols(t)));for(var a=0;a<o.length;a+=1)cF(r,o[a],t[o[a]],e[o[a]])};QE.supportsDescriptors=!!KE;jE.exports=QE});var v0=ye((s6,ew)=>{"use strict";var tw=function(r){return r!==r};ew.exports=function(t,e){return t===0&&e===0?1/t===1/e:!!(t===e||tw(t)&&tw(e))}});var _0=ye((a6,nw)=>{"use strict";var fF=v0();nw.exports=function(){return typeof Object.is=="function"?Object.is:fF}});var iw=ye((u6,rw)=>{"use strict";var hF=_0(),pF=yc();rw.exports=function(){var t=hF();return pF(Object,{is:t},{is:function(){return Object.is!==t}}),t}});var uw=ye((l6,aw)=>{"use strict";var dF=yc(),gF=Rp(),mF=v0(),ow=_0(),yF=iw(),sw=gF(ow(),Object);dF(sw,{getPolyfill:ow,implementation:mF,shim:yF});aw.exports=sw});var pw=ye((c6,hw)=>{"use strict";var x0=m0(),lw=Sp()(),cw,fw,E0,w0;lw&&(cw=x0("Object.prototype.hasOwnProperty"),fw=x0("RegExp.prototype.exec"),E0={},Np=function(){throw E0},w0={toString:Np,valueOf:Np},typeof Symbol.toPrimitive=="symbol"&&(w0[Symbol.toPrimitive]=Np));var Np,vF=x0("Object.prototype.toString"),_F=Object.getOwnPropertyDescriptor,xF="[object RegExp]";hw.exports=lw?function(t){if(!t||typeof t!="object")return!1;var e=_F(t,"lastIndex"),o=e&&cw(e,"value");if(!o)return!1;try{fw(t,w0)}catch(a){return a===E0}}:function(t){return!t||typeof t!="object"&&typeof t!="function"?!1:vF(t)===xF}});var gw=ye((f6,dw)=>{"use strict";var Sf=function(){return typeof function(){}.name=="string"},Mf=Object.getOwnPropertyDescriptor;if(Mf)try{Mf([],"length")}catch(r){Mf=null}Sf.functionsHaveConfigurableNames=function(){if(!Sf()||!Mf)return!1;var t=Mf(function(){},"name");return!!t&&!!t.configurable};var EF=Function.prototype.bind;Sf.boundFunctionsHaveNames=function(){return Sf()&&typeof EF=="function"&&function(){}.bind().name!==""};dw.exports=Sf});var vw=ye((h6,yw)=>{"use strict";var mw=Pp(),wF=xf()(),MF=gw().functionsHaveConfigurableNames(),SF=TypeError;yw.exports=function(t,e){if(typeof t!="function")throw new SF("\`fn\` is not a function");var o=arguments.length>2&&!!arguments[2];return(!o||MF)&&(wF?mw(t,"name",e,!0,!0):mw(t,"name",e)),t}});var M0=ye((p6,_w)=>{"use strict";var bF=vw(),TF=Object,AF=TypeError;_w.exports=bF(function(){if(this!=null&&this!==TF(this))throw new AF("RegExp.prototype.flags getter called on non-object");var t="";return this.hasIndices&&(t+="d"),this.global&&(t+="g"),this.ignoreCase&&(t+="i"),this.multiline&&(t+="m"),this.dotAll&&(t+="s"),this.unicode&&(t+="u"),this.unicodeSets&&(t+="v"),this.sticky&&(t+="y"),t},"get flags",!0)});var S0=ye((d6,xw)=>{"use strict";var CF=M0(),PF=yc().supportsDescriptors,IF=Object.getOwnPropertyDescriptor;xw.exports=function(){if(PF&&/a/mig.flags==="gim"){var t=IF(RegExp.prototype,"flags");if(t&&typeof t.get=="function"&&typeof RegExp.prototype.dotAll=="boolean"&&typeof RegExp.prototype.hasIndices=="boolean"){var e="",o={};if(Object.defineProperty(o,"hasIndices",{get:function(){e+="d"}}),Object.defineProperty(o,"sticky",{get:function(){e+="y"}}),e==="dy")return t.get}}return CF}});var Mw=ye((g6,ww)=>{"use strict";var RF=yc().supportsDescriptors,LF=S0(),NF=Object.getOwnPropertyDescriptor,OF=Object.defineProperty,DF=TypeError,Ew=Object.getPrototypeOf,FF=/a/;ww.exports=function(){if(!RF||!Ew)throw new DF("RegExp.prototype.flags requires a true ES5 environment that supports property descriptors");var t=LF(),e=Ew(FF),o=NF(e,"flags");return(!o||o.get!==t)&&OF(e,"flags",{configurable:!0,enumerable:!1,get:t}),t}});var Aw=ye((m6,Tw)=>{"use strict";var UF=yc(),BF=Rp(),zF=M0(),Sw=S0(),kF=Mw(),bw=BF(Sw());UF(bw,{getPolyfill:Sw,implementation:zF,shim:kF});Tw.exports=bw});var Pw=ye((y6,Cw)=>{"use strict";var GF=Date.prototype.getDay,HF=function(t){try{return GF.call(t),!0}catch(e){return!1}},VF=Object.prototype.toString,WF="[object Date]",qF=Sp()();Cw.exports=function(t){return typeof t!="object"||t===null?!1:qF?HF(t):VF.call(t)===WF}});var b0=ye((v6,kw)=>{var Iw=a0(),Rw=ZE(),Lw=uw(),Nw=pw(),Ow=Aw(),Dw=Pw(),Fw=Date.prototype.getTime;function zw(r,t,e){var o=e||{};return(o.strict?Lw(r,t):r===t)?!0:!r||!t||typeof r!="object"&&typeof t!="object"?o.strict?Lw(r,t):r==t:XF(r,t,o)}function Uw(r){return r==null}function Bw(r){return!(!r||typeof r!="object"||typeof r.length!="number"||typeof r.copy!="function"||typeof r.slice!="function"||r.length>0&&typeof r[0]!="number")}function XF(r,t,e){var o,a;if(typeof r!=typeof t||Uw(r)||Uw(t)||r.prototype!==t.prototype||Rw(r)!==Rw(t))return!1;var c=Nw(r),p=Nw(t);if(c!==p)return!1;if(c||p)return r.source===t.source&&Ow(r)===Ow(t);if(Dw(r)&&Dw(t))return Fw.call(r)===Fw.call(t);var d=Bw(r),g=Bw(t);if(d!==g)return!1;if(d||g){if(r.length!==t.length)return!1;for(o=0;o<r.length;o++)if(r[o]!==t[o])return!1;return!0}if(typeof r!=typeof t)return!1;try{var y=Iw(r),_=Iw(t)}catch(w){return!1}if(y.length!==_.length)return!1;for(y.sort(),_.sort(),o=y.length-1;o>=0;o--)if(y[o]!=_[o])return!1;for(o=y.length-1;o>=0;o--)if(a=y[o],!zw(r[a],t[a],e))return!1;return!0}kw.exports=zw});var U0=ye((SW,Yw)=>{var FU=b0(),pa=function(r){this.precision=r&&r.precision?r.precision:17,this.direction=r&&r.direction?r.direction:!1,this.pseudoNode=r&&r.pseudoNode?r.pseudoNode:!1,this.objectComparator=r&&r.objectComparator?r.objectComparator:UU};pa.prototype.compare=function(r,t){if(r.type!==t.type||!Xw(r,t))return!1;switch(r.type){case"Point":return this.compareCoord(r.coordinates,t.coordinates);case"LineString":return this.compareLine(r.coordinates,t.coordinates,0,!1);case"Polygon":return this.comparePolygon(r,t);case"Feature":return this.compareFeature(r,t);default:if(r.type.indexOf("Multi")===0){var e=this,o=qw(r),a=qw(t);return o.every(function(c){return this.some(function(p){return e.compare(c,p)})},a)}}return!1};function qw(r){return r.coordinates.map(function(t){return{type:r.type.replace("Multi",""),coordinates:t}})}function Xw(r,t){return r.hasOwnProperty("coordinates")?r.coordinates.length===t.coordinates.length:r.length===t.length}pa.prototype.compareCoord=function(r,t){if(r.length!==t.length)return!1;for(var e=0;e<r.length;e++)if(r[e].toFixed(this.precision)!==t[e].toFixed(this.precision))return!1;return!0};pa.prototype.compareLine=function(r,t,e,o){if(!Xw(r,t))return!1;var a=this.pseudoNode?r:this.removePseudo(r),c=this.pseudoNode?t:this.removePseudo(t);if(!(o&&!this.compareCoord(a[0],c[0])&&(c=this.fixStartIndex(c,a),!c))){var p=this.compareCoord(a[e],c[e]);return this.direction||p?this.comparePath(a,c):this.compareCoord(a[e],c[c.length-(1+e)])?this.comparePath(a.slice().reverse(),c):!1}};pa.prototype.fixStartIndex=function(r,t){for(var e,o=-1,a=0;a<r.length;a++)if(this.compareCoord(r[a],t[0])){o=a;break}return o>=0&&(e=[].concat(r.slice(o,r.length),r.slice(1,o+1))),e};pa.prototype.comparePath=function(r,t){var e=this;return r.every(function(o,a){return e.compareCoord(o,this[a])},t)};pa.prototype.comparePolygon=function(r,t){if(this.compareLine(r.coordinates[0],t.coordinates[0],1,!0)){var e=r.coordinates.slice(1,r.coordinates.length),o=t.coordinates.slice(1,t.coordinates.length),a=this;return e.every(function(c){return this.some(function(p){return a.compareLine(c,p,1,!0)})},o)}else return!1};pa.prototype.compareFeature=function(r,t){return r.id!==t.id||!this.objectComparator(r.properties,t.properties)||!this.compareBBox(r,t)?!1:this.compare(r.geometry,t.geometry)};pa.prototype.compareBBox=function(r,t){return!!(!r.bbox&&!t.bbox||r.bbox&&t.bbox&&this.compareCoord(r.bbox,t.bbox))};pa.prototype.removePseudo=function(r){return r};function UU(r,t){return FU(r,t,{strict:!0})}Yw.exports=pa});var $w=ye((FW,Fp)=>{function Pu(r,t,e,o){this.dataset=[],this.epsilon=1,this.minPts=2,this.distance=this._euclideanDistance,this.clusters=[],this.noise=[],this._visited=[],this._assigned=[],this._datasetLength=0,this._init(r,t,e,o)}Pu.prototype.run=function(r,t,e,o){this._init(r,t,e,o);for(var a=0;a<this._datasetLength;a++)if(this._visited[a]!==1){this._visited[a]=1;var c=this._regionQuery(a);if(c.length<this.minPts)this.noise.push(a);else{var p=this.clusters.length;this.clusters.push([]),this._addToCluster(a,p),this._expandCluster(p,c)}}return this.clusters};Pu.prototype._init=function(r,t,e,o){if(r){if(!(r instanceof Array))throw Error("Dataset must be of type array, "+typeof r+" given");this.dataset=r,this.clusters=[],this.noise=[],this._datasetLength=r.length,this._visited=new Array(this._datasetLength),this._assigned=new Array(this._datasetLength)}t&&(this.epsilon=t),e&&(this.minPts=e),o&&(this.distance=o)};Pu.prototype._expandCluster=function(r,t){for(var e=0;e<t.length;e++){var o=t[e];if(this._visited[o]!==1){this._visited[o]=1;var a=this._regionQuery(o);a.length>=this.minPts&&(t=this._mergeArrays(t,a))}this._assigned[o]!==1&&this._addToCluster(o,r)}};Pu.prototype._addToCluster=function(r,t){this.clusters[t].push(r),this._assigned[r]=1};Pu.prototype._regionQuery=function(r){for(var t=[],e=0;e<this._datasetLength;e++){var o=this.distance(this.dataset[r],this.dataset[e]);o<this.epsilon&&t.push(e)}return t};Pu.prototype._mergeArrays=function(r,t){for(var e=t.length,o=0;o<e;o++){var a=t[o];r.indexOf(a)<0&&r.push(a)}return r};Pu.prototype._euclideanDistance=function(r,t){for(var e=0,o=Math.min(r.length,t.length);o--;)e+=(r[o]-t[o])*(r[o]-t[o]);return Math.sqrt(e)};typeof Fp!="undefined"&&Fp.exports&&(Fp.exports=Pu)});var Zw=ye((UW,Up)=>{function Iu(r,t,e){this.k=3,this.dataset=[],this.assignments=[],this.centroids=[],this.init(r,t,e)}Iu.prototype.init=function(r,t,e){this.assignments=[],this.centroids=[],typeof r!="undefined"&&(this.dataset=r),typeof t!="undefined"&&(this.k=t),typeof e!="undefined"&&(this.distance=e)};Iu.prototype.run=function(r,t){this.init(r,t);for(var e=this.dataset.length,o=0;o<this.k;o++)this.centroids[o]=this.randomCentroid();for(var a=!0;a;){a=this.assign();for(var c=0;c<this.k;c++){for(var p=new Array(_),d=0,g=0;g<_;g++)p[g]=0;for(var y=0;y<e;y++){var _=this.dataset[y].length;if(c===this.assignments[y]){for(var g=0;g<_;g++)p[g]+=this.dataset[y][g];d++}}if(d>0){for(var g=0;g<_;g++)p[g]/=d;this.centroids[c]=p}else this.centroids[c]=this.randomCentroid(),a=!0}}return this.getClusters()};Iu.prototype.randomCentroid=function(){var r=this.dataset.length-1,t,e;do e=Math.round(Math.random()*r),t=this.dataset[e];while(this.centroids.indexOf(t)>=0);return t};Iu.prototype.assign=function(){for(var r=!1,t=this.dataset.length,e,o=0;o<t;o++)e=this.argmin(this.dataset[o],this.centroids,this.distance),e!=this.assignments[o]&&(this.assignments[o]=e,r=!0);return r};Iu.prototype.getClusters=function(){for(var r=new Array(this.k),t,e=0;e<this.assignments.length;e++)t=this.assignments[e],typeof r[t]=="undefined"&&(r[t]=[]),r[t].push(e);return r};Iu.prototype.argmin=function(r,t,e){for(var o=Number.MAX_VALUE,a=0,c=t.length,p,d=0;d<c;d++)p=e(r,t[d]),p<o&&(o=p,a=d);return a};Iu.prototype.distance=function(r,t){for(var e=0,o=Math.min(r.length,t.length);o--;){var a=r[o]-t[o];e+=a*a}return Math.sqrt(e)};typeof Up!="undefined"&&Up.exports&&(Up.exports=Iu)});var B0=ye((BW,Bp)=>{function da(r,t,e){this._queue=[],this._priorities=[],this._sorting="desc",this._init(r,t,e)}da.prototype.insert=function(r,t){for(var e=this._queue.length,o=e;o--;){var a=this._priorities[o];this._sorting==="desc"?t>a&&(e=o):t<a&&(e=o)}this._insertAt(r,t,e)};da.prototype.remove=function(r){for(var t=this._queue.length;t--;){var e=this._queue[t];if(r===e){this._queue.splice(t,1),this._priorities.splice(t,1);break}}};da.prototype.forEach=function(r){this._queue.forEach(r)};da.prototype.getElements=function(){return this._queue};da.prototype.getElementPriority=function(r){return this._priorities[r]};da.prototype.getPriorities=function(){return this._priorities};da.prototype.getElementsWithPriorities=function(){for(var r=[],t=0,e=this._queue.length;t<e;t++)r.push([this._queue[t],this._priorities[t]]);return r};da.prototype._init=function(r,t,e){if(r&&t){if(this._queue=[],this._priorities=[],r.length!==t.length)throw new Error("Arrays must have the same length");for(var o=0;o<r.length;o++)this.insert(r[o],t[o])}e&&(this._sorting=e)};da.prototype._insertAt=function(r,t,e){this._queue.length===e?(this._queue.push(r),this._priorities.push(t)):(this._queue.splice(e,0,r),this._priorities.splice(e,0,t))};typeof Bp!="undefined"&&Bp.exports&&(Bp.exports=da)});var Kw=ye((zW,_c)=>{typeof _c!="undefined"&&_c.exports&&(Jw=B0());var Jw;function Za(r,t,e,o){this.epsilon=1,this.minPts=1,this.distance=this._euclideanDistance,this._reachability=[],this._processed=[],this._coreDistance=0,this._orderedList=[],this._init(r,t,e,o)}Za.prototype.run=function(r,t,e,o){this._init(r,t,e,o);for(var a=0,c=this.dataset.length;a<c;a++)if(this._processed[a]!==1){this._processed[a]=1,this.clusters.push([a]);var p=this.clusters.length-1;this._orderedList.push(a);var d=new Jw(null,null,"asc"),g=this._regionQuery(a);this._distanceToCore(a)!==void 0&&(this._updateQueue(a,g,d),this._expandCluster(p,d))}return this.clusters};Za.prototype.getReachabilityPlot=function(){for(var r=[],t=0,e=this._orderedList.length;t<e;t++){var o=this._orderedList[t],a=this._reachability[o];r.push([o,a])}return r};Za.prototype._init=function(r,t,e,o){if(r){if(!(r instanceof Array))throw Error("Dataset must be of type array, "+typeof r+" given");this.dataset=r,this.clusters=[],this._reachability=new Array(this.dataset.length),this._processed=new Array(this.dataset.length),this._coreDistance=0,this._orderedList=[]}t&&(this.epsilon=t),e&&(this.minPts=e),o&&(this.distance=o)};Za.prototype._updateQueue=function(r,t,e){var o=this;this._coreDistance=this._distanceToCore(r),t.forEach(function(a){if(o._processed[a]===void 0){var c=o.distance(o.dataset[r],o.dataset[a]),p=Math.max(o._coreDistance,c);o._reachability[a]===void 0?(o._reachability[a]=p,e.insert(a,p)):p<o._reachability[a]&&(o._reachability[a]=p,e.remove(a),e.insert(a,p))}})};Za.prototype._expandCluster=function(r,t){for(var e=t.getElements(),o=0,a=e.length;o<a;o++){var c=e[o];if(this._processed[c]===void 0){var p=this._regionQuery(c);this._processed[c]=1,this.clusters[r].push(c),this._orderedList.push(c),this._distanceToCore(c)!==void 0&&(this._updateQueue(c,p,t),this._expandCluster(r,t))}}};Za.prototype._distanceToCore=function(r){for(var t=this.epsilon,e=0;e<t;e++){var o=this._regionQuery(r,e);if(o.length>=this.minPts)return e}};Za.prototype._regionQuery=function(r,t){t=t||this.epsilon;for(var e=[],o=0,a=this.dataset.length;o<a;o++)this.distance(this.dataset[r],this.dataset[o])<t&&e.push(o);return e};Za.prototype._euclideanDistance=function(r,t){for(var e=0,o=Math.min(r.length,t.length);o--;)e+=(r[o]-t[o])*(r[o]-t[o]);return Math.sqrt(e)};typeof _c!="undefined"&&_c.exports&&(_c.exports=Za)});var Qw=ye((kW,zp)=>{typeof zp!="undefined"&&zp.exports&&(zp.exports={DBSCAN:$w(),KMEANS:Zw(),OPTICS:Kw(),PriorityQueue:B0()})});var z0=ye((XW,tM)=>{"use strict";tM.exports={eudist:function(t,e,o){for(var a=t.length,c=0,p=0;p<a;p++){var d=(t[p]||0)-(e[p]||0);c+=d*d}return o?Math.sqrt(c):c},mandist:function(t,e,o){for(var a=t.length,c=0,p=0;p<a;p++)c+=Math.abs((t[p]||0)-(e[p]||0));return o?Math.sqrt(c):c},dist:function(t,e,o){var a=Math.abs(t-e);return o?a:a*a}}});var rM=ye((YW,nM)=>{"use strict";var eM=z0(),VU=eM.eudist,WU=eM.dist;nM.exports={kmrand:function(t,e){for(var o={},a=[],c=e<<2,p=t.length,d=t[0].length>0;a.length<e&&c-- >0;){var g=t[Math.floor(Math.random()*p)],y=d?g.join("_"):""+g;o[y]||(o[y]=!0,a.push(g))}if(a.length<e)throw new Error("Error initializating clusters");return a},kmpp:function(t,e){var o=t[0].length?VU:WU,a=[],c=t.length,p=t[0].length>0,d={},g=t[Math.floor(Math.random()*c)],y=p?g.join("_"):""+g;for(a.push(g),d[y]=!0;a.length<e;){for(var _=[],w=a.length,x=0,T=[],C=0;C<c;C++){for(var I=1/0,M=0;M<w;M++){var E=o(t[C],a[M]);E<=I&&(I=E)}_[C]=I}for(var L=0;L<c;L++)x+=_[L];for(var A=0;A<c;A++)T[A]={i:A,v:t[A],pr:_[A]/x,cs:0};T.sort(function(X,U){return X.pr-U.pr}),T[0].cs=T[0].pr;for(var z=1;z<c;z++)T[z].cs=T[z-1].cs+T[z].pr;for(var G=Math.random(),Y=0;Y<c-1&&T[Y++].cs<G;);a.push(T[Y-1].v)}return a}}});var uM=ye((JW,aM)=>{"use strict";var k0=z0(),sM=rM(),qU=k0.eudist,$W=k0.mandist,ZW=k0.dist,XU=sM.kmrand,YU=sM.kmpp,iM=1e4;function oM(r,t,e){e=e||[];for(var o=0;o<r;o++)e[o]=t;return e}function $U(r,t,e,o){var a=[],c=[],p=[],d=[],g=!1,y=o||iM,_=r.length,w=r[0].length,x=w>0,T=[];if(e)e=="kmrand"?a=XU(r,t):e=="kmpp"?a=YU(r,t):a=e;else for(var C={};a.length<t;){var I=Math.floor(Math.random()*_);C[I]||(C[I]=!0,a.push(r[I]))}do{oM(t,0,T);for(var M=0;M<_;M++){for(var E=1/0,L=0,A=0;A<t;A++){var d=x?qU(r[M],a[A]):Math.abs(r[M]-a[A]);d<=E&&(E=d,L=A)}p[M]=L,T[L]++}for(var z=[],c=[],G=0,Y=0;Y<t;Y++)z[Y]=x?oM(w,0,z[Y]):0,c[Y]=a[Y];if(x){for(var X=0;X<t;X++)a[X]=[];for(var U=0;U<_;U++)for(var H=p[U],Q=z[H],gt=r[U],$=0;$<w;$++)Q[$]+=gt[$];g=!0;for(var Nt=0;Nt<t;Nt++){for(var j=a[Nt],pt=z[Nt],Ct=c[Nt],Tt=T[Nt],ft=0;ft<w;ft++)j[ft]=pt[ft]/Tt||0;if(g){for(var dt=0;dt<w;dt++)if(Ct[dt]!=j[dt]){g=!1;break}}}}else{for(var Z=0;Z<_;Z++){var st=p[Z];z[st]+=r[Z]}for(var vt=0;vt<t;vt++)a[vt]=z[vt]/T[vt]||0;g=!0;for(var zt=0;zt<t;zt++)if(c[zt]!=a[zt]){g=!1;break}}g=g||--y<=0}while(!g);return{it:iM-y,k:t,idxs:p,centroids:a}}aM.exports=$U});var Sc=ye((X0,Y0)=>{(function(r,t){typeof X0=="object"&&typeof Y0!="undefined"?Y0.exports=t():typeof define=="function"&&define.amd?define(t):(r=typeof globalThis!="undefined"?globalThis:r||self,r.polygonClipping=t())})(X0,function(){"use strict";function r(it,B){if(!(it instanceof B))throw new TypeError("Cannot call a class as a function")}function t(it,B){for(var P=0;P<B.length;P++){var F=B[P];F.enumerable=F.enumerable||!1,F.configurable=!0,"value"in F&&(F.writable=!0),Object.defineProperty(it,F.key,F)}}function e(it,B,P){return B&&t(it.prototype,B),P&&t(it,P),it}var o=function(){function it(B,P){this.next=null,this.key=B,this.data=P,this.left=null,this.right=null}return it}();function a(it,B){return it>B?1:it<B?-1:0}function c(it,B,P){for(var F=new o(null,null),J=F,rt=F;;){var D=P(it,B.key);if(D<0){if(B.left===null)break;if(P(it,B.left.key)<0){var N=B.left;if(B.left=N.right,N.right=B,B=N,B.left===null)break}rt.left=B,rt=B,B=B.left}else if(D>0){if(B.right===null)break;if(P(it,B.right.key)>0){var N=B.right;if(B.right=N.left,N.left=B,B=N,B.right===null)break}J.right=B,J=B,B=B.right}else break}return J.right=B.left,rt.left=B.right,B.left=F.right,B.right=F.left,B}function p(it,B,P,F){var J=new o(it,B);if(P===null)return J.left=J.right=null,J;P=c(it,P,F);var rt=F(it,P.key);return rt<0?(J.left=P.left,J.right=P,P.left=null):rt>=0&&(J.right=P.right,J.left=P,P.right=null),J}function d(it,B,P){var F=null,J=null;if(B){B=c(it,B,P);var rt=P(B.key,it);rt===0?(F=B.left,J=B.right):rt<0?(J=B.right,B.right=null,F=B):(F=B.left,B.left=null,J=B)}return{left:F,right:J}}function g(it,B,P){return B===null?it:(it===null||(B=c(it.key,B,P),B.left=it),B)}function y(it,B,P,F,J){if(it){F(""+B+(P?"\\u2514\\u2500\\u2500 ":"\\u251C\\u2500\\u2500 ")+J(it)+\`
|
|
106
106
|
\`);var rt=B+(P?" ":"\\u2502 ");it.left&&y(it.left,rt,!1,F,J),it.right&&y(it.right,rt,!0,F,J)}}var _=function(){function it(B){B===void 0&&(B=a),this._root=null,this._size=0,this._comparator=B}return it.prototype.insert=function(B,P){return this._size++,this._root=p(B,P,this._root,this._comparator)},it.prototype.add=function(B,P){var F=new o(B,P);this._root===null&&(F.left=F.right=null,this._size++,this._root=F);var J=this._comparator,rt=c(B,this._root,J),D=J(B,rt.key);return D===0?this._root=rt:(D<0?(F.left=rt.left,F.right=rt,rt.left=null):D>0&&(F.right=rt.right,F.left=rt,rt.right=null),this._size++,this._root=F),this._root},it.prototype.remove=function(B){this._root=this._remove(B,this._root,this._comparator)},it.prototype._remove=function(B,P,F){var J;if(P===null)return null;P=c(B,P,F);var rt=F(B,P.key);return rt===0?(P.left===null?J=P.right:(J=c(B,P.left,F),J.right=P.right),this._size--,J):P},it.prototype.pop=function(){var B=this._root;if(B){for(;B.left;)B=B.left;return this._root=c(B.key,this._root,this._comparator),this._root=this._remove(B.key,this._root,this._comparator),{key:B.key,data:B.data}}return null},it.prototype.findStatic=function(B){for(var P=this._root,F=this._comparator;P;){var J=F(B,P.key);if(J===0)return P;J<0?P=P.left:P=P.right}return null},it.prototype.find=function(B){return this._root&&(this._root=c(B,this._root,this._comparator),this._comparator(B,this._root.key)!==0)?null:this._root},it.prototype.contains=function(B){for(var P=this._root,F=this._comparator;P;){var J=F(B,P.key);if(J===0)return!0;J<0?P=P.left:P=P.right}return!1},it.prototype.forEach=function(B,P){for(var F=this._root,J=[],rt=!1;!rt;)F!==null?(J.push(F),F=F.left):J.length!==0?(F=J.pop(),B.call(P,F),F=F.right):rt=!0;return this},it.prototype.range=function(B,P,F,J){for(var rt=[],D=this._comparator,N=this._root,W;rt.length!==0||N;)if(N)rt.push(N),N=N.left;else{if(N=rt.pop(),W=D(N.key,P),W>0)break;if(D(N.key,B)>=0&&F.call(J,N))return this;N=N.right}return this},it.prototype.keys=function(){var B=[];return this.forEach(function(P){var F=P.key;return B.push(F)}),B},it.prototype.values=function(){var B=[];return this.forEach(function(P){var F=P.data;return B.push(F)}),B},it.prototype.min=function(){return this._root?this.minNode(this._root).key:null},it.prototype.max=function(){return this._root?this.maxNode(this._root).key:null},it.prototype.minNode=function(B){if(B===void 0&&(B=this._root),B)for(;B.left;)B=B.left;return B},it.prototype.maxNode=function(B){if(B===void 0&&(B=this._root),B)for(;B.right;)B=B.right;return B},it.prototype.at=function(B){for(var P=this._root,F=!1,J=0,rt=[];!F;)if(P)rt.push(P),P=P.left;else if(rt.length>0){if(P=rt.pop(),J===B)return P;J++,P=P.right}else F=!0;return null},it.prototype.next=function(B){var P=this._root,F=null;if(B.right){for(F=B.right;F.left;)F=F.left;return F}for(var J=this._comparator;P;){var rt=J(B.key,P.key);if(rt===0)break;rt<0?(F=P,P=P.left):P=P.right}return F},it.prototype.prev=function(B){var P=this._root,F=null;if(B.left!==null){for(F=B.left;F.right;)F=F.right;return F}for(var J=this._comparator;P;){var rt=J(B.key,P.key);if(rt===0)break;rt<0?P=P.left:(F=P,P=P.right)}return F},it.prototype.clear=function(){return this._root=null,this._size=0,this},it.prototype.toList=function(){return T(this._root)},it.prototype.load=function(B,P,F){P===void 0&&(P=[]),F===void 0&&(F=!1);var J=B.length,rt=this._comparator;if(F&&M(B,P,0,J-1,rt),this._root===null)this._root=w(B,P,0,J),this._size=J;else{var D=I(this.toList(),x(B,P),rt);J=this._size+J,this._root=C({head:D},0,J)}return this},it.prototype.isEmpty=function(){return this._root===null},Object.defineProperty(it.prototype,"size",{get:function(){return this._size},enumerable:!0,configurable:!0}),Object.defineProperty(it.prototype,"root",{get:function(){return this._root},enumerable:!0,configurable:!0}),it.prototype.toString=function(B){B===void 0&&(B=function(J){return String(J.key)});var P=[];return y(this._root,"",!0,function(F){return P.push(F)},B),P.join("")},it.prototype.update=function(B,P,F){var J=this._comparator,rt=d(B,this._root,J),D=rt.left,N=rt.right;J(B,P)<0?N=p(P,F,N,J):D=p(P,F,D,J),this._root=g(D,N,J)},it.prototype.split=function(B){return d(B,this._root,this._comparator)},it}();function w(it,B,P,F){var J=F-P;if(J>0){var rt=P+Math.floor(J/2),D=it[rt],N=B[rt],W=new o(D,N);return W.left=w(it,B,P,rt),W.right=w(it,B,rt+1,F),W}return null}function x(it,B){for(var P=new o(null,null),F=P,J=0;J<it.length;J++)F=F.next=new o(it[J],B[J]);return F.next=null,P.next}function T(it){for(var B=it,P=[],F=!1,J=new o(null,null),rt=J;!F;)B?(P.push(B),B=B.left):P.length>0?(B=rt=rt.next=P.pop(),B=B.right):F=!0;return rt.next=null,J.next}function C(it,B,P){var F=P-B;if(F>0){var J=B+Math.floor(F/2),rt=C(it,B,J),D=it.head;return D.left=rt,it.head=it.head.next,D.right=C(it,J+1,P),D}return null}function I(it,B,P){for(var F=new o(null,null),J=F,rt=it,D=B;rt!==null&&D!==null;)P(rt.key,D.key)<0?(J.next=rt,rt=rt.next):(J.next=D,D=D.next),J=J.next;return rt!==null?J.next=rt:D!==null&&(J.next=D),F.next}function M(it,B,P,F,J){if(!(P>=F)){for(var rt=it[P+F>>1],D=P-1,N=F+1;;){do D++;while(J(it[D],rt)<0);do N--;while(J(it[N],rt)>0);if(D>=N)break;var W=it[D];it[D]=it[N],it[N]=W,W=B[D],B[D]=B[N],B[N]=W}M(it,B,P,N,J),M(it,B,N+1,F,J)}}var E=function(B,P){return B.ll.x<=P.x&&P.x<=B.ur.x&&B.ll.y<=P.y&&P.y<=B.ur.y},L=function(B,P){if(P.ur.x<B.ll.x||B.ur.x<P.ll.x||P.ur.y<B.ll.y||B.ur.y<P.ll.y)return null;var F=B.ll.x<P.ll.x?P.ll.x:B.ll.x,J=B.ur.x<P.ur.x?B.ur.x:P.ur.x,rt=B.ll.y<P.ll.y?P.ll.y:B.ll.y,D=B.ur.y<P.ur.y?B.ur.y:P.ur.y;return{ll:{x:F,y:rt},ur:{x:J,y:D}}},A=Number.EPSILON;A===void 0&&(A=Math.pow(2,-52));var z=A*A,G=function(B,P){if(-A<B&&B<A&&-A<P&&P<A)return 0;var F=B-P;return F*F<z*B*P?0:B<P?-1:1},Y=function(){function it(){r(this,it),this.reset()}return e(it,[{key:"reset",value:function(){this.xRounder=new X,this.yRounder=new X}},{key:"round",value:function(P,F){return{x:this.xRounder.round(P),y:this.yRounder.round(F)}}}]),it}(),X=function(){function it(){r(this,it),this.tree=new _,this.round(0)}return e(it,[{key:"round",value:function(P){var F=this.tree.add(P),J=this.tree.prev(F);if(J!==null&&G(F.key,J.key)===0)return this.tree.remove(P),J.key;var rt=this.tree.next(F);return rt!==null&&G(F.key,rt.key)===0?(this.tree.remove(P),rt.key):P}}]),it}(),U=new Y,H=function(B,P){return B.x*P.y-B.y*P.x},Q=function(B,P){return B.x*P.x+B.y*P.y},gt=function(B,P,F){var J={x:P.x-B.x,y:P.y-B.y},rt={x:F.x-B.x,y:F.y-B.y},D=H(J,rt);return G(D,0)},$=function(B){return Math.sqrt(Q(B,B))},Nt=function(B,P,F){var J={x:P.x-B.x,y:P.y-B.y},rt={x:F.x-B.x,y:F.y-B.y};return H(rt,J)/$(rt)/$(J)},j=function(B,P,F){var J={x:P.x-B.x,y:P.y-B.y},rt={x:F.x-B.x,y:F.y-B.y};return Q(rt,J)/$(rt)/$(J)},pt=function(B,P,F){return P.y===0?null:{x:B.x+P.x/P.y*(F-B.y),y:F}},Ct=function(B,P,F){return P.x===0?null:{x:F,y:B.y+P.y/P.x*(F-B.x)}},Tt=function(B,P,F,J){if(P.x===0)return Ct(F,J,B.x);if(J.x===0)return Ct(B,P,F.x);if(P.y===0)return pt(F,J,B.y);if(J.y===0)return pt(B,P,F.y);var rt=H(P,J);if(rt==0)return null;var D={x:F.x-B.x,y:F.y-B.y},N=H(D,P)/rt,W=H(D,J)/rt,xt=B.x+W*P.x,wt=F.x+N*J.x,lt=B.y+W*P.y,Bt=F.y+N*J.y,Lt=(xt+wt)/2,Ut=(lt+Bt)/2;return{x:Lt,y:Ut}},ft=function(){e(it,null,[{key:"compare",value:function(P,F){var J=it.comparePoints(P.point,F.point);return J!==0?J:(P.point!==F.point&&P.link(F),P.isLeft!==F.isLeft?P.isLeft?1:-1:Z.compare(P.segment,F.segment))}},{key:"comparePoints",value:function(P,F){return P.x<F.x?-1:P.x>F.x?1:P.y<F.y?-1:P.y>F.y?1:0}}]);function it(B,P){r(this,it),B.events===void 0?B.events=[this]:B.events.push(this),this.point=B,this.isLeft=P}return e(it,[{key:"link",value:function(P){if(P.point===this.point)throw new Error("Tried to link already linked events");for(var F=P.point.events,J=0,rt=F.length;J<rt;J++){var D=F[J];this.point.events.push(D),D.point=this.point}this.checkForConsuming()}},{key:"checkForConsuming",value:function(){for(var P=this.point.events.length,F=0;F<P;F++){var J=this.point.events[F];if(J.segment.consumedBy===void 0)for(var rt=F+1;rt<P;rt++){var D=this.point.events[rt];D.consumedBy===void 0&&J.otherSE.point.events===D.otherSE.point.events&&J.segment.consume(D.segment)}}}},{key:"getAvailableLinkedEvents",value:function(){for(var P=[],F=0,J=this.point.events.length;F<J;F++){var rt=this.point.events[F];rt!==this&&!rt.segment.ringOut&&rt.segment.isInResult()&&P.push(rt)}return P}},{key:"getLeftmostComparator",value:function(P){var F=this,J=new Map,rt=function(N){var W=N.otherSE;J.set(N,{sine:Nt(F.point,P.point,W.point),cosine:j(F.point,P.point,W.point)})};return function(D,N){J.has(D)||rt(D),J.has(N)||rt(N);var W=J.get(D),xt=W.sine,wt=W.cosine,lt=J.get(N),Bt=lt.sine,Lt=lt.cosine;return xt>=0&&Bt>=0?wt<Lt?1:wt>Lt?-1:0:xt<0&&Bt<0?wt<Lt?-1:wt>Lt?1:0:Bt<xt?-1:Bt>xt?1:0}}}]),it}(),dt=0,Z=function(){e(it,null,[{key:"compare",value:function(P,F){var J=P.leftSE.point.x,rt=F.leftSE.point.x,D=P.rightSE.point.x,N=F.rightSE.point.x;if(N<J)return 1;if(D<rt)return-1;var W=P.leftSE.point.y,xt=F.leftSE.point.y,wt=P.rightSE.point.y,lt=F.rightSE.point.y;if(J<rt){if(xt<W&&xt<wt)return 1;if(xt>W&&xt>wt)return-1;var Bt=P.comparePoint(F.leftSE.point);if(Bt<0)return 1;if(Bt>0)return-1;var Lt=F.comparePoint(P.rightSE.point);return Lt!==0?Lt:-1}if(J>rt){if(W<xt&&W<lt)return-1;if(W>xt&&W>lt)return 1;var Ut=F.comparePoint(P.leftSE.point);if(Ut!==0)return Ut;var Xt=P.comparePoint(F.rightSE.point);return Xt<0?1:Xt>0?-1:1}if(W<xt)return-1;if(W>xt)return 1;if(D<N){var de=F.comparePoint(P.rightSE.point);if(de!==0)return de}if(D>N){var Ft=P.comparePoint(F.rightSE.point);if(Ft<0)return 1;if(Ft>0)return-1}if(D!==N){var Se=wt-W,xe=D-J,he=lt-xt,Jt=N-rt;if(Se>xe&&he<Jt)return 1;if(Se<xe&&he>Jt)return-1}return D>N?1:D<N||wt<lt?-1:wt>lt?1:P.id<F.id?-1:P.id>F.id?1:0}}]);function it(B,P,F,J){r(this,it),this.id=++dt,this.leftSE=B,B.segment=this,B.otherSE=P,this.rightSE=P,P.segment=this,P.otherSE=B,this.rings=F,this.windings=J}return e(it,[{key:"replaceRightSE",value:function(P){this.rightSE=P,this.rightSE.segment=this,this.rightSE.otherSE=this.leftSE,this.leftSE.otherSE=this.rightSE}},{key:"bbox",value:function(){var P=this.leftSE.point.y,F=this.rightSE.point.y;return{ll:{x:this.leftSE.point.x,y:P<F?P:F},ur:{x:this.rightSE.point.x,y:P>F?P:F}}}},{key:"vector",value:function(){return{x:this.rightSE.point.x-this.leftSE.point.x,y:this.rightSE.point.y-this.leftSE.point.y}}},{key:"isAnEndpoint",value:function(P){return P.x===this.leftSE.point.x&&P.y===this.leftSE.point.y||P.x===this.rightSE.point.x&&P.y===this.rightSE.point.y}},{key:"comparePoint",value:function(P){if(this.isAnEndpoint(P))return 0;var F=this.leftSE.point,J=this.rightSE.point,rt=this.vector();if(F.x===J.x)return P.x===F.x?0:P.x<F.x?1:-1;var D=(P.y-F.y)/rt.y,N=F.x+D*rt.x;if(P.x===N)return 0;var W=(P.x-F.x)/rt.x,xt=F.y+W*rt.y;return P.y===xt?0:P.y<xt?-1:1}},{key:"getIntersection",value:function(P){var F=this.bbox(),J=P.bbox(),rt=L(F,J);if(rt===null)return null;var D=this.leftSE.point,N=this.rightSE.point,W=P.leftSE.point,xt=P.rightSE.point,wt=E(F,W)&&this.comparePoint(W)===0,lt=E(J,D)&&P.comparePoint(D)===0,Bt=E(F,xt)&&this.comparePoint(xt)===0,Lt=E(J,N)&&P.comparePoint(N)===0;if(lt&&wt)return Lt&&!Bt?N:!Lt&&Bt?xt:null;if(lt)return Bt&&D.x===xt.x&&D.y===xt.y?null:D;if(wt)return Lt&&N.x===W.x&&N.y===W.y?null:W;if(Lt&&Bt)return null;if(Lt)return N;if(Bt)return xt;var Ut=Tt(D,this.vector(),W,P.vector());return Ut===null||!E(rt,Ut)?null:U.round(Ut.x,Ut.y)}},{key:"split",value:function(P){var F=[],J=P.events!==void 0,rt=new ft(P,!0),D=new ft(P,!1),N=this.rightSE;this.replaceRightSE(D),F.push(D),F.push(rt);var W=new it(rt,N,this.rings.slice(),this.windings.slice());return ft.comparePoints(W.leftSE.point,W.rightSE.point)>0&&W.swapEvents(),ft.comparePoints(this.leftSE.point,this.rightSE.point)>0&&this.swapEvents(),J&&(rt.checkForConsuming(),D.checkForConsuming()),F}},{key:"swapEvents",value:function(){var P=this.rightSE;this.rightSE=this.leftSE,this.leftSE=P,this.leftSE.isLeft=!0,this.rightSE.isLeft=!1;for(var F=0,J=this.windings.length;F<J;F++)this.windings[F]*=-1}},{key:"consume",value:function(P){for(var F=this,J=P;F.consumedBy;)F=F.consumedBy;for(;J.consumedBy;)J=J.consumedBy;var rt=it.compare(F,J);if(rt!==0){if(rt>0){var D=F;F=J,J=D}if(F.prev===J){var N=F;F=J,J=N}for(var W=0,xt=J.rings.length;W<xt;W++){var wt=J.rings[W],lt=J.windings[W],Bt=F.rings.indexOf(wt);Bt===-1?(F.rings.push(wt),F.windings.push(lt)):F.windings[Bt]+=lt}J.rings=null,J.windings=null,J.consumedBy=F,J.leftSE.consumedBy=F.leftSE,J.rightSE.consumedBy=F.rightSE}}},{key:"prevInResult",value:function(){return this._prevInResult!==void 0?this._prevInResult:(this.prev?this.prev.isInResult()?this._prevInResult=this.prev:this._prevInResult=this.prev.prevInResult():this._prevInResult=null,this._prevInResult)}},{key:"beforeState",value:function(){if(this._beforeState!==void 0)return this._beforeState;if(!this.prev)this._beforeState={rings:[],windings:[],multiPolys:[]};else{var P=this.prev.consumedBy||this.prev;this._beforeState=P.afterState()}return this._beforeState}},{key:"afterState",value:function(){if(this._afterState!==void 0)return this._afterState;var P=this.beforeState();this._afterState={rings:P.rings.slice(0),windings:P.windings.slice(0),multiPolys:[]};for(var F=this._afterState.rings,J=this._afterState.windings,rt=this._afterState.multiPolys,D=0,N=this.rings.length;D<N;D++){var W=this.rings[D],xt=this.windings[D],wt=F.indexOf(W);wt===-1?(F.push(W),J.push(xt)):J[wt]+=xt}for(var lt=[],Bt=[],Lt=0,Ut=F.length;Lt<Ut;Lt++)if(J[Lt]!==0){var Xt=F[Lt],de=Xt.poly;if(Bt.indexOf(de)===-1)if(Xt.isExterior)lt.push(de);else{Bt.indexOf(de)===-1&&Bt.push(de);var Ft=lt.indexOf(Xt.poly);Ft!==-1&<.splice(Ft,1)}}for(var Se=0,xe=lt.length;Se<xe;Se++){var he=lt[Se].multiPoly;rt.indexOf(he)===-1&&rt.push(he)}return this._afterState}},{key:"isInResult",value:function(){if(this.consumedBy)return!1;if(this._isInResult!==void 0)return this._isInResult;var P=this.beforeState().multiPolys,F=this.afterState().multiPolys;switch(pe.type){case"union":{var J=P.length===0,rt=F.length===0;this._isInResult=J!==rt;break}case"intersection":{var D,N;P.length<F.length?(D=P.length,N=F.length):(D=F.length,N=P.length),this._isInResult=N===pe.numMultiPolys&&D<N;break}case"xor":{var W=Math.abs(P.length-F.length);this._isInResult=W%2===1;break}case"difference":{var xt=function(lt){return lt.length===1&<[0].isSubject};this._isInResult=xt(P)!==xt(F);break}default:throw new Error("Unrecognized operation type found ".concat(pe.type))}return this._isInResult}}],[{key:"fromRing",value:function(P,F,J){var rt,D,N,W=ft.comparePoints(P,F);if(W<0)rt=P,D=F,N=1;else if(W>0)rt=F,D=P,N=-1;else throw new Error("Tried to create degenerate segment at [".concat(P.x,", ").concat(P.y,"]"));var xt=new ft(rt,!0),wt=new ft(D,!1);return new it(xt,wt,[J],[N])}}]),it}(),st=function(){function it(B,P,F){if(r(this,it),!Array.isArray(B)||B.length===0)throw new Error("Input geometry is not a valid Polygon or MultiPolygon");if(this.poly=P,this.isExterior=F,this.segments=[],typeof B[0][0]!="number"||typeof B[0][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");var J=U.round(B[0][0],B[0][1]);this.bbox={ll:{x:J.x,y:J.y},ur:{x:J.x,y:J.y}};for(var rt=J,D=1,N=B.length;D<N;D++){if(typeof B[D][0]!="number"||typeof B[D][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");var W=U.round(B[D][0],B[D][1]);W.x===rt.x&&W.y===rt.y||(this.segments.push(Z.fromRing(rt,W,this)),W.x<this.bbox.ll.x&&(this.bbox.ll.x=W.x),W.y<this.bbox.ll.y&&(this.bbox.ll.y=W.y),W.x>this.bbox.ur.x&&(this.bbox.ur.x=W.x),W.y>this.bbox.ur.y&&(this.bbox.ur.y=W.y),rt=W)}(J.x!==rt.x||J.y!==rt.y)&&this.segments.push(Z.fromRing(rt,J,this))}return e(it,[{key:"getSweepEvents",value:function(){for(var P=[],F=0,J=this.segments.length;F<J;F++){var rt=this.segments[F];P.push(rt.leftSE),P.push(rt.rightSE)}return P}}]),it}(),vt=function(){function it(B,P){if(r(this,it),!Array.isArray(B))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");this.exteriorRing=new st(B[0],this,!0),this.bbox={ll:{x:this.exteriorRing.bbox.ll.x,y:this.exteriorRing.bbox.ll.y},ur:{x:this.exteriorRing.bbox.ur.x,y:this.exteriorRing.bbox.ur.y}},this.interiorRings=[];for(var F=1,J=B.length;F<J;F++){var rt=new st(B[F],this,!1);rt.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=rt.bbox.ll.x),rt.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=rt.bbox.ll.y),rt.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=rt.bbox.ur.x),rt.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=rt.bbox.ur.y),this.interiorRings.push(rt)}this.multiPoly=P}return e(it,[{key:"getSweepEvents",value:function(){for(var P=this.exteriorRing.getSweepEvents(),F=0,J=this.interiorRings.length;F<J;F++)for(var rt=this.interiorRings[F].getSweepEvents(),D=0,N=rt.length;D<N;D++)P.push(rt[D]);return P}}]),it}(),zt=function(){function it(B,P){if(r(this,it),!Array.isArray(B))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");try{typeof B[0][0][0]=="number"&&(B=[B])}catch(D){}this.polys=[],this.bbox={ll:{x:Number.POSITIVE_INFINITY,y:Number.POSITIVE_INFINITY},ur:{x:Number.NEGATIVE_INFINITY,y:Number.NEGATIVE_INFINITY}};for(var F=0,J=B.length;F<J;F++){var rt=new vt(B[F],this);rt.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=rt.bbox.ll.x),rt.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=rt.bbox.ll.y),rt.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=rt.bbox.ur.x),rt.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=rt.bbox.ur.y),this.polys.push(rt)}this.isSubject=P}return e(it,[{key:"getSweepEvents",value:function(){for(var P=[],F=0,J=this.polys.length;F<J;F++)for(var rt=this.polys[F].getSweepEvents(),D=0,N=rt.length;D<N;D++)P.push(rt[D]);return P}}]),it}(),bt=function(){e(it,null,[{key:"factory",value:function(P){for(var F=[],J=0,rt=P.length;J<rt;J++){var D=P[J];if(!(!D.isInResult()||D.ringOut)){for(var N=null,W=D.leftSE,xt=D.rightSE,wt=[W],lt=W.point,Bt=[];N=W,W=xt,wt.push(W),W.point!==lt;)for(;;){var Lt=W.getAvailableLinkedEvents();if(Lt.length===0){var Ut=wt[0].point,Xt=wt[wt.length-1].point;throw new Error("Unable to complete output ring starting at [".concat(Ut.x,",")+" ".concat(Ut.y,"]. Last matching segment found ends at")+" [".concat(Xt.x,", ").concat(Xt.y,"]."))}if(Lt.length===1){xt=Lt[0].otherSE;break}for(var de=null,Ft=0,Se=Bt.length;Ft<Se;Ft++)if(Bt[Ft].point===W.point){de=Ft;break}if(de!==null){var xe=Bt.splice(de)[0],he=wt.splice(xe.index);he.unshift(he[0].otherSE),F.push(new it(he.reverse()));continue}Bt.push({index:wt.length,point:W.point});var Jt=W.getLeftmostComparator(N);xt=Lt.sort(Jt)[0].otherSE;break}F.push(new it(wt))}}return F}}]);function it(B){r(this,it),this.events=B;for(var P=0,F=B.length;P<F;P++)B[P].segment.ringOut=this;this.poly=null}return e(it,[{key:"getGeom",value:function(){for(var P=this.events[0].point,F=[P],J=1,rt=this.events.length-1;J<rt;J++){var D=this.events[J].point,N=this.events[J+1].point;gt(D,P,N)!==0&&(F.push(D),P=D)}if(F.length===1)return null;var W=F[0],xt=F[1];gt(W,P,xt)===0&&F.shift(),F.push(F[0]);for(var wt=this.isExteriorRing()?1:-1,lt=this.isExteriorRing()?0:F.length-1,Bt=this.isExteriorRing()?F.length:-1,Lt=[],Ut=lt;Ut!=Bt;Ut+=wt)Lt.push([F[Ut].x,F[Ut].y]);return Lt}},{key:"isExteriorRing",value:function(){if(this._isExteriorRing===void 0){var P=this.enclosingRing();this._isExteriorRing=P?!P.isExteriorRing():!0}return this._isExteriorRing}},{key:"enclosingRing",value:function(){return this._enclosingRing===void 0&&(this._enclosingRing=this._calcEnclosingRing()),this._enclosingRing}},{key:"_calcEnclosingRing",value:function(){for(var P=this.events[0],F=1,J=this.events.length;F<J;F++){var rt=this.events[F];ft.compare(P,rt)>0&&(P=rt)}for(var D=P.segment.prevInResult(),N=D?D.prevInResult():null;;){if(!D)return null;if(!N)return D.ringOut;if(N.ringOut!==D.ringOut)return N.ringOut.enclosingRing()!==D.ringOut?D.ringOut:D.ringOut.enclosingRing();D=N.prevInResult(),N=D?D.prevInResult():null}}}]),it}(),qt=function(){function it(B){r(this,it),this.exteriorRing=B,B.poly=this,this.interiorRings=[]}return e(it,[{key:"addInterior",value:function(P){this.interiorRings.push(P),P.poly=this}},{key:"getGeom",value:function(){var P=[this.exteriorRing.getGeom()];if(P[0]===null)return null;for(var F=0,J=this.interiorRings.length;F<J;F++){var rt=this.interiorRings[F].getGeom();rt!==null&&P.push(rt)}return P}}]),it}(),le=function(){function it(B){r(this,it),this.rings=B,this.polys=this._composePolys(B)}return e(it,[{key:"getGeom",value:function(){for(var P=[],F=0,J=this.polys.length;F<J;F++){var rt=this.polys[F].getGeom();rt!==null&&P.push(rt)}return P}},{key:"_composePolys",value:function(P){for(var F=[],J=0,rt=P.length;J<rt;J++){var D=P[J];if(!D.poly)if(D.isExteriorRing())F.push(new qt(D));else{var N=D.enclosingRing();N.poly||F.push(new qt(N)),N.poly.addInterior(D)}}return F}}]),it}(),se=function(){function it(B){var P=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Z.compare;r(this,it),this.queue=B,this.tree=new _(P),this.segments=[]}return e(it,[{key:"process",value:function(P){var F=P.segment,J=[];if(P.consumedBy)return P.isLeft?this.queue.remove(P.otherSE):this.tree.remove(F),J;var rt=P.isLeft?this.tree.insert(F):this.tree.find(F);if(!rt)throw new Error("Unable to find segment #".concat(F.id," ")+"[".concat(F.leftSE.point.x,", ").concat(F.leftSE.point.y,"] -> ")+"[".concat(F.rightSE.point.x,", ").concat(F.rightSE.point.y,"] ")+"in SweepLine tree. Please submit a bug report.");for(var D=rt,N=rt,W=void 0,xt=void 0;W===void 0;)D=this.tree.prev(D),D===null?W=null:D.key.consumedBy===void 0&&(W=D.key);for(;xt===void 0;)N=this.tree.next(N),N===null?xt=null:N.key.consumedBy===void 0&&(xt=N.key);if(P.isLeft){var wt=null;if(W){var lt=W.getIntersection(F);if(lt!==null&&(F.isAnEndpoint(lt)||(wt=lt),!W.isAnEndpoint(lt)))for(var Bt=this._splitSafely(W,lt),Lt=0,Ut=Bt.length;Lt<Ut;Lt++)J.push(Bt[Lt])}var Xt=null;if(xt){var de=xt.getIntersection(F);if(de!==null&&(F.isAnEndpoint(de)||(Xt=de),!xt.isAnEndpoint(de)))for(var Ft=this._splitSafely(xt,de),Se=0,xe=Ft.length;Se<xe;Se++)J.push(Ft[Se])}if(wt!==null||Xt!==null){var he=null;if(wt===null)he=Xt;else if(Xt===null)he=wt;else{var Jt=ft.comparePoints(wt,Xt);he=Jt<=0?wt:Xt}this.queue.remove(F.rightSE),J.push(F.rightSE);for(var et=F.split(he),kt=0,ct=et.length;kt<ct;kt++)J.push(et[kt])}J.length>0?(this.tree.remove(F),J.push(P)):(this.segments.push(F),F.prev=W)}else{if(W&&xt){var jt=W.getIntersection(xt);if(jt!==null){if(!W.isAnEndpoint(jt))for(var Kt=this._splitSafely(W,jt),Mt=0,me=Kt.length;Mt<me;Mt++)J.push(Kt[Mt]);if(!xt.isAnEndpoint(jt))for(var be=this._splitSafely(xt,jt),Jn=0,$e=be.length;Jn<$e;Jn++)J.push(be[Jn])}}this.tree.remove(F)}return J}},{key:"_splitSafely",value:function(P,F){this.tree.remove(P);var J=P.rightSE;this.queue.remove(J);var rt=P.split(F);return rt.push(J),P.consumedBy===void 0&&this.tree.insert(P),rt}}]),it}(),Zt=typeof process!="undefined"&&process.env.POLYGON_CLIPPING_MAX_QUEUE_SIZE||1e6,_e=typeof process!="undefined"&&process.env.POLYGON_CLIPPING_MAX_SWEEPLINE_SEGMENTS||1e6,Vt=function(){function it(){r(this,it)}return e(it,[{key:"run",value:function(P,F,J){pe.type=P,U.reset();for(var rt=[new zt(F,!0)],D=0,N=J.length;D<N;D++)rt.push(new zt(J[D],!1));if(pe.numMultiPolys=rt.length,pe.type==="difference")for(var W=rt[0],xt=1;xt<rt.length;)L(rt[xt].bbox,W.bbox)!==null?xt++:rt.splice(xt,1);if(pe.type==="intersection"){for(var wt=0,lt=rt.length;wt<lt;wt++)for(var Bt=rt[wt],Lt=wt+1,Ut=rt.length;Lt<Ut;Lt++)if(L(Bt.bbox,rt[Lt].bbox)===null)return[]}for(var Xt=new _(ft.compare),de=0,Ft=rt.length;de<Ft;de++)for(var Se=rt[de].getSweepEvents(),xe=0,he=Se.length;xe<he;xe++)if(Xt.insert(Se[xe]),Xt.size>Zt)throw new Error("Infinite loop when putting segment endpoints in a priority queue (queue size too big). Please file a bug report.");for(var Jt=new se(Xt),et=Xt.size,kt=Xt.pop();kt;){var ct=kt.key;if(Xt.size===et){var jt=ct.segment;throw new Error("Unable to pop() ".concat(ct.isLeft?"left":"right"," SweepEvent ")+"[".concat(ct.point.x,", ").concat(ct.point.y,"] from segment #").concat(jt.id," ")+"[".concat(jt.leftSE.point.x,", ").concat(jt.leftSE.point.y,"] -> ")+"[".concat(jt.rightSE.point.x,", ").concat(jt.rightSE.point.y,"] from queue. ")+"Please file a bug report.")}if(Xt.size>Zt)throw new Error("Infinite loop when passing sweep line over endpoints (queue size too big). Please file a bug report.");if(Jt.segments.length>_e)throw new Error("Infinite loop when passing sweep line over endpoints (too many sweep line segments). Please file a bug report.");for(var Kt=Jt.process(ct),Mt=0,me=Kt.length;Mt<me;Mt++){var be=Kt[Mt];be.consumedBy===void 0&&Xt.insert(be)}et=Xt.size,kt=Xt.pop()}U.reset();var Jn=bt.factory(Jt.segments),$e=new le(Jn);return $e.getGeom()}}]),it}(),pe=new Vt,at=function(B){for(var P=arguments.length,F=new Array(P>1?P-1:0),J=1;J<P;J++)F[J-1]=arguments[J];return pe.run("union",B,F)},He=function(B){for(var P=arguments.length,F=new Array(P>1?P-1:0),J=1;J<P;J++)F[J-1]=arguments[J];return pe.run("intersection",B,F)},ae=function(B){for(var P=arguments.length,F=new Array(P>1?P-1:0),J=1;J<P;J++)F[J-1]=arguments[J];return pe.run("xor",B,F)},ce=function(B){for(var P=arguments.length,F=new Array(P>1?P-1:0),J=1;J<P;J++)F[J-1]=arguments[J];return pe.run("difference",B,F)},fe={union:at,intersection:He,xor:ae,difference:ce};return fe})});var AM=ye((Vp,TM)=>{(function(r,t){typeof Vp=="object"&&typeof TM!="undefined"?t(Vp):typeof define=="function"&&define.amd?define(["exports"],t):t(r.jsts={})})(Vp,function(r){"use strict";function t(){}function e(n){this.message=n||""}function o(n){this.message=n||""}function a(n){this.message=n||""}function c(){}function p(n){return n===null?eo:n.color}function d(n){return n===null?null:n.parent}function g(n,i){n!==null&&(n.color=i)}function y(n){return n===null?null:n.left}function _(n){return n===null?null:n.right}function w(){this.root_=null,this.size_=0}function x(){}function T(){this.array_=[],arguments[0]instanceof Jt&&this.addAll(arguments[0])}function C(){}function I(n){this.message=n||""}function M(){this.array_=[]}"fill"in Array.prototype||Object.defineProperty(Array.prototype,"fill",{configurable:!0,value:function(n){if(this===void 0||this===null)throw new TypeError(this+" is not an object");var i=Object(this),s=Math.max(Math.min(i.length,9007199254740991),0)||0,l=1 in arguments&&parseInt(Number(arguments[1]),10)||0;l=l<0?Math.max(s+l,0):Math.min(l,s);var h=2 in arguments&&arguments[2]!==void 0?parseInt(Number(arguments[2]),10)||0:s;for(h=h<0?Math.max(s+arguments[2],0):Math.min(h,s);l<h;)i[l]=n,++l;return i},writable:!0}),Number.isFinite=Number.isFinite||function(n){return typeof n=="number"&&isFinite(n)},Number.isInteger=Number.isInteger||function(n){return typeof n=="number"&&isFinite(n)&&Math.floor(n)===n},Number.parseFloat=Number.parseFloat||parseFloat,Number.isNaN=Number.isNaN||function(n){return n!=n},Math.trunc=Math.trunc||function(n){return n<0?Math.ceil(n):Math.floor(n)};var E=function(){};E.prototype.interfaces_=function(){return[]},E.prototype.getClass=function(){return E},E.prototype.equalsWithTolerance=function(n,i,s){return Math.abs(n-i)<=s};var L=function(n){function i(s){n.call(this,s),this.name="IllegalArgumentException",this.message=s,this.stack=new n().stack}return n&&(i.__proto__=n),i.prototype=Object.create(n&&n.prototype),i.prototype.constructor=i,i}(Error),A=function(){},z={MAX_VALUE:{configurable:!0}};A.isNaN=function(n){return Number.isNaN(n)},A.doubleToLongBits=function(n){return n},A.longBitsToDouble=function(n){return n},A.isInfinite=function(n){return!Number.isFinite(n)},z.MAX_VALUE.get=function(){return Number.MAX_VALUE},Object.defineProperties(A,z);var G=function(){},Y=function(){},X=function(){},U=function n(){if(this.x=null,this.y=null,this.z=null,arguments.length===0)this.x=0,this.y=0,this.z=n.NULL_ORDINATE;else if(arguments.length===1){var i=arguments[0];this.x=i.x,this.y=i.y,this.z=i.z}else arguments.length===2?(this.x=arguments[0],this.y=arguments[1],this.z=n.NULL_ORDINATE):arguments.length===3&&(this.x=arguments[0],this.y=arguments[1],this.z=arguments[2])},H={DimensionalComparator:{configurable:!0},serialVersionUID:{configurable:!0},NULL_ORDINATE:{configurable:!0},X:{configurable:!0},Y:{configurable:!0},Z:{configurable:!0}};U.prototype.setOrdinate=function(n,i){switch(n){case U.X:this.x=i;break;case U.Y:this.y=i;break;case U.Z:this.z=i;break;default:throw new L("Invalid ordinate index: "+n)}},U.prototype.equals2D=function(){if(arguments.length===1){var n=arguments[0];return this.x===n.x&&this.y===n.y}if(arguments.length===2){var i=arguments[0],s=arguments[1];return!!E.equalsWithTolerance(this.x,i.x,s)&&!!E.equalsWithTolerance(this.y,i.y,s)}},U.prototype.getOrdinate=function(n){switch(n){case U.X:return this.x;case U.Y:return this.y;case U.Z:return this.z}throw new L("Invalid ordinate index: "+n)},U.prototype.equals3D=function(n){return this.x===n.x&&this.y===n.y&&(this.z===n.z||A.isNaN(this.z))&&A.isNaN(n.z)},U.prototype.equals=function(n){return n instanceof U&&this.equals2D(n)},U.prototype.equalInZ=function(n,i){return E.equalsWithTolerance(this.z,n.z,i)},U.prototype.compareTo=function(n){var i=n;return this.x<i.x?-1:this.x>i.x?1:this.y<i.y?-1:this.y>i.y?1:0},U.prototype.clone=function(){},U.prototype.copy=function(){return new U(this)},U.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},U.prototype.distance3D=function(n){var i=this.x-n.x,s=this.y-n.y,l=this.z-n.z;return Math.sqrt(i*i+s*s+l*l)},U.prototype.distance=function(n){var i=this.x-n.x,s=this.y-n.y;return Math.sqrt(i*i+s*s)},U.prototype.hashCode=function(){var n=17;return n=37*n+U.hashCode(this.x),n=37*n+U.hashCode(this.y)},U.prototype.setCoordinate=function(n){this.x=n.x,this.y=n.y,this.z=n.z},U.prototype.interfaces_=function(){return[G,Y,t]},U.prototype.getClass=function(){return U},U.hashCode=function(){if(arguments.length===1){var n=arguments[0],i=A.doubleToLongBits(n);return Math.trunc((i^i)>>>32)}},H.DimensionalComparator.get=function(){return Q},H.serialVersionUID.get=function(){return 6683108902428367e3},H.NULL_ORDINATE.get=function(){return A.NaN},H.X.get=function(){return 0},H.Y.get=function(){return 1},H.Z.get=function(){return 2},Object.defineProperties(U,H);var Q=function(n){if(this._dimensionsToTest=2,arguments.length!==0){if(arguments.length===1){var i=arguments[0];if(i!==2&&i!==3)throw new L("only 2 or 3 dimensions may be specified");this._dimensionsToTest=i}}};Q.prototype.compare=function(n,i){var s=n,l=i,h=Q.compare(s.x,l.x);if(h!==0)return h;var v=Q.compare(s.y,l.y);return v!==0?v:this._dimensionsToTest<=2?0:Q.compare(s.z,l.z)},Q.prototype.interfaces_=function(){return[X]},Q.prototype.getClass=function(){return Q},Q.compare=function(n,i){return n<i?-1:n>i?1:A.isNaN(n)?A.isNaN(i)?0:-1:A.isNaN(i)?1:0};var gt=function(){};gt.prototype.create=function(){},gt.prototype.interfaces_=function(){return[]},gt.prototype.getClass=function(){return gt};var $=function(){},Nt={INTERIOR:{configurable:!0},BOUNDARY:{configurable:!0},EXTERIOR:{configurable:!0},NONE:{configurable:!0}};$.prototype.interfaces_=function(){return[]},$.prototype.getClass=function(){return $},$.toLocationSymbol=function(n){switch(n){case $.EXTERIOR:return"e";case $.BOUNDARY:return"b";case $.INTERIOR:return"i";case $.NONE:return"-"}throw new L("Unknown location value: "+n)},Nt.INTERIOR.get=function(){return 0},Nt.BOUNDARY.get=function(){return 1},Nt.EXTERIOR.get=function(){return 2},Nt.NONE.get=function(){return-1},Object.defineProperties($,Nt);var j=function(n,i){return n.interfaces_&&n.interfaces_().indexOf(i)>-1},pt=function(){},Ct={LOG_10:{configurable:!0}};pt.prototype.interfaces_=function(){return[]},pt.prototype.getClass=function(){return pt},pt.log10=function(n){var i=Math.log(n);return A.isInfinite(i)||A.isNaN(i)?i:i/pt.LOG_10},pt.min=function(n,i,s,l){var h=n;return i<h&&(h=i),s<h&&(h=s),l<h&&(h=l),h},pt.clamp=function(){if(typeof arguments[2]=="number"&&typeof arguments[0]=="number"&&typeof arguments[1]=="number"){var n=arguments[0],i=arguments[1],s=arguments[2];return n<i?i:n>s?s:n}if(Number.isInteger(arguments[2])&&Number.isInteger(arguments[0])&&Number.isInteger(arguments[1])){var l=arguments[0],h=arguments[1],v=arguments[2];return l<h?h:l>v?v:l}},pt.wrap=function(n,i){return n<0?i- -n%i:n%i},pt.max=function(){if(arguments.length===3){var n=arguments[0],i=arguments[1],s=arguments[2],l=n;return i>l&&(l=i),s>l&&(l=s),l}if(arguments.length===4){var h=arguments[0],v=arguments[1],S=arguments[2],R=arguments[3],V=h;return v>V&&(V=v),S>V&&(V=S),R>V&&(V=R),V}},pt.average=function(n,i){return(n+i)/2},Ct.LOG_10.get=function(){return Math.log(10)},Object.defineProperties(pt,Ct);var Tt=function(n){this.str=n};Tt.prototype.append=function(n){this.str+=n},Tt.prototype.setCharAt=function(n,i){this.str=this.str.substr(0,n)+i+this.str.substr(n+1)},Tt.prototype.toString=function(n){return this.str};var ft=function(n){this.value=n};ft.prototype.intValue=function(){return this.value},ft.prototype.compareTo=function(n){return this.value<n?-1:this.value>n?1:0},ft.isNaN=function(n){return Number.isNaN(n)};var dt=function(){};dt.isWhitespace=function(n){return n<=32&&n>=0||n===127},dt.toUpperCase=function(n){return n.toUpperCase()};var Z=function n(){if(this._hi=0,this._lo=0,arguments.length===0)this.init(0);else if(arguments.length===1){if(typeof arguments[0]=="number"){var i=arguments[0];this.init(i)}else if(arguments[0]instanceof n){var s=arguments[0];this.init(s)}else if(typeof arguments[0]=="string"){var l=arguments[0];n.call(this,n.parse(l))}}else if(arguments.length===2){var h=arguments[0],v=arguments[1];this.init(h,v)}},st={PI:{configurable:!0},TWO_PI:{configurable:!0},PI_2:{configurable:!0},E:{configurable:!0},NaN:{configurable:!0},EPS:{configurable:!0},SPLIT:{configurable:!0},MAX_PRINT_DIGITS:{configurable:!0},TEN:{configurable:!0},ONE:{configurable:!0},SCI_NOT_EXPONENT_CHAR:{configurable:!0},SCI_NOT_ZERO:{configurable:!0}};Z.prototype.le=function(n){return(this._hi<n._hi||this._hi===n._hi)&&this._lo<=n._lo},Z.prototype.extractSignificantDigits=function(n,i){var s=this.abs(),l=Z.magnitude(s._hi),h=Z.TEN.pow(l);(s=s.divide(h)).gt(Z.TEN)?(s=s.divide(Z.TEN),l+=1):s.lt(Z.ONE)&&(s=s.multiply(Z.TEN),l-=1);for(var v=l+1,S=new Tt,R=Z.MAX_PRINT_DIGITS-1,V=0;V<=R;V++){n&&V===v&&S.append(".");var nt=Math.trunc(s._hi);if(nt<0)break;var _t=!1,Et=0;nt>9?(_t=!0,Et="9"):Et="0"+nt,S.append(Et),s=s.subtract(Z.valueOf(nt)).multiply(Z.TEN),_t&&s.selfAdd(Z.TEN);var Wt=!0,$t=Z.magnitude(s._hi);if($t<0&&Math.abs($t)>=R-V&&(Wt=!1),!Wt)break}return i[0]=l,S.toString()},Z.prototype.sqr=function(){return this.multiply(this)},Z.prototype.doubleValue=function(){return this._hi+this._lo},Z.prototype.subtract=function(){if(arguments[0]instanceof Z){var n=arguments[0];return this.add(n.negate())}if(typeof arguments[0]=="number"){var i=arguments[0];return this.add(-i)}},Z.prototype.equals=function(){if(arguments.length===1){var n=arguments[0];return this._hi===n._hi&&this._lo===n._lo}},Z.prototype.isZero=function(){return this._hi===0&&this._lo===0},Z.prototype.selfSubtract=function(){if(arguments[0]instanceof Z){var n=arguments[0];return this.isNaN()?this:this.selfAdd(-n._hi,-n._lo)}if(typeof arguments[0]=="number"){var i=arguments[0];return this.isNaN()?this:this.selfAdd(-i,0)}},Z.prototype.getSpecialNumberString=function(){return this.isZero()?"0.0":this.isNaN()?"NaN ":null},Z.prototype.min=function(n){return this.le(n)?this:n},Z.prototype.selfDivide=function(){if(arguments.length===1){if(arguments[0]instanceof Z){var n=arguments[0];return this.selfDivide(n._hi,n._lo)}if(typeof arguments[0]=="number"){var i=arguments[0];return this.selfDivide(i,0)}}else if(arguments.length===2){var s=arguments[0],l=arguments[1],h=null,v=null,S=null,R=null,V=null,nt=null,_t=null,Et=null;return V=this._hi/s,nt=Z.SPLIT*V,h=nt-V,Et=Z.SPLIT*s,h=nt-h,v=V-h,S=Et-s,_t=V*s,S=Et-S,R=s-S,Et=h*S-_t+h*R+v*S+v*R,nt=(this._hi-_t-Et+this._lo-V*l)/s,Et=V+nt,this._hi=Et,this._lo=V-Et+nt,this}},Z.prototype.dump=function(){return"DD<"+this._hi+", "+this._lo+">"},Z.prototype.divide=function(){if(arguments[0]instanceof Z){var n=arguments[0],i=null,s=null,l=null,h=null,v=null,S=null,R=null,V=null;return s=(v=this._hi/n._hi)-(i=(S=Z.SPLIT*v)-(i=S-v)),V=i*(l=(V=Z.SPLIT*n._hi)-(l=V-n._hi))-(R=v*n._hi)+i*(h=n._hi-l)+s*l+s*h,S=(this._hi-R-V+this._lo-v*n._lo)/n._hi,new Z(V=v+S,v-V+S)}if(typeof arguments[0]=="number"){var nt=arguments[0];return A.isNaN(nt)?Z.createNaN():Z.copy(this).selfDivide(nt,0)}},Z.prototype.ge=function(n){return(this._hi>n._hi||this._hi===n._hi)&&this._lo>=n._lo},Z.prototype.pow=function(n){if(n===0)return Z.valueOf(1);var i=new Z(this),s=Z.valueOf(1),l=Math.abs(n);if(l>1)for(;l>0;)l%2==1&&s.selfMultiply(i),(l/=2)>0&&(i=i.sqr());else s=i;return n<0?s.reciprocal():s},Z.prototype.ceil=function(){if(this.isNaN())return Z.NaN;var n=Math.ceil(this._hi),i=0;return n===this._hi&&(i=Math.ceil(this._lo)),new Z(n,i)},Z.prototype.compareTo=function(n){var i=n;return this._hi<i._hi?-1:this._hi>i._hi?1:this._lo<i._lo?-1:this._lo>i._lo?1:0},Z.prototype.rint=function(){return this.isNaN()?this:this.add(.5).floor()},Z.prototype.setValue=function(){if(arguments[0]instanceof Z){var n=arguments[0];return this.init(n),this}if(typeof arguments[0]=="number"){var i=arguments[0];return this.init(i),this}},Z.prototype.max=function(n){return this.ge(n)?this:n},Z.prototype.sqrt=function(){if(this.isZero())return Z.valueOf(0);if(this.isNegative())return Z.NaN;var n=1/Math.sqrt(this._hi),i=this._hi*n,s=Z.valueOf(i),l=this.subtract(s.sqr())._hi*(.5*n);return s.add(l)},Z.prototype.selfAdd=function(){if(arguments.length===1){if(arguments[0]instanceof Z){var n=arguments[0];return this.selfAdd(n._hi,n._lo)}if(typeof arguments[0]=="number"){var i=arguments[0],s=null,l=null,h=null,v=null,S=null,R=null;return h=this._hi+i,S=h-this._hi,v=h-S,v=i-S+(this._hi-v),R=v+this._lo,s=h+R,l=R+(h-s),this._hi=s+l,this._lo=l+(s-this._hi),this}}else if(arguments.length===2){var V=arguments[0],nt=arguments[1],_t=null,Et=null,Wt=null,$t=null,ie=null,Ee=null,An=null;$t=this._hi+V,Et=this._lo+nt,ie=$t-(Ee=$t-this._hi),Wt=Et-(An=Et-this._lo);var Wn=(_t=$t+(Ee=(ie=V-Ee+(this._hi-ie))+Et))+(Ee=(Wt=nt-An+(this._lo-Wt))+(Ee+($t-_t))),Qr=Ee+(_t-Wn);return this._hi=Wn,this._lo=Qr,this}},Z.prototype.selfMultiply=function(){if(arguments.length===1){if(arguments[0]instanceof Z){var n=arguments[0];return this.selfMultiply(n._hi,n._lo)}if(typeof arguments[0]=="number"){var i=arguments[0];return this.selfMultiply(i,0)}}else if(arguments.length===2){var s=arguments[0],l=arguments[1],h=null,v=null,S=null,R=null,V=null,nt=null;h=(V=Z.SPLIT*this._hi)-this._hi,nt=Z.SPLIT*s,h=V-h,v=this._hi-h,S=nt-s;var _t=(V=this._hi*s)+(nt=h*(S=nt-S)-V+h*(R=s-S)+v*S+v*R+(this._hi*l+this._lo*s)),Et=nt+(h=V-_t);return this._hi=_t,this._lo=Et,this}},Z.prototype.selfSqr=function(){return this.selfMultiply(this)},Z.prototype.floor=function(){if(this.isNaN())return Z.NaN;var n=Math.floor(this._hi),i=0;return n===this._hi&&(i=Math.floor(this._lo)),new Z(n,i)},Z.prototype.negate=function(){return this.isNaN()?this:new Z(-this._hi,-this._lo)},Z.prototype.clone=function(){},Z.prototype.multiply=function(){if(arguments[0]instanceof Z){var n=arguments[0];return n.isNaN()?Z.createNaN():Z.copy(this).selfMultiply(n)}if(typeof arguments[0]=="number"){var i=arguments[0];return A.isNaN(i)?Z.createNaN():Z.copy(this).selfMultiply(i,0)}},Z.prototype.isNaN=function(){return A.isNaN(this._hi)},Z.prototype.intValue=function(){return Math.trunc(this._hi)},Z.prototype.toString=function(){var n=Z.magnitude(this._hi);return n>=-3&&n<=20?this.toStandardNotation():this.toSciNotation()},Z.prototype.toStandardNotation=function(){var n=this.getSpecialNumberString();if(n!==null)return n;var i=new Array(1).fill(null),s=this.extractSignificantDigits(!0,i),l=i[0]+1,h=s;if(s.charAt(0)===".")h="0"+s;else if(l<0)h="0."+Z.stringOfChar("0",-l)+s;else if(s.indexOf(".")===-1){var v=l-s.length;h=s+Z.stringOfChar("0",v)+".0"}return this.isNegative()?"-"+h:h},Z.prototype.reciprocal=function(){var n=null,i=null,s=null,l=null,h=null,v=null,S=null,R=null;i=(h=1/this._hi)-(n=(v=Z.SPLIT*h)-(n=v-h)),s=(R=Z.SPLIT*this._hi)-this._hi;var V=h+(v=(1-(S=h*this._hi)-(R=n*(s=R-s)-S+n*(l=this._hi-s)+i*s+i*l)-h*this._lo)/this._hi);return new Z(V,h-V+v)},Z.prototype.toSciNotation=function(){if(this.isZero())return Z.SCI_NOT_ZERO;var n=this.getSpecialNumberString();if(n!==null)return n;var i=new Array(1).fill(null),s=this.extractSignificantDigits(!1,i),l=Z.SCI_NOT_EXPONENT_CHAR+i[0];if(s.charAt(0)==="0")throw new Error("Found leading zero: "+s);var h="";s.length>1&&(h=s.substring(1));var v=s.charAt(0)+"."+h;return this.isNegative()?"-"+v+l:v+l},Z.prototype.abs=function(){return this.isNaN()?Z.NaN:this.isNegative()?this.negate():new Z(this)},Z.prototype.isPositive=function(){return(this._hi>0||this._hi===0)&&this._lo>0},Z.prototype.lt=function(n){return(this._hi<n._hi||this._hi===n._hi)&&this._lo<n._lo},Z.prototype.add=function(){if(arguments[0]instanceof Z){var n=arguments[0];return Z.copy(this).selfAdd(n)}if(typeof arguments[0]=="number"){var i=arguments[0];return Z.copy(this).selfAdd(i)}},Z.prototype.init=function(){if(arguments.length===1){if(typeof arguments[0]=="number"){var n=arguments[0];this._hi=n,this._lo=0}else if(arguments[0]instanceof Z){var i=arguments[0];this._hi=i._hi,this._lo=i._lo}}else if(arguments.length===2){var s=arguments[0],l=arguments[1];this._hi=s,this._lo=l}},Z.prototype.gt=function(n){return(this._hi>n._hi||this._hi===n._hi)&&this._lo>n._lo},Z.prototype.isNegative=function(){return(this._hi<0||this._hi===0)&&this._lo<0},Z.prototype.trunc=function(){return this.isNaN()?Z.NaN:this.isPositive()?this.floor():this.ceil()},Z.prototype.signum=function(){return this._hi>0?1:this._hi<0?-1:this._lo>0?1:this._lo<0?-1:0},Z.prototype.interfaces_=function(){return[t,G,Y]},Z.prototype.getClass=function(){return Z},Z.sqr=function(n){return Z.valueOf(n).selfMultiply(n)},Z.valueOf=function(){if(typeof arguments[0]=="string"){var n=arguments[0];return Z.parse(n)}if(typeof arguments[0]=="number"){var i=arguments[0];return new Z(i)}},Z.sqrt=function(n){return Z.valueOf(n).sqrt()},Z.parse=function(n){for(var i=0,s=n.length;dt.isWhitespace(n.charAt(i));)i++;var l=!1;if(i<s){var h=n.charAt(i);h!=="-"&&h!=="+"||(i++,h==="-"&&(l=!0))}for(var v=new Z,S=0,R=0,V=0;!(i>=s);){var nt=n.charAt(i);if(i++,dt.isDigit(nt)){var _t=nt-"0";v.selfMultiply(Z.TEN),v.selfAdd(_t),S++}else{if(nt!=="."){if(nt==="e"||nt==="E"){var Et=n.substring(i);try{V=ft.parseInt(Et)}catch(An){throw An instanceof Error?new Error("Invalid exponent "+Et+" in string "+n):An}break}throw new Error("Unexpected character '"+nt+"' at position "+i+" in string "+n)}R=S}}var Wt=v,$t=S-R-V;if($t===0)Wt=v;else if($t>0){var ie=Z.TEN.pow($t);Wt=v.divide(ie)}else if($t<0){var Ee=Z.TEN.pow(-$t);Wt=v.multiply(Ee)}return l?Wt.negate():Wt},Z.createNaN=function(){return new Z(A.NaN,A.NaN)},Z.copy=function(n){return new Z(n)},Z.magnitude=function(n){var i=Math.abs(n),s=Math.log(i)/Math.log(10),l=Math.trunc(Math.floor(s));return 10*Math.pow(10,l)<=i&&(l+=1),l},Z.stringOfChar=function(n,i){for(var s=new Tt,l=0;l<i;l++)s.append(n);return s.toString()},st.PI.get=function(){return new Z(3.141592653589793,12246467991473532e-32)},st.TWO_PI.get=function(){return new Z(6.283185307179586,24492935982947064e-32)},st.PI_2.get=function(){return new Z(1.5707963267948966,6123233995736766e-32)},st.E.get=function(){return new Z(2.718281828459045,14456468917292502e-32)},st.NaN.get=function(){return new Z(A.NaN,A.NaN)},st.EPS.get=function(){return 123259516440783e-46},st.SPLIT.get=function(){return 134217729},st.MAX_PRINT_DIGITS.get=function(){return 32},st.TEN.get=function(){return Z.valueOf(10)},st.ONE.get=function(){return Z.valueOf(1)},st.SCI_NOT_EXPONENT_CHAR.get=function(){return"E"},st.SCI_NOT_ZERO.get=function(){return"0.0E0"},Object.defineProperties(Z,st);var vt=function(){},zt={DP_SAFE_EPSILON:{configurable:!0}};vt.prototype.interfaces_=function(){return[]},vt.prototype.getClass=function(){return vt},vt.orientationIndex=function(n,i,s){var l=vt.orientationIndexFilter(n,i,s);if(l<=1)return l;var h=Z.valueOf(i.x).selfAdd(-n.x),v=Z.valueOf(i.y).selfAdd(-n.y),S=Z.valueOf(s.x).selfAdd(-i.x),R=Z.valueOf(s.y).selfAdd(-i.y);return h.selfMultiply(R).selfSubtract(v.selfMultiply(S)).signum()},vt.signOfDet2x2=function(n,i,s,l){return n.multiply(l).selfSubtract(i.multiply(s)).signum()},vt.intersection=function(n,i,s,l){var h=Z.valueOf(l.y).selfSubtract(s.y).selfMultiply(Z.valueOf(i.x).selfSubtract(n.x)),v=Z.valueOf(l.x).selfSubtract(s.x).selfMultiply(Z.valueOf(i.y).selfSubtract(n.y)),S=h.subtract(v),R=Z.valueOf(l.x).selfSubtract(s.x).selfMultiply(Z.valueOf(n.y).selfSubtract(s.y)),V=Z.valueOf(l.y).selfSubtract(s.y).selfMultiply(Z.valueOf(n.x).selfSubtract(s.x)),nt=R.subtract(V).selfDivide(S).doubleValue(),_t=Z.valueOf(n.x).selfAdd(Z.valueOf(i.x).selfSubtract(n.x).selfMultiply(nt)).doubleValue(),Et=Z.valueOf(i.x).selfSubtract(n.x).selfMultiply(Z.valueOf(n.y).selfSubtract(s.y)),Wt=Z.valueOf(i.y).selfSubtract(n.y).selfMultiply(Z.valueOf(n.x).selfSubtract(s.x)),$t=Et.subtract(Wt).selfDivide(S).doubleValue(),ie=Z.valueOf(s.y).selfAdd(Z.valueOf(l.y).selfSubtract(s.y).selfMultiply($t)).doubleValue();return new U(_t,ie)},vt.orientationIndexFilter=function(n,i,s){var l=null,h=(n.x-s.x)*(i.y-s.y),v=(n.y-s.y)*(i.x-s.x),S=h-v;if(h>0){if(v<=0)return vt.signum(S);l=h+v}else{if(!(h<0)||v>=0)return vt.signum(S);l=-h-v}var R=vt.DP_SAFE_EPSILON*l;return S>=R||-S>=R?vt.signum(S):2},vt.signum=function(n){return n>0?1:n<0?-1:0},zt.DP_SAFE_EPSILON.get=function(){return 1e-15},Object.defineProperties(vt,zt);var bt=function(){},qt={X:{configurable:!0},Y:{configurable:!0},Z:{configurable:!0},M:{configurable:!0}};qt.X.get=function(){return 0},qt.Y.get=function(){return 1},qt.Z.get=function(){return 2},qt.M.get=function(){return 3},bt.prototype.setOrdinate=function(n,i,s){},bt.prototype.size=function(){},bt.prototype.getOrdinate=function(n,i){},bt.prototype.getCoordinate=function(){},bt.prototype.getCoordinateCopy=function(n){},bt.prototype.getDimension=function(){},bt.prototype.getX=function(n){},bt.prototype.clone=function(){},bt.prototype.expandEnvelope=function(n){},bt.prototype.copy=function(){},bt.prototype.getY=function(n){},bt.prototype.toCoordinateArray=function(){},bt.prototype.interfaces_=function(){return[Y]},bt.prototype.getClass=function(){return bt},Object.defineProperties(bt,qt);var le=function(){},se=function(n){function i(){n.call(this,"Projective point not representable on the Cartesian plane.")}return n&&(i.__proto__=n),i.prototype=Object.create(n&&n.prototype),i.prototype.constructor=i,i.prototype.interfaces_=function(){return[]},i.prototype.getClass=function(){return i},i}(le),Zt=function(){};Zt.arraycopy=function(n,i,s,l,h){for(var v=0,S=i;S<i+h;S++)s[l+v]=n[S],v++},Zt.getProperty=function(n){return{"line.separator":\`
|
|
107
107
|
\`}[n]};var _e=function n(){if(this.x=null,this.y=null,this.w=null,arguments.length===0)this.x=0,this.y=0,this.w=1;else if(arguments.length===1){var i=arguments[0];this.x=i.x,this.y=i.y,this.w=1}else if(arguments.length===2){if(typeof arguments[0]=="number"&&typeof arguments[1]=="number"){var s=arguments[0],l=arguments[1];this.x=s,this.y=l,this.w=1}else if(arguments[0]instanceof n&&arguments[1]instanceof n){var h=arguments[0],v=arguments[1];this.x=h.y*v.w-v.y*h.w,this.y=v.x*h.w-h.x*v.w,this.w=h.x*v.y-v.x*h.y}else if(arguments[0]instanceof U&&arguments[1]instanceof U){var S=arguments[0],R=arguments[1];this.x=S.y-R.y,this.y=R.x-S.x,this.w=S.x*R.y-R.x*S.y}}else if(arguments.length===3){var V=arguments[0],nt=arguments[1],_t=arguments[2];this.x=V,this.y=nt,this.w=_t}else if(arguments.length===4){var Et=arguments[0],Wt=arguments[1],$t=arguments[2],ie=arguments[3],Ee=Et.y-Wt.y,An=Wt.x-Et.x,Wn=Et.x*Wt.y-Wt.x*Et.y,Qr=$t.y-ie.y,jo=ie.x-$t.x,Os=$t.x*ie.y-ie.x*$t.y;this.x=An*Os-jo*Wn,this.y=Qr*Wn-Ee*Os,this.w=Ee*jo-Qr*An}};_e.prototype.getY=function(){var n=this.y/this.w;if(A.isNaN(n)||A.isInfinite(n))throw new se;return n},_e.prototype.getX=function(){var n=this.x/this.w;if(A.isNaN(n)||A.isInfinite(n))throw new se;return n},_e.prototype.getCoordinate=function(){var n=new U;return n.x=this.getX(),n.y=this.getY(),n},_e.prototype.interfaces_=function(){return[]},_e.prototype.getClass=function(){return _e},_e.intersection=function(n,i,s,l){var h=n.y-i.y,v=i.x-n.x,S=n.x*i.y-i.x*n.y,R=s.y-l.y,V=l.x-s.x,nt=s.x*l.y-l.x*s.y,_t=h*V-R*v,Et=(v*nt-V*S)/_t,Wt=(R*S-h*nt)/_t;if(A.isNaN(Et)||A.isInfinite(Et)||A.isNaN(Wt)||A.isInfinite(Wt))throw new se;return new U(Et,Wt)};var Vt=function n(){if(this._minx=null,this._maxx=null,this._miny=null,this._maxy=null,arguments.length===0)this.init();else if(arguments.length===1){if(arguments[0]instanceof U){var i=arguments[0];this.init(i.x,i.x,i.y,i.y)}else if(arguments[0]instanceof n){var s=arguments[0];this.init(s)}}else if(arguments.length===2){var l=arguments[0],h=arguments[1];this.init(l.x,h.x,l.y,h.y)}else if(arguments.length===4){var v=arguments[0],S=arguments[1],R=arguments[2],V=arguments[3];this.init(v,S,R,V)}},pe={serialVersionUID:{configurable:!0}};Vt.prototype.getArea=function(){return this.getWidth()*this.getHeight()},Vt.prototype.equals=function(n){if(!(n instanceof Vt))return!1;var i=n;return this.isNull()?i.isNull():this._maxx===i.getMaxX()&&this._maxy===i.getMaxY()&&this._minx===i.getMinX()&&this._miny===i.getMinY()},Vt.prototype.intersection=function(n){if(this.isNull()||n.isNull()||!this.intersects(n))return new Vt;var i=this._minx>n._minx?this._minx:n._minx,s=this._miny>n._miny?this._miny:n._miny,l=this._maxx<n._maxx?this._maxx:n._maxx,h=this._maxy<n._maxy?this._maxy:n._maxy;return new Vt(i,l,s,h)},Vt.prototype.isNull=function(){return this._maxx<this._minx},Vt.prototype.getMaxX=function(){return this._maxx},Vt.prototype.covers=function(){if(arguments.length===1){if(arguments[0]instanceof U){var n=arguments[0];return this.covers(n.x,n.y)}if(arguments[0]instanceof Vt){var i=arguments[0];return!this.isNull()&&!i.isNull()&&i.getMinX()>=this._minx&&i.getMaxX()<=this._maxx&&i.getMinY()>=this._miny&&i.getMaxY()<=this._maxy}}else if(arguments.length===2){var s=arguments[0],l=arguments[1];return!this.isNull()&&s>=this._minx&&s<=this._maxx&&l>=this._miny&&l<=this._maxy}},Vt.prototype.intersects=function(){if(arguments.length===1){if(arguments[0]instanceof Vt){var n=arguments[0];return!this.isNull()&&!n.isNull()&&!(n._minx>this._maxx||n._maxx<this._minx||n._miny>this._maxy||n._maxy<this._miny)}if(arguments[0]instanceof U){var i=arguments[0];return this.intersects(i.x,i.y)}}else if(arguments.length===2){var s=arguments[0],l=arguments[1];return!this.isNull()&&!(s>this._maxx||s<this._minx||l>this._maxy||l<this._miny)}},Vt.prototype.getMinY=function(){return this._miny},Vt.prototype.getMinX=function(){return this._minx},Vt.prototype.expandToInclude=function(){if(arguments.length===1){if(arguments[0]instanceof U){var n=arguments[0];this.expandToInclude(n.x,n.y)}else if(arguments[0]instanceof Vt){var i=arguments[0];if(i.isNull())return null;this.isNull()?(this._minx=i.getMinX(),this._maxx=i.getMaxX(),this._miny=i.getMinY(),this._maxy=i.getMaxY()):(i._minx<this._minx&&(this._minx=i._minx),i._maxx>this._maxx&&(this._maxx=i._maxx),i._miny<this._miny&&(this._miny=i._miny),i._maxy>this._maxy&&(this._maxy=i._maxy))}}else if(arguments.length===2){var s=arguments[0],l=arguments[1];this.isNull()?(this._minx=s,this._maxx=s,this._miny=l,this._maxy=l):(s<this._minx&&(this._minx=s),s>this._maxx&&(this._maxx=s),l<this._miny&&(this._miny=l),l>this._maxy&&(this._maxy=l))}},Vt.prototype.minExtent=function(){if(this.isNull())return 0;var n=this.getWidth(),i=this.getHeight();return n<i?n:i},Vt.prototype.getWidth=function(){return this.isNull()?0:this._maxx-this._minx},Vt.prototype.compareTo=function(n){var i=n;return this.isNull()?i.isNull()?0:-1:i.isNull()?1:this._minx<i._minx?-1:this._minx>i._minx?1:this._miny<i._miny?-1:this._miny>i._miny?1:this._maxx<i._maxx?-1:this._maxx>i._maxx?1:this._maxy<i._maxy?-1:this._maxy>i._maxy?1:0},Vt.prototype.translate=function(n,i){if(this.isNull())return null;this.init(this.getMinX()+n,this.getMaxX()+n,this.getMinY()+i,this.getMaxY()+i)},Vt.prototype.toString=function(){return"Env["+this._minx+" : "+this._maxx+", "+this._miny+" : "+this._maxy+"]"},Vt.prototype.setToNull=function(){this._minx=0,this._maxx=-1,this._miny=0,this._maxy=-1},Vt.prototype.getHeight=function(){return this.isNull()?0:this._maxy-this._miny},Vt.prototype.maxExtent=function(){if(this.isNull())return 0;var n=this.getWidth(),i=this.getHeight();return n>i?n:i},Vt.prototype.expandBy=function(){if(arguments.length===1){var n=arguments[0];this.expandBy(n,n)}else if(arguments.length===2){var i=arguments[0],s=arguments[1];if(this.isNull())return null;this._minx-=i,this._maxx+=i,this._miny-=s,this._maxy+=s,(this._minx>this._maxx||this._miny>this._maxy)&&this.setToNull()}},Vt.prototype.contains=function(){if(arguments.length===1){if(arguments[0]instanceof Vt){var n=arguments[0];return this.covers(n)}if(arguments[0]instanceof U){var i=arguments[0];return this.covers(i)}}else if(arguments.length===2){var s=arguments[0],l=arguments[1];return this.covers(s,l)}},Vt.prototype.centre=function(){return this.isNull()?null:new U((this.getMinX()+this.getMaxX())/2,(this.getMinY()+this.getMaxY())/2)},Vt.prototype.init=function(){if(arguments.length===0)this.setToNull();else if(arguments.length===1){if(arguments[0]instanceof U){var n=arguments[0];this.init(n.x,n.x,n.y,n.y)}else if(arguments[0]instanceof Vt){var i=arguments[0];this._minx=i._minx,this._maxx=i._maxx,this._miny=i._miny,this._maxy=i._maxy}}else if(arguments.length===2){var s=arguments[0],l=arguments[1];this.init(s.x,l.x,s.y,l.y)}else if(arguments.length===4){var h=arguments[0],v=arguments[1],S=arguments[2],R=arguments[3];h<v?(this._minx=h,this._maxx=v):(this._minx=v,this._maxx=h),S<R?(this._miny=S,this._maxy=R):(this._miny=R,this._maxy=S)}},Vt.prototype.getMaxY=function(){return this._maxy},Vt.prototype.distance=function(n){if(this.intersects(n))return 0;var i=0;this._maxx<n._minx?i=n._minx-this._maxx:this._minx>n._maxx&&(i=this._minx-n._maxx);var s=0;return this._maxy<n._miny?s=n._miny-this._maxy:this._miny>n._maxy&&(s=this._miny-n._maxy),i===0?s:s===0?i:Math.sqrt(i*i+s*s)},Vt.prototype.hashCode=function(){var n=17;return n=37*n+U.hashCode(this._minx),n=37*n+U.hashCode(this._maxx),n=37*n+U.hashCode(this._miny),n=37*n+U.hashCode(this._maxy)},Vt.prototype.interfaces_=function(){return[G,t]},Vt.prototype.getClass=function(){return Vt},Vt.intersects=function(){if(arguments.length===3){var n=arguments[0],i=arguments[1],s=arguments[2];return s.x>=(n.x<i.x?n.x:i.x)&&s.x<=(n.x>i.x?n.x:i.x)&&s.y>=(n.y<i.y?n.y:i.y)&&s.y<=(n.y>i.y?n.y:i.y)}if(arguments.length===4){var l=arguments[0],h=arguments[1],v=arguments[2],S=arguments[3],R=Math.min(v.x,S.x),V=Math.max(v.x,S.x),nt=Math.min(l.x,h.x),_t=Math.max(l.x,h.x);return!(nt>V)&&!(_t<R)&&(R=Math.min(v.y,S.y),V=Math.max(v.y,S.y),nt=Math.min(l.y,h.y),_t=Math.max(l.y,h.y),!(nt>V)&&!(_t<R))}},pe.serialVersionUID.get=function(){return 5873921885273102e3},Object.defineProperties(Vt,pe);var at={typeStr:/^\\s*(\\w+)\\s*\\(\\s*(.*)\\s*\\)\\s*$/,emptyTypeStr:/^\\s*(\\w+)\\s*EMPTY\\s*$/,spaces:/\\s+/,parenComma:/\\)\\s*,\\s*\\(/,doubleParenComma:/\\)\\s*\\)\\s*,\\s*\\(\\s*\\(/,trimParens:/^\\s*\\(?(.*?)\\)?\\s*$/},He=function(n){this.geometryFactory=n||new Ce};He.prototype.read=function(n){var i,s,l;n=n.replace(/[\\n\\r]/g," ");var h=at.typeStr.exec(n);if(n.search("EMPTY")!==-1&&((h=at.emptyTypeStr.exec(n))[2]=void 0),h&&(s=h[1].toLowerCase(),l=h[2],ce[s]&&(i=ce[s].apply(this,[l]))),i===void 0)throw new Error("Could not parse WKT "+n);return i},He.prototype.write=function(n){return this.extractGeometry(n)},He.prototype.extractGeometry=function(n){var i=n.getGeometryType().toLowerCase();if(!ae[i])return null;var s=i.toUpperCase();return n.isEmpty()?s+" EMPTY":s+"("+ae[i].apply(this,[n])+")"};var ae={coordinate:function(n){return n.x+" "+n.y},point:function(n){return ae.coordinate.call(this,n._coordinates._coordinates[0])},multipoint:function(n){for(var i=[],s=0,l=n._geometries.length;s<l;++s)i.push("("+ae.point.apply(this,[n._geometries[s]])+")");return i.join(",")},linestring:function(n){for(var i=[],s=0,l=n._points._coordinates.length;s<l;++s)i.push(ae.coordinate.apply(this,[n._points._coordinates[s]]));return i.join(",")},linearring:function(n){for(var i=[],s=0,l=n._points._coordinates.length;s<l;++s)i.push(ae.coordinate.apply(this,[n._points._coordinates[s]]));return i.join(",")},multilinestring:function(n){for(var i=[],s=0,l=n._geometries.length;s<l;++s)i.push("("+ae.linestring.apply(this,[n._geometries[s]])+")");return i.join(",")},polygon:function(n){var i=[];i.push("("+ae.linestring.apply(this,[n._shell])+")");for(var s=0,l=n._holes.length;s<l;++s)i.push("("+ae.linestring.apply(this,[n._holes[s]])+")");return i.join(",")},multipolygon:function(n){for(var i=[],s=0,l=n._geometries.length;s<l;++s)i.push("("+ae.polygon.apply(this,[n._geometries[s]])+")");return i.join(",")},geometrycollection:function(n){for(var i=[],s=0,l=n._geometries.length;s<l;++s)i.push(this.extractGeometry(n._geometries[s]));return i.join(",")}},ce={point:function(n){if(n===void 0)return this.geometryFactory.createPoint();var i=n.trim().split(at.spaces);return this.geometryFactory.createPoint(new U(Number.parseFloat(i[0]),Number.parseFloat(i[1])))},multipoint:function(n){if(n===void 0)return this.geometryFactory.createMultiPoint();for(var i,s=n.trim().split(","),l=[],h=0,v=s.length;h<v;++h)i=s[h].replace(at.trimParens,"$1"),l.push(ce.point.apply(this,[i]));return this.geometryFactory.createMultiPoint(l)},linestring:function(n){if(n===void 0)return this.geometryFactory.createLineString();for(var i,s=n.trim().split(","),l=[],h=0,v=s.length;h<v;++h)i=s[h].trim().split(at.spaces),l.push(new U(Number.parseFloat(i[0]),Number.parseFloat(i[1])));return this.geometryFactory.createLineString(l)},linearring:function(n){if(n===void 0)return this.geometryFactory.createLinearRing();for(var i,s=n.trim().split(","),l=[],h=0,v=s.length;h<v;++h)i=s[h].trim().split(at.spaces),l.push(new U(Number.parseFloat(i[0]),Number.parseFloat(i[1])));return this.geometryFactory.createLinearRing(l)},multilinestring:function(n){if(n===void 0)return this.geometryFactory.createMultiLineString();for(var i,s=n.trim().split(at.parenComma),l=[],h=0,v=s.length;h<v;++h)i=s[h].replace(at.trimParens,"$1"),l.push(ce.linestring.apply(this,[i]));return this.geometryFactory.createMultiLineString(l)},polygon:function(n){if(n===void 0)return this.geometryFactory.createPolygon();for(var i,s,l,h,v=n.trim().split(at.parenComma),S=[],R=0,V=v.length;R<V;++R)i=v[R].replace(at.trimParens,"$1"),s=ce.linestring.apply(this,[i]),l=this.geometryFactory.createLinearRing(s._points),R===0?h=l:S.push(l);return this.geometryFactory.createPolygon(h,S)},multipolygon:function(n){if(n===void 0)return this.geometryFactory.createMultiPolygon();for(var i,s=n.trim().split(at.doubleParenComma),l=[],h=0,v=s.length;h<v;++h)i=s[h].replace(at.trimParens,"$1"),l.push(ce.polygon.apply(this,[i]));return this.geometryFactory.createMultiPolygon(l)},geometrycollection:function(n){if(n===void 0)return this.geometryFactory.createGeometryCollection();for(var i=(n=n.replace(/,\\s*([A-Za-z])/g,"|$1")).trim().split("|"),s=[],l=0,h=i.length;l<h;++l)s.push(this.read(i[l]));return this.geometryFactory.createGeometryCollection(s)}},fe=function(n){this.parser=new He(n)};fe.prototype.write=function(n){return this.parser.write(n)},fe.toLineString=function(n,i){if(arguments.length!==2)throw new Error("Not implemented");return"LINESTRING ( "+n.x+" "+n.y+", "+i.x+" "+i.y+" )"};var it=function(n){function i(s){n.call(this,s),this.name="RuntimeException",this.message=s,this.stack=new n().stack}return n&&(i.__proto__=n),i.prototype=Object.create(n&&n.prototype),i.prototype.constructor=i,i}(Error),B=function(n){function i(){if(n.call(this),arguments.length===0)n.call(this);else if(arguments.length===1){var s=arguments[0];n.call(this,s)}}return n&&(i.__proto__=n),i.prototype=Object.create(n&&n.prototype),i.prototype.constructor=i,i.prototype.interfaces_=function(){return[]},i.prototype.getClass=function(){return i},i}(it),P=function(){};P.prototype.interfaces_=function(){return[]},P.prototype.getClass=function(){return P},P.shouldNeverReachHere=function(){if(arguments.length===0)P.shouldNeverReachHere(null);else if(arguments.length===1){var n=arguments[0];throw new B("Should never reach here"+(n!==null?": "+n:""))}},P.isTrue=function(){var n,i;if(arguments.length===1)n=arguments[0],P.isTrue(n,null);else if(arguments.length===2&&(n=arguments[0],i=arguments[1],!n))throw i===null?new B:new B(i)},P.equals=function(){var n,i,s;if(arguments.length===2)n=arguments[0],i=arguments[1],P.equals(n,i,null);else if(arguments.length===3&&(n=arguments[0],i=arguments[1],s=arguments[2],!i.equals(n)))throw new B("Expected "+n+" but encountered "+i+(s!==null?": "+s:""))};var F=function(){this._result=null,this._inputLines=Array(2).fill().map(function(){return Array(2)}),this._intPt=new Array(2).fill(null),this._intLineIndex=null,this._isProper=null,this._pa=null,this._pb=null,this._precisionModel=null,this._intPt[0]=new U,this._intPt[1]=new U,this._pa=this._intPt[0],this._pb=this._intPt[1],this._result=0},J={DONT_INTERSECT:{configurable:!0},DO_INTERSECT:{configurable:!0},COLLINEAR:{configurable:!0},NO_INTERSECTION:{configurable:!0},POINT_INTERSECTION:{configurable:!0},COLLINEAR_INTERSECTION:{configurable:!0}};F.prototype.getIndexAlongSegment=function(n,i){return this.computeIntLineIndex(),this._intLineIndex[n][i]},F.prototype.getTopologySummary=function(){var n=new Tt;return this.isEndPoint()&&n.append(" endpoint"),this._isProper&&n.append(" proper"),this.isCollinear()&&n.append(" collinear"),n.toString()},F.prototype.computeIntersection=function(n,i,s,l){this._inputLines[0][0]=n,this._inputLines[0][1]=i,this._inputLines[1][0]=s,this._inputLines[1][1]=l,this._result=this.computeIntersect(n,i,s,l)},F.prototype.getIntersectionNum=function(){return this._result},F.prototype.computeIntLineIndex=function(){if(arguments.length===0)this._intLineIndex===null&&(this._intLineIndex=Array(2).fill().map(function(){return Array(2)}),this.computeIntLineIndex(0),this.computeIntLineIndex(1));else if(arguments.length===1){var n=arguments[0];this.getEdgeDistance(n,0)>this.getEdgeDistance(n,1)?(this._intLineIndex[n][0]=0,this._intLineIndex[n][1]=1):(this._intLineIndex[n][0]=1,this._intLineIndex[n][1]=0)}},F.prototype.isProper=function(){return this.hasIntersection()&&this._isProper},F.prototype.setPrecisionModel=function(n){this._precisionModel=n},F.prototype.isInteriorIntersection=function(){if(arguments.length===0)return!!this.isInteriorIntersection(0)||!!this.isInteriorIntersection(1);if(arguments.length===1){for(var n=arguments[0],i=0;i<this._result;i++)if(!this._intPt[i].equals2D(this._inputLines[n][0])&&!this._intPt[i].equals2D(this._inputLines[n][1]))return!0;return!1}},F.prototype.getIntersection=function(n){return this._intPt[n]},F.prototype.isEndPoint=function(){return this.hasIntersection()&&!this._isProper},F.prototype.hasIntersection=function(){return this._result!==F.NO_INTERSECTION},F.prototype.getEdgeDistance=function(n,i){return F.computeEdgeDistance(this._intPt[i],this._inputLines[n][0],this._inputLines[n][1])},F.prototype.isCollinear=function(){return this._result===F.COLLINEAR_INTERSECTION},F.prototype.toString=function(){return fe.toLineString(this._inputLines[0][0],this._inputLines[0][1])+" - "+fe.toLineString(this._inputLines[1][0],this._inputLines[1][1])+this.getTopologySummary()},F.prototype.getEndpoint=function(n,i){return this._inputLines[n][i]},F.prototype.isIntersection=function(n){for(var i=0;i<this._result;i++)if(this._intPt[i].equals2D(n))return!0;return!1},F.prototype.getIntersectionAlongSegment=function(n,i){return this.computeIntLineIndex(),this._intPt[this._intLineIndex[n][i]]},F.prototype.interfaces_=function(){return[]},F.prototype.getClass=function(){return F},F.computeEdgeDistance=function(n,i,s){var l=Math.abs(s.x-i.x),h=Math.abs(s.y-i.y),v=-1;if(n.equals(i))v=0;else if(n.equals(s))v=l>h?l:h;else{var S=Math.abs(n.x-i.x),R=Math.abs(n.y-i.y);(v=l>h?S:R)!==0||n.equals(i)||(v=Math.max(S,R))}return P.isTrue(!(v===0&&!n.equals(i)),"Bad distance calculation"),v},F.nonRobustComputeEdgeDistance=function(n,i,s){var l=n.x-i.x,h=n.y-i.y,v=Math.sqrt(l*l+h*h);return P.isTrue(!(v===0&&!n.equals(i)),"Invalid distance calculation"),v},J.DONT_INTERSECT.get=function(){return 0},J.DO_INTERSECT.get=function(){return 1},J.COLLINEAR.get=function(){return 2},J.NO_INTERSECTION.get=function(){return 0},J.POINT_INTERSECTION.get=function(){return 1},J.COLLINEAR_INTERSECTION.get=function(){return 2},Object.defineProperties(F,J);var rt=function(n){function i(){n.apply(this,arguments)}return n&&(i.__proto__=n),i.prototype=Object.create(n&&n.prototype),i.prototype.constructor=i,i.prototype.isInSegmentEnvelopes=function(s){var l=new Vt(this._inputLines[0][0],this._inputLines[0][1]),h=new Vt(this._inputLines[1][0],this._inputLines[1][1]);return l.contains(s)&&h.contains(s)},i.prototype.computeIntersection=function(){if(arguments.length!==3)return n.prototype.computeIntersection.apply(this,arguments);var s=arguments[0],l=arguments[1],h=arguments[2];if(this._isProper=!1,Vt.intersects(l,h,s)&&W.orientationIndex(l,h,s)===0&&W.orientationIndex(h,l,s)===0)return this._isProper=!0,(s.equals(l)||s.equals(h))&&(this._isProper=!1),this._result=n.POINT_INTERSECTION,null;this._result=n.NO_INTERSECTION},i.prototype.normalizeToMinimum=function(s,l,h,v,S){S.x=this.smallestInAbsValue(s.x,l.x,h.x,v.x),S.y=this.smallestInAbsValue(s.y,l.y,h.y,v.y),s.x-=S.x,s.y-=S.y,l.x-=S.x,l.y-=S.y,h.x-=S.x,h.y-=S.y,v.x-=S.x,v.y-=S.y},i.prototype.safeHCoordinateIntersection=function(s,l,h,v){var S=null;try{S=_e.intersection(s,l,h,v)}catch(R){if(!(R instanceof se))throw R;S=i.nearestEndpoint(s,l,h,v)}return S},i.prototype.intersection=function(s,l,h,v){var S=this.intersectionWithNormalization(s,l,h,v);return this.isInSegmentEnvelopes(S)||(S=new U(i.nearestEndpoint(s,l,h,v))),this._precisionModel!==null&&this._precisionModel.makePrecise(S),S},i.prototype.smallestInAbsValue=function(s,l,h,v){var S=s,R=Math.abs(S);return Math.abs(l)<R&&(S=l,R=Math.abs(l)),Math.abs(h)<R&&(S=h,R=Math.abs(h)),Math.abs(v)<R&&(S=v),S},i.prototype.checkDD=function(s,l,h,v,S){var R=vt.intersection(s,l,h,v),V=this.isInSegmentEnvelopes(R);Zt.out.println("DD in env = "+V+" --------------------- "+R),S.distance(R)>1e-4&&Zt.out.println("Distance = "+S.distance(R))},i.prototype.intersectionWithNormalization=function(s,l,h,v){var S=new U(s),R=new U(l),V=new U(h),nt=new U(v),_t=new U;this.normalizeToEnvCentre(S,R,V,nt,_t);var Et=this.safeHCoordinateIntersection(S,R,V,nt);return Et.x+=_t.x,Et.y+=_t.y,Et},i.prototype.computeCollinearIntersection=function(s,l,h,v){var S=Vt.intersects(s,l,h),R=Vt.intersects(s,l,v),V=Vt.intersects(h,v,s),nt=Vt.intersects(h,v,l);return S&&R?(this._intPt[0]=h,this._intPt[1]=v,n.COLLINEAR_INTERSECTION):V&&nt?(this._intPt[0]=s,this._intPt[1]=l,n.COLLINEAR_INTERSECTION):S&&V?(this._intPt[0]=h,this._intPt[1]=s,!h.equals(s)||R||nt?n.COLLINEAR_INTERSECTION:n.POINT_INTERSECTION):S&&nt?(this._intPt[0]=h,this._intPt[1]=l,!h.equals(l)||R||V?n.COLLINEAR_INTERSECTION:n.POINT_INTERSECTION):R&&V?(this._intPt[0]=v,this._intPt[1]=s,!v.equals(s)||S||nt?n.COLLINEAR_INTERSECTION:n.POINT_INTERSECTION):R&&nt?(this._intPt[0]=v,this._intPt[1]=l,!v.equals(l)||S||V?n.COLLINEAR_INTERSECTION:n.POINT_INTERSECTION):n.NO_INTERSECTION},i.prototype.normalizeToEnvCentre=function(s,l,h,v,S){var R=s.x<l.x?s.x:l.x,V=s.y<l.y?s.y:l.y,nt=s.x>l.x?s.x:l.x,_t=s.y>l.y?s.y:l.y,Et=h.x<v.x?h.x:v.x,Wt=h.y<v.y?h.y:v.y,$t=h.x>v.x?h.x:v.x,ie=h.y>v.y?h.y:v.y,Ee=((R>Et?R:Et)+(nt<$t?nt:$t))/2,An=((V>Wt?V:Wt)+(_t<ie?_t:ie))/2;S.x=Ee,S.y=An,s.x-=S.x,s.y-=S.y,l.x-=S.x,l.y-=S.y,h.x-=S.x,h.y-=S.y,v.x-=S.x,v.y-=S.y},i.prototype.computeIntersect=function(s,l,h,v){if(this._isProper=!1,!Vt.intersects(s,l,h,v))return n.NO_INTERSECTION;var S=W.orientationIndex(s,l,h),R=W.orientationIndex(s,l,v);if(S>0&&R>0||S<0&&R<0)return n.NO_INTERSECTION;var V=W.orientationIndex(h,v,s),nt=W.orientationIndex(h,v,l);return V>0&&nt>0||V<0&&nt<0?n.NO_INTERSECTION:S===0&&R===0&&V===0&&nt===0?this.computeCollinearIntersection(s,l,h,v):(S===0||R===0||V===0||nt===0?(this._isProper=!1,s.equals2D(h)||s.equals2D(v)?this._intPt[0]=s:l.equals2D(h)||l.equals2D(v)?this._intPt[0]=l:S===0?this._intPt[0]=new U(h):R===0?this._intPt[0]=new U(v):V===0?this._intPt[0]=new U(s):nt===0&&(this._intPt[0]=new U(l))):(this._isProper=!0,this._intPt[0]=this.intersection(s,l,h,v)),n.POINT_INTERSECTION)},i.prototype.interfaces_=function(){return[]},i.prototype.getClass=function(){return i},i.nearestEndpoint=function(s,l,h,v){var S=s,R=W.distancePointLine(s,h,v),V=W.distancePointLine(l,h,v);return V<R&&(R=V,S=l),(V=W.distancePointLine(h,s,l))<R&&(R=V,S=h),(V=W.distancePointLine(v,s,l))<R&&(R=V,S=v),S},i}(F),D=function(){};D.prototype.interfaces_=function(){return[]},D.prototype.getClass=function(){return D},D.orientationIndex=function(n,i,s){var l=i.x-n.x,h=i.y-n.y,v=s.x-i.x,S=s.y-i.y;return D.signOfDet2x2(l,h,v,S)},D.signOfDet2x2=function(n,i,s,l){var h=null,v=null,S=null;if(h=1,n===0||l===0)return i===0||s===0?0:i>0?s>0?-h:h:s>0?h:-h;if(i===0||s===0)return l>0?n>0?h:-h:n>0?-h:h;if(i>0?l>0?i<=l||(h=-h,v=n,n=s,s=v,v=i,i=l,l=v):i<=-l?(h=-h,s=-s,l=-l):(v=n,n=-s,s=v,v=i,i=-l,l=v):l>0?-i<=l?(h=-h,n=-n,i=-i):(v=-n,n=s,s=v,v=-i,i=l,l=v):i>=l?(n=-n,i=-i,s=-s,l=-l):(h=-h,v=-n,n=-s,s=v,v=-i,i=-l,l=v),n>0){if(!(s>0)||!(n<=s))return h}else{if(s>0||!(n>=s))return-h;h=-h,n=-n,s=-s}for(;;){if(S=Math.floor(s/n),s-=S*n,(l-=S*i)<0)return-h;if(l>i)return h;if(n>s+s){if(i<l+l)return h}else{if(i>l+l)return-h;s=n-s,l=i-l,h=-h}if(l===0)return s===0?0:-h;if(s===0||(S=Math.floor(n/s),n-=S*s,(i-=S*l)<0))return h;if(i>l)return-h;if(s>n+n){if(l<i+i)return-h}else{if(l>i+i)return h;n=s-n,i=l-i,h=-h}if(i===0)return n===0?0:h;if(n===0)return-h}};var N=function(){this._p=null,this._crossingCount=0,this._isPointOnSegment=!1;var n=arguments[0];this._p=n};N.prototype.countSegment=function(n,i){if(n.x<this._p.x&&i.x<this._p.x)return null;if(this._p.x===i.x&&this._p.y===i.y)return this._isPointOnSegment=!0,null;if(n.y===this._p.y&&i.y===this._p.y){var s=n.x,l=i.x;return s>l&&(s=i.x,l=n.x),this._p.x>=s&&this._p.x<=l&&(this._isPointOnSegment=!0),null}if(n.y>this._p.y&&i.y<=this._p.y||i.y>this._p.y&&n.y<=this._p.y){var h=n.x-this._p.x,v=n.y-this._p.y,S=i.x-this._p.x,R=i.y-this._p.y,V=D.signOfDet2x2(h,v,S,R);if(V===0)return this._isPointOnSegment=!0,null;R<v&&(V=-V),V>0&&this._crossingCount++}},N.prototype.isPointInPolygon=function(){return this.getLocation()!==$.EXTERIOR},N.prototype.getLocation=function(){return this._isPointOnSegment?$.BOUNDARY:this._crossingCount%2==1?$.INTERIOR:$.EXTERIOR},N.prototype.isOnSegment=function(){return this._isPointOnSegment},N.prototype.interfaces_=function(){return[]},N.prototype.getClass=function(){return N},N.locatePointInRing=function(){if(arguments[0]instanceof U&&j(arguments[1],bt)){for(var n=arguments[0],i=arguments[1],s=new N(n),l=new U,h=new U,v=1;v<i.size();v++)if(i.getCoordinate(v,l),i.getCoordinate(v-1,h),s.countSegment(l,h),s.isOnSegment())return s.getLocation();return s.getLocation()}if(arguments[0]instanceof U&&arguments[1]instanceof Array){for(var S=arguments[0],R=arguments[1],V=new N(S),nt=1;nt<R.length;nt++){var _t=R[nt],Et=R[nt-1];if(V.countSegment(_t,Et),V.isOnSegment())return V.getLocation()}return V.getLocation()}};var W=function(){},xt={CLOCKWISE:{configurable:!0},RIGHT:{configurable:!0},COUNTERCLOCKWISE:{configurable:!0},LEFT:{configurable:!0},COLLINEAR:{configurable:!0},STRAIGHT:{configurable:!0}};W.prototype.interfaces_=function(){return[]},W.prototype.getClass=function(){return W},W.orientationIndex=function(n,i,s){return vt.orientationIndex(n,i,s)},W.signedArea=function(){if(arguments[0]instanceof Array){var n=arguments[0];if(n.length<3)return 0;for(var i=0,s=n[0].x,l=1;l<n.length-1;l++){var h=n[l].x-s,v=n[l+1].y;i+=h*(n[l-1].y-v)}return i/2}if(j(arguments[0],bt)){var S=arguments[0],R=S.size();if(R<3)return 0;var V=new U,nt=new U,_t=new U;S.getCoordinate(0,nt),S.getCoordinate(1,_t);var Et=nt.x;_t.x-=Et;for(var Wt=0,$t=1;$t<R-1;$t++)V.y=nt.y,nt.x=_t.x,nt.y=_t.y,S.getCoordinate($t+1,_t),_t.x-=Et,Wt+=nt.x*(V.y-_t.y);return Wt/2}},W.distanceLineLine=function(n,i,s,l){if(n.equals(i))return W.distancePointLine(n,s,l);if(s.equals(l))return W.distancePointLine(l,n,i);var h=!1;if(Vt.intersects(n,i,s,l)){var v=(i.x-n.x)*(l.y-s.y)-(i.y-n.y)*(l.x-s.x);if(v===0)h=!0;else{var S=(n.y-s.y)*(l.x-s.x)-(n.x-s.x)*(l.y-s.y),R=((n.y-s.y)*(i.x-n.x)-(n.x-s.x)*(i.y-n.y))/v,V=S/v;(V<0||V>1||R<0||R>1)&&(h=!0)}}else h=!0;return h?pt.min(W.distancePointLine(n,s,l),W.distancePointLine(i,s,l),W.distancePointLine(s,n,i),W.distancePointLine(l,n,i)):0},W.isPointInRing=function(n,i){return W.locatePointInRing(n,i)!==$.EXTERIOR},W.computeLength=function(n){var i=n.size();if(i<=1)return 0;var s=0,l=new U;n.getCoordinate(0,l);for(var h=l.x,v=l.y,S=1;S<i;S++){n.getCoordinate(S,l);var R=l.x,V=l.y,nt=R-h,_t=V-v;s+=Math.sqrt(nt*nt+_t*_t),h=R,v=V}return s},W.isCCW=function(n){var i=n.length-1;if(i<3)throw new L("Ring has fewer than 4 points, so orientation cannot be determined");for(var s=n[0],l=0,h=1;h<=i;h++){var v=n[h];v.y>s.y&&(s=v,l=h)}var S=l;do(S-=1)<0&&(S=i);while(n[S].equals2D(s)&&S!==l);var R=l;do R=(R+1)%i;while(n[R].equals2D(s)&&R!==l);var V=n[S],nt=n[R];if(V.equals2D(s)||nt.equals2D(s)||V.equals2D(nt))return!1;var _t=W.computeOrientation(V,s,nt),Et=!1;return Et=_t===0?V.x>nt.x:_t>0,Et},W.locatePointInRing=function(n,i){return N.locatePointInRing(n,i)},W.distancePointLinePerpendicular=function(n,i,s){var l=(s.x-i.x)*(s.x-i.x)+(s.y-i.y)*(s.y-i.y),h=((i.y-n.y)*(s.x-i.x)-(i.x-n.x)*(s.y-i.y))/l;return Math.abs(h)*Math.sqrt(l)},W.computeOrientation=function(n,i,s){return W.orientationIndex(n,i,s)},W.distancePointLine=function(){if(arguments.length===2){var n=arguments[0],i=arguments[1];if(i.length===0)throw new L("Line array must contain at least one vertex");for(var s=n.distance(i[0]),l=0;l<i.length-1;l++){var h=W.distancePointLine(n,i[l],i[l+1]);h<s&&(s=h)}return s}if(arguments.length===3){var v=arguments[0],S=arguments[1],R=arguments[2];if(S.x===R.x&&S.y===R.y)return v.distance(S);var V=(R.x-S.x)*(R.x-S.x)+(R.y-S.y)*(R.y-S.y),nt=((v.x-S.x)*(R.x-S.x)+(v.y-S.y)*(R.y-S.y))/V;if(nt<=0)return v.distance(S);if(nt>=1)return v.distance(R);var _t=((S.y-v.y)*(R.x-S.x)-(S.x-v.x)*(R.y-S.y))/V;return Math.abs(_t)*Math.sqrt(V)}},W.isOnLine=function(n,i){for(var s=new rt,l=1;l<i.length;l++){var h=i[l-1],v=i[l];if(s.computeIntersection(n,h,v),s.hasIntersection())return!0}return!1},xt.CLOCKWISE.get=function(){return-1},xt.RIGHT.get=function(){return W.CLOCKWISE},xt.COUNTERCLOCKWISE.get=function(){return 1},xt.LEFT.get=function(){return W.COUNTERCLOCKWISE},xt.COLLINEAR.get=function(){return 0},xt.STRAIGHT.get=function(){return W.COLLINEAR},Object.defineProperties(W,xt);var wt=function(){};wt.prototype.filter=function(n){},wt.prototype.interfaces_=function(){return[]},wt.prototype.getClass=function(){return wt};var lt=function(){var n=arguments[0];this._envelope=null,this._factory=null,this._SRID=null,this._userData=null,this._factory=n,this._SRID=n.getSRID()},Bt={serialVersionUID:{configurable:!0},SORTINDEX_POINT:{configurable:!0},SORTINDEX_MULTIPOINT:{configurable:!0},SORTINDEX_LINESTRING:{configurable:!0},SORTINDEX_LINEARRING:{configurable:!0},SORTINDEX_MULTILINESTRING:{configurable:!0},SORTINDEX_POLYGON:{configurable:!0},SORTINDEX_MULTIPOLYGON:{configurable:!0},SORTINDEX_GEOMETRYCOLLECTION:{configurable:!0},geometryChangedFilter:{configurable:!0}};lt.prototype.isGeometryCollection=function(){return this.getSortIndex()===lt.SORTINDEX_GEOMETRYCOLLECTION},lt.prototype.getFactory=function(){return this._factory},lt.prototype.getGeometryN=function(n){return this},lt.prototype.getArea=function(){return 0},lt.prototype.isRectangle=function(){return!1},lt.prototype.equals=function(){if(arguments[0]instanceof lt){var n=arguments[0];return n!==null&&this.equalsTopo(n)}if(arguments[0]instanceof Object){var i=arguments[0];if(!(i instanceof lt))return!1;var s=i;return this.equalsExact(s)}},lt.prototype.equalsExact=function(n){return this===n||this.equalsExact(n,0)},lt.prototype.geometryChanged=function(){this.apply(lt.geometryChangedFilter)},lt.prototype.geometryChangedAction=function(){this._envelope=null},lt.prototype.equalsNorm=function(n){return n!==null&&this.norm().equalsExact(n.norm())},lt.prototype.getLength=function(){return 0},lt.prototype.getNumGeometries=function(){return 1},lt.prototype.compareTo=function(){if(arguments.length===1){var n=arguments[0],i=n;return this.getSortIndex()!==i.getSortIndex()?this.getSortIndex()-i.getSortIndex():this.isEmpty()&&i.isEmpty()?0:this.isEmpty()?-1:i.isEmpty()?1:this.compareToSameClass(n)}if(arguments.length===2){var s=arguments[0],l=arguments[1];return this.getSortIndex()!==s.getSortIndex()?this.getSortIndex()-s.getSortIndex():this.isEmpty()&&s.isEmpty()?0:this.isEmpty()?-1:s.isEmpty()?1:this.compareToSameClass(s,l)}},lt.prototype.getUserData=function(){return this._userData},lt.prototype.getSRID=function(){return this._SRID},lt.prototype.getEnvelope=function(){return this.getFactory().toGeometry(this.getEnvelopeInternal())},lt.prototype.checkNotGeometryCollection=function(n){if(n.getSortIndex()===lt.SORTINDEX_GEOMETRYCOLLECTION)throw new L("This method does not support GeometryCollection arguments")},lt.prototype.equal=function(n,i,s){return s===0?n.equals(i):n.distance(i)<=s},lt.prototype.norm=function(){var n=this.copy();return n.normalize(),n},lt.prototype.getPrecisionModel=function(){return this._factory.getPrecisionModel()},lt.prototype.getEnvelopeInternal=function(){return this._envelope===null&&(this._envelope=this.computeEnvelopeInternal()),new Vt(this._envelope)},lt.prototype.setSRID=function(n){this._SRID=n},lt.prototype.setUserData=function(n){this._userData=n},lt.prototype.compare=function(n,i){for(var s=n.iterator(),l=i.iterator();s.hasNext()&&l.hasNext();){var h=s.next(),v=l.next(),S=h.compareTo(v);if(S!==0)return S}return s.hasNext()?1:l.hasNext()?-1:0},lt.prototype.hashCode=function(){return this.getEnvelopeInternal().hashCode()},lt.prototype.isGeometryCollectionOrDerived=function(){return this.getSortIndex()===lt.SORTINDEX_GEOMETRYCOLLECTION||this.getSortIndex()===lt.SORTINDEX_MULTIPOINT||this.getSortIndex()===lt.SORTINDEX_MULTILINESTRING||this.getSortIndex()===lt.SORTINDEX_MULTIPOLYGON},lt.prototype.interfaces_=function(){return[Y,G,t]},lt.prototype.getClass=function(){return lt},lt.hasNonEmptyElements=function(n){for(var i=0;i<n.length;i++)if(!n[i].isEmpty())return!0;return!1},lt.hasNullElements=function(n){for(var i=0;i<n.length;i++)if(n[i]===null)return!0;return!1},Bt.serialVersionUID.get=function(){return 8763622679187377e3},Bt.SORTINDEX_POINT.get=function(){return 0},Bt.SORTINDEX_MULTIPOINT.get=function(){return 1},Bt.SORTINDEX_LINESTRING.get=function(){return 2},Bt.SORTINDEX_LINEARRING.get=function(){return 3},Bt.SORTINDEX_MULTILINESTRING.get=function(){return 4},Bt.SORTINDEX_POLYGON.get=function(){return 5},Bt.SORTINDEX_MULTIPOLYGON.get=function(){return 6},Bt.SORTINDEX_GEOMETRYCOLLECTION.get=function(){return 7},Bt.geometryChangedFilter.get=function(){return Lt},Object.defineProperties(lt,Bt);var Lt=function(){};Lt.interfaces_=function(){return[wt]},Lt.filter=function(n){n.geometryChangedAction()};var Ut=function(){};Ut.prototype.filter=function(n){},Ut.prototype.interfaces_=function(){return[]},Ut.prototype.getClass=function(){return Ut};var Xt=function(){},de={Mod2BoundaryNodeRule:{configurable:!0},EndPointBoundaryNodeRule:{configurable:!0},MultiValentEndPointBoundaryNodeRule:{configurable:!0},MonoValentEndPointBoundaryNodeRule:{configurable:!0},MOD2_BOUNDARY_RULE:{configurable:!0},ENDPOINT_BOUNDARY_RULE:{configurable:!0},MULTIVALENT_ENDPOINT_BOUNDARY_RULE:{configurable:!0},MONOVALENT_ENDPOINT_BOUNDARY_RULE:{configurable:!0},OGC_SFS_BOUNDARY_RULE:{configurable:!0}};Xt.prototype.isInBoundary=function(n){},Xt.prototype.interfaces_=function(){return[]},Xt.prototype.getClass=function(){return Xt},de.Mod2BoundaryNodeRule.get=function(){return Ft},de.EndPointBoundaryNodeRule.get=function(){return Se},de.MultiValentEndPointBoundaryNodeRule.get=function(){return xe},de.MonoValentEndPointBoundaryNodeRule.get=function(){return he},de.MOD2_BOUNDARY_RULE.get=function(){return new Ft},de.ENDPOINT_BOUNDARY_RULE.get=function(){return new Se},de.MULTIVALENT_ENDPOINT_BOUNDARY_RULE.get=function(){return new xe},de.MONOVALENT_ENDPOINT_BOUNDARY_RULE.get=function(){return new he},de.OGC_SFS_BOUNDARY_RULE.get=function(){return Xt.MOD2_BOUNDARY_RULE},Object.defineProperties(Xt,de);var Ft=function(){};Ft.prototype.isInBoundary=function(n){return n%2==1},Ft.prototype.interfaces_=function(){return[Xt]},Ft.prototype.getClass=function(){return Ft};var Se=function(){};Se.prototype.isInBoundary=function(n){return n>0},Se.prototype.interfaces_=function(){return[Xt]},Se.prototype.getClass=function(){return Se};var xe=function(){};xe.prototype.isInBoundary=function(n){return n>1},xe.prototype.interfaces_=function(){return[Xt]},xe.prototype.getClass=function(){return xe};var he=function(){};he.prototype.isInBoundary=function(n){return n===1},he.prototype.interfaces_=function(){return[Xt]},he.prototype.getClass=function(){return he};var Jt=function(){};Jt.prototype.add=function(){},Jt.prototype.addAll=function(){},Jt.prototype.isEmpty=function(){},Jt.prototype.iterator=function(){},Jt.prototype.size=function(){},Jt.prototype.toArray=function(){},Jt.prototype.remove=function(){},(e.prototype=new Error).name="IndexOutOfBoundsException";var et=function(){};et.prototype.hasNext=function(){},et.prototype.next=function(){},et.prototype.remove=function(){};var kt=function(n){function i(){n.apply(this,arguments)}return n&&(i.__proto__=n),i.prototype=Object.create(n&&n.prototype),i.prototype.constructor=i,i.prototype.get=function(){},i.prototype.set=function(){},i.prototype.isEmpty=function(){},i}(Jt);(o.prototype=new Error).name="NoSuchElementException";var ct=function(n){function i(){n.call(this),this.array_=[],arguments[0]instanceof Jt&&this.addAll(arguments[0])}return n&&(i.__proto__=n),i.prototype=Object.create(n&&n.prototype),i.prototype.constructor=i,i.prototype.ensureCapacity=function(){},i.prototype.interfaces_=function(){return[n,Jt]},i.prototype.add=function(s){return arguments.length===1?this.array_.push(s):this.array_.splice(arguments[0],arguments[1]),!0},i.prototype.clear=function(){this.array_=[]},i.prototype.addAll=function(s){for(var l=s.iterator();l.hasNext();)this.add(l.next());return!0},i.prototype.set=function(s,l){var h=this.array_[s];return this.array_[s]=l,h},i.prototype.iterator=function(){return new jt(this)},i.prototype.get=function(s){if(s<0||s>=this.size())throw new e;return this.array_[s]},i.prototype.isEmpty=function(){return this.array_.length===0},i.prototype.size=function(){return this.array_.length},i.prototype.toArray=function(){for(var s=[],l=0,h=this.array_.length;l<h;l++)s.push(this.array_[l]);return s},i.prototype.remove=function(s){for(var l=!1,h=0,v=this.array_.length;h<v;h++)if(this.array_[h]===s){this.array_.splice(h,1),l=!0;break}return l},i}(kt),jt=function(n){function i(s){n.call(this),this.arrayList_=s,this.position_=0}return n&&(i.__proto__=n),i.prototype=Object.create(n&&n.prototype),i.prototype.constructor=i,i.prototype.next=function(){if(this.position_===this.arrayList_.size())throw new o;return this.arrayList_.get(this.position_++)},i.prototype.hasNext=function(){return this.position_<this.arrayList_.size()},i.prototype.set=function(s){return this.arrayList_.set(this.position_-1,s)},i.prototype.remove=function(){this.arrayList_.remove(this.arrayList_.get(this.position_))},i}(et),Kt=function(n){function i(){if(n.call(this),arguments.length!==0){if(arguments.length===1){var l=arguments[0];this.ensureCapacity(l.length),this.add(l,!0)}else if(arguments.length===2){var h=arguments[0],v=arguments[1];this.ensureCapacity(h.length),this.add(h,v)}}}n&&(i.__proto__=n),(i.prototype=Object.create(n&&n.prototype)).constructor=i;var s={coordArrayType:{configurable:!0}};return s.coordArrayType.get=function(){return new Array(0).fill(null)},i.prototype.getCoordinate=function(l){return this.get(l)},i.prototype.addAll=function(){if(arguments.length===2){for(var l=arguments[0],h=arguments[1],v=!1,S=l.iterator();S.hasNext();)this.add(S.next(),h),v=!0;return v}return n.prototype.addAll.apply(this,arguments)},i.prototype.clone=function(){for(var l=n.prototype.clone.call(this),h=0;h<this.size();h++)l.add(h,this.get(h).copy());return l},i.prototype.toCoordinateArray=function(){return this.toArray(i.coordArrayType)},i.prototype.add=function(){if(arguments.length===1){var l=arguments[0];n.prototype.add.call(this,l)}else if(arguments.length===2){if(arguments[0]instanceof Array&&typeof arguments[1]=="boolean"){var h=arguments[0],v=arguments[1];return this.add(h,v,!0),!0}if(arguments[0]instanceof U&&typeof arguments[1]=="boolean"){var S=arguments[0];if(!arguments[1]&&this.size()>=1&&this.get(this.size()-1).equals2D(S))return null;n.prototype.add.call(this,S)}else if(arguments[0]instanceof Object&&typeof arguments[1]=="boolean"){var R=arguments[0],V=arguments[1];return this.add(R,V),!0}}else if(arguments.length===3){if(typeof arguments[2]=="boolean"&&arguments[0]instanceof Array&&typeof arguments[1]=="boolean"){var nt=arguments[0],_t=arguments[1];if(arguments[2])for(var Et=0;Et<nt.length;Et++)this.add(nt[Et],_t);else for(var Wt=nt.length-1;Wt>=0;Wt--)this.add(nt[Wt],_t);return!0}if(typeof arguments[2]=="boolean"&&Number.isInteger(arguments[0])&&arguments[1]instanceof U){var $t=arguments[0],ie=arguments[1];if(!arguments[2]){var Ee=this.size();if(Ee>0&&($t>0&&this.get($t-1).equals2D(ie)||$t<Ee&&this.get($t).equals2D(ie)))return null}n.prototype.add.call(this,$t,ie)}}else if(arguments.length===4){var An=arguments[0],Wn=arguments[1],Qr=arguments[2],jo=arguments[3],Os=1;Qr>jo&&(Os=-1);for(var Oc=Qr;Oc!==jo;Oc+=Os)this.add(An[Oc],Wn);return!0}},i.prototype.closeRing=function(){this.size()>0&&this.add(new U(this.get(0)),!1)},i.prototype.interfaces_=function(){return[]},i.prototype.getClass=function(){return i},Object.defineProperties(i,s),i}(ct),Mt=function(){},me={ForwardComparator:{configurable:!0},BidirectionalComparator:{configurable:!0},coordArrayType:{configurable:!0}};me.ForwardComparator.get=function(){return be},me.BidirectionalComparator.get=function(){return Jn},me.coordArrayType.get=function(){return new Array(0).fill(null)},Mt.prototype.interfaces_=function(){return[]},Mt.prototype.getClass=function(){return Mt},Mt.isRing=function(n){return!(n.length<4)&&!!n[0].equals2D(n[n.length-1])},Mt.ptNotInList=function(n,i){for(var s=0;s<n.length;s++){var l=n[s];if(Mt.indexOf(l,i)<0)return l}return null},Mt.scroll=function(n,i){var s=Mt.indexOf(i,n);if(s<0)return null;var l=new Array(n.length).fill(null);Zt.arraycopy(n,s,l,0,n.length-s),Zt.arraycopy(n,0,l,n.length-s,s),Zt.arraycopy(l,0,n,0,n.length)},Mt.equals=function(){if(arguments.length===2){var n=arguments[0],i=arguments[1];if(n===i)return!0;if(n===null||i===null||n.length!==i.length)return!1;for(var s=0;s<n.length;s++)if(!n[s].equals(i[s]))return!1;return!0}if(arguments.length===3){var l=arguments[0],h=arguments[1],v=arguments[2];if(l===h)return!0;if(l===null||h===null||l.length!==h.length)return!1;for(var S=0;S<l.length;S++)if(v.compare(l[S],h[S])!==0)return!1;return!0}},Mt.intersection=function(n,i){for(var s=new Kt,l=0;l<n.length;l++)i.intersects(n[l])&&s.add(n[l],!0);return s.toCoordinateArray()},Mt.hasRepeatedPoints=function(n){for(var i=1;i<n.length;i++)if(n[i-1].equals(n[i]))return!0;return!1},Mt.removeRepeatedPoints=function(n){return Mt.hasRepeatedPoints(n)?new Kt(n,!1).toCoordinateArray():n},Mt.reverse=function(n){for(var i=n.length-1,s=Math.trunc(i/2),l=0;l<=s;l++){var h=n[l];n[l]=n[i-l],n[i-l]=h}},Mt.removeNull=function(n){for(var i=0,s=0;s<n.length;s++)n[s]!==null&&i++;var l=new Array(i).fill(null);if(i===0)return l;for(var h=0,v=0;v<n.length;v++)n[v]!==null&&(l[h++]=n[v]);return l},Mt.copyDeep=function(){if(arguments.length===1){for(var n=arguments[0],i=new Array(n.length).fill(null),s=0;s<n.length;s++)i[s]=new U(n[s]);return i}if(arguments.length===5)for(var l=arguments[0],h=arguments[1],v=arguments[2],S=arguments[3],R=arguments[4],V=0;V<R;V++)v[S+V]=new U(l[h+V])},Mt.isEqualReversed=function(n,i){for(var s=0;s<n.length;s++){var l=n[s],h=i[n.length-s-1];if(l.compareTo(h)!==0)return!1}return!0},Mt.envelope=function(n){for(var i=new Vt,s=0;s<n.length;s++)i.expandToInclude(n[s]);return i},Mt.toCoordinateArray=function(n){return n.toArray(Mt.coordArrayType)},Mt.atLeastNCoordinatesOrNothing=function(n,i){return i.length>=n?i:[]},Mt.indexOf=function(n,i){for(var s=0;s<i.length;s++)if(n.equals(i[s]))return s;return-1},Mt.increasingDirection=function(n){for(var i=0;i<Math.trunc(n.length/2);i++){var s=n.length-1-i,l=n[i].compareTo(n[s]);if(l!==0)return l}return 1},Mt.compare=function(n,i){for(var s=0;s<n.length&&s<i.length;){var l=n[s].compareTo(i[s]);if(l!==0)return l;s++}return s<i.length?-1:s<n.length?1:0},Mt.minCoordinate=function(n){for(var i=null,s=0;s<n.length;s++)(i===null||i.compareTo(n[s])>0)&&(i=n[s]);return i},Mt.extract=function(n,i,s){i=pt.clamp(i,0,n.length);var l=(s=pt.clamp(s,-1,n.length))-i+1;s<0&&(l=0),i>=n.length&&(l=0),s<i&&(l=0);var h=new Array(l).fill(null);if(l===0)return h;for(var v=0,S=i;S<=s;S++)h[v++]=n[S];return h},Object.defineProperties(Mt,me);var be=function(){};be.prototype.compare=function(n,i){return Mt.compare(n,i)},be.prototype.interfaces_=function(){return[X]},be.prototype.getClass=function(){return be};var Jn=function(){};Jn.prototype.compare=function(n,i){var s=n,l=i;if(s.length<l.length)return-1;if(s.length>l.length)return 1;if(s.length===0)return 0;var h=Mt.compare(s,l);return Mt.isEqualReversed(s,l)?0:h},Jn.prototype.OLDcompare=function(n,i){var s=n,l=i;if(s.length<l.length)return-1;if(s.length>l.length)return 1;if(s.length===0)return 0;for(var h=Mt.increasingDirection(s),v=Mt.increasingDirection(l),S=h>0?0:s.length-1,R=v>0?0:s.length-1,V=0;V<s.length;V++){var nt=s[S].compareTo(l[R]);if(nt!==0)return nt;S+=h,R+=v}return 0},Jn.prototype.interfaces_=function(){return[X]},Jn.prototype.getClass=function(){return Jn};var $e=function(){};$e.prototype.get=function(){},$e.prototype.put=function(){},$e.prototype.size=function(){},$e.prototype.values=function(){},$e.prototype.entrySet=function(){};var Vi=function(n){function i(){n.apply(this,arguments)}return n&&(i.__proto__=n),i.prototype=Object.create(n&&n.prototype),i.prototype.constructor=i,i}($e);(a.prototype=new Error).name="OperationNotSupported",(c.prototype=new Jt).contains=function(){};var zr=function(n){function i(){n.call(this),this.array_=[],arguments[0]instanceof Jt&&this.addAll(arguments[0])}return n&&(i.__proto__=n),i.prototype=Object.create(n&&n.prototype),i.prototype.constructor=i,i.prototype.contains=function(s){for(var l=0,h=this.array_.length;l<h;l++)if(this.array_[l]===s)return!0;return!1},i.prototype.add=function(s){return!this.contains(s)&&(this.array_.push(s),!0)},i.prototype.addAll=function(s){for(var l=s.iterator();l.hasNext();)this.add(l.next());return!0},i.prototype.remove=function(s){throw new Error},i.prototype.size=function(){return this.array_.length},i.prototype.isEmpty=function(){return this.array_.length===0},i.prototype.toArray=function(){for(var s=[],l=0,h=this.array_.length;l<h;l++)s.push(this.array_[l]);return s},i.prototype.iterator=function(){return new Ja(this)},i}(c),Ja=function(n){function i(s){n.call(this),this.hashSet_=s,this.position_=0}return n&&(i.__proto__=n),i.prototype=Object.create(n&&n.prototype),i.prototype.constructor=i,i.prototype.next=function(){if(this.position_===this.hashSet_.size())throw new o;return this.hashSet_.array_[this.position_++]},i.prototype.hasNext=function(){return this.position_<this.hashSet_.size()},i.prototype.remove=function(){throw new a},i}(et),eo=0;(w.prototype=new Vi).get=function(n){for(var i=this.root_;i!==null;){var s=n.compareTo(i.key);if(s<0)i=i.left;else{if(!(s>0))return i.value;i=i.right}}return null},w.prototype.put=function(n,i){if(this.root_===null)return this.root_={key:n,value:i,left:null,right:null,parent:null,color:eo,getValue:function(){return this.value},getKey:function(){return this.key}},this.size_=1,null;var s,l,h=this.root_;do if(s=h,(l=n.compareTo(h.key))<0)h=h.left;else{if(!(l>0)){var v=h.value;return h.value=i,v}h=h.right}while(h!==null);var S={key:n,left:null,right:null,value:i,parent:s,color:eo,getValue:function(){return this.value},getKey:function(){return this.key}};return l<0?s.left=S:s.right=S,this.fixAfterInsertion(S),this.size_++,null},w.prototype.fixAfterInsertion=function(n){for(n.color=1;n!=null&&n!==this.root_&&n.parent.color===1;)if(d(n)===y(d(d(n)))){var i=_(d(d(n)));p(i)===1?(g(d(n),eo),g(i,eo),g(d(d(n)),1),n=d(d(n))):(n===_(d(n))&&(n=d(n),this.rotateLeft(n)),g(d(n),eo),g(d(d(n)),1),this.rotateRight(d(d(n))))}else{var s=y(d(d(n)));p(s)===1?(g(d(n),eo),g(s,eo),g(d(d(n)),1),n=d(d(n))):(n===y(d(n))&&(n=d(n),this.rotateRight(n)),g(d(n),eo),g(d(d(n)),1),this.rotateLeft(d(d(n))))}this.root_.color=eo},w.prototype.values=function(){var n=new ct,i=this.getFirstEntry();if(i!==null)for(n.add(i.value);(i=w.successor(i))!==null;)n.add(i.value);return n},w.prototype.entrySet=function(){var n=new zr,i=this.getFirstEntry();if(i!==null)for(n.add(i);(i=w.successor(i))!==null;)n.add(i);return n},w.prototype.rotateLeft=function(n){if(n!=null){var i=n.right;n.right=i.left,i.left!=null&&(i.left.parent=n),i.parent=n.parent,n.parent===null?this.root_=i:n.parent.left===n?n.parent.left=i:n.parent.right=i,i.left=n,n.parent=i}},w.prototype.rotateRight=function(n){if(n!=null){var i=n.left;n.left=i.right,i.right!=null&&(i.right.parent=n),i.parent=n.parent,n.parent===null?this.root_=i:n.parent.right===n?n.parent.right=i:n.parent.left=i,i.right=n,n.parent=i}},w.prototype.getFirstEntry=function(){var n=this.root_;if(n!=null)for(;n.left!=null;)n=n.left;return n},w.successor=function(n){if(n===null)return null;if(n.right!==null){for(var i=n.right;i.left!==null;)i=i.left;return i}for(var s=n.parent,l=n;s!==null&&l===s.right;)l=s,s=s.parent;return s},w.prototype.size=function(){return this.size_};var ya=function(){};ya.prototype.interfaces_=function(){return[]},ya.prototype.getClass=function(){return ya},x.prototype=new c,(T.prototype=new x).contains=function(n){for(var i=0,s=this.array_.length;i<s;i++)if(this.array_[i].compareTo(n)===0)return!0;return!1},T.prototype.add=function(n){if(this.contains(n))return!1;for(var i=0,s=this.array_.length;i<s;i++)if(this.array_[i].compareTo(n)===1)return this.array_.splice(i,0,n),!0;return this.array_.push(n),!0},T.prototype.addAll=function(n){for(var i=n.iterator();i.hasNext();)this.add(i.next());return!0},T.prototype.remove=function(n){throw new a},T.prototype.size=function(){return this.array_.length},T.prototype.isEmpty=function(){return this.array_.length===0},T.prototype.toArray=function(){for(var n=[],i=0,s=this.array_.length;i<s;i++)n.push(this.array_[i]);return n},T.prototype.iterator=function(){return new As(this)};var As=function(n){this.treeSet_=n,this.position_=0};As.prototype.next=function(){if(this.position_===this.treeSet_.size())throw new o;return this.treeSet_.array_[this.position_++]},As.prototype.hasNext=function(){return this.position_<this.treeSet_.size()},As.prototype.remove=function(){throw new a};var Ho=function(){};Ho.sort=function(){var n,i,s,l,h=arguments[0];if(arguments.length===1)l=function(S,R){return S.compareTo(R)},h.sort(l);else if(arguments.length===2)s=arguments[1],l=function(S,R){return s.compare(S,R)},h.sort(l);else if(arguments.length===3){(i=h.slice(arguments[1],arguments[2])).sort();var v=h.slice(0,arguments[1]).concat(i,h.slice(arguments[2],h.length));for(h.splice(0,h.length),n=0;n<v.length;n++)h.push(v[n])}else if(arguments.length===4)for(i=h.slice(arguments[1],arguments[2]),s=arguments[3],l=function(S,R){return s.compare(S,R)},i.sort(l),v=h.slice(0,arguments[1]).concat(i,h.slice(arguments[2],h.length)),h.splice(0,h.length),n=0;n<v.length;n++)h.push(v[n])},Ho.asList=function(n){for(var i=new ct,s=0,l=n.length;s<l;s++)i.add(n[s]);return i};var Be=function(){},fi={P:{configurable:!0},L:{configurable:!0},A:{configurable:!0},FALSE:{configurable:!0},TRUE:{configurable:!0},DONTCARE:{configurable:!0},SYM_FALSE:{configurable:!0},SYM_TRUE:{configurable:!0},SYM_DONTCARE:{configurable:!0},SYM_P:{configurable:!0},SYM_L:{configurable:!0},SYM_A:{configurable:!0}};fi.P.get=function(){return 0},fi.L.get=function(){return 1},fi.A.get=function(){return 2},fi.FALSE.get=function(){return-1},fi.TRUE.get=function(){return-2},fi.DONTCARE.get=function(){return-3},fi.SYM_FALSE.get=function(){return"F"},fi.SYM_TRUE.get=function(){return"T"},fi.SYM_DONTCARE.get=function(){return"*"},fi.SYM_P.get=function(){return"0"},fi.SYM_L.get=function(){return"1"},fi.SYM_A.get=function(){return"2"},Be.prototype.interfaces_=function(){return[]},Be.prototype.getClass=function(){return Be},Be.toDimensionSymbol=function(n){switch(n){case Be.FALSE:return Be.SYM_FALSE;case Be.TRUE:return Be.SYM_TRUE;case Be.DONTCARE:return Be.SYM_DONTCARE;case Be.P:return Be.SYM_P;case Be.L:return Be.SYM_L;case Be.A:return Be.SYM_A}throw new L("Unknown dimension value: "+n)},Be.toDimensionValue=function(n){switch(dt.toUpperCase(n)){case Be.SYM_FALSE:return Be.FALSE;case Be.SYM_TRUE:return Be.TRUE;case Be.SYM_DONTCARE:return Be.DONTCARE;case Be.SYM_P:return Be.P;case Be.SYM_L:return Be.L;case Be.SYM_A:return Be.A}throw new L("Unknown dimension symbol: "+n)},Object.defineProperties(Be,fi);var Wi=function(){};Wi.prototype.filter=function(n){},Wi.prototype.interfaces_=function(){return[]},Wi.prototype.getClass=function(){return Wi};var Ci=function(){};Ci.prototype.filter=function(n,i){},Ci.prototype.isDone=function(){},Ci.prototype.isGeometryChanged=function(){},Ci.prototype.interfaces_=function(){return[]},Ci.prototype.getClass=function(){return Ci};var Sr=function(n){function i(l,h){if(n.call(this,h),this._geometries=l||[],n.hasNullElements(this._geometries))throw new L("geometries must not contain null elements")}n&&(i.__proto__=n),(i.prototype=Object.create(n&&n.prototype)).constructor=i;var s={serialVersionUID:{configurable:!0}};return i.prototype.computeEnvelopeInternal=function(){for(var l=new Vt,h=0;h<this._geometries.length;h++)l.expandToInclude(this._geometries[h].getEnvelopeInternal());return l},i.prototype.getGeometryN=function(l){return this._geometries[l]},i.prototype.getSortIndex=function(){return n.SORTINDEX_GEOMETRYCOLLECTION},i.prototype.getCoordinates=function(){for(var l=new Array(this.getNumPoints()).fill(null),h=-1,v=0;v<this._geometries.length;v++)for(var S=this._geometries[v].getCoordinates(),R=0;R<S.length;R++)l[++h]=S[R];return l},i.prototype.getArea=function(){for(var l=0,h=0;h<this._geometries.length;h++)l+=this._geometries[h].getArea();return l},i.prototype.equalsExact=function(){if(arguments.length===2){var l=arguments[0],h=arguments[1];if(!this.isEquivalentClass(l))return!1;var v=l;if(this._geometries.length!==v._geometries.length)return!1;for(var S=0;S<this._geometries.length;S++)if(!this._geometries[S].equalsExact(v._geometries[S],h))return!1;return!0}return n.prototype.equalsExact.apply(this,arguments)},i.prototype.normalize=function(){for(var l=0;l<this._geometries.length;l++)this._geometries[l].normalize();Ho.sort(this._geometries)},i.prototype.getCoordinate=function(){return this.isEmpty()?null:this._geometries[0].getCoordinate()},i.prototype.getBoundaryDimension=function(){for(var l=Be.FALSE,h=0;h<this._geometries.length;h++)l=Math.max(l,this._geometries[h].getBoundaryDimension());return l},i.prototype.getDimension=function(){for(var l=Be.FALSE,h=0;h<this._geometries.length;h++)l=Math.max(l,this._geometries[h].getDimension());return l},i.prototype.getLength=function(){for(var l=0,h=0;h<this._geometries.length;h++)l+=this._geometries[h].getLength();return l},i.prototype.getNumPoints=function(){for(var l=0,h=0;h<this._geometries.length;h++)l+=this._geometries[h].getNumPoints();return l},i.prototype.getNumGeometries=function(){return this._geometries.length},i.prototype.reverse=function(){for(var l=this._geometries.length,h=new Array(l).fill(null),v=0;v<this._geometries.length;v++)h[v]=this._geometries[v].reverse();return this.getFactory().createGeometryCollection(h)},i.prototype.compareToSameClass=function(){if(arguments.length===1){var l=arguments[0],h=new T(Ho.asList(this._geometries)),v=new T(Ho.asList(l._geometries));return this.compare(h,v)}if(arguments.length===2){for(var S=arguments[0],R=arguments[1],V=S,nt=this.getNumGeometries(),_t=V.getNumGeometries(),Et=0;Et<nt&&Et<_t;){var Wt=this.getGeometryN(Et),$t=V.getGeometryN(Et),ie=Wt.compareToSameClass($t,R);if(ie!==0)return ie;Et++}return Et<nt?1:Et<_t?-1:0}},i.prototype.apply=function(){if(j(arguments[0],Ut))for(var l=arguments[0],h=0;h<this._geometries.length;h++)this._geometries[h].apply(l);else if(j(arguments[0],Ci)){var v=arguments[0];if(this._geometries.length===0)return null;for(var S=0;S<this._geometries.length&&(this._geometries[S].apply(v),!v.isDone());S++);v.isGeometryChanged()&&this.geometryChanged()}else if(j(arguments[0],Wi)){var R=arguments[0];R.filter(this);for(var V=0;V<this._geometries.length;V++)this._geometries[V].apply(R)}else if(j(arguments[0],wt)){var nt=arguments[0];nt.filter(this);for(var _t=0;_t<this._geometries.length;_t++)this._geometries[_t].apply(nt)}},i.prototype.getBoundary=function(){return this.checkNotGeometryCollection(this),P.shouldNeverReachHere(),null},i.prototype.clone=function(){var l=n.prototype.clone.call(this);l._geometries=new Array(this._geometries.length).fill(null);for(var h=0;h<this._geometries.length;h++)l._geometries[h]=this._geometries[h].clone();return l},i.prototype.getGeometryType=function(){return"GeometryCollection"},i.prototype.copy=function(){for(var l=new Array(this._geometries.length).fill(null),h=0;h<l.length;h++)l[h]=this._geometries[h].copy();return new i(l,this._factory)},i.prototype.isEmpty=function(){for(var l=0;l<this._geometries.length;l++)if(!this._geometries[l].isEmpty())return!1;return!0},i.prototype.interfaces_=function(){return[]},i.prototype.getClass=function(){return i},s.serialVersionUID.get=function(){return-5694727726395021e3},Object.defineProperties(i,s),i}(lt),K=function(n){function i(){n.apply(this,arguments)}n&&(i.__proto__=n),(i.prototype=Object.create(n&&n.prototype)).constructor=i;var s={serialVersionUID:{configurable:!0}};return i.prototype.getSortIndex=function(){return lt.SORTINDEX_MULTILINESTRING},i.prototype.equalsExact=function(){if(arguments.length===2){var l=arguments[0],h=arguments[1];return!!this.isEquivalentClass(l)&&n.prototype.equalsExact.call(this,l,h)}return n.prototype.equalsExact.apply(this,arguments)},i.prototype.getBoundaryDimension=function(){return this.isClosed()?Be.FALSE:0},i.prototype.isClosed=function(){if(this.isEmpty())return!1;for(var l=0;l<this._geometries.length;l++)if(!this._geometries[l].isClosed())return!1;return!0},i.prototype.getDimension=function(){return 1},i.prototype.reverse=function(){for(var l=this._geometries.length,h=new Array(l).fill(null),v=0;v<this._geometries.length;v++)h[l-1-v]=this._geometries[v].reverse();return this.getFactory().createMultiLineString(h)},i.prototype.getBoundary=function(){return new mt(this).getBoundary()},i.prototype.getGeometryType=function(){return"MultiLineString"},i.prototype.copy=function(){for(var l=new Array(this._geometries.length).fill(null),h=0;h<l.length;h++)l[h]=this._geometries[h].copy();return new i(l,this._factory)},i.prototype.interfaces_=function(){return[ya]},i.prototype.getClass=function(){return i},s.serialVersionUID.get=function(){return 8166665132445434e3},Object.defineProperties(i,s),i}(Sr),mt=function(){if(this._geom=null,this._geomFact=null,this._bnRule=null,this._endpointMap=null,arguments.length===1){var n=arguments[0],i=Xt.MOD2_BOUNDARY_RULE;this._geom=n,this._geomFact=n.getFactory(),this._bnRule=i}else if(arguments.length===2){var s=arguments[0],l=arguments[1];this._geom=s,this._geomFact=s.getFactory(),this._bnRule=l}};mt.prototype.boundaryMultiLineString=function(n){if(this._geom.isEmpty())return this.getEmptyMultiPoint();var i=this.computeBoundaryCoordinates(n);return i.length===1?this._geomFact.createPoint(i[0]):this._geomFact.createMultiPointFromCoords(i)},mt.prototype.getBoundary=function(){return this._geom instanceof Qt?this.boundaryLineString(this._geom):this._geom instanceof K?this.boundaryMultiLineString(this._geom):this._geom.getBoundary()},mt.prototype.boundaryLineString=function(n){return this._geom.isEmpty()?this.getEmptyMultiPoint():n.isClosed()?this._bnRule.isInBoundary(2)?n.getStartPoint():this._geomFact.createMultiPoint():this._geomFact.createMultiPoint([n.getStartPoint(),n.getEndPoint()])},mt.prototype.getEmptyMultiPoint=function(){return this._geomFact.createMultiPoint()},mt.prototype.computeBoundaryCoordinates=function(n){var i=new ct;this._endpointMap=new w;for(var s=0;s<n.getNumGeometries();s++){var l=n.getGeometryN(s);l.getNumPoints()!==0&&(this.addEndpoint(l.getCoordinateN(0)),this.addEndpoint(l.getCoordinateN(l.getNumPoints()-1)))}for(var h=this._endpointMap.entrySet().iterator();h.hasNext();){var v=h.next(),S=v.getValue().count;this._bnRule.isInBoundary(S)&&i.add(v.getKey())}return Mt.toCoordinateArray(i)},mt.prototype.addEndpoint=function(n){var i=this._endpointMap.get(n);i===null&&(i=new Pt,this._endpointMap.put(n,i)),i.count++},mt.prototype.interfaces_=function(){return[]},mt.prototype.getClass=function(){return mt},mt.getBoundary=function(){if(arguments.length===1){var n=arguments[0];return new mt(n).getBoundary()}if(arguments.length===2){var i=arguments[0],s=arguments[1];return new mt(i,s).getBoundary()}};var Pt=function(){this.count=null};Pt.prototype.interfaces_=function(){return[]},Pt.prototype.getClass=function(){return Pt};var yt=function(){},Rt={NEWLINE:{configurable:!0},SIMPLE_ORDINATE_FORMAT:{configurable:!0}};yt.prototype.interfaces_=function(){return[]},yt.prototype.getClass=function(){return yt},yt.chars=function(n,i){for(var s=new Array(i).fill(null),l=0;l<i;l++)s[l]=n;return String(s)},yt.getStackTrace=function(){if(arguments.length===1){var n=arguments[0],i=new function(){},s=new function(){}(i);return n.printStackTrace(s),i.toString()}if(arguments.length===2){for(var l=arguments[0],h=arguments[1],v="",S=new function(){}(new function(){}(yt.getStackTrace(l))),R=0;R<h;R++)try{v+=S.readLine()+yt.NEWLINE}catch(V){if(!(V instanceof C))throw V;P.shouldNeverReachHere()}return v}},yt.split=function(n,i){for(var s=i.length,l=new ct,h=""+n,v=h.indexOf(i);v>=0;){var S=h.substring(0,v);l.add(S),v=(h=h.substring(v+s)).indexOf(i)}h.length>0&&l.add(h);for(var R=new Array(l.size()).fill(null),V=0;V<R.length;V++)R[V]=l.get(V);return R},yt.toString=function(){if(arguments.length===1){var n=arguments[0];return yt.SIMPLE_ORDINATE_FORMAT.format(n)}},yt.spaces=function(n){return yt.chars(" ",n)},Rt.NEWLINE.get=function(){return Zt.getProperty("line.separator")},Rt.SIMPLE_ORDINATE_FORMAT.get=function(){return new function(){}("0.#")},Object.defineProperties(yt,Rt);var Yt=function(){};Yt.prototype.interfaces_=function(){return[]},Yt.prototype.getClass=function(){return Yt},Yt.copyCoord=function(n,i,s,l){for(var h=Math.min(n.getDimension(),s.getDimension()),v=0;v<h;v++)s.setOrdinate(l,v,n.getOrdinate(i,v))},Yt.isRing=function(n){var i=n.size();return i===0||!(i<=3)&&n.getOrdinate(0,bt.X)===n.getOrdinate(i-1,bt.X)&&n.getOrdinate(0,bt.Y)===n.getOrdinate(i-1,bt.Y)},Yt.isEqual=function(n,i){var s=n.size();if(s!==i.size())return!1;for(var l=Math.min(n.getDimension(),i.getDimension()),h=0;h<s;h++)for(var v=0;v<l;v++){var S=n.getOrdinate(h,v),R=i.getOrdinate(h,v);if(n.getOrdinate(h,v)!==i.getOrdinate(h,v)&&(!A.isNaN(S)||!A.isNaN(R)))return!1}return!0},Yt.extend=function(n,i,s){var l=n.create(s,i.getDimension()),h=i.size();if(Yt.copy(i,0,l,0,h),h>0)for(var v=h;v<s;v++)Yt.copy(i,h-1,l,v,1);return l},Yt.reverse=function(n){for(var i=n.size()-1,s=Math.trunc(i/2),l=0;l<=s;l++)Yt.swap(n,l,i-l)},Yt.swap=function(n,i,s){if(i===s)return null;for(var l=0;l<n.getDimension();l++){var h=n.getOrdinate(i,l);n.setOrdinate(i,l,n.getOrdinate(s,l)),n.setOrdinate(s,l,h)}},Yt.copy=function(n,i,s,l,h){for(var v=0;v<h;v++)Yt.copyCoord(n,i+v,s,l+v)},Yt.toString=function(){if(arguments.length===1){var n=arguments[0],i=n.size();if(i===0)return"()";var s=n.getDimension(),l=new Tt;l.append("(");for(var h=0;h<i;h++){h>0&&l.append(" ");for(var v=0;v<s;v++)v>0&&l.append(","),l.append(yt.toString(n.getOrdinate(h,v)))}return l.append(")"),l.toString()}},Yt.ensureValidRing=function(n,i){var s=i.size();return s===0?i:s<=3?Yt.createClosedRing(n,i,4):i.getOrdinate(0,bt.X)===i.getOrdinate(s-1,bt.X)&&i.getOrdinate(0,bt.Y)===i.getOrdinate(s-1,bt.Y)?i:Yt.createClosedRing(n,i,s+1)},Yt.createClosedRing=function(n,i,s){var l=n.create(s,i.getDimension()),h=i.size();Yt.copy(i,0,l,0,h);for(var v=h;v<s;v++)Yt.copy(i,0,l,v,1);return l};var Qt=function(n){function i(l,h){n.call(this,h),this._points=null,this.init(l)}n&&(i.__proto__=n),(i.prototype=Object.create(n&&n.prototype)).constructor=i;var s={serialVersionUID:{configurable:!0}};return i.prototype.computeEnvelopeInternal=function(){return this.isEmpty()?new Vt:this._points.expandEnvelope(new Vt)},i.prototype.isRing=function(){return this.isClosed()&&this.isSimple()},i.prototype.getSortIndex=function(){return n.SORTINDEX_LINESTRING},i.prototype.getCoordinates=function(){return this._points.toCoordinateArray()},i.prototype.equalsExact=function(){if(arguments.length===2){var l=arguments[0],h=arguments[1];if(!this.isEquivalentClass(l))return!1;var v=l;if(this._points.size()!==v._points.size())return!1;for(var S=0;S<this._points.size();S++)if(!this.equal(this._points.getCoordinate(S),v._points.getCoordinate(S),h))return!1;return!0}return n.prototype.equalsExact.apply(this,arguments)},i.prototype.normalize=function(){for(var l=0;l<Math.trunc(this._points.size()/2);l++){var h=this._points.size()-1-l;if(!this._points.getCoordinate(l).equals(this._points.getCoordinate(h)))return this._points.getCoordinate(l).compareTo(this._points.getCoordinate(h))>0&&Yt.reverse(this._points),null}},i.prototype.getCoordinate=function(){return this.isEmpty()?null:this._points.getCoordinate(0)},i.prototype.getBoundaryDimension=function(){return this.isClosed()?Be.FALSE:0},i.prototype.isClosed=function(){return!this.isEmpty()&&this.getCoordinateN(0).equals2D(this.getCoordinateN(this.getNumPoints()-1))},i.prototype.getEndPoint=function(){return this.isEmpty()?null:this.getPointN(this.getNumPoints()-1)},i.prototype.getDimension=function(){return 1},i.prototype.getLength=function(){return W.computeLength(this._points)},i.prototype.getNumPoints=function(){return this._points.size()},i.prototype.reverse=function(){var l=this._points.copy();return Yt.reverse(l),this.getFactory().createLineString(l)},i.prototype.compareToSameClass=function(){if(arguments.length===1){for(var l=arguments[0],h=0,v=0;h<this._points.size()&&v<l._points.size();){var S=this._points.getCoordinate(h).compareTo(l._points.getCoordinate(v));if(S!==0)return S;h++,v++}return h<this._points.size()?1:v<l._points.size()?-1:0}if(arguments.length===2){var R=arguments[0];return arguments[1].compare(this._points,R._points)}},i.prototype.apply=function(){if(j(arguments[0],Ut))for(var l=arguments[0],h=0;h<this._points.size();h++)l.filter(this._points.getCoordinate(h));else if(j(arguments[0],Ci)){var v=arguments[0];if(this._points.size()===0)return null;for(var S=0;S<this._points.size()&&(v.filter(this._points,S),!v.isDone());S++);v.isGeometryChanged()&&this.geometryChanged()}else j(arguments[0],Wi)?arguments[0].filter(this):j(arguments[0],wt)&&arguments[0].filter(this)},i.prototype.getBoundary=function(){return new mt(this).getBoundary()},i.prototype.isEquivalentClass=function(l){return l instanceof i},i.prototype.clone=function(){var l=n.prototype.clone.call(this);return l._points=this._points.clone(),l},i.prototype.getCoordinateN=function(l){return this._points.getCoordinate(l)},i.prototype.getGeometryType=function(){return"LineString"},i.prototype.copy=function(){return new i(this._points.copy(),this._factory)},i.prototype.getCoordinateSequence=function(){return this._points},i.prototype.isEmpty=function(){return this._points.size()===0},i.prototype.init=function(l){if(l===null&&(l=this.getFactory().getCoordinateSequenceFactory().create([])),l.size()===1)throw new L("Invalid number of points in LineString (found "+l.size()+" - must be 0 or >= 2)");this._points=l},i.prototype.isCoordinate=function(l){for(var h=0;h<this._points.size();h++)if(this._points.getCoordinate(h).equals(l))return!0;return!1},i.prototype.getStartPoint=function(){return this.isEmpty()?null:this.getPointN(0)},i.prototype.getPointN=function(l){return this.getFactory().createPoint(this._points.getCoordinate(l))},i.prototype.interfaces_=function(){return[ya]},i.prototype.getClass=function(){return i},s.serialVersionUID.get=function(){return 0x2b2b51ba435c8e00},Object.defineProperties(i,s),i}(lt),Te=function(){};Te.prototype.interfaces_=function(){return[]},Te.prototype.getClass=function(){return Te};var ge=function(n){function i(l,h){n.call(this,h),this._coordinates=l||null,this.init(this._coordinates)}n&&(i.__proto__=n),(i.prototype=Object.create(n&&n.prototype)).constructor=i;var s={serialVersionUID:{configurable:!0}};return i.prototype.computeEnvelopeInternal=function(){if(this.isEmpty())return new Vt;var l=new Vt;return l.expandToInclude(this._coordinates.getX(0),this._coordinates.getY(0)),l},i.prototype.getSortIndex=function(){return n.SORTINDEX_POINT},i.prototype.getCoordinates=function(){return this.isEmpty()?[]:[this.getCoordinate()]},i.prototype.equalsExact=function(){if(arguments.length===2){var l=arguments[0],h=arguments[1];return!!this.isEquivalentClass(l)&&(!(!this.isEmpty()||!l.isEmpty())||this.isEmpty()===l.isEmpty()&&this.equal(l.getCoordinate(),this.getCoordinate(),h))}return n.prototype.equalsExact.apply(this,arguments)},i.prototype.normalize=function(){},i.prototype.getCoordinate=function(){return this._coordinates.size()!==0?this._coordinates.getCoordinate(0):null},i.prototype.getBoundaryDimension=function(){return Be.FALSE},i.prototype.getDimension=function(){return 0},i.prototype.getNumPoints=function(){return this.isEmpty()?0:1},i.prototype.reverse=function(){return this.copy()},i.prototype.getX=function(){if(this.getCoordinate()===null)throw new Error("getX called on empty Point");return this.getCoordinate().x},i.prototype.compareToSameClass=function(){if(arguments.length===1){var l=arguments[0];return this.getCoordinate().compareTo(l.getCoordinate())}if(arguments.length===2){var h=arguments[0];return arguments[1].compare(this._coordinates,h._coordinates)}},i.prototype.apply=function(){if(j(arguments[0],Ut)){var l=arguments[0];if(this.isEmpty())return null;l.filter(this.getCoordinate())}else if(j(arguments[0],Ci)){var h=arguments[0];if(this.isEmpty())return null;h.filter(this._coordinates,0),h.isGeometryChanged()&&this.geometryChanged()}else j(arguments[0],Wi)?arguments[0].filter(this):j(arguments[0],wt)&&arguments[0].filter(this)},i.prototype.getBoundary=function(){return this.getFactory().createGeometryCollection(null)},i.prototype.clone=function(){var l=n.prototype.clone.call(this);return l._coordinates=this._coordinates.clone(),l},i.prototype.getGeometryType=function(){return"Point"},i.prototype.copy=function(){return new i(this._coordinates.copy(),this._factory)},i.prototype.getCoordinateSequence=function(){return this._coordinates},i.prototype.getY=function(){if(this.getCoordinate()===null)throw new Error("getY called on empty Point");return this.getCoordinate().y},i.prototype.isEmpty=function(){return this._coordinates.size()===0},i.prototype.init=function(l){l===null&&(l=this.getFactory().getCoordinateSequenceFactory().create([])),P.isTrue(l.size()<=1),this._coordinates=l},i.prototype.isSimple=function(){return!0},i.prototype.interfaces_=function(){return[Te]},i.prototype.getClass=function(){return i},s.serialVersionUID.get=function(){return 4902022702746615e3},Object.defineProperties(i,s),i}(lt),Ne=function(){};Ne.prototype.interfaces_=function(){return[]},Ne.prototype.getClass=function(){return Ne};var ue=function(n){function i(l,h,v){if(n.call(this,v),this._shell=null,this._holes=null,l===null&&(l=this.getFactory().createLinearRing()),h===null&&(h=[]),n.hasNullElements(h))throw new L("holes must not contain null elements");if(l.isEmpty()&&n.hasNonEmptyElements(h))throw new L("shell is empty but holes are not");this._shell=l,this._holes=h}n&&(i.__proto__=n),(i.prototype=Object.create(n&&n.prototype)).constructor=i;var s={serialVersionUID:{configurable:!0}};return i.prototype.computeEnvelopeInternal=function(){return this._shell.getEnvelopeInternal()},i.prototype.getSortIndex=function(){return n.SORTINDEX_POLYGON},i.prototype.getCoordinates=function(){if(this.isEmpty())return[];for(var l=new Array(this.getNumPoints()).fill(null),h=-1,v=this._shell.getCoordinates(),S=0;S<v.length;S++)l[++h]=v[S];for(var R=0;R<this._holes.length;R++)for(var V=this._holes[R].getCoordinates(),nt=0;nt<V.length;nt++)l[++h]=V[nt];return l},i.prototype.getArea=function(){var l=0;l+=Math.abs(W.signedArea(this._shell.getCoordinateSequence()));for(var h=0;h<this._holes.length;h++)l-=Math.abs(W.signedArea(this._holes[h].getCoordinateSequence()));return l},i.prototype.isRectangle=function(){if(this.getNumInteriorRing()!==0||this._shell===null||this._shell.getNumPoints()!==5)return!1;for(var l=this._shell.getCoordinateSequence(),h=this.getEnvelopeInternal(),v=0;v<5;v++){var S=l.getX(v);if(S!==h.getMinX()&&S!==h.getMaxX())return!1;var R=l.getY(v);if(R!==h.getMinY()&&R!==h.getMaxY())return!1}for(var V=l.getX(0),nt=l.getY(0),_t=1;_t<=4;_t++){var Et=l.getX(_t),Wt=l.getY(_t);if(Et!==V==(Wt!==nt))return!1;V=Et,nt=Wt}return!0},i.prototype.equalsExact=function(){if(arguments.length===2){var l=arguments[0],h=arguments[1];if(!this.isEquivalentClass(l))return!1;var v=l,S=this._shell,R=v._shell;if(!S.equalsExact(R,h)||this._holes.length!==v._holes.length)return!1;for(var V=0;V<this._holes.length;V++)if(!this._holes[V].equalsExact(v._holes[V],h))return!1;return!0}return n.prototype.equalsExact.apply(this,arguments)},i.prototype.normalize=function(){if(arguments.length===0){this.normalize(this._shell,!0);for(var l=0;l<this._holes.length;l++)this.normalize(this._holes[l],!1);Ho.sort(this._holes)}else if(arguments.length===2){var h=arguments[0],v=arguments[1];if(h.isEmpty())return null;var S=new Array(h.getCoordinates().length-1).fill(null);Zt.arraycopy(h.getCoordinates(),0,S,0,S.length);var R=Mt.minCoordinate(h.getCoordinates());Mt.scroll(S,R),Zt.arraycopy(S,0,h.getCoordinates(),0,S.length),h.getCoordinates()[S.length]=S[0],W.isCCW(h.getCoordinates())===v&&Mt.reverse(h.getCoordinates())}},i.prototype.getCoordinate=function(){return this._shell.getCoordinate()},i.prototype.getNumInteriorRing=function(){return this._holes.length},i.prototype.getBoundaryDimension=function(){return 1},i.prototype.getDimension=function(){return 2},i.prototype.getLength=function(){var l=0;l+=this._shell.getLength();for(var h=0;h<this._holes.length;h++)l+=this._holes[h].getLength();return l},i.prototype.getNumPoints=function(){for(var l=this._shell.getNumPoints(),h=0;h<this._holes.length;h++)l+=this._holes[h].getNumPoints();return l},i.prototype.reverse=function(){var l=this.copy();l._shell=this._shell.copy().reverse(),l._holes=new Array(this._holes.length).fill(null);for(var h=0;h<this._holes.length;h++)l._holes[h]=this._holes[h].copy().reverse();return l},i.prototype.convexHull=function(){return this.getExteriorRing().convexHull()},i.prototype.compareToSameClass=function(){if(arguments.length===1){var l=arguments[0],h=this._shell,v=l._shell;return h.compareToSameClass(v)}if(arguments.length===2){var S=arguments[0],R=arguments[1],V=S,nt=this._shell,_t=V._shell,Et=nt.compareToSameClass(_t,R);if(Et!==0)return Et;for(var Wt=this.getNumInteriorRing(),$t=V.getNumInteriorRing(),ie=0;ie<Wt&&ie<$t;){var Ee=this.getInteriorRingN(ie),An=V.getInteriorRingN(ie),Wn=Ee.compareToSameClass(An,R);if(Wn!==0)return Wn;ie++}return ie<Wt?1:ie<$t?-1:0}},i.prototype.apply=function(l){if(j(l,Ut)){this._shell.apply(l);for(var h=0;h<this._holes.length;h++)this._holes[h].apply(l)}else if(j(l,Ci)){if(this._shell.apply(l),!l.isDone())for(var v=0;v<this._holes.length&&(this._holes[v].apply(l),!l.isDone());v++);l.isGeometryChanged()&&this.geometryChanged()}else if(j(l,Wi))l.filter(this);else if(j(l,wt)){l.filter(this),this._shell.apply(l);for(var S=0;S<this._holes.length;S++)this._holes[S].apply(l)}},i.prototype.getBoundary=function(){if(this.isEmpty())return this.getFactory().createMultiLineString();var l=new Array(this._holes.length+1).fill(null);l[0]=this._shell;for(var h=0;h<this._holes.length;h++)l[h+1]=this._holes[h];return l.length<=1?this.getFactory().createLinearRing(l[0].getCoordinateSequence()):this.getFactory().createMultiLineString(l)},i.prototype.clone=function(){var l=n.prototype.clone.call(this);l._shell=this._shell.clone(),l._holes=new Array(this._holes.length).fill(null);for(var h=0;h<this._holes.length;h++)l._holes[h]=this._holes[h].clone();return l},i.prototype.getGeometryType=function(){return"Polygon"},i.prototype.copy=function(){for(var l=this._shell.copy(),h=new Array(this._holes.length).fill(null),v=0;v<h.length;v++)h[v]=this._holes[v].copy();return new i(l,h,this._factory)},i.prototype.getExteriorRing=function(){return this._shell},i.prototype.isEmpty=function(){return this._shell.isEmpty()},i.prototype.getInteriorRingN=function(l){return this._holes[l]},i.prototype.interfaces_=function(){return[Ne]},i.prototype.getClass=function(){return i},s.serialVersionUID.get=function(){return-0x307ffefd8dc97200},Object.defineProperties(i,s),i}(lt),Oe=function(n){function i(){n.apply(this,arguments)}n&&(i.__proto__=n),(i.prototype=Object.create(n&&n.prototype)).constructor=i;var s={serialVersionUID:{configurable:!0}};return i.prototype.getSortIndex=function(){return lt.SORTINDEX_MULTIPOINT},i.prototype.isValid=function(){return!0},i.prototype.equalsExact=function(){if(arguments.length===2){var l=arguments[0],h=arguments[1];return!!this.isEquivalentClass(l)&&n.prototype.equalsExact.call(this,l,h)}return n.prototype.equalsExact.apply(this,arguments)},i.prototype.getCoordinate=function(){if(arguments.length===1){var l=arguments[0];return this._geometries[l].getCoordinate()}return n.prototype.getCoordinate.apply(this,arguments)},i.prototype.getBoundaryDimension=function(){return Be.FALSE},i.prototype.getDimension=function(){return 0},i.prototype.getBoundary=function(){return this.getFactory().createGeometryCollection(null)},i.prototype.getGeometryType=function(){return"MultiPoint"},i.prototype.copy=function(){for(var l=new Array(this._geometries.length).fill(null),h=0;h<l.length;h++)l[h]=this._geometries[h].copy();return new i(l,this._factory)},i.prototype.interfaces_=function(){return[Te]},i.prototype.getClass=function(){return i},s.serialVersionUID.get=function(){return-8048474874175356e3},Object.defineProperties(i,s),i}(Sr),bn=function(n){function i(l,h){l instanceof U&&h instanceof Ce&&(l=h.getCoordinateSequenceFactory().create(l)),n.call(this,l,h),this.validateConstruction()}n&&(i.__proto__=n),(i.prototype=Object.create(n&&n.prototype)).constructor=i;var s={MINIMUM_VALID_SIZE:{configurable:!0},serialVersionUID:{configurable:!0}};return i.prototype.getSortIndex=function(){return lt.SORTINDEX_LINEARRING},i.prototype.getBoundaryDimension=function(){return Be.FALSE},i.prototype.isClosed=function(){return!!this.isEmpty()||n.prototype.isClosed.call(this)},i.prototype.reverse=function(){var l=this._points.copy();return Yt.reverse(l),this.getFactory().createLinearRing(l)},i.prototype.validateConstruction=function(){if(!this.isEmpty()&&!n.prototype.isClosed.call(this))throw new L("Points of LinearRing do not form a closed linestring");if(this.getCoordinateSequence().size()>=1&&this.getCoordinateSequence().size()<i.MINIMUM_VALID_SIZE)throw new L("Invalid number of points in LinearRing (found "+this.getCoordinateSequence().size()+" - must be 0 or >= 4)")},i.prototype.getGeometryType=function(){return"LinearRing"},i.prototype.copy=function(){return new i(this._points.copy(),this._factory)},i.prototype.interfaces_=function(){return[]},i.prototype.getClass=function(){return i},s.MINIMUM_VALID_SIZE.get=function(){return 4},s.serialVersionUID.get=function(){return-0x3b229e262367a600},Object.defineProperties(i,s),i}(Qt),Un=function(n){function i(){n.apply(this,arguments)}n&&(i.__proto__=n),(i.prototype=Object.create(n&&n.prototype)).constructor=i;var s={serialVersionUID:{configurable:!0}};return i.prototype.getSortIndex=function(){return lt.SORTINDEX_MULTIPOLYGON},i.prototype.equalsExact=function(){if(arguments.length===2){var l=arguments[0],h=arguments[1];return!!this.isEquivalentClass(l)&&n.prototype.equalsExact.call(this,l,h)}return n.prototype.equalsExact.apply(this,arguments)},i.prototype.getBoundaryDimension=function(){return 1},i.prototype.getDimension=function(){return 2},i.prototype.reverse=function(){for(var l=this._geometries.length,h=new Array(l).fill(null),v=0;v<this._geometries.length;v++)h[v]=this._geometries[v].reverse();return this.getFactory().createMultiPolygon(h)},i.prototype.getBoundary=function(){if(this.isEmpty())return this.getFactory().createMultiLineString();for(var l=new ct,h=0;h<this._geometries.length;h++)for(var v=this._geometries[h].getBoundary(),S=0;S<v.getNumGeometries();S++)l.add(v.getGeometryN(S));var R=new Array(l.size()).fill(null);return this.getFactory().createMultiLineString(l.toArray(R))},i.prototype.getGeometryType=function(){return"MultiPolygon"},i.prototype.copy=function(){for(var l=new Array(this._geometries.length).fill(null),h=0;h<l.length;h++)l[h]=this._geometries[h].copy();return new i(l,this._factory)},i.prototype.interfaces_=function(){return[Ne]},i.prototype.getClass=function(){return i},s.serialVersionUID.get=function(){return-0x7a5aa1369171980},Object.defineProperties(i,s),i}(Sr),Kn=function(n){this._factory=n||null,this._isUserDataCopied=!1},qi={NoOpGeometryOperation:{configurable:!0},CoordinateOperation:{configurable:!0},CoordinateSequenceOperation:{configurable:!0}};Kn.prototype.setCopyUserData=function(n){this._isUserDataCopied=n},Kn.prototype.edit=function(n,i){if(n===null)return null;var s=this.editInternal(n,i);return this._isUserDataCopied&&s.setUserData(n.getUserData()),s},Kn.prototype.editInternal=function(n,i){return this._factory===null&&(this._factory=n.getFactory()),n instanceof Sr?this.editGeometryCollection(n,i):n instanceof ue?this.editPolygon(n,i):n instanceof ge?i.edit(n,this._factory):n instanceof Qt?i.edit(n,this._factory):(P.shouldNeverReachHere("Unsupported Geometry class: "+n.getClass().getName()),null)},Kn.prototype.editGeometryCollection=function(n,i){for(var s=i.edit(n,this._factory),l=new ct,h=0;h<s.getNumGeometries();h++){var v=this.edit(s.getGeometryN(h),i);v===null||v.isEmpty()||l.add(v)}return s.getClass()===Oe?this._factory.createMultiPoint(l.toArray([])):s.getClass()===K?this._factory.createMultiLineString(l.toArray([])):s.getClass()===Un?this._factory.createMultiPolygon(l.toArray([])):this._factory.createGeometryCollection(l.toArray([]))},Kn.prototype.editPolygon=function(n,i){var s=i.edit(n,this._factory);if(s===null&&(s=this._factory.createPolygon(null)),s.isEmpty())return s;var l=this.edit(s.getExteriorRing(),i);if(l===null||l.isEmpty())return this._factory.createPolygon();for(var h=new ct,v=0;v<s.getNumInteriorRing();v++){var S=this.edit(s.getInteriorRingN(v),i);S===null||S.isEmpty()||h.add(S)}return this._factory.createPolygon(l,h.toArray([]))},Kn.prototype.interfaces_=function(){return[]},Kn.prototype.getClass=function(){return Kn},Kn.GeometryEditorOperation=function(){},qi.NoOpGeometryOperation.get=function(){return ir},qi.CoordinateOperation.get=function(){return ze},qi.CoordinateSequenceOperation.get=function(){return Cs},Object.defineProperties(Kn,qi);var ir=function(){};ir.prototype.edit=function(n,i){return n},ir.prototype.interfaces_=function(){return[Kn.GeometryEditorOperation]},ir.prototype.getClass=function(){return ir};var ze=function(){};ze.prototype.edit=function(n,i){var s=this.editCoordinates(n.getCoordinates(),n);return s===null?n:n instanceof bn?i.createLinearRing(s):n instanceof Qt?i.createLineString(s):n instanceof ge?s.length>0?i.createPoint(s[0]):i.createPoint():n},ze.prototype.interfaces_=function(){return[Kn.GeometryEditorOperation]},ze.prototype.getClass=function(){return ze};var Cs=function(){};Cs.prototype.edit=function(n,i){return n instanceof bn?i.createLinearRing(this.edit(n.getCoordinateSequence(),n)):n instanceof Qt?i.createLineString(this.edit(n.getCoordinateSequence(),n)):n instanceof ge?i.createPoint(this.edit(n.getCoordinateSequence(),n)):n},Cs.prototype.interfaces_=function(){return[Kn.GeometryEditorOperation]},Cs.prototype.getClass=function(){return Cs};var De=function(){if(this._dimension=3,this._coordinates=null,arguments.length===1){if(arguments[0]instanceof Array)this._coordinates=arguments[0],this._dimension=3;else if(Number.isInteger(arguments[0])){var n=arguments[0];this._coordinates=new Array(n).fill(null);for(var i=0;i<n;i++)this._coordinates[i]=new U}else if(j(arguments[0],bt)){var s=arguments[0];if(s===null)return this._coordinates=new Array(0).fill(null),null;this._dimension=s.getDimension(),this._coordinates=new Array(s.size()).fill(null);for(var l=0;l<this._coordinates.length;l++)this._coordinates[l]=s.getCoordinateCopy(l)}}else if(arguments.length===2){if(arguments[0]instanceof Array&&Number.isInteger(arguments[1])){var h=arguments[0],v=arguments[1];this._coordinates=h,this._dimension=v,h===null&&(this._coordinates=new Array(0).fill(null))}else if(Number.isInteger(arguments[0])&&Number.isInteger(arguments[1])){var S=arguments[0],R=arguments[1];this._coordinates=new Array(S).fill(null),this._dimension=R;for(var V=0;V<S;V++)this._coordinates[V]=new U}}},Vo={serialVersionUID:{configurable:!0}};De.prototype.setOrdinate=function(n,i,s){switch(i){case bt.X:this._coordinates[n].x=s;break;case bt.Y:this._coordinates[n].y=s;break;case bt.Z:this._coordinates[n].z=s;break;default:throw new L("invalid ordinateIndex")}},De.prototype.size=function(){return this._coordinates.length},De.prototype.getOrdinate=function(n,i){switch(i){case bt.X:return this._coordinates[n].x;case bt.Y:return this._coordinates[n].y;case bt.Z:return this._coordinates[n].z}return A.NaN},De.prototype.getCoordinate=function(){if(arguments.length===1){var n=arguments[0];return this._coordinates[n]}if(arguments.length===2){var i=arguments[0],s=arguments[1];s.x=this._coordinates[i].x,s.y=this._coordinates[i].y,s.z=this._coordinates[i].z}},De.prototype.getCoordinateCopy=function(n){return new U(this._coordinates[n])},De.prototype.getDimension=function(){return this._dimension},De.prototype.getX=function(n){return this._coordinates[n].x},De.prototype.clone=function(){for(var n=new Array(this.size()).fill(null),i=0;i<this._coordinates.length;i++)n[i]=this._coordinates[i].clone();return new De(n,this._dimension)},De.prototype.expandEnvelope=function(n){for(var i=0;i<this._coordinates.length;i++)n.expandToInclude(this._coordinates[i]);return n},De.prototype.copy=function(){for(var n=new Array(this.size()).fill(null),i=0;i<this._coordinates.length;i++)n[i]=this._coordinates[i].copy();return new De(n,this._dimension)},De.prototype.toString=function(){if(this._coordinates.length>0){var n=new Tt(17*this._coordinates.length);n.append("("),n.append(this._coordinates[0]);for(var i=1;i<this._coordinates.length;i++)n.append(", "),n.append(this._coordinates[i]);return n.append(")"),n.toString()}return"()"},De.prototype.getY=function(n){return this._coordinates[n].y},De.prototype.toCoordinateArray=function(){return this._coordinates},De.prototype.interfaces_=function(){return[bt,t]},De.prototype.getClass=function(){return De},Vo.serialVersionUID.get=function(){return-0xcb44a778db18e00},Object.defineProperties(De,Vo);var Pi=function(){},Wo={serialVersionUID:{configurable:!0},instanceObject:{configurable:!0}};Pi.prototype.readResolve=function(){return Pi.instance()},Pi.prototype.create=function(){if(arguments.length===1){if(arguments[0]instanceof Array){var n=arguments[0];return new De(n)}if(j(arguments[0],bt)){var i=arguments[0];return new De(i)}}else if(arguments.length===2){var s=arguments[0],l=arguments[1];return l>3&&(l=3),l<2?new De(s):new De(s,l)}},Pi.prototype.interfaces_=function(){return[gt,t]},Pi.prototype.getClass=function(){return Pi},Pi.instance=function(){return Pi.instanceObject},Wo.serialVersionUID.get=function(){return-0x38e49fa6cf6f2e00},Wo.instanceObject.get=function(){return new Pi},Object.defineProperties(Pi,Wo);var Ka=function(n){function i(){n.call(this),this.map_=new Map}return n&&(i.__proto__=n),i.prototype=Object.create(n&&n.prototype),i.prototype.constructor=i,i.prototype.get=function(s){return this.map_.get(s)||null},i.prototype.put=function(s,l){return this.map_.set(s,l),l},i.prototype.values=function(){for(var s=new ct,l=this.map_.values(),h=l.next();!h.done;)s.add(h.value),h=l.next();return s},i.prototype.entrySet=function(){var s=new zr;return this.map_.entries().forEach(function(l){return s.add(l)}),s},i.prototype.size=function(){return this.map_.size()},i}($e),Me=function n(){if(this._modelType=null,this._scale=null,arguments.length===0)this._modelType=n.FLOATING;else if(arguments.length===1){if(arguments[0]instanceof ti){var i=arguments[0];this._modelType=i,i===n.FIXED&&this.setScale(1)}else if(typeof arguments[0]=="number"){var s=arguments[0];this._modelType=n.FIXED,this.setScale(s)}else if(arguments[0]instanceof n){var l=arguments[0];this._modelType=l._modelType,this._scale=l._scale}}},Xi={serialVersionUID:{configurable:!0},maximumPreciseValue:{configurable:!0}};Me.prototype.equals=function(n){if(!(n instanceof Me))return!1;var i=n;return this._modelType===i._modelType&&this._scale===i._scale},Me.prototype.compareTo=function(n){var i=n,s=this.getMaximumSignificantDigits(),l=i.getMaximumSignificantDigits();return new ft(s).compareTo(new ft(l))},Me.prototype.getScale=function(){return this._scale},Me.prototype.isFloating=function(){return this._modelType===Me.FLOATING||this._modelType===Me.FLOATING_SINGLE},Me.prototype.getType=function(){return this._modelType},Me.prototype.toString=function(){var n="UNKNOWN";return this._modelType===Me.FLOATING?n="Floating":this._modelType===Me.FLOATING_SINGLE?n="Floating-Single":this._modelType===Me.FIXED&&(n="Fixed (Scale="+this.getScale()+")"),n},Me.prototype.makePrecise=function(){if(typeof arguments[0]=="number"){var n=arguments[0];return A.isNaN(n)||this._modelType===Me.FLOATING_SINGLE?n:this._modelType===Me.FIXED?Math.round(n*this._scale)/this._scale:n}if(arguments[0]instanceof U){var i=arguments[0];if(this._modelType===Me.FLOATING)return null;i.x=this.makePrecise(i.x),i.y=this.makePrecise(i.y)}},Me.prototype.getMaximumSignificantDigits=function(){var n=16;return this._modelType===Me.FLOATING?n=16:this._modelType===Me.FLOATING_SINGLE?n=6:this._modelType===Me.FIXED&&(n=1+Math.trunc(Math.ceil(Math.log(this.getScale())/Math.log(10)))),n},Me.prototype.setScale=function(n){this._scale=Math.abs(n)},Me.prototype.interfaces_=function(){return[t,G]},Me.prototype.getClass=function(){return Me},Me.mostPrecise=function(n,i){return n.compareTo(i)>=0?n:i},Xi.serialVersionUID.get=function(){return 7777263578777804e3},Xi.maximumPreciseValue.get=function(){return 9007199254740992},Object.defineProperties(Me,Xi);var ti=function n(i){this._name=i||null,n.nameToTypeMap.put(i,this)},ei={serialVersionUID:{configurable:!0},nameToTypeMap:{configurable:!0}};ti.prototype.readResolve=function(){return ti.nameToTypeMap.get(this._name)},ti.prototype.toString=function(){return this._name},ti.prototype.interfaces_=function(){return[t]},ti.prototype.getClass=function(){return ti},ei.serialVersionUID.get=function(){return-552860263173159e4},ei.nameToTypeMap.get=function(){return new Ka},Object.defineProperties(ti,ei),Me.Type=ti,Me.FIXED=new ti("FIXED"),Me.FLOATING=new ti("FLOATING"),Me.FLOATING_SINGLE=new ti("FLOATING SINGLE");var Ce=function n(){this._precisionModel=new Me,this._SRID=0,this._coordinateSequenceFactory=n.getDefaultCoordinateSequenceFactory(),arguments.length===0||(arguments.length===1?j(arguments[0],gt)?this._coordinateSequenceFactory=arguments[0]:arguments[0]instanceof Me&&(this._precisionModel=arguments[0]):arguments.length===2?(this._precisionModel=arguments[0],this._SRID=arguments[1]):arguments.length===3&&(this._precisionModel=arguments[0],this._SRID=arguments[1],this._coordinateSequenceFactory=arguments[2]))},Ou={serialVersionUID:{configurable:!0}};Ce.prototype.toGeometry=function(n){return n.isNull()?this.createPoint(null):n.getMinX()===n.getMaxX()&&n.getMinY()===n.getMaxY()?this.createPoint(new U(n.getMinX(),n.getMinY())):n.getMinX()===n.getMaxX()||n.getMinY()===n.getMaxY()?this.createLineString([new U(n.getMinX(),n.getMinY()),new U(n.getMaxX(),n.getMaxY())]):this.createPolygon(this.createLinearRing([new U(n.getMinX(),n.getMinY()),new U(n.getMinX(),n.getMaxY()),new U(n.getMaxX(),n.getMaxY()),new U(n.getMaxX(),n.getMinY()),new U(n.getMinX(),n.getMinY())]),null)},Ce.prototype.createLineString=function(n){return n?n instanceof Array?new Qt(this.getCoordinateSequenceFactory().create(n),this):j(n,bt)?new Qt(n,this):void 0:new Qt(this.getCoordinateSequenceFactory().create([]),this)},Ce.prototype.createMultiLineString=function(){if(arguments.length===0)return new K(null,this);if(arguments.length===1){var n=arguments[0];return new K(n,this)}},Ce.prototype.buildGeometry=function(n){for(var i=null,s=!1,l=!1,h=n.iterator();h.hasNext();){var v=h.next(),S=v.getClass();i===null&&(i=S),S!==i&&(s=!0),v.isGeometryCollectionOrDerived()&&(l=!0)}if(i===null)return this.createGeometryCollection();if(s||l)return this.createGeometryCollection(Ce.toGeometryArray(n));var R=n.iterator().next();if(n.size()>1){if(R instanceof ue)return this.createMultiPolygon(Ce.toPolygonArray(n));if(R instanceof Qt)return this.createMultiLineString(Ce.toLineStringArray(n));if(R instanceof ge)return this.createMultiPoint(Ce.toPointArray(n));P.shouldNeverReachHere("Unhandled class: "+R.getClass().getName())}return R},Ce.prototype.createMultiPointFromCoords=function(n){return this.createMultiPoint(n!==null?this.getCoordinateSequenceFactory().create(n):null)},Ce.prototype.createPoint=function(){if(arguments.length===0)return this.createPoint(this.getCoordinateSequenceFactory().create([]));if(arguments.length===1){if(arguments[0]instanceof U){var n=arguments[0];return this.createPoint(n!==null?this.getCoordinateSequenceFactory().create([n]):null)}if(j(arguments[0],bt)){var i=arguments[0];return new ge(i,this)}}},Ce.prototype.getCoordinateSequenceFactory=function(){return this._coordinateSequenceFactory},Ce.prototype.createPolygon=function(){if(arguments.length===0)return new ue(null,null,this);if(arguments.length===1){if(j(arguments[0],bt)){var n=arguments[0];return this.createPolygon(this.createLinearRing(n))}if(arguments[0]instanceof Array){var i=arguments[0];return this.createPolygon(this.createLinearRing(i))}if(arguments[0]instanceof bn){var s=arguments[0];return this.createPolygon(s,null)}}else if(arguments.length===2){var l=arguments[0],h=arguments[1];return new ue(l,h,this)}},Ce.prototype.getSRID=function(){return this._SRID},Ce.prototype.createGeometryCollection=function(){if(arguments.length===0)return new Sr(null,this);if(arguments.length===1){var n=arguments[0];return new Sr(n,this)}},Ce.prototype.createGeometry=function(n){return new Kn(this).edit(n,{edit:function(){if(arguments.length===2){var i=arguments[0];return this._coordinateSequenceFactory.create(i)}}})},Ce.prototype.getPrecisionModel=function(){return this._precisionModel},Ce.prototype.createLinearRing=function(){if(arguments.length===0)return this.createLinearRing(this.getCoordinateSequenceFactory().create([]));if(arguments.length===1){if(arguments[0]instanceof Array){var n=arguments[0];return this.createLinearRing(n!==null?this.getCoordinateSequenceFactory().create(n):null)}if(j(arguments[0],bt)){var i=arguments[0];return new bn(i,this)}}},Ce.prototype.createMultiPolygon=function(){if(arguments.length===0)return new Un(null,this);if(arguments.length===1){var n=arguments[0];return new Un(n,this)}},Ce.prototype.createMultiPoint=function(){if(arguments.length===0)return new Oe(null,this);if(arguments.length===1){if(arguments[0]instanceof Array){var n=arguments[0];return new Oe(n,this)}if(arguments[0]instanceof Array){var i=arguments[0];return this.createMultiPoint(i!==null?this.getCoordinateSequenceFactory().create(i):null)}if(j(arguments[0],bt)){var s=arguments[0];if(s===null)return this.createMultiPoint(new Array(0).fill(null));for(var l=new Array(s.size()).fill(null),h=0;h<s.size();h++){var v=this.getCoordinateSequenceFactory().create(1,s.getDimension());Yt.copy(s,h,v,0,1),l[h]=this.createPoint(v)}return this.createMultiPoint(l)}}},Ce.prototype.interfaces_=function(){return[t]},Ce.prototype.getClass=function(){return Ce},Ce.toMultiPolygonArray=function(n){var i=new Array(n.size()).fill(null);return n.toArray(i)},Ce.toGeometryArray=function(n){if(n===null)return null;var i=new Array(n.size()).fill(null);return n.toArray(i)},Ce.getDefaultCoordinateSequenceFactory=function(){return Pi.instance()},Ce.toMultiLineStringArray=function(n){var i=new Array(n.size()).fill(null);return n.toArray(i)},Ce.toLineStringArray=function(n){var i=new Array(n.size()).fill(null);return n.toArray(i)},Ce.toMultiPointArray=function(n){var i=new Array(n.size()).fill(null);return n.toArray(i)},Ce.toLinearRingArray=function(n){var i=new Array(n.size()).fill(null);return n.toArray(i)},Ce.toPointArray=function(n){var i=new Array(n.size()).fill(null);return n.toArray(i)},Ce.toPolygonArray=function(n){var i=new Array(n.size()).fill(null);return n.toArray(i)},Ce.createPointFromInternalCoord=function(n,i){return i.getPrecisionModel().makePrecise(n),i.getFactory().createPoint(n)},Ou.serialVersionUID.get=function(){return-6820524753094096e3},Object.defineProperties(Ce,Ou);var Qa=["Point","MultiPoint","LineString","MultiLineString","Polygon","MultiPolygon"],gl=function(n){this.geometryFactory=n||new Ce};gl.prototype.read=function(n){var i,s=(i=typeof n=="string"?JSON.parse(n):n).type;if(!no[s])throw new Error("Unknown GeoJSON type: "+i.type);return Qa.indexOf(s)!==-1?no[s].apply(this,[i.coordinates]):s==="GeometryCollection"?no[s].apply(this,[i.geometries]):no[s].apply(this,[i])},gl.prototype.write=function(n){var i=n.getGeometryType();if(!_o[i])throw new Error("Geometry is not supported");return _o[i].apply(this,[n])};var no={Feature:function(n){var i={};for(var s in n)i[s]=n[s];if(n.geometry){var l=n.geometry.type;if(!no[l])throw new Error("Unknown GeoJSON type: "+n.type);i.geometry=this.read(n.geometry)}return n.bbox&&(i.bbox=no.bbox.apply(this,[n.bbox])),i},FeatureCollection:function(n){var i={};if(n.features){i.features=[];for(var s=0;s<n.features.length;++s)i.features.push(this.read(n.features[s]))}return n.bbox&&(i.bbox=this.parse.bbox.apply(this,[n.bbox])),i},coordinates:function(n){for(var i=[],s=0;s<n.length;++s){var l=n[s];i.push(new U(l[0],l[1]))}return i},bbox:function(n){return this.geometryFactory.createLinearRing([new U(n[0],n[1]),new U(n[2],n[1]),new U(n[2],n[3]),new U(n[0],n[3]),new U(n[0],n[1])])},Point:function(n){var i=new U(n[0],n[1]);return this.geometryFactory.createPoint(i)},MultiPoint:function(n){for(var i=[],s=0;s<n.length;++s)i.push(no.Point.apply(this,[n[s]]));return this.geometryFactory.createMultiPoint(i)},LineString:function(n){var i=no.coordinates.apply(this,[n]);return this.geometryFactory.createLineString(i)},MultiLineString:function(n){for(var i=[],s=0;s<n.length;++s)i.push(no.LineString.apply(this,[n[s]]));return this.geometryFactory.createMultiLineString(i)},Polygon:function(n){for(var i=no.coordinates.apply(this,[n[0]]),s=this.geometryFactory.createLinearRing(i),l=[],h=1;h<n.length;++h){var v=n[h],S=no.coordinates.apply(this,[v]),R=this.geometryFactory.createLinearRing(S);l.push(R)}return this.geometryFactory.createPolygon(s,l)},MultiPolygon:function(n){for(var i=[],s=0;s<n.length;++s){var l=n[s];i.push(no.Polygon.apply(this,[l]))}return this.geometryFactory.createMultiPolygon(i)},GeometryCollection:function(n){for(var i=[],s=0;s<n.length;++s){var l=n[s];i.push(this.read(l))}return this.geometryFactory.createGeometryCollection(i)}},_o={coordinate:function(n){return[n.x,n.y]},Point:function(n){return{type:"Point",coordinates:_o.coordinate.apply(this,[n.getCoordinate()])}},MultiPoint:function(n){for(var i=[],s=0;s<n._geometries.length;++s){var l=n._geometries[s],h=_o.Point.apply(this,[l]);i.push(h.coordinates)}return{type:"MultiPoint",coordinates:i}},LineString:function(n){for(var i=[],s=n.getCoordinates(),l=0;l<s.length;++l){var h=s[l];i.push(_o.coordinate.apply(this,[h]))}return{type:"LineString",coordinates:i}},MultiLineString:function(n){for(var i=[],s=0;s<n._geometries.length;++s){var l=n._geometries[s],h=_o.LineString.apply(this,[l]);i.push(h.coordinates)}return{type:"MultiLineString",coordinates:i}},Polygon:function(n){var i=[],s=_o.LineString.apply(this,[n._shell]);i.push(s.coordinates);for(var l=0;l<n._holes.length;++l){var h=n._holes[l],v=_o.LineString.apply(this,[h]);i.push(v.coordinates)}return{type:"Polygon",coordinates:i}},MultiPolygon:function(n){for(var i=[],s=0;s<n._geometries.length;++s){var l=n._geometries[s],h=_o.Polygon.apply(this,[l]);i.push(h.coordinates)}return{type:"MultiPolygon",coordinates:i}},GeometryCollection:function(n){for(var i=[],s=0;s<n._geometries.length;++s){var l=n._geometries[s],h=l.getGeometryType();i.push(_o[h].apply(this,[l]))}return{type:"GeometryCollection",geometries:i}}},Du=function(n){this.geometryFactory=n||new Ce,this.precisionModel=this.geometryFactory.getPrecisionModel(),this.parser=new gl(this.geometryFactory)};Du.prototype.read=function(n){var i=this.parser.read(n);return this.precisionModel.getType()===Me.FIXED&&this.reducePrecision(i),i},Du.prototype.reducePrecision=function(n){var i,s;if(n.coordinate)this.precisionModel.makePrecise(n.coordinate);else if(n.points)for(i=0,s=n.points.length;i<s;i++)this.precisionModel.makePrecise(n.points[i]);else if(n.geometries)for(i=0,s=n.geometries.length;i<s;i++)this.reducePrecision(n.geometries[i])};var va=function(){this.parser=new gl(this.geometryFactory)};va.prototype.write=function(n){return this.parser.write(n)};var Gt=function(){},Fu={ON:{configurable:!0},LEFT:{configurable:!0},RIGHT:{configurable:!0}};Gt.prototype.interfaces_=function(){return[]},Gt.prototype.getClass=function(){return Gt},Gt.opposite=function(n){return n===Gt.LEFT?Gt.RIGHT:n===Gt.RIGHT?Gt.LEFT:n},Fu.ON.get=function(){return 0},Fu.LEFT.get=function(){return 1},Fu.RIGHT.get=function(){return 2},Object.defineProperties(Gt,Fu),(I.prototype=new Error).name="EmptyStackException",(M.prototype=new kt).add=function(n){return this.array_.push(n),!0},M.prototype.get=function(n){if(n<0||n>=this.size())throw new Error;return this.array_[n]},M.prototype.push=function(n){return this.array_.push(n),n},M.prototype.pop=function(n){if(this.array_.length===0)throw new I;return this.array_.pop()},M.prototype.peek=function(){if(this.array_.length===0)throw new I;return this.array_[this.array_.length-1]},M.prototype.empty=function(){return this.array_.length===0},M.prototype.isEmpty=function(){return this.empty()},M.prototype.search=function(n){return this.array_.indexOf(n)},M.prototype.size=function(){return this.array_.length},M.prototype.toArray=function(){for(var n=[],i=0,s=this.array_.length;i<s;i++)n.push(this.array_[i]);return n};var xo=function(){this._minIndex=-1,this._minCoord=null,this._minDe=null,this._orientedDe=null};xo.prototype.getCoordinate=function(){return this._minCoord},xo.prototype.getRightmostSide=function(n,i){var s=this.getRightmostSideOfSegment(n,i);return s<0&&(s=this.getRightmostSideOfSegment(n,i-1)),s<0&&(this._minCoord=null,this.checkForRightmostCoordinate(n)),s},xo.prototype.findRightmostEdgeAtVertex=function(){var n=this._minDe.getEdge().getCoordinates();P.isTrue(this._minIndex>0&&this._minIndex<n.length,"rightmost point expected to be interior vertex of edge");var i=n[this._minIndex-1],s=n[this._minIndex+1],l=W.computeOrientation(this._minCoord,s,i),h=!1;(i.y<this._minCoord.y&&s.y<this._minCoord.y&&l===W.COUNTERCLOCKWISE||i.y>this._minCoord.y&&s.y>this._minCoord.y&&l===W.CLOCKWISE)&&(h=!0),h&&(this._minIndex=this._minIndex-1)},xo.prototype.getRightmostSideOfSegment=function(n,i){var s=n.getEdge().getCoordinates();if(i<0||i+1>=s.length||s[i].y===s[i+1].y)return-1;var l=Gt.LEFT;return s[i].y<s[i+1].y&&(l=Gt.RIGHT),l},xo.prototype.getEdge=function(){return this._orientedDe},xo.prototype.checkForRightmostCoordinate=function(n){for(var i=n.getEdge().getCoordinates(),s=0;s<i.length-1;s++)(this._minCoord===null||i[s].x>this._minCoord.x)&&(this._minDe=n,this._minIndex=s,this._minCoord=i[s])},xo.prototype.findRightmostEdgeAtNode=function(){var n=this._minDe.getNode().getEdges();this._minDe=n.getRightmostEdge(),this._minDe.isForward()||(this._minDe=this._minDe.getSym(),this._minIndex=this._minDe.getEdge().getCoordinates().length-1)},xo.prototype.findEdge=function(n){for(var i=n.iterator();i.hasNext();){var s=i.next();s.isForward()&&this.checkForRightmostCoordinate(s)}P.isTrue(this._minIndex!==0||this._minCoord.equals(this._minDe.getCoordinate()),"inconsistency in rightmost processing"),this._minIndex===0?this.findRightmostEdgeAtNode():this.findRightmostEdgeAtVertex(),this._orientedDe=this._minDe,this.getRightmostSide(this._minDe,this._minIndex)===Gt.LEFT&&(this._orientedDe=this._minDe.getSym())},xo.prototype.interfaces_=function(){return[]},xo.prototype.getClass=function(){return xo};var qo=function(n){function i(s,l){n.call(this,i.msgWithCoord(s,l)),this.pt=l?new U(l):null,this.name="TopologyException"}return n&&(i.__proto__=n),i.prototype=Object.create(n&&n.prototype),i.prototype.constructor=i,i.prototype.getCoordinate=function(){return this.pt},i.prototype.interfaces_=function(){return[]},i.prototype.getClass=function(){return i},i.msgWithCoord=function(s,l){return l?s:s+" [ "+l+" ]"},i}(it),Uu=function(){this.array_=[]};Uu.prototype.addLast=function(n){this.array_.push(n)},Uu.prototype.removeFirst=function(){return this.array_.shift()},Uu.prototype.isEmpty=function(){return this.array_.length===0};var kr=function(){this._finder=null,this._dirEdgeList=new ct,this._nodes=new ct,this._rightMostCoord=null,this._env=null,this._finder=new xo};kr.prototype.clearVisitedEdges=function(){for(var n=this._dirEdgeList.iterator();n.hasNext();)n.next().setVisited(!1)},kr.prototype.getRightmostCoordinate=function(){return this._rightMostCoord},kr.prototype.computeNodeDepth=function(n){for(var i=null,s=n.getEdges().iterator();s.hasNext();){var l=s.next();if(l.isVisited()||l.getSym().isVisited()){i=l;break}}if(i===null)throw new qo("unable to find edge to compute depths at "+n.getCoordinate());n.getEdges().computeDepths(i);for(var h=n.getEdges().iterator();h.hasNext();){var v=h.next();v.setVisited(!0),this.copySymDepths(v)}},kr.prototype.computeDepth=function(n){this.clearVisitedEdges();var i=this._finder.getEdge();i.setEdgeDepths(Gt.RIGHT,n),this.copySymDepths(i),this.computeDepths(i)},kr.prototype.create=function(n){this.addReachable(n),this._finder.findEdge(this._dirEdgeList),this._rightMostCoord=this._finder.getCoordinate()},kr.prototype.findResultEdges=function(){for(var n=this._dirEdgeList.iterator();n.hasNext();){var i=n.next();i.getDepth(Gt.RIGHT)>=1&&i.getDepth(Gt.LEFT)<=0&&!i.isInteriorAreaEdge()&&i.setInResult(!0)}},kr.prototype.computeDepths=function(n){var i=new zr,s=new Uu,l=n.getNode();for(s.addLast(l),i.add(l),n.setVisited(!0);!s.isEmpty();){var h=s.removeFirst();i.add(h),this.computeNodeDepth(h);for(var v=h.getEdges().iterator();v.hasNext();){var S=v.next().getSym();if(!S.isVisited()){var R=S.getNode();i.contains(R)||(s.addLast(R),i.add(R))}}}},kr.prototype.compareTo=function(n){var i=n;return this._rightMostCoord.x<i._rightMostCoord.x?-1:this._rightMostCoord.x>i._rightMostCoord.x?1:0},kr.prototype.getEnvelope=function(){if(this._env===null){for(var n=new Vt,i=this._dirEdgeList.iterator();i.hasNext();)for(var s=i.next().getEdge().getCoordinates(),l=0;l<s.length-1;l++)n.expandToInclude(s[l]);this._env=n}return this._env},kr.prototype.addReachable=function(n){var i=new M;for(i.add(n);!i.empty();){var s=i.pop();this.add(s,i)}},kr.prototype.copySymDepths=function(n){var i=n.getSym();i.setDepth(Gt.LEFT,n.getDepth(Gt.RIGHT)),i.setDepth(Gt.RIGHT,n.getDepth(Gt.LEFT))},kr.prototype.add=function(n,i){n.setVisited(!0),this._nodes.add(n);for(var s=n.getEdges().iterator();s.hasNext();){var l=s.next();this._dirEdgeList.add(l);var h=l.getSym().getNode();h.isVisited()||i.push(h)}},kr.prototype.getNodes=function(){return this._nodes},kr.prototype.getDirectedEdges=function(){return this._dirEdgeList},kr.prototype.interfaces_=function(){return[G]},kr.prototype.getClass=function(){return kr};var Hn=function n(){if(this.location=null,arguments.length===1){if(arguments[0]instanceof Array){var i=arguments[0];this.init(i.length)}else if(Number.isInteger(arguments[0])){var s=arguments[0];this.init(1),this.location[Gt.ON]=s}else if(arguments[0]instanceof n){var l=arguments[0];if(this.init(l.location.length),l!==null)for(var h=0;h<this.location.length;h++)this.location[h]=l.location[h]}}else if(arguments.length===3){var v=arguments[0],S=arguments[1],R=arguments[2];this.init(3),this.location[Gt.ON]=v,this.location[Gt.LEFT]=S,this.location[Gt.RIGHT]=R}};Hn.prototype.setAllLocations=function(n){for(var i=0;i<this.location.length;i++)this.location[i]=n},Hn.prototype.isNull=function(){for(var n=0;n<this.location.length;n++)if(this.location[n]!==$.NONE)return!1;return!0},Hn.prototype.setAllLocationsIfNull=function(n){for(var i=0;i<this.location.length;i++)this.location[i]===$.NONE&&(this.location[i]=n)},Hn.prototype.isLine=function(){return this.location.length===1},Hn.prototype.merge=function(n){if(n.location.length>this.location.length){var i=new Array(3).fill(null);i[Gt.ON]=this.location[Gt.ON],i[Gt.LEFT]=$.NONE,i[Gt.RIGHT]=$.NONE,this.location=i}for(var s=0;s<this.location.length;s++)this.location[s]===$.NONE&&s<n.location.length&&(this.location[s]=n.location[s])},Hn.prototype.getLocations=function(){return this.location},Hn.prototype.flip=function(){if(this.location.length<=1)return null;var n=this.location[Gt.LEFT];this.location[Gt.LEFT]=this.location[Gt.RIGHT],this.location[Gt.RIGHT]=n},Hn.prototype.toString=function(){var n=new Tt;return this.location.length>1&&n.append($.toLocationSymbol(this.location[Gt.LEFT])),n.append($.toLocationSymbol(this.location[Gt.ON])),this.location.length>1&&n.append($.toLocationSymbol(this.location[Gt.RIGHT])),n.toString()},Hn.prototype.setLocations=function(n,i,s){this.location[Gt.ON]=n,this.location[Gt.LEFT]=i,this.location[Gt.RIGHT]=s},Hn.prototype.get=function(n){return n<this.location.length?this.location[n]:$.NONE},Hn.prototype.isArea=function(){return this.location.length>1},Hn.prototype.isAnyNull=function(){for(var n=0;n<this.location.length;n++)if(this.location[n]===$.NONE)return!0;return!1},Hn.prototype.setLocation=function(){if(arguments.length===1){var n=arguments[0];this.setLocation(Gt.ON,n)}else if(arguments.length===2){var i=arguments[0],s=arguments[1];this.location[i]=s}},Hn.prototype.init=function(n){this.location=new Array(n).fill(null),this.setAllLocations($.NONE)},Hn.prototype.isEqualOnSide=function(n,i){return this.location[i]===n.location[i]},Hn.prototype.allPositionsEqual=function(n){for(var i=0;i<this.location.length;i++)if(this.location[i]!==n)return!1;return!0},Hn.prototype.interfaces_=function(){return[]},Hn.prototype.getClass=function(){return Hn};var Tn=function n(){if(this.elt=new Array(2).fill(null),arguments.length===1){if(Number.isInteger(arguments[0])){var i=arguments[0];this.elt[0]=new Hn(i),this.elt[1]=new Hn(i)}else if(arguments[0]instanceof n){var s=arguments[0];this.elt[0]=new Hn(s.elt[0]),this.elt[1]=new Hn(s.elt[1])}}else if(arguments.length===2){var l=arguments[0],h=arguments[1];this.elt[0]=new Hn($.NONE),this.elt[1]=new Hn($.NONE),this.elt[l].setLocation(h)}else if(arguments.length===3){var v=arguments[0],S=arguments[1],R=arguments[2];this.elt[0]=new Hn(v,S,R),this.elt[1]=new Hn(v,S,R)}else if(arguments.length===4){var V=arguments[0],nt=arguments[1],_t=arguments[2],Et=arguments[3];this.elt[0]=new Hn($.NONE,$.NONE,$.NONE),this.elt[1]=new Hn($.NONE,$.NONE,$.NONE),this.elt[V].setLocations(nt,_t,Et)}};Tn.prototype.getGeometryCount=function(){var n=0;return this.elt[0].isNull()||n++,this.elt[1].isNull()||n++,n},Tn.prototype.setAllLocations=function(n,i){this.elt[n].setAllLocations(i)},Tn.prototype.isNull=function(n){return this.elt[n].isNull()},Tn.prototype.setAllLocationsIfNull=function(){if(arguments.length===1){var n=arguments[0];this.setAllLocationsIfNull(0,n),this.setAllLocationsIfNull(1,n)}else if(arguments.length===2){var i=arguments[0],s=arguments[1];this.elt[i].setAllLocationsIfNull(s)}},Tn.prototype.isLine=function(n){return this.elt[n].isLine()},Tn.prototype.merge=function(n){for(var i=0;i<2;i++)this.elt[i]===null&&n.elt[i]!==null?this.elt[i]=new Hn(n.elt[i]):this.elt[i].merge(n.elt[i])},Tn.prototype.flip=function(){this.elt[0].flip(),this.elt[1].flip()},Tn.prototype.getLocation=function(){if(arguments.length===1){var n=arguments[0];return this.elt[n].get(Gt.ON)}if(arguments.length===2){var i=arguments[0],s=arguments[1];return this.elt[i].get(s)}},Tn.prototype.toString=function(){var n=new Tt;return this.elt[0]!==null&&(n.append("A:"),n.append(this.elt[0].toString())),this.elt[1]!==null&&(n.append(" B:"),n.append(this.elt[1].toString())),n.toString()},Tn.prototype.isArea=function(){if(arguments.length===0)return this.elt[0].isArea()||this.elt[1].isArea();if(arguments.length===1){var n=arguments[0];return this.elt[n].isArea()}},Tn.prototype.isAnyNull=function(n){return this.elt[n].isAnyNull()},Tn.prototype.setLocation=function(){if(arguments.length===2){var n=arguments[0],i=arguments[1];this.elt[n].setLocation(Gt.ON,i)}else if(arguments.length===3){var s=arguments[0],l=arguments[1],h=arguments[2];this.elt[s].setLocation(l,h)}},Tn.prototype.isEqualOnSide=function(n,i){return this.elt[0].isEqualOnSide(n.elt[0],i)&&this.elt[1].isEqualOnSide(n.elt[1],i)},Tn.prototype.allPositionsEqual=function(n,i){return this.elt[n].allPositionsEqual(i)},Tn.prototype.toLine=function(n){this.elt[n].isArea()&&(this.elt[n]=new Hn(this.elt[n].location[0]))},Tn.prototype.interfaces_=function(){return[]},Tn.prototype.getClass=function(){return Tn},Tn.toLineLabel=function(n){for(var i=new Tn($.NONE),s=0;s<2;s++)i.setLocation(s,n.getLocation(s));return i};var pr=function(){this._startDe=null,this._maxNodeDegree=-1,this._edges=new ct,this._pts=new ct,this._label=new Tn($.NONE),this._ring=null,this._isHole=null,this._shell=null,this._holes=new ct,this._geometryFactory=null;var n=arguments[0],i=arguments[1];this._geometryFactory=i,this.computePoints(n),this.computeRing()};pr.prototype.computeRing=function(){if(this._ring!==null)return null;for(var n=new Array(this._pts.size()).fill(null),i=0;i<this._pts.size();i++)n[i]=this._pts.get(i);this._ring=this._geometryFactory.createLinearRing(n),this._isHole=W.isCCW(this._ring.getCoordinates())},pr.prototype.isIsolated=function(){return this._label.getGeometryCount()===1},pr.prototype.computePoints=function(n){this._startDe=n;var i=n,s=!0;do{if(i===null)throw new qo("Found null DirectedEdge");if(i.getEdgeRing()===this)throw new qo("Directed Edge visited twice during ring-building at "+i.getCoordinate());this._edges.add(i);var l=i.getLabel();P.isTrue(l.isArea()),this.mergeLabel(l),this.addPoints(i.getEdge(),i.isForward(),s),s=!1,this.setEdgeRing(i,this),i=this.getNext(i)}while(i!==this._startDe)},pr.prototype.getLinearRing=function(){return this._ring},pr.prototype.getCoordinate=function(n){return this._pts.get(n)},pr.prototype.computeMaxNodeDegree=function(){this._maxNodeDegree=0;var n=this._startDe;do{var i=n.getNode().getEdges().getOutgoingDegree(this);i>this._maxNodeDegree&&(this._maxNodeDegree=i),n=this.getNext(n)}while(n!==this._startDe);this._maxNodeDegree*=2},pr.prototype.addPoints=function(n,i,s){var l=n.getCoordinates();if(i){var h=1;s&&(h=0);for(var v=h;v<l.length;v++)this._pts.add(l[v])}else{var S=l.length-2;s&&(S=l.length-1);for(var R=S;R>=0;R--)this._pts.add(l[R])}},pr.prototype.isHole=function(){return this._isHole},pr.prototype.setInResult=function(){var n=this._startDe;do n.getEdge().setInResult(!0),n=n.getNext();while(n!==this._startDe)},pr.prototype.containsPoint=function(n){var i=this.getLinearRing();if(!i.getEnvelopeInternal().contains(n)||!W.isPointInRing(n,i.getCoordinates()))return!1;for(var s=this._holes.iterator();s.hasNext();)if(s.next().containsPoint(n))return!1;return!0},pr.prototype.addHole=function(n){this._holes.add(n)},pr.prototype.isShell=function(){return this._shell===null},pr.prototype.getLabel=function(){return this._label},pr.prototype.getEdges=function(){return this._edges},pr.prototype.getMaxNodeDegree=function(){return this._maxNodeDegree<0&&this.computeMaxNodeDegree(),this._maxNodeDegree},pr.prototype.getShell=function(){return this._shell},pr.prototype.mergeLabel=function(){if(arguments.length===1){var n=arguments[0];this.mergeLabel(n,0),this.mergeLabel(n,1)}else if(arguments.length===2){var i=arguments[0],s=arguments[1],l=i.getLocation(s,Gt.RIGHT);if(l===$.NONE)return null;if(this._label.getLocation(s)===$.NONE)return this._label.setLocation(s,l),null}},pr.prototype.setShell=function(n){this._shell=n,n!==null&&n.addHole(this)},pr.prototype.toPolygon=function(n){for(var i=new Array(this._holes.size()).fill(null),s=0;s<this._holes.size();s++)i[s]=this._holes.get(s).getLinearRing();return n.createPolygon(this.getLinearRing(),i)},pr.prototype.interfaces_=function(){return[]},pr.prototype.getClass=function(){return pr};var nd=function(n){function i(){var s=arguments[0],l=arguments[1];n.call(this,s,l)}return n&&(i.__proto__=n),i.prototype=Object.create(n&&n.prototype),i.prototype.constructor=i,i.prototype.setEdgeRing=function(s,l){s.setMinEdgeRing(l)},i.prototype.getNext=function(s){return s.getNextMin()},i.prototype.interfaces_=function(){return[]},i.prototype.getClass=function(){return i},i}(pr),Of=function(n){function i(){var s=arguments[0],l=arguments[1];n.call(this,s,l)}return n&&(i.__proto__=n),i.prototype=Object.create(n&&n.prototype),i.prototype.constructor=i,i.prototype.buildMinimalRings=function(){var s=new ct,l=this._startDe;do{if(l.getMinEdgeRing()===null){var h=new nd(l,this._geometryFactory);s.add(h)}l=l.getNext()}while(l!==this._startDe);return s},i.prototype.setEdgeRing=function(s,l){s.setEdgeRing(l)},i.prototype.linkDirectedEdgesForMinimalEdgeRings=function(){var s=this._startDe;do s.getNode().getEdges().linkMinimalDirectedEdges(this),s=s.getNext();while(s!==this._startDe)},i.prototype.getNext=function(s){return s.getNext()},i.prototype.interfaces_=function(){return[]},i.prototype.getClass=function(){return i},i}(pr),Ii=function(){if(this._label=null,this._isInResult=!1,this._isCovered=!1,this._isCoveredSet=!1,this._isVisited=!1,arguments.length!==0){if(arguments.length===1){var n=arguments[0];this._label=n}}};Ii.prototype.setVisited=function(n){this._isVisited=n},Ii.prototype.setInResult=function(n){this._isInResult=n},Ii.prototype.isCovered=function(){return this._isCovered},Ii.prototype.isCoveredSet=function(){return this._isCoveredSet},Ii.prototype.setLabel=function(n){this._label=n},Ii.prototype.getLabel=function(){return this._label},Ii.prototype.setCovered=function(n){this._isCovered=n,this._isCoveredSet=!0},Ii.prototype.updateIM=function(n){P.isTrue(this._label.getGeometryCount()>=2,"found partial label"),this.computeIM(n)},Ii.prototype.isInResult=function(){return this._isInResult},Ii.prototype.isVisited=function(){return this._isVisited},Ii.prototype.interfaces_=function(){return[]},Ii.prototype.getClass=function(){return Ii};var ml=function(n){function i(){n.call(this),this._coord=null,this._edges=null;var s=arguments[0],l=arguments[1];this._coord=s,this._edges=l,this._label=new Tn(0,$.NONE)}return n&&(i.__proto__=n),i.prototype=Object.create(n&&n.prototype),i.prototype.constructor=i,i.prototype.isIncidentEdgeInResult=function(){for(var s=this.getEdges().getEdges().iterator();s.hasNext();)if(s.next().getEdge().isInResult())return!0;return!1},i.prototype.isIsolated=function(){return this._label.getGeometryCount()===1},i.prototype.getCoordinate=function(){return this._coord},i.prototype.print=function(s){s.println("node "+this._coord+" lbl: "+this._label)},i.prototype.computeIM=function(s){},i.prototype.computeMergedLocation=function(s,l){var h=$.NONE;if(h=this._label.getLocation(l),!s.isNull(l)){var v=s.getLocation(l);h!==$.BOUNDARY&&(h=v)}return h},i.prototype.setLabel=function(){if(arguments.length!==2)return n.prototype.setLabel.apply(this,arguments);var s=arguments[0],l=arguments[1];this._label===null?this._label=new Tn(s,l):this._label.setLocation(s,l)},i.prototype.getEdges=function(){return this._edges},i.prototype.mergeLabel=function(){if(arguments[0]instanceof i){var s=arguments[0];this.mergeLabel(s._label)}else if(arguments[0]instanceof Tn)for(var l=arguments[0],h=0;h<2;h++){var v=this.computeMergedLocation(l,h);this._label.getLocation(h)===$.NONE&&this._label.setLocation(h,v)}},i.prototype.add=function(s){this._edges.insert(s),s.setNode(this)},i.prototype.setLabelBoundary=function(s){if(this._label===null)return null;var l=$.NONE;this._label!==null&&(l=this._label.getLocation(s));var h=null;switch(l){case $.BOUNDARY:h=$.INTERIOR;break;case $.INTERIOR:default:h=$.BOUNDARY}this._label.setLocation(s,h)},i.prototype.interfaces_=function(){return[]},i.prototype.getClass=function(){return i},i}(Ii),Eo=function(){this.nodeMap=new w,this.nodeFact=null;var n=arguments[0];this.nodeFact=n};Eo.prototype.find=function(n){return this.nodeMap.get(n)},Eo.prototype.addNode=function(){if(arguments[0]instanceof U){var n=arguments[0],i=this.nodeMap.get(n);return i===null&&(i=this.nodeFact.createNode(n),this.nodeMap.put(n,i)),i}if(arguments[0]instanceof ml){var s=arguments[0],l=this.nodeMap.get(s.getCoordinate());return l===null?(this.nodeMap.put(s.getCoordinate(),s),s):(l.mergeLabel(s),l)}},Eo.prototype.print=function(n){for(var i=this.iterator();i.hasNext();)i.next().print(n)},Eo.prototype.iterator=function(){return this.nodeMap.values().iterator()},Eo.prototype.values=function(){return this.nodeMap.values()},Eo.prototype.getBoundaryNodes=function(n){for(var i=new ct,s=this.iterator();s.hasNext();){var l=s.next();l.getLabel().getLocation(n)===$.BOUNDARY&&i.add(l)}return i},Eo.prototype.add=function(n){var i=n.getCoordinate();this.addNode(i).add(n)},Eo.prototype.interfaces_=function(){return[]},Eo.prototype.getClass=function(){return Eo};var kn=function(){},_a={NE:{configurable:!0},NW:{configurable:!0},SW:{configurable:!0},SE:{configurable:!0}};kn.prototype.interfaces_=function(){return[]},kn.prototype.getClass=function(){return kn},kn.isNorthern=function(n){return n===kn.NE||n===kn.NW},kn.isOpposite=function(n,i){return n===i?!1:(n-i+4)%4===2},kn.commonHalfPlane=function(n,i){if(n===i)return n;if((n-i+4)%4===2)return-1;var s=n<i?n:i;return s===0&&(n>i?n:i)===3?3:s},kn.isInHalfPlane=function(n,i){return i===kn.SE?n===kn.SE||n===kn.SW:n===i||n===i+1},kn.quadrant=function(){if(typeof arguments[0]=="number"&&typeof arguments[1]=="number"){var n=arguments[0],i=arguments[1];if(n===0&&i===0)throw new L("Cannot compute the quadrant for point ( "+n+", "+i+" )");return n>=0?i>=0?kn.NE:kn.SE:i>=0?kn.NW:kn.SW}if(arguments[0]instanceof U&&arguments[1]instanceof U){var s=arguments[0],l=arguments[1];if(l.x===s.x&&l.y===s.y)throw new L("Cannot compute the quadrant for two identical points "+s);return l.x>=s.x?l.y>=s.y?kn.NE:kn.SE:l.y>=s.y?kn.NW:kn.SW}},_a.NE.get=function(){return 0},_a.NW.get=function(){return 1},_a.SW.get=function(){return 2},_a.SE.get=function(){return 3},Object.defineProperties(kn,_a);var Gr=function(){if(this._edge=null,this._label=null,this._node=null,this._p0=null,this._p1=null,this._dx=null,this._dy=null,this._quadrant=null,arguments.length===1){var n=arguments[0];this._edge=n}else if(arguments.length===3){var i=arguments[0],s=arguments[1],l=arguments[2];this._edge=i,this.init(s,l),this._label=null}else if(arguments.length===4){var h=arguments[0],v=arguments[1],S=arguments[2],R=arguments[3];this._edge=h,this.init(v,S),this._label=R}};Gr.prototype.compareDirection=function(n){return this._dx===n._dx&&this._dy===n._dy?0:this._quadrant>n._quadrant?1:this._quadrant<n._quadrant?-1:W.computeOrientation(n._p0,n._p1,this._p1)},Gr.prototype.getDy=function(){return this._dy},Gr.prototype.getCoordinate=function(){return this._p0},Gr.prototype.setNode=function(n){this._node=n},Gr.prototype.print=function(n){var i=Math.atan2(this._dy,this._dx),s=this.getClass().getName(),l=s.lastIndexOf("."),h=s.substring(l+1);n.print(" "+h+": "+this._p0+" - "+this._p1+" "+this._quadrant+":"+i+" "+this._label)},Gr.prototype.compareTo=function(n){var i=n;return this.compareDirection(i)},Gr.prototype.getDirectedCoordinate=function(){return this._p1},Gr.prototype.getDx=function(){return this._dx},Gr.prototype.getLabel=function(){return this._label},Gr.prototype.getEdge=function(){return this._edge},Gr.prototype.getQuadrant=function(){return this._quadrant},Gr.prototype.getNode=function(){return this._node},Gr.prototype.toString=function(){var n=Math.atan2(this._dy,this._dx),i=this.getClass().getName(),s=i.lastIndexOf(".");return" "+i.substring(s+1)+": "+this._p0+" - "+this._p1+" "+this._quadrant+":"+n+" "+this._label},Gr.prototype.computeLabel=function(n){},Gr.prototype.init=function(n,i){this._p0=n,this._p1=i,this._dx=i.x-n.x,this._dy=i.y-n.y,this._quadrant=kn.quadrant(this._dx,this._dy),P.isTrue(!(this._dx===0&&this._dy===0),"EdgeEnd with identical endpoints found")},Gr.prototype.interfaces_=function(){return[G]},Gr.prototype.getClass=function(){return Gr};var Ac=function(n){function i(){var s=arguments[0],l=arguments[1];if(n.call(this,s),this._isForward=null,this._isInResult=!1,this._isVisited=!1,this._sym=null,this._next=null,this._nextMin=null,this._edgeRing=null,this._minEdgeRing=null,this._depth=[0,-999,-999],this._isForward=l,l)this.init(s.getCoordinate(0),s.getCoordinate(1));else{var h=s.getNumPoints()-1;this.init(s.getCoordinate(h),s.getCoordinate(h-1))}this.computeDirectedLabel()}return n&&(i.__proto__=n),i.prototype=Object.create(n&&n.prototype),i.prototype.constructor=i,i.prototype.getNextMin=function(){return this._nextMin},i.prototype.getDepth=function(s){return this._depth[s]},i.prototype.setVisited=function(s){this._isVisited=s},i.prototype.computeDirectedLabel=function(){this._label=new Tn(this._edge.getLabel()),this._isForward||this._label.flip()},i.prototype.getNext=function(){return this._next},i.prototype.setDepth=function(s,l){if(this._depth[s]!==-999&&this._depth[s]!==l)throw new qo("assigned depths do not match",this.getCoordinate());this._depth[s]=l},i.prototype.isInteriorAreaEdge=function(){for(var s=!0,l=0;l<2;l++)this._label.isArea(l)&&this._label.getLocation(l,Gt.LEFT)===$.INTERIOR&&this._label.getLocation(l,Gt.RIGHT)===$.INTERIOR||(s=!1);return s},i.prototype.setNextMin=function(s){this._nextMin=s},i.prototype.print=function(s){n.prototype.print.call(this,s),s.print(" "+this._depth[Gt.LEFT]+"/"+this._depth[Gt.RIGHT]),s.print(" ("+this.getDepthDelta()+")"),this._isInResult&&s.print(" inResult")},i.prototype.setMinEdgeRing=function(s){this._minEdgeRing=s},i.prototype.isLineEdge=function(){var s=this._label.isLine(0)||this._label.isLine(1),l=!this._label.isArea(0)||this._label.allPositionsEqual(0,$.EXTERIOR),h=!this._label.isArea(1)||this._label.allPositionsEqual(1,$.EXTERIOR);return s&&l&&h},i.prototype.setEdgeRing=function(s){this._edgeRing=s},i.prototype.getMinEdgeRing=function(){return this._minEdgeRing},i.prototype.getDepthDelta=function(){var s=this._edge.getDepthDelta();return this._isForward||(s=-s),s},i.prototype.setInResult=function(s){this._isInResult=s},i.prototype.getSym=function(){return this._sym},i.prototype.isForward=function(){return this._isForward},i.prototype.getEdge=function(){return this._edge},i.prototype.printEdge=function(s){this.print(s),s.print(" "),this._isForward?this._edge.print(s):this._edge.printReverse(s)},i.prototype.setSym=function(s){this._sym=s},i.prototype.setVisitedEdge=function(s){this.setVisited(s),this._sym.setVisited(s)},i.prototype.setEdgeDepths=function(s,l){var h=this.getEdge().getDepthDelta();this._isForward||(h=-h);var v=1;s===Gt.LEFT&&(v=-1);var S=Gt.opposite(s),R=l+h*v;this.setDepth(s,l),this.setDepth(S,R)},i.prototype.getEdgeRing=function(){return this._edgeRing},i.prototype.isInResult=function(){return this._isInResult},i.prototype.setNext=function(s){this._next=s},i.prototype.isVisited=function(){return this._isVisited},i.prototype.interfaces_=function(){return[]},i.prototype.getClass=function(){return i},i.depthFactor=function(s,l){return s===$.EXTERIOR&&l===$.INTERIOR?1:s===$.INTERIOR&&l===$.EXTERIOR?-1:0},i}(Gr),ja=function(){};ja.prototype.createNode=function(n){return new ml(n,null)},ja.prototype.interfaces_=function(){return[]},ja.prototype.getClass=function(){return ja};var nr=function(){if(this._edges=new ct,this._nodes=null,this._edgeEndList=new ct,arguments.length===0)this._nodes=new Eo(new ja);else if(arguments.length===1){var n=arguments[0];this._nodes=new Eo(n)}};nr.prototype.printEdges=function(n){n.println("Edges:");for(var i=0;i<this._edges.size();i++){n.println("edge "+i+":");var s=this._edges.get(i);s.print(n),s.eiList.print(n)}},nr.prototype.find=function(n){return this._nodes.find(n)},nr.prototype.addNode=function(){if(arguments[0]instanceof ml){var n=arguments[0];return this._nodes.addNode(n)}if(arguments[0]instanceof U){var i=arguments[0];return this._nodes.addNode(i)}},nr.prototype.getNodeIterator=function(){return this._nodes.iterator()},nr.prototype.linkResultDirectedEdges=function(){for(var n=this._nodes.iterator();n.hasNext();)n.next().getEdges().linkResultDirectedEdges()},nr.prototype.debugPrintln=function(n){Zt.out.println(n)},nr.prototype.isBoundaryNode=function(n,i){var s=this._nodes.find(i);if(s===null)return!1;var l=s.getLabel();return l!==null&&l.getLocation(n)===$.BOUNDARY},nr.prototype.linkAllDirectedEdges=function(){for(var n=this._nodes.iterator();n.hasNext();)n.next().getEdges().linkAllDirectedEdges()},nr.prototype.matchInSameDirection=function(n,i,s,l){return!!n.equals(s)&&W.computeOrientation(n,i,l)===W.COLLINEAR&&kn.quadrant(n,i)===kn.quadrant(s,l)},nr.prototype.getEdgeEnds=function(){return this._edgeEndList},nr.prototype.debugPrint=function(n){Zt.out.print(n)},nr.prototype.getEdgeIterator=function(){return this._edges.iterator()},nr.prototype.findEdgeInSameDirection=function(n,i){for(var s=0;s<this._edges.size();s++){var l=this._edges.get(s),h=l.getCoordinates();if(this.matchInSameDirection(n,i,h[0],h[1])||this.matchInSameDirection(n,i,h[h.length-1],h[h.length-2]))return l}return null},nr.prototype.insertEdge=function(n){this._edges.add(n)},nr.prototype.findEdgeEnd=function(n){for(var i=this.getEdgeEnds().iterator();i.hasNext();){var s=i.next();if(s.getEdge()===n)return s}return null},nr.prototype.addEdges=function(n){for(var i=n.iterator();i.hasNext();){var s=i.next();this._edges.add(s);var l=new Ac(s,!0),h=new Ac(s,!1);l.setSym(h),h.setSym(l),this.add(l),this.add(h)}},nr.prototype.add=function(n){this._nodes.add(n),this._edgeEndList.add(n)},nr.prototype.getNodes=function(){return this._nodes.values()},nr.prototype.findEdge=function(n,i){for(var s=0;s<this._edges.size();s++){var l=this._edges.get(s),h=l.getCoordinates();if(n.equals(h[0])&&i.equals(h[1]))return l}return null},nr.prototype.interfaces_=function(){return[]},nr.prototype.getClass=function(){return nr},nr.linkResultDirectedEdges=function(n){for(var i=n.iterator();i.hasNext();)i.next().getEdges().linkResultDirectedEdges()};var hi=function(){this._geometryFactory=null,this._shellList=new ct;var n=arguments[0];this._geometryFactory=n};hi.prototype.sortShellsAndHoles=function(n,i,s){for(var l=n.iterator();l.hasNext();){var h=l.next();h.isHole()?s.add(h):i.add(h)}},hi.prototype.computePolygons=function(n){for(var i=new ct,s=n.iterator();s.hasNext();){var l=s.next().toPolygon(this._geometryFactory);i.add(l)}return i},hi.prototype.placeFreeHoles=function(n,i){for(var s=i.iterator();s.hasNext();){var l=s.next();if(l.getShell()===null){var h=this.findEdgeRingContaining(l,n);if(h===null)throw new qo("unable to assign hole to a shell",l.getCoordinate(0));l.setShell(h)}}},hi.prototype.buildMinimalEdgeRings=function(n,i,s){for(var l=new ct,h=n.iterator();h.hasNext();){var v=h.next();if(v.getMaxNodeDegree()>2){v.linkDirectedEdgesForMinimalEdgeRings();var S=v.buildMinimalRings(),R=this.findShell(S);R!==null?(this.placePolygonHoles(R,S),i.add(R)):s.addAll(S)}else l.add(v)}return l},hi.prototype.containsPoint=function(n){for(var i=this._shellList.iterator();i.hasNext();)if(i.next().containsPoint(n))return!0;return!1},hi.prototype.buildMaximalEdgeRings=function(n){for(var i=new ct,s=n.iterator();s.hasNext();){var l=s.next();if(l.isInResult()&&l.getLabel().isArea()&&l.getEdgeRing()===null){var h=new Of(l,this._geometryFactory);i.add(h),h.setInResult()}}return i},hi.prototype.placePolygonHoles=function(n,i){for(var s=i.iterator();s.hasNext();){var l=s.next();l.isHole()&&l.setShell(n)}},hi.prototype.getPolygons=function(){return this.computePolygons(this._shellList)},hi.prototype.findEdgeRingContaining=function(n,i){for(var s=n.getLinearRing(),l=s.getEnvelopeInternal(),h=s.getCoordinateN(0),v=null,S=null,R=i.iterator();R.hasNext();){var V=R.next(),nt=V.getLinearRing(),_t=nt.getEnvelopeInternal();v!==null&&(S=v.getLinearRing().getEnvelopeInternal());var Et=!1;_t.contains(l)&&W.isPointInRing(h,nt.getCoordinates())&&(Et=!0),Et&&(v===null||S.contains(_t))&&(v=V)}return v},hi.prototype.findShell=function(n){for(var i=0,s=null,l=n.iterator();l.hasNext();){var h=l.next();h.isHole()||(s=h,i++)}return P.isTrue(i<=1,"found two shells in MinimalEdgeRing list"),s},hi.prototype.add=function(){if(arguments.length===1){var n=arguments[0];this.add(n.getEdgeEnds(),n.getNodes())}else if(arguments.length===2){var i=arguments[0],s=arguments[1];nr.linkResultDirectedEdges(s);var l=this.buildMaximalEdgeRings(i),h=new ct,v=this.buildMinimalEdgeRings(l,this._shellList,h);this.sortShellsAndHoles(v,this._shellList,h),this.placeFreeHoles(this._shellList,h)}},hi.prototype.interfaces_=function(){return[]},hi.prototype.getClass=function(){return hi};var $n=function(){};$n.prototype.getBounds=function(){},$n.prototype.interfaces_=function(){return[]},$n.prototype.getClass=function(){return $n};var qe=function(){this._bounds=null,this._item=null;var n=arguments[0],i=arguments[1];this._bounds=n,this._item=i};qe.prototype.getItem=function(){return this._item},qe.prototype.getBounds=function(){return this._bounds},qe.prototype.interfaces_=function(){return[$n,t]},qe.prototype.getClass=function(){return qe};var us=function(){this._size=null,this._items=null,this._size=0,this._items=new ct,this._items.add(null)};us.prototype.poll=function(){if(this.isEmpty())return null;var n=this._items.get(1);return this._items.set(1,this._items.get(this._size)),this._size-=1,this.reorder(1),n},us.prototype.size=function(){return this._size},us.prototype.reorder=function(n){for(var i=null,s=this._items.get(n);2*n<=this._size&&((i=2*n)!==this._size&&this._items.get(i+1).compareTo(this._items.get(i))<0&&i++,this._items.get(i).compareTo(s)<0);n=i)this._items.set(n,this._items.get(i));this._items.set(n,s)},us.prototype.clear=function(){this._size=0,this._items.clear()},us.prototype.isEmpty=function(){return this._size===0},us.prototype.add=function(n){this._items.add(null),this._size+=1;var i=this._size;for(this._items.set(0,n);n.compareTo(this._items.get(Math.trunc(i/2)))<0;i/=2)this._items.set(i,this._items.get(Math.trunc(i/2)));this._items.set(i,n)},us.prototype.interfaces_=function(){return[]},us.prototype.getClass=function(){return us};var Ps=function(){};Ps.prototype.visitItem=function(n){},Ps.prototype.interfaces_=function(){return[]},Ps.prototype.getClass=function(){return Ps};var xa=function(){};xa.prototype.insert=function(n,i){},xa.prototype.remove=function(n,i){},xa.prototype.query=function(){},xa.prototype.interfaces_=function(){return[]},xa.prototype.getClass=function(){return xa};var yr=function(){if(this._childBoundables=new ct,this._bounds=null,this._level=null,arguments.length!==0){if(arguments.length===1){var n=arguments[0];this._level=n}}},Df={serialVersionUID:{configurable:!0}};yr.prototype.getLevel=function(){return this._level},yr.prototype.size=function(){return this._childBoundables.size()},yr.prototype.getChildBoundables=function(){return this._childBoundables},yr.prototype.addChildBoundable=function(n){P.isTrue(this._bounds===null),this._childBoundables.add(n)},yr.prototype.isEmpty=function(){return this._childBoundables.isEmpty()},yr.prototype.getBounds=function(){return this._bounds===null&&(this._bounds=this.computeBounds()),this._bounds},yr.prototype.interfaces_=function(){return[$n,t]},yr.prototype.getClass=function(){return yr},Df.serialVersionUID.get=function(){return 6493722185909574e3},Object.defineProperties(yr,Df);var ro=function(){};ro.reverseOrder=function(){return{compare:function(n,i){return i.compareTo(n)}}},ro.min=function(n){return ro.sort(n),n.get(0)},ro.sort=function(n,i){var s=n.toArray();i?Ho.sort(s,i):Ho.sort(s);for(var l=n.iterator(),h=0,v=s.length;h<v;h++)l.next(),l.set(s[h])},ro.singletonList=function(n){var i=new ct;return i.add(n),i};var cr=function(){this._boundable1=null,this._boundable2=null,this._distance=null,this._itemDistance=null;var n=arguments[0],i=arguments[1],s=arguments[2];this._boundable1=n,this._boundable2=i,this._itemDistance=s,this._distance=this.distance()};cr.prototype.expandToQueue=function(n,i){var s=cr.isComposite(this._boundable1),l=cr.isComposite(this._boundable2);if(s&&l)return cr.area(this._boundable1)>cr.area(this._boundable2)?(this.expand(this._boundable1,this._boundable2,n,i),null):(this.expand(this._boundable2,this._boundable1,n,i),null);if(s)return this.expand(this._boundable1,this._boundable2,n,i),null;if(l)return this.expand(this._boundable2,this._boundable1,n,i),null;throw new L("neither boundable is composite")},cr.prototype.isLeaves=function(){return!(cr.isComposite(this._boundable1)||cr.isComposite(this._boundable2))},cr.prototype.compareTo=function(n){var i=n;return this._distance<i._distance?-1:this._distance>i._distance?1:0},cr.prototype.expand=function(n,i,s,l){for(var h=n.getChildBoundables().iterator();h.hasNext();){var v=h.next(),S=new cr(v,i,this._itemDistance);S.getDistance()<l&&s.add(S)}},cr.prototype.getBoundable=function(n){return n===0?this._boundable1:this._boundable2},cr.prototype.getDistance=function(){return this._distance},cr.prototype.distance=function(){return this.isLeaves()?this._itemDistance.distance(this._boundable1,this._boundable2):this._boundable1.getBounds().distance(this._boundable2.getBounds())},cr.prototype.interfaces_=function(){return[G]},cr.prototype.getClass=function(){return cr},cr.area=function(n){return n.getBounds().getArea()},cr.isComposite=function(n){return n instanceof yr};var br=function n(){if(this._root=null,this._built=!1,this._itemBoundables=new ct,this._nodeCapacity=null,arguments.length===0){var i=n.DEFAULT_NODE_CAPACITY;this._nodeCapacity=i}else if(arguments.length===1){var s=arguments[0];P.isTrue(s>1,"Node capacity must be greater than 1"),this._nodeCapacity=s}},Tr={IntersectsOp:{configurable:!0},serialVersionUID:{configurable:!0},DEFAULT_NODE_CAPACITY:{configurable:!0}};br.prototype.getNodeCapacity=function(){return this._nodeCapacity},br.prototype.lastNode=function(n){return n.get(n.size()-1)},br.prototype.size=function(){if(arguments.length===0)return this.isEmpty()?0:(this.build(),this.size(this._root));if(arguments.length===1){for(var n=0,i=arguments[0].getChildBoundables().iterator();i.hasNext();){var s=i.next();s instanceof yr?n+=this.size(s):s instanceof qe&&(n+=1)}return n}},br.prototype.removeItem=function(n,i){for(var s=null,l=n.getChildBoundables().iterator();l.hasNext();){var h=l.next();h instanceof qe&&h.getItem()===i&&(s=h)}return s!==null&&(n.getChildBoundables().remove(s),!0)},br.prototype.itemsTree=function(){if(arguments.length===0){this.build();var n=this.itemsTree(this._root);return n===null?new ct:n}if(arguments.length===1){for(var i=arguments[0],s=new ct,l=i.getChildBoundables().iterator();l.hasNext();){var h=l.next();if(h instanceof yr){var v=this.itemsTree(h);v!==null&&s.add(v)}else h instanceof qe?s.add(h.getItem()):P.shouldNeverReachHere()}return s.size()<=0?null:s}},br.prototype.insert=function(n,i){P.isTrue(!this._built,"Cannot insert items into an STR packed R-tree after it has been built."),this._itemBoundables.add(new qe(n,i))},br.prototype.boundablesAtLevel=function(){if(arguments.length===1){var n=arguments[0],i=new ct;return this.boundablesAtLevel(n,this._root,i),i}if(arguments.length===3){var s=arguments[0],l=arguments[1],h=arguments[2];if(P.isTrue(s>-2),l.getLevel()===s)return h.add(l),null;for(var v=l.getChildBoundables().iterator();v.hasNext();){var S=v.next();S instanceof yr?this.boundablesAtLevel(s,S,h):(P.isTrue(S instanceof qe),s===-1&&h.add(S))}return null}},br.prototype.query=function(){if(arguments.length===1){var n=arguments[0];this.build();var i=new ct;return this.isEmpty()||this.getIntersectsOp().intersects(this._root.getBounds(),n)&&this.query(n,this._root,i),i}if(arguments.length===2){var s=arguments[0],l=arguments[1];if(this.build(),this.isEmpty())return null;this.getIntersectsOp().intersects(this._root.getBounds(),s)&&this.query(s,this._root,l)}else if(arguments.length===3){if(j(arguments[2],Ps)&&arguments[0]instanceof Object&&arguments[1]instanceof yr)for(var h=arguments[0],v=arguments[1],S=arguments[2],R=v.getChildBoundables(),V=0;V<R.size();V++){var nt=R.get(V);this.getIntersectsOp().intersects(nt.getBounds(),h)&&(nt instanceof yr?this.query(h,nt,S):nt instanceof qe?S.visitItem(nt.getItem()):P.shouldNeverReachHere())}else if(j(arguments[2],kt)&&arguments[0]instanceof Object&&arguments[1]instanceof yr)for(var _t=arguments[0],Et=arguments[1],Wt=arguments[2],$t=Et.getChildBoundables(),ie=0;ie<$t.size();ie++){var Ee=$t.get(ie);this.getIntersectsOp().intersects(Ee.getBounds(),_t)&&(Ee instanceof yr?this.query(_t,Ee,Wt):Ee instanceof qe?Wt.add(Ee.getItem()):P.shouldNeverReachHere())}}},br.prototype.build=function(){if(this._built)return null;this._root=this._itemBoundables.isEmpty()?this.createNode(0):this.createHigherLevels(this._itemBoundables,-1),this._itemBoundables=null,this._built=!0},br.prototype.getRoot=function(){return this.build(),this._root},br.prototype.remove=function(){if(arguments.length===2){var n=arguments[0],i=arguments[1];return this.build(),!!this.getIntersectsOp().intersects(this._root.getBounds(),n)&&this.remove(n,this._root,i)}if(arguments.length===3){var s=arguments[0],l=arguments[1],h=arguments[2],v=this.removeItem(l,h);if(v)return!0;for(var S=null,R=l.getChildBoundables().iterator();R.hasNext();){var V=R.next();if(this.getIntersectsOp().intersects(V.getBounds(),s)&&V instanceof yr&&(v=this.remove(s,V,h))){S=V;break}}return S!==null&&S.getChildBoundables().isEmpty()&&l.getChildBoundables().remove(S),v}},br.prototype.createHigherLevels=function(n,i){P.isTrue(!n.isEmpty());var s=this.createParentBoundables(n,i+1);return s.size()===1?s.get(0):this.createHigherLevels(s,i+1)},br.prototype.depth=function(){if(arguments.length===0)return this.isEmpty()?0:(this.build(),this.depth(this._root));if(arguments.length===1){for(var n=0,i=arguments[0].getChildBoundables().iterator();i.hasNext();){var s=i.next();if(s instanceof yr){var l=this.depth(s);l>n&&(n=l)}}return n+1}},br.prototype.createParentBoundables=function(n,i){P.isTrue(!n.isEmpty());var s=new ct;s.add(this.createNode(i));var l=new ct(n);ro.sort(l,this.getComparator());for(var h=l.iterator();h.hasNext();){var v=h.next();this.lastNode(s).getChildBoundables().size()===this.getNodeCapacity()&&s.add(this.createNode(i)),this.lastNode(s).addChildBoundable(v)}return s},br.prototype.isEmpty=function(){return this._built?this._root.isEmpty():this._itemBoundables.isEmpty()},br.prototype.interfaces_=function(){return[t]},br.prototype.getClass=function(){return br},br.compareDoubles=function(n,i){return n>i?1:n<i?-1:0},Tr.IntersectsOp.get=function(){return Cc},Tr.serialVersionUID.get=function(){return-3886435814360241e3},Tr.DEFAULT_NODE_CAPACITY.get=function(){return 10},Object.defineProperties(br,Tr);var Cc=function(){},wo=function(){};wo.prototype.distance=function(n,i){},wo.prototype.interfaces_=function(){return[]},wo.prototype.getClass=function(){return wo};var Pc=function(n){function i(l){l=l||i.DEFAULT_NODE_CAPACITY,n.call(this,l)}n&&(i.__proto__=n),(i.prototype=Object.create(n&&n.prototype)).constructor=i;var s={STRtreeNode:{configurable:!0},serialVersionUID:{configurable:!0},xComparator:{configurable:!0},yComparator:{configurable:!0},intersectsOp:{configurable:!0},DEFAULT_NODE_CAPACITY:{configurable:!0}};return i.prototype.createParentBoundablesFromVerticalSlices=function(l,h){P.isTrue(l.length>0);for(var v=new ct,S=0;S<l.length;S++)v.addAll(this.createParentBoundablesFromVerticalSlice(l[S],h));return v},i.prototype.createNode=function(l){return new yl(l)},i.prototype.size=function(){return arguments.length===0?n.prototype.size.call(this):n.prototype.size.apply(this,arguments)},i.prototype.insert=function(){if(arguments.length!==2)return n.prototype.insert.apply(this,arguments);var l=arguments[0],h=arguments[1];if(l.isNull())return null;n.prototype.insert.call(this,l,h)},i.prototype.getIntersectsOp=function(){return i.intersectsOp},i.prototype.verticalSlices=function(l,h){for(var v=Math.trunc(Math.ceil(l.size()/h)),S=new Array(h).fill(null),R=l.iterator(),V=0;V<h;V++){S[V]=new ct;for(var nt=0;R.hasNext()&&nt<v;){var _t=R.next();S[V].add(_t),nt++}}return S},i.prototype.query=function(){if(arguments.length===1){var l=arguments[0];return n.prototype.query.call(this,l)}if(arguments.length===2){var h=arguments[0],v=arguments[1];n.prototype.query.call(this,h,v)}else if(arguments.length===3){if(j(arguments[2],Ps)&&arguments[0]instanceof Object&&arguments[1]instanceof yr){var S=arguments[0],R=arguments[1],V=arguments[2];n.prototype.query.call(this,S,R,V)}else if(j(arguments[2],kt)&&arguments[0]instanceof Object&&arguments[1]instanceof yr){var nt=arguments[0],_t=arguments[1],Et=arguments[2];n.prototype.query.call(this,nt,_t,Et)}}},i.prototype.getComparator=function(){return i.yComparator},i.prototype.createParentBoundablesFromVerticalSlice=function(l,h){return n.prototype.createParentBoundables.call(this,l,h)},i.prototype.remove=function(){if(arguments.length===2){var l=arguments[0],h=arguments[1];return n.prototype.remove.call(this,l,h)}return n.prototype.remove.apply(this,arguments)},i.prototype.depth=function(){return arguments.length===0?n.prototype.depth.call(this):n.prototype.depth.apply(this,arguments)},i.prototype.createParentBoundables=function(l,h){P.isTrue(!l.isEmpty());var v=Math.trunc(Math.ceil(l.size()/this.getNodeCapacity())),S=new ct(l);ro.sort(S,i.xComparator);var R=this.verticalSlices(S,Math.trunc(Math.ceil(Math.sqrt(v))));return this.createParentBoundablesFromVerticalSlices(R,h)},i.prototype.nearestNeighbour=function(){if(arguments.length===1){if(j(arguments[0],wo)){var l=arguments[0],h=new cr(this.getRoot(),this.getRoot(),l);return this.nearestNeighbour(h)}if(arguments[0]instanceof cr){var v=arguments[0];return this.nearestNeighbour(v,A.POSITIVE_INFINITY)}}else if(arguments.length===2){if(arguments[0]instanceof i&&j(arguments[1],wo)){var S=arguments[0],R=arguments[1],V=new cr(this.getRoot(),S.getRoot(),R);return this.nearestNeighbour(V)}if(arguments[0]instanceof cr&&typeof arguments[1]=="number"){var nt=arguments[0],_t=arguments[1],Et=null,Wt=new us;for(Wt.add(nt);!Wt.isEmpty()&&_t>0;){var $t=Wt.poll(),ie=$t.getDistance();if(ie>=_t)break;$t.isLeaves()?(_t=ie,Et=$t):$t.expandToQueue(Wt,_t)}return[Et.getBoundable(0).getItem(),Et.getBoundable(1).getItem()]}}else if(arguments.length===3){var Ee=arguments[0],An=arguments[1],Wn=arguments[2],Qr=new qe(Ee,An),jo=new cr(this.getRoot(),Qr,Wn);return this.nearestNeighbour(jo)[0]}},i.prototype.interfaces_=function(){return[xa,t]},i.prototype.getClass=function(){return i},i.centreX=function(l){return i.avg(l.getMinX(),l.getMaxX())},i.avg=function(l,h){return(l+h)/2},i.centreY=function(l){return i.avg(l.getMinY(),l.getMaxY())},s.STRtreeNode.get=function(){return yl},s.serialVersionUID.get=function(){return 0x39920f7d5f261e0},s.xComparator.get=function(){return{interfaces_:function(){return[X]},compare:function(l,h){return n.compareDoubles(i.centreX(l.getBounds()),i.centreX(h.getBounds()))}}},s.yComparator.get=function(){return{interfaces_:function(){return[X]},compare:function(l,h){return n.compareDoubles(i.centreY(l.getBounds()),i.centreY(h.getBounds()))}}},s.intersectsOp.get=function(){return{interfaces_:function(){return[n.IntersectsOp]},intersects:function(l,h){return l.intersects(h)}}},s.DEFAULT_NODE_CAPACITY.get=function(){return 10},Object.defineProperties(i,s),i}(br),yl=function(n){function i(){var s=arguments[0];n.call(this,s)}return n&&(i.__proto__=n),i.prototype=Object.create(n&&n.prototype),i.prototype.constructor=i,i.prototype.computeBounds=function(){for(var s=null,l=this.getChildBoundables().iterator();l.hasNext();){var h=l.next();s===null?s=new Vt(h.getBounds()):s.expandToInclude(h.getBounds())}return s},i.prototype.interfaces_=function(){return[]},i.prototype.getClass=function(){return i},i}(yr),Qn=function(){};Qn.prototype.interfaces_=function(){return[]},Qn.prototype.getClass=function(){return Qn},Qn.relativeSign=function(n,i){return n<i?-1:n>i?1:0},Qn.compare=function(n,i,s){if(i.equals2D(s))return 0;var l=Qn.relativeSign(i.x,s.x),h=Qn.relativeSign(i.y,s.y);switch(n){case 0:return Qn.compareValue(l,h);case 1:return Qn.compareValue(h,l);case 2:return Qn.compareValue(h,-l);case 3:return Qn.compareValue(-l,h);case 4:return Qn.compareValue(-l,-h);case 5:return Qn.compareValue(-h,-l);case 6:return Qn.compareValue(-h,l);case 7:return Qn.compareValue(l,-h)}return P.shouldNeverReachHere("invalid octant value"),0},Qn.compareValue=function(n,i){return n<0?-1:n>0?1:i<0?-1:i>0?1:0};var ls=function(){this._segString=null,this.coord=null,this.segmentIndex=null,this._segmentOctant=null,this._isInterior=null;var n=arguments[0],i=arguments[1],s=arguments[2],l=arguments[3];this._segString=n,this.coord=new U(i),this.segmentIndex=s,this._segmentOctant=l,this._isInterior=!i.equals2D(n.getCoordinate(s))};ls.prototype.getCoordinate=function(){return this.coord},ls.prototype.print=function(n){n.print(this.coord),n.print(" seg # = "+this.segmentIndex)},ls.prototype.compareTo=function(n){var i=n;return this.segmentIndex<i.segmentIndex?-1:this.segmentIndex>i.segmentIndex?1:this.coord.equals2D(i.coord)?0:Qn.compare(this._segmentOctant,this.coord,i.coord)},ls.prototype.isEndPoint=function(n){return this.segmentIndex===0&&!this._isInterior||this.segmentIndex===n},ls.prototype.isInterior=function(){return this._isInterior},ls.prototype.interfaces_=function(){return[G]},ls.prototype.getClass=function(){return ls};var Hr=function(){this._nodeMap=new w,this._edge=null;var n=arguments[0];this._edge=n};Hr.prototype.getSplitCoordinates=function(){var n=new Kt;this.addEndpoints();for(var i=this.iterator(),s=i.next();i.hasNext();){var l=i.next();this.addEdgeCoordinates(s,l,n),s=l}return n.toCoordinateArray()},Hr.prototype.addCollapsedNodes=function(){var n=new ct;this.findCollapsesFromInsertedNodes(n),this.findCollapsesFromExistingVertices(n);for(var i=n.iterator();i.hasNext();){var s=i.next().intValue();this.add(this._edge.getCoordinate(s),s)}},Hr.prototype.print=function(n){n.println("Intersections:");for(var i=this.iterator();i.hasNext();)i.next().print(n)},Hr.prototype.findCollapsesFromExistingVertices=function(n){for(var i=0;i<this._edge.size()-2;i++){var s=this._edge.getCoordinate(i),l=this._edge.getCoordinate(i+2);s.equals2D(l)&&n.add(new ft(i+1))}},Hr.prototype.addEdgeCoordinates=function(n,i,s){var l=this._edge.getCoordinate(i.segmentIndex),h=i.isInterior()||!i.coord.equals2D(l);s.add(new U(n.coord),!1);for(var v=n.segmentIndex+1;v<=i.segmentIndex;v++)s.add(this._edge.getCoordinate(v));h&&s.add(new U(i.coord))},Hr.prototype.iterator=function(){return this._nodeMap.values().iterator()},Hr.prototype.addSplitEdges=function(n){this.addEndpoints(),this.addCollapsedNodes();for(var i=this.iterator(),s=i.next();i.hasNext();){var l=i.next(),h=this.createSplitEdge(s,l);n.add(h),s=l}},Hr.prototype.findCollapseIndex=function(n,i,s){if(!n.coord.equals2D(i.coord))return!1;var l=i.segmentIndex-n.segmentIndex;return i.isInterior()||l--,l===1&&(s[0]=n.segmentIndex+1,!0)},Hr.prototype.findCollapsesFromInsertedNodes=function(n){for(var i=new Array(1).fill(null),s=this.iterator(),l=s.next();s.hasNext();){var h=s.next();this.findCollapseIndex(l,h,i)&&n.add(new ft(i[0])),l=h}},Hr.prototype.getEdge=function(){return this._edge},Hr.prototype.addEndpoints=function(){var n=this._edge.size()-1;this.add(this._edge.getCoordinate(0),0),this.add(this._edge.getCoordinate(n),n)},Hr.prototype.createSplitEdge=function(n,i){var s=i.segmentIndex-n.segmentIndex+2,l=this._edge.getCoordinate(i.segmentIndex),h=i.isInterior()||!i.coord.equals2D(l);h||s--;var v=new Array(s).fill(null),S=0;v[S++]=new U(n.coord);for(var R=n.segmentIndex+1;R<=i.segmentIndex;R++)v[S++]=this._edge.getCoordinate(R);return h&&(v[S]=new U(i.coord)),new or(v,this._edge.getData())},Hr.prototype.add=function(n,i){var s=new ls(this._edge,n,i,this._edge.getSegmentOctant(i)),l=this._nodeMap.get(s);return l!==null?(P.isTrue(l.coord.equals2D(n),"Found equal nodes with different coordinates"),l):(this._nodeMap.put(s,s),s)},Hr.prototype.checkSplitEdgesCorrectness=function(n){var i=this._edge.getCoordinates(),s=n.get(0).getCoordinate(0);if(!s.equals2D(i[0]))throw new it("bad split edge start point at "+s);var l=n.get(n.size()-1).getCoordinates(),h=l[l.length-1];if(!h.equals2D(i[i.length-1]))throw new it("bad split edge end point at "+h)},Hr.prototype.interfaces_=function(){return[]},Hr.prototype.getClass=function(){return Hr};var Ys=function(){};Ys.prototype.interfaces_=function(){return[]},Ys.prototype.getClass=function(){return Ys},Ys.octant=function(){if(typeof arguments[0]=="number"&&typeof arguments[1]=="number"){var n=arguments[0],i=arguments[1];if(n===0&&i===0)throw new L("Cannot compute the octant for point ( "+n+", "+i+" )");var s=Math.abs(n),l=Math.abs(i);return n>=0?i>=0?s>=l?0:1:s>=l?7:6:i>=0?s>=l?3:2:s>=l?4:5}if(arguments[0]instanceof U&&arguments[1]instanceof U){var h=arguments[0],v=arguments[1],S=v.x-h.x,R=v.y-h.y;if(S===0&&R===0)throw new L("Cannot compute the octant for two identical points "+h);return Ys.octant(S,R)}};var Mo=function(){};Mo.prototype.getCoordinates=function(){},Mo.prototype.size=function(){},Mo.prototype.getCoordinate=function(n){},Mo.prototype.isClosed=function(){},Mo.prototype.setData=function(n){},Mo.prototype.getData=function(){},Mo.prototype.interfaces_=function(){return[]},Mo.prototype.getClass=function(){return Mo};var tu=function(){};tu.prototype.addIntersection=function(n,i){},tu.prototype.interfaces_=function(){return[Mo]},tu.prototype.getClass=function(){return tu};var or=function(){this._nodeList=new Hr(this),this._pts=null,this._data=null;var n=arguments[0],i=arguments[1];this._pts=n,this._data=i};or.prototype.getCoordinates=function(){return this._pts},or.prototype.size=function(){return this._pts.length},or.prototype.getCoordinate=function(n){return this._pts[n]},or.prototype.isClosed=function(){return this._pts[0].equals(this._pts[this._pts.length-1])},or.prototype.getSegmentOctant=function(n){return n===this._pts.length-1?-1:this.safeOctant(this.getCoordinate(n),this.getCoordinate(n+1))},or.prototype.setData=function(n){this._data=n},or.prototype.safeOctant=function(n,i){return n.equals2D(i)?0:Ys.octant(n,i)},or.prototype.getData=function(){return this._data},or.prototype.addIntersection=function(){if(arguments.length===2){var n=arguments[0],i=arguments[1];this.addIntersectionNode(n,i)}else if(arguments.length===4){var s=arguments[0],l=arguments[1],h=arguments[3],v=new U(s.getIntersection(h));this.addIntersection(v,l)}},or.prototype.toString=function(){return fe.toLineString(new De(this._pts))},or.prototype.getNodeList=function(){return this._nodeList},or.prototype.addIntersectionNode=function(n,i){var s=i,l=s+1;if(l<this._pts.length){var h=this._pts[l];n.equals2D(h)&&(s=l)}return this._nodeList.add(n,s)},or.prototype.addIntersections=function(n,i,s){for(var l=0;l<n.getIntersectionNum();l++)this.addIntersection(n,i,s,l)},or.prototype.interfaces_=function(){return[tu]},or.prototype.getClass=function(){return or},or.getNodedSubstrings=function(){if(arguments.length===1){var n=arguments[0],i=new ct;return or.getNodedSubstrings(n,i),i}if(arguments.length===2)for(var s=arguments[0],l=arguments[1],h=s.iterator();h.hasNext();)h.next().getNodeList().addSplitEdges(l)};var ee=function(){if(this.p0=null,this.p1=null,arguments.length===0)this.p0=new U,this.p1=new U;else if(arguments.length===1){var n=arguments[0];this.p0=new U(n.p0),this.p1=new U(n.p1)}else if(arguments.length===2)this.p0=arguments[0],this.p1=arguments[1];else if(arguments.length===4){var i=arguments[0],s=arguments[1],l=arguments[2],h=arguments[3];this.p0=new U(i,s),this.p1=new U(l,h)}},Ff={serialVersionUID:{configurable:!0}};ee.prototype.minX=function(){return Math.min(this.p0.x,this.p1.x)},ee.prototype.orientationIndex=function(){if(arguments[0]instanceof ee){var n=arguments[0],i=W.orientationIndex(this.p0,this.p1,n.p0),s=W.orientationIndex(this.p0,this.p1,n.p1);return i>=0&&s>=0||i<=0&&s<=0?Math.max(i,s):0}if(arguments[0]instanceof U){var l=arguments[0];return W.orientationIndex(this.p0,this.p1,l)}},ee.prototype.toGeometry=function(n){return n.createLineString([this.p0,this.p1])},ee.prototype.isVertical=function(){return this.p0.x===this.p1.x},ee.prototype.equals=function(n){if(!(n instanceof ee))return!1;var i=n;return this.p0.equals(i.p0)&&this.p1.equals(i.p1)},ee.prototype.intersection=function(n){var i=new rt;return i.computeIntersection(this.p0,this.p1,n.p0,n.p1),i.hasIntersection()?i.getIntersection(0):null},ee.prototype.project=function(){if(arguments[0]instanceof U){var n=arguments[0];if(n.equals(this.p0)||n.equals(this.p1))return new U(n);var i=this.projectionFactor(n),s=new U;return s.x=this.p0.x+i*(this.p1.x-this.p0.x),s.y=this.p0.y+i*(this.p1.y-this.p0.y),s}if(arguments[0]instanceof ee){var l=arguments[0],h=this.projectionFactor(l.p0),v=this.projectionFactor(l.p1);if(h>=1&&v>=1||h<=0&&v<=0)return null;var S=this.project(l.p0);h<0&&(S=this.p0),h>1&&(S=this.p1);var R=this.project(l.p1);return v<0&&(R=this.p0),v>1&&(R=this.p1),new ee(S,R)}},ee.prototype.normalize=function(){this.p1.compareTo(this.p0)<0&&this.reverse()},ee.prototype.angle=function(){return Math.atan2(this.p1.y-this.p0.y,this.p1.x-this.p0.x)},ee.prototype.getCoordinate=function(n){return n===0?this.p0:this.p1},ee.prototype.distancePerpendicular=function(n){return W.distancePointLinePerpendicular(n,this.p0,this.p1)},ee.prototype.minY=function(){return Math.min(this.p0.y,this.p1.y)},ee.prototype.midPoint=function(){return ee.midPoint(this.p0,this.p1)},ee.prototype.projectionFactor=function(n){if(n.equals(this.p0))return 0;if(n.equals(this.p1))return 1;var i=this.p1.x-this.p0.x,s=this.p1.y-this.p0.y,l=i*i+s*s;return l<=0?A.NaN:((n.x-this.p0.x)*i+(n.y-this.p0.y)*s)/l},ee.prototype.closestPoints=function(n){var i=this.intersection(n);if(i!==null)return[i,i];var s=new Array(2).fill(null),l=A.MAX_VALUE,h=null,v=this.closestPoint(n.p0);l=v.distance(n.p0),s[0]=v,s[1]=n.p0;var S=this.closestPoint(n.p1);(h=S.distance(n.p1))<l&&(l=h,s[0]=S,s[1]=n.p1);var R=n.closestPoint(this.p0);(h=R.distance(this.p0))<l&&(l=h,s[0]=this.p0,s[1]=R);var V=n.closestPoint(this.p1);return(h=V.distance(this.p1))<l&&(l=h,s[0]=this.p1,s[1]=V),s},ee.prototype.closestPoint=function(n){var i=this.projectionFactor(n);return i>0&&i<1?this.project(n):this.p0.distance(n)<this.p1.distance(n)?this.p0:this.p1},ee.prototype.maxX=function(){return Math.max(this.p0.x,this.p1.x)},ee.prototype.getLength=function(){return this.p0.distance(this.p1)},ee.prototype.compareTo=function(n){var i=n,s=this.p0.compareTo(i.p0);return s!==0?s:this.p1.compareTo(i.p1)},ee.prototype.reverse=function(){var n=this.p0;this.p0=this.p1,this.p1=n},ee.prototype.equalsTopo=function(n){return this.p0.equals(n.p0)&&(this.p1.equals(n.p1)||this.p0.equals(n.p1))&&this.p1.equals(n.p0)},ee.prototype.lineIntersection=function(n){try{return _e.intersection(this.p0,this.p1,n.p0,n.p1)}catch(i){if(!(i instanceof se))throw i}return null},ee.prototype.maxY=function(){return Math.max(this.p0.y,this.p1.y)},ee.prototype.pointAlongOffset=function(n,i){var s=this.p0.x+n*(this.p1.x-this.p0.x),l=this.p0.y+n*(this.p1.y-this.p0.y),h=this.p1.x-this.p0.x,v=this.p1.y-this.p0.y,S=Math.sqrt(h*h+v*v),R=0,V=0;if(i!==0){if(S<=0)throw new Error("Cannot compute offset from zero-length line segment");R=i*h/S,V=i*v/S}return new U(s-V,l+R)},ee.prototype.setCoordinates=function(){if(arguments.length===1){var n=arguments[0];this.setCoordinates(n.p0,n.p1)}else if(arguments.length===2){var i=arguments[0],s=arguments[1];this.p0.x=i.x,this.p0.y=i.y,this.p1.x=s.x,this.p1.y=s.y}},ee.prototype.segmentFraction=function(n){var i=this.projectionFactor(n);return i<0?i=0:(i>1||A.isNaN(i))&&(i=1),i},ee.prototype.toString=function(){return"LINESTRING( "+this.p0.x+" "+this.p0.y+", "+this.p1.x+" "+this.p1.y+")"},ee.prototype.isHorizontal=function(){return this.p0.y===this.p1.y},ee.prototype.distance=function(){if(arguments[0]instanceof ee){var n=arguments[0];return W.distanceLineLine(this.p0,this.p1,n.p0,n.p1)}if(arguments[0]instanceof U){var i=arguments[0];return W.distancePointLine(i,this.p0,this.p1)}},ee.prototype.pointAlong=function(n){var i=new U;return i.x=this.p0.x+n*(this.p1.x-this.p0.x),i.y=this.p0.y+n*(this.p1.y-this.p0.y),i},ee.prototype.hashCode=function(){var n=A.doubleToLongBits(this.p0.x);n^=31*A.doubleToLongBits(this.p0.y);var i=Math.trunc(n)^Math.trunc(n>>32),s=A.doubleToLongBits(this.p1.x);return s^=31*A.doubleToLongBits(this.p1.y),i^(Math.trunc(s)^Math.trunc(s>>32))},ee.prototype.interfaces_=function(){return[G,t]},ee.prototype.getClass=function(){return ee},ee.midPoint=function(n,i){return new U((n.x+i.x)/2,(n.y+i.y)/2)},Ff.serialVersionUID.get=function(){return 0x2d2172135f411c00},Object.defineProperties(ee,Ff);var pi=function(){this.tempEnv1=new Vt,this.tempEnv2=new Vt,this._overlapSeg1=new ee,this._overlapSeg2=new ee};pi.prototype.overlap=function(){if(arguments.length!==2){if(arguments.length===4){var n=arguments[0],i=arguments[1],s=arguments[2],l=arguments[3];n.getLineSegment(i,this._overlapSeg1),s.getLineSegment(l,this._overlapSeg2),this.overlap(this._overlapSeg1,this._overlapSeg2)}}},pi.prototype.interfaces_=function(){return[]},pi.prototype.getClass=function(){return pi};var di=function(){this._pts=null,this._start=null,this._end=null,this._env=null,this._context=null,this._id=null;var n=arguments[0],i=arguments[1],s=arguments[2],l=arguments[3];this._pts=n,this._start=i,this._end=s,this._context=l};di.prototype.getLineSegment=function(n,i){i.p0=this._pts[n],i.p1=this._pts[n+1]},di.prototype.computeSelect=function(n,i,s,l){var h=this._pts[i],v=this._pts[s];if(l.tempEnv1.init(h,v),s-i==1)return l.select(this,i),null;if(!n.intersects(l.tempEnv1))return null;var S=Math.trunc((i+s)/2);i<S&&this.computeSelect(n,i,S,l),S<s&&this.computeSelect(n,S,s,l)},di.prototype.getCoordinates=function(){for(var n=new Array(this._end-this._start+1).fill(null),i=0,s=this._start;s<=this._end;s++)n[i++]=this._pts[s];return n},di.prototype.computeOverlaps=function(n,i){this.computeOverlapsInternal(this._start,this._end,n,n._start,n._end,i)},di.prototype.setId=function(n){this._id=n},di.prototype.select=function(n,i){this.computeSelect(n,this._start,this._end,i)},di.prototype.getEnvelope=function(){if(this._env===null){var n=this._pts[this._start],i=this._pts[this._end];this._env=new Vt(n,i)}return this._env},di.prototype.getEndIndex=function(){return this._end},di.prototype.getStartIndex=function(){return this._start},di.prototype.getContext=function(){return this._context},di.prototype.getId=function(){return this._id},di.prototype.computeOverlapsInternal=function(n,i,s,l,h,v){var S=this._pts[n],R=this._pts[i],V=s._pts[l],nt=s._pts[h];if(i-n==1&&h-l==1)return v.overlap(this,n,s,l),null;if(v.tempEnv1.init(S,R),v.tempEnv2.init(V,nt),!v.tempEnv1.intersects(v.tempEnv2))return null;var _t=Math.trunc((n+i)/2),Et=Math.trunc((l+h)/2);n<_t&&(l<Et&&this.computeOverlapsInternal(n,_t,s,l,Et,v),Et<h&&this.computeOverlapsInternal(n,_t,s,Et,h,v)),_t<i&&(l<Et&&this.computeOverlapsInternal(_t,i,s,l,Et,v),Et<h&&this.computeOverlapsInternal(_t,i,s,Et,h,v))},di.prototype.interfaces_=function(){return[]},di.prototype.getClass=function(){return di};var io=function(){};io.prototype.interfaces_=function(){return[]},io.prototype.getClass=function(){return io},io.getChainStartIndices=function(n){var i=0,s=new ct;s.add(new ft(i));do{var l=io.findChainEnd(n,i);s.add(new ft(l)),i=l}while(i<n.length-1);return io.toIntArray(s)},io.findChainEnd=function(n,i){for(var s=i;s<n.length-1&&n[s].equals2D(n[s+1]);)s++;if(s>=n.length-1)return n.length-1;for(var l=kn.quadrant(n[s],n[s+1]),h=i+1;h<n.length&&!(!n[h-1].equals2D(n[h])&&kn.quadrant(n[h-1],n[h])!==l);)h++;return h-1},io.getChains=function(){if(arguments.length===1){var n=arguments[0];return io.getChains(n,null)}if(arguments.length===2){for(var i=arguments[0],s=arguments[1],l=new ct,h=io.getChainStartIndices(i),v=0;v<h.length-1;v++){var S=new di(i,h[v],h[v+1],s);l.add(S)}return l}},io.toIntArray=function(n){for(var i=new Array(n.size()).fill(null),s=0;s<i.length;s++)i[s]=n.get(s).intValue();return i};var Ri=function(){};Ri.prototype.computeNodes=function(n){},Ri.prototype.getNodedSubstrings=function(){},Ri.prototype.interfaces_=function(){return[]},Ri.prototype.getClass=function(){return Ri};var $s=function(){if(this._segInt=null,arguments.length!==0){if(arguments.length===1){var n=arguments[0];this.setSegmentIntersector(n)}}};$s.prototype.setSegmentIntersector=function(n){this._segInt=n},$s.prototype.interfaces_=function(){return[Ri]},$s.prototype.getClass=function(){return $s};var Bu=function(n){function i(l){l?n.call(this,l):n.call(this),this._monoChains=new ct,this._index=new Pc,this._idCounter=0,this._nodedSegStrings=null,this._nOverlaps=0}n&&(i.__proto__=n),(i.prototype=Object.create(n&&n.prototype)).constructor=i;var s={SegmentOverlapAction:{configurable:!0}};return i.prototype.getMonotoneChains=function(){return this._monoChains},i.prototype.getNodedSubstrings=function(){return or.getNodedSubstrings(this._nodedSegStrings)},i.prototype.getIndex=function(){return this._index},i.prototype.add=function(l){for(var h=io.getChains(l.getCoordinates(),l).iterator();h.hasNext();){var v=h.next();v.setId(this._idCounter++),this._index.insert(v.getEnvelope(),v),this._monoChains.add(v)}},i.prototype.computeNodes=function(l){this._nodedSegStrings=l;for(var h=l.iterator();h.hasNext();)this.add(h.next());this.intersectChains()},i.prototype.intersectChains=function(){for(var l=new fr(this._segInt),h=this._monoChains.iterator();h.hasNext();)for(var v=h.next(),S=this._index.query(v.getEnvelope()).iterator();S.hasNext();){var R=S.next();if(R.getId()>v.getId()&&(v.computeOverlaps(R,l),this._nOverlaps++),this._segInt.isDone())return null}},i.prototype.interfaces_=function(){return[]},i.prototype.getClass=function(){return i},s.SegmentOverlapAction.get=function(){return fr},Object.defineProperties(i,s),i}($s),fr=function(n){function i(){n.call(this),this._si=null;var s=arguments[0];this._si=s}return n&&(i.__proto__=n),i.prototype=Object.create(n&&n.prototype),i.prototype.constructor=i,i.prototype.overlap=function(){if(arguments.length!==4)return n.prototype.overlap.apply(this,arguments);var s=arguments[0],l=arguments[1],h=arguments[2],v=arguments[3],S=s.getContext(),R=h.getContext();this._si.processIntersections(S,l,R,v)},i.prototype.interfaces_=function(){return[]},i.prototype.getClass=function(){return i},i}(pi),Fe=function n(){if(this._quadrantSegments=n.DEFAULT_QUADRANT_SEGMENTS,this._endCapStyle=n.CAP_ROUND,this._joinStyle=n.JOIN_ROUND,this._mitreLimit=n.DEFAULT_MITRE_LIMIT,this._isSingleSided=!1,this._simplifyFactor=n.DEFAULT_SIMPLIFY_FACTOR,arguments.length!==0){if(arguments.length===1){var i=arguments[0];this.setQuadrantSegments(i)}else if(arguments.length===2){var s=arguments[0],l=arguments[1];this.setQuadrantSegments(s),this.setEndCapStyle(l)}else if(arguments.length===4){var h=arguments[0],v=arguments[1],S=arguments[2],R=arguments[3];this.setQuadrantSegments(h),this.setEndCapStyle(v),this.setJoinStyle(S),this.setMitreLimit(R)}}},So={CAP_ROUND:{configurable:!0},CAP_FLAT:{configurable:!0},CAP_SQUARE:{configurable:!0},JOIN_ROUND:{configurable:!0},JOIN_MITRE:{configurable:!0},JOIN_BEVEL:{configurable:!0},DEFAULT_QUADRANT_SEGMENTS:{configurable:!0},DEFAULT_MITRE_LIMIT:{configurable:!0},DEFAULT_SIMPLIFY_FACTOR:{configurable:!0}};Fe.prototype.getEndCapStyle=function(){return this._endCapStyle},Fe.prototype.isSingleSided=function(){return this._isSingleSided},Fe.prototype.setQuadrantSegments=function(n){this._quadrantSegments=n,this._quadrantSegments===0&&(this._joinStyle=Fe.JOIN_BEVEL),this._quadrantSegments<0&&(this._joinStyle=Fe.JOIN_MITRE,this._mitreLimit=Math.abs(this._quadrantSegments)),n<=0&&(this._quadrantSegments=1),this._joinStyle!==Fe.JOIN_ROUND&&(this._quadrantSegments=Fe.DEFAULT_QUADRANT_SEGMENTS)},Fe.prototype.getJoinStyle=function(){return this._joinStyle},Fe.prototype.setJoinStyle=function(n){this._joinStyle=n},Fe.prototype.setSimplifyFactor=function(n){this._simplifyFactor=n<0?0:n},Fe.prototype.getSimplifyFactor=function(){return this._simplifyFactor},Fe.prototype.getQuadrantSegments=function(){return this._quadrantSegments},Fe.prototype.setEndCapStyle=function(n){this._endCapStyle=n},Fe.prototype.getMitreLimit=function(){return this._mitreLimit},Fe.prototype.setMitreLimit=function(n){this._mitreLimit=n},Fe.prototype.setSingleSided=function(n){this._isSingleSided=n},Fe.prototype.interfaces_=function(){return[]},Fe.prototype.getClass=function(){return Fe},Fe.bufferDistanceError=function(n){var i=Math.PI/2/n;return 1-Math.cos(i/2)},So.CAP_ROUND.get=function(){return 1},So.CAP_FLAT.get=function(){return 2},So.CAP_SQUARE.get=function(){return 3},So.JOIN_ROUND.get=function(){return 1},So.JOIN_MITRE.get=function(){return 2},So.JOIN_BEVEL.get=function(){return 3},So.DEFAULT_QUADRANT_SEGMENTS.get=function(){return 8},So.DEFAULT_MITRE_LIMIT.get=function(){return 5},So.DEFAULT_SIMPLIFY_FACTOR.get=function(){return .01},Object.defineProperties(Fe,So);var sr=function(n){this._distanceTol=null,this._isDeleted=null,this._angleOrientation=W.COUNTERCLOCKWISE,this._inputLine=n||null},Ea={INIT:{configurable:!0},DELETE:{configurable:!0},KEEP:{configurable:!0},NUM_PTS_TO_CHECK:{configurable:!0}};sr.prototype.isDeletable=function(n,i,s,l){var h=this._inputLine[n],v=this._inputLine[i],S=this._inputLine[s];return!!this.isConcave(h,v,S)&&!!this.isShallow(h,v,S,l)&&this.isShallowSampled(h,v,n,s,l)},sr.prototype.deleteShallowConcavities=function(){for(var n=1,i=this.findNextNonDeletedIndex(n),s=this.findNextNonDeletedIndex(i),l=!1;s<this._inputLine.length;){var h=!1;this.isDeletable(n,i,s,this._distanceTol)&&(this._isDeleted[i]=sr.DELETE,h=!0,l=!0),n=h?s:i,i=this.findNextNonDeletedIndex(n),s=this.findNextNonDeletedIndex(i)}return l},sr.prototype.isShallowConcavity=function(n,i,s,l){return W.computeOrientation(n,i,s)!==this._angleOrientation?!1:W.distancePointLine(i,n,s)<l},sr.prototype.isShallowSampled=function(n,i,s,l,h){var v=Math.trunc((l-s)/sr.NUM_PTS_TO_CHECK);v<=0&&(v=1);for(var S=s;S<l;S+=v)if(!this.isShallow(n,i,this._inputLine[S],h))return!1;return!0},sr.prototype.isConcave=function(n,i,s){var l=W.computeOrientation(n,i,s)===this._angleOrientation;return l},sr.prototype.simplify=function(n){this._distanceTol=Math.abs(n),n<0&&(this._angleOrientation=W.CLOCKWISE),this._isDeleted=new Array(this._inputLine.length).fill(null);var i=!1;do i=this.deleteShallowConcavities();while(i);return this.collapseLine()},sr.prototype.findNextNonDeletedIndex=function(n){for(var i=n+1;i<this._inputLine.length&&this._isDeleted[i]===sr.DELETE;)i++;return i},sr.prototype.isShallow=function(n,i,s,l){return W.distancePointLine(i,n,s)<l},sr.prototype.collapseLine=function(){for(var n=new Kt,i=0;i<this._inputLine.length;i++)this._isDeleted[i]!==sr.DELETE&&n.add(this._inputLine[i]);return n.toCoordinateArray()},sr.prototype.interfaces_=function(){return[]},sr.prototype.getClass=function(){return sr},sr.simplify=function(n,i){return new sr(n).simplify(i)},Ea.INIT.get=function(){return 0},Ea.DELETE.get=function(){return 1},Ea.KEEP.get=function(){return 1},Ea.NUM_PTS_TO_CHECK.get=function(){return 10},Object.defineProperties(sr,Ea);var Li=function(){this._ptList=null,this._precisionModel=null,this._minimimVertexDistance=0,this._ptList=new ct},Uf={COORDINATE_ARRAY_TYPE:{configurable:!0}};Li.prototype.getCoordinates=function(){return this._ptList.toArray(Li.COORDINATE_ARRAY_TYPE)},Li.prototype.setPrecisionModel=function(n){this._precisionModel=n},Li.prototype.addPt=function(n){var i=new U(n);if(this._precisionModel.makePrecise(i),this.isRedundant(i))return null;this._ptList.add(i)},Li.prototype.revere=function(){},Li.prototype.addPts=function(n,i){if(i)for(var s=0;s<n.length;s++)this.addPt(n[s]);else for(var l=n.length-1;l>=0;l--)this.addPt(n[l])},Li.prototype.isRedundant=function(n){if(this._ptList.size()<1)return!1;var i=this._ptList.get(this._ptList.size()-1);return n.distance(i)<this._minimimVertexDistance},Li.prototype.toString=function(){return new Ce().createLineString(this.getCoordinates()).toString()},Li.prototype.closeRing=function(){if(this._ptList.size()<1)return null;var n=new U(this._ptList.get(0)),i=this._ptList.get(this._ptList.size()-1);if(n.equals(i))return null;this._ptList.add(n)},Li.prototype.setMinimumVertexDistance=function(n){this._minimimVertexDistance=n},Li.prototype.interfaces_=function(){return[]},Li.prototype.getClass=function(){return Li},Uf.COORDINATE_ARRAY_TYPE.get=function(){return new Array(0).fill(null)},Object.defineProperties(Li,Uf);var ke=function(){},Zs={PI_TIMES_2:{configurable:!0},PI_OVER_2:{configurable:!0},PI_OVER_4:{configurable:!0},COUNTERCLOCKWISE:{configurable:!0},CLOCKWISE:{configurable:!0},NONE:{configurable:!0}};ke.prototype.interfaces_=function(){return[]},ke.prototype.getClass=function(){return ke},ke.toDegrees=function(n){return 180*n/Math.PI},ke.normalize=function(n){for(;n>Math.PI;)n-=ke.PI_TIMES_2;for(;n<=-Math.PI;)n+=ke.PI_TIMES_2;return n},ke.angle=function(){if(arguments.length===1){var n=arguments[0];return Math.atan2(n.y,n.x)}if(arguments.length===2){var i=arguments[0],s=arguments[1],l=s.x-i.x,h=s.y-i.y;return Math.atan2(h,l)}},ke.isAcute=function(n,i,s){var l=n.x-i.x,h=n.y-i.y;return l*(s.x-i.x)+h*(s.y-i.y)>0},ke.isObtuse=function(n,i,s){var l=n.x-i.x,h=n.y-i.y;return l*(s.x-i.x)+h*(s.y-i.y)<0},ke.interiorAngle=function(n,i,s){var l=ke.angle(i,n),h=ke.angle(i,s);return Math.abs(h-l)},ke.normalizePositive=function(n){if(n<0){for(;n<0;)n+=ke.PI_TIMES_2;n>=ke.PI_TIMES_2&&(n=0)}else{for(;n>=ke.PI_TIMES_2;)n-=ke.PI_TIMES_2;n<0&&(n=0)}return n},ke.angleBetween=function(n,i,s){var l=ke.angle(i,n),h=ke.angle(i,s);return ke.diff(l,h)},ke.diff=function(n,i){var s=null;return(s=n<i?i-n:n-i)>Math.PI&&(s=2*Math.PI-s),s},ke.toRadians=function(n){return n*Math.PI/180},ke.getTurn=function(n,i){var s=Math.sin(i-n);return s>0?ke.COUNTERCLOCKWISE:s<0?ke.CLOCKWISE:ke.NONE},ke.angleBetweenOriented=function(n,i,s){var l=ke.angle(i,n),h=ke.angle(i,s)-l;return h<=-Math.PI?h+ke.PI_TIMES_2:h>Math.PI?h-ke.PI_TIMES_2:h},Zs.PI_TIMES_2.get=function(){return 2*Math.PI},Zs.PI_OVER_2.get=function(){return Math.PI/2},Zs.PI_OVER_4.get=function(){return Math.PI/4},Zs.COUNTERCLOCKWISE.get=function(){return W.COUNTERCLOCKWISE},Zs.CLOCKWISE.get=function(){return W.CLOCKWISE},Zs.NONE.get=function(){return W.COLLINEAR},Object.defineProperties(ke,Zs);var Vn=function n(){this._maxCurveSegmentError=0,this._filletAngleQuantum=null,this._closingSegLengthFactor=1,this._segList=null,this._distance=0,this._precisionModel=null,this._bufParams=null,this._li=null,this._s0=null,this._s1=null,this._s2=null,this._seg0=new ee,this._seg1=new ee,this._offset0=new ee,this._offset1=new ee,this._side=0,this._hasNarrowConcaveAngle=!1;var i=arguments[0],s=arguments[1],l=arguments[2];this._precisionModel=i,this._bufParams=s,this._li=new rt,this._filletAngleQuantum=Math.PI/2/s.getQuadrantSegments(),s.getQuadrantSegments()>=8&&s.getJoinStyle()===Fe.JOIN_ROUND&&(this._closingSegLengthFactor=n.MAX_CLOSING_SEG_LEN_FACTOR),this.init(l)},cs={OFFSET_SEGMENT_SEPARATION_FACTOR:{configurable:!0},INSIDE_TURN_VERTEX_SNAP_DISTANCE_FACTOR:{configurable:!0},CURVE_VERTEX_SNAP_DISTANCE_FACTOR:{configurable:!0},MAX_CLOSING_SEG_LEN_FACTOR:{configurable:!0}};Vn.prototype.addNextSegment=function(n,i){if(this._s0=this._s1,this._s1=this._s2,this._s2=n,this._seg0.setCoordinates(this._s0,this._s1),this.computeOffsetSegment(this._seg0,this._side,this._distance,this._offset0),this._seg1.setCoordinates(this._s1,this._s2),this.computeOffsetSegment(this._seg1,this._side,this._distance,this._offset1),this._s1.equals(this._s2))return null;var s=W.computeOrientation(this._s0,this._s1,this._s2),l=s===W.CLOCKWISE&&this._side===Gt.LEFT||s===W.COUNTERCLOCKWISE&&this._side===Gt.RIGHT;s===0?this.addCollinear(i):l?this.addOutsideTurn(s,i):this.addInsideTurn(s,i)},Vn.prototype.addLineEndCap=function(n,i){var s=new ee(n,i),l=new ee;this.computeOffsetSegment(s,Gt.LEFT,this._distance,l);var h=new ee;this.computeOffsetSegment(s,Gt.RIGHT,this._distance,h);var v=i.x-n.x,S=i.y-n.y,R=Math.atan2(S,v);switch(this._bufParams.getEndCapStyle()){case Fe.CAP_ROUND:this._segList.addPt(l.p1),this.addFilletArc(i,R+Math.PI/2,R-Math.PI/2,W.CLOCKWISE,this._distance),this._segList.addPt(h.p1);break;case Fe.CAP_FLAT:this._segList.addPt(l.p1),this._segList.addPt(h.p1);break;case Fe.CAP_SQUARE:var V=new U;V.x=Math.abs(this._distance)*Math.cos(R),V.y=Math.abs(this._distance)*Math.sin(R);var nt=new U(l.p1.x+V.x,l.p1.y+V.y),_t=new U(h.p1.x+V.x,h.p1.y+V.y);this._segList.addPt(nt),this._segList.addPt(_t)}},Vn.prototype.getCoordinates=function(){return this._segList.getCoordinates()},Vn.prototype.addMitreJoin=function(n,i,s,l){var h=!0,v=null;try{v=_e.intersection(i.p0,i.p1,s.p0,s.p1),(l<=0?1:v.distance(n)/Math.abs(l))>this._bufParams.getMitreLimit()&&(h=!1)}catch(S){if(!(S instanceof se))throw S;v=new U(0,0),h=!1}h?this._segList.addPt(v):this.addLimitedMitreJoin(i,s,l,this._bufParams.getMitreLimit())},Vn.prototype.addFilletCorner=function(n,i,s,l,h){var v=i.x-n.x,S=i.y-n.y,R=Math.atan2(S,v),V=s.x-n.x,nt=s.y-n.y,_t=Math.atan2(nt,V);l===W.CLOCKWISE?R<=_t&&(R+=2*Math.PI):R>=_t&&(R-=2*Math.PI),this._segList.addPt(i),this.addFilletArc(n,R,_t,l,h),this._segList.addPt(s)},Vn.prototype.addOutsideTurn=function(n,i){if(this._offset0.p1.distance(this._offset1.p0)<this._distance*Vn.OFFSET_SEGMENT_SEPARATION_FACTOR)return this._segList.addPt(this._offset0.p1),null;this._bufParams.getJoinStyle()===Fe.JOIN_MITRE?this.addMitreJoin(this._s1,this._offset0,this._offset1,this._distance):this._bufParams.getJoinStyle()===Fe.JOIN_BEVEL?this.addBevelJoin(this._offset0,this._offset1):(i&&this._segList.addPt(this._offset0.p1),this.addFilletCorner(this._s1,this._offset0.p1,this._offset1.p0,n,this._distance),this._segList.addPt(this._offset1.p0))},Vn.prototype.createSquare=function(n){this._segList.addPt(new U(n.x+this._distance,n.y+this._distance)),this._segList.addPt(new U(n.x+this._distance,n.y-this._distance)),this._segList.addPt(new U(n.x-this._distance,n.y-this._distance)),this._segList.addPt(new U(n.x-this._distance,n.y+this._distance)),this._segList.closeRing()},Vn.prototype.addSegments=function(n,i){this._segList.addPts(n,i)},Vn.prototype.addFirstSegment=function(){this._segList.addPt(this._offset1.p0)},Vn.prototype.addLastSegment=function(){this._segList.addPt(this._offset1.p1)},Vn.prototype.initSideSegments=function(n,i,s){this._s1=n,this._s2=i,this._side=s,this._seg1.setCoordinates(n,i),this.computeOffsetSegment(this._seg1,s,this._distance,this._offset1)},Vn.prototype.addLimitedMitreJoin=function(n,i,s,l){var h=this._seg0.p1,v=ke.angle(h,this._seg0.p0),S=ke.angleBetweenOriented(this._seg0.p0,h,this._seg1.p1)/2,R=ke.normalize(v+S),V=ke.normalize(R+Math.PI),nt=l*s,_t=s-nt*Math.abs(Math.sin(S)),Et=h.x+nt*Math.cos(V),Wt=h.y+nt*Math.sin(V),$t=new U(Et,Wt),ie=new ee(h,$t),Ee=ie.pointAlongOffset(1,_t),An=ie.pointAlongOffset(1,-_t);this._side===Gt.LEFT?(this._segList.addPt(Ee),this._segList.addPt(An)):(this._segList.addPt(An),this._segList.addPt(Ee))},Vn.prototype.computeOffsetSegment=function(n,i,s,l){var h=i===Gt.LEFT?1:-1,v=n.p1.x-n.p0.x,S=n.p1.y-n.p0.y,R=Math.sqrt(v*v+S*S),V=h*s*v/R,nt=h*s*S/R;l.p0.x=n.p0.x-nt,l.p0.y=n.p0.y+V,l.p1.x=n.p1.x-nt,l.p1.y=n.p1.y+V},Vn.prototype.addFilletArc=function(n,i,s,l,h){var v=l===W.CLOCKWISE?-1:1,S=Math.abs(i-s),R=Math.trunc(S/this._filletAngleQuantum+.5);if(R<1)return null;for(var V=S/R,nt=0,_t=new U;nt<S;){var Et=i+v*nt;_t.x=n.x+h*Math.cos(Et),_t.y=n.y+h*Math.sin(Et),this._segList.addPt(_t),nt+=V}},Vn.prototype.addInsideTurn=function(n,i){if(this._li.computeIntersection(this._offset0.p0,this._offset0.p1,this._offset1.p0,this._offset1.p1),this._li.hasIntersection())this._segList.addPt(this._li.getIntersection(0));else if(this._hasNarrowConcaveAngle=!0,this._offset0.p1.distance(this._offset1.p0)<this._distance*Vn.INSIDE_TURN_VERTEX_SNAP_DISTANCE_FACTOR)this._segList.addPt(this._offset0.p1);else{if(this._segList.addPt(this._offset0.p1),this._closingSegLengthFactor>0){var s=new U((this._closingSegLengthFactor*this._offset0.p1.x+this._s1.x)/(this._closingSegLengthFactor+1),(this._closingSegLengthFactor*this._offset0.p1.y+this._s1.y)/(this._closingSegLengthFactor+1));this._segList.addPt(s);var l=new U((this._closingSegLengthFactor*this._offset1.p0.x+this._s1.x)/(this._closingSegLengthFactor+1),(this._closingSegLengthFactor*this._offset1.p0.y+this._s1.y)/(this._closingSegLengthFactor+1));this._segList.addPt(l)}else this._segList.addPt(this._s1);this._segList.addPt(this._offset1.p0)}},Vn.prototype.createCircle=function(n){var i=new U(n.x+this._distance,n.y);this._segList.addPt(i),this.addFilletArc(n,0,2*Math.PI,-1,this._distance),this._segList.closeRing()},Vn.prototype.addBevelJoin=function(n,i){this._segList.addPt(n.p1),this._segList.addPt(i.p0)},Vn.prototype.init=function(n){this._distance=n,this._maxCurveSegmentError=n*(1-Math.cos(this._filletAngleQuantum/2)),this._segList=new Li,this._segList.setPrecisionModel(this._precisionModel),this._segList.setMinimumVertexDistance(n*Vn.CURVE_VERTEX_SNAP_DISTANCE_FACTOR)},Vn.prototype.addCollinear=function(n){this._li.computeIntersection(this._s0,this._s1,this._s1,this._s2),this._li.getIntersectionNum()>=2&&(this._bufParams.getJoinStyle()===Fe.JOIN_BEVEL||this._bufParams.getJoinStyle()===Fe.JOIN_MITRE?(n&&this._segList.addPt(this._offset0.p1),this._segList.addPt(this._offset1.p0)):this.addFilletCorner(this._s1,this._offset0.p1,this._offset1.p0,W.CLOCKWISE,this._distance))},Vn.prototype.closeRing=function(){this._segList.closeRing()},Vn.prototype.hasNarrowConcaveAngle=function(){return this._hasNarrowConcaveAngle},Vn.prototype.interfaces_=function(){return[]},Vn.prototype.getClass=function(){return Vn},cs.OFFSET_SEGMENT_SEPARATION_FACTOR.get=function(){return .001},cs.INSIDE_TURN_VERTEX_SNAP_DISTANCE_FACTOR.get=function(){return .001},cs.CURVE_VERTEX_SNAP_DISTANCE_FACTOR.get=function(){return 1e-6},cs.MAX_CLOSING_SEG_LEN_FACTOR.get=function(){return 80},Object.defineProperties(Vn,cs);var ni=function(){this._distance=0,this._precisionModel=null,this._bufParams=null;var n=arguments[0],i=arguments[1];this._precisionModel=n,this._bufParams=i};ni.prototype.getOffsetCurve=function(n,i){if(this._distance=i,i===0)return null;var s=i<0,l=Math.abs(i),h=this.getSegGen(l);n.length<=1?this.computePointCurve(n[0],h):this.computeOffsetCurve(n,s,h);var v=h.getCoordinates();return s&&Mt.reverse(v),v},ni.prototype.computeSingleSidedBufferCurve=function(n,i,s){var l=this.simplifyTolerance(this._distance);if(i){s.addSegments(n,!0);var h=sr.simplify(n,-l),v=h.length-1;s.initSideSegments(h[v],h[v-1],Gt.LEFT),s.addFirstSegment();for(var S=v-2;S>=0;S--)s.addNextSegment(h[S],!0)}else{s.addSegments(n,!1);var R=sr.simplify(n,l),V=R.length-1;s.initSideSegments(R[0],R[1],Gt.LEFT),s.addFirstSegment();for(var nt=2;nt<=V;nt++)s.addNextSegment(R[nt],!0)}s.addLastSegment(),s.closeRing()},ni.prototype.computeRingBufferCurve=function(n,i,s){var l=this.simplifyTolerance(this._distance);i===Gt.RIGHT&&(l=-l);var h=sr.simplify(n,l),v=h.length-1;s.initSideSegments(h[v-1],h[0],i);for(var S=1;S<=v;S++){var R=S!==1;s.addNextSegment(h[S],R)}s.closeRing()},ni.prototype.computeLineBufferCurve=function(n,i){var s=this.simplifyTolerance(this._distance),l=sr.simplify(n,s),h=l.length-1;i.initSideSegments(l[0],l[1],Gt.LEFT);for(var v=2;v<=h;v++)i.addNextSegment(l[v],!0);i.addLastSegment(),i.addLineEndCap(l[h-1],l[h]);var S=sr.simplify(n,-s),R=S.length-1;i.initSideSegments(S[R],S[R-1],Gt.LEFT);for(var V=R-2;V>=0;V--)i.addNextSegment(S[V],!0);i.addLastSegment(),i.addLineEndCap(S[1],S[0]),i.closeRing()},ni.prototype.computePointCurve=function(n,i){switch(this._bufParams.getEndCapStyle()){case Fe.CAP_ROUND:i.createCircle(n);break;case Fe.CAP_SQUARE:i.createSquare(n)}},ni.prototype.getLineCurve=function(n,i){if(this._distance=i,i<0&&!this._bufParams.isSingleSided()||i===0)return null;var s=Math.abs(i),l=this.getSegGen(s);if(n.length<=1)this.computePointCurve(n[0],l);else if(this._bufParams.isSingleSided()){var h=i<0;this.computeSingleSidedBufferCurve(n,h,l)}else this.computeLineBufferCurve(n,l);return l.getCoordinates()},ni.prototype.getBufferParameters=function(){return this._bufParams},ni.prototype.simplifyTolerance=function(n){return n*this._bufParams.getSimplifyFactor()},ni.prototype.getRingCurve=function(n,i,s){if(this._distance=s,n.length<=2)return this.getLineCurve(n,s);if(s===0)return ni.copyCoordinates(n);var l=this.getSegGen(s);return this.computeRingBufferCurve(n,i,l),l.getCoordinates()},ni.prototype.computeOffsetCurve=function(n,i,s){var l=this.simplifyTolerance(this._distance);if(i){var h=sr.simplify(n,-l),v=h.length-1;s.initSideSegments(h[v],h[v-1],Gt.LEFT),s.addFirstSegment();for(var S=v-2;S>=0;S--)s.addNextSegment(h[S],!0)}else{var R=sr.simplify(n,l),V=R.length-1;s.initSideSegments(R[0],R[1],Gt.LEFT),s.addFirstSegment();for(var nt=2;nt<=V;nt++)s.addNextSegment(R[nt],!0)}s.addLastSegment()},ni.prototype.getSegGen=function(n){return new Vn(this._precisionModel,this._bufParams,n)},ni.prototype.interfaces_=function(){return[]},ni.prototype.getClass=function(){return ni},ni.copyCoordinates=function(n){for(var i=new Array(n.length).fill(null),s=0;s<i.length;s++)i[s]=new U(n[s]);return i};var Js=function(){this._subgraphs=null,this._seg=new ee,this._cga=new W;var n=arguments[0];this._subgraphs=n},Ic={DepthSegment:{configurable:!0}};Js.prototype.findStabbedSegments=function(){if(arguments.length===1){for(var n=arguments[0],i=new ct,s=this._subgraphs.iterator();s.hasNext();){var l=s.next(),h=l.getEnvelope();n.y<h.getMinY()||n.y>h.getMaxY()||this.findStabbedSegments(n,l.getDirectedEdges(),i)}return i}if(arguments.length===3){if(j(arguments[2],kt)&&arguments[0]instanceof U&&arguments[1]instanceof Ac){for(var v=arguments[0],S=arguments[1],R=arguments[2],V=S.getEdge().getCoordinates(),nt=0;nt<V.length-1;nt++)if(this._seg.p0=V[nt],this._seg.p1=V[nt+1],this._seg.p0.y>this._seg.p1.y&&this._seg.reverse(),!(Math.max(this._seg.p0.x,this._seg.p1.x)<v.x)&&!(this._seg.isHorizontal()||v.y<this._seg.p0.y||v.y>this._seg.p1.y||W.computeOrientation(this._seg.p0,this._seg.p1,v)===W.RIGHT)){var _t=S.getDepth(Gt.LEFT);this._seg.p0.equals(V[nt])||(_t=S.getDepth(Gt.RIGHT));var Et=new fs(this._seg,_t);R.add(Et)}}else if(j(arguments[2],kt)&&arguments[0]instanceof U&&j(arguments[1],kt))for(var Wt=arguments[0],$t=arguments[1],ie=arguments[2],Ee=$t.iterator();Ee.hasNext();){var An=Ee.next();An.isForward()&&this.findStabbedSegments(Wt,An,ie)}}},Js.prototype.getDepth=function(n){var i=this.findStabbedSegments(n);return i.size()===0?0:ro.min(i)._leftDepth},Js.prototype.interfaces_=function(){return[]},Js.prototype.getClass=function(){return Js},Ic.DepthSegment.get=function(){return fs},Object.defineProperties(Js,Ic);var fs=function(){this._upwardSeg=null,this._leftDepth=null;var n=arguments[0],i=arguments[1];this._upwardSeg=new ee(n),this._leftDepth=i};fs.prototype.compareTo=function(n){var i=n;if(this._upwardSeg.minX()>=i._upwardSeg.maxX())return 1;if(this._upwardSeg.maxX()<=i._upwardSeg.minX())return-1;var s=this._upwardSeg.orientationIndex(i._upwardSeg);return s!==0||(s=-1*i._upwardSeg.orientationIndex(this._upwardSeg))!=0?s:this._upwardSeg.compareTo(i._upwardSeg)},fs.prototype.compareX=function(n,i){var s=n.p0.compareTo(i.p0);return s!==0?s:n.p1.compareTo(i.p1)},fs.prototype.toString=function(){return this._upwardSeg.toString()},fs.prototype.interfaces_=function(){return[G]},fs.prototype.getClass=function(){return fs};var Ve=function(n,i,s){this.p0=n||null,this.p1=i||null,this.p2=s||null};Ve.prototype.area=function(){return Ve.area(this.p0,this.p1,this.p2)},Ve.prototype.signedArea=function(){return Ve.signedArea(this.p0,this.p1,this.p2)},Ve.prototype.interpolateZ=function(n){if(n===null)throw new L("Supplied point is null.");return Ve.interpolateZ(n,this.p0,this.p1,this.p2)},Ve.prototype.longestSideLength=function(){return Ve.longestSideLength(this.p0,this.p1,this.p2)},Ve.prototype.isAcute=function(){return Ve.isAcute(this.p0,this.p1,this.p2)},Ve.prototype.circumcentre=function(){return Ve.circumcentre(this.p0,this.p1,this.p2)},Ve.prototype.area3D=function(){return Ve.area3D(this.p0,this.p1,this.p2)},Ve.prototype.centroid=function(){return Ve.centroid(this.p0,this.p1,this.p2)},Ve.prototype.inCentre=function(){return Ve.inCentre(this.p0,this.p1,this.p2)},Ve.prototype.interfaces_=function(){return[]},Ve.prototype.getClass=function(){return Ve},Ve.area=function(n,i,s){return Math.abs(((s.x-n.x)*(i.y-n.y)-(i.x-n.x)*(s.y-n.y))/2)},Ve.signedArea=function(n,i,s){return((s.x-n.x)*(i.y-n.y)-(i.x-n.x)*(s.y-n.y))/2},Ve.det=function(n,i,s,l){return n*l-i*s},Ve.interpolateZ=function(n,i,s,l){var h=i.x,v=i.y,S=s.x-h,R=l.x-h,V=s.y-v,nt=l.y-v,_t=S*nt-R*V,Et=n.x-h,Wt=n.y-v,$t=(nt*Et-R*Wt)/_t,ie=(-V*Et+S*Wt)/_t;return i.z+$t*(s.z-i.z)+ie*(l.z-i.z)},Ve.longestSideLength=function(n,i,s){var l=n.distance(i),h=i.distance(s),v=s.distance(n),S=l;return h>S&&(S=h),v>S&&(S=v),S},Ve.isAcute=function(n,i,s){return!!ke.isAcute(n,i,s)&&!!ke.isAcute(i,s,n)&&!!ke.isAcute(s,n,i)},Ve.circumcentre=function(n,i,s){var l=s.x,h=s.y,v=n.x-l,S=n.y-h,R=i.x-l,V=i.y-h,nt=2*Ve.det(v,S,R,V),_t=Ve.det(S,v*v+S*S,V,R*R+V*V),Et=Ve.det(v,v*v+S*S,R,R*R+V*V);return new U(l-_t/nt,h+Et/nt)},Ve.perpendicularBisector=function(n,i){var s=i.x-n.x,l=i.y-n.y,h=new _e(n.x+s/2,n.y+l/2,1),v=new _e(n.x-l+s/2,n.y+s+l/2,1);return new _e(h,v)},Ve.angleBisector=function(n,i,s){var l=i.distance(n),h=l/(l+i.distance(s)),v=s.x-n.x,S=s.y-n.y;return new U(n.x+h*v,n.y+h*S)},Ve.area3D=function(n,i,s){var l=i.x-n.x,h=i.y-n.y,v=i.z-n.z,S=s.x-n.x,R=s.y-n.y,V=s.z-n.z,nt=h*V-v*R,_t=v*S-l*V,Et=l*R-h*S,Wt=nt*nt+_t*_t+Et*Et,$t=Math.sqrt(Wt)/2;return $t},Ve.centroid=function(n,i,s){var l=(n.x+i.x+s.x)/3,h=(n.y+i.y+s.y)/3;return new U(l,h)},Ve.inCentre=function(n,i,s){var l=i.distance(s),h=n.distance(s),v=n.distance(i),S=l+h+v,R=(l*n.x+h*i.x+v*s.x)/S,V=(l*n.y+h*i.y+v*s.y)/S;return new U(R,V)};var Ni=function(){this._inputGeom=null,this._distance=null,this._curveBuilder=null,this._curveList=new ct;var n=arguments[0],i=arguments[1],s=arguments[2];this._inputGeom=n,this._distance=i,this._curveBuilder=s};Ni.prototype.addPoint=function(n){if(this._distance<=0)return null;var i=n.getCoordinates(),s=this._curveBuilder.getLineCurve(i,this._distance);this.addCurve(s,$.EXTERIOR,$.INTERIOR)},Ni.prototype.addPolygon=function(n){var i=this._distance,s=Gt.LEFT;this._distance<0&&(i=-this._distance,s=Gt.RIGHT);var l=n.getExteriorRing(),h=Mt.removeRepeatedPoints(l.getCoordinates());if(this._distance<0&&this.isErodedCompletely(l,this._distance)||this._distance<=0&&h.length<3)return null;this.addPolygonRing(h,i,s,$.EXTERIOR,$.INTERIOR);for(var v=0;v<n.getNumInteriorRing();v++){var S=n.getInteriorRingN(v),R=Mt.removeRepeatedPoints(S.getCoordinates());this._distance>0&&this.isErodedCompletely(S,-this._distance)||this.addPolygonRing(R,i,Gt.opposite(s),$.INTERIOR,$.EXTERIOR)}},Ni.prototype.isTriangleErodedCompletely=function(n,i){var s=new Ve(n[0],n[1],n[2]),l=s.inCentre();return W.distancePointLine(l,s.p0,s.p1)<Math.abs(i)},Ni.prototype.addLineString=function(n){if(this._distance<=0&&!this._curveBuilder.getBufferParameters().isSingleSided())return null;var i=Mt.removeRepeatedPoints(n.getCoordinates()),s=this._curveBuilder.getLineCurve(i,this._distance);this.addCurve(s,$.EXTERIOR,$.INTERIOR)},Ni.prototype.addCurve=function(n,i,s){if(n===null||n.length<2)return null;var l=new or(n,new Tn(0,$.BOUNDARY,i,s));this._curveList.add(l)},Ni.prototype.getCurves=function(){return this.add(this._inputGeom),this._curveList},Ni.prototype.addPolygonRing=function(n,i,s,l,h){if(i===0&&n.length<bn.MINIMUM_VALID_SIZE)return null;var v=l,S=h;n.length>=bn.MINIMUM_VALID_SIZE&&W.isCCW(n)&&(v=h,S=l,s=Gt.opposite(s));var R=this._curveBuilder.getRingCurve(n,s,i);this.addCurve(R,v,S)},Ni.prototype.add=function(n){if(n.isEmpty())return null;n instanceof ue?this.addPolygon(n):n instanceof Qt?this.addLineString(n):n instanceof ge?this.addPoint(n):n instanceof Oe?this.addCollection(n):n instanceof K?this.addCollection(n):n instanceof Un?this.addCollection(n):n instanceof Sr&&this.addCollection(n)},Ni.prototype.isErodedCompletely=function(n,i){var s=n.getCoordinates();if(s.length<4)return i<0;if(s.length===4)return this.isTriangleErodedCompletely(s,i);var l=n.getEnvelopeInternal(),h=Math.min(l.getHeight(),l.getWidth());return i<0&&2*Math.abs(i)>h},Ni.prototype.addCollection=function(n){for(var i=0;i<n.getNumGeometries();i++){var s=n.getGeometryN(i);this.add(s)}},Ni.prototype.interfaces_=function(){return[]},Ni.prototype.getClass=function(){return Ni};var eu=function(){};eu.prototype.locate=function(n){},eu.prototype.interfaces_=function(){return[]},eu.prototype.getClass=function(){return eu};var oo=function(){this._parent=null,this._atStart=null,this._max=null,this._index=null,this._subcollectionIterator=null;var n=arguments[0];this._parent=n,this._atStart=!0,this._index=0,this._max=n.getNumGeometries()};oo.prototype.next=function(){if(this._atStart)return this._atStart=!1,oo.isAtomic(this._parent)&&this._index++,this._parent;if(this._subcollectionIterator!==null){if(this._subcollectionIterator.hasNext())return this._subcollectionIterator.next();this._subcollectionIterator=null}if(this._index>=this._max)throw new o;var n=this._parent.getGeometryN(this._index++);return n instanceof Sr?(this._subcollectionIterator=new oo(n),this._subcollectionIterator.next()):n},oo.prototype.remove=function(){throw new Error(this.getClass().getName())},oo.prototype.hasNext=function(){if(this._atStart)return!0;if(this._subcollectionIterator!==null){if(this._subcollectionIterator.hasNext())return!0;this._subcollectionIterator=null}return!(this._index>=this._max)},oo.prototype.interfaces_=function(){return[et]},oo.prototype.getClass=function(){return oo},oo.isAtomic=function(n){return!(n instanceof Sr)};var ri=function(){this._geom=null;var n=arguments[0];this._geom=n};ri.prototype.locate=function(n){return ri.locate(n,this._geom)},ri.prototype.interfaces_=function(){return[eu]},ri.prototype.getClass=function(){return ri},ri.isPointInRing=function(n,i){return!!i.getEnvelopeInternal().intersects(n)&&W.isPointInRing(n,i.getCoordinates())},ri.containsPointInPolygon=function(n,i){if(i.isEmpty())return!1;var s=i.getExteriorRing();if(!ri.isPointInRing(n,s))return!1;for(var l=0;l<i.getNumInteriorRing();l++){var h=i.getInteriorRingN(l);if(ri.isPointInRing(n,h))return!1}return!0},ri.containsPoint=function(n,i){if(i instanceof ue)return ri.containsPointInPolygon(n,i);if(i instanceof Sr)for(var s=new oo(i);s.hasNext();){var l=s.next();if(l!==i&&ri.containsPoint(n,l))return!0}return!1},ri.locate=function(n,i){return i.isEmpty()?$.EXTERIOR:ri.containsPoint(n,i)?$.INTERIOR:$.EXTERIOR};var Vr=function(){this._edgeMap=new w,this._edgeList=null,this._ptInAreaLocation=[$.NONE,$.NONE]};Vr.prototype.getNextCW=function(n){this.getEdges();var i=this._edgeList.indexOf(n),s=i-1;return i===0&&(s=this._edgeList.size()-1),this._edgeList.get(s)},Vr.prototype.propagateSideLabels=function(n){for(var i=$.NONE,s=this.iterator();s.hasNext();){var l=s.next().getLabel();l.isArea(n)&&l.getLocation(n,Gt.LEFT)!==$.NONE&&(i=l.getLocation(n,Gt.LEFT))}if(i===$.NONE)return null;for(var h=i,v=this.iterator();v.hasNext();){var S=v.next(),R=S.getLabel();if(R.getLocation(n,Gt.ON)===$.NONE&&R.setLocation(n,Gt.ON,h),R.isArea(n)){var V=R.getLocation(n,Gt.LEFT),nt=R.getLocation(n,Gt.RIGHT);if(nt!==$.NONE){if(nt!==h)throw new qo("side location conflict",S.getCoordinate());V===$.NONE&&P.shouldNeverReachHere("found single null side (at "+S.getCoordinate()+")"),h=V}else P.isTrue(R.getLocation(n,Gt.LEFT)===$.NONE,"found single null side"),R.setLocation(n,Gt.RIGHT,h),R.setLocation(n,Gt.LEFT,h)}}},Vr.prototype.getCoordinate=function(){var n=this.iterator();return n.hasNext()?n.next().getCoordinate():null},Vr.prototype.print=function(n){Zt.out.println("EdgeEndStar: "+this.getCoordinate());for(var i=this.iterator();i.hasNext();)i.next().print(n)},Vr.prototype.isAreaLabelsConsistent=function(n){return this.computeEdgeEndLabels(n.getBoundaryNodeRule()),this.checkAreaLabelsConsistent(0)},Vr.prototype.checkAreaLabelsConsistent=function(n){var i=this.getEdges();if(i.size()<=0)return!0;var s=i.size()-1,l=i.get(s).getLabel().getLocation(n,Gt.LEFT);P.isTrue(l!==$.NONE,"Found unlabelled area edge");for(var h=l,v=this.iterator();v.hasNext();){var S=v.next().getLabel();P.isTrue(S.isArea(n),"Found non-area edge");var R=S.getLocation(n,Gt.LEFT),V=S.getLocation(n,Gt.RIGHT);if(R===V||V!==h)return!1;h=R}return!0},Vr.prototype.findIndex=function(n){this.iterator();for(var i=0;i<this._edgeList.size();i++)if(this._edgeList.get(i)===n)return i;return-1},Vr.prototype.iterator=function(){return this.getEdges().iterator()},Vr.prototype.getEdges=function(){return this._edgeList===null&&(this._edgeList=new ct(this._edgeMap.values())),this._edgeList},Vr.prototype.getLocation=function(n,i,s){return this._ptInAreaLocation[n]===$.NONE&&(this._ptInAreaLocation[n]=ri.locate(i,s[n].getGeometry())),this._ptInAreaLocation[n]},Vr.prototype.toString=function(){var n=new Tt;n.append("EdgeEndStar: "+this.getCoordinate()),n.append(\`
|
|
108
108
|
\`);for(var i=this.iterator();i.hasNext();){var s=i.next();n.append(s),n.append(\`
|
|
@@ -3817,7 +3817,7 @@ three/build/three.module.js:
|
|
|
3817
3817
|
* along with MarchingSquaresJS. If not, see <http://www.gnu.org/licenses/>.
|
|
3818
3818
|
*)
|
|
3819
3819
|
*/
|
|
3820
|
-
`)}var Pr=class extends Ar.EventDispatcher{worker=rn();initRoadStatus=!1;constructor(){super()}async setRoadData(e,t){this.initRoadStatus=!1,this.dispatchEvent({type:"init-road-status",status:!1}),await lt(this.worker,"set_road_info",{roadData:e,facilities:t}),this.initRoadStatus=!0,this.dispatchEvent({type:"init-road-status",status:!0})}async getPath(e,t,n=""){return new Promise((r,i)=>{let o=()=>{console.log("initRoadStatus",this.initRoadStatus),lt(this.worker,"get_path",{start:e,end:t,type:n}).then(a=>{a?typeof a=="string"?i(a):r(a):i("no-path")})};if(this.initRoadStatus)o();else{let a=({status:l})=>{l&&(this.removeEventListener("init-road-status",a),o())};this.addEventListener("init-road-status",a)}})}getDirectionPath(e){return lt(this.worker,"get_direction_path",e)}async dispose(){lt(this.worker,"clear",""),this.worker.terminate()}};var Ir=g("three");function on(){return Kt(`var N1=Object.create;var Rf=Object.defineProperty;var O1=Object.getOwnPropertyDescriptor;var D1=Object.getOwnPropertyNames,fm=Object.getOwnPropertySymbols,F1=Object.getPrototypeOf,hm=Object.prototype.hasOwnProperty,U1=Object.prototype.propertyIsEnumerable;var If=(r,t,e)=>t in r?Rf(r,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[t]=e,Tl=(r,t)=>{for(var e in t||(t={}))hm.call(t,e)&&If(r,e,t[e]);if(fm)for(var e of fm(t))U1.call(t,e)&&If(r,e,t[e]);return r};var Jt=(r,t)=>()=>(t||r((t={exports:{}}).exports,t),t.exports);var B1=(r,t,e,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of D1(t))!hm.call(r,a)&&a!==e&&Rf(r,a,{get:()=>t[a],enumerable:!(o=O1(t,a))||o.enumerable});return r};var On=(r,t,e)=>(e=r!=null?N1(F1(r)):{},B1(t||!r||!r.__esModule?Rf(e,"default",{value:r,enumerable:!0}):e,r));var vi=(r,t,e)=>If(r,typeof t!="symbol"?t+"":t,e);var dm=Jt((lR,pm)=>{var Lf=class{constructor(){this.keys=new Set,this.queue=[]}sort(){this.queue.sort((t,e)=>t.priority-e.priority)}set(t,e){let o=Number(e);if(isNaN(o))throw new TypeError('"priority" must be a number');return this.keys.has(t)?this.queue.map(a=>(a.key===t&&Object.assign(a,{priority:o}),a)):(this.keys.add(t),this.queue.push({key:t,priority:o})),this.sort(),this.queue.length}next(){let t=this.queue.shift();return this.keys.delete(t.key),t}isEmpty(){return this.queue.length===0}has(t){return this.keys.has(t)}get(t){return this.queue.find(e=>e.key===t)}};pm.exports=Lf});var ym=Jt((cR,gm)=>{function mm(r,t){let e=new Map;for(let[o,a]of r)o!==t&&a instanceof Map?e.set(o,mm(a,t)):o!==t&&e.set(o,a);return e}gm.exports=mm});var xm=Jt((fR,_m)=>{function z1(r){let t=Number(r);return!(isNaN(t)||t<=0)}function vm(r){let t=new Map;return Object.keys(r).forEach(o=>{let a=r[o];if(a!==null&&typeof a=="object"&&!Array.isArray(a))return t.set(o,vm(a));if(!z1(a))throw new Error(\`Could not add node at key "\${o}", make sure it's a valid node\`,a);return t.set(o,Number(a))}),t}_m.exports=vm});var Sm=Jt((hR,Mm)=>{function Em(r){if(!(r instanceof Map))throw new Error(\`Invalid graph: Expected Map instead found \${typeof r}\`);r.forEach((t,e)=>{if(typeof t=="object"&&t instanceof Map){Em(t);return}if(typeof t!="number"||t<=0)throw new Error(\`Values must be numbers greater than 0. Found value \${t} at \${e}\`)})}Mm.exports=Em});var Am=Jt((pR,Tm)=>{var k1=dm(),G1=ym(),wm=xm(),bm=Sm(),Nf=class{constructor(t){t instanceof Map?(bm(t),this.graph=t):t?this.graph=wm(t):this.graph=new Map}addNode(t,e){let o;return e instanceof Map?(bm(e),o=e):o=wm(e),this.graph.set(t,o),this}addVertex(t,e){return this.addNode(t,e)}removeNode(t){return this.graph=G1(this.graph,t),this}path(t,e,o={}){if(!this.graph.size)return o.cost?{path:null,cost:0}:null;let a=new Set,l=new k1,f=new Map,h=[],p=0,d=[];if(o.avoid&&(d=[].concat(o.avoid)),d.includes(t))throw new Error(\`Starting node (\${t}) cannot be avoided\`);if(d.includes(e))throw new Error(\`Ending node (\${e}) cannot be avoided\`);for(l.set(t,0);!l.isEmpty();){let g=l.next();if(g.key===e){p=g.priority;let y=g.key;for(;f.has(y);)h.push(y),y=f.get(y);break}a.add(g.key),(this.graph.get(g.key)||new Map).forEach((y,M)=>{if(a.has(M)||d.includes(M))return null;if(!l.has(M))return f.set(M,g.key),l.set(M,g.priority+y);let w=l.get(M).priority,T=g.priority+y;return T<w?(f.set(M,g.key),l.set(M,T)):null})}return h.length?(o.trim?h.shift():h=h.concat([t]),o.reverse||(h=h.reverse()),o.cost?{path:h,cost:p}:h):o.cost?{path:null,cost:0}:null}shortestPath(...t){return this.path(...t)}};Tm.exports=Nf});var yc=Jt((MR,y0)=>{"use strict";var g0=Object.getOwnPropertySymbols,Vb=Object.prototype.hasOwnProperty,Hb=Object.prototype.propertyIsEnumerable;function Wb(r){if(r==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(r)}function qb(){try{if(!Object.assign)return!1;var r=new String("abc");if(r[5]="de",Object.getOwnPropertyNames(r)[0]==="5")return!1;for(var t={},e=0;e<10;e++)t["_"+String.fromCharCode(e)]=e;var o=Object.getOwnPropertyNames(t).map(function(l){return t[l]});if(o.join("")!=="0123456789")return!1;var a={};return"abcdefghijklmnopqrst".split("").forEach(function(l){a[l]=l}),Object.keys(Object.assign({},a)).join("")==="abcdefghijklmnopqrst"}catch(l){return!1}}y0.exports=qb()?Object.assign:function(r,t){for(var e,o=Wb(r),a,l=1;l<arguments.length;l++){e=Object(arguments[l]);for(var f in e)Vb.call(e,f)&&(o[f]=e[f]);if(g0){a=g0(e);for(var h=0;h<a.length;h++)Hb.call(e,a[h])&&(o[a[h]]=e[a[h]])}}return o}});var op=Jt((rp,ip)=>{(function(r,t){typeof rp=="object"&&typeof ip!="undefined"?ip.exports=t():typeof define=="function"&&define.amd?define(t):(r=r||self).RBush=t()})(rp,function(){"use strict";function r(x,v,C,S,O){(function F(G,z,L,D,q){for(;D>L;){if(D-L>600){var nt=D-L+1,k=z-L+1,xt=Math.log(nt),X=.5*Math.exp(2*xt/3),it=.5*Math.sqrt(xt*X*(nt-X)/nt)*(k-nt/2<0?-1:1),vt=Math.max(L,Math.floor(z-k*X/nt+it)),pt=Math.min(D,Math.floor(z+(nt-k)*X/nt+it));F(G,z,vt,pt,q)}var et=G[z],ot=L,V=D;for(t(G,L,z),q(G[D],et)>0&&t(G,L,D);ot<V;){for(t(G,ot,V),ot++,V--;q(G[ot],et)<0;)ot++;for(;q(G[V],et)>0;)V--}q(G[L],et)===0?t(G,L,V):t(G,++V,D),V<=z&&(L=V+1),z<=V&&(D=V-1)}})(x,v,C||0,S||x.length-1,O||e)}function t(x,v,C){var S=x[v];x[v]=x[C],x[C]=S}function e(x,v){return x<v?-1:x>v?1:0}var o=function(x){x===void 0&&(x=9),this._maxEntries=Math.max(4,x),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()};function a(x,v,C){if(!C)return v.indexOf(x);for(var S=0;S<v.length;S++)if(C(x,v[S]))return S;return-1}function l(x,v){f(x,0,x.children.length,v,x)}function f(x,v,C,S,O){O||(O=w(null)),O.minX=1/0,O.minY=1/0,O.maxX=-1/0,O.maxY=-1/0;for(var F=v;F<C;F++){var G=x.children[F];h(O,x.leaf?S(G):G)}return O}function h(x,v){return x.minX=Math.min(x.minX,v.minX),x.minY=Math.min(x.minY,v.minY),x.maxX=Math.max(x.maxX,v.maxX),x.maxY=Math.max(x.maxY,v.maxY),x}function p(x,v){return x.minX-v.minX}function d(x,v){return x.minY-v.minY}function g(x){return(x.maxX-x.minX)*(x.maxY-x.minY)}function _(x){return x.maxX-x.minX+(x.maxY-x.minY)}function y(x,v){return x.minX<=v.minX&&x.minY<=v.minY&&v.maxX<=x.maxX&&v.maxY<=x.maxY}function M(x,v){return v.minX<=x.maxX&&v.minY<=x.maxY&&v.maxX>=x.minX&&v.maxY>=x.minY}function w(x){return{children:x,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function T(x,v,C,S,O){for(var F=[v,C];F.length;)if(!((C=F.pop())-(v=F.pop())<=S)){var G=v+Math.ceil((C-v)/S/2)*S;r(x,G,v,C,O),F.push(v,G,G,C)}}return o.prototype.all=function(){return this._all(this.data,[])},o.prototype.search=function(x){var v=this.data,C=[];if(!M(x,v))return C;for(var S=this.toBBox,O=[];v;){for(var F=0;F<v.children.length;F++){var G=v.children[F],z=v.leaf?S(G):G;M(x,z)&&(v.leaf?C.push(G):y(x,z)?this._all(G,C):O.push(G))}v=O.pop()}return C},o.prototype.collides=function(x){var v=this.data;if(!M(x,v))return!1;for(var C=[];v;){for(var S=0;S<v.children.length;S++){var O=v.children[S],F=v.leaf?this.toBBox(O):O;if(M(x,F)){if(v.leaf||y(x,F))return!0;C.push(O)}}v=C.pop()}return!1},o.prototype.load=function(x){if(!x||!x.length)return this;if(x.length<this._minEntries){for(var v=0;v<x.length;v++)this.insert(x[v]);return this}var C=this._build(x.slice(),0,x.length-1,0);if(this.data.children.length)if(this.data.height===C.height)this._splitRoot(this.data,C);else{if(this.data.height<C.height){var S=this.data;this.data=C,C=S}this._insert(C,this.data.height-C.height-1,!0)}else this.data=C;return this},o.prototype.insert=function(x){return x&&this._insert(x,this.data.height-1),this},o.prototype.clear=function(){return this.data=w([]),this},o.prototype.remove=function(x,v){if(!x)return this;for(var C,S,O,F=this.data,G=this.toBBox(x),z=[],L=[];F||z.length;){if(F||(F=z.pop(),S=z[z.length-1],C=L.pop(),O=!0),F.leaf){var D=a(x,F.children,v);if(D!==-1)return F.children.splice(D,1),z.push(F),this._condense(z),this}O||F.leaf||!y(F,G)?S?(C++,F=S.children[C],O=!1):F=null:(z.push(F),L.push(C),C=0,S=F,F=F.children[0])}return this},o.prototype.toBBox=function(x){return x},o.prototype.compareMinX=function(x,v){return x.minX-v.minX},o.prototype.compareMinY=function(x,v){return x.minY-v.minY},o.prototype.toJSON=function(){return this.data},o.prototype.fromJSON=function(x){return this.data=x,this},o.prototype._all=function(x,v){for(var C=[];x;)x.leaf?v.push.apply(v,x.children):C.push.apply(C,x.children),x=C.pop();return v},o.prototype._build=function(x,v,C,S){var O,F=C-v+1,G=this._maxEntries;if(F<=G)return l(O=w(x.slice(v,C+1)),this.toBBox),O;S||(S=Math.ceil(Math.log(F)/Math.log(G)),G=Math.ceil(F/Math.pow(G,S-1))),(O=w([])).leaf=!1,O.height=S;var z=Math.ceil(F/G),L=z*Math.ceil(Math.sqrt(G));T(x,v,C,L,this.compareMinX);for(var D=v;D<=C;D+=L){var q=Math.min(D+L-1,C);T(x,D,q,z,this.compareMinY);for(var nt=D;nt<=q;nt+=z){var k=Math.min(nt+z-1,q);O.children.push(this._build(x,nt,k,S-1))}}return l(O,this.toBBox),O},o.prototype._chooseSubtree=function(x,v,C,S){for(;S.push(v),!v.leaf&&S.length-1!==C;){for(var O=1/0,F=1/0,G=void 0,z=0;z<v.children.length;z++){var L=v.children[z],D=g(L),q=(nt=x,k=L,(Math.max(k.maxX,nt.maxX)-Math.min(k.minX,nt.minX))*(Math.max(k.maxY,nt.maxY)-Math.min(k.minY,nt.minY))-D);q<F?(F=q,O=D<O?D:O,G=L):q===F&&D<O&&(O=D,G=L)}v=G||v.children[0]}var nt,k;return v},o.prototype._insert=function(x,v,C){var S=C?x:this.toBBox(x),O=[],F=this._chooseSubtree(S,this.data,v,O);for(F.children.push(x),h(F,S);v>=0&&O[v].children.length>this._maxEntries;)this._split(O,v),v--;this._adjustParentBBoxes(S,O,v)},o.prototype._split=function(x,v){var C=x[v],S=C.children.length,O=this._minEntries;this._chooseSplitAxis(C,O,S);var F=this._chooseSplitIndex(C,O,S),G=w(C.children.splice(F,C.children.length-F));G.height=C.height,G.leaf=C.leaf,l(C,this.toBBox),l(G,this.toBBox),v?x[v-1].children.push(G):this._splitRoot(C,G)},o.prototype._splitRoot=function(x,v){this.data=w([x,v]),this.data.height=x.height+1,this.data.leaf=!1,l(this.data,this.toBBox)},o.prototype._chooseSplitIndex=function(x,v,C){for(var S,O,F,G,z,L,D,q=1/0,nt=1/0,k=v;k<=C-v;k++){var xt=f(x,0,k,this.toBBox),X=f(x,k,C,this.toBBox),it=(O=xt,F=X,G=void 0,z=void 0,L=void 0,D=void 0,G=Math.max(O.minX,F.minX),z=Math.max(O.minY,F.minY),L=Math.min(O.maxX,F.maxX),D=Math.min(O.maxY,F.maxY),Math.max(0,L-G)*Math.max(0,D-z)),vt=g(xt)+g(X);it<q?(q=it,S=k,nt=vt<nt?vt:nt):it===q&&vt<nt&&(nt=vt,S=k)}return S||C-v},o.prototype._chooseSplitAxis=function(x,v,C){var S=x.leaf?this.compareMinX:p,O=x.leaf?this.compareMinY:d;this._allDistMargin(x,v,C,S)<this._allDistMargin(x,v,C,O)&&x.children.sort(S)},o.prototype._allDistMargin=function(x,v,C,S){x.children.sort(S);for(var O=this.toBBox,F=f(x,0,v,O),G=f(x,C-v,C,O),z=_(F)+_(G),L=v;L<C-v;L++){var D=x.children[L];h(F,x.leaf?O(D):D),z+=_(F)}for(var q=C-v-1;q>=v;q--){var nt=x.children[q];h(G,x.leaf?O(nt):nt),z+=_(G)}return z},o.prototype._adjustParentBBoxes=function(x,v,C){for(var S=C;S>=0;S--)h(v[S],x)},o.prototype._condense=function(x){for(var v=x.length-1,C=void 0;v>=0;v--)x[v].children.length===0?v>0?(C=x[v-1].children).splice(C.indexOf(x[v]),1):this.clear():l(x[v],this.toBBox)},o})});var v0=Jt((sp,ap)=>{(function(r,t){typeof sp=="object"&&typeof ap!="undefined"?ap.exports=t():typeof define=="function"&&define.amd?define(t):(r=r||self,r.TinyQueue=t())})(sp,function(){"use strict";var r=function(o,a){if(o===void 0&&(o=[]),a===void 0&&(a=t),this.data=o,this.length=this.data.length,this.compare=a,this.length>0)for(var l=(this.length>>1)-1;l>=0;l--)this._down(l)};r.prototype.push=function(o){this.data.push(o),this.length++,this._up(this.length-1)},r.prototype.pop=function(){if(this.length!==0){var o=this.data[0],a=this.data.pop();return this.length--,this.length>0&&(this.data[0]=a,this._down(0)),o}},r.prototype.peek=function(){return this.data[0]},r.prototype._up=function(o){for(var a=this,l=a.data,f=a.compare,h=l[o];o>0;){var p=o-1>>1,d=l[p];if(f(h,d)>=0)break;l[o]=d,o=p}l[o]=h},r.prototype._down=function(o){for(var a=this,l=a.data,f=a.compare,h=this.length>>1,p=l[o];o<h;){var d=(o<<1)+1,g=l[d],_=d+1;if(_<this.length&&f(l[_],g)<0&&(d=_,g=l[_]),f(g,p)>=0)break;l[o]=g,o=d}l[o]=p};function t(e,o){return e<o?-1:e>o?1:0}return r})});var x0=Jt((CR,_0)=>{_0.exports=function(t,e,o,a){var l=t[0],f=t[1],h=!1;o===void 0&&(o=0),a===void 0&&(a=e.length);for(var p=(a-o)/2,d=0,g=p-1;d<p;g=d++){var _=e[o+d*2+0],y=e[o+d*2+1],M=e[o+g*2+0],w=e[o+g*2+1],T=y>f!=w>f&&l<(M-_)*(f-y)/(w-y)+_;T&&(h=!h)}return h}});var M0=Jt((PR,E0)=>{E0.exports=function(t,e,o,a){var l=t[0],f=t[1],h=!1;o===void 0&&(o=0),a===void 0&&(a=e.length);for(var p=a-o,d=0,g=p-1;d<p;g=d++){var _=e[d+o][0],y=e[d+o][1],M=e[g+o][0],w=e[g+o][1],T=y>f!=w>f&&l<(M-_)*(f-y)/(w-y)+_;T&&(h=!h)}return h}});var b0=Jt((IR,xc)=>{var S0=x0(),w0=M0();xc.exports=function(t,e,o,a){return e.length>0&&Array.isArray(e[0])?w0(t,e,o,a):S0(t,e,o,a)};xc.exports.nested=w0;xc.exports.flat=S0});var A0=Jt((Ec,T0)=>{(function(r,t){typeof Ec=="object"&&typeof T0!="undefined"?t(Ec):typeof define=="function"&&define.amd?define(["exports"],t):t((r=r||self).predicates={})})(Ec,function(r){"use strict";let e=33306690738754706e-32;function o(M,w,T,x,v){let C,S,O,F,G=w[0],z=x[0],L=0,D=0;z>G==z>-G?(C=G,G=w[++L]):(C=z,z=x[++D]);let q=0;if(L<M&&D<T)for(z>G==z>-G?(O=C-((S=G+C)-G),G=w[++L]):(O=C-((S=z+C)-z),z=x[++D]),C=S,O!==0&&(v[q++]=O);L<M&&D<T;)z>G==z>-G?(O=C-((S=C+G)-(F=S-C))+(G-F),G=w[++L]):(O=C-((S=C+z)-(F=S-C))+(z-F),z=x[++D]),C=S,O!==0&&(v[q++]=O);for(;L<M;)O=C-((S=C+G)-(F=S-C))+(G-F),G=w[++L],C=S,O!==0&&(v[q++]=O);for(;D<T;)O=C-((S=C+z)-(F=S-C))+(z-F),z=x[++D],C=S,O!==0&&(v[q++]=O);return C===0&&q!==0||(v[q++]=C),q}function a(M){return new Float64Array(M)}let l=33306690738754716e-32,f=22204460492503146e-32,h=11093356479670487e-47,p=a(4),d=a(8),g=a(12),_=a(16),y=a(4);r.orient2d=function(M,w,T,x,v,C){let S=(w-C)*(T-v),O=(M-v)*(x-C),F=S-O;if(S===0||O===0||S>0!=O>0)return F;let G=Math.abs(S+O);return Math.abs(F)>=l*G?F:-function(z,L,D,q,nt,k,xt){let X,it,vt,pt,et,ot,V,K,at,Tt,dt,Ct,Yt,Wt,Nt,ne,Pt,Xt,tt=z-nt,nn=D-nt,Gt=L-k,te=q-k;et=(Nt=(K=tt-(V=(ot=134217729*tt)-(ot-tt)))*(Tt=te-(at=(ot=134217729*te)-(ot-te)))-((Wt=tt*te)-V*at-K*at-V*Tt))-(dt=Nt-(Pt=(K=Gt-(V=(ot=134217729*Gt)-(ot-Gt)))*(Tt=nn-(at=(ot=134217729*nn)-(ot-nn)))-((ne=Gt*nn)-V*at-K*at-V*Tt))),p[0]=Nt-(dt+et)+(et-Pt),et=(Yt=Wt-((Ct=Wt+dt)-(et=Ct-Wt))+(dt-et))-(dt=Yt-ne),p[1]=Yt-(dt+et)+(et-ne),et=(Xt=Ct+dt)-Ct,p[2]=Ct-(Xt-et)+(dt-et),p[3]=Xt;let qt=function(W,J){let I=J[0];for(let P=1;P<W;P++)I+=J[P];return I}(4,p),$=f*xt;if(qt>=$||-qt>=$||(X=z-(tt+(et=z-tt))+(et-nt),vt=D-(nn+(et=D-nn))+(et-nt),it=L-(Gt+(et=L-Gt))+(et-k),pt=q-(te+(et=q-te))+(et-k),X===0&&it===0&&vt===0&&pt===0)||($=h*xt+e*Math.abs(qt),(qt+=tt*pt+te*X-(Gt*vt+nn*it))>=$||-qt>=$))return qt;et=(Nt=(K=X-(V=(ot=134217729*X)-(ot-X)))*(Tt=te-(at=(ot=134217729*te)-(ot-te)))-((Wt=X*te)-V*at-K*at-V*Tt))-(dt=Nt-(Pt=(K=it-(V=(ot=134217729*it)-(ot-it)))*(Tt=nn-(at=(ot=134217729*nn)-(ot-nn)))-((ne=it*nn)-V*at-K*at-V*Tt))),y[0]=Nt-(dt+et)+(et-Pt),et=(Yt=Wt-((Ct=Wt+dt)-(et=Ct-Wt))+(dt-et))-(dt=Yt-ne),y[1]=Yt-(dt+et)+(et-ne),et=(Xt=Ct+dt)-Ct,y[2]=Ct-(Xt-et)+(dt-et),y[3]=Xt;let N=o(4,p,4,y,d);et=(Nt=(K=tt-(V=(ot=134217729*tt)-(ot-tt)))*(Tt=pt-(at=(ot=134217729*pt)-(ot-pt)))-((Wt=tt*pt)-V*at-K*at-V*Tt))-(dt=Nt-(Pt=(K=Gt-(V=(ot=134217729*Gt)-(ot-Gt)))*(Tt=vt-(at=(ot=134217729*vt)-(ot-vt)))-((ne=Gt*vt)-V*at-K*at-V*Tt))),y[0]=Nt-(dt+et)+(et-Pt),et=(Yt=Wt-((Ct=Wt+dt)-(et=Ct-Wt))+(dt-et))-(dt=Yt-ne),y[1]=Yt-(dt+et)+(et-ne),et=(Xt=Ct+dt)-Ct,y[2]=Ct-(Xt-et)+(dt-et),y[3]=Xt;let b=o(N,d,4,y,g);et=(Nt=(K=X-(V=(ot=134217729*X)-(ot-X)))*(Tt=pt-(at=(ot=134217729*pt)-(ot-pt)))-((Wt=X*pt)-V*at-K*at-V*Tt))-(dt=Nt-(Pt=(K=it-(V=(ot=134217729*it)-(ot-it)))*(Tt=vt-(at=(ot=134217729*vt)-(ot-vt)))-((ne=it*vt)-V*at-K*at-V*Tt))),y[0]=Nt-(dt+et)+(et-Pt),et=(Yt=Wt-((Ct=Wt+dt)-(et=Ct-Wt))+(dt-et))-(dt=Yt-ne),y[1]=Yt-(dt+et)+(et-ne),et=(Xt=Ct+dt)-Ct,y[2]=Ct-(Xt-et)+(dt-et),y[3]=Xt;let R=o(b,g,4,y,_);return _[R-1]}(M,w,T,x,v,C,G)},r.orient2dfast=function(M,w,T,x,v,C){return(w-C)*(T-v)-(M-v)*(x-C)},Object.defineProperty(r,"__esModule",{value:!0})})});var N0=Jt((RR,fp)=>{"use strict";var C0=op(),Sc=v0(),Yb=b0(),Zb=A0().orient2d;Sc.default&&(Sc=Sc.default);fp.exports=L0;fp.exports.default=L0;function L0(r,t,e){t=Math.max(0,t===void 0?2:t),e=e||0;var o=Qb(r),a=new C0(16);a.toBBox=function(C){return{minX:C[0],minY:C[1],maxX:C[0],maxY:C[1]}},a.compareMinX=function(C,S){return C[0]-S[0]},a.compareMinY=function(C,S){return C[1]-S[1]},a.load(r);for(var l=[],f=0,h;f<o.length;f++){var p=o[f];a.remove(p),h=R0(p,h),l.push(h)}var d=new C0(16);for(f=0;f<l.length;f++)d.insert(up(l[f]));for(var g=t*t,_=e*e;l.length;){var y=l.shift(),M=y.p,w=y.next.p,T=lp(M,w);if(!(T<_)){var x=T/g;p=Jb(a,y.prev.p,M,w,y.next.next.p,x,d),p&&Math.min(lp(p,M),lp(p,w))<=x&&(l.push(y),l.push(R0(p,y)),a.remove(p),d.remove(y),d.insert(up(y)),d.insert(up(y.next)))}}y=h;var v=[];do v.push(y.p),y=y.next;while(y!==h);return v.push(y.p),v}function Jb(r,t,e,o,a,l,f){for(var h=new Sc([],$b),p=r.data;p;){for(var d=0;d<p.children.length;d++){var g=p.children[d],_=p.leaf?cp(g,e,o):Kb(e,o,g);_>l||h.push({node:g,dist:_})}for(;h.length&&!h.peek().node.children;){var y=h.pop(),M=y.node,w=cp(M,t,e),T=cp(M,o,a);if(y.dist<w&&y.dist<T&&I0(e,M,f)&&I0(o,M,f))return M}p=h.pop(),p&&(p=p.node)}return null}function $b(r,t){return r.dist-t.dist}function Kb(r,t,e){if(P0(r,e)||P0(t,e))return 0;var o=Mc(r[0],r[1],t[0],t[1],e.minX,e.minY,e.maxX,e.minY);if(o===0)return 0;var a=Mc(r[0],r[1],t[0],t[1],e.minX,e.minY,e.minX,e.maxY);if(a===0)return 0;var l=Mc(r[0],r[1],t[0],t[1],e.maxX,e.minY,e.maxX,e.maxY);if(l===0)return 0;var f=Mc(r[0],r[1],t[0],t[1],e.minX,e.maxY,e.maxX,e.maxY);return f===0?0:Math.min(o,a,l,f)}function P0(r,t){return r[0]>=t.minX&&r[0]<=t.maxX&&r[1]>=t.minY&&r[1]<=t.maxY}function I0(r,t,e){for(var o=Math.min(r[0],t[0]),a=Math.min(r[1],t[1]),l=Math.max(r[0],t[0]),f=Math.max(r[1],t[1]),h=e.search({minX:o,minY:a,maxX:l,maxY:f}),p=0;p<h.length;p++)if(jb(h[p].p,h[p].next.p,r,t))return!1;return!0}function Ja(r,t,e){return Zb(r[0],r[1],t[0],t[1],e[0],e[1])}function jb(r,t,e,o){return r!==o&&t!==e&&Ja(r,t,e)>0!=Ja(r,t,o)>0&&Ja(e,o,r)>0!=Ja(e,o,t)>0}function up(r){var t=r.p,e=r.next.p;return r.minX=Math.min(t[0],e[0]),r.minY=Math.min(t[1],e[1]),r.maxX=Math.max(t[0],e[0]),r.maxY=Math.max(t[1],e[1]),r}function Qb(r){for(var t=r[0],e=r[0],o=r[0],a=r[0],l=0;l<r.length;l++){var f=r[l];f[0]<t[0]&&(t=f),f[0]>o[0]&&(o=f),f[1]<e[1]&&(e=f),f[1]>a[1]&&(a=f)}var h=[t,e,o,a],p=h.slice();for(l=0;l<r.length;l++)Yb(r[l],h)||p.push(r[l]);return eT(p)}function R0(r,t){var e={p:r,prev:null,next:null,minX:0,minY:0,maxX:0,maxY:0};return t?(e.next=t.next,e.prev=t,t.next.prev=e,t.next=e):(e.prev=e,e.next=e),e}function lp(r,t){var e=r[0]-t[0],o=r[1]-t[1];return e*e+o*o}function cp(r,t,e){var o=t[0],a=t[1],l=e[0]-o,f=e[1]-a;if(l!==0||f!==0){var h=((r[0]-o)*l+(r[1]-a)*f)/(l*l+f*f);h>1?(o=e[0],a=e[1]):h>0&&(o+=l*h,a+=f*h)}return l=r[0]-o,f=r[1]-a,l*l+f*f}function Mc(r,t,e,o,a,l,f,h){var p=e-r,d=o-t,g=f-a,_=h-l,y=r-a,M=t-l,w=p*p+d*d,T=p*g+d*_,x=g*g+_*_,v=p*y+d*M,C=g*y+_*M,S=w*x-T*T,O,F,G,z,L=S,D=S;S===0?(F=0,L=1,z=C,D=x):(F=T*C-x*v,z=w*C-T*v,F<0?(F=0,z=C,D=x):F>L&&(F=L,z=C+T,D=x)),z<0?(z=0,-v<0?F=0:-v>w?F=L:(F=-v,L=w)):z>D&&(z=D,-v+T<0?F=0:-v+T>w?F=L:(F=-v+T,L=w)),O=F===0?0:F/L,G=z===0?0:z/D;var q=(1-O)*r+O*e,nt=(1-O)*t+O*o,k=(1-G)*a+G*f,xt=(1-G)*l+G*h,X=k-q,it=xt-nt;return X*X+it*it}function tT(r,t){return r[0]===t[0]?r[1]-t[1]:r[0]-t[0]}function eT(r){r.sort(tT);for(var t=[],e=0;e<r.length;e++){for(;t.length>=2&&Ja(t[t.length-2],t[t.length-1],r[e])<=0;)t.pop();t.push(r[e])}for(var o=[],a=r.length-1;a>=0;a--){for(;o.length>=2&&Ja(o[o.length-2],o[o.length-1],r[a])<=0;)o.pop();o.push(r[a])}return o.pop(),t.pop(),t.concat(o)}});var z0=Jt((pp,dp)=>{(function(r,t){typeof pp=="object"&&typeof dp!="undefined"?dp.exports=t():typeof define=="function"&&define.amd?define(t):r.quickselect=t()})(pp,function(){"use strict";function r(a,l,f,h,p){t(a,l,f||0,h||a.length-1,p||o)}function t(a,l,f,h,p){for(;h>f;){if(h-f>600){var d=h-f+1,g=l-f+1,_=Math.log(d),y=.5*Math.exp(2*_/3),M=.5*Math.sqrt(_*y*(d-y)/d)*(g-d/2<0?-1:1),w=Math.max(f,Math.floor(l-g*y/d+M)),T=Math.min(h,Math.floor(l+(d-g)*y/d+M));t(a,l,w,T,p)}var x=a[l],v=f,C=h;for(e(a,f,l),p(a[h],x)>0&&e(a,f,h);v<C;){for(e(a,v,C),v++,C--;p(a[v],x)<0;)v++;for(;p(a[C],x)>0;)C--}p(a[f],x)===0?e(a,f,C):(C++,e(a,C,h)),C<=l&&(f=C+1),l<=C&&(h=C-1)}}function e(a,l,f){var h=a[l];a[l]=a[f],a[f]=h}function o(a,l){return a<l?-1:a>l?1:0}return r})});var vp=Jt((r2,yp)=>{"use strict";yp.exports=qu;yp.exports.default=qu;var dT=z0();function qu(r,t){if(!(this instanceof qu))return new qu(r,t);this._maxEntries=Math.max(4,r||9),this._minEntries=Math.max(2,Math.ceil(this._maxEntries*.4)),t&&this._initFormat(t),this.clear()}qu.prototype={all:function(){return this._all(this.data,[])},search:function(r){var t=this.data,e=[],o=this.toBBox;if(!bc(r,t))return e;for(var a=[],l,f,h,p;t;){for(l=0,f=t.children.length;l<f;l++)h=t.children[l],p=t.leaf?o(h):h,bc(r,p)&&(t.leaf?e.push(h):gp(r,p)?this._all(h,e):a.push(h));t=a.pop()}return e},collides:function(r){var t=this.data,e=this.toBBox;if(!bc(r,t))return!1;for(var o=[],a,l,f,h;t;){for(a=0,l=t.children.length;a<l;a++)if(f=t.children[a],h=t.leaf?e(f):f,bc(r,h)){if(t.leaf||gp(r,h))return!0;o.push(f)}t=o.pop()}return!1},load:function(r){if(!(r&&r.length))return this;if(r.length<this._minEntries){for(var t=0,e=r.length;t<e;t++)this.insert(r[t]);return this}var o=this._build(r.slice(),0,r.length-1,0);if(!this.data.children.length)this.data=o;else if(this.data.height===o.height)this._splitRoot(this.data,o);else{if(this.data.height<o.height){var a=this.data;this.data=o,o=a}this._insert(o,this.data.height-o.height-1,!0)}return this},insert:function(r){return r&&this._insert(r,this.data.height-1),this},clear:function(){return this.data=ja([]),this},remove:function(r,t){if(!r)return this;for(var e=this.data,o=this.toBBox(r),a=[],l=[],f,h,p,d;e||a.length;){if(e||(e=a.pop(),h=a[a.length-1],f=l.pop(),d=!0),e.leaf&&(p=mT(r,e.children,t),p!==-1))return e.children.splice(p,1),a.push(e),this._condense(a),this;!d&&!e.leaf&&gp(e,o)?(a.push(e),l.push(f),f=0,h=e,e=e.children[0]):h?(f++,e=h.children[f],d=!1):e=null}return this},toBBox:function(r){return r},compareMinX:k0,compareMinY:G0,toJSON:function(){return this.data},fromJSON:function(r){return this.data=r,this},_all:function(r,t){for(var e=[];r;)r.leaf?t.push.apply(t,r.children):e.push.apply(e,r.children),r=e.pop();return t},_build:function(r,t,e,o){var a=e-t+1,l=this._maxEntries,f;if(a<=l)return f=ja(r.slice(t,e+1)),Ka(f,this.toBBox),f;o||(o=Math.ceil(Math.log(a)/Math.log(l)),l=Math.ceil(a/Math.pow(l,o-1))),f=ja([]),f.leaf=!1,f.height=o;var h=Math.ceil(a/l),p=h*Math.ceil(Math.sqrt(l)),d,g,_,y;for(V0(r,t,e,p,this.compareMinX),d=t;d<=e;d+=p)for(_=Math.min(d+p-1,e),V0(r,d,_,h,this.compareMinY),g=d;g<=_;g+=h)y=Math.min(g+h-1,_),f.children.push(this._build(r,g,y,o-1));return Ka(f,this.toBBox),f},_chooseSubtree:function(r,t,e,o){for(var a,l,f,h,p,d,g,_;o.push(t),!(t.leaf||o.length-1===e);){for(g=_=1/0,a=0,l=t.children.length;a<l;a++)f=t.children[a],p=mp(f),d=gT(r,f)-p,d<_?(_=d,g=p<g?p:g,h=f):d===_&&p<g&&(g=p,h=f);t=h||t.children[0]}return t},_insert:function(r,t,e){var o=this.toBBox,a=e?r:o(r),l=[],f=this._chooseSubtree(a,this.data,t,l);for(f.children.push(r),Wu(f,a);t>=0&&l[t].children.length>this._maxEntries;)this._split(l,t),t--;this._adjustParentBBoxes(a,l,t)},_split:function(r,t){var e=r[t],o=e.children.length,a=this._minEntries;this._chooseSplitAxis(e,a,o);var l=this._chooseSplitIndex(e,a,o),f=ja(e.children.splice(l,e.children.length-l));f.height=e.height,f.leaf=e.leaf,Ka(e,this.toBBox),Ka(f,this.toBBox),t?r[t-1].children.push(f):this._splitRoot(e,f)},_splitRoot:function(r,t){this.data=ja([r,t]),this.data.height=r.height+1,this.data.leaf=!1,Ka(this.data,this.toBBox)},_chooseSplitIndex:function(r,t,e){var o,a,l,f,h,p,d,g;for(p=d=1/0,o=t;o<=e-t;o++)a=Hu(r,0,o,this.toBBox),l=Hu(r,o,e,this.toBBox),f=yT(a,l),h=mp(a)+mp(l),f<p?(p=f,g=o,d=h<d?h:d):f===p&&h<d&&(d=h,g=o);return g},_chooseSplitAxis:function(r,t,e){var o=r.leaf?this.compareMinX:k0,a=r.leaf?this.compareMinY:G0,l=this._allDistMargin(r,t,e,o),f=this._allDistMargin(r,t,e,a);l<f&&r.children.sort(o)},_allDistMargin:function(r,t,e,o){r.children.sort(o);var a=this.toBBox,l=Hu(r,0,t,a),f=Hu(r,e-t,e,a),h=wc(l)+wc(f),p,d;for(p=t;p<e-t;p++)d=r.children[p],Wu(l,r.leaf?a(d):d),h+=wc(l);for(p=e-t-1;p>=t;p--)d=r.children[p],Wu(f,r.leaf?a(d):d),h+=wc(f);return h},_adjustParentBBoxes:function(r,t,e){for(var o=e;o>=0;o--)Wu(t[o],r)},_condense:function(r){for(var t=r.length-1,e;t>=0;t--)r[t].children.length===0?t>0?(e=r[t-1].children,e.splice(e.indexOf(r[t]),1)):this.clear():Ka(r[t],this.toBBox)},_initFormat:function(r){var t=["return a"," - b",";"];this.compareMinX=new Function("a","b",t.join(r[0])),this.compareMinY=new Function("a","b",t.join(r[1])),this.toBBox=new Function("a","return {minX: a"+r[0]+", minY: a"+r[1]+", maxX: a"+r[2]+", maxY: a"+r[3]+"};")}};function mT(r,t,e){if(!e)return t.indexOf(r);for(var o=0;o<t.length;o++)if(e(r,t[o]))return o;return-1}function Ka(r,t){Hu(r,0,r.children.length,t,r)}function Hu(r,t,e,o,a){a||(a=ja(null)),a.minX=1/0,a.minY=1/0,a.maxX=-1/0,a.maxY=-1/0;for(var l=t,f;l<e;l++)f=r.children[l],Wu(a,r.leaf?o(f):f);return a}function Wu(r,t){return r.minX=Math.min(r.minX,t.minX),r.minY=Math.min(r.minY,t.minY),r.maxX=Math.max(r.maxX,t.maxX),r.maxY=Math.max(r.maxY,t.maxY),r}function k0(r,t){return r.minX-t.minX}function G0(r,t){return r.minY-t.minY}function mp(r){return(r.maxX-r.minX)*(r.maxY-r.minY)}function wc(r){return r.maxX-r.minX+(r.maxY-r.minY)}function gT(r,t){return(Math.max(t.maxX,r.maxX)-Math.min(t.minX,r.minX))*(Math.max(t.maxY,r.maxY)-Math.min(t.minY,r.minY))}function yT(r,t){var e=Math.max(r.minX,t.minX),o=Math.max(r.minY,t.minY),a=Math.min(r.maxX,t.maxX),l=Math.min(r.maxY,t.maxY);return Math.max(0,a-e)*Math.max(0,l-o)}function gp(r,t){return r.minX<=t.minX&&r.minY<=t.minY&&t.maxX<=r.maxX&&t.maxY<=r.maxY}function bc(r,t){return t.minX<=r.maxX&&t.minY<=r.maxY&&t.maxX>=r.minX&&t.maxY>=r.minY}function ja(r){return{children:r,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function V0(r,t,e,o,a){for(var l=[t,e],f;l.length;)e=l.pop(),t=l.pop(),!(e-t<=o)&&(f=t+Math.ceil((e-t)/o/2)*o,dT(r,f,t,e,a),l.push(t,f,f,e))}});var Z0=Jt((gO,wp)=>{"use strict";wp.exports=Pc;wp.exports.default=Pc;function Pc(r,t,e){e=e||2;var o=t&&t.length,a=o?t[0]*e:r.length,l=q0(r,0,a,e,!0),f=[];if(!l||l.next===l.prev)return f;var h,p,d,g,_,y,M;if(o&&(l=AT(r,t,l,e)),r.length>80*e){h=d=r[0],p=g=r[1];for(var w=e;w<a;w+=e)_=r[w],y=r[w+1],_<h&&(h=_),y<p&&(p=y),_>d&&(d=_),y>g&&(g=y);M=Math.max(d-h,g-p),M=M!==0?32767/M:0}return Zu(l,f,e,h,p,M,0),f}function q0(r,t,e,o,a){var l,f;if(a===Sp(r,t,e,o)>0)for(l=t;l<e;l+=o)f=W0(l,r[l],r[l+1],f);else for(l=e-o;l>=t;l-=o)f=W0(l,r[l],r[l+1],f);return f&&Ic(f,f.next)&&($u(f),f=f.next),f}function js(r,t){if(!r)return r;t||(t=r);var e=r,o;do if(o=!1,!e.steiner&&(Ic(e,e.next)||Un(e.prev,e,e.next)===0)){if($u(e),e=t=e.prev,e===e.next)break;o=!0}else e=e.next;while(o||e!==t);return t}function Zu(r,t,e,o,a,l,f){if(r){!f&&l&<(r,o,a,l);for(var h=r,p,d;r.prev!==r.next;){if(p=r.prev,d=r.next,l?wT(r,o,a,l):ST(r)){t.push(p.i/e|0),t.push(r.i/e|0),t.push(d.i/e|0),$u(r),r=d.next,h=d.next;continue}if(r=d,r===h){f?f===1?(r=bT(js(r),t,e),Zu(r,t,e,o,a,l,2)):f===2&&TT(r,t,e,o,a,l):Zu(js(r),t,e,o,a,l,1);break}}}}function ST(r){var t=r.prev,e=r,o=r.next;if(Un(t,e,o)>=0)return!1;for(var a=t.x,l=e.x,f=o.x,h=t.y,p=e.y,d=o.y,g=a<l?a<f?a:f:l<f?l:f,_=h<p?h<d?h:d:p<d?p:d,y=a>l?a>f?a:f:l>f?l:f,M=h>p?h>d?h:d:p>d?p:d,w=o.next;w!==t;){if(w.x>=g&&w.x<=y&&w.y>=_&&w.y<=M&&eu(a,h,l,p,f,d,w.x,w.y)&&Un(w.prev,w,w.next)>=0)return!1;w=w.next}return!0}function wT(r,t,e,o){var a=r.prev,l=r,f=r.next;if(Un(a,l,f)>=0)return!1;for(var h=a.x,p=l.x,d=f.x,g=a.y,_=l.y,y=f.y,M=h<p?h<d?h:d:p<d?p:d,w=g<_?g<y?g:y:_<y?_:y,T=h>p?h>d?h:d:p>d?p:d,x=g>_?g>y?g:y:_>y?_:y,v=Ep(M,w,t,e,o),C=Ep(T,x,t,e,o),S=r.prevZ,O=r.nextZ;S&&S.z>=v&&O&&O.z<=C;){if(S.x>=M&&S.x<=T&&S.y>=w&&S.y<=x&&S!==a&&S!==f&&eu(h,g,p,_,d,y,S.x,S.y)&&Un(S.prev,S,S.next)>=0||(S=S.prevZ,O.x>=M&&O.x<=T&&O.y>=w&&O.y<=x&&O!==a&&O!==f&&eu(h,g,p,_,d,y,O.x,O.y)&&Un(O.prev,O,O.next)>=0))return!1;O=O.nextZ}for(;S&&S.z>=v;){if(S.x>=M&&S.x<=T&&S.y>=w&&S.y<=x&&S!==a&&S!==f&&eu(h,g,p,_,d,y,S.x,S.y)&&Un(S.prev,S,S.next)>=0)return!1;S=S.prevZ}for(;O&&O.z<=C;){if(O.x>=M&&O.x<=T&&O.y>=w&&O.y<=x&&O!==a&&O!==f&&eu(h,g,p,_,d,y,O.x,O.y)&&Un(O.prev,O,O.next)>=0)return!1;O=O.nextZ}return!0}function bT(r,t,e){var o=r;do{var a=o.prev,l=o.next.next;!Ic(a,l)&&X0(a,o,o.next,l)&&Ju(a,l)&&Ju(l,a)&&(t.push(a.i/e|0),t.push(o.i/e|0),t.push(l.i/e|0),$u(o),$u(o.next),o=r=l),o=o.next}while(o!==r);return js(o)}function TT(r,t,e,o,a,l){var f=r;do{for(var h=f.next.next;h!==f.prev;){if(f.i!==h.i&&DT(f,h)){var p=Y0(f,h);f=js(f,f.next),p=js(p,p.next),Zu(f,t,e,o,a,l,0),Zu(p,t,e,o,a,l,0);return}h=h.next}f=f.next}while(f!==r)}function AT(r,t,e,o){var a=[],l,f,h,p,d;for(l=0,f=t.length;l<f;l++)h=t[l]*o,p=l<f-1?t[l+1]*o:r.length,d=q0(r,h,p,o,!1),d===d.next&&(d.steiner=!0),a.push(OT(d));for(a.sort(CT),l=0;l<a.length;l++)e=PT(a[l],e);return e}function CT(r,t){return r.x-t.x}function PT(r,t){var e=IT(r,t);if(!e)return t;var o=Y0(e,r);return js(o,o.next),js(e,e.next)}function IT(r,t){var e=t,o=r.x,a=r.y,l=-1/0,f;do{if(a<=e.y&&a>=e.next.y&&e.next.y!==e.y){var h=e.x+(a-e.y)*(e.next.x-e.x)/(e.next.y-e.y);if(h<=o&&h>l&&(l=h,f=e.x<e.next.x?e:e.next,h===o))return f}e=e.next}while(e!==t);if(!f)return null;var p=f,d=f.x,g=f.y,_=1/0,y;e=f;do o>=e.x&&e.x>=d&&o!==e.x&&eu(a<g?o:l,a,d,g,a<g?l:o,a,e.x,e.y)&&(y=Math.abs(a-e.y)/(o-e.x),Ju(e,r)&&(y<_||y===_&&(e.x>f.x||e.x===f.x&&RT(f,e)))&&(f=e,_=y)),e=e.next;while(e!==p);return f}function RT(r,t){return Un(r.prev,r,t.prev)<0&&Un(t.next,r,r.next)<0}function LT(r,t,e,o){var a=r;do a.z===0&&(a.z=Ep(a.x,a.y,t,e,o)),a.prevZ=a.prev,a.nextZ=a.next,a=a.next;while(a!==r);a.prevZ.nextZ=null,a.prevZ=null,NT(a)}function NT(r){var t,e,o,a,l,f,h,p,d=1;do{for(e=r,r=null,l=null,f=0;e;){for(f++,o=e,h=0,t=0;t<d&&(h++,o=o.nextZ,!!o);t++);for(p=d;h>0||p>0&&o;)h!==0&&(p===0||!o||e.z<=o.z)?(a=e,e=e.nextZ,h--):(a=o,o=o.nextZ,p--),l?l.nextZ=a:r=a,a.prevZ=l,l=a;e=o}l.nextZ=null,d*=2}while(f>1);return r}function Ep(r,t,e,o,a){return r=(r-e)*a|0,t=(t-o)*a|0,r=(r|r<<8)&16711935,r=(r|r<<4)&252645135,r=(r|r<<2)&858993459,r=(r|r<<1)&1431655765,t=(t|t<<8)&16711935,t=(t|t<<4)&252645135,t=(t|t<<2)&858993459,t=(t|t<<1)&1431655765,r|t<<1}function OT(r){var t=r,e=r;do(t.x<e.x||t.x===e.x&&t.y<e.y)&&(e=t),t=t.next;while(t!==r);return e}function eu(r,t,e,o,a,l,f,h){return(a-f)*(t-h)>=(r-f)*(l-h)&&(r-f)*(o-h)>=(e-f)*(t-h)&&(e-f)*(l-h)>=(a-f)*(o-h)}function DT(r,t){return r.next.i!==t.i&&r.prev.i!==t.i&&!FT(r,t)&&(Ju(r,t)&&Ju(t,r)&&UT(r,t)&&(Un(r.prev,r,t.prev)||Un(r,t.prev,t))||Ic(r,t)&&Un(r.prev,r,r.next)>0&&Un(t.prev,t,t.next)>0)}function Un(r,t,e){return(t.y-r.y)*(e.x-t.x)-(t.x-r.x)*(e.y-t.y)}function Ic(r,t){return r.x===t.x&&r.y===t.y}function X0(r,t,e,o){var a=Cc(Un(r,t,e)),l=Cc(Un(r,t,o)),f=Cc(Un(e,o,r)),h=Cc(Un(e,o,t));return!!(a!==l&&f!==h||a===0&&Ac(r,e,t)||l===0&&Ac(r,o,t)||f===0&&Ac(e,r,o)||h===0&&Ac(e,t,o))}function Ac(r,t,e){return t.x<=Math.max(r.x,e.x)&&t.x>=Math.min(r.x,e.x)&&t.y<=Math.max(r.y,e.y)&&t.y>=Math.min(r.y,e.y)}function Cc(r){return r>0?1:r<0?-1:0}function FT(r,t){var e=r;do{if(e.i!==r.i&&e.next.i!==r.i&&e.i!==t.i&&e.next.i!==t.i&&X0(e,e.next,r,t))return!0;e=e.next}while(e!==r);return!1}function Ju(r,t){return Un(r.prev,r,r.next)<0?Un(r,t,r.next)>=0&&Un(r,r.prev,t)>=0:Un(r,t,r.prev)<0||Un(r,r.next,t)<0}function UT(r,t){var e=r,o=!1,a=(r.x+t.x)/2,l=(r.y+t.y)/2;do e.y>l!=e.next.y>l&&e.next.y!==e.y&&a<(e.next.x-e.x)*(l-e.y)/(e.next.y-e.y)+e.x&&(o=!o),e=e.next;while(e!==r);return o}function Y0(r,t){var e=new Mp(r.i,r.x,r.y),o=new Mp(t.i,t.x,t.y),a=r.next,l=t.prev;return r.next=t,t.prev=r,e.next=a,a.prev=e,o.next=e,e.prev=o,l.next=o,o.prev=l,o}function W0(r,t,e,o){var a=new Mp(r,t,e);return o?(a.next=o.next,a.prev=o,o.next.prev=a,o.next=a):(a.prev=a,a.next=a),a}function $u(r){r.next.prev=r.prev,r.prev.next=r.next,r.prevZ&&(r.prevZ.nextZ=r.nextZ),r.nextZ&&(r.nextZ.prevZ=r.prevZ)}function Mp(r,t,e){this.i=r,this.x=t,this.y=e,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}Pc.deviation=function(r,t,e,o){var a=t&&t.length,l=a?t[0]*e:r.length,f=Math.abs(Sp(r,0,l,e));if(a)for(var h=0,p=t.length;h<p;h++){var d=t[h]*e,g=h<p-1?t[h+1]*e:r.length;f-=Math.abs(Sp(r,d,g,e))}var _=0;for(h=0;h<o.length;h+=3){var y=o[h]*e,M=o[h+1]*e,w=o[h+2]*e;_+=Math.abs((r[y]-r[w])*(r[M+1]-r[y+1])-(r[y]-r[M])*(r[w+1]-r[y+1]))}return f===0&&_===0?0:Math.abs((_-f)/f)};function Sp(r,t,e,o){for(var a=0,l=t,f=e-o;l<e;l+=o)a+=(r[f]-r[l])*(r[l+1]+r[f+1]),f=l;return a}Pc.flatten=function(r){for(var t=r[0][0].length,e={vertices:[],holes:[],dimensions:t},o=0,a=0;a<r.length;a++){for(var l=0;l<r[a].length;l++)for(var f=0;f<t;f++)e.vertices.push(r[a][l][f]);a>0&&(o+=r[a-1].length,e.holes.push(o))}return e}});var Pp=Jt(ue=>{"use strict";Object.defineProperty(ue,"__esModule",{value:!0});ue.earthRadius=63710088e-1;ue.factors={centimeters:ue.earthRadius*100,centimetres:ue.earthRadius*100,degrees:ue.earthRadius/111325,feet:ue.earthRadius*3.28084,inches:ue.earthRadius*39.37,kilometers:ue.earthRadius/1e3,kilometres:ue.earthRadius/1e3,meters:ue.earthRadius,metres:ue.earthRadius,miles:ue.earthRadius/1609.344,millimeters:ue.earthRadius*1e3,millimetres:ue.earthRadius*1e3,nauticalmiles:ue.earthRadius/1852,radians:1,yards:ue.earthRadius*1.0936};ue.unitsFactors={centimeters:100,centimetres:100,degrees:1/111325,feet:3.28084,inches:39.37,kilometers:1/1e3,kilometres:1/1e3,meters:1,metres:1,miles:1/1609.344,millimeters:1e3,millimetres:1e3,nauticalmiles:1/1852,radians:1/ue.earthRadius,yards:1.0936133};ue.areaFactors={acres:247105e-9,centimeters:1e4,centimetres:1e4,feet:10.763910417,hectares:1e-4,inches:1550.003100006,kilometers:1e-6,kilometres:1e-6,meters:1,metres:1,miles:386e-9,millimeters:1e6,millimetres:1e6,yards:1.195990046};function xs(r,t,e){e===void 0&&(e={});var o={type:"Feature"};return(e.id===0||e.id)&&(o.id=e.id),e.bbox&&(o.bbox=e.bbox),o.properties=t||{},o.geometry=r,o}ue.feature=xs;function zT(r,t,e){switch(e===void 0&&(e={}),r){case"Point":return bp(t).geometry;case"LineString":return Ap(t).geometry;case"Polygon":return Tp(t).geometry;case"MultiPoint":return $0(t).geometry;case"MultiLineString":return J0(t).geometry;case"MultiPolygon":return K0(t).geometry;default:throw new Error(r+" is invalid")}}ue.geometry=zT;function bp(r,t,e){if(e===void 0&&(e={}),!r)throw new Error("coordinates is required");if(!Array.isArray(r))throw new Error("coordinates must be an Array");if(r.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!Rc(r[0])||!Rc(r[1]))throw new Error("coordinates must contain numbers");var o={type:"Point",coordinates:r};return xs(o,t,e)}ue.point=bp;function kT(r,t,e){return e===void 0&&(e={}),Lc(r.map(function(o){return bp(o,t)}),e)}ue.points=kT;function Tp(r,t,e){e===void 0&&(e={});for(var o=0,a=r;o<a.length;o++){var l=a[o];if(l.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");for(var f=0;f<l[l.length-1].length;f++)if(l[l.length-1][f]!==l[0][f])throw new Error("First and last Position are not equivalent.")}var h={type:"Polygon",coordinates:r};return xs(h,t,e)}ue.polygon=Tp;function GT(r,t,e){return e===void 0&&(e={}),Lc(r.map(function(o){return Tp(o,t)}),e)}ue.polygons=GT;function Ap(r,t,e){if(e===void 0&&(e={}),r.length<2)throw new Error("coordinates must be an array of two or more positions");var o={type:"LineString",coordinates:r};return xs(o,t,e)}ue.lineString=Ap;function VT(r,t,e){return e===void 0&&(e={}),Lc(r.map(function(o){return Ap(o,t)}),e)}ue.lineStrings=VT;function Lc(r,t){t===void 0&&(t={});var e={type:"FeatureCollection"};return t.id&&(e.id=t.id),t.bbox&&(e.bbox=t.bbox),e.features=r,e}ue.featureCollection=Lc;function J0(r,t,e){e===void 0&&(e={});var o={type:"MultiLineString",coordinates:r};return xs(o,t,e)}ue.multiLineString=J0;function $0(r,t,e){e===void 0&&(e={});var o={type:"MultiPoint",coordinates:r};return xs(o,t,e)}ue.multiPoint=$0;function K0(r,t,e){e===void 0&&(e={});var o={type:"MultiPolygon",coordinates:r};return xs(o,t,e)}ue.multiPolygon=K0;function HT(r,t,e){e===void 0&&(e={});var o={type:"GeometryCollection",geometries:r};return xs(o,t,e)}ue.geometryCollection=HT;function WT(r,t){if(t===void 0&&(t=0),t&&!(t>=0))throw new Error("precision must be a positive number");var e=Math.pow(10,t||0);return Math.round(r*e)/e}ue.round=WT;function j0(r,t){t===void 0&&(t="kilometers");var e=ue.factors[t];if(!e)throw new Error(t+" units is invalid");return r*e}ue.radiansToLength=j0;function Cp(r,t){t===void 0&&(t="kilometers");var e=ue.factors[t];if(!e)throw new Error(t+" units is invalid");return r/e}ue.lengthToRadians=Cp;function qT(r,t){return Q0(Cp(r,t))}ue.lengthToDegrees=qT;function XT(r){var t=r%360;return t<0&&(t+=360),t}ue.bearingToAzimuth=XT;function Q0(r){var t=r%(2*Math.PI);return t*180/Math.PI}ue.radiansToDegrees=Q0;function YT(r){var t=r%360;return t*Math.PI/180}ue.degreesToRadians=YT;function ZT(r,t,e){if(t===void 0&&(t="kilometers"),e===void 0&&(e="kilometers"),!(r>=0))throw new Error("length must be a positive number");return j0(Cp(r,t),e)}ue.convertLength=ZT;function JT(r,t,e){if(t===void 0&&(t="meters"),e===void 0&&(e="kilometers"),!(r>=0))throw new Error("area must be a positive number");var o=ue.areaFactors[t];if(!o)throw new Error("invalid original units");var a=ue.areaFactors[e];if(!a)throw new Error("invalid final units");return r/o*a}ue.convertArea=JT;function Rc(r){return!isNaN(r)&&r!==null&&!Array.isArray(r)}ue.isNumber=Rc;function $T(r){return!!r&&r.constructor===Object}ue.isObject=$T;function KT(r){if(!r)throw new Error("bbox is required");if(!Array.isArray(r))throw new Error("bbox must be an Array");if(r.length!==4&&r.length!==6)throw new Error("bbox must be an Array of 4 or 6 numbers");r.forEach(function(t){if(!Rc(t))throw new Error("bbox must only contain numbers")})}ue.validateBBox=KT;function jT(r){if(!r)throw new Error("id is required");if(["string","number"].indexOf(typeof r)===-1)throw new Error("id must be a number or a string")}ue.validateId=jT});var Rp=Jt(ir=>{"use strict";Object.defineProperty(ir,"__esModule",{value:!0});var Gr=Pp();function Ku(r,t,e){if(r!==null)for(var o,a,l,f,h,p,d,g=0,_=0,y,M=r.type,w=M==="FeatureCollection",T=M==="Feature",x=w?r.features.length:1,v=0;v<x;v++){d=w?r.features[v].geometry:T?r.geometry:r,y=d?d.type==="GeometryCollection":!1,h=y?d.geometries.length:1;for(var C=0;C<h;C++){var S=0,O=0;if(f=y?d.geometries[C]:d,f!==null){p=f.coordinates;var F=f.type;switch(g=e&&(F==="Polygon"||F==="MultiPolygon")?1:0,F){case null:break;case"Point":if(t(p,_,v,S,O)===!1)return!1;_++,S++;break;case"LineString":case"MultiPoint":for(o=0;o<p.length;o++){if(t(p[o],_,v,S,O)===!1)return!1;_++,F==="MultiPoint"&&S++}F==="LineString"&&S++;break;case"Polygon":case"MultiLineString":for(o=0;o<p.length;o++){for(a=0;a<p[o].length-g;a++){if(t(p[o][a],_,v,S,O)===!1)return!1;_++}F==="MultiLineString"&&S++,F==="Polygon"&&O++}F==="Polygon"&&S++;break;case"MultiPolygon":for(o=0;o<p.length;o++){for(O=0,a=0;a<p[o].length;a++){for(l=0;l<p[o][a].length-g;l++){if(t(p[o][a][l],_,v,S,O)===!1)return!1;_++}O++}S++}break;case"GeometryCollection":for(o=0;o<f.geometries.length;o++)if(Ku(f.geometries[o],t,e)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function QT(r,t,e,o){var a=e;return Ku(r,function(l,f,h,p,d){f===0&&e===void 0?a=l:a=t(a,l,f,h,p,d)},o),a}function ty(r,t){var e;switch(r.type){case"FeatureCollection":for(e=0;e<r.features.length&&t(r.features[e].properties,e)!==!1;e++);break;case"Feature":t(r.properties,0);break}}function tA(r,t,e){var o=e;return ty(r,function(a,l){l===0&&e===void 0?o=a:o=t(o,a,l)}),o}function ey(r,t){if(r.type==="Feature")t(r,0);else if(r.type==="FeatureCollection")for(var e=0;e<r.features.length&&t(r.features[e],e)!==!1;e++);}function eA(r,t,e){var o=e;return ey(r,function(a,l){l===0&&e===void 0?o=a:o=t(o,a,l)}),o}function nA(r){var t=[];return Ku(r,function(e){t.push(e)}),t}function Ip(r,t){var e,o,a,l,f,h,p,d,g,_,y=0,M=r.type==="FeatureCollection",w=r.type==="Feature",T=M?r.features.length:1;for(e=0;e<T;e++){for(h=M?r.features[e].geometry:w?r.geometry:r,d=M?r.features[e].properties:w?r.properties:{},g=M?r.features[e].bbox:w?r.bbox:void 0,_=M?r.features[e].id:w?r.id:void 0,p=h?h.type==="GeometryCollection":!1,f=p?h.geometries.length:1,a=0;a<f;a++){if(l=p?h.geometries[a]:h,l===null){if(t(null,y,d,g,_)===!1)return!1;continue}switch(l.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":{if(t(l,y,d,g,_)===!1)return!1;break}case"GeometryCollection":{for(o=0;o<l.geometries.length;o++)if(t(l.geometries[o],y,d,g,_)===!1)return!1;break}default:throw new Error("Unknown Geometry Type")}}y++}}function rA(r,t,e){var o=e;return Ip(r,function(a,l,f,h,p){l===0&&e===void 0?o=a:o=t(o,a,l,f,h,p)}),o}function Nc(r,t){Ip(r,function(e,o,a,l,f){var h=e===null?null:e.type;switch(h){case null:case"Point":case"LineString":case"Polygon":return t(Gr.feature(e,a,{bbox:l,id:f}),o,0)===!1?!1:void 0}var p;switch(h){case"MultiPoint":p="Point";break;case"MultiLineString":p="LineString";break;case"MultiPolygon":p="Polygon";break}for(var d=0;d<e.coordinates.length;d++){var g=e.coordinates[d],_={type:p,coordinates:g};if(t(Gr.feature(_,a),o,d)===!1)return!1}})}function iA(r,t,e){var o=e;return Nc(r,function(a,l,f){l===0&&f===0&&e===void 0?o=a:o=t(o,a,l,f)}),o}function ny(r,t){Nc(r,function(e,o,a){var l=0;if(e.geometry){var f=e.geometry.type;if(!(f==="Point"||f==="MultiPoint")){var h,p=0,d=0,g=0;if(Ku(e,function(_,y,M,w,T){if(h===void 0||o>p||w>d||T>g){h=_,p=o,d=w,g=T,l=0;return}var x=Gr.lineString([h,_],e.properties);if(t(x,o,a,T,l)===!1)return!1;l++,h=_})===!1)return!1}}})}function oA(r,t,e){var o=e,a=!1;return ny(r,function(l,f,h,p,d){a===!1&&e===void 0?o=l:o=t(o,l,f,h,p,d),a=!0}),o}function ry(r,t){if(!r)throw new Error("geojson is required");Nc(r,function(e,o,a){if(e.geometry!==null){var l=e.geometry.type,f=e.geometry.coordinates;switch(l){case"LineString":if(t(e,o,a,0,0)===!1)return!1;break;case"Polygon":for(var h=0;h<f.length;h++)if(t(Gr.lineString(f[h],e.properties),o,a,h)===!1)return!1;break}}})}function sA(r,t,e){var o=e;return ry(r,function(a,l,f,h){l===0&&e===void 0?o=a:o=t(o,a,l,f,h)}),o}function aA(r,t){if(t=t||{},!Gr.isObject(t))throw new Error("options is invalid");var e=t.featureIndex||0,o=t.multiFeatureIndex||0,a=t.geometryIndex||0,l=t.segmentIndex||0,f=t.properties,h;switch(r.type){case"FeatureCollection":e<0&&(e=r.features.length+e),f=f||r.features[e].properties,h=r.features[e].geometry;break;case"Feature":f=f||r.properties,h=r.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":h=r;break;default:throw new Error("geojson is invalid")}if(h===null)return null;var p=h.coordinates;switch(h.type){case"Point":case"MultiPoint":return null;case"LineString":return l<0&&(l=p.length+l-1),Gr.lineString([p[l],p[l+1]],f,t);case"Polygon":return a<0&&(a=p.length+a),l<0&&(l=p[a].length+l-1),Gr.lineString([p[a][l],p[a][l+1]],f,t);case"MultiLineString":return o<0&&(o=p.length+o),l<0&&(l=p[o].length+l-1),Gr.lineString([p[o][l],p[o][l+1]],f,t);case"MultiPolygon":return o<0&&(o=p.length+o),a<0&&(a=p[o].length+a),l<0&&(l=p[o][a].length-l-1),Gr.lineString([p[o][a][l],p[o][a][l+1]],f,t)}throw new Error("geojson is invalid")}function uA(r,t){if(t=t||{},!Gr.isObject(t))throw new Error("options is invalid");var e=t.featureIndex||0,o=t.multiFeatureIndex||0,a=t.geometryIndex||0,l=t.coordIndex||0,f=t.properties,h;switch(r.type){case"FeatureCollection":e<0&&(e=r.features.length+e),f=f||r.features[e].properties,h=r.features[e].geometry;break;case"Feature":f=f||r.properties,h=r.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":h=r;break;default:throw new Error("geojson is invalid")}if(h===null)return null;var p=h.coordinates;switch(h.type){case"Point":return Gr.point(p,f,t);case"MultiPoint":return o<0&&(o=p.length+o),Gr.point(p[o],f,t);case"LineString":return l<0&&(l=p.length+l),Gr.point(p[l],f,t);case"Polygon":return a<0&&(a=p.length+a),l<0&&(l=p[a].length+l),Gr.point(p[a][l],f,t);case"MultiLineString":return o<0&&(o=p.length+o),l<0&&(l=p[o].length+l),Gr.point(p[o][l],f,t);case"MultiPolygon":return o<0&&(o=p.length+o),a<0&&(a=p[o].length+a),l<0&&(l=p[o][a].length-l),Gr.point(p[o][a][l],f,t)}throw new Error("geojson is invalid")}ir.coordAll=nA;ir.coordEach=Ku;ir.coordReduce=QT;ir.featureEach=ey;ir.featureReduce=eA;ir.findPoint=uA;ir.findSegment=aA;ir.flattenEach=Nc;ir.flattenReduce=iA;ir.geomEach=Ip;ir.geomReduce=rA;ir.lineEach=ry;ir.lineReduce=sA;ir.propEach=ty;ir.propReduce=tA;ir.segmentEach=ny;ir.segmentReduce=oA});var iy=Jt(Np=>{"use strict";Object.defineProperty(Np,"__esModule",{value:!0});var lA=Rp();function Lp(r){var t=[1/0,1/0,-1/0,-1/0];return lA.coordEach(r,function(e){t[0]>e[0]&&(t[0]=e[0]),t[1]>e[1]&&(t[1]=e[1]),t[2]<e[0]&&(t[2]=e[0]),t[3]<e[1]&&(t[3]=e[1])}),t}Lp.default=Lp;Np.default=Lp});var Oc=Jt((LO,Op)=>{var go=op(),sy=Pp(),ay=Rp(),nu=iy().default,cA=ay.featureEach,IO=ay.coordEach,RO=sy.polygon,oy=sy.featureCollection;function uy(r){var t=new go(r);return t.insert=function(e){if(e.type!=="Feature")throw new Error("invalid feature");return e.bbox=e.bbox?e.bbox:nu(e),go.prototype.insert.call(this,e)},t.load=function(e){var o=[];return Array.isArray(e)?e.forEach(function(a){if(a.type!=="Feature")throw new Error("invalid features");a.bbox=a.bbox?a.bbox:nu(a),o.push(a)}):cA(e,function(a){if(a.type!=="Feature")throw new Error("invalid features");a.bbox=a.bbox?a.bbox:nu(a),o.push(a)}),go.prototype.load.call(this,o)},t.remove=function(e,o){if(e.type!=="Feature")throw new Error("invalid feature");return e.bbox=e.bbox?e.bbox:nu(e),go.prototype.remove.call(this,e,o)},t.clear=function(){return go.prototype.clear.call(this)},t.search=function(e){var o=go.prototype.search.call(this,this.toBBox(e));return oy(o)},t.collides=function(e){return go.prototype.collides.call(this,this.toBBox(e))},t.all=function(){var e=go.prototype.all.call(this);return oy(e)},t.toJSON=function(){return go.prototype.toJSON.call(this)},t.fromJSON=function(e){return go.prototype.fromJSON.call(this,e)},t.toBBox=function(e){var o;if(e.bbox)o=e.bbox;else if(Array.isArray(e)&&e.length===4)o=e;else if(Array.isArray(e)&&e.length===6)o=[e[0],e[1],e[3],e[4]];else if(e.type==="Feature")o=nu(e);else if(e.type==="FeatureCollection")o=nu(e);else throw new Error("invalid geojson");return{minX:o[0],minY:o[1],maxX:o[2],maxY:o[3]}},t}Op.exports=uy;Op.exports.default=uy});var kp=Jt((G3,vy)=>{"use strict";var yy=Object.prototype.toString;vy.exports=function(t){var e=yy.call(t),o=e==="[object Arguments]";return o||(o=e!=="[object Array]"&&t!==null&&typeof t=="object"&&typeof t.length=="number"&&t.length>=0&&yy.call(t.callee)==="[object Function]"),o}});var Ay=Jt((V3,Ty)=>{"use strict";var by;Object.keys||(tl=Object.prototype.hasOwnProperty,Gp=Object.prototype.toString,_y=kp(),Vp=Object.prototype.propertyIsEnumerable,xy=!Vp.call({toString:null},"toString"),Ey=Vp.call(function(){},"prototype"),el=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],zc=function(r){var t=r.constructor;return t&&t.prototype===r},My={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},Sy=function(){if(typeof window=="undefined")return!1;for(var r in window)try{if(!My["$"+r]&&tl.call(window,r)&&window[r]!==null&&typeof window[r]=="object")try{zc(window[r])}catch(t){return!0}}catch(t){return!0}return!1}(),wy=function(r){if(typeof window=="undefined"||!Sy)return zc(r);try{return zc(r)}catch(t){return!1}},by=function(t){var e=t!==null&&typeof t=="object",o=Gp.call(t)==="[object Function]",a=_y(t),l=e&&Gp.call(t)==="[object String]",f=[];if(!e&&!o&&!a)throw new TypeError("Object.keys called on a non-object");var h=Ey&&o;if(l&&t.length>0&&!tl.call(t,0))for(var p=0;p<t.length;++p)f.push(String(p));if(a&&t.length>0)for(var d=0;d<t.length;++d)f.push(String(d));else for(var g in t)!(h&&g==="prototype")&&tl.call(t,g)&&f.push(String(g));if(xy)for(var _=wy(t),y=0;y<el.length;++y)!(_&&el[y]==="constructor")&&tl.call(t,el[y])&&f.push(el[y]);return f});var tl,Gp,_y,Vp,xy,Ey,el,zc,My,Sy,wy;Ty.exports=by});var Hp=Jt((H3,Iy)=>{"use strict";var xA=Array.prototype.slice,EA=kp(),Cy=Object.keys,kc=Cy?function(t){return Cy(t)}:Ay(),Py=Object.keys;kc.shim=function(){if(Object.keys){var t=function(){var e=Object.keys(arguments);return e&&e.length===arguments.length}(1,2);t||(Object.keys=function(o){return EA(o)?Py(xA.call(o)):Py(o)})}else Object.keys=kc;return Object.keys||kc};Iy.exports=kc});var Wp=Jt((W3,Ry)=>{"use strict";Ry.exports=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var t={},e=Symbol("test"),o=Object(e);if(typeof e=="string"||Object.prototype.toString.call(e)!=="[object Symbol]"||Object.prototype.toString.call(o)!=="[object Symbol]")return!1;var a=42;t[e]=a;for(e in t)return!1;if(typeof Object.keys=="function"&&Object.keys(t).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(t).length!==0)return!1;var l=Object.getOwnPropertySymbols(t);if(l.length!==1||l[0]!==e||!Object.prototype.propertyIsEnumerable.call(t,e))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var f=Object.getOwnPropertyDescriptor(t,e);if(f.value!==a||f.enumerable!==!0)return!1}return!0}});var Gc=Jt((q3,Ly)=>{"use strict";var MA=Wp();Ly.exports=function(){return MA()&&!!Symbol.toStringTag}});var Dy=Jt((X3,Oy)=>{"use strict";var Ny=typeof Symbol!="undefined"&&Symbol,SA=Wp();Oy.exports=function(){return typeof Ny!="function"||typeof Symbol!="function"||typeof Ny("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:SA()}});var By=Jt((Y3,Uy)=>{"use strict";var Fy={foo:{}},wA=Object;Uy.exports=function(){return{__proto__:Fy}.foo===Fy.foo&&!({__proto__:null}instanceof wA)}});var Gy=Jt((Z3,ky)=>{"use strict";var bA="Function.prototype.bind called on incompatible ",TA=Object.prototype.toString,AA=Math.max,CA="[object Function]",zy=function(t,e){for(var o=[],a=0;a<t.length;a+=1)o[a]=t[a];for(var l=0;l<e.length;l+=1)o[l+t.length]=e[l];return o},PA=function(t,e){for(var o=[],a=e||0,l=0;a<t.length;a+=1,l+=1)o[l]=t[a];return o},IA=function(r,t){for(var e="",o=0;o<r.length;o+=1)e+=r[o],o+1<r.length&&(e+=t);return e};ky.exports=function(t){var e=this;if(typeof e!="function"||TA.apply(e)!==CA)throw new TypeError(bA+e);for(var o=PA(arguments,1),a,l=function(){if(this instanceof a){var g=e.apply(this,zy(o,arguments));return Object(g)===g?g:this}return e.apply(t,zy(o,arguments))},f=AA(0,e.length-o.length),h=[],p=0;p<f;p++)h[p]="$"+p;if(a=Function("binder","return function ("+IA(h,",")+"){ return binder.apply(this,arguments); }")(l),e.prototype){var d=function(){};d.prototype=e.prototype,a.prototype=new d,d.prototype=null}return a}});var Vc=Jt((J3,Vy)=>{"use strict";var RA=Gy();Vy.exports=Function.prototype.bind||RA});var Wy=Jt(($3,Hy)=>{"use strict";var LA=Function.prototype.call,NA=Object.prototype.hasOwnProperty,OA=Vc();Hy.exports=OA.call(LA,NA)});var ea=Jt((K3,Jy)=>{"use strict";var tn,su=SyntaxError,Zy=Function,ou=TypeError,qp=function(r){try{return Zy('"use strict"; return ('+r+").constructor;")()}catch(t){}},Qs=Object.getOwnPropertyDescriptor;if(Qs)try{Qs({},"")}catch(r){Qs=null}var Xp=function(){throw new ou},DA=Qs?function(){try{return arguments.callee,Xp}catch(r){try{return Qs(arguments,"callee").get}catch(t){return Xp}}}():Xp,ru=Dy()(),FA=By()(),vr=Object.getPrototypeOf||(FA?function(r){return r.__proto__}:null),iu={},UA=typeof Uint8Array=="undefined"||!vr?tn:vr(Uint8Array),ta={"%AggregateError%":typeof AggregateError=="undefined"?tn:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer=="undefined"?tn:ArrayBuffer,"%ArrayIteratorPrototype%":ru&&vr?vr([][Symbol.iterator]()):tn,"%AsyncFromSyncIteratorPrototype%":tn,"%AsyncFunction%":iu,"%AsyncGenerator%":iu,"%AsyncGeneratorFunction%":iu,"%AsyncIteratorPrototype%":iu,"%Atomics%":typeof Atomics=="undefined"?tn:Atomics,"%BigInt%":typeof BigInt=="undefined"?tn:BigInt,"%BigInt64Array%":typeof BigInt64Array=="undefined"?tn:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array=="undefined"?tn:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView=="undefined"?tn:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":typeof Float32Array=="undefined"?tn:Float32Array,"%Float64Array%":typeof Float64Array=="undefined"?tn:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry=="undefined"?tn:FinalizationRegistry,"%Function%":Zy,"%GeneratorFunction%":iu,"%Int8Array%":typeof Int8Array=="undefined"?tn:Int8Array,"%Int16Array%":typeof Int16Array=="undefined"?tn:Int16Array,"%Int32Array%":typeof Int32Array=="undefined"?tn:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":ru&&vr?vr(vr([][Symbol.iterator]())):tn,"%JSON%":typeof JSON=="object"?JSON:tn,"%Map%":typeof Map=="undefined"?tn:Map,"%MapIteratorPrototype%":typeof Map=="undefined"||!ru||!vr?tn:vr(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise=="undefined"?tn:Promise,"%Proxy%":typeof Proxy=="undefined"?tn:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":typeof Reflect=="undefined"?tn:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set=="undefined"?tn:Set,"%SetIteratorPrototype%":typeof Set=="undefined"||!ru||!vr?tn:vr(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer=="undefined"?tn:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":ru&&vr?vr(""[Symbol.iterator]()):tn,"%Symbol%":ru?Symbol:tn,"%SyntaxError%":su,"%ThrowTypeError%":DA,"%TypedArray%":UA,"%TypeError%":ou,"%Uint8Array%":typeof Uint8Array=="undefined"?tn:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray=="undefined"?tn:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array=="undefined"?tn:Uint16Array,"%Uint32Array%":typeof Uint32Array=="undefined"?tn:Uint32Array,"%URIError%":URIError,"%WeakMap%":typeof WeakMap=="undefined"?tn:WeakMap,"%WeakRef%":typeof WeakRef=="undefined"?tn:WeakRef,"%WeakSet%":typeof WeakSet=="undefined"?tn:WeakSet};if(vr)try{null.error}catch(r){qy=vr(vr(r)),ta["%Error.prototype%"]=qy}var qy,BA=function r(t){var e;if(t==="%AsyncFunction%")e=qp("async function () {}");else if(t==="%GeneratorFunction%")e=qp("function* () {}");else if(t==="%AsyncGeneratorFunction%")e=qp("async function* () {}");else if(t==="%AsyncGenerator%"){var o=r("%AsyncGeneratorFunction%");o&&(e=o.prototype)}else if(t==="%AsyncIteratorPrototype%"){var a=r("%AsyncGenerator%");a&&vr&&(e=vr(a.prototype))}return ta[t]=e,e},Xy={"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},nl=Vc(),Hc=Wy(),zA=nl.call(Function.call,Array.prototype.concat),kA=nl.call(Function.apply,Array.prototype.splice),Yy=nl.call(Function.call,String.prototype.replace),Wc=nl.call(Function.call,String.prototype.slice),GA=nl.call(Function.call,RegExp.prototype.exec),VA=/[^%.[\\]]+|\\[(?:(-?\\d+(?:\\.\\d+)?)|(["'])((?:(?!\\2)[^\\\\]|\\\\.)*?)\\2)\\]|(?=(?:\\.|\\[\\])(?:\\.|\\[\\]|%$))/g,HA=/\\\\(\\\\)?/g,WA=function(t){var e=Wc(t,0,1),o=Wc(t,-1);if(e==="%"&&o!=="%")throw new su("invalid intrinsic syntax, expected closing \`%\`");if(o==="%"&&e!=="%")throw new su("invalid intrinsic syntax, expected opening \`%\`");var a=[];return Yy(t,VA,function(l,f,h,p){a[a.length]=h?Yy(p,HA,"$1"):f||l}),a},qA=function(t,e){var o=t,a;if(Hc(Xy,o)&&(a=Xy[o],o="%"+a[0]+"%"),Hc(ta,o)){var l=ta[o];if(l===iu&&(l=BA(o)),typeof l=="undefined"&&!e)throw new ou("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:a,name:o,value:l}}throw new su("intrinsic "+t+" does not exist!")};Jy.exports=function(t,e){if(typeof t!="string"||t.length===0)throw new ou("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof e!="boolean")throw new ou('"allowMissing" argument must be a boolean');if(GA(/^%?[^%]*%?$/,t)===null)throw new su("\`%\` may not be present anywhere but at the beginning and end of the intrinsic name");var o=WA(t),a=o.length>0?o[0]:"",l=qA("%"+a+"%",e),f=l.name,h=l.value,p=!1,d=l.alias;d&&(a=d[0],kA(o,zA([0,1],d)));for(var g=1,_=!0;g<o.length;g+=1){var y=o[g],M=Wc(y,0,1),w=Wc(y,-1);if((M==='"'||M==="'"||M==="\`"||w==='"'||w==="'"||w==="\`")&&M!==w)throw new su("property names with quotes must have matching quotes");if((y==="constructor"||!_)&&(p=!0),a+="."+y,f="%"+a+"%",Hc(ta,f))h=ta[f];else if(h!=null){if(!(y in h)){if(!e)throw new ou("base intrinsic for "+t+" exists, but the property is not available.");return}if(Qs&&g+1>=o.length){var T=Qs(h,y);_=!!T,_&&"get"in T&&!("originalValue"in T.get)?h=T.get:h=h[y]}else _=Hc(h,y),h=h[y];_&&!p&&(ta[f]=h)}}return h}});var rl=Jt((j3,$y)=>{"use strict";var XA=ea(),Yp=XA("%Object.defineProperty%",!0),Zp=function(){if(Yp)try{return Yp({},"a",{value:1}),!0}catch(t){return!1}return!1};Zp.hasArrayLengthDefineBug=function(){if(!Zp())return null;try{return Yp([],"length",{value:1}).length!==1}catch(t){return!0}};$y.exports=Zp});var Jp=Jt((Q3,Ky)=>{"use strict";var YA=ea(),qc=YA("%Object.getOwnPropertyDescriptor%",!0);if(qc)try{qc([],"length")}catch(r){qc=null}Ky.exports=qc});var Xc=Jt((tF,Qy)=>{"use strict";var ZA=rl()(),$p=ea(),il=ZA&&$p("%Object.defineProperty%",!0);if(il)try{il({},"a",{value:1})}catch(r){il=!1}var JA=$p("%SyntaxError%"),au=$p("%TypeError%"),jy=Jp();Qy.exports=function(t,e,o){if(!t||typeof t!="object"&&typeof t!="function")throw new au("\`obj\` must be an object or a function\`");if(typeof e!="string"&&typeof e!="symbol")throw new au("\`property\` must be a string or a symbol\`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new au("\`nonEnumerable\`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new au("\`nonWritable\`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new au("\`nonConfigurable\`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new au("\`loose\`, if provided, must be a boolean");var a=arguments.length>3?arguments[3]:null,l=arguments.length>4?arguments[4]:null,f=arguments.length>5?arguments[5]:null,h=arguments.length>6?arguments[6]:!1,p=!!jy&&jy(t,e);if(il)il(t,e,{configurable:f===null&&p?p.configurable:!f,enumerable:a===null&&p?p.enumerable:!a,value:o,writable:l===null&&p?p.writable:!l});else if(h||!a&&!l&&!f)t[e]=o;else throw new JA("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")}});var ov=Jt((eF,iv)=>{"use strict";var rv=ea(),tv=Xc(),$A=rl()(),ev=Jp(),nv=rv("%TypeError%"),KA=rv("%Math.floor%");iv.exports=function(t,e){if(typeof t!="function")throw new nv("\`fn\` is not a function");if(typeof e!="number"||e<0||e>4294967295||KA(e)!==e)throw new nv("\`length\` must be a positive 32-bit integer");var o=arguments.length>2&&!!arguments[2],a=!0,l=!0;if("length"in t&&ev){var f=ev(t,"length");f&&!f.configurable&&(a=!1),f&&!f.writable&&(l=!1)}return(a||l||!o)&&($A?tv(t,"length",e,!0,!0):tv(t,"length",e)),t}});var Zc=Jt((nF,Yc)=>{"use strict";var Kp=Vc(),uu=ea(),jA=ov(),QA=uu("%TypeError%"),av=uu("%Function.prototype.apply%"),uv=uu("%Function.prototype.call%"),lv=uu("%Reflect.apply%",!0)||Kp.call(uv,av),ol=uu("%Object.defineProperty%",!0),tC=uu("%Math.max%");if(ol)try{ol({},"a",{value:1})}catch(r){ol=null}Yc.exports=function(t){if(typeof t!="function")throw new QA("a function is required");var e=lv(Kp,uv,arguments);return jA(e,1+tC(0,t.length-(arguments.length-1)),!0)};var sv=function(){return lv(Kp,av,arguments)};ol?ol(Yc.exports,"apply",{value:sv}):Yc.exports.apply=sv});var jp=Jt((rF,hv)=>{"use strict";var cv=ea(),fv=Zc(),eC=fv(cv("String.prototype.indexOf"));hv.exports=function(t,e){var o=cv(t,!!e);return typeof o=="function"&&eC(t,".prototype.")>-1?fv(o):o}});var mv=Jt((iF,dv)=>{"use strict";var nC=Gc()(),rC=jp(),Qp=rC("Object.prototype.toString"),Jc=function(t){return nC&&t&&typeof t=="object"&&Symbol.toStringTag in t?!1:Qp(t)==="[object Arguments]"},pv=function(t){return Jc(t)?!0:t!==null&&typeof t=="object"&&typeof t.length=="number"&&t.length>=0&&Qp(t)!=="[object Array]"&&Qp(t.callee)==="[object Function]"},iC=function(){return Jc(arguments)}();Jc.isLegacyArguments=pv;dv.exports=iC?Jc:pv});var lu=Jt((oF,_v)=>{"use strict";var oC=Hp(),sC=typeof Symbol=="function"&&typeof Symbol("foo")=="symbol",aC=Object.prototype.toString,uC=Array.prototype.concat,gv=Xc(),lC=function(r){return typeof r=="function"&&aC.call(r)==="[object Function]"},yv=rl()(),cC=function(r,t,e,o){if(t in r){if(o===!0){if(r[t]===e)return}else if(!lC(o)||!o())return}yv?gv(r,t,e,!0):gv(r,t,e)},vv=function(r,t){var e=arguments.length>2?arguments[2]:{},o=oC(t);sC&&(o=uC.call(o,Object.getOwnPropertySymbols(t)));for(var a=0;a<o.length;a+=1)cC(r,o[a],t[o[a]],e[o[a]])};vv.supportsDescriptors=!!yv;_v.exports=vv});var td=Jt((sF,Ev)=>{"use strict";var xv=function(r){return r!==r};Ev.exports=function(t,e){return t===0&&e===0?1/t===1/e:!!(t===e||xv(t)&&xv(e))}});var ed=Jt((aF,Mv)=>{"use strict";var fC=td();Mv.exports=function(){return typeof Object.is=="function"?Object.is:fC}});var wv=Jt((uF,Sv)=>{"use strict";var hC=ed(),pC=lu();Sv.exports=function(){var t=hC();return pC(Object,{is:t},{is:function(){return Object.is!==t}}),t}});var Cv=Jt((lF,Av)=>{"use strict";var dC=lu(),mC=Zc(),gC=td(),bv=ed(),yC=wv(),Tv=mC(bv(),Object);dC(Tv,{getPolyfill:bv,implementation:gC,shim:yC});Av.exports=Tv});var Nv=Jt((cF,Lv)=>{"use strict";var nd=jp(),Pv=Gc()(),Iv,Rv,rd,id;Pv&&(Iv=nd("Object.prototype.hasOwnProperty"),Rv=nd("RegExp.prototype.exec"),rd={},$c=function(){throw rd},id={toString:$c,valueOf:$c},typeof Symbol.toPrimitive=="symbol"&&(id[Symbol.toPrimitive]=$c));var $c,vC=nd("Object.prototype.toString"),_C=Object.getOwnPropertyDescriptor,xC="[object RegExp]";Lv.exports=Pv?function(t){if(!t||typeof t!="object")return!1;var e=_C(t,"lastIndex"),o=e&&Iv(e,"value");if(!o)return!1;try{Rv(t,id)}catch(a){return a===rd}}:function(t){return!t||typeof t!="object"&&typeof t!="function"?!1:vC(t)===xC}});var Dv=Jt((fF,Ov)=>{"use strict";var al=function(){return typeof function(){}.name=="string"},sl=Object.getOwnPropertyDescriptor;if(sl)try{sl([],"length")}catch(r){sl=null}al.functionsHaveConfigurableNames=function(){if(!al()||!sl)return!1;var t=sl(function(){},"name");return!!t&&!!t.configurable};var EC=Function.prototype.bind;al.boundFunctionsHaveNames=function(){return al()&&typeof EC=="function"&&function(){}.bind().name!==""};Ov.exports=al});var Bv=Jt((hF,Uv)=>{"use strict";var Fv=Xc(),MC=rl()(),SC=Dv().functionsHaveConfigurableNames(),wC=TypeError;Uv.exports=function(t,e){if(typeof t!="function")throw new wC("\`fn\` is not a function");var o=arguments.length>2&&!!arguments[2];return(!o||SC)&&(MC?Fv(t,"name",e,!0,!0):Fv(t,"name",e)),t}});var od=Jt((pF,zv)=>{"use strict";var bC=Bv(),TC=Object,AC=TypeError;zv.exports=bC(function(){if(this!=null&&this!==TC(this))throw new AC("RegExp.prototype.flags getter called on non-object");var t="";return this.hasIndices&&(t+="d"),this.global&&(t+="g"),this.ignoreCase&&(t+="i"),this.multiline&&(t+="m"),this.dotAll&&(t+="s"),this.unicode&&(t+="u"),this.unicodeSets&&(t+="v"),this.sticky&&(t+="y"),t},"get flags",!0)});var sd=Jt((dF,kv)=>{"use strict";var CC=od(),PC=lu().supportsDescriptors,IC=Object.getOwnPropertyDescriptor;kv.exports=function(){if(PC&&/a/mig.flags==="gim"){var t=IC(RegExp.prototype,"flags");if(t&&typeof t.get=="function"&&typeof RegExp.prototype.dotAll=="boolean"&&typeof RegExp.prototype.hasIndices=="boolean"){var e="",o={};if(Object.defineProperty(o,"hasIndices",{get:function(){e+="d"}}),Object.defineProperty(o,"sticky",{get:function(){e+="y"}}),e==="dy")return t.get}}return CC}});var Hv=Jt((mF,Vv)=>{"use strict";var RC=lu().supportsDescriptors,LC=sd(),NC=Object.getOwnPropertyDescriptor,OC=Object.defineProperty,DC=TypeError,Gv=Object.getPrototypeOf,FC=/a/;Vv.exports=function(){if(!RC||!Gv)throw new DC("RegExp.prototype.flags requires a true ES5 environment that supports property descriptors");var t=LC(),e=Gv(FC),o=NC(e,"flags");return(!o||o.get!==t)&&OC(e,"flags",{configurable:!0,enumerable:!1,get:t}),t}});var Yv=Jt((gF,Xv)=>{"use strict";var UC=lu(),BC=Zc(),zC=od(),Wv=sd(),kC=Hv(),qv=BC(Wv());UC(qv,{getPolyfill:Wv,implementation:zC,shim:kC});Xv.exports=qv});var Jv=Jt((yF,Zv)=>{"use strict";var GC=Date.prototype.getDay,VC=function(t){try{return GC.call(t),!0}catch(e){return!1}},HC=Object.prototype.toString,WC="[object Date]",qC=Gc()();Zv.exports=function(t){return typeof t!="object"||t===null?!1:qC?VC(t):HC.call(t)===WC}});var ad=Jt((vF,s_)=>{var $v=Hp(),Kv=mv(),jv=Cv(),Qv=Nv(),t_=Yv(),e_=Jv(),n_=Date.prototype.getTime;function o_(r,t,e){var o=e||{};return(o.strict?jv(r,t):r===t)?!0:!r||!t||typeof r!="object"&&typeof t!="object"?o.strict?jv(r,t):r==t:XC(r,t,o)}function r_(r){return r==null}function i_(r){return!(!r||typeof r!="object"||typeof r.length!="number"||typeof r.copy!="function"||typeof r.slice!="function"||r.length>0&&typeof r[0]!="number")}function XC(r,t,e){var o,a;if(typeof r!=typeof t||r_(r)||r_(t)||r.prototype!==t.prototype||Kv(r)!==Kv(t))return!1;var l=Qv(r),f=Qv(t);if(l!==f)return!1;if(l||f)return r.source===t.source&&t_(r)===t_(t);if(e_(r)&&e_(t))return n_.call(r)===n_.call(t);var h=i_(r),p=i_(t);if(h!==p)return!1;if(h||p){if(r.length!==t.length)return!1;for(o=0;o<r.length;o++)if(r[o]!==t[o])return!1;return!0}if(typeof r!=typeof t)return!1;try{var d=$v(r),g=$v(t)}catch(_){return!1}if(d.length!==g.length)return!1;for(d.sort(),g.sort(),o=d.length-1;o>=0;o--)if(d[o]!=g[o])return!1;for(o=d.length-1;o>=0;o--)if(a=d[o],!o_(r[a],t[a],e))return!1;return!0}s_.exports=o_});var _d=Jt((wB,p_)=>{var FP=ad(),yo=function(r){this.precision=r&&r.precision?r.precision:17,this.direction=r&&r.direction?r.direction:!1,this.pseudoNode=r&&r.pseudoNode?r.pseudoNode:!1,this.objectComparator=r&&r.objectComparator?r.objectComparator:UP};yo.prototype.compare=function(r,t){if(r.type!==t.type||!h_(r,t))return!1;switch(r.type){case"Point":return this.compareCoord(r.coordinates,t.coordinates);case"LineString":return this.compareLine(r.coordinates,t.coordinates,0,!1);case"Polygon":return this.comparePolygon(r,t);case"Feature":return this.compareFeature(r,t);default:if(r.type.indexOf("Multi")===0){var e=this,o=f_(r),a=f_(t);return o.every(function(l){return this.some(function(f){return e.compare(l,f)})},a)}}return!1};function f_(r){return r.coordinates.map(function(t){return{type:r.type.replace("Multi",""),coordinates:t}})}function h_(r,t){return r.hasOwnProperty("coordinates")?r.coordinates.length===t.coordinates.length:r.length===t.length}yo.prototype.compareCoord=function(r,t){if(r.length!==t.length)return!1;for(var e=0;e<r.length;e++)if(r[e].toFixed(this.precision)!==t[e].toFixed(this.precision))return!1;return!0};yo.prototype.compareLine=function(r,t,e,o){if(!h_(r,t))return!1;var a=this.pseudoNode?r:this.removePseudo(r),l=this.pseudoNode?t:this.removePseudo(t);if(!(o&&!this.compareCoord(a[0],l[0])&&(l=this.fixStartIndex(l,a),!l))){var f=this.compareCoord(a[e],l[e]);return this.direction||f?this.comparePath(a,l):this.compareCoord(a[e],l[l.length-(1+e)])?this.comparePath(a.slice().reverse(),l):!1}};yo.prototype.fixStartIndex=function(r,t){for(var e,o=-1,a=0;a<r.length;a++)if(this.compareCoord(r[a],t[0])){o=a;break}return o>=0&&(e=[].concat(r.slice(o,r.length),r.slice(1,o+1))),e};yo.prototype.comparePath=function(r,t){var e=this;return r.every(function(o,a){return e.compareCoord(o,this[a])},t)};yo.prototype.comparePolygon=function(r,t){if(this.compareLine(r.coordinates[0],t.coordinates[0],1,!0)){var e=r.coordinates.slice(1,r.coordinates.length),o=t.coordinates.slice(1,t.coordinates.length),a=this;return e.every(function(l){return this.some(function(f){return a.compareLine(l,f,1,!0)})},o)}else return!1};yo.prototype.compareFeature=function(r,t){return r.id!==t.id||!this.objectComparator(r.properties,t.properties)||!this.compareBBox(r,t)?!1:this.compare(r.geometry,t.geometry)};yo.prototype.compareBBox=function(r,t){return!!(!r.bbox&&!t.bbox||r.bbox&&t.bbox&&this.compareCoord(r.bbox,t.bbox))};yo.prototype.removePseudo=function(r){return r};function UP(r,t){return FP(r,t,{strict:!0})}p_.exports=yo});var d_=Jt((FB,Qc)=>{function Ms(r,t,e,o){this.dataset=[],this.epsilon=1,this.minPts=2,this.distance=this._euclideanDistance,this.clusters=[],this.noise=[],this._visited=[],this._assigned=[],this._datasetLength=0,this._init(r,t,e,o)}Ms.prototype.run=function(r,t,e,o){this._init(r,t,e,o);for(var a=0;a<this._datasetLength;a++)if(this._visited[a]!==1){this._visited[a]=1;var l=this._regionQuery(a);if(l.length<this.minPts)this.noise.push(a);else{var f=this.clusters.length;this.clusters.push([]),this._addToCluster(a,f),this._expandCluster(f,l)}}return this.clusters};Ms.prototype._init=function(r,t,e,o){if(r){if(!(r instanceof Array))throw Error("Dataset must be of type array, "+typeof r+" given");this.dataset=r,this.clusters=[],this.noise=[],this._datasetLength=r.length,this._visited=new Array(this._datasetLength),this._assigned=new Array(this._datasetLength)}t&&(this.epsilon=t),e&&(this.minPts=e),o&&(this.distance=o)};Ms.prototype._expandCluster=function(r,t){for(var e=0;e<t.length;e++){var o=t[e];if(this._visited[o]!==1){this._visited[o]=1;var a=this._regionQuery(o);a.length>=this.minPts&&(t=this._mergeArrays(t,a))}this._assigned[o]!==1&&this._addToCluster(o,r)}};Ms.prototype._addToCluster=function(r,t){this.clusters[t].push(r),this._assigned[r]=1};Ms.prototype._regionQuery=function(r){for(var t=[],e=0;e<this._datasetLength;e++){var o=this.distance(this.dataset[r],this.dataset[e]);o<this.epsilon&&t.push(e)}return t};Ms.prototype._mergeArrays=function(r,t){for(var e=t.length,o=0;o<e;o++){var a=t[o];r.indexOf(a)<0&&r.push(a)}return r};Ms.prototype._euclideanDistance=function(r,t){for(var e=0,o=Math.min(r.length,t.length);o--;)e+=(r[o]-t[o])*(r[o]-t[o]);return Math.sqrt(e)};typeof Qc!="undefined"&&Qc.exports&&(Qc.exports=Ms)});var m_=Jt((UB,tf)=>{function Ss(r,t,e){this.k=3,this.dataset=[],this.assignments=[],this.centroids=[],this.init(r,t,e)}Ss.prototype.init=function(r,t,e){this.assignments=[],this.centroids=[],typeof r!="undefined"&&(this.dataset=r),typeof t!="undefined"&&(this.k=t),typeof e!="undefined"&&(this.distance=e)};Ss.prototype.run=function(r,t){this.init(r,t);for(var e=this.dataset.length,o=0;o<this.k;o++)this.centroids[o]=this.randomCentroid();for(var a=!0;a;){a=this.assign();for(var l=0;l<this.k;l++){for(var f=new Array(g),h=0,p=0;p<g;p++)f[p]=0;for(var d=0;d<e;d++){var g=this.dataset[d].length;if(l===this.assignments[d]){for(var p=0;p<g;p++)f[p]+=this.dataset[d][p];h++}}if(h>0){for(var p=0;p<g;p++)f[p]/=h;this.centroids[l]=f}else this.centroids[l]=this.randomCentroid(),a=!0}}return this.getClusters()};Ss.prototype.randomCentroid=function(){var r=this.dataset.length-1,t,e;do e=Math.round(Math.random()*r),t=this.dataset[e];while(this.centroids.indexOf(t)>=0);return t};Ss.prototype.assign=function(){for(var r=!1,t=this.dataset.length,e,o=0;o<t;o++)e=this.argmin(this.dataset[o],this.centroids,this.distance),e!=this.assignments[o]&&(this.assignments[o]=e,r=!0);return r};Ss.prototype.getClusters=function(){for(var r=new Array(this.k),t,e=0;e<this.assignments.length;e++)t=this.assignments[e],typeof r[t]=="undefined"&&(r[t]=[]),r[t].push(e);return r};Ss.prototype.argmin=function(r,t,e){for(var o=Number.MAX_VALUE,a=0,l=t.length,f,h=0;h<l;h++)f=e(r,t[h]),f<o&&(o=f,a=h);return a};Ss.prototype.distance=function(r,t){for(var e=0,o=Math.min(r.length,t.length);o--;){var a=r[o]-t[o];e+=a*a}return Math.sqrt(e)};typeof tf!="undefined"&&tf.exports&&(tf.exports=Ss)});var xd=Jt((BB,ef)=>{function vo(r,t,e){this._queue=[],this._priorities=[],this._sorting="desc",this._init(r,t,e)}vo.prototype.insert=function(r,t){for(var e=this._queue.length,o=e;o--;){var a=this._priorities[o];this._sorting==="desc"?t>a&&(e=o):t<a&&(e=o)}this._insertAt(r,t,e)};vo.prototype.remove=function(r){for(var t=this._queue.length;t--;){var e=this._queue[t];if(r===e){this._queue.splice(t,1),this._priorities.splice(t,1);break}}};vo.prototype.forEach=function(r){this._queue.forEach(r)};vo.prototype.getElements=function(){return this._queue};vo.prototype.getElementPriority=function(r){return this._priorities[r]};vo.prototype.getPriorities=function(){return this._priorities};vo.prototype.getElementsWithPriorities=function(){for(var r=[],t=0,e=this._queue.length;t<e;t++)r.push([this._queue[t],this._priorities[t]]);return r};vo.prototype._init=function(r,t,e){if(r&&t){if(this._queue=[],this._priorities=[],r.length!==t.length)throw new Error("Arrays must have the same length");for(var o=0;o<r.length;o++)this.insert(r[o],t[o])}e&&(this._sorting=e)};vo.prototype._insertAt=function(r,t,e){this._queue.length===e?(this._queue.push(r),this._priorities.push(t)):(this._queue.splice(e,0,r),this._priorities.splice(e,0,t))};typeof ef!="undefined"&&ef.exports&&(ef.exports=vo)});var y_=Jt((zB,fu)=>{typeof fu!="undefined"&&fu.exports&&(g_=xd());var g_;function $o(r,t,e,o){this.epsilon=1,this.minPts=1,this.distance=this._euclideanDistance,this._reachability=[],this._processed=[],this._coreDistance=0,this._orderedList=[],this._init(r,t,e,o)}$o.prototype.run=function(r,t,e,o){this._init(r,t,e,o);for(var a=0,l=this.dataset.length;a<l;a++)if(this._processed[a]!==1){this._processed[a]=1,this.clusters.push([a]);var f=this.clusters.length-1;this._orderedList.push(a);var h=new g_(null,null,"asc"),p=this._regionQuery(a);this._distanceToCore(a)!==void 0&&(this._updateQueue(a,p,h),this._expandCluster(f,h))}return this.clusters};$o.prototype.getReachabilityPlot=function(){for(var r=[],t=0,e=this._orderedList.length;t<e;t++){var o=this._orderedList[t],a=this._reachability[o];r.push([o,a])}return r};$o.prototype._init=function(r,t,e,o){if(r){if(!(r instanceof Array))throw Error("Dataset must be of type array, "+typeof r+" given");this.dataset=r,this.clusters=[],this._reachability=new Array(this.dataset.length),this._processed=new Array(this.dataset.length),this._coreDistance=0,this._orderedList=[]}t&&(this.epsilon=t),e&&(this.minPts=e),o&&(this.distance=o)};$o.prototype._updateQueue=function(r,t,e){var o=this;this._coreDistance=this._distanceToCore(r),t.forEach(function(a){if(o._processed[a]===void 0){var l=o.distance(o.dataset[r],o.dataset[a]),f=Math.max(o._coreDistance,l);o._reachability[a]===void 0?(o._reachability[a]=f,e.insert(a,f)):f<o._reachability[a]&&(o._reachability[a]=f,e.remove(a),e.insert(a,f))}})};$o.prototype._expandCluster=function(r,t){for(var e=t.getElements(),o=0,a=e.length;o<a;o++){var l=e[o];if(this._processed[l]===void 0){var f=this._regionQuery(l);this._processed[l]=1,this.clusters[r].push(l),this._orderedList.push(l),this._distanceToCore(l)!==void 0&&(this._updateQueue(l,f,t),this._expandCluster(r,t))}}};$o.prototype._distanceToCore=function(r){for(var t=this.epsilon,e=0;e<t;e++){var o=this._regionQuery(r,e);if(o.length>=this.minPts)return e}};$o.prototype._regionQuery=function(r,t){t=t||this.epsilon;for(var e=[],o=0,a=this.dataset.length;o<a;o++)this.distance(this.dataset[r],this.dataset[o])<t&&e.push(o);return e};$o.prototype._euclideanDistance=function(r,t){for(var e=0,o=Math.min(r.length,t.length);o--;)e+=(r[o]-t[o])*(r[o]-t[o]);return Math.sqrt(e)};typeof fu!="undefined"&&fu.exports&&(fu.exports=$o)});var v_=Jt((kB,nf)=>{typeof nf!="undefined"&&nf.exports&&(nf.exports={DBSCAN:d_(),KMEANS:m_(),OPTICS:y_(),PriorityQueue:xd()})});var Ed=Jt((XB,x_)=>{"use strict";x_.exports={eudist:function(t,e,o){for(var a=t.length,l=0,f=0;f<a;f++){var h=(t[f]||0)-(e[f]||0);l+=h*h}return o?Math.sqrt(l):l},mandist:function(t,e,o){for(var a=t.length,l=0,f=0;f<a;f++)l+=Math.abs((t[f]||0)-(e[f]||0));return o?Math.sqrt(l):l},dist:function(t,e,o){var a=Math.abs(t-e);return o?a:a*a}}});var S_=Jt((YB,M_)=>{"use strict";var E_=Ed(),HP=E_.eudist,WP=E_.dist;M_.exports={kmrand:function(t,e){for(var o={},a=[],l=e<<2,f=t.length,h=t[0].length>0;a.length<e&&l-- >0;){var p=t[Math.floor(Math.random()*f)],d=h?p.join("_"):""+p;o[d]||(o[d]=!0,a.push(p))}if(a.length<e)throw new Error("Error initializating clusters");return a},kmpp:function(t,e){var o=t[0].length?HP:WP,a=[],l=t.length,f=t[0].length>0,h={},p=t[Math.floor(Math.random()*l)],d=f?p.join("_"):""+p;for(a.push(p),h[d]=!0;a.length<e;){for(var g=[],_=a.length,y=0,M=[],w=0;w<l;w++){for(var T=1/0,x=0;x<_;x++){var v=o(t[w],a[x]);v<=T&&(T=v)}g[w]=T}for(var C=0;C<l;C++)y+=g[C];for(var S=0;S<l;S++)M[S]={i:S,v:t[S],pr:g[S]/y,cs:0};M.sort(function(z,L){return z.pr-L.pr}),M[0].cs=M[0].pr;for(var O=1;O<l;O++)M[O].cs=M[O-1].cs+M[O].pr;for(var F=Math.random(),G=0;G<l-1&&M[G++].cs<F;);a.push(M[G-1].v)}return a}}});var C_=Jt(($B,A_)=>{"use strict";var Md=Ed(),T_=S_(),qP=Md.eudist,ZB=Md.mandist,JB=Md.dist,XP=T_.kmrand,YP=T_.kmpp,w_=1e4;function b_(r,t,e){e=e||[];for(var o=0;o<r;o++)e[o]=t;return e}function ZP(r,t,e,o){var a=[],l=[],f=[],h=[],p=!1,d=o||w_,g=r.length,_=r[0].length,y=_>0,M=[];if(e)e=="kmrand"?a=XP(r,t):e=="kmpp"?a=YP(r,t):a=e;else for(var w={};a.length<t;){var T=Math.floor(Math.random()*g);w[T]||(w[T]=!0,a.push(r[T]))}do{b_(t,0,M);for(var x=0;x<g;x++){for(var v=1/0,C=0,S=0;S<t;S++){var h=y?qP(r[x],a[S]):Math.abs(r[x]-a[S]);h<=v&&(v=h,C=S)}f[x]=C,M[C]++}for(var O=[],l=[],F=0,G=0;G<t;G++)O[G]=y?b_(_,0,O[G]):0,l[G]=a[G];if(y){for(var z=0;z<t;z++)a[z]=[];for(var L=0;L<g;L++)for(var D=f[L],q=O[D],nt=r[L],k=0;k<_;k++)q[k]+=nt[k];p=!0;for(var xt=0;xt<t;xt++){for(var X=a[xt],it=O[xt],vt=l[xt],pt=M[xt],et=0;et<_;et++)X[et]=it[et]/pt||0;if(p){for(var ot=0;ot<_;ot++)if(vt[ot]!=X[ot]){p=!1;break}}}}else{for(var V=0;V<g;V++){var K=f[V];O[K]+=r[V]}for(var at=0;at<t;at++)a[at]=O[at]/M[at]||0;p=!0;for(var Tt=0;Tt<t;Tt++)if(l[Tt]!=a[Tt]){p=!1;break}}p=p||--d<=0}while(!p);return{it:w_-d,k:t,idxs:f,centroids:a}}A_.exports=ZP});var gu=Jt((Cd,Pd)=>{(function(r,t){typeof Cd=="object"&&typeof Pd!="undefined"?Pd.exports=t():typeof define=="function"&&define.amd?define(t):(r=typeof globalThis!="undefined"?globalThis:r||self,r.polygonClipping=t())})(Cd,function(){"use strict";function r($,N){if(!($ instanceof N))throw new TypeError("Cannot call a class as a function")}function t($,N){for(var b=0;b<N.length;b++){var R=N[b];R.enumerable=R.enumerable||!1,R.configurable=!0,"value"in R&&(R.writable=!0),Object.defineProperty($,R.key,R)}}function e($,N,b){return N&&t($.prototype,N),b&&t($,b),$}var o=function(){function $(N,b){this.next=null,this.key=N,this.data=b,this.left=null,this.right=null}return $}();function a($,N){return $>N?1:$<N?-1:0}function l($,N,b){for(var R=new o(null,null),W=R,J=R;;){var I=b($,N.key);if(I<0){if(N.left===null)break;if(b($,N.left.key)<0){var P=N.left;if(N.left=P.right,P.right=N,N=P,N.left===null)break}J.left=N,J=N,N=N.left}else if(I>0){if(N.right===null)break;if(b($,N.right.key)>0){var P=N.right;if(N.right=P.left,P.left=N,N=P,N.right===null)break}W.right=N,W=N,N=N.right}else break}return W.right=N.left,J.left=N.right,N.left=R.right,N.right=R.left,N}function f($,N,b,R){var W=new o($,N);if(b===null)return W.left=W.right=null,W;b=l($,b,R);var J=R($,b.key);return J<0?(W.left=b.left,W.right=b,b.left=null):J>=0&&(W.right=b.right,W.left=b,b.right=null),W}function h($,N,b){var R=null,W=null;if(N){N=l($,N,b);var J=b(N.key,$);J===0?(R=N.left,W=N.right):J<0?(W=N.right,N.right=null,R=N):(R=N.left,N.left=null,W=N)}return{left:R,right:W}}function p($,N,b){return N===null?$:($===null||(N=l($.key,N,b),N.left=$),N)}function d($,N,b,R,W){if($){R(""+N+(b?"\\u2514\\u2500\\u2500 ":"\\u251C\\u2500\\u2500 ")+W($)+\`
|
|
3820
|
+
`)}var Pr=class extends Ar.EventDispatcher{worker=rn();initRoadStatus=!1;constructor(){super()}async setRoadData(n,t){this.initRoadStatus=!1,this.dispatchEvent({type:"init-road-status",status:!1}),await lt(this.worker,"set_road_info",{roadData:n,facilities:t}),this.initRoadStatus=!0,this.dispatchEvent({type:"init-road-status",status:!0})}async getPath(n,t,e=""){return new Promise((r,i)=>{let o=()=>{console.log("initRoadStatus",this.initRoadStatus),lt(this.worker,"get_path",{start:n,end:t,type:e}).then(a=>{a?typeof a=="string"?i(a):r(a):i("no-path")})};if(this.initRoadStatus)o();else{let a=({status:l})=>{l&&(this.removeEventListener("init-road-status",a),o())};this.addEventListener("init-road-status",a)}})}getDirectionPath(n){return lt(this.worker,"get_direction_path",n)}async dispose(){lt(this.worker,"clear",""),this.worker.terminate()}};var Ir=g("three");function on(){return Kt(`var N1=Object.create;var Rf=Object.defineProperty;var O1=Object.getOwnPropertyDescriptor;var D1=Object.getOwnPropertyNames,fm=Object.getOwnPropertySymbols,F1=Object.getPrototypeOf,hm=Object.prototype.hasOwnProperty,U1=Object.prototype.propertyIsEnumerable;var If=(r,t,e)=>t in r?Rf(r,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[t]=e,Tl=(r,t)=>{for(var e in t||(t={}))hm.call(t,e)&&If(r,e,t[e]);if(fm)for(var e of fm(t))U1.call(t,e)&&If(r,e,t[e]);return r};var Jt=(r,t)=>()=>(t||r((t={exports:{}}).exports,t),t.exports);var B1=(r,t,e,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of D1(t))!hm.call(r,a)&&a!==e&&Rf(r,a,{get:()=>t[a],enumerable:!(o=O1(t,a))||o.enumerable});return r};var On=(r,t,e)=>(e=r!=null?N1(F1(r)):{},B1(t||!r||!r.__esModule?Rf(e,"default",{value:r,enumerable:!0}):e,r));var vi=(r,t,e)=>If(r,typeof t!="symbol"?t+"":t,e);var dm=Jt((lR,pm)=>{var Lf=class{constructor(){this.keys=new Set,this.queue=[]}sort(){this.queue.sort((t,e)=>t.priority-e.priority)}set(t,e){let o=Number(e);if(isNaN(o))throw new TypeError('"priority" must be a number');return this.keys.has(t)?this.queue.map(a=>(a.key===t&&Object.assign(a,{priority:o}),a)):(this.keys.add(t),this.queue.push({key:t,priority:o})),this.sort(),this.queue.length}next(){let t=this.queue.shift();return this.keys.delete(t.key),t}isEmpty(){return this.queue.length===0}has(t){return this.keys.has(t)}get(t){return this.queue.find(e=>e.key===t)}};pm.exports=Lf});var ym=Jt((cR,gm)=>{function mm(r,t){let e=new Map;for(let[o,a]of r)o!==t&&a instanceof Map?e.set(o,mm(a,t)):o!==t&&e.set(o,a);return e}gm.exports=mm});var xm=Jt((fR,_m)=>{function z1(r){let t=Number(r);return!(isNaN(t)||t<=0)}function vm(r){let t=new Map;return Object.keys(r).forEach(o=>{let a=r[o];if(a!==null&&typeof a=="object"&&!Array.isArray(a))return t.set(o,vm(a));if(!z1(a))throw new Error(\`Could not add node at key "\${o}", make sure it's a valid node\`,a);return t.set(o,Number(a))}),t}_m.exports=vm});var Sm=Jt((hR,Mm)=>{function Em(r){if(!(r instanceof Map))throw new Error(\`Invalid graph: Expected Map instead found \${typeof r}\`);r.forEach((t,e)=>{if(typeof t=="object"&&t instanceof Map){Em(t);return}if(typeof t!="number"||t<=0)throw new Error(\`Values must be numbers greater than 0. Found value \${t} at \${e}\`)})}Mm.exports=Em});var Am=Jt((pR,Tm)=>{var k1=dm(),G1=ym(),wm=xm(),bm=Sm(),Nf=class{constructor(t){t instanceof Map?(bm(t),this.graph=t):t?this.graph=wm(t):this.graph=new Map}addNode(t,e){let o;return e instanceof Map?(bm(e),o=e):o=wm(e),this.graph.set(t,o),this}addVertex(t,e){return this.addNode(t,e)}removeNode(t){return this.graph=G1(this.graph,t),this}path(t,e,o={}){if(!this.graph.size)return o.cost?{path:null,cost:0}:null;let a=new Set,l=new k1,f=new Map,h=[],p=0,d=[];if(o.avoid&&(d=[].concat(o.avoid)),d.includes(t))throw new Error(\`Starting node (\${t}) cannot be avoided\`);if(d.includes(e))throw new Error(\`Ending node (\${e}) cannot be avoided\`);for(l.set(t,0);!l.isEmpty();){let g=l.next();if(g.key===e){p=g.priority;let y=g.key;for(;f.has(y);)h.push(y),y=f.get(y);break}a.add(g.key),(this.graph.get(g.key)||new Map).forEach((y,M)=>{if(a.has(M)||d.includes(M))return null;if(!l.has(M))return f.set(M,g.key),l.set(M,g.priority+y);let w=l.get(M).priority,T=g.priority+y;return T<w?(f.set(M,g.key),l.set(M,T)):null})}return h.length?(o.trim?h.shift():h=h.concat([t]),o.reverse||(h=h.reverse()),o.cost?{path:h,cost:p}:h):o.cost?{path:null,cost:0}:null}shortestPath(...t){return this.path(...t)}};Tm.exports=Nf});var yc=Jt((MR,y0)=>{"use strict";var g0=Object.getOwnPropertySymbols,Vb=Object.prototype.hasOwnProperty,Hb=Object.prototype.propertyIsEnumerable;function Wb(r){if(r==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(r)}function qb(){try{if(!Object.assign)return!1;var r=new String("abc");if(r[5]="de",Object.getOwnPropertyNames(r)[0]==="5")return!1;for(var t={},e=0;e<10;e++)t["_"+String.fromCharCode(e)]=e;var o=Object.getOwnPropertyNames(t).map(function(l){return t[l]});if(o.join("")!=="0123456789")return!1;var a={};return"abcdefghijklmnopqrst".split("").forEach(function(l){a[l]=l}),Object.keys(Object.assign({},a)).join("")==="abcdefghijklmnopqrst"}catch(l){return!1}}y0.exports=qb()?Object.assign:function(r,t){for(var e,o=Wb(r),a,l=1;l<arguments.length;l++){e=Object(arguments[l]);for(var f in e)Vb.call(e,f)&&(o[f]=e[f]);if(g0){a=g0(e);for(var h=0;h<a.length;h++)Hb.call(e,a[h])&&(o[a[h]]=e[a[h]])}}return o}});var op=Jt((rp,ip)=>{(function(r,t){typeof rp=="object"&&typeof ip!="undefined"?ip.exports=t():typeof define=="function"&&define.amd?define(t):(r=r||self).RBush=t()})(rp,function(){"use strict";function r(x,v,C,S,O){(function F(G,z,L,D,q){for(;D>L;){if(D-L>600){var nt=D-L+1,k=z-L+1,xt=Math.log(nt),X=.5*Math.exp(2*xt/3),it=.5*Math.sqrt(xt*X*(nt-X)/nt)*(k-nt/2<0?-1:1),vt=Math.max(L,Math.floor(z-k*X/nt+it)),pt=Math.min(D,Math.floor(z+(nt-k)*X/nt+it));F(G,z,vt,pt,q)}var et=G[z],ot=L,V=D;for(t(G,L,z),q(G[D],et)>0&&t(G,L,D);ot<V;){for(t(G,ot,V),ot++,V--;q(G[ot],et)<0;)ot++;for(;q(G[V],et)>0;)V--}q(G[L],et)===0?t(G,L,V):t(G,++V,D),V<=z&&(L=V+1),z<=V&&(D=V-1)}})(x,v,C||0,S||x.length-1,O||e)}function t(x,v,C){var S=x[v];x[v]=x[C],x[C]=S}function e(x,v){return x<v?-1:x>v?1:0}var o=function(x){x===void 0&&(x=9),this._maxEntries=Math.max(4,x),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()};function a(x,v,C){if(!C)return v.indexOf(x);for(var S=0;S<v.length;S++)if(C(x,v[S]))return S;return-1}function l(x,v){f(x,0,x.children.length,v,x)}function f(x,v,C,S,O){O||(O=w(null)),O.minX=1/0,O.minY=1/0,O.maxX=-1/0,O.maxY=-1/0;for(var F=v;F<C;F++){var G=x.children[F];h(O,x.leaf?S(G):G)}return O}function h(x,v){return x.minX=Math.min(x.minX,v.minX),x.minY=Math.min(x.minY,v.minY),x.maxX=Math.max(x.maxX,v.maxX),x.maxY=Math.max(x.maxY,v.maxY),x}function p(x,v){return x.minX-v.minX}function d(x,v){return x.minY-v.minY}function g(x){return(x.maxX-x.minX)*(x.maxY-x.minY)}function _(x){return x.maxX-x.minX+(x.maxY-x.minY)}function y(x,v){return x.minX<=v.minX&&x.minY<=v.minY&&v.maxX<=x.maxX&&v.maxY<=x.maxY}function M(x,v){return v.minX<=x.maxX&&v.minY<=x.maxY&&v.maxX>=x.minX&&v.maxY>=x.minY}function w(x){return{children:x,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function T(x,v,C,S,O){for(var F=[v,C];F.length;)if(!((C=F.pop())-(v=F.pop())<=S)){var G=v+Math.ceil((C-v)/S/2)*S;r(x,G,v,C,O),F.push(v,G,G,C)}}return o.prototype.all=function(){return this._all(this.data,[])},o.prototype.search=function(x){var v=this.data,C=[];if(!M(x,v))return C;for(var S=this.toBBox,O=[];v;){for(var F=0;F<v.children.length;F++){var G=v.children[F],z=v.leaf?S(G):G;M(x,z)&&(v.leaf?C.push(G):y(x,z)?this._all(G,C):O.push(G))}v=O.pop()}return C},o.prototype.collides=function(x){var v=this.data;if(!M(x,v))return!1;for(var C=[];v;){for(var S=0;S<v.children.length;S++){var O=v.children[S],F=v.leaf?this.toBBox(O):O;if(M(x,F)){if(v.leaf||y(x,F))return!0;C.push(O)}}v=C.pop()}return!1},o.prototype.load=function(x){if(!x||!x.length)return this;if(x.length<this._minEntries){for(var v=0;v<x.length;v++)this.insert(x[v]);return this}var C=this._build(x.slice(),0,x.length-1,0);if(this.data.children.length)if(this.data.height===C.height)this._splitRoot(this.data,C);else{if(this.data.height<C.height){var S=this.data;this.data=C,C=S}this._insert(C,this.data.height-C.height-1,!0)}else this.data=C;return this},o.prototype.insert=function(x){return x&&this._insert(x,this.data.height-1),this},o.prototype.clear=function(){return this.data=w([]),this},o.prototype.remove=function(x,v){if(!x)return this;for(var C,S,O,F=this.data,G=this.toBBox(x),z=[],L=[];F||z.length;){if(F||(F=z.pop(),S=z[z.length-1],C=L.pop(),O=!0),F.leaf){var D=a(x,F.children,v);if(D!==-1)return F.children.splice(D,1),z.push(F),this._condense(z),this}O||F.leaf||!y(F,G)?S?(C++,F=S.children[C],O=!1):F=null:(z.push(F),L.push(C),C=0,S=F,F=F.children[0])}return this},o.prototype.toBBox=function(x){return x},o.prototype.compareMinX=function(x,v){return x.minX-v.minX},o.prototype.compareMinY=function(x,v){return x.minY-v.minY},o.prototype.toJSON=function(){return this.data},o.prototype.fromJSON=function(x){return this.data=x,this},o.prototype._all=function(x,v){for(var C=[];x;)x.leaf?v.push.apply(v,x.children):C.push.apply(C,x.children),x=C.pop();return v},o.prototype._build=function(x,v,C,S){var O,F=C-v+1,G=this._maxEntries;if(F<=G)return l(O=w(x.slice(v,C+1)),this.toBBox),O;S||(S=Math.ceil(Math.log(F)/Math.log(G)),G=Math.ceil(F/Math.pow(G,S-1))),(O=w([])).leaf=!1,O.height=S;var z=Math.ceil(F/G),L=z*Math.ceil(Math.sqrt(G));T(x,v,C,L,this.compareMinX);for(var D=v;D<=C;D+=L){var q=Math.min(D+L-1,C);T(x,D,q,z,this.compareMinY);for(var nt=D;nt<=q;nt+=z){var k=Math.min(nt+z-1,q);O.children.push(this._build(x,nt,k,S-1))}}return l(O,this.toBBox),O},o.prototype._chooseSubtree=function(x,v,C,S){for(;S.push(v),!v.leaf&&S.length-1!==C;){for(var O=1/0,F=1/0,G=void 0,z=0;z<v.children.length;z++){var L=v.children[z],D=g(L),q=(nt=x,k=L,(Math.max(k.maxX,nt.maxX)-Math.min(k.minX,nt.minX))*(Math.max(k.maxY,nt.maxY)-Math.min(k.minY,nt.minY))-D);q<F?(F=q,O=D<O?D:O,G=L):q===F&&D<O&&(O=D,G=L)}v=G||v.children[0]}var nt,k;return v},o.prototype._insert=function(x,v,C){var S=C?x:this.toBBox(x),O=[],F=this._chooseSubtree(S,this.data,v,O);for(F.children.push(x),h(F,S);v>=0&&O[v].children.length>this._maxEntries;)this._split(O,v),v--;this._adjustParentBBoxes(S,O,v)},o.prototype._split=function(x,v){var C=x[v],S=C.children.length,O=this._minEntries;this._chooseSplitAxis(C,O,S);var F=this._chooseSplitIndex(C,O,S),G=w(C.children.splice(F,C.children.length-F));G.height=C.height,G.leaf=C.leaf,l(C,this.toBBox),l(G,this.toBBox),v?x[v-1].children.push(G):this._splitRoot(C,G)},o.prototype._splitRoot=function(x,v){this.data=w([x,v]),this.data.height=x.height+1,this.data.leaf=!1,l(this.data,this.toBBox)},o.prototype._chooseSplitIndex=function(x,v,C){for(var S,O,F,G,z,L,D,q=1/0,nt=1/0,k=v;k<=C-v;k++){var xt=f(x,0,k,this.toBBox),X=f(x,k,C,this.toBBox),it=(O=xt,F=X,G=void 0,z=void 0,L=void 0,D=void 0,G=Math.max(O.minX,F.minX),z=Math.max(O.minY,F.minY),L=Math.min(O.maxX,F.maxX),D=Math.min(O.maxY,F.maxY),Math.max(0,L-G)*Math.max(0,D-z)),vt=g(xt)+g(X);it<q?(q=it,S=k,nt=vt<nt?vt:nt):it===q&&vt<nt&&(nt=vt,S=k)}return S||C-v},o.prototype._chooseSplitAxis=function(x,v,C){var S=x.leaf?this.compareMinX:p,O=x.leaf?this.compareMinY:d;this._allDistMargin(x,v,C,S)<this._allDistMargin(x,v,C,O)&&x.children.sort(S)},o.prototype._allDistMargin=function(x,v,C,S){x.children.sort(S);for(var O=this.toBBox,F=f(x,0,v,O),G=f(x,C-v,C,O),z=_(F)+_(G),L=v;L<C-v;L++){var D=x.children[L];h(F,x.leaf?O(D):D),z+=_(F)}for(var q=C-v-1;q>=v;q--){var nt=x.children[q];h(G,x.leaf?O(nt):nt),z+=_(G)}return z},o.prototype._adjustParentBBoxes=function(x,v,C){for(var S=C;S>=0;S--)h(v[S],x)},o.prototype._condense=function(x){for(var v=x.length-1,C=void 0;v>=0;v--)x[v].children.length===0?v>0?(C=x[v-1].children).splice(C.indexOf(x[v]),1):this.clear():l(x[v],this.toBBox)},o})});var v0=Jt((sp,ap)=>{(function(r,t){typeof sp=="object"&&typeof ap!="undefined"?ap.exports=t():typeof define=="function"&&define.amd?define(t):(r=r||self,r.TinyQueue=t())})(sp,function(){"use strict";var r=function(o,a){if(o===void 0&&(o=[]),a===void 0&&(a=t),this.data=o,this.length=this.data.length,this.compare=a,this.length>0)for(var l=(this.length>>1)-1;l>=0;l--)this._down(l)};r.prototype.push=function(o){this.data.push(o),this.length++,this._up(this.length-1)},r.prototype.pop=function(){if(this.length!==0){var o=this.data[0],a=this.data.pop();return this.length--,this.length>0&&(this.data[0]=a,this._down(0)),o}},r.prototype.peek=function(){return this.data[0]},r.prototype._up=function(o){for(var a=this,l=a.data,f=a.compare,h=l[o];o>0;){var p=o-1>>1,d=l[p];if(f(h,d)>=0)break;l[o]=d,o=p}l[o]=h},r.prototype._down=function(o){for(var a=this,l=a.data,f=a.compare,h=this.length>>1,p=l[o];o<h;){var d=(o<<1)+1,g=l[d],_=d+1;if(_<this.length&&f(l[_],g)<0&&(d=_,g=l[_]),f(g,p)>=0)break;l[o]=g,o=d}l[o]=p};function t(e,o){return e<o?-1:e>o?1:0}return r})});var x0=Jt((CR,_0)=>{_0.exports=function(t,e,o,a){var l=t[0],f=t[1],h=!1;o===void 0&&(o=0),a===void 0&&(a=e.length);for(var p=(a-o)/2,d=0,g=p-1;d<p;g=d++){var _=e[o+d*2+0],y=e[o+d*2+1],M=e[o+g*2+0],w=e[o+g*2+1],T=y>f!=w>f&&l<(M-_)*(f-y)/(w-y)+_;T&&(h=!h)}return h}});var M0=Jt((PR,E0)=>{E0.exports=function(t,e,o,a){var l=t[0],f=t[1],h=!1;o===void 0&&(o=0),a===void 0&&(a=e.length);for(var p=a-o,d=0,g=p-1;d<p;g=d++){var _=e[d+o][0],y=e[d+o][1],M=e[g+o][0],w=e[g+o][1],T=y>f!=w>f&&l<(M-_)*(f-y)/(w-y)+_;T&&(h=!h)}return h}});var b0=Jt((IR,xc)=>{var S0=x0(),w0=M0();xc.exports=function(t,e,o,a){return e.length>0&&Array.isArray(e[0])?w0(t,e,o,a):S0(t,e,o,a)};xc.exports.nested=w0;xc.exports.flat=S0});var A0=Jt((Ec,T0)=>{(function(r,t){typeof Ec=="object"&&typeof T0!="undefined"?t(Ec):typeof define=="function"&&define.amd?define(["exports"],t):t((r=r||self).predicates={})})(Ec,function(r){"use strict";let e=33306690738754706e-32;function o(M,w,T,x,v){let C,S,O,F,G=w[0],z=x[0],L=0,D=0;z>G==z>-G?(C=G,G=w[++L]):(C=z,z=x[++D]);let q=0;if(L<M&&D<T)for(z>G==z>-G?(O=C-((S=G+C)-G),G=w[++L]):(O=C-((S=z+C)-z),z=x[++D]),C=S,O!==0&&(v[q++]=O);L<M&&D<T;)z>G==z>-G?(O=C-((S=C+G)-(F=S-C))+(G-F),G=w[++L]):(O=C-((S=C+z)-(F=S-C))+(z-F),z=x[++D]),C=S,O!==0&&(v[q++]=O);for(;L<M;)O=C-((S=C+G)-(F=S-C))+(G-F),G=w[++L],C=S,O!==0&&(v[q++]=O);for(;D<T;)O=C-((S=C+z)-(F=S-C))+(z-F),z=x[++D],C=S,O!==0&&(v[q++]=O);return C===0&&q!==0||(v[q++]=C),q}function a(M){return new Float64Array(M)}let l=33306690738754716e-32,f=22204460492503146e-32,h=11093356479670487e-47,p=a(4),d=a(8),g=a(12),_=a(16),y=a(4);r.orient2d=function(M,w,T,x,v,C){let S=(w-C)*(T-v),O=(M-v)*(x-C),F=S-O;if(S===0||O===0||S>0!=O>0)return F;let G=Math.abs(S+O);return Math.abs(F)>=l*G?F:-function(z,L,D,q,nt,k,xt){let X,it,vt,pt,et,ot,V,K,at,Tt,dt,Ct,Yt,Wt,Nt,ne,Pt,Xt,tt=z-nt,nn=D-nt,Gt=L-k,te=q-k;et=(Nt=(K=tt-(V=(ot=134217729*tt)-(ot-tt)))*(Tt=te-(at=(ot=134217729*te)-(ot-te)))-((Wt=tt*te)-V*at-K*at-V*Tt))-(dt=Nt-(Pt=(K=Gt-(V=(ot=134217729*Gt)-(ot-Gt)))*(Tt=nn-(at=(ot=134217729*nn)-(ot-nn)))-((ne=Gt*nn)-V*at-K*at-V*Tt))),p[0]=Nt-(dt+et)+(et-Pt),et=(Yt=Wt-((Ct=Wt+dt)-(et=Ct-Wt))+(dt-et))-(dt=Yt-ne),p[1]=Yt-(dt+et)+(et-ne),et=(Xt=Ct+dt)-Ct,p[2]=Ct-(Xt-et)+(dt-et),p[3]=Xt;let qt=function(W,J){let I=J[0];for(let P=1;P<W;P++)I+=J[P];return I}(4,p),$=f*xt;if(qt>=$||-qt>=$||(X=z-(tt+(et=z-tt))+(et-nt),vt=D-(nn+(et=D-nn))+(et-nt),it=L-(Gt+(et=L-Gt))+(et-k),pt=q-(te+(et=q-te))+(et-k),X===0&&it===0&&vt===0&&pt===0)||($=h*xt+e*Math.abs(qt),(qt+=tt*pt+te*X-(Gt*vt+nn*it))>=$||-qt>=$))return qt;et=(Nt=(K=X-(V=(ot=134217729*X)-(ot-X)))*(Tt=te-(at=(ot=134217729*te)-(ot-te)))-((Wt=X*te)-V*at-K*at-V*Tt))-(dt=Nt-(Pt=(K=it-(V=(ot=134217729*it)-(ot-it)))*(Tt=nn-(at=(ot=134217729*nn)-(ot-nn)))-((ne=it*nn)-V*at-K*at-V*Tt))),y[0]=Nt-(dt+et)+(et-Pt),et=(Yt=Wt-((Ct=Wt+dt)-(et=Ct-Wt))+(dt-et))-(dt=Yt-ne),y[1]=Yt-(dt+et)+(et-ne),et=(Xt=Ct+dt)-Ct,y[2]=Ct-(Xt-et)+(dt-et),y[3]=Xt;let N=o(4,p,4,y,d);et=(Nt=(K=tt-(V=(ot=134217729*tt)-(ot-tt)))*(Tt=pt-(at=(ot=134217729*pt)-(ot-pt)))-((Wt=tt*pt)-V*at-K*at-V*Tt))-(dt=Nt-(Pt=(K=Gt-(V=(ot=134217729*Gt)-(ot-Gt)))*(Tt=vt-(at=(ot=134217729*vt)-(ot-vt)))-((ne=Gt*vt)-V*at-K*at-V*Tt))),y[0]=Nt-(dt+et)+(et-Pt),et=(Yt=Wt-((Ct=Wt+dt)-(et=Ct-Wt))+(dt-et))-(dt=Yt-ne),y[1]=Yt-(dt+et)+(et-ne),et=(Xt=Ct+dt)-Ct,y[2]=Ct-(Xt-et)+(dt-et),y[3]=Xt;let b=o(N,d,4,y,g);et=(Nt=(K=X-(V=(ot=134217729*X)-(ot-X)))*(Tt=pt-(at=(ot=134217729*pt)-(ot-pt)))-((Wt=X*pt)-V*at-K*at-V*Tt))-(dt=Nt-(Pt=(K=it-(V=(ot=134217729*it)-(ot-it)))*(Tt=vt-(at=(ot=134217729*vt)-(ot-vt)))-((ne=it*vt)-V*at-K*at-V*Tt))),y[0]=Nt-(dt+et)+(et-Pt),et=(Yt=Wt-((Ct=Wt+dt)-(et=Ct-Wt))+(dt-et))-(dt=Yt-ne),y[1]=Yt-(dt+et)+(et-ne),et=(Xt=Ct+dt)-Ct,y[2]=Ct-(Xt-et)+(dt-et),y[3]=Xt;let R=o(b,g,4,y,_);return _[R-1]}(M,w,T,x,v,C,G)},r.orient2dfast=function(M,w,T,x,v,C){return(w-C)*(T-v)-(M-v)*(x-C)},Object.defineProperty(r,"__esModule",{value:!0})})});var N0=Jt((RR,fp)=>{"use strict";var C0=op(),Sc=v0(),Yb=b0(),Zb=A0().orient2d;Sc.default&&(Sc=Sc.default);fp.exports=L0;fp.exports.default=L0;function L0(r,t,e){t=Math.max(0,t===void 0?2:t),e=e||0;var o=Qb(r),a=new C0(16);a.toBBox=function(C){return{minX:C[0],minY:C[1],maxX:C[0],maxY:C[1]}},a.compareMinX=function(C,S){return C[0]-S[0]},a.compareMinY=function(C,S){return C[1]-S[1]},a.load(r);for(var l=[],f=0,h;f<o.length;f++){var p=o[f];a.remove(p),h=R0(p,h),l.push(h)}var d=new C0(16);for(f=0;f<l.length;f++)d.insert(up(l[f]));for(var g=t*t,_=e*e;l.length;){var y=l.shift(),M=y.p,w=y.next.p,T=lp(M,w);if(!(T<_)){var x=T/g;p=Jb(a,y.prev.p,M,w,y.next.next.p,x,d),p&&Math.min(lp(p,M),lp(p,w))<=x&&(l.push(y),l.push(R0(p,y)),a.remove(p),d.remove(y),d.insert(up(y)),d.insert(up(y.next)))}}y=h;var v=[];do v.push(y.p),y=y.next;while(y!==h);return v.push(y.p),v}function Jb(r,t,e,o,a,l,f){for(var h=new Sc([],$b),p=r.data;p;){for(var d=0;d<p.children.length;d++){var g=p.children[d],_=p.leaf?cp(g,e,o):Kb(e,o,g);_>l||h.push({node:g,dist:_})}for(;h.length&&!h.peek().node.children;){var y=h.pop(),M=y.node,w=cp(M,t,e),T=cp(M,o,a);if(y.dist<w&&y.dist<T&&I0(e,M,f)&&I0(o,M,f))return M}p=h.pop(),p&&(p=p.node)}return null}function $b(r,t){return r.dist-t.dist}function Kb(r,t,e){if(P0(r,e)||P0(t,e))return 0;var o=Mc(r[0],r[1],t[0],t[1],e.minX,e.minY,e.maxX,e.minY);if(o===0)return 0;var a=Mc(r[0],r[1],t[0],t[1],e.minX,e.minY,e.minX,e.maxY);if(a===0)return 0;var l=Mc(r[0],r[1],t[0],t[1],e.maxX,e.minY,e.maxX,e.maxY);if(l===0)return 0;var f=Mc(r[0],r[1],t[0],t[1],e.minX,e.maxY,e.maxX,e.maxY);return f===0?0:Math.min(o,a,l,f)}function P0(r,t){return r[0]>=t.minX&&r[0]<=t.maxX&&r[1]>=t.minY&&r[1]<=t.maxY}function I0(r,t,e){for(var o=Math.min(r[0],t[0]),a=Math.min(r[1],t[1]),l=Math.max(r[0],t[0]),f=Math.max(r[1],t[1]),h=e.search({minX:o,minY:a,maxX:l,maxY:f}),p=0;p<h.length;p++)if(jb(h[p].p,h[p].next.p,r,t))return!1;return!0}function Ja(r,t,e){return Zb(r[0],r[1],t[0],t[1],e[0],e[1])}function jb(r,t,e,o){return r!==o&&t!==e&&Ja(r,t,e)>0!=Ja(r,t,o)>0&&Ja(e,o,r)>0!=Ja(e,o,t)>0}function up(r){var t=r.p,e=r.next.p;return r.minX=Math.min(t[0],e[0]),r.minY=Math.min(t[1],e[1]),r.maxX=Math.max(t[0],e[0]),r.maxY=Math.max(t[1],e[1]),r}function Qb(r){for(var t=r[0],e=r[0],o=r[0],a=r[0],l=0;l<r.length;l++){var f=r[l];f[0]<t[0]&&(t=f),f[0]>o[0]&&(o=f),f[1]<e[1]&&(e=f),f[1]>a[1]&&(a=f)}var h=[t,e,o,a],p=h.slice();for(l=0;l<r.length;l++)Yb(r[l],h)||p.push(r[l]);return eT(p)}function R0(r,t){var e={p:r,prev:null,next:null,minX:0,minY:0,maxX:0,maxY:0};return t?(e.next=t.next,e.prev=t,t.next.prev=e,t.next=e):(e.prev=e,e.next=e),e}function lp(r,t){var e=r[0]-t[0],o=r[1]-t[1];return e*e+o*o}function cp(r,t,e){var o=t[0],a=t[1],l=e[0]-o,f=e[1]-a;if(l!==0||f!==0){var h=((r[0]-o)*l+(r[1]-a)*f)/(l*l+f*f);h>1?(o=e[0],a=e[1]):h>0&&(o+=l*h,a+=f*h)}return l=r[0]-o,f=r[1]-a,l*l+f*f}function Mc(r,t,e,o,a,l,f,h){var p=e-r,d=o-t,g=f-a,_=h-l,y=r-a,M=t-l,w=p*p+d*d,T=p*g+d*_,x=g*g+_*_,v=p*y+d*M,C=g*y+_*M,S=w*x-T*T,O,F,G,z,L=S,D=S;S===0?(F=0,L=1,z=C,D=x):(F=T*C-x*v,z=w*C-T*v,F<0?(F=0,z=C,D=x):F>L&&(F=L,z=C+T,D=x)),z<0?(z=0,-v<0?F=0:-v>w?F=L:(F=-v,L=w)):z>D&&(z=D,-v+T<0?F=0:-v+T>w?F=L:(F=-v+T,L=w)),O=F===0?0:F/L,G=z===0?0:z/D;var q=(1-O)*r+O*e,nt=(1-O)*t+O*o,k=(1-G)*a+G*f,xt=(1-G)*l+G*h,X=k-q,it=xt-nt;return X*X+it*it}function tT(r,t){return r[0]===t[0]?r[1]-t[1]:r[0]-t[0]}function eT(r){r.sort(tT);for(var t=[],e=0;e<r.length;e++){for(;t.length>=2&&Ja(t[t.length-2],t[t.length-1],r[e])<=0;)t.pop();t.push(r[e])}for(var o=[],a=r.length-1;a>=0;a--){for(;o.length>=2&&Ja(o[o.length-2],o[o.length-1],r[a])<=0;)o.pop();o.push(r[a])}return o.pop(),t.pop(),t.concat(o)}});var z0=Jt((pp,dp)=>{(function(r,t){typeof pp=="object"&&typeof dp!="undefined"?dp.exports=t():typeof define=="function"&&define.amd?define(t):r.quickselect=t()})(pp,function(){"use strict";function r(a,l,f,h,p){t(a,l,f||0,h||a.length-1,p||o)}function t(a,l,f,h,p){for(;h>f;){if(h-f>600){var d=h-f+1,g=l-f+1,_=Math.log(d),y=.5*Math.exp(2*_/3),M=.5*Math.sqrt(_*y*(d-y)/d)*(g-d/2<0?-1:1),w=Math.max(f,Math.floor(l-g*y/d+M)),T=Math.min(h,Math.floor(l+(d-g)*y/d+M));t(a,l,w,T,p)}var x=a[l],v=f,C=h;for(e(a,f,l),p(a[h],x)>0&&e(a,f,h);v<C;){for(e(a,v,C),v++,C--;p(a[v],x)<0;)v++;for(;p(a[C],x)>0;)C--}p(a[f],x)===0?e(a,f,C):(C++,e(a,C,h)),C<=l&&(f=C+1),l<=C&&(h=C-1)}}function e(a,l,f){var h=a[l];a[l]=a[f],a[f]=h}function o(a,l){return a<l?-1:a>l?1:0}return r})});var vp=Jt((r2,yp)=>{"use strict";yp.exports=qu;yp.exports.default=qu;var dT=z0();function qu(r,t){if(!(this instanceof qu))return new qu(r,t);this._maxEntries=Math.max(4,r||9),this._minEntries=Math.max(2,Math.ceil(this._maxEntries*.4)),t&&this._initFormat(t),this.clear()}qu.prototype={all:function(){return this._all(this.data,[])},search:function(r){var t=this.data,e=[],o=this.toBBox;if(!bc(r,t))return e;for(var a=[],l,f,h,p;t;){for(l=0,f=t.children.length;l<f;l++)h=t.children[l],p=t.leaf?o(h):h,bc(r,p)&&(t.leaf?e.push(h):gp(r,p)?this._all(h,e):a.push(h));t=a.pop()}return e},collides:function(r){var t=this.data,e=this.toBBox;if(!bc(r,t))return!1;for(var o=[],a,l,f,h;t;){for(a=0,l=t.children.length;a<l;a++)if(f=t.children[a],h=t.leaf?e(f):f,bc(r,h)){if(t.leaf||gp(r,h))return!0;o.push(f)}t=o.pop()}return!1},load:function(r){if(!(r&&r.length))return this;if(r.length<this._minEntries){for(var t=0,e=r.length;t<e;t++)this.insert(r[t]);return this}var o=this._build(r.slice(),0,r.length-1,0);if(!this.data.children.length)this.data=o;else if(this.data.height===o.height)this._splitRoot(this.data,o);else{if(this.data.height<o.height){var a=this.data;this.data=o,o=a}this._insert(o,this.data.height-o.height-1,!0)}return this},insert:function(r){return r&&this._insert(r,this.data.height-1),this},clear:function(){return this.data=ja([]),this},remove:function(r,t){if(!r)return this;for(var e=this.data,o=this.toBBox(r),a=[],l=[],f,h,p,d;e||a.length;){if(e||(e=a.pop(),h=a[a.length-1],f=l.pop(),d=!0),e.leaf&&(p=mT(r,e.children,t),p!==-1))return e.children.splice(p,1),a.push(e),this._condense(a),this;!d&&!e.leaf&&gp(e,o)?(a.push(e),l.push(f),f=0,h=e,e=e.children[0]):h?(f++,e=h.children[f],d=!1):e=null}return this},toBBox:function(r){return r},compareMinX:k0,compareMinY:G0,toJSON:function(){return this.data},fromJSON:function(r){return this.data=r,this},_all:function(r,t){for(var e=[];r;)r.leaf?t.push.apply(t,r.children):e.push.apply(e,r.children),r=e.pop();return t},_build:function(r,t,e,o){var a=e-t+1,l=this._maxEntries,f;if(a<=l)return f=ja(r.slice(t,e+1)),Ka(f,this.toBBox),f;o||(o=Math.ceil(Math.log(a)/Math.log(l)),l=Math.ceil(a/Math.pow(l,o-1))),f=ja([]),f.leaf=!1,f.height=o;var h=Math.ceil(a/l),p=h*Math.ceil(Math.sqrt(l)),d,g,_,y;for(V0(r,t,e,p,this.compareMinX),d=t;d<=e;d+=p)for(_=Math.min(d+p-1,e),V0(r,d,_,h,this.compareMinY),g=d;g<=_;g+=h)y=Math.min(g+h-1,_),f.children.push(this._build(r,g,y,o-1));return Ka(f,this.toBBox),f},_chooseSubtree:function(r,t,e,o){for(var a,l,f,h,p,d,g,_;o.push(t),!(t.leaf||o.length-1===e);){for(g=_=1/0,a=0,l=t.children.length;a<l;a++)f=t.children[a],p=mp(f),d=gT(r,f)-p,d<_?(_=d,g=p<g?p:g,h=f):d===_&&p<g&&(g=p,h=f);t=h||t.children[0]}return t},_insert:function(r,t,e){var o=this.toBBox,a=e?r:o(r),l=[],f=this._chooseSubtree(a,this.data,t,l);for(f.children.push(r),Wu(f,a);t>=0&&l[t].children.length>this._maxEntries;)this._split(l,t),t--;this._adjustParentBBoxes(a,l,t)},_split:function(r,t){var e=r[t],o=e.children.length,a=this._minEntries;this._chooseSplitAxis(e,a,o);var l=this._chooseSplitIndex(e,a,o),f=ja(e.children.splice(l,e.children.length-l));f.height=e.height,f.leaf=e.leaf,Ka(e,this.toBBox),Ka(f,this.toBBox),t?r[t-1].children.push(f):this._splitRoot(e,f)},_splitRoot:function(r,t){this.data=ja([r,t]),this.data.height=r.height+1,this.data.leaf=!1,Ka(this.data,this.toBBox)},_chooseSplitIndex:function(r,t,e){var o,a,l,f,h,p,d,g;for(p=d=1/0,o=t;o<=e-t;o++)a=Hu(r,0,o,this.toBBox),l=Hu(r,o,e,this.toBBox),f=yT(a,l),h=mp(a)+mp(l),f<p?(p=f,g=o,d=h<d?h:d):f===p&&h<d&&(d=h,g=o);return g},_chooseSplitAxis:function(r,t,e){var o=r.leaf?this.compareMinX:k0,a=r.leaf?this.compareMinY:G0,l=this._allDistMargin(r,t,e,o),f=this._allDistMargin(r,t,e,a);l<f&&r.children.sort(o)},_allDistMargin:function(r,t,e,o){r.children.sort(o);var a=this.toBBox,l=Hu(r,0,t,a),f=Hu(r,e-t,e,a),h=wc(l)+wc(f),p,d;for(p=t;p<e-t;p++)d=r.children[p],Wu(l,r.leaf?a(d):d),h+=wc(l);for(p=e-t-1;p>=t;p--)d=r.children[p],Wu(f,r.leaf?a(d):d),h+=wc(f);return h},_adjustParentBBoxes:function(r,t,e){for(var o=e;o>=0;o--)Wu(t[o],r)},_condense:function(r){for(var t=r.length-1,e;t>=0;t--)r[t].children.length===0?t>0?(e=r[t-1].children,e.splice(e.indexOf(r[t]),1)):this.clear():Ka(r[t],this.toBBox)},_initFormat:function(r){var t=["return a"," - b",";"];this.compareMinX=new Function("a","b",t.join(r[0])),this.compareMinY=new Function("a","b",t.join(r[1])),this.toBBox=new Function("a","return {minX: a"+r[0]+", minY: a"+r[1]+", maxX: a"+r[2]+", maxY: a"+r[3]+"};")}};function mT(r,t,e){if(!e)return t.indexOf(r);for(var o=0;o<t.length;o++)if(e(r,t[o]))return o;return-1}function Ka(r,t){Hu(r,0,r.children.length,t,r)}function Hu(r,t,e,o,a){a||(a=ja(null)),a.minX=1/0,a.minY=1/0,a.maxX=-1/0,a.maxY=-1/0;for(var l=t,f;l<e;l++)f=r.children[l],Wu(a,r.leaf?o(f):f);return a}function Wu(r,t){return r.minX=Math.min(r.minX,t.minX),r.minY=Math.min(r.minY,t.minY),r.maxX=Math.max(r.maxX,t.maxX),r.maxY=Math.max(r.maxY,t.maxY),r}function k0(r,t){return r.minX-t.minX}function G0(r,t){return r.minY-t.minY}function mp(r){return(r.maxX-r.minX)*(r.maxY-r.minY)}function wc(r){return r.maxX-r.minX+(r.maxY-r.minY)}function gT(r,t){return(Math.max(t.maxX,r.maxX)-Math.min(t.minX,r.minX))*(Math.max(t.maxY,r.maxY)-Math.min(t.minY,r.minY))}function yT(r,t){var e=Math.max(r.minX,t.minX),o=Math.max(r.minY,t.minY),a=Math.min(r.maxX,t.maxX),l=Math.min(r.maxY,t.maxY);return Math.max(0,a-e)*Math.max(0,l-o)}function gp(r,t){return r.minX<=t.minX&&r.minY<=t.minY&&t.maxX<=r.maxX&&t.maxY<=r.maxY}function bc(r,t){return t.minX<=r.maxX&&t.minY<=r.maxY&&t.maxX>=r.minX&&t.maxY>=r.minY}function ja(r){return{children:r,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function V0(r,t,e,o,a){for(var l=[t,e],f;l.length;)e=l.pop(),t=l.pop(),!(e-t<=o)&&(f=t+Math.ceil((e-t)/o/2)*o,dT(r,f,t,e,a),l.push(t,f,f,e))}});var Z0=Jt((gO,wp)=>{"use strict";wp.exports=Pc;wp.exports.default=Pc;function Pc(r,t,e){e=e||2;var o=t&&t.length,a=o?t[0]*e:r.length,l=q0(r,0,a,e,!0),f=[];if(!l||l.next===l.prev)return f;var h,p,d,g,_,y,M;if(o&&(l=AT(r,t,l,e)),r.length>80*e){h=d=r[0],p=g=r[1];for(var w=e;w<a;w+=e)_=r[w],y=r[w+1],_<h&&(h=_),y<p&&(p=y),_>d&&(d=_),y>g&&(g=y);M=Math.max(d-h,g-p),M=M!==0?32767/M:0}return Zu(l,f,e,h,p,M,0),f}function q0(r,t,e,o,a){var l,f;if(a===Sp(r,t,e,o)>0)for(l=t;l<e;l+=o)f=W0(l,r[l],r[l+1],f);else for(l=e-o;l>=t;l-=o)f=W0(l,r[l],r[l+1],f);return f&&Ic(f,f.next)&&($u(f),f=f.next),f}function js(r,t){if(!r)return r;t||(t=r);var e=r,o;do if(o=!1,!e.steiner&&(Ic(e,e.next)||Un(e.prev,e,e.next)===0)){if($u(e),e=t=e.prev,e===e.next)break;o=!0}else e=e.next;while(o||e!==t);return t}function Zu(r,t,e,o,a,l,f){if(r){!f&&l&<(r,o,a,l);for(var h=r,p,d;r.prev!==r.next;){if(p=r.prev,d=r.next,l?wT(r,o,a,l):ST(r)){t.push(p.i/e|0),t.push(r.i/e|0),t.push(d.i/e|0),$u(r),r=d.next,h=d.next;continue}if(r=d,r===h){f?f===1?(r=bT(js(r),t,e),Zu(r,t,e,o,a,l,2)):f===2&&TT(r,t,e,o,a,l):Zu(js(r),t,e,o,a,l,1);break}}}}function ST(r){var t=r.prev,e=r,o=r.next;if(Un(t,e,o)>=0)return!1;for(var a=t.x,l=e.x,f=o.x,h=t.y,p=e.y,d=o.y,g=a<l?a<f?a:f:l<f?l:f,_=h<p?h<d?h:d:p<d?p:d,y=a>l?a>f?a:f:l>f?l:f,M=h>p?h>d?h:d:p>d?p:d,w=o.next;w!==t;){if(w.x>=g&&w.x<=y&&w.y>=_&&w.y<=M&&eu(a,h,l,p,f,d,w.x,w.y)&&Un(w.prev,w,w.next)>=0)return!1;w=w.next}return!0}function wT(r,t,e,o){var a=r.prev,l=r,f=r.next;if(Un(a,l,f)>=0)return!1;for(var h=a.x,p=l.x,d=f.x,g=a.y,_=l.y,y=f.y,M=h<p?h<d?h:d:p<d?p:d,w=g<_?g<y?g:y:_<y?_:y,T=h>p?h>d?h:d:p>d?p:d,x=g>_?g>y?g:y:_>y?_:y,v=Ep(M,w,t,e,o),C=Ep(T,x,t,e,o),S=r.prevZ,O=r.nextZ;S&&S.z>=v&&O&&O.z<=C;){if(S.x>=M&&S.x<=T&&S.y>=w&&S.y<=x&&S!==a&&S!==f&&eu(h,g,p,_,d,y,S.x,S.y)&&Un(S.prev,S,S.next)>=0||(S=S.prevZ,O.x>=M&&O.x<=T&&O.y>=w&&O.y<=x&&O!==a&&O!==f&&eu(h,g,p,_,d,y,O.x,O.y)&&Un(O.prev,O,O.next)>=0))return!1;O=O.nextZ}for(;S&&S.z>=v;){if(S.x>=M&&S.x<=T&&S.y>=w&&S.y<=x&&S!==a&&S!==f&&eu(h,g,p,_,d,y,S.x,S.y)&&Un(S.prev,S,S.next)>=0)return!1;S=S.prevZ}for(;O&&O.z<=C;){if(O.x>=M&&O.x<=T&&O.y>=w&&O.y<=x&&O!==a&&O!==f&&eu(h,g,p,_,d,y,O.x,O.y)&&Un(O.prev,O,O.next)>=0)return!1;O=O.nextZ}return!0}function bT(r,t,e){var o=r;do{var a=o.prev,l=o.next.next;!Ic(a,l)&&X0(a,o,o.next,l)&&Ju(a,l)&&Ju(l,a)&&(t.push(a.i/e|0),t.push(o.i/e|0),t.push(l.i/e|0),$u(o),$u(o.next),o=r=l),o=o.next}while(o!==r);return js(o)}function TT(r,t,e,o,a,l){var f=r;do{for(var h=f.next.next;h!==f.prev;){if(f.i!==h.i&&DT(f,h)){var p=Y0(f,h);f=js(f,f.next),p=js(p,p.next),Zu(f,t,e,o,a,l,0),Zu(p,t,e,o,a,l,0);return}h=h.next}f=f.next}while(f!==r)}function AT(r,t,e,o){var a=[],l,f,h,p,d;for(l=0,f=t.length;l<f;l++)h=t[l]*o,p=l<f-1?t[l+1]*o:r.length,d=q0(r,h,p,o,!1),d===d.next&&(d.steiner=!0),a.push(OT(d));for(a.sort(CT),l=0;l<a.length;l++)e=PT(a[l],e);return e}function CT(r,t){return r.x-t.x}function PT(r,t){var e=IT(r,t);if(!e)return t;var o=Y0(e,r);return js(o,o.next),js(e,e.next)}function IT(r,t){var e=t,o=r.x,a=r.y,l=-1/0,f;do{if(a<=e.y&&a>=e.next.y&&e.next.y!==e.y){var h=e.x+(a-e.y)*(e.next.x-e.x)/(e.next.y-e.y);if(h<=o&&h>l&&(l=h,f=e.x<e.next.x?e:e.next,h===o))return f}e=e.next}while(e!==t);if(!f)return null;var p=f,d=f.x,g=f.y,_=1/0,y;e=f;do o>=e.x&&e.x>=d&&o!==e.x&&eu(a<g?o:l,a,d,g,a<g?l:o,a,e.x,e.y)&&(y=Math.abs(a-e.y)/(o-e.x),Ju(e,r)&&(y<_||y===_&&(e.x>f.x||e.x===f.x&&RT(f,e)))&&(f=e,_=y)),e=e.next;while(e!==p);return f}function RT(r,t){return Un(r.prev,r,t.prev)<0&&Un(t.next,r,r.next)<0}function LT(r,t,e,o){var a=r;do a.z===0&&(a.z=Ep(a.x,a.y,t,e,o)),a.prevZ=a.prev,a.nextZ=a.next,a=a.next;while(a!==r);a.prevZ.nextZ=null,a.prevZ=null,NT(a)}function NT(r){var t,e,o,a,l,f,h,p,d=1;do{for(e=r,r=null,l=null,f=0;e;){for(f++,o=e,h=0,t=0;t<d&&(h++,o=o.nextZ,!!o);t++);for(p=d;h>0||p>0&&o;)h!==0&&(p===0||!o||e.z<=o.z)?(a=e,e=e.nextZ,h--):(a=o,o=o.nextZ,p--),l?l.nextZ=a:r=a,a.prevZ=l,l=a;e=o}l.nextZ=null,d*=2}while(f>1);return r}function Ep(r,t,e,o,a){return r=(r-e)*a|0,t=(t-o)*a|0,r=(r|r<<8)&16711935,r=(r|r<<4)&252645135,r=(r|r<<2)&858993459,r=(r|r<<1)&1431655765,t=(t|t<<8)&16711935,t=(t|t<<4)&252645135,t=(t|t<<2)&858993459,t=(t|t<<1)&1431655765,r|t<<1}function OT(r){var t=r,e=r;do(t.x<e.x||t.x===e.x&&t.y<e.y)&&(e=t),t=t.next;while(t!==r);return e}function eu(r,t,e,o,a,l,f,h){return(a-f)*(t-h)>=(r-f)*(l-h)&&(r-f)*(o-h)>=(e-f)*(t-h)&&(e-f)*(l-h)>=(a-f)*(o-h)}function DT(r,t){return r.next.i!==t.i&&r.prev.i!==t.i&&!FT(r,t)&&(Ju(r,t)&&Ju(t,r)&&UT(r,t)&&(Un(r.prev,r,t.prev)||Un(r,t.prev,t))||Ic(r,t)&&Un(r.prev,r,r.next)>0&&Un(t.prev,t,t.next)>0)}function Un(r,t,e){return(t.y-r.y)*(e.x-t.x)-(t.x-r.x)*(e.y-t.y)}function Ic(r,t){return r.x===t.x&&r.y===t.y}function X0(r,t,e,o){var a=Cc(Un(r,t,e)),l=Cc(Un(r,t,o)),f=Cc(Un(e,o,r)),h=Cc(Un(e,o,t));return!!(a!==l&&f!==h||a===0&&Ac(r,e,t)||l===0&&Ac(r,o,t)||f===0&&Ac(e,r,o)||h===0&&Ac(e,t,o))}function Ac(r,t,e){return t.x<=Math.max(r.x,e.x)&&t.x>=Math.min(r.x,e.x)&&t.y<=Math.max(r.y,e.y)&&t.y>=Math.min(r.y,e.y)}function Cc(r){return r>0?1:r<0?-1:0}function FT(r,t){var e=r;do{if(e.i!==r.i&&e.next.i!==r.i&&e.i!==t.i&&e.next.i!==t.i&&X0(e,e.next,r,t))return!0;e=e.next}while(e!==r);return!1}function Ju(r,t){return Un(r.prev,r,r.next)<0?Un(r,t,r.next)>=0&&Un(r,r.prev,t)>=0:Un(r,t,r.prev)<0||Un(r,r.next,t)<0}function UT(r,t){var e=r,o=!1,a=(r.x+t.x)/2,l=(r.y+t.y)/2;do e.y>l!=e.next.y>l&&e.next.y!==e.y&&a<(e.next.x-e.x)*(l-e.y)/(e.next.y-e.y)+e.x&&(o=!o),e=e.next;while(e!==r);return o}function Y0(r,t){var e=new Mp(r.i,r.x,r.y),o=new Mp(t.i,t.x,t.y),a=r.next,l=t.prev;return r.next=t,t.prev=r,e.next=a,a.prev=e,o.next=e,e.prev=o,l.next=o,o.prev=l,o}function W0(r,t,e,o){var a=new Mp(r,t,e);return o?(a.next=o.next,a.prev=o,o.next.prev=a,o.next=a):(a.prev=a,a.next=a),a}function $u(r){r.next.prev=r.prev,r.prev.next=r.next,r.prevZ&&(r.prevZ.nextZ=r.nextZ),r.nextZ&&(r.nextZ.prevZ=r.prevZ)}function Mp(r,t,e){this.i=r,this.x=t,this.y=e,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}Pc.deviation=function(r,t,e,o){var a=t&&t.length,l=a?t[0]*e:r.length,f=Math.abs(Sp(r,0,l,e));if(a)for(var h=0,p=t.length;h<p;h++){var d=t[h]*e,g=h<p-1?t[h+1]*e:r.length;f-=Math.abs(Sp(r,d,g,e))}var _=0;for(h=0;h<o.length;h+=3){var y=o[h]*e,M=o[h+1]*e,w=o[h+2]*e;_+=Math.abs((r[y]-r[w])*(r[M+1]-r[y+1])-(r[y]-r[M])*(r[w+1]-r[y+1]))}return f===0&&_===0?0:Math.abs((_-f)/f)};function Sp(r,t,e,o){for(var a=0,l=t,f=e-o;l<e;l+=o)a+=(r[f]-r[l])*(r[l+1]+r[f+1]),f=l;return a}Pc.flatten=function(r){for(var t=r[0][0].length,e={vertices:[],holes:[],dimensions:t},o=0,a=0;a<r.length;a++){for(var l=0;l<r[a].length;l++)for(var f=0;f<t;f++)e.vertices.push(r[a][l][f]);a>0&&(o+=r[a-1].length,e.holes.push(o))}return e}});var Pp=Jt(ue=>{"use strict";Object.defineProperty(ue,"__esModule",{value:!0});ue.earthRadius=63710088e-1;ue.factors={centimeters:ue.earthRadius*100,centimetres:ue.earthRadius*100,degrees:ue.earthRadius/111325,feet:ue.earthRadius*3.28084,inches:ue.earthRadius*39.37,kilometers:ue.earthRadius/1e3,kilometres:ue.earthRadius/1e3,meters:ue.earthRadius,metres:ue.earthRadius,miles:ue.earthRadius/1609.344,millimeters:ue.earthRadius*1e3,millimetres:ue.earthRadius*1e3,nauticalmiles:ue.earthRadius/1852,radians:1,yards:ue.earthRadius*1.0936};ue.unitsFactors={centimeters:100,centimetres:100,degrees:1/111325,feet:3.28084,inches:39.37,kilometers:1/1e3,kilometres:1/1e3,meters:1,metres:1,miles:1/1609.344,millimeters:1e3,millimetres:1e3,nauticalmiles:1/1852,radians:1/ue.earthRadius,yards:1.0936133};ue.areaFactors={acres:247105e-9,centimeters:1e4,centimetres:1e4,feet:10.763910417,hectares:1e-4,inches:1550.003100006,kilometers:1e-6,kilometres:1e-6,meters:1,metres:1,miles:386e-9,millimeters:1e6,millimetres:1e6,yards:1.195990046};function xs(r,t,e){e===void 0&&(e={});var o={type:"Feature"};return(e.id===0||e.id)&&(o.id=e.id),e.bbox&&(o.bbox=e.bbox),o.properties=t||{},o.geometry=r,o}ue.feature=xs;function zT(r,t,e){switch(e===void 0&&(e={}),r){case"Point":return bp(t).geometry;case"LineString":return Ap(t).geometry;case"Polygon":return Tp(t).geometry;case"MultiPoint":return $0(t).geometry;case"MultiLineString":return J0(t).geometry;case"MultiPolygon":return K0(t).geometry;default:throw new Error(r+" is invalid")}}ue.geometry=zT;function bp(r,t,e){if(e===void 0&&(e={}),!r)throw new Error("coordinates is required");if(!Array.isArray(r))throw new Error("coordinates must be an Array");if(r.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!Rc(r[0])||!Rc(r[1]))throw new Error("coordinates must contain numbers");var o={type:"Point",coordinates:r};return xs(o,t,e)}ue.point=bp;function kT(r,t,e){return e===void 0&&(e={}),Lc(r.map(function(o){return bp(o,t)}),e)}ue.points=kT;function Tp(r,t,e){e===void 0&&(e={});for(var o=0,a=r;o<a.length;o++){var l=a[o];if(l.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");for(var f=0;f<l[l.length-1].length;f++)if(l[l.length-1][f]!==l[0][f])throw new Error("First and last Position are not equivalent.")}var h={type:"Polygon",coordinates:r};return xs(h,t,e)}ue.polygon=Tp;function GT(r,t,e){return e===void 0&&(e={}),Lc(r.map(function(o){return Tp(o,t)}),e)}ue.polygons=GT;function Ap(r,t,e){if(e===void 0&&(e={}),r.length<2)throw new Error("coordinates must be an array of two or more positions");var o={type:"LineString",coordinates:r};return xs(o,t,e)}ue.lineString=Ap;function VT(r,t,e){return e===void 0&&(e={}),Lc(r.map(function(o){return Ap(o,t)}),e)}ue.lineStrings=VT;function Lc(r,t){t===void 0&&(t={});var e={type:"FeatureCollection"};return t.id&&(e.id=t.id),t.bbox&&(e.bbox=t.bbox),e.features=r,e}ue.featureCollection=Lc;function J0(r,t,e){e===void 0&&(e={});var o={type:"MultiLineString",coordinates:r};return xs(o,t,e)}ue.multiLineString=J0;function $0(r,t,e){e===void 0&&(e={});var o={type:"MultiPoint",coordinates:r};return xs(o,t,e)}ue.multiPoint=$0;function K0(r,t,e){e===void 0&&(e={});var o={type:"MultiPolygon",coordinates:r};return xs(o,t,e)}ue.multiPolygon=K0;function HT(r,t,e){e===void 0&&(e={});var o={type:"GeometryCollection",geometries:r};return xs(o,t,e)}ue.geometryCollection=HT;function WT(r,t){if(t===void 0&&(t=0),t&&!(t>=0))throw new Error("precision must be a positive number");var e=Math.pow(10,t||0);return Math.round(r*e)/e}ue.round=WT;function j0(r,t){t===void 0&&(t="kilometers");var e=ue.factors[t];if(!e)throw new Error(t+" units is invalid");return r*e}ue.radiansToLength=j0;function Cp(r,t){t===void 0&&(t="kilometers");var e=ue.factors[t];if(!e)throw new Error(t+" units is invalid");return r/e}ue.lengthToRadians=Cp;function qT(r,t){return Q0(Cp(r,t))}ue.lengthToDegrees=qT;function XT(r){var t=r%360;return t<0&&(t+=360),t}ue.bearingToAzimuth=XT;function Q0(r){var t=r%(2*Math.PI);return t*180/Math.PI}ue.radiansToDegrees=Q0;function YT(r){var t=r%360;return t*Math.PI/180}ue.degreesToRadians=YT;function ZT(r,t,e){if(t===void 0&&(t="kilometers"),e===void 0&&(e="kilometers"),!(r>=0))throw new Error("length must be a positive number");return j0(Cp(r,t),e)}ue.convertLength=ZT;function JT(r,t,e){if(t===void 0&&(t="meters"),e===void 0&&(e="kilometers"),!(r>=0))throw new Error("area must be a positive number");var o=ue.areaFactors[t];if(!o)throw new Error("invalid original units");var a=ue.areaFactors[e];if(!a)throw new Error("invalid final units");return r/o*a}ue.convertArea=JT;function Rc(r){return!isNaN(r)&&r!==null&&!Array.isArray(r)}ue.isNumber=Rc;function $T(r){return!!r&&r.constructor===Object}ue.isObject=$T;function KT(r){if(!r)throw new Error("bbox is required");if(!Array.isArray(r))throw new Error("bbox must be an Array");if(r.length!==4&&r.length!==6)throw new Error("bbox must be an Array of 4 or 6 numbers");r.forEach(function(t){if(!Rc(t))throw new Error("bbox must only contain numbers")})}ue.validateBBox=KT;function jT(r){if(!r)throw new Error("id is required");if(["string","number"].indexOf(typeof r)===-1)throw new Error("id must be a number or a string")}ue.validateId=jT});var Rp=Jt(ir=>{"use strict";Object.defineProperty(ir,"__esModule",{value:!0});var Gr=Pp();function Ku(r,t,e){if(r!==null)for(var o,a,l,f,h,p,d,g=0,_=0,y,M=r.type,w=M==="FeatureCollection",T=M==="Feature",x=w?r.features.length:1,v=0;v<x;v++){d=w?r.features[v].geometry:T?r.geometry:r,y=d?d.type==="GeometryCollection":!1,h=y?d.geometries.length:1;for(var C=0;C<h;C++){var S=0,O=0;if(f=y?d.geometries[C]:d,f!==null){p=f.coordinates;var F=f.type;switch(g=e&&(F==="Polygon"||F==="MultiPolygon")?1:0,F){case null:break;case"Point":if(t(p,_,v,S,O)===!1)return!1;_++,S++;break;case"LineString":case"MultiPoint":for(o=0;o<p.length;o++){if(t(p[o],_,v,S,O)===!1)return!1;_++,F==="MultiPoint"&&S++}F==="LineString"&&S++;break;case"Polygon":case"MultiLineString":for(o=0;o<p.length;o++){for(a=0;a<p[o].length-g;a++){if(t(p[o][a],_,v,S,O)===!1)return!1;_++}F==="MultiLineString"&&S++,F==="Polygon"&&O++}F==="Polygon"&&S++;break;case"MultiPolygon":for(o=0;o<p.length;o++){for(O=0,a=0;a<p[o].length;a++){for(l=0;l<p[o][a].length-g;l++){if(t(p[o][a][l],_,v,S,O)===!1)return!1;_++}O++}S++}break;case"GeometryCollection":for(o=0;o<f.geometries.length;o++)if(Ku(f.geometries[o],t,e)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function QT(r,t,e,o){var a=e;return Ku(r,function(l,f,h,p,d){f===0&&e===void 0?a=l:a=t(a,l,f,h,p,d)},o),a}function ty(r,t){var e;switch(r.type){case"FeatureCollection":for(e=0;e<r.features.length&&t(r.features[e].properties,e)!==!1;e++);break;case"Feature":t(r.properties,0);break}}function tA(r,t,e){var o=e;return ty(r,function(a,l){l===0&&e===void 0?o=a:o=t(o,a,l)}),o}function ey(r,t){if(r.type==="Feature")t(r,0);else if(r.type==="FeatureCollection")for(var e=0;e<r.features.length&&t(r.features[e],e)!==!1;e++);}function eA(r,t,e){var o=e;return ey(r,function(a,l){l===0&&e===void 0?o=a:o=t(o,a,l)}),o}function nA(r){var t=[];return Ku(r,function(e){t.push(e)}),t}function Ip(r,t){var e,o,a,l,f,h,p,d,g,_,y=0,M=r.type==="FeatureCollection",w=r.type==="Feature",T=M?r.features.length:1;for(e=0;e<T;e++){for(h=M?r.features[e].geometry:w?r.geometry:r,d=M?r.features[e].properties:w?r.properties:{},g=M?r.features[e].bbox:w?r.bbox:void 0,_=M?r.features[e].id:w?r.id:void 0,p=h?h.type==="GeometryCollection":!1,f=p?h.geometries.length:1,a=0;a<f;a++){if(l=p?h.geometries[a]:h,l===null){if(t(null,y,d,g,_)===!1)return!1;continue}switch(l.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":{if(t(l,y,d,g,_)===!1)return!1;break}case"GeometryCollection":{for(o=0;o<l.geometries.length;o++)if(t(l.geometries[o],y,d,g,_)===!1)return!1;break}default:throw new Error("Unknown Geometry Type")}}y++}}function rA(r,t,e){var o=e;return Ip(r,function(a,l,f,h,p){l===0&&e===void 0?o=a:o=t(o,a,l,f,h,p)}),o}function Nc(r,t){Ip(r,function(e,o,a,l,f){var h=e===null?null:e.type;switch(h){case null:case"Point":case"LineString":case"Polygon":return t(Gr.feature(e,a,{bbox:l,id:f}),o,0)===!1?!1:void 0}var p;switch(h){case"MultiPoint":p="Point";break;case"MultiLineString":p="LineString";break;case"MultiPolygon":p="Polygon";break}for(var d=0;d<e.coordinates.length;d++){var g=e.coordinates[d],_={type:p,coordinates:g};if(t(Gr.feature(_,a),o,d)===!1)return!1}})}function iA(r,t,e){var o=e;return Nc(r,function(a,l,f){l===0&&f===0&&e===void 0?o=a:o=t(o,a,l,f)}),o}function ny(r,t){Nc(r,function(e,o,a){var l=0;if(e.geometry){var f=e.geometry.type;if(!(f==="Point"||f==="MultiPoint")){var h,p=0,d=0,g=0;if(Ku(e,function(_,y,M,w,T){if(h===void 0||o>p||w>d||T>g){h=_,p=o,d=w,g=T,l=0;return}var x=Gr.lineString([h,_],e.properties);if(t(x,o,a,T,l)===!1)return!1;l++,h=_})===!1)return!1}}})}function oA(r,t,e){var o=e,a=!1;return ny(r,function(l,f,h,p,d){a===!1&&e===void 0?o=l:o=t(o,l,f,h,p,d),a=!0}),o}function ry(r,t){if(!r)throw new Error("geojson is required");Nc(r,function(e,o,a){if(e.geometry!==null){var l=e.geometry.type,f=e.geometry.coordinates;switch(l){case"LineString":if(t(e,o,a,0,0)===!1)return!1;break;case"Polygon":for(var h=0;h<f.length;h++)if(t(Gr.lineString(f[h],e.properties),o,a,h)===!1)return!1;break}}})}function sA(r,t,e){var o=e;return ry(r,function(a,l,f,h){l===0&&e===void 0?o=a:o=t(o,a,l,f,h)}),o}function aA(r,t){if(t=t||{},!Gr.isObject(t))throw new Error("options is invalid");var e=t.featureIndex||0,o=t.multiFeatureIndex||0,a=t.geometryIndex||0,l=t.segmentIndex||0,f=t.properties,h;switch(r.type){case"FeatureCollection":e<0&&(e=r.features.length+e),f=f||r.features[e].properties,h=r.features[e].geometry;break;case"Feature":f=f||r.properties,h=r.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":h=r;break;default:throw new Error("geojson is invalid")}if(h===null)return null;var p=h.coordinates;switch(h.type){case"Point":case"MultiPoint":return null;case"LineString":return l<0&&(l=p.length+l-1),Gr.lineString([p[l],p[l+1]],f,t);case"Polygon":return a<0&&(a=p.length+a),l<0&&(l=p[a].length+l-1),Gr.lineString([p[a][l],p[a][l+1]],f,t);case"MultiLineString":return o<0&&(o=p.length+o),l<0&&(l=p[o].length+l-1),Gr.lineString([p[o][l],p[o][l+1]],f,t);case"MultiPolygon":return o<0&&(o=p.length+o),a<0&&(a=p[o].length+a),l<0&&(l=p[o][a].length-l-1),Gr.lineString([p[o][a][l],p[o][a][l+1]],f,t)}throw new Error("geojson is invalid")}function uA(r,t){if(t=t||{},!Gr.isObject(t))throw new Error("options is invalid");var e=t.featureIndex||0,o=t.multiFeatureIndex||0,a=t.geometryIndex||0,l=t.coordIndex||0,f=t.properties,h;switch(r.type){case"FeatureCollection":e<0&&(e=r.features.length+e),f=f||r.features[e].properties,h=r.features[e].geometry;break;case"Feature":f=f||r.properties,h=r.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":h=r;break;default:throw new Error("geojson is invalid")}if(h===null)return null;var p=h.coordinates;switch(h.type){case"Point":return Gr.point(p,f,t);case"MultiPoint":return o<0&&(o=p.length+o),Gr.point(p[o],f,t);case"LineString":return l<0&&(l=p.length+l),Gr.point(p[l],f,t);case"Polygon":return a<0&&(a=p.length+a),l<0&&(l=p[a].length+l),Gr.point(p[a][l],f,t);case"MultiLineString":return o<0&&(o=p.length+o),l<0&&(l=p[o].length+l),Gr.point(p[o][l],f,t);case"MultiPolygon":return o<0&&(o=p.length+o),a<0&&(a=p[o].length+a),l<0&&(l=p[o][a].length-l),Gr.point(p[o][a][l],f,t)}throw new Error("geojson is invalid")}ir.coordAll=nA;ir.coordEach=Ku;ir.coordReduce=QT;ir.featureEach=ey;ir.featureReduce=eA;ir.findPoint=uA;ir.findSegment=aA;ir.flattenEach=Nc;ir.flattenReduce=iA;ir.geomEach=Ip;ir.geomReduce=rA;ir.lineEach=ry;ir.lineReduce=sA;ir.propEach=ty;ir.propReduce=tA;ir.segmentEach=ny;ir.segmentReduce=oA});var iy=Jt(Np=>{"use strict";Object.defineProperty(Np,"__esModule",{value:!0});var lA=Rp();function Lp(r){var t=[1/0,1/0,-1/0,-1/0];return lA.coordEach(r,function(e){t[0]>e[0]&&(t[0]=e[0]),t[1]>e[1]&&(t[1]=e[1]),t[2]<e[0]&&(t[2]=e[0]),t[3]<e[1]&&(t[3]=e[1])}),t}Lp.default=Lp;Np.default=Lp});var Oc=Jt((LO,Op)=>{var go=op(),sy=Pp(),ay=Rp(),nu=iy().default,cA=ay.featureEach,IO=ay.coordEach,RO=sy.polygon,oy=sy.featureCollection;function uy(r){var t=new go(r);return t.insert=function(e){if(e.type!=="Feature")throw new Error("invalid feature");return e.bbox=e.bbox?e.bbox:nu(e),go.prototype.insert.call(this,e)},t.load=function(e){var o=[];return Array.isArray(e)?e.forEach(function(a){if(a.type!=="Feature")throw new Error("invalid features");a.bbox=a.bbox?a.bbox:nu(a),o.push(a)}):cA(e,function(a){if(a.type!=="Feature")throw new Error("invalid features");a.bbox=a.bbox?a.bbox:nu(a),o.push(a)}),go.prototype.load.call(this,o)},t.remove=function(e,o){if(e.type!=="Feature")throw new Error("invalid feature");return e.bbox=e.bbox?e.bbox:nu(e),go.prototype.remove.call(this,e,o)},t.clear=function(){return go.prototype.clear.call(this)},t.search=function(e){var o=go.prototype.search.call(this,this.toBBox(e));return oy(o)},t.collides=function(e){return go.prototype.collides.call(this,this.toBBox(e))},t.all=function(){var e=go.prototype.all.call(this);return oy(e)},t.toJSON=function(){return go.prototype.toJSON.call(this)},t.fromJSON=function(e){return go.prototype.fromJSON.call(this,e)},t.toBBox=function(e){var o;if(e.bbox)o=e.bbox;else if(Array.isArray(e)&&e.length===4)o=e;else if(Array.isArray(e)&&e.length===6)o=[e[0],e[1],e[3],e[4]];else if(e.type==="Feature")o=nu(e);else if(e.type==="FeatureCollection")o=nu(e);else throw new Error("invalid geojson");return{minX:o[0],minY:o[1],maxX:o[2],maxY:o[3]}},t}Op.exports=uy;Op.exports.default=uy});var kp=Jt((G3,vy)=>{"use strict";var yy=Object.prototype.toString;vy.exports=function(t){var e=yy.call(t),o=e==="[object Arguments]";return o||(o=e!=="[object Array]"&&t!==null&&typeof t=="object"&&typeof t.length=="number"&&t.length>=0&&yy.call(t.callee)==="[object Function]"),o}});var Ay=Jt((V3,Ty)=>{"use strict";var by;Object.keys||(tl=Object.prototype.hasOwnProperty,Gp=Object.prototype.toString,_y=kp(),Vp=Object.prototype.propertyIsEnumerable,xy=!Vp.call({toString:null},"toString"),Ey=Vp.call(function(){},"prototype"),el=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],zc=function(r){var t=r.constructor;return t&&t.prototype===r},My={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},Sy=function(){if(typeof window=="undefined")return!1;for(var r in window)try{if(!My["$"+r]&&tl.call(window,r)&&window[r]!==null&&typeof window[r]=="object")try{zc(window[r])}catch(t){return!0}}catch(t){return!0}return!1}(),wy=function(r){if(typeof window=="undefined"||!Sy)return zc(r);try{return zc(r)}catch(t){return!1}},by=function(t){var e=t!==null&&typeof t=="object",o=Gp.call(t)==="[object Function]",a=_y(t),l=e&&Gp.call(t)==="[object String]",f=[];if(!e&&!o&&!a)throw new TypeError("Object.keys called on a non-object");var h=Ey&&o;if(l&&t.length>0&&!tl.call(t,0))for(var p=0;p<t.length;++p)f.push(String(p));if(a&&t.length>0)for(var d=0;d<t.length;++d)f.push(String(d));else for(var g in t)!(h&&g==="prototype")&&tl.call(t,g)&&f.push(String(g));if(xy)for(var _=wy(t),y=0;y<el.length;++y)!(_&&el[y]==="constructor")&&tl.call(t,el[y])&&f.push(el[y]);return f});var tl,Gp,_y,Vp,xy,Ey,el,zc,My,Sy,wy;Ty.exports=by});var Hp=Jt((H3,Iy)=>{"use strict";var xA=Array.prototype.slice,EA=kp(),Cy=Object.keys,kc=Cy?function(t){return Cy(t)}:Ay(),Py=Object.keys;kc.shim=function(){if(Object.keys){var t=function(){var e=Object.keys(arguments);return e&&e.length===arguments.length}(1,2);t||(Object.keys=function(o){return EA(o)?Py(xA.call(o)):Py(o)})}else Object.keys=kc;return Object.keys||kc};Iy.exports=kc});var Wp=Jt((W3,Ry)=>{"use strict";Ry.exports=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var t={},e=Symbol("test"),o=Object(e);if(typeof e=="string"||Object.prototype.toString.call(e)!=="[object Symbol]"||Object.prototype.toString.call(o)!=="[object Symbol]")return!1;var a=42;t[e]=a;for(e in t)return!1;if(typeof Object.keys=="function"&&Object.keys(t).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(t).length!==0)return!1;var l=Object.getOwnPropertySymbols(t);if(l.length!==1||l[0]!==e||!Object.prototype.propertyIsEnumerable.call(t,e))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var f=Object.getOwnPropertyDescriptor(t,e);if(f.value!==a||f.enumerable!==!0)return!1}return!0}});var Gc=Jt((q3,Ly)=>{"use strict";var MA=Wp();Ly.exports=function(){return MA()&&!!Symbol.toStringTag}});var Dy=Jt((X3,Oy)=>{"use strict";var Ny=typeof Symbol!="undefined"&&Symbol,SA=Wp();Oy.exports=function(){return typeof Ny!="function"||typeof Symbol!="function"||typeof Ny("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:SA()}});var By=Jt((Y3,Uy)=>{"use strict";var Fy={foo:{}},wA=Object;Uy.exports=function(){return{__proto__:Fy}.foo===Fy.foo&&!({__proto__:null}instanceof wA)}});var Gy=Jt((Z3,ky)=>{"use strict";var bA="Function.prototype.bind called on incompatible ",TA=Object.prototype.toString,AA=Math.max,CA="[object Function]",zy=function(t,e){for(var o=[],a=0;a<t.length;a+=1)o[a]=t[a];for(var l=0;l<e.length;l+=1)o[l+t.length]=e[l];return o},PA=function(t,e){for(var o=[],a=e||0,l=0;a<t.length;a+=1,l+=1)o[l]=t[a];return o},IA=function(r,t){for(var e="",o=0;o<r.length;o+=1)e+=r[o],o+1<r.length&&(e+=t);return e};ky.exports=function(t){var e=this;if(typeof e!="function"||TA.apply(e)!==CA)throw new TypeError(bA+e);for(var o=PA(arguments,1),a,l=function(){if(this instanceof a){var g=e.apply(this,zy(o,arguments));return Object(g)===g?g:this}return e.apply(t,zy(o,arguments))},f=AA(0,e.length-o.length),h=[],p=0;p<f;p++)h[p]="$"+p;if(a=Function("binder","return function ("+IA(h,",")+"){ return binder.apply(this,arguments); }")(l),e.prototype){var d=function(){};d.prototype=e.prototype,a.prototype=new d,d.prototype=null}return a}});var Vc=Jt((J3,Vy)=>{"use strict";var RA=Gy();Vy.exports=Function.prototype.bind||RA});var Wy=Jt(($3,Hy)=>{"use strict";var LA=Function.prototype.call,NA=Object.prototype.hasOwnProperty,OA=Vc();Hy.exports=OA.call(LA,NA)});var ea=Jt((K3,Jy)=>{"use strict";var tn,su=SyntaxError,Zy=Function,ou=TypeError,qp=function(r){try{return Zy('"use strict"; return ('+r+").constructor;")()}catch(t){}},Qs=Object.getOwnPropertyDescriptor;if(Qs)try{Qs({},"")}catch(r){Qs=null}var Xp=function(){throw new ou},DA=Qs?function(){try{return arguments.callee,Xp}catch(r){try{return Qs(arguments,"callee").get}catch(t){return Xp}}}():Xp,ru=Dy()(),FA=By()(),vr=Object.getPrototypeOf||(FA?function(r){return r.__proto__}:null),iu={},UA=typeof Uint8Array=="undefined"||!vr?tn:vr(Uint8Array),ta={"%AggregateError%":typeof AggregateError=="undefined"?tn:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer=="undefined"?tn:ArrayBuffer,"%ArrayIteratorPrototype%":ru&&vr?vr([][Symbol.iterator]()):tn,"%AsyncFromSyncIteratorPrototype%":tn,"%AsyncFunction%":iu,"%AsyncGenerator%":iu,"%AsyncGeneratorFunction%":iu,"%AsyncIteratorPrototype%":iu,"%Atomics%":typeof Atomics=="undefined"?tn:Atomics,"%BigInt%":typeof BigInt=="undefined"?tn:BigInt,"%BigInt64Array%":typeof BigInt64Array=="undefined"?tn:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array=="undefined"?tn:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView=="undefined"?tn:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":typeof Float32Array=="undefined"?tn:Float32Array,"%Float64Array%":typeof Float64Array=="undefined"?tn:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry=="undefined"?tn:FinalizationRegistry,"%Function%":Zy,"%GeneratorFunction%":iu,"%Int8Array%":typeof Int8Array=="undefined"?tn:Int8Array,"%Int16Array%":typeof Int16Array=="undefined"?tn:Int16Array,"%Int32Array%":typeof Int32Array=="undefined"?tn:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":ru&&vr?vr(vr([][Symbol.iterator]())):tn,"%JSON%":typeof JSON=="object"?JSON:tn,"%Map%":typeof Map=="undefined"?tn:Map,"%MapIteratorPrototype%":typeof Map=="undefined"||!ru||!vr?tn:vr(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise=="undefined"?tn:Promise,"%Proxy%":typeof Proxy=="undefined"?tn:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":typeof Reflect=="undefined"?tn:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set=="undefined"?tn:Set,"%SetIteratorPrototype%":typeof Set=="undefined"||!ru||!vr?tn:vr(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer=="undefined"?tn:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":ru&&vr?vr(""[Symbol.iterator]()):tn,"%Symbol%":ru?Symbol:tn,"%SyntaxError%":su,"%ThrowTypeError%":DA,"%TypedArray%":UA,"%TypeError%":ou,"%Uint8Array%":typeof Uint8Array=="undefined"?tn:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray=="undefined"?tn:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array=="undefined"?tn:Uint16Array,"%Uint32Array%":typeof Uint32Array=="undefined"?tn:Uint32Array,"%URIError%":URIError,"%WeakMap%":typeof WeakMap=="undefined"?tn:WeakMap,"%WeakRef%":typeof WeakRef=="undefined"?tn:WeakRef,"%WeakSet%":typeof WeakSet=="undefined"?tn:WeakSet};if(vr)try{null.error}catch(r){qy=vr(vr(r)),ta["%Error.prototype%"]=qy}var qy,BA=function r(t){var e;if(t==="%AsyncFunction%")e=qp("async function () {}");else if(t==="%GeneratorFunction%")e=qp("function* () {}");else if(t==="%AsyncGeneratorFunction%")e=qp("async function* () {}");else if(t==="%AsyncGenerator%"){var o=r("%AsyncGeneratorFunction%");o&&(e=o.prototype)}else if(t==="%AsyncIteratorPrototype%"){var a=r("%AsyncGenerator%");a&&vr&&(e=vr(a.prototype))}return ta[t]=e,e},Xy={"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},nl=Vc(),Hc=Wy(),zA=nl.call(Function.call,Array.prototype.concat),kA=nl.call(Function.apply,Array.prototype.splice),Yy=nl.call(Function.call,String.prototype.replace),Wc=nl.call(Function.call,String.prototype.slice),GA=nl.call(Function.call,RegExp.prototype.exec),VA=/[^%.[\\]]+|\\[(?:(-?\\d+(?:\\.\\d+)?)|(["'])((?:(?!\\2)[^\\\\]|\\\\.)*?)\\2)\\]|(?=(?:\\.|\\[\\])(?:\\.|\\[\\]|%$))/g,HA=/\\\\(\\\\)?/g,WA=function(t){var e=Wc(t,0,1),o=Wc(t,-1);if(e==="%"&&o!=="%")throw new su("invalid intrinsic syntax, expected closing \`%\`");if(o==="%"&&e!=="%")throw new su("invalid intrinsic syntax, expected opening \`%\`");var a=[];return Yy(t,VA,function(l,f,h,p){a[a.length]=h?Yy(p,HA,"$1"):f||l}),a},qA=function(t,e){var o=t,a;if(Hc(Xy,o)&&(a=Xy[o],o="%"+a[0]+"%"),Hc(ta,o)){var l=ta[o];if(l===iu&&(l=BA(o)),typeof l=="undefined"&&!e)throw new ou("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:a,name:o,value:l}}throw new su("intrinsic "+t+" does not exist!")};Jy.exports=function(t,e){if(typeof t!="string"||t.length===0)throw new ou("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof e!="boolean")throw new ou('"allowMissing" argument must be a boolean');if(GA(/^%?[^%]*%?$/,t)===null)throw new su("\`%\` may not be present anywhere but at the beginning and end of the intrinsic name");var o=WA(t),a=o.length>0?o[0]:"",l=qA("%"+a+"%",e),f=l.name,h=l.value,p=!1,d=l.alias;d&&(a=d[0],kA(o,zA([0,1],d)));for(var g=1,_=!0;g<o.length;g+=1){var y=o[g],M=Wc(y,0,1),w=Wc(y,-1);if((M==='"'||M==="'"||M==="\`"||w==='"'||w==="'"||w==="\`")&&M!==w)throw new su("property names with quotes must have matching quotes");if((y==="constructor"||!_)&&(p=!0),a+="."+y,f="%"+a+"%",Hc(ta,f))h=ta[f];else if(h!=null){if(!(y in h)){if(!e)throw new ou("base intrinsic for "+t+" exists, but the property is not available.");return}if(Qs&&g+1>=o.length){var T=Qs(h,y);_=!!T,_&&"get"in T&&!("originalValue"in T.get)?h=T.get:h=h[y]}else _=Hc(h,y),h=h[y];_&&!p&&(ta[f]=h)}}return h}});var rl=Jt((j3,$y)=>{"use strict";var XA=ea(),Yp=XA("%Object.defineProperty%",!0),Zp=function(){if(Yp)try{return Yp({},"a",{value:1}),!0}catch(t){return!1}return!1};Zp.hasArrayLengthDefineBug=function(){if(!Zp())return null;try{return Yp([],"length",{value:1}).length!==1}catch(t){return!0}};$y.exports=Zp});var Jp=Jt((Q3,Ky)=>{"use strict";var YA=ea(),qc=YA("%Object.getOwnPropertyDescriptor%",!0);if(qc)try{qc([],"length")}catch(r){qc=null}Ky.exports=qc});var Xc=Jt((tF,Qy)=>{"use strict";var ZA=rl()(),$p=ea(),il=ZA&&$p("%Object.defineProperty%",!0);if(il)try{il({},"a",{value:1})}catch(r){il=!1}var JA=$p("%SyntaxError%"),au=$p("%TypeError%"),jy=Jp();Qy.exports=function(t,e,o){if(!t||typeof t!="object"&&typeof t!="function")throw new au("\`obj\` must be an object or a function\`");if(typeof e!="string"&&typeof e!="symbol")throw new au("\`property\` must be a string or a symbol\`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new au("\`nonEnumerable\`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new au("\`nonWritable\`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new au("\`nonConfigurable\`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new au("\`loose\`, if provided, must be a boolean");var a=arguments.length>3?arguments[3]:null,l=arguments.length>4?arguments[4]:null,f=arguments.length>5?arguments[5]:null,h=arguments.length>6?arguments[6]:!1,p=!!jy&&jy(t,e);if(il)il(t,e,{configurable:f===null&&p?p.configurable:!f,enumerable:a===null&&p?p.enumerable:!a,value:o,writable:l===null&&p?p.writable:!l});else if(h||!a&&!l&&!f)t[e]=o;else throw new JA("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")}});var ov=Jt((eF,iv)=>{"use strict";var rv=ea(),tv=Xc(),$A=rl()(),ev=Jp(),nv=rv("%TypeError%"),KA=rv("%Math.floor%");iv.exports=function(t,e){if(typeof t!="function")throw new nv("\`fn\` is not a function");if(typeof e!="number"||e<0||e>4294967295||KA(e)!==e)throw new nv("\`length\` must be a positive 32-bit integer");var o=arguments.length>2&&!!arguments[2],a=!0,l=!0;if("length"in t&&ev){var f=ev(t,"length");f&&!f.configurable&&(a=!1),f&&!f.writable&&(l=!1)}return(a||l||!o)&&($A?tv(t,"length",e,!0,!0):tv(t,"length",e)),t}});var Zc=Jt((nF,Yc)=>{"use strict";var Kp=Vc(),uu=ea(),jA=ov(),QA=uu("%TypeError%"),av=uu("%Function.prototype.apply%"),uv=uu("%Function.prototype.call%"),lv=uu("%Reflect.apply%",!0)||Kp.call(uv,av),ol=uu("%Object.defineProperty%",!0),tC=uu("%Math.max%");if(ol)try{ol({},"a",{value:1})}catch(r){ol=null}Yc.exports=function(t){if(typeof t!="function")throw new QA("a function is required");var e=lv(Kp,uv,arguments);return jA(e,1+tC(0,t.length-(arguments.length-1)),!0)};var sv=function(){return lv(Kp,av,arguments)};ol?ol(Yc.exports,"apply",{value:sv}):Yc.exports.apply=sv});var jp=Jt((rF,hv)=>{"use strict";var cv=ea(),fv=Zc(),eC=fv(cv("String.prototype.indexOf"));hv.exports=function(t,e){var o=cv(t,!!e);return typeof o=="function"&&eC(t,".prototype.")>-1?fv(o):o}});var mv=Jt((iF,dv)=>{"use strict";var nC=Gc()(),rC=jp(),Qp=rC("Object.prototype.toString"),Jc=function(t){return nC&&t&&typeof t=="object"&&Symbol.toStringTag in t?!1:Qp(t)==="[object Arguments]"},pv=function(t){return Jc(t)?!0:t!==null&&typeof t=="object"&&typeof t.length=="number"&&t.length>=0&&Qp(t)!=="[object Array]"&&Qp(t.callee)==="[object Function]"},iC=function(){return Jc(arguments)}();Jc.isLegacyArguments=pv;dv.exports=iC?Jc:pv});var lu=Jt((oF,_v)=>{"use strict";var oC=Hp(),sC=typeof Symbol=="function"&&typeof Symbol("foo")=="symbol",aC=Object.prototype.toString,uC=Array.prototype.concat,gv=Xc(),lC=function(r){return typeof r=="function"&&aC.call(r)==="[object Function]"},yv=rl()(),cC=function(r,t,e,o){if(t in r){if(o===!0){if(r[t]===e)return}else if(!lC(o)||!o())return}yv?gv(r,t,e,!0):gv(r,t,e)},vv=function(r,t){var e=arguments.length>2?arguments[2]:{},o=oC(t);sC&&(o=uC.call(o,Object.getOwnPropertySymbols(t)));for(var a=0;a<o.length;a+=1)cC(r,o[a],t[o[a]],e[o[a]])};vv.supportsDescriptors=!!yv;_v.exports=vv});var td=Jt((sF,Ev)=>{"use strict";var xv=function(r){return r!==r};Ev.exports=function(t,e){return t===0&&e===0?1/t===1/e:!!(t===e||xv(t)&&xv(e))}});var ed=Jt((aF,Mv)=>{"use strict";var fC=td();Mv.exports=function(){return typeof Object.is=="function"?Object.is:fC}});var wv=Jt((uF,Sv)=>{"use strict";var hC=ed(),pC=lu();Sv.exports=function(){var t=hC();return pC(Object,{is:t},{is:function(){return Object.is!==t}}),t}});var Cv=Jt((lF,Av)=>{"use strict";var dC=lu(),mC=Zc(),gC=td(),bv=ed(),yC=wv(),Tv=mC(bv(),Object);dC(Tv,{getPolyfill:bv,implementation:gC,shim:yC});Av.exports=Tv});var Nv=Jt((cF,Lv)=>{"use strict";var nd=jp(),Pv=Gc()(),Iv,Rv,rd,id;Pv&&(Iv=nd("Object.prototype.hasOwnProperty"),Rv=nd("RegExp.prototype.exec"),rd={},$c=function(){throw rd},id={toString:$c,valueOf:$c},typeof Symbol.toPrimitive=="symbol"&&(id[Symbol.toPrimitive]=$c));var $c,vC=nd("Object.prototype.toString"),_C=Object.getOwnPropertyDescriptor,xC="[object RegExp]";Lv.exports=Pv?function(t){if(!t||typeof t!="object")return!1;var e=_C(t,"lastIndex"),o=e&&Iv(e,"value");if(!o)return!1;try{Rv(t,id)}catch(a){return a===rd}}:function(t){return!t||typeof t!="object"&&typeof t!="function"?!1:vC(t)===xC}});var Dv=Jt((fF,Ov)=>{"use strict";var al=function(){return typeof function(){}.name=="string"},sl=Object.getOwnPropertyDescriptor;if(sl)try{sl([],"length")}catch(r){sl=null}al.functionsHaveConfigurableNames=function(){if(!al()||!sl)return!1;var t=sl(function(){},"name");return!!t&&!!t.configurable};var EC=Function.prototype.bind;al.boundFunctionsHaveNames=function(){return al()&&typeof EC=="function"&&function(){}.bind().name!==""};Ov.exports=al});var Bv=Jt((hF,Uv)=>{"use strict";var Fv=Xc(),MC=rl()(),SC=Dv().functionsHaveConfigurableNames(),wC=TypeError;Uv.exports=function(t,e){if(typeof t!="function")throw new wC("\`fn\` is not a function");var o=arguments.length>2&&!!arguments[2];return(!o||SC)&&(MC?Fv(t,"name",e,!0,!0):Fv(t,"name",e)),t}});var od=Jt((pF,zv)=>{"use strict";var bC=Bv(),TC=Object,AC=TypeError;zv.exports=bC(function(){if(this!=null&&this!==TC(this))throw new AC("RegExp.prototype.flags getter called on non-object");var t="";return this.hasIndices&&(t+="d"),this.global&&(t+="g"),this.ignoreCase&&(t+="i"),this.multiline&&(t+="m"),this.dotAll&&(t+="s"),this.unicode&&(t+="u"),this.unicodeSets&&(t+="v"),this.sticky&&(t+="y"),t},"get flags",!0)});var sd=Jt((dF,kv)=>{"use strict";var CC=od(),PC=lu().supportsDescriptors,IC=Object.getOwnPropertyDescriptor;kv.exports=function(){if(PC&&/a/mig.flags==="gim"){var t=IC(RegExp.prototype,"flags");if(t&&typeof t.get=="function"&&typeof RegExp.prototype.dotAll=="boolean"&&typeof RegExp.prototype.hasIndices=="boolean"){var e="",o={};if(Object.defineProperty(o,"hasIndices",{get:function(){e+="d"}}),Object.defineProperty(o,"sticky",{get:function(){e+="y"}}),e==="dy")return t.get}}return CC}});var Hv=Jt((mF,Vv)=>{"use strict";var RC=lu().supportsDescriptors,LC=sd(),NC=Object.getOwnPropertyDescriptor,OC=Object.defineProperty,DC=TypeError,Gv=Object.getPrototypeOf,FC=/a/;Vv.exports=function(){if(!RC||!Gv)throw new DC("RegExp.prototype.flags requires a true ES5 environment that supports property descriptors");var t=LC(),e=Gv(FC),o=NC(e,"flags");return(!o||o.get!==t)&&OC(e,"flags",{configurable:!0,enumerable:!1,get:t}),t}});var Yv=Jt((gF,Xv)=>{"use strict";var UC=lu(),BC=Zc(),zC=od(),Wv=sd(),kC=Hv(),qv=BC(Wv());UC(qv,{getPolyfill:Wv,implementation:zC,shim:kC});Xv.exports=qv});var Jv=Jt((yF,Zv)=>{"use strict";var GC=Date.prototype.getDay,VC=function(t){try{return GC.call(t),!0}catch(e){return!1}},HC=Object.prototype.toString,WC="[object Date]",qC=Gc()();Zv.exports=function(t){return typeof t!="object"||t===null?!1:qC?VC(t):HC.call(t)===WC}});var ad=Jt((vF,s_)=>{var $v=Hp(),Kv=mv(),jv=Cv(),Qv=Nv(),t_=Yv(),e_=Jv(),n_=Date.prototype.getTime;function o_(r,t,e){var o=e||{};return(o.strict?jv(r,t):r===t)?!0:!r||!t||typeof r!="object"&&typeof t!="object"?o.strict?jv(r,t):r==t:XC(r,t,o)}function r_(r){return r==null}function i_(r){return!(!r||typeof r!="object"||typeof r.length!="number"||typeof r.copy!="function"||typeof r.slice!="function"||r.length>0&&typeof r[0]!="number")}function XC(r,t,e){var o,a;if(typeof r!=typeof t||r_(r)||r_(t)||r.prototype!==t.prototype||Kv(r)!==Kv(t))return!1;var l=Qv(r),f=Qv(t);if(l!==f)return!1;if(l||f)return r.source===t.source&&t_(r)===t_(t);if(e_(r)&&e_(t))return n_.call(r)===n_.call(t);var h=i_(r),p=i_(t);if(h!==p)return!1;if(h||p){if(r.length!==t.length)return!1;for(o=0;o<r.length;o++)if(r[o]!==t[o])return!1;return!0}if(typeof r!=typeof t)return!1;try{var d=$v(r),g=$v(t)}catch(_){return!1}if(d.length!==g.length)return!1;for(d.sort(),g.sort(),o=d.length-1;o>=0;o--)if(d[o]!=g[o])return!1;for(o=d.length-1;o>=0;o--)if(a=d[o],!o_(r[a],t[a],e))return!1;return!0}s_.exports=o_});var _d=Jt((wB,p_)=>{var FP=ad(),yo=function(r){this.precision=r&&r.precision?r.precision:17,this.direction=r&&r.direction?r.direction:!1,this.pseudoNode=r&&r.pseudoNode?r.pseudoNode:!1,this.objectComparator=r&&r.objectComparator?r.objectComparator:UP};yo.prototype.compare=function(r,t){if(r.type!==t.type||!h_(r,t))return!1;switch(r.type){case"Point":return this.compareCoord(r.coordinates,t.coordinates);case"LineString":return this.compareLine(r.coordinates,t.coordinates,0,!1);case"Polygon":return this.comparePolygon(r,t);case"Feature":return this.compareFeature(r,t);default:if(r.type.indexOf("Multi")===0){var e=this,o=f_(r),a=f_(t);return o.every(function(l){return this.some(function(f){return e.compare(l,f)})},a)}}return!1};function f_(r){return r.coordinates.map(function(t){return{type:r.type.replace("Multi",""),coordinates:t}})}function h_(r,t){return r.hasOwnProperty("coordinates")?r.coordinates.length===t.coordinates.length:r.length===t.length}yo.prototype.compareCoord=function(r,t){if(r.length!==t.length)return!1;for(var e=0;e<r.length;e++)if(r[e].toFixed(this.precision)!==t[e].toFixed(this.precision))return!1;return!0};yo.prototype.compareLine=function(r,t,e,o){if(!h_(r,t))return!1;var a=this.pseudoNode?r:this.removePseudo(r),l=this.pseudoNode?t:this.removePseudo(t);if(!(o&&!this.compareCoord(a[0],l[0])&&(l=this.fixStartIndex(l,a),!l))){var f=this.compareCoord(a[e],l[e]);return this.direction||f?this.comparePath(a,l):this.compareCoord(a[e],l[l.length-(1+e)])?this.comparePath(a.slice().reverse(),l):!1}};yo.prototype.fixStartIndex=function(r,t){for(var e,o=-1,a=0;a<r.length;a++)if(this.compareCoord(r[a],t[0])){o=a;break}return o>=0&&(e=[].concat(r.slice(o,r.length),r.slice(1,o+1))),e};yo.prototype.comparePath=function(r,t){var e=this;return r.every(function(o,a){return e.compareCoord(o,this[a])},t)};yo.prototype.comparePolygon=function(r,t){if(this.compareLine(r.coordinates[0],t.coordinates[0],1,!0)){var e=r.coordinates.slice(1,r.coordinates.length),o=t.coordinates.slice(1,t.coordinates.length),a=this;return e.every(function(l){return this.some(function(f){return a.compareLine(l,f,1,!0)})},o)}else return!1};yo.prototype.compareFeature=function(r,t){return r.id!==t.id||!this.objectComparator(r.properties,t.properties)||!this.compareBBox(r,t)?!1:this.compare(r.geometry,t.geometry)};yo.prototype.compareBBox=function(r,t){return!!(!r.bbox&&!t.bbox||r.bbox&&t.bbox&&this.compareCoord(r.bbox,t.bbox))};yo.prototype.removePseudo=function(r){return r};function UP(r,t){return FP(r,t,{strict:!0})}p_.exports=yo});var d_=Jt((FB,Qc)=>{function Ms(r,t,e,o){this.dataset=[],this.epsilon=1,this.minPts=2,this.distance=this._euclideanDistance,this.clusters=[],this.noise=[],this._visited=[],this._assigned=[],this._datasetLength=0,this._init(r,t,e,o)}Ms.prototype.run=function(r,t,e,o){this._init(r,t,e,o);for(var a=0;a<this._datasetLength;a++)if(this._visited[a]!==1){this._visited[a]=1;var l=this._regionQuery(a);if(l.length<this.minPts)this.noise.push(a);else{var f=this.clusters.length;this.clusters.push([]),this._addToCluster(a,f),this._expandCluster(f,l)}}return this.clusters};Ms.prototype._init=function(r,t,e,o){if(r){if(!(r instanceof Array))throw Error("Dataset must be of type array, "+typeof r+" given");this.dataset=r,this.clusters=[],this.noise=[],this._datasetLength=r.length,this._visited=new Array(this._datasetLength),this._assigned=new Array(this._datasetLength)}t&&(this.epsilon=t),e&&(this.minPts=e),o&&(this.distance=o)};Ms.prototype._expandCluster=function(r,t){for(var e=0;e<t.length;e++){var o=t[e];if(this._visited[o]!==1){this._visited[o]=1;var a=this._regionQuery(o);a.length>=this.minPts&&(t=this._mergeArrays(t,a))}this._assigned[o]!==1&&this._addToCluster(o,r)}};Ms.prototype._addToCluster=function(r,t){this.clusters[t].push(r),this._assigned[r]=1};Ms.prototype._regionQuery=function(r){for(var t=[],e=0;e<this._datasetLength;e++){var o=this.distance(this.dataset[r],this.dataset[e]);o<this.epsilon&&t.push(e)}return t};Ms.prototype._mergeArrays=function(r,t){for(var e=t.length,o=0;o<e;o++){var a=t[o];r.indexOf(a)<0&&r.push(a)}return r};Ms.prototype._euclideanDistance=function(r,t){for(var e=0,o=Math.min(r.length,t.length);o--;)e+=(r[o]-t[o])*(r[o]-t[o]);return Math.sqrt(e)};typeof Qc!="undefined"&&Qc.exports&&(Qc.exports=Ms)});var m_=Jt((UB,tf)=>{function Ss(r,t,e){this.k=3,this.dataset=[],this.assignments=[],this.centroids=[],this.init(r,t,e)}Ss.prototype.init=function(r,t,e){this.assignments=[],this.centroids=[],typeof r!="undefined"&&(this.dataset=r),typeof t!="undefined"&&(this.k=t),typeof e!="undefined"&&(this.distance=e)};Ss.prototype.run=function(r,t){this.init(r,t);for(var e=this.dataset.length,o=0;o<this.k;o++)this.centroids[o]=this.randomCentroid();for(var a=!0;a;){a=this.assign();for(var l=0;l<this.k;l++){for(var f=new Array(g),h=0,p=0;p<g;p++)f[p]=0;for(var d=0;d<e;d++){var g=this.dataset[d].length;if(l===this.assignments[d]){for(var p=0;p<g;p++)f[p]+=this.dataset[d][p];h++}}if(h>0){for(var p=0;p<g;p++)f[p]/=h;this.centroids[l]=f}else this.centroids[l]=this.randomCentroid(),a=!0}}return this.getClusters()};Ss.prototype.randomCentroid=function(){var r=this.dataset.length-1,t,e;do e=Math.round(Math.random()*r),t=this.dataset[e];while(this.centroids.indexOf(t)>=0);return t};Ss.prototype.assign=function(){for(var r=!1,t=this.dataset.length,e,o=0;o<t;o++)e=this.argmin(this.dataset[o],this.centroids,this.distance),e!=this.assignments[o]&&(this.assignments[o]=e,r=!0);return r};Ss.prototype.getClusters=function(){for(var r=new Array(this.k),t,e=0;e<this.assignments.length;e++)t=this.assignments[e],typeof r[t]=="undefined"&&(r[t]=[]),r[t].push(e);return r};Ss.prototype.argmin=function(r,t,e){for(var o=Number.MAX_VALUE,a=0,l=t.length,f,h=0;h<l;h++)f=e(r,t[h]),f<o&&(o=f,a=h);return a};Ss.prototype.distance=function(r,t){for(var e=0,o=Math.min(r.length,t.length);o--;){var a=r[o]-t[o];e+=a*a}return Math.sqrt(e)};typeof tf!="undefined"&&tf.exports&&(tf.exports=Ss)});var xd=Jt((BB,ef)=>{function vo(r,t,e){this._queue=[],this._priorities=[],this._sorting="desc",this._init(r,t,e)}vo.prototype.insert=function(r,t){for(var e=this._queue.length,o=e;o--;){var a=this._priorities[o];this._sorting==="desc"?t>a&&(e=o):t<a&&(e=o)}this._insertAt(r,t,e)};vo.prototype.remove=function(r){for(var t=this._queue.length;t--;){var e=this._queue[t];if(r===e){this._queue.splice(t,1),this._priorities.splice(t,1);break}}};vo.prototype.forEach=function(r){this._queue.forEach(r)};vo.prototype.getElements=function(){return this._queue};vo.prototype.getElementPriority=function(r){return this._priorities[r]};vo.prototype.getPriorities=function(){return this._priorities};vo.prototype.getElementsWithPriorities=function(){for(var r=[],t=0,e=this._queue.length;t<e;t++)r.push([this._queue[t],this._priorities[t]]);return r};vo.prototype._init=function(r,t,e){if(r&&t){if(this._queue=[],this._priorities=[],r.length!==t.length)throw new Error("Arrays must have the same length");for(var o=0;o<r.length;o++)this.insert(r[o],t[o])}e&&(this._sorting=e)};vo.prototype._insertAt=function(r,t,e){this._queue.length===e?(this._queue.push(r),this._priorities.push(t)):(this._queue.splice(e,0,r),this._priorities.splice(e,0,t))};typeof ef!="undefined"&&ef.exports&&(ef.exports=vo)});var y_=Jt((zB,fu)=>{typeof fu!="undefined"&&fu.exports&&(g_=xd());var g_;function $o(r,t,e,o){this.epsilon=1,this.minPts=1,this.distance=this._euclideanDistance,this._reachability=[],this._processed=[],this._coreDistance=0,this._orderedList=[],this._init(r,t,e,o)}$o.prototype.run=function(r,t,e,o){this._init(r,t,e,o);for(var a=0,l=this.dataset.length;a<l;a++)if(this._processed[a]!==1){this._processed[a]=1,this.clusters.push([a]);var f=this.clusters.length-1;this._orderedList.push(a);var h=new g_(null,null,"asc"),p=this._regionQuery(a);this._distanceToCore(a)!==void 0&&(this._updateQueue(a,p,h),this._expandCluster(f,h))}return this.clusters};$o.prototype.getReachabilityPlot=function(){for(var r=[],t=0,e=this._orderedList.length;t<e;t++){var o=this._orderedList[t],a=this._reachability[o];r.push([o,a])}return r};$o.prototype._init=function(r,t,e,o){if(r){if(!(r instanceof Array))throw Error("Dataset must be of type array, "+typeof r+" given");this.dataset=r,this.clusters=[],this._reachability=new Array(this.dataset.length),this._processed=new Array(this.dataset.length),this._coreDistance=0,this._orderedList=[]}t&&(this.epsilon=t),e&&(this.minPts=e),o&&(this.distance=o)};$o.prototype._updateQueue=function(r,t,e){var o=this;this._coreDistance=this._distanceToCore(r),t.forEach(function(a){if(o._processed[a]===void 0){var l=o.distance(o.dataset[r],o.dataset[a]),f=Math.max(o._coreDistance,l);o._reachability[a]===void 0?(o._reachability[a]=f,e.insert(a,f)):f<o._reachability[a]&&(o._reachability[a]=f,e.remove(a),e.insert(a,f))}})};$o.prototype._expandCluster=function(r,t){for(var e=t.getElements(),o=0,a=e.length;o<a;o++){var l=e[o];if(this._processed[l]===void 0){var f=this._regionQuery(l);this._processed[l]=1,this.clusters[r].push(l),this._orderedList.push(l),this._distanceToCore(l)!==void 0&&(this._updateQueue(l,f,t),this._expandCluster(r,t))}}};$o.prototype._distanceToCore=function(r){for(var t=this.epsilon,e=0;e<t;e++){var o=this._regionQuery(r,e);if(o.length>=this.minPts)return e}};$o.prototype._regionQuery=function(r,t){t=t||this.epsilon;for(var e=[],o=0,a=this.dataset.length;o<a;o++)this.distance(this.dataset[r],this.dataset[o])<t&&e.push(o);return e};$o.prototype._euclideanDistance=function(r,t){for(var e=0,o=Math.min(r.length,t.length);o--;)e+=(r[o]-t[o])*(r[o]-t[o]);return Math.sqrt(e)};typeof fu!="undefined"&&fu.exports&&(fu.exports=$o)});var v_=Jt((kB,nf)=>{typeof nf!="undefined"&&nf.exports&&(nf.exports={DBSCAN:d_(),KMEANS:m_(),OPTICS:y_(),PriorityQueue:xd()})});var Ed=Jt((XB,x_)=>{"use strict";x_.exports={eudist:function(t,e,o){for(var a=t.length,l=0,f=0;f<a;f++){var h=(t[f]||0)-(e[f]||0);l+=h*h}return o?Math.sqrt(l):l},mandist:function(t,e,o){for(var a=t.length,l=0,f=0;f<a;f++)l+=Math.abs((t[f]||0)-(e[f]||0));return o?Math.sqrt(l):l},dist:function(t,e,o){var a=Math.abs(t-e);return o?a:a*a}}});var S_=Jt((YB,M_)=>{"use strict";var E_=Ed(),HP=E_.eudist,WP=E_.dist;M_.exports={kmrand:function(t,e){for(var o={},a=[],l=e<<2,f=t.length,h=t[0].length>0;a.length<e&&l-- >0;){var p=t[Math.floor(Math.random()*f)],d=h?p.join("_"):""+p;o[d]||(o[d]=!0,a.push(p))}if(a.length<e)throw new Error("Error initializating clusters");return a},kmpp:function(t,e){var o=t[0].length?HP:WP,a=[],l=t.length,f=t[0].length>0,h={},p=t[Math.floor(Math.random()*l)],d=f?p.join("_"):""+p;for(a.push(p),h[d]=!0;a.length<e;){for(var g=[],_=a.length,y=0,M=[],w=0;w<l;w++){for(var T=1/0,x=0;x<_;x++){var v=o(t[w],a[x]);v<=T&&(T=v)}g[w]=T}for(var C=0;C<l;C++)y+=g[C];for(var S=0;S<l;S++)M[S]={i:S,v:t[S],pr:g[S]/y,cs:0};M.sort(function(z,L){return z.pr-L.pr}),M[0].cs=M[0].pr;for(var O=1;O<l;O++)M[O].cs=M[O-1].cs+M[O].pr;for(var F=Math.random(),G=0;G<l-1&&M[G++].cs<F;);a.push(M[G-1].v)}return a}}});var C_=Jt(($B,A_)=>{"use strict";var Md=Ed(),T_=S_(),qP=Md.eudist,ZB=Md.mandist,JB=Md.dist,XP=T_.kmrand,YP=T_.kmpp,w_=1e4;function b_(r,t,e){e=e||[];for(var o=0;o<r;o++)e[o]=t;return e}function ZP(r,t,e,o){var a=[],l=[],f=[],h=[],p=!1,d=o||w_,g=r.length,_=r[0].length,y=_>0,M=[];if(e)e=="kmrand"?a=XP(r,t):e=="kmpp"?a=YP(r,t):a=e;else for(var w={};a.length<t;){var T=Math.floor(Math.random()*g);w[T]||(w[T]=!0,a.push(r[T]))}do{b_(t,0,M);for(var x=0;x<g;x++){for(var v=1/0,C=0,S=0;S<t;S++){var h=y?qP(r[x],a[S]):Math.abs(r[x]-a[S]);h<=v&&(v=h,C=S)}f[x]=C,M[C]++}for(var O=[],l=[],F=0,G=0;G<t;G++)O[G]=y?b_(_,0,O[G]):0,l[G]=a[G];if(y){for(var z=0;z<t;z++)a[z]=[];for(var L=0;L<g;L++)for(var D=f[L],q=O[D],nt=r[L],k=0;k<_;k++)q[k]+=nt[k];p=!0;for(var xt=0;xt<t;xt++){for(var X=a[xt],it=O[xt],vt=l[xt],pt=M[xt],et=0;et<_;et++)X[et]=it[et]/pt||0;if(p){for(var ot=0;ot<_;ot++)if(vt[ot]!=X[ot]){p=!1;break}}}}else{for(var V=0;V<g;V++){var K=f[V];O[K]+=r[V]}for(var at=0;at<t;at++)a[at]=O[at]/M[at]||0;p=!0;for(var Tt=0;Tt<t;Tt++)if(l[Tt]!=a[Tt]){p=!1;break}}p=p||--d<=0}while(!p);return{it:w_-d,k:t,idxs:f,centroids:a}}A_.exports=ZP});var gu=Jt((Cd,Pd)=>{(function(r,t){typeof Cd=="object"&&typeof Pd!="undefined"?Pd.exports=t():typeof define=="function"&&define.amd?define(t):(r=typeof globalThis!="undefined"?globalThis:r||self,r.polygonClipping=t())})(Cd,function(){"use strict";function r($,N){if(!($ instanceof N))throw new TypeError("Cannot call a class as a function")}function t($,N){for(var b=0;b<N.length;b++){var R=N[b];R.enumerable=R.enumerable||!1,R.configurable=!0,"value"in R&&(R.writable=!0),Object.defineProperty($,R.key,R)}}function e($,N,b){return N&&t($.prototype,N),b&&t($,b),$}var o=function(){function $(N,b){this.next=null,this.key=N,this.data=b,this.left=null,this.right=null}return $}();function a($,N){return $>N?1:$<N?-1:0}function l($,N,b){for(var R=new o(null,null),W=R,J=R;;){var I=b($,N.key);if(I<0){if(N.left===null)break;if(b($,N.left.key)<0){var P=N.left;if(N.left=P.right,P.right=N,N=P,N.left===null)break}J.left=N,J=N,N=N.left}else if(I>0){if(N.right===null)break;if(b($,N.right.key)>0){var P=N.right;if(N.right=P.left,P.left=N,N=P,N.right===null)break}W.right=N,W=N,N=N.right}else break}return W.right=N.left,J.left=N.right,N.left=R.right,N.right=R.left,N}function f($,N,b,R){var W=new o($,N);if(b===null)return W.left=W.right=null,W;b=l($,b,R);var J=R($,b.key);return J<0?(W.left=b.left,W.right=b,b.left=null):J>=0&&(W.right=b.right,W.left=b,b.right=null),W}function h($,N,b){var R=null,W=null;if(N){N=l($,N,b);var J=b(N.key,$);J===0?(R=N.left,W=N.right):J<0?(W=N.right,N.right=null,R=N):(R=N.left,N.left=null,W=N)}return{left:R,right:W}}function p($,N,b){return N===null?$:($===null||(N=l($.key,N,b),N.left=$),N)}function d($,N,b,R,W){if($){R(""+N+(b?"\\u2514\\u2500\\u2500 ":"\\u251C\\u2500\\u2500 ")+W($)+\`
|
|
3821
3821
|
\`);var J=N+(b?" ":"\\u2502 ");$.left&&d($.left,J,!1,R,W),$.right&&d($.right,J,!0,R,W)}}var g=function(){function $(N){N===void 0&&(N=a),this._root=null,this._size=0,this._comparator=N}return $.prototype.insert=function(N,b){return this._size++,this._root=f(N,b,this._root,this._comparator)},$.prototype.add=function(N,b){var R=new o(N,b);this._root===null&&(R.left=R.right=null,this._size++,this._root=R);var W=this._comparator,J=l(N,this._root,W),I=W(N,J.key);return I===0?this._root=J:(I<0?(R.left=J.left,R.right=J,J.left=null):I>0&&(R.right=J.right,R.left=J,J.right=null),this._size++,this._root=R),this._root},$.prototype.remove=function(N){this._root=this._remove(N,this._root,this._comparator)},$.prototype._remove=function(N,b,R){var W;if(b===null)return null;b=l(N,b,R);var J=R(N,b.key);return J===0?(b.left===null?W=b.right:(W=l(N,b.left,R),W.right=b.right),this._size--,W):b},$.prototype.pop=function(){var N=this._root;if(N){for(;N.left;)N=N.left;return this._root=l(N.key,this._root,this._comparator),this._root=this._remove(N.key,this._root,this._comparator),{key:N.key,data:N.data}}return null},$.prototype.findStatic=function(N){for(var b=this._root,R=this._comparator;b;){var W=R(N,b.key);if(W===0)return b;W<0?b=b.left:b=b.right}return null},$.prototype.find=function(N){return this._root&&(this._root=l(N,this._root,this._comparator),this._comparator(N,this._root.key)!==0)?null:this._root},$.prototype.contains=function(N){for(var b=this._root,R=this._comparator;b;){var W=R(N,b.key);if(W===0)return!0;W<0?b=b.left:b=b.right}return!1},$.prototype.forEach=function(N,b){for(var R=this._root,W=[],J=!1;!J;)R!==null?(W.push(R),R=R.left):W.length!==0?(R=W.pop(),N.call(b,R),R=R.right):J=!0;return this},$.prototype.range=function(N,b,R,W){for(var J=[],I=this._comparator,P=this._root,B;J.length!==0||P;)if(P)J.push(P),P=P.left;else{if(P=J.pop(),B=I(P.key,b),B>0)break;if(I(P.key,N)>=0&&R.call(W,P))return this;P=P.right}return this},$.prototype.keys=function(){var N=[];return this.forEach(function(b){var R=b.key;return N.push(R)}),N},$.prototype.values=function(){var N=[];return this.forEach(function(b){var R=b.data;return N.push(R)}),N},$.prototype.min=function(){return this._root?this.minNode(this._root).key:null},$.prototype.max=function(){return this._root?this.maxNode(this._root).key:null},$.prototype.minNode=function(N){if(N===void 0&&(N=this._root),N)for(;N.left;)N=N.left;return N},$.prototype.maxNode=function(N){if(N===void 0&&(N=this._root),N)for(;N.right;)N=N.right;return N},$.prototype.at=function(N){for(var b=this._root,R=!1,W=0,J=[];!R;)if(b)J.push(b),b=b.left;else if(J.length>0){if(b=J.pop(),W===N)return b;W++,b=b.right}else R=!0;return null},$.prototype.next=function(N){var b=this._root,R=null;if(N.right){for(R=N.right;R.left;)R=R.left;return R}for(var W=this._comparator;b;){var J=W(N.key,b.key);if(J===0)break;J<0?(R=b,b=b.left):b=b.right}return R},$.prototype.prev=function(N){var b=this._root,R=null;if(N.left!==null){for(R=N.left;R.right;)R=R.right;return R}for(var W=this._comparator;b;){var J=W(N.key,b.key);if(J===0)break;J<0?b=b.left:(R=b,b=b.right)}return R},$.prototype.clear=function(){return this._root=null,this._size=0,this},$.prototype.toList=function(){return M(this._root)},$.prototype.load=function(N,b,R){b===void 0&&(b=[]),R===void 0&&(R=!1);var W=N.length,J=this._comparator;if(R&&x(N,b,0,W-1,J),this._root===null)this._root=_(N,b,0,W),this._size=W;else{var I=T(this.toList(),y(N,b),J);W=this._size+W,this._root=w({head:I},0,W)}return this},$.prototype.isEmpty=function(){return this._root===null},Object.defineProperty($.prototype,"size",{get:function(){return this._size},enumerable:!0,configurable:!0}),Object.defineProperty($.prototype,"root",{get:function(){return this._root},enumerable:!0,configurable:!0}),$.prototype.toString=function(N){N===void 0&&(N=function(W){return String(W.key)});var b=[];return d(this._root,"",!0,function(R){return b.push(R)},N),b.join("")},$.prototype.update=function(N,b,R){var W=this._comparator,J=h(N,this._root,W),I=J.left,P=J.right;W(N,b)<0?P=f(b,R,P,W):I=f(b,R,I,W),this._root=p(I,P,W)},$.prototype.split=function(N){return h(N,this._root,this._comparator)},$}();function _($,N,b,R){var W=R-b;if(W>0){var J=b+Math.floor(W/2),I=$[J],P=N[J],B=new o(I,P);return B.left=_($,N,b,J),B.right=_($,N,J+1,R),B}return null}function y($,N){for(var b=new o(null,null),R=b,W=0;W<$.length;W++)R=R.next=new o($[W],N[W]);return R.next=null,b.next}function M($){for(var N=$,b=[],R=!1,W=new o(null,null),J=W;!R;)N?(b.push(N),N=N.left):b.length>0?(N=J=J.next=b.pop(),N=N.right):R=!0;return J.next=null,W.next}function w($,N,b){var R=b-N;if(R>0){var W=N+Math.floor(R/2),J=w($,N,W),I=$.head;return I.left=J,$.head=$.head.next,I.right=w($,W+1,b),I}return null}function T($,N,b){for(var R=new o(null,null),W=R,J=$,I=N;J!==null&&I!==null;)b(J.key,I.key)<0?(W.next=J,J=J.next):(W.next=I,I=I.next),W=W.next;return J!==null?W.next=J:I!==null&&(W.next=I),R.next}function x($,N,b,R,W){if(!(b>=R)){for(var J=$[b+R>>1],I=b-1,P=R+1;;){do I++;while(W($[I],J)<0);do P--;while(W($[P],J)>0);if(I>=P)break;var B=$[I];$[I]=$[P],$[P]=B,B=N[I],N[I]=N[P],N[P]=B}x($,N,b,P,W),x($,N,P+1,R,W)}}var v=function(N,b){return N.ll.x<=b.x&&b.x<=N.ur.x&&N.ll.y<=b.y&&b.y<=N.ur.y},C=function(N,b){if(b.ur.x<N.ll.x||N.ur.x<b.ll.x||b.ur.y<N.ll.y||N.ur.y<b.ll.y)return null;var R=N.ll.x<b.ll.x?b.ll.x:N.ll.x,W=N.ur.x<b.ur.x?N.ur.x:b.ur.x,J=N.ll.y<b.ll.y?b.ll.y:N.ll.y,I=N.ur.y<b.ur.y?N.ur.y:b.ur.y;return{ll:{x:R,y:J},ur:{x:W,y:I}}},S=Number.EPSILON;S===void 0&&(S=Math.pow(2,-52));var O=S*S,F=function(N,b){if(-S<N&&N<S&&-S<b&&b<S)return 0;var R=N-b;return R*R<O*N*b?0:N<b?-1:1},G=function(){function $(){r(this,$),this.reset()}return e($,[{key:"reset",value:function(){this.xRounder=new z,this.yRounder=new z}},{key:"round",value:function(b,R){return{x:this.xRounder.round(b),y:this.yRounder.round(R)}}}]),$}(),z=function(){function $(){r(this,$),this.tree=new g,this.round(0)}return e($,[{key:"round",value:function(b){var R=this.tree.add(b),W=this.tree.prev(R);if(W!==null&&F(R.key,W.key)===0)return this.tree.remove(b),W.key;var J=this.tree.next(R);return J!==null&&F(R.key,J.key)===0?(this.tree.remove(b),J.key):b}}]),$}(),L=new G,D=function(N,b){return N.x*b.y-N.y*b.x},q=function(N,b){return N.x*b.x+N.y*b.y},nt=function(N,b,R){var W={x:b.x-N.x,y:b.y-N.y},J={x:R.x-N.x,y:R.y-N.y},I=D(W,J);return F(I,0)},k=function(N){return Math.sqrt(q(N,N))},xt=function(N,b,R){var W={x:b.x-N.x,y:b.y-N.y},J={x:R.x-N.x,y:R.y-N.y};return D(J,W)/k(J)/k(W)},X=function(N,b,R){var W={x:b.x-N.x,y:b.y-N.y},J={x:R.x-N.x,y:R.y-N.y};return q(J,W)/k(J)/k(W)},it=function(N,b,R){return b.y===0?null:{x:N.x+b.x/b.y*(R-N.y),y:R}},vt=function(N,b,R){return b.x===0?null:{x:R,y:N.y+b.y/b.x*(R-N.x)}},pt=function(N,b,R,W){if(b.x===0)return vt(R,W,N.x);if(W.x===0)return vt(N,b,R.x);if(b.y===0)return it(R,W,N.y);if(W.y===0)return it(N,b,R.y);var J=D(b,W);if(J==0)return null;var I={x:R.x-N.x,y:R.y-N.y},P=D(I,b)/J,B=D(I,W)/J,lt=N.x+B*b.x,ct=R.x+P*W.x,Q=N.y+B*b.y,St=R.y+P*W.y,_t=(lt+ct)/2,Mt=(Q+St)/2;return{x:_t,y:Mt}},et=function(){e($,null,[{key:"compare",value:function(b,R){var W=$.comparePoints(b.point,R.point);return W!==0?W:(b.point!==R.point&&b.link(R),b.isLeft!==R.isLeft?b.isLeft?1:-1:V.compare(b.segment,R.segment))}},{key:"comparePoints",value:function(b,R){return b.x<R.x?-1:b.x>R.x?1:b.y<R.y?-1:b.y>R.y?1:0}}]);function $(N,b){r(this,$),N.events===void 0?N.events=[this]:N.events.push(this),this.point=N,this.isLeft=b}return e($,[{key:"link",value:function(b){if(b.point===this.point)throw new Error("Tried to link already linked events");for(var R=b.point.events,W=0,J=R.length;W<J;W++){var I=R[W];this.point.events.push(I),I.point=this.point}this.checkForConsuming()}},{key:"checkForConsuming",value:function(){for(var b=this.point.events.length,R=0;R<b;R++){var W=this.point.events[R];if(W.segment.consumedBy===void 0)for(var J=R+1;J<b;J++){var I=this.point.events[J];I.consumedBy===void 0&&W.otherSE.point.events===I.otherSE.point.events&&W.segment.consume(I.segment)}}}},{key:"getAvailableLinkedEvents",value:function(){for(var b=[],R=0,W=this.point.events.length;R<W;R++){var J=this.point.events[R];J!==this&&!J.segment.ringOut&&J.segment.isInResult()&&b.push(J)}return b}},{key:"getLeftmostComparator",value:function(b){var R=this,W=new Map,J=function(P){var B=P.otherSE;W.set(P,{sine:xt(R.point,b.point,B.point),cosine:X(R.point,b.point,B.point)})};return function(I,P){W.has(I)||J(I),W.has(P)||J(P);var B=W.get(I),lt=B.sine,ct=B.cosine,Q=W.get(P),St=Q.sine,_t=Q.cosine;return lt>=0&&St>=0?ct<_t?1:ct>_t?-1:0:lt<0&&St<0?ct<_t?-1:ct>_t?1:0:St<lt?-1:St>lt?1:0}}}]),$}(),ot=0,V=function(){e($,null,[{key:"compare",value:function(b,R){var W=b.leftSE.point.x,J=R.leftSE.point.x,I=b.rightSE.point.x,P=R.rightSE.point.x;if(P<W)return 1;if(I<J)return-1;var B=b.leftSE.point.y,lt=R.leftSE.point.y,ct=b.rightSE.point.y,Q=R.rightSE.point.y;if(W<J){if(lt<B&<<ct)return 1;if(lt>B&<>ct)return-1;var St=b.comparePoint(R.leftSE.point);if(St<0)return 1;if(St>0)return-1;var _t=R.comparePoint(b.rightSE.point);return _t!==0?_t:-1}if(W>J){if(B<lt&&B<Q)return-1;if(B>lt&&B>Q)return 1;var Mt=R.comparePoint(b.leftSE.point);if(Mt!==0)return Mt;var Lt=b.comparePoint(R.rightSE.point);return Lt<0?1:Lt>0?-1:1}if(B<lt)return-1;if(B>lt)return 1;if(I<P){var $t=R.comparePoint(b.rightSE.point);if($t!==0)return $t}if(I>P){var Et=b.comparePoint(R.rightSE.point);if(Et<0)return 1;if(Et>0)return-1}if(I!==P){var oe=ct-B,jt=I-W,Ht=Q-lt,Ot=P-J;if(oe>jt&&Ht<Ot)return 1;if(oe<jt&&Ht>Ot)return-1}return I>P?1:I<P||ct<Q?-1:ct>Q?1:b.id<R.id?-1:b.id>R.id?1:0}}]);function $(N,b,R,W){r(this,$),this.id=++ot,this.leftSE=N,N.segment=this,N.otherSE=b,this.rightSE=b,b.segment=this,b.otherSE=N,this.rings=R,this.windings=W}return e($,[{key:"replaceRightSE",value:function(b){this.rightSE=b,this.rightSE.segment=this,this.rightSE.otherSE=this.leftSE,this.leftSE.otherSE=this.rightSE}},{key:"bbox",value:function(){var b=this.leftSE.point.y,R=this.rightSE.point.y;return{ll:{x:this.leftSE.point.x,y:b<R?b:R},ur:{x:this.rightSE.point.x,y:b>R?b:R}}}},{key:"vector",value:function(){return{x:this.rightSE.point.x-this.leftSE.point.x,y:this.rightSE.point.y-this.leftSE.point.y}}},{key:"isAnEndpoint",value:function(b){return b.x===this.leftSE.point.x&&b.y===this.leftSE.point.y||b.x===this.rightSE.point.x&&b.y===this.rightSE.point.y}},{key:"comparePoint",value:function(b){if(this.isAnEndpoint(b))return 0;var R=this.leftSE.point,W=this.rightSE.point,J=this.vector();if(R.x===W.x)return b.x===R.x?0:b.x<R.x?1:-1;var I=(b.y-R.y)/J.y,P=R.x+I*J.x;if(b.x===P)return 0;var B=(b.x-R.x)/J.x,lt=R.y+B*J.y;return b.y===lt?0:b.y<lt?-1:1}},{key:"getIntersection",value:function(b){var R=this.bbox(),W=b.bbox(),J=C(R,W);if(J===null)return null;var I=this.leftSE.point,P=this.rightSE.point,B=b.leftSE.point,lt=b.rightSE.point,ct=v(R,B)&&this.comparePoint(B)===0,Q=v(W,I)&&b.comparePoint(I)===0,St=v(R,lt)&&this.comparePoint(lt)===0,_t=v(W,P)&&b.comparePoint(P)===0;if(Q&&ct)return _t&&!St?P:!_t&&St?lt:null;if(Q)return St&&I.x===lt.x&&I.y===lt.y?null:I;if(ct)return _t&&P.x===B.x&&P.y===B.y?null:B;if(_t&&St)return null;if(_t)return P;if(St)return lt;var Mt=pt(I,this.vector(),B,b.vector());return Mt===null||!v(J,Mt)?null:L.round(Mt.x,Mt.y)}},{key:"split",value:function(b){var R=[],W=b.events!==void 0,J=new et(b,!0),I=new et(b,!1),P=this.rightSE;this.replaceRightSE(I),R.push(I),R.push(J);var B=new $(J,P,this.rings.slice(),this.windings.slice());return et.comparePoints(B.leftSE.point,B.rightSE.point)>0&&B.swapEvents(),et.comparePoints(this.leftSE.point,this.rightSE.point)>0&&this.swapEvents(),W&&(J.checkForConsuming(),I.checkForConsuming()),R}},{key:"swapEvents",value:function(){var b=this.rightSE;this.rightSE=this.leftSE,this.leftSE=b,this.leftSE.isLeft=!0,this.rightSE.isLeft=!1;for(var R=0,W=this.windings.length;R<W;R++)this.windings[R]*=-1}},{key:"consume",value:function(b){for(var R=this,W=b;R.consumedBy;)R=R.consumedBy;for(;W.consumedBy;)W=W.consumedBy;var J=$.compare(R,W);if(J!==0){if(J>0){var I=R;R=W,W=I}if(R.prev===W){var P=R;R=W,W=P}for(var B=0,lt=W.rings.length;B<lt;B++){var ct=W.rings[B],Q=W.windings[B],St=R.rings.indexOf(ct);St===-1?(R.rings.push(ct),R.windings.push(Q)):R.windings[St]+=Q}W.rings=null,W.windings=null,W.consumedBy=R,W.leftSE.consumedBy=R.leftSE,W.rightSE.consumedBy=R.rightSE}}},{key:"prevInResult",value:function(){return this._prevInResult!==void 0?this._prevInResult:(this.prev?this.prev.isInResult()?this._prevInResult=this.prev:this._prevInResult=this.prev.prevInResult():this._prevInResult=null,this._prevInResult)}},{key:"beforeState",value:function(){if(this._beforeState!==void 0)return this._beforeState;if(!this.prev)this._beforeState={rings:[],windings:[],multiPolys:[]};else{var b=this.prev.consumedBy||this.prev;this._beforeState=b.afterState()}return this._beforeState}},{key:"afterState",value:function(){if(this._afterState!==void 0)return this._afterState;var b=this.beforeState();this._afterState={rings:b.rings.slice(0),windings:b.windings.slice(0),multiPolys:[]};for(var R=this._afterState.rings,W=this._afterState.windings,J=this._afterState.multiPolys,I=0,P=this.rings.length;I<P;I++){var B=this.rings[I],lt=this.windings[I],ct=R.indexOf(B);ct===-1?(R.push(B),W.push(lt)):W[ct]+=lt}for(var Q=[],St=[],_t=0,Mt=R.length;_t<Mt;_t++)if(W[_t]!==0){var Lt=R[_t],$t=Lt.poly;if(St.indexOf($t)===-1)if(Lt.isExterior)Q.push($t);else{St.indexOf($t)===-1&&St.push($t);var Et=Q.indexOf(Lt.poly);Et!==-1&&Q.splice(Et,1)}}for(var oe=0,jt=Q.length;oe<jt;oe++){var Ht=Q[oe].multiPoly;J.indexOf(Ht)===-1&&J.push(Ht)}return this._afterState}},{key:"isInResult",value:function(){if(this.consumedBy)return!1;if(this._isInResult!==void 0)return this._isInResult;var b=this.beforeState().multiPolys,R=this.afterState().multiPolys;switch(Xt.type){case"union":{var W=b.length===0,J=R.length===0;this._isInResult=W!==J;break}case"intersection":{var I,P;b.length<R.length?(I=b.length,P=R.length):(I=R.length,P=b.length),this._isInResult=P===Xt.numMultiPolys&&I<P;break}case"xor":{var B=Math.abs(b.length-R.length);this._isInResult=B%2===1;break}case"difference":{var lt=function(Q){return Q.length===1&&Q[0].isSubject};this._isInResult=lt(b)!==lt(R);break}default:throw new Error("Unrecognized operation type found ".concat(Xt.type))}return this._isInResult}}],[{key:"fromRing",value:function(b,R,W){var J,I,P,B=et.comparePoints(b,R);if(B<0)J=b,I=R,P=1;else if(B>0)J=R,I=b,P=-1;else throw new Error("Tried to create degenerate segment at [".concat(b.x,", ").concat(b.y,"]"));var lt=new et(J,!0),ct=new et(I,!1);return new $(lt,ct,[W],[P])}}]),$}(),K=function(){function $(N,b,R){if(r(this,$),!Array.isArray(N)||N.length===0)throw new Error("Input geometry is not a valid Polygon or MultiPolygon");if(this.poly=b,this.isExterior=R,this.segments=[],typeof N[0][0]!="number"||typeof N[0][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");var W=L.round(N[0][0],N[0][1]);this.bbox={ll:{x:W.x,y:W.y},ur:{x:W.x,y:W.y}};for(var J=W,I=1,P=N.length;I<P;I++){if(typeof N[I][0]!="number"||typeof N[I][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");var B=L.round(N[I][0],N[I][1]);B.x===J.x&&B.y===J.y||(this.segments.push(V.fromRing(J,B,this)),B.x<this.bbox.ll.x&&(this.bbox.ll.x=B.x),B.y<this.bbox.ll.y&&(this.bbox.ll.y=B.y),B.x>this.bbox.ur.x&&(this.bbox.ur.x=B.x),B.y>this.bbox.ur.y&&(this.bbox.ur.y=B.y),J=B)}(W.x!==J.x||W.y!==J.y)&&this.segments.push(V.fromRing(J,W,this))}return e($,[{key:"getSweepEvents",value:function(){for(var b=[],R=0,W=this.segments.length;R<W;R++){var J=this.segments[R];b.push(J.leftSE),b.push(J.rightSE)}return b}}]),$}(),at=function(){function $(N,b){if(r(this,$),!Array.isArray(N))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");this.exteriorRing=new K(N[0],this,!0),this.bbox={ll:{x:this.exteriorRing.bbox.ll.x,y:this.exteriorRing.bbox.ll.y},ur:{x:this.exteriorRing.bbox.ur.x,y:this.exteriorRing.bbox.ur.y}},this.interiorRings=[];for(var R=1,W=N.length;R<W;R++){var J=new K(N[R],this,!1);J.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=J.bbox.ll.x),J.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=J.bbox.ll.y),J.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=J.bbox.ur.x),J.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=J.bbox.ur.y),this.interiorRings.push(J)}this.multiPoly=b}return e($,[{key:"getSweepEvents",value:function(){for(var b=this.exteriorRing.getSweepEvents(),R=0,W=this.interiorRings.length;R<W;R++)for(var J=this.interiorRings[R].getSweepEvents(),I=0,P=J.length;I<P;I++)b.push(J[I]);return b}}]),$}(),Tt=function(){function $(N,b){if(r(this,$),!Array.isArray(N))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");try{typeof N[0][0][0]=="number"&&(N=[N])}catch(I){}this.polys=[],this.bbox={ll:{x:Number.POSITIVE_INFINITY,y:Number.POSITIVE_INFINITY},ur:{x:Number.NEGATIVE_INFINITY,y:Number.NEGATIVE_INFINITY}};for(var R=0,W=N.length;R<W;R++){var J=new at(N[R],this);J.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=J.bbox.ll.x),J.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=J.bbox.ll.y),J.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=J.bbox.ur.x),J.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=J.bbox.ur.y),this.polys.push(J)}this.isSubject=b}return e($,[{key:"getSweepEvents",value:function(){for(var b=[],R=0,W=this.polys.length;R<W;R++)for(var J=this.polys[R].getSweepEvents(),I=0,P=J.length;I<P;I++)b.push(J[I]);return b}}]),$}(),dt=function(){e($,null,[{key:"factory",value:function(b){for(var R=[],W=0,J=b.length;W<J;W++){var I=b[W];if(!(!I.isInResult()||I.ringOut)){for(var P=null,B=I.leftSE,lt=I.rightSE,ct=[B],Q=B.point,St=[];P=B,B=lt,ct.push(B),B.point!==Q;)for(;;){var _t=B.getAvailableLinkedEvents();if(_t.length===0){var Mt=ct[0].point,Lt=ct[ct.length-1].point;throw new Error("Unable to complete output ring starting at [".concat(Mt.x,",")+" ".concat(Mt.y,"]. Last matching segment found ends at")+" [".concat(Lt.x,", ").concat(Lt.y,"]."))}if(_t.length===1){lt=_t[0].otherSE;break}for(var $t=null,Et=0,oe=St.length;Et<oe;Et++)if(St[Et].point===B.point){$t=Et;break}if($t!==null){var jt=St.splice($t)[0],Ht=ct.splice(jt.index);Ht.unshift(Ht[0].otherSE),R.push(new $(Ht.reverse()));continue}St.push({index:ct.length,point:B.point});var Ot=B.getLeftmostComparator(P);lt=_t.sort(Ot)[0].otherSE;break}R.push(new $(ct))}}return R}}]);function $(N){r(this,$),this.events=N;for(var b=0,R=N.length;b<R;b++)N[b].segment.ringOut=this;this.poly=null}return e($,[{key:"getGeom",value:function(){for(var b=this.events[0].point,R=[b],W=1,J=this.events.length-1;W<J;W++){var I=this.events[W].point,P=this.events[W+1].point;nt(I,b,P)!==0&&(R.push(I),b=I)}if(R.length===1)return null;var B=R[0],lt=R[1];nt(B,b,lt)===0&&R.shift(),R.push(R[0]);for(var ct=this.isExteriorRing()?1:-1,Q=this.isExteriorRing()?0:R.length-1,St=this.isExteriorRing()?R.length:-1,_t=[],Mt=Q;Mt!=St;Mt+=ct)_t.push([R[Mt].x,R[Mt].y]);return _t}},{key:"isExteriorRing",value:function(){if(this._isExteriorRing===void 0){var b=this.enclosingRing();this._isExteriorRing=b?!b.isExteriorRing():!0}return this._isExteriorRing}},{key:"enclosingRing",value:function(){return this._enclosingRing===void 0&&(this._enclosingRing=this._calcEnclosingRing()),this._enclosingRing}},{key:"_calcEnclosingRing",value:function(){for(var b=this.events[0],R=1,W=this.events.length;R<W;R++){var J=this.events[R];et.compare(b,J)>0&&(b=J)}for(var I=b.segment.prevInResult(),P=I?I.prevInResult():null;;){if(!I)return null;if(!P)return I.ringOut;if(P.ringOut!==I.ringOut)return P.ringOut.enclosingRing()!==I.ringOut?I.ringOut:I.ringOut.enclosingRing();I=P.prevInResult(),P=I?I.prevInResult():null}}}]),$}(),Ct=function(){function $(N){r(this,$),this.exteriorRing=N,N.poly=this,this.interiorRings=[]}return e($,[{key:"addInterior",value:function(b){this.interiorRings.push(b),b.poly=this}},{key:"getGeom",value:function(){var b=[this.exteriorRing.getGeom()];if(b[0]===null)return null;for(var R=0,W=this.interiorRings.length;R<W;R++){var J=this.interiorRings[R].getGeom();J!==null&&b.push(J)}return b}}]),$}(),Yt=function(){function $(N){r(this,$),this.rings=N,this.polys=this._composePolys(N)}return e($,[{key:"getGeom",value:function(){for(var b=[],R=0,W=this.polys.length;R<W;R++){var J=this.polys[R].getGeom();J!==null&&b.push(J)}return b}},{key:"_composePolys",value:function(b){for(var R=[],W=0,J=b.length;W<J;W++){var I=b[W];if(!I.poly)if(I.isExteriorRing())R.push(new Ct(I));else{var P=I.enclosingRing();P.poly||R.push(new Ct(P)),P.poly.addInterior(I)}}return R}}]),$}(),Wt=function(){function $(N){var b=arguments.length>1&&arguments[1]!==void 0?arguments[1]:V.compare;r(this,$),this.queue=N,this.tree=new g(b),this.segments=[]}return e($,[{key:"process",value:function(b){var R=b.segment,W=[];if(b.consumedBy)return b.isLeft?this.queue.remove(b.otherSE):this.tree.remove(R),W;var J=b.isLeft?this.tree.insert(R):this.tree.find(R);if(!J)throw new Error("Unable to find segment #".concat(R.id," ")+"[".concat(R.leftSE.point.x,", ").concat(R.leftSE.point.y,"] -> ")+"[".concat(R.rightSE.point.x,", ").concat(R.rightSE.point.y,"] ")+"in SweepLine tree. Please submit a bug report.");for(var I=J,P=J,B=void 0,lt=void 0;B===void 0;)I=this.tree.prev(I),I===null?B=null:I.key.consumedBy===void 0&&(B=I.key);for(;lt===void 0;)P=this.tree.next(P),P===null?lt=null:P.key.consumedBy===void 0&&(lt=P.key);if(b.isLeft){var ct=null;if(B){var Q=B.getIntersection(R);if(Q!==null&&(R.isAnEndpoint(Q)||(ct=Q),!B.isAnEndpoint(Q)))for(var St=this._splitSafely(B,Q),_t=0,Mt=St.length;_t<Mt;_t++)W.push(St[_t])}var Lt=null;if(lt){var $t=lt.getIntersection(R);if($t!==null&&(R.isAnEndpoint($t)||(Lt=$t),!lt.isAnEndpoint($t)))for(var Et=this._splitSafely(lt,$t),oe=0,jt=Et.length;oe<jt;oe++)W.push(Et[oe])}if(ct!==null||Lt!==null){var Ht=null;if(ct===null)Ht=Lt;else if(Lt===null)Ht=ct;else{var Ot=et.comparePoints(ct,Lt);Ht=Ot<=0?ct:Lt}this.queue.remove(R.rightSE),W.push(R.rightSE);for(var Y=R.split(Ht),wt=0,j=Y.length;wt<j;wt++)W.push(Y[wt])}W.length>0?(this.tree.remove(R),W.push(b)):(this.segments.push(R),R.prev=B)}else{if(B&<){var Ut=B.getIntersection(lt);if(Ut!==null){if(!B.isAnEndpoint(Ut))for(var Dt=this._splitSafely(B,Ut),ft=0,Kt=Dt.length;ft<Kt;ft++)W.push(Dt[ft]);if(!lt.isAnEndpoint(Ut))for(var re=this._splitSafely(lt,Ut),mn=0,He=re.length;mn<He;mn++)W.push(re[mn])}}this.tree.remove(R)}return W}},{key:"_splitSafely",value:function(b,R){this.tree.remove(b);var W=b.rightSE;this.queue.remove(W);var J=b.split(R);return J.push(W),b.consumedBy===void 0&&this.tree.insert(b),J}}]),$}(),Nt=typeof process!="undefined"&&process.env.POLYGON_CLIPPING_MAX_QUEUE_SIZE||1e6,ne=typeof process!="undefined"&&process.env.POLYGON_CLIPPING_MAX_SWEEPLINE_SEGMENTS||1e6,Pt=function(){function $(){r(this,$)}return e($,[{key:"run",value:function(b,R,W){Xt.type=b,L.reset();for(var J=[new Tt(R,!0)],I=0,P=W.length;I<P;I++)J.push(new Tt(W[I],!1));if(Xt.numMultiPolys=J.length,Xt.type==="difference")for(var B=J[0],lt=1;lt<J.length;)C(J[lt].bbox,B.bbox)!==null?lt++:J.splice(lt,1);if(Xt.type==="intersection"){for(var ct=0,Q=J.length;ct<Q;ct++)for(var St=J[ct],_t=ct+1,Mt=J.length;_t<Mt;_t++)if(C(St.bbox,J[_t].bbox)===null)return[]}for(var Lt=new g(et.compare),$t=0,Et=J.length;$t<Et;$t++)for(var oe=J[$t].getSweepEvents(),jt=0,Ht=oe.length;jt<Ht;jt++)if(Lt.insert(oe[jt]),Lt.size>Nt)throw new Error("Infinite loop when putting segment endpoints in a priority queue (queue size too big). Please file a bug report.");for(var Ot=new Wt(Lt),Y=Lt.size,wt=Lt.pop();wt;){var j=wt.key;if(Lt.size===Y){var Ut=j.segment;throw new Error("Unable to pop() ".concat(j.isLeft?"left":"right"," SweepEvent ")+"[".concat(j.point.x,", ").concat(j.point.y,"] from segment #").concat(Ut.id," ")+"[".concat(Ut.leftSE.point.x,", ").concat(Ut.leftSE.point.y,"] -> ")+"[".concat(Ut.rightSE.point.x,", ").concat(Ut.rightSE.point.y,"] from queue. ")+"Please file a bug report.")}if(Lt.size>Nt)throw new Error("Infinite loop when passing sweep line over endpoints (queue size too big). Please file a bug report.");if(Ot.segments.length>ne)throw new Error("Infinite loop when passing sweep line over endpoints (too many sweep line segments). Please file a bug report.");for(var Dt=Ot.process(j),ft=0,Kt=Dt.length;ft<Kt;ft++){var re=Dt[ft];re.consumedBy===void 0&&Lt.insert(re)}Y=Lt.size,wt=Lt.pop()}L.reset();var mn=dt.factory(Ot.segments),He=new Yt(mn);return He.getGeom()}}]),$}(),Xt=new Pt,tt=function(N){for(var b=arguments.length,R=new Array(b>1?b-1:0),W=1;W<b;W++)R[W-1]=arguments[W];return Xt.run("union",N,R)},nn=function(N){for(var b=arguments.length,R=new Array(b>1?b-1:0),W=1;W<b;W++)R[W-1]=arguments[W];return Xt.run("intersection",N,R)},Gt=function(N){for(var b=arguments.length,R=new Array(b>1?b-1:0),W=1;W<b;W++)R[W-1]=arguments[W];return Xt.run("xor",N,R)},te=function(N){for(var b=arguments.length,R=new Array(b>1?b-1:0),W=1;W<b;W++)R[W-1]=arguments[W];return Xt.run("difference",N,R)},qt={union:tt,intersection:nn,xor:Gt,difference:te};return qt})});var Y_=Jt((af,X_)=>{(function(r,t){typeof af=="object"&&typeof X_!="undefined"?t(af):typeof define=="function"&&define.amd?define(["exports"],t):t(r.jsts={})})(af,function(r){"use strict";function t(){}function e(n){this.message=n||""}function o(n){this.message=n||""}function a(n){this.message=n||""}function l(){}function f(n){return n===null?hi:n.color}function h(n){return n===null?null:n.parent}function p(n,i){n!==null&&(n.color=i)}function d(n){return n===null?null:n.left}function g(n){return n===null?null:n.right}function _(){this.root_=null,this.size_=0}function y(){}function M(){this.array_=[],arguments[0]instanceof Ot&&this.addAll(arguments[0])}function w(){}function T(n){this.message=n||""}function x(){this.array_=[]}"fill"in Array.prototype||Object.defineProperty(Array.prototype,"fill",{configurable:!0,value:function(n){if(this===void 0||this===null)throw new TypeError(this+" is not an object");var i=Object(this),s=Math.max(Math.min(i.length,9007199254740991),0)||0,u=1 in arguments&&parseInt(Number(arguments[1]),10)||0;u=u<0?Math.max(s+u,0):Math.min(u,s);var c=2 in arguments&&arguments[2]!==void 0?parseInt(Number(arguments[2]),10)||0:s;for(c=c<0?Math.max(s+arguments[2],0):Math.min(c,s);u<c;)i[u]=n,++u;return i},writable:!0}),Number.isFinite=Number.isFinite||function(n){return typeof n=="number"&&isFinite(n)},Number.isInteger=Number.isInteger||function(n){return typeof n=="number"&&isFinite(n)&&Math.floor(n)===n},Number.parseFloat=Number.parseFloat||parseFloat,Number.isNaN=Number.isNaN||function(n){return n!=n},Math.trunc=Math.trunc||function(n){return n<0?Math.ceil(n):Math.floor(n)};var v=function(){};v.prototype.interfaces_=function(){return[]},v.prototype.getClass=function(){return v},v.prototype.equalsWithTolerance=function(n,i,s){return Math.abs(n-i)<=s};var C=function(n){function i(s){n.call(this,s),this.name="IllegalArgumentException",this.message=s,this.stack=new n().stack}return n&&(i.__proto__=n),i.prototype=Object.create(n&&n.prototype),i.prototype.constructor=i,i}(Error),S=function(){},O={MAX_VALUE:{configurable:!0}};S.isNaN=function(n){return Number.isNaN(n)},S.doubleToLongBits=function(n){return n},S.longBitsToDouble=function(n){return n},S.isInfinite=function(n){return!Number.isFinite(n)},O.MAX_VALUE.get=function(){return Number.MAX_VALUE},Object.defineProperties(S,O);var F=function(){},G=function(){},z=function(){},L=function n(){if(this.x=null,this.y=null,this.z=null,arguments.length===0)this.x=0,this.y=0,this.z=n.NULL_ORDINATE;else if(arguments.length===1){var i=arguments[0];this.x=i.x,this.y=i.y,this.z=i.z}else arguments.length===2?(this.x=arguments[0],this.y=arguments[1],this.z=n.NULL_ORDINATE):arguments.length===3&&(this.x=arguments[0],this.y=arguments[1],this.z=arguments[2])},D={DimensionalComparator:{configurable:!0},serialVersionUID:{configurable:!0},NULL_ORDINATE:{configurable:!0},X:{configurable:!0},Y:{configurable:!0},Z:{configurable:!0}};L.prototype.setOrdinate=function(n,i){switch(n){case L.X:this.x=i;break;case L.Y:this.y=i;break;case L.Z:this.z=i;break;default:throw new C("Invalid ordinate index: "+n)}},L.prototype.equals2D=function(){if(arguments.length===1){var n=arguments[0];return this.x===n.x&&this.y===n.y}if(arguments.length===2){var i=arguments[0],s=arguments[1];return!!v.equalsWithTolerance(this.x,i.x,s)&&!!v.equalsWithTolerance(this.y,i.y,s)}},L.prototype.getOrdinate=function(n){switch(n){case L.X:return this.x;case L.Y:return this.y;case L.Z:return this.z}throw new C("Invalid ordinate index: "+n)},L.prototype.equals3D=function(n){return this.x===n.x&&this.y===n.y&&(this.z===n.z||S.isNaN(this.z))&&S.isNaN(n.z)},L.prototype.equals=function(n){return n instanceof L&&this.equals2D(n)},L.prototype.equalInZ=function(n,i){return v.equalsWithTolerance(this.z,n.z,i)},L.prototype.compareTo=function(n){var i=n;return this.x<i.x?-1:this.x>i.x?1:this.y<i.y?-1:this.y>i.y?1:0},L.prototype.clone=function(){},L.prototype.copy=function(){return new L(this)},L.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},L.prototype.distance3D=function(n){var i=this.x-n.x,s=this.y-n.y,u=this.z-n.z;return Math.sqrt(i*i+s*s+u*u)},L.prototype.distance=function(n){var i=this.x-n.x,s=this.y-n.y;return Math.sqrt(i*i+s*s)},L.prototype.hashCode=function(){var n=17;return n=37*n+L.hashCode(this.x),n=37*n+L.hashCode(this.y)},L.prototype.setCoordinate=function(n){this.x=n.x,this.y=n.y,this.z=n.z},L.prototype.interfaces_=function(){return[F,G,t]},L.prototype.getClass=function(){return L},L.hashCode=function(){if(arguments.length===1){var n=arguments[0],i=S.doubleToLongBits(n);return Math.trunc((i^i)>>>32)}},D.DimensionalComparator.get=function(){return q},D.serialVersionUID.get=function(){return 6683108902428367e3},D.NULL_ORDINATE.get=function(){return S.NaN},D.X.get=function(){return 0},D.Y.get=function(){return 1},D.Z.get=function(){return 2},Object.defineProperties(L,D);var q=function(n){if(this._dimensionsToTest=2,arguments.length!==0){if(arguments.length===1){var i=arguments[0];if(i!==2&&i!==3)throw new C("only 2 or 3 dimensions may be specified");this._dimensionsToTest=i}}};q.prototype.compare=function(n,i){var s=n,u=i,c=q.compare(s.x,u.x);if(c!==0)return c;var m=q.compare(s.y,u.y);return m!==0?m:this._dimensionsToTest<=2?0:q.compare(s.z,u.z)},q.prototype.interfaces_=function(){return[z]},q.prototype.getClass=function(){return q},q.compare=function(n,i){return n<i?-1:n>i?1:S.isNaN(n)?S.isNaN(i)?0:-1:S.isNaN(i)?1:0};var nt=function(){};nt.prototype.create=function(){},nt.prototype.interfaces_=function(){return[]},nt.prototype.getClass=function(){return nt};var k=function(){},xt={INTERIOR:{configurable:!0},BOUNDARY:{configurable:!0},EXTERIOR:{configurable:!0},NONE:{configurable:!0}};k.prototype.interfaces_=function(){return[]},k.prototype.getClass=function(){return k},k.toLocationSymbol=function(n){switch(n){case k.EXTERIOR:return"e";case k.BOUNDARY:return"b";case k.INTERIOR:return"i";case k.NONE:return"-"}throw new C("Unknown location value: "+n)},xt.INTERIOR.get=function(){return 0},xt.BOUNDARY.get=function(){return 1},xt.EXTERIOR.get=function(){return 2},xt.NONE.get=function(){return-1},Object.defineProperties(k,xt);var X=function(n,i){return n.interfaces_&&n.interfaces_().indexOf(i)>-1},it=function(){},vt={LOG_10:{configurable:!0}};it.prototype.interfaces_=function(){return[]},it.prototype.getClass=function(){return it},it.log10=function(n){var i=Math.log(n);return S.isInfinite(i)||S.isNaN(i)?i:i/it.LOG_10},it.min=function(n,i,s,u){var c=n;return i<c&&(c=i),s<c&&(c=s),u<c&&(c=u),c},it.clamp=function(){if(typeof arguments[2]=="number"&&typeof arguments[0]=="number"&&typeof arguments[1]=="number"){var n=arguments[0],i=arguments[1],s=arguments[2];return n<i?i:n>s?s:n}if(Number.isInteger(arguments[2])&&Number.isInteger(arguments[0])&&Number.isInteger(arguments[1])){var u=arguments[0],c=arguments[1],m=arguments[2];return u<c?c:u>m?m:u}},it.wrap=function(n,i){return n<0?i- -n%i:n%i},it.max=function(){if(arguments.length===3){var n=arguments[0],i=arguments[1],s=arguments[2],u=n;return i>u&&(u=i),s>u&&(u=s),u}if(arguments.length===4){var c=arguments[0],m=arguments[1],E=arguments[2],A=arguments[3],U=c;return m>U&&(U=m),E>U&&(U=E),A>U&&(U=A),U}},it.average=function(n,i){return(n+i)/2},vt.LOG_10.get=function(){return Math.log(10)},Object.defineProperties(it,vt);var pt=function(n){this.str=n};pt.prototype.append=function(n){this.str+=n},pt.prototype.setCharAt=function(n,i){this.str=this.str.substr(0,n)+i+this.str.substr(n+1)},pt.prototype.toString=function(n){return this.str};var et=function(n){this.value=n};et.prototype.intValue=function(){return this.value},et.prototype.compareTo=function(n){return this.value<n?-1:this.value>n?1:0},et.isNaN=function(n){return Number.isNaN(n)};var ot=function(){};ot.isWhitespace=function(n){return n<=32&&n>=0||n===127},ot.toUpperCase=function(n){return n.toUpperCase()};var V=function n(){if(this._hi=0,this._lo=0,arguments.length===0)this.init(0);else if(arguments.length===1){if(typeof arguments[0]=="number"){var i=arguments[0];this.init(i)}else if(arguments[0]instanceof n){var s=arguments[0];this.init(s)}else if(typeof arguments[0]=="string"){var u=arguments[0];n.call(this,n.parse(u))}}else if(arguments.length===2){var c=arguments[0],m=arguments[1];this.init(c,m)}},K={PI:{configurable:!0},TWO_PI:{configurable:!0},PI_2:{configurable:!0},E:{configurable:!0},NaN:{configurable:!0},EPS:{configurable:!0},SPLIT:{configurable:!0},MAX_PRINT_DIGITS:{configurable:!0},TEN:{configurable:!0},ONE:{configurable:!0},SCI_NOT_EXPONENT_CHAR:{configurable:!0},SCI_NOT_ZERO:{configurable:!0}};V.prototype.le=function(n){return(this._hi<n._hi||this._hi===n._hi)&&this._lo<=n._lo},V.prototype.extractSignificantDigits=function(n,i){var s=this.abs(),u=V.magnitude(s._hi),c=V.TEN.pow(u);(s=s.divide(c)).gt(V.TEN)?(s=s.divide(V.TEN),u+=1):s.lt(V.ONE)&&(s=s.multiply(V.TEN),u-=1);for(var m=u+1,E=new pt,A=V.MAX_PRINT_DIGITS-1,U=0;U<=A;U++){n&&U===m&&E.append(".");var Z=Math.trunc(s._hi);if(Z<0)break;var ut=!1,ht=0;Z>9?(ut=!0,ht="9"):ht="0"+Z,E.append(ht),s=s.subtract(V.valueOf(Z)).multiply(V.TEN),ut&&s.selfAdd(V.TEN);var At=!0,Rt=V.magnitude(s._hi);if(Rt<0&&Math.abs(Rt)>=A-U&&(At=!1),!At)break}return i[0]=u,E.toString()},V.prototype.sqr=function(){return this.multiply(this)},V.prototype.doubleValue=function(){return this._hi+this._lo},V.prototype.subtract=function(){if(arguments[0]instanceof V){var n=arguments[0];return this.add(n.negate())}if(typeof arguments[0]=="number"){var i=arguments[0];return this.add(-i)}},V.prototype.equals=function(){if(arguments.length===1){var n=arguments[0];return this._hi===n._hi&&this._lo===n._lo}},V.prototype.isZero=function(){return this._hi===0&&this._lo===0},V.prototype.selfSubtract=function(){if(arguments[0]instanceof V){var n=arguments[0];return this.isNaN()?this:this.selfAdd(-n._hi,-n._lo)}if(typeof arguments[0]=="number"){var i=arguments[0];return this.isNaN()?this:this.selfAdd(-i,0)}},V.prototype.getSpecialNumberString=function(){return this.isZero()?"0.0":this.isNaN()?"NaN ":null},V.prototype.min=function(n){return this.le(n)?this:n},V.prototype.selfDivide=function(){if(arguments.length===1){if(arguments[0]instanceof V){var n=arguments[0];return this.selfDivide(n._hi,n._lo)}if(typeof arguments[0]=="number"){var i=arguments[0];return this.selfDivide(i,0)}}else if(arguments.length===2){var s=arguments[0],u=arguments[1],c=null,m=null,E=null,A=null,U=null,Z=null,ut=null,ht=null;return U=this._hi/s,Z=V.SPLIT*U,c=Z-U,ht=V.SPLIT*s,c=Z-c,m=U-c,E=ht-s,ut=U*s,E=ht-E,A=s-E,ht=c*E-ut+c*A+m*E+m*A,Z=(this._hi-ut-ht+this._lo-U*u)/s,ht=U+Z,this._hi=ht,this._lo=U-ht+Z,this}},V.prototype.dump=function(){return"DD<"+this._hi+", "+this._lo+">"},V.prototype.divide=function(){if(arguments[0]instanceof V){var n=arguments[0],i=null,s=null,u=null,c=null,m=null,E=null,A=null,U=null;return s=(m=this._hi/n._hi)-(i=(E=V.SPLIT*m)-(i=E-m)),U=i*(u=(U=V.SPLIT*n._hi)-(u=U-n._hi))-(A=m*n._hi)+i*(c=n._hi-u)+s*u+s*c,E=(this._hi-A-U+this._lo-m*n._lo)/n._hi,new V(U=m+E,m-U+E)}if(typeof arguments[0]=="number"){var Z=arguments[0];return S.isNaN(Z)?V.createNaN():V.copy(this).selfDivide(Z,0)}},V.prototype.ge=function(n){return(this._hi>n._hi||this._hi===n._hi)&&this._lo>=n._lo},V.prototype.pow=function(n){if(n===0)return V.valueOf(1);var i=new V(this),s=V.valueOf(1),u=Math.abs(n);if(u>1)for(;u>0;)u%2==1&&s.selfMultiply(i),(u/=2)>0&&(i=i.sqr());else s=i;return n<0?s.reciprocal():s},V.prototype.ceil=function(){if(this.isNaN())return V.NaN;var n=Math.ceil(this._hi),i=0;return n===this._hi&&(i=Math.ceil(this._lo)),new V(n,i)},V.prototype.compareTo=function(n){var i=n;return this._hi<i._hi?-1:this._hi>i._hi?1:this._lo<i._lo?-1:this._lo>i._lo?1:0},V.prototype.rint=function(){return this.isNaN()?this:this.add(.5).floor()},V.prototype.setValue=function(){if(arguments[0]instanceof V){var n=arguments[0];return this.init(n),this}if(typeof arguments[0]=="number"){var i=arguments[0];return this.init(i),this}},V.prototype.max=function(n){return this.ge(n)?this:n},V.prototype.sqrt=function(){if(this.isZero())return V.valueOf(0);if(this.isNegative())return V.NaN;var n=1/Math.sqrt(this._hi),i=this._hi*n,s=V.valueOf(i),u=this.subtract(s.sqr())._hi*(.5*n);return s.add(u)},V.prototype.selfAdd=function(){if(arguments.length===1){if(arguments[0]instanceof V){var n=arguments[0];return this.selfAdd(n._hi,n._lo)}if(typeof arguments[0]=="number"){var i=arguments[0],s=null,u=null,c=null,m=null,E=null,A=null;return c=this._hi+i,E=c-this._hi,m=c-E,m=i-E+(this._hi-m),A=m+this._lo,s=c+A,u=A+(c-s),this._hi=s+u,this._lo=u+(s-this._hi),this}}else if(arguments.length===2){var U=arguments[0],Z=arguments[1],ut=null,ht=null,At=null,Rt=null,kt=null,ee=null,on=null;Rt=this._hi+U,ht=this._lo+Z,kt=Rt-(ee=Rt-this._hi),At=ht-(on=ht-this._lo);var In=(ut=Rt+(ee=(kt=U-ee+(this._hi-kt))+ht))+(ee=(At=Z-on+(this._lo-At))+(ee+(Rt-ut))),pr=ee+(ut-In);return this._hi=In,this._lo=pr,this}},V.prototype.selfMultiply=function(){if(arguments.length===1){if(arguments[0]instanceof V){var n=arguments[0];return this.selfMultiply(n._hi,n._lo)}if(typeof arguments[0]=="number"){var i=arguments[0];return this.selfMultiply(i,0)}}else if(arguments.length===2){var s=arguments[0],u=arguments[1],c=null,m=null,E=null,A=null,U=null,Z=null;c=(U=V.SPLIT*this._hi)-this._hi,Z=V.SPLIT*s,c=U-c,m=this._hi-c,E=Z-s;var ut=(U=this._hi*s)+(Z=c*(E=Z-E)-U+c*(A=s-E)+m*E+m*A+(this._hi*u+this._lo*s)),ht=Z+(c=U-ut);return this._hi=ut,this._lo=ht,this}},V.prototype.selfSqr=function(){return this.selfMultiply(this)},V.prototype.floor=function(){if(this.isNaN())return V.NaN;var n=Math.floor(this._hi),i=0;return n===this._hi&&(i=Math.floor(this._lo)),new V(n,i)},V.prototype.negate=function(){return this.isNaN()?this:new V(-this._hi,-this._lo)},V.prototype.clone=function(){},V.prototype.multiply=function(){if(arguments[0]instanceof V){var n=arguments[0];return n.isNaN()?V.createNaN():V.copy(this).selfMultiply(n)}if(typeof arguments[0]=="number"){var i=arguments[0];return S.isNaN(i)?V.createNaN():V.copy(this).selfMultiply(i,0)}},V.prototype.isNaN=function(){return S.isNaN(this._hi)},V.prototype.intValue=function(){return Math.trunc(this._hi)},V.prototype.toString=function(){var n=V.magnitude(this._hi);return n>=-3&&n<=20?this.toStandardNotation():this.toSciNotation()},V.prototype.toStandardNotation=function(){var n=this.getSpecialNumberString();if(n!==null)return n;var i=new Array(1).fill(null),s=this.extractSignificantDigits(!0,i),u=i[0]+1,c=s;if(s.charAt(0)===".")c="0"+s;else if(u<0)c="0."+V.stringOfChar("0",-u)+s;else if(s.indexOf(".")===-1){var m=u-s.length;c=s+V.stringOfChar("0",m)+".0"}return this.isNegative()?"-"+c:c},V.prototype.reciprocal=function(){var n=null,i=null,s=null,u=null,c=null,m=null,E=null,A=null;i=(c=1/this._hi)-(n=(m=V.SPLIT*c)-(n=m-c)),s=(A=V.SPLIT*this._hi)-this._hi;var U=c+(m=(1-(E=c*this._hi)-(A=n*(s=A-s)-E+n*(u=this._hi-s)+i*s+i*u)-c*this._lo)/this._hi);return new V(U,c-U+m)},V.prototype.toSciNotation=function(){if(this.isZero())return V.SCI_NOT_ZERO;var n=this.getSpecialNumberString();if(n!==null)return n;var i=new Array(1).fill(null),s=this.extractSignificantDigits(!1,i),u=V.SCI_NOT_EXPONENT_CHAR+i[0];if(s.charAt(0)==="0")throw new Error("Found leading zero: "+s);var c="";s.length>1&&(c=s.substring(1));var m=s.charAt(0)+"."+c;return this.isNegative()?"-"+m+u:m+u},V.prototype.abs=function(){return this.isNaN()?V.NaN:this.isNegative()?this.negate():new V(this)},V.prototype.isPositive=function(){return(this._hi>0||this._hi===0)&&this._lo>0},V.prototype.lt=function(n){return(this._hi<n._hi||this._hi===n._hi)&&this._lo<n._lo},V.prototype.add=function(){if(arguments[0]instanceof V){var n=arguments[0];return V.copy(this).selfAdd(n)}if(typeof arguments[0]=="number"){var i=arguments[0];return V.copy(this).selfAdd(i)}},V.prototype.init=function(){if(arguments.length===1){if(typeof arguments[0]=="number"){var n=arguments[0];this._hi=n,this._lo=0}else if(arguments[0]instanceof V){var i=arguments[0];this._hi=i._hi,this._lo=i._lo}}else if(arguments.length===2){var s=arguments[0],u=arguments[1];this._hi=s,this._lo=u}},V.prototype.gt=function(n){return(this._hi>n._hi||this._hi===n._hi)&&this._lo>n._lo},V.prototype.isNegative=function(){return(this._hi<0||this._hi===0)&&this._lo<0},V.prototype.trunc=function(){return this.isNaN()?V.NaN:this.isPositive()?this.floor():this.ceil()},V.prototype.signum=function(){return this._hi>0?1:this._hi<0?-1:this._lo>0?1:this._lo<0?-1:0},V.prototype.interfaces_=function(){return[t,F,G]},V.prototype.getClass=function(){return V},V.sqr=function(n){return V.valueOf(n).selfMultiply(n)},V.valueOf=function(){if(typeof arguments[0]=="string"){var n=arguments[0];return V.parse(n)}if(typeof arguments[0]=="number"){var i=arguments[0];return new V(i)}},V.sqrt=function(n){return V.valueOf(n).sqrt()},V.parse=function(n){for(var i=0,s=n.length;ot.isWhitespace(n.charAt(i));)i++;var u=!1;if(i<s){var c=n.charAt(i);c!=="-"&&c!=="+"||(i++,c==="-"&&(u=!0))}for(var m=new V,E=0,A=0,U=0;!(i>=s);){var Z=n.charAt(i);if(i++,ot.isDigit(Z)){var ut=Z-"0";m.selfMultiply(V.TEN),m.selfAdd(ut),E++}else{if(Z!=="."){if(Z==="e"||Z==="E"){var ht=n.substring(i);try{U=et.parseInt(ht)}catch(on){throw on instanceof Error?new Error("Invalid exponent "+ht+" in string "+n):on}break}throw new Error("Unexpected character '"+Z+"' at position "+i+" in string "+n)}A=E}}var At=m,Rt=E-A-U;if(Rt===0)At=m;else if(Rt>0){var kt=V.TEN.pow(Rt);At=m.divide(kt)}else if(Rt<0){var ee=V.TEN.pow(-Rt);At=m.multiply(ee)}return u?At.negate():At},V.createNaN=function(){return new V(S.NaN,S.NaN)},V.copy=function(n){return new V(n)},V.magnitude=function(n){var i=Math.abs(n),s=Math.log(i)/Math.log(10),u=Math.trunc(Math.floor(s));return 10*Math.pow(10,u)<=i&&(u+=1),u},V.stringOfChar=function(n,i){for(var s=new pt,u=0;u<i;u++)s.append(n);return s.toString()},K.PI.get=function(){return new V(3.141592653589793,12246467991473532e-32)},K.TWO_PI.get=function(){return new V(6.283185307179586,24492935982947064e-32)},K.PI_2.get=function(){return new V(1.5707963267948966,6123233995736766e-32)},K.E.get=function(){return new V(2.718281828459045,14456468917292502e-32)},K.NaN.get=function(){return new V(S.NaN,S.NaN)},K.EPS.get=function(){return 123259516440783e-46},K.SPLIT.get=function(){return 134217729},K.MAX_PRINT_DIGITS.get=function(){return 32},K.TEN.get=function(){return V.valueOf(10)},K.ONE.get=function(){return V.valueOf(1)},K.SCI_NOT_EXPONENT_CHAR.get=function(){return"E"},K.SCI_NOT_ZERO.get=function(){return"0.0E0"},Object.defineProperties(V,K);var at=function(){},Tt={DP_SAFE_EPSILON:{configurable:!0}};at.prototype.interfaces_=function(){return[]},at.prototype.getClass=function(){return at},at.orientationIndex=function(n,i,s){var u=at.orientationIndexFilter(n,i,s);if(u<=1)return u;var c=V.valueOf(i.x).selfAdd(-n.x),m=V.valueOf(i.y).selfAdd(-n.y),E=V.valueOf(s.x).selfAdd(-i.x),A=V.valueOf(s.y).selfAdd(-i.y);return c.selfMultiply(A).selfSubtract(m.selfMultiply(E)).signum()},at.signOfDet2x2=function(n,i,s,u){return n.multiply(u).selfSubtract(i.multiply(s)).signum()},at.intersection=function(n,i,s,u){var c=V.valueOf(u.y).selfSubtract(s.y).selfMultiply(V.valueOf(i.x).selfSubtract(n.x)),m=V.valueOf(u.x).selfSubtract(s.x).selfMultiply(V.valueOf(i.y).selfSubtract(n.y)),E=c.subtract(m),A=V.valueOf(u.x).selfSubtract(s.x).selfMultiply(V.valueOf(n.y).selfSubtract(s.y)),U=V.valueOf(u.y).selfSubtract(s.y).selfMultiply(V.valueOf(n.x).selfSubtract(s.x)),Z=A.subtract(U).selfDivide(E).doubleValue(),ut=V.valueOf(n.x).selfAdd(V.valueOf(i.x).selfSubtract(n.x).selfMultiply(Z)).doubleValue(),ht=V.valueOf(i.x).selfSubtract(n.x).selfMultiply(V.valueOf(n.y).selfSubtract(s.y)),At=V.valueOf(i.y).selfSubtract(n.y).selfMultiply(V.valueOf(n.x).selfSubtract(s.x)),Rt=ht.subtract(At).selfDivide(E).doubleValue(),kt=V.valueOf(s.y).selfAdd(V.valueOf(u.y).selfSubtract(s.y).selfMultiply(Rt)).doubleValue();return new L(ut,kt)},at.orientationIndexFilter=function(n,i,s){var u=null,c=(n.x-s.x)*(i.y-s.y),m=(n.y-s.y)*(i.x-s.x),E=c-m;if(c>0){if(m<=0)return at.signum(E);u=c+m}else{if(!(c<0)||m>=0)return at.signum(E);u=-c-m}var A=at.DP_SAFE_EPSILON*u;return E>=A||-E>=A?at.signum(E):2},at.signum=function(n){return n>0?1:n<0?-1:0},Tt.DP_SAFE_EPSILON.get=function(){return 1e-15},Object.defineProperties(at,Tt);var dt=function(){},Ct={X:{configurable:!0},Y:{configurable:!0},Z:{configurable:!0},M:{configurable:!0}};Ct.X.get=function(){return 0},Ct.Y.get=function(){return 1},Ct.Z.get=function(){return 2},Ct.M.get=function(){return 3},dt.prototype.setOrdinate=function(n,i,s){},dt.prototype.size=function(){},dt.prototype.getOrdinate=function(n,i){},dt.prototype.getCoordinate=function(){},dt.prototype.getCoordinateCopy=function(n){},dt.prototype.getDimension=function(){},dt.prototype.getX=function(n){},dt.prototype.clone=function(){},dt.prototype.expandEnvelope=function(n){},dt.prototype.copy=function(){},dt.prototype.getY=function(n){},dt.prototype.toCoordinateArray=function(){},dt.prototype.interfaces_=function(){return[G]},dt.prototype.getClass=function(){return dt},Object.defineProperties(dt,Ct);var Yt=function(){},Wt=function(n){function i(){n.call(this,"Projective point not representable on the Cartesian plane.")}return n&&(i.__proto__=n),i.prototype=Object.create(n&&n.prototype),i.prototype.constructor=i,i.prototype.interfaces_=function(){return[]},i.prototype.getClass=function(){return i},i}(Yt),Nt=function(){};Nt.arraycopy=function(n,i,s,u,c){for(var m=0,E=i;E<i+c;E++)s[u+m]=n[E],m++},Nt.getProperty=function(n){return{"line.separator":\`
|
|
3822
3822
|
\`}[n]};var ne=function n(){if(this.x=null,this.y=null,this.w=null,arguments.length===0)this.x=0,this.y=0,this.w=1;else if(arguments.length===1){var i=arguments[0];this.x=i.x,this.y=i.y,this.w=1}else if(arguments.length===2){if(typeof arguments[0]=="number"&&typeof arguments[1]=="number"){var s=arguments[0],u=arguments[1];this.x=s,this.y=u,this.w=1}else if(arguments[0]instanceof n&&arguments[1]instanceof n){var c=arguments[0],m=arguments[1];this.x=c.y*m.w-m.y*c.w,this.y=m.x*c.w-c.x*m.w,this.w=c.x*m.y-m.x*c.y}else if(arguments[0]instanceof L&&arguments[1]instanceof L){var E=arguments[0],A=arguments[1];this.x=E.y-A.y,this.y=A.x-E.x,this.w=E.x*A.y-A.x*E.y}}else if(arguments.length===3){var U=arguments[0],Z=arguments[1],ut=arguments[2];this.x=U,this.y=Z,this.w=ut}else if(arguments.length===4){var ht=arguments[0],At=arguments[1],Rt=arguments[2],kt=arguments[3],ee=ht.y-At.y,on=At.x-ht.x,In=ht.x*At.y-At.x*ht.y,pr=Rt.y-kt.y,Zi=kt.x-Rt.x,Do=Rt.x*kt.y-kt.x*Rt.y;this.x=on*Do-Zi*In,this.y=pr*In-ee*Do,this.w=ee*Zi-pr*on}};ne.prototype.getY=function(){var n=this.y/this.w;if(S.isNaN(n)||S.isInfinite(n))throw new Wt;return n},ne.prototype.getX=function(){var n=this.x/this.w;if(S.isNaN(n)||S.isInfinite(n))throw new Wt;return n},ne.prototype.getCoordinate=function(){var n=new L;return n.x=this.getX(),n.y=this.getY(),n},ne.prototype.interfaces_=function(){return[]},ne.prototype.getClass=function(){return ne},ne.intersection=function(n,i,s,u){var c=n.y-i.y,m=i.x-n.x,E=n.x*i.y-i.x*n.y,A=s.y-u.y,U=u.x-s.x,Z=s.x*u.y-u.x*s.y,ut=c*U-A*m,ht=(m*Z-U*E)/ut,At=(A*E-c*Z)/ut;if(S.isNaN(ht)||S.isInfinite(ht)||S.isNaN(At)||S.isInfinite(At))throw new Wt;return new L(ht,At)};var Pt=function n(){if(this._minx=null,this._maxx=null,this._miny=null,this._maxy=null,arguments.length===0)this.init();else if(arguments.length===1){if(arguments[0]instanceof L){var i=arguments[0];this.init(i.x,i.x,i.y,i.y)}else if(arguments[0]instanceof n){var s=arguments[0];this.init(s)}}else if(arguments.length===2){var u=arguments[0],c=arguments[1];this.init(u.x,c.x,u.y,c.y)}else if(arguments.length===4){var m=arguments[0],E=arguments[1],A=arguments[2],U=arguments[3];this.init(m,E,A,U)}},Xt={serialVersionUID:{configurable:!0}};Pt.prototype.getArea=function(){return this.getWidth()*this.getHeight()},Pt.prototype.equals=function(n){if(!(n instanceof Pt))return!1;var i=n;return this.isNull()?i.isNull():this._maxx===i.getMaxX()&&this._maxy===i.getMaxY()&&this._minx===i.getMinX()&&this._miny===i.getMinY()},Pt.prototype.intersection=function(n){if(this.isNull()||n.isNull()||!this.intersects(n))return new Pt;var i=this._minx>n._minx?this._minx:n._minx,s=this._miny>n._miny?this._miny:n._miny,u=this._maxx<n._maxx?this._maxx:n._maxx,c=this._maxy<n._maxy?this._maxy:n._maxy;return new Pt(i,u,s,c)},Pt.prototype.isNull=function(){return this._maxx<this._minx},Pt.prototype.getMaxX=function(){return this._maxx},Pt.prototype.covers=function(){if(arguments.length===1){if(arguments[0]instanceof L){var n=arguments[0];return this.covers(n.x,n.y)}if(arguments[0]instanceof Pt){var i=arguments[0];return!this.isNull()&&!i.isNull()&&i.getMinX()>=this._minx&&i.getMaxX()<=this._maxx&&i.getMinY()>=this._miny&&i.getMaxY()<=this._maxy}}else if(arguments.length===2){var s=arguments[0],u=arguments[1];return!this.isNull()&&s>=this._minx&&s<=this._maxx&&u>=this._miny&&u<=this._maxy}},Pt.prototype.intersects=function(){if(arguments.length===1){if(arguments[0]instanceof Pt){var n=arguments[0];return!this.isNull()&&!n.isNull()&&!(n._minx>this._maxx||n._maxx<this._minx||n._miny>this._maxy||n._maxy<this._miny)}if(arguments[0]instanceof L){var i=arguments[0];return this.intersects(i.x,i.y)}}else if(arguments.length===2){var s=arguments[0],u=arguments[1];return!this.isNull()&&!(s>this._maxx||s<this._minx||u>this._maxy||u<this._miny)}},Pt.prototype.getMinY=function(){return this._miny},Pt.prototype.getMinX=function(){return this._minx},Pt.prototype.expandToInclude=function(){if(arguments.length===1){if(arguments[0]instanceof L){var n=arguments[0];this.expandToInclude(n.x,n.y)}else if(arguments[0]instanceof Pt){var i=arguments[0];if(i.isNull())return null;this.isNull()?(this._minx=i.getMinX(),this._maxx=i.getMaxX(),this._miny=i.getMinY(),this._maxy=i.getMaxY()):(i._minx<this._minx&&(this._minx=i._minx),i._maxx>this._maxx&&(this._maxx=i._maxx),i._miny<this._miny&&(this._miny=i._miny),i._maxy>this._maxy&&(this._maxy=i._maxy))}}else if(arguments.length===2){var s=arguments[0],u=arguments[1];this.isNull()?(this._minx=s,this._maxx=s,this._miny=u,this._maxy=u):(s<this._minx&&(this._minx=s),s>this._maxx&&(this._maxx=s),u<this._miny&&(this._miny=u),u>this._maxy&&(this._maxy=u))}},Pt.prototype.minExtent=function(){if(this.isNull())return 0;var n=this.getWidth(),i=this.getHeight();return n<i?n:i},Pt.prototype.getWidth=function(){return this.isNull()?0:this._maxx-this._minx},Pt.prototype.compareTo=function(n){var i=n;return this.isNull()?i.isNull()?0:-1:i.isNull()?1:this._minx<i._minx?-1:this._minx>i._minx?1:this._miny<i._miny?-1:this._miny>i._miny?1:this._maxx<i._maxx?-1:this._maxx>i._maxx?1:this._maxy<i._maxy?-1:this._maxy>i._maxy?1:0},Pt.prototype.translate=function(n,i){if(this.isNull())return null;this.init(this.getMinX()+n,this.getMaxX()+n,this.getMinY()+i,this.getMaxY()+i)},Pt.prototype.toString=function(){return"Env["+this._minx+" : "+this._maxx+", "+this._miny+" : "+this._maxy+"]"},Pt.prototype.setToNull=function(){this._minx=0,this._maxx=-1,this._miny=0,this._maxy=-1},Pt.prototype.getHeight=function(){return this.isNull()?0:this._maxy-this._miny},Pt.prototype.maxExtent=function(){if(this.isNull())return 0;var n=this.getWidth(),i=this.getHeight();return n>i?n:i},Pt.prototype.expandBy=function(){if(arguments.length===1){var n=arguments[0];this.expandBy(n,n)}else if(arguments.length===2){var i=arguments[0],s=arguments[1];if(this.isNull())return null;this._minx-=i,this._maxx+=i,this._miny-=s,this._maxy+=s,(this._minx>this._maxx||this._miny>this._maxy)&&this.setToNull()}},Pt.prototype.contains=function(){if(arguments.length===1){if(arguments[0]instanceof Pt){var n=arguments[0];return this.covers(n)}if(arguments[0]instanceof L){var i=arguments[0];return this.covers(i)}}else if(arguments.length===2){var s=arguments[0],u=arguments[1];return this.covers(s,u)}},Pt.prototype.centre=function(){return this.isNull()?null:new L((this.getMinX()+this.getMaxX())/2,(this.getMinY()+this.getMaxY())/2)},Pt.prototype.init=function(){if(arguments.length===0)this.setToNull();else if(arguments.length===1){if(arguments[0]instanceof L){var n=arguments[0];this.init(n.x,n.x,n.y,n.y)}else if(arguments[0]instanceof Pt){var i=arguments[0];this._minx=i._minx,this._maxx=i._maxx,this._miny=i._miny,this._maxy=i._maxy}}else if(arguments.length===2){var s=arguments[0],u=arguments[1];this.init(s.x,u.x,s.y,u.y)}else if(arguments.length===4){var c=arguments[0],m=arguments[1],E=arguments[2],A=arguments[3];c<m?(this._minx=c,this._maxx=m):(this._minx=m,this._maxx=c),E<A?(this._miny=E,this._maxy=A):(this._miny=A,this._maxy=E)}},Pt.prototype.getMaxY=function(){return this._maxy},Pt.prototype.distance=function(n){if(this.intersects(n))return 0;var i=0;this._maxx<n._minx?i=n._minx-this._maxx:this._minx>n._maxx&&(i=this._minx-n._maxx);var s=0;return this._maxy<n._miny?s=n._miny-this._maxy:this._miny>n._maxy&&(s=this._miny-n._maxy),i===0?s:s===0?i:Math.sqrt(i*i+s*s)},Pt.prototype.hashCode=function(){var n=17;return n=37*n+L.hashCode(this._minx),n=37*n+L.hashCode(this._maxx),n=37*n+L.hashCode(this._miny),n=37*n+L.hashCode(this._maxy)},Pt.prototype.interfaces_=function(){return[F,t]},Pt.prototype.getClass=function(){return Pt},Pt.intersects=function(){if(arguments.length===3){var n=arguments[0],i=arguments[1],s=arguments[2];return s.x>=(n.x<i.x?n.x:i.x)&&s.x<=(n.x>i.x?n.x:i.x)&&s.y>=(n.y<i.y?n.y:i.y)&&s.y<=(n.y>i.y?n.y:i.y)}if(arguments.length===4){var u=arguments[0],c=arguments[1],m=arguments[2],E=arguments[3],A=Math.min(m.x,E.x),U=Math.max(m.x,E.x),Z=Math.min(u.x,c.x),ut=Math.max(u.x,c.x);return!(Z>U)&&!(ut<A)&&(A=Math.min(m.y,E.y),U=Math.max(m.y,E.y),Z=Math.min(u.y,c.y),ut=Math.max(u.y,c.y),!(Z>U)&&!(ut<A))}},Xt.serialVersionUID.get=function(){return 5873921885273102e3},Object.defineProperties(Pt,Xt);var tt={typeStr:/^\\s*(\\w+)\\s*\\(\\s*(.*)\\s*\\)\\s*$/,emptyTypeStr:/^\\s*(\\w+)\\s*EMPTY\\s*$/,spaces:/\\s+/,parenComma:/\\)\\s*,\\s*\\(/,doubleParenComma:/\\)\\s*\\)\\s*,\\s*\\(\\s*\\(/,trimParens:/^\\s*\\(?(.*?)\\)?\\s*$/},nn=function(n){this.geometryFactory=n||new le};nn.prototype.read=function(n){var i,s,u;n=n.replace(/[\\n\\r]/g," ");var c=tt.typeStr.exec(n);if(n.search("EMPTY")!==-1&&((c=tt.emptyTypeStr.exec(n))[2]=void 0),c&&(s=c[1].toLowerCase(),u=c[2],te[s]&&(i=te[s].apply(this,[u]))),i===void 0)throw new Error("Could not parse WKT "+n);return i},nn.prototype.write=function(n){return this.extractGeometry(n)},nn.prototype.extractGeometry=function(n){var i=n.getGeometryType().toLowerCase();if(!Gt[i])return null;var s=i.toUpperCase();return n.isEmpty()?s+" EMPTY":s+"("+Gt[i].apply(this,[n])+")"};var Gt={coordinate:function(n){return n.x+" "+n.y},point:function(n){return Gt.coordinate.call(this,n._coordinates._coordinates[0])},multipoint:function(n){for(var i=[],s=0,u=n._geometries.length;s<u;++s)i.push("("+Gt.point.apply(this,[n._geometries[s]])+")");return i.join(",")},linestring:function(n){for(var i=[],s=0,u=n._points._coordinates.length;s<u;++s)i.push(Gt.coordinate.apply(this,[n._points._coordinates[s]]));return i.join(",")},linearring:function(n){for(var i=[],s=0,u=n._points._coordinates.length;s<u;++s)i.push(Gt.coordinate.apply(this,[n._points._coordinates[s]]));return i.join(",")},multilinestring:function(n){for(var i=[],s=0,u=n._geometries.length;s<u;++s)i.push("("+Gt.linestring.apply(this,[n._geometries[s]])+")");return i.join(",")},polygon:function(n){var i=[];i.push("("+Gt.linestring.apply(this,[n._shell])+")");for(var s=0,u=n._holes.length;s<u;++s)i.push("("+Gt.linestring.apply(this,[n._holes[s]])+")");return i.join(",")},multipolygon:function(n){for(var i=[],s=0,u=n._geometries.length;s<u;++s)i.push("("+Gt.polygon.apply(this,[n._geometries[s]])+")");return i.join(",")},geometrycollection:function(n){for(var i=[],s=0,u=n._geometries.length;s<u;++s)i.push(this.extractGeometry(n._geometries[s]));return i.join(",")}},te={point:function(n){if(n===void 0)return this.geometryFactory.createPoint();var i=n.trim().split(tt.spaces);return this.geometryFactory.createPoint(new L(Number.parseFloat(i[0]),Number.parseFloat(i[1])))},multipoint:function(n){if(n===void 0)return this.geometryFactory.createMultiPoint();for(var i,s=n.trim().split(","),u=[],c=0,m=s.length;c<m;++c)i=s[c].replace(tt.trimParens,"$1"),u.push(te.point.apply(this,[i]));return this.geometryFactory.createMultiPoint(u)},linestring:function(n){if(n===void 0)return this.geometryFactory.createLineString();for(var i,s=n.trim().split(","),u=[],c=0,m=s.length;c<m;++c)i=s[c].trim().split(tt.spaces),u.push(new L(Number.parseFloat(i[0]),Number.parseFloat(i[1])));return this.geometryFactory.createLineString(u)},linearring:function(n){if(n===void 0)return this.geometryFactory.createLinearRing();for(var i,s=n.trim().split(","),u=[],c=0,m=s.length;c<m;++c)i=s[c].trim().split(tt.spaces),u.push(new L(Number.parseFloat(i[0]),Number.parseFloat(i[1])));return this.geometryFactory.createLinearRing(u)},multilinestring:function(n){if(n===void 0)return this.geometryFactory.createMultiLineString();for(var i,s=n.trim().split(tt.parenComma),u=[],c=0,m=s.length;c<m;++c)i=s[c].replace(tt.trimParens,"$1"),u.push(te.linestring.apply(this,[i]));return this.geometryFactory.createMultiLineString(u)},polygon:function(n){if(n===void 0)return this.geometryFactory.createPolygon();for(var i,s,u,c,m=n.trim().split(tt.parenComma),E=[],A=0,U=m.length;A<U;++A)i=m[A].replace(tt.trimParens,"$1"),s=te.linestring.apply(this,[i]),u=this.geometryFactory.createLinearRing(s._points),A===0?c=u:E.push(u);return this.geometryFactory.createPolygon(c,E)},multipolygon:function(n){if(n===void 0)return this.geometryFactory.createMultiPolygon();for(var i,s=n.trim().split(tt.doubleParenComma),u=[],c=0,m=s.length;c<m;++c)i=s[c].replace(tt.trimParens,"$1"),u.push(te.polygon.apply(this,[i]));return this.geometryFactory.createMultiPolygon(u)},geometrycollection:function(n){if(n===void 0)return this.geometryFactory.createGeometryCollection();for(var i=(n=n.replace(/,\\s*([A-Za-z])/g,"|$1")).trim().split("|"),s=[],u=0,c=i.length;u<c;++u)s.push(this.read(i[u]));return this.geometryFactory.createGeometryCollection(s)}},qt=function(n){this.parser=new nn(n)};qt.prototype.write=function(n){return this.parser.write(n)},qt.toLineString=function(n,i){if(arguments.length!==2)throw new Error("Not implemented");return"LINESTRING ( "+n.x+" "+n.y+", "+i.x+" "+i.y+" )"};var $=function(n){function i(s){n.call(this,s),this.name="RuntimeException",this.message=s,this.stack=new n().stack}return n&&(i.__proto__=n),i.prototype=Object.create(n&&n.prototype),i.prototype.constructor=i,i}(Error),N=function(n){function i(){if(n.call(this),arguments.length===0)n.call(this);else if(arguments.length===1){var s=arguments[0];n.call(this,s)}}return n&&(i.__proto__=n),i.prototype=Object.create(n&&n.prototype),i.prototype.constructor=i,i.prototype.interfaces_=function(){return[]},i.prototype.getClass=function(){return i},i}($),b=function(){};b.prototype.interfaces_=function(){return[]},b.prototype.getClass=function(){return b},b.shouldNeverReachHere=function(){if(arguments.length===0)b.shouldNeverReachHere(null);else if(arguments.length===1){var n=arguments[0];throw new N("Should never reach here"+(n!==null?": "+n:""))}},b.isTrue=function(){var n,i;if(arguments.length===1)n=arguments[0],b.isTrue(n,null);else if(arguments.length===2&&(n=arguments[0],i=arguments[1],!n))throw i===null?new N:new N(i)},b.equals=function(){var n,i,s;if(arguments.length===2)n=arguments[0],i=arguments[1],b.equals(n,i,null);else if(arguments.length===3&&(n=arguments[0],i=arguments[1],s=arguments[2],!i.equals(n)))throw new N("Expected "+n+" but encountered "+i+(s!==null?": "+s:""))};var R=function(){this._result=null,this._inputLines=Array(2).fill().map(function(){return Array(2)}),this._intPt=new Array(2).fill(null),this._intLineIndex=null,this._isProper=null,this._pa=null,this._pb=null,this._precisionModel=null,this._intPt[0]=new L,this._intPt[1]=new L,this._pa=this._intPt[0],this._pb=this._intPt[1],this._result=0},W={DONT_INTERSECT:{configurable:!0},DO_INTERSECT:{configurable:!0},COLLINEAR:{configurable:!0},NO_INTERSECTION:{configurable:!0},POINT_INTERSECTION:{configurable:!0},COLLINEAR_INTERSECTION:{configurable:!0}};R.prototype.getIndexAlongSegment=function(n,i){return this.computeIntLineIndex(),this._intLineIndex[n][i]},R.prototype.getTopologySummary=function(){var n=new pt;return this.isEndPoint()&&n.append(" endpoint"),this._isProper&&n.append(" proper"),this.isCollinear()&&n.append(" collinear"),n.toString()},R.prototype.computeIntersection=function(n,i,s,u){this._inputLines[0][0]=n,this._inputLines[0][1]=i,this._inputLines[1][0]=s,this._inputLines[1][1]=u,this._result=this.computeIntersect(n,i,s,u)},R.prototype.getIntersectionNum=function(){return this._result},R.prototype.computeIntLineIndex=function(){if(arguments.length===0)this._intLineIndex===null&&(this._intLineIndex=Array(2).fill().map(function(){return Array(2)}),this.computeIntLineIndex(0),this.computeIntLineIndex(1));else if(arguments.length===1){var n=arguments[0];this.getEdgeDistance(n,0)>this.getEdgeDistance(n,1)?(this._intLineIndex[n][0]=0,this._intLineIndex[n][1]=1):(this._intLineIndex[n][0]=1,this._intLineIndex[n][1]=0)}},R.prototype.isProper=function(){return this.hasIntersection()&&this._isProper},R.prototype.setPrecisionModel=function(n){this._precisionModel=n},R.prototype.isInteriorIntersection=function(){if(arguments.length===0)return!!this.isInteriorIntersection(0)||!!this.isInteriorIntersection(1);if(arguments.length===1){for(var n=arguments[0],i=0;i<this._result;i++)if(!this._intPt[i].equals2D(this._inputLines[n][0])&&!this._intPt[i].equals2D(this._inputLines[n][1]))return!0;return!1}},R.prototype.getIntersection=function(n){return this._intPt[n]},R.prototype.isEndPoint=function(){return this.hasIntersection()&&!this._isProper},R.prototype.hasIntersection=function(){return this._result!==R.NO_INTERSECTION},R.prototype.getEdgeDistance=function(n,i){return R.computeEdgeDistance(this._intPt[i],this._inputLines[n][0],this._inputLines[n][1])},R.prototype.isCollinear=function(){return this._result===R.COLLINEAR_INTERSECTION},R.prototype.toString=function(){return qt.toLineString(this._inputLines[0][0],this._inputLines[0][1])+" - "+qt.toLineString(this._inputLines[1][0],this._inputLines[1][1])+this.getTopologySummary()},R.prototype.getEndpoint=function(n,i){return this._inputLines[n][i]},R.prototype.isIntersection=function(n){for(var i=0;i<this._result;i++)if(this._intPt[i].equals2D(n))return!0;return!1},R.prototype.getIntersectionAlongSegment=function(n,i){return this.computeIntLineIndex(),this._intPt[this._intLineIndex[n][i]]},R.prototype.interfaces_=function(){return[]},R.prototype.getClass=function(){return R},R.computeEdgeDistance=function(n,i,s){var u=Math.abs(s.x-i.x),c=Math.abs(s.y-i.y),m=-1;if(n.equals(i))m=0;else if(n.equals(s))m=u>c?u:c;else{var E=Math.abs(n.x-i.x),A=Math.abs(n.y-i.y);(m=u>c?E:A)!==0||n.equals(i)||(m=Math.max(E,A))}return b.isTrue(!(m===0&&!n.equals(i)),"Bad distance calculation"),m},R.nonRobustComputeEdgeDistance=function(n,i,s){var u=n.x-i.x,c=n.y-i.y,m=Math.sqrt(u*u+c*c);return b.isTrue(!(m===0&&!n.equals(i)),"Invalid distance calculation"),m},W.DONT_INTERSECT.get=function(){return 0},W.DO_INTERSECT.get=function(){return 1},W.COLLINEAR.get=function(){return 2},W.NO_INTERSECTION.get=function(){return 0},W.POINT_INTERSECTION.get=function(){return 1},W.COLLINEAR_INTERSECTION.get=function(){return 2},Object.defineProperties(R,W);var J=function(n){function i(){n.apply(this,arguments)}return n&&(i.__proto__=n),i.prototype=Object.create(n&&n.prototype),i.prototype.constructor=i,i.prototype.isInSegmentEnvelopes=function(s){var u=new Pt(this._inputLines[0][0],this._inputLines[0][1]),c=new Pt(this._inputLines[1][0],this._inputLines[1][1]);return u.contains(s)&&c.contains(s)},i.prototype.computeIntersection=function(){if(arguments.length!==3)return n.prototype.computeIntersection.apply(this,arguments);var s=arguments[0],u=arguments[1],c=arguments[2];if(this._isProper=!1,Pt.intersects(u,c,s)&&B.orientationIndex(u,c,s)===0&&B.orientationIndex(c,u,s)===0)return this._isProper=!0,(s.equals(u)||s.equals(c))&&(this._isProper=!1),this._result=n.POINT_INTERSECTION,null;this._result=n.NO_INTERSECTION},i.prototype.normalizeToMinimum=function(s,u,c,m,E){E.x=this.smallestInAbsValue(s.x,u.x,c.x,m.x),E.y=this.smallestInAbsValue(s.y,u.y,c.y,m.y),s.x-=E.x,s.y-=E.y,u.x-=E.x,u.y-=E.y,c.x-=E.x,c.y-=E.y,m.x-=E.x,m.y-=E.y},i.prototype.safeHCoordinateIntersection=function(s,u,c,m){var E=null;try{E=ne.intersection(s,u,c,m)}catch(A){if(!(A instanceof Wt))throw A;E=i.nearestEndpoint(s,u,c,m)}return E},i.prototype.intersection=function(s,u,c,m){var E=this.intersectionWithNormalization(s,u,c,m);return this.isInSegmentEnvelopes(E)||(E=new L(i.nearestEndpoint(s,u,c,m))),this._precisionModel!==null&&this._precisionModel.makePrecise(E),E},i.prototype.smallestInAbsValue=function(s,u,c,m){var E=s,A=Math.abs(E);return Math.abs(u)<A&&(E=u,A=Math.abs(u)),Math.abs(c)<A&&(E=c,A=Math.abs(c)),Math.abs(m)<A&&(E=m),E},i.prototype.checkDD=function(s,u,c,m,E){var A=at.intersection(s,u,c,m),U=this.isInSegmentEnvelopes(A);Nt.out.println("DD in env = "+U+" --------------------- "+A),E.distance(A)>1e-4&&Nt.out.println("Distance = "+E.distance(A))},i.prototype.intersectionWithNormalization=function(s,u,c,m){var E=new L(s),A=new L(u),U=new L(c),Z=new L(m),ut=new L;this.normalizeToEnvCentre(E,A,U,Z,ut);var ht=this.safeHCoordinateIntersection(E,A,U,Z);return ht.x+=ut.x,ht.y+=ut.y,ht},i.prototype.computeCollinearIntersection=function(s,u,c,m){var E=Pt.intersects(s,u,c),A=Pt.intersects(s,u,m),U=Pt.intersects(c,m,s),Z=Pt.intersects(c,m,u);return E&&A?(this._intPt[0]=c,this._intPt[1]=m,n.COLLINEAR_INTERSECTION):U&&Z?(this._intPt[0]=s,this._intPt[1]=u,n.COLLINEAR_INTERSECTION):E&&U?(this._intPt[0]=c,this._intPt[1]=s,!c.equals(s)||A||Z?n.COLLINEAR_INTERSECTION:n.POINT_INTERSECTION):E&&Z?(this._intPt[0]=c,this._intPt[1]=u,!c.equals(u)||A||U?n.COLLINEAR_INTERSECTION:n.POINT_INTERSECTION):A&&U?(this._intPt[0]=m,this._intPt[1]=s,!m.equals(s)||E||Z?n.COLLINEAR_INTERSECTION:n.POINT_INTERSECTION):A&&Z?(this._intPt[0]=m,this._intPt[1]=u,!m.equals(u)||E||U?n.COLLINEAR_INTERSECTION:n.POINT_INTERSECTION):n.NO_INTERSECTION},i.prototype.normalizeToEnvCentre=function(s,u,c,m,E){var A=s.x<u.x?s.x:u.x,U=s.y<u.y?s.y:u.y,Z=s.x>u.x?s.x:u.x,ut=s.y>u.y?s.y:u.y,ht=c.x<m.x?c.x:m.x,At=c.y<m.y?c.y:m.y,Rt=c.x>m.x?c.x:m.x,kt=c.y>m.y?c.y:m.y,ee=((A>ht?A:ht)+(Z<Rt?Z:Rt))/2,on=((U>At?U:At)+(ut<kt?ut:kt))/2;E.x=ee,E.y=on,s.x-=E.x,s.y-=E.y,u.x-=E.x,u.y-=E.y,c.x-=E.x,c.y-=E.y,m.x-=E.x,m.y-=E.y},i.prototype.computeIntersect=function(s,u,c,m){if(this._isProper=!1,!Pt.intersects(s,u,c,m))return n.NO_INTERSECTION;var E=B.orientationIndex(s,u,c),A=B.orientationIndex(s,u,m);if(E>0&&A>0||E<0&&A<0)return n.NO_INTERSECTION;var U=B.orientationIndex(c,m,s),Z=B.orientationIndex(c,m,u);return U>0&&Z>0||U<0&&Z<0?n.NO_INTERSECTION:E===0&&A===0&&U===0&&Z===0?this.computeCollinearIntersection(s,u,c,m):(E===0||A===0||U===0||Z===0?(this._isProper=!1,s.equals2D(c)||s.equals2D(m)?this._intPt[0]=s:u.equals2D(c)||u.equals2D(m)?this._intPt[0]=u:E===0?this._intPt[0]=new L(c):A===0?this._intPt[0]=new L(m):U===0?this._intPt[0]=new L(s):Z===0&&(this._intPt[0]=new L(u))):(this._isProper=!0,this._intPt[0]=this.intersection(s,u,c,m)),n.POINT_INTERSECTION)},i.prototype.interfaces_=function(){return[]},i.prototype.getClass=function(){return i},i.nearestEndpoint=function(s,u,c,m){var E=s,A=B.distancePointLine(s,c,m),U=B.distancePointLine(u,c,m);return U<A&&(A=U,E=u),(U=B.distancePointLine(c,s,u))<A&&(A=U,E=c),(U=B.distancePointLine(m,s,u))<A&&(A=U,E=m),E},i}(R),I=function(){};I.prototype.interfaces_=function(){return[]},I.prototype.getClass=function(){return I},I.orientationIndex=function(n,i,s){var u=i.x-n.x,c=i.y-n.y,m=s.x-i.x,E=s.y-i.y;return I.signOfDet2x2(u,c,m,E)},I.signOfDet2x2=function(n,i,s,u){var c=null,m=null,E=null;if(c=1,n===0||u===0)return i===0||s===0?0:i>0?s>0?-c:c:s>0?c:-c;if(i===0||s===0)return u>0?n>0?c:-c:n>0?-c:c;if(i>0?u>0?i<=u||(c=-c,m=n,n=s,s=m,m=i,i=u,u=m):i<=-u?(c=-c,s=-s,u=-u):(m=n,n=-s,s=m,m=i,i=-u,u=m):u>0?-i<=u?(c=-c,n=-n,i=-i):(m=-n,n=s,s=m,m=-i,i=u,u=m):i>=u?(n=-n,i=-i,s=-s,u=-u):(c=-c,m=-n,n=-s,s=m,m=-i,i=-u,u=m),n>0){if(!(s>0)||!(n<=s))return c}else{if(s>0||!(n>=s))return-c;c=-c,n=-n,s=-s}for(;;){if(E=Math.floor(s/n),s-=E*n,(u-=E*i)<0)return-c;if(u>i)return c;if(n>s+s){if(i<u+u)return c}else{if(i>u+u)return-c;s=n-s,u=i-u,c=-c}if(u===0)return s===0?0:-c;if(s===0||(E=Math.floor(n/s),n-=E*s,(i-=E*u)<0))return c;if(i>u)return-c;if(s>n+n){if(u<i+i)return-c}else{if(u>i+i)return c;n=s-n,i=u-i,c=-c}if(i===0)return n===0?0:c;if(n===0)return-c}};var P=function(){this._p=null,this._crossingCount=0,this._isPointOnSegment=!1;var n=arguments[0];this._p=n};P.prototype.countSegment=function(n,i){if(n.x<this._p.x&&i.x<this._p.x)return null;if(this._p.x===i.x&&this._p.y===i.y)return this._isPointOnSegment=!0,null;if(n.y===this._p.y&&i.y===this._p.y){var s=n.x,u=i.x;return s>u&&(s=i.x,u=n.x),this._p.x>=s&&this._p.x<=u&&(this._isPointOnSegment=!0),null}if(n.y>this._p.y&&i.y<=this._p.y||i.y>this._p.y&&n.y<=this._p.y){var c=n.x-this._p.x,m=n.y-this._p.y,E=i.x-this._p.x,A=i.y-this._p.y,U=I.signOfDet2x2(c,m,E,A);if(U===0)return this._isPointOnSegment=!0,null;A<m&&(U=-U),U>0&&this._crossingCount++}},P.prototype.isPointInPolygon=function(){return this.getLocation()!==k.EXTERIOR},P.prototype.getLocation=function(){return this._isPointOnSegment?k.BOUNDARY:this._crossingCount%2==1?k.INTERIOR:k.EXTERIOR},P.prototype.isOnSegment=function(){return this._isPointOnSegment},P.prototype.interfaces_=function(){return[]},P.prototype.getClass=function(){return P},P.locatePointInRing=function(){if(arguments[0]instanceof L&&X(arguments[1],dt)){for(var n=arguments[0],i=arguments[1],s=new P(n),u=new L,c=new L,m=1;m<i.size();m++)if(i.getCoordinate(m,u),i.getCoordinate(m-1,c),s.countSegment(u,c),s.isOnSegment())return s.getLocation();return s.getLocation()}if(arguments[0]instanceof L&&arguments[1]instanceof Array){for(var E=arguments[0],A=arguments[1],U=new P(E),Z=1;Z<A.length;Z++){var ut=A[Z],ht=A[Z-1];if(U.countSegment(ut,ht),U.isOnSegment())return U.getLocation()}return U.getLocation()}};var B=function(){},lt={CLOCKWISE:{configurable:!0},RIGHT:{configurable:!0},COUNTERCLOCKWISE:{configurable:!0},LEFT:{configurable:!0},COLLINEAR:{configurable:!0},STRAIGHT:{configurable:!0}};B.prototype.interfaces_=function(){return[]},B.prototype.getClass=function(){return B},B.orientationIndex=function(n,i,s){return at.orientationIndex(n,i,s)},B.signedArea=function(){if(arguments[0]instanceof Array){var n=arguments[0];if(n.length<3)return 0;for(var i=0,s=n[0].x,u=1;u<n.length-1;u++){var c=n[u].x-s,m=n[u+1].y;i+=c*(n[u-1].y-m)}return i/2}if(X(arguments[0],dt)){var E=arguments[0],A=E.size();if(A<3)return 0;var U=new L,Z=new L,ut=new L;E.getCoordinate(0,Z),E.getCoordinate(1,ut);var ht=Z.x;ut.x-=ht;for(var At=0,Rt=1;Rt<A-1;Rt++)U.y=Z.y,Z.x=ut.x,Z.y=ut.y,E.getCoordinate(Rt+1,ut),ut.x-=ht,At+=Z.x*(U.y-ut.y);return At/2}},B.distanceLineLine=function(n,i,s,u){if(n.equals(i))return B.distancePointLine(n,s,u);if(s.equals(u))return B.distancePointLine(u,n,i);var c=!1;if(Pt.intersects(n,i,s,u)){var m=(i.x-n.x)*(u.y-s.y)-(i.y-n.y)*(u.x-s.x);if(m===0)c=!0;else{var E=(n.y-s.y)*(u.x-s.x)-(n.x-s.x)*(u.y-s.y),A=((n.y-s.y)*(i.x-n.x)-(n.x-s.x)*(i.y-n.y))/m,U=E/m;(U<0||U>1||A<0||A>1)&&(c=!0)}}else c=!0;return c?it.min(B.distancePointLine(n,s,u),B.distancePointLine(i,s,u),B.distancePointLine(s,n,i),B.distancePointLine(u,n,i)):0},B.isPointInRing=function(n,i){return B.locatePointInRing(n,i)!==k.EXTERIOR},B.computeLength=function(n){var i=n.size();if(i<=1)return 0;var s=0,u=new L;n.getCoordinate(0,u);for(var c=u.x,m=u.y,E=1;E<i;E++){n.getCoordinate(E,u);var A=u.x,U=u.y,Z=A-c,ut=U-m;s+=Math.sqrt(Z*Z+ut*ut),c=A,m=U}return s},B.isCCW=function(n){var i=n.length-1;if(i<3)throw new C("Ring has fewer than 4 points, so orientation cannot be determined");for(var s=n[0],u=0,c=1;c<=i;c++){var m=n[c];m.y>s.y&&(s=m,u=c)}var E=u;do(E-=1)<0&&(E=i);while(n[E].equals2D(s)&&E!==u);var A=u;do A=(A+1)%i;while(n[A].equals2D(s)&&A!==u);var U=n[E],Z=n[A];if(U.equals2D(s)||Z.equals2D(s)||U.equals2D(Z))return!1;var ut=B.computeOrientation(U,s,Z),ht=!1;return ht=ut===0?U.x>Z.x:ut>0,ht},B.locatePointInRing=function(n,i){return P.locatePointInRing(n,i)},B.distancePointLinePerpendicular=function(n,i,s){var u=(s.x-i.x)*(s.x-i.x)+(s.y-i.y)*(s.y-i.y),c=((i.y-n.y)*(s.x-i.x)-(i.x-n.x)*(s.y-i.y))/u;return Math.abs(c)*Math.sqrt(u)},B.computeOrientation=function(n,i,s){return B.orientationIndex(n,i,s)},B.distancePointLine=function(){if(arguments.length===2){var n=arguments[0],i=arguments[1];if(i.length===0)throw new C("Line array must contain at least one vertex");for(var s=n.distance(i[0]),u=0;u<i.length-1;u++){var c=B.distancePointLine(n,i[u],i[u+1]);c<s&&(s=c)}return s}if(arguments.length===3){var m=arguments[0],E=arguments[1],A=arguments[2];if(E.x===A.x&&E.y===A.y)return m.distance(E);var U=(A.x-E.x)*(A.x-E.x)+(A.y-E.y)*(A.y-E.y),Z=((m.x-E.x)*(A.x-E.x)+(m.y-E.y)*(A.y-E.y))/U;if(Z<=0)return m.distance(E);if(Z>=1)return m.distance(A);var ut=((E.y-m.y)*(A.x-E.x)-(E.x-m.x)*(A.y-E.y))/U;return Math.abs(ut)*Math.sqrt(U)}},B.isOnLine=function(n,i){for(var s=new J,u=1;u<i.length;u++){var c=i[u-1],m=i[u];if(s.computeIntersection(n,c,m),s.hasIntersection())return!0}return!1},lt.CLOCKWISE.get=function(){return-1},lt.RIGHT.get=function(){return B.CLOCKWISE},lt.COUNTERCLOCKWISE.get=function(){return 1},lt.LEFT.get=function(){return B.COUNTERCLOCKWISE},lt.COLLINEAR.get=function(){return 0},lt.STRAIGHT.get=function(){return B.COLLINEAR},Object.defineProperties(B,lt);var ct=function(){};ct.prototype.filter=function(n){},ct.prototype.interfaces_=function(){return[]},ct.prototype.getClass=function(){return ct};var Q=function(){var n=arguments[0];this._envelope=null,this._factory=null,this._SRID=null,this._userData=null,this._factory=n,this._SRID=n.getSRID()},St={serialVersionUID:{configurable:!0},SORTINDEX_POINT:{configurable:!0},SORTINDEX_MULTIPOINT:{configurable:!0},SORTINDEX_LINESTRING:{configurable:!0},SORTINDEX_LINEARRING:{configurable:!0},SORTINDEX_MULTILINESTRING:{configurable:!0},SORTINDEX_POLYGON:{configurable:!0},SORTINDEX_MULTIPOLYGON:{configurable:!0},SORTINDEX_GEOMETRYCOLLECTION:{configurable:!0},geometryChangedFilter:{configurable:!0}};Q.prototype.isGeometryCollection=function(){return this.getSortIndex()===Q.SORTINDEX_GEOMETRYCOLLECTION},Q.prototype.getFactory=function(){return this._factory},Q.prototype.getGeometryN=function(n){return this},Q.prototype.getArea=function(){return 0},Q.prototype.isRectangle=function(){return!1},Q.prototype.equals=function(){if(arguments[0]instanceof Q){var n=arguments[0];return n!==null&&this.equalsTopo(n)}if(arguments[0]instanceof Object){var i=arguments[0];if(!(i instanceof Q))return!1;var s=i;return this.equalsExact(s)}},Q.prototype.equalsExact=function(n){return this===n||this.equalsExact(n,0)},Q.prototype.geometryChanged=function(){this.apply(Q.geometryChangedFilter)},Q.prototype.geometryChangedAction=function(){this._envelope=null},Q.prototype.equalsNorm=function(n){return n!==null&&this.norm().equalsExact(n.norm())},Q.prototype.getLength=function(){return 0},Q.prototype.getNumGeometries=function(){return 1},Q.prototype.compareTo=function(){if(arguments.length===1){var n=arguments[0],i=n;return this.getSortIndex()!==i.getSortIndex()?this.getSortIndex()-i.getSortIndex():this.isEmpty()&&i.isEmpty()?0:this.isEmpty()?-1:i.isEmpty()?1:this.compareToSameClass(n)}if(arguments.length===2){var s=arguments[0],u=arguments[1];return this.getSortIndex()!==s.getSortIndex()?this.getSortIndex()-s.getSortIndex():this.isEmpty()&&s.isEmpty()?0:this.isEmpty()?-1:s.isEmpty()?1:this.compareToSameClass(s,u)}},Q.prototype.getUserData=function(){return this._userData},Q.prototype.getSRID=function(){return this._SRID},Q.prototype.getEnvelope=function(){return this.getFactory().toGeometry(this.getEnvelopeInternal())},Q.prototype.checkNotGeometryCollection=function(n){if(n.getSortIndex()===Q.SORTINDEX_GEOMETRYCOLLECTION)throw new C("This method does not support GeometryCollection arguments")},Q.prototype.equal=function(n,i,s){return s===0?n.equals(i):n.distance(i)<=s},Q.prototype.norm=function(){var n=this.copy();return n.normalize(),n},Q.prototype.getPrecisionModel=function(){return this._factory.getPrecisionModel()},Q.prototype.getEnvelopeInternal=function(){return this._envelope===null&&(this._envelope=this.computeEnvelopeInternal()),new Pt(this._envelope)},Q.prototype.setSRID=function(n){this._SRID=n},Q.prototype.setUserData=function(n){this._userData=n},Q.prototype.compare=function(n,i){for(var s=n.iterator(),u=i.iterator();s.hasNext()&&u.hasNext();){var c=s.next(),m=u.next(),E=c.compareTo(m);if(E!==0)return E}return s.hasNext()?1:u.hasNext()?-1:0},Q.prototype.hashCode=function(){return this.getEnvelopeInternal().hashCode()},Q.prototype.isGeometryCollectionOrDerived=function(){return this.getSortIndex()===Q.SORTINDEX_GEOMETRYCOLLECTION||this.getSortIndex()===Q.SORTINDEX_MULTIPOINT||this.getSortIndex()===Q.SORTINDEX_MULTILINESTRING||this.getSortIndex()===Q.SORTINDEX_MULTIPOLYGON},Q.prototype.interfaces_=function(){return[G,F,t]},Q.prototype.getClass=function(){return Q},Q.hasNonEmptyElements=function(n){for(var i=0;i<n.length;i++)if(!n[i].isEmpty())return!0;return!1},Q.hasNullElements=function(n){for(var i=0;i<n.length;i++)if(n[i]===null)return!0;return!1},St.serialVersionUID.get=function(){return 8763622679187377e3},St.SORTINDEX_POINT.get=function(){return 0},St.SORTINDEX_MULTIPOINT.get=function(){return 1},St.SORTINDEX_LINESTRING.get=function(){return 2},St.SORTINDEX_LINEARRING.get=function(){return 3},St.SORTINDEX_MULTILINESTRING.get=function(){return 4},St.SORTINDEX_POLYGON.get=function(){return 5},St.SORTINDEX_MULTIPOLYGON.get=function(){return 6},St.SORTINDEX_GEOMETRYCOLLECTION.get=function(){return 7},St.geometryChangedFilter.get=function(){return _t},Object.defineProperties(Q,St);var _t=function(){};_t.interfaces_=function(){return[ct]},_t.filter=function(n){n.geometryChangedAction()};var Mt=function(){};Mt.prototype.filter=function(n){},Mt.prototype.interfaces_=function(){return[]},Mt.prototype.getClass=function(){return Mt};var Lt=function(){},$t={Mod2BoundaryNodeRule:{configurable:!0},EndPointBoundaryNodeRule:{configurable:!0},MultiValentEndPointBoundaryNodeRule:{configurable:!0},MonoValentEndPointBoundaryNodeRule:{configurable:!0},MOD2_BOUNDARY_RULE:{configurable:!0},ENDPOINT_BOUNDARY_RULE:{configurable:!0},MULTIVALENT_ENDPOINT_BOUNDARY_RULE:{configurable:!0},MONOVALENT_ENDPOINT_BOUNDARY_RULE:{configurable:!0},OGC_SFS_BOUNDARY_RULE:{configurable:!0}};Lt.prototype.isInBoundary=function(n){},Lt.prototype.interfaces_=function(){return[]},Lt.prototype.getClass=function(){return Lt},$t.Mod2BoundaryNodeRule.get=function(){return Et},$t.EndPointBoundaryNodeRule.get=function(){return oe},$t.MultiValentEndPointBoundaryNodeRule.get=function(){return jt},$t.MonoValentEndPointBoundaryNodeRule.get=function(){return Ht},$t.MOD2_BOUNDARY_RULE.get=function(){return new Et},$t.ENDPOINT_BOUNDARY_RULE.get=function(){return new oe},$t.MULTIVALENT_ENDPOINT_BOUNDARY_RULE.get=function(){return new jt},$t.MONOVALENT_ENDPOINT_BOUNDARY_RULE.get=function(){return new Ht},$t.OGC_SFS_BOUNDARY_RULE.get=function(){return Lt.MOD2_BOUNDARY_RULE},Object.defineProperties(Lt,$t);var Et=function(){};Et.prototype.isInBoundary=function(n){return n%2==1},Et.prototype.interfaces_=function(){return[Lt]},Et.prototype.getClass=function(){return Et};var oe=function(){};oe.prototype.isInBoundary=function(n){return n>0},oe.prototype.interfaces_=function(){return[Lt]},oe.prototype.getClass=function(){return oe};var jt=function(){};jt.prototype.isInBoundary=function(n){return n>1},jt.prototype.interfaces_=function(){return[Lt]},jt.prototype.getClass=function(){return jt};var Ht=function(){};Ht.prototype.isInBoundary=function(n){return n===1},Ht.prototype.interfaces_=function(){return[Lt]},Ht.prototype.getClass=function(){return Ht};var Ot=function(){};Ot.prototype.add=function(){},Ot.prototype.addAll=function(){},Ot.prototype.isEmpty=function(){},Ot.prototype.iterator=function(){},Ot.prototype.size=function(){},Ot.prototype.toArray=function(){},Ot.prototype.remove=function(){},(e.prototype=new Error).name="IndexOutOfBoundsException";var Y=function(){};Y.prototype.hasNext=function(){},Y.prototype.next=function(){},Y.prototype.remove=function(){};var wt=function(n){function i(){n.apply(this,arguments)}return n&&(i.__proto__=n),i.prototype=Object.create(n&&n.prototype),i.prototype.constructor=i,i.prototype.get=function(){},i.prototype.set=function(){},i.prototype.isEmpty=function(){},i}(Ot);(o.prototype=new Error).name="NoSuchElementException";var j=function(n){function i(){n.call(this),this.array_=[],arguments[0]instanceof Ot&&this.addAll(arguments[0])}return n&&(i.__proto__=n),i.prototype=Object.create(n&&n.prototype),i.prototype.constructor=i,i.prototype.ensureCapacity=function(){},i.prototype.interfaces_=function(){return[n,Ot]},i.prototype.add=function(s){return arguments.length===1?this.array_.push(s):this.array_.splice(arguments[0],arguments[1]),!0},i.prototype.clear=function(){this.array_=[]},i.prototype.addAll=function(s){for(var u=s.iterator();u.hasNext();)this.add(u.next());return!0},i.prototype.set=function(s,u){var c=this.array_[s];return this.array_[s]=u,c},i.prototype.iterator=function(){return new Ut(this)},i.prototype.get=function(s){if(s<0||s>=this.size())throw new e;return this.array_[s]},i.prototype.isEmpty=function(){return this.array_.length===0},i.prototype.size=function(){return this.array_.length},i.prototype.toArray=function(){for(var s=[],u=0,c=this.array_.length;u<c;u++)s.push(this.array_[u]);return s},i.prototype.remove=function(s){for(var u=!1,c=0,m=this.array_.length;c<m;c++)if(this.array_[c]===s){this.array_.splice(c,1),u=!0;break}return u},i}(wt),Ut=function(n){function i(s){n.call(this),this.arrayList_=s,this.position_=0}return n&&(i.__proto__=n),i.prototype=Object.create(n&&n.prototype),i.prototype.constructor=i,i.prototype.next=function(){if(this.position_===this.arrayList_.size())throw new o;return this.arrayList_.get(this.position_++)},i.prototype.hasNext=function(){return this.position_<this.arrayList_.size()},i.prototype.set=function(s){return this.arrayList_.set(this.position_-1,s)},i.prototype.remove=function(){this.arrayList_.remove(this.arrayList_.get(this.position_))},i}(Y),Dt=function(n){function i(){if(n.call(this),arguments.length!==0){if(arguments.length===1){var u=arguments[0];this.ensureCapacity(u.length),this.add(u,!0)}else if(arguments.length===2){var c=arguments[0],m=arguments[1];this.ensureCapacity(c.length),this.add(c,m)}}}n&&(i.__proto__=n),(i.prototype=Object.create(n&&n.prototype)).constructor=i;var s={coordArrayType:{configurable:!0}};return s.coordArrayType.get=function(){return new Array(0).fill(null)},i.prototype.getCoordinate=function(u){return this.get(u)},i.prototype.addAll=function(){if(arguments.length===2){for(var u=arguments[0],c=arguments[1],m=!1,E=u.iterator();E.hasNext();)this.add(E.next(),c),m=!0;return m}return n.prototype.addAll.apply(this,arguments)},i.prototype.clone=function(){for(var u=n.prototype.clone.call(this),c=0;c<this.size();c++)u.add(c,this.get(c).copy());return u},i.prototype.toCoordinateArray=function(){return this.toArray(i.coordArrayType)},i.prototype.add=function(){if(arguments.length===1){var u=arguments[0];n.prototype.add.call(this,u)}else if(arguments.length===2){if(arguments[0]instanceof Array&&typeof arguments[1]=="boolean"){var c=arguments[0],m=arguments[1];return this.add(c,m,!0),!0}if(arguments[0]instanceof L&&typeof arguments[1]=="boolean"){var E=arguments[0];if(!arguments[1]&&this.size()>=1&&this.get(this.size()-1).equals2D(E))return null;n.prototype.add.call(this,E)}else if(arguments[0]instanceof Object&&typeof arguments[1]=="boolean"){var A=arguments[0],U=arguments[1];return this.add(A,U),!0}}else if(arguments.length===3){if(typeof arguments[2]=="boolean"&&arguments[0]instanceof Array&&typeof arguments[1]=="boolean"){var Z=arguments[0],ut=arguments[1];if(arguments[2])for(var ht=0;ht<Z.length;ht++)this.add(Z[ht],ut);else for(var At=Z.length-1;At>=0;At--)this.add(Z[At],ut);return!0}if(typeof arguments[2]=="boolean"&&Number.isInteger(arguments[0])&&arguments[1]instanceof L){var Rt=arguments[0],kt=arguments[1];if(!arguments[2]){var ee=this.size();if(ee>0&&(Rt>0&&this.get(Rt-1).equals2D(kt)||Rt<ee&&this.get(Rt).equals2D(kt)))return null}n.prototype.add.call(this,Rt,kt)}}else if(arguments.length===4){var on=arguments[0],In=arguments[1],pr=arguments[2],Zi=arguments[3],Do=1;pr>Zi&&(Do=-1);for(var Pf=pr;Pf!==Zi;Pf+=Do)this.add(on[Pf],In);return!0}},i.prototype.closeRing=function(){this.size()>0&&this.add(new L(this.get(0)),!1)},i.prototype.interfaces_=function(){return[]},i.prototype.getClass=function(){return i},Object.defineProperties(i,s),i}(j),ft=function(){},Kt={ForwardComparator:{configurable:!0},BidirectionalComparator:{configurable:!0},coordArrayType:{configurable:!0}};Kt.ForwardComparator.get=function(){return re},Kt.BidirectionalComparator.get=function(){return mn},Kt.coordArrayType.get=function(){return new Array(0).fill(null)},ft.prototype.interfaces_=function(){return[]},ft.prototype.getClass=function(){return ft},ft.isRing=function(n){return!(n.length<4)&&!!n[0].equals2D(n[n.length-1])},ft.ptNotInList=function(n,i){for(var s=0;s<n.length;s++){var u=n[s];if(ft.indexOf(u,i)<0)return u}return null},ft.scroll=function(n,i){var s=ft.indexOf(i,n);if(s<0)return null;var u=new Array(n.length).fill(null);Nt.arraycopy(n,s,u,0,n.length-s),Nt.arraycopy(n,0,u,n.length-s,s),Nt.arraycopy(u,0,n,0,n.length)},ft.equals=function(){if(arguments.length===2){var n=arguments[0],i=arguments[1];if(n===i)return!0;if(n===null||i===null||n.length!==i.length)return!1;for(var s=0;s<n.length;s++)if(!n[s].equals(i[s]))return!1;return!0}if(arguments.length===3){var u=arguments[0],c=arguments[1],m=arguments[2];if(u===c)return!0;if(u===null||c===null||u.length!==c.length)return!1;for(var E=0;E<u.length;E++)if(m.compare(u[E],c[E])!==0)return!1;return!0}},ft.intersection=function(n,i){for(var s=new Dt,u=0;u<n.length;u++)i.intersects(n[u])&&s.add(n[u],!0);return s.toCoordinateArray()},ft.hasRepeatedPoints=function(n){for(var i=1;i<n.length;i++)if(n[i-1].equals(n[i]))return!0;return!1},ft.removeRepeatedPoints=function(n){return ft.hasRepeatedPoints(n)?new Dt(n,!1).toCoordinateArray():n},ft.reverse=function(n){for(var i=n.length-1,s=Math.trunc(i/2),u=0;u<=s;u++){var c=n[u];n[u]=n[i-u],n[i-u]=c}},ft.removeNull=function(n){for(var i=0,s=0;s<n.length;s++)n[s]!==null&&i++;var u=new Array(i).fill(null);if(i===0)return u;for(var c=0,m=0;m<n.length;m++)n[m]!==null&&(u[c++]=n[m]);return u},ft.copyDeep=function(){if(arguments.length===1){for(var n=arguments[0],i=new Array(n.length).fill(null),s=0;s<n.length;s++)i[s]=new L(n[s]);return i}if(arguments.length===5)for(var u=arguments[0],c=arguments[1],m=arguments[2],E=arguments[3],A=arguments[4],U=0;U<A;U++)m[E+U]=new L(u[c+U])},ft.isEqualReversed=function(n,i){for(var s=0;s<n.length;s++){var u=n[s],c=i[n.length-s-1];if(u.compareTo(c)!==0)return!1}return!0},ft.envelope=function(n){for(var i=new Pt,s=0;s<n.length;s++)i.expandToInclude(n[s]);return i},ft.toCoordinateArray=function(n){return n.toArray(ft.coordArrayType)},ft.atLeastNCoordinatesOrNothing=function(n,i){return i.length>=n?i:[]},ft.indexOf=function(n,i){for(var s=0;s<i.length;s++)if(n.equals(i[s]))return s;return-1},ft.increasingDirection=function(n){for(var i=0;i<Math.trunc(n.length/2);i++){var s=n.length-1-i,u=n[i].compareTo(n[s]);if(u!==0)return u}return 1},ft.compare=function(n,i){for(var s=0;s<n.length&&s<i.length;){var u=n[s].compareTo(i[s]);if(u!==0)return u;s++}return s<i.length?-1:s<n.length?1:0},ft.minCoordinate=function(n){for(var i=null,s=0;s<n.length;s++)(i===null||i.compareTo(n[s])>0)&&(i=n[s]);return i},ft.extract=function(n,i,s){i=it.clamp(i,0,n.length);var u=(s=it.clamp(s,-1,n.length))-i+1;s<0&&(u=0),i>=n.length&&(u=0),s<i&&(u=0);var c=new Array(u).fill(null);if(u===0)return c;for(var m=0,E=i;E<=s;E++)c[m++]=n[E];return c},Object.defineProperties(ft,Kt);var re=function(){};re.prototype.compare=function(n,i){return ft.compare(n,i)},re.prototype.interfaces_=function(){return[z]},re.prototype.getClass=function(){return re};var mn=function(){};mn.prototype.compare=function(n,i){var s=n,u=i;if(s.length<u.length)return-1;if(s.length>u.length)return 1;if(s.length===0)return 0;var c=ft.compare(s,u);return ft.isEqualReversed(s,u)?0:c},mn.prototype.OLDcompare=function(n,i){var s=n,u=i;if(s.length<u.length)return-1;if(s.length>u.length)return 1;if(s.length===0)return 0;for(var c=ft.increasingDirection(s),m=ft.increasingDirection(u),E=c>0?0:s.length-1,A=m>0?0:s.length-1,U=0;U<s.length;U++){var Z=s[E].compareTo(u[A]);if(Z!==0)return Z;E+=c,A+=m}return 0},mn.prototype.interfaces_=function(){return[z]},mn.prototype.getClass=function(){return mn};var He=function(){};He.prototype.get=function(){},He.prototype.put=function(){},He.prototype.size=function(){},He.prototype.values=function(){},He.prototype.entrySet=function(){};var Si=function(n){function i(){n.apply(this,arguments)}return n&&(i.__proto__=n),i.prototype=Object.create(n&&n.prototype),i.prototype.constructor=i,i}(He);(a.prototype=new Error).name="OperationNotSupported",(l.prototype=new Ot).contains=function(){};var $n=function(n){function i(){n.call(this),this.array_=[],arguments[0]instanceof Ot&&this.addAll(arguments[0])}return n&&(i.__proto__=n),i.prototype=Object.create(n&&n.prototype),i.prototype.constructor=i,i.prototype.contains=function(s){for(var u=0,c=this.array_.length;u<c;u++)if(this.array_[u]===s)return!0;return!1},i.prototype.add=function(s){return!this.contains(s)&&(this.array_.push(s),!0)},i.prototype.addAll=function(s){for(var u=s.iterator();u.hasNext();)this.add(u.next());return!0},i.prototype.remove=function(s){throw new Error},i.prototype.size=function(){return this.array_.length},i.prototype.isEmpty=function(){return this.array_.length===0},i.prototype.toArray=function(){for(var s=[],u=0,c=this.array_.length;u<c;u++)s.push(this.array_[u]);return s},i.prototype.iterator=function(){return new gl(this)},i}(l),gl=function(n){function i(s){n.call(this),this.hashSet_=s,this.position_=0}return n&&(i.__proto__=n),i.prototype=Object.create(n&&n.prototype),i.prototype.constructor=i,i.prototype.next=function(){if(this.position_===this.hashSet_.size())throw new o;return this.hashSet_.array_[this.position_++]},i.prototype.hasNext=function(){return this.position_<this.hashSet_.size()},i.prototype.remove=function(){throw new a},i}(Y),hi=0;(_.prototype=new Si).get=function(n){for(var i=this.root_;i!==null;){var s=n.compareTo(i.key);if(s<0)i=i.left;else{if(!(s>0))return i.value;i=i.right}}return null},_.prototype.put=function(n,i){if(this.root_===null)return this.root_={key:n,value:i,left:null,right:null,parent:null,color:hi,getValue:function(){return this.value},getKey:function(){return this.key}},this.size_=1,null;var s,u,c=this.root_;do if(s=c,(u=n.compareTo(c.key))<0)c=c.left;else{if(!(u>0)){var m=c.value;return c.value=i,m}c=c.right}while(c!==null);var E={key:n,left:null,right:null,value:i,parent:s,color:hi,getValue:function(){return this.value},getKey:function(){return this.key}};return u<0?s.left=E:s.right=E,this.fixAfterInsertion(E),this.size_++,null},_.prototype.fixAfterInsertion=function(n){for(n.color=1;n!=null&&n!==this.root_&&n.parent.color===1;)if(h(n)===d(h(h(n)))){var i=g(h(h(n)));f(i)===1?(p(h(n),hi),p(i,hi),p(h(h(n)),1),n=h(h(n))):(n===g(h(n))&&(n=h(n),this.rotateLeft(n)),p(h(n),hi),p(h(h(n)),1),this.rotateRight(h(h(n))))}else{var s=d(h(h(n)));f(s)===1?(p(h(n),hi),p(s,hi),p(h(h(n)),1),n=h(h(n))):(n===d(h(n))&&(n=h(n),this.rotateRight(n)),p(h(n),hi),p(h(h(n)),1),this.rotateLeft(h(h(n))))}this.root_.color=hi},_.prototype.values=function(){var n=new j,i=this.getFirstEntry();if(i!==null)for(n.add(i.value);(i=_.successor(i))!==null;)n.add(i.value);return n},_.prototype.entrySet=function(){var n=new $n,i=this.getFirstEntry();if(i!==null)for(n.add(i);(i=_.successor(i))!==null;)n.add(i);return n},_.prototype.rotateLeft=function(n){if(n!=null){var i=n.right;n.right=i.left,i.left!=null&&(i.left.parent=n),i.parent=n.parent,n.parent===null?this.root_=i:n.parent.left===n?n.parent.left=i:n.parent.right=i,i.left=n,n.parent=i}},_.prototype.rotateRight=function(n){if(n!=null){var i=n.left;n.left=i.right,i.right!=null&&(i.right.parent=n),i.parent=n.parent,n.parent===null?this.root_=i:n.parent.right===n?n.parent.right=i:n.parent.left=i,i.right=n,n.parent=i}},_.prototype.getFirstEntry=function(){var n=this.root_;if(n!=null)for(;n.left!=null;)n=n.left;return n},_.successor=function(n){if(n===null)return null;if(n.right!==null){for(var i=n.right;i.left!==null;)i=i.left;return i}for(var s=n.parent,u=n;s!==null&&u===s.right;)u=s,s=s.parent;return s},_.prototype.size=function(){return this.size_};var As=function(){};As.prototype.interfaces_=function(){return[]},As.prototype.getClass=function(){return As},y.prototype=new l,(M.prototype=new y).contains=function(n){for(var i=0,s=this.array_.length;i<s;i++)if(this.array_[i].compareTo(n)===0)return!0;return!1},M.prototype.add=function(n){if(this.contains(n))return!1;for(var i=0,s=this.array_.length;i<s;i++)if(this.array_[i].compareTo(n)===1)return this.array_.splice(i,0,n),!0;return this.array_.push(n),!0},M.prototype.addAll=function(n){for(var i=n.iterator();i.hasNext();)this.add(i.next());return!0},M.prototype.remove=function(n){throw new a},M.prototype.size=function(){return this.array_.length},M.prototype.isEmpty=function(){return this.array_.length===0},M.prototype.toArray=function(){for(var n=[],i=0,s=this.array_.length;i<s;i++)n.push(this.array_[i]);return n},M.prototype.iterator=function(){return new Mo(this)};var Mo=function(n){this.treeSet_=n,this.position_=0};Mo.prototype.next=function(){if(this.position_===this.treeSet_.size())throw new o;return this.treeSet_.array_[this.position_++]},Mo.prototype.hasNext=function(){return this.position_<this.treeSet_.size()},Mo.prototype.remove=function(){throw new a};var Bi=function(){};Bi.sort=function(){var n,i,s,u,c=arguments[0];if(arguments.length===1)u=function(E,A){return E.compareTo(A)},c.sort(u);else if(arguments.length===2)s=arguments[1],u=function(E,A){return s.compare(E,A)},c.sort(u);else if(arguments.length===3){(i=c.slice(arguments[1],arguments[2])).sort();var m=c.slice(0,arguments[1]).concat(i,c.slice(arguments[2],c.length));for(c.splice(0,c.length),n=0;n<m.length;n++)c.push(m[n])}else if(arguments.length===4)for(i=c.slice(arguments[1],arguments[2]),s=arguments[3],u=function(E,A){return s.compare(E,A)},i.sort(u),m=c.slice(0,arguments[1]).concat(i,c.slice(arguments[2],c.length)),c.splice(0,c.length),n=0;n<m.length;n++)c.push(m[n])},Bi.asList=function(n){for(var i=new j,s=0,u=n.length;s<u;s++)i.add(n[s]);return i};var pe=function(){},Rr={P:{configurable:!0},L:{configurable:!0},A:{configurable:!0},FALSE:{configurable:!0},TRUE:{configurable:!0},DONTCARE:{configurable:!0},SYM_FALSE:{configurable:!0},SYM_TRUE:{configurable:!0},SYM_DONTCARE:{configurable:!0},SYM_P:{configurable:!0},SYM_L:{configurable:!0},SYM_A:{configurable:!0}};Rr.P.get=function(){return 0},Rr.L.get=function(){return 1},Rr.A.get=function(){return 2},Rr.FALSE.get=function(){return-1},Rr.TRUE.get=function(){return-2},Rr.DONTCARE.get=function(){return-3},Rr.SYM_FALSE.get=function(){return"F"},Rr.SYM_TRUE.get=function(){return"T"},Rr.SYM_DONTCARE.get=function(){return"*"},Rr.SYM_P.get=function(){return"0"},Rr.SYM_L.get=function(){return"1"},Rr.SYM_A.get=function(){return"2"},pe.prototype.interfaces_=function(){return[]},pe.prototype.getClass=function(){return pe},pe.toDimensionSymbol=function(n){switch(n){case pe.FALSE:return pe.SYM_FALSE;case pe.TRUE:return pe.SYM_TRUE;case pe.DONTCARE:return pe.SYM_DONTCARE;case pe.P:return pe.SYM_P;case pe.L:return pe.SYM_L;case pe.A:return pe.SYM_A}throw new C("Unknown dimension value: "+n)},pe.toDimensionValue=function(n){switch(ot.toUpperCase(n)){case pe.SYM_FALSE:return pe.FALSE;case pe.SYM_TRUE:return pe.TRUE;case pe.SYM_DONTCARE:return pe.DONTCARE;case pe.SYM_P:return pe.P;case pe.SYM_L:return pe.L;case pe.SYM_A:return pe.A}throw new C("Unknown dimension symbol: "+n)},Object.defineProperties(pe,Rr);var ei=function(){};ei.prototype.filter=function(n){},ei.prototype.interfaces_=function(){return[]},ei.prototype.getClass=function(){return ei};var Vr=function(){};Vr.prototype.filter=function(n,i){},Vr.prototype.isDone=function(){},Vr.prototype.isGeometryChanged=function(){},Vr.prototype.interfaces_=function(){return[]},Vr.prototype.getClass=function(){return Vr};var Vn=function(n){function i(u,c){if(n.call(this,c),this._geometries=u||[],n.hasNullElements(this._geometries))throw new C("geometries must not contain null elements")}n&&(i.__proto__=n),(i.prototype=Object.create(n&&n.prototype)).constructor=i;var s={serialVersionUID:{configurable:!0}};return i.prototype.computeEnvelopeInternal=function(){for(var u=new Pt,c=0;c<this._geometries.length;c++)u.expandToInclude(this._geometries[c].getEnvelopeInternal());return u},i.prototype.getGeometryN=function(u){return this._geometries[u]},i.prototype.getSortIndex=function(){return n.SORTINDEX_GEOMETRYCOLLECTION},i.prototype.getCoordinates=function(){for(var u=new Array(this.getNumPoints()).fill(null),c=-1,m=0;m<this._geometries.length;m++)for(var E=this._geometries[m].getCoordinates(),A=0;A<E.length;A++)u[++c]=E[A];return u},i.prototype.getArea=function(){for(var u=0,c=0;c<this._geometries.length;c++)u+=this._geometries[c].getArea();return u},i.prototype.equalsExact=function(){if(arguments.length===2){var u=arguments[0],c=arguments[1];if(!this.isEquivalentClass(u))return!1;var m=u;if(this._geometries.length!==m._geometries.length)return!1;for(var E=0;E<this._geometries.length;E++)if(!this._geometries[E].equalsExact(m._geometries[E],c))return!1;return!0}return n.prototype.equalsExact.apply(this,arguments)},i.prototype.normalize=function(){for(var u=0;u<this._geometries.length;u++)this._geometries[u].normalize();Bi.sort(this._geometries)},i.prototype.getCoordinate=function(){return this.isEmpty()?null:this._geometries[0].getCoordinate()},i.prototype.getBoundaryDimension=function(){for(var u=pe.FALSE,c=0;c<this._geometries.length;c++)u=Math.max(u,this._geometries[c].getBoundaryDimension());return u},i.prototype.getDimension=function(){for(var u=pe.FALSE,c=0;c<this._geometries.length;c++)u=Math.max(u,this._geometries[c].getDimension());return u},i.prototype.getLength=function(){for(var u=0,c=0;c<this._geometries.length;c++)u+=this._geometries[c].getLength();return u},i.prototype.getNumPoints=function(){for(var u=0,c=0;c<this._geometries.length;c++)u+=this._geometries[c].getNumPoints();return u},i.prototype.getNumGeometries=function(){return this._geometries.length},i.prototype.reverse=function(){for(var u=this._geometries.length,c=new Array(u).fill(null),m=0;m<this._geometries.length;m++)c[m]=this._geometries[m].reverse();return this.getFactory().createGeometryCollection(c)},i.prototype.compareToSameClass=function(){if(arguments.length===1){var u=arguments[0],c=new M(Bi.asList(this._geometries)),m=new M(Bi.asList(u._geometries));return this.compare(c,m)}if(arguments.length===2){for(var E=arguments[0],A=arguments[1],U=E,Z=this.getNumGeometries(),ut=U.getNumGeometries(),ht=0;ht<Z&&ht<ut;){var At=this.getGeometryN(ht),Rt=U.getGeometryN(ht),kt=At.compareToSameClass(Rt,A);if(kt!==0)return kt;ht++}return ht<Z?1:ht<ut?-1:0}},i.prototype.apply=function(){if(X(arguments[0],Mt))for(var u=arguments[0],c=0;c<this._geometries.length;c++)this._geometries[c].apply(u);else if(X(arguments[0],Vr)){var m=arguments[0];if(this._geometries.length===0)return null;for(var E=0;E<this._geometries.length&&(this._geometries[E].apply(m),!m.isDone());E++);m.isGeometryChanged()&&this.geometryChanged()}else if(X(arguments[0],ei)){var A=arguments[0];A.filter(this);for(var U=0;U<this._geometries.length;U++)this._geometries[U].apply(A)}else if(X(arguments[0],ct)){var Z=arguments[0];Z.filter(this);for(var ut=0;ut<this._geometries.length;ut++)this._geometries[ut].apply(Z)}},i.prototype.getBoundary=function(){return this.checkNotGeometryCollection(this),b.shouldNeverReachHere(),null},i.prototype.clone=function(){var u=n.prototype.clone.call(this);u._geometries=new Array(this._geometries.length).fill(null);for(var c=0;c<this._geometries.length;c++)u._geometries[c]=this._geometries[c].clone();return u},i.prototype.getGeometryType=function(){return"GeometryCollection"},i.prototype.copy=function(){for(var u=new Array(this._geometries.length).fill(null),c=0;c<u.length;c++)u[c]=this._geometries[c].copy();return new i(u,this._factory)},i.prototype.isEmpty=function(){for(var u=0;u<this._geometries.length;u++)if(!this._geometries[u].isEmpty())return!1;return!0},i.prototype.interfaces_=function(){return[]},i.prototype.getClass=function(){return i},s.serialVersionUID.get=function(){return-5694727726395021e3},Object.defineProperties(i,s),i}(Q),H=function(n){function i(){n.apply(this,arguments)}n&&(i.__proto__=n),(i.prototype=Object.create(n&&n.prototype)).constructor=i;var s={serialVersionUID:{configurable:!0}};return i.prototype.getSortIndex=function(){return Q.SORTINDEX_MULTILINESTRING},i.prototype.equalsExact=function(){if(arguments.length===2){var u=arguments[0],c=arguments[1];return!!this.isEquivalentClass(u)&&n.prototype.equalsExact.call(this,u,c)}return n.prototype.equalsExact.apply(this,arguments)},i.prototype.getBoundaryDimension=function(){return this.isClosed()?pe.FALSE:0},i.prototype.isClosed=function(){if(this.isEmpty())return!1;for(var u=0;u<this._geometries.length;u++)if(!this._geometries[u].isClosed())return!1;return!0},i.prototype.getDimension=function(){return 1},i.prototype.reverse=function(){for(var u=this._geometries.length,c=new Array(u).fill(null),m=0;m<this._geometries.length;m++)c[u-1-m]=this._geometries[m].reverse();return this.getFactory().createMultiLineString(c)},i.prototype.getBoundary=function(){return new rt(this).getBoundary()},i.prototype.getGeometryType=function(){return"MultiLineString"},i.prototype.copy=function(){for(var u=new Array(this._geometries.length).fill(null),c=0;c<u.length;c++)u[c]=this._geometries[c].copy();return new i(u,this._factory)},i.prototype.interfaces_=function(){return[As]},i.prototype.getClass=function(){return i},s.serialVersionUID.get=function(){return 8166665132445434e3},Object.defineProperties(i,s),i}(Vn),rt=function(){if(this._geom=null,this._geomFact=null,this._bnRule=null,this._endpointMap=null,arguments.length===1){var n=arguments[0],i=Lt.MOD2_BOUNDARY_RULE;this._geom=n,this._geomFact=n.getFactory(),this._bnRule=i}else if(arguments.length===2){var s=arguments[0],u=arguments[1];this._geom=s,this._geomFact=s.getFactory(),this._bnRule=u}};rt.prototype.boundaryMultiLineString=function(n){if(this._geom.isEmpty())return this.getEmptyMultiPoint();var i=this.computeBoundaryCoordinates(n);return i.length===1?this._geomFact.createPoint(i[0]):this._geomFact.createMultiPointFromCoords(i)},rt.prototype.getBoundary=function(){return this._geom instanceof Bt?this.boundaryLineString(this._geom):this._geom instanceof H?this.boundaryMultiLineString(this._geom):this._geom.getBoundary()},rt.prototype.boundaryLineString=function(n){return this._geom.isEmpty()?this.getEmptyMultiPoint():n.isClosed()?this._bnRule.isInBoundary(2)?n.getStartPoint():this._geomFact.createMultiPoint():this._geomFact.createMultiPoint([n.getStartPoint(),n.getEndPoint()])},rt.prototype.getEmptyMultiPoint=function(){return this._geomFact.createMultiPoint()},rt.prototype.computeBoundaryCoordinates=function(n){var i=new j;this._endpointMap=new _;for(var s=0;s<n.getNumGeometries();s++){var u=n.getGeometryN(s);u.getNumPoints()!==0&&(this.addEndpoint(u.getCoordinateN(0)),this.addEndpoint(u.getCoordinateN(u.getNumPoints()-1)))}for(var c=this._endpointMap.entrySet().iterator();c.hasNext();){var m=c.next(),E=m.getValue().count;this._bnRule.isInBoundary(E)&&i.add(m.getKey())}return ft.toCoordinateArray(i)},rt.prototype.addEndpoint=function(n){var i=this._endpointMap.get(n);i===null&&(i=new gt,this._endpointMap.put(n,i)),i.count++},rt.prototype.interfaces_=function(){return[]},rt.prototype.getClass=function(){return rt},rt.getBoundary=function(){if(arguments.length===1){var n=arguments[0];return new rt(n).getBoundary()}if(arguments.length===2){var i=arguments[0],s=arguments[1];return new rt(i,s).getBoundary()}};var gt=function(){this.count=null};gt.prototype.interfaces_=function(){return[]},gt.prototype.getClass=function(){return gt};var st=function(){},yt={NEWLINE:{configurable:!0},SIMPLE_ORDINATE_FORMAT:{configurable:!0}};st.prototype.interfaces_=function(){return[]},st.prototype.getClass=function(){return st},st.chars=function(n,i){for(var s=new Array(i).fill(null),u=0;u<i;u++)s[u]=n;return String(s)},st.getStackTrace=function(){if(arguments.length===1){var n=arguments[0],i=new function(){},s=new function(){}(i);return n.printStackTrace(s),i.toString()}if(arguments.length===2){for(var u=arguments[0],c=arguments[1],m="",E=new function(){}(new function(){}(st.getStackTrace(u))),A=0;A<c;A++)try{m+=E.readLine()+st.NEWLINE}catch(U){if(!(U instanceof w))throw U;b.shouldNeverReachHere()}return m}},st.split=function(n,i){for(var s=i.length,u=new j,c=""+n,m=c.indexOf(i);m>=0;){var E=c.substring(0,m);u.add(E),m=(c=c.substring(m+s)).indexOf(i)}c.length>0&&u.add(c);for(var A=new Array(u.size()).fill(null),U=0;U<A.length;U++)A[U]=u.get(U);return A},st.toString=function(){if(arguments.length===1){var n=arguments[0];return st.SIMPLE_ORDINATE_FORMAT.format(n)}},st.spaces=function(n){return st.chars(" ",n)},yt.NEWLINE.get=function(){return Nt.getProperty("line.separator")},yt.SIMPLE_ORDINATE_FORMAT.get=function(){return new function(){}("0.#")},Object.defineProperties(st,yt);var It=function(){};It.prototype.interfaces_=function(){return[]},It.prototype.getClass=function(){return It},It.copyCoord=function(n,i,s,u){for(var c=Math.min(n.getDimension(),s.getDimension()),m=0;m<c;m++)s.setOrdinate(u,m,n.getOrdinate(i,m))},It.isRing=function(n){var i=n.size();return i===0||!(i<=3)&&n.getOrdinate(0,dt.X)===n.getOrdinate(i-1,dt.X)&&n.getOrdinate(0,dt.Y)===n.getOrdinate(i-1,dt.Y)},It.isEqual=function(n,i){var s=n.size();if(s!==i.size())return!1;for(var u=Math.min(n.getDimension(),i.getDimension()),c=0;c<s;c++)for(var m=0;m<u;m++){var E=n.getOrdinate(c,m),A=i.getOrdinate(c,m);if(n.getOrdinate(c,m)!==i.getOrdinate(c,m)&&(!S.isNaN(E)||!S.isNaN(A)))return!1}return!0},It.extend=function(n,i,s){var u=n.create(s,i.getDimension()),c=i.size();if(It.copy(i,0,u,0,c),c>0)for(var m=c;m<s;m++)It.copy(i,c-1,u,m,1);return u},It.reverse=function(n){for(var i=n.size()-1,s=Math.trunc(i/2),u=0;u<=s;u++)It.swap(n,u,i-u)},It.swap=function(n,i,s){if(i===s)return null;for(var u=0;u<n.getDimension();u++){var c=n.getOrdinate(i,u);n.setOrdinate(i,u,n.getOrdinate(s,u)),n.setOrdinate(s,u,c)}},It.copy=function(n,i,s,u,c){for(var m=0;m<c;m++)It.copyCoord(n,i+m,s,u+m)},It.toString=function(){if(arguments.length===1){var n=arguments[0],i=n.size();if(i===0)return"()";var s=n.getDimension(),u=new pt;u.append("(");for(var c=0;c<i;c++){c>0&&u.append(" ");for(var m=0;m<s;m++)m>0&&u.append(","),u.append(st.toString(n.getOrdinate(c,m)))}return u.append(")"),u.toString()}},It.ensureValidRing=function(n,i){var s=i.size();return s===0?i:s<=3?It.createClosedRing(n,i,4):i.getOrdinate(0,dt.X)===i.getOrdinate(s-1,dt.X)&&i.getOrdinate(0,dt.Y)===i.getOrdinate(s-1,dt.Y)?i:It.createClosedRing(n,i,s+1)},It.createClosedRing=function(n,i,s){var u=n.create(s,i.getDimension()),c=i.size();It.copy(i,0,u,0,c);for(var m=c;m<s;m++)It.copy(i,0,u,m,1);return u};var Bt=function(n){function i(u,c){n.call(this,c),this._points=null,this.init(u)}n&&(i.__proto__=n),(i.prototype=Object.create(n&&n.prototype)).constructor=i;var s={serialVersionUID:{configurable:!0}};return i.prototype.computeEnvelopeInternal=function(){return this.isEmpty()?new Pt:this._points.expandEnvelope(new Pt)},i.prototype.isRing=function(){return this.isClosed()&&this.isSimple()},i.prototype.getSortIndex=function(){return n.SORTINDEX_LINESTRING},i.prototype.getCoordinates=function(){return this._points.toCoordinateArray()},i.prototype.equalsExact=function(){if(arguments.length===2){var u=arguments[0],c=arguments[1];if(!this.isEquivalentClass(u))return!1;var m=u;if(this._points.size()!==m._points.size())return!1;for(var E=0;E<this._points.size();E++)if(!this.equal(this._points.getCoordinate(E),m._points.getCoordinate(E),c))return!1;return!0}return n.prototype.equalsExact.apply(this,arguments)},i.prototype.normalize=function(){for(var u=0;u<Math.trunc(this._points.size()/2);u++){var c=this._points.size()-1-u;if(!this._points.getCoordinate(u).equals(this._points.getCoordinate(c)))return this._points.getCoordinate(u).compareTo(this._points.getCoordinate(c))>0&&It.reverse(this._points),null}},i.prototype.getCoordinate=function(){return this.isEmpty()?null:this._points.getCoordinate(0)},i.prototype.getBoundaryDimension=function(){return this.isClosed()?pe.FALSE:0},i.prototype.isClosed=function(){return!this.isEmpty()&&this.getCoordinateN(0).equals2D(this.getCoordinateN(this.getNumPoints()-1))},i.prototype.getEndPoint=function(){return this.isEmpty()?null:this.getPointN(this.getNumPoints()-1)},i.prototype.getDimension=function(){return 1},i.prototype.getLength=function(){return B.computeLength(this._points)},i.prototype.getNumPoints=function(){return this._points.size()},i.prototype.reverse=function(){var u=this._points.copy();return It.reverse(u),this.getFactory().createLineString(u)},i.prototype.compareToSameClass=function(){if(arguments.length===1){for(var u=arguments[0],c=0,m=0;c<this._points.size()&&m<u._points.size();){var E=this._points.getCoordinate(c).compareTo(u._points.getCoordinate(m));if(E!==0)return E;c++,m++}return c<this._points.size()?1:m<u._points.size()?-1:0}if(arguments.length===2){var A=arguments[0];return arguments[1].compare(this._points,A._points)}},i.prototype.apply=function(){if(X(arguments[0],Mt))for(var u=arguments[0],c=0;c<this._points.size();c++)u.filter(this._points.getCoordinate(c));else if(X(arguments[0],Vr)){var m=arguments[0];if(this._points.size()===0)return null;for(var E=0;E<this._points.size()&&(m.filter(this._points,E),!m.isDone());E++);m.isGeometryChanged()&&this.geometryChanged()}else X(arguments[0],ei)?arguments[0].filter(this):X(arguments[0],ct)&&arguments[0].filter(this)},i.prototype.getBoundary=function(){return new rt(this).getBoundary()},i.prototype.isEquivalentClass=function(u){return u instanceof i},i.prototype.clone=function(){var u=n.prototype.clone.call(this);return u._points=this._points.clone(),u},i.prototype.getCoordinateN=function(u){return this._points.getCoordinate(u)},i.prototype.getGeometryType=function(){return"LineString"},i.prototype.copy=function(){return new i(this._points.copy(),this._factory)},i.prototype.getCoordinateSequence=function(){return this._points},i.prototype.isEmpty=function(){return this._points.size()===0},i.prototype.init=function(u){if(u===null&&(u=this.getFactory().getCoordinateSequenceFactory().create([])),u.size()===1)throw new C("Invalid number of points in LineString (found "+u.size()+" - must be 0 or >= 2)");this._points=u},i.prototype.isCoordinate=function(u){for(var c=0;c<this._points.size();c++)if(this._points.getCoordinate(c).equals(u))return!0;return!1},i.prototype.getStartPoint=function(){return this.isEmpty()?null:this.getPointN(0)},i.prototype.getPointN=function(u){return this.getFactory().createPoint(this._points.getCoordinate(u))},i.prototype.interfaces_=function(){return[As]},i.prototype.getClass=function(){return i},s.serialVersionUID.get=function(){return 0x2b2b51ba435c8e00},Object.defineProperties(i,s),i}(Q),se=function(){};se.prototype.interfaces_=function(){return[]},se.prototype.getClass=function(){return se};var Qt=function(n){function i(u,c){n.call(this,c),this._coordinates=u||null,this.init(this._coordinates)}n&&(i.__proto__=n),(i.prototype=Object.create(n&&n.prototype)).constructor=i;var s={serialVersionUID:{configurable:!0}};return i.prototype.computeEnvelopeInternal=function(){if(this.isEmpty())return new Pt;var u=new Pt;return u.expandToInclude(this._coordinates.getX(0),this._coordinates.getY(0)),u},i.prototype.getSortIndex=function(){return n.SORTINDEX_POINT},i.prototype.getCoordinates=function(){return this.isEmpty()?[]:[this.getCoordinate()]},i.prototype.equalsExact=function(){if(arguments.length===2){var u=arguments[0],c=arguments[1];return!!this.isEquivalentClass(u)&&(!(!this.isEmpty()||!u.isEmpty())||this.isEmpty()===u.isEmpty()&&this.equal(u.getCoordinate(),this.getCoordinate(),c))}return n.prototype.equalsExact.apply(this,arguments)},i.prototype.normalize=function(){},i.prototype.getCoordinate=function(){return this._coordinates.size()!==0?this._coordinates.getCoordinate(0):null},i.prototype.getBoundaryDimension=function(){return pe.FALSE},i.prototype.getDimension=function(){return 0},i.prototype.getNumPoints=function(){return this.isEmpty()?0:1},i.prototype.reverse=function(){return this.copy()},i.prototype.getX=function(){if(this.getCoordinate()===null)throw new Error("getX called on empty Point");return this.getCoordinate().x},i.prototype.compareToSameClass=function(){if(arguments.length===1){var u=arguments[0];return this.getCoordinate().compareTo(u.getCoordinate())}if(arguments.length===2){var c=arguments[0];return arguments[1].compare(this._coordinates,c._coordinates)}},i.prototype.apply=function(){if(X(arguments[0],Mt)){var u=arguments[0];if(this.isEmpty())return null;u.filter(this.getCoordinate())}else if(X(arguments[0],Vr)){var c=arguments[0];if(this.isEmpty())return null;c.filter(this._coordinates,0),c.isGeometryChanged()&&this.geometryChanged()}else X(arguments[0],ei)?arguments[0].filter(this):X(arguments[0],ct)&&arguments[0].filter(this)},i.prototype.getBoundary=function(){return this.getFactory().createGeometryCollection(null)},i.prototype.clone=function(){var u=n.prototype.clone.call(this);return u._coordinates=this._coordinates.clone(),u},i.prototype.getGeometryType=function(){return"Point"},i.prototype.copy=function(){return new i(this._coordinates.copy(),this._factory)},i.prototype.getCoordinateSequence=function(){return this._coordinates},i.prototype.getY=function(){if(this.getCoordinate()===null)throw new Error("getY called on empty Point");return this.getCoordinate().y},i.prototype.isEmpty=function(){return this._coordinates.size()===0},i.prototype.init=function(u){u===null&&(u=this.getFactory().getCoordinateSequenceFactory().create([])),b.isTrue(u.size()<=1),this._coordinates=u},i.prototype.isSimple=function(){return!0},i.prototype.interfaces_=function(){return[se]},i.prototype.getClass=function(){return i},s.serialVersionUID.get=function(){return 4902022702746615e3},Object.defineProperties(i,s),i}(Q),ce=function(){};ce.prototype.interfaces_=function(){return[]},ce.prototype.getClass=function(){return ce};var Vt=function(n){function i(u,c,m){if(n.call(this,m),this._shell=null,this._holes=null,u===null&&(u=this.getFactory().createLinearRing()),c===null&&(c=[]),n.hasNullElements(c))throw new C("holes must not contain null elements");if(u.isEmpty()&&n.hasNonEmptyElements(c))throw new C("shell is empty but holes are not");this._shell=u,this._holes=c}n&&(i.__proto__=n),(i.prototype=Object.create(n&&n.prototype)).constructor=i;var s={serialVersionUID:{configurable:!0}};return i.prototype.computeEnvelopeInternal=function(){return this._shell.getEnvelopeInternal()},i.prototype.getSortIndex=function(){return n.SORTINDEX_POLYGON},i.prototype.getCoordinates=function(){if(this.isEmpty())return[];for(var u=new Array(this.getNumPoints()).fill(null),c=-1,m=this._shell.getCoordinates(),E=0;E<m.length;E++)u[++c]=m[E];for(var A=0;A<this._holes.length;A++)for(var U=this._holes[A].getCoordinates(),Z=0;Z<U.length;Z++)u[++c]=U[Z];return u},i.prototype.getArea=function(){var u=0;u+=Math.abs(B.signedArea(this._shell.getCoordinateSequence()));for(var c=0;c<this._holes.length;c++)u-=Math.abs(B.signedArea(this._holes[c].getCoordinateSequence()));return u},i.prototype.isRectangle=function(){if(this.getNumInteriorRing()!==0||this._shell===null||this._shell.getNumPoints()!==5)return!1;for(var u=this._shell.getCoordinateSequence(),c=this.getEnvelopeInternal(),m=0;m<5;m++){var E=u.getX(m);if(E!==c.getMinX()&&E!==c.getMaxX())return!1;var A=u.getY(m);if(A!==c.getMinY()&&A!==c.getMaxY())return!1}for(var U=u.getX(0),Z=u.getY(0),ut=1;ut<=4;ut++){var ht=u.getX(ut),At=u.getY(ut);if(ht!==U==(At!==Z))return!1;U=ht,Z=At}return!0},i.prototype.equalsExact=function(){if(arguments.length===2){var u=arguments[0],c=arguments[1];if(!this.isEquivalentClass(u))return!1;var m=u,E=this._shell,A=m._shell;if(!E.equalsExact(A,c)||this._holes.length!==m._holes.length)return!1;for(var U=0;U<this._holes.length;U++)if(!this._holes[U].equalsExact(m._holes[U],c))return!1;return!0}return n.prototype.equalsExact.apply(this,arguments)},i.prototype.normalize=function(){if(arguments.length===0){this.normalize(this._shell,!0);for(var u=0;u<this._holes.length;u++)this.normalize(this._holes[u],!1);Bi.sort(this._holes)}else if(arguments.length===2){var c=arguments[0],m=arguments[1];if(c.isEmpty())return null;var E=new Array(c.getCoordinates().length-1).fill(null);Nt.arraycopy(c.getCoordinates(),0,E,0,E.length);var A=ft.minCoordinate(c.getCoordinates());ft.scroll(E,A),Nt.arraycopy(E,0,c.getCoordinates(),0,E.length),c.getCoordinates()[E.length]=E[0],B.isCCW(c.getCoordinates())===m&&ft.reverse(c.getCoordinates())}},i.prototype.getCoordinate=function(){return this._shell.getCoordinate()},i.prototype.getNumInteriorRing=function(){return this._holes.length},i.prototype.getBoundaryDimension=function(){return 1},i.prototype.getDimension=function(){return 2},i.prototype.getLength=function(){var u=0;u+=this._shell.getLength();for(var c=0;c<this._holes.length;c++)u+=this._holes[c].getLength();return u},i.prototype.getNumPoints=function(){for(var u=this._shell.getNumPoints(),c=0;c<this._holes.length;c++)u+=this._holes[c].getNumPoints();return u},i.prototype.reverse=function(){var u=this.copy();u._shell=this._shell.copy().reverse(),u._holes=new Array(this._holes.length).fill(null);for(var c=0;c<this._holes.length;c++)u._holes[c]=this._holes[c].copy().reverse();return u},i.prototype.convexHull=function(){return this.getExteriorRing().convexHull()},i.prototype.compareToSameClass=function(){if(arguments.length===1){var u=arguments[0],c=this._shell,m=u._shell;return c.compareToSameClass(m)}if(arguments.length===2){var E=arguments[0],A=arguments[1],U=E,Z=this._shell,ut=U._shell,ht=Z.compareToSameClass(ut,A);if(ht!==0)return ht;for(var At=this.getNumInteriorRing(),Rt=U.getNumInteriorRing(),kt=0;kt<At&&kt<Rt;){var ee=this.getInteriorRingN(kt),on=U.getInteriorRingN(kt),In=ee.compareToSameClass(on,A);if(In!==0)return In;kt++}return kt<At?1:kt<Rt?-1:0}},i.prototype.apply=function(u){if(X(u,Mt)){this._shell.apply(u);for(var c=0;c<this._holes.length;c++)this._holes[c].apply(u)}else if(X(u,Vr)){if(this._shell.apply(u),!u.isDone())for(var m=0;m<this._holes.length&&(this._holes[m].apply(u),!u.isDone());m++);u.isGeometryChanged()&&this.geometryChanged()}else if(X(u,ei))u.filter(this);else if(X(u,ct)){u.filter(this),this._shell.apply(u);for(var E=0;E<this._holes.length;E++)this._holes[E].apply(u)}},i.prototype.getBoundary=function(){if(this.isEmpty())return this.getFactory().createMultiLineString();var u=new Array(this._holes.length+1).fill(null);u[0]=this._shell;for(var c=0;c<this._holes.length;c++)u[c+1]=this._holes[c];return u.length<=1?this.getFactory().createLinearRing(u[0].getCoordinateSequence()):this.getFactory().createMultiLineString(u)},i.prototype.clone=function(){var u=n.prototype.clone.call(this);u._shell=this._shell.clone(),u._holes=new Array(this._holes.length).fill(null);for(var c=0;c<this._holes.length;c++)u._holes[c]=this._holes[c].clone();return u},i.prototype.getGeometryType=function(){return"Polygon"},i.prototype.copy=function(){for(var u=this._shell.copy(),c=new Array(this._holes.length).fill(null),m=0;m<c.length;m++)c[m]=this._holes[m].copy();return new i(u,c,this._factory)},i.prototype.getExteriorRing=function(){return this._shell},i.prototype.isEmpty=function(){return this._shell.isEmpty()},i.prototype.getInteriorRingN=function(u){return this._holes[u]},i.prototype.interfaces_=function(){return[ce]},i.prototype.getClass=function(){return i},s.serialVersionUID.get=function(){return-0x307ffefd8dc97200},Object.defineProperties(i,s),i}(Q),fe=function(n){function i(){n.apply(this,arguments)}n&&(i.__proto__=n),(i.prototype=Object.create(n&&n.prototype)).constructor=i;var s={serialVersionUID:{configurable:!0}};return i.prototype.getSortIndex=function(){return Q.SORTINDEX_MULTIPOINT},i.prototype.isValid=function(){return!0},i.prototype.equalsExact=function(){if(arguments.length===2){var u=arguments[0],c=arguments[1];return!!this.isEquivalentClass(u)&&n.prototype.equalsExact.call(this,u,c)}return n.prototype.equalsExact.apply(this,arguments)},i.prototype.getCoordinate=function(){if(arguments.length===1){var u=arguments[0];return this._geometries[u].getCoordinate()}return n.prototype.getCoordinate.apply(this,arguments)},i.prototype.getBoundaryDimension=function(){return pe.FALSE},i.prototype.getDimension=function(){return 0},i.prototype.getBoundary=function(){return this.getFactory().createGeometryCollection(null)},i.prototype.getGeometryType=function(){return"MultiPoint"},i.prototype.copy=function(){for(var u=new Array(this._geometries.length).fill(null),c=0;c<u.length;c++)u[c]=this._geometries[c].copy();return new i(u,this._factory)},i.prototype.interfaces_=function(){return[se]},i.prototype.getClass=function(){return i},s.serialVersionUID.get=function(){return-8048474874175356e3},Object.defineProperties(i,s),i}(Vn),sn=function(n){function i(u,c){u instanceof L&&c instanceof le&&(u=c.getCoordinateSequenceFactory().create(u)),n.call(this,u,c),this.validateConstruction()}n&&(i.__proto__=n),(i.prototype=Object.create(n&&n.prototype)).constructor=i;var s={MINIMUM_VALID_SIZE:{configurable:!0},serialVersionUID:{configurable:!0}};return i.prototype.getSortIndex=function(){return Q.SORTINDEX_LINEARRING},i.prototype.getBoundaryDimension=function(){return pe.FALSE},i.prototype.isClosed=function(){return!!this.isEmpty()||n.prototype.isClosed.call(this)},i.prototype.reverse=function(){var u=this._points.copy();return It.reverse(u),this.getFactory().createLinearRing(u)},i.prototype.validateConstruction=function(){if(!this.isEmpty()&&!n.prototype.isClosed.call(this))throw new C("Points of LinearRing do not form a closed linestring");if(this.getCoordinateSequence().size()>=1&&this.getCoordinateSequence().size()<i.MINIMUM_VALID_SIZE)throw new C("Invalid number of points in LinearRing (found "+this.getCoordinateSequence().size()+" - must be 0 or >= 4)")},i.prototype.getGeometryType=function(){return"LinearRing"},i.prototype.copy=function(){return new i(this._points.copy(),this._factory)},i.prototype.interfaces_=function(){return[]},i.prototype.getClass=function(){return i},s.MINIMUM_VALID_SIZE.get=function(){return 4},s.serialVersionUID.get=function(){return-0x3b229e262367a600},Object.defineProperties(i,s),i}(Bt),un=function(n){function i(){n.apply(this,arguments)}n&&(i.__proto__=n),(i.prototype=Object.create(n&&n.prototype)).constructor=i;var s={serialVersionUID:{configurable:!0}};return i.prototype.getSortIndex=function(){return Q.SORTINDEX_MULTIPOLYGON},i.prototype.equalsExact=function(){if(arguments.length===2){var u=arguments[0],c=arguments[1];return!!this.isEquivalentClass(u)&&n.prototype.equalsExact.call(this,u,c)}return n.prototype.equalsExact.apply(this,arguments)},i.prototype.getBoundaryDimension=function(){return 1},i.prototype.getDimension=function(){return 2},i.prototype.reverse=function(){for(var u=this._geometries.length,c=new Array(u).fill(null),m=0;m<this._geometries.length;m++)c[m]=this._geometries[m].reverse();return this.getFactory().createMultiPolygon(c)},i.prototype.getBoundary=function(){if(this.isEmpty())return this.getFactory().createMultiLineString();for(var u=new j,c=0;c<this._geometries.length;c++)for(var m=this._geometries[c].getBoundary(),E=0;E<m.getNumGeometries();E++)u.add(m.getGeometryN(E));var A=new Array(u.size()).fill(null);return this.getFactory().createMultiLineString(u.toArray(A))},i.prototype.getGeometryType=function(){return"MultiPolygon"},i.prototype.copy=function(){for(var u=new Array(this._geometries.length).fill(null),c=0;c<u.length;c++)u[c]=this._geometries[c].copy();return new i(u,this._factory)},i.prototype.interfaces_=function(){return[ce]},i.prototype.getClass=function(){return i},s.serialVersionUID.get=function(){return-0x7a5aa1369171980},Object.defineProperties(i,s),i}(Vn),vn=function(n){this._factory=n||null,this._isUserDataCopied=!1},ni={NoOpGeometryOperation:{configurable:!0},CoordinateOperation:{configurable:!0},CoordinateSequenceOperation:{configurable:!0}};vn.prototype.setCopyUserData=function(n){this._isUserDataCopied=n},vn.prototype.edit=function(n,i){if(n===null)return null;var s=this.editInternal(n,i);return this._isUserDataCopied&&s.setUserData(n.getUserData()),s},vn.prototype.editInternal=function(n,i){return this._factory===null&&(this._factory=n.getFactory()),n instanceof Vn?this.editGeometryCollection(n,i):n instanceof Vt?this.editPolygon(n,i):n instanceof Qt?i.edit(n,this._factory):n instanceof Bt?i.edit(n,this._factory):(b.shouldNeverReachHere("Unsupported Geometry class: "+n.getClass().getName()),null)},vn.prototype.editGeometryCollection=function(n,i){for(var s=i.edit(n,this._factory),u=new j,c=0;c<s.getNumGeometries();c++){var m=this.edit(s.getGeometryN(c),i);m===null||m.isEmpty()||u.add(m)}return s.getClass()===fe?this._factory.createMultiPoint(u.toArray([])):s.getClass()===H?this._factory.createMultiLineString(u.toArray([])):s.getClass()===un?this._factory.createMultiPolygon(u.toArray([])):this._factory.createGeometryCollection(u.toArray([]))},vn.prototype.editPolygon=function(n,i){var s=i.edit(n,this._factory);if(s===null&&(s=this._factory.createPolygon(null)),s.isEmpty())return s;var u=this.edit(s.getExteriorRing(),i);if(u===null||u.isEmpty())return this._factory.createPolygon();for(var c=new j,m=0;m<s.getNumInteriorRing();m++){var E=this.edit(s.getInteriorRingN(m),i);E===null||E.isEmpty()||c.add(E)}return this._factory.createPolygon(u,c.toArray([]))},vn.prototype.interfaces_=function(){return[]},vn.prototype.getClass=function(){return vn},vn.GeometryEditorOperation=function(){},ni.NoOpGeometryOperation.get=function(){return En},ni.CoordinateOperation.get=function(){return de},ni.CoordinateSequenceOperation.get=function(){return So},Object.defineProperties(vn,ni);var En=function(){};En.prototype.edit=function(n,i){return n},En.prototype.interfaces_=function(){return[vn.GeometryEditorOperation]},En.prototype.getClass=function(){return En};var de=function(){};de.prototype.edit=function(n,i){var s=this.editCoordinates(n.getCoordinates(),n);return s===null?n:n instanceof sn?i.createLinearRing(s):n instanceof Bt?i.createLineString(s):n instanceof Qt?s.length>0?i.createPoint(s[0]):i.createPoint():n},de.prototype.interfaces_=function(){return[vn.GeometryEditorOperation]},de.prototype.getClass=function(){return de};var So=function(){};So.prototype.edit=function(n,i){return n instanceof sn?i.createLinearRing(this.edit(n.getCoordinateSequence(),n)):n instanceof Bt?i.createLineString(this.edit(n.getCoordinateSequence(),n)):n instanceof Qt?i.createPoint(this.edit(n.getCoordinateSequence(),n)):n},So.prototype.interfaces_=function(){return[vn.GeometryEditorOperation]},So.prototype.getClass=function(){return So};var he=function(){if(this._dimension=3,this._coordinates=null,arguments.length===1){if(arguments[0]instanceof Array)this._coordinates=arguments[0],this._dimension=3;else if(Number.isInteger(arguments[0])){var n=arguments[0];this._coordinates=new Array(n).fill(null);for(var i=0;i<n;i++)this._coordinates[i]=new L}else if(X(arguments[0],dt)){var s=arguments[0];if(s===null)return this._coordinates=new Array(0).fill(null),null;this._dimension=s.getDimension(),this._coordinates=new Array(s.size()).fill(null);for(var u=0;u<this._coordinates.length;u++)this._coordinates[u]=s.getCoordinateCopy(u)}}else if(arguments.length===2){if(arguments[0]instanceof Array&&Number.isInteger(arguments[1])){var c=arguments[0],m=arguments[1];this._coordinates=c,this._dimension=m,c===null&&(this._coordinates=new Array(0).fill(null))}else if(Number.isInteger(arguments[0])&&Number.isInteger(arguments[1])){var E=arguments[0],A=arguments[1];this._coordinates=new Array(E).fill(null),this._dimension=A;for(var U=0;U<E;U++)this._coordinates[U]=new L}}},io={serialVersionUID:{configurable:!0}};he.prototype.setOrdinate=function(n,i,s){switch(i){case dt.X:this._coordinates[n].x=s;break;case dt.Y:this._coordinates[n].y=s;break;case dt.Z:this._coordinates[n].z=s;break;default:throw new C("invalid ordinateIndex")}},he.prototype.size=function(){return this._coordinates.length},he.prototype.getOrdinate=function(n,i){switch(i){case dt.X:return this._coordinates[n].x;case dt.Y:return this._coordinates[n].y;case dt.Z:return this._coordinates[n].z}return S.NaN},he.prototype.getCoordinate=function(){if(arguments.length===1){var n=arguments[0];return this._coordinates[n]}if(arguments.length===2){var i=arguments[0],s=arguments[1];s.x=this._coordinates[i].x,s.y=this._coordinates[i].y,s.z=this._coordinates[i].z}},he.prototype.getCoordinateCopy=function(n){return new L(this._coordinates[n])},he.prototype.getDimension=function(){return this._dimension},he.prototype.getX=function(n){return this._coordinates[n].x},he.prototype.clone=function(){for(var n=new Array(this.size()).fill(null),i=0;i<this._coordinates.length;i++)n[i]=this._coordinates[i].clone();return new he(n,this._dimension)},he.prototype.expandEnvelope=function(n){for(var i=0;i<this._coordinates.length;i++)n.expandToInclude(this._coordinates[i]);return n},he.prototype.copy=function(){for(var n=new Array(this.size()).fill(null),i=0;i<this._coordinates.length;i++)n[i]=this._coordinates[i].copy();return new he(n,this._dimension)},he.prototype.toString=function(){if(this._coordinates.length>0){var n=new pt(17*this._coordinates.length);n.append("("),n.append(this._coordinates[0]);for(var i=1;i<this._coordinates.length;i++)n.append(", "),n.append(this._coordinates[i]);return n.append(")"),n.toString()}return"()"},he.prototype.getY=function(n){return this._coordinates[n].y},he.prototype.toCoordinateArray=function(){return this._coordinates},he.prototype.interfaces_=function(){return[dt,t]},he.prototype.getClass=function(){return he},io.serialVersionUID.get=function(){return-0xcb44a778db18e00},Object.defineProperties(he,io);var ri=function(){},wo={serialVersionUID:{configurable:!0},instanceObject:{configurable:!0}};ri.prototype.readResolve=function(){return ri.instance()},ri.prototype.create=function(){if(arguments.length===1){if(arguments[0]instanceof Array){var n=arguments[0];return new he(n)}if(X(arguments[0],dt)){var i=arguments[0];return new he(i)}}else if(arguments.length===2){var s=arguments[0],u=arguments[1];return u>3&&(u=3),u<2?new he(s):new he(s,u)}},ri.prototype.interfaces_=function(){return[nt,t]},ri.prototype.getClass=function(){return ri},ri.instance=function(){return ri.instanceObject},wo.serialVersionUID.get=function(){return-0x38e49fa6cf6f2e00},wo.instanceObject.get=function(){return new ri},Object.defineProperties(ri,wo);var aa=function(n){function i(){n.call(this),this.map_=new Map}return n&&(i.__proto__=n),i.prototype=Object.create(n&&n.prototype),i.prototype.constructor=i,i.prototype.get=function(s){return this.map_.get(s)||null},i.prototype.put=function(s,u){return this.map_.set(s,u),u},i.prototype.values=function(){for(var s=new j,u=this.map_.values(),c=u.next();!c.done;)s.add(c.value),c=u.next();return s},i.prototype.entrySet=function(){var s=new $n;return this.map_.entries().forEach(function(u){return s.add(u)}),s},i.prototype.size=function(){return this.map_.size()},i}(He),ie=function n(){if(this._modelType=null,this._scale=null,arguments.length===0)this._modelType=n.FLOATING;else if(arguments.length===1){if(arguments[0]instanceof Lr){var i=arguments[0];this._modelType=i,i===n.FIXED&&this.setScale(1)}else if(typeof arguments[0]=="number"){var s=arguments[0];this._modelType=n.FIXED,this.setScale(s)}else if(arguments[0]instanceof n){var u=arguments[0];this._modelType=u._modelType,this._scale=u._scale}}},zi={serialVersionUID:{configurable:!0},maximumPreciseValue:{configurable:!0}};ie.prototype.equals=function(n){if(!(n instanceof ie))return!1;var i=n;return this._modelType===i._modelType&&this._scale===i._scale},ie.prototype.compareTo=function(n){var i=n,s=this.getMaximumSignificantDigits(),u=i.getMaximumSignificantDigits();return new et(s).compareTo(new et(u))},ie.prototype.getScale=function(){return this._scale},ie.prototype.isFloating=function(){return this._modelType===ie.FLOATING||this._modelType===ie.FLOATING_SINGLE},ie.prototype.getType=function(){return this._modelType},ie.prototype.toString=function(){var n="UNKNOWN";return this._modelType===ie.FLOATING?n="Floating":this._modelType===ie.FLOATING_SINGLE?n="Floating-Single":this._modelType===ie.FIXED&&(n="Fixed (Scale="+this.getScale()+")"),n},ie.prototype.makePrecise=function(){if(typeof arguments[0]=="number"){var n=arguments[0];return S.isNaN(n)||this._modelType===ie.FLOATING_SINGLE?n:this._modelType===ie.FIXED?Math.round(n*this._scale)/this._scale:n}if(arguments[0]instanceof L){var i=arguments[0];if(this._modelType===ie.FLOATING)return null;i.x=this.makePrecise(i.x),i.y=this.makePrecise(i.y)}},ie.prototype.getMaximumSignificantDigits=function(){var n=16;return this._modelType===ie.FLOATING?n=16:this._modelType===ie.FLOATING_SINGLE?n=6:this._modelType===ie.FIXED&&(n=1+Math.trunc(Math.ceil(Math.log(this.getScale())/Math.log(10)))),n},ie.prototype.setScale=function(n){this._scale=Math.abs(n)},ie.prototype.interfaces_=function(){return[t,F]},ie.prototype.getClass=function(){return ie},ie.mostPrecise=function(n,i){return n.compareTo(i)>=0?n:i},zi.serialVersionUID.get=function(){return 7777263578777804e3},zi.maximumPreciseValue.get=function(){return 9007199254740992},Object.defineProperties(ie,zi);var Lr=function n(i){this._name=i||null,n.nameToTypeMap.put(i,this)},xr={serialVersionUID:{configurable:!0},nameToTypeMap:{configurable:!0}};Lr.prototype.readResolve=function(){return Lr.nameToTypeMap.get(this._name)},Lr.prototype.toString=function(){return this._name},Lr.prototype.interfaces_=function(){return[t]},Lr.prototype.getClass=function(){return Lr},xr.serialVersionUID.get=function(){return-552860263173159e4},xr.nameToTypeMap.get=function(){return new aa},Object.defineProperties(Lr,xr),ie.Type=Lr,ie.FIXED=new Lr("FIXED"),ie.FLOATING=new Lr("FLOATING"),ie.FLOATING_SINGLE=new Lr("FLOATING SINGLE");var le=function n(){this._precisionModel=new ie,this._SRID=0,this._coordinateSequenceFactory=n.getDefaultCoordinateSequenceFactory(),arguments.length===0||(arguments.length===1?X(arguments[0],nt)?this._coordinateSequenceFactory=arguments[0]:arguments[0]instanceof ie&&(this._precisionModel=arguments[0]):arguments.length===2?(this._precisionModel=arguments[0],this._SRID=arguments[1]):arguments.length===3&&(this._precisionModel=arguments[0],this._SRID=arguments[1],this._coordinateSequenceFactory=arguments[2]))},yl={serialVersionUID:{configurable:!0}};le.prototype.toGeometry=function(n){return n.isNull()?this.createPoint(null):n.getMinX()===n.getMaxX()&&n.getMinY()===n.getMaxY()?this.createPoint(new L(n.getMinX(),n.getMinY())):n.getMinX()===n.getMaxX()||n.getMinY()===n.getMaxY()?this.createLineString([new L(n.getMinX(),n.getMinY()),new L(n.getMaxX(),n.getMaxY())]):this.createPolygon(this.createLinearRing([new L(n.getMinX(),n.getMinY()),new L(n.getMinX(),n.getMaxY()),new L(n.getMaxX(),n.getMaxY()),new L(n.getMaxX(),n.getMinY()),new L(n.getMinX(),n.getMinY())]),null)},le.prototype.createLineString=function(n){return n?n instanceof Array?new Bt(this.getCoordinateSequenceFactory().create(n),this):X(n,dt)?new Bt(n,this):void 0:new Bt(this.getCoordinateSequenceFactory().create([]),this)},le.prototype.createMultiLineString=function(){if(arguments.length===0)return new H(null,this);if(arguments.length===1){var n=arguments[0];return new H(n,this)}},le.prototype.buildGeometry=function(n){for(var i=null,s=!1,u=!1,c=n.iterator();c.hasNext();){var m=c.next(),E=m.getClass();i===null&&(i=E),E!==i&&(s=!0),m.isGeometryCollectionOrDerived()&&(u=!0)}if(i===null)return this.createGeometryCollection();if(s||u)return this.createGeometryCollection(le.toGeometryArray(n));var A=n.iterator().next();if(n.size()>1){if(A instanceof Vt)return this.createMultiPolygon(le.toPolygonArray(n));if(A instanceof Bt)return this.createMultiLineString(le.toLineStringArray(n));if(A instanceof Qt)return this.createMultiPoint(le.toPointArray(n));b.shouldNeverReachHere("Unhandled class: "+A.getClass().getName())}return A},le.prototype.createMultiPointFromCoords=function(n){return this.createMultiPoint(n!==null?this.getCoordinateSequenceFactory().create(n):null)},le.prototype.createPoint=function(){if(arguments.length===0)return this.createPoint(this.getCoordinateSequenceFactory().create([]));if(arguments.length===1){if(arguments[0]instanceof L){var n=arguments[0];return this.createPoint(n!==null?this.getCoordinateSequenceFactory().create([n]):null)}if(X(arguments[0],dt)){var i=arguments[0];return new Qt(i,this)}}},le.prototype.getCoordinateSequenceFactory=function(){return this._coordinateSequenceFactory},le.prototype.createPolygon=function(){if(arguments.length===0)return new Vt(null,null,this);if(arguments.length===1){if(X(arguments[0],dt)){var n=arguments[0];return this.createPolygon(this.createLinearRing(n))}if(arguments[0]instanceof Array){var i=arguments[0];return this.createPolygon(this.createLinearRing(i))}if(arguments[0]instanceof sn){var s=arguments[0];return this.createPolygon(s,null)}}else if(arguments.length===2){var u=arguments[0],c=arguments[1];return new Vt(u,c,this)}},le.prototype.getSRID=function(){return this._SRID},le.prototype.createGeometryCollection=function(){if(arguments.length===0)return new Vn(null,this);if(arguments.length===1){var n=arguments[0];return new Vn(n,this)}},le.prototype.createGeometry=function(n){return new vn(this).edit(n,{edit:function(){if(arguments.length===2){var i=arguments[0];return this._coordinateSequenceFactory.create(i)}}})},le.prototype.getPrecisionModel=function(){return this._precisionModel},le.prototype.createLinearRing=function(){if(arguments.length===0)return this.createLinearRing(this.getCoordinateSequenceFactory().create([]));if(arguments.length===1){if(arguments[0]instanceof Array){var n=arguments[0];return this.createLinearRing(n!==null?this.getCoordinateSequenceFactory().create(n):null)}if(X(arguments[0],dt)){var i=arguments[0];return new sn(i,this)}}},le.prototype.createMultiPolygon=function(){if(arguments.length===0)return new un(null,this);if(arguments.length===1){var n=arguments[0];return new un(n,this)}},le.prototype.createMultiPoint=function(){if(arguments.length===0)return new fe(null,this);if(arguments.length===1){if(arguments[0]instanceof Array){var n=arguments[0];return new fe(n,this)}if(arguments[0]instanceof Array){var i=arguments[0];return this.createMultiPoint(i!==null?this.getCoordinateSequenceFactory().create(i):null)}if(X(arguments[0],dt)){var s=arguments[0];if(s===null)return this.createMultiPoint(new Array(0).fill(null));for(var u=new Array(s.size()).fill(null),c=0;c<s.size();c++){var m=this.getCoordinateSequenceFactory().create(1,s.getDimension());It.copy(s,c,m,0,1),u[c]=this.createPoint(m)}return this.createMultiPoint(u)}}},le.prototype.interfaces_=function(){return[t]},le.prototype.getClass=function(){return le},le.toMultiPolygonArray=function(n){var i=new Array(n.size()).fill(null);return n.toArray(i)},le.toGeometryArray=function(n){if(n===null)return null;var i=new Array(n.size()).fill(null);return n.toArray(i)},le.getDefaultCoordinateSequenceFactory=function(){return ri.instance()},le.toMultiLineStringArray=function(n){var i=new Array(n.size()).fill(null);return n.toArray(i)},le.toLineStringArray=function(n){var i=new Array(n.size()).fill(null);return n.toArray(i)},le.toMultiPointArray=function(n){var i=new Array(n.size()).fill(null);return n.toArray(i)},le.toLinearRingArray=function(n){var i=new Array(n.size()).fill(null);return n.toArray(i)},le.toPointArray=function(n){var i=new Array(n.size()).fill(null);return n.toArray(i)},le.toPolygonArray=function(n){var i=new Array(n.size()).fill(null);return n.toArray(i)},le.createPointFromInternalCoord=function(n,i){return i.getPrecisionModel().makePrecise(n),i.getFactory().createPoint(n)},yl.serialVersionUID.get=function(){return-6820524753094096e3},Object.defineProperties(le,yl);var vl=["Point","MultiPoint","LineString","MultiLineString","Polygon","MultiPolygon"],_l=function(n){this.geometryFactory=n||new le};_l.prototype.read=function(n){var i,s=(i=typeof n=="string"?JSON.parse(n):n).type;if(!wi[s])throw new Error("Unknown GeoJSON type: "+i.type);return vl.indexOf(s)!==-1?wi[s].apply(this,[i.coordinates]):s==="GeometryCollection"?wi[s].apply(this,[i.geometries]):wi[s].apply(this,[i])},_l.prototype.write=function(n){var i=n.getGeometryType();if(!oo[i])throw new Error("Geometry is not supported");return oo[i].apply(this,[n])};var wi={Feature:function(n){var i={};for(var s in n)i[s]=n[s];if(n.geometry){var u=n.geometry.type;if(!wi[u])throw new Error("Unknown GeoJSON type: "+n.type);i.geometry=this.read(n.geometry)}return n.bbox&&(i.bbox=wi.bbox.apply(this,[n.bbox])),i},FeatureCollection:function(n){var i={};if(n.features){i.features=[];for(var s=0;s<n.features.length;++s)i.features.push(this.read(n.features[s]))}return n.bbox&&(i.bbox=this.parse.bbox.apply(this,[n.bbox])),i},coordinates:function(n){for(var i=[],s=0;s<n.length;++s){var u=n[s];i.push(new L(u[0],u[1]))}return i},bbox:function(n){return this.geometryFactory.createLinearRing([new L(n[0],n[1]),new L(n[2],n[1]),new L(n[2],n[3]),new L(n[0],n[3]),new L(n[0],n[1])])},Point:function(n){var i=new L(n[0],n[1]);return this.geometryFactory.createPoint(i)},MultiPoint:function(n){for(var i=[],s=0;s<n.length;++s)i.push(wi.Point.apply(this,[n[s]]));return this.geometryFactory.createMultiPoint(i)},LineString:function(n){var i=wi.coordinates.apply(this,[n]);return this.geometryFactory.createLineString(i)},MultiLineString:function(n){for(var i=[],s=0;s<n.length;++s)i.push(wi.LineString.apply(this,[n[s]]));return this.geometryFactory.createMultiLineString(i)},Polygon:function(n){for(var i=wi.coordinates.apply(this,[n[0]]),s=this.geometryFactory.createLinearRing(i),u=[],c=1;c<n.length;++c){var m=n[c],E=wi.coordinates.apply(this,[m]),A=this.geometryFactory.createLinearRing(E);u.push(A)}return this.geometryFactory.createPolygon(s,u)},MultiPolygon:function(n){for(var i=[],s=0;s<n.length;++s){var u=n[s];i.push(wi.Polygon.apply(this,[u]))}return this.geometryFactory.createMultiPolygon(i)},GeometryCollection:function(n){for(var i=[],s=0;s<n.length;++s){var u=n[s];i.push(this.read(u))}return this.geometryFactory.createGeometryCollection(i)}},oo={coordinate:function(n){return[n.x,n.y]},Point:function(n){return{type:"Point",coordinates:oo.coordinate.apply(this,[n.getCoordinate()])}},MultiPoint:function(n){for(var i=[],s=0;s<n._geometries.length;++s){var u=n._geometries[s],c=oo.Point.apply(this,[u]);i.push(c.coordinates)}return{type:"MultiPoint",coordinates:i}},LineString:function(n){for(var i=[],s=n.getCoordinates(),u=0;u<s.length;++u){var c=s[u];i.push(oo.coordinate.apply(this,[c]))}return{type:"LineString",coordinates:i}},MultiLineString:function(n){for(var i=[],s=0;s<n._geometries.length;++s){var u=n._geometries[s],c=oo.LineString.apply(this,[u]);i.push(c.coordinates)}return{type:"MultiLineString",coordinates:i}},Polygon:function(n){var i=[],s=oo.LineString.apply(this,[n._shell]);i.push(s.coordinates);for(var u=0;u<n._holes.length;++u){var c=n._holes[u],m=oo.LineString.apply(this,[c]);i.push(m.coordinates)}return{type:"Polygon",coordinates:i}},MultiPolygon:function(n){for(var i=[],s=0;s<n._geometries.length;++s){var u=n._geometries[s],c=oo.Polygon.apply(this,[u]);i.push(c.coordinates)}return{type:"MultiPolygon",coordinates:i}},GeometryCollection:function(n){for(var i=[],s=0;s<n._geometries.length;++s){var u=n._geometries[s],c=u.getGeometryType();i.push(oo[c].apply(this,[u]))}return{type:"GeometryCollection",geometries:i}}},_f=function(n){this.geometryFactory=n||new le,this.precisionModel=this.geometryFactory.getPrecisionModel(),this.parser=new _l(this.geometryFactory)};_f.prototype.read=function(n){var i=this.parser.read(n);return this.precisionModel.getType()===ie.FIXED&&this.reducePrecision(i),i},_f.prototype.reducePrecision=function(n){var i,s;if(n.coordinate)this.precisionModel.makePrecise(n.coordinate);else if(n.points)for(i=0,s=n.points.length;i<s;i++)this.precisionModel.makePrecise(n.points[i]);else if(n.geometries)for(i=0,s=n.geometries.length;i<s;i++)this.reducePrecision(n.geometries[i])};var qd=function(){this.parser=new _l(this.geometryFactory)};qd.prototype.write=function(n){return this.parser.write(n)};var bt=function(){},xl={ON:{configurable:!0},LEFT:{configurable:!0},RIGHT:{configurable:!0}};bt.prototype.interfaces_=function(){return[]},bt.prototype.getClass=function(){return bt},bt.opposite=function(n){return n===bt.LEFT?bt.RIGHT:n===bt.RIGHT?bt.LEFT:n},xl.ON.get=function(){return 0},xl.LEFT.get=function(){return 1},xl.RIGHT.get=function(){return 2},Object.defineProperties(bt,xl),(T.prototype=new Error).name="EmptyStackException",(x.prototype=new wt).add=function(n){return this.array_.push(n),!0},x.prototype.get=function(n){if(n<0||n>=this.size())throw new Error;return this.array_[n]},x.prototype.push=function(n){return this.array_.push(n),n},x.prototype.pop=function(n){if(this.array_.length===0)throw new T;return this.array_.pop()},x.prototype.peek=function(){if(this.array_.length===0)throw new T;return this.array_[this.array_.length-1]},x.prototype.empty=function(){return this.array_.length===0},x.prototype.isEmpty=function(){return this.empty()},x.prototype.search=function(n){return this.array_.indexOf(n)},x.prototype.size=function(){return this.array_.length},x.prototype.toArray=function(){for(var n=[],i=0,s=this.array_.length;i<s;i++)n.push(this.array_[i]);return n};var bi=function(){this._minIndex=-1,this._minCoord=null,this._minDe=null,this._orientedDe=null};bi.prototype.getCoordinate=function(){return this._minCoord},bi.prototype.getRightmostSide=function(n,i){var s=this.getRightmostSideOfSegment(n,i);return s<0&&(s=this.getRightmostSideOfSegment(n,i-1)),s<0&&(this._minCoord=null,this.checkForRightmostCoordinate(n)),s},bi.prototype.findRightmostEdgeAtVertex=function(){var n=this._minDe.getEdge().getCoordinates();b.isTrue(this._minIndex>0&&this._minIndex<n.length,"rightmost point expected to be interior vertex of edge");var i=n[this._minIndex-1],s=n[this._minIndex+1],u=B.computeOrientation(this._minCoord,s,i),c=!1;(i.y<this._minCoord.y&&s.y<this._minCoord.y&&u===B.COUNTERCLOCKWISE||i.y>this._minCoord.y&&s.y>this._minCoord.y&&u===B.CLOCKWISE)&&(c=!0),c&&(this._minIndex=this._minIndex-1)},bi.prototype.getRightmostSideOfSegment=function(n,i){var s=n.getEdge().getCoordinates();if(i<0||i+1>=s.length||s[i].y===s[i+1].y)return-1;var u=bt.LEFT;return s[i].y<s[i+1].y&&(u=bt.RIGHT),u},bi.prototype.getEdge=function(){return this._orientedDe},bi.prototype.checkForRightmostCoordinate=function(n){for(var i=n.getEdge().getCoordinates(),s=0;s<i.length-1;s++)(this._minCoord===null||i[s].x>this._minCoord.x)&&(this._minDe=n,this._minIndex=s,this._minCoord=i[s])},bi.prototype.findRightmostEdgeAtNode=function(){var n=this._minDe.getNode().getEdges();this._minDe=n.getRightmostEdge(),this._minDe.isForward()||(this._minDe=this._minDe.getSym(),this._minIndex=this._minDe.getEdge().getCoordinates().length-1)},bi.prototype.findEdge=function(n){for(var i=n.iterator();i.hasNext();){var s=i.next();s.isForward()&&this.checkForRightmostCoordinate(s)}b.isTrue(this._minIndex!==0||this._minCoord.equals(this._minDe.getCoordinate()),"inconsistency in rightmost processing"),this._minIndex===0?this.findRightmostEdgeAtNode():this.findRightmostEdgeAtVertex(),this._orientedDe=this._minDe,this.getRightmostSide(this._minDe,this._minIndex)===bt.LEFT&&(this._orientedDe=this._minDe.getSym())},bi.prototype.interfaces_=function(){return[]},bi.prototype.getClass=function(){return bi};var so=function(n){function i(s,u){n.call(this,i.msgWithCoord(s,u)),this.pt=u?new L(u):null,this.name="TopologyException"}return n&&(i.__proto__=n),i.prototype=Object.create(n&&n.prototype),i.prototype.constructor=i,i.prototype.getCoordinate=function(){return this.pt},i.prototype.interfaces_=function(){return[]},i.prototype.getClass=function(){return i},i.msgWithCoord=function(s,u){return u?s:s+" [ "+u+" ]"},i}($),El=function(){this.array_=[]};El.prototype.addLast=function(n){this.array_.push(n)},El.prototype.removeFirst=function(){return this.array_.shift()},El.prototype.isEmpty=function(){return this.array_.length===0};var sr=function(){this._finder=null,this._dirEdgeList=new j,this._nodes=new j,this._rightMostCoord=null,this._env=null,this._finder=new bi};sr.prototype.clearVisitedEdges=function(){for(var n=this._dirEdgeList.iterator();n.hasNext();)n.next().setVisited(!1)},sr.prototype.getRightmostCoordinate=function(){return this._rightMostCoord},sr.prototype.computeNodeDepth=function(n){for(var i=null,s=n.getEdges().iterator();s.hasNext();){var u=s.next();if(u.isVisited()||u.getSym().isVisited()){i=u;break}}if(i===null)throw new so("unable to find edge to compute depths at "+n.getCoordinate());n.getEdges().computeDepths(i);for(var c=n.getEdges().iterator();c.hasNext();){var m=c.next();m.setVisited(!0),this.copySymDepths(m)}},sr.prototype.computeDepth=function(n){this.clearVisitedEdges();var i=this._finder.getEdge();i.setEdgeDepths(bt.RIGHT,n),this.copySymDepths(i),this.computeDepths(i)},sr.prototype.create=function(n){this.addReachable(n),this._finder.findEdge(this._dirEdgeList),this._rightMostCoord=this._finder.getCoordinate()},sr.prototype.findResultEdges=function(){for(var n=this._dirEdgeList.iterator();n.hasNext();){var i=n.next();i.getDepth(bt.RIGHT)>=1&&i.getDepth(bt.LEFT)<=0&&!i.isInteriorAreaEdge()&&i.setInResult(!0)}},sr.prototype.computeDepths=function(n){var i=new $n,s=new El,u=n.getNode();for(s.addLast(u),i.add(u),n.setVisited(!0);!s.isEmpty();){var c=s.removeFirst();i.add(c),this.computeNodeDepth(c);for(var m=c.getEdges().iterator();m.hasNext();){var E=m.next().getSym();if(!E.isVisited()){var A=E.getNode();i.contains(A)||(s.addLast(A),i.add(A))}}}},sr.prototype.compareTo=function(n){var i=n;return this._rightMostCoord.x<i._rightMostCoord.x?-1:this._rightMostCoord.x>i._rightMostCoord.x?1:0},sr.prototype.getEnvelope=function(){if(this._env===null){for(var n=new Pt,i=this._dirEdgeList.iterator();i.hasNext();)for(var s=i.next().getEdge().getCoordinates(),u=0;u<s.length-1;u++)n.expandToInclude(s[u]);this._env=n}return this._env},sr.prototype.addReachable=function(n){var i=new x;for(i.add(n);!i.empty();){var s=i.pop();this.add(s,i)}},sr.prototype.copySymDepths=function(n){var i=n.getSym();i.setDepth(bt.LEFT,n.getDepth(bt.RIGHT)),i.setDepth(bt.RIGHT,n.getDepth(bt.LEFT))},sr.prototype.add=function(n,i){n.setVisited(!0),this._nodes.add(n);for(var s=n.getEdges().iterator();s.hasNext();){var u=s.next();this._dirEdgeList.add(u);var c=u.getSym().getNode();c.isVisited()||i.push(c)}},sr.prototype.getNodes=function(){return this._nodes},sr.prototype.getDirectedEdges=function(){return this._dirEdgeList},sr.prototype.interfaces_=function(){return[F]},sr.prototype.getClass=function(){return sr};var hn=function n(){if(this.location=null,arguments.length===1){if(arguments[0]instanceof Array){var i=arguments[0];this.init(i.length)}else if(Number.isInteger(arguments[0])){var s=arguments[0];this.init(1),this.location[bt.ON]=s}else if(arguments[0]instanceof n){var u=arguments[0];if(this.init(u.location.length),u!==null)for(var c=0;c<this.location.length;c++)this.location[c]=u.location[c]}}else if(arguments.length===3){var m=arguments[0],E=arguments[1],A=arguments[2];this.init(3),this.location[bt.ON]=m,this.location[bt.LEFT]=E,this.location[bt.RIGHT]=A}};hn.prototype.setAllLocations=function(n){for(var i=0;i<this.location.length;i++)this.location[i]=n},hn.prototype.isNull=function(){for(var n=0;n<this.location.length;n++)if(this.location[n]!==k.NONE)return!1;return!0},hn.prototype.setAllLocationsIfNull=function(n){for(var i=0;i<this.location.length;i++)this.location[i]===k.NONE&&(this.location[i]=n)},hn.prototype.isLine=function(){return this.location.length===1},hn.prototype.merge=function(n){if(n.location.length>this.location.length){var i=new Array(3).fill(null);i[bt.ON]=this.location[bt.ON],i[bt.LEFT]=k.NONE,i[bt.RIGHT]=k.NONE,this.location=i}for(var s=0;s<this.location.length;s++)this.location[s]===k.NONE&&s<n.location.length&&(this.location[s]=n.location[s])},hn.prototype.getLocations=function(){return this.location},hn.prototype.flip=function(){if(this.location.length<=1)return null;var n=this.location[bt.LEFT];this.location[bt.LEFT]=this.location[bt.RIGHT],this.location[bt.RIGHT]=n},hn.prototype.toString=function(){var n=new pt;return this.location.length>1&&n.append(k.toLocationSymbol(this.location[bt.LEFT])),n.append(k.toLocationSymbol(this.location[bt.ON])),this.location.length>1&&n.append(k.toLocationSymbol(this.location[bt.RIGHT])),n.toString()},hn.prototype.setLocations=function(n,i,s){this.location[bt.ON]=n,this.location[bt.LEFT]=i,this.location[bt.RIGHT]=s},hn.prototype.get=function(n){return n<this.location.length?this.location[n]:k.NONE},hn.prototype.isArea=function(){return this.location.length>1},hn.prototype.isAnyNull=function(){for(var n=0;n<this.location.length;n++)if(this.location[n]===k.NONE)return!0;return!1},hn.prototype.setLocation=function(){if(arguments.length===1){var n=arguments[0];this.setLocation(bt.ON,n)}else if(arguments.length===2){var i=arguments[0],s=arguments[1];this.location[i]=s}},hn.prototype.init=function(n){this.location=new Array(n).fill(null),this.setAllLocations(k.NONE)},hn.prototype.isEqualOnSide=function(n,i){return this.location[i]===n.location[i]},hn.prototype.allPositionsEqual=function(n){for(var i=0;i<this.location.length;i++)if(this.location[i]!==n)return!1;return!0},hn.prototype.interfaces_=function(){return[]},hn.prototype.getClass=function(){return hn};var rn=function n(){if(this.elt=new Array(2).fill(null),arguments.length===1){if(Number.isInteger(arguments[0])){var i=arguments[0];this.elt[0]=new hn(i),this.elt[1]=new hn(i)}else if(arguments[0]instanceof n){var s=arguments[0];this.elt[0]=new hn(s.elt[0]),this.elt[1]=new hn(s.elt[1])}}else if(arguments.length===2){var u=arguments[0],c=arguments[1];this.elt[0]=new hn(k.NONE),this.elt[1]=new hn(k.NONE),this.elt[u].setLocation(c)}else if(arguments.length===3){var m=arguments[0],E=arguments[1],A=arguments[2];this.elt[0]=new hn(m,E,A),this.elt[1]=new hn(m,E,A)}else if(arguments.length===4){var U=arguments[0],Z=arguments[1],ut=arguments[2],ht=arguments[3];this.elt[0]=new hn(k.NONE,k.NONE,k.NONE),this.elt[1]=new hn(k.NONE,k.NONE,k.NONE),this.elt[U].setLocations(Z,ut,ht)}};rn.prototype.getGeometryCount=function(){var n=0;return this.elt[0].isNull()||n++,this.elt[1].isNull()||n++,n},rn.prototype.setAllLocations=function(n,i){this.elt[n].setAllLocations(i)},rn.prototype.isNull=function(n){return this.elt[n].isNull()},rn.prototype.setAllLocationsIfNull=function(){if(arguments.length===1){var n=arguments[0];this.setAllLocationsIfNull(0,n),this.setAllLocationsIfNull(1,n)}else if(arguments.length===2){var i=arguments[0],s=arguments[1];this.elt[i].setAllLocationsIfNull(s)}},rn.prototype.isLine=function(n){return this.elt[n].isLine()},rn.prototype.merge=function(n){for(var i=0;i<2;i++)this.elt[i]===null&&n.elt[i]!==null?this.elt[i]=new hn(n.elt[i]):this.elt[i].merge(n.elt[i])},rn.prototype.flip=function(){this.elt[0].flip(),this.elt[1].flip()},rn.prototype.getLocation=function(){if(arguments.length===1){var n=arguments[0];return this.elt[n].get(bt.ON)}if(arguments.length===2){var i=arguments[0],s=arguments[1];return this.elt[i].get(s)}},rn.prototype.toString=function(){var n=new pt;return this.elt[0]!==null&&(n.append("A:"),n.append(this.elt[0].toString())),this.elt[1]!==null&&(n.append(" B:"),n.append(this.elt[1].toString())),n.toString()},rn.prototype.isArea=function(){if(arguments.length===0)return this.elt[0].isArea()||this.elt[1].isArea();if(arguments.length===1){var n=arguments[0];return this.elt[n].isArea()}},rn.prototype.isAnyNull=function(n){return this.elt[n].isAnyNull()},rn.prototype.setLocation=function(){if(arguments.length===2){var n=arguments[0],i=arguments[1];this.elt[n].setLocation(bt.ON,i)}else if(arguments.length===3){var s=arguments[0],u=arguments[1],c=arguments[2];this.elt[s].setLocation(u,c)}},rn.prototype.isEqualOnSide=function(n,i){return this.elt[0].isEqualOnSide(n.elt[0],i)&&this.elt[1].isEqualOnSide(n.elt[1],i)},rn.prototype.allPositionsEqual=function(n,i){return this.elt[n].allPositionsEqual(i)},rn.prototype.toLine=function(n){this.elt[n].isArea()&&(this.elt[n]=new hn(this.elt[n].location[0]))},rn.prototype.interfaces_=function(){return[]},rn.prototype.getClass=function(){return rn},rn.toLineLabel=function(n){for(var i=new rn(k.NONE),s=0;s<2;s++)i.setLocation(s,n.getLocation(s));return i};var An=function(){this._startDe=null,this._maxNodeDegree=-1,this._edges=new j,this._pts=new j,this._label=new rn(k.NONE),this._ring=null,this._isHole=null,this._shell=null,this._holes=new j,this._geometryFactory=null;var n=arguments[0],i=arguments[1];this._geometryFactory=i,this.computePoints(n),this.computeRing()};An.prototype.computeRing=function(){if(this._ring!==null)return null;for(var n=new Array(this._pts.size()).fill(null),i=0;i<this._pts.size();i++)n[i]=this._pts.get(i);this._ring=this._geometryFactory.createLinearRing(n),this._isHole=B.isCCW(this._ring.getCoordinates())},An.prototype.isIsolated=function(){return this._label.getGeometryCount()===1},An.prototype.computePoints=function(n){this._startDe=n;var i=n,s=!0;do{if(i===null)throw new so("Found null DirectedEdge");if(i.getEdgeRing()===this)throw new so("Directed Edge visited twice during ring-building at "+i.getCoordinate());this._edges.add(i);var u=i.getLabel();b.isTrue(u.isArea()),this.mergeLabel(u),this.addPoints(i.getEdge(),i.isForward(),s),s=!1,this.setEdgeRing(i,this),i=this.getNext(i)}while(i!==this._startDe)},An.prototype.getLinearRing=function(){return this._ring},An.prototype.getCoordinate=function(n){return this._pts.get(n)},An.prototype.computeMaxNodeDegree=function(){this._maxNodeDegree=0;var n=this._startDe;do{var i=n.getNode().getEdges().getOutgoingDegree(this);i>this._maxNodeDegree&&(this._maxNodeDegree=i),n=this.getNext(n)}while(n!==this._startDe);this._maxNodeDegree*=2},An.prototype.addPoints=function(n,i,s){var u=n.getCoordinates();if(i){var c=1;s&&(c=0);for(var m=c;m<u.length;m++)this._pts.add(u[m])}else{var E=u.length-2;s&&(E=u.length-1);for(var A=E;A>=0;A--)this._pts.add(u[A])}},An.prototype.isHole=function(){return this._isHole},An.prototype.setInResult=function(){var n=this._startDe;do n.getEdge().setInResult(!0),n=n.getNext();while(n!==this._startDe)},An.prototype.containsPoint=function(n){var i=this.getLinearRing();if(!i.getEnvelopeInternal().contains(n)||!B.isPointInRing(n,i.getCoordinates()))return!1;for(var s=this._holes.iterator();s.hasNext();)if(s.next().containsPoint(n))return!1;return!0},An.prototype.addHole=function(n){this._holes.add(n)},An.prototype.isShell=function(){return this._shell===null},An.prototype.getLabel=function(){return this._label},An.prototype.getEdges=function(){return this._edges},An.prototype.getMaxNodeDegree=function(){return this._maxNodeDegree<0&&this.computeMaxNodeDegree(),this._maxNodeDegree},An.prototype.getShell=function(){return this._shell},An.prototype.mergeLabel=function(){if(arguments.length===1){var n=arguments[0];this.mergeLabel(n,0),this.mergeLabel(n,1)}else if(arguments.length===2){var i=arguments[0],s=arguments[1],u=i.getLocation(s,bt.RIGHT);if(u===k.NONE)return null;if(this._label.getLocation(s)===k.NONE)return this._label.setLocation(s,u),null}},An.prototype.setShell=function(n){this._shell=n,n!==null&&n.addHole(this)},An.prototype.toPolygon=function(n){for(var i=new Array(this._holes.size()).fill(null),s=0;s<this._holes.size();s++)i[s]=this._holes.get(s).getLinearRing();return n.createPolygon(this.getLinearRing(),i)},An.prototype.interfaces_=function(){return[]},An.prototype.getClass=function(){return An};var T1=function(n){function i(){var s=arguments[0],u=arguments[1];n.call(this,s,u)}return n&&(i.__proto__=n),i.prototype=Object.create(n&&n.prototype),i.prototype.constructor=i,i.prototype.setEdgeRing=function(s,u){s.setMinEdgeRing(u)},i.prototype.getNext=function(s){return s.getNextMin()},i.prototype.interfaces_=function(){return[]},i.prototype.getClass=function(){return i},i}(An),A1=function(n){function i(){var s=arguments[0],u=arguments[1];n.call(this,s,u)}return n&&(i.__proto__=n),i.prototype=Object.create(n&&n.prototype),i.prototype.constructor=i,i.prototype.buildMinimalRings=function(){var s=new j,u=this._startDe;do{if(u.getMinEdgeRing()===null){var c=new T1(u,this._geometryFactory);s.add(c)}u=u.getNext()}while(u!==this._startDe);return s},i.prototype.setEdgeRing=function(s,u){s.setEdgeRing(u)},i.prototype.linkDirectedEdgesForMinimalEdgeRings=function(){var s=this._startDe;do s.getNode().getEdges().linkMinimalDirectedEdges(this),s=s.getNext();while(s!==this._startDe)},i.prototype.getNext=function(s){return s.getNext()},i.prototype.interfaces_=function(){return[]},i.prototype.getClass=function(){return i},i}(An),Hr=function(){if(this._label=null,this._isInResult=!1,this._isCovered=!1,this._isCoveredSet=!1,this._isVisited=!1,arguments.length!==0){if(arguments.length===1){var n=arguments[0];this._label=n}}};Hr.prototype.setVisited=function(n){this._isVisited=n},Hr.prototype.setInResult=function(n){this._isInResult=n},Hr.prototype.isCovered=function(){return this._isCovered},Hr.prototype.isCoveredSet=function(){return this._isCoveredSet},Hr.prototype.setLabel=function(n){this._label=n},Hr.prototype.getLabel=function(){return this._label},Hr.prototype.setCovered=function(n){this._isCovered=n,this._isCoveredSet=!0},Hr.prototype.updateIM=function(n){b.isTrue(this._label.getGeometryCount()>=2,"found partial label"),this.computeIM(n)},Hr.prototype.isInResult=function(){return this._isInResult},Hr.prototype.isVisited=function(){return this._isVisited},Hr.prototype.interfaces_=function(){return[]},Hr.prototype.getClass=function(){return Hr};var Ml=function(n){function i(){n.call(this),this._coord=null,this._edges=null;var s=arguments[0],u=arguments[1];this._coord=s,this._edges=u,this._label=new rn(0,k.NONE)}return n&&(i.__proto__=n),i.prototype=Object.create(n&&n.prototype),i.prototype.constructor=i,i.prototype.isIncidentEdgeInResult=function(){for(var s=this.getEdges().getEdges().iterator();s.hasNext();)if(s.next().getEdge().isInResult())return!0;return!1},i.prototype.isIsolated=function(){return this._label.getGeometryCount()===1},i.prototype.getCoordinate=function(){return this._coord},i.prototype.print=function(s){s.println("node "+this._coord+" lbl: "+this._label)},i.prototype.computeIM=function(s){},i.prototype.computeMergedLocation=function(s,u){var c=k.NONE;if(c=this._label.getLocation(u),!s.isNull(u)){var m=s.getLocation(u);c!==k.BOUNDARY&&(c=m)}return c},i.prototype.setLabel=function(){if(arguments.length!==2)return n.prototype.setLabel.apply(this,arguments);var s=arguments[0],u=arguments[1];this._label===null?this._label=new rn(s,u):this._label.setLocation(s,u)},i.prototype.getEdges=function(){return this._edges},i.prototype.mergeLabel=function(){if(arguments[0]instanceof i){var s=arguments[0];this.mergeLabel(s._label)}else if(arguments[0]instanceof rn)for(var u=arguments[0],c=0;c<2;c++){var m=this.computeMergedLocation(u,c);this._label.getLocation(c)===k.NONE&&this._label.setLocation(c,m)}},i.prototype.add=function(s){this._edges.insert(s),s.setNode(this)},i.prototype.setLabelBoundary=function(s){if(this._label===null)return null;var u=k.NONE;this._label!==null&&(u=this._label.getLocation(s));var c=null;switch(u){case k.BOUNDARY:c=k.INTERIOR;break;case k.INTERIOR:default:c=k.BOUNDARY}this._label.setLocation(s,c)},i.prototype.interfaces_=function(){return[]},i.prototype.getClass=function(){return i},i}(Hr),Ti=function(){this.nodeMap=new _,this.nodeFact=null;var n=arguments[0];this.nodeFact=n};Ti.prototype.find=function(n){return this.nodeMap.get(n)},Ti.prototype.addNode=function(){if(arguments[0]instanceof L){var n=arguments[0],i=this.nodeMap.get(n);return i===null&&(i=this.nodeFact.createNode(n),this.nodeMap.put(n,i)),i}if(arguments[0]instanceof Ml){var s=arguments[0],u=this.nodeMap.get(s.getCoordinate());return u===null?(this.nodeMap.put(s.getCoordinate(),s),s):(u.mergeLabel(s),u)}},Ti.prototype.print=function(n){for(var i=this.iterator();i.hasNext();)i.next().print(n)},Ti.prototype.iterator=function(){return this.nodeMap.values().iterator()},Ti.prototype.values=function(){return this.nodeMap.values()},Ti.prototype.getBoundaryNodes=function(n){for(var i=new j,s=this.iterator();s.hasNext();){var u=s.next();u.getLabel().getLocation(n)===k.BOUNDARY&&i.add(u)}return i},Ti.prototype.add=function(n){var i=n.getCoordinate();this.addNode(i).add(n)},Ti.prototype.interfaces_=function(){return[]},Ti.prototype.getClass=function(){return Ti};var ln=function(){},vu={NE:{configurable:!0},NW:{configurable:!0},SW:{configurable:!0},SE:{configurable:!0}};ln.prototype.interfaces_=function(){return[]},ln.prototype.getClass=function(){return ln},ln.isNorthern=function(n){return n===ln.NE||n===ln.NW},ln.isOpposite=function(n,i){return n===i?!1:(n-i+4)%4===2},ln.commonHalfPlane=function(n,i){if(n===i)return n;if((n-i+4)%4===2)return-1;var s=n<i?n:i;return s===0&&(n>i?n:i)===3?3:s},ln.isInHalfPlane=function(n,i){return i===ln.SE?n===ln.SE||n===ln.SW:n===i||n===i+1},ln.quadrant=function(){if(typeof arguments[0]=="number"&&typeof arguments[1]=="number"){var n=arguments[0],i=arguments[1];if(n===0&&i===0)throw new C("Cannot compute the quadrant for point ( "+n+", "+i+" )");return n>=0?i>=0?ln.NE:ln.SE:i>=0?ln.NW:ln.SW}if(arguments[0]instanceof L&&arguments[1]instanceof L){var s=arguments[0],u=arguments[1];if(u.x===s.x&&u.y===s.y)throw new C("Cannot compute the quadrant for two identical points "+s);return u.x>=s.x?u.y>=s.y?ln.NE:ln.SE:u.y>=s.y?ln.NW:ln.SW}},vu.NE.get=function(){return 0},vu.NW.get=function(){return 1},vu.SW.get=function(){return 2},vu.SE.get=function(){return 3},Object.defineProperties(ln,vu);var Kn=function(){if(this._edge=null,this._label=null,this._node=null,this._p0=null,this._p1=null,this._dx=null,this._dy=null,this._quadrant=null,arguments.length===1){var n=arguments[0];this._edge=n}else if(arguments.length===3){var i=arguments[0],s=arguments[1],u=arguments[2];this._edge=i,this.init(s,u),this._label=null}else if(arguments.length===4){var c=arguments[0],m=arguments[1],E=arguments[2],A=arguments[3];this._edge=c,this.init(m,E),this._label=A}};Kn.prototype.compareDirection=function(n){return this._dx===n._dx&&this._dy===n._dy?0:this._quadrant>n._quadrant?1:this._quadrant<n._quadrant?-1:B.computeOrientation(n._p0,n._p1,this._p1)},Kn.prototype.getDy=function(){return this._dy},Kn.prototype.getCoordinate=function(){return this._p0},Kn.prototype.setNode=function(n){this._node=n},Kn.prototype.print=function(n){var i=Math.atan2(this._dy,this._dx),s=this.getClass().getName(),u=s.lastIndexOf("."),c=s.substring(u+1);n.print(" "+c+": "+this._p0+" - "+this._p1+" "+this._quadrant+":"+i+" "+this._label)},Kn.prototype.compareTo=function(n){var i=n;return this.compareDirection(i)},Kn.prototype.getDirectedCoordinate=function(){return this._p1},Kn.prototype.getDx=function(){return this._dx},Kn.prototype.getLabel=function(){return this._label},Kn.prototype.getEdge=function(){return this._edge},Kn.prototype.getQuadrant=function(){return this._quadrant},Kn.prototype.getNode=function(){return this._node},Kn.prototype.toString=function(){var n=Math.atan2(this._dy,this._dx),i=this.getClass().getName(),s=i.lastIndexOf(".");return" "+i.substring(s+1)+": "+this._p0+" - "+this._p1+" "+this._quadrant+":"+n+" "+this._label},Kn.prototype.computeLabel=function(n){},Kn.prototype.init=function(n,i){this._p0=n,this._p1=i,this._dx=i.x-n.x,this._dy=i.y-n.y,this._quadrant=ln.quadrant(this._dx,this._dy),b.isTrue(!(this._dx===0&&this._dy===0),"EdgeEnd with identical endpoints found")},Kn.prototype.interfaces_=function(){return[F]},Kn.prototype.getClass=function(){return Kn};var xf=function(n){function i(){var s=arguments[0],u=arguments[1];if(n.call(this,s),this._isForward=null,this._isInResult=!1,this._isVisited=!1,this._sym=null,this._next=null,this._nextMin=null,this._edgeRing=null,this._minEdgeRing=null,this._depth=[0,-999,-999],this._isForward=u,u)this.init(s.getCoordinate(0),s.getCoordinate(1));else{var c=s.getNumPoints()-1;this.init(s.getCoordinate(c),s.getCoordinate(c-1))}this.computeDirectedLabel()}return n&&(i.__proto__=n),i.prototype=Object.create(n&&n.prototype),i.prototype.constructor=i,i.prototype.getNextMin=function(){return this._nextMin},i.prototype.getDepth=function(s){return this._depth[s]},i.prototype.setVisited=function(s){this._isVisited=s},i.prototype.computeDirectedLabel=function(){this._label=new rn(this._edge.getLabel()),this._isForward||this._label.flip()},i.prototype.getNext=function(){return this._next},i.prototype.setDepth=function(s,u){if(this._depth[s]!==-999&&this._depth[s]!==u)throw new so("assigned depths do not match",this.getCoordinate());this._depth[s]=u},i.prototype.isInteriorAreaEdge=function(){for(var s=!0,u=0;u<2;u++)this._label.isArea(u)&&this._label.getLocation(u,bt.LEFT)===k.INTERIOR&&this._label.getLocation(u,bt.RIGHT)===k.INTERIOR||(s=!1);return s},i.prototype.setNextMin=function(s){this._nextMin=s},i.prototype.print=function(s){n.prototype.print.call(this,s),s.print(" "+this._depth[bt.LEFT]+"/"+this._depth[bt.RIGHT]),s.print(" ("+this.getDepthDelta()+")"),this._isInResult&&s.print(" inResult")},i.prototype.setMinEdgeRing=function(s){this._minEdgeRing=s},i.prototype.isLineEdge=function(){var s=this._label.isLine(0)||this._label.isLine(1),u=!this._label.isArea(0)||this._label.allPositionsEqual(0,k.EXTERIOR),c=!this._label.isArea(1)||this._label.allPositionsEqual(1,k.EXTERIOR);return s&&u&&c},i.prototype.setEdgeRing=function(s){this._edgeRing=s},i.prototype.getMinEdgeRing=function(){return this._minEdgeRing},i.prototype.getDepthDelta=function(){var s=this._edge.getDepthDelta();return this._isForward||(s=-s),s},i.prototype.setInResult=function(s){this._isInResult=s},i.prototype.getSym=function(){return this._sym},i.prototype.isForward=function(){return this._isForward},i.prototype.getEdge=function(){return this._edge},i.prototype.printEdge=function(s){this.print(s),s.print(" "),this._isForward?this._edge.print(s):this._edge.printReverse(s)},i.prototype.setSym=function(s){this._sym=s},i.prototype.setVisitedEdge=function(s){this.setVisited(s),this._sym.setVisited(s)},i.prototype.setEdgeDepths=function(s,u){var c=this.getEdge().getDepthDelta();this._isForward||(c=-c);var m=1;s===bt.LEFT&&(m=-1);var E=bt.opposite(s),A=u+c*m;this.setDepth(s,u),this.setDepth(E,A)},i.prototype.getEdgeRing=function(){return this._edgeRing},i.prototype.isInResult=function(){return this._isInResult},i.prototype.setNext=function(s){this._next=s},i.prototype.isVisited=function(){return this._isVisited},i.prototype.interfaces_=function(){return[]},i.prototype.getClass=function(){return i},i.depthFactor=function(s,u){return s===k.EXTERIOR&&u===k.INTERIOR?1:s===k.INTERIOR&&u===k.EXTERIOR?-1:0},i}(Kn),ua=function(){};ua.prototype.createNode=function(n){return new Ml(n,null)},ua.prototype.interfaces_=function(){return[]},ua.prototype.getClass=function(){return ua};var _n=function(){if(this._edges=new j,this._nodes=null,this._edgeEndList=new j,arguments.length===0)this._nodes=new Ti(new ua);else if(arguments.length===1){var n=arguments[0];this._nodes=new Ti(n)}};_n.prototype.printEdges=function(n){n.println("Edges:");for(var i=0;i<this._edges.size();i++){n.println("edge "+i+":");var s=this._edges.get(i);s.print(n),s.eiList.print(n)}},_n.prototype.find=function(n){return this._nodes.find(n)},_n.prototype.addNode=function(){if(arguments[0]instanceof Ml){var n=arguments[0];return this._nodes.addNode(n)}if(arguments[0]instanceof L){var i=arguments[0];return this._nodes.addNode(i)}},_n.prototype.getNodeIterator=function(){return this._nodes.iterator()},_n.prototype.linkResultDirectedEdges=function(){for(var n=this._nodes.iterator();n.hasNext();)n.next().getEdges().linkResultDirectedEdges()},_n.prototype.debugPrintln=function(n){Nt.out.println(n)},_n.prototype.isBoundaryNode=function(n,i){var s=this._nodes.find(i);if(s===null)return!1;var u=s.getLabel();return u!==null&&u.getLocation(n)===k.BOUNDARY},_n.prototype.linkAllDirectedEdges=function(){for(var n=this._nodes.iterator();n.hasNext();)n.next().getEdges().linkAllDirectedEdges()},_n.prototype.matchInSameDirection=function(n,i,s,u){return!!n.equals(s)&&B.computeOrientation(n,i,u)===B.COLLINEAR&&ln.quadrant(n,i)===ln.quadrant(s,u)},_n.prototype.getEdgeEnds=function(){return this._edgeEndList},_n.prototype.debugPrint=function(n){Nt.out.print(n)},_n.prototype.getEdgeIterator=function(){return this._edges.iterator()},_n.prototype.findEdgeInSameDirection=function(n,i){for(var s=0;s<this._edges.size();s++){var u=this._edges.get(s),c=u.getCoordinates();if(this.matchInSameDirection(n,i,c[0],c[1])||this.matchInSameDirection(n,i,c[c.length-1],c[c.length-2]))return u}return null},_n.prototype.insertEdge=function(n){this._edges.add(n)},_n.prototype.findEdgeEnd=function(n){for(var i=this.getEdgeEnds().iterator();i.hasNext();){var s=i.next();if(s.getEdge()===n)return s}return null},_n.prototype.addEdges=function(n){for(var i=n.iterator();i.hasNext();){var s=i.next();this._edges.add(s);var u=new xf(s,!0),c=new xf(s,!1);u.setSym(c),c.setSym(u),this.add(u),this.add(c)}},_n.prototype.add=function(n){this._nodes.add(n),this._edgeEndList.add(n)},_n.prototype.getNodes=function(){return this._nodes.values()},_n.prototype.findEdge=function(n,i){for(var s=0;s<this._edges.size();s++){var u=this._edges.get(s),c=u.getCoordinates();if(n.equals(c[0])&&i.equals(c[1]))return u}return null},_n.prototype.interfaces_=function(){return[]},_n.prototype.getClass=function(){return _n},_n.linkResultDirectedEdges=function(n){for(var i=n.iterator();i.hasNext();)i.next().getEdges().linkResultDirectedEdges()};var Nr=function(){this._geometryFactory=null,this._shellList=new j;var n=arguments[0];this._geometryFactory=n};Nr.prototype.sortShellsAndHoles=function(n,i,s){for(var u=n.iterator();u.hasNext();){var c=u.next();c.isHole()?s.add(c):i.add(c)}},Nr.prototype.computePolygons=function(n){for(var i=new j,s=n.iterator();s.hasNext();){var u=s.next().toPolygon(this._geometryFactory);i.add(u)}return i},Nr.prototype.placeFreeHoles=function(n,i){for(var s=i.iterator();s.hasNext();){var u=s.next();if(u.getShell()===null){var c=this.findEdgeRingContaining(u,n);if(c===null)throw new so("unable to assign hole to a shell",u.getCoordinate(0));u.setShell(c)}}},Nr.prototype.buildMinimalEdgeRings=function(n,i,s){for(var u=new j,c=n.iterator();c.hasNext();){var m=c.next();if(m.getMaxNodeDegree()>2){m.linkDirectedEdgesForMinimalEdgeRings();var E=m.buildMinimalRings(),A=this.findShell(E);A!==null?(this.placePolygonHoles(A,E),i.add(A)):s.addAll(E)}else u.add(m)}return u},Nr.prototype.containsPoint=function(n){for(var i=this._shellList.iterator();i.hasNext();)if(i.next().containsPoint(n))return!0;return!1},Nr.prototype.buildMaximalEdgeRings=function(n){for(var i=new j,s=n.iterator();s.hasNext();){var u=s.next();if(u.isInResult()&&u.getLabel().isArea()&&u.getEdgeRing()===null){var c=new A1(u,this._geometryFactory);i.add(c),c.setInResult()}}return i},Nr.prototype.placePolygonHoles=function(n,i){for(var s=i.iterator();s.hasNext();){var u=s.next();u.isHole()&&u.setShell(n)}},Nr.prototype.getPolygons=function(){return this.computePolygons(this._shellList)},Nr.prototype.findEdgeRingContaining=function(n,i){for(var s=n.getLinearRing(),u=s.getEnvelopeInternal(),c=s.getCoordinateN(0),m=null,E=null,A=i.iterator();A.hasNext();){var U=A.next(),Z=U.getLinearRing(),ut=Z.getEnvelopeInternal();m!==null&&(E=m.getLinearRing().getEnvelopeInternal());var ht=!1;ut.contains(u)&&B.isPointInRing(c,Z.getCoordinates())&&(ht=!0),ht&&(m===null||E.contains(ut))&&(m=U)}return m},Nr.prototype.findShell=function(n){for(var i=0,s=null,u=n.iterator();u.hasNext();){var c=u.next();c.isHole()||(s=c,i++)}return b.isTrue(i<=1,"found two shells in MinimalEdgeRing list"),s},Nr.prototype.add=function(){if(arguments.length===1){var n=arguments[0];this.add(n.getEdgeEnds(),n.getNodes())}else if(arguments.length===2){var i=arguments[0],s=arguments[1];_n.linkResultDirectedEdges(s);var u=this.buildMaximalEdgeRings(i),c=new j,m=this.buildMinimalEdgeRings(u,this._shellList,c);this.sortShellsAndHoles(m,this._shellList,c),this.placeFreeHoles(this._shellList,c)}},Nr.prototype.interfaces_=function(){return[]},Nr.prototype.getClass=function(){return Nr};var la=function(){};la.prototype.getBounds=function(){},la.prototype.interfaces_=function(){return[]},la.prototype.getClass=function(){return la};var pi=function(){this._bounds=null,this._item=null;var n=arguments[0],i=arguments[1];this._bounds=n,this._item=i};pi.prototype.getItem=function(){return this._item},pi.prototype.getBounds=function(){return this._bounds},pi.prototype.interfaces_=function(){return[la,t]},pi.prototype.getClass=function(){return pi};var ao=function(){this._size=null,this._items=null,this._size=0,this._items=new j,this._items.add(null)};ao.prototype.poll=function(){if(this.isEmpty())return null;var n=this._items.get(1);return this._items.set(1,this._items.get(this._size)),this._size-=1,this.reorder(1),n},ao.prototype.size=function(){return this._size},ao.prototype.reorder=function(n){for(var i=null,s=this._items.get(n);2*n<=this._size&&((i=2*n)!==this._size&&this._items.get(i+1).compareTo(this._items.get(i))<0&&i++,this._items.get(i).compareTo(s)<0);n=i)this._items.set(n,this._items.get(i));this._items.set(n,s)},ao.prototype.clear=function(){this._size=0,this._items.clear()},ao.prototype.isEmpty=function(){return this._size===0},ao.prototype.add=function(n){this._items.add(null),this._size+=1;var i=this._size;for(this._items.set(0,n);n.compareTo(this._items.get(Math.trunc(i/2)))<0;i/=2)this._items.set(i,this._items.get(Math.trunc(i/2)));this._items.set(i,n)},ao.prototype.interfaces_=function(){return[]},ao.prototype.getClass=function(){return ao};var bo=function(){};bo.prototype.visitItem=function(n){},bo.prototype.interfaces_=function(){return[]},bo.prototype.getClass=function(){return bo};var Cs=function(){};Cs.prototype.insert=function(n,i){},Cs.prototype.remove=function(n,i){},Cs.prototype.query=function(){},Cs.prototype.interfaces_=function(){return[]},Cs.prototype.getClass=function(){return Cs};var Nn=function(){if(this._childBoundables=new j,this._bounds=null,this._level=null,arguments.length!==0){if(arguments.length===1){var n=arguments[0];this._level=n}}},Xd={serialVersionUID:{configurable:!0}};Nn.prototype.getLevel=function(){return this._level},Nn.prototype.size=function(){return this._childBoundables.size()},Nn.prototype.getChildBoundables=function(){return this._childBoundables},Nn.prototype.addChildBoundable=function(n){b.isTrue(this._bounds===null),this._childBoundables.add(n)},Nn.prototype.isEmpty=function(){return this._childBoundables.isEmpty()},Nn.prototype.getBounds=function(){return this._bounds===null&&(this._bounds=this.computeBounds()),this._bounds},Nn.prototype.interfaces_=function(){return[la,t]},Nn.prototype.getClass=function(){return Nn},Xd.serialVersionUID.get=function(){return 6493722185909574e3},Object.defineProperties(Nn,Xd);var di=function(){};di.reverseOrder=function(){return{compare:function(n,i){return i.compareTo(n)}}},di.min=function(n){return di.sort(n),n.get(0)},di.sort=function(n,i){var s=n.toArray();i?Bi.sort(s,i):Bi.sort(s);for(var u=n.iterator(),c=0,m=s.length;c<m;c++)u.next(),u.set(s[c])},di.singletonList=function(n){var i=new j;return i.add(n),i};var Cn=function(){this._boundable1=null,this._boundable2=null,this._distance=null,this._itemDistance=null;var n=arguments[0],i=arguments[1],s=arguments[2];this._boundable1=n,this._boundable2=i,this._itemDistance=s,this._distance=this.distance()};Cn.prototype.expandToQueue=function(n,i){var s=Cn.isComposite(this._boundable1),u=Cn.isComposite(this._boundable2);if(s&&u)return Cn.area(this._boundable1)>Cn.area(this._boundable2)?(this.expand(this._boundable1,this._boundable2,n,i),null):(this.expand(this._boundable2,this._boundable1,n,i),null);if(s)return this.expand(this._boundable1,this._boundable2,n,i),null;if(u)return this.expand(this._boundable2,this._boundable1,n,i),null;throw new C("neither boundable is composite")},Cn.prototype.isLeaves=function(){return!(Cn.isComposite(this._boundable1)||Cn.isComposite(this._boundable2))},Cn.prototype.compareTo=function(n){var i=n;return this._distance<i._distance?-1:this._distance>i._distance?1:0},Cn.prototype.expand=function(n,i,s,u){for(var c=n.getChildBoundables().iterator();c.hasNext();){var m=c.next(),E=new Cn(m,i,this._itemDistance);E.getDistance()<u&&s.add(E)}},Cn.prototype.getBoundable=function(n){return n===0?this._boundable1:this._boundable2},Cn.prototype.getDistance=function(){return this._distance},Cn.prototype.distance=function(){return this.isLeaves()?this._itemDistance.distance(this._boundable1,this._boundable2):this._boundable1.getBounds().distance(this._boundable2.getBounds())},Cn.prototype.interfaces_=function(){return[F]},Cn.prototype.getClass=function(){return Cn},Cn.area=function(n){return n.getBounds().getArea()},Cn.isComposite=function(n){return n instanceof Nn};var zn=function n(){if(this._root=null,this._built=!1,this._itemBoundables=new j,this._nodeCapacity=null,arguments.length===0){var i=n.DEFAULT_NODE_CAPACITY;this._nodeCapacity=i}else if(arguments.length===1){var s=arguments[0];b.isTrue(s>1,"Node capacity must be greater than 1"),this._nodeCapacity=s}},Sl={IntersectsOp:{configurable:!0},serialVersionUID:{configurable:!0},DEFAULT_NODE_CAPACITY:{configurable:!0}};zn.prototype.getNodeCapacity=function(){return this._nodeCapacity},zn.prototype.lastNode=function(n){return n.get(n.size()-1)},zn.prototype.size=function(){if(arguments.length===0)return this.isEmpty()?0:(this.build(),this.size(this._root));if(arguments.length===1){for(var n=0,i=arguments[0].getChildBoundables().iterator();i.hasNext();){var s=i.next();s instanceof Nn?n+=this.size(s):s instanceof pi&&(n+=1)}return n}},zn.prototype.removeItem=function(n,i){for(var s=null,u=n.getChildBoundables().iterator();u.hasNext();){var c=u.next();c instanceof pi&&c.getItem()===i&&(s=c)}return s!==null&&(n.getChildBoundables().remove(s),!0)},zn.prototype.itemsTree=function(){if(arguments.length===0){this.build();var n=this.itemsTree(this._root);return n===null?new j:n}if(arguments.length===1){for(var i=arguments[0],s=new j,u=i.getChildBoundables().iterator();u.hasNext();){var c=u.next();if(c instanceof Nn){var m=this.itemsTree(c);m!==null&&s.add(m)}else c instanceof pi?s.add(c.getItem()):b.shouldNeverReachHere()}return s.size()<=0?null:s}},zn.prototype.insert=function(n,i){b.isTrue(!this._built,"Cannot insert items into an STR packed R-tree after it has been built."),this._itemBoundables.add(new pi(n,i))},zn.prototype.boundablesAtLevel=function(){if(arguments.length===1){var n=arguments[0],i=new j;return this.boundablesAtLevel(n,this._root,i),i}if(arguments.length===3){var s=arguments[0],u=arguments[1],c=arguments[2];if(b.isTrue(s>-2),u.getLevel()===s)return c.add(u),null;for(var m=u.getChildBoundables().iterator();m.hasNext();){var E=m.next();E instanceof Nn?this.boundablesAtLevel(s,E,c):(b.isTrue(E instanceof pi),s===-1&&c.add(E))}return null}},zn.prototype.query=function(){if(arguments.length===1){var n=arguments[0];this.build();var i=new j;return this.isEmpty()||this.getIntersectsOp().intersects(this._root.getBounds(),n)&&this.query(n,this._root,i),i}if(arguments.length===2){var s=arguments[0],u=arguments[1];if(this.build(),this.isEmpty())return null;this.getIntersectsOp().intersects(this._root.getBounds(),s)&&this.query(s,this._root,u)}else if(arguments.length===3){if(X(arguments[2],bo)&&arguments[0]instanceof Object&&arguments[1]instanceof Nn)for(var c=arguments[0],m=arguments[1],E=arguments[2],A=m.getChildBoundables(),U=0;U<A.size();U++){var Z=A.get(U);this.getIntersectsOp().intersects(Z.getBounds(),c)&&(Z instanceof Nn?this.query(c,Z,E):Z instanceof pi?E.visitItem(Z.getItem()):b.shouldNeverReachHere())}else if(X(arguments[2],wt)&&arguments[0]instanceof Object&&arguments[1]instanceof Nn)for(var ut=arguments[0],ht=arguments[1],At=arguments[2],Rt=ht.getChildBoundables(),kt=0;kt<Rt.size();kt++){var ee=Rt.get(kt);this.getIntersectsOp().intersects(ee.getBounds(),ut)&&(ee instanceof Nn?this.query(ut,ee,At):ee instanceof pi?At.add(ee.getItem()):b.shouldNeverReachHere())}}},zn.prototype.build=function(){if(this._built)return null;this._root=this._itemBoundables.isEmpty()?this.createNode(0):this.createHigherLevels(this._itemBoundables,-1),this._itemBoundables=null,this._built=!0},zn.prototype.getRoot=function(){return this.build(),this._root},zn.prototype.remove=function(){if(arguments.length===2){var n=arguments[0],i=arguments[1];return this.build(),!!this.getIntersectsOp().intersects(this._root.getBounds(),n)&&this.remove(n,this._root,i)}if(arguments.length===3){var s=arguments[0],u=arguments[1],c=arguments[2],m=this.removeItem(u,c);if(m)return!0;for(var E=null,A=u.getChildBoundables().iterator();A.hasNext();){var U=A.next();if(this.getIntersectsOp().intersects(U.getBounds(),s)&&U instanceof Nn&&(m=this.remove(s,U,c))){E=U;break}}return E!==null&&E.getChildBoundables().isEmpty()&&u.getChildBoundables().remove(E),m}},zn.prototype.createHigherLevels=function(n,i){b.isTrue(!n.isEmpty());var s=this.createParentBoundables(n,i+1);return s.size()===1?s.get(0):this.createHigherLevels(s,i+1)},zn.prototype.depth=function(){if(arguments.length===0)return this.isEmpty()?0:(this.build(),this.depth(this._root));if(arguments.length===1){for(var n=0,i=arguments[0].getChildBoundables().iterator();i.hasNext();){var s=i.next();if(s instanceof Nn){var u=this.depth(s);u>n&&(n=u)}}return n+1}},zn.prototype.createParentBoundables=function(n,i){b.isTrue(!n.isEmpty());var s=new j;s.add(this.createNode(i));var u=new j(n);di.sort(u,this.getComparator());for(var c=u.iterator();c.hasNext();){var m=c.next();this.lastNode(s).getChildBoundables().size()===this.getNodeCapacity()&&s.add(this.createNode(i)),this.lastNode(s).addChildBoundable(m)}return s},zn.prototype.isEmpty=function(){return this._built?this._root.isEmpty():this._itemBoundables.isEmpty()},zn.prototype.interfaces_=function(){return[t]},zn.prototype.getClass=function(){return zn},zn.compareDoubles=function(n,i){return n>i?1:n<i?-1:0},Sl.IntersectsOp.get=function(){return C1},Sl.serialVersionUID.get=function(){return-3886435814360241e3},Sl.DEFAULT_NODE_CAPACITY.get=function(){return 10},Object.defineProperties(zn,Sl);var C1=function(){},ca=function(){};ca.prototype.distance=function(n,i){},ca.prototype.interfaces_=function(){return[]},ca.prototype.getClass=function(){return ca};var Yd=function(n){function i(u){u=u||i.DEFAULT_NODE_CAPACITY,n.call(this,u)}n&&(i.__proto__=n),(i.prototype=Object.create(n&&n.prototype)).constructor=i;var s={STRtreeNode:{configurable:!0},serialVersionUID:{configurable:!0},xComparator:{configurable:!0},yComparator:{configurable:!0},intersectsOp:{configurable:!0},DEFAULT_NODE_CAPACITY:{configurable:!0}};return i.prototype.createParentBoundablesFromVerticalSlices=function(u,c){b.isTrue(u.length>0);for(var m=new j,E=0;E<u.length;E++)m.addAll(this.createParentBoundablesFromVerticalSlice(u[E],c));return m},i.prototype.createNode=function(u){return new Zd(u)},i.prototype.size=function(){return arguments.length===0?n.prototype.size.call(this):n.prototype.size.apply(this,arguments)},i.prototype.insert=function(){if(arguments.length!==2)return n.prototype.insert.apply(this,arguments);var u=arguments[0],c=arguments[1];if(u.isNull())return null;n.prototype.insert.call(this,u,c)},i.prototype.getIntersectsOp=function(){return i.intersectsOp},i.prototype.verticalSlices=function(u,c){for(var m=Math.trunc(Math.ceil(u.size()/c)),E=new Array(c).fill(null),A=u.iterator(),U=0;U<c;U++){E[U]=new j;for(var Z=0;A.hasNext()&&Z<m;){var ut=A.next();E[U].add(ut),Z++}}return E},i.prototype.query=function(){if(arguments.length===1){var u=arguments[0];return n.prototype.query.call(this,u)}if(arguments.length===2){var c=arguments[0],m=arguments[1];n.prototype.query.call(this,c,m)}else if(arguments.length===3){if(X(arguments[2],bo)&&arguments[0]instanceof Object&&arguments[1]instanceof Nn){var E=arguments[0],A=arguments[1],U=arguments[2];n.prototype.query.call(this,E,A,U)}else if(X(arguments[2],wt)&&arguments[0]instanceof Object&&arguments[1]instanceof Nn){var Z=arguments[0],ut=arguments[1],ht=arguments[2];n.prototype.query.call(this,Z,ut,ht)}}},i.prototype.getComparator=function(){return i.yComparator},i.prototype.createParentBoundablesFromVerticalSlice=function(u,c){return n.prototype.createParentBoundables.call(this,u,c)},i.prototype.remove=function(){if(arguments.length===2){var u=arguments[0],c=arguments[1];return n.prototype.remove.call(this,u,c)}return n.prototype.remove.apply(this,arguments)},i.prototype.depth=function(){return arguments.length===0?n.prototype.depth.call(this):n.prototype.depth.apply(this,arguments)},i.prototype.createParentBoundables=function(u,c){b.isTrue(!u.isEmpty());var m=Math.trunc(Math.ceil(u.size()/this.getNodeCapacity())),E=new j(u);di.sort(E,i.xComparator);var A=this.verticalSlices(E,Math.trunc(Math.ceil(Math.sqrt(m))));return this.createParentBoundablesFromVerticalSlices(A,c)},i.prototype.nearestNeighbour=function(){if(arguments.length===1){if(X(arguments[0],ca)){var u=arguments[0],c=new Cn(this.getRoot(),this.getRoot(),u);return this.nearestNeighbour(c)}if(arguments[0]instanceof Cn){var m=arguments[0];return this.nearestNeighbour(m,S.POSITIVE_INFINITY)}}else if(arguments.length===2){if(arguments[0]instanceof i&&X(arguments[1],ca)){var E=arguments[0],A=arguments[1],U=new Cn(this.getRoot(),E.getRoot(),A);return this.nearestNeighbour(U)}if(arguments[0]instanceof Cn&&typeof arguments[1]=="number"){var Z=arguments[0],ut=arguments[1],ht=null,At=new ao;for(At.add(Z);!At.isEmpty()&&ut>0;){var Rt=At.poll(),kt=Rt.getDistance();if(kt>=ut)break;Rt.isLeaves()?(ut=kt,ht=Rt):Rt.expandToQueue(At,ut)}return[ht.getBoundable(0).getItem(),ht.getBoundable(1).getItem()]}}else if(arguments.length===3){var ee=arguments[0],on=arguments[1],In=arguments[2],pr=new pi(ee,on),Zi=new Cn(this.getRoot(),pr,In);return this.nearestNeighbour(Zi)[0]}},i.prototype.interfaces_=function(){return[Cs,t]},i.prototype.getClass=function(){return i},i.centreX=function(u){return i.avg(u.getMinX(),u.getMaxX())},i.avg=function(u,c){return(u+c)/2},i.centreY=function(u){return i.avg(u.getMinY(),u.getMaxY())},s.STRtreeNode.get=function(){return Zd},s.serialVersionUID.get=function(){return 0x39920f7d5f261e0},s.xComparator.get=function(){return{interfaces_:function(){return[z]},compare:function(u,c){return n.compareDoubles(i.centreX(u.getBounds()),i.centreX(c.getBounds()))}}},s.yComparator.get=function(){return{interfaces_:function(){return[z]},compare:function(u,c){return n.compareDoubles(i.centreY(u.getBounds()),i.centreY(c.getBounds()))}}},s.intersectsOp.get=function(){return{interfaces_:function(){return[n.IntersectsOp]},intersects:function(u,c){return u.intersects(c)}}},s.DEFAULT_NODE_CAPACITY.get=function(){return 10},Object.defineProperties(i,s),i}(zn),Zd=function(n){function i(){var s=arguments[0];n.call(this,s)}return n&&(i.__proto__=n),i.prototype=Object.create(n&&n.prototype),i.prototype.constructor=i,i.prototype.computeBounds=function(){for(var s=null,u=this.getChildBoundables().iterator();u.hasNext();){var c=u.next();s===null?s=new Pt(c.getBounds()):s.expandToInclude(c.getBounds())}return s},i.prototype.interfaces_=function(){return[]},i.prototype.getClass=function(){return i},i}(Nn),Er=function(){};Er.prototype.interfaces_=function(){return[]},Er.prototype.getClass=function(){return Er},Er.relativeSign=function(n,i){return n<i?-1:n>i?1:0},Er.compare=function(n,i,s){if(i.equals2D(s))return 0;var u=Er.relativeSign(i.x,s.x),c=Er.relativeSign(i.y,s.y);switch(n){case 0:return Er.compareValue(u,c);case 1:return Er.compareValue(c,u);case 2:return Er.compareValue(c,-u);case 3:return Er.compareValue(-u,c);case 4:return Er.compareValue(-u,-c);case 5:return Er.compareValue(-c,-u);case 6:return Er.compareValue(-c,u);case 7:return Er.compareValue(u,-c)}return b.shouldNeverReachHere("invalid octant value"),0},Er.compareValue=function(n,i){return n<0?-1:n>0?1:i<0?-1:i>0?1:0};var To=function(){this._segString=null,this.coord=null,this.segmentIndex=null,this._segmentOctant=null,this._isInterior=null;var n=arguments[0],i=arguments[1],s=arguments[2],u=arguments[3];this._segString=n,this.coord=new L(i),this.segmentIndex=s,this._segmentOctant=u,this._isInterior=!i.equals2D(n.getCoordinate(s))};To.prototype.getCoordinate=function(){return this.coord},To.prototype.print=function(n){n.print(this.coord),n.print(" seg # = "+this.segmentIndex)},To.prototype.compareTo=function(n){var i=n;return this.segmentIndex<i.segmentIndex?-1:this.segmentIndex>i.segmentIndex?1:this.coord.equals2D(i.coord)?0:Er.compare(this._segmentOctant,this.coord,i.coord)},To.prototype.isEndPoint=function(n){return this.segmentIndex===0&&!this._isInterior||this.segmentIndex===n},To.prototype.isInterior=function(){return this._isInterior},To.prototype.interfaces_=function(){return[F]},To.prototype.getClass=function(){return To};var ar=function(){this._nodeMap=new _,this._edge=null;var n=arguments[0];this._edge=n};ar.prototype.getSplitCoordinates=function(){var n=new Dt;this.addEndpoints();for(var i=this.iterator(),s=i.next();i.hasNext();){var u=i.next();this.addEdgeCoordinates(s,u,n),s=u}return n.toCoordinateArray()},ar.prototype.addCollapsedNodes=function(){var n=new j;this.findCollapsesFromInsertedNodes(n),this.findCollapsesFromExistingVertices(n);for(var i=n.iterator();i.hasNext();){var s=i.next().intValue();this.add(this._edge.getCoordinate(s),s)}},ar.prototype.print=function(n){n.println("Intersections:");for(var i=this.iterator();i.hasNext();)i.next().print(n)},ar.prototype.findCollapsesFromExistingVertices=function(n){for(var i=0;i<this._edge.size()-2;i++){var s=this._edge.getCoordinate(i),u=this._edge.getCoordinate(i+2);s.equals2D(u)&&n.add(new et(i+1))}},ar.prototype.addEdgeCoordinates=function(n,i,s){var u=this._edge.getCoordinate(i.segmentIndex),c=i.isInterior()||!i.coord.equals2D(u);s.add(new L(n.coord),!1);for(var m=n.segmentIndex+1;m<=i.segmentIndex;m++)s.add(this._edge.getCoordinate(m));c&&s.add(new L(i.coord))},ar.prototype.iterator=function(){return this._nodeMap.values().iterator()},ar.prototype.addSplitEdges=function(n){this.addEndpoints(),this.addCollapsedNodes();for(var i=this.iterator(),s=i.next();i.hasNext();){var u=i.next(),c=this.createSplitEdge(s,u);n.add(c),s=u}},ar.prototype.findCollapseIndex=function(n,i,s){if(!n.coord.equals2D(i.coord))return!1;var u=i.segmentIndex-n.segmentIndex;return i.isInterior()||u--,u===1&&(s[0]=n.segmentIndex+1,!0)},ar.prototype.findCollapsesFromInsertedNodes=function(n){for(var i=new Array(1).fill(null),s=this.iterator(),u=s.next();s.hasNext();){var c=s.next();this.findCollapseIndex(u,c,i)&&n.add(new et(i[0])),u=c}},ar.prototype.getEdge=function(){return this._edge},ar.prototype.addEndpoints=function(){var n=this._edge.size()-1;this.add(this._edge.getCoordinate(0),0),this.add(this._edge.getCoordinate(n),n)},ar.prototype.createSplitEdge=function(n,i){var s=i.segmentIndex-n.segmentIndex+2,u=this._edge.getCoordinate(i.segmentIndex),c=i.isInterior()||!i.coord.equals2D(u);c||s--;var m=new Array(s).fill(null),E=0;m[E++]=new L(n.coord);for(var A=n.segmentIndex+1;A<=i.segmentIndex;A++)m[E++]=this._edge.getCoordinate(A);return c&&(m[E]=new L(i.coord)),new wn(m,this._edge.getData())},ar.prototype.add=function(n,i){var s=new To(this._edge,n,i,this._edge.getSegmentOctant(i)),u=this._nodeMap.get(s);return u!==null?(b.isTrue(u.coord.equals2D(n),"Found equal nodes with different coordinates"),u):(this._nodeMap.put(s,s),s)},ar.prototype.checkSplitEdgesCorrectness=function(n){var i=this._edge.getCoordinates(),s=n.get(0).getCoordinate(0);if(!s.equals2D(i[0]))throw new $("bad split edge start point at "+s);var u=n.get(n.size()-1).getCoordinates(),c=u[u.length-1];if(!c.equals2D(i[i.length-1]))throw new $("bad split edge end point at "+c)},ar.prototype.interfaces_=function(){return[]},ar.prototype.getClass=function(){return ar};var Ps=function(){};Ps.prototype.interfaces_=function(){return[]},Ps.prototype.getClass=function(){return Ps},Ps.octant=function(){if(typeof arguments[0]=="number"&&typeof arguments[1]=="number"){var n=arguments[0],i=arguments[1];if(n===0&&i===0)throw new C("Cannot compute the octant for point ( "+n+", "+i+" )");var s=Math.abs(n),u=Math.abs(i);return n>=0?i>=0?s>=u?0:1:s>=u?7:6:i>=0?s>=u?3:2:s>=u?4:5}if(arguments[0]instanceof L&&arguments[1]instanceof L){var c=arguments[0],m=arguments[1],E=m.x-c.x,A=m.y-c.y;if(E===0&&A===0)throw new C("Cannot compute the octant for two identical points "+c);return Ps.octant(E,A)}};var ki=function(){};ki.prototype.getCoordinates=function(){},ki.prototype.size=function(){},ki.prototype.getCoordinate=function(n){},ki.prototype.isClosed=function(){},ki.prototype.setData=function(n){},ki.prototype.getData=function(){},ki.prototype.interfaces_=function(){return[]},ki.prototype.getClass=function(){return ki};var _u=function(){};_u.prototype.addIntersection=function(n,i){},_u.prototype.interfaces_=function(){return[ki]},_u.prototype.getClass=function(){return _u};var wn=function(){this._nodeList=new ar(this),this._pts=null,this._data=null;var n=arguments[0],i=arguments[1];this._pts=n,this._data=i};wn.prototype.getCoordinates=function(){return this._pts},wn.prototype.size=function(){return this._pts.length},wn.prototype.getCoordinate=function(n){return this._pts[n]},wn.prototype.isClosed=function(){return this._pts[0].equals(this._pts[this._pts.length-1])},wn.prototype.getSegmentOctant=function(n){return n===this._pts.length-1?-1:this.safeOctant(this.getCoordinate(n),this.getCoordinate(n+1))},wn.prototype.setData=function(n){this._data=n},wn.prototype.safeOctant=function(n,i){return n.equals2D(i)?0:Ps.octant(n,i)},wn.prototype.getData=function(){return this._data},wn.prototype.addIntersection=function(){if(arguments.length===2){var n=arguments[0],i=arguments[1];this.addIntersectionNode(n,i)}else if(arguments.length===4){var s=arguments[0],u=arguments[1],c=arguments[3],m=new L(s.getIntersection(c));this.addIntersection(m,u)}},wn.prototype.toString=function(){return qt.toLineString(new he(this._pts))},wn.prototype.getNodeList=function(){return this._nodeList},wn.prototype.addIntersectionNode=function(n,i){var s=i,u=s+1;if(u<this._pts.length){var c=this._pts[u];n.equals2D(c)&&(s=u)}return this._nodeList.add(n,s)},wn.prototype.addIntersections=function(n,i,s){for(var u=0;u<n.getIntersectionNum();u++)this.addIntersection(n,i,s,u)},wn.prototype.interfaces_=function(){return[_u]},wn.prototype.getClass=function(){return wn},wn.getNodedSubstrings=function(){if(arguments.length===1){var n=arguments[0],i=new j;return wn.getNodedSubstrings(n,i),i}if(arguments.length===2)for(var s=arguments[0],u=arguments[1],c=s.iterator();c.hasNext();)c.next().getNodeList().addSplitEdges(u)};var Zt=function(){if(this.p0=null,this.p1=null,arguments.length===0)this.p0=new L,this.p1=new L;else if(arguments.length===1){var n=arguments[0];this.p0=new L(n.p0),this.p1=new L(n.p1)}else if(arguments.length===2)this.p0=arguments[0],this.p1=arguments[1];else if(arguments.length===4){var i=arguments[0],s=arguments[1],u=arguments[2],c=arguments[3];this.p0=new L(i,s),this.p1=new L(u,c)}},Jd={serialVersionUID:{configurable:!0}};Zt.prototype.minX=function(){return Math.min(this.p0.x,this.p1.x)},Zt.prototype.orientationIndex=function(){if(arguments[0]instanceof Zt){var n=arguments[0],i=B.orientationIndex(this.p0,this.p1,n.p0),s=B.orientationIndex(this.p0,this.p1,n.p1);return i>=0&&s>=0||i<=0&&s<=0?Math.max(i,s):0}if(arguments[0]instanceof L){var u=arguments[0];return B.orientationIndex(this.p0,this.p1,u)}},Zt.prototype.toGeometry=function(n){return n.createLineString([this.p0,this.p1])},Zt.prototype.isVertical=function(){return this.p0.x===this.p1.x},Zt.prototype.equals=function(n){if(!(n instanceof Zt))return!1;var i=n;return this.p0.equals(i.p0)&&this.p1.equals(i.p1)},Zt.prototype.intersection=function(n){var i=new J;return i.computeIntersection(this.p0,this.p1,n.p0,n.p1),i.hasIntersection()?i.getIntersection(0):null},Zt.prototype.project=function(){if(arguments[0]instanceof L){var n=arguments[0];if(n.equals(this.p0)||n.equals(this.p1))return new L(n);var i=this.projectionFactor(n),s=new L;return s.x=this.p0.x+i*(this.p1.x-this.p0.x),s.y=this.p0.y+i*(this.p1.y-this.p0.y),s}if(arguments[0]instanceof Zt){var u=arguments[0],c=this.projectionFactor(u.p0),m=this.projectionFactor(u.p1);if(c>=1&&m>=1||c<=0&&m<=0)return null;var E=this.project(u.p0);c<0&&(E=this.p0),c>1&&(E=this.p1);var A=this.project(u.p1);return m<0&&(A=this.p0),m>1&&(A=this.p1),new Zt(E,A)}},Zt.prototype.normalize=function(){this.p1.compareTo(this.p0)<0&&this.reverse()},Zt.prototype.angle=function(){return Math.atan2(this.p1.y-this.p0.y,this.p1.x-this.p0.x)},Zt.prototype.getCoordinate=function(n){return n===0?this.p0:this.p1},Zt.prototype.distancePerpendicular=function(n){return B.distancePointLinePerpendicular(n,this.p0,this.p1)},Zt.prototype.minY=function(){return Math.min(this.p0.y,this.p1.y)},Zt.prototype.midPoint=function(){return Zt.midPoint(this.p0,this.p1)},Zt.prototype.projectionFactor=function(n){if(n.equals(this.p0))return 0;if(n.equals(this.p1))return 1;var i=this.p1.x-this.p0.x,s=this.p1.y-this.p0.y,u=i*i+s*s;return u<=0?S.NaN:((n.x-this.p0.x)*i+(n.y-this.p0.y)*s)/u},Zt.prototype.closestPoints=function(n){var i=this.intersection(n);if(i!==null)return[i,i];var s=new Array(2).fill(null),u=S.MAX_VALUE,c=null,m=this.closestPoint(n.p0);u=m.distance(n.p0),s[0]=m,s[1]=n.p0;var E=this.closestPoint(n.p1);(c=E.distance(n.p1))<u&&(u=c,s[0]=E,s[1]=n.p1);var A=n.closestPoint(this.p0);(c=A.distance(this.p0))<u&&(u=c,s[0]=this.p0,s[1]=A);var U=n.closestPoint(this.p1);return(c=U.distance(this.p1))<u&&(u=c,s[0]=this.p1,s[1]=U),s},Zt.prototype.closestPoint=function(n){var i=this.projectionFactor(n);return i>0&&i<1?this.project(n):this.p0.distance(n)<this.p1.distance(n)?this.p0:this.p1},Zt.prototype.maxX=function(){return Math.max(this.p0.x,this.p1.x)},Zt.prototype.getLength=function(){return this.p0.distance(this.p1)},Zt.prototype.compareTo=function(n){var i=n,s=this.p0.compareTo(i.p0);return s!==0?s:this.p1.compareTo(i.p1)},Zt.prototype.reverse=function(){var n=this.p0;this.p0=this.p1,this.p1=n},Zt.prototype.equalsTopo=function(n){return this.p0.equals(n.p0)&&(this.p1.equals(n.p1)||this.p0.equals(n.p1))&&this.p1.equals(n.p0)},Zt.prototype.lineIntersection=function(n){try{return ne.intersection(this.p0,this.p1,n.p0,n.p1)}catch(i){if(!(i instanceof Wt))throw i}return null},Zt.prototype.maxY=function(){return Math.max(this.p0.y,this.p1.y)},Zt.prototype.pointAlongOffset=function(n,i){var s=this.p0.x+n*(this.p1.x-this.p0.x),u=this.p0.y+n*(this.p1.y-this.p0.y),c=this.p1.x-this.p0.x,m=this.p1.y-this.p0.y,E=Math.sqrt(c*c+m*m),A=0,U=0;if(i!==0){if(E<=0)throw new Error("Cannot compute offset from zero-length line segment");A=i*c/E,U=i*m/E}return new L(s-U,u+A)},Zt.prototype.setCoordinates=function(){if(arguments.length===1){var n=arguments[0];this.setCoordinates(n.p0,n.p1)}else if(arguments.length===2){var i=arguments[0],s=arguments[1];this.p0.x=i.x,this.p0.y=i.y,this.p1.x=s.x,this.p1.y=s.y}},Zt.prototype.segmentFraction=function(n){var i=this.projectionFactor(n);return i<0?i=0:(i>1||S.isNaN(i))&&(i=1),i},Zt.prototype.toString=function(){return"LINESTRING( "+this.p0.x+" "+this.p0.y+", "+this.p1.x+" "+this.p1.y+")"},Zt.prototype.isHorizontal=function(){return this.p0.y===this.p1.y},Zt.prototype.distance=function(){if(arguments[0]instanceof Zt){var n=arguments[0];return B.distanceLineLine(this.p0,this.p1,n.p0,n.p1)}if(arguments[0]instanceof L){var i=arguments[0];return B.distancePointLine(i,this.p0,this.p1)}},Zt.prototype.pointAlong=function(n){var i=new L;return i.x=this.p0.x+n*(this.p1.x-this.p0.x),i.y=this.p0.y+n*(this.p1.y-this.p0.y),i},Zt.prototype.hashCode=function(){var n=S.doubleToLongBits(this.p0.x);n^=31*S.doubleToLongBits(this.p0.y);var i=Math.trunc(n)^Math.trunc(n>>32),s=S.doubleToLongBits(this.p1.x);return s^=31*S.doubleToLongBits(this.p1.y),i^(Math.trunc(s)^Math.trunc(s>>32))},Zt.prototype.interfaces_=function(){return[F,t]},Zt.prototype.getClass=function(){return Zt},Zt.midPoint=function(n,i){return new L((n.x+i.x)/2,(n.y+i.y)/2)},Jd.serialVersionUID.get=function(){return 0x2d2172135f411c00},Object.defineProperties(Zt,Jd);var xu=function(){this.tempEnv1=new Pt,this.tempEnv2=new Pt,this._overlapSeg1=new Zt,this._overlapSeg2=new Zt};xu.prototype.overlap=function(){if(arguments.length!==2){if(arguments.length===4){var n=arguments[0],i=arguments[1],s=arguments[2],u=arguments[3];n.getLineSegment(i,this._overlapSeg1),s.getLineSegment(u,this._overlapSeg2),this.overlap(this._overlapSeg1,this._overlapSeg2)}}},xu.prototype.interfaces_=function(){return[]},xu.prototype.getClass=function(){return xu};var Or=function(){this._pts=null,this._start=null,this._end=null,this._env=null,this._context=null,this._id=null;var n=arguments[0],i=arguments[1],s=arguments[2],u=arguments[3];this._pts=n,this._start=i,this._end=s,this._context=u};Or.prototype.getLineSegment=function(n,i){i.p0=this._pts[n],i.p1=this._pts[n+1]},Or.prototype.computeSelect=function(n,i,s,u){var c=this._pts[i],m=this._pts[s];if(u.tempEnv1.init(c,m),s-i==1)return u.select(this,i),null;if(!n.intersects(u.tempEnv1))return null;var E=Math.trunc((i+s)/2);i<E&&this.computeSelect(n,i,E,u),E<s&&this.computeSelect(n,E,s,u)},Or.prototype.getCoordinates=function(){for(var n=new Array(this._end-this._start+1).fill(null),i=0,s=this._start;s<=this._end;s++)n[i++]=this._pts[s];return n},Or.prototype.computeOverlaps=function(n,i){this.computeOverlapsInternal(this._start,this._end,n,n._start,n._end,i)},Or.prototype.setId=function(n){this._id=n},Or.prototype.select=function(n,i){this.computeSelect(n,this._start,this._end,i)},Or.prototype.getEnvelope=function(){if(this._env===null){var n=this._pts[this._start],i=this._pts[this._end];this._env=new Pt(n,i)}return this._env},Or.prototype.getEndIndex=function(){return this._end},Or.prototype.getStartIndex=function(){return this._start},Or.prototype.getContext=function(){return this._context},Or.prototype.getId=function(){return this._id},Or.prototype.computeOverlapsInternal=function(n,i,s,u,c,m){var E=this._pts[n],A=this._pts[i],U=s._pts[u],Z=s._pts[c];if(i-n==1&&c-u==1)return m.overlap(this,n,s,u),null;if(m.tempEnv1.init(E,A),m.tempEnv2.init(U,Z),!m.tempEnv1.intersects(m.tempEnv2))return null;var ut=Math.trunc((n+i)/2),ht=Math.trunc((u+c)/2);n<ut&&(u<ht&&this.computeOverlapsInternal(n,ut,s,u,ht,m),ht<c&&this.computeOverlapsInternal(n,ut,s,ht,c,m)),ut<i&&(u<ht&&this.computeOverlapsInternal(ut,i,s,u,ht,m),ht<c&&this.computeOverlapsInternal(ut,i,s,ht,c,m))},Or.prototype.interfaces_=function(){return[]},Or.prototype.getClass=function(){return Or};var Ai=function(){};Ai.prototype.interfaces_=function(){return[]},Ai.prototype.getClass=function(){return Ai},Ai.getChainStartIndices=function(n){var i=0,s=new j;s.add(new et(i));do{var u=Ai.findChainEnd(n,i);s.add(new et(u)),i=u}while(i<n.length-1);return Ai.toIntArray(s)},Ai.findChainEnd=function(n,i){for(var s=i;s<n.length-1&&n[s].equals2D(n[s+1]);)s++;if(s>=n.length-1)return n.length-1;for(var u=ln.quadrant(n[s],n[s+1]),c=i+1;c<n.length&&!(!n[c-1].equals2D(n[c])&&ln.quadrant(n[c-1],n[c])!==u);)c++;return c-1},Ai.getChains=function(){if(arguments.length===1){var n=arguments[0];return Ai.getChains(n,null)}if(arguments.length===2){for(var i=arguments[0],s=arguments[1],u=new j,c=Ai.getChainStartIndices(i),m=0;m<c.length-1;m++){var E=new Or(i,c[m],c[m+1],s);u.add(E)}return u}},Ai.toIntArray=function(n){for(var i=new Array(n.size()).fill(null),s=0;s<i.length;s++)i[s]=n.get(s).intValue();return i};var Ko=function(){};Ko.prototype.computeNodes=function(n){},Ko.prototype.getNodedSubstrings=function(){},Ko.prototype.interfaces_=function(){return[]},Ko.prototype.getClass=function(){return Ko};var Eu=function(){if(this._segInt=null,arguments.length!==0){if(arguments.length===1){var n=arguments[0];this.setSegmentIntersector(n)}}};Eu.prototype.setSegmentIntersector=function(n){this._segInt=n},Eu.prototype.interfaces_=function(){return[Ko]},Eu.prototype.getClass=function(){return Eu};var Ef=function(n){function i(u){u?n.call(this,u):n.call(this),this._monoChains=new j,this._index=new Yd,this._idCounter=0,this._nodedSegStrings=null,this._nOverlaps=0}n&&(i.__proto__=n),(i.prototype=Object.create(n&&n.prototype)).constructor=i;var s={SegmentOverlapAction:{configurable:!0}};return i.prototype.getMonotoneChains=function(){return this._monoChains},i.prototype.getNodedSubstrings=function(){return wn.getNodedSubstrings(this._nodedSegStrings)},i.prototype.getIndex=function(){return this._index},i.prototype.add=function(u){for(var c=Ai.getChains(u.getCoordinates(),u).iterator();c.hasNext();){var m=c.next();m.setId(this._idCounter++),this._index.insert(m.getEnvelope(),m),this._monoChains.add(m)}},i.prototype.computeNodes=function(u){this._nodedSegStrings=u;for(var c=u.iterator();c.hasNext();)this.add(c.next());this.intersectChains()},i.prototype.intersectChains=function(){for(var u=new $d(this._segInt),c=this._monoChains.iterator();c.hasNext();)for(var m=c.next(),E=this._index.query(m.getEnvelope()).iterator();E.hasNext();){var A=E.next();if(A.getId()>m.getId()&&(m.computeOverlaps(A,u),this._nOverlaps++),this._segInt.isDone())return null}},i.prototype.interfaces_=function(){return[]},i.prototype.getClass=function(){return i},s.SegmentOverlapAction.get=function(){return $d},Object.defineProperties(i,s),i}(Eu),$d=function(n){function i(){n.call(this),this._si=null;var s=arguments[0];this._si=s}return n&&(i.__proto__=n),i.prototype=Object.create(n&&n.prototype),i.prototype.constructor=i,i.prototype.overlap=function(){if(arguments.length!==4)return n.prototype.overlap.apply(this,arguments);var s=arguments[0],u=arguments[1],c=arguments[2],m=arguments[3],E=s.getContext(),A=c.getContext();this._si.processIntersections(E,u,A,m)},i.prototype.interfaces_=function(){return[]},i.prototype.getClass=function(){return i},i}(xu),We=function n(){if(this._quadrantSegments=n.DEFAULT_QUADRANT_SEGMENTS,this._endCapStyle=n.CAP_ROUND,this._joinStyle=n.JOIN_ROUND,this._mitreLimit=n.DEFAULT_MITRE_LIMIT,this._isSingleSided=!1,this._simplifyFactor=n.DEFAULT_SIMPLIFY_FACTOR,arguments.length!==0){if(arguments.length===1){var i=arguments[0];this.setQuadrantSegments(i)}else if(arguments.length===2){var s=arguments[0],u=arguments[1];this.setQuadrantSegments(s),this.setEndCapStyle(u)}else if(arguments.length===4){var c=arguments[0],m=arguments[1],E=arguments[2],A=arguments[3];this.setQuadrantSegments(c),this.setEndCapStyle(m),this.setJoinStyle(E),this.setMitreLimit(A)}}},uo={CAP_ROUND:{configurable:!0},CAP_FLAT:{configurable:!0},CAP_SQUARE:{configurable:!0},JOIN_ROUND:{configurable:!0},JOIN_MITRE:{configurable:!0},JOIN_BEVEL:{configurable:!0},DEFAULT_QUADRANT_SEGMENTS:{configurable:!0},DEFAULT_MITRE_LIMIT:{configurable:!0},DEFAULT_SIMPLIFY_FACTOR:{configurable:!0}};We.prototype.getEndCapStyle=function(){return this._endCapStyle},We.prototype.isSingleSided=function(){return this._isSingleSided},We.prototype.setQuadrantSegments=function(n){this._quadrantSegments=n,this._quadrantSegments===0&&(this._joinStyle=We.JOIN_BEVEL),this._quadrantSegments<0&&(this._joinStyle=We.JOIN_MITRE,this._mitreLimit=Math.abs(this._quadrantSegments)),n<=0&&(this._quadrantSegments=1),this._joinStyle!==We.JOIN_ROUND&&(this._quadrantSegments=We.DEFAULT_QUADRANT_SEGMENTS)},We.prototype.getJoinStyle=function(){return this._joinStyle},We.prototype.setJoinStyle=function(n){this._joinStyle=n},We.prototype.setSimplifyFactor=function(n){this._simplifyFactor=n<0?0:n},We.prototype.getSimplifyFactor=function(){return this._simplifyFactor},We.prototype.getQuadrantSegments=function(){return this._quadrantSegments},We.prototype.setEndCapStyle=function(n){this._endCapStyle=n},We.prototype.getMitreLimit=function(){return this._mitreLimit},We.prototype.setMitreLimit=function(n){this._mitreLimit=n},We.prototype.setSingleSided=function(n){this._isSingleSided=n},We.prototype.interfaces_=function(){return[]},We.prototype.getClass=function(){return We},We.bufferDistanceError=function(n){var i=Math.PI/2/n;return 1-Math.cos(i/2)},uo.CAP_ROUND.get=function(){return 1},uo.CAP_FLAT.get=function(){return 2},uo.CAP_SQUARE.get=function(){return 3},uo.JOIN_ROUND.get=function(){return 1},uo.JOIN_MITRE.get=function(){return 2},uo.JOIN_BEVEL.get=function(){return 3},uo.DEFAULT_QUADRANT_SEGMENTS.get=function(){return 8},uo.DEFAULT_MITRE_LIMIT.get=function(){return 5},uo.DEFAULT_SIMPLIFY_FACTOR.get=function(){return .01},Object.defineProperties(We,uo);var Mn=function(n){this._distanceTol=null,this._isDeleted=null,this._angleOrientation=B.COUNTERCLOCKWISE,this._inputLine=n||null},Mu={INIT:{configurable:!0},DELETE:{configurable:!0},KEEP:{configurable:!0},NUM_PTS_TO_CHECK:{configurable:!0}};Mn.prototype.isDeletable=function(n,i,s,u){var c=this._inputLine[n],m=this._inputLine[i],E=this._inputLine[s];return!!this.isConcave(c,m,E)&&!!this.isShallow(c,m,E,u)&&this.isShallowSampled(c,m,n,s,u)},Mn.prototype.deleteShallowConcavities=function(){for(var n=1,i=this.findNextNonDeletedIndex(n),s=this.findNextNonDeletedIndex(i),u=!1;s<this._inputLine.length;){var c=!1;this.isDeletable(n,i,s,this._distanceTol)&&(this._isDeleted[i]=Mn.DELETE,c=!0,u=!0),n=c?s:i,i=this.findNextNonDeletedIndex(n),s=this.findNextNonDeletedIndex(i)}return u},Mn.prototype.isShallowConcavity=function(n,i,s,u){return B.computeOrientation(n,i,s)!==this._angleOrientation?!1:B.distancePointLine(i,n,s)<u},Mn.prototype.isShallowSampled=function(n,i,s,u,c){var m=Math.trunc((u-s)/Mn.NUM_PTS_TO_CHECK);m<=0&&(m=1);for(var E=s;E<u;E+=m)if(!this.isShallow(n,i,this._inputLine[E],c))return!1;return!0},Mn.prototype.isConcave=function(n,i,s){var u=B.computeOrientation(n,i,s)===this._angleOrientation;return u},Mn.prototype.simplify=function(n){this._distanceTol=Math.abs(n),n<0&&(this._angleOrientation=B.CLOCKWISE),this._isDeleted=new Array(this._inputLine.length).fill(null);var i=!1;do i=this.deleteShallowConcavities();while(i);return this.collapseLine()},Mn.prototype.findNextNonDeletedIndex=function(n){for(var i=n+1;i<this._inputLine.length&&this._isDeleted[i]===Mn.DELETE;)i++;return i},Mn.prototype.isShallow=function(n,i,s,u){return B.distancePointLine(i,n,s)<u},Mn.prototype.collapseLine=function(){for(var n=new Dt,i=0;i<this._inputLine.length;i++)this._isDeleted[i]!==Mn.DELETE&&n.add(this._inputLine[i]);return n.toCoordinateArray()},Mn.prototype.interfaces_=function(){return[]},Mn.prototype.getClass=function(){return Mn},Mn.simplify=function(n,i){return new Mn(n).simplify(i)},Mu.INIT.get=function(){return 0},Mu.DELETE.get=function(){return 1},Mu.KEEP.get=function(){return 1},Mu.NUM_PTS_TO_CHECK.get=function(){return 10},Object.defineProperties(Mn,Mu);var Wr=function(){this._ptList=null,this._precisionModel=null,this._minimimVertexDistance=0,this._ptList=new j},Kd={COORDINATE_ARRAY_TYPE:{configurable:!0}};Wr.prototype.getCoordinates=function(){return this._ptList.toArray(Wr.COORDINATE_ARRAY_TYPE)},Wr.prototype.setPrecisionModel=function(n){this._precisionModel=n},Wr.prototype.addPt=function(n){var i=new L(n);if(this._precisionModel.makePrecise(i),this.isRedundant(i))return null;this._ptList.add(i)},Wr.prototype.revere=function(){},Wr.prototype.addPts=function(n,i){if(i)for(var s=0;s<n.length;s++)this.addPt(n[s]);else for(var u=n.length-1;u>=0;u--)this.addPt(n[u])},Wr.prototype.isRedundant=function(n){if(this._ptList.size()<1)return!1;var i=this._ptList.get(this._ptList.size()-1);return n.distance(i)<this._minimimVertexDistance},Wr.prototype.toString=function(){return new le().createLineString(this.getCoordinates()).toString()},Wr.prototype.closeRing=function(){if(this._ptList.size()<1)return null;var n=new L(this._ptList.get(0)),i=this._ptList.get(this._ptList.size()-1);if(n.equals(i))return null;this._ptList.add(n)},Wr.prototype.setMinimumVertexDistance=function(n){this._minimimVertexDistance=n},Wr.prototype.interfaces_=function(){return[]},Wr.prototype.getClass=function(){return Wr},Kd.COORDINATE_ARRAY_TYPE.get=function(){return new Array(0).fill(null)},Object.defineProperties(Wr,Kd);var me=function(){},Is={PI_TIMES_2:{configurable:!0},PI_OVER_2:{configurable:!0},PI_OVER_4:{configurable:!0},COUNTERCLOCKWISE:{configurable:!0},CLOCKWISE:{configurable:!0},NONE:{configurable:!0}};me.prototype.interfaces_=function(){return[]},me.prototype.getClass=function(){return me},me.toDegrees=function(n){return 180*n/Math.PI},me.normalize=function(n){for(;n>Math.PI;)n-=me.PI_TIMES_2;for(;n<=-Math.PI;)n+=me.PI_TIMES_2;return n},me.angle=function(){if(arguments.length===1){var n=arguments[0];return Math.atan2(n.y,n.x)}if(arguments.length===2){var i=arguments[0],s=arguments[1],u=s.x-i.x,c=s.y-i.y;return Math.atan2(c,u)}},me.isAcute=function(n,i,s){var u=n.x-i.x,c=n.y-i.y;return u*(s.x-i.x)+c*(s.y-i.y)>0},me.isObtuse=function(n,i,s){var u=n.x-i.x,c=n.y-i.y;return u*(s.x-i.x)+c*(s.y-i.y)<0},me.interiorAngle=function(n,i,s){var u=me.angle(i,n),c=me.angle(i,s);return Math.abs(c-u)},me.normalizePositive=function(n){if(n<0){for(;n<0;)n+=me.PI_TIMES_2;n>=me.PI_TIMES_2&&(n=0)}else{for(;n>=me.PI_TIMES_2;)n-=me.PI_TIMES_2;n<0&&(n=0)}return n},me.angleBetween=function(n,i,s){var u=me.angle(i,n),c=me.angle(i,s);return me.diff(u,c)},me.diff=function(n,i){var s=null;return(s=n<i?i-n:n-i)>Math.PI&&(s=2*Math.PI-s),s},me.toRadians=function(n){return n*Math.PI/180},me.getTurn=function(n,i){var s=Math.sin(i-n);return s>0?me.COUNTERCLOCKWISE:s<0?me.CLOCKWISE:me.NONE},me.angleBetweenOriented=function(n,i,s){var u=me.angle(i,n),c=me.angle(i,s)-u;return c<=-Math.PI?c+me.PI_TIMES_2:c>Math.PI?c-me.PI_TIMES_2:c},Is.PI_TIMES_2.get=function(){return 2*Math.PI},Is.PI_OVER_2.get=function(){return Math.PI/2},Is.PI_OVER_4.get=function(){return Math.PI/4},Is.COUNTERCLOCKWISE.get=function(){return B.COUNTERCLOCKWISE},Is.CLOCKWISE.get=function(){return B.CLOCKWISE},Is.NONE.get=function(){return B.COLLINEAR},Object.defineProperties(me,Is);var pn=function n(){this._maxCurveSegmentError=0,this._filletAngleQuantum=null,this._closingSegLengthFactor=1,this._segList=null,this._distance=0,this._precisionModel=null,this._bufParams=null,this._li=null,this._s0=null,this._s1=null,this._s2=null,this._seg0=new Zt,this._seg1=new Zt,this._offset0=new Zt,this._offset1=new Zt,this._side=0,this._hasNarrowConcaveAngle=!1;var i=arguments[0],s=arguments[1],u=arguments[2];this._precisionModel=i,this._bufParams=s,this._li=new J,this._filletAngleQuantum=Math.PI/2/s.getQuadrantSegments(),s.getQuadrantSegments()>=8&&s.getJoinStyle()===We.JOIN_ROUND&&(this._closingSegLengthFactor=n.MAX_CLOSING_SEG_LEN_FACTOR),this.init(u)},Su={OFFSET_SEGMENT_SEPARATION_FACTOR:{configurable:!0},INSIDE_TURN_VERTEX_SNAP_DISTANCE_FACTOR:{configurable:!0},CURVE_VERTEX_SNAP_DISTANCE_FACTOR:{configurable:!0},MAX_CLOSING_SEG_LEN_FACTOR:{configurable:!0}};pn.prototype.addNextSegment=function(n,i){if(this._s0=this._s1,this._s1=this._s2,this._s2=n,this._seg0.setCoordinates(this._s0,this._s1),this.computeOffsetSegment(this._seg0,this._side,this._distance,this._offset0),this._seg1.setCoordinates(this._s1,this._s2),this.computeOffsetSegment(this._seg1,this._side,this._distance,this._offset1),this._s1.equals(this._s2))return null;var s=B.computeOrientation(this._s0,this._s1,this._s2),u=s===B.CLOCKWISE&&this._side===bt.LEFT||s===B.COUNTERCLOCKWISE&&this._side===bt.RIGHT;s===0?this.addCollinear(i):u?this.addOutsideTurn(s,i):this.addInsideTurn(s,i)},pn.prototype.addLineEndCap=function(n,i){var s=new Zt(n,i),u=new Zt;this.computeOffsetSegment(s,bt.LEFT,this._distance,u);var c=new Zt;this.computeOffsetSegment(s,bt.RIGHT,this._distance,c);var m=i.x-n.x,E=i.y-n.y,A=Math.atan2(E,m);switch(this._bufParams.getEndCapStyle()){case We.CAP_ROUND:this._segList.addPt(u.p1),this.addFilletArc(i,A+Math.PI/2,A-Math.PI/2,B.CLOCKWISE,this._distance),this._segList.addPt(c.p1);break;case We.CAP_FLAT:this._segList.addPt(u.p1),this._segList.addPt(c.p1);break;case We.CAP_SQUARE:var U=new L;U.x=Math.abs(this._distance)*Math.cos(A),U.y=Math.abs(this._distance)*Math.sin(A);var Z=new L(u.p1.x+U.x,u.p1.y+U.y),ut=new L(c.p1.x+U.x,c.p1.y+U.y);this._segList.addPt(Z),this._segList.addPt(ut)}},pn.prototype.getCoordinates=function(){return this._segList.getCoordinates()},pn.prototype.addMitreJoin=function(n,i,s,u){var c=!0,m=null;try{m=ne.intersection(i.p0,i.p1,s.p0,s.p1),(u<=0?1:m.distance(n)/Math.abs(u))>this._bufParams.getMitreLimit()&&(c=!1)}catch(E){if(!(E instanceof Wt))throw E;m=new L(0,0),c=!1}c?this._segList.addPt(m):this.addLimitedMitreJoin(i,s,u,this._bufParams.getMitreLimit())},pn.prototype.addFilletCorner=function(n,i,s,u,c){var m=i.x-n.x,E=i.y-n.y,A=Math.atan2(E,m),U=s.x-n.x,Z=s.y-n.y,ut=Math.atan2(Z,U);u===B.CLOCKWISE?A<=ut&&(A+=2*Math.PI):A>=ut&&(A-=2*Math.PI),this._segList.addPt(i),this.addFilletArc(n,A,ut,u,c),this._segList.addPt(s)},pn.prototype.addOutsideTurn=function(n,i){if(this._offset0.p1.distance(this._offset1.p0)<this._distance*pn.OFFSET_SEGMENT_SEPARATION_FACTOR)return this._segList.addPt(this._offset0.p1),null;this._bufParams.getJoinStyle()===We.JOIN_MITRE?this.addMitreJoin(this._s1,this._offset0,this._offset1,this._distance):this._bufParams.getJoinStyle()===We.JOIN_BEVEL?this.addBevelJoin(this._offset0,this._offset1):(i&&this._segList.addPt(this._offset0.p1),this.addFilletCorner(this._s1,this._offset0.p1,this._offset1.p0,n,this._distance),this._segList.addPt(this._offset1.p0))},pn.prototype.createSquare=function(n){this._segList.addPt(new L(n.x+this._distance,n.y+this._distance)),this._segList.addPt(new L(n.x+this._distance,n.y-this._distance)),this._segList.addPt(new L(n.x-this._distance,n.y-this._distance)),this._segList.addPt(new L(n.x-this._distance,n.y+this._distance)),this._segList.closeRing()},pn.prototype.addSegments=function(n,i){this._segList.addPts(n,i)},pn.prototype.addFirstSegment=function(){this._segList.addPt(this._offset1.p0)},pn.prototype.addLastSegment=function(){this._segList.addPt(this._offset1.p1)},pn.prototype.initSideSegments=function(n,i,s){this._s1=n,this._s2=i,this._side=s,this._seg1.setCoordinates(n,i),this.computeOffsetSegment(this._seg1,s,this._distance,this._offset1)},pn.prototype.addLimitedMitreJoin=function(n,i,s,u){var c=this._seg0.p1,m=me.angle(c,this._seg0.p0),E=me.angleBetweenOriented(this._seg0.p0,c,this._seg1.p1)/2,A=me.normalize(m+E),U=me.normalize(A+Math.PI),Z=u*s,ut=s-Z*Math.abs(Math.sin(E)),ht=c.x+Z*Math.cos(U),At=c.y+Z*Math.sin(U),Rt=new L(ht,At),kt=new Zt(c,Rt),ee=kt.pointAlongOffset(1,ut),on=kt.pointAlongOffset(1,-ut);this._side===bt.LEFT?(this._segList.addPt(ee),this._segList.addPt(on)):(this._segList.addPt(on),this._segList.addPt(ee))},pn.prototype.computeOffsetSegment=function(n,i,s,u){var c=i===bt.LEFT?1:-1,m=n.p1.x-n.p0.x,E=n.p1.y-n.p0.y,A=Math.sqrt(m*m+E*E),U=c*s*m/A,Z=c*s*E/A;u.p0.x=n.p0.x-Z,u.p0.y=n.p0.y+U,u.p1.x=n.p1.x-Z,u.p1.y=n.p1.y+U},pn.prototype.addFilletArc=function(n,i,s,u,c){var m=u===B.CLOCKWISE?-1:1,E=Math.abs(i-s),A=Math.trunc(E/this._filletAngleQuantum+.5);if(A<1)return null;for(var U=E/A,Z=0,ut=new L;Z<E;){var ht=i+m*Z;ut.x=n.x+c*Math.cos(ht),ut.y=n.y+c*Math.sin(ht),this._segList.addPt(ut),Z+=U}},pn.prototype.addInsideTurn=function(n,i){if(this._li.computeIntersection(this._offset0.p0,this._offset0.p1,this._offset1.p0,this._offset1.p1),this._li.hasIntersection())this._segList.addPt(this._li.getIntersection(0));else if(this._hasNarrowConcaveAngle=!0,this._offset0.p1.distance(this._offset1.p0)<this._distance*pn.INSIDE_TURN_VERTEX_SNAP_DISTANCE_FACTOR)this._segList.addPt(this._offset0.p1);else{if(this._segList.addPt(this._offset0.p1),this._closingSegLengthFactor>0){var s=new L((this._closingSegLengthFactor*this._offset0.p1.x+this._s1.x)/(this._closingSegLengthFactor+1),(this._closingSegLengthFactor*this._offset0.p1.y+this._s1.y)/(this._closingSegLengthFactor+1));this._segList.addPt(s);var u=new L((this._closingSegLengthFactor*this._offset1.p0.x+this._s1.x)/(this._closingSegLengthFactor+1),(this._closingSegLengthFactor*this._offset1.p0.y+this._s1.y)/(this._closingSegLengthFactor+1));this._segList.addPt(u)}else this._segList.addPt(this._s1);this._segList.addPt(this._offset1.p0)}},pn.prototype.createCircle=function(n){var i=new L(n.x+this._distance,n.y);this._segList.addPt(i),this.addFilletArc(n,0,2*Math.PI,-1,this._distance),this._segList.closeRing()},pn.prototype.addBevelJoin=function(n,i){this._segList.addPt(n.p1),this._segList.addPt(i.p0)},pn.prototype.init=function(n){this._distance=n,this._maxCurveSegmentError=n*(1-Math.cos(this._filletAngleQuantum/2)),this._segList=new Wr,this._segList.setPrecisionModel(this._precisionModel),this._segList.setMinimumVertexDistance(n*pn.CURVE_VERTEX_SNAP_DISTANCE_FACTOR)},pn.prototype.addCollinear=function(n){this._li.computeIntersection(this._s0,this._s1,this._s1,this._s2),this._li.getIntersectionNum()>=2&&(this._bufParams.getJoinStyle()===We.JOIN_BEVEL||this._bufParams.getJoinStyle()===We.JOIN_MITRE?(n&&this._segList.addPt(this._offset0.p1),this._segList.addPt(this._offset1.p0)):this.addFilletCorner(this._s1,this._offset0.p1,this._offset1.p0,B.CLOCKWISE,this._distance))},pn.prototype.closeRing=function(){this._segList.closeRing()},pn.prototype.hasNarrowConcaveAngle=function(){return this._hasNarrowConcaveAngle},pn.prototype.interfaces_=function(){return[]},pn.prototype.getClass=function(){return pn},Su.OFFSET_SEGMENT_SEPARATION_FACTOR.get=function(){return .001},Su.INSIDE_TURN_VERTEX_SNAP_DISTANCE_FACTOR.get=function(){return .001},Su.CURVE_VERTEX_SNAP_DISTANCE_FACTOR.get=function(){return 1e-6},Su.MAX_CLOSING_SEG_LEN_FACTOR.get=function(){return 80},Object.defineProperties(pn,Su);var Mr=function(){this._distance=0,this._precisionModel=null,this._bufParams=null;var n=arguments[0],i=arguments[1];this._precisionModel=n,this._bufParams=i};Mr.prototype.getOffsetCurve=function(n,i){if(this._distance=i,i===0)return null;var s=i<0,u=Math.abs(i),c=this.getSegGen(u);n.length<=1?this.computePointCurve(n[0],c):this.computeOffsetCurve(n,s,c);var m=c.getCoordinates();return s&&ft.reverse(m),m},Mr.prototype.computeSingleSidedBufferCurve=function(n,i,s){var u=this.simplifyTolerance(this._distance);if(i){s.addSegments(n,!0);var c=Mn.simplify(n,-u),m=c.length-1;s.initSideSegments(c[m],c[m-1],bt.LEFT),s.addFirstSegment();for(var E=m-2;E>=0;E--)s.addNextSegment(c[E],!0)}else{s.addSegments(n,!1);var A=Mn.simplify(n,u),U=A.length-1;s.initSideSegments(A[0],A[1],bt.LEFT),s.addFirstSegment();for(var Z=2;Z<=U;Z++)s.addNextSegment(A[Z],!0)}s.addLastSegment(),s.closeRing()},Mr.prototype.computeRingBufferCurve=function(n,i,s){var u=this.simplifyTolerance(this._distance);i===bt.RIGHT&&(u=-u);var c=Mn.simplify(n,u),m=c.length-1;s.initSideSegments(c[m-1],c[0],i);for(var E=1;E<=m;E++){var A=E!==1;s.addNextSegment(c[E],A)}s.closeRing()},Mr.prototype.computeLineBufferCurve=function(n,i){var s=this.simplifyTolerance(this._distance),u=Mn.simplify(n,s),c=u.length-1;i.initSideSegments(u[0],u[1],bt.LEFT);for(var m=2;m<=c;m++)i.addNextSegment(u[m],!0);i.addLastSegment(),i.addLineEndCap(u[c-1],u[c]);var E=Mn.simplify(n,-s),A=E.length-1;i.initSideSegments(E[A],E[A-1],bt.LEFT);for(var U=A-2;U>=0;U--)i.addNextSegment(E[U],!0);i.addLastSegment(),i.addLineEndCap(E[1],E[0]),i.closeRing()},Mr.prototype.computePointCurve=function(n,i){switch(this._bufParams.getEndCapStyle()){case We.CAP_ROUND:i.createCircle(n);break;case We.CAP_SQUARE:i.createSquare(n)}},Mr.prototype.getLineCurve=function(n,i){if(this._distance=i,i<0&&!this._bufParams.isSingleSided()||i===0)return null;var s=Math.abs(i),u=this.getSegGen(s);if(n.length<=1)this.computePointCurve(n[0],u);else if(this._bufParams.isSingleSided()){var c=i<0;this.computeSingleSidedBufferCurve(n,c,u)}else this.computeLineBufferCurve(n,u);return u.getCoordinates()},Mr.prototype.getBufferParameters=function(){return this._bufParams},Mr.prototype.simplifyTolerance=function(n){return n*this._bufParams.getSimplifyFactor()},Mr.prototype.getRingCurve=function(n,i,s){if(this._distance=s,n.length<=2)return this.getLineCurve(n,s);if(s===0)return Mr.copyCoordinates(n);var u=this.getSegGen(s);return this.computeRingBufferCurve(n,i,u),u.getCoordinates()},Mr.prototype.computeOffsetCurve=function(n,i,s){var u=this.simplifyTolerance(this._distance);if(i){var c=Mn.simplify(n,-u),m=c.length-1;s.initSideSegments(c[m],c[m-1],bt.LEFT),s.addFirstSegment();for(var E=m-2;E>=0;E--)s.addNextSegment(c[E],!0)}else{var A=Mn.simplify(n,u),U=A.length-1;s.initSideSegments(A[0],A[1],bt.LEFT),s.addFirstSegment();for(var Z=2;Z<=U;Z++)s.addNextSegment(A[Z],!0)}s.addLastSegment()},Mr.prototype.getSegGen=function(n){return new pn(this._precisionModel,this._bufParams,n)},Mr.prototype.interfaces_=function(){return[]},Mr.prototype.getClass=function(){return Mr},Mr.copyCoordinates=function(n){for(var i=new Array(n.length).fill(null),s=0;s<i.length;s++)i[s]=new L(n[s]);return i};var Rs=function(){this._subgraphs=null,this._seg=new Zt,this._cga=new B;var n=arguments[0];this._subgraphs=n},jd={DepthSegment:{configurable:!0}};Rs.prototype.findStabbedSegments=function(){if(arguments.length===1){for(var n=arguments[0],i=new j,s=this._subgraphs.iterator();s.hasNext();){var u=s.next(),c=u.getEnvelope();n.y<c.getMinY()||n.y>c.getMaxY()||this.findStabbedSegments(n,u.getDirectedEdges(),i)}return i}if(arguments.length===3){if(X(arguments[2],wt)&&arguments[0]instanceof L&&arguments[1]instanceof xf){for(var m=arguments[0],E=arguments[1],A=arguments[2],U=E.getEdge().getCoordinates(),Z=0;Z<U.length-1;Z++)if(this._seg.p0=U[Z],this._seg.p1=U[Z+1],this._seg.p0.y>this._seg.p1.y&&this._seg.reverse(),!(Math.max(this._seg.p0.x,this._seg.p1.x)<m.x)&&!(this._seg.isHorizontal()||m.y<this._seg.p0.y||m.y>this._seg.p1.y||B.computeOrientation(this._seg.p0,this._seg.p1,m)===B.RIGHT)){var ut=E.getDepth(bt.LEFT);this._seg.p0.equals(U[Z])||(ut=E.getDepth(bt.RIGHT));var ht=new jo(this._seg,ut);A.add(ht)}}else if(X(arguments[2],wt)&&arguments[0]instanceof L&&X(arguments[1],wt))for(var At=arguments[0],Rt=arguments[1],kt=arguments[2],ee=Rt.iterator();ee.hasNext();){var on=ee.next();on.isForward()&&this.findStabbedSegments(At,on,kt)}}},Rs.prototype.getDepth=function(n){var i=this.findStabbedSegments(n);return i.size()===0?0:di.min(i)._leftDepth},Rs.prototype.interfaces_=function(){return[]},Rs.prototype.getClass=function(){return Rs},jd.DepthSegment.get=function(){return jo},Object.defineProperties(Rs,jd);var jo=function(){this._upwardSeg=null,this._leftDepth=null;var n=arguments[0],i=arguments[1];this._upwardSeg=new Zt(n),this._leftDepth=i};jo.prototype.compareTo=function(n){var i=n;if(this._upwardSeg.minX()>=i._upwardSeg.maxX())return 1;if(this._upwardSeg.maxX()<=i._upwardSeg.minX())return-1;var s=this._upwardSeg.orientationIndex(i._upwardSeg);return s!==0||(s=-1*i._upwardSeg.orientationIndex(this._upwardSeg))!=0?s:this._upwardSeg.compareTo(i._upwardSeg)},jo.prototype.compareX=function(n,i){var s=n.p0.compareTo(i.p0);return s!==0?s:n.p1.compareTo(i.p1)},jo.prototype.toString=function(){return this._upwardSeg.toString()},jo.prototype.interfaces_=function(){return[F]},jo.prototype.getClass=function(){return jo};var qe=function(n,i,s){this.p0=n||null,this.p1=i||null,this.p2=s||null};qe.prototype.area=function(){return qe.area(this.p0,this.p1,this.p2)},qe.prototype.signedArea=function(){return qe.signedArea(this.p0,this.p1,this.p2)},qe.prototype.interpolateZ=function(n){if(n===null)throw new C("Supplied point is null.");return qe.interpolateZ(n,this.p0,this.p1,this.p2)},qe.prototype.longestSideLength=function(){return qe.longestSideLength(this.p0,this.p1,this.p2)},qe.prototype.isAcute=function(){return qe.isAcute(this.p0,this.p1,this.p2)},qe.prototype.circumcentre=function(){return qe.circumcentre(this.p0,this.p1,this.p2)},qe.prototype.area3D=function(){return qe.area3D(this.p0,this.p1,this.p2)},qe.prototype.centroid=function(){return qe.centroid(this.p0,this.p1,this.p2)},qe.prototype.inCentre=function(){return qe.inCentre(this.p0,this.p1,this.p2)},qe.prototype.interfaces_=function(){return[]},qe.prototype.getClass=function(){return qe},qe.area=function(n,i,s){return Math.abs(((s.x-n.x)*(i.y-n.y)-(i.x-n.x)*(s.y-n.y))/2)},qe.signedArea=function(n,i,s){return((s.x-n.x)*(i.y-n.y)-(i.x-n.x)*(s.y-n.y))/2},qe.det=function(n,i,s,u){return n*u-i*s},qe.interpolateZ=function(n,i,s,u){var c=i.x,m=i.y,E=s.x-c,A=u.x-c,U=s.y-m,Z=u.y-m,ut=E*Z-A*U,ht=n.x-c,At=n.y-m,Rt=(Z*ht-A*At)/ut,kt=(-U*ht+E*At)/ut;return i.z+Rt*(s.z-i.z)+kt*(u.z-i.z)},qe.longestSideLength=function(n,i,s){var u=n.distance(i),c=i.distance(s),m=s.distance(n),E=u;return c>E&&(E=c),m>E&&(E=m),E},qe.isAcute=function(n,i,s){return!!me.isAcute(n,i,s)&&!!me.isAcute(i,s,n)&&!!me.isAcute(s,n,i)},qe.circumcentre=function(n,i,s){var u=s.x,c=s.y,m=n.x-u,E=n.y-c,A=i.x-u,U=i.y-c,Z=2*qe.det(m,E,A,U),ut=qe.det(E,m*m+E*E,U,A*A+U*U),ht=qe.det(m,m*m+E*E,A,A*A+U*U);return new L(u-ut/Z,c+ht/Z)},qe.perpendicularBisector=function(n,i){var s=i.x-n.x,u=i.y-n.y,c=new ne(n.x+s/2,n.y+u/2,1),m=new ne(n.x-u+s/2,n.y+s+u/2,1);return new ne(c,m)},qe.angleBisector=function(n,i,s){var u=i.distance(n),c=u/(u+i.distance(s)),m=s.x-n.x,E=s.y-n.y;return new L(n.x+c*m,n.y+c*E)},qe.area3D=function(n,i,s){var u=i.x-n.x,c=i.y-n.y,m=i.z-n.z,E=s.x-n.x,A=s.y-n.y,U=s.z-n.z,Z=c*U-m*A,ut=m*E-u*U,ht=u*A-c*E,At=Z*Z+ut*ut+ht*ht,Rt=Math.sqrt(At)/2;return Rt},qe.centroid=function(n,i,s){var u=(n.x+i.x+s.x)/3,c=(n.y+i.y+s.y)/3;return new L(u,c)},qe.inCentre=function(n,i,s){var u=i.distance(s),c=n.distance(s),m=n.distance(i),E=u+c+m,A=(u*n.x+c*i.x+m*s.x)/E,U=(u*n.y+c*i.y+m*s.y)/E;return new L(A,U)};var ii=function(){this._inputGeom=null,this._distance=null,this._curveBuilder=null,this._curveList=new j;var n=arguments[0],i=arguments[1],s=arguments[2];this._inputGeom=n,this._distance=i,this._curveBuilder=s};ii.prototype.addPoint=function(n){if(this._distance<=0)return null;var i=n.getCoordinates(),s=this._curveBuilder.getLineCurve(i,this._distance);this.addCurve(s,k.EXTERIOR,k.INTERIOR)},ii.prototype.addPolygon=function(n){var i=this._distance,s=bt.LEFT;this._distance<0&&(i=-this._distance,s=bt.RIGHT);var u=n.getExteriorRing(),c=ft.removeRepeatedPoints(u.getCoordinates());if(this._distance<0&&this.isErodedCompletely(u,this._distance)||this._distance<=0&&c.length<3)return null;this.addPolygonRing(c,i,s,k.EXTERIOR,k.INTERIOR);for(var m=0;m<n.getNumInteriorRing();m++){var E=n.getInteriorRingN(m),A=ft.removeRepeatedPoints(E.getCoordinates());this._distance>0&&this.isErodedCompletely(E,-this._distance)||this.addPolygonRing(A,i,bt.opposite(s),k.INTERIOR,k.EXTERIOR)}},ii.prototype.isTriangleErodedCompletely=function(n,i){var s=new qe(n[0],n[1],n[2]),u=s.inCentre();return B.distancePointLine(u,s.p0,s.p1)<Math.abs(i)},ii.prototype.addLineString=function(n){if(this._distance<=0&&!this._curveBuilder.getBufferParameters().isSingleSided())return null;var i=ft.removeRepeatedPoints(n.getCoordinates()),s=this._curveBuilder.getLineCurve(i,this._distance);this.addCurve(s,k.EXTERIOR,k.INTERIOR)},ii.prototype.addCurve=function(n,i,s){if(n===null||n.length<2)return null;var u=new wn(n,new rn(0,k.BOUNDARY,i,s));this._curveList.add(u)},ii.prototype.getCurves=function(){return this.add(this._inputGeom),this._curveList},ii.prototype.addPolygonRing=function(n,i,s,u,c){if(i===0&&n.length<sn.MINIMUM_VALID_SIZE)return null;var m=u,E=c;n.length>=sn.MINIMUM_VALID_SIZE&&B.isCCW(n)&&(m=c,E=u,s=bt.opposite(s));var A=this._curveBuilder.getRingCurve(n,s,i);this.addCurve(A,m,E)},ii.prototype.add=function(n){if(n.isEmpty())return null;n instanceof Vt?this.addPolygon(n):n instanceof Bt?this.addLineString(n):n instanceof Qt?this.addPoint(n):n instanceof fe?this.addCollection(n):n instanceof H?this.addCollection(n):n instanceof un?this.addCollection(n):n instanceof Vn&&this.addCollection(n)},ii.prototype.isErodedCompletely=function(n,i){var s=n.getCoordinates();if(s.length<4)return i<0;if(s.length===4)return this.isTriangleErodedCompletely(s,i);var u=n.getEnvelopeInternal(),c=Math.min(u.getHeight(),u.getWidth());return i<0&&2*Math.abs(i)>c},ii.prototype.addCollection=function(n){for(var i=0;i<n.getNumGeometries();i++){var s=n.getGeometryN(i);this.add(s)}},ii.prototype.interfaces_=function(){return[]},ii.prototype.getClass=function(){return ii};var fa=function(){};fa.prototype.locate=function(n){},fa.prototype.interfaces_=function(){return[]},fa.prototype.getClass=function(){return fa};var Gi=function(){this._parent=null,this._atStart=null,this._max=null,this._index=null,this._subcollectionIterator=null;var n=arguments[0];this._parent=n,this._atStart=!0,this._index=0,this._max=n.getNumGeometries()};Gi.prototype.next=function(){if(this._atStart)return this._atStart=!1,Gi.isAtomic(this._parent)&&this._index++,this._parent;if(this._subcollectionIterator!==null){if(this._subcollectionIterator.hasNext())return this._subcollectionIterator.next();this._subcollectionIterator=null}if(this._index>=this._max)throw new o;var n=this._parent.getGeometryN(this._index++);return n instanceof Vn?(this._subcollectionIterator=new Gi(n),this._subcollectionIterator.next()):n},Gi.prototype.remove=function(){throw new Error(this.getClass().getName())},Gi.prototype.hasNext=function(){if(this._atStart)return!0;if(this._subcollectionIterator!==null){if(this._subcollectionIterator.hasNext())return!0;this._subcollectionIterator=null}return!(this._index>=this._max)},Gi.prototype.interfaces_=function(){return[Y]},Gi.prototype.getClass=function(){return Gi},Gi.isAtomic=function(n){return!(n instanceof Vn)};var qr=function(){this._geom=null;var n=arguments[0];this._geom=n};qr.prototype.locate=function(n){return qr.locate(n,this._geom)},qr.prototype.interfaces_=function(){return[fa]},qr.prototype.getClass=function(){return qr},qr.isPointInRing=function(n,i){return!!i.getEnvelopeInternal().intersects(n)&&B.isPointInRing(n,i.getCoordinates())},qr.containsPointInPolygon=function(n,i){if(i.isEmpty())return!1;var s=i.getExteriorRing();if(!qr.isPointInRing(n,s))return!1;for(var u=0;u<i.getNumInteriorRing();u++){var c=i.getInteriorRingN(u);if(qr.isPointInRing(n,c))return!1}return!0},qr.containsPoint=function(n,i){if(i instanceof Vt)return qr.containsPointInPolygon(n,i);if(i instanceof Vn)for(var s=new Gi(i);s.hasNext();){var u=s.next();if(u!==i&&qr.containsPoint(n,u))return!0}return!1},qr.locate=function(n,i){return i.isEmpty()?k.EXTERIOR:qr.containsPoint(n,i)?k.INTERIOR:k.EXTERIOR};var jn=function(){this._edgeMap=new _,this._edgeList=null,this._ptInAreaLocation=[k.NONE,k.NONE]};jn.prototype.getNextCW=function(n){this.getEdges();var i=this._edgeList.indexOf(n),s=i-1;return i===0&&(s=this._edgeList.size()-1),this._edgeList.get(s)},jn.prototype.propagateSideLabels=function(n){for(var i=k.NONE,s=this.iterator();s.hasNext();){var u=s.next().getLabel();u.isArea(n)&&u.getLocation(n,bt.LEFT)!==k.NONE&&(i=u.getLocation(n,bt.LEFT))}if(i===k.NONE)return null;for(var c=i,m=this.iterator();m.hasNext();){var E=m.next(),A=E.getLabel();if(A.getLocation(n,bt.ON)===k.NONE&&A.setLocation(n,bt.ON,c),A.isArea(n)){var U=A.getLocation(n,bt.LEFT),Z=A.getLocation(n,bt.RIGHT);if(Z!==k.NONE){if(Z!==c)throw new so("side location conflict",E.getCoordinate());U===k.NONE&&b.shouldNeverReachHere("found single null side (at "+E.getCoordinate()+")"),c=U}else b.isTrue(A.getLocation(n,bt.LEFT)===k.NONE,"found single null side"),A.setLocation(n,bt.RIGHT,c),A.setLocation(n,bt.LEFT,c)}}},jn.prototype.getCoordinate=function(){var n=this.iterator();return n.hasNext()?n.next().getCoordinate():null},jn.prototype.print=function(n){Nt.out.println("EdgeEndStar: "+this.getCoordinate());for(var i=this.iterator();i.hasNext();)i.next().print(n)},jn.prototype.isAreaLabelsConsistent=function(n){return this.computeEdgeEndLabels(n.getBoundaryNodeRule()),this.checkAreaLabelsConsistent(0)},jn.prototype.checkAreaLabelsConsistent=function(n){var i=this.getEdges();if(i.size()<=0)return!0;var s=i.size()-1,u=i.get(s).getLabel().getLocation(n,bt.LEFT);b.isTrue(u!==k.NONE,"Found unlabelled area edge");for(var c=u,m=this.iterator();m.hasNext();){var E=m.next().getLabel();b.isTrue(E.isArea(n),"Found non-area edge");var A=E.getLocation(n,bt.LEFT),U=E.getLocation(n,bt.RIGHT);if(A===U||U!==c)return!1;c=A}return!0},jn.prototype.findIndex=function(n){this.iterator();for(var i=0;i<this._edgeList.size();i++)if(this._edgeList.get(i)===n)return i;return-1},jn.prototype.iterator=function(){return this.getEdges().iterator()},jn.prototype.getEdges=function(){return this._edgeList===null&&(this._edgeList=new j(this._edgeMap.values())),this._edgeList},jn.prototype.getLocation=function(n,i,s){return this._ptInAreaLocation[n]===k.NONE&&(this._ptInAreaLocation[n]=qr.locate(i,s[n].getGeometry())),this._ptInAreaLocation[n]},jn.prototype.toString=function(){var n=new pt;n.append("EdgeEndStar: "+this.getCoordinate()),n.append(\`
|
|
3823
3823
|
\`);for(var i=this.iterator();i.hasNext();){var s=i.next();n.append(s),n.append(\`
|
|
@@ -7503,5 +7503,5 @@ three/build/three.module.js:
|
|
|
7503
7503
|
* along with MarchingSquaresJS. If not, see <http://www.gnu.org/licenses/>.
|
|
7504
7504
|
*)
|
|
7505
7505
|
*/
|
|
7506
|
-
`)}var Rr=class extends Ir.EventDispatcher{worker=on();initRoadStatus=!1;constructor(){super()}async setRoadData(e){this.initRoadStatus=!1,this.dispatchEvent({type:"init-road-status",status:!1}),await lt(this.worker,"set_road_info",{roadData:e}),this.initRoadStatus=!0,this.dispatchEvent({type:"init-road-status",status:!0})}async getPath(e,t,n=""){return new Promise((r,i)=>{let o=()=>{console.log("initRoadStatus",this.initRoadStatus),lt(this.worker,"get_path",{start:e,end:t,type:n}).then(a=>{a?typeof a=="string"?i(a):r(a):i("no-path")})};if(this.initRoadStatus)o();else{let a=({status:l})=>{l&&(this.removeEventListener("init-road-status",a),o())};this.addEventListener("init-road-status",a)}})}getDirectionPath(e){return lt(this.worker,"get_direction_path",e)}async dispose(){lt(this.worker,"clear",""),this.worker.terminate()}};var Lr=g("three"),De=class extends et{startPoint;endPoint;rect;frustum=new Lr.Frustum;constructor(e){super(e);let{config:{selectBox:{fill:t,stroke:n}}}=e;this.rect=mt(n,t),this.svg.appendChild(this.rect),this.registryEvent()}setEnable(e){super.setEnable(e),k(this.rect,0,0,0,0),e?this.registryEvent():(this.startPoint=void 0,this.unRegistryEvent())}onPointerDown=e=>{if(!this.enable)return;let t=this.getIntersectByPointerEvent(e);t&&(this.startPoint=t),this.endPoint=void 0};onPointerMove=e=>{if(!this.enable||!this.startPoint)return;let t=this.getIntersectByPointerEvent(e);t&&(this.endPoint=t)};onPointerUp=e=>{if(!this.enable)return;let t=this.getIntersectByPointerEvent(e);t&&(this.endPoint=t),this.doSelect(),this.startPoint=void 0};onUpdate=()=>{if(this.startPoint){let e=this.getSvgCoordinate(this.startPoint),t={...e};this.endPoint&&(t=this.getSvgCoordinate(this.endPoint));let n={x:Math.min(e.x,t.x),y:Math.min(e.y,t.y)},r=Math.abs(t.x-e.x),i=Math.abs(t.y-e.y);k(this.rect,n.x,n.y,r,i)}else k(this.rect,0,0,0,0)};registryEvent(){this.context.container.addEventListener("pointerdown",this.onPointerDown),this.context.container.addEventListener("pointermove",this.onPointerMove),this.context.container.addEventListener("pointerup",this.onPointerUp),this.context.addEventListener("update",this.onUpdate)}unRegistryEvent(){this.context.container.removeEventListener("pointerdown",this.onPointerDown),this.context.container.removeEventListener("pointermove",this.onPointerMove),this.context.container.removeEventListener("pointerup",this.onPointerUp),this.context.removeEventListener("update",this.onUpdate)}doSelect(){if(this.startPoint&&this.endPoint){if(this.startPoint.distanceTo(this.endPoint)<.1)return;let{context:{camera:t,container:{clientWidth:n,clientHeight:r}}}=this,i=x(this.startPoint,t,n,r),o=x(this.endPoint,t,n,r),a={x:Math.min(i.x,o.x),y:Math.min(i.y,o.y)},l={x:Math.max(i.x,o.x),y:Math.max(i.y,o.y)},u=this.searchMapInFrustum(a,l);this.dispatchEvent({type:"selected",list:u})}}searchMapInFrustum(e,t){let{context:n}=this;return n.currentFloor?.graphicLayer.children.filter(r=>r instanceof L&&this.searchChildInFrustum(r,e,t))||[]}searchChildInFrustum(e,t,n){let{context:{camera:r,container:{clientWidth:i,clientHeight:o}}}=this;if(!e)return!1;if(!e.mesh){let f=e.getPosition();if(f){let d=x(f,r,i,o);return gt(d,t,n)}return!1}e.mesh.geometry.boundingBox||e.mesh.geometry.computeBoundingBox();let a=e.mesh.geometry.boundingBox;if(!a)return!1;let{min:l,max:u}=a,c=x(l,r,i,o),h=x(u,r,i,o);return!(!gt(c,t,n)||!gt(h,t,n))}dispose(){this.unRegistryEvent()}};var Mi={boxSelection:!1,elements:["graphic","poi"]},Nr=class extends pt{options;_list=new Set;_poiList=new Set;boxSelection;prevPanStatus;prevRotateStatus;downPoint=null;isMultipleSelect=!1;constructor(e,t={}){super(e),this.options={...Mi,...t},this.boxSelection=new De(this.bmap.context),this.boxSelection.setEnable(!1),this.registryEvent()}get list(){return this._list}enableBoxSelection(){this.isMultipleSelect||!this.options.boxSelection||(this.isMultipleSelect=!0,this.boxSelection.setEnable(!0),this.prevPanStatus=this.bmap.context.control.enablePan,this.prevRotateStatus=this.bmap.context.control.enableRotate,this.bmap.context.control.enablePan=!1,this.bmap.context.control.enableRotate=!1)}disableBoxSelection(){this.isMultipleSelect&&(this.isMultipleSelect=!1,this.boxSelection.setEnable(!1),this.bmap.context.control.enablePan=!!this.prevPanStatus,this.bmap.context.control.enableRotate=!!this.prevRotateStatus)}onPointerDown=e=>{this.downPoint={x:e.offsetX,y:e.offsetY}};onPointerUp=e=>{if(!this.downPoint)return;let{offsetX:t,offsetY:n}=e,{x:r,y:i}=this.downPoint;if(Math.sqrt((r-t)**2+(i-n)**2)>3)return;let o=new Set,a=[],l=[];if(this.options.elements.includes("graphic")){let{graphics:u}=this.bmap.context.getGraphicsByDeviceXy(t,n);u.map(c=>o.add(c.options.id)),a.push(...u)}if(this.options.elements.includes("poi")){let u=this.bmap.context.getPoisByDeviceXy(t,n);l.push(...u),u.forEach(c=>{if(!o.has(c.options.id)){let h=this.bmap.context.currentFloor?.graphicLayer.graphicMap.get(c.options.id)||null;h&&(o.add(c.options.id),a.push(h))}})}(!this.options.boxSelection||!(Ut?e.metaKey:e.ctrlKey))&&(this._list.clear(),this._poiList.clear()),a.forEach(u=>this._list.add(u)),l.forEach(u=>this._poiList.add(u)),this.selectEnd(),this.downPoint=null};onPointerOut=e=>{this.disableBoxSelection()};onKeyDown=e=>{Ft(e.key)&&this.enableBoxSelection()};onKeyUp=e=>{Ft(e.key)&&this.disableBoxSelection()};onBoxSelected=({list:e})=>{this._list.clear(),e.forEach(t=>{this._list.add(t)}),this.selectEnd()};selectEnd(){this.dispatchEvent({type:"select",graphics:[...this._list],pois:[...this._poiList],isMultipleSelect:this.isMultipleSelect})}registryEvent(){this.bmap.context.container.addEventListener("pointerdown",this.onPointerDown),this.bmap.context.container.addEventListener("pointerup",this.onPointerUp),this.bmap.context.container.addEventListener("pointerout",this.onPointerOut),this.bmap.context.container.addEventListener("pointercancel",this.onPointerOut),window.addEventListener("keydown",this.onKeyDown),window.addEventListener("keyup",this.onKeyUp),this.boxSelection.addEventListener("selected",this.onBoxSelected)}unRegistryEvent(){this.bmap.context.container.removeEventListener("pointerdown",this.onPointerDown),this.bmap.context.container.removeEventListener("pointerup",this.onPointerUp),this.bmap.context.container.removeEventListener("pointerout",this.onPointerOut),this.bmap.context.container.removeEventListener("pointercancel",this.onPointerOut),window.removeEventListener("keydown",this.onKeyDown),window.removeEventListener("keyup",this.onKeyUp),this.boxSelection.removeEventListener("selected",this.onBoxSelected)}clear(){this._list.clear()}remove(e){this._list.delete(e)}dispose(){this.unRegistryEvent()}};var q=g("lodash");var Dr=g("three");var Ti={time:200,elements:["compass","deviceMotion","acceleration","gps"]},Oe=class extends Dr.EventDispatcher{options;gpsTimer=null;data=[];timer=new U;dispatchTimer=null;constructor(e={}){super(),this.options={...Ti,...e}}start(){this.options.elements.some(e=>["deviceMotion","compass"].includes(e))&&this.listenDeviceOrientation(),this.options.elements.includes("acceleration")&&this.listenAcceleration(),this.options.elements.includes("gps")&&this.listenGps(),this.dispatchEvent({type:"start"}),this.dispatchTimer=this.timer.setInterval(()=>{this.dispatchEvent({type:"sensor-data",data:(0,q.cloneDeep)(this.data)}),this.data=[]},this.options.time)}addDataItem(e){this.data.push(e),this.dispatchEvent({type:"add-data-item",item:e})}addDeviceMotion=(0,q.throttle)(e=>{this.addDataItem(e)},20);addAcceleration=(0,q.throttle)(e=>{this.addDataItem(e)},20);deviceOrientationAbsHandler=e=>{let t=Date.now(),{alpha:n,beta:r,gamma:i}=e;if((0,q.isNil)(n)||(0,q.isNil)(r)||(0,q.isNil)(i))return;let o;qt?o=e.webkitCompassHeading:o=360-n,this.options.elements.includes("deviceMotion")&&this.addDeviceMotion({type:"deviceMotion",timestamp:t,res:[n,r,i]}),this.options.elements.includes("compass")&&this.addDataItem({type:"compass",timestamp:t,res:o})};listenDeviceOrientation(){qt?window.addEventListener("deviceorientation",this.deviceOrientationAbsHandler,!1):window.addEventListener("deviceorientationabsolute",this.deviceOrientationAbsHandler,{absolute:!0})}handleAcceleration=e=>{let t=e.accelerationIncludingGravity;(0,q.isNil)(t)||(0,q.isNil)(t.x)||(0,q.isNil)(t.y)||(0,q.isNil)(t.z)||this.addAcceleration({type:"acceleration",timestamp:Date.now(),res:[t.x,t.y,t.z]})};listenAcceleration(){window.addEventListener("devicemotion",this.handleAcceleration,!1)}listenGps(){this.gpsTimer=navigator.geolocation.watchPosition(e=>{e.coords.accuracy<=10&&this.addDataItem({type:"gps",timestamp:Date.now(),res:[e.coords.longitude,e.coords.latitude,e.coords.accuracy]})})}async checkSensor(){return{deviceOrientation:await this.checkDeviceOrientation()}}async checkDeviceOrientation(){if(!qt)return!0;if(typeof window.DeviceOrientationEvent<"u"&&typeof window.DeviceOrientationEvent?.requestPermission=="function")try{return await window.DeviceOrientationEvent?.requestPermission()==="granted"}catch{return!1}return!1}stop(){window.removeEventListener("devicemotion",this.handleAcceleration,!1),qt?window.removeEventListener("deviceorientation",this.deviceOrientationAbsHandler,!1):window.removeEventListener("deviceorientationabsolute",this.deviceOrientationAbsHandler,{absolute:!0}),(0,q.isNil)(this.gpsTimer)||navigator.geolocation.clearWatch(this.gpsTimer),this.dispatchTimer&&this.timer.clearInterval(this.dispatchTimer),this.data=[],this.dispatchEvent({type:"stop"})}};var Fr=g("three");function Ue(s,e){return 1/Math.sqrt(2*Math.PI*Math.pow(e,2))*Math.exp(-Math.pow(s,2)/(2*Math.pow(e,2)))}function Fe(s){return(s+360)%360}function Or(s,e){let n=6378137*s*Math.PI/180,r=6378137*Math.log(Math.tan(Math.PI/4+e*Math.PI/180/2));return{x:n,y:r}}function Ht(s,e,t,n){return Math.sqrt(Math.pow(Math.abs(s-t),2)+Math.pow(Math.abs(e-n),2))}var Be=class{NumParticle;reSampNumParticle;initial_xy_uncertainty;initial_yaw_uncertainty;step_noise_sigma;yaw_noise_sigma;compass_update_interval;sigmaCompass;delta_yaw;sigmaBeacon;unaccess_weight;particle_PosInitFlag;particle_yawInitFlag;xEst;particleX;particleWeight;last_compass_time;constructor(e){this.NumParticle=e.NumParticle,this.reSampNumParticle=e.reSampNumParticle,this.initial_xy_uncertainty=e.initial_xy_uncertainty,this.initial_yaw_uncertainty=e.initial_yaw_uncertainty,this.step_noise_sigma=e.step_noise_sigma,this.yaw_noise_sigma=e.yaw_noise_sigma,this.compass_update_interval=e.compass_update_interval,this.sigmaCompass=e.sigmaCompass,this.delta_yaw=e.delta_yaw,this.sigmaBeacon=e.sigmaBeacon,this.unaccess_weight=e.unaccess_weight,this.particle_PosInitFlag=!1,this.particle_yawInitFlag=!1,this.xEst=[[0],[0],[0]],this.particleX=Array.from({length:3},()=>Array(this.NumParticle).fill(0)),this.particleWeight=Array.from({length:1},()=>Array(this.NumParticle).fill(1/this.NumParticle)),this.last_compass_time=0}motionModelRotYaw(e){if(!(Math.abs(e)<.001))for(let t=0;t<this.NumParticle;t++){let n=Math.random()*this.yaw_noise_sigma;this.particleX[2][t]=this.particleX[2][t]+e+n,this.particleX[2][t]=Fe(this.particleX[2][t])}}motionModelStepLength(e,t){if(e===0)return;for(let r=0;r<this.NumParticle;r++){let i=Math.random()*this.step_noise_sigma;this.particleX[0][r]+=(.65+i)*Math.sin(-this.particleX[2][r]/180*Math.PI),this.particleX[1][r]+=(.65+i)*Math.cos(this.particleX[2][r]/180*Math.PI),t(this.particleX[0][r],this.particleX[1][r])||(this.particleWeight[0][r]*=this.unaccess_weight)}let n=this.particleWeight[0].reduce((r,i)=>r+i,0);this.particleWeight[0]=this.particleWeight[0].map(r=>r/n)}motionModelCompassYaw(e,t){if(t-this.last_compass_time>this.compass_update_interval){let n=360-e;n+=this.delta_yaw,n=Fe(n);for(let i=0;i<this.NumParticle;i++){let o=Math.abs(this.particleX[2][i]-n);o>180&&(o=360-o),this.particleWeight[0][i]*=Ue(o,this.sigmaCompass)}let r=this.particleWeight[0].reduce((i,o)=>i+o,0);this.particleWeight[0]=this.particleWeight[0].map(i=>i/r)}}resampling(){if(1/this.particleWeight[0].reduce((t,n)=>t+n*n,0)<this.reSampNumParticle){let t=this.particleWeight[0].reduce((a,l,u)=>a.concat(a[u]+l),[0]),r=this.particleWeight[0].map(()=>1/this.NumParticle).map((a,l)=>a+Math.random()/this.NumParticle),i=[],o=0;for(let a=0;a<this.NumParticle;a++){for(;r[a]>t[o];)o++;i.push(o)}this.particleX=this.particleX.map((a,l)=>i.map(u=>a[u])),this.particleWeight[0]=Array(this.NumParticle).fill(1/this.NumParticle)}}update(e,t){for(let r=0;r<this.NumParticle;r++){let i=Ht(this.particleX[0][r],this.particleX[1][r],e.x,e.y);this.particleWeight[0][r]=Math.max(1e-7,this.particleWeight[0][r]*Ue(i,t))}let n=this.particleWeight[0].reduce((r,i)=>r+i,0);this.particleWeight[0]=this.particleWeight[0].map(r=>r/n)}updateCar(e,t){let n=e.x-this.xEst[0][0],r=e.y-this.xEst[1][0];for(let o=0;o<this.NumParticle;o++){let a=Ht(this.particleX[0][o],this.particleX[1][o],e.x,e.y);this.particleWeight[0][o]=Math.max(1e-7,this.particleWeight[0][o]*Ue(a,t)),this.particleX[0][o]+=n,this.particleX[1][o]+=r}let i=this.particleWeight[0].reduce((o,a)=>o+a,0);this.particleWeight[0]=this.particleWeight[0].map(o=>o/i)}getPosInitFlag(){return this.particle_PosInitFlag}getYawInitFlag(){return this.particle_yawInitFlag}setPosInitFlag(e){this.particle_PosInitFlag=e}setYawInitFlag(e){this.particle_yawInitFlag=e}getResultX(){return this.xEst[0][0]=this.particleX[0].reduce((e,t,n)=>e+t*this.particleWeight[0][n],0),this.xEst[0][0]}getResultY(){return this.xEst[1][0]}getResultYaw(){let e=this.particleWeight[0].indexOf(Math.max(...this.particleWeight[0]));return this.particleX[2][e]}getEstConfidence(){let e=this.particleWeight[0].indexOf(Math.max(...this.particleWeight[0])),t=this.particleWeight[0].indexOf(Math.min(...this.particleWeight[0])),n=[this.particleX[0][e],this.particleX[1][e]],r=[this.particleX[0][t],this.particleX[1][t]],i=Ht(n[0],n[1],r[0],r[1]),o=i*.67;return console.log(i,o),o}getParticleNum(){return this.NumParticle}getParticleX(){return this.particleX}setLastCompassTime(e){this.last_compass_time=e}getLastCompassTime(){return this.last_compass_time}initParticlesByPos(e,t,n){if(!this.particle_PosInitFlag){this.particleWeight[0]=Array(this.NumParticle).fill(1/this.NumParticle);let r=0;for(;r<this.NumParticle;){let o=(2*Math.random()-1)*this.initial_xy_uncertainty,a=(2*Math.random()-1)*this.initial_xy_uncertainty;n(e+o,t+a)||(this.particleWeight[0][r]*=this.unaccess_weight),this.particleX[0][r]=e+o,this.particleX[1][r]=t+a,r++}let i=this.particleWeight[0].reduce((o,a)=>o+a,0);this.particleWeight[0]=this.particleWeight[0].map(o=>o/i),this.particle_PosInitFlag=!0,this.xEst[0][0]=e,this.xEst[1][0]=t,this.xEst[2][0]=0}}initParticlesByCompass(e){console.log(`Init compass: ${e}`);let t=360-e;t+=this.delta_yaw,t=Fe(t),console.log(`Init Yaw: ${t}`);for(let n=0;n<this.NumParticle;n++){let r=(2*Math.random()-1)*this.initial_yaw_uncertainty;this.particleX[2][n]=t+r}this.particle_yawInitFlag=!0,this.xEst[2][0]=t}};var Ge=class{fre;accH_fifo;accH_time_fifo;accH_fifo_len;step_count;state_count;last_valley_time;last_peak_time;last_step_time;min_step_time;max_step_time;min_peak;max_valley;peak_num;valley_num;fft_min_amp;fft_min_fre;fft_max_fre;last_fft_amp;abnor_start_time;abnor_fft_detected;abnor_time_threshod;abnor_peak_time;abnor_peak_accH;const_step_length;last_rot;delta_rot;last_yaw;delta_yaw;delta_rot_sum_fifo;delta_rot_sum_time_fifo;delta_yaw_accum;delta_yaw_accum_timestamp;delta_yaw_time_threshold;last_px;last_py;delta_px;delta_py;constructor(){this.init()}init(){this.fre=100,this.accH_fifo=[],this.accH_time_fifo=[],this.accH_fifo_len=Math.floor(1*this.fre)+1,this.step_count=0,this.state_count=0,this.last_valley_time=0,this.last_peak_time=0,this.last_step_time=0,this.min_step_time=.3,this.max_step_time=1,this.min_peak=10+.5,this.max_valley=10-.5,this.peak_num=0,this.valley_num=0,this.fft_min_amp=.3,this.fft_min_fre=0,this.fft_max_fre=4,this.last_fft_amp=0,this.abnor_start_time=0,this.abnor_fft_detected=!1,this.abnor_time_threshod=4,this.abnor_peak_time=0,this.abnor_peak_accH=0,this.const_step_length=.65,this.last_rot=[],this.delta_rot=[],this.last_yaw=0,this.delta_yaw=null,this.delta_rot_sum_fifo=[],this.delta_rot_sum_time_fifo=[],this.delta_yaw_accum=0,this.delta_yaw_accum_timestamp=0,this.delta_yaw_time_threshold=.5,this.last_px=0,this.last_py=0,this.delta_px=0,this.delta_py=0}reset(){this.init()}set_init_pose(e=[0,0]){this.last_px=e[0],this.last_py=e[1],console.log(`pdr init pos: ${this.last_px}, ${this.last_py}`)}set_init_yaw(e=0){this.last_yaw=e}getPos(e,t,n){let r=0;return n.length===3&&(this.delta_yaw=this.getDeltaYaw_fromRot(e,n)),t.length===3&&(r=this.getStepLength(e,t)),r!==0&&(this.last_px+=this.delta_px,this.last_py+=this.delta_py),[this.last_px,this.last_py]}get_delta_pose(){return[this.delta_px,this.delta_py]}getStepLength(e,t){if(t.length<3)return console.warn("acc data less than 3"),0;let n=!1,r=Math.sqrt(t.reduce((i,o)=>i+o*o,0));if(this.accH_fifo.push(r),this.accH_time_fifo.push(e),this.imuFreUpdate(),this.accH_fifo.length<this.accH_fifo_len+1)n=!1;else{for(;this.accH_fifo.length>=this.accH_fifo_len+1;)this.accH_fifo.shift(),this.accH_time_fifo.shift();let i=this.PVstepDetec(),o=this.FFTstepDetec(),a=this.recheckState(),l=this.accH_time_fifo[Math.floor(this.accH_time_fifo.length*(3/4))];Math.abs(this.abnor_start_time)<.001&&this.abnor_fft_detected?this.abnor_start_time=l:this.abnor_fft_detected||(this.abnor_start_time=0),i&&o&&a?(this.step_count++,this.last_step_time=l,n=!0):Math.abs(this.abnor_start_time)>.001&&this.abnor_peak_time-this.abnor_start_time>this.abnor_time_threshod&&this.step_count>1&&this.abnor_peak_time-this.last_step_time>1?(this.step_count++,this.last_step_time=l,n=!0):(l-this.last_step_time>2&&(this.state_count=0),n=!1)}if(n){let i=this.last_yaw/180*Math.PI;return this.delta_px=this.const_step_length*Math.cos(i),this.delta_py=this.const_step_length*Math.sin(i),this.const_step_length}else return 0}imuFreUpdate(){if(this.accH_time_fifo.length>2&&(this.accH_time_fifo[this.accH_time_fifo.length-1]-this.accH_time_fifo[this.accH_time_fifo.length-2]<0||this.accH_time_fifo[this.accH_time_fifo.length-1]-this.accH_time_fifo[this.accH_time_fifo.length-2]>10||this.accH_time_fifo[this.accH_time_fifo.length-1]===this.accH_time_fifo[0])&&(console.warn(`pdr reset last one time ${this.accH_time_fifo[this.accH_time_fifo.length-1]} last two time ${this.accH_time_fifo[this.accH_time_fifo.length-2]}`),this.reset()),this.accH_fifo.length>9||this.fre<15){let e=(this.accH_fifo.length-1)/(this.accH_time_fifo[this.accH_time_fifo.length-1]-this.accH_time_fifo[0]);Math.abs(this.fre-e)>8&&(this.fre=Math.round((e-3)/10)*10,(this.fre<=10||this.fre>=100)&&(console.warn(`Frequency Error ${this.fre}`),this.fre=100),console.log(`Frequency change to ${this.fre}`),this.accH_fifo_len=Math.floor(1*this.fre)+1)}}recheckState(){return!0}PVstepDetec(){let e=!1,t=this.accH_fifo.slice(this.accH_fifo_len/2),n=this.accH_time_fifo.slice(this.accH_fifo_len/2),r=t[Math.floor(t.length/2)],i=n[Math.floor(n.length/2)],o=Math.max(...t),a=Math.min(...t),l=!1,u=!1;return Math.abs(r-a)<.01&&r<this.max_valley&&this.valley_num<=this.peak_num&&(this.last_valley_time===void 0||i-this.last_valley_time>this.min_step_time?u=!0:u=!1,u&&(this.last_valley_time=i,this.valley_num++)),Math.abs(r-o)<.01&&r>this.min_peak&&this.peak_num<=this.valley_num&&(this.last_peak_time===void 0||i-this.last_peak_time>this.min_step_time?l=!0:l=!1,l&&(this.last_peak_time=i,this.peak_num++)),r===o&&r>this.min_peak&&(this.abnor_peak_time=i,this.abnor_peak_accH=r),this.peak_num===this.valley_num&&(l||u)&&(e=!0),e}FFTstepDetec(){let e=!1,t=this.fre,n=this.accH_fifo_len,r=this.accH_fifo.map(h=>h-this.mean(this.accH_fifo)),i=this.rfft(r),o=this.getFrequencies(t,n),a=i.map(h=>Math.abs(h)),l=Math.max(...a),u=a.indexOf(l);l>this.fft_min_amp&&this.fft_min_fre<o[u]&&o[u]<this.fft_max_fre&&(e=!0),this.last_fft_amp=l;let c=0;this.abnor_fft_detected=!1;for(let h=0;h<o.length;h++)a[h]>c&&this.fft_min_fre<o[h]&&o[h]<this.fft_max_fre&&(c=a[h]);return c>this.fft_min_amp-.1&&(this.abnor_fft_detected=!0),e}mean(e){return e.reduce((t,n)=>t+n,0)/e.length}rfft(e){return e.map(t=>t)}getFrequencies(e,t){return Array.from({length:t/2+1},(n,r)=>r*(e/t))}getDeltaYaw_fromRot(e,t){if(t.length<3)return console.warn("rot data less than 3"),0;let n;this.last_rot.length===3?n=t.map((o,a)=>o-this.last_rot[a]):n=[0,0,0];for(let o=0;o<t.length;o++)n[o]<-180?n[o]+=360:n[o]>180&&(n[o]-=360);this.delta_rot.length===3?this.delta_rot=this.delta_rot.map((a,l)=>.2*a+(1-.2)*n[l]):this.delta_rot=n,this.last_rot=t,this.delta_yaw=this.delta_rot[0],this.last_yaw+=this.delta_yaw,this.last_yaw=this.limit_yaw(this.last_yaw);let r=this.delta_rot.reduce((o,a)=>o+Math.abs(a),0);this.delta_rot_sum_fifo.push(r),this.delta_rot_sum_time_fifo.push(e),Math.abs(this.delta_rot_sum_time_fifo[this.delta_rot_sum_time_fifo.length-1]-this.delta_rot_sum_time_fifo[0])>1&&(this.delta_rot_sum_fifo.shift(),this.delta_rot_sum_time_fifo.shift()),this.delta_yaw_accum+=this.delta_yaw;let i=0;return Math.abs(this.delta_yaw_accum_timestamp-e)>this.delta_yaw_time_threshold&&(i=this.delta_yaw_accum,this.delta_yaw_accum=0,this.delta_yaw_accum_timestamp=e),i}limit_yaw(e){for(;e<-180;)e+=360;for(;e>180;)e-=360;return e}};var ze=class{particleFilter;pdr;sigmaBeacon=5;gps_horizontalAccuracy=10;using_gps=!0;last_beacon_time=null;last_pos_time;position_count=0;gps_max_horizontalAccuracy=20;MaxEstimateErr=12;outTrustRegionNum=0;TrustNum=4;cacheSensorData=[];constructor(){this.particleFilter=new Be({NumParticle:200,reSampNumParticle:.65,initial_xy_uncertainty:12,initial_yaw_uncertainty:100,step_noise_sigma:.5,yaw_noise_sigma:2,compass_update_interval:3e3,sigmaCompass:80,delta_yaw:2,sigmaBeacon:5,unaccess_weight:.7}),this.pdr=new Ge}pfFusionPDRiBeacon(e){let{type:t,timestamp:n,res:r}=e,i=!1;if(this.particleFilter.getPosInitFlag()&&this.particleFilter.getYawInitFlag()){if(t==="acceleration"){let o=r,a=this.pdr.getStepLength(n,o);console.log("SENSOR_TYPE.ACCELERATION",a),a!==0&&(this.particleFilter.motionModelStepLength(a,()=>!0),this.particleFilter.resampling(),this.position_count+=1,i=!0)}if(this.using_gps&&t==="gps"&&(this.last_beacon_time===null||n-this.last_beacon_time>5e3)){let o=this.getGpsPosition(r);i=o!==null,o&&(this.particleFilter.update(o,this.gps_horizontalAccuracy),this.resetParticleFilterDist(o),this.particleFilter.resampling(),this.position_count+=1)}if(t==="deviceMotion"){let o=this.pdr.getDeltaYaw_fromRot(n,r);this.particleFilter.motionModelRotYaw(o)}t==="compass"&&(this.particleFilter.motionModelCompassYaw(r,n),this.particleFilter.setLastCompassTime(n)),this.last_pos_time&&n-this.last_pos_time>500&&(this.position_count+=1,i=!0)}else if(!this.particleFilter.getPosInitFlag()&&this.using_gps&&t==="gps"){let o=this.getGpsPosition(r);i=o!==null,o?(this.particleFilter.initParticlesByPos(o.x,o.y,()=>!0),this.last_pos_time=n,console.log(`init Pos by gps success time ${n}`),this.cacheSensorData.length=0):console.log(`init Pos by gps fail time ${n}`)}else if(!this.particleFilter.getYawInitFlag()&&t==="compass"){let o=r;this.particleFilter.initParticlesByCompass(o),this.particleFilter.setLastCompassTime(n),console.log(`init yaw by compass success time ${n}`)}else this.cacheSensorData.push(e);return i&&(this.last_pos_time=n),[i,this.particleFilter.getResultX(),this.particleFilter.getResultY()]}setBeaconPosition(e,t){return this.last_beacon_time=t,this.particleFilter.getPosInitFlag()?this.particleFilter.update(e,this.sigmaBeacon):this.particleFilter.initParticlesByPos(e.x,e.y,()=>!0),this.resetParticleFilterDist(e),this.particleFilter.resampling(),this.position_count+=1,this.cacheSensorData.filter(r=>r.timestamp>t).map(r=>this.pfFusionPDRiBeacon(r)),this.cacheSensorData.length=0,[this.particleFilter.getResultX(),this.particleFilter.getResultY()]}getGpsPosition(e){return e[2]>this.gps_max_horizontalAccuracy?null:Or(e[0],e[1])}resetParticleFilterDist(e){let t=this.particleFilter.getResultX(),n=this.particleFilter.getResultY();Ht(t,n,e.x,e.y)>this.MaxEstimateErr?(this.outTrustRegionNum+=1,this.outTrustRegionNum>=this.TrustNum&&(console.info(`\u8D85\u51FA\u53EF\u4FE1\u533A\u57DF\uFF0C\u91CD\u7F6E\u7C92\u5B50\u8FC7\u6EE4\u5668\u5230: ${e.x}, ${e.y}`),this.particleFilter.setPosInitFlag(!1),this.particleFilter.setYawInitFlag(!1),this.outTrustRegionNum=0)):this.outTrustRegionNum=0}};var Ur=class extends Fr.EventDispatcher{sensor;pdr;constructor(e={}){super(),this.sensor=new Oe(e.sensor),this.pdr=new ze}checkSensor(){return this.sensor.checkSensor()}start(){this.sensor.start(),this.sensor.addEventListener("add-data-item",({item:e})=>{let[t,n,r]=this.pdr.pfFusionPDRiBeacon(e);console.log(e,t,n,r),t&&this.dispatchEvent({type:"position",x:n,y:r})})}setBeaconPosition(e,t){let[n,r]=this.pdr.setBeaconPosition(e,t);this.dispatchEvent({type:"position",x:n,y:r})}dispose(){this.sensor.stop()}};async function Br({brand:s,project:e},t){let{apiDomain:n,apiPath:{floorRange:r},apiInfo:i}=t,o=`${n}${r}?brand=${s}&project=${e}&phase=${e}&building=${e}`;return await fetch(o,i).then(l=>l.json()).then(l=>l.data).then(l=>{let u=(l||[])[0];return u&&(u.info=JSON.parse(u.info)),u})}async function Gr({brand:s,project:e,floor:t,ts:n,resource_type_list:r},i){let{apiDomain:o,apiPath:{floorGraphic:a},apiInfo:l}=i,u=`${o}${a}?brand=${s}&project=${e}&phase=${e}&building=${e}&floor=${t}&ts=${n}&resource_type_list=${r}`;return await fetch(u,l).then(h=>h.json()).then(h=>h.data).then(h=>((h||[]).map(f=>f.info=JSON.parse(f.info)),h||[]))}var ot;function zr(s="aibee_map"){return new Promise((e,t)=>{if(ot)return e({db:ot,type:"success"});let n=indexedDB.open(s);n.onupgradeneeded=function(r){ot=r.target.result,console.log("onupgradeneeded"),e({db:ot,type:"onupgradeneeded"})},n.onsuccess=r=>{ot=r.target.result,e({db:ot,type:"success"})},n.onerror=r=>{t(r)}})}function kr(s,e,t=ot){return new Promise((n,r)=>{t||r("\u6CA1\u6709db");let o=t.transaction([s],"readonly").objectStore(s).get(e);o.onsuccess=()=>{o.result?n(o.result.value):n(null)},o.onerror=a=>{console.log("[getVersionByKey]",a),n(null)}})}function Vr(s,e,t,n=ot){return new Promise((r,i)=>(n||i("\u6CA1\u6709db"),new Promise((o,a)=>{let u=n.transaction([s],"readwrite").objectStore(s).add({key:e,value:t});u.onsuccess=function(c){o(c)},u.onerror=function(c){a(c)}})))}function ke(s,e=ot){e&&(e.objectStoreNames.contains(s)||e.createObjectStore(s,{keyPath:"key"}))}function Hr(){ot?.close(),ot=null}var Wr="data:image/png;base64,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";var Xr="data:image/png;base64,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";var qr="data:image/png;base64,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";var jh={loadRoadNetwork:!1},Ve="version",sn="map_data",He="road_network_data",jr={half:Wr,power:Xr,mechanical:qr},Yr=class{constructor(e){this.bmap=e;this.initDb()}floors=[];async initDb(){try{let{db:e,type:t}=await zr();t==="onupgradeneeded"&&(ke(Ve),ke(sn),ke(He))}catch(e){console.log("[\u6253\u5F00indexDb\u9519\u8BEF]",e)}}async load(e){if(this.clear(),Array.isArray(e))this.floors=e;else{let t=await fetch(e).then(n=>n.json());t.code==="0"&&(this.floors=t.data.list)}}setCacheData(e,t,n){return Vr(e,`${t}`,n)}getCacheData(e,t){return kr(e,`${t}`)}getFloorCacheKey(e){return`${e.floor_id}`}async getFloorData(e){let t=this.floors.find(r=>r.floor===e);if(!t)return null;let n=this.getFloorCacheKey(t);try{if(await this.getCacheData(Ve,n)===t.version_id){let i=await this.getCacheData(sn,n);if(i)return this.getDataByJson(i)}return this.getFloorDataByFloorInfo(t)}catch{return this.getFloorDataByFloorInfo(t)}}async getFloorDataByFloorInfo(e){let t=this.getFloorCacheKey(e);console.time("zstd_json");let n=await fetch(e.map_url).then(r=>r.json());return n.floor=e.floor,console.timeEnd("zstd_json"),this.setCacheData(sn,t,n),this.setCacheData(Ve,t,e.version_id),this.getDataByJson(n)}async getRoadNetworkData(){return(await Promise.all(this.floors.map(async t=>{let n=this.getFloorCacheKey(t);try{if(await this.getCacheData(Ve,n)===t.version_id){let o=await this.getCacheData(He,n);if(o)return o}let i=await fetch(t.route_url).then(o=>o.json());return this.setCacheData(He,n,i),i}catch{let r=await fetch(t.route_url).then(i=>i.json());return this.setCacheData(He,n,r),r}}))).filter(t=>t.points)}async getFacilitiesData(){if(this.floors[0]?.entry_infra_url)return fetch(this.floors[0].entry_infra_url).then(e=>e.json())}async getOtherDataByFreeTime(){}async getMulFloorsData(e){return Promise.all(e.map(t=>this.getFloorData(t))).then(t=>t.filter(n=>n))}async getDataByUrl(e){let t=await fetch(e).then(n=>n.json());return this.getDataByJson(t)}getDataByJson(e){let t=new ht(this.bmap.context);t.userData.graphics=[],t.userData.graphicMap=new Map;let n=[0,0];return e.layers.forEach(r=>{switch(r.l_type){case"range":let i=r.elements[0];n=[i.center_x,i.center_y];break;case"graph":Y(r.elements,n);let o=[];r.elements.forEach(p=>{p.group==="ground"?t.createGround(p):o.push(p)});let a=o.reduce((p,m)=>{let{fillColor:b,fillOpacity:E,strokeColor:z,strokeOpacity:S,height:T}=m,O=`${b.toLowerCase()}-${E}-${z.toLowerCase()}-${S}-${T}`;return S===0&&(O=`${b.toLowerCase()}-${E}-${T}`),p[O]?p[O].push(m):p[O]=[m],p},{});Object.values(a).forEach(p=>{let m=new ve(this.bmap.context,p);t.mergeGraphicLayer.add(m)});break;case"ground":Y(r.elements,n);let l=r.elements.map(p=>new L(this.bmap.context,p));t.addGrounds(l);break;case"wall":Y(r.elements,n);let u=r.elements.reduce((p,m)=>{let{fillColor:b,fillOpacity:E,strokeColor:z,strokeOpacity:S,height:T}=m,O=`${b.toLowerCase()}-${E}-${z.toLowerCase()}-${S}-${T}`;return S===0&&(O=`${b.toLowerCase()}-${E}-${T}`),p[O]?p[O].push(m):p[O]=[m],p},{});Object.values(u).forEach(p=>{let m=new me(this.bmap.context,p);t.wallLayer.add(m)});break;case"lane":Y(r.elements,n);let c=r.elements.reduce((p,m)=>{let{fillColor:b,fillOpacity:E,strokeColor:z,strokeOpacity:S}=m,T=`${b.toLowerCase()}-${E}-${z.toLowerCase()}-${S}`;return S===0&&(T=`${b.toLowerCase()}-${E}`),p[T]?p[T].push(m):p[T]=[m],p},{});Object.values(c).forEach(p=>{let m=new ye(this.bmap.context,p);t.laneLayer.add(m)});break;case"texture2d":case"texture3d":if(Y(r.elements,n),r.elements.length){let p=new Yt(this.bmap.context,r.elements);t.textureLayer.add(p)}break;case"glb":Y(r.elements,n),r.elements.forEach(p=>{let m=ct([p.center_x,p.center_y],n),b=new _e(this.bmap.context,{...p,url:p.secondUrl,rotate:p.secondRotate,width:p.secondWidth,center_x:m[0],center_y:m[1]});t.glbModelLayer.add(b)});break;case"store":Y(r.elements,n),r.elements.map(p=>{let m=ct([p.center_x,p.center_y],n),b=t.addGraphic(p);t.userData.graphics.push(b),t.userData.graphicMap.set(p.id,b);try{let E=new $(this.bmap.context,{id:p.id,icon:p.poi_info.icon,text:p.poi_info.showName||p.store_name||p.poi_info.text,position:{x:m[0],y:m[1],z:p.airHeight+p.height},icon_size:[18,18]});t.poiLayer2.pushPoi(E),E&&(E.userData.type="store",E.userData.data=p)}catch(E){console.log("\u521B\u5EFA\u5E97\u94FApoi\u5931\u8D25",E,p)}});break;case"facility":Y(r.elements,n),r.elements.map(p=>{let m=ct([p.center_x,p.center_y],n),b=t.addGraphic(p);if(t.userData.graphics.push(b),t.userData.graphicMap.set(p.id,b),p.poi_info){let E=new $(this.bmap.context,{id:p.id,icon:p.poi_info.icon,text:p.poi_info.showName||p.store_name||p.poi_info.text,position:{x:m[0],y:m[1],z:p.airHeight+p.height},icon_size:[18,18]});t.poiLayer2.pushPoi(E),E.userData.type="facility",E.userData.data=p}else console.log("\u6DFB\u52A0facility\u5931\u8D25\u6CA1\u6709poi_info",p)});break;case"parkingSpace":Y(r.elements,n);let h=[],f=new Map;r.elements.forEach(p=>{let m=t.addGraphic(p);h.push(m),f.set(p.id,m);let b=ct([p.center_x,p.center_y],n);if(p.texts[0]){let E=new $(this.bmap.context,{id:p.id,text:p.texts[0],position:{x:b[0],y:b[1],z:p.airHeight+p.height}});E&&(E.userData.type="parkingSpace",E.userData.data=p),t.poiLayer2.pushPoi(E)}});let d=r.elements.filter(p=>jr[p.parkingType]).map(p=>{let m=ct([p.center_x,p.center_y],n),b=pn(p.geometry.coords,m);return{uuid:p.id,iconUrl:jr[p.parkingType],name:p.texts[0],deltaHeight:p.deltaHeight,airHeight:p.airHeight,height:p.height,geometry:{...p.geometry,coords:b},opacity:p.fillOpacity,visible:!0}});if(d.length){let p=new Yt(this.bmap.context,d);t.textureLayer.add(p)}t.userData.parkingSpaces=h,t.userData.parkingSpacesGraphicMap=f;break;case"text":Y(r.elements,n);let y=new xe(this.bmap.context,r.elements.map(p=>{let m=ct([p.center_x,p.center_y],n);return{...p,center_x:m[0],center_y:m[1]}}));t.textTextureLayer.add(y);break}}),t.userData.center=n,t.userData.height=e.floorHeight*10,t.name=e.floor,t.userData.data=e,t.updateBox(),t}clear(){}dispose(){this.clear(),Hr()}};var $r=class{constructor(e){this.bmap=e}cacheData=new Map;floorDataLengthMap=new Map;buildingGroundMap=new Map;async load(e){let t=Bt(e);if(this.cacheData.has(t))return this.cacheData.get(t);let[,n]=await Promise.all([this.loadBuildGround(e),Gr(e,this.bmap.config)]),r=Bt({floor:e.floor,ts:e.ts});Y(n.map(o=>o.info),this.bmap.buildingCenter,this.floorDataLengthMap.get(r)||0),n.forEach(o=>o.info.transformToBuildingGround=!1),this.cacheData.set(t,n);let i=this.floorDataLengthMap.get(r)||0;return this.floorDataLengthMap.set(r,i+n.length),n}switchFloorByData(e,t){if(!e.length)return;let n=t.userData.legacyToGraphicMap||new Map,r=t.userData.graphicMap||new Map,{ground:i,markGraphic:o,graphic:a}=this.bmap.config;for(let l=0;l<e.length;l++){let u=e[l];u.info.group==="ground"?(u.info.fillColor=i.color,u.info.fillOpacity=i.opacity,u.info.height=i.height,u.info.stroke=i.stroke,u.info.strokeColor=i.strokeColor,u.info.strokeOpacity=i.strokeOpacity):u.info.userData.mark?(u.info.height=o.height,u.info.fillColor=o.color,u.info.fillOpacity=o.opacity,u.info.stroke=o.stroke,u.info.strokeColor=o.strokeColor,u.info.strokeOpacity=o.strokeOpacity):(u.info.fillOpacity=a.fillOpacity,this.bmap.config.initTransToMark&&(u.info.height=o.height,u.info.fillColor=o.color,u.info.stroke=o.stroke,u.info.strokeColor=o.strokeColor,u.info.strokeOpacity=o.strokeOpacity))}for(let l of e){if(l.info.group==="ground")t.createGround(l.info);else{let u=t.addGraphic(l.info);u.userData.data=l,n.set(l.legacy_id,u)}r.set(l.element_uuid,l)}t.userData.legacyToGraphicMap=n,t.userData.graphicMap=r,t.updateBox(),t===this.bmap.context.currentFloor?(this.bmap.triggerHooks("switch_floor_before",{curFloor:t,graphics:t.graphicLayer.children}),this.bmap.initialFloorCamera(),this.bmap.triggerHooks("switch_floor_after",{curFloor:t,graphics:t.graphicLayer.children})):this.bmap.switchFloorByFloor(t)}filterData(e,t){let n=t.userData.graphicMap||new Map;return e.filter(r=>!n.has(r.element_uuid))}async switchFloorByStoreData(e,t){let n=await this.load({...e,resource_type_list:"6"}),r=this.filterData(n,t);this.switchFloorByData(r,t)}async switchFloorByOtherData(e,t){let n=await this.load({...e,resource_type_list:"1,2,3,4"}),r=this.filterData(n,t);this.switchFloorByData(r,t)}async loadBuildGround({brand:e,project:t}){let n=await this.loadBuildingGround({brand:e,project:t});return this.bmap.currentBuildGround=n,this.bmap.changeBuildingCenter(n,{brand:e,project:t}),this.bmap.currentBuildGround}async loadBuildingGround({brand:e,project:t}){let n=Bt({brand:e,project:t});if(this.buildingGroundMap.has(n))return this.buildingGroundMap.get(n);let r=Br({brand:e,project:t},this.bmap.config).then(i=>(this.buildingGroundMap.set(n,i),i));return this.buildingGroundMap.set(n,r),r}async switchFloor(e){let t=new ht(this.bmap.context);t.name=e.floor;try{await Promise.all([this.switchFloorByStoreData(e,t),this.switchFloorByOtherData(e,t)])}catch(n){console.log(n)}return t}dispose(){this.cacheData.clear(),this.floorDataLengthMap.clear(),this.buildingGroundMap.clear()}};})();
|
|
7506
|
+
`)}var Rr=class extends Ir.EventDispatcher{worker=on();initRoadStatus=!1;constructor(){super()}async setRoadData(n){this.initRoadStatus=!1,this.dispatchEvent({type:"init-road-status",status:!1}),await lt(this.worker,"set_road_info",{roadData:n}),this.initRoadStatus=!0,this.dispatchEvent({type:"init-road-status",status:!0})}async getPath(n,t,e=""){return new Promise((r,i)=>{let o=()=>{console.log("initRoadStatus",this.initRoadStatus),lt(this.worker,"get_path",{start:n,end:t,type:e}).then(a=>{a?typeof a=="string"?i(a):r(a):i("no-path")})};if(this.initRoadStatus)o();else{let a=({status:l})=>{l&&(this.removeEventListener("init-road-status",a),o())};this.addEventListener("init-road-status",a)}})}getDirectionPath(n){return lt(this.worker,"get_direction_path",n)}async dispose(){lt(this.worker,"clear",""),this.worker.terminate()}};var Lr=g("three"),De=class extends et{startPoint;endPoint;rect;frustum=new Lr.Frustum;constructor(n){super(n);let{config:{selectBox:{fill:t,stroke:e}}}=n;this.rect=mt(e,t),this.svg.appendChild(this.rect),this.registryEvent()}setEnable(n){super.setEnable(n),k(this.rect,0,0,0,0),n?this.registryEvent():(this.startPoint=void 0,this.unRegistryEvent())}onPointerDown=n=>{if(!this.enable)return;let t=this.getIntersectByPointerEvent(n);t&&(this.startPoint=t),this.endPoint=void 0};onPointerMove=n=>{if(!this.enable||!this.startPoint)return;let t=this.getIntersectByPointerEvent(n);t&&(this.endPoint=t)};onPointerUp=n=>{if(!this.enable)return;let t=this.getIntersectByPointerEvent(n);t&&(this.endPoint=t),this.doSelect(),this.startPoint=void 0};onUpdate=()=>{if(this.startPoint){let n=this.getSvgCoordinate(this.startPoint),t={...n};this.endPoint&&(t=this.getSvgCoordinate(this.endPoint));let e={x:Math.min(n.x,t.x),y:Math.min(n.y,t.y)},r=Math.abs(t.x-n.x),i=Math.abs(t.y-n.y);k(this.rect,e.x,e.y,r,i)}else k(this.rect,0,0,0,0)};registryEvent(){this.context.container.addEventListener("pointerdown",this.onPointerDown),this.context.container.addEventListener("pointermove",this.onPointerMove),this.context.container.addEventListener("pointerup",this.onPointerUp),this.context.addEventListener("update",this.onUpdate)}unRegistryEvent(){this.context.container.removeEventListener("pointerdown",this.onPointerDown),this.context.container.removeEventListener("pointermove",this.onPointerMove),this.context.container.removeEventListener("pointerup",this.onPointerUp),this.context.removeEventListener("update",this.onUpdate)}doSelect(){if(this.startPoint&&this.endPoint){if(this.startPoint.distanceTo(this.endPoint)<.1)return;let{context:{camera:t,container:{clientWidth:e,clientHeight:r}}}=this,i=x(this.startPoint,t,e,r),o=x(this.endPoint,t,e,r),a={x:Math.min(i.x,o.x),y:Math.min(i.y,o.y)},l={x:Math.max(i.x,o.x),y:Math.max(i.y,o.y)},u=this.searchMapInFrustum(a,l);this.dispatchEvent({type:"selected",list:u})}}searchMapInFrustum(n,t){let{context:e}=this;return e.currentFloor?.graphicLayer.children.filter(r=>r instanceof L&&this.searchChildInFrustum(r,n,t))||[]}searchChildInFrustum(n,t,e){let{context:{camera:r,container:{clientWidth:i,clientHeight:o}}}=this;if(!n)return!1;if(!n.mesh){let f=n.getPosition();if(f){let d=x(f,r,i,o);return gt(d,t,e)}return!1}n.mesh.geometry.boundingBox||n.mesh.geometry.computeBoundingBox();let a=n.mesh.geometry.boundingBox;if(!a)return!1;let{min:l,max:u}=a,c=x(l,r,i,o),h=x(u,r,i,o);return!(!gt(c,t,e)||!gt(h,t,e))}dispose(){this.unRegistryEvent()}};var Mi={boxSelection:!1,elements:["graphic","poi"]},Nr=class extends pt{options;_list=new Set;_poiList=new Set;boxSelection;prevPanStatus;prevRotateStatus;downPoint=null;isMultipleSelect=!1;constructor(n,t={}){super(n),this.options={...Mi,...t},this.boxSelection=new De(this.bmap.context),this.boxSelection.setEnable(!1),this.registryEvent()}get list(){return this._list}enableBoxSelection(){this.isMultipleSelect||!this.options.boxSelection||(this.isMultipleSelect=!0,this.boxSelection.setEnable(!0),this.prevPanStatus=this.bmap.context.control.enablePan,this.prevRotateStatus=this.bmap.context.control.enableRotate,this.bmap.context.control.enablePan=!1,this.bmap.context.control.enableRotate=!1)}disableBoxSelection(){this.isMultipleSelect&&(this.isMultipleSelect=!1,this.boxSelection.setEnable(!1),this.bmap.context.control.enablePan=!!this.prevPanStatus,this.bmap.context.control.enableRotate=!!this.prevRotateStatus)}onPointerDown=n=>{this.downPoint={x:n.offsetX,y:n.offsetY}};onPointerUp=n=>{if(!this.downPoint)return;let{offsetX:t,offsetY:e}=n,{x:r,y:i}=this.downPoint;if(Math.sqrt((r-t)**2+(i-e)**2)>3)return;let o=new Set,a=[],l=[];if(this.options.elements.includes("graphic")){let{graphics:u}=this.bmap.context.getGraphicsByDeviceXy(t,e);u.map(c=>o.add(c.options.id)),a.push(...u)}if(this.options.elements.includes("poi")){let u=this.bmap.context.getPoisByDeviceXy(t,e);l.push(...u),u.forEach(c=>{if(!o.has(c.options.id)){let h=this.bmap.context.currentFloor?.graphicLayer.graphicMap.get(c.options.id)||null;h&&(o.add(c.options.id),a.push(h))}})}(!this.options.boxSelection||!(Ut?n.metaKey:n.ctrlKey))&&(this._list.clear(),this._poiList.clear()),a.forEach(u=>this._list.add(u)),l.forEach(u=>this._poiList.add(u)),this.selectEnd(),this.downPoint=null};onPointerOut=n=>{this.disableBoxSelection()};onKeyDown=n=>{Ft(n.key)&&this.enableBoxSelection()};onKeyUp=n=>{Ft(n.key)&&this.disableBoxSelection()};onBoxSelected=({list:n})=>{this._list.clear(),n.forEach(t=>{this._list.add(t)}),this.selectEnd()};selectEnd(){this.dispatchEvent({type:"select",graphics:[...this._list],pois:[...this._poiList],isMultipleSelect:this.isMultipleSelect})}registryEvent(){this.bmap.context.container.addEventListener("pointerdown",this.onPointerDown),this.bmap.context.container.addEventListener("pointerup",this.onPointerUp),this.bmap.context.container.addEventListener("pointerout",this.onPointerOut),this.bmap.context.container.addEventListener("pointercancel",this.onPointerOut),window.addEventListener("keydown",this.onKeyDown),window.addEventListener("keyup",this.onKeyUp),this.boxSelection.addEventListener("selected",this.onBoxSelected)}unRegistryEvent(){this.bmap.context.container.removeEventListener("pointerdown",this.onPointerDown),this.bmap.context.container.removeEventListener("pointerup",this.onPointerUp),this.bmap.context.container.removeEventListener("pointerout",this.onPointerOut),this.bmap.context.container.removeEventListener("pointercancel",this.onPointerOut),window.removeEventListener("keydown",this.onKeyDown),window.removeEventListener("keyup",this.onKeyUp),this.boxSelection.removeEventListener("selected",this.onBoxSelected)}clear(){this._list.clear()}remove(n){this._list.delete(n)}dispose(){this.unRegistryEvent()}};var q=g("lodash");var Dr=g("three");var Ti={time:200,elements:["compass","deviceMotion","acceleration","gps"]},Oe=class extends Dr.EventDispatcher{options;gpsTimer=null;data=[];timer=new U;dispatchTimer=null;constructor(n={}){super(),this.options={...Ti,...n}}start(){this.options.elements.some(n=>["deviceMotion","compass"].includes(n))&&this.listenDeviceOrientation(),this.options.elements.includes("acceleration")&&this.listenAcceleration(),this.options.elements.includes("gps")&&this.listenGps(),this.dispatchEvent({type:"start"}),this.dispatchTimer=this.timer.setInterval(()=>{this.dispatchEvent({type:"sensor-data",data:(0,q.cloneDeep)(this.data)}),this.data=[]},this.options.time)}addDataItem(n){this.data.push(n),this.dispatchEvent({type:"add-data-item",item:n})}addDeviceMotion=(0,q.throttle)(n=>{this.addDataItem(n)},20);addAcceleration=(0,q.throttle)(n=>{this.addDataItem(n)},20);deviceOrientationAbsHandler=n=>{let t=Date.now(),{alpha:e,beta:r,gamma:i}=n;if((0,q.isNil)(e)||(0,q.isNil)(r)||(0,q.isNil)(i))return;let o;qt?o=n.webkitCompassHeading:o=360-e,this.options.elements.includes("deviceMotion")&&this.addDeviceMotion({type:"deviceMotion",timestamp:t,res:[e,r,i]}),this.options.elements.includes("compass")&&this.addDataItem({type:"compass",timestamp:t,res:o})};listenDeviceOrientation(){qt?window.addEventListener("deviceorientation",this.deviceOrientationAbsHandler,!1):window.addEventListener("deviceorientationabsolute",this.deviceOrientationAbsHandler,{absolute:!0})}handleAcceleration=n=>{let t=n.accelerationIncludingGravity;(0,q.isNil)(t)||(0,q.isNil)(t.x)||(0,q.isNil)(t.y)||(0,q.isNil)(t.z)||this.addAcceleration({type:"acceleration",timestamp:Date.now(),res:[t.x,t.y,t.z]})};listenAcceleration(){window.addEventListener("devicemotion",this.handleAcceleration,!1)}listenGps(){this.gpsTimer=navigator.geolocation.watchPosition(n=>{n.coords.accuracy<=10&&this.addDataItem({type:"gps",timestamp:Date.now(),res:[n.coords.longitude,n.coords.latitude,n.coords.accuracy]})})}async checkSensor(){return{deviceOrientation:await this.checkDeviceOrientation()}}async checkDeviceOrientation(){if(!qt)return!0;if(typeof window.DeviceOrientationEvent<"u"&&typeof window.DeviceOrientationEvent?.requestPermission=="function")try{return await window.DeviceOrientationEvent?.requestPermission()==="granted"}catch{return!1}return!1}stop(){window.removeEventListener("devicemotion",this.handleAcceleration,!1),qt?window.removeEventListener("deviceorientation",this.deviceOrientationAbsHandler,!1):window.removeEventListener("deviceorientationabsolute",this.deviceOrientationAbsHandler,{absolute:!0}),(0,q.isNil)(this.gpsTimer)||navigator.geolocation.clearWatch(this.gpsTimer),this.dispatchTimer&&this.timer.clearInterval(this.dispatchTimer),this.data=[],this.dispatchEvent({type:"stop"})}};var Fr=g("three");function Ue(s,n){return 1/Math.sqrt(2*Math.PI*Math.pow(n,2))*Math.exp(-Math.pow(s,2)/(2*Math.pow(n,2)))}function Fe(s){return(s+360)%360}function Or(s,n){let e=6378137*s*Math.PI/180,r=6378137*Math.log(Math.tan(Math.PI/4+n*Math.PI/180/2));return{x:e,y:r}}function Ht(s,n,t,e){return Math.sqrt(Math.pow(Math.abs(s-t),2)+Math.pow(Math.abs(n-e),2))}var Be=class{NumParticle;reSampNumParticle;initial_xy_uncertainty;initial_yaw_uncertainty;step_noise_sigma;yaw_noise_sigma;compass_update_interval;sigmaCompass;delta_yaw;sigmaBeacon;unaccess_weight;particle_PosInitFlag;particle_yawInitFlag;xEst;particleX;particleWeight;last_compass_time;constructor(n){this.NumParticle=n.NumParticle,this.reSampNumParticle=n.reSampNumParticle,this.initial_xy_uncertainty=n.initial_xy_uncertainty,this.initial_yaw_uncertainty=n.initial_yaw_uncertainty,this.step_noise_sigma=n.step_noise_sigma,this.yaw_noise_sigma=n.yaw_noise_sigma,this.compass_update_interval=n.compass_update_interval,this.sigmaCompass=n.sigmaCompass,this.delta_yaw=n.delta_yaw,this.sigmaBeacon=n.sigmaBeacon,this.unaccess_weight=n.unaccess_weight,this.particle_PosInitFlag=!1,this.particle_yawInitFlag=!1,this.xEst=[[0],[0],[0]],this.particleX=Array.from({length:3},()=>Array(this.NumParticle).fill(0)),this.particleWeight=Array.from({length:1},()=>Array(this.NumParticle).fill(1/this.NumParticle)),this.last_compass_time=0}motionModelRotYaw(n){if(!(Math.abs(n)<.001))for(let t=0;t<this.NumParticle;t++){let e=Math.random()*this.yaw_noise_sigma;this.particleX[2][t]=this.particleX[2][t]+n+e,this.particleX[2][t]=Fe(this.particleX[2][t])}}motionModelStepLength(n,t){if(n===0)return;for(let r=0;r<this.NumParticle;r++){let i=Math.random()*this.step_noise_sigma;this.particleX[0][r]+=(.65+i)*Math.sin(-this.particleX[2][r]/180*Math.PI),this.particleX[1][r]+=(.65+i)*Math.cos(this.particleX[2][r]/180*Math.PI),t(this.particleX[0][r],this.particleX[1][r])||(this.particleWeight[0][r]*=this.unaccess_weight)}let e=this.particleWeight[0].reduce((r,i)=>r+i,0);this.particleWeight[0]=this.particleWeight[0].map(r=>r/e)}motionModelCompassYaw(n,t){if(t-this.last_compass_time>this.compass_update_interval){let e=360-n;e+=this.delta_yaw,e=Fe(e);for(let i=0;i<this.NumParticle;i++){let o=Math.abs(this.particleX[2][i]-e);o>180&&(o=360-o),this.particleWeight[0][i]*=Ue(o,this.sigmaCompass)}let r=this.particleWeight[0].reduce((i,o)=>i+o,0);this.particleWeight[0]=this.particleWeight[0].map(i=>i/r)}}resampling(){if(1/this.particleWeight[0].reduce((t,e)=>t+e*e,0)<this.reSampNumParticle){let t=this.particleWeight[0].reduce((a,l,u)=>a.concat(a[u]+l),[0]),r=this.particleWeight[0].map(()=>1/this.NumParticle).map((a,l)=>a+Math.random()/this.NumParticle),i=[],o=0;for(let a=0;a<this.NumParticle;a++){for(;r[a]>t[o];)o++;i.push(o)}this.particleX=this.particleX.map((a,l)=>i.map(u=>a[u])),this.particleWeight[0]=Array(this.NumParticle).fill(1/this.NumParticle)}}update(n,t){for(let r=0;r<this.NumParticle;r++){let i=Ht(this.particleX[0][r],this.particleX[1][r],n.x,n.y);this.particleWeight[0][r]=Math.max(1e-7,this.particleWeight[0][r]*Ue(i,t))}let e=this.particleWeight[0].reduce((r,i)=>r+i,0);this.particleWeight[0]=this.particleWeight[0].map(r=>r/e)}updateCar(n,t){let e=n.x-this.xEst[0][0],r=n.y-this.xEst[1][0];for(let o=0;o<this.NumParticle;o++){let a=Ht(this.particleX[0][o],this.particleX[1][o],n.x,n.y);this.particleWeight[0][o]=Math.max(1e-7,this.particleWeight[0][o]*Ue(a,t)),this.particleX[0][o]+=e,this.particleX[1][o]+=r}let i=this.particleWeight[0].reduce((o,a)=>o+a,0);this.particleWeight[0]=this.particleWeight[0].map(o=>o/i)}getPosInitFlag(){return this.particle_PosInitFlag}getYawInitFlag(){return this.particle_yawInitFlag}setPosInitFlag(n){this.particle_PosInitFlag=n}setYawInitFlag(n){this.particle_yawInitFlag=n}getResultX(){return this.xEst[0][0]=this.particleX[0].reduce((n,t,e)=>n+t*this.particleWeight[0][e],0),this.xEst[0][0]}getResultY(){return this.xEst[1][0]}getResultYaw(){let n=this.particleWeight[0].indexOf(Math.max(...this.particleWeight[0]));return this.particleX[2][n]}getEstConfidence(){let n=this.particleWeight[0].indexOf(Math.max(...this.particleWeight[0])),t=this.particleWeight[0].indexOf(Math.min(...this.particleWeight[0])),e=[this.particleX[0][n],this.particleX[1][n]],r=[this.particleX[0][t],this.particleX[1][t]],i=Ht(e[0],e[1],r[0],r[1]),o=i*.67;return console.log(i,o),o}getParticleNum(){return this.NumParticle}getParticleX(){return this.particleX}setLastCompassTime(n){this.last_compass_time=n}getLastCompassTime(){return this.last_compass_time}initParticlesByPos(n,t,e){if(!this.particle_PosInitFlag){this.particleWeight[0]=Array(this.NumParticle).fill(1/this.NumParticle);let r=0;for(;r<this.NumParticle;){let o=(2*Math.random()-1)*this.initial_xy_uncertainty,a=(2*Math.random()-1)*this.initial_xy_uncertainty;e(n+o,t+a)||(this.particleWeight[0][r]*=this.unaccess_weight),this.particleX[0][r]=n+o,this.particleX[1][r]=t+a,r++}let i=this.particleWeight[0].reduce((o,a)=>o+a,0);this.particleWeight[0]=this.particleWeight[0].map(o=>o/i),this.particle_PosInitFlag=!0,this.xEst[0][0]=n,this.xEst[1][0]=t,this.xEst[2][0]=0}}initParticlesByCompass(n){console.log(`Init compass: ${n}`);let t=360-n;t+=this.delta_yaw,t=Fe(t),console.log(`Init Yaw: ${t}`);for(let e=0;e<this.NumParticle;e++){let r=(2*Math.random()-1)*this.initial_yaw_uncertainty;this.particleX[2][e]=t+r}this.particle_yawInitFlag=!0,this.xEst[2][0]=t}};var Ge=class{fre;accH_fifo;accH_time_fifo;accH_fifo_len;step_count;state_count;last_valley_time;last_peak_time;last_step_time;min_step_time;max_step_time;min_peak;max_valley;peak_num;valley_num;fft_min_amp;fft_min_fre;fft_max_fre;last_fft_amp;abnor_start_time;abnor_fft_detected;abnor_time_threshod;abnor_peak_time;abnor_peak_accH;const_step_length;last_rot;delta_rot;last_yaw;delta_yaw;delta_rot_sum_fifo;delta_rot_sum_time_fifo;delta_yaw_accum;delta_yaw_accum_timestamp;delta_yaw_time_threshold;last_px;last_py;delta_px;delta_py;constructor(){this.init()}init(){this.fre=100,this.accH_fifo=[],this.accH_time_fifo=[],this.accH_fifo_len=Math.floor(1*this.fre)+1,this.step_count=0,this.state_count=0,this.last_valley_time=0,this.last_peak_time=0,this.last_step_time=0,this.min_step_time=300,this.max_step_time=1e3,this.min_peak=10+.5,this.max_valley=10-.5,this.peak_num=0,this.valley_num=0,this.fft_min_amp=.3,this.fft_min_fre=0,this.fft_max_fre=4,this.last_fft_amp=0,this.abnor_start_time=0,this.abnor_fft_detected=!1,this.abnor_time_threshod=4e3,this.abnor_peak_time=0,this.abnor_peak_accH=0,this.const_step_length=.65,this.last_rot=[],this.delta_rot=[],this.last_yaw=0,this.delta_yaw=null,this.delta_rot_sum_fifo=[],this.delta_rot_sum_time_fifo=[],this.delta_yaw_accum=0,this.delta_yaw_accum_timestamp=0,this.delta_yaw_time_threshold=500,this.last_px=0,this.last_py=0,this.delta_px=0,this.delta_py=0}reset(){this.init()}set_init_pose(n=[0,0]){this.last_px=n[0],this.last_py=n[1],console.log(`pdr init pos: ${this.last_px}, ${this.last_py}`)}set_init_yaw(n=0){this.last_yaw=n}getPos(n,t,e){let r=0;return e.length===3&&(this.delta_yaw=this.getDeltaYaw_fromRot(n,e)),t.length===3&&(r=this.getStepLength(n,t)),r!==0&&(this.last_px+=this.delta_px,this.last_py+=this.delta_py),[this.last_px,this.last_py]}get_delta_pose(){return[this.delta_px,this.delta_py]}getStepLength(n,t){if(t.length<3)return console.warn("acc data less than 3"),0;let e=!1,r=Math.sqrt(t.reduce((i,o)=>i+o*o,0));if(this.accH_fifo.push(r),this.accH_time_fifo.push(n),this.imuFreUpdate(),this.accH_fifo.length<this.accH_fifo_len+1)e=!1;else{for(;this.accH_fifo.length>=this.accH_fifo_len+1;)this.accH_fifo.shift(),this.accH_time_fifo.shift();let i=this.PVstepDetec(),o=this.FFTstepDetec(),a=this.recheckState(),l=this.accH_time_fifo[Math.floor(this.accH_time_fifo.length*(3/4))];Math.abs(this.abnor_start_time)<.001&&this.abnor_fft_detected?this.abnor_start_time=l:this.abnor_fft_detected||(this.abnor_start_time=0),console.log("pv_detected",i,o,a,this.abnor_start_time,l),i&&o&&a?(this.step_count++,this.last_step_time=l,e=!0):Math.abs(this.abnor_start_time)>.001&&this.abnor_peak_time-this.abnor_start_time>this.abnor_time_threshod&&this.step_count>1&&this.abnor_peak_time-this.last_step_time>1e3?(this.step_count++,this.last_step_time=l,e=!0):(l-this.last_step_time>2e3&&(this.state_count=0),e=!1)}if(console.log("detected_flag",e),e){let i=this.last_yaw/180*Math.PI;return this.delta_px=this.const_step_length*Math.cos(i),this.delta_py=this.const_step_length*Math.sin(i),this.const_step_length}else return 0}imuFreUpdate(){if(console.log("this.accH_time_fifo",this.accH_time_fifo),this.accH_time_fifo.length>2&&(this.accH_time_fifo[this.accH_time_fifo.length-1]-this.accH_time_fifo[this.accH_time_fifo.length-2]<0||this.accH_time_fifo[this.accH_time_fifo.length-1]-this.accH_time_fifo[this.accH_time_fifo.length-2]>1e4||this.accH_time_fifo[this.accH_time_fifo.length-1]===this.accH_time_fifo[0])&&(console.warn(`pdr reset last one time ${this.accH_time_fifo[this.accH_time_fifo.length-1]} last two time ${this.accH_time_fifo[this.accH_time_fifo.length-2]}`),this.reset()),this.accH_fifo.length>9||this.fre<15){let n=(this.accH_fifo.length-1)/(this.accH_time_fifo[this.accH_time_fifo.length-1]-this.accH_time_fifo[0]);Math.abs(this.fre-n)>8&&(this.fre=Math.round((n-3)/10)*10,(this.fre<=10||this.fre>=100)&&(console.warn(`Frequency Error ${this.fre}`),this.fre=100),console.log(`Frequency change to ${this.fre}`),this.accH_fifo_len=Math.floor(1*this.fre)+1)}}recheckState(){return!0}PVstepDetec(){let n=!1,t=this.accH_fifo.slice(this.accH_fifo_len/2),e=this.accH_time_fifo.slice(this.accH_fifo_len/2),r=t[Math.floor(t.length/2)],i=e[Math.floor(e.length/2)],o=Math.max(...t),a=Math.min(...t),l=!1,u=!1;return console.log("mid_accH - min_accH",r-a,r,o,this.valley_num,this.peak_num,this.min_peak),Math.abs(r-a)<.01&&r<this.max_valley&&this.valley_num<=this.peak_num&&(this.last_valley_time===void 0||i-this.last_valley_time>this.min_step_time?u=!0:u=!1,u&&(this.last_valley_time=i,this.valley_num++)),Math.abs(r-o)<.01&&r>this.min_peak&&this.peak_num<=this.valley_num&&(this.last_peak_time===void 0||i-this.last_peak_time>this.min_step_time?l=!0:l=!1,l&&(this.last_peak_time=i,this.peak_num++)),r===o&&r>this.min_peak&&(this.abnor_peak_time=i,this.abnor_peak_accH=r),this.peak_num===this.valley_num&&(l||u)&&(n=!0),n}FFTstepDetec(){let n=!1,t=this.fre,e=this.accH_fifo_len,r=this.accH_fifo.map(h=>h-this.mean(this.accH_fifo)),i=this.rfft(r),o=this.getFrequencies(t,e),a=i.map(h=>Math.abs(h)),l=Math.max(...a),u=a.indexOf(l);l>this.fft_min_amp&&this.fft_min_fre<o[u]&&o[u]<this.fft_max_fre&&(n=!0),this.last_fft_amp=l;let c=0;this.abnor_fft_detected=!1;for(let h=0;h<o.length;h++)a[h]>c&&this.fft_min_fre<o[h]&&o[h]<this.fft_max_fre&&(c=a[h]);return c>this.fft_min_amp-.1&&(this.abnor_fft_detected=!0),n}mean(n){return n.reduce((t,e)=>t+e,0)/n.length}rfft(n){return n.map(t=>t)}getFrequencies(n,t){return Array.from({length:t/2+1},(e,r)=>r*(n/t))}getDeltaYaw_fromRot(n,t){if(t.length<3)return console.warn("rot data less than 3"),0;let e;this.last_rot.length===3?e=t.map((o,a)=>o-this.last_rot[a]):e=[0,0,0];for(let o=0;o<t.length;o++)e[o]<-180?e[o]+=360:e[o]>180&&(e[o]-=360);this.delta_rot.length===3?this.delta_rot=this.delta_rot.map((a,l)=>.2*a+(1-.2)*e[l]):this.delta_rot=e,this.last_rot=t,this.delta_yaw=this.delta_rot[0],this.last_yaw+=this.delta_yaw,this.last_yaw=this.limit_yaw(this.last_yaw);let r=this.delta_rot.reduce((o,a)=>o+Math.abs(a),0);this.delta_rot_sum_fifo.push(r),this.delta_rot_sum_time_fifo.push(n),Math.abs(this.delta_rot_sum_time_fifo[this.delta_rot_sum_time_fifo.length-1]-this.delta_rot_sum_time_fifo[0])>1&&(this.delta_rot_sum_fifo.shift(),this.delta_rot_sum_time_fifo.shift()),this.delta_yaw_accum+=this.delta_yaw;let i=0;return Math.abs(this.delta_yaw_accum_timestamp-n)>this.delta_yaw_time_threshold&&(i=this.delta_yaw_accum,this.delta_yaw_accum=0,this.delta_yaw_accum_timestamp=n),i}limit_yaw(n){for(;n<-180;)n+=360;for(;n>180;)n-=360;return n}};var ze=class{particleFilter;pdr;sigmaBeacon=5;gps_horizontalAccuracy=10;using_gps=!0;last_beacon_time=null;last_pos_time;position_count=0;gps_max_horizontalAccuracy=20;MaxEstimateErr=12;outTrustRegionNum=0;TrustNum=4;cacheSensorData=[];constructor(){this.particleFilter=new Be({NumParticle:200,reSampNumParticle:.65,initial_xy_uncertainty:12,initial_yaw_uncertainty:100,step_noise_sigma:.5,yaw_noise_sigma:2,compass_update_interval:3e3,sigmaCompass:80,delta_yaw:2,sigmaBeacon:5,unaccess_weight:.7}),this.pdr=new Ge}pfFusionPDRiBeacon(n){let{type:t,timestamp:e,res:r}=n,i=!1;if(this.particleFilter.getPosInitFlag()&&this.particleFilter.getYawInitFlag()){if(t==="acceleration"){let o=r,a=this.pdr.getStepLength(e,o);console.log("SENSOR_TYPE.ACCELERATION",a),a!==0&&(this.particleFilter.motionModelStepLength(a,()=>!0),this.particleFilter.resampling(),this.position_count+=1,i=!0)}if(this.using_gps&&t==="gps"&&(this.last_beacon_time===null||e-this.last_beacon_time>5e3)){let o=this.getGpsPosition(r);i=o!==null,o&&(this.particleFilter.update(o,this.gps_horizontalAccuracy),this.resetParticleFilterDist(o),this.particleFilter.resampling(),this.position_count+=1)}if(t==="deviceMotion"){let o=this.pdr.getDeltaYaw_fromRot(e,r);this.particleFilter.motionModelRotYaw(o)}t==="compass"&&(this.particleFilter.motionModelCompassYaw(r,e),this.particleFilter.setLastCompassTime(e)),this.last_pos_time&&e-this.last_pos_time>500&&(this.position_count+=1,i=!0)}else if(!this.particleFilter.getPosInitFlag()&&this.using_gps&&t==="gps"){let o=this.getGpsPosition(r);i=o!==null,o?(this.particleFilter.initParticlesByPos(o.x,o.y,()=>!0),this.last_pos_time=e,console.log(`init Pos by gps success time ${e}`),this.cacheSensorData.length=0):console.log(`init Pos by gps fail time ${e}`)}else if(!this.particleFilter.getYawInitFlag()&&t==="compass"){let o=r;this.particleFilter.initParticlesByCompass(o),this.particleFilter.setLastCompassTime(e),console.log(`init yaw by compass success time ${e}`)}else this.cacheSensorData.push(n);return i&&(this.last_pos_time=e),[i,this.particleFilter.getResultX(),this.particleFilter.getResultY()]}setBeaconPosition(n,t){return this.last_beacon_time=t,this.particleFilter.getPosInitFlag()?this.particleFilter.update(n,this.sigmaBeacon):this.particleFilter.initParticlesByPos(n.x,n.y,()=>!0),this.resetParticleFilterDist(n),this.particleFilter.resampling(),this.position_count+=1,this.cacheSensorData.filter(r=>r.timestamp>t).map(r=>this.pfFusionPDRiBeacon(r)),this.cacheSensorData.length=0,[this.particleFilter.getResultX(),this.particleFilter.getResultY()]}getGpsPosition(n){return n[2]>this.gps_max_horizontalAccuracy?null:Or(n[0],n[1])}resetParticleFilterDist(n){let t=this.particleFilter.getResultX(),e=this.particleFilter.getResultY();Ht(t,e,n.x,n.y)>this.MaxEstimateErr?(this.outTrustRegionNum+=1,this.outTrustRegionNum>=this.TrustNum&&(console.info(`\u8D85\u51FA\u53EF\u4FE1\u533A\u57DF\uFF0C\u91CD\u7F6E\u7C92\u5B50\u8FC7\u6EE4\u5668\u5230: ${n.x}, ${n.y}`),this.particleFilter.setPosInitFlag(!1),this.particleFilter.setYawInitFlag(!1),this.outTrustRegionNum=0)):this.outTrustRegionNum=0}};var Ur=class extends Fr.EventDispatcher{sensor;pdr;constructor(n={}){super(),this.sensor=new Oe(n.sensor),this.pdr=new ze}checkSensor(){return this.sensor.checkSensor()}start(){this.sensor.start(),this.sensor.addEventListener("add-data-item",({item:n})=>{let[t,e,r]=this.pdr.pfFusionPDRiBeacon(n);console.log(n,t,e,r),t&&this.dispatchEvent({type:"position",x:e,y:r})})}setBeaconPosition(n,t){let[e,r]=this.pdr.setBeaconPosition(n,t);this.dispatchEvent({type:"position",x:e,y:r})}dispose(){this.sensor.stop()}};async function Br({brand:s,project:n},t){let{apiDomain:e,apiPath:{floorRange:r},apiInfo:i}=t,o=`${e}${r}?brand=${s}&project=${n}&phase=${n}&building=${n}`;return await fetch(o,i).then(l=>l.json()).then(l=>l.data).then(l=>{let u=(l||[])[0];return u&&(u.info=JSON.parse(u.info)),u})}async function Gr({brand:s,project:n,floor:t,ts:e,resource_type_list:r},i){let{apiDomain:o,apiPath:{floorGraphic:a},apiInfo:l}=i,u=`${o}${a}?brand=${s}&project=${n}&phase=${n}&building=${n}&floor=${t}&ts=${e}&resource_type_list=${r}`;return await fetch(u,l).then(h=>h.json()).then(h=>h.data).then(h=>((h||[]).map(f=>f.info=JSON.parse(f.info)),h||[]))}var ot;function zr(s="aibee_map"){return new Promise((n,t)=>{if(ot)return n({db:ot,type:"success"});let e=indexedDB.open(s);e.onupgradeneeded=function(r){ot=r.target.result,console.log("onupgradeneeded"),n({db:ot,type:"onupgradeneeded"})},e.onsuccess=r=>{ot=r.target.result,n({db:ot,type:"success"})},e.onerror=r=>{t(r)}})}function kr(s,n,t=ot){return new Promise((e,r)=>{t||r("\u6CA1\u6709db");let o=t.transaction([s],"readonly").objectStore(s).get(n);o.onsuccess=()=>{o.result?e(o.result.value):e(null)},o.onerror=a=>{console.log("[getVersionByKey]",a),e(null)}})}function Vr(s,n,t,e=ot){return new Promise((r,i)=>(e||i("\u6CA1\u6709db"),new Promise((o,a)=>{let u=e.transaction([s],"readwrite").objectStore(s).add({key:n,value:t});u.onsuccess=function(c){o(c)},u.onerror=function(c){a(c)}})))}function ke(s,n=ot){n&&(n.objectStoreNames.contains(s)||n.createObjectStore(s,{keyPath:"key"}))}function Hr(){ot?.close(),ot=null}var Wr="data:image/png;base64,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";var Xr="data:image/png;base64,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";var qr="data:image/png;base64,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";var jh={loadRoadNetwork:!1},Ve="version",sn="map_data",He="road_network_data",jr={half:Wr,power:Xr,mechanical:qr},Yr=class{constructor(n){this.bmap=n;this.initDb()}floors=[];async initDb(){try{let{db:n,type:t}=await zr();t==="onupgradeneeded"&&(ke(Ve),ke(sn),ke(He))}catch(n){console.log("[\u6253\u5F00indexDb\u9519\u8BEF]",n)}}async load(n){if(this.clear(),Array.isArray(n))this.floors=n;else{let t=await fetch(n).then(e=>e.json());t.code==="0"&&(this.floors=t.data.list)}}setCacheData(n,t,e){return Vr(n,`${t}`,e)}getCacheData(n,t){return kr(n,`${t}`)}getFloorCacheKey(n){return`${n.floor_id}`}async getFloorData(n){let t=this.floors.find(r=>r.floor===n);if(!t)return null;let e=this.getFloorCacheKey(t);try{if(await this.getCacheData(Ve,e)===t.version_id){let i=await this.getCacheData(sn,e);if(i)return this.getDataByJson(i)}return this.getFloorDataByFloorInfo(t)}catch{return this.getFloorDataByFloorInfo(t)}}async getFloorDataByFloorInfo(n){let t=this.getFloorCacheKey(n);console.time("zstd_json");let e=await fetch(n.map_url).then(r=>r.json());return e.floor=n.floor,console.timeEnd("zstd_json"),this.setCacheData(sn,t,e),this.setCacheData(Ve,t,n.version_id),this.getDataByJson(e)}async getRoadNetworkData(){return(await Promise.all(this.floors.map(async t=>{let e=this.getFloorCacheKey(t);try{if(await this.getCacheData(Ve,e)===t.version_id){let o=await this.getCacheData(He,e);if(o)return o}let i=await fetch(t.route_url).then(o=>o.json());return this.setCacheData(He,e,i),i}catch{let r=await fetch(t.route_url).then(i=>i.json());return this.setCacheData(He,e,r),r}}))).filter(t=>t.points)}async getFacilitiesData(){if(this.floors[0]?.entry_infra_url)return fetch(this.floors[0].entry_infra_url).then(n=>n.json())}async getOtherDataByFreeTime(){}async getMulFloorsData(n){return Promise.all(n.map(t=>this.getFloorData(t))).then(t=>t.filter(e=>e))}async getDataByUrl(n){let t=await fetch(n).then(e=>e.json());return this.getDataByJson(t)}getDataByJson(n){let t=new ht(this.bmap.context);t.userData.graphics=[],t.userData.graphicMap=new Map;let e=[0,0];return n.layers.forEach(r=>{switch(r.l_type){case"range":let i=r.elements[0];e=[i.center_x,i.center_y];break;case"graph":Y(r.elements,e);let o=[];r.elements.forEach(p=>{p.group==="ground"?t.createGround(p):o.push(p)});let a=o.reduce((p,m)=>{let{fillColor:b,fillOpacity:E,strokeColor:z,strokeOpacity:S,height:T}=m,O=`${b.toLowerCase()}-${E}-${z.toLowerCase()}-${S}-${T}`;return S===0&&(O=`${b.toLowerCase()}-${E}-${T}`),p[O]?p[O].push(m):p[O]=[m],p},{});Object.values(a).forEach(p=>{let m=new ve(this.bmap.context,p);t.mergeGraphicLayer.add(m)});break;case"ground":Y(r.elements,e);let l=r.elements.map(p=>new L(this.bmap.context,p));t.addGrounds(l);break;case"wall":Y(r.elements,e);let u=r.elements.reduce((p,m)=>{let{fillColor:b,fillOpacity:E,strokeColor:z,strokeOpacity:S,height:T}=m,O=`${b.toLowerCase()}-${E}-${z.toLowerCase()}-${S}-${T}`;return S===0&&(O=`${b.toLowerCase()}-${E}-${T}`),p[O]?p[O].push(m):p[O]=[m],p},{});Object.values(u).forEach(p=>{let m=new me(this.bmap.context,p);t.wallLayer.add(m)});break;case"lane":Y(r.elements,e);let c=r.elements.reduce((p,m)=>{let{fillColor:b,fillOpacity:E,strokeColor:z,strokeOpacity:S}=m,T=`${b.toLowerCase()}-${E}-${z.toLowerCase()}-${S}`;return S===0&&(T=`${b.toLowerCase()}-${E}`),p[T]?p[T].push(m):p[T]=[m],p},{});Object.values(c).forEach(p=>{let m=new ye(this.bmap.context,p);t.laneLayer.add(m)});break;case"texture2d":case"texture3d":if(Y(r.elements,e),r.elements.length){let p=new Yt(this.bmap.context,r.elements);t.textureLayer.add(p)}break;case"glb":Y(r.elements,e),r.elements.forEach(p=>{let m=ct([p.center_x,p.center_y],e),b=new _e(this.bmap.context,{...p,url:p.secondUrl,rotate:p.secondRotate,width:p.secondWidth,center_x:m[0],center_y:m[1]});t.glbModelLayer.add(b)});break;case"store":Y(r.elements,e),r.elements.map(p=>{let m=ct([p.center_x,p.center_y],e),b=t.addGraphic(p);t.userData.graphics.push(b),t.userData.graphicMap.set(p.id,b);try{let E=new $(this.bmap.context,{id:p.id,icon:p.poi_info.icon,text:p.poi_info.showName||p.store_name||p.poi_info.text,position:{x:m[0],y:m[1],z:p.airHeight+p.height},icon_size:[18,18]});t.poiLayer2.pushPoi(E),E&&(E.userData.type="store",E.userData.data=p)}catch(E){console.log("\u521B\u5EFA\u5E97\u94FApoi\u5931\u8D25",E,p)}});break;case"facility":Y(r.elements,e),r.elements.map(p=>{let m=ct([p.center_x,p.center_y],e),b=t.addGraphic(p);if(t.userData.graphics.push(b),t.userData.graphicMap.set(p.id,b),p.poi_info){let E=new $(this.bmap.context,{id:p.id,icon:p.poi_info.icon,text:p.poi_info.showName||p.store_name||p.poi_info.text,position:{x:m[0],y:m[1],z:p.airHeight+p.height},icon_size:[18,18]});t.poiLayer2.pushPoi(E),E.userData.type="facility",E.userData.data=p}else console.log("\u6DFB\u52A0facility\u5931\u8D25\u6CA1\u6709poi_info",p)});break;case"parkingSpace":Y(r.elements,e);let h=[],f=new Map;r.elements.forEach(p=>{let m=t.addGraphic(p);h.push(m),f.set(p.id,m);let b=ct([p.center_x,p.center_y],e);if(p.texts[0]){let E=new $(this.bmap.context,{id:p.id,text:p.texts[0],position:{x:b[0],y:b[1],z:p.airHeight+p.height}});E&&(E.userData.type="parkingSpace",E.userData.data=p),t.poiLayer2.pushPoi(E)}});let d=r.elements.filter(p=>jr[p.parkingType]).map(p=>{let m=ct([p.center_x,p.center_y],e),b=pn(p.geometry.coords,m);return{uuid:p.id,iconUrl:jr[p.parkingType],name:p.texts[0],deltaHeight:p.deltaHeight,airHeight:p.airHeight,height:p.height,geometry:{...p.geometry,coords:b},opacity:p.fillOpacity,visible:!0}});if(d.length){let p=new Yt(this.bmap.context,d);t.textureLayer.add(p)}t.userData.parkingSpaces=h,t.userData.parkingSpacesGraphicMap=f;break;case"text":Y(r.elements,e);let y=new xe(this.bmap.context,r.elements.map(p=>{let m=ct([p.center_x,p.center_y],e);return{...p,center_x:m[0],center_y:m[1]}}));t.textTextureLayer.add(y);break}}),t.userData.center=e,t.userData.height=n.floorHeight*10,t.name=n.floor,t.userData.data=n,t.updateBox(),t}clear(){}dispose(){this.clear(),Hr()}};var $r=class{constructor(n){this.bmap=n}cacheData=new Map;floorDataLengthMap=new Map;buildingGroundMap=new Map;async load(n){let t=Bt(n);if(this.cacheData.has(t))return this.cacheData.get(t);let[,e]=await Promise.all([this.loadBuildGround(n),Gr(n,this.bmap.config)]),r=Bt({floor:n.floor,ts:n.ts});Y(e.map(o=>o.info),this.bmap.buildingCenter,this.floorDataLengthMap.get(r)||0),e.forEach(o=>o.info.transformToBuildingGround=!1),this.cacheData.set(t,e);let i=this.floorDataLengthMap.get(r)||0;return this.floorDataLengthMap.set(r,i+e.length),e}switchFloorByData(n,t){if(!n.length)return;let e=t.userData.legacyToGraphicMap||new Map,r=t.userData.graphicMap||new Map,{ground:i,markGraphic:o,graphic:a}=this.bmap.config;for(let l=0;l<n.length;l++){let u=n[l];u.info.group==="ground"?(u.info.fillColor=i.color,u.info.fillOpacity=i.opacity,u.info.height=i.height,u.info.stroke=i.stroke,u.info.strokeColor=i.strokeColor,u.info.strokeOpacity=i.strokeOpacity):u.info.userData.mark?(u.info.height=o.height,u.info.fillColor=o.color,u.info.fillOpacity=o.opacity,u.info.stroke=o.stroke,u.info.strokeColor=o.strokeColor,u.info.strokeOpacity=o.strokeOpacity):(u.info.fillOpacity=a.fillOpacity,this.bmap.config.initTransToMark&&(u.info.height=o.height,u.info.fillColor=o.color,u.info.stroke=o.stroke,u.info.strokeColor=o.strokeColor,u.info.strokeOpacity=o.strokeOpacity))}for(let l of n){if(l.info.group==="ground")t.createGround(l.info);else{let u=t.addGraphic(l.info);u.userData.data=l,e.set(l.legacy_id,u)}r.set(l.element_uuid,l)}t.userData.legacyToGraphicMap=e,t.userData.graphicMap=r,t.updateBox(),t===this.bmap.context.currentFloor?(this.bmap.triggerHooks("switch_floor_before",{curFloor:t,graphics:t.graphicLayer.children}),this.bmap.initialFloorCamera(),this.bmap.triggerHooks("switch_floor_after",{curFloor:t,graphics:t.graphicLayer.children})):this.bmap.switchFloorByFloor(t)}filterData(n,t){let e=t.userData.graphicMap||new Map;return n.filter(r=>!e.has(r.element_uuid))}async switchFloorByStoreData(n,t){let e=await this.load({...n,resource_type_list:"6"}),r=this.filterData(e,t);this.switchFloorByData(r,t)}async switchFloorByOtherData(n,t){let e=await this.load({...n,resource_type_list:"1,2,3,4"}),r=this.filterData(e,t);this.switchFloorByData(r,t)}async loadBuildGround({brand:n,project:t}){let e=await this.loadBuildingGround({brand:n,project:t});return this.bmap.currentBuildGround=e,this.bmap.changeBuildingCenter(e,{brand:n,project:t}),this.bmap.currentBuildGround}async loadBuildingGround({brand:n,project:t}){let e=Bt({brand:n,project:t});if(this.buildingGroundMap.has(e))return this.buildingGroundMap.get(e);let r=Br({brand:n,project:t},this.bmap.config).then(i=>(this.buildingGroundMap.set(e,i),i));return this.buildingGroundMap.set(e,r),r}async switchFloor(n){let t=new ht(this.bmap.context);t.name=n.floor;try{await Promise.all([this.switchFloorByStoreData(n,t),this.switchFloorByOtherData(n,t)])}catch(e){console.log(e)}return t}dispose(){this.cacheData.clear(),this.floorDataLengthMap.clear(),this.buildingGroundMap.clear()}};})();
|
|
7507
7507
|
//# sourceMappingURL=bmap.min.js.map
|