@aibee/crc-bmap 0.0.117 → 0.0.118

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.
@@ -1,4 +1,30 @@
1
- "use strict";var ei=Object.create;var Wt=Object.defineProperty;var ni=Object.getOwnPropertyDescriptor;var ii=Object.getOwnPropertyNames;var ri=Object.getPrototypeOf,oi=Object.prototype.hasOwnProperty;var it=(o,n)=>()=>(n||o((n={exports:{}}).exports,n),n.exports),si=(o,n)=>{for(var t in n)Wt(o,t,{get:n[t],enumerable:!0})},je=(o,n,t,e)=>{if(n&&typeof n=="object"||typeof n=="function")for(let i of ii(n))!oi.call(o,i)&&i!==t&&Wt(o,i,{get:()=>n[i],enumerable:!(e=ni(n,i))||e.enumerable});return o};var Je=(o,n,t)=>(t=o!=null?ei(ri(o)):{},je(n||!o||!o.__esModule?Wt(t,"default",{value:o,enumerable:!0}):t,o)),ai=o=>je(Wt({},"__esModule",{value:!0}),o);var nn=it((or,en)=>{en.exports=function(n,t){return n[0]=t[0],n[1]=t[1],n}});var sn=it((sr,on)=>{var rn=nn();on.exports=function(o,n){Array.isArray(n)||(n=[]),o.length>0&&n.push(rn([0,0],o[0]));for(var t=0;t<o.length-1;t++){var e=o[t],i=o[t+1],r=e[0],s=e[1],l=i[0],u=i[1],a=[.75*r+.25*l,.75*s+.25*u],h=[.25*r+.75*l,.25*s+.75*u];n.push(a),n.push(h)}return o.length>1&&n.push(rn([0,0],o[o.length-1])),n}});var pn=it((ur,cn)=>{var Be=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(i=>(i.key===n&&Object.assign(i,{priority:e}),i)):(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)}};cn.exports=Be});var dn=it((hr,gn)=>{function fn(o,n){let t=new Map;for(let[e,i]of o)e!==n&&i instanceof Map?t.set(e,fn(i,n)):e!==n&&t.set(e,i);return t}gn.exports=fn});var yn=it((cr,An)=>{function yi(o){let n=Number(o);return!(isNaN(n)||n<=0)}function mn(o){let n=new Map;return Object.keys(o).forEach(e=>{let i=o[e];if(i!==null&&typeof i=="object"&&!Array.isArray(i))return n.set(e,mn(i));if(!yi(i))throw new Error(`Could not add node at key "${e}", make sure it's a valid node`,i);return n.set(e,Number(i))}),n}An.exports=mn});var En=it((pr,vn)=>{function _n(o){if(!(o instanceof Map))throw new Error(`Invalid graph: Expected Map instead found ${typeof o}`);o.forEach((n,t)=>{if(typeof n=="object"&&n instanceof Map){_n(n);return}if(typeof n!="number"||n<=0)throw new Error(`Values must be numbers greater than 0. Found value ${n} at ${t}`)})}vn.exports=_n});var Mn=it((fr,Cn)=>{var _i=pn(),vi=dn(),xn=yn(),In=En(),Re=class{constructor(n){n instanceof Map?(In(n),this.graph=n):n?this.graph=xn(n):this.graph=new Map}addNode(n,t){let e;return t instanceof Map?(In(t),e=t):e=xn(t),this.graph.set(n,e),this}addVertex(n,t){return this.addNode(n,t)}removeNode(n){return this.graph=vi(this.graph,n),this}path(n,t,e={}){if(!this.graph.size)return e.cost?{path:null,cost:0}:null;let i=new Set,r=new _i,s=new Map,l=[],u=0,a=[];if(e.avoid&&(a=[].concat(e.avoid)),a.includes(n))throw new Error(`Starting node (${n}) cannot be avoided`);if(a.includes(t))throw new Error(`Ending node (${t}) cannot be avoided`);for(r.set(n,0);!r.isEmpty();){let h=r.next();if(h.key===t){u=h.priority;let g=h.key;for(;s.has(g);)l.push(g),g=s.get(g);break}i.add(h.key),(this.graph.get(h.key)||new Map).forEach((g,c)=>{if(i.has(c)||a.includes(c))return null;if(!r.has(c))return s.set(c,h.key),r.set(c,h.priority+g);let f=r.get(c).priority,A=h.priority+g;return A<f?(s.set(c,h.key),r.set(c,A)):null})}return l.length?(e.trim?l.shift():l=l.concat([n]),e.reverse||(l=l.reverse()),e.cost?{path:l,cost:u}:l):e.cost?{path:null,cost:0}:null}shortestPath(...n){return this.path(...n)}};Cn.exports=Re});var Pi={};si(Pi,{AibeeLoader:()=>Xe,BMap:()=>Ge,BaseSvg:()=>H,Context:()=>Qt,Equipment:()=>Qe,Events:()=>Me,Floor:()=>q,GlbModel:()=>Ot,Graphic:()=>B,GraphicLayer:()=>Rt,GroundTexture:()=>Nt,HeatmapElement:()=>Tt,HooksName:()=>mt,HoverHelper:()=>Gt,Lane:()=>Ft,Layer:()=>k,MapTypePolar:()=>Vn,Model:()=>Bt,MulFloors:()=>qe,Navigation:()=>He,Overlay:()=>wt,PathDirection:()=>un,Poi:()=>yt,PoiLayer:()=>ht,RoadNetwork:()=>Le,SelectBox:()=>De,Selection:()=>Ut,Shadow:()=>St,SplitLoad:()=>Ve,SvgLine:()=>Lt,SvgPolygon:()=>Pt,Timer:()=>z,UniqueKey:()=>ut,Wall:()=>Dt,addAlphaToHexColor:()=>pi,calc_angle:()=>ve,calc_direction:()=>hn,clearCanvas:()=>_e,clearTextTexture:()=>ye,convertToSnakeCase:()=>Pe,createCanvas:()=>$e,createCircle:()=>dt,createLine:()=>Ct,createRect:()=>at,createSvg:()=>Ee,createSvgElement:()=>It,darkenColor:()=>lt,defaultAibeeLoaderOption:()=>Ti,defaultConfig:()=>zn,defaultOptions:()=>Ln,dispose:()=>O,disposeLoader:()=>Ie,distancePointToSegment:()=>we,generatorKeyByObj:()=>G,getCenter:()=>Yt,getConfig:()=>Fe,getDirectPath:()=>Ai,getLength:()=>R,getLongestSideDir:()=>ui,getPathLength:()=>xt,getTextureByText:()=>li,hasChinese:()=>me,initCamera:()=>pe,initCanvas:()=>Ze,initControl:()=>ge,initDirectionalLight:()=>de,initLight:()=>fe,initRenderer:()=>ce,initScene:()=>he,initShape:()=>X,isContain:()=>Et,isControl:()=>Kt,isMac:()=>bt,loadBuildingGround:()=>Ue,loadGraphics:()=>kt,loadModel:()=>Mt,moveOnRoute:()=>Te,proxyOptions:()=>st,removeWeightPath:()=>ln,setCirclePosition:()=>K,setLineStartEnd:()=>F,setRectPosition:()=>U,simplifyPath:()=>Se,sleepOnePromise:()=>xe,sleepOneRf:()=>hi,smoothPath:()=>be,strToNumber:()=>ci,timeoutPromise:()=>J,toWebWorker:()=>Ei,triggerWorker:()=>Z,vector3ToDevice:()=>y,xhrGet:()=>gi});module.exports=ai(Pi);var se=require("three");var z=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 x=require("three"),Ke=require("three/examples/jsm/controls/MapControls");function he(){let o=new x.Scene;return o.background=new x.Color(16777215),o}function ce(){let o=new x.WebGLRenderer({antialias:!0});return o.autoClear=!0,o.setClearAlpha(1),o.setClearColor(16777215),o.setPixelRatio(window.devicePixelRatio),o.shadowMap.enabled=!0,o.shadowMap.autoUpdate=!0,o.shadowMap.type=x.PCFSoftShadowMap,o}function pe(o,n){let t=new x.OrthographicCamera(-o/2,o/2,n/2,-n/2,-1e3,5e3);return t.up.set(0,0,1),t.position.set(0,0,100),t.lookAt(0,0,0),t}function fe(){let o=new x.Group,n=new x.AmbientLight(16777215,2.6);return o.add(n),o}function ge(o,n){let t=new Ke.MapControls(o,n);return t.enableDamping=!1,t.zoomSpeed=2,t}function X(o,n=[]){let t=new x.Shape(o.map(e=>new x.Vector2(...e)));return n.length&&n.forEach(e=>{var i=new x.Path(e.map(r=>new x.Vector2(...r)));t.holes.push(i)}),t}function de(o=16777215,n=1){let t=new x.DirectionalLight(o,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 O(o,n){if(n&&o.children&&o.children.length&&o.children.forEach(t=>{O(t,n)}),o.isMesh){let t=o;t.geometry&&t.geometry.dispose(),t.material&&(Array.isArray(t.material)?t.material.forEach(e=>{e.dispose()}):t.material.dispose())}o.isLight&&o.dispose?.()}function me(o){return/[\u4E00-\u9FA5]+/g.test(o)}var ot=require("three");var Xt=new Map;function Ze(){let o=document.createElement("canvas");o.width=1024,o.height=64;let n=o.getContext("2d",{willReadFrequently:!0});return n.font="54px sans-serif",n.textBaseline="hanging",n.lineWidth=12,n.fillStyle="rgba(0,0,0,1)",n.strokeStyle="white",{canvas:o,ctx:n}}var Ae,rt;function $e(){if(!Ae){let{canvas:o,ctx:n}=Ze();Ae=o,rt=n}}function li(o){if(Xt.has(o))return Xt.get(o);$e(),rt.clearRect(0,0,1024,64);let n=me(o)?4:8;rt.strokeText(o,2,n),rt.fillText(o,2,n);let t=Math.ceil(rt.measureText(o).width);t=t%2===0?t:t+1,t+=2;let e=rt.getImageData(0,0,t,64),i=new ot.DataTexture(Uint8Array.from(e.data),t,64,ot.RGBAFormat);return i.flipY=!0,i.minFilter=ot.LinearFilter,i.magFilter=ot.LinearFilter,Xt.set(o,i),i}function ye(){Xt.clear()}function _e(){rt=null,Ae=null}var Y=require("three"),gt=require("@turf/turf");function y(o,n,t,e){let i=o.clone().project(n),r=t/2,s=e/2,l=Math.round(i.x*r+r),u=Math.round(-i.y*s+s);return{x:l,y:u}}function Yt(o){let n=(0,gt.featureCollection)(o.map(e=>(0,gt.point)(e)));return(0,gt.center)(n).geometry.coordinates}function Et(o,n,t){return o.x>=n.x&&o.x<=t.x&&o.y>=n.y&&o.y<=t.y}function ui(o){let n=0,t=new Y.Vector3;for(let e=1;e<o.length;e++){let i=new Y.Vector3(o[e-1][0],o[e-1][1],0),r=new Y.Vector3(o[e][0],o[e][1],0),s=r.distanceTo(i);s>n&&(n=s,t=r.clone().sub(i).normalize())}return t}function R(o,n){return Math.sqrt((n[0]-o[0])**2+(n[1]-o[1])**2)}function xt(o){let n=0;for(let t=0;t<o.length-1;t++)n+=R(o[t],o[t+1]);return n}function ve(o,n,t){let e=new Y.Vector2(n[0]-o[0],n[1]-o[1]),i=new Y.Vector2(n[0]-t[0],n[1]-t[1]),s=e.angleTo(i)*180/Math.PI,l=new Y.Vector2(n[0]-o[0],n[1]-o[1]);return new Y.Vector2(t[0]-o[0],t[1]-o[1]).cross(l)>0?s:-s}function st(o,n){return new Proxy(o,{get:(t,e,i)=>Reflect.get(t,e,i),set:(t,e,i,r)=>{let s=Reflect.get(t,e,r),l=Reflect.set(t,e,i,r);return s!==i&&n.dispatchEvent({type:`change-${e}`,value:i}),l}})}function J(o,n){return Promise.race([o,new Promise((t,e)=>{setTimeout(()=>e(new Error("Promise timeout")),n)})])}function It(o){return document.createElementNS("http://www.w3.org/2000/svg",o)}function Ee(o,n){let t=It("svg");return t.setAttribute("width",o),t.setAttribute("height",n),t.style.cssText="position: absolute; left: 0; top: 0; pointer-events: none;",t}function dt(o="2",n){let t=It("circle");return t.setAttribute("r",o),t.setAttribute("fill",n),t}function Ct(o){let n=It("line");return n.setAttribute("stroke",o),n}function at(o,n){let t=It("rect");return t.setAttribute("stroke",o),t.setAttribute("fill",n),t}function K(o,n,t){o.setAttribute("cx",`${n}`),o.setAttribute("cy",`${t}`)}function F(o,n,t){n&&(o.setAttribute("x1",`${n.x}`),o.setAttribute("y1",`${n.y}`)),t&&(o.setAttribute("x2",`${t.x}`),o.setAttribute("y2",`${t.y}`))}function U(o,n,t,e,i){o.setAttribute("x",`${n}`),o.setAttribute("y",`${t}`),o.setAttribute("width",`${e}`),o.setAttribute("height",`${i}`)}function xe(){return Promise.resolve()}function hi(){return new Promise(o=>{requestAnimationFrame(o)})}function ci(o){return parseInt(o.replace("#","0x"),16)}function pi(o,n){let t=parseInt(o.substring(1,3),16),e=parseInt(o.substring(3,5),16),i=parseInt(o.substring(5,7),16),r=Math.round(t*n),s=Math.round(e*n),l=Math.round(i*n);return`#${(1<<24|r<<16|s<<8|l).toString(16).slice(1)}`}function lt(o,n=.85){let t,e,i;if(o.startsWith("#"))t=parseInt(o.substring(1,3),16),e=parseInt(o.substring(3,5),16),i=parseInt(o.substring(5,7),16);else{let s=o.slice(4,-1).split(",");t=parseInt(s[0].trim()),e=parseInt(s[1].trim()),i=parseInt(s[2].trim())}return t=Math.min(Math.floor(t*n),255),e=Math.min(Math.floor(e*n),255),i=Math.min(Math.floor(i*n),255),"#"+((1<<24)+(t<<16)+(e<<8)+i).toString(16).slice(1)}var tn=require("three/examples/jsm/loaders/GLTFLoader");function fi(){return new tn.GLTFLoader}var jt=null,Jt=new Map;function Mt(o){if(Jt.has(o)){let t=Jt.get(o).then(e=>(e.scene=e.scene.clone(),e))}jt||(jt=fi());let n=new Promise((t,e)=>{jt.load(o,i=>{t(i)},void 0,e)});return Jt.set(o,n),n.then(t=>(t.scene=t.scene.clone(),t))}function Ie(){jt=null,Jt.clear()}var bt=navigator.userAgent.toUpperCase().indexOf("MAC")>=0;function Kt(o){return bt?o==="Meta":o==="Control"}var Ce="__once__",Me=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=`${Ce}${n}`,i=this.events.get(e);return i?i.add(t):this.events.set(e,new Set([t]))}off(n,t){let e=this.events.get(n),i=this.events.get(`${Ce}${n}`);!e&&!i||(t===void 0&&(e?.clear(),i?.clear()),e?.has(t)&&e.delete(t),i?.has(t)&&i.delete(t))}offAll(){this.events.clear()}emit(n,...t){let e=this.events.get(n),i=this.events.get(`${Ce}${n}`);!e&&!i||(e?.forEach(r=>{typeof r=="function"&&r(...t)}),i?.forEach(r=>{typeof r=="function"&&r(...t)}),i?.clear())}};var mt=(t=>(t.SWITCH_FLOOR_BEFORE="switch_floor_before",t.SWITCH_FLOOR_AFTER="switch_floor_after",t))(mt||{});function G(o){return Object.keys(o).sort().map(n=>`${n}=${o[n]}`).join("&")}function gi(o,n){return new Promise((t,e)=>{let i=new XMLHttpRequest;i.open("GET",o,!0),Object.keys(n.headers||{}).forEach(r=>{i.setRequestHeader(r,n.headers[r])}),n.responseType&&(i.responseType=n.responseType),i.onload=()=>{if(i.status>=200&&i.status<300)if(n.responseType==="arraybuffer")t(i.response);else try{let r=JSON.parse(i.responseText);t(r)}catch(r){e(r)}else e(i.statusText)},i.onerror=()=>{e(i.statusText)},i.send()})}var ut=class o{keySet=new Set;static createKey(){return Math.random().toString(36).substring(2,15)+Math.random().toString(36).substring(2,15)}genUniqueKey(){let n=o.createKey();for(;this.keySet.has(n);)n=o.createKey();return n}removeKey(n){this.keySet.delete(n)}dispose(){this.keySet.clear()}};var At=require("three"),an=Je(sn(),1);function di(o,n){let t=o.clone().normalize(),e=n.clone().normalize();return Math.acos(t.dot(e))}function mi(o){let n=0;return o.reduce(([t,e],[i,r])=>(n+=Math.sqrt((i-t)**2+(r-e)**2),[i,r])),n/o.length}function be(o,n=.25){if(mi(o)<n)return o;let t=(0,an.default)(o);return be(t,n)}function Se(o,n=!1,t=!0,e=5,i=150,r=3){let s=[],l=!n;if(s.push(o[0]),o.length<2)return s;for(let a=0;a<o.length-2;a+=1){let h=o[a],p=o[a+1],g=o[a+2],c=new At.Vector2(h[0]-p[0],h[1]-p[1]),f=new At.Vector2(g[0]-p[0],g[1]-p[1]),A=di(c,f)/Math.PI*180,m=c.length()+f.length();(!l||A<i&&m>.01||m>e)&&(s.push(o[a+1]),l=!0)}if(s.push(o[o.length-1]),!t)return s;let u=[];u.push(s[0]);for(let a=0;a<s.length-2;a+=1){let h=new At.Vector2(s[a][0],s[a][1]),p=new At.Vector2(s[a+1][0],s[a+1][1]),g=new At.Vector2(s[a+2][0],s[a+2][1]),c=h.distanceTo(p)/2,f=g.distanceTo(p)/2,A=p.clone(),m=p.clone();A.add(h.clone().sub(p).normalize().multiplyScalar(c>r?r/2:c)),m.add(g.clone().sub(p).normalize().multiplyScalar(f>r?r/2:f));let C=[[A.x,A.y],[p.x,p.y],[m.x,m.y]];u.push(...be(C,r/25))}return u.push(s[s.length-1]),ln(u)}function ln(o){if(o.length<=1)return o;let n=[],t;return o.forEach(([e,i])=>{t?e===t[0]&&i===t[1]||(t=[e,i],n.push([e,i])):(t=[e,i],n.push([e,i]))}),n}function we(o,n,t){let e=Math.sqrt((t[0]-n[0])**2+(t[1]-n[1])**2);if(e===0)return{distance:Math.sqrt((o[0]-n[0])**2+(o[1]-n[1])**2),closestPoint:n.slice(0)};let i=Math.max(0,Math.min(1,((o[0]-n[0])*(t[0]-n[0])+(o[1]-n[1])*(t[1]-n[1]))/e**2)),r=[n[0]+i*(t[0]-n[0]),n[1]+i*(t[1]-n[1])];return{distance:Math.sqrt((o[0]-r[0])**2+(o[1]-r[1])**2),closestPoint:r}}function Te(o,n,t){let[e,i]=o,[r,s]=n,l=Math.sqrt(Math.pow(r-e,2)+Math.pow(s-i,2)),u=t/l,a=e+(r-e)*u,h=i+(s-i)*u;return[a,h]}var un=(a=>(a.START="start",a.END="end",a.FRONT="front",a.RIGHT="right",a.LEFT="left",a.RIGHT_FRONT="right_front",a.LEFT_FRONT="left_front",a.RIGHT_BACK="right_back",a.LEFT_BACK="left_back",a))(un||{});function hn(o,n,t){let e=ve(o,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 Ai(o){let n=[{direction:"start",distance:R(o[0],o[1]),points:[o[0],o[1]]}];for(let t=2;t<o.length;t++){let e=hn(o[t-2],o[t-1],o[t]);if(e==="front"){let i=n[n.length-1],r=R(o[t-1],o[t]);i.distance+=r,t!==2&&i.points.push(o[t-1])}else n.push({direction:e,distance:R(o[t-1],o[t]),points:[o[t-1],o[t]]})}return n.push({direction:"end",distance:0,points:[o[o.length-1]]}),n}var V=Je(Mn(),1);var Le=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 V.default;escalatorRoute=new V.default;straightLadderRoute=new V.default;initRoute(n){this.clear(),this.roadInfo=n,n.length&&(n.forEach(t=>{t.points.forEach(e=>{let i=`${t.floor}-${e.id}`;if(this.pointMap.set(i,e),this.nodeMap.set(`${e.floor}-${e.nodeId}`,i),e.type==="straightLadder"){let r=this.straightLadderMap.get(e.name)||[];r.push({...e}),this.straightLadderMap.set(e.name,r)}if(e.type==="staircase"){let r=this.staircaseMap.get(e.name)||[];r.push({...e}),this.staircaseMap.set(e.name,r)}if(e.type==="escalator"){let r=this.escalatorMap.get(e.name)||{};e.escalatorDirection==="exit"?r.end={floor:e.floor,id:e.id}:r.start={floor:e.floor,id:e.id},this.escalatorMap.set(e.name,r)}if(e.type==="facility"){let r=this.facilityMap.get(e.targetId)||[];r.push({...e}),this.facilityMap.set(e.targetId,r)}}),t.lines.filter(e=>e.direction!=="no").forEach(e=>{let i=`${t.floor}-${e.from}`,r=`${t.floor}-${e.to}`,s=this.pointMap.get(i)?.cds,l=this.pointMap.get(r)?.cds;if(s?.length&&l?.length){let u=R(s,l);this.addLineItem(i,r,u),e.direction==="double"&&this.addLineItem(r,i,u)}})}),this.initBaseRoute(),this.initEscalatorRoute(),this.initStraightLadderRoute())}addLineItem(n,t,e,i=this.lineMap){let r=i.get(n)||new Map;r.set(t,e),i.set(n,r)}addFacilityToLineMap(n,t,e,i){[...this.straightLadderMap,...this.staircaseMap].forEach(([r,s])=>{if(!(s.length<2))for(let l=0;l<s.length;l++){let u=`${s[l].floor}-${s[l].id}`;for(let a=0;a<s.length;a++)if(l!==a){let h=`${s[a].floor}-${s[a].id}`,p=this.pointMap.get(u)?.cds,g=this.pointMap.get(h)?.cds;if(p?.length&&g?.length)if(s[l].type==="straightLadder"){let c=t;this.addLineItem(u,h,c,i)}else{let c=e;this.addLineItem(u,h,c,i)}}}}),this.escalatorMap.forEach((r,s)=>{if(r.start&&r.end){let l=`${r.start.floor}-${r.start.id}`,u=`${r.end.floor}-${r.end.id}`,a=this.pointMap.get(l)?.cds,h=this.pointMap.get(u)?.cds;if(a?.length&&h?.length){let p=n;this.addLineItem(l,u,p,i)}}})}initBaseRoute(){let n=new Map([...this.lineMap]);this.addFacilityToLineMap(1,this.lift_priority,3e4,n),this.baseRoute=new V.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 V.default(n)}initStraightLadderRoute(){let n=new Map([...this.lineMap]),t=1e4;this.addFacilityToLineMap(3*t,1*t,3e4*t,n),this.straightLadderRoute=new V.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}-${n.nodeId}`);if(t){let[e,i]=t.split("-");return{floor:e,id:i}}}if(n.coord?.length){let t=this.roadInfo.find(i=>i.floor===n.floor);if(!t)return null;let e=t.points.reduce((i,r)=>{let s=R(n.coord,r.cds);return s<i.min&&(i.min=s,i.point=r),i},{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 i=this.transformStart(n);if(!i)return"no-start";let r=this.transformEnd(t);if(!r)return"no-end";let s=this.getBasePath.bind(this);switch(e){case"escalator":s=this.getEscalatorPath.bind(this);case"straightLadder":s=this.getStraightLadderPath.bind(this);default:s=this.getBasePath.bind(this)}if(r.id)return s(i,r);if(r.facility){let l=this.facilityMap.get(r.facility).filter(a=>r.floor?a.floor===r.floor:!0);if(!l.length)return null;let u=l.map(a=>s(i,{floor:a.floor,id:a.id})).filter(a=>!!a);return u.reduce((a,h)=>{let p=h.reduce((g,c)=>g+xt(c.points),0);return p<a.distance&&(a.distance=p,a.path=h),a},{distance:1/0,path:u[0]}).path}}getRoutePath(n,t,e){let i=`${n.floor}-${n.id}`,r=`${t.floor}-${t.id}`,s=e.path(i,r);if(!s)return null;let l=[];return s.map(u=>{let a=this.pointMap.get(u);if(a){let{floor:h}=a;if(l[l.length-1]?.floor===h){let p=l[l.length-1];p.points.push(a.cds),p.endType=a.type,p.destId=a.nodeId}else l.push({floor:h,points:[a.cds],endType:a.type,destId:a.nodeId})}}),l}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 V.default,this.escalatorRoute=new V.default,this.straightLadderRoute=new V.default}};function Pe(o){return o.replace(/[A-Z]/g,n=>"_"+n.toLowerCase()).replace(/^_/,"")}var bn=new ut;function Z(o,n,t){return new Promise((e,i)=>{let r=bn.genUniqueKey(),s=({data:l})=>{l.type===`${n}_result`&&l.key===r&&(bn.removeKey(r),self.removeEventListener("message",s),l.error?i(l.error):e(l.data))};o.addEventListener("message",s),o.postMessage({type:n,key:r,data:t})})}function Ei(o){let n={};for(let e in o)e.startsWith("on")&&(n[Pe(e.slice(2))]=o[e]);let t=async({data:e})=>{if(n[e.type])try{let i=await n[e.type](e.data);self.postMessage({type:`${e.type}_result`,key:e.key,data:i})}catch(i){self.postMessage({type:`${e.type}_result`,key:e.key,error:i})}else self.postMessage({type:`${e.type}_result`,key:e.key,error:"no_event"})};return self.addEventListener("message",t),()=>{self.removeEventListener("message",t)}}var v=require("three"),ft=require("@tweenjs/tween.js");var On=require("three");var _=require("three");var xi={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},B=class extends _.Object3D{constructor(t,e){super();this.context=t;if(this.options=st({...xi,...e},this),this.options.geometry.type==="point"){let[i,r]=this.options.geometry.coords;return this.position.set(i,r,this.options.height+this.options.airHeight),this}this.init(),this.visible=this.options.visible,this.addEventListener("change-fillColor",({value:i})=>{this.initMaterial(),this.initMesh()}),this.addEventListener("change-fillOpacity",({value:i})=>{this.initMaterial(),this.initMesh()}),this.addEventListener("change-height",({value:i})=>{this.dispose(),this.init()}),this.addEventListener("change-strokeColor",({value:i})=>{this.options.stroke&&(this.initLineMaterial(),this.createBorder())}),this.addEventListener("change-strokeOpacity",({value:i})=>{this.options.stroke&&(this.initLineMaterial(),this.createBorder())}),this.addEventListener("change-airHeight",({value:i})=>{this.position.z=i}),this.addEventListener("change-visible",({value:i})=>{this.visible=i}),this.addEventListener("change-stroke",({value:i})=>{if(i){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 _.Vector3,e=new _.Box3;return e.setFromObject(this),e.getCenter(t),t}getSize(){if(this.options.geometry.type==="point")return new _.Vector3(0,0,0);let t=new _.Box3,e=new _.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.initLineMaterial(),this.initLineGeometry(),this.createBorder())}initGeometry(){let t=X(this.options.geometry.coords[0],this.options.geometry.coords.slice(1));return new _.ExtrudeGeometry(t,{steps:1,bevelEnabled:!1,depth:this.options.height,curveSegments:4})}initSingleMaterial(){let t=this.context.materialFactory.createMeshBasicMaterial({color:this.options.fillColor,opacity:this.options.fillOpacity});if(this.options.height<=.1)return this.material=t,t;let e=this.context.materialFactory.createMeshBasicMaterial({color:lt(this.options.fillColor),opacity:this.options.fillOpacity});return this.material=[t,e],[t,e]}getMaxAndMin(t,e){let i=new _.Box3().setFromObject(this),r=t.clone().add(e.clone().multiplyScalar(1e3)),s=new _.Ray(r,e.clone().multiplyScalar(-1)),l=new _.Vector3;s.intersectBox(i,l);let u=t.clone().add(e.clone().multiplyScalar(-1e3)),a=new _.Ray(u,e.clone()),h=new _.Vector3;return a.intersectBox(i,h),{max:h,min:l}}initGradualMaterial(){let{max:t,min:e}=new _.Box3().setFromObject(this),i=t.clone().sub(e),r=Math.max(i.x,i.y,i.z)/2,s=this.getPosition(),l=new _.Vector3(-1,.2,0).normalize(),{max:u,min:a}=this.getMaxAndMin(s,l),h=this.context.materialFactory.createShaderMaterial({gradualColor:this.options.gradualColor,center:this.getPosition(),maxValue:r,opacity:this.options.fillOpacity,direction:new _.Vector3(-1,.2,0),max:u,min:a});if(this.options.height<=.1)return this.material=h,h;let p=this.getCenter(),g=new _.Vector3(-1,.2,1).normalize(),{max:c,min:f}=this.getMaxAndMin(p,g),A=this.context.materialFactory.createShaderMaterial({gradualColor:[lt(this.options.gradualColor[0],this.options.colorFactor),lt(this.options.gradualColor[1],this.options.colorFactor)],center:this.getCenter(),maxValue:r,opacity:this.options.fillOpacity,direction:new _.Vector3(-1,.2,1),max:c,min:f});return this.material=[h,A],[h,A]}initMaterial(){return this.options.renderType==="gradual"?this.initGradualMaterial():this.initSingleMaterial()}initLineMaterial(){let t=this.context.materialFactory.createLineMaterial({color:this.options.strokeColor,opacity:this.options.strokeOpacity});return this.lineMaterial=t,t}initMesh(){this.mesh&&this.remove(this.mesh),this.mesh=new _.Mesh(this.geometry,this.material),this.add(this.mesh)}getBorderPoints(){let t=[],e=this.options.height+this.options.deltaHeight,{coords:i}=this.options.geometry;for(let r=0;r<i.length;r++){let s=i[r];for(let l=0;l<s.length;l++){let u=s[l],a=l+1===s.length?s[0]:s[l+1];t.push(new _.Vector3(u[0],u[1],e)),t.push(new _.Vector3(a[0],a[1],e))}}return t}initLineGeometry(){this.lineGeometry&&this.lineGeometry.dispose();let t=this.getBorderPoints(),e=new _.BufferGeometry().setFromPoints(t);this.lineGeometry=e}createBorder(){this.line&&this.remove(this.line);let t=new _.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:i,distance:r}=e[0];return{position:i,distance:r}}return!1}dispose(){this.geometry.dispose(),this.line?.geometry.dispose(),this.clear()}};var Q=require("three");var St=class extends Q.Object3D{directionalLight;plane;basicOpacity=.07;constructor(){super(),this.directionalLight=this.initLight(),this.initPlane()}initLight(){let n=de(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 Q.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 Q.PlaneGeometry(n,t),i=new Q.ShadowMaterial({transparent:!0,opacity:0,side:Q.DoubleSide}),r=new Q.Mesh(e,i);return r.receiveShadow=!0,r.position.z=-10,this.add(r),this.plane=r,r}setTarget(n){this.directionalLight.target=n}transformOpacity(n){return n*this.basicOpacity}setOpacity(n){this.plane.material.opacity=this.transformOpacity(n)}dispose(){O(this,!0)}};var Zt=require("three");var E=require("three");var Sn=require("lodash");var Ii={autoUpdate:!0,appendToBody:!1,autoChangePlacement:!1},wt=class extends E.EventDispatcher{constructor(t,e={}){super();this.context=t;this.options={...Ii,...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 E.Vector3;clientPos={x:0,y:0};visible=!0;options;placement="top";observer=null;initObserver(){let t=new MutationObserver((0,Sn.debounce)(()=>{this.div&&this.usePlacement()},100));t.observe(this.div,{childList:!0,subtree:!0,attributes:!0}),this.observer=t}getPlacementPosition(){if(this.element instanceof B&&this.element.options.geometry.type==="polygon"){let{max:r,min:s}=new E.Box3().setFromObject(this.element),l=(r.x+s.x)/2,u=(r.y+s.y)/2;return{left:new E.Vector3(s.x,u,r.z),leftTop:new E.Vector3(s.x,r.y,r.z),top:new E.Vector3(l,r.y,r.z),rightTop:new E.Vector3(r.x,r.y,r.z),right:new E.Vector3(r.x,u,r.z),rightBottom:new E.Vector3(r.x,s.y,r.z),bottom:new E.Vector3(l,s.y,r.z),leftBottom:new E.Vector3(s.x,s.y,r.z),center:new E.Vector3(l,u,r.z)}}let{x:t,y:e,z:i}=this.element?.getPosition?.()||this.position;return{left:new E.Vector3(t,e,i),leftTop:new E.Vector3(t,e,i),top:new E.Vector3(t,e,i),rightTop:new E.Vector3(t,e,i),right:new E.Vector3(t,e,i),rightBottom:new E.Vector3(t,e,i),bottom:new E.Vector3(t,e,i),leftBottom:new E.Vector3(t,e,i),center:new E.Vector3(t,e,i)}}getPlacementScreenPosition(){let{width:t,height:e}=this.context.clientSize,i=this.getPlacementPosition();return Object.keys(i).reduce((r,s)=>{let{x:l,y:u}=y(i[s],this.context.camera,t,e);return r[s]={x:l,y:u},r},{})}checkOverflow(t,e){let{width:i,height:r}=this.context.clientSize;return e.x>0&&t.x<i&&e.y<r&&t.y>0}getPlacement(){let{clientWidth:t,clientHeight:e}=this.div,i=this.getPlacementScreenPosition(),r=t/2,s=e/2,l=[{type:"center",getBox(u,a){return{max:{x:r+u,y:a-e},min:{x:u-r,y:a}}}},{type:"left",getBox(u,a){return{max:{x:u,y:a-s},min:{x:u-t,y:a+s}}}},{type:"leftTop",getBox(u,a){return{max:{x:u,y:a-e},min:{x:u-t,y:a}}}},{type:"top",getBox(u,a){return{max:{x:u+r,y:a-e},min:{x:u-r,y:a}}}},{type:"rightTop",getBox(u,a){return{max:{x:u+t,y:a-e},min:{x:u,y:a}}}},{type:"right",getBox(u,a){return{max:{x:u+t,y:a-s},min:{x:u,y:a+s}}}},{type:"rightBottom",getBox(u,a){return{max:{x:u+t,y:a},min:{x:u,y:a+e}}}},{type:"bottom",getBox(u,a){return{max:{x:u+r,y:a},min:{x:u-r,y:a+e}}}},{type:"leftBottom",getBox(u,a){return{max:{x:u,y:a},min:{x:u-t,y:a+s}}}}];for(let u=0;u<l.length;u++){let a=l[u],h=i[a.type],{max:p,min:g}=a.getBox(h.x,h.y);if(this.checkOverflow(p,g))return{type:a.type,position:h}}return{type:"center",position:i.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 E.Box3().setFromObject(this.element).getCenter(new E.Vector3):this.position}get withinDisplayRange(){let{x:t,y:e}=this.clientPos,{width:i,height:r}=this.context.clientSize;return t>=0&&t<=i&&e>=0&&e<=r}_updatePosition(t,e){this.clientPos={x:t,y:e};let{width:i,height:r,x:s,y:l}=this.context.clientSize;this.options.appendToBody&&(this.div.style.left=`${s}px`,this.div.style.top=`${l+r}px`),this.options.autoUpdate?this.div.style.transform=`translate3d(${t}px, ${-r+e}px, 0)`:this.dispatchEvent({type:"update-position",x:t,y:e,width:i,height:r})}updatePosition(t=!1){let e=this.getPosition(),{width:i,height:r}=this.context.clientSize,{x:s,y:l}=y(e,this.context.camera,i,r);this.clientPos.x===s&&this.clientPos.y===l&&!t||this._updatePosition(s,l)}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 Ci={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},yt=class extends Zt.EventDispatcher{constructor(t,e){super();this.context=t;this.options=st({...Ci,...e},this),this.position.set(e.position?.x||0,e.position?.y||0,e.position?.z||0),this.overlay=new wt(this.context,{autoUpdate:!1}),this.overlay.addEventListener("update-position",({x:i,y:r,height:s})=>{this.overlay.div.style.transform=`translate3d(calc(${i}px - 50%), calc(${-s+r}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:i})=>{i?this.img?this.img.setAttribute("src",i):(this.addIcon(),this._changePosition()):(this.img&&this.div.removeChild(this.img),this.img=void 0,this._changePosition(),this.resetSize())}),this.addEventListener("change-texts",({value:i})=>{let r=this.textDiv;if(r){let s=this.initText();this.div.replaceChild(s,r)}else this.addText();this.resetSize()}),this.addEventListener("change-opacity",({value:i})=>{this.overlay.setOpacity(i)}),this.addEventListener("change-icon_size",({value:i})=>{this.img&&(this.img.style.width=`${i?.[0]||32}px`,this.img.style.height=`${i?.[1]||32}px`,this.resetSize())}),this.addEventListener("change-icon_opacity",({value:i})=>{this.img&&(this.img.style.opacity=`${i}`)}),this.addEventListener("change-icon_border",({value:i})=>{this.img&&(this.img.style.border=`${i.width}px solid ${i.color}`)}),this.addEventListener("change-background",({value:i})=>{this.div.style.background=i})}div;textDiv;img;overlay;options;visible=!0;size={width:0,height:0};position=new Zt.Vector3;userData={};showTextStatus=!0;disposed=!1;get withinDisplayRange(){return this.overlay.withinDisplayRange}async resetSize(){if(await xe(),!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 i=document.createElement("div");if(i.style.whiteSpace="nowrap",e.styles)for(let[r,s]of Object.entries(e.styles))i.style[r]=s;i.textContent=e.text,t.appendChild(i)}),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:i}=this.size,r=e*t,s=i*t,{x:l,y:u}=this.overlay.clientPos;return{left:l-r/2,right:l+r/2,top:this.options.icon?u-s:u-s/2,bottom:this.options.icon?u:u+s/2}}getOriginBox(){return this.getBox(1)}isContain(t,e){if(!this.overlay.visible||!this.visible)return!1;let i=this.getOriginBox();return t>=i.left&&t<=i.right&&e>=i.top&&e<=i.bottom}dispose(){this.unRegistryEvent(),this.div=null,this.textDiv=null,this.img=void 0,this.overlay.dispose(),this.disposed=!0}};var L=require("three");var T=require("three"),wn=require("@mars3d/heatmap.js"),$=require("@turf/turf"),Tt=class extends T.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:i,leftTop:r,center:s}=this.getBox(t);this.heatmap=(0,wn.create)({width:e,height:i,container:this.div,...this.context.config.heatMap}),this.heatmap.setData(this.transformData(t,r)),this.initPlane(e,i),this.position.set(s[0],s[1],this.position.z)}initPlane(t,e){this.plane&&this.remove(this.plane);let i=new T.PlaneGeometry(t,e),r=new T.Texture(this.div.firstChild);r.needsUpdate=!0;let s=new T.MeshBasicMaterial({transparent:!0,side:T.DoubleSide,map:r});s.needsUpdate=!0,this.plane=new T.Mesh(i,s),this.add(this.plane)}getTransMatrix({x:t,y:e}){return new T.Matrix3().makeScale(1,-1).multiply(new T.Matrix3().makeTranslation(0-t,0-e))}transformData(t,e){let i=this.getTransMatrix(e);return{data:t.data.map(s=>{let l=new T.Vector2(s.x,s.y).applyMatrix3(i);return{x:l.x,y:l.y,value:s.value}}),max:t.max,min:t.min}}getBox(t){let e=(0,$.featureCollection)(t.data.map(a=>(0,$.point)([a.x,a.y]))),i=(0,$.bbox)(e),r=i[2]-i[0],s=i[3]-i[1],l={x:i[0],y:i[3]},u=(0,$.center)(e);return{width:r,height:s,leftTop:l,center:u.geometry.coordinates}}dispose(){this.div=null,this.heatmap=void 0}};var $t=require("three");var Bt=class extends $t.Object3D{constructor(t,e){super();this.context=t;this.options=e;this.position.copy(e.position||new $t.Vector3(0,0,0)),this.loadModel()}model=null;async loadModel(){let t=await Mt(this.options.modelUrl);t.scene.rotation.set(Math.PI/2,Math.PI/2,0),this.add(t.scene),this.model=t}dispose(){O(this),this.model=null}};var te=require("three");var Tn=require("three");var k=class extends Tn.Object3D{constructor(t){super();this.context=t}dispose(){O(this),this.children.forEach(t=>t.dispose?.()),this.clear()}};var Rt=class extends k{graphicMap=new Map;constructor(n){super(n)}getCenter(){return new te.Box3().setFromObject(this).getCenter(new te.Vector3)}createGraphic(n){let t=new B(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((i,r)=>{if(r instanceof B){let s=r.raycast(n);if(s){let{distance:l}=s;if(l<i.distance)return{distance:s.distance,position:s.position,graphic:r}}return i}else return i},t);return e===t?{graphics:[],position:null}:{graphics:[e.graphic],position:e.position}}};var Bn=require("lodash");var ht=class extends k{pois=[];debounceCollisionDetection;timer=new z;constructor(n){super(n),this.registryEvent(),this.debounceCollisionDetection=(0,Bn.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 yt(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(i=>i instanceof yt&&i.isContain(n,t))}onUpdate=()=>{this.timer.requestAnimationFrame(()=>{this.collisionDetection()})};collisionDetection(){let n=[];this.pois.filter(e=>e.visible&&e.withinDisplayRange).forEach((e,i)=>{let{left:r,right:s,top:l,bottom:u}=e.getBox();if(i===0||!e.options.collision_enable){n.push({left:r,right:s,top:l,bottom:u}),e.parentSetVisible(!0);return}let a=n.some(h=>h.left<s&&h.right>r&&h.top<u&&h.bottom>l);e.parentSetVisible(!a),a||n.push({left:r,right:s,top:l,bottom:u})})}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 q=class extends L.Object3D{constructor(t){super();this.context=t;this.graphicLayer=new Rt(this.context),this.poiLayer=new ht(this.context),this.wallLayer=new k(this.context),this.textureLayer=new k(this.context),this.glbModelLayer=new k(this.context),this.laneLayer=new k(this.context),this.groundUpper.add(this.graphicLayer),this.groundUpper.add(this.poiLayer),this.groundUpper.add(this.wallLayer),this.groundUpper.add(this.textureLayer),this.groundUpper.add(this.glbModelLayer),this.groundUpper.add(this.laneLayer),this.add(this.groundUpper),this.add(this.models)}graphicLayer;poiLayer;wallLayer;textureLayer;glbModelLayer;laneLayer;grounds=new Set;shadow=new St;heatmap;groundUpper=new L.Object3D;models=new L.Object3D;modelMap=new Map;groundMaxHeight=0;name="";key="";getPosition(){return new L.Box3().setFromObject(this.groundUpper).getCenter(new L.Vector3)}createGround(t){let e=new B(this.context,t);this.addGrounds([e])}addGrounds(t){t.forEach(e=>{this.grounds.has(e)||(e.mesh.castShadow=!0,this.grounds.add(e),this.groundUpper.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.graphicLayer.position.z=this.groundMaxHeight,this.models.position.z=this.groundMaxHeight}get hasElement(){return!!(this.grounds.size||this.graphicLayer.children.length)}getCenter(){return new L.Box3().setFromObject(this.groundUpper).getCenter(new L.Vector3)}addModel(t){let e=new Bt(this.context,t);return this.models.add(e),this.modelMap.set(t.id,e),e}addShadow(){let t=new L.Box3().setFromObject(this.groundUpper),e=t.getCenter(new L.Vector3),i=t.getSize(new L.Vector3);this.shadow.setPosition(e),this.shadow.changeLightCamera(i)}addGraphic(t){return this.graphicLayer.createGraphic(t)}addPoi(t){return this.poiLayer.createPoi(t)}addHeatmap(t){this.heatmap||(this.heatmap=new Tt(this.context),this.add(this.heatmap)),this.heatmap.loadData(t);let e=new L.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}dispose(){this.shadow.dispose(),this.graphicLayer.dispose(),this.poiLayer.dispose(),this.wallLayer.dispose(),this.textureLayer.dispose(),this.glbModelLayer.dispose(),this.laneLayer.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 ee=require("three");var H=class extends ee.EventDispatcher{constructor(t){super();this.context=t;this.svg=Ee(`${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:i}=this.context,{offsetX:r,offsetY:s}=t,{clientWidth:l,clientHeight:u}=i.domElement,a=r/l*2-1,h=1-s/u*2;return new ee.Vector3(a,h,0).unproject(e)}getSvgCoordinate(t){let{camera:e,container:i}=this.context;return y(t,e,i.clientWidth,i.clientHeight)}dispose(){this._unRegistryEvent(),this.context.container.removeChild(this.svg),this.svg=null}};var Lt=class extends H{constructor(t){super(t);this.context=t;let{config:{svg:{circle:e,line:i}}}=t;this.circles=[dt(e.radius,e.fill),dt(e.radius,e.fill)],this.line=Ct(i.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]);K(this.circles[0],t.x,t.y),F(this.line,t)}if(this.points[1]){let t=this.getSvgCoordinate(this.points[1]);K(this.circles[1],t.x,t.y),F(this.line,void 0,t)}};onPointermove=t=>{this.points.length===1&&(this.line.style.display="block",F(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:i,offsetY:r}=t,s=this.circles[this.points.length];K(s,i,r),this.points.length||F(this.line,{x:i,y:r},{x:i,y:r}),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:i,y:r}]=this.points;return Math.sqrt((i-t)**2+(r-e)**2)}dispose(){super.dispose(),this.unRegistryEvent(),this.line=null,this.circles=[]}};var Pt=class extends H{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]&&K(this.circles[t],e.x,e.y),t!==0&&F(this.lines[t-1],void 0,e),this.lines[t]&&F(this.lines[t],e)})};onPointermove=n=>{!this.lastLine||this.isClose||(this.lastLine.style.display="block",F(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:i}=n;this.checkAdsorb(e,i)?(this.isClose=!0,this.addPoint(this.points[0])):this.addPoint(t);let{circle:{fill:r,radius:s},line:{stroke:l}}=this.context.config.svg;if(!this.isClose){let u=dt(s,r);K(u,e,i),this.addCircle(u)}if(this.lines.length&&F(this.lastLine,void 0,{x:e,y:i}),!this.isClose){let u=Ct(l);F(u,{x:e,y:i},{x:e,y:i}),this.addLine(u)}}};checkAdsorb(n,t){if(this.points.length<3)return!1;let e=this.circles[0],i=+e.getAttribute("cx"),r=+e.getAttribute("cy");return Math.sqrt((n-i)**2+(t-r)**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(i=>[i.x,i.y]),t=0,e=n.length;for(let i=0;i<e;i++){let r=(i+1)%e;t+=n[i][0]*n[r][1]-n[r][0]*n[i][1]}return Math.abs(t/2)}dispose(){super.dispose(),this.unRegistryEvent(),this.lines=[],this.circles=[]}};var Rn=require("three");var De=class extends H{constructor(t){super(t);this.context=t;let{config:{svg:{line:e}}}=t;this.rect=at(e.stroke,"transparent"),this.svg.appendChild(this.rect);for(let i=0;i<4;i++)this.cornerRect[i]=at(e.stroke,"#ffffff"),this.centerRect[i]=at(e.stroke,"#ffffff"),this.svg.appendChild(this.cornerRect[i]),this.svg.appendChild(this.centerRect[i]);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 Rn.Box3().setFromObject(this.graphic),{camera:e,container:{clientWidth:i,clientHeight:r}}=this.context,{min:s,max:l}=t,u=y(s,e,i,r),a=y(l,e,i,r);U(this.rect,u.x,a.y,Math.abs(a.x-u.x),Math.abs(a.y-u.y));let{x:h,y:p}=u,{x:g,y:c}=a,f=5,A=[{x:h-f,y:c-f},{x:g-f,y:c-f},{x:h-f,y:p-f},{x:g-f,y:p-f}];for(let M=0;M<A.length;M++)U(this.cornerRect[M],A[M].x,A[M].y,f*2,f*2);let m=4,C=(h+g)/2,w=(p+c)/2,I=[{x:C-m,y:c-m},{x:h-m,y:w-m},{x:g-m,y:w-m},{x:C-m,y:p-m}];for(let M=0;M<I.length;M++)U(this.centerRect[M],I[M].x,I[M].y,m*2,m*2)}else{U(this.rect,0,0,0,0);for(let t=0;t<this.cornerRect.length;t++)U(this.cornerRect[t],0,0,0,0),U(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=require("three");var Ne=require("three/examples/jsm/utils/BufferGeometryUtils"),Dt=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 i=X(e.geometry.coords[0],e.geometry.coords.slice(1));return new P.ExtrudeGeometry(i,{steps:1,bevelEnabled:!1,depth:e.height,curveSegments:4})});this.geometry=(0,Ne.mergeGeometries)(t)}initMaterial(){let{fillColor:t,fillOpacity:e,height:i}=this.options[0],r=this.context.materialFactory.createMeshBasicMaterial({color:t,opacity:e}),s=this.context.materialFactory.createMeshBasicMaterial({color:lt(t),opacity:e});return this.material=[r,s],[r,s]}initLineMaterial(){let{strokeColor:t,strokeOpacity:e}=this.options[0],i=this.context.materialFactory.createLineMaterial({color:t,opacity:e});return this.lineMaterial=i,i}getBorderPoints(t){let{height:e,deltaHeight:i,geometry:r}=t,s=[],l=e+(i||0),{coords:u}=r;for(let a=0;a<u.length;a++){let h=u[a];for(let p=0;p<h.length;p++){let g=h[p],c=p+1===h.length?h[0]:h[p+1];s.push(new P.Vector3(g[0],g[1],l)),s.push(new P.Vector3(c[0],c[1],l))}}return s}initLineGeometry(){let t=this.options.map(e=>{let i=this.getBorderPoints(e);return new P.BufferGeometry().setFromPoints(i)});this.lineGeometry=(0,Ne.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.initLineMaterial(),this.initLineGeometry(),this.createBorder()}dispose(){this.geometry?.dispose(),this.lineGeometry?.dispose(),this.clear()}};var _t=require("three"),Ln={uuid:"",iconUrl:"",name:"",secondRotate:0,airHeight:0,deltaHeight:0,height:0,geometry:{cds:[],type:"polygon",coords:[],curveCpt:[],curveIndex:[]},opacity:1,visible:!0},Nt=class extends _t.Object3D{constructor(t,e){super();this.context=t;this.options=st({...Ln,...e},this),this.init()}options;mesh;async init(){let{deltaHeight:t,airHeight:e,geometry:i,iconUrl:r,opacity:s}=this.options,l=X(i.coords[0],i.coords.slice(1)),u=new _t.ExtrudeGeometry(l,{steps:1,bevelEnabled:!1,depth:0,curveSegments:4}),a=await this.context.materialFactory.createGroundTextureMaterial({url:r,opacity:s}),h=new _t.Mesh(u,a);this.mesh=h,this.mesh.position.z=e+t,this.add(h)}dispose(){this.mesh?.geometry.dispose(),this.clear()}};var ct=require("three");var Mi={url:"",geometry:{type:"polygon",cds:[],coords:[],curveCpt:[],curveIndex:[]},id:"",width:0,rotate:1,airHeight:1,deltaHeight:0},Ot=class extends ct.Object3D{constructor(t,e){super();this.context=t;this.options=Object.assign({},Mi,e),this.loadModel()}model=null;options;async loadModel(){let t=await Mt(this.options.url);t.scene.rotation.set(Math.PI/2,Math.PI/2,0);let e=new ct.Box3().setFromObject(t.scene),i=e.getSize(new ct.Vector3),r=Math.max(i.x,i.y),s=this.options.width/r;this.scale.set(s,s,s),this.add(t.scene),this.position.copy(e.getCenter(new ct.Vector3)),this.position.z+=this.options.airHeight+this.options.deltaHeight,this.model=t}dispose(){O(this),this.model=null}};var D=require("three");var Oe=require("three/examples/jsm/utils/BufferGeometryUtils"),Pn=require("three/examples/jsm/lines/line2"),Dn=require("three/examples/jsm/lines/lineGeometry"),Ft=class extends D.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 i=X(e.geometry.coords[0],e.geometry.coords.slice(1));return new D.ExtrudeGeometry(i,{steps:1,bevelEnabled:!1,depth:0,curveSegments:4})});this.geometry=(0,Oe.mergeGeometries)(t)}initMaterial(){let{fillColor:t,fillOpacity:e}=this.options[0],i=this.context.materialFactory.createMeshBasicMaterial({color:t,opacity:e});return this.material=i,i}initLineMaterial(){let{strokeColor:t,strokeOpacity:e}=this.options[0],i=this.context.materialFactory.createLineMaterial({color:t,opacity:e});return this.lineMaterial=i,i}getBorderPoints(t){let{deltaHeight:e,geometry:i}=t,r=[],s=e||0,{coords:l}=i;for(let u=0;u<l.length;u++){let a=l[u];for(let h=0;h<a.length;h++){let p=a[h],g=h+1===a.length?a[0]:a[h+1];r.push(new D.Vector3(p[0],p[1],s)),r.push(new D.Vector3(g[0],g[1],s))}}return r}initDoubleLine(){let t=this.options.filter(i=>i.double&&i.geometry.otherCoords?.[1]?.length);if(!t.length)return;let e=t.reduce((i,r)=>{let s=`${r.secondColor}-${r.dashed}`;return i[s]&&i[s].push(r),i[s]||(i[s]=[r]),i},{});Object.values(e).map(i=>{let r=this.context.materialFactory.createLine2MaterialMap({color:i[0].secondColor,width:.2,dashed:i[0].dashed});i.map(s=>{let l=new Dn.LineGeometry,u=s.geometry.otherCoords[1].map(h=>[...h,0]).flat(2);l.setPositions(u);let a=new Pn.Line2(l,r);a.computeLineDistances(),a.position.z+=1e-4,this.add(a)})})}initLineGeometry(){let t=this.options.map(e=>{let i=this.getBorderPoints(e);return new D.BufferGeometry().setFromPoints(i)});this.lineGeometry=(0,Oe.mergeGeometries)(t)}createBorder(){let t=new D.LineSegments(this.lineGeometry,this.lineMaterial);return this.LineMesh=t,this.add(t),t}init(){this.initGeometry(),this.initMaterial();let t=new D.Mesh(this.geometry,this.material);this.add(t),this.initLineMaterial(),this.initLineGeometry(),this.createBorder(),this.initDoubleLine()}dispose(){this.geometry?.dispose(),this.lineGeometry?.dispose(),this.clear()}};var Nn=require("three"),ne=class extends H{startPoint;endPoint;rect;frustum=new Nn.Frustum;constructor(n){super(n);let{config:{selectBox:{fill:t,stroke:e}}}=n;this.rect=at(e,t),this.svg.appendChild(this.rect),this.registryEvent()}setEnable(n){super.setEnable(n),U(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)},i=Math.abs(t.x-n.x),r=Math.abs(t.y-n.y);U(this.rect,e.x,e.y,i,r)}else U(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:i}}}=this,r=y(this.startPoint,t,e,i),s=y(this.endPoint,t,e,i),l={x:Math.min(r.x,s.x),y:Math.min(r.y,s.y)},u={x:Math.max(r.x,s.x),y:Math.max(r.y,s.y)},a=this.searchMapInFrustum(l,u);this.dispatchEvent({type:"selected",list:a})}}searchMapInFrustum(n,t){let{context:e}=this;return e.currentFloor?.graphicLayer.children.filter(i=>i instanceof B&&this.searchChildInFrustum(i,n,t))||[]}searchChildInFrustum(n,t,e){let{context:{camera:i,container:{clientWidth:r,clientHeight:s}}}=this;if(!n)return!1;if(!n.mesh){let g=n.getPosition();if(g){let c=y(g,i,r,s);return Et(c,t,e)}return!1}n.mesh.geometry.boundingBox||n.mesh.geometry.computeBoundingBox();let l=n.mesh.geometry.boundingBox;if(!l)return!1;let{min:u,max:a}=l,h=y(u,i,r,s),p=y(a,i,r,s);return!(!Et(h,t,e)||!Et(p,t,e))}dispose(){this.unRegistryEvent()}};var Ut=class extends On.EventDispatcher{constructor(t){super();this.context=t;this.boxSelection=new ne(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.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:i}=t,{x:r,y:s}=this.downPoint;if(Math.sqrt((r-e)**2+(s-i)**2)>3)return;let{graphics:l}=this.context.getGraphicsByDeviceXy(e,i),u=new Set(l.map(h=>h.options.id));this.context.getPoisByDeviceXy(e,i).forEach(h=>{if(!u.has(h.options.id)){let p=this.context.currentFloor?.graphicLayer.graphicMap.get(h.options.id)||null;p&&p.options.geometry.type==="point"&&(l.push(p),u.add(h.options.id))}}),(bt?t.metaKey:t.ctrlKey)||this._list.clear(),l.forEach(h=>this._list.add(h)),this.selectEnd(),this.downPoint=null};onPointerOut=t=>{this.disableBoxSelection()};onKeyDown=t=>{Kt(t.key)&&this.enableBoxSelection()};onKeyUp=t=>{Kt(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 Fn=require("three");var Gt=class extends Fn.EventDispatcher{constructor(t){super();this.context=t;this.registryEvent()}curGraphics=new Set;timer=new z;graphicTimerMap=new Map;onPointerMove=({graphics:t,pois:e,e:i})=>{let r=e.map(a=>this.context.currentFloor?.graphicLayer.graphicMap.get(a.options.id)).filter(a=>a&&a.options.geometry.type==="point");if(!t.length&&!r.length&&this.curGraphics.size){this.curGraphics.clear(),this.handleHoverGraphicsChange();return}let{time:s}=this.context.config.hover,l=new Set;if(r.length){let a,h=1e4;r.forEach(p=>{let g=e.find(m=>m.options.id===p.options.id),{x:c,y:f}=g.clientPos,A=Math.sqrt((c-i.offsetX)**2+(f-i.offsetY)**2);A<h&&(h=A,a=p)}),l.add(a)}l.size||t.forEach(a=>l.add(a)),l.forEach(a=>{if(this.graphicTimerMap.get(a)||this.curGraphics.has(a))return;let h=this.timer.setTimeout(()=>{this.curGraphics.add(a),this.graphicTimerMap.delete(a),this.timer.clearTimeout(h),this.handleHoverGraphicsChange()},s);this.graphicTimerMap.set(a,h)}),this.graphicTimerMap.forEach((a,h)=>{l.has(h)||(this.timer.clearTimeout(a),this.graphicTimerMap.delete(h))});let u=this.curGraphics.size;this.curGraphics.forEach(a=>{l.has(a)||this.curGraphics.delete(a)}),u!==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 Gn=require("three/examples/jsm/lines/LineMaterial"),b=require("three");function Un(o){return`${o.x}-${o.y}-${o.z}`}var ie=class{constructor(n){this.context=n}lineMaterialMap=new Map;meshStandardMaterialMap=new Map;meshBasicMaterialMap=new Map;shaderMaterialMap=new Map;groundTextureMaterialMap=new Map;line2MaterialMap=new Map;generateLineMaterialKey({color:n,opacity:t}){return`${n}-${t}`}createLineMaterial({color:n,opacity:t}){let e=this.generateLineMaterialKey({color:n,opacity:t});if(this.lineMaterialMap.has(e))return this.lineMaterialMap.get(e);let i=new b.LineBasicMaterial({color:new b.Color(n).convertLinearToSRGB(),transparent:!0,opacity:t});return this.lineMaterialMap.set(e,i),i}createMeshStandardMaterial({color:n,opacity:t}){let e=`${n}-${t}`;if(this.meshStandardMaterialMap.has(e))return this.meshStandardMaterialMap.get(e);let i=new b.MeshStandardMaterial({color:new b.Color(n).convertLinearToSRGB(),roughness:1,transparent:!0,opacity:t,depthWrite:!0});return this.meshStandardMaterialMap.set(e,i),i}createMeshBasicMaterial({color:n,opacity:t}){let e=`${n}-${t}`;if(this.meshBasicMaterialMap.has(e))return this.meshBasicMaterialMap.get(e);let i=new b.MeshBasicMaterial({color:n,transparent:!0,opacity:t,depthWrite:!0});return this.meshBasicMaterialMap.set(e,i),i}createShaderMaterial({gradualColor:n,center:t,maxValue:e,opacity:i,direction:r,max:s,min:l}){let u=`${n.toString()}-${Un(t)}-${e}-${i}-${Un(r)}`;if(this.shaderMaterialMap.has(u))return this.shaderMaterialMap.get(u);let a=`
1
+ "use strict";var ir=Object.create;var Xt=Object.defineProperty;var or=Object.getOwnPropertyDescriptor;var sr=Object.getOwnPropertyNames;var ar=Object.getPrototypeOf,lr=Object.prototype.hasOwnProperty;var nt=(o,n)=>()=>(n||o((n={exports:{}}).exports,n),n.exports),ur=(o,n)=>{for(var t in n)Xt(o,t,{get:n[t],enumerable:!0})},Ze=(o,n,t,e)=>{if(n&&typeof n=="object"||typeof n=="function")for(let r of sr(n))!lr.call(o,r)&&r!==t&&Xt(o,r,{get:()=>n[r],enumerable:!(e=or(n,r))||e.enumerable});return o};var Ke=(o,n,t)=>(t=o!=null?ir(ar(o)):{},Ze(n||!o||!o.__esModule?Xt(t,"default",{value:o,enumerable:!0}):t,o)),cr=o=>Ze(Xt({},"__esModule",{value:!0}),o);var nn=nt((si,en)=>{en.exports=function(n,t){return n[0]=t[0],n[1]=t[1],n}});var sn=nt((ai,on)=>{var rn=nn();on.exports=function(o,n){Array.isArray(n)||(n=[]),o.length>0&&n.push(rn([0,0],o[0]));for(var t=0;t<o.length-1;t++){var e=o[t],r=o[t+1],i=e[0],s=e[1],l=r[0],u=r[1],a=[.75*i+.25*l,.75*s+.25*u],c=[.25*i+.75*l,.25*s+.75*u];n.push(a),n.push(c)}return o.length>1&&n.push(rn([0,0],o[o.length-1])),n}});var pn=nt((ci,hn)=>{var Ae=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)}};hn.exports=Ae});var gn=nt((hi,dn)=>{function fn(o,n){let t=new Map;for(let[e,r]of o)e!==n&&r instanceof Map?t.set(e,fn(r,n)):e!==n&&t.set(e,r);return t}dn.exports=fn});var _n=nt((pi,yn)=>{function Er(o){let n=Number(o);return!(isNaN(n)||n<=0)}function mn(o){let n=new Map;return Object.keys(o).forEach(e=>{let r=o[e];if(r!==null&&typeof r=="object"&&!Array.isArray(r))return n.set(e,mn(r));if(!Er(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}yn.exports=mn});var En=nt((fi,xn)=>{function vn(o){if(!(o instanceof Map))throw new Error(`Invalid graph: Expected Map instead found ${typeof o}`);o.forEach((n,t)=>{if(typeof n=="object"&&n instanceof Map){vn(n);return}if(typeof n!="number"||n<=0)throw new Error(`Values must be numbers greater than 0. Found value ${n} at ${t}`)})}xn.exports=vn});var wn=nt((di,Sn)=>{var br=pn(),Mr=gn(),bn=_n(),Mn=En(),Re=class{constructor(n){n instanceof Map?(Mn(n),this.graph=n):n?this.graph=bn(n):this.graph=new Map}addNode(n,t){let e;return t instanceof Map?(Mn(t),e=t):e=bn(t),this.graph.set(n,e),this}addVertex(n,t){return this.addNode(n,t)}removeNode(n){return this.graph=Mr(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 br,s=new Map,l=[],u=0,a=[];if(e.avoid&&(a=[].concat(e.avoid)),a.includes(n))throw new Error(`Starting node (${n}) cannot be avoided`);if(a.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){u=c.priority;let d=c.key;for(;s.has(d);)l.push(d),d=s.get(d);break}r.add(c.key),(this.graph.get(c.key)||new Map).forEach((d,h)=>{if(r.has(h)||a.includes(h))return null;if(!i.has(h))return s.set(h,c.key),i.set(h,c.priority+d);let f=i.get(h).priority,y=c.priority+d;return y<f?(s.set(h,c.key),i.set(h,y)):null})}return l.length?(e.trim?l.shift():l=l.concat([n]),e.reverse||(l=l.reverse()),e.cost?{path:l,cost:u}:l):e.cost?{path:null,cost:0}:null}shortestPath(...n){return this.path(...n)}};Sn.exports=Re});var Or={};ur(Or,{AibeeLoader:()=>je,BMap:()=>Ge,BaseSvg:()=>H,Context:()=>zt,Equipment:()=>Be,Events:()=>Se,Floor:()=>Z,GlbModel:()=>Ft,Graphic:()=>L,GraphicLayer:()=>Lt,GroundTexture:()=>Dt,HeatmapElement:()=>At,HooksName:()=>gt,HoverHelper:()=>Bt,Lane:()=>Ut,Layer:()=>O,MapTypePolar:()=>Wn,Model:()=>Rt,MulFloors:()=>Xe,Navigation:()=>He,Overlay:()=>Pt,PathDirection:()=>un,Poi:()=>_t,PoiLayer:()=>ut,RoadNetwork:()=>Le,SelectBox:()=>Ne,Selection:()=>Gt,Shadow:()=>Ct,SplitLoad:()=>We,SvgLine:()=>It,SvgPolygon:()=>Nt,Timer:()=>V,UniqueKey:()=>lt,Wall:()=>Ot,addAlphaToHexColor:()=>gr,calc_angle:()=>ve,calc_direction:()=>cn,clearCanvas:()=>_e,clearTextTexture:()=>ye,convertToSnakeCase:()=>Ie,createCanvas:()=>Qe,createCircle:()=>dt,createLine:()=>St,createRect:()=>st,createSvg:()=>xe,createSvgElement:()=>Mt,darkenColor:()=>at,defaultAibeeLoaderOption:()=>Ir,defaultConfig:()=>Vn,defaultOptions:()=>In,dispose:()=>U,disposeLoader:()=>be,distancePointToSegment:()=>Ce,generatorKeyByObj:()=>z,getCenter:()=>jt,getConfig:()=>Fe,getDirectPath:()=>xr,getLength:()=>I,getLongestSideDir:()=>pr,getPathLength:()=>bt,getTextureByText:()=>hr,hasChinese:()=>ge,initCamera:()=>he,initCanvas:()=>Je,initControl:()=>fe,initDirectionalLight:()=>de,initLight:()=>pe,initRenderer:()=>ce,initScene:()=>ue,initShape:()=>j,isContain:()=>Et,isControl:()=>Kt,isMac:()=>Tt,loadBuildingGround:()=>Ue,loadGraphics:()=>kt,loadModel:()=>wt,moveOnRoute:()=>Pe,proxyOptions:()=>ot,removeWeightPath:()=>ln,setCirclePosition:()=>J,setLineStartEnd:()=>G,setRectPosition:()=>B,simplifyPath:()=>Te,sleepOnePromise:()=>Ee,sleepOneRf:()=>fr,smoothPath:()=>we,strToNumber:()=>dr,timeoutPromise:()=>$,toWebWorker:()=>Sr,triggerWorker:()=>yt,vector3ToDevice:()=>_,xhrGet:()=>yr});module.exports=cr(Or);var oe=require("three");var V=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 b=require("three"),$e=require("three/examples/jsm/controls/MapControls");function ue(){let o=new b.Scene;return o.background=new b.Color(16777215),o}function ce(){let o=new b.WebGLRenderer({antialias:!0});return o.autoClear=!0,o.setClearAlpha(1),o.setClearColor(16777215),o.setPixelRatio(window.devicePixelRatio),o.shadowMap.enabled=!0,o.shadowMap.autoUpdate=!0,o.shadowMap.type=b.PCFSoftShadowMap,o}function he(o,n){let t=new b.OrthographicCamera(-o/2,o/2,n/2,-n/2,-1e3,5e3);return t.up.set(0,0,1),t.position.set(0,0,100),t.lookAt(0,0,0),t}function pe(){let o=new b.Group,n=new b.AmbientLight(16777215,2.6);return o.add(n),o}function fe(o,n){let t=new $e.MapControls(o,n);return t.enableDamping=!1,t.zoomSpeed=2,t}function j(o,n=[]){let t=new b.Shape(o.map(e=>new b.Vector2(...e)));return n.length&&n.forEach(e=>{var r=new b.Path(e.map(i=>new b.Vector2(...i)));t.holes.push(r)}),t}function de(o=16777215,n=1){let t=new b.DirectionalLight(o,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 U(o,n){if(n&&o.children&&o.children.length&&o.children.forEach(t=>{U(t,n)}),o.isMesh){let t=o;t.geometry&&t.geometry.dispose(),t.material&&(Array.isArray(t.material)?t.material.forEach(e=>{e.dispose()}):t.material.dispose())}o.isLight&&o.dispose?.()}function ge(o){return/[\u4E00-\u9FA5]+/g.test(o)}var it=require("three");var qt=new Map;function Je(){let o=document.createElement("canvas");o.width=1024,o.height=64;let n=o.getContext("2d",{willReadFrequently:!0});return n.font="54px sans-serif",n.textBaseline="hanging",n.lineWidth=12,n.fillStyle="rgba(0,0,0,1)",n.strokeStyle="white",{canvas:o,ctx:n}}var me,rt;function Qe(){if(!me){let{canvas:o,ctx:n}=Je();me=o,rt=n}}function hr(o){if(qt.has(o))return qt.get(o);Qe(),rt.clearRect(0,0,1024,64);let n=ge(o)?4:8;rt.strokeText(o,2,n),rt.fillText(o,2,n);let t=Math.ceil(rt.measureText(o).width);t=t%2===0?t:t+1,t+=2;let e=rt.getImageData(0,0,t,64),r=new it.DataTexture(Uint8Array.from(e.data),t,64,it.RGBAFormat);return r.flipY=!0,r.minFilter=it.LinearFilter,r.magFilter=it.LinearFilter,qt.set(o,r),r}function ye(){qt.clear()}function _e(){rt=null,me=null}var Y=require("three"),ft=require("@turf/turf");function _(o,n,t,e){let r=o.clone().project(n),i=t/2,s=e/2,l=Math.round(r.x*i+i),u=Math.round(-r.y*s+s);return{x:l,y:u}}function jt(o){let n=(0,ft.featureCollection)(o.map(e=>(0,ft.point)(e)));return(0,ft.center)(n).geometry.coordinates}function Et(o,n,t){return o.x>=n.x&&o.x<=t.x&&o.y>=n.y&&o.y<=t.y}function pr(o){let n=0,t=new Y.Vector3;for(let e=1;e<o.length;e++){let r=new Y.Vector3(o[e-1][0],o[e-1][1],0),i=new Y.Vector3(o[e][0],o[e][1],0),s=i.distanceTo(r);s>n&&(n=s,t=i.clone().sub(r).normalize())}return t}function I(o,n){return Math.sqrt((n[0]-o[0])**2+(n[1]-o[1])**2)}function bt(o){let n=0;for(let t=0;t<o.length-1;t++)n+=I(o[t],o[t+1]);return n}function ve(o,n,t){let e=new Y.Vector2(n[0]-o[0],n[1]-o[1]),r=new Y.Vector2(n[0]-t[0],n[1]-t[1]),s=e.angleTo(r)*180/Math.PI,l=new Y.Vector2(n[0]-o[0],n[1]-o[1]);return new Y.Vector2(t[0]-o[0],t[1]-o[1]).cross(l)>0?s:-s}function ot(o,n){return new Proxy(o,{get:(t,e,r)=>Reflect.get(t,e,r),set:(t,e,r,i)=>{let s=Reflect.get(t,e,i),l=Reflect.set(t,e,r,i);return s!==r&&n.dispatchEvent({type:`change-${e}`,value:r}),l}})}function $(o,n){return Promise.race([o,new Promise((t,e)=>{setTimeout(()=>e(new Error("Promise timeout")),n)})])}function Mt(o){return document.createElementNS("http://www.w3.org/2000/svg",o)}function xe(o,n){let t=Mt("svg");return t.setAttribute("width",o),t.setAttribute("height",n),t.style.cssText="position: absolute; left: 0; top: 0; pointer-events: none;",t}function dt(o="2",n){let t=Mt("circle");return t.setAttribute("r",o),t.setAttribute("fill",n),t}function St(o){let n=Mt("line");return n.setAttribute("stroke",o),n}function st(o,n){let t=Mt("rect");return t.setAttribute("stroke",o),t.setAttribute("fill",n),t}function J(o,n,t){o.setAttribute("cx",`${n}`),o.setAttribute("cy",`${t}`)}function G(o,n,t){n&&(o.setAttribute("x1",`${n.x}`),o.setAttribute("y1",`${n.y}`)),t&&(o.setAttribute("x2",`${t.x}`),o.setAttribute("y2",`${t.y}`))}function B(o,n,t,e,r){o.setAttribute("x",`${n}`),o.setAttribute("y",`${t}`),o.setAttribute("width",`${e}`),o.setAttribute("height",`${r}`)}function Ee(){return Promise.resolve()}function fr(){return new Promise(o=>{requestAnimationFrame(o)})}function dr(o){return parseInt(o.replace("#","0x"),16)}function gr(o,n){let t=parseInt(o.substring(1,3),16),e=parseInt(o.substring(3,5),16),r=parseInt(o.substring(5,7),16),i=Math.round(t*n),s=Math.round(e*n),l=Math.round(r*n);return`#${(1<<24|i<<16|s<<8|l).toString(16).slice(1)}`}function at(o,n=.85){let t,e,r;if(o.startsWith("#"))t=parseInt(o.substring(1,3),16),e=parseInt(o.substring(3,5),16),r=parseInt(o.substring(5,7),16);else{let s=o.slice(4,-1).split(",");t=parseInt(s[0].trim()),e=parseInt(s[1].trim()),r=parseInt(s[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)}var tn=require("three/examples/jsm/loaders/GLTFLoader");function mr(){return new tn.GLTFLoader}var Yt=null,Zt=new Map;function wt(o){if(Zt.has(o)){let t=Zt.get(o).then(e=>(e.scene=e.scene.clone(),e))}Yt||(Yt=mr());let n=new Promise((t,e)=>{Yt.load(o,r=>{t(r)},void 0,e)});return Zt.set(o,n),n.then(t=>(t.scene=t.scene.clone(),t))}function be(){Yt=null,Zt.clear()}var Tt=navigator.userAgent.toUpperCase().indexOf("MAC")>=0;function Kt(o){return Tt?o==="Meta":o==="Control"}var Me="__once__",Se=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=`${Me}${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(`${Me}${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(`${Me}${n}`);!e&&!r||(e?.forEach(i=>{typeof i=="function"&&i(...t)}),r?.forEach(i=>{typeof i=="function"&&i(...t)}),r?.clear())}};var gt=(t=>(t.SWITCH_FLOOR_BEFORE="switch_floor_before",t.SWITCH_FLOOR_AFTER="switch_floor_after",t))(gt||{});function z(o){return Object.keys(o).sort().map(n=>`${n}=${o[n]}`).join("&")}function yr(o,n){return new Promise((t,e)=>{let r=new XMLHttpRequest;r.open("GET",o,!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 lt=class o{keySet=new Set;static createKey(){return Math.random().toString(36).substring(2,15)+Math.random().toString(36).substring(2,15)}genUniqueKey(){let n=o.createKey();for(;this.keySet.has(n);)n=o.createKey();return n}removeKey(n){this.keySet.delete(n)}dispose(){this.keySet.clear()}};var mt=require("three"),an=Ke(sn(),1);function _r(o,n){let t=o.clone().normalize(),e=n.clone().normalize();return Math.acos(t.dot(e))}function vr(o){let n=0;return o.reduce(([t,e],[r,i])=>(n+=Math.sqrt((r-t)**2+(i-e)**2),[r,i])),n/o.length}function we(o,n=.25){if(vr(o)<n)return o;let t=(0,an.default)(o);return we(t,n)}function Te(o,n=!1,t=!0,e=5,r=150,i=3){let s=[],l=!n;if(s.push(o[0]),o.length<2)return s;for(let a=0;a<o.length-2;a+=1){let c=o[a],p=o[a+1],d=o[a+2],h=new mt.Vector2(c[0]-p[0],c[1]-p[1]),f=new mt.Vector2(d[0]-p[0],d[1]-p[1]),y=_r(h,f)/Math.PI*180,m=h.length()+f.length();(!l||y<r&&m>.01||m>e)&&(s.push(o[a+1]),l=!0)}if(s.push(o[o.length-1]),!t)return s;let u=[];u.push(s[0]);for(let a=0;a<s.length-2;a+=1){let c=new mt.Vector2(s[a][0],s[a][1]),p=new mt.Vector2(s[a+1][0],s[a+1][1]),d=new mt.Vector2(s[a+2][0],s[a+2][1]),h=c.distanceTo(p)/2,f=d.distanceTo(p)/2,y=p.clone(),m=p.clone();y.add(c.clone().sub(p).normalize().multiplyScalar(h>i?i/2:h)),m.add(d.clone().sub(p).normalize().multiplyScalar(f>i?i/2:f));let S=[[y.x,y.y],[p.x,p.y],[m.x,m.y]];u.push(...we(S,i/25))}return u.push(s[s.length-1]),ln(u)}function ln(o){if(o.length<=1)return o;let n=[],t;return o.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 Ce(o,n,t){let e=Math.sqrt((t[0]-n[0])**2+(t[1]-n[1])**2);if(e===0)return{distance:Math.sqrt((o[0]-n[0])**2+(o[1]-n[1])**2),closestPoint:n.slice(0)};let r=Math.max(0,Math.min(1,((o[0]-n[0])*(t[0]-n[0])+(o[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((o[0]-i[0])**2+(o[1]-i[1])**2),closestPoint:i}}function Pe(o,n,t){let[e,r]=o,[i,s]=n,l=Math.sqrt(Math.pow(i-e,2)+Math.pow(s-r,2)),u=t/l,a=e+(i-e)*u,c=r+(s-r)*u;return[a,c]}var un=(a=>(a.START="start",a.END="end",a.FRONT="front",a.RIGHT="right",a.LEFT="left",a.RIGHT_FRONT="right_front",a.LEFT_FRONT="left_front",a.RIGHT_BACK="right_back",a.LEFT_BACK="left_back",a))(un||{});function cn(o,n,t){let e=ve(o,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 xr(o){let n=[{direction:"start",distance:I(o[0],o[1]),points:[o[0],o[1]]}];for(let t=2;t<o.length;t++){let e=cn(o[t-2],o[t-1],o[t]);if(e==="front"){let r=n[n.length-1],i=I(o[t-1],o[t]);r.distance+=i,t!==2&&r.points.push(o[t-1])}else n.push({direction:e,distance:I(o[t-1],o[t]),points:[o[t-1],o[t]]})}return n.push({direction:"end",distance:0,points:[o[o.length-1]]}),n}var X=Ke(wn(),1);var Le=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 X.default;escalatorRoute=new X.default;straightLadderRoute=new X.default;initRoute(n){this.clear(),this.roadInfo=n,n.length&&(n.forEach(t=>{t.points.forEach(e=>{let r=`${t.floor}-${e.id}`;if(this.pointMap.set(r,e),this.nodeMap.set(`${e.floor}-${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}-${e.from}`,i=`${t.floor}-${e.to}`,s=this.pointMap.get(r)?.cds,l=this.pointMap.get(i)?.cds;if(s?.length&&l?.length){let u=I(s,l);this.addLineItem(r,i,u),e.direction==="double"&&this.addLineItem(i,r,u)}})}),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,s])=>{if(!(s.length<2))for(let l=0;l<s.length;l++){let u=`${s[l].floor}-${s[l].id}`;for(let a=0;a<s.length;a++)if(l!==a){let c=`${s[a].floor}-${s[a].id}`,p=this.pointMap.get(u)?.cds,d=this.pointMap.get(c)?.cds;if(p?.length&&d?.length)if(s[l].type==="straightLadder"){let h=t;this.addLineItem(u,c,h,r)}else{let h=e;this.addLineItem(u,c,h,r)}}}}),this.escalatorMap.forEach((i,s)=>{if(i.start&&i.end){let l=`${i.start.floor}-${i.start.id}`,u=`${i.end.floor}-${i.end.id}`,a=this.pointMap.get(l)?.cds,c=this.pointMap.get(u)?.cds;if(a?.length&&c?.length){let p=n;this.addLineItem(l,u,p,r)}}})}initBaseRoute(){let n=new Map([...this.lineMap]);this.addFacilityToLineMap(1,this.lift_priority,3e4,n),this.baseRoute=new X.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 X.default(n)}initStraightLadderRoute(){let n=new Map([...this.lineMap]),t=1e4;this.addFacilityToLineMap(3*t,1*t,3e4*t,n),this.straightLadderRoute=new X.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}-${n.nodeId}`);if(t){let[e,r]=t.split("-");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 s=I(n.coord,i.cds);return s<r.min&&(r.min=s,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 s=this.getBasePath.bind(this);switch(e){case"escalator":s=this.getEscalatorPath.bind(this);case"straightLadder":s=this.getStraightLadderPath.bind(this);default:s=this.getBasePath.bind(this)}if(i.id)return s(r,i);if(i.facility){let l=this.facilityMap.get(i.facility).filter(a=>i.floor?a.floor===i.floor:!0);if(!l.length)return null;let u=l.map(a=>s(r,{floor:a.floor,id:a.id})).filter(a=>!!a);return u.reduce((a,c)=>{let p=c.reduce((d,h)=>d+bt(h.points),0);return p<a.distance&&(a.distance=p,a.path=c),a},{distance:1/0,path:u[0]}).path}}getRoutePath(n,t,e){let r=`${n.floor}-${n.id}`,i=`${t.floor}-${t.id}`,s=e.path(r,i);if(!s)return null;let l=[];return s.map(u=>{let a=this.pointMap.get(u);if(a){let{floor:c}=a;if(l[l.length-1]?.floor===c){let p=l[l.length-1];p.points.push(a.cds),p.endType=a.type,p.destId=a.nodeId}else l.push({floor:c,points:[a.cds],endType:a.type,destId:a.nodeId})}}),l}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 X.default,this.escalatorRoute=new X.default,this.straightLadderRoute=new X.default}};function Ie(o){return o.replace(/[A-Z]/g,n=>"_"+n.toLowerCase()).replace(/^_/,"")}var Tn=new lt;function yt(o,n,t){return new Promise((e,r)=>{let i=Tn.genUniqueKey(),s=({data:l})=>{l.type===`${n}_result`&&l.key===i&&(Tn.removeKey(i),self.removeEventListener("message",s),l.error?r(l.error):e(l.data))};o.addEventListener("message",s),o.postMessage({type:n,key:i,data:t})})}function Sr(o){let n={};for(let e in o)e.startsWith("on")&&(n[Ie(e.slice(2))]=o[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 x=require("three"),pt=require("@tweenjs/tween.js");var Fn=require("three");var v=require("three");var wr={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({...wr,...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.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.initLineMaterial(),this.initLineGeometry(),this.createBorder())}initGeometry(){let t=j(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=this.context.materialFactory.createMeshBasicMaterial({color:this.options.fillColor,opacity:this.options.fillOpacity});if(this.options.height<=.1)return this.material=t,t;let e=this.context.materialFactory.createMeshBasicMaterial({color:at(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)),s=new v.Ray(i,e.clone().multiplyScalar(-1)),l=new v.Vector3;s.intersectBox(r,l);let u=t.clone().add(e.clone().multiplyScalar(-1e3)),a=new v.Ray(u,e.clone()),c=new v.Vector3;return a.intersectBox(r,c),{max:c,min:l}}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,s=this.getPosition(),l=new v.Vector3(-1,.2,0).normalize(),{max:u,min:a}=this.getMaxAndMin(s,l),c=this.context.materialFactory.createShaderMaterial({gradualColor:this.options.gradualColor,center:this.getPosition(),maxValue:i,opacity:this.options.fillOpacity,direction:new v.Vector3(-1,.2,0),max:u,min:a});if(this.options.height<=.1)return this.material=c,c;let p=this.getCenter(),d=new v.Vector3(-1,.2,1).normalize(),{max:h,min:f}=this.getMaxAndMin(p,d),y=this.context.materialFactory.createShaderMaterial({gradualColor:[at(this.options.gradualColor[0],this.options.colorFactor),at(this.options.gradualColor[1],this.options.colorFactor)],center:this.getCenter(),maxValue:i,opacity:this.options.fillOpacity,direction:new v.Vector3(-1,.2,1),max:h,min:f});return this.material=[c,y],[c,y]}initMaterial(){return this.options.renderType==="gradual"?this.initGradualMaterial():this.initSingleMaterial()}initLineMaterial(){let t=this.context.materialFactory.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 s=r[i];for(let l=0;l<s.length;l++){let u=s[l],a=l+1===s.length?s[0]:s[l+1];t.push(new v.Vector3(u[0],u[1],e)),t.push(new v.Vector3(a[0],a[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 k=require("three");var Ct=class extends k.Object3D{directionalLight;plane;basicOpacity=.07;constructor(){super(),this.directionalLight=this.initLight(),this.initPlane()}initLight(){let n=de(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 k.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 k.PlaneGeometry(n,t),r=new k.ShadowMaterial({transparent:!0,opacity:0,side:k.DoubleSide}),i=new k.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(){U(this,!0)}};var $t=require("three");var E=require("three");var Cn=require("lodash");var Tr={autoUpdate:!0,appendToBody:!1,autoChangePlacement:!1},Pt=class extends E.EventDispatcher{constructor(t,e={}){super();this.context=t;this.options={...Tr,...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 E.Vector3;clientPos={x:0,y:0};visible=!0;options;placement="top";observer=null;initObserver(){let t=new MutationObserver((0,Cn.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:s}=new E.Box3().setFromObject(this.element),l=(i.x+s.x)/2,u=(i.y+s.y)/2;return{left:new E.Vector3(s.x,u,i.z),leftTop:new E.Vector3(s.x,i.y,i.z),top:new E.Vector3(l,i.y,i.z),rightTop:new E.Vector3(i.x,i.y,i.z),right:new E.Vector3(i.x,u,i.z),rightBottom:new E.Vector3(i.x,s.y,i.z),bottom:new E.Vector3(l,s.y,i.z),leftBottom:new E.Vector3(s.x,s.y,i.z),center:new E.Vector3(l,u,i.z)}}let{x:t,y:e,z:r}=this.element?.getPosition?.()||this.position;return{left:new E.Vector3(t,e,r),leftTop:new E.Vector3(t,e,r),top:new E.Vector3(t,e,r),rightTop:new E.Vector3(t,e,r),right:new E.Vector3(t,e,r),rightBottom:new E.Vector3(t,e,r),bottom:new E.Vector3(t,e,r),leftBottom:new E.Vector3(t,e,r),center:new E.Vector3(t,e,r)}}getPlacementScreenPosition(){let{width:t,height:e}=this.context.clientSize,r=this.getPlacementPosition();return Object.keys(r).reduce((i,s)=>{let{x:l,y:u}=_(r[s],this.context.camera,t,e);return i[s]={x:l,y:u},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,s=e/2,l=[{type:"center",getBox(u,a){return{max:{x:i+u,y:a-e},min:{x:u-i,y:a}}}},{type:"left",getBox(u,a){return{max:{x:u,y:a-s},min:{x:u-t,y:a+s}}}},{type:"leftTop",getBox(u,a){return{max:{x:u,y:a-e},min:{x:u-t,y:a}}}},{type:"top",getBox(u,a){return{max:{x:u+i,y:a-e},min:{x:u-i,y:a}}}},{type:"rightTop",getBox(u,a){return{max:{x:u+t,y:a-e},min:{x:u,y:a}}}},{type:"right",getBox(u,a){return{max:{x:u+t,y:a-s},min:{x:u,y:a+s}}}},{type:"rightBottom",getBox(u,a){return{max:{x:u+t,y:a},min:{x:u,y:a+e}}}},{type:"bottom",getBox(u,a){return{max:{x:u+i,y:a},min:{x:u-i,y:a+e}}}},{type:"leftBottom",getBox(u,a){return{max:{x:u,y:a},min:{x:u-t,y:a+s}}}}];for(let u=0;u<l.length;u++){let a=l[u],c=r[a.type],{max:p,min:d}=a.getBox(c.x,c.y);if(this.checkOverflow(p,d))return{type:a.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 E.Box3().setFromObject(this.element).getCenter(new E.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:s,y:l}=this.context.clientSize;this.options.appendToBody&&(this.div.style.left=`${s}px`,this.div.style.top=`${l+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:s,y:l}=_(e,this.context.camera,r,i);this.clientPos.x===s&&this.clientPos.y===l&&!t||this._updatePosition(s,l)}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 Cr={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},_t=class extends $t.EventDispatcher{constructor(t,e){super();this.context=t;this.options=ot({...Cr,...e},this),this.position.set(e.position?.x||0,e.position?.y||0,e.position?.z||0),this.overlay=new Pt(this.context,{autoUpdate:!1}),this.overlay.addEventListener("update-position",({x:r,y:i,height:s})=>{this.overlay.div.style.transform=`translate3d(calc(${r}px - 50%), calc(${-s+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 s=this.initText();this.div.replaceChild(s,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 $t.Vector3;userData={};showTextStatus=!0;disposed=!1;get withinDisplayRange(){return this.overlay.withinDisplayRange}async resetSize(){if(await Ee(),!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,s]of Object.entries(e.styles))r.style[i]=s;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,s=r*t,{x:l,y:u}=this.overlay.clientPos;return{left:l-i/2,right:l+i/2,top:this.options.icon?u-s:u-s/2,bottom:this.options.icon?u:u+s/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 N=require("three");var R=require("three"),Pn=require("@mars3d/heatmap.js"),Q=require("@turf/turf"),At=class extends R.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:s}=this.getBox(t);this.heatmap=(0,Pn.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(s[0],s[1],this.position.z)}initPlane(t,e){this.plane&&this.remove(this.plane);let r=new R.PlaneGeometry(t,e),i=new R.Texture(this.div.firstChild);i.needsUpdate=!0;let s=new R.MeshBasicMaterial({transparent:!0,side:R.DoubleSide,map:i});s.needsUpdate=!0,this.plane=new R.Mesh(r,s),this.add(this.plane)}getTransMatrix({x:t,y:e}){return new R.Matrix3().makeScale(1,-1).multiply(new R.Matrix3().makeTranslation(0-t,0-e))}transformData(t,e){let r=this.getTransMatrix(e);return{data:t.data.map(s=>{let l=new R.Vector2(s.x,s.y).applyMatrix3(r);return{x:l.x,y:l.y,value:s.value}}),max:t.max,min:t.min}}getBox(t){let e=(0,Q.featureCollection)(t.data.map(a=>(0,Q.point)([a.x,a.y]))),r=(0,Q.bbox)(e),i=r[2]-r[0],s=r[3]-r[1],l={x:r[0],y:r[3]},u=(0,Q.center)(e);return{width:i,height:s,leftTop:l,center:u.geometry.coordinates}}dispose(){this.div=null,this.heatmap=void 0}};var Jt=require("three");var Rt=class extends Jt.Object3D{constructor(t,e){super();this.context=t;this.options=e;this.position.copy(e.position||new Jt.Vector3(0,0,0)),this.loadModel()}model=null;async loadModel(){let t=await wt(this.options.modelUrl);t.scene.rotation.set(Math.PI/2,Math.PI/2,0),this.add(t.scene),this.model=t}dispose(){U(this),this.model=null}};var Qt=require("three");var An=require("three");var O=class extends An.Object3D{constructor(t){super();this.context=t}dispose(){U(this),this.children.forEach(t=>t.dispose?.()),this.clear()}};var Lt=class extends O{graphicMap=new Map;constructor(n){super(n)}getCenter(){return new Qt.Box3().setFromObject(this).getCenter(new Qt.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 s=i.raycast(n);if(s){let{distance:l}=s;if(l<r.distance)return{distance:s.distance,position:s.position,graphic:i}}return r}else return r},t);return e===t?{graphics:[],position:null}:{graphics:[e.graphic],position:e.position}}};var Rn=require("lodash");var ut=class extends O{pois=[];debounceCollisionDetection;timer=new V;constructor(n){super(n),this.registryEvent(),this.debounceCollisionDetection=(0,Rn.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 _t(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 _t&&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:s,top:l,bottom:u}=e.getBox();if(r===0||!e.options.collision_enable){n.push({left:i,right:s,top:l,bottom:u}),e.parentSetVisible(!0);return}let a=n.some(c=>c.left<s&&c.right>i&&c.top<u&&c.bottom>l);e.parentSetVisible(!a),a||n.push({left:i,right:s,top:l,bottom:u})})}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 Z=class extends N.Object3D{constructor(t){super();this.context=t;this.groundLayer=new O(this.context),this.graphicLayer=new Lt(this.context),this.poiLayer=new ut(this.context),this.wallLayer=new O(this.context),this.textureLayer=new O(this.context),this.glbModelLayer=new O(this.context),this.laneLayer=new O(this.context),this.groundUpper.add(this.graphicLayer),this.groundUpper.add(this.poiLayer),this.groundUpper.add(this.wallLayer),this.groundUpper.add(this.textureLayer),this.groundUpper.add(this.glbModelLayer),this.groundUpper.add(this.laneLayer),this.add(this.groundUpper),this.add(this.groundLayer),this.add(this.models)}graphicLayer;poiLayer;wallLayer;textureLayer;glbModelLayer;laneLayer;grounds=new Set;groundLayer;shadow=new Ct;heatmap;groundUpper=new N.Object3D;models=new N.Object3D;modelMap=new Map;groundMaxHeight=0;name="";key="";getPosition(){return new N.Box3().setFromObject(this).getCenter(new N.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 N.Box3().setFromObject(this).getCenter(new N.Vector3)}addModel(t){let e=new Rt(this.context,t);return this.models.add(e),this.modelMap.set(t.id,e),e}addShadow(){let t=new N.Box3().setFromObject(this.groundUpper),e=t.getCenter(new N.Vector3),r=t.getSize(new N.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 At(this.context),this.add(this.heatmap)),this.heatmap.loadData(t);let e=new N.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}dispose(){this.shadow.dispose(),this.groundLayer.dispose(),this.graphicLayer.dispose(),this.poiLayer.dispose(),this.wallLayer.dispose(),this.textureLayer.dispose(),this.glbModelLayer.dispose(),this.laneLayer.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 te=require("three");var H=class extends te.EventDispatcher{constructor(t){super();this.context=t;this.svg=xe(`${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:s}=t,{clientWidth:l,clientHeight:u}=r.domElement,a=i/l*2-1,c=1-s/u*2;return new te.Vector3(a,c,0).unproject(e)}getSvgCoordinate(t){let{camera:e,container:r}=this.context;return _(t,e,r.clientWidth,r.clientHeight)}dispose(){this._unRegistryEvent(),this.context.container.removeChild(this.svg),this.svg=null}};var It=class extends H{constructor(t){super(t);this.context=t;let{config:{svg:{circle:e,line:r}}}=t;this.circles=[dt(e.radius,e.fill),dt(e.radius,e.fill)],this.line=St(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]);J(this.circles[0],t.x,t.y),G(this.line,t)}if(this.points[1]){let t=this.getSvgCoordinate(this.points[1]);J(this.circles[1],t.x,t.y),G(this.line,void 0,t)}};onPointermove=t=>{this.points.length===1&&(this.line.style.display="block",G(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,s=this.circles[this.points.length];J(s,r,i),this.points.length||G(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 Nt=class extends H{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]&&J(this.circles[t],e.x,e.y),t!==0&&G(this.lines[t-1],void 0,e),this.lines[t]&&G(this.lines[t],e)})};onPointermove=n=>{!this.lastLine||this.isClose||(this.lastLine.style.display="block",G(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:s},line:{stroke:l}}=this.context.config.svg;if(!this.isClose){let u=dt(s,i);J(u,e,r),this.addCircle(u)}if(this.lines.length&&G(this.lastLine,void 0,{x:e,y:r}),!this.isClose){let u=St(l);G(u,{x:e,y:r},{x:e,y:r}),this.addLine(u)}}};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 Ln=require("three");var Ne=class extends H{constructor(t){super(t);this.context=t;let{config:{svg:{line:e}}}=t;this.rect=st(e.stroke,"transparent"),this.svg.appendChild(this.rect);for(let r=0;r<4;r++)this.cornerRect[r]=st(e.stroke,"#ffffff"),this.centerRect[r]=st(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 Ln.Box3().setFromObject(this.graphic),{camera:e,container:{clientWidth:r,clientHeight:i}}=this.context,{min:s,max:l}=t,u=_(s,e,r,i),a=_(l,e,r,i);B(this.rect,u.x,a.y,Math.abs(a.x-u.x),Math.abs(a.y-u.y));let{x:c,y:p}=u,{x:d,y:h}=a,f=5,y=[{x:c-f,y:h-f},{x:d-f,y:h-f},{x:c-f,y:p-f},{x:d-f,y:p-f}];for(let w=0;w<y.length;w++)B(this.cornerRect[w],y[w].x,y[w].y,f*2,f*2);let m=4,S=(c+d)/2,A=(p+h)/2,M=[{x:S-m,y:h-m},{x:c-m,y:A-m},{x:d-m,y:A-m},{x:S-m,y:p-m}];for(let w=0;w<M.length;w++)B(this.centerRect[w],M[w].x,M[w].y,m*2,m*2)}else{B(this.rect,0,0,0,0);for(let t=0;t<this.cornerRect.length;t++)B(this.cornerRect[t],0,0,0,0),B(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 T=require("three");var Oe=require("three/examples/jsm/utils/BufferGeometryUtils"),Ot=class extends T.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=j(e.geometry.coords[0],e.geometry.coords.slice(1));return new T.ExtrudeGeometry(r,{steps:1,bevelEnabled:!1,depth:e.height,curveSegments:4})});this.geometry=(0,Oe.mergeGeometries)(t),t.forEach(e=>e.dispose())}initMaterial(){let t=`
2
+ varying vec3 vPosition; // \u7528\u4E8E\u4F20\u9012\u9876\u70B9\u7684\u4F4D\u7F6E\u7ED9\u7247\u6BB5\u7740\u8272\u5668
3
+ uniform float maxZ; // \u58F0\u660E\u4E00\u4E2Auniform\u53D8\u91CF
4
+ uniform vec3 uColor;
5
+ uniform vec3 uColor2;
6
+ uniform float uOpacity;
7
+
8
+ void main() {
9
+ vPosition = position; // \u5411\u7247\u6BB5\u7740\u8272\u5668\u4F20\u9012\u4F4D\u7F6E
10
+ gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);
11
+ }
12
+ `,e=`
13
+ varying vec3 vPosition; // \u63A5\u6536\u9876\u70B9\u4F4D\u7F6E
14
+ uniform float maxZ;
15
+ uniform vec3 uColor;
16
+ uniform vec3 uColor2;
17
+ uniform float uOpacity;
18
+
19
+ void main() {
20
+ // \u5224\u65AD\u5F53\u524D\u9876\u70B9\u662F\u5426\u4E3A\u9876\u9762
21
+ if (vPosition.z >= maxZ) {
22
+ gl_FragColor = vec4(uColor, uOpacity); //\uFF08\u9876\u9762\u989C\u8272\uFF09
23
+ } else {
24
+ gl_FragColor = vec4(uColor2, uOpacity); // \u5176\u4ED6\u9762\u989C\u8272\uFF09
25
+ }
26
+ }
27
+ `,r=-1/0,i=this.geometry.getAttribute("position");if(i)for(let l=0;l<i.count;l++){let u=i.getZ(l);u>r&&(r=u)}let s=new T.ShaderMaterial({uniforms:{maxZ:{value:r},uColor:{value:new T.Color(this.options[0].fillColor)},uColor2:{value:new T.Color(at(this.options[0].fillColor))},uOpacity:{value:this.options[0].fillOpacity}},vertexShader:t,fragmentShader:e});this.material=s}initLineMaterial(){let{strokeColor:t,strokeOpacity:e}=this.options[0],r=this.context.materialFactory.createLineMaterial({color:t,opacity:e});return this.lineMaterial=r,r}getBorderPoints(t){let{height:e,deltaHeight:r,geometry:i}=t,s=[],l=e+(r||0),{coords:u}=i;for(let a=0;a<u.length;a++){let c=u[a];for(let p=0;p<c.length;p++){let d=c[p],h=p+1===c.length?c[0]:c[p+1];s.push(new T.Vector3(d[0],d[1],l)),s.push(new T.Vector3(h[0],h[1],l))}}return s}initLineGeometry(){let t=this.options.map(e=>{let r=this.getBorderPoints(e);return new T.BufferGeometry().setFromPoints(r)});this.lineGeometry=(0,Oe.mergeGeometries)(t)}createBorder(){let t=new T.LineSegments(this.lineGeometry,this.lineMaterial);return this.LineMesh=t,this.add(t),t}init(){this.initGeometry(),this.initMaterial();let t=new T.Mesh(this.geometry,this.material);this.add(t),this.initLineMaterial(),this.initLineGeometry(),this.createBorder()}dispose(){this.geometry?.dispose(),this.material?.dispose(),this.lineGeometry?.dispose(),this.clear()}};var vt=require("three"),In={uuid:"",iconUrl:"",name:"",secondRotate:0,airHeight:0,deltaHeight:0,height:0,geometry:{cds:[],type:"polygon",coords:[],curveCpt:[],curveIndex:[]},opacity:1,visible:!0},Dt=class extends vt.Object3D{constructor(t,e){super();this.context=t;this.options=ot({...In,...e},this),this.init()}options;mesh;async init(){let{deltaHeight:t,airHeight:e,geometry:r,iconUrl:i,opacity:s}=this.options,l=j(r.coords[0],r.coords.slice(1)),u=new vt.ExtrudeGeometry(l,{steps:1,bevelEnabled:!1,depth:0,curveSegments:4}),a=await this.context.materialFactory.createGroundTextureMaterial({url:i,opacity:s}),c=new vt.Mesh(u,a);this.mesh=c,this.mesh.position.z=e+t,this.add(c)}dispose(){this.mesh?.geometry.dispose(),this.clear()}};var ct=require("three");var Pr={url:"",geometry:{type:"polygon",cds:[],coords:[],curveCpt:[],curveIndex:[]},id:"",width:0,rotate:1,airHeight:1,deltaHeight:0},Ft=class extends ct.Object3D{constructor(t,e){super();this.context=t;this.options=Object.assign({},Pr,e),this.loadModel()}model=null;options;async loadModel(){let t=await wt(this.options.url);t.scene.rotation.set(Math.PI/2,Math.PI/2,0);let e=new ct.Box3().setFromObject(t.scene),r=e.getSize(new ct.Vector3),i=Math.max(r.x,r.y),s=this.options.width/i;this.scale.set(s,s,s),this.add(t.scene),this.position.copy(e.getCenter(new ct.Vector3)),this.position.z+=this.options.airHeight+this.options.deltaHeight,this.model=t}dispose(){U(this),this.model=null}};var D=require("three");var De=require("three/examples/jsm/utils/BufferGeometryUtils"),Nn=require("three/examples/jsm/lines/line2"),On=require("three/examples/jsm/lines/lineGeometry"),Ut=class extends D.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=j(e.geometry.coords[0],e.geometry.coords.slice(1));return new D.ExtrudeGeometry(r,{steps:1,bevelEnabled:!1,depth:0,curveSegments:4})});this.geometry=(0,De.mergeGeometries)(t),t.forEach(e=>e.dispose())}initMaterial(){let{fillColor:t,fillOpacity:e}=this.options[0],r=this.context.materialFactory.createMeshBasicMaterial({color:t,opacity:e});return this.material=r,r}initLineMaterial(){let{strokeColor:t,strokeOpacity:e}=this.options[0],r=this.context.materialFactory.createLineMaterial({color:t,opacity:e});return this.lineMaterial=r,r}getBorderPoints(t){let{deltaHeight:e,geometry:r}=t,i=[],s=e||0,{coords:l}=r;for(let u=0;u<l.length;u++){let a=l[u];for(let c=0;c<a.length;c++){let p=a[c],d=c+1===a.length?a[0]:a[c+1];i.push(new D.Vector3(p[0],p[1],s)),i.push(new D.Vector3(d[0],d[1],s))}}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 s=`${i.secondColor}-${i.dashed}`;return r[s]&&r[s].push(i),r[s]||(r[s]=[i]),r},{});Object.values(e).map(r=>{let i=this.context.materialFactory.createLine2MaterialMap({color:r[0].secondColor,width:.2,dashed:r[0].dashed});r.map(s=>{let l=new On.LineGeometry,u=s.geometry.otherCoords[1].map(c=>[...c,0]).flat(2);l.setPositions(u);let a=new Nn.Line2(l,i);a.computeLineDistances(),a.position.z+=1e-4,this.add(a)})})}initLineGeometry(){let t=this.options.map(e=>{let r=this.getBorderPoints(e);return new D.BufferGeometry().setFromPoints(r)});this.lineGeometry=(0,De.mergeGeometries)(t)}createBorder(){let t=new D.LineSegments(this.lineGeometry,this.lineMaterial);return this.LineMesh=t,this.add(t),t}init(){this.initGeometry(),this.initMaterial();let t=new D.Mesh(this.geometry,this.material);this.add(t),this.initLineMaterial(),this.initLineGeometry(),this.createBorder(),this.initDoubleLine(),this.position.z+=.001+(this.options[0].deltaHeight||0)}dispose(){this.geometry?.dispose(),this.lineGeometry?.dispose(),this.clear()}};var Dn=require("three"),ee=class extends H{startPoint;endPoint;rect;frustum=new Dn.Frustum;constructor(n){super(n);let{config:{selectBox:{fill:t,stroke:e}}}=n;this.rect=st(e,t),this.svg.appendChild(this.rect),this.registryEvent()}setEnable(n){super.setEnable(n),B(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);B(this.rect,e.x,e.y,r,i)}else B(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=_(this.startPoint,t,e,r),s=_(this.endPoint,t,e,r),l={x:Math.min(i.x,s.x),y:Math.min(i.y,s.y)},u={x:Math.max(i.x,s.x),y:Math.max(i.y,s.y)},a=this.searchMapInFrustum(l,u);this.dispatchEvent({type:"selected",list:a})}}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:s}}}=this;if(!n)return!1;if(!n.mesh){let d=n.getPosition();if(d){let h=_(d,r,i,s);return Et(h,t,e)}return!1}n.mesh.geometry.boundingBox||n.mesh.geometry.computeBoundingBox();let l=n.mesh.geometry.boundingBox;if(!l)return!1;let{min:u,max:a}=l,c=_(u,r,i,s),p=_(a,r,i,s);return!(!Et(c,t,e)||!Et(p,t,e))}dispose(){this.unRegistryEvent()}};var Gt=class extends Fn.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.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:s}=this.downPoint;if(Math.sqrt((i-e)**2+(s-r)**2)>3)return;let{graphics:l}=this.context.getGraphicsByDeviceXy(e,r),u=new Set(l.map(c=>c.options.id));this.context.getPoisByDeviceXy(e,r).forEach(c=>{if(!u.has(c.options.id)){let p=this.context.currentFloor?.graphicLayer.graphicMap.get(c.options.id)||null;p&&p.options.geometry.type==="point"&&(l.push(p),u.add(c.options.id))}}),(Tt?t.metaKey:t.ctrlKey)||this._list.clear(),l.forEach(c=>this._list.add(c)),this.selectEnd(),this.downPoint=null};onPointerOut=t=>{this.disableBoxSelection()};onKeyDown=t=>{Kt(t.key)&&this.enableBoxSelection()};onKeyUp=t=>{Kt(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 Un=require("three");var Bt=class extends Un.EventDispatcher{constructor(t){super();this.context=t;this.registryEvent()}curGraphics=new Set;timer=new V;graphicTimerMap=new Map;onPointerMove=({graphics:t,pois:e,e:r})=>{let i=e.map(a=>this.context.currentFloor?.graphicLayer.graphicMap.get(a.options.id)).filter(a=>a&&a.options.geometry.type==="point");if(!t.length&&!i.length&&this.curGraphics.size){this.curGraphics.clear(),this.handleHoverGraphicsChange();return}let{time:s}=this.context.config.hover,l=new Set;if(i.length){let a,c=1e4;i.forEach(p=>{let d=e.find(m=>m.options.id===p.options.id),{x:h,y:f}=d.clientPos,y=Math.sqrt((h-r.offsetX)**2+(f-r.offsetY)**2);y<c&&(c=y,a=p)}),l.add(a)}l.size||t.forEach(a=>l.add(a)),l.forEach(a=>{if(this.graphicTimerMap.get(a)||this.curGraphics.has(a))return;let c=this.timer.setTimeout(()=>{this.curGraphics.add(a),this.graphicTimerMap.delete(a),this.timer.clearTimeout(c),this.handleHoverGraphicsChange()},s);this.graphicTimerMap.set(a,c)}),this.graphicTimerMap.forEach((a,c)=>{l.has(c)||(this.timer.clearTimeout(a),this.graphicTimerMap.delete(c))});let u=this.curGraphics.size;this.curGraphics.forEach(a=>{l.has(a)||this.curGraphics.delete(a)}),u!==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 Bn=require("three/examples/jsm/lines/LineMaterial"),C=require("three");function Gn(o){return`${o.x}-${o.y}-${o.z}`}var ne=class{constructor(n){this.context=n}lineMaterialMap=new Map;meshStandardMaterialMap=new Map;meshBasicMaterialMap=new Map;shaderMaterialMap=new Map;groundTextureMaterialMap=new Map;line2MaterialMap=new Map;generateLineMaterialKey({color:n,opacity:t}){return`${n}-${t}`}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 C.LineBasicMaterial({color:new C.Color(n).convertLinearToSRGB(),transparent:!0,opacity:t});return this.lineMaterialMap.set(e,r),r}createMeshStandardMaterial({color:n,opacity:t}){let e=`${n}-${t}`;if(this.meshStandardMaterialMap.has(e))return this.meshStandardMaterialMap.get(e);let r=new C.MeshStandardMaterial({color:new C.Color(n).convertLinearToSRGB(),roughness:1,transparent:!0,opacity:t,depthWrite:!0});return this.meshStandardMaterialMap.set(e,r),r}createMeshBasicMaterial({color:n,opacity:t}){let e=`${n}-${t}`;if(this.meshBasicMaterialMap.has(e))return this.meshBasicMaterialMap.get(e);let r=new C.MeshBasicMaterial({color:n,transparent:!0,opacity:t,depthWrite:!0});return this.meshBasicMaterialMap.set(e,r),r}createShaderMaterial({gradualColor:n,center:t,maxValue:e,opacity:r,direction:i,max:s,min:l}){let u=`${n.toString()}-${Gn(t)}-${e}-${r}-${Gn(i)}`;if(this.shaderMaterialMap.has(u))return this.shaderMaterialMap.get(u);let a=`
2
28
  uniform vec3 uColor;
3
29
  uniform vec3 uGradualColor;
4
30
  uniform vec3 center;
@@ -28,14 +54,14 @@
28
54
  vColor = mix(uColor, uGradualColor, 1.0 - t);
29
55
  gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);
30
56
  }
31
- `,h=`
57
+ `,c=`
32
58
  varying vec3 vColor;
33
59
  uniform float opacity;
34
60
 
35
61
  void main() {
36
62
  gl_FragColor = vec4(vColor.x, vColor.y, vColor.z, opacity);
37
63
  }
38
- `,p=new b.ShaderMaterial({uniforms:{uColor:{value:new b.Color(n[0]).convertLinearToSRGB()},uGradualColor:{value:new b.Color(n[1]).convertLinearToSRGB()},center:{value:t},maxValue:{value:e},opacity:{value:i},uDirection:{value:r},uMax:{value:s},uMin:{value:l}},vertexShader:a,fragmentShader:h,side:b.DoubleSide});return this.shaderMaterialMap.set(u,p),p}async createGroundTextureMaterial({url:n,opacity:t}){let e=`${n}-${t}`;if(this.groundTextureMaterialMap.has(e))return this.groundTextureMaterialMap.get(e);let i=await this.context.textureFactory.getTexture(n),r=new b.MeshBasicMaterial({map:i,transparent:!0,opacity:t});return this.groundTextureMaterialMap.set(e,r),r}createLine2MaterialMap({color:n,width:t,dashed:e}){let i=`${n}-${t}-${e}`;if(this.line2MaterialMap.has(i))return this.line2MaterialMap.get(i);let r=new Gn.LineMaterial({color:parseInt(n.slice(1),16),dashed:e,linewidth:t,worldUnits:!0,dashSize:1,gapSize:3,dashScale:1,resolution:new b.Vector2(this.context.clientSize.width,this.context.clientSize.height)});return this.line2MaterialMap.set(i,r),r}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.groundTextureMaterialMap.forEach((n,t)=>{n.dispose(),n.map?.dispose()}),this.groundTextureMaterialMap.clear(),this.line2MaterialMap.forEach((n,t)=>{n.dispose()}),this.line2MaterialMap.clear()}};var pt=require("three");var re=class{constructor(n){this.context=n;this.registryEvent(),this.changePrevCamera()}prevCamera={position:new pt.Vector3,zoom:1,target:new pt.Vector3};enable=!0;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 q).length)return null;let t=new pt.Box3().setFromObject(this.context.scene),{camera:e,clientSize:{width:i,height:r}}=this.context,{min:s,max:l}=t,u=y(s,e,i,r),a=y(l,e,i,r),h=y(new pt.Vector3(s.x,l.y,l.z),e,i,r),p=y(new pt.Vector3(l.x,s.y,s.z),e,i,r),g=Math.min(u.x,a.x,h.x,p.x),c=Math.max(u.x,a.x,h.x,p.x),f=Math.min(u.y,a.y,h.y,p.y),A=Math.max(u.y,a.y,h.y,p.y);return{left:g,right:c,top:f,bottom:A}}checkDistanceToScreenEdge({left:n,right:t,top:e,bottom:i}){let{width:r,height:s}=this.context.clientSize,[l,u,a,h]=this.context.config.cameraBound.padding,p=t>=h,g=r-n>=u,c=s-e>=a,f=i>=l;return p&&g&&c&&f}onCameraChange=()=>{let n=this.getCurFloorScreenPosition();if(n){let{left:t,right:e,top:i,bottom:r}=n;this.checkDistanceToScreenEdge({left:t,right:e,top:i,bottom:r})?this.changePrevCamera():this.backToPrevCamera()}};dispose(){this.unRegistryEvent()}};var Qn=require("three"),oe=class{constructor(n){this.context=n}textureMap=new Map;loader=new Qn.TextureLoader;async getTexture(n){if(this.textureMap.has(n))return this.textureMap.get(n);let t=await this.loader.loadAsync(n);return this.textureMap.set(n,t),t}dispose(){this.textureMap.forEach(n=>{n.dispose()}),this.textureMap.clear()}};var Qt=class extends v.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 Ut(this),this.hoverHelper=new Gt(this),this.materialFactory=new ie(this),this.textureFactory=new oe(this),this.resizeClientSize(),this.registryEvent()}scene=he();renderer=ce();camera;control;lights=fe();timer=new z;tweenGroup=new ft.Group;currentFloor;selection;hoverHelper;basicRatio;materialFactory;textureFactory;cameraBound;clientSize={width:0,height:0,x:0,y:0};renderRf=0;resizeClientSize(){let{x:t,y:e,width:i,height:r}=this.container.getBoundingClientRect();this.clientSize={width:i||this.container.clientWidth,height:r||this.container.clientHeight,x:t,y:e}}init(){let{clientWidth:t,clientHeight:e}=this.container;this.camera=pe(t,e),this.renderer.setSize(t,e),this.control=ge(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",()=>{let i=this.control.getPolarAngle();this.currentFloor?.setShadowOpacity(i/this.config.control.maxPolar),this.dispatchEvent({type:"change-ratio",px:(this.basicRatio||0)*this.camera.zoom}),this.dispatchEvent({type:"control-change"})}),this.cameraBound=new re(this)}getRatio(t=new v.Vector3(0,0,0),e=new v.Vector3(100,0,0)){let{clientWidth:i,clientHeight:r}=this.container,s=y(t,this.camera,i,r),l=y(e,this.camera,i,r);return Math.ceil(Math.sqrt((l.x-s.x)**2+(l.y-s.y)**2))}changeAmbientLightColor(t){this.lights.children.forEach(e=>{e instanceof v.AmbientLight&&(e.color=new v.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)}onWindowResize=()=>{let{container:t,camera:e,renderer:i}=this,{clientWidth:r,clientHeight:s}=t;r=Math.max(1,r),s=Math.max(1,s),e.left=-r/2,e.right=r/2,e.top=s/2,e.bottom=-s/2,e.updateProjectionMatrix(),i.setSize(r,s),this.resizeClientSize(),this.dispatchEvent({type:"resize",width:r,height:s})};onClick=t=>{let{graphics:e,position:i}=this.getGraphicsByDeviceXy(t.offsetX,t.offsetY);e.length&&this.dispatchEvent({type:"graphic-click",graphics:e,position:i});let r=this.getPoisByDeviceXy(t.offsetX,t.offsetY);r.length&&this.dispatchEvent({type:"poi-click",pois:r})};getGraphicsByDeviceXy(t,e){let i=new v.Vector2;i.x=t/this.clientSize.width*2-1,i.y=e/this.clientSize.height*-2+1;let r=new v.Raycaster;return r.setFromCamera(i,this.camera),r.ray.origin.sub(r.ray.direction.clone().multiplyScalar(100)),this.currentFloor?.graphicLayer.getGraphicByRaycaster(r)||{graphics:[],position:null}}getPoisByDeviceXy(t,e){return this.currentFloor?.poiLayer.getPoiByDeviceXy(t,e)||[]}onPointerover=t=>{let{graphics:e,position:i}=this.getGraphicsByDeviceXy(t.offsetX,t.offsetY),r=this.getPoisByDeviceXy(t.offsetX,t.offsetY);this.dispatchEvent({type:"pointer-over",e:t,graphics:e,pois:r,position:i})};onPointermove=t=>{let{graphics:e,position:i}=this.getGraphicsByDeviceXy(t.offsetX,t.offsetY),r=this.getPoisByDeviceXy(t.offsetX,t.offsetY);this.dispatchEvent({type:"pointer-move",e:t,graphics:e,pois:r,position:i})};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 e===0?(this.control.maxPolarAngle=t,this.control.minPolarAngle=t,this.control.update(),this.control.maxPolarAngle=this.config.control.maxPolar,this.control.minPolarAngle=0,Promise.resolve()):J(new Promise(i=>{let r={polar:this.control.getPolarAngle()},s={polar:t},l=new ft.Tween(r,this.tweenGroup).to(s,e).onUpdate(()=>{this.control.maxPolarAngle=r.polar,this.control.minPolarAngle=r.polar,this.control.update()}).onComplete(()=>{this.control.enabled=!0,this.control.maxPolarAngle=this.config.control.maxPolar,this.control.minPolarAngle=0,this.tweenGroup.remove(l),i(!0)}).onStart(()=>{this.control.enabled=!1}).start()}),e+500)}setAzimuthalAngle(t,e=500){let{maxAzimuthAngle:i,minAzimuthAngle:r}=this.control,s=i===r;if(!(!s&&t>i&&t<r)){if(e===0){this.control.maxAzimuthAngle=t,this.control.minAzimuthAngle=t,this.control.update(),s||(this.control.maxAzimuthAngle=i,this.control.minAzimuthAngle=r);return}return J(new Promise(l=>{let u={azimuthal:this.control.getAzimuthalAngle()},a={azimuthal:t},h=new ft.Tween(u,this.tweenGroup).to(a,e).onUpdate(()=>{this.control.maxAzimuthAngle=u.azimuthal,this.control.minAzimuthAngle=u.azimuthal,this.control.update()}).onComplete(()=>{this.control.enabled=!0,s||(this.control.maxAzimuthAngle=i,this.control.minAzimuthAngle=r),this.tweenGroup.remove(h),l(!0)}).onStart(()=>{this.control.enabled=!1}).start()}),e+500)}}getCameraLookAt(){return new v.Vector3().subVectors(this.control.target,this.camera.position)}setZoom(t,e,i=500){let r=this.getCameraLookAt(),s={zoom:this.camera.zoom,target:this.control.target.clone()};if(!i){this.camera.position.copy(e.clone().sub(r)),this.control.target.copy(e),this.camera.zoom=t,this.control.update();return}return J(new Promise(l=>{let u=new ft.Tween(s,this.tweenGroup).to({zoom:t,target:e},i).onUpdate(()=>{this.camera.position.copy(s.target.clone().sub(r)),this.control.target.copy(s.target),this.camera.zoom=s.zoom,this.control.update()}).onComplete(()=>{this.tweenGroup.remove(u),this.control.enabled=!0,l(!0)}).onStart(()=>{this.control.enabled=!1}).start()}),i+500)}getFitCameraToObjectZoom(t,e=[20,20,20,20],i=500,r=!0){let[s,l,u,a]=e,{clientSize:{width:h,height:p}}=this,g=this.control.getPolarAngle();r&&this.setPolarAngle(0,0);let c=new v.Box3().setFromObject(t);this.setPolarAngle(g,0);let{max:f,min:A}=c,m=new v.Vector3(A.x,f.y,f.z),C=new v.Vector3(f.x,f.y,f.z),w=new v.Vector3(f.x,A.y,A.z),I=new v.Vector3(A.x,A.y,A.z),M=y(m,this.camera,h,p),nt=y(C,this.camera,h,p),j=y(I,this.camera,h,p),Vt=y(w,this.camera,h,p),Ye=new v.Box2().setFromPoints([new v.Vector2(M.x,M.y),new v.Vector2(nt.x,nt.y),new v.Vector2(j.x,j.y),new v.Vector2(Vt.x,Vt.y)]).getSize(new v.Vector2),Kn=(h-l-a)/Ye.x,Zn=(p-s-u)/Ye.y,$n=Math.min(Kn,Zn),ti=new v.Vector3((f.x+A.x)/2,(f.y+A.y)/2,(f.z+A.z)/2);return{zoom:$n*this.camera.zoom,center:ti}}fitCameraToObject(t,e=[20,20,20,20],i=500,r=!0){let{zoom:s,center:l}=this.getFitCameraToObjectZoom(t,e,i,r);return this.setZoom(s,l,i)}getFitCameraToGroundZoom(t=[20,20,20,20],e=500,i=!0){if(this.currentFloor&&this.currentFloor.hasElement)return this.getFitCameraToObjectZoom(this.currentFloor.groundUpper,t,e,i).zoom}fitCameraToGround(t=[20,20,20,20],e=500,i=!0){return this.currentFloor&&this.currentFloor.hasElement?this.fitCameraToObject(this.currentFloor.groundUpper,t,e,i):Promise.resolve(!1)}setCameraPosition(t,e){return J(new Promise(i=>{let r=this.camera.position.clone(),s=this.getCameraLookAt(),l=new ft.Tween(r,this.tweenGroup).to(t,e).onUpdate(()=>{this.camera.position.copy(r.clone().sub(s)),this.control.target.copy(r.clone()),this.control.update()}).onComplete(()=>{this.tweenGroup.remove(l),this.camera.position.copy(r.clone().sub(s)),this.control.target.copy(t.clone()),this.control.update(),this.control.enabled=!0,i(!0)}).onStart(()=>{this.control.enabled=!1}).start()}),e+500)}render(){this.renderer.render(this.scene,this.camera),this.dispatchEvent({type:"update"}),this.renderRf=this.timer.requestAnimationFrame(()=>{this.render()}),this.tweenGroup.update()}pauseRender(){this.timer.cancelAnimationFrame(this.renderRf)}continueRender(){this.render()}dispose(){this.cameraBound.dispose(),this.selection.dispose(),this.hoverHelper.dispose(),this.tweenGroup.getAll().forEach(t=>t.stop()),this.tweenGroup.removeAll(),this.unRegistryEvent(),this.container.removeChild(this.renderer.domElement),this.timer.dispose(),this.renderer.dispose(),this.lights.children.forEach(t=>t.dispose()),this.materialFactory.dispose(),this.textureFactory.dispose(),O(this.scene)}};var kn=require("lodash"),zn={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"},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 Fe(o){return(0,kn.merge)({},zn,o)}var Hn=require("lodash");async function Ue({brand:o,project:n},t){let{apiDomain:e,apiPath:{floorRange:i},apiInfo:r}=t,s=`${e}${i}?brand=${o}&project=${n}&phase=${n}&building=${n}`;return await fetch(s,r).then(u=>u.json()).then(u=>u.data).then(u=>{let a=(u||[])[0];return a&&(a.info=JSON.parse(a.info)),a})}async function kt({brand:o,project:n,floor:t,ts:e,resource_type_list:i},r){let{apiDomain:s,apiPath:{floorGraphic:l},apiInfo:u}=r,a=`${s}${l}?brand=${o}&project=${n}&phase=${n}&building=${n}&floor=${t}&ts=${e}&resource_type_list=${i}`;return await fetch(a,u).then(p=>p.json()).then(p=>p.data).then(p=>((p||[]).map(g=>g.info=JSON.parse(g.info)),p||[]))}var Vn=(t=>(t[t.D2=0]="D2",t[t.D3=1.1]="D3",t))(Vn||{}),Ge=class extends se.EventDispatcher{constructor(t,e={}){super();this.container=t;this.config=Fe(e),this.context=new Qt(t,this.config),this.registryEvent(),this.context.render()}config;context;polarKeys=[];azimuthalKeys=[];svgLine;svgPolygon;basicZoom=1;prevCameraZoom=1;type="2d";floorDataMap=new Map;buildingGroundMap=new Map;buildingGroundPromiseMap=new Map;currentBuildGround=null;observe=null;buildingCenter=[0,0];timer=new z;plugins=[];async loadGraphics({brand:t,project:e,floor:i,ts:r,resource_type_list:s}){return await kt({brand:t,project:e,floor:i,ts:r,resource_type_list:s},this.config)}changeBuildingCenter(t,{brand:e,project:i}){let r=t?Yt(t.info.geometry.cds[0]):[0,0];this.buildingCenter=r,this.dispatchEvent({type:"center-change",center:r,project:i,brand:e})}async loadBuildingGround({brand:t,project:e}){let i=G({brand:t,project:e});if(this.buildingGroundMap.has(i)){let s=this.buildingGroundMap.get(i);return this.changeBuildingCenter(s||null,{brand:t,project:e}),s||null}if(this.buildingGroundPromiseMap.has(i))return this.buildingGroundPromiseMap.get(i);let r=new Promise(async s=>{let l=await Ue({brand:t,project:e},this.config);this.buildingGroundMap.set(i,l),this.changeBuildingCenter(l||null,{brand:t,project:e}),this.buildingGroundPromiseMap.delete(i),s(l)});return this.buildingGroundPromiseMap.set(i,r),r}async load({brand:t,project:e,floor:i,ts:r,resource_type_list:s}){let l=G({brand:t,project:e,floor:i,ts:r,resource_type_list:s});if(this.floorDataMap.has(l))return this.floorDataMap.get(l);let[u,a]=await Promise.all([this.loadGraphics({brand:t,project:e,floor:i,ts:r,resource_type_list:s}),this.loadBuildingGround({brand:t,project:e})]);return this.transformGraphicData(u),u.forEach(h=>{h.info.transformToBuildingGround=!!a}),this.config.useFloorCache||this.floorDataMap.clear(),this.floorDataMap.set(l,u),u}transformGraphicData(t,e=this.buildingCenter,i=0){t.forEach(u=>{if(u.info.geometry.coords=JSON.parse(JSON.stringify(u.info.geometry.cds)),u.info.geometry.type==="polygon")u.info.geometry.coords.map(a=>{Array.isArray(a)&&a.forEach(h=>{h[0]-=e[0],h[1]-=e[1]})});else{let[a,h]=u.info.geometry.cds;u.info.geometry.coords=[a-e[0],h-e[1]]}});let{ground:r,markGraphic:s,graphic:l}=this.config;for(let u=0;u<t.length;u++){let a=t[u];a.info.deltaHeight=1e-5*(i+u+1),a.info.group==="ground"?(a.info.fillColor=r.color,a.info.fillOpacity=r.opacity,a.info.height=r.height,a.info.stroke=r.stroke,a.info.strokeColor=r.strokeColor,a.info.strokeOpacity=r.strokeOpacity):a.info.userData.mark?(a.info.height=s.height,a.info.fillColor=s.color,a.info.fillOpacity=s.opacity,a.info.stroke=s.stroke,a.info.strokeColor=s.strokeColor,a.info.strokeOpacity=s.strokeOpacity):(a.info.fillOpacity=l.fillOpacity,this.config.initTransToMark&&(a.info.height=s.height,a.info.fillColor=s.color,a.info.stroke=s.stroke,a.info.strokeColor=s.strokeColor,a.info.strokeOpacity=s.strokeOpacity))}}use(t){t.bmap=this,this.plugins.push(t)}unUse(t){this.plugins=this.plugins.filter(e=>e!==t)}createFloor(t){let e=new q(this.context);if(!t.length)return{curFloor:e,graphics:[]};let i=new Map,r=[];for(let s of t)if(s.info.group==="ground")e.createGround(s.info);else{let l=e.addGraphic(s.info);l.userData.data=s,i.set(s.legacy_id,l),r.push(l)}return e.userData.legacyToGraphicMap=i,{curFloor:e,graphics:r}}triggerHooks(t,e){this.dispatchEvent({type:t,data:e})}switchFloor({brand:t,project:e,floor:i,ts:r,resource_type_list:s}){let l=G({brand:t,project:e,floor:i,ts:r,resource_type_list:s}),u=this.floorDataMap.get(l);if(this.context.control.removeEventListener("change",this.onControlChange),u){let a=G({brand:t,project:e});this.currentBuildGround=this.buildingGroundMap.get(a)||null;let h=this.createFloor(u);h?(h.curFloor.name=i,this.triggerHooks("switch_floor_before",h),this.context.switchFloor(h.curFloor),this.initialFloorCamera(),this.triggerHooks("switch_floor_after",h)):console.warn("[switchFloor error] ["+i+"] \u697C\u5C42\u6CA1\u6709\u6570\u636E")}else console.warn("[switchFloor error] \u6CA1\u6709\u8FD9\u4E2A\u697C\u5C42\uFF0C\u8BF7\u5148\u8C03\u7528load\u65B9\u6CD5\u52A0\u8F7D\u697C\u5C42")}switchFloorByData(t,e,i=e){let{curFloor:r,graphics:s}=this.createFloor(t);r.name=e,r.key=i;let l=new Map;t.forEach(u=>{l.set(u.element_uuid,u)}),r.userData.graphicMap=l,this.switchFloorByFloor(r,s)}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*25,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 i=this.context.currentFloor?.addModel({...e,position:t.getPosition().setZ(.1),id:t.options.id});if(i){let{facilityAngle:r=0,facilityXScale:s=1,facilityYScale:l=1}=t.options.userData;i.rotateZ((180-r)/180*Math.PI),i.scale.set(s,l,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 B)||[]}createGraphicPoi(t,e){if(this.context.currentFloor){e.id===void 0&&(e.id=t.options.id);let i=t.getCenter();return this.context.currentFloor.addPoi({...e,position:{...i,z:i.z+t.options.height/2}})}return null}removeHeatMap(){this.context.currentFloor?.removeHeatMap()}translateElementToCenter(t,e=500){let i=t.getPosition();return this.context.setCameraPosition(i,e)}async translateElementToCenterX(t,e=500){return J(new Promise(i=>{let r=this.context.control.target.clone(),s=t.getPosition();this.timer.requestAnimationFrame(()=>{let{clientSize:{width:l,height:u},camera:a}=this.context,p=y(s,a,l,u).x-l/2,g=new se.Vector3;g.setFromMatrixColumn(this.context.camera.matrix,0),g.normalize(),g.multiplyScalar(p/this.context.camera.zoom),r.add(g),this.context.setCameraPosition(r,e).then(i)})}),e+500)}getElementDeviceCoordinate(t){let e=t.position.clone(),{clientWidth:i,clientHeight:r}=this.container;return y(e,this.context.camera,i,r)}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 i=this.context.camera.zoom;return this.context.setZoom(i-t,this.context.control.target,e)}enlargeMap(t=.5,e=500){let i=this.context.camera.zoom;return this.context.setZoom(i+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,Hn.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 Lt(this.context);let i=this.svgLine.dispose.bind(this.svgLine);this.svgLine.dispose=function(){i(),e("cancel")},this.svgLine.addEventListener("distance",({distance:r})=>{t(r)})})}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 Pt(this.context);let i=this.svgPolygon.dispose.bind(this.svgPolygon);this.svgPolygon.dispose=function(){i(),e("cancel")},this.svgPolygon.addEventListener("area",({area:r})=>{t(r)})})}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=Yt(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(i=>{Array.isArray(i)&&i.forEach(r=>{r[0]-=e[0],r[1]-=e[1]})});else{let[i,r]=t.geometry.cds;t.geometry.coords=[i-e[0],r-e[1]]}}return this.context.currentFloor?.graphicLayer.createGraphic(t)}removePoiById(t){return this.context.currentFloor?.poiLayer.removePoiById(t)}getPoiById(t){return this.context.currentFloor?.poiLayer.getPoiById(t)}getPois(){return(this.context.currentFloor?.poiLayer.pois||[]).filter(t=>!t.options.built_in)}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 i=this.context.getFitCameraToGroundZoom(void 0,0)||1;this.context.camera.zoom=e,this.context.control.minZoom=i,this.context.control.maxZoom=i*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.floorDataMap.clear(),this.buildingGroundMap.clear(),ye(),_e(),Ie(),this.unRegistryEvent()}};var qn=require("three"),W=class extends qn.EventDispatcher{bmap;constructor(n){super(),this.bmap=n}dispose(){}};var Qe=class extends W{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,i=`${n}${t}`;await fetch(i,e).then(r=>r.json()).then(r=>r.data).then(r=>{this.equipmentList=r,this.equipmentMap=new Map(r.map(s=>[s.equipment_id,s]))}),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)),i=this.bmap.createGraphicPoi(t,{icon:e?.equipment_icon,built_in:!0,icon_size:[14,14]});i&&(i.userData.data=e,i.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)})}};function zt(o){let n=new Blob([o],{type:"text/javascript"}),t=URL.createObjectURL(n),e=new Worker(t);return URL.revokeObjectURL(t),e}function ke(){return zt(`var O1=Object.create;var Rf=Object.defineProperty;var D1=Object.getOwnPropertyDescriptor;var F1=Object.getOwnPropertyNames,cm=Object.getOwnPropertySymbols,U1=Object.getPrototypeOf,fm=Object.prototype.hasOwnProperty,B1=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,bl=(r,t)=>{for(var e in t||(t={}))fm.call(t,e)&&If(r,e,t[e]);if(cm)for(var e of cm(t))B1.call(t,e)&&If(r,e,t[e]);return r};var Jt=(r,t)=>()=>(t||r((t={exports:{}}).exports,t),t.exports);var z1=(r,t,e,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of F1(t))!fm.call(r,a)&&a!==e&&Rf(r,a,{get:()=>t[a],enumerable:!(o=D1(t,a))||o.enumerable});return r};var On=(r,t,e)=>(e=r!=null?O1(U1(r)):{},z1(t||!r||!r.__esModule?Rf(e,"default",{value:r,enumerable:!0}):e,r));var si=(r,t,e)=>If(r,typeof t!="symbol"?t+"":t,e);var e0=Jt((pR,t0)=>{t0.exports=function(t,e){return t[0]=e[0],t[1]=e[1],t}});var i0=Jt((dR,r0)=>{var n0=e0();r0.exports=function(r,t){Array.isArray(t)||(t=[]),r.length>0&&t.push(n0([0,0],r[0]));for(var e=0;e<r.length-1;e++){var o=r[e],a=r[e+1],l=o[0],f=o[1],h=a[0],p=a[1],d=[.75*l+.25*h,.75*f+.25*p],g=[.25*l+.75*h,.25*f+.75*p];t.push(d),t.push(g)}return r.length>1&&t.push(n0([0,0],r[r.length-1])),t}});var gc=Jt((ER,a0)=>{"use strict";var s0=Object.getOwnPropertySymbols,kb=Object.prototype.hasOwnProperty,Gb=Object.prototype.propertyIsEnumerable;function Vb(r){if(r==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(r)}function Hb(){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}}a0.exports=Hb()?Object.assign:function(r,t){for(var e,o=Vb(r),a,l=1;l<arguments.length;l++){e=Object(arguments[l]);for(var f in e)kb.call(e,f)&&(o[f]=e[f]);if(s0){a=s0(e);for(var h=0;h<a.length;h++)Gb.call(e,a[h])&&(o[a[h]]=e[a[h]])}}return o}});var rp=Jt((ep,np)=>{(function(r,t){typeof ep=="object"&&typeof np!="undefined"?np.exports=t():typeof define=="function"&&define.amd?define(t):(r=r||self).RBush=t()})(ep,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 u0=Jt((ip,op)=>{(function(r,t){typeof ip=="object"&&typeof op!="undefined"?op.exports=t():typeof define=="function"&&define.amd?define(t):(r=r||self,r.TinyQueue=t())})(ip,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 c0=Jt((AR,l0)=>{l0.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 h0=Jt((CR,f0)=>{f0.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 m0=Jt((PR,_c)=>{var p0=c0(),d0=h0();_c.exports=function(t,e,o,a){return e.length>0&&Array.isArray(e[0])?d0(t,e,o,a):p0(t,e,o,a)};_c.exports.nested=d0;_c.exports.flat=p0});var y0=Jt((xc,g0)=>{(function(r,t){typeof xc=="object"&&typeof g0!="undefined"?t(xc):typeof define=="function"&&define.amd?define(["exports"],t):t((r=r||self).predicates={})})(xc,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 S0=Jt((IR,lp)=>{"use strict";var v0=rp(),Mc=u0(),qb=m0(),Xb=y0().orient2d;Mc.default&&(Mc=Mc.default);lp.exports=M0;lp.exports.default=M0;function M0(r,t,e){t=Math.max(0,t===void 0?2:t),e=e||0;var o=Kb(r),a=new v0(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=E0(p,h),l.push(h)}var d=new v0(16);for(f=0;f<l.length;f++)d.insert(sp(l[f]));for(var g=t*t,_=e*e;l.length;){var y=l.shift(),M=y.p,w=y.next.p,T=ap(M,w);if(!(T<_)){var x=T/g;p=Yb(a,y.prev.p,M,w,y.next.next.p,x,d),p&&Math.min(ap(p,M),ap(p,w))<=x&&(l.push(y),l.push(E0(p,y)),a.remove(p),d.remove(y),d.insert(sp(y)),d.insert(sp(y.next)))}}y=h;var v=[];do v.push(y.p),y=y.next;while(y!==h);return v.push(y.p),v}function Yb(r,t,e,o,a,l,f){for(var h=new Mc([],Zb),p=r.data;p;){for(var d=0;d<p.children.length;d++){var g=p.children[d],_=p.leaf?up(g,e,o):Jb(e,o,g);_>l||h.push({node:g,dist:_})}for(;h.length&&!h.peek().node.children;){var y=h.pop(),M=y.node,w=up(M,t,e),T=up(M,o,a);if(y.dist<w&&y.dist<T&&x0(e,M,f)&&x0(o,M,f))return M}p=h.pop(),p&&(p=p.node)}return null}function Zb(r,t){return r.dist-t.dist}function Jb(r,t,e){if(_0(r,e)||_0(t,e))return 0;var o=Ec(r[0],r[1],t[0],t[1],e.minX,e.minY,e.maxX,e.minY);if(o===0)return 0;var a=Ec(r[0],r[1],t[0],t[1],e.minX,e.minY,e.minX,e.maxY);if(a===0)return 0;var l=Ec(r[0],r[1],t[0],t[1],e.maxX,e.minY,e.maxX,e.maxY);if(l===0)return 0;var f=Ec(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 _0(r,t){return r[0]>=t.minX&&r[0]<=t.maxX&&r[1]>=t.minY&&r[1]<=t.maxY}function x0(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($b(h[p].p,h[p].next.p,r,t))return!1;return!0}function Za(r,t,e){return Xb(r[0],r[1],t[0],t[1],e[0],e[1])}function $b(r,t,e,o){return r!==o&&t!==e&&Za(r,t,e)>0!=Za(r,t,o)>0&&Za(e,o,r)>0!=Za(e,o,t)>0}function sp(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 Kb(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++)qb(r[l],h)||p.push(r[l]);return Qb(p)}function E0(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 ap(r,t){var e=r[0]-t[0],o=r[1]-t[1];return e*e+o*o}function up(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 Ec(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 jb(r,t){return r[0]===t[0]?r[1]-t[1]:r[0]-t[0]}function Qb(r){r.sort(jb);for(var t=[],e=0;e<r.length;e++){for(;t.length>=2&&Za(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&&Za(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 P0=Jt((fp,hp)=>{(function(r,t){typeof fp=="object"&&typeof hp!="undefined"?hp.exports=t():typeof define=="function"&&define.amd?define(t):r.quickselect=t()})(fp,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 gp=Jt((n2,mp)=>{"use strict";mp.exports=Wu;mp.exports.default=Wu;var hT=P0();function Wu(r,t){if(!(this instanceof Wu))return new Wu(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()}Wu.prototype={all:function(){return this._all(this.data,[])},search:function(r){var t=this.data,e=[],o=this.toBBox;if(!wc(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,wc(r,p)&&(t.leaf?e.push(h):dp(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(!wc(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,wc(r,h)){if(t.leaf||dp(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=Ka([]),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=pT(r,e.children,t),p!==-1))return e.children.splice(p,1),a.push(e),this._condense(a),this;!d&&!e.leaf&&dp(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:I0,compareMinY:R0,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=Ka(r.slice(t,e+1)),$a(f,this.toBBox),f;o||(o=Math.ceil(Math.log(a)/Math.log(l)),l=Math.ceil(a/Math.pow(l,o-1))),f=Ka([]),f.leaf=!1,f.height=o;var h=Math.ceil(a/l),p=h*Math.ceil(Math.sqrt(l)),d,g,_,y;for(L0(r,t,e,p,this.compareMinX),d=t;d<=e;d+=p)for(_=Math.min(d+p-1,e),L0(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 $a(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=pp(f),d=dT(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),Hu(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=Ka(e.children.splice(l,e.children.length-l));f.height=e.height,f.leaf=e.leaf,$a(e,this.toBBox),$a(f,this.toBBox),t?r[t-1].children.push(f):this._splitRoot(e,f)},_splitRoot:function(r,t){this.data=Ka([r,t]),this.data.height=r.height+1,this.data.leaf=!1,$a(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=Vu(r,0,o,this.toBBox),l=Vu(r,o,e,this.toBBox),f=mT(a,l),h=pp(a)+pp(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:I0,a=r.leaf?this.compareMinY:R0,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=Vu(r,0,t,a),f=Vu(r,e-t,e,a),h=Sc(l)+Sc(f),p,d;for(p=t;p<e-t;p++)d=r.children[p],Hu(l,r.leaf?a(d):d),h+=Sc(l);for(p=e-t-1;p>=t;p--)d=r.children[p],Hu(f,r.leaf?a(d):d),h+=Sc(f);return h},_adjustParentBBoxes:function(r,t,e){for(var o=e;o>=0;o--)Hu(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():$a(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 pT(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 $a(r,t){Vu(r,0,r.children.length,t,r)}function Vu(r,t,e,o,a){a||(a=Ka(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],Hu(a,r.leaf?o(f):f);return a}function Hu(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 I0(r,t){return r.minX-t.minX}function R0(r,t){return r.minY-t.minY}function pp(r){return(r.maxX-r.minX)*(r.maxY-r.minY)}function Sc(r){return r.maxX-r.minX+(r.maxY-r.minY)}function dT(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 mT(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 dp(r,t){return r.minX<=t.minX&&r.minY<=t.minY&&t.maxX<=r.maxX&&t.maxY<=r.maxY}function wc(r,t){return t.minX<=r.maxX&&t.minY<=r.maxY&&t.maxX>=r.minX&&t.maxY>=r.minY}function Ka(r){return{children:r,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function L0(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,hT(r,f,t,e,a),l.push(t,f,f,e))}});var B0=Jt((mO,Mp)=>{"use strict";Mp.exports=Cc;Mp.exports.default=Cc;function Cc(r,t,e){e=e||2;var o=t&&t.length,a=o?t[0]*e:r.length,l=D0(r,0,a,e,!0),f=[];if(!l||l.next===l.prev)return f;var h,p,d,g,_,y,M;if(o&&(l=bT(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 Yu(l,f,e,h,p,M,0),f}function D0(r,t,e,o,a){var l,f;if(a===Ep(r,t,e,o)>0)for(l=t;l<e;l+=o)f=O0(l,r[l],r[l+1],f);else for(l=e-o;l>=t;l-=o)f=O0(l,r[l],r[l+1],f);return f&&Pc(f,f.next)&&(Ju(f),f=f.next),f}function Ks(r,t){if(!r)return r;t||(t=r);var e=r,o;do if(o=!1,!e.steiner&&(Pc(e,e.next)||Un(e.prev,e,e.next)===0)){if(Ju(e),e=t=e.prev,e===e.next)break;o=!0}else e=e.next;while(o||e!==t);return t}function Yu(r,t,e,o,a,l,f){if(r){!f&&l&&IT(r,o,a,l);for(var h=r,p,d;r.prev!==r.next;){if(p=r.prev,d=r.next,l?MT(r,o,a,l):ET(r)){t.push(p.i/e|0),t.push(r.i/e|0),t.push(d.i/e|0),Ju(r),r=d.next,h=d.next;continue}if(r=d,r===h){f?f===1?(r=ST(Ks(r),t,e),Yu(r,t,e,o,a,l,2)):f===2&&wT(r,t,e,o,a,l):Yu(Ks(r),t,e,o,a,l,1);break}}}}function ET(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&&tu(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 MT(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=_p(M,w,t,e,o),C=_p(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&&tu(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&&tu(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&&tu(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&&tu(h,g,p,_,d,y,O.x,O.y)&&Un(O.prev,O,O.next)>=0)return!1;O=O.nextZ}return!0}function ST(r,t,e){var o=r;do{var a=o.prev,l=o.next.next;!Pc(a,l)&&F0(a,o,o.next,l)&&Zu(a,l)&&Zu(l,a)&&(t.push(a.i/e|0),t.push(o.i/e|0),t.push(l.i/e|0),Ju(o),Ju(o.next),o=r=l),o=o.next}while(o!==r);return Ks(o)}function wT(r,t,e,o,a,l){var f=r;do{for(var h=f.next.next;h!==f.prev;){if(f.i!==h.i&&NT(f,h)){var p=U0(f,h);f=Ks(f,f.next),p=Ks(p,p.next),Yu(f,t,e,o,a,l,0),Yu(p,t,e,o,a,l,0);return}h=h.next}f=f.next}while(f!==r)}function bT(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=D0(r,h,p,o,!1),d===d.next&&(d.steiner=!0),a.push(LT(d));for(a.sort(TT),l=0;l<a.length;l++)e=AT(a[l],e);return e}function TT(r,t){return r.x-t.x}function AT(r,t){var e=CT(r,t);if(!e)return t;var o=U0(e,r);return Ks(o,o.next),Ks(e,e.next)}function CT(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&&tu(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),Zu(e,r)&&(y<_||y===_&&(e.x>f.x||e.x===f.x&&PT(f,e)))&&(f=e,_=y)),e=e.next;while(e!==p);return f}function PT(r,t){return Un(r.prev,r,t.prev)<0&&Un(t.next,r,r.next)<0}function IT(r,t,e,o){var a=r;do a.z===0&&(a.z=_p(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,RT(a)}function RT(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 _p(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 LT(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 tu(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 NT(r,t){return r.next.i!==t.i&&r.prev.i!==t.i&&!OT(r,t)&&(Zu(r,t)&&Zu(t,r)&&DT(r,t)&&(Un(r.prev,r,t.prev)||Un(r,t.prev,t))||Pc(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 Pc(r,t){return r.x===t.x&&r.y===t.y}function F0(r,t,e,o){var a=Ac(Un(r,t,e)),l=Ac(Un(r,t,o)),f=Ac(Un(e,o,r)),h=Ac(Un(e,o,t));return!!(a!==l&&f!==h||a===0&&Tc(r,e,t)||l===0&&Tc(r,o,t)||f===0&&Tc(e,r,o)||h===0&&Tc(e,t,o))}function Tc(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 Ac(r){return r>0?1:r<0?-1:0}function OT(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&&F0(e,e.next,r,t))return!0;e=e.next}while(e!==r);return!1}function Zu(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 DT(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 U0(r,t){var e=new xp(r.i,r.x,r.y),o=new xp(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 O0(r,t,e,o){var a=new xp(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 Ju(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 xp(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}Cc.deviation=function(r,t,e,o){var a=t&&t.length,l=a?t[0]*e:r.length,f=Math.abs(Ep(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(Ep(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 Ep(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}Cc.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 Ap=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 _s(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=_s;function UT(r,t,e){switch(e===void 0&&(e={}),r){case"Point":return Sp(t).geometry;case"LineString":return bp(t).geometry;case"Polygon":return wp(t).geometry;case"MultiPoint":return k0(t).geometry;case"MultiLineString":return z0(t).geometry;case"MultiPolygon":return G0(t).geometry;default:throw new Error(r+" is invalid")}}ue.geometry=UT;function Sp(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(!Ic(r[0])||!Ic(r[1]))throw new Error("coordinates must contain numbers");var o={type:"Point",coordinates:r};return _s(o,t,e)}ue.point=Sp;function BT(r,t,e){return e===void 0&&(e={}),Rc(r.map(function(o){return Sp(o,t)}),e)}ue.points=BT;function wp(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 _s(h,t,e)}ue.polygon=wp;function zT(r,t,e){return e===void 0&&(e={}),Rc(r.map(function(o){return wp(o,t)}),e)}ue.polygons=zT;function bp(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 _s(o,t,e)}ue.lineString=bp;function kT(r,t,e){return e===void 0&&(e={}),Rc(r.map(function(o){return bp(o,t)}),e)}ue.lineStrings=kT;function Rc(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=Rc;function z0(r,t,e){e===void 0&&(e={});var o={type:"MultiLineString",coordinates:r};return _s(o,t,e)}ue.multiLineString=z0;function k0(r,t,e){e===void 0&&(e={});var o={type:"MultiPoint",coordinates:r};return _s(o,t,e)}ue.multiPoint=k0;function G0(r,t,e){e===void 0&&(e={});var o={type:"MultiPolygon",coordinates:r};return _s(o,t,e)}ue.multiPolygon=G0;function GT(r,t,e){e===void 0&&(e={});var o={type:"GeometryCollection",geometries:r};return _s(o,t,e)}ue.geometryCollection=GT;function VT(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=VT;function V0(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=V0;function Tp(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=Tp;function HT(r,t){return H0(Tp(r,t))}ue.lengthToDegrees=HT;function WT(r){var t=r%360;return t<0&&(t+=360),t}ue.bearingToAzimuth=WT;function H0(r){var t=r%(2*Math.PI);return t*180/Math.PI}ue.radiansToDegrees=H0;function qT(r){var t=r%360;return t*Math.PI/180}ue.degreesToRadians=qT;function XT(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 V0(Tp(r,t),e)}ue.convertLength=XT;function YT(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=YT;function Ic(r){return!isNaN(r)&&r!==null&&!Array.isArray(r)}ue.isNumber=Ic;function ZT(r){return!!r&&r.constructor===Object}ue.isObject=ZT;function JT(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(!Ic(t))throw new Error("bbox must only contain numbers")})}ue.validateBBox=JT;function $T(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=$T});var Pp=Jt(ir=>{"use strict";Object.defineProperty(ir,"__esModule",{value:!0});var Gr=Ap();function $u(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($u(f.geometries[o],t,e)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function KT(r,t,e,o){var a=e;return $u(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 W0(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 jT(r,t,e){var o=e;return W0(r,function(a,l){l===0&&e===void 0?o=a:o=t(o,a,l)}),o}function q0(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 QT(r,t,e){var o=e;return q0(r,function(a,l){l===0&&e===void 0?o=a:o=t(o,a,l)}),o}function tA(r){var t=[];return $u(r,function(e){t.push(e)}),t}function Cp(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 eA(r,t,e){var o=e;return Cp(r,function(a,l,f,h,p){l===0&&e===void 0?o=a:o=t(o,a,l,f,h,p)}),o}function Lc(r,t){Cp(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 nA(r,t,e){var o=e;return Lc(r,function(a,l,f){l===0&&f===0&&e===void 0?o=a:o=t(o,a,l,f)}),o}function X0(r,t){Lc(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($u(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 rA(r,t,e){var o=e,a=!1;return X0(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 Y0(r,t){if(!r)throw new Error("geojson is required");Lc(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 iA(r,t,e){var o=e;return Y0(r,function(a,l,f,h){l===0&&e===void 0?o=a:o=t(o,a,l,f,h)}),o}function oA(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 sA(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=tA;ir.coordEach=$u;ir.coordReduce=KT;ir.featureEach=q0;ir.featureReduce=QT;ir.findPoint=sA;ir.findSegment=oA;ir.flattenEach=Lc;ir.flattenReduce=nA;ir.geomEach=Cp;ir.geomReduce=eA;ir.lineEach=Y0;ir.lineReduce=iA;ir.propEach=W0;ir.propReduce=jT;ir.segmentEach=X0;ir.segmentReduce=rA});var Z0=Jt(Rp=>{"use strict";Object.defineProperty(Rp,"__esModule",{value:!0});var aA=Pp();function Ip(r){var t=[1/0,1/0,-1/0,-1/0];return aA.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}Ip.default=Ip;Rp.default=Ip});var Nc=Jt((RO,Lp)=>{var mo=rp(),$0=Ap(),K0=Pp(),eu=Z0().default,uA=K0.featureEach,PO=K0.coordEach,IO=$0.polygon,J0=$0.featureCollection;function j0(r){var t=new mo(r);return t.insert=function(e){if(e.type!=="Feature")throw new Error("invalid feature");return e.bbox=e.bbox?e.bbox:eu(e),mo.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:eu(a),o.push(a)}):uA(e,function(a){if(a.type!=="Feature")throw new Error("invalid features");a.bbox=a.bbox?a.bbox:eu(a),o.push(a)}),mo.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:eu(e),mo.prototype.remove.call(this,e,o)},t.clear=function(){return mo.prototype.clear.call(this)},t.search=function(e){var o=mo.prototype.search.call(this,this.toBBox(e));return J0(o)},t.collides=function(e){return mo.prototype.collides.call(this,this.toBBox(e))},t.all=function(){var e=mo.prototype.all.call(this);return J0(e)},t.toJSON=function(){return mo.prototype.toJSON.call(this)},t.fromJSON=function(e){return mo.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=eu(e);else if(e.type==="FeatureCollection")o=eu(e);else throw new Error("invalid geojson");return{minX:o[0],minY:o[1],maxX:o[2],maxY:o[3]}},t}Lp.exports=j0;Lp.exports.default=j0});var Bp=Jt((k3,uy)=>{"use strict";var ay=Object.prototype.toString;uy.exports=function(t){var e=ay.call(t),o=e==="[object Arguments]";return o||(o=e!=="[object Array]"&&t!==null&&typeof t=="object"&&typeof t.length=="number"&&t.length>=0&&ay.call(t.callee)==="[object Function]"),o}});var yy=Jt((G3,gy)=>{"use strict";var my;Object.keys||(Qu=Object.prototype.hasOwnProperty,zp=Object.prototype.toString,ly=Bp(),kp=Object.prototype.propertyIsEnumerable,cy=!kp.call({toString:null},"toString"),fy=kp.call(function(){},"prototype"),tl=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],Bc=function(r){var t=r.constructor;return t&&t.prototype===r},hy={$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},py=function(){if(typeof window=="undefined")return!1;for(var r in window)try{if(!hy["$"+r]&&Qu.call(window,r)&&window[r]!==null&&typeof window[r]=="object")try{Bc(window[r])}catch(t){return!0}}catch(t){return!0}return!1}(),dy=function(r){if(typeof window=="undefined"||!py)return Bc(r);try{return Bc(r)}catch(t){return!1}},my=function(t){var e=t!==null&&typeof t=="object",o=zp.call(t)==="[object Function]",a=ly(t),l=e&&zp.call(t)==="[object String]",f=[];if(!e&&!o&&!a)throw new TypeError("Object.keys called on a non-object");var h=fy&&o;if(l&&t.length>0&&!Qu.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")&&Qu.call(t,g)&&f.push(String(g));if(cy)for(var _=dy(t),y=0;y<tl.length;++y)!(_&&tl[y]==="constructor")&&Qu.call(t,tl[y])&&f.push(tl[y]);return f});var Qu,zp,ly,kp,cy,fy,tl,Bc,hy,py,dy;gy.exports=my});var Gp=Jt((V3,xy)=>{"use strict";var vA=Array.prototype.slice,_A=Bp(),vy=Object.keys,zc=vy?function(t){return vy(t)}:yy(),_y=Object.keys;zc.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 _A(o)?_y(vA.call(o)):_y(o)})}else Object.keys=zc;return Object.keys||zc};xy.exports=zc});var Vp=Jt((H3,Ey)=>{"use strict";Ey.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 kc=Jt((W3,My)=>{"use strict";var xA=Vp();My.exports=function(){return xA()&&!!Symbol.toStringTag}});var by=Jt((q3,wy)=>{"use strict";var Sy=typeof Symbol!="undefined"&&Symbol,EA=Vp();wy.exports=function(){return typeof Sy!="function"||typeof Symbol!="function"||typeof Sy("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:EA()}});var Cy=Jt((X3,Ay)=>{"use strict";var Ty={foo:{}},MA=Object;Ay.exports=function(){return{__proto__:Ty}.foo===Ty.foo&&!({__proto__:null}instanceof MA)}});var Ry=Jt((Y3,Iy)=>{"use strict";var SA="Function.prototype.bind called on incompatible ",wA=Object.prototype.toString,bA=Math.max,TA="[object Function]",Py=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},AA=function(t,e){for(var o=[],a=e||0,l=0;a<t.length;a+=1,l+=1)o[l]=t[a];return o},CA=function(r,t){for(var e="",o=0;o<r.length;o+=1)e+=r[o],o+1<r.length&&(e+=t);return e};Iy.exports=function(t){var e=this;if(typeof e!="function"||wA.apply(e)!==TA)throw new TypeError(SA+e);for(var o=AA(arguments,1),a,l=function(){if(this instanceof a){var g=e.apply(this,Py(o,arguments));return Object(g)===g?g:this}return e.apply(t,Py(o,arguments))},f=bA(0,e.length-o.length),h=[],p=0;p<f;p++)h[p]="$"+p;if(a=Function("binder","return function ("+CA(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 Gc=Jt((Z3,Ly)=>{"use strict";var PA=Ry();Ly.exports=Function.prototype.bind||PA});var Oy=Jt((J3,Ny)=>{"use strict";var IA=Function.prototype.call,RA=Object.prototype.hasOwnProperty,LA=Gc();Ny.exports=LA.call(IA,RA)});var ta=Jt(($3,zy)=>{"use strict";var tn,ou=SyntaxError,By=Function,iu=TypeError,Hp=function(r){try{return By('"use strict"; return ('+r+").constructor;")()}catch(t){}},js=Object.getOwnPropertyDescriptor;if(js)try{js({},"")}catch(r){js=null}var Wp=function(){throw new iu},NA=js?function(){try{return arguments.callee,Wp}catch(r){try{return js(arguments,"callee").get}catch(t){return Wp}}}():Wp,nu=by()(),OA=Cy()(),vr=Object.getPrototypeOf||(OA?function(r){return r.__proto__}:null),ru={},DA=typeof Uint8Array=="undefined"||!vr?tn:vr(Uint8Array),Qs={"%AggregateError%":typeof AggregateError=="undefined"?tn:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer=="undefined"?tn:ArrayBuffer,"%ArrayIteratorPrototype%":nu&&vr?vr([][Symbol.iterator]()):tn,"%AsyncFromSyncIteratorPrototype%":tn,"%AsyncFunction%":ru,"%AsyncGenerator%":ru,"%AsyncGeneratorFunction%":ru,"%AsyncIteratorPrototype%":ru,"%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%":By,"%GeneratorFunction%":ru,"%Int8Array%":typeof Int8Array=="undefined"?tn:Int8Array,"%Int16Array%":typeof Int16Array=="undefined"?tn:Int16Array,"%Int32Array%":typeof Int32Array=="undefined"?tn:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":nu&&vr?vr(vr([][Symbol.iterator]())):tn,"%JSON%":typeof JSON=="object"?JSON:tn,"%Map%":typeof Map=="undefined"?tn:Map,"%MapIteratorPrototype%":typeof Map=="undefined"||!nu||!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"||!nu||!vr?tn:vr(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer=="undefined"?tn:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":nu&&vr?vr(""[Symbol.iterator]()):tn,"%Symbol%":nu?Symbol:tn,"%SyntaxError%":ou,"%ThrowTypeError%":NA,"%TypedArray%":DA,"%TypeError%":iu,"%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){Dy=vr(vr(r)),Qs["%Error.prototype%"]=Dy}var Dy,FA=function r(t){var e;if(t==="%AsyncFunction%")e=Hp("async function () {}");else if(t==="%GeneratorFunction%")e=Hp("function* () {}");else if(t==="%AsyncGeneratorFunction%")e=Hp("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 Qs[t]=e,e},Fy={"%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"]},el=Gc(),Vc=Oy(),UA=el.call(Function.call,Array.prototype.concat),BA=el.call(Function.apply,Array.prototype.splice),Uy=el.call(Function.call,String.prototype.replace),Hc=el.call(Function.call,String.prototype.slice),zA=el.call(Function.call,RegExp.prototype.exec),kA=/[^%.[\\]]+|\\[(?:(-?\\d+(?:\\.\\d+)?)|(["'])((?:(?!\\2)[^\\\\]|\\\\.)*?)\\2)\\]|(?=(?:\\.|\\[\\])(?:\\.|\\[\\]|%$))/g,GA=/\\\\(\\\\)?/g,VA=function(t){var e=Hc(t,0,1),o=Hc(t,-1);if(e==="%"&&o!=="%")throw new ou("invalid intrinsic syntax, expected closing \`%\`");if(o==="%"&&e!=="%")throw new ou("invalid intrinsic syntax, expected opening \`%\`");var a=[];return Uy(t,kA,function(l,f,h,p){a[a.length]=h?Uy(p,GA,"$1"):f||l}),a},HA=function(t,e){var o=t,a;if(Vc(Fy,o)&&(a=Fy[o],o="%"+a[0]+"%"),Vc(Qs,o)){var l=Qs[o];if(l===ru&&(l=FA(o)),typeof l=="undefined"&&!e)throw new iu("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:a,name:o,value:l}}throw new ou("intrinsic "+t+" does not exist!")};zy.exports=function(t,e){if(typeof t!="string"||t.length===0)throw new iu("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof e!="boolean")throw new iu('"allowMissing" argument must be a boolean');if(zA(/^%?[^%]*%?$/,t)===null)throw new ou("\`%\` may not be present anywhere but at the beginning and end of the intrinsic name");var o=VA(t),a=o.length>0?o[0]:"",l=HA("%"+a+"%",e),f=l.name,h=l.value,p=!1,d=l.alias;d&&(a=d[0],BA(o,UA([0,1],d)));for(var g=1,_=!0;g<o.length;g+=1){var y=o[g],M=Hc(y,0,1),w=Hc(y,-1);if((M==='"'||M==="'"||M==="\`"||w==='"'||w==="'"||w==="\`")&&M!==w)throw new ou("property names with quotes must have matching quotes");if((y==="constructor"||!_)&&(p=!0),a+="."+y,f="%"+a+"%",Vc(Qs,f))h=Qs[f];else if(h!=null){if(!(y in h)){if(!e)throw new iu("base intrinsic for "+t+" exists, but the property is not available.");return}if(js&&g+1>=o.length){var T=js(h,y);_=!!T,_&&"get"in T&&!("originalValue"in T.get)?h=T.get:h=h[y]}else _=Vc(h,y),h=h[y];_&&!p&&(Qs[f]=h)}}return h}});var nl=Jt((K3,ky)=>{"use strict";var WA=ta(),qp=WA("%Object.defineProperty%",!0),Xp=function(){if(qp)try{return qp({},"a",{value:1}),!0}catch(t){return!1}return!1};Xp.hasArrayLengthDefineBug=function(){if(!Xp())return null;try{return qp([],"length",{value:1}).length!==1}catch(t){return!0}};ky.exports=Xp});var Yp=Jt((j3,Gy)=>{"use strict";var qA=ta(),Wc=qA("%Object.getOwnPropertyDescriptor%",!0);if(Wc)try{Wc([],"length")}catch(r){Wc=null}Gy.exports=Wc});var qc=Jt((Q3,Hy)=>{"use strict";var XA=nl()(),Zp=ta(),rl=XA&&Zp("%Object.defineProperty%",!0);if(rl)try{rl({},"a",{value:1})}catch(r){rl=!1}var YA=Zp("%SyntaxError%"),su=Zp("%TypeError%"),Vy=Yp();Hy.exports=function(t,e,o){if(!t||typeof t!="object"&&typeof t!="function")throw new su("\`obj\` must be an object or a function\`");if(typeof e!="string"&&typeof e!="symbol")throw new su("\`property\` must be a string or a symbol\`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new su("\`nonEnumerable\`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new su("\`nonWritable\`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new su("\`nonConfigurable\`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new su("\`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=!!Vy&&Vy(t,e);if(rl)rl(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 YA("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")}});var Jy=Jt((tF,Zy)=>{"use strict";var Yy=ta(),Wy=qc(),ZA=nl()(),qy=Yp(),Xy=Yy("%TypeError%"),JA=Yy("%Math.floor%");Zy.exports=function(t,e){if(typeof t!="function")throw new Xy("\`fn\` is not a function");if(typeof e!="number"||e<0||e>4294967295||JA(e)!==e)throw new Xy("\`length\` must be a positive 32-bit integer");var o=arguments.length>2&&!!arguments[2],a=!0,l=!0;if("length"in t&&qy){var f=qy(t,"length");f&&!f.configurable&&(a=!1),f&&!f.writable&&(l=!1)}return(a||l||!o)&&(ZA?Wy(t,"length",e,!0,!0):Wy(t,"length",e)),t}});var Yc=Jt((eF,Xc)=>{"use strict";var Jp=Gc(),au=ta(),$A=Jy(),KA=au("%TypeError%"),Ky=au("%Function.prototype.apply%"),jy=au("%Function.prototype.call%"),Qy=au("%Reflect.apply%",!0)||Jp.call(jy,Ky),il=au("%Object.defineProperty%",!0),jA=au("%Math.max%");if(il)try{il({},"a",{value:1})}catch(r){il=null}Xc.exports=function(t){if(typeof t!="function")throw new KA("a function is required");var e=Qy(Jp,jy,arguments);return $A(e,1+jA(0,t.length-(arguments.length-1)),!0)};var $y=function(){return Qy(Jp,Ky,arguments)};il?il(Xc.exports,"apply",{value:$y}):Xc.exports.apply=$y});var $p=Jt((nF,nv)=>{"use strict";var tv=ta(),ev=Yc(),QA=ev(tv("String.prototype.indexOf"));nv.exports=function(t,e){var o=tv(t,!!e);return typeof o=="function"&&QA(t,".prototype.")>-1?ev(o):o}});var ov=Jt((rF,iv)=>{"use strict";var tC=kc()(),eC=$p(),Kp=eC("Object.prototype.toString"),Zc=function(t){return tC&&t&&typeof t=="object"&&Symbol.toStringTag in t?!1:Kp(t)==="[object Arguments]"},rv=function(t){return Zc(t)?!0:t!==null&&typeof t=="object"&&typeof t.length=="number"&&t.length>=0&&Kp(t)!=="[object Array]"&&Kp(t.callee)==="[object Function]"},nC=function(){return Zc(arguments)}();Zc.isLegacyArguments=rv;iv.exports=nC?Zc:rv});var uu=Jt((iF,lv)=>{"use strict";var rC=Gp(),iC=typeof Symbol=="function"&&typeof Symbol("foo")=="symbol",oC=Object.prototype.toString,sC=Array.prototype.concat,sv=qc(),aC=function(r){return typeof r=="function"&&oC.call(r)==="[object Function]"},av=nl()(),uC=function(r,t,e,o){if(t in r){if(o===!0){if(r[t]===e)return}else if(!aC(o)||!o())return}av?sv(r,t,e,!0):sv(r,t,e)},uv=function(r,t){var e=arguments.length>2?arguments[2]:{},o=rC(t);iC&&(o=sC.call(o,Object.getOwnPropertySymbols(t)));for(var a=0;a<o.length;a+=1)uC(r,o[a],t[o[a]],e[o[a]])};uv.supportsDescriptors=!!av;lv.exports=uv});var jp=Jt((oF,fv)=>{"use strict";var cv=function(r){return r!==r};fv.exports=function(t,e){return t===0&&e===0?1/t===1/e:!!(t===e||cv(t)&&cv(e))}});var Qp=Jt((sF,hv)=>{"use strict";var lC=jp();hv.exports=function(){return typeof Object.is=="function"?Object.is:lC}});var dv=Jt((aF,pv)=>{"use strict";var cC=Qp(),fC=uu();pv.exports=function(){var t=cC();return fC(Object,{is:t},{is:function(){return Object.is!==t}}),t}});var vv=Jt((uF,yv)=>{"use strict";var hC=uu(),pC=Yc(),dC=jp(),mv=Qp(),mC=dv(),gv=pC(mv(),Object);hC(gv,{getPolyfill:mv,implementation:dC,shim:mC});yv.exports=gv});var Sv=Jt((lF,Mv)=>{"use strict";var td=$p(),_v=kc()(),xv,Ev,ed,nd;_v&&(xv=td("Object.prototype.hasOwnProperty"),Ev=td("RegExp.prototype.exec"),ed={},Jc=function(){throw ed},nd={toString:Jc,valueOf:Jc},typeof Symbol.toPrimitive=="symbol"&&(nd[Symbol.toPrimitive]=Jc));var Jc,gC=td("Object.prototype.toString"),yC=Object.getOwnPropertyDescriptor,vC="[object RegExp]";Mv.exports=_v?function(t){if(!t||typeof t!="object")return!1;var e=yC(t,"lastIndex"),o=e&&xv(e,"value");if(!o)return!1;try{Ev(t,nd)}catch(a){return a===ed}}:function(t){return!t||typeof t!="object"&&typeof t!="function"?!1:gC(t)===vC}});var bv=Jt((cF,wv)=>{"use strict";var sl=function(){return typeof function(){}.name=="string"},ol=Object.getOwnPropertyDescriptor;if(ol)try{ol([],"length")}catch(r){ol=null}sl.functionsHaveConfigurableNames=function(){if(!sl()||!ol)return!1;var t=ol(function(){},"name");return!!t&&!!t.configurable};var _C=Function.prototype.bind;sl.boundFunctionsHaveNames=function(){return sl()&&typeof _C=="function"&&function(){}.bind().name!==""};wv.exports=sl});var Cv=Jt((fF,Av)=>{"use strict";var Tv=qc(),xC=nl()(),EC=bv().functionsHaveConfigurableNames(),MC=TypeError;Av.exports=function(t,e){if(typeof t!="function")throw new MC("\`fn\` is not a function");var o=arguments.length>2&&!!arguments[2];return(!o||EC)&&(xC?Tv(t,"name",e,!0,!0):Tv(t,"name",e)),t}});var rd=Jt((hF,Pv)=>{"use strict";var SC=Cv(),wC=Object,bC=TypeError;Pv.exports=SC(function(){if(this!=null&&this!==wC(this))throw new bC("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 id=Jt((pF,Iv)=>{"use strict";var TC=rd(),AC=uu().supportsDescriptors,CC=Object.getOwnPropertyDescriptor;Iv.exports=function(){if(AC&&/a/mig.flags==="gim"){var t=CC(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 TC}});var Nv=Jt((dF,Lv)=>{"use strict";var PC=uu().supportsDescriptors,IC=id(),RC=Object.getOwnPropertyDescriptor,LC=Object.defineProperty,NC=TypeError,Rv=Object.getPrototypeOf,OC=/a/;Lv.exports=function(){if(!PC||!Rv)throw new NC("RegExp.prototype.flags requires a true ES5 environment that supports property descriptors");var t=IC(),e=Rv(OC),o=RC(e,"flags");return(!o||o.get!==t)&&LC(e,"flags",{configurable:!0,enumerable:!1,get:t}),t}});var Uv=Jt((mF,Fv)=>{"use strict";var DC=uu(),FC=Yc(),UC=rd(),Ov=id(),BC=Nv(),Dv=FC(Ov());DC(Dv,{getPolyfill:Ov,implementation:UC,shim:BC});Fv.exports=Dv});var zv=Jt((gF,Bv)=>{"use strict";var zC=Date.prototype.getDay,kC=function(t){try{return zC.call(t),!0}catch(e){return!1}},GC=Object.prototype.toString,VC="[object Date]",HC=kc()();Bv.exports=function(t){return typeof t!="object"||t===null?!1:HC?kC(t):GC.call(t)===VC}});var od=Jt((yF,$v)=>{var kv=Gp(),Gv=ov(),Vv=vv(),Hv=Sv(),Wv=Uv(),qv=zv(),Xv=Date.prototype.getTime;function Jv(r,t,e){var o=e||{};return(o.strict?Vv(r,t):r===t)?!0:!r||!t||typeof r!="object"&&typeof t!="object"?o.strict?Vv(r,t):r==t:WC(r,t,o)}function Yv(r){return r==null}function Zv(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 WC(r,t,e){var o,a;if(typeof r!=typeof t||Yv(r)||Yv(t)||r.prototype!==t.prototype||Gv(r)!==Gv(t))return!1;var l=Hv(r),f=Hv(t);if(l!==f)return!1;if(l||f)return r.source===t.source&&Wv(r)===Wv(t);if(qv(r)&&qv(t))return Xv.call(r)===Xv.call(t);var h=Zv(r),p=Zv(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=kv(r),g=kv(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],!Jv(r[a],t[a],e))return!1;return!0}$v.exports=Jv});var yd=Jt((SB,r_)=>{var OP=od(),go=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:DP};go.prototype.compare=function(r,t){if(r.type!==t.type||!n_(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=e_(r),a=e_(t);return o.every(function(l){return this.some(function(f){return e.compare(l,f)})},a)}}return!1};function e_(r){return r.coordinates.map(function(t){return{type:r.type.replace("Multi",""),coordinates:t}})}function n_(r,t){return r.hasOwnProperty("coordinates")?r.coordinates.length===t.coordinates.length:r.length===t.length}go.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};go.prototype.compareLine=function(r,t,e,o){if(!n_(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}};go.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};go.prototype.comparePath=function(r,t){var e=this;return r.every(function(o,a){return e.compareCoord(o,this[a])},t)};go.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};go.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)};go.prototype.compareBBox=function(r,t){return!!(!r.bbox&&!t.bbox||r.bbox&&t.bbox&&this.compareCoord(r.bbox,t.bbox))};go.prototype.removePseudo=function(r){return r};function DP(r,t){return OP(r,t,{strict:!0})}r_.exports=go});var i_=Jt((DB,jc)=>{function Es(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)}Es.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};Es.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)};Es.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)}};Es.prototype._addToCluster=function(r,t){this.clusters[t].push(r),this._assigned[r]=1};Es.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};Es.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};Es.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 jc!="undefined"&&jc.exports&&(jc.exports=Es)});var o_=Jt((FB,Qc)=>{function Ms(r,t,e){this.k=3,this.dataset=[],this.assignments=[],this.centroids=[],this.init(r,t,e)}Ms.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)};Ms.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()};Ms.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};Ms.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};Ms.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};Ms.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};Ms.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 Qc!="undefined"&&Qc.exports&&(Qc.exports=Ms)});var vd=Jt((UB,tf)=>{function yo(r,t,e){this._queue=[],this._priorities=[],this._sorting="desc",this._init(r,t,e)}yo.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)};yo.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}}};yo.prototype.forEach=function(r){this._queue.forEach(r)};yo.prototype.getElements=function(){return this._queue};yo.prototype.getElementPriority=function(r){return this._priorities[r]};yo.prototype.getPriorities=function(){return this._priorities};yo.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};yo.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)};yo.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 tf!="undefined"&&tf.exports&&(tf.exports=yo)});var a_=Jt((BB,cu)=>{typeof cu!="undefined"&&cu.exports&&(s_=vd());var s_;function Jo(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)}Jo.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 s_(null,null,"asc"),p=this._regionQuery(a);this._distanceToCore(a)!==void 0&&(this._updateQueue(a,p,h),this._expandCluster(f,h))}return this.clusters};Jo.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};Jo.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)};Jo.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))}})};Jo.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))}}};Jo.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}};Jo.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};Jo.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 cu!="undefined"&&cu.exports&&(cu.exports=Jo)});var u_=Jt((zB,ef)=>{typeof ef!="undefined"&&ef.exports&&(ef.exports={DBSCAN:i_(),KMEANS:o_(),OPTICS:a_(),PriorityQueue:vd()})});var _d=Jt((qB,c_)=>{"use strict";c_.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 p_=Jt((XB,h_)=>{"use strict";var f_=_d(),GP=f_.eudist,VP=f_.dist;h_.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?GP:VP,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 v_=Jt((JB,y_)=>{"use strict";var xd=_d(),g_=p_(),HP=xd.eudist,YB=xd.mandist,ZB=xd.dist,WP=g_.kmrand,qP=g_.kmpp,d_=1e4;function m_(r,t,e){e=e||[];for(var o=0;o<r;o++)e[o]=t;return e}function XP(r,t,e,o){var a=[],l=[],f=[],h=[],p=!1,d=o||d_,g=r.length,_=r[0].length,y=_>0,M=[];if(e)e=="kmrand"?a=WP(r,t):e=="kmpp"?a=qP(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{m_(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?HP(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?m_(_,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:d_-d,k:t,idxs:f,centroids:a}}y_.exports=XP});var mu=Jt((Td,Ad)=>{(function(r,t){typeof Td=="object"&&typeof Ad!="undefined"?Ad.exports=t():typeof define=="function"&&define.amd?define(t):(r=typeof globalThis!="undefined"?globalThis:r||self,r.polygonClipping=t())})(Td,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($)+\`
64
+ `,p=new C.ShaderMaterial({uniforms:{uColor:{value:new C.Color(n[0]).convertLinearToSRGB()},uGradualColor:{value:new C.Color(n[1]).convertLinearToSRGB()},center:{value:t},maxValue:{value:e},opacity:{value:r},uDirection:{value:i},uMax:{value:s},uMin:{value:l}},vertexShader:a,fragmentShader:c,side:C.DoubleSide});return this.shaderMaterialMap.set(u,p),p}async createGroundTextureMaterial({url:n,opacity:t}){let e=`${n}-${t}`;if(this.groundTextureMaterialMap.has(e))return this.groundTextureMaterialMap.get(e);let r=await this.context.textureFactory.getTexture(n),i=new C.MeshBasicMaterial({map:r,transparent:!0,opacity:t});return this.groundTextureMaterialMap.set(e,i),i}createLine2MaterialMap({color:n,width:t,dashed:e}){let r=`${n}-${t}-${e}`;if(this.line2MaterialMap.has(r))return this.line2MaterialMap.get(r);let i=new Bn.LineMaterial({color:parseInt(n.slice(1),16),dashed:e,linewidth:t,worldUnits:!0,dashSize:1,gapSize:3,dashScale:1,resolution:new C.Vector2(this.context.clientSize.width,this.context.clientSize.height)});return this.line2MaterialMap.set(r,i),i}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.groundTextureMaterialMap.forEach((n,t)=>{n.dispose(),n.map?.dispose()}),this.groundTextureMaterialMap.clear(),this.line2MaterialMap.forEach((n,t)=>{n.dispose()}),this.line2MaterialMap.clear()}};var ht=require("three");var re=class{constructor(n){this.context=n;this.registryEvent(),this.changePrevCamera()}prevCamera={position:new ht.Vector3,zoom:1,target:new ht.Vector3};enable=!0;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 Z).length)return null;let t=new ht.Box3().setFromObject(this.context.scene),{camera:e,clientSize:{width:r,height:i}}=this.context,{min:s,max:l}=t,u=_(s,e,r,i),a=_(l,e,r,i),c=_(new ht.Vector3(s.x,l.y,l.z),e,r,i),p=_(new ht.Vector3(l.x,s.y,s.z),e,r,i),d=Math.min(u.x,a.x,c.x,p.x),h=Math.max(u.x,a.x,c.x,p.x),f=Math.min(u.y,a.y,c.y,p.y),y=Math.max(u.y,a.y,c.y,p.y);return{left:d,right:h,top:f,bottom:y}}checkDistanceToScreenEdge({left:n,right:t,top:e,bottom:r}){let{width:i,height:s}=this.context.clientSize,[l,u,a,c]=this.context.config.cameraBound.padding,p=t>=c,d=i-n>=u,h=s-e>=a,f=r>=l;return p&&d&&h&&f}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 zn=require("three"),ie=class{constructor(n){this.context=n}textureMap=new Map;loader=new zn.TextureLoader;async getTexture(n){if(this.textureMap.has(n))return this.textureMap.get(n);let t=await this.loader.loadAsync(n);return this.textureMap.set(n,t),t}dispose(){this.textureMap.forEach(n=>{n.dispose()}),this.textureMap.clear()}};var zt=class extends x.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 Gt(this),this.hoverHelper=new Bt(this),this.materialFactory=new ne(this),this.textureFactory=new ie(this),this.resizeClientSize(),this.registryEvent()}scene=ue();renderer=ce();camera;control;lights=pe();timer=new V;tweenGroup=new pt.Group;currentFloor;selection;hoverHelper;basicRatio;materialFactory;textureFactory;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=he(t,e),this.renderer.setSize(t,e),this.control=fe(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",()=>{let r=this.control.getPolarAngle();this.currentFloor?.setShadowOpacity(r/this.config.control.maxPolar),this.dispatchEvent({type:"change-ratio",px:(this.basicRatio||0)*this.camera.zoom}),this.dispatchEvent({type:"control-change"})}),this.cameraBound=new re(this)}getRatio(t=new x.Vector3(0,0,0),e=new x.Vector3(100,0,0)){let{clientWidth:r,clientHeight:i}=this.container,s=_(t,this.camera,r,i),l=_(e,this.camera,r,i);return Math.ceil(Math.sqrt((l.x-s.x)**2+(l.y-s.y)**2))}changeAmbientLightColor(t){this.lights.children.forEach(e=>{e instanceof x.AmbientLight&&(e.color=new x.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)}onWindowResize=()=>{let{container:t,camera:e,renderer:r}=this,{clientWidth:i,clientHeight:s}=t;i=Math.max(1,i),s=Math.max(1,s),e.left=-i/2,e.right=i/2,e.top=s/2,e.bottom=-s/2,e.updateProjectionMatrix(),r.setSize(i,s),this.resizeClientSize(),this.dispatchEvent({type:"resize",width:i,height:s})};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 x.Vector2;r.x=t/this.clientSize.width*2-1,r.y=e/this.clientSize.height*-2+1;let i=new x.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){return this.currentFloor?.poiLayer.getPoiByDeviceXy(t,e)||[]}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 e===0?(this.control.maxPolarAngle=t,this.control.minPolarAngle=t,this.control.update(),this.control.maxPolarAngle=this.config.control.maxPolar,this.control.minPolarAngle=0,Promise.resolve()):$(new Promise(r=>{let i={polar:this.control.getPolarAngle()},s={polar:t},l=new pt.Tween(i,this.tweenGroup).to(s,e).onUpdate(()=>{this.control.maxPolarAngle=i.polar,this.control.minPolarAngle=i.polar,this.control.update()}).onComplete(()=>{this.control.enabled=!0,this.control.maxPolarAngle=this.config.control.maxPolar,this.control.minPolarAngle=0,this.tweenGroup.remove(l),r(!0)}).onStart(()=>{this.control.enabled=!1}).start()}),e+500)}setAzimuthalAngle(t,e=500){let{maxAzimuthAngle:r,minAzimuthAngle:i}=this.control,s=r===i;if(!(!s&&t>r&&t<i)){if(e===0){this.control.maxAzimuthAngle=t,this.control.minAzimuthAngle=t,this.control.update(),s||(this.control.maxAzimuthAngle=r,this.control.minAzimuthAngle=i);return}return $(new Promise(l=>{let u={azimuthal:this.control.getAzimuthalAngle()},a={azimuthal:t},c=new pt.Tween(u,this.tweenGroup).to(a,e).onUpdate(()=>{this.control.maxAzimuthAngle=u.azimuthal,this.control.minAzimuthAngle=u.azimuthal,this.control.update()}).onComplete(()=>{this.control.enabled=!0,s||(this.control.maxAzimuthAngle=r,this.control.minAzimuthAngle=i),this.tweenGroup.remove(c),l(!0)}).onStart(()=>{this.control.enabled=!1}).start()}),e+500)}}getCameraLookAt(){return new x.Vector3().subVectors(this.control.target,this.camera.position)}setZoom(t,e,r=500){let i=this.getCameraLookAt(),s={zoom:this.camera.zoom,target:this.control.target.clone()};if(!r){this.camera.position.copy(e.clone().sub(i)),this.control.target.copy(e),this.camera.zoom=t,this.control.update();return}return $(new Promise(l=>{let u=new pt.Tween(s,this.tweenGroup).to({zoom:t,target:e},r).onUpdate(()=>{this.camera.position.copy(s.target.clone().sub(i)),this.control.target.copy(s.target),this.camera.zoom=s.zoom,this.control.update()}).onComplete(()=>{this.tweenGroup.remove(u),this.control.enabled=!0,l(!0)}).onStart(()=>{this.control.enabled=!1}).start()}),r+500)}getFitCameraToObjectZoom(t,e=[20,20,20,20],r=500,i=!0){let[s,l,u,a]=e,{clientSize:{width:c,height:p}}=this,d=this.control.getPolarAngle();i&&this.setPolarAngle(0,0);let h=new x.Box3().setFromObject(t);this.setPolarAngle(d,0);let{max:f,min:y}=h,m=new x.Vector3(y.x,f.y,f.z),S=new x.Vector3(f.x,f.y,f.z),A=new x.Vector3(f.x,y.y,y.z),M=new x.Vector3(y.x,y.y,y.z),w=_(m,this.camera,c,p),et=_(S,this.camera,c,p),K=_(M,this.camera,c,p),Ht=_(A,this.camera,c,p),Ye=new x.Box2().setFromPoints([new x.Vector2(w.x,w.y),new x.Vector2(et.x,et.y),new x.Vector2(K.x,K.y),new x.Vector2(Ht.x,Ht.y)]).getSize(new x.Vector2),tr=(c-l-a)/Ye.x,er=(p-s-u)/Ye.y,nr=Math.min(tr,er),rr=new x.Vector3((f.x+y.x)/2,(f.y+y.y)/2,(f.z+y.z)/2);return{zoom:nr*this.camera.zoom,center:rr}}fitCameraToObject(t,e=[20,20,20,20],r=500,i=!0){let{zoom:s,center:l}=this.getFitCameraToObjectZoom(t,e,r,i);return this.setZoom(s,l,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)}setCameraPosition(t,e){return $(new Promise(r=>{let i=this.camera.position.clone(),s=this.getCameraLookAt(),l=new pt.Tween(i,this.tweenGroup).to(t,e).onUpdate(()=>{this.camera.position.copy(i.clone().sub(s)),this.control.target.copy(i.clone()),this.control.update()}).onComplete(()=>{this.tweenGroup.remove(l),this.camera.position.copy(i.clone().sub(s)),this.control.target.copy(t.clone()),this.control.update(),this.control.enabled=!0,r(!0)}).onStart(()=>{this.control.enabled=!1}).start()}),e+500)}render(){this.renderer.render(this.scene,this.camera),this.dispatchEvent({type:"update"}),this.renderRf=this.timer.requestAnimationFrame(()=>{this.render()}),this.tweenGroup.update()}pauseRender(){this.timer.cancelAnimationFrame(this.renderRf)}continueRender(){this.render()}dispose(){this.cameraBound.dispose(),this.selection.dispose(),this.hoverHelper.dispose(),this.tweenGroup.getAll().forEach(t=>t.stop()),this.tweenGroup.removeAll(),this.unRegistryEvent(),this.container.removeChild(this.renderer.domElement),this.timer.dispose(),this.renderer.dispose(),this.lights.children.forEach(t=>t.dispose()),this.materialFactory.dispose(),this.textureFactory.dispose(),U(this.scene)}};var kn=require("lodash"),Vn={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"},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 Fe(o){return(0,kn.merge)({},Vn,o)}var Hn=require("lodash");async function Ue({brand:o,project:n},t){let{apiDomain:e,apiPath:{floorRange:r},apiInfo:i}=t,s=`${e}${r}?brand=${o}&project=${n}&phase=${n}&building=${n}`;return await fetch(s,i).then(u=>u.json()).then(u=>u.data).then(u=>{let a=(u||[])[0];return a&&(a.info=JSON.parse(a.info)),a})}async function kt({brand:o,project:n,floor:t,ts:e,resource_type_list:r},i){let{apiDomain:s,apiPath:{floorGraphic:l},apiInfo:u}=i,a=`${s}${l}?brand=${o}&project=${n}&phase=${n}&building=${n}&floor=${t}&ts=${e}&resource_type_list=${r}`;return await fetch(a,u).then(p=>p.json()).then(p=>p.data).then(p=>((p||[]).map(d=>d.info=JSON.parse(d.info)),p||[]))}var Wn=(t=>(t[t.D2=0]="D2",t[t.D3=1.1]="D3",t))(Wn||{}),Ge=class extends oe.EventDispatcher{constructor(t,e={}){super();this.container=t;this.config=Fe(e),this.context=new zt(t,this.config),this.registryEvent(),this.context.render()}config;context;polarKeys=[];azimuthalKeys=[];svgLine;svgPolygon;basicZoom=1;prevCameraZoom=1;type="2d";floorDataMap=new Map;buildingGroundMap=new Map;buildingGroundPromiseMap=new Map;currentBuildGround=null;observe=null;buildingCenter=[0,0];timer=new V;plugins=[];async loadGraphics({brand:t,project:e,floor:r,ts:i,resource_type_list:s}){return await kt({brand:t,project:e,floor:r,ts:i,resource_type_list:s},this.config)}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})}async loadBuildingGround({brand:t,project:e}){let r=z({brand:t,project:e});if(this.buildingGroundMap.has(r)){let s=this.buildingGroundMap.get(r);return this.changeBuildingCenter(s||null,{brand:t,project:e}),s||null}if(this.buildingGroundPromiseMap.has(r))return this.buildingGroundPromiseMap.get(r);let i=new Promise(async s=>{let l=await Ue({brand:t,project:e},this.config);this.buildingGroundMap.set(r,l),this.changeBuildingCenter(l||null,{brand:t,project:e}),this.buildingGroundPromiseMap.delete(r),s(l)});return this.buildingGroundPromiseMap.set(r,i),i}async load({brand:t,project:e,floor:r,ts:i,resource_type_list:s}){let l=z({brand:t,project:e,floor:r,ts:i,resource_type_list:s});if(this.floorDataMap.has(l))return this.floorDataMap.get(l);let[u,a]=await Promise.all([this.loadGraphics({brand:t,project:e,floor:r,ts:i,resource_type_list:s}),this.loadBuildingGround({brand:t,project:e})]);return this.transformGraphicData(u),u.forEach(c=>{c.info.transformToBuildingGround=!!a}),this.config.useFloorCache||this.floorDataMap.clear(),this.floorDataMap.set(l,u),u}transformGraphicData(t,e=this.buildingCenter,r=0){t.forEach(u=>{if(u.info.geometry.coords=JSON.parse(JSON.stringify(u.info.geometry.cds)),u.info.geometry.type==="polygon")u.info.geometry.coords.map(a=>{Array.isArray(a)&&a.forEach(c=>{c[0]-=e[0],c[1]-=e[1]})});else{let[a,c]=u.info.geometry.cds;u.info.geometry.coords=[a-e[0],c-e[1]]}});let{ground:i,markGraphic:s,graphic:l}=this.config;for(let u=0;u<t.length;u++){let a=t[u];a.info.deltaHeight=1e-5*(r+u+1),a.info.group==="ground"?(a.info.fillColor=i.color,a.info.fillOpacity=i.opacity,a.info.height=i.height,a.info.stroke=i.stroke,a.info.strokeColor=i.strokeColor,a.info.strokeOpacity=i.strokeOpacity):a.info.userData.mark?(a.info.height=s.height,a.info.fillColor=s.color,a.info.fillOpacity=s.opacity,a.info.stroke=s.stroke,a.info.strokeColor=s.strokeColor,a.info.strokeOpacity=s.strokeOpacity):(a.info.fillOpacity=l.fillOpacity,this.config.initTransToMark&&(a.info.height=s.height,a.info.fillColor=s.color,a.info.stroke=s.stroke,a.info.strokeColor=s.strokeColor,a.info.strokeOpacity=s.strokeOpacity))}}use(t){t.bmap=this,this.plugins.push(t)}unUse(t){this.plugins=this.plugins.filter(e=>e!==t)}createFloor(t){let e=new Z(this.context);if(!t.length)return{curFloor:e,graphics:[]};let r=new Map,i=[];for(let s of t)if(s.info.group==="ground")e.createGround(s.info);else{let l=e.addGraphic(s.info);l.userData.data=s,r.set(s.legacy_id,l),i.push(l)}return e.userData.legacyToGraphicMap=r,{curFloor:e,graphics:i}}triggerHooks(t,e){this.dispatchEvent({type:t,data:e})}switchFloor({brand:t,project:e,floor:r,ts:i,resource_type_list:s}){let l=z({brand:t,project:e,floor:r,ts:i,resource_type_list:s}),u=this.floorDataMap.get(l);if(this.context.control.removeEventListener("change",this.onControlChange),u){let a=z({brand:t,project:e});this.currentBuildGround=this.buildingGroundMap.get(a)||null;let c=this.createFloor(u);c?(c.curFloor.name=r,this.triggerHooks("switch_floor_before",c),this.context.switchFloor(c.curFloor),this.initialFloorCamera(),this.triggerHooks("switch_floor_after",c)):console.warn("[switchFloor error] ["+r+"] \u697C\u5C42\u6CA1\u6709\u6570\u636E")}else console.warn("[switchFloor error] \u6CA1\u6709\u8FD9\u4E2A\u697C\u5C42\uFF0C\u8BF7\u5148\u8C03\u7528load\u65B9\u6CD5\u52A0\u8F7D\u697C\u5C42")}switchFloorByData(t,e,r=e){let{curFloor:i,graphics:s}=this.createFloor(t);i.name=e,i.key=r;let l=new Map;t.forEach(u=>{l.set(u.element_uuid,u)}),i.userData.graphicMap=l,this.switchFloorByFloor(i,s)}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*25,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:s=1,facilityYScale:l=1}=t.options.userData;r.rotateZ((180-i)/180*Math.PI),r.scale.set(s,l,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 $(new Promise(r=>{let i=this.context.control.target.clone(),s=t.getPosition();this.timer.requestAnimationFrame(()=>{let{clientSize:{width:l,height:u},camera:a}=this.context,p=_(s,a,l,u).x-l/2,d=new oe.Vector3;d.setFromMatrixColumn(this.context.camera.matrix,0),d.normalize(),d.multiplyScalar(p/this.context.camera.zoom),i.add(d),this.context.setCameraPosition(i,e).then(r)})}),e+500)}getElementDeviceCoordinate(t){let e=t.position.clone(),{clientWidth:r,clientHeight:i}=this.container;return _(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,Hn.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 It(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 Nt(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){return this.context.currentFloor?.poiLayer.removePoiById(t)}getPoiById(t){return this.context.currentFloor?.poiLayer.getPoiById(t)}getPois(){return(this.context.currentFloor?.poiLayer.pois||[]).filter(t=>!t.options.built_in)}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.floorDataMap.clear(),this.buildingGroundMap.clear(),ye(),_e(),be(),this.unRegistryEvent()}};var Xn=require("three"),q=class extends Xn.EventDispatcher{bmap;constructor(n){super(),this.bmap=n}dispose(){}};var Be=class extends q{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(s=>[s.equipment_id,s]))}),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)})}};function ze(o){let n=new Blob([o],{type:"text/javascript"}),t=URL.createObjectURL(n),e=new Worker(t);return URL.revokeObjectURL(t),e}function ke(){return ze(`var O1=Object.create;var Rf=Object.defineProperty;var D1=Object.getOwnPropertyDescriptor;var F1=Object.getOwnPropertyNames,cm=Object.getOwnPropertySymbols,U1=Object.getPrototypeOf,fm=Object.prototype.hasOwnProperty,B1=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,bl=(r,t)=>{for(var e in t||(t={}))fm.call(t,e)&&If(r,e,t[e]);if(cm)for(var e of cm(t))B1.call(t,e)&&If(r,e,t[e]);return r};var Jt=(r,t)=>()=>(t||r((t={exports:{}}).exports,t),t.exports);var z1=(r,t,e,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of F1(t))!fm.call(r,a)&&a!==e&&Rf(r,a,{get:()=>t[a],enumerable:!(o=D1(t,a))||o.enumerable});return r};var On=(r,t,e)=>(e=r!=null?O1(U1(r)):{},z1(t||!r||!r.__esModule?Rf(e,"default",{value:r,enumerable:!0}):e,r));var si=(r,t,e)=>If(r,typeof t!="symbol"?t+"":t,e);var e0=Jt((pR,t0)=>{t0.exports=function(t,e){return t[0]=e[0],t[1]=e[1],t}});var i0=Jt((dR,r0)=>{var n0=e0();r0.exports=function(r,t){Array.isArray(t)||(t=[]),r.length>0&&t.push(n0([0,0],r[0]));for(var e=0;e<r.length-1;e++){var o=r[e],a=r[e+1],l=o[0],f=o[1],h=a[0],p=a[1],d=[.75*l+.25*h,.75*f+.25*p],g=[.25*l+.75*h,.25*f+.75*p];t.push(d),t.push(g)}return r.length>1&&t.push(n0([0,0],r[r.length-1])),t}});var gc=Jt((ER,a0)=>{"use strict";var s0=Object.getOwnPropertySymbols,kb=Object.prototype.hasOwnProperty,Gb=Object.prototype.propertyIsEnumerable;function Vb(r){if(r==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(r)}function Hb(){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}}a0.exports=Hb()?Object.assign:function(r,t){for(var e,o=Vb(r),a,l=1;l<arguments.length;l++){e=Object(arguments[l]);for(var f in e)kb.call(e,f)&&(o[f]=e[f]);if(s0){a=s0(e);for(var h=0;h<a.length;h++)Gb.call(e,a[h])&&(o[a[h]]=e[a[h]])}}return o}});var rp=Jt((ep,np)=>{(function(r,t){typeof ep=="object"&&typeof np!="undefined"?np.exports=t():typeof define=="function"&&define.amd?define(t):(r=r||self).RBush=t()})(ep,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 u0=Jt((ip,op)=>{(function(r,t){typeof ip=="object"&&typeof op!="undefined"?op.exports=t():typeof define=="function"&&define.amd?define(t):(r=r||self,r.TinyQueue=t())})(ip,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 c0=Jt((AR,l0)=>{l0.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 h0=Jt((CR,f0)=>{f0.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 m0=Jt((PR,_c)=>{var p0=c0(),d0=h0();_c.exports=function(t,e,o,a){return e.length>0&&Array.isArray(e[0])?d0(t,e,o,a):p0(t,e,o,a)};_c.exports.nested=d0;_c.exports.flat=p0});var y0=Jt((xc,g0)=>{(function(r,t){typeof xc=="object"&&typeof g0!="undefined"?t(xc):typeof define=="function"&&define.amd?define(["exports"],t):t((r=r||self).predicates={})})(xc,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 S0=Jt((IR,lp)=>{"use strict";var v0=rp(),Mc=u0(),qb=m0(),Xb=y0().orient2d;Mc.default&&(Mc=Mc.default);lp.exports=M0;lp.exports.default=M0;function M0(r,t,e){t=Math.max(0,t===void 0?2:t),e=e||0;var o=Kb(r),a=new v0(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=E0(p,h),l.push(h)}var d=new v0(16);for(f=0;f<l.length;f++)d.insert(sp(l[f]));for(var g=t*t,_=e*e;l.length;){var y=l.shift(),M=y.p,w=y.next.p,T=ap(M,w);if(!(T<_)){var x=T/g;p=Yb(a,y.prev.p,M,w,y.next.next.p,x,d),p&&Math.min(ap(p,M),ap(p,w))<=x&&(l.push(y),l.push(E0(p,y)),a.remove(p),d.remove(y),d.insert(sp(y)),d.insert(sp(y.next)))}}y=h;var v=[];do v.push(y.p),y=y.next;while(y!==h);return v.push(y.p),v}function Yb(r,t,e,o,a,l,f){for(var h=new Mc([],Zb),p=r.data;p;){for(var d=0;d<p.children.length;d++){var g=p.children[d],_=p.leaf?up(g,e,o):Jb(e,o,g);_>l||h.push({node:g,dist:_})}for(;h.length&&!h.peek().node.children;){var y=h.pop(),M=y.node,w=up(M,t,e),T=up(M,o,a);if(y.dist<w&&y.dist<T&&x0(e,M,f)&&x0(o,M,f))return M}p=h.pop(),p&&(p=p.node)}return null}function Zb(r,t){return r.dist-t.dist}function Jb(r,t,e){if(_0(r,e)||_0(t,e))return 0;var o=Ec(r[0],r[1],t[0],t[1],e.minX,e.minY,e.maxX,e.minY);if(o===0)return 0;var a=Ec(r[0],r[1],t[0],t[1],e.minX,e.minY,e.minX,e.maxY);if(a===0)return 0;var l=Ec(r[0],r[1],t[0],t[1],e.maxX,e.minY,e.maxX,e.maxY);if(l===0)return 0;var f=Ec(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 _0(r,t){return r[0]>=t.minX&&r[0]<=t.maxX&&r[1]>=t.minY&&r[1]<=t.maxY}function x0(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($b(h[p].p,h[p].next.p,r,t))return!1;return!0}function Za(r,t,e){return Xb(r[0],r[1],t[0],t[1],e[0],e[1])}function $b(r,t,e,o){return r!==o&&t!==e&&Za(r,t,e)>0!=Za(r,t,o)>0&&Za(e,o,r)>0!=Za(e,o,t)>0}function sp(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 Kb(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++)qb(r[l],h)||p.push(r[l]);return Qb(p)}function E0(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 ap(r,t){var e=r[0]-t[0],o=r[1]-t[1];return e*e+o*o}function up(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 Ec(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 jb(r,t){return r[0]===t[0]?r[1]-t[1]:r[0]-t[0]}function Qb(r){r.sort(jb);for(var t=[],e=0;e<r.length;e++){for(;t.length>=2&&Za(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&&Za(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 P0=Jt((fp,hp)=>{(function(r,t){typeof fp=="object"&&typeof hp!="undefined"?hp.exports=t():typeof define=="function"&&define.amd?define(t):r.quickselect=t()})(fp,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 gp=Jt((n2,mp)=>{"use strict";mp.exports=Wu;mp.exports.default=Wu;var hT=P0();function Wu(r,t){if(!(this instanceof Wu))return new Wu(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()}Wu.prototype={all:function(){return this._all(this.data,[])},search:function(r){var t=this.data,e=[],o=this.toBBox;if(!wc(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,wc(r,p)&&(t.leaf?e.push(h):dp(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(!wc(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,wc(r,h)){if(t.leaf||dp(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=Ka([]),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=pT(r,e.children,t),p!==-1))return e.children.splice(p,1),a.push(e),this._condense(a),this;!d&&!e.leaf&&dp(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:I0,compareMinY:R0,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=Ka(r.slice(t,e+1)),$a(f,this.toBBox),f;o||(o=Math.ceil(Math.log(a)/Math.log(l)),l=Math.ceil(a/Math.pow(l,o-1))),f=Ka([]),f.leaf=!1,f.height=o;var h=Math.ceil(a/l),p=h*Math.ceil(Math.sqrt(l)),d,g,_,y;for(L0(r,t,e,p,this.compareMinX),d=t;d<=e;d+=p)for(_=Math.min(d+p-1,e),L0(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 $a(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=pp(f),d=dT(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),Hu(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=Ka(e.children.splice(l,e.children.length-l));f.height=e.height,f.leaf=e.leaf,$a(e,this.toBBox),$a(f,this.toBBox),t?r[t-1].children.push(f):this._splitRoot(e,f)},_splitRoot:function(r,t){this.data=Ka([r,t]),this.data.height=r.height+1,this.data.leaf=!1,$a(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=Vu(r,0,o,this.toBBox),l=Vu(r,o,e,this.toBBox),f=mT(a,l),h=pp(a)+pp(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:I0,a=r.leaf?this.compareMinY:R0,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=Vu(r,0,t,a),f=Vu(r,e-t,e,a),h=Sc(l)+Sc(f),p,d;for(p=t;p<e-t;p++)d=r.children[p],Hu(l,r.leaf?a(d):d),h+=Sc(l);for(p=e-t-1;p>=t;p--)d=r.children[p],Hu(f,r.leaf?a(d):d),h+=Sc(f);return h},_adjustParentBBoxes:function(r,t,e){for(var o=e;o>=0;o--)Hu(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():$a(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 pT(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 $a(r,t){Vu(r,0,r.children.length,t,r)}function Vu(r,t,e,o,a){a||(a=Ka(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],Hu(a,r.leaf?o(f):f);return a}function Hu(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 I0(r,t){return r.minX-t.minX}function R0(r,t){return r.minY-t.minY}function pp(r){return(r.maxX-r.minX)*(r.maxY-r.minY)}function Sc(r){return r.maxX-r.minX+(r.maxY-r.minY)}function dT(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 mT(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 dp(r,t){return r.minX<=t.minX&&r.minY<=t.minY&&t.maxX<=r.maxX&&t.maxY<=r.maxY}function wc(r,t){return t.minX<=r.maxX&&t.minY<=r.maxY&&t.maxX>=r.minX&&t.maxY>=r.minY}function Ka(r){return{children:r,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function L0(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,hT(r,f,t,e,a),l.push(t,f,f,e))}});var B0=Jt((mO,Mp)=>{"use strict";Mp.exports=Cc;Mp.exports.default=Cc;function Cc(r,t,e){e=e||2;var o=t&&t.length,a=o?t[0]*e:r.length,l=D0(r,0,a,e,!0),f=[];if(!l||l.next===l.prev)return f;var h,p,d,g,_,y,M;if(o&&(l=bT(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 Yu(l,f,e,h,p,M,0),f}function D0(r,t,e,o,a){var l,f;if(a===Ep(r,t,e,o)>0)for(l=t;l<e;l+=o)f=O0(l,r[l],r[l+1],f);else for(l=e-o;l>=t;l-=o)f=O0(l,r[l],r[l+1],f);return f&&Pc(f,f.next)&&(Ju(f),f=f.next),f}function Ks(r,t){if(!r)return r;t||(t=r);var e=r,o;do if(o=!1,!e.steiner&&(Pc(e,e.next)||Un(e.prev,e,e.next)===0)){if(Ju(e),e=t=e.prev,e===e.next)break;o=!0}else e=e.next;while(o||e!==t);return t}function Yu(r,t,e,o,a,l,f){if(r){!f&&l&&IT(r,o,a,l);for(var h=r,p,d;r.prev!==r.next;){if(p=r.prev,d=r.next,l?MT(r,o,a,l):ET(r)){t.push(p.i/e|0),t.push(r.i/e|0),t.push(d.i/e|0),Ju(r),r=d.next,h=d.next;continue}if(r=d,r===h){f?f===1?(r=ST(Ks(r),t,e),Yu(r,t,e,o,a,l,2)):f===2&&wT(r,t,e,o,a,l):Yu(Ks(r),t,e,o,a,l,1);break}}}}function ET(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&&tu(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 MT(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=_p(M,w,t,e,o),C=_p(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&&tu(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&&tu(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&&tu(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&&tu(h,g,p,_,d,y,O.x,O.y)&&Un(O.prev,O,O.next)>=0)return!1;O=O.nextZ}return!0}function ST(r,t,e){var o=r;do{var a=o.prev,l=o.next.next;!Pc(a,l)&&F0(a,o,o.next,l)&&Zu(a,l)&&Zu(l,a)&&(t.push(a.i/e|0),t.push(o.i/e|0),t.push(l.i/e|0),Ju(o),Ju(o.next),o=r=l),o=o.next}while(o!==r);return Ks(o)}function wT(r,t,e,o,a,l){var f=r;do{for(var h=f.next.next;h!==f.prev;){if(f.i!==h.i&&NT(f,h)){var p=U0(f,h);f=Ks(f,f.next),p=Ks(p,p.next),Yu(f,t,e,o,a,l,0),Yu(p,t,e,o,a,l,0);return}h=h.next}f=f.next}while(f!==r)}function bT(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=D0(r,h,p,o,!1),d===d.next&&(d.steiner=!0),a.push(LT(d));for(a.sort(TT),l=0;l<a.length;l++)e=AT(a[l],e);return e}function TT(r,t){return r.x-t.x}function AT(r,t){var e=CT(r,t);if(!e)return t;var o=U0(e,r);return Ks(o,o.next),Ks(e,e.next)}function CT(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&&tu(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),Zu(e,r)&&(y<_||y===_&&(e.x>f.x||e.x===f.x&&PT(f,e)))&&(f=e,_=y)),e=e.next;while(e!==p);return f}function PT(r,t){return Un(r.prev,r,t.prev)<0&&Un(t.next,r,r.next)<0}function IT(r,t,e,o){var a=r;do a.z===0&&(a.z=_p(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,RT(a)}function RT(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 _p(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 LT(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 tu(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 NT(r,t){return r.next.i!==t.i&&r.prev.i!==t.i&&!OT(r,t)&&(Zu(r,t)&&Zu(t,r)&&DT(r,t)&&(Un(r.prev,r,t.prev)||Un(r,t.prev,t))||Pc(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 Pc(r,t){return r.x===t.x&&r.y===t.y}function F0(r,t,e,o){var a=Ac(Un(r,t,e)),l=Ac(Un(r,t,o)),f=Ac(Un(e,o,r)),h=Ac(Un(e,o,t));return!!(a!==l&&f!==h||a===0&&Tc(r,e,t)||l===0&&Tc(r,o,t)||f===0&&Tc(e,r,o)||h===0&&Tc(e,t,o))}function Tc(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 Ac(r){return r>0?1:r<0?-1:0}function OT(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&&F0(e,e.next,r,t))return!0;e=e.next}while(e!==r);return!1}function Zu(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 DT(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 U0(r,t){var e=new xp(r.i,r.x,r.y),o=new xp(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 O0(r,t,e,o){var a=new xp(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 Ju(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 xp(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}Cc.deviation=function(r,t,e,o){var a=t&&t.length,l=a?t[0]*e:r.length,f=Math.abs(Ep(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(Ep(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 Ep(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}Cc.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 Ap=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 _s(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=_s;function UT(r,t,e){switch(e===void 0&&(e={}),r){case"Point":return Sp(t).geometry;case"LineString":return bp(t).geometry;case"Polygon":return wp(t).geometry;case"MultiPoint":return k0(t).geometry;case"MultiLineString":return z0(t).geometry;case"MultiPolygon":return G0(t).geometry;default:throw new Error(r+" is invalid")}}ue.geometry=UT;function Sp(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(!Ic(r[0])||!Ic(r[1]))throw new Error("coordinates must contain numbers");var o={type:"Point",coordinates:r};return _s(o,t,e)}ue.point=Sp;function BT(r,t,e){return e===void 0&&(e={}),Rc(r.map(function(o){return Sp(o,t)}),e)}ue.points=BT;function wp(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 _s(h,t,e)}ue.polygon=wp;function zT(r,t,e){return e===void 0&&(e={}),Rc(r.map(function(o){return wp(o,t)}),e)}ue.polygons=zT;function bp(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 _s(o,t,e)}ue.lineString=bp;function kT(r,t,e){return e===void 0&&(e={}),Rc(r.map(function(o){return bp(o,t)}),e)}ue.lineStrings=kT;function Rc(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=Rc;function z0(r,t,e){e===void 0&&(e={});var o={type:"MultiLineString",coordinates:r};return _s(o,t,e)}ue.multiLineString=z0;function k0(r,t,e){e===void 0&&(e={});var o={type:"MultiPoint",coordinates:r};return _s(o,t,e)}ue.multiPoint=k0;function G0(r,t,e){e===void 0&&(e={});var o={type:"MultiPolygon",coordinates:r};return _s(o,t,e)}ue.multiPolygon=G0;function GT(r,t,e){e===void 0&&(e={});var o={type:"GeometryCollection",geometries:r};return _s(o,t,e)}ue.geometryCollection=GT;function VT(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=VT;function V0(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=V0;function Tp(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=Tp;function HT(r,t){return H0(Tp(r,t))}ue.lengthToDegrees=HT;function WT(r){var t=r%360;return t<0&&(t+=360),t}ue.bearingToAzimuth=WT;function H0(r){var t=r%(2*Math.PI);return t*180/Math.PI}ue.radiansToDegrees=H0;function qT(r){var t=r%360;return t*Math.PI/180}ue.degreesToRadians=qT;function XT(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 V0(Tp(r,t),e)}ue.convertLength=XT;function YT(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=YT;function Ic(r){return!isNaN(r)&&r!==null&&!Array.isArray(r)}ue.isNumber=Ic;function ZT(r){return!!r&&r.constructor===Object}ue.isObject=ZT;function JT(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(!Ic(t))throw new Error("bbox must only contain numbers")})}ue.validateBBox=JT;function $T(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=$T});var Pp=Jt(ir=>{"use strict";Object.defineProperty(ir,"__esModule",{value:!0});var Gr=Ap();function $u(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($u(f.geometries[o],t,e)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function KT(r,t,e,o){var a=e;return $u(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 W0(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 jT(r,t,e){var o=e;return W0(r,function(a,l){l===0&&e===void 0?o=a:o=t(o,a,l)}),o}function q0(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 QT(r,t,e){var o=e;return q0(r,function(a,l){l===0&&e===void 0?o=a:o=t(o,a,l)}),o}function tA(r){var t=[];return $u(r,function(e){t.push(e)}),t}function Cp(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 eA(r,t,e){var o=e;return Cp(r,function(a,l,f,h,p){l===0&&e===void 0?o=a:o=t(o,a,l,f,h,p)}),o}function Lc(r,t){Cp(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 nA(r,t,e){var o=e;return Lc(r,function(a,l,f){l===0&&f===0&&e===void 0?o=a:o=t(o,a,l,f)}),o}function X0(r,t){Lc(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($u(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 rA(r,t,e){var o=e,a=!1;return X0(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 Y0(r,t){if(!r)throw new Error("geojson is required");Lc(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 iA(r,t,e){var o=e;return Y0(r,function(a,l,f,h){l===0&&e===void 0?o=a:o=t(o,a,l,f,h)}),o}function oA(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 sA(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=tA;ir.coordEach=$u;ir.coordReduce=KT;ir.featureEach=q0;ir.featureReduce=QT;ir.findPoint=sA;ir.findSegment=oA;ir.flattenEach=Lc;ir.flattenReduce=nA;ir.geomEach=Cp;ir.geomReduce=eA;ir.lineEach=Y0;ir.lineReduce=iA;ir.propEach=W0;ir.propReduce=jT;ir.segmentEach=X0;ir.segmentReduce=rA});var Z0=Jt(Rp=>{"use strict";Object.defineProperty(Rp,"__esModule",{value:!0});var aA=Pp();function Ip(r){var t=[1/0,1/0,-1/0,-1/0];return aA.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}Ip.default=Ip;Rp.default=Ip});var Nc=Jt((RO,Lp)=>{var mo=rp(),$0=Ap(),K0=Pp(),eu=Z0().default,uA=K0.featureEach,PO=K0.coordEach,IO=$0.polygon,J0=$0.featureCollection;function j0(r){var t=new mo(r);return t.insert=function(e){if(e.type!=="Feature")throw new Error("invalid feature");return e.bbox=e.bbox?e.bbox:eu(e),mo.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:eu(a),o.push(a)}):uA(e,function(a){if(a.type!=="Feature")throw new Error("invalid features");a.bbox=a.bbox?a.bbox:eu(a),o.push(a)}),mo.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:eu(e),mo.prototype.remove.call(this,e,o)},t.clear=function(){return mo.prototype.clear.call(this)},t.search=function(e){var o=mo.prototype.search.call(this,this.toBBox(e));return J0(o)},t.collides=function(e){return mo.prototype.collides.call(this,this.toBBox(e))},t.all=function(){var e=mo.prototype.all.call(this);return J0(e)},t.toJSON=function(){return mo.prototype.toJSON.call(this)},t.fromJSON=function(e){return mo.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=eu(e);else if(e.type==="FeatureCollection")o=eu(e);else throw new Error("invalid geojson");return{minX:o[0],minY:o[1],maxX:o[2],maxY:o[3]}},t}Lp.exports=j0;Lp.exports.default=j0});var Bp=Jt((k3,uy)=>{"use strict";var ay=Object.prototype.toString;uy.exports=function(t){var e=ay.call(t),o=e==="[object Arguments]";return o||(o=e!=="[object Array]"&&t!==null&&typeof t=="object"&&typeof t.length=="number"&&t.length>=0&&ay.call(t.callee)==="[object Function]"),o}});var yy=Jt((G3,gy)=>{"use strict";var my;Object.keys||(Qu=Object.prototype.hasOwnProperty,zp=Object.prototype.toString,ly=Bp(),kp=Object.prototype.propertyIsEnumerable,cy=!kp.call({toString:null},"toString"),fy=kp.call(function(){},"prototype"),tl=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],Bc=function(r){var t=r.constructor;return t&&t.prototype===r},hy={$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},py=function(){if(typeof window=="undefined")return!1;for(var r in window)try{if(!hy["$"+r]&&Qu.call(window,r)&&window[r]!==null&&typeof window[r]=="object")try{Bc(window[r])}catch(t){return!0}}catch(t){return!0}return!1}(),dy=function(r){if(typeof window=="undefined"||!py)return Bc(r);try{return Bc(r)}catch(t){return!1}},my=function(t){var e=t!==null&&typeof t=="object",o=zp.call(t)==="[object Function]",a=ly(t),l=e&&zp.call(t)==="[object String]",f=[];if(!e&&!o&&!a)throw new TypeError("Object.keys called on a non-object");var h=fy&&o;if(l&&t.length>0&&!Qu.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")&&Qu.call(t,g)&&f.push(String(g));if(cy)for(var _=dy(t),y=0;y<tl.length;++y)!(_&&tl[y]==="constructor")&&Qu.call(t,tl[y])&&f.push(tl[y]);return f});var Qu,zp,ly,kp,cy,fy,tl,Bc,hy,py,dy;gy.exports=my});var Gp=Jt((V3,xy)=>{"use strict";var vA=Array.prototype.slice,_A=Bp(),vy=Object.keys,zc=vy?function(t){return vy(t)}:yy(),_y=Object.keys;zc.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 _A(o)?_y(vA.call(o)):_y(o)})}else Object.keys=zc;return Object.keys||zc};xy.exports=zc});var Vp=Jt((H3,Ey)=>{"use strict";Ey.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 kc=Jt((W3,My)=>{"use strict";var xA=Vp();My.exports=function(){return xA()&&!!Symbol.toStringTag}});var by=Jt((q3,wy)=>{"use strict";var Sy=typeof Symbol!="undefined"&&Symbol,EA=Vp();wy.exports=function(){return typeof Sy!="function"||typeof Symbol!="function"||typeof Sy("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:EA()}});var Cy=Jt((X3,Ay)=>{"use strict";var Ty={foo:{}},MA=Object;Ay.exports=function(){return{__proto__:Ty}.foo===Ty.foo&&!({__proto__:null}instanceof MA)}});var Ry=Jt((Y3,Iy)=>{"use strict";var SA="Function.prototype.bind called on incompatible ",wA=Object.prototype.toString,bA=Math.max,TA="[object Function]",Py=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},AA=function(t,e){for(var o=[],a=e||0,l=0;a<t.length;a+=1,l+=1)o[l]=t[a];return o},CA=function(r,t){for(var e="",o=0;o<r.length;o+=1)e+=r[o],o+1<r.length&&(e+=t);return e};Iy.exports=function(t){var e=this;if(typeof e!="function"||wA.apply(e)!==TA)throw new TypeError(SA+e);for(var o=AA(arguments,1),a,l=function(){if(this instanceof a){var g=e.apply(this,Py(o,arguments));return Object(g)===g?g:this}return e.apply(t,Py(o,arguments))},f=bA(0,e.length-o.length),h=[],p=0;p<f;p++)h[p]="$"+p;if(a=Function("binder","return function ("+CA(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 Gc=Jt((Z3,Ly)=>{"use strict";var PA=Ry();Ly.exports=Function.prototype.bind||PA});var Oy=Jt((J3,Ny)=>{"use strict";var IA=Function.prototype.call,RA=Object.prototype.hasOwnProperty,LA=Gc();Ny.exports=LA.call(IA,RA)});var ta=Jt(($3,zy)=>{"use strict";var tn,ou=SyntaxError,By=Function,iu=TypeError,Hp=function(r){try{return By('"use strict"; return ('+r+").constructor;")()}catch(t){}},js=Object.getOwnPropertyDescriptor;if(js)try{js({},"")}catch(r){js=null}var Wp=function(){throw new iu},NA=js?function(){try{return arguments.callee,Wp}catch(r){try{return js(arguments,"callee").get}catch(t){return Wp}}}():Wp,nu=by()(),OA=Cy()(),vr=Object.getPrototypeOf||(OA?function(r){return r.__proto__}:null),ru={},DA=typeof Uint8Array=="undefined"||!vr?tn:vr(Uint8Array),Qs={"%AggregateError%":typeof AggregateError=="undefined"?tn:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer=="undefined"?tn:ArrayBuffer,"%ArrayIteratorPrototype%":nu&&vr?vr([][Symbol.iterator]()):tn,"%AsyncFromSyncIteratorPrototype%":tn,"%AsyncFunction%":ru,"%AsyncGenerator%":ru,"%AsyncGeneratorFunction%":ru,"%AsyncIteratorPrototype%":ru,"%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%":By,"%GeneratorFunction%":ru,"%Int8Array%":typeof Int8Array=="undefined"?tn:Int8Array,"%Int16Array%":typeof Int16Array=="undefined"?tn:Int16Array,"%Int32Array%":typeof Int32Array=="undefined"?tn:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":nu&&vr?vr(vr([][Symbol.iterator]())):tn,"%JSON%":typeof JSON=="object"?JSON:tn,"%Map%":typeof Map=="undefined"?tn:Map,"%MapIteratorPrototype%":typeof Map=="undefined"||!nu||!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"||!nu||!vr?tn:vr(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer=="undefined"?tn:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":nu&&vr?vr(""[Symbol.iterator]()):tn,"%Symbol%":nu?Symbol:tn,"%SyntaxError%":ou,"%ThrowTypeError%":NA,"%TypedArray%":DA,"%TypeError%":iu,"%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){Dy=vr(vr(r)),Qs["%Error.prototype%"]=Dy}var Dy,FA=function r(t){var e;if(t==="%AsyncFunction%")e=Hp("async function () {}");else if(t==="%GeneratorFunction%")e=Hp("function* () {}");else if(t==="%AsyncGeneratorFunction%")e=Hp("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 Qs[t]=e,e},Fy={"%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"]},el=Gc(),Vc=Oy(),UA=el.call(Function.call,Array.prototype.concat),BA=el.call(Function.apply,Array.prototype.splice),Uy=el.call(Function.call,String.prototype.replace),Hc=el.call(Function.call,String.prototype.slice),zA=el.call(Function.call,RegExp.prototype.exec),kA=/[^%.[\\]]+|\\[(?:(-?\\d+(?:\\.\\d+)?)|(["'])((?:(?!\\2)[^\\\\]|\\\\.)*?)\\2)\\]|(?=(?:\\.|\\[\\])(?:\\.|\\[\\]|%$))/g,GA=/\\\\(\\\\)?/g,VA=function(t){var e=Hc(t,0,1),o=Hc(t,-1);if(e==="%"&&o!=="%")throw new ou("invalid intrinsic syntax, expected closing \`%\`");if(o==="%"&&e!=="%")throw new ou("invalid intrinsic syntax, expected opening \`%\`");var a=[];return Uy(t,kA,function(l,f,h,p){a[a.length]=h?Uy(p,GA,"$1"):f||l}),a},HA=function(t,e){var o=t,a;if(Vc(Fy,o)&&(a=Fy[o],o="%"+a[0]+"%"),Vc(Qs,o)){var l=Qs[o];if(l===ru&&(l=FA(o)),typeof l=="undefined"&&!e)throw new iu("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:a,name:o,value:l}}throw new ou("intrinsic "+t+" does not exist!")};zy.exports=function(t,e){if(typeof t!="string"||t.length===0)throw new iu("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof e!="boolean")throw new iu('"allowMissing" argument must be a boolean');if(zA(/^%?[^%]*%?$/,t)===null)throw new ou("\`%\` may not be present anywhere but at the beginning and end of the intrinsic name");var o=VA(t),a=o.length>0?o[0]:"",l=HA("%"+a+"%",e),f=l.name,h=l.value,p=!1,d=l.alias;d&&(a=d[0],BA(o,UA([0,1],d)));for(var g=1,_=!0;g<o.length;g+=1){var y=o[g],M=Hc(y,0,1),w=Hc(y,-1);if((M==='"'||M==="'"||M==="\`"||w==='"'||w==="'"||w==="\`")&&M!==w)throw new ou("property names with quotes must have matching quotes");if((y==="constructor"||!_)&&(p=!0),a+="."+y,f="%"+a+"%",Vc(Qs,f))h=Qs[f];else if(h!=null){if(!(y in h)){if(!e)throw new iu("base intrinsic for "+t+" exists, but the property is not available.");return}if(js&&g+1>=o.length){var T=js(h,y);_=!!T,_&&"get"in T&&!("originalValue"in T.get)?h=T.get:h=h[y]}else _=Vc(h,y),h=h[y];_&&!p&&(Qs[f]=h)}}return h}});var nl=Jt((K3,ky)=>{"use strict";var WA=ta(),qp=WA("%Object.defineProperty%",!0),Xp=function(){if(qp)try{return qp({},"a",{value:1}),!0}catch(t){return!1}return!1};Xp.hasArrayLengthDefineBug=function(){if(!Xp())return null;try{return qp([],"length",{value:1}).length!==1}catch(t){return!0}};ky.exports=Xp});var Yp=Jt((j3,Gy)=>{"use strict";var qA=ta(),Wc=qA("%Object.getOwnPropertyDescriptor%",!0);if(Wc)try{Wc([],"length")}catch(r){Wc=null}Gy.exports=Wc});var qc=Jt((Q3,Hy)=>{"use strict";var XA=nl()(),Zp=ta(),rl=XA&&Zp("%Object.defineProperty%",!0);if(rl)try{rl({},"a",{value:1})}catch(r){rl=!1}var YA=Zp("%SyntaxError%"),su=Zp("%TypeError%"),Vy=Yp();Hy.exports=function(t,e,o){if(!t||typeof t!="object"&&typeof t!="function")throw new su("\`obj\` must be an object or a function\`");if(typeof e!="string"&&typeof e!="symbol")throw new su("\`property\` must be a string or a symbol\`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new su("\`nonEnumerable\`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new su("\`nonWritable\`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new su("\`nonConfigurable\`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new su("\`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=!!Vy&&Vy(t,e);if(rl)rl(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 YA("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")}});var Jy=Jt((tF,Zy)=>{"use strict";var Yy=ta(),Wy=qc(),ZA=nl()(),qy=Yp(),Xy=Yy("%TypeError%"),JA=Yy("%Math.floor%");Zy.exports=function(t,e){if(typeof t!="function")throw new Xy("\`fn\` is not a function");if(typeof e!="number"||e<0||e>4294967295||JA(e)!==e)throw new Xy("\`length\` must be a positive 32-bit integer");var o=arguments.length>2&&!!arguments[2],a=!0,l=!0;if("length"in t&&qy){var f=qy(t,"length");f&&!f.configurable&&(a=!1),f&&!f.writable&&(l=!1)}return(a||l||!o)&&(ZA?Wy(t,"length",e,!0,!0):Wy(t,"length",e)),t}});var Yc=Jt((eF,Xc)=>{"use strict";var Jp=Gc(),au=ta(),$A=Jy(),KA=au("%TypeError%"),Ky=au("%Function.prototype.apply%"),jy=au("%Function.prototype.call%"),Qy=au("%Reflect.apply%",!0)||Jp.call(jy,Ky),il=au("%Object.defineProperty%",!0),jA=au("%Math.max%");if(il)try{il({},"a",{value:1})}catch(r){il=null}Xc.exports=function(t){if(typeof t!="function")throw new KA("a function is required");var e=Qy(Jp,jy,arguments);return $A(e,1+jA(0,t.length-(arguments.length-1)),!0)};var $y=function(){return Qy(Jp,Ky,arguments)};il?il(Xc.exports,"apply",{value:$y}):Xc.exports.apply=$y});var $p=Jt((nF,nv)=>{"use strict";var tv=ta(),ev=Yc(),QA=ev(tv("String.prototype.indexOf"));nv.exports=function(t,e){var o=tv(t,!!e);return typeof o=="function"&&QA(t,".prototype.")>-1?ev(o):o}});var ov=Jt((rF,iv)=>{"use strict";var tC=kc()(),eC=$p(),Kp=eC("Object.prototype.toString"),Zc=function(t){return tC&&t&&typeof t=="object"&&Symbol.toStringTag in t?!1:Kp(t)==="[object Arguments]"},rv=function(t){return Zc(t)?!0:t!==null&&typeof t=="object"&&typeof t.length=="number"&&t.length>=0&&Kp(t)!=="[object Array]"&&Kp(t.callee)==="[object Function]"},nC=function(){return Zc(arguments)}();Zc.isLegacyArguments=rv;iv.exports=nC?Zc:rv});var uu=Jt((iF,lv)=>{"use strict";var rC=Gp(),iC=typeof Symbol=="function"&&typeof Symbol("foo")=="symbol",oC=Object.prototype.toString,sC=Array.prototype.concat,sv=qc(),aC=function(r){return typeof r=="function"&&oC.call(r)==="[object Function]"},av=nl()(),uC=function(r,t,e,o){if(t in r){if(o===!0){if(r[t]===e)return}else if(!aC(o)||!o())return}av?sv(r,t,e,!0):sv(r,t,e)},uv=function(r,t){var e=arguments.length>2?arguments[2]:{},o=rC(t);iC&&(o=sC.call(o,Object.getOwnPropertySymbols(t)));for(var a=0;a<o.length;a+=1)uC(r,o[a],t[o[a]],e[o[a]])};uv.supportsDescriptors=!!av;lv.exports=uv});var jp=Jt((oF,fv)=>{"use strict";var cv=function(r){return r!==r};fv.exports=function(t,e){return t===0&&e===0?1/t===1/e:!!(t===e||cv(t)&&cv(e))}});var Qp=Jt((sF,hv)=>{"use strict";var lC=jp();hv.exports=function(){return typeof Object.is=="function"?Object.is:lC}});var dv=Jt((aF,pv)=>{"use strict";var cC=Qp(),fC=uu();pv.exports=function(){var t=cC();return fC(Object,{is:t},{is:function(){return Object.is!==t}}),t}});var vv=Jt((uF,yv)=>{"use strict";var hC=uu(),pC=Yc(),dC=jp(),mv=Qp(),mC=dv(),gv=pC(mv(),Object);hC(gv,{getPolyfill:mv,implementation:dC,shim:mC});yv.exports=gv});var Sv=Jt((lF,Mv)=>{"use strict";var td=$p(),_v=kc()(),xv,Ev,ed,nd;_v&&(xv=td("Object.prototype.hasOwnProperty"),Ev=td("RegExp.prototype.exec"),ed={},Jc=function(){throw ed},nd={toString:Jc,valueOf:Jc},typeof Symbol.toPrimitive=="symbol"&&(nd[Symbol.toPrimitive]=Jc));var Jc,gC=td("Object.prototype.toString"),yC=Object.getOwnPropertyDescriptor,vC="[object RegExp]";Mv.exports=_v?function(t){if(!t||typeof t!="object")return!1;var e=yC(t,"lastIndex"),o=e&&xv(e,"value");if(!o)return!1;try{Ev(t,nd)}catch(a){return a===ed}}:function(t){return!t||typeof t!="object"&&typeof t!="function"?!1:gC(t)===vC}});var bv=Jt((cF,wv)=>{"use strict";var sl=function(){return typeof function(){}.name=="string"},ol=Object.getOwnPropertyDescriptor;if(ol)try{ol([],"length")}catch(r){ol=null}sl.functionsHaveConfigurableNames=function(){if(!sl()||!ol)return!1;var t=ol(function(){},"name");return!!t&&!!t.configurable};var _C=Function.prototype.bind;sl.boundFunctionsHaveNames=function(){return sl()&&typeof _C=="function"&&function(){}.bind().name!==""};wv.exports=sl});var Cv=Jt((fF,Av)=>{"use strict";var Tv=qc(),xC=nl()(),EC=bv().functionsHaveConfigurableNames(),MC=TypeError;Av.exports=function(t,e){if(typeof t!="function")throw new MC("\`fn\` is not a function");var o=arguments.length>2&&!!arguments[2];return(!o||EC)&&(xC?Tv(t,"name",e,!0,!0):Tv(t,"name",e)),t}});var rd=Jt((hF,Pv)=>{"use strict";var SC=Cv(),wC=Object,bC=TypeError;Pv.exports=SC(function(){if(this!=null&&this!==wC(this))throw new bC("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 id=Jt((pF,Iv)=>{"use strict";var TC=rd(),AC=uu().supportsDescriptors,CC=Object.getOwnPropertyDescriptor;Iv.exports=function(){if(AC&&/a/mig.flags==="gim"){var t=CC(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 TC}});var Nv=Jt((dF,Lv)=>{"use strict";var PC=uu().supportsDescriptors,IC=id(),RC=Object.getOwnPropertyDescriptor,LC=Object.defineProperty,NC=TypeError,Rv=Object.getPrototypeOf,OC=/a/;Lv.exports=function(){if(!PC||!Rv)throw new NC("RegExp.prototype.flags requires a true ES5 environment that supports property descriptors");var t=IC(),e=Rv(OC),o=RC(e,"flags");return(!o||o.get!==t)&&LC(e,"flags",{configurable:!0,enumerable:!1,get:t}),t}});var Uv=Jt((mF,Fv)=>{"use strict";var DC=uu(),FC=Yc(),UC=rd(),Ov=id(),BC=Nv(),Dv=FC(Ov());DC(Dv,{getPolyfill:Ov,implementation:UC,shim:BC});Fv.exports=Dv});var zv=Jt((gF,Bv)=>{"use strict";var zC=Date.prototype.getDay,kC=function(t){try{return zC.call(t),!0}catch(e){return!1}},GC=Object.prototype.toString,VC="[object Date]",HC=kc()();Bv.exports=function(t){return typeof t!="object"||t===null?!1:HC?kC(t):GC.call(t)===VC}});var od=Jt((yF,$v)=>{var kv=Gp(),Gv=ov(),Vv=vv(),Hv=Sv(),Wv=Uv(),qv=zv(),Xv=Date.prototype.getTime;function Jv(r,t,e){var o=e||{};return(o.strict?Vv(r,t):r===t)?!0:!r||!t||typeof r!="object"&&typeof t!="object"?o.strict?Vv(r,t):r==t:WC(r,t,o)}function Yv(r){return r==null}function Zv(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 WC(r,t,e){var o,a;if(typeof r!=typeof t||Yv(r)||Yv(t)||r.prototype!==t.prototype||Gv(r)!==Gv(t))return!1;var l=Hv(r),f=Hv(t);if(l!==f)return!1;if(l||f)return r.source===t.source&&Wv(r)===Wv(t);if(qv(r)&&qv(t))return Xv.call(r)===Xv.call(t);var h=Zv(r),p=Zv(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=kv(r),g=kv(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],!Jv(r[a],t[a],e))return!1;return!0}$v.exports=Jv});var yd=Jt((SB,r_)=>{var OP=od(),go=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:DP};go.prototype.compare=function(r,t){if(r.type!==t.type||!n_(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=e_(r),a=e_(t);return o.every(function(l){return this.some(function(f){return e.compare(l,f)})},a)}}return!1};function e_(r){return r.coordinates.map(function(t){return{type:r.type.replace("Multi",""),coordinates:t}})}function n_(r,t){return r.hasOwnProperty("coordinates")?r.coordinates.length===t.coordinates.length:r.length===t.length}go.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};go.prototype.compareLine=function(r,t,e,o){if(!n_(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}};go.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};go.prototype.comparePath=function(r,t){var e=this;return r.every(function(o,a){return e.compareCoord(o,this[a])},t)};go.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};go.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)};go.prototype.compareBBox=function(r,t){return!!(!r.bbox&&!t.bbox||r.bbox&&t.bbox&&this.compareCoord(r.bbox,t.bbox))};go.prototype.removePseudo=function(r){return r};function DP(r,t){return OP(r,t,{strict:!0})}r_.exports=go});var i_=Jt((DB,jc)=>{function Es(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)}Es.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};Es.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)};Es.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)}};Es.prototype._addToCluster=function(r,t){this.clusters[t].push(r),this._assigned[r]=1};Es.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};Es.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};Es.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 jc!="undefined"&&jc.exports&&(jc.exports=Es)});var o_=Jt((FB,Qc)=>{function Ms(r,t,e){this.k=3,this.dataset=[],this.assignments=[],this.centroids=[],this.init(r,t,e)}Ms.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)};Ms.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()};Ms.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};Ms.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};Ms.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};Ms.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};Ms.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 Qc!="undefined"&&Qc.exports&&(Qc.exports=Ms)});var vd=Jt((UB,tf)=>{function yo(r,t,e){this._queue=[],this._priorities=[],this._sorting="desc",this._init(r,t,e)}yo.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)};yo.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}}};yo.prototype.forEach=function(r){this._queue.forEach(r)};yo.prototype.getElements=function(){return this._queue};yo.prototype.getElementPriority=function(r){return this._priorities[r]};yo.prototype.getPriorities=function(){return this._priorities};yo.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};yo.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)};yo.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 tf!="undefined"&&tf.exports&&(tf.exports=yo)});var a_=Jt((BB,cu)=>{typeof cu!="undefined"&&cu.exports&&(s_=vd());var s_;function Jo(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)}Jo.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 s_(null,null,"asc"),p=this._regionQuery(a);this._distanceToCore(a)!==void 0&&(this._updateQueue(a,p,h),this._expandCluster(f,h))}return this.clusters};Jo.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};Jo.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)};Jo.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))}})};Jo.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))}}};Jo.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}};Jo.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};Jo.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 cu!="undefined"&&cu.exports&&(cu.exports=Jo)});var u_=Jt((zB,ef)=>{typeof ef!="undefined"&&ef.exports&&(ef.exports={DBSCAN:i_(),KMEANS:o_(),OPTICS:a_(),PriorityQueue:vd()})});var _d=Jt((qB,c_)=>{"use strict";c_.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 p_=Jt((XB,h_)=>{"use strict";var f_=_d(),GP=f_.eudist,VP=f_.dist;h_.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?GP:VP,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 v_=Jt((JB,y_)=>{"use strict";var xd=_d(),g_=p_(),HP=xd.eudist,YB=xd.mandist,ZB=xd.dist,WP=g_.kmrand,qP=g_.kmpp,d_=1e4;function m_(r,t,e){e=e||[];for(var o=0;o<r;o++)e[o]=t;return e}function XP(r,t,e,o){var a=[],l=[],f=[],h=[],p=!1,d=o||d_,g=r.length,_=r[0].length,y=_>0,M=[];if(e)e=="kmrand"?a=WP(r,t):e=="kmpp"?a=qP(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{m_(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?HP(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?m_(_,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:d_-d,k:t,idxs:f,centroids:a}}y_.exports=XP});var mu=Jt((Td,Ad)=>{(function(r,t){typeof Td=="object"&&typeof Ad!="undefined"?Ad.exports=t():typeof define=="function"&&define.amd?define(t):(r=typeof globalThis!="undefined"?globalThis:r||self,r.polygonClipping=t())})(Td,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($)+\`
39
65
  \`);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&&lt<ct)return 1;if(lt>B&&lt>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&&lt){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 U_=Jt((sf,F_)=>{(function(r,t){typeof sf=="object"&&typeof F_!="undefined"?t(sf):typeof define=="function"&&define.amd?define(["exports"],t):t(r.jsts={})})(sf,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?pi: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":\`
40
66
  \`}[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,Yi=kt.x-Rt.x,Oo=Rt.x*kt.y-kt.x*Rt.y;this.x=on*Oo-Yi*In,this.y=pr*In-ee*Oo,this.w=ee*Yi-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],Yi=arguments[3],Oo=1;pr>Yi&&(Oo=-1);for(var Pf=pr;Pf!==Yi;Pf+=Oo)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 ml(this)},i}(l),ml=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),pi=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:pi,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:pi,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),pi),p(i,pi),p(h(h(n)),1),n=h(h(n))):(n===g(h(n))&&(n=h(n),this.rotateLeft(n)),p(h(n),pi),p(h(h(n)),1),this.rotateRight(h(h(n))))}else{var s=d(h(h(n)));f(s)===1?(p(h(n),pi),p(s,pi),p(h(h(n)),1),n=h(h(n))):(n===d(h(n))&&(n=h(n),this.rotateRight(n)),p(h(n),pi),p(h(h(n)),1),this.rotateLeft(h(h(n))))}this.root_.color=pi},_.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 Ts=function(){};Ts.prototype.interfaces_=function(){return[]},Ts.prototype.getClass=function(){return Ts},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 Eo(this)};var Eo=function(n){this.treeSet_=n,this.position_=0};Eo.prototype.next=function(){if(this.position_===this.treeSet_.size())throw new o;return this.treeSet_.array_[this.position_++]},Eo.prototype.hasNext=function(){return this.position_<this.treeSet_.size()},Eo.prototype.remove=function(){throw new a};var Ui=function(){};Ui.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])},Ui.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();Ui.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(Ui.asList(this._geometries)),m=new M(Ui.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[Ts]},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[Ts]},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);Ui.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 Mo},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 Mo=function(){};Mo.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},Mo.prototype.interfaces_=function(){return[vn.GeometryEditorOperation]},Mo.prototype.getClass=function(){return Mo};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}}},ro={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},ro.serialVersionUID.get=function(){return-0xcb44a778db18e00},Object.defineProperties(he,ro);var ri=function(){},So={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},So.serialVersionUID.get=function(){return-0x38e49fa6cf6f2e00},So.instanceObject.get=function(){return new ri},Object.defineProperties(ri,So);var sa=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}}},Bi={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},Bi.serialVersionUID.get=function(){return 7777263578777804e3},Bi.maximumPreciseValue.get=function(){return 9007199254740992},Object.defineProperties(ie,Bi);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 sa},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]))},gl={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)},gl.serialVersionUID.get=function(){return-6820524753094096e3},Object.defineProperties(le,gl);var yl=["Point","MultiPoint","LineString","MultiLineString","Polygon","MultiPolygon"],vl=function(n){this.geometryFactory=n||new le};vl.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 yl.indexOf(s)!==-1?wi[s].apply(this,[i.coordinates]):s==="GeometryCollection"?wi[s].apply(this,[i.geometries]):wi[s].apply(this,[i])},vl.prototype.write=function(n){var i=n.getGeometryType();if(!io[i])throw new Error("Geometry is not supported");return io[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)}},io={coordinate:function(n){return[n.x,n.y]},Point:function(n){return{type:"Point",coordinates:io.coordinate.apply(this,[n.getCoordinate()])}},MultiPoint:function(n){for(var i=[],s=0;s<n._geometries.length;++s){var u=n._geometries[s],c=io.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(io.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=io.LineString.apply(this,[u]);i.push(c.coordinates)}return{type:"MultiLineString",coordinates:i}},Polygon:function(n){var i=[],s=io.LineString.apply(this,[n._shell]);i.push(s.coordinates);for(var u=0;u<n._holes.length;++u){var c=n._holes[u],m=io.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=io.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(io[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 vl(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 Wd=function(){this.parser=new vl(this.geometryFactory)};Wd.prototype.write=function(n){return this.parser.write(n)};var bt=function(){},_l={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},_l.ON.get=function(){return 0},_l.LEFT.get=function(){return 1},_l.RIGHT.get=function(){return 2},Object.defineProperties(bt,_l),(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 oo=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}($),xl=function(){this.array_=[]};xl.prototype.addLast=function(n){this.array_.push(n)},xl.prototype.removeFirst=function(){return this.array_.shift()},xl.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 oo("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 xl,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 oo("Found null DirectedEdge");if(i.getEdgeRing()===this)throw new oo("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 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.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),C1=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 A1(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 El=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 El){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(){},yu={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}},yu.NE.get=function(){return 0},yu.NW.get=function(){return 1},yu.SW.get=function(){return 2},yu.SE.get=function(){return 3},Object.defineProperties(ln,yu);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 oo("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),aa=function(){};aa.prototype.createNode=function(n){return new El(n,null)},aa.prototype.interfaces_=function(){return[]},aa.prototype.getClass=function(){return aa};var _n=function(){if(this._edges=new j,this._nodes=null,this._edgeEndList=new j,arguments.length===0)this._nodes=new Ti(new aa);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 El){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 oo("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 C1(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 ua=function(){};ua.prototype.getBounds=function(){},ua.prototype.interfaces_=function(){return[]},ua.prototype.getClass=function(){return ua};var di=function(){this._bounds=null,this._item=null;var n=arguments[0],i=arguments[1];this._bounds=n,this._item=i};di.prototype.getItem=function(){return this._item},di.prototype.getBounds=function(){return this._bounds},di.prototype.interfaces_=function(){return[ua,t]},di.prototype.getClass=function(){return di};var so=function(){this._size=null,this._items=null,this._size=0,this._items=new j,this._items.add(null)};so.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},so.prototype.size=function(){return this._size},so.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)},so.prototype.clear=function(){this._size=0,this._items.clear()},so.prototype.isEmpty=function(){return this._size===0},so.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)},so.prototype.interfaces_=function(){return[]},so.prototype.getClass=function(){return so};var wo=function(){};wo.prototype.visitItem=function(n){},wo.prototype.interfaces_=function(){return[]},wo.prototype.getClass=function(){return wo};var As=function(){};As.prototype.insert=function(n,i){},As.prototype.remove=function(n,i){},As.prototype.query=function(){},As.prototype.interfaces_=function(){return[]},As.prototype.getClass=function(){return As};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}}},qd={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[ua,t]},Nn.prototype.getClass=function(){return Nn},qd.serialVersionUID.get=function(){return 6493722185909574e3},Object.defineProperties(Nn,qd);var mi=function(){};mi.reverseOrder=function(){return{compare:function(n,i){return i.compareTo(n)}}},mi.min=function(n){return mi.sort(n),n.get(0)},mi.sort=function(n,i){var s=n.toArray();i?Ui.sort(s,i):Ui.sort(s);for(var u=n.iterator(),c=0,m=s.length;c<m;c++)u.next(),u.set(s[c])},mi.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}},Ml={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 di&&(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 di&&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 di?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 di(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 di),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],wo)&&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 di?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 di?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);mi.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},Ml.IntersectsOp.get=function(){return P1},Ml.serialVersionUID.get=function(){return-3886435814360241e3},Ml.DEFAULT_NODE_CAPACITY.get=function(){return 10},Object.defineProperties(zn,Ml);var P1=function(){},la=function(){};la.prototype.distance=function(n,i){},la.prototype.interfaces_=function(){return[]},la.prototype.getClass=function(){return la};var Xd=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 Yd(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],wo)&&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);mi.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],la)){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],la)){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 so;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 di(ee,on),Yi=new Cn(this.getRoot(),pr,In);return this.nearestNeighbour(Yi)[0]}},i.prototype.interfaces_=function(){return[As,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 Yd},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),Yd=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 bo=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))};bo.prototype.getCoordinate=function(){return this.coord},bo.prototype.print=function(n){n.print(this.coord),n.print(" seg # = "+this.segmentIndex)},bo.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)},bo.prototype.isEndPoint=function(n){return this.segmentIndex===0&&!this._isInterior||this.segmentIndex===n},bo.prototype.isInterior=function(){return this._isInterior},bo.prototype.interfaces_=function(){return[F]},bo.prototype.getClass=function(){return bo};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 bo(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 Cs=function(){};Cs.prototype.interfaces_=function(){return[]},Cs.prototype.getClass=function(){return Cs},Cs.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 Cs.octant(E,A)}};var zi=function(){};zi.prototype.getCoordinates=function(){},zi.prototype.size=function(){},zi.prototype.getCoordinate=function(n){},zi.prototype.isClosed=function(){},zi.prototype.setData=function(n){},zi.prototype.getData=function(){},zi.prototype.interfaces_=function(){return[]},zi.prototype.getClass=function(){return zi};var vu=function(){};vu.prototype.addIntersection=function(n,i){},vu.prototype.interfaces_=function(){return[zi]},vu.prototype.getClass=function(){return vu};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:Cs.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[vu]},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)}},Zd={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)},Zd.serialVersionUID.get=function(){return 0x2d2172135f411c00},Object.defineProperties(Zt,Zd);var _u=function(){this.tempEnv1=new Pt,this.tempEnv2=new Pt,this._overlapSeg1=new Zt,this._overlapSeg2=new Zt};_u.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)}}},_u.prototype.interfaces_=function(){return[]},_u.prototype.getClass=function(){return _u};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 $o=function(){};$o.prototype.computeNodes=function(n){},$o.prototype.getNodedSubstrings=function(){},$o.prototype.interfaces_=function(){return[]},$o.prototype.getClass=function(){return $o};var xu=function(){if(this._segInt=null,arguments.length!==0){if(arguments.length===1){var n=arguments[0];this.setSegmentIntersector(n)}}};xu.prototype.setSegmentIntersector=function(n){this._segInt=n},xu.prototype.interfaces_=function(){return[$o]},xu.prototype.getClass=function(){return xu};var Ef=function(n){function i(u){u?n.call(this,u):n.call(this),this._monoChains=new j,this._index=new Xd,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 Jd(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 Jd},Object.defineProperties(i,s),i}(xu),Jd=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}(_u),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)}}},ao={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)},ao.CAP_ROUND.get=function(){return 1},ao.CAP_FLAT.get=function(){return 2},ao.CAP_SQUARE.get=function(){return 3},ao.JOIN_ROUND.get=function(){return 1},ao.JOIN_MITRE.get=function(){return 2},ao.JOIN_BEVEL.get=function(){return 3},ao.DEFAULT_QUADRANT_SEGMENTS.get=function(){return 8},ao.DEFAULT_MITRE_LIMIT.get=function(){return 5},ao.DEFAULT_SIMPLIFY_FACTOR.get=function(){return .01},Object.defineProperties(We,ao);var Mn=function(n){this._distanceTol=null,this._isDeleted=null,this._angleOrientation=B.COUNTERCLOCKWISE,this._inputLine=n||null},Eu={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)},Eu.INIT.get=function(){return 0},Eu.DELETE.get=function(){return 1},Eu.KEEP.get=function(){return 1},Eu.NUM_PTS_TO_CHECK.get=function(){return 10},Object.defineProperties(Mn,Eu);var Wr=function(){this._ptList=null,this._precisionModel=null,this._minimimVertexDistance=0,this._ptList=new j},$d={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},$d.COORDINATE_ARRAY_TYPE.get=function(){return new Array(0).fill(null)},Object.defineProperties(Wr,$d);var me=function(){},Ps={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},Ps.PI_TIMES_2.get=function(){return 2*Math.PI},Ps.PI_OVER_2.get=function(){return Math.PI/2},Ps.PI_OVER_4.get=function(){return Math.PI/4},Ps.COUNTERCLOCKWISE.get=function(){return B.COUNTERCLOCKWISE},Ps.CLOCKWISE.get=function(){return B.CLOCKWISE},Ps.NONE.get=function(){return B.COLLINEAR},Object.defineProperties(me,Ps);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)},Mu={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},Mu.OFFSET_SEGMENT_SEPARATION_FACTOR.get=function(){return .001},Mu.INSIDE_TURN_VERTEX_SNAP_DISTANCE_FACTOR.get=function(){return .001},Mu.CURVE_VERTEX_SNAP_DISTANCE_FACTOR.get=function(){return 1e-6},Mu.MAX_CLOSING_SEG_LEN_FACTOR.get=function(){return 80},Object.defineProperties(pn,Mu);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 Is=function(){this._subgraphs=null,this._seg=new Zt,this._cga=new B;var n=arguments[0];this._subgraphs=n},Kd={DepthSegment:{configurable:!0}};Is.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 Ko(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)}}},Is.prototype.getDepth=function(n){var i=this.findStabbedSegments(n);return i.size()===0?0:mi.min(i)._leftDepth},Is.prototype.interfaces_=function(){return[]},Is.prototype.getClass=function(){return Is},Kd.DepthSegment.get=function(){return Ko},Object.defineProperties(Is,Kd);var Ko=function(){this._upwardSeg=null,this._leftDepth=null;var n=arguments[0],i=arguments[1];this._upwardSeg=new Zt(n),this._leftDepth=i};Ko.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)},Ko.prototype.compareX=function(n,i){var s=n.p0.compareTo(i.p0);return s!==0?s:n.p1.compareTo(i.p1)},Ko.prototype.toString=function(){return this._upwardSeg.toString()},Ko.prototype.interfaces_=function(){return[F]},Ko.prototype.getClass=function(){return Ko};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 ca=function(){};ca.prototype.locate=function(n){},ca.prototype.interfaces_=function(){return[]},ca.prototype.getClass=function(){return ca};var ki=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()};ki.prototype.next=function(){if(this._atStart)return this._atStart=!1,ki.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 ki(n),this._subcollectionIterator.next()):n},ki.prototype.remove=function(){throw new Error(this.getClass().getName())},ki.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)},ki.prototype.interfaces_=function(){return[Y]},ki.prototype.getClass=function(){return ki},ki.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[ca]},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 ki(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 oo("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(\`
41
67
  \`);for(var i=this.iterator();i.hasNext();){var s=i.next();n.append(s),n.append(\`
@@ -3721,7 +3747,7 @@ three/build/three.module.js:
3721
3747
  * along with MarchingSquaresJS. If not, see <http://www.gnu.org/licenses/>.
3722
3748
  *)
3723
3749
  */
3724
- `)}var S=require("three");var d=require("three"),N=class extends d.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 d.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)}}})}};N.prototype.setMatrixWorld=function(o){this.matrixWorld=o};N.prototype.setGeometry=function(o,n){this._geometry=o,this.setPoints(o.getAttribute("position").array,n)};N.prototype.setPoints=function(o,n){if(!(o instanceof Float32Array)&&!(o instanceof Array)){console.error("ERROR: The BufferArray of points is not instancied correctly.");return}if(this._points=o,this.widthCallback=n,this.positions=[],this.counters=[],o.length&&o[0]instanceof d.Vector3)for(var t=0;t<o.length;t++){var e=o[t],i=t/o.length;this.positions.push(e.x,e.y,e.z),this.positions.push(e.x,e.y,e.z),this.counters.push(i),this.counters.push(i)}else for(var t=0;t<o.length;t+=3){var i=t/o.length;this.positions.push(o[t],o[t+1],o[t+2]),this.positions.push(o[t],o[t+1],o[t+2]),this.counters.push(i),this.counters.push(i)}this.process()};function bi(o,n){var t=new d.Matrix4,e=new d.Ray,i=new d.Sphere,r=new d.Vector3,s=this.geometry;if(s.boundingSphere||s.computeBoundingSphere(),i.copy(s.boundingSphere),i.applyMatrix4(this.matrixWorld),o.ray.intersectSphere(i,r)!==!1){t.copy(this.matrixWorld).invert(),e.copy(o.ray).applyMatrix4(t);var l=new d.Vector3,u=new d.Vector3,a=new d.Vector3,h=this instanceof d.LineSegments?2:1,p=s.index,g=s.attributes;if(p!==null)for(var c=p.array,f=g.position.array,A=g.width.array,m=0,C=c.length-1;m<C;m+=h){var w=c[m],I=c[m+1];l.fromArray(f,w*3),u.fromArray(f,I*3);var M=A[Math.floor(m/3)]!==void 0?A[Math.floor(m/3)]:1,nt=o.params.Line.threshold+this.material.lineWidth*M/2,j=nt*nt,Vt=e.distanceSqToSegment(l,u,r,a);if(!(Vt>j)){r.applyMatrix4(this.matrixWorld);var qt=o.ray.origin.distanceTo(r);qt<o.near||qt>o.far||(n.push({distance:qt,point:a.clone().applyMatrix4(this.matrixWorld),index:m,face:null,faceIndex:null,object:this}),m=C)}}}}N.prototype.raycast=bi;N.prototype.compareV3=function(o,n){var t=o*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]};N.prototype.copyV3=function(o){var n=o*6;return[this.positions[n],this.positions[n+1],this.positions[n+2]]};N.prototype.getDistance=function(o){let n=0;for(let t=0;t<o;t++){let e=6*t,i=new d.Vector3(this.positions[e],this.positions[e+1],this.positions[e+2]),r=new d.Vector3(this.positions[e+6],this.positions[e+7],this.positions[e+8]),s=i.distanceTo(r);n+=s}return n};N.prototype.process=function(){var o=this.positions.length/6;this.previous=[],this.next=[],this.side=[],this.width=[],this.indices_array=[],this.uvs=[];var n;let t=this.getDistance(o-1);var e;this.compareV3(0,o-1)?e=this.copyV3(o-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 i=0;i<o;i++){if(this.side.push(1),this.side.push(-1),this.widthCallback?n=this.widthCallback(i/(o-1)):n=1,this.width.push(n),this.width.push(n),i===0)this.uvs.push(0,0),this.uvs.push(0,1);else if(i===o-1)this.uvs.push(1,0),this.uvs.push(1,1);else{let s=this.getDistance(i)/t;this.uvs.push(s,0),this.uvs.push(s,1)}if(i<o-1){e=this.copyV3(i),this.previous.push(e[0],e[1],e[2]),this.previous.push(e[0],e[1],e[2]);var r=i*2;this.indices_array.push(r,r+1,r+2),this.indices_array.push(r+2,r+1,r+3)}i>0&&(e=this.copyV3(i),this.next.push(e[0],e[1],e[2]),this.next.push(e[0],e[1],e[2]))}this.compareV3(o-1,0)?e=this.copyV3(1):e=this.copyV3(o-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 d.BufferAttribute(new Float32Array(this.positions),3),previous:new d.BufferAttribute(new Float32Array(this.previous),3),next:new d.BufferAttribute(new Float32Array(this.next),3),side:new d.BufferAttribute(new Float32Array(this.side),1),width:new d.BufferAttribute(new Float32Array(this.width),1),uv:new d.BufferAttribute(new Float32Array(this.uvs),2),index:new d.BufferAttribute(new Uint16Array(this.indices_array),1),counters:new d.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 ze(o,n,t,e,i){var r;if(o=o.subarray||o.slice?o:o.buffer,t=t.subarray||t.slice?t:t.buffer,o=n?o.subarray?o.subarray(n,i&&n+i):o.slice(n,i&&n+i):o,t.set)t.set(o,e);else for(r=0;r<o.length;r++)t[r+e]=o[r];return t}N.prototype.advance=function(o){var n=this._attributes.position.array,t=this._attributes.previous.array,e=this._attributes.next.array,i=n.length;ze(n,0,t,0,i),ze(n,6,n,0,i-6),n[i-6]=o.x,n[i-5]=o.y,n[i-4]=o.z,n[i-3]=o.x,n[i-2]=o.y,n[i-1]=o.z,ze(n,6,e,0,i-6),e[i-6]=o.x,e[i-5]=o.y,e[i-4]=o.z,e[i-3]=o.x,e[i-2]=o.y,e[i-1]=o.z,this._attributes.position.needsUpdate=!0,this._attributes.previous.needsUpdate=!0,this._attributes.next.needsUpdate=!0};d.ShaderChunk.meshline_vert=["",d.ShaderChunk.logdepthbuf_pars_vertex,d.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;","",d.ShaderChunk.logdepthbuf_vertex,d.ShaderChunk.fog_vertex&&" vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );",d.ShaderChunk.fog_vertex,"}"].join(`
3725
- `);d.ShaderChunk.meshline_frag=["",d.ShaderChunk.fog_pars_fragment,d.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;","","varying vec2 vUV;","varying vec4 vColor;","varying float vCounters;","","void main() {","",d.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);","",d.ShaderChunk.fog_fragment,"}"].join(`
3726
- `);var Ht=class extends d.ShaderMaterial{constructor(n){super({uniforms:Object.assign({},d.UniformsLib.fog,{lineWidth:{value:1},map:{value:null},useMap:{value:0},alphaMap:{value:null},useAlphaMap:{value:0},color:{value:new d.Color(16777215)},opacity:{value:1},resolution:{value:new d.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 d.Vector2(1,1)}}),vertexShader:d.ShaderChunk.meshline_vert,fragmentShader:d.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)}}}),this.setValues(n)}};Ht.prototype.copy=function(o){return d.ShaderMaterial.prototype.copy.call(this,o),this.lineWidth=o.lineWidth,this.map=o.map,this.useMap=o.useMap,this.alphaMap=o.alphaMap,this.useAlphaMap=o.useAlphaMap,this.color.copy(o.color),this.opacity=o.opacity,this.resolution.copy(o.resolution),this.sizeAttenuation=o.sizeAttenuation,this.dashArray.copy(o.dashArray),this.dashOffset.copy(o.dashOffset),this.dashRatio.copy(o.dashRatio),this.useDash=o.useDash,this.visibility=o.visibility,this.alphaTest=o.alphaTest,this.repeat.copy(o.repeat),this};var Wn="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 Xn={texture_url:Wn,lineWidth:8,color:16777215},ae=class extends S.Object3D{constructor(t,e){super();this.navigation=t;this.config=Object.assign({},Xn,e),this.registryEvent()}mesh=null;geometry=null;material=null;texture=null;config=Xn;points=[];basicRepeat=1;registryEvent(){this.navigation.bmap.context.addEventListener("control-change",this.onControlChange),this.navigation.bmap.context.addEventListener("update",this.onUpdate)}unRegistryEvent(){this.navigation.bmap.context.removeEventListener("control-change",this.onControlChange),this.navigation.bmap.context.removeEventListener("update",this.onUpdate)}onControlChange=()=>{this.changeRepeat()};onUpdate=()=>{this.texture};getRepeat(){let{points:t,navigation:{bmap:{context:{camera:e,clientSize:{width:i,height:r}}}}}=this,s=t.map(([u,a])=>y(new S.Vector3(u,a,0),e,i,r)).map(({x:u,y:a})=>[u,a]);return xt(s)/32}changeRepeat(){if(!this.material)return;let t=this.getRepeat();this.material.repeat=new S.Vector2(t,1)}loadTexture(t){return new Promise((e,i)=>{new S.TextureLoader().load(t,e,void 0,i)})}transformPoints(t){let e=[];for(let i=0;i<t.length;i++)e.push(...t[i],0);return e}updatePoints(t){this.points=t,this.changeRepeat();let e=this.transformPoints(t);this.geometry&&this.geometry.setPoints(e)}async create(t){let e=this.geometry=new N;if(this.updatePoints(t),!this.texture){let s=this.texture=await this.loadTexture(this.config.texture_url);s.wrapS=s.wrapT=S.RepeatWrapping}let i=this.material=new Ht({useMap:!0,color:new S.Color(this.config.color),transparent:!0,resolution:new S.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:S.NormalBlending,repeat:new S.Vector2(this.getRepeat(),1)}),r=this.mesh=new S.Mesh(e,i);return this.add(r),r}dispose(){this.unRegistryEvent(),this.clear(),this.geometry?.dispose(),this.material?.dispose(),this.texture?.dispose()}};var le=require("@tweenjs/tween.js"),wi={path:{},speed:10,cheapMaximumDistance:20,needStartPoi:!1,startPoi:{},loadRoad:!0},He=class extends W{path=null;worker=ke();fetchRoadStatus=!1;uniqueKey=new ut;paths=[];options;pathTween=new le.Group;startPoi=null;animationPathOptions={cPathIndex:0};cPath=[];constructor(n,t,e={}){super(n),this.options=Object.assign({},wi,e);let{apiDomain:i,apiPath:{roadNetwork:r},apiInfo:s}=this.bmap.config;this.registryEvent(),this.options.loadRoad&&Z(this.worker,"load_road",{url:`${i||location.origin}${r}?project=${t}`,...s}).then(l=>{this.fetchRoadStatus=!0,this.dispatchEvent({type:"fetch-road-status",status:!0}),this.dispatchEvent({type:"fetch-road-data",roadInfo:l})}).catch(l=>{console.log("[\u52A0\u8F7D\u8DEF\u7F51\u5931\u8D25]",l)})}registryEvent(){this.bmap.context.addEventListener("update",this.onUpdate),this.bmap.addEventListener("switch_floor_after",this.onSwitchFloor)}unRegistryEvent(){this.bmap.context.removeEventListener("update",this.onUpdate),this.bmap.removeEventListener("switch_floor_after",this.onSwitchFloor)}onUpdate=()=>{this.pathTween.update()};async setRoadData(n){this.fetchRoadStatus=!1,this.dispatchEvent({type:"fetch-road-status",status:!1}),await Z(this.worker,"set_road_info",n),this.fetchRoadStatus=!0,this.dispatchEvent({type:"fetch-road-status",status:!0})}clearPath(){this.path&&(this.bmap.context.scene.remove(this.path),this.path.dispose(),this.path=null,this.pathTween.getAll().forEach(n=>n.stop()),this.pathTween.removeAll())}onSwitchFloor=({data:{curFloor:n}})=>{if(this.paths.length){let t=this.paths.find(e=>e.floor===n.name);t?this.renderPath(this.translatePoints(t.points)):this.clearPath()}else this.clearPath()};getDirectionPath(n){return Z(this.worker,"get_direction_path",n)}addPath(n){this.paths=n;let t=this.bmap.context.currentFloor?.name,e=n.find(i=>i.floor===t);if(e)if(this.bmap.currentBuildGround)this.renderPath(this.translatePoints(e.points));else{let i=()=>{this.bmap.removeEventListener("center-change",i),this.renderPath(this.translatePoints(e.points))};this.bmap.addEventListener("center-change",i)}else this.clearPath()}translatePoints(n){let[t,e]=this.bmap.buildingCenter;return n.map(i=>[i[0]-t,i[1]-e])}getPath(n,t,e=""){return new Promise((i,r)=>{let s=()=>{Z(this.worker,"get_path",{start:n,end:t,type:e}).then(l=>{l?typeof l=="string"?r(l):i(l):r("no-path")})};if(this.fetchRoadStatus)s();else{let l=({status:u})=>{u&&(this.removeEventListener("fetch-road-status",l),s())};this.addEventListener("fetch-road-status",l)}})}renderPath(n){let t=this.catmullRomCurve3(n);this.cPath=t,this.animationPathOptions={cPathIndex:0},this.path?this.path.updatePoints(t):(this.path=new ae(this,this.options.path),this.path.create(t),this.path.position.z=this.bmap.context.currentFloor.groundMaxHeight+1,this.bmap.context.scene.add(this.path)),this.startPoi&&(this.startPoi.dispose(),this.startPoi=null),this.options.needStartPoi&&(this.startPoi=this.bmap.context.currentFloor?.addPoi({...this.options.startPoi,position:{x:t[0][0],y:t[0][1],z:1e-4},collision_enable:!1})||null)}catmullRomCurve3(n){return Se(n,!1,!0,.1,150,2.5)}async animationTo(n,t=this.options.speed){if(n.floor!==this.bmap.context.currentFloor?.name||!this.path)return;let{animationPathOptions:{cPathIndex:e}}=this,i=[this.path.points[0],...this.cPath.slice(e+1)],r=this.translatePoints([n.pos])[0],{distance:s,pos:l,index:u}=i.reduce((f,A,m,C)=>{if(m===C.length-1)return f;let{distance:w,closestPoint:I}=we(r,A,C[m+1]);return w<f.distance&&(f.distance=w,f.pos=I,f.index=m),f},{distance:Number.MAX_SAFE_INTEGER,pos:n.pos,index:0});if(s>this.options.cheapMaximumDistance||this.path.points[0][0]===l[0]&&this.path.points[0][1]===l[1])return;let a=0,h=[];if(u===0)a=R(i[0],l),h=[a];else{h=[R(i[0],i[1])];for(let f=1;f<u;f++)h.push(R(i[f],i[f+1]));h.push(R(i[u],l)),a=h.reduce((f,A)=>f+A,0)}let p=this.kmPerHourToMetersPerSecond(t),g=a/p;this.pathTween.getAll().forEach(f=>f.stop()),this.pathTween.removeAll();let c={distance:0};return new Promise(f=>{let A=new le.Tween(c,this.pathTween).to({distance:a},g*1e3).onUpdate(()=>{for(let m=0;m<h.length;m++){let C=h.slice(0,m+1).reduce((w,I)=>w+I,0);if(C>=c.distance){let w=C-h[m],I=c.distance-w,M=i[m],nt=i[m+1],j=Te(M,nt,I);this.path?.updatePoints([j,...i.slice(m+1)]),this.animationPathOptions.cPathIndex+=m,this.startPoi&&this.startPoi.position.setX(j[0]).setY(j[1]),this.dispatchEvent({type:"path-animation"});return}}}).onComplete(()=>{this.pathTween.remove(A),this.dispatchEvent({type:"path-animation-end"}),f(!0)}).start()})}kmPerHourToMetersPerSecond(n){return n*1e3/3600}dispose(){this.worker.terminate(),this.unRegistryEvent(),this.path?.dispose(),this.uniqueKey.dispose(),this.startPoi?.dispose()}};var Ve=class extends W{cacheData=new Map;floorDataLengthMap=new Map;async load(n){let t=G(n);if(this.cacheData.has(t))return this.cacheData.get(t);console.time("floor/get\u8BF7\u6C42"+n.resource_type_list);let[,e]=await Promise.all([this.loadBuildGround(n),kt(n,this.bmap.config)]);console.timeEnd("floor/get\u8BF7\u6C42"+n.resource_type_list);let i=G({floor:n.floor,ts:n.ts});this.bmap.transformGraphicData(e,this.bmap.buildingCenter,this.floorDataLengthMap.get(i)||0),e.forEach(s=>s.info.transformToBuildingGround=!1),this.cacheData.set(t,e);let r=this.floorDataLengthMap.get(i)||0;return this.floorDataLengthMap.set(i,r+e.length),e}isSameFloor(n){return this.bmap.context.currentFloor?.key===G(n)}switchFloorByData(n,t){if(this.isSameFloor(t)){if(!n.length)return;let e=this.bmap.context.currentFloor,i=e.userData.legacyToGraphicMap,r=e.userData.graphicMap,s=[];for(let l of n){if(l.info.group==="ground")e.createGround(l.info);else{let u=e.addGraphic(l.info);u.userData.data=l,i.set(l.legacy_id,u),s.push(u)}r.set(l.element_uuid,l)}this.bmap.triggerHooks("switch_floor_before",{curFloor:e,graphics:s}),this.bmap.initialFloorCamera(),this.bmap.triggerHooks("switch_floor_after",{curFloor:e,graphics:s})}else{let e=G(t),{curFloor:i,graphics:r}=this.bmap.createFloor(n);i.name=t.floor,i.key=e;let s=new Map;n.forEach(l=>{s.set(l.element_uuid,l)}),i.userData.graphicMap=s,this.bmap.triggerHooks("switch_floor_before",{curFloor:i,graphics:r}),this.bmap.context.switchFloor(i),this.bmap.initialFloorCamera(),this.bmap.triggerHooks("switch_floor_after",{curFloor:i,graphics:r})}}filterData(n,t){if(!this.isSameFloor(t))return n;let e=this.bmap.context.currentFloor.userData.graphicMap;return n.filter(i=>!e.has(i.element_uuid))}async switchFloorByStoreData(n){let t=await this.load({...n,resource_type_list:"6"}),e=this.filterData(t,n);this.switchFloorByData(e,n)}async switchFloorByOtherData(n){let t=await this.load({...n,resource_type_list:"1,2,3,4"}),e=this.filterData(t,n);this.switchFloorByData(e,n)}async loadBuildGround({brand:n,project:t}){let e=G({brand:n,project:t});return await this.bmap.loadBuildingGround({brand:n,project:t}),this.bmap.currentBuildGround=this.bmap.buildingGroundMap.get(e)||null,this.bmap.currentBuildGround}async changeFloor(n){return await Promise.all([this.switchFloorByStoreData(n),this.switchFloorByOtherData(n)]),Array.from(this.bmap.context.currentFloor.userData.graphicMap.values())}};var Yn=require("three"),qe=class extends W{poiLayer;floors=[];group=new Yn.Group;constructor(n){super(n),this.poiLayer=new ht(n.context)}show(n){let t=n[0].userData.height;n.forEach(r=>{r.poiLayer.pois.forEach(s=>{this.poiLayer.pushPoi(s)}),r.poiLayer.pois.length=0,r.poiLayer.dispose(),r.position.z=t,t+=r.userData.height});let{scene:e,currentFloor:i}=this.bmap.context;i&&(e.remove(i),i.dispose()),this.group.add(this.poiLayer,...n),e.add(this.group),this.floors=n}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 i=n.camera.zoom;n.control.minZoom=i,n.control.maxZoom=i*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 tt;function jn(o="aibee_map"){return new Promise((n,t)=>{if(tt)return n(tt);let e=indexedDB.open(o);e.onupgradeneeded=function(i){tt=i.target.result,n(tt)},e.onsuccess=i=>{tt=i.target.result},e.onerror=i=>{t(i)}})}function ue(o,n=tt){n&&(n.objectStoreNames.contains(o)||n.createObjectStore(o,{keyPath:"key"}))}function Jn(){tt?.close(),tt=null}function We(){return zt('var L=Object.defineProperty;var k=(g,A,Q)=>A in g?L(g,A,{enumerable:!0,configurable:!0,writable:!0,value:Q}):g[A]=Q;var s=(g,A,Q)=>k(g,typeof A!="symbol"?A+"":A,Q);function a(g,A){return new Promise((Q,I)=>{let B=new XMLHttpRequest;B.open("GET",g,!0),Object.keys(A.headers||{}).forEach(C=>{B.setRequestHeader(C,A.headers[C])}),A.responseType&&(B.responseType=A.responseType),B.onload=()=>{if(B.status>=200&&B.status<300)if(A.responseType==="arraybuffer")Q(B.response);else try{let C=JSON.parse(B.responseText);Q(C)}catch(C){I(C)}else I(B.statusText)},B.onerror=()=>{I(B.statusText)},B.send()})}function F(g){return g.replace(/[A-Z]/g,A=>"_"+A.toLowerCase()).replace(/^_/,"")}var D=class g{constructor(){s(this,"keySet",new Set)}static createKey(){return Math.random().toString(36).substring(2,15)+Math.random().toString(36).substring(2,15)}genUniqueKey(){let A=g.createKey();for(;this.keySet.has(A);)A=g.createKey();return A}removeKey(A){this.keySet.delete(A)}dispose(){this.keySet.clear()}};var H=new D;function h(g){let A={};for(let I in g)I.startsWith("on")&&(A[F(I.slice(2))]=g[I]);let Q=async({data:I})=>{if(A[I.type])try{let B=await A[I.type](I.data);self.postMessage({type:`${I.type}_result`,key:I.key,data:B})}catch(B){self.postMessage({type:`${I.type}_result`,key:I.key,error:B})}else self.postMessage({type:`${I.type}_result`,key:I.key,error:"no_event"})};return self.addEventListener("message",Q),()=>{self.removeEventListener("message",Q)}}var i,E,w,G={env:{emscripten_notify_memory_growth:function(g){w=new Uint8Array(E.exports.memory.buffer)}}},o=class{init(){return i||(typeof fetch!="undefined"?i=fetch("data:application/wasm;base64,"+y).then(A=>A.arrayBuffer()).then(A=>WebAssembly.instantiate(A,G)).then(this._init):i=WebAssembly.instantiate(Buffer.from(y,"base64"),G).then(this._init),i)}_init(A){E=A.instance,G.env.emscripten_notify_memory_growth(0)}decode(A,Q=0){if(!E)throw new Error("ZSTDDecoder: Await .init() before decoding.");let I=A.byteLength,B=E.exports.malloc(I);w.set(A,B),Q=Q||Number(E.exports.ZSTD_findDecompressedSize(B,I));let C=E.exports.malloc(Q),S=E.exports.ZSTD_decompress(C,Q,B,I),N=w.slice(C,C+S);return E.exports.free(B),E.exports.free(C),N}},y="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IAMNACAEQQNxBEADQCACRQ0FIAAgAkF/aiICaiIDIAEgAmotAAA6AAAgA0EDcQ0ACwsgAkEDTQ0AA0AgACACQXxqIgJqIAEgAmooAgA2AgAgAkEDSw0ACwsgAkUNAgNAIAAgAkF/aiICaiABIAJqLQAAOgAAIAINAAsMAgsgAkEDTQ0AIAIhBANAIAMgASgCADYCACABQQRqIQEgA0EEaiEDIARBfGoiBEEDSw0ACyACQQNxIQILIAJFDQADQCADIAEtAAA6AAAgA0EBaiEDIAFBAWohASACQX9qIgINAAsLIAAL8wICAn8BfgJAIAJFDQAgACACaiIDQX9qIAE6AAAgACABOgAAIAJBA0kNACADQX5qIAE6AAAgACABOgABIANBfWogAToAACAAIAE6AAIgAkEHSQ0AIANBfGogAToAACAAIAE6AAMgAkEJSQ0AIABBACAAa0EDcSIEaiIDIAFB/wFxQYGChAhsIgE2AgAgAyACIARrQXxxIgRqIgJBfGogATYCACAEQQlJDQAgAyABNgIIIAMgATYCBCACQXhqIAE2AgAgAkF0aiABNgIAIARBGUkNACADIAE2AhggAyABNgIUIAMgATYCECADIAE2AgwgAkFwaiABNgIAIAJBbGogATYCACACQWhqIAE2AgAgAkFkaiABNgIAIAQgA0EEcUEYciIEayICQSBJDQAgAa0iBUIghiAFhCEFIAMgBGohAQNAIAEgBTcDGCABIAU3AxAgASAFNwMIIAEgBTcDACABQSBqIQEgAkFgaiICQR9LDQALCyAACy8BAn8gACgCBCAAKAIAQQJ0aiICLQACIQMgACACLwEAIAEgAi0AAxAIajYCACADCy8BAn8gACgCBCAAKAIAQQJ0aiICLQACIQMgACACLwEAIAEgAi0AAxAFajYCACADCx8AIAAgASACKAIEEAg2AgAgARAEGiAAIAJBCGo2AgQLCAAgAGdBH3MLugUBDX8jAEEQayIKJAACfyAEQQNNBEAgCkEANgIMIApBDGogAyAEEAsaIAAgASACIApBDGpBBBAVIgBBbCAAEAMbIAAgACAESxsMAQsgAEEAIAEoAgBBAXRBAmoQECENQVQgAygAACIGQQ9xIgBBCksNABogAiAAQQVqNgIAIAMgBGoiAkF8aiEMIAJBeWohDiACQXtqIRAgAEEGaiELQQQhBSAGQQR2IQRBICAAdCIAQQFyIQkgASgCACEPQQAhAiADIQYCQANAIAlBAkggAiAPS3JFBEAgAiEHAkAgCARAA0AgBEH//wNxQf//A0YEQCAHQRhqIQcgBiAQSQR/IAZBAmoiBigAACAFdgUgBUEQaiEFIARBEHYLIQQMAQsLA0AgBEEDcSIIQQNGBEAgBUECaiEFIARBAnYhBCAHQQNqIQcMAQsLIAcgCGoiByAPSw0EIAVBAmohBQNAIAIgB0kEQCANIAJBAXRqQQA7AQAgAkEBaiECDAELCyAGIA5LQQAgBiAFQQN1aiIHIAxLG0UEQCAHKAAAIAVBB3EiBXYhBAwCCyAEQQJ2IQQLIAYhBwsCfyALQX9qIAQgAEF/anEiBiAAQQF0QX9qIgggCWsiEUkNABogBCAIcSIEQQAgESAEIABIG2shBiALCyEIIA0gAkEBdGogBkF/aiIEOwEAIAlBASAGayAEIAZBAUgbayEJA0AgCSAASARAIABBAXUhACALQX9qIQsMAQsLAn8gByAOS0EAIAcgBSAIaiIFQQN1aiIGIAxLG0UEQCAFQQdxDAELIAUgDCIGIAdrQQN0awshBSACQQFqIQIgBEUhCCAGKAAAIAVBH3F2IQQMAQsLQWwgCUEBRyAFQSBKcg0BGiABIAJBf2o2AgAgBiAFQQdqQQN1aiADawwBC0FQCyEAIApBEGokACAACwkAQQFBBSAAGwsMACAAIAEoAAA2AAALqgMBCn8jAEHwAGsiCiQAIAJBAWohDiAAQQhqIQtBgIAEIAVBf2p0QRB1IQxBACECQQEhBkEBIAV0IglBf2oiDyEIA0AgAiAORkUEQAJAIAEgAkEBdCINai8BACIHQf//A0YEQCALIAhBA3RqIAI2AgQgCEF/aiEIQQEhBwwBCyAGQQAgDCAHQRB0QRB1ShshBgsgCiANaiAHOwEAIAJBAWohAgwBCwsgACAFNgIEIAAgBjYCACAJQQN2IAlBAXZqQQNqIQxBACEAQQAhBkEAIQIDQCAGIA5GBEADQAJAIAAgCUYNACAKIAsgAEEDdGoiASgCBCIGQQF0aiICIAIvAQAiAkEBajsBACABIAUgAhAUayIIOgADIAEgAiAIQf8BcXQgCWs7AQAgASAEIAZBAnQiAmooAgA6AAIgASACIANqKAIANgIEIABBAWohAAwBCwsFIAEgBkEBdGouAQAhDUEAIQcDQCAHIA1ORQRAIAsgAkEDdGogBjYCBANAIAIgDGogD3EiAiAISw0ACyAHQQFqIQcMAQsLIAZBAWohBgwBCwsgCkHwAGokAAsjAEIAIAEQCSAAhUKHla+vmLbem55/fkLj3MqV/M7y9YV/fAsQACAAQn43AwggACABNgIACyQBAX8gAARAIAEoAgQiAgRAIAEoAgggACACEQEADwsgABAmCwsfACAAIAEgAi8BABAINgIAIAEQBBogACACQQRqNgIEC0oBAX9BoCAoAgAiASAAaiIAQX9MBEBBiCBBMDYCAEF/DwsCQCAAPwBBEHRNDQAgABBmDQBBiCBBMDYCAEF/DwtBoCAgADYCACABC9cBAQh/Qbp/IQoCQCACKAIEIgggAigCACIJaiIOIAEgAGtLDQBBbCEKIAkgBCADKAIAIgtrSw0AIAAgCWoiBCACKAIIIgxrIQ0gACABQWBqIg8gCyAJQQAQKSADIAkgC2o2AgACQAJAIAwgBCAFa00EQCANIQUMAQsgDCAEIAZrSw0CIAcgDSAFayIAaiIBIAhqIAdNBEAgBCABIAgQDxoMAgsgBCABQQAgAGsQDyEBIAIgACAIaiIINgIEIAEgAGshBAsgBCAPIAUgCEEBECkLIA4hCgsgCgubAgEBfyMAQYABayINJAAgDSADNgJ8AkAgAkEDSwRAQX8hCQwBCwJAAkACQAJAIAJBAWsOAwADAgELIAZFBEBBuH8hCQwEC0FsIQkgBS0AACICIANLDQMgACAHIAJBAnQiAmooAgAgAiAIaigCABA7IAEgADYCAEEBIQkMAwsgASAJNgIAQQAhCQwCCyAKRQRAQWwhCQwCC0EAIQkgC0UgDEEZSHINAUEIIAR0QQhqIQBBACECA0AgAiAATw0CIAJBQGshAgwAAAsAC0FsIQkgDSANQfwAaiANQfgAaiAFIAYQFSICEAMNACANKAJ4IgMgBEsNACAAIA0gDSgCfCAHIAggAxAYIAEgADYCACACIQkLIA1BgAFqJAAgCQsLACAAIAEgAhALGgsQACAALwAAIAAtAAJBEHRyCy8AAn9BuH8gAUEISQ0AGkFyIAAoAAQiAEF3Sw0AGkG4fyAAQQhqIgAgACABSxsLCwkAIAAgATsAAAsDAAELigYBBX8gACAAKAIAIgVBfnE2AgBBACAAIAVBAXZqQYQgKAIAIgQgAEYbIQECQAJAIAAoAgQiAkUNACACKAIAIgNBAXENACACQQhqIgUgA0EBdkF4aiIDQQggA0EISxtnQR9zQQJ0QYAfaiIDKAIARgRAIAMgAigCDDYCAAsgAigCCCIDBEAgAyACKAIMNgIECyACKAIMIgMEQCADIAIoAgg2AgALIAIgAigCACAAKAIAQX5xajYCAEGEICEAAkACQCABRQ0AIAEgAjYCBCABKAIAIgNBAXENASADQQF2QXhqIgNBCCADQQhLG2dBH3NBAnRBgB9qIgMoAgAgAUEIakYEQCADIAEoAgw2AgALIAEoAggiAwRAIAMgASgCDDYCBAsgASgCDCIDBEAgAyABKAIINgIAQYQgKAIAIQQLIAIgAigCACABKAIAQX5xajYCACABIARGDQAgASABKAIAQQF2akEEaiEACyAAIAI2AgALIAIoAgBBAXZBeGoiAEEIIABBCEsbZ0Efc0ECdEGAH2oiASgCACEAIAEgBTYCACACIAA2AgwgAkEANgIIIABFDQEgACAFNgIADwsCQCABRQ0AIAEoAgAiAkEBcQ0AIAJBAXZBeGoiAkEIIAJBCEsbZ0Efc0ECdEGAH2oiAigCACABQQhqRgRAIAIgASgCDDYCAAsgASgCCCICBEAgAiABKAIMNgIECyABKAIMIgIEQCACIAEoAgg2AgBBhCAoAgAhBAsgACAAKAIAIAEoAgBBfnFqIgI2AgACQCABIARHBEAgASABKAIAQQF2aiAANgIEIAAoAgAhAgwBC0GEICAANgIACyACQQF2QXhqIgFBCCABQQhLG2dBH3NBAnRBgB9qIgIoAgAhASACIABBCGoiAjYCACAAIAE2AgwgAEEANgIIIAFFDQEgASACNgIADwsgBUEBdkF4aiIBQQggAUEISxtnQR9zQQJ0QYAfaiICKAIAIQEgAiAAQQhqIgI2AgAgACABNgIMIABBADYCCCABRQ0AIAEgAjYCAAsLDgAgAARAIABBeGoQJQsLgAIBA38CQCAAQQ9qQXhxQYQgKAIAKAIAQQF2ayICEB1Bf0YNAAJAQYQgKAIAIgAoAgAiAUEBcQ0AIAFBAXZBeGoiAUEIIAFBCEsbZ0Efc0ECdEGAH2oiASgCACAAQQhqRgRAIAEgACgCDDYCAAsgACgCCCIBBEAgASAAKAIMNgIECyAAKAIMIgFFDQAgASAAKAIINgIAC0EBIQEgACAAKAIAIAJBAXRqIgI2AgAgAkEBcQ0AIAJBAXZBeGoiAkEIIAJBCEsbZ0Efc0ECdEGAH2oiAygCACECIAMgAEEIaiIDNgIAIAAgAjYCDCAAQQA2AgggAkUNACACIAM2AgALIAELtwIBA38CQAJAIABBASAAGyICEDgiAA0AAkACQEGEICgCACIARQ0AIAAoAgAiA0EBcQ0AIAAgA0EBcjYCACADQQF2QXhqIgFBCCABQQhLG2dBH3NBAnRBgB9qIgEoAgAgAEEIakYEQCABIAAoAgw2AgALIAAoAggiAQRAIAEgACgCDDYCBAsgACgCDCIBBEAgASAAKAIINgIACyACECchAkEAIQFBhCAoAgAhACACDQEgACAAKAIAQX5xNgIAQQAPCyACQQ9qQXhxIgMQHSICQX9GDQIgAkEHakF4cSIAIAJHBEAgACACaxAdQX9GDQMLAkBBhCAoAgAiAUUEQEGAICAANgIADAELIAAgATYCBAtBhCAgADYCACAAIANBAXRBAXI2AgAMAQsgAEUNAQsgAEEIaiEBCyABC7kDAQJ/IAAgA2ohBQJAIANBB0wEQANAIAAgBU8NAiAAIAItAAA6AAAgAEEBaiEAIAJBAWohAgwAAAsACyAEQQFGBEACQCAAIAJrIgZBB00EQCAAIAItAAA6AAAgACACLQABOgABIAAgAi0AAjoAAiAAIAItAAM6AAMgAEEEaiACIAZBAnQiBkHAHmooAgBqIgIQFyACIAZB4B5qKAIAayECDAELIAAgAhAMCyACQQhqIQIgAEEIaiEACwJAAkACQAJAIAUgAU0EQCAAIANqIQEgBEEBRyAAIAJrQQ9Kcg0BA0AgACACEAwgAkEIaiECIABBCGoiACABSQ0ACwwFCyAAIAFLBEAgACEBDAQLIARBAUcgACACa0EPSnINASAAIQMgAiEEA0AgAyAEEAwgBEEIaiEEIANBCGoiAyABSQ0ACwwCCwNAIAAgAhAHIAJBEGohAiAAQRBqIgAgAUkNAAsMAwsgACEDIAIhBANAIAMgBBAHIARBEGohBCADQRBqIgMgAUkNAAsLIAIgASAAa2ohAgsDQCABIAVPDQEgASACLQAAOgAAIAFBAWohASACQQFqIQIMAAALAAsLQQECfyAAIAAoArjgASIDNgLE4AEgACgCvOABIQQgACABNgK84AEgACABIAJqNgK44AEgACABIAQgA2tqNgLA4AELpgEBAX8gACAAKALs4QEQFjYCyOABIABCADcD+OABIABCADcDuOABIABBwOABakIANwMAIABBqNAAaiIBQYyAgOAANgIAIABBADYCmOIBIABCADcDiOEBIABCAzcDgOEBIABBrNABakHgEikCADcCACAAQbTQAWpB6BIoAgA2AgAgACABNgIMIAAgAEGYIGo2AgggACAAQaAwajYCBCAAIABBEGo2AgALYQEBf0G4fyEDAkAgAUEDSQ0AIAIgABAhIgFBA3YiADYCCCACIAFBAXE2AgQgAiABQQF2QQNxIgM2AgACQCADQX9qIgFBAksNAAJAIAFBAWsOAgEAAgtBbA8LIAAhAwsgAwsMACAAIAEgAkEAEC4LiAQCA38CfiADEBYhBCAAQQBBKBAQIQAgBCACSwRAIAQPCyABRQRAQX8PCwJAAkAgA0EBRg0AIAEoAAAiBkGo6r5pRg0AQXYhAyAGQXBxQdDUtMIBRw0BQQghAyACQQhJDQEgAEEAQSgQECEAIAEoAAQhASAAQQE2AhQgACABrTcDAEEADwsgASACIAMQLyIDIAJLDQAgACADNgIYQXIhAyABIARqIgVBf2otAAAiAkEIcQ0AIAJBIHEiBkUEQEFwIQMgBS0AACIFQacBSw0BIAVBB3GtQgEgBUEDdkEKaq2GIgdCA4h+IAd8IQggBEEBaiEECyACQQZ2IQMgAkECdiEFAkAgAkEDcUF/aiICQQJLBEBBACECDAELAkACQAJAIAJBAWsOAgECAAsgASAEai0AACECIARBAWohBAwCCyABIARqLwAAIQIgBEECaiEEDAELIAEgBGooAAAhAiAEQQRqIQQLIAVBAXEhBQJ+AkACQAJAIANBf2oiA0ECTQRAIANBAWsOAgIDAQtCfyAGRQ0DGiABIARqMQAADAMLIAEgBGovAACtQoACfAwCCyABIARqKAAArQwBCyABIARqKQAACyEHIAAgBTYCICAAIAI2AhwgACAHNwMAQQAhAyAAQQA2AhQgACAHIAggBhsiBzcDCCAAIAdCgIAIIAdCgIAIVBs+AhALIAMLWwEBf0G4fyEDIAIQFiICIAFNBH8gACACakF/ai0AACIAQQNxQQJ0QaAeaigC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C0Egak8NAQsgByAHKQNoNwMQIAcgBykDYDcDCCAEIA0gB0EIaiAHQdwAaiAPIA4gESAQEB4hCwwBCyACIARqIQggBCAKEAcgAkERTwRAIARBEGohAgNAIAIgCkEQaiIKEAcgAkEQaiICIAhJDQALCyAIIAlrIQIgByATNgJcIAkgCCAOa0sEQCAJIAggEWtLBEBBbCELDAILIBAgAiAOayICaiIKIANqIBBNBEAgCCAKIAMQDxoMAgsgCCAKQQAgAmsQDyEIIAcgAiADaiIDNgJkIAggAmshCCAOIQILIAlBEE8EQCADIAhqIQMDQCAIIAIQByACQRBqIQIgCEEQaiIIIANJDQALDAELAkAgCUEHTQRAIAggAi0AADoAACAIIAItAAE6AAEgCCACLQACOgACIAggAi0AAzoAAyAIQQRqIAIgCUECdCIDQcAeaigCAGoiAhAXIAIgA0HgHmooAgBrIQIgBygCZCEDDAELIAggAhAMCyADQQlJDQAgAyAIaiEDIAhBCGoiCCACQQhqIgJrQQ9MBEADQCAIIAIQDCACQQhqIQIgCEEIaiIIIANJDQAMAgALAAsDQCAIIAIQByACQRBqIQIgCEEQaiIIIANJDQALCyAHQRhqEAQaIAsgDCALEAMiAhshDCAEIAQgC2ogAhshBCAFQX9qIgUNAAsgDBADDQFBbCEMIAdBGGoQBEECSQ0BQQAhCANAIAhBA0cEQCAAIAhBAnQiAmpBrNABaiACIAdqKAJENgIAIAhBAWohCAwBCwsgBygCXCEIC0G6fyEMIA8gCGsiACANIARrSw0AIAQEfyAEIAggABALIABqBUEACyABayEMCyAHQfAAaiQAIAwLkRcCFn8FfiMAQdABayIHJAAgByAAKALw4QEiCDYCvAEgASACaiESIAggACgCgOIBaiETAkACQCAFRQRAIAEhAwwBCyAAKALE4AEhESAAKALA4AEhFSAAKAK84AEhDyAAQQE2AozhAUEAIQgDQCAIQQNHBEAgByAIQQJ0IgJqIAAgAmpBrNABaigCADYCVCAIQQFqIQgMAQsLIAcgETYCZCAHIA82AmAgByABIA9rNgJoQWwhECAHQShqIAMgBBAGEAMNASAFQQQgBUEESBshFyAHQTxqIAdBKGogACgCABATIAdBxABqIAdBKGogACgCCBATIAdBzABqIAdB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IAdB0AFqJAAgEAslACAAQgA3AgAgAEEAOwEIIABBADoACyAAIAE2AgwgACACOgAKC7QFAQN/IwBBMGsiBCQAIABB/wFqIgVBfWohBgJAIAMvAQIEQCAEQRhqIAEgAhAGIgIQAw0BIARBEGogBEEYaiADEBwgBEEIaiAEQRhqIAMQHCAAIQMDQAJAIARBGGoQBCADIAZPckUEQCADIARBEGogBEEYahASOgAAIAMgBEEIaiAEQRhqEBI6AAEgBEEYahAERQ0BIANBAmohAwsgBUF+aiEFAn8DQEG6fyECIAMiASAFSw0FIAEgBEEQaiAEQRhqEBI6AAAgAUEBaiEDIARBGGoQBEEDRgRAQQIhAiAEQQhqDAILIAMgBUsNBSABIARBCGogBEEYahASOgABIAFBAmohA0EDIQIgBEEYahAEQQNHDQALIARBEGoLIQUgAyAFIARBGGoQEjoAACABIAJqIABrIQIMAwsgAyAEQRBqIARBGGoQEjoAAiADIARBCGogBEEYahASOgADIANBBGohAwwAAAsACyAEQRhqIAEgAhAGIgIQAw0AIARBEGogBEEYaiADEBwgBEEIaiAEQRhqIAMQHCAAIQMDQAJAIARBGGoQBCADIAZPckUEQCADIARBEGogBEEYahAROgAAIAMgBEEIaiAEQRhqEBE6AAEgBEEYahAERQ0BIANBAmohAwsgBUF+aiEFAn8DQEG6fyECIAMiASAFSw0EIAEgBEEQaiAEQRhqEBE6AAAgAUEBaiEDIARBGGoQBEEDRgRAQQIhAiAEQQhqDAILIAMgBUsNBCABIARBCGogBEEYahAROgABIAFBAmohA0EDIQIgBEEYahAEQQNHDQALIARBEGoLIQUgAyAFIARBGGoQEToAACABIAJqIABrIQIMAgsgAyAEQRBqIARBGGoQEToAAiADIARBCGogBEEYahAROgADIANBBGohAwwAAAsACyAEQTBqJAAgAgtpAQF/An8CQAJAIAJBB00NACABKAAAQbfIwuF+Rw0AIAAgASgABDYCmOIBQWIgAEEQaiABIAIQPiIDEAMNAhogAEKBgICAEDcDiOEBIAAgASADaiACIANrECoMAQsgACABIAIQKgtBAAsLrQMBBn8jAEGAAWsiAyQAQWIhCAJAIAJBCUkNACAAQZjQAGogAUEIaiIEIAJBeGogAEGY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wOABCwutAgIEfwF+IwBBQGoiBCQAAkACQCACQQhJDQAgASgAAEFwcUHQ1LTCAUcNACABIAIQIiEBIABCADcDCCAAQQA2AgQgACABNgIADAELIARBGGogASACEC0iAxADBEAgACADEBoMAQsgAwRAIABBuH8QGgwBCyACIAQoAjAiA2shAiABIANqIQMDQAJAIAAgAyACIARBCGoQLCIFEAMEfyAFBSACIAVBA2oiBU8NAUG4fwsQGgwCCyAGQQFqIQYgAiAFayECIAMgBWohAyAEKAIMRQ0ACyAEKAI4BEAgAkEDTQRAIABBuH8QGgwCCyADQQRqIQMLIAQoAighAiAEKQMYIQcgAEEANgIEIAAgAyABazYCACAAIAIgBmytIAcgB0J/URs3AwgLIARBQGskAAslAQF/IwBBEGsiAiQAIAIgACABEFEgAigCACEAIAJBEGokACAAC30BBH8jAEGQBGsiBCQAIARB/wE2AggCQCAEQRBqIARBCGogBEEMaiABIAIQFSIGEAMEQCAGIQUMAQtBVCEFIAQoAgwiB0EGSw0AIAMgBEEQaiAEKAIIIAcQQSIFEAMNACAAIAEgBmogAiAGayADEDwhBQsgBEGQBGokACAFC4cBAgJ/An5BABAWIQMCQANAIAEgA08EQAJAIAAoAABBcHFB0NS0wgFGBEAgACABECIiAhADRQ0BQn4PCyAAIAEQVSIEQn1WDQMgBCAFfCIFIARUIQJCfiEEIAINAyAAIAEQUiICEAMNAwsgASACayEBIAAgAmohAAwBCwtCfiAFIAEbIQQLIAQLPwIBfwF+IwBBMGsiAiQAAn5CfiACQQhqIAAgARAtDQAaQgAgAigCHEEBRg0AGiACKQMICyEDIAJBMGokACADC40BAQJ/IwBBMGsiASQAAkAgAEUNACAAKAKI4gENACABIABB/OEBaigCADYCKCABIAApAvThATcDICAAEDAgACgCqOIBIQIgASABKAIoNgIYIAEgASkDIDcDECACIAFBEGoQGyAAQQA2AqjiASABIAEoAig2AgggASABKQMgNwMAIAAgARAbCyABQTBqJAALKgECfyMAQRBrIgAkACAAQQA2AgggAEIANwMAIAAQWCEBIABBEGokACABC4cBAQN/IwBBEGsiAiQAAkAgACgCAEUgACgCBEVzDQAgAiAAKAIINgIIIAIgACkCADcDAAJ/IAIoAgAiAQRAIAIoAghBqOMJIAERBQAMAQtBqOMJECgLIgFFDQAgASAAKQIANwL04QEgAUH84QFqIAAoAgg2AgAgARBZIAEhAwsgAkEQaiQAIAMLywEBAn8jAEEgayIBJAAgAEGBgIDAADYCtOIBIABBADYCiOIBIABBADYC7OEBIABCADcDkOIBIABBADYCpOMJIABBADYC3OIBIABCADcCzOIBIABBADYCvOIBIABBADYCxOABIABCADcCnOIBIABBpOIBakIANwIAIABBrOIBakEANgIAIAFCADcCECABQgA3AhggASABKQMYNwMIIAEgASkDEDcDACABKAIIQQh2QQFxIQIgAEEANgLg4gEgACACNgKM4gEgAUEgaiQAC3YBA38jAEEwayIBJAAgAARAIAEgAEHE0AFqIgIoAgA2AiggASAAKQK80AE3AyAgACgCACEDIAEgAigCADYCGCABIAApArzQATcDECADIAFBEGoQGyABIAEoAig2AgggASABKQMgNwMAIAAgARAbCyABQTBqJAALzAEBAX8gACABKAK00AE2ApjiASAAIAEoAgQiAjYCwOABIAAgAjYCvOABIAAgAiABKAIIaiICNgK44AEgACACNgLE4AEgASgCuNABBEAgAEKBgICAEDcDiOEBIAAgAUGk0ABqNgIMIAAgAUGUIGo2AgggACABQZwwajYCBCAAIAFBDGo2AgAgAEGs0AFqIAFBqNABaigCADYCACAAQbDQAWogAUGs0AFqKAIANgIAIABBtNABaiABQbDQAWooAgA2AgAPCyAAQgA3A4jhAQs7ACACRQRAQbp/DwsgBEUEQEFsDwsgAiAEEGAEQCAAIAEgAiADIAQgBRBhDwsgACABIAIgAyAEIAUQZQtGAQF/IwBBEGsiBSQAIAVBCGogBBAOAn8gBS0ACQRAIAAgASACIAMgBBAyDAELIAAgASACIAMgBBA0CyEAIAVBEGokACAACzQAIAAgAyAEIAUQNiIFEAMEQCAFDwsgBSAESQR/IAEgAiADIAVqIAQgBWsgABA1BUG4fwsLRgEBfyMAQRBrIgUkACAFQQhqIAQQDgJ/IAUtAAkEQCAAIAEgAiADIAQQYgwBCyAAIAEgAiADIAQQNQshACAFQRBqJAAgAAtZAQF/QQ8hAiABIABJBEAgAUEE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";var R=new o,J=R.init();h({async onDecode(g){try{let A=await a(g,{responseType:"arraybuffer"}),Q=new Uint8Array(A);await J;let I=R.decode(Q),B=new TextDecoder().decode(I);return JSON.parse(B)}catch(A){return console.error(A),"error"}}});\n')}function et(o,n,t=0){o.forEach(e=>{e.geometry.coords=JSON.parse(JSON.stringify(e.geometry.cds)),e.geometry.type==="polygon"?(e.geometry.coords.map(i=>{Array.isArray(i)&&i.forEach(r=>{r[0]-=n[0],r[1]-=n[1]})}),e.geometry.otherCds&&(e.geometry.otherCoords=e.geometry.otherCds.map(i=>i.map(r=>vt(r,n))))):e.geometry.coords=vt(e.geometry.cds,n)});for(let e=0;e<o.length;e++){let i=o[e];i.deltaHeight=1e-5*(t+e+1)}}function vt(o,n){return[o[0]-n[0],o[1]-n[1]]}var Ti={loadRoadNetwork:!1},Bi="version",Ri="map_data",Li="road_network_data",Xe=class{constructor(n){this.bmap=n;this.initDb()}placeId=null;canUseZstd=localStorage.getItem("canUseZstd")!=="0";worker=We();async initDb(){try{await jn(),ue(Bi),ue(Ri),ue(Li)}catch(n){console.log("[\u6253\u5F00indexDb\u9519\u8BEF]",n)}}async load(n){this.clear(),this.placeId=n}async getFloorData(n){return this.canUseZstd&&await Z(this.worker,"decode","")==="error"?(this.setCanUseZstd(!1),this.getFloorData(n)):new q(this.bmap.context)}async getRoadNetworkData(){}async getOtherDataByFreeTime(){}async getMulFloorsData(n){return[]}async getDataByUrl(n){let t=await fetch(n).then(e=>e.json());return this.getDataByJson(t)}getDataByJson(n){let t=new q(this.bmap.context),e=[0,0];return n.layers.forEach(i=>{switch(i.l_type){case"range":let r=i.elements[0];e=[r.center_x,r.center_y];break;case"graph":let s=[],l=new Map;et(i.elements,e),i.elements.forEach(c=>{let f=t.addGraphic(c);s.push(f),l.set(c.id,f)}),t.userData.graphics=s,t.userData.graphicMap=l;break;case"ground":et(i.elements,e);let u=i.elements.map(c=>new B(this.bmap.context,c));t.addGrounds(u);break;case"wall":et(i.elements,e);let a=i.elements.reduce((c,f)=>{let{fillColor:A,fillOpacity:m,strokeColor:C,strokeOpacity:w}=f,I=`${A}-${m}-${C}-${w}`;return c[I]?c[I].push(f):c[I]=[f],c},{});Object.values(a).forEach(c=>{let f=new Dt(this.bmap.context,c);t.wallLayer.add(f)});break;case"lane":et(i.elements,e);let h=i.elements.reduce((c,f)=>{let{fillColor:A,fillOpacity:m,strokeColor:C,strokeOpacity:w}=f,I=`${A}-${m}-${C}-${w}`;return c[I]?c[I].push(f):c[I]=[f],c},{});Object.values(h).forEach(c=>{let f=new Ft(this.bmap.context,c);t.laneLayer.add(f)});break;case"texture2d":case"texture3d":et(i.elements,e),i.elements.forEach(c=>{let f=new Nt(this.bmap.context,c);t.textureLayer.add(f)});break;case"glb":et(i.elements,e),i.elements.forEach(c=>{let f=new Ot(this.bmap.context,{...c,url:c.secondUrl,rotate:c.secondRotate,width:c.secondWidth});t.glbModelLayer.add(f)});break;case"store":i.elements.map(c=>{let f=vt([c.center_x,c.center_y],e);t.poiLayer.createPoi({icon:c.poi_info.icon,texts:[{text:c.store_name||c.poi_info.name}],position:{x:f[0],y:f[1],z:c.airHeight}})});break;case"facility":i.elements.map(c=>{let f=vt(c.geometry.cds,e);t.poiLayer.createPoi({icon:c.poi_info.icon,texts:[{text:c.store_name||c.poi_info.name}],position:{x:f[0],y:f[1],z:c.airHeight}})});break;case"parkingSpace":et(i.elements,e);let p=[],g=new Map;i.elements.forEach(c=>{let f=t.addGraphic(c);p.push(f),g.set(c.id,f);let A=vt([c.center_x,c.center_y],e);t.poiLayer.createPoi({texts:[{text:c.poi_info.name}],position:{x:A[0],y:A[1],z:c.airHeight}})}),t.userData.parkingSpaces=p,t.userData.parkingSpacesGraphicMap=g;break}}),t.userData.center=e,t.userData.height=n.floorHeight,t}clear(){this.placeId=null}setCanUseZstd(n){this.canUseZstd=n,localStorage.setItem("canUseZstd","0")}dispose(){this.clear(),Jn()}};
3750
+ `)}var P=require("three");var g=require("three"),F=class extends g.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 g.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)}}})}};F.prototype.setMatrixWorld=function(o){this.matrixWorld=o};F.prototype.setGeometry=function(o,n){this._geometry=o,this.setPoints(o.getAttribute("position").array,n)};F.prototype.setPoints=function(o,n){if(!(o instanceof Float32Array)&&!(o instanceof Array)){console.error("ERROR: The BufferArray of points is not instancied correctly.");return}if(this._points=o,this.widthCallback=n,this.positions=[],this.counters=[],o.length&&o[0]instanceof g.Vector3)for(var t=0;t<o.length;t++){var e=o[t],r=t/o.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<o.length;t+=3){var r=t/o.length;this.positions.push(o[t],o[t+1],o[t+2]),this.positions.push(o[t],o[t+1],o[t+2]),this.counters.push(r),this.counters.push(r)}this.process()};function Ar(o,n){var t=new g.Matrix4,e=new g.Ray,r=new g.Sphere,i=new g.Vector3,s=this.geometry;if(s.boundingSphere||s.computeBoundingSphere(),r.copy(s.boundingSphere),r.applyMatrix4(this.matrixWorld),o.ray.intersectSphere(r,i)!==!1){t.copy(this.matrixWorld).invert(),e.copy(o.ray).applyMatrix4(t);var l=new g.Vector3,u=new g.Vector3,a=new g.Vector3,c=this instanceof g.LineSegments?2:1,p=s.index,d=s.attributes;if(p!==null)for(var h=p.array,f=d.position.array,y=d.width.array,m=0,S=h.length-1;m<S;m+=c){var A=h[m],M=h[m+1];l.fromArray(f,A*3),u.fromArray(f,M*3);var w=y[Math.floor(m/3)]!==void 0?y[Math.floor(m/3)]:1,et=o.params.Line.threshold+this.material.lineWidth*w/2,K=et*et,Ht=e.distanceSqToSegment(l,u,i,a);if(!(Ht>K)){i.applyMatrix4(this.matrixWorld);var Wt=o.ray.origin.distanceTo(i);Wt<o.near||Wt>o.far||(n.push({distance:Wt,point:a.clone().applyMatrix4(this.matrixWorld),index:m,face:null,faceIndex:null,object:this}),m=S)}}}}F.prototype.raycast=Ar;F.prototype.compareV3=function(o,n){var t=o*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]};F.prototype.copyV3=function(o){var n=o*6;return[this.positions[n],this.positions[n+1],this.positions[n+2]]};F.prototype.getDistance=function(o){let n=0;for(let t=0;t<o;t++){let e=6*t,r=new g.Vector3(this.positions[e],this.positions[e+1],this.positions[e+2]),i=new g.Vector3(this.positions[e+6],this.positions[e+7],this.positions[e+8]),s=r.distanceTo(i);n+=s}return n};F.prototype.process=function(){var o=this.positions.length/6;this.previous=[],this.next=[],this.side=[],this.width=[],this.indices_array=[],this.uvs=[];var n;let t=this.getDistance(o-1);var e;this.compareV3(0,o-1)?e=this.copyV3(o-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<o;r++){if(this.side.push(1),this.side.push(-1),this.widthCallback?n=this.widthCallback(r/(o-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===o-1)this.uvs.push(1,0),this.uvs.push(1,1);else{let s=this.getDistance(r)/t;this.uvs.push(s,0),this.uvs.push(s,1)}if(r<o-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(o-1,0)?e=this.copyV3(1):e=this.copyV3(o-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 g.BufferAttribute(new Float32Array(this.positions),3),previous:new g.BufferAttribute(new Float32Array(this.previous),3),next:new g.BufferAttribute(new Float32Array(this.next),3),side:new g.BufferAttribute(new Float32Array(this.side),1),width:new g.BufferAttribute(new Float32Array(this.width),1),uv:new g.BufferAttribute(new Float32Array(this.uvs),2),index:new g.BufferAttribute(new Uint16Array(this.indices_array),1),counters:new g.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 Ve(o,n,t,e,r){var i;if(o=o.subarray||o.slice?o:o.buffer,t=t.subarray||t.slice?t:t.buffer,o=n?o.subarray?o.subarray(n,r&&n+r):o.slice(n,r&&n+r):o,t.set)t.set(o,e);else for(i=0;i<o.length;i++)t[i+e]=o[i];return t}F.prototype.advance=function(o){var n=this._attributes.position.array,t=this._attributes.previous.array,e=this._attributes.next.array,r=n.length;Ve(n,0,t,0,r),Ve(n,6,n,0,r-6),n[r-6]=o.x,n[r-5]=o.y,n[r-4]=o.z,n[r-3]=o.x,n[r-2]=o.y,n[r-1]=o.z,Ve(n,6,e,0,r-6),e[r-6]=o.x,e[r-5]=o.y,e[r-4]=o.z,e[r-3]=o.x,e[r-2]=o.y,e[r-1]=o.z,this._attributes.position.needsUpdate=!0,this._attributes.previous.needsUpdate=!0,this._attributes.next.needsUpdate=!0};g.ShaderChunk.meshline_vert=["",g.ShaderChunk.logdepthbuf_pars_vertex,g.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;","",g.ShaderChunk.logdepthbuf_vertex,g.ShaderChunk.fog_vertex&&" vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );",g.ShaderChunk.fog_vertex,"}"].join(`
3751
+ `);g.ShaderChunk.meshline_frag=["",g.ShaderChunk.fog_pars_fragment,g.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;","","varying vec2 vUV;","varying vec4 vColor;","varying float vCounters;","","void main() {","",g.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);","",g.ShaderChunk.fog_fragment,"}"].join(`
3752
+ `);var Vt=class extends g.ShaderMaterial{constructor(n){super({uniforms:Object.assign({},g.UniformsLib.fog,{lineWidth:{value:1},map:{value:null},useMap:{value:0},alphaMap:{value:null},useAlphaMap:{value:0},color:{value:new g.Color(16777215)},opacity:{value:1},resolution:{value:new g.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 g.Vector2(1,1)}}),vertexShader:g.ShaderChunk.meshline_vert,fragmentShader:g.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)}}}),this.setValues(n)}};Vt.prototype.copy=function(o){return g.ShaderMaterial.prototype.copy.call(this,o),this.lineWidth=o.lineWidth,this.map=o.map,this.useMap=o.useMap,this.alphaMap=o.alphaMap,this.useAlphaMap=o.useAlphaMap,this.color.copy(o.color),this.opacity=o.opacity,this.resolution.copy(o.resolution),this.sizeAttenuation=o.sizeAttenuation,this.dashArray.copy(o.dashArray),this.dashOffset.copy(o.dashOffset),this.dashRatio.copy(o.dashRatio),this.useDash=o.useDash,this.visibility=o.visibility,this.alphaTest=o.alphaTest,this.repeat.copy(o.repeat),this};var qn="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 jn={texture_url:qn,lineWidth:8,color:16777215},se=class extends P.Object3D{constructor(t,e){super();this.navigation=t;this.config=Object.assign({},jn,e),this.registryEvent()}mesh=null;geometry=null;material=null;texture=null;config=jn;points=[];basicRepeat=1;registryEvent(){this.navigation.bmap.context.addEventListener("control-change",this.onControlChange),this.navigation.bmap.context.addEventListener("update",this.onUpdate)}unRegistryEvent(){this.navigation.bmap.context.removeEventListener("control-change",this.onControlChange),this.navigation.bmap.context.removeEventListener("update",this.onUpdate)}onControlChange=()=>{this.changeRepeat()};onUpdate=()=>{this.texture};getRepeat(){let{points:t,navigation:{bmap:{context:{camera:e,clientSize:{width:r,height:i}}}}}=this,s=t.map(([u,a])=>_(new P.Vector3(u,a,0),e,r,i)).map(({x:u,y:a})=>[u,a]);return bt(s)/32}changeRepeat(){if(!this.material)return;let t=this.getRepeat();this.material.repeat=new P.Vector2(t,1)}loadTexture(t){return new Promise((e,r)=>{new P.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)}async create(t){let e=this.geometry=new F;if(this.updatePoints(t),!this.texture){let s=this.texture=await this.loadTexture(this.config.texture_url);s.wrapS=s.wrapT=P.RepeatWrapping}let r=this.material=new Vt({useMap:!0,color:new P.Color(this.config.color),transparent:!0,resolution:new P.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:P.NormalBlending,repeat:new P.Vector2(this.getRepeat(),1)}),i=this.mesh=new P.Mesh(e,r);return this.add(i),i}dispose(){this.unRegistryEvent(),this.clear(),this.geometry?.dispose(),this.material?.dispose(),this.texture?.dispose()}};var ae=require("@tweenjs/tween.js"),Lr={path:{},speed:10,cheapMaximumDistance:20,needStartPoi:!1,startPoi:{},loadRoad:!0},He=class extends q{path=null;worker=ke();fetchRoadStatus=!1;uniqueKey=new lt;paths=[];options;pathTween=new ae.Group;startPoi=null;animationPathOptions={cPathIndex:0};cPath=[];constructor(n,t,e={}){super(n),this.options=Object.assign({},Lr,e);let{apiDomain:r,apiPath:{roadNetwork:i},apiInfo:s}=this.bmap.config;this.registryEvent(),this.options.loadRoad&&yt(this.worker,"load_road",{url:`${r||location.origin}${i}?project=${t}`,...s}).then(l=>{this.fetchRoadStatus=!0,this.dispatchEvent({type:"fetch-road-status",status:!0}),this.dispatchEvent({type:"fetch-road-data",roadInfo:l})}).catch(l=>{console.log("[\u52A0\u8F7D\u8DEF\u7F51\u5931\u8D25]",l)})}registryEvent(){this.bmap.context.addEventListener("update",this.onUpdate),this.bmap.addEventListener("switch_floor_after",this.onSwitchFloor)}unRegistryEvent(){this.bmap.context.removeEventListener("update",this.onUpdate),this.bmap.removeEventListener("switch_floor_after",this.onSwitchFloor)}onUpdate=()=>{this.pathTween.update()};async setRoadData(n){this.fetchRoadStatus=!1,this.dispatchEvent({type:"fetch-road-status",status:!1}),await yt(this.worker,"set_road_info",n),this.fetchRoadStatus=!0,this.dispatchEvent({type:"fetch-road-status",status:!0})}clearPath(){this.path&&(this.bmap.context.scene.remove(this.path),this.path.dispose(),this.path=null,this.pathTween.getAll().forEach(n=>n.stop()),this.pathTween.removeAll())}onSwitchFloor=({data:{curFloor:n}})=>{if(this.paths.length){let t=this.paths.find(e=>e.floor===n.name);t?this.renderPath(this.translatePoints(t.points)):this.clearPath()}else this.clearPath()};getDirectionPath(n){return yt(this.worker,"get_direction_path",n)}addPath(n){this.paths=n;let t=this.bmap.context.currentFloor?.name,e=n.find(r=>r.floor===t);if(e)if(this.bmap.currentBuildGround)this.renderPath(this.translatePoints(e.points));else{let r=()=>{this.bmap.removeEventListener("center-change",r),this.renderPath(this.translatePoints(e.points))};this.bmap.addEventListener("center-change",r)}else this.clearPath()}translatePoints(n){let[t,e]=this.bmap.buildingCenter;return n.map(r=>[r[0]-t,r[1]-e])}getPath(n,t,e=""){return new Promise((r,i)=>{let s=()=>{yt(this.worker,"get_path",{start:n,end:t,type:e}).then(l=>{l?typeof l=="string"?i(l):r(l):i("no-path")})};if(this.fetchRoadStatus)s();else{let l=({status:u})=>{u&&(this.removeEventListener("fetch-road-status",l),s())};this.addEventListener("fetch-road-status",l)}})}renderPath(n){let t=this.catmullRomCurve3(n);this.cPath=t,this.animationPathOptions={cPathIndex:0},this.path?this.path.updatePoints(t):(this.path=new se(this,this.options.path),this.path.create(t),this.path.position.z=this.bmap.context.currentFloor.groundMaxHeight+1,this.bmap.context.scene.add(this.path)),this.startPoi&&(this.startPoi.dispose(),this.startPoi=null),this.options.needStartPoi&&(this.startPoi=this.bmap.context.currentFloor?.addPoi({...this.options.startPoi,position:{x:t[0][0],y:t[0][1],z:1e-4},collision_enable:!1})||null)}catmullRomCurve3(n){return Te(n,!1,!0,.1,150,2.5)}async animationTo(n,t=this.options.speed){if(n.floor!==this.bmap.context.currentFloor?.name||!this.path)return;let{animationPathOptions:{cPathIndex:e}}=this,r=[this.path.points[0],...this.cPath.slice(e+1)],i=this.translatePoints([n.pos])[0],{distance:s,pos:l,index:u}=r.reduce((f,y,m,S)=>{if(m===S.length-1)return f;let{distance:A,closestPoint:M}=Ce(i,y,S[m+1]);return A<f.distance&&(f.distance=A,f.pos=M,f.index=m),f},{distance:Number.MAX_SAFE_INTEGER,pos:n.pos,index:0});if(s>this.options.cheapMaximumDistance||this.path.points[0][0]===l[0]&&this.path.points[0][1]===l[1])return;let a=0,c=[];if(u===0)a=I(r[0],l),c=[a];else{c=[I(r[0],r[1])];for(let f=1;f<u;f++)c.push(I(r[f],r[f+1]));c.push(I(r[u],l)),a=c.reduce((f,y)=>f+y,0)}let p=this.kmPerHourToMetersPerSecond(t),d=a/p;this.pathTween.getAll().forEach(f=>f.stop()),this.pathTween.removeAll();let h={distance:0};return new Promise(f=>{let y=new ae.Tween(h,this.pathTween).to({distance:a},d*1e3).onUpdate(()=>{for(let m=0;m<c.length;m++){let S=c.slice(0,m+1).reduce((A,M)=>A+M,0);if(S>=h.distance){let A=S-c[m],M=h.distance-A,w=r[m],et=r[m+1],K=Pe(w,et,M);this.path?.updatePoints([K,...r.slice(m+1)]),this.animationPathOptions.cPathIndex+=m,this.startPoi&&this.startPoi.position.setX(K[0]).setY(K[1]),this.dispatchEvent({type:"path-animation"});return}}}).onComplete(()=>{this.pathTween.remove(y),this.dispatchEvent({type:"path-animation-end"}),f(!0)}).start()})}kmPerHourToMetersPerSecond(n){return n*1e3/3600}dispose(){this.worker.terminate(),this.unRegistryEvent(),this.path?.dispose(),this.uniqueKey.dispose(),this.startPoi?.dispose()}};var We=class extends q{cacheData=new Map;floorDataLengthMap=new Map;async load(n){let t=z(n);if(this.cacheData.has(t))return this.cacheData.get(t);console.time("floor/get\u8BF7\u6C42"+n.resource_type_list);let[,e]=await Promise.all([this.loadBuildGround(n),kt(n,this.bmap.config)]);console.timeEnd("floor/get\u8BF7\u6C42"+n.resource_type_list);let r=z({floor:n.floor,ts:n.ts});this.bmap.transformGraphicData(e,this.bmap.buildingCenter,this.floorDataLengthMap.get(r)||0),e.forEach(s=>s.info.transformToBuildingGround=!1),this.cacheData.set(t,e);let i=this.floorDataLengthMap.get(r)||0;return this.floorDataLengthMap.set(r,i+e.length),e}isSameFloor(n){return this.bmap.context.currentFloor?.key===z(n)}switchFloorByData(n,t){if(this.isSameFloor(t)){if(!n.length)return;let e=this.bmap.context.currentFloor,r=e.userData.legacyToGraphicMap,i=e.userData.graphicMap,s=[];for(let l of n){if(l.info.group==="ground")e.createGround(l.info);else{let u=e.addGraphic(l.info);u.userData.data=l,r.set(l.legacy_id,u),s.push(u)}i.set(l.element_uuid,l)}this.bmap.triggerHooks("switch_floor_before",{curFloor:e,graphics:s}),this.bmap.initialFloorCamera(),this.bmap.triggerHooks("switch_floor_after",{curFloor:e,graphics:s})}else{let e=z(t),{curFloor:r,graphics:i}=this.bmap.createFloor(n);r.name=t.floor,r.key=e;let s=new Map;n.forEach(l=>{s.set(l.element_uuid,l)}),r.userData.graphicMap=s,this.bmap.triggerHooks("switch_floor_before",{curFloor:r,graphics:i}),this.bmap.context.switchFloor(r),this.bmap.initialFloorCamera(),this.bmap.triggerHooks("switch_floor_after",{curFloor:r,graphics:i})}}filterData(n,t){if(!this.isSameFloor(t))return n;let e=this.bmap.context.currentFloor.userData.graphicMap;return n.filter(r=>!e.has(r.element_uuid))}async switchFloorByStoreData(n){let t=await this.load({...n,resource_type_list:"6"}),e=this.filterData(t,n);this.switchFloorByData(e,n)}async switchFloorByOtherData(n){let t=await this.load({...n,resource_type_list:"1,2,3,4"}),e=this.filterData(t,n);this.switchFloorByData(e,n)}async loadBuildGround({brand:n,project:t}){let e=z({brand:n,project:t});return await this.bmap.loadBuildingGround({brand:n,project:t}),this.bmap.currentBuildGround=this.bmap.buildingGroundMap.get(e)||null,this.bmap.currentBuildGround}async changeFloor(n){return await Promise.all([this.switchFloorByStoreData(n),this.switchFloorByOtherData(n)]),Array.from(this.bmap.context.currentFloor.userData.graphicMap.values())}};var Yn=require("three"),Xe=class extends q{poiLayer;floors=[];group=new Yn.Group;constructor(n){super(n),this.poiLayer=new ut(n.context)}show(n){let t=n[0].userData.height;n.forEach(i=>{i.poiLayer.pois.forEach(s=>{this.poiLayer.pushPoi(s)}),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}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 W;function Zn(o="aibee_map"){return new Promise((n,t)=>{if(W)return n({db:W,type:"success"});let e=indexedDB.open(o);e.onupgradeneeded=function(r){W=r.target.result,console.log("onupgradeneeded"),n({db:W,type:"onupgradeneeded"})},e.onsuccess=r=>{W=r.target.result,n({db:W,type:"success"})},e.onerror=r=>{t(r)}})}function Kn(o,n,t=W){return new Promise((e,r)=>{t||r("\u6CA1\u6709db");let s=t.transaction([o],"readonly").objectStore(o).get(n);s.onsuccess=()=>{s.result?e(s.result.value):e(null)},s.onerror=l=>{console.log("[getVersionByKey]",l),e(null)}})}function $n(o,n,t,e=W){return new Promise((r,i)=>(e||i("\u6CA1\u6709db"),new Promise((s,l)=>{let a=e.transaction([o],"readwrite").objectStore(o).add({key:n,value:t});a.onsuccess=function(c){s(c)},a.onerror=function(c){l(c)}})))}function le(o,n=W){n&&(n.objectStoreNames.contains(o)||n.createObjectStore(o,{keyPath:"key"}))}function Jn(){W?.close(),W=null}function tt(o,n,t=0){o.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=>xt(i,n))))):e.geometry.coords=xt(e.geometry.cds,n)});for(let e=0;e<o.length;e++){let r=o[e];r.deltaHeight=1e-5*(t+e+1)}}function xt(o,n){return[o[0]-n[0],o[1]-n[1]]}var Ir={loadRoadNetwork:!1},qe="version",Qn="map_data",Nr="road_network_data",je=class{constructor(n){this.bmap=n;this.initDb()}floors=[];async initDb(){try{let{db:n,type:t}=await Zn();t==="onupgradeneeded"&&(le(qe),le(Qn),le(Nr))}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 $n(n,`${t}`,e)}getCacheData(n,t){return Kn(n,`${t}`)}getFloorCacheKey(n){return`${n.floor_id}`}async getFloorData(n){let t=this.floors.find(i=>i.floor===n);if(!t)return null;let e=this.getFloorCacheKey(t),r=await this.getCacheData(qe,e);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 console.timeEnd("zstd_json"),this.setCacheData(Qn,t,e),this.setCacheData(qe,t,n.version_id),this.getDataByJson(e)}async getRoadNetworkData(){return Promise.all(this.floors.map(async n=>fetch(n.route_url).then(t=>t.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 Z(this.bmap.context),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":let s=[],l=new Map;tt(r.elements,e),r.elements.forEach(h=>{if(h.group==="ground")t.createGround(h);else{let f=t.addGraphic(h);s.push(f),l.set(h.id,f)}}),t.userData.graphics=s,t.userData.graphicMap=l;break;case"ground":tt(r.elements,e);let u=r.elements.map(h=>new L(this.bmap.context,h));t.addGrounds(u);break;case"wall":tt(r.elements,e);let a=r.elements.reduce((h,f)=>{let{fillColor:y,fillOpacity:m,strokeColor:S,strokeOpacity:A}=f,M=`${y}-${m}-${S}-${A}`;return h[M]?h[M].push(f):h[M]=[f],h},{});Object.values(a).forEach(h=>{let f=new Ot(this.bmap.context,h);t.wallLayer.add(f)});break;case"lane":tt(r.elements,e);let c=r.elements.reduce((h,f)=>{let{fillColor:y,fillOpacity:m,strokeColor:S,strokeOpacity:A}=f,M=`${y}-${m}-${S}-${A}`;return h[M]?h[M].push(f):h[M]=[f],h},{});Object.values(c).forEach(h=>{let f=new Ut(this.bmap.context,h);t.laneLayer.add(f)});break;case"texture2d":case"texture3d":tt(r.elements,e),r.elements.forEach(h=>{let f=new Dt(this.bmap.context,h);t.textureLayer.add(f)});break;case"glb":tt(r.elements,e),r.elements.forEach(h=>{let f=new Ft(this.bmap.context,{...h,url:h.secondUrl,rotate:h.secondRotate,width:h.secondWidth});t.glbModelLayer.add(f)});break;case"store":r.elements.map(h=>{let f=xt([h.center_x,h.center_y],e);t.poiLayer.createPoi({icon:h.poi_info.icon,texts:[{text:h.store_name||h.poi_info.name}],position:{x:f[0],y:f[1],z:h.airHeight}})});break;case"facility":r.elements.map(h=>{let f=xt(h.geometry.cds,e);t.poiLayer.createPoi({icon:h.poi_info.icon,texts:[{text:h.store_name||h.poi_info.name}],position:{x:f[0],y:f[1],z:h.airHeight}})});break;case"parkingSpace":tt(r.elements,e);let p=[],d=new Map;r.elements.forEach(h=>{let f=t.addGraphic(h);p.push(f),d.set(h.id,f);let y=xt([h.center_x,h.center_y],e);t.poiLayer.createPoi({texts:[{text:h.poi_info.name}],position:{x:y[0],y:y[1],z:h.airHeight}})}),t.userData.parkingSpaces=p,t.userData.parkingSpacesGraphicMap=d;break}}),t.userData.center=e,t.userData.height=n.floorHeight,t}clear(){}dispose(){this.clear(),Jn()}};
3727
3753
  //# sourceMappingURL=bmap.cjs.min.js.map