@aibee/crc-bmap 0.13.6 → 0.13.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/index.cjs +9 -9
- package/lib/index.esm.min.js +9 -9
- package/lib/index.online.esm.min.js +9 -9
- package/lib/index.online.min.js +1 -1
- package/lib/meta.json +9726 -0
- package/package.json +84 -92
- package/README.md +0 -3
package/lib/index.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";var Ua=Object.create;var wn=Object.defineProperty;var Fa=Object.getOwnPropertyDescriptor;var Ba=Object.getOwnPropertyNames,Po=Object.getOwnPropertySymbols,za=Object.getPrototypeOf,Lo=Object.prototype.hasOwnProperty,Ga=Object.prototype.propertyIsEnumerable;var mi=(a,t,e)=>t in a?wn(a,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):a[t]=e,Tn=(a,t)=>{for(var e in t||(t={}))Lo.call(t,e)&&mi(a,e,t[e]);if(Po)for(var e of Po(t))Ga.call(t,e)&&mi(a,e,t[e]);return a};var Ge=(a,t)=>()=>(t||a((t={exports:{}}).exports,t),t.exports),No=(a,t)=>{for(var e in t)wn(a,e,{get:t[e],enumerable:!0})},Oo=(a,t,e,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of Ba(t))!Lo.call(a,r)&&r!==e&&wn(a,r,{get:()=>t[r],enumerable:!(n=Fa(t,r))||n.enumerable});return a};var _i=(a,t,e)=>(e=a!=null?Ua(za(a)):{},Oo(t||!a||!a.__esModule?wn(e,"default",{value:a,enumerable:!0}):e,a)),ka=a=>Oo(wn({},"__esModule",{value:!0}),a);var pt=(a,t,e)=>mi(a,typeof t!="symbol"?t+"":t,e);var g=(a,t,e)=>new Promise((n,r)=>{var i=u=>{try{s(e.next(u))}catch(l){r(l)}},o=u=>{try{s(e.throw(u))}catch(l){r(l)}},s=u=>u.done?n(u.value):Promise.resolve(u.value).then(i,o);s((e=e.apply(a,t)).next())});var Uo=Ge((tl,Do)=>{Do.exports=function(t,e){return t[0]=e[0],t[1]=e[1],t}});var zo=Ge((el,Bo)=>{var Fo=Uo();Bo.exports=function(a,t){Array.isArray(t)||(t=[]),a.length>0&&t.push(Fo([0,0],a[0]));for(var e=0;e<a.length-1;e++){var n=a[e],r=a[e+1],i=n[0],o=n[1],s=r[0],u=r[1],l=[.75*i+.25*s,.75*o+.25*u],c=[.25*i+.75*s,.25*o+.75*u];t.push(l),t.push(c)}return a.length>1&&t.push(Fo([0,0],a[a.length-1])),t}});var Wo=Ge((sl,Ho)=>{var Pi=class{constructor(){this.keys=new Set,this.queue=[]}sort(){this.queue.sort((t,e)=>t.priority-e.priority)}set(t,e){let n=Number(e);if(isNaN(n))throw new TypeError('"priority" must be a number');return this.keys.has(t)?this.queue.map(r=>(r.key===t&&Object.assign(r,{priority:n}),r)):(this.keys.add(t),this.queue.push({key:t,priority:n})),this.sort(),this.queue.length}next(){let t=this.queue.shift();return this.keys.delete(t.key),t}isEmpty(){return this.queue.length===0}has(t){return this.keys.has(t)}get(t){return this.queue.find(e=>e.key===t)}};Ho.exports=Pi});var jo=Ge((al,qo)=>{function Xo(a,t){let e=new Map;for(let[n,r]of a)n!==t&&r instanceof Map?e.set(n,Xo(r,t)):n!==t&&e.set(n,r);return e}qo.exports=Xo});var Ko=Ge((ul,Zo)=>{function Qa(a){let t=Number(a);return!(isNaN(t)||t<=0)}function Yo(a){let t=new Map;return Object.keys(a).forEach(n=>{let r=a[n];if(r!==null&&typeof r=="object"&&!Array.isArray(r))return t.set(n,Yo(r));if(!Qa(r))throw new Error(`Could not add node at key "${n}", make sure it's a valid node`,r);return t.set(n,Number(r))}),t}Zo.exports=Yo});var Qo=Ge((ll,Jo)=>{function $o(a){if(!(a instanceof Map))throw new Error(`Invalid graph: Expected Map instead found ${typeof a}`);a.forEach((t,e)=>{if(typeof t=="object"&&t instanceof Map){$o(t);return}if(typeof t!="number"||t<=0)throw new Error(`Values must be numbers greater than 0. Found value ${t} at ${e}`)})}Jo.exports=$o});var Ni=Ge((cl,ns)=>{var tu=Wo(),eu=jo(),ts=Ko(),es=Qo(),Li=class{constructor(t){t instanceof Map?(es(t),this.graph=t):t?this.graph=ts(t):this.graph=new Map}addNode(t,e){let n;return e instanceof Map?(es(e),n=e):n=ts(e),this.graph.set(t,n),this}addVertex(t,e){return this.addNode(t,e)}removeNode(t){return this.graph=eu(this.graph,t),this}path(t,e,n={}){if(!this.graph.size)return n.cost?{path:null,cost:0}:null;let r=new Set,i=new tu,o=new Map,s=[],u=0,l=[];if(n.avoid&&(l=[].concat(n.avoid)),l.includes(t))throw new Error(`Starting node (${t}) cannot be avoided`);if(l.includes(e))throw new Error(`Ending node (${e}) cannot be avoided`);for(i.set(t,0);!i.isEmpty();){let c=i.next();if(c.key===e){u=c.priority;let p=c.key;for(;o.has(p);)s.push(p),p=o.get(p);break}r.add(c.key),(this.graph.get(c.key)||new Map).forEach((p,f)=>{if(r.has(f)||l.includes(f))return null;if(!i.has(f))return o.set(f,c.key),i.set(f,c.priority+p);let d=i.get(f).priority,m=c.priority+p;return m<d?(o.set(f,c.key),i.set(f,m)):null})}return s.length?(n.trim?s.shift():s=s.concat([t]),n.reverse||(s=s.reverse()),n.cost?{path:s,cost:u}:s):n.cost?{path:null,cost:0}:null}shortestPath(...t){return this.path(...t)}};ns.exports=Li});var s0={};No(s0,{AibeeLoader:()=>Je,BMap:()=>ro,BMapSelect:()=>ho,BaseSvg:()=>Vt,CarInertialPosition:()=>Er,ClickHelper:()=>Nn,Context:()=>hr,ContextCamera:()=>cr,ContextScene:()=>lr,Control:()=>ar,CrLoader:()=>no,CrNavPath:()=>co,Equipment:()=>io,EventDispatcher:()=>ct,Events:()=>Ai,Floor:()=>re,GlbModel:()=>Wi,Graphic:()=>mt,GraphicLayer:()=>kn,GroundTexture:()=>Le,HeatmapElement:()=>zn,HighlightPoi:()=>Eo,HooksName:()=>bt,HoverHelper:()=>or,InstancedGraphic:()=>Ke,InstancedModel:()=>qn,InstancedParkingSpace:()=>nn,InstancedWall:()=>rr,KalmanFilter:()=>Dn,Lane:()=>Qn,Layer:()=>nt,LineElement:()=>un,MapTypePolar:()=>Hu,MergeAttributeGraphic:()=>an,MergeAttributeGroundTexture:()=>Ne,MergeAttributeLane:()=>nr,MergeAttributeWall:()=>er,MergeGraphic:()=>Xi,MergedAttributeGraphicLine:()=>Oe,MergedGraphicLayer:()=>Yn,MergedModelLayer:()=>Xn,Model:()=>Gn,MulFloorNavigation:()=>po,MulFloorSelect:()=>fo,MulFloors:()=>ao,NavPath:()=>gr,Navigation:()=>so,Overlay:()=>Ze,ParkingLayer:()=>Wn,ParkingType:()=>Wu,PathDirection:()=>ce,PdrPosition:()=>yr,Poi:()=>Pe,Poi2:()=>st,PoiLayer:()=>Vn,PoiLayer2:()=>Hn,Position:()=>vo,RENDER_VERSION:()=>fn,RecommendParkingSpace:()=>mo,Renderer:()=>ur,RoadNetwork:()=>Oi,RoadNetwork2:()=>Di,SENSOR_TYPE:()=>G,SatelliteTile:()=>So,SelectBox:()=>Hi,Selection:()=>ir,Sensor:()=>mr,Shadow:()=>Bn,Socket:()=>xn,SortByDistance:()=>bo,SvgLine:()=>Kn,SvgPolygon:()=>$n,TaskQueue:()=>Ye,TextTexture:()=>tr,TileLayer:()=>De,TileLoader:()=>Zn,Timer:()=>$,TweenUtil:()=>be,UA:()=>wi,UseMyPosition:()=>xo,Wall:()=>Jn,WorkerPool:()=>On,addAlphaToHexColor:()=>ja,calc_angle:()=>ke,calc_direction:()=>Tr,calculateInstantaneousSpeed:()=>Qu,calculateLineDirection:()=>vr,convertToSnakeCase:()=>Ui,createCircle:()=>tn,createLine:()=>Rn,createRect:()=>Ee,createSvg:()=>bi,createSvgElement:()=>In,createThreeBox:()=>iu,createThreeLine:()=>ru,darkenColor:()=>le,defaultConfig:()=>aa,defaultGraphicOptions:()=>de,defaultOptions:()=>Wr,defaultTextTextureOptions:()=>qs,deviceToVector3:()=>Va,dispose:()=>F,distancePointToSegment:()=>Ii,generatorKeyByObj:()=>Xe,getAngle:()=>ko,getBorderPoints:()=>Rr,getCenter:()=>Cn,getConfig:()=>Ki,getDirectPath:()=>Ja,getDirectionByAngle:()=>Ar,getDistanceByPathPos:()=>Ri,getLength:()=>U,getLongestSideDir:()=>Ha,getMinEdgeSquare:()=>Wa,getPathLength:()=>Rt,getPointEdgeIndex:()=>ue,getPosByPathDistance:()=>qe,hasChinese:()=>xi,hexToRgb:()=>wr,initDirectionalLight:()=>vi,initLight:()=>yi,initShape:()=>An,instancedGeometiesAttributes:()=>su,isAndroid:()=>Ya,isContain:()=>xe,isControl:()=>We,isIphone:()=>Ie,isMac:()=>He,isPointInPolygon:()=>Ei,isRectangle:()=>au,loadBuildingGround:()=>to,loadExternalStreet:()=>ku,loadGraphics:()=>eo,mergeGraphicGeometries:()=>ou,mergeGraphicLineGeometries:()=>cs,moveOnRoute:()=>$a,predictFuturePosition:()=>vn,predictFutureSpeed:()=>t0,proxyOptions:()=>Ve,removeOutliers:()=>e0,removeWeightPath:()=>Vo,setCirclePosition:()=>Ce,setLineStartEnd:()=>Yt,setRectPosition:()=>Ct,simplifyPath:()=>Pn,sleepByRf:()=>Mi,sleepOnePromise:()=>Si,sleepOneRf:()=>Mr,smoothPath:()=>Ci,strToNumber:()=>qa,timeoutPromise:()=>Gt,toWebWorker:()=>nu,transformGraphicData:()=>Ln,transformSpeed:()=>fi,translatePosToCenter:()=>je,triggerWorker:()=>Z,vector3ToDevice:()=>N,xhrGet:()=>Za});module.exports=ka(s0);function v(){return v=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},v.apply(this,arguments)}var Mv=require("core-js/modules/es.array.push.js"),wv=require("core-js/modules/web.dom-collections.iterator.js"),Tv=require("core-js/modules/es.json.stringify.js"),Xt=require("three");var Ny=require("core-js/modules/web.dom-collections.iterator.js");var l0=require("core-js/modules/es.set.difference.v2.js"),c0=require("core-js/modules/es.set.intersection.v2.js"),h0=require("core-js/modules/es.set.is-disjoint-from.v2.js"),p0=require("core-js/modules/es.set.is-subset-of.v2.js"),f0=require("core-js/modules/es.set.is-superset-of.v2.js"),d0=require("core-js/modules/es.set.symmetric-difference.v2.js"),g0=require("core-js/modules/es.set.union.v2.js"),m0=require("core-js/modules/web.dom-collections.iterator.js"),$=class{requestAnimationFrame(t){let e=window.requestAnimationFrame(()=>{this.tasks.requestAnimation.delete(e),t()});return this.tasks.requestAnimation.add(e),e}cancelAnimationFrame(t){this.tasks.requestAnimation.delete(t),window.cancelAnimationFrame(t)}setTimeout(t,e){let n=window.setTimeout(()=>{this.tasks.timeout.delete(n),t()},e);return this.tasks.timeout.add(n),n}clearTimeout(t){this.tasks.timeout.delete(t),window.clearTimeout(t)}setInterval(t,e){let n=window.setInterval(()=>{t()},e);return this.tasks.interval.add(n),n}clearInterval(t){this.tasks.interval.delete(t),window.clearInterval(t)}requestIdleCallback(t,e){let n=window.requestIdleCallback(r=>{this.tasks.requestIdleCallback.delete(n),t(r)},e);return this.tasks.requestIdleCallback.add(n),n}cancelIdleCallback(t){this.tasks.requestIdleCallback.delete(t),window.cancelIdleCallback(t)}dispose(){this.tasks.requestAnimation.forEach(t=>{window.cancelAnimationFrame(t)}),this.tasks.requestAnimation.clear(),this.tasks.requestIdleCallback.forEach(t=>{window.cancelIdleCallback(t)}),this.tasks.requestIdleCallback.clear(),this.tasks.timeout.forEach(t=>{window.clearTimeout(t)}),this.tasks.timeout.clear(),this.tasks.interval.forEach(t=>{window.clearInterval(t)}),this.tasks.interval.clear()}constructor(){this.tasks={requestAnimation:new Set,requestIdleCallback:new Set,timeout:new Set,interval:new Set}}};var y0=require("core-js/modules/web.dom-collections.iterator.js"),v0=require("core-js/modules/es.array.push.js"),zt=require("three");function yi(){let a=new zt.Group,t=new zt.AmbientLight(16777215,.3);return a.add(t),a}function An(a,t){t===void 0&&(t=[]);let e=new zt.Shape(a.map(n=>new zt.Vector2(...n)));return t.length&&t.forEach(n=>{var r=new zt.Path(n.map(i=>new zt.Vector2(...i)));e.holes.push(r)}),e}function vi(a,t){a===void 0&&(a=16777215),t===void 0&&(t=1);let e=new zt.DirectionalLight(a,t);return e.castShadow=!0,e.shadow.radius=8,e.shadow.bias=-.001,e.shadow.mapSize.set(256,256),e.shadow.camera.left=-200,e.shadow.camera.right=200,e.shadow.camera.top=200,e.shadow.camera.bottom=-200,e}function F(a,t){if(t&&a.children&&a.children.length&&a.children.forEach(e=>{F(e,t)}),a.isMesh){let e=a;e.geometry&&e.geometry.dispose(),e.material&&(Array.isArray(e.material)?e.material.forEach(n=>{n.dispose()}):e.material.dispose())}a.isLight&&(a.dispose==null||a.dispose.call(a))}var b0=require("core-js/modules/es.regexp.exec.js");function xi(a){return/[\u4E00-\u9FA5]+/g.test(a)}var M0=require("core-js/modules/web.dom-collections.iterator.js"),ft=require("three"),Qe=require("@turf/turf");function N(a,t,e,n){let r=a.clone().project(t),i=e/2,o=n/2,s=Math.round(r.x*i+i),u=Math.round(-r.y*o+o);return{x:s,y:u}}function Va(a,t,e,n,r){if(!r)return null;e=Math.min(1,e),n=Math.min(1,n);let i=a/e*2-1,o=1-t/n*2;return new ft.Vector3(i,o,0).unproject(r)}function Cn(a){let t=(0,Qe.featureCollection)(a.map(n=>(0,Qe.point)(n)));return(0,Qe.center)(t).geometry.coordinates}function xe(a,t,e){return a.x>=t.x&&a.x<=e.x&&a.y>=t.y&&a.y<=e.y}function Ha(a){let t=0,e=new ft.Vector3;for(let n=1;n<a.length;n++){let r=new ft.Vector3(a[n-1][0],a[n-1][1],0),i=new ft.Vector3(a[n][0],a[n][1],0),o=i.distanceTo(r);o>t&&(t=o,e=i.clone().sub(r).normalize())}return e}function U(a,t){return Math.sqrt((t[0]-a[0])**2+(t[1]-a[1])**2)}function Rt(a){let t=0;for(let e=0;e<a.length-1;e++)t+=U(a[e],a[e+1]);return t}function ke(a,t,e){let n=new ft.Vector2(t[0]-a[0],t[1]-a[1]),r=new ft.Vector2(t[0]-e[0],t[1]-e[1]),o=n.angleTo(r)*180/Math.PI,s=new ft.Vector2(t[0]-a[0],t[1]-a[1]);return new ft.Vector2(e[0]-a[0],e[1]-a[1]).cross(s)>0?o:-o}function Wa(a,t){let e=Math.min(U(a[0][0],a[0][1]),U(a[0][2],a[0][1]))-1;t||(t=Cn(a[0]));let n=Xa(t,e),r=new ft.Vector2(a[0][0][0],a[0][0][1]),i=new ft.Vector2(a[0][1][0],a[0][1][1]),o=new ft.Vector2(a[0][2][0],a[0][2][1]),u=(r.distanceTo(i)>i.distanceTo(o)?i.clone().sub(r):o.clone().sub(i)).angleTo(new ft.Vector2(0,1)),l=new ft.Matrix3;return l.multiply(new ft.Matrix3().translate(t[0],t[1])).multiply(new ft.Matrix3().rotate(u)).multiply(new ft.Matrix3().translate(-t[0],-t[1])),[n.map(c=>{let h=new ft.Vector2(c[0],c[1]).applyMatrix3(l);return[h.x,h.y]})]}function Xa(a,t){let e=t/2;return[[a[0]-e,a[1]+e],[a[0]+e,a[1]+e],[a[0]+e,a[1]-e],[a[0]-e,a[1]-e],[a[0]-e,a[1]+e]]}function ue(a,t){let e=0,n=1/0,[r,i]=t;for(let o=0;o<a.length-1;o++){let[s,u]=a[o],[l,c]=a[o+1],h=Math.min(s,l)<=r&&r<=Math.max(s,l),p=Math.min(u,c)<=i&&i<=Math.max(u,c);if(h&&p){let f=Math.abs((l-s)*(i-u)-(c-u)*(r-s));f<n&&(n=f,e=o)}}return e}function Ei(a,t){let e=a[0],n=a[1],r=!1;for(let i=0,o=t.length-1;i<t.length;o=i++){let s=t[i][0],u=t[i][1],l=t[o][0],c=t[o][1];u>n!=c>n&&e<(l-s)*(n-u)/(c-u)+s&&(r=!r)}return r}var T0=require("core-js/modules/es.reflect.to-string-tag.js");function Ve(a,t){return new Proxy(a,{get:(e,n,r)=>Reflect.get(e,n,r),set:(e,n,r,i)=>{let o=Reflect.get(e,n,i),s=Reflect.set(e,n,r,i);return o!==r&&t.dispatchEvent({type:"change-"+n,value:r}),s}})}var C0=require("core-js/modules/web.dom-collections.iterator.js"),I0=require("core-js/modules/es.error.cause.js");function Gt(a,t){return Promise.race([a,new Promise((e,n)=>{setTimeout(()=>n(new Error("Promise timeout")),t)})])}function In(a){return document.createElementNS("http://www.w3.org/2000/svg",a)}function bi(a,t){let e=In("svg");return e.setAttribute("width",a),e.setAttribute("height",t),e.style.cssText="position: absolute; left: 0; top: 0; pointer-events: none;",e}function tn(a,t){a===void 0&&(a="2");let e=In("circle");return e.setAttribute("r",a),e.setAttribute("fill",t),e}function Rn(a){let t=In("line");return t.setAttribute("stroke",a),t}function Ee(a,t){let e=In("rect");return e.setAttribute("stroke",a),e.setAttribute("fill",t),e}function Ce(a,t,e){a.setAttribute("cx",""+t),a.setAttribute("cy",""+e)}function Yt(a,t,e){t&&(a.setAttribute("x1",""+t.x),a.setAttribute("y1",""+t.y)),e&&(a.setAttribute("x2",""+e.x),a.setAttribute("y2",""+e.y))}function Ct(a,t,e,n,r){a.setAttribute("x",""+t),a.setAttribute("y",""+e),a.setAttribute("width",""+n),a.setAttribute("height",""+r)}function Si(){return Promise.resolve()}function Mr(){return new Promise(a=>{requestAnimationFrame(a)})}function Mi(a){return a===void 0&&(a=1),new Promise(t=>{function e(){a<=0?t(!0):(a--,window.requestAnimationFrame(e))}window.requestAnimationFrame(e)})}var N0=require("core-js/modules/es.string.replace.js"),O0=require("core-js/modules/es.regexp.exec.js"),D0=require("core-js/modules/es.string.trim.js");function qa(a){return parseInt(a.replace("#","0x"),16)}function ja(a,t){let e=parseInt(a.substring(1,3),16),n=parseInt(a.substring(3,5),16),r=parseInt(a.substring(5,7),16),i=Math.round(e*t),o=Math.round(n*t),s=Math.round(r*t);return"#"+(1<<24|i<<16|o<<8|s).toString(16).slice(1)}function le(a,t){t===void 0&&(t=.85);let e,n,r;if(a.startsWith("#"))e=parseInt(a.substring(1,3),16),n=parseInt(a.substring(3,5),16),r=parseInt(a.substring(5,7),16);else{let o=a.slice(4,-1).split(",");e=parseInt(o[0].trim()),n=parseInt(o[1].trim()),r=parseInt(o[2].trim())}return e=Math.min(Math.floor(e*t),255),n=Math.min(Math.floor(n*t),255),r=Math.min(Math.floor(r*t),255),"#"+((1<<24)+(e<<16)+(n<<8)+r).toString(16).slice(1)}function wr(a,t){a=a.replace(/^#/,"");let e=parseInt(a.substring(0,2),16),n=parseInt(a.substring(2,4),16),r=parseInt(a.substring(4,6),16);return t!==void 0?"rgba("+e+", "+n+", "+r+", "+t+")":"rgb("+e+", "+n+", "+r+")"}var F0=require("core-js/modules/es.regexp.exec.js"),He=navigator.userAgent.toUpperCase().indexOf("MAC")>=0,wi=(navigator.userAgent||"").toLocaleLowerCase(),Ie=/ios|iphone/i.test(wi),Ya=/android|adr|linux/gi.test(wi);function We(a){return He?a==="Meta":a==="Control"}var k0=require("core-js/modules/es.set.difference.v2.js"),V0=require("core-js/modules/es.set.intersection.v2.js"),H0=require("core-js/modules/es.set.is-disjoint-from.v2.js"),W0=require("core-js/modules/es.set.is-subset-of.v2.js"),X0=require("core-js/modules/es.set.is-superset-of.v2.js"),q0=require("core-js/modules/es.set.symmetric-difference.v2.js"),j0=require("core-js/modules/es.set.union.v2.js"),Y0=require("core-js/modules/web.dom-collections.iterator.js"),Ti="__once__",Ai=class{on(t,e){if(typeof e!="function")return;let n=this.events.get(t);return n?n.add(e):this.events.set(t,new Set([e]))}once(t,e){if(typeof e!="function")return;let n=""+Ti+t,r=this.events.get(n);return r?r.add(e):this.events.set(n,new Set([e]))}off(t,e){let n=this.events.get(t),r=this.events.get(""+Ti+t);!n&&!r||(e===void 0&&(n==null||n.clear(),r==null||r.clear()),n!=null&&n.has(e)&&n.delete(e),r!=null&&r.has(e)&&r.delete(e))}offAll(){this.events.clear()}emit(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];let i=this.events.get(t),o=this.events.get(""+Ti+t);!i&&!o||(i==null||i.forEach(s=>{typeof s=="function"&&s(...n)}),o==null||o.forEach(s=>{typeof s=="function"&&s(...n)}),o==null||o.clear())}constructor(){this.events=new Map}};var bt=function(a){return a.SWITCH_FLOOR_BEFORE="switch_floor_before",a.SWITCH_FLOOR_GROUND="switch_floor_ground",a.SWITCH_FLOOR_AFTER="switch_floor_after",a}({});var $0=require("core-js/modules/es.array.sort.js");function Xe(a){return Object.keys(a).sort().map(t=>t+"="+a[t]).join("&")}function Za(a,t){return new Promise((e,n)=>{let r=new XMLHttpRequest;r.open("GET",a,!0),Object.keys(t.headers||{}).forEach(i=>{r.setRequestHeader(i,t.headers[i])}),t.responseType&&(r.responseType=t.responseType),r.onload=()=>{if(r.status>=200&&r.status<300)if(t.responseType==="arraybuffer")e(r.response);else try{let i=JSON.parse(r.responseText);e(i)}catch(i){n(i)}else n(r.statusText)},r.onerror=()=>{n(r.statusText)},r.send()})}var nl=require("core-js/modules/web.dom-collections.iterator.js"),rl=require("core-js/modules/es.array.push.js"),en=require("three"),Go=_i(zo(),1);function ko(a,t){let e=a.clone().normalize(),n=t.clone().normalize();return Math.acos(e.dot(n))}function Ka(a){let t=0;return a.reduce((e,n)=>{let[r,i]=e,[o,s]=n;return t+=Math.sqrt((o-r)**2+(s-i)**2),[o,s]}),t/a.length}function Ci(a,t){if(t===void 0&&(t=.25),Ka(a)<t)return a;let e=(0,Go.default)(a);return Ci(e,t)}function Pn(a,t,e,n,r,i){t===void 0&&(t=!1),e===void 0&&(e=!0),n===void 0&&(n=5),r===void 0&&(r=150),i===void 0&&(i=3);let o=[],s=!t;if(o.push(a[0]),a.length<2)return o;for(let l=0;l<a.length-2;l+=1){let c=a[l],h=a[l+1],p=a[l+2],f=new en.Vector2(c[0]-h[0],c[1]-h[1]),d=new en.Vector2(p[0]-h[0],p[1]-h[1]),m=ko(f,d)/Math.PI*180,y=f.length()+d.length();(!s||m<r&&y>.01||y>n)&&(o.push(a[l+1]),s=!0)}if(o.push(a[a.length-1]),!e)return o;let u=[];u.push(o[0]);for(let l=0;l<o.length-2;l+=1){let c=new en.Vector2(o[l][0],o[l][1]),h=new en.Vector2(o[l+1][0],o[l+1][1]),p=new en.Vector2(o[l+2][0],o[l+2][1]),f=c.distanceTo(h)/2,d=p.distanceTo(h)/2,m=h.clone(),y=h.clone();m.add(c.clone().sub(h).normalize().multiplyScalar(f>i?i/2:f)),y.add(p.clone().sub(h).normalize().multiplyScalar(d>i?i/2:d));let x=[[m.x,m.y],[h.x,h.y],[y.x,y.y]];u.push(...Ci(x,i/25))}return u.push(o[o.length-1]),Vo(u)}function Vo(a){if(a.length<=1)return a;let t=[],e;return a.forEach(n=>{let[r,i]=n;e?r===e[0]&&i===e[1]||(e=[r,i],t.push([r,i])):(e=[r,i],t.push([r,i]))}),t}function Ii(a,t,e){let n=Math.sqrt((e[0]-t[0])**2+(e[1]-t[1])**2);if(n===0)return{distance:Math.sqrt((a[0]-t[0])**2+(a[1]-t[1])**2),closestPoint:t.slice(0)};let r=Math.max(0,Math.min(1,((a[0]-t[0])*(e[0]-t[0])+(a[1]-t[1])*(e[1]-t[1]))/n**2)),i=[t[0]+r*(e[0]-t[0]),t[1]+r*(e[1]-t[1])];return{distance:Math.sqrt((a[0]-i[0])**2+(a[1]-i[1])**2),closestPoint:i}}function $a(a,t,e){let[n,r]=a,[i,o]=t,s=Math.sqrt(Math.pow(i-n,2)+Math.pow(o-r,2));if(s===0||s<e)return[...t];let u=e/s,l=n+(i-n)*u,c=r+(o-r)*u;return[l,c]}var ce=function(a){return 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}({});function Tr(a,t,e){let n=ke(a,t,e);return Ar(n)}function Ar(a){return 180-Math.abs(a)<15?"front":a>135?"right_front":a<-135?"left_front":a<=135&&a>=60?"right":a>=-135&&a<=-60?"left":a<60&&a>0?"right_back":a>-60&&a<0?"left_back":"front"}function Ja(a){if(!a.length)return[];if(a.length===1)return[{direction:"start",distance:0,points:a}];let t=[{direction:"start",distance:U(a[0],a[1]),points:[a[0],a[1]]}];for(let e=2;e<a.length;e++){let n=Tr(a[e-2],a[e-1],a[e]);if(n==="front"){let r=t[t.length-1],i=U(a[e-1],a[e]);r.distance+=i,e!==2&&r.points.push(a[e-1])}else t.push({direction:n,distance:U(a[e-1],a[e]),points:[a[e-1],a[e]]})}return t.push({direction:"end",distance:0,points:[a[a.length-1]]}),t}function Ri(a,t){if(a.length<2)return-1;let e=0;for(let n=1;n<a.length;n++){let r=a[n-1],i=a[n],o=[t[0]-r[0],t[1]-r[1]],s=[i[0]-r[0],i[1]-r[1]],u=Math.min(i[0],r[0])<=t[0]&&t[0]<=Math.max(i[0],r[0]),l=Math.min(i[1],r[1])<=t[1]&&t[1]<=Math.max(i[1],r[1]);if(u&&l){let c=o[0]*s[1]-o[1]*s[0];if(Math.abs(c)<1e-6){let h=Math.sqrt((t[0]-r[0])**2+(t[1]-r[1])**2);return e+h}}e+=Math.sqrt((i[0]-r[0])**2+(i[1]-r[1])**2)}return-1}function qe(a,t){if(a.length<2){var e;return(e=a[0])!=null?e:null}let n=0;for(let r=1;r<a.length;r++){let i=a[r-1],o=a[r],s=Math.sqrt((o[0]-i[0])**2+(o[1]-i[1])**2);if(n+=s,n>=t){let u=(t-(n-s))/s,l=i[0]+(o[0]-i[0])*u,c=i[1]+(o[1]-i[1])*u;return[l,c]}}return null}var pl=require("core-js/modules/es.array.push.js"),fl=require("core-js/modules/web.dom-collections.iterator.js"),dl=require("core-js/modules/es.regexp.exec.js"),he=_i(Ni(),1);var Zt="___",Oi=class{initRoute(t){this.clear(),this.roadInfo=t,t.length&&(t.forEach(e=>{e.points.forEach(n=>{let r=""+e.floor+Zt+n.id;if(this.pointMap.set(r,n),this.nodeMap.set(""+n.floor+Zt+n.nodeId,r),n.type==="straightLadder"){let i=this.straightLadderMap.get(n.name)||[];i.push(v({},n)),this.straightLadderMap.set(n.name,i)}if(n.type==="staircase"){let i=this.staircaseMap.get(n.name)||[];i.push(v({},n)),this.staircaseMap.set(n.name,i)}if(n.type==="escalator"){let i=this.escalatorMap.get(n.name)||{};n.escalatorDirection==="exit"?i.end={floor:n.floor,id:n.id}:i.start={floor:n.floor,id:n.id},this.escalatorMap.set(n.name,i)}if(n.type==="facility"){let i=this.facilityMap.get(n.targetId)||[];i.push(v({},n)),this.facilityMap.set(n.targetId,i)}}),e.lines.filter(n=>n.direction!=="no").forEach(n=>{var r,i;let o=""+e.floor+Zt+n.from,s=""+e.floor+Zt+n.to,u=(r=this.pointMap.get(o))==null?void 0:r.cds,l=(i=this.pointMap.get(s))==null?void 0:i.cds;if(u!=null&&u.length&&(l!=null&&l.length)){let c=U(u,l);this.addLineItem(o,s,c),n.direction==="double"&&this.addLineItem(s,o,c)}})}),this.initBaseRoute(),this.initEscalatorRoute(),this.initStraightLadderRoute())}addLineItem(t,e,n,r){r===void 0&&(r=this.lineMap);let i=r.get(t)||new Map;i.set(e,n),r.set(t,i)}addFacilityToLineMap(t,e,n,r){[...this.straightLadderMap,...this.staircaseMap].forEach(i=>{let[o,s]=i;if(!(s.length<2))for(let c=0;c<s.length;c++){let h=""+s[c].floor+Zt+s[c].id;for(let p=0;p<s.length;p++)if(c!==p){var u,l;let f=""+s[p].floor+Zt+s[p].id,d=(u=this.pointMap.get(h))==null?void 0:u.cds,m=(l=this.pointMap.get(f))==null?void 0:l.cds;if(d!=null&&d.length&&(m!=null&&m.length))if(s[c].type==="straightLadder"){let y=e;this.addLineItem(h,f,y,r)}else{let y=n;this.addLineItem(h,f,y,r)}}}}),this.escalatorMap.forEach((i,o)=>{if(i.start&&i.end){var s,u;let l=""+i.start.floor+Zt+i.start.id,c=""+i.end.floor+Zt+i.end.id,h=(s=this.pointMap.get(l))==null?void 0:s.cds,p=(u=this.pointMap.get(c))==null?void 0:u.cds;if(h!=null&&h.length&&(p!=null&&p.length)){let f=t;this.addLineItem(l,c,f,r)}}})}initBaseRoute(){let t=new Map([...this.lineMap]);this.addFacilityToLineMap(1,this.lift_priority,3e4,t),this.baseRoute=new he.default(t)}initEscalatorRoute(){let t=new Map([...this.lineMap]),e=1e4;this.addFacilityToLineMap(1*e,this.lift_priority*e,3e4*e,t),this.escalatorRoute=new he.default(t)}initStraightLadderRoute(){let t=new Map([...this.lineMap]),e=1e4;this.addFacilityToLineMap(3*e,1*e,3e4*e,t),this.straightLadderRoute=new he.default(t)}checkStart(t){return!(!t.floor||!t.nodeId&&(!t.coord||t.coord.length<2))}checkEnd(t){return t.facility?!0:this.checkStart(t)}transformStart(t){var e;if(t.nodeId){let n=this.nodeMap.get(""+t.floor+Zt+t.nodeId);if(n){let[r,i]=n.split(Zt);return{floor:r,id:i}}}if((e=t.coord)!=null&&e.length){let n=this.roadInfo.find(i=>i.floor===t.floor);if(!n)return null;let r=n.points.reduce((i,o)=>{let s=U(t.coord,o.cds);return s<i.min&&(i.min=s,i.point=o),i},{min:1/0,point:n.points[0]});return{floor:r.point.floor,id:r.point.id}}return null}transformEnd(t){if(t.floor){let e=this.transformStart(t);if(e)return e}if(t.facility){let e=this.facilityMap.get(t.facility);if(e!=null&&e.length)return{floor:t.floor,facility:t.facility}}return null}getPath(t,e,n){if(n===void 0&&(n=""),!this.checkStart(t))return"start-error";if(!this.checkEnd(e))return"end-error";let r=this.transformStart(t);if(!r)return"no-start";let i=this.transformEnd(e);if(!i)return"no-end";let o=this.getBasePath.bind(this);switch(n){case"escalator":o=this.getEscalatorPath.bind(this);break;case"straightLadder":o=this.getStraightLadderPath.bind(this);break;default:o=this.getBasePath.bind(this);break}if(i.id)return o(r,i);if(i.facility){let s=this.facilityMap.get(i.facility).filter(l=>i.floor?l.floor===i.floor:!0);if(!s.length)return null;let u=s.map(l=>o(r,{floor:l.floor,id:l.id})).filter(l=>!!l);return u.reduce((l,c)=>{let h=c.reduce((p,f)=>p+Rt(f.points),0);return h<l.distance&&(l.distance=h,l.path=c),l},{distance:1/0,path:u[0]}).path}}getRoutePath(t,e,n){let r=""+t.floor+Zt+t.id,i=""+e.floor+Zt+e.id,o=n.path(r,i);if(!o)return null;let s=[];return o.map(u=>{let l=this.pointMap.get(u);if(l){var c;let{floor:h}=l;if(((c=s[s.length-1])==null?void 0:c.floor)===h){let p=s[s.length-1];p.points.push(l.cds),p.endType=l.type,p.destId=l.nodeId,p.distance=Rt(p.points)}else s.push({floor:h,points:[l.cds],endType:l.type,destId:l.nodeId,distance:0})}}),s}getBasePath(t,e){return this.getRoutePath(t,e,this.baseRoute)}getEscalatorPath(t,e){return this.getRoutePath(t,e,this.escalatorRoute)}getStraightLadderPath(t,e){return this.getRoutePath(t,e,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 he.default,this.escalatorRoute=new he.default,this.straightLadderRoute=new he.default}constructor(t=3){this.lift_priority=t,this.roadInfo=[],this.pointMap=new Map,this.nodeMap=new Map,this.facilityMap=new Map,this.straightLadderMap=new Map,this.escalatorMap=new Map,this.staircaseMap=new Map,this.lineMap=new Map,this.baseRoute=new he.default,this.escalatorRoute=new he.default,this.straightLadderRoute=new he.default}};var yl=require("core-js/modules/web.dom-collections.iterator.js"),vl=require("core-js/modules/es.regexp.exec.js"),xl=require("core-js/modules/es.array.push.js"),El=require("core-js/modules/es.set.difference.v2.js"),bl=require("core-js/modules/es.set.intersection.v2.js"),Sl=require("core-js/modules/es.set.is-disjoint-from.v2.js"),Ml=require("core-js/modules/es.set.is-subset-of.v2.js"),wl=require("core-js/modules/es.set.is-superset-of.v2.js"),Tl=require("core-js/modules/es.set.symmetric-difference.v2.js"),Al=require("core-js/modules/es.set.union.v2.js"),Cl=require("core-js/modules/es.array.flat.js"),Il=require("core-js/modules/es.array.unscopables.flat.js"),St=_i(Ni(),1);var Ot=require("lodash"),Cr=require("three"),D="___",Di=class{setLiftPriority(t){this.lift_priority=t}isFacilityByType(t){return["facility","escalator","straightLadder","staircase","ramp","connectionPoint"].includes(t)}initFacilities(t){this.facilities=t.map(e=>{let n=[];try{n=JSON.parse(e.entry_end_floor)}catch(i){n=[]}let r=[];try{r=JSON.parse(e.entry_start_floor)}catch(i){r=[]}return v({},e,{entry_start_floor:r,entry_end_floor:n})})}getParkingSpaceInfo(t,e){let n=""+t+D+e;var r;return(r=this.parkingMap.get(n))!=null?r:null}getNodeInfo(t,e){let n=""+t+D+e,r=this.nodeMap.get(n);if(!(r!=null&&r.length))return null;let i=this.pointMap.get(r[0]);return i!=null?i:null}initRoute(t,e){this.clear(),this.roadInfo=t,this.initFacilities(e);let n=new Date,r=n.getHours()*60+n.getMinutes();t.length&&(t.forEach(i=>{let o=(i.points||[]).filter(s=>!(0,Ot.isNil)(s.passWeight)&&s.passWeight!==1&&!(0,Ot.isNil)(s.coverageArea)&&s.coverageArea!==0);(i.points||[]).filter(s=>s.openStatus!==!1).filter(s=>{if(!s.startTime||!s.endTime)return!0;let[u,l]=s.startTime.split(":").map(d=>+d),[c,h]=s.endTime.split(":").map(d=>+d),p=u*60+l,f=c*60+h;return r>=p&&r<=f}).forEach(s=>{s.floor=i.floor;let u=""+i.floor+D+s.id,l=""+i.floor+D+s.nodeId,c=this.nodeMap.get(l)||[];if(c.push(""+i.floor+D+(s.relatedId||s.id)),this.nodeMap.set(""+i.floor+D+s.nodeId,c),this.pointMap.set(u,s),this.isFacilityByType(s.type)){let h=this.facilities.find(p=>p.id===+s.targetId);if(h){switch(h.entry_infra_type){case"straightLadder":if(h.entry_end_floor.find(m=>m.floor===i.floor)&&h.entry_start_floor.find(m=>m.floor===i.floor)){let m=this.straightLadderMap.get(s.targetId)||[];m.push(v({},s)),this.straightLadderMap.set(s.targetId,m)}break;case"staircase":if(h.entry_end_floor.find(m=>m.floor===i.floor)&&h.entry_start_floor.find(m=>m.floor===i.floor)){let m=this.staircaseMap.get(s.targetId)||[];m.push(v({},s)),this.staircaseMap.set(s.targetId,m)}break;case"escalator":let f=this.escalatorMap.get(s.targetId)||[];if(h.entry_start_floor.find(m=>m.floor===i.floor)){let m=f.find(y=>{var x;return((x=y.end)==null?void 0:x.floor)!==i.floor&&!y.start});m?m.start=s:f.push({start:s})}if(h.entry_end_floor.find(m=>m.floor===i.floor)){let m=f.find(y=>{var x;return((x=y.start)==null?void 0:x.floor)!==i.floor&&!y.end});m?m.end=s:f.push({end:s})}this.escalatorMap.set(s.targetId,f);break;case"ramp":let d=this.rampMap.get(s.targetId)||[];if(h.entry_start_floor.find(m=>m.floor===i.floor)){let m=d.find(y=>{var x;return((x=y.end)==null?void 0:x.floor)!==i.floor&&!y.start});m?m.start=s:d.push({start:s})}if(h.entry_end_floor.find(m=>m.floor===i.floor)){let m=d.find(y=>{var x;return((x=y.start)==null?void 0:x.floor)!==i.floor&&!y.end});m?m.end=s:d.push({end:s})}this.rampMap.set(s.targetId,d);break;case"connectionPoint":if(h.entry_end_floor.find(m=>m.floor===i.floor)&&h.entry_start_floor.find(m=>m.floor===i.floor)){let m=this.connectionPointMap.get(s.targetId)||[];m.push(v({},s)),this.connectionPointMap.set(s.targetId,m)}break}let p=this.facilityMap.get(s.targetId)||[];p.push(v({},s)),this.facilityMap.set(s.targetId,p)}}s.type==="parkingSpace"&&s.name.split(/[,,]/).forEach(p=>{this.parkingMap.set(""+i.floor+D+p,s)})}),(i.lines||[]).filter(s=>s.to!==s.from).forEach(s=>{let u=""+i.floor+D+s.from,l=""+i.floor+D+s.to,c=this.pointMap.get(u),h=this.pointMap.get(l);if(!c||!h)return;let p=c.cds,f=h.cds,d=U(p,f);if(o.forEach(m=>{(m.id===s.from||m.id===s.to)&&(d=d/m.passWeight);let y=U(p,m.cds)<=m.coverageArea,x=U(f,m.cds)<=m.coverageArea;(y||x)&&(d=d/m.passWeight)}),!c.permission&&!h.permission){switch(this.addLineItem(u,l,d),this.addLineItem(l,u,d),s.direction){case"double":this.addLineItem(u,l,d,this.forwardLineMap),this.addLineItem(l,u,d,this.forwardLineMap);break;case"single":this.addLineItem(u,l,d,this.forwardLineMap);break;case"back":this.addLineItem(l,u,d,this.forwardLineMap);break}(c.type==="parkingSpace"||h.type==="parkingSpace")&&s.direction==="noDir"&&(this.addLineItem(u,l,d,this.forwardLineMap),this.addLineItem(l,u,d,this.forwardLineMap))}else c.permission&&(this.setPermissionLine(u,l,c.permission,d,""),this.setPermissionLine(l,u,c.permission,d,"")),h.permission&&h.permission!==c.permission&&(this.setPermissionLine(u,l,h.permission,d,""),this.setPermissionLine(l,u,h.permission,d,""))})}),this.addPermissionFacility(),this.initBaseRoute(),this.initEscalatorRoute(),this.initStraightLadderRoute(),this.initForwardRoute())}getPermissionMap(t){return this["permission_"+t]||(this["permission_"+t]=new Set),this["permission_"+t]}setPermissionLine(t,e,n,r,i){this.getPermissionMap(n).add({fromKey:t,toKey:e,distance:r,type:i})}addPermissionFacility(){this.straightLadderMap.forEach((t,e)=>{if(t.length<2){this.straightLadderMap.delete(e);return}for(let n=0;n<t.length;n++){let r=""+t[n].floor+D+t[n].id,i=this.pointMap.get(r);if(i){for(let o=0;o<t.length;o++)if(n!==o){let s=""+t[o].floor+D+t[o].id,u=this.pointMap.get(s);if(!u)continue;i.permission&&this.setPermissionLine(r,s,i.permission,1,"straightLadder"),u.permission&&u.permission!==i.permission&&this.setPermissionLine(r,s,u.permission,1,"straightLadder")}}}}),this.staircaseMap.forEach((t,e)=>{if(t.length<2){this.staircaseMap.delete(e);return}for(let n=0;n<t.length;n++){let r=""+t[n].floor+D+t[n].id,i=this.pointMap.get(r);if(i){for(let o=0;o<t.length;o++)if(n!==o){let s=""+t[o].floor+D+t[o].id,u=this.pointMap.get(s);if(!u)continue;i.permission&&this.setPermissionLine(r,s,i.permission,1,"staircase"),u.permission&&u.permission!==i.permission&&this.setPermissionLine(r,s,u.permission,1,"staircase")}}}}),this.escalatorMap.forEach((t,e)=>{t.forEach(n=>{if(n.start&&n.end){let r=""+n.start.floor+D+n.start.id,i=""+n.end.floor+D+n.end.id,o=this.pointMap.get(r),s=this.pointMap.get(i);o&&s&&(o.permission&&this.setPermissionLine(r,i,o.permission,1,"escalator"),s.permission&&s.permission!==o.permission&&this.setPermissionLine(r,i,s.permission,1,"escalator"))}})}),this.rampMap.forEach((t,e)=>{t.forEach(n=>{if(n.start&&n.end){let r=""+n.start.floor+D+n.start.id,i=""+n.end.floor+D+n.end.id,o=this.pointMap.get(r),s=this.pointMap.get(i);o&&s&&(o.permission&&this.setPermissionLine(r,i,o.permission,10,"ramp"),s.permission&&s.permission!==o.permission&&this.setPermissionLine(r,i,s.permission,10,"ramp"))}})}),this.connectionPointMap.forEach((t,e)=>{if(t.length<2){this.connectionPointMap.delete(e);return}for(let n=0;n<t.length;n++){let r=""+t[n].floor+D+t[n].id,i=this.pointMap.get(r);if(i){for(let o=0;o<t.length;o++)if(n!==o){let s=""+t[o].floor+D+t[o].id,u=this.pointMap.get(s);if(!u)continue;i.permission&&this.setPermissionLine(r,s,i.permission,1,"connectionPoint"),u.permission&&u.permission!==i.permission&&this.setPermissionLine(r,s,u.permission,1,"connectionPoint")}}}})}addPermissionLineToMap(t,e,n,r){this.getPermissionMap(t).forEach(o=>{e.includes(o.type)&&(o.type===""?this.addLineItem(o.fromKey,o.toKey,o.distance,n):this.addLineItem(o.fromKey,o.toKey,r.get(o.type),n))})}addLineItem(t,e,n,r){r===void 0&&(r=this.lineMap);let i=r.get(t)||new Map;i.set(e,n),r.set(t,i)}addFacilityToLineMap(t,e,n,r){[...this.straightLadderMap,...this.staircaseMap].forEach(i=>{let[o,s]=i;if(!(s.length<2))for(let u=0;u<s.length;u++){let l=""+s[u].floor+D+s[u].id,c=this.pointMap.get(l);if(!(!c||c.permission)){for(let h=0;h<s.length;h++)if(u!==h){let p=""+s[h].floor+D+s[h].id,f=this.pointMap.get(p);if(!f||f.permission)continue;if(s[u].type==="straightLadder"){let d=e;this.addLineItem(l,p,d,r)}else{let d=n;this.addLineItem(l,p,d,r)}}}}}),this.escalatorMap.forEach((i,o)=>{i.forEach(s=>{if(s.start&&s.end){let u=""+s.start.floor+D+s.start.id,l=""+s.end.floor+D+s.end.id,c=this.pointMap.get(u),h=this.pointMap.get(l);if(c&&h&&!c.permission&&!h.permission){let p=t;this.addLineItem(u,l,p,r)}}})}),this.connectionPointMap.forEach((i,o)=>{if(!(i.length<2))for(let s=0;s<i.length;s++){let u=""+i[s].floor+D+i[s].id,l=this.pointMap.get(u);if(!(!l||l.permission)){for(let c=0;c<i.length;c++)if(s!==c){let h=""+i[c].floor+D+i[c].id,p=this.pointMap.get(h);if(!p||p.permission)continue;this.addLineItem(u,h,100,r)}}}})}initBaseRoute(){let t=new Map((0,Ot.cloneDeep)([...this.lineMap]));this.addFacilityToLineMap(100,100*this.lift_priority,3e4,t),this.baseRoute=new St.default(t)}initEscalatorRoute(){let t=new Map((0,Ot.cloneDeep)([...this.lineMap])),e=1e4;this.addFacilityToLineMap(100,this.lift_priority*e,3e4*e,t),this.escalatorRoute=new St.default(t)}initStraightLadderRoute(){let t=new Map((0,Ot.cloneDeep)([...this.lineMap])),e=1e4;this.addFacilityToLineMap(3*e,300,3e4*e,t),this.straightLadderRoute=new St.default(t)}initForwardRoute(){this.rampMap.forEach((t,e)=>{t.forEach(n=>{if(n.start&&n.end){let r=""+n.start.floor+D+n.start.id,i=""+n.end.floor+D+n.end.id,o=this.pointMap.get(r),s=this.pointMap.get(i);o&&s&&!o.permission&&!s.permission&&this.addLineItem(r,i,10,this.forwardLineMap)}})}),this.connectionPointMap.forEach((t,e)=>{if(!(t.length<2))for(let n=0;n<t.length;n++){let r=""+t[n].floor+D+t[n].id,i=this.pointMap.get(r);if(!(!i||i.permission)){for(let o=0;o<t.length;o++)if(n!==o){let s=""+t[o].floor+D+t[o].id,u=this.pointMap.get(s);if(!u||u.permission)continue;this.addLineItem(r,s,100,this.forwardLineMap)}}}}),this.forwardRoute=new St.default(this.forwardLineMap)}checkStart(t){return!(!t.floor||!t.nodeId&&(!t.coord||t.coord.length<2))}checkEnd(t){return t.facility||t.parkingSpace&&t.floor?!0:this.checkStart(t)}transformStart(t,e,n){n===void 0&&(n={});var r;if(t.nodeId){let i=this.nodeMap.get(""+t.floor+D+t.nodeId);if(i!=null&&i.length)return i.map(o=>{let[s,u]=o.split(D);return{floor:s,id:u}})}if((r=t.coord)!=null&&r.length){let i=this.roadInfo.find(l=>l.floor===t.floor);if(!i)return null;let o=i.points.filter(l=>l.isStarted),s=i.points.filter(l=>{let c=""+l.floor+D+l.id;if(e==="forward"){if(!this.forwardLineMap.has(c)||n.adsorptionIntersection&&o.length&&!l.isStarted)return!1}else if(!this.lineMap.has(c))return!1;return!0});if(!s.length)return null;let u=s.reduce((l,c)=>{if(c.relatedId)return l;let h=U(t.coord,c.cds);return h<l.min&&(l.min=h,l.point=c),l},{min:1/0,point:s[0]});return[{floor:i.floor,id:u.point.id}]}return null}transformEnd(t,e){if(t.floor){if(t.parkingSpace){let r=this.parkingMap.get(""+t.floor+D+t.parkingSpace);if(r)return[{floor:t.floor,id:r.id}]}let n=this.transformStart(t,e);if(n)return n}if(t.facility){let r=this.facilities.filter(i=>+i.type_id==+t.facility).map(i=>i.id).map(i=>this.facilityMap.get(""+i)).flat(2);if(r!=null&&r.length)return{floor:t.floor,facility:t.facility}}return null}getPath(t,e,n,r,i,o){if(n===void 0&&(n=""),o===void 0&&(o={}),!this.checkStart(t))return"start-error";if(!this.checkEnd(e))return"end-error";let s=this.transformStart(t,n,o);if(!s)return"no-start";let u=this.transformEnd(e,n);if(!u)return"no-end";let l=[];if(Array.isArray(u))for(let p=0;p<s.length;p++){let f=s[p];for(let d=0;d<u.length;d++){let m=u[d];if(f.floor===m.floor&&f.id===m.id)return"near"}}else{l=this.facilities.filter(f=>+f.type_id==+e.facility).map(f=>f.id).map(f=>this.facilityMap.get(""+f)).flat(2).filter(f=>f).filter(f=>u.floor?f.floor===u.floor:!0);for(let f=0;f<s.length;f++){let d=s[f];for(let m=0;m<l.length;m++){let y=l[m];if(d.floor===y.floor&&d.id===y.id)return"near"}}}let c;switch(n){case"escalator":c=this.getEscalatorPath.bind(this);break;case"straightLadder":c=this.getStraightLadderPath.bind(this);break;case"forward":c=this.getForwardPath.bind(this);break;default:c=this.getBasePath.bind(this);break}let h=null;return s.forEach(p=>{if(Array.isArray(u))u.forEach(f=>{let d=c(p,f,r,i);d&&d&&(!h||d[0].consume<h[0].consume)&&(h=d)});else{if(!l.length)return null;let f=l.map(d=>c(p,{floor:d.floor,id:d.id},r,i)).filter(d=>!!d);h=f.reduce((d,m)=>{let y=m[0].consume;return y<d.distance&&(d.distance=y,d.path=m),d},{distance:1/0,path:f[0]}).path}}),h}getRoutePath(t,e,n){let r=""+t.floor+D+t.id,i=this.pointMap.get(r),o=""+e.floor+D+e.id,s=this.pointMap.get(o);if(!i||!s)return null;let u=""+i.floor+D+(i.relatedId||i.id),l=""+s.floor+D+(s.relatedId||s.id),c=n.path(u,l);if(!c)return null;let h=[],p=c.reduce((f,d,m,y)=>{if(m===0)return 0;let x=y[m-1],E=n.graph.get(x).get(d);return f+E},0);return c.map(f=>{let d=this.pointMap.get(f);if(d){var m;let{floor:y}=d,x=d.type;if(this.isFacilityByType(d.type)){let E=this.facilities.find(S=>S.id===+d.targetId);E&&(x=E.entry_infra_type)}if(((m=h[h.length-1])==null?void 0:m.floor)===y){let E=h[h.length-1];E.points.push(d.cds),E.pointInfos.push(d),E.endType=x,E.destId=d.nodeId,E.distance=Rt(E.points)}else h.push({floor:y,points:[d.cds],pointInfos:[d],endType:x,destId:d.nodeId,distance:0,consume:p})}}),h}getBasePath(t,e,n){if(!n)return this.getRoutePath(t,e,this.baseRoute);let r=(0,Ot.cloneDeep)(this.baseRoute.graph),i=s=>{this.addPermissionLineToMap(s,["","escalator","staircase","straightLadder","connectionPoint"],r,new Map([["escalator",100],["connectionPoint",100],["straightLadder",100*this.lift_priority],["staircase",3e4]]))};Array.isArray(n)?n.forEach(s=>{i(s)}):i(n);let o=new St.default(r);return this.getRoutePath(t,e,o)}getEscalatorPath(t,e,n){if(!n)return this.getRoutePath(t,e,this.escalatorRoute);let r=(0,Ot.cloneDeep)(this.escalatorRoute.graph),i=1e4,o=u=>{this.addPermissionLineToMap(u,["","escalator","staircase","straightLadder","connectionPoint"],r,new Map([["escalator",100],["connectionPoint",100],["straightLadder",this.lift_priority*i],["staircase",3e4*i]]))};Array.isArray(n)?n.forEach(u=>{o(u)}):o(n);let s=new St.default(r);return this.getRoutePath(t,e,s)}getStraightLadderPath(t,e,n){if(!n)return this.getRoutePath(t,e,this.straightLadderRoute);let r=(0,Ot.cloneDeep)(this.straightLadderRoute.graph),i=1e4,o=u=>{this.addPermissionLineToMap(u,["","escalator","staircase","straightLadder","connectionPoint"],r,new Map([["escalator",3*i],["connectionPoint",100],["straightLadder",300],["staircase",3e4*i]]))};Array.isArray(n)?n.forEach(u=>{o(u)}):o(n);let s=new St.default(r);return this.getRoutePath(t,e,s)}getForwardPath(t,e,n,r){let i=new Map,o=f=>{let d=this.forwardRoute.graph.get(u);f.forEach(m=>{let y=d.get(m);(0,Ot.isNil)(y)||(i.set(m,y),d.delete(m))})},s=()=>{let f=this.forwardRoute.graph.get(u);i.forEach((d,m)=>{f.set(m,d)})},u=""+t.floor+D+t.id;if(!(0,Ot.isNil)(r)){let f=this.forwardLineMap.get(u),d=this.pointMap.get(u);if(d&&(f!=null&&f.size)&&f.size>1){let m=new Cr.Vector2(d.cds[0],d.cds[1]),y=new Map;f.forEach((E,S)=>{let R=this.pointMap.get(S);if(R){let P=new Cr.Vector2(R.cds[0],R.cds[1]),T=360-(new Cr.Vector2().subVectors(P,m).angle()/Math.PI*180-90+360)%360;y.set(S,T)}});let x=Array.from(y).filter(E=>{let[S,R]=E;return Math.abs(R-r)<=60}).map(E=>{let[S]=E;return S});if(x.length)x.forEach(E=>y.delete(E)),o([...y.keys()]);else{let E=Array.from(y).reduce((S,R)=>{let P=Math.abs(R[1]-r);return P<S.diff?{diff:P,key:R[0]}:S},{diff:1/0,key:""});y.delete(E.key),o([...y.keys()])}}}if(!n){let f=this.getRoutePath(t,e,this.forwardRoute);return s(),f||this.getRoutePath(t,e,this.forwardRoute)}let l=(0,Ot.cloneDeep)(this.forwardRoute.graph),c=f=>{this.addPermissionLineToMap(f,["","ramp"],l,new Map([["ramp",10]]))};Array.isArray(n)?n.forEach(f=>{c(f)}):c(n);let h=new St.default(l),p=this.getRoutePath(t,e,h);if(s(),p)return p;{let f=(0,Ot.cloneDeep)(this.forwardRoute.graph);Array.isArray(n)?n.forEach(y=>{c(y)}):c(n);let d=new St.default(f);return this.getRoutePath(t,e,d)}}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 St.default,this.escalatorRoute=new St.default,this.straightLadderRoute=new St.default}constructor(t=3){this.lift_priority=t,this.roadInfo=[],this.facilities=[],this.pointMap=new Map,this.nodeMap=new Map,this.facilityMap=new Map,this.straightLadderMap=new Map,this.escalatorMap=new Map,this.rampMap=new Map,this.staircaseMap=new Map,this.connectionPointMap=new Map,this.parkingMap=new Map,this.lineMap=new Map,this.baseRoute=new St.default,this.escalatorRoute=new St.default,this.straightLadderRoute=new St.default,this.forwardLineMap=new Map,this.forwardRoute=new St.default}};var Ll=require("core-js/modules/es.set.difference.v2.js"),Nl=require("core-js/modules/es.set.intersection.v2.js"),Ol=require("core-js/modules/es.set.is-disjoint-from.v2.js"),Dl=require("core-js/modules/es.set.is-subset-of.v2.js"),Ul=require("core-js/modules/es.set.is-superset-of.v2.js"),Fl=require("core-js/modules/es.set.symmetric-difference.v2.js"),Bl=require("core-js/modules/es.set.union.v2.js"),zl=require("core-js/modules/web.dom-collections.iterator.js"),Re=class{static createKey(){return Math.random().toString(36).substring(2,15)+Math.random().toString(36).substring(2,15)}static genUniqueKey(){let t=this.createKey();for(;this.keySet.has(t);)t=this.createKey();return t}static removeKey(t){this.keySet.delete(t)}static dispose(){this.keySet.clear()}};Re.keySet=new Set;var kl=require("core-js/modules/es.string.replace.js"),Vl=require("core-js/modules/es.regexp.exec.js");function Ui(a){return a.replace(/[A-Z]/g,t=>"_"+t.toLowerCase()).replace(/^_/,"")}function Z(a,t,e){return new Promise((n,r)=>{let i=Re.genUniqueKey(),o=s=>{let{data:u}=s;u.type===""+t+"_result"&&u.key===i&&(Re.removeKey(i),self.removeEventListener("message",o),u.error?r(u.error):n(u.data))};a.addEventListener("message",o),a.postMessage({type:t,key:i,data:e})})}function nu(a){let t={};for(let n in a)n.startsWith("on")&&(t[Ui(n.slice(2))]=a[n],t[n]=a[n]);let e=n=>g(this,null,function*(){let{data:r}=n;if(t[r.type])try{let i=yield t[r.type](r.data);if(i!=null&&i.$transfer&&Array.isArray(i.$transfer)){let o=i.$transfer;delete i.$transfer,self.postMessage({type:""+r.type+"_result",key:r.key,data:i},o)}else self.postMessage({type:""+r.type+"_result",key:r.key,data:i})}catch(i){self.postMessage({type:""+r.type+"_result",key:r.key,error:i})}else self.postMessage({type:""+r.type+"_result",key:r.key,error:"no_event"})});return self.addEventListener("message",e),()=>{self.removeEventListener("message",e)}}var Kt=require("three");function ru(a,t){t===void 0&&(t=16711680);let e=new Kt.LineBasicMaterial({color:t}),n=new Kt.BufferGeometry().setFromPoints(a);return new Kt.Line(n,e)}function iu(a,t){t===void 0&&(t=16711680);let e=new Kt.MeshBasicMaterial({color:t,depthTest:!1,transparent:!0}),n=new Kt.BoxGeometry(1,1,1),r=new Kt.Mesh(n,e);return r.position.copy(a),r.renderOrder=100100,r}var Zl=require("core-js/modules/es.json.stringify.js"),Kl=require("core-js/modules/web.dom-collections.iterator.js");function Ln(a,t,e){e===void 0&&(e=0),a.forEach(n=>{if(n.geometry.coords=JSON.parse(JSON.stringify(n.geometry.cds)),n.geometry.type==="polygon"){var r;n.geometry.coords.map(i=>{Array.isArray(i)&&i.forEach(o=>{o[0]-=t[0],o[1]-=t[1]})}),n.geometry.otherCds&&(n.geometry.otherCoords=n.geometry.otherCds.map(i=>i.map(o=>je(o,t)))),(r=n.doors)!=null&&r.length&&n.doors.map(i=>{i.coord=je(i.coordinate,t)}),n.center&&(n.centerCoords=je(n.center,t))}else n.geometry.coords=je(n.geometry.cds,t),n.center&&(n.centerCoords=je(n.center,t));if(n.center_x&&n.center_y){let[i,o]=je([n.center_x,n.center_y],t);n.center_coord_x=i,n.center_coord_y=o}});for(let n=0;n<a.length;n++){let r=a[n];r.deltaHeight=1e-5*(e+n+1)}}function je(a,t){return[a[0]-t[0],a[1]-t[1]]}var Jl=require("core-js/modules/es.set.difference.v2.js"),Ql=require("core-js/modules/es.set.intersection.v2.js"),tc=require("core-js/modules/es.set.is-disjoint-from.v2.js"),ec=require("core-js/modules/es.set.is-subset-of.v2.js"),nc=require("core-js/modules/es.set.is-superset-of.v2.js"),rc=require("core-js/modules/es.set.symmetric-difference.v2.js"),ic=require("core-js/modules/es.set.union.v2.js"),oc=require("core-js/modules/web.dom-collections.iterator.js"),rs=require("@tweenjs/tween.js"),be=class{update(){this.group.update()}pause(){this.pauseTween=!0,this.getAll().forEach(t=>{this.tweenStore.add(t),t.pause()})}continue(){this.pauseTween&&(this.tweenStore.forEach(t=>{t.resume()}),this.tweenStore.clear(),this.pauseTween=!1)}remove(t){this.group.remove(t)}getAll(){return this.group.getAll()}clear(){this.getAll().forEach(t=>t.stop()),this.group.removeAll()}dispose(){this.clear()}constructor(){this.pauseTween=!1,this.tweenStore=new Set,this.group=new rs.Group}};var is=require("three"),Nn=class extends is.EventDispatcher{registryEvent(){this.ctn.addEventListener("pointerdown",this._pointerDown),this.ctn.addEventListener("pointerup",this._pointerUp)}unRegistryEvent(){this.ctn.removeEventListener("pointerdown",this._pointerDown),this.ctn.removeEventListener("pointerup",this._pointerUp)}dispose(){this.unRegistryEvent()}constructor(t){super(),this.ctn=t,this._pointerDown=e=>{this.point={x:e.offsetX,y:e.offsetY}},this._pointerUp=e=>{if(!this.point)return;let{offsetX:n,offsetY:r}=e,{x:i,y:o}=this.point;Math.hypot(i-n+(o-r))>3||this.dispatchEvent({type:"click",e})},this.registryEvent()}};var lc=require("core-js/modules/web.dom-collections.iterator.js"),cc=require("core-js/modules/es.array.push.js"),hc=require("core-js/modules/es.string.replace.js"),pc=require("core-js/modules/es.regexp.exec.js"),os=require("lodash"),ss=require("three");var Ye=class extends ss.EventDispatcher{_isEffectiveTask(t){return t&&typeof t.run=="function"}_getIndexByTid(t){return this._task.findIndex(e=>e.tid===t)}_createTask(t){return this._isEffectiveTask(t)?v({},t,{tid:++this._id,meta:t.meta||{}}):!1}get task(){return[...this._task]}getTasks(){return[...this._task]}add(t){if(this._isEffectiveTask(t)){let e=this._createTask(t);return this._task.push(e),this.started&&!this.activeTask&&this.start(),e.tid}return!1}replace(t,e){if(!this._isEffectiveTask(e))return console.warn("[TaskQueue] replace\u65B9\u6CD5\u4F20\u5165\u7684task\u53C2\u6570\u683C\u5F0F\u4E0D\u6B63\u786E"),!1;let n=this._getIndexByTid(t);if(n===-1)return console.warn("[TaskQueue] \u6CA1\u6709\u627E\u5230id="+t+"\u7684\u4EFB\u52A1"),!1;let r=this._createTask(e);return this._task.splice(n,1,r),r.tid}replaceByMetaType(t){var e;let n=(e=t.meta)==null?void 0:e.type;if((0,os.isNil)(n))return this.add(t);{let r=this._task.find(i=>i.meta.type===n);return r?this.replace(r.tid,t):this.add(t)}}remove(t){let e=this._getIndexByTid(t);return e===-1?(console.warn("[TaskQueue] remove\u65B9\u6CD5\u4F20\u5165\u7684id\uFF1A"+t+"\u627E\u4E0D\u5230\u5BF9\u5E94\u7684task"),!1):(this._task.splice(e,1),!0)}clear(){this._task.length=0}start(){this.started=!0,!this.activeTask&&this._task.length&&this.exec()}stop(){this.started=!1}exec(){return g(this,null,function*(){if(!this.started||!this._task.length)return!1;let t=this._task.shift();this.activeTask=t,this.dispatchEvent({type:"active-task-start",task:t});let e;try{e=yield t.run()}catch(n){console.warn("[task run err]",n,t)}return this.activeTask=null,this.dispatchEvent({type:"active-task-end",task:t,res:e}),this.exec()})}constructor(t=!0){super(),this._task=[],this.started=!1,this.activeTask=null,this._id=0,t&&this.start()}};var gc=require("core-js/modules/es.array.push.js"),as=require("three"),On=class extends as.EventDispatcher{getWorker(){return new Promise(t=>{let e=this.pool.find(r=>r.state==="leisure");if(e){e.state="used",t(e.worker);return}if(this.pool.length<this.max&&this.workerConstructor){let r=this.workerConstructor();this.pool.push({worker:r,state:"used"}),t(r);return}let n=()=>{let r=this.pool.find(i=>i.state==="leisure");r&&(this.removeEventListener("release",n),r.state="used",t(r.worker))};this.addEventListener("release",n)})}releaseWorker(t){let e=this.pool.find(n=>n.worker===t);e&&(e.state="leisure",this.dispatchEvent({type:"release",worker:t}))}dispose(){this._listeners={},this.pool.forEach(t=>{t.worker.terminate()}),this.pool=[]}constructor(t=10,e){super(),this.max=10,this.pool=[],this.max=t,this.workerConstructor=e}};var us=require("three"),ct=class extends us.EventDispatcher{dispose(){this._listeners={}}};var Dn=class{filter(t){let e=this.estimate,n=this.errorEstimate+this.processNoise,r=n/(n+this.measurementNoise);return this.estimate=e+r*(t-e),this.errorEstimate=(1-r)*n,this.estimate}constructor(t={}){this.estimate=0,this.errorEstimate=1,this.processNoise=.1,this.measurementNoise=1,this.measurementNoise=t.measurementNoise||1,this.processNoise=t.processNoise||.1,this.errorEstimate=t.errorEstimate||1}};var vc=require("core-js/modules/es.typed-array.float32-array.js"),xc=require("core-js/modules/es.typed-array.at.js"),Ec=require("core-js/modules/es.typed-array.fill.js"),bc=require("core-js/modules/es.typed-array.find-last.js"),Sc=require("core-js/modules/es.typed-array.find-last-index.js"),Mc=require("core-js/modules/es.typed-array.set.js"),wc=require("core-js/modules/es.typed-array.sort.js"),Tc=require("core-js/modules/es.typed-array.to-reversed.js"),Ac=require("core-js/modules/es.typed-array.to-sorted.js"),Cc=require("core-js/modules/es.typed-array.with.js"),Ic=require("core-js/modules/es.array-buffer.constructor.js"),Rc=require("core-js/modules/es.array-buffer.slice.js"),Pc=require("core-js/modules/es.array-buffer.detached.js"),Lc=require("core-js/modules/es.array-buffer.transfer.js"),Nc=require("core-js/modules/es.array-buffer.transfer-to-fixed-length.js"),Oc=require("core-js/modules/es.array.push.js"),Dc=require("core-js/modules/web.dom-collections.iterator.js"),J=require("three");var ls=require("three/examples/jsm/utils/BufferGeometryUtils.js");var Ir=require("@turf/turf");function ou(a,t,e){t===void 0&&(t=!0),e===void 0&&(e=!1);let n=a.filter(s=>s.geometry.type==="polygon");if(!n.length)return null;let r=n.map(s=>{var u;let l=s.geometry.coords,c=An(l[0],l.slice(1)),h=new J.ExtrudeGeometry(c,{steps:1,bevelEnabled:!1,depth:s.height,curveSegments:4});(u=s).deltaHeight||(u.deltaHeight=0),h.translate(0,0,s.airHeight+s.deltaHeight);let p=h.attributes.position.count,f=new Float32Array(p).fill(s.height+s.airHeight+s.deltaHeight);if(h.setAttribute("maxZ",new J.BufferAttribute(f,1)),h.setAttribute("opacity",new J.BufferAttribute(new Float32Array(p).fill(s.fillOpacity),1)),e){let y=new Float32Array(p).fill(s.airHeight+s.deltaHeight);h.setAttribute("minZ",new J.BufferAttribute(y,1))}let d=new J.Color(s.fillColor).convertLinearToSRGB(),m=new Float32Array(p*3);for(let y=0;y<p;y++)m[y*3]=d.r,m[y*3+1]=d.g,m[y*3+2]=d.b;return h.setAttribute("color",new J.BufferAttribute(m,3)),h}),i=(0,ls.mergeGeometries)(r);r.forEach(s=>s.dispose());let o={geometry:i};return i.dispose(),t&&(o.lineGeometry=cs(n)||void 0),o}function su(a){let t=a.filter(u=>u.geometry.type==="polygon");if(!t.length)return null;let e=[],n=[],r=[],i=[],o=[],s=[];return t.map((u,l)=>{var c;(c=u).deltaHeight||(c.deltaHeight=0);let h=u.geometry.coords,p=U(h[0][0],h[0][1]),f=U(h[0][1],h[0][2]),d=h[0][1][0]-h[0][0][0],m=h[0][1][1]-h[0][0][1],y=Math.atan2(m,d),x=(0,Ir.center)((0,Ir.polygon)(h)),E=x.geometry.coordinates[0],S=x.geometry.coordinates[1],R=new J.Matrix4().compose(new J.Vector3(E,S,u.deltaHeight+u.airHeight+u.height/2),new J.Quaternion().setFromAxisAngle(new J.Vector3(0,0,1),y),new J.Vector3(p,f,u.height));e.push(...R.toArray()),n.push(...new J.Color(u.fillColor).convertLinearToSRGB().toArray()),r[l]=u.fillOpacity||1,i[l]=(u.deltaHeight||0)+u.airHeight+u.height,o[l]=u.id,s[l]=u.airHeight+u.deltaHeight}),{size:t.length,ids:o,matrixes:e,colors:n,opacities:r,maxZs:i,minZs:s}}function cs(a){let{points:t,colors:e,opacities:n}=Rr(a);if(!t.length)return null;let r=new J.BufferGeometry().setFromPoints(t);return r.setAttribute("color",new J.BufferAttribute(new Float32Array(e),3)),r.setAttribute("opacity",new J.BufferAttribute(new Float32Array(n),1)),r}function Rr(a){let t=[],e=[],n=[];return a.filter(r=>r.strokeOpacity>0).map(r=>{let i=r.height+(r.deltaHeight||0)+r.airHeight,{coords:o}=r.geometry,{strokeColor:s,strokeOpacity:u}=r,l=new J.Color(s).convertLinearToSRGB();for(let c=0;c<o.length;c++){let h=o[c];for(let p=0;p<h.length;p++){let f=h[p],d=p+1===h.length?h[0]:h[p+1];t.push(new J.Vector3(f[0],f[1],i)),t.push(new J.Vector3(d[0],d[1],i)),e.push(l.r,l.g,l.b),e.push(l.r,l.g,l.b),n.push(u),n.push(u)}}}),{points:t,colors:e,opacities:n}}function au(a){if(a.length>1)return!1;let t=a[0];if(t.length!==5)return!1;let[e]=t,n=t[t.length-1];if(e[0]!==n[0]||e[1]!==n[1])return!1;let r=[Math.round(U(t[0],t[1])),Math.round(U(t[1],t[2])),Math.round(U(t[2],t[3])),Math.round(U(t[3],t[4]))];if(!(r[2]===r[0]&&r[3]===r[1]))return!1;let i=ke(t[0],t[1],t[2]);return Math.abs(Math.abs(i)-90)<1}var k=require("three");var k_=require("core-js/modules/web.dom-collections.iterator.js"),V_=require("core-js/modules/es.set.difference.v2.js"),H_=require("core-js/modules/es.set.intersection.v2.js"),W_=require("core-js/modules/es.set.is-disjoint-from.v2.js"),X_=require("core-js/modules/es.set.is-subset-of.v2.js"),q_=require("core-js/modules/es.set.is-superset-of.v2.js"),j_=require("core-js/modules/es.set.symmetric-difference.v2.js"),Y_=require("core-js/modules/es.set.union.v2.js"),Z_=require("core-js/modules/es.array.push.js"),Js=require("three");var Bp=require("core-js/modules/web.dom-collections.iterator.js"),zp=require("core-js/modules/es.array.push.js"),C=require("three");var zc=require("core-js/modules/web.dom-collections.iterator.js"),ps=require("three/examples/jsm/lines/LineMaterial.js"),et=require("three");function hs(a){return a.x+"-"+a.y+"-"+a.z}var A=class{static generateLineMaterialKey(t){let{color:e,opacity:n}=t;return e+"-"+n}static createLineMaterial(t){let{color:e,opacity:n,vertexColors:r}=t,i=this.generateLineMaterialKey({color:e,opacity:n,vertexColors:r});if(this.lineMaterialMap.has(i))return this.lineMaterialMap.get(i);let o=new et.LineBasicMaterial({color:new et.Color(e).convertLinearToSRGB(),transparent:!0,opacity:n,vertexColors:r!=null?r:!1});return this.lineMaterialMap.set(i,o),o}static createMeshStandardMaterial(t){let{color:e,opacity:n}=t,r=e+"-"+n;if(this.meshStandardMaterialMap.has(r))return this.meshStandardMaterialMap.get(r);let i=new et.MeshStandardMaterial({color:new et.Color(e).convertLinearToSRGB(),roughness:1,transparent:!0,opacity:n,depthWrite:!0});return this.meshStandardMaterialMap.set(r,i),i}static createMeshBasicMaterial(t){let{color:e,opacity:n,vertexColors:r}=t,i=e+"-"+n+"-"+r;if(this.meshBasicMaterialMap.has(i))return this.meshBasicMaterialMap.get(i);let o=new et.MeshBasicMaterial({color:e,transparent:!0,opacity:n,depthWrite:!0,vertexColors:r!=null?r:!1});return this.meshBasicMaterialMap.set(i,o),o}static createShaderMaterial(t){let{gradualColor:e,center:n,maxValue:r,opacity:i,direction:o,max:s,min:u}=t,l=e.toString()+"-"+hs(n)+"-"+r+"-"+i+"-"+hs(o);if(this.shaderMaterialMap.has(l))return this.shaderMaterialMap.get(l);let c=`
|
|
1
|
+
"use strict";var Ua=Object.create;var wn=Object.defineProperty;var Fa=Object.getOwnPropertyDescriptor;var Ba=Object.getOwnPropertyNames,Po=Object.getOwnPropertySymbols,za=Object.getPrototypeOf,Lo=Object.prototype.hasOwnProperty,Ga=Object.prototype.propertyIsEnumerable;var mi=(a,t,e)=>t in a?wn(a,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):a[t]=e,Tn=(a,t)=>{for(var e in t||(t={}))Lo.call(t,e)&&mi(a,e,t[e]);if(Po)for(var e of Po(t))Ga.call(t,e)&&mi(a,e,t[e]);return a};var Ge=(a,t)=>()=>(t||a((t={exports:{}}).exports,t),t.exports),No=(a,t)=>{for(var e in t)wn(a,e,{get:t[e],enumerable:!0})},Oo=(a,t,e,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of Ba(t))!Lo.call(a,r)&&r!==e&&wn(a,r,{get:()=>t[r],enumerable:!(n=Fa(t,r))||n.enumerable});return a};var _i=(a,t,e)=>(e=a!=null?Ua(za(a)):{},Oo(t||!a||!a.__esModule?wn(e,"default",{value:a,enumerable:!0}):e,a)),ka=a=>Oo(wn({},"__esModule",{value:!0}),a);var pt=(a,t,e)=>mi(a,typeof t!="symbol"?t+"":t,e);var g=(a,t,e)=>new Promise((n,r)=>{var i=u=>{try{s(e.next(u))}catch(l){r(l)}},o=u=>{try{s(e.throw(u))}catch(l){r(l)}},s=u=>u.done?n(u.value):Promise.resolve(u.value).then(i,o);s((e=e.apply(a,t)).next())});var Uo=Ge((tl,Do)=>{Do.exports=function(t,e){return t[0]=e[0],t[1]=e[1],t}});var zo=Ge((el,Bo)=>{var Fo=Uo();Bo.exports=function(a,t){Array.isArray(t)||(t=[]),a.length>0&&t.push(Fo([0,0],a[0]));for(var e=0;e<a.length-1;e++){var n=a[e],r=a[e+1],i=n[0],o=n[1],s=r[0],u=r[1],l=[.75*i+.25*s,.75*o+.25*u],c=[.25*i+.75*s,.25*o+.75*u];t.push(l),t.push(c)}return a.length>1&&t.push(Fo([0,0],a[a.length-1])),t}});var Wo=Ge((sl,Ho)=>{var Pi=class{constructor(){this.keys=new Set,this.queue=[]}sort(){this.queue.sort((t,e)=>t.priority-e.priority)}set(t,e){let n=Number(e);if(isNaN(n))throw new TypeError('"priority" must be a number');return this.keys.has(t)?this.queue.map(r=>(r.key===t&&Object.assign(r,{priority:n}),r)):(this.keys.add(t),this.queue.push({key:t,priority:n})),this.sort(),this.queue.length}next(){let t=this.queue.shift();return this.keys.delete(t.key),t}isEmpty(){return this.queue.length===0}has(t){return this.keys.has(t)}get(t){return this.queue.find(e=>e.key===t)}};Ho.exports=Pi});var jo=Ge((al,qo)=>{function Xo(a,t){let e=new Map;for(let[n,r]of a)n!==t&&r instanceof Map?e.set(n,Xo(r,t)):n!==t&&e.set(n,r);return e}qo.exports=Xo});var Ko=Ge((ul,Zo)=>{function Qa(a){let t=Number(a);return!(isNaN(t)||t<=0)}function Yo(a){let t=new Map;return Object.keys(a).forEach(n=>{let r=a[n];if(r!==null&&typeof r=="object"&&!Array.isArray(r))return t.set(n,Yo(r));if(!Qa(r))throw new Error(`Could not add node at key "${n}", make sure it's a valid node`,r);return t.set(n,Number(r))}),t}Zo.exports=Yo});var Qo=Ge((ll,Jo)=>{function $o(a){if(!(a instanceof Map))throw new Error(`Invalid graph: Expected Map instead found ${typeof a}`);a.forEach((t,e)=>{if(typeof t=="object"&&t instanceof Map){$o(t);return}if(typeof t!="number"||t<=0)throw new Error(`Values must be numbers greater than 0. Found value ${t} at ${e}`)})}Jo.exports=$o});var Ni=Ge((cl,ns)=>{var tu=Wo(),eu=jo(),ts=Ko(),es=Qo(),Li=class{constructor(t){t instanceof Map?(es(t),this.graph=t):t?this.graph=ts(t):this.graph=new Map}addNode(t,e){let n;return e instanceof Map?(es(e),n=e):n=ts(e),this.graph.set(t,n),this}addVertex(t,e){return this.addNode(t,e)}removeNode(t){return this.graph=eu(this.graph,t),this}path(t,e,n={}){if(!this.graph.size)return n.cost?{path:null,cost:0}:null;let r=new Set,i=new tu,o=new Map,s=[],u=0,l=[];if(n.avoid&&(l=[].concat(n.avoid)),l.includes(t))throw new Error(`Starting node (${t}) cannot be avoided`);if(l.includes(e))throw new Error(`Ending node (${e}) cannot be avoided`);for(i.set(t,0);!i.isEmpty();){let c=i.next();if(c.key===e){u=c.priority;let p=c.key;for(;o.has(p);)s.push(p),p=o.get(p);break}r.add(c.key),(this.graph.get(c.key)||new Map).forEach((p,f)=>{if(r.has(f)||l.includes(f))return null;if(!i.has(f))return o.set(f,c.key),i.set(f,c.priority+p);let d=i.get(f).priority,m=c.priority+p;return m<d?(o.set(f,c.key),i.set(f,m)):null})}return s.length?(n.trim?s.shift():s=s.concat([t]),n.reverse||(s=s.reverse()),n.cost?{path:s,cost:u}:s):n.cost?{path:null,cost:0}:null}shortestPath(...t){return this.path(...t)}};ns.exports=Li});var s0={};No(s0,{AibeeLoader:()=>Je,BMap:()=>ro,BMapSelect:()=>ho,BaseSvg:()=>Vt,CarInertialPosition:()=>Er,ClickHelper:()=>Nn,Context:()=>hr,ContextCamera:()=>cr,ContextScene:()=>lr,Control:()=>ar,CrLoader:()=>no,CrNavPath:()=>co,Equipment:()=>io,EventDispatcher:()=>ct,Events:()=>Ai,Floor:()=>re,GlbModel:()=>Wi,Graphic:()=>mt,GraphicLayer:()=>kn,GroundTexture:()=>Le,HeatmapElement:()=>zn,HighlightPoi:()=>Eo,HooksName:()=>bt,HoverHelper:()=>or,InstancedGraphic:()=>Ke,InstancedModel:()=>qn,InstancedParkingSpace:()=>nn,InstancedWall:()=>rr,KalmanFilter:()=>Dn,Lane:()=>Qn,Layer:()=>nt,LineElement:()=>un,MapTypePolar:()=>Hu,MergeAttributeGraphic:()=>an,MergeAttributeGroundTexture:()=>Ne,MergeAttributeLane:()=>nr,MergeAttributeWall:()=>er,MergeGraphic:()=>Xi,MergedAttributeGraphicLine:()=>Oe,MergedGraphicLayer:()=>Yn,MergedModelLayer:()=>Xn,Model:()=>Gn,MulFloorNavigation:()=>po,MulFloorSelect:()=>fo,MulFloors:()=>ao,NavPath:()=>gr,Navigation:()=>so,Overlay:()=>Ze,ParkingLayer:()=>Wn,ParkingType:()=>Wu,PathDirection:()=>ce,PdrPosition:()=>yr,Poi:()=>Pe,Poi2:()=>st,PoiLayer:()=>Vn,PoiLayer2:()=>Hn,Position:()=>vo,RENDER_VERSION:()=>fn,RecommendParkingSpace:()=>mo,Renderer:()=>ur,RoadNetwork:()=>Oi,RoadNetwork2:()=>Di,SENSOR_TYPE:()=>G,SatelliteTile:()=>So,SelectBox:()=>Hi,Selection:()=>ir,Sensor:()=>mr,Shadow:()=>Bn,Socket:()=>xn,SortByDistance:()=>bo,SvgLine:()=>Kn,SvgPolygon:()=>$n,TaskQueue:()=>Ye,TextTexture:()=>tr,TileLayer:()=>De,TileLoader:()=>Zn,Timer:()=>$,TweenUtil:()=>be,UA:()=>wi,UseMyPosition:()=>xo,Wall:()=>Jn,WorkerPool:()=>On,addAlphaToHexColor:()=>ja,calc_angle:()=>ke,calc_direction:()=>Tr,calculateInstantaneousSpeed:()=>Qu,calculateLineDirection:()=>vr,convertToSnakeCase:()=>Ui,createCircle:()=>tn,createLine:()=>Rn,createRect:()=>Ee,createSvg:()=>bi,createSvgElement:()=>In,createThreeBox:()=>iu,createThreeLine:()=>ru,darkenColor:()=>le,defaultConfig:()=>aa,defaultGraphicOptions:()=>de,defaultOptions:()=>Wr,defaultTextTextureOptions:()=>qs,deviceToVector3:()=>Va,dispose:()=>F,distancePointToSegment:()=>Ii,generatorKeyByObj:()=>Xe,getAngle:()=>ko,getBorderPoints:()=>Rr,getCenter:()=>Cn,getConfig:()=>Ki,getDirectPath:()=>Ja,getDirectionByAngle:()=>Ar,getDistanceByPathPos:()=>Ri,getLength:()=>U,getLongestSideDir:()=>Ha,getMinEdgeSquare:()=>Wa,getPathLength:()=>Rt,getPointEdgeIndex:()=>ue,getPosByPathDistance:()=>qe,hasChinese:()=>xi,hexToRgb:()=>wr,initDirectionalLight:()=>vi,initLight:()=>yi,initShape:()=>An,instancedGeometiesAttributes:()=>su,isAndroid:()=>Ya,isContain:()=>xe,isControl:()=>We,isIphone:()=>Ie,isMac:()=>He,isPointInPolygon:()=>Ei,isRectangle:()=>au,loadBuildingGround:()=>to,loadExternalStreet:()=>ku,loadGraphics:()=>eo,mergeGraphicGeometries:()=>ou,mergeGraphicLineGeometries:()=>cs,moveOnRoute:()=>$a,predictFuturePosition:()=>vn,predictFutureSpeed:()=>t0,proxyOptions:()=>Ve,removeOutliers:()=>e0,removeWeightPath:()=>Vo,setCirclePosition:()=>Ce,setLineStartEnd:()=>Yt,setRectPosition:()=>Ct,simplifyPath:()=>Pn,sleepByRf:()=>Mi,sleepOnePromise:()=>Si,sleepOneRf:()=>Mr,smoothPath:()=>Ci,strToNumber:()=>qa,timeoutPromise:()=>Gt,toWebWorker:()=>nu,transformGraphicData:()=>Ln,transformSpeed:()=>fi,translatePosToCenter:()=>je,triggerWorker:()=>Z,vector3ToDevice:()=>N,xhrGet:()=>Za});module.exports=ka(s0);function v(){return v=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},v.apply(this,arguments)}var Mv=require("core-js/modules/es.array.push.js"),wv=require("core-js/modules/web.dom-collections.iterator.js"),Tv=require("core-js/modules/es.json.stringify.js"),Xt=require("three");var Ny=require("core-js/modules/web.dom-collections.iterator.js");var l0=require("core-js/modules/es.set.difference.v2.js"),c0=require("core-js/modules/es.set.intersection.v2.js"),h0=require("core-js/modules/es.set.is-disjoint-from.v2.js"),p0=require("core-js/modules/es.set.is-subset-of.v2.js"),f0=require("core-js/modules/es.set.is-superset-of.v2.js"),d0=require("core-js/modules/es.set.symmetric-difference.v2.js"),g0=require("core-js/modules/es.set.union.v2.js"),m0=require("core-js/modules/web.dom-collections.iterator.js"),$=class{requestAnimationFrame(t){let e=window.requestAnimationFrame(()=>{this.tasks.requestAnimation.delete(e),t()});return this.tasks.requestAnimation.add(e),e}cancelAnimationFrame(t){this.tasks.requestAnimation.delete(t),window.cancelAnimationFrame(t)}setTimeout(t,e){let n=window.setTimeout(()=>{this.tasks.timeout.delete(n),t()},e);return this.tasks.timeout.add(n),n}clearTimeout(t){this.tasks.timeout.delete(t),window.clearTimeout(t)}setInterval(t,e){let n=window.setInterval(()=>{t()},e);return this.tasks.interval.add(n),n}clearInterval(t){this.tasks.interval.delete(t),window.clearInterval(t)}requestIdleCallback(t,e){let n=window.requestIdleCallback(r=>{this.tasks.requestIdleCallback.delete(n),t(r)},e);return this.tasks.requestIdleCallback.add(n),n}cancelIdleCallback(t){this.tasks.requestIdleCallback.delete(t),window.cancelIdleCallback(t)}dispose(){this.tasks.requestAnimation.forEach(t=>{window.cancelAnimationFrame(t)}),this.tasks.requestAnimation.clear(),this.tasks.requestIdleCallback.forEach(t=>{window.cancelIdleCallback(t)}),this.tasks.requestIdleCallback.clear(),this.tasks.timeout.forEach(t=>{window.clearTimeout(t)}),this.tasks.timeout.clear(),this.tasks.interval.forEach(t=>{window.clearInterval(t)}),this.tasks.interval.clear()}constructor(){this.tasks={requestAnimation:new Set,requestIdleCallback:new Set,timeout:new Set,interval:new Set}}};var y0=require("core-js/modules/web.dom-collections.iterator.js"),v0=require("core-js/modules/es.array.push.js"),zt=require("three");function yi(){let a=new zt.Group,t=new zt.AmbientLight(16777215,.3);return a.add(t),a}function An(a,t){t===void 0&&(t=[]);let e=new zt.Shape(a.map(n=>new zt.Vector2(...n)));return t.length&&t.forEach(n=>{var r=new zt.Path(n.map(i=>new zt.Vector2(...i)));e.holes.push(r)}),e}function vi(a,t){a===void 0&&(a=16777215),t===void 0&&(t=1);let e=new zt.DirectionalLight(a,t);return e.castShadow=!0,e.shadow.radius=8,e.shadow.bias=-.001,e.shadow.mapSize.set(256,256),e.shadow.camera.left=-200,e.shadow.camera.right=200,e.shadow.camera.top=200,e.shadow.camera.bottom=-200,e}function F(a,t){if(t&&a.children&&a.children.length&&a.children.forEach(e=>{F(e,t)}),a.isMesh){let e=a;e.geometry&&e.geometry.dispose(),e.material&&(Array.isArray(e.material)?e.material.forEach(n=>{n.dispose()}):e.material.dispose())}a.isLight&&(a.dispose==null||a.dispose.call(a))}var b0=require("core-js/modules/es.regexp.exec.js");function xi(a){return/[\u4E00-\u9FA5]+/g.test(a)}var M0=require("core-js/modules/web.dom-collections.iterator.js"),ft=require("three"),Qe=require("@turf/turf");function N(a,t,e,n){let r=a.clone().project(t),i=e/2,o=n/2,s=Math.round(r.x*i+i),u=Math.round(-r.y*o+o);return{x:s,y:u}}function Va(a,t,e,n,r){if(!r)return null;e=Math.min(1,e),n=Math.min(1,n);let i=a/e*2-1,o=1-t/n*2;return new ft.Vector3(i,o,0).unproject(r)}function Cn(a){let t=(0,Qe.featureCollection)(a.map(n=>(0,Qe.point)(n)));return(0,Qe.center)(t).geometry.coordinates}function xe(a,t,e){return a.x>=t.x&&a.x<=e.x&&a.y>=t.y&&a.y<=e.y}function Ha(a){let t=0,e=new ft.Vector3;for(let n=1;n<a.length;n++){let r=new ft.Vector3(a[n-1][0],a[n-1][1],0),i=new ft.Vector3(a[n][0],a[n][1],0),o=i.distanceTo(r);o>t&&(t=o,e=i.clone().sub(r).normalize())}return e}function U(a,t){return Math.sqrt((t[0]-a[0])**2+(t[1]-a[1])**2)}function Rt(a){let t=0;for(let e=0;e<a.length-1;e++)t+=U(a[e],a[e+1]);return t}function ke(a,t,e){let n=new ft.Vector2(t[0]-a[0],t[1]-a[1]),r=new ft.Vector2(t[0]-e[0],t[1]-e[1]),o=n.angleTo(r)*180/Math.PI,s=new ft.Vector2(t[0]-a[0],t[1]-a[1]);return new ft.Vector2(e[0]-a[0],e[1]-a[1]).cross(s)>0?o:-o}function Wa(a,t){let e=Math.min(U(a[0][0],a[0][1]),U(a[0][2],a[0][1]))-1;t||(t=Cn(a[0]));let n=Xa(t,e),r=new ft.Vector2(a[0][0][0],a[0][0][1]),i=new ft.Vector2(a[0][1][0],a[0][1][1]),o=new ft.Vector2(a[0][2][0],a[0][2][1]),u=(r.distanceTo(i)>i.distanceTo(o)?i.clone().sub(r):o.clone().sub(i)).angleTo(new ft.Vector2(0,1)),l=new ft.Matrix3;return l.multiply(new ft.Matrix3().translate(t[0],t[1])).multiply(new ft.Matrix3().rotate(u)).multiply(new ft.Matrix3().translate(-t[0],-t[1])),[n.map(c=>{let h=new ft.Vector2(c[0],c[1]).applyMatrix3(l);return[h.x,h.y]})]}function Xa(a,t){let e=t/2;return[[a[0]-e,a[1]+e],[a[0]+e,a[1]+e],[a[0]+e,a[1]-e],[a[0]-e,a[1]-e],[a[0]-e,a[1]+e]]}function ue(a,t){let e=0,n=1/0,[r,i]=t;for(let o=0;o<a.length-1;o++){let[s,u]=a[o],[l,c]=a[o+1],h=Math.min(s,l)<=r&&r<=Math.max(s,l),p=Math.min(u,c)<=i&&i<=Math.max(u,c);if(h&&p){let f=Math.abs((l-s)*(i-u)-(c-u)*(r-s));f<n&&(n=f,e=o)}}return e}function Ei(a,t){let e=a[0],n=a[1],r=!1;for(let i=0,o=t.length-1;i<t.length;o=i++){let s=t[i][0],u=t[i][1],l=t[o][0],c=t[o][1];u>n!=c>n&&e<(l-s)*(n-u)/(c-u)+s&&(r=!r)}return r}var T0=require("core-js/modules/es.reflect.to-string-tag.js");function Ve(a,t){return new Proxy(a,{get:(e,n,r)=>Reflect.get(e,n,r),set:(e,n,r,i)=>{let o=Reflect.get(e,n,i),s=Reflect.set(e,n,r,i);return o!==r&&t.dispatchEvent({type:"change-"+n,value:r}),s}})}var C0=require("core-js/modules/web.dom-collections.iterator.js"),I0=require("core-js/modules/es.error.cause.js");function Gt(a,t){return Promise.race([a,new Promise((e,n)=>{setTimeout(()=>n(new Error("Promise timeout")),t)})])}function In(a){return document.createElementNS("http://www.w3.org/2000/svg",a)}function bi(a,t){let e=In("svg");return e.setAttribute("width",a),e.setAttribute("height",t),e.style.cssText="position: absolute; left: 0; top: 0; pointer-events: none;",e}function tn(a,t){a===void 0&&(a="2");let e=In("circle");return e.setAttribute("r",a),e.setAttribute("fill",t),e}function Rn(a){let t=In("line");return t.setAttribute("stroke",a),t}function Ee(a,t){let e=In("rect");return e.setAttribute("stroke",a),e.setAttribute("fill",t),e}function Ce(a,t,e){a.setAttribute("cx",""+t),a.setAttribute("cy",""+e)}function Yt(a,t,e){t&&(a.setAttribute("x1",""+t.x),a.setAttribute("y1",""+t.y)),e&&(a.setAttribute("x2",""+e.x),a.setAttribute("y2",""+e.y))}function Ct(a,t,e,n,r){a.setAttribute("x",""+t),a.setAttribute("y",""+e),a.setAttribute("width",""+n),a.setAttribute("height",""+r)}function Si(){return Promise.resolve()}function Mr(){return new Promise(a=>{requestAnimationFrame(a)})}function Mi(a){return a===void 0&&(a=1),new Promise(t=>{function e(){a<=0?t(!0):(a--,window.requestAnimationFrame(e))}window.requestAnimationFrame(e)})}var N0=require("core-js/modules/es.string.replace.js"),O0=require("core-js/modules/es.regexp.exec.js"),D0=require("core-js/modules/es.string.trim.js");function qa(a){return parseInt(a.replace("#","0x"),16)}function ja(a,t){let e=parseInt(a.substring(1,3),16),n=parseInt(a.substring(3,5),16),r=parseInt(a.substring(5,7),16),i=Math.round(e*t),o=Math.round(n*t),s=Math.round(r*t);return"#"+(1<<24|i<<16|o<<8|s).toString(16).slice(1)}function le(a,t){t===void 0&&(t=.85);let e,n,r;if(a.startsWith("#"))e=parseInt(a.substring(1,3),16),n=parseInt(a.substring(3,5),16),r=parseInt(a.substring(5,7),16);else{let o=a.slice(4,-1).split(",");e=parseInt(o[0].trim()),n=parseInt(o[1].trim()),r=parseInt(o[2].trim())}return e=Math.min(Math.floor(e*t),255),n=Math.min(Math.floor(n*t),255),r=Math.min(Math.floor(r*t),255),"#"+((1<<24)+(e<<16)+(n<<8)+r).toString(16).slice(1)}function wr(a,t){a=a.replace(/^#/,"");let e=parseInt(a.substring(0,2),16),n=parseInt(a.substring(2,4),16),r=parseInt(a.substring(4,6),16);return t!==void 0?"rgba("+e+", "+n+", "+r+", "+t+")":"rgb("+e+", "+n+", "+r+")"}var F0=require("core-js/modules/es.regexp.exec.js"),He=navigator.userAgent.toUpperCase().indexOf("MAC")>=0,wi=(navigator.userAgent||"").toLocaleLowerCase(),Ie=/ios|iphone/i.test(wi),Ya=/android|adr|linux/gi.test(wi);function We(a){return He?a==="Meta":a==="Control"}var k0=require("core-js/modules/es.set.difference.v2.js"),V0=require("core-js/modules/es.set.intersection.v2.js"),H0=require("core-js/modules/es.set.is-disjoint-from.v2.js"),W0=require("core-js/modules/es.set.is-subset-of.v2.js"),X0=require("core-js/modules/es.set.is-superset-of.v2.js"),q0=require("core-js/modules/es.set.symmetric-difference.v2.js"),j0=require("core-js/modules/es.set.union.v2.js"),Y0=require("core-js/modules/web.dom-collections.iterator.js"),Ti="__once__",Ai=class{on(t,e){if(typeof e!="function")return;let n=this.events.get(t);return n?n.add(e):this.events.set(t,new Set([e]))}once(t,e){if(typeof e!="function")return;let n=""+Ti+t,r=this.events.get(n);return r?r.add(e):this.events.set(n,new Set([e]))}off(t,e){let n=this.events.get(t),r=this.events.get(""+Ti+t);!n&&!r||(e===void 0&&(n==null||n.clear(),r==null||r.clear()),n!=null&&n.has(e)&&n.delete(e),r!=null&&r.has(e)&&r.delete(e))}offAll(){this.events.clear()}emit(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];let i=this.events.get(t),o=this.events.get(""+Ti+t);!i&&!o||(i==null||i.forEach(s=>{typeof s=="function"&&s(...n)}),o==null||o.forEach(s=>{typeof s=="function"&&s(...n)}),o==null||o.clear())}constructor(){this.events=new Map}};var bt=function(a){return a.SWITCH_FLOOR_BEFORE="switch_floor_before",a.SWITCH_FLOOR_GROUND="switch_floor_ground",a.SWITCH_FLOOR_AFTER="switch_floor_after",a}({});var $0=require("core-js/modules/es.array.sort.js");function Xe(a){return Object.keys(a).sort().map(t=>t+"="+a[t]).join("&")}function Za(a,t){return new Promise((e,n)=>{let r=new XMLHttpRequest;r.open("GET",a,!0),Object.keys(t.headers||{}).forEach(i=>{r.setRequestHeader(i,t.headers[i])}),t.responseType&&(r.responseType=t.responseType),r.onload=()=>{if(r.status>=200&&r.status<300)if(t.responseType==="arraybuffer")e(r.response);else try{let i=JSON.parse(r.responseText);e(i)}catch(i){n(i)}else n(r.statusText)},r.onerror=()=>{n(r.statusText)},r.send()})}var nl=require("core-js/modules/web.dom-collections.iterator.js"),rl=require("core-js/modules/es.array.push.js"),en=require("three"),Go=_i(zo(),1);function ko(a,t){let e=a.clone().normalize(),n=t.clone().normalize();return Math.acos(e.dot(n))}function Ka(a){let t=0;return a.reduce((e,n)=>{let[r,i]=e,[o,s]=n;return t+=Math.sqrt((o-r)**2+(s-i)**2),[o,s]}),t/a.length}function Ci(a,t){if(t===void 0&&(t=.25),Ka(a)<t)return a;let e=(0,Go.default)(a);return Ci(e,t)}function Pn(a,t,e,n,r,i){t===void 0&&(t=!1),e===void 0&&(e=!0),n===void 0&&(n=5),r===void 0&&(r=150),i===void 0&&(i=3);let o=[],s=!t;if(o.push(a[0]),a.length<2)return o;for(let l=0;l<a.length-2;l+=1){let c=a[l],h=a[l+1],p=a[l+2],f=new en.Vector2(c[0]-h[0],c[1]-h[1]),d=new en.Vector2(p[0]-h[0],p[1]-h[1]),m=ko(f,d)/Math.PI*180,_=f.length()+d.length();(!s||m<r&&_>.01||_>n)&&(o.push(a[l+1]),s=!0)}if(o.push(a[a.length-1]),!e)return o;let u=[];u.push(o[0]);for(let l=0;l<o.length-2;l+=1){let c=new en.Vector2(o[l][0],o[l][1]),h=new en.Vector2(o[l+1][0],o[l+1][1]),p=new en.Vector2(o[l+2][0],o[l+2][1]),f=c.distanceTo(h)/2,d=p.distanceTo(h)/2,m=h.clone(),_=h.clone();m.add(c.clone().sub(h).normalize().multiplyScalar(f>i?i/2:f)),_.add(p.clone().sub(h).normalize().multiplyScalar(d>i?i/2:d));let x=[[m.x,m.y],[h.x,h.y],[_.x,_.y]];u.push(...Ci(x,i/25))}return u.push(o[o.length-1]),Vo(u)}function Vo(a){if(a.length<=1)return a;let t=[],e;return a.forEach(n=>{let[r,i]=n;e?r===e[0]&&i===e[1]||(e=[r,i],t.push([r,i])):(e=[r,i],t.push([r,i]))}),t}function Ii(a,t,e){let n=Math.sqrt((e[0]-t[0])**2+(e[1]-t[1])**2);if(n===0)return{distance:Math.sqrt((a[0]-t[0])**2+(a[1]-t[1])**2),closestPoint:t.slice(0)};let r=Math.max(0,Math.min(1,((a[0]-t[0])*(e[0]-t[0])+(a[1]-t[1])*(e[1]-t[1]))/n**2)),i=[t[0]+r*(e[0]-t[0]),t[1]+r*(e[1]-t[1])];return{distance:Math.sqrt((a[0]-i[0])**2+(a[1]-i[1])**2),closestPoint:i}}function $a(a,t,e){let[n,r]=a,[i,o]=t,s=Math.sqrt(Math.pow(i-n,2)+Math.pow(o-r,2));if(s===0||s<e)return[...t];let u=e/s,l=n+(i-n)*u,c=r+(o-r)*u;return[l,c]}var ce=function(a){return 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}({});function Tr(a,t,e){let n=ke(a,t,e);return Ar(n)}function Ar(a){return 180-Math.abs(a)<15?"front":a>135?"right_front":a<-135?"left_front":a<=135&&a>=60?"right":a>=-135&&a<=-60?"left":a<60&&a>0?"right_back":a>-60&&a<0?"left_back":"front"}function Ja(a){if(!a.length)return[];if(a.length===1)return[{direction:"start",distance:0,points:a}];let t=[{direction:"start",distance:U(a[0],a[1]),points:[a[0],a[1]]}];for(let e=2;e<a.length;e++){let n=Tr(a[e-2],a[e-1],a[e]);if(n==="front"){let r=t[t.length-1],i=U(a[e-1],a[e]);r.distance+=i,e!==2&&r.points.push(a[e-1])}else t.push({direction:n,distance:U(a[e-1],a[e]),points:[a[e-1],a[e]]})}return t.push({direction:"end",distance:0,points:[a[a.length-1]]}),t}function Ri(a,t){if(a.length<2)return-1;let e=0;for(let n=1;n<a.length;n++){let r=a[n-1],i=a[n],o=[t[0]-r[0],t[1]-r[1]],s=[i[0]-r[0],i[1]-r[1]],u=Math.min(i[0],r[0])<=t[0]&&t[0]<=Math.max(i[0],r[0]),l=Math.min(i[1],r[1])<=t[1]&&t[1]<=Math.max(i[1],r[1]);if(u&&l){let c=o[0]*s[1]-o[1]*s[0];if(Math.abs(c)<1e-6){let h=Math.sqrt((t[0]-r[0])**2+(t[1]-r[1])**2);return e+h}}e+=Math.sqrt((i[0]-r[0])**2+(i[1]-r[1])**2)}return-1}function qe(a,t){if(a.length<2){var e;return(e=a[0])!=null?e:null}let n=0;for(let r=1;r<a.length;r++){let i=a[r-1],o=a[r],s=Math.sqrt((o[0]-i[0])**2+(o[1]-i[1])**2);if(n+=s,n>=t){let u=(t-(n-s))/s,l=i[0]+(o[0]-i[0])*u,c=i[1]+(o[1]-i[1])*u;return[l,c]}}return null}var pl=require("core-js/modules/es.array.push.js"),fl=require("core-js/modules/web.dom-collections.iterator.js"),dl=require("core-js/modules/es.regexp.exec.js"),he=_i(Ni(),1);var Zt="___",Oi=class{initRoute(t){this.clear(),this.roadInfo=t,t.length&&(t.forEach(e=>{e.points.forEach(n=>{let r=""+e.floor+Zt+n.id;if(this.pointMap.set(r,n),this.nodeMap.set(""+n.floor+Zt+n.nodeId,r),n.type==="straightLadder"){let i=this.straightLadderMap.get(n.name)||[];i.push(v({},n)),this.straightLadderMap.set(n.name,i)}if(n.type==="staircase"){let i=this.staircaseMap.get(n.name)||[];i.push(v({},n)),this.staircaseMap.set(n.name,i)}if(n.type==="escalator"){let i=this.escalatorMap.get(n.name)||{};n.escalatorDirection==="exit"?i.end={floor:n.floor,id:n.id}:i.start={floor:n.floor,id:n.id},this.escalatorMap.set(n.name,i)}if(n.type==="facility"){let i=this.facilityMap.get(n.targetId)||[];i.push(v({},n)),this.facilityMap.set(n.targetId,i)}}),e.lines.filter(n=>n.direction!=="no").forEach(n=>{var r,i;let o=""+e.floor+Zt+n.from,s=""+e.floor+Zt+n.to,u=(r=this.pointMap.get(o))==null?void 0:r.cds,l=(i=this.pointMap.get(s))==null?void 0:i.cds;if(u!=null&&u.length&&(l!=null&&l.length)){let c=U(u,l);this.addLineItem(o,s,c),n.direction==="double"&&this.addLineItem(s,o,c)}})}),this.initBaseRoute(),this.initEscalatorRoute(),this.initStraightLadderRoute())}addLineItem(t,e,n,r){r===void 0&&(r=this.lineMap);let i=r.get(t)||new Map;i.set(e,n),r.set(t,i)}addFacilityToLineMap(t,e,n,r){[...this.straightLadderMap,...this.staircaseMap].forEach(i=>{let[o,s]=i;if(!(s.length<2))for(let c=0;c<s.length;c++){let h=""+s[c].floor+Zt+s[c].id;for(let p=0;p<s.length;p++)if(c!==p){var u,l;let f=""+s[p].floor+Zt+s[p].id,d=(u=this.pointMap.get(h))==null?void 0:u.cds,m=(l=this.pointMap.get(f))==null?void 0:l.cds;if(d!=null&&d.length&&(m!=null&&m.length))if(s[c].type==="straightLadder"){let _=e;this.addLineItem(h,f,_,r)}else{let _=n;this.addLineItem(h,f,_,r)}}}}),this.escalatorMap.forEach((i,o)=>{if(i.start&&i.end){var s,u;let l=""+i.start.floor+Zt+i.start.id,c=""+i.end.floor+Zt+i.end.id,h=(s=this.pointMap.get(l))==null?void 0:s.cds,p=(u=this.pointMap.get(c))==null?void 0:u.cds;if(h!=null&&h.length&&(p!=null&&p.length)){let f=t;this.addLineItem(l,c,f,r)}}})}initBaseRoute(){let t=new Map([...this.lineMap]);this.addFacilityToLineMap(1,this.lift_priority,3e4,t),this.baseRoute=new he.default(t)}initEscalatorRoute(){let t=new Map([...this.lineMap]),e=1e4;this.addFacilityToLineMap(1*e,this.lift_priority*e,3e4*e,t),this.escalatorRoute=new he.default(t)}initStraightLadderRoute(){let t=new Map([...this.lineMap]),e=1e4;this.addFacilityToLineMap(3*e,1*e,3e4*e,t),this.straightLadderRoute=new he.default(t)}checkStart(t){return!(!t.floor||!t.nodeId&&(!t.coord||t.coord.length<2))}checkEnd(t){return t.facility?!0:this.checkStart(t)}transformStart(t){var e;if(t.nodeId){let n=this.nodeMap.get(""+t.floor+Zt+t.nodeId);if(n){let[r,i]=n.split(Zt);return{floor:r,id:i}}}if((e=t.coord)!=null&&e.length){let n=this.roadInfo.find(i=>i.floor===t.floor);if(!n)return null;let r=n.points.reduce((i,o)=>{let s=U(t.coord,o.cds);return s<i.min&&(i.min=s,i.point=o),i},{min:1/0,point:n.points[0]});return{floor:r.point.floor,id:r.point.id}}return null}transformEnd(t){if(t.floor){let e=this.transformStart(t);if(e)return e}if(t.facility){let e=this.facilityMap.get(t.facility);if(e!=null&&e.length)return{floor:t.floor,facility:t.facility}}return null}getPath(t,e,n){if(n===void 0&&(n=""),!this.checkStart(t))return"start-error";if(!this.checkEnd(e))return"end-error";let r=this.transformStart(t);if(!r)return"no-start";let i=this.transformEnd(e);if(!i)return"no-end";let o=this.getBasePath.bind(this);switch(n){case"escalator":o=this.getEscalatorPath.bind(this);break;case"straightLadder":o=this.getStraightLadderPath.bind(this);break;default:o=this.getBasePath.bind(this);break}if(i.id)return o(r,i);if(i.facility){let s=this.facilityMap.get(i.facility).filter(l=>i.floor?l.floor===i.floor:!0);if(!s.length)return null;let u=s.map(l=>o(r,{floor:l.floor,id:l.id})).filter(l=>!!l);return u.reduce((l,c)=>{let h=c.reduce((p,f)=>p+Rt(f.points),0);return h<l.distance&&(l.distance=h,l.path=c),l},{distance:1/0,path:u[0]}).path}}getRoutePath(t,e,n){let r=""+t.floor+Zt+t.id,i=""+e.floor+Zt+e.id,o=n.path(r,i);if(!o)return null;let s=[];return o.map(u=>{let l=this.pointMap.get(u);if(l){var c;let{floor:h}=l;if(((c=s[s.length-1])==null?void 0:c.floor)===h){let p=s[s.length-1];p.points.push(l.cds),p.endType=l.type,p.destId=l.nodeId,p.distance=Rt(p.points)}else s.push({floor:h,points:[l.cds],endType:l.type,destId:l.nodeId,distance:0})}}),s}getBasePath(t,e){return this.getRoutePath(t,e,this.baseRoute)}getEscalatorPath(t,e){return this.getRoutePath(t,e,this.escalatorRoute)}getStraightLadderPath(t,e){return this.getRoutePath(t,e,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 he.default,this.escalatorRoute=new he.default,this.straightLadderRoute=new he.default}constructor(t=3){this.lift_priority=t,this.roadInfo=[],this.pointMap=new Map,this.nodeMap=new Map,this.facilityMap=new Map,this.straightLadderMap=new Map,this.escalatorMap=new Map,this.staircaseMap=new Map,this.lineMap=new Map,this.baseRoute=new he.default,this.escalatorRoute=new he.default,this.straightLadderRoute=new he.default}};var yl=require("core-js/modules/web.dom-collections.iterator.js"),vl=require("core-js/modules/es.regexp.exec.js"),xl=require("core-js/modules/es.array.push.js"),El=require("core-js/modules/es.set.difference.v2.js"),bl=require("core-js/modules/es.set.intersection.v2.js"),Sl=require("core-js/modules/es.set.is-disjoint-from.v2.js"),Ml=require("core-js/modules/es.set.is-subset-of.v2.js"),wl=require("core-js/modules/es.set.is-superset-of.v2.js"),Tl=require("core-js/modules/es.set.symmetric-difference.v2.js"),Al=require("core-js/modules/es.set.union.v2.js"),Cl=require("core-js/modules/es.array.flat.js"),Il=require("core-js/modules/es.array.unscopables.flat.js"),St=_i(Ni(),1);var Ot=require("lodash"),Cr=require("three"),D="___",Di=class{setLiftPriority(t){this.lift_priority=t}isFacilityByType(t){return["facility","escalator","straightLadder","staircase","ramp","connectionPoint"].includes(t)}initFacilities(t){this.facilities=t.map(e=>{let n=[];try{n=JSON.parse(e.entry_end_floor)}catch(i){n=[]}let r=[];try{r=JSON.parse(e.entry_start_floor)}catch(i){r=[]}return v({},e,{entry_start_floor:r,entry_end_floor:n})})}getParkingSpaceInfo(t,e){let n=""+t+D+e;var r;return(r=this.parkingMap.get(n))!=null?r:null}getNodeInfo(t,e){let n=""+t+D+e,r=this.nodeMap.get(n);if(!(r!=null&&r.length))return null;let i=this.pointMap.get(r[0]);return i!=null?i:null}initRoute(t,e){this.clear(),this.roadInfo=t,this.initFacilities(e);let n=new Date,r=n.getHours()*60+n.getMinutes();t.length&&(t.forEach(i=>{let o=(i.points||[]).filter(s=>!(0,Ot.isNil)(s.passWeight)&&s.passWeight!==1&&!(0,Ot.isNil)(s.coverageArea)&&s.coverageArea!==0);(i.points||[]).filter(s=>s.openStatus!==!1).filter(s=>{if(!s.startTime||!s.endTime)return!0;let[u,l]=s.startTime.split(":").map(d=>+d),[c,h]=s.endTime.split(":").map(d=>+d),p=u*60+l,f=c*60+h;return r>=p&&r<=f}).forEach(s=>{s.floor=i.floor;let u=""+i.floor+D+s.id,l=""+i.floor+D+s.nodeId,c=this.nodeMap.get(l)||[];if(c.push(""+i.floor+D+(s.relatedId||s.id)),this.nodeMap.set(""+i.floor+D+s.nodeId,c),this.pointMap.set(u,s),this.isFacilityByType(s.type)){let h=this.facilities.find(p=>p.id===+s.targetId);if(h){switch(h.entry_infra_type){case"straightLadder":if(h.entry_end_floor.find(m=>m.floor===i.floor)&&h.entry_start_floor.find(m=>m.floor===i.floor)){let m=this.straightLadderMap.get(s.targetId)||[];m.push(v({},s)),this.straightLadderMap.set(s.targetId,m)}break;case"staircase":if(h.entry_end_floor.find(m=>m.floor===i.floor)&&h.entry_start_floor.find(m=>m.floor===i.floor)){let m=this.staircaseMap.get(s.targetId)||[];m.push(v({},s)),this.staircaseMap.set(s.targetId,m)}break;case"escalator":let f=this.escalatorMap.get(s.targetId)||[];if(h.entry_start_floor.find(m=>m.floor===i.floor)){let m=f.find(_=>{var x;return((x=_.end)==null?void 0:x.floor)!==i.floor&&!_.start});m?m.start=s:f.push({start:s})}if(h.entry_end_floor.find(m=>m.floor===i.floor)){let m=f.find(_=>{var x;return((x=_.start)==null?void 0:x.floor)!==i.floor&&!_.end});m?m.end=s:f.push({end:s})}this.escalatorMap.set(s.targetId,f);break;case"ramp":let d=this.rampMap.get(s.targetId)||[];if(h.entry_start_floor.find(m=>m.floor===i.floor)){let m=d.find(_=>{var x;return((x=_.end)==null?void 0:x.floor)!==i.floor&&!_.start});m?m.start=s:d.push({start:s})}if(h.entry_end_floor.find(m=>m.floor===i.floor)){let m=d.find(_=>{var x;return((x=_.start)==null?void 0:x.floor)!==i.floor&&!_.end});m?m.end=s:d.push({end:s})}this.rampMap.set(s.targetId,d);break;case"connectionPoint":if(h.entry_end_floor.find(m=>m.floor===i.floor)&&h.entry_start_floor.find(m=>m.floor===i.floor)){let m=this.connectionPointMap.get(s.targetId)||[];m.push(v({},s)),this.connectionPointMap.set(s.targetId,m)}break}let p=this.facilityMap.get(s.targetId)||[];p.push(v({},s)),this.facilityMap.set(s.targetId,p)}}s.type==="parkingSpace"&&s.name.split(/[,,]/).forEach(p=>{this.parkingMap.set(""+i.floor+D+p,s)})}),(i.lines||[]).filter(s=>s.to!==s.from).forEach(s=>{let u=""+i.floor+D+s.from,l=""+i.floor+D+s.to,c=this.pointMap.get(u),h=this.pointMap.get(l);if(!c||!h)return;let p=c.cds,f=h.cds,d=U(p,f);if(o.forEach(m=>{(m.id===s.from||m.id===s.to)&&(d=d/m.passWeight);let _=U(p,m.cds)<=m.coverageArea,x=U(f,m.cds)<=m.coverageArea;(_||x)&&(d=d/m.passWeight)}),!c.permission&&!h.permission){switch(this.addLineItem(u,l,d),this.addLineItem(l,u,d),s.direction){case"double":this.addLineItem(u,l,d,this.forwardLineMap),this.addLineItem(l,u,d,this.forwardLineMap);break;case"single":this.addLineItem(u,l,d,this.forwardLineMap);break;case"back":this.addLineItem(l,u,d,this.forwardLineMap);break}(c.type==="parkingSpace"||h.type==="parkingSpace")&&s.direction==="noDir"&&(this.addLineItem(u,l,d,this.forwardLineMap),this.addLineItem(l,u,d,this.forwardLineMap))}else c.permission&&(this.setPermissionLine(u,l,c.permission,d,""),this.setPermissionLine(l,u,c.permission,d,"")),h.permission&&h.permission!==c.permission&&(this.setPermissionLine(u,l,h.permission,d,""),this.setPermissionLine(l,u,h.permission,d,""))})}),this.addPermissionFacility(),this.initBaseRoute(),this.initEscalatorRoute(),this.initStraightLadderRoute(),this.initForwardRoute())}getPermissionMap(t){return this["permission_"+t]||(this["permission_"+t]=new Set),this["permission_"+t]}setPermissionLine(t,e,n,r,i){this.getPermissionMap(n).add({fromKey:t,toKey:e,distance:r,type:i})}addPermissionFacility(){this.straightLadderMap.forEach((t,e)=>{if(t.length<2){this.straightLadderMap.delete(e);return}for(let n=0;n<t.length;n++){let r=""+t[n].floor+D+t[n].id,i=this.pointMap.get(r);if(i){for(let o=0;o<t.length;o++)if(n!==o){let s=""+t[o].floor+D+t[o].id,u=this.pointMap.get(s);if(!u)continue;i.permission&&this.setPermissionLine(r,s,i.permission,1,"straightLadder"),u.permission&&u.permission!==i.permission&&this.setPermissionLine(r,s,u.permission,1,"straightLadder")}}}}),this.staircaseMap.forEach((t,e)=>{if(t.length<2){this.staircaseMap.delete(e);return}for(let n=0;n<t.length;n++){let r=""+t[n].floor+D+t[n].id,i=this.pointMap.get(r);if(i){for(let o=0;o<t.length;o++)if(n!==o){let s=""+t[o].floor+D+t[o].id,u=this.pointMap.get(s);if(!u)continue;i.permission&&this.setPermissionLine(r,s,i.permission,1,"staircase"),u.permission&&u.permission!==i.permission&&this.setPermissionLine(r,s,u.permission,1,"staircase")}}}}),this.escalatorMap.forEach((t,e)=>{t.forEach(n=>{if(n.start&&n.end){let r=""+n.start.floor+D+n.start.id,i=""+n.end.floor+D+n.end.id,o=this.pointMap.get(r),s=this.pointMap.get(i);o&&s&&(o.permission&&this.setPermissionLine(r,i,o.permission,1,"escalator"),s.permission&&s.permission!==o.permission&&this.setPermissionLine(r,i,s.permission,1,"escalator"))}})}),this.rampMap.forEach((t,e)=>{t.forEach(n=>{if(n.start&&n.end){let r=""+n.start.floor+D+n.start.id,i=""+n.end.floor+D+n.end.id,o=this.pointMap.get(r),s=this.pointMap.get(i);o&&s&&(o.permission&&this.setPermissionLine(r,i,o.permission,10,"ramp"),s.permission&&s.permission!==o.permission&&this.setPermissionLine(r,i,s.permission,10,"ramp"))}})}),this.connectionPointMap.forEach((t,e)=>{if(t.length<2){this.connectionPointMap.delete(e);return}for(let n=0;n<t.length;n++){let r=""+t[n].floor+D+t[n].id,i=this.pointMap.get(r);if(i){for(let o=0;o<t.length;o++)if(n!==o){let s=""+t[o].floor+D+t[o].id,u=this.pointMap.get(s);if(!u)continue;i.permission&&this.setPermissionLine(r,s,i.permission,1,"connectionPoint"),u.permission&&u.permission!==i.permission&&this.setPermissionLine(r,s,u.permission,1,"connectionPoint")}}}})}addPermissionLineToMap(t,e,n,r){this.getPermissionMap(t).forEach(o=>{e.includes(o.type)&&(o.type===""?this.addLineItem(o.fromKey,o.toKey,o.distance,n):this.addLineItem(o.fromKey,o.toKey,r.get(o.type),n))})}addLineItem(t,e,n,r){r===void 0&&(r=this.lineMap);let i=r.get(t)||new Map;i.set(e,n),r.set(t,i)}addFacilityToLineMap(t,e,n,r){[...this.straightLadderMap,...this.staircaseMap].forEach(i=>{let[o,s]=i;if(!(s.length<2))for(let u=0;u<s.length;u++){let l=""+s[u].floor+D+s[u].id,c=this.pointMap.get(l);if(!(!c||c.permission)){for(let h=0;h<s.length;h++)if(u!==h){let p=""+s[h].floor+D+s[h].id,f=this.pointMap.get(p);if(!f||f.permission)continue;if(s[u].type==="straightLadder"){let d=e;this.addLineItem(l,p,d,r)}else{let d=n;this.addLineItem(l,p,d,r)}}}}}),this.escalatorMap.forEach((i,o)=>{i.forEach(s=>{if(s.start&&s.end){let u=""+s.start.floor+D+s.start.id,l=""+s.end.floor+D+s.end.id,c=this.pointMap.get(u),h=this.pointMap.get(l);if(c&&h&&!c.permission&&!h.permission){let p=t;this.addLineItem(u,l,p,r)}}})}),this.connectionPointMap.forEach((i,o)=>{if(!(i.length<2))for(let s=0;s<i.length;s++){let u=""+i[s].floor+D+i[s].id,l=this.pointMap.get(u);if(!(!l||l.permission)){for(let c=0;c<i.length;c++)if(s!==c){let h=""+i[c].floor+D+i[c].id,p=this.pointMap.get(h);if(!p||p.permission)continue;this.addLineItem(u,h,100,r)}}}})}initBaseRoute(){let t=new Map((0,Ot.cloneDeep)([...this.lineMap]));this.addFacilityToLineMap(100,100*this.lift_priority,3e4,t),this.baseRoute=new St.default(t)}initEscalatorRoute(){let t=new Map((0,Ot.cloneDeep)([...this.lineMap])),e=1e4;this.addFacilityToLineMap(100,this.lift_priority*e,3e4*e,t),this.escalatorRoute=new St.default(t)}initStraightLadderRoute(){let t=new Map((0,Ot.cloneDeep)([...this.lineMap])),e=1e4;this.addFacilityToLineMap(3*e,300,3e4*e,t),this.straightLadderRoute=new St.default(t)}initForwardRoute(){this.rampMap.forEach((t,e)=>{t.forEach(n=>{if(n.start&&n.end){let r=""+n.start.floor+D+n.start.id,i=""+n.end.floor+D+n.end.id,o=this.pointMap.get(r),s=this.pointMap.get(i);o&&s&&!o.permission&&!s.permission&&this.addLineItem(r,i,10,this.forwardLineMap)}})}),this.connectionPointMap.forEach((t,e)=>{if(!(t.length<2))for(let n=0;n<t.length;n++){let r=""+t[n].floor+D+t[n].id,i=this.pointMap.get(r);if(!(!i||i.permission)){for(let o=0;o<t.length;o++)if(n!==o){let s=""+t[o].floor+D+t[o].id,u=this.pointMap.get(s);if(!u||u.permission)continue;this.addLineItem(r,s,100,this.forwardLineMap)}}}}),this.forwardRoute=new St.default(this.forwardLineMap)}checkStart(t){return!(!t.floor||!t.nodeId&&(!t.coord||t.coord.length<2))}checkEnd(t){return t.facility||t.parkingSpace&&t.floor?!0:this.checkStart(t)}transformStart(t,e,n){n===void 0&&(n={});var r;if(t.nodeId){let i=this.nodeMap.get(""+t.floor+D+t.nodeId);if(i!=null&&i.length)return i.map(o=>{let[s,u]=o.split(D);return{floor:s,id:u}})}if((r=t.coord)!=null&&r.length){let i=this.roadInfo.find(l=>l.floor===t.floor);if(!i)return null;let o=i.points.filter(l=>l.isStarted),s=i.points.filter(l=>{let c=""+l.floor+D+l.id;if(e==="forward"){if(!this.forwardLineMap.has(c)||n.adsorptionIntersection&&o.length&&!l.isStarted)return!1}else if(!this.lineMap.has(c))return!1;return!0});if(!s.length)return null;let u=s.reduce((l,c)=>{if(c.relatedId)return l;let h=U(t.coord,c.cds);return h<l.min&&(l.min=h,l.point=c),l},{min:1/0,point:s[0]});return[{floor:i.floor,id:u.point.id}]}return null}transformEnd(t,e){if(t.floor){if(t.parkingSpace){let r=this.parkingMap.get(""+t.floor+D+t.parkingSpace);if(r)return[{floor:t.floor,id:r.id}]}let n=this.transformStart(t,e);if(n)return n}if(t.facility){let r=this.facilities.filter(i=>+i.type_id==+t.facility).map(i=>i.id).map(i=>this.facilityMap.get(""+i)).flat(2);if(r!=null&&r.length)return{floor:t.floor,facility:t.facility}}return null}getPath(t,e,n,r,i,o){if(n===void 0&&(n=""),o===void 0&&(o={}),!this.checkStart(t))return"start-error";if(!this.checkEnd(e))return"end-error";let s=this.transformStart(t,n,o);if(!s)return"no-start";let u=this.transformEnd(e,n);if(!u)return"no-end";let l=[];if(Array.isArray(u))for(let p=0;p<s.length;p++){let f=s[p];for(let d=0;d<u.length;d++){let m=u[d];if(f.floor===m.floor&&f.id===m.id)return"near"}}else{l=this.facilities.filter(f=>+f.type_id==+e.facility).map(f=>f.id).map(f=>this.facilityMap.get(""+f)).flat(2).filter(f=>f).filter(f=>u.floor?f.floor===u.floor:!0);for(let f=0;f<s.length;f++){let d=s[f];for(let m=0;m<l.length;m++){let _=l[m];if(d.floor===_.floor&&d.id===_.id)return"near"}}}let c;switch(n){case"escalator":c=this.getEscalatorPath.bind(this);break;case"straightLadder":c=this.getStraightLadderPath.bind(this);break;case"forward":c=this.getForwardPath.bind(this);break;default:c=this.getBasePath.bind(this);break}let h=null;return s.forEach(p=>{if(Array.isArray(u))u.forEach(f=>{let d=c(p,f,r,i);d&&d&&(!h||d[0].consume<h[0].consume)&&(h=d)});else{if(!l.length)return null;let f=l.map(d=>c(p,{floor:d.floor,id:d.id},r,i)).filter(d=>!!d);h=f.reduce((d,m)=>{let _=m[0].consume;return _<d.distance&&(d.distance=_,d.path=m),d},{distance:1/0,path:f[0]}).path}}),h}getRoutePath(t,e,n){let r=""+t.floor+D+t.id,i=this.pointMap.get(r),o=""+e.floor+D+e.id,s=this.pointMap.get(o);if(!i||!s)return null;let u=""+i.floor+D+(i.relatedId||i.id),l=""+s.floor+D+(s.relatedId||s.id),c=n.path(u,l);if(!c)return null;let h=[],p=c.reduce((f,d,m,_)=>{if(m===0)return 0;let x=_[m-1],E=n.graph.get(x).get(d);return f+E},0);return c.map(f=>{let d=this.pointMap.get(f);if(d){var m;let{floor:_}=d,x=d.type;if(this.isFacilityByType(d.type)){let E=this.facilities.find(S=>S.id===+d.targetId);E&&(x=E.entry_infra_type)}if(((m=h[h.length-1])==null?void 0:m.floor)===_){let E=h[h.length-1];E.points.push(d.cds),E.pointInfos.push(d),E.endType=x,E.destId=d.nodeId,E.distance=Rt(E.points)}else h.push({floor:_,points:[d.cds],pointInfos:[d],endType:x,destId:d.nodeId,distance:0,consume:p})}}),h}getBasePath(t,e,n){if(!n)return this.getRoutePath(t,e,this.baseRoute);let r=(0,Ot.cloneDeep)(this.baseRoute.graph),i=s=>{this.addPermissionLineToMap(s,["","escalator","staircase","straightLadder","connectionPoint"],r,new Map([["escalator",100],["connectionPoint",100],["straightLadder",100*this.lift_priority],["staircase",3e4]]))};Array.isArray(n)?n.forEach(s=>{i(s)}):i(n);let o=new St.default(r);return this.getRoutePath(t,e,o)}getEscalatorPath(t,e,n){if(!n)return this.getRoutePath(t,e,this.escalatorRoute);let r=(0,Ot.cloneDeep)(this.escalatorRoute.graph),i=1e4,o=u=>{this.addPermissionLineToMap(u,["","escalator","staircase","straightLadder","connectionPoint"],r,new Map([["escalator",100],["connectionPoint",100],["straightLadder",this.lift_priority*i],["staircase",3e4*i]]))};Array.isArray(n)?n.forEach(u=>{o(u)}):o(n);let s=new St.default(r);return this.getRoutePath(t,e,s)}getStraightLadderPath(t,e,n){if(!n)return this.getRoutePath(t,e,this.straightLadderRoute);let r=(0,Ot.cloneDeep)(this.straightLadderRoute.graph),i=1e4,o=u=>{this.addPermissionLineToMap(u,["","escalator","staircase","straightLadder","connectionPoint"],r,new Map([["escalator",3*i],["connectionPoint",100],["straightLadder",300],["staircase",3e4*i]]))};Array.isArray(n)?n.forEach(u=>{o(u)}):o(n);let s=new St.default(r);return this.getRoutePath(t,e,s)}getForwardPath(t,e,n,r){let i=new Map,o=f=>{let d=this.forwardRoute.graph.get(u);f.forEach(m=>{let _=d.get(m);(0,Ot.isNil)(_)||(i.set(m,_),d.delete(m))})},s=()=>{let f=this.forwardRoute.graph.get(u);i.forEach((d,m)=>{f.set(m,d)})},u=""+t.floor+D+t.id;if(!(0,Ot.isNil)(r)){let f=this.forwardLineMap.get(u),d=this.pointMap.get(u);if(d&&(f!=null&&f.size)&&f.size>1){let m=new Cr.Vector2(d.cds[0],d.cds[1]),_=new Map;f.forEach((E,S)=>{let R=this.pointMap.get(S);if(R){let P=new Cr.Vector2(R.cds[0],R.cds[1]),T=360-(new Cr.Vector2().subVectors(P,m).angle()/Math.PI*180-90+360)%360;_.set(S,T)}});let x=Array.from(_).filter(E=>{let[S,R]=E;return Math.abs(R-r)<=60}).map(E=>{let[S]=E;return S});if(x.length)x.forEach(E=>_.delete(E)),o([..._.keys()]);else{let E=Array.from(_).reduce((S,R)=>{let P=Math.abs(R[1]-r);return P<S.diff?{diff:P,key:R[0]}:S},{diff:1/0,key:""});_.delete(E.key),o([..._.keys()])}}}if(!n){let f=this.getRoutePath(t,e,this.forwardRoute);return s(),f||this.getRoutePath(t,e,this.forwardRoute)}let l=(0,Ot.cloneDeep)(this.forwardRoute.graph),c=f=>{this.addPermissionLineToMap(f,["","ramp"],l,new Map([["ramp",10]]))};Array.isArray(n)?n.forEach(f=>{c(f)}):c(n);let h=new St.default(l),p=this.getRoutePath(t,e,h);if(s(),p)return p;{let f=(0,Ot.cloneDeep)(this.forwardRoute.graph);Array.isArray(n)?n.forEach(_=>{c(_)}):c(n);let d=new St.default(f);return this.getRoutePath(t,e,d)}}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 St.default,this.escalatorRoute=new St.default,this.straightLadderRoute=new St.default}constructor(t=3){this.lift_priority=t,this.roadInfo=[],this.facilities=[],this.pointMap=new Map,this.nodeMap=new Map,this.facilityMap=new Map,this.straightLadderMap=new Map,this.escalatorMap=new Map,this.rampMap=new Map,this.staircaseMap=new Map,this.connectionPointMap=new Map,this.parkingMap=new Map,this.lineMap=new Map,this.baseRoute=new St.default,this.escalatorRoute=new St.default,this.straightLadderRoute=new St.default,this.forwardLineMap=new Map,this.forwardRoute=new St.default}};var Ll=require("core-js/modules/es.set.difference.v2.js"),Nl=require("core-js/modules/es.set.intersection.v2.js"),Ol=require("core-js/modules/es.set.is-disjoint-from.v2.js"),Dl=require("core-js/modules/es.set.is-subset-of.v2.js"),Ul=require("core-js/modules/es.set.is-superset-of.v2.js"),Fl=require("core-js/modules/es.set.symmetric-difference.v2.js"),Bl=require("core-js/modules/es.set.union.v2.js"),zl=require("core-js/modules/web.dom-collections.iterator.js"),Re=class{static createKey(){return Math.random().toString(36).substring(2,15)+Math.random().toString(36).substring(2,15)}static genUniqueKey(){let t=this.createKey();for(;this.keySet.has(t);)t=this.createKey();return t}static removeKey(t){this.keySet.delete(t)}static dispose(){this.keySet.clear()}};Re.keySet=new Set;var kl=require("core-js/modules/es.string.replace.js"),Vl=require("core-js/modules/es.regexp.exec.js");function Ui(a){return a.replace(/[A-Z]/g,t=>"_"+t.toLowerCase()).replace(/^_/,"")}function Z(a,t,e){return new Promise((n,r)=>{let i=Re.genUniqueKey(),o=s=>{let{data:u}=s;u.type===""+t+"_result"&&u.key===i&&(Re.removeKey(i),self.removeEventListener("message",o),u.error?r(u.error):n(u.data))};a.addEventListener("message",o),a.postMessage({type:t,key:i,data:e})})}function nu(a){let t={};for(let n in a)n.startsWith("on")&&(t[Ui(n.slice(2))]=a[n],t[n]=a[n]);let e=n=>g(this,null,function*(){let{data:r}=n;if(t[r.type])try{let i=yield t[r.type](r.data);if(i!=null&&i.$transfer&&Array.isArray(i.$transfer)){let o=i.$transfer;delete i.$transfer,self.postMessage({type:""+r.type+"_result",key:r.key,data:i},o)}else self.postMessage({type:""+r.type+"_result",key:r.key,data:i})}catch(i){self.postMessage({type:""+r.type+"_result",key:r.key,error:i})}else self.postMessage({type:""+r.type+"_result",key:r.key,error:"no_event"})});return self.addEventListener("message",e),()=>{self.removeEventListener("message",e)}}var Kt=require("three");function ru(a,t){t===void 0&&(t=16711680);let e=new Kt.LineBasicMaterial({color:t}),n=new Kt.BufferGeometry().setFromPoints(a);return new Kt.Line(n,e)}function iu(a,t){t===void 0&&(t=16711680);let e=new Kt.MeshBasicMaterial({color:t,depthTest:!1,transparent:!0}),n=new Kt.BoxGeometry(1,1,1),r=new Kt.Mesh(n,e);return r.position.copy(a),r.renderOrder=100100,r}var Zl=require("core-js/modules/es.json.stringify.js"),Kl=require("core-js/modules/web.dom-collections.iterator.js");function Ln(a,t,e){e===void 0&&(e=0),a.forEach(n=>{if(n.geometry.coords=JSON.parse(JSON.stringify(n.geometry.cds)),n.geometry.type==="polygon"){var r;n.geometry.coords.map(i=>{Array.isArray(i)&&i.forEach(o=>{o[0]-=t[0],o[1]-=t[1]})}),n.geometry.otherCds&&(n.geometry.otherCoords=n.geometry.otherCds.map(i=>i.map(o=>je(o,t)))),(r=n.doors)!=null&&r.length&&n.doors.map(i=>{i.coord=je(i.coordinate,t)}),n.center&&(n.centerCoords=je(n.center,t))}else n.geometry.coords=je(n.geometry.cds,t),n.center&&(n.centerCoords=je(n.center,t));if(n.center_x&&n.center_y){let[i,o]=je([n.center_x,n.center_y],t);n.center_coord_x=i,n.center_coord_y=o}});for(let n=0;n<a.length;n++){let r=a[n];r.deltaHeight=1e-5*(e+n+1)}}function je(a,t){return[a[0]-t[0],a[1]-t[1]]}var Jl=require("core-js/modules/es.set.difference.v2.js"),Ql=require("core-js/modules/es.set.intersection.v2.js"),tc=require("core-js/modules/es.set.is-disjoint-from.v2.js"),ec=require("core-js/modules/es.set.is-subset-of.v2.js"),nc=require("core-js/modules/es.set.is-superset-of.v2.js"),rc=require("core-js/modules/es.set.symmetric-difference.v2.js"),ic=require("core-js/modules/es.set.union.v2.js"),oc=require("core-js/modules/web.dom-collections.iterator.js"),rs=require("@tweenjs/tween.js"),be=class{update(){this.group.update()}pause(){this.pauseTween=!0,this.getAll().forEach(t=>{this.tweenStore.add(t),t.pause()})}continue(){this.pauseTween&&(this.tweenStore.forEach(t=>{t.resume()}),this.tweenStore.clear(),this.pauseTween=!1)}remove(t){this.group.remove(t)}getAll(){return this.group.getAll()}clear(){this.getAll().forEach(t=>t.stop()),this.group.removeAll()}dispose(){this.clear()}constructor(){this.pauseTween=!1,this.tweenStore=new Set,this.group=new rs.Group}};var is=require("three"),Nn=class extends is.EventDispatcher{registryEvent(){this.ctn.addEventListener("pointerdown",this._pointerDown),this.ctn.addEventListener("pointerup",this._pointerUp)}unRegistryEvent(){this.ctn.removeEventListener("pointerdown",this._pointerDown),this.ctn.removeEventListener("pointerup",this._pointerUp)}dispose(){this.unRegistryEvent()}constructor(t){super(),this.ctn=t,this._pointerDown=e=>{this.point={x:e.offsetX,y:e.offsetY}},this._pointerUp=e=>{if(!this.point)return;let{offsetX:n,offsetY:r}=e,{x:i,y:o}=this.point;Math.hypot(i-n+(o-r))>3||this.dispatchEvent({type:"click",e})},this.registryEvent()}};var lc=require("core-js/modules/web.dom-collections.iterator.js"),cc=require("core-js/modules/es.array.push.js"),hc=require("core-js/modules/es.string.replace.js"),pc=require("core-js/modules/es.regexp.exec.js"),os=require("lodash"),ss=require("three");var Ye=class extends ss.EventDispatcher{_isEffectiveTask(t){return t&&typeof t.run=="function"}_getIndexByTid(t){return this._task.findIndex(e=>e.tid===t)}_createTask(t){return this._isEffectiveTask(t)?v({},t,{tid:++this._id,meta:t.meta||{}}):!1}get task(){return[...this._task]}getTasks(){return[...this._task]}add(t){if(this._isEffectiveTask(t)){let e=this._createTask(t);return this._task.push(e),this.started&&!this.activeTask&&this.start(),e.tid}return!1}replace(t,e){if(!this._isEffectiveTask(e))return console.warn("[TaskQueue] replace\u65B9\u6CD5\u4F20\u5165\u7684task\u53C2\u6570\u683C\u5F0F\u4E0D\u6B63\u786E"),!1;let n=this._getIndexByTid(t);if(n===-1)return console.warn("[TaskQueue] \u6CA1\u6709\u627E\u5230id="+t+"\u7684\u4EFB\u52A1"),!1;let r=this._createTask(e);return this._task.splice(n,1,r),r.tid}replaceByMetaType(t){var e;let n=(e=t.meta)==null?void 0:e.type;if((0,os.isNil)(n))return this.add(t);{let r=this._task.find(i=>i.meta.type===n);return r?this.replace(r.tid,t):this.add(t)}}remove(t){let e=this._getIndexByTid(t);return e===-1?(console.warn("[TaskQueue] remove\u65B9\u6CD5\u4F20\u5165\u7684id\uFF1A"+t+"\u627E\u4E0D\u5230\u5BF9\u5E94\u7684task"),!1):(this._task.splice(e,1),!0)}clear(){this._task.length=0}start(){this.started=!0,!this.activeTask&&this._task.length&&this.exec()}stop(){this.started=!1}exec(){return g(this,null,function*(){if(!this.started||!this._task.length)return!1;let t=this._task.shift();this.activeTask=t,this.dispatchEvent({type:"active-task-start",task:t});let e;try{e=yield t.run()}catch(n){console.warn("[task run err]",n,t)}return this.activeTask=null,this.dispatchEvent({type:"active-task-end",task:t,res:e}),this.exec()})}constructor(t=!0){super(),this._task=[],this.started=!1,this.activeTask=null,this._id=0,t&&this.start()}};var gc=require("core-js/modules/es.array.push.js"),as=require("three"),On=class extends as.EventDispatcher{getWorker(){return new Promise(t=>{let e=this.pool.find(r=>r.state==="leisure");if(e){e.state="used",t(e.worker);return}if(this.pool.length<this.max&&this.workerConstructor){let r=this.workerConstructor();this.pool.push({worker:r,state:"used"}),t(r);return}let n=()=>{let r=this.pool.find(i=>i.state==="leisure");r&&(this.removeEventListener("release",n),r.state="used",t(r.worker))};this.addEventListener("release",n)})}releaseWorker(t){let e=this.pool.find(n=>n.worker===t);e&&(e.state="leisure",this.dispatchEvent({type:"release",worker:t}))}dispose(){this._listeners={},this.pool.forEach(t=>{t.worker.terminate()}),this.pool=[]}constructor(t=10,e){super(),this.max=10,this.pool=[],this.max=t,this.workerConstructor=e}};var us=require("three"),ct=class extends us.EventDispatcher{dispose(){this._listeners={}}};var Dn=class{filter(t){let e=this.estimate,n=this.errorEstimate+this.processNoise,r=n/(n+this.measurementNoise);return this.estimate=e+r*(t-e),this.errorEstimate=(1-r)*n,this.estimate}constructor(t={}){this.estimate=0,this.errorEstimate=1,this.processNoise=.1,this.measurementNoise=1,this.measurementNoise=t.measurementNoise||1,this.processNoise=t.processNoise||.1,this.errorEstimate=t.errorEstimate||1}};var vc=require("core-js/modules/es.typed-array.float32-array.js"),xc=require("core-js/modules/es.typed-array.at.js"),Ec=require("core-js/modules/es.typed-array.fill.js"),bc=require("core-js/modules/es.typed-array.find-last.js"),Sc=require("core-js/modules/es.typed-array.find-last-index.js"),Mc=require("core-js/modules/es.typed-array.set.js"),wc=require("core-js/modules/es.typed-array.sort.js"),Tc=require("core-js/modules/es.typed-array.to-reversed.js"),Ac=require("core-js/modules/es.typed-array.to-sorted.js"),Cc=require("core-js/modules/es.typed-array.with.js"),Ic=require("core-js/modules/es.array-buffer.constructor.js"),Rc=require("core-js/modules/es.array-buffer.slice.js"),Pc=require("core-js/modules/es.array-buffer.detached.js"),Lc=require("core-js/modules/es.array-buffer.transfer.js"),Nc=require("core-js/modules/es.array-buffer.transfer-to-fixed-length.js"),Oc=require("core-js/modules/es.array.push.js"),Dc=require("core-js/modules/web.dom-collections.iterator.js"),J=require("three");var ls=require("three/examples/jsm/utils/BufferGeometryUtils.js");var Ir=require("@turf/turf");function ou(a,t,e){t===void 0&&(t=!0),e===void 0&&(e=!1);let n=a.filter(s=>s.geometry.type==="polygon");if(!n.length)return null;let r=n.map(s=>{var u;let l=s.geometry.coords,c=An(l[0],l.slice(1)),h=new J.ExtrudeGeometry(c,{steps:1,bevelEnabled:!1,depth:s.height,curveSegments:4});(u=s).deltaHeight||(u.deltaHeight=0),h.translate(0,0,s.airHeight+s.deltaHeight);let p=h.attributes.position.count,f=new Float32Array(p).fill(s.height+s.airHeight+s.deltaHeight);if(h.setAttribute("maxZ",new J.BufferAttribute(f,1)),h.setAttribute("opacity",new J.BufferAttribute(new Float32Array(p).fill(s.fillOpacity),1)),e){let _=new Float32Array(p).fill(s.airHeight+s.deltaHeight);h.setAttribute("minZ",new J.BufferAttribute(_,1))}let d=new J.Color(s.fillColor).convertLinearToSRGB(),m=new Float32Array(p*3);for(let _=0;_<p;_++)m[_*3]=d.r,m[_*3+1]=d.g,m[_*3+2]=d.b;return h.setAttribute("color",new J.BufferAttribute(m,3)),h}),i=(0,ls.mergeGeometries)(r);r.forEach(s=>s.dispose());let o={geometry:i};return i.dispose(),t&&(o.lineGeometry=cs(n)||void 0),o}function su(a){let t=a.filter(u=>u.geometry.type==="polygon");if(!t.length)return null;let e=[],n=[],r=[],i=[],o=[],s=[];return t.map((u,l)=>{var c;(c=u).deltaHeight||(c.deltaHeight=0);let h=u.geometry.coords,p=U(h[0][0],h[0][1]),f=U(h[0][1],h[0][2]),d=h[0][1][0]-h[0][0][0],m=h[0][1][1]-h[0][0][1],_=Math.atan2(m,d),x=(0,Ir.center)((0,Ir.polygon)(h)),E=x.geometry.coordinates[0],S=x.geometry.coordinates[1],R=new J.Matrix4().compose(new J.Vector3(E,S,u.deltaHeight+u.airHeight+u.height/2),new J.Quaternion().setFromAxisAngle(new J.Vector3(0,0,1),_),new J.Vector3(p,f,u.height));e.push(...R.toArray()),n.push(...new J.Color(u.fillColor).convertLinearToSRGB().toArray()),r[l]=u.fillOpacity||1,i[l]=(u.deltaHeight||0)+u.airHeight+u.height,o[l]=u.id,s[l]=u.airHeight+u.deltaHeight}),{size:t.length,ids:o,matrixes:e,colors:n,opacities:r,maxZs:i,minZs:s}}function cs(a){let{points:t,colors:e,opacities:n}=Rr(a);if(!t.length)return null;let r=new J.BufferGeometry().setFromPoints(t);return r.setAttribute("color",new J.BufferAttribute(new Float32Array(e),3)),r.setAttribute("opacity",new J.BufferAttribute(new Float32Array(n),1)),r}function Rr(a){let t=[],e=[],n=[];return a.filter(r=>r.strokeOpacity>0).map(r=>{let i=r.height+(r.deltaHeight||0)+r.airHeight,{coords:o}=r.geometry,{strokeColor:s,strokeOpacity:u}=r,l=new J.Color(s).convertLinearToSRGB();for(let c=0;c<o.length;c++){let h=o[c];for(let p=0;p<h.length;p++){let f=h[p],d=p+1===h.length?h[0]:h[p+1];t.push(new J.Vector3(f[0],f[1],i)),t.push(new J.Vector3(d[0],d[1],i)),e.push(l.r,l.g,l.b),e.push(l.r,l.g,l.b),n.push(u),n.push(u)}}}),{points:t,colors:e,opacities:n}}function au(a){if(a.length>1)return!1;let t=a[0];if(t.length!==5)return!1;let[e]=t,n=t[t.length-1];if(e[0]!==n[0]||e[1]!==n[1])return!1;let r=[Math.round(U(t[0],t[1])),Math.round(U(t[1],t[2])),Math.round(U(t[2],t[3])),Math.round(U(t[3],t[4]))];if(!(r[2]===r[0]&&r[3]===r[1]))return!1;let i=ke(t[0],t[1],t[2]);return Math.abs(Math.abs(i)-90)<1}var k=require("three");var k_=require("core-js/modules/web.dom-collections.iterator.js"),V_=require("core-js/modules/es.set.difference.v2.js"),H_=require("core-js/modules/es.set.intersection.v2.js"),W_=require("core-js/modules/es.set.is-disjoint-from.v2.js"),X_=require("core-js/modules/es.set.is-subset-of.v2.js"),q_=require("core-js/modules/es.set.is-superset-of.v2.js"),j_=require("core-js/modules/es.set.symmetric-difference.v2.js"),Y_=require("core-js/modules/es.set.union.v2.js"),Z_=require("core-js/modules/es.array.push.js"),Js=require("three");var Bp=require("core-js/modules/web.dom-collections.iterator.js"),zp=require("core-js/modules/es.array.push.js"),C=require("three");var zc=require("core-js/modules/web.dom-collections.iterator.js"),ps=require("three/examples/jsm/lines/LineMaterial.js"),et=require("three");function hs(a){return a.x+"-"+a.y+"-"+a.z}var A=class{static generateLineMaterialKey(t){let{color:e,opacity:n}=t;return e+"-"+n}static createLineMaterial(t){let{color:e,opacity:n,vertexColors:r}=t,i=this.generateLineMaterialKey({color:e,opacity:n,vertexColors:r});if(this.lineMaterialMap.has(i))return this.lineMaterialMap.get(i);let o=new et.LineBasicMaterial({color:new et.Color(e).convertLinearToSRGB(),transparent:!0,opacity:n,vertexColors:r!=null?r:!1});return this.lineMaterialMap.set(i,o),o}static createMeshStandardMaterial(t){let{color:e,opacity:n}=t,r=e+"-"+n;if(this.meshStandardMaterialMap.has(r))return this.meshStandardMaterialMap.get(r);let i=new et.MeshStandardMaterial({color:new et.Color(e).convertLinearToSRGB(),roughness:1,transparent:!0,opacity:n,depthWrite:!0});return this.meshStandardMaterialMap.set(r,i),i}static createMeshBasicMaterial(t){let{color:e,opacity:n,vertexColors:r}=t,i=e+"-"+n+"-"+r;if(this.meshBasicMaterialMap.has(i))return this.meshBasicMaterialMap.get(i);let o=new et.MeshBasicMaterial({color:e,transparent:!0,opacity:n,depthWrite:!0,vertexColors:r!=null?r:!1});return this.meshBasicMaterialMap.set(i,o),o}static createShaderMaterial(t){let{gradualColor:e,center:n,maxValue:r,opacity:i,direction:o,max:s,min:u}=t,l=e.toString()+"-"+hs(n)+"-"+r+"-"+i+"-"+hs(o);if(this.shaderMaterialMap.has(l))return this.shaderMaterialMap.get(l);let c=`
|
|
2
2
|
uniform vec3 uColor;
|
|
3
3
|
uniform vec3 uGradualColor;
|
|
4
4
|
uniform vec3 center;
|
|
@@ -221,8 +221,8 @@
|
|
|
221
221
|
`],{type:"text/javascript"}),t=URL.createObjectURL(a),e=new Worker(t);return URL.revokeObjectURL(t),e}function Bi(){let a=new Blob([`var Py=Object.create;var Xn=Object.defineProperty;var _y=Object.getOwnPropertyDescriptor;var Cy=Object.getOwnPropertyNames;var Ny=Object.getPrototypeOf,Fy=Object.prototype.hasOwnProperty;var i=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports);var Ly=(r,e,t,a)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of Cy(e))!Fy.call(r,n)&&n!==t&&Xn(r,n,{get:()=>e[n],enumerable:!(a=_y(e,n))||a.enumerable});return r};var S=(r,e,t)=>(t=r!=null?Py(Ny(r)):{},Ly(e||!r||!r.__esModule?Xn(t,"default",{value:r,enumerable:!0}):t,r));var Y=(r,e,t)=>new Promise((a,n)=>{var u=c=>{try{s(t.next(c))}catch(f){n(f)}},o=c=>{try{s(t.throw(c))}catch(f){n(f)}},s=c=>c.done?a(c.value):Promise.resolve(c.value).then(u,o);s((t=t.apply(r,e)).next())});var T=i((At,Zn)=>{"use strict";var Wr=function(r){return r&&r.Math===Math&&r};Zn.exports=Wr(typeof globalThis=="object"&&globalThis)||Wr(typeof window=="object"&&window)||Wr(typeof self=="object"&&self)||Wr(typeof global=="object"&&global)||Wr(typeof At=="object"&&At)||function(){return this}()||Function("return this")()});var I=i((TE,Jn)=>{"use strict";Jn.exports=function(r){try{return!!r()}catch(e){return!0}}});var w=i((SE,Qn)=>{"use strict";var By=I();Qn.exports=!By(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!==7})});var Yr=i((IE,ri)=>{"use strict";var jy=I();ri.exports=!jy(function(){var r=function(){}.bind();return typeof r!="function"||r.hasOwnProperty("prototype")})});var b=i((xE,ei)=>{"use strict";var Dy=Yr(),de=Function.prototype.call;ei.exports=Dy?de.bind(de):function(){return de.apply(de,arguments)}});var ii=i(ni=>{"use strict";var ti={}.propertyIsEnumerable,ai=Object.getOwnPropertyDescriptor,My=ai&&!ti.call({1:2},1);ni.f=My?function(e){var t=ai(this,e);return!!t&&t.enumerable}:ti});var Kr=i((OE,ui)=>{"use strict";ui.exports=function(r,e){return{enumerable:!(r&1),configurable:!(r&2),writable:!(r&4),value:e}}});var A=i((bE,vi)=>{"use strict";var oi=Yr(),si=Function.prototype,Ot=si.call,Uy=oi&&si.bind.bind(Ot,Ot);vi.exports=oi?Uy:function(r){return function(){return Ot.apply(r,arguments)}}});var ir=i((EE,fi)=>{"use strict";var ci=A(),ky=ci({}.toString),Gy=ci("".slice);fi.exports=function(r){return Gy(ky(r),8,-1)}});var qe=i((wE,li)=>{"use strict";var $y=A(),Vy=I(),Wy=ir(),bt=Object,Yy=$y("".split);li.exports=Vy(function(){return!bt("z").propertyIsEnumerable(0)})?function(r){return Wy(r)==="String"?Yy(r,""):bt(r)}:bt});var he=i((RE,yi)=>{"use strict";yi.exports=function(r){return r==null}});var wr=i((mE,pi)=>{"use strict";var Ky=he(),zy=TypeError;pi.exports=function(r){if(Ky(r))throw new zy("Can't call method on "+r);return r}});var Rr=i((PE,di)=>{"use strict";var Hy=qe(),Xy=wr();di.exports=function(r){return Hy(Xy(r))}});var O=i((_E,qi)=>{"use strict";var Et=typeof document=="object"&&document.all;qi.exports=typeof Et=="undefined"&&Et!==void 0?function(r){return typeof r=="function"||r===Et}:function(r){return typeof r=="function"}});var m=i((CE,hi)=>{"use strict";var Zy=O();hi.exports=function(r){return typeof r=="object"?r!==null:Zy(r)}});var gr=i((NE,gi)=>{"use strict";var wt=T(),Jy=O(),Qy=function(r){return Jy(r)?r:void 0};gi.exports=function(r,e){return arguments.length<2?Qy(wt[r]):wt[r]&&wt[r][e]}});var zr=i((FE,Ti)=>{"use strict";var rp=A();Ti.exports=rp({}.isPrototypeOf)});var mr=i((LE,xi)=>{"use strict";var ep=T(),Si=ep.navigator,Ii=Si&&Si.userAgent;xi.exports=Ii?String(Ii):""});var Te=i((BE,Ri)=>{"use strict";var wi=T(),Rt=mr(),Ai=wi.process,Oi=wi.Deno,bi=Ai&&Ai.versions||Oi&&Oi.version,Ei=bi&&bi.v8,k,ge;Ei&&(k=Ei.split("."),ge=k[0]>0&&k[0]<4?1:+(k[0]+k[1]));!ge&&Rt&&(k=Rt.match(/Edge\\/(\\d+)/),(!k||k[1]>=74)&&(k=Rt.match(/Chrome\\/(\\d+)/),k&&(ge=+k[1])));Ri.exports=ge});var mt=i((jE,Pi)=>{"use strict";var mi=Te(),tp=I(),ap=T(),np=ap.String;Pi.exports=!!Object.getOwnPropertySymbols&&!tp(function(){var r=Symbol("symbol detection");return!np(r)||!(Object(r)instanceof Symbol)||!Symbol.sham&&mi&&mi<41})});var Pt=i((DE,_i)=>{"use strict";var ip=mt();_i.exports=ip&&!Symbol.sham&&typeof Symbol.iterator=="symbol"});var Se=i((ME,Ci)=>{"use strict";var up=gr(),op=O(),sp=zr(),vp=Pt(),cp=Object;Ci.exports=vp?function(r){return typeof r=="symbol"}:function(r){var e=up("Symbol");return op(e)&&sp(e.prototype,cp(r))}});var Hr=i((UE,Ni)=>{"use strict";var fp=String;Ni.exports=function(r){try{return fp(r)}catch(e){return"Object"}}});var ur=i((kE,Fi)=>{"use strict";var lp=O(),yp=Hr(),pp=TypeError;Fi.exports=function(r){if(lp(r))return r;throw new pp(yp(r)+" is not a function")}});var Xr=i((GE,Li)=>{"use strict";var dp=ur(),qp=he();Li.exports=function(r,e){var t=r[e];return qp(t)?void 0:dp(t)}});var ji=i(($E,Bi)=>{"use strict";var _t=b(),Ct=O(),Nt=m(),hp=TypeError;Bi.exports=function(r,e){var t,a;if(e==="string"&&Ct(t=r.toString)&&!Nt(a=_t(t,r))||Ct(t=r.valueOf)&&!Nt(a=_t(t,r))||e!=="string"&&Ct(t=r.toString)&&!Nt(a=_t(t,r)))return a;throw new hp("Can't convert object to primitive value")}});var Zr=i((VE,Di)=>{"use strict";Di.exports=!1});var Ie=i((WE,Ui)=>{"use strict";var Mi=T(),gp=Object.defineProperty;Ui.exports=function(r,e){try{gp(Mi,r,{value:e,configurable:!0,writable:!0})}catch(t){Mi[r]=e}return e}});var xe=i((YE,$i)=>{"use strict";var Tp=Zr(),Sp=T(),Ip=Ie(),ki="__core-js_shared__",Gi=$i.exports=Sp[ki]||Ip(ki,{});(Gi.versions||(Gi.versions=[])).push({version:"3.42.0",mode:Tp?"pure":"global",copyright:"\\xA9 2014-2025 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.42.0/LICENSE",source:"https://github.com/zloirock/core-js"})});var Ae=i((KE,Wi)=>{"use strict";var Vi=xe();Wi.exports=function(r,e){return Vi[r]||(Vi[r]=e||{})}});var K=i((zE,Yi)=>{"use strict";var xp=wr(),Ap=Object;Yi.exports=function(r){return Ap(xp(r))}});var j=i((HE,Ki)=>{"use strict";var Op=A(),bp=K(),Ep=Op({}.hasOwnProperty);Ki.exports=Object.hasOwn||function(e,t){return Ep(bp(e),t)}});var Oe=i((XE,zi)=>{"use strict";var wp=A(),Rp=0,mp=Math.random(),Pp=wp(1 .toString);zi.exports=function(r){return"Symbol("+(r===void 0?"":r)+")_"+Pp(++Rp+mp,36)}});var E=i((ZE,Xi)=>{"use strict";var _p=T(),Cp=Ae(),Hi=j(),Np=Oe(),Fp=mt(),Lp=Pt(),Pr=_p.Symbol,Ft=Cp("wks"),Bp=Lp?Pr.for||Pr:Pr&&Pr.withoutSetter||Np;Xi.exports=function(r){return Hi(Ft,r)||(Ft[r]=Fp&&Hi(Pr,r)?Pr[r]:Bp("Symbol."+r)),Ft[r]}});var Lt=i((JE,Qi)=>{"use strict";var jp=b(),Zi=m(),Ji=Se(),Dp=Xr(),Mp=ji(),Up=E(),kp=TypeError,Gp=Up("toPrimitive");Qi.exports=function(r,e){if(!Zi(r)||Ji(r))return r;var t=Dp(r,Gp),a;if(t){if(e===void 0&&(e="default"),a=jp(t,r,e),!Zi(a)||Ji(a))return a;throw new kp("Can't convert object to primitive value")}return e===void 0&&(e="number"),Mp(r,e)}});var be=i((QE,ru)=>{"use strict";var $p=Lt(),Vp=Se();ru.exports=function(r){var e=$p(r,"string");return Vp(e)?e:e+""}});var Ee=i((rw,tu)=>{"use strict";var Wp=T(),eu=m(),Bt=Wp.document,Yp=eu(Bt)&&eu(Bt.createElement);tu.exports=function(r){return Yp?Bt.createElement(r):{}}});var jt=i((ew,au)=>{"use strict";var Kp=w(),zp=I(),Hp=Ee();au.exports=!Kp&&!zp(function(){return Object.defineProperty(Hp("div"),"a",{get:function(){return 7}}).a!==7})});var we=i(iu=>{"use strict";var Xp=w(),Zp=b(),Jp=ii(),Qp=Kr(),rd=Rr(),ed=be(),td=j(),ad=jt(),nu=Object.getOwnPropertyDescriptor;iu.f=Xp?nu:function(e,t){if(e=rd(e),t=ed(t),ad)try{return nu(e,t)}catch(a){}if(td(e,t))return Qp(!Zp(Jp.f,e,t),e[t])}});var Dt=i((aw,uu)=>{"use strict";var nd=w(),id=I();uu.exports=nd&&id(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!==42})});var D=i((nw,ou)=>{"use strict";var ud=m(),od=String,sd=TypeError;ou.exports=function(r){if(ud(r))return r;throw new sd(od(r)+" is not an object")}});var z=i(vu=>{"use strict";var vd=w(),cd=jt(),fd=Dt(),Re=D(),su=be(),ld=TypeError,Mt=Object.defineProperty,yd=Object.getOwnPropertyDescriptor,Ut="enumerable",kt="configurable",Gt="writable";vu.f=vd?fd?function(e,t,a){if(Re(e),t=su(t),Re(a),typeof e=="function"&&t==="prototype"&&"value"in a&&Gt in a&&!a[Gt]){var n=yd(e,t);n&&n[Gt]&&(e[t]=a.value,a={configurable:kt in a?a[kt]:n[kt],enumerable:Ut in a?a[Ut]:n[Ut],writable:!1})}return Mt(e,t,a)}:Mt:function(e,t,a){if(Re(e),t=su(t),Re(a),cd)try{return Mt(e,t,a)}catch(n){}if("get"in a||"set"in a)throw new ld("Accessors not supported");return"value"in a&&(e[t]=a.value),e}});var J=i((uw,cu)=>{"use strict";var pd=w(),dd=z(),qd=Kr();cu.exports=pd?function(r,e,t){return dd.f(r,e,qd(1,t))}:function(r,e,t){return r[e]=t,r}});var me=i((ow,lu)=>{"use strict";var $t=w(),hd=j(),fu=Function.prototype,gd=$t&&Object.getOwnPropertyDescriptor,Vt=hd(fu,"name"),Td=Vt&&function(){}.name==="something",Sd=Vt&&(!$t||$t&&gd(fu,"name").configurable);lu.exports={EXISTS:Vt,PROPER:Td,CONFIGURABLE:Sd}});var Yt=i((sw,yu)=>{"use strict";var Id=A(),xd=O(),Wt=xe(),Ad=Id(Function.toString);xd(Wt.inspectSource)||(Wt.inspectSource=function(r){return Ad(r)});yu.exports=Wt.inspectSource});var qu=i((vw,du)=>{"use strict";var Od=T(),bd=O(),pu=Od.WeakMap;du.exports=bd(pu)&&/native code/.test(String(pu))});var Pe=i((cw,gu)=>{"use strict";var Ed=Ae(),wd=Oe(),hu=Ed("keys");gu.exports=function(r){return hu[r]||(hu[r]=wd(r))}});var _e=i((fw,Tu)=>{"use strict";Tu.exports={}});var Sr=i((lw,xu)=>{"use strict";var Rd=qu(),Iu=T(),md=m(),Pd=J(),Kt=j(),zt=xe(),_d=Pe(),Cd=_e(),Su="Object already initialized",Ht=Iu.TypeError,Nd=Iu.WeakMap,Ce,Jr,Ne,Fd=function(r){return Ne(r)?Jr(r):Ce(r,{})},Ld=function(r){return function(e){var t;if(!md(e)||(t=Jr(e)).type!==r)throw new Ht("Incompatible receiver, "+r+" required");return t}};Rd||zt.state?(G=zt.state||(zt.state=new Nd),G.get=G.get,G.has=G.has,G.set=G.set,Ce=function(r,e){if(G.has(r))throw new Ht(Su);return e.facade=r,G.set(r,e),e},Jr=function(r){return G.get(r)||{}},Ne=function(r){return G.has(r)}):(Tr=_d("state"),Cd[Tr]=!0,Ce=function(r,e){if(Kt(r,Tr))throw new Ht(Su);return e.facade=r,Pd(r,Tr,e),e},Jr=function(r){return Kt(r,Tr)?r[Tr]:{}},Ne=function(r){return Kt(r,Tr)});var G,Tr;xu.exports={set:Ce,get:Jr,has:Ne,enforce:Fd,getterFor:Ld}});var Jt=i((yw,bu)=>{"use strict";var Zt=A(),Bd=I(),jd=O(),Fe=j(),Xt=w(),Dd=me().CONFIGURABLE,Md=Yt(),Ou=Sr(),Ud=Ou.enforce,kd=Ou.get,Au=String,Le=Object.defineProperty,Gd=Zt("".slice),$d=Zt("".replace),Vd=Zt([].join),Wd=Xt&&!Bd(function(){return Le(function(){},"length",{value:8}).length!==8}),Yd=String(String).split("String"),Kd=bu.exports=function(r,e,t){Gd(Au(e),0,7)==="Symbol("&&(e="["+$d(Au(e),/^Symbol\\(([^)]*)\\).*$/,"$1")+"]"),t&&t.getter&&(e="get "+e),t&&t.setter&&(e="set "+e),(!Fe(r,"name")||Dd&&r.name!==e)&&(Xt?Le(r,"name",{value:e,configurable:!0}):r.name=e),Wd&&t&&Fe(t,"arity")&&r.length!==t.arity&&Le(r,"length",{value:t.arity});try{t&&Fe(t,"constructor")&&t.constructor?Xt&&Le(r,"prototype",{writable:!1}):r.prototype&&(r.prototype=void 0)}catch(n){}var a=Ud(r);return Fe(a,"source")||(a.source=Vd(Yd,typeof e=="string"?e:"")),r};Function.prototype.toString=Kd(function(){return jd(this)&&kd(this).source||Md(this)},"toString")});var Ir=i((pw,Eu)=>{"use strict";var zd=O(),Hd=z(),Xd=Jt(),Zd=Ie();Eu.exports=function(r,e,t,a){a||(a={});var n=a.enumerable,u=a.name!==void 0?a.name:e;if(zd(t)&&Xd(t,u,a),a.global)n?r[e]=t:Zd(e,t);else{try{a.unsafe?r[e]&&(n=!0):delete r[e]}catch(o){}n?r[e]=t:Hd.f(r,e,{value:t,enumerable:!1,configurable:!a.nonConfigurable,writable:!a.nonWritable})}return r}});var Ru=i((dw,wu)=>{"use strict";var Jd=Math.ceil,Qd=Math.floor;wu.exports=Math.trunc||function(e){var t=+e;return(t>0?Qd:Jd)(t)}});var M=i((qw,mu)=>{"use strict";var rq=Ru();mu.exports=function(r){var e=+r;return e!==e||e===0?0:rq(e)}});var Be=i((hw,Pu)=>{"use strict";var eq=M(),tq=Math.max,aq=Math.min;Pu.exports=function(r,e){var t=eq(r);return t<0?tq(t+e,0):aq(t,e)}});var xr=i((gw,_u)=>{"use strict";var nq=M(),iq=Math.min;_u.exports=function(r){var e=nq(r);return e>0?iq(e,9007199254740991):0}});var U=i((Tw,Cu)=>{"use strict";var uq=xr();Cu.exports=function(r){return uq(r.length)}});var Lu=i((Sw,Fu)=>{"use strict";var oq=Rr(),sq=Be(),vq=U(),Nu=function(r){return function(e,t,a){var n=oq(e),u=vq(n);if(u===0)return!r&&-1;var o=sq(a,u),s;if(r&&t!==t){for(;u>o;)if(s=n[o++],s!==s)return!0}else for(;u>o;o++)if((r||o in n)&&n[o]===t)return r||o||0;return!r&&-1}};Fu.exports={includes:Nu(!0),indexOf:Nu(!1)}});var ra=i((Iw,ju)=>{"use strict";var cq=A(),Qt=j(),fq=Rr(),lq=Lu().indexOf,yq=_e(),Bu=cq([].push);ju.exports=function(r,e){var t=fq(r),a=0,n=[],u;for(u in t)!Qt(yq,u)&&Qt(t,u)&&Bu(n,u);for(;e.length>a;)Qt(t,u=e[a++])&&(~lq(n,u)||Bu(n,u));return n}});var je=i((xw,Du)=>{"use strict";Du.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]});var ea=i(Mu=>{"use strict";var pq=ra(),dq=je(),qq=dq.concat("length","prototype");Mu.f=Object.getOwnPropertyNames||function(e){return pq(e,qq)}});var ku=i(Uu=>{"use strict";Uu.f=Object.getOwnPropertySymbols});var $u=i((bw,Gu)=>{"use strict";var hq=gr(),gq=A(),Tq=ea(),Sq=ku(),Iq=D(),xq=gq([].concat);Gu.exports=hq("Reflect","ownKeys")||function(e){var t=Tq.f(Iq(e)),a=Sq.f;return a?xq(t,a(e)):t}});var ta=i((Ew,Wu)=>{"use strict";var Vu=j(),Aq=$u(),Oq=we(),bq=z();Wu.exports=function(r,e,t){for(var a=Aq(e),n=bq.f,u=Oq.f,o=0;o<a.length;o++){var s=a[o];!Vu(r,s)&&!(t&&Vu(t,s))&&n(r,s,u(e,s))}}});var Ku=i((ww,Yu)=>{"use strict";var Eq=I(),wq=O(),Rq=/#|\\.prototype\\./,Qr=function(r,e){var t=Pq[mq(r)];return t===Cq?!0:t===_q?!1:wq(e)?Eq(e):!!e},mq=Qr.normalize=function(r){return String(r).replace(Rq,".").toLowerCase()},Pq=Qr.data={},_q=Qr.NATIVE="N",Cq=Qr.POLYFILL="P";Yu.exports=Qr});var R=i((Rw,zu)=>{"use strict";var De=T(),Nq=we().f,Fq=J(),Lq=Ir(),Bq=Ie(),jq=ta(),Dq=Ku();zu.exports=function(r,e){var t=r.target,a=r.global,n=r.stat,u,o,s,c,f,v;if(a?o=De:n?o=De[t]||Bq(t,{}):o=De[t]&&De[t].prototype,o)for(s in e){if(f=e[s],r.dontCallGetSet?(v=Nq(o,s),c=v&&v.value):c=o[s],u=Dq(a?s:t+(n?".":"#")+s,r.forced),!u&&c!==void 0){if(typeof f==typeof c)continue;jq(f,c)}(r.sham||c&&c.sham)&&Fq(f,"sham",!0),Lq(o,s,f,r)}}});var $=i((mw,Hu)=>{"use strict";var aa=A(),Me=Set.prototype;Hu.exports={Set,add:aa(Me.add),has:aa(Me.has),remove:aa(Me.delete),proto:Me}});var or=i((Pw,Xu)=>{"use strict";var Mq=$().has;Xu.exports=function(r){return Mq(r),r}});var sr=i((_w,Zu)=>{"use strict";var Uq=b();Zu.exports=function(r,e,t){for(var a=t?r:r.iterator,n=r.next,u,o;!(u=Uq(n,a)).done;)if(o=e(u.value),o!==void 0)return o}});var _r=i((Cw,to)=>{"use strict";var Ju=A(),kq=sr(),Qu=$(),Gq=Qu.Set,ro=Qu.proto,$q=Ju(ro.forEach),eo=Ju(ro.keys),Vq=eo(new Gq).next;to.exports=function(r,e,t){return t?kq({iterator:eo(r),next:Vq},e):$q(r,e)}});var Ue=i((Nw,no)=>{"use strict";var ao=$(),Wq=_r(),Yq=ao.Set,Kq=ao.add;no.exports=function(r){var e=new Yq;return Wq(r,function(t){Kq(e,t)}),e}});var re=i((Fw,io)=>{"use strict";var zq=A(),Hq=ur();io.exports=function(r,e,t){try{return zq(Hq(Object.getOwnPropertyDescriptor(r,e)[t]))}catch(a){}}});var Cr=i((Lw,uo)=>{"use strict";var Xq=re(),Zq=$();uo.exports=Xq(Zq.proto,"size","get")||function(r){return r.size}});var so=i((Bw,oo)=>{"use strict";oo.exports=function(r){return{iterator:r,next:r.next,done:!1}}});var vr=i((jw,po)=>{"use strict";var vo=ur(),lo=D(),co=b(),Jq=M(),Qq=so(),fo="Invalid size",rh=RangeError,eh=TypeError,th=Math.max,yo=function(r,e){this.set=r,this.size=th(e,0),this.has=vo(r.has),this.keys=vo(r.keys)};yo.prototype={getIterator:function(){return Qq(lo(co(this.keys,this.set)))},includes:function(r){return co(this.has,this.set,r)}};po.exports=function(r){lo(r);var e=+r.size;if(e!==e)throw new eh(fo);var t=Jq(e);if(t<0)throw new rh(fo);return new yo(r,t)}});var To=i((Dw,go)=>{"use strict";var ah=or(),ho=$(),nh=Ue(),ih=Cr(),uh=vr(),oh=_r(),sh=sr(),vh=ho.has,qo=ho.remove;go.exports=function(e){var t=ah(this),a=uh(e),n=nh(t);return ih(t)<=a.size?oh(t,function(u){a.includes(u)&&qo(n,u)}):sh(a.getIterator(),function(u){vh(t,u)&&qo(n,u)}),n}});var cr=i((Mw,xo)=>{"use strict";var ch=gr(),So=function(r){return{size:r,has:function(){return!1},keys:function(){return{next:function(){return{done:!0}}}}}},Io=function(r){return{size:r,has:function(){return!0},keys:function(){throw new Error("e")}}};xo.exports=function(r,e){var t=ch("Set");try{new t()[r](So(0));try{return new t()[r](So(-1)),!1}catch(n){if(!e)return!0;try{return new t()[r](Io(-1/0)),!1}catch(u){var a=new t;return a.add(1),a.add(2),e(a[r](Io(1/0)))}}}catch(n){return!1}}});var Ao=i(()=>{"use strict";var fh=R(),lh=To(),yh=cr(),ph=!yh("difference",function(r){return r.size===0});fh({target:"Set",proto:!0,real:!0,forced:ph},{difference:lh})});var Eo=i((Gw,bo)=>{"use strict";var dh=or(),na=$(),qh=Cr(),hh=vr(),gh=_r(),Th=sr(),Sh=na.Set,Oo=na.add,Ih=na.has;bo.exports=function(e){var t=dh(this),a=hh(e),n=new Sh;return qh(t)>a.size?Th(a.getIterator(),function(u){Ih(t,u)&&Oo(n,u)}):gh(t,function(u){a.includes(u)&&Oo(n,u)}),n}});var wo=i(()=>{"use strict";var xh=R(),Ah=I(),Oh=Eo(),bh=cr(),Eh=!bh("intersection",function(r){return r.size===2&&r.has(1)&&r.has(2)})||Ah(function(){return String(Array.from(new Set([1,2,3]).intersection(new Set([3,2]))))!=="3,2"});xh({target:"Set",proto:!0,real:!0,forced:Eh},{intersection:Oh})});var ia=i((Ww,mo)=>{"use strict";var wh=b(),Ro=D(),Rh=Xr();mo.exports=function(r,e,t){var a,n;Ro(r);try{if(a=Rh(r,"return"),!a){if(e==="throw")throw t;return t}a=wh(a,r)}catch(u){n=!0,a=u}if(e==="throw")throw t;if(n)throw a;return Ro(a),t}});var _o=i((Yw,Po)=>{"use strict";var mh=or(),Ph=$().has,_h=Cr(),Ch=vr(),Nh=_r(),Fh=sr(),Lh=ia();Po.exports=function(e){var t=mh(this),a=Ch(e);if(_h(t)<=a.size)return Nh(t,function(u){if(a.includes(u))return!1},!0)!==!1;var n=a.getIterator();return Fh(n,function(u){if(Ph(t,u))return Lh(n,"normal",!1)})!==!1}});var Co=i(()=>{"use strict";var Bh=R(),jh=_o(),Dh=cr(),Mh=!Dh("isDisjointFrom",function(r){return!r});Bh({target:"Set",proto:!0,real:!0,forced:Mh},{isDisjointFrom:jh})});var Fo=i((Hw,No)=>{"use strict";var Uh=or(),kh=Cr(),Gh=_r(),$h=vr();No.exports=function(e){var t=Uh(this),a=$h(e);return kh(t)>a.size?!1:Gh(t,function(n){if(!a.includes(n))return!1},!0)!==!1}});var Lo=i(()=>{"use strict";var Vh=R(),Wh=Fo(),Yh=cr(),Kh=!Yh("isSubsetOf",function(r){return r});Vh({target:"Set",proto:!0,real:!0,forced:Kh},{isSubsetOf:Wh})});var jo=i((Jw,Bo)=>{"use strict";var zh=or(),Hh=$().has,Xh=Cr(),Zh=vr(),Jh=sr(),Qh=ia();Bo.exports=function(e){var t=zh(this),a=Zh(e);if(Xh(t)<a.size)return!1;var n=a.getIterator();return Jh(n,function(u){if(!Hh(t,u))return Qh(n,"normal",!1)})!==!1}});var Do=i(()=>{"use strict";var rg=R(),eg=jo(),tg=cr(),ag=!tg("isSupersetOf",function(r){return!r});rg({target:"Set",proto:!0,real:!0,forced:ag},{isSupersetOf:eg})});var Uo=i((eR,Mo)=>{"use strict";var ng=or(),ua=$(),ig=Ue(),ug=vr(),og=sr(),sg=ua.add,vg=ua.has,cg=ua.remove;Mo.exports=function(e){var t=ng(this),a=ug(e).getIterator(),n=ig(t);return og(a,function(u){vg(t,u)?cg(n,u):sg(n,u)}),n}});var ko=i(()=>{"use strict";var fg=R(),lg=Uo(),yg=cr();fg({target:"Set",proto:!0,real:!0,forced:!yg("symmetricDifference")},{symmetricDifference:lg})});var $o=i((nR,Go)=>{"use strict";var pg=or(),dg=$().add,qg=Ue(),hg=vr(),gg=sr();Go.exports=function(e){var t=pg(this),a=hg(e).getIterator(),n=qg(t);return gg(a,function(u){dg(n,u)}),n}});var Vo=i(()=>{"use strict";var Tg=R(),Sg=$o(),Ig=cr();Tg({target:"Set",proto:!0,real:!0,forced:!Ig("union")},{union:Sg})});var Yo=i((oR,Wo)=>{"use strict";Wo.exports={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0}});var Ho=i((sR,zo)=>{"use strict";var xg=Ee(),oa=xg("span").classList,Ko=oa&&oa.constructor&&oa.constructor.prototype;zo.exports=Ko===Object.prototype?void 0:Ko});var Zo=i((vR,Xo)=>{"use strict";var Ag=ra(),Og=je();Xo.exports=Object.keys||function(e){return Ag(e,Og)}});var Qo=i(Jo=>{"use strict";var bg=w(),Eg=Dt(),wg=z(),Rg=D(),mg=Rr(),Pg=Zo();Jo.f=bg&&!Eg?Object.defineProperties:function(e,t){Rg(e);for(var a=mg(t),n=Pg(t),u=n.length,o=0,s;u>o;)wg.f(e,s=n[o++],a[s]);return e}});var es=i((fR,rs)=>{"use strict";var _g=gr();rs.exports=_g("document","documentElement")});var Nr=i((lR,ss)=>{"use strict";var Cg=D(),Ng=Qo(),ts=je(),Fg=_e(),Lg=es(),Bg=Ee(),jg=Pe(),as=">",ns="<",va="prototype",ca="script",us=jg("IE_PROTO"),sa=function(){},os=function(r){return ns+ca+as+r+ns+"/"+ca+as},is=function(r){r.write(os("")),r.close();var e=r.parentWindow.Object;return r=null,e},Dg=function(){var r=Bg("iframe"),e="java"+ca+":",t;return r.style.display="none",Lg.appendChild(r),r.src=String(e),t=r.contentWindow.document,t.open(),t.write(os("document.F=Object")),t.close(),t.F},ke,Ge=function(){try{ke=new ActiveXObject("htmlfile")}catch(e){}Ge=typeof document!="undefined"?document.domain&&ke?is(ke):Dg():is(ke);for(var r=ts.length;r--;)delete Ge[va][ts[r]];return Ge()};Fg[us]=!0;ss.exports=Object.create||function(e,t){var a;return e!==null?(sa[va]=Cg(e),a=new sa,sa[va]=null,a[us]=e):a=Ge(),t===void 0?a:Ng.f(a,t)}});var cs=i((yR,vs)=>{"use strict";var Mg=E(),Ug=Nr(),kg=z().f,fa=Mg("unscopables"),la=Array.prototype;la[fa]===void 0&&kg(la,fa,{configurable:!0,value:Ug(null)});vs.exports=function(r){la[fa][r]=!0}});var Fr=i((pR,fs)=>{"use strict";fs.exports={}});var ys=i((dR,ls)=>{"use strict";var Gg=I();ls.exports=!Gg(function(){function r(){}return r.prototype.constructor=null,Object.getPrototypeOf(new r)!==r.prototype})});var ee=i((qR,ds)=>{"use strict";var $g=j(),Vg=O(),Wg=K(),Yg=Pe(),Kg=ys(),ps=Yg("IE_PROTO"),ya=Object,zg=ya.prototype;ds.exports=Kg?ya.getPrototypeOf:function(r){var e=Wg(r);if($g(e,ps))return e[ps];var t=e.constructor;return Vg(t)&&e instanceof t?t.prototype:e instanceof ya?zg:null}});var ha=i((hR,gs)=>{"use strict";var Hg=I(),Xg=O(),Zg=m(),Jg=Nr(),qs=ee(),Qg=Ir(),rT=E(),eT=Zr(),qa=rT("iterator"),hs=!1,Q,pa,da;[].keys&&(da=[].keys(),"next"in da?(pa=qs(qs(da)),pa!==Object.prototype&&(Q=pa)):hs=!0);var tT=!Zg(Q)||Hg(function(){var r={};return Q[qa].call(r)!==r});tT?Q={}:eT&&(Q=Jg(Q));Xg(Q[qa])||Qg(Q,qa,function(){return this});gs.exports={IteratorPrototype:Q,BUGGY_SAFARI_ITERATORS:hs}});var te=i((gR,Ss)=>{"use strict";var aT=z().f,nT=j(),iT=E(),Ts=iT("toStringTag");Ss.exports=function(r,e,t){r&&!t&&(r=r.prototype),r&&!nT(r,Ts)&&aT(r,Ts,{configurable:!0,value:e})}});var xs=i((TR,Is)=>{"use strict";var uT=ha().IteratorPrototype,oT=Nr(),sT=Kr(),vT=te(),cT=Fr(),fT=function(){return this};Is.exports=function(r,e,t,a){var n=e+" Iterator";return r.prototype=oT(uT,{next:sT(+!a,t)}),vT(r,n,!1,!0),cT[n]=fT,r}});var Os=i((SR,As)=>{"use strict";var lT=m();As.exports=function(r){return lT(r)||r===null}});var Es=i((IR,bs)=>{"use strict";var yT=Os(),pT=String,dT=TypeError;bs.exports=function(r){if(yT(r))return r;throw new dT("Can't set "+pT(r)+" as a prototype")}});var Lr=i((xR,ws)=>{"use strict";var qT=re(),hT=m(),gT=wr(),TT=Es();ws.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var r=!1,e={},t;try{t=qT(Object.prototype,"__proto__","set"),t(e,[]),r=e instanceof Array}catch(a){}return function(n,u){return gT(n),TT(u),hT(n)&&(r?t(n,u):n.__proto__=u),n}}():void 0)});var Ds=i((AR,js)=>{"use strict";var ST=R(),IT=b(),$e=Zr(),Ls=me(),xT=O(),AT=xs(),Rs=ee(),ms=Lr(),OT=te(),bT=J(),ga=Ir(),ET=E(),Ps=Fr(),Bs=ha(),wT=Ls.PROPER,RT=Ls.CONFIGURABLE,_s=Bs.IteratorPrototype,Ve=Bs.BUGGY_SAFARI_ITERATORS,ae=ET("iterator"),Cs="keys",ne="values",Ns="entries",Fs=function(){return this};js.exports=function(r,e,t,a,n,u,o){AT(t,e,a);var s=function(h){if(h===n&&l)return l;if(!Ve&&h&&h in v)return v[h];switch(h){case Cs:return function(){return new t(this,h)};case ne:return function(){return new t(this,h)};case Ns:return function(){return new t(this,h)}}return function(){return new t(this)}},c=e+" Iterator",f=!1,v=r.prototype,y=v[ae]||v["@@iterator"]||n&&v[n],l=!Ve&&y||s(n),d=e==="Array"&&v.entries||y,g,q,p;if(d&&(g=Rs(d.call(new r)),g!==Object.prototype&&g.next&&(!$e&&Rs(g)!==_s&&(ms?ms(g,_s):xT(g[ae])||ga(g,ae,Fs)),OT(g,c,!0,!0),$e&&(Ps[c]=Fs))),wT&&n===ne&&y&&y.name!==ne&&(!$e&&RT?bT(v,"name",ne):(f=!0,l=function(){return IT(y,this)})),n)if(q={values:s(ne),keys:u?l:s(Cs),entries:s(Ns)},o)for(p in q)(Ve||f||!(p in v))&&ga(v,p,q[p]);else ST({target:e,proto:!0,forced:Ve||f},q);return(!$e||o)&&v[ae]!==l&&ga(v,ae,l,{name:n}),Ps[e]=l,q}});var Us=i((OR,Ms)=>{"use strict";Ms.exports=function(r,e){return{value:r,done:e}}});var Ys=i((bR,Ws)=>{"use strict";var mT=Rr(),Ta=cs(),ks=Fr(),$s=Sr(),PT=z().f,_T=Ds(),We=Us(),CT=Zr(),NT=w(),Vs="Array Iterator",FT=$s.set,LT=$s.getterFor(Vs);Ws.exports=_T(Array,"Array",function(r,e){FT(this,{type:Vs,target:mT(r),index:0,kind:e})},function(){var r=LT(this),e=r.target,t=r.index++;if(!e||t>=e.length)return r.target=null,We(void 0,!0);switch(r.kind){case"keys":return We(t,!1);case"values":return We(e[t],!1)}return We([t,e[t]],!1)},"values");var Gs=ks.Arguments=ks.Array;Ta("keys");Ta("values");Ta("entries");if(!CT&&NT&&Gs.name!=="values")try{PT(Gs,"name",{value:"values"})}catch(r){}});var Zs=i(()=>{"use strict";var Ks=T(),Hs=Yo(),BT=Ho(),ie=Ys(),zs=J(),jT=te(),DT=E(),Sa=DT("iterator"),Ia=ie.values,Xs=function(r,e){if(r){if(r[Sa]!==Ia)try{zs(r,Sa,Ia)}catch(a){r[Sa]=Ia}if(jT(r,e,!0),Hs[e]){for(var t in ie)if(r[t]!==ie[t])try{zs(r,t,ie[t])}catch(a){r[t]=ie[t]}}}};for(Ye in Hs)Xs(Ks[Ye]&&Ks[Ye].prototype,Ye);var Ye;Xs(BT,"DOMTokenList")});var tv=i((RR,ev)=>{"use strict";var MT=E(),Qs=MT("iterator"),rv=!1;try{Js=0,xa={next:function(){return{done:!!Js++}},return:function(){rv=!0}},xa[Qs]=function(){return this},Array.from(xa,function(){throw 2})}catch(r){}var Js,xa;ev.exports=function(r,e){try{if(!e&&!rv)return!1}catch(n){return!1}var t=!1;try{var a={};a[Qs]=function(){return{next:function(){return{done:t=!0}}}},r(a)}catch(n){}return t}});var Ke=i((mR,av)=>{"use strict";av.exports=typeof ArrayBuffer!="undefined"&&typeof DataView!="undefined"});var uv=i((PR,iv)=>{"use strict";var UT=E(),kT=UT("toStringTag"),nv={};nv[kT]="z";iv.exports=String(nv)==="[object z]"});var fr=i((_R,ov)=>{"use strict";var GT=uv(),$T=O(),ze=ir(),VT=E(),WT=VT("toStringTag"),YT=Object,KT=ze(function(){return arguments}())==="Arguments",zT=function(r,e){try{return r[e]}catch(t){}};ov.exports=GT?ze:function(r){var e,t,a;return r===void 0?"Undefined":r===null?"Null":typeof(t=zT(e=YT(r),WT))=="string"?t:KT?ze(e):(a=ze(e))==="Object"&&$T(e.callee)?"Arguments":a}});var Br=i((CR,vv)=>{"use strict";var sv=Jt(),HT=z();vv.exports=function(r,e,t){return t.get&&sv(t.get,e,{getter:!0}),t.set&&sv(t.set,e,{setter:!0}),HT.f(r,e,t)}});var N=i((NR,Tv)=>{"use strict";var XT=Ke(),Ea=w(),P=T(),yv=O(),Ze=m(),yr=j(),wa=fr(),ZT=Hr(),JT=J(),Aa=Ir(),QT=Br(),rS=zr(),Je=ee(),Dr=Lr(),eS=E(),tS=Oe(),pv=Sr(),dv=pv.enforce,aS=pv.get,He=P.Int8Array,Oa=He&&He.prototype,cv=P.Uint8ClampedArray,fv=cv&&cv.prototype,H=He&&Je(He),V=Oa&&Je(Oa),nS=Object.prototype,Ra=P.TypeError,lv=eS("toStringTag"),ba=tS("TYPED_ARRAY_TAG"),Xe="TypedArrayConstructor",rr=XT&&!!Dr&&wa(P.opera)!=="Opera",qv=!1,C,lr,jr,er={Int8Array:1,Uint8Array:1,Uint8ClampedArray:1,Int16Array:2,Uint16Array:2,Int32Array:4,Uint32Array:4,Float32Array:4,Float64Array:8},ma={BigInt64Array:8,BigUint64Array:8},iS=function(e){if(!Ze(e))return!1;var t=wa(e);return t==="DataView"||yr(er,t)||yr(ma,t)},hv=function(r){var e=Je(r);if(Ze(e)){var t=aS(e);return t&&yr(t,Xe)?t[Xe]:hv(e)}},gv=function(r){if(!Ze(r))return!1;var e=wa(r);return yr(er,e)||yr(ma,e)},uS=function(r){if(gv(r))return r;throw new Ra("Target is not a typed array")},oS=function(r){if(yv(r)&&(!Dr||rS(H,r)))return r;throw new Ra(ZT(r)+" is not a typed array constructor")},sS=function(r,e,t,a){if(Ea){if(t)for(var n in er){var u=P[n];if(u&&yr(u.prototype,r))try{delete u.prototype[r]}catch(o){try{u.prototype[r]=e}catch(s){}}}(!V[r]||t)&&Aa(V,r,t?e:rr&&Oa[r]||e,a)}},vS=function(r,e,t){var a,n;if(Ea){if(Dr){if(t){for(a in er)if(n=P[a],n&&yr(n,r))try{delete n[r]}catch(u){}}if(!H[r]||t)try{return Aa(H,r,t?e:rr&&H[r]||e)}catch(u){}else return}for(a in er)n=P[a],n&&(!n[r]||t)&&Aa(n,r,e)}};for(C in er)lr=P[C],jr=lr&&lr.prototype,jr?dv(jr)[Xe]=lr:rr=!1;for(C in ma)lr=P[C],jr=lr&&lr.prototype,jr&&(dv(jr)[Xe]=lr);if((!rr||!yv(H)||H===Function.prototype)&&(H=function(){throw new Ra("Incorrect invocation")},rr))for(C in er)P[C]&&Dr(P[C],H);if((!rr||!V||V===nS)&&(V=H.prototype,rr))for(C in er)P[C]&&Dr(P[C].prototype,V);rr&&Je(fv)!==V&&Dr(fv,V);if(Ea&&!yr(V,lv)){qv=!0,QT(V,lv,{configurable:!0,get:function(){return Ze(this)?this[ba]:void 0}});for(C in er)P[C]&&JT(P[C],ba,C)}Tv.exports={NATIVE_ARRAY_BUFFER_VIEWS:rr,TYPED_ARRAY_TAG:qv&&ba,aTypedArray:uS,aTypedArrayConstructor:oS,exportTypedArrayMethod:sS,exportTypedArrayStaticMethod:vS,getTypedArrayConstructor:hv,isView:iS,isTypedArray:gv,TypedArray:H,TypedArrayPrototype:V}});var _a=i((FR,Iv)=>{"use strict";var Sv=T(),Pa=I(),cS=tv(),fS=N().NATIVE_ARRAY_BUFFER_VIEWS,lS=Sv.ArrayBuffer,Ar=Sv.Int8Array;Iv.exports=!fS||!Pa(function(){Ar(1)})||!Pa(function(){new Ar(-1)})||!cS(function(r){new Ar,new Ar(null),new Ar(1.5),new Ar(r)},!0)||Pa(function(){return new Ar(new lS(2),1,void 0).length!==1})});var Av=i((LR,xv)=>{"use strict";var yS=Ir();xv.exports=function(r,e,t){for(var a in e)yS(r,a,e[a],t);return r}});var Ca=i((BR,Ov)=>{"use strict";var pS=zr(),dS=TypeError;Ov.exports=function(r,e){if(pS(e,r))return r;throw new dS("Incorrect invocation")}});var Qe=i((jR,bv)=>{"use strict";var qS=M(),hS=xr(),gS=RangeError;bv.exports=function(r){if(r===void 0)return 0;var e=qS(r),t=hS(e);if(e!==t)throw new gS("Wrong length or index");return t}});var wv=i((DR,Ev)=>{"use strict";Ev.exports=Math.sign||function(e){var t=+e;return t===0||t!==t?t:t<0?-1:1}});var Pv=i((MR,mv)=>{"use strict";var TS=2220446049250313e-31,Rv=1/TS;mv.exports=function(r){return r+Rv-Rv}});var Cv=i((UR,_v)=>{"use strict";var SS=wv(),IS=Pv(),xS=Math.abs,AS=2220446049250313e-31;_v.exports=function(r,e,t,a){var n=+r,u=xS(n),o=SS(n);if(u<a)return o*IS(u/a/e)*a*e;var s=(1+e/AS)*u,c=s-(s-u);return c>t||c!==c?o*(1/0):o*c}});var Fv=i((kR,Nv)=>{"use strict";var OS=Cv(),bS=11920928955078125e-23,ES=34028234663852886e22,wS=11754943508222875e-54;Nv.exports=Math.fround||function(e){return OS(e,bS,ES,wS)}});var Bv=i((GR,Lv)=>{"use strict";var RS=Array,mS=Math.abs,tr=Math.pow,PS=Math.floor,_S=Math.log,CS=Math.LN2,NS=function(r,e,t){var a=RS(t),n=t*8-e-1,u=(1<<n)-1,o=u>>1,s=e===23?tr(2,-24)-tr(2,-77):0,c=r<0||r===0&&1/r<0?1:0,f=0,v,y,l;for(r=mS(r),r!==r||r===1/0?(y=r!==r?1:0,v=u):(v=PS(_S(r)/CS),l=tr(2,-v),r*l<1&&(v--,l*=2),v+o>=1?r+=s/l:r+=s*tr(2,1-o),r*l>=2&&(v++,l/=2),v+o>=u?(y=0,v=u):v+o>=1?(y=(r*l-1)*tr(2,e),v+=o):(y=r*tr(2,o-1)*tr(2,e),v=0));e>=8;)a[f++]=y&255,y/=256,e-=8;for(v=v<<e|y,n+=e;n>0;)a[f++]=v&255,v/=256,n-=8;return a[f-1]|=c*128,a},FS=function(r,e){var t=r.length,a=t*8-e-1,n=(1<<a)-1,u=n>>1,o=a-7,s=t-1,c=r[s--],f=c&127,v;for(c>>=7;o>0;)f=f*256+r[s--],o-=8;for(v=f&(1<<-o)-1,f>>=-o,o+=e;o>0;)v=v*256+r[s--],o-=8;if(f===0)f=1-u;else{if(f===n)return v?NaN:c?-1/0:1/0;v+=tr(2,e),f-=u}return(c?-1:1)*v*tr(2,f-e)};Lv.exports={pack:NS,unpack:FS}});var Na=i(($R,Dv)=>{"use strict";var LS=K(),jv=Be(),BS=U();Dv.exports=function(e){for(var t=LS(this),a=BS(t),n=arguments.length,u=jv(n>1?arguments[1]:void 0,a),o=n>2?arguments[2]:void 0,s=o===void 0?a:jv(o,a);s>u;)t[u++]=e;return t}});var Fa=i((VR,Mv)=>{"use strict";var jS=A();Mv.exports=jS([].slice)});var La=i((WR,kv)=>{"use strict";var DS=O(),MS=m(),Uv=Lr();kv.exports=function(r,e,t){var a,n;return Uv&&DS(a=e.constructor)&&a!==t&&MS(n=a.prototype)&&n!==t.prototype&&Uv(r,n),r}});var ut=i((YR,nc)=>{"use strict";var nt=T(),Ua=A(),Ba=w(),US=Ke(),Qv=me(),kS=J(),GS=Br(),Gv=Av(),ja=I(),rt=Ca(),$S=M(),VS=xr(),tt=Qe(),WS=Fv(),rc=Bv(),YS=ee(),$v=Lr(),KS=Na(),zS=Fa(),HS=La(),XS=ta(),ec=te(),ka=Sr(),ZS=Qv.PROPER,Vv=Qv.CONFIGURABLE,Ur="ArrayBuffer",it="DataView",kr="prototype",JS="Wrong length",tc="Wrong index",Wv=ka.getterFor(Ur),oe=ka.getterFor(it),Yv=ka.set,W=nt[Ur],F=W,Mr=F&&F[kr],X=nt[it],Or=X&&X[kr],Kv=Object.prototype,QS=nt.Array,at=nt.RangeError,rI=Ua(KS),eI=Ua([].reverse),ac=rc.pack,zv=rc.unpack,Hv=function(r){return[r&255]},Xv=function(r){return[r&255,r>>8&255]},Zv=function(r){return[r&255,r>>8&255,r>>16&255,r>>24&255]},Jv=function(r){return r[3]<<24|r[2]<<16|r[1]<<8|r[0]},tI=function(r){return ac(WS(r),23,4)},aI=function(r){return ac(r,52,8)},et=function(r,e,t){GS(r[kr],e,{configurable:!0,get:function(){return t(this)[e]}})},pr=function(r,e,t,a){var n=oe(r),u=tt(t),o=!!a;if(u+e>n.byteLength)throw new at(tc);var s=n.bytes,c=u+n.byteOffset,f=zS(s,c,c+e);return o?f:eI(f)},dr=function(r,e,t,a,n,u){var o=oe(r),s=tt(t),c=a(+n),f=!!u;if(s+e>o.byteLength)throw new at(tc);for(var v=o.bytes,y=s+o.byteOffset,l=0;l<e;l++)v[y+l]=c[f?l:e-l-1]};US?(Da=ZS&&W.name!==Ur,!ja(function(){W(1)})||!ja(function(){new W(-1)})||ja(function(){return new W,new W(1.5),new W(NaN),W.length!==1||Da&&!Vv})?(F=function(e){return rt(this,Mr),HS(new W(tt(e)),this,F)},F[kr]=Mr,Mr.constructor=F,XS(F,W)):Da&&Vv&&kS(W,"name",Ur),$v&&YS(Or)!==Kv&&$v(Or,Kv),ue=new X(new F(2)),Ma=Ua(Or.setInt8),ue.setInt8(0,2147483648),ue.setInt8(1,2147483649),(ue.getInt8(0)||!ue.getInt8(1))&&Gv(Or,{setInt8:function(e,t){Ma(this,e,t<<24>>24)},setUint8:function(e,t){Ma(this,e,t<<24>>24)}},{unsafe:!0})):(F=function(e){rt(this,Mr);var t=tt(e);Yv(this,{type:Ur,bytes:rI(QS(t),0),byteLength:t}),Ba||(this.byteLength=t,this.detached=!1)},Mr=F[kr],X=function(e,t,a){rt(this,Or),rt(e,Mr);var n=Wv(e),u=n.byteLength,o=$S(t);if(o<0||o>u)throw new at("Wrong offset");if(a=a===void 0?u-o:VS(a),o+a>u)throw new at(JS);Yv(this,{type:it,buffer:e,byteLength:a,byteOffset:o,bytes:n.bytes}),Ba||(this.buffer=e,this.byteLength=a,this.byteOffset=o)},Or=X[kr],Ba&&(et(F,"byteLength",Wv),et(X,"buffer",oe),et(X,"byteLength",oe),et(X,"byteOffset",oe)),Gv(Or,{getInt8:function(e){return pr(this,1,e)[0]<<24>>24},getUint8:function(e){return pr(this,1,e)[0]},getInt16:function(e){var t=pr(this,2,e,arguments.length>1?arguments[1]:!1);return(t[1]<<8|t[0])<<16>>16},getUint16:function(e){var t=pr(this,2,e,arguments.length>1?arguments[1]:!1);return t[1]<<8|t[0]},getInt32:function(e){return Jv(pr(this,4,e,arguments.length>1?arguments[1]:!1))},getUint32:function(e){return Jv(pr(this,4,e,arguments.length>1?arguments[1]:!1))>>>0},getFloat32:function(e){return zv(pr(this,4,e,arguments.length>1?arguments[1]:!1),23)},getFloat64:function(e){return zv(pr(this,8,e,arguments.length>1?arguments[1]:!1),52)},setInt8:function(e,t){dr(this,1,e,Hv,t)},setUint8:function(e,t){dr(this,1,e,Hv,t)},setInt16:function(e,t){dr(this,2,e,Xv,t,arguments.length>2?arguments[2]:!1)},setUint16:function(e,t){dr(this,2,e,Xv,t,arguments.length>2?arguments[2]:!1)},setInt32:function(e,t){dr(this,4,e,Zv,t,arguments.length>2?arguments[2]:!1)},setUint32:function(e,t){dr(this,4,e,Zv,t,arguments.length>2?arguments[2]:!1)},setFloat32:function(e,t){dr(this,4,e,tI,t,arguments.length>2?arguments[2]:!1)},setFloat64:function(e,t){dr(this,8,e,aI,t,arguments.length>2?arguments[2]:!1)}}));var Da,ue,Ma;ec(F,Ur);ec(X,it);nc.exports={ArrayBuffer:F,DataView:X}});var uc=i((KR,ic)=>{"use strict";var nI=m(),iI=Math.floor;ic.exports=Number.isInteger||function(e){return!nI(e)&&isFinite(e)&&iI(e)===e}});var sc=i((zR,oc)=>{"use strict";var uI=M(),oI=RangeError;oc.exports=function(r){var e=uI(r);if(e<0)throw new oI("The argument can't be less than 0");return e}});var Ga=i((HR,vc)=>{"use strict";var sI=sc(),vI=RangeError;vc.exports=function(r,e){var t=sI(r);if(t%e)throw new vI("Wrong offset");return t}});var fc=i((XR,cc)=>{"use strict";var cI=Math.round;cc.exports=function(r){var e=cI(r);return e<0?0:e>255?255:e&255}});var ot=i((ZR,lc)=>{"use strict";var fI=ir(),lI=A();lc.exports=function(r){if(fI(r)==="Function")return lI(r)}});var st=i((JR,pc)=>{"use strict";var yc=ot(),yI=ur(),pI=Yr(),dI=yc(yc.bind);pc.exports=function(r,e){return yI(r),e===void 0?r:pI?dI(r,e):function(){return r.apply(e,arguments)}}});var Va=i((QR,Tc)=>{"use strict";var qI=A(),hI=I(),dc=O(),gI=fr(),TI=gr(),SI=Yt(),qc=function(){},hc=TI("Reflect","construct"),$a=/^\\s*(?:class|function)\\b/,II=qI($a.exec),xI=!$a.test(qc),se=function(e){if(!dc(e))return!1;try{return hc(qc,[],e),!0}catch(t){return!1}},gc=function(e){if(!dc(e))return!1;switch(gI(e)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return xI||!!II($a,SI(e))}catch(t){return!0}};gc.sham=!0;Tc.exports=!hc||hI(function(){var r;return se(se.call)||!se(Object)||!se(function(){r=!0})||r})?gc:se});var Ic=i((rm,Sc)=>{"use strict";var AI=Va(),OI=Hr(),bI=TypeError;Sc.exports=function(r){if(AI(r))return r;throw new bI(OI(r)+" is not a constructor")}});var Wa=i((em,Ac)=>{"use strict";var EI=fr(),xc=Xr(),wI=he(),RI=Fr(),mI=E(),PI=mI("iterator");Ac.exports=function(r){if(!wI(r))return xc(r,PI)||xc(r,"@@iterator")||RI[EI(r)]}});var bc=i((tm,Oc)=>{"use strict";var _I=b(),CI=ur(),NI=D(),FI=Hr(),LI=Wa(),BI=TypeError;Oc.exports=function(r,e){var t=arguments.length<2?LI(r):e;if(CI(t))return NI(_I(t,r));throw new BI(FI(r)+" is not iterable")}});var wc=i((am,Ec)=>{"use strict";var jI=E(),DI=Fr(),MI=jI("iterator"),UI=Array.prototype;Ec.exports=function(r){return r!==void 0&&(DI.Array===r||UI[MI]===r)}});var Ya=i((nm,Rc)=>{"use strict";var kI=fr();Rc.exports=function(r){var e=kI(r);return e==="BigInt64Array"||e==="BigUint64Array"}});var vt=i((im,mc)=>{"use strict";var GI=Lt(),$I=TypeError;mc.exports=function(r){var e=GI(r,"number");if(typeof e=="number")throw new $I("Can't convert number to bigint");return BigInt(e)}});var Ka=i((um,Pc)=>{"use strict";var VI=st(),WI=b(),YI=Ic(),KI=K(),zI=U(),HI=bc(),XI=Wa(),ZI=wc(),JI=Ya(),QI=N().aTypedArrayConstructor,rx=vt();Pc.exports=function(e){var t=YI(this),a=KI(e),n=arguments.length,u=n>1?arguments[1]:void 0,o=u!==void 0,s=XI(a),c,f,v,y,l,d,g,q;if(s&&!ZI(s))for(g=HI(a,s),q=g.next,a=[];!(d=WI(q,g)).done;)a.push(d.value);for(o&&n>2&&(u=VI(u,arguments[2])),f=zI(a),v=new(QI(t))(f),y=JI(v),c=0;f>c;c++)l=o?u(a[c],c):a[c],v[c]=y?rx(l):+l;return v}});var za=i((om,_c)=>{"use strict";var ex=ir();_c.exports=Array.isArray||function(e){return ex(e)==="Array"}});var Lc=i((sm,Fc)=>{"use strict";var Cc=za(),tx=Va(),ax=m(),nx=E(),ix=nx("species"),Nc=Array;Fc.exports=function(r){var e;return Cc(r)&&(e=r.constructor,tx(e)&&(e===Nc||Cc(e.prototype))?e=void 0:ax(e)&&(e=e[ix],e===null&&(e=void 0))),e===void 0?Nc:e}});var jc=i((vm,Bc)=>{"use strict";var ux=Lc();Bc.exports=function(r,e){return new(ux(r))(e===0?0:e)}});var Uc=i((cm,Mc)=>{"use strict";var ox=st(),sx=A(),vx=qe(),cx=K(),fx=U(),lx=jc(),Dc=sx([].push),qr=function(r){var e=r===1,t=r===2,a=r===3,n=r===4,u=r===6,o=r===7,s=r===5||u;return function(c,f,v,y){for(var l=cx(c),d=vx(l),g=fx(d),q=ox(f,v),p=0,h=y||lx,x=e?h(c,g):t||o?h(c,0):void 0,_,L;g>p;p++)if((s||p in d)&&(_=d[p],L=q(_,p,l),r))if(e)x[p]=L;else if(L)switch(r){case 3:return!0;case 5:return _;case 6:return p;case 2:Dc(x,_)}else switch(r){case 4:return!1;case 7:Dc(x,_)}return u?-1:a||n?n:x}};Mc.exports={forEach:qr(0),map:qr(1),filter:qr(2),some:qr(3),every:qr(4),find:qr(5),findIndex:qr(6),filterReject:qr(7)}});var Ha=i((fm,Gc)=>{"use strict";var yx=gr(),px=Br(),dx=E(),qx=w(),kc=dx("species");Gc.exports=function(r){var e=yx(r);qx&&e&&!e[kc]&&px(e,kc,{configurable:!0,get:function(){return this}})}});var Xa=i((lm,$c)=>{"use strict";var hx=U();$c.exports=function(r,e,t){for(var a=0,n=arguments.length>2?t:hx(e),u=new r(n);n>a;)u[a]=e[a++];return u}});var cf=i((ym,an)=>{"use strict";var Vc=R(),ef=T(),Wc=b(),gx=w(),Tx=_a(),le=N(),tf=ut(),Yc=Ca(),Sx=Kr(),ve=J(),Ix=uc(),xx=xr(),Kc=Qe(),Za=Ga(),Ax=fc(),af=be(),ce=j(),Ox=fr(),rn=m(),bx=Se(),Ex=Nr(),wx=zr(),ct=Lr(),Rx=ea().f,zc=Ka(),mx=Uc().forEach,Px=Ha(),_x=Br(),nf=z(),uf=we(),Hc=Xa(),nn=Sr(),Cx=La(),en=nn.get,Nx=nn.set,Fx=nn.enforce,of=nf.f,Lx=uf.f,Ja=ef.RangeError,sf=tf.ArrayBuffer,Bx=sf.prototype,jx=tf.DataView,ft=le.NATIVE_ARRAY_BUFFER_VIEWS,Xc=le.TYPED_ARRAY_TAG,Zc=le.TypedArray,fe=le.TypedArrayPrototype,tn=le.isTypedArray,lt="BYTES_PER_ELEMENT",Qa="Wrong length",yt=function(r,e){_x(r,e,{configurable:!0,get:function(){return en(this)[e]}})},Jc=function(r){var e;return wx(Bx,r)||(e=Ox(r))==="ArrayBuffer"||e==="SharedArrayBuffer"},vf=function(r,e){return tn(r)&&!bx(e)&&e in r&&Ix(+e)&&e>=0},Qc=function(e,t){return t=af(t),vf(e,t)?Sx(2,e[t]):Lx(e,t)},rf=function(e,t,a){return t=af(t),vf(e,t)&&rn(a)&&ce(a,"value")&&!ce(a,"get")&&!ce(a,"set")&&!a.configurable&&(!ce(a,"writable")||a.writable)&&(!ce(a,"enumerable")||a.enumerable)?(e[t]=a.value,e):of(e,t,a)};gx?(ft||(uf.f=Qc,nf.f=rf,yt(fe,"buffer"),yt(fe,"byteOffset"),yt(fe,"byteLength"),yt(fe,"length")),Vc({target:"Object",stat:!0,forced:!ft},{getOwnPropertyDescriptor:Qc,defineProperty:rf}),an.exports=function(r,e,t){var a=r.match(/\\d+/)[0]/8,n=r+(t?"Clamped":"")+"Array",u="get"+r,o="set"+r,s=ef[n],c=s,f=c&&c.prototype,v={},y=function(q,p){var h=en(q);return h.view[u](p*a+h.byteOffset,!0)},l=function(q,p,h){var x=en(q);x.view[o](p*a+x.byteOffset,t?Ax(h):h,!0)},d=function(q,p){of(q,p,{get:function(){return y(this,p)},set:function(h){return l(this,p,h)},enumerable:!0})};ft?Tx&&(c=e(function(q,p,h,x){return Yc(q,f),Cx(function(){return rn(p)?Jc(p)?x!==void 0?new s(p,Za(h,a),x):h!==void 0?new s(p,Za(h,a)):new s(p):tn(p)?Hc(c,p):Wc(zc,c,p):new s(Kc(p))}(),q,c)}),ct&&ct(c,Zc),mx(Rx(s),function(q){q in c||ve(c,q,s[q])}),c.prototype=f):(c=e(function(q,p,h,x){Yc(q,f);var _=0,L=0,nr,B,Z;if(!rn(p))Z=Kc(p),B=Z*a,nr=new sf(B);else if(Jc(p)){nr=p,L=Za(h,a);var Er=p.byteLength;if(x===void 0){if(Er%a)throw new Ja(Qa);if(B=Er-L,B<0)throw new Ja(Qa)}else if(B=xx(x)*a,B+L>Er)throw new Ja(Qa);Z=B/a}else return tn(p)?Hc(c,p):Wc(zc,c,p);for(Nx(q,{buffer:nr,byteOffset:L,byteLength:B,length:Z,view:new jx(nr)});_<Z;)d(q,_++)}),ct&&ct(c,Zc),f=c.prototype=Ex(fe)),f.constructor!==c&&ve(f,"constructor",c),Fx(f).TypedArrayConstructor=c,Xc&&ve(f,Xc,n);var g=c!==s;v[n]=c,Vc({global:!0,constructor:!0,forced:g,sham:!ft},v),lt in c||ve(c,lt,a),lt in f||ve(f,lt,a),Px(n)}):an.exports=function(){}});var ff=i(()=>{"use strict";var Dx=cf();Dx("Uint8",function(r){return function(t,a,n){return r(this,t,a,n)}})});var yf=i(()=>{"use strict";var lf=N(),Mx=U(),Ux=M(),kx=lf.aTypedArray,Gx=lf.exportTypedArrayMethod;Gx("at",function(e){var t=kx(this),a=Mx(t),n=Ux(e),u=n>=0?n:a+n;return u<0||u>=a?void 0:t[u]})});var df=i(()=>{"use strict";var pf=N(),$x=Na(),Vx=vt(),Wx=fr(),Yx=b(),Kx=A(),zx=I(),Hx=pf.aTypedArray,Xx=pf.exportTypedArrayMethod,Zx=Kx("".slice),Jx=zx(function(){var r=0;return new Int8Array(2).fill({valueOf:function(){return r++}}),r!==1});Xx("fill",function(e){var t=arguments.length;Hx(this);var a=Zx(Wx(this),0,3)==="Big"?Vx(e):+e;return Yx($x,this,a,t>1?arguments[1]:void 0,t>2?arguments[2]:void 0)},Jx)});var un=i((Sm,hf)=>{"use strict";var Qx=st(),rA=qe(),eA=K(),tA=U(),qf=function(r){var e=r===1;return function(t,a,n){for(var u=eA(t),o=rA(u),s=tA(o),c=Qx(a,n),f,v;s-- >0;)if(f=o[s],v=c(f,s,u),v)switch(r){case 0:return f;case 1:return s}return e?-1:void 0}};hf.exports={findLast:qf(0),findLastIndex:qf(1)}});var Tf=i(()=>{"use strict";var gf=N(),aA=un().findLast,nA=gf.aTypedArray,iA=gf.exportTypedArrayMethod;iA("findLast",function(e){return aA(nA(this),e,arguments.length>1?arguments[1]:void 0)})});var If=i(()=>{"use strict";var Sf=N(),uA=un().findLastIndex,oA=Sf.aTypedArray,sA=Sf.exportTypedArrayMethod;sA("findLastIndex",function(e){return uA(oA(this),e,arguments.length>1?arguments[1]:void 0)})});var wf=i(()=>{"use strict";var Af=T(),Of=b(),vn=N(),vA=U(),cA=Ga(),fA=K(),bf=I(),lA=Af.RangeError,on=Af.Int8Array,xf=on&&on.prototype,Ef=xf&&xf.set,yA=vn.aTypedArray,pA=vn.exportTypedArrayMethod,sn=!bf(function(){var r=new Uint8ClampedArray(2);return Of(Ef,r,{length:1,0:3},1),r[1]!==3}),dA=sn&&vn.NATIVE_ARRAY_BUFFER_VIEWS&&bf(function(){var r=new on(2);return r.set(1),r.set("2",1),r[0]!==0||r[1]!==2});pA("set",function(e){yA(this);var t=cA(arguments.length>1?arguments[1]:void 0,1),a=fA(e);if(sn)return Of(Ef,this,a,t);var n=this.length,u=vA(a),o=0;if(u+t>n)throw new lA("Wrong length");for(;o<u;)this[t+o]=a[o++]},!sn||dA)});var Pf=i((wm,mf)=>{"use strict";var Rf=Fa(),qA=Math.floor,cn=function(r,e){var t=r.length;if(t<8)for(var a=1,n,u;a<t;){for(u=a,n=r[a];u&&e(r[u-1],n)>0;)r[u]=r[--u];u!==a++&&(r[u]=n)}else for(var o=qA(t/2),s=cn(Rf(r,0,o),e),c=cn(Rf(r,o),e),f=s.length,v=c.length,y=0,l=0;y<f||l<v;)r[y+l]=y<f&&l<v?e(s[y],c[l])<=0?s[y++]:c[l++]:y<f?s[y++]:c[l++];return r};mf.exports=cn});var Nf=i((Rm,Cf)=>{"use strict";var hA=mr(),_f=hA.match(/firefox\\/(\\d+)/i);Cf.exports=!!_f&&+_f[1]});var Lf=i((mm,Ff)=>{"use strict";var gA=mr();Ff.exports=/MSIE|Trident/.test(gA)});var Df=i((Pm,jf)=>{"use strict";var TA=mr(),Bf=TA.match(/AppleWebKit\\/(\\d+)\\./);jf.exports=!!Bf&&+Bf[1]});var Vf=i(()=>{"use strict";var SA=T(),IA=ot(),fn=I(),xA=ur(),AA=Pf(),$f=N(),Mf=Nf(),OA=Lf(),Uf=Te(),kf=Df(),bA=$f.aTypedArray,EA=$f.exportTypedArrayMethod,ye=SA.Uint16Array,Gr=ye&&IA(ye.prototype.sort),wA=!!Gr&&!(fn(function(){Gr(new ye(2),null)})&&fn(function(){Gr(new ye(2),{})})),Gf=!!Gr&&!fn(function(){if(Uf)return Uf<74;if(Mf)return Mf<67;if(OA)return!0;if(kf)return kf<602;var r=new ye(516),e=Array(516),t,a;for(t=0;t<516;t++)a=t%4,r[t]=515-t,e[t]=t-2*a+3;for(Gr(r,function(n,u){return(n/4|0)-(u/4|0)}),t=0;t<516;t++)if(r[t]!==e[t])return!0}),RA=function(r){return function(e,t){return r!==void 0?+r(e,t)||0:t!==t?-1:e!==e?1:e===0&&t===0?1/e>0&&1/t<0?1:-1:e>t}};EA("sort",function(e){return e!==void 0&&xA(e),Gf?Gr(this,e):AA(bA(this),RA(e))},!Gf||wA)});var Yf=i((Nm,Wf)=>{"use strict";var mA=U();Wf.exports=function(r,e){for(var t=mA(r),a=new e(t),n=0;n<t;n++)a[n]=r[t-n-1];return a}});var Kf=i(()=>{"use strict";var PA=Yf(),ln=N(),_A=ln.aTypedArray,CA=ln.exportTypedArrayMethod,NA=ln.getTypedArrayConstructor;CA("toReversed",function(){return PA(_A(this),NA(this))})});var zf=i(()=>{"use strict";var pt=N(),FA=A(),LA=ur(),BA=Xa(),jA=pt.aTypedArray,DA=pt.getTypedArrayConstructor,MA=pt.exportTypedArrayMethod,UA=FA(pt.TypedArrayPrototype.sort);MA("toSorted",function(e){e!==void 0&&LA(e);var t=jA(this),a=BA(DA(t),t);return UA(a,e)})});var Xf=i((Dm,Hf)=>{"use strict";var kA=U(),GA=M(),$A=RangeError;Hf.exports=function(r,e,t,a){var n=kA(r),u=GA(t),o=u<0?n+u:u;if(o>=n||o<0)throw new $A("Incorrect index");for(var s=new e(n),c=0;c<n;c++)s[c]=c===o?a:r[c];return s}});var Zf=i(()=>{"use strict";var VA=Xf(),yn=N(),WA=Ya(),YA=M(),KA=vt(),zA=yn.aTypedArray,HA=yn.getTypedArrayConstructor,XA=yn.exportTypedArrayMethod,ZA=!!function(){try{new Int8Array(1).with(2,{valueOf:function(){throw 8}})}catch(r){return r===8}}();XA("with",function(r,e){var t=zA(this),a=YA(r),n=WA(t)?KA(e):+e;return VA(t,HA(t),a,n)},!ZA)});var Qf=i(()=>{"use strict";var JA=R(),QA=T(),rO=ut(),eO=Ha(),pn="ArrayBuffer",Jf=rO[pn],tO=QA[pn];JA({global:!0,constructor:!0,forced:tO!==Jf},{ArrayBuffer:Jf});eO(pn)});var il=i(()=>{"use strict";var aO=R(),qn=ot(),nO=I(),al=ut(),rl=D(),el=Be(),iO=xr(),hn=al.ArrayBuffer,dn=al.DataView,nl=dn.prototype,tl=qn(hn.prototype.slice),uO=qn(nl.getUint8),oO=qn(nl.setUint8),sO=nO(function(){return!new hn(2).slice(1,void 0).byteLength});aO({target:"ArrayBuffer",proto:!0,unsafe:!0,forced:sO},{slice:function(e,t){if(tl&&t===void 0)return tl(rl(this),e);for(var a=rl(this).byteLength,n=el(e,a),u=el(t===void 0?a:t,a),o=new hn(iO(u-n)),s=new dn(this),c=new dn(o),f=0;n<u;)oO(c,f++,uO(s,n++));return o}})});var gn=i((Wm,sl)=>{"use strict";var ol=T(),vO=re(),cO=ir(),ul=ol.ArrayBuffer,fO=ol.TypeError;sl.exports=ul&&vO(ul.prototype,"byteLength","get")||function(r){if(cO(r)!=="ArrayBuffer")throw new fO("ArrayBuffer expected");return r.byteLength}});var Tn=i((Ym,vl)=>{"use strict";var lO=T(),yO=Ke(),pO=gn(),dO=lO.DataView;vl.exports=function(r){if(!yO||pO(r)!==0)return!1;try{return new dO(r),!1}catch(e){return!0}}});var fl=i(()=>{"use strict";var qO=w(),hO=Br(),gO=Tn(),cl=ArrayBuffer.prototype;qO&&!("detached"in cl)&&hO(cl,"detached",{configurable:!0,get:function(){return gO(this)}})});var yl=i((Hm,ll)=>{"use strict";var TO=Tn(),SO=TypeError;ll.exports=function(r){if(TO(r))throw new SO("ArrayBuffer is detached");return r}});var Sn=i((Xm,pl)=>{"use strict";var pe=T(),IO=mr(),xO=ir(),dt=function(r){return IO.slice(0,r.length)===r};pl.exports=function(){return dt("Bun/")?"BUN":dt("Cloudflare-Workers")?"CLOUDFLARE":dt("Deno/")?"DENO":dt("Node.js/")?"NODE":pe.Bun&&typeof Bun.version=="string"?"BUN":pe.Deno&&typeof Deno.version=="object"?"DENO":xO(pe.process)==="process"?"NODE":pe.window&&pe.document?"BROWSER":"REST"}()});var ql=i((Zm,dl)=>{"use strict";var AO=Sn();dl.exports=AO==="NODE"});var gl=i((Jm,hl)=>{"use strict";var OO=T(),bO=ql();hl.exports=function(r){if(bO){try{return OO.process.getBuiltinModule(r)}catch(e){}try{return Function('return require("'+r+'")')()}catch(e){}}}});var An=i((Qm,Sl)=>{"use strict";var EO=T(),wO=I(),In=Te(),xn=Sn(),Tl=EO.structuredClone;Sl.exports=!!Tl&&!wO(function(){if(xn==="DENO"&&In>92||xn==="NODE"&&In>94||xn==="BROWSER"&&In>97)return!1;var r=new ArrayBuffer(8),e=Tl(r,{transfer:[r]});return r.byteLength!==0||e.byteLength!==8})});var Ol=i((rP,Al)=>{"use strict";var wn=T(),RO=gl(),mO=An(),PO=wn.structuredClone,Il=wn.ArrayBuffer,qt=wn.MessageChannel,En=!1,On,xl,ht,bn;if(mO)En=function(r){PO(r,{transfer:[r]})};else if(Il)try{qt||(On=RO("worker_threads"),On&&(qt=On.MessageChannel)),qt&&(xl=new qt,ht=new Il(2),bn=function(r){xl.port1.postMessage(null,[r])},ht.byteLength===2&&(bn(ht),ht.byteLength===0&&(En=bn)))}catch(r){}Al.exports=En});var Nn=i((eP,_l)=>{"use strict";var Pn=T(),_n=A(),Rl=re(),_O=Qe(),CO=yl(),NO=gn(),bl=Ol(),Rn=An(),FO=Pn.structuredClone,ml=Pn.ArrayBuffer,mn=Pn.DataView,LO=Math.min,Cn=ml.prototype,Pl=mn.prototype,BO=_n(Cn.slice),El=Rl(Cn,"resizable","get"),wl=Rl(Cn,"maxByteLength","get"),jO=_n(Pl.getInt8),DO=_n(Pl.setInt8);_l.exports=(Rn||bl)&&function(r,e,t){var a=NO(r),n=e===void 0?a:_O(e),u=!El||!El(r),o;if(CO(r),Rn&&(r=FO(r,{transfer:[r]}),a===n&&(t||u)))return r;if(a>=n&&(!t||u))o=BO(r,0,n);else{var s=t&&!u&&wl?{maxByteLength:wl(r)}:void 0;o=new ml(n,s);for(var c=new mn(r),f=new mn(o),v=LO(n,a),y=0;y<v;y++)DO(f,y,jO(c,y))}return Rn||bl(r),o}});var Nl=i(()=>{"use strict";var MO=R(),Cl=Nn();Cl&&MO({target:"ArrayBuffer",proto:!0},{transfer:function(){return Cl(this,arguments.length?arguments[0]:void 0,!0)}})});var Ll=i(()=>{"use strict";var UO=R(),Fl=Nn();Fl&&UO({target:"ArrayBuffer",proto:!0},{transferToFixedLength:function(){return Fl(this,arguments.length?arguments[0]:void 0,!1)}})});var Bl=i(()=>{"use strict";var kO=_a(),GO=N().exportTypedArrayStaticMethod,$O=Ka();GO("from",$O,kO)});var Dl=i((sP,jl)=>{"use strict";var VO=w(),WO=za(),YO=TypeError,KO=Object.getOwnPropertyDescriptor,zO=VO&&!function(){if(this!==void 0)return!0;try{Object.defineProperty([],"length",{writable:!1}).length=1}catch(r){return r instanceof TypeError}}();jl.exports=zO?function(r,e){if(WO(r)&&!KO(r,"length").writable)throw new YO("Cannot set read only .length");return r.length=e}:function(r,e){return r.length=e}});var Ul=i((vP,Ml)=>{"use strict";var HO=TypeError,XO=9007199254740991;Ml.exports=function(r){if(r>XO)throw HO("Maximum allowed index exceeded");return r}});var kl=i(()=>{"use strict";var ZO=R(),JO=K(),QO=U(),rb=Dl(),eb=Ul(),tb=I(),ab=tb(function(){return[].push.call({length:4294967296},1)!==4294967297}),nb=function(){try{Object.defineProperty([],"length",{writable:!1}).push()}catch(r){return r instanceof TypeError}},ib=ab||!nb();ZO({target:"Array",proto:!0,arity:1,forced:ib},{push:function(e){var t=JO(this),a=QO(t),n=arguments.length;eb(a+n);for(var u=0;u<n;u++)t[a]=arguments[u],a++;return rb(t,a),a}})});var gt=i((lP,Gl)=>{"use strict";var ub=fr(),ob=String;Gl.exports=function(r){if(ub(r)==="Symbol")throw new TypeError("Cannot convert a Symbol value to a string");return ob(r)}});var Vl=i((yP,$l)=>{"use strict";var sb=D();$l.exports=function(){var r=sb(this),e="";return r.hasIndices&&(e+="d"),r.global&&(e+="g"),r.ignoreCase&&(e+="i"),r.multiline&&(e+="m"),r.dotAll&&(e+="s"),r.unicode&&(e+="u"),r.unicodeSets&&(e+="v"),r.sticky&&(e+="y"),e}});var Yl=i((pP,Wl)=>{"use strict";var Fn=I(),vb=T(),Ln=vb.RegExp,Bn=Fn(function(){var r=Ln("a","y");return r.lastIndex=2,r.exec("abcd")!==null}),cb=Bn||Fn(function(){return!Ln("a","y").sticky}),fb=Bn||Fn(function(){var r=Ln("^r","gy");return r.lastIndex=2,r.exec("str")!==null});Wl.exports={BROKEN_CARET:fb,MISSED_STICKY:cb,UNSUPPORTED_Y:Bn}});var zl=i((dP,Kl)=>{"use strict";var lb=I(),yb=T(),pb=yb.RegExp;Kl.exports=lb(function(){var r=pb(".","s");return!(r.dotAll&&r.test(\`
|
|
222
222
|
\`)&&r.flags==="s")})});var Xl=i((qP,Hl)=>{"use strict";var db=I(),qb=T(),hb=qb.RegExp;Hl.exports=db(function(){var r=hb("(?<a>b)","g");return r.exec("b").groups.a!=="b"||"b".replace(r,"$<a>c")!=="bc"})});var It=i((hP,Jl)=>{"use strict";var $r=b(),St=A(),gb=gt(),Tb=Vl(),Sb=Yl(),Ib=Ae(),xb=Nr(),Ab=Sr().get,Ob=zl(),bb=Xl(),Eb=Ib("native-string-replace",String.prototype.replace),Tt=RegExp.prototype.exec,Dn=Tt,wb=St("".charAt),Rb=St("".indexOf),mb=St("".replace),jn=St("".slice),Mn=function(){var r=/a/,e=/b*/g;return $r(Tt,r,"a"),$r(Tt,e,"a"),r.lastIndex!==0||e.lastIndex!==0}(),Zl=Sb.BROKEN_CARET,Un=/()??/.exec("")[1]!==void 0,Pb=Mn||Un||Zl||Ob||bb;Pb&&(Dn=function(e){var t=this,a=Ab(t),n=gb(e),u=a.raw,o,s,c,f,v,y,l;if(u)return u.lastIndex=t.lastIndex,o=$r(Dn,u,n),t.lastIndex=u.lastIndex,o;var d=a.groups,g=Zl&&t.sticky,q=$r(Tb,t),p=t.source,h=0,x=n;if(g&&(q=mb(q,"y",""),Rb(q,"g")===-1&&(q+="g"),x=jn(n,t.lastIndex),t.lastIndex>0&&(!t.multiline||t.multiline&&wb(n,t.lastIndex-1)!==\`
|
|
223
223
|
\`)&&(p="(?: "+p+")",x=" "+x,h++),s=new RegExp("^(?:"+p+")",q)),Un&&(s=new RegExp("^"+p+"$(?!\\\\s)",q)),Mn&&(c=t.lastIndex),f=$r(Tt,g?s:t,x),g?f?(f.input=jn(f.input,h),f[0]=jn(f[0],h),f.index=t.lastIndex,t.lastIndex+=f[0].length):t.lastIndex=0:Mn&&f&&(t.lastIndex=t.global?f.index+f[0].length:c),Un&&f&&f.length>1&&$r(Eb,f[0],s,function(){for(v=1;v<arguments.length-2;v++)arguments[v]===void 0&&(f[v]=void 0)}),f&&d)for(f.groups=y=xb(null),v=0;v<d.length;v++)l=d[v],y[l[0]]=f[l[1]];return f});Jl.exports=Dn});var kn=i(()=>{"use strict";var _b=R(),Ql=It();_b({target:"RegExp",proto:!0,forced:/./.exec!==Ql},{exec:Ql})});var ny=i((SP,ay)=>{"use strict";var Cb=Yr(),ty=Function.prototype,ry=ty.apply,ey=ty.call;ay.exports=typeof Reflect=="object"&&Reflect.apply||(Cb?ey.bind(ry):function(){return ey.apply(ry,arguments)})});var cy=i((IP,vy)=>{"use strict";kn();var iy=b(),uy=Ir(),Nb=It(),oy=I(),sy=E(),Fb=J(),Lb=sy("species"),Gn=RegExp.prototype;vy.exports=function(r,e,t,a){var n=sy(r),u=!oy(function(){var f={};return f[n]=function(){return 7},""[r](f)!==7}),o=u&&!oy(function(){var f=!1,v=/a/;return r==="split"&&(v={},v.constructor={},v.constructor[Lb]=function(){return v},v.flags="",v[n]=/./[n]),v.exec=function(){return f=!0,null},v[n](""),!f});if(!u||!o||t){var s=/./[n],c=e(n,""[r],function(f,v,y,l,d){var g=v.exec;return g===Nb||g===Gn.exec?u&&!d?{done:!0,value:iy(s,v,y,l)}:{done:!0,value:iy(f,y,v,l)}:{done:!1}});uy(String.prototype,r,c[0]),uy(Gn,n,c[1])}a&&Fb(Gn[n],"sham",!0)}});var py=i((xP,yy)=>{"use strict";var $n=A(),Bb=M(),jb=gt(),Db=wr(),Mb=$n("".charAt),fy=$n("".charCodeAt),Ub=$n("".slice),ly=function(r){return function(e,t){var a=jb(Db(e)),n=Bb(t),u=a.length,o,s;return n<0||n>=u?r?"":void 0:(o=fy(a,n),o<55296||o>56319||n+1===u||(s=fy(a,n+1))<56320||s>57343?r?Mb(a,n):o:r?Ub(a,n,n+2):(o-55296<<10)+(s-56320)+65536)}};yy.exports={codeAt:ly(!1),charAt:ly(!0)}});var qy=i((AP,dy)=>{"use strict";var kb=py().charAt;dy.exports=function(r,e,t){return e+(t?kb(r,e).length:1)}});var gy=i((OP,hy)=>{"use strict";var Yn=A(),Gb=K(),$b=Math.floor,Vn=Yn("".charAt),Vb=Yn("".replace),Wn=Yn("".slice),Wb=/\\$([$&'\`]|\\d{1,2}|<[^>]*>)/g,Yb=/\\$([$&'\`]|\\d{1,2})/g;hy.exports=function(r,e,t,a,n,u){var o=t+r.length,s=a.length,c=Yb;return n!==void 0&&(n=Gb(n),c=Wb),Vb(u,c,function(f,v){var y;switch(Vn(v,0)){case"$":return"$";case"&":return r;case"\`":return Wn(e,0,t);case"'":return Wn(e,o);case"<":y=n[Wn(v,1,-1)];break;default:var l=+v;if(l===0)return f;if(l>s){var d=$b(l/10);return d===0?f:d<=s?a[d-1]===void 0?Vn(v,1):a[d-1]+Vn(v,1):f}y=a[l-1]}return y===void 0?"":y})}});var Iy=i((bP,Sy)=>{"use strict";var Ty=b(),Kb=D(),zb=O(),Hb=ir(),Xb=It(),Zb=TypeError;Sy.exports=function(r,e){var t=r.exec;if(zb(t)){var a=Ty(t,r,e);return a!==null&&Kb(a),a}if(Hb(r)==="RegExp")return Ty(Xb,r,e);throw new Zb("RegExp#exec called on incompatible receiver")}});var Ey=i(()=>{"use strict";var Jb=ny(),xy=b(),xt=A(),Qb=cy(),rE=I(),eE=D(),tE=O(),aE=m(),nE=M(),iE=xr(),Vr=gt(),uE=wr(),oE=qy(),sE=Xr(),vE=gy(),cE=Iy(),fE=E(),zn=fE("replace"),lE=Math.max,yE=Math.min,pE=xt([].concat),Kn=xt([].push),Ay=xt("".indexOf),Oy=xt("".slice),dE=function(r){return r===void 0?r:String(r)},qE=function(){return"a".replace(/./,"$0")==="$0"}(),by=function(){return/./[zn]?/./[zn]("a","$0")==="":!1}(),hE=!rE(function(){var r=/./;return r.exec=function(){var e=[];return e.groups={a:"7"},e},"".replace(r,"$<a>")!=="7"});Qb("replace",function(r,e,t){var a=by?"$":"$0";return[function(u,o){var s=uE(this),c=aE(u)?sE(u,zn):void 0;return c?xy(c,u,s,o):xy(e,Vr(s),u,o)},function(n,u){var o=eE(this),s=Vr(n);if(typeof u=="string"&&Ay(u,a)===-1&&Ay(u,"$<")===-1){var c=t(e,o,s,u);if(c.done)return c.value}var f=tE(u);f||(u=Vr(u));var v=o.global,y;v&&(y=o.unicode,o.lastIndex=0);for(var l=[],d;d=cE(o,s),!(d===null||(Kn(l,d),!v));){var g=Vr(d[0]);g===""&&(o.lastIndex=oE(s,iE(o.lastIndex),y))}for(var q="",p=0,h=0;h<l.length;h++){d=l[h];for(var x=Vr(d[0]),_=lE(yE(nE(d.index),s.length),0),L=[],nr,B=1;B<d.length;B++)Kn(L,dE(d[B]));var Z=d.groups;if(f){var Er=pE([x],L,_,s);Z!==void 0&&Kn(Er,Z),nr=Vr(Jb(u,void 0,Er))}else nr=vE(x,s,_,L,Z,u);_>=p&&(q+=Oy(s,p,_)+nr,p=_+x.length)}return q+Oy(s,p)}]},!hE||!qE||by)});var BP=S(Ao(),1),jP=S(wo(),1),DP=S(Co(),1),MP=S(Lo(),1),UP=S(Do(),1),kP=S(ko(),1),GP=S(Vo(),1),$P=S(Zs(),1),VP=S(ff(),1),WP=S(yf(),1),YP=S(df(),1),KP=S(Tf(),1),zP=S(If(),1),HP=S(wf(),1),XP=S(Vf(),1),ZP=S(Kf(),1),JP=S(zf(),1),QP=S(Zf(),1),r_=S(Qf(),1),e_=S(il(),1),t_=S(fl(),1),a_=S(Nl(),1),n_=S(Ll(),1),i_=S(Bl(),1),u_=S(kl(),1);var RP=S(Ey(),1),mP=S(kn(),1);function wy(r){return r.replace(/[A-Z]/g,e=>"_"+e.toLowerCase()).replace(/^_/,"")}function Ry(r){let e={};for(let a in r)a.startsWith("on")&&(e[wy(a.slice(2))]=r[a],e[a]=r[a]);let t=a=>Y(this,null,function*(){let{data:n}=a;if(e[n.type])try{let u=yield e[n.type](n.data);if(u!=null&&u.$transfer&&Array.isArray(u.$transfer)){let o=u.$transfer;delete u.$transfer,self.postMessage({type:""+n.type+"_result",key:n.key,data:u},o)}else self.postMessage({type:""+n.type+"_result",key:n.key,data:u})}catch(u){self.postMessage({type:""+n.type+"_result",key:n.key,error:u})}else self.postMessage({type:""+n.type+"_result",key:n.key,error:"no_event"})});return self.addEventListener("message",t),()=>{self.removeEventListener("message",t)}}var br,hr=function(r){return r.MAP_VERSION="map_version",r.ROUTE_VERSION="route_version",r.FACILITY_VERSION="facility_version",r.MAP_DATA="map_data",r.ROAD_NETWORK_DATA="road_network_data",r.FACILITY_DATA="facility_data",r.POI_TEXT="poi_text",r.LAZY_TEXTURE="lazy_texture",r.LAZY_POI="lazy_poi",r}({});function Hn(r,e){return r===void 0&&(r="aibee_map"),e===void 0&&(e=6),new Promise((t,a)=>{if(br)return t({db:br,type:"success"});let n=indexedDB.open(r,e);n.onupgradeneeded=function(u){br=u.target.result,console.log("[open db is onupgradeneeded]"),ar("map_version"),ar("route_version"),ar("facility_version"),ar("map_data"),ar("road_network_data"),ar("facility_data"),ar("poi_text"),ar("lazy_texture"),ar("lazy_poi")},n.onsuccess=u=>{br=u.target.result,t({db:br,type:"success"})},n.onerror=u=>{console.log("[open db is onerror]"),a(u)}})}function my(r,e,t){return t===void 0&&(t=br),new Promise((a,n)=>{t||n("\\u6CA1\\u6709db");let o=t.transaction([r],"readonly").objectStore(r).get(e);o.onsuccess=()=>{o.result?a(o.result.value):a(null)},o.onerror=s=>{console.log("[getVersionByKey]",s),a(null)}})}function ar(r,e){e===void 0&&(e=br),e&&(e.objectStoreNames.contains(r)||e.createObjectStore(r,{keyPath:"key"}))}Ry({onGetTextureByTexts(r){return Y(this,null,function*(){let{texts:e}=r,{db:t}=yield Hn(),n=t.transaction([hr.LAZY_POI],"readonly").objectStore(hr.LAZY_POI).openCursor(),u={},o=new Set,s={};return new Promise(c=>{let f=()=>Y(this,null,function*(){yield Promise.all(Object.values(s).map(v=>Y(this,null,function*(){if(u[v.textureKey])u[v.textureKey].map[v.key]=v;else{let y=yield my(hr.LAZY_TEXTURE,v.textureKey);if(y){let{width:l,height:d,data:g}=y;u[v.textureKey]={width:l,height:d,data:Uint8Array.from(g),map:{[v.key]:v}}}else o.add(v.textureKey)}}))),c({textureKeyMap:u,$transfer:Object.values(u).map(v=>v.data.buffer)})});n.onsuccess=v=>Y(this,null,function*(){var y;let l=(y=v.target)==null?void 0:y.result;if(l){let d=l.key,g=l.value.value;e.includes(d)&&(s[d]=g),l.continue()}else console.log("\\u6240\\u6709\\u6570\\u636E\\u8BFB\\u53D6\\u5B8C\\u6BD5"),f()})})})},onSaveTextTextures(r){return Y(this,null,function*(){let{data:e}=r;return new Promise(t=>Y(this,null,function*(){let{db:a}=yield Hn(),n=a.transaction([hr.LAZY_TEXTURE],"readwrite"),u=a.transaction([hr.LAZY_POI],"readwrite"),o=n.objectStore(hr.LAZY_TEXTURE),s=u.objectStore(hr.LAZY_POI),c=[];for(let f in e){let{textureData:v,res:y}=e[f];o.add({key:f,value:v}),y.forEach(l=>{s.add({key:l.key,value:l})})}c.push(new Promise((f,v)=>{n.oncomplete=f,n.onerror=v}),new Promise((f,v)=>{u.oncomplete=f,u.onerror=v})),Promise.all(c).then(()=>{t({status:!0})}).catch(f=>{console.error(f),n.abort(),u.abort()})}))})}});
|
|
224
|
-
`],{type:"text/javascript"}),t=URL.createObjectURL(a),e=new Worker(t);return URL.revokeObjectURL(t),e}var pe,Pt=function(a){return a.MAP_VERSION="map_version",a.ROUTE_VERSION="route_version",a.FACILITY_VERSION="facility_version",a.MAP_DATA="map_data",a.ROAD_NETWORK_DATA="road_network_data",a.FACILITY_DATA="facility_data",a.POI_TEXT="poi_text",a.LAZY_TEXTURE="lazy_texture",a.LAZY_POI="lazy_poi",a}({});function Pr(a,t){return a===void 0&&(a="aibee_map"),t===void 0&&(t=6),new Promise((e,n)=>{if(pe)return e({db:pe,type:"success"});let r=indexedDB.open(a,t);r.onupgradeneeded=function(i){pe=i.target.result,console.log("[open db is onupgradeneeded]"),Se("map_version"),Se("route_version"),Se("facility_version"),Se("map_data"),Se("road_network_data"),Se("facility_data"),Se("poi_text"),Se("lazy_texture"),Se("lazy_poi")},r.onsuccess=i=>{pe=i.target.result,e({db:pe,type:"success"})},r.onerror=i=>{console.log("[open db is onerror]"),n(i)}})}function Un(a,t,e){return e===void 0&&(e=pe),new Promise((n,r)=>{e||r("\u6CA1\u6709db");let o=e.transaction([a],"readonly").objectStore(a).get(t);o.onsuccess=()=>{o.result?n(o.result.value):n(null)},o.onerror=s=>{console.log("[getVersionByKey]",s),n(null)}})}function Lr(a,t,e,n,r){return n===void 0&&(n=pe),r===void 0&&(r=!1),new Promise((i,o)=>g(this,null,function*(){if(!n){o("\u6CA1\u6709db");return}let s=r;r||(s=!!(yield Un(a,t)));let u=n.transaction([a],"readwrite").objectStore(a),l=s?u.put({key:t,value:e}):u.add({key:t,value:e});l.onsuccess=function(c){i(c)},l.onerror=function(c){o(c)}}))}function Se(a,t){t===void 0&&(t=pe),t&&(t.objectStoreNames.contains(a)||t.createObjectStore(a,{keyPath:"key"}))}function fs(a){a===void 0&&(a=pe),a==null||a.close(),pe=null}var fe=Math.max(window.devicePixelRatio,2),dt=class{static InitDb(){return Pr()}static getCanvas(){if(this.canvas)return this.canvas;{let t=document.createElement("canvas");return this.canvas=t,t}}static getCtx(){if(this.ctx)return this.ctx;let e=this.getCanvas().getContext("2d",{willReadFrequently:!0});return this.ctx=e,e}static getIdleCanvas(){if(this.idleCanvas)return this.idleCanvas;{let t=document.createElement("canvas");return this.idleCanvas=t,t}}static getIdleCtx(){if(this.idleCtx)return this.idleCtx;let e=this.getIdleCanvas().getContext("2d",{willReadFrequently:!0});return this.idleCtx=e,e}static getMergedOptions(t){return v({},this.options,t)}static setCtxStyle(t,e,n){e===void 0&&(e=this.getCanvas()),n===void 0&&(n=this.getCtx()),e.style.width=""+t.width+"px",e.style.height=""+t.height+"px",e.width=t.width*fe,e.height=t.height*fe,n.font=t.font,n.textBaseline=t.textBaseline,n.lineWidth=t.lineWidth,n.fillStyle=t.fillStyle,n.strokeStyle=t.strokeStyle,n.scale(fe,fe)}static getLazyIndexDbTextTextureWorker(){if(this.lazyIndexDbTextTextureWorker)return this.lazyIndexDbTextTextureWorker;{let t=Bi();return this.lazyIndexDbTextTextureWorker=t,t}}static getTextureByText(t,e){return g(this,null,function*(){let n=this.getMergedOptions(e),r=(e==null?void 0:e.maxWidth)||600,i=Xe(v({},n,{text:t,maxWidth:r}));if(this.cacheMap.has(i))return this.cacheMap.get(i);let o=new Promise((s,u)=>g(this,null,function*(){var l;yield this.InitDb();let c=yield Un(Pt.POI_TEXT,i);if(c){let L=new B.DataTexture(new Uint8Array(c.data),c.width,c.height,B.RGBAFormat);L.flipY=!0,L.minFilter=B.LinearFilter,L.magFilter=B.LinearFilter;let O={texture:L,lines:c.lines};this.cacheMap.set(i,O),s(O);return}let h=this.getCanvas(),p=this.getCtx();p.clearRect(0,0,h.width,h.height),this.setCtxStyle(n);let f=[],d="",m=[],y="",x=0;for(let L=0;L<t.length;L++){let O=t[L];if(O==="("||O==="\uFF08"){if(x===0&&y){let I=E(y);m.push(...I),y=""}x++}else if((O===")"||O==="\uFF09")&&(x--,x===0)){y+=O,m.push(y),y="";continue}y+=O}if(y){let L=E(y);m.push(...L)}function E(L){let O=[],I="",V=!1,it="";for(let q=0;q<L.length;q++){let z=L[q];(z==='"'||z==="'")&&(!V||z===it)?(V?(I+=z,O.push(I),I=""):(I&&O.push(I),I=z),V=!V,it=z):I+=z}return I&&O.push(I),O}for(let L of m)if(L.startsWith("(")||L.startsWith("\uFF08")||L.startsWith('"')||L.startsWith("'"))if(p.measureText(L).width>r){d&&(f.push(d),d="");let I="",V=L.split("");for(let it of V){let q=I+it;p.measureText(q).width>r&&I?(f.push(I),I=it):I=q}I&&(d=I)}else{let I=d?d+" "+L:L;p.measureText(I).width>r&&d?(f.push(d),d=L):d=I}else{let O=L.split(" ");for(let I of O){let V=d?d+" "+I:I,it=p.measureText(V);if(it.width>r)if(d&&f.push(d),it.width>r||xi(I)){let q="",z=I.split("");for(let ge of z){let Te=q+ge;p.measureText(Te).width>r&&q?(f.push(q),q=ge):q=Te}q&&(d=q)}else d=I;else d=V}}d&&f.push(d);let S=+(((l=n.font.match(/(\d+)px/))==null?void 0:l[1])||54),R=Math.ceil(S+n.lineWidth+2),P=R*f.length,K=Math.max(...f.map(L=>{let O=Math.ceil(p.measureText(L).width);return O%2===0?O:O+1}))+2;f.forEach((L,O)=>{let I=p.measureText(L),V=Math.ceil(I.width),it=Math.floor((K-V)/2),q=O*(2+R);n.lineWidth&&p.strokeText(L,it,q),p.fillText(L,it,q)});let T=p.getImageData(0,0,K*fe,P*fe),Q=new B.DataTexture(T.data,K*fe,P*fe,B.RGBAFormat);Q.flipY=!0,Q.minFilter=B.LinearFilter,Q.magFilter=B.LinearFilter,this.cacheMap.set(i,{texture:Q,lines:f.length}),Lr(Pt.POI_TEXT,i,{data:Array.from(T.data),width:K*fe,height:P*fe,lines:f.length},void 0,!0),s({texture:Q,lines:f.length})}));return this.cacheMap.set(i,o),o})}static lazyGetTextureByTexts(t,e){return g(this,null,function*(){let n=this.getMergedOptions(e),r=n.height;n.height=Math.min(r*t.length,2048);let i={},o=new Set;if(t.map(l=>{if(this.lazyPoiMap.has(l)){let c=this.lazyPoiMap.get(l),h=this.lazyTextureCacheMap.get(c.textureKey);if(h){i[l]={width:c.width,height:r,x:c.x,y:c.y,texture:h};return}}o.add(l)}),!o.size)return i;let s=Array.from(o);return new Promise((l,c)=>g(this,null,function*(){let h;window.OffscreenCanvas?(console.log("use webworker"),h=this.getTextsByWorker(s,n,r)):typeof window.requestIdleCallback=="function"?(console.log("use browser idle"),h=this.getTextsByBrowserIdle(s,n,r)):(console.log("use requestAnimation text textures"),h=Promise.resolve().then(()=>this.getTextsSync(s,n,r))),l(h)}))})}static getTextsByWorker(t,e,n){return g(this,null,function*(){return this.textTextureWorker||(this.textTextureWorker=Fi()),(yield Z(this.textTextureWorker,"get_texture_by_texts",{texts:t,options:e,originHeight:n})).data.map(i=>{let o=new B.DataTexture(i.data,e.width,i.height,B.RGBAFormat);return o.flipY=!0,o.minFilter=B.LinearFilter,o.magFilter=B.LinearFilter,{texture:o,offsetMap:i.offsetMap}}).reduce((i,o)=>(Object.keys(o.offsetMap).forEach(s=>{i[s]=o.offsetMap[s],i[s].texture=o.texture}),i),{})})}static getTextsByBrowserIdle(t,e,n){return g(this,null,function*(){let r=0,i=t.length;return new Promise(o=>{let s=this.getIdleCanvas(),u=this.getIdleCtx();u.clearRect(0,0,s.width,s.height),this.setCtxStyle(e,s,u);let l=[],c=0,h=0,p={},f=()=>g(this,null,function*(){let m=u.getImageData(0,0,e.width,n+h);l.push({imageData:m,offsetMap:p,height:n+h});let y=l.reduce((x,E)=>{let S=new B.DataTexture(E.imageData.data,e.width,E.height,B.RGBAFormat);return S.flipY=!0,S.minFilter=B.LinearFilter,S.magFilter=B.LinearFilter,Object.keys(E.offsetMap).forEach(R=>{x[R]=v({},E.offsetMap[R],{texture:S})}),x},{});o(y)}),d=m=>{if(r>=i)return f();if(m.timeRemaining()>0){let y=t[r],x=Math.ceil(u.measureText(y).width);if(x=x%2===0?x:x+1,x+=2,x+c>e.width&&(c=0,h+=n,n+h>e.height)){let S=u.getImageData(0,0,e.width,h);l.push({imageData:S,offsetMap:p,height:h}),h=0,u.clearRect(0,0,e.width,e.height),p={}}let E=8;if(e.lineWidth&&u.strokeText(y,2+c,E+h),u.fillText(y,2+c,E+h),p[y]={width:x,height:n,x:c,y:h},c+=x,++r>=i)return f();m.timeRemaining()>0?d(m):this.timer.requestIdleCallback(d)}else this.timer.requestIdleCallback(d)};this.timer.requestIdleCallback(d),this.timer.setTimeout(()=>{r===0&&(console.log("idle \u4E0D\u6267\u884C \u56DE\u9000\u5230\u540C\u6B65"),o(this.getTextsSync(t,e,n)))},1e3)})})}static getTextsByReqAniFrame(t,e,n){return g(this,null,function*(){let r=0,i=t.length;return new Promise(o=>{let s=this.getIdleCanvas(),u=this.getIdleCtx();u.clearRect(0,0,s.width,s.height),this.setCtxStyle(e,s,u);let l=[],c=0,h=0,p={},f=()=>g(this,null,function*(){let m=u.getImageData(0,0,e.width,n+h);l.push({imageData:m,offsetMap:p,height:n+h});let y=l.reduce((x,E)=>{let S=new B.DataTexture(E.imageData.data,e.width,E.height,B.RGBAFormat);return S.flipY=!0,S.minFilter=B.LinearFilter,S.magFilter=B.LinearFilter,Object.keys(E.offsetMap).forEach(R=>{x[R]=v({},E.offsetMap[R],{texture:S})}),x},{});o(y)}),d=()=>{if(r>=i)return f();let m=0;for(;m<30;){let y=t[r],x=Math.ceil(u.measureText(y).width);if(x=x%2===0?x:x+1,x+=2,x+c>e.width&&(c=0,h+=n,n+h>e.height)){let S=u.getImageData(0,0,e.width,h);l.push({imageData:S,offsetMap:p,height:h}),h=0,u.clearRect(0,0,e.width,e.height),p={}}let E=8;if(e.lineWidth&&u.strokeText(y,2+c,E+h),u.fillText(y,2+c,E+h),p[y]={width:x,height:n,x:c,y:h},c+=x,++r>=i)return f();m++}this.timer.requestAnimationFrame(d)};this.timer.requestAnimationFrame(d)})})}static getTextsSync(t,e,n){let r=this.getCanvas(),i=this.getCtx();i.clearRect(0,0,r.width,r.height),this.setCtxStyle(e);let o=[],s=0,u=0,l={};t.forEach(p=>{let f=Math.ceil(i.measureText(p).width);if(f=f%2===0?f:f+1,f+=2,f+s>e.width&&(s=0,u+=n,n+u>e.height)){let m=i.getImageData(0,0,e.width,u);o.push({data:m.data,offsetMap:l,height:u}),u=0,i.clearRect(0,0,e.width,e.height),l={}}let d=8;e.lineWidth&&i.strokeText(p,2+s,d+u),i.fillText(p,2+s,d+u),l[p]={width:f,height:n,x:s,y:u},s+=f});let c=i.getImageData(0,0,e.width,n+u);return o.push({data:c.data,offsetMap:l,height:u+n}),o.reduce((p,f)=>{let d=new B.DataTexture(f.data,e.width,f.height,B.RGBAFormat);return d.flipY=!0,d.minFilter=B.LinearFilter,d.magFilter=B.LinearFilter,Object.keys(f.offsetMap).forEach(m=>{p[m]=v({},f.offsetMap[m],{texture:d})}),p},{})}static getTextureByTexts(t,e){let n=this.getMergedOptions(e),r=n.height;n.height=Math.min(r*t.length,1e4);let i=this.getCanvas(),o=this.getCtx();o.clearRect(0,0,i.width,i.height),this.setCtxStyle(n);let s=0,u=0,l={};t.forEach(p=>{let f=Math.ceil(o.measureText(p).width);f=f%2===0?f:f+1,f+=2,f+s>n.width&&(s=0,u+=r);let d=8;n.lineWidth&&o.strokeText(p,2+s,d+u),o.fillText(p,2+s,d+u),l[p]={width:f,height:r,x:s,y:u},s+=f});let c=o.getImageData(0,0,n.width,r+u),h=new B.DataTexture(Uint8Array.from(c.data),n.width,r+u,B.RGBAFormat);return h.flipY=!0,h.minFilter=B.LinearFilter,h.magFilter=B.LinearFilter,{texture:h,offsetMap:l}}static dispose(){var t,e;this.ctx=null,this.canvas=null,this.idleCtx=null,this.idleCanvas=null,this.timer.dispose(),this.cacheMap.forEach(n=>{n instanceof Promise?n.then(r=>{r.texture.dispose()}):n.texture.dispose()}),this.cacheMap.clear(),(t=this.textTextureWorker)==null||t.terminate(),(e=this.lazyIndexDbTextTextureWorker)==null||e.terminate(),this.textTextureWorker=null}};dt.canvas=document.createElement("canvas");dt.ctx=dt.canvas.getContext("2d",{willReadFrequently:!0});dt.cacheMap=new Map;dt.lazyTextureCacheMap=new Map;dt.lazyPoiMap=new Map;dt.textTextureWorker=null;dt.lazyIndexDbTextTextureWorker=null;dt.idleCanvas=null;dt.idleCtx=null;dt.timer=new $;dt.options={width:2048,height:512,font:"28px sans-serif",textBaseline:"top",lineWidth:2,fillStyle:"rgba(0,0,0,1)",strokeStyle:"white"};var Mh=require("core-js/modules/web.dom-collections.iterator.js"),$t=require("three"),gt=class{static getTextureByUrl(t){if(this.urlTextureMap.has(t))return Promise.resolve(this.urlTextureMap.get(t));let e=this.textureLoader.loadAsync(t);return e.then(n=>{n.format=$t.RGBAFormat,n.magFilter=$t.LinearFilter,n.minFilter=$t.LinearFilter,n.colorSpace="srgb",this.urlTextureMap.set(t,n)}),this.urlTextureMap.set(t,e),e}static getUrlTextureBorder(t,e,n){let r=t+"-"+n.width+"-"+n.color;if(this.borderUrlTextureMap.has(r))return Promise.resolve(this.borderUrlTextureMap.get(r));let i=this.textureLoader.loadAsync(t).then(o=>{let s=this.ctx,u=this.canvas,l=e+n.width*2;u.width=l,u.height=l;let c=l/2;s.clearRect(0,0,l,l),s.beginPath(),s.arc(c,c,e/2+n.width,0,2*Math.PI),s.fillStyle=n.color,s.fill(),s.beginPath(),s.arc(c,c,e/2,0,2*Math.PI),s.closePath(),s.clip(),s.drawImage(o.image,n.width,n.width,e,e);let h=new $t.Texture(u);return h.format=$t.RGBAFormat,h.magFilter=$t.LinearFilter,h.minFilter=$t.LinearFilter,h.colorSpace="srgb",h.needsUpdate=!0,this.borderUrlTextureMap.set(r,h),h});return this.borderUrlTextureMap.set(r,i),i}static dispose(){this.urlTextureMap.forEach(t=>{t instanceof Promise?t.then(e=>e.dispose()):t.dispose()}),this.borderUrlTextureMap.forEach(t=>{t instanceof Promise?t.then(e=>e.dispose()):t.dispose()}),this.urlTextureMap.clear(),this.borderUrlTextureMap.clear(),this.ctx=null,this.canvas=null}};gt.textureLoader=new $t.TextureLoader;gt.urlTextureMap=new Map;gt.borderUrlTextureMap=new Map;gt.canvas=document.createElement("canvas");gt.ctx=gt.canvas.getContext("2d",{willReadFrequently:!0});var Tp=require("core-js/modules/web.dom-collections.iterator.js");var As=require("three/examples/jsm/loaders/GLTFLoader.js");var Xh=require("core-js/modules/web.dom-collections.iterator.js"),qh=require("core-js/modules/es.json.stringify.js"),jh=require("core-js/modules/es.error.cause.js"),Yh=require("core-js/modules/es.typed-array.float32-array.js"),Zh=require("core-js/modules/es.typed-array.at.js"),Kh=require("core-js/modules/es.typed-array.fill.js"),$h=require("core-js/modules/es.typed-array.find-last.js"),Jh=require("core-js/modules/es.typed-array.find-last-index.js"),Qh=require("core-js/modules/es.typed-array.set.js"),tp=require("core-js/modules/es.typed-array.sort.js"),ep=require("core-js/modules/es.typed-array.to-reversed.js"),np=require("core-js/modules/es.typed-array.to-sorted.js"),rp=require("core-js/modules/es.typed-array.with.js"),ip=require("core-js/modules/es.array-buffer.constructor.js"),op=require("core-js/modules/es.array-buffer.slice.js"),sp=require("core-js/modules/es.array-buffer.detached.js"),ap=require("core-js/modules/es.array-buffer.transfer.js"),up=require("core-js/modules/es.array-buffer.transfer-to-fixed-length.js"),lp=require("core-js/modules/es.array.push.js"),cp=require("core-js/modules/web.url.js"),hp=require("core-js/modules/web.url.to-json.js"),pp=require("core-js/modules/web.url-search-params.js"),fp=require("core-js/modules/web.url-search-params.delete.js"),dp=require("core-js/modules/web.url-search-params.has.js"),gp=require("core-js/modules/web.url-search-params.size.js"),mp=require("core-js/modules/es.array.sort.js"),_p=require("core-js/modules/es.typed-array.int8-array.js"),yp=require("core-js/modules/es.typed-array.uint32-array.js"),vp=require("core-js/modules/es.typed-array.int16-array.js"),xp=require("core-js/modules/es.typed-array.int32-array.js"),Ep=require("core-js/modules/es.typed-array.uint8-array.js"),bp=require("core-js/modules/es.typed-array.uint16-array.js");var zi={};No(zi,{Arrow:()=>vu,DracoDecoderJs:()=>xs,DracoDecoderWasm:()=>Es,DracoWasmWrapperJs:()=>bs,ManGlb:()=>yu,ParkingTypeIconMap:()=>_u});var uu={},ds=new URL("./icon/parkingSpace/half.svg",uu.url).href;var lu={},gs=new URL("./icon/parkingSpace/power.svg",lu.url).href;var cu={},ms=new URL("./icon/parkingSpace/mechanical.svg",cu.url).href;var hu={},_s=new URL("./icon/parkingSpace/vip.svg",hu.url).href;var pu={},ys=new URL("./glb/locate.glb",pu.url).href;var fu={},vs=new URL("./icon/path/arrow.png",fu.url).href;var du={},xs=new URL("./draco/draco_decoder.js",du.url).href;var gu={},Es=new URL("./draco/draco_decoder.wasm",gu.url).href;var mu={},bs=new URL("./draco/draco_wasm_wrapper.js",mu.url).href;var _u={half:ds,power:gs,mechanical:ms,vip:_s},yu=ys,vu=vs;var{ParkingTypeIconMap:Nr,ManGlb:Ss,Arrow:Or,DracoDecoderJs:Ms,DracoDecoderWasm:ws,DracoWasmWrapperJs:Ts}=zi;var Mt=require("three"),Gi=new WeakMap,Dr=class extends Mt.Loader{setDecoderPath(t){return this.decoderPath=t,this}setDecoderConfig(t){return this.decoderConfig=t,this}setWorkerLimit(t){return this.workerLimit=t,this}load(t,e,n,r){let i=new Mt.FileLoader(this.manager);i.setPath(this.path),i.setResponseType("arraybuffer"),i.setRequestHeader(this.requestHeader),i.setWithCredentials(this.withCredentials),i.load(t,o=>{this.parse(o,e,r)},n,r)}parse(t,e,n){n===void 0&&(n=()=>{}),this.decodeDracoFile(t,e,null,null,Mt.SRGBColorSpace).catch(n)}decodeDracoFile(t,e,n,r,i,o){i===void 0&&(i=Mt.LinearSRGBColorSpace),o===void 0&&(o=()=>{});let s={attributeIDs:n||this.defaultAttributeIDs,attributeTypes:r||this.defaultAttributeTypes,useUniqueIDs:!!n,vertexColorSpace:i};return this.decodeGeometry(t,s).then(e).catch(o)}decodeGeometry(t,e){let n=JSON.stringify(e);if(Gi.has(t)){let u=Gi.get(t);if(u.key===n)return u.promise;if(t.byteLength===0)throw new Error("THREE.DRACOLoader: Unable to re-decode a buffer with different settings. Buffer has already been transferred.")}let r,i=this.workerNextTaskID++,o=t.byteLength,s=this._getWorker(i,o).then(u=>(r=u,new Promise((l,c)=>{r._callbacks[i]={resolve:l,reject:c},r.postMessage({type:"decode",id:i,taskConfig:e,buffer:t},[t])}))).then(u=>this._createGeometry(u.geometry));return s.catch(()=>!0).then(()=>{r&&i&&this._releaseTask(r,i)}),Gi.set(t,{key:n,promise:s}),s}_createGeometry(t){let e=new Mt.BufferGeometry;t.index&&e.setIndex(new Mt.BufferAttribute(t.index.array,1));for(let n=0;n<t.attributes.length;n++){let r=t.attributes[n],i=r.name,o=r.array,s=r.itemSize,u=new Mt.BufferAttribute(o,s);i==="color"&&(this._assignVertexColorSpace(u,r.vertexColorSpace),u.normalized=!(o instanceof Float32Array)),e.setAttribute(i,u)}return e}_assignVertexColorSpace(t,e){if(e!==Mt.SRGBColorSpace)return;let n=new Mt.Color;for(let r=0,i=t.count;r<i;r++)n.fromBufferAttribute(t,r).convertSRGBToLinear(),t.setXYZ(r,n.r,n.g,n.b)}_loadLibrary(t,e){let n=new Mt.FileLoader(this.manager);return n.setPath(this.decoderPath),n.setResponseType(e),n.setWithCredentials(this.withCredentials),new Promise((r,i)=>{n.load(t,r,void 0,i)})}preload(){return this._initDecoder(),this}_initDecoder(){if(this.decoderPending)return this.decoderPending;let t=typeof WebAssembly!="object"||this.decoderConfig.type==="js",e=[];return t?e.push(this._loadLibrary(Ms,"text")):(e.push(this._loadLibrary(Ts,"text")),e.push(this._loadLibrary(ws,"arraybuffer"))),this.decoderPending=Promise.all(e).then(n=>{let r=n[0];t||(this.decoderConfig.wasmBinary=n[1]);let i=xu.toString(),o=["/* draco decoder */",r,"","/* worker */",i.substring(i.indexOf("{")+1,i.lastIndexOf("}"))].join(`
|
|
225
|
-
`);this.workerSourceURL=URL.createObjectURL(new Blob([o]))}),this.decoderPending}_getWorker(t,e){return this._initDecoder().then(()=>{if(this.workerPool.length<this.workerLimit){let r=new Worker(this.workerSourceURL);r._callbacks={},r._taskCosts={},r._taskLoad=0,r.postMessage({type:"init",decoderConfig:this.decoderConfig}),r.onmessage=function(i){let o=i.data;switch(o.type){case"decode":r._callbacks[o.id].resolve(o);break;case"error":r._callbacks[o.id].reject(o);break;default:console.error('THREE.DRACOLoader: Unexpected message, "'+o.type+'"')}},this.workerPool.push(r)}else this.workerPool.sort(function(r,i){return r._taskLoad>i._taskLoad?-1:1});let n=this.workerPool[this.workerPool.length-1];return n._taskCosts[t]=e,n._taskLoad+=e,n})}_releaseTask(t,e){t._taskLoad-=t._taskCosts[e],delete t._callbacks[e],delete t._taskCosts[e]}debug(){console.log("Task load: ",this.workerPool.map(t=>t._taskLoad))}dispose(){for(let t=0;t<this.workerPool.length;++t)this.workerPool[t].terminate();return this.workerPool.length=0,this.workerSourceURL!==""&&URL.revokeObjectURL(this.workerSourceURL),this}constructor(t){super(t),this.decoderPath="",this.decoderConfig={},this.decoderBinary=null,this.decoderPending=null,this.workerLimit=4,this.workerPool=[],this.workerNextTaskID=1,this.workerSourceURL="",this.defaultAttributeIDs={position:"POSITION",normal:"NORMAL",color:"COLOR",uv:"TEX_COORD"},this.defaultAttributeTypes={position:"Float32Array",normal:"Float32Array",color:"Float32Array",uv:"Float32Array"}}};function xu(){let a,t;onmessage=function(o){let s=o.data;switch(s.type){case"init":a=s.decoderConfig,t=new Promise(function(c){a.onModuleLoaded=function(h){c({draco:h})},DracoDecoderModule(a)});break;case"decode":let u=s.buffer,l=s.taskConfig;t.then(c=>{let h=c.draco,p=new h.Decoder;try{let f=e(h,p,new Int8Array(u),l),d=f.attributes.map(m=>m.array.buffer);f.index&&d.push(f.index.array.buffer),self.postMessage({type:"decode",id:s.id,geometry:f},d)}catch(f){console.error(f),self.postMessage({type:"error",id:s.id,error:f.message})}finally{h.destroy(p)}});break}};function e(o,s,u,l){let c=l.attributeIDs,h=l.attributeTypes,p,f,d=s.GetEncodedGeometryType(u);if(d===o.TRIANGULAR_MESH)p=new o.Mesh,f=s.DecodeArrayToMesh(u,u.byteLength,p);else if(d===o.POINT_CLOUD)p=new o.PointCloud,f=s.DecodeArrayToPointCloud(u,u.byteLength,p);else throw new Error("THREE.DRACOLoader: Unexpected geometry type.");if(!f.ok()||p.ptr===0)throw new Error("THREE.DRACOLoader: Decoding failed: "+f.error_msg());let m={index:null,attributes:[]};for(let y in c){let x=self[h[y]],E,S;if(l.useUniqueIDs)S=c[y],E=s.GetAttributeByUniqueId(p,S);else{if(S=s.GetAttributeId(p,o[c[y]]),S===-1)continue;E=s.GetAttribute(p,S)}let R=r(o,s,p,y,x,E);y==="color"&&(R.vertexColorSpace=l.vertexColorSpace),m.attributes.push(R)}return d===o.TRIANGULAR_MESH&&(m.index=n(o,s,p)),o.destroy(p),m}function n(o,s,u){let c=u.num_faces()*3,h=c*4,p=o._malloc(h);s.GetTrianglesUInt32Array(u,h,p);let f=new Uint32Array(o.HEAPF32.buffer,p,c).slice();return o._free(p),{array:f,itemSize:1}}function r(o,s,u,l,c,h){let p=h.num_components(),d=u.num_points()*p,m=d*c.BYTES_PER_ELEMENT,y=i(o,c),x=o._malloc(m);s.GetAttributeDataArrayForAllPoints(u,h,y,m,x);let E=new c(o.HEAPF32.buffer,x,d).slice();return o._free(x),{name:l,array:E,itemSize:p}}function i(o,s){switch(s){case Float32Array:return o.DT_FLOAT32;case Int8Array:return o.DT_INT8;case Int16Array:return o.DT_INT16;case Int32Array:return o.DT_INT32;case Uint8Array:return o.DT_UINT8;case Uint16Array:return o.DT_UINT16;case Uint32Array:return o.DT_UINT32}}}var It=class{static loadModel(t,e){return g(this,null,function*(){if(e===void 0&&(e=!0),e){if(this.modelMap.has(t)){let r=this.modelMap.get(t);if(r instanceof Promise)r.then(i=>v({},i,{scene:i.scene.clone()}));else return v({},r,{scene:r.scene.clone()})}let n=new Promise((r,i)=>{this.loader.load(t,o=>{this.modelMap.set(t,o),r(o)},void 0,i)});return this.modelMap.set(t,n),n.then(r=>v({},r,{scene:r.scene.clone()}))}else return new Promise((n,r)=>{this.loader.load(t,n,void 0,r)})})}static dispose(){this.modelMap.forEach(t=>{t instanceof Promise?t.then(e=>F(e.scene)):F(t.scene)}),this.modelMap.clear()}};It.dracoLoader=new Dr;It.loader=new As.GLTFLoader().setDRACOLoader(It.dracoLoader);It.modelMap=new Map;function ki(){let a=new Blob([`var p2=Object.create;var zx=Object.defineProperty;var d2=Object.getOwnPropertyDescriptor;var m2=Object.getOwnPropertyNames;var g2=Object.getPrototypeOf,y2=Object.prototype.hasOwnProperty;var Z=(n,t)=>()=>(t||n((t={exports:{}}).exports,t),t.exports);var v2=(n,t,e,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of m2(t))!y2.call(n,s)&&s!==e&&zx(n,s,{get:()=>t[s],enumerable:!(i=d2(t,s))||i.enumerable});return n};var ue=(n,t,e)=>(e=n!=null?p2(g2(n)):{},v2(t||!n||!n.__esModule?zx(e,"default",{value:n,enumerable:!0}):e,n));var Tf=(n,t,e)=>new Promise((i,s)=>{var u=p=>{try{f(e.next(p))}catch(d){s(d)}},c=p=>{try{f(e.throw(p))}catch(d){s(d)}},f=p=>p.done?i(p.value):Promise.resolve(p.value).then(u,c);f((e=e.apply(n,t)).next())});var wn=Z((nm,Gx)=>{"use strict";var ic=function(n){return n&&n.Math===Math&&n};Gx.exports=ic(typeof globalThis=="object"&&globalThis)||ic(typeof window=="object"&&window)||ic(typeof self=="object"&&self)||ic(typeof global=="object"&&global)||ic(typeof nm=="object"&&nm)||function(){return this}()||Function("return this")()});var Un=Z(($Z,kx)=>{"use strict";kx.exports=function(n){try{return!!n()}catch(t){return!0}}});var ei=Z((ZZ,qx)=>{"use strict";var _2=Un();qx.exports=!_2(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!==7})});var oc=Z((JZ,Vx)=>{"use strict";var x2=Un();Vx.exports=!x2(function(){var n=function(){}.bind();return typeof n!="function"||n.hasOwnProperty("prototype")})});var gi=Z((jZ,Hx)=>{"use strict";var E2=oc(),Cf=Function.prototype.call;Hx.exports=E2?Cf.bind(Cf):function(){return Cf.apply(Cf,arguments)}});var $x=Z(Yx=>{"use strict";var Wx={}.propertyIsEnumerable,Xx=Object.getOwnPropertyDescriptor,w2=Xx&&!Wx.call({1:2},1);Yx.f=w2?function(t){var e=Xx(this,t);return!!e&&e.enumerable}:Wx});var sc=Z((QZ,Zx)=>{"use strict";Zx.exports=function(n,t){return{enumerable:!(n&1),configurable:!(n&2),writable:!(n&4),value:t}}});var Zn=Z((tJ,Kx)=>{"use strict";var Jx=oc(),jx=Function.prototype,rm=jx.call,S2=Jx&&jx.bind.bind(rm,rm);Kx.exports=Jx?S2:function(n){return function(){return rm.apply(n,arguments)}}});var Gs=Z((eJ,t1)=>{"use strict";var Qx=Zn(),M2=Qx({}.toString),b2=Qx("".slice);t1.exports=function(n){return b2(M2(n),8,-1)}});var If=Z((nJ,e1)=>{"use strict";var A2=Zn(),T2=Un(),C2=Gs(),im=Object,I2=A2("".split);e1.exports=T2(function(){return!im("z").propertyIsEnumerable(0)})?function(n){return C2(n)==="String"?I2(n,""):im(n)}:im});var Pf=Z((rJ,n1)=>{"use strict";n1.exports=function(n){return n==null}});var Su=Z((iJ,r1)=>{"use strict";var P2=Pf(),R2=TypeError;r1.exports=function(n){if(P2(n))throw new R2("Can't call method on "+n);return n}});var Mu=Z((oJ,i1)=>{"use strict";var L2=If(),N2=Su();i1.exports=function(n){return L2(N2(n))}});var fr=Z((sJ,o1)=>{"use strict";var om=typeof document=="object"&&document.all;o1.exports=typeof om=="undefined"&&om!==void 0?function(n){return typeof n=="function"||n===om}:function(n){return typeof n=="function"}});var yi=Z((aJ,s1)=>{"use strict";var O2=fr();s1.exports=function(n){return typeof n=="object"?n!==null:O2(n)}});var bu=Z((uJ,a1)=>{"use strict";var sm=wn(),D2=fr(),F2=function(n){return D2(n)?n:void 0};a1.exports=function(n,t){return arguments.length<2?F2(sm[n]):sm[n]&&sm[n][t]}});var ac=Z((lJ,u1)=>{"use strict";var U2=Zn();u1.exports=U2({}.isPrototypeOf)});var Au=Z((cJ,f1)=>{"use strict";var B2=wn(),l1=B2.navigator,c1=l1&&l1.userAgent;f1.exports=c1?String(c1):""});var Lf=Z((fJ,y1)=>{"use strict";var g1=wn(),am=Au(),h1=g1.process,p1=g1.Deno,d1=h1&&h1.versions||p1&&p1.version,m1=d1&&d1.v8,yo,Rf;m1&&(yo=m1.split("."),Rf=yo[0]>0&&yo[0]<4?1:+(yo[0]+yo[1]));!Rf&&am&&(yo=am.match(/Edge\\/(\\d+)/),(!yo||yo[1]>=74)&&(yo=am.match(/Chrome\\/(\\d+)/),yo&&(Rf=+yo[1])));y1.exports=Rf});var um=Z((hJ,_1)=>{"use strict";var v1=Lf(),z2=Un(),G2=wn(),k2=G2.String;_1.exports=!!Object.getOwnPropertySymbols&&!z2(function(){var n=Symbol("symbol detection");return!k2(n)||!(Object(n)instanceof Symbol)||!Symbol.sham&&v1&&v1<41})});var lm=Z((pJ,x1)=>{"use strict";var q2=um();x1.exports=q2&&!Symbol.sham&&typeof Symbol.iterator=="symbol"});var Nf=Z((dJ,E1)=>{"use strict";var V2=bu(),H2=fr(),W2=ac(),X2=lm(),Y2=Object;E1.exports=X2?function(n){return typeof n=="symbol"}:function(n){var t=V2("Symbol");return H2(t)&&W2(t.prototype,Y2(n))}});var uc=Z((mJ,w1)=>{"use strict";var $2=String;w1.exports=function(n){try{return $2(n)}catch(t){return"Object"}}});var Ca=Z((gJ,S1)=>{"use strict";var Z2=fr(),J2=uc(),j2=TypeError;S1.exports=function(n){if(Z2(n))return n;throw new j2(J2(n)+" is not a function")}});var Of=Z((yJ,M1)=>{"use strict";var K2=Ca(),Q2=Pf();M1.exports=function(n,t){var e=n[t];return Q2(e)?void 0:K2(e)}});var A1=Z((vJ,b1)=>{"use strict";var cm=gi(),fm=fr(),hm=yi(),tO=TypeError;b1.exports=function(n,t){var e,i;if(t==="string"&&fm(e=n.toString)&&!hm(i=cm(e,n))||fm(e=n.valueOf)&&!hm(i=cm(e,n))||t!=="string"&&fm(e=n.toString)&&!hm(i=cm(e,n)))return i;throw new tO("Can't convert object to primitive value")}});var lc=Z((_J,T1)=>{"use strict";T1.exports=!1});var Df=Z((xJ,I1)=>{"use strict";var C1=wn(),eO=Object.defineProperty;I1.exports=function(n,t){try{eO(C1,n,{value:t,configurable:!0,writable:!0})}catch(e){C1[n]=t}return t}});var Ff=Z((EJ,L1)=>{"use strict";var nO=lc(),rO=wn(),iO=Df(),P1="__core-js_shared__",R1=L1.exports=rO[P1]||iO(P1,{});(R1.versions||(R1.versions=[])).push({version:"3.42.0",mode:nO?"pure":"global",copyright:"\\xA9 2014-2025 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.42.0/LICENSE",source:"https://github.com/zloirock/core-js"})});var Uf=Z((wJ,O1)=>{"use strict";var N1=Ff();O1.exports=function(n,t){return N1[n]||(N1[n]=t||{})}});var zo=Z((SJ,D1)=>{"use strict";var oO=Su(),sO=Object;D1.exports=function(n){return sO(oO(n))}});var to=Z((MJ,F1)=>{"use strict";var aO=Zn(),uO=zo(),lO=aO({}.hasOwnProperty);F1.exports=Object.hasOwn||function(t,e){return lO(uO(t),e)}});var Bf=Z((bJ,U1)=>{"use strict";var cO=Zn(),fO=0,hO=Math.random(),pO=cO(1 .toString);U1.exports=function(n){return"Symbol("+(n===void 0?"":n)+")_"+pO(++fO+hO,36)}});var Vr=Z((AJ,z1)=>{"use strict";var dO=wn(),mO=Uf(),B1=to(),gO=Bf(),yO=um(),vO=lm(),Tu=dO.Symbol,pm=mO("wks"),_O=vO?Tu.for||Tu:Tu&&Tu.withoutSetter||gO;z1.exports=function(n){return B1(pm,n)||(pm[n]=yO&&B1(Tu,n)?Tu[n]:_O("Symbol."+n)),pm[n]}});var dm=Z((TJ,q1)=>{"use strict";var xO=gi(),G1=yi(),k1=Nf(),EO=Of(),wO=A1(),SO=Vr(),MO=TypeError,bO=SO("toPrimitive");q1.exports=function(n,t){if(!G1(n)||k1(n))return n;var e=EO(n,bO),i;if(e){if(t===void 0&&(t="default"),i=xO(e,n,t),!G1(i)||k1(i))return i;throw new MO("Can't convert object to primitive value")}return t===void 0&&(t="number"),wO(n,t)}});var zf=Z((CJ,V1)=>{"use strict";var AO=dm(),TO=Nf();V1.exports=function(n){var t=AO(n,"string");return TO(t)?t:t+""}});var Gf=Z((IJ,W1)=>{"use strict";var CO=wn(),H1=yi(),mm=CO.document,IO=H1(mm)&&H1(mm.createElement);W1.exports=function(n){return IO?mm.createElement(n):{}}});var gm=Z((PJ,X1)=>{"use strict";var PO=ei(),RO=Un(),LO=Gf();X1.exports=!PO&&!RO(function(){return Object.defineProperty(LO("div"),"a",{get:function(){return 7}}).a!==7})});var kf=Z($1=>{"use strict";var NO=ei(),OO=gi(),DO=$x(),FO=sc(),UO=Mu(),BO=zf(),zO=to(),GO=gm(),Y1=Object.getOwnPropertyDescriptor;$1.f=NO?Y1:function(t,e){if(t=UO(t),e=BO(e),GO)try{return Y1(t,e)}catch(i){}if(zO(t,e))return FO(!OO(DO.f,t,e),t[e])}});var ym=Z((LJ,Z1)=>{"use strict";var kO=ei(),qO=Un();Z1.exports=kO&&qO(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!==42})});var Go=Z((NJ,J1)=>{"use strict";var VO=yi(),HO=String,WO=TypeError;J1.exports=function(n){if(VO(n))return n;throw new WO(HO(n)+" is not an object")}});var ko=Z(K1=>{"use strict";var XO=ei(),YO=gm(),$O=ym(),qf=Go(),j1=zf(),ZO=TypeError,vm=Object.defineProperty,JO=Object.getOwnPropertyDescriptor,_m="enumerable",xm="configurable",Em="writable";K1.f=XO?$O?function(t,e,i){if(qf(t),e=j1(e),qf(i),typeof t=="function"&&e==="prototype"&&"value"in i&&Em in i&&!i[Em]){var s=JO(t,e);s&&s[Em]&&(t[e]=i.value,i={configurable:xm in i?i[xm]:s[xm],enumerable:_m in i?i[_m]:s[_m],writable:!1})}return vm(t,e,i)}:vm:function(t,e,i){if(qf(t),e=j1(e),qf(i),YO)try{return vm(t,e,i)}catch(s){}if("get"in i||"set"in i)throw new ZO("Accessors not supported");return"value"in i&&(t[e]=i.value),t}});var hs=Z((DJ,Q1)=>{"use strict";var jO=ei(),KO=ko(),QO=sc();Q1.exports=jO?function(n,t,e){return KO.f(n,t,QO(1,e))}:function(n,t,e){return n[t]=e,n}});var Vf=Z((FJ,eE)=>{"use strict";var wm=ei(),tD=to(),tE=Function.prototype,eD=wm&&Object.getOwnPropertyDescriptor,Sm=tD(tE,"name"),nD=Sm&&function(){}.name==="something",rD=Sm&&(!wm||wm&&eD(tE,"name").configurable);eE.exports={EXISTS:Sm,PROPER:nD,CONFIGURABLE:rD}});var bm=Z((UJ,nE)=>{"use strict";var iD=Zn(),oD=fr(),Mm=Ff(),sD=iD(Function.toString);oD(Mm.inspectSource)||(Mm.inspectSource=function(n){return sD(n)});nE.exports=Mm.inspectSource});var oE=Z((BJ,iE)=>{"use strict";var aD=wn(),uD=fr(),rE=aD.WeakMap;iE.exports=uD(rE)&&/native code/.test(String(rE))});var Hf=Z((zJ,aE)=>{"use strict";var lD=Uf(),cD=Bf(),sE=lD("keys");aE.exports=function(n){return sE[n]||(sE[n]=cD(n))}});var Wf=Z((GJ,uE)=>{"use strict";uE.exports={}});var Pa=Z((kJ,fE)=>{"use strict";var fD=oE(),cE=wn(),hD=yi(),pD=hs(),Am=to(),Tm=Ff(),dD=Hf(),mD=Wf(),lE="Object already initialized",Cm=cE.TypeError,gD=cE.WeakMap,Xf,cc,Yf,yD=function(n){return Yf(n)?cc(n):Xf(n,{})},vD=function(n){return function(t){var e;if(!hD(t)||(e=cc(t)).type!==n)throw new Cm("Incompatible receiver, "+n+" required");return e}};fD||Tm.state?(vo=Tm.state||(Tm.state=new gD),vo.get=vo.get,vo.has=vo.has,vo.set=vo.set,Xf=function(n,t){if(vo.has(n))throw new Cm(lE);return t.facade=n,vo.set(n,t),t},cc=function(n){return vo.get(n)||{}},Yf=function(n){return vo.has(n)}):(Ia=dD("state"),mD[Ia]=!0,Xf=function(n,t){if(Am(n,Ia))throw new Cm(lE);return t.facade=n,pD(n,Ia,t),t},cc=function(n){return Am(n,Ia)?n[Ia]:{}},Yf=function(n){return Am(n,Ia)});var vo,Ia;fE.exports={set:Xf,get:cc,has:Yf,enforce:yD,getterFor:vD}});var Rm=Z((qJ,dE)=>{"use strict";var Pm=Zn(),_D=Un(),xD=fr(),$f=to(),Im=ei(),ED=Vf().CONFIGURABLE,wD=bm(),pE=Pa(),SD=pE.enforce,MD=pE.get,hE=String,Zf=Object.defineProperty,bD=Pm("".slice),AD=Pm("".replace),TD=Pm([].join),CD=Im&&!_D(function(){return Zf(function(){},"length",{value:8}).length!==8}),ID=String(String).split("String"),PD=dE.exports=function(n,t,e){bD(hE(t),0,7)==="Symbol("&&(t="["+AD(hE(t),/^Symbol\\(([^)]*)\\).*$/,"$1")+"]"),e&&e.getter&&(t="get "+t),e&&e.setter&&(t="set "+t),(!$f(n,"name")||ED&&n.name!==t)&&(Im?Zf(n,"name",{value:t,configurable:!0}):n.name=t),CD&&e&&$f(e,"arity")&&n.length!==e.arity&&Zf(n,"length",{value:e.arity});try{e&&$f(e,"constructor")&&e.constructor?Im&&Zf(n,"prototype",{writable:!1}):n.prototype&&(n.prototype=void 0)}catch(s){}var i=SD(n);return $f(i,"source")||(i.source=TD(ID,typeof t=="string"?t:"")),n};Function.prototype.toString=PD(function(){return xD(this)&&MD(this).source||wD(this)},"toString")});var Ra=Z((VJ,mE)=>{"use strict";var RD=fr(),LD=ko(),ND=Rm(),OD=Df();mE.exports=function(n,t,e,i){i||(i={});var s=i.enumerable,u=i.name!==void 0?i.name:t;if(RD(e)&&ND(e,u,i),i.global)s?n[t]=e:OD(t,e);else{try{i.unsafe?n[t]&&(s=!0):delete n[t]}catch(c){}s?n[t]=e:LD.f(n,t,{value:e,enumerable:!1,configurable:!i.nonConfigurable,writable:!i.nonWritable})}return n}});var yE=Z((HJ,gE)=>{"use strict";var DD=Math.ceil,FD=Math.floor;gE.exports=Math.trunc||function(t){var e=+t;return(e>0?FD:DD)(e)}});var _o=Z((WJ,vE)=>{"use strict";var UD=yE();vE.exports=function(n){var t=+n;return t!==t||t===0?0:UD(t)}});var Jf=Z((XJ,_E)=>{"use strict";var BD=_o(),zD=Math.max,GD=Math.min;_E.exports=function(n,t){var e=BD(n);return e<0?zD(e+t,0):GD(e,t)}});var La=Z((YJ,xE)=>{"use strict";var kD=_o(),qD=Math.min;xE.exports=function(n){var t=kD(n);return t>0?qD(t,9007199254740991):0}});var eo=Z(($J,EE)=>{"use strict";var VD=La();EE.exports=function(n){return VD(n.length)}});var ME=Z((ZJ,SE)=>{"use strict";var HD=Mu(),WD=Jf(),XD=eo(),wE=function(n){return function(t,e,i){var s=HD(t),u=XD(s);if(u===0)return!n&&-1;var c=WD(i,u),f;if(n&&e!==e){for(;u>c;)if(f=s[c++],f!==f)return!0}else for(;u>c;c++)if((n||c in s)&&s[c]===e)return n||c||0;return!n&&-1}};SE.exports={includes:wE(!0),indexOf:wE(!1)}});var Nm=Z((JJ,AE)=>{"use strict";var YD=Zn(),Lm=to(),$D=Mu(),ZD=ME().indexOf,JD=Wf(),bE=YD([].push);AE.exports=function(n,t){var e=$D(n),i=0,s=[],u;for(u in e)!Lm(JD,u)&&Lm(e,u)&&bE(s,u);for(;t.length>i;)Lm(e,u=t[i++])&&(~ZD(s,u)||bE(s,u));return s}});var jf=Z((jJ,TE)=>{"use strict";TE.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]});var Om=Z(CE=>{"use strict";var jD=Nm(),KD=jf(),QD=KD.concat("length","prototype");CE.f=Object.getOwnPropertyNames||function(t){return jD(t,QD)}});var PE=Z(IE=>{"use strict";IE.f=Object.getOwnPropertySymbols});var LE=Z((tj,RE)=>{"use strict";var t3=bu(),e3=Zn(),n3=Om(),r3=PE(),i3=Go(),o3=e3([].concat);RE.exports=t3("Reflect","ownKeys")||function(t){var e=n3.f(i3(t)),i=r3.f;return i?o3(e,i(t)):e}});var Dm=Z((ej,OE)=>{"use strict";var NE=to(),s3=LE(),a3=kf(),u3=ko();OE.exports=function(n,t,e){for(var i=s3(t),s=u3.f,u=a3.f,c=0;c<i.length;c++){var f=i[c];!NE(n,f)&&!(e&&NE(e,f))&&s(n,f,u(t,f))}}});var FE=Z((nj,DE)=>{"use strict";var l3=Un(),c3=fr(),f3=/#|\\.prototype\\./,fc=function(n,t){var e=p3[h3(n)];return e===m3?!0:e===d3?!1:c3(t)?l3(t):!!t},h3=fc.normalize=function(n){return String(n).replace(f3,".").toLowerCase()},p3=fc.data={},d3=fc.NATIVE="N",m3=fc.POLYFILL="P";DE.exports=fc});var qo=Z((rj,UE)=>{"use strict";var Kf=wn(),g3=kf().f,y3=hs(),v3=Ra(),_3=Df(),x3=Dm(),E3=FE();UE.exports=function(n,t){var e=n.target,i=n.global,s=n.stat,u,c,f,p,d,m;if(i?c=Kf:s?c=Kf[e]||_3(e,{}):c=Kf[e]&&Kf[e].prototype,c)for(f in t){if(d=t[f],n.dontCallGetSet?(m=g3(c,f),p=m&&m.value):p=c[f],u=E3(i?f:e+(s?".":"#")+f,n.forced),!u&&p!==void 0){if(typeof d==typeof p)continue;x3(d,p)}(n.sham||p&&p.sham)&&y3(d,"sham",!0),v3(c,f,d,n)}}});var Fm=Z((ij,BE)=>{"use strict";var w3=Gs();BE.exports=Array.isArray||function(t){return w3(t)==="Array"}});var GE=Z((oj,zE)=>{"use strict";var S3=ei(),M3=Fm(),b3=TypeError,A3=Object.getOwnPropertyDescriptor,T3=S3&&!function(){if(this!==void 0)return!0;try{Object.defineProperty([],"length",{writable:!1}).length=1}catch(n){return n instanceof TypeError}}();zE.exports=T3?function(n,t){if(M3(n)&&!A3(n,"length").writable)throw new b3("Cannot set read only .length");return n.length=t}:function(n,t){return n.length=t}});var qE=Z((sj,kE)=>{"use strict";var C3=TypeError,I3=9007199254740991;kE.exports=function(n){if(n>I3)throw C3("Maximum allowed index exceeded");return n}});var Qf=Z(()=>{"use strict";var P3=qo(),R3=zo(),L3=eo(),N3=GE(),O3=qE(),D3=Un(),F3=D3(function(){return[].push.call({length:4294967296},1)!==4294967297}),U3=function(){try{Object.defineProperty([],"length",{writable:!1}).push()}catch(n){return n instanceof TypeError}},B3=F3||!U3();P3({target:"Array",proto:!0,arity:1,forced:B3},{push:function(t){var e=R3(this),i=L3(e),s=arguments.length;O3(i+s);for(var u=0;u<s;u++)e[i]=arguments[u],i++;return N3(e,i),i}})});var YE=Z((lj,XE)=>{"use strict";var z3=Vr(),HE=z3("iterator"),WE=!1;try{VE=0,Um={next:function(){return{done:!!VE++}},return:function(){WE=!0}},Um[HE]=function(){return this},Array.from(Um,function(){throw 2})}catch(n){}var VE,Um;XE.exports=function(n,t){try{if(!t&&!WE)return!1}catch(s){return!1}var e=!1;try{var i={};i[HE]=function(){return{next:function(){return{done:e=!0}}}},n(i)}catch(s){}return e}});var th=Z((cj,$E)=>{"use strict";$E.exports=typeof ArrayBuffer!="undefined"&&typeof DataView!="undefined"});var jE=Z((fj,JE)=>{"use strict";var G3=Vr(),k3=G3("toStringTag"),ZE={};ZE[k3]="z";JE.exports=String(ZE)==="[object z]"});var ks=Z((hj,KE)=>{"use strict";var q3=jE(),V3=fr(),eh=Gs(),H3=Vr(),W3=H3("toStringTag"),X3=Object,Y3=eh(function(){return arguments}())==="Arguments",$3=function(n,t){try{return n[t]}catch(e){}};KE.exports=q3?eh:function(n){var t,e,i;return n===void 0?"Undefined":n===null?"Null":typeof(e=$3(t=X3(n),W3))=="string"?e:Y3?eh(t):(i=eh(t))==="Object"&&V3(t.callee)?"Arguments":i}});var Cu=Z((pj,tw)=>{"use strict";var QE=Rm(),Z3=ko();tw.exports=function(n,t,e){return e.get&&QE(e.get,t,{getter:!0}),e.set&&QE(e.set,t,{setter:!0}),Z3.f(n,t,e)}});var nw=Z((dj,ew)=>{"use strict";var J3=Un();ew.exports=!J3(function(){function n(){}return n.prototype.constructor=null,Object.getPrototypeOf(new n)!==n.prototype})});var hc=Z((mj,iw)=>{"use strict";var j3=to(),K3=fr(),Q3=zo(),tF=Hf(),eF=nw(),rw=tF("IE_PROTO"),Bm=Object,nF=Bm.prototype;iw.exports=eF?Bm.getPrototypeOf:function(n){var t=Q3(n);if(j3(t,rw))return t[rw];var e=t.constructor;return K3(e)&&t instanceof e?e.prototype:t instanceof Bm?nF:null}});var nh=Z((gj,ow)=>{"use strict";var rF=Zn(),iF=Ca();ow.exports=function(n,t,e){try{return rF(iF(Object.getOwnPropertyDescriptor(n,t)[e]))}catch(i){}}});var aw=Z((yj,sw)=>{"use strict";var oF=yi();sw.exports=function(n){return oF(n)||n===null}});var lw=Z((vj,uw)=>{"use strict";var sF=aw(),aF=String,uF=TypeError;uw.exports=function(n){if(sF(n))return n;throw new uF("Can't set "+aF(n)+" as a prototype")}});var Iu=Z((_j,cw)=>{"use strict";var lF=nh(),cF=yi(),fF=Su(),hF=lw();cw.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var n=!1,t={},e;try{e=lF(Object.prototype,"__proto__","set"),e(t,[]),n=t instanceof Array}catch(i){}return function(s,u){return fF(s),hF(u),cF(s)&&(n?e(s,u):s.__proto__=u),s}}():void 0)});var Gi=Z((xj,xw)=>{"use strict";var pF=th(),qm=ei(),vi=wn(),dw=fr(),oh=yi(),Vs=to(),Vm=ks(),dF=uc(),mF=hs(),zm=Ra(),gF=Cu(),yF=ac(),sh=hc(),Ru=Iu(),vF=Vr(),_F=Bf(),mw=Pa(),gw=mw.enforce,xF=mw.get,rh=vi.Int8Array,Gm=rh&&rh.prototype,fw=vi.Uint8ClampedArray,hw=fw&&fw.prototype,Vo=rh&&sh(rh),xo=Gm&&sh(Gm),EF=Object.prototype,Hm=vi.TypeError,pw=vF("toStringTag"),km=_F("TYPED_ARRAY_TAG"),ih="TypedArrayConstructor",ps=pF&&!!Ru&&Vm(vi.opera)!=="Opera",yw=!1,Ci,qs,Pu,ds={Int8Array:1,Uint8Array:1,Uint8ClampedArray:1,Int16Array:2,Uint16Array:2,Int32Array:4,Uint32Array:4,Float32Array:4,Float64Array:8},Wm={BigInt64Array:8,BigUint64Array:8},wF=function(t){if(!oh(t))return!1;var e=Vm(t);return e==="DataView"||Vs(ds,e)||Vs(Wm,e)},vw=function(n){var t=sh(n);if(oh(t)){var e=xF(t);return e&&Vs(e,ih)?e[ih]:vw(t)}},_w=function(n){if(!oh(n))return!1;var t=Vm(n);return Vs(ds,t)||Vs(Wm,t)},SF=function(n){if(_w(n))return n;throw new Hm("Target is not a typed array")},MF=function(n){if(dw(n)&&(!Ru||yF(Vo,n)))return n;throw new Hm(dF(n)+" is not a typed array constructor")},bF=function(n,t,e,i){if(qm){if(e)for(var s in ds){var u=vi[s];if(u&&Vs(u.prototype,n))try{delete u.prototype[n]}catch(c){try{u.prototype[n]=t}catch(f){}}}(!xo[n]||e)&&zm(xo,n,e?t:ps&&Gm[n]||t,i)}},AF=function(n,t,e){var i,s;if(qm){if(Ru){if(e){for(i in ds)if(s=vi[i],s&&Vs(s,n))try{delete s[n]}catch(u){}}if(!Vo[n]||e)try{return zm(Vo,n,e?t:ps&&Vo[n]||t)}catch(u){}else return}for(i in ds)s=vi[i],s&&(!s[n]||e)&&zm(s,n,t)}};for(Ci in ds)qs=vi[Ci],Pu=qs&&qs.prototype,Pu?gw(Pu)[ih]=qs:ps=!1;for(Ci in Wm)qs=vi[Ci],Pu=qs&&qs.prototype,Pu&&(gw(Pu)[ih]=qs);if((!ps||!dw(Vo)||Vo===Function.prototype)&&(Vo=function(){throw new Hm("Incorrect invocation")},ps))for(Ci in ds)vi[Ci]&&Ru(vi[Ci],Vo);if((!ps||!xo||xo===EF)&&(xo=Vo.prototype,ps))for(Ci in ds)vi[Ci]&&Ru(vi[Ci].prototype,xo);ps&&sh(hw)!==xo&&Ru(hw,xo);if(qm&&!Vs(xo,pw)){yw=!0,gF(xo,pw,{configurable:!0,get:function(){return oh(this)?this[km]:void 0}});for(Ci in ds)vi[Ci]&&mF(vi[Ci],km,Ci)}xw.exports={NATIVE_ARRAY_BUFFER_VIEWS:ps,TYPED_ARRAY_TAG:yw&&km,aTypedArray:SF,aTypedArrayConstructor:MF,exportTypedArrayMethod:bF,exportTypedArrayStaticMethod:AF,getTypedArrayConstructor:vw,isView:wF,isTypedArray:_w,TypedArray:Vo,TypedArrayPrototype:xo}});var Sw=Z((Ej,ww)=>{"use strict";var Ew=wn(),Xm=Un(),TF=YE(),CF=Gi().NATIVE_ARRAY_BUFFER_VIEWS,IF=Ew.ArrayBuffer,Na=Ew.Int8Array;ww.exports=!CF||!Xm(function(){Na(1)})||!Xm(function(){new Na(-1)})||!TF(function(n){new Na,new Na(null),new Na(1.5),new Na(n)},!0)||Xm(function(){return new Na(new IF(2),1,void 0).length!==1})});var bw=Z((wj,Mw)=>{"use strict";var PF=Ra();Mw.exports=function(n,t,e){for(var i in t)PF(n,i,t[i],e);return n}});var Ym=Z((Sj,Aw)=>{"use strict";var RF=ac(),LF=TypeError;Aw.exports=function(n,t){if(RF(t,n))return n;throw new LF("Incorrect invocation")}});var ah=Z((Mj,Tw)=>{"use strict";var NF=_o(),OF=La(),DF=RangeError;Tw.exports=function(n){if(n===void 0)return 0;var t=NF(n),e=OF(t);if(t!==e)throw new DF("Wrong length or index");return e}});var Iw=Z((bj,Cw)=>{"use strict";Cw.exports=Math.sign||function(t){var e=+t;return e===0||e!==e?e:e<0?-1:1}});var Lw=Z((Aj,Rw)=>{"use strict";var FF=2220446049250313e-31,Pw=1/FF;Rw.exports=function(n){return n+Pw-Pw}});var Ow=Z((Tj,Nw)=>{"use strict";var UF=Iw(),BF=Lw(),zF=Math.abs,GF=2220446049250313e-31;Nw.exports=function(n,t,e,i){var s=+n,u=zF(s),c=UF(s);if(u<i)return c*BF(u/i/t)*i*t;var f=(1+t/GF)*u,p=f-(f-u);return p>e||p!==p?c*(1/0):c*p}});var Fw=Z((Cj,Dw)=>{"use strict";var kF=Ow(),qF=11920928955078125e-23,VF=34028234663852886e22,HF=11754943508222875e-54;Dw.exports=Math.fround||function(t){return kF(t,qF,VF,HF)}});var Bw=Z((Ij,Uw)=>{"use strict";var WF=Array,XF=Math.abs,ms=Math.pow,YF=Math.floor,$F=Math.log,ZF=Math.LN2,JF=function(n,t,e){var i=WF(e),s=e*8-t-1,u=(1<<s)-1,c=u>>1,f=t===23?ms(2,-24)-ms(2,-77):0,p=n<0||n===0&&1/n<0?1:0,d=0,m,y,v;for(n=XF(n),n!==n||n===1/0?(y=n!==n?1:0,m=u):(m=YF($F(n)/ZF),v=ms(2,-m),n*v<1&&(m--,v*=2),m+c>=1?n+=f/v:n+=f*ms(2,1-c),n*v>=2&&(m++,v/=2),m+c>=u?(y=0,m=u):m+c>=1?(y=(n*v-1)*ms(2,t),m+=c):(y=n*ms(2,c-1)*ms(2,t),m=0));t>=8;)i[d++]=y&255,y/=256,t-=8;for(m=m<<t|y,s+=t;s>0;)i[d++]=m&255,m/=256,s-=8;return i[d-1]|=p*128,i},jF=function(n,t){var e=n.length,i=e*8-t-1,s=(1<<i)-1,u=s>>1,c=i-7,f=e-1,p=n[f--],d=p&127,m;for(p>>=7;c>0;)d=d*256+n[f--],c-=8;for(m=d&(1<<-c)-1,d>>=-c,c+=t;c>0;)m=m*256+n[f--],c-=8;if(d===0)d=1-u;else{if(d===s)return m?NaN:p?-1/0:1/0;m+=ms(2,t),d-=u}return(p?-1:1)*m*ms(2,d-t)};Uw.exports={pack:JF,unpack:jF}});var $m=Z((Pj,Gw)=>{"use strict";var KF=zo(),zw=Jf(),QF=eo();Gw.exports=function(t){for(var e=KF(this),i=QF(e),s=arguments.length,u=zw(s>1?arguments[1]:void 0,i),c=s>2?arguments[2]:void 0,f=c===void 0?i:zw(c,i);f>u;)e[u++]=t;return e}});var Zm=Z((Rj,kw)=>{"use strict";var tU=Zn();kw.exports=tU([].slice)});var Jm=Z((Lj,Vw)=>{"use strict";var eU=fr(),nU=yi(),qw=Iu();Vw.exports=function(n,t,e){var i,s;return qw&&eU(i=t.constructor)&&i!==e&&nU(s=i.prototype)&&s!==e.prototype&&qw(n,s),n}});var pc=Z((Nj,Ww)=>{"use strict";var rU=ko().f,iU=to(),oU=Vr(),Hw=oU("toStringTag");Ww.exports=function(n,t,e){n&&!e&&(n=n.prototype),n&&!iU(n,Hw)&&rU(n,Hw,{configurable:!0,value:t})}});var dh=Z((Oj,uS)=>{"use strict";var hh=wn(),eg=Zn(),jm=ei(),sU=th(),rS=Vf(),aU=hs(),uU=Cu(),Xw=bw(),Km=Un(),uh=Ym(),lU=_o(),cU=La(),ch=ah(),fU=Fw(),iS=Bw(),hU=hc(),Yw=Iu(),pU=$m(),dU=Zm(),mU=Jm(),gU=Dm(),oS=pc(),ng=Pa(),yU=rS.PROPER,$w=rS.CONFIGURABLE,Nu="ArrayBuffer",ph="DataView",Ou="prototype",vU="Wrong length",sS="Wrong index",Zw=ng.getterFor(Nu),mc=ng.getterFor(ph),Jw=ng.set,Eo=hh[Nu],ki=Eo,Lu=ki&&ki[Ou],Ho=hh[ph],Oa=Ho&&Ho[Ou],jw=Object.prototype,_U=hh.Array,fh=hh.RangeError,xU=eg(pU),EU=eg([].reverse),aS=iS.pack,Kw=iS.unpack,Qw=function(n){return[n&255]},tS=function(n){return[n&255,n>>8&255]},eS=function(n){return[n&255,n>>8&255,n>>16&255,n>>24&255]},nS=function(n){return n[3]<<24|n[2]<<16|n[1]<<8|n[0]},wU=function(n){return aS(fU(n),23,4)},SU=function(n){return aS(n,52,8)},lh=function(n,t,e){uU(n[Ou],t,{configurable:!0,get:function(){return e(this)[t]}})},Hs=function(n,t,e,i){var s=mc(n),u=ch(e),c=!!i;if(u+t>s.byteLength)throw new fh(sS);var f=s.bytes,p=u+s.byteOffset,d=dU(f,p,p+t);return c?d:EU(d)},Ws=function(n,t,e,i,s,u){var c=mc(n),f=ch(e),p=i(+s),d=!!u;if(f+t>c.byteLength)throw new fh(sS);for(var m=c.bytes,y=f+c.byteOffset,v=0;v<t;v++)m[y+v]=p[d?v:t-v-1]};sU?(Qm=yU&&Eo.name!==Nu,!Km(function(){Eo(1)})||!Km(function(){new Eo(-1)})||Km(function(){return new Eo,new Eo(1.5),new Eo(NaN),Eo.length!==1||Qm&&!$w})?(ki=function(t){return uh(this,Lu),mU(new Eo(ch(t)),this,ki)},ki[Ou]=Lu,Lu.constructor=ki,gU(ki,Eo)):Qm&&$w&&aU(Eo,"name",Nu),Yw&&hU(Oa)!==jw&&Yw(Oa,jw),dc=new Ho(new ki(2)),tg=eg(Oa.setInt8),dc.setInt8(0,2147483648),dc.setInt8(1,2147483649),(dc.getInt8(0)||!dc.getInt8(1))&&Xw(Oa,{setInt8:function(t,e){tg(this,t,e<<24>>24)},setUint8:function(t,e){tg(this,t,e<<24>>24)}},{unsafe:!0})):(ki=function(t){uh(this,Lu);var e=ch(t);Jw(this,{type:Nu,bytes:xU(_U(e),0),byteLength:e}),jm||(this.byteLength=e,this.detached=!1)},Lu=ki[Ou],Ho=function(t,e,i){uh(this,Oa),uh(t,Lu);var s=Zw(t),u=s.byteLength,c=lU(e);if(c<0||c>u)throw new fh("Wrong offset");if(i=i===void 0?u-c:cU(i),c+i>u)throw new fh(vU);Jw(this,{type:ph,buffer:t,byteLength:i,byteOffset:c,bytes:s.bytes}),jm||(this.buffer=t,this.byteLength=i,this.byteOffset=c)},Oa=Ho[Ou],jm&&(lh(ki,"byteLength",Zw),lh(Ho,"buffer",mc),lh(Ho,"byteLength",mc),lh(Ho,"byteOffset",mc)),Xw(Oa,{getInt8:function(t){return Hs(this,1,t)[0]<<24>>24},getUint8:function(t){return Hs(this,1,t)[0]},getInt16:function(t){var e=Hs(this,2,t,arguments.length>1?arguments[1]:!1);return(e[1]<<8|e[0])<<16>>16},getUint16:function(t){var e=Hs(this,2,t,arguments.length>1?arguments[1]:!1);return e[1]<<8|e[0]},getInt32:function(t){return nS(Hs(this,4,t,arguments.length>1?arguments[1]:!1))},getUint32:function(t){return nS(Hs(this,4,t,arguments.length>1?arguments[1]:!1))>>>0},getFloat32:function(t){return Kw(Hs(this,4,t,arguments.length>1?arguments[1]:!1),23)},getFloat64:function(t){return Kw(Hs(this,8,t,arguments.length>1?arguments[1]:!1),52)},setInt8:function(t,e){Ws(this,1,t,Qw,e)},setUint8:function(t,e){Ws(this,1,t,Qw,e)},setInt16:function(t,e){Ws(this,2,t,tS,e,arguments.length>2?arguments[2]:!1)},setUint16:function(t,e){Ws(this,2,t,tS,e,arguments.length>2?arguments[2]:!1)},setInt32:function(t,e){Ws(this,4,t,eS,e,arguments.length>2?arguments[2]:!1)},setUint32:function(t,e){Ws(this,4,t,eS,e,arguments.length>2?arguments[2]:!1)},setFloat32:function(t,e){Ws(this,4,t,wU,e,arguments.length>2?arguments[2]:!1)},setFloat64:function(t,e){Ws(this,8,t,SU,e,arguments.length>2?arguments[2]:!1)}}));var Qm,dc,tg;oS(ki,Nu);oS(Ho,ph);uS.exports={ArrayBuffer:ki,DataView:Ho}});var cS=Z((Dj,lS)=>{"use strict";var MU=yi(),bU=Math.floor;lS.exports=Number.isInteger||function(t){return!MU(t)&&isFinite(t)&&bU(t)===t}});var hS=Z((Fj,fS)=>{"use strict";var AU=_o(),TU=RangeError;fS.exports=function(n){var t=AU(n);if(t<0)throw new TU("The argument can't be less than 0");return t}});var rg=Z((Uj,pS)=>{"use strict";var CU=hS(),IU=RangeError;pS.exports=function(n,t){var e=CU(n);if(e%t)throw new IU("Wrong offset");return e}});var mS=Z((Bj,dS)=>{"use strict";var PU=Math.round;dS.exports=function(n){var t=PU(n);return t<0?0:t>255?255:t&255}});var yS=Z((zj,gS)=>{"use strict";var RU=Nm(),LU=jf();gS.exports=Object.keys||function(t){return RU(t,LU)}});var _S=Z(vS=>{"use strict";var NU=ei(),OU=ym(),DU=ko(),FU=Go(),UU=Mu(),BU=yS();vS.f=NU&&!OU?Object.defineProperties:function(t,e){FU(t);for(var i=UU(e),s=BU(e),u=s.length,c=0,f;u>c;)DU.f(t,f=s[c++],i[f]);return t}});var ES=Z((kj,xS)=>{"use strict";var zU=bu();xS.exports=zU("document","documentElement")});var Du=Z((qj,CS)=>{"use strict";var GU=Go(),kU=_S(),wS=jf(),qU=Wf(),VU=ES(),HU=Gf(),WU=Hf(),SS=">",MS="<",og="prototype",sg="script",AS=WU("IE_PROTO"),ig=function(){},TS=function(n){return MS+sg+SS+n+MS+"/"+sg+SS},bS=function(n){n.write(TS("")),n.close();var t=n.parentWindow.Object;return n=null,t},XU=function(){var n=HU("iframe"),t="java"+sg+":",e;return n.style.display="none",VU.appendChild(n),n.src=String(t),e=n.contentWindow.document,e.open(),e.write(TS("document.F=Object")),e.close(),e.F},mh,gh=function(){try{mh=new ActiveXObject("htmlfile")}catch(t){}gh=typeof document!="undefined"?document.domain&&mh?bS(mh):XU():bS(mh);for(var n=wS.length;n--;)delete gh[og][wS[n]];return gh()};qU[AS]=!0;CS.exports=Object.create||function(t,e){var i;return t!==null?(ig[og]=GU(t),i=new ig,ig[og]=null,i[AS]=t):i=gh(),e===void 0?i:kU.f(i,e)}});var yh=Z((Vj,IS)=>{"use strict";var YU=Gs(),$U=Zn();IS.exports=function(n){if(YU(n)==="Function")return $U(n)}});var vh=Z((Hj,RS)=>{"use strict";var PS=yh(),ZU=Ca(),JU=oc(),jU=PS(PS.bind);RS.exports=function(n,t){return ZU(n),t===void 0?n:JU?jU(n,t):function(){return n.apply(t,arguments)}}});var ug=Z((Wj,FS)=>{"use strict";var KU=Zn(),QU=Un(),LS=fr(),tB=ks(),eB=bu(),nB=bm(),NS=function(){},OS=eB("Reflect","construct"),ag=/^\\s*(?:class|function)\\b/,rB=KU(ag.exec),iB=!ag.test(NS),gc=function(t){if(!LS(t))return!1;try{return OS(NS,[],t),!0}catch(e){return!1}},DS=function(t){if(!LS(t))return!1;switch(tB(t)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return iB||!!rB(ag,nB(t))}catch(e){return!0}};DS.sham=!0;FS.exports=!OS||QU(function(){var n;return gc(gc.call)||!gc(Object)||!gc(function(){n=!0})||n})?DS:gc});var BS=Z((Xj,US)=>{"use strict";var oB=ug(),sB=uc(),aB=TypeError;US.exports=function(n){if(oB(n))return n;throw new aB(sB(n)+" is not a constructor")}});var Fu=Z((Yj,zS)=>{"use strict";zS.exports={}});var lg=Z(($j,kS)=>{"use strict";var uB=ks(),GS=Of(),lB=Pf(),cB=Fu(),fB=Vr(),hB=fB("iterator");kS.exports=function(n){if(!lB(n))return GS(n,hB)||GS(n,"@@iterator")||cB[uB(n)]}});var VS=Z((Zj,qS)=>{"use strict";var pB=gi(),dB=Ca(),mB=Go(),gB=uc(),yB=lg(),vB=TypeError;qS.exports=function(n,t){var e=arguments.length<2?yB(n):t;if(dB(e))return mB(pB(e,n));throw new vB(gB(n)+" is not iterable")}});var WS=Z((Jj,HS)=>{"use strict";var _B=Vr(),xB=Fu(),EB=_B("iterator"),wB=Array.prototype;HS.exports=function(n){return n!==void 0&&(xB.Array===n||wB[EB]===n)}});var cg=Z((jj,XS)=>{"use strict";var SB=ks();XS.exports=function(n){var t=SB(n);return t==="BigInt64Array"||t==="BigUint64Array"}});var _h=Z((Kj,YS)=>{"use strict";var MB=dm(),bB=TypeError;YS.exports=function(n){var t=MB(n,"number");if(typeof t=="number")throw new bB("Can't convert number to bigint");return BigInt(t)}});var ZS=Z((Qj,$S)=>{"use strict";var AB=vh(),TB=gi(),CB=BS(),IB=zo(),PB=eo(),RB=VS(),LB=lg(),NB=WS(),OB=cg(),DB=Gi().aTypedArrayConstructor,FB=_h();$S.exports=function(t){var e=CB(this),i=IB(t),s=arguments.length,u=s>1?arguments[1]:void 0,c=u!==void 0,f=LB(i),p,d,m,y,v,E,M,A;if(f&&!NB(f))for(M=RB(i,f),A=M.next,i=[];!(E=TB(A,M)).done;)i.push(E.value);for(c&&s>2&&(u=AB(u,arguments[2])),d=PB(i),m=new(DB(e))(d),y=OB(m),p=0;d>p;p++)v=c?u(i[p],p):i[p],m[p]=y?FB(v):+v;return m}});var QS=Z((tK,KS)=>{"use strict";var JS=Fm(),UB=ug(),BB=yi(),zB=Vr(),GB=zB("species"),jS=Array;KS.exports=function(n){var t;return JS(n)&&(t=n.constructor,UB(t)&&(t===jS||JS(t.prototype))?t=void 0:BB(t)&&(t=t[GB],t===null&&(t=void 0))),t===void 0?jS:t}});var eM=Z((eK,tM)=>{"use strict";var kB=QS();tM.exports=function(n,t){return new(kB(n))(t===0?0:t)}});var iM=Z((nK,rM)=>{"use strict";var qB=vh(),VB=Zn(),HB=If(),WB=zo(),XB=eo(),YB=eM(),nM=VB([].push),Xs=function(n){var t=n===1,e=n===2,i=n===3,s=n===4,u=n===6,c=n===7,f=n===5||u;return function(p,d,m,y){for(var v=WB(p),E=HB(v),M=XB(E),A=qB(d,m),_=0,x=y||YB,T=t?x(p,M):e||c?x(p,0):void 0,S,R;M>_;_++)if((f||_ in E)&&(S=E[_],R=A(S,_,v),n))if(t)T[_]=R;else if(R)switch(n){case 3:return!0;case 5:return S;case 6:return _;case 2:nM(T,S)}else switch(n){case 4:return!1;case 7:nM(T,S)}return u?-1:i||s?s:T}};rM.exports={forEach:Xs(0),map:Xs(1),filter:Xs(2),some:Xs(3),every:Xs(4),find:Xs(5),findIndex:Xs(6),filterReject:Xs(7)}});var fg=Z((rK,sM)=>{"use strict";var $B=bu(),ZB=Cu(),JB=Vr(),jB=ei(),oM=JB("species");sM.exports=function(n){var t=$B(n);jB&&t&&!t[oM]&&ZB(t,oM,{configurable:!0,get:function(){return this}})}});var hg=Z((iK,aM)=>{"use strict";var KB=eo();aM.exports=function(n,t,e){for(var i=0,s=arguments.length>2?e:KB(t),u=new n(s);s>i;)u[i]=t[i++];return u}});var TM=Z((oK,_g)=>{"use strict";var uM=qo(),_M=wn(),lM=gi(),QB=ei(),tz=Sw(),xc=Gi(),xM=dh(),cM=Ym(),ez=sc(),yc=hs(),nz=cS(),rz=La(),fM=ah(),pg=rg(),iz=mS(),EM=zf(),vc=to(),oz=ks(),gg=yi(),sz=Nf(),az=Du(),uz=ac(),xh=Iu(),lz=Om().f,hM=ZS(),cz=iM().forEach,fz=fg(),hz=Cu(),wM=ko(),SM=kf(),pM=hg(),xg=Pa(),pz=Jm(),yg=xg.get,dz=xg.set,mz=xg.enforce,MM=wM.f,gz=SM.f,dg=_M.RangeError,bM=xM.ArrayBuffer,yz=bM.prototype,vz=xM.DataView,Eh=xc.NATIVE_ARRAY_BUFFER_VIEWS,dM=xc.TYPED_ARRAY_TAG,mM=xc.TypedArray,_c=xc.TypedArrayPrototype,vg=xc.isTypedArray,wh="BYTES_PER_ELEMENT",mg="Wrong length",Sh=function(n,t){hz(n,t,{configurable:!0,get:function(){return yg(this)[t]}})},gM=function(n){var t;return uz(yz,n)||(t=oz(n))==="ArrayBuffer"||t==="SharedArrayBuffer"},AM=function(n,t){return vg(n)&&!sz(t)&&t in n&&nz(+t)&&t>=0},yM=function(t,e){return e=EM(e),AM(t,e)?ez(2,t[e]):gz(t,e)},vM=function(t,e,i){return e=EM(e),AM(t,e)&&gg(i)&&vc(i,"value")&&!vc(i,"get")&&!vc(i,"set")&&!i.configurable&&(!vc(i,"writable")||i.writable)&&(!vc(i,"enumerable")||i.enumerable)?(t[e]=i.value,t):MM(t,e,i)};QB?(Eh||(SM.f=yM,wM.f=vM,Sh(_c,"buffer"),Sh(_c,"byteOffset"),Sh(_c,"byteLength"),Sh(_c,"length")),uM({target:"Object",stat:!0,forced:!Eh},{getOwnPropertyDescriptor:yM,defineProperty:vM}),_g.exports=function(n,t,e){var i=n.match(/\\d+/)[0]/8,s=n+(e?"Clamped":"")+"Array",u="get"+n,c="set"+n,f=_M[s],p=f,d=p&&p.prototype,m={},y=function(A,_){var x=yg(A);return x.view[u](_*i+x.byteOffset,!0)},v=function(A,_,x){var T=yg(A);T.view[c](_*i+T.byteOffset,e?iz(x):x,!0)},E=function(A,_){MM(A,_,{get:function(){return y(this,_)},set:function(x){return v(this,_,x)},enumerable:!0})};Eh?tz&&(p=t(function(A,_,x,T){return cM(A,d),pz(function(){return gg(_)?gM(_)?T!==void 0?new f(_,pg(x,i),T):x!==void 0?new f(_,pg(x,i)):new f(_):vg(_)?pM(p,_):lM(hM,p,_):new f(fM(_))}(),A,p)}),xh&&xh(p,mM),cz(lz(f),function(A){A in p||yc(p,A,f[A])}),p.prototype=d):(p=t(function(A,_,x,T){cM(A,d);var S=0,R=0,z,U,D;if(!gg(_))D=fM(_),U=D*i,z=new bM(U);else if(gM(_)){z=_,R=pg(x,i);var P=_.byteLength;if(T===void 0){if(P%i)throw new dg(mg);if(U=P-R,U<0)throw new dg(mg)}else if(U=rz(T)*i,U+R>P)throw new dg(mg);D=U/i}else return vg(_)?pM(p,_):lM(hM,p,_);for(dz(A,{buffer:z,byteOffset:R,byteLength:U,length:D,view:new vz(z)});S<D;)E(A,S++)}),xh&&xh(p,mM),d=p.prototype=az(_c)),d.constructor!==p&&yc(d,"constructor",p),mz(d).TypedArrayConstructor=p,dM&&yc(d,dM,s);var M=p!==f;m[s]=p,uM({global:!0,constructor:!0,forced:M,sham:!Eh},m),wh in p||yc(p,wh,i),wh in d||yc(d,wh,i),fz(s)}):_g.exports=function(){}});var Eg=Z(()=>{"use strict";var _z=TM();_z("Float32",function(n){return function(e,i,s){return n(this,e,i,s)}})});var wg=Z(()=>{"use strict";var CM=Gi(),xz=eo(),Ez=_o(),wz=CM.aTypedArray,Sz=CM.exportTypedArrayMethod;Sz("at",function(t){var e=wz(this),i=xz(e),s=Ez(t),u=s>=0?s:i+s;return u<0||u>=i?void 0:e[u]})});var Sg=Z(()=>{"use strict";var IM=Gi(),Mz=$m(),bz=_h(),Az=ks(),Tz=gi(),Cz=Zn(),Iz=Un(),Pz=IM.aTypedArray,Rz=IM.exportTypedArrayMethod,Lz=Cz("".slice),Nz=Iz(function(){var n=0;return new Int8Array(2).fill({valueOf:function(){return n++}}),n!==1});Rz("fill",function(t){var e=arguments.length;Pz(this);var i=Lz(Az(this),0,3)==="Big"?bz(t):+t;return Tz(Mz,this,i,e>1?arguments[1]:void 0,e>2?arguments[2]:void 0)},Nz)});var Mg=Z((hK,RM)=>{"use strict";var Oz=vh(),Dz=If(),Fz=zo(),Uz=eo(),PM=function(n){var t=n===1;return function(e,i,s){for(var u=Fz(e),c=Dz(u),f=Uz(c),p=Oz(i,s),d,m;f-- >0;)if(d=c[f],m=p(d,f,u),m)switch(n){case 0:return d;case 1:return f}return t?-1:void 0}};RM.exports={findLast:PM(0),findLastIndex:PM(1)}});var bg=Z(()=>{"use strict";var LM=Gi(),Bz=Mg().findLast,zz=LM.aTypedArray,Gz=LM.exportTypedArrayMethod;Gz("findLast",function(t){return Bz(zz(this),t,arguments.length>1?arguments[1]:void 0)})});var Ag=Z(()=>{"use strict";var NM=Gi(),kz=Mg().findLastIndex,qz=NM.aTypedArray,Vz=NM.exportTypedArrayMethod;Vz("findLastIndex",function(t){return kz(qz(this),t,arguments.length>1?arguments[1]:void 0)})});var Pg=Z(()=>{"use strict";var DM=wn(),FM=gi(),Ig=Gi(),Hz=eo(),Wz=rg(),Xz=zo(),UM=Un(),Yz=DM.RangeError,Tg=DM.Int8Array,OM=Tg&&Tg.prototype,BM=OM&&OM.set,$z=Ig.aTypedArray,Zz=Ig.exportTypedArrayMethod,Cg=!UM(function(){var n=new Uint8ClampedArray(2);return FM(BM,n,{length:1,0:3},1),n[1]!==3}),Jz=Cg&&Ig.NATIVE_ARRAY_BUFFER_VIEWS&&UM(function(){var n=new Tg(2);return n.set(1),n.set("2",1),n[0]!==0||n[1]!==2});Zz("set",function(t){$z(this);var e=Wz(arguments.length>1?arguments[1]:void 0,1),i=Xz(t);if(Cg)return FM(BM,this,i,e);var s=this.length,u=Hz(i),c=0;if(u+e>s)throw new Yz("Wrong length");for(;c<u;)this[e+c]=i[c++]},!Cg||Jz)});var kM=Z((_K,GM)=>{"use strict";var zM=Zm(),jz=Math.floor,Rg=function(n,t){var e=n.length;if(e<8)for(var i=1,s,u;i<e;){for(u=i,s=n[i];u&&t(n[u-1],s)>0;)n[u]=n[--u];u!==i++&&(n[u]=s)}else for(var c=jz(e/2),f=Rg(zM(n,0,c),t),p=Rg(zM(n,c),t),d=f.length,m=p.length,y=0,v=0;y<d||v<m;)n[y+v]=y<d&&v<m?t(f[y],p[v])<=0?f[y++]:p[v++]:y<d?f[y++]:p[v++];return n};GM.exports=Rg});var HM=Z((xK,VM)=>{"use strict";var Kz=Au(),qM=Kz.match(/firefox\\/(\\d+)/i);VM.exports=!!qM&&+qM[1]});var XM=Z((EK,WM)=>{"use strict";var Qz=Au();WM.exports=/MSIE|Trident/.test(Qz)});var ZM=Z((wK,$M)=>{"use strict";var tG=Au(),YM=tG.match(/AppleWebKit\\/(\\d+)\\./);$M.exports=!!YM&&+YM[1]});var Ng=Z(()=>{"use strict";var eG=wn(),nG=yh(),Lg=Un(),rG=Ca(),iG=kM(),tb=Gi(),JM=HM(),oG=XM(),jM=Lf(),KM=ZM(),sG=tb.aTypedArray,aG=tb.exportTypedArrayMethod,Ec=eG.Uint16Array,Uu=Ec&&nG(Ec.prototype.sort),uG=!!Uu&&!(Lg(function(){Uu(new Ec(2),null)})&&Lg(function(){Uu(new Ec(2),{})})),QM=!!Uu&&!Lg(function(){if(jM)return jM<74;if(JM)return JM<67;if(oG)return!0;if(KM)return KM<602;var n=new Ec(516),t=Array(516),e,i;for(e=0;e<516;e++)i=e%4,n[e]=515-e,t[e]=e-2*i+3;for(Uu(n,function(s,u){return(s/4|0)-(u/4|0)}),e=0;e<516;e++)if(n[e]!==t[e])return!0}),lG=function(n){return function(t,e){return n!==void 0?+n(t,e)||0:e!==e?-1:t!==t?1:t===0&&e===0?1/t>0&&1/e<0?1:-1:t>e}};aG("sort",function(t){return t!==void 0&&rG(t),QM?Uu(this,t):iG(sG(this),lG(t))},!QM||uG)});var nb=Z((bK,eb)=>{"use strict";var cG=eo();eb.exports=function(n,t){for(var e=cG(n),i=new t(e),s=0;s<e;s++)i[s]=n[e-s-1];return i}});var Dg=Z(()=>{"use strict";var fG=nb(),Og=Gi(),hG=Og.aTypedArray,pG=Og.exportTypedArrayMethod,dG=Og.getTypedArrayConstructor;pG("toReversed",function(){return fG(hG(this),dG(this))})});var Fg=Z(()=>{"use strict";var Mh=Gi(),mG=Zn(),gG=Ca(),yG=hg(),vG=Mh.aTypedArray,_G=Mh.getTypedArrayConstructor,xG=Mh.exportTypedArrayMethod,EG=mG(Mh.TypedArrayPrototype.sort);xG("toSorted",function(t){t!==void 0&&gG(t);var e=vG(this),i=yG(_G(e),e);return EG(i,t)})});var ib=Z((PK,rb)=>{"use strict";var wG=eo(),SG=_o(),MG=RangeError;rb.exports=function(n,t,e,i){var s=wG(n),u=SG(e),c=u<0?s+u:u;if(c>=s||c<0)throw new MG("Incorrect index");for(var f=new t(s),p=0;p<s;p++)f[p]=p===c?i:n[p];return f}});var Bg=Z(()=>{"use strict";var bG=ib(),Ug=Gi(),AG=cg(),TG=_o(),CG=_h(),IG=Ug.aTypedArray,PG=Ug.getTypedArrayConstructor,RG=Ug.exportTypedArrayMethod,LG=!!function(){try{new Int8Array(1).with(2,{valueOf:function(){throw 8}})}catch(n){return n===8}}();RG("with",function(n,t){var e=IG(this),i=TG(n),s=AG(e)?CG(t):+t;return bG(e,PG(e),i,s)},!LG)});var Gg=Z(()=>{"use strict";var NG=qo(),OG=wn(),DG=dh(),FG=fg(),zg="ArrayBuffer",ob=DG[zg],UG=OG[zg];NG({global:!0,constructor:!0,forced:UG!==ob},{ArrayBuffer:ob});FG(zg)});var Hg=Z(()=>{"use strict";var BG=qo(),qg=yh(),zG=Un(),lb=dh(),sb=Go(),ab=Jf(),GG=La(),Vg=lb.ArrayBuffer,kg=lb.DataView,cb=kg.prototype,ub=qg(Vg.prototype.slice),kG=qg(cb.getUint8),qG=qg(cb.setUint8),VG=zG(function(){return!new Vg(2).slice(1,void 0).byteLength});BG({target:"ArrayBuffer",proto:!0,unsafe:!0,forced:VG},{slice:function(t,e){if(ub&&e===void 0)return ub(sb(this),t);for(var i=sb(this).byteLength,s=ab(t,i),u=ab(e===void 0?i:e,i),c=new Vg(GG(u-s)),f=new kg(this),p=new kg(c),d=0;s<u;)qG(p,d++,kG(f,s++));return c}})});var Wg=Z((UK,pb)=>{"use strict";var hb=wn(),HG=nh(),WG=Gs(),fb=hb.ArrayBuffer,XG=hb.TypeError;pb.exports=fb&&HG(fb.prototype,"byteLength","get")||function(n){if(WG(n)!=="ArrayBuffer")throw new XG("ArrayBuffer expected");return n.byteLength}});var Xg=Z((BK,db)=>{"use strict";var YG=wn(),$G=th(),ZG=Wg(),JG=YG.DataView;db.exports=function(n){if(!$G||ZG(n)!==0)return!1;try{return new JG(n),!1}catch(t){return!0}}});var Yg=Z(()=>{"use strict";var jG=ei(),KG=Cu(),QG=Xg(),mb=ArrayBuffer.prototype;jG&&!("detached"in mb)&&KG(mb,"detached",{configurable:!0,get:function(){return QG(this)}})});var yb=Z((kK,gb)=>{"use strict";var t4=Xg(),e4=TypeError;gb.exports=function(n){if(t4(n))throw new e4("ArrayBuffer is detached");return n}});var $g=Z((qK,vb)=>{"use strict";var wc=wn(),n4=Au(),r4=Gs(),bh=function(n){return n4.slice(0,n.length)===n};vb.exports=function(){return bh("Bun/")?"BUN":bh("Cloudflare-Workers")?"CLOUDFLARE":bh("Deno/")?"DENO":bh("Node.js/")?"NODE":wc.Bun&&typeof Bun.version=="string"?"BUN":wc.Deno&&typeof Deno.version=="object"?"DENO":r4(wc.process)==="process"?"NODE":wc.window&&wc.document?"BROWSER":"REST"}()});var xb=Z((VK,_b)=>{"use strict";var i4=$g();_b.exports=i4==="NODE"});var wb=Z((HK,Eb)=>{"use strict";var o4=wn(),s4=xb();Eb.exports=function(n){if(s4){try{return o4.process.getBuiltinModule(n)}catch(t){}try{return Function('return require("'+n+'")')()}catch(t){}}}});var jg=Z((WK,Mb)=>{"use strict";var a4=wn(),u4=Un(),Zg=Lf(),Jg=$g(),Sb=a4.structuredClone;Mb.exports=!!Sb&&!u4(function(){if(Jg==="DENO"&&Zg>92||Jg==="NODE"&&Zg>94||Jg==="BROWSER"&&Zg>97)return!1;var n=new ArrayBuffer(8),t=Sb(n,{transfer:[n]});return n.byteLength!==0||t.byteLength!==8})});var Cb=Z((XK,Tb)=>{"use strict";var e0=wn(),l4=wb(),c4=jg(),f4=e0.structuredClone,bb=e0.ArrayBuffer,Ah=e0.MessageChannel,t0=!1,Kg,Ab,Th,Qg;if(c4)t0=function(n){f4(n,{transfer:[n]})};else if(bb)try{Ah||(Kg=l4("worker_threads"),Kg&&(Ah=Kg.MessageChannel)),Ah&&(Ab=new Ah,Th=new bb(2),Qg=function(n){Ab.port1.postMessage(null,[n])},Th.byteLength===2&&(Qg(Th),Th.byteLength===0&&(t0=Qg)))}catch(n){}Tb.exports=t0});var a0=Z((YK,Db)=>{"use strict";var i0=wn(),o0=Zn(),Lb=nh(),h4=ah(),p4=yb(),d4=Wg(),Ib=Cb(),n0=jg(),m4=i0.structuredClone,Nb=i0.ArrayBuffer,r0=i0.DataView,g4=Math.min,s0=Nb.prototype,Ob=r0.prototype,y4=o0(s0.slice),Pb=Lb(s0,"resizable","get"),Rb=Lb(s0,"maxByteLength","get"),v4=o0(Ob.getInt8),_4=o0(Ob.setInt8);Db.exports=(n0||Ib)&&function(n,t,e){var i=d4(n),s=t===void 0?i:h4(t),u=!Pb||!Pb(n),c;if(p4(n),n0&&(n=m4(n,{transfer:[n]}),i===s&&(e||u)))return n;if(i>=s&&(!e||u))c=y4(n,0,s);else{var f=e&&!u&&Rb?{maxByteLength:Rb(n)}:void 0;c=new Nb(s,f);for(var p=new r0(n),d=new r0(c),m=g4(s,i),y=0;y<m;y++)_4(d,y,v4(p,y))}return n0||Ib(n),c}});var u0=Z(()=>{"use strict";var x4=qo(),Fb=a0();Fb&&x4({target:"ArrayBuffer",proto:!0},{transfer:function(){return Fb(this,arguments.length?arguments[0]:void 0,!0)}})});var l0=Z(()=>{"use strict";var E4=qo(),Ub=a0();Ub&&E4({target:"ArrayBuffer",proto:!0},{transferToFixedLength:function(){return Ub(this,arguments.length?arguments[0]:void 0,!1)}})});var Bb=Z(()=>{"use strict";var w4=qo(),S4=gi();w4({target:"URL",proto:!0,enumerable:!0},{toJSON:function(){return S4(URL.prototype.toString,this)}})});var GT=Z((oQ,zT)=>{"use strict";zT.exports={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0}});var VT=Z((sQ,qT)=>{"use strict";var o8=Gf(),Jy=o8("span").classList,kT=Jy&&Jy.constructor&&Jy.constructor.prototype;qT.exports=kT===Object.prototype?void 0:kT});var WT=Z((aQ,HT)=>{"use strict";var s8=Vr(),a8=Du(),u8=ko().f,jy=s8("unscopables"),Ky=Array.prototype;Ky[jy]===void 0&&u8(Ky,jy,{configurable:!0,value:a8(null)});HT.exports=function(n){Ky[jy][n]=!0}});var nv=Z((uQ,$T)=>{"use strict";var l8=Un(),c8=fr(),f8=yi(),h8=Du(),XT=hc(),p8=Ra(),d8=Vr(),m8=lc(),ev=d8("iterator"),YT=!1,Is,Qy,tv;[].keys&&(tv=[].keys(),"next"in tv?(Qy=XT(XT(tv)),Qy!==Object.prototype&&(Is=Qy)):YT=!0);var g8=!f8(Is)||l8(function(){var n={};return Is[ev].call(n)!==n});g8?Is={}:m8&&(Is=h8(Is));c8(Is[ev])||p8(Is,ev,function(){return this});$T.exports={IteratorPrototype:Is,BUGGY_SAFARI_ITERATORS:YT}});var JT=Z((lQ,ZT)=>{"use strict";var y8=nv().IteratorPrototype,v8=Du(),_8=sc(),x8=pc(),E8=Fu(),w8=function(){return this};ZT.exports=function(n,t,e,i){var s=t+" Iterator";return n.prototype=v8(y8,{next:_8(+!i,e)}),x8(n,s,!1,!0),E8[s]=w8,n}});var aC=Z((cQ,sC)=>{"use strict";var S8=qo(),M8=gi(),Lp=lc(),iC=Vf(),b8=fr(),A8=JT(),jT=hc(),KT=Iu(),T8=pc(),C8=hs(),rv=Ra(),I8=Vr(),QT=Fu(),oC=nv(),P8=iC.PROPER,R8=iC.CONFIGURABLE,tC=oC.IteratorPrototype,Np=oC.BUGGY_SAFARI_ITERATORS,Hc=I8("iterator"),eC="keys",Wc="values",nC="entries",rC=function(){return this};sC.exports=function(n,t,e,i,s,u,c){A8(e,t,i);var f=function(x){if(x===s&&v)return v;if(!Np&&x&&x in m)return m[x];switch(x){case eC:return function(){return new e(this,x)};case Wc:return function(){return new e(this,x)};case nC:return function(){return new e(this,x)}}return function(){return new e(this)}},p=t+" Iterator",d=!1,m=n.prototype,y=m[Hc]||m["@@iterator"]||s&&m[s],v=!Np&&y||f(s),E=t==="Array"&&m.entries||y,M,A,_;if(E&&(M=jT(E.call(new n)),M!==Object.prototype&&M.next&&(!Lp&&jT(M)!==tC&&(KT?KT(M,tC):b8(M[Hc])||rv(M,Hc,rC)),T8(M,p,!0,!0),Lp&&(QT[p]=rC))),P8&&s===Wc&&y&&y.name!==Wc&&(!Lp&&R8?C8(m,"name",Wc):(d=!0,v=function(){return M8(y,this)})),s)if(A={values:f(Wc),keys:u?v:f(eC),entries:f(nC)},c)for(_ in A)(Np||d||!(_ in m))&&rv(m,_,A[_]);else S8({target:t,proto:!0,forced:Np||d},A);return(!Lp||c)&&m[Hc]!==v&&rv(m,Hc,v,{name:s}),QT[t]=v,A}});var lC=Z((fQ,uC)=>{"use strict";uC.exports=function(n,t){return{value:n,done:t}}});var mC=Z((hQ,dC)=>{"use strict";var L8=Mu(),iv=WT(),cC=Fu(),hC=Pa(),N8=ko().f,O8=aC(),Op=lC(),D8=lc(),F8=ei(),pC="Array Iterator",U8=hC.set,B8=hC.getterFor(pC);dC.exports=O8(Array,"Array",function(n,t){U8(this,{type:pC,target:L8(n),index:0,kind:t})},function(){var n=B8(this),t=n.target,e=n.index++;if(!t||e>=t.length)return n.target=null,Op(void 0,!0);switch(n.kind){case"keys":return Op(e,!1);case"values":return Op(t[e],!1)}return Op([e,t[e]],!1)},"values");var fC=cC.Arguments=cC.Array;iv("keys");iv("values");iv("entries");if(!D8&&F8&&fC.name!=="values")try{N8(fC,"name",{value:"values"})}catch(n){}});var av=Z(()=>{"use strict";var gC=wn(),vC=GT(),z8=VT(),Xc=mC(),yC=hs(),G8=pc(),k8=Vr(),ov=k8("iterator"),sv=Xc.values,_C=function(n,t){if(n){if(n[ov]!==sv)try{yC(n,ov,sv)}catch(i){n[ov]=sv}if(G8(n,t,!0),vC[t]){for(var e in Xc)if(n[e]!==Xc[e])try{yC(n,e,Xc[e])}catch(i){n[e]=Xc[e]}}}};for(Dp in vC)_C(gC[Dp]&&gC[Dp].prototype,Dp);var Dp;_C(z8,"DOMTokenList")});var Fp=Z((EQ,xC)=>{"use strict";var q8=ks(),V8=String;xC.exports=function(n){if(q8(n)==="Symbol")throw new TypeError("Cannot convert a Symbol value to a string");return V8(n)}});var wC=Z((wQ,EC)=>{"use strict";var H8=Go();EC.exports=function(){var n=H8(this),t="";return n.hasIndices&&(t+="d"),n.global&&(t+="g"),n.ignoreCase&&(t+="i"),n.multiline&&(t+="m"),n.dotAll&&(t+="s"),n.unicode&&(t+="u"),n.unicodeSets&&(t+="v"),n.sticky&&(t+="y"),t}});var MC=Z((SQ,SC)=>{"use strict";var uv=Un(),W8=wn(),lv=W8.RegExp,cv=uv(function(){var n=lv("a","y");return n.lastIndex=2,n.exec("abcd")!==null}),X8=cv||uv(function(){return!lv("a","y").sticky}),Y8=cv||uv(function(){var n=lv("^r","gy");return n.lastIndex=2,n.exec("str")!==null});SC.exports={BROKEN_CARET:Y8,MISSED_STICKY:X8,UNSUPPORTED_Y:cv}});var AC=Z((MQ,bC)=>{"use strict";var $8=Un(),Z8=wn(),J8=Z8.RegExp;bC.exports=$8(function(){var n=J8(".","s");return!(n.dotAll&&n.test(\`
|
|
224
|
+
`],{type:"text/javascript"}),t=URL.createObjectURL(a),e=new Worker(t);return URL.revokeObjectURL(t),e}var pe,Pt=function(a){return a.MAP_VERSION="map_version",a.ROUTE_VERSION="route_version",a.FACILITY_VERSION="facility_version",a.MAP_DATA="map_data",a.ROAD_NETWORK_DATA="road_network_data",a.FACILITY_DATA="facility_data",a.POI_TEXT="poi_text",a.LAZY_TEXTURE="lazy_texture",a.LAZY_POI="lazy_poi",a}({});function Pr(a,t){return a===void 0&&(a="aibee_map"),t===void 0&&(t=6),new Promise((e,n)=>{if(pe)return e({db:pe,type:"success"});let r=indexedDB.open(a,t);r.onupgradeneeded=function(i){pe=i.target.result,console.log("[open db is onupgradeneeded]"),Se("map_version"),Se("route_version"),Se("facility_version"),Se("map_data"),Se("road_network_data"),Se("facility_data"),Se("poi_text"),Se("lazy_texture"),Se("lazy_poi")},r.onsuccess=i=>{pe=i.target.result,e({db:pe,type:"success"})},r.onerror=i=>{console.log("[open db is onerror]"),n(i)}})}function Un(a,t,e){return e===void 0&&(e=pe),new Promise((n,r)=>{e||r("\u6CA1\u6709db");let o=e.transaction([a],"readonly").objectStore(a).get(t);o.onsuccess=()=>{o.result?n(o.result.value):n(null)},o.onerror=s=>{console.log("[getVersionByKey]",s),n(null)}})}function Lr(a,t,e,n,r){return n===void 0&&(n=pe),r===void 0&&(r=!1),new Promise((i,o)=>g(this,null,function*(){if(!n){o("\u6CA1\u6709db");return}let s=r;r||(s=!!(yield Un(a,t)));let u=n.transaction([a],"readwrite").objectStore(a),l=s?u.put({key:t,value:e}):u.add({key:t,value:e});l.onsuccess=function(c){i(c)},l.onerror=function(c){o(c)}}))}function Se(a,t){t===void 0&&(t=pe),t&&(t.objectStoreNames.contains(a)||t.createObjectStore(a,{keyPath:"key"}))}function fs(a){a===void 0&&(a=pe),a==null||a.close(),pe=null}var fe=Math.max(window.devicePixelRatio,2),dt=class{static InitDb(){return Pr()}static getCanvas(){if(this.canvas)return this.canvas;{let t=document.createElement("canvas");return this.canvas=t,t}}static getCtx(){if(this.ctx)return this.ctx;let e=this.getCanvas().getContext("2d",{willReadFrequently:!0});return this.ctx=e,e}static getIdleCanvas(){if(this.idleCanvas)return this.idleCanvas;{let t=document.createElement("canvas");return this.idleCanvas=t,t}}static getIdleCtx(){if(this.idleCtx)return this.idleCtx;let e=this.getIdleCanvas().getContext("2d",{willReadFrequently:!0});return this.idleCtx=e,e}static getMergedOptions(t){return v({},this.options,t)}static setCtxStyle(t,e,n){e===void 0&&(e=this.getCanvas()),n===void 0&&(n=this.getCtx()),e.style.width=""+t.width+"px",e.style.height=""+t.height+"px",e.width=t.width*fe,e.height=t.height*fe,n.font=t.font,n.textBaseline=t.textBaseline,n.lineWidth=t.lineWidth,n.fillStyle=t.fillStyle,n.strokeStyle=t.strokeStyle,n.scale(fe,fe)}static getLazyIndexDbTextTextureWorker(){if(this.lazyIndexDbTextTextureWorker)return this.lazyIndexDbTextTextureWorker;{let t=Bi();return this.lazyIndexDbTextTextureWorker=t,t}}static getTextureByText(t,e){return g(this,null,function*(){let n=this.getMergedOptions(e),r=(e==null?void 0:e.maxWidth)||600,i=Xe(v({},n,{text:t,maxWidth:r}));if(this.cacheMap.has(i))return this.cacheMap.get(i);let o=new Promise((s,u)=>g(this,null,function*(){var l;yield this.InitDb();let c=yield Un(Pt.POI_TEXT,i);if(c){let L=new B.DataTexture(new Uint8Array(c.data),c.width,c.height,B.RGBAFormat);L.flipY=!0,L.minFilter=B.LinearFilter,L.magFilter=B.LinearFilter;let O={texture:L,lines:c.lines};this.cacheMap.set(i,O),s(O);return}let h=this.getCanvas(),p=this.getCtx();p.clearRect(0,0,h.width,h.height),this.setCtxStyle(n);let f=[],d="",m=[],_="",x=0;for(let L=0;L<t.length;L++){let O=t[L];if(O==="("||O==="\uFF08"){if(x===0&&_){let I=E(_);m.push(...I),_=""}x++}else if((O===")"||O==="\uFF09")&&(x--,x===0)){_+=O,m.push(_),_="";continue}_+=O}if(_){let L=E(_);m.push(...L)}function E(L){let O=[],I="",V=!1,it="";for(let q=0;q<L.length;q++){let z=L[q];(z==='"'||z==="'")&&(!V||z===it)?(V?(I+=z,O.push(I),I=""):(I&&O.push(I),I=z),V=!V,it=z):I+=z}return I&&O.push(I),O}for(let L of m)if(L.startsWith("(")||L.startsWith("\uFF08")||L.startsWith('"')||L.startsWith("'"))if(p.measureText(L).width>r){d&&(f.push(d),d="");let I="",V=L.split("");for(let it of V){let q=I+it;p.measureText(q).width>r&&I?(f.push(I),I=it):I=q}I&&(d=I)}else{let I=d?d+" "+L:L;p.measureText(I).width>r&&d?(f.push(d),d=L):d=I}else{let O=L.split(" ");for(let I of O){let V=d?d+" "+I:I,it=p.measureText(V);if(it.width>r)if(d&&f.push(d),it.width>r||xi(I)){let q="",z=I.split("");for(let ge of z){let Te=q+ge;p.measureText(Te).width>r&&q?(f.push(q),q=ge):q=Te}q&&(d=q)}else d=I;else d=V}}d&&f.push(d);let S=+(((l=n.font.match(/(\d+)px/))==null?void 0:l[1])||54),R=Math.ceil(S+n.lineWidth+2),P=R*f.length,K=Math.max(...f.map(L=>{let O=Math.ceil(p.measureText(L).width);return O%2===0?O:O+1}))+2;f.forEach((L,O)=>{let I=p.measureText(L),V=Math.ceil(I.width),it=Math.floor((K-V)/2),q=O*(2+R);n.lineWidth&&p.strokeText(L,it,q),p.fillText(L,it,q)});let T=p.getImageData(0,0,K*fe,P*fe),Q=new B.DataTexture(T.data,K*fe,P*fe,B.RGBAFormat);Q.flipY=!0,Q.minFilter=B.LinearFilter,Q.magFilter=B.LinearFilter,this.cacheMap.set(i,{texture:Q,lines:f.length}),Lr(Pt.POI_TEXT,i,{data:Array.from(T.data),width:K*fe,height:P*fe,lines:f.length},void 0,!0),s({texture:Q,lines:f.length})}));return this.cacheMap.set(i,o),o})}static lazyGetTextureByTexts(t,e){return g(this,null,function*(){let n=this.getMergedOptions(e),r=n.height;n.height=Math.min(r*t.length,2048);let i={},o=new Set;if(t.map(l=>{if(this.lazyPoiMap.has(l)){let c=this.lazyPoiMap.get(l),h=this.lazyTextureCacheMap.get(c.textureKey);if(h){i[l]={width:c.width,height:r,x:c.x,y:c.y,texture:h};return}}o.add(l)}),!o.size)return i;let s=Array.from(o);return new Promise((l,c)=>g(this,null,function*(){let h;window.OffscreenCanvas?(console.log("use webworker"),h=this.getTextsByWorker(s,n,r)):typeof window.requestIdleCallback=="function"?(console.log("use browser idle"),h=this.getTextsByBrowserIdle(s,n,r)):(console.log("use requestAnimation text textures"),h=Promise.resolve().then(()=>this.getTextsSync(s,n,r))),l(h)}))})}static getTextsByWorker(t,e,n){return g(this,null,function*(){return this.textTextureWorker||(this.textTextureWorker=Fi()),(yield Z(this.textTextureWorker,"get_texture_by_texts",{texts:t,options:e,originHeight:n})).data.map(i=>{let o=new B.DataTexture(i.data,e.width,i.height,B.RGBAFormat);return o.flipY=!0,o.minFilter=B.LinearFilter,o.magFilter=B.LinearFilter,{texture:o,offsetMap:i.offsetMap}}).reduce((i,o)=>(Object.keys(o.offsetMap).forEach(s=>{i[s]=o.offsetMap[s],i[s].texture=o.texture}),i),{})})}static getTextsByBrowserIdle(t,e,n){return g(this,null,function*(){let r=0,i=t.length;return new Promise(o=>{let s=this.getIdleCanvas(),u=this.getIdleCtx();u.clearRect(0,0,s.width,s.height),this.setCtxStyle(e,s,u);let l=[],c=0,h=0,p={},f=()=>g(this,null,function*(){let m=u.getImageData(0,0,e.width,n+h);l.push({imageData:m,offsetMap:p,height:n+h});let _=l.reduce((x,E)=>{let S=new B.DataTexture(E.imageData.data,e.width,E.height,B.RGBAFormat);return S.flipY=!0,S.minFilter=B.LinearFilter,S.magFilter=B.LinearFilter,Object.keys(E.offsetMap).forEach(R=>{x[R]=v({},E.offsetMap[R],{texture:S})}),x},{});o(_)}),d=m=>{if(r>=i)return f();if(m.timeRemaining()>0){let _=t[r],x=Math.ceil(u.measureText(_).width);if(x=x%2===0?x:x+1,x+=2,x+c>e.width&&(c=0,h+=n,n+h>e.height)){let S=u.getImageData(0,0,e.width,h);l.push({imageData:S,offsetMap:p,height:h}),h=0,u.clearRect(0,0,e.width,e.height),p={}}let E=8;if(e.lineWidth&&u.strokeText(_,2+c,E+h),u.fillText(_,2+c,E+h),p[_]={width:x,height:n,x:c,y:h},c+=x,++r>=i)return f();m.timeRemaining()>0?d(m):this.timer.requestIdleCallback(d)}else this.timer.requestIdleCallback(d)};this.timer.requestIdleCallback(d),this.timer.setTimeout(()=>{r===0&&(console.log("idle \u4E0D\u6267\u884C \u56DE\u9000\u5230\u540C\u6B65"),o(this.getTextsSync(t,e,n)))},1e3)})})}static getTextsByReqAniFrame(t,e,n){return g(this,null,function*(){let r=0,i=t.length;return new Promise(o=>{let s=this.getIdleCanvas(),u=this.getIdleCtx();u.clearRect(0,0,s.width,s.height),this.setCtxStyle(e,s,u);let l=[],c=0,h=0,p={},f=()=>g(this,null,function*(){let m=u.getImageData(0,0,e.width,n+h);l.push({imageData:m,offsetMap:p,height:n+h});let _=l.reduce((x,E)=>{let S=new B.DataTexture(E.imageData.data,e.width,E.height,B.RGBAFormat);return S.flipY=!0,S.minFilter=B.LinearFilter,S.magFilter=B.LinearFilter,Object.keys(E.offsetMap).forEach(R=>{x[R]=v({},E.offsetMap[R],{texture:S})}),x},{});o(_)}),d=()=>{if(r>=i)return f();let m=0;for(;m<30;){let _=t[r],x=Math.ceil(u.measureText(_).width);if(x=x%2===0?x:x+1,x+=2,x+c>e.width&&(c=0,h+=n,n+h>e.height)){let S=u.getImageData(0,0,e.width,h);l.push({imageData:S,offsetMap:p,height:h}),h=0,u.clearRect(0,0,e.width,e.height),p={}}let E=8;if(e.lineWidth&&u.strokeText(_,2+c,E+h),u.fillText(_,2+c,E+h),p[_]={width:x,height:n,x:c,y:h},c+=x,++r>=i)return f();m++}this.timer.requestAnimationFrame(d)};this.timer.requestAnimationFrame(d)})})}static getTextsSync(t,e,n){let r=this.getCanvas(),i=this.getCtx();i.clearRect(0,0,r.width,r.height),this.setCtxStyle(e);let o=[],s=0,u=0,l={};t.forEach(p=>{let f=Math.ceil(i.measureText(p).width);if(f=f%2===0?f:f+1,f+=2,f+s>e.width&&(s=0,u+=n,n+u>e.height)){let m=i.getImageData(0,0,e.width,u);o.push({data:m.data,offsetMap:l,height:u}),u=0,i.clearRect(0,0,e.width,e.height),l={}}let d=8;e.lineWidth&&i.strokeText(p,2+s,d+u),i.fillText(p,2+s,d+u),l[p]={width:f,height:n,x:s,y:u},s+=f});let c=i.getImageData(0,0,e.width,n+u);return o.push({data:c.data,offsetMap:l,height:u+n}),o.reduce((p,f)=>{let d=new B.DataTexture(f.data,e.width,f.height,B.RGBAFormat);return d.flipY=!0,d.minFilter=B.LinearFilter,d.magFilter=B.LinearFilter,Object.keys(f.offsetMap).forEach(m=>{p[m]=v({},f.offsetMap[m],{texture:d})}),p},{})}static getTextureByTexts(t,e){let n=this.getMergedOptions(e),r=n.height;n.height=Math.min(r*t.length,1e4);let i=this.getCanvas(),o=this.getCtx();o.clearRect(0,0,i.width,i.height),this.setCtxStyle(n);let s=0,u=0,l={};t.forEach(p=>{let f=Math.ceil(o.measureText(p).width);f=f%2===0?f:f+1,f+=2,f+s>n.width&&(s=0,u+=r);let d=8;n.lineWidth&&o.strokeText(p,2+s,d+u),o.fillText(p,2+s,d+u),l[p]={width:f,height:r,x:s,y:u},s+=f});let c=o.getImageData(0,0,n.width,r+u),h=new B.DataTexture(Uint8Array.from(c.data),n.width,r+u,B.RGBAFormat);return h.flipY=!0,h.minFilter=B.LinearFilter,h.magFilter=B.LinearFilter,{texture:h,offsetMap:l}}static dispose(){var t,e;this.ctx=null,this.canvas=null,this.idleCtx=null,this.idleCanvas=null,this.timer.dispose(),this.cacheMap.forEach(n=>{n instanceof Promise?n.then(r=>{r.texture.dispose()}):n.texture.dispose()}),this.cacheMap.clear(),(t=this.textTextureWorker)==null||t.terminate(),(e=this.lazyIndexDbTextTextureWorker)==null||e.terminate(),this.textTextureWorker=null}};dt.canvas=document.createElement("canvas");dt.ctx=dt.canvas.getContext("2d",{willReadFrequently:!0});dt.cacheMap=new Map;dt.lazyTextureCacheMap=new Map;dt.lazyPoiMap=new Map;dt.textTextureWorker=null;dt.lazyIndexDbTextTextureWorker=null;dt.idleCanvas=null;dt.idleCtx=null;dt.timer=new $;dt.options={width:2048,height:512,font:"28px sans-serif",textBaseline:"top",lineWidth:2,fillStyle:"rgba(0,0,0,1)",strokeStyle:"white"};var Mh=require("core-js/modules/web.dom-collections.iterator.js"),$t=require("three"),gt=class{static getTextureByUrl(t){if(this.urlTextureMap.has(t))return Promise.resolve(this.urlTextureMap.get(t));let e=this.textureLoader.loadAsync(t);return e.then(n=>{n.format=$t.RGBAFormat,n.magFilter=$t.LinearFilter,n.minFilter=$t.LinearFilter,n.colorSpace="srgb",this.urlTextureMap.set(t,n)}),this.urlTextureMap.set(t,e),e}static getUrlTextureBorder(t,e,n){let r=t+"-"+n.width+"-"+n.color;if(this.borderUrlTextureMap.has(r))return Promise.resolve(this.borderUrlTextureMap.get(r));let i=this.textureLoader.loadAsync(t).then(o=>{let s=this.ctx,u=this.canvas,l=e+n.width*2;u.width=l,u.height=l;let c=l/2;s.clearRect(0,0,l,l),s.beginPath(),s.arc(c,c,e/2+n.width,0,2*Math.PI),s.fillStyle=n.color,s.fill(),s.beginPath(),s.arc(c,c,e/2,0,2*Math.PI),s.closePath(),s.clip(),s.drawImage(o.image,n.width,n.width,e,e);let h=new $t.Texture(u);return h.format=$t.RGBAFormat,h.magFilter=$t.LinearFilter,h.minFilter=$t.LinearFilter,h.colorSpace="srgb",h.needsUpdate=!0,this.borderUrlTextureMap.set(r,h),h});return this.borderUrlTextureMap.set(r,i),i}static dispose(){this.urlTextureMap.forEach(t=>{t instanceof Promise?t.then(e=>e.dispose()):t.dispose()}),this.borderUrlTextureMap.forEach(t=>{t instanceof Promise?t.then(e=>e.dispose()):t.dispose()}),this.urlTextureMap.clear(),this.borderUrlTextureMap.clear(),this.ctx=null,this.canvas=null}};gt.textureLoader=new $t.TextureLoader;gt.urlTextureMap=new Map;gt.borderUrlTextureMap=new Map;gt.canvas=document.createElement("canvas");gt.ctx=gt.canvas.getContext("2d",{willReadFrequently:!0});var Tp=require("core-js/modules/web.dom-collections.iterator.js");var As=require("three/examples/jsm/loaders/GLTFLoader.js");var Xh=require("core-js/modules/web.dom-collections.iterator.js"),qh=require("core-js/modules/es.json.stringify.js"),jh=require("core-js/modules/es.error.cause.js"),Yh=require("core-js/modules/es.typed-array.float32-array.js"),Zh=require("core-js/modules/es.typed-array.at.js"),Kh=require("core-js/modules/es.typed-array.fill.js"),$h=require("core-js/modules/es.typed-array.find-last.js"),Jh=require("core-js/modules/es.typed-array.find-last-index.js"),Qh=require("core-js/modules/es.typed-array.set.js"),tp=require("core-js/modules/es.typed-array.sort.js"),ep=require("core-js/modules/es.typed-array.to-reversed.js"),np=require("core-js/modules/es.typed-array.to-sorted.js"),rp=require("core-js/modules/es.typed-array.with.js"),ip=require("core-js/modules/es.array-buffer.constructor.js"),op=require("core-js/modules/es.array-buffer.slice.js"),sp=require("core-js/modules/es.array-buffer.detached.js"),ap=require("core-js/modules/es.array-buffer.transfer.js"),up=require("core-js/modules/es.array-buffer.transfer-to-fixed-length.js"),lp=require("core-js/modules/es.array.push.js"),cp=require("core-js/modules/web.url.js"),hp=require("core-js/modules/web.url.to-json.js"),pp=require("core-js/modules/web.url-search-params.js"),fp=require("core-js/modules/web.url-search-params.delete.js"),dp=require("core-js/modules/web.url-search-params.has.js"),gp=require("core-js/modules/web.url-search-params.size.js"),mp=require("core-js/modules/es.array.sort.js"),_p=require("core-js/modules/es.typed-array.int8-array.js"),yp=require("core-js/modules/es.typed-array.uint32-array.js"),vp=require("core-js/modules/es.typed-array.int16-array.js"),xp=require("core-js/modules/es.typed-array.int32-array.js"),Ep=require("core-js/modules/es.typed-array.uint8-array.js"),bp=require("core-js/modules/es.typed-array.uint16-array.js");var zi={};No(zi,{Arrow:()=>vu,DracoDecoderJs:()=>xs,DracoDecoderWasm:()=>Es,DracoWasmWrapperJs:()=>bs,ManGlb:()=>yu,ParkingTypeIconMap:()=>_u});var uu={},ds=new URL("./icon/parkingSpace/half.svg",uu.url).href;var lu={},gs=new URL("./icon/parkingSpace/power.svg",lu.url).href;var cu={},ms=new URL("./icon/parkingSpace/mechanical.svg",cu.url).href;var hu={},_s=new URL("./icon/parkingSpace/vip.svg",hu.url).href;var pu={},ys=new URL("./glb/locate.glb",pu.url).href;var fu={},vs=new URL("./icon/path/arrow.png",fu.url).href;var du={},xs=new URL("./draco/draco_decoder.js",du.url).href;var gu={},Es=new URL("./draco/draco_decoder.wasm",gu.url).href;var mu={},bs=new URL("./draco/draco_wasm_wrapper.js",mu.url).href;var _u={half:ds,power:gs,mechanical:ms,vip:_s},yu=ys,vu=vs;var{ParkingTypeIconMap:Nr,ManGlb:Ss,Arrow:Or,DracoDecoderJs:Ms,DracoDecoderWasm:ws,DracoWasmWrapperJs:Ts}=zi;var Mt=require("three"),Gi=new WeakMap,Dr=class extends Mt.Loader{setDecoderPath(t){return this.decoderPath=t,this}setDecoderConfig(t){return this.decoderConfig=t,this}setWorkerLimit(t){return this.workerLimit=t,this}load(t,e,n,r){let i=new Mt.FileLoader(this.manager);i.setPath(this.path),i.setResponseType("arraybuffer"),i.setRequestHeader(this.requestHeader),i.setWithCredentials(this.withCredentials),i.load(t,o=>{this.parse(o,e,r)},n,r)}parse(t,e,n){n===void 0&&(n=()=>{}),this.decodeDracoFile(t,e,null,null,Mt.SRGBColorSpace).catch(n)}decodeDracoFile(t,e,n,r,i,o){i===void 0&&(i=Mt.LinearSRGBColorSpace),o===void 0&&(o=()=>{});let s={attributeIDs:n||this.defaultAttributeIDs,attributeTypes:r||this.defaultAttributeTypes,useUniqueIDs:!!n,vertexColorSpace:i};return this.decodeGeometry(t,s).then(e).catch(o)}decodeGeometry(t,e){let n=JSON.stringify(e);if(Gi.has(t)){let u=Gi.get(t);if(u.key===n)return u.promise;if(t.byteLength===0)throw new Error("THREE.DRACOLoader: Unable to re-decode a buffer with different settings. Buffer has already been transferred.")}let r,i=this.workerNextTaskID++,o=t.byteLength,s=this._getWorker(i,o).then(u=>(r=u,new Promise((l,c)=>{r._callbacks[i]={resolve:l,reject:c},r.postMessage({type:"decode",id:i,taskConfig:e,buffer:t},[t])}))).then(u=>this._createGeometry(u.geometry));return s.catch(()=>!0).then(()=>{r&&i&&this._releaseTask(r,i)}),Gi.set(t,{key:n,promise:s}),s}_createGeometry(t){let e=new Mt.BufferGeometry;t.index&&e.setIndex(new Mt.BufferAttribute(t.index.array,1));for(let n=0;n<t.attributes.length;n++){let r=t.attributes[n],i=r.name,o=r.array,s=r.itemSize,u=new Mt.BufferAttribute(o,s);i==="color"&&(this._assignVertexColorSpace(u,r.vertexColorSpace),u.normalized=!(o instanceof Float32Array)),e.setAttribute(i,u)}return e}_assignVertexColorSpace(t,e){if(e!==Mt.SRGBColorSpace)return;let n=new Mt.Color;for(let r=0,i=t.count;r<i;r++)n.fromBufferAttribute(t,r).convertSRGBToLinear(),t.setXYZ(r,n.r,n.g,n.b)}_loadLibrary(t,e){let n=new Mt.FileLoader(this.manager);return n.setPath(this.decoderPath),n.setResponseType(e),n.setWithCredentials(this.withCredentials),new Promise((r,i)=>{n.load(t,r,void 0,i)})}preload(){return this._initDecoder(),this}_initDecoder(){if(this.decoderPending)return this.decoderPending;let t=typeof WebAssembly!="object"||this.decoderConfig.type==="js",e=[];return t?e.push(this._loadLibrary(Ms,"text")):(e.push(this._loadLibrary(Ts,"text")),e.push(this._loadLibrary(ws,"arraybuffer"))),this.decoderPending=Promise.all(e).then(n=>{let r=n[0];t||(this.decoderConfig.wasmBinary=n[1]);let i=xu.toString(),o=["/* draco decoder */",r,"","/* worker */",i.substring(i.indexOf("{")+1,i.lastIndexOf("}"))].join(`
|
|
225
|
+
`);this.workerSourceURL=URL.createObjectURL(new Blob([o]))}),this.decoderPending}_getWorker(t,e){return this._initDecoder().then(()=>{if(this.workerPool.length<this.workerLimit){let r=new Worker(this.workerSourceURL);r._callbacks={},r._taskCosts={},r._taskLoad=0,r.postMessage({type:"init",decoderConfig:this.decoderConfig}),r.onmessage=function(i){let o=i.data;switch(o.type){case"decode":r._callbacks[o.id].resolve(o);break;case"error":r._callbacks[o.id].reject(o);break;default:console.error('THREE.DRACOLoader: Unexpected message, "'+o.type+'"')}},this.workerPool.push(r)}else this.workerPool.sort(function(r,i){return r._taskLoad>i._taskLoad?-1:1});let n=this.workerPool[this.workerPool.length-1];return n._taskCosts[t]=e,n._taskLoad+=e,n})}_releaseTask(t,e){t._taskLoad-=t._taskCosts[e],delete t._callbacks[e],delete t._taskCosts[e]}debug(){console.log("Task load: ",this.workerPool.map(t=>t._taskLoad))}dispose(){for(let t=0;t<this.workerPool.length;++t)this.workerPool[t].terminate();return this.workerPool.length=0,this.workerSourceURL!==""&&URL.revokeObjectURL(this.workerSourceURL),this}constructor(t){super(t),this.decoderPath="",this.decoderConfig={},this.decoderBinary=null,this.decoderPending=null,this.workerLimit=4,this.workerPool=[],this.workerNextTaskID=1,this.workerSourceURL="",this.defaultAttributeIDs={position:"POSITION",normal:"NORMAL",color:"COLOR",uv:"TEX_COORD"},this.defaultAttributeTypes={position:"Float32Array",normal:"Float32Array",color:"Float32Array",uv:"Float32Array"}}};function xu(){let a,t;onmessage=function(o){let s=o.data;switch(s.type){case"init":a=s.decoderConfig,t=new Promise(function(c){a.onModuleLoaded=function(h){c({draco:h})},DracoDecoderModule(a)});break;case"decode":let u=s.buffer,l=s.taskConfig;t.then(c=>{let h=c.draco,p=new h.Decoder;try{let f=e(h,p,new Int8Array(u),l),d=f.attributes.map(m=>m.array.buffer);f.index&&d.push(f.index.array.buffer),self.postMessage({type:"decode",id:s.id,geometry:f},d)}catch(f){console.error(f),self.postMessage({type:"error",id:s.id,error:f.message})}finally{h.destroy(p)}});break}};function e(o,s,u,l){let c=l.attributeIDs,h=l.attributeTypes,p,f,d=s.GetEncodedGeometryType(u);if(d===o.TRIANGULAR_MESH)p=new o.Mesh,f=s.DecodeArrayToMesh(u,u.byteLength,p);else if(d===o.POINT_CLOUD)p=new o.PointCloud,f=s.DecodeArrayToPointCloud(u,u.byteLength,p);else throw new Error("THREE.DRACOLoader: Unexpected geometry type.");if(!f.ok()||p.ptr===0)throw new Error("THREE.DRACOLoader: Decoding failed: "+f.error_msg());let m={index:null,attributes:[]};for(let _ in c){let x=self[h[_]],E,S;if(l.useUniqueIDs)S=c[_],E=s.GetAttributeByUniqueId(p,S);else{if(S=s.GetAttributeId(p,o[c[_]]),S===-1)continue;E=s.GetAttribute(p,S)}let R=r(o,s,p,_,x,E);_==="color"&&(R.vertexColorSpace=l.vertexColorSpace),m.attributes.push(R)}return d===o.TRIANGULAR_MESH&&(m.index=n(o,s,p)),o.destroy(p),m}function n(o,s,u){let c=u.num_faces()*3,h=c*4,p=o._malloc(h);s.GetTrianglesUInt32Array(u,h,p);let f=new Uint32Array(o.HEAPF32.buffer,p,c).slice();return o._free(p),{array:f,itemSize:1}}function r(o,s,u,l,c,h){let p=h.num_components(),d=u.num_points()*p,m=d*c.BYTES_PER_ELEMENT,_=i(o,c),x=o._malloc(m);s.GetAttributeDataArrayForAllPoints(u,h,_,m,x);let E=new c(o.HEAPF32.buffer,x,d).slice();return o._free(x),{name:l,array:E,itemSize:p}}function i(o,s){switch(s){case Float32Array:return o.DT_FLOAT32;case Int8Array:return o.DT_INT8;case Int16Array:return o.DT_INT16;case Int32Array:return o.DT_INT32;case Uint8Array:return o.DT_UINT8;case Uint16Array:return o.DT_UINT16;case Uint32Array:return o.DT_UINT32}}}var It=class{static loadModel(t,e){return g(this,null,function*(){if(e===void 0&&(e=!0),e){if(this.modelMap.has(t)){let r=this.modelMap.get(t);if(r instanceof Promise)r.then(i=>v({},i,{scene:i.scene.clone()}));else return v({},r,{scene:r.scene.clone()})}let n=new Promise((r,i)=>{this.loader.load(t,o=>{this.modelMap.set(t,o),r(o)},void 0,i)});return this.modelMap.set(t,n),n.then(r=>v({},r,{scene:r.scene.clone()}))}else return new Promise((n,r)=>{this.loader.load(t,n,void 0,r)})})}static dispose(){this.modelMap.forEach(t=>{t instanceof Promise?t.then(e=>F(e.scene)):F(t.scene)}),this.modelMap.clear()}};It.dracoLoader=new Dr;It.loader=new As.GLTFLoader().setDRACOLoader(It.dracoLoader);It.modelMap=new Map;function ki(){let a=new Blob([`var p2=Object.create;var zx=Object.defineProperty;var d2=Object.getOwnPropertyDescriptor;var m2=Object.getOwnPropertyNames;var g2=Object.getPrototypeOf,y2=Object.prototype.hasOwnProperty;var Z=(n,t)=>()=>(t||n((t={exports:{}}).exports,t),t.exports);var v2=(n,t,e,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of m2(t))!y2.call(n,s)&&s!==e&&zx(n,s,{get:()=>t[s],enumerable:!(i=d2(t,s))||i.enumerable});return n};var ue=(n,t,e)=>(e=n!=null?p2(g2(n)):{},v2(t||!n||!n.__esModule?zx(e,"default",{value:n,enumerable:!0}):e,n));var Tf=(n,t,e)=>new Promise((i,s)=>{var u=p=>{try{f(e.next(p))}catch(d){s(d)}},c=p=>{try{f(e.throw(p))}catch(d){s(d)}},f=p=>p.done?i(p.value):Promise.resolve(p.value).then(u,c);f((e=e.apply(n,t)).next())});var wn=Z((nm,Gx)=>{"use strict";var ic=function(n){return n&&n.Math===Math&&n};Gx.exports=ic(typeof globalThis=="object"&&globalThis)||ic(typeof window=="object"&&window)||ic(typeof self=="object"&&self)||ic(typeof global=="object"&&global)||ic(typeof nm=="object"&&nm)||function(){return this}()||Function("return this")()});var Un=Z(($Z,kx)=>{"use strict";kx.exports=function(n){try{return!!n()}catch(t){return!0}}});var ei=Z((ZZ,qx)=>{"use strict";var _2=Un();qx.exports=!_2(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!==7})});var oc=Z((JZ,Vx)=>{"use strict";var x2=Un();Vx.exports=!x2(function(){var n=function(){}.bind();return typeof n!="function"||n.hasOwnProperty("prototype")})});var gi=Z((jZ,Hx)=>{"use strict";var E2=oc(),Cf=Function.prototype.call;Hx.exports=E2?Cf.bind(Cf):function(){return Cf.apply(Cf,arguments)}});var $x=Z(Yx=>{"use strict";var Wx={}.propertyIsEnumerable,Xx=Object.getOwnPropertyDescriptor,w2=Xx&&!Wx.call({1:2},1);Yx.f=w2?function(t){var e=Xx(this,t);return!!e&&e.enumerable}:Wx});var sc=Z((QZ,Zx)=>{"use strict";Zx.exports=function(n,t){return{enumerable:!(n&1),configurable:!(n&2),writable:!(n&4),value:t}}});var Zn=Z((tJ,Kx)=>{"use strict";var Jx=oc(),jx=Function.prototype,rm=jx.call,S2=Jx&&jx.bind.bind(rm,rm);Kx.exports=Jx?S2:function(n){return function(){return rm.apply(n,arguments)}}});var Gs=Z((eJ,t1)=>{"use strict";var Qx=Zn(),M2=Qx({}.toString),b2=Qx("".slice);t1.exports=function(n){return b2(M2(n),8,-1)}});var If=Z((nJ,e1)=>{"use strict";var A2=Zn(),T2=Un(),C2=Gs(),im=Object,I2=A2("".split);e1.exports=T2(function(){return!im("z").propertyIsEnumerable(0)})?function(n){return C2(n)==="String"?I2(n,""):im(n)}:im});var Pf=Z((rJ,n1)=>{"use strict";n1.exports=function(n){return n==null}});var Su=Z((iJ,r1)=>{"use strict";var P2=Pf(),R2=TypeError;r1.exports=function(n){if(P2(n))throw new R2("Can't call method on "+n);return n}});var Mu=Z((oJ,i1)=>{"use strict";var L2=If(),N2=Su();i1.exports=function(n){return L2(N2(n))}});var fr=Z((sJ,o1)=>{"use strict";var om=typeof document=="object"&&document.all;o1.exports=typeof om=="undefined"&&om!==void 0?function(n){return typeof n=="function"||n===om}:function(n){return typeof n=="function"}});var yi=Z((aJ,s1)=>{"use strict";var O2=fr();s1.exports=function(n){return typeof n=="object"?n!==null:O2(n)}});var bu=Z((uJ,a1)=>{"use strict";var sm=wn(),D2=fr(),F2=function(n){return D2(n)?n:void 0};a1.exports=function(n,t){return arguments.length<2?F2(sm[n]):sm[n]&&sm[n][t]}});var ac=Z((lJ,u1)=>{"use strict";var U2=Zn();u1.exports=U2({}.isPrototypeOf)});var Au=Z((cJ,f1)=>{"use strict";var B2=wn(),l1=B2.navigator,c1=l1&&l1.userAgent;f1.exports=c1?String(c1):""});var Lf=Z((fJ,y1)=>{"use strict";var g1=wn(),am=Au(),h1=g1.process,p1=g1.Deno,d1=h1&&h1.versions||p1&&p1.version,m1=d1&&d1.v8,yo,Rf;m1&&(yo=m1.split("."),Rf=yo[0]>0&&yo[0]<4?1:+(yo[0]+yo[1]));!Rf&&am&&(yo=am.match(/Edge\\/(\\d+)/),(!yo||yo[1]>=74)&&(yo=am.match(/Chrome\\/(\\d+)/),yo&&(Rf=+yo[1])));y1.exports=Rf});var um=Z((hJ,_1)=>{"use strict";var v1=Lf(),z2=Un(),G2=wn(),k2=G2.String;_1.exports=!!Object.getOwnPropertySymbols&&!z2(function(){var n=Symbol("symbol detection");return!k2(n)||!(Object(n)instanceof Symbol)||!Symbol.sham&&v1&&v1<41})});var lm=Z((pJ,x1)=>{"use strict";var q2=um();x1.exports=q2&&!Symbol.sham&&typeof Symbol.iterator=="symbol"});var Nf=Z((dJ,E1)=>{"use strict";var V2=bu(),H2=fr(),W2=ac(),X2=lm(),Y2=Object;E1.exports=X2?function(n){return typeof n=="symbol"}:function(n){var t=V2("Symbol");return H2(t)&&W2(t.prototype,Y2(n))}});var uc=Z((mJ,w1)=>{"use strict";var $2=String;w1.exports=function(n){try{return $2(n)}catch(t){return"Object"}}});var Ca=Z((gJ,S1)=>{"use strict";var Z2=fr(),J2=uc(),j2=TypeError;S1.exports=function(n){if(Z2(n))return n;throw new j2(J2(n)+" is not a function")}});var Of=Z((yJ,M1)=>{"use strict";var K2=Ca(),Q2=Pf();M1.exports=function(n,t){var e=n[t];return Q2(e)?void 0:K2(e)}});var A1=Z((vJ,b1)=>{"use strict";var cm=gi(),fm=fr(),hm=yi(),tO=TypeError;b1.exports=function(n,t){var e,i;if(t==="string"&&fm(e=n.toString)&&!hm(i=cm(e,n))||fm(e=n.valueOf)&&!hm(i=cm(e,n))||t!=="string"&&fm(e=n.toString)&&!hm(i=cm(e,n)))return i;throw new tO("Can't convert object to primitive value")}});var lc=Z((_J,T1)=>{"use strict";T1.exports=!1});var Df=Z((xJ,I1)=>{"use strict";var C1=wn(),eO=Object.defineProperty;I1.exports=function(n,t){try{eO(C1,n,{value:t,configurable:!0,writable:!0})}catch(e){C1[n]=t}return t}});var Ff=Z((EJ,L1)=>{"use strict";var nO=lc(),rO=wn(),iO=Df(),P1="__core-js_shared__",R1=L1.exports=rO[P1]||iO(P1,{});(R1.versions||(R1.versions=[])).push({version:"3.42.0",mode:nO?"pure":"global",copyright:"\\xA9 2014-2025 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.42.0/LICENSE",source:"https://github.com/zloirock/core-js"})});var Uf=Z((wJ,O1)=>{"use strict";var N1=Ff();O1.exports=function(n,t){return N1[n]||(N1[n]=t||{})}});var zo=Z((SJ,D1)=>{"use strict";var oO=Su(),sO=Object;D1.exports=function(n){return sO(oO(n))}});var to=Z((MJ,F1)=>{"use strict";var aO=Zn(),uO=zo(),lO=aO({}.hasOwnProperty);F1.exports=Object.hasOwn||function(t,e){return lO(uO(t),e)}});var Bf=Z((bJ,U1)=>{"use strict";var cO=Zn(),fO=0,hO=Math.random(),pO=cO(1 .toString);U1.exports=function(n){return"Symbol("+(n===void 0?"":n)+")_"+pO(++fO+hO,36)}});var Vr=Z((AJ,z1)=>{"use strict";var dO=wn(),mO=Uf(),B1=to(),gO=Bf(),yO=um(),vO=lm(),Tu=dO.Symbol,pm=mO("wks"),_O=vO?Tu.for||Tu:Tu&&Tu.withoutSetter||gO;z1.exports=function(n){return B1(pm,n)||(pm[n]=yO&&B1(Tu,n)?Tu[n]:_O("Symbol."+n)),pm[n]}});var dm=Z((TJ,q1)=>{"use strict";var xO=gi(),G1=yi(),k1=Nf(),EO=Of(),wO=A1(),SO=Vr(),MO=TypeError,bO=SO("toPrimitive");q1.exports=function(n,t){if(!G1(n)||k1(n))return n;var e=EO(n,bO),i;if(e){if(t===void 0&&(t="default"),i=xO(e,n,t),!G1(i)||k1(i))return i;throw new MO("Can't convert object to primitive value")}return t===void 0&&(t="number"),wO(n,t)}});var zf=Z((CJ,V1)=>{"use strict";var AO=dm(),TO=Nf();V1.exports=function(n){var t=AO(n,"string");return TO(t)?t:t+""}});var Gf=Z((IJ,W1)=>{"use strict";var CO=wn(),H1=yi(),mm=CO.document,IO=H1(mm)&&H1(mm.createElement);W1.exports=function(n){return IO?mm.createElement(n):{}}});var gm=Z((PJ,X1)=>{"use strict";var PO=ei(),RO=Un(),LO=Gf();X1.exports=!PO&&!RO(function(){return Object.defineProperty(LO("div"),"a",{get:function(){return 7}}).a!==7})});var kf=Z($1=>{"use strict";var NO=ei(),OO=gi(),DO=$x(),FO=sc(),UO=Mu(),BO=zf(),zO=to(),GO=gm(),Y1=Object.getOwnPropertyDescriptor;$1.f=NO?Y1:function(t,e){if(t=UO(t),e=BO(e),GO)try{return Y1(t,e)}catch(i){}if(zO(t,e))return FO(!OO(DO.f,t,e),t[e])}});var ym=Z((LJ,Z1)=>{"use strict";var kO=ei(),qO=Un();Z1.exports=kO&&qO(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!==42})});var Go=Z((NJ,J1)=>{"use strict";var VO=yi(),HO=String,WO=TypeError;J1.exports=function(n){if(VO(n))return n;throw new WO(HO(n)+" is not an object")}});var ko=Z(K1=>{"use strict";var XO=ei(),YO=gm(),$O=ym(),qf=Go(),j1=zf(),ZO=TypeError,vm=Object.defineProperty,JO=Object.getOwnPropertyDescriptor,_m="enumerable",xm="configurable",Em="writable";K1.f=XO?$O?function(t,e,i){if(qf(t),e=j1(e),qf(i),typeof t=="function"&&e==="prototype"&&"value"in i&&Em in i&&!i[Em]){var s=JO(t,e);s&&s[Em]&&(t[e]=i.value,i={configurable:xm in i?i[xm]:s[xm],enumerable:_m in i?i[_m]:s[_m],writable:!1})}return vm(t,e,i)}:vm:function(t,e,i){if(qf(t),e=j1(e),qf(i),YO)try{return vm(t,e,i)}catch(s){}if("get"in i||"set"in i)throw new ZO("Accessors not supported");return"value"in i&&(t[e]=i.value),t}});var hs=Z((DJ,Q1)=>{"use strict";var jO=ei(),KO=ko(),QO=sc();Q1.exports=jO?function(n,t,e){return KO.f(n,t,QO(1,e))}:function(n,t,e){return n[t]=e,n}});var Vf=Z((FJ,eE)=>{"use strict";var wm=ei(),tD=to(),tE=Function.prototype,eD=wm&&Object.getOwnPropertyDescriptor,Sm=tD(tE,"name"),nD=Sm&&function(){}.name==="something",rD=Sm&&(!wm||wm&&eD(tE,"name").configurable);eE.exports={EXISTS:Sm,PROPER:nD,CONFIGURABLE:rD}});var bm=Z((UJ,nE)=>{"use strict";var iD=Zn(),oD=fr(),Mm=Ff(),sD=iD(Function.toString);oD(Mm.inspectSource)||(Mm.inspectSource=function(n){return sD(n)});nE.exports=Mm.inspectSource});var oE=Z((BJ,iE)=>{"use strict";var aD=wn(),uD=fr(),rE=aD.WeakMap;iE.exports=uD(rE)&&/native code/.test(String(rE))});var Hf=Z((zJ,aE)=>{"use strict";var lD=Uf(),cD=Bf(),sE=lD("keys");aE.exports=function(n){return sE[n]||(sE[n]=cD(n))}});var Wf=Z((GJ,uE)=>{"use strict";uE.exports={}});var Pa=Z((kJ,fE)=>{"use strict";var fD=oE(),cE=wn(),hD=yi(),pD=hs(),Am=to(),Tm=Ff(),dD=Hf(),mD=Wf(),lE="Object already initialized",Cm=cE.TypeError,gD=cE.WeakMap,Xf,cc,Yf,yD=function(n){return Yf(n)?cc(n):Xf(n,{})},vD=function(n){return function(t){var e;if(!hD(t)||(e=cc(t)).type!==n)throw new Cm("Incompatible receiver, "+n+" required");return e}};fD||Tm.state?(vo=Tm.state||(Tm.state=new gD),vo.get=vo.get,vo.has=vo.has,vo.set=vo.set,Xf=function(n,t){if(vo.has(n))throw new Cm(lE);return t.facade=n,vo.set(n,t),t},cc=function(n){return vo.get(n)||{}},Yf=function(n){return vo.has(n)}):(Ia=dD("state"),mD[Ia]=!0,Xf=function(n,t){if(Am(n,Ia))throw new Cm(lE);return t.facade=n,pD(n,Ia,t),t},cc=function(n){return Am(n,Ia)?n[Ia]:{}},Yf=function(n){return Am(n,Ia)});var vo,Ia;fE.exports={set:Xf,get:cc,has:Yf,enforce:yD,getterFor:vD}});var Rm=Z((qJ,dE)=>{"use strict";var Pm=Zn(),_D=Un(),xD=fr(),$f=to(),Im=ei(),ED=Vf().CONFIGURABLE,wD=bm(),pE=Pa(),SD=pE.enforce,MD=pE.get,hE=String,Zf=Object.defineProperty,bD=Pm("".slice),AD=Pm("".replace),TD=Pm([].join),CD=Im&&!_D(function(){return Zf(function(){},"length",{value:8}).length!==8}),ID=String(String).split("String"),PD=dE.exports=function(n,t,e){bD(hE(t),0,7)==="Symbol("&&(t="["+AD(hE(t),/^Symbol\\(([^)]*)\\).*$/,"$1")+"]"),e&&e.getter&&(t="get "+t),e&&e.setter&&(t="set "+t),(!$f(n,"name")||ED&&n.name!==t)&&(Im?Zf(n,"name",{value:t,configurable:!0}):n.name=t),CD&&e&&$f(e,"arity")&&n.length!==e.arity&&Zf(n,"length",{value:e.arity});try{e&&$f(e,"constructor")&&e.constructor?Im&&Zf(n,"prototype",{writable:!1}):n.prototype&&(n.prototype=void 0)}catch(s){}var i=SD(n);return $f(i,"source")||(i.source=TD(ID,typeof t=="string"?t:"")),n};Function.prototype.toString=PD(function(){return xD(this)&&MD(this).source||wD(this)},"toString")});var Ra=Z((VJ,mE)=>{"use strict";var RD=fr(),LD=ko(),ND=Rm(),OD=Df();mE.exports=function(n,t,e,i){i||(i={});var s=i.enumerable,u=i.name!==void 0?i.name:t;if(RD(e)&&ND(e,u,i),i.global)s?n[t]=e:OD(t,e);else{try{i.unsafe?n[t]&&(s=!0):delete n[t]}catch(c){}s?n[t]=e:LD.f(n,t,{value:e,enumerable:!1,configurable:!i.nonConfigurable,writable:!i.nonWritable})}return n}});var yE=Z((HJ,gE)=>{"use strict";var DD=Math.ceil,FD=Math.floor;gE.exports=Math.trunc||function(t){var e=+t;return(e>0?FD:DD)(e)}});var _o=Z((WJ,vE)=>{"use strict";var UD=yE();vE.exports=function(n){var t=+n;return t!==t||t===0?0:UD(t)}});var Jf=Z((XJ,_E)=>{"use strict";var BD=_o(),zD=Math.max,GD=Math.min;_E.exports=function(n,t){var e=BD(n);return e<0?zD(e+t,0):GD(e,t)}});var La=Z((YJ,xE)=>{"use strict";var kD=_o(),qD=Math.min;xE.exports=function(n){var t=kD(n);return t>0?qD(t,9007199254740991):0}});var eo=Z(($J,EE)=>{"use strict";var VD=La();EE.exports=function(n){return VD(n.length)}});var ME=Z((ZJ,SE)=>{"use strict";var HD=Mu(),WD=Jf(),XD=eo(),wE=function(n){return function(t,e,i){var s=HD(t),u=XD(s);if(u===0)return!n&&-1;var c=WD(i,u),f;if(n&&e!==e){for(;u>c;)if(f=s[c++],f!==f)return!0}else for(;u>c;c++)if((n||c in s)&&s[c]===e)return n||c||0;return!n&&-1}};SE.exports={includes:wE(!0),indexOf:wE(!1)}});var Nm=Z((JJ,AE)=>{"use strict";var YD=Zn(),Lm=to(),$D=Mu(),ZD=ME().indexOf,JD=Wf(),bE=YD([].push);AE.exports=function(n,t){var e=$D(n),i=0,s=[],u;for(u in e)!Lm(JD,u)&&Lm(e,u)&&bE(s,u);for(;t.length>i;)Lm(e,u=t[i++])&&(~ZD(s,u)||bE(s,u));return s}});var jf=Z((jJ,TE)=>{"use strict";TE.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]});var Om=Z(CE=>{"use strict";var jD=Nm(),KD=jf(),QD=KD.concat("length","prototype");CE.f=Object.getOwnPropertyNames||function(t){return jD(t,QD)}});var PE=Z(IE=>{"use strict";IE.f=Object.getOwnPropertySymbols});var LE=Z((tj,RE)=>{"use strict";var t3=bu(),e3=Zn(),n3=Om(),r3=PE(),i3=Go(),o3=e3([].concat);RE.exports=t3("Reflect","ownKeys")||function(t){var e=n3.f(i3(t)),i=r3.f;return i?o3(e,i(t)):e}});var Dm=Z((ej,OE)=>{"use strict";var NE=to(),s3=LE(),a3=kf(),u3=ko();OE.exports=function(n,t,e){for(var i=s3(t),s=u3.f,u=a3.f,c=0;c<i.length;c++){var f=i[c];!NE(n,f)&&!(e&&NE(e,f))&&s(n,f,u(t,f))}}});var FE=Z((nj,DE)=>{"use strict";var l3=Un(),c3=fr(),f3=/#|\\.prototype\\./,fc=function(n,t){var e=p3[h3(n)];return e===m3?!0:e===d3?!1:c3(t)?l3(t):!!t},h3=fc.normalize=function(n){return String(n).replace(f3,".").toLowerCase()},p3=fc.data={},d3=fc.NATIVE="N",m3=fc.POLYFILL="P";DE.exports=fc});var qo=Z((rj,UE)=>{"use strict";var Kf=wn(),g3=kf().f,y3=hs(),v3=Ra(),_3=Df(),x3=Dm(),E3=FE();UE.exports=function(n,t){var e=n.target,i=n.global,s=n.stat,u,c,f,p,d,m;if(i?c=Kf:s?c=Kf[e]||_3(e,{}):c=Kf[e]&&Kf[e].prototype,c)for(f in t){if(d=t[f],n.dontCallGetSet?(m=g3(c,f),p=m&&m.value):p=c[f],u=E3(i?f:e+(s?".":"#")+f,n.forced),!u&&p!==void 0){if(typeof d==typeof p)continue;x3(d,p)}(n.sham||p&&p.sham)&&y3(d,"sham",!0),v3(c,f,d,n)}}});var Fm=Z((ij,BE)=>{"use strict";var w3=Gs();BE.exports=Array.isArray||function(t){return w3(t)==="Array"}});var GE=Z((oj,zE)=>{"use strict";var S3=ei(),M3=Fm(),b3=TypeError,A3=Object.getOwnPropertyDescriptor,T3=S3&&!function(){if(this!==void 0)return!0;try{Object.defineProperty([],"length",{writable:!1}).length=1}catch(n){return n instanceof TypeError}}();zE.exports=T3?function(n,t){if(M3(n)&&!A3(n,"length").writable)throw new b3("Cannot set read only .length");return n.length=t}:function(n,t){return n.length=t}});var qE=Z((sj,kE)=>{"use strict";var C3=TypeError,I3=9007199254740991;kE.exports=function(n){if(n>I3)throw C3("Maximum allowed index exceeded");return n}});var Qf=Z(()=>{"use strict";var P3=qo(),R3=zo(),L3=eo(),N3=GE(),O3=qE(),D3=Un(),F3=D3(function(){return[].push.call({length:4294967296},1)!==4294967297}),U3=function(){try{Object.defineProperty([],"length",{writable:!1}).push()}catch(n){return n instanceof TypeError}},B3=F3||!U3();P3({target:"Array",proto:!0,arity:1,forced:B3},{push:function(t){var e=R3(this),i=L3(e),s=arguments.length;O3(i+s);for(var u=0;u<s;u++)e[i]=arguments[u],i++;return N3(e,i),i}})});var YE=Z((lj,XE)=>{"use strict";var z3=Vr(),HE=z3("iterator"),WE=!1;try{VE=0,Um={next:function(){return{done:!!VE++}},return:function(){WE=!0}},Um[HE]=function(){return this},Array.from(Um,function(){throw 2})}catch(n){}var VE,Um;XE.exports=function(n,t){try{if(!t&&!WE)return!1}catch(s){return!1}var e=!1;try{var i={};i[HE]=function(){return{next:function(){return{done:e=!0}}}},n(i)}catch(s){}return e}});var th=Z((cj,$E)=>{"use strict";$E.exports=typeof ArrayBuffer!="undefined"&&typeof DataView!="undefined"});var jE=Z((fj,JE)=>{"use strict";var G3=Vr(),k3=G3("toStringTag"),ZE={};ZE[k3]="z";JE.exports=String(ZE)==="[object z]"});var ks=Z((hj,KE)=>{"use strict";var q3=jE(),V3=fr(),eh=Gs(),H3=Vr(),W3=H3("toStringTag"),X3=Object,Y3=eh(function(){return arguments}())==="Arguments",$3=function(n,t){try{return n[t]}catch(e){}};KE.exports=q3?eh:function(n){var t,e,i;return n===void 0?"Undefined":n===null?"Null":typeof(e=$3(t=X3(n),W3))=="string"?e:Y3?eh(t):(i=eh(t))==="Object"&&V3(t.callee)?"Arguments":i}});var Cu=Z((pj,tw)=>{"use strict";var QE=Rm(),Z3=ko();tw.exports=function(n,t,e){return e.get&&QE(e.get,t,{getter:!0}),e.set&&QE(e.set,t,{setter:!0}),Z3.f(n,t,e)}});var nw=Z((dj,ew)=>{"use strict";var J3=Un();ew.exports=!J3(function(){function n(){}return n.prototype.constructor=null,Object.getPrototypeOf(new n)!==n.prototype})});var hc=Z((mj,iw)=>{"use strict";var j3=to(),K3=fr(),Q3=zo(),tF=Hf(),eF=nw(),rw=tF("IE_PROTO"),Bm=Object,nF=Bm.prototype;iw.exports=eF?Bm.getPrototypeOf:function(n){var t=Q3(n);if(j3(t,rw))return t[rw];var e=t.constructor;return K3(e)&&t instanceof e?e.prototype:t instanceof Bm?nF:null}});var nh=Z((gj,ow)=>{"use strict";var rF=Zn(),iF=Ca();ow.exports=function(n,t,e){try{return rF(iF(Object.getOwnPropertyDescriptor(n,t)[e]))}catch(i){}}});var aw=Z((yj,sw)=>{"use strict";var oF=yi();sw.exports=function(n){return oF(n)||n===null}});var lw=Z((vj,uw)=>{"use strict";var sF=aw(),aF=String,uF=TypeError;uw.exports=function(n){if(sF(n))return n;throw new uF("Can't set "+aF(n)+" as a prototype")}});var Iu=Z((_j,cw)=>{"use strict";var lF=nh(),cF=yi(),fF=Su(),hF=lw();cw.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var n=!1,t={},e;try{e=lF(Object.prototype,"__proto__","set"),e(t,[]),n=t instanceof Array}catch(i){}return function(s,u){return fF(s),hF(u),cF(s)&&(n?e(s,u):s.__proto__=u),s}}():void 0)});var Gi=Z((xj,xw)=>{"use strict";var pF=th(),qm=ei(),vi=wn(),dw=fr(),oh=yi(),Vs=to(),Vm=ks(),dF=uc(),mF=hs(),zm=Ra(),gF=Cu(),yF=ac(),sh=hc(),Ru=Iu(),vF=Vr(),_F=Bf(),mw=Pa(),gw=mw.enforce,xF=mw.get,rh=vi.Int8Array,Gm=rh&&rh.prototype,fw=vi.Uint8ClampedArray,hw=fw&&fw.prototype,Vo=rh&&sh(rh),xo=Gm&&sh(Gm),EF=Object.prototype,Hm=vi.TypeError,pw=vF("toStringTag"),km=_F("TYPED_ARRAY_TAG"),ih="TypedArrayConstructor",ps=pF&&!!Ru&&Vm(vi.opera)!=="Opera",yw=!1,Ci,qs,Pu,ds={Int8Array:1,Uint8Array:1,Uint8ClampedArray:1,Int16Array:2,Uint16Array:2,Int32Array:4,Uint32Array:4,Float32Array:4,Float64Array:8},Wm={BigInt64Array:8,BigUint64Array:8},wF=function(t){if(!oh(t))return!1;var e=Vm(t);return e==="DataView"||Vs(ds,e)||Vs(Wm,e)},vw=function(n){var t=sh(n);if(oh(t)){var e=xF(t);return e&&Vs(e,ih)?e[ih]:vw(t)}},_w=function(n){if(!oh(n))return!1;var t=Vm(n);return Vs(ds,t)||Vs(Wm,t)},SF=function(n){if(_w(n))return n;throw new Hm("Target is not a typed array")},MF=function(n){if(dw(n)&&(!Ru||yF(Vo,n)))return n;throw new Hm(dF(n)+" is not a typed array constructor")},bF=function(n,t,e,i){if(qm){if(e)for(var s in ds){var u=vi[s];if(u&&Vs(u.prototype,n))try{delete u.prototype[n]}catch(c){try{u.prototype[n]=t}catch(f){}}}(!xo[n]||e)&&zm(xo,n,e?t:ps&&Gm[n]||t,i)}},AF=function(n,t,e){var i,s;if(qm){if(Ru){if(e){for(i in ds)if(s=vi[i],s&&Vs(s,n))try{delete s[n]}catch(u){}}if(!Vo[n]||e)try{return zm(Vo,n,e?t:ps&&Vo[n]||t)}catch(u){}else return}for(i in ds)s=vi[i],s&&(!s[n]||e)&&zm(s,n,t)}};for(Ci in ds)qs=vi[Ci],Pu=qs&&qs.prototype,Pu?gw(Pu)[ih]=qs:ps=!1;for(Ci in Wm)qs=vi[Ci],Pu=qs&&qs.prototype,Pu&&(gw(Pu)[ih]=qs);if((!ps||!dw(Vo)||Vo===Function.prototype)&&(Vo=function(){throw new Hm("Incorrect invocation")},ps))for(Ci in ds)vi[Ci]&&Ru(vi[Ci],Vo);if((!ps||!xo||xo===EF)&&(xo=Vo.prototype,ps))for(Ci in ds)vi[Ci]&&Ru(vi[Ci].prototype,xo);ps&&sh(hw)!==xo&&Ru(hw,xo);if(qm&&!Vs(xo,pw)){yw=!0,gF(xo,pw,{configurable:!0,get:function(){return oh(this)?this[km]:void 0}});for(Ci in ds)vi[Ci]&&mF(vi[Ci],km,Ci)}xw.exports={NATIVE_ARRAY_BUFFER_VIEWS:ps,TYPED_ARRAY_TAG:yw&&km,aTypedArray:SF,aTypedArrayConstructor:MF,exportTypedArrayMethod:bF,exportTypedArrayStaticMethod:AF,getTypedArrayConstructor:vw,isView:wF,isTypedArray:_w,TypedArray:Vo,TypedArrayPrototype:xo}});var Sw=Z((Ej,ww)=>{"use strict";var Ew=wn(),Xm=Un(),TF=YE(),CF=Gi().NATIVE_ARRAY_BUFFER_VIEWS,IF=Ew.ArrayBuffer,Na=Ew.Int8Array;ww.exports=!CF||!Xm(function(){Na(1)})||!Xm(function(){new Na(-1)})||!TF(function(n){new Na,new Na(null),new Na(1.5),new Na(n)},!0)||Xm(function(){return new Na(new IF(2),1,void 0).length!==1})});var bw=Z((wj,Mw)=>{"use strict";var PF=Ra();Mw.exports=function(n,t,e){for(var i in t)PF(n,i,t[i],e);return n}});var Ym=Z((Sj,Aw)=>{"use strict";var RF=ac(),LF=TypeError;Aw.exports=function(n,t){if(RF(t,n))return n;throw new LF("Incorrect invocation")}});var ah=Z((Mj,Tw)=>{"use strict";var NF=_o(),OF=La(),DF=RangeError;Tw.exports=function(n){if(n===void 0)return 0;var t=NF(n),e=OF(t);if(t!==e)throw new DF("Wrong length or index");return e}});var Iw=Z((bj,Cw)=>{"use strict";Cw.exports=Math.sign||function(t){var e=+t;return e===0||e!==e?e:e<0?-1:1}});var Lw=Z((Aj,Rw)=>{"use strict";var FF=2220446049250313e-31,Pw=1/FF;Rw.exports=function(n){return n+Pw-Pw}});var Ow=Z((Tj,Nw)=>{"use strict";var UF=Iw(),BF=Lw(),zF=Math.abs,GF=2220446049250313e-31;Nw.exports=function(n,t,e,i){var s=+n,u=zF(s),c=UF(s);if(u<i)return c*BF(u/i/t)*i*t;var f=(1+t/GF)*u,p=f-(f-u);return p>e||p!==p?c*(1/0):c*p}});var Fw=Z((Cj,Dw)=>{"use strict";var kF=Ow(),qF=11920928955078125e-23,VF=34028234663852886e22,HF=11754943508222875e-54;Dw.exports=Math.fround||function(t){return kF(t,qF,VF,HF)}});var Bw=Z((Ij,Uw)=>{"use strict";var WF=Array,XF=Math.abs,ms=Math.pow,YF=Math.floor,$F=Math.log,ZF=Math.LN2,JF=function(n,t,e){var i=WF(e),s=e*8-t-1,u=(1<<s)-1,c=u>>1,f=t===23?ms(2,-24)-ms(2,-77):0,p=n<0||n===0&&1/n<0?1:0,d=0,m,y,v;for(n=XF(n),n!==n||n===1/0?(y=n!==n?1:0,m=u):(m=YF($F(n)/ZF),v=ms(2,-m),n*v<1&&(m--,v*=2),m+c>=1?n+=f/v:n+=f*ms(2,1-c),n*v>=2&&(m++,v/=2),m+c>=u?(y=0,m=u):m+c>=1?(y=(n*v-1)*ms(2,t),m+=c):(y=n*ms(2,c-1)*ms(2,t),m=0));t>=8;)i[d++]=y&255,y/=256,t-=8;for(m=m<<t|y,s+=t;s>0;)i[d++]=m&255,m/=256,s-=8;return i[d-1]|=p*128,i},jF=function(n,t){var e=n.length,i=e*8-t-1,s=(1<<i)-1,u=s>>1,c=i-7,f=e-1,p=n[f--],d=p&127,m;for(p>>=7;c>0;)d=d*256+n[f--],c-=8;for(m=d&(1<<-c)-1,d>>=-c,c+=t;c>0;)m=m*256+n[f--],c-=8;if(d===0)d=1-u;else{if(d===s)return m?NaN:p?-1/0:1/0;m+=ms(2,t),d-=u}return(p?-1:1)*m*ms(2,d-t)};Uw.exports={pack:JF,unpack:jF}});var $m=Z((Pj,Gw)=>{"use strict";var KF=zo(),zw=Jf(),QF=eo();Gw.exports=function(t){for(var e=KF(this),i=QF(e),s=arguments.length,u=zw(s>1?arguments[1]:void 0,i),c=s>2?arguments[2]:void 0,f=c===void 0?i:zw(c,i);f>u;)e[u++]=t;return e}});var Zm=Z((Rj,kw)=>{"use strict";var tU=Zn();kw.exports=tU([].slice)});var Jm=Z((Lj,Vw)=>{"use strict";var eU=fr(),nU=yi(),qw=Iu();Vw.exports=function(n,t,e){var i,s;return qw&&eU(i=t.constructor)&&i!==e&&nU(s=i.prototype)&&s!==e.prototype&&qw(n,s),n}});var pc=Z((Nj,Ww)=>{"use strict";var rU=ko().f,iU=to(),oU=Vr(),Hw=oU("toStringTag");Ww.exports=function(n,t,e){n&&!e&&(n=n.prototype),n&&!iU(n,Hw)&&rU(n,Hw,{configurable:!0,value:t})}});var dh=Z((Oj,uS)=>{"use strict";var hh=wn(),eg=Zn(),jm=ei(),sU=th(),rS=Vf(),aU=hs(),uU=Cu(),Xw=bw(),Km=Un(),uh=Ym(),lU=_o(),cU=La(),ch=ah(),fU=Fw(),iS=Bw(),hU=hc(),Yw=Iu(),pU=$m(),dU=Zm(),mU=Jm(),gU=Dm(),oS=pc(),ng=Pa(),yU=rS.PROPER,$w=rS.CONFIGURABLE,Nu="ArrayBuffer",ph="DataView",Ou="prototype",vU="Wrong length",sS="Wrong index",Zw=ng.getterFor(Nu),mc=ng.getterFor(ph),Jw=ng.set,Eo=hh[Nu],ki=Eo,Lu=ki&&ki[Ou],Ho=hh[ph],Oa=Ho&&Ho[Ou],jw=Object.prototype,_U=hh.Array,fh=hh.RangeError,xU=eg(pU),EU=eg([].reverse),aS=iS.pack,Kw=iS.unpack,Qw=function(n){return[n&255]},tS=function(n){return[n&255,n>>8&255]},eS=function(n){return[n&255,n>>8&255,n>>16&255,n>>24&255]},nS=function(n){return n[3]<<24|n[2]<<16|n[1]<<8|n[0]},wU=function(n){return aS(fU(n),23,4)},SU=function(n){return aS(n,52,8)},lh=function(n,t,e){uU(n[Ou],t,{configurable:!0,get:function(){return e(this)[t]}})},Hs=function(n,t,e,i){var s=mc(n),u=ch(e),c=!!i;if(u+t>s.byteLength)throw new fh(sS);var f=s.bytes,p=u+s.byteOffset,d=dU(f,p,p+t);return c?d:EU(d)},Ws=function(n,t,e,i,s,u){var c=mc(n),f=ch(e),p=i(+s),d=!!u;if(f+t>c.byteLength)throw new fh(sS);for(var m=c.bytes,y=f+c.byteOffset,v=0;v<t;v++)m[y+v]=p[d?v:t-v-1]};sU?(Qm=yU&&Eo.name!==Nu,!Km(function(){Eo(1)})||!Km(function(){new Eo(-1)})||Km(function(){return new Eo,new Eo(1.5),new Eo(NaN),Eo.length!==1||Qm&&!$w})?(ki=function(t){return uh(this,Lu),mU(new Eo(ch(t)),this,ki)},ki[Ou]=Lu,Lu.constructor=ki,gU(ki,Eo)):Qm&&$w&&aU(Eo,"name",Nu),Yw&&hU(Oa)!==jw&&Yw(Oa,jw),dc=new Ho(new ki(2)),tg=eg(Oa.setInt8),dc.setInt8(0,2147483648),dc.setInt8(1,2147483649),(dc.getInt8(0)||!dc.getInt8(1))&&Xw(Oa,{setInt8:function(t,e){tg(this,t,e<<24>>24)},setUint8:function(t,e){tg(this,t,e<<24>>24)}},{unsafe:!0})):(ki=function(t){uh(this,Lu);var e=ch(t);Jw(this,{type:Nu,bytes:xU(_U(e),0),byteLength:e}),jm||(this.byteLength=e,this.detached=!1)},Lu=ki[Ou],Ho=function(t,e,i){uh(this,Oa),uh(t,Lu);var s=Zw(t),u=s.byteLength,c=lU(e);if(c<0||c>u)throw new fh("Wrong offset");if(i=i===void 0?u-c:cU(i),c+i>u)throw new fh(vU);Jw(this,{type:ph,buffer:t,byteLength:i,byteOffset:c,bytes:s.bytes}),jm||(this.buffer=t,this.byteLength=i,this.byteOffset=c)},Oa=Ho[Ou],jm&&(lh(ki,"byteLength",Zw),lh(Ho,"buffer",mc),lh(Ho,"byteLength",mc),lh(Ho,"byteOffset",mc)),Xw(Oa,{getInt8:function(t){return Hs(this,1,t)[0]<<24>>24},getUint8:function(t){return Hs(this,1,t)[0]},getInt16:function(t){var e=Hs(this,2,t,arguments.length>1?arguments[1]:!1);return(e[1]<<8|e[0])<<16>>16},getUint16:function(t){var e=Hs(this,2,t,arguments.length>1?arguments[1]:!1);return e[1]<<8|e[0]},getInt32:function(t){return nS(Hs(this,4,t,arguments.length>1?arguments[1]:!1))},getUint32:function(t){return nS(Hs(this,4,t,arguments.length>1?arguments[1]:!1))>>>0},getFloat32:function(t){return Kw(Hs(this,4,t,arguments.length>1?arguments[1]:!1),23)},getFloat64:function(t){return Kw(Hs(this,8,t,arguments.length>1?arguments[1]:!1),52)},setInt8:function(t,e){Ws(this,1,t,Qw,e)},setUint8:function(t,e){Ws(this,1,t,Qw,e)},setInt16:function(t,e){Ws(this,2,t,tS,e,arguments.length>2?arguments[2]:!1)},setUint16:function(t,e){Ws(this,2,t,tS,e,arguments.length>2?arguments[2]:!1)},setInt32:function(t,e){Ws(this,4,t,eS,e,arguments.length>2?arguments[2]:!1)},setUint32:function(t,e){Ws(this,4,t,eS,e,arguments.length>2?arguments[2]:!1)},setFloat32:function(t,e){Ws(this,4,t,wU,e,arguments.length>2?arguments[2]:!1)},setFloat64:function(t,e){Ws(this,8,t,SU,e,arguments.length>2?arguments[2]:!1)}}));var Qm,dc,tg;oS(ki,Nu);oS(Ho,ph);uS.exports={ArrayBuffer:ki,DataView:Ho}});var cS=Z((Dj,lS)=>{"use strict";var MU=yi(),bU=Math.floor;lS.exports=Number.isInteger||function(t){return!MU(t)&&isFinite(t)&&bU(t)===t}});var hS=Z((Fj,fS)=>{"use strict";var AU=_o(),TU=RangeError;fS.exports=function(n){var t=AU(n);if(t<0)throw new TU("The argument can't be less than 0");return t}});var rg=Z((Uj,pS)=>{"use strict";var CU=hS(),IU=RangeError;pS.exports=function(n,t){var e=CU(n);if(e%t)throw new IU("Wrong offset");return e}});var mS=Z((Bj,dS)=>{"use strict";var PU=Math.round;dS.exports=function(n){var t=PU(n);return t<0?0:t>255?255:t&255}});var yS=Z((zj,gS)=>{"use strict";var RU=Nm(),LU=jf();gS.exports=Object.keys||function(t){return RU(t,LU)}});var _S=Z(vS=>{"use strict";var NU=ei(),OU=ym(),DU=ko(),FU=Go(),UU=Mu(),BU=yS();vS.f=NU&&!OU?Object.defineProperties:function(t,e){FU(t);for(var i=UU(e),s=BU(e),u=s.length,c=0,f;u>c;)DU.f(t,f=s[c++],i[f]);return t}});var ES=Z((kj,xS)=>{"use strict";var zU=bu();xS.exports=zU("document","documentElement")});var Du=Z((qj,CS)=>{"use strict";var GU=Go(),kU=_S(),wS=jf(),qU=Wf(),VU=ES(),HU=Gf(),WU=Hf(),SS=">",MS="<",og="prototype",sg="script",AS=WU("IE_PROTO"),ig=function(){},TS=function(n){return MS+sg+SS+n+MS+"/"+sg+SS},bS=function(n){n.write(TS("")),n.close();var t=n.parentWindow.Object;return n=null,t},XU=function(){var n=HU("iframe"),t="java"+sg+":",e;return n.style.display="none",VU.appendChild(n),n.src=String(t),e=n.contentWindow.document,e.open(),e.write(TS("document.F=Object")),e.close(),e.F},mh,gh=function(){try{mh=new ActiveXObject("htmlfile")}catch(t){}gh=typeof document!="undefined"?document.domain&&mh?bS(mh):XU():bS(mh);for(var n=wS.length;n--;)delete gh[og][wS[n]];return gh()};qU[AS]=!0;CS.exports=Object.create||function(t,e){var i;return t!==null?(ig[og]=GU(t),i=new ig,ig[og]=null,i[AS]=t):i=gh(),e===void 0?i:kU.f(i,e)}});var yh=Z((Vj,IS)=>{"use strict";var YU=Gs(),$U=Zn();IS.exports=function(n){if(YU(n)==="Function")return $U(n)}});var vh=Z((Hj,RS)=>{"use strict";var PS=yh(),ZU=Ca(),JU=oc(),jU=PS(PS.bind);RS.exports=function(n,t){return ZU(n),t===void 0?n:JU?jU(n,t):function(){return n.apply(t,arguments)}}});var ug=Z((Wj,FS)=>{"use strict";var KU=Zn(),QU=Un(),LS=fr(),tB=ks(),eB=bu(),nB=bm(),NS=function(){},OS=eB("Reflect","construct"),ag=/^\\s*(?:class|function)\\b/,rB=KU(ag.exec),iB=!ag.test(NS),gc=function(t){if(!LS(t))return!1;try{return OS(NS,[],t),!0}catch(e){return!1}},DS=function(t){if(!LS(t))return!1;switch(tB(t)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return iB||!!rB(ag,nB(t))}catch(e){return!0}};DS.sham=!0;FS.exports=!OS||QU(function(){var n;return gc(gc.call)||!gc(Object)||!gc(function(){n=!0})||n})?DS:gc});var BS=Z((Xj,US)=>{"use strict";var oB=ug(),sB=uc(),aB=TypeError;US.exports=function(n){if(oB(n))return n;throw new aB(sB(n)+" is not a constructor")}});var Fu=Z((Yj,zS)=>{"use strict";zS.exports={}});var lg=Z(($j,kS)=>{"use strict";var uB=ks(),GS=Of(),lB=Pf(),cB=Fu(),fB=Vr(),hB=fB("iterator");kS.exports=function(n){if(!lB(n))return GS(n,hB)||GS(n,"@@iterator")||cB[uB(n)]}});var VS=Z((Zj,qS)=>{"use strict";var pB=gi(),dB=Ca(),mB=Go(),gB=uc(),yB=lg(),vB=TypeError;qS.exports=function(n,t){var e=arguments.length<2?yB(n):t;if(dB(e))return mB(pB(e,n));throw new vB(gB(n)+" is not iterable")}});var WS=Z((Jj,HS)=>{"use strict";var _B=Vr(),xB=Fu(),EB=_B("iterator"),wB=Array.prototype;HS.exports=function(n){return n!==void 0&&(xB.Array===n||wB[EB]===n)}});var cg=Z((jj,XS)=>{"use strict";var SB=ks();XS.exports=function(n){var t=SB(n);return t==="BigInt64Array"||t==="BigUint64Array"}});var _h=Z((Kj,YS)=>{"use strict";var MB=dm(),bB=TypeError;YS.exports=function(n){var t=MB(n,"number");if(typeof t=="number")throw new bB("Can't convert number to bigint");return BigInt(t)}});var ZS=Z((Qj,$S)=>{"use strict";var AB=vh(),TB=gi(),CB=BS(),IB=zo(),PB=eo(),RB=VS(),LB=lg(),NB=WS(),OB=cg(),DB=Gi().aTypedArrayConstructor,FB=_h();$S.exports=function(t){var e=CB(this),i=IB(t),s=arguments.length,u=s>1?arguments[1]:void 0,c=u!==void 0,f=LB(i),p,d,m,y,v,E,M,A;if(f&&!NB(f))for(M=RB(i,f),A=M.next,i=[];!(E=TB(A,M)).done;)i.push(E.value);for(c&&s>2&&(u=AB(u,arguments[2])),d=PB(i),m=new(DB(e))(d),y=OB(m),p=0;d>p;p++)v=c?u(i[p],p):i[p],m[p]=y?FB(v):+v;return m}});var QS=Z((tK,KS)=>{"use strict";var JS=Fm(),UB=ug(),BB=yi(),zB=Vr(),GB=zB("species"),jS=Array;KS.exports=function(n){var t;return JS(n)&&(t=n.constructor,UB(t)&&(t===jS||JS(t.prototype))?t=void 0:BB(t)&&(t=t[GB],t===null&&(t=void 0))),t===void 0?jS:t}});var eM=Z((eK,tM)=>{"use strict";var kB=QS();tM.exports=function(n,t){return new(kB(n))(t===0?0:t)}});var iM=Z((nK,rM)=>{"use strict";var qB=vh(),VB=Zn(),HB=If(),WB=zo(),XB=eo(),YB=eM(),nM=VB([].push),Xs=function(n){var t=n===1,e=n===2,i=n===3,s=n===4,u=n===6,c=n===7,f=n===5||u;return function(p,d,m,y){for(var v=WB(p),E=HB(v),M=XB(E),A=qB(d,m),_=0,x=y||YB,T=t?x(p,M):e||c?x(p,0):void 0,S,R;M>_;_++)if((f||_ in E)&&(S=E[_],R=A(S,_,v),n))if(t)T[_]=R;else if(R)switch(n){case 3:return!0;case 5:return S;case 6:return _;case 2:nM(T,S)}else switch(n){case 4:return!1;case 7:nM(T,S)}return u?-1:i||s?s:T}};rM.exports={forEach:Xs(0),map:Xs(1),filter:Xs(2),some:Xs(3),every:Xs(4),find:Xs(5),findIndex:Xs(6),filterReject:Xs(7)}});var fg=Z((rK,sM)=>{"use strict";var $B=bu(),ZB=Cu(),JB=Vr(),jB=ei(),oM=JB("species");sM.exports=function(n){var t=$B(n);jB&&t&&!t[oM]&&ZB(t,oM,{configurable:!0,get:function(){return this}})}});var hg=Z((iK,aM)=>{"use strict";var KB=eo();aM.exports=function(n,t,e){for(var i=0,s=arguments.length>2?e:KB(t),u=new n(s);s>i;)u[i]=t[i++];return u}});var TM=Z((oK,_g)=>{"use strict";var uM=qo(),_M=wn(),lM=gi(),QB=ei(),tz=Sw(),xc=Gi(),xM=dh(),cM=Ym(),ez=sc(),yc=hs(),nz=cS(),rz=La(),fM=ah(),pg=rg(),iz=mS(),EM=zf(),vc=to(),oz=ks(),gg=yi(),sz=Nf(),az=Du(),uz=ac(),xh=Iu(),lz=Om().f,hM=ZS(),cz=iM().forEach,fz=fg(),hz=Cu(),wM=ko(),SM=kf(),pM=hg(),xg=Pa(),pz=Jm(),yg=xg.get,dz=xg.set,mz=xg.enforce,MM=wM.f,gz=SM.f,dg=_M.RangeError,bM=xM.ArrayBuffer,yz=bM.prototype,vz=xM.DataView,Eh=xc.NATIVE_ARRAY_BUFFER_VIEWS,dM=xc.TYPED_ARRAY_TAG,mM=xc.TypedArray,_c=xc.TypedArrayPrototype,vg=xc.isTypedArray,wh="BYTES_PER_ELEMENT",mg="Wrong length",Sh=function(n,t){hz(n,t,{configurable:!0,get:function(){return yg(this)[t]}})},gM=function(n){var t;return uz(yz,n)||(t=oz(n))==="ArrayBuffer"||t==="SharedArrayBuffer"},AM=function(n,t){return vg(n)&&!sz(t)&&t in n&&nz(+t)&&t>=0},yM=function(t,e){return e=EM(e),AM(t,e)?ez(2,t[e]):gz(t,e)},vM=function(t,e,i){return e=EM(e),AM(t,e)&&gg(i)&&vc(i,"value")&&!vc(i,"get")&&!vc(i,"set")&&!i.configurable&&(!vc(i,"writable")||i.writable)&&(!vc(i,"enumerable")||i.enumerable)?(t[e]=i.value,t):MM(t,e,i)};QB?(Eh||(SM.f=yM,wM.f=vM,Sh(_c,"buffer"),Sh(_c,"byteOffset"),Sh(_c,"byteLength"),Sh(_c,"length")),uM({target:"Object",stat:!0,forced:!Eh},{getOwnPropertyDescriptor:yM,defineProperty:vM}),_g.exports=function(n,t,e){var i=n.match(/\\d+/)[0]/8,s=n+(e?"Clamped":"")+"Array",u="get"+n,c="set"+n,f=_M[s],p=f,d=p&&p.prototype,m={},y=function(A,_){var x=yg(A);return x.view[u](_*i+x.byteOffset,!0)},v=function(A,_,x){var T=yg(A);T.view[c](_*i+T.byteOffset,e?iz(x):x,!0)},E=function(A,_){MM(A,_,{get:function(){return y(this,_)},set:function(x){return v(this,_,x)},enumerable:!0})};Eh?tz&&(p=t(function(A,_,x,T){return cM(A,d),pz(function(){return gg(_)?gM(_)?T!==void 0?new f(_,pg(x,i),T):x!==void 0?new f(_,pg(x,i)):new f(_):vg(_)?pM(p,_):lM(hM,p,_):new f(fM(_))}(),A,p)}),xh&&xh(p,mM),cz(lz(f),function(A){A in p||yc(p,A,f[A])}),p.prototype=d):(p=t(function(A,_,x,T){cM(A,d);var S=0,R=0,z,U,D;if(!gg(_))D=fM(_),U=D*i,z=new bM(U);else if(gM(_)){z=_,R=pg(x,i);var P=_.byteLength;if(T===void 0){if(P%i)throw new dg(mg);if(U=P-R,U<0)throw new dg(mg)}else if(U=rz(T)*i,U+R>P)throw new dg(mg);D=U/i}else return vg(_)?pM(p,_):lM(hM,p,_);for(dz(A,{buffer:z,byteOffset:R,byteLength:U,length:D,view:new vz(z)});S<D;)E(A,S++)}),xh&&xh(p,mM),d=p.prototype=az(_c)),d.constructor!==p&&yc(d,"constructor",p),mz(d).TypedArrayConstructor=p,dM&&yc(d,dM,s);var M=p!==f;m[s]=p,uM({global:!0,constructor:!0,forced:M,sham:!Eh},m),wh in p||yc(p,wh,i),wh in d||yc(d,wh,i),fz(s)}):_g.exports=function(){}});var Eg=Z(()=>{"use strict";var _z=TM();_z("Float32",function(n){return function(e,i,s){return n(this,e,i,s)}})});var wg=Z(()=>{"use strict";var CM=Gi(),xz=eo(),Ez=_o(),wz=CM.aTypedArray,Sz=CM.exportTypedArrayMethod;Sz("at",function(t){var e=wz(this),i=xz(e),s=Ez(t),u=s>=0?s:i+s;return u<0||u>=i?void 0:e[u]})});var Sg=Z(()=>{"use strict";var IM=Gi(),Mz=$m(),bz=_h(),Az=ks(),Tz=gi(),Cz=Zn(),Iz=Un(),Pz=IM.aTypedArray,Rz=IM.exportTypedArrayMethod,Lz=Cz("".slice),Nz=Iz(function(){var n=0;return new Int8Array(2).fill({valueOf:function(){return n++}}),n!==1});Rz("fill",function(t){var e=arguments.length;Pz(this);var i=Lz(Az(this),0,3)==="Big"?bz(t):+t;return Tz(Mz,this,i,e>1?arguments[1]:void 0,e>2?arguments[2]:void 0)},Nz)});var Mg=Z((hK,RM)=>{"use strict";var Oz=vh(),Dz=If(),Fz=zo(),Uz=eo(),PM=function(n){var t=n===1;return function(e,i,s){for(var u=Fz(e),c=Dz(u),f=Uz(c),p=Oz(i,s),d,m;f-- >0;)if(d=c[f],m=p(d,f,u),m)switch(n){case 0:return d;case 1:return f}return t?-1:void 0}};RM.exports={findLast:PM(0),findLastIndex:PM(1)}});var bg=Z(()=>{"use strict";var LM=Gi(),Bz=Mg().findLast,zz=LM.aTypedArray,Gz=LM.exportTypedArrayMethod;Gz("findLast",function(t){return Bz(zz(this),t,arguments.length>1?arguments[1]:void 0)})});var Ag=Z(()=>{"use strict";var NM=Gi(),kz=Mg().findLastIndex,qz=NM.aTypedArray,Vz=NM.exportTypedArrayMethod;Vz("findLastIndex",function(t){return kz(qz(this),t,arguments.length>1?arguments[1]:void 0)})});var Pg=Z(()=>{"use strict";var DM=wn(),FM=gi(),Ig=Gi(),Hz=eo(),Wz=rg(),Xz=zo(),UM=Un(),Yz=DM.RangeError,Tg=DM.Int8Array,OM=Tg&&Tg.prototype,BM=OM&&OM.set,$z=Ig.aTypedArray,Zz=Ig.exportTypedArrayMethod,Cg=!UM(function(){var n=new Uint8ClampedArray(2);return FM(BM,n,{length:1,0:3},1),n[1]!==3}),Jz=Cg&&Ig.NATIVE_ARRAY_BUFFER_VIEWS&&UM(function(){var n=new Tg(2);return n.set(1),n.set("2",1),n[0]!==0||n[1]!==2});Zz("set",function(t){$z(this);var e=Wz(arguments.length>1?arguments[1]:void 0,1),i=Xz(t);if(Cg)return FM(BM,this,i,e);var s=this.length,u=Hz(i),c=0;if(u+e>s)throw new Yz("Wrong length");for(;c<u;)this[e+c]=i[c++]},!Cg||Jz)});var kM=Z((_K,GM)=>{"use strict";var zM=Zm(),jz=Math.floor,Rg=function(n,t){var e=n.length;if(e<8)for(var i=1,s,u;i<e;){for(u=i,s=n[i];u&&t(n[u-1],s)>0;)n[u]=n[--u];u!==i++&&(n[u]=s)}else for(var c=jz(e/2),f=Rg(zM(n,0,c),t),p=Rg(zM(n,c),t),d=f.length,m=p.length,y=0,v=0;y<d||v<m;)n[y+v]=y<d&&v<m?t(f[y],p[v])<=0?f[y++]:p[v++]:y<d?f[y++]:p[v++];return n};GM.exports=Rg});var HM=Z((xK,VM)=>{"use strict";var Kz=Au(),qM=Kz.match(/firefox\\/(\\d+)/i);VM.exports=!!qM&&+qM[1]});var XM=Z((EK,WM)=>{"use strict";var Qz=Au();WM.exports=/MSIE|Trident/.test(Qz)});var ZM=Z((wK,$M)=>{"use strict";var tG=Au(),YM=tG.match(/AppleWebKit\\/(\\d+)\\./);$M.exports=!!YM&&+YM[1]});var Ng=Z(()=>{"use strict";var eG=wn(),nG=yh(),Lg=Un(),rG=Ca(),iG=kM(),tb=Gi(),JM=HM(),oG=XM(),jM=Lf(),KM=ZM(),sG=tb.aTypedArray,aG=tb.exportTypedArrayMethod,Ec=eG.Uint16Array,Uu=Ec&&nG(Ec.prototype.sort),uG=!!Uu&&!(Lg(function(){Uu(new Ec(2),null)})&&Lg(function(){Uu(new Ec(2),{})})),QM=!!Uu&&!Lg(function(){if(jM)return jM<74;if(JM)return JM<67;if(oG)return!0;if(KM)return KM<602;var n=new Ec(516),t=Array(516),e,i;for(e=0;e<516;e++)i=e%4,n[e]=515-e,t[e]=e-2*i+3;for(Uu(n,function(s,u){return(s/4|0)-(u/4|0)}),e=0;e<516;e++)if(n[e]!==t[e])return!0}),lG=function(n){return function(t,e){return n!==void 0?+n(t,e)||0:e!==e?-1:t!==t?1:t===0&&e===0?1/t>0&&1/e<0?1:-1:t>e}};aG("sort",function(t){return t!==void 0&&rG(t),QM?Uu(this,t):iG(sG(this),lG(t))},!QM||uG)});var nb=Z((bK,eb)=>{"use strict";var cG=eo();eb.exports=function(n,t){for(var e=cG(n),i=new t(e),s=0;s<e;s++)i[s]=n[e-s-1];return i}});var Dg=Z(()=>{"use strict";var fG=nb(),Og=Gi(),hG=Og.aTypedArray,pG=Og.exportTypedArrayMethod,dG=Og.getTypedArrayConstructor;pG("toReversed",function(){return fG(hG(this),dG(this))})});var Fg=Z(()=>{"use strict";var Mh=Gi(),mG=Zn(),gG=Ca(),yG=hg(),vG=Mh.aTypedArray,_G=Mh.getTypedArrayConstructor,xG=Mh.exportTypedArrayMethod,EG=mG(Mh.TypedArrayPrototype.sort);xG("toSorted",function(t){t!==void 0&&gG(t);var e=vG(this),i=yG(_G(e),e);return EG(i,t)})});var ib=Z((PK,rb)=>{"use strict";var wG=eo(),SG=_o(),MG=RangeError;rb.exports=function(n,t,e,i){var s=wG(n),u=SG(e),c=u<0?s+u:u;if(c>=s||c<0)throw new MG("Incorrect index");for(var f=new t(s),p=0;p<s;p++)f[p]=p===c?i:n[p];return f}});var Bg=Z(()=>{"use strict";var bG=ib(),Ug=Gi(),AG=cg(),TG=_o(),CG=_h(),IG=Ug.aTypedArray,PG=Ug.getTypedArrayConstructor,RG=Ug.exportTypedArrayMethod,LG=!!function(){try{new Int8Array(1).with(2,{valueOf:function(){throw 8}})}catch(n){return n===8}}();RG("with",function(n,t){var e=IG(this),i=TG(n),s=AG(e)?CG(t):+t;return bG(e,PG(e),i,s)},!LG)});var Gg=Z(()=>{"use strict";var NG=qo(),OG=wn(),DG=dh(),FG=fg(),zg="ArrayBuffer",ob=DG[zg],UG=OG[zg];NG({global:!0,constructor:!0,forced:UG!==ob},{ArrayBuffer:ob});FG(zg)});var Hg=Z(()=>{"use strict";var BG=qo(),qg=yh(),zG=Un(),lb=dh(),sb=Go(),ab=Jf(),GG=La(),Vg=lb.ArrayBuffer,kg=lb.DataView,cb=kg.prototype,ub=qg(Vg.prototype.slice),kG=qg(cb.getUint8),qG=qg(cb.setUint8),VG=zG(function(){return!new Vg(2).slice(1,void 0).byteLength});BG({target:"ArrayBuffer",proto:!0,unsafe:!0,forced:VG},{slice:function(t,e){if(ub&&e===void 0)return ub(sb(this),t);for(var i=sb(this).byteLength,s=ab(t,i),u=ab(e===void 0?i:e,i),c=new Vg(GG(u-s)),f=new kg(this),p=new kg(c),d=0;s<u;)qG(p,d++,kG(f,s++));return c}})});var Wg=Z((UK,pb)=>{"use strict";var hb=wn(),HG=nh(),WG=Gs(),fb=hb.ArrayBuffer,XG=hb.TypeError;pb.exports=fb&&HG(fb.prototype,"byteLength","get")||function(n){if(WG(n)!=="ArrayBuffer")throw new XG("ArrayBuffer expected");return n.byteLength}});var Xg=Z((BK,db)=>{"use strict";var YG=wn(),$G=th(),ZG=Wg(),JG=YG.DataView;db.exports=function(n){if(!$G||ZG(n)!==0)return!1;try{return new JG(n),!1}catch(t){return!0}}});var Yg=Z(()=>{"use strict";var jG=ei(),KG=Cu(),QG=Xg(),mb=ArrayBuffer.prototype;jG&&!("detached"in mb)&&KG(mb,"detached",{configurable:!0,get:function(){return QG(this)}})});var yb=Z((kK,gb)=>{"use strict";var t4=Xg(),e4=TypeError;gb.exports=function(n){if(t4(n))throw new e4("ArrayBuffer is detached");return n}});var $g=Z((qK,vb)=>{"use strict";var wc=wn(),n4=Au(),r4=Gs(),bh=function(n){return n4.slice(0,n.length)===n};vb.exports=function(){return bh("Bun/")?"BUN":bh("Cloudflare-Workers")?"CLOUDFLARE":bh("Deno/")?"DENO":bh("Node.js/")?"NODE":wc.Bun&&typeof Bun.version=="string"?"BUN":wc.Deno&&typeof Deno.version=="object"?"DENO":r4(wc.process)==="process"?"NODE":wc.window&&wc.document?"BROWSER":"REST"}()});var xb=Z((VK,_b)=>{"use strict";var i4=$g();_b.exports=i4==="NODE"});var wb=Z((HK,Eb)=>{"use strict";var o4=wn(),s4=xb();Eb.exports=function(n){if(s4){try{return o4.process.getBuiltinModule(n)}catch(t){}try{return Function('return require("'+n+'")')()}catch(t){}}}});var jg=Z((WK,Mb)=>{"use strict";var a4=wn(),u4=Un(),Zg=Lf(),Jg=$g(),Sb=a4.structuredClone;Mb.exports=!!Sb&&!u4(function(){if(Jg==="DENO"&&Zg>92||Jg==="NODE"&&Zg>94||Jg==="BROWSER"&&Zg>97)return!1;var n=new ArrayBuffer(8),t=Sb(n,{transfer:[n]});return n.byteLength!==0||t.byteLength!==8})});var Cb=Z((XK,Tb)=>{"use strict";var e0=wn(),l4=wb(),c4=jg(),f4=e0.structuredClone,bb=e0.ArrayBuffer,Ah=e0.MessageChannel,t0=!1,Kg,Ab,Th,Qg;if(c4)t0=function(n){f4(n,{transfer:[n]})};else if(bb)try{Ah||(Kg=l4("worker_threads"),Kg&&(Ah=Kg.MessageChannel)),Ah&&(Ab=new Ah,Th=new bb(2),Qg=function(n){Ab.port1.postMessage(null,[n])},Th.byteLength===2&&(Qg(Th),Th.byteLength===0&&(t0=Qg)))}catch(n){}Tb.exports=t0});var a0=Z((YK,Db)=>{"use strict";var i0=wn(),o0=Zn(),Lb=nh(),h4=ah(),p4=yb(),d4=Wg(),Ib=Cb(),n0=jg(),m4=i0.structuredClone,Nb=i0.ArrayBuffer,r0=i0.DataView,g4=Math.min,s0=Nb.prototype,Ob=r0.prototype,y4=o0(s0.slice),Pb=Lb(s0,"resizable","get"),Rb=Lb(s0,"maxByteLength","get"),v4=o0(Ob.getInt8),_4=o0(Ob.setInt8);Db.exports=(n0||Ib)&&function(n,t,e){var i=d4(n),s=t===void 0?i:h4(t),u=!Pb||!Pb(n),c;if(p4(n),n0&&(n=m4(n,{transfer:[n]}),i===s&&(e||u)))return n;if(i>=s&&(!e||u))c=y4(n,0,s);else{var f=e&&!u&&Rb?{maxByteLength:Rb(n)}:void 0;c=new Nb(s,f);for(var p=new r0(n),d=new r0(c),m=g4(s,i),y=0;y<m;y++)_4(d,y,v4(p,y))}return n0||Ib(n),c}});var u0=Z(()=>{"use strict";var x4=qo(),Fb=a0();Fb&&x4({target:"ArrayBuffer",proto:!0},{transfer:function(){return Fb(this,arguments.length?arguments[0]:void 0,!0)}})});var l0=Z(()=>{"use strict";var E4=qo(),Ub=a0();Ub&&E4({target:"ArrayBuffer",proto:!0},{transferToFixedLength:function(){return Ub(this,arguments.length?arguments[0]:void 0,!1)}})});var Bb=Z(()=>{"use strict";var w4=qo(),S4=gi();w4({target:"URL",proto:!0,enumerable:!0},{toJSON:function(){return S4(URL.prototype.toString,this)}})});var GT=Z((oQ,zT)=>{"use strict";zT.exports={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0}});var VT=Z((sQ,qT)=>{"use strict";var o8=Gf(),Jy=o8("span").classList,kT=Jy&&Jy.constructor&&Jy.constructor.prototype;qT.exports=kT===Object.prototype?void 0:kT});var WT=Z((aQ,HT)=>{"use strict";var s8=Vr(),a8=Du(),u8=ko().f,jy=s8("unscopables"),Ky=Array.prototype;Ky[jy]===void 0&&u8(Ky,jy,{configurable:!0,value:a8(null)});HT.exports=function(n){Ky[jy][n]=!0}});var nv=Z((uQ,$T)=>{"use strict";var l8=Un(),c8=fr(),f8=yi(),h8=Du(),XT=hc(),p8=Ra(),d8=Vr(),m8=lc(),ev=d8("iterator"),YT=!1,Is,Qy,tv;[].keys&&(tv=[].keys(),"next"in tv?(Qy=XT(XT(tv)),Qy!==Object.prototype&&(Is=Qy)):YT=!0);var g8=!f8(Is)||l8(function(){var n={};return Is[ev].call(n)!==n});g8?Is={}:m8&&(Is=h8(Is));c8(Is[ev])||p8(Is,ev,function(){return this});$T.exports={IteratorPrototype:Is,BUGGY_SAFARI_ITERATORS:YT}});var JT=Z((lQ,ZT)=>{"use strict";var y8=nv().IteratorPrototype,v8=Du(),_8=sc(),x8=pc(),E8=Fu(),w8=function(){return this};ZT.exports=function(n,t,e,i){var s=t+" Iterator";return n.prototype=v8(y8,{next:_8(+!i,e)}),x8(n,s,!1,!0),E8[s]=w8,n}});var aC=Z((cQ,sC)=>{"use strict";var S8=qo(),M8=gi(),Lp=lc(),iC=Vf(),b8=fr(),A8=JT(),jT=hc(),KT=Iu(),T8=pc(),C8=hs(),rv=Ra(),I8=Vr(),QT=Fu(),oC=nv(),P8=iC.PROPER,R8=iC.CONFIGURABLE,tC=oC.IteratorPrototype,Np=oC.BUGGY_SAFARI_ITERATORS,Hc=I8("iterator"),eC="keys",Wc="values",nC="entries",rC=function(){return this};sC.exports=function(n,t,e,i,s,u,c){A8(e,t,i);var f=function(x){if(x===s&&v)return v;if(!Np&&x&&x in m)return m[x];switch(x){case eC:return function(){return new e(this,x)};case Wc:return function(){return new e(this,x)};case nC:return function(){return new e(this,x)}}return function(){return new e(this)}},p=t+" Iterator",d=!1,m=n.prototype,y=m[Hc]||m["@@iterator"]||s&&m[s],v=!Np&&y||f(s),E=t==="Array"&&m.entries||y,M,A,_;if(E&&(M=jT(E.call(new n)),M!==Object.prototype&&M.next&&(!Lp&&jT(M)!==tC&&(KT?KT(M,tC):b8(M[Hc])||rv(M,Hc,rC)),T8(M,p,!0,!0),Lp&&(QT[p]=rC))),P8&&s===Wc&&y&&y.name!==Wc&&(!Lp&&R8?C8(m,"name",Wc):(d=!0,v=function(){return M8(y,this)})),s)if(A={values:f(Wc),keys:u?v:f(eC),entries:f(nC)},c)for(_ in A)(Np||d||!(_ in m))&&rv(m,_,A[_]);else S8({target:t,proto:!0,forced:Np||d},A);return(!Lp||c)&&m[Hc]!==v&&rv(m,Hc,v,{name:s}),QT[t]=v,A}});var lC=Z((fQ,uC)=>{"use strict";uC.exports=function(n,t){return{value:n,done:t}}});var mC=Z((hQ,dC)=>{"use strict";var L8=Mu(),iv=WT(),cC=Fu(),hC=Pa(),N8=ko().f,O8=aC(),Op=lC(),D8=lc(),F8=ei(),pC="Array Iterator",U8=hC.set,B8=hC.getterFor(pC);dC.exports=O8(Array,"Array",function(n,t){U8(this,{type:pC,target:L8(n),index:0,kind:t})},function(){var n=B8(this),t=n.target,e=n.index++;if(!t||e>=t.length)return n.target=null,Op(void 0,!0);switch(n.kind){case"keys":return Op(e,!1);case"values":return Op(t[e],!1)}return Op([e,t[e]],!1)},"values");var fC=cC.Arguments=cC.Array;iv("keys");iv("values");iv("entries");if(!D8&&F8&&fC.name!=="values")try{N8(fC,"name",{value:"values"})}catch(n){}});var av=Z(()=>{"use strict";var gC=wn(),vC=GT(),z8=VT(),Xc=mC(),yC=hs(),G8=pc(),k8=Vr(),ov=k8("iterator"),sv=Xc.values,_C=function(n,t){if(n){if(n[ov]!==sv)try{yC(n,ov,sv)}catch(i){n[ov]=sv}if(G8(n,t,!0),vC[t]){for(var e in Xc)if(n[e]!==Xc[e])try{yC(n,e,Xc[e])}catch(i){n[e]=Xc[e]}}}};for(Dp in vC)_C(gC[Dp]&&gC[Dp].prototype,Dp);var Dp;_C(z8,"DOMTokenList")});var Fp=Z((EQ,xC)=>{"use strict";var q8=ks(),V8=String;xC.exports=function(n){if(q8(n)==="Symbol")throw new TypeError("Cannot convert a Symbol value to a string");return V8(n)}});var wC=Z((wQ,EC)=>{"use strict";var H8=Go();EC.exports=function(){var n=H8(this),t="";return n.hasIndices&&(t+="d"),n.global&&(t+="g"),n.ignoreCase&&(t+="i"),n.multiline&&(t+="m"),n.dotAll&&(t+="s"),n.unicode&&(t+="u"),n.unicodeSets&&(t+="v"),n.sticky&&(t+="y"),t}});var MC=Z((SQ,SC)=>{"use strict";var uv=Un(),W8=wn(),lv=W8.RegExp,cv=uv(function(){var n=lv("a","y");return n.lastIndex=2,n.exec("abcd")!==null}),X8=cv||uv(function(){return!lv("a","y").sticky}),Y8=cv||uv(function(){var n=lv("^r","gy");return n.lastIndex=2,n.exec("str")!==null});SC.exports={BROKEN_CARET:Y8,MISSED_STICKY:X8,UNSUPPORTED_Y:cv}});var AC=Z((MQ,bC)=>{"use strict";var $8=Un(),Z8=wn(),J8=Z8.RegExp;bC.exports=$8(function(){var n=J8(".","s");return!(n.dotAll&&n.test(\`
|
|
226
226
|
\`)&&n.flags==="s")})});var CC=Z((bQ,TC)=>{"use strict";var j8=Un(),K8=wn(),Q8=K8.RegExp;TC.exports=j8(function(){var n=Q8("(?<a>b)","g");return n.exec("b").groups.a!=="b"||"b".replace(n,"$<a>c")!=="bc"})});var zp=Z((AQ,PC)=>{"use strict";var _l=gi(),Bp=Zn(),tW=Fp(),eW=wC(),nW=MC(),rW=Uf(),iW=Du(),oW=Pa().get,sW=AC(),aW=CC(),uW=rW("native-string-replace",String.prototype.replace),Up=RegExp.prototype.exec,hv=Up,lW=Bp("".charAt),cW=Bp("".indexOf),fW=Bp("".replace),fv=Bp("".slice),pv=function(){var n=/a/,t=/b*/g;return _l(Up,n,"a"),_l(Up,t,"a"),n.lastIndex!==0||t.lastIndex!==0}(),IC=nW.BROKEN_CARET,dv=/()??/.exec("")[1]!==void 0,hW=pv||dv||IC||sW||aW;hW&&(hv=function(t){var e=this,i=oW(e),s=tW(t),u=i.raw,c,f,p,d,m,y,v;if(u)return u.lastIndex=e.lastIndex,c=_l(hv,u,s),e.lastIndex=u.lastIndex,c;var E=i.groups,M=IC&&e.sticky,A=_l(eW,e),_=e.source,x=0,T=s;if(M&&(A=fW(A,"y",""),cW(A,"g")===-1&&(A+="g"),T=fv(s,e.lastIndex),e.lastIndex>0&&(!e.multiline||e.multiline&&lW(s,e.lastIndex-1)!==\`
|
|
227
227
|
\`)&&(_="(?: "+_+")",T=" "+T,x++),f=new RegExp("^(?:"+_+")",A)),dv&&(f=new RegExp("^"+_+"$(?!\\\\s)",A)),pv&&(p=e.lastIndex),d=_l(Up,M?f:e,T),M?d?(d.input=fv(d.input,x),d[0]=fv(d[0],x),d.index=e.lastIndex,e.lastIndex+=d[0].length):e.lastIndex=0:pv&&d&&(e.lastIndex=e.global?d.index+d[0].length:p),dv&&d&&d.length>1&&_l(uW,d[0],f,function(){for(m=1;m<arguments.length-2;m++)arguments[m]===void 0&&(d[m]=void 0)}),d&&E)for(d.groups=y=iW(null),m=0;m<E.length;m++)v=E[m],y[v[0]]=d[v[1]];return d});PC.exports=hv});var mv=Z(()=>{"use strict";var pW=qo(),RC=zp();pW({target:"RegExp",proto:!0,forced:/./.exec!==RC},{exec:RC})});var Gp=Z((DQ,OC)=>{"use strict";var NC=Object.getOwnPropertySymbols,yW=Object.prototype.hasOwnProperty,vW=Object.prototype.propertyIsEnumerable;function _W(n){if(n==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(n)}function xW(){try{if(!Object.assign)return!1;var n=new String("abc");if(n[5]="de",Object.getOwnPropertyNames(n)[0]==="5")return!1;for(var t={},e=0;e<10;e++)t["_"+String.fromCharCode(e)]=e;var i=Object.getOwnPropertyNames(t).map(function(u){return t[u]});if(i.join("")!=="0123456789")return!1;var s={};return"abcdefghijklmnopqrst".split("").forEach(function(u){s[u]=u}),Object.keys(Object.assign({},s)).join("")==="abcdefghijklmnopqrst"}catch(u){return!1}}OC.exports=xW()?Object.assign:function(n,t){for(var e,i=_W(n),s,u=1;u<arguments.length;u++){e=Object(arguments[u]);for(var c in e)yW.call(e,c)&&(i[c]=e[c]);if(NC){s=NC(e);for(var f=0;f<s.length;f++)vW.call(e,s[f])&&(i[s[f]]=e[s[f]])}}return i}});var Ev=Z((_v,xv)=>{(function(n,t){typeof _v=="object"&&typeof xv!="undefined"?xv.exports=t():typeof define=="function"&&define.amd?define(t):(n=n||self).RBush=t()})(_v,function(){"use strict";function n(_,x,T,S,R){(function z(U,D,P,ct,L){for(;ct>P;){if(ct-P>600){var W=ct-P+1,V=D-P+1,Mt=Math.log(W),Y=.5*Math.exp(2*Mt/3),mt=.5*Math.sqrt(Mt*Y*(W-Y)/W)*(V-W/2<0?-1:1),ft=Math.max(P,Math.floor(D-V*Y/W+mt)),vt=Math.min(ct,Math.floor(D+(W-V)*Y/W+mt));z(U,D,ft,vt,L)}var it=U[D],lt=P,H=ct;for(t(U,P,D),L(U[ct],it)>0&&t(U,P,ct);lt<H;){for(t(U,lt,H),lt++,H--;L(U[lt],it)<0;)lt++;for(;L(U[H],it)>0;)H--}L(U[P],it)===0?t(U,P,H):t(U,++H,ct),H<=D&&(P=H+1),D<=H&&(ct=H-1)}})(_,x,T||0,S||_.length-1,R||e)}function t(_,x,T){var S=_[x];_[x]=_[T],_[T]=S}function e(_,x){return _<x?-1:_>x?1:0}var i=function(_){_===void 0&&(_=9),this._maxEntries=Math.max(4,_),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()};function s(_,x,T){if(!T)return x.indexOf(_);for(var S=0;S<x.length;S++)if(T(_,x[S]))return S;return-1}function u(_,x){c(_,0,_.children.length,x,_)}function c(_,x,T,S,R){R||(R=M(null)),R.minX=1/0,R.minY=1/0,R.maxX=-1/0,R.maxY=-1/0;for(var z=x;z<T;z++){var U=_.children[z];f(R,_.leaf?S(U):U)}return R}function f(_,x){return _.minX=Math.min(_.minX,x.minX),_.minY=Math.min(_.minY,x.minY),_.maxX=Math.max(_.maxX,x.maxX),_.maxY=Math.max(_.maxY,x.maxY),_}function p(_,x){return _.minX-x.minX}function d(_,x){return _.minY-x.minY}function m(_){return(_.maxX-_.minX)*(_.maxY-_.minY)}function y(_){return _.maxX-_.minX+(_.maxY-_.minY)}function v(_,x){return _.minX<=x.minX&&_.minY<=x.minY&&x.maxX<=_.maxX&&x.maxY<=_.maxY}function E(_,x){return x.minX<=_.maxX&&x.minY<=_.maxY&&x.maxX>=_.minX&&x.maxY>=_.minY}function M(_){return{children:_,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function A(_,x,T,S,R){for(var z=[x,T];z.length;)if(!((T=z.pop())-(x=z.pop())<=S)){var U=x+Math.ceil((T-x)/S/2)*S;n(_,U,x,T,R),z.push(x,U,U,T)}}return i.prototype.all=function(){return this._all(this.data,[])},i.prototype.search=function(_){var x=this.data,T=[];if(!E(_,x))return T;for(var S=this.toBBox,R=[];x;){for(var z=0;z<x.children.length;z++){var U=x.children[z],D=x.leaf?S(U):U;E(_,D)&&(x.leaf?T.push(U):v(_,D)?this._all(U,T):R.push(U))}x=R.pop()}return T},i.prototype.collides=function(_){var x=this.data;if(!E(_,x))return!1;for(var T=[];x;){for(var S=0;S<x.children.length;S++){var R=x.children[S],z=x.leaf?this.toBBox(R):R;if(E(_,z)){if(x.leaf||v(_,z))return!0;T.push(R)}}x=T.pop()}return!1},i.prototype.load=function(_){if(!_||!_.length)return this;if(_.length<this._minEntries){for(var x=0;x<_.length;x++)this.insert(_[x]);return this}var T=this._build(_.slice(),0,_.length-1,0);if(this.data.children.length)if(this.data.height===T.height)this._splitRoot(this.data,T);else{if(this.data.height<T.height){var S=this.data;this.data=T,T=S}this._insert(T,this.data.height-T.height-1,!0)}else this.data=T;return this},i.prototype.insert=function(_){return _&&this._insert(_,this.data.height-1),this},i.prototype.clear=function(){return this.data=M([]),this},i.prototype.remove=function(_,x){if(!_)return this;for(var T,S,R,z=this.data,U=this.toBBox(_),D=[],P=[];z||D.length;){if(z||(z=D.pop(),S=D[D.length-1],T=P.pop(),R=!0),z.leaf){var ct=s(_,z.children,x);if(ct!==-1)return z.children.splice(ct,1),D.push(z),this._condense(D),this}R||z.leaf||!v(z,U)?S?(T++,z=S.children[T],R=!1):z=null:(D.push(z),P.push(T),T=0,S=z,z=z.children[0])}return this},i.prototype.toBBox=function(_){return _},i.prototype.compareMinX=function(_,x){return _.minX-x.minX},i.prototype.compareMinY=function(_,x){return _.minY-x.minY},i.prototype.toJSON=function(){return this.data},i.prototype.fromJSON=function(_){return this.data=_,this},i.prototype._all=function(_,x){for(var T=[];_;)_.leaf?x.push.apply(x,_.children):T.push.apply(T,_.children),_=T.pop();return x},i.prototype._build=function(_,x,T,S){var R,z=T-x+1,U=this._maxEntries;if(z<=U)return u(R=M(_.slice(x,T+1)),this.toBBox),R;S||(S=Math.ceil(Math.log(z)/Math.log(U)),U=Math.ceil(z/Math.pow(U,S-1))),(R=M([])).leaf=!1,R.height=S;var D=Math.ceil(z/U),P=D*Math.ceil(Math.sqrt(U));A(_,x,T,P,this.compareMinX);for(var ct=x;ct<=T;ct+=P){var L=Math.min(ct+P-1,T);A(_,ct,L,D,this.compareMinY);for(var W=ct;W<=L;W+=D){var V=Math.min(W+D-1,L);R.children.push(this._build(_,W,V,S-1))}}return u(R,this.toBBox),R},i.prototype._chooseSubtree=function(_,x,T,S){for(;S.push(x),!x.leaf&&S.length-1!==T;){for(var R=1/0,z=1/0,U=void 0,D=0;D<x.children.length;D++){var P=x.children[D],ct=m(P),L=(W=_,V=P,(Math.max(V.maxX,W.maxX)-Math.min(V.minX,W.minX))*(Math.max(V.maxY,W.maxY)-Math.min(V.minY,W.minY))-ct);L<z?(z=L,R=ct<R?ct:R,U=P):L===z&&ct<R&&(R=ct,U=P)}x=U||x.children[0]}var W,V;return x},i.prototype._insert=function(_,x,T){var S=T?_:this.toBBox(_),R=[],z=this._chooseSubtree(S,this.data,x,R);for(z.children.push(_),f(z,S);x>=0&&R[x].children.length>this._maxEntries;)this._split(R,x),x--;this._adjustParentBBoxes(S,R,x)},i.prototype._split=function(_,x){var T=_[x],S=T.children.length,R=this._minEntries;this._chooseSplitAxis(T,R,S);var z=this._chooseSplitIndex(T,R,S),U=M(T.children.splice(z,T.children.length-z));U.height=T.height,U.leaf=T.leaf,u(T,this.toBBox),u(U,this.toBBox),x?_[x-1].children.push(U):this._splitRoot(T,U)},i.prototype._splitRoot=function(_,x){this.data=M([_,x]),this.data.height=_.height+1,this.data.leaf=!1,u(this.data,this.toBBox)},i.prototype._chooseSplitIndex=function(_,x,T){for(var S,R,z,U,D,P,ct,L=1/0,W=1/0,V=x;V<=T-x;V++){var Mt=c(_,0,V,this.toBBox),Y=c(_,V,T,this.toBBox),mt=(R=Mt,z=Y,U=void 0,D=void 0,P=void 0,ct=void 0,U=Math.max(R.minX,z.minX),D=Math.max(R.minY,z.minY),P=Math.min(R.maxX,z.maxX),ct=Math.min(R.maxY,z.maxY),Math.max(0,P-U)*Math.max(0,ct-D)),ft=m(Mt)+m(Y);mt<L?(L=mt,S=V,W=ft<W?ft:W):mt===L&&ft<W&&(W=ft,S=V)}return S||T-x},i.prototype._chooseSplitAxis=function(_,x,T){var S=_.leaf?this.compareMinX:p,R=_.leaf?this.compareMinY:d;this._allDistMargin(_,x,T,S)<this._allDistMargin(_,x,T,R)&&_.children.sort(S)},i.prototype._allDistMargin=function(_,x,T,S){_.children.sort(S);for(var R=this.toBBox,z=c(_,0,x,R),U=c(_,T-x,T,R),D=y(z)+y(U),P=x;P<T-x;P++){var ct=_.children[P];f(z,_.leaf?R(ct):ct),D+=y(z)}for(var L=T-x-1;L>=x;L--){var W=_.children[L];f(U,_.leaf?R(W):W),D+=y(U)}return D},i.prototype._adjustParentBBoxes=function(_,x,T){for(var S=T;S>=0;S--)f(x[S],_)},i.prototype._condense=function(_){for(var x=_.length-1,T=void 0;x>=0;x--)_[x].children.length===0?x>0?(T=_[x-1].children).splice(T.indexOf(_[x]),1):this.clear():u(_[x],this.toBBox)},i})});var DC=Z((wv,Sv)=>{(function(n,t){typeof wv=="object"&&typeof Sv!="undefined"?Sv.exports=t():typeof define=="function"&&define.amd?define(t):(n=n||self,n.TinyQueue=t())})(wv,function(){"use strict";var n=function(i,s){if(i===void 0&&(i=[]),s===void 0&&(s=t),this.data=i,this.length=this.data.length,this.compare=s,this.length>0)for(var u=(this.length>>1)-1;u>=0;u--)this._down(u)};n.prototype.push=function(i){this.data.push(i),this.length++,this._up(this.length-1)},n.prototype.pop=function(){if(this.length!==0){var i=this.data[0],s=this.data.pop();return this.length--,this.length>0&&(this.data[0]=s,this._down(0)),i}},n.prototype.peek=function(){return this.data[0]},n.prototype._up=function(i){for(var s=this,u=s.data,c=s.compare,f=u[i];i>0;){var p=i-1>>1,d=u[p];if(c(f,d)>=0)break;u[i]=d,i=p}u[i]=f},n.prototype._down=function(i){for(var s=this,u=s.data,c=s.compare,f=this.length>>1,p=u[i];i<f;){var d=(i<<1)+1,m=u[d],y=d+1;if(y<this.length&&c(u[y],m)<0&&(d=y,m=u[y]),c(m,p)>=0)break;u[i]=m,i=d}u[i]=p};function t(e,i){return e<i?-1:e>i?1:0}return n})});var UC=Z((kQ,FC)=>{FC.exports=function(t,e,i,s){var u=t[0],c=t[1],f=!1;i===void 0&&(i=0),s===void 0&&(s=e.length);for(var p=(s-i)/2,d=0,m=p-1;d<p;m=d++){var y=e[i+d*2+0],v=e[i+d*2+1],E=e[i+m*2+0],M=e[i+m*2+1],A=v>c!=M>c&&u<(E-y)*(c-v)/(M-v)+y;A&&(f=!f)}return f}});var zC=Z((qQ,BC)=>{BC.exports=function(t,e,i,s){var u=t[0],c=t[1],f=!1;i===void 0&&(i=0),s===void 0&&(s=e.length);for(var p=s-i,d=0,m=p-1;d<p;m=d++){var y=e[d+i][0],v=e[d+i][1],E=e[m+i][0],M=e[m+i][1],A=v>c!=M>c&&u<(E-y)*(c-v)/(M-v)+y;A&&(f=!f)}return f}});var qC=Z((VQ,Vp)=>{var GC=UC(),kC=zC();Vp.exports=function(t,e,i,s){return e.length>0&&Array.isArray(e[0])?kC(t,e,i,s):GC(t,e,i,s)};Vp.exports.nested=kC;Vp.exports.flat=GC});var HC=Z((Hp,VC)=>{(function(n,t){typeof Hp=="object"&&typeof VC!="undefined"?t(Hp):typeof define=="function"&&define.amd?define(["exports"],t):t((n=n||self).predicates={})})(Hp,function(n){"use strict";let e=33306690738754706e-32;function i(E,M,A,_,x){let T,S,R,z,U=M[0],D=_[0],P=0,ct=0;D>U==D>-U?(T=U,U=M[++P]):(T=D,D=_[++ct]);let L=0;if(P<E&&ct<A)for(D>U==D>-U?(R=T-((S=U+T)-U),U=M[++P]):(R=T-((S=D+T)-D),D=_[++ct]),T=S,R!==0&&(x[L++]=R);P<E&&ct<A;)D>U==D>-U?(R=T-((S=T+U)-(z=S-T))+(U-z),U=M[++P]):(R=T-((S=T+D)-(z=S-T))+(D-z),D=_[++ct]),T=S,R!==0&&(x[L++]=R);for(;P<E;)R=T-((S=T+U)-(z=S-T))+(U-z),U=M[++P],T=S,R!==0&&(x[L++]=R);for(;ct<A;)R=T-((S=T+D)-(z=S-T))+(D-z),D=_[++ct],T=S,R!==0&&(x[L++]=R);return T===0&&L!==0||(x[L++]=T),L}function s(E){return new Float64Array(E)}let u=33306690738754716e-32,c=22204460492503146e-32,f=11093356479670487e-47,p=s(4),d=s(8),m=s(12),y=s(16),v=s(4);n.orient2d=function(E,M,A,_,x,T){let S=(M-T)*(A-x),R=(E-x)*(_-T),z=S-R;if(S===0||R===0||S>0!=R>0)return z;let U=Math.abs(S+R);return Math.abs(z)>=u*U?z:-function(D,P,ct,L,W,V,Mt){let Y,mt,ft,vt,it,lt,H,At,It,jt,nt,bt,qt,$t,Ft,zt,Ct,te,$=D-W,Ot=ct-W,_t=P-V,Nt=L-V;it=(Ft=(At=$-(H=(lt=134217729*$)-(lt-$)))*(jt=Nt-(It=(lt=134217729*Nt)-(lt-Nt)))-(($t=$*Nt)-H*It-At*It-H*jt))-(nt=Ft-(Ct=(At=_t-(H=(lt=134217729*_t)-(lt-_t)))*(jt=Ot-(It=(lt=134217729*Ot)-(lt-Ot)))-((zt=_t*Ot)-H*It-At*It-H*jt))),p[0]=Ft-(nt+it)+(it-Ct),it=(qt=$t-((bt=$t+nt)-(it=bt-$t))+(nt-it))-(nt=qt-zt),p[1]=qt-(nt+it)+(it-zt),it=(te=bt+nt)-bt,p[2]=bt-(te-it)+(nt-it),p[3]=te;let St=function(X,N){let xt=N[0];for(let wt=1;wt<X;wt++)xt+=N[wt];return xt}(4,p),Vt=c*Mt;if(St>=Vt||-St>=Vt||(Y=D-($+(it=D-$))+(it-W),ft=ct-(Ot+(it=ct-Ot))+(it-W),mt=P-(_t+(it=P-_t))+(it-V),vt=L-(Nt+(it=L-Nt))+(it-V),Y===0&&mt===0&&ft===0&&vt===0)||(Vt=f*Mt+e*Math.abs(St),(St+=$*vt+Nt*Y-(_t*ft+Ot*mt))>=Vt||-St>=Vt))return St;it=(Ft=(At=Y-(H=(lt=134217729*Y)-(lt-Y)))*(jt=Nt-(It=(lt=134217729*Nt)-(lt-Nt)))-(($t=Y*Nt)-H*It-At*It-H*jt))-(nt=Ft-(Ct=(At=mt-(H=(lt=134217729*mt)-(lt-mt)))*(jt=Ot-(It=(lt=134217729*Ot)-(lt-Ot)))-((zt=mt*Ot)-H*It-At*It-H*jt))),v[0]=Ft-(nt+it)+(it-Ct),it=(qt=$t-((bt=$t+nt)-(it=bt-$t))+(nt-it))-(nt=qt-zt),v[1]=qt-(nt+it)+(it-zt),it=(te=bt+nt)-bt,v[2]=bt-(te-it)+(nt-it),v[3]=te;let Xt=i(4,p,4,v,d);it=(Ft=(At=$-(H=(lt=134217729*$)-(lt-$)))*(jt=vt-(It=(lt=134217729*vt)-(lt-vt)))-(($t=$*vt)-H*It-At*It-H*jt))-(nt=Ft-(Ct=(At=_t-(H=(lt=134217729*_t)-(lt-_t)))*(jt=ft-(It=(lt=134217729*ft)-(lt-ft)))-((zt=_t*ft)-H*It-At*It-H*jt))),v[0]=Ft-(nt+it)+(it-Ct),it=(qt=$t-((bt=$t+nt)-(it=bt-$t))+(nt-it))-(nt=qt-zt),v[1]=qt-(nt+it)+(it-zt),it=(te=bt+nt)-bt,v[2]=bt-(te-it)+(nt-it),v[3]=te;let Pt=i(Xt,d,4,v,m);it=(Ft=(At=Y-(H=(lt=134217729*Y)-(lt-Y)))*(jt=vt-(It=(lt=134217729*vt)-(lt-vt)))-(($t=Y*vt)-H*It-At*It-H*jt))-(nt=Ft-(Ct=(At=mt-(H=(lt=134217729*mt)-(lt-mt)))*(jt=ft-(It=(lt=134217729*ft)-(lt-ft)))-((zt=mt*ft)-H*It-At*It-H*jt))),v[0]=Ft-(nt+it)+(it-Ct),it=(qt=$t-((bt=$t+nt)-(it=bt-$t))+(nt-it))-(nt=qt-zt),v[1]=qt-(nt+it)+(it-zt),it=(te=bt+nt)-bt,v[2]=bt-(te-it)+(nt-it),v[3]=te;let ee=i(Pt,m,4,v,y);return y[ee-1]}(E,M,A,_,x,T,U)},n.orient2dfast=function(E,M,A,_,x,T){return(M-T)*(A-x)-(E-x)*(_-T)},Object.defineProperty(n,"__esModule",{value:!0})})});var JC=Z((HQ,Tv)=>{"use strict";var WC=Ev(),Xp=DC(),wW=qC(),SW=HC().orient2d;Xp.default&&(Xp=Xp.default);Tv.exports=ZC;Tv.exports.default=ZC;function ZC(n,t,e){t=Math.max(0,t===void 0?2:t),e=e||0;var i=CW(n),s=new WC(16);s.toBBox=function(T){return{minX:T[0],minY:T[1],maxX:T[0],maxY:T[1]}},s.compareMinX=function(T,S){return T[0]-S[0]},s.compareMinY=function(T,S){return T[1]-S[1]},s.load(n);for(var u=[],c=0,f;c<i.length;c++){var p=i[c];s.remove(p),f=$C(p,f),u.push(f)}var d=new WC(16);for(c=0;c<u.length;c++)d.insert(Mv(u[c]));for(var m=t*t,y=e*e;u.length;){var v=u.shift(),E=v.p,M=v.next.p,A=bv(E,M);if(!(A<y)){var _=A/m;p=MW(s,v.prev.p,E,M,v.next.next.p,_,d),p&&Math.min(bv(p,E),bv(p,M))<=_&&(u.push(v),u.push($C(p,v)),s.remove(p),d.remove(v),d.insert(Mv(v)),d.insert(Mv(v.next)))}}v=f;var x=[];do x.push(v.p),v=v.next;while(v!==f);return x.push(v.p),x}function MW(n,t,e,i,s,u,c){for(var f=new Xp([],bW),p=n.data;p;){for(var d=0;d<p.children.length;d++){var m=p.children[d],y=p.leaf?Av(m,e,i):AW(e,i,m);y>u||f.push({node:m,dist:y})}for(;f.length&&!f.peek().node.children;){var v=f.pop(),E=v.node,M=Av(E,t,e),A=Av(E,i,s);if(v.dist<M&&v.dist<A&&YC(e,E,c)&&YC(i,E,c))return E}p=f.pop(),p&&(p=p.node)}return null}function bW(n,t){return n.dist-t.dist}function AW(n,t,e){if(XC(n,e)||XC(t,e))return 0;var i=Wp(n[0],n[1],t[0],t[1],e.minX,e.minY,e.maxX,e.minY);if(i===0)return 0;var s=Wp(n[0],n[1],t[0],t[1],e.minX,e.minY,e.minX,e.maxY);if(s===0)return 0;var u=Wp(n[0],n[1],t[0],t[1],e.maxX,e.minY,e.maxX,e.maxY);if(u===0)return 0;var c=Wp(n[0],n[1],t[0],t[1],e.minX,e.maxY,e.maxX,e.maxY);return c===0?0:Math.min(i,s,u,c)}function XC(n,t){return n[0]>=t.minX&&n[0]<=t.maxX&&n[1]>=t.minY&&n[1]<=t.maxY}function YC(n,t,e){for(var i=Math.min(n[0],t[0]),s=Math.min(n[1],t[1]),u=Math.max(n[0],t[0]),c=Math.max(n[1],t[1]),f=e.search({minX:i,minY:s,maxX:u,maxY:c}),p=0;p<f.length;p++)if(TW(f[p].p,f[p].next.p,n,t))return!1;return!0}function xl(n,t,e){return SW(n[0],n[1],t[0],t[1],e[0],e[1])}function TW(n,t,e,i){return n!==i&&t!==e&&xl(n,t,e)>0!=xl(n,t,i)>0&&xl(e,i,n)>0!=xl(e,i,t)>0}function Mv(n){var t=n.p,e=n.next.p;return n.minX=Math.min(t[0],e[0]),n.minY=Math.min(t[1],e[1]),n.maxX=Math.max(t[0],e[0]),n.maxY=Math.max(t[1],e[1]),n}function CW(n){for(var t=n[0],e=n[0],i=n[0],s=n[0],u=0;u<n.length;u++){var c=n[u];c[0]<t[0]&&(t=c),c[0]>i[0]&&(i=c),c[1]<e[1]&&(e=c),c[1]>s[1]&&(s=c)}var f=[t,e,i,s],p=f.slice();for(u=0;u<n.length;u++)wW(n[u],f)||p.push(n[u]);return PW(p)}function $C(n,t){var e={p:n,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 bv(n,t){var e=n[0]-t[0],i=n[1]-t[1];return e*e+i*i}function Av(n,t,e){var i=t[0],s=t[1],u=e[0]-i,c=e[1]-s;if(u!==0||c!==0){var f=((n[0]-i)*u+(n[1]-s)*c)/(u*u+c*c);f>1?(i=e[0],s=e[1]):f>0&&(i+=u*f,s+=c*f)}return u=n[0]-i,c=n[1]-s,u*u+c*c}function Wp(n,t,e,i,s,u,c,f){var p=e-n,d=i-t,m=c-s,y=f-u,v=n-s,E=t-u,M=p*p+d*d,A=p*m+d*y,_=m*m+y*y,x=p*v+d*E,T=m*v+y*E,S=M*_-A*A,R,z,U,D,P=S,ct=S;S===0?(z=0,P=1,D=T,ct=_):(z=A*T-_*x,D=M*T-A*x,z<0?(z=0,D=T,ct=_):z>P&&(z=P,D=T+A,ct=_)),D<0?(D=0,-x<0?z=0:-x>M?z=P:(z=-x,P=M)):D>ct&&(D=ct,-x+A<0?z=0:-x+A>M?z=P:(z=-x+A,P=M)),R=z===0?0:z/P,U=D===0?0:D/ct;var L=(1-R)*n+R*e,W=(1-R)*t+R*i,V=(1-U)*s+U*c,Mt=(1-U)*u+U*f,Y=V-L,mt=Mt-W;return Y*Y+mt*mt}function IW(n,t){return n[0]===t[0]?n[1]-t[1]:n[0]-t[0]}function PW(n){n.sort(IW);for(var t=[],e=0;e<n.length;e++){for(;t.length>=2&&xl(t[t.length-2],t[t.length-1],n[e])<=0;)t.pop();t.push(n[e])}for(var i=[],s=n.length-1;s>=0;s--){for(;i.length>=2&&xl(i[i.length-2],i[i.length-1],n[s])<=0;)i.pop();i.push(n[s])}return i.pop(),t.pop(),t.concat(i)}});var nI=Z((Iv,Pv)=>{(function(n,t){typeof Iv=="object"&&typeof Pv!="undefined"?Pv.exports=t():typeof define=="function"&&define.amd?define(t):n.quickselect=t()})(Iv,function(){"use strict";function n(s,u,c,f,p){t(s,u,c||0,f||s.length-1,p||i)}function t(s,u,c,f,p){for(;f>c;){if(f-c>600){var d=f-c+1,m=u-c+1,y=Math.log(d),v=.5*Math.exp(2*y/3),E=.5*Math.sqrt(y*v*(d-v)/d)*(m-d/2<0?-1:1),M=Math.max(c,Math.floor(u-m*v/d+E)),A=Math.min(f,Math.floor(u+(d-m)*v/d+E));t(s,u,M,A,p)}var _=s[u],x=c,T=f;for(e(s,c,u),p(s[f],_)>0&&e(s,c,f);x<T;){for(e(s,x,T),x++,T--;p(s[x],_)<0;)x++;for(;p(s[T],_)>0;)T--}p(s[c],_)===0?e(s,c,T):(T++,e(s,T,f)),T<=u&&(c=T+1),u<=T&&(f=T-1)}}function e(s,u,c){var f=s[u];s[u]=s[c],s[c]=f}function i(s,u){return s<u?-1:s>u?1:0}return n})});var Ov=Z((vnt,Nv)=>{"use strict";Nv.exports=Zc;Nv.exports.default=Zc;var VW=nI();function Zc(n,t){if(!(this instanceof Zc))return new Zc(n,t);this._maxEntries=Math.max(4,n||9),this._minEntries=Math.max(2,Math.ceil(this._maxEntries*.4)),t&&this._initFormat(t),this.clear()}Zc.prototype={all:function(){return this._all(this.data,[])},search:function(n){var t=this.data,e=[],i=this.toBBox;if(!$p(n,t))return e;for(var s=[],u,c,f,p;t;){for(u=0,c=t.children.length;u<c;u++)f=t.children[u],p=t.leaf?i(f):f,$p(n,p)&&(t.leaf?e.push(f):Lv(n,p)?this._all(f,e):s.push(f));t=s.pop()}return e},collides:function(n){var t=this.data,e=this.toBBox;if(!$p(n,t))return!1;for(var i=[],s,u,c,f;t;){for(s=0,u=t.children.length;s<u;s++)if(c=t.children[s],f=t.leaf?e(c):c,$p(n,f)){if(t.leaf||Lv(n,f))return!0;i.push(c)}t=i.pop()}return!1},load:function(n){if(!(n&&n.length))return this;if(n.length<this._minEntries){for(var t=0,e=n.length;t<e;t++)this.insert(n[t]);return this}var i=this._build(n.slice(),0,n.length-1,0);if(!this.data.children.length)this.data=i;else if(this.data.height===i.height)this._splitRoot(this.data,i);else{if(this.data.height<i.height){var s=this.data;this.data=i,i=s}this._insert(i,this.data.height-i.height-1,!0)}return this},insert:function(n){return n&&this._insert(n,this.data.height-1),this},clear:function(){return this.data=Sl([]),this},remove:function(n,t){if(!n)return this;for(var e=this.data,i=this.toBBox(n),s=[],u=[],c,f,p,d;e||s.length;){if(e||(e=s.pop(),f=s[s.length-1],c=u.pop(),d=!0),e.leaf&&(p=HW(n,e.children,t),p!==-1))return e.children.splice(p,1),s.push(e),this._condense(s),this;!d&&!e.leaf&&Lv(e,i)?(s.push(e),u.push(c),c=0,f=e,e=e.children[0]):f?(c++,e=f.children[c],d=!1):e=null}return this},toBBox:function(n){return n},compareMinX:rI,compareMinY:iI,toJSON:function(){return this.data},fromJSON:function(n){return this.data=n,this},_all:function(n,t){for(var e=[];n;)n.leaf?t.push.apply(t,n.children):e.push.apply(e,n.children),n=e.pop();return t},_build:function(n,t,e,i){var s=e-t+1,u=this._maxEntries,c;if(s<=u)return c=Sl(n.slice(t,e+1)),wl(c,this.toBBox),c;i||(i=Math.ceil(Math.log(s)/Math.log(u)),u=Math.ceil(s/Math.pow(u,i-1))),c=Sl([]),c.leaf=!1,c.height=i;var f=Math.ceil(s/u),p=f*Math.ceil(Math.sqrt(u)),d,m,y,v;for(oI(n,t,e,p,this.compareMinX),d=t;d<=e;d+=p)for(y=Math.min(d+p-1,e),oI(n,d,y,f,this.compareMinY),m=d;m<=y;m+=f)v=Math.min(m+f-1,y),c.children.push(this._build(n,m,v,i-1));return wl(c,this.toBBox),c},_chooseSubtree:function(n,t,e,i){for(var s,u,c,f,p,d,m,y;i.push(t),!(t.leaf||i.length-1===e);){for(m=y=1/0,s=0,u=t.children.length;s<u;s++)c=t.children[s],p=Rv(c),d=WW(n,c)-p,d<y?(y=d,m=p<m?p:m,f=c):d===y&&p<m&&(m=p,f=c);t=f||t.children[0]}return t},_insert:function(n,t,e){var i=this.toBBox,s=e?n:i(n),u=[],c=this._chooseSubtree(s,this.data,t,u);for(c.children.push(n),$c(c,s);t>=0&&u[t].children.length>this._maxEntries;)this._split(u,t),t--;this._adjustParentBBoxes(s,u,t)},_split:function(n,t){var e=n[t],i=e.children.length,s=this._minEntries;this._chooseSplitAxis(e,s,i);var u=this._chooseSplitIndex(e,s,i),c=Sl(e.children.splice(u,e.children.length-u));c.height=e.height,c.leaf=e.leaf,wl(e,this.toBBox),wl(c,this.toBBox),t?n[t-1].children.push(c):this._splitRoot(e,c)},_splitRoot:function(n,t){this.data=Sl([n,t]),this.data.height=n.height+1,this.data.leaf=!1,wl(this.data,this.toBBox)},_chooseSplitIndex:function(n,t,e){var i,s,u,c,f,p,d,m;for(p=d=1/0,i=t;i<=e-t;i++)s=Yc(n,0,i,this.toBBox),u=Yc(n,i,e,this.toBBox),c=XW(s,u),f=Rv(s)+Rv(u),c<p?(p=c,m=i,d=f<d?f:d):c===p&&f<d&&(d=f,m=i);return m},_chooseSplitAxis:function(n,t,e){var i=n.leaf?this.compareMinX:rI,s=n.leaf?this.compareMinY:iI,u=this._allDistMargin(n,t,e,i),c=this._allDistMargin(n,t,e,s);u<c&&n.children.sort(i)},_allDistMargin:function(n,t,e,i){n.children.sort(i);var s=this.toBBox,u=Yc(n,0,t,s),c=Yc(n,e-t,e,s),f=Yp(u)+Yp(c),p,d;for(p=t;p<e-t;p++)d=n.children[p],$c(u,n.leaf?s(d):d),f+=Yp(u);for(p=e-t-1;p>=t;p--)d=n.children[p],$c(c,n.leaf?s(d):d),f+=Yp(c);return f},_adjustParentBBoxes:function(n,t,e){for(var i=e;i>=0;i--)$c(t[i],n)},_condense:function(n){for(var t=n.length-1,e;t>=0;t--)n[t].children.length===0?t>0?(e=n[t-1].children,e.splice(e.indexOf(n[t]),1)):this.clear():wl(n[t],this.toBBox)},_initFormat:function(n){var t=["return a"," - b",";"];this.compareMinX=new Function("a","b",t.join(n[0])),this.compareMinY=new Function("a","b",t.join(n[1])),this.toBBox=new Function("a","return {minX: a"+n[0]+", minY: a"+n[1]+", maxX: a"+n[2]+", maxY: a"+n[3]+"};")}};function HW(n,t,e){if(!e)return t.indexOf(n);for(var i=0;i<t.length;i++)if(e(n,t[i]))return i;return-1}function wl(n,t){Yc(n,0,n.children.length,t,n)}function Yc(n,t,e,i,s){s||(s=Sl(null)),s.minX=1/0,s.minY=1/0,s.maxX=-1/0,s.maxY=-1/0;for(var u=t,c;u<e;u++)c=n.children[u],$c(s,n.leaf?i(c):c);return s}function $c(n,t){return n.minX=Math.min(n.minX,t.minX),n.minY=Math.min(n.minY,t.minY),n.maxX=Math.max(n.maxX,t.maxX),n.maxY=Math.max(n.maxY,t.maxY),n}function rI(n,t){return n.minX-t.minX}function iI(n,t){return n.minY-t.minY}function Rv(n){return(n.maxX-n.minX)*(n.maxY-n.minY)}function Yp(n){return n.maxX-n.minX+(n.maxY-n.minY)}function WW(n,t){return(Math.max(t.maxX,n.maxX)-Math.min(t.minX,n.minX))*(Math.max(t.maxY,n.maxY)-Math.min(t.minY,n.minY))}function XW(n,t){var e=Math.max(n.minX,t.minX),i=Math.max(n.minY,t.minY),s=Math.min(n.maxX,t.maxX),u=Math.min(n.maxY,t.maxY);return Math.max(0,s-e)*Math.max(0,u-i)}function Lv(n,t){return n.minX<=t.minX&&n.minY<=t.minY&&t.maxX<=n.maxX&&t.maxY<=n.maxY}function $p(n,t){return t.minX<=n.maxX&&t.minY<=n.maxY&&t.maxX>=n.minX&&t.maxY>=n.minY}function Sl(n){return{children:n,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function oI(n,t,e,i,s){for(var u=[t,e],c;u.length;)e=u.pop(),t=u.pop(),!(e-t<=i)&&(c=t+Math.ceil((e-t)/i/2)*i,VW(n,c,t,e,s),u.push(t,c,c,e))}});var fI=Z((Rrt,Gv)=>{"use strict";Gv.exports=Kp;Gv.exports.default=Kp;function Kp(n,t,e){e=e||2;var i=t&&t.length,s=i?t[0]*e:n.length,u=uI(n,0,s,e,!0),c=[];if(!u||u.next===u.prev)return c;var f,p,d,m,y,v,E;if(i&&(u=nX(n,t,u,e)),n.length>80*e){f=d=n[0],p=m=n[1];for(var M=e;M<s;M+=e)y=n[M],v=n[M+1],y<f&&(f=y),v<p&&(p=v),y>d&&(d=y),v>m&&(m=v);E=Math.max(d-f,m-p),E=E!==0?32767/E:0}return Kc(u,c,e,f,p,E,0),c}function uI(n,t,e,i,s){var u,c;if(s===zv(n,t,e,i)>0)for(u=t;u<e;u+=i)c=aI(u,n[u],n[u+1],c);else for(u=e-i;u>=t;u-=i)c=aI(u,n[u],n[u+1],c);return c&&Qp(c,c.next)&&(tf(c),c=c.next),c}function eu(n,t){if(!n)return n;t||(t=n);var e=n,i;do if(i=!1,!e.steiner&&(Qp(e,e.next)||Qn(e.prev,e,e.next)===0)){if(tf(e),e=t=e.prev,e===e.next)break;i=!0}else e=e.next;while(i||e!==t);return t}function Kc(n,t,e,i,s,u,c){if(n){!c&&u&&aX(n,i,s,u);for(var f=n,p,d;n.prev!==n.next;){if(p=n.prev,d=n.next,u?QW(n,i,s,u):KW(n)){t.push(p.i/e|0),t.push(n.i/e|0),t.push(d.i/e|0),tf(n),n=d.next,f=d.next;continue}if(n=d,n===f){c?c===1?(n=tX(eu(n),t,e),Kc(n,t,e,i,s,u,2)):c===2&&eX(n,t,e,i,s,u):Kc(eu(n),t,e,i,s,u,1);break}}}}function KW(n){var t=n.prev,e=n,i=n.next;if(Qn(t,e,i)>=0)return!1;for(var s=t.x,u=e.x,c=i.x,f=t.y,p=e.y,d=i.y,m=s<u?s<c?s:c:u<c?u:c,y=f<p?f<d?f:d:p<d?p:d,v=s>u?s>c?s:c:u>c?u:c,E=f>p?f>d?f:d:p>d?p:d,M=i.next;M!==t;){if(M.x>=m&&M.x<=v&&M.y>=y&&M.y<=E&&Al(s,f,u,p,c,d,M.x,M.y)&&Qn(M.prev,M,M.next)>=0)return!1;M=M.next}return!0}function QW(n,t,e,i){var s=n.prev,u=n,c=n.next;if(Qn(s,u,c)>=0)return!1;for(var f=s.x,p=u.x,d=c.x,m=s.y,y=u.y,v=c.y,E=f<p?f<d?f:d:p<d?p:d,M=m<y?m<v?m:v:y<v?y:v,A=f>p?f>d?f:d:p>d?p:d,_=m>y?m>v?m:v:y>v?y:v,x=Uv(E,M,t,e,i),T=Uv(A,_,t,e,i),S=n.prevZ,R=n.nextZ;S&&S.z>=x&&R&&R.z<=T;){if(S.x>=E&&S.x<=A&&S.y>=M&&S.y<=_&&S!==s&&S!==c&&Al(f,m,p,y,d,v,S.x,S.y)&&Qn(S.prev,S,S.next)>=0||(S=S.prevZ,R.x>=E&&R.x<=A&&R.y>=M&&R.y<=_&&R!==s&&R!==c&&Al(f,m,p,y,d,v,R.x,R.y)&&Qn(R.prev,R,R.next)>=0))return!1;R=R.nextZ}for(;S&&S.z>=x;){if(S.x>=E&&S.x<=A&&S.y>=M&&S.y<=_&&S!==s&&S!==c&&Al(f,m,p,y,d,v,S.x,S.y)&&Qn(S.prev,S,S.next)>=0)return!1;S=S.prevZ}for(;R&&R.z<=T;){if(R.x>=E&&R.x<=A&&R.y>=M&&R.y<=_&&R!==s&&R!==c&&Al(f,m,p,y,d,v,R.x,R.y)&&Qn(R.prev,R,R.next)>=0)return!1;R=R.nextZ}return!0}function tX(n,t,e){var i=n;do{var s=i.prev,u=i.next.next;!Qp(s,u)&&lI(s,i,i.next,u)&&Qc(s,u)&&Qc(u,s)&&(t.push(s.i/e|0),t.push(i.i/e|0),t.push(u.i/e|0),tf(i),tf(i.next),i=n=u),i=i.next}while(i!==n);return eu(i)}function eX(n,t,e,i,s,u){var c=n;do{for(var f=c.next.next;f!==c.prev;){if(c.i!==f.i&&cX(c,f)){var p=cI(c,f);c=eu(c,c.next),p=eu(p,p.next),Kc(c,t,e,i,s,u,0),Kc(p,t,e,i,s,u,0);return}f=f.next}c=c.next}while(c!==n)}function nX(n,t,e,i){var s=[],u,c,f,p,d;for(u=0,c=t.length;u<c;u++)f=t[u]*i,p=u<c-1?t[u+1]*i:n.length,d=uI(n,f,p,i,!1),d===d.next&&(d.steiner=!0),s.push(lX(d));for(s.sort(rX),u=0;u<s.length;u++)e=iX(s[u],e);return e}function rX(n,t){return n.x-t.x}function iX(n,t){var e=oX(n,t);if(!e)return t;var i=cI(e,n);return eu(i,i.next),eu(e,e.next)}function oX(n,t){var e=t,i=n.x,s=n.y,u=-1/0,c;do{if(s<=e.y&&s>=e.next.y&&e.next.y!==e.y){var f=e.x+(s-e.y)*(e.next.x-e.x)/(e.next.y-e.y);if(f<=i&&f>u&&(u=f,c=e.x<e.next.x?e:e.next,f===i))return c}e=e.next}while(e!==t);if(!c)return null;var p=c,d=c.x,m=c.y,y=1/0,v;e=c;do i>=e.x&&e.x>=d&&i!==e.x&&Al(s<m?i:u,s,d,m,s<m?u:i,s,e.x,e.y)&&(v=Math.abs(s-e.y)/(i-e.x),Qc(e,n)&&(v<y||v===y&&(e.x>c.x||e.x===c.x&&sX(c,e)))&&(c=e,y=v)),e=e.next;while(e!==p);return c}function sX(n,t){return Qn(n.prev,n,t.prev)<0&&Qn(t.next,n,n.next)<0}function aX(n,t,e,i){var s=n;do s.z===0&&(s.z=Uv(s.x,s.y,t,e,i)),s.prevZ=s.prev,s.nextZ=s.next,s=s.next;while(s!==n);s.prevZ.nextZ=null,s.prevZ=null,uX(s)}function uX(n){var t,e,i,s,u,c,f,p,d=1;do{for(e=n,n=null,u=null,c=0;e;){for(c++,i=e,f=0,t=0;t<d&&(f++,i=i.nextZ,!!i);t++);for(p=d;f>0||p>0&&i;)f!==0&&(p===0||!i||e.z<=i.z)?(s=e,e=e.nextZ,f--):(s=i,i=i.nextZ,p--),u?u.nextZ=s:n=s,s.prevZ=u,u=s;e=i}u.nextZ=null,d*=2}while(c>1);return n}function Uv(n,t,e,i,s){return n=(n-e)*s|0,t=(t-i)*s|0,n=(n|n<<8)&16711935,n=(n|n<<4)&252645135,n=(n|n<<2)&858993459,n=(n|n<<1)&1431655765,t=(t|t<<8)&16711935,t=(t|t<<4)&252645135,t=(t|t<<2)&858993459,t=(t|t<<1)&1431655765,n|t<<1}function lX(n){var t=n,e=n;do(t.x<e.x||t.x===e.x&&t.y<e.y)&&(e=t),t=t.next;while(t!==n);return e}function Al(n,t,e,i,s,u,c,f){return(s-c)*(t-f)>=(n-c)*(u-f)&&(n-c)*(i-f)>=(e-c)*(t-f)&&(e-c)*(u-f)>=(s-c)*(i-f)}function cX(n,t){return n.next.i!==t.i&&n.prev.i!==t.i&&!fX(n,t)&&(Qc(n,t)&&Qc(t,n)&&hX(n,t)&&(Qn(n.prev,n,t.prev)||Qn(n,t.prev,t))||Qp(n,t)&&Qn(n.prev,n,n.next)>0&&Qn(t.prev,t,t.next)>0)}function Qn(n,t,e){return(t.y-n.y)*(e.x-t.x)-(t.x-n.x)*(e.y-t.y)}function Qp(n,t){return n.x===t.x&&n.y===t.y}function lI(n,t,e,i){var s=jp(Qn(n,t,e)),u=jp(Qn(n,t,i)),c=jp(Qn(e,i,n)),f=jp(Qn(e,i,t));return!!(s!==u&&c!==f||s===0&&Jp(n,e,t)||u===0&&Jp(n,i,t)||c===0&&Jp(e,n,i)||f===0&&Jp(e,t,i))}function Jp(n,t,e){return t.x<=Math.max(n.x,e.x)&&t.x>=Math.min(n.x,e.x)&&t.y<=Math.max(n.y,e.y)&&t.y>=Math.min(n.y,e.y)}function jp(n){return n>0?1:n<0?-1:0}function fX(n,t){var e=n;do{if(e.i!==n.i&&e.next.i!==n.i&&e.i!==t.i&&e.next.i!==t.i&&lI(e,e.next,n,t))return!0;e=e.next}while(e!==n);return!1}function Qc(n,t){return Qn(n.prev,n,n.next)<0?Qn(n,t,n.next)>=0&&Qn(n,n.prev,t)>=0:Qn(n,t,n.prev)<0||Qn(n,n.next,t)<0}function hX(n,t){var e=n,i=!1,s=(n.x+t.x)/2,u=(n.y+t.y)/2;do e.y>u!=e.next.y>u&&e.next.y!==e.y&&s<(e.next.x-e.x)*(u-e.y)/(e.next.y-e.y)+e.x&&(i=!i),e=e.next;while(e!==n);return i}function cI(n,t){var e=new Bv(n.i,n.x,n.y),i=new Bv(t.i,t.x,t.y),s=n.next,u=t.prev;return n.next=t,t.prev=n,e.next=s,s.prev=e,i.next=e,e.prev=i,u.next=i,i.prev=u,i}function aI(n,t,e,i){var s=new Bv(n,t,e);return i?(s.next=i.next,s.prev=i,i.next.prev=s,i.next=s):(s.prev=s,s.next=s),s}function tf(n){n.next.prev=n.prev,n.prev.next=n.next,n.prevZ&&(n.prevZ.nextZ=n.nextZ),n.nextZ&&(n.nextZ.prevZ=n.prevZ)}function Bv(n,t,e){this.i=n,this.x=t,this.y=e,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}Kp.deviation=function(n,t,e,i){var s=t&&t.length,u=s?t[0]*e:n.length,c=Math.abs(zv(n,0,u,e));if(s)for(var f=0,p=t.length;f<p;f++){var d=t[f]*e,m=f<p-1?t[f+1]*e:n.length;c-=Math.abs(zv(n,d,m,e))}var y=0;for(f=0;f<i.length;f+=3){var v=i[f]*e,E=i[f+1]*e,M=i[f+2]*e;y+=Math.abs((n[v]-n[M])*(n[E+1]-n[v+1])-(n[v]-n[E])*(n[M+1]-n[v+1]))}return c===0&&y===0?0:Math.abs((y-c)/c)};function zv(n,t,e,i){for(var s=0,u=t,c=e-i;u<e;u+=i)s+=(n[c]-n[u])*(n[u+1]+n[c+1]),c=u;return s}Kp.flatten=function(n){for(var t=n[0][0].length,e={vertices:[],holes:[],dimensions:t},i=0,s=0;s<n.length;s++){for(var u=0;u<n[s].length;u++)for(var c=0;c<t;c++)e.vertices.push(n[s][u][c]);s>0&&(i+=n[s-1].length,e.holes.push(i))}return e}});var Wv=Z(me=>{"use strict";Object.defineProperty(me,"__esModule",{value:!0});me.earthRadius=63710088e-1;me.factors={centimeters:me.earthRadius*100,centimetres:me.earthRadius*100,degrees:me.earthRadius/111325,feet:me.earthRadius*3.28084,inches:me.earthRadius*39.37,kilometers:me.earthRadius/1e3,kilometres:me.earthRadius/1e3,meters:me.earthRadius,metres:me.earthRadius,miles:me.earthRadius/1609.344,millimeters:me.earthRadius*1e3,millimetres:me.earthRadius*1e3,nauticalmiles:me.earthRadius/1852,radians:1,yards:me.earthRadius*1.0936};me.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/me.earthRadius,yards:1.0936133};me.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 ca(n,t,e){e===void 0&&(e={});var i={type:"Feature"};return(e.id===0||e.id)&&(i.id=e.id),e.bbox&&(i.bbox=e.bbox),i.properties=t||{},i.geometry=n,i}me.feature=ca;function dX(n,t,e){switch(e===void 0&&(e={}),n){case"Point":return kv(t).geometry;case"LineString":return Vv(t).geometry;case"Polygon":return qv(t).geometry;case"MultiPoint":return pI(t).geometry;case"MultiLineString":return hI(t).geometry;case"MultiPolygon":return dI(t).geometry;default:throw new Error(n+" is invalid")}}me.geometry=dX;function kv(n,t,e){if(e===void 0&&(e={}),!n)throw new Error("coordinates is required");if(!Array.isArray(n))throw new Error("coordinates must be an Array");if(n.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!td(n[0])||!td(n[1]))throw new Error("coordinates must contain numbers");var i={type:"Point",coordinates:n};return ca(i,t,e)}me.point=kv;function mX(n,t,e){return e===void 0&&(e={}),ed(n.map(function(i){return kv(i,t)}),e)}me.points=mX;function qv(n,t,e){e===void 0&&(e={});for(var i=0,s=n;i<s.length;i++){var u=s[i];if(u.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");for(var c=0;c<u[u.length-1].length;c++)if(u[u.length-1][c]!==u[0][c])throw new Error("First and last Position are not equivalent.")}var f={type:"Polygon",coordinates:n};return ca(f,t,e)}me.polygon=qv;function gX(n,t,e){return e===void 0&&(e={}),ed(n.map(function(i){return qv(i,t)}),e)}me.polygons=gX;function Vv(n,t,e){if(e===void 0&&(e={}),n.length<2)throw new Error("coordinates must be an array of two or more positions");var i={type:"LineString",coordinates:n};return ca(i,t,e)}me.lineString=Vv;function yX(n,t,e){return e===void 0&&(e={}),ed(n.map(function(i){return Vv(i,t)}),e)}me.lineStrings=yX;function ed(n,t){t===void 0&&(t={});var e={type:"FeatureCollection"};return t.id&&(e.id=t.id),t.bbox&&(e.bbox=t.bbox),e.features=n,e}me.featureCollection=ed;function hI(n,t,e){e===void 0&&(e={});var i={type:"MultiLineString",coordinates:n};return ca(i,t,e)}me.multiLineString=hI;function pI(n,t,e){e===void 0&&(e={});var i={type:"MultiPoint",coordinates:n};return ca(i,t,e)}me.multiPoint=pI;function dI(n,t,e){e===void 0&&(e={});var i={type:"MultiPolygon",coordinates:n};return ca(i,t,e)}me.multiPolygon=dI;function vX(n,t,e){e===void 0&&(e={});var i={type:"GeometryCollection",geometries:n};return ca(i,t,e)}me.geometryCollection=vX;function _X(n,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(n*e)/e}me.round=_X;function mI(n,t){t===void 0&&(t="kilometers");var e=me.factors[t];if(!e)throw new Error(t+" units is invalid");return n*e}me.radiansToLength=mI;function Hv(n,t){t===void 0&&(t="kilometers");var e=me.factors[t];if(!e)throw new Error(t+" units is invalid");return n/e}me.lengthToRadians=Hv;function xX(n,t){return gI(Hv(n,t))}me.lengthToDegrees=xX;function EX(n){var t=n%360;return t<0&&(t+=360),t}me.bearingToAzimuth=EX;function gI(n){var t=n%(2*Math.PI);return t*180/Math.PI}me.radiansToDegrees=gI;function wX(n){var t=n%360;return t*Math.PI/180}me.degreesToRadians=wX;function SX(n,t,e){if(t===void 0&&(t="kilometers"),e===void 0&&(e="kilometers"),!(n>=0))throw new Error("length must be a positive number");return mI(Hv(n,t),e)}me.convertLength=SX;function MX(n,t,e){if(t===void 0&&(t="meters"),e===void 0&&(e="kilometers"),!(n>=0))throw new Error("area must be a positive number");var i=me.areaFactors[t];if(!i)throw new Error("invalid original units");var s=me.areaFactors[e];if(!s)throw new Error("invalid final units");return n/i*s}me.convertArea=MX;function td(n){return!isNaN(n)&&n!==null&&!Array.isArray(n)}me.isNumber=td;function bX(n){return!!n&&n.constructor===Object}me.isObject=bX;function AX(n){if(!n)throw new Error("bbox is required");if(!Array.isArray(n))throw new Error("bbox must be an Array");if(n.length!==4&&n.length!==6)throw new Error("bbox must be an Array of 4 or 6 numbers");n.forEach(function(t){if(!td(t))throw new Error("bbox must only contain numbers")})}me.validateBBox=AX;function TX(n){if(!n)throw new Error("id is required");if(["string","number"].indexOf(typeof n)===-1)throw new Error("id must be a number or a string")}me.validateId=TX});var Yv=Z(Er=>{"use strict";Object.defineProperty(Er,"__esModule",{value:!0});var si=Wv();function ef(n,t,e){if(n!==null)for(var i,s,u,c,f,p,d,m=0,y=0,v,E=n.type,M=E==="FeatureCollection",A=E==="Feature",_=M?n.features.length:1,x=0;x<_;x++){d=M?n.features[x].geometry:A?n.geometry:n,v=d?d.type==="GeometryCollection":!1,f=v?d.geometries.length:1;for(var T=0;T<f;T++){var S=0,R=0;if(c=v?d.geometries[T]:d,c!==null){p=c.coordinates;var z=c.type;switch(m=e&&(z==="Polygon"||z==="MultiPolygon")?1:0,z){case null:break;case"Point":if(t(p,y,x,S,R)===!1)return!1;y++,S++;break;case"LineString":case"MultiPoint":for(i=0;i<p.length;i++){if(t(p[i],y,x,S,R)===!1)return!1;y++,z==="MultiPoint"&&S++}z==="LineString"&&S++;break;case"Polygon":case"MultiLineString":for(i=0;i<p.length;i++){for(s=0;s<p[i].length-m;s++){if(t(p[i][s],y,x,S,R)===!1)return!1;y++}z==="MultiLineString"&&S++,z==="Polygon"&&R++}z==="Polygon"&&S++;break;case"MultiPolygon":for(i=0;i<p.length;i++){for(R=0,s=0;s<p[i].length;s++){for(u=0;u<p[i][s].length-m;u++){if(t(p[i][s][u],y,x,S,R)===!1)return!1;y++}R++}S++}break;case"GeometryCollection":for(i=0;i<c.geometries.length;i++)if(ef(c.geometries[i],t,e)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function CX(n,t,e,i){var s=e;return ef(n,function(u,c,f,p,d){c===0&&e===void 0?s=u:s=t(s,u,c,f,p,d)},i),s}function yI(n,t){var e;switch(n.type){case"FeatureCollection":for(e=0;e<n.features.length&&t(n.features[e].properties,e)!==!1;e++);break;case"Feature":t(n.properties,0);break}}function IX(n,t,e){var i=e;return yI(n,function(s,u){u===0&&e===void 0?i=s:i=t(i,s,u)}),i}function vI(n,t){if(n.type==="Feature")t(n,0);else if(n.type==="FeatureCollection")for(var e=0;e<n.features.length&&t(n.features[e],e)!==!1;e++);}function PX(n,t,e){var i=e;return vI(n,function(s,u){u===0&&e===void 0?i=s:i=t(i,s,u)}),i}function RX(n){var t=[];return ef(n,function(e){t.push(e)}),t}function Xv(n,t){var e,i,s,u,c,f,p,d,m,y,v=0,E=n.type==="FeatureCollection",M=n.type==="Feature",A=E?n.features.length:1;for(e=0;e<A;e++){for(f=E?n.features[e].geometry:M?n.geometry:n,d=E?n.features[e].properties:M?n.properties:{},m=E?n.features[e].bbox:M?n.bbox:void 0,y=E?n.features[e].id:M?n.id:void 0,p=f?f.type==="GeometryCollection":!1,c=p?f.geometries.length:1,s=0;s<c;s++){if(u=p?f.geometries[s]:f,u===null){if(t(null,v,d,m,y)===!1)return!1;continue}switch(u.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":{if(t(u,v,d,m,y)===!1)return!1;break}case"GeometryCollection":{for(i=0;i<u.geometries.length;i++)if(t(u.geometries[i],v,d,m,y)===!1)return!1;break}default:throw new Error("Unknown Geometry Type")}}v++}}function LX(n,t,e){var i=e;return Xv(n,function(s,u,c,f,p){u===0&&e===void 0?i=s:i=t(i,s,u,c,f,p)}),i}function nd(n,t){Xv(n,function(e,i,s,u,c){var f=e===null?null:e.type;switch(f){case null:case"Point":case"LineString":case"Polygon":return t(si.feature(e,s,{bbox:u,id:c}),i,0)===!1?!1:void 0}var p;switch(f){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 m=e.coordinates[d],y={type:p,coordinates:m};if(t(si.feature(y,s),i,d)===!1)return!1}})}function NX(n,t,e){var i=e;return nd(n,function(s,u,c){u===0&&c===0&&e===void 0?i=s:i=t(i,s,u,c)}),i}function _I(n,t){nd(n,function(e,i,s){var u=0;if(e.geometry){var c=e.geometry.type;if(!(c==="Point"||c==="MultiPoint")){var f,p=0,d=0,m=0;if(ef(e,function(y,v,E,M,A){if(f===void 0||i>p||M>d||A>m){f=y,p=i,d=M,m=A,u=0;return}var _=si.lineString([f,y],e.properties);if(t(_,i,s,A,u)===!1)return!1;u++,f=y})===!1)return!1}}})}function OX(n,t,e){var i=e,s=!1;return _I(n,function(u,c,f,p,d){s===!1&&e===void 0?i=u:i=t(i,u,c,f,p,d),s=!0}),i}function xI(n,t){if(!n)throw new Error("geojson is required");nd(n,function(e,i,s){if(e.geometry!==null){var u=e.geometry.type,c=e.geometry.coordinates;switch(u){case"LineString":if(t(e,i,s,0,0)===!1)return!1;break;case"Polygon":for(var f=0;f<c.length;f++)if(t(si.lineString(c[f],e.properties),i,s,f)===!1)return!1;break}}})}function DX(n,t,e){var i=e;return xI(n,function(s,u,c,f){u===0&&e===void 0?i=s:i=t(i,s,u,c,f)}),i}function FX(n,t){if(t=t||{},!si.isObject(t))throw new Error("options is invalid");var e=t.featureIndex||0,i=t.multiFeatureIndex||0,s=t.geometryIndex||0,u=t.segmentIndex||0,c=t.properties,f;switch(n.type){case"FeatureCollection":e<0&&(e=n.features.length+e),c=c||n.features[e].properties,f=n.features[e].geometry;break;case"Feature":c=c||n.properties,f=n.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":f=n;break;default:throw new Error("geojson is invalid")}if(f===null)return null;var p=f.coordinates;switch(f.type){case"Point":case"MultiPoint":return null;case"LineString":return u<0&&(u=p.length+u-1),si.lineString([p[u],p[u+1]],c,t);case"Polygon":return s<0&&(s=p.length+s),u<0&&(u=p[s].length+u-1),si.lineString([p[s][u],p[s][u+1]],c,t);case"MultiLineString":return i<0&&(i=p.length+i),u<0&&(u=p[i].length+u-1),si.lineString([p[i][u],p[i][u+1]],c,t);case"MultiPolygon":return i<0&&(i=p.length+i),s<0&&(s=p[i].length+s),u<0&&(u=p[i][s].length-u-1),si.lineString([p[i][s][u],p[i][s][u+1]],c,t)}throw new Error("geojson is invalid")}function UX(n,t){if(t=t||{},!si.isObject(t))throw new Error("options is invalid");var e=t.featureIndex||0,i=t.multiFeatureIndex||0,s=t.geometryIndex||0,u=t.coordIndex||0,c=t.properties,f;switch(n.type){case"FeatureCollection":e<0&&(e=n.features.length+e),c=c||n.features[e].properties,f=n.features[e].geometry;break;case"Feature":c=c||n.properties,f=n.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":f=n;break;default:throw new Error("geojson is invalid")}if(f===null)return null;var p=f.coordinates;switch(f.type){case"Point":return si.point(p,c,t);case"MultiPoint":return i<0&&(i=p.length+i),si.point(p[i],c,t);case"LineString":return u<0&&(u=p.length+u),si.point(p[u],c,t);case"Polygon":return s<0&&(s=p.length+s),u<0&&(u=p[s].length+u),si.point(p[s][u],c,t);case"MultiLineString":return i<0&&(i=p.length+i),u<0&&(u=p[i].length+u),si.point(p[i][u],c,t);case"MultiPolygon":return i<0&&(i=p.length+i),s<0&&(s=p[i].length+s),u<0&&(u=p[i][s].length-u),si.point(p[i][s][u],c,t)}throw new Error("geojson is invalid")}Er.coordAll=RX;Er.coordEach=ef;Er.coordReduce=CX;Er.featureEach=vI;Er.featureReduce=PX;Er.findPoint=UX;Er.findSegment=FX;Er.flattenEach=nd;Er.flattenReduce=NX;Er.geomEach=Xv;Er.geomReduce=LX;Er.lineEach=xI;Er.lineReduce=DX;Er.propEach=yI;Er.propReduce=IX;Er.segmentEach=_I;Er.segmentReduce=OX});var EI=Z(Zv=>{"use strict";Object.defineProperty(Zv,"__esModule",{value:!0});var BX=Yv();function $v(n){var t=[1/0,1/0,-1/0,-1/0];return BX.coordEach(n,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}$v.default=$v;Zv.default=$v});var rd=Z((Yrt,Jv)=>{var Jo=Ev(),SI=Wv(),MI=Yv(),Tl=EI().default,zX=MI.featureEach,Wrt=MI.coordEach,Xrt=SI.polygon,wI=SI.featureCollection;function bI(n){var t=new Jo(n);return t.insert=function(e){if(e.type!=="Feature")throw new Error("invalid feature");return e.bbox=e.bbox?e.bbox:Tl(e),Jo.prototype.insert.call(this,e)},t.load=function(e){var i=[];return Array.isArray(e)?e.forEach(function(s){if(s.type!=="Feature")throw new Error("invalid features");s.bbox=s.bbox?s.bbox:Tl(s),i.push(s)}):zX(e,function(s){if(s.type!=="Feature")throw new Error("invalid features");s.bbox=s.bbox?s.bbox:Tl(s),i.push(s)}),Jo.prototype.load.call(this,i)},t.remove=function(e,i){if(e.type!=="Feature")throw new Error("invalid feature");return e.bbox=e.bbox?e.bbox:Tl(e),Jo.prototype.remove.call(this,e,i)},t.clear=function(){return Jo.prototype.clear.call(this)},t.search=function(e){var i=Jo.prototype.search.call(this,this.toBBox(e));return wI(i)},t.collides=function(e){return Jo.prototype.collides.call(this,this.toBBox(e))},t.all=function(){var e=Jo.prototype.all.call(this);return wI(e)},t.toJSON=function(){return Jo.prototype.toJSON.call(this)},t.fromJSON=function(e){return Jo.prototype.fromJSON.call(this,e)},t.toBBox=function(e){var i;if(e.bbox)i=e.bbox;else if(Array.isArray(e)&&e.length===4)i=e;else if(Array.isArray(e)&&e.length===6)i=[e[0],e[1],e[3],e[4]];else if(e.type==="Feature")i=Tl(e);else if(e.type==="FeatureCollection")i=Tl(e);else throw new Error("invalid geojson");return{minX:i[0],minY:i[1],maxX:i[2],maxY:i[3]}},t}Jv.exports=bI;Jv.exports.default=bI});var n_=Z((nst,DI)=>{"use strict";var OI=Object.prototype.toString;DI.exports=function(t){var e=OI.call(t),i=e==="[object Arguments]";return i||(i=e!=="[object Array]"&&t!==null&&typeof t=="object"&&typeof t.length=="number"&&t.length>=0&&OI.call(t.callee)==="[object Function]"),i}});var HI=Z((rst,VI)=>{"use strict";var qI;Object.keys||(of=Object.prototype.hasOwnProperty,r_=Object.prototype.toString,FI=n_(),i_=Object.prototype.propertyIsEnumerable,UI=!i_.call({toString:null},"toString"),BI=i_.call(function(){},"prototype"),sf=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],ud=function(n){var t=n.constructor;return t&&t.prototype===n},zI={$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},GI=function(){if(typeof window=="undefined")return!1;for(var n in window)try{if(!zI["$"+n]&&of.call(window,n)&&window[n]!==null&&typeof window[n]=="object")try{ud(window[n])}catch(t){return!0}}catch(t){return!0}return!1}(),kI=function(n){if(typeof window=="undefined"||!GI)return ud(n);try{return ud(n)}catch(t){return!1}},qI=function(t){var e=t!==null&&typeof t=="object",i=r_.call(t)==="[object Function]",s=FI(t),u=e&&r_.call(t)==="[object String]",c=[];if(!e&&!i&&!s)throw new TypeError("Object.keys called on a non-object");var f=BI&&i;if(u&&t.length>0&&!of.call(t,0))for(var p=0;p<t.length;++p)c.push(String(p));if(s&&t.length>0)for(var d=0;d<t.length;++d)c.push(String(d));else for(var m in t)!(f&&m==="prototype")&&of.call(t,m)&&c.push(String(m));if(UI)for(var y=kI(t),v=0;v<sf.length;++v)!(y&&sf[v]==="constructor")&&of.call(t,sf[v])&&c.push(sf[v]);return c});var of,r_,FI,i_,UI,BI,sf,ud,zI,GI,kI;VI.exports=qI});var o_=Z((ist,YI)=>{"use strict";var ZX=Array.prototype.slice,JX=n_(),WI=Object.keys,ld=WI?function(t){return WI(t)}:HI(),XI=Object.keys;ld.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(i){return JX(i)?XI(ZX.call(i)):XI(i)})}else Object.keys=ld;return Object.keys||ld};YI.exports=ld});var s_=Z((ost,$I)=>{"use strict";$I.exports=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var t={},e=Symbol("test"),i=Object(e);if(typeof e=="string"||Object.prototype.toString.call(e)!=="[object Symbol]"||Object.prototype.toString.call(i)!=="[object Symbol]")return!1;var s=42;t[e]=s;for(var u in t)return!1;if(typeof Object.keys=="function"&&Object.keys(t).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(t).length!==0)return!1;var c=Object.getOwnPropertySymbols(t);if(c.length!==1||c[0]!==e||!Object.prototype.propertyIsEnumerable.call(t,e))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var f=Object.getOwnPropertyDescriptor(t,e);if(f.value!==s||f.enumerable!==!0)return!1}return!0}});var cd=Z((sst,ZI)=>{"use strict";var jX=s_();ZI.exports=function(){return jX()&&!!Symbol.toStringTag}});var a_=Z((ast,JI)=>{"use strict";JI.exports=Object});var u_=Z((ust,jI)=>{"use strict";jI.exports=Error});var QI=Z((lst,KI)=>{"use strict";KI.exports=EvalError});var eP=Z((cst,tP)=>{"use strict";tP.exports=RangeError});var rP=Z((fst,nP)=>{"use strict";nP.exports=ReferenceError});var l_=Z((hst,iP)=>{"use strict";iP.exports=SyntaxError});var nu=Z((pst,oP)=>{"use strict";oP.exports=TypeError});var aP=Z((dst,sP)=>{"use strict";sP.exports=URIError});var lP=Z((mst,uP)=>{"use strict";uP.exports=Math.abs});var fP=Z((gst,cP)=>{"use strict";cP.exports=Math.floor});var pP=Z((yst,hP)=>{"use strict";hP.exports=Math.max});var mP=Z((vst,dP)=>{"use strict";dP.exports=Math.min});var yP=Z((_st,gP)=>{"use strict";gP.exports=Math.pow});var _P=Z((xst,vP)=>{"use strict";vP.exports=Math.round});var EP=Z((Est,xP)=>{"use strict";xP.exports=Number.isNaN||function(t){return t!==t}});var SP=Z((wst,wP)=>{"use strict";var KX=EP();wP.exports=function(t){return KX(t)||t===0?t:t<0?-1:1}});var bP=Z((Sst,MP)=>{"use strict";MP.exports=Object.getOwnPropertyDescriptor});var ru=Z((Mst,AP)=>{"use strict";var fd=bP();if(fd)try{fd([],"length")}catch(n){fd=null}AP.exports=fd});var af=Z((bst,TP)=>{"use strict";var hd=Object.defineProperty||!1;if(hd)try{hd({},"a",{value:1})}catch(n){hd=!1}TP.exports=hd});var PP=Z((Ast,IP)=>{"use strict";var CP=typeof Symbol!="undefined"&&Symbol,QX=s_();IP.exports=function(){return typeof CP!="function"||typeof Symbol!="function"||typeof CP("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:QX()}});var c_=Z((Tst,RP)=>{"use strict";RP.exports=typeof Reflect!="undefined"&&Reflect.getPrototypeOf||null});var f_=Z((Cst,LP)=>{"use strict";var t9=a_();LP.exports=t9.getPrototypeOf||null});var DP=Z((Ist,OP)=>{"use strict";var e9="Function.prototype.bind called on incompatible ",n9=Object.prototype.toString,r9=Math.max,i9="[object Function]",NP=function(t,e){for(var i=[],s=0;s<t.length;s+=1)i[s]=t[s];for(var u=0;u<e.length;u+=1)i[u+t.length]=e[u];return i},o9=function(t,e){for(var i=[],s=e||0,u=0;s<t.length;s+=1,u+=1)i[u]=t[s];return i},s9=function(n,t){for(var e="",i=0;i<n.length;i+=1)e+=n[i],i+1<n.length&&(e+=t);return e};OP.exports=function(t){var e=this;if(typeof e!="function"||n9.apply(e)!==i9)throw new TypeError(e9+e);for(var i=o9(arguments,1),s,u=function(){if(this instanceof s){var m=e.apply(this,NP(i,arguments));return Object(m)===m?m:this}return e.apply(t,NP(i,arguments))},c=r9(0,e.length-i.length),f=[],p=0;p<c;p++)f[p]="$"+p;if(s=Function("binder","return function ("+s9(f,",")+"){ return binder.apply(this,arguments); }")(u),e.prototype){var d=function(){};d.prototype=e.prototype,s.prototype=new d,d.prototype=null}return s}});var Cl=Z((Pst,FP)=>{"use strict";var a9=DP();FP.exports=Function.prototype.bind||a9});var pd=Z((Rst,UP)=>{"use strict";UP.exports=Function.prototype.call});var dd=Z((Lst,BP)=>{"use strict";BP.exports=Function.prototype.apply});var GP=Z((Nst,zP)=>{"use strict";zP.exports=typeof Reflect!="undefined"&&Reflect&&Reflect.apply});var h_=Z((Ost,kP)=>{"use strict";var u9=Cl(),l9=dd(),c9=pd(),f9=GP();kP.exports=f9||u9.call(c9,l9)});var md=Z((Dst,qP)=>{"use strict";var h9=Cl(),p9=nu(),d9=pd(),m9=h_();qP.exports=function(t){if(t.length<1||typeof t[0]!="function")throw new p9("a function is required");return m9(h9,d9,t)}});var $P=Z((Fst,YP)=>{"use strict";var g9=md(),VP=ru(),WP;try{WP=[].__proto__===Array.prototype}catch(n){if(!n||typeof n!="object"||!("code"in n)||n.code!=="ERR_PROTO_ACCESS")throw n}var p_=!!WP&&VP&&VP(Object.prototype,"__proto__"),XP=Object,HP=XP.getPrototypeOf;YP.exports=p_&&typeof p_.get=="function"?g9([p_.get]):typeof HP=="function"?function(t){return HP(t==null?t:XP(t))}:!1});var d_=Z((Ust,KP)=>{"use strict";var ZP=c_(),JP=f_(),jP=$P();KP.exports=ZP?function(t){return ZP(t)}:JP?function(t){if(!t||typeof t!="object"&&typeof t!="function")throw new TypeError("getProto: not an object");return JP(t)}:jP?function(t){return jP(t)}:null});var m_=Z((Bst,QP)=>{"use strict";var y9=Function.prototype.call,v9=Object.prototype.hasOwnProperty,_9=Cl();QP.exports=_9.call(y9,v9)});var v_=Z((zst,oR)=>{"use strict";var Qe,x9=a_(),E9=u_(),w9=QI(),S9=eP(),M9=rP(),Ll=l_(),Rl=nu(),b9=aP(),A9=lP(),T9=fP(),C9=pP(),I9=mP(),P9=yP(),R9=_P(),L9=SP(),rR=Function,g_=function(n){try{return rR('"use strict"; return ('+n+").constructor;")()}catch(t){}},uf=ru(),N9=af(),y_=function(){throw new Rl},O9=uf?function(){try{return arguments.callee,y_}catch(n){try{return uf(arguments,"callee").get}catch(t){return y_}}}():y_,Il=PP()(),Ur=d_(),D9=f_(),F9=c_(),iR=dd(),lf=pd(),Pl={},U9=typeof Uint8Array=="undefined"||!Ur?Qe:Ur(Uint8Array),iu={__proto__:null,"%AggregateError%":typeof AggregateError=="undefined"?Qe:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer=="undefined"?Qe:ArrayBuffer,"%ArrayIteratorPrototype%":Il&&Ur?Ur([][Symbol.iterator]()):Qe,"%AsyncFromSyncIteratorPrototype%":Qe,"%AsyncFunction%":Pl,"%AsyncGenerator%":Pl,"%AsyncGeneratorFunction%":Pl,"%AsyncIteratorPrototype%":Pl,"%Atomics%":typeof Atomics=="undefined"?Qe:Atomics,"%BigInt%":typeof BigInt=="undefined"?Qe:BigInt,"%BigInt64Array%":typeof BigInt64Array=="undefined"?Qe:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array=="undefined"?Qe:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView=="undefined"?Qe:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":E9,"%eval%":eval,"%EvalError%":w9,"%Float16Array%":typeof Float16Array=="undefined"?Qe:Float16Array,"%Float32Array%":typeof Float32Array=="undefined"?Qe:Float32Array,"%Float64Array%":typeof Float64Array=="undefined"?Qe:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry=="undefined"?Qe:FinalizationRegistry,"%Function%":rR,"%GeneratorFunction%":Pl,"%Int8Array%":typeof Int8Array=="undefined"?Qe:Int8Array,"%Int16Array%":typeof Int16Array=="undefined"?Qe:Int16Array,"%Int32Array%":typeof Int32Array=="undefined"?Qe:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":Il&&Ur?Ur(Ur([][Symbol.iterator]())):Qe,"%JSON%":typeof JSON=="object"?JSON:Qe,"%Map%":typeof Map=="undefined"?Qe:Map,"%MapIteratorPrototype%":typeof Map=="undefined"||!Il||!Ur?Qe:Ur(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":x9,"%Object.getOwnPropertyDescriptor%":uf,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise=="undefined"?Qe:Promise,"%Proxy%":typeof Proxy=="undefined"?Qe:Proxy,"%RangeError%":S9,"%ReferenceError%":M9,"%Reflect%":typeof Reflect=="undefined"?Qe:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set=="undefined"?Qe:Set,"%SetIteratorPrototype%":typeof Set=="undefined"||!Il||!Ur?Qe:Ur(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer=="undefined"?Qe:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":Il&&Ur?Ur(""[Symbol.iterator]()):Qe,"%Symbol%":Il?Symbol:Qe,"%SyntaxError%":Ll,"%ThrowTypeError%":O9,"%TypedArray%":U9,"%TypeError%":Rl,"%Uint8Array%":typeof Uint8Array=="undefined"?Qe:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray=="undefined"?Qe:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array=="undefined"?Qe:Uint16Array,"%Uint32Array%":typeof Uint32Array=="undefined"?Qe:Uint32Array,"%URIError%":b9,"%WeakMap%":typeof WeakMap=="undefined"?Qe:WeakMap,"%WeakRef%":typeof WeakRef=="undefined"?Qe:WeakRef,"%WeakSet%":typeof WeakSet=="undefined"?Qe:WeakSet,"%Function.prototype.call%":lf,"%Function.prototype.apply%":iR,"%Object.defineProperty%":N9,"%Object.getPrototypeOf%":D9,"%Math.abs%":A9,"%Math.floor%":T9,"%Math.max%":C9,"%Math.min%":I9,"%Math.pow%":P9,"%Math.round%":R9,"%Math.sign%":L9,"%Reflect.getPrototypeOf%":F9};if(Ur)try{null.error}catch(n){tR=Ur(Ur(n)),iu["%Error.prototype%"]=tR}var tR,B9=function n(t){var e;if(t==="%AsyncFunction%")e=g_("async function () {}");else if(t==="%GeneratorFunction%")e=g_("function* () {}");else if(t==="%AsyncGeneratorFunction%")e=g_("async function* () {}");else if(t==="%AsyncGenerator%"){var i=n("%AsyncGeneratorFunction%");i&&(e=i.prototype)}else if(t==="%AsyncIteratorPrototype%"){var s=n("%AsyncGenerator%");s&&Ur&&(e=Ur(s.prototype))}return iu[t]=e,e},eR={__proto__:null,"%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"]},cf=Cl(),gd=m_(),z9=cf.call(lf,Array.prototype.concat),G9=cf.call(iR,Array.prototype.splice),nR=cf.call(lf,String.prototype.replace),yd=cf.call(lf,String.prototype.slice),k9=cf.call(lf,RegExp.prototype.exec),q9=/[^%.[\\]]+|\\[(?:(-?\\d+(?:\\.\\d+)?)|(["'])((?:(?!\\2)[^\\\\]|\\\\.)*?)\\2)\\]|(?=(?:\\.|\\[\\])(?:\\.|\\[\\]|%$))/g,V9=/\\\\(\\\\)?/g,H9=function(t){var e=yd(t,0,1),i=yd(t,-1);if(e==="%"&&i!=="%")throw new Ll("invalid intrinsic syntax, expected closing \`%\`");if(i==="%"&&e!=="%")throw new Ll("invalid intrinsic syntax, expected opening \`%\`");var s=[];return nR(t,q9,function(u,c,f,p){s[s.length]=f?nR(p,V9,"$1"):c||u}),s},W9=function(t,e){var i=t,s;if(gd(eR,i)&&(s=eR[i],i="%"+s[0]+"%"),gd(iu,i)){var u=iu[i];if(u===Pl&&(u=B9(i)),typeof u=="undefined"&&!e)throw new Rl("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:s,name:i,value:u}}throw new Ll("intrinsic "+t+" does not exist!")};oR.exports=function(t,e){if(typeof t!="string"||t.length===0)throw new Rl("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof e!="boolean")throw new Rl('"allowMissing" argument must be a boolean');if(k9(/^%?[^%]*%?$/,t)===null)throw new Ll("\`%\` may not be present anywhere but at the beginning and end of the intrinsic name");var i=H9(t),s=i.length>0?i[0]:"",u=W9("%"+s+"%",e),c=u.name,f=u.value,p=!1,d=u.alias;d&&(s=d[0],G9(i,z9([0,1],d)));for(var m=1,y=!0;m<i.length;m+=1){var v=i[m],E=yd(v,0,1),M=yd(v,-1);if((E==='"'||E==="'"||E==="\`"||M==='"'||M==="'"||M==="\`")&&E!==M)throw new Ll("property names with quotes must have matching quotes");if((v==="constructor"||!y)&&(p=!0),s+="."+v,c="%"+s+"%",gd(iu,c))f=iu[c];else if(f!=null){if(!(v in f)){if(!e)throw new Rl("base intrinsic for "+t+" exists, but the property is not available.");return}if(uf&&m+1>=i.length){var A=uf(f,v);y=!!A,y&&"get"in A&&!("originalValue"in A.get)?f=A.get:f=f[v]}else y=gd(f,v),f=f[v];y&&!p&&(iu[c]=f)}}return f}});var vd=Z((Gst,uR)=>{"use strict";var sR=v_(),aR=md(),X9=aR([sR("%String.prototype.indexOf%")]);uR.exports=function(t,e){var i=sR(t,!!e);return typeof i=="function"&&X9(t,".prototype.")>-1?aR([i]):i}});var fR=Z((kst,cR)=>{"use strict";var Y9=cd()(),$9=vd(),__=$9("Object.prototype.toString"),_d=function(t){return Y9&&t&&typeof t=="object"&&Symbol.toStringTag in t?!1:__(t)==="[object Arguments]"},lR=function(t){return _d(t)?!0:t!==null&&typeof t=="object"&&"length"in t&&typeof t.length=="number"&&t.length>=0&&__(t)!=="[object Array]"&&"callee"in t&&__(t.callee)==="[object Function]"},Z9=function(){return _d(arguments)}();_d.isLegacyArguments=lR;cR.exports=Z9?_d:lR});var xd=Z((qst,dR)=>{"use strict";var hR=af(),J9=l_(),Nl=nu(),pR=ru();dR.exports=function(t,e,i){if(!t||typeof t!="object"&&typeof t!="function")throw new Nl("\`obj\` must be an object or a function\`");if(typeof e!="string"&&typeof e!="symbol")throw new Nl("\`property\` must be a string or a symbol\`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new Nl("\`nonEnumerable\`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new Nl("\`nonWritable\`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new Nl("\`nonConfigurable\`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new Nl("\`loose\`, if provided, must be a boolean");var s=arguments.length>3?arguments[3]:null,u=arguments.length>4?arguments[4]:null,c=arguments.length>5?arguments[5]:null,f=arguments.length>6?arguments[6]:!1,p=!!pR&&pR(t,e);if(hR)hR(t,e,{configurable:c===null&&p?p.configurable:!c,enumerable:s===null&&p?p.enumerable:!s,value:i,writable:u===null&&p?p.writable:!u});else if(f||!s&&!u&&!c)t[e]=i;else throw new J9("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")}});var Ed=Z((Vst,gR)=>{"use strict";var x_=af(),mR=function(){return!!x_};mR.hasArrayLengthDefineBug=function(){if(!x_)return null;try{return x_([],"length",{value:1}).length!==1}catch(t){return!0}};gR.exports=mR});var Ol=Z((Hst,xR)=>{"use strict";var j9=o_(),K9=typeof Symbol=="function"&&typeof Symbol("foo")=="symbol",Q9=Object.prototype.toString,t7=Array.prototype.concat,yR=xd(),e7=function(n){return typeof n=="function"&&Q9.call(n)==="[object Function]"},vR=Ed()(),n7=function(n,t,e,i){if(t in n){if(i===!0){if(n[t]===e)return}else if(!e7(i)||!i())return}vR?yR(n,t,e,!0):yR(n,t,e)},_R=function(n,t){var e=arguments.length>2?arguments[2]:{},i=j9(t);K9&&(i=t7.call(i,Object.getOwnPropertySymbols(t)));for(var s=0;s<i.length;s+=1)n7(n,i[s],t[i[s]],e[i[s]])};_R.supportsDescriptors=!!vR;xR.exports=_R});var bR=Z((Wst,MR)=>{"use strict";var r7=v_(),ER=xd(),i7=Ed()(),wR=ru(),SR=nu(),o7=r7("%Math.floor%");MR.exports=function(t,e){if(typeof t!="function")throw new SR("\`fn\` is not a function");if(typeof e!="number"||e<0||e>4294967295||o7(e)!==e)throw new SR("\`length\` must be a positive 32-bit integer");var i=arguments.length>2&&!!arguments[2],s=!0,u=!0;if("length"in t&&wR){var c=wR(t,"length");c&&!c.configurable&&(s=!1),c&&!c.writable&&(u=!1)}return(s||u||!i)&&(i7?ER(t,"length",e,!0,!0):ER(t,"length",e)),t}});var TR=Z((Xst,AR)=>{"use strict";var s7=Cl(),a7=dd(),u7=h_();AR.exports=function(){return u7(s7,a7,arguments)}});var E_=Z((Yst,wd)=>{"use strict";var l7=bR(),CR=af(),c7=md(),IR=TR();wd.exports=function(t){var e=c7(arguments),i=t.length-(arguments.length-1);return l7(e,1+(i>0?i:0),!0)};CR?CR(wd.exports,"apply",{value:IR}):wd.exports.apply=IR});var w_=Z(($st,RR)=>{"use strict";var PR=function(n){return n!==n};RR.exports=function(t,e){return t===0&&e===0?1/t===1/e:!!(t===e||PR(t)&&PR(e))}});var S_=Z((Zst,LR)=>{"use strict";var f7=w_();LR.exports=function(){return typeof Object.is=="function"?Object.is:f7}});var OR=Z((Jst,NR)=>{"use strict";var h7=S_(),p7=Ol();NR.exports=function(){var t=h7();return p7(Object,{is:t},{is:function(){return Object.is!==t}}),t}});var BR=Z((jst,UR)=>{"use strict";var d7=Ol(),m7=E_(),g7=w_(),DR=S_(),y7=OR(),FR=m7(DR(),Object);d7(FR,{getPolyfill:DR,implementation:g7,shim:y7});UR.exports=FR});var HR=Z((Kst,VR)=>{"use strict";var zR=vd(),v7=cd()(),_7=m_(),x7=ru(),A_;v7?(GR=zR("RegExp.prototype.exec"),M_={},Sd=function(){throw M_},b_={toString:Sd,valueOf:Sd},typeof Symbol.toPrimitive=="symbol"&&(b_[Symbol.toPrimitive]=Sd),A_=function(t){if(!t||typeof t!="object")return!1;var e=x7(t,"lastIndex"),i=e&&_7(e,"value");if(!i)return!1;try{GR(t,b_)}catch(s){return s===M_}}):(kR=zR("Object.prototype.toString"),qR="[object RegExp]",A_=function(t){return!t||typeof t!="object"&&typeof t!="function"?!1:kR(t)===qR});var GR,M_,Sd,b_,kR,qR;VR.exports=A_});var XR=Z((Qst,WR)=>{"use strict";var hf=function(){return typeof function(){}.name=="string"},ff=Object.getOwnPropertyDescriptor;if(ff)try{ff([],"length")}catch(n){ff=null}hf.functionsHaveConfigurableNames=function(){if(!hf()||!ff)return!1;var t=ff(function(){},"name");return!!t&&!!t.configurable};var E7=Function.prototype.bind;hf.boundFunctionsHaveNames=function(){return hf()&&typeof E7=="function"&&function(){}.bind().name!==""};WR.exports=hf});var ZR=Z((tat,$R)=>{"use strict";var YR=xd(),w7=Ed()(),S7=XR().functionsHaveConfigurableNames(),M7=nu();$R.exports=function(t,e){if(typeof t!="function")throw new M7("\`fn\` is not a function");var i=arguments.length>2&&!!arguments[2];return(!i||S7)&&(w7?YR(t,"name",e,!0,!0):YR(t,"name",e)),t}});var T_=Z((eat,JR)=>{"use strict";var b7=ZR(),A7=nu(),T7=Object;JR.exports=b7(function(){if(this==null||this!==T7(this))throw new A7("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 C_=Z((nat,jR)=>{"use strict";var C7=T_(),I7=Ol().supportsDescriptors,P7=Object.getOwnPropertyDescriptor;jR.exports=function(){if(I7&&/a/mig.flags==="gim"){var t=P7(RegExp.prototype,"flags");if(t&&typeof t.get=="function"&&"dotAll"in RegExp.prototype&&"hasIndices"in RegExp.prototype){var e="",i={};if(Object.defineProperty(i,"hasIndices",{get:function(){e+="d"}}),Object.defineProperty(i,"sticky",{get:function(){e+="y"}}),t.get.call(i),e==="dy")return t.get}}return C7}});var tL=Z((rat,QR)=>{"use strict";var R7=Ol().supportsDescriptors,L7=C_(),N7=ru(),O7=Object.defineProperty,D7=u_(),KR=d_(),F7=/a/;QR.exports=function(){if(!R7||!KR)throw new D7("RegExp.prototype.flags requires a true ES5 environment that supports property descriptors");var t=L7(),e=KR(F7),i=N7(e,"flags");return(!i||i.get!==t)&&O7(e,"flags",{configurable:!0,enumerable:!1,get:t}),t}});var iL=Z((iat,rL)=>{"use strict";var U7=Ol(),B7=E_(),z7=T_(),eL=C_(),G7=tL(),nL=B7(eL());U7(nL,{getPolyfill:eL,implementation:z7,shim:G7});rL.exports=nL});var aL=Z((oat,sL)=>{"use strict";var oL=vd(),k7=oL("Date.prototype.getDay"),q7=function(t){try{return k7(t),!0}catch(e){return!1}},V7=oL("Object.prototype.toString"),H7="[object Date]",W7=cd()();sL.exports=function(t){return typeof t!="object"||t===null?!1:W7?q7(t):V7(t)===H7}});var I_=Z((sat,vL)=>{var uL=o_(),lL=fR(),cL=BR(),fL=HR(),hL=iL(),pL=aL(),dL=Date.prototype.getTime;function yL(n,t,e){var i=e||{};return(i.strict?cL(n,t):n===t)?!0:!n||!t||typeof n!="object"&&typeof t!="object"?i.strict?cL(n,t):n==t:X7(n,t,i)}function mL(n){return n==null}function gL(n){return!(!n||typeof n!="object"||typeof n.length!="number"||typeof n.copy!="function"||typeof n.slice!="function"||n.length>0&&typeof n[0]!="number")}function X7(n,t,e){var i,s;if(typeof n!=typeof t||mL(n)||mL(t)||n.prototype!==t.prototype||lL(n)!==lL(t))return!1;var u=fL(n),c=fL(t);if(u!==c)return!1;if(u||c)return n.source===t.source&&hL(n)===hL(t);if(pL(n)&&pL(t))return dL.call(n)===dL.call(t);var f=gL(n),p=gL(t);if(f!==p)return!1;if(f||p){if(n.length!==t.length)return!1;for(i=0;i<n.length;i++)if(n[i]!==t[i])return!1;return!0}if(typeof n!=typeof t)return!1;try{var d=uL(n),m=uL(t)}catch(y){return!1}if(d.length!==m.length)return!1;for(d.sort(),m.sort(),i=d.length-1;i>=0;i--)if(d[i]!=m[i])return!1;for(i=d.length-1;i>=0;i--)if(s=d[i],!yL(n[s],t[s],e))return!1;return!0}vL.exports=yL});var k_=Z((hlt,bL)=>{var FY=I_(),jo=function(n){this.precision=n&&n.precision?n.precision:17,this.direction=n&&n.direction?n.direction:!1,this.pseudoNode=n&&n.pseudoNode?n.pseudoNode:!1,this.objectComparator=n&&n.objectComparator?n.objectComparator:UY};jo.prototype.compare=function(n,t){if(n.type!==t.type||!ML(n,t))return!1;switch(n.type){case"Point":return this.compareCoord(n.coordinates,t.coordinates);case"LineString":return this.compareLine(n.coordinates,t.coordinates,0,!1);case"Polygon":return this.comparePolygon(n,t);case"Feature":return this.compareFeature(n,t);default:if(n.type.indexOf("Multi")===0){var e=this,i=SL(n),s=SL(t);return i.every(function(u){return this.some(function(c){return e.compare(u,c)})},s)}}return!1};function SL(n){return n.coordinates.map(function(t){return{type:n.type.replace("Multi",""),coordinates:t}})}function ML(n,t){return n.hasOwnProperty("coordinates")?n.coordinates.length===t.coordinates.length:n.length===t.length}jo.prototype.compareCoord=function(n,t){if(n.length!==t.length)return!1;for(var e=0;e<n.length;e++)if(n[e].toFixed(this.precision)!==t[e].toFixed(this.precision))return!1;return!0};jo.prototype.compareLine=function(n,t,e,i){if(!ML(n,t))return!1;var s=this.pseudoNode?n:this.removePseudo(n),u=this.pseudoNode?t:this.removePseudo(t);if(!(i&&!this.compareCoord(s[0],u[0])&&(u=this.fixStartIndex(u,s),!u))){var c=this.compareCoord(s[e],u[e]);return this.direction||c?this.comparePath(s,u):this.compareCoord(s[e],u[u.length-(1+e)])?this.comparePath(s.slice().reverse(),u):!1}};jo.prototype.fixStartIndex=function(n,t){for(var e,i=-1,s=0;s<n.length;s++)if(this.compareCoord(n[s],t[0])){i=s;break}return i>=0&&(e=[].concat(n.slice(i,n.length),n.slice(1,i+1))),e};jo.prototype.comparePath=function(n,t){var e=this;return n.every(function(i,s){return e.compareCoord(i,this[s])},t)};jo.prototype.comparePolygon=function(n,t){if(this.compareLine(n.coordinates[0],t.coordinates[0],1,!0)){var e=n.coordinates.slice(1,n.coordinates.length),i=t.coordinates.slice(1,t.coordinates.length),s=this;return e.every(function(u){return this.some(function(c){return s.compareLine(u,c,1,!0)})},i)}else return!1};jo.prototype.compareFeature=function(n,t){return n.id!==t.id||!this.objectComparator(n.properties,t.properties)||!this.compareBBox(n,t)?!1:this.compare(n.geometry,t.geometry)};jo.prototype.compareBBox=function(n,t){return!!(!n.bbox&&!t.bbox||n.bbox&&t.bbox&&this.compareCoord(n.bbox,t.bbox))};jo.prototype.removePseudo=function(n){return n};function UY(n,t){return FY(n,t,{strict:!0})}bL.exports=jo});var AL=Z((Mlt,Ad)=>{function ha(n,t,e,i){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(n,t,e,i)}ha.prototype.run=function(n,t,e,i){this._init(n,t,e,i);for(var s=0;s<this._datasetLength;s++)if(this._visited[s]!==1){this._visited[s]=1;var u=this._regionQuery(s);if(u.length<this.minPts)this.noise.push(s);else{var c=this.clusters.length;this.clusters.push([]),this._addToCluster(s,c),this._expandCluster(c,u)}}return this.clusters};ha.prototype._init=function(n,t,e,i){if(n){if(!(n instanceof Array))throw Error("Dataset must be of type array, "+typeof n+" given");this.dataset=n,this.clusters=[],this.noise=[],this._datasetLength=n.length,this._visited=new Array(this._datasetLength),this._assigned=new Array(this._datasetLength)}t&&(this.epsilon=t),e&&(this.minPts=e),i&&(this.distance=i)};ha.prototype._expandCluster=function(n,t){for(var e=0;e<t.length;e++){var i=t[e];if(this._visited[i]!==1){this._visited[i]=1;var s=this._regionQuery(i);s.length>=this.minPts&&(t=this._mergeArrays(t,s))}this._assigned[i]!==1&&this._addToCluster(i,n)}};ha.prototype._addToCluster=function(n,t){this.clusters[t].push(n),this._assigned[n]=1};ha.prototype._regionQuery=function(n){for(var t=[],e=0;e<this._datasetLength;e++){var i=this.distance(this.dataset[n],this.dataset[e]);i<this.epsilon&&t.push(e)}return t};ha.prototype._mergeArrays=function(n,t){for(var e=t.length,i=0;i<e;i++){var s=t[i];n.indexOf(s)<0&&n.push(s)}return n};ha.prototype._euclideanDistance=function(n,t){for(var e=0,i=Math.min(n.length,t.length);i--;)e+=(n[i]-t[i])*(n[i]-t[i]);return Math.sqrt(e)};typeof Ad!="undefined"&&Ad.exports&&(Ad.exports=ha)});var TL=Z((blt,Td)=>{function pa(n,t,e){this.k=3,this.dataset=[],this.assignments=[],this.centroids=[],this.init(n,t,e)}pa.prototype.init=function(n,t,e){this.assignments=[],this.centroids=[],typeof n!="undefined"&&(this.dataset=n),typeof t!="undefined"&&(this.k=t),typeof e!="undefined"&&(this.distance=e)};pa.prototype.run=function(n,t){this.init(n,t);for(var e=this.dataset.length,i=0;i<this.k;i++)this.centroids[i]=this.randomCentroid();for(var s=!0;s;){s=this.assign();for(var u=0;u<this.k;u++){for(var c=new Array(m),f=0,p=0;p<m;p++)c[p]=0;for(var d=0;d<e;d++){var m=this.dataset[d].length;if(u===this.assignments[d]){for(var p=0;p<m;p++)c[p]+=this.dataset[d][p];f++}}if(f>0){for(var p=0;p<m;p++)c[p]/=f;this.centroids[u]=c}else this.centroids[u]=this.randomCentroid(),s=!0}}return this.getClusters()};pa.prototype.randomCentroid=function(){var n=this.dataset.length-1,t,e;do e=Math.round(Math.random()*n),t=this.dataset[e];while(this.centroids.indexOf(t)>=0);return t};pa.prototype.assign=function(){for(var n=!1,t=this.dataset.length,e,i=0;i<t;i++)e=this.argmin(this.dataset[i],this.centroids,this.distance),e!=this.assignments[i]&&(this.assignments[i]=e,n=!0);return n};pa.prototype.getClusters=function(){for(var n=new Array(this.k),t,e=0;e<this.assignments.length;e++)t=this.assignments[e],typeof n[t]=="undefined"&&(n[t]=[]),n[t].push(e);return n};pa.prototype.argmin=function(n,t,e){for(var i=Number.MAX_VALUE,s=0,u=t.length,c,f=0;f<u;f++)c=e(n,t[f]),c<i&&(i=c,s=f);return s};pa.prototype.distance=function(n,t){for(var e=0,i=Math.min(n.length,t.length);i--;){var s=n[i]-t[i];e+=s*s}return Math.sqrt(e)};typeof Td!="undefined"&&Td.exports&&(Td.exports=pa)});var q_=Z((Alt,Cd)=>{function Ko(n,t,e){this._queue=[],this._priorities=[],this._sorting="desc",this._init(n,t,e)}Ko.prototype.insert=function(n,t){for(var e=this._queue.length,i=e;i--;){var s=this._priorities[i];this._sorting==="desc"?t>s&&(e=i):t<s&&(e=i)}this._insertAt(n,t,e)};Ko.prototype.remove=function(n){for(var t=this._queue.length;t--;){var e=this._queue[t];if(n===e){this._queue.splice(t,1),this._priorities.splice(t,1);break}}};Ko.prototype.forEach=function(n){this._queue.forEach(n)};Ko.prototype.getElements=function(){return this._queue};Ko.prototype.getElementPriority=function(n){return this._priorities[n]};Ko.prototype.getPriorities=function(){return this._priorities};Ko.prototype.getElementsWithPriorities=function(){for(var n=[],t=0,e=this._queue.length;t<e;t++)n.push([this._queue[t],this._priorities[t]]);return n};Ko.prototype._init=function(n,t,e){if(n&&t){if(this._queue=[],this._priorities=[],n.length!==t.length)throw new Error("Arrays must have the same length");for(var i=0;i<n.length;i++)this.insert(n[i],t[i])}e&&(this._sorting=e)};Ko.prototype._insertAt=function(n,t,e){this._queue.length===e?(this._queue.push(n),this._priorities.push(t)):(this._queue.splice(e,0,n),this._priorities.splice(e,0,t))};typeof Cd!="undefined"&&Cd.exports&&(Cd.exports=Ko)});var IL=Z((Tlt,Fl)=>{typeof Fl!="undefined"&&Fl.exports&&(CL=q_());var CL;function Ps(n,t,e,i){this.epsilon=1,this.minPts=1,this.distance=this._euclideanDistance,this._reachability=[],this._processed=[],this._coreDistance=0,this._orderedList=[],this._init(n,t,e,i)}Ps.prototype.run=function(n,t,e,i){this._init(n,t,e,i);for(var s=0,u=this.dataset.length;s<u;s++)if(this._processed[s]!==1){this._processed[s]=1,this.clusters.push([s]);var c=this.clusters.length-1;this._orderedList.push(s);var f=new CL(null,null,"asc"),p=this._regionQuery(s);this._distanceToCore(s)!==void 0&&(this._updateQueue(s,p,f),this._expandCluster(c,f))}return this.clusters};Ps.prototype.getReachabilityPlot=function(){for(var n=[],t=0,e=this._orderedList.length;t<e;t++){var i=this._orderedList[t],s=this._reachability[i];n.push([i,s])}return n};Ps.prototype._init=function(n,t,e,i){if(n){if(!(n instanceof Array))throw Error("Dataset must be of type array, "+typeof n+" given");this.dataset=n,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),i&&(this.distance=i)};Ps.prototype._updateQueue=function(n,t,e){var i=this;this._coreDistance=this._distanceToCore(n),t.forEach(function(s){if(i._processed[s]===void 0){var u=i.distance(i.dataset[n],i.dataset[s]),c=Math.max(i._coreDistance,u);i._reachability[s]===void 0?(i._reachability[s]=c,e.insert(s,c)):c<i._reachability[s]&&(i._reachability[s]=c,e.remove(s),e.insert(s,c))}})};Ps.prototype._expandCluster=function(n,t){for(var e=t.getElements(),i=0,s=e.length;i<s;i++){var u=e[i];if(this._processed[u]===void 0){var c=this._regionQuery(u);this._processed[u]=1,this.clusters[n].push(u),this._orderedList.push(u),this._distanceToCore(u)!==void 0&&(this._updateQueue(u,c,t),this._expandCluster(n,t))}}};Ps.prototype._distanceToCore=function(n){for(var t=this.epsilon,e=0;e<t;e++){var i=this._regionQuery(n,e);if(i.length>=this.minPts)return e}};Ps.prototype._regionQuery=function(n,t){t=t||this.epsilon;for(var e=[],i=0,s=this.dataset.length;i<s;i++)this.distance(this.dataset[n],this.dataset[i])<t&&e.push(i);return e};Ps.prototype._euclideanDistance=function(n,t){for(var e=0,i=Math.min(n.length,t.length);i--;)e+=(n[i]-t[i])*(n[i]-t[i]);return Math.sqrt(e)};typeof Fl!="undefined"&&Fl.exports&&(Fl.exports=Ps)});var PL=Z((Clt,Id)=>{typeof Id!="undefined"&&Id.exports&&(Id.exports={DBSCAN:AL(),KMEANS:TL(),OPTICS:IL(),PriorityQueue:q_()})});var V_=Z((Olt,LL)=>{"use strict";LL.exports={eudist:function(t,e,i){for(var s=t.length,u=0,c=0;c<s;c++){var f=(t[c]||0)-(e[c]||0);u+=f*f}return i?Math.sqrt(u):u},mandist:function(t,e,i){for(var s=t.length,u=0,c=0;c<s;c++)u+=Math.abs((t[c]||0)-(e[c]||0));return i?Math.sqrt(u):u},dist:function(t,e,i){var s=Math.abs(t-e);return i?s:s*s}}});var DL=Z((Dlt,OL)=>{"use strict";var NL=V_(),VY=NL.eudist,HY=NL.dist;OL.exports={kmrand:function(t,e){for(var i={},s=[],u=e<<2,c=t.length,f=t[0].length>0;s.length<e&&u-- >0;){var p=t[Math.floor(Math.random()*c)],d=f?p.join("_"):""+p;i[d]||(i[d]=!0,s.push(p))}if(s.length<e)throw new Error("Error initializating clusters");return s},kmpp:function(t,e){var i=t[0].length?VY:HY,s=[],u=t.length,c=t[0].length>0,f={},p=t[Math.floor(Math.random()*u)],d=c?p.join("_"):""+p;for(s.push(p),f[d]=!0;s.length<e;){for(var m=[],y=s.length,v=0,E=[],M=0;M<u;M++){for(var A=1/0,_=0;_<y;_++){var x=i(t[M],s[_]);x<=A&&(A=x)}m[M]=A}for(var T=0;T<u;T++)v+=m[T];for(var S=0;S<u;S++)E[S]={i:S,v:t[S],pr:m[S]/v,cs:0};E.sort(function(D,P){return D.pr-P.pr}),E[0].cs=E[0].pr;for(var R=1;R<u;R++)E[R].cs=E[R-1].cs+E[R].pr;for(var z=Math.random(),U=0;U<u-1&&E[U++].cs<z;);s.push(E[U-1].v)}return s}}});var GL=Z((Blt,zL)=>{"use strict";var H_=V_(),BL=DL(),WY=H_.eudist,Flt=H_.mandist,Ult=H_.dist,XY=BL.kmrand,YY=BL.kmpp,FL=1e4;function UL(n,t,e){e=e||[];for(var i=0;i<n;i++)e[i]=t;return e}function $Y(n,t,e,i){var s=[],u=[],c=[],f=[],p=!1,d=i||FL,m=n.length,y=n[0].length,v=y>0,E=[];if(e)e=="kmrand"?s=XY(n,t):e=="kmpp"?s=YY(n,t):s=e;else for(var M={};s.length<t;){var A=Math.floor(Math.random()*m);M[A]||(M[A]=!0,s.push(n[A]))}do{UL(t,0,E);for(var _=0;_<m;_++){for(var x=1/0,T=0,S=0;S<t;S++){var f=v?WY(n[_],s[S]):Math.abs(n[_]-s[S]);f<=x&&(x=f,T=S)}c[_]=T,E[T]++}for(var R=[],u=[],z=0,U=0;U<t;U++)R[U]=v?UL(y,0,R[U]):0,u[U]=s[U];if(v){for(var D=0;D<t;D++)s[D]=[];for(var P=0;P<m;P++)for(var ct=c[P],L=R[ct],W=n[P],V=0;V<y;V++)L[V]+=W[V];p=!0;for(var Mt=0;Mt<t;Mt++){for(var Y=s[Mt],mt=R[Mt],ft=u[Mt],vt=E[Mt],it=0;it<y;it++)Y[it]=mt[it]/vt||0;if(p){for(var lt=0;lt<y;lt++)if(ft[lt]!=Y[lt]){p=!1;break}}}}else{for(var H=0;H<m;H++){var At=c[H];R[At]+=n[H]}for(var It=0;It<t;It++)s[It]=R[It]/E[It]||0;p=!0;for(var jt=0;jt<t;jt++)if(u[jt]!=s[jt]){p=!1;break}}p=p||--d<=0}while(!p);return{it:FL-d,k:t,idxs:c,centroids:s}}zL.exports=$Y});var kl=Z((J_,j_)=>{(function(n,t){typeof J_=="object"&&typeof j_!="undefined"?j_.exports=t():typeof define=="function"&&define.amd?define(t):(n=typeof globalThis!="undefined"?globalThis:n||self,n.polygonClipping=t())})(J_,function(){"use strict";function n(j,b){var I={label:0,sent:function(){if(G[0]&1)throw G[1];return G[1]},trys:[],ops:[]},F,k,G,rt;return rt={next:tt(0),throw:tt(1),return:tt(2)},typeof Symbol=="function"&&(rt[Symbol.iterator]=function(){return this}),rt;function tt(ht){return function(O){return pt([ht,O])}}function pt(ht){if(F)throw new TypeError("Generator is already executing.");for(;I;)try{if(F=1,k&&(G=ht[0]&2?k.return:ht[0]?k.throw||((G=k.return)&&G.call(k),0):k.next)&&!(G=G.call(k,ht[1])).done)return G;switch(k=0,G&&(ht=[ht[0]&2,G.value]),ht[0]){case 0:case 1:G=ht;break;case 4:return I.label++,{value:ht[1],done:!1};case 5:I.label++,k=ht[1],ht=[0];continue;case 7:ht=I.ops.pop(),I.trys.pop();continue;default:if(G=I.trys,!(G=G.length>0&&G[G.length-1])&&(ht[0]===6||ht[0]===2)){I=0;continue}if(ht[0]===3&&(!G||ht[1]>G[0]&&ht[1]<G[3])){I.label=ht[1];break}if(ht[0]===6&&I.label<G[1]){I.label=G[1],G=ht;break}if(G&&I.label<G[2]){I.label=G[2],I.ops.push(ht);break}G[2]&&I.ops.pop(),I.trys.pop();continue}ht=b.call(j,I)}catch(O){ht=[6,O],k=0}finally{F=G=0}if(ht[0]&5)throw ht[1];return{value:ht[0]?ht[1]:void 0,done:!0}}}var t=function(){function j(b,I){this.next=null,this.key=b,this.data=I,this.left=null,this.right=null}return j}();function e(j,b){return j>b?1:j<b?-1:0}function i(j,b,I){for(var F=new t(null,null),k=F,G=F;;){var rt=I(j,b.key);if(rt<0){if(b.left===null)break;if(I(j,b.left.key)<0){var tt=b.left;if(b.left=tt.right,tt.right=b,b=tt,b.left===null)break}G.left=b,G=b,b=b.left}else if(rt>0){if(b.right===null)break;if(I(j,b.right.key)>0){var tt=b.right;if(b.right=tt.left,tt.left=b,b=tt,b.right===null)break}k.right=b,k=b,b=b.right}else break}return k.right=b.left,G.left=b.right,b.left=F.right,b.right=F.left,b}function s(j,b,I,F){var k=new t(j,b);if(I===null)return k.left=k.right=null,k;I=i(j,I,F);var G=F(j,I.key);return G<0?(k.left=I.left,k.right=I,I.left=null):G>=0&&(k.right=I.right,k.left=I,I.right=null),k}function u(j,b,I){var F=null,k=null;if(b){b=i(j,b,I);var G=I(b.key,j);G===0?(F=b.left,k=b.right):G<0?(k=b.right,b.right=null,F=b):(F=b.left,b.left=null,k=b)}return{left:F,right:k}}function c(j,b,I){return b===null?j:(j===null||(b=i(j.key,b,I),b.left=j),b)}function f(j,b,I,F,k){if(j){F(""+b+(I?"\\u2514\\u2500\\u2500 ":"\\u251C\\u2500\\u2500 ")+k(j)+\`
|
|
228
228
|
\`);var G=b+(I?" ":"\\u2502 ");j.left&&f(j.left,G,!1,F,k),j.right&&f(j.right,G,!0,F,k)}}var p=function(){function j(b){b===void 0&&(b=e),this._root=null,this._size=0,this._comparator=b}return j.prototype.insert=function(b,I){return this._size++,this._root=s(b,I,this._root,this._comparator)},j.prototype.add=function(b,I){var F=new t(b,I);this._root===null&&(F.left=F.right=null,this._size++,this._root=F);var k=this._comparator,G=i(b,this._root,k),rt=k(b,G.key);return rt===0?this._root=G:(rt<0?(F.left=G.left,F.right=G,G.left=null):rt>0&&(F.right=G.right,F.left=G,G.right=null),this._size++,this._root=F),this._root},j.prototype.remove=function(b){this._root=this._remove(b,this._root,this._comparator)},j.prototype._remove=function(b,I,F){var k;if(I===null)return null;I=i(b,I,F);var G=F(b,I.key);return G===0?(I.left===null?k=I.right:(k=i(b,I.left,F),k.right=I.right),this._size--,k):I},j.prototype.pop=function(){var b=this._root;if(b){for(;b.left;)b=b.left;return this._root=i(b.key,this._root,this._comparator),this._root=this._remove(b.key,this._root,this._comparator),{key:b.key,data:b.data}}return null},j.prototype.findStatic=function(b){for(var I=this._root,F=this._comparator;I;){var k=F(b,I.key);if(k===0)return I;k<0?I=I.left:I=I.right}return null},j.prototype.find=function(b){return this._root&&(this._root=i(b,this._root,this._comparator),this._comparator(b,this._root.key)!==0)?null:this._root},j.prototype.contains=function(b){for(var I=this._root,F=this._comparator;I;){var k=F(b,I.key);if(k===0)return!0;k<0?I=I.left:I=I.right}return!1},j.prototype.forEach=function(b,I){for(var F=this._root,k=[],G=!1;!G;)F!==null?(k.push(F),F=F.left):k.length!==0?(F=k.pop(),b.call(I,F),F=F.right):G=!0;return this},j.prototype.range=function(b,I,F,k){for(var G=[],rt=this._comparator,tt=this._root,pt;G.length!==0||tt;)if(tt)G.push(tt),tt=tt.left;else{if(tt=G.pop(),pt=rt(tt.key,I),pt>0)break;if(rt(tt.key,b)>=0&&F.call(k,tt))return this;tt=tt.right}return this},j.prototype.keys=function(){var b=[];return this.forEach(function(I){var F=I.key;return b.push(F)}),b},j.prototype.values=function(){var b=[];return this.forEach(function(I){var F=I.data;return b.push(F)}),b},j.prototype.min=function(){return this._root?this.minNode(this._root).key:null},j.prototype.max=function(){return this._root?this.maxNode(this._root).key:null},j.prototype.minNode=function(b){if(b===void 0&&(b=this._root),b)for(;b.left;)b=b.left;return b},j.prototype.maxNode=function(b){if(b===void 0&&(b=this._root),b)for(;b.right;)b=b.right;return b},j.prototype.at=function(b){for(var I=this._root,F=!1,k=0,G=[];!F;)if(I)G.push(I),I=I.left;else if(G.length>0){if(I=G.pop(),k===b)return I;k++,I=I.right}else F=!0;return null},j.prototype.next=function(b){var I=this._root,F=null;if(b.right){for(F=b.right;F.left;)F=F.left;return F}for(var k=this._comparator;I;){var G=k(b.key,I.key);if(G===0)break;G<0?(F=I,I=I.left):I=I.right}return F},j.prototype.prev=function(b){var I=this._root,F=null;if(b.left!==null){for(F=b.left;F.right;)F=F.right;return F}for(var k=this._comparator;I;){var G=k(b.key,I.key);if(G===0)break;G<0?I=I.left:(F=I,I=I.right)}return F},j.prototype.clear=function(){return this._root=null,this._size=0,this},j.prototype.toList=function(){return y(this._root)},j.prototype.load=function(b,I,F){I===void 0&&(I=[]),F===void 0&&(F=!1);var k=b.length,G=this._comparator;if(F&&M(b,I,0,k-1,G),this._root===null)this._root=d(b,I,0,k),this._size=k;else{var rt=E(this.toList(),m(b,I),G);k=this._size+k,this._root=v({head:rt},0,k)}return this},j.prototype.isEmpty=function(){return this._root===null},Object.defineProperty(j.prototype,"size",{get:function(){return this._size},enumerable:!0,configurable:!0}),Object.defineProperty(j.prototype,"root",{get:function(){return this._root},enumerable:!0,configurable:!0}),j.prototype.toString=function(b){b===void 0&&(b=function(F){return String(F.key)});var I=[];return f(this._root,"",!0,function(F){return I.push(F)},b),I.join("")},j.prototype.update=function(b,I,F){var k=this._comparator,G=u(b,this._root,k),rt=G.left,tt=G.right;k(b,I)<0?tt=s(I,F,tt,k):rt=s(I,F,rt,k),this._root=c(rt,tt,k)},j.prototype.split=function(b){return u(b,this._root,this._comparator)},j.prototype[Symbol.iterator]=function(){var b,I,F;return n(this,function(k){switch(k.label){case 0:b=this._root,I=[],F=!1,k.label=1;case 1:return F?[3,6]:b===null?[3,2]:(I.push(b),b=b.left,[3,5]);case 2:return I.length===0?[3,4]:(b=I.pop(),[4,b]);case 3:return k.sent(),b=b.right,[3,5];case 4:F=!0,k.label=5;case 5:return[3,1];case 6:return[2]}})},j}();function d(j,b,I,F){var k=F-I;if(k>0){var G=I+Math.floor(k/2),rt=j[G],tt=b[G],pt=new t(rt,tt);return pt.left=d(j,b,I,G),pt.right=d(j,b,G+1,F),pt}return null}function m(j,b){for(var I=new t(null,null),F=I,k=0;k<j.length;k++)F=F.next=new t(j[k],b[k]);return F.next=null,I.next}function y(j){for(var b=j,I=[],F=!1,k=new t(null,null),G=k;!F;)b?(I.push(b),b=b.left):I.length>0?(b=G=G.next=I.pop(),b=b.right):F=!0;return G.next=null,k.next}function v(j,b,I){var F=I-b;if(F>0){var k=b+Math.floor(F/2),G=v(j,b,k),rt=j.head;return rt.left=G,j.head=j.head.next,rt.right=v(j,k+1,I),rt}return null}function E(j,b,I){for(var F=new t(null,null),k=F,G=j,rt=b;G!==null&&rt!==null;)I(G.key,rt.key)<0?(k.next=G,G=G.next):(k.next=rt,rt=rt.next),k=k.next;return G!==null?k.next=G:rt!==null&&(k.next=rt),F.next}function M(j,b,I,F,k){if(!(I>=F)){for(var G=j[I+F>>1],rt=I-1,tt=F+1;;){do rt++;while(k(j[rt],G)<0);do tt--;while(k(j[tt],G)>0);if(rt>=tt)break;var pt=j[rt];j[rt]=j[tt],j[tt]=pt,pt=b[rt],b[rt]=b[tt],b[tt]=pt}M(j,b,I,tt,k),M(j,b,tt+1,F,k)}}let A=(j,b)=>j.ll.x<=b.x&&b.x<=j.ur.x&&j.ll.y<=b.y&&b.y<=j.ur.y,_=(j,b)=>{if(b.ur.x<j.ll.x||j.ur.x<b.ll.x||b.ur.y<j.ll.y||j.ur.y<b.ll.y)return null;let I=j.ll.x<b.ll.x?b.ll.x:j.ll.x,F=j.ur.x<b.ur.x?j.ur.x:b.ur.x,k=j.ll.y<b.ll.y?b.ll.y:j.ll.y,G=j.ur.y<b.ur.y?j.ur.y:b.ur.y;return{ll:{x:I,y:k},ur:{x:F,y:G}}},x=Number.EPSILON;x===void 0&&(x=Math.pow(2,-52));let T=x*x,S=(j,b)=>{if(-x<j&&j<x&&-x<b&&b<x)return 0;let I=j-b;return I*I<T*j*b?0:j<b?-1:1};class R{constructor(){this.reset()}reset(){this.xRounder=new z,this.yRounder=new z}round(b,I){return{x:this.xRounder.round(b),y:this.yRounder.round(I)}}}class z{constructor(){this.tree=new p,this.round(0)}round(b){let I=this.tree.add(b),F=this.tree.prev(I);if(F!==null&&S(I.key,F.key)===0)return this.tree.remove(b),F.key;let k=this.tree.next(I);return k!==null&&S(I.key,k.key)===0?(this.tree.remove(b),k.key):b}}let U=new R,D=11102230246251565e-32,P=134217729,ct=(3+8*D)*D;function L(j,b,I,F,k){let G,rt,tt,pt,ht=b[0],O=F[0],Q=0,J=0;O>ht==O>-ht?(G=ht,ht=b[++Q]):(G=O,O=F[++J]);let et=0;if(Q<j&&J<I)for(O>ht==O>-ht?(rt=ht+G,tt=G-(rt-ht),ht=b[++Q]):(rt=O+G,tt=G-(rt-O),O=F[++J]),G=rt,tt!==0&&(k[et++]=tt);Q<j&&J<I;)O>ht==O>-ht?(rt=G+ht,pt=rt-G,tt=G-(rt-pt)+(ht-pt),ht=b[++Q]):(rt=G+O,pt=rt-G,tt=G-(rt-pt)+(O-pt),O=F[++J]),G=rt,tt!==0&&(k[et++]=tt);for(;Q<j;)rt=G+ht,pt=rt-G,tt=G-(rt-pt)+(ht-pt),ht=b[++Q],G=rt,tt!==0&&(k[et++]=tt);for(;J<I;)rt=G+O,pt=rt-G,tt=G-(rt-pt)+(O-pt),O=F[++J],G=rt,tt!==0&&(k[et++]=tt);return(G!==0||et===0)&&(k[et++]=G),et}function W(j,b){let I=b[0];for(let F=1;F<j;F++)I+=b[F];return I}function V(j){return new Float64Array(j)}let Mt=(3+16*D)*D,Y=(2+12*D)*D,mt=(9+64*D)*D*D,ft=V(4),vt=V(8),it=V(12),lt=V(16),H=V(4);function At(j,b,I,F,k,G,rt){let tt,pt,ht,O,Q,J,et,Tt,Gt,re,ie,Se,ye,be,Ae,On,pr,_n,pe=j-k,xn=I-k,Rn=b-G,Tn=F-G;be=pe*Tn,J=P*pe,et=J-(J-pe),Tt=pe-et,J=P*Tn,Gt=J-(J-Tn),re=Tn-Gt,Ae=Tt*re-(be-et*Gt-Tt*Gt-et*re),On=Rn*xn,J=P*Rn,et=J-(J-Rn),Tt=Rn-et,J=P*xn,Gt=J-(J-xn),re=xn-Gt,pr=Tt*re-(On-et*Gt-Tt*Gt-et*re),ie=Ae-pr,Q=Ae-ie,ft[0]=Ae-(ie+Q)+(Q-pr),Se=be+ie,Q=Se-be,ye=be-(Se-Q)+(ie-Q),ie=ye-On,Q=ye-ie,ft[1]=ye-(ie+Q)+(Q-On),_n=Se+ie,Q=_n-Se,ft[2]=Se-(_n-Q)+(ie-Q),ft[3]=_n;let En=W(4,ft),Jr=Y*rt;if(En>=Jr||-En>=Jr||(Q=j-pe,tt=j-(pe+Q)+(Q-k),Q=I-xn,ht=I-(xn+Q)+(Q-k),Q=b-Rn,pt=b-(Rn+Q)+(Q-G),Q=F-Tn,O=F-(Tn+Q)+(Q-G),tt===0&&pt===0&&ht===0&&O===0)||(Jr=mt*rt+ct*Math.abs(En),En+=pe*O+Tn*tt-(Rn*ht+xn*pt),En>=Jr||-En>=Jr))return En;be=tt*Tn,J=P*tt,et=J-(J-tt),Tt=tt-et,J=P*Tn,Gt=J-(J-Tn),re=Tn-Gt,Ae=Tt*re-(be-et*Gt-Tt*Gt-et*re),On=pt*xn,J=P*pt,et=J-(J-pt),Tt=pt-et,J=P*xn,Gt=J-(J-xn),re=xn-Gt,pr=Tt*re-(On-et*Gt-Tt*Gt-et*re),ie=Ae-pr,Q=Ae-ie,H[0]=Ae-(ie+Q)+(Q-pr),Se=be+ie,Q=Se-be,ye=be-(Se-Q)+(ie-Q),ie=ye-On,Q=ye-ie,H[1]=ye-(ie+Q)+(Q-On),_n=Se+ie,Q=_n-Se,H[2]=Se-(_n-Q)+(ie-Q),H[3]=_n;let Sr=L(4,ft,4,H,vt);be=pe*O,J=P*pe,et=J-(J-pe),Tt=pe-et,J=P*O,Gt=J-(J-O),re=O-Gt,Ae=Tt*re-(be-et*Gt-Tt*Gt-et*re),On=Rn*ht,J=P*Rn,et=J-(J-Rn),Tt=Rn-et,J=P*ht,Gt=J-(J-ht),re=ht-Gt,pr=Tt*re-(On-et*Gt-Tt*Gt-et*re),ie=Ae-pr,Q=Ae-ie,H[0]=Ae-(ie+Q)+(Q-pr),Se=be+ie,Q=Se-be,ye=be-(Se-Q)+(ie-Q),ie=ye-On,Q=ye-ie,H[1]=ye-(ie+Q)+(Q-On),_n=Se+ie,Q=_n-Se,H[2]=Se-(_n-Q)+(ie-Q),H[3]=_n;let q=L(Sr,vt,4,H,it);be=tt*O,J=P*tt,et=J-(J-tt),Tt=tt-et,J=P*O,Gt=J-(J-O),re=O-Gt,Ae=Tt*re-(be-et*Gt-Tt*Gt-et*re),On=pt*ht,J=P*pt,et=J-(J-pt),Tt=pt-et,J=P*ht,Gt=J-(J-ht),re=ht-Gt,pr=Tt*re-(On-et*Gt-Tt*Gt-et*re),ie=Ae-pr,Q=Ae-ie,H[0]=Ae-(ie+Q)+(Q-pr),Se=be+ie,Q=Se-be,ye=be-(Se-Q)+(ie-Q),ie=ye-On,Q=ye-ie,H[1]=ye-(ie+Q)+(Q-On),_n=Se+ie,Q=_n-Se,H[2]=Se-(_n-Q)+(ie-Q),H[3]=_n;let st=L(q,it,4,H,lt);return lt[st-1]}function It(j,b,I,F,k,G){let rt=(b-G)*(I-k),tt=(j-k)*(F-G),pt=rt-tt,ht=Math.abs(rt+tt);return Math.abs(pt)>=Mt*ht?pt:-At(j,b,I,F,k,G,ht)}let jt=(j,b)=>j.x*b.y-j.y*b.x,nt=(j,b)=>j.x*b.x+j.y*b.y,bt=(j,b,I)=>{let F=It(j.x,j.y,b.x,b.y,I.x,I.y);return F>0?-1:F<0?1:0},qt=j=>Math.sqrt(nt(j,j)),$t=(j,b,I)=>{let F={x:b.x-j.x,y:b.y-j.y},k={x:I.x-j.x,y:I.y-j.y};return jt(k,F)/qt(k)/qt(F)},Ft=(j,b,I)=>{let F={x:b.x-j.x,y:b.y-j.y},k={x:I.x-j.x,y:I.y-j.y};return nt(k,F)/qt(k)/qt(F)},zt=(j,b,I)=>b.y===0?null:{x:j.x+b.x/b.y*(I-j.y),y:I},Ct=(j,b,I)=>b.x===0?null:{x:I,y:j.y+b.y/b.x*(I-j.x)},te=(j,b,I,F)=>{if(b.x===0)return Ct(I,F,j.x);if(F.x===0)return Ct(j,b,I.x);if(b.y===0)return zt(I,F,j.y);if(F.y===0)return zt(j,b,I.y);let k=jt(b,F);if(k==0)return null;let G={x:I.x-j.x,y:I.y-j.y},rt=jt(G,b)/k,tt=jt(G,F)/k,pt=j.x+tt*b.x,ht=I.x+rt*F.x,O=j.y+tt*b.y,Q=I.y+rt*F.y,J=(pt+ht)/2,et=(O+Q)/2;return{x:J,y:et}};class \${static compare(b,I){let F=$.comparePoints(b.point,I.point);return F!==0?F:(b.point!==I.point&&b.link(I),b.isLeft!==I.isLeft?b.isLeft?1:-1:_t.compare(b.segment,I.segment))}static comparePoints(b,I){return b.x<I.x?-1:b.x>I.x?1:b.y<I.y?-1:b.y>I.y?1:0}constructor(b,I){b.events===void 0?b.events=[this]:b.events.push(this),this.point=b,this.isLeft=I}link(b){if(b.point===this.point)throw new Error("Tried to link already linked events");let I=b.point.events;for(let F=0,k=I.length;F<k;F++){let G=I[F];this.point.events.push(G),G.point=this.point}this.checkForConsuming()}checkForConsuming(){let b=this.point.events.length;for(let I=0;I<b;I++){let F=this.point.events[I];if(F.segment.consumedBy===void 0)for(let k=I+1;k<b;k++){let G=this.point.events[k];G.consumedBy===void 0&&F.otherSE.point.events===G.otherSE.point.events&&F.segment.consume(G.segment)}}}getAvailableLinkedEvents(){let b=[];for(let I=0,F=this.point.events.length;I<F;I++){let k=this.point.events[I];k!==this&&!k.segment.ringOut&&k.segment.isInResult()&&b.push(k)}return b}getLeftmostComparator(b){let I=new Map,F=k=>{let G=k.otherSE;I.set(k,{sine:$t(this.point,b.point,G.point),cosine:Ft(this.point,b.point,G.point)})};return(k,G)=>{I.has(k)||F(k),I.has(G)||F(G);let{sine:rt,cosine:tt}=I.get(k),{sine:pt,cosine:ht}=I.get(G);return rt>=0&&pt>=0?tt<ht?1:tt>ht?-1:0:rt<0&&pt<0?tt<ht?-1:tt>ht?1:0:pt<rt?-1:pt>rt?1:0}}}let Ot=0;class _t{static compare(b,I){let F=b.leftSE.point.x,k=I.leftSE.point.x,G=b.rightSE.point.x,rt=I.rightSE.point.x;if(rt<F)return 1;if(G<k)return-1;let tt=b.leftSE.point.y,pt=I.leftSE.point.y,ht=b.rightSE.point.y,O=I.rightSE.point.y;if(F<k){if(pt<tt&&pt<ht)return 1;if(pt>tt&&pt>ht)return-1;let Q=b.comparePoint(I.leftSE.point);if(Q<0)return 1;if(Q>0)return-1;let J=I.comparePoint(b.rightSE.point);return J!==0?J:-1}if(F>k){if(tt<pt&&tt<O)return-1;if(tt>pt&&tt>O)return 1;let Q=I.comparePoint(b.leftSE.point);if(Q!==0)return Q;let J=b.comparePoint(I.rightSE.point);return J<0?1:J>0?-1:1}if(tt<pt)return-1;if(tt>pt)return 1;if(G<rt){let Q=I.comparePoint(b.rightSE.point);if(Q!==0)return Q}if(G>rt){let Q=b.comparePoint(I.rightSE.point);if(Q<0)return 1;if(Q>0)return-1}if(G!==rt){let Q=ht-tt,J=G-F,et=O-pt,Tt=rt-k;if(Q>J&&et<Tt)return 1;if(Q<J&&et>Tt)return-1}return G>rt?1:G<rt||ht<O?-1:ht>O?1:b.id<I.id?-1:b.id>I.id?1:0}constructor(b,I,F,k){this.id=++Ot,this.leftSE=b,b.segment=this,b.otherSE=I,this.rightSE=I,I.segment=this,I.otherSE=b,this.rings=F,this.windings=k}static fromRing(b,I,F){let k,G,rt,tt=$.comparePoints(b,I);if(tt<0)k=b,G=I,rt=1;else if(tt>0)k=I,G=b,rt=-1;else throw new Error(\`Tried to create degenerate segment at [\${b.x}, \${b.y}]\`);let pt=new $(k,!0),ht=new $(G,!1);return new _t(pt,ht,[F],[rt])}replaceRightSE(b){this.rightSE=b,this.rightSE.segment=this,this.rightSE.otherSE=this.leftSE,this.leftSE.otherSE=this.rightSE}bbox(){let b=this.leftSE.point.y,I=this.rightSE.point.y;return{ll:{x:this.leftSE.point.x,y:b<I?b:I},ur:{x:this.rightSE.point.x,y:b>I?b:I}}}vector(){return{x:this.rightSE.point.x-this.leftSE.point.x,y:this.rightSE.point.y-this.leftSE.point.y}}isAnEndpoint(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}comparePoint(b){if(this.isAnEndpoint(b))return 0;let I=this.leftSE.point,F=this.rightSE.point,k=this.vector();if(I.x===F.x)return b.x===I.x?0:b.x<I.x?1:-1;let G=(b.y-I.y)/k.y,rt=I.x+G*k.x;if(b.x===rt)return 0;let tt=(b.x-I.x)/k.x,pt=I.y+tt*k.y;return b.y===pt?0:b.y<pt?-1:1}getIntersection(b){let I=this.bbox(),F=b.bbox(),k=_(I,F);if(k===null)return null;let G=this.leftSE.point,rt=this.rightSE.point,tt=b.leftSE.point,pt=b.rightSE.point,ht=A(I,tt)&&this.comparePoint(tt)===0,O=A(F,G)&&b.comparePoint(G)===0,Q=A(I,pt)&&this.comparePoint(pt)===0,J=A(F,rt)&&b.comparePoint(rt)===0;if(O&&ht)return J&&!Q?rt:!J&&Q?pt:null;if(O)return Q&&G.x===pt.x&&G.y===pt.y?null:G;if(ht)return J&&rt.x===tt.x&&rt.y===tt.y?null:tt;if(J&&Q)return null;if(J)return rt;if(Q)return pt;let et=te(G,this.vector(),tt,b.vector());return et===null||!A(k,et)?null:U.round(et.x,et.y)}split(b){let I=[],F=b.events!==void 0,k=new $(b,!0),G=new $(b,!1),rt=this.rightSE;this.replaceRightSE(G),I.push(G),I.push(k);let tt=new _t(k,rt,this.rings.slice(),this.windings.slice());return $.comparePoints(tt.leftSE.point,tt.rightSE.point)>0&&tt.swapEvents(),$.comparePoints(this.leftSE.point,this.rightSE.point)>0&&this.swapEvents(),F&&(k.checkForConsuming(),G.checkForConsuming()),I}swapEvents(){let b=this.rightSE;this.rightSE=this.leftSE,this.leftSE=b,this.leftSE.isLeft=!0,this.rightSE.isLeft=!1;for(let I=0,F=this.windings.length;I<F;I++)this.windings[I]*=-1}consume(b){let I=this,F=b;for(;I.consumedBy;)I=I.consumedBy;for(;F.consumedBy;)F=F.consumedBy;let k=_t.compare(I,F);if(k!==0){if(k>0){let G=I;I=F,F=G}if(I.prev===F){let G=I;I=F,F=G}for(let G=0,rt=F.rings.length;G<rt;G++){let tt=F.rings[G],pt=F.windings[G],ht=I.rings.indexOf(tt);ht===-1?(I.rings.push(tt),I.windings.push(pt)):I.windings[ht]+=pt}F.rings=null,F.windings=null,F.consumedBy=I,F.leftSE.consumedBy=I.leftSE,F.rightSE.consumedBy=I.rightSE}}prevInResult(){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)}beforeState(){if(this._beforeState!==void 0)return this._beforeState;if(!this.prev)this._beforeState={rings:[],windings:[],multiPolys:[]};else{let b=this.prev.consumedBy||this.prev;this._beforeState=b.afterState()}return this._beforeState}afterState(){if(this._afterState!==void 0)return this._afterState;let b=this.beforeState();this._afterState={rings:b.rings.slice(0),windings:b.windings.slice(0),multiPolys:[]};let I=this._afterState.rings,F=this._afterState.windings,k=this._afterState.multiPolys;for(let tt=0,pt=this.rings.length;tt<pt;tt++){let ht=this.rings[tt],O=this.windings[tt],Q=I.indexOf(ht);Q===-1?(I.push(ht),F.push(O)):F[Q]+=O}let G=[],rt=[];for(let tt=0,pt=I.length;tt<pt;tt++){if(F[tt]===0)continue;let ht=I[tt],O=ht.poly;if(rt.indexOf(O)===-1)if(ht.isExterior)G.push(O);else{rt.indexOf(O)===-1&&rt.push(O);let Q=G.indexOf(ht.poly);Q!==-1&&G.splice(Q,1)}}for(let tt=0,pt=G.length;tt<pt;tt++){let ht=G[tt].multiPoly;k.indexOf(ht)===-1&&k.push(ht)}return this._afterState}isInResult(){if(this.consumedBy)return!1;if(this._isInResult!==void 0)return this._isInResult;let b=this.beforeState().multiPolys,I=this.afterState().multiPolys;switch(ot.type){case"union":{let F=b.length===0,k=I.length===0;this._isInResult=F!==k;break}case"intersection":{let F,k;b.length<I.length?(F=b.length,k=I.length):(F=I.length,k=b.length),this._isInResult=k===ot.numMultiPolys&&F<k;break}case"xor":{let F=Math.abs(b.length-I.length);this._isInResult=F%2===1;break}case"difference":{let F=k=>k.length===1&&k[0].isSubject;this._isInResult=F(b)!==F(I);break}default:throw new Error(\`Unrecognized operation type found \${ot.type}\`)}return this._isInResult}}class Nt{constructor(b,I,F){if(!Array.isArray(b)||b.length===0)throw new Error("Input geometry is not a valid Polygon or MultiPolygon");if(this.poly=I,this.isExterior=F,this.segments=[],typeof b[0][0]!="number"||typeof b[0][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");let k=U.round(b[0][0],b[0][1]);this.bbox={ll:{x:k.x,y:k.y},ur:{x:k.x,y:k.y}};let G=k;for(let rt=1,tt=b.length;rt<tt;rt++){if(typeof b[rt][0]!="number"||typeof b[rt][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");let pt=U.round(b[rt][0],b[rt][1]);pt.x===G.x&&pt.y===G.y||(this.segments.push(_t.fromRing(G,pt,this)),pt.x<this.bbox.ll.x&&(this.bbox.ll.x=pt.x),pt.y<this.bbox.ll.y&&(this.bbox.ll.y=pt.y),pt.x>this.bbox.ur.x&&(this.bbox.ur.x=pt.x),pt.y>this.bbox.ur.y&&(this.bbox.ur.y=pt.y),G=pt)}(k.x!==G.x||k.y!==G.y)&&this.segments.push(_t.fromRing(G,k,this))}getSweepEvents(){let b=[];for(let I=0,F=this.segments.length;I<F;I++){let k=this.segments[I];b.push(k.leftSE),b.push(k.rightSE)}return b}}class St{constructor(b,I){if(!Array.isArray(b))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");this.exteriorRing=new Nt(b[0],this,!0),this.bbox={ll:{x:this.exteriorRing.bbox.ll.x,y:this.exteriorRing.bbox.ll.y},ur:{x:this.exteriorRing.bbox.ur.x,y:this.exteriorRing.bbox.ur.y}},this.interiorRings=[];for(let F=1,k=b.length;F<k;F++){let G=new Nt(b[F],this,!1);G.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=G.bbox.ll.x),G.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=G.bbox.ll.y),G.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=G.bbox.ur.x),G.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=G.bbox.ur.y),this.interiorRings.push(G)}this.multiPoly=I}getSweepEvents(){let b=this.exteriorRing.getSweepEvents();for(let I=0,F=this.interiorRings.length;I<F;I++){let k=this.interiorRings[I].getSweepEvents();for(let G=0,rt=k.length;G<rt;G++)b.push(k[G])}return b}}class Vt{constructor(b,I){if(!Array.isArray(b))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");try{typeof b[0][0][0]=="number"&&(b=[b])}catch(F){}this.polys=[],this.bbox={ll:{x:Number.POSITIVE_INFINITY,y:Number.POSITIVE_INFINITY},ur:{x:Number.NEGATIVE_INFINITY,y:Number.NEGATIVE_INFINITY}};for(let F=0,k=b.length;F<k;F++){let G=new St(b[F],this);G.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=G.bbox.ll.x),G.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=G.bbox.ll.y),G.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=G.bbox.ur.x),G.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=G.bbox.ur.y),this.polys.push(G)}this.isSubject=I}getSweepEvents(){let b=[];for(let I=0,F=this.polys.length;I<F;I++){let k=this.polys[I].getSweepEvents();for(let G=0,rt=k.length;G<rt;G++)b.push(k[G])}return b}}class Xt{static factory(b){let I=[];for(let F=0,k=b.length;F<k;F++){let G=b[F];if(!G.isInResult()||G.ringOut)continue;let rt=null,tt=G.leftSE,pt=G.rightSE,ht=[tt],O=tt.point,Q=[];for(;rt=tt,tt=pt,ht.push(tt),tt.point!==O;)for(;;){let J=tt.getAvailableLinkedEvents();if(J.length===0){let Gt=ht[0].point,re=ht[ht.length-1].point;throw new Error(\`Unable to complete output ring starting at [\${Gt.x}, \${Gt.y}]. Last matching segment found ends at [\${re.x}, \${re.y}].\`)}if(J.length===1){pt=J[0].otherSE;break}let et=null;for(let Gt=0,re=Q.length;Gt<re;Gt++)if(Q[Gt].point===tt.point){et=Gt;break}if(et!==null){let Gt=Q.splice(et)[0],re=ht.splice(Gt.index);re.unshift(re[0].otherSE),I.push(new Xt(re.reverse()));continue}Q.push({index:ht.length,point:tt.point});let Tt=tt.getLeftmostComparator(rt);pt=J.sort(Tt)[0].otherSE;break}I.push(new Xt(ht))}return I}constructor(b){this.events=b;for(let I=0,F=b.length;I<F;I++)b[I].segment.ringOut=this;this.poly=null}getGeom(){let b=this.events[0].point,I=[b];for(let ht=1,O=this.events.length-1;ht<O;ht++){let Q=this.events[ht].point,J=this.events[ht+1].point;bt(Q,b,J)!==0&&(I.push(Q),b=Q)}if(I.length===1)return null;let F=I[0],k=I[1];bt(F,b,k)===0&&I.shift(),I.push(I[0]);let G=this.isExteriorRing()?1:-1,rt=this.isExteriorRing()?0:I.length-1,tt=this.isExteriorRing()?I.length:-1,pt=[];for(let ht=rt;ht!=tt;ht+=G)pt.push([I[ht].x,I[ht].y]);return pt}isExteriorRing(){if(this._isExteriorRing===void 0){let b=this.enclosingRing();this._isExteriorRing=b?!b.isExteriorRing():!0}return this._isExteriorRing}enclosingRing(){return this._enclosingRing===void 0&&(this._enclosingRing=this._calcEnclosingRing()),this._enclosingRing}_calcEnclosingRing(){let b=this.events[0];for(let k=1,G=this.events.length;k<G;k++){let rt=this.events[k];$.compare(b,rt)>0&&(b=rt)}let I=b.segment.prevInResult(),F=I?I.prevInResult():null;for(;;){if(!I)return null;if(!F)return I.ringOut;if(F.ringOut!==I.ringOut)return F.ringOut.enclosingRing()!==I.ringOut?I.ringOut:I.ringOut.enclosingRing();I=F.prevInResult(),F=I?I.prevInResult():null}}}class Pt{constructor(b){this.exteriorRing=b,b.poly=this,this.interiorRings=[]}addInterior(b){this.interiorRings.push(b),b.poly=this}getGeom(){let b=[this.exteriorRing.getGeom()];if(b[0]===null)return null;for(let I=0,F=this.interiorRings.length;I<F;I++){let k=this.interiorRings[I].getGeom();k!==null&&b.push(k)}return b}}class ee{constructor(b){this.rings=b,this.polys=this._composePolys(b)}getGeom(){let b=[];for(let I=0,F=this.polys.length;I<F;I++){let k=this.polys[I].getGeom();k!==null&&b.push(k)}return b}_composePolys(b){let I=[];for(let F=0,k=b.length;F<k;F++){let G=b[F];if(!G.poly)if(G.isExteriorRing())I.push(new Pt(G));else{let rt=G.enclosingRing();rt.poly||I.push(new Pt(rt)),rt.poly.addInterior(G)}}return I}}class X{constructor(b){let I=arguments.length>1&&arguments[1]!==void 0?arguments[1]:_t.compare;this.queue=b,this.tree=new p(I),this.segments=[]}process(b){let I=b.segment,F=[];if(b.consumedBy)return b.isLeft?this.queue.remove(b.otherSE):this.tree.remove(I),F;let k=b.isLeft?this.tree.add(I):this.tree.find(I);if(!k)throw new Error(\`Unable to find segment #\${I.id} [\${I.leftSE.point.x}, \${I.leftSE.point.y}] -> [\${I.rightSE.point.x}, \${I.rightSE.point.y}] in SweepLine tree.\`);let G=k,rt=k,tt,pt;for(;tt===void 0;)G=this.tree.prev(G),G===null?tt=null:G.key.consumedBy===void 0&&(tt=G.key);for(;pt===void 0;)rt=this.tree.next(rt),rt===null?pt=null:rt.key.consumedBy===void 0&&(pt=rt.key);if(b.isLeft){let ht=null;if(tt){let Q=tt.getIntersection(I);if(Q!==null&&(I.isAnEndpoint(Q)||(ht=Q),!tt.isAnEndpoint(Q))){let J=this._splitSafely(tt,Q);for(let et=0,Tt=J.length;et<Tt;et++)F.push(J[et])}}let O=null;if(pt){let Q=pt.getIntersection(I);if(Q!==null&&(I.isAnEndpoint(Q)||(O=Q),!pt.isAnEndpoint(Q))){let J=this._splitSafely(pt,Q);for(let et=0,Tt=J.length;et<Tt;et++)F.push(J[et])}}if(ht!==null||O!==null){let Q=null;ht===null?Q=O:O===null?Q=ht:Q=$.comparePoints(ht,O)<=0?ht:O,this.queue.remove(I.rightSE),F.push(I.rightSE);let J=I.split(Q);for(let et=0,Tt=J.length;et<Tt;et++)F.push(J[et])}F.length>0?(this.tree.remove(I),F.push(b)):(this.segments.push(I),I.prev=tt)}else{if(tt&&pt){let ht=tt.getIntersection(pt);if(ht!==null){if(!tt.isAnEndpoint(ht)){let O=this._splitSafely(tt,ht);for(let Q=0,J=O.length;Q<J;Q++)F.push(O[Q])}if(!pt.isAnEndpoint(ht)){let O=this._splitSafely(pt,ht);for(let Q=0,J=O.length;Q<J;Q++)F.push(O[Q])}}}this.tree.remove(I)}return F}_splitSafely(b,I){this.tree.remove(b);let F=b.rightSE;this.queue.remove(F);let k=b.split(I);return k.push(F),b.consumedBy===void 0&&this.tree.add(b),k}}let N=typeof process!="undefined"&&process.env.POLYGON_CLIPPING_MAX_QUEUE_SIZE||1e6,xt=typeof process!="undefined"&&process.env.POLYGON_CLIPPING_MAX_SWEEPLINE_SEGMENTS||1e6;class wt{run(b,I,F){ot.type=b,U.reset();let k=[new Vt(I,!0)];for(let Q=0,J=F.length;Q<J;Q++)k.push(new Vt(F[Q],!1));if(ot.numMultiPolys=k.length,ot.type==="difference"){let Q=k[0],J=1;for(;J<k.length;)_(k[J].bbox,Q.bbox)!==null?J++:k.splice(J,1)}if(ot.type==="intersection")for(let Q=0,J=k.length;Q<J;Q++){let et=k[Q];for(let Tt=Q+1,Gt=k.length;Tt<Gt;Tt++)if(_(et.bbox,k[Tt].bbox)===null)return[]}let G=new p($.compare);for(let Q=0,J=k.length;Q<J;Q++){let et=k[Q].getSweepEvents();for(let Tt=0,Gt=et.length;Tt<Gt;Tt++)if(G.insert(et[Tt]),G.size>N)throw new Error("Infinite loop when putting segment endpoints in a priority queue (queue size too big).")}let rt=new X(G),tt=G.size,pt=G.pop();for(;pt;){let Q=pt.key;if(G.size===tt){let et=Q.segment;throw new Error(\`Unable to pop() \${Q.isLeft?"left":"right"} SweepEvent [\${Q.point.x}, \${Q.point.y}] from segment #\${et.id} [\${et.leftSE.point.x}, \${et.leftSE.point.y}] -> [\${et.rightSE.point.x}, \${et.rightSE.point.y}] from queue.\`)}if(G.size>N)throw new Error("Infinite loop when passing sweep line over endpoints (queue size too big).");if(rt.segments.length>xt)throw new Error("Infinite loop when passing sweep line over endpoints (too many sweep line segments).");let J=rt.process(Q);for(let et=0,Tt=J.length;et<Tt;et++){let Gt=J[et];Gt.consumedBy===void 0&&G.insert(Gt)}tt=G.size,pt=G.pop()}U.reset();let ht=Xt.factory(rt.segments);return new ee(ht).getGeom()}}let ot=new wt;var Wt={union:function(j){for(var b=arguments.length,I=new Array(b>1?b-1:0),F=1;F<b;F++)I[F-1]=arguments[F];return ot.run("union",j,I)},intersection:function(j){for(var b=arguments.length,I=new Array(b>1?b-1:0),F=1;F<b;F++)I[F-1]=arguments[F];return ot.run("intersection",j,I)},xor:function(j){for(var b=arguments.length,I=new Array(b>1?b-1:0),F=1;F<b;F++)I[F-1]=arguments[F];return ot.run("xor",j,I)},difference:function(j){for(var b=arguments.length,I=new Array(b>1?b-1:0),F=1;F<b;F++)I[F-1]=arguments[F];return ot.run("difference",j,I)}};return Wt})});var oN=Z((Nd,iN)=>{(function(n,t){typeof Nd=="object"&&typeof iN!="undefined"?t(Nd):typeof define=="function"&&define.amd?define(["exports"],t):t(n.jsts={})})(Nd,function(n){"use strict";function t(){}function e(r){this.message=r||""}function i(r){this.message=r||""}function s(r){this.message=r||""}function u(){}function c(r){return r===null?Ae:r.color}function f(r){return r===null?null:r.parent}function p(r,o){r!==null&&(r.color=o)}function d(r){return r===null?null:r.left}function m(r){return r===null?null:r.right}function y(){this.root_=null,this.size_=0}function v(){}function E(){this.array_=[],arguments[0]instanceof tt&&this.addAll(arguments[0])}function M(){}function A(r){this.message=r||""}function _(){this.array_=[]}"fill"in Array.prototype||Object.defineProperty(Array.prototype,"fill",{configurable:!0,value:function(r){if(this===void 0||this===null)throw new TypeError(this+" is not an object");var o=Object(this),a=Math.max(Math.min(o.length,9007199254740991),0)||0,l=1 in arguments&&parseInt(Number(arguments[1]),10)||0;l=l<0?Math.max(a+l,0):Math.min(l,a);var h=2 in arguments&&arguments[2]!==void 0?parseInt(Number(arguments[2]),10)||0:a;for(h=h<0?Math.max(a+arguments[2],0):Math.min(h,a);l<h;)o[l]=r,++l;return o},writable:!0}),Number.isFinite=Number.isFinite||function(r){return typeof r=="number"&&isFinite(r)},Number.isInteger=Number.isInteger||function(r){return typeof r=="number"&&isFinite(r)&&Math.floor(r)===r},Number.parseFloat=Number.parseFloat||parseFloat,Number.isNaN=Number.isNaN||function(r){return r!=r},Math.trunc=Math.trunc||function(r){return r<0?Math.ceil(r):Math.floor(r)};var x=function(){};x.prototype.interfaces_=function(){return[]},x.prototype.getClass=function(){return x},x.prototype.equalsWithTolerance=function(r,o,a){return Math.abs(r-o)<=a};var T=function(r){function o(a){r.call(this,a),this.name="IllegalArgumentException",this.message=a,this.stack=new r().stack}return r&&(o.__proto__=r),o.prototype=Object.create(r&&r.prototype),o.prototype.constructor=o,o}(Error),S=function(){},R={MAX_VALUE:{configurable:!0}};S.isNaN=function(r){return Number.isNaN(r)},S.doubleToLongBits=function(r){return r},S.longBitsToDouble=function(r){return r},S.isInfinite=function(r){return!Number.isFinite(r)},R.MAX_VALUE.get=function(){return Number.MAX_VALUE},Object.defineProperties(S,R);var z=function(){},U=function(){},D=function(){},P=function r(){if(this.x=null,this.y=null,this.z=null,arguments.length===0)this.x=0,this.y=0,this.z=r.NULL_ORDINATE;else if(arguments.length===1){var o=arguments[0];this.x=o.x,this.y=o.y,this.z=o.z}else arguments.length===2?(this.x=arguments[0],this.y=arguments[1],this.z=r.NULL_ORDINATE):arguments.length===3&&(this.x=arguments[0],this.y=arguments[1],this.z=arguments[2])},ct={DimensionalComparator:{configurable:!0},serialVersionUID:{configurable:!0},NULL_ORDINATE:{configurable:!0},X:{configurable:!0},Y:{configurable:!0},Z:{configurable:!0}};P.prototype.setOrdinate=function(r,o){switch(r){case P.X:this.x=o;break;case P.Y:this.y=o;break;case P.Z:this.z=o;break;default:throw new T("Invalid ordinate index: "+r)}},P.prototype.equals2D=function(){if(arguments.length===1){var r=arguments[0];return this.x===r.x&&this.y===r.y}if(arguments.length===2){var o=arguments[0],a=arguments[1];return!!x.equalsWithTolerance(this.x,o.x,a)&&!!x.equalsWithTolerance(this.y,o.y,a)}},P.prototype.getOrdinate=function(r){switch(r){case P.X:return this.x;case P.Y:return this.y;case P.Z:return this.z}throw new T("Invalid ordinate index: "+r)},P.prototype.equals3D=function(r){return this.x===r.x&&this.y===r.y&&(this.z===r.z||S.isNaN(this.z))&&S.isNaN(r.z)},P.prototype.equals=function(r){return r instanceof P&&this.equals2D(r)},P.prototype.equalInZ=function(r,o){return x.equalsWithTolerance(this.z,r.z,o)},P.prototype.compareTo=function(r){var o=r;return this.x<o.x?-1:this.x>o.x?1:this.y<o.y?-1:this.y>o.y?1:0},P.prototype.clone=function(){},P.prototype.copy=function(){return new P(this)},P.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},P.prototype.distance3D=function(r){var o=this.x-r.x,a=this.y-r.y,l=this.z-r.z;return Math.sqrt(o*o+a*a+l*l)},P.prototype.distance=function(r){var o=this.x-r.x,a=this.y-r.y;return Math.sqrt(o*o+a*a)},P.prototype.hashCode=function(){var r=17;return r=37*r+P.hashCode(this.x),r=37*r+P.hashCode(this.y)},P.prototype.setCoordinate=function(r){this.x=r.x,this.y=r.y,this.z=r.z},P.prototype.interfaces_=function(){return[z,U,t]},P.prototype.getClass=function(){return P},P.hashCode=function(){if(arguments.length===1){var r=arguments[0],o=S.doubleToLongBits(r);return Math.trunc((o^o)>>>32)}},ct.DimensionalComparator.get=function(){return L},ct.serialVersionUID.get=function(){return 6683108902428367e3},ct.NULL_ORDINATE.get=function(){return S.NaN},ct.X.get=function(){return 0},ct.Y.get=function(){return 1},ct.Z.get=function(){return 2},Object.defineProperties(P,ct);var L=function(r){if(this._dimensionsToTest=2,arguments.length!==0){if(arguments.length===1){var o=arguments[0];if(o!==2&&o!==3)throw new T("only 2 or 3 dimensions may be specified");this._dimensionsToTest=o}}};L.prototype.compare=function(r,o){var a=r,l=o,h=L.compare(a.x,l.x);if(h!==0)return h;var g=L.compare(a.y,l.y);return g!==0?g:this._dimensionsToTest<=2?0:L.compare(a.z,l.z)},L.prototype.interfaces_=function(){return[D]},L.prototype.getClass=function(){return L},L.compare=function(r,o){return r<o?-1:r>o?1:S.isNaN(r)?S.isNaN(o)?0:-1:S.isNaN(o)?1:0};var W=function(){};W.prototype.create=function(){},W.prototype.interfaces_=function(){return[]},W.prototype.getClass=function(){return W};var V=function(){},Mt={INTERIOR:{configurable:!0},BOUNDARY:{configurable:!0},EXTERIOR:{configurable:!0},NONE:{configurable:!0}};V.prototype.interfaces_=function(){return[]},V.prototype.getClass=function(){return V},V.toLocationSymbol=function(r){switch(r){case V.EXTERIOR:return"e";case V.BOUNDARY:return"b";case V.INTERIOR:return"i";case V.NONE:return"-"}throw new T("Unknown location value: "+r)},Mt.INTERIOR.get=function(){return 0},Mt.BOUNDARY.get=function(){return 1},Mt.EXTERIOR.get=function(){return 2},Mt.NONE.get=function(){return-1},Object.defineProperties(V,Mt);var Y=function(r,o){return r.interfaces_&&r.interfaces_().indexOf(o)>-1},mt=function(){},ft={LOG_10:{configurable:!0}};mt.prototype.interfaces_=function(){return[]},mt.prototype.getClass=function(){return mt},mt.log10=function(r){var o=Math.log(r);return S.isInfinite(o)||S.isNaN(o)?o:o/mt.LOG_10},mt.min=function(r,o,a,l){var h=r;return o<h&&(h=o),a<h&&(h=a),l<h&&(h=l),h},mt.clamp=function(){if(typeof arguments[2]=="number"&&typeof arguments[0]=="number"&&typeof arguments[1]=="number"){var r=arguments[0],o=arguments[1],a=arguments[2];return r<o?o:r>a?a:r}if(Number.isInteger(arguments[2])&&Number.isInteger(arguments[0])&&Number.isInteger(arguments[1])){var l=arguments[0],h=arguments[1],g=arguments[2];return l<h?h:l>g?g:l}},mt.wrap=function(r,o){return r<0?o- -r%o:r%o},mt.max=function(){if(arguments.length===3){var r=arguments[0],o=arguments[1],a=arguments[2],l=r;return o>l&&(l=o),a>l&&(l=a),l}if(arguments.length===4){var h=arguments[0],g=arguments[1],w=arguments[2],C=arguments[3],B=h;return g>B&&(B=g),w>B&&(B=w),C>B&&(B=C),B}},mt.average=function(r,o){return(r+o)/2},ft.LOG_10.get=function(){return Math.log(10)},Object.defineProperties(mt,ft);var vt=function(r){this.str=r};vt.prototype.append=function(r){this.str+=r},vt.prototype.setCharAt=function(r,o){this.str=this.str.substr(0,r)+o+this.str.substr(r+1)},vt.prototype.toString=function(r){return this.str};var it=function(r){this.value=r};it.prototype.intValue=function(){return this.value},it.prototype.compareTo=function(r){return this.value<r?-1:this.value>r?1:0},it.isNaN=function(r){return Number.isNaN(r)};var lt=function(){};lt.isWhitespace=function(r){return r<=32&&r>=0||r===127},lt.toUpperCase=function(r){return r.toUpperCase()};var H=function r(){if(this._hi=0,this._lo=0,arguments.length===0)this.init(0);else if(arguments.length===1){if(typeof arguments[0]=="number"){var o=arguments[0];this.init(o)}else if(arguments[0]instanceof r){var a=arguments[0];this.init(a)}else if(typeof arguments[0]=="string"){var l=arguments[0];r.call(this,r.parse(l))}}else if(arguments.length===2){var h=arguments[0],g=arguments[1];this.init(h,g)}},At={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}};H.prototype.le=function(r){return(this._hi<r._hi||this._hi===r._hi)&&this._lo<=r._lo},H.prototype.extractSignificantDigits=function(r,o){var a=this.abs(),l=H.magnitude(a._hi),h=H.TEN.pow(l);(a=a.divide(h)).gt(H.TEN)?(a=a.divide(H.TEN),l+=1):a.lt(H.ONE)&&(a=a.multiply(H.TEN),l-=1);for(var g=l+1,w=new vt,C=H.MAX_PRINT_DIGITS-1,B=0;B<=C;B++){r&&B===g&&w.append(".");var K=Math.trunc(a._hi);if(K<0)break;var gt=!1,yt=0;K>9?(gt=!0,yt="9"):yt="0"+K,w.append(yt),a=a.subtract(H.valueOf(K)).multiply(H.TEN),gt&&a.selfAdd(H.TEN);var Bt=!0,kt=H.magnitude(a._hi);if(kt<0&&Math.abs(kt)>=C-B&&(Bt=!1),!Bt)break}return o[0]=l,w.toString()},H.prototype.sqr=function(){return this.multiply(this)},H.prototype.doubleValue=function(){return this._hi+this._lo},H.prototype.subtract=function(){if(arguments[0]instanceof H){var r=arguments[0];return this.add(r.negate())}if(typeof arguments[0]=="number"){var o=arguments[0];return this.add(-o)}},H.prototype.equals=function(){if(arguments.length===1){var r=arguments[0];return this._hi===r._hi&&this._lo===r._lo}},H.prototype.isZero=function(){return this._hi===0&&this._lo===0},H.prototype.selfSubtract=function(){if(arguments[0]instanceof H){var r=arguments[0];return this.isNaN()?this:this.selfAdd(-r._hi,-r._lo)}if(typeof arguments[0]=="number"){var o=arguments[0];return this.isNaN()?this:this.selfAdd(-o,0)}},H.prototype.getSpecialNumberString=function(){return this.isZero()?"0.0":this.isNaN()?"NaN ":null},H.prototype.min=function(r){return this.le(r)?this:r},H.prototype.selfDivide=function(){if(arguments.length===1){if(arguments[0]instanceof H){var r=arguments[0];return this.selfDivide(r._hi,r._lo)}if(typeof arguments[0]=="number"){var o=arguments[0];return this.selfDivide(o,0)}}else if(arguments.length===2){var a=arguments[0],l=arguments[1],h=null,g=null,w=null,C=null,B=null,K=null,gt=null,yt=null;return B=this._hi/a,K=H.SPLIT*B,h=K-B,yt=H.SPLIT*a,h=K-h,g=B-h,w=yt-a,gt=B*a,w=yt-w,C=a-w,yt=h*w-gt+h*C+g*w+g*C,K=(this._hi-gt-yt+this._lo-B*l)/a,yt=B+K,this._hi=yt,this._lo=B-yt+K,this}},H.prototype.dump=function(){return"DD<"+this._hi+", "+this._lo+">"},H.prototype.divide=function(){if(arguments[0]instanceof H){var r=arguments[0],o=null,a=null,l=null,h=null,g=null,w=null,C=null,B=null;return a=(g=this._hi/r._hi)-(o=(w=H.SPLIT*g)-(o=w-g)),B=o*(l=(B=H.SPLIT*r._hi)-(l=B-r._hi))-(C=g*r._hi)+o*(h=r._hi-l)+a*l+a*h,w=(this._hi-C-B+this._lo-g*r._lo)/r._hi,new H(B=g+w,g-B+w)}if(typeof arguments[0]=="number"){var K=arguments[0];return S.isNaN(K)?H.createNaN():H.copy(this).selfDivide(K,0)}},H.prototype.ge=function(r){return(this._hi>r._hi||this._hi===r._hi)&&this._lo>=r._lo},H.prototype.pow=function(r){if(r===0)return H.valueOf(1);var o=new H(this),a=H.valueOf(1),l=Math.abs(r);if(l>1)for(;l>0;)l%2==1&&a.selfMultiply(o),(l/=2)>0&&(o=o.sqr());else a=o;return r<0?a.reciprocal():a},H.prototype.ceil=function(){if(this.isNaN())return H.NaN;var r=Math.ceil(this._hi),o=0;return r===this._hi&&(o=Math.ceil(this._lo)),new H(r,o)},H.prototype.compareTo=function(r){var o=r;return this._hi<o._hi?-1:this._hi>o._hi?1:this._lo<o._lo?-1:this._lo>o._lo?1:0},H.prototype.rint=function(){return this.isNaN()?this:this.add(.5).floor()},H.prototype.setValue=function(){if(arguments[0]instanceof H){var r=arguments[0];return this.init(r),this}if(typeof arguments[0]=="number"){var o=arguments[0];return this.init(o),this}},H.prototype.max=function(r){return this.ge(r)?this:r},H.prototype.sqrt=function(){if(this.isZero())return H.valueOf(0);if(this.isNegative())return H.NaN;var r=1/Math.sqrt(this._hi),o=this._hi*r,a=H.valueOf(o),l=this.subtract(a.sqr())._hi*(.5*r);return a.add(l)},H.prototype.selfAdd=function(){if(arguments.length===1){if(arguments[0]instanceof H){var r=arguments[0];return this.selfAdd(r._hi,r._lo)}if(typeof arguments[0]=="number"){var o=arguments[0],a=null,l=null,h=null,g=null,w=null,C=null;return h=this._hi+o,w=h-this._hi,g=h-w,g=o-w+(this._hi-g),C=g+this._lo,a=h+C,l=C+(h-a),this._hi=a+l,this._lo=l+(a-this._hi),this}}else if(arguments.length===2){var B=arguments[0],K=arguments[1],gt=null,yt=null,Bt=null,kt=null,Jt=null,ae=null,dn=null;kt=this._hi+B,yt=this._lo+K,Jt=kt-(ae=kt-this._hi),Bt=yt-(dn=yt-this._lo);var Wn=(gt=kt+(ae=(Jt=B-ae+(this._hi-Jt))+yt))+(ae=(Bt=K-dn+(this._lo-Bt))+(ae+(kt-gt))),Lr=ae+(gt-Wn);return this._hi=Wn,this._lo=Lr,this}},H.prototype.selfMultiply=function(){if(arguments.length===1){if(arguments[0]instanceof H){var r=arguments[0];return this.selfMultiply(r._hi,r._lo)}if(typeof arguments[0]=="number"){var o=arguments[0];return this.selfMultiply(o,0)}}else if(arguments.length===2){var a=arguments[0],l=arguments[1],h=null,g=null,w=null,C=null,B=null,K=null;h=(B=H.SPLIT*this._hi)-this._hi,K=H.SPLIT*a,h=B-h,g=this._hi-h,w=K-a;var gt=(B=this._hi*a)+(K=h*(w=K-w)-B+h*(C=a-w)+g*w+g*C+(this._hi*l+this._lo*a)),yt=K+(h=B-gt);return this._hi=gt,this._lo=yt,this}},H.prototype.selfSqr=function(){return this.selfMultiply(this)},H.prototype.floor=function(){if(this.isNaN())return H.NaN;var r=Math.floor(this._hi),o=0;return r===this._hi&&(o=Math.floor(this._lo)),new H(r,o)},H.prototype.negate=function(){return this.isNaN()?this:new H(-this._hi,-this._lo)},H.prototype.clone=function(){},H.prototype.multiply=function(){if(arguments[0]instanceof H){var r=arguments[0];return r.isNaN()?H.createNaN():H.copy(this).selfMultiply(r)}if(typeof arguments[0]=="number"){var o=arguments[0];return S.isNaN(o)?H.createNaN():H.copy(this).selfMultiply(o,0)}},H.prototype.isNaN=function(){return S.isNaN(this._hi)},H.prototype.intValue=function(){return Math.trunc(this._hi)},H.prototype.toString=function(){var r=H.magnitude(this._hi);return r>=-3&&r<=20?this.toStandardNotation():this.toSciNotation()},H.prototype.toStandardNotation=function(){var r=this.getSpecialNumberString();if(r!==null)return r;var o=new Array(1).fill(null),a=this.extractSignificantDigits(!0,o),l=o[0]+1,h=a;if(a.charAt(0)===".")h="0"+a;else if(l<0)h="0."+H.stringOfChar("0",-l)+a;else if(a.indexOf(".")===-1){var g=l-a.length;h=a+H.stringOfChar("0",g)+".0"}return this.isNegative()?"-"+h:h},H.prototype.reciprocal=function(){var r=null,o=null,a=null,l=null,h=null,g=null,w=null,C=null;o=(h=1/this._hi)-(r=(g=H.SPLIT*h)-(r=g-h)),a=(C=H.SPLIT*this._hi)-this._hi;var B=h+(g=(1-(w=h*this._hi)-(C=r*(a=C-a)-w+r*(l=this._hi-a)+o*a+o*l)-h*this._lo)/this._hi);return new H(B,h-B+g)},H.prototype.toSciNotation=function(){if(this.isZero())return H.SCI_NOT_ZERO;var r=this.getSpecialNumberString();if(r!==null)return r;var o=new Array(1).fill(null),a=this.extractSignificantDigits(!1,o),l=H.SCI_NOT_EXPONENT_CHAR+o[0];if(a.charAt(0)==="0")throw new Error("Found leading zero: "+a);var h="";a.length>1&&(h=a.substring(1));var g=a.charAt(0)+"."+h;return this.isNegative()?"-"+g+l:g+l},H.prototype.abs=function(){return this.isNaN()?H.NaN:this.isNegative()?this.negate():new H(this)},H.prototype.isPositive=function(){return(this._hi>0||this._hi===0)&&this._lo>0},H.prototype.lt=function(r){return(this._hi<r._hi||this._hi===r._hi)&&this._lo<r._lo},H.prototype.add=function(){if(arguments[0]instanceof H){var r=arguments[0];return H.copy(this).selfAdd(r)}if(typeof arguments[0]=="number"){var o=arguments[0];return H.copy(this).selfAdd(o)}},H.prototype.init=function(){if(arguments.length===1){if(typeof arguments[0]=="number"){var r=arguments[0];this._hi=r,this._lo=0}else if(arguments[0]instanceof H){var o=arguments[0];this._hi=o._hi,this._lo=o._lo}}else if(arguments.length===2){var a=arguments[0],l=arguments[1];this._hi=a,this._lo=l}},H.prototype.gt=function(r){return(this._hi>r._hi||this._hi===r._hi)&&this._lo>r._lo},H.prototype.isNegative=function(){return(this._hi<0||this._hi===0)&&this._lo<0},H.prototype.trunc=function(){return this.isNaN()?H.NaN:this.isPositive()?this.floor():this.ceil()},H.prototype.signum=function(){return this._hi>0?1:this._hi<0?-1:this._lo>0?1:this._lo<0?-1:0},H.prototype.interfaces_=function(){return[t,z,U]},H.prototype.getClass=function(){return H},H.sqr=function(r){return H.valueOf(r).selfMultiply(r)},H.valueOf=function(){if(typeof arguments[0]=="string"){var r=arguments[0];return H.parse(r)}if(typeof arguments[0]=="number"){var o=arguments[0];return new H(o)}},H.sqrt=function(r){return H.valueOf(r).sqrt()},H.parse=function(r){for(var o=0,a=r.length;lt.isWhitespace(r.charAt(o));)o++;var l=!1;if(o<a){var h=r.charAt(o);h!=="-"&&h!=="+"||(o++,h==="-"&&(l=!0))}for(var g=new H,w=0,C=0,B=0;!(o>=a);){var K=r.charAt(o);if(o++,lt.isDigit(K)){var gt=K-"0";g.selfMultiply(H.TEN),g.selfAdd(gt),w++}else{if(K!=="."){if(K==="e"||K==="E"){var yt=r.substring(o);try{B=it.parseInt(yt)}catch(dn){throw dn instanceof Error?new Error("Invalid exponent "+yt+" in string "+r):dn}break}throw new Error("Unexpected character '"+K+"' at position "+o+" in string "+r)}C=w}}var Bt=g,kt=w-C-B;if(kt===0)Bt=g;else if(kt>0){var Jt=H.TEN.pow(kt);Bt=g.divide(Jt)}else if(kt<0){var ae=H.TEN.pow(-kt);Bt=g.multiply(ae)}return l?Bt.negate():Bt},H.createNaN=function(){return new H(S.NaN,S.NaN)},H.copy=function(r){return new H(r)},H.magnitude=function(r){var o=Math.abs(r),a=Math.log(o)/Math.log(10),l=Math.trunc(Math.floor(a));return 10*Math.pow(10,l)<=o&&(l+=1),l},H.stringOfChar=function(r,o){for(var a=new vt,l=0;l<o;l++)a.append(r);return a.toString()},At.PI.get=function(){return new H(3.141592653589793,12246467991473532e-32)},At.TWO_PI.get=function(){return new H(6.283185307179586,24492935982947064e-32)},At.PI_2.get=function(){return new H(1.5707963267948966,6123233995736766e-32)},At.E.get=function(){return new H(2.718281828459045,14456468917292502e-32)},At.NaN.get=function(){return new H(S.NaN,S.NaN)},At.EPS.get=function(){return 123259516440783e-46},At.SPLIT.get=function(){return 134217729},At.MAX_PRINT_DIGITS.get=function(){return 32},At.TEN.get=function(){return H.valueOf(10)},At.ONE.get=function(){return H.valueOf(1)},At.SCI_NOT_EXPONENT_CHAR.get=function(){return"E"},At.SCI_NOT_ZERO.get=function(){return"0.0E0"},Object.defineProperties(H,At);var It=function(){},jt={DP_SAFE_EPSILON:{configurable:!0}};It.prototype.interfaces_=function(){return[]},It.prototype.getClass=function(){return It},It.orientationIndex=function(r,o,a){var l=It.orientationIndexFilter(r,o,a);if(l<=1)return l;var h=H.valueOf(o.x).selfAdd(-r.x),g=H.valueOf(o.y).selfAdd(-r.y),w=H.valueOf(a.x).selfAdd(-o.x),C=H.valueOf(a.y).selfAdd(-o.y);return h.selfMultiply(C).selfSubtract(g.selfMultiply(w)).signum()},It.signOfDet2x2=function(r,o,a,l){return r.multiply(l).selfSubtract(o.multiply(a)).signum()},It.intersection=function(r,o,a,l){var h=H.valueOf(l.y).selfSubtract(a.y).selfMultiply(H.valueOf(o.x).selfSubtract(r.x)),g=H.valueOf(l.x).selfSubtract(a.x).selfMultiply(H.valueOf(o.y).selfSubtract(r.y)),w=h.subtract(g),C=H.valueOf(l.x).selfSubtract(a.x).selfMultiply(H.valueOf(r.y).selfSubtract(a.y)),B=H.valueOf(l.y).selfSubtract(a.y).selfMultiply(H.valueOf(r.x).selfSubtract(a.x)),K=C.subtract(B).selfDivide(w).doubleValue(),gt=H.valueOf(r.x).selfAdd(H.valueOf(o.x).selfSubtract(r.x).selfMultiply(K)).doubleValue(),yt=H.valueOf(o.x).selfSubtract(r.x).selfMultiply(H.valueOf(r.y).selfSubtract(a.y)),Bt=H.valueOf(o.y).selfSubtract(r.y).selfMultiply(H.valueOf(r.x).selfSubtract(a.x)),kt=yt.subtract(Bt).selfDivide(w).doubleValue(),Jt=H.valueOf(a.y).selfAdd(H.valueOf(l.y).selfSubtract(a.y).selfMultiply(kt)).doubleValue();return new P(gt,Jt)},It.orientationIndexFilter=function(r,o,a){var l=null,h=(r.x-a.x)*(o.y-a.y),g=(r.y-a.y)*(o.x-a.x),w=h-g;if(h>0){if(g<=0)return It.signum(w);l=h+g}else{if(!(h<0)||g>=0)return It.signum(w);l=-h-g}var C=It.DP_SAFE_EPSILON*l;return w>=C||-w>=C?It.signum(w):2},It.signum=function(r){return r>0?1:r<0?-1:0},jt.DP_SAFE_EPSILON.get=function(){return 1e-15},Object.defineProperties(It,jt);var nt=function(){},bt={X:{configurable:!0},Y:{configurable:!0},Z:{configurable:!0},M:{configurable:!0}};bt.X.get=function(){return 0},bt.Y.get=function(){return 1},bt.Z.get=function(){return 2},bt.M.get=function(){return 3},nt.prototype.setOrdinate=function(r,o,a){},nt.prototype.size=function(){},nt.prototype.getOrdinate=function(r,o){},nt.prototype.getCoordinate=function(){},nt.prototype.getCoordinateCopy=function(r){},nt.prototype.getDimension=function(){},nt.prototype.getX=function(r){},nt.prototype.clone=function(){},nt.prototype.expandEnvelope=function(r){},nt.prototype.copy=function(){},nt.prototype.getY=function(r){},nt.prototype.toCoordinateArray=function(){},nt.prototype.interfaces_=function(){return[U]},nt.prototype.getClass=function(){return nt},Object.defineProperties(nt,bt);var qt=function(){},$t=function(r){function o(){r.call(this,"Projective point not representable on the Cartesian plane.")}return r&&(o.__proto__=r),o.prototype=Object.create(r&&r.prototype),o.prototype.constructor=o,o.prototype.interfaces_=function(){return[]},o.prototype.getClass=function(){return o},o}(qt),Ft=function(){};Ft.arraycopy=function(r,o,a,l,h){for(var g=0,w=o;w<o+h;w++)a[l+g]=r[w],g++},Ft.getProperty=function(r){return{"line.separator":\`
|
|
@@ -8049,7 +8049,7 @@ void main() {
|
|
|
8049
8049
|
|
|
8050
8050
|
}\`,Ap=class{constructor(){this.texture=null,this.mesh=null,this.depthNear=0,this.depthFar=0}init(t,e,o){if(this.texture===null){let s=new Vi,u=t.properties.get(s);u.__webglTexture=e.texture,(e.depthNear!=o.depthNear||e.depthFar!=o.depthFar)&&(this.depthNear=e.depthNear,this.depthFar=e.depthFar),this.texture=s}}render(t,e){if(this.texture!==null){if(this.mesh===null){let o=e.cameras[0].viewport,s=new wo({extensions:{fragDepth:!0},vertexShader:CT,fragmentShader:PT,uniforms:{depthColor:{value:this.texture},depthWidth:{value:o.z},depthHeight:{value:o.w}}});this.mesh=new ao(new qc(20,20),s)}t.render(this.mesh,e)}}reset(){this.texture=null,this.mesh=null}},Tp=class extends Ss{constructor(t,e){super();let o=this,s=null,u=1,c=null,h="local-floor",p=1,d=null,m=null,y=null,v=null,E=null,b=null,A=new Ap,_=e.getContextAttributes(),x=null,T=null,w=[],R=[],G=new qt,z=null,F=new Li;F.layers.enable(1),F.viewport=new zr;let I=new Li;I.layers.enable(2),I.viewport=new zr;let lt=[F,I],L=new bp;L.layers.enable(1),L.layers.enable(2);let W=null,V=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(et){let St=w[et];return St===void 0&&(St=new ol,w[et]=St),St.getTargetRaySpace()},this.getControllerGrip=function(et){let St=w[et];return St===void 0&&(St=new ol,w[et]=St),St.getGripSpace()},this.getHand=function(et){let St=w[et];return St===void 0&&(St=new ol,w[et]=St),St.getHandSpace()};function wt(et){let St=R.indexOf(et.inputSource);if(St===-1)return;let kt=w[St];kt!==void 0&&(kt.update(et.inputSource,et.frame,d||c),kt.dispatchEvent({type:et.type,data:et.inputSource}))}function Y(){s.removeEventListener("select",wt),s.removeEventListener("selectstart",wt),s.removeEventListener("selectend",wt),s.removeEventListener("squeeze",wt),s.removeEventListener("squeezestart",wt),s.removeEventListener("squeezeend",wt),s.removeEventListener("end",Y),s.removeEventListener("inputsourceschange",dt);for(let et=0;et<w.length;et++){let St=R[et];St!==null&&(R[et]=null,w[et].disconnect(St))}W=null,V=null,A.reset(),t.setRenderTarget(x),E=null,v=null,y=null,s=null,T=null,Kt.stop(),o.isPresenting=!1,t.setPixelRatio(z),t.setSize(G.width,G.height,!1),o.dispatchEvent({type:"sessionend"})}this.setFramebufferScaleFactor=function(et){u=et,o.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(et){h=et,o.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return d||c},this.setReferenceSpace=function(et){d=et},this.getBaseLayer=function(){return v!==null?v:E},this.getBinding=function(){return y},this.getFrame=function(){return b},this.getSession=function(){return s},this.setSession=function(et){return Kl(this,null,function*(){if(s=et,s!==null){if(x=t.getRenderTarget(),s.addEventListener("select",wt),s.addEventListener("selectstart",wt),s.addEventListener("selectend",wt),s.addEventListener("squeeze",wt),s.addEventListener("squeezestart",wt),s.addEventListener("squeezeend",wt),s.addEventListener("end",Y),s.addEventListener("inputsourceschange",dt),_.xrCompatible!==!0&&(yield e.makeXRCompatible()),z=t.getPixelRatio(),t.getSize(G),s.renderState.layers===void 0||t.capabilities.isWebGL2===!1){let St={antialias:s.renderState.layers===void 0?_.antialias:!0,alpha:!0,depth:_.depth,stencil:_.stencil,framebufferScaleFactor:u};E=new XRWebGLLayer(s,e,St),s.updateRenderState({baseLayer:E}),t.setPixelRatio(1),t.setSize(E.framebufferWidth,E.framebufferHeight,!1),T=new jo(E.framebufferWidth,E.framebufferHeight,{format:so,type:Es,colorSpace:t.outputColorSpace,stencilBuffer:_.stencil})}else{let St=null,kt=null,Zt=null;_.depth&&(Zt=_.stencil?e.DEPTH24_STENCIL8:e.DEPTH_COMPONENT24,St=_.stencil?su:ia,kt=_.stencil?ra:vs);let Dt={colorFormat:e.RGBA8,depthFormat:Zt,scaleFactor:u};y=new XRWebGLBinding(s,e),v=y.createProjectionLayer(Dt),s.updateRenderState({layers:[v]}),t.setPixelRatio(1),t.setSize(v.textureWidth,v.textureHeight,!1),T=new jo(v.textureWidth,v.textureHeight,{format:so,type:Es,depthTexture:new Xc(v.textureWidth,v.textureHeight,kt,void 0,void 0,void 0,void 0,void 0,void 0,St),stencilBuffer:_.stencil,colorSpace:t.outputColorSpace,samples:_.antialias?4:0});let Bt=t.properties.get(T);Bt.__ignoreDepthValues=v.ignoreDepthValues}T.isXRRenderTarget=!0,this.setFoveation(p),d=null,c=yield s.requestReferenceSpace(h),Kt.setContext(s),Kt.start(),o.isPresenting=!0,o.dispatchEvent({type:"sessionstart"})}})},this.getEnvironmentBlendMode=function(){if(s!==null)return s.environmentBlendMode};function dt(et){for(let St=0;St<et.removed.length;St++){let kt=et.removed[St],Zt=R.indexOf(kt);Zt>=0&&(R[Zt]=null,w[Zt].disconnect(kt))}for(let St=0;St<et.added.length;St++){let kt=et.added[St],Zt=R.indexOf(kt);if(Zt===-1){for(let Bt=0;Bt<w.length;Bt++)if(Bt>=R.length){R.push(kt),Zt=Bt;break}else if(R[Bt]===null){R[Bt]=kt,Zt=Bt;break}if(Zt===-1)break}let Dt=w[Zt];Dt&&Dt.connect(kt)}}let ct=new st,yt=new st;function rt(et,St,kt){ct.setFromMatrixPosition(St.matrixWorld),yt.setFromMatrixPosition(kt.matrixWorld);let Zt=ct.distanceTo(yt),Dt=St.projectionMatrix.elements,Bt=kt.projectionMatrix.elements,Tt=Dt[14]/(Dt[10]-1),te=Dt[14]/(Dt[10]+1),Z=(Dt[9]+1)/Dt[5],Nt=(Dt[9]-1)/Dt[5],vt=(Dt[8]-1)/Dt[0],Lt=(Bt[8]+1)/Bt[0],Mt=Tt*vt,Ht=Tt*Lt,Xt=Zt/(-vt+Lt),Pt=Xt*-vt;St.matrixWorld.decompose(et.position,et.quaternion,et.scale),et.translateX(Pt),et.translateZ(Xt),et.matrixWorld.compose(et.position,et.quaternion,et.scale),et.matrixWorldInverse.copy(et.matrixWorld).invert();let ee=Tt+Xt,X=te+Xt,N=Mt-Pt,_t=Ht+(Zt-Pt),Et=Z*te/X*ee,it=Nt*te/X*ee;et.projectionMatrix.makePerspective(N,_t,Et,it,ee,X),et.projectionMatrixInverse.copy(et.projectionMatrix).invert()}function ut(et,St){St===null?et.matrixWorld.copy(et.matrix):et.matrixWorld.multiplyMatrices(St.matrixWorld,et.matrix),et.matrixWorldInverse.copy(et.matrixWorld).invert()}this.updateCamera=function(et){if(s===null)return;A.texture!==null&&(et.near=A.depthNear,et.far=A.depthFar),L.near=I.near=F.near=et.near,L.far=I.far=F.far=et.far,(W!==L.near||V!==L.far)&&(s.updateRenderState({depthNear:L.near,depthFar:L.far}),W=L.near,V=L.far,F.near=W,F.far=V,I.near=W,I.far=V,F.updateProjectionMatrix(),I.updateProjectionMatrix(),et.updateProjectionMatrix());let St=et.parent,kt=L.cameras;ut(L,St);for(let Zt=0;Zt<kt.length;Zt++)ut(kt[Zt],St);kt.length===2?rt(L,F,I):L.projectionMatrix.copy(F.projectionMatrix),q(et,L,St)};function q(et,St,kt){kt===null?et.matrix.copy(St.matrixWorld):(et.matrix.copy(kt.matrixWorld),et.matrix.invert(),et.matrix.multiply(St.matrixWorld)),et.matrix.decompose(et.position,et.quaternion,et.scale),et.updateMatrixWorld(!0),et.projectionMatrix.copy(St.projectionMatrix),et.projectionMatrixInverse.copy(St.projectionMatrixInverse),et.isPerspectiveCamera&&(et.fov=lp*2*Math.atan(1/et.projectionMatrix.elements[5]),et.zoom=1)}this.getCamera=function(){return L},this.getFoveation=function(){if(!(v===null&&E===null))return p},this.setFoveation=function(et){p=et,v!==null&&(v.fixedFoveation=et),E!==null&&E.fixedFoveation!==void 0&&(E.fixedFoveation=et)},this.hasDepthSensing=function(){return A.texture!==null};let bt=null;function Ct(et,St){if(m=St.getViewerPose(d||c),b=St,m!==null){let kt=m.views;E!==null&&(t.setRenderTargetFramebuffer(T,E.framebuffer),t.setRenderTarget(T));let Zt=!1;kt.length!==L.cameras.length&&(L.cameras.length=0,Zt=!0);for(let Bt=0;Bt<kt.length;Bt++){let Tt=kt[Bt],te=null;if(E!==null)te=E.getViewport(Tt);else{let Nt=y.getViewSubImage(v,Tt);te=Nt.viewport,Bt===0&&(t.setRenderTargetTextures(T,Nt.colorTexture,v.ignoreDepthValues?void 0:Nt.depthStencilTexture),t.setRenderTarget(T))}let Z=lt[Bt];Z===void 0&&(Z=new Li,Z.layers.enable(Bt),Z.viewport=new zr,lt[Bt]=Z),Z.matrix.fromArray(Tt.transform.matrix),Z.matrix.decompose(Z.position,Z.quaternion,Z.scale),Z.projectionMatrix.fromArray(Tt.projectionMatrix),Z.projectionMatrixInverse.copy(Z.projectionMatrix).invert(),Z.viewport.set(te.x,te.y,te.width,te.height),Bt===0&&(L.matrix.copy(Z.matrix),L.matrix.decompose(L.position,L.quaternion,L.scale)),Zt===!0&&L.cameras.push(Z)}let Dt=s.enabledFeatures;if(Dt&&Dt.includes("depth-sensing")){let Bt=y.getDepthInformation(kt[0]);Bt&&Bt.isValid&&Bt.texture&&A.init(t,Bt,s.renderState)}}for(let kt=0;kt<w.length;kt++){let Zt=R[kt],Dt=w[kt];Zt!==null&&Dt!==void 0&&Dt.update(Zt,St,d||c)}A.render(t,L),bt&&bt(et,St),St.detectedPlanes&&o.dispatchEvent({type:"planesdetected",data:St}),b=null}let Kt=new hy;Kt.setAnimationLoop(Ct),this.setAnimationLoop=function(et){bt=et},this.dispose=function(){}}},Js=new sa,IT=new er;function RT(r,t){function e(_,x){_.matrixAutoUpdate===!0&&_.updateMatrix(),x.value.copy(_.matrix)}function o(_,x){x.color.getRGB(_.fogColor.value,cy(r)),x.isFog?(_.fogNear.value=x.near,_.fogFar.value=x.far):x.isFogExp2&&(_.fogDensity.value=x.density)}function s(_,x,T,w,R){x.isMeshBasicMaterial||x.isMeshLambertMaterial?u(_,x):x.isMeshToonMaterial?(u(_,x),y(_,x)):x.isMeshPhongMaterial?(u(_,x),m(_,x)):x.isMeshStandardMaterial?(u(_,x),v(_,x),x.isMeshPhysicalMaterial&&E(_,x,R)):x.isMeshMatcapMaterial?(u(_,x),b(_,x)):x.isMeshDepthMaterial?u(_,x):x.isMeshDistanceMaterial?(u(_,x),A(_,x)):x.isMeshNormalMaterial?u(_,x):x.isLineBasicMaterial?(c(_,x),x.isLineDashedMaterial&&h(_,x)):x.isPointsMaterial?p(_,x,T,w):x.isSpriteMaterial?d(_,x):x.isShadowMaterial?(_.color.value.copy(x.color),_.opacity.value=x.opacity):x.isShaderMaterial&&(x.uniformsNeedUpdate=!1)}function u(_,x){_.opacity.value=x.opacity,x.color&&_.diffuse.value.copy(x.color),x.emissive&&_.emissive.value.copy(x.emissive).multiplyScalar(x.emissiveIntensity),x.map&&(_.map.value=x.map,e(x.map,_.mapTransform)),x.alphaMap&&(_.alphaMap.value=x.alphaMap,e(x.alphaMap,_.alphaMapTransform)),x.bumpMap&&(_.bumpMap.value=x.bumpMap,e(x.bumpMap,_.bumpMapTransform),_.bumpScale.value=x.bumpScale,x.side===xi&&(_.bumpScale.value*=-1)),x.normalMap&&(_.normalMap.value=x.normalMap,e(x.normalMap,_.normalMapTransform),_.normalScale.value.copy(x.normalScale),x.side===xi&&_.normalScale.value.negate()),x.displacementMap&&(_.displacementMap.value=x.displacementMap,e(x.displacementMap,_.displacementMapTransform),_.displacementScale.value=x.displacementScale,_.displacementBias.value=x.displacementBias),x.emissiveMap&&(_.emissiveMap.value=x.emissiveMap,e(x.emissiveMap,_.emissiveMapTransform)),x.specularMap&&(_.specularMap.value=x.specularMap,e(x.specularMap,_.specularMapTransform)),x.alphaTest>0&&(_.alphaTest.value=x.alphaTest);let T=t.get(x),w=T.envMap,R=T.envMapRotation;if(w&&(_.envMap.value=w,Js.copy(R),Js.x*=-1,Js.y*=-1,Js.z*=-1,w.isCubeTexture&&w.isRenderTargetTexture===!1&&(Js.y*=-1,Js.z*=-1),_.envMapRotation.value.setFromMatrix4(IT.makeRotationFromEuler(Js)),_.flipEnvMap.value=w.isCubeTexture&&w.isRenderTargetTexture===!1?-1:1,_.reflectivity.value=x.reflectivity,_.ior.value=x.ior,_.refractionRatio.value=x.refractionRatio),x.lightMap){_.lightMap.value=x.lightMap;let G=r._useLegacyLights===!0?Math.PI:1;_.lightMapIntensity.value=x.lightMapIntensity*G,e(x.lightMap,_.lightMapTransform)}x.aoMap&&(_.aoMap.value=x.aoMap,_.aoMapIntensity.value=x.aoMapIntensity,e(x.aoMap,_.aoMapTransform))}function c(_,x){_.diffuse.value.copy(x.color),_.opacity.value=x.opacity,x.map&&(_.map.value=x.map,e(x.map,_.mapTransform))}function h(_,x){_.dashSize.value=x.dashSize,_.totalSize.value=x.dashSize+x.gapSize,_.scale.value=x.scale}function p(_,x,T,w){_.diffuse.value.copy(x.color),_.opacity.value=x.opacity,_.size.value=x.size*T,_.scale.value=w*.5,x.map&&(_.map.value=x.map,e(x.map,_.uvTransform)),x.alphaMap&&(_.alphaMap.value=x.alphaMap,e(x.alphaMap,_.alphaMapTransform)),x.alphaTest>0&&(_.alphaTest.value=x.alphaTest)}function d(_,x){_.diffuse.value.copy(x.color),_.opacity.value=x.opacity,_.rotation.value=x.rotation,x.map&&(_.map.value=x.map,e(x.map,_.mapTransform)),x.alphaMap&&(_.alphaMap.value=x.alphaMap,e(x.alphaMap,_.alphaMapTransform)),x.alphaTest>0&&(_.alphaTest.value=x.alphaTest)}function m(_,x){_.specular.value.copy(x.specular),_.shininess.value=Math.max(x.shininess,1e-4)}function y(_,x){x.gradientMap&&(_.gradientMap.value=x.gradientMap)}function v(_,x){_.metalness.value=x.metalness,x.metalnessMap&&(_.metalnessMap.value=x.metalnessMap,e(x.metalnessMap,_.metalnessMapTransform)),_.roughness.value=x.roughness,x.roughnessMap&&(_.roughnessMap.value=x.roughnessMap,e(x.roughnessMap,_.roughnessMapTransform)),t.get(x).envMap&&(_.envMapIntensity.value=x.envMapIntensity)}function E(_,x,T){_.ior.value=x.ior,x.sheen>0&&(_.sheenColor.value.copy(x.sheenColor).multiplyScalar(x.sheen),_.sheenRoughness.value=x.sheenRoughness,x.sheenColorMap&&(_.sheenColorMap.value=x.sheenColorMap,e(x.sheenColorMap,_.sheenColorMapTransform)),x.sheenRoughnessMap&&(_.sheenRoughnessMap.value=x.sheenRoughnessMap,e(x.sheenRoughnessMap,_.sheenRoughnessMapTransform))),x.clearcoat>0&&(_.clearcoat.value=x.clearcoat,_.clearcoatRoughness.value=x.clearcoatRoughness,x.clearcoatMap&&(_.clearcoatMap.value=x.clearcoatMap,e(x.clearcoatMap,_.clearcoatMapTransform)),x.clearcoatRoughnessMap&&(_.clearcoatRoughnessMap.value=x.clearcoatRoughnessMap,e(x.clearcoatRoughnessMap,_.clearcoatRoughnessMapTransform)),x.clearcoatNormalMap&&(_.clearcoatNormalMap.value=x.clearcoatNormalMap,e(x.clearcoatNormalMap,_.clearcoatNormalMapTransform),_.clearcoatNormalScale.value.copy(x.clearcoatNormalScale),x.side===xi&&_.clearcoatNormalScale.value.negate())),x.iridescence>0&&(_.iridescence.value=x.iridescence,_.iridescenceIOR.value=x.iridescenceIOR,_.iridescenceThicknessMinimum.value=x.iridescenceThicknessRange[0],_.iridescenceThicknessMaximum.value=x.iridescenceThicknessRange[1],x.iridescenceMap&&(_.iridescenceMap.value=x.iridescenceMap,e(x.iridescenceMap,_.iridescenceMapTransform)),x.iridescenceThicknessMap&&(_.iridescenceThicknessMap.value=x.iridescenceThicknessMap,e(x.iridescenceThicknessMap,_.iridescenceThicknessMapTransform))),x.transmission>0&&(_.transmission.value=x.transmission,_.transmissionSamplerMap.value=T.texture,_.transmissionSamplerSize.value.set(T.width,T.height),x.transmissionMap&&(_.transmissionMap.value=x.transmissionMap,e(x.transmissionMap,_.transmissionMapTransform)),_.thickness.value=x.thickness,x.thicknessMap&&(_.thicknessMap.value=x.thicknessMap,e(x.thicknessMap,_.thicknessMapTransform)),_.attenuationDistance.value=x.attenuationDistance,_.attenuationColor.value.copy(x.attenuationColor)),x.anisotropy>0&&(_.anisotropyVector.value.set(x.anisotropy*Math.cos(x.anisotropyRotation),x.anisotropy*Math.sin(x.anisotropyRotation)),x.anisotropyMap&&(_.anisotropyMap.value=x.anisotropyMap,e(x.anisotropyMap,_.anisotropyMapTransform))),_.specularIntensity.value=x.specularIntensity,_.specularColor.value.copy(x.specularColor),x.specularColorMap&&(_.specularColorMap.value=x.specularColorMap,e(x.specularColorMap,_.specularColorMapTransform)),x.specularIntensityMap&&(_.specularIntensityMap.value=x.specularIntensityMap,e(x.specularIntensityMap,_.specularIntensityMapTransform))}function b(_,x){x.matcap&&(_.matcap.value=x.matcap)}function A(_,x){let T=t.get(x).light;_.referencePosition.value.setFromMatrixPosition(T.matrixWorld),_.nearDistance.value=T.shadow.camera.near,_.farDistance.value=T.shadow.camera.far}return{refreshFogUniforms:o,refreshMaterialUniforms:s}}function LT(r,t,e,o){let s={},u={},c=[],h=e.isWebGL2?r.getParameter(r.MAX_UNIFORM_BUFFER_BINDINGS):0;function p(T,w){let R=w.program;o.uniformBlockBinding(T,R)}function d(T,w){let R=s[T.id];R===void 0&&(b(T),R=m(T),s[T.id]=R,T.addEventListener("dispose",_));let G=w.program;o.updateUBOMapping(T,G);let z=t.render.frame;u[T.id]!==z&&(v(T),u[T.id]=z)}function m(T){let w=y();T.__bindingPointIndex=w;let R=r.createBuffer(),G=T.__size,z=T.usage;return r.bindBuffer(r.UNIFORM_BUFFER,R),r.bufferData(r.UNIFORM_BUFFER,G,z),r.bindBuffer(r.UNIFORM_BUFFER,null),r.bindBufferBase(r.UNIFORM_BUFFER,w,R),R}function y(){for(let T=0;T<h;T++)if(c.indexOf(T)===-1)return c.push(T),T;return console.error("THREE.WebGLRenderer: Maximum number of simultaneously usable uniforms groups reached."),0}function v(T){let w=s[T.id],R=T.uniforms,G=T.__cache;r.bindBuffer(r.UNIFORM_BUFFER,w);for(let z=0,F=R.length;z<F;z++){let I=Array.isArray(R[z])?R[z]:[R[z]];for(let lt=0,L=I.length;lt<L;lt++){let W=I[lt];if(E(W,z,lt,G)===!0){let V=W.__offset,wt=Array.isArray(W.value)?W.value:[W.value],Y=0;for(let dt=0;dt<wt.length;dt++){let ct=wt[dt],yt=A(ct);typeof ct=="number"||typeof ct=="boolean"?(W.__data[0]=ct,r.bufferSubData(r.UNIFORM_BUFFER,V+Y,W.__data)):ct.isMatrix3?(W.__data[0]=ct.elements[0],W.__data[1]=ct.elements[1],W.__data[2]=ct.elements[2],W.__data[3]=0,W.__data[4]=ct.elements[3],W.__data[5]=ct.elements[4],W.__data[6]=ct.elements[5],W.__data[7]=0,W.__data[8]=ct.elements[6],W.__data[9]=ct.elements[7],W.__data[10]=ct.elements[8],W.__data[11]=0):(ct.toArray(W.__data,Y),Y+=yt.storage/Float32Array.BYTES_PER_ELEMENT)}r.bufferSubData(r.UNIFORM_BUFFER,V,W.__data)}}}r.bindBuffer(r.UNIFORM_BUFFER,null)}function E(T,w,R,G){let z=T.value,F=w+"_"+R;if(G[F]===void 0)return typeof z=="number"||typeof z=="boolean"?G[F]=z:G[F]=z.clone(),!0;{let I=G[F];if(typeof z=="number"||typeof z=="boolean"){if(I!==z)return G[F]=z,!0}else if(I.equals(z)===!1)return I.copy(z),!0}return!1}function b(T){let w=T.uniforms,R=0,G=16;for(let F=0,I=w.length;F<I;F++){let lt=Array.isArray(w[F])?w[F]:[w[F]];for(let L=0,W=lt.length;L<W;L++){let V=lt[L],wt=Array.isArray(V.value)?V.value:[V.value];for(let Y=0,dt=wt.length;Y<dt;Y++){let ct=wt[Y],yt=A(ct),rt=R%G;rt!==0&&G-rt<yt.boundary&&(R+=G-rt),V.__data=new Float32Array(yt.storage/Float32Array.BYTES_PER_ELEMENT),V.__offset=R,R+=yt.storage}}}let z=R%G;return z>0&&(R+=G-z),T.__size=R,T.__cache={},this}function A(T){let w={boundary:0,storage:0};return typeof T=="number"||typeof T=="boolean"?(w.boundary=4,w.storage=4):T.isVector2?(w.boundary=8,w.storage=8):T.isVector3||T.isColor?(w.boundary=16,w.storage=12):T.isVector4?(w.boundary=16,w.storage=16):T.isMatrix3?(w.boundary=48,w.storage=48):T.isMatrix4?(w.boundary=64,w.storage=64):T.isTexture?console.warn("THREE.WebGLRenderer: Texture samplers can not be part of an uniforms group."):console.warn("THREE.WebGLRenderer: Unsupported uniform value type.",T),w}function _(T){let w=T.target;w.removeEventListener("dispose",_);let R=c.indexOf(w.__bindingPointIndex);c.splice(R,1),r.deleteBuffer(s[w.id]),delete s[w.id],delete u[w.id]}function x(){for(let T in s)r.deleteBuffer(s[T]);c=[],s={},u={}}return{bind:p,update:d,dispose:x}}var Cp=class{constructor(t={}){let{canvas:e=FM(),context:o=null,depth:s=!0,stencil:u=!0,alpha:c=!1,antialias:h=!1,premultipliedAlpha:p=!0,preserveDrawingBuffer:d=!1,powerPreference:m="default",failIfMajorPerformanceCaveat:y=!1}=t;this.isWebGLRenderer=!0;let v;o!==null?v=o.getContextAttributes().alpha:v=c;let E=new Uint32Array(4),b=new Int32Array(4),A=null,_=null,x=[],T=[];this.domElement=e,this.debug={checkShaderErrors:!0,onShaderError:null},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this._outputColorSpace=xo,this._useLegacyLights=!1,this.toneMapping=xs,this.toneMappingExposure=1;let w=this,R=!1,G=0,z=0,F=null,I=-1,lt=null,L=new zr,W=new zr,V=null,wt=new cn(0),Y=0,dt=e.width,ct=e.height,yt=1,rt=null,ut=null,q=new zr(0,0,dt,ct),bt=new zr(0,0,dt,ct),Ct=!1,Kt=new Vc,et=!1,St=!1,kt=null,Zt=new er,Dt=new qt,Bt=new st,Tt={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};function te(){return F===null?yt:1}let Z=o;function Nt(H,ot){for(let xt=0;xt<H.length;xt++){let pt=H[xt],at=e.getContext(pt,ot);if(at!==null)return at}return null}try{let H={alpha:!0,depth:s,stencil:u,antialias:h,premultipliedAlpha:p,preserveDrawingBuffer:d,powerPreference:m,failIfMajorPerformanceCaveat:y};if("setAttribute"in e&&e.setAttribute("data-engine",\`three.js r\${Kp}\`),e.addEventListener("webglcontextlost",ht,!1),e.addEventListener("webglcontextrestored",O,!1),e.addEventListener("webglcontextcreationerror",j,!1),Z===null){let ot=["webgl2","webgl","experimental-webgl"];if(w.isWebGL1Renderer===!0&&ot.shift(),Z=Nt(ot,H),Z===null)throw Nt(ot)?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.")}typeof WebGLRenderingContext!="undefined"&&Z instanceof WebGLRenderingContext&&console.warn("THREE.WebGLRenderer: WebGL 1 support was deprecated in r153 and will be removed in r163."),Z.getShaderPrecisionFormat===void 0&&(Z.getShaderPrecisionFormat=function(){return{rangeMin:1,rangeMax:1,precision:1}})}catch(H){throw console.error("THREE.WebGLRenderer: "+H.message),H}let vt,Lt,Mt,Ht,Xt,Pt,ee,X,N,_t,Et,it,Rt,le,It,Ft,Wt,J,S,P,D,k,B,nt;function Q(){vt=new Zb(Z),Lt=new Hb(Z,vt,t),vt.init(Lt),k=new AT(Z,vt,Lt),Mt=new ST(Z,vt,Lt),Ht=new Kb(Z),Xt=new fT,Pt=new bT(Z,vt,Mt,Xt,Lt,k,Ht),ee=new qb(w),X=new Yb(w),N=new rw(Z,Lt),B=new Gb(Z,vt,N,Lt),_t=new $b(Z,N,Ht,B),Et=new eA(Z,_t,N,Ht),S=new tA(Z,Lt,Pt),Ft=new Vb(Xt),it=new hT(w,ee,X,vt,Lt,B,Ft),Rt=new RT(w,Xt),le=new dT,It=new xT(vt,Lt),J=new zb(w,ee,X,Mt,Et,v,p),Wt=new wT(w,Et,Lt),nt=new LT(Z,Ht,Lt,Mt),P=new kb(Z,vt,Ht,Lt),D=new Jb(Z,vt,Ht,Lt),Ht.programs=it.programs,w.capabilities=Lt,w.extensions=vt,w.properties=Xt,w.renderLists=le,w.shadowMap=Wt,w.state=Mt,w.info=Ht}Q();let ft=new Tp(w,Z);this.xr=ft,this.getContext=function(){return Z},this.getContextAttributes=function(){return Z.getContextAttributes()},this.forceContextLoss=function(){let H=vt.get("WEBGL_lose_context");H&&H.loseContext()},this.forceContextRestore=function(){let H=vt.get("WEBGL_lose_context");H&&H.restoreContext()},this.getPixelRatio=function(){return yt},this.setPixelRatio=function(H){H!==void 0&&(yt=H,this.setSize(dt,ct,!1))},this.getSize=function(H){return H.set(dt,ct)},this.setSize=function(H,ot,xt=!0){if(ft.isPresenting){console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting.");return}dt=H,ct=ot,e.width=Math.floor(H*yt),e.height=Math.floor(ot*yt),xt===!0&&(e.style.width=H+"px",e.style.height=ot+"px"),this.setViewport(0,0,H,ot)},this.getDrawingBufferSize=function(H){return H.set(dt*yt,ct*yt).floor()},this.setDrawingBufferSize=function(H,ot,xt){dt=H,ct=ot,yt=xt,e.width=Math.floor(H*xt),e.height=Math.floor(ot*xt),this.setViewport(0,0,H,ot)},this.getCurrentViewport=function(H){return H.copy(L)},this.getViewport=function(H){return H.copy(q)},this.setViewport=function(H,ot,xt,pt){H.isVector4?q.set(H.x,H.y,H.z,H.w):q.set(H,ot,xt,pt),Mt.viewport(L.copy(q).multiplyScalar(yt).round())},this.getScissor=function(H){return H.copy(bt)},this.setScissor=function(H,ot,xt,pt){H.isVector4?bt.set(H.x,H.y,H.z,H.w):bt.set(H,ot,xt,pt),Mt.scissor(W.copy(bt).multiplyScalar(yt).round())},this.getScissorTest=function(){return Ct},this.setScissorTest=function(H){Mt.setScissorTest(Ct=H)},this.setOpaqueSort=function(H){rt=H},this.setTransparentSort=function(H){ut=H},this.getClearColor=function(H){return H.copy(J.getClearColor())},this.setClearColor=function(){J.setClearColor.apply(J,arguments)},this.getClearAlpha=function(){return J.getClearAlpha()},this.setClearAlpha=function(){J.setClearAlpha.apply(J,arguments)},this.clear=function(H=!0,ot=!0,xt=!0){let pt=0;if(H){let at=!1;if(F!==null){let jt=F.texture.format;at=jt===iy||jt===ry||jt===ny}if(at){let jt=F.texture.type,Qt=jt===Es||jt===vs||jt===jp||jt===ra||jt===ty||jt===ey,ue=J.getClearColor(),ne=J.getClearAlpha(),ye=ue.r,ce=ue.g,he=ue.b;Qt?(E[0]=ye,E[1]=ce,E[2]=he,E[3]=ne,Z.clearBufferuiv(Z.COLOR,0,E)):(b[0]=ye,b[1]=ce,b[2]=he,b[3]=ne,Z.clearBufferiv(Z.COLOR,0,b))}else pt|=Z.COLOR_BUFFER_BIT}ot&&(pt|=Z.DEPTH_BUFFER_BIT),xt&&(pt|=Z.STENCIL_BUFFER_BIT,this.state.buffers.stencil.setMask(4294967295)),Z.clear(pt)},this.clearColor=function(){this.clear(!0,!1,!1)},this.clearDepth=function(){this.clear(!1,!0,!1)},this.clearStencil=function(){this.clear(!1,!1,!0)},this.dispose=function(){e.removeEventListener("webglcontextlost",ht,!1),e.removeEventListener("webglcontextrestored",O,!1),e.removeEventListener("webglcontextcreationerror",j,!1),le.dispose(),It.dispose(),Xt.dispose(),ee.dispose(),X.dispose(),Et.dispose(),B.dispose(),nt.dispose(),it.dispose(),Wt.dispose(),ft.dispose(),ft.removeEventListener("sessionstart",Me),ft.removeEventListener("sessionend",ge),kt&&(kt.dispose(),kt=null),Se.stop()};function ht(H){H.preventDefault(),console.log("THREE.WebGLRenderer: Context Lost."),R=!0}function O(){console.log("THREE.WebGLRenderer: Context Restored."),R=!1;let H=Ht.autoReset,ot=Wt.enabled,xt=Wt.autoUpdate,pt=Wt.needsUpdate,at=Wt.type;Q(),Ht.autoReset=H,Wt.enabled=ot,Wt.autoUpdate=xt,Wt.needsUpdate=pt,Wt.type=at}function j(H){console.error("THREE.WebGLRenderer: A WebGL context could not be created. Reason: ",H.statusMessage)}function $(H){let ot=H.target;ot.removeEventListener("dispose",$),tt(ot)}function tt(H){At(H),Xt.remove(H)}function At(H){let ot=Xt.get(H).programs;ot!==void 0&&(ot.forEach(function(xt){it.releaseProgram(xt)}),H.isShaderMaterial&&it.releaseShaderCache(H))}this.renderBufferDirect=function(H,ot,xt,pt,at,jt){ot===null&&(ot=Tt);let Qt=at.isMesh&&at.matrixWorld.determinant()<0,ue=xn(H,ot,xt,pt,at);Mt.setMaterial(pt,Qt);let ne=xt.index,ye=1;if(pt.wireframe===!0){if(ne=_t.getWireframeAttribute(xt),ne===void 0)return;ye=2}let ce=xt.drawRange,he=xt.attributes.position,un=ce.start*ye,xr=(ce.start+ce.count)*ye;jt!==null&&(un=Math.max(un,jt.start*ye),xr=Math.min(xr,(jt.start+jt.count)*ye)),ne!==null?(un=Math.max(un,0),xr=Math.min(xr,ne.count)):he!=null&&(un=Math.max(un,0),xr=Math.min(xr,he.count));let Bn=xr-un;if(Bn<0||Bn===1/0)return;B.setup(at,pt,ue,xt,ne);let ei,En=P;if(ne!==null&&(ei=N.get(ne),En=D,En.setIndex(ei)),at.isMesh)pt.wireframe===!0?(Mt.setLineWidth(pt.wireframeLinewidth*te()),En.setMode(Z.LINES)):En.setMode(Z.TRIANGLES);else if(at.isLine){let oe=pt.linewidth;oe===void 0&&(oe=1),Mt.setLineWidth(oe*te()),at.isLineSegments?En.setMode(Z.LINES):at.isLineLoop?En.setMode(Z.LINE_LOOP):En.setMode(Z.LINE_STRIP)}else at.isPoints?En.setMode(Z.POINTS):at.isSprite&&En.setMode(Z.TRIANGLES);if(at.isBatchedMesh)En.renderMultiDraw(at._multiDrawStarts,at._multiDrawCounts,at._multiDrawCount);else if(at.isInstancedMesh)En.renderInstances(un,Bn,at.count);else if(xt.isInstancedBufferGeometry){let oe=xt._maxInstanceCount!==void 0?xt._maxInstanceCount:1/0,xa=Math.min(xt.instanceCount,oe);En.renderInstances(un,Bn,xa)}else En.render(un,Bn)};function zt(H,ot,xt){H.transparent===!0&&H.side===Zo&&H.forceSinglePass===!1?(H.side=xi,H.needsUpdate=!0,_n(H,ot,xt),H.side=ws,H.needsUpdate=!0,_n(H,ot,xt),H.side=Zo):_n(H,ot,xt)}this.compile=function(H,ot,xt=null){xt===null&&(xt=H),_=It.get(xt),_.init(),T.push(_),xt.traverseVisible(function(at){at.isLight&&at.layers.test(ot.layers)&&(_.pushLight(at),at.castShadow&&_.pushShadow(at))}),H!==xt&&H.traverseVisible(function(at){at.isLight&&at.layers.test(ot.layers)&&(_.pushLight(at),at.castShadow&&_.pushShadow(at))}),_.setupLights(w._useLegacyLights);let pt=new Set;return H.traverse(function(at){let jt=at.material;if(jt)if(Array.isArray(jt))for(let Qt=0;Qt<jt.length;Qt++){let ue=jt[Qt];zt(ue,xt,at),pt.add(ue)}else zt(jt,xt,at),pt.add(jt)}),T.pop(),_=null,pt},this.compileAsync=function(H,ot,xt=null){let pt=this.compile(H,ot,xt);return new Promise(at=>{function jt(){if(pt.forEach(function(Qt){Xt.get(Qt).currentProgram.isReady()&&pt.delete(Qt)}),pt.size===0){at(H);return}setTimeout(jt,10)}vt.get("KHR_parallel_shader_compile")!==null?jt():setTimeout(jt,10)})};let re=null;function ie(H){re&&re(H)}function Me(){Se.stop()}function ge(){Se.start()}let Se=new hy;Se.setAnimationLoop(ie),typeof self!="undefined"&&Se.setContext(self),this.setAnimationLoop=function(H){re=H,ft.setAnimationLoop(H),H===null?Se.stop():Se.start()},ft.addEventListener("sessionstart",Me),ft.addEventListener("sessionend",ge),this.render=function(H,ot){if(ot!==void 0&&ot.isCamera!==!0){console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");return}if(R===!0)return;H.matrixWorldAutoUpdate===!0&&H.updateMatrixWorld(),ot.parent===null&&ot.matrixWorldAutoUpdate===!0&&ot.updateMatrixWorld(),ft.enabled===!0&&ft.isPresenting===!0&&(ft.cameraAutoUpdate===!0&&ft.updateCamera(ot),ot=ft.getCamera()),H.isScene===!0&&H.onBeforeRender(w,H,ot,F),_=It.get(H,T.length),_.init(),T.push(_),Zt.multiplyMatrices(ot.projectionMatrix,ot.matrixWorldInverse),Kt.setFromProjectionMatrix(Zt),St=this.localClippingEnabled,et=Ft.init(this.clippingPlanes,St),A=le.get(H,x.length),A.init(),x.push(A),be(H,ot,0,w.sortObjects),A.finish(),w.sortObjects===!0&&A.sort(rt,ut),this.info.render.frame++,et===!0&&Ft.beginShadows();let xt=_.state.shadowsArray;if(Wt.render(xt,H,ot),et===!0&&Ft.endShadows(),this.info.autoReset===!0&&this.info.reset(),(ft.enabled===!1||ft.isPresenting===!1||ft.hasDepthSensing()===!1)&&J.render(A,H),_.setupLights(w._useLegacyLights),ot.isArrayCamera){let pt=ot.cameras;for(let at=0,jt=pt.length;at<jt;at++){let Qt=pt[at];Ln(A,H,Qt,Qt.viewport)}}else Ln(A,H,ot);F!==null&&(Pt.updateMultisampleRenderTarget(F),Pt.updateRenderTargetMipmap(F)),H.isScene===!0&&H.onAfterRender(w,H,ot),B.resetDefaultState(),I=-1,lt=null,T.pop(),T.length>0?_=T[T.length-1]:_=null,x.pop(),x.length>0?A=x[x.length-1]:A=null};function be(H,ot,xt,pt){if(H.visible===!1)return;if(H.layers.test(ot.layers)){if(H.isGroup)xt=H.renderOrder;else if(H.isLOD)H.autoUpdate===!0&&H.update(ot);else if(H.isLight)_.pushLight(H),H.castShadow&&_.pushShadow(H);else if(H.isSprite){if(!H.frustumCulled||Kt.intersectsSprite(H)){pt&&Bt.setFromMatrixPosition(H.matrixWorld).applyMatrix4(Zt);let Qt=Et.update(H),ue=H.material;ue.visible&&A.push(H,Qt,ue,xt,Bt.z,null)}}else if((H.isMesh||H.isLine||H.isPoints)&&(!H.frustumCulled||Kt.intersectsObject(H))){let Qt=Et.update(H),ue=H.material;if(pt&&(H.boundingSphere!==void 0?(H.boundingSphere===null&&H.computeBoundingSphere(),Bt.copy(H.boundingSphere.center)):(Qt.boundingSphere===null&&Qt.computeBoundingSphere(),Bt.copy(Qt.boundingSphere.center)),Bt.applyMatrix4(H.matrixWorld).applyMatrix4(Zt)),Array.isArray(ue)){let ne=Qt.groups;for(let ye=0,ce=ne.length;ye<ce;ye++){let he=ne[ye],un=ue[he.materialIndex];un&&un.visible&&A.push(H,Qt,un,xt,Bt.z,he)}}else ue.visible&&A.push(H,Qt,ue,xt,Bt.z,null)}}let jt=H.children;for(let Qt=0,ue=jt.length;Qt<ue;Qt++)be(jt[Qt],ot,xt,pt)}function Ln(H,ot,xt,pt){let at=H.opaque,jt=H.transmissive,Qt=H.transparent;_.setupLightsView(xt),et===!0&&Ft.setGlobalState(w.clippingPlanes,xt),jt.length>0&&lr(at,jt,ot,xt),pt&&Mt.viewport(L.copy(pt)),at.length>0&&vn(at,ot,xt),jt.length>0&&vn(jt,ot,xt),Qt.length>0&&vn(Qt,ot,xt),Mt.buffers.depth.setTest(!0),Mt.buffers.depth.setMask(!0),Mt.buffers.color.setMask(!0),Mt.setPolygonOffset(!1)}function lr(H,ot,xt,pt){if((xt.isScene===!0?xt.overrideMaterial:null)!==null)return;let jt=Lt.isWebGL2;kt===null&&(kt=new jo(1,1,{generateMipmaps:!0,type:vt.has("EXT_color_buffer_half_float")?ul:Es,minFilter:ta,samples:jt?4:0})),w.getDrawingBufferSize(Dt),jt?kt.setSize(Dt.x,Dt.y):kt.setSize(cp(Dt.x),cp(Dt.y));let Qt=w.getRenderTarget();w.setRenderTarget(kt),w.getClearColor(wt),Y=w.getClearAlpha(),Y<1&&w.setClearColor(16777215,.5),w.clear();let ue=w.toneMapping;w.toneMapping=xs,vn(H,xt,pt),Pt.updateMultisampleRenderTarget(kt),Pt.updateRenderTargetMipmap(kt);let ne=!1;for(let ye=0,ce=ot.length;ye<ce;ye++){let he=ot[ye],un=he.object,xr=he.geometry,Bn=he.material,ei=he.group;if(Bn.side===Zo&&un.layers.test(pt.layers)){let En=Bn.side;Bn.side=xi,Bn.needsUpdate=!0,fe(un,xt,pt,xr,Bn,ei),Bn.side=En,Bn.needsUpdate=!0,ne=!0}}ne===!0&&(Pt.updateMultisampleRenderTarget(kt),Pt.updateRenderTargetMipmap(kt)),w.setRenderTarget(Qt),w.setClearColor(wt,Y),w.toneMapping=ue}function vn(H,ot,xt){let pt=ot.isScene===!0?ot.overrideMaterial:null;for(let at=0,jt=H.length;at<jt;at++){let Qt=H[at],ue=Qt.object,ne=Qt.geometry,ye=pt===null?Qt.material:pt,ce=Qt.group;ue.layers.test(xt.layers)&&fe(ue,ot,xt,ne,ye,ce)}}function fe(H,ot,xt,pt,at,jt){H.onBeforeRender(w,ot,xt,pt,at,jt),H.modelViewMatrix.multiplyMatrices(xt.matrixWorldInverse,H.matrixWorld),H.normalMatrix.getNormalMatrix(H.modelViewMatrix),at.onBeforeRender(w,ot,xt,pt,H,jt),at.transparent===!0&&at.side===Zo&&at.forceSinglePass===!1?(at.side=xi,at.needsUpdate=!0,w.renderBufferDirect(xt,ot,pt,at,H,jt),at.side=ws,at.needsUpdate=!0,w.renderBufferDirect(xt,ot,pt,at,H,jt),at.side=Zo):w.renderBufferDirect(xt,ot,pt,at,H,jt),H.onAfterRender(w,ot,xt,pt,at,jt)}function _n(H,ot,xt){ot.isScene!==!0&&(ot=Tt);let pt=Xt.get(H),at=_.state.lights,jt=_.state.shadowsArray,Qt=at.state.version,ue=it.getParameters(H,at.state,jt,ot,xt),ne=it.getProgramCacheKey(ue),ye=pt.programs;pt.environment=H.isMeshStandardMaterial?ot.environment:null,pt.fog=ot.fog,pt.envMap=(H.isMeshStandardMaterial?X:ee).get(H.envMap||pt.environment),pt.envMapRotation=pt.environment!==null&&H.envMap===null?ot.environmentRotation:H.envMapRotation,ye===void 0&&(H.addEventListener("dispose",$),ye=new Map,pt.programs=ye);let ce=ye.get(ne);if(ce!==void 0){if(pt.currentProgram===ce&&pt.lightsStateVersion===Qt)return bn(H,ue),ce}else ue.uniforms=it.getUniforms(H),H.onBuild(xt,ue,w),H.onBeforeCompile(ue,w),ce=it.acquireProgram(ue,ne),ye.set(ne,ce),pt.uniforms=ue.uniforms;let he=pt.uniforms;return(!H.isShaderMaterial&&!H.isRawShaderMaterial||H.clipping===!0)&&(he.clippingPlanes=Ft.uniform),bn(H,ue),pt.needsLights=_r(H),pt.lightsStateVersion=Qt,pt.needsLights&&(he.ambientLightColor.value=at.state.ambient,he.lightProbe.value=at.state.probe,he.directionalLights.value=at.state.directional,he.directionalLightShadows.value=at.state.directionalShadow,he.spotLights.value=at.state.spot,he.spotLightShadows.value=at.state.spotShadow,he.rectAreaLights.value=at.state.rectArea,he.ltc_1.value=at.state.rectAreaLTC1,he.ltc_2.value=at.state.rectAreaLTC2,he.pointLights.value=at.state.point,he.pointLightShadows.value=at.state.pointShadow,he.hemisphereLights.value=at.state.hemi,he.directionalShadowMap.value=at.state.directionalShadowMap,he.directionalShadowMatrix.value=at.state.directionalShadowMatrix,he.spotShadowMap.value=at.state.spotShadowMap,he.spotLightMatrix.value=at.state.spotLightMatrix,he.spotLightMap.value=at.state.spotLightMap,he.pointShadowMap.value=at.state.pointShadowMap,he.pointShadowMatrix.value=at.state.pointShadowMatrix),pt.currentProgram=ce,pt.uniformsList=null,ce}function Pn(H){if(H.uniformsList===null){let ot=H.currentProgram.getUniforms();H.uniformsList=ru.seqWithValue(ot.seq,H.uniforms)}return H.uniformsList}function bn(H,ot){let xt=Xt.get(H);xt.outputColorSpace=ot.outputColorSpace,xt.batching=ot.batching,xt.instancing=ot.instancing,xt.instancingColor=ot.instancingColor,xt.instancingMorph=ot.instancingMorph,xt.skinning=ot.skinning,xt.morphTargets=ot.morphTargets,xt.morphNormals=ot.morphNormals,xt.morphColors=ot.morphColors,xt.morphTargetsCount=ot.morphTargetsCount,xt.numClippingPlanes=ot.numClippingPlanes,xt.numIntersection=ot.numClipIntersection,xt.vertexAlphas=ot.vertexAlphas,xt.vertexTangents=ot.vertexTangents,xt.toneMapping=ot.toneMapping}function xn(H,ot,xt,pt,at){ot.isScene!==!0&&(ot=Tt),Pt.resetTextureUnits();let jt=ot.fog,Qt=pt.isMeshStandardMaterial?ot.environment:null,ue=F===null?w.outputColorSpace:F.isXRRenderTarget===!0?F.texture.colorSpace:bs,ne=(pt.isMeshStandardMaterial?X:ee).get(pt.envMap||Qt),ye=pt.vertexColors===!0&&!!xt.attributes.color&&xt.attributes.color.itemSize===4,ce=!!xt.attributes.tangent&&(!!pt.normalMap||pt.anisotropy>0),he=!!xt.morphAttributes.position,un=!!xt.morphAttributes.normal,xr=!!xt.morphAttributes.color,Bn=xs;pt.toneMapped&&(F===null||F.isXRRenderTarget===!0)&&(Bn=w.toneMapping);let ei=xt.morphAttributes.position||xt.morphAttributes.normal||xt.morphAttributes.color,En=ei!==void 0?ei.length:0,oe=Xt.get(pt),xa=_.state.lights;if(et===!0&&(St===!0||H!==lt)){let ni=H===lt&&pt.id===I;Ft.setState(pt,H,ni)}let ln=!1;pt.version===oe.__version?(oe.needsLights&&oe.lightsStateVersion!==xa.state.version||oe.outputColorSpace!==ue||at.isBatchedMesh&&oe.batching===!1||!at.isBatchedMesh&&oe.batching===!0||at.isInstancedMesh&&oe.instancing===!1||!at.isInstancedMesh&&oe.instancing===!0||at.isSkinnedMesh&&oe.skinning===!1||!at.isSkinnedMesh&&oe.skinning===!0||at.isInstancedMesh&&oe.instancingColor===!0&&at.instanceColor===null||at.isInstancedMesh&&oe.instancingColor===!1&&at.instanceColor!==null||at.isInstancedMesh&&oe.instancingMorph===!0&&at.morphTexture===null||at.isInstancedMesh&&oe.instancingMorph===!1&&at.morphTexture!==null||oe.envMap!==ne||pt.fog===!0&&oe.fog!==jt||oe.numClippingPlanes!==void 0&&(oe.numClippingPlanes!==Ft.numPlanes||oe.numIntersection!==Ft.numIntersection)||oe.vertexAlphas!==ye||oe.vertexTangents!==ce||oe.morphTargets!==he||oe.morphNormals!==un||oe.morphColors!==xr||oe.toneMapping!==Bn||Lt.isWebGL2===!0&&oe.morphTargetsCount!==En)&&(ln=!0):(ln=!0,oe.__version=pt.version);let Wi=oe.currentProgram;ln===!0&&(Wi=_n(pt,ot,at));let Bu=!1,ve=!1,Ns=!1,Mn=Wi.getUniforms(),Xi=oe.uniforms;if(Mt.useProgram(Wi.program)&&(Bu=!0,ve=!0,Ns=!0),pt.id!==I&&(I=pt.id,ve=!0),Bu||lt!==H){Mn.setValue(Z,"projectionMatrix",H.projectionMatrix),Mn.setValue(Z,"viewMatrix",H.matrixWorldInverse);let ni=Mn.map.cameraPosition;ni!==void 0&&ni.setValue(Z,Bt.setFromMatrixPosition(H.matrixWorld)),Lt.logarithmicDepthBuffer&&Mn.setValue(Z,"logDepthBufFC",2/(Math.log(H.far+1)/Math.LN2)),(pt.isMeshPhongMaterial||pt.isMeshToonMaterial||pt.isMeshLambertMaterial||pt.isMeshBasicMaterial||pt.isMeshStandardMaterial||pt.isShaderMaterial)&&Mn.setValue(Z,"isOrthographic",H.isOrthographicCamera===!0),lt!==H&&(lt=H,ve=!0,Ns=!0)}if(at.isSkinnedMesh){Mn.setOptional(Z,at,"bindMatrix"),Mn.setOptional(Z,at,"bindMatrixInverse");let ni=at.skeleton;ni&&(Lt.floatVertexTextures?(ni.boneTexture===null&&ni.computeBoneTexture(),Mn.setValue(Z,"boneTexture",ni.boneTexture,Pt)):console.warn("THREE.WebGLRenderer: SkinnedMesh can only be used with WebGL 2. With WebGL 1 OES_texture_float and vertex textures support is required."))}at.isBatchedMesh&&(Mn.setOptional(Z,at,"batchingTexture"),Mn.setValue(Z,"batchingTexture",at._matricesTexture,Pt));let me=xt.morphAttributes;if((me.position!==void 0||me.normal!==void 0||me.color!==void 0&&Lt.isWebGL2===!0)&&S.update(at,xt,Wi),(ve||oe.receiveShadow!==at.receiveShadow)&&(oe.receiveShadow=at.receiveShadow,Mn.setValue(Z,"receiveShadow",at.receiveShadow)),pt.isMeshGouraudMaterial&&pt.envMap!==null&&(Xi.envMap.value=ne,Xi.flipEnvMap.value=ne.isCubeTexture&&ne.isRenderTargetTexture===!1?-1:1),ve&&(Mn.setValue(Z,"toneMappingExposure",w.toneMappingExposure),oe.needsLights&&Wr(Xi,Ns),jt&&pt.fog===!0&&Rt.refreshFogUniforms(Xi,jt),Rt.refreshMaterialUniforms(Xi,pt,yt,ct,kt),ru.upload(Z,Pn(oe),Xi,Pt)),pt.isShaderMaterial&&pt.uniformsNeedUpdate===!0&&(ru.upload(Z,Pn(oe),Xi,Pt),pt.uniformsNeedUpdate=!1),pt.isSpriteMaterial&&Mn.setValue(Z,"center",at.center),Mn.setValue(Z,"modelViewMatrix",at.modelViewMatrix),Mn.setValue(Z,"normalMatrix",at.normalMatrix),Mn.setValue(Z,"modelMatrix",at.matrixWorld),pt.isShaderMaterial||pt.isRawShaderMaterial){let ni=pt.uniformsGroups;for(let zu=0,Ea=ni.length;zu<Ea;zu++)if(Lt.isWebGL2){let ri=ni[zu];nt.update(ri,Wi),nt.bind(ri,Wi)}else console.warn("THREE.WebGLRenderer: Uniform Buffer Objects can only be used with WebGL 2.")}return Wi}function Wr(H,ot){H.ambientLightColor.needsUpdate=ot,H.lightProbe.needsUpdate=ot,H.directionalLights.needsUpdate=ot,H.directionalLightShadows.needsUpdate=ot,H.pointLights.needsUpdate=ot,H.pointLightShadows.needsUpdate=ot,H.spotLights.needsUpdate=ot,H.spotLightShadows.needsUpdate=ot,H.rectAreaLights.needsUpdate=ot,H.hemisphereLights.needsUpdate=ot}function _r(H){return H.isMeshLambertMaterial||H.isMeshToonMaterial||H.isMeshPhongMaterial||H.isMeshStandardMaterial||H.isShadowMaterial||H.isShaderMaterial&&H.lights===!0}this.getActiveCubeFace=function(){return G},this.getActiveMipmapLevel=function(){return z},this.getRenderTarget=function(){return F},this.setRenderTargetTextures=function(H,ot,xt){Xt.get(H.texture).__webglTexture=ot,Xt.get(H.depthTexture).__webglTexture=xt;let pt=Xt.get(H);pt.__hasExternalTextures=!0,pt.__autoAllocateDepthBuffer=xt===void 0,pt.__autoAllocateDepthBuffer||vt.has("WEBGL_multisampled_render_to_texture")===!0&&(console.warn("THREE.WebGLRenderer: Render-to-texture extension was disabled because an external texture was provided"),pt.__useRenderToTexture=!1)},this.setRenderTargetFramebuffer=function(H,ot){let xt=Xt.get(H);xt.__webglFramebuffer=ot,xt.__useDefaultFramebuffer=ot===void 0},this.setRenderTarget=function(H,ot=0,xt=0){F=H,G=ot,z=xt;let pt=!0,at=null,jt=!1,Qt=!1;if(H){let ne=Xt.get(H);ne.__useDefaultFramebuffer!==void 0?(Mt.bindFramebuffer(Z.FRAMEBUFFER,null),pt=!1):ne.__webglFramebuffer===void 0?Pt.setupRenderTarget(H):ne.__hasExternalTextures&&Pt.rebindTextures(H,Xt.get(H.texture).__webglTexture,Xt.get(H.depthTexture).__webglTexture);let ye=H.texture;(ye.isData3DTexture||ye.isDataArrayTexture||ye.isCompressedArrayTexture)&&(Qt=!0);let ce=Xt.get(H).__webglFramebuffer;H.isWebGLCubeRenderTarget?(Array.isArray(ce[ot])?at=ce[ot][xt]:at=ce[ot],jt=!0):Lt.isWebGL2&&H.samples>0&&Pt.useMultisampledRTT(H)===!1?at=Xt.get(H).__webglMultisampledFramebuffer:Array.isArray(ce)?at=ce[xt]:at=ce,L.copy(H.viewport),W.copy(H.scissor),V=H.scissorTest}else L.copy(q).multiplyScalar(yt).floor(),W.copy(bt).multiplyScalar(yt).floor(),V=Ct;if(Mt.bindFramebuffer(Z.FRAMEBUFFER,at)&&Lt.drawBuffers&&pt&&Mt.drawBuffers(H,at),Mt.viewport(L),Mt.scissor(W),Mt.setScissorTest(V),jt){let ne=Xt.get(H.texture);Z.framebufferTexture2D(Z.FRAMEBUFFER,Z.COLOR_ATTACHMENT0,Z.TEXTURE_CUBE_MAP_POSITIVE_X+ot,ne.__webglTexture,xt)}else if(Qt){let ne=Xt.get(H.texture),ye=ot||0;Z.framebufferTextureLayer(Z.FRAMEBUFFER,Z.COLOR_ATTACHMENT0,ne.__webglTexture,xt||0,ye)}I=-1},this.readRenderTargetPixels=function(H,ot,xt,pt,at,jt,Qt){if(!(H&&H.isWebGLRenderTarget)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}let ue=Xt.get(H).__webglFramebuffer;if(H.isWebGLCubeRenderTarget&&Qt!==void 0&&(ue=ue[Qt]),ue){Mt.bindFramebuffer(Z.FRAMEBUFFER,ue);try{let ne=H.texture,ye=ne.format,ce=ne.type;if(ye!==so&&k.convert(ye)!==Z.getParameter(Z.IMPLEMENTATION_COLOR_READ_FORMAT)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}let he=ce===ul&&(vt.has("EXT_color_buffer_half_float")||Lt.isWebGL2&&vt.has("EXT_color_buffer_float"));if(ce!==Es&&k.convert(ce)!==Z.getParameter(Z.IMPLEMENTATION_COLOR_READ_TYPE)&&!(ce===$o&&(Lt.isWebGL2||vt.has("OES_texture_float")||vt.has("WEBGL_color_buffer_float")))&&!he){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}ot>=0&&ot<=H.width-pt&&xt>=0&&xt<=H.height-at&&Z.readPixels(ot,xt,pt,at,k.convert(ye),k.convert(ce),jt)}finally{let ne=F!==null?Xt.get(F).__webglFramebuffer:null;Mt.bindFramebuffer(Z.FRAMEBUFFER,ne)}}},this.copyFramebufferToTexture=function(H,ot,xt=0){let pt=Math.pow(2,-xt),at=Math.floor(ot.image.width*pt),jt=Math.floor(ot.image.height*pt);Pt.setTexture2D(ot,0),Z.copyTexSubImage2D(Z.TEXTURE_2D,xt,0,0,H.x,H.y,at,jt),Mt.unbindTexture()},this.copyTextureToTexture=function(H,ot,xt,pt=0){let at=ot.image.width,jt=ot.image.height,Qt=k.convert(xt.format),ue=k.convert(xt.type);Pt.setTexture2D(xt,0),Z.pixelStorei(Z.UNPACK_FLIP_Y_WEBGL,xt.flipY),Z.pixelStorei(Z.UNPACK_PREMULTIPLY_ALPHA_WEBGL,xt.premultiplyAlpha),Z.pixelStorei(Z.UNPACK_ALIGNMENT,xt.unpackAlignment),ot.isDataTexture?Z.texSubImage2D(Z.TEXTURE_2D,pt,H.x,H.y,at,jt,Qt,ue,ot.image.data):ot.isCompressedTexture?Z.compressedTexSubImage2D(Z.TEXTURE_2D,pt,H.x,H.y,ot.mipmaps[0].width,ot.mipmaps[0].height,Qt,ot.mipmaps[0].data):Z.texSubImage2D(Z.TEXTURE_2D,pt,H.x,H.y,Qt,ue,ot.image),pt===0&&xt.generateMipmaps&&Z.generateMipmap(Z.TEXTURE_2D),Mt.unbindTexture()},this.copyTextureToTexture3D=function(H,ot,xt,pt,at=0){if(w.isWebGL1Renderer){console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: can only be used with WebGL2.");return}let jt=Math.round(H.max.x-H.min.x),Qt=Math.round(H.max.y-H.min.y),ue=H.max.z-H.min.z+1,ne=k.convert(pt.format),ye=k.convert(pt.type),ce;if(pt.isData3DTexture)Pt.setTexture3D(pt,0),ce=Z.TEXTURE_3D;else if(pt.isDataArrayTexture||pt.isCompressedArrayTexture)Pt.setTexture2DArray(pt,0),ce=Z.TEXTURE_2D_ARRAY;else{console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.");return}Z.pixelStorei(Z.UNPACK_FLIP_Y_WEBGL,pt.flipY),Z.pixelStorei(Z.UNPACK_PREMULTIPLY_ALPHA_WEBGL,pt.premultiplyAlpha),Z.pixelStorei(Z.UNPACK_ALIGNMENT,pt.unpackAlignment);let he=Z.getParameter(Z.UNPACK_ROW_LENGTH),un=Z.getParameter(Z.UNPACK_IMAGE_HEIGHT),xr=Z.getParameter(Z.UNPACK_SKIP_PIXELS),Bn=Z.getParameter(Z.UNPACK_SKIP_ROWS),ei=Z.getParameter(Z.UNPACK_SKIP_IMAGES),En=xt.isCompressedTexture?xt.mipmaps[at]:xt.image;Z.pixelStorei(Z.UNPACK_ROW_LENGTH,En.width),Z.pixelStorei(Z.UNPACK_IMAGE_HEIGHT,En.height),Z.pixelStorei(Z.UNPACK_SKIP_PIXELS,H.min.x),Z.pixelStorei(Z.UNPACK_SKIP_ROWS,H.min.y),Z.pixelStorei(Z.UNPACK_SKIP_IMAGES,H.min.z),xt.isDataTexture||xt.isData3DTexture?Z.texSubImage3D(ce,at,ot.x,ot.y,ot.z,jt,Qt,ue,ne,ye,En.data):pt.isCompressedArrayTexture?Z.compressedTexSubImage3D(ce,at,ot.x,ot.y,ot.z,jt,Qt,ue,ne,En.data):Z.texSubImage3D(ce,at,ot.x,ot.y,ot.z,jt,Qt,ue,ne,ye,En),Z.pixelStorei(Z.UNPACK_ROW_LENGTH,he),Z.pixelStorei(Z.UNPACK_IMAGE_HEIGHT,un),Z.pixelStorei(Z.UNPACK_SKIP_PIXELS,xr),Z.pixelStorei(Z.UNPACK_SKIP_ROWS,Bn),Z.pixelStorei(Z.UNPACK_SKIP_IMAGES,ei),at===0&&pt.generateMipmaps&&Z.generateMipmap(ce),Mt.unbindTexture()},this.initTexture=function(H){H.isCubeTexture?Pt.setTextureCube(H,0):H.isData3DTexture?Pt.setTexture3D(H,0):H.isDataArrayTexture||H.isCompressedArrayTexture?Pt.setTexture2DArray(H,0):Pt.setTexture2D(H,0),Mt.unbindTexture()},this.resetState=function(){G=0,z=0,F=null,Mt.reset(),B.reset()},typeof __THREE_DEVTOOLS__!="undefined"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}get coordinateSystem(){return Jo}get outputColorSpace(){return this._outputColorSpace}set outputColorSpace(t){this._outputColorSpace=t;let e=this.getContext();e.drawingBufferColorSpace=t===Qp?"display-p3":"srgb",e.unpackColorSpace=Tn.workingColorSpace===Qc?"display-p3":"srgb"}get useLegacyLights(){return console.warn("THREE.WebGLRenderer: The property .useLegacyLights has been deprecated. Migrate your lighting according to the following guide: https://discourse.threejs.org/t/updates-to-lighting-in-three-js-r155/53733."),this._useLegacyLights}set useLegacyLights(t){console.warn("THREE.WebGLRenderer: The property .useLegacyLights has been deprecated. Migrate your lighting according to the following guide: https://discourse.threejs.org/t/updates-to-lighting-in-three-js-r155/53733."),this._useLegacyLights=t}},Pp=class extends Cp{};Pp.prototype.isWebGL1Renderer=!0;var Yc=class{constructor(t,e){this.isInterleavedBuffer=!0,this.array=t,this.stride=e,this.count=t!==void 0?t.length/e:0,this.usage=ap,this._updateRange={offset:0,count:-1},this.updateRanges=[],this.version=0,this.uuid=Ko()}onUploadCallback(){}set needsUpdate(t){t===!0&&this.version++}get updateRange(){return uy("THREE.InterleavedBuffer: updateRange() is deprecated and will be removed in r169. Use addUpdateRange() instead."),this._updateRange}setUsage(t){return this.usage=t,this}addUpdateRange(t,e){this.updateRanges.push({start:t,count:e})}clearUpdateRanges(){this.updateRanges.length=0}copy(t){return this.array=new t.array.constructor(t.array),this.count=t.count,this.stride=t.stride,this.usage=t.usage,this}copyAt(t,e,o){t*=this.stride,o*=e.stride;for(let s=0,u=this.stride;s<u;s++)this.array[t+s]=e.array[o+s];return this}set(t,e=0){return this.array.set(t,e),this}clone(t){t.arrayBuffers===void 0&&(t.arrayBuffers={}),this.array.buffer._uuid===void 0&&(this.array.buffer._uuid=Ko()),t.arrayBuffers[this.array.buffer._uuid]===void 0&&(t.arrayBuffers[this.array.buffer._uuid]=this.array.slice(0).buffer);let e=new this.array.constructor(t.arrayBuffers[this.array.buffer._uuid]),o=new this.constructor(e,this.stride);return o.setUsage(this.usage),o}onUpload(t){return this.onUploadCallback=t,this}toJSON(t){return t.arrayBuffers===void 0&&(t.arrayBuffers={}),this.array.buffer._uuid===void 0&&(this.array.buffer._uuid=Ko()),t.arrayBuffers[this.array.buffer._uuid]===void 0&&(t.arrayBuffers[this.array.buffer._uuid]=Array.from(new Uint32Array(this.array.buffer))),{uuid:this.uuid,buffer:this.array.buffer._uuid,type:this.array.constructor.name,stride:this.stride}}},ci=new st,hl=class r{constructor(t,e,o,s=!1){this.isInterleavedBufferAttribute=!0,this.name="",this.data=t,this.itemSize=e,this.offset=o,this.normalized=s}get count(){return this.data.count}get array(){return this.data.array}set needsUpdate(t){this.data.needsUpdate=t}applyMatrix4(t){for(let e=0,o=this.data.count;e<o;e++)ci.fromBufferAttribute(this,e),ci.applyMatrix4(t),this.setXYZ(e,ci.x,ci.y,ci.z);return this}applyNormalMatrix(t){for(let e=0,o=this.count;e<o;e++)ci.fromBufferAttribute(this,e),ci.applyNormalMatrix(t),this.setXYZ(e,ci.x,ci.y,ci.z);return this}transformDirection(t){for(let e=0,o=this.count;e<o;e++)ci.fromBufferAttribute(this,e),ci.transformDirection(t),this.setXYZ(e,ci.x,ci.y,ci.z);return this}getComponent(t,e){let o=this.array[t*this.data.stride+this.offset+e];return this.normalized&&(o=Mo(o,this.array)),o}setComponent(t,e,o){return this.normalized&&(o=An(o,this.array)),this.data.array[t*this.data.stride+this.offset+e]=o,this}setX(t,e){return this.normalized&&(e=An(e,this.array)),this.data.array[t*this.data.stride+this.offset]=e,this}setY(t,e){return this.normalized&&(e=An(e,this.array)),this.data.array[t*this.data.stride+this.offset+1]=e,this}setZ(t,e){return this.normalized&&(e=An(e,this.array)),this.data.array[t*this.data.stride+this.offset+2]=e,this}setW(t,e){return this.normalized&&(e=An(e,this.array)),this.data.array[t*this.data.stride+this.offset+3]=e,this}getX(t){let e=this.data.array[t*this.data.stride+this.offset];return this.normalized&&(e=Mo(e,this.array)),e}getY(t){let e=this.data.array[t*this.data.stride+this.offset+1];return this.normalized&&(e=Mo(e,this.array)),e}getZ(t){let e=this.data.array[t*this.data.stride+this.offset+2];return this.normalized&&(e=Mo(e,this.array)),e}getW(t){let e=this.data.array[t*this.data.stride+this.offset+3];return this.normalized&&(e=Mo(e,this.array)),e}setXY(t,e,o){return t=t*this.data.stride+this.offset,this.normalized&&(e=An(e,this.array),o=An(o,this.array)),this.data.array[t+0]=e,this.data.array[t+1]=o,this}setXYZ(t,e,o,s){return t=t*this.data.stride+this.offset,this.normalized&&(e=An(e,this.array),o=An(o,this.array),s=An(s,this.array)),this.data.array[t+0]=e,this.data.array[t+1]=o,this.data.array[t+2]=s,this}setXYZW(t,e,o,s,u){return t=t*this.data.stride+this.offset,this.normalized&&(e=An(e,this.array),o=An(o,this.array),s=An(s,this.array),u=An(u,this.array)),this.data.array[t+0]=e,this.data.array[t+1]=o,this.data.array[t+2]=s,this.data.array[t+3]=u,this}clone(t){if(t===void 0){console.log("THREE.InterleavedBufferAttribute.clone(): Cloning an interleaved buffer attribute will de-interleave buffer data.");let e=[];for(let o=0;o<this.count;o++){let s=o*this.data.stride+this.offset;for(let u=0;u<this.itemSize;u++)e.push(this.data.array[s+u])}return new qn(new this.array.constructor(e),this.itemSize,this.normalized)}else return t.interleavedBuffers===void 0&&(t.interleavedBuffers={}),t.interleavedBuffers[this.data.uuid]===void 0&&(t.interleavedBuffers[this.data.uuid]=this.data.clone(t)),new r(t.interleavedBuffers[this.data.uuid],this.itemSize,this.offset,this.normalized)}toJSON(t){if(t===void 0){console.log("THREE.InterleavedBufferAttribute.toJSON(): Serializing an interleaved buffer attribute will de-interleave buffer data.");let e=[];for(let o=0;o<this.count;o++){let s=o*this.data.stride+this.offset;for(let u=0;u<this.itemSize;u++)e.push(this.data.array[s+u])}return{itemSize:this.itemSize,type:this.array.constructor.name,array:e,normalized:this.normalized}}else return t.interleavedBuffers===void 0&&(t.interleavedBuffers={}),t.interleavedBuffers[this.data.uuid]===void 0&&(t.interleavedBuffers[this.data.uuid]=this.data.toJSON(t)),{isInterleavedBufferAttribute:!0,itemSize:this.itemSize,data:this.data.uuid,offset:this.offset,normalized:this.normalized}}},Ip=class extends aa{constructor(t){super(),this.isSpriteMaterial=!0,this.type="SpriteMaterial",this.color=new cn(16777215),this.map=null,this.alphaMap=null,this.rotation=0,this.sizeAttenuation=!0,this.transparent=!0,this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.map=t.map,this.alphaMap=t.alphaMap,this.rotation=t.rotation,this.sizeAttenuation=t.sizeAttenuation,this.fog=t.fog,this}},gs,nl=new st,$a=new st,Ja=new st,Ka=new qt,rl=new qt,yy=new er,_c=new st,il=new st,xc=new st,q0=new qt,Kf=new qt,W0=new qt,Rp=class extends uo{constructor(t=new Ip){if(super(),this.isSprite=!0,this.type="Sprite",gs===void 0){gs=new Ei;let e=new Float32Array([-.5,-.5,0,0,0,.5,-.5,0,1,0,.5,.5,0,1,1,-.5,.5,0,0,1]),o=new Yc(e,5);gs.setIndex([0,1,2,0,2,3]),gs.setAttribute("position",new hl(o,3,0,!1)),gs.setAttribute("uv",new hl(o,2,3,!1))}this.geometry=gs,this.material=t,this.center=new qt(.5,.5)}raycast(t,e){t.camera===null&&console.error('THREE.Sprite: "Raycaster.camera" needs to be set in order to raycast against sprites.'),$a.setFromMatrixScale(this.matrixWorld),yy.copy(t.camera.matrixWorld),this.modelViewMatrix.multiplyMatrices(t.camera.matrixWorldInverse,this.matrixWorld),Ja.setFromMatrixPosition(this.modelViewMatrix),t.camera.isPerspectiveCamera&&this.material.sizeAttenuation===!1&&$a.multiplyScalar(-Ja.z);let o=this.material.rotation,s,u;o!==0&&(u=Math.cos(o),s=Math.sin(o));let c=this.center;Ec(_c.set(-.5,-.5,0),Ja,c,$a,s,u),Ec(il.set(.5,-.5,0),Ja,c,$a,s,u),Ec(xc.set(.5,.5,0),Ja,c,$a,s,u),q0.set(0,0),Kf.set(1,0),W0.set(1,1);let h=t.ray.intersectTriangle(_c,il,xc,!1,nl);if(h===null&&(Ec(il.set(-.5,.5,0),Ja,c,$a,s,u),Kf.set(0,1),h=t.ray.intersectTriangle(_c,xc,il,!1,nl),h===null))return;let p=t.ray.origin.distanceTo(nl);p<t.near||p>t.far||e.push({distance:p,point:nl.clone(),uv:ea.getInterpolation(nl,_c,il,xc,q0,Kf,W0,new qt),face:null,object:this})}copy(t,e){return super.copy(t,e),t.center!==void 0&&this.center.copy(t.center),this.material=t.material,this}};Rp.Dispose=function(){gs.dispose(),gs=void 0};function Ec(r,t,e,o,s,u){Ka.subVectors(r,e).addScalar(.5).multiply(o),s!==void 0?(rl.x=u*Ka.x-s*Ka.y,rl.y=s*Ka.x+u*Ka.y):rl.copy(Ka),r.copy(t),r.x+=rl.x,r.y+=rl.y,r.applyMatrix4(yy)}var qi=class{constructor(){this.type="Curve",this.arcLengthDivisions=200}getPoint(){return console.warn("THREE.Curve: .getPoint() not implemented."),null}getPointAt(t,e){let o=this.getUtoTmapping(t);return this.getPoint(o,e)}getPoints(t=5){let e=[];for(let o=0;o<=t;o++)e.push(this.getPoint(o/t));return e}getSpacedPoints(t=5){let e=[];for(let o=0;o<=t;o++)e.push(this.getPointAt(o/t));return e}getLength(){let t=this.getLengths();return t[t.length-1]}getLengths(t=this.arcLengthDivisions){if(this.cacheArcLengths&&this.cacheArcLengths.length===t+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;let e=[],o,s=this.getPoint(0),u=0;e.push(0);for(let c=1;c<=t;c++)o=this.getPoint(c/t),u+=o.distanceTo(s),e.push(u),s=o;return this.cacheArcLengths=e,e}updateArcLengths(){this.needsUpdate=!0,this.getLengths()}getUtoTmapping(t,e){let o=this.getLengths(),s=0,u=o.length,c;e?c=e:c=t*o[u-1];let h=0,p=u-1,d;for(;h<=p;)if(s=Math.floor(h+(p-h)/2),d=o[s]-c,d<0)h=s+1;else if(d>0)p=s-1;else{p=s;break}if(s=p,o[s]===c)return s/(u-1);let m=o[s],v=o[s+1]-m,E=(c-m)/v;return(s+E)/(u-1)}getTangent(t,e){let s=t-1e-4,u=t+1e-4;s<0&&(s=0),u>1&&(u=1);let c=this.getPoint(s),h=this.getPoint(u),p=e||(c.isVector2?new qt:new st);return p.copy(h).sub(c).normalize(),p}getTangentAt(t,e){let o=this.getUtoTmapping(t);return this.getTangent(o,e)}computeFrenetFrames(t,e){let o=new st,s=[],u=[],c=[],h=new st,p=new er;for(let E=0;E<=t;E++){let b=E/t;s[E]=this.getTangentAt(b,new st)}u[0]=new st,c[0]=new st;let d=Number.MAX_VALUE,m=Math.abs(s[0].x),y=Math.abs(s[0].y),v=Math.abs(s[0].z);m<=d&&(d=m,o.set(1,0,0)),y<=d&&(d=y,o.set(0,1,0)),v<=d&&o.set(0,0,1),h.crossVectors(s[0],o).normalize(),u[0].crossVectors(s[0],h),c[0].crossVectors(s[0],u[0]);for(let E=1;E<=t;E++){if(u[E]=u[E-1].clone(),c[E]=c[E-1].clone(),h.crossVectors(s[E-1],s[E]),h.length()>Number.EPSILON){h.normalize();let b=Math.acos(jr(s[E-1].dot(s[E]),-1,1));u[E].applyMatrix4(p.makeRotationAxis(h,b))}c[E].crossVectors(s[E],u[E])}if(e===!0){let E=Math.acos(jr(u[0].dot(u[t]),-1,1));E/=t,s[0].dot(h.crossVectors(u[0],u[t]))>0&&(E=-E);for(let b=1;b<=t;b++)u[b].applyMatrix4(p.makeRotationAxis(s[b],E*b)),c[b].crossVectors(s[b],u[b])}return{tangents:s,normals:u,binormals:c}}clone(){return new this.constructor().copy(this)}copy(t){return this.arcLengthDivisions=t.arcLengthDivisions,this}toJSON(){let t={metadata:{version:4.6,type:"Curve",generator:"Curve.toJSON"}};return t.arcLengthDivisions=this.arcLengthDivisions,t.type=this.type,t}fromJSON(t){return this.arcLengthDivisions=t.arcLengthDivisions,this}},fl=class extends qi{constructor(t=0,e=0,o=1,s=1,u=0,c=Math.PI*2,h=!1,p=0){super(),this.isEllipseCurve=!0,this.type="EllipseCurve",this.aX=t,this.aY=e,this.xRadius=o,this.yRadius=s,this.aStartAngle=u,this.aEndAngle=c,this.aClockwise=h,this.aRotation=p}getPoint(t,e=new qt){let o=e,s=Math.PI*2,u=this.aEndAngle-this.aStartAngle,c=Math.abs(u)<Number.EPSILON;for(;u<0;)u+=s;for(;u>s;)u-=s;u<Number.EPSILON&&(c?u=0:u=s),this.aClockwise===!0&&!c&&(u===s?u=-s:u=u-s);let h=this.aStartAngle+t*u,p=this.aX+this.xRadius*Math.cos(h),d=this.aY+this.yRadius*Math.sin(h);if(this.aRotation!==0){let m=Math.cos(this.aRotation),y=Math.sin(this.aRotation),v=p-this.aX,E=d-this.aY;p=v*m-E*y+this.aX,d=v*y+E*m+this.aY}return o.set(p,d)}copy(t){return super.copy(t),this.aX=t.aX,this.aY=t.aY,this.xRadius=t.xRadius,this.yRadius=t.yRadius,this.aStartAngle=t.aStartAngle,this.aEndAngle=t.aEndAngle,this.aClockwise=t.aClockwise,this.aRotation=t.aRotation,this}toJSON(){let t=super.toJSON();return t.aX=this.aX,t.aY=this.aY,t.xRadius=this.xRadius,t.yRadius=this.yRadius,t.aStartAngle=this.aStartAngle,t.aEndAngle=this.aEndAngle,t.aClockwise=this.aClockwise,t.aRotation=this.aRotation,t}fromJSON(t){return super.fromJSON(t),this.aX=t.aX,this.aY=t.aY,this.xRadius=t.xRadius,this.yRadius=t.yRadius,this.aStartAngle=t.aStartAngle,this.aEndAngle=t.aEndAngle,this.aClockwise=t.aClockwise,this.aRotation=t.aRotation,this}},Lp=class extends fl{constructor(t,e,o,s,u,c){super(t,e,o,o,s,u,c),this.isArcCurve=!0,this.type="ArcCurve"}};function ed(){let r=0,t=0,e=0,o=0;function s(u,c,h,p){r=u,t=h,e=-3*u+3*c-2*h-p,o=2*u-2*c+h+p}return{initCatmullRom:function(u,c,h,p,d){s(c,h,d*(h-u),d*(p-c))},initNonuniformCatmullRom:function(u,c,h,p,d,m,y){let v=(c-u)/d-(h-u)/(d+m)+(h-c)/m,E=(h-c)/m-(p-c)/(m+y)+(p-h)/y;v*=m,E*=m,s(c,h,v,E)},calc:function(u){let c=u*u,h=c*u;return r+t*u+e*c+o*h}}}var Mc=new st,jf=new ed,Qf=new ed,tp=new ed,Np=class extends qi{constructor(t=[],e=!1,o="centripetal",s=.5){super(),this.isCatmullRomCurve3=!0,this.type="CatmullRomCurve3",this.points=t,this.closed=e,this.curveType=o,this.tension=s}getPoint(t,e=new st){let o=e,s=this.points,u=s.length,c=(u-(this.closed?0:1))*t,h=Math.floor(c),p=c-h;this.closed?h+=h>0?0:(Math.floor(Math.abs(h)/u)+1)*u:p===0&&h===u-1&&(h=u-2,p=1);let d,m;this.closed||h>0?d=s[(h-1)%u]:(Mc.subVectors(s[0],s[1]).add(s[0]),d=Mc);let y=s[h%u],v=s[(h+1)%u];if(this.closed||h+2<u?m=s[(h+2)%u]:(Mc.subVectors(s[u-1],s[u-2]).add(s[u-1]),m=Mc),this.curveType==="centripetal"||this.curveType==="chordal"){let E=this.curveType==="chordal"?.5:.25,b=Math.pow(d.distanceToSquared(y),E),A=Math.pow(y.distanceToSquared(v),E),_=Math.pow(v.distanceToSquared(m),E);A<1e-4&&(A=1),b<1e-4&&(b=A),_<1e-4&&(_=A),jf.initNonuniformCatmullRom(d.x,y.x,v.x,m.x,b,A,_),Qf.initNonuniformCatmullRom(d.y,y.y,v.y,m.y,b,A,_),tp.initNonuniformCatmullRom(d.z,y.z,v.z,m.z,b,A,_)}else this.curveType==="catmullrom"&&(jf.initCatmullRom(d.x,y.x,v.x,m.x,this.tension),Qf.initCatmullRom(d.y,y.y,v.y,m.y,this.tension),tp.initCatmullRom(d.z,y.z,v.z,m.z,this.tension));return o.set(jf.calc(p),Qf.calc(p),tp.calc(p)),o}copy(t){super.copy(t),this.points=[];for(let e=0,o=t.points.length;e<o;e++){let s=t.points[e];this.points.push(s.clone())}return this.closed=t.closed,this.curveType=t.curveType,this.tension=t.tension,this}toJSON(){let t=super.toJSON();t.points=[];for(let e=0,o=this.points.length;e<o;e++){let s=this.points[e];t.points.push(s.toArray())}return t.closed=this.closed,t.curveType=this.curveType,t.tension=this.tension,t}fromJSON(t){super.fromJSON(t),this.points=[];for(let e=0,o=t.points.length;e<o;e++){let s=t.points[e];this.points.push(new st().fromArray(s))}return this.closed=t.closed,this.curveType=t.curveType,this.tension=t.tension,this}};function X0(r,t,e,o,s){let u=(o-t)*.5,c=(s-e)*.5,h=r*r,p=r*h;return(2*e-2*o+u+c)*p+(-3*e+3*o-2*u-c)*h+u*r+e}function NT(r,t){let e=1-r;return e*e*t}function OT(r,t){return 2*(1-r)*r*t}function DT(r,t){return r*r*t}function sl(r,t,e,o){return NT(r,t)+OT(r,e)+DT(r,o)}function FT(r,t){let e=1-r;return e*e*e*t}function UT(r,t){let e=1-r;return 3*e*e*r*t}function BT(r,t){return 3*(1-r)*r*r*t}function zT(r,t){return r*r*r*t}function al(r,t,e,o,s){return FT(r,t)+UT(r,e)+BT(r,o)+zT(r,s)}var Zc=class extends qi{constructor(t=new qt,e=new qt,o=new qt,s=new qt){super(),this.isCubicBezierCurve=!0,this.type="CubicBezierCurve",this.v0=t,this.v1=e,this.v2=o,this.v3=s}getPoint(t,e=new qt){let o=e,s=this.v0,u=this.v1,c=this.v2,h=this.v3;return o.set(al(t,s.x,u.x,c.x,h.x),al(t,s.y,u.y,c.y,h.y)),o}copy(t){return super.copy(t),this.v0.copy(t.v0),this.v1.copy(t.v1),this.v2.copy(t.v2),this.v3.copy(t.v3),this}toJSON(){let t=super.toJSON();return t.v0=this.v0.toArray(),t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t.v3=this.v3.toArray(),t}fromJSON(t){return super.fromJSON(t),this.v0.fromArray(t.v0),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this.v3.fromArray(t.v3),this}},Op=class extends qi{constructor(t=new st,e=new st,o=new st,s=new st){super(),this.isCubicBezierCurve3=!0,this.type="CubicBezierCurve3",this.v0=t,this.v1=e,this.v2=o,this.v3=s}getPoint(t,e=new st){let o=e,s=this.v0,u=this.v1,c=this.v2,h=this.v3;return o.set(al(t,s.x,u.x,c.x,h.x),al(t,s.y,u.y,c.y,h.y),al(t,s.z,u.z,c.z,h.z)),o}copy(t){return super.copy(t),this.v0.copy(t.v0),this.v1.copy(t.v1),this.v2.copy(t.v2),this.v3.copy(t.v3),this}toJSON(){let t=super.toJSON();return t.v0=this.v0.toArray(),t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t.v3=this.v3.toArray(),t}fromJSON(t){return super.fromJSON(t),this.v0.fromArray(t.v0),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this.v3.fromArray(t.v3),this}},$c=class extends qi{constructor(t=new qt,e=new qt){super(),this.isLineCurve=!0,this.type="LineCurve",this.v1=t,this.v2=e}getPoint(t,e=new qt){let o=e;return t===1?o.copy(this.v2):(o.copy(this.v2).sub(this.v1),o.multiplyScalar(t).add(this.v1)),o}getPointAt(t,e){return this.getPoint(t,e)}getTangent(t,e=new qt){return e.subVectors(this.v2,this.v1).normalize()}getTangentAt(t,e){return this.getTangent(t,e)}copy(t){return super.copy(t),this.v1.copy(t.v1),this.v2.copy(t.v2),this}toJSON(){let t=super.toJSON();return t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t}fromJSON(t){return super.fromJSON(t),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this}},Dp=class extends qi{constructor(t=new st,e=new st){super(),this.isLineCurve3=!0,this.type="LineCurve3",this.v1=t,this.v2=e}getPoint(t,e=new st){let o=e;return t===1?o.copy(this.v2):(o.copy(this.v2).sub(this.v1),o.multiplyScalar(t).add(this.v1)),o}getPointAt(t,e){return this.getPoint(t,e)}getTangent(t,e=new st){return e.subVectors(this.v2,this.v1).normalize()}getTangentAt(t,e){return this.getTangent(t,e)}copy(t){return super.copy(t),this.v1.copy(t.v1),this.v2.copy(t.v2),this}toJSON(){let t=super.toJSON();return t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t}fromJSON(t){return super.fromJSON(t),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this}},Jc=class extends qi{constructor(t=new qt,e=new qt,o=new qt){super(),this.isQuadraticBezierCurve=!0,this.type="QuadraticBezierCurve",this.v0=t,this.v1=e,this.v2=o}getPoint(t,e=new qt){let o=e,s=this.v0,u=this.v1,c=this.v2;return o.set(sl(t,s.x,u.x,c.x),sl(t,s.y,u.y,c.y)),o}copy(t){return super.copy(t),this.v0.copy(t.v0),this.v1.copy(t.v1),this.v2.copy(t.v2),this}toJSON(){let t=super.toJSON();return t.v0=this.v0.toArray(),t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t}fromJSON(t){return super.fromJSON(t),this.v0.fromArray(t.v0),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this}},Fp=class extends qi{constructor(t=new st,e=new st,o=new st){super(),this.isQuadraticBezierCurve3=!0,this.type="QuadraticBezierCurve3",this.v0=t,this.v1=e,this.v2=o}getPoint(t,e=new st){let o=e,s=this.v0,u=this.v1,c=this.v2;return o.set(sl(t,s.x,u.x,c.x),sl(t,s.y,u.y,c.y),sl(t,s.z,u.z,c.z)),o}copy(t){return super.copy(t),this.v0.copy(t.v0),this.v1.copy(t.v1),this.v2.copy(t.v2),this}toJSON(){let t=super.toJSON();return t.v0=this.v0.toArray(),t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t}fromJSON(t){return super.fromJSON(t),this.v0.fromArray(t.v0),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this}},Kc=class extends qi{constructor(t=[]){super(),this.isSplineCurve=!0,this.type="SplineCurve",this.points=t}getPoint(t,e=new qt){let o=e,s=this.points,u=(s.length-1)*t,c=Math.floor(u),h=u-c,p=s[c===0?c:c-1],d=s[c],m=s[c>s.length-2?s.length-1:c+1],y=s[c>s.length-3?s.length-1:c+2];return o.set(X0(h,p.x,d.x,m.x,y.x),X0(h,p.y,d.y,m.y,y.y)),o}copy(t){super.copy(t),this.points=[];for(let e=0,o=t.points.length;e<o;e++){let s=t.points[e];this.points.push(s.clone())}return this}toJSON(){let t=super.toJSON();t.points=[];for(let e=0,o=this.points.length;e<o;e++){let s=this.points[e];t.points.push(s.toArray())}return t}fromJSON(t){super.fromJSON(t),this.points=[];for(let e=0,o=t.points.length;e<o;e++){let s=t.points[e];this.points.push(new qt().fromArray(s))}return this}},Up=Object.freeze({__proto__:null,ArcCurve:Lp,CatmullRomCurve3:Np,CubicBezierCurve:Zc,CubicBezierCurve3:Op,EllipseCurve:fl,LineCurve:$c,LineCurve3:Dp,QuadraticBezierCurve:Jc,QuadraticBezierCurve3:Fp,SplineCurve:Kc}),Bp=class extends qi{constructor(){super(),this.type="CurvePath",this.curves=[],this.autoClose=!1}add(t){this.curves.push(t)}closePath(){let t=this.curves[0].getPoint(0),e=this.curves[this.curves.length-1].getPoint(1);if(!t.equals(e)){let o=t.isVector2===!0?"LineCurve":"LineCurve3";this.curves.push(new Up[o](e,t))}return this}getPoint(t,e){let o=t*this.getLength(),s=this.getCurveLengths(),u=0;for(;u<s.length;){if(s[u]>=o){let c=s[u]-o,h=this.curves[u],p=h.getLength(),d=p===0?0:1-c/p;return h.getPointAt(d,e)}u++}return null}getLength(){let t=this.getCurveLengths();return t[t.length-1]}updateArcLengths(){this.needsUpdate=!0,this.cacheLengths=null,this.getCurveLengths()}getCurveLengths(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;let t=[],e=0;for(let o=0,s=this.curves.length;o<s;o++)e+=this.curves[o].getLength(),t.push(e);return this.cacheLengths=t,t}getSpacedPoints(t=40){let e=[];for(let o=0;o<=t;o++)e.push(this.getPoint(o/t));return this.autoClose&&e.push(e[0]),e}getPoints(t=12){let e=[],o;for(let s=0,u=this.curves;s<u.length;s++){let c=u[s],h=c.isEllipseCurve?t*2:c.isLineCurve||c.isLineCurve3?1:c.isSplineCurve?t*c.points.length:t,p=c.getPoints(h);for(let d=0;d<p.length;d++){let m=p[d];o&&o.equals(m)||(e.push(m),o=m)}}return this.autoClose&&e.length>1&&!e[e.length-1].equals(e[0])&&e.push(e[0]),e}copy(t){super.copy(t),this.curves=[];for(let e=0,o=t.curves.length;e<o;e++){let s=t.curves[e];this.curves.push(s.clone())}return this.autoClose=t.autoClose,this}toJSON(){let t=super.toJSON();t.autoClose=this.autoClose,t.curves=[];for(let e=0,o=this.curves.length;e<o;e++){let s=this.curves[e];t.curves.push(s.toJSON())}return t}fromJSON(t){super.fromJSON(t),this.autoClose=t.autoClose,this.curves=[];for(let e=0,o=t.curves.length;e<o;e++){let s=t.curves[e];this.curves.push(new Up[s.type]().fromJSON(s))}return this}},uu=class extends Bp{constructor(t){super(),this.type="Path",this.currentPoint=new qt,t&&this.setFromPoints(t)}setFromPoints(t){this.moveTo(t[0].x,t[0].y);for(let e=1,o=t.length;e<o;e++)this.lineTo(t[e].x,t[e].y);return this}moveTo(t,e){return this.currentPoint.set(t,e),this}lineTo(t,e){let o=new $c(this.currentPoint.clone(),new qt(t,e));return this.curves.push(o),this.currentPoint.set(t,e),this}quadraticCurveTo(t,e,o,s){let u=new Jc(this.currentPoint.clone(),new qt(t,e),new qt(o,s));return this.curves.push(u),this.currentPoint.set(o,s),this}bezierCurveTo(t,e,o,s,u,c){let h=new Zc(this.currentPoint.clone(),new qt(t,e),new qt(o,s),new qt(u,c));return this.curves.push(h),this.currentPoint.set(u,c),this}splineThru(t){let e=[this.currentPoint.clone()].concat(t),o=new Kc(e);return this.curves.push(o),this.currentPoint.copy(t[t.length-1]),this}arc(t,e,o,s,u,c){let h=this.currentPoint.x,p=this.currentPoint.y;return this.absarc(t+h,e+p,o,s,u,c),this}absarc(t,e,o,s,u,c){return this.absellipse(t,e,o,o,s,u,c),this}ellipse(t,e,o,s,u,c,h,p){let d=this.currentPoint.x,m=this.currentPoint.y;return this.absellipse(t+d,e+m,o,s,u,c,h,p),this}absellipse(t,e,o,s,u,c,h,p){let d=new fl(t,e,o,s,u,c,h,p);if(this.curves.length>0){let y=d.getPoint(0);y.equals(this.currentPoint)||this.lineTo(y.x,y.y)}this.curves.push(d);let m=d.getPoint(1);return this.currentPoint.copy(m),this}copy(t){return super.copy(t),this.currentPoint.copy(t.currentPoint),this}toJSON(){let t=super.toJSON();return t.currentPoint=this.currentPoint.toArray(),t}fromJSON(t){return super.fromJSON(t),this.currentPoint.fromArray(t.currentPoint),this}};var lu=class extends uu{constructor(t){super(t),this.uuid=Ko(),this.type="Shape",this.holes=[]}getPointsHoles(t){let e=[];for(let o=0,s=this.holes.length;o<s;o++)e[o]=this.holes[o].getPoints(t);return e}extractPoints(t){return{shape:this.getPoints(t),holes:this.getPointsHoles(t)}}copy(t){super.copy(t),this.holes=[];for(let e=0,o=t.holes.length;e<o;e++){let s=t.holes[e];this.holes.push(s.clone())}return this}toJSON(){let t=super.toJSON();t.uuid=this.uuid,t.holes=[];for(let e=0,o=this.holes.length;e<o;e++){let s=this.holes[e];t.holes.push(s.toJSON())}return t}fromJSON(t){super.fromJSON(t),this.uuid=t.uuid,this.holes=[];for(let e=0,o=t.holes.length;e<o;e++){let s=t.holes[e];this.holes.push(new uu().fromJSON(s))}return this}},GT={triangulate:function(r,t,e=2){let o=t&&t.length,s=o?t[0]*e:r.length,u=vy(r,0,s,e,!0),c=[];if(!u||u.next===u.prev)return c;let h,p,d,m,y,v,E;if(o&&(u=WT(r,t,u,e)),r.length>80*e){h=d=r[0],p=m=r[1];for(let b=e;b<s;b+=e)y=r[b],v=r[b+1],y<h&&(h=y),v<p&&(p=v),y>d&&(d=y),v>m&&(m=v);E=Math.max(d-h,m-p),E=E!==0?32767/E:0}return pl(u,c,e,h,p,E,0),c}};function vy(r,t,e,o,s){let u,c;if(s===nC(r,t,e,o)>0)for(u=t;u<e;u+=o)c=Y0(u,r[u],r[u+1],c);else for(u=e-o;u>=t;u-=o)c=Y0(u,r[u],r[u+1],c);return c&&eh(c,c.next)&&(ml(c),c=c.next),c}function ua(r,t){if(!r)return r;t||(t=r);let e=r,o;do if(o=!1,!e.steiner&&(eh(e,e.next)||Xn(e.prev,e,e.next)===0)){if(ml(e),e=t=e.prev,e===e.next)break;o=!0}else e=e.next;while(o||e!==t);return t}function pl(r,t,e,o,s,u,c){if(!r)return;!c&&u&&JT(r,o,s,u);let h=r,p,d;for(;r.prev!==r.next;){if(p=r.prev,d=r.next,u?HT(r,o,s,u):kT(r)){t.push(p.i/e|0),t.push(r.i/e|0),t.push(d.i/e|0),ml(r),r=d.next,h=d.next;continue}if(r=d,r===h){c?c===1?(r=VT(ua(r),t,e),pl(r,t,e,o,s,u,2)):c===2&&qT(r,t,e,o,s,u):pl(ua(r),t,e,o,s,u,1);break}}}function kT(r){let t=r.prev,e=r,o=r.next;if(Xn(t,e,o)>=0)return!1;let s=t.x,u=e.x,c=o.x,h=t.y,p=e.y,d=o.y,m=s<u?s<c?s:c:u<c?u:c,y=h<p?h<d?h:d:p<d?p:d,v=s>u?s>c?s:c:u>c?u:c,E=h>p?h>d?h:d:p>d?p:d,b=o.next;for(;b!==t;){if(b.x>=m&&b.x<=v&&b.y>=y&&b.y<=E&&tu(s,h,u,p,c,d,b.x,b.y)&&Xn(b.prev,b,b.next)>=0)return!1;b=b.next}return!0}function HT(r,t,e,o){let s=r.prev,u=r,c=r.next;if(Xn(s,u,c)>=0)return!1;let h=s.x,p=u.x,d=c.x,m=s.y,y=u.y,v=c.y,E=h<p?h<d?h:d:p<d?p:d,b=m<y?m<v?m:v:y<v?y:v,A=h>p?h>d?h:d:p>d?p:d,_=m>y?m>v?m:v:y>v?y:v,x=zp(E,b,t,e,o),T=zp(A,_,t,e,o),w=r.prevZ,R=r.nextZ;for(;w&&w.z>=x&&R&&R.z<=T;){if(w.x>=E&&w.x<=A&&w.y>=b&&w.y<=_&&w!==s&&w!==c&&tu(h,m,p,y,d,v,w.x,w.y)&&Xn(w.prev,w,w.next)>=0||(w=w.prevZ,R.x>=E&&R.x<=A&&R.y>=b&&R.y<=_&&R!==s&&R!==c&&tu(h,m,p,y,d,v,R.x,R.y)&&Xn(R.prev,R,R.next)>=0))return!1;R=R.nextZ}for(;w&&w.z>=x;){if(w.x>=E&&w.x<=A&&w.y>=b&&w.y<=_&&w!==s&&w!==c&&tu(h,m,p,y,d,v,w.x,w.y)&&Xn(w.prev,w,w.next)>=0)return!1;w=w.prevZ}for(;R&&R.z<=T;){if(R.x>=E&&R.x<=A&&R.y>=b&&R.y<=_&&R!==s&&R!==c&&tu(h,m,p,y,d,v,R.x,R.y)&&Xn(R.prev,R,R.next)>=0)return!1;R=R.nextZ}return!0}function VT(r,t,e){let o=r;do{let s=o.prev,u=o.next.next;!eh(s,u)&&_y(s,o,o.next,u)&&dl(s,u)&&dl(u,s)&&(t.push(s.i/e|0),t.push(o.i/e|0),t.push(u.i/e|0),ml(o),ml(o.next),o=r=u),o=o.next}while(o!==r);return ua(o)}function qT(r,t,e,o,s,u){let c=r;do{let h=c.next.next;for(;h!==c.prev;){if(c.i!==h.i&&QT(c,h)){let p=xy(c,h);c=ua(c,c.next),p=ua(p,p.next),pl(c,t,e,o,s,u,0),pl(p,t,e,o,s,u,0);return}h=h.next}c=c.next}while(c!==r)}function WT(r,t,e,o){let s=[],u,c,h,p,d;for(u=0,c=t.length;u<c;u++)h=t[u]*o,p=u<c-1?t[u+1]*o:r.length,d=vy(r,h,p,o,!1),d===d.next&&(d.steiner=!0),s.push(jT(d));for(s.sort(XT),u=0;u<s.length;u++)e=YT(s[u],e);return e}function XT(r,t){return r.x-t.x}function YT(r,t){let e=ZT(r,t);if(!e)return t;let o=xy(e,r);return ua(o,o.next),ua(e,e.next)}function ZT(r,t){let e=t,o=-1/0,s,u=r.x,c=r.y;do{if(c<=e.y&&c>=e.next.y&&e.next.y!==e.y){let v=e.x+(c-e.y)*(e.next.x-e.x)/(e.next.y-e.y);if(v<=u&&v>o&&(o=v,s=e.x<e.next.x?e:e.next,v===u))return s}e=e.next}while(e!==t);if(!s)return null;let h=s,p=s.x,d=s.y,m=1/0,y;e=s;do u>=e.x&&e.x>=p&&u!==e.x&&tu(c<d?u:o,c,p,d,c<d?o:u,c,e.x,e.y)&&(y=Math.abs(c-e.y)/(u-e.x),dl(e,r)&&(y<m||y===m&&(e.x>s.x||e.x===s.x&&$T(s,e)))&&(s=e,m=y)),e=e.next;while(e!==h);return s}function $T(r,t){return Xn(r.prev,r,t.prev)<0&&Xn(t.next,r,r.next)<0}function JT(r,t,e,o){let s=r;do s.z===0&&(s.z=zp(s.x,s.y,t,e,o)),s.prevZ=s.prev,s.nextZ=s.next,s=s.next;while(s!==r);s.prevZ.nextZ=null,s.prevZ=null,KT(s)}function KT(r){let t,e,o,s,u,c,h,p,d=1;do{for(e=r,r=null,u=null,c=0;e;){for(c++,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)?(s=e,e=e.nextZ,h--):(s=o,o=o.nextZ,p--),u?u.nextZ=s:r=s,s.prevZ=u,u=s;e=o}u.nextZ=null,d*=2}while(c>1);return r}function zp(r,t,e,o,s){return r=(r-e)*s|0,t=(t-o)*s|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 jT(r){let 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,s,u,c,h){return(s-c)*(t-h)>=(r-c)*(u-h)&&(r-c)*(o-h)>=(e-c)*(t-h)&&(e-c)*(u-h)>=(s-c)*(o-h)}function QT(r,t){return r.next.i!==t.i&&r.prev.i!==t.i&&!tC(r,t)&&(dl(r,t)&&dl(t,r)&&eC(r,t)&&(Xn(r.prev,r,t.prev)||Xn(r,t.prev,t))||eh(r,t)&&Xn(r.prev,r,r.next)>0&&Xn(t.prev,t,t.next)>0)}function Xn(r,t,e){return(t.y-r.y)*(e.x-t.x)-(t.x-r.x)*(e.y-t.y)}function eh(r,t){return r.x===t.x&&r.y===t.y}function _y(r,t,e,o){let s=Sc(Xn(r,t,e)),u=Sc(Xn(r,t,o)),c=Sc(Xn(e,o,r)),h=Sc(Xn(e,o,t));return!!(s!==u&&c!==h||s===0&&wc(r,e,t)||u===0&&wc(r,o,t)||c===0&&wc(e,r,o)||h===0&&wc(e,t,o))}function wc(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 Sc(r){return r>0?1:r<0?-1:0}function tC(r,t){let e=r;do{if(e.i!==r.i&&e.next.i!==r.i&&e.i!==t.i&&e.next.i!==t.i&&_y(e,e.next,r,t))return!0;e=e.next}while(e!==r);return!1}function dl(r,t){return Xn(r.prev,r,r.next)<0?Xn(r,t,r.next)>=0&&Xn(r,r.prev,t)>=0:Xn(r,t,r.prev)<0||Xn(r,r.next,t)<0}function eC(r,t){let e=r,o=!1,s=(r.x+t.x)/2,u=(r.y+t.y)/2;do e.y>u!=e.next.y>u&&e.next.y!==e.y&&s<(e.next.x-e.x)*(u-e.y)/(e.next.y-e.y)+e.x&&(o=!o),e=e.next;while(e!==r);return o}function xy(r,t){let e=new Gp(r.i,r.x,r.y),o=new Gp(t.i,t.x,t.y),s=r.next,u=t.prev;return r.next=t,t.prev=r,e.next=s,s.prev=e,o.next=e,e.prev=o,u.next=o,o.prev=u,o}function Y0(r,t,e,o){let s=new Gp(r,t,e);return o?(s.next=o.next,s.prev=o,o.next.prev=s,o.next=s):(s.prev=s,s.next=s),s}function ml(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 Gp(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}function nC(r,t,e,o){let s=0;for(let u=t,c=e-o;u<e;u+=o)s+=(r[c]-r[u])*(r[u+1]+r[c+1]),c=u;return s}var Ms=class r{static area(t){let e=t.length,o=0;for(let s=e-1,u=0;u<e;s=u++)o+=t[s].x*t[u].y-t[u].x*t[s].y;return o*.5}static isClockWise(t){return r.area(t)<0}static triangulateShape(t,e){let o=[],s=[],u=[];Z0(t),$0(o,t);let c=t.length;e.forEach(Z0);for(let p=0;p<e.length;p++)s.push(c),c+=e[p].length,$0(o,e[p]);let h=GT.triangulate(o,s);for(let p=0;p<h.length;p+=3)u.push(h.slice(p,p+3));return u}};function Z0(r){let t=r.length;t>2&&r[t-1].equals(r[0])&&r.pop()}function $0(r,t){for(let e=0;e<t.length;e++)r.push(t[e].x),r.push(t[e].y)}var cu=class r extends Ei{constructor(t=new lu([new qt(.5,.5),new qt(-.5,.5),new qt(-.5,-.5),new qt(.5,-.5)]),e={}){super(),this.type="ExtrudeGeometry",this.parameters={shapes:t,options:e},t=Array.isArray(t)?t:[t];let o=this,s=[],u=[];for(let h=0,p=t.length;h<p;h++){let d=t[h];c(d)}this.setAttribute("position",new Gr(s,3)),this.setAttribute("uv",new Gr(u,2)),this.computeVertexNormals();function c(h){let p=[],d=e.curveSegments!==void 0?e.curveSegments:12,m=e.steps!==void 0?e.steps:1,y=e.depth!==void 0?e.depth:1,v=e.bevelEnabled!==void 0?e.bevelEnabled:!0,E=e.bevelThickness!==void 0?e.bevelThickness:.2,b=e.bevelSize!==void 0?e.bevelSize:E-.1,A=e.bevelOffset!==void 0?e.bevelOffset:0,_=e.bevelSegments!==void 0?e.bevelSegments:3,x=e.extrudePath,T=e.UVGenerator!==void 0?e.UVGenerator:rC,w,R=!1,G,z,F,I;x&&(w=x.getSpacedPoints(m),R=!0,v=!1,G=x.computeFrenetFrames(m,!1),z=new st,F=new st,I=new st),v||(_=0,E=0,b=0,A=0);let lt=h.extractPoints(d),L=lt.shape,W=lt.holes;if(!Ms.isClockWise(L)){L=L.reverse();for(let Z=0,Nt=W.length;Z<Nt;Z++){let vt=W[Z];Ms.isClockWise(vt)&&(W[Z]=vt.reverse())}}let wt=Ms.triangulateShape(L,W),Y=L;for(let Z=0,Nt=W.length;Z<Nt;Z++){let vt=W[Z];L=L.concat(vt)}function dt(Z,Nt,vt){return Nt||console.error("THREE.ExtrudeGeometry: vec does not exist"),Z.clone().addScaledVector(Nt,vt)}let ct=L.length,yt=wt.length;function rt(Z,Nt,vt){let Lt,Mt,Ht,Xt=Z.x-Nt.x,Pt=Z.y-Nt.y,ee=vt.x-Z.x,X=vt.y-Z.y,N=Xt*Xt+Pt*Pt,_t=Xt*X-Pt*ee;if(Math.abs(_t)>Number.EPSILON){let Et=Math.sqrt(N),it=Math.sqrt(ee*ee+X*X),Rt=Nt.x-Pt/Et,le=Nt.y+Xt/Et,It=vt.x-X/it,Ft=vt.y+ee/it,Wt=((It-Rt)*X-(Ft-le)*ee)/(Xt*X-Pt*ee);Lt=Rt+Xt*Wt-Z.x,Mt=le+Pt*Wt-Z.y;let J=Lt*Lt+Mt*Mt;if(J<=2)return new qt(Lt,Mt);Ht=Math.sqrt(J/2)}else{let Et=!1;Xt>Number.EPSILON?ee>Number.EPSILON&&(Et=!0):Xt<-Number.EPSILON?ee<-Number.EPSILON&&(Et=!0):Math.sign(Pt)===Math.sign(X)&&(Et=!0),Et?(Lt=-Pt,Mt=Xt,Ht=Math.sqrt(N)):(Lt=Xt,Mt=Pt,Ht=Math.sqrt(N/2))}return new qt(Lt/Ht,Mt/Ht)}let ut=[];for(let Z=0,Nt=Y.length,vt=Nt-1,Lt=Z+1;Z<Nt;Z++,vt++,Lt++)vt===Nt&&(vt=0),Lt===Nt&&(Lt=0),ut[Z]=rt(Y[Z],Y[vt],Y[Lt]);let q=[],bt,Ct=ut.concat();for(let Z=0,Nt=W.length;Z<Nt;Z++){let vt=W[Z];bt=[];for(let Lt=0,Mt=vt.length,Ht=Mt-1,Xt=Lt+1;Lt<Mt;Lt++,Ht++,Xt++)Ht===Mt&&(Ht=0),Xt===Mt&&(Xt=0),bt[Lt]=rt(vt[Lt],vt[Ht],vt[Xt]);q.push(bt),Ct=Ct.concat(bt)}for(let Z=0;Z<_;Z++){let Nt=Z/_,vt=E*Math.cos(Nt*Math.PI/2),Lt=b*Math.sin(Nt*Math.PI/2)+A;for(let Mt=0,Ht=Y.length;Mt<Ht;Mt++){let Xt=dt(Y[Mt],ut[Mt],Lt);Zt(Xt.x,Xt.y,-vt)}for(let Mt=0,Ht=W.length;Mt<Ht;Mt++){let Xt=W[Mt];bt=q[Mt];for(let Pt=0,ee=Xt.length;Pt<ee;Pt++){let X=dt(Xt[Pt],bt[Pt],Lt);Zt(X.x,X.y,-vt)}}}let Kt=b+A;for(let Z=0;Z<ct;Z++){let Nt=v?dt(L[Z],Ct[Z],Kt):L[Z];R?(F.copy(G.normals[0]).multiplyScalar(Nt.x),z.copy(G.binormals[0]).multiplyScalar(Nt.y),I.copy(w[0]).add(F).add(z),Zt(I.x,I.y,I.z)):Zt(Nt.x,Nt.y,0)}for(let Z=1;Z<=m;Z++)for(let Nt=0;Nt<ct;Nt++){let vt=v?dt(L[Nt],Ct[Nt],Kt):L[Nt];R?(F.copy(G.normals[Z]).multiplyScalar(vt.x),z.copy(G.binormals[Z]).multiplyScalar(vt.y),I.copy(w[Z]).add(F).add(z),Zt(I.x,I.y,I.z)):Zt(vt.x,vt.y,y/m*Z)}for(let Z=_-1;Z>=0;Z--){let Nt=Z/_,vt=E*Math.cos(Nt*Math.PI/2),Lt=b*Math.sin(Nt*Math.PI/2)+A;for(let Mt=0,Ht=Y.length;Mt<Ht;Mt++){let Xt=dt(Y[Mt],ut[Mt],Lt);Zt(Xt.x,Xt.y,y+vt)}for(let Mt=0,Ht=W.length;Mt<Ht;Mt++){let Xt=W[Mt];bt=q[Mt];for(let Pt=0,ee=Xt.length;Pt<ee;Pt++){let X=dt(Xt[Pt],bt[Pt],Lt);R?Zt(X.x,X.y+w[m-1].y,w[m-1].x+vt):Zt(X.x,X.y,y+vt)}}}et(),St();function et(){let Z=s.length/3;if(v){let Nt=0,vt=ct*Nt;for(let Lt=0;Lt<yt;Lt++){let Mt=wt[Lt];Dt(Mt[2]+vt,Mt[1]+vt,Mt[0]+vt)}Nt=m+_*2,vt=ct*Nt;for(let Lt=0;Lt<yt;Lt++){let Mt=wt[Lt];Dt(Mt[0]+vt,Mt[1]+vt,Mt[2]+vt)}}else{for(let Nt=0;Nt<yt;Nt++){let vt=wt[Nt];Dt(vt[2],vt[1],vt[0])}for(let Nt=0;Nt<yt;Nt++){let vt=wt[Nt];Dt(vt[0]+ct*m,vt[1]+ct*m,vt[2]+ct*m)}}o.addGroup(Z,s.length/3-Z,0)}function St(){let Z=s.length/3,Nt=0;kt(Y,Nt),Nt+=Y.length;for(let vt=0,Lt=W.length;vt<Lt;vt++){let Mt=W[vt];kt(Mt,Nt),Nt+=Mt.length}o.addGroup(Z,s.length/3-Z,1)}function kt(Z,Nt){let vt=Z.length;for(;--vt>=0;){let Lt=vt,Mt=vt-1;Mt<0&&(Mt=Z.length-1);for(let Ht=0,Xt=m+_*2;Ht<Xt;Ht++){let Pt=ct*Ht,ee=ct*(Ht+1),X=Nt+Lt+Pt,N=Nt+Mt+Pt,_t=Nt+Mt+ee,Et=Nt+Lt+ee;Bt(X,N,_t,Et)}}}function Zt(Z,Nt,vt){p.push(Z),p.push(Nt),p.push(vt)}function Dt(Z,Nt,vt){Tt(Z),Tt(Nt),Tt(vt);let Lt=s.length/3,Mt=T.generateTopUV(o,s,Lt-3,Lt-2,Lt-1);te(Mt[0]),te(Mt[1]),te(Mt[2])}function Bt(Z,Nt,vt,Lt){Tt(Z),Tt(Nt),Tt(Lt),Tt(Nt),Tt(vt),Tt(Lt);let Mt=s.length/3,Ht=T.generateSideWallUV(o,s,Mt-6,Mt-3,Mt-2,Mt-1);te(Ht[0]),te(Ht[1]),te(Ht[3]),te(Ht[1]),te(Ht[2]),te(Ht[3])}function Tt(Z){s.push(p[Z*3+0]),s.push(p[Z*3+1]),s.push(p[Z*3+2])}function te(Z){u.push(Z.x),u.push(Z.y)}}}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}toJSON(){let t=super.toJSON(),e=this.parameters.shapes,o=this.parameters.options;return iC(e,o,t)}static fromJSON(t,e){let o=[];for(let u=0,c=t.shapes.length;u<c;u++){let h=e[t.shapes[u]];o.push(h)}let s=t.options.extrudePath;return s!==void 0&&(t.options.extrudePath=new Up[s.type]().fromJSON(s)),new r(o,t.options)}},rC={generateTopUV:function(r,t,e,o,s){let u=t[e*3],c=t[e*3+1],h=t[o*3],p=t[o*3+1],d=t[s*3],m=t[s*3+1];return[new qt(u,c),new qt(h,p),new qt(d,m)]},generateSideWallUV:function(r,t,e,o,s,u){let c=t[e*3],h=t[e*3+1],p=t[e*3+2],d=t[o*3],m=t[o*3+1],y=t[o*3+2],v=t[s*3],E=t[s*3+1],b=t[s*3+2],A=t[u*3],_=t[u*3+1],x=t[u*3+2];return Math.abs(h-m)<Math.abs(c-d)?[new qt(c,1-p),new qt(d,1-y),new qt(v,1-b),new qt(A,1-x)]:[new qt(h,1-p),new qt(m,1-y),new qt(E,1-b),new qt(_,1-x)]}};function iC(r,t,e){if(e.shapes=[],Array.isArray(r))for(let o=0,s=r.length;o<s;o++){let u=r[o];e.shapes.push(u.uuid)}else e.shapes.push(r.uuid);return e.options=Object.assign({},t),t.extrudePath!==void 0&&(e.options.extrudePath=t.extrudePath.toJSON()),e}var gl=class r extends Ei{constructor(t=new lu([new qt(0,.5),new qt(-.5,-.5),new qt(.5,-.5)]),e=12){super(),this.type="ShapeGeometry",this.parameters={shapes:t,curveSegments:e};let o=[],s=[],u=[],c=[],h=0,p=0;if(Array.isArray(t)===!1)d(t);else for(let m=0;m<t.length;m++)d(t[m]),this.addGroup(h,p,m),h+=p,p=0;this.setIndex(o),this.setAttribute("position",new Gr(s,3)),this.setAttribute("normal",new Gr(u,3)),this.setAttribute("uv",new Gr(c,2));function d(m){let y=s.length/3,v=m.extractPoints(e),E=v.shape,b=v.holes;Ms.isClockWise(E)===!1&&(E=E.reverse());for(let _=0,x=b.length;_<x;_++){let T=b[_];Ms.isClockWise(T)===!0&&(b[_]=T.reverse())}let A=Ms.triangulateShape(E,b);for(let _=0,x=b.length;_<x;_++){let T=b[_];E=E.concat(T)}for(let _=0,x=E.length;_<x;_++){let T=E[_];s.push(T.x,T.y,0),u.push(0,0,1),c.push(T.x,T.y)}for(let _=0,x=A.length;_<x;_++){let T=A[_],w=T[0]+y,R=T[1]+y,G=T[2]+y;o.push(w,R,G),p+=3}}}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}toJSON(){let t=super.toJSON(),e=this.parameters.shapes;return oC(e,t)}static fromJSON(t,e){let o=[];for(let s=0,u=t.shapes.length;s<u;s++){let c=e[t.shapes[s]];o.push(c)}return new r(o,t.curveSegments)}};function oC(r,t){if(t.shapes=[],Array.isArray(r))for(let e=0,o=r.length;e<o;e++){let s=r[e];t.shapes.push(s.uuid)}else t.shapes.push(r.uuid);return t}function bc(r,t,e){return!r||!e&&r.constructor===t?r:typeof t.BYTES_PER_ELEMENT=="number"?new t(r):Array.prototype.slice.call(r)}function sC(r){return ArrayBuffer.isView(r)&&!(r instanceof DataView)}var hu=class{constructor(t,e,o,s){this.parameterPositions=t,this._cachedIndex=0,this.resultBuffer=s!==void 0?s:new e.constructor(o),this.sampleValues=e,this.valueSize=o,this.settings=null,this.DefaultSettings_={}}evaluate(t){let e=this.parameterPositions,o=this._cachedIndex,s=e[o],u=e[o-1];n:{t:{let c;e:{r:if(!(t<s)){for(let h=o+2;;){if(s===void 0){if(t<u)break r;return o=e.length,this._cachedIndex=o,this.copySampleValue_(o-1)}if(o===h)break;if(u=s,s=e[++o],t<s)break t}c=e.length;break e}if(!(t>=u)){let h=e[1];t<h&&(o=2,u=h);for(let p=o-2;;){if(u===void 0)return this._cachedIndex=0,this.copySampleValue_(0);if(o===p)break;if(s=u,u=e[--o-1],t>=u)break t}c=o,o=0;break e}break n}for(;o<c;){let h=o+c>>>1;t<e[h]?c=h:o=h+1}if(s=e[o],u=e[o-1],u===void 0)return this._cachedIndex=0,this.copySampleValue_(0);if(s===void 0)return o=e.length,this._cachedIndex=o,this.copySampleValue_(o-1)}this._cachedIndex=o,this.intervalChanged_(o,u,s)}return this.interpolate_(o,u,t,s)}getSettings_(){return this.settings||this.DefaultSettings_}copySampleValue_(t){let e=this.resultBuffer,o=this.sampleValues,s=this.valueSize,u=t*s;for(let c=0;c!==s;++c)e[c]=o[u+c];return e}interpolate_(){throw new Error("call to abstract method")}intervalChanged_(){}},kp=class extends hu{constructor(t,e,o,s){super(t,e,o,s),this._weightPrev=-0,this._offsetPrev=-0,this._weightNext=-0,this._offsetNext=-0,this.DefaultSettings_={endingStart:Qg,endingEnd:Qg}}intervalChanged_(t,e,o){let s=this.parameterPositions,u=t-2,c=t+1,h=s[u],p=s[c];if(h===void 0)switch(this.getSettings_().endingStart){case t0:u=t,h=2*e-o;break;case e0:u=s.length-2,h=e+s[u]-s[u+1];break;default:u=t,h=o}if(p===void 0)switch(this.getSettings_().endingEnd){case t0:c=t,p=2*o-e;break;case e0:c=1,p=o+s[1]-s[0];break;default:c=t-1,p=e}let d=(o-e)*.5,m=this.valueSize;this._weightPrev=d/(e-h),this._weightNext=d/(p-o),this._offsetPrev=u*m,this._offsetNext=c*m}interpolate_(t,e,o,s){let u=this.resultBuffer,c=this.sampleValues,h=this.valueSize,p=t*h,d=p-h,m=this._offsetPrev,y=this._offsetNext,v=this._weightPrev,E=this._weightNext,b=(o-e)/(s-e),A=b*b,_=A*b,x=-v*_+2*v*A-v*b,T=(1+v)*_+(-1.5-2*v)*A+(-.5+v)*b+1,w=(-1-E)*_+(1.5+E)*A+.5*b,R=E*_-E*A;for(let G=0;G!==h;++G)u[G]=x*c[m+G]+T*c[d+G]+w*c[p+G]+R*c[y+G];return u}},Hp=class extends hu{constructor(t,e,o,s){super(t,e,o,s)}interpolate_(t,e,o,s){let u=this.resultBuffer,c=this.sampleValues,h=this.valueSize,p=t*h,d=p-h,m=(o-e)/(s-e),y=1-m;for(let v=0;v!==h;++v)u[v]=c[d+v]*y+c[p+v]*m;return u}},Vp=class extends hu{constructor(t,e,o,s){super(t,e,o,s)}interpolate_(t){return this.copySampleValue_(t-1)}},lo=class{constructor(t,e,o,s){if(t===void 0)throw new Error("THREE.KeyframeTrack: track name is undefined");if(e===void 0||e.length===0)throw new Error("THREE.KeyframeTrack: no keyframes in track named "+t);this.name=t,this.times=bc(e,this.TimeBufferType),this.values=bc(o,this.ValueBufferType),this.setInterpolation(s||this.DefaultInterpolation)}static toJSON(t){let e=t.constructor,o;if(e.toJSON!==this.toJSON)o=e.toJSON(t);else{o={name:t.name,times:bc(t.times,Array),values:bc(t.values,Array)};let s=t.getInterpolation();s!==t.DefaultInterpolation&&(o.interpolation=s)}return o.type=t.ValueTypeName,o}InterpolantFactoryMethodDiscrete(t){return new Vp(this.times,this.values,this.getValueSize(),t)}InterpolantFactoryMethodLinear(t){return new Hp(this.times,this.values,this.getValueSize(),t)}InterpolantFactoryMethodSmooth(t){return new kp(this.times,this.values,this.getValueSize(),t)}setInterpolation(t){let e;switch(t){case Tc:e=this.InterpolantFactoryMethodDiscrete;break;case Cc:e=this.InterpolantFactoryMethodLinear;break;case Sf:e=this.InterpolantFactoryMethodSmooth;break}if(e===void 0){let o="unsupported interpolation for "+this.ValueTypeName+" keyframe track named "+this.name;if(this.createInterpolant===void 0)if(t!==this.DefaultInterpolation)this.setInterpolation(this.DefaultInterpolation);else throw new Error(o);return console.warn("THREE.KeyframeTrack:",o),this}return this.createInterpolant=e,this}getInterpolation(){switch(this.createInterpolant){case this.InterpolantFactoryMethodDiscrete:return Tc;case this.InterpolantFactoryMethodLinear:return Cc;case this.InterpolantFactoryMethodSmooth:return Sf}}getValueSize(){return this.values.length/this.times.length}shift(t){if(t!==0){let e=this.times;for(let o=0,s=e.length;o!==s;++o)e[o]+=t}return this}scale(t){if(t!==1){let e=this.times;for(let o=0,s=e.length;o!==s;++o)e[o]*=t}return this}trim(t,e){let o=this.times,s=o.length,u=0,c=s-1;for(;u!==s&&o[u]<t;)++u;for(;c!==-1&&o[c]>e;)--c;if(++c,u!==0||c!==s){u>=c&&(c=Math.max(c,1),u=c-1);let h=this.getValueSize();this.times=o.slice(u,c),this.values=this.values.slice(u*h,c*h)}return this}validate(){let t=!0,e=this.getValueSize();e-Math.floor(e)!==0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),t=!1);let o=this.times,s=this.values,u=o.length;u===0&&(console.error("THREE.KeyframeTrack: Track is empty.",this),t=!1);let c=null;for(let h=0;h!==u;h++){let p=o[h];if(typeof p=="number"&&isNaN(p)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,h,p),t=!1;break}if(c!==null&&c>p){console.error("THREE.KeyframeTrack: Out of order keys.",this,h,p,c),t=!1;break}c=p}if(s!==void 0&&sC(s))for(let h=0,p=s.length;h!==p;++h){let d=s[h];if(isNaN(d)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,h,d),t=!1;break}}return t}optimize(){let t=this.times.slice(),e=this.values.slice(),o=this.getValueSize(),s=this.getInterpolation()===Sf,u=t.length-1,c=1;for(let h=1;h<u;++h){let p=!1,d=t[h],m=t[h+1];if(d!==m&&(h!==1||d!==t[0]))if(s)p=!0;else{let y=h*o,v=y-o,E=y+o;for(let b=0;b!==o;++b){let A=e[y+b];if(A!==e[v+b]||A!==e[E+b]){p=!0;break}}}if(p){if(h!==c){t[c]=t[h];let y=h*o,v=c*o;for(let E=0;E!==o;++E)e[v+E]=e[y+E]}++c}}if(u>0){t[c]=t[u];for(let h=u*o,p=c*o,d=0;d!==o;++d)e[p+d]=e[h+d];++c}return c!==t.length?(this.times=t.slice(0,c),this.values=e.slice(0,c*o)):(this.times=t,this.values=e),this}clone(){let t=this.times.slice(),e=this.values.slice(),o=this.constructor,s=new o(this.name,t,e);return s.createInterpolant=this.createInterpolant,s}};lo.prototype.TimeBufferType=Float32Array;lo.prototype.ValueBufferType=Float32Array;lo.prototype.DefaultInterpolation=Cc;var la=class extends lo{};la.prototype.ValueTypeName="bool";la.prototype.ValueBufferType=Array;la.prototype.DefaultInterpolation=Tc;la.prototype.InterpolantFactoryMethodLinear=void 0;la.prototype.InterpolantFactoryMethodSmooth=void 0;var qp=class extends lo{};qp.prototype.ValueTypeName="color";var Wp=class extends lo{};Wp.prototype.ValueTypeName="number";var Xp=class extends hu{constructor(t,e,o,s){super(t,e,o,s)}interpolate_(t,e,o,s){let u=this.resultBuffer,c=this.sampleValues,h=this.valueSize,p=(o-e)/(s-e),d=t*h;for(let m=d+h;d!==m;d+=4)Qo.slerpFlat(u,0,c,d-h,c,d,p);return u}},yl=class extends lo{InterpolantFactoryMethodLinear(t){return new Xp(this.times,this.values,this.getValueSize(),t)}};yl.prototype.ValueTypeName="quaternion";yl.prototype.DefaultInterpolation=Cc;yl.prototype.InterpolantFactoryMethodSmooth=void 0;var ca=class extends lo{};ca.prototype.ValueTypeName="string";ca.prototype.ValueBufferType=Array;ca.prototype.DefaultInterpolation=Tc;ca.prototype.InterpolantFactoryMethodLinear=void 0;ca.prototype.InterpolantFactoryMethodSmooth=void 0;var Yp=class extends lo{};Yp.prototype.ValueTypeName="vector";var Zp=class{constructor(t,e,o){let s=this,u=!1,c=0,h=0,p,d=[];this.onStart=void 0,this.onLoad=t,this.onProgress=e,this.onError=o,this.itemStart=function(m){h++,u===!1&&s.onStart!==void 0&&s.onStart(m,c,h),u=!0},this.itemEnd=function(m){c++,s.onProgress!==void 0&&s.onProgress(m,c,h),c===h&&(u=!1,s.onLoad!==void 0&&s.onLoad())},this.itemError=function(m){s.onError!==void 0&&s.onError(m)},this.resolveURL=function(m){return p?p(m):m},this.setURLModifier=function(m){return p=m,this},this.addHandler=function(m,y){return d.push(m,y),this},this.removeHandler=function(m){let y=d.indexOf(m);return y!==-1&&d.splice(y,2),this},this.getHandler=function(m){for(let y=0,v=d.length;y<v;y+=2){let E=d[y],b=d[y+1];if(E.global&&(E.lastIndex=0),E.test(m))return b}return null}}},aC=new Zp,$p=class{constructor(t){this.manager=t!==void 0?t:aC,this.crossOrigin="anonymous",this.withCredentials=!1,this.path="",this.resourcePath="",this.requestHeader={}}load(){}loadAsync(t,e){let o=this;return new Promise(function(s,u){o.load(t,s,e,u)})}parse(){}setCrossOrigin(t){return this.crossOrigin=t,this}setWithCredentials(t){return this.withCredentials=t,this}setPath(t){return this.path=t,this}setResourcePath(t){return this.resourcePath=t,this}setRequestHeader(t){return this.requestHeader=t,this}};$p.DEFAULT_MATERIAL_NAME="__DEFAULT";var nd="\\\\[\\\\]\\\\.:\\\\/",uC=new RegExp("["+nd+"]","g"),rd="[^"+nd+"]",lC="[^"+nd.replace("\\\\.","")+"]",cC=/((?:WC+[\\/:])*)/.source.replace("WC",rd),hC=/(WCOD+)?/.source.replace("WCOD",lC),fC=/(?:\\.(WC+)(?:\\[(.+)\\])?)?/.source.replace("WC",rd),pC=/\\.(WC+)(?:\\[(.+)\\])?/.source.replace("WC",rd),dC=new RegExp("^"+cC+hC+fC+pC+"$"),mC=["material","materials","bones","map"],Jp=class{constructor(t,e,o){let s=o||Vn.parseTrackName(e);this._targetGroup=t,this._bindings=t.subscribe_(e,s)}getValue(t,e){this.bind();let o=this._targetGroup.nCachedObjects_,s=this._bindings[o];s!==void 0&&s.getValue(t,e)}setValue(t,e){let o=this._bindings;for(let s=this._targetGroup.nCachedObjects_,u=o.length;s!==u;++s)o[s].setValue(t,e)}bind(){let t=this._bindings;for(let e=this._targetGroup.nCachedObjects_,o=t.length;e!==o;++e)t[e].bind()}unbind(){let t=this._bindings;for(let e=this._targetGroup.nCachedObjects_,o=t.length;e!==o;++e)t[e].unbind()}},Vn=class r{constructor(t,e,o){this.path=e,this.parsedPath=o||r.parseTrackName(e),this.node=r.findNode(t,this.parsedPath.nodeName),this.rootNode=t,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(t,e,o){return t&&t.isAnimationObjectGroup?new r.Composite(t,e,o):new r(t,e,o)}static sanitizeNodeName(t){return t.replace(/\\s/g,"_").replace(uC,"")}static parseTrackName(t){let e=dC.exec(t);if(e===null)throw new Error("PropertyBinding: Cannot parse trackName: "+t);let o={nodeName:e[2],objectName:e[3],objectIndex:e[4],propertyName:e[5],propertyIndex:e[6]},s=o.nodeName&&o.nodeName.lastIndexOf(".");if(s!==void 0&&s!==-1){let u=o.nodeName.substring(s+1);mC.indexOf(u)!==-1&&(o.nodeName=o.nodeName.substring(0,s),o.objectName=u)}if(o.propertyName===null||o.propertyName.length===0)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+t);return o}static findNode(t,e){if(e===void 0||e===""||e==="."||e===-1||e===t.name||e===t.uuid)return t;if(t.skeleton){let o=t.skeleton.getBoneByName(e);if(o!==void 0)return o}if(t.children){let o=function(u){for(let c=0;c<u.length;c++){let h=u[c];if(h.name===e||h.uuid===e)return h;let p=o(h.children);if(p)return p}return null},s=o(t.children);if(s)return s}return null}_getValue_unavailable(){}_setValue_unavailable(){}_getValue_direct(t,e){t[e]=this.targetObject[this.propertyName]}_getValue_array(t,e){let o=this.resolvedProperty;for(let s=0,u=o.length;s!==u;++s)t[e++]=o[s]}_getValue_arrayElement(t,e){t[e]=this.resolvedProperty[this.propertyIndex]}_getValue_toArray(t,e){this.resolvedProperty.toArray(t,e)}_setValue_direct(t,e){this.targetObject[this.propertyName]=t[e]}_setValue_direct_setNeedsUpdate(t,e){this.targetObject[this.propertyName]=t[e],this.targetObject.needsUpdate=!0}_setValue_direct_setMatrixWorldNeedsUpdate(t,e){this.targetObject[this.propertyName]=t[e],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_array(t,e){let o=this.resolvedProperty;for(let s=0,u=o.length;s!==u;++s)o[s]=t[e++]}_setValue_array_setNeedsUpdate(t,e){let o=this.resolvedProperty;for(let s=0,u=o.length;s!==u;++s)o[s]=t[e++];this.targetObject.needsUpdate=!0}_setValue_array_setMatrixWorldNeedsUpdate(t,e){let o=this.resolvedProperty;for(let s=0,u=o.length;s!==u;++s)o[s]=t[e++];this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_arrayElement(t,e){this.resolvedProperty[this.propertyIndex]=t[e]}_setValue_arrayElement_setNeedsUpdate(t,e){this.resolvedProperty[this.propertyIndex]=t[e],this.targetObject.needsUpdate=!0}_setValue_arrayElement_setMatrixWorldNeedsUpdate(t,e){this.resolvedProperty[this.propertyIndex]=t[e],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_fromArray(t,e){this.resolvedProperty.fromArray(t,e)}_setValue_fromArray_setNeedsUpdate(t,e){this.resolvedProperty.fromArray(t,e),this.targetObject.needsUpdate=!0}_setValue_fromArray_setMatrixWorldNeedsUpdate(t,e){this.resolvedProperty.fromArray(t,e),this.targetObject.matrixWorldNeedsUpdate=!0}_getValue_unbound(t,e){this.bind(),this.getValue(t,e)}_setValue_unbound(t,e){this.bind(),this.setValue(t,e)}bind(){let t=this.node,e=this.parsedPath,o=e.objectName,s=e.propertyName,u=e.propertyIndex;if(t||(t=r.findNode(this.rootNode,e.nodeName),this.node=t),this.getValue=this._getValue_unavailable,this.setValue=this._setValue_unavailable,!t){console.warn("THREE.PropertyBinding: No target node found for track: "+this.path+".");return}if(o){let d=e.objectIndex;switch(o){case"materials":if(!t.material){console.error("THREE.PropertyBinding: Can not bind to material as node does not have a material.",this);return}if(!t.material.materials){console.error("THREE.PropertyBinding: Can not bind to material.materials as node.material does not have a materials array.",this);return}t=t.material.materials;break;case"bones":if(!t.skeleton){console.error("THREE.PropertyBinding: Can not bind to bones as node does not have a skeleton.",this);return}t=t.skeleton.bones;for(let m=0;m<t.length;m++)if(t[m].name===d){d=m;break}break;case"map":if("map"in t){t=t.map;break}if(!t.material){console.error("THREE.PropertyBinding: Can not bind to material as node does not have a material.",this);return}if(!t.material.map){console.error("THREE.PropertyBinding: Can not bind to material.map as node.material does not have a map.",this);return}t=t.material.map;break;default:if(t[o]===void 0){console.error("THREE.PropertyBinding: Can not bind to objectName of node undefined.",this);return}t=t[o]}if(d!==void 0){if(t[d]===void 0){console.error("THREE.PropertyBinding: Trying to bind to objectIndex of objectName, but is undefined.",this,t);return}t=t[d]}}let c=t[s];if(c===void 0){let d=e.nodeName;console.error("THREE.PropertyBinding: Trying to update property for track: "+d+"."+s+" but it wasn't found.",t);return}let h=this.Versioning.None;this.targetObject=t,t.needsUpdate!==void 0?h=this.Versioning.NeedsUpdate:t.matrixWorldNeedsUpdate!==void 0&&(h=this.Versioning.MatrixWorldNeedsUpdate);let p=this.BindingType.Direct;if(u!==void 0){if(s==="morphTargetInfluences"){if(!t.geometry){console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.",this);return}if(!t.geometry.morphAttributes){console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphAttributes.",this);return}t.morphTargetDictionary[u]!==void 0&&(u=t.morphTargetDictionary[u])}p=this.BindingType.ArrayElement,this.resolvedProperty=c,this.propertyIndex=u}else c.fromArray!==void 0&&c.toArray!==void 0?(p=this.BindingType.HasFromToArray,this.resolvedProperty=c):Array.isArray(c)?(p=this.BindingType.EntireArray,this.resolvedProperty=c):this.propertyName=s;this.getValue=this.GetterByBindingType[p],this.setValue=this.SetterByBindingTypeAndVersioning[p][h]}unbind(){this.node=null,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}};Vn.Composite=Jp;Vn.prototype.BindingType={Direct:0,EntireArray:1,ArrayElement:2,HasFromToArray:3};Vn.prototype.Versioning={None:0,NeedsUpdate:1,MatrixWorldNeedsUpdate:2};Vn.prototype.GetterByBindingType=[Vn.prototype._getValue_direct,Vn.prototype._getValue_array,Vn.prototype._getValue_arrayElement,Vn.prototype._getValue_toArray];Vn.prototype.SetterByBindingTypeAndVersioning=[[Vn.prototype._setValue_direct,Vn.prototype._setValue_direct_setNeedsUpdate,Vn.prototype._setValue_direct_setMatrixWorldNeedsUpdate],[Vn.prototype._setValue_array,Vn.prototype._setValue_array_setNeedsUpdate,Vn.prototype._setValue_array_setMatrixWorldNeedsUpdate],[Vn.prototype._setValue_arrayElement,Vn.prototype._setValue_arrayElement_setNeedsUpdate,Vn.prototype._setValue_arrayElement_setMatrixWorldNeedsUpdate],[Vn.prototype._setValue_fromArray,Vn.prototype._setValue_fromArray_setNeedsUpdate,Vn.prototype._setValue_fromArray_setMatrixWorldNeedsUpdate]];var f2=new Float32Array(1);typeof __THREE_DEVTOOLS__!="undefined"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:Kp}}));typeof window!="undefined"&&(window.__THREE__?console.warn("WARNING: Multiple instances of Three.js being imported."):window.__THREE__=Kp);function pu(r,t=[]){let e=new lu(r.map(o=>new qt(...o)));return t.length&&t.forEach(o=>{var s=new uu(o.map(u=>new qt(...u)));e.holes.push(s)}),e}var Ir=63710088e-1,_2={centimeters:Ir*100,centimetres:Ir*100,degrees:Ir/111325,feet:Ir*3.28084,inches:Ir*39.37,kilometers:Ir/1e3,kilometres:Ir/1e3,meters:Ir,metres:Ir,miles:Ir/1609.344,millimeters:Ir*1e3,millimetres:Ir*1e3,nauticalmiles:Ir/1852,radians:1,yards:Ir*1.0936},x2={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/Ir,yards:1.0936133};function pi(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}function Fn(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(!So(r[0])||!So(r[1]))throw new Error("coordinates must contain numbers");var o={type:"Point",coordinates:r};return pi(o,t,e)}function Un(r,t,e){e===void 0&&(e={});for(var o=0,s=r;o<s.length;o++){var u=s[o];if(u.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");for(var c=0;c<u[u.length-1].length;c++)if(u[u.length-1][c]!==u[0][c])throw new Error("First and last Position are not equivalent.")}var h={type:"Polygon",coordinates:r};return pi(h,t,e)}function Rr(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 pi(o,t,e)}function id(r,t,e){e===void 0&&(e={});var o={type:"MultiPoint",coordinates:r};return pi(o,t,e)}function So(r){return!isNaN(r)&&r!==null&&!Array.isArray(r)}function mr(r,t,e){if(r!==null)for(var o,s,u,c,h,p,d,m=0,y=0,v,E=r.type,b=E==="FeatureCollection",A=E==="Feature",_=b?r.features.length:1,x=0;x<_;x++){d=b?r.features[x].geometry:A?r.geometry:r,v=d?d.type==="GeometryCollection":!1,h=v?d.geometries.length:1;for(var T=0;T<h;T++){var w=0,R=0;if(c=v?d.geometries[T]:d,c!==null){p=c.coordinates;var G=c.type;switch(m=e&&(G==="Polygon"||G==="MultiPolygon")?1:0,G){case null:break;case"Point":if(t(p,y,x,w,R)===!1)return!1;y++,w++;break;case"LineString":case"MultiPoint":for(o=0;o<p.length;o++){if(t(p[o],y,x,w,R)===!1)return!1;y++,G==="MultiPoint"&&w++}G==="LineString"&&w++;break;case"Polygon":case"MultiLineString":for(o=0;o<p.length;o++){for(s=0;s<p[o].length-m;s++){if(t(p[o][s],y,x,w,R)===!1)return!1;y++}G==="MultiLineString"&&w++,G==="Polygon"&&R++}G==="Polygon"&&w++;break;case"MultiPolygon":for(o=0;o<p.length;o++){for(R=0,s=0;s<p[o].length;s++){for(u=0;u<p[o][s].length-m;u++){if(t(p[o][s][u],y,x,w,R)===!1)return!1;y++}R++}w++}break;case"GeometryCollection":for(o=0;o<c.geometries.length;o++)if(mr(c.geometries[o],t,e)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function Ey(r,t,e,o){var s=e;return mr(r,function(u,c,h,p,d){c===0&&e===void 0?s=u:s=t(s,u,c,h,p,d)},o),s}function As(r,t){var e,o,s,u,c,h,p,d,m,y,v=0,E=r.type==="FeatureCollection",b=r.type==="Feature",A=E?r.features.length:1;for(e=0;e<A;e++){for(h=E?r.features[e].geometry:b?r.geometry:r,d=E?r.features[e].properties:b?r.properties:{},m=E?r.features[e].bbox:b?r.bbox:void 0,y=E?r.features[e].id:b?r.id:void 0,p=h?h.type==="GeometryCollection":!1,c=p?h.geometries.length:1,s=0;s<c;s++){if(u=p?h.geometries[s]:h,u===null){if(t(null,v,d,m,y)===!1)return!1;continue}switch(u.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":{if(t(u,v,d,m,y)===!1)return!1;break}case"GeometryCollection":{for(o=0;o<u.geometries.length;o++)if(t(u.geometries[o],v,d,m,y)===!1)return!1;break}default:throw new Error("Unknown Geometry Type")}}v++}}function Ni(r,t){As(r,function(e,o,s,u,c){var h=e===null?null:e.type;switch(h){case null:case"Point":case"LineString":case"Polygon":return t(pi(e,s,{bbox:u,id:c}),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 m=e.coordinates[d],y={type:p,coordinates:m};if(t(pi(y,s),o,d)===!1)return!1}})}function od(r){var t=[1/0,1/0,-1/0,-1/0];return mr(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}od.default=od;var di=od;function kr(r){if(!r)throw new Error("coord is required");if(!Array.isArray(r)){if(r.type==="Feature"&&r.geometry!==null&&r.geometry.type==="Point")return r.geometry.coordinates;if(r.type==="Point")return r.coordinates}if(Array.isArray(r)&&r.length>=2&&!Array.isArray(r[0])&&!Array.isArray(r[1]))return r;throw new Error("coord must be GeoJSON Point or an Array of numbers")}function sd(r,t,e){if(!r)throw new Error("No feature passed");if(!e)throw new Error(".featureOf() requires a name");if(!r||r.type!=="Feature"||!r.geometry)throw new Error("Invalid input to "+e+", Feature with geometry required");if(!r.geometry||r.geometry.type!==t)throw new Error("Invalid input to "+e+": must be a "+t+", given "+r.geometry.type)}function Hr(r){return r.type==="Feature"?r.geometry:r}var wC=tr(nh(),1);var NC=tr(zy(),1);function Lr(r,t,e){if(e===void 0&&(e={}),!r)throw new Error("point is required");if(!t)throw new Error("polygon is required");var o=kr(r),s=Hr(t),u=s.type,c=t.bbox,h=s.coordinates;if(c&&OC(o,c)===!1)return!1;u==="Polygon"&&(h=[h]);for(var p=!1,d=0;d<h.length&&!p;d++)if(Gy(o,h[d][0],e.ignoreBoundary)){for(var m=!1,y=1;y<h[d].length&&!m;)Gy(o,h[d][y],!e.ignoreBoundary)&&(m=!0),y++;m||(p=!0)}return p}function Gy(r,t,e){var o=!1;t[0][0]===t[t.length-1][0]&&t[0][1]===t[t.length-1][1]&&(t=t.slice(0,t.length-1));for(var s=0,u=t.length-1;s<t.length;u=s++){var c=t[s][0],h=t[s][1],p=t[u][0],d=t[u][1],m=r[1]*(c-p)+h*(p-r[0])+d*(r[0]-c)===0&&(c-r[0])*(p-r[0])<=0&&(h-r[1])*(d-r[1])<=0;if(m)return!e;var y=h>r[1]!=d>r[1]&&r[0]<(p-c)*(r[1]-h)/(d-h)+c;y&&(o=!o)}return o}function OC(r,t){return t[0]<=r[0]&&t[1]<=r[1]&&t[2]>=r[0]&&t[3]>=r[1]}var Vy=new ArrayBuffer(16),$O=new Float64Array(Vy),JO=new Uint32Array(Vy);var $C=tr(Md(),1);var M3=function(){function r(t){this.points=t.points||[],this.duration=t.duration||1e4,this.sharpness=t.sharpness||.85,this.centers=[],this.controls=[],this.stepLength=t.stepLength||60,this.length=this.points.length,this.delay=0;for(var e=0;e<this.length;e++)this.points[e].z=this.points[e].z||0;for(var e=0;e<this.length-1;e++){var o=this.points[e],s=this.points[e+1];this.centers.push({x:(o.x+s.x)/2,y:(o.y+s.y)/2,z:(o.z+s.z)/2})}this.controls.push([this.points[0],this.points[0]]);for(var e=0;e<this.centers.length-1;e++){var u=this.points[e+1].x-(this.centers[e].x+this.centers[e+1].x)/2,c=this.points[e+1].y-(this.centers[e].y+this.centers[e+1].y)/2,h=this.points[e+1].z-(this.centers[e].y+this.centers[e+1].z)/2;this.controls.push([{x:(1-this.sharpness)*this.points[e+1].x+this.sharpness*(this.centers[e].x+u),y:(1-this.sharpness)*this.points[e+1].y+this.sharpness*(this.centers[e].y+c),z:(1-this.sharpness)*this.points[e+1].z+this.sharpness*(this.centers[e].z+h)},{x:(1-this.sharpness)*this.points[e+1].x+this.sharpness*(this.centers[e+1].x+u),y:(1-this.sharpness)*this.points[e+1].y+this.sharpness*(this.centers[e+1].y+c),z:(1-this.sharpness)*this.points[e+1].z+this.sharpness*(this.centers[e+1].z+h)}])}return this.controls.push([this.points[this.length-1],this.points[this.length-1]]),this.steps=this.cacheSteps(this.stepLength),this}return r.prototype.cacheSteps=function(t){var e=[],o=this.pos(0);e.push(0);for(var s=0;s<this.duration;s+=10){var u=this.pos(s),c=Math.sqrt((u.x-o.x)*(u.x-o.x)+(u.y-o.y)*(u.y-o.y)+(u.z-o.z)*(u.z-o.z));c>t&&(e.push(s),o=u)}return e},r.prototype.vector=function(t){var e=this.pos(t+10),o=this.pos(t-10);return{angle:180*Math.atan2(e.y-o.y,e.x-o.x)/3.14,speed:Math.sqrt((o.x-e.x)*(o.x-e.x)+(o.y-e.y)*(o.y-e.y)+(o.z-e.z)*(o.z-e.z))}},r.prototype.pos=function(t){var e=t-this.delay;e<0&&(e=0),e>this.duration&&(e=this.duration-1);var o=e/this.duration;if(o>=1)return this.points[this.length-1];var s=Math.floor((this.points.length-1)*o),u=(this.length-1)*o-s;return JC(u,this.points[s],this.controls[s][1],this.controls[s+1][0],this.points[s+1])},r}();function JC(r,t,e,o,s){var u=KC(r),c={x:s.x*u[0]+o.x*u[1]+e.x*u[2]+t.x*u[3],y:s.y*u[0]+o.y*u[1]+e.y*u[2]+t.y*u[3],z:s.z*u[0]+o.z*u[1]+e.z*u[2]+t.z*u[3]};return c}function KC(r){var t=r*r,e=t*r;return[e,3*t*(1-r),3*r*(1-r)*(1-r),(1-r)*(1-r)*(1-r)]}function El(r,t){t===void 0&&(t={});var e=Number(r[0]),o=Number(r[1]),s=Number(r[2]),u=Number(r[3]);if(r.length===6)throw new Error("@turf/bbox-polygon does not support BBox with 6 positions");var c=[e,o],h=[e,u],p=[s,u],d=[s,o];return Un([[c,d,p,h,c]],t.properties,{bbox:r,id:t.id})}function jC(r){return El(di(r))}var wd=jC;var mP=tr(tv(),1);var HP=tr(_h(),1);var qP=tr(nh(),1);var YP=tr(Md(),1);var vv=Math.PI/180,_v=180/Math.PI,Cl=function(r,t){this.lon=r,this.lat=t,this.x=vv*r,this.y=vv*t};Cl.prototype.view=function(){return String(this.lon).slice(0,4)+","+String(this.lat).slice(0,4)};Cl.prototype.antipode=function(){var r=-1*this.lat,t=this.lon<0?180+this.lon:(180-this.lon)*-1;return new Cl(t,r)};var xv=function(){this.coords=[],this.length=0};xv.prototype.move_to=function(r){this.length++,this.coords.push(r)};var Vd=function(r){this.properties=r||{},this.geometries=[]};Vd.prototype.json=function(){if(this.geometries.length<=0)return{geometry:{type:"LineString",coordinates:null},type:"Feature",properties:this.properties};if(this.geometries.length===1)return{geometry:{type:"LineString",coordinates:this.geometries[0].coords},type:"Feature",properties:this.properties};for(var r=[],t=0;t<this.geometries.length;t++)r.push(this.geometries[t].coords);return{geometry:{type:"MultiLineString",coordinates:r},type:"Feature",properties:this.properties}};Vd.prototype.wkt=function(){for(var r="",t="LINESTRING(",e=function(u){t+=u[0]+" "+u[1]+","},o=0;o<this.geometries.length;o++){if(this.geometries[o].coords.length===0)return"LINESTRING(empty)";var s=this.geometries[o].coords;s.forEach(e),r+=t.substring(0,t.length-1)+")"}return r};var Ev=function(r,t,e){if(!r||r.x===void 0||r.y===void 0)throw new Error("GreatCircle constructor expects two args: start and end objects with x and y properties");if(!t||t.x===void 0||t.y===void 0)throw new Error("GreatCircle constructor expects two args: start and end objects with x and y properties");this.start=new Cl(r.x,r.y),this.end=new Cl(t.x,t.y),this.properties=e||{};var o=this.start.x-this.end.x,s=this.start.y-this.end.y,u=Math.pow(Math.sin(s/2),2)+Math.cos(this.start.y)*Math.cos(this.end.y)*Math.pow(Math.sin(o/2),2);if(this.g=2*Math.asin(Math.sqrt(u)),this.g===Math.PI)throw new Error("it appears "+r.view()+" and "+t.view()+" are 'antipodal', e.g diametrically opposite, thus there is no single route but rather infinite");if(isNaN(this.g))throw new Error("could not calculate great circle between "+r+" and "+t)};Ev.prototype.interpolate=function(r){var t=Math.sin((1-r)*this.g)/Math.sin(this.g),e=Math.sin(r*this.g)/Math.sin(this.g),o=t*Math.cos(this.start.y)*Math.cos(this.start.x)+e*Math.cos(this.end.y)*Math.cos(this.end.x),s=t*Math.cos(this.start.y)*Math.sin(this.start.x)+e*Math.cos(this.end.y)*Math.sin(this.end.x),u=t*Math.sin(this.start.y)+e*Math.sin(this.end.y),c=_v*Math.atan2(u,Math.sqrt(Math.pow(o,2)+Math.pow(s,2))),h=_v*Math.atan2(s,o);return[h,c]};Ev.prototype.Arc=function(r,t){var e=[];if(!r||r<=2)e.push([this.start.lon,this.start.lat]),e.push([this.end.lon,this.end.lat]);else for(var o=1/(r-1),s=0;s<r;++s){var u=o*s,c=this.interpolate(u);e.push(c)}for(var h=!1,p=0,d=t&&t.offset?t.offset:10,m=180-d,y=-180+d,v=360-d,E=1;E<e.length;++E){var b=e[E-1][0],A=e[E][0],_=Math.abs(A-b);_>v&&(A>m&&b<y||b>m&&A<y)?h=!0:_>p&&(p=_)}var x=[];if(h&&p<d){var T=[];x.push(T);for(var w=0;w<e.length;++w){var R=parseFloat(e[w][0]);if(w>0&&Math.abs(R-e[w-1][0])>v){var G=parseFloat(e[w-1][0]),z=parseFloat(e[w-1][1]),F=parseFloat(e[w][0]),I=parseFloat(e[w][1]);if(G>-180&&G<y&&F===180&&w+1<e.length&&e[w-1][0]>-180&&e[w-1][0]<y){T.push([-180,e[w][1]]),w++,T.push([e[w][0],e[w][1]]);continue}else if(G>m&&G<180&&F===-180&&w+1<e.length&&e[w-1][0]>m&&e[w-1][0]<180){T.push([180,e[w][1]]),w++,T.push([e[w][0],e[w][1]]);continue}if(G<y&&F>m){var lt=G;G=F,F=lt;var L=z;z=I,I=L}if(G>m&&F<y&&(F+=360),G<=180&&F>=180&&G<F){var W=(180-G)/(F-G),V=W*I+(1-W)*z;T.push([e[w-1][0]>m?180:-180,V]),T=[],T.push([e[w-1][0]>m?-180:180,V]),x.push(T)}else T=[],x.push(T);T.push([R,e[w][1]])}else T.push([e[w][0],e[w][1]])}}else{var wt=[];x.push(wt);for(var Y=0;Y<e.length;++Y)wt.push([e[Y][0],e[Y][1]])}for(var dt=new Vd(this.properties),ct=0;ct<x.length;++ct){var yt=new xv;dt.geometries.push(yt);for(var rt=x[ct],ut=0;ut<rt.length;++ut)yt.move_to(rt[ut])}return dt};var JP=tr(_h(),1);var $R=tr(_h(),1);var JR=tr(ym(),1);var QR=tr(nh(),1);var Ae=[],Te=[],Ce=[],Pe=[],Ie=[],Re=[],Le=[],Ne=[],Oe=[],De=[],Fe=[],Ue=[],Be=[],ze=[],Ge=[],ke=[],He=[],Ve=[],qe=[],We=[],Xe=[],Ye=[],Ze=[],$e=[];Le[85]=De[85]=-1;Ne[85]=Fe[85]=0;Oe[85]=Ue[85]=1;qe[85]=Ye[85]=1;We[85]=Ze[85]=0;Xe[85]=$e[85]=1;Ae[85]=Pe[85]=0;Te[85]=Ie[85]=-1;Ce[85]=Ge[85]=0;ke[85]=Be[85]=0;He[85]=ze[85]=1;Re[85]=Ve[85]=1;Ye[1]=Ye[169]=0;Ze[1]=Ze[169]=-1;$e[1]=$e[169]=0;Be[1]=Be[169]=-1;ze[1]=ze[169]=0;Ge[1]=Ge[169]=0;De[4]=De[166]=0;Fe[4]=Fe[166]=-1;Ue[4]=Ue[166]=1;ke[4]=ke[166]=1;He[4]=He[166]=0;Ve[4]=Ve[166]=0;Le[16]=Le[154]=0;Ne[16]=Ne[154]=1;Oe[16]=Oe[154]=1;Pe[16]=Pe[154]=1;Ie[16]=Ie[154]=0;Re[16]=Re[154]=1;qe[64]=qe[106]=0;We[64]=We[106]=1;Xe[64]=Xe[106]=0;Ae[64]=Ae[106]=-1;Te[64]=Te[106]=0;Ce[64]=Ce[106]=1;qe[2]=qe[168]=0;We[2]=We[168]=-1;Xe[2]=Xe[168]=1;Ye[2]=Ye[168]=0;Ze[2]=Ze[168]=-1;$e[2]=$e[168]=0;Be[2]=Be[168]=-1;ze[2]=ze[168]=0;Ge[2]=Ge[168]=0;ke[2]=ke[168]=-1;He[2]=He[168]=0;Ve[2]=Ve[168]=1;Le[8]=Le[162]=0;Ne[8]=Ne[162]=-1;Oe[8]=Oe[162]=0;De[8]=De[162]=0;Fe[8]=Fe[162]=-1;Ue[8]=Ue[162]=1;Be[8]=Be[162]=1;ze[8]=ze[162]=0;Ge[8]=Ge[162]=1;ke[8]=ke[162]=1;He[8]=He[162]=0;Ve[8]=Ve[162]=0;Le[32]=Le[138]=0;Ne[32]=Ne[138]=1;Oe[32]=Oe[138]=1;De[32]=De[138]=0;Fe[32]=Fe[138]=1;Ue[32]=Ue[138]=0;Ae[32]=Ae[138]=1;Te[32]=Te[138]=0;Ce[32]=Ce[138]=0;Pe[32]=Pe[138]=1;Ie[32]=Ie[138]=0;Re[32]=Re[138]=1;Ye[128]=Ye[42]=0;Ze[128]=Ze[42]=1;$e[128]=$e[42]=1;qe[128]=qe[42]=0;We[128]=We[42]=1;Xe[128]=Xe[42]=0;Ae[128]=Ae[42]=-1;Te[128]=Te[42]=0;Ce[128]=Ce[42]=1;Pe[128]=Pe[42]=-1;Ie[128]=Ie[42]=0;Re[128]=Re[42]=0;De[5]=De[165]=-1;Fe[5]=Fe[165]=0;Ue[5]=Ue[165]=0;Ye[5]=Ye[165]=1;Ze[5]=Ze[165]=0;$e[5]=$e[165]=0;ke[20]=ke[150]=0;He[20]=He[150]=1;Ve[20]=Ve[150]=1;Pe[20]=Pe[150]=0;Ie[20]=Ie[150]=-1;Re[20]=Re[150]=1;Le[80]=Le[90]=-1;Ne[80]=Ne[90]=0;Oe[80]=Oe[90]=1;qe[80]=qe[90]=1;We[80]=We[90]=0;Xe[80]=Xe[90]=1;Be[65]=Be[105]=0;ze[65]=ze[105]=1;Ge[65]=Ge[105]=0;Ae[65]=Ae[105]=0;Te[65]=Te[105]=-1;Ce[65]=Ce[105]=0;Le[160]=Le[10]=-1;Ne[160]=Ne[10]=0;Oe[160]=Oe[10]=1;De[160]=De[10]=-1;Fe[160]=Fe[10]=0;Ue[160]=Ue[10]=0;Ye[160]=Ye[10]=1;Ze[160]=Ze[10]=0;$e[160]=$e[10]=0;qe[160]=qe[10]=1;We[160]=We[10]=0;Xe[160]=Xe[10]=1;ke[130]=ke[40]=0;He[130]=He[40]=1;Ve[130]=Ve[40]=1;Be[130]=Be[40]=0;ze[130]=ze[40]=1;Ge[130]=Ge[40]=0;Ae[130]=Ae[40]=0;Te[130]=Te[40]=-1;Ce[130]=Ce[40]=0;Pe[130]=Pe[40]=0;Ie[130]=Ie[40]=-1;Re[130]=Re[40]=1;De[37]=De[133]=0;Fe[37]=Fe[133]=1;Ue[37]=Ue[133]=1;Ye[37]=Ye[133]=0;Ze[37]=Ze[133]=1;$e[37]=$e[133]=0;Ae[37]=Ae[133]=-1;Te[37]=Te[133]=0;Ce[37]=Ce[133]=0;Pe[37]=Pe[133]=1;Ie[37]=Ie[133]=0;Re[37]=Re[133]=0;ke[148]=ke[22]=-1;He[148]=He[22]=0;Ve[148]=Ve[22]=0;Ye[148]=Ye[22]=0;Ze[148]=Ze[22]=-1;$e[148]=$e[22]=1;qe[148]=qe[22]=0;We[148]=We[22]=1;Xe[148]=Xe[22]=1;Pe[148]=Pe[22]=-1;Ie[148]=Ie[22]=0;Re[148]=Re[22]=1;Le[82]=Le[88]=0;Ne[82]=Ne[88]=-1;Oe[82]=Oe[88]=1;ke[82]=ke[88]=1;He[82]=He[88]=0;Ve[82]=Ve[88]=1;Be[82]=Be[88]=-1;ze[82]=ze[88]=0;Ge[82]=Ge[88]=1;qe[82]=qe[88]=0;We[82]=We[88]=-1;Xe[82]=Xe[88]=0;Le[73]=Le[97]=0;Ne[73]=Ne[97]=1;Oe[73]=Oe[97]=0;De[73]=De[97]=0;Fe[73]=Fe[97]=-1;Ue[73]=Ue[97]=0;Be[73]=Be[97]=1;ze[73]=ze[97]=0;Ge[73]=Ge[97]=0;Ae[73]=Ae[97]=1;Te[73]=Te[97]=0;Ce[73]=Ce[97]=1;Le[145]=Le[25]=0;Ne[145]=Ne[25]=-1;Oe[145]=Oe[25]=0;Be[145]=Be[25]=1;ze[145]=ze[25]=0;Ge[145]=Ge[25]=1;Ye[145]=Ye[25]=0;Ze[145]=Ze[25]=1;$e[145]=$e[25]=1;Pe[145]=Pe[25]=-1;Ie[145]=Ie[25]=0;Re[145]=Re[25]=0;De[70]=De[100]=0;Fe[70]=Fe[100]=1;Ue[70]=Ue[100]=0;ke[70]=ke[100]=-1;He[70]=He[100]=0;Ve[70]=Ve[100]=1;qe[70]=qe[100]=0;We[70]=We[100]=-1;Xe[70]=Xe[100]=1;Ae[70]=Ae[100]=1;Te[70]=Te[100]=0;Ce[70]=Ce[100]=0;De[101]=De[69]=0;Fe[101]=Fe[69]=1;Ue[101]=Ue[69]=0;Ae[101]=Ae[69]=1;Te[101]=Te[69]=0;Ce[101]=Ce[69]=0;Ye[149]=Ye[21]=0;Ze[149]=Ze[21]=1;$e[149]=$e[21]=1;Pe[149]=Pe[21]=-1;Ie[149]=Ie[21]=0;Re[149]=Re[21]=0;ke[86]=ke[84]=-1;He[86]=He[84]=0;Ve[86]=Ve[84]=1;qe[86]=qe[84]=0;We[86]=We[84]=-1;Xe[86]=Xe[84]=1;Le[89]=Le[81]=0;Ne[89]=Ne[81]=-1;Oe[89]=Oe[81]=0;Be[89]=Be[81]=1;ze[89]=ze[81]=0;Ge[89]=Ge[81]=1;Le[96]=Le[74]=0;Ne[96]=Ne[74]=1;Oe[96]=Oe[74]=0;De[96]=De[74]=-1;Fe[96]=Fe[74]=0;Ue[96]=Ue[74]=1;qe[96]=qe[74]=1;We[96]=We[74]=0;Xe[96]=Xe[74]=0;Ae[96]=Ae[74]=1;Te[96]=Te[74]=0;Ce[96]=Ce[74]=1;Le[24]=Le[146]=0;Ne[24]=Ne[146]=-1;Oe[24]=Oe[146]=1;ke[24]=ke[146]=1;He[24]=He[146]=0;Ve[24]=Ve[146]=1;Be[24]=Be[146]=0;ze[24]=ze[146]=1;Ge[24]=Ge[146]=1;Pe[24]=Pe[146]=0;Ie[24]=Ie[146]=-1;Re[24]=Re[146]=0;De[6]=De[164]=-1;Fe[6]=Fe[164]=0;Ue[6]=Ue[164]=1;ke[6]=ke[164]=-1;He[6]=He[164]=0;Ve[6]=Ve[164]=0;Ye[6]=Ye[164]=0;Ze[6]=Ze[164]=-1;$e[6]=$e[164]=1;qe[6]=qe[164]=1;We[6]=We[164]=0;Xe[6]=Xe[164]=0;Be[129]=Be[41]=0;ze[129]=ze[41]=1;Ge[129]=Ge[41]=1;Ye[129]=Ye[41]=0;Ze[129]=Ze[41]=1;$e[129]=$e[41]=0;Ae[129]=Ae[41]=-1;Te[129]=Te[41]=0;Ce[129]=Ce[41]=0;Pe[129]=Pe[41]=0;Ie[129]=Ie[41]=-1;Re[129]=Re[41]=0;ke[66]=ke[104]=0;He[66]=He[104]=1;Ve[66]=Ve[104]=0;Be[66]=Be[104]=-1;ze[66]=ze[104]=0;Ge[66]=Ge[104]=1;qe[66]=qe[104]=0;We[66]=We[104]=-1;Xe[66]=Xe[104]=0;Ae[66]=Ae[104]=0;Te[66]=Te[104]=-1;Ce[66]=Ce[104]=1;Le[144]=Le[26]=-1;Ne[144]=Ne[26]=0;Oe[144]=Oe[26]=0;Ye[144]=Ye[26]=1;Ze[144]=Ze[26]=0;$e[144]=$e[26]=1;qe[144]=qe[26]=0;We[144]=We[26]=1;Xe[144]=Xe[26]=1;Pe[144]=Pe[26]=-1;Ie[144]=Ie[26]=0;Re[144]=Re[26]=1;De[36]=De[134]=0;Fe[36]=Fe[134]=1;Ue[36]=Ue[134]=1;ke[36]=ke[134]=0;He[36]=He[134]=1;Ve[36]=Ve[134]=0;Ae[36]=Ae[134]=0;Te[36]=Te[134]=-1;Ce[36]=Ce[134]=1;Pe[36]=Pe[134]=1;Ie[36]=Ie[134]=0;Re[36]=Re[134]=0;Le[9]=Le[161]=-1;Ne[9]=Ne[161]=0;Oe[9]=Oe[161]=0;De[9]=De[161]=0;Fe[9]=Fe[161]=-1;Ue[9]=Ue[161]=0;Be[9]=Be[161]=1;ze[9]=ze[161]=0;Ge[9]=Ge[161]=0;Ye[9]=Ye[161]=1;Ze[9]=Ze[161]=0;$e[9]=$e[161]=1;Le[136]=0;Ne[136]=1;Oe[136]=1;De[136]=0;Fe[136]=1;Ue[136]=0;ke[136]=-1;He[136]=0;Ve[136]=1;Be[136]=-1;ze[136]=0;Ge[136]=0;Ye[136]=0;Ze[136]=-1;$e[136]=0;qe[136]=0;We[136]=-1;Xe[136]=1;Ae[136]=1;Te[136]=0;Ce[136]=0;Pe[136]=1;Ie[136]=0;Re[136]=1;Le[34]=0;Ne[34]=-1;Oe[34]=0;De[34]=0;Fe[34]=-1;Ue[34]=1;ke[34]=1;He[34]=0;Ve[34]=0;Be[34]=1;ze[34]=0;Ge[34]=1;Ye[34]=0;Ze[34]=1;$e[34]=1;qe[34]=0;We[34]=1;Xe[34]=0;Ae[34]=-1;Te[34]=0;Ce[34]=1;Pe[34]=-1;Ie[34]=0;Re[34]=0;Le[35]=0;Ne[35]=1;Oe[35]=1;De[35]=0;Fe[35]=-1;Ue[35]=1;ke[35]=1;He[35]=0;Ve[35]=0;Be[35]=-1;ze[35]=0;Ge[35]=0;Ye[35]=0;Ze[35]=-1;$e[35]=0;qe[35]=0;We[35]=1;Xe[35]=0;Ae[35]=-1;Te[35]=0;Ce[35]=1;Pe[35]=1;Ie[35]=0;Re[35]=1;Le[153]=0;Ne[153]=1;Oe[153]=1;Be[153]=-1;ze[153]=0;Ge[153]=0;Ye[153]=0;Ze[153]=-1;$e[153]=0;Pe[153]=1;Ie[153]=0;Re[153]=1;De[102]=0;Fe[102]=-1;Ue[102]=1;ke[102]=1;He[102]=0;Ve[102]=0;qe[102]=0;We[102]=1;Xe[102]=0;Ae[102]=-1;Te[102]=0;Ce[102]=1;Le[155]=0;Ne[155]=-1;Oe[155]=0;Be[155]=1;ze[155]=0;Ge[155]=1;Ye[155]=0;Ze[155]=1;$e[155]=1;Pe[155]=-1;Ie[155]=0;Re[155]=0;De[103]=0;Fe[103]=1;Ue[103]=0;ke[103]=-1;He[103]=0;Ve[103]=1;qe[103]=0;We[103]=-1;Xe[103]=1;Ae[103]=1;Te[103]=0;Ce[103]=0;Le[152]=0;Ne[152]=1;Oe[152]=1;ke[152]=-1;He[152]=0;Ve[152]=1;Be[152]=-1;ze[152]=0;Ge[152]=0;Ye[152]=0;Ze[152]=-1;$e[152]=0;qe[152]=0;We[152]=-1;Xe[152]=1;Pe[152]=1;Ie[152]=0;Re[152]=1;Le[156]=0;Ne[156]=-1;Oe[156]=1;ke[156]=1;He[156]=0;Ve[156]=1;Be[156]=-1;ze[156]=0;Ge[156]=0;Ye[156]=0;Ze[156]=-1;$e[156]=0;qe[156]=0;We[156]=1;Xe[156]=1;Pe[156]=-1;Ie[156]=0;Re[156]=1;Le[137]=0;Ne[137]=1;Oe[137]=1;De[137]=0;Fe[137]=1;Ue[137]=0;Be[137]=-1;ze[137]=0;Ge[137]=0;Ye[137]=0;Ze[137]=-1;$e[137]=0;Ae[137]=1;Te[137]=0;Ce[137]=0;Pe[137]=1;Ie[137]=0;Re[137]=1;Le[139]=0;Ne[139]=1;Oe[139]=1;De[139]=0;Fe[139]=-1;Ue[139]=0;Be[139]=1;ze[139]=0;Ge[139]=0;Ye[139]=0;Ze[139]=1;$e[139]=0;Ae[139]=-1;Te[139]=0;Ce[139]=0;Pe[139]=1;Ie[139]=0;Re[139]=1;Le[98]=0;Ne[98]=-1;Oe[98]=0;De[98]=0;Fe[98]=-1;Ue[98]=1;ke[98]=1;He[98]=0;Ve[98]=0;Be[98]=1;ze[98]=0;Ge[98]=1;qe[98]=0;We[98]=1;Xe[98]=0;Ae[98]=-1;Te[98]=0;Ce[98]=1;Le[99]=0;Ne[99]=1;Oe[99]=0;De[99]=0;Fe[99]=-1;Ue[99]=1;ke[99]=1;He[99]=0;Ve[99]=0;Be[99]=-1;ze[99]=0;Ge[99]=1;qe[99]=0;We[99]=-1;Xe[99]=0;Ae[99]=1;Te[99]=0;Ce[99]=1;De[38]=0;Fe[38]=-1;Ue[38]=1;ke[38]=1;He[38]=0;Ve[38]=0;Ye[38]=0;Ze[38]=1;$e[38]=1;qe[38]=0;We[38]=1;Xe[38]=0;Ae[38]=-1;Te[38]=0;Ce[38]=1;Pe[38]=-1;Ie[38]=0;Re[38]=0;De[39]=0;Fe[39]=1;Ue[39]=1;ke[39]=-1;He[39]=0;Ve[39]=0;Ye[39]=0;Ze[39]=-1;$e[39]=1;qe[39]=0;We[39]=1;Xe[39]=0;Ae[39]=-1;Te[39]=0;Ce[39]=1;Pe[39]=1;Ie[39]=0;Re[39]=0;var vm=function(r){return[[r.bottomleft,0],[0,0],[0,r.leftbottom]]},_m=function(r){return[[1,r.rightbottom],[1,0],[r.bottomright,0]]},xm=function(r){return[[r.topright,1],[1,1],[1,r.righttop]]},Em=function(r){return[[0,r.lefttop],[0,1],[r.topleft,1]]},Mm=function(r){return[[r.bottomright,0],[r.bottomleft,0],[0,r.leftbottom],[0,r.lefttop]]},wm=function(r){return[[r.bottomright,0],[r.bottomleft,0],[1,r.righttop],[1,r.rightbottom]]},Sm=function(r){return[[1,r.righttop],[1,r.rightbottom],[r.topleft,1],[r.topright,1]]},bm=function(r){return[[0,r.leftbottom],[0,r.lefttop],[r.topleft,1],[r.topright,1]]},tL=function(r){return[[0,0],[0,r.leftbottom],[1,r.rightbottom],[1,0]]},eL=function(r){return[[1,0],[r.bottomright,0],[r.topright,1],[1,1]]},nL=function(r){return[[1,1],[1,r.righttop],[0,r.lefttop],[0,1]]},rL=function(r){return[[r.bottomleft,0],[0,0],[0,1],[r.topleft,1]]},iL=function(r){return[[1,r.righttop],[1,r.rightbottom],[0,r.leftbottom],[0,r.lefttop]]},oL=function(r){return[[r.topleft,1],[r.topright,1],[r.bottomright,0],[r.bottomleft,0]]},sL=function(){return[[0,0],[0,1],[1,1],[1,0]]},aL=function(r){return[[1,r.rightbottom],[1,0],[0,0],[0,1],[r.topleft,1]]},uL=function(r){return[[r.topright,1],[1,1],[1,0],[0,0],[0,r.leftbottom]]},lL=function(r){return[[1,0],[r.bottomright,0],[0,r.lefttop],[0,1],[1,1]]},cL=function(r){return[[1,1],[1,r.righttop],[r.bottomleft,0],[0,0],[0,1]]},hL=function(r){return[[1,r.righttop],[1,r.rightbottom],[0,r.lefttop],[0,1],[r.topleft,1]]},fL=function(r){return[[1,1],[1,r.righttop],[r.bottomright,0],[r.bottomleft,0],[r.topright,1]]},pL=function(r){return[[1,r.rightbottom],[1,0],[r.bottomright,0],[0,r.leftbottom],[0,r.lefttop]]},dL=function(r){return[[r.topright,1],[r.bottomleft,0],[0,0],[0,r.leftbottom],[r.topleft,1]]},mL=function(r){return[[r.bottomright,0],[r.bottomleft,0],[0,r.lefttop],[0,1],[r.topleft,1]]},gL=function(r){return[[1,1],[1,r.righttop],[0,r.leftbottom],[0,r.lefttop],[r.topright,1]]},yL=function(r){return[[1,r.rightbottom],[1,0],[r.bottomright,0],[r.topleft,1],[r.topright,1]]},vL=function(r){return[[1,r.righttop],[1,r.rightbottom],[r.bottomleft,0],[0,0],[0,r.leftbottom]]},_L=function(r){return[[1,r.rightbottom],[1,0],[0,0],[0,r.leftbottom],[r.topleft,1],[r.topright,1]]},xL=function(r){return[[1,1],[1,0],[r.bottomright,0],[0,r.leftbottom],[0,r.lefttop],[r.topright,1]]},EL=function(r){return[[1,1],[1,r.righttop],[r.bottomright,0],[r.bottomleft,0],[0,r.lefttop],[0,1]]},ML=function(r){return[[1,r.righttop],[1,r.rightbottom],[r.bottomleft,0],[0,0],[0,1],[r.topleft,1]]},wL=function(r){return[[1,1],[1,r.righttop],[r.bottomleft,0],[0,0],[0,r.leftbottom],[r.topright,1]]},SL=function(r){return[[1,r.rightbottom],[1,0],[r.bottomright,0],[0,r.lefttop],[0,1],[r.topleft,1]]},bL=function(r){return[[1,r.righttop],[1,r.rightbottom],[r.bottomright,0],[r.bottomleft,0],[0,r.leftbottom],[0,r.lefttop],[r.topleft,1],[r.topright,1]]},AL=function(r){return[[1,1],[1,r.righttop],[r.bottomleft,0],[0,0],[0,r.leftbottom],[r.topright,1]]},TL=function(r){return[[1,r.rightbottom],[1,0],[r.bottomright,0],[0,r.lefttop],[0,1],[r.topleft,1]]},CL=function(r){return[[1,1],[1,r.righttop],[r.bottomright,0],[r.bottomleft,0],[0,r.leftbottom],[0,r.lefttop],[r.topright,1]]},PL=function(r){return[[1,r.righttop],[1,r.rightbottom],[r.bottomleft,0],[0,0],[0,r.leftbottom],[r.topleft,1],[r.topright,1]]},IL=function(r){return[[1,r.righttop],[1,r.rightbottom],[r.bottomright,0],[r.bottomleft,0],[0,r.lefttop],[0,1],[r.topleft,1]]},RL=function(r){return[[1,r.rightbottom],[1,0],[r.bottomright,0],[0,r.leftbottom],[0,r.lefttop],[r.topleft,1],[r.topright,1]]},Qe=[],tn=[],en=[],nn=[],rn=[],on=[],sn=[],an=[];nn[1]=rn[1]=18;nn[169]=rn[169]=18;en[4]=tn[4]=12;en[166]=tn[166]=12;Qe[16]=an[16]=4;Qe[154]=an[154]=4;on[64]=sn[64]=22;on[106]=sn[106]=22;en[2]=on[2]=17;nn[2]=rn[2]=18;en[168]=on[168]=17;nn[168]=rn[168]=18;Qe[8]=nn[8]=9;tn[8]=en[8]=12;Qe[162]=nn[162]=9;tn[162]=en[162]=12;Qe[32]=an[32]=4;tn[32]=sn[32]=1;Qe[138]=an[138]=4;tn[138]=sn[138]=1;rn[128]=an[128]=21;on[128]=sn[128]=22;rn[42]=an[42]=21;on[42]=sn[42]=22;tn[5]=rn[5]=14;tn[165]=rn[165]=14;en[20]=an[20]=6;en[150]=an[150]=6;Qe[80]=on[80]=11;Qe[90]=on[90]=11;nn[65]=sn[65]=3;nn[105]=sn[105]=3;Qe[160]=on[160]=11;tn[160]=rn[160]=14;Qe[10]=on[10]=11;tn[10]=rn[10]=14;en[130]=an[130]=6;nn[130]=sn[130]=3;en[40]=an[40]=6;nn[40]=sn[40]=3;tn[101]=sn[101]=1;tn[69]=sn[69]=1;rn[149]=an[149]=21;rn[21]=an[21]=21;en[86]=on[86]=17;en[84]=on[84]=17;Qe[89]=nn[89]=9;Qe[81]=nn[81]=9;Qe[96]=sn[96]=0;tn[96]=on[96]=15;Qe[74]=sn[74]=0;tn[74]=on[74]=15;Qe[24]=en[24]=8;nn[24]=an[24]=7;Qe[146]=en[146]=8;nn[146]=an[146]=7;tn[6]=on[6]=15;en[6]=rn[6]=16;tn[164]=on[164]=15;en[164]=rn[164]=16;nn[129]=an[129]=7;rn[129]=sn[129]=20;nn[41]=an[41]=7;rn[41]=sn[41]=20;en[66]=sn[66]=2;nn[66]=on[66]=19;en[104]=sn[104]=2;nn[104]=on[104]=19;Qe[144]=rn[144]=10;on[144]=an[144]=23;Qe[26]=rn[26]=10;on[26]=an[26]=23;tn[36]=an[36]=5;en[36]=sn[36]=2;tn[134]=an[134]=5;en[134]=sn[134]=2;Qe[9]=rn[9]=10;tn[9]=nn[9]=13;Qe[161]=rn[161]=10;tn[161]=nn[161]=13;tn[37]=an[37]=5;rn[37]=sn[37]=20;tn[133]=an[133]=5;rn[133]=sn[133]=20;en[148]=rn[148]=16;on[148]=an[148]=23;en[22]=rn[22]=16;on[22]=an[22]=23;Qe[82]=en[82]=8;nn[82]=on[82]=19;Qe[88]=en[88]=8;nn[88]=on[88]=19;Qe[73]=sn[73]=0;tn[73]=nn[73]=13;Qe[97]=sn[97]=0;tn[97]=nn[97]=13;Qe[145]=nn[145]=9;rn[145]=an[145]=21;Qe[25]=nn[25]=9;rn[25]=an[25]=21;tn[70]=sn[70]=1;en[70]=on[70]=17;tn[100]=sn[100]=1;en[100]=on[100]=17;Qe[34]=nn[34]=9;tn[34]=en[34]=12;rn[34]=an[34]=21;on[34]=sn[34]=22;Qe[136]=an[136]=4;tn[136]=sn[136]=1;en[136]=on[136]=17;nn[136]=rn[136]=18;Qe[35]=an[35]=4;tn[35]=en[35]=12;nn[35]=rn[35]=18;on[35]=sn[35]=22;Qe[153]=an[153]=4;nn[153]=rn[153]=18;tn[102]=en[102]=12;on[102]=sn[102]=22;Qe[155]=nn[155]=9;rn[155]=an[155]=23;tn[103]=sn[103]=1;en[103]=on[103]=17;Qe[152]=an[152]=4;en[152]=on[152]=17;nn[152]=rn[152]=18;Qe[156]=en[156]=8;nn[156]=rn[156]=18;on[156]=an[156]=23;Qe[137]=an[137]=4;tn[137]=sn[137]=1;nn[137]=rn[137]=18;Qe[139]=an[139]=4;tn[139]=nn[139]=13;rn[139]=sn[139]=20;Qe[98]=nn[98]=9;tn[98]=en[98]=12;on[98]=sn[98]=22;Qe[99]=sn[99]=0;tn[99]=en[99]=12;nn[99]=on[99]=19;tn[38]=en[38]=12;rn[38]=an[38]=21;on[38]=sn[38]=22;tn[39]=an[39]=5;en[39]=rn[39]=16;on[39]=sn[39]=22;var Yt=[];Yt[1]=Yt[169]=vm;Yt[4]=Yt[166]=_m;Yt[16]=Yt[154]=xm;Yt[64]=Yt[106]=Em;Yt[168]=Yt[2]=Mm;Yt[162]=Yt[8]=wm;Yt[138]=Yt[32]=Sm;Yt[42]=Yt[128]=bm;Yt[5]=Yt[165]=tL;Yt[20]=Yt[150]=eL;Yt[80]=Yt[90]=nL;Yt[65]=Yt[105]=rL;Yt[160]=Yt[10]=iL;Yt[130]=Yt[40]=oL;Yt[85]=sL;Yt[101]=Yt[69]=aL;Yt[149]=Yt[21]=uL;Yt[86]=Yt[84]=lL;Yt[89]=Yt[81]=cL;Yt[96]=Yt[74]=hL;Yt[24]=Yt[146]=fL;Yt[6]=Yt[164]=pL;Yt[129]=Yt[41]=dL;Yt[66]=Yt[104]=mL;Yt[144]=Yt[26]=gL;Yt[36]=Yt[134]=yL;Yt[9]=Yt[161]=vL;Yt[37]=Yt[133]=_L;Yt[148]=Yt[22]=xL;Yt[82]=Yt[88]=EL;Yt[73]=Yt[97]=ML;Yt[145]=Yt[25]=wL;Yt[70]=Yt[100]=SL;Yt[34]=function(r){return[bm(r),wm(r)]};Yt[35]=bL;Yt[136]=function(r){return[Sm(r),Mm(r)]};Yt[153]=function(r){return[xm(r),vm(r)]};Yt[102]=function(r){return[_m(r),Em(r)]};Yt[155]=AL;Yt[103]=TL;Yt[152]=function(r){return[xm(r),Mm(r)]};Yt[156]=CL;Yt[137]=function(r){return[Sm(r),vm(r)]};Yt[139]=PL;Yt[98]=function(r){return[wm(r),Em(r)]};Yt[99]=IL;Yt[38]=function(r){return[_m(r),bm(r)]};Yt[39]=RL;function NL(r){return(r>0)-(r<0)||+r}function Pu(r,t,e){var o=t[0]-r[0],s=t[1]-r[1],u=e[0]-t[0],c=e[1]-t[1];return NL(o*c-u*s)}function u1(r,t){var e=r.geometry.coordinates[0].map(function(c){return c[0]}),o=r.geometry.coordinates[0].map(function(c){return c[1]}),s=t.geometry.coordinates[0].map(function(c){return c[0]}),u=t.geometry.coordinates[0].map(function(c){return c[1]});return Math.max.apply(null,e)===Math.max.apply(null,s)&&Math.max.apply(null,o)===Math.max.apply(null,u)&&Math.min.apply(null,e)===Math.min.apply(null,s)&&Math.min.apply(null,o)===Math.min.apply(null,u)}function Am(r,t){return t.geometry.coordinates[0].every(function(e){return Lr(Fn(e),r)})}function l1(r,t){return r[0]===t[0]&&r[1]===t[1]}var OL=function(){function r(t){this.id=r.buildId(t),this.coordinates=t,this.innerEdges=[],this.outerEdges=[],this.outerEdgesSorted=!1}return r.buildId=function(t){return t.join(",")},r.prototype.removeInnerEdge=function(t){this.innerEdges=this.innerEdges.filter(function(e){return e.from.id!==t.from.id})},r.prototype.removeOuterEdge=function(t){this.outerEdges=this.outerEdges.filter(function(e){return e.to.id!==t.to.id})},r.prototype.addOuterEdge=function(t){this.outerEdges.push(t),this.outerEdgesSorted=!1},r.prototype.sortOuterEdges=function(){var t=this;this.outerEdgesSorted||(this.outerEdges.sort(function(e,o){var s=e.to,u=o.to;if(s.coordinates[0]-t.coordinates[0]>=0&&u.coordinates[0]-t.coordinates[0]<0)return 1;if(s.coordinates[0]-t.coordinates[0]<0&&u.coordinates[0]-t.coordinates[0]>=0)return-1;if(s.coordinates[0]-t.coordinates[0]===0&&u.coordinates[0]-t.coordinates[0]===0)return s.coordinates[1]-t.coordinates[1]>=0||u.coordinates[1]-t.coordinates[1]>=0?s.coordinates[1]-u.coordinates[1]:u.coordinates[1]-s.coordinates[1];var c=Pu(t.coordinates,s.coordinates,u.coordinates);if(c<0)return 1;if(c>0)return-1;var h=Math.pow(s.coordinates[0]-t.coordinates[0],2)+Math.pow(s.coordinates[1]-t.coordinates[1],2),p=Math.pow(u.coordinates[0]-t.coordinates[0],2)+Math.pow(u.coordinates[1]-t.coordinates[1],2);return h-p}),this.outerEdgesSorted=!0)},r.prototype.getOuterEdges=function(){return this.sortOuterEdges(),this.outerEdges},r.prototype.getOuterEdge=function(t){return this.sortOuterEdges(),this.outerEdges[t]},r.prototype.addInnerEdge=function(t){this.innerEdges.push(t)},r}(),Tm=OL;var DL=function(){function r(t,e){this.from=t,this.to=e,this.next=void 0,this.label=void 0,this.symetric=void 0,this.ring=void 0,this.from.addOuterEdge(this),this.to.addInnerEdge(this)}return r.prototype.getSymetric=function(){return this.symetric||(this.symetric=new r(this.to,this.from),this.symetric.symetric=this),this.symetric},r.prototype.deleteEdge=function(){this.from.removeOuterEdge(this),this.to.removeInnerEdge(this)},r.prototype.isEqual=function(t){return this.from.id===t.from.id&&this.to.id===t.to.id},r.prototype.toString=function(){return"Edge { "+this.from.id+" -> "+this.to.id+" }"},r.prototype.toLineString=function(){return Rr([this.from.coordinates,this.to.coordinates])},r.prototype.compareTo=function(t){return Pu(t.from.coordinates,t.to.coordinates,this.to.coordinates)},r}(),c1=DL;var FL=function(){function r(){this.edges=[],this.polygon=void 0,this.envelope=void 0}return r.prototype.push=function(t){this.edges.push(t),this.polygon=this.envelope=void 0},r.prototype.get=function(t){return this.edges[t]},Object.defineProperty(r.prototype,"length",{get:function(){return this.edges.length},enumerable:!0,configurable:!0}),r.prototype.forEach=function(t){this.edges.forEach(t)},r.prototype.map=function(t){return this.edges.map(t)},r.prototype.some=function(t){return this.edges.some(t)},r.prototype.isValid=function(){return!0},r.prototype.isHole=function(){var t=this,e=this.edges.reduce(function(c,h,p){return h.from.coordinates[1]>t.edges[c].from.coordinates[1]&&(c=p),c},0),o=(e===0?this.length:e)-1,s=(e+1)%this.length,u=Pu(this.edges[o].from.coordinates,this.edges[e].from.coordinates,this.edges[s].from.coordinates);return u===0?this.edges[o].from.coordinates[0]>this.edges[s].from.coordinates[0]:u>0},r.prototype.toMultiPoint=function(){return id(this.edges.map(function(t){return t.from.coordinates}))},r.prototype.toPolygon=function(){if(this.polygon)return this.polygon;var t=this.edges.map(function(e){return e.from.coordinates});return t.push(this.edges[0].from.coordinates),this.polygon=Un([t])},r.prototype.getEnvelope=function(){return this.envelope?this.envelope:this.envelope=wd(this.toPolygon())},r.findEdgeRingContaining=function(t,e){var o=t.getEnvelope(),s,u;return e.forEach(function(c){var h=c.getEnvelope();if(u&&(s=u.getEnvelope()),!u1(h,o)&&Am(h,o)){for(var p=t.map(function(b){return b.from.coordinates}),d=void 0,m=function(b){c.some(function(A){return l1(b,A.from.coordinates)})||(d=b)},y=0,v=p;y<v.length;y++){var E=v[y];m(E)}d&&c.inside(Fn(d))&&(!u||Am(s,h))&&(u=c)}}),u},r.prototype.inside=function(t){return Lr(t,this.toPolygon())},r}(),Cm=FL;function UL(r){if(!r)throw new Error("No geojson passed");if(r.type!=="FeatureCollection"&&r.type!=="GeometryCollection"&&r.type!=="MultiLineString"&&r.type!=="LineString"&&r.type!=="Feature")throw new Error("Invalid input type '"+r.type+"'. Geojson must be FeatureCollection, GeometryCollection, LineString, MultiLineString or Feature")}var I4=function(){function r(){this.edges=[],this.nodes={}}return r.fromGeoJson=function(t){UL(t);var e=new r;return Ni(t,function(o){sd(o,"LineString","Graph::fromGeoJson"),Ey(o,function(s,u){if(s){var c=e.getNode(s),h=e.getNode(u);e.addEdge(c,h)}return u})}),e},r.prototype.getNode=function(t){var e=Tm.buildId(t),o=this.nodes[e];return o||(o=this.nodes[e]=new Tm(t)),o},r.prototype.addEdge=function(t,e){var o=new c1(t,e),s=o.getSymetric();this.edges.push(o),this.edges.push(s)},r.prototype.deleteDangles=function(){var t=this;Object.keys(this.nodes).map(function(e){return t.nodes[e]}).forEach(function(e){return t._removeIfDangle(e)})},r.prototype._removeIfDangle=function(t){var e=this;if(t.innerEdges.length<=1){var o=t.getOuterEdges().map(function(s){return s.to});this.removeNode(t),o.forEach(function(s){return e._removeIfDangle(s)})}},r.prototype.deleteCutEdges=function(){var t=this;this._computeNextCWEdges(),this._findLabeledEdgeRings(),this.edges.forEach(function(e){e.label===e.symetric.label&&(t.removeEdge(e.symetric),t.removeEdge(e))})},r.prototype._computeNextCWEdges=function(t){var e=this;typeof t=="undefined"?Object.keys(this.nodes).forEach(function(o){return e._computeNextCWEdges(e.nodes[o])}):t.getOuterEdges().forEach(function(o,s){t.getOuterEdge((s===0?t.getOuterEdges().length:s)-1).symetric.next=o})},r.prototype._computeNextCCWEdges=function(t,e){for(var o=t.getOuterEdges(),s,u,c=o.length-1;c>=0;--c){var h=o[c],p=h.symetric,d=void 0,m=void 0;h.label===e&&(d=h),p.label===e&&(m=p),!(!d||!m)&&(m&&(u=m),d&&(u&&(u.next=d,u=void 0),s||(s=d)))}u&&(u.next=s)},r.prototype._findLabeledEdgeRings=function(){var t=[],e=0;return this.edges.forEach(function(o){if(!(o.label>=0)){t.push(o);var s=o;do s.label=e,s=s.next;while(!o.isEqual(s));e++}}),t},r.prototype.getEdgeRings=function(){var t=this;this._computeNextCWEdges(),this.edges.forEach(function(o){o.label=void 0}),this._findLabeledEdgeRings().forEach(function(o){t._findIntersectionNodes(o).forEach(function(s){t._computeNextCCWEdges(s,o.label)})});var e=[];return this.edges.forEach(function(o){o.ring||e.push(t._findEdgeRing(o))}),e},r.prototype._findIntersectionNodes=function(t){var e=[],o=t,s=function(){var u=0;o.from.getOuterEdges().forEach(function(c){c.label===t.label&&++u}),u>1&&e.push(o.from),o=o.next};do s();while(!t.isEqual(o));return e},r.prototype._findEdgeRing=function(t){var e=t,o=new Cm;do o.push(e),e.ring=o,e=e.next;while(!t.isEqual(e));return o},r.prototype.removeNode=function(t){var e=this;t.getOuterEdges().forEach(function(o){return e.removeEdge(o)}),t.innerEdges.forEach(function(o){return e.removeEdge(o)}),delete this.nodes[t.id]},r.prototype.removeEdge=function(t){this.edges=this.edges.filter(function(e){return!e.isEqual(t)}),t.deleteEdge()},r}();var kL=tr(Pm(),1);var HL=tr(Pm(),1);var qL=tr(_1(),1);var KL=tr(P1(),1);function R1(r){for(var t=r,e=[];t.parent;)e.unshift(t),t=t.parent;return e}function QL(){return new L1(function(r){return r.f})}var Nm={search:function(r,t,e,o){r.cleanDirty(),o=o||{};var s=o.heuristic||Nm.heuristics.manhattan,u=o.closest||!1,c=QL(),h=t;for(t.h=s(t,e),c.push(t);c.size()>0;){var p=c.pop();if(p===e)return R1(p);p.closed=!0;for(var d=r.neighbors(p),m=0,y=d.length;m<y;++m){var v=d[m];if(!(v.closed||v.isWall())){var E=p.g+v.getCost(p),b=v.visited;(!b||E<v.g)&&(v.visited=!0,v.parent=p,v.h=v.h||s(v,e),v.g=E,v.f=v.g+v.h,r.markDirty(v),u&&(v.h<h.h||v.h===h.h&&v.g<h.g)&&(h=v),b?c.rescoreElement(v):c.push(v))}}}return u?R1(h):[]},heuristics:{manhattan:function(r,t){var e=Math.abs(t.x-r.x),o=Math.abs(t.y-r.y);return e+o},diagonal:function(r,t){var e=1,o=Math.sqrt(2),s=Math.abs(t.x-r.x),u=Math.abs(t.y-r.y);return e*(s+u)+(o-2*e)*Math.min(s,u)}},cleanNode:function(r){r.f=0,r.g=0,r.h=0,r.visited=!1,r.closed=!1,r.parent=null}};function Ul(r,t){t=t||{},this.nodes=[],this.diagonal=!!t.diagonal,this.grid=[];for(var e=0;e<r.length;e++){this.grid[e]=[];for(var o=0,s=r[e];o<s.length;o++){var u=new Xh(e,o,s[o]);this.grid[e][o]=u,this.nodes.push(u)}}this.init()}Ul.prototype.init=function(){this.dirtyNodes=[];for(var r=0;r<this.nodes.length;r++)Nm.cleanNode(this.nodes[r])};Ul.prototype.cleanDirty=function(){for(var r=0;r<this.dirtyNodes.length;r++)Nm.cleanNode(this.dirtyNodes[r]);this.dirtyNodes=[]};Ul.prototype.markDirty=function(r){this.dirtyNodes.push(r)};Ul.prototype.neighbors=function(r){var t=[],e=r.x,o=r.y,s=this.grid;return s[e-1]&&s[e-1][o]&&t.push(s[e-1][o]),s[e+1]&&s[e+1][o]&&t.push(s[e+1][o]),s[e]&&s[e][o-1]&&t.push(s[e][o-1]),s[e]&&s[e][o+1]&&t.push(s[e][o+1]),this.diagonal&&(s[e-1]&&s[e-1][o-1]&&t.push(s[e-1][o-1]),s[e+1]&&s[e+1][o-1]&&t.push(s[e+1][o-1]),s[e-1]&&s[e-1][o+1]&&t.push(s[e-1][o+1]),s[e+1]&&s[e+1][o+1]&&t.push(s[e+1][o+1])),t};Ul.prototype.toString=function(){for(var r=[],t=this.grid,e,o,s,u,c=0,h=t.length;c<h;c++){for(e=[],o=t[c],s=0,u=o.length;s<u;s++)e.push(o[s].weight);r.push(e.join(" "))}return r.join(\`
|
|
8051
8051
|
\`)};function Xh(r,t,e){this.x=r,this.y=t,this.weight=e}Xh.prototype.toString=function(){return"["+this.x+" "+this.y+"]"};Xh.prototype.getCost=function(r){return r&&r.x!==this.x&&r.y!==this.y?this.weight*1.41421:this.weight};Xh.prototype.isWall=function(){return this.weight===0};function L1(r){this.content=[],this.scoreFunction=r}L1.prototype={push:function(r){this.content.push(r),this.sinkDown(this.content.length-1)},pop:function(){var r=this.content[0],t=this.content.pop();return this.content.length>0&&(this.content[0]=t,this.bubbleUp(0)),r},remove:function(r){var t=this.content.indexOf(r),e=this.content.pop();t!==this.content.length-1&&(this.content[t]=e,this.scoreFunction(e)<this.scoreFunction(r)?this.sinkDown(t):this.bubbleUp(t))},size:function(){return this.content.length},rescoreElement:function(r){this.sinkDown(this.content.indexOf(r))},sinkDown:function(r){for(var t=this.content[r];r>0;){var e=(r+1>>1)-1,o=this.content[e];if(this.scoreFunction(t)<this.scoreFunction(o))this.content[e]=t,this.content[r]=o,r=e;else break}},bubbleUp:function(r){for(var t=this.content.length,e=this.content[r],o=this.scoreFunction(e);;){var s=r+1<<1,u=s-1,c=null,h;if(u<t){var p=this.content[u];h=this.scoreFunction(p),h<o&&(c=u)}if(s<t){var d=this.content[s],m=this.scoreFunction(d);m<(c===null?o:h)&&(c=s)}if(c!==null)this.content[r]=this.content[c],this.content[c]=e,r=c;else break}}};function Om(){this._=null}function Ru(r){r.U=r.C=r.L=r.R=r.P=r.N=null}Om.prototype={constructor:Om,insert:function(r,t){var e,o,s;if(r){if(t.P=r,t.N=r.N,r.N&&(r.N.P=t),r.N=t,r.R){for(r=r.R;r.L;)r=r.L;r.L=t}else r.R=t;e=r}else this._?(r=N1(this._),t.P=null,t.N=r,r.P=r.L=t,e=r):(t.P=t.N=null,this._=t,e=null);for(t.L=t.R=null,t.U=e,t.C=!0,r=t;e&&e.C;)o=e.U,e===o.L?(s=o.R,s&&s.C?(e.C=s.C=!1,o.C=!0,r=o):(r===e.R&&(Bl(this,e),r=e,e=r.U),e.C=!1,o.C=!0,zl(this,o))):(s=o.L,s&&s.C?(e.C=s.C=!1,o.C=!0,r=o):(r===e.L&&(zl(this,e),r=e,e=r.U),e.C=!1,o.C=!0,Bl(this,o))),e=r.U;this._.C=!1},remove:function(r){r.N&&(r.N.P=r.P),r.P&&(r.P.N=r.N),r.N=r.P=null;var t=r.U,e,o=r.L,s=r.R,u,c;if(o?s?u=N1(s):u=o:u=s,t?t.L===r?t.L=u:t.R=u:this._=u,o&&s?(c=u.C,u.C=r.C,u.L=o,o.U=u,u!==s?(t=u.U,u.U=r.U,r=u.R,t.L=r,u.R=s,s.U=u):(u.U=t,t=u,r=u.R)):(c=r.C,r=u),r&&(r.U=t),!c){if(r&&r.C){r.C=!1;return}do{if(r===this._)break;if(r===t.L){if(e=t.R,e.C&&(e.C=!1,t.C=!0,Bl(this,t),e=t.R),e.L&&e.L.C||e.R&&e.R.C){(!e.R||!e.R.C)&&(e.L.C=!1,e.C=!0,zl(this,e),e=t.R),e.C=t.C,t.C=e.R.C=!1,Bl(this,t),r=this._;break}}else if(e=t.L,e.C&&(e.C=!1,t.C=!0,zl(this,t),e=t.L),e.L&&e.L.C||e.R&&e.R.C){(!e.L||!e.L.C)&&(e.R.C=!1,e.C=!0,Bl(this,e),e=t.L),e.C=t.C,t.C=e.L.C=!1,zl(this,t),r=this._;break}e.C=!0,r=t,t=t.U}while(!r.C);r&&(r.C=!1)}}};function Bl(r,t){var e=t,o=t.R,s=e.U;s?s.L===e?s.L=o:s.R=o:r._=o,o.U=s,e.U=o,e.R=o.L,e.R&&(e.R.U=e),o.L=e}function zl(r,t){var e=t,o=t.L,s=e.U;s?s.L===e?s.L=o:s.R=o:r._=o,o.U=s,e.U=o,e.L=o.R,e.L&&(e.L.U=e),o.R=e}function N1(r){for(;r.L;)r=r.L;return r}var Dm=Om;function Lu(r,t,e,o){var s=[null,null],u=Or.push(s)-1;return s.left=r,s.right=t,e&&Gl(s,r,t,e),o&&Gl(s,t,r,o),mi[r.index].halfedges.push(u),mi[t.index].halfedges.push(u),s}function Nu(r,t,e){var o=[t,e];return o.left=r,o}function Gl(r,t,e,o){!r[0]&&!r[1]?(r[0]=o,r.left=t,r.right=e):r.left===e?r[1]=o:r[0]=o}function tN(r,t,e,o,s){var u=r[0],c=r[1],h=u[0],p=u[1],d=c[0],m=c[1],y=0,v=1,E=d-h,b=m-p,A;if(A=t-h,!(!E&&A>0)){if(A/=E,E<0){if(A<y)return;A<v&&(v=A)}else if(E>0){if(A>v)return;A>y&&(y=A)}if(A=o-h,!(!E&&A<0)){if(A/=E,E<0){if(A>v)return;A>y&&(y=A)}else if(E>0){if(A<y)return;A<v&&(v=A)}if(A=e-p,!(!b&&A>0)){if(A/=b,b<0){if(A<y)return;A<v&&(v=A)}else if(b>0){if(A>v)return;A>y&&(y=A)}if(A=s-p,!(!b&&A<0)){if(A/=b,b<0){if(A>v)return;A>y&&(y=A)}else if(b>0){if(A<y)return;A<v&&(v=A)}return!(y>0)&&!(v<1)||(y>0&&(r[0]=[h+y*E,p+y*b]),v<1&&(r[1]=[h+v*E,p+v*b])),!0}}}}}function eN(r,t,e,o,s){var u=r[1];if(u)return!0;var c=r[0],h=r.left,p=r.right,d=h[0],m=h[1],y=p[0],v=p[1],E=(d+y)/2,b=(m+v)/2,A,_;if(v===m){if(E<t||E>=o)return;if(d>y){if(!c)c=[E,e];else if(c[1]>=s)return;u=[E,s]}else{if(!c)c=[E,s];else if(c[1]<e)return;u=[E,e]}}else if(A=(d-y)/(v-m),_=b-A*E,A<-1||A>1)if(d>y){if(!c)c=[(e-_)/A,e];else if(c[1]>=s)return;u=[(s-_)/A,s]}else{if(!c)c=[(s-_)/A,s];else if(c[1]<e)return;u=[(e-_)/A,e]}else if(m<v){if(!c)c=[t,A*t+_];else if(c[0]>=o)return;u=[o,A*o+_]}else{if(!c)c=[o,A*o+_];else if(c[0]<t)return;u=[t,A*t+_]}return r[0]=c,r[1]=u,!0}function O1(r,t,e,o){for(var s=Or.length,u;s--;)(!eN(u=Or[s],r,t,e,o)||!tN(u,r,t,e,o)||!(Math.abs(u[0][0]-u[1][0])>Cn||Math.abs(u[0][1]-u[1][1])>Cn))&&delete Or[s]}function D1(r){return mi[r.index]={site:r,halfedges:[]}}function nN(r,t){var e=r.site,o=t.left,s=t.right;return e===s&&(s=o,o=e),s?Math.atan2(s[1]-o[1],s[0]-o[0]):(e===o?(o=t[1],s=t[0]):(o=t[0],s=t[1]),Math.atan2(o[0]-s[0],s[1]-o[1]))}function Fm(r,t){return t[+(t.left!==r.site)]}function rN(r,t){return t[+(t.left===r.site)]}function F1(){for(var r=0,t=mi.length,e,o,s,u;r<t;++r)if((e=mi[r])&&(u=(o=e.halfedges).length)){var c=new Array(u),h=new Array(u);for(s=0;s<u;++s)c[s]=s,h[s]=nN(e,Or[o[s]]);for(c.sort(function(p,d){return h[d]-h[p]}),s=0;s<u;++s)h[s]=o[c[s]];for(s=0;s<u;++s)o[s]=h[s]}}function U1(r,t,e,o){var s=mi.length,u,c,h,p,d,m,y,v,E,b,A,_,x=!0;for(u=0;u<s;++u)if(c=mi[u]){for(h=c.site,d=c.halfedges,p=d.length;p--;)Or[d[p]]||d.splice(p,1);for(p=0,m=d.length;p<m;)b=rN(c,Or[d[p]]),A=b[0],_=b[1],y=Fm(c,Or[d[++p%m]]),v=y[0],E=y[1],(Math.abs(A-v)>Cn||Math.abs(_-E)>Cn)&&(d.splice(p,0,Or.push(Nu(h,b,Math.abs(A-r)<Cn&&o-_>Cn?[r,Math.abs(v-r)<Cn?E:o]:Math.abs(_-o)<Cn&&e-A>Cn?[Math.abs(E-o)<Cn?v:e,o]:Math.abs(A-e)<Cn&&_-t>Cn?[e,Math.abs(v-e)<Cn?E:t]:Math.abs(_-t)<Cn&&A-r>Cn?[Math.abs(E-t)<Cn?v:r,t]:null))-1),++m);m&&(x=!1)}if(x){var T,w,R,G=1/0;for(u=0,x=null;u<s;++u)(c=mi[u])&&(h=c.site,T=h[0]-r,w=h[1]-t,R=T*T+w*w,R<G&&(G=R,x=c));if(x){var z=[r,t],F=[r,o],I=[e,o],lt=[e,t];x.halfedges.push(Or.push(Nu(h=x.site,z,F))-1,Or.push(Nu(h,F,I))-1,Or.push(Nu(h,I,lt))-1,Or.push(Nu(h,lt,z))-1)}}for(u=0;u<s;++u)(c=mi[u])&&(c.halfedges.length||delete mi[u])}var B1=[],Yh;function iN(){Ru(this),this.x=this.y=this.arc=this.site=this.cy=null}function ma(r){var t=r.P,e=r.N;if(!(!t||!e)){var o=t.site,s=r.site,u=e.site;if(o!==u){var c=s[0],h=s[1],p=o[0]-c,d=o[1]-h,m=u[0]-c,y=u[1]-h,v=2*(p*y-d*m);if(!(v>=-z1)){var E=p*p+d*d,b=m*m+y*y,A=(y*E-d*b)/v,_=(p*b-m*E)/v,x=B1.pop()||new iN;x.arc=r,x.site=s,x.x=A+c,x.y=(x.cy=_+h)+Math.sqrt(A*A+_*_),r.circle=x;for(var T=null,w=Ou._;w;)if(x.y<w.y||x.y===w.y&&x.x<=w.x)if(w.L)w=w.L;else{T=w.P;break}else if(w.R)w=w.R;else{T=w;break}Ou.insert(T,x),T||(Yh=x)}}}}function ga(r){var t=r.circle;t&&(t.P||(Yh=t.N),Ou.remove(t),B1.push(t),Ru(t),r.circle=null)}var k1=[];function oN(){Ru(this),this.edge=this.site=this.circle=null}function G1(r){var t=k1.pop()||new oN;return t.site=r,t}function Um(r){ga(r),ya.remove(r),k1.push(r),Ru(r)}function H1(r){var t=r.circle,e=t.x,o=t.cy,s=[e,o],u=r.P,c=r.N,h=[r];Um(r);for(var p=u;p.circle&&Math.abs(e-p.circle.x)<Cn&&Math.abs(o-p.circle.cy)<Cn;)u=p.P,h.unshift(p),Um(p),p=u;h.unshift(p),ga(p);for(var d=c;d.circle&&Math.abs(e-d.circle.x)<Cn&&Math.abs(o-d.circle.cy)<Cn;)c=d.N,h.push(d),Um(d),d=c;h.push(d),ga(d);var m=h.length,y;for(y=1;y<m;++y)d=h[y],p=h[y-1],Gl(d.edge,p.site,d.site,s);p=h[0],d=h[m-1],d.edge=Lu(p.site,d.site,null,s),ma(p),ma(d)}function V1(r){for(var t=r[0],e=r[1],o,s,u,c,h=ya._;h;)if(u=q1(h,e)-t,u>Cn)h=h.L;else if(c=t-sN(h,e),c>Cn){if(!h.R){o=h;break}h=h.R}else{u>-Cn?(o=h.P,s=h):c>-Cn?(o=h,s=h.N):o=s=h;break}D1(r);var p=G1(r);if(ya.insert(o,p),!(!o&&!s)){if(o===s){ga(o),s=G1(o.site),ya.insert(p,s),p.edge=s.edge=Lu(o.site,p.site),ma(o),ma(s);return}if(!s){p.edge=Lu(o.site,p.site);return}ga(o),ga(s);var d=o.site,m=d[0],y=d[1],v=r[0]-m,E=r[1]-y,b=s.site,A=b[0]-m,_=b[1]-y,x=2*(v*_-E*A),T=v*v+E*E,w=A*A+_*_,R=[(_*T-E*w)/x+m,(v*w-A*T)/x+y];Gl(s.edge,d,b,R),p.edge=Lu(d,r,null,R),s.edge=Lu(r,b,null,R),ma(o),ma(s)}}function q1(r,t){var e=r.site,o=e[0],s=e[1],u=s-t;if(!u)return o;var c=r.P;if(!c)return-1/0;e=c.site;var h=e[0],p=e[1],d=p-t;if(!d)return h;var m=h-o,y=1/u-1/d,v=m/d;return y?(-v+Math.sqrt(v*v-2*y*(m*m/(-2*d)-p+d/2+s-u/2)))/y+o:(o+h)/2}function sN(r,t){var e=r.N;if(e)return q1(e,t);var o=r.site;return o[1]===t?o[0]:1/0}var Cn=1e-6,z1=1e-12,ya,mi,Ou,Or;function aN(r,t,e){return(r[0]-e[0])*(t[1]-r[1])-(r[0]-t[0])*(e[1]-r[1])}function uN(r,t){return t[1]-r[1]||t[0]-r[0]}function Zh(r,t){var e=r.sort(uN).pop(),o,s,u;for(Or=[],mi=new Array(r.length),ya=new Dm,Ou=new Dm;;)if(u=Yh,e&&(!u||e[1]<u.y||e[1]===u.y&&e[0]<u.x))(e[0]!==o||e[1]!==s)&&(V1(e),o=e[0],s=e[1]),e=r.pop();else if(u)H1(u.arc);else break;if(F1(),t){var c=+t[0][0],h=+t[0][1],p=+t[1][0],d=+t[1][1];O1(c,h,p,d),U1(c,h,p,d)}this.edges=Or,this.cells=mi,ya=Ou=Or=mi=null}Zh.prototype={constructor:Zh,polygons:function(){var r=this.edges;return this.cells.map(function(t){var e=t.halfedges.map(function(o){return Fm(t,r[o])});return e.data=t.site.data,e})},triangles:function(){var r=[],t=this.edges;return this.cells.forEach(function(e,o){if(h=(u=e.halfedges).length)for(var s=e.site,u,c=-1,h,p,d=t[u[h-1]],m=d.left===s?d.right:d.left;++c<h;)p=m,d=t[u[c]],m=d.left===s?d.right:d.left,p&&m&&o<p.index&&o<m.index&&aN(s,p,m)<0&&r.push([s.data,p.data,m.data])}),r},links:function(){return this.edges.filter(function(r){return r.right}).map(function(r){return{source:r.left.data,target:r.right.data}})},find:function(r,t,e){for(var o=this,s,u=o._found||0,c=o.cells.length,h;!(h=o.cells[u]);)if(++u>=c)return null;var p=r-h.site[0],d=t-h.site[1],m=p*p+d*d;do h=o.cells[s=u],u=null,h.halfedges.forEach(function(y){var v=o.edges[y],E=v.left;if(!((E===h.site||!E)&&!(E=v.right))){var b=r-E[0],A=t-E[1],_=b*b+A*A;_<m&&(m=_,u=E.index)}});while(u!==null);return o._found=s,e==null||m<=e*e?h.site:null}};var gN=tr(Du(),1);var jm=tr(Z1(),1);function Mi(){return new Kh}function Kh(){this.reset()}Kh.prototype={constructor:Kh,reset:function(){this.s=this.t=0},add:function(r){$1(Jh,r,this.t),$1(this,Jh.s,this.s),this.s?this.t+=Jh.t:this.s=Jh.t},valueOf:function(){return this.s}};var Jh=new Kh;function $1(r,t,e){var o=r.s=t+e,s=o-t,u=o-s;r.t=t-u+(e-s)}var gn=1e-6;var Sn=Math.PI,vr=Sn/2,jh=Sn/4,Co=Sn*2,va=180/Sn,wi=Sn/180,Jn=Math.abs,ho=Math.atan,Si=Math.atan2,hn=Math.cos;var Qh=Math.exp;var kl=Math.log;var we=Math.sin;var qr=Math.sqrt,Hl=Math.tan;function Gm(r){return r>1?0:r<-1?Sn:Math.acos(r)}function gi(r){return r>1?vr:r<-1?-vr:Math.asin(r)}function fo(){}var yN=Mi(),SH=Mi();function _a(r){var t=r[0],e=r[1],o=hn(e);return[o*hn(t),o*we(t),we(e)]}function Vl(r,t){return[r[1]*t[2]-r[2]*t[1],r[2]*t[0]-r[0]*t[2],r[0]*t[1]-r[1]*t[0]]}function ql(r){var t=qr(r[0]*r[0]+r[1]*r[1]+r[2]*r[2]);r[0]/=t,r[1]/=t,r[2]/=t}var OH=Mi();function K1(r,t){return[r>Sn?r-Co:r<-Sn?r+Co:r,t]}K1.invert=K1;function km(){var r=[],t;return{point:function(e,o){t.push([e,o])},lineStart:function(){r.push(t=[])},lineEnd:fo,rejoin:function(){r.length>1&&r.push(r.pop().concat(r.shift()))},result:function(){var e=r;return r=[],t=null,e}}}function Hm(r,t){return Jn(r[0]-t[0])<gn&&Jn(r[1]-t[1])<gn}function tf(r,t,e,o){this.x=r,this.z=t,this.o=e,this.e=o,this.v=!1,this.n=this.p=null}function Vm(r,t,e,o,s){var u=[],c=[],h,p;if(r.forEach(function(b){if(!((A=b.length-1)<=0)){var A,_=b[0],x=b[A],T;if(Hm(_,x)){for(s.lineStart(),h=0;h<A;++h)s.point((_=b[h])[0],_[1]);s.lineEnd();return}u.push(T=new tf(_,b,null,!0)),c.push(T.o=new tf(_,null,T,!1)),u.push(T=new tf(x,b,null,!1)),c.push(T.o=new tf(x,null,T,!0))}}),!!u.length){for(c.sort(t),j1(u),j1(c),h=0,p=c.length;h<p;++h)c[h].e=e=!e;for(var d=u[0],m,y;;){for(var v=d,E=!0;v.v;)if((v=v.n)===d)return;m=v.z,s.lineStart();do{if(v.v=v.o.v=!0,v.e){if(E)for(h=0,p=m.length;h<p;++h)s.point((y=m[h])[0],y[1]);else o(v.x,v.n.x,1,s);v=v.n}else{if(E)for(m=v.p.z,h=m.length-1;h>=0;--h)s.point((y=m[h])[0],y[1]);else o(v.x,v.p.x,-1,s);v=v.p}v=v.o,m=v.z,E=!E}while(!v.v);s.lineEnd()}}}function j1(r){if(t=r.length){for(var t,e=0,o=r[0],s;++e<t;)o.n=s=r[e],s.p=o,o=s;o.n=s=r[0],s.p=o}}function Rs(r,t){return r<t?-1:r>t?1:r>=t?0:NaN}function qm(r){return r.length===1&&(r=xN(r)),{left:function(t,e,o,s){for(o==null&&(o=0),s==null&&(s=t.length);o<s;){var u=o+s>>>1;r(t[u],e)<0?o=u+1:s=u}return o},right:function(t,e,o,s){for(o==null&&(o=0),s==null&&(s=t.length);o<s;){var u=o+s>>>1;r(t[u],e)>0?s=u:o=u+1}return o}}}function xN(r){return function(t,e){return Rs(r(t),e)}}var Q1=qm(Rs),EN=Q1.right,MN=Q1.left;var tE=Array.prototype,SN=tE.slice,bN=tE.map;var AV=Math.sqrt(50),TV=Math.sqrt(10),CV=Math.sqrt(2);function nf(r){for(var t=r.length,e,o=-1,s=0,u,c;++o<t;)s+=r[o].length;for(u=new Array(s);--t>=0;)for(c=r[t],e=c.length;--e>=0;)u[--s]=c[e];return u}var NN=1e9,h8=-NN;var Wm=Mi();function Xm(r,t){var e=t[0],o=t[1],s=[we(e),-hn(e),0],u=0,c=0;Wm.reset();for(var h=0,p=r.length;h<p;++h)if(m=(d=r[h]).length)for(var d,m,y=d[m-1],v=y[0],E=y[1]/2+jh,b=we(E),A=hn(E),_=0;_<m;++_,v=T,b=R,A=G,y=x){var x=d[_],T=x[0],w=x[1]/2+jh,R=we(w),G=hn(w),z=T-v,F=z>=0?1:-1,I=F*z,lt=I>Sn,L=b*R;if(Wm.add(Si(L*F*we(I),A*G+L*hn(I))),u+=lt?z+F*Co:z,lt^v>=e^T>=e){var W=Vl(_a(y),_a(x));ql(W);var V=Vl(s,W);ql(V);var wt=(lt^z>=0?-1:1)*gi(V[2]);(o>wt||o===wt&&(W[0]||W[1]))&&(c+=lt^z>=0?1:-1)}}return(u<-gn||u<gn&&Wm<-gn)^c&1}var E8=Mi();var G8=Mi(),k8=Mi();var FN=1/0;var q8=-FN;function Ym(r){this._context=r}Ym.prototype={_radius:4.5,pointRadius:function(r){return this._radius=r,this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){this._line===0&&this._context.closePath(),this._point=NaN},point:function(r,t){switch(this._point){case 0:{this._context.moveTo(r,t),this._point=1;break}case 1:{this._context.lineTo(r,t);break}default:{this._context.moveTo(r+this._radius,t),this._context.arc(r,t,this._radius,0,Co);break}}},result:fo};var tq=Mi();function Zm(){this._string=[]}Zm.prototype={_radius:4.5,_circle:rE(4.5),pointRadius:function(r){return(r=+r)!==this._radius&&(this._radius=r,this._circle=null),this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){this._line===0&&this._string.push("Z"),this._point=NaN},point:function(r,t){switch(this._point){case 0:{this._string.push("M",r,",",t),this._point=1;break}case 1:{this._string.push("L",r,",",t);break}default:{this._circle==null&&(this._circle=rE(this._radius)),this._string.push("M",r,",",t,this._circle);break}}},result:function(){if(this._string.length){var r=this._string.join("");return this._string=[],r}else return null}};function rE(r){return"m0,"+r+"a"+r+","+r+" 0 1,1 0,"+-2*r+"a"+r+","+r+" 0 1,1 0,"+2*r+"z"}function $m(r,t,e,o){return function(s,u){var c=t(u),h=s.invert(o[0],o[1]),p=km(),d=t(p),m=!1,y,v,E,b={point:A,lineStart:x,lineEnd:T,polygonStart:function(){b.point=w,b.lineStart=R,b.lineEnd=G,v=[],y=[]},polygonEnd:function(){b.point=A,b.lineStart=x,b.lineEnd=T,v=nf(v);var z=Xm(y,h);v.length?(m||(u.polygonStart(),m=!0),Vm(v,zN,z,e,u)):z&&(m||(u.polygonStart(),m=!0),u.lineStart(),e(null,null,1,u),u.lineEnd()),m&&(u.polygonEnd(),m=!1),v=y=null},sphere:function(){u.polygonStart(),u.lineStart(),e(null,null,1,u),u.lineEnd(),u.polygonEnd()}};function A(z,F){var I=s(z,F);r(z=I[0],F=I[1])&&u.point(z,F)}function _(z,F){var I=s(z,F);c.point(I[0],I[1])}function x(){b.point=_,c.lineStart()}function T(){b.point=A,c.lineEnd()}function w(z,F){E.push([z,F]);var I=s(z,F);d.point(I[0],I[1])}function R(){d.lineStart(),E=[]}function G(){w(E[0][0],E[0][1]),d.lineEnd();var z=d.clean(),F=p.result(),I,lt=F.length,L,W,V;if(E.pop(),y.push(E),E=null,!!lt){if(z&1){if(W=F[0],(L=W.length-1)>0){for(m||(u.polygonStart(),m=!0),u.lineStart(),I=0;I<L;++I)u.point((V=W[I])[0],V[1]);u.lineEnd()}return}lt>1&&z&2&&F.push(F.pop().concat(F.shift())),v.push(F.filter(BN))}}return b}}function BN(r){return r.length>1}function zN(r,t){return((r=r.x)[0]<0?r[1]-vr-gn:vr-r[1])-((t=t.x)[0]<0?t[1]-vr-gn:vr-t[1])}var GN=$m(function(){return!0},kN,VN,[-Sn,-vr]);function kN(r){var t=NaN,e=NaN,o=NaN,s;return{lineStart:function(){r.lineStart(),s=1},point:function(u,c){var h=u>0?Sn:-Sn,p=Jn(u-t);Jn(p-Sn)<gn?(r.point(t,e=(e+c)/2>0?vr:-vr),r.point(o,e),r.lineEnd(),r.lineStart(),r.point(h,e),r.point(u,e),s=0):o!==h&&p>=Sn&&(Jn(t-o)<gn&&(t-=o*gn),Jn(u-h)<gn&&(u-=h*gn),e=HN(t,e,u,c),r.point(o,e),r.lineEnd(),r.lineStart(),r.point(h,e),s=0),r.point(t=u,e=c),o=h},lineEnd:function(){r.lineEnd(),t=e=NaN},clean:function(){return 2-s}}}function HN(r,t,e,o){var s,u,c=we(r-e);return Jn(c)>gn?ho((we(t)*(u=hn(o))*we(e)-we(o)*(s=hn(t))*we(r))/(s*u*c)):(t+o)/2}function VN(r,t,e,o){var s;if(r==null)s=e*vr,o.point(-Sn,s),o.point(0,s),o.point(Sn,s),o.point(Sn,0),o.point(Sn,-s),o.point(0,-s),o.point(-Sn,-s),o.point(-Sn,0),o.point(-Sn,s);else if(Jn(r[0]-t[0])>gn){var u=r[0]<t[0]?Sn:-Sn;s=e*u/2,o.point(-u,s),o.point(0,s),o.point(u,s)}else o.point(t[0],t[1])}function rf(r){return function(t){var e=new Jm;for(var o in r)e[o]=r[o];return e.stream=t,e}}function Jm(){}Jm.prototype={constructor:Jm,point:function(r,t){this.stream.point(r,t)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}};var kq=hn(30*wi);var eW=rf({point:function(r,t){this.stream.point(r*wi,t*wi)}});function of(r){return function(t,e){var o=hn(t),s=hn(e),u=r(o*s);return[u*s*we(t),u*we(e)]}}function Po(r){return function(t,e){var o=qr(t*t+e*e),s=r(o),u=we(s),c=hn(s);return[Si(t*u,o*c),gi(o&&e*u/o)]}}var cE=of(function(r){return qr(2/(1+r))});cE.invert=Po(function(r){return 2*gi(r/2)});var hE=of(function(r){return(r=Gm(r))&&r/we(r)});hE.invert=Po(function(r){return r});function Km(r,t){return[r,kl(Hl((vr+t)/2))]}Km.invert=function(r,t){return[r,2*ho(Qh(t))-vr]};function sf(r,t){return[r,t]}sf.invert=sf;function fE(r,t){var e=hn(t),o=hn(r)*e;return[e*we(r)/o,we(t)/o]}fE.invert=Po(ho);function pE(r,t){var e=t*t,o=e*e;return[r*(.8707-.131979*e+o*(-.013791+o*(.003971*e-.001529*o))),t*(1.007226+e*(.015085+o*(-.044475+.028874*e-.005916*o)))]}pE.invert=function(r,t){var e=t,o=25,s;do{var u=e*e,c=u*u;e-=s=(e*(1.007226+u*(.015085+c*(-.044475+.028874*u-.005916*c)))-t)/(1.007226+u*(.015085*3+c*(-.044475*7+.028874*9*u-.005916*11*c)))}while(Jn(s)>gn&&--o>0);return[r/(.8707+(u=e*e)*(-.131979+u*(-.013791+u*u*u*(.003971-.001529*u)))),e]};function dE(r,t){return[hn(t)*we(r),we(t)]}dE.invert=Po(gi);function mE(r,t){var e=hn(t),o=1+hn(r)*e;return[e*we(r)/o,we(t)/o]}mE.invert=Po(function(r){return 2*ho(r)});function gE(r,t){return[kl(Hl((vr+t)/2)),-r]}gE.invert=function(r,t){return[-t,2*ho(Qh(r))-vr]};var $N=tr(Du(),1);var JN=tr(Du(),1);var jN=tr(Du(),1);var QN=tr(Du(),1);function vE(r){return r.replace(/[A-Z]/g,t=>"_"+t.toLowerCase()).replace(/^_/,"")}function _E(r){let t={};for(let o in r)o.startsWith("on")&&(t[vE(o.slice(2))]=r[o],t[o]=r[o]);let e=s=>Kl(this,[s],function*({data:o}){if(t[o.type])try{let u=yield t[o.type](o.data);if(u!=null&&u.$transfer&&Array.isArray(u.$transfer)){let c=u.$transfer;delete u.$transfer,self.postMessage({type:\`\${o.type}_result\`,key:o.key,data:u},c)}else self.postMessage({type:\`\${o.type}_result\`,key:o.key,data:u})}catch(u){self.postMessage({type:\`\${o.type}_result\`,key:o.key,error:u})}else self.postMessage({type:\`\${o.type}_result\`,key:o.key,error:"no_event"})});return self.addEventListener("message",e),()=>{self.removeEventListener("message",e)}}function Uu(r,t=!1){let e=r[0].index!==null,o=new Set(Object.keys(r[0].attributes)),s=new Set(Object.keys(r[0].morphAttributes)),u={},c={},h=r[0].morphTargetsRelative,p=new Ei,d=0;for(let m=0;m<r.length;++m){let y=r[m],v=0;if(e!==(y.index!==null))return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+m+". All geometries must have compatible attributes; make sure index attribute exists among all geometries, or in none of them."),null;for(let E in y.attributes){if(!o.has(E))return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+m+'. All geometries must have compatible attributes; make sure "'+E+'" attribute exists among all geometries, or in none of them.'),null;u[E]===void 0&&(u[E]=[]),u[E].push(y.attributes[E]),v++}if(v!==o.size)return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+m+". Make sure all geometries have the same number of attributes."),null;if(h!==y.morphTargetsRelative)return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+m+". .morphTargetsRelative must be consistent throughout all geometries."),null;for(let E in y.morphAttributes){if(!s.has(E))return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+m+". .morphAttributes must be consistent throughout all geometries."),null;c[E]===void 0&&(c[E]=[]),c[E].push(y.morphAttributes[E])}if(t){let E;if(e)E=y.index.count;else if(y.attributes.position!==void 0)E=y.attributes.position.count;else return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+m+". The geometry must have either an index or a position attribute"),null;p.addGroup(d,E,m),d+=E}}if(e){let m=0,y=[];for(let v=0;v<r.length;++v){let E=r[v].index;for(let b=0;b<E.count;++b)y.push(E.getX(b)+m);m+=r[v].attributes.position.count}p.setIndex(y)}for(let m in u){let y=xE(u[m]);if(!y)return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed while trying to merge the "+m+" attribute."),null;p.setAttribute(m,y)}for(let m in c){let y=c[m][0].length;if(y===0)break;p.morphAttributes=p.morphAttributes||{},p.morphAttributes[m]=[];for(let v=0;v<y;++v){let E=[];for(let A=0;A<c[m].length;++A)E.push(c[m][A][v]);let b=xE(E);if(!b)return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed while trying to merge the "+m+" morphAttribute."),null;p.morphAttributes[m].push(b)}}return p}function xE(r){let t,e,o,s=-1,u=0;for(let d=0;d<r.length;++d){let m=r[d];if(t===void 0&&(t=m.array.constructor),t!==m.array.constructor)return console.error("THREE.BufferGeometryUtils: .mergeAttributes() failed. BufferAttribute.array must be of consistent array types across matching attributes."),null;if(e===void 0&&(e=m.itemSize),e!==m.itemSize)return console.error("THREE.BufferGeometryUtils: .mergeAttributes() failed. BufferAttribute.itemSize must be consistent across matching attributes."),null;if(o===void 0&&(o=m.normalized),o!==m.normalized)return console.error("THREE.BufferGeometryUtils: .mergeAttributes() failed. BufferAttribute.normalized must be consistent across matching attributes."),null;if(s===-1&&(s=m.gpuType),s!==m.gpuType)return console.error("THREE.BufferGeometryUtils: .mergeAttributes() failed. BufferAttribute.gpuType must be consistent across matching attributes."),null;u+=m.count*e}let c=new t(u),h=new qn(c,e,o),p=0;for(let d=0;d<r.length;++d){let m=r[d];if(m.isInterleavedBufferAttribute){let y=p/e;for(let v=0,E=m.count;v<E;v++)for(let b=0;b<e;b++){let A=m.getComponent(v,b);h.setComponent(v+y,b,A)}}else c.set(m.array,p);p+=m.count*e}return s!==void 0&&(h.gpuType=s),h}function EE(r,t=!0,e=!1){let o=r.filter(h=>h.geometry.type==="polygon");if(!o.length)return null;let s=o.map(h=>{let p=h.geometry.coords,d=pu(p[0],p.slice(1)),m=new cu(d,{steps:1,bevelEnabled:!1,depth:h.height,curveSegments:4});h.deltaHeight||(h.deltaHeight=0),m.translate(0,0,h.airHeight+h.deltaHeight);let y=m.attributes.position.count,v=new Float32Array(y).fill(h.height+h.airHeight+h.deltaHeight);if(m.setAttribute("maxZ",new qn(v,1)),m.setAttribute("opacity",new qn(new Float32Array(y).fill(h.fillOpacity),1)),e){let A=new Float32Array(y).fill(h.airHeight+h.deltaHeight);m.setAttribute("minZ",new qn(A,1))}let E=new cn(h.fillColor).convertLinearToSRGB(),b=new Float32Array(y*3);for(let A=0;A<y;A++)b[A*3]=E.r,b[A*3+1]=E.g,b[A*3+2]=E.b;return m.setAttribute("color",new qn(b,3)),m}),u=Uu(s);s.forEach(h=>h.dispose());let c={geometry:u};return u.dispose(),t&&(c.lineGeometry=Qm(o)||void 0),c}function Qm(r){let{points:t,colors:e,opacities:o}=u2(r);if(!t.length)return null;let s=new Ei().setFromPoints(t);return s.setAttribute("color",new qn(new Float32Array(e),3)),s.setAttribute("opacity",new qn(new Float32Array(o),1)),s}function u2(r){let t=[],e=[],o=[];return r.filter(s=>s.strokeOpacity>0).map(s=>{let u=s.height+(s.deltaHeight||0)+s.airHeight,{coords:c}=s.geometry,{strokeColor:h,strokeOpacity:p}=s,d=new cn(h).convertLinearToSRGB();for(let m=0;m<c.length;m++){let y=c[m];for(let v=0;v<y.length;v++){let E=y[v],b=v+1===y.length?y[0]:y[v+1];t.push(new st(E[0],E[1],u)),t.push(new st(b[0],b[1],u)),e.push(d.r,d.g,d.b),e.push(d.r,d.g,d.b),o.push(p),o.push(p)}}}),{points:t,colors:e,opacities:o}}_E({onGetMergedGeometryAttributes({data:r}){let t=r.map(s=>{let u=s.geometry.coords,c=pu(u[0],u.slice(1));return new cu(c,{steps:1,bevelEnabled:!1,depth:s.height,curveSegments:4})}),e=Uu(t);t.forEach(s=>s.dispose());let o={attributes:e.attributes,index:e.index,morphAttributes:e.morphAttributes,morphTargetsRelative:e.morphTargetsRelative,groups:e.groups,boundingSphere:e.boundingSphere};return e.dispose(),o},onGetMergedShapeGeometryAttributes({data:r}){let t=r.map(s=>{var m;let u=pu(s.geometry.coords[0].slice(0,-1),s.geometry.coords.slice(1)),c=new gl(u,4),h=c.getAttribute("position"),p=[],d=new cn(s.fillColor);for(let y=0;y<h.count;y++)h.setZ(y,s.airHeight+(s.deltaHeight||0)),p.push(d.r,d.g,d.b,(m=s.fillOpacity)!=null?m:1);return c.setAttribute("color",new qn(new Float32Array(p),4)),c}),e=Uu(t);t.forEach(s=>s.dispose());let o={attributes:e.attributes,index:e.index,morphAttributes:e.morphAttributes,morphTargetsRelative:e.morphTargetsRelative,groups:e.groups,boundingSphere:e.boundingSphere};return e.dispose(),o},onGetMergedTexture2dShapeGeometryAttributes({data:r}){let t=r.map(s=>{let u=pu(s.geometry.coords[0].slice(0,-1),s.geometry.coords.slice(1)),c=new gl(u,4),h=c.getAttribute("position"),p=[1,1,1,0,0,0,0,1];c.setAttribute("uv",new Gr(p,2));let d=s.height+(s.deltaHeight||0)+s.airHeight;for(let m=0;m<h.count;m++)h.setZ(m,d);return c}),e=Uu(t);t.forEach(s=>s.dispose());let o={attributes:e.attributes,index:e.index,morphAttributes:e.morphAttributes,morphTargetsRelative:e.morphTargetsRelative,groups:e.groups,boundingSphere:e.boundingSphere};return e.dispose(),o},onGetMergedGeometriesJson({data:r}){let t=EE(r,!1);return t?{mergedGeometry:t.geometry.toJSON()}:null},onGetMergedGeometriesLineJson({data:r}){let t=Qm(r);return t?{lineGeometry:t.toJSON()}:null}});
|
|
8052
|
-
`],{type:"text/javascript"}),t=URL.createObjectURL(a),e=new Worker(t);return URL.revokeObjectURL(t),e}var jn=require("three");var sn=class{static GetMergeGeometry(t){return g(this,null,function*(){let e=yield this.WorkerPool.getWorker(),n=yield on(e,"get_merged_geometry_attributes",{data:t}),r=this.GetBufferGeometryByData(n);return this.WorkerPool.releaseWorker(e),r})}static GetMergedShapeGeometry(t){return g(this,null,function*(){let e=yield this.WorkerPool.getWorker(),n=yield on(e,"get_merged_shape_geometry_attributes",{data:t}),r=this.GetBufferGeometryByData(n);return this.WorkerPool.releaseWorker(e),r})}static GetMergedTexture2dGeometry(t){return g(this,null,function*(){let e=yield this.WorkerPool.getWorker(),n=yield on(e,"get_merged_texture2d_shape_geometry_attributes",{data:t}),r=this.GetBufferGeometryByData(n);return this.WorkerPool.releaseWorker(e),r})}static GetBufferGeometryByData(t){let e=new jn.BufferGeometry;return Object.keys(t.attributes).forEach(n=>{e.setAttribute(n,new jn.BufferAttribute(t.attributes[n].array,t.attributes[n].itemSize))}),t.index&&e.setIndex(new jn.BufferAttribute(t.index.array,t.index.itemSize)),e.morphAttributes=t.morphAttributes,e.morphTargetsRelative=t.morphTargetsRelative,e.groups=t.groups,e.boundingSphere=t.boundingSphere,e}static GetMergedGeometry(t){return g(this,null,function*(){let e=yield this.WorkerPool.getWorker(),n=yield on(e,"get_merged_geometries_json",{data:t});return this.WorkerPool.releaseWorker(e),n?Tn(Tn({},t[0]),n):null})}static GetMergedGeometryLine(t){return g(this,null,function*(){let e=yield this.WorkerPool.getWorker(),n=yield on(e,"get_merged_geometries_line_json",{data:t});return this.WorkerPool.releaseWorker(e),n?Tn(Tn({},t[0]),n):null})}static dispose(){this.WorkerPool.dispose()}};pt(sn,"WorkerPool",new kr(10,Vi));var Yn=class extends nt{getCenter(){return new kt.Box3().setFromObject(this).getCenter(new kt.Vector3)}addInstancedGraphic(t){this.instancedGraphicConfig?(this.instancedGraphicConfig.size+=t.size,this.instancedGraphicConfig.colors=[...this.instancedGraphicConfig.colors,...t.colors],this.instancedGraphicConfig.matrixes=[...this.instancedGraphicConfig.matrixes,...t.matrixes],this.instancedGraphicConfig.opacities=[...this.instancedGraphicConfig.opacities,...t.opacities],this.instancedGraphicConfig.maxZs=[...this.instancedGraphicConfig.maxZs,...t.maxZs],this.instancedGraphicConfig.ids=[...this.instancedGraphicConfig.ids,...t.ids]):this.instancedGraphicConfig=t,this.refeshInstancedGraphic()}refeshInstancedGraphic(){this.instancedGraphic&&(this.remove(this.instancedGraphic),F(this.instancedGraphic)),this.instancedGraphicConfig&&(this.instancedGraphic=new Ke(this.context,this.instancedGraphicConfig),this.add(this.instancedGraphic))}addGraphics(t,e){t.map(n=>{this.graphicDataMap.set(n.id,n),this.graphicOriginOptionMap.set(n.id,{fillOpacity:n.fillOpacity,strokeOpacity:n.strokeOpacity})}),e?e.map(n=>{if(n.instancedGeometry&&this.addInstancedGraphic(n.instancedGeometry),n.mergedGeometry){let r=new an(this.context,v({},n,{lineGeometry:null}));this.mergedGraphicGroup.add(r)}if(n.lineGeometry){let r=new Oe(this.context,n.lineGeometry);this.mergedLineGroup.add(r)}}):(this.refreshMergeGraphic(),this.refreshLine())}createGraphic(t){return g(this,null,function*(){let e=yield sn.GetMergedGeometry(t);if(F(this.mergedGraphicGroup),this.mergedGraphicGroup.clear(),e){let n=new an(this.context,e);this.mergedGraphicGroup.add(n)}})}createLine(t){return g(this,null,function*(){let e=yield sn.GetMergedGeometryLine(t);if(F(this.mergedLineGroup),this.mergedLineGroup.clear(),e){let n=new Oe(this.context,e.lineGeometry);this.mergedLineGroup.add(n)}})}refreshMergeGraphic(){let t=Array.from(this.graphicDataMap.values());this.instancedGraphicConfig&&(t=t.filter(e=>{var n;return!((n=this.instancedGraphicConfig)!=null&&n.ids.includes(e.id))})),this.createGraphic(t)}refreshLine(){let t=Array.from(this.graphicDataMap.values());this.createLine(t)}removeGraphicById(t){var e;if(this.graphicDataMap.delete(t),(e=this.instancedGraphicConfig)!=null&&e.ids.includes(t)){let n=this.instancedGraphicConfig.ids.findIndex(r=>r===t);this.instancedGraphicConfig.size--,this.instancedGraphicConfig.colors.splice(n*3,3),this.instancedGraphicConfig.matrixes.splice(n*16,16),this.instancedGraphicConfig.opacities.splice(n,1),this.instancedGraphicConfig.maxZs.splice(n,1),this.instancedGraphicConfig.ids.splice(n,1),this.refeshInstancedGraphic()}else this.refreshMergeGraphic();this.refreshLine()}getGraphicDataByNodeId(t){return this.graphicMap.get(t)||null}setGraphicOptions(t,e){var n;let r,i=this.graphicDataMap.get(t);if(i){if(typeof e=="function"?r=e(i):r=v({},i,e),this.graphicDataMap.set(t,r),(n=this.instancedGraphicConfig)!=null&&n.ids.includes(t)&&this.instancedGraphic){this.instancedGraphic.setColorById(t,r.fillColor),this.instancedGraphic.setOpacityById(t,r.fillOpacity),this.instancedGraphic.setMaxZById(t,r.deltaHeight+r.airHeight+r.height);let o=this.instancedGraphicConfig.ids.findIndex(p=>p===t),s=this.instancedGraphicConfig.matrixes.slice(o*16,(o+1)*16),u=new kt.Matrix4().fromArray(s),l=new kt.Vector3,c=new kt.Quaternion,h=new kt.Vector3;u.decompose(l,c,h),h.z=r.height,l.z=r.deltaHeight+r.airHeight+r.height/2,u.compose(l,c,h),this.instancedGraphic.setMatrixById(t,u)}else this.refreshMergeGraphic();this.refreshLine()}}getGraphicPosition(t){let e=this.graphicDataMap.get(t);return e?[e.center_x,e.center_y]:null}setOpacity(t,e){e===void 0&&(e=!1);var n;this.graphicDataMap.forEach((r,i)=>{if(e)r.fillOpacity=t,r.strokeOpacity=t;else{let u=this.graphicOriginOptionMap.get(i);var o;r.fillOpacity=Math.min(t,(o=u==null?void 0:u.fillOpacity)!=null?o:1);var s;r.strokeOpacity=Math.min(t,(s=u==null?void 0:u.strokeOpacity)!=null?s:1)}}),(n=this.instancedGraphic)==null||n.setOpacity(t,e),this.refeshInstancedGraphic(),this.refreshLine()}dispose(){super.dispose(),this.mergedGraphicGroup.clear(),this.mergedLineGroup.clear(),this.instancedGraphic=null,this.instancedGraphicConfig=null}constructor(t){super(t),this.graphicMap=new Map,this.mergedGraphicGroup=new kt.Group,this.mergedLineGroup=new kt.Group,this.graphicDataMap=new Map,this.graphicOriginOptionMap=new Map,this.instancedGraphic=null,this.instancedGraphicConfig=null,this.add(this.mergedGraphicGroup),this.add(this.mergedLineGroup)}};var md=require("core-js/modules/web.dom-collections.iterator.js"),_d=require("core-js/modules/es.array.push.js");var _t=require("three");var ld=require("core-js/modules/es.string.replace.js"),cd=require("core-js/modules/es.regexp.exec.js"),hd=require("core-js/modules/es.error.cause.js"),pd=require("core-js/modules/web.dom-collections.iterator.js"),Vr=require("three");var Zn=class{setBaseUrl(t){this.baseUrl=t.replace(/\/$/,"")}setConfig(t){this.config=t}loadConfig(){return g(this,null,function*(){if(this.config)return this.config;if(!this.baseUrl)throw new Error("Base URL is not set");try{let t=yield fetch(""+this.baseUrl+"/config.json");return this.config=yield t.json(),this.config}catch(t){return console.error("Failed to load tile config:",t),this.config={extent:[12276734621488994e-9,2.1183542845726013e6,12279646804065457e-9,2121524247761597e-9],maxZoom:21,minZoom:11},this.config}})}buildTileUrl(t,e,n){if(!this.baseUrl)throw new Error("Base URL is not set");return this.baseUrl+"/"+n+"/"+t+"/"+e+".png"}loadTileTexture(t,e,n){return g(this,null,function*(){if(!this.baseUrl)throw new Error("Base URL is not set");let r=this.buildTileUrl(t,e,n);if(this.textureCache.has(r)){let o=this.textureCache.get(r);return o instanceof Promise?o:Promise.resolve(o)}let i=this.textureLoader.loadAsync(r).then(o=>(o.flipY=!0,o.colorSpace=Vr.SRGBColorSpace,this.textureCache.set(r,o),o)).catch(o=>null);return this.textureCache.set(r,i),i})}clearCache(){this.textureCache.forEach(t=>{t instanceof Promise?t.then(e=>e==null?void 0:e.dispose()):t.dispose()}),this.textureCache.clear()}dispose(){this.clearCache()}constructor(t){this.baseUrl="",this.config=null,this.textureCache=new Map,this.textureLoader=new Vr.TextureLoader,t&&this.setBaseUrl(t)}};var zs=require("lodash");var Bs={base_url:"https://robot-vr-public.aibee.cn/static_resource/tiles"},De=class a extends nt{loadTileConfig(){return g(this,null,function*(){return this.tileLoader.loadConfig()})}initEvents(){this.context.addEventListener("control-change",this.onUpdate),this.context.bmap.addEventListener("center-change",this.onCenterChange)}removeEvents(){this.context.removeEventListener("control-change",this.onUpdate),this.context.bmap.removeEventListener("center-change",this.onCenterChange)}getViewBounds(){let t=this.context.camera,e=new _t.Raycaster,n=new _t.Vector2,r=[],[i,o]=this.context.center||[0,0],s=[{x:-1,y:1},{x:1,y:1},{x:1,y:-1},{x:-1,y:-1}];for(let p of s){n.set(p.x,p.y),e.setFromCamera(n,t);let f=new _t.Vector3(0,0,1),d=new _t.Vector3(0,0,0),m=new _t.Plane().setFromNormalAndCoplanarPoint(f,d),y=new _t.Vector3;e.ray.intersectPlane(m,y)?r.push(y):(e.ray.direction.negate(),e.ray.intersectPlane(m,y)&&r.push(y))}if(r.length<4)return null;let u=1/0,l=1/0,c=-1/0,h=-1/0;return r.forEach(p=>{u=Math.min(u,p.x+i),l=Math.min(l,p.y+o),c=Math.max(c,p.x+i),h=Math.max(h,p.y+o)}),{minX:u,minY:l,maxX:c,maxY:h}}getTileZoomLevel(t,e){let{minZoom:n,maxZoom:r}=e,i=this.context.camera,o=(i.right-i.left)/i.zoom,s=this.context.clientSize.width,u=o/s,l=a.WORLD_WIDTH,c=Math.log2(l/(u*this.tileSize));return Math.min(r,Math.max(n,Math.round(c)))}getTilesInView(t,e,n){let[r,i,o,s]=n.extent,u=Math.max(t.minX,r),l=Math.max(t.minY,i),c=Math.min(t.maxX,o),h=Math.min(t.maxY,s);if(u>=c||l>=h)return[];let p=Math.pow(2,e),f=a.WORLD_WIDTH/p,d=a.WORLD_WIDTH_HALF,m=Math.max(0,Math.floor((u+d)/f)),y=Math.floor((c+d)/f),x=Math.max(0,Math.floor((d-h)/f)),E=Math.floor((d-l)/f),S=[];for(let R=m;R<=y;R++)for(let P=x;P<=E;P++)S.push({x:R,y:P,z:e});return S}renderTiles(t,e){return g(this,null,function*(){let n=t,r=[];if(this.currentLevel!==e)r=[...this.tileGroup.children];else{let s=this.tileGroup.children,u=s.map(c=>c.userData.key),l=t.map(c=>c.z+"/"+c.x+"/"+c.y);n=t.filter(c=>!u.includes(c.z+"/"+c.x+"/"+c.y)),r=s.filter(c=>!l.includes(c.userData.key))}let i=Math.pow(2,e),o=a.WORLD_WIDTH/i;yield Promise.all(n.map(s=>g(this,null,function*(){let u=s.z+"/"+s.x+"/"+s.y,l=yield this.tileLoader.loadTileTexture(s.x,s.y,s.z);if(l){let c=new _t.MeshBasicMaterial({map:l,transparent:!0}),h=new _t.Mesh(this.baseGeometry,c);h.scale.setX(o).setY(o),h.position.set((s.x-i/2)*o+o/2,-((s.y-i/2)*o)-o/2,0),h.userData.key=u,this.tileGroup.add(h)}}))),this.tileGroup.children.forEach(s=>{r.includes(s)&&(s.material.dispose(),this.tileGroup.remove(s))})})}setVisibility(t){this.visible=t,t&&this.onUpdate()}setOpacity(t){super.setOpacity(t)}clearTiles(){this.tileGroup.children.forEach(t=>{t.material.dispose()}),this.tileGroup.clear()}dispose(){this.removeEvents(),this.clearTiles(),this.baseGeometry.dispose(),this.tileLoader.dispose(),super.dispose()}constructor(t,e){super(t),this.loadedTiles=new Map,this.currentLevel=0,this.tileSize=256,this.baseGeometry=new _t.PlaneGeometry(1,1),this.options=Bs,this.onUpdate=()=>{this.updateTiles()},this.onCenterChange=()=>{let{center:r}=this.context;this.tileGroup.position.set(-r[0],-r[1],0),this.updateTiles()},this.updateTiles=(0,zs.debounce)(()=>g(this,null,function*(){if(!this.visible)return;let r=yield this.loadTileConfig(),i=this.context.camera,o=this.getViewBounds();if(!o)return;let s=this.getTileZoomLevel(i.zoom,r),u=this.getTilesInView(o,s,r);this.renderTiles(u,s)}),100),this.options=v({},Bs,e),this.tileGroup=new _t.Group;let{center:n}=t;this.tileGroup.position.set(-n[0],-n[1],0),this.add(this.tileGroup),this.tileLoader=new Zn(this.options.base_url),this.initEvents(),this.updateTiles()}};De.WORLD_WIDTH=4007501668e-2;De.WORLD_WIDTH_HALF=De.WORLD_WIDTH/2;var Sd=require("core-js/modules/es.array.push.js"),Md=require("core-js/modules/web.dom-collections.iterator.js"),wd=require("core-js/modules/es.string.trim.js");var Tt=require("three");var Ue=require("lodash");var Su={text:"",icon:"",icon_size:[22,22],level:1,collision_enable:!0,opacity:1,id:"",position:{x:0,y:0,z:0},text_font_size:14,icon_rotate:0,depth_test:!1,hide_text:!1,maxWeight:25,minWeight:1,text_opacity:1,icon_opacity:1},st=class extends Tt.Object3D{get hasText(){return!this.options.hide_text&&this.options.text}get durIconAndText(){return this.options.icon&&this.hasText?2:0}get offset(){return this.options.icon&&this.hasText?0:.5}get iconWidth(){return this.options.icon?this.options.icon_size[0]:0}get iconHeight(){return this.options.icon?this.options.icon_size[1]:0}get textWidth(){return this.hasText?this.textHeight*this.textAspect:0}get textHeight(){return this.hasText?this.options.text_font_size*this.textureLines:0}get hasOriginTexture(){let{text_texture:t,text_texture_width:e,text_texture_height:n,text_texture_offset_x:r,text_texture_offset_y:i}=this.options;return!(0,Ue.isNil)(t)&&!(0,Ue.isNil)(e)&&!(0,Ue.isNil)(n)&&!(0,Ue.isNil)(r)&&!(0,Ue.isNil)(i)}get inited(){return!this.options.text||this.options.text&&this.textTexture}get deltaZ(){return this.options.icon&&this.hasText?.1+this.offset*(this.iconHeight+this.durIconAndText+this.textHeight)/this.context.camera.zoom:this.hasText?.1+.5*this.textHeight/this.context.camera.zoom:.1}get canSelect(){return this.visible&&this._shouldShow}show(){return g(this,null,function*(){if(this._shouldShow)return;this._shouldShow=!0;let t=[];if(!this.spriteIcon&&this.options.icon&&t.push(this.initIcon()),!this.spriteText&&this.hasText&&t.push(this.initText()),yield Promise.all(t),!this._shouldShow){this.hide();return}this.initSize(),this._initScale({zoom:this.context.camera.zoom}),this.spriteIcon&&(this.spriteIcon.visible=!0),this.spriteText&&(this.spriteText.visible=!0)})}hide(){this._shouldShow=!1,this.spriteIcon&&(this.remove(this.spriteIcon),this.spriteIcon.material.dispose(),this.spriteIcon=void 0),this.spriteText&&(this.remove(this.spriteText),this.spriteText.material.dispose(),this.spriteText=void 0)}registryEvent(){this.context.addEventListener("control-zoom-change",this._initScale),this.addEventListener("change-icon",t=>g(this,null,function*(){let{value:e}=t;this._shouldShow&&(this.hide(),yield this.show()),this.context.forceUpdate()})),this.addEventListener("change-text",t=>g(this,null,function*(){let{value:e}=t;this._shouldShow&&(this.hide(),yield this.show()),this.context.forceUpdate()})),this.addEventListener("change-text_font_size",t=>g(this,null,function*(){let{value:e}=t;this._shouldShow&&(this.hide(),yield this.show())})),this.addEventListener("change-icon_rotate",t=>{let{value:e}=t;this.spriteIcon&&(this.spriteIcon.material.rotation=e/180*Math.PI)}),this.addEventListener("change-icon_size",t=>{let{value:e}=t;this._initScale({zoom:this.context.camera.zoom}),this.options.icon&&this.context.forceUpdate()}),this.addEventListener("change-depth_test",t=>{let{value:e}=t;this.spriteIcon&&(this.spriteIcon.material.depthTest=e),this.spriteText&&(this.spriteText.material.depthTest=e)}),this.addEventListener("change-icon_opacity",t=>{let{value:e}=t;this.spriteIcon&&(this.spriteIcon.material.opacity=e)}),this.addEventListener("change-text_opacity",t=>{let{value:e}=t;this.spriteText&&(this.spriteText.material.opacity=e)})}unRegistryEvent(){this.context.removeEventListener("control-zoom-change",this._initScale)}getPosition(){return this.position}initIcon(){return g(this,null,function*(){if(this.options.icon)return this._initIconPromise=new Promise(t=>g(this,null,function*(){let e;if(this.options.icon_border){let{icon:r,icon_size:i,icon_border:o}=this.options;e=yield gt.getUrlTextureBorder(r,i[0]-o.width*2,o)}else e=yield gt.getTextureByUrl(this.options.icon);let n=new Tt.Sprite(new Tt.SpriteMaterial({map:e,transparent:!0,alphaTest:.2,depthTest:this.options.depth_test,rotation:this.options.icon_rotate/180*Math.PI,opacity:this.options.icon_opacity}));n.visible=!1,n.renderOrder=1e5+this.options.level,e.needsUpdate=!0,this.add(n),this.spriteIcon=n,t(n)})).then(()=>{this._initIconPromise=null})})}initText(){return g(this,null,function*(){if(this.hasText){let t=this.textTexture;if(!t)return;let e=new Tt.Sprite(new Tt.SpriteMaterial({map:t,transparent:!0,alphaTest:.2,depthTest:this.options.depth_test,opacity:this.options.text_opacity}));e.visible=!1,e.renderOrder=100001+this.options.level,t.needsUpdate=!0,this.spriteText=e,this.add(e)}})}initSize(){var t,e;let n=0,r=0,{icon:i}=this.options;i?this.hasText?(n=0,r=n*(this.iconHeight/this.textHeight)-this.iconHeight/this.textHeight-this.durIconAndText/this.textHeight):(n=.5,r=0):this.hasText?(r=.5,n=0):(n=0,r=0),(t=this.spriteIcon)==null||t.center.set(.5,n),(e=this.spriteText)==null||e.center.set(.5,r)}init(){return g(this,null,function*(){yield Promise.all([this.initIcon(),this.initText()]),this.initSize(),this._initScale({zoom:this.context.camera.zoom})})}resetZ(){let t=this.deltaZ;this.spriteIcon&&(this.spriteIcon.position.z=t),this.spriteText&&(this.spriteText.position.z=t)}getBox(t){if(!this.inited)return this.initTextTexture(),null;let{clientSize:{width:e,height:n}}=this.context,r=e*(t.x+1)/2,i=n*(-t.y+1)/2;i+=this.offset*(this.iconHeight+this.durIconAndText+this.textHeight);let o=this.iconWidth/2,s=new Tt.Box2(new Tt.Vector2(r-o,i-this.iconHeight),new Tt.Vector2(r+o,i)),u=this.textWidth/2,l=new Tt.Box2(new Tt.Vector2(r-u,i-this.textHeight-this.durIconAndText-this.iconHeight),new Tt.Vector2(r+u,i-this.iconHeight-this.durIconAndText));return this.box=l.union(s),this.box}renderBoxHelper(t,e){if(!this.boxHelper){let n=document.createElement("div");n.style.position="absolute",n.style.zIndex="999",n.style.border="1px solid red",n.style.pointerEvents="none",this.boxHelper=n,this.context.container.appendChild(n)}t&&e?(this.boxHelper.style.left=t+"px",this.boxHelper.style.top=e+"px",this.boxHelper.style.width="2px",this.boxHelper.style.height="2px"):(this.boxHelper.style.left=this.box.min.x+"px",this.boxHelper.style.top=this.box.min.y+"px",this.boxHelper.style.width=this.box.max.x-this.box.min.x+"px",this.boxHelper.style.height=this.box.max.y-this.box.min.y+"px")}parentSetVisible(t){t?this.show():this.hide(),this.boxHelper&&(this.boxHelper.style.display=t?"block":"none")}dispose(){this.hide(),this.unRegistryEvent(),this._listeners={}}constructor(t,e){var n;super(),this.context=t,this.textAspect=1,this.box=new Tt.Box2,this._initIconPromise=null,this.textureLines=1,this._shouldShow=!1,this.initTextTexture=(0,Ue.once)(()=>g(this,null,function*(){if(!this.options.text||this.textTexture)return;let i;if(this.hasOriginTexture){let{text_texture:o,text_texture_width:s,text_texture_height:u,text_texture_offset_x:l,text_texture_offset_y:c}=this.options;i=this.options.text_texture.clone(),i.uuid=o.uuid,i.offset.set(l/i.image.width,1-(u+c)/i.image.height),i.repeat.set(s/i.image.width,u/i.image.height),this.textAspect=s/u}else{let o=yield dt.getTextureByText(this.options.text);i=o.texture,this.textureLines=o.lines,this.textAspect=i.image.width/i.image.height}this.textTexture=i,this.dispatchEvent({type:"text-texture-inited"})})),this._initScale=i=>{let{zoom:o}=i;if(this.spriteText){let u=this.textHeight/o;this.spriteText.scale.set(this.textAspect*u,u,.1)}if(this.spriteIcon){var s;(s=this.spriteIcon)==null||s.scale.set(this.options.icon_size[0]/o,this.options.icon_size[1]/o,.1)}this.resetZ()};var r;this.options=Ve(v({},Su,e,{text:(r=(n=e.text)==null?void 0:n.trim())!=null?r:""}),this),this.position.set(this.options.position.x,this.options.position.y,this.options.position.z),this.registryEvent()}};var re=class extends Dt.Object3D{getPosition(){return this.box.getCenter(new Dt.Vector3)}onAddToScene(t){this.poiLayer2.onAddToScene(t)}onRemoveFromScene(){this.poiLayer2.onRemoveFromScene()}createGround(t){let e=new mt(this.context,t);e.userData.data=t,this.addGrounds([e])}addGrounds(t){t.forEach(e=>{this.grounds.has(e)||(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+.01}get hasElement(){return!!(this.grounds.size||this.graphicLayer.children.length)}getCenter(){return new Dt.Box3().setFromObject(this).getCenter(new Dt.Vector3)}addModel(t){let e=new Gn(this.context,t);return this.models.add(e),this.modelMap.set(t.id,e),e}addShadow(){let t=new Dt.Box3().setFromObject(this.groundUpper),e=t.getCenter(new Dt.Vector3),n=t.getSize(new Dt.Vector3);this.shadow.setPosition(e),this.shadow.changeLightCamera(n)}addGraphic(t){return this.graphicLayer.createGraphic(t)}addPoi(t){return this.poiLayer.createPoi(t)}addPoi2(t){let e=new st(this.context,t);return this.poiLayer2.pushPoi(e),e}removePoi2(t){return this.poiLayer2.removePoi(t)}removePoi2ById(t){return this.poiLayer2.removePoiById(t)}addHeatmap(t){this.heatmap||(this.heatmap=new zn(this.context),this.add(this.heatmap)),this.heatmap.loadData(t);let e=new Dt.Box3().setFromObject(this.graphicLayer);return this.heatmap.position.setZ(e.max.z+.1),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}setGraphicOptions(t,e){this.graphicLayer.graphicMap.has(t)?this.graphicLayer.setGraphicOptions(t,e):this.mergeGraphicLayer.setGraphicOptions(t,e)}getGraphicPosition(t){return this.graphicLayer.getGraphicPosition(t)||this.mergeGraphicLayer.getGraphicPosition(t)||this.parkingSpaceLayer.getGraphicPosition(t)}changeParkingColor(t){this.parkingSpaceLayer.changeParkingColor(t)}getParkingOptionsByParkingNo(t){return this.parkingSpaceLayer.getParkingOptionsByParkingNo(t)}updateBox(){this.box.setFromObject(this.groundLayer)}getGraphics(){return this.graphicLayer.children.filter(t=>t instanceof mt)}setOpacity(t,e){e===void 0&&(e=!1),this.groundLayer.setOpacity(t,e),this.graphicLayer.setOpacity(t,e),this.mergeGraphicLayer.setOpacity(t,e),this.poiLayer2.setOpacity(t),this.parkingSpaceLayer.setOpacity(t,e),this.laneLayer.setOpacity(t,e),this.wallLayer.setOpacity(t,e),this.textureLayer.setOpacity(t),this.textTextureLayer.setOpacity(t),this.glbModelLayer.setOpacity(t,e),this.userData.opacity=t}dispose(){var t;console.log("floor dispose",this.name),this.shadow.dispose(),this.groundLayer.dispose(),this.graphicLayer.dispose(),this.poiLayer.dispose(),this.poiLayer2.dispose(),this.parkingSpaceLayer.dispose(),this.wallLayer.dispose(),this.textureLayer.dispose(),this.glbModelLayer.dispose(),this.laneLayer.dispose(),this.mergeGraphicLayer.dispose(),this.textTextureLayer.dispose(),this.grounds.forEach(e=>e.dispose()),(t=this.heatmap)==null||t.dispose(),this.groundUpper.clear(),this.models.children.forEach(e=>e.dispose()),this.models.clear(),this.modelMap.clear(),this.clear()}constructor(t){super(),this.context=t,this.grounds=new Set,this.shadow=new Bn,this.groundUpper=new Dt.Object3D,this.models=new Dt.Object3D,this.modelMap=new Map,this.groundMaxHeight=0,this.name="",this.key="",this.box=new Dt.Box3,this.groundLayer=new nt(this.context),this.graphicLayer=new kn(this.context),this.poiLayer=new Vn(this.context),this.poiLayer2=new Hn(this.context),this.parkingSpaceLayer=new Wn(this.context),this.wallLayer=new nt(this.context),this.textureLayer=new nt(this.context),this.glbModelLayer=new Xn(this.context),this.laneLayer=new nt(this.context),this.mergeGraphicLayer=new Yn(this.context),this.textTextureLayer=new nt(this.context),this.groundUpper.add(this.graphicLayer),this.groundUpper.add(this.poiLayer),this.groundUpper.add(this.poiLayer2),this.groundUpper.add(this.parkingSpaceLayer),this.groundUpper.add(this.wallLayer),this.groundUpper.add(this.textureLayer),this.groundUpper.add(this.glbModelLayer),this.groundUpper.add(this.laneLayer),this.groundUpper.add(this.mergeGraphicLayer),this.groundUpper.add(this.textTextureLayer),this.add(this.groundUpper),this.add(this.groundLayer),this.add(this.models)}};var jd=require("core-js/modules/es.array.push.js"),Yd=require("core-js/modules/web.dom-collections.iterator.js");var Hr=require("three");var Vt=class extends Hr.EventDispatcher{_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:n}=this.context,{offsetX:r,offsetY:i}=t,{clientWidth:o,clientHeight:s}=n.domElement,u=r/o*2-1,l=1-i/s*2;return new Hr.Vector3(u,l,0).unproject(e)}getSvgCoordinate(t){let{camera:e,container:n}=this.context;return N(t,e,n.clientWidth,n.clientHeight)}dispose(){this._unRegistryEvent(),this.context.container.removeChild(this.svg),this.svg=null}constructor(t){super(),this.context=t,this.points=[],this.enable=!0,this._onResize=e=>{let{width:n,height:r}=e;this.svg&&(this.svg.setAttribute("width",""+n),this.svg.setAttribute("height",""+r))},this.svg=bi(""+t.container.clientWidth,""+t.container.clientHeight),t.container.appendChild(this.svg),this._registryEvent()}};var Kn=class extends Vt{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)}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:n,y:r}]=this.points;return Math.sqrt((n-t)**2+(r-e)**2)}dispose(){super.dispose(),this.unRegistryEvent(),this.line=null,this.circles=[]}constructor(t){super(t),this.context=t,this.onUpdate=()=>{if(this.points[0]){let r=this.getSvgCoordinate(this.points[0]);Ce(this.circles[0],r.x,r.y),Yt(this.line,r)}if(this.points[1]){let r=this.getSvgCoordinate(this.points[1]);Ce(this.circles[1],r.x,r.y),Yt(this.line,void 0,r)}},this.onPointermove=r=>{this.points.length===1&&(this.line.style.display="block",Yt(this.line,void 0,{x:r.offsetX,y:r.offsetY}))},this.onPointerleave=()=>{this.points[1]||(this.line.style.display="none")},this.onPointerdown=r=>{if(this.points[1])return;let i=this.getIntersectByPointerEvent(r);if(i){let{offsetX:o,offsetY:s}=r,u=this.circles[this.points.length];Ce(u,o,s),this.points.length||Yt(this.line,{x:o,y:s},{x:o,y:s}),this.addPoint(i)}};let{config:{svg:{circle:e,line:n}}}=t;this.circles=[tn(e.radius,e.fill),tn(e.radius,e.fill)],this.line=Rn(n.stroke),this.svg.appendChild(this.circles[0]),this.svg.appendChild(this.circles[1]),this.svg.appendChild(this.line),this.registryEvent()}};var Jd=require("core-js/modules/es.array.push.js");var $n=class extends Vt{setEnable(t){super.setEnable(t),t?this.registryEvent():this.unRegistryEvent()}get lastLine(){return this.lines.slice(-1)[0]}addCircle(t){this.circles.push(t),this.svg.appendChild(t)}addLine(t){this.lines.push(t),this.svg.appendChild(t)}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)}checkAdsorb(t,e){if(this.points.length<3)return!1;let n=this.circles[0],r=+n.getAttribute("cx"),i=+n.getAttribute("cy");return Math.sqrt((t-r)**2+(e-i)**2)<=5}addPoint(t){if(this.points.push(t),this.isClose){let e=this.calculatedArea();this.dispatchEvent({type:"area",area:e})}}calculatedArea(){let t=this.points.map(r=>[r.x,r.y]),e=0,n=t.length;for(let r=0;r<n;r++){let i=(r+1)%n;e+=t[r][0]*t[i][1]-t[i][0]*t[r][1]}return Math.abs(e/2)}dispose(){super.dispose(),this.unRegistryEvent(),this.lines=[],this.circles=[]}constructor(t){super(t),this.circles=[],this.lines=[],this.isClose=!1,this.onUpdate=()=>{this.points.length&&this.points.forEach((e,n)=>{let r=this.getSvgCoordinate(e);this.circles[n]&&Ce(this.circles[n],r.x,r.y),n!==0&&Yt(this.lines[n-1],void 0,r),this.lines[n]&&Yt(this.lines[n],r)})},this.onPointermove=e=>{!this.lastLine||this.isClose||(this.lastLine.style.display="block",Yt(this.lastLine,void 0,{x:e.offsetX,y:e.offsetY}))},this.onPointerleave=()=>{this.isClose||(this.lastLine.style.display="none")},this.onPointerdown=e=>{if(this.isClose)return;let n=this.getIntersectByPointerEvent(e);if(n){let{offsetX:r,offsetY:i}=e;this.checkAdsorb(r,i)?(this.isClose=!0,this.addPoint(this.points[0])):this.addPoint(n);let{circle:{fill:o,radius:s},line:{stroke:u}}=this.context.config.svg;if(!this.isClose){let l=tn(s,o);Ce(l,r,i),this.addCircle(l)}if(this.lines.length&&Yt(this.lastLine,void 0,{x:r,y:i}),!this.isClose){let l=Rn(u);Yt(l,{x:r,y:i},{x:r,y:i}),this.addLine(l)}}},this.registryEvent()}};var Gs=require("three");var Hi=class extends Vt{setEnable(t){super.setEnable(t),t?this.registryEvent():this.unRegistryEvent()}registryEvent(){this.context.addEventListener("update",this.onUpdate)}unRegistryEvent(){this.context.removeEventListener("update",this.onUpdate)}selectGraphic(t){this.graphic=t}dispose(){super.dispose(),this.unRegistryEvent(),this.rect=null,this.cornerRect=[],this.centerRect=[]}constructor(t){super(t),this.context=t,this.cornerRect=[],this.centerRect=[],this.onUpdate=()=>{if(this.graphic){let n=new Gs.Box3().setFromObject(this.graphic),{camera:r,container:{clientWidth:i,clientHeight:o}}=this.context,{min:s,max:u}=n,l=N(s,r,i,o),c=N(u,r,i,o);Ct(this.rect,l.x,c.y,Math.abs(c.x-l.x),Math.abs(c.y-l.y));let{x:h,y:p}=l,{x:f,y:d}=c,m=5,y=[{x:h-m,y:d-m},{x:f-m,y:d-m},{x:h-m,y:p-m},{x:f-m,y:p-m}];for(let P=0;P<y.length;P++)Ct(this.cornerRect[P],y[P].x,y[P].y,m*2,m*2);let x=4,E=(h+f)/2,S=(p+d)/2,R=[{x:E-x,y:d-x},{x:h-x,y:S-x},{x:f-x,y:S-x},{x:E-x,y:p-x}];for(let P=0;P<R.length;P++)Ct(this.centerRect[P],R[P].x,R[P].y,x*2,x*2)}else{Ct(this.rect,0,0,0,0);for(let n=0;n<this.cornerRect.length;n++)Ct(this.cornerRect[n],0,0,0,0),Ct(this.centerRect[n],0,0,0,0)}};let{config:{svg:{line:e}}}=t;this.rect=Ee(e.stroke,"transparent"),this.svg.appendChild(this.rect);for(let n=0;n<4;n++)this.cornerRect[n]=Ee(e.stroke,"#ffffff"),this.centerRect[n]=Ee(e.stroke,"#ffffff"),this.svg.appendChild(this.cornerRect[n]),this.svg.appendChild(this.centerRect[n]);this.registryEvent()}};var og=require("core-js/modules/es.array.push.js"),At=require("three");var ks=require("three/examples/jsm/utils/BufferGeometryUtils.js");var Jn=class extends At.Object3D{initGeometry(){return g(this,null,function*(){let t=yield ne.GetMergeGeometry(this.options);this.geometry=t})}initMaterial(){let t=`
|
|
8052
|
+
`],{type:"text/javascript"}),t=URL.createObjectURL(a),e=new Worker(t);return URL.revokeObjectURL(t),e}var jn=require("three");var sn=class{static GetMergeGeometry(t){return g(this,null,function*(){let e=yield this.WorkerPool.getWorker(),n=yield on(e,"get_merged_geometry_attributes",{data:t}),r=this.GetBufferGeometryByData(n);return this.WorkerPool.releaseWorker(e),r})}static GetMergedShapeGeometry(t){return g(this,null,function*(){let e=yield this.WorkerPool.getWorker(),n=yield on(e,"get_merged_shape_geometry_attributes",{data:t}),r=this.GetBufferGeometryByData(n);return this.WorkerPool.releaseWorker(e),r})}static GetMergedTexture2dGeometry(t){return g(this,null,function*(){let e=yield this.WorkerPool.getWorker(),n=yield on(e,"get_merged_texture2d_shape_geometry_attributes",{data:t}),r=this.GetBufferGeometryByData(n);return this.WorkerPool.releaseWorker(e),r})}static GetBufferGeometryByData(t){let e=new jn.BufferGeometry;return Object.keys(t.attributes).forEach(n=>{e.setAttribute(n,new jn.BufferAttribute(t.attributes[n].array,t.attributes[n].itemSize))}),t.index&&e.setIndex(new jn.BufferAttribute(t.index.array,t.index.itemSize)),e.morphAttributes=t.morphAttributes,e.morphTargetsRelative=t.morphTargetsRelative,e.groups=t.groups,e.boundingSphere=t.boundingSphere,e}static GetMergedGeometry(t){return g(this,null,function*(){let e=yield this.WorkerPool.getWorker(),n=yield on(e,"get_merged_geometries_json",{data:t});return this.WorkerPool.releaseWorker(e),n?Tn(Tn({},t[0]),n):null})}static GetMergedGeometryLine(t){return g(this,null,function*(){let e=yield this.WorkerPool.getWorker(),n=yield on(e,"get_merged_geometries_line_json",{data:t});return this.WorkerPool.releaseWorker(e),n?Tn(Tn({},t[0]),n):null})}static dispose(){this.WorkerPool.dispose()}};pt(sn,"WorkerPool",new kr(10,Vi));var Yn=class extends nt{getCenter(){return new kt.Box3().setFromObject(this).getCenter(new kt.Vector3)}addInstancedGraphic(t){this.instancedGraphicConfig?(this.instancedGraphicConfig.size+=t.size,this.instancedGraphicConfig.colors=[...this.instancedGraphicConfig.colors,...t.colors],this.instancedGraphicConfig.matrixes=[...this.instancedGraphicConfig.matrixes,...t.matrixes],this.instancedGraphicConfig.opacities=[...this.instancedGraphicConfig.opacities,...t.opacities],this.instancedGraphicConfig.maxZs=[...this.instancedGraphicConfig.maxZs,...t.maxZs],this.instancedGraphicConfig.ids=[...this.instancedGraphicConfig.ids,...t.ids]):this.instancedGraphicConfig=t,this.refeshInstancedGraphic()}refeshInstancedGraphic(){this.instancedGraphic&&(this.remove(this.instancedGraphic),F(this.instancedGraphic)),this.instancedGraphicConfig&&(this.instancedGraphic=new Ke(this.context,this.instancedGraphicConfig),this.add(this.instancedGraphic))}addGraphics(t,e){t.map(n=>{this.graphicDataMap.set(n.id,n),this.graphicOriginOptionMap.set(n.id,{fillOpacity:n.fillOpacity,strokeOpacity:n.strokeOpacity})}),e?e.map(n=>{if(n.instancedGeometry&&this.addInstancedGraphic(n.instancedGeometry),n.mergedGeometry){let r=new an(this.context,v({},n,{lineGeometry:null}));this.mergedGraphicGroup.add(r)}if(n.lineGeometry){let r=new Oe(this.context,n.lineGeometry);this.mergedLineGroup.add(r)}}):(this.refreshMergeGraphic(),this.refreshLine())}createGraphic(t){return g(this,null,function*(){let e=yield sn.GetMergedGeometry(t);if(F(this.mergedGraphicGroup),this.mergedGraphicGroup.clear(),e){let n=new an(this.context,e);this.mergedGraphicGroup.add(n)}})}createLine(t){return g(this,null,function*(){let e=yield sn.GetMergedGeometryLine(t);if(F(this.mergedLineGroup),this.mergedLineGroup.clear(),e){let n=new Oe(this.context,e.lineGeometry);this.mergedLineGroup.add(n)}})}refreshMergeGraphic(){let t=Array.from(this.graphicDataMap.values());this.instancedGraphicConfig&&(t=t.filter(e=>{var n;return!((n=this.instancedGraphicConfig)!=null&&n.ids.includes(e.id))})),this.createGraphic(t)}refreshLine(){let t=Array.from(this.graphicDataMap.values());this.createLine(t)}removeGraphicById(t){var e;if(this.graphicDataMap.delete(t),(e=this.instancedGraphicConfig)!=null&&e.ids.includes(t)){let n=this.instancedGraphicConfig.ids.findIndex(r=>r===t);this.instancedGraphicConfig.size--,this.instancedGraphicConfig.colors.splice(n*3,3),this.instancedGraphicConfig.matrixes.splice(n*16,16),this.instancedGraphicConfig.opacities.splice(n,1),this.instancedGraphicConfig.maxZs.splice(n,1),this.instancedGraphicConfig.ids.splice(n,1),this.refeshInstancedGraphic()}else this.refreshMergeGraphic();this.refreshLine()}getGraphicDataByNodeId(t){return this.graphicMap.get(t)||null}setGraphicOptions(t,e){var n;let r,i=this.graphicDataMap.get(t);if(i){if(typeof e=="function"?r=e(i):r=v({},i,e),this.graphicDataMap.set(t,r),(n=this.instancedGraphicConfig)!=null&&n.ids.includes(t)&&this.instancedGraphic){this.instancedGraphic.setColorById(t,r.fillColor),this.instancedGraphic.setOpacityById(t,r.fillOpacity),this.instancedGraphic.setMaxZById(t,r.deltaHeight+r.airHeight+r.height);let o=this.instancedGraphicConfig.ids.findIndex(p=>p===t),s=this.instancedGraphicConfig.matrixes.slice(o*16,(o+1)*16),u=new kt.Matrix4().fromArray(s),l=new kt.Vector3,c=new kt.Quaternion,h=new kt.Vector3;u.decompose(l,c,h),h.z=r.height,l.z=r.deltaHeight+r.airHeight+r.height/2,u.compose(l,c,h),this.instancedGraphic.setMatrixById(t,u)}else this.refreshMergeGraphic();this.refreshLine()}}getGraphicPosition(t){let e=this.graphicDataMap.get(t);return e?[e.center_x,e.center_y]:null}setOpacity(t,e){e===void 0&&(e=!1);var n;this.graphicDataMap.forEach((r,i)=>{if(e)r.fillOpacity=t,r.strokeOpacity=t;else{let u=this.graphicOriginOptionMap.get(i);var o;r.fillOpacity=Math.min(t,(o=u==null?void 0:u.fillOpacity)!=null?o:1);var s;r.strokeOpacity=Math.min(t,(s=u==null?void 0:u.strokeOpacity)!=null?s:1)}}),(n=this.instancedGraphic)==null||n.setOpacity(t,e),this.refeshInstancedGraphic(),this.refreshLine()}dispose(){super.dispose(),this.mergedGraphicGroup.clear(),this.mergedLineGroup.clear(),this.instancedGraphic=null,this.instancedGraphicConfig=null}constructor(t){super(t),this.graphicMap=new Map,this.mergedGraphicGroup=new kt.Group,this.mergedLineGroup=new kt.Group,this.graphicDataMap=new Map,this.graphicOriginOptionMap=new Map,this.instancedGraphic=null,this.instancedGraphicConfig=null,this.add(this.mergedGraphicGroup),this.add(this.mergedLineGroup)}};var md=require("core-js/modules/web.dom-collections.iterator.js"),_d=require("core-js/modules/es.array.push.js");var _t=require("three");var ld=require("core-js/modules/es.string.replace.js"),cd=require("core-js/modules/es.regexp.exec.js"),hd=require("core-js/modules/es.error.cause.js"),pd=require("core-js/modules/web.dom-collections.iterator.js"),Vr=require("three");var Zn=class{setBaseUrl(t){this.baseUrl=t.replace(/\/$/,"")}setConfig(t){this.config=t}loadConfig(){return g(this,null,function*(){if(this.config)return this.config;if(!this.baseUrl)throw new Error("Base URL is not set");try{let t=yield fetch(""+this.baseUrl+"/config.json");return this.config=yield t.json(),this.config}catch(t){return console.error("Failed to load tile config:",t),this.config={extent:[12276734621488994e-9,2.1183542845726013e6,12279646804065457e-9,2121524247761597e-9],maxZoom:21,minZoom:11},this.config}})}buildTileUrl(t,e,n){if(!this.baseUrl)throw new Error("Base URL is not set");return this.baseUrl+"/"+n+"/"+t+"/"+e+".png"}loadTileTexture(t,e,n){return g(this,null,function*(){if(!this.baseUrl)throw new Error("Base URL is not set");let r=this.buildTileUrl(t,e,n);if(this.textureCache.has(r)){let o=this.textureCache.get(r);return o instanceof Promise?o:Promise.resolve(o)}let i=this.textureLoader.loadAsync(r).then(o=>(o.flipY=!0,o.colorSpace=Vr.SRGBColorSpace,this.textureCache.set(r,o),o)).catch(o=>null);return this.textureCache.set(r,i),i})}clearCache(){this.textureCache.forEach(t=>{t instanceof Promise?t.then(e=>e==null?void 0:e.dispose()):t.dispose()}),this.textureCache.clear()}dispose(){this.clearCache()}constructor(t){this.baseUrl="",this.config=null,this.textureCache=new Map,this.textureLoader=new Vr.TextureLoader,t&&this.setBaseUrl(t)}};var zs=require("lodash");var Bs={base_url:"https://robot-vr-public.aibee.cn/static_resource/tiles"},De=class a extends nt{loadTileConfig(){return g(this,null,function*(){return this.tileLoader.loadConfig()})}initEvents(){this.context.addEventListener("control-change",this.onUpdate),this.context.bmap.addEventListener("center-change",this.onCenterChange)}removeEvents(){this.context.removeEventListener("control-change",this.onUpdate),this.context.bmap.removeEventListener("center-change",this.onCenterChange)}getViewBounds(){let t=this.context.camera,e=new _t.Raycaster,n=new _t.Vector2,r=[],[i,o]=this.context.center||[0,0],s=[{x:-1,y:1},{x:1,y:1},{x:1,y:-1},{x:-1,y:-1}];for(let p of s){n.set(p.x,p.y),e.setFromCamera(n,t);let f=new _t.Vector3(0,0,1),d=new _t.Vector3(0,0,0),m=new _t.Plane().setFromNormalAndCoplanarPoint(f,d),_=new _t.Vector3;e.ray.intersectPlane(m,_)?r.push(_):(e.ray.direction.negate(),e.ray.intersectPlane(m,_)&&r.push(_))}if(r.length<4)return null;let u=1/0,l=1/0,c=-1/0,h=-1/0;return r.forEach(p=>{u=Math.min(u,p.x+i),l=Math.min(l,p.y+o),c=Math.max(c,p.x+i),h=Math.max(h,p.y+o)}),{minX:u,minY:l,maxX:c,maxY:h}}getTileZoomLevel(t,e){let{minZoom:n,maxZoom:r}=e,i=this.context.camera,o=(i.right-i.left)/i.zoom,s=this.context.clientSize.width,u=o/s,l=a.WORLD_WIDTH,c=Math.log2(l/(u*this.tileSize));return Math.min(r,Math.max(n,Math.round(c)))}getTilesInView(t,e,n){let[r,i,o,s]=n.extent,u=Math.max(t.minX,r),l=Math.max(t.minY,i),c=Math.min(t.maxX,o),h=Math.min(t.maxY,s);if(u>=c||l>=h)return[];let p=Math.pow(2,e),f=a.WORLD_WIDTH/p,d=a.WORLD_WIDTH_HALF,m=Math.max(0,Math.floor((u+d)/f)),_=Math.floor((c+d)/f),x=Math.max(0,Math.floor((d-h)/f)),E=Math.floor((d-l)/f),S=[];for(let R=m;R<=_;R++)for(let P=x;P<=E;P++)S.push({x:R,y:P,z:e});return S}renderTiles(t,e){return g(this,null,function*(){let n=t,r=[];if(this.currentLevel!==e)r=[...this.tileGroup.children];else{let s=this.tileGroup.children,u=s.map(c=>c.userData.key),l=t.map(c=>c.z+"/"+c.x+"/"+c.y);n=t.filter(c=>!u.includes(c.z+"/"+c.x+"/"+c.y)),r=s.filter(c=>!l.includes(c.userData.key))}let i=Math.pow(2,e),o=a.WORLD_WIDTH/i;yield Promise.all(n.map(s=>g(this,null,function*(){let u=s.z+"/"+s.x+"/"+s.y,l=yield this.tileLoader.loadTileTexture(s.x,s.y,s.z);if(l){let c=new _t.MeshBasicMaterial({map:l,transparent:!0}),h=new _t.Mesh(this.baseGeometry,c);h.scale.setX(o).setY(o),h.position.set((s.x-i/2)*o+o/2,-((s.y-i/2)*o)-o/2,0),h.userData.key=u,this.tileGroup.add(h)}}))),this.tileGroup.children.forEach(s=>{r.includes(s)&&(s.material.dispose(),this.tileGroup.remove(s))})})}setVisibility(t){this.visible=t,t&&this.onUpdate()}setOpacity(t){super.setOpacity(t)}clearTiles(){this.tileGroup.children.forEach(t=>{t.material.dispose()}),this.tileGroup.clear()}dispose(){this.removeEvents(),this.clearTiles(),this.baseGeometry.dispose(),this.tileLoader.dispose(),super.dispose()}constructor(t,e){super(t),this.loadedTiles=new Map,this.currentLevel=0,this.tileSize=256,this.baseGeometry=new _t.PlaneGeometry(1,1),this.options=Bs,this.onUpdate=()=>{this.updateTiles()},this.onCenterChange=()=>{let{center:r}=this.context;this.tileGroup.position.set(-r[0],-r[1],0),this.updateTiles()},this.updateTiles=(0,zs.debounce)(()=>g(this,null,function*(){if(!this.visible)return;let r=yield this.loadTileConfig(),i=this.context.camera,o=this.getViewBounds();if(!o)return;let s=this.getTileZoomLevel(i.zoom,r),u=this.getTilesInView(o,s,r);this.renderTiles(u,s)}),100),this.options=v({},Bs,e),this.tileGroup=new _t.Group;let{center:n}=t;this.tileGroup.position.set(-n[0],-n[1],0),this.add(this.tileGroup),this.tileLoader=new Zn(this.options.base_url),this.initEvents(),this.updateTiles()}};De.WORLD_WIDTH=4007501668e-2;De.WORLD_WIDTH_HALF=De.WORLD_WIDTH/2;var Sd=require("core-js/modules/es.array.push.js"),Md=require("core-js/modules/web.dom-collections.iterator.js"),wd=require("core-js/modules/es.string.trim.js");var Tt=require("three");var Ue=require("lodash");var Su={text:"",icon:"",icon_size:[22,22],level:1,collision_enable:!0,opacity:1,id:"",position:{x:0,y:0,z:0},text_font_size:14,icon_rotate:0,depth_test:!1,hide_text:!1,maxWeight:25,minWeight:1,text_opacity:1,icon_opacity:1},st=class extends Tt.Object3D{get hasText(){return!this.options.hide_text&&this.options.text}get durIconAndText(){return this.options.icon&&this.hasText?2:0}get offset(){return this.options.icon&&this.hasText?0:.5}get iconWidth(){return this.options.icon?this.options.icon_size[0]:0}get iconHeight(){return this.options.icon?this.options.icon_size[1]:0}get textWidth(){return this.hasText?this.textHeight*this.textAspect:0}get textHeight(){return this.hasText?this.options.text_font_size*this.textureLines:0}get hasOriginTexture(){let{text_texture:t,text_texture_width:e,text_texture_height:n,text_texture_offset_x:r,text_texture_offset_y:i}=this.options;return!(0,Ue.isNil)(t)&&!(0,Ue.isNil)(e)&&!(0,Ue.isNil)(n)&&!(0,Ue.isNil)(r)&&!(0,Ue.isNil)(i)}get inited(){return!this.options.text||this.options.text&&this.textTexture}get deltaZ(){return this.options.icon&&this.hasText?.1+this.offset*(this.iconHeight+this.durIconAndText+this.textHeight)/this.context.camera.zoom:this.hasText?.1+.5*this.textHeight/this.context.camera.zoom:.1}get canSelect(){return this.visible&&this._shouldShow}show(){return g(this,null,function*(){if(this._shouldShow)return;this._shouldShow=!0;let t=[];if(!this.spriteIcon&&this.options.icon&&t.push(this.initIcon()),!this.spriteText&&this.hasText&&t.push(this.initText()),yield Promise.all(t),!this._shouldShow){this.hide();return}this.initSize(),this._initScale({zoom:this.context.camera.zoom}),this.spriteIcon&&(this.spriteIcon.visible=!0),this.spriteText&&(this.spriteText.visible=!0)})}hide(){this._shouldShow=!1,this.spriteIcon&&(this.remove(this.spriteIcon),this.spriteIcon.material.dispose(),this.spriteIcon=void 0),this.spriteText&&(this.remove(this.spriteText),this.spriteText.material.dispose(),this.spriteText=void 0)}registryEvent(){this.context.addEventListener("control-zoom-change",this._initScale),this.addEventListener("change-icon",t=>g(this,null,function*(){let{value:e}=t;this._shouldShow&&(this.hide(),yield this.show()),this.context.forceUpdate()})),this.addEventListener("change-text",t=>g(this,null,function*(){let{value:e}=t;this._shouldShow&&(this.hide(),yield this.show()),this.context.forceUpdate()})),this.addEventListener("change-text_font_size",t=>g(this,null,function*(){let{value:e}=t;this._shouldShow&&(this.hide(),yield this.show())})),this.addEventListener("change-icon_rotate",t=>{let{value:e}=t;this.spriteIcon&&(this.spriteIcon.material.rotation=e/180*Math.PI)}),this.addEventListener("change-icon_size",t=>{let{value:e}=t;this._initScale({zoom:this.context.camera.zoom}),this.options.icon&&this.context.forceUpdate()}),this.addEventListener("change-depth_test",t=>{let{value:e}=t;this.spriteIcon&&(this.spriteIcon.material.depthTest=e),this.spriteText&&(this.spriteText.material.depthTest=e)}),this.addEventListener("change-icon_opacity",t=>{let{value:e}=t;this.spriteIcon&&(this.spriteIcon.material.opacity=e)}),this.addEventListener("change-text_opacity",t=>{let{value:e}=t;this.spriteText&&(this.spriteText.material.opacity=e)})}unRegistryEvent(){this.context.removeEventListener("control-zoom-change",this._initScale)}getPosition(){return this.position}initIcon(){return g(this,null,function*(){if(this.options.icon)return this._initIconPromise=new Promise(t=>g(this,null,function*(){let e;if(this.options.icon_border){let{icon:r,icon_size:i,icon_border:o}=this.options;e=yield gt.getUrlTextureBorder(r,i[0]-o.width*2,o)}else e=yield gt.getTextureByUrl(this.options.icon);let n=new Tt.Sprite(new Tt.SpriteMaterial({map:e,transparent:!0,alphaTest:.2,depthTest:this.options.depth_test,rotation:this.options.icon_rotate/180*Math.PI,opacity:this.options.icon_opacity}));n.visible=!1,n.renderOrder=1e5+this.options.level,e.needsUpdate=!0,this.add(n),this.spriteIcon=n,t(n)})).then(()=>{this._initIconPromise=null})})}initText(){return g(this,null,function*(){if(this.hasText){let t=this.textTexture;if(!t)return;let e=new Tt.Sprite(new Tt.SpriteMaterial({map:t,transparent:!0,alphaTest:.2,depthTest:this.options.depth_test,opacity:this.options.text_opacity}));e.visible=!1,e.renderOrder=100001+this.options.level,t.needsUpdate=!0,this.spriteText=e,this.add(e)}})}initSize(){var t,e;let n=0,r=0,{icon:i}=this.options;i?this.hasText?(n=0,r=n*(this.iconHeight/this.textHeight)-this.iconHeight/this.textHeight-this.durIconAndText/this.textHeight):(n=.5,r=0):this.hasText?(r=.5,n=0):(n=0,r=0),(t=this.spriteIcon)==null||t.center.set(.5,n),(e=this.spriteText)==null||e.center.set(.5,r)}init(){return g(this,null,function*(){yield Promise.all([this.initIcon(),this.initText()]),this.initSize(),this._initScale({zoom:this.context.camera.zoom})})}resetZ(){let t=this.deltaZ;this.spriteIcon&&(this.spriteIcon.position.z=t),this.spriteText&&(this.spriteText.position.z=t)}getBox(t){if(!this.inited)return this.initTextTexture(),null;let{clientSize:{width:e,height:n}}=this.context,r=e*(t.x+1)/2,i=n*(-t.y+1)/2;i+=this.offset*(this.iconHeight+this.durIconAndText+this.textHeight);let o=this.iconWidth/2,s=new Tt.Box2(new Tt.Vector2(r-o,i-this.iconHeight),new Tt.Vector2(r+o,i)),u=this.textWidth/2,l=new Tt.Box2(new Tt.Vector2(r-u,i-this.textHeight-this.durIconAndText-this.iconHeight),new Tt.Vector2(r+u,i-this.iconHeight-this.durIconAndText));return this.box=l.union(s),this.box}renderBoxHelper(t,e){if(!this.boxHelper){let n=document.createElement("div");n.style.position="absolute",n.style.zIndex="999",n.style.border="1px solid red",n.style.pointerEvents="none",this.boxHelper=n,this.context.container.appendChild(n)}t&&e?(this.boxHelper.style.left=t+"px",this.boxHelper.style.top=e+"px",this.boxHelper.style.width="2px",this.boxHelper.style.height="2px"):(this.boxHelper.style.left=this.box.min.x+"px",this.boxHelper.style.top=this.box.min.y+"px",this.boxHelper.style.width=this.box.max.x-this.box.min.x+"px",this.boxHelper.style.height=this.box.max.y-this.box.min.y+"px")}parentSetVisible(t){t?this.show():this.hide(),this.boxHelper&&(this.boxHelper.style.display=t?"block":"none")}dispose(){this.hide(),this.unRegistryEvent(),this._listeners={}}constructor(t,e){var n;super(),this.context=t,this.textAspect=1,this.box=new Tt.Box2,this._initIconPromise=null,this.textureLines=1,this._shouldShow=!1,this.initTextTexture=(0,Ue.once)(()=>g(this,null,function*(){if(!this.options.text||this.textTexture)return;let i;if(this.hasOriginTexture){let{text_texture:o,text_texture_width:s,text_texture_height:u,text_texture_offset_x:l,text_texture_offset_y:c}=this.options;i=this.options.text_texture.clone(),i.uuid=o.uuid,i.offset.set(l/i.image.width,1-(u+c)/i.image.height),i.repeat.set(s/i.image.width,u/i.image.height),this.textAspect=s/u}else{let o=yield dt.getTextureByText(this.options.text);i=o.texture,this.textureLines=o.lines,this.textAspect=i.image.width/i.image.height}this.textTexture=i,this.dispatchEvent({type:"text-texture-inited"})})),this._initScale=i=>{let{zoom:o}=i;if(this.spriteText){let u=this.textHeight/o;this.spriteText.scale.set(this.textAspect*u,u,.1)}if(this.spriteIcon){var s;(s=this.spriteIcon)==null||s.scale.set(this.options.icon_size[0]/o,this.options.icon_size[1]/o,.1)}this.resetZ()};var r;this.options=Ve(v({},Su,e,{text:(r=(n=e.text)==null?void 0:n.trim())!=null?r:""}),this),this.position.set(this.options.position.x,this.options.position.y,this.options.position.z),this.registryEvent()}};var re=class extends Dt.Object3D{getPosition(){return this.box.getCenter(new Dt.Vector3)}onAddToScene(t){this.poiLayer2.onAddToScene(t)}onRemoveFromScene(){this.poiLayer2.onRemoveFromScene()}createGround(t){let e=new mt(this.context,t);e.userData.data=t,this.addGrounds([e])}addGrounds(t){t.forEach(e=>{this.grounds.has(e)||(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+.01}get hasElement(){return!!(this.grounds.size||this.graphicLayer.children.length)}getCenter(){return new Dt.Box3().setFromObject(this).getCenter(new Dt.Vector3)}addModel(t){let e=new Gn(this.context,t);return this.models.add(e),this.modelMap.set(t.id,e),e}addShadow(){let t=new Dt.Box3().setFromObject(this.groundUpper),e=t.getCenter(new Dt.Vector3),n=t.getSize(new Dt.Vector3);this.shadow.setPosition(e),this.shadow.changeLightCamera(n)}addGraphic(t){return this.graphicLayer.createGraphic(t)}addPoi(t){return this.poiLayer.createPoi(t)}addPoi2(t){let e=new st(this.context,t);return this.poiLayer2.pushPoi(e),e}removePoi2(t){return this.poiLayer2.removePoi(t)}removePoi2ById(t){return this.poiLayer2.removePoiById(t)}addHeatmap(t){this.heatmap||(this.heatmap=new zn(this.context),this.add(this.heatmap)),this.heatmap.loadData(t);let e=new Dt.Box3().setFromObject(this.graphicLayer);return this.heatmap.position.setZ(e.max.z+.1),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}setGraphicOptions(t,e){this.graphicLayer.graphicMap.has(t)?this.graphicLayer.setGraphicOptions(t,e):this.mergeGraphicLayer.setGraphicOptions(t,e)}getGraphicPosition(t){return this.graphicLayer.getGraphicPosition(t)||this.mergeGraphicLayer.getGraphicPosition(t)||this.parkingSpaceLayer.getGraphicPosition(t)}changeParkingColor(t){this.parkingSpaceLayer.changeParkingColor(t)}getParkingOptionsByParkingNo(t){return this.parkingSpaceLayer.getParkingOptionsByParkingNo(t)}updateBox(){this.box.setFromObject(this.groundLayer)}getGraphics(){return this.graphicLayer.children.filter(t=>t instanceof mt)}setOpacity(t,e){e===void 0&&(e=!1),this.groundLayer.setOpacity(t,e),this.graphicLayer.setOpacity(t,e),this.mergeGraphicLayer.setOpacity(t,e),this.poiLayer2.setOpacity(t),this.parkingSpaceLayer.setOpacity(t,e),this.laneLayer.setOpacity(t,e),this.wallLayer.setOpacity(t,e),this.textureLayer.setOpacity(t),this.textTextureLayer.setOpacity(t),this.glbModelLayer.setOpacity(t,e),this.userData.opacity=t}dispose(){var t;console.log("floor dispose",this.name),this.shadow.dispose(),this.groundLayer.dispose(),this.graphicLayer.dispose(),this.poiLayer.dispose(),this.poiLayer2.dispose(),this.parkingSpaceLayer.dispose(),this.wallLayer.dispose(),this.textureLayer.dispose(),this.glbModelLayer.dispose(),this.laneLayer.dispose(),this.mergeGraphicLayer.dispose(),this.textTextureLayer.dispose(),this.grounds.forEach(e=>e.dispose()),(t=this.heatmap)==null||t.dispose(),this.groundUpper.clear(),this.models.children.forEach(e=>e.dispose()),this.models.clear(),this.modelMap.clear(),this.clear()}constructor(t){super(),this.context=t,this.grounds=new Set,this.shadow=new Bn,this.groundUpper=new Dt.Object3D,this.models=new Dt.Object3D,this.modelMap=new Map,this.groundMaxHeight=0,this.name="",this.key="",this.box=new Dt.Box3,this.groundLayer=new nt(this.context),this.graphicLayer=new kn(this.context),this.poiLayer=new Vn(this.context),this.poiLayer2=new Hn(this.context),this.parkingSpaceLayer=new Wn(this.context),this.wallLayer=new nt(this.context),this.textureLayer=new nt(this.context),this.glbModelLayer=new Xn(this.context),this.laneLayer=new nt(this.context),this.mergeGraphicLayer=new Yn(this.context),this.textTextureLayer=new nt(this.context),this.groundUpper.add(this.graphicLayer),this.groundUpper.add(this.poiLayer),this.groundUpper.add(this.poiLayer2),this.groundUpper.add(this.parkingSpaceLayer),this.groundUpper.add(this.wallLayer),this.groundUpper.add(this.textureLayer),this.groundUpper.add(this.glbModelLayer),this.groundUpper.add(this.laneLayer),this.groundUpper.add(this.mergeGraphicLayer),this.groundUpper.add(this.textTextureLayer),this.add(this.groundUpper),this.add(this.groundLayer),this.add(this.models)}};var jd=require("core-js/modules/es.array.push.js"),Yd=require("core-js/modules/web.dom-collections.iterator.js");var Hr=require("three");var Vt=class extends Hr.EventDispatcher{_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:n}=this.context,{offsetX:r,offsetY:i}=t,{clientWidth:o,clientHeight:s}=n.domElement,u=r/o*2-1,l=1-i/s*2;return new Hr.Vector3(u,l,0).unproject(e)}getSvgCoordinate(t){let{camera:e,container:n}=this.context;return N(t,e,n.clientWidth,n.clientHeight)}dispose(){this._unRegistryEvent(),this.context.container.removeChild(this.svg),this.svg=null}constructor(t){super(),this.context=t,this.points=[],this.enable=!0,this._onResize=e=>{let{width:n,height:r}=e;this.svg&&(this.svg.setAttribute("width",""+n),this.svg.setAttribute("height",""+r))},this.svg=bi(""+t.container.clientWidth,""+t.container.clientHeight),t.container.appendChild(this.svg),this._registryEvent()}};var Kn=class extends Vt{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)}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:n,y:r}]=this.points;return Math.sqrt((n-t)**2+(r-e)**2)}dispose(){super.dispose(),this.unRegistryEvent(),this.line=null,this.circles=[]}constructor(t){super(t),this.context=t,this.onUpdate=()=>{if(this.points[0]){let r=this.getSvgCoordinate(this.points[0]);Ce(this.circles[0],r.x,r.y),Yt(this.line,r)}if(this.points[1]){let r=this.getSvgCoordinate(this.points[1]);Ce(this.circles[1],r.x,r.y),Yt(this.line,void 0,r)}},this.onPointermove=r=>{this.points.length===1&&(this.line.style.display="block",Yt(this.line,void 0,{x:r.offsetX,y:r.offsetY}))},this.onPointerleave=()=>{this.points[1]||(this.line.style.display="none")},this.onPointerdown=r=>{if(this.points[1])return;let i=this.getIntersectByPointerEvent(r);if(i){let{offsetX:o,offsetY:s}=r,u=this.circles[this.points.length];Ce(u,o,s),this.points.length||Yt(this.line,{x:o,y:s},{x:o,y:s}),this.addPoint(i)}};let{config:{svg:{circle:e,line:n}}}=t;this.circles=[tn(e.radius,e.fill),tn(e.radius,e.fill)],this.line=Rn(n.stroke),this.svg.appendChild(this.circles[0]),this.svg.appendChild(this.circles[1]),this.svg.appendChild(this.line),this.registryEvent()}};var Jd=require("core-js/modules/es.array.push.js");var $n=class extends Vt{setEnable(t){super.setEnable(t),t?this.registryEvent():this.unRegistryEvent()}get lastLine(){return this.lines.slice(-1)[0]}addCircle(t){this.circles.push(t),this.svg.appendChild(t)}addLine(t){this.lines.push(t),this.svg.appendChild(t)}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)}checkAdsorb(t,e){if(this.points.length<3)return!1;let n=this.circles[0],r=+n.getAttribute("cx"),i=+n.getAttribute("cy");return Math.sqrt((t-r)**2+(e-i)**2)<=5}addPoint(t){if(this.points.push(t),this.isClose){let e=this.calculatedArea();this.dispatchEvent({type:"area",area:e})}}calculatedArea(){let t=this.points.map(r=>[r.x,r.y]),e=0,n=t.length;for(let r=0;r<n;r++){let i=(r+1)%n;e+=t[r][0]*t[i][1]-t[i][0]*t[r][1]}return Math.abs(e/2)}dispose(){super.dispose(),this.unRegistryEvent(),this.lines=[],this.circles=[]}constructor(t){super(t),this.circles=[],this.lines=[],this.isClose=!1,this.onUpdate=()=>{this.points.length&&this.points.forEach((e,n)=>{let r=this.getSvgCoordinate(e);this.circles[n]&&Ce(this.circles[n],r.x,r.y),n!==0&&Yt(this.lines[n-1],void 0,r),this.lines[n]&&Yt(this.lines[n],r)})},this.onPointermove=e=>{!this.lastLine||this.isClose||(this.lastLine.style.display="block",Yt(this.lastLine,void 0,{x:e.offsetX,y:e.offsetY}))},this.onPointerleave=()=>{this.isClose||(this.lastLine.style.display="none")},this.onPointerdown=e=>{if(this.isClose)return;let n=this.getIntersectByPointerEvent(e);if(n){let{offsetX:r,offsetY:i}=e;this.checkAdsorb(r,i)?(this.isClose=!0,this.addPoint(this.points[0])):this.addPoint(n);let{circle:{fill:o,radius:s},line:{stroke:u}}=this.context.config.svg;if(!this.isClose){let l=tn(s,o);Ce(l,r,i),this.addCircle(l)}if(this.lines.length&&Yt(this.lastLine,void 0,{x:r,y:i}),!this.isClose){let l=Rn(u);Yt(l,{x:r,y:i},{x:r,y:i}),this.addLine(l)}}},this.registryEvent()}};var Gs=require("three");var Hi=class extends Vt{setEnable(t){super.setEnable(t),t?this.registryEvent():this.unRegistryEvent()}registryEvent(){this.context.addEventListener("update",this.onUpdate)}unRegistryEvent(){this.context.removeEventListener("update",this.onUpdate)}selectGraphic(t){this.graphic=t}dispose(){super.dispose(),this.unRegistryEvent(),this.rect=null,this.cornerRect=[],this.centerRect=[]}constructor(t){super(t),this.context=t,this.cornerRect=[],this.centerRect=[],this.onUpdate=()=>{if(this.graphic){let n=new Gs.Box3().setFromObject(this.graphic),{camera:r,container:{clientWidth:i,clientHeight:o}}=this.context,{min:s,max:u}=n,l=N(s,r,i,o),c=N(u,r,i,o);Ct(this.rect,l.x,c.y,Math.abs(c.x-l.x),Math.abs(c.y-l.y));let{x:h,y:p}=l,{x:f,y:d}=c,m=5,_=[{x:h-m,y:d-m},{x:f-m,y:d-m},{x:h-m,y:p-m},{x:f-m,y:p-m}];for(let P=0;P<_.length;P++)Ct(this.cornerRect[P],_[P].x,_[P].y,m*2,m*2);let x=4,E=(h+f)/2,S=(p+d)/2,R=[{x:E-x,y:d-x},{x:h-x,y:S-x},{x:f-x,y:S-x},{x:E-x,y:p-x}];for(let P=0;P<R.length;P++)Ct(this.centerRect[P],R[P].x,R[P].y,x*2,x*2)}else{Ct(this.rect,0,0,0,0);for(let n=0;n<this.cornerRect.length;n++)Ct(this.cornerRect[n],0,0,0,0),Ct(this.centerRect[n],0,0,0,0)}};let{config:{svg:{line:e}}}=t;this.rect=Ee(e.stroke,"transparent"),this.svg.appendChild(this.rect);for(let n=0;n<4;n++)this.cornerRect[n]=Ee(e.stroke,"#ffffff"),this.centerRect[n]=Ee(e.stroke,"#ffffff"),this.svg.appendChild(this.cornerRect[n]),this.svg.appendChild(this.centerRect[n]);this.registryEvent()}};var og=require("core-js/modules/es.array.push.js"),At=require("three");var ks=require("three/examples/jsm/utils/BufferGeometryUtils.js");var Jn=class extends At.Object3D{initGeometry(){return g(this,null,function*(){let t=yield ne.GetMergeGeometry(this.options);this.geometry=t})}initMaterial(){let t=`
|
|
8053
8053
|
varying vec3 vPosition; // \u7528\u4E8E\u4F20\u9012\u9876\u70B9\u7684\u4F4D\u7F6E\u7ED9\u7247\u6BB5\u7740\u8272\u5668
|
|
8054
8054
|
uniform float maxZ; // \u58F0\u660E\u4E00\u4E2Auniform\u53D8\u91CF
|
|
8055
8055
|
uniform vec3 uColor;
|
|
@@ -8114,7 +8114,7 @@ void main() {
|
|
|
8114
8114
|
gl_FragColor = vec4(uColor2, uOpacity); // \u5176\u4ED6\u9762\u989C\u8272\uFF09
|
|
8115
8115
|
}
|
|
8116
8116
|
}
|
|
8117
|
-
`,n=-1/0,r=this.geometry.getAttribute("position");if(r)for(let o=0;o<r.count;o++){let s=r.getZ(o);s>n&&(n=s)}let i=new yt.ShaderMaterial({uniforms:{maxZ:{value:n},uColor:{value:new yt.Color(this.options[0].fillColor).convertLinearToSRGB()},uColor2:{value:new yt.Color(le(this.options[0].fillColor)).convertLinearToSRGB()},uOpacity:{value:this.options[0].fillOpacity}},vertexShader:t,fragmentShader:e,transparent:!0});this.material=i}initLineMaterial(){let t=A.createLineMaterial({color:this.options[0].strokeColor,opacity:this.options[0].strokeOpacity});return this.lineMaterial=t,t}initMesh(){this.mesh&&this.remove(this.mesh),this.mesh=new yt.Mesh(this.geometry,this.material),this.add(this.mesh)}getBorderPoints(){let t=[],e=this.options[0].height+this.options[0].deltaHeight;return this.options.map(n=>{let{coords:r}=n.geometry;for(let i=0;i<r.length;i++){let o=r[i];for(let s=0;s<o.length;s++){let u=o[s],l=s+1===o.length?o[0]:o[s+1];t.push(new yt.Vector3(u[0],u[1],e)),t.push(new yt.Vector3(l[0],l[1],e))}}}),t}initLineGeometry(){this.lineGeometry&&this.lineGeometry.dispose();let t=this.getBorderPoints(),e=new yt.BufferGeometry().setFromPoints(t);this.lineGeometry=e}createBorder(){this.line&&this.remove(this.line);let t=new yt.LineSegments(this.lineGeometry,this.lineMaterial);return t.position.z=.01,this.line=t,this.add(t),t}dispose(){var t,e;this.geometry?(this.geometry.dispose(),this._listeners={}):this.addEventListener("init-geometry",()=>{var n;(n=this.geometry)==null||n.dispose(),this._listeners={}}),(t=this.material)==null||t.dispose(),(e=this.line)==null||e.geometry.dispose(),this.clear()}constructor(t,e,n){super(),this.context=t,this.mergedElement=n,this.options=[],n?(this.options=[n],this.initMergedElement()):(this.options=e.map(r=>v({},de,r)),this.init())}};var Ng=require("core-js/modules/web.dom-collections.iterator.js"),Og=require("core-js/modules/es.string.trim.js");var Ht=require("three"),Xs=require("three/examples/jsm/utils/BufferGeometryUtils.js");var qs={airHeight:0,deltaHeight:0,height:0,geometry:{cds:[],type:"polygon",coords:[],curveCpt:[],curveIndex:[]},texts:[],fillColor:"#ffffff",fillOpacity:0,strokeColor:"#ffffff",strokeOpacity:0,secondHeight:0,secondRotate:0,center_x:0,center_y:0},tr=class extends Ht.Object3D{init(){return g(this,null,function*(){let t=yield Promise.all(this.options.map(o=>dt.getTextureByText(o.texts[0],{fillStyle:wr(o.fillColor,o.fillOpacity),strokeStyle:wr(o.strokeColor,o.strokeOpacity),lineWidth:6,font:"bold 54px sans-serif",maxWidth:2048}))),e=t.map((o,s)=>{let u=this.options[s],{width:l,height:c}=o.texture.image,h=l/c,p=u.secondHeight*h,f=new Ht.PlaneGeometry(p,u.secondHeight),d=new Ht.Matrix4().makeTranslation(u.center_x,u.center_y,u.airHeight+u.deltaHeight+u.height).multiply(new Ht.Matrix4().makeRotationZ(u.secondRotate));return f.applyMatrix4(d),f}),n=(0,Xs.mergeGeometries)(e,!0);e.forEach(o=>o.dispose());let r=t.map(o=>{let{texture:s}=o,u=new Ht.MeshBasicMaterial({map:s,alphaTest:1,side:Ht.DoubleSide});return s.needsUpdate=!0,u}),i=new Ht.Mesh(n,r);this.mesh=i,this.position.z+=.04,this.add(i)})}setOpacity(t){var e,n;(n=this.mesh)==null||(e=n.material)==null||e.forEach(r=>{r.opacity=t,r.needsUpdate=!0})}dispose(){var t,e,n;(t=this.mesh)==null||t.geometry.dispose(),(n=this.mesh)==null||(e=n.material)==null||e.forEach(r=>r.dispose()),this.clear()}constructor(t,e){super(),this.context=t,this.options=e.map(n=>v({},qs,n)).filter(n=>n.texts[0].trim()),this.options.length&&this.init()}};var js=require("three"),Ys=require("three/examples/jsm/lines/Line2.js"),Zs=require("three/examples/jsm/lines/LineGeometry.js"),Ks=require("three/examples/jsm/lines/LineMaterial.js"),un=class extends js.Object3D{registryEvent(){this.context.addEventListener("resize",this.onResize)}unRegistryEvent(){this.context.removeEventListener("resize",this.onResize)}setPosition(t,e){this.lineGeometry.setPositions([t.x,t.y,t.z,e.x,e.y,e.z]),this.line||this.createLine()}createLine(){this.line=new Ys.Line2(this.lineGeometry,this.lineMaterial),this.line.renderOrder=100003,this.add(this.line)}dispose(){var t;this.unRegistryEvent(),this.line&&F(this.line),this.lineGeometry=null,this.lineMaterial=null,this.clear(),(t=this.line)==null||t.clear(),this.line=null}constructor(t,e,n){super(),this.context=t,this.lineGeometry=new Zs.LineGeometry,this.lineMaterial=new Ks.LineMaterial({color:0,transparent:!0,depthTest:!1,linewidth:2}),this.line=null,this.onResize=()=>{let{width:r,height:i}=this.context.clientSize;this.lineMaterial.resolution.set(r,i)},this.onResize(),this.registryEvent(),e&&n&&this.setPosition(e,n)}};var kg=require("core-js/modules/es.array.push.js"),Vg=require("core-js/modules/web.dom-collections.iterator.js"),Be=require("three");var ln=require("three");var qn=class extends Be.Object3D{loadModel(){return g(this,null,function*(){let t=yield It.loadModel(this.options[0].url);t.scene.updateMatrixWorld(!0);let e=t.scene.matrixWorld.clone().invert();t.scene.traverse(u=>{if(u.isMesh){let l=e.clone().multiply(u.matrixWorld),c=u.material;this.subMeshes.push({geometry:u.geometry,material:u.material,initialMatrix:l}),Array.isArray(c)?c.forEach(h=>{h.transparent=!0,this.materialOriginParams.set(h,{opacity:h.opacity})}):(c.transparent=!0,this.materialOriginParams.set(c,{opacity:c.opacity}))}});let n=this.subMeshes.map(u=>{let{geometry:l,material:c}=u;return new Be.InstancedMesh(l,c,this.options.length)});t.scene.rotation.set(Math.PI/2,0,0);let i=new Be.Box3().setFromObject(t.scene).getSize(new Be.Vector3),o=Math.max(i.x,i.y);this.options.map(u=>{let l=new ln.Matrix4,c=u.width/o;return l.multiply(new ln.Matrix4().makeTranslation(u.center_x,u.center_y,u.airHeight+u.deltaHeight)).multiply(new ln.Matrix4().makeScale(c,c,c)).multiply(new ln.Matrix4().makeRotationZ(u.rotate)).multiply(new ln.Matrix4().makeRotationX(Math.PI/2)),u.url==="https://robot-vr-public.cdn.bcebos.com/ai-map-resource/757/1865371442288267264/smzsdrc.glb"&&console.log(u,l),l}).forEach((u,l)=>{n.forEach((c,h)=>{let p=u.clone().multiply(this.subMeshes[h].initialMatrix);c.setMatrixAt(l,p)})}),n.forEach(u=>{u.instanceMatrix.needsUpdate=!0,this.meshSetMaterial(u),this.add(u)})})}meshSetMaterial(t){t.isMesh&&(t.frustumCulled=!1,t.castShadow=!0,Array.isArray(t.material)?t.material.map(e=>{e.emissiveIntensity*=.95}):(t.material.emissiveIntensity*=.95,t.material.emissive=t.material.color,t.material.emissiveMap=t.material.map))}setOpacity(t,e){e===void 0&&(e=!1),this.subMeshes.forEach(n=>{let{material:r}=n;if(Array.isArray(r))r.forEach(i=>{if(e)i.opacity=t;else{let o=this.materialOriginParams.get(i)||{opacity:1};t>o.opacity?i.opacity=o.opacity:i.opacity=t}i.needsUpdate=!0});else{let i=this.materialOriginParams.get(r)||{opacity:1};t>i.opacity?r.opacity=i.opacity:r.opacity=t,r.needsUpdate=!0}}),this.children.forEach(n=>{n.instanceMatrix.needsUpdate=!0})}dispose(){this.children.forEach(t=>t.dispose()),F(this),this.clear()}constructor(t,e){super(),this.context=t,this.options=e,this.subMeshes=[],this.materialOriginParams=new Map,this.loadModel()}};var ze=require("three");var an=class extends ze.Object3D{init(){return g(this,null,function*(){this.geometry=this.initGeometry(),this.initMaterial(),this.initMesh(),this.mesh.position.z=this.options.deltaHeight+this.options.airHeight,this.options.lineGeometry&&(this.initLineMaterial(),this.initLineGeometry(),this.createBorder())})}initGeometry(){return this.loader.parseGeometries([this.options.mergedGeometry])[this.options.mergedGeometry.uuid]}initMaterial(){this.material=A.GetMergeAttributeGraphicMaterial()}initLineMaterial(){return this.lineMaterial=A.GetMergeAttributeGraphicLineMaterial()}initMesh(){this.mesh&&this.remove(this.mesh),this.mesh=new ze.Mesh(this.geometry,this.material),this.add(this.mesh)}initLineGeometry(){this.lineGeometry&&this.lineGeometry.dispose();let t=this.loader.parseGeometries([this.options.lineGeometry]);this.lineGeometry=t[this.options.lineGeometry.uuid]}createBorder(){this.line&&this.remove(this.line);let t=new ze.LineSegments(this.lineGeometry,this.lineMaterial);return t.position.z=.01,this.line=t,this.add(t),t}dispose(){var t;this.geometry&&this.geometry.dispose(),(t=this.line)==null||t.geometry.dispose(),this.clear()}constructor(t,e){super(),this.context=t,this.loader=new ze.ObjectLoader,this.options=v({},de,e),this.init()}};var cn=require("three");var er=class extends cn.Object3D{initGeometry(){return g(this,null,function*(){let t=new cn.ObjectLoader().parseGeometries([this.options.mergedGeometry]);this.geometry=t[this.options.mergedGeometry.uuid]})}init(){return g(this,null,function*(){var t;yield this.initGeometry();let e=new cn.Mesh(this.geometry,Lt.GetMergeAttributeWallMaterial());this.add(e);let n=(t=this.geometry)==null?void 0:t.getAttribute("opacity");n&&(this.originOpacities=Array.from(n.array))})}setOpacity(t,e){e===void 0&&(e=!1);var n;let r=(n=this.geometry)==null?void 0:n.getAttribute("opacity");if(r){for(let o=0;o<r.count;o++)if(e)r.setX(o,t);else{var i;r.setX(o,Math.min(t,(i=this.originOpacities[o])!=null?i:1))}r.needsUpdate=!0}}dispose(){var t;(t=this.geometry)==null||t.dispose(),this.clear()}constructor(t,e){super(),this.context=t,this.options=e,this.originOpacities=[],this.init()}};var nm=require("core-js/modules/es.typed-array.float32-array.js"),rm=require("core-js/modules/es.typed-array.at.js"),im=require("core-js/modules/es.typed-array.fill.js"),om=require("core-js/modules/es.typed-array.find-last.js"),sm=require("core-js/modules/es.typed-array.find-last-index.js"),am=require("core-js/modules/es.typed-array.set.js"),um=require("core-js/modules/es.typed-array.sort.js"),lm=require("core-js/modules/es.typed-array.to-reversed.js"),cm=require("core-js/modules/es.typed-array.to-sorted.js"),hm=require("core-js/modules/es.typed-array.with.js"),pm=require("core-js/modules/es.array-buffer.constructor.js"),fm=require("core-js/modules/es.array-buffer.slice.js"),dm=require("core-js/modules/es.array-buffer.detached.js"),gm=require("core-js/modules/es.array-buffer.transfer.js"),mm=require("core-js/modules/es.array-buffer.transfer-to-fixed-length.js");var ht=require("three");var Ne=class extends ht.Object3D{init(){return g(this,null,function*(){let t=this.options.iconUrl,e=yield gt.getTextureByUrl(t),n=new ht.MeshBasicMaterial({map:e,transparent:!0,alphaTest:.2,side:ht.FrontSide}),r=new ht.InstancedMesh(this.geometry,n,this.options.mergedMatrixes.size);r.instanceMatrix=new ht.InstancedBufferAttribute(new Float32Array(this.options.mergedMatrixes.array),16),this.add(r),this.mesh=r,this.position.z+=.004})}setOpacity(t){this.mesh&&(this.mesh.material.opacity=t,this.mesh.material.needsUpdate=!0,this.mesh.instanceMatrix.needsUpdate=!0)}dispose(){var t;this.mesh&&F(this.mesh),(t=this.mesh)==null||t.dispose(),this.clear()}constructor(t,e){super(),this.context=t,this.geometry=new ht.ShapeGeometry(new ht.Shape([new ht.Vector2(-.5,-.5),new ht.Vector2(-.5,.5),new ht.Vector2(.5,.5),new ht.Vector2(.5,-.5)])),this.options=v({},Wr,e);let n=new ht.Float32BufferAttribute([0,0,0,1,1,1,1,0],2);this.geometry.setAttribute("uv",n),this.init()}};var bm=require("core-js/modules/es.array.push.js"),Me=require("three");var qi=require("three/examples/jsm/lines/LineSegments2.js"),ji=require("three/examples/jsm/lines/LineSegmentsGeometry.js");var nr=class extends Me.Object3D{initGeometry(){return g(this,null,function*(){let t=this.loader.parseGeometries([this.options.mergedGeometry]);this.geometry=t[this.options.mergedGeometry.uuid]})}initMaterial(){let t=A.createMeshBasicMaterial({color:"#ffffff",opacity:1,vertexColors:!0});return this.material=t,t}initDoubleLine(){if(this.options.dashedLineGeometry){let t=A.createLine2MaterialMap({color:"#ffffff",width:.2,dashed:!0,resolution:new Me.Vector2(this.context.clientSize.width,this.context.clientSize.height),vertexColors:!0});t.transparent=!0,t.needsUpdate=!0;let e=new ji.LineSegmentsGeometry;e.setPositions(this.options.dashedLineGeometry.positions),e.setColors(this.options.dashedLineGeometry.colors);let n=new qi.LineSegments2(e,t);n.computeLineDistances(),n.position.z+=.01,this.add(n),this.doubleLines.push(n)}if(this.options.lineGeometry){let t=A.createLine2MaterialMap({color:"#ffffff",width:.2,dashed:!1,resolution:new Me.Vector2(this.context.clientSize.width,this.context.clientSize.height),vertexColors:!0}),e=new ji.LineSegmentsGeometry;e.setPositions(this.options.lineGeometry.positions),e.setColors(this.options.lineGeometry.colors);let n=new qi.LineSegments2(e,t);n.position.z+=.01,this.add(n),this.doubleLines.push(n)}}init(){return g(this,null,function*(){yield this.initGeometry(),this.initMaterial();let t=new Me.Mesh(this.geometry,this.material);this.add(t),this.initDoubleLine(),this.position.z+=.02})}setOpacity(t){this.material.opacity=t,this.material.needsUpdate=!0,this.doubleLines.forEach(e=>{e.material.opacity=t,e.material.needsUpdate=!0})}dispose(){var t,e;(t=this.geometry)==null||t.dispose(),(e=this.lineGeometry)==null||e.dispose(),this.doubleLines.map(n=>n.geometry.dispose()),this.clear()}constructor(t,e){super(),this.context=t,this.options=e,this.doubleLines=[],this.loader=new Me.ObjectLoader,this.init()}};var Am=require("core-js/modules/es.typed-array.float32-array.js"),Cm=require("core-js/modules/es.typed-array.at.js"),Im=require("core-js/modules/es.typed-array.fill.js"),Rm=require("core-js/modules/es.typed-array.find-last.js"),Pm=require("core-js/modules/es.typed-array.find-last-index.js"),Lm=require("core-js/modules/es.typed-array.set.js"),Nm=require("core-js/modules/es.typed-array.sort.js"),Om=require("core-js/modules/es.typed-array.to-reversed.js"),Dm=require("core-js/modules/es.typed-array.to-sorted.js"),Um=require("core-js/modules/es.typed-array.with.js"),Fm=require("core-js/modules/es.array-buffer.constructor.js"),Bm=require("core-js/modules/es.array-buffer.slice.js"),zm=require("core-js/modules/es.array-buffer.detached.js"),Gm=require("core-js/modules/es.array-buffer.transfer.js"),km=require("core-js/modules/es.array-buffer.transfer-to-fixed-length.js"),Vm=require("core-js/modules/web.dom-collections.iterator.js"),X=require("three");var nn=class extends X.Object3D{setColorByIndex(t,e){this.mesh&&(this.mesh.setColorAt(t,new X.Color(e).convertLinearToSRGB()),this.mesh.instanceColor.needsUpdate=!0)}init(){return g(this,null,function*(){this.initMaterial(),this.initMesh(),this.mesh.position.z=this.options[0].deltaHeight+this.options[0].airHeight,this.options[0].strokeOpacity!==0&&(this.initLineMaterial(),this.initLineGeometry(),this.createBorder())})}initMaterial(){this.material=A.GetInstancedGraphicMaterial()}initLineMaterial(){let t=A.GetMergeAttributeGraphicLineMaterial();this.lineMaterial=t}initMesh(){this.mesh&&this.remove(this.mesh),this.mesh=new X.InstancedMesh(this.geometry,this.material,this.options.length);let t=new X.InstancedBufferAttribute(new Float32Array(this.options.length),1),e=new X.InstancedBufferAttribute(new Float32Array(this.options.length),1);this.options.forEach((n,r)=>{let i=n.geometry.coords[0],[o,s,u]=i.slice(0,3),l=Math.sqrt((s[0]-o[0])**2+(s[1]-o[1])**2),c=Math.sqrt((u[0]-s[0])**2+(u[1]-s[1])**2),h=[l,c],p=Math.max(...h),f=Math.min(...h),d;p===l?d=[s[0]-o[0],s[1]-o[1]]:d=[u[0]-s[0],u[1]-s[1]];let[m,y]=d,x=Math.atan2(y,m)-Math.PI/2,E=new X.Matrix4().compose(new X.Vector3(n.center_coord_x,n.center_coord_y,(n.deltaHeight||0)+n.airHeight+n.height/2),new X.Quaternion().setFromAxisAngle(new X.Vector3(0,0,1),x),new X.Vector3(f,p,n.height));this.mesh.setMatrixAt(r,E),this.mesh.setColorAt(r,new X.Color(n.fillColor).convertLinearToSRGB()),t.array[r]=n.fillOpacity||1,e.array[r]=(n.deltaHeight||0)+n.airHeight+n.height}),this.originOpacity=[...t.array],this.geometry.setAttribute("opacity",t),this.geometry.setAttribute("maxZ",e),this.add(this.mesh),this.mesh.instanceMatrix.needsUpdate=!0}initLineGeometry(){this.lineGeometry&&this.lineGeometry.dispose();let{points:t,colors:e,opacities:n}=Rr(this.options),r=new X.BufferGeometry().setFromPoints(t);r.setAttribute("color",new X.BufferAttribute(new Float32Array(e),3)),r.setAttribute("opacity",new X.BufferAttribute(new Float32Array(n),1)),this.lineOriginOpacity=[...n],this.lineGeometry=r}createBorder(){this.line&&this.remove(this.line);let t=new X.LineSegments(this.lineGeometry,this.lineMaterial);return t.position.z=.01,this.line=t,this.add(t),t}setOpacity(t,e){e===void 0&&(e=!1);let n=this.geometry.getAttribute("opacity");for(let o=0;o<n.count;o++)if(e)n.array[o]=t;else{var r;n.array[o]=Math.min(t,(r=this.originOpacity[o])!=null?r:1)}if(n.needsUpdate=!0,this.lineGeometry){let o=this.lineGeometry.getAttribute("opacity");for(let s=0;s<o.count;s++)if(e)o.array[s]=t;else{var i;o.array[s]=Math.min(t,(i=this.lineOriginOpacity[s])!=null?i:1)}o.needsUpdate=!0}}dispose(){var t,e;this.geometry.dispose(),(t=this.mesh)==null||t.dispose(),(e=this.line)==null||e.geometry.dispose(),this.clear()}constructor(t,e){super(),this.context=t,this.geometry=new X.BoxGeometry(1,1,1),this.options=[],this.originOpacity=[],this.lineOriginOpacity=[],this.options=e.map(n=>v({},de,n)),this.init()}};var Ym=require("core-js/modules/es.typed-array.float32-array.js"),Zm=require("core-js/modules/es.typed-array.at.js"),Km=require("core-js/modules/es.typed-array.fill.js"),$m=require("core-js/modules/es.typed-array.find-last.js"),Jm=require("core-js/modules/es.typed-array.find-last-index.js"),Qm=require("core-js/modules/es.typed-array.set.js"),t_=require("core-js/modules/es.typed-array.sort.js"),e_=require("core-js/modules/es.typed-array.to-reversed.js"),n_=require("core-js/modules/es.typed-array.to-sorted.js"),r_=require("core-js/modules/es.typed-array.with.js"),i_=require("core-js/modules/es.array-buffer.constructor.js"),o_=require("core-js/modules/es.array-buffer.slice.js"),s_=require("core-js/modules/es.array-buffer.detached.js"),a_=require("core-js/modules/es.array-buffer.transfer.js"),u_=require("core-js/modules/es.array-buffer.transfer-to-fixed-length.js"),l_=require("core-js/modules/web.dom-collections.iterator.js"),Qt=require("three");var Ke=class extends Qt.Object3D{init(){return g(this,null,function*(){this.initMaterial(),this.initMesh()})}initMaterial(){this.material=A.GetInstancedGraphicMaterial()}initMesh(){if(this.mesh&&this.remove(this.mesh),!this.elements)return;this.mesh=new Qt.InstancedMesh(this.geometry,this.material,this.elements.size);let t=new Qt.InstancedBufferAttribute(new Float32Array(this.elements.opacities),1),e=new Qt.InstancedBufferAttribute(new Float32Array(this.elements.maxZs),1);this.originOpacities=[...t.array],this.geometry.setAttribute("opacity",t),this.geometry.setAttribute("maxZ",e),this.mesh.instanceMatrix.set(this.elements.matrixes),this.mesh.instanceColor=new Qt.InstancedBufferAttribute(new Float32Array(this.elements.colors),3),this.add(this.mesh),this.mesh.instanceMatrix.needsUpdate=!0}setColorByIndex(t,e){this.mesh&&(this.mesh.setColorAt(t,new Qt.Color(e).convertLinearToSRGB()),this.mesh.instanceColor.needsUpdate=!0)}setOpacityByIndex(t,e){if(this.mesh){let n=this.geometry.getAttribute("opacity");n.setX(t,e),n.needsUpdate=!0}}setMatrixByIndex(t,e){this.mesh&&(this.mesh.setMatrixAt(t,e),this.mesh.instanceMatrix.needsUpdate=!0)}setMaxZByIndex(t,e){if(this.mesh){let n=this.geometry.getAttribute("maxZ");n.setX(t,e),n.needsUpdate=!0}}setColorById(t,e){if(!this.elements)return;let n=this.elements.ids.findIndex(r=>r===t);n!==-1&&this.setColorByIndex(n,e)}setOpacityById(t,e){if(!this.elements)return;let n=this.elements.ids.findIndex(r=>r===t);n!==-1&&this.setOpacityByIndex(n,e)}setMatrixById(t,e){if(!this.elements)return;let n=this.elements.ids.findIndex(r=>r===t);n!==-1&&this.setMatrixByIndex(n,e)}setMaxZById(t,e){if(!this.elements)return;let n=this.elements.ids.findIndex(r=>r===t);n!==-1&&this.setMaxZByIndex(n,e)}setOpacity(t,e){if(e===void 0&&(e=!1),!this.geometry)return;let n=this.geometry.getAttribute("opacity");for(let i=0;i<n.count;i++)if(e)n.array[i]=t;else{var r;n.array[i]=Math.min(t,(r=this.originOpacities[i])!=null?r:1)}n.needsUpdate=!0}pushElements(t){this.elements?(this.elements.size+=t.size,this.elements.colors=[...this.elements.colors,...t.colors],this.elements.matrixes=[...this.elements.matrixes,...t.matrixes],this.elements.opacities=[...this.elements.opacities,...t.opacities],this.elements.maxZs=[...this.elements.maxZs,...t.maxZs],this.elements.ids=[...this.elements.ids,...t.ids],this.originOpacities=[...this.originOpacities,...t.opacities]):this.elements=t,this.refesh()}removeInstanceById(t){if(this.elements){if(this.mesh){let e=this.elements.ids.indexOf(t);e!==-1&&(this.elements.size--,this.elements.colors.splice(e*3,3),this.elements.matrixes.splice(e*16,16),this.elements.opacities.splice(e,1),this.elements.maxZs.splice(e,1),this.elements.ids.splice(e,1),this.originOpacities.splice(e,1))}this.refesh()}}refesh(){this.mesh&&(this.mesh.dispose(),this.remove(this.mesh)),this.init()}dispose(){var t;this.material=null,this.originOpacities.length=0,this.geometry.dispose(),(t=this.mesh)==null||t.dispose(),this.clear()}constructor(t,e){super(),this.geometry=new Qt.BoxGeometry(1,1,1),this.material=null,this.elements=null,this.originOpacities=[],this.elements=e,this.init()}};var f_=require("core-js/modules/es.typed-array.float32-array.js"),d_=require("core-js/modules/es.typed-array.at.js"),g_=require("core-js/modules/es.typed-array.fill.js"),m_=require("core-js/modules/es.typed-array.find-last.js"),__=require("core-js/modules/es.typed-array.find-last-index.js"),y_=require("core-js/modules/es.typed-array.set.js"),v_=require("core-js/modules/es.typed-array.sort.js"),x_=require("core-js/modules/es.typed-array.to-reversed.js"),E_=require("core-js/modules/es.typed-array.to-sorted.js"),b_=require("core-js/modules/es.typed-array.with.js"),S_=require("core-js/modules/es.array-buffer.constructor.js"),M_=require("core-js/modules/es.array-buffer.slice.js"),w_=require("core-js/modules/es.array-buffer.detached.js"),T_=require("core-js/modules/es.array-buffer.transfer.js"),A_=require("core-js/modules/es.array-buffer.transfer-to-fixed-length.js"),C_=require("core-js/modules/web.dom-collections.iterator.js"),ie=require("three");var rr=class extends ie.Object3D{init(){return g(this,null,function*(){this.initMaterial(),this.initMesh()})}initMaterial(){this.material=A.GetInstancedWallMaterial()}initMesh(){if(this.mesh&&this.remove(this.mesh),!this.elements)return;this.mesh=new ie.InstancedMesh(this.geometry,this.material,this.elements.size);let t=new ie.InstancedBufferAttribute(new Float32Array(this.elements.opacities),1),e=new ie.InstancedBufferAttribute(new Float32Array(this.elements.maxZs),1),n=new ie.InstancedBufferAttribute(new Float32Array(this.elements.minZs),1);this.originOpacities=[...t.array],this.geometry.setAttribute("opacity",t),this.geometry.setAttribute("maxZ",e),this.geometry.setAttribute("minZ",n),this.mesh.instanceMatrix.set(this.elements.matrixes),this.mesh.instanceColor=new ie.InstancedBufferAttribute(new Float32Array(this.elements.colors),3),this.add(this.mesh),this.mesh.instanceMatrix.needsUpdate=!0}setOpacityByIndex(t,e){if(this.mesh){let n=this.geometry.getAttribute("opacity");n.setX(t,e),n.needsUpdate=!0}}setOpacity(t,e){e===void 0&&(e=!1),this.elements&&this.elements.opacities.forEach((n,r)=>{let i=e?t:Math.min(t,this.originOpacities[r]);this.setOpacityByIndex(r,i)})}dispose(){this.mesh&&(this.mesh.dispose(),this.remove(this.mesh)),this.material=null,this.geometry&&this.geometry.dispose(),this.elements=null}constructor(t,e){super(),this.geometry=new ie.BoxGeometry(1,1,1),this.material=null,this.elements=null,this.originOpacities=[],this.elements=e,this.init()}};var hn=require("three");var Oe=class extends hn.Object3D{init(){return g(this,null,function*(){this.initLineGeometry(),this.initLineMaterial(),this.createBorder()})}initLineMaterial(){return this.lineMaterial=A.GetMergeAttributeGraphicLineMaterial()}initLineGeometry(){this.lineGeometry&&this.lineGeometry.dispose();let t=this.loader.parseGeometries([this.options]);this.lineGeometry=t[this.options.uuid]}createBorder(){this.line&&this.remove(this.line);let t=new hn.LineSegments(this.lineGeometry,this.lineMaterial);return t.position.z=.01,this.line=t,this.add(t),t}dispose(){var t;(t=this.lineGeometry)==null||t.dispose(),this.lineMaterial=null,this.clear()}constructor(t,e){super(),this.context=t,this.lineMaterial=null,this.loader=new hn.ObjectLoader,this.options=v({},de,e),this.init()}};var $s=require("three"),Xr=class extends Vt{setEnable(t){super.setEnable(t),Ct(this.rect,0,0,0,0),t?this.registryEvent():(this.startPoint=void 0,this.unRegistryEvent())}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:e,container:{clientWidth:n,clientHeight:r}}}=this,i=N(this.startPoint,e,n,r),o=N(this.endPoint,e,n,r),s={x:Math.min(i.x,o.x),y:Math.min(i.y,o.y)},u={x:Math.max(i.x,o.x),y:Math.max(i.y,o.y)},l=this.searchMapInFrustum(s,u);this.dispatchEvent({type:"selected",list:l})}}searchMapInFrustum(t,e){var n;let{context:r}=this;return((n=r.currentFloor)==null?void 0:n.graphicLayer.children.filter(i=>i instanceof mt&&this.searchChildInFrustum(i,t,e)))||[]}searchChildInFrustum(t,e,n){let{context:{camera:r,container:{clientWidth:i,clientHeight:o}}}=this;if(!t)return!1;if(!t.mesh){let p=t.getPosition();if(p){let f=N(p,r,i,o);return xe(f,e,n)}return!1}t.mesh.geometry.boundingBox||t.mesh.geometry.computeBoundingBox();let s=t.mesh.geometry.boundingBox;if(!s)return!1;let{min:u,max:l}=s,c=N(u,r,i,o),h=N(l,r,i,o);return!(!xe(c,e,n)||!xe(h,e,n))}dispose(){super.dispose(),this.rect=null,this.unRegistryEvent()}constructor(t){super(t),this.frustum=new $s.Frustum,this.onPointerDown=r=>{if(!this.enable)return;let i=this.getIntersectByPointerEvent(r);i&&(this.startPoint=i),this.endPoint=void 0},this.onPointerMove=r=>{if(!this.enable||!this.startPoint)return;let i=this.getIntersectByPointerEvent(r);i&&(this.endPoint=i)},this.onPointerUp=r=>{if(!this.enable)return;let i=this.getIntersectByPointerEvent(r);i&&(this.endPoint=i),this.doSelect(),this.startPoint=void 0},this.onUpdate=()=>{if(this.startPoint){let r=this.getSvgCoordinate(this.startPoint),i=v({},r);this.endPoint&&(i=this.getSvgCoordinate(this.endPoint));let o={x:Math.min(r.x,i.x),y:Math.min(r.y,i.y)},s=Math.abs(i.x-r.x),u=Math.abs(i.y-r.y);Ct(this.rect,o.x,o.y,s,u)}else Ct(this.rect,0,0,0,0)};let{config:{selectBox:{fill:e,stroke:n}}}=t;this.rect=Ee(n,e),this.svg.appendChild(this.rect),this.registryEvent()}};var ir=class extends Js.EventDispatcher{get list(){return this._list}enableBoxSelection(){this.isMultipleSelect||!this.context.config.enableBoxSelect||(this.isMultipleSelect=!0,this.boxSelection.setEnable(!0),this.prevPanStatus=this.context.control.enablePan,this.prevRotateStatus=this.context.control.enableRotate,this.context.control.enablePan=!1,this.context.control.enableRotate=!1)}disableBoxSelection(){this.isMultipleSelect&&(this.isMultipleSelect=!1,this.boxSelection.setEnable(!1),this.context.control.enablePan=!!this.prevPanStatus,this.context.control.enableRotate=!!this.prevRotateStatus)}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()}constructor(t){super(),this.context=t,this._list=new Set,this.downPoint=null,this.downTime=0,this.isMultipleSelect=!1,this.onPointerDown=e=>{Date.now()-this.downTime<200||(this.downPoint={x:e.offsetX,y:e.offsetY},this.downTime=Date.now())},this.onPointerUp=e=>{if(!this.downPoint)return;let{offsetX:n,offsetY:r}=e,{x:i,y:o}=this.downPoint;if(Math.sqrt((i-n)**2+(o-r)**2)>3)return;let{graphics:s}=this.context.getGraphicsByDeviceXy(n,r),u=new Set(s.map(c=>c.options.id));this.context.getPoisByDeviceXy(n,r).forEach(c=>{if(!u.has(c.options.id)){var h;let p=((h=this.context.currentFloor)==null?void 0:h.graphicLayer.graphicMap.get(c.options.id))||null;p&&p.options.geometry.type==="point"&&(s.push(p),u.add(c.options.id))}}),(He?e.metaKey:e.ctrlKey)||this._list.clear(),s.forEach(c=>this._list.add(c)),this.selectEnd(),this.downPoint=null},this.onPointerOut=e=>{this.disableBoxSelection()},this.onKeyDown=e=>{We(e.key)&&this.enableBoxSelection()},this.onKeyUp=e=>{We(e.key)&&this.disableBoxSelection()},this.onBoxSelected=e=>{let{list:n}=e;this._list.clear(),n.forEach(r=>{this._list.add(r)}),this.selectEnd()},this.boxSelection=new Xr(t),this.boxSelection.setEnable(!1),this.registryEvent()}};var Q_=require("core-js/modules/es.set.difference.v2.js"),ty=require("core-js/modules/es.set.intersection.v2.js"),ey=require("core-js/modules/es.set.is-disjoint-from.v2.js"),ny=require("core-js/modules/es.set.is-subset-of.v2.js"),ry=require("core-js/modules/es.set.is-superset-of.v2.js"),iy=require("core-js/modules/es.set.symmetric-difference.v2.js"),oy=require("core-js/modules/es.set.union.v2.js"),sy=require("core-js/modules/web.dom-collections.iterator.js");var qr=require("three");var or=class extends qr.EventDispatcher{handleHoverGraphicsChange(t){t===void 0&&(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()}constructor(t){super(),this.context=t,this.curGraphics=new Set,this.timer=new $,this.graphicTimerMap=new Map,this.onPointerMove=e=>{let{graphics:n,pois:r,e:i}=e,o=r.map(c=>{var h;return(h=this.context.currentFloor)==null?void 0:h.graphicLayer.graphicMap.get(c.options.id)}).filter(c=>c&&c.options.geometry.type==="point");if(!n.length&&!o.length&&this.curGraphics.size){this.curGraphics.clear(),this.handleHoverGraphicsChange();return}let{time:s}=this.context.config.hover,u=new Set;if(o.length){let c,h=1e4;o.forEach(p=>{let f=r.find(d=>d.options.id===p.options.id);if(f instanceof Pe){let{x:d,y:m}=f.clientPos,y=Math.sqrt((d-i.offsetX)**2+(m-i.offsetY)**2);y<h&&(h=y,c=p)}else if(f instanceof st){let{x:d,y:m}=f.box.getCenter(new qr.Vector2),y=Math.sqrt((d-i.offsetX)**2+(m-i.offsetY)**2);y<h&&(h=y,c=p)}}),u.add(c)}u.size||n.forEach(c=>u.add(c)),u.forEach(c=>{if(this.graphicTimerMap.get(c)||this.curGraphics.has(c))return;let h=this.timer.setTimeout(()=>{this.curGraphics.add(c),this.graphicTimerMap.delete(c),this.timer.clearTimeout(h),this.handleHoverGraphicsChange()},s);this.graphicTimerMap.set(c,h)}),this.graphicTimerMap.forEach((c,h)=>{u.has(h)||(this.timer.clearTimeout(c),this.graphicTimerMap.delete(h))});let l=this.curGraphics.size;this.curGraphics.forEach(c=>{u.has(c)||this.curGraphics.delete(c)}),l!==this.curGraphics.size&&this.handleHoverGraphicsChange()},this.onPointerLevel=()=>{this.curGraphics.clear(),this.handleHoverGraphicsChange()},this.onBodyPointerMove=e=>{if(this.curGraphics.size){let n=this.context.container.getBoundingClientRect();(e.clientX<n.left||e.clientX>n.right||e.clientY<n.top||e.clientY>n.bottom)&&this.onPointerLevel()}},this.registryEvent()}};var cy=require("core-js/modules/web.dom-collections.iterator.js"),Wt=require("three");var sr=require("@turf/turf"),jr=class{updateBox(){this.box.setFromObject(this.context.scene)}setEnable(t){this.enable=t,t?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(d=>d instanceof re).length)return null;let e=this.box,{camera:n,clientSize:{width:r,height:i}}=this.context,{min:o,max:s}=e,l=[new Wt.Vector3(o.x,o.y,o.z),new Wt.Vector3(s.x,o.y,o.z),new Wt.Vector3(o.x,s.y,o.z),new Wt.Vector3(s.x,s.y,o.z),new Wt.Vector3(o.x,o.y,s.z),new Wt.Vector3(s.x,o.y,s.z),new Wt.Vector3(o.x,s.y,s.z),new Wt.Vector3(s.x,s.y,s.z)].map(d=>N(d,n,r,i)),c=Math.min(...l.map(d=>d.x)),h=Math.max(...l.map(d=>d.x)),p=Math.min(...l.map(d=>d.y)),f=Math.max(...l.map(d=>d.y));return{left:c,right:h,top:p,bottom:f}}checkDistanceToScreenEdge(t){let{left:e,right:n,top:r,bottom:i}=t,{width:o,height:s}=this.context.clientSize,[u,l,c,h]=this.context.config.cameraBound.padding,p=(0,sr.polygon)([[[e,r],[n,r],[n,i],[e,i],[e,r]]]),f=(0,sr.polygon)([[[h,u],[o-l,u],[o-l,s-c],[h,s-c],[h,u]]]);try{return(0,sr.intersect)(p,f)!==null}catch(d){return console.warn("\u8BA1\u7B97\u4EA4\u96C6\u51FA\u9519:",d),!1}}dispose(){this.unRegistryEvent()}constructor(t){this.context=t,this.prevCamera={position:new Wt.Vector3,zoom:1,target:new Wt.Vector3},this.enable=!0,this.box=new Wt.Box3,this.onCameraChange=()=>{let e=this.getCurFloorScreenPosition();if(e){let{left:n,right:r,top:i,bottom:o}=e;this.checkDistanceToScreenEdge({left:n,right:r,top:i,bottom:o})?this.changePrevCamera():this.backToPrevCamera()}},this.registryEvent(),this.changePrevCamera()}};var _y=require("core-js/modules/es.promise.finally.js"),Yi=require("three"),$e=require("@tweenjs/tween.js");var dy=require("core-js/modules/web.dom-collections.iterator.js"),gy=require("core-js/modules/es.array.push.js"),M=require("three"),Yr=new M.Ray,Qs=new M.Plane,wu=Math.cos(70*M.MathUtils.DEG2RAD),Zr=class extends M.EventDispatcher{dispose(){this.domElement.removeEventListener("contextmenu",this.onContextMenu),this.domElement.removeEventListener("pointerdown",this.onPointerDown),this.domElement.removeEventListener("pointercancel",this.onPointerUp),this.domElement.removeEventListener("wheel",this.onMouseWheel),this.domElement.removeEventListener("pointermove",this.onPointerMove),this.domElement.removeEventListener("pointerup",this.onPointerUp),this._domElementKeyEvents!==null&&(this._domElementKeyEvents.removeEventListener("keydown",this.onKeyDown),this._domElementKeyEvents=null)}constructor(t,e){super(),this.rotateLineStart=new M.Vector2,this.rotateLineEnd=new M.Vector2,this.spherical=new M.Spherical,this.sphericalDelta=new M.Spherical,this.object=t,this.domElement=e,this.domElement.style.touchAction="none",this.enabled=!0,this.target=new M.Vector3,this.minDistance=0,this.maxDistance=1/0,this.minZoom=0,this.maxZoom=1/0,this.minPolarAngle=0,this.maxPolarAngle=Math.PI,this.minAzimuthAngle=-1/0,this.maxAzimuthAngle=1/0,this.enableDamping=!1,this.dampingFactor=.05,this.enableZoom=!0,this.zoomSpeed=1,this.enableRotate=!0,this.rotateSpeed=1,this.enablePan=!0,this.panSpeed=1,this.keyPanSpeed=7,this.zoomToCursor=!1,this.autoRotate=!1,this.autoRotateSpeed=2,this.keys={LEFT:"ArrowLeft",UP:"ArrowUp",RIGHT:"ArrowRight",BOTTOM:"ArrowDown"},this.screenSpacePanning=!1,this.mouseButtons={LEFT:M.MOUSE.PAN,MIDDLE:M.MOUSE.DOLLY,RIGHT:M.MOUSE.ROTATE},this.touches={ONE:M.TOUCH.PAN,TWO:M.TOUCH.DOLLY_ROTATE},this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this._domElementKeyEvents=null,this.getPolarAngle=function(){return s.phi},this.getAzimuthalAngle=function(){return s.theta},this.getDistance=function(){return this.object.position.distanceTo(this.target)},this.listenToKeyEvents=function(_){_.addEventListener("keydown",this.onKeyDown),this._domElementKeyEvents=_},this.stopListenToKeyEvents=function(){var _;(_=this._domElementKeyEvents)==null||_.removeEventListener("keydown",this.onKeyDown),this._domElementKeyEvents=null},this.saveState=function(){n.target0.copy(n.target),n.position0.copy(n.object.position),n.zoom0=n.object.zoom},this.reset=function(){n.target.copy(n.target0),n.object.position.copy(n.position0),n.object.zoom=n.zoom0,n.object.updateProjectionMatrix(),n.dispatchEvent({type:"change"}),n.update(),i=r.NONE},this.update=function(){let _=new M.Vector3,b=new M.Quaternion().setFromUnitVectors(t.up,new M.Vector3(0,1,0)),Y=b.clone().invert(),lt=new M.Vector3,Bt=new M.Quaternion,ae=new M.Vector3,ee=2*Math.PI;return function(bn){bn===void 0&&(bn=null);let _e=n.object.position;_.copy(_e).sub(n.target),_.applyQuaternion(b),s.setFromVector3(_),n.autoRotate&&i===r.NONE&&I(L(bn)),n.enableDamping?(s.theta+=u.theta*n.dampingFactor,s.phi+=u.phi*n.dampingFactor):(s.theta+=u.theta,s.phi+=u.phi);let ye=n.minAzimuthAngle,ve=n.maxAzimuthAngle;isFinite(ye)&&isFinite(ve)&&(ye<-Math.PI?ye+=ee:ye>Math.PI&&(ye-=ee),ve<-Math.PI?ve+=ee:ve>Math.PI&&(ve-=ee),ye<=ve?s.theta=Math.max(ye,Math.min(ve,s.theta)):s.theta=s.theta>(ye+ve)/2?Math.max(ye,s.theta):Math.min(ve,s.theta)),s.phi=Math.max(n.minPolarAngle,Math.min(n.maxPolarAngle,s.phi)),s.makeSafe(),n.enableDamping===!0?n.target.addScaledVector(c,n.dampingFactor):n.target.add(c),n.zoomToCursor&&K||n.object.isOrthographicCamera?s.radius=j(s.radius):s.radius=j(s.radius*l),_.setFromSpherical(s),_.applyQuaternion(Y),_e.copy(n.target).add(_),n.object.lookAt(n.target),n.enableDamping===!0?(u.theta*=1-n.dampingFactor,u.phi*=1-n.dampingFactor,c.multiplyScalar(1-n.dampingFactor)):(u.set(0,0,0),c.set(0,0,0));let br=!1;if(n.zoomToCursor&&K){let Sn=null;if(n.object.isPerspectiveCamera){let Mn=_.length();Sn=j(Mn*l);let Sr=Mn-Sn;n.object.position.addScaledVector(R,Sr),n.object.updateMatrixWorld()}else if(n.object.isOrthographicCamera){let Mn=new M.Vector3(P.x,P.y,0);Mn.unproject(n.object),n.object.zoom=Math.max(n.minZoom,Math.min(n.maxZoom,n.object.zoom/l)),n.object.updateProjectionMatrix(),br=!0;let Sr=new M.Vector3(P.x,P.y,0);Sr.unproject(n.object),n.object.position.sub(Sr).add(Mn),n.object.updateMatrixWorld(),Sn=_.length()}else console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."),n.zoomToCursor=!1;Sn!==null&&(n.screenSpacePanning?n.target.set(0,0,-1).transformDirection(n.object.matrix).multiplyScalar(Sn).add(n.object.position):(Yr.origin.copy(n.object.position),Yr.direction.set(0,0,-1).transformDirection(n.object.matrix),Math.abs(n.object.up.dot(Yr.direction))<wu?t.lookAt(n.target):(Qs.setFromNormalAndCoplanarPoint(n.object.up,n.target),Yr.intersectPlane(Qs,n.target))))}else n.object.isOrthographicCamera&&(n.object.zoom=Math.max(n.minZoom,Math.min(n.maxZoom,n.object.zoom/l)),n.object.updateProjectionMatrix(),br=!0);return l=1,K=!1,br||lt.distanceToSquared(n.object.position)>o||8*(1-Bt.dot(n.object.quaternion))>o||ae.distanceToSquared(n.target)>0?(n.dispatchEvent({type:"change"}),lt.copy(n.object.position),Bt.copy(n.object.quaternion),ae.copy(n.target),br=!1,!0):!1}}();let n=this,r={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_PAN:4,TOUCH_DOLLY_PAN:5,TOUCH_DOLLY_ROTATE:6},i=r.NONE,o=1e-6,s=new M.Spherical,u=new M.Spherical,l=1,c=new M.Vector3,h=new M.Vector2,p=new M.Vector2,f=new M.Vector2,d=new M.Vector2,m=new M.Vector2,y=new M.Vector2,x=new M.Vector2,E=new M.Vector2,S=new M.Vector2,R=new M.Vector3,P=new M.Vector2,K=!1,T=[],Q={};function L(_){return _!==null?2*Math.PI/60*n.autoRotateSpeed*_:2*Math.PI/60/60*n.autoRotateSpeed}function O(){return Math.pow(.95,n.zoomSpeed)}function I(_){u.theta-=_}function V(_){u.phi-=_}let it=function(){let _=new M.Vector3;return function(Y,lt){_.setFromMatrixColumn(lt,0),_.multiplyScalar(-Y),c.add(_)}}(),q=function(){let _=new M.Vector3;return function(Y,lt){n.screenSpacePanning===!0?_.setFromMatrixColumn(lt,1):(_.setFromMatrixColumn(lt,0),_.crossVectors(n.object.up,_)),_.multiplyScalar(Y),c.add(_)}}(),z=function(){let _=new M.Vector3;return function(Y,lt){let Bt=n.domElement;if(n.object.isPerspectiveCamera){let ae=n.object.position;_.copy(ae).sub(n.target);let ee=_.length();ee*=Math.tan(n.object.fov/2*Math.PI/180),it(2*Y*ee/Bt.clientHeight,n.object.matrix),q(2*lt*ee/Bt.clientHeight,n.object.matrix)}else n.object.isOrthographicCamera?(it(Y*(n.object.right-n.object.left)/n.object.zoom/Bt.clientWidth,n.object.matrix),q(lt*(n.object.top-n.object.bottom)/n.object.zoom/Bt.clientHeight,n.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),n.enablePan=!1)}}();function ge(_){n.object.isPerspectiveCamera||n.object.isOrthographicCamera?l/=_:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),n.enableZoom=!1)}function Te(_){n.object.isPerspectiveCamera||n.object.isOrthographicCamera?l*=_:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),n.enableZoom=!1)}function H(_){if(!n.zoomToCursor)return;K=!0;let b=n.domElement.getBoundingClientRect(),Y=_.clientX-b.left,lt=_.clientY-b.top,Bt=b.width,ae=b.height;P.x=Y/Bt*2-1,P.y=-(lt/ae)*2+1,R.set(P.x,P.y,1).unproject(n.object).sub(n.object.position).normalize()}function j(_){return Math.max(n.minDistance,Math.min(n.maxDistance,_))}function ut(_){h.set(_.clientX,_.clientY)}function ot(_){H(_),x.set(_.clientX,_.clientY)}function oe(_){d.set(_.clientX,_.clientY)}function se(_){p.set(_.clientX,_.clientY),f.subVectors(p,h).multiplyScalar(n.rotateSpeed);let b=n.domElement;I(2*Math.PI*f.x/b.clientHeight),V(2*Math.PI*f.y/b.clientHeight),h.copy(p),n.update()}function Ae(_){E.set(_.clientX,_.clientY),S.subVectors(E,x),S.y>0?ge(O()):S.y<0&&Te(O()),x.copy(E),n.update()}function me(_){m.set(_.clientX,_.clientY),y.subVectors(m,d).multiplyScalar(n.panSpeed),z(y.x,y.y),d.copy(m),n.update()}function En(_){H(_),_.deltaY<0?Te(O()):_.deltaY>0&&ge(O()),n.update()}function wa(_){let b=!1;switch(_.code){case n.keys.UP:_.ctrlKey||_.metaKey||_.shiftKey?V(2*Math.PI*n.rotateSpeed/n.domElement.clientHeight):z(0,n.keyPanSpeed),b=!0;break;case n.keys.BOTTOM:_.ctrlKey||_.metaKey||_.shiftKey?V(-2*Math.PI*n.rotateSpeed/n.domElement.clientHeight):z(0,-n.keyPanSpeed),b=!0;break;case n.keys.LEFT:_.ctrlKey||_.metaKey||_.shiftKey?I(2*Math.PI*n.rotateSpeed/n.domElement.clientHeight):z(n.keyPanSpeed,0),b=!0;break;case n.keys.RIGHT:_.ctrlKey||_.metaKey||_.shiftKey?I(-2*Math.PI*n.rotateSpeed/n.domElement.clientHeight):z(-n.keyPanSpeed,0),b=!0;break}b&&(_.preventDefault(),n.update())}function Mo(){if(T.length===1)h.set(T[0].pageX,T[0].pageY);else{let _=(T[0].pageX-T[0].pageY)/(T[1].pageX-T[1].pageY),b=T[0].pageY-_*T[0].pageX;n.rotateLineStart.set(_,b);let Y=.5*(T[0].pageX+T[1].pageX),lt=.5*(T[0].pageY+T[1].pageY);h.set(Y,lt)}}function wo(){if(T.length===1)d.set(T[0].pageX,T[0].pageY);else{let _=.5*(T[0].pageX+T[1].pageX),b=.5*(T[0].pageY+T[1].pageY);d.set(_,b)}}function To(){let _=T[0].pageX-T[1].pageX,b=T[0].pageY-T[1].pageY,Y=Math.sqrt(_*_+b*b);x.set(0,Y)}function Ta(){n.enableZoom&&To(),n.enablePan&&wo()}function Aa(){n.enableZoom&&To(),n.enableRotate&&Mo()}function Ao(_){if(T.length==1)p.set(_.pageX,_.pageY);else{let Y=di(_),lt=.5*(_.pageX+Y.x),Bt=.5*(_.pageY+Y.y);p.set(lt,Bt);let ae=(_.pageY-Y.y)/(_.pageX-Y.x),ee=Y.y-ae*Y.x;if(n.rotateLineEnd.set(ae,ee),Number.isFinite(n.rotateLineEnd.x)&&Number.isFinite(n.rotateLineStart.x)){let gi=(n.rotateLineStart.y-n.rotateLineEnd.y)/(n.rotateLineEnd.x-n.rotateLineStart.x),bn=ae*gi+ee;if(Number.isFinite(gi)&&Number.isFinite(bn)){let _e=Math.atan(n.rotateLineEnd.x)-Math.atan(n.rotateLineStart.x);Math.PI-Math.abs(_e)<.5&&(_e=-Math.sign(_e)*(Math.PI-Math.abs(_e))),Math.abs(_e)<.1&&(u.theta+=_e)}}n.rotateLineStart.copy(n.rotateLineEnd)}f.subVectors(p,h).multiplyScalar(n.rotateSpeed);let b=n.domElement;V(2*Math.PI*f.y/b.clientHeight),h.copy(p)}function Co(_){if(T.length===1)m.set(_.pageX,_.pageY);else{let b=di(_),Y=.5*(_.pageX+b.x),lt=.5*(_.pageY+b.y);m.set(Y,lt)}y.subVectors(m,d).multiplyScalar(n.panSpeed),z(y.x,y.y),d.copy(m)}function Io(_){let b=di(_),Y=_.pageX-b.x,lt=_.pageY-b.y,Bt=Math.sqrt(Y*Y+lt*lt);E.set(0,Bt),S.set(0,Math.pow(E.y/x.y,n.zoomSpeed)),ge(S.y),x.copy(E)}function Ca(_){n.enableZoom&&Io(_),n.enablePan&&Co(_)}function Ia(_){n.enableZoom&&Io(_),n.enableRotate&&Ao(_)}this.onPointerDown=function(b){n.enabled!==!1&&(T.length===0&&(n.domElement.setPointerCapture(b.pointerId),n.domElement.addEventListener("pointermove",n.onPointerMove),n.domElement.addEventListener("pointerup",n.onPointerUp)),Oa(b),b.pointerType==="touch"?La(b):Ra(b))},this.onPointerMove=function(b){n.enabled!==!1&&(b.pointerType==="touch"?Na(b):Pa(b))},this.onPointerUp=function(b){Da(b),T.length===0&&(n.domElement.releasePointerCapture(b.pointerId),n.domElement.removeEventListener("pointermove",n.onPointerMove),n.domElement.removeEventListener("pointerup",n.onPointerUp)),n.dispatchEvent({type:"end"}),i=r.NONE};function Ra(_){let b;switch(_.button){case 0:b=n.mouseButtons.LEFT;break;case 1:b=n.mouseButtons.MIDDLE;break;case 2:b=n.mouseButtons.RIGHT;break;default:b=-1}switch(b){case M.MOUSE.DOLLY:if(n.enableZoom===!1)return;ot(_),i=r.DOLLY;break;case M.MOUSE.ROTATE:if(_.ctrlKey||_.metaKey||_.shiftKey){if(n.enablePan===!1)return;oe(_),i=r.PAN}else{if(n.enableRotate===!1)return;ut(_),i=r.ROTATE}break;case M.MOUSE.PAN:if(_.ctrlKey||_.metaKey||_.shiftKey){if(n.enableRotate===!1)return;ut(_),i=r.ROTATE}else{if(n.enablePan===!1)return;oe(_),i=r.PAN}break;default:i=r.NONE}i!==r.NONE&&n.dispatchEvent({type:"start"})}function Pa(_){switch(i){case r.ROTATE:if(n.enableRotate===!1)return;se(_);break;case r.DOLLY:if(n.enableZoom===!1)return;Ae(_);break;case r.PAN:if(n.enablePan===!1)return;me(_);break}}this.onMouseWheel=function(b){n.enabled===!1||n.enableZoom===!1||i!==r.NONE||(b.preventDefault(),n.dispatchEvent({type:"start"}),En(b),n.dispatchEvent({type:"end"}))},this.onKeyDown=function(b){n.enabled===!1||n.enablePan===!1||wa(b)};function La(_){switch(Ro(_),T.length){case 1:switch(n.touches.ONE){case M.TOUCH.ROTATE:if(n.enableRotate===!1)return;Mo(),i=r.TOUCH_ROTATE;break;case M.TOUCH.PAN:if(n.enablePan===!1)return;wo(),i=r.TOUCH_PAN;break;default:i=r.NONE}break;case 2:switch(n.touches.TWO){case M.TOUCH.DOLLY_PAN:if(n.enableZoom===!1&&n.enablePan===!1)return;Ta(),i=r.TOUCH_DOLLY_PAN;break;case M.TOUCH.DOLLY_ROTATE:if(n.enableZoom===!1&&n.enableRotate===!1)return;Aa(),i=r.TOUCH_DOLLY_ROTATE;break;default:i=r.NONE}break;default:i=r.NONE}i!==r.NONE&&n.dispatchEvent({type:"start"})}function Na(_){switch(Ro(_),i){case r.TOUCH_ROTATE:if(n.enableRotate===!1)return;Ao(_),n.update();break;case r.TOUCH_PAN:if(n.enablePan===!1)return;Co(_),n.update();break;case r.TOUCH_DOLLY_PAN:if(n.enableZoom===!1&&n.enablePan===!1)return;Ca(_),n.update();break;case r.TOUCH_DOLLY_ROTATE:if(n.enableZoom===!1&&n.enableRotate===!1)return;Ia(_),n.update();break;default:i=r.NONE}}this.onContextMenu=function(b){n.enabled!==!1&&b.preventDefault()};function Oa(_){T.push(_)}function Da(_){delete Q[_.pointerId];for(let b=0;b<T.length;b++)if(T[b].pointerId==_.pointerId){T.splice(b,1);return}}function Ro(_){let b=Q[_.pointerId];b===void 0&&(b=new M.Vector2,Q[_.pointerId]=b),b.set(_.pageX,_.pageY)}function di(_){let b=_.pointerId===T[0].pointerId?T[1]:T[0];return Q[b.pointerId]}n.domElement.addEventListener("contextmenu",this.onContextMenu),n.domElement.addEventListener("pointerdown",this.onPointerDown),n.domElement.addEventListener("pointercancel",this.onPointerUp),n.domElement.addEventListener("wheel",this.onMouseWheel,{passive:!1}),this.update()}};var ar=class extends Zr{registryEvent(){this.addEventListener("change",this.onChange),this.context.addEventListener("update",this.tweenUpdate)}unRegistryEvent(){this.removeEventListener("change",this.onChange),this.context.removeEventListener("update",this.tweenUpdate)}setPolarAngle(t,e){e===void 0&&(e=!1);let{maxPolarAngle:n,minPolarAngle:r}=this,i=n===r;(e||t<=n&&t>=r)&&(this.maxPolarAngle=t,this.minPolarAngle=t,this.update()),i||(this.maxPolarAngle=n,this.minPolarAngle=r)}setPolarAngleByDuration(t,e,n){return g(this,null,function*(){return e===void 0&&(e=!1),n===void 0&&(n=500),n<=0?this.setPolarAngle(t,e):Gt(new Promise(r=>{let i={polar:this.getPolarAngle()},o={polar:t},s=new $e.Tween(i,this.tweenGroup).to(o,n).onUpdate(()=>{this.setPolarAngle(i.polar,e)}).onComplete(()=>{this.enabled=!0,this.tweenGroup.remove(s),r(!0)}).onStart(()=>{this.enabled=!1}).start()}),n+500)})}setAzimuthalAngle(t,e){let{maxAzimuthAngle:n,minAzimuthAngle:r}=this,i=n===r;(e||t<=n&&t>=r)&&(this.maxAzimuthAngle=t,this.minAzimuthAngle=t,this.update()),i||(this.maxAzimuthAngle=n,this.minAzimuthAngle=r)}setAzimuthalAngleDuration(t,e,n){return e===void 0&&(e=!1),n===void 0&&(n=500),n<=0?this.setAzimuthalAngle(t,e):Gt(new Promise(r=>{let i={azimuthal:this.getAzimuthalAngle()},o={azimuthal:t},s=new $e.Tween(i,this.tweenGroup).to(o,n).onUpdate(()=>{this.setAzimuthalAngle(i.azimuthal,e)}).onComplete(()=>{this.enabled=!0,this.tweenGroup.remove(s),r(!0)}).onStart(()=>{this.enabled=!1}).start()}),n+500)}getCameraLookAt(){return new Yi.Vector3().subVectors(this.target,this.camera.position)}setCameraPositionByTarget(t,e){return g(this,null,function*(){let n=this.target.clone(),r=this.getCameraLookAt();if(!e){this.camera.position.copy(t.clone().sub(r)),this.target.copy(t.clone()),this.update();return}return Gt(new Promise(i=>{let o=new $e.Tween(n,this.tweenGroup).to(t,e).onUpdate(()=>{this.camera.position.copy(n.clone().sub(r)),this.target.copy(n.clone()),this.update()}).onComplete(()=>{this.tweenGroup.remove(o),this.enabled=!0,i(!0)}).onStart(()=>{this.enabled=!1}).start()}),e+500)})}setZoom(t,e,n){n===void 0&&(n=!1);let{minZoom:r,maxZoom:i}=this;(n||t>=r&&t<=i)&&(this.camera.position.copy(e.clone().sub(this.getCameraLookAt())),this.target.copy(e),this.camera.zoom=t,this.update())}setZoomByDuration(t,e,n,r){return g(this,null,function*(){n===void 0&&(n=!1),r===void 0&&(r=500);let i={zoom:this.camera.zoom,target:this.target.clone()};if(t!==this.camera.zoom)return r?Gt(new Promise(o=>{let s=new $e.Tween(i,this.tweenGroup).to({zoom:t,target:e},r).onUpdate(()=>{this.setZoom(i.zoom,i.target,n)}).onComplete(()=>{this.tweenGroup.remove(s),this.enabled=!0,o(!0)}).onStart(()=>{this.enabled=!1}).start()}),r+500).finally(()=>{this.enabled=!0}):this.setZoom(t,e,n)})}setTargetByOffset(t,e){if(e===void 0&&(e=this.target.clone()),this.camera.updateMatrix(),t){let n=new Yi.Vector3;n.setFromMatrixColumn(this.camera.matrix,1),n.normalize(),n.multiplyScalar(t/this.camera.zoom),e.add(n)}this.setCameraPositionByTarget(e,0)}clearTween(){this.tweenGroup.getAll().forEach(t=>t.stop()),this.tweenGroup.removeAll()}dispose(){super.dispose(),this.unRegistryEvent(),this.clearTween()}constructor(t,e,n){super(e,n),this.context=t,this.camera=e,this.domElement=n,this.prevCameraZoom=1,this.tweenGroup=new $e.Group,this.offsetY=0,this.onChange=()=>{let r=this.camera.zoom;r!==this.prevCameraZoom&&(this.prevCameraZoom=r,this.dispatchEvent({type:"change-zoom",zoom:r}))},this.tweenUpdate=()=>{this.tweenGroup.update()},this.enableDamping=!1,this.zoomSpeed=.5,this.prevCameraZoom=e.zoom,this.registryEvent()}};var pn=require("three");var ur=class extends pn.WebGLRenderer{setCameraAndScene(t,e){this.scene=t,this.camera=e}autoRender(){this.scene&&this.camera&&this.enable&&(this.event.dispatchEvent({type:"update"}),this.render(this.scene,this.camera)),this.timer.requestAnimationFrame(()=>{this.autoRender()})}pauseRender(){this.enable=!1}continueRender(){this.enable=!0}addEventListener(t,e){this.event.addEventListener(t,e)}removeEventListener(t,e){this.event.removeEventListener(t,e)}constructor(t){super(v({antialias:!0,alpha:!0},t)),this.event=new pn.EventDispatcher,this.enable=!0,this.timer=new $,this.autoClear=!0,this.setPixelRatio(window.devicePixelRatio),this.toneMapping=pn.LinearToneMapping,this.toneMappingExposure=1;let e=this.dispose;this.dispose=()=>{this.timer.dispose(),this.enable=!1,e.call(this),this.domElement.remove(),this.domElement=null,this.shadowMap=null,this.info.programs&&(this.info.programs.length=0),this.info=null}}};var ra=require("three");var ta=require("three"),ea=require("three/examples/jsm/environments/RoomEnvironment.js");function na(a,t){t===void 0&&(t=.85);let e=new ta.PMREMGenerator(a);return e.compileEquirectangularShader(),e.fromScene(new ea.RoomEnvironment).texture}var lr=class extends ra.Scene{dispose(){var t;(t=this.environment)==null||t.dispose(),this.environment=null,F(this),this.clear()}constructor(t){super(),this.environment=na(t)}};var ia=require("three"),cr=class extends ia.OrthographicCamera{constructor(t,e){super(-t/2,t/2,e/2,-e/2,-1e4,5e4),this.up.set(0,0,1),this.position.set(0,0,100),this.lookAt(0,0,0)}};var Zi=require("@turf/turf");var Ry=require("core-js/modules/es.array.unshift.js"),Py=require("core-js/modules/es.array.push.js"),oa=require("three"),Kr=class{registryEvent(){this.context.addEventListener("update",this.onUpdate),this.context.addEventListener("control-change",this.onControlChange),this.context.addEventListener("resize",this.onControlChange)}unRegistryEvent(){this.context.removeEventListener("update",this.onUpdate),this.context.removeEventListener("control-change",this.onControlChange),this.context.removeEventListener("resize",this.onControlChange)}changePoiLevelOrCollisionEnable(t){let e=this.objects.findIndex(n=>n===t);e!==-1&&(this.objects.splice(e,1),this.addObject(t))}addObject(t){if(!this.objects.includes(t)){if(this.needsUpdate=!0,!t.options.collision_enable){this.objects.unshift(t);return}if(t.options.level===0){this.objects.push(t);return}for(let e=0;e<this.objects.length;e++){let n=this.objects[e];if(n.options.collision_enable&&n.options.level<=t.options.level){this.objects.splice(e,0,t);return}}this.objects.push(t)}}removeObject(t){let e=this.objects.indexOf(t);e!==-1&&(this.objects.splice(e,1),this.needsUpdate=!0)}removeObjects(t){this.objects=this.objects.filter(e=>!t.includes(e)),this.needsUpdate=!0}getObjectById(t){return this.objects.find(e=>e.options.id===t)||null}validShowParkingSpace(t){t===void 0&&(t=60);let{clientSize:{width:e,height:n},control:r,camera:i}=this.context,o=Math.min(e/t,n/t,r.maxZoom-1);return i.zoom>=o}detectCollisions(){if(!this.needsUpdate)return;let t=[],{camera:e}=this.context;e.updateMatrixWorld();let n=c=>c<=1&&c>=-1,r=e.projectionMatrix.clone();r.multiply(e.matrixWorldInverse);let i=e.zoom/this.context.basicZoom,o=25/30,s=Math.min(25,Math.max(1,i*o)),u=this.validShowParkingSpace();this.objects.filter(c=>{if(c.visible){if(!(s<=c.options.maxWeight&&s>=c.options.minWeight)||!u&&c.userData.type==="parkingSpace")return c.parentSetVisible(!1),!1;let h=c.getWorldPosition(new oa.Vector3);return h.applyMatrix4(r),c.screenPosition=h,n(h.x)&&n(h.y)&&n(h.z)?!0:(c.parentSetVisible(!1),!1)}return!1}).forEach((c,h)=>{let p=c.getBox(c.screenPosition);if(p===null){c.parentSetVisible(!1);return}if(h===0||!c.options.collision_enable){t.push(p),c.parentSetVisible(!0);return}let f=t.some(d=>d.intersectsBox(p));c.parentSetVisible(!f),f||t.push(p)}),this.needsUpdate=!1}markForUpdate(){this.needsUpdate=!0}clear(){this.objects=[],this.needsUpdate=!0}dispose(){this.objects=[],this.unRegistryEvent()}constructor(t){this.context=t,this.objects=[],this.needsUpdate=!0,this.onUpdate=()=>{this.detectCollisions()},this.onControlChange=()=>{this.needsUpdate=!0},this.registryEvent()}};var hr=class extends k.EventDispatcher{get config(){return this.bmap.config}get center(){return this.bmap.buildingCenter}setRange(t){this.range=(0,Zi.polygon)([t])}resizeClientSize(){let{x:t,y:e,width:n,height:r}=this.container.getBoundingClientRect();this.clientSize={width:n||this.container.clientWidth,height:r||this.container.clientHeight,x:t,y:e}}init(){let{clientWidth:t,clientHeight:e}=this.container;this.camera=new cr(t,e),this.renderer.setSize(t,e),this.renderer.setCameraAndScene(this.scene,this.camera),this.renderer.autoRender(),this.control=new ar(this,this.camera,this.renderer.domElement),this.control.maxPolarAngle=this.config.control.maxPolar,this.container.appendChild(this.renderer.domElement),this.scene.add(this.lights),this.basicRatio=this.getRatio(),this.control.addEventListener("change",this.onControlChange),this.control.addEventListener("change-zoom",this.onControlChangeZoom),this.renderer.addEventListener("update",this.onRendererUpdate),this.cameraBound=new jr(this)}getRatio(t,e){t===void 0&&(t=new k.Vector3(0,0,0)),e===void 0&&(e=new k.Vector3(100,0,0));let{clientWidth:n,clientHeight:r}=this.container,i=N(t,this.camera,n,r),o=N(e,this.camera,n,r);return Math.ceil(Math.sqrt((o.x-i.x)**2+(o.y-i.y)**2))}changeAmbientLightColor(t){this.lights.children.forEach(e=>{e instanceof k.AmbientLight&&(e.color=new k.Color(t))})}switchFloor(t,e){e===void 0&&(e=!0),console.log("switchFloor",e),this.currentFloor&&(this.scene.remove(this.currentFloor),e?this.currentFloor.dispose():this.currentFloor.onRemoveFromScene()),this.currentFloor=t,this.setRange(t.userData.range||[]),this.scene.add(t),t.onAddToScene("scene"),this.cameraBound.updateBox()}getGraphicsByDeviceXy(t,e){var n;let r=new k.Vector2;r.x=t/this.clientSize.width*2-1,r.y=e/this.clientSize.height*-2+1;let i=new k.Raycaster;return i.setFromCamera(r,this.camera),i.ray.origin.sub(i.ray.direction.clone().multiplyScalar(100)),((n=this.currentFloor)==null?void 0:n.graphicLayer.getGraphicByRaycaster(i))||{graphics:[],position:null}}getPoisByDeviceXy(t,e){var n,r;let i=(n=this.currentFloor)==null?void 0:n.poiLayer.getPoiByDeviceXy(t,e),o=(r=this.currentFloor)==null?void 0:r.poiLayer2.getPoiByDeviceXy(t,e);return(i||[]).concat(o||[])}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),this.control.removeEventListener("change",this.onControlChange),this.control.removeEventListener("change-zoom",this.onControlChangeZoom),this.renderer.removeEventListener("update",this.onRendererUpdate)}setPolarAngle(t,e){return e===void 0&&(e=500),this.control.setPolarAngleByDuration(t,!0,e)}setAzimuthalAngle(t,e){return e===void 0&&(e=500),this.control.setAzimuthalAngleDuration(t,!0,e)}getCameraLookAt(){return this.control.getCameraLookAt()}setZoom(t,e,n){return n===void 0&&(n=500),this.control.setZoomByDuration(t,e,!0,n)}getFitCameraToObjectZoom(t,e,n){return e===void 0&&(e=[20,20,20,20]),n===void 0&&(n=!0),this.getFitCameraToBoxZoom(new k.Box3().setFromObject(t),e,n)}getFitCameraToBoxZoom(t,e,n){e===void 0&&(e=[20,20,20,20]),n===void 0&&(n=!0);let[r,i,o,s]=e,{clientSize:{width:u,height:l}}=this,c=this.control.getPolarAngle();n&&this.setPolarAngle(0,0),this.setPolarAngle(c,0);let{max:h,min:p}=t,f=new k.Vector3(p.x,h.y,h.z),d=new k.Vector3(h.x,h.y,h.z),m=new k.Vector3(h.x,p.y,p.z),y=new k.Vector3(p.x,p.y,p.z),x=N(f,this.camera,u,l),E=N(d,this.camera,u,l),S=N(y,this.camera,u,l),R=N(m,this.camera,u,l),K=new k.Box2().setFromPoints([new k.Vector2(x.x,x.y),new k.Vector2(E.x,E.y),new k.Vector2(S.x,S.y),new k.Vector2(R.x,R.y)]).getSize(new k.Vector2),T=(u-i-s)/K.x,Q=(l-r-o)/K.y,L=Math.min(T,Q),O=new k.Vector3((h.x+p.x)/2,(h.y+p.y)/2,(h.z+p.z)/2),I=L*this.camera.zoom,V=this.camera.clone();V.zoom=I,V.updateMatrix();let it=(i-s)/2,q=(r-o)/2;if(it){let z=new k.Vector3;z.setFromMatrixColumn(V.matrix,0),z.normalize(),z.multiplyScalar(it/I),O.add(z)}if(q){let z=new k.Vector3;z.setFromMatrixColumn(V.matrix,1),z.normalize(),z.multiplyScalar(q/I),O.add(z)}return{zoom:L*this.camera.zoom,center:O}}fitCameraToObject(t,e,n,r){e===void 0&&(e=[20,20,20,20]),n===void 0&&(n=500),r===void 0&&(r=!0);let{zoom:i,center:o}=this.getFitCameraToObjectZoom(t,e,r);return this.setZoom(i,o,n)}fitCameraToBox(t,e,n,r){e===void 0&&(e=[20,20,20,20]),n===void 0&&(n=500),r===void 0&&(r=!0);let{zoom:i,center:o}=this.getFitCameraToBoxZoom(t,e,r);return this.setZoom(i,o,n)}getFitCameraToGroundZoom(t,e,n){if(t===void 0&&(t=[20,20,20,20]),e===void 0&&(e=500),n===void 0&&(n=!0),this.currentFloor&&this.currentFloor.hasElement)return this.getFitCameraToObjectZoom(this.currentFloor.groundUpper,t,n).zoom}fitCameraToGround(t,e,n){return t===void 0&&(t=[20,20,20,20]),e===void 0&&(e=500),n===void 0&&(n=!0),this.currentFloor&&this.currentFloor.hasElement?this.fitCameraToObject(this.currentFloor.groundLayer,t,e,n):Promise.resolve(!1)}setCameraPosition(t,e){return g(this,null,function*(){return this.control.setCameraPositionByTarget(t,e)})}pauseRender(){this.renderer.pauseRender()}continueRender(){this.renderer.continueRender()}forceUpdate(){this.collisionSystem.needsUpdate=!0}dispose(){var t;this.collisionSystem.dispose(),(t=this.currentFloor)==null||t.dispose(),this.control.dispose(),this.cameraBound.dispose(),this.selection.dispose(),this.hoverHelper.dispose(),this.unRegistryEvent(),this.renderer.dispose(),this.lights.children.forEach(e=>e.dispose()),this.scene.dispose(),this.container=null,this.renderer=null}constructor(t,e){super(),this.container=t,this.renderer=new ur,this.lights=yi(),this.range=(0,Zi.polygon)([]),this.clientSize={width:0,height:0,x:0,y:0},this.renderRf=0,this.basicZoom=1,this.onControlChange=()=>{this.dispatchEvent({type:"change-ratio",px:(this.basicRatio||0)*this.camera.zoom}),this.dispatchEvent({type:"control-change"})},this.onControlChangeZoom=n=>{let{zoom:r}=n;this.dispatchEvent({type:"control-zoom-change",zoom:r})},this.onRendererUpdate=()=>{this.dispatchEvent({type:"update"})},this.onWindowResize=()=>{let{container:n,camera:r,renderer:i}=this,{clientWidth:o,clientHeight:s}=n;o=Math.max(1,o),s=Math.max(1,s),r.left=-o/2,r.right=o/2,r.top=s/2,r.bottom=-s/2,r.updateProjectionMatrix(),i.setSize(o,s),this.resizeClientSize(),this.dispatchEvent({type:"resize",width:o,height:s})},this.onClick=n=>{let{graphics:r,position:i}=this.getGraphicsByDeviceXy(n.offsetX,n.offsetY);r.length&&this.dispatchEvent({type:"graphic-click",graphics:r,position:i});let o=this.getPoisByDeviceXy(n.offsetX,n.offsetY);o.length&&this.dispatchEvent({type:"poi-click",pois:o})},this.onPointerover=n=>{let{graphics:r,position:i}=this.getGraphicsByDeviceXy(n.offsetX,n.offsetY),o=this.getPoisByDeviceXy(n.offsetX,n.offsetY);this.dispatchEvent({type:"pointer-over",e:n,graphics:r,pois:o,position:i})},this.onPointermove=n=>{let{graphics:r,position:i}=this.getGraphicsByDeviceXy(n.offsetX,n.offsetY),o=this.getPoisByDeviceXy(n.offsetX,n.offsetY);this.dispatchEvent({type:"pointer-move",e:n,graphics:r,pois:o,position:i})},this.onPointerleave=n=>{this.dispatchEvent({type:"pointer-level"})},this.onSelectionSelect=n=>{let{graphics:r,isMultipleSelect:i}=n;this.dispatchEvent({type:"select-graphic",graphics:r,isMultipleSelect:i})},this.onHoverChange=n=>{let{graphics:r}=n;this.dispatchEvent({type:"hover",graphics:r})},this.bmap=e,this.container.style.position="relative",this.container.style.overflow="hidden",this.scene=new lr(this.renderer),this.collisionSystem=new Kr(this),this.init(),this.selection=new ir(this),this.hoverHelper=new or(this),this.resizeClientSize(),this.registryEvent()}};var sa=require("lodash"),aa={placeId:0,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",loadPlaceInfo:"https://screen.aibee.cn/ai-map/map/get-floor-map"},enableBoxSelect:!0,resizeObserver:!1,initTransToMark:!1,heatMap:{radius:50,minOpacity:.1,gradient:{0:"#8F9FCD",.5:"#6284FF",1:"#F95D5D"}},useFloorCache:!0,control:{maxPolar:1.2,defaultPolar:1.1,defaultAzimuthal:0,maxZoomScale:30},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},loaderPlaceConfig:{textFontSize:14}};function Ki(a){return(0,sa.merge)({},aa,a)}var ha=require("lodash");var iv=require("core-js/modules/web.dom-collections.iterator.js");var Qr=require("three");var Ky=require("core-js/modules/es.array.push.js"),$y=require("core-js/modules/web.dom-collections.iterator.js");var qy=require("core-js/modules/es.array.sort.js");var fn=function(a){return a.LAYERED_RENDER_VERSION="layeredRender",a.MERGED_RENDER_VERSION="mergedRender",a}({});function $r(a,t){let e=a.poi_info.showName||a.store_name||a.poi_info.text;switch(t){case"zh-cn":return e;case"en":var n;return((n=a.store_info_ext)==null?void 0:n.poi_name)||e;case"zh-hk":var r;return((r=a.store_info_ext)==null?void 0:r.traditional_name)||e}}function Jr(a,t){let e=a.poi_info.showName||a.store_name||a.poi_info.text;switch(t){case"zh-cn":return e;case"en":var n;return((n=a.infra_info_ext)==null?void 0:n.poi_name)||e;case"zh-hk":var r;return((r=a.infra_info_ext)==null?void 0:r.traditional_name)||e}}var $i=["range","ground","store","facility","parkingSpace"];function ua(a){return $i.indexOf(a.l_type)===-1?$i.length:$i.indexOf(a.l_type)}function Tu(a){a.layers.sort((t,e)=>ua(t)-ua(e))}function Au(a){let t=a.layers.find(n=>n.l_type==="range"),e=[t.elements[0].center_x,t.elements[0].center_y];a.layers.map(n=>{if(n.l_type!=="range")return Ln(n.elements,e)})}function pr(a){Tu(a),Au(a)}function dn(a,t){return t===void 0&&(t=5),a.floor_id+"_"+a.version_id+(t?"_"+t:"")}function la(a,t,e){switch(a.l_type){case"ground":return Ji(a,t);case"graph":return Cu(a,t);case"wall":return Iu(a,t);case"lane":return Ru(a,t);case"texture2d":case"texture3d":return Pu(a,t);case"glb":return Lu(a,t);case"store":return Nu(a,t,e);case"facility":return Du(a,t,e);case"parkingSpace":return Fu(a,t,e);case"text":return zu(a,t)}}function ca(a,t,e,n,r){switch(a.l_type){case"store":return Ou(a,t,e,n,r);case"facility":return Uu(a,t,e,n,r);case"parkingSpace":return Bu(a,t,n,r)}}function Cu(a,t){t.mergeGraphicLayer.addGraphics(a.elements,a.mergedElements)}function Ji(a,t){let e=a.elements.map(n=>new mt(t.context,v({},n,{dashed:!1})));t.addGrounds(e)}function Iu(a,t){if(a.mergedElements)a.mergedElements.map(e=>{if(e.instancedGeometry){let n=new rr(t.context,e.instancedGeometry);t.wallLayer.add(n)}if(e.mergedGeometry){let n=new er(t.context,e);t.wallLayer.add(n)}});else{let e=a.elements.reduce((n,r)=>{let{fillColor:i,fillOpacity:o,strokeColor:s,strokeOpacity:u,height:l}=r,c=i.toLowerCase()+"-"+o+"-"+s.toLowerCase()+"-"+u+"-"+l;return u===0&&(c=i.toLowerCase()+"-"+o+"-"+l),n[c]?n[c].push(r):n[c]=[r],n},{});Object.values(e).forEach(n=>{let r=new Jn(t.context,n);t.wallLayer.add(r)})}}function Ru(a,t){if(a.mergedElements){let e=new nr(t.context,a.mergedElements);t.laneLayer.add(e)}else{let e=new Qn(t.context,a.elements);t.laneLayer.add(e)}}function Pu(a,t){if(a.mergedMatrixes)a.mergedMatrixes.map(e=>{let n=new Ne(t.context,e);t.textureLayer.add(n)});else if(a.elements.length){let e=new Le(t.context,a.elements);t.textureLayer.add(e)}}function Lu(a,t){t.glbModelLayer.addModels(a.elements.map(e=>v({},e,{url:e.secondUrl,rotate:e.secondRotate,width:e.secondWidth,center_x:e.center_coord_x,center_y:e.center_coord_y,deltaHeight:0})))}function Nu(a,t,e){e.mergeGraphic?t.mergeGraphicLayer.addGraphics(a.elements,a.mergedElements):a.elements.map(n=>{let r=t.addGraphic(v({},n,{dashed:!1}));t.userData.graphics.push(r),t.userData.graphicMap.set(n.id,r)})}function Ou(a,t,e,n,r){a.elements.filter(i=>r.filterPoi(i)).map(i=>{try{let o=$r(i,e),s=new st(t.context,{id:i.id,icon:i.poi_info.showImageUrl||i.poi_info.icon,text:o,position:{x:i.center_coord_x,y:i.center_coord_y,z:i.airHeight+i.height},icon_size:[24,24],level:i.poi_info.level||0,hide_text:!n.showStoreName,maxWeight:i.poi_info.maxWeight||25,minWeight:i.poi_info.minWeight||1,text_font_size:n.textFontSize});t.poiLayer2.pushPoi(s),s&&(s.userData.type="store",s.userData.data=i,s.userData.floor=t.name)}catch(o){console.log("\u521B\u5EFA\u5E97\u94FApoi\u5931\u8D25",o,i)}})}function Du(a,t,e){e.mergeGraphic?t.mergeGraphicLayer.addGraphics(a.elements,a.mergedElements):a.elements.map(n=>{let r=t.addGraphic(v({},n,{dashed:!1}));t.userData.graphics.push(r),t.userData.graphicMap.set(n.id,r)})}function Uu(a,t,e,n,r){a.elements.filter(i=>i.poi_info).filter(i=>r.filterPoi(i)).map(i=>{try{let o=Jr(i,e),s=new st(t.context,{id:i.id,icon:i.poi_info.showImageUrl||i.poi_info.icon,text:o,position:{x:i.center_coord_x,y:i.center_coord_y,z:i.airHeight+i.height},icon_size:[24,24],level:i.poi_info.level||0,hide_text:!n.showFacilityName,maxWeight:i.poi_info.maxWeight||25,minWeight:i.poi_info.minWeight||1,text_font_size:n.textFontSize});t.poiLayer2.pushPoi(s),s.userData.type="facility",s.userData.data=i,s.userData.floor=t.name}catch(o){console.log("\u6DFB\u52A0facility\u5931\u8D25",o,i)}})}function Fu(a,t,e){t.parkingSpaceLayer.load(a,e.mergeParkingSpace),t.userData.parkingSpaces=t.parkingSpaceLayer.graphicMap.values(),t.userData.parkingSpacesGraphicMap=t.parkingSpaceLayer.graphicMap}function Bu(a,t,e,n){return g(this,null,function*(){a.elements.filter(i=>i.texts[0]).filter(i=>n.filterPoi(i)).forEach(i=>{try{let o=i.displayName||i.texts[0],s=new st(t.context,{id:i.id,text:o,position:{x:i.center_coord_x,y:i.center_coord_y,z:i.airHeight+i.height},text_font_size:e.textFontSize});s&&(s.userData.type="parkingSpace",s.userData.data=i,s.userData.floor=t.name),t.poiLayer2.pushPoi(s)}catch(o){console.log("\u6DFB\u52A0\u8F66\u4F4Dpoi\u5931\u8D25",o,i)}})})}function zu(a,t){let e=new tr(t.context,a.elements.map(n=>v({},n,{center_x:n.center_coord_x,center_y:n.center_coord_y})));t.textTextureLayer.add(e)}function Qi(){let a=new Blob([`var $D=Object.create;var U1=Object.defineProperty;var ZD=Object.getOwnPropertyDescriptor;var JD=Object.getOwnPropertyNames;var jD=Object.getPrototypeOf,KD=Object.prototype.hasOwnProperty;var X=(n,t)=>()=>(t||n((t={exports:{}}).exports,t),t.exports);var QD=(n,t,e,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of JD(t))!KD.call(n,s)&&s!==e&&U1(n,s,{get:()=>t[s],enumerable:!(i=ZD(t,s))||i.enumerable});return n};var jt=(n,t,e)=>(e=n!=null?$D(jD(n)):{},QD(t||!n||!n.__esModule?U1(e,"default",{value:n,enumerable:!0}):e,n));var Ri=(n,t,e)=>new Promise((i,s)=>{var u=p=>{try{f(e.next(p))}catch(d){s(d)}},c=p=>{try{f(e.throw(p))}catch(d){s(d)}},f=p=>p.done?i(p.value):Promise.resolve(p.value).then(u,c);f((e=e.apply(n,t)).next())});var Sn=X((zg,B1)=>{"use strict";var Mc=function(n){return n&&n.Math===Math&&n};B1.exports=Mc(typeof globalThis=="object"&&globalThis)||Mc(typeof window=="object"&&window)||Mc(typeof self=="object"&&self)||Mc(typeof global=="object"&&global)||Mc(typeof zg=="object"&&zg)||function(){return this}()||Function("return this")()});var An=X((vet,z1)=>{"use strict";z1.exports=function(n){try{return!!n()}catch(t){return!0}}});var ri=X((_et,G1)=>{"use strict";var t3=An();G1.exports=!t3(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!==7})});var bc=X((xet,k1)=>{"use strict";var e3=An();k1.exports=!e3(function(){var n=function(){}.bind();return typeof n!="function"||n.hasOwnProperty("prototype")})});var vr=X((Eet,q1)=>{"use strict";var n3=bc(),th=Function.prototype.call;q1.exports=n3?th.bind(th):function(){return th.apply(th,arguments)}});var X1=X(W1=>{"use strict";var V1={}.propertyIsEnumerable,H1=Object.getOwnPropertyDescriptor,r3=H1&&!V1.call({1:2},1);W1.f=r3?function(t){var e=H1(this,t);return!!e&&e.enumerable}:V1});var Ac=X((Met,Y1)=>{"use strict";Y1.exports=function(n,t){return{enumerable:!(n&1),configurable:!(n&2),writable:!(n&4),value:t}}});var In=X((bet,J1)=>{"use strict";var $1=bc(),Z1=Function.prototype,Gg=Z1.call,i3=$1&&Z1.bind.bind(Gg,Gg);J1.exports=$1?i3:function(n){return function(){return Gg.apply(n,arguments)}}});var vs=X((Aet,K1)=>{"use strict";var j1=In(),o3=j1({}.toString),s3=j1("".slice);K1.exports=function(n){return s3(o3(n),8,-1)}});var eh=X((Tet,Q1)=>{"use strict";var a3=In(),u3=An(),l3=vs(),kg=Object,c3=a3("".split);Q1.exports=u3(function(){return!kg("z").propertyIsEnumerable(0)})?function(n){return l3(n)==="String"?c3(n,""):kg(n)}:kg});var nh=X((Cet,tE)=>{"use strict";tE.exports=function(n){return n==null}});var zu=X((Iet,eE)=>{"use strict";var f3=nh(),h3=TypeError;eE.exports=function(n){if(f3(n))throw new h3("Can't call method on "+n);return n}});var Gu=X((Pet,nE)=>{"use strict";var p3=eh(),d3=zu();nE.exports=function(n){return p3(d3(n))}});var er=X((Ret,rE)=>{"use strict";var qg=typeof document=="object"&&document.all;rE.exports=typeof qg=="undefined"&&qg!==void 0?function(n){return typeof n=="function"||n===qg}:function(n){return typeof n=="function"}});var Ei=X((Let,iE)=>{"use strict";var g3=er();iE.exports=function(n){return typeof n=="object"?n!==null:g3(n)}});var $s=X((Net,oE)=>{"use strict";var Vg=Sn(),m3=er(),y3=function(n){return m3(n)?n:void 0};oE.exports=function(n,t){return arguments.length<2?y3(Vg[n]):Vg[n]&&Vg[n][t]}});var Tc=X((Oet,sE)=>{"use strict";var v3=In();sE.exports=v3({}.isPrototypeOf)});var ku=X((Det,lE)=>{"use strict";var _3=Sn(),aE=_3.navigator,uE=aE&&aE.userAgent;lE.exports=uE?String(uE):""});var Cc=X((Fet,gE)=>{"use strict";var dE=Sn(),Hg=ku(),cE=dE.process,fE=dE.Deno,hE=cE&&cE.versions||fE&&fE.version,pE=hE&&hE.v8,wo,rh;pE&&(wo=pE.split("."),rh=wo[0]>0&&wo[0]<4?1:+(wo[0]+wo[1]));!rh&&Hg&&(wo=Hg.match(/Edge\\/(\\d+)/),(!wo||wo[1]>=74)&&(wo=Hg.match(/Chrome\\/(\\d+)/),wo&&(rh=+wo[1])));gE.exports=rh});var ih=X((Uet,yE)=>{"use strict";var mE=Cc(),x3=An(),E3=Sn(),S3=E3.String;yE.exports=!!Object.getOwnPropertySymbols&&!x3(function(){var n=Symbol("symbol detection");return!S3(n)||!(Object(n)instanceof Symbol)||!Symbol.sham&&mE&&mE<41})});var Wg=X((Bet,vE)=>{"use strict";var w3=ih();vE.exports=w3&&!Symbol.sham&&typeof Symbol.iterator=="symbol"});var Ic=X((zet,_E)=>{"use strict";var M3=$s(),b3=er(),A3=Tc(),T3=Wg(),C3=Object;_E.exports=T3?function(n){return typeof n=="symbol"}:function(n){var t=M3("Symbol");return b3(t)&&A3(t.prototype,C3(n))}});var qu=X((Get,xE)=>{"use strict";var I3=String;xE.exports=function(n){try{return I3(n)}catch(t){return"Object"}}});var _s=X((ket,EE)=>{"use strict";var P3=er(),R3=qu(),L3=TypeError;EE.exports=function(n){if(P3(n))return n;throw new L3(R3(n)+" is not a function")}});var Pc=X((qet,SE)=>{"use strict";var N3=_s(),O3=nh();SE.exports=function(n,t){var e=n[t];return O3(e)?void 0:N3(e)}});var ME=X((Vet,wE)=>{"use strict";var Xg=vr(),Yg=er(),$g=Ei(),D3=TypeError;wE.exports=function(n,t){var e,i;if(t==="string"&&Yg(e=n.toString)&&!$g(i=Xg(e,n))||Yg(e=n.valueOf)&&!$g(i=Xg(e,n))||t!=="string"&&Yg(e=n.toString)&&!$g(i=Xg(e,n)))return i;throw new D3("Can't convert object to primitive value")}});var Rc=X((Het,bE)=>{"use strict";bE.exports=!1});var oh=X((Wet,TE)=>{"use strict";var AE=Sn(),F3=Object.defineProperty;TE.exports=function(n,t){try{F3(AE,n,{value:t,configurable:!0,writable:!0})}catch(e){AE[n]=t}return t}});var sh=X((Xet,PE)=>{"use strict";var U3=Rc(),B3=Sn(),z3=oh(),CE="__core-js_shared__",IE=PE.exports=B3[CE]||z3(CE,{});(IE.versions||(IE.versions=[])).push({version:"3.42.0",mode:U3?"pure":"global",copyright:"\\xA9 2014-2025 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.42.0/LICENSE",source:"https://github.com/zloirock/core-js"})});var ah=X((Yet,LE)=>{"use strict";var RE=sh();LE.exports=function(n,t){return RE[n]||(RE[n]=t||{})}});var Vi=X(($et,NE)=>{"use strict";var G3=zu(),k3=Object;NE.exports=function(n){return k3(G3(n))}});var oo=X((Zet,OE)=>{"use strict";var q3=In(),V3=Vi(),H3=q3({}.hasOwnProperty);OE.exports=Object.hasOwn||function(t,e){return H3(V3(t),e)}});var uh=X((Jet,DE)=>{"use strict";var W3=In(),X3=0,Y3=Math.random(),$3=W3(1 .toString);DE.exports=function(n){return"Symbol("+(n===void 0?"":n)+")_"+$3(++X3+Y3,36)}});var Xr=X((jet,UE)=>{"use strict";var Z3=Sn(),J3=ah(),FE=oo(),j3=uh(),K3=ih(),Q3=Wg(),Vu=Z3.Symbol,Zg=J3("wks"),tF=Q3?Vu.for||Vu:Vu&&Vu.withoutSetter||j3;UE.exports=function(n){return FE(Zg,n)||(Zg[n]=K3&&FE(Vu,n)?Vu[n]:tF("Symbol."+n)),Zg[n]}});var Jg=X((Ket,GE)=>{"use strict";var eF=vr(),BE=Ei(),zE=Ic(),nF=Pc(),rF=ME(),iF=Xr(),oF=TypeError,sF=iF("toPrimitive");GE.exports=function(n,t){if(!BE(n)||zE(n))return n;var e=nF(n,sF),i;if(e){if(t===void 0&&(t="default"),i=eF(e,n,t),!BE(i)||zE(i))return i;throw new oF("Can't convert object to primitive value")}return t===void 0&&(t="number"),rF(n,t)}});var lh=X((Qet,kE)=>{"use strict";var aF=Jg(),uF=Ic();kE.exports=function(n){var t=aF(n,"string");return uF(t)?t:t+""}});var ch=X((tnt,VE)=>{"use strict";var lF=Sn(),qE=Ei(),jg=lF.document,cF=qE(jg)&&qE(jg.createElement);VE.exports=function(n){return cF?jg.createElement(n):{}}});var Kg=X((ent,HE)=>{"use strict";var fF=ri(),hF=An(),pF=ch();HE.exports=!fF&&!hF(function(){return Object.defineProperty(pF("div"),"a",{get:function(){return 7}}).a!==7})});var fh=X(XE=>{"use strict";var dF=ri(),gF=vr(),mF=X1(),yF=Ac(),vF=Gu(),_F=lh(),xF=oo(),EF=Kg(),WE=Object.getOwnPropertyDescriptor;XE.f=dF?WE:function(t,e){if(t=vF(t),e=_F(e),EF)try{return WE(t,e)}catch(i){}if(xF(t,e))return yF(!gF(mF.f,t,e),t[e])}});var Qg=X((rnt,YE)=>{"use strict";var SF=ri(),wF=An();YE.exports=SF&&wF(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!==42})});var so=X((int,$E)=>{"use strict";var MF=Ei(),bF=String,AF=TypeError;$E.exports=function(n){if(MF(n))return n;throw new AF(bF(n)+" is not an object")}});var Wo=X(JE=>{"use strict";var TF=ri(),CF=Kg(),IF=Qg(),hh=so(),ZE=lh(),PF=TypeError,tm=Object.defineProperty,RF=Object.getOwnPropertyDescriptor,em="enumerable",nm="configurable",rm="writable";JE.f=TF?IF?function(t,e,i){if(hh(t),e=ZE(e),hh(i),typeof t=="function"&&e==="prototype"&&"value"in i&&rm in i&&!i[rm]){var s=RF(t,e);s&&s[rm]&&(t[e]=i.value,i={configurable:nm in i?i[nm]:s[nm],enumerable:em in i?i[em]:s[em],writable:!1})}return tm(t,e,i)}:tm:function(t,e,i){if(hh(t),e=ZE(e),hh(i),CF)try{return tm(t,e,i)}catch(s){}if("get"in i||"set"in i)throw new PF("Accessors not supported");return"value"in i&&(t[e]=i.value),t}});var xs=X((snt,jE)=>{"use strict";var LF=ri(),NF=Wo(),OF=Ac();jE.exports=LF?function(n,t,e){return NF.f(n,t,OF(1,e))}:function(n,t,e){return n[t]=e,n}});var ph=X((ant,QE)=>{"use strict";var im=ri(),DF=oo(),KE=Function.prototype,FF=im&&Object.getOwnPropertyDescriptor,om=DF(KE,"name"),UF=om&&function(){}.name==="something",BF=om&&(!im||im&&FF(KE,"name").configurable);QE.exports={EXISTS:om,PROPER:UF,CONFIGURABLE:BF}});var am=X((unt,tS)=>{"use strict";var zF=In(),GF=er(),sm=sh(),kF=zF(Function.toString);GF(sm.inspectSource)||(sm.inspectSource=function(n){return kF(n)});tS.exports=sm.inspectSource});var rS=X((lnt,nS)=>{"use strict";var qF=Sn(),VF=er(),eS=qF.WeakMap;nS.exports=VF(eS)&&/native code/.test(String(eS))});var dh=X((cnt,oS)=>{"use strict";var HF=ah(),WF=uh(),iS=HF("keys");oS.exports=function(n){return iS[n]||(iS[n]=WF(n))}});var gh=X((fnt,sS)=>{"use strict";sS.exports={}});var Va=X((hnt,lS)=>{"use strict";var XF=rS(),uS=Sn(),YF=Ei(),$F=xs(),um=oo(),lm=sh(),ZF=dh(),JF=gh(),aS="Object already initialized",cm=uS.TypeError,jF=uS.WeakMap,mh,Lc,yh,KF=function(n){return yh(n)?Lc(n):mh(n,{})},QF=function(n){return function(t){var e;if(!YF(t)||(e=Lc(t)).type!==n)throw new cm("Incompatible receiver, "+n+" required");return e}};XF||lm.state?(Mo=lm.state||(lm.state=new jF),Mo.get=Mo.get,Mo.has=Mo.has,Mo.set=Mo.set,mh=function(n,t){if(Mo.has(n))throw new cm(aS);return t.facade=n,Mo.set(n,t),t},Lc=function(n){return Mo.get(n)||{}},yh=function(n){return Mo.has(n)}):(qa=ZF("state"),JF[qa]=!0,mh=function(n,t){if(um(n,qa))throw new cm(aS);return t.facade=n,$F(n,qa,t),t},Lc=function(n){return um(n,qa)?n[qa]:{}},yh=function(n){return um(n,qa)});var Mo,qa;lS.exports={set:mh,get:Lc,has:yh,enforce:KF,getterFor:QF}});var pm=X((pnt,hS)=>{"use strict";var hm=In(),tU=An(),eU=er(),vh=oo(),fm=ri(),nU=ph().CONFIGURABLE,rU=am(),fS=Va(),iU=fS.enforce,oU=fS.get,cS=String,_h=Object.defineProperty,sU=hm("".slice),aU=hm("".replace),uU=hm([].join),lU=fm&&!tU(function(){return _h(function(){},"length",{value:8}).length!==8}),cU=String(String).split("String"),fU=hS.exports=function(n,t,e){sU(cS(t),0,7)==="Symbol("&&(t="["+aU(cS(t),/^Symbol\\(([^)]*)\\).*$/,"$1")+"]"),e&&e.getter&&(t="get "+t),e&&e.setter&&(t="set "+t),(!vh(n,"name")||nU&&n.name!==t)&&(fm?_h(n,"name",{value:t,configurable:!0}):n.name=t),lU&&e&&vh(e,"arity")&&n.length!==e.arity&&_h(n,"length",{value:e.arity});try{e&&vh(e,"constructor")&&e.constructor?fm&&_h(n,"prototype",{writable:!1}):n.prototype&&(n.prototype=void 0)}catch(s){}var i=iU(n);return vh(i,"source")||(i.source=uU(cU,typeof t=="string"?t:"")),n};Function.prototype.toString=fU(function(){return eU(this)&&oU(this).source||rU(this)},"toString")});var Ha=X((dnt,pS)=>{"use strict";var hU=er(),pU=Wo(),dU=pm(),gU=oh();pS.exports=function(n,t,e,i){i||(i={});var s=i.enumerable,u=i.name!==void 0?i.name:t;if(hU(e)&&dU(e,u,i),i.global)s?n[t]=e:gU(t,e);else{try{i.unsafe?n[t]&&(s=!0):delete n[t]}catch(c){}s?n[t]=e:pU.f(n,t,{value:e,enumerable:!1,configurable:!i.nonConfigurable,writable:!i.nonWritable})}return n}});var gS=X((gnt,dS)=>{"use strict";var mU=Math.ceil,yU=Math.floor;dS.exports=Math.trunc||function(t){var e=+t;return(e>0?yU:mU)(e)}});var Hi=X((mnt,mS)=>{"use strict";var vU=gS();mS.exports=function(n){var t=+n;return t!==t||t===0?0:vU(t)}});var xh=X((ynt,yS)=>{"use strict";var _U=Hi(),xU=Math.max,EU=Math.min;yS.exports=function(n,t){var e=_U(n);return e<0?xU(e+t,0):EU(e,t)}});var Wa=X((vnt,vS)=>{"use strict";var SU=Hi(),wU=Math.min;vS.exports=function(n){var t=SU(n);return t>0?wU(t,9007199254740991):0}});var ii=X((_nt,_S)=>{"use strict";var MU=Wa();_S.exports=function(n){return MU(n.length)}});var SS=X((xnt,ES)=>{"use strict";var bU=Gu(),AU=xh(),TU=ii(),xS=function(n){return function(t,e,i){var s=bU(t),u=TU(s);if(u===0)return!n&&-1;var c=AU(i,u),f;if(n&&e!==e){for(;u>c;)if(f=s[c++],f!==f)return!0}else for(;u>c;c++)if((n||c in s)&&s[c]===e)return n||c||0;return!n&&-1}};ES.exports={includes:xS(!0),indexOf:xS(!1)}});var gm=X((Ent,MS)=>{"use strict";var CU=In(),dm=oo(),IU=Gu(),PU=SS().indexOf,RU=gh(),wS=CU([].push);MS.exports=function(n,t){var e=IU(n),i=0,s=[],u;for(u in e)!dm(RU,u)&&dm(e,u)&&wS(s,u);for(;t.length>i;)dm(e,u=t[i++])&&(~PU(s,u)||wS(s,u));return s}});var Eh=X((Snt,bS)=>{"use strict";bS.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]});var mm=X(AS=>{"use strict";var LU=gm(),NU=Eh(),OU=NU.concat("length","prototype");AS.f=Object.getOwnPropertyNames||function(t){return LU(t,OU)}});var CS=X(TS=>{"use strict";TS.f=Object.getOwnPropertySymbols});var PS=X((bnt,IS)=>{"use strict";var DU=$s(),FU=In(),UU=mm(),BU=CS(),zU=so(),GU=FU([].concat);IS.exports=DU("Reflect","ownKeys")||function(t){var e=UU.f(zU(t)),i=BU.f;return i?GU(e,i(t)):e}});var ym=X((Ant,LS)=>{"use strict";var RS=oo(),kU=PS(),qU=fh(),VU=Wo();LS.exports=function(n,t,e){for(var i=kU(t),s=VU.f,u=qU.f,c=0;c<i.length;c++){var f=i[c];!RS(n,f)&&!(e&&RS(e,f))&&s(n,f,u(t,f))}}});var OS=X((Tnt,NS)=>{"use strict";var HU=An(),WU=er(),XU=/#|\\.prototype\\./,Nc=function(n,t){var e=$U[YU(n)];return e===JU?!0:e===ZU?!1:WU(t)?HU(t):!!t},YU=Nc.normalize=function(n){return String(n).replace(XU,".").toLowerCase()},$U=Nc.data={},ZU=Nc.NATIVE="N",JU=Nc.POLYFILL="P";NS.exports=Nc});var sr=X((Cnt,DS)=>{"use strict";var Sh=Sn(),jU=fh().f,KU=xs(),QU=Ha(),tB=oh(),eB=ym(),nB=OS();DS.exports=function(n,t){var e=n.target,i=n.global,s=n.stat,u,c,f,p,d,g;if(i?c=Sh:s?c=Sh[e]||tB(e,{}):c=Sh[e]&&Sh[e].prototype,c)for(f in t){if(d=t[f],n.dontCallGetSet?(g=jU(c,f),p=g&&g.value):p=c[f],u=nB(i?f:e+(s?".":"#")+f,n.forced),!u&&p!==void 0){if(typeof d==typeof p)continue;eB(d,p)}(n.sham||p&&p.sham)&&KU(d,"sham",!0),QU(c,f,d,n)}}});var Oc=X((Int,FS)=>{"use strict";var rB=vs();FS.exports=Array.isArray||function(t){return rB(t)==="Array"}});var vm=X((Pnt,US)=>{"use strict";var iB=ri(),oB=Oc(),sB=TypeError,aB=Object.getOwnPropertyDescriptor,uB=iB&&!function(){if(this!==void 0)return!0;try{Object.defineProperty([],"length",{writable:!1}).length=1}catch(n){return n instanceof TypeError}}();US.exports=uB?function(n,t){if(oB(n)&&!aB(n,"length").writable)throw new sB("Cannot set read only .length");return n.length=t}:function(n,t){return n.length=t}});var wh=X((Rnt,BS)=>{"use strict";var lB=TypeError,cB=9007199254740991;BS.exports=function(n){if(n>cB)throw lB("Maximum allowed index exceeded");return n}});var Mh=X(()=>{"use strict";var fB=sr(),hB=Vi(),pB=ii(),dB=vm(),gB=wh(),mB=An(),yB=mB(function(){return[].push.call({length:4294967296},1)!==4294967297}),vB=function(){try{Object.defineProperty([],"length",{writable:!1}).push()}catch(n){return n instanceof TypeError}},_B=yB||!vB();fB({target:"Array",proto:!0,arity:1,forced:_B},{push:function(t){var e=hB(this),i=pB(e),s=arguments.length;gB(i+s);for(var u=0;u<s;u++)e[i]=arguments[u],i++;return dB(e,i),i}})});var zS=X(()=>{"use strict";var xB=sr(),EB=vr();xB({target:"URL",proto:!0,enumerable:!0},{toJSON:function(){return EB(URL.prototype.toString,this)}})});var kS=X((Fnt,GS)=>{"use strict";GS.exports={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0}});var HS=X((Unt,VS)=>{"use strict";var SB=ch(),_m=SB("span").classList,qS=_m&&_m.constructor&&_m.constructor.prototype;VS.exports=qS===Object.prototype?void 0:qS});var XS=X((Bnt,WS)=>{"use strict";var wB=gm(),MB=Eh();WS.exports=Object.keys||function(t){return wB(t,MB)}});var $S=X(YS=>{"use strict";var bB=ri(),AB=Qg(),TB=Wo(),CB=so(),IB=Gu(),PB=XS();YS.f=bB&&!AB?Object.defineProperties:function(t,e){CB(t);for(var i=IB(e),s=PB(e),u=s.length,c=0,f;u>c;)TB.f(t,f=s[c++],i[f]);return t}});var JS=X((Gnt,ZS)=>{"use strict";var RB=$s();ZS.exports=RB("document","documentElement")});var Hu=X((knt,rw)=>{"use strict";var LB=so(),NB=$S(),jS=Eh(),OB=gh(),DB=JS(),FB=ch(),UB=dh(),KS=">",QS="<",Em="prototype",Sm="script",ew=UB("IE_PROTO"),xm=function(){},nw=function(n){return QS+Sm+KS+n+QS+"/"+Sm+KS},tw=function(n){n.write(nw("")),n.close();var t=n.parentWindow.Object;return n=null,t},BB=function(){var n=FB("iframe"),t="java"+Sm+":",e;return n.style.display="none",DB.appendChild(n),n.src=String(t),e=n.contentWindow.document,e.open(),e.write(nw("document.F=Object")),e.close(),e.F},bh,Ah=function(){try{bh=new ActiveXObject("htmlfile")}catch(t){}Ah=typeof document!="undefined"?document.domain&&bh?tw(bh):BB():tw(bh);for(var n=jS.length;n--;)delete Ah[Em][jS[n]];return Ah()};OB[ew]=!0;rw.exports=Object.create||function(t,e){var i;return t!==null?(xm[Em]=LB(t),i=new xm,xm[Em]=null,i[ew]=t):i=Ah(),e===void 0?i:NB.f(i,e)}});var bm=X((qnt,iw)=>{"use strict";var zB=Xr(),GB=Hu(),kB=Wo().f,wm=zB("unscopables"),Mm=Array.prototype;Mm[wm]===void 0&&kB(Mm,wm,{configurable:!0,value:GB(null)});iw.exports=function(n){Mm[wm][n]=!0}});var Wu=X((Vnt,ow)=>{"use strict";ow.exports={}});var aw=X((Hnt,sw)=>{"use strict";var qB=An();sw.exports=!qB(function(){function n(){}return n.prototype.constructor=null,Object.getPrototypeOf(new n)!==n.prototype})});var Dc=X((Wnt,lw)=>{"use strict";var VB=oo(),HB=er(),WB=Vi(),XB=dh(),YB=aw(),uw=XB("IE_PROTO"),Am=Object,$B=Am.prototype;lw.exports=YB?Am.getPrototypeOf:function(n){var t=WB(n);if(VB(t,uw))return t[uw];var e=t.constructor;return HB(e)&&t instanceof e?e.prototype:t instanceof Am?$B:null}});var Pm=X((Xnt,hw)=>{"use strict";var ZB=An(),JB=er(),jB=Ei(),KB=Hu(),cw=Dc(),QB=Ha(),tz=Xr(),ez=Rc(),Im=tz("iterator"),fw=!1,Es,Tm,Cm;[].keys&&(Cm=[].keys(),"next"in Cm?(Tm=cw(cw(Cm)),Tm!==Object.prototype&&(Es=Tm)):fw=!0);var nz=!jB(Es)||ZB(function(){var n={};return Es[Im].call(n)!==n});nz?Es={}:ez&&(Es=KB(Es));JB(Es[Im])||QB(Es,Im,function(){return this});hw.exports={IteratorPrototype:Es,BUGGY_SAFARI_ITERATORS:fw}});var Fc=X((Ynt,dw)=>{"use strict";var rz=Wo().f,iz=oo(),oz=Xr(),pw=oz("toStringTag");dw.exports=function(n,t,e){n&&!e&&(n=n.prototype),n&&!iz(n,pw)&&rz(n,pw,{configurable:!0,value:t})}});var mw=X(($nt,gw)=>{"use strict";var sz=Pm().IteratorPrototype,az=Hu(),uz=Ac(),lz=Fc(),cz=Wu(),fz=function(){return this};gw.exports=function(n,t,e,i){var s=t+" Iterator";return n.prototype=az(sz,{next:uz(+!i,e)}),lz(n,s,!1,!0),cz[s]=fz,n}});var Uc=X((Znt,yw)=>{"use strict";var hz=In(),pz=_s();yw.exports=function(n,t,e){try{return hz(pz(Object.getOwnPropertyDescriptor(n,t)[e]))}catch(i){}}});var _w=X((Jnt,vw)=>{"use strict";var dz=Ei();vw.exports=function(n){return dz(n)||n===null}});var Ew=X((jnt,xw)=>{"use strict";var gz=_w(),mz=String,yz=TypeError;xw.exports=function(n){if(gz(n))return n;throw new yz("Can't set "+mz(n)+" as a prototype")}});var Xu=X((Knt,Sw)=>{"use strict";var vz=Uc(),_z=Ei(),xz=zu(),Ez=Ew();Sw.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var n=!1,t={},e;try{e=vz(Object.prototype,"__proto__","set"),e(t,[]),n=t instanceof Array}catch(i){}return function(s,u){return xz(s),Ez(u),_z(s)&&(n?e(s,u):s.__proto__=u),s}}():void 0)});var Nw=X((Qnt,Lw)=>{"use strict";var Sz=sr(),wz=vr(),Th=Rc(),Pw=ph(),Mz=er(),bz=mw(),ww=Dc(),Mw=Xu(),Az=Fc(),Tz=xs(),Rm=Ha(),Cz=Xr(),bw=Wu(),Rw=Pm(),Iz=Pw.PROPER,Pz=Pw.CONFIGURABLE,Aw=Rw.IteratorPrototype,Ch=Rw.BUGGY_SAFARI_ITERATORS,Bc=Cz("iterator"),Tw="keys",zc="values",Cw="entries",Iw=function(){return this};Lw.exports=function(n,t,e,i,s,u,c){bz(e,t,i);var f=function(x){if(x===s&&v)return v;if(!Ch&&x&&x in g)return g[x];switch(x){case Tw:return function(){return new e(this,x)};case zc:return function(){return new e(this,x)};case Cw:return function(){return new e(this,x)}}return function(){return new e(this)}},p=t+" Iterator",d=!1,g=n.prototype,y=g[Bc]||g["@@iterator"]||s&&g[s],v=!Ch&&y||f(s),E=t==="Array"&&g.entries||y,M,A,_;if(E&&(M=ww(E.call(new n)),M!==Object.prototype&&M.next&&(!Th&&ww(M)!==Aw&&(Mw?Mw(M,Aw):Mz(M[Bc])||Rm(M,Bc,Iw)),Az(M,p,!0,!0),Th&&(bw[p]=Iw))),Iz&&s===zc&&y&&y.name!==zc&&(!Th&&Pz?Tz(g,"name",zc):(d=!0,v=function(){return wz(y,this)})),s)if(A={values:f(zc),keys:u?v:f(Tw),entries:f(Cw)},c)for(_ in A)(Ch||d||!(_ in g))&&Rm(g,_,A[_]);else Sz({target:t,proto:!0,forced:Ch||d},A);return(!Th||c)&&g[Bc]!==v&&Rm(g,Bc,v,{name:s}),bw[t]=v,A}});var Dw=X((trt,Ow)=>{"use strict";Ow.exports=function(n,t){return{value:n,done:t}}});var kw=X((ert,Gw)=>{"use strict";var Rz=Gu(),Lm=bm(),Fw=Wu(),Bw=Va(),Lz=Wo().f,Nz=Nw(),Ih=Dw(),Oz=Rc(),Dz=ri(),zw="Array Iterator",Fz=Bw.set,Uz=Bw.getterFor(zw);Gw.exports=Nz(Array,"Array",function(n,t){Fz(this,{type:zw,target:Rz(n),index:0,kind:t})},function(){var n=Uz(this),t=n.target,e=n.index++;if(!t||e>=t.length)return n.target=null,Ih(void 0,!0);switch(n.kind){case"keys":return Ih(e,!1);case"values":return Ih(t[e],!1)}return Ih([e,t[e]],!1)},"values");var Uw=Fw.Arguments=Fw.Array;Lm("keys");Lm("values");Lm("entries");if(!Oz&&Dz&&Uw.name!=="values")try{Lz(Uw,"name",{value:"values"})}catch(n){}});var Yu=X(()=>{"use strict";var qw=Sn(),Hw=kS(),Bz=HS(),Gc=kw(),Vw=xs(),zz=Fc(),Gz=Xr(),Nm=Gz("iterator"),Om=Gc.values,Ww=function(n,t){if(n){if(n[Nm]!==Om)try{Vw(n,Nm,Om)}catch(i){n[Nm]=Om}if(zz(n,t,!0),Hw[t]){for(var e in Gc)if(n[e]!==Gc[e])try{Vw(n,e,Gc[e])}catch(i){n[e]=Gc[e]}}}};for(Ph in Hw)Ww(qw[Ph]&&qw[Ph].prototype,Ph);var Ph;Ww(Bz,"DOMTokenList")});var Rh=X((irt,Xw)=>{"use strict";var kz=vs(),qz=In();Xw.exports=function(n){if(kz(n)==="Function")return qz(n)}});var kc=X((ort,$w)=>{"use strict";var Yw=Rh(),Vz=_s(),Hz=bc(),Wz=Yw(Yw.bind);$w.exports=function(n,t){return Vz(n),t===void 0?n:Hz?Wz(n,t):function(){return n.apply(t,arguments)}}});var jw=X((srt,Jw)=>{"use strict";var Xz=Oc(),Yz=ii(),$z=wh(),Zz=kc(),Zw=function(n,t,e,i,s,u,c,f){for(var p=s,d=0,g=c?Zz(c,f):!1,y,v;d<i;)d in e&&(y=g?g(e[d],d,t):e[d],u>0&&Xz(y)?(v=Yz(y),p=Zw(n,t,y,v,p,u-1)-1):($z(p+1),n[p]=y),p++),d++;return p};Jw.exports=Zw});var tM=X((art,Qw)=>{"use strict";var Jz=Xr(),jz=Jz("toStringTag"),Kw={};Kw[jz]="z";Qw.exports=String(Kw)==="[object z]"});var Zs=X((urt,eM)=>{"use strict";var Kz=tM(),Qz=er(),Lh=vs(),tG=Xr(),eG=tG("toStringTag"),nG=Object,rG=Lh(function(){return arguments}())==="Arguments",iG=function(n,t){try{return n[t]}catch(e){}};eM.exports=Kz?Lh:function(n){var t,e,i;return n===void 0?"Undefined":n===null?"Null":typeof(e=iG(t=nG(n),eG))=="string"?e:rG?Lh(t):(i=Lh(t))==="Object"&&Qz(t.callee)?"Arguments":i}});var Fm=X((lrt,sM)=>{"use strict";var oG=In(),sG=An(),nM=er(),aG=Zs(),uG=$s(),lG=am(),rM=function(){},iM=uG("Reflect","construct"),Dm=/^\\s*(?:class|function)\\b/,cG=oG(Dm.exec),fG=!Dm.test(rM),qc=function(t){if(!nM(t))return!1;try{return iM(rM,[],t),!0}catch(e){return!1}},oM=function(t){if(!nM(t))return!1;switch(aG(t)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return fG||!!cG(Dm,lG(t))}catch(e){return!0}};oM.sham=!0;sM.exports=!iM||sG(function(){var n;return qc(qc.call)||!qc(Object)||!qc(function(){n=!0})||n})?oM:qc});var cM=X((crt,lM)=>{"use strict";var aM=Oc(),hG=Fm(),pG=Ei(),dG=Xr(),gG=dG("species"),uM=Array;lM.exports=function(n){var t;return aM(n)&&(t=n.constructor,hG(t)&&(t===uM||aM(t.prototype))?t=void 0:pG(t)&&(t=t[gG],t===null&&(t=void 0))),t===void 0?uM:t}});var Um=X((frt,fM)=>{"use strict";var mG=cM();fM.exports=function(n,t){return new(mG(n))(t===0?0:t)}});var hM=X(()=>{"use strict";var yG=sr(),vG=jw(),_G=Vi(),xG=ii(),EG=Hi(),SG=Um();yG({target:"Array",proto:!0},{flat:function(){var t=arguments.length?arguments[0]:void 0,e=_G(this),i=xG(e),s=SG(e,0);return s.length=vG(s,e,e,i,0,t===void 0?1:EG(t)),s}})});var pM=X(()=>{"use strict";var wG=bm();wG("flat")});var vM=X((mrt,yM)=>{"use strict";var MG=Xr(),gM=MG("iterator"),mM=!1;try{dM=0,Bm={next:function(){return{done:!!dM++}},return:function(){mM=!0}},Bm[gM]=function(){return this},Array.from(Bm,function(){throw 2})}catch(n){}var dM,Bm;yM.exports=function(n,t){try{if(!t&&!mM)return!1}catch(s){return!1}var e=!1;try{var i={};i[gM]=function(){return{next:function(){return{done:e=!0}}}},n(i)}catch(s){}return e}});var Nh=X((yrt,_M)=>{"use strict";_M.exports=typeof ArrayBuffer!="undefined"&&typeof DataView!="undefined"});var $u=X((vrt,EM)=>{"use strict";var xM=pm(),bG=Wo();EM.exports=function(n,t,e){return e.get&&xM(e.get,t,{getter:!0}),e.set&&xM(e.set,t,{setter:!0}),bG.f(n,t,e)}});var Wi=X((_rt,RM)=>{"use strict";var AG=Nh(),qm=ri(),Si=Sn(),bM=er(),Fh=Ei(),js=oo(),Vm=Zs(),TG=qu(),CG=xs(),zm=Ha(),IG=$u(),PG=Tc(),Uh=Dc(),Ju=Xu(),RG=Xr(),LG=uh(),AM=Va(),TM=AM.enforce,NG=AM.get,Oh=Si.Int8Array,Gm=Oh&&Oh.prototype,SM=Si.Uint8ClampedArray,wM=SM&&SM.prototype,Xo=Oh&&Uh(Oh),bo=Gm&&Uh(Gm),OG=Object.prototype,Hm=Si.TypeError,MM=RG("toStringTag"),km=LG("TYPED_ARRAY_TAG"),Dh="TypedArrayConstructor",Ss=AG&&!!Ju&&Vm(Si.opera)!=="Opera",CM=!1,Li,Js,Zu,ws={Int8Array:1,Uint8Array:1,Uint8ClampedArray:1,Int16Array:2,Uint16Array:2,Int32Array:4,Uint32Array:4,Float32Array:4,Float64Array:8},Wm={BigInt64Array:8,BigUint64Array:8},DG=function(t){if(!Fh(t))return!1;var e=Vm(t);return e==="DataView"||js(ws,e)||js(Wm,e)},IM=function(n){var t=Uh(n);if(Fh(t)){var e=NG(t);return e&&js(e,Dh)?e[Dh]:IM(t)}},PM=function(n){if(!Fh(n))return!1;var t=Vm(n);return js(ws,t)||js(Wm,t)},FG=function(n){if(PM(n))return n;throw new Hm("Target is not a typed array")},UG=function(n){if(bM(n)&&(!Ju||PG(Xo,n)))return n;throw new Hm(TG(n)+" is not a typed array constructor")},BG=function(n,t,e,i){if(qm){if(e)for(var s in ws){var u=Si[s];if(u&&js(u.prototype,n))try{delete u.prototype[n]}catch(c){try{u.prototype[n]=t}catch(f){}}}(!bo[n]||e)&&zm(bo,n,e?t:Ss&&Gm[n]||t,i)}},zG=function(n,t,e){var i,s;if(qm){if(Ju){if(e){for(i in ws)if(s=Si[i],s&&js(s,n))try{delete s[n]}catch(u){}}if(!Xo[n]||e)try{return zm(Xo,n,e?t:Ss&&Xo[n]||t)}catch(u){}else return}for(i in ws)s=Si[i],s&&(!s[n]||e)&&zm(s,n,t)}};for(Li in ws)Js=Si[Li],Zu=Js&&Js.prototype,Zu?TM(Zu)[Dh]=Js:Ss=!1;for(Li in Wm)Js=Si[Li],Zu=Js&&Js.prototype,Zu&&(TM(Zu)[Dh]=Js);if((!Ss||!bM(Xo)||Xo===Function.prototype)&&(Xo=function(){throw new Hm("Incorrect invocation")},Ss))for(Li in ws)Si[Li]&&Ju(Si[Li],Xo);if((!Ss||!bo||bo===OG)&&(bo=Xo.prototype,Ss))for(Li in ws)Si[Li]&&Ju(Si[Li].prototype,bo);Ss&&Uh(wM)!==bo&&Ju(wM,bo);if(qm&&!js(bo,MM)){CM=!0,IG(bo,MM,{configurable:!0,get:function(){return Fh(this)?this[km]:void 0}});for(Li in ws)Si[Li]&&CG(Si[Li],km,Li)}RM.exports={NATIVE_ARRAY_BUFFER_VIEWS:Ss,TYPED_ARRAY_TAG:CM&&km,aTypedArray:FG,aTypedArrayConstructor:UG,exportTypedArrayMethod:BG,exportTypedArrayStaticMethod:zG,getTypedArrayConstructor:IM,isView:DG,isTypedArray:PM,TypedArray:Xo,TypedArrayPrototype:bo}});var OM=X((xrt,NM)=>{"use strict";var LM=Sn(),Xm=An(),GG=vM(),kG=Wi().NATIVE_ARRAY_BUFFER_VIEWS,qG=LM.ArrayBuffer,Xa=LM.Int8Array;NM.exports=!kG||!Xm(function(){Xa(1)})||!Xm(function(){new Xa(-1)})||!GG(function(n){new Xa,new Xa(null),new Xa(1.5),new Xa(n)},!0)||Xm(function(){return new Xa(new qG(2),1,void 0).length!==1})});var FM=X((Ert,DM)=>{"use strict";var VG=Ha();DM.exports=function(n,t,e){for(var i in t)VG(n,i,t[i],e);return n}});var Ym=X((Srt,UM)=>{"use strict";var HG=Tc(),WG=TypeError;UM.exports=function(n,t){if(HG(t,n))return n;throw new WG("Incorrect invocation")}});var Bh=X((wrt,BM)=>{"use strict";var XG=Hi(),YG=Wa(),$G=RangeError;BM.exports=function(n){if(n===void 0)return 0;var t=XG(n),e=YG(t);if(t!==e)throw new $G("Wrong length or index");return e}});var GM=X((Mrt,zM)=>{"use strict";zM.exports=Math.sign||function(t){var e=+t;return e===0||e!==e?e:e<0?-1:1}});var VM=X((brt,qM)=>{"use strict";var ZG=2220446049250313e-31,kM=1/ZG;qM.exports=function(n){return n+kM-kM}});var WM=X((Art,HM)=>{"use strict";var JG=GM(),jG=VM(),KG=Math.abs,QG=2220446049250313e-31;HM.exports=function(n,t,e,i){var s=+n,u=KG(s),c=JG(s);if(u<i)return c*jG(u/i/t)*i*t;var f=(1+t/QG)*u,p=f-(f-u);return p>e||p!==p?c*(1/0):c*p}});var YM=X((Trt,XM)=>{"use strict";var t4=WM(),e4=11920928955078125e-23,n4=34028234663852886e22,r4=11754943508222875e-54;XM.exports=Math.fround||function(t){return t4(t,e4,n4,r4)}});var ZM=X((Crt,$M)=>{"use strict";var i4=Array,o4=Math.abs,Ms=Math.pow,s4=Math.floor,a4=Math.log,u4=Math.LN2,l4=function(n,t,e){var i=i4(e),s=e*8-t-1,u=(1<<s)-1,c=u>>1,f=t===23?Ms(2,-24)-Ms(2,-77):0,p=n<0||n===0&&1/n<0?1:0,d=0,g,y,v;for(n=o4(n),n!==n||n===1/0?(y=n!==n?1:0,g=u):(g=s4(a4(n)/u4),v=Ms(2,-g),n*v<1&&(g--,v*=2),g+c>=1?n+=f/v:n+=f*Ms(2,1-c),n*v>=2&&(g++,v/=2),g+c>=u?(y=0,g=u):g+c>=1?(y=(n*v-1)*Ms(2,t),g+=c):(y=n*Ms(2,c-1)*Ms(2,t),g=0));t>=8;)i[d++]=y&255,y/=256,t-=8;for(g=g<<t|y,s+=t;s>0;)i[d++]=g&255,g/=256,s-=8;return i[d-1]|=p*128,i},c4=function(n,t){var e=n.length,i=e*8-t-1,s=(1<<i)-1,u=s>>1,c=i-7,f=e-1,p=n[f--],d=p&127,g;for(p>>=7;c>0;)d=d*256+n[f--],c-=8;for(g=d&(1<<-c)-1,d>>=-c,c+=t;c>0;)g=g*256+n[f--],c-=8;if(d===0)d=1-u;else{if(d===s)return g?NaN:p?-1/0:1/0;g+=Ms(2,t),d-=u}return(p?-1:1)*g*Ms(2,d-t)};$M.exports={pack:l4,unpack:c4}});var $m=X((Irt,jM)=>{"use strict";var f4=Vi(),JM=xh(),h4=ii();jM.exports=function(t){for(var e=f4(this),i=h4(e),s=arguments.length,u=JM(s>1?arguments[1]:void 0,i),c=s>2?arguments[2]:void 0,f=c===void 0?i:JM(c,i);f>u;)e[u++]=t;return e}});var zh=X((Prt,KM)=>{"use strict";var p4=In();KM.exports=p4([].slice)});var Zm=X((Rrt,tb)=>{"use strict";var d4=er(),g4=Ei(),QM=Xu();tb.exports=function(n,t,e){var i,s;return QM&&d4(i=t.constructor)&&i!==e&&g4(s=i.prototype)&&s!==e.prototype&&QM(n,s),n}});var Xh=X((Lrt,yb)=>{"use strict";var Hh=Sn(),t0=In(),Jm=ri(),m4=Nh(),hb=ph(),y4=xs(),v4=$u(),eb=FM(),jm=An(),Gh=Ym(),_4=Hi(),x4=Wa(),qh=Bh(),E4=YM(),pb=ZM(),S4=Dc(),nb=Xu(),w4=$m(),M4=zh(),b4=Zm(),A4=ym(),db=Fc(),e0=Va(),T4=hb.PROPER,rb=hb.CONFIGURABLE,Ku="ArrayBuffer",Wh="DataView",Qu="prototype",C4="Wrong length",gb="Wrong index",ib=e0.getterFor(Ku),Hc=e0.getterFor(Wh),ob=e0.set,Ao=Hh[Ku],Xi=Ao,ju=Xi&&Xi[Qu],Yo=Hh[Wh],Ya=Yo&&Yo[Qu],sb=Object.prototype,I4=Hh.Array,Vh=Hh.RangeError,P4=t0(w4),R4=t0([].reverse),mb=pb.pack,ab=pb.unpack,ub=function(n){return[n&255]},lb=function(n){return[n&255,n>>8&255]},cb=function(n){return[n&255,n>>8&255,n>>16&255,n>>24&255]},fb=function(n){return n[3]<<24|n[2]<<16|n[1]<<8|n[0]},L4=function(n){return mb(E4(n),23,4)},N4=function(n){return mb(n,52,8)},kh=function(n,t,e){v4(n[Qu],t,{configurable:!0,get:function(){return e(this)[t]}})},Ks=function(n,t,e,i){var s=Hc(n),u=qh(e),c=!!i;if(u+t>s.byteLength)throw new Vh(gb);var f=s.bytes,p=u+s.byteOffset,d=M4(f,p,p+t);return c?d:R4(d)},Qs=function(n,t,e,i,s,u){var c=Hc(n),f=qh(e),p=i(+s),d=!!u;if(f+t>c.byteLength)throw new Vh(gb);for(var g=c.bytes,y=f+c.byteOffset,v=0;v<t;v++)g[y+v]=p[d?v:t-v-1]};m4?(Km=T4&&Ao.name!==Ku,!jm(function(){Ao(1)})||!jm(function(){new Ao(-1)})||jm(function(){return new Ao,new Ao(1.5),new Ao(NaN),Ao.length!==1||Km&&!rb})?(Xi=function(t){return Gh(this,ju),b4(new Ao(qh(t)),this,Xi)},Xi[Qu]=ju,ju.constructor=Xi,A4(Xi,Ao)):Km&&rb&&y4(Ao,"name",Ku),nb&&S4(Ya)!==sb&&nb(Ya,sb),Vc=new Yo(new Xi(2)),Qm=t0(Ya.setInt8),Vc.setInt8(0,2147483648),Vc.setInt8(1,2147483649),(Vc.getInt8(0)||!Vc.getInt8(1))&&eb(Ya,{setInt8:function(t,e){Qm(this,t,e<<24>>24)},setUint8:function(t,e){Qm(this,t,e<<24>>24)}},{unsafe:!0})):(Xi=function(t){Gh(this,ju);var e=qh(t);ob(this,{type:Ku,bytes:P4(I4(e),0),byteLength:e}),Jm||(this.byteLength=e,this.detached=!1)},ju=Xi[Qu],Yo=function(t,e,i){Gh(this,Ya),Gh(t,ju);var s=ib(t),u=s.byteLength,c=_4(e);if(c<0||c>u)throw new Vh("Wrong offset");if(i=i===void 0?u-c:x4(i),c+i>u)throw new Vh(C4);ob(this,{type:Wh,buffer:t,byteLength:i,byteOffset:c,bytes:s.bytes}),Jm||(this.buffer=t,this.byteLength=i,this.byteOffset=c)},Ya=Yo[Qu],Jm&&(kh(Xi,"byteLength",ib),kh(Yo,"buffer",Hc),kh(Yo,"byteLength",Hc),kh(Yo,"byteOffset",Hc)),eb(Ya,{getInt8:function(t){return Ks(this,1,t)[0]<<24>>24},getUint8:function(t){return Ks(this,1,t)[0]},getInt16:function(t){var e=Ks(this,2,t,arguments.length>1?arguments[1]:!1);return(e[1]<<8|e[0])<<16>>16},getUint16:function(t){var e=Ks(this,2,t,arguments.length>1?arguments[1]:!1);return e[1]<<8|e[0]},getInt32:function(t){return fb(Ks(this,4,t,arguments.length>1?arguments[1]:!1))},getUint32:function(t){return fb(Ks(this,4,t,arguments.length>1?arguments[1]:!1))>>>0},getFloat32:function(t){return ab(Ks(this,4,t,arguments.length>1?arguments[1]:!1),23)},getFloat64:function(t){return ab(Ks(this,8,t,arguments.length>1?arguments[1]:!1),52)},setInt8:function(t,e){Qs(this,1,t,ub,e)},setUint8:function(t,e){Qs(this,1,t,ub,e)},setInt16:function(t,e){Qs(this,2,t,lb,e,arguments.length>2?arguments[2]:!1)},setUint16:function(t,e){Qs(this,2,t,lb,e,arguments.length>2?arguments[2]:!1)},setInt32:function(t,e){Qs(this,4,t,cb,e,arguments.length>2?arguments[2]:!1)},setUint32:function(t,e){Qs(this,4,t,cb,e,arguments.length>2?arguments[2]:!1)},setFloat32:function(t,e){Qs(this,4,t,L4,e,arguments.length>2?arguments[2]:!1)},setFloat64:function(t,e){Qs(this,8,t,N4,e,arguments.length>2?arguments[2]:!1)}}));var Km,Vc,Qm;db(Xi,Ku);db(Yo,Wh);yb.exports={ArrayBuffer:Xi,DataView:Yo}});var _b=X((Nrt,vb)=>{"use strict";var O4=Ei(),D4=Math.floor;vb.exports=Number.isInteger||function(t){return!O4(t)&&isFinite(t)&&D4(t)===t}});var Eb=X((Ort,xb)=>{"use strict";var F4=Hi(),U4=RangeError;xb.exports=function(n){var t=F4(n);if(t<0)throw new U4("The argument can't be less than 0");return t}});var n0=X((Drt,Sb)=>{"use strict";var B4=Eb(),z4=RangeError;Sb.exports=function(n,t){var e=B4(n);if(e%t)throw new z4("Wrong offset");return e}});var Mb=X((Frt,wb)=>{"use strict";var G4=Math.round;wb.exports=function(n){var t=G4(n);return t<0?0:t>255?255:t&255}});var Ab=X((Urt,bb)=>{"use strict";var k4=Fm(),q4=qu(),V4=TypeError;bb.exports=function(n){if(k4(n))return n;throw new V4(q4(n)+" is not a constructor")}});var r0=X((Brt,Cb)=>{"use strict";var H4=Zs(),Tb=Pc(),W4=nh(),X4=Wu(),Y4=Xr(),$4=Y4("iterator");Cb.exports=function(n){if(!W4(n))return Tb(n,$4)||Tb(n,"@@iterator")||X4[H4(n)]}});var Pb=X((zrt,Ib)=>{"use strict";var Z4=vr(),J4=_s(),j4=so(),K4=qu(),Q4=r0(),tk=TypeError;Ib.exports=function(n,t){var e=arguments.length<2?Q4(n):t;if(J4(e))return j4(Z4(e,n));throw new tk(K4(n)+" is not iterable")}});var Lb=X((Grt,Rb)=>{"use strict";var ek=Xr(),nk=Wu(),rk=ek("iterator"),ik=Array.prototype;Rb.exports=function(n){return n!==void 0&&(nk.Array===n||ik[rk]===n)}});var i0=X((krt,Nb)=>{"use strict";var ok=Zs();Nb.exports=function(n){var t=ok(n);return t==="BigInt64Array"||t==="BigUint64Array"}});var Yh=X((qrt,Ob)=>{"use strict";var sk=Jg(),ak=TypeError;Ob.exports=function(n){var t=sk(n,"number");if(typeof t=="number")throw new ak("Can't convert number to bigint");return BigInt(t)}});var Fb=X((Vrt,Db)=>{"use strict";var uk=kc(),lk=vr(),ck=Ab(),fk=Vi(),hk=ii(),pk=Pb(),dk=r0(),gk=Lb(),mk=i0(),yk=Wi().aTypedArrayConstructor,vk=Yh();Db.exports=function(t){var e=ck(this),i=fk(t),s=arguments.length,u=s>1?arguments[1]:void 0,c=u!==void 0,f=dk(i),p,d,g,y,v,E,M,A;if(f&&!gk(f))for(M=pk(i,f),A=M.next,i=[];!(E=lk(A,M)).done;)i.push(E.value);for(c&&s>2&&(u=uk(u,arguments[2])),d=hk(i),g=new(yk(e))(d),y=mk(g),p=0;d>p;p++)v=c?u(i[p],p):i[p],g[p]=y?vk(v):+v;return g}});var zb=X((Hrt,Bb)=>{"use strict";var _k=kc(),xk=In(),Ek=eh(),Sk=Vi(),wk=ii(),Mk=Um(),Ub=xk([].push),ta=function(n){var t=n===1,e=n===2,i=n===3,s=n===4,u=n===6,c=n===7,f=n===5||u;return function(p,d,g,y){for(var v=Sk(p),E=Ek(v),M=wk(E),A=_k(d,g),_=0,x=y||Mk,T=t?x(p,M):e||c?x(p,0):void 0,w,R;M>_;_++)if((f||_ in E)&&(w=E[_],R=A(w,_,v),n))if(t)T[_]=R;else if(R)switch(n){case 3:return!0;case 5:return w;case 6:return _;case 2:Ub(T,w)}else switch(n){case 4:return!1;case 7:Ub(T,w)}return u?-1:i||s?s:T}};Bb.exports={forEach:ta(0),map:ta(1),filter:ta(2),some:ta(3),every:ta(4),find:ta(5),findIndex:ta(6),filterReject:ta(7)}});var o0=X((Wrt,kb)=>{"use strict";var bk=$s(),Ak=$u(),Tk=Xr(),Ck=ri(),Gb=Tk("species");kb.exports=function(n){var t=bk(n);Ck&&t&&!t[Gb]&&Ak(t,Gb,{configurable:!0,get:function(){return this}})}});var s0=X((Xrt,qb)=>{"use strict";var Ik=ii();qb.exports=function(n,t,e){for(var i=0,s=arguments.length>2?e:Ik(t),u=new n(s);s>i;)u[i]=t[i++];return u}});var uA=X((Yrt,p0)=>{"use strict";var Vb=sr(),tA=Sn(),Hb=vr(),Pk=ri(),Rk=OM(),$c=Wi(),eA=Xh(),Wb=Ym(),Lk=Ac(),Wc=xs(),Nk=_b(),Ok=Wa(),Xb=Bh(),a0=n0(),Dk=Mb(),nA=lh(),Xc=oo(),Fk=Zs(),c0=Ei(),Uk=Ic(),Bk=Hu(),zk=Tc(),$h=Xu(),Gk=mm().f,Yb=Fb(),kk=zb().forEach,qk=o0(),Vk=$u(),rA=Wo(),iA=fh(),$b=s0(),d0=Va(),Hk=Zm(),f0=d0.get,Wk=d0.set,Xk=d0.enforce,oA=rA.f,Yk=iA.f,u0=tA.RangeError,sA=eA.ArrayBuffer,$k=sA.prototype,Zk=eA.DataView,Zh=$c.NATIVE_ARRAY_BUFFER_VIEWS,Zb=$c.TYPED_ARRAY_TAG,Jb=$c.TypedArray,Yc=$c.TypedArrayPrototype,h0=$c.isTypedArray,Jh="BYTES_PER_ELEMENT",l0="Wrong length",jh=function(n,t){Vk(n,t,{configurable:!0,get:function(){return f0(this)[t]}})},jb=function(n){var t;return zk($k,n)||(t=Fk(n))==="ArrayBuffer"||t==="SharedArrayBuffer"},aA=function(n,t){return h0(n)&&!Uk(t)&&t in n&&Nk(+t)&&t>=0},Kb=function(t,e){return e=nA(e),aA(t,e)?Lk(2,t[e]):Yk(t,e)},Qb=function(t,e,i){return e=nA(e),aA(t,e)&&c0(i)&&Xc(i,"value")&&!Xc(i,"get")&&!Xc(i,"set")&&!i.configurable&&(!Xc(i,"writable")||i.writable)&&(!Xc(i,"enumerable")||i.enumerable)?(t[e]=i.value,t):oA(t,e,i)};Pk?(Zh||(iA.f=Kb,rA.f=Qb,jh(Yc,"buffer"),jh(Yc,"byteOffset"),jh(Yc,"byteLength"),jh(Yc,"length")),Vb({target:"Object",stat:!0,forced:!Zh},{getOwnPropertyDescriptor:Kb,defineProperty:Qb}),p0.exports=function(n,t,e){var i=n.match(/\\d+/)[0]/8,s=n+(e?"Clamped":"")+"Array",u="get"+n,c="set"+n,f=tA[s],p=f,d=p&&p.prototype,g={},y=function(A,_){var x=f0(A);return x.view[u](_*i+x.byteOffset,!0)},v=function(A,_,x){var T=f0(A);T.view[c](_*i+T.byteOffset,e?Dk(x):x,!0)},E=function(A,_){oA(A,_,{get:function(){return y(this,_)},set:function(x){return v(this,_,x)},enumerable:!0})};Zh?Rk&&(p=t(function(A,_,x,T){return Wb(A,d),Hk(function(){return c0(_)?jb(_)?T!==void 0?new f(_,a0(x,i),T):x!==void 0?new f(_,a0(x,i)):new f(_):h0(_)?$b(p,_):Hb(Yb,p,_):new f(Xb(_))}(),A,p)}),$h&&$h(p,Jb),kk(Gk(f),function(A){A in p||Wc(p,A,f[A])}),p.prototype=d):(p=t(function(A,_,x,T){Wb(A,d);var w=0,R=0,z,U,D;if(!c0(_))D=Xb(_),U=D*i,z=new sA(U);else if(jb(_)){z=_,R=a0(x,i);var P=_.byteLength;if(T===void 0){if(P%i)throw new u0(l0);if(U=P-R,U<0)throw new u0(l0)}else if(U=Ok(T)*i,U+R>P)throw new u0(l0);D=U/i}else return h0(_)?$b(p,_):Hb(Yb,p,_);for(Wk(A,{buffer:z,byteOffset:R,byteLength:U,length:D,view:new Zk(z)});w<D;)E(A,w++)}),$h&&$h(p,Jb),d=p.prototype=Bk(Yc)),d.constructor!==p&&Wc(d,"constructor",p),Xk(d).TypedArrayConstructor=p,Zb&&Wc(d,Zb,s);var M=p!==f;g[s]=p,Vb({global:!0,constructor:!0,forced:M,sham:!Zh},g),Jh in p||Wc(p,Jh,i),Jh in d||Wc(d,Jh,i),qk(s)}):p0.exports=function(){}});var g0=X(()=>{"use strict";var Jk=uA();Jk("Float32",function(n){return function(e,i,s){return n(this,e,i,s)}})});var m0=X(()=>{"use strict";var lA=Wi(),jk=ii(),Kk=Hi(),Qk=lA.aTypedArray,tq=lA.exportTypedArrayMethod;tq("at",function(t){var e=Qk(this),i=jk(e),s=Kk(t),u=s>=0?s:i+s;return u<0||u>=i?void 0:e[u]})});var y0=X(()=>{"use strict";var cA=Wi(),eq=$m(),nq=Yh(),rq=Zs(),iq=vr(),oq=In(),sq=An(),aq=cA.aTypedArray,uq=cA.exportTypedArrayMethod,lq=oq("".slice),cq=sq(function(){var n=0;return new Int8Array(2).fill({valueOf:function(){return n++}}),n!==1});uq("fill",function(t){var e=arguments.length;aq(this);var i=lq(rq(this),0,3)==="Big"?nq(t):+t;return iq(eq,this,i,e>1?arguments[1]:void 0,e>2?arguments[2]:void 0)},cq)});var v0=X((tit,hA)=>{"use strict";var fq=kc(),hq=eh(),pq=Vi(),dq=ii(),fA=function(n){var t=n===1;return function(e,i,s){for(var u=pq(e),c=hq(u),f=dq(c),p=fq(i,s),d,g;f-- >0;)if(d=c[f],g=p(d,f,u),g)switch(n){case 0:return d;case 1:return f}return t?-1:void 0}};hA.exports={findLast:fA(0),findLastIndex:fA(1)}});var _0=X(()=>{"use strict";var pA=Wi(),gq=v0().findLast,mq=pA.aTypedArray,yq=pA.exportTypedArrayMethod;yq("findLast",function(t){return gq(mq(this),t,arguments.length>1?arguments[1]:void 0)})});var x0=X(()=>{"use strict";var dA=Wi(),vq=v0().findLastIndex,_q=dA.aTypedArray,xq=dA.exportTypedArrayMethod;xq("findLastIndex",function(t){return vq(_q(this),t,arguments.length>1?arguments[1]:void 0)})});var M0=X(()=>{"use strict";var mA=Sn(),yA=vr(),w0=Wi(),Eq=ii(),Sq=n0(),wq=Vi(),vA=An(),Mq=mA.RangeError,E0=mA.Int8Array,gA=E0&&E0.prototype,_A=gA&&gA.set,bq=w0.aTypedArray,Aq=w0.exportTypedArrayMethod,S0=!vA(function(){var n=new Uint8ClampedArray(2);return yA(_A,n,{length:1,0:3},1),n[1]!==3}),Tq=S0&&w0.NATIVE_ARRAY_BUFFER_VIEWS&&vA(function(){var n=new E0(2);return n.set(1),n.set("2",1),n[0]!==0||n[1]!==2});Aq("set",function(t){bq(this);var e=Sq(arguments.length>1?arguments[1]:void 0,1),i=wq(t);if(S0)return yA(_A,this,i,e);var s=this.length,u=Eq(i),c=0;if(u+e>s)throw new Mq("Wrong length");for(;c<u;)this[e+c]=i[c++]},!S0||Tq)});var A0=X((ait,EA)=>{"use strict";var xA=zh(),Cq=Math.floor,b0=function(n,t){var e=n.length;if(e<8)for(var i=1,s,u;i<e;){for(u=i,s=n[i];u&&t(n[u-1],s)>0;)n[u]=n[--u];u!==i++&&(n[u]=s)}else for(var c=Cq(e/2),f=b0(xA(n,0,c),t),p=b0(xA(n,c),t),d=f.length,g=p.length,y=0,v=0;y<d||v<g;)n[y+v]=y<d&&v<g?t(f[y],p[v])<=0?f[y++]:p[v++]:y<d?f[y++]:p[v++];return n};EA.exports=b0});var T0=X((uit,wA)=>{"use strict";var Iq=ku(),SA=Iq.match(/firefox\\/(\\d+)/i);wA.exports=!!SA&&+SA[1]});var C0=X((lit,MA)=>{"use strict";var Pq=ku();MA.exports=/MSIE|Trident/.test(Pq)});var I0=X((cit,AA)=>{"use strict";var Rq=ku(),bA=Rq.match(/AppleWebKit\\/(\\d+)\\./);AA.exports=!!bA&&+bA[1]});var R0=X(()=>{"use strict";var Lq=Sn(),Nq=Rh(),P0=An(),Oq=_s(),Dq=A0(),RA=Wi(),TA=T0(),Fq=C0(),CA=Cc(),IA=I0(),Uq=RA.aTypedArray,Bq=RA.exportTypedArrayMethod,Zc=Lq.Uint16Array,tl=Zc&&Nq(Zc.prototype.sort),zq=!!tl&&!(P0(function(){tl(new Zc(2),null)})&&P0(function(){tl(new Zc(2),{})})),PA=!!tl&&!P0(function(){if(CA)return CA<74;if(TA)return TA<67;if(Fq)return!0;if(IA)return IA<602;var n=new Zc(516),t=Array(516),e,i;for(e=0;e<516;e++)i=e%4,n[e]=515-e,t[e]=e-2*i+3;for(tl(n,function(s,u){return(s/4|0)-(u/4|0)}),e=0;e<516;e++)if(n[e]!==t[e])return!0}),Gq=function(n){return function(t,e){return n!==void 0?+n(t,e)||0:e!==e?-1:t!==t?1:t===0&&e===0?1/t>0&&1/e<0?1:-1:t>e}};Bq("sort",function(t){return t!==void 0&&Oq(t),PA?tl(this,t):Dq(Uq(this),Gq(t))},!PA||zq)});var NA=X((pit,LA)=>{"use strict";var kq=ii();LA.exports=function(n,t){for(var e=kq(n),i=new t(e),s=0;s<e;s++)i[s]=n[e-s-1];return i}});var N0=X(()=>{"use strict";var qq=NA(),L0=Wi(),Vq=L0.aTypedArray,Hq=L0.exportTypedArrayMethod,Wq=L0.getTypedArrayConstructor;Hq("toReversed",function(){return qq(Vq(this),Wq(this))})});var O0=X(()=>{"use strict";var Kh=Wi(),Xq=In(),Yq=_s(),$q=s0(),Zq=Kh.aTypedArray,Jq=Kh.getTypedArrayConstructor,jq=Kh.exportTypedArrayMethod,Kq=Xq(Kh.TypedArrayPrototype.sort);jq("toSorted",function(t){t!==void 0&&Yq(t);var e=Zq(this),i=$q(Jq(e),e);return Kq(i,t)})});var DA=X((vit,OA)=>{"use strict";var Qq=ii(),t5=Hi(),e5=RangeError;OA.exports=function(n,t,e,i){var s=Qq(n),u=t5(e),c=u<0?s+u:u;if(c>=s||c<0)throw new e5("Incorrect index");for(var f=new t(s),p=0;p<s;p++)f[p]=p===c?i:n[p];return f}});var F0=X(()=>{"use strict";var n5=DA(),D0=Wi(),r5=i0(),i5=Hi(),o5=Yh(),s5=D0.aTypedArray,a5=D0.getTypedArrayConstructor,u5=D0.exportTypedArrayMethod,l5=!!function(){try{new Int8Array(1).with(2,{valueOf:function(){throw 8}})}catch(n){return n===8}}();u5("with",function(n,t){var e=s5(this),i=i5(n),s=r5(e)?o5(t):+t;return n5(e,a5(e),i,s)},!l5)});var B0=X(()=>{"use strict";var c5=sr(),f5=Sn(),h5=Xh(),p5=o0(),U0="ArrayBuffer",FA=h5[U0],d5=f5[U0];c5({global:!0,constructor:!0,forced:d5!==FA},{ArrayBuffer:FA});p5(U0)});var q0=X(()=>{"use strict";var g5=sr(),G0=Rh(),m5=An(),GA=Xh(),UA=so(),BA=xh(),y5=Wa(),k0=GA.ArrayBuffer,z0=GA.DataView,kA=z0.prototype,zA=G0(k0.prototype.slice),v5=G0(kA.getUint8),_5=G0(kA.setUint8),x5=m5(function(){return!new k0(2).slice(1,void 0).byteLength});g5({target:"ArrayBuffer",proto:!0,unsafe:!0,forced:x5},{slice:function(t,e){if(zA&&e===void 0)return zA(UA(this),t);for(var i=UA(this).byteLength,s=BA(t,i),u=BA(e===void 0?i:e,i),c=new k0(y5(u-s)),f=new z0(this),p=new z0(c),d=0;s<u;)_5(p,d++,v5(f,s++));return c}})});var V0=X((bit,HA)=>{"use strict";var VA=Sn(),E5=Uc(),S5=vs(),qA=VA.ArrayBuffer,w5=VA.TypeError;HA.exports=qA&&E5(qA.prototype,"byteLength","get")||function(n){if(S5(n)!=="ArrayBuffer")throw new w5("ArrayBuffer expected");return n.byteLength}});var H0=X((Ait,WA)=>{"use strict";var M5=Sn(),b5=Nh(),A5=V0(),T5=M5.DataView;WA.exports=function(n){if(!b5||A5(n)!==0)return!1;try{return new T5(n),!1}catch(t){return!0}}});var W0=X(()=>{"use strict";var C5=ri(),I5=$u(),P5=H0(),XA=ArrayBuffer.prototype;C5&&!("detached"in XA)&&I5(XA,"detached",{configurable:!0,get:function(){return P5(this)}})});var $A=X((Iit,YA)=>{"use strict";var R5=H0(),L5=TypeError;YA.exports=function(n){if(R5(n))throw new L5("ArrayBuffer is detached");return n}});var X0=X((Pit,ZA)=>{"use strict";var Jc=Sn(),N5=ku(),O5=vs(),Qh=function(n){return N5.slice(0,n.length)===n};ZA.exports=function(){return Qh("Bun/")?"BUN":Qh("Cloudflare-Workers")?"CLOUDFLARE":Qh("Deno/")?"DENO":Qh("Node.js/")?"NODE":Jc.Bun&&typeof Bun.version=="string"?"BUN":Jc.Deno&&typeof Deno.version=="object"?"DENO":O5(Jc.process)==="process"?"NODE":Jc.window&&Jc.document?"BROWSER":"REST"}()});var jA=X((Rit,JA)=>{"use strict";var D5=X0();JA.exports=D5==="NODE"});var QA=X((Lit,KA)=>{"use strict";var F5=Sn(),U5=jA();KA.exports=function(n){if(U5){try{return F5.process.getBuiltinModule(n)}catch(t){}try{return Function('return require("'+n+'")')()}catch(t){}}}});var Z0=X((Nit,eT)=>{"use strict";var B5=Sn(),z5=An(),Y0=Cc(),$0=X0(),tT=B5.structuredClone;eT.exports=!!tT&&!z5(function(){if($0==="DENO"&&Y0>92||$0==="NODE"&&Y0>94||$0==="BROWSER"&&Y0>97)return!1;var n=new ArrayBuffer(8),t=tT(n,{transfer:[n]});return n.byteLength!==0||t.byteLength!==8})});var oT=X((Oit,iT)=>{"use strict";var Q0=Sn(),G5=QA(),k5=Z0(),q5=Q0.structuredClone,nT=Q0.ArrayBuffer,tp=Q0.MessageChannel,K0=!1,J0,rT,ep,j0;if(k5)K0=function(n){q5(n,{transfer:[n]})};else if(nT)try{tp||(J0=G5("worker_threads"),J0&&(tp=J0.MessageChannel)),tp&&(rT=new tp,ep=new nT(2),j0=function(n){rT.port1.postMessage(null,[n])},ep.byteLength===2&&(j0(ep),ep.byteLength===0&&(K0=j0)))}catch(n){}iT.exports=K0});var oy=X((Dit,hT)=>{"use strict";var ny=Sn(),ry=In(),lT=Uc(),V5=Bh(),H5=$A(),W5=V0(),sT=oT(),ty=Z0(),X5=ny.structuredClone,cT=ny.ArrayBuffer,ey=ny.DataView,Y5=Math.min,iy=cT.prototype,fT=ey.prototype,$5=ry(iy.slice),aT=lT(iy,"resizable","get"),uT=lT(iy,"maxByteLength","get"),Z5=ry(fT.getInt8),J5=ry(fT.setInt8);hT.exports=(ty||sT)&&function(n,t,e){var i=W5(n),s=t===void 0?i:V5(t),u=!aT||!aT(n),c;if(H5(n),ty&&(n=X5(n,{transfer:[n]}),i===s&&(e||u)))return n;if(i>=s&&(!e||u))c=$5(n,0,s);else{var f=e&&!u&&uT?{maxByteLength:uT(n)}:void 0;c=new cT(s,f);for(var p=new ey(n),d=new ey(c),g=Y5(s,i),y=0;y<g;y++)J5(d,y,Z5(p,y))}return ty||sT(n),c}});var sy=X(()=>{"use strict";var j5=sr(),pT=oy();pT&&j5({target:"ArrayBuffer",proto:!0},{transfer:function(){return pT(this,arguments.length?arguments[0]:void 0,!0)}})});var ay=X(()=>{"use strict";var K5=sr(),dT=oy();dT&&K5({target:"ArrayBuffer",proto:!0},{transferToFixedLength:function(){return dT(this,arguments.length?arguments[0]:void 0,!1)}})});var To=X((Git,gT)=>{"use strict";var uy=In(),np=Set.prototype;gT.exports={Set,add:uy(np.add),has:uy(np.has),remove:uy(np.delete),proto:np}});var ea=X((kit,mT)=>{"use strict";var Q5=To().has;mT.exports=function(n){return Q5(n),n}});var na=X((qit,yT)=>{"use strict";var tV=vr();yT.exports=function(n,t,e){for(var i=e?n:n.iterator,s=n.next,u,c;!(u=tV(s,i)).done;)if(c=t(u.value),c!==void 0)return c}});var el=X((Vit,ST)=>{"use strict";var vT=In(),eV=na(),_T=To(),nV=_T.Set,xT=_T.proto,rV=vT(xT.forEach),ET=vT(xT.keys),iV=ET(new nV).next;ST.exports=function(n,t,e){return e?eV({iterator:ET(n),next:iV},t):rV(n,t)}});var rp=X((Hit,MT)=>{"use strict";var wT=To(),oV=el(),sV=wT.Set,aV=wT.add;MT.exports=function(n){var t=new sV;return oV(n,function(e){aV(t,e)}),t}});var nl=X((Wit,bT)=>{"use strict";var uV=Uc(),lV=To();bT.exports=uV(lV.proto,"size","get")||function(n){return n.size}});var TT=X((Xit,AT)=>{"use strict";AT.exports=function(n){return{iterator:n,next:n.next,done:!1}}});var ra=X((Yit,NT)=>{"use strict";var CT=_s(),RT=so(),IT=vr(),cV=Hi(),fV=TT(),PT="Invalid size",hV=RangeError,pV=TypeError,dV=Math.max,LT=function(n,t){this.set=n,this.size=dV(t,0),this.has=CT(n.has),this.keys=CT(n.keys)};LT.prototype={getIterator:function(){return fV(RT(IT(this.keys,this.set)))},includes:function(n){return IT(this.has,this.set,n)}};NT.exports=function(n){RT(n);var t=+n.size;if(t!==t)throw new pV(PT);var e=cV(t);if(e<0)throw new hV(PT);return new LT(n,e)}});var UT=X(($it,FT)=>{"use strict";var gV=ea(),DT=To(),mV=rp(),yV=nl(),vV=ra(),_V=el(),xV=na(),EV=DT.has,OT=DT.remove;FT.exports=function(t){var e=gV(this),i=vV(t),s=mV(e);return yV(e)<=i.size?_V(e,function(u){i.includes(u)&&OT(s,u)}):xV(i.getIterator(),function(u){EV(e,u)&&OT(s,u)}),s}});var ia=X((Zit,GT)=>{"use strict";var SV=$s(),BT=function(n){return{size:n,has:function(){return!1},keys:function(){return{next:function(){return{done:!0}}}}}},zT=function(n){return{size:n,has:function(){return!0},keys:function(){throw new Error("e")}}};GT.exports=function(n,t){var e=SV("Set");try{new e()[n](BT(0));try{return new e()[n](BT(-1)),!1}catch(s){if(!t)return!0;try{return new e()[n](zT(-1/0)),!1}catch(u){var i=new e;return i.add(1),i.add(2),t(i[n](zT(1/0)))}}}catch(s){return!1}}});var kT=X(()=>{"use strict";var wV=sr(),MV=UT(),bV=ia(),AV=!bV("difference",function(n){return n.size===0});wV({target:"Set",proto:!0,real:!0,forced:AV},{difference:MV})});var HT=X((Kit,VT)=>{"use strict";var TV=ea(),ly=To(),CV=nl(),IV=ra(),PV=el(),RV=na(),LV=ly.Set,qT=ly.add,NV=ly.has;VT.exports=function(t){var e=TV(this),i=IV(t),s=new LV;return CV(e)>i.size?RV(i.getIterator(),function(u){NV(e,u)&&qT(s,u)}):PV(e,function(u){i.includes(u)&&qT(s,u)}),s}});var WT=X(()=>{"use strict";var OV=sr(),DV=An(),FV=HT(),UV=ia(),BV=!UV("intersection",function(n){return n.size===2&&n.has(1)&&n.has(2)})||DV(function(){return String(Array.from(new Set([1,2,3]).intersection(new Set([3,2]))))!=="3,2"});OV({target:"Set",proto:!0,real:!0,forced:BV},{intersection:FV})});var cy=X((eot,YT)=>{"use strict";var zV=vr(),XT=so(),GV=Pc();YT.exports=function(n,t,e){var i,s;XT(n);try{if(i=GV(n,"return"),!i){if(t==="throw")throw e;return e}i=zV(i,n)}catch(u){s=!0,i=u}if(t==="throw")throw e;if(s)throw i;return XT(i),e}});var ZT=X((not,$T)=>{"use strict";var kV=ea(),qV=To().has,VV=nl(),HV=ra(),WV=el(),XV=na(),YV=cy();$T.exports=function(t){var e=kV(this),i=HV(t);if(VV(e)<=i.size)return WV(e,function(u){if(i.includes(u))return!1},!0)!==!1;var s=i.getIterator();return XV(s,function(u){if(qV(e,u))return YV(s,"normal",!1)})!==!1}});var JT=X(()=>{"use strict";var $V=sr(),ZV=ZT(),JV=ia(),jV=!JV("isDisjointFrom",function(n){return!n});$V({target:"Set",proto:!0,real:!0,forced:jV},{isDisjointFrom:ZV})});var KT=X((oot,jT)=>{"use strict";var KV=ea(),QV=nl(),tH=el(),eH=ra();jT.exports=function(t){var e=KV(this),i=eH(t);return QV(e)>i.size?!1:tH(e,function(s){if(!i.includes(s))return!1},!0)!==!1}});var QT=X(()=>{"use strict";var nH=sr(),rH=KT(),iH=ia(),oH=!iH("isSubsetOf",function(n){return n});nH({target:"Set",proto:!0,real:!0,forced:oH},{isSubsetOf:rH})});var eC=X((uot,tC)=>{"use strict";var sH=ea(),aH=To().has,uH=nl(),lH=ra(),cH=na(),fH=cy();tC.exports=function(t){var e=sH(this),i=lH(t);if(uH(e)<i.size)return!1;var s=i.getIterator();return cH(s,function(u){if(!aH(e,u))return fH(s,"normal",!1)})!==!1}});var nC=X(()=>{"use strict";var hH=sr(),pH=eC(),dH=ia(),gH=!dH("isSupersetOf",function(n){return!n});hH({target:"Set",proto:!0,real:!0,forced:gH},{isSupersetOf:pH})});var iC=X((fot,rC)=>{"use strict";var mH=ea(),fy=To(),yH=rp(),vH=ra(),_H=na(),xH=fy.add,EH=fy.has,SH=fy.remove;rC.exports=function(t){var e=mH(this),i=vH(t).getIterator(),s=yH(e);return _H(i,function(u){EH(e,u)?SH(s,u):xH(s,u)}),s}});var oC=X(()=>{"use strict";var wH=sr(),MH=iC(),bH=ia();wH({target:"Set",proto:!0,real:!0,forced:!bH("symmetricDifference")},{symmetricDifference:MH})});var aC=X((dot,sC)=>{"use strict";var AH=ea(),TH=To().add,CH=rp(),IH=ra(),PH=na();sC.exports=function(t){var e=AH(this),i=IH(t).getIterator(),s=CH(e);return PH(i,function(u){TH(s,u)}),s}});var uC=X(()=>{"use strict";var RH=sr(),LH=aC(),NH=ia();RH({target:"Set",proto:!0,real:!0,forced:!NH("union")},{union:LH})});var hy=X((yot,cC)=>{"use strict";var lC=qu(),OH=TypeError;cC.exports=function(n,t){if(!delete n[t])throw new OH("Cannot delete property "+lC(t)+" of "+lC(n))}});var fC=X(()=>{"use strict";var DH=sr(),FH=Vi(),UH=ii(),BH=vm(),zH=hy(),GH=wh(),kH=[].unshift(0)!==1,qH=function(){try{Object.defineProperty([],"length",{writable:!1}).unshift()}catch(n){return n instanceof TypeError}},VH=kH||!qH();DH({target:"Array",proto:!0,arity:1,forced:VH},{unshift:function(t){var e=FH(this),i=UH(e),s=arguments.length;if(s){GH(i+s);for(var u=i;u--;){var c=u+s;u in e?e[c]=e[u]:zH(e,c)}for(var f=0;f<s;f++)e[f]=arguments[f]}return BH(e,i+s)}})});var Fl=X((Not,gP)=>{"use strict";var bY=Zs(),AY=String;gP.exports=function(n){if(bY(n)==="Symbol")throw new TypeError("Cannot convert a Symbol value to a string");return AY(n)}});var yP=X((Oot,mP)=>{"use strict";var TY=so();mP.exports=function(){var n=TY(this),t="";return n.hasIndices&&(t+="d"),n.global&&(t+="g"),n.ignoreCase&&(t+="i"),n.multiline&&(t+="m"),n.dotAll&&(t+="s"),n.unicode&&(t+="u"),n.unicodeSets&&(t+="v"),n.sticky&&(t+="y"),t}});var _P=X((Dot,vP)=>{"use strict";var t_=An(),CY=Sn(),e_=CY.RegExp,n_=t_(function(){var n=e_("a","y");return n.lastIndex=2,n.exec("abcd")!==null}),IY=n_||t_(function(){return!e_("a","y").sticky}),PY=n_||t_(function(){var n=e_("^r","gy");return n.lastIndex=2,n.exec("str")!==null});vP.exports={BROKEN_CARET:PY,MISSED_STICKY:IY,UNSUPPORTED_Y:n_}});var EP=X((Fot,xP)=>{"use strict";var RY=An(),LY=Sn(),NY=LY.RegExp;xP.exports=RY(function(){var n=NY(".","s");return!(n.dotAll&&n.test(\`
|
|
8117
|
+
`,n=-1/0,r=this.geometry.getAttribute("position");if(r)for(let o=0;o<r.count;o++){let s=r.getZ(o);s>n&&(n=s)}let i=new yt.ShaderMaterial({uniforms:{maxZ:{value:n},uColor:{value:new yt.Color(this.options[0].fillColor).convertLinearToSRGB()},uColor2:{value:new yt.Color(le(this.options[0].fillColor)).convertLinearToSRGB()},uOpacity:{value:this.options[0].fillOpacity}},vertexShader:t,fragmentShader:e,transparent:!0});this.material=i}initLineMaterial(){let t=A.createLineMaterial({color:this.options[0].strokeColor,opacity:this.options[0].strokeOpacity});return this.lineMaterial=t,t}initMesh(){this.mesh&&this.remove(this.mesh),this.mesh=new yt.Mesh(this.geometry,this.material),this.add(this.mesh)}getBorderPoints(){let t=[],e=this.options[0].height+this.options[0].deltaHeight;return this.options.map(n=>{let{coords:r}=n.geometry;for(let i=0;i<r.length;i++){let o=r[i];for(let s=0;s<o.length;s++){let u=o[s],l=s+1===o.length?o[0]:o[s+1];t.push(new yt.Vector3(u[0],u[1],e)),t.push(new yt.Vector3(l[0],l[1],e))}}}),t}initLineGeometry(){this.lineGeometry&&this.lineGeometry.dispose();let t=this.getBorderPoints(),e=new yt.BufferGeometry().setFromPoints(t);this.lineGeometry=e}createBorder(){this.line&&this.remove(this.line);let t=new yt.LineSegments(this.lineGeometry,this.lineMaterial);return t.position.z=.01,this.line=t,this.add(t),t}dispose(){var t,e;this.geometry?(this.geometry.dispose(),this._listeners={}):this.addEventListener("init-geometry",()=>{var n;(n=this.geometry)==null||n.dispose(),this._listeners={}}),(t=this.material)==null||t.dispose(),(e=this.line)==null||e.geometry.dispose(),this.clear()}constructor(t,e,n){super(),this.context=t,this.mergedElement=n,this.options=[],n?(this.options=[n],this.initMergedElement()):(this.options=e.map(r=>v({},de,r)),this.init())}};var Ng=require("core-js/modules/web.dom-collections.iterator.js"),Og=require("core-js/modules/es.string.trim.js");var Ht=require("three"),Xs=require("three/examples/jsm/utils/BufferGeometryUtils.js");var qs={airHeight:0,deltaHeight:0,height:0,geometry:{cds:[],type:"polygon",coords:[],curveCpt:[],curveIndex:[]},texts:[],fillColor:"#ffffff",fillOpacity:0,strokeColor:"#ffffff",strokeOpacity:0,secondHeight:0,secondRotate:0,center_x:0,center_y:0},tr=class extends Ht.Object3D{init(){return g(this,null,function*(){let t=yield Promise.all(this.options.map(o=>dt.getTextureByText(o.texts[0],{fillStyle:wr(o.fillColor,o.fillOpacity),strokeStyle:wr(o.strokeColor,o.strokeOpacity),lineWidth:6,font:"bold 54px sans-serif",maxWidth:2048}))),e=t.map((o,s)=>{let u=this.options[s],{width:l,height:c}=o.texture.image,h=l/c,p=u.secondHeight*h,f=new Ht.PlaneGeometry(p,u.secondHeight),d=new Ht.Matrix4().makeTranslation(u.center_x,u.center_y,u.airHeight+u.deltaHeight+u.height).multiply(new Ht.Matrix4().makeRotationZ(u.secondRotate));return f.applyMatrix4(d),f}),n=(0,Xs.mergeGeometries)(e,!0);e.forEach(o=>o.dispose());let r=t.map(o=>{let{texture:s}=o,u=new Ht.MeshBasicMaterial({map:s,alphaTest:1,side:Ht.DoubleSide});return s.needsUpdate=!0,u}),i=new Ht.Mesh(n,r);this.mesh=i,this.position.z+=.04,this.add(i)})}setOpacity(t){var e,n;(n=this.mesh)==null||(e=n.material)==null||e.forEach(r=>{r.opacity=t,r.needsUpdate=!0})}dispose(){var t,e,n;(t=this.mesh)==null||t.geometry.dispose(),(n=this.mesh)==null||(e=n.material)==null||e.forEach(r=>r.dispose()),this.clear()}constructor(t,e){super(),this.context=t,this.options=e.map(n=>v({},qs,n)).filter(n=>n.texts[0].trim()),this.options.length&&this.init()}};var js=require("three"),Ys=require("three/examples/jsm/lines/Line2.js"),Zs=require("three/examples/jsm/lines/LineGeometry.js"),Ks=require("three/examples/jsm/lines/LineMaterial.js"),un=class extends js.Object3D{registryEvent(){this.context.addEventListener("resize",this.onResize)}unRegistryEvent(){this.context.removeEventListener("resize",this.onResize)}setPosition(t,e){this.lineGeometry.setPositions([t.x,t.y,t.z,e.x,e.y,e.z]),this.line||this.createLine()}createLine(){this.line=new Ys.Line2(this.lineGeometry,this.lineMaterial),this.line.renderOrder=100003,this.add(this.line)}dispose(){var t;this.unRegistryEvent(),this.line&&F(this.line),this.lineGeometry=null,this.lineMaterial=null,this.clear(),(t=this.line)==null||t.clear(),this.line=null}constructor(t,e,n){super(),this.context=t,this.lineGeometry=new Zs.LineGeometry,this.lineMaterial=new Ks.LineMaterial({color:0,transparent:!0,depthTest:!1,linewidth:2}),this.line=null,this.onResize=()=>{let{width:r,height:i}=this.context.clientSize;this.lineMaterial.resolution.set(r,i)},this.onResize(),this.registryEvent(),e&&n&&this.setPosition(e,n)}};var kg=require("core-js/modules/es.array.push.js"),Vg=require("core-js/modules/web.dom-collections.iterator.js"),Be=require("three");var ln=require("three");var qn=class extends Be.Object3D{loadModel(){return g(this,null,function*(){let t=yield It.loadModel(this.options[0].url);t.scene.updateMatrixWorld(!0);let e=t.scene.matrixWorld.clone().invert();t.scene.traverse(u=>{if(u.isMesh){let l=e.clone().multiply(u.matrixWorld),c=u.material;this.subMeshes.push({geometry:u.geometry,material:u.material,initialMatrix:l}),Array.isArray(c)?c.forEach(h=>{h.transparent=!0,this.materialOriginParams.set(h,{opacity:h.opacity})}):(c.transparent=!0,this.materialOriginParams.set(c,{opacity:c.opacity}))}});let n=this.subMeshes.map(u=>{let{geometry:l,material:c}=u;return new Be.InstancedMesh(l,c,this.options.length)});t.scene.rotation.set(Math.PI/2,0,0);let i=new Be.Box3().setFromObject(t.scene).getSize(new Be.Vector3),o=Math.max(i.x,i.y);this.options.map(u=>{let l=new ln.Matrix4,c=u.width/o;return l.multiply(new ln.Matrix4().makeTranslation(u.center_x,u.center_y,u.airHeight+u.deltaHeight)).multiply(new ln.Matrix4().makeScale(c,c,c)).multiply(new ln.Matrix4().makeRotationZ(u.rotate)).multiply(new ln.Matrix4().makeRotationX(Math.PI/2)),u.url==="https://robot-vr-public.cdn.bcebos.com/ai-map-resource/757/1865371442288267264/smzsdrc.glb"&&console.log(u,l),l}).forEach((u,l)=>{n.forEach((c,h)=>{let p=u.clone().multiply(this.subMeshes[h].initialMatrix);c.setMatrixAt(l,p)})}),n.forEach(u=>{u.instanceMatrix.needsUpdate=!0,this.meshSetMaterial(u),this.add(u)})})}meshSetMaterial(t){t.isMesh&&(t.frustumCulled=!1,t.castShadow=!0,Array.isArray(t.material)?t.material.map(e=>{e.emissiveIntensity*=.95}):(t.material.emissiveIntensity*=.95,t.material.emissive=t.material.color,t.material.emissiveMap=t.material.map))}setOpacity(t,e){e===void 0&&(e=!1),this.subMeshes.forEach(n=>{let{material:r}=n;if(Array.isArray(r))r.forEach(i=>{if(e)i.opacity=t;else{let o=this.materialOriginParams.get(i)||{opacity:1};t>o.opacity?i.opacity=o.opacity:i.opacity=t}i.needsUpdate=!0});else{let i=this.materialOriginParams.get(r)||{opacity:1};t>i.opacity?r.opacity=i.opacity:r.opacity=t,r.needsUpdate=!0}}),this.children.forEach(n=>{n.instanceMatrix.needsUpdate=!0})}dispose(){this.children.forEach(t=>t.dispose()),F(this),this.clear()}constructor(t,e){super(),this.context=t,this.options=e,this.subMeshes=[],this.materialOriginParams=new Map,this.loadModel()}};var ze=require("three");var an=class extends ze.Object3D{init(){return g(this,null,function*(){this.geometry=this.initGeometry(),this.initMaterial(),this.initMesh(),this.mesh.position.z=this.options.deltaHeight+this.options.airHeight,this.options.lineGeometry&&(this.initLineMaterial(),this.initLineGeometry(),this.createBorder())})}initGeometry(){return this.loader.parseGeometries([this.options.mergedGeometry])[this.options.mergedGeometry.uuid]}initMaterial(){this.material=A.GetMergeAttributeGraphicMaterial()}initLineMaterial(){return this.lineMaterial=A.GetMergeAttributeGraphicLineMaterial()}initMesh(){this.mesh&&this.remove(this.mesh),this.mesh=new ze.Mesh(this.geometry,this.material),this.add(this.mesh)}initLineGeometry(){this.lineGeometry&&this.lineGeometry.dispose();let t=this.loader.parseGeometries([this.options.lineGeometry]);this.lineGeometry=t[this.options.lineGeometry.uuid]}createBorder(){this.line&&this.remove(this.line);let t=new ze.LineSegments(this.lineGeometry,this.lineMaterial);return t.position.z=.01,this.line=t,this.add(t),t}dispose(){var t;this.geometry&&this.geometry.dispose(),(t=this.line)==null||t.geometry.dispose(),this.clear()}constructor(t,e){super(),this.context=t,this.loader=new ze.ObjectLoader,this.options=v({},de,e),this.init()}};var cn=require("three");var er=class extends cn.Object3D{initGeometry(){return g(this,null,function*(){let t=new cn.ObjectLoader().parseGeometries([this.options.mergedGeometry]);this.geometry=t[this.options.mergedGeometry.uuid]})}init(){return g(this,null,function*(){var t;yield this.initGeometry();let e=new cn.Mesh(this.geometry,Lt.GetMergeAttributeWallMaterial());this.add(e);let n=(t=this.geometry)==null?void 0:t.getAttribute("opacity");n&&(this.originOpacities=Array.from(n.array))})}setOpacity(t,e){e===void 0&&(e=!1);var n;let r=(n=this.geometry)==null?void 0:n.getAttribute("opacity");if(r){for(let o=0;o<r.count;o++)if(e)r.setX(o,t);else{var i;r.setX(o,Math.min(t,(i=this.originOpacities[o])!=null?i:1))}r.needsUpdate=!0}}dispose(){var t;(t=this.geometry)==null||t.dispose(),this.clear()}constructor(t,e){super(),this.context=t,this.options=e,this.originOpacities=[],this.init()}};var nm=require("core-js/modules/es.typed-array.float32-array.js"),rm=require("core-js/modules/es.typed-array.at.js"),im=require("core-js/modules/es.typed-array.fill.js"),om=require("core-js/modules/es.typed-array.find-last.js"),sm=require("core-js/modules/es.typed-array.find-last-index.js"),am=require("core-js/modules/es.typed-array.set.js"),um=require("core-js/modules/es.typed-array.sort.js"),lm=require("core-js/modules/es.typed-array.to-reversed.js"),cm=require("core-js/modules/es.typed-array.to-sorted.js"),hm=require("core-js/modules/es.typed-array.with.js"),pm=require("core-js/modules/es.array-buffer.constructor.js"),fm=require("core-js/modules/es.array-buffer.slice.js"),dm=require("core-js/modules/es.array-buffer.detached.js"),gm=require("core-js/modules/es.array-buffer.transfer.js"),mm=require("core-js/modules/es.array-buffer.transfer-to-fixed-length.js");var ht=require("three");var Ne=class extends ht.Object3D{init(){return g(this,null,function*(){let t=this.options.iconUrl,e=yield gt.getTextureByUrl(t),n=new ht.MeshBasicMaterial({map:e,transparent:!0,alphaTest:.2,side:ht.FrontSide}),r=new ht.InstancedMesh(this.geometry,n,this.options.mergedMatrixes.size);r.instanceMatrix=new ht.InstancedBufferAttribute(new Float32Array(this.options.mergedMatrixes.array),16),this.add(r),this.mesh=r,this.position.z+=.004})}setOpacity(t){this.mesh&&(this.mesh.material.opacity=t,this.mesh.material.needsUpdate=!0,this.mesh.instanceMatrix.needsUpdate=!0)}dispose(){var t;this.mesh&&F(this.mesh),(t=this.mesh)==null||t.dispose(),this.clear()}constructor(t,e){super(),this.context=t,this.geometry=new ht.ShapeGeometry(new ht.Shape([new ht.Vector2(-.5,-.5),new ht.Vector2(-.5,.5),new ht.Vector2(.5,.5),new ht.Vector2(.5,-.5)])),this.options=v({},Wr,e);let n=new ht.Float32BufferAttribute([0,0,0,1,1,1,1,0],2);this.geometry.setAttribute("uv",n),this.init()}};var bm=require("core-js/modules/es.array.push.js"),Me=require("three");var qi=require("three/examples/jsm/lines/LineSegments2.js"),ji=require("three/examples/jsm/lines/LineSegmentsGeometry.js");var nr=class extends Me.Object3D{initGeometry(){return g(this,null,function*(){let t=this.loader.parseGeometries([this.options.mergedGeometry]);this.geometry=t[this.options.mergedGeometry.uuid]})}initMaterial(){let t=A.createMeshBasicMaterial({color:"#ffffff",opacity:1,vertexColors:!0});return this.material=t,t}initDoubleLine(){if(this.options.dashedLineGeometry){let t=A.createLine2MaterialMap({color:"#ffffff",width:.2,dashed:!0,resolution:new Me.Vector2(this.context.clientSize.width,this.context.clientSize.height),vertexColors:!0});t.transparent=!0,t.needsUpdate=!0;let e=new ji.LineSegmentsGeometry;e.setPositions(this.options.dashedLineGeometry.positions),e.setColors(this.options.dashedLineGeometry.colors);let n=new qi.LineSegments2(e,t);n.computeLineDistances(),n.position.z+=.01,this.add(n),this.doubleLines.push(n)}if(this.options.lineGeometry){let t=A.createLine2MaterialMap({color:"#ffffff",width:.2,dashed:!1,resolution:new Me.Vector2(this.context.clientSize.width,this.context.clientSize.height),vertexColors:!0}),e=new ji.LineSegmentsGeometry;e.setPositions(this.options.lineGeometry.positions),e.setColors(this.options.lineGeometry.colors);let n=new qi.LineSegments2(e,t);n.position.z+=.01,this.add(n),this.doubleLines.push(n)}}init(){return g(this,null,function*(){yield this.initGeometry(),this.initMaterial();let t=new Me.Mesh(this.geometry,this.material);this.add(t),this.initDoubleLine(),this.position.z+=.02})}setOpacity(t){this.material.opacity=t,this.material.needsUpdate=!0,this.doubleLines.forEach(e=>{e.material.opacity=t,e.material.needsUpdate=!0})}dispose(){var t,e;(t=this.geometry)==null||t.dispose(),(e=this.lineGeometry)==null||e.dispose(),this.doubleLines.map(n=>n.geometry.dispose()),this.clear()}constructor(t,e){super(),this.context=t,this.options=e,this.doubleLines=[],this.loader=new Me.ObjectLoader,this.init()}};var Am=require("core-js/modules/es.typed-array.float32-array.js"),Cm=require("core-js/modules/es.typed-array.at.js"),Im=require("core-js/modules/es.typed-array.fill.js"),Rm=require("core-js/modules/es.typed-array.find-last.js"),Pm=require("core-js/modules/es.typed-array.find-last-index.js"),Lm=require("core-js/modules/es.typed-array.set.js"),Nm=require("core-js/modules/es.typed-array.sort.js"),Om=require("core-js/modules/es.typed-array.to-reversed.js"),Dm=require("core-js/modules/es.typed-array.to-sorted.js"),Um=require("core-js/modules/es.typed-array.with.js"),Fm=require("core-js/modules/es.array-buffer.constructor.js"),Bm=require("core-js/modules/es.array-buffer.slice.js"),zm=require("core-js/modules/es.array-buffer.detached.js"),Gm=require("core-js/modules/es.array-buffer.transfer.js"),km=require("core-js/modules/es.array-buffer.transfer-to-fixed-length.js"),Vm=require("core-js/modules/web.dom-collections.iterator.js"),X=require("three");var nn=class extends X.Object3D{setColorByIndex(t,e){this.mesh&&(this.mesh.setColorAt(t,new X.Color(e).convertLinearToSRGB()),this.mesh.instanceColor.needsUpdate=!0)}init(){return g(this,null,function*(){this.initMaterial(),this.initMesh(),this.mesh.position.z=this.options[0].deltaHeight+this.options[0].airHeight,this.options[0].strokeOpacity!==0&&(this.initLineMaterial(),this.initLineGeometry(),this.createBorder())})}initMaterial(){this.material=A.GetInstancedGraphicMaterial()}initLineMaterial(){let t=A.GetMergeAttributeGraphicLineMaterial();this.lineMaterial=t}initMesh(){this.mesh&&this.remove(this.mesh),this.mesh=new X.InstancedMesh(this.geometry,this.material,this.options.length);let t=new X.InstancedBufferAttribute(new Float32Array(this.options.length),1),e=new X.InstancedBufferAttribute(new Float32Array(this.options.length),1);this.options.forEach((n,r)=>{let i=n.geometry.coords[0],[o,s,u]=i.slice(0,3),l=Math.sqrt((s[0]-o[0])**2+(s[1]-o[1])**2),c=Math.sqrt((u[0]-s[0])**2+(u[1]-s[1])**2),h=[l,c],p=Math.max(...h),f=Math.min(...h),d;p===l?d=[s[0]-o[0],s[1]-o[1]]:d=[u[0]-s[0],u[1]-s[1]];let[m,_]=d,x=Math.atan2(_,m)-Math.PI/2,E=new X.Matrix4().compose(new X.Vector3(n.center_coord_x,n.center_coord_y,(n.deltaHeight||0)+n.airHeight+n.height/2),new X.Quaternion().setFromAxisAngle(new X.Vector3(0,0,1),x),new X.Vector3(f,p,n.height));this.mesh.setMatrixAt(r,E),this.mesh.setColorAt(r,new X.Color(n.fillColor).convertLinearToSRGB()),t.array[r]=n.fillOpacity||1,e.array[r]=(n.deltaHeight||0)+n.airHeight+n.height}),this.originOpacity=[...t.array],this.geometry.setAttribute("opacity",t),this.geometry.setAttribute("maxZ",e),this.add(this.mesh),this.mesh.instanceMatrix.needsUpdate=!0}initLineGeometry(){this.lineGeometry&&this.lineGeometry.dispose();let{points:t,colors:e,opacities:n}=Rr(this.options),r=new X.BufferGeometry().setFromPoints(t);r.setAttribute("color",new X.BufferAttribute(new Float32Array(e),3)),r.setAttribute("opacity",new X.BufferAttribute(new Float32Array(n),1)),this.lineOriginOpacity=[...n],this.lineGeometry=r}createBorder(){this.line&&this.remove(this.line);let t=new X.LineSegments(this.lineGeometry,this.lineMaterial);return t.position.z=.01,this.line=t,this.add(t),t}setOpacity(t,e){e===void 0&&(e=!1);let n=this.geometry.getAttribute("opacity");for(let o=0;o<n.count;o++)if(e)n.array[o]=t;else{var r;n.array[o]=Math.min(t,(r=this.originOpacity[o])!=null?r:1)}if(n.needsUpdate=!0,this.lineGeometry){let o=this.lineGeometry.getAttribute("opacity");for(let s=0;s<o.count;s++)if(e)o.array[s]=t;else{var i;o.array[s]=Math.min(t,(i=this.lineOriginOpacity[s])!=null?i:1)}o.needsUpdate=!0}}dispose(){var t,e;this.geometry.dispose(),(t=this.mesh)==null||t.dispose(),(e=this.line)==null||e.geometry.dispose(),this.clear()}constructor(t,e){super(),this.context=t,this.geometry=new X.BoxGeometry(1,1,1),this.options=[],this.originOpacity=[],this.lineOriginOpacity=[],this.options=e.map(n=>v({},de,n)),this.init()}};var Ym=require("core-js/modules/es.typed-array.float32-array.js"),Zm=require("core-js/modules/es.typed-array.at.js"),Km=require("core-js/modules/es.typed-array.fill.js"),$m=require("core-js/modules/es.typed-array.find-last.js"),Jm=require("core-js/modules/es.typed-array.find-last-index.js"),Qm=require("core-js/modules/es.typed-array.set.js"),t_=require("core-js/modules/es.typed-array.sort.js"),e_=require("core-js/modules/es.typed-array.to-reversed.js"),n_=require("core-js/modules/es.typed-array.to-sorted.js"),r_=require("core-js/modules/es.typed-array.with.js"),i_=require("core-js/modules/es.array-buffer.constructor.js"),o_=require("core-js/modules/es.array-buffer.slice.js"),s_=require("core-js/modules/es.array-buffer.detached.js"),a_=require("core-js/modules/es.array-buffer.transfer.js"),u_=require("core-js/modules/es.array-buffer.transfer-to-fixed-length.js"),l_=require("core-js/modules/web.dom-collections.iterator.js"),Qt=require("three");var Ke=class extends Qt.Object3D{init(){return g(this,null,function*(){this.initMaterial(),this.initMesh()})}initMaterial(){this.material=A.GetInstancedGraphicMaterial()}initMesh(){if(this.mesh&&this.remove(this.mesh),!this.elements)return;this.mesh=new Qt.InstancedMesh(this.geometry,this.material,this.elements.size);let t=new Qt.InstancedBufferAttribute(new Float32Array(this.elements.opacities),1),e=new Qt.InstancedBufferAttribute(new Float32Array(this.elements.maxZs),1);this.originOpacities=[...t.array],this.geometry.setAttribute("opacity",t),this.geometry.setAttribute("maxZ",e),this.mesh.instanceMatrix.set(this.elements.matrixes),this.mesh.instanceColor=new Qt.InstancedBufferAttribute(new Float32Array(this.elements.colors),3),this.add(this.mesh),this.mesh.instanceMatrix.needsUpdate=!0}setColorByIndex(t,e){this.mesh&&(this.mesh.setColorAt(t,new Qt.Color(e).convertLinearToSRGB()),this.mesh.instanceColor.needsUpdate=!0)}setOpacityByIndex(t,e){if(this.mesh){let n=this.geometry.getAttribute("opacity");n.setX(t,e),n.needsUpdate=!0}}setMatrixByIndex(t,e){this.mesh&&(this.mesh.setMatrixAt(t,e),this.mesh.instanceMatrix.needsUpdate=!0)}setMaxZByIndex(t,e){if(this.mesh){let n=this.geometry.getAttribute("maxZ");n.setX(t,e),n.needsUpdate=!0}}setColorById(t,e){if(!this.elements)return;let n=this.elements.ids.findIndex(r=>r===t);n!==-1&&this.setColorByIndex(n,e)}setOpacityById(t,e){if(!this.elements)return;let n=this.elements.ids.findIndex(r=>r===t);n!==-1&&this.setOpacityByIndex(n,e)}setMatrixById(t,e){if(!this.elements)return;let n=this.elements.ids.findIndex(r=>r===t);n!==-1&&this.setMatrixByIndex(n,e)}setMaxZById(t,e){if(!this.elements)return;let n=this.elements.ids.findIndex(r=>r===t);n!==-1&&this.setMaxZByIndex(n,e)}setOpacity(t,e){if(e===void 0&&(e=!1),!this.geometry)return;let n=this.geometry.getAttribute("opacity");for(let i=0;i<n.count;i++)if(e)n.array[i]=t;else{var r;n.array[i]=Math.min(t,(r=this.originOpacities[i])!=null?r:1)}n.needsUpdate=!0}pushElements(t){this.elements?(this.elements.size+=t.size,this.elements.colors=[...this.elements.colors,...t.colors],this.elements.matrixes=[...this.elements.matrixes,...t.matrixes],this.elements.opacities=[...this.elements.opacities,...t.opacities],this.elements.maxZs=[...this.elements.maxZs,...t.maxZs],this.elements.ids=[...this.elements.ids,...t.ids],this.originOpacities=[...this.originOpacities,...t.opacities]):this.elements=t,this.refesh()}removeInstanceById(t){if(this.elements){if(this.mesh){let e=this.elements.ids.indexOf(t);e!==-1&&(this.elements.size--,this.elements.colors.splice(e*3,3),this.elements.matrixes.splice(e*16,16),this.elements.opacities.splice(e,1),this.elements.maxZs.splice(e,1),this.elements.ids.splice(e,1),this.originOpacities.splice(e,1))}this.refesh()}}refesh(){this.mesh&&(this.mesh.dispose(),this.remove(this.mesh)),this.init()}dispose(){var t;this.material=null,this.originOpacities.length=0,this.geometry.dispose(),(t=this.mesh)==null||t.dispose(),this.clear()}constructor(t,e){super(),this.geometry=new Qt.BoxGeometry(1,1,1),this.material=null,this.elements=null,this.originOpacities=[],this.elements=e,this.init()}};var f_=require("core-js/modules/es.typed-array.float32-array.js"),d_=require("core-js/modules/es.typed-array.at.js"),g_=require("core-js/modules/es.typed-array.fill.js"),m_=require("core-js/modules/es.typed-array.find-last.js"),__=require("core-js/modules/es.typed-array.find-last-index.js"),y_=require("core-js/modules/es.typed-array.set.js"),v_=require("core-js/modules/es.typed-array.sort.js"),x_=require("core-js/modules/es.typed-array.to-reversed.js"),E_=require("core-js/modules/es.typed-array.to-sorted.js"),b_=require("core-js/modules/es.typed-array.with.js"),S_=require("core-js/modules/es.array-buffer.constructor.js"),M_=require("core-js/modules/es.array-buffer.slice.js"),w_=require("core-js/modules/es.array-buffer.detached.js"),T_=require("core-js/modules/es.array-buffer.transfer.js"),A_=require("core-js/modules/es.array-buffer.transfer-to-fixed-length.js"),C_=require("core-js/modules/web.dom-collections.iterator.js"),ie=require("three");var rr=class extends ie.Object3D{init(){return g(this,null,function*(){this.initMaterial(),this.initMesh()})}initMaterial(){this.material=A.GetInstancedWallMaterial()}initMesh(){if(this.mesh&&this.remove(this.mesh),!this.elements)return;this.mesh=new ie.InstancedMesh(this.geometry,this.material,this.elements.size);let t=new ie.InstancedBufferAttribute(new Float32Array(this.elements.opacities),1),e=new ie.InstancedBufferAttribute(new Float32Array(this.elements.maxZs),1),n=new ie.InstancedBufferAttribute(new Float32Array(this.elements.minZs),1);this.originOpacities=[...t.array],this.geometry.setAttribute("opacity",t),this.geometry.setAttribute("maxZ",e),this.geometry.setAttribute("minZ",n),this.mesh.instanceMatrix.set(this.elements.matrixes),this.mesh.instanceColor=new ie.InstancedBufferAttribute(new Float32Array(this.elements.colors),3),this.add(this.mesh),this.mesh.instanceMatrix.needsUpdate=!0}setOpacityByIndex(t,e){if(this.mesh){let n=this.geometry.getAttribute("opacity");n.setX(t,e),n.needsUpdate=!0}}setOpacity(t,e){e===void 0&&(e=!1),this.elements&&this.elements.opacities.forEach((n,r)=>{let i=e?t:Math.min(t,this.originOpacities[r]);this.setOpacityByIndex(r,i)})}dispose(){this.mesh&&(this.mesh.dispose(),this.remove(this.mesh)),this.material=null,this.geometry&&this.geometry.dispose(),this.elements=null}constructor(t,e){super(),this.geometry=new ie.BoxGeometry(1,1,1),this.material=null,this.elements=null,this.originOpacities=[],this.elements=e,this.init()}};var hn=require("three");var Oe=class extends hn.Object3D{init(){return g(this,null,function*(){this.initLineGeometry(),this.initLineMaterial(),this.createBorder()})}initLineMaterial(){return this.lineMaterial=A.GetMergeAttributeGraphicLineMaterial()}initLineGeometry(){this.lineGeometry&&this.lineGeometry.dispose();let t=this.loader.parseGeometries([this.options]);this.lineGeometry=t[this.options.uuid]}createBorder(){this.line&&this.remove(this.line);let t=new hn.LineSegments(this.lineGeometry,this.lineMaterial);return t.position.z=.01,this.line=t,this.add(t),t}dispose(){var t;(t=this.lineGeometry)==null||t.dispose(),this.lineMaterial=null,this.clear()}constructor(t,e){super(),this.context=t,this.lineMaterial=null,this.loader=new hn.ObjectLoader,this.options=v({},de,e),this.init()}};var $s=require("three"),Xr=class extends Vt{setEnable(t){super.setEnable(t),Ct(this.rect,0,0,0,0),t?this.registryEvent():(this.startPoint=void 0,this.unRegistryEvent())}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:e,container:{clientWidth:n,clientHeight:r}}}=this,i=N(this.startPoint,e,n,r),o=N(this.endPoint,e,n,r),s={x:Math.min(i.x,o.x),y:Math.min(i.y,o.y)},u={x:Math.max(i.x,o.x),y:Math.max(i.y,o.y)},l=this.searchMapInFrustum(s,u);this.dispatchEvent({type:"selected",list:l})}}searchMapInFrustum(t,e){var n;let{context:r}=this;return((n=r.currentFloor)==null?void 0:n.graphicLayer.children.filter(i=>i instanceof mt&&this.searchChildInFrustum(i,t,e)))||[]}searchChildInFrustum(t,e,n){let{context:{camera:r,container:{clientWidth:i,clientHeight:o}}}=this;if(!t)return!1;if(!t.mesh){let p=t.getPosition();if(p){let f=N(p,r,i,o);return xe(f,e,n)}return!1}t.mesh.geometry.boundingBox||t.mesh.geometry.computeBoundingBox();let s=t.mesh.geometry.boundingBox;if(!s)return!1;let{min:u,max:l}=s,c=N(u,r,i,o),h=N(l,r,i,o);return!(!xe(c,e,n)||!xe(h,e,n))}dispose(){super.dispose(),this.rect=null,this.unRegistryEvent()}constructor(t){super(t),this.frustum=new $s.Frustum,this.onPointerDown=r=>{if(!this.enable)return;let i=this.getIntersectByPointerEvent(r);i&&(this.startPoint=i),this.endPoint=void 0},this.onPointerMove=r=>{if(!this.enable||!this.startPoint)return;let i=this.getIntersectByPointerEvent(r);i&&(this.endPoint=i)},this.onPointerUp=r=>{if(!this.enable)return;let i=this.getIntersectByPointerEvent(r);i&&(this.endPoint=i),this.doSelect(),this.startPoint=void 0},this.onUpdate=()=>{if(this.startPoint){let r=this.getSvgCoordinate(this.startPoint),i=v({},r);this.endPoint&&(i=this.getSvgCoordinate(this.endPoint));let o={x:Math.min(r.x,i.x),y:Math.min(r.y,i.y)},s=Math.abs(i.x-r.x),u=Math.abs(i.y-r.y);Ct(this.rect,o.x,o.y,s,u)}else Ct(this.rect,0,0,0,0)};let{config:{selectBox:{fill:e,stroke:n}}}=t;this.rect=Ee(n,e),this.svg.appendChild(this.rect),this.registryEvent()}};var ir=class extends Js.EventDispatcher{get list(){return this._list}enableBoxSelection(){this.isMultipleSelect||!this.context.config.enableBoxSelect||(this.isMultipleSelect=!0,this.boxSelection.setEnable(!0),this.prevPanStatus=this.context.control.enablePan,this.prevRotateStatus=this.context.control.enableRotate,this.context.control.enablePan=!1,this.context.control.enableRotate=!1)}disableBoxSelection(){this.isMultipleSelect&&(this.isMultipleSelect=!1,this.boxSelection.setEnable(!1),this.context.control.enablePan=!!this.prevPanStatus,this.context.control.enableRotate=!!this.prevRotateStatus)}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()}constructor(t){super(),this.context=t,this._list=new Set,this.downPoint=null,this.downTime=0,this.isMultipleSelect=!1,this.onPointerDown=e=>{Date.now()-this.downTime<200||(this.downPoint={x:e.offsetX,y:e.offsetY},this.downTime=Date.now())},this.onPointerUp=e=>{if(!this.downPoint)return;let{offsetX:n,offsetY:r}=e,{x:i,y:o}=this.downPoint;if(Math.sqrt((i-n)**2+(o-r)**2)>3)return;let{graphics:s}=this.context.getGraphicsByDeviceXy(n,r),u=new Set(s.map(c=>c.options.id));this.context.getPoisByDeviceXy(n,r).forEach(c=>{if(!u.has(c.options.id)){var h;let p=((h=this.context.currentFloor)==null?void 0:h.graphicLayer.graphicMap.get(c.options.id))||null;p&&p.options.geometry.type==="point"&&(s.push(p),u.add(c.options.id))}}),(He?e.metaKey:e.ctrlKey)||this._list.clear(),s.forEach(c=>this._list.add(c)),this.selectEnd(),this.downPoint=null},this.onPointerOut=e=>{this.disableBoxSelection()},this.onKeyDown=e=>{We(e.key)&&this.enableBoxSelection()},this.onKeyUp=e=>{We(e.key)&&this.disableBoxSelection()},this.onBoxSelected=e=>{let{list:n}=e;this._list.clear(),n.forEach(r=>{this._list.add(r)}),this.selectEnd()},this.boxSelection=new Xr(t),this.boxSelection.setEnable(!1),this.registryEvent()}};var Q_=require("core-js/modules/es.set.difference.v2.js"),ty=require("core-js/modules/es.set.intersection.v2.js"),ey=require("core-js/modules/es.set.is-disjoint-from.v2.js"),ny=require("core-js/modules/es.set.is-subset-of.v2.js"),ry=require("core-js/modules/es.set.is-superset-of.v2.js"),iy=require("core-js/modules/es.set.symmetric-difference.v2.js"),oy=require("core-js/modules/es.set.union.v2.js"),sy=require("core-js/modules/web.dom-collections.iterator.js");var qr=require("three");var or=class extends qr.EventDispatcher{handleHoverGraphicsChange(t){t===void 0&&(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()}constructor(t){super(),this.context=t,this.curGraphics=new Set,this.timer=new $,this.graphicTimerMap=new Map,this.onPointerMove=e=>{let{graphics:n,pois:r,e:i}=e,o=r.map(c=>{var h;return(h=this.context.currentFloor)==null?void 0:h.graphicLayer.graphicMap.get(c.options.id)}).filter(c=>c&&c.options.geometry.type==="point");if(!n.length&&!o.length&&this.curGraphics.size){this.curGraphics.clear(),this.handleHoverGraphicsChange();return}let{time:s}=this.context.config.hover,u=new Set;if(o.length){let c,h=1e4;o.forEach(p=>{let f=r.find(d=>d.options.id===p.options.id);if(f instanceof Pe){let{x:d,y:m}=f.clientPos,_=Math.sqrt((d-i.offsetX)**2+(m-i.offsetY)**2);_<h&&(h=_,c=p)}else if(f instanceof st){let{x:d,y:m}=f.box.getCenter(new qr.Vector2),_=Math.sqrt((d-i.offsetX)**2+(m-i.offsetY)**2);_<h&&(h=_,c=p)}}),u.add(c)}u.size||n.forEach(c=>u.add(c)),u.forEach(c=>{if(this.graphicTimerMap.get(c)||this.curGraphics.has(c))return;let h=this.timer.setTimeout(()=>{this.curGraphics.add(c),this.graphicTimerMap.delete(c),this.timer.clearTimeout(h),this.handleHoverGraphicsChange()},s);this.graphicTimerMap.set(c,h)}),this.graphicTimerMap.forEach((c,h)=>{u.has(h)||(this.timer.clearTimeout(c),this.graphicTimerMap.delete(h))});let l=this.curGraphics.size;this.curGraphics.forEach(c=>{u.has(c)||this.curGraphics.delete(c)}),l!==this.curGraphics.size&&this.handleHoverGraphicsChange()},this.onPointerLevel=()=>{this.curGraphics.clear(),this.handleHoverGraphicsChange()},this.onBodyPointerMove=e=>{if(this.curGraphics.size){let n=this.context.container.getBoundingClientRect();(e.clientX<n.left||e.clientX>n.right||e.clientY<n.top||e.clientY>n.bottom)&&this.onPointerLevel()}},this.registryEvent()}};var cy=require("core-js/modules/web.dom-collections.iterator.js"),Wt=require("three");var sr=require("@turf/turf"),jr=class{updateBox(){this.box.setFromObject(this.context.scene)}setEnable(t){this.enable=t,t?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(d=>d instanceof re).length)return null;let e=this.box,{camera:n,clientSize:{width:r,height:i}}=this.context,{min:o,max:s}=e,l=[new Wt.Vector3(o.x,o.y,o.z),new Wt.Vector3(s.x,o.y,o.z),new Wt.Vector3(o.x,s.y,o.z),new Wt.Vector3(s.x,s.y,o.z),new Wt.Vector3(o.x,o.y,s.z),new Wt.Vector3(s.x,o.y,s.z),new Wt.Vector3(o.x,s.y,s.z),new Wt.Vector3(s.x,s.y,s.z)].map(d=>N(d,n,r,i)),c=Math.min(...l.map(d=>d.x)),h=Math.max(...l.map(d=>d.x)),p=Math.min(...l.map(d=>d.y)),f=Math.max(...l.map(d=>d.y));return{left:c,right:h,top:p,bottom:f}}checkDistanceToScreenEdge(t){let{left:e,right:n,top:r,bottom:i}=t,{width:o,height:s}=this.context.clientSize,[u,l,c,h]=this.context.config.cameraBound.padding,p=(0,sr.polygon)([[[e,r],[n,r],[n,i],[e,i],[e,r]]]),f=(0,sr.polygon)([[[h,u],[o-l,u],[o-l,s-c],[h,s-c],[h,u]]]);try{return(0,sr.intersect)(p,f)!==null}catch(d){return console.warn("\u8BA1\u7B97\u4EA4\u96C6\u51FA\u9519:",d),!1}}dispose(){this.unRegistryEvent()}constructor(t){this.context=t,this.prevCamera={position:new Wt.Vector3,zoom:1,target:new Wt.Vector3},this.enable=!0,this.box=new Wt.Box3,this.onCameraChange=()=>{let e=this.getCurFloorScreenPosition();if(e){let{left:n,right:r,top:i,bottom:o}=e;this.checkDistanceToScreenEdge({left:n,right:r,top:i,bottom:o})?this.changePrevCamera():this.backToPrevCamera()}},this.registryEvent(),this.changePrevCamera()}};var _y=require("core-js/modules/es.promise.finally.js"),Yi=require("three"),$e=require("@tweenjs/tween.js");var dy=require("core-js/modules/web.dom-collections.iterator.js"),gy=require("core-js/modules/es.array.push.js"),M=require("three"),Yr=new M.Ray,Qs=new M.Plane,wu=Math.cos(70*M.MathUtils.DEG2RAD),Zr=class extends M.EventDispatcher{dispose(){this.domElement.removeEventListener("contextmenu",this.onContextMenu),this.domElement.removeEventListener("pointerdown",this.onPointerDown),this.domElement.removeEventListener("pointercancel",this.onPointerUp),this.domElement.removeEventListener("wheel",this.onMouseWheel),this.domElement.removeEventListener("pointermove",this.onPointerMove),this.domElement.removeEventListener("pointerup",this.onPointerUp),this._domElementKeyEvents!==null&&(this._domElementKeyEvents.removeEventListener("keydown",this.onKeyDown),this._domElementKeyEvents=null)}constructor(t,e){super(),this.rotateLineStart=new M.Vector2,this.rotateLineEnd=new M.Vector2,this.spherical=new M.Spherical,this.sphericalDelta=new M.Spherical,this.object=t,this.domElement=e,this.domElement.style.touchAction="none",this.enabled=!0,this.target=new M.Vector3,this.minDistance=0,this.maxDistance=1/0,this.minZoom=0,this.maxZoom=1/0,this.minPolarAngle=0,this.maxPolarAngle=Math.PI,this.minAzimuthAngle=-1/0,this.maxAzimuthAngle=1/0,this.enableDamping=!1,this.dampingFactor=.05,this.enableZoom=!0,this.zoomSpeed=1,this.enableRotate=!0,this.rotateSpeed=1,this.enablePan=!0,this.panSpeed=1,this.keyPanSpeed=7,this.zoomToCursor=!1,this.autoRotate=!1,this.autoRotateSpeed=2,this.keys={LEFT:"ArrowLeft",UP:"ArrowUp",RIGHT:"ArrowRight",BOTTOM:"ArrowDown"},this.screenSpacePanning=!1,this.mouseButtons={LEFT:M.MOUSE.PAN,MIDDLE:M.MOUSE.DOLLY,RIGHT:M.MOUSE.ROTATE},this.touches={ONE:M.TOUCH.PAN,TWO:M.TOUCH.DOLLY_ROTATE},this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this._domElementKeyEvents=null,this.getPolarAngle=function(){return s.phi},this.getAzimuthalAngle=function(){return s.theta},this.getDistance=function(){return this.object.position.distanceTo(this.target)},this.listenToKeyEvents=function(y){y.addEventListener("keydown",this.onKeyDown),this._domElementKeyEvents=y},this.stopListenToKeyEvents=function(){var y;(y=this._domElementKeyEvents)==null||y.removeEventListener("keydown",this.onKeyDown),this._domElementKeyEvents=null},this.saveState=function(){n.target0.copy(n.target),n.position0.copy(n.object.position),n.zoom0=n.object.zoom},this.reset=function(){n.target.copy(n.target0),n.object.position.copy(n.position0),n.object.zoom=n.zoom0,n.object.updateProjectionMatrix(),n.dispatchEvent({type:"change"}),n.update(),i=r.NONE},this.update=function(){let y=new M.Vector3,b=new M.Quaternion().setFromUnitVectors(t.up,new M.Vector3(0,1,0)),Y=b.clone().invert(),lt=new M.Vector3,Bt=new M.Quaternion,ae=new M.Vector3,ee=2*Math.PI;return function(bn){bn===void 0&&(bn=null);let _e=n.object.position;y.copy(_e).sub(n.target),y.applyQuaternion(b),s.setFromVector3(y),n.autoRotate&&i===r.NONE&&I(L(bn)),n.enableDamping?(s.theta+=u.theta*n.dampingFactor,s.phi+=u.phi*n.dampingFactor):(s.theta+=u.theta,s.phi+=u.phi);let ye=n.minAzimuthAngle,ve=n.maxAzimuthAngle;isFinite(ye)&&isFinite(ve)&&(ye<-Math.PI?ye+=ee:ye>Math.PI&&(ye-=ee),ve<-Math.PI?ve+=ee:ve>Math.PI&&(ve-=ee),ye<=ve?s.theta=Math.max(ye,Math.min(ve,s.theta)):s.theta=s.theta>(ye+ve)/2?Math.max(ye,s.theta):Math.min(ve,s.theta)),s.phi=Math.max(n.minPolarAngle,Math.min(n.maxPolarAngle,s.phi)),s.makeSafe(),n.enableDamping===!0?n.target.addScaledVector(c,n.dampingFactor):n.target.add(c),n.zoomToCursor&&K||n.object.isOrthographicCamera?s.radius=j(s.radius):s.radius=j(s.radius*l),y.setFromSpherical(s),y.applyQuaternion(Y),_e.copy(n.target).add(y),n.object.lookAt(n.target),n.enableDamping===!0?(u.theta*=1-n.dampingFactor,u.phi*=1-n.dampingFactor,c.multiplyScalar(1-n.dampingFactor)):(u.set(0,0,0),c.set(0,0,0));let br=!1;if(n.zoomToCursor&&K){let Sn=null;if(n.object.isPerspectiveCamera){let Mn=y.length();Sn=j(Mn*l);let Sr=Mn-Sn;n.object.position.addScaledVector(R,Sr),n.object.updateMatrixWorld()}else if(n.object.isOrthographicCamera){let Mn=new M.Vector3(P.x,P.y,0);Mn.unproject(n.object),n.object.zoom=Math.max(n.minZoom,Math.min(n.maxZoom,n.object.zoom/l)),n.object.updateProjectionMatrix(),br=!0;let Sr=new M.Vector3(P.x,P.y,0);Sr.unproject(n.object),n.object.position.sub(Sr).add(Mn),n.object.updateMatrixWorld(),Sn=y.length()}else console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."),n.zoomToCursor=!1;Sn!==null&&(n.screenSpacePanning?n.target.set(0,0,-1).transformDirection(n.object.matrix).multiplyScalar(Sn).add(n.object.position):(Yr.origin.copy(n.object.position),Yr.direction.set(0,0,-1).transformDirection(n.object.matrix),Math.abs(n.object.up.dot(Yr.direction))<wu?t.lookAt(n.target):(Qs.setFromNormalAndCoplanarPoint(n.object.up,n.target),Yr.intersectPlane(Qs,n.target))))}else n.object.isOrthographicCamera&&(n.object.zoom=Math.max(n.minZoom,Math.min(n.maxZoom,n.object.zoom/l)),n.object.updateProjectionMatrix(),br=!0);return l=1,K=!1,br||lt.distanceToSquared(n.object.position)>o||8*(1-Bt.dot(n.object.quaternion))>o||ae.distanceToSquared(n.target)>0?(n.dispatchEvent({type:"change"}),lt.copy(n.object.position),Bt.copy(n.object.quaternion),ae.copy(n.target),br=!1,!0):!1}}();let n=this,r={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_PAN:4,TOUCH_DOLLY_PAN:5,TOUCH_DOLLY_ROTATE:6},i=r.NONE,o=1e-6,s=new M.Spherical,u=new M.Spherical,l=1,c=new M.Vector3,h=new M.Vector2,p=new M.Vector2,f=new M.Vector2,d=new M.Vector2,m=new M.Vector2,_=new M.Vector2,x=new M.Vector2,E=new M.Vector2,S=new M.Vector2,R=new M.Vector3,P=new M.Vector2,K=!1,T=[],Q={};function L(y){return y!==null?2*Math.PI/60*n.autoRotateSpeed*y:2*Math.PI/60/60*n.autoRotateSpeed}function O(){return Math.pow(.95,n.zoomSpeed)}function I(y){u.theta-=y}function V(y){u.phi-=y}let it=function(){let y=new M.Vector3;return function(Y,lt){y.setFromMatrixColumn(lt,0),y.multiplyScalar(-Y),c.add(y)}}(),q=function(){let y=new M.Vector3;return function(Y,lt){n.screenSpacePanning===!0?y.setFromMatrixColumn(lt,1):(y.setFromMatrixColumn(lt,0),y.crossVectors(n.object.up,y)),y.multiplyScalar(Y),c.add(y)}}(),z=function(){let y=new M.Vector3;return function(Y,lt){let Bt=n.domElement;if(n.object.isPerspectiveCamera){let ae=n.object.position;y.copy(ae).sub(n.target);let ee=y.length();ee*=Math.tan(n.object.fov/2*Math.PI/180),it(2*Y*ee/Bt.clientHeight,n.object.matrix),q(2*lt*ee/Bt.clientHeight,n.object.matrix)}else n.object.isOrthographicCamera?(it(Y*(n.object.right-n.object.left)/n.object.zoom/Bt.clientWidth,n.object.matrix),q(lt*(n.object.top-n.object.bottom)/n.object.zoom/Bt.clientHeight,n.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),n.enablePan=!1)}}();function ge(y){n.object.isPerspectiveCamera||n.object.isOrthographicCamera?l/=y:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),n.enableZoom=!1)}function Te(y){n.object.isPerspectiveCamera||n.object.isOrthographicCamera?l*=y:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),n.enableZoom=!1)}function H(y){if(!n.zoomToCursor)return;K=!0;let b=n.domElement.getBoundingClientRect(),Y=y.clientX-b.left,lt=y.clientY-b.top,Bt=b.width,ae=b.height;P.x=Y/Bt*2-1,P.y=-(lt/ae)*2+1,R.set(P.x,P.y,1).unproject(n.object).sub(n.object.position).normalize()}function j(y){return Math.max(n.minDistance,Math.min(n.maxDistance,y))}function ut(y){h.set(y.clientX,y.clientY)}function ot(y){H(y),x.set(y.clientX,y.clientY)}function oe(y){d.set(y.clientX,y.clientY)}function se(y){p.set(y.clientX,y.clientY),f.subVectors(p,h).multiplyScalar(n.rotateSpeed);let b=n.domElement;I(2*Math.PI*f.x/b.clientHeight),V(2*Math.PI*f.y/b.clientHeight),h.copy(p),n.update()}function Ae(y){E.set(y.clientX,y.clientY),S.subVectors(E,x),S.y>0?ge(O()):S.y<0&&Te(O()),x.copy(E),n.update()}function me(y){m.set(y.clientX,y.clientY),_.subVectors(m,d).multiplyScalar(n.panSpeed),z(_.x,_.y),d.copy(m),n.update()}function En(y){H(y),y.deltaY<0?Te(O()):y.deltaY>0&&ge(O()),n.update()}function wa(y){let b=!1;switch(y.code){case n.keys.UP:y.ctrlKey||y.metaKey||y.shiftKey?V(2*Math.PI*n.rotateSpeed/n.domElement.clientHeight):z(0,n.keyPanSpeed),b=!0;break;case n.keys.BOTTOM:y.ctrlKey||y.metaKey||y.shiftKey?V(-2*Math.PI*n.rotateSpeed/n.domElement.clientHeight):z(0,-n.keyPanSpeed),b=!0;break;case n.keys.LEFT:y.ctrlKey||y.metaKey||y.shiftKey?I(2*Math.PI*n.rotateSpeed/n.domElement.clientHeight):z(n.keyPanSpeed,0),b=!0;break;case n.keys.RIGHT:y.ctrlKey||y.metaKey||y.shiftKey?I(-2*Math.PI*n.rotateSpeed/n.domElement.clientHeight):z(-n.keyPanSpeed,0),b=!0;break}b&&(y.preventDefault(),n.update())}function Mo(){if(T.length===1)h.set(T[0].pageX,T[0].pageY);else{let y=(T[0].pageX-T[0].pageY)/(T[1].pageX-T[1].pageY),b=T[0].pageY-y*T[0].pageX;n.rotateLineStart.set(y,b);let Y=.5*(T[0].pageX+T[1].pageX),lt=.5*(T[0].pageY+T[1].pageY);h.set(Y,lt)}}function wo(){if(T.length===1)d.set(T[0].pageX,T[0].pageY);else{let y=.5*(T[0].pageX+T[1].pageX),b=.5*(T[0].pageY+T[1].pageY);d.set(y,b)}}function To(){let y=T[0].pageX-T[1].pageX,b=T[0].pageY-T[1].pageY,Y=Math.sqrt(y*y+b*b);x.set(0,Y)}function Ta(){n.enableZoom&&To(),n.enablePan&&wo()}function Aa(){n.enableZoom&&To(),n.enableRotate&&Mo()}function Ao(y){if(T.length==1)p.set(y.pageX,y.pageY);else{let Y=di(y),lt=.5*(y.pageX+Y.x),Bt=.5*(y.pageY+Y.y);p.set(lt,Bt);let ae=(y.pageY-Y.y)/(y.pageX-Y.x),ee=Y.y-ae*Y.x;if(n.rotateLineEnd.set(ae,ee),Number.isFinite(n.rotateLineEnd.x)&&Number.isFinite(n.rotateLineStart.x)){let gi=(n.rotateLineStart.y-n.rotateLineEnd.y)/(n.rotateLineEnd.x-n.rotateLineStart.x),bn=ae*gi+ee;if(Number.isFinite(gi)&&Number.isFinite(bn)){let _e=Math.atan(n.rotateLineEnd.x)-Math.atan(n.rotateLineStart.x);Math.PI-Math.abs(_e)<.5&&(_e=-Math.sign(_e)*(Math.PI-Math.abs(_e))),Math.abs(_e)<.1&&(u.theta+=_e)}}n.rotateLineStart.copy(n.rotateLineEnd)}f.subVectors(p,h).multiplyScalar(n.rotateSpeed);let b=n.domElement;V(2*Math.PI*f.y/b.clientHeight),h.copy(p)}function Co(y){if(T.length===1)m.set(y.pageX,y.pageY);else{let b=di(y),Y=.5*(y.pageX+b.x),lt=.5*(y.pageY+b.y);m.set(Y,lt)}_.subVectors(m,d).multiplyScalar(n.panSpeed),z(_.x,_.y),d.copy(m)}function Io(y){let b=di(y),Y=y.pageX-b.x,lt=y.pageY-b.y,Bt=Math.sqrt(Y*Y+lt*lt);E.set(0,Bt),S.set(0,Math.pow(E.y/x.y,n.zoomSpeed)),ge(S.y),x.copy(E)}function Ca(y){n.enableZoom&&Io(y),n.enablePan&&Co(y)}function Ia(y){n.enableZoom&&Io(y),n.enableRotate&&Ao(y)}this.onPointerDown=function(b){n.enabled!==!1&&(T.length===0&&(n.domElement.setPointerCapture(b.pointerId),n.domElement.addEventListener("pointermove",n.onPointerMove),n.domElement.addEventListener("pointerup",n.onPointerUp)),Oa(b),b.pointerType==="touch"?La(b):Ra(b))},this.onPointerMove=function(b){n.enabled!==!1&&(b.pointerType==="touch"?Na(b):Pa(b))},this.onPointerUp=function(b){Da(b),T.length===0&&(n.domElement.releasePointerCapture(b.pointerId),n.domElement.removeEventListener("pointermove",n.onPointerMove),n.domElement.removeEventListener("pointerup",n.onPointerUp)),n.dispatchEvent({type:"end"}),i=r.NONE};function Ra(y){let b;switch(y.button){case 0:b=n.mouseButtons.LEFT;break;case 1:b=n.mouseButtons.MIDDLE;break;case 2:b=n.mouseButtons.RIGHT;break;default:b=-1}switch(b){case M.MOUSE.DOLLY:if(n.enableZoom===!1)return;ot(y),i=r.DOLLY;break;case M.MOUSE.ROTATE:if(y.ctrlKey||y.metaKey||y.shiftKey){if(n.enablePan===!1)return;oe(y),i=r.PAN}else{if(n.enableRotate===!1)return;ut(y),i=r.ROTATE}break;case M.MOUSE.PAN:if(y.ctrlKey||y.metaKey||y.shiftKey){if(n.enableRotate===!1)return;ut(y),i=r.ROTATE}else{if(n.enablePan===!1)return;oe(y),i=r.PAN}break;default:i=r.NONE}i!==r.NONE&&n.dispatchEvent({type:"start"})}function Pa(y){switch(i){case r.ROTATE:if(n.enableRotate===!1)return;se(y);break;case r.DOLLY:if(n.enableZoom===!1)return;Ae(y);break;case r.PAN:if(n.enablePan===!1)return;me(y);break}}this.onMouseWheel=function(b){n.enabled===!1||n.enableZoom===!1||i!==r.NONE||(b.preventDefault(),n.dispatchEvent({type:"start"}),En(b),n.dispatchEvent({type:"end"}))},this.onKeyDown=function(b){n.enabled===!1||n.enablePan===!1||wa(b)};function La(y){switch(Ro(y),T.length){case 1:switch(n.touches.ONE){case M.TOUCH.ROTATE:if(n.enableRotate===!1)return;Mo(),i=r.TOUCH_ROTATE;break;case M.TOUCH.PAN:if(n.enablePan===!1)return;wo(),i=r.TOUCH_PAN;break;default:i=r.NONE}break;case 2:switch(n.touches.TWO){case M.TOUCH.DOLLY_PAN:if(n.enableZoom===!1&&n.enablePan===!1)return;Ta(),i=r.TOUCH_DOLLY_PAN;break;case M.TOUCH.DOLLY_ROTATE:if(n.enableZoom===!1&&n.enableRotate===!1)return;Aa(),i=r.TOUCH_DOLLY_ROTATE;break;default:i=r.NONE}break;default:i=r.NONE}i!==r.NONE&&n.dispatchEvent({type:"start"})}function Na(y){switch(Ro(y),i){case r.TOUCH_ROTATE:if(n.enableRotate===!1)return;Ao(y),n.update();break;case r.TOUCH_PAN:if(n.enablePan===!1)return;Co(y),n.update();break;case r.TOUCH_DOLLY_PAN:if(n.enableZoom===!1&&n.enablePan===!1)return;Ca(y),n.update();break;case r.TOUCH_DOLLY_ROTATE:if(n.enableZoom===!1&&n.enableRotate===!1)return;Ia(y),n.update();break;default:i=r.NONE}}this.onContextMenu=function(b){n.enabled!==!1&&b.preventDefault()};function Oa(y){T.push(y)}function Da(y){delete Q[y.pointerId];for(let b=0;b<T.length;b++)if(T[b].pointerId==y.pointerId){T.splice(b,1);return}}function Ro(y){let b=Q[y.pointerId];b===void 0&&(b=new M.Vector2,Q[y.pointerId]=b),b.set(y.pageX,y.pageY)}function di(y){let b=y.pointerId===T[0].pointerId?T[1]:T[0];return Q[b.pointerId]}n.domElement.addEventListener("contextmenu",this.onContextMenu),n.domElement.addEventListener("pointerdown",this.onPointerDown),n.domElement.addEventListener("pointercancel",this.onPointerUp),n.domElement.addEventListener("wheel",this.onMouseWheel,{passive:!1}),this.update()}};var ar=class extends Zr{registryEvent(){this.addEventListener("change",this.onChange),this.context.addEventListener("update",this.tweenUpdate)}unRegistryEvent(){this.removeEventListener("change",this.onChange),this.context.removeEventListener("update",this.tweenUpdate)}setPolarAngle(t,e){e===void 0&&(e=!1);let{maxPolarAngle:n,minPolarAngle:r}=this,i=n===r;(e||t<=n&&t>=r)&&(this.maxPolarAngle=t,this.minPolarAngle=t,this.update()),i||(this.maxPolarAngle=n,this.minPolarAngle=r)}setPolarAngleByDuration(t,e,n){return g(this,null,function*(){return e===void 0&&(e=!1),n===void 0&&(n=500),n<=0?this.setPolarAngle(t,e):Gt(new Promise(r=>{let i={polar:this.getPolarAngle()},o={polar:t},s=new $e.Tween(i,this.tweenGroup).to(o,n).onUpdate(()=>{this.setPolarAngle(i.polar,e)}).onComplete(()=>{this.enabled=!0,this.tweenGroup.remove(s),r(!0)}).onStart(()=>{this.enabled=!1}).start()}),n+500)})}setAzimuthalAngle(t,e){let{maxAzimuthAngle:n,minAzimuthAngle:r}=this,i=n===r;(e||t<=n&&t>=r)&&(this.maxAzimuthAngle=t,this.minAzimuthAngle=t,this.update()),i||(this.maxAzimuthAngle=n,this.minAzimuthAngle=r)}setAzimuthalAngleDuration(t,e,n){return e===void 0&&(e=!1),n===void 0&&(n=500),n<=0?this.setAzimuthalAngle(t,e):Gt(new Promise(r=>{let i={azimuthal:this.getAzimuthalAngle()},o={azimuthal:t},s=new $e.Tween(i,this.tweenGroup).to(o,n).onUpdate(()=>{this.setAzimuthalAngle(i.azimuthal,e)}).onComplete(()=>{this.enabled=!0,this.tweenGroup.remove(s),r(!0)}).onStart(()=>{this.enabled=!1}).start()}),n+500)}getCameraLookAt(){return new Yi.Vector3().subVectors(this.target,this.camera.position)}setCameraPositionByTarget(t,e){return g(this,null,function*(){let n=this.target.clone(),r=this.getCameraLookAt();if(!e){this.camera.position.copy(t.clone().sub(r)),this.target.copy(t.clone()),this.update();return}return Gt(new Promise(i=>{let o=new $e.Tween(n,this.tweenGroup).to(t,e).onUpdate(()=>{this.camera.position.copy(n.clone().sub(r)),this.target.copy(n.clone()),this.update()}).onComplete(()=>{this.tweenGroup.remove(o),this.enabled=!0,i(!0)}).onStart(()=>{this.enabled=!1}).start()}),e+500)})}setZoom(t,e,n){n===void 0&&(n=!1);let{minZoom:r,maxZoom:i}=this;(n||t>=r&&t<=i)&&(this.camera.position.copy(e.clone().sub(this.getCameraLookAt())),this.target.copy(e),this.camera.zoom=t,this.update())}setZoomByDuration(t,e,n,r){return g(this,null,function*(){n===void 0&&(n=!1),r===void 0&&(r=500);let i={zoom:this.camera.zoom,target:this.target.clone()};if(t!==this.camera.zoom)return r?Gt(new Promise(o=>{let s=new $e.Tween(i,this.tweenGroup).to({zoom:t,target:e},r).onUpdate(()=>{this.setZoom(i.zoom,i.target,n)}).onComplete(()=>{this.tweenGroup.remove(s),this.enabled=!0,o(!0)}).onStart(()=>{this.enabled=!1}).start()}),r+500).finally(()=>{this.enabled=!0}):this.setZoom(t,e,n)})}setTargetByOffset(t,e){if(e===void 0&&(e=this.target.clone()),this.camera.updateMatrix(),t){let n=new Yi.Vector3;n.setFromMatrixColumn(this.camera.matrix,1),n.normalize(),n.multiplyScalar(t/this.camera.zoom),e.add(n)}this.setCameraPositionByTarget(e,0)}clearTween(){this.tweenGroup.getAll().forEach(t=>t.stop()),this.tweenGroup.removeAll()}dispose(){super.dispose(),this.unRegistryEvent(),this.clearTween()}constructor(t,e,n){super(e,n),this.context=t,this.camera=e,this.domElement=n,this.prevCameraZoom=1,this.tweenGroup=new $e.Group,this.offsetY=0,this.onChange=()=>{let r=this.camera.zoom;r!==this.prevCameraZoom&&(this.prevCameraZoom=r,this.dispatchEvent({type:"change-zoom",zoom:r}))},this.tweenUpdate=()=>{this.tweenGroup.update()},this.enableDamping=!1,this.zoomSpeed=.5,this.prevCameraZoom=e.zoom,this.registryEvent()}};var pn=require("three");var ur=class extends pn.WebGLRenderer{setCameraAndScene(t,e){this.scene=t,this.camera=e}autoRender(){this.scene&&this.camera&&this.enable&&(this.event.dispatchEvent({type:"update"}),this.render(this.scene,this.camera)),this.timer.requestAnimationFrame(()=>{this.autoRender()})}pauseRender(){this.enable=!1}continueRender(){this.enable=!0}addEventListener(t,e){this.event.addEventListener(t,e)}removeEventListener(t,e){this.event.removeEventListener(t,e)}constructor(t){super(v({antialias:!0,alpha:!0},t)),this.event=new pn.EventDispatcher,this.enable=!0,this.timer=new $,this.autoClear=!0,this.setPixelRatio(window.devicePixelRatio),this.toneMapping=pn.LinearToneMapping,this.toneMappingExposure=1;let e=this.dispose;this.dispose=()=>{this.timer.dispose(),this.enable=!1,e.call(this),this.domElement.remove(),this.domElement=null,this.shadowMap=null,this.info.programs&&(this.info.programs.length=0),this.info=null}}};var ra=require("three");var ta=require("three"),ea=require("three/examples/jsm/environments/RoomEnvironment.js");function na(a,t){t===void 0&&(t=.85);let e=new ta.PMREMGenerator(a);return e.compileEquirectangularShader(),e.fromScene(new ea.RoomEnvironment).texture}var lr=class extends ra.Scene{dispose(){var t;(t=this.environment)==null||t.dispose(),this.environment=null,F(this),this.clear()}constructor(t){super(),this.environment=na(t)}};var ia=require("three"),cr=class extends ia.OrthographicCamera{constructor(t,e){super(-t/2,t/2,e/2,-e/2,-1e4,5e4),this.up.set(0,0,1),this.position.set(0,0,100),this.lookAt(0,0,0)}};var Zi=require("@turf/turf");var Ry=require("core-js/modules/es.array.unshift.js"),Py=require("core-js/modules/es.array.push.js"),oa=require("three"),Kr=class{registryEvent(){this.context.addEventListener("update",this.onUpdate),this.context.addEventListener("control-change",this.onControlChange),this.context.addEventListener("resize",this.onControlChange)}unRegistryEvent(){this.context.removeEventListener("update",this.onUpdate),this.context.removeEventListener("control-change",this.onControlChange),this.context.removeEventListener("resize",this.onControlChange)}changePoiLevelOrCollisionEnable(t){let e=this.objects.findIndex(n=>n===t);e!==-1&&(this.objects.splice(e,1),this.addObject(t))}addObject(t){if(!this.objects.includes(t)){if(this.needsUpdate=!0,!t.options.collision_enable){this.objects.unshift(t);return}if(t.options.level===0){this.objects.push(t);return}for(let e=0;e<this.objects.length;e++){let n=this.objects[e];if(n.options.collision_enable&&n.options.level<=t.options.level){this.objects.splice(e,0,t);return}}this.objects.push(t)}}removeObject(t){let e=this.objects.indexOf(t);e!==-1&&(this.objects.splice(e,1),this.needsUpdate=!0)}removeObjects(t){this.objects=this.objects.filter(e=>!t.includes(e)),this.needsUpdate=!0}getObjectById(t){return this.objects.find(e=>e.options.id===t)||null}validShowParkingSpace(t){t===void 0&&(t=60);let{clientSize:{width:e,height:n},control:r,camera:i}=this.context,o=Math.min(e/t,n/t,r.maxZoom-1);return i.zoom>=o}detectCollisions(){if(!this.needsUpdate)return;let t=[],{camera:e}=this.context;e.updateMatrixWorld();let n=c=>c<=1&&c>=-1,r=e.projectionMatrix.clone();r.multiply(e.matrixWorldInverse);let i=e.zoom/this.context.basicZoom,o=25/30,s=Math.min(25,Math.max(1,i*o)),u=this.validShowParkingSpace();this.objects.filter(c=>{if(c.visible){if(!(s<=c.options.maxWeight&&s>=c.options.minWeight)||!u&&c.userData.type==="parkingSpace")return c.parentSetVisible(!1),!1;let h=c.getWorldPosition(new oa.Vector3);return h.applyMatrix4(r),c.screenPosition=h,n(h.x)&&n(h.y)&&n(h.z)?!0:(c.parentSetVisible(!1),!1)}return!1}).forEach((c,h)=>{let p=c.getBox(c.screenPosition);if(p===null){c.parentSetVisible(!1);return}if(h===0||!c.options.collision_enable){t.push(p),c.parentSetVisible(!0);return}let f=t.some(d=>d.intersectsBox(p));c.parentSetVisible(!f),f||t.push(p)}),this.needsUpdate=!1}markForUpdate(){this.needsUpdate=!0}clear(){this.objects=[],this.needsUpdate=!0}dispose(){this.objects=[],this.unRegistryEvent()}constructor(t){this.context=t,this.objects=[],this.needsUpdate=!0,this.onUpdate=()=>{this.detectCollisions()},this.onControlChange=()=>{this.needsUpdate=!0},this.registryEvent()}};var hr=class extends k.EventDispatcher{get config(){return this.bmap.config}get center(){return this.bmap.buildingCenter}setRange(t){this.range=(0,Zi.polygon)([t])}resizeClientSize(){let{x:t,y:e,width:n,height:r}=this.container.getBoundingClientRect();this.clientSize={width:n||this.container.clientWidth,height:r||this.container.clientHeight,x:t,y:e}}init(){let{clientWidth:t,clientHeight:e}=this.container;this.camera=new cr(t,e),this.renderer.setSize(t,e),this.renderer.setCameraAndScene(this.scene,this.camera),this.renderer.autoRender(),this.control=new ar(this,this.camera,this.renderer.domElement),this.control.maxPolarAngle=this.config.control.maxPolar,this.container.appendChild(this.renderer.domElement),this.scene.add(this.lights),this.basicRatio=this.getRatio(),this.control.addEventListener("change",this.onControlChange),this.control.addEventListener("change-zoom",this.onControlChangeZoom),this.renderer.addEventListener("update",this.onRendererUpdate),this.cameraBound=new jr(this)}getRatio(t,e){t===void 0&&(t=new k.Vector3(0,0,0)),e===void 0&&(e=new k.Vector3(100,0,0));let{clientWidth:n,clientHeight:r}=this.container,i=N(t,this.camera,n,r),o=N(e,this.camera,n,r);return Math.ceil(Math.sqrt((o.x-i.x)**2+(o.y-i.y)**2))}changeAmbientLightColor(t){this.lights.children.forEach(e=>{e instanceof k.AmbientLight&&(e.color=new k.Color(t))})}switchFloor(t,e){e===void 0&&(e=!0),console.log("switchFloor",e),this.currentFloor&&(this.scene.remove(this.currentFloor),e?this.currentFloor.dispose():this.currentFloor.onRemoveFromScene()),this.currentFloor=t,this.setRange(t.userData.range||[]),this.scene.add(t),t.onAddToScene("scene"),this.cameraBound.updateBox()}getGraphicsByDeviceXy(t,e){var n;let r=new k.Vector2;r.x=t/this.clientSize.width*2-1,r.y=e/this.clientSize.height*-2+1;let i=new k.Raycaster;return i.setFromCamera(r,this.camera),i.ray.origin.sub(i.ray.direction.clone().multiplyScalar(100)),((n=this.currentFloor)==null?void 0:n.graphicLayer.getGraphicByRaycaster(i))||{graphics:[],position:null}}getPoisByDeviceXy(t,e){var n,r;let i=(n=this.currentFloor)==null?void 0:n.poiLayer.getPoiByDeviceXy(t,e),o=(r=this.currentFloor)==null?void 0:r.poiLayer2.getPoiByDeviceXy(t,e);return(i||[]).concat(o||[])}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),this.control.removeEventListener("change",this.onControlChange),this.control.removeEventListener("change-zoom",this.onControlChangeZoom),this.renderer.removeEventListener("update",this.onRendererUpdate)}setPolarAngle(t,e){return e===void 0&&(e=500),this.control.setPolarAngleByDuration(t,!0,e)}setAzimuthalAngle(t,e){return e===void 0&&(e=500),this.control.setAzimuthalAngleDuration(t,!0,e)}getCameraLookAt(){return this.control.getCameraLookAt()}setZoom(t,e,n){return n===void 0&&(n=500),this.control.setZoomByDuration(t,e,!0,n)}getFitCameraToObjectZoom(t,e,n){return e===void 0&&(e=[20,20,20,20]),n===void 0&&(n=!0),this.getFitCameraToBoxZoom(new k.Box3().setFromObject(t),e,n)}getFitCameraToBoxZoom(t,e,n){e===void 0&&(e=[20,20,20,20]),n===void 0&&(n=!0);let[r,i,o,s]=e,{clientSize:{width:u,height:l}}=this,c=this.control.getPolarAngle();n&&this.setPolarAngle(0,0),this.setPolarAngle(c,0);let{max:h,min:p}=t,f=new k.Vector3(p.x,h.y,h.z),d=new k.Vector3(h.x,h.y,h.z),m=new k.Vector3(h.x,p.y,p.z),_=new k.Vector3(p.x,p.y,p.z),x=N(f,this.camera,u,l),E=N(d,this.camera,u,l),S=N(_,this.camera,u,l),R=N(m,this.camera,u,l),K=new k.Box2().setFromPoints([new k.Vector2(x.x,x.y),new k.Vector2(E.x,E.y),new k.Vector2(S.x,S.y),new k.Vector2(R.x,R.y)]).getSize(new k.Vector2),T=(u-i-s)/K.x,Q=(l-r-o)/K.y,L=Math.min(T,Q),O=new k.Vector3((h.x+p.x)/2,(h.y+p.y)/2,(h.z+p.z)/2),I=L*this.camera.zoom,V=this.camera.clone();V.zoom=I,V.updateMatrix();let it=(i-s)/2,q=(r-o)/2;if(it){let z=new k.Vector3;z.setFromMatrixColumn(V.matrix,0),z.normalize(),z.multiplyScalar(it/I),O.add(z)}if(q){let z=new k.Vector3;z.setFromMatrixColumn(V.matrix,1),z.normalize(),z.multiplyScalar(q/I),O.add(z)}return{zoom:L*this.camera.zoom,center:O}}fitCameraToObject(t,e,n,r){e===void 0&&(e=[20,20,20,20]),n===void 0&&(n=500),r===void 0&&(r=!0);let{zoom:i,center:o}=this.getFitCameraToObjectZoom(t,e,r);return this.setZoom(i,o,n)}fitCameraToBox(t,e,n,r){e===void 0&&(e=[20,20,20,20]),n===void 0&&(n=500),r===void 0&&(r=!0);let{zoom:i,center:o}=this.getFitCameraToBoxZoom(t,e,r);return this.setZoom(i,o,n)}getFitCameraToGroundZoom(t,e,n){if(t===void 0&&(t=[20,20,20,20]),e===void 0&&(e=500),n===void 0&&(n=!0),this.currentFloor&&this.currentFloor.hasElement)return this.getFitCameraToObjectZoom(this.currentFloor.groundUpper,t,n).zoom}fitCameraToGround(t,e,n){return t===void 0&&(t=[20,20,20,20]),e===void 0&&(e=500),n===void 0&&(n=!0),this.currentFloor&&this.currentFloor.hasElement?this.fitCameraToObject(this.currentFloor.groundLayer,t,e,n):Promise.resolve(!1)}setCameraPosition(t,e){return g(this,null,function*(){return this.control.setCameraPositionByTarget(t,e)})}pauseRender(){this.renderer.pauseRender()}continueRender(){this.renderer.continueRender()}forceUpdate(){this.collisionSystem.needsUpdate=!0}dispose(){var t;this.collisionSystem.dispose(),(t=this.currentFloor)==null||t.dispose(),this.control.dispose(),this.cameraBound.dispose(),this.selection.dispose(),this.hoverHelper.dispose(),this.unRegistryEvent(),this.renderer.dispose(),this.lights.children.forEach(e=>e.dispose()),this.scene.dispose(),this.container=null,this.renderer=null}constructor(t,e){super(),this.container=t,this.renderer=new ur,this.lights=yi(),this.range=(0,Zi.polygon)([]),this.clientSize={width:0,height:0,x:0,y:0},this.renderRf=0,this.basicZoom=1,this.onControlChange=()=>{this.dispatchEvent({type:"change-ratio",px:(this.basicRatio||0)*this.camera.zoom}),this.dispatchEvent({type:"control-change"})},this.onControlChangeZoom=n=>{let{zoom:r}=n;this.dispatchEvent({type:"control-zoom-change",zoom:r})},this.onRendererUpdate=()=>{this.dispatchEvent({type:"update"})},this.onWindowResize=()=>{let{container:n,camera:r,renderer:i}=this,{clientWidth:o,clientHeight:s}=n;o=Math.max(1,o),s=Math.max(1,s),r.left=-o/2,r.right=o/2,r.top=s/2,r.bottom=-s/2,r.updateProjectionMatrix(),i.setSize(o,s),this.resizeClientSize(),this.dispatchEvent({type:"resize",width:o,height:s})},this.onClick=n=>{let{graphics:r,position:i}=this.getGraphicsByDeviceXy(n.offsetX,n.offsetY);r.length&&this.dispatchEvent({type:"graphic-click",graphics:r,position:i});let o=this.getPoisByDeviceXy(n.offsetX,n.offsetY);o.length&&this.dispatchEvent({type:"poi-click",pois:o})},this.onPointerover=n=>{let{graphics:r,position:i}=this.getGraphicsByDeviceXy(n.offsetX,n.offsetY),o=this.getPoisByDeviceXy(n.offsetX,n.offsetY);this.dispatchEvent({type:"pointer-over",e:n,graphics:r,pois:o,position:i})},this.onPointermove=n=>{let{graphics:r,position:i}=this.getGraphicsByDeviceXy(n.offsetX,n.offsetY),o=this.getPoisByDeviceXy(n.offsetX,n.offsetY);this.dispatchEvent({type:"pointer-move",e:n,graphics:r,pois:o,position:i})},this.onPointerleave=n=>{this.dispatchEvent({type:"pointer-level"})},this.onSelectionSelect=n=>{let{graphics:r,isMultipleSelect:i}=n;this.dispatchEvent({type:"select-graphic",graphics:r,isMultipleSelect:i})},this.onHoverChange=n=>{let{graphics:r}=n;this.dispatchEvent({type:"hover",graphics:r})},this.bmap=e,this.container.style.position="relative",this.container.style.overflow="hidden",this.scene=new lr(this.renderer),this.collisionSystem=new Kr(this),this.init(),this.selection=new ir(this),this.hoverHelper=new or(this),this.resizeClientSize(),this.registryEvent()}};var sa=require("lodash"),aa={placeId:0,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",loadPlaceInfo:"https://screen.aibee.cn/ai-map/map/get-floor-map"},enableBoxSelect:!0,resizeObserver:!1,initTransToMark:!1,heatMap:{radius:50,minOpacity:.1,gradient:{0:"#8F9FCD",.5:"#6284FF",1:"#F95D5D"}},useFloorCache:!0,control:{maxPolar:1.2,defaultPolar:1.1,defaultAzimuthal:0,maxZoomScale:30},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},loaderPlaceConfig:{textFontSize:14}};function Ki(a){return(0,sa.merge)({},aa,a)}var ha=require("lodash");var iv=require("core-js/modules/web.dom-collections.iterator.js");var Qr=require("three");var Ky=require("core-js/modules/es.array.push.js"),$y=require("core-js/modules/web.dom-collections.iterator.js");var qy=require("core-js/modules/es.array.sort.js");var fn=function(a){return a.LAYERED_RENDER_VERSION="layeredRender",a.MERGED_RENDER_VERSION="mergedRender",a}({});function $r(a,t){let e=a.poi_info.showName||a.store_name||a.poi_info.text;switch(t){case"zh-cn":return e;case"en":var n;return((n=a.store_info_ext)==null?void 0:n.poi_name)||e;case"zh-hk":var r;return((r=a.store_info_ext)==null?void 0:r.traditional_name)||e}}function Jr(a,t){let e=a.poi_info.showName||a.store_name||a.poi_info.text;switch(t){case"zh-cn":return e;case"en":var n;return((n=a.infra_info_ext)==null?void 0:n.poi_name)||e;case"zh-hk":var r;return((r=a.infra_info_ext)==null?void 0:r.traditional_name)||e}}var $i=["range","ground","store","facility","parkingSpace"];function ua(a){return $i.indexOf(a.l_type)===-1?$i.length:$i.indexOf(a.l_type)}function Tu(a){a.layers.sort((t,e)=>ua(t)-ua(e))}function Au(a){let t=a.layers.find(n=>n.l_type==="range"),e=[t.elements[0].center_x,t.elements[0].center_y];a.layers.map(n=>{if(n.l_type!=="range")return Ln(n.elements,e)})}function pr(a){Tu(a),Au(a)}function dn(a,t){return t===void 0&&(t=5),a.floor_id+"_"+a.version_id+(t?"_"+t:"")}function la(a,t,e){switch(a.l_type){case"ground":return Ji(a,t);case"graph":return Cu(a,t);case"wall":return Iu(a,t);case"lane":return Ru(a,t);case"texture2d":case"texture3d":return Pu(a,t);case"glb":return Lu(a,t);case"store":return Nu(a,t,e);case"facility":return Du(a,t,e);case"parkingSpace":return Fu(a,t,e);case"text":return zu(a,t)}}function ca(a,t,e,n,r){switch(a.l_type){case"store":return Ou(a,t,e,n,r);case"facility":return Uu(a,t,e,n,r);case"parkingSpace":return Bu(a,t,n,r)}}function Cu(a,t){t.mergeGraphicLayer.addGraphics(a.elements,a.mergedElements)}function Ji(a,t){let e=a.elements.map(n=>new mt(t.context,v({},n,{dashed:!1})));t.addGrounds(e)}function Iu(a,t){if(a.mergedElements)a.mergedElements.map(e=>{if(e.instancedGeometry){let n=new rr(t.context,e.instancedGeometry);t.wallLayer.add(n)}if(e.mergedGeometry){let n=new er(t.context,e);t.wallLayer.add(n)}});else{let e=a.elements.reduce((n,r)=>{let{fillColor:i,fillOpacity:o,strokeColor:s,strokeOpacity:u,height:l}=r,c=i.toLowerCase()+"-"+o+"-"+s.toLowerCase()+"-"+u+"-"+l;return u===0&&(c=i.toLowerCase()+"-"+o+"-"+l),n[c]?n[c].push(r):n[c]=[r],n},{});Object.values(e).forEach(n=>{let r=new Jn(t.context,n);t.wallLayer.add(r)})}}function Ru(a,t){if(a.mergedElements){let e=new nr(t.context,a.mergedElements);t.laneLayer.add(e)}else{let e=new Qn(t.context,a.elements);t.laneLayer.add(e)}}function Pu(a,t){if(a.mergedMatrixes)a.mergedMatrixes.map(e=>{let n=new Ne(t.context,e);t.textureLayer.add(n)});else if(a.elements.length){let e=new Le(t.context,a.elements);t.textureLayer.add(e)}}function Lu(a,t){t.glbModelLayer.addModels(a.elements.map(e=>v({},e,{url:e.secondUrl,rotate:e.secondRotate,width:e.secondWidth,center_x:e.center_coord_x,center_y:e.center_coord_y,deltaHeight:0})))}function Nu(a,t,e){e.mergeGraphic?t.mergeGraphicLayer.addGraphics(a.elements,a.mergedElements):a.elements.map(n=>{let r=t.addGraphic(v({},n,{dashed:!1}));t.userData.graphics.push(r),t.userData.graphicMap.set(n.id,r)})}function Ou(a,t,e,n,r){a.elements.filter(i=>r.filterPoi(i)).map(i=>{try{let o=$r(i,e),s=new st(t.context,{id:i.id,icon:i.poi_info.showImageUrl||i.poi_info.icon,text:o,position:{x:i.center_coord_x,y:i.center_coord_y,z:i.airHeight+i.height},icon_size:[24,24],level:i.poi_info.level||0,hide_text:!n.showStoreName,maxWeight:i.poi_info.maxWeight||25,minWeight:i.poi_info.minWeight||1,text_font_size:n.textFontSize});t.poiLayer2.pushPoi(s),s&&(s.userData.type="store",s.userData.data=i,s.userData.floor=t.name)}catch(o){console.log("\u521B\u5EFA\u5E97\u94FApoi\u5931\u8D25",o,i)}})}function Du(a,t,e){e.mergeGraphic?t.mergeGraphicLayer.addGraphics(a.elements,a.mergedElements):a.elements.map(n=>{let r=t.addGraphic(v({},n,{dashed:!1}));t.userData.graphics.push(r),t.userData.graphicMap.set(n.id,r)})}function Uu(a,t,e,n,r){a.elements.filter(i=>i.poi_info).filter(i=>r.filterPoi(i)).map(i=>{try{let o=Jr(i,e),s=new st(t.context,{id:i.id,icon:i.poi_info.showImageUrl||i.poi_info.icon,text:o,position:{x:i.center_coord_x,y:i.center_coord_y,z:i.airHeight+i.height},icon_size:[24,24],level:i.poi_info.level||0,hide_text:!n.showFacilityName,maxWeight:i.poi_info.maxWeight||25,minWeight:i.poi_info.minWeight||1,text_font_size:n.textFontSize});t.poiLayer2.pushPoi(s),s.userData.type="facility",s.userData.data=i,s.userData.floor=t.name}catch(o){console.log("\u6DFB\u52A0facility\u5931\u8D25",o,i)}})}function Fu(a,t,e){t.parkingSpaceLayer.load(a,e.mergeParkingSpace),t.userData.parkingSpaces=t.parkingSpaceLayer.graphicMap.values(),t.userData.parkingSpacesGraphicMap=t.parkingSpaceLayer.graphicMap}function Bu(a,t,e,n){return g(this,null,function*(){a.elements.filter(i=>i.texts[0]).filter(i=>n.filterPoi(i)).forEach(i=>{try{let o=i.displayName||i.texts[0],s=new st(t.context,{id:i.id,text:o,position:{x:i.center_coord_x,y:i.center_coord_y,z:i.airHeight+i.height},text_font_size:e.textFontSize});s&&(s.userData.type="parkingSpace",s.userData.data=i,s.userData.floor=t.name),t.poiLayer2.pushPoi(s)}catch(o){console.log("\u6DFB\u52A0\u8F66\u4F4Dpoi\u5931\u8D25",o,i)}})})}function zu(a,t){let e=new tr(t.context,a.elements.map(n=>v({},n,{center_x:n.center_coord_x,center_y:n.center_coord_y})));t.textTextureLayer.add(e)}function Qi(){let a=new Blob([`var $D=Object.create;var U1=Object.defineProperty;var ZD=Object.getOwnPropertyDescriptor;var JD=Object.getOwnPropertyNames;var jD=Object.getPrototypeOf,KD=Object.prototype.hasOwnProperty;var X=(n,t)=>()=>(t||n((t={exports:{}}).exports,t),t.exports);var QD=(n,t,e,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of JD(t))!KD.call(n,s)&&s!==e&&U1(n,s,{get:()=>t[s],enumerable:!(i=ZD(t,s))||i.enumerable});return n};var jt=(n,t,e)=>(e=n!=null?$D(jD(n)):{},QD(t||!n||!n.__esModule?U1(e,"default",{value:n,enumerable:!0}):e,n));var Ri=(n,t,e)=>new Promise((i,s)=>{var u=p=>{try{f(e.next(p))}catch(d){s(d)}},c=p=>{try{f(e.throw(p))}catch(d){s(d)}},f=p=>p.done?i(p.value):Promise.resolve(p.value).then(u,c);f((e=e.apply(n,t)).next())});var Sn=X((zg,B1)=>{"use strict";var Mc=function(n){return n&&n.Math===Math&&n};B1.exports=Mc(typeof globalThis=="object"&&globalThis)||Mc(typeof window=="object"&&window)||Mc(typeof self=="object"&&self)||Mc(typeof global=="object"&&global)||Mc(typeof zg=="object"&&zg)||function(){return this}()||Function("return this")()});var An=X((vet,z1)=>{"use strict";z1.exports=function(n){try{return!!n()}catch(t){return!0}}});var ri=X((_et,G1)=>{"use strict";var t3=An();G1.exports=!t3(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!==7})});var bc=X((xet,k1)=>{"use strict";var e3=An();k1.exports=!e3(function(){var n=function(){}.bind();return typeof n!="function"||n.hasOwnProperty("prototype")})});var vr=X((Eet,q1)=>{"use strict";var n3=bc(),th=Function.prototype.call;q1.exports=n3?th.bind(th):function(){return th.apply(th,arguments)}});var X1=X(W1=>{"use strict";var V1={}.propertyIsEnumerable,H1=Object.getOwnPropertyDescriptor,r3=H1&&!V1.call({1:2},1);W1.f=r3?function(t){var e=H1(this,t);return!!e&&e.enumerable}:V1});var Ac=X((Met,Y1)=>{"use strict";Y1.exports=function(n,t){return{enumerable:!(n&1),configurable:!(n&2),writable:!(n&4),value:t}}});var In=X((bet,J1)=>{"use strict";var $1=bc(),Z1=Function.prototype,Gg=Z1.call,i3=$1&&Z1.bind.bind(Gg,Gg);J1.exports=$1?i3:function(n){return function(){return Gg.apply(n,arguments)}}});var vs=X((Aet,K1)=>{"use strict";var j1=In(),o3=j1({}.toString),s3=j1("".slice);K1.exports=function(n){return s3(o3(n),8,-1)}});var eh=X((Tet,Q1)=>{"use strict";var a3=In(),u3=An(),l3=vs(),kg=Object,c3=a3("".split);Q1.exports=u3(function(){return!kg("z").propertyIsEnumerable(0)})?function(n){return l3(n)==="String"?c3(n,""):kg(n)}:kg});var nh=X((Cet,tE)=>{"use strict";tE.exports=function(n){return n==null}});var zu=X((Iet,eE)=>{"use strict";var f3=nh(),h3=TypeError;eE.exports=function(n){if(f3(n))throw new h3("Can't call method on "+n);return n}});var Gu=X((Pet,nE)=>{"use strict";var p3=eh(),d3=zu();nE.exports=function(n){return p3(d3(n))}});var er=X((Ret,rE)=>{"use strict";var qg=typeof document=="object"&&document.all;rE.exports=typeof qg=="undefined"&&qg!==void 0?function(n){return typeof n=="function"||n===qg}:function(n){return typeof n=="function"}});var Ei=X((Let,iE)=>{"use strict";var g3=er();iE.exports=function(n){return typeof n=="object"?n!==null:g3(n)}});var $s=X((Net,oE)=>{"use strict";var Vg=Sn(),m3=er(),y3=function(n){return m3(n)?n:void 0};oE.exports=function(n,t){return arguments.length<2?y3(Vg[n]):Vg[n]&&Vg[n][t]}});var Tc=X((Oet,sE)=>{"use strict";var v3=In();sE.exports=v3({}.isPrototypeOf)});var ku=X((Det,lE)=>{"use strict";var _3=Sn(),aE=_3.navigator,uE=aE&&aE.userAgent;lE.exports=uE?String(uE):""});var Cc=X((Fet,gE)=>{"use strict";var dE=Sn(),Hg=ku(),cE=dE.process,fE=dE.Deno,hE=cE&&cE.versions||fE&&fE.version,pE=hE&&hE.v8,wo,rh;pE&&(wo=pE.split("."),rh=wo[0]>0&&wo[0]<4?1:+(wo[0]+wo[1]));!rh&&Hg&&(wo=Hg.match(/Edge\\/(\\d+)/),(!wo||wo[1]>=74)&&(wo=Hg.match(/Chrome\\/(\\d+)/),wo&&(rh=+wo[1])));gE.exports=rh});var ih=X((Uet,yE)=>{"use strict";var mE=Cc(),x3=An(),E3=Sn(),S3=E3.String;yE.exports=!!Object.getOwnPropertySymbols&&!x3(function(){var n=Symbol("symbol detection");return!S3(n)||!(Object(n)instanceof Symbol)||!Symbol.sham&&mE&&mE<41})});var Wg=X((Bet,vE)=>{"use strict";var w3=ih();vE.exports=w3&&!Symbol.sham&&typeof Symbol.iterator=="symbol"});var Ic=X((zet,_E)=>{"use strict";var M3=$s(),b3=er(),A3=Tc(),T3=Wg(),C3=Object;_E.exports=T3?function(n){return typeof n=="symbol"}:function(n){var t=M3("Symbol");return b3(t)&&A3(t.prototype,C3(n))}});var qu=X((Get,xE)=>{"use strict";var I3=String;xE.exports=function(n){try{return I3(n)}catch(t){return"Object"}}});var _s=X((ket,EE)=>{"use strict";var P3=er(),R3=qu(),L3=TypeError;EE.exports=function(n){if(P3(n))return n;throw new L3(R3(n)+" is not a function")}});var Pc=X((qet,SE)=>{"use strict";var N3=_s(),O3=nh();SE.exports=function(n,t){var e=n[t];return O3(e)?void 0:N3(e)}});var ME=X((Vet,wE)=>{"use strict";var Xg=vr(),Yg=er(),$g=Ei(),D3=TypeError;wE.exports=function(n,t){var e,i;if(t==="string"&&Yg(e=n.toString)&&!$g(i=Xg(e,n))||Yg(e=n.valueOf)&&!$g(i=Xg(e,n))||t!=="string"&&Yg(e=n.toString)&&!$g(i=Xg(e,n)))return i;throw new D3("Can't convert object to primitive value")}});var Rc=X((Het,bE)=>{"use strict";bE.exports=!1});var oh=X((Wet,TE)=>{"use strict";var AE=Sn(),F3=Object.defineProperty;TE.exports=function(n,t){try{F3(AE,n,{value:t,configurable:!0,writable:!0})}catch(e){AE[n]=t}return t}});var sh=X((Xet,PE)=>{"use strict";var U3=Rc(),B3=Sn(),z3=oh(),CE="__core-js_shared__",IE=PE.exports=B3[CE]||z3(CE,{});(IE.versions||(IE.versions=[])).push({version:"3.42.0",mode:U3?"pure":"global",copyright:"\\xA9 2014-2025 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.42.0/LICENSE",source:"https://github.com/zloirock/core-js"})});var ah=X((Yet,LE)=>{"use strict";var RE=sh();LE.exports=function(n,t){return RE[n]||(RE[n]=t||{})}});var Vi=X(($et,NE)=>{"use strict";var G3=zu(),k3=Object;NE.exports=function(n){return k3(G3(n))}});var oo=X((Zet,OE)=>{"use strict";var q3=In(),V3=Vi(),H3=q3({}.hasOwnProperty);OE.exports=Object.hasOwn||function(t,e){return H3(V3(t),e)}});var uh=X((Jet,DE)=>{"use strict";var W3=In(),X3=0,Y3=Math.random(),$3=W3(1 .toString);DE.exports=function(n){return"Symbol("+(n===void 0?"":n)+")_"+$3(++X3+Y3,36)}});var Xr=X((jet,UE)=>{"use strict";var Z3=Sn(),J3=ah(),FE=oo(),j3=uh(),K3=ih(),Q3=Wg(),Vu=Z3.Symbol,Zg=J3("wks"),tF=Q3?Vu.for||Vu:Vu&&Vu.withoutSetter||j3;UE.exports=function(n){return FE(Zg,n)||(Zg[n]=K3&&FE(Vu,n)?Vu[n]:tF("Symbol."+n)),Zg[n]}});var Jg=X((Ket,GE)=>{"use strict";var eF=vr(),BE=Ei(),zE=Ic(),nF=Pc(),rF=ME(),iF=Xr(),oF=TypeError,sF=iF("toPrimitive");GE.exports=function(n,t){if(!BE(n)||zE(n))return n;var e=nF(n,sF),i;if(e){if(t===void 0&&(t="default"),i=eF(e,n,t),!BE(i)||zE(i))return i;throw new oF("Can't convert object to primitive value")}return t===void 0&&(t="number"),rF(n,t)}});var lh=X((Qet,kE)=>{"use strict";var aF=Jg(),uF=Ic();kE.exports=function(n){var t=aF(n,"string");return uF(t)?t:t+""}});var ch=X((tnt,VE)=>{"use strict";var lF=Sn(),qE=Ei(),jg=lF.document,cF=qE(jg)&&qE(jg.createElement);VE.exports=function(n){return cF?jg.createElement(n):{}}});var Kg=X((ent,HE)=>{"use strict";var fF=ri(),hF=An(),pF=ch();HE.exports=!fF&&!hF(function(){return Object.defineProperty(pF("div"),"a",{get:function(){return 7}}).a!==7})});var fh=X(XE=>{"use strict";var dF=ri(),gF=vr(),mF=X1(),yF=Ac(),vF=Gu(),_F=lh(),xF=oo(),EF=Kg(),WE=Object.getOwnPropertyDescriptor;XE.f=dF?WE:function(t,e){if(t=vF(t),e=_F(e),EF)try{return WE(t,e)}catch(i){}if(xF(t,e))return yF(!gF(mF.f,t,e),t[e])}});var Qg=X((rnt,YE)=>{"use strict";var SF=ri(),wF=An();YE.exports=SF&&wF(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!==42})});var so=X((int,$E)=>{"use strict";var MF=Ei(),bF=String,AF=TypeError;$E.exports=function(n){if(MF(n))return n;throw new AF(bF(n)+" is not an object")}});var Wo=X(JE=>{"use strict";var TF=ri(),CF=Kg(),IF=Qg(),hh=so(),ZE=lh(),PF=TypeError,tm=Object.defineProperty,RF=Object.getOwnPropertyDescriptor,em="enumerable",nm="configurable",rm="writable";JE.f=TF?IF?function(t,e,i){if(hh(t),e=ZE(e),hh(i),typeof t=="function"&&e==="prototype"&&"value"in i&&rm in i&&!i[rm]){var s=RF(t,e);s&&s[rm]&&(t[e]=i.value,i={configurable:nm in i?i[nm]:s[nm],enumerable:em in i?i[em]:s[em],writable:!1})}return tm(t,e,i)}:tm:function(t,e,i){if(hh(t),e=ZE(e),hh(i),CF)try{return tm(t,e,i)}catch(s){}if("get"in i||"set"in i)throw new PF("Accessors not supported");return"value"in i&&(t[e]=i.value),t}});var xs=X((snt,jE)=>{"use strict";var LF=ri(),NF=Wo(),OF=Ac();jE.exports=LF?function(n,t,e){return NF.f(n,t,OF(1,e))}:function(n,t,e){return n[t]=e,n}});var ph=X((ant,QE)=>{"use strict";var im=ri(),DF=oo(),KE=Function.prototype,FF=im&&Object.getOwnPropertyDescriptor,om=DF(KE,"name"),UF=om&&function(){}.name==="something",BF=om&&(!im||im&&FF(KE,"name").configurable);QE.exports={EXISTS:om,PROPER:UF,CONFIGURABLE:BF}});var am=X((unt,tS)=>{"use strict";var zF=In(),GF=er(),sm=sh(),kF=zF(Function.toString);GF(sm.inspectSource)||(sm.inspectSource=function(n){return kF(n)});tS.exports=sm.inspectSource});var rS=X((lnt,nS)=>{"use strict";var qF=Sn(),VF=er(),eS=qF.WeakMap;nS.exports=VF(eS)&&/native code/.test(String(eS))});var dh=X((cnt,oS)=>{"use strict";var HF=ah(),WF=uh(),iS=HF("keys");oS.exports=function(n){return iS[n]||(iS[n]=WF(n))}});var gh=X((fnt,sS)=>{"use strict";sS.exports={}});var Va=X((hnt,lS)=>{"use strict";var XF=rS(),uS=Sn(),YF=Ei(),$F=xs(),um=oo(),lm=sh(),ZF=dh(),JF=gh(),aS="Object already initialized",cm=uS.TypeError,jF=uS.WeakMap,mh,Lc,yh,KF=function(n){return yh(n)?Lc(n):mh(n,{})},QF=function(n){return function(t){var e;if(!YF(t)||(e=Lc(t)).type!==n)throw new cm("Incompatible receiver, "+n+" required");return e}};XF||lm.state?(Mo=lm.state||(lm.state=new jF),Mo.get=Mo.get,Mo.has=Mo.has,Mo.set=Mo.set,mh=function(n,t){if(Mo.has(n))throw new cm(aS);return t.facade=n,Mo.set(n,t),t},Lc=function(n){return Mo.get(n)||{}},yh=function(n){return Mo.has(n)}):(qa=ZF("state"),JF[qa]=!0,mh=function(n,t){if(um(n,qa))throw new cm(aS);return t.facade=n,$F(n,qa,t),t},Lc=function(n){return um(n,qa)?n[qa]:{}},yh=function(n){return um(n,qa)});var Mo,qa;lS.exports={set:mh,get:Lc,has:yh,enforce:KF,getterFor:QF}});var pm=X((pnt,hS)=>{"use strict";var hm=In(),tU=An(),eU=er(),vh=oo(),fm=ri(),nU=ph().CONFIGURABLE,rU=am(),fS=Va(),iU=fS.enforce,oU=fS.get,cS=String,_h=Object.defineProperty,sU=hm("".slice),aU=hm("".replace),uU=hm([].join),lU=fm&&!tU(function(){return _h(function(){},"length",{value:8}).length!==8}),cU=String(String).split("String"),fU=hS.exports=function(n,t,e){sU(cS(t),0,7)==="Symbol("&&(t="["+aU(cS(t),/^Symbol\\(([^)]*)\\).*$/,"$1")+"]"),e&&e.getter&&(t="get "+t),e&&e.setter&&(t="set "+t),(!vh(n,"name")||nU&&n.name!==t)&&(fm?_h(n,"name",{value:t,configurable:!0}):n.name=t),lU&&e&&vh(e,"arity")&&n.length!==e.arity&&_h(n,"length",{value:e.arity});try{e&&vh(e,"constructor")&&e.constructor?fm&&_h(n,"prototype",{writable:!1}):n.prototype&&(n.prototype=void 0)}catch(s){}var i=iU(n);return vh(i,"source")||(i.source=uU(cU,typeof t=="string"?t:"")),n};Function.prototype.toString=fU(function(){return eU(this)&&oU(this).source||rU(this)},"toString")});var Ha=X((dnt,pS)=>{"use strict";var hU=er(),pU=Wo(),dU=pm(),gU=oh();pS.exports=function(n,t,e,i){i||(i={});var s=i.enumerable,u=i.name!==void 0?i.name:t;if(hU(e)&&dU(e,u,i),i.global)s?n[t]=e:gU(t,e);else{try{i.unsafe?n[t]&&(s=!0):delete n[t]}catch(c){}s?n[t]=e:pU.f(n,t,{value:e,enumerable:!1,configurable:!i.nonConfigurable,writable:!i.nonWritable})}return n}});var gS=X((gnt,dS)=>{"use strict";var mU=Math.ceil,yU=Math.floor;dS.exports=Math.trunc||function(t){var e=+t;return(e>0?yU:mU)(e)}});var Hi=X((mnt,mS)=>{"use strict";var vU=gS();mS.exports=function(n){var t=+n;return t!==t||t===0?0:vU(t)}});var xh=X((ynt,yS)=>{"use strict";var _U=Hi(),xU=Math.max,EU=Math.min;yS.exports=function(n,t){var e=_U(n);return e<0?xU(e+t,0):EU(e,t)}});var Wa=X((vnt,vS)=>{"use strict";var SU=Hi(),wU=Math.min;vS.exports=function(n){var t=SU(n);return t>0?wU(t,9007199254740991):0}});var ii=X((_nt,_S)=>{"use strict";var MU=Wa();_S.exports=function(n){return MU(n.length)}});var SS=X((xnt,ES)=>{"use strict";var bU=Gu(),AU=xh(),TU=ii(),xS=function(n){return function(t,e,i){var s=bU(t),u=TU(s);if(u===0)return!n&&-1;var c=AU(i,u),f;if(n&&e!==e){for(;u>c;)if(f=s[c++],f!==f)return!0}else for(;u>c;c++)if((n||c in s)&&s[c]===e)return n||c||0;return!n&&-1}};ES.exports={includes:xS(!0),indexOf:xS(!1)}});var gm=X((Ent,MS)=>{"use strict";var CU=In(),dm=oo(),IU=Gu(),PU=SS().indexOf,RU=gh(),wS=CU([].push);MS.exports=function(n,t){var e=IU(n),i=0,s=[],u;for(u in e)!dm(RU,u)&&dm(e,u)&&wS(s,u);for(;t.length>i;)dm(e,u=t[i++])&&(~PU(s,u)||wS(s,u));return s}});var Eh=X((Snt,bS)=>{"use strict";bS.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]});var mm=X(AS=>{"use strict";var LU=gm(),NU=Eh(),OU=NU.concat("length","prototype");AS.f=Object.getOwnPropertyNames||function(t){return LU(t,OU)}});var CS=X(TS=>{"use strict";TS.f=Object.getOwnPropertySymbols});var PS=X((bnt,IS)=>{"use strict";var DU=$s(),FU=In(),UU=mm(),BU=CS(),zU=so(),GU=FU([].concat);IS.exports=DU("Reflect","ownKeys")||function(t){var e=UU.f(zU(t)),i=BU.f;return i?GU(e,i(t)):e}});var ym=X((Ant,LS)=>{"use strict";var RS=oo(),kU=PS(),qU=fh(),VU=Wo();LS.exports=function(n,t,e){for(var i=kU(t),s=VU.f,u=qU.f,c=0;c<i.length;c++){var f=i[c];!RS(n,f)&&!(e&&RS(e,f))&&s(n,f,u(t,f))}}});var OS=X((Tnt,NS)=>{"use strict";var HU=An(),WU=er(),XU=/#|\\.prototype\\./,Nc=function(n,t){var e=$U[YU(n)];return e===JU?!0:e===ZU?!1:WU(t)?HU(t):!!t},YU=Nc.normalize=function(n){return String(n).replace(XU,".").toLowerCase()},$U=Nc.data={},ZU=Nc.NATIVE="N",JU=Nc.POLYFILL="P";NS.exports=Nc});var sr=X((Cnt,DS)=>{"use strict";var Sh=Sn(),jU=fh().f,KU=xs(),QU=Ha(),tB=oh(),eB=ym(),nB=OS();DS.exports=function(n,t){var e=n.target,i=n.global,s=n.stat,u,c,f,p,d,g;if(i?c=Sh:s?c=Sh[e]||tB(e,{}):c=Sh[e]&&Sh[e].prototype,c)for(f in t){if(d=t[f],n.dontCallGetSet?(g=jU(c,f),p=g&&g.value):p=c[f],u=nB(i?f:e+(s?".":"#")+f,n.forced),!u&&p!==void 0){if(typeof d==typeof p)continue;eB(d,p)}(n.sham||p&&p.sham)&&KU(d,"sham",!0),QU(c,f,d,n)}}});var Oc=X((Int,FS)=>{"use strict";var rB=vs();FS.exports=Array.isArray||function(t){return rB(t)==="Array"}});var vm=X((Pnt,US)=>{"use strict";var iB=ri(),oB=Oc(),sB=TypeError,aB=Object.getOwnPropertyDescriptor,uB=iB&&!function(){if(this!==void 0)return!0;try{Object.defineProperty([],"length",{writable:!1}).length=1}catch(n){return n instanceof TypeError}}();US.exports=uB?function(n,t){if(oB(n)&&!aB(n,"length").writable)throw new sB("Cannot set read only .length");return n.length=t}:function(n,t){return n.length=t}});var wh=X((Rnt,BS)=>{"use strict";var lB=TypeError,cB=9007199254740991;BS.exports=function(n){if(n>cB)throw lB("Maximum allowed index exceeded");return n}});var Mh=X(()=>{"use strict";var fB=sr(),hB=Vi(),pB=ii(),dB=vm(),gB=wh(),mB=An(),yB=mB(function(){return[].push.call({length:4294967296},1)!==4294967297}),vB=function(){try{Object.defineProperty([],"length",{writable:!1}).push()}catch(n){return n instanceof TypeError}},_B=yB||!vB();fB({target:"Array",proto:!0,arity:1,forced:_B},{push:function(t){var e=hB(this),i=pB(e),s=arguments.length;gB(i+s);for(var u=0;u<s;u++)e[i]=arguments[u],i++;return dB(e,i),i}})});var zS=X(()=>{"use strict";var xB=sr(),EB=vr();xB({target:"URL",proto:!0,enumerable:!0},{toJSON:function(){return EB(URL.prototype.toString,this)}})});var kS=X((Fnt,GS)=>{"use strict";GS.exports={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0}});var HS=X((Unt,VS)=>{"use strict";var SB=ch(),_m=SB("span").classList,qS=_m&&_m.constructor&&_m.constructor.prototype;VS.exports=qS===Object.prototype?void 0:qS});var XS=X((Bnt,WS)=>{"use strict";var wB=gm(),MB=Eh();WS.exports=Object.keys||function(t){return wB(t,MB)}});var $S=X(YS=>{"use strict";var bB=ri(),AB=Qg(),TB=Wo(),CB=so(),IB=Gu(),PB=XS();YS.f=bB&&!AB?Object.defineProperties:function(t,e){CB(t);for(var i=IB(e),s=PB(e),u=s.length,c=0,f;u>c;)TB.f(t,f=s[c++],i[f]);return t}});var JS=X((Gnt,ZS)=>{"use strict";var RB=$s();ZS.exports=RB("document","documentElement")});var Hu=X((knt,rw)=>{"use strict";var LB=so(),NB=$S(),jS=Eh(),OB=gh(),DB=JS(),FB=ch(),UB=dh(),KS=">",QS="<",Em="prototype",Sm="script",ew=UB("IE_PROTO"),xm=function(){},nw=function(n){return QS+Sm+KS+n+QS+"/"+Sm+KS},tw=function(n){n.write(nw("")),n.close();var t=n.parentWindow.Object;return n=null,t},BB=function(){var n=FB("iframe"),t="java"+Sm+":",e;return n.style.display="none",DB.appendChild(n),n.src=String(t),e=n.contentWindow.document,e.open(),e.write(nw("document.F=Object")),e.close(),e.F},bh,Ah=function(){try{bh=new ActiveXObject("htmlfile")}catch(t){}Ah=typeof document!="undefined"?document.domain&&bh?tw(bh):BB():tw(bh);for(var n=jS.length;n--;)delete Ah[Em][jS[n]];return Ah()};OB[ew]=!0;rw.exports=Object.create||function(t,e){var i;return t!==null?(xm[Em]=LB(t),i=new xm,xm[Em]=null,i[ew]=t):i=Ah(),e===void 0?i:NB.f(i,e)}});var bm=X((qnt,iw)=>{"use strict";var zB=Xr(),GB=Hu(),kB=Wo().f,wm=zB("unscopables"),Mm=Array.prototype;Mm[wm]===void 0&&kB(Mm,wm,{configurable:!0,value:GB(null)});iw.exports=function(n){Mm[wm][n]=!0}});var Wu=X((Vnt,ow)=>{"use strict";ow.exports={}});var aw=X((Hnt,sw)=>{"use strict";var qB=An();sw.exports=!qB(function(){function n(){}return n.prototype.constructor=null,Object.getPrototypeOf(new n)!==n.prototype})});var Dc=X((Wnt,lw)=>{"use strict";var VB=oo(),HB=er(),WB=Vi(),XB=dh(),YB=aw(),uw=XB("IE_PROTO"),Am=Object,$B=Am.prototype;lw.exports=YB?Am.getPrototypeOf:function(n){var t=WB(n);if(VB(t,uw))return t[uw];var e=t.constructor;return HB(e)&&t instanceof e?e.prototype:t instanceof Am?$B:null}});var Pm=X((Xnt,hw)=>{"use strict";var ZB=An(),JB=er(),jB=Ei(),KB=Hu(),cw=Dc(),QB=Ha(),tz=Xr(),ez=Rc(),Im=tz("iterator"),fw=!1,Es,Tm,Cm;[].keys&&(Cm=[].keys(),"next"in Cm?(Tm=cw(cw(Cm)),Tm!==Object.prototype&&(Es=Tm)):fw=!0);var nz=!jB(Es)||ZB(function(){var n={};return Es[Im].call(n)!==n});nz?Es={}:ez&&(Es=KB(Es));JB(Es[Im])||QB(Es,Im,function(){return this});hw.exports={IteratorPrototype:Es,BUGGY_SAFARI_ITERATORS:fw}});var Fc=X((Ynt,dw)=>{"use strict";var rz=Wo().f,iz=oo(),oz=Xr(),pw=oz("toStringTag");dw.exports=function(n,t,e){n&&!e&&(n=n.prototype),n&&!iz(n,pw)&&rz(n,pw,{configurable:!0,value:t})}});var mw=X(($nt,gw)=>{"use strict";var sz=Pm().IteratorPrototype,az=Hu(),uz=Ac(),lz=Fc(),cz=Wu(),fz=function(){return this};gw.exports=function(n,t,e,i){var s=t+" Iterator";return n.prototype=az(sz,{next:uz(+!i,e)}),lz(n,s,!1,!0),cz[s]=fz,n}});var Uc=X((Znt,yw)=>{"use strict";var hz=In(),pz=_s();yw.exports=function(n,t,e){try{return hz(pz(Object.getOwnPropertyDescriptor(n,t)[e]))}catch(i){}}});var _w=X((Jnt,vw)=>{"use strict";var dz=Ei();vw.exports=function(n){return dz(n)||n===null}});var Ew=X((jnt,xw)=>{"use strict";var gz=_w(),mz=String,yz=TypeError;xw.exports=function(n){if(gz(n))return n;throw new yz("Can't set "+mz(n)+" as a prototype")}});var Xu=X((Knt,Sw)=>{"use strict";var vz=Uc(),_z=Ei(),xz=zu(),Ez=Ew();Sw.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var n=!1,t={},e;try{e=vz(Object.prototype,"__proto__","set"),e(t,[]),n=t instanceof Array}catch(i){}return function(s,u){return xz(s),Ez(u),_z(s)&&(n?e(s,u):s.__proto__=u),s}}():void 0)});var Nw=X((Qnt,Lw)=>{"use strict";var Sz=sr(),wz=vr(),Th=Rc(),Pw=ph(),Mz=er(),bz=mw(),ww=Dc(),Mw=Xu(),Az=Fc(),Tz=xs(),Rm=Ha(),Cz=Xr(),bw=Wu(),Rw=Pm(),Iz=Pw.PROPER,Pz=Pw.CONFIGURABLE,Aw=Rw.IteratorPrototype,Ch=Rw.BUGGY_SAFARI_ITERATORS,Bc=Cz("iterator"),Tw="keys",zc="values",Cw="entries",Iw=function(){return this};Lw.exports=function(n,t,e,i,s,u,c){bz(e,t,i);var f=function(x){if(x===s&&v)return v;if(!Ch&&x&&x in g)return g[x];switch(x){case Tw:return function(){return new e(this,x)};case zc:return function(){return new e(this,x)};case Cw:return function(){return new e(this,x)}}return function(){return new e(this)}},p=t+" Iterator",d=!1,g=n.prototype,y=g[Bc]||g["@@iterator"]||s&&g[s],v=!Ch&&y||f(s),E=t==="Array"&&g.entries||y,M,A,_;if(E&&(M=ww(E.call(new n)),M!==Object.prototype&&M.next&&(!Th&&ww(M)!==Aw&&(Mw?Mw(M,Aw):Mz(M[Bc])||Rm(M,Bc,Iw)),Az(M,p,!0,!0),Th&&(bw[p]=Iw))),Iz&&s===zc&&y&&y.name!==zc&&(!Th&&Pz?Tz(g,"name",zc):(d=!0,v=function(){return wz(y,this)})),s)if(A={values:f(zc),keys:u?v:f(Tw),entries:f(Cw)},c)for(_ in A)(Ch||d||!(_ in g))&&Rm(g,_,A[_]);else Sz({target:t,proto:!0,forced:Ch||d},A);return(!Th||c)&&g[Bc]!==v&&Rm(g,Bc,v,{name:s}),bw[t]=v,A}});var Dw=X((trt,Ow)=>{"use strict";Ow.exports=function(n,t){return{value:n,done:t}}});var kw=X((ert,Gw)=>{"use strict";var Rz=Gu(),Lm=bm(),Fw=Wu(),Bw=Va(),Lz=Wo().f,Nz=Nw(),Ih=Dw(),Oz=Rc(),Dz=ri(),zw="Array Iterator",Fz=Bw.set,Uz=Bw.getterFor(zw);Gw.exports=Nz(Array,"Array",function(n,t){Fz(this,{type:zw,target:Rz(n),index:0,kind:t})},function(){var n=Uz(this),t=n.target,e=n.index++;if(!t||e>=t.length)return n.target=null,Ih(void 0,!0);switch(n.kind){case"keys":return Ih(e,!1);case"values":return Ih(t[e],!1)}return Ih([e,t[e]],!1)},"values");var Uw=Fw.Arguments=Fw.Array;Lm("keys");Lm("values");Lm("entries");if(!Oz&&Dz&&Uw.name!=="values")try{Lz(Uw,"name",{value:"values"})}catch(n){}});var Yu=X(()=>{"use strict";var qw=Sn(),Hw=kS(),Bz=HS(),Gc=kw(),Vw=xs(),zz=Fc(),Gz=Xr(),Nm=Gz("iterator"),Om=Gc.values,Ww=function(n,t){if(n){if(n[Nm]!==Om)try{Vw(n,Nm,Om)}catch(i){n[Nm]=Om}if(zz(n,t,!0),Hw[t]){for(var e in Gc)if(n[e]!==Gc[e])try{Vw(n,e,Gc[e])}catch(i){n[e]=Gc[e]}}}};for(Ph in Hw)Ww(qw[Ph]&&qw[Ph].prototype,Ph);var Ph;Ww(Bz,"DOMTokenList")});var Rh=X((irt,Xw)=>{"use strict";var kz=vs(),qz=In();Xw.exports=function(n){if(kz(n)==="Function")return qz(n)}});var kc=X((ort,$w)=>{"use strict";var Yw=Rh(),Vz=_s(),Hz=bc(),Wz=Yw(Yw.bind);$w.exports=function(n,t){return Vz(n),t===void 0?n:Hz?Wz(n,t):function(){return n.apply(t,arguments)}}});var jw=X((srt,Jw)=>{"use strict";var Xz=Oc(),Yz=ii(),$z=wh(),Zz=kc(),Zw=function(n,t,e,i,s,u,c,f){for(var p=s,d=0,g=c?Zz(c,f):!1,y,v;d<i;)d in e&&(y=g?g(e[d],d,t):e[d],u>0&&Xz(y)?(v=Yz(y),p=Zw(n,t,y,v,p,u-1)-1):($z(p+1),n[p]=y),p++),d++;return p};Jw.exports=Zw});var tM=X((art,Qw)=>{"use strict";var Jz=Xr(),jz=Jz("toStringTag"),Kw={};Kw[jz]="z";Qw.exports=String(Kw)==="[object z]"});var Zs=X((urt,eM)=>{"use strict";var Kz=tM(),Qz=er(),Lh=vs(),tG=Xr(),eG=tG("toStringTag"),nG=Object,rG=Lh(function(){return arguments}())==="Arguments",iG=function(n,t){try{return n[t]}catch(e){}};eM.exports=Kz?Lh:function(n){var t,e,i;return n===void 0?"Undefined":n===null?"Null":typeof(e=iG(t=nG(n),eG))=="string"?e:rG?Lh(t):(i=Lh(t))==="Object"&&Qz(t.callee)?"Arguments":i}});var Fm=X((lrt,sM)=>{"use strict";var oG=In(),sG=An(),nM=er(),aG=Zs(),uG=$s(),lG=am(),rM=function(){},iM=uG("Reflect","construct"),Dm=/^\\s*(?:class|function)\\b/,cG=oG(Dm.exec),fG=!Dm.test(rM),qc=function(t){if(!nM(t))return!1;try{return iM(rM,[],t),!0}catch(e){return!1}},oM=function(t){if(!nM(t))return!1;switch(aG(t)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return fG||!!cG(Dm,lG(t))}catch(e){return!0}};oM.sham=!0;sM.exports=!iM||sG(function(){var n;return qc(qc.call)||!qc(Object)||!qc(function(){n=!0})||n})?oM:qc});var cM=X((crt,lM)=>{"use strict";var aM=Oc(),hG=Fm(),pG=Ei(),dG=Xr(),gG=dG("species"),uM=Array;lM.exports=function(n){var t;return aM(n)&&(t=n.constructor,hG(t)&&(t===uM||aM(t.prototype))?t=void 0:pG(t)&&(t=t[gG],t===null&&(t=void 0))),t===void 0?uM:t}});var Um=X((frt,fM)=>{"use strict";var mG=cM();fM.exports=function(n,t){return new(mG(n))(t===0?0:t)}});var hM=X(()=>{"use strict";var yG=sr(),vG=jw(),_G=Vi(),xG=ii(),EG=Hi(),SG=Um();yG({target:"Array",proto:!0},{flat:function(){var t=arguments.length?arguments[0]:void 0,e=_G(this),i=xG(e),s=SG(e,0);return s.length=vG(s,e,e,i,0,t===void 0?1:EG(t)),s}})});var pM=X(()=>{"use strict";var wG=bm();wG("flat")});var vM=X((mrt,yM)=>{"use strict";var MG=Xr(),gM=MG("iterator"),mM=!1;try{dM=0,Bm={next:function(){return{done:!!dM++}},return:function(){mM=!0}},Bm[gM]=function(){return this},Array.from(Bm,function(){throw 2})}catch(n){}var dM,Bm;yM.exports=function(n,t){try{if(!t&&!mM)return!1}catch(s){return!1}var e=!1;try{var i={};i[gM]=function(){return{next:function(){return{done:e=!0}}}},n(i)}catch(s){}return e}});var Nh=X((yrt,_M)=>{"use strict";_M.exports=typeof ArrayBuffer!="undefined"&&typeof DataView!="undefined"});var $u=X((vrt,EM)=>{"use strict";var xM=pm(),bG=Wo();EM.exports=function(n,t,e){return e.get&&xM(e.get,t,{getter:!0}),e.set&&xM(e.set,t,{setter:!0}),bG.f(n,t,e)}});var Wi=X((_rt,RM)=>{"use strict";var AG=Nh(),qm=ri(),Si=Sn(),bM=er(),Fh=Ei(),js=oo(),Vm=Zs(),TG=qu(),CG=xs(),zm=Ha(),IG=$u(),PG=Tc(),Uh=Dc(),Ju=Xu(),RG=Xr(),LG=uh(),AM=Va(),TM=AM.enforce,NG=AM.get,Oh=Si.Int8Array,Gm=Oh&&Oh.prototype,SM=Si.Uint8ClampedArray,wM=SM&&SM.prototype,Xo=Oh&&Uh(Oh),bo=Gm&&Uh(Gm),OG=Object.prototype,Hm=Si.TypeError,MM=RG("toStringTag"),km=LG("TYPED_ARRAY_TAG"),Dh="TypedArrayConstructor",Ss=AG&&!!Ju&&Vm(Si.opera)!=="Opera",CM=!1,Li,Js,Zu,ws={Int8Array:1,Uint8Array:1,Uint8ClampedArray:1,Int16Array:2,Uint16Array:2,Int32Array:4,Uint32Array:4,Float32Array:4,Float64Array:8},Wm={BigInt64Array:8,BigUint64Array:8},DG=function(t){if(!Fh(t))return!1;var e=Vm(t);return e==="DataView"||js(ws,e)||js(Wm,e)},IM=function(n){var t=Uh(n);if(Fh(t)){var e=NG(t);return e&&js(e,Dh)?e[Dh]:IM(t)}},PM=function(n){if(!Fh(n))return!1;var t=Vm(n);return js(ws,t)||js(Wm,t)},FG=function(n){if(PM(n))return n;throw new Hm("Target is not a typed array")},UG=function(n){if(bM(n)&&(!Ju||PG(Xo,n)))return n;throw new Hm(TG(n)+" is not a typed array constructor")},BG=function(n,t,e,i){if(qm){if(e)for(var s in ws){var u=Si[s];if(u&&js(u.prototype,n))try{delete u.prototype[n]}catch(c){try{u.prototype[n]=t}catch(f){}}}(!bo[n]||e)&&zm(bo,n,e?t:Ss&&Gm[n]||t,i)}},zG=function(n,t,e){var i,s;if(qm){if(Ju){if(e){for(i in ws)if(s=Si[i],s&&js(s,n))try{delete s[n]}catch(u){}}if(!Xo[n]||e)try{return zm(Xo,n,e?t:Ss&&Xo[n]||t)}catch(u){}else return}for(i in ws)s=Si[i],s&&(!s[n]||e)&&zm(s,n,t)}};for(Li in ws)Js=Si[Li],Zu=Js&&Js.prototype,Zu?TM(Zu)[Dh]=Js:Ss=!1;for(Li in Wm)Js=Si[Li],Zu=Js&&Js.prototype,Zu&&(TM(Zu)[Dh]=Js);if((!Ss||!bM(Xo)||Xo===Function.prototype)&&(Xo=function(){throw new Hm("Incorrect invocation")},Ss))for(Li in ws)Si[Li]&&Ju(Si[Li],Xo);if((!Ss||!bo||bo===OG)&&(bo=Xo.prototype,Ss))for(Li in ws)Si[Li]&&Ju(Si[Li].prototype,bo);Ss&&Uh(wM)!==bo&&Ju(wM,bo);if(qm&&!js(bo,MM)){CM=!0,IG(bo,MM,{configurable:!0,get:function(){return Fh(this)?this[km]:void 0}});for(Li in ws)Si[Li]&&CG(Si[Li],km,Li)}RM.exports={NATIVE_ARRAY_BUFFER_VIEWS:Ss,TYPED_ARRAY_TAG:CM&&km,aTypedArray:FG,aTypedArrayConstructor:UG,exportTypedArrayMethod:BG,exportTypedArrayStaticMethod:zG,getTypedArrayConstructor:IM,isView:DG,isTypedArray:PM,TypedArray:Xo,TypedArrayPrototype:bo}});var OM=X((xrt,NM)=>{"use strict";var LM=Sn(),Xm=An(),GG=vM(),kG=Wi().NATIVE_ARRAY_BUFFER_VIEWS,qG=LM.ArrayBuffer,Xa=LM.Int8Array;NM.exports=!kG||!Xm(function(){Xa(1)})||!Xm(function(){new Xa(-1)})||!GG(function(n){new Xa,new Xa(null),new Xa(1.5),new Xa(n)},!0)||Xm(function(){return new Xa(new qG(2),1,void 0).length!==1})});var FM=X((Ert,DM)=>{"use strict";var VG=Ha();DM.exports=function(n,t,e){for(var i in t)VG(n,i,t[i],e);return n}});var Ym=X((Srt,UM)=>{"use strict";var HG=Tc(),WG=TypeError;UM.exports=function(n,t){if(HG(t,n))return n;throw new WG("Incorrect invocation")}});var Bh=X((wrt,BM)=>{"use strict";var XG=Hi(),YG=Wa(),$G=RangeError;BM.exports=function(n){if(n===void 0)return 0;var t=XG(n),e=YG(t);if(t!==e)throw new $G("Wrong length or index");return e}});var GM=X((Mrt,zM)=>{"use strict";zM.exports=Math.sign||function(t){var e=+t;return e===0||e!==e?e:e<0?-1:1}});var VM=X((brt,qM)=>{"use strict";var ZG=2220446049250313e-31,kM=1/ZG;qM.exports=function(n){return n+kM-kM}});var WM=X((Art,HM)=>{"use strict";var JG=GM(),jG=VM(),KG=Math.abs,QG=2220446049250313e-31;HM.exports=function(n,t,e,i){var s=+n,u=KG(s),c=JG(s);if(u<i)return c*jG(u/i/t)*i*t;var f=(1+t/QG)*u,p=f-(f-u);return p>e||p!==p?c*(1/0):c*p}});var YM=X((Trt,XM)=>{"use strict";var t4=WM(),e4=11920928955078125e-23,n4=34028234663852886e22,r4=11754943508222875e-54;XM.exports=Math.fround||function(t){return t4(t,e4,n4,r4)}});var ZM=X((Crt,$M)=>{"use strict";var i4=Array,o4=Math.abs,Ms=Math.pow,s4=Math.floor,a4=Math.log,u4=Math.LN2,l4=function(n,t,e){var i=i4(e),s=e*8-t-1,u=(1<<s)-1,c=u>>1,f=t===23?Ms(2,-24)-Ms(2,-77):0,p=n<0||n===0&&1/n<0?1:0,d=0,g,y,v;for(n=o4(n),n!==n||n===1/0?(y=n!==n?1:0,g=u):(g=s4(a4(n)/u4),v=Ms(2,-g),n*v<1&&(g--,v*=2),g+c>=1?n+=f/v:n+=f*Ms(2,1-c),n*v>=2&&(g++,v/=2),g+c>=u?(y=0,g=u):g+c>=1?(y=(n*v-1)*Ms(2,t),g+=c):(y=n*Ms(2,c-1)*Ms(2,t),g=0));t>=8;)i[d++]=y&255,y/=256,t-=8;for(g=g<<t|y,s+=t;s>0;)i[d++]=g&255,g/=256,s-=8;return i[d-1]|=p*128,i},c4=function(n,t){var e=n.length,i=e*8-t-1,s=(1<<i)-1,u=s>>1,c=i-7,f=e-1,p=n[f--],d=p&127,g;for(p>>=7;c>0;)d=d*256+n[f--],c-=8;for(g=d&(1<<-c)-1,d>>=-c,c+=t;c>0;)g=g*256+n[f--],c-=8;if(d===0)d=1-u;else{if(d===s)return g?NaN:p?-1/0:1/0;g+=Ms(2,t),d-=u}return(p?-1:1)*g*Ms(2,d-t)};$M.exports={pack:l4,unpack:c4}});var $m=X((Irt,jM)=>{"use strict";var f4=Vi(),JM=xh(),h4=ii();jM.exports=function(t){for(var e=f4(this),i=h4(e),s=arguments.length,u=JM(s>1?arguments[1]:void 0,i),c=s>2?arguments[2]:void 0,f=c===void 0?i:JM(c,i);f>u;)e[u++]=t;return e}});var zh=X((Prt,KM)=>{"use strict";var p4=In();KM.exports=p4([].slice)});var Zm=X((Rrt,tb)=>{"use strict";var d4=er(),g4=Ei(),QM=Xu();tb.exports=function(n,t,e){var i,s;return QM&&d4(i=t.constructor)&&i!==e&&g4(s=i.prototype)&&s!==e.prototype&&QM(n,s),n}});var Xh=X((Lrt,yb)=>{"use strict";var Hh=Sn(),t0=In(),Jm=ri(),m4=Nh(),hb=ph(),y4=xs(),v4=$u(),eb=FM(),jm=An(),Gh=Ym(),_4=Hi(),x4=Wa(),qh=Bh(),E4=YM(),pb=ZM(),S4=Dc(),nb=Xu(),w4=$m(),M4=zh(),b4=Zm(),A4=ym(),db=Fc(),e0=Va(),T4=hb.PROPER,rb=hb.CONFIGURABLE,Ku="ArrayBuffer",Wh="DataView",Qu="prototype",C4="Wrong length",gb="Wrong index",ib=e0.getterFor(Ku),Hc=e0.getterFor(Wh),ob=e0.set,Ao=Hh[Ku],Xi=Ao,ju=Xi&&Xi[Qu],Yo=Hh[Wh],Ya=Yo&&Yo[Qu],sb=Object.prototype,I4=Hh.Array,Vh=Hh.RangeError,P4=t0(w4),R4=t0([].reverse),mb=pb.pack,ab=pb.unpack,ub=function(n){return[n&255]},lb=function(n){return[n&255,n>>8&255]},cb=function(n){return[n&255,n>>8&255,n>>16&255,n>>24&255]},fb=function(n){return n[3]<<24|n[2]<<16|n[1]<<8|n[0]},L4=function(n){return mb(E4(n),23,4)},N4=function(n){return mb(n,52,8)},kh=function(n,t,e){v4(n[Qu],t,{configurable:!0,get:function(){return e(this)[t]}})},Ks=function(n,t,e,i){var s=Hc(n),u=qh(e),c=!!i;if(u+t>s.byteLength)throw new Vh(gb);var f=s.bytes,p=u+s.byteOffset,d=M4(f,p,p+t);return c?d:R4(d)},Qs=function(n,t,e,i,s,u){var c=Hc(n),f=qh(e),p=i(+s),d=!!u;if(f+t>c.byteLength)throw new Vh(gb);for(var g=c.bytes,y=f+c.byteOffset,v=0;v<t;v++)g[y+v]=p[d?v:t-v-1]};m4?(Km=T4&&Ao.name!==Ku,!jm(function(){Ao(1)})||!jm(function(){new Ao(-1)})||jm(function(){return new Ao,new Ao(1.5),new Ao(NaN),Ao.length!==1||Km&&!rb})?(Xi=function(t){return Gh(this,ju),b4(new Ao(qh(t)),this,Xi)},Xi[Qu]=ju,ju.constructor=Xi,A4(Xi,Ao)):Km&&rb&&y4(Ao,"name",Ku),nb&&S4(Ya)!==sb&&nb(Ya,sb),Vc=new Yo(new Xi(2)),Qm=t0(Ya.setInt8),Vc.setInt8(0,2147483648),Vc.setInt8(1,2147483649),(Vc.getInt8(0)||!Vc.getInt8(1))&&eb(Ya,{setInt8:function(t,e){Qm(this,t,e<<24>>24)},setUint8:function(t,e){Qm(this,t,e<<24>>24)}},{unsafe:!0})):(Xi=function(t){Gh(this,ju);var e=qh(t);ob(this,{type:Ku,bytes:P4(I4(e),0),byteLength:e}),Jm||(this.byteLength=e,this.detached=!1)},ju=Xi[Qu],Yo=function(t,e,i){Gh(this,Ya),Gh(t,ju);var s=ib(t),u=s.byteLength,c=_4(e);if(c<0||c>u)throw new Vh("Wrong offset");if(i=i===void 0?u-c:x4(i),c+i>u)throw new Vh(C4);ob(this,{type:Wh,buffer:t,byteLength:i,byteOffset:c,bytes:s.bytes}),Jm||(this.buffer=t,this.byteLength=i,this.byteOffset=c)},Ya=Yo[Qu],Jm&&(kh(Xi,"byteLength",ib),kh(Yo,"buffer",Hc),kh(Yo,"byteLength",Hc),kh(Yo,"byteOffset",Hc)),eb(Ya,{getInt8:function(t){return Ks(this,1,t)[0]<<24>>24},getUint8:function(t){return Ks(this,1,t)[0]},getInt16:function(t){var e=Ks(this,2,t,arguments.length>1?arguments[1]:!1);return(e[1]<<8|e[0])<<16>>16},getUint16:function(t){var e=Ks(this,2,t,arguments.length>1?arguments[1]:!1);return e[1]<<8|e[0]},getInt32:function(t){return fb(Ks(this,4,t,arguments.length>1?arguments[1]:!1))},getUint32:function(t){return fb(Ks(this,4,t,arguments.length>1?arguments[1]:!1))>>>0},getFloat32:function(t){return ab(Ks(this,4,t,arguments.length>1?arguments[1]:!1),23)},getFloat64:function(t){return ab(Ks(this,8,t,arguments.length>1?arguments[1]:!1),52)},setInt8:function(t,e){Qs(this,1,t,ub,e)},setUint8:function(t,e){Qs(this,1,t,ub,e)},setInt16:function(t,e){Qs(this,2,t,lb,e,arguments.length>2?arguments[2]:!1)},setUint16:function(t,e){Qs(this,2,t,lb,e,arguments.length>2?arguments[2]:!1)},setInt32:function(t,e){Qs(this,4,t,cb,e,arguments.length>2?arguments[2]:!1)},setUint32:function(t,e){Qs(this,4,t,cb,e,arguments.length>2?arguments[2]:!1)},setFloat32:function(t,e){Qs(this,4,t,L4,e,arguments.length>2?arguments[2]:!1)},setFloat64:function(t,e){Qs(this,8,t,N4,e,arguments.length>2?arguments[2]:!1)}}));var Km,Vc,Qm;db(Xi,Ku);db(Yo,Wh);yb.exports={ArrayBuffer:Xi,DataView:Yo}});var _b=X((Nrt,vb)=>{"use strict";var O4=Ei(),D4=Math.floor;vb.exports=Number.isInteger||function(t){return!O4(t)&&isFinite(t)&&D4(t)===t}});var Eb=X((Ort,xb)=>{"use strict";var F4=Hi(),U4=RangeError;xb.exports=function(n){var t=F4(n);if(t<0)throw new U4("The argument can't be less than 0");return t}});var n0=X((Drt,Sb)=>{"use strict";var B4=Eb(),z4=RangeError;Sb.exports=function(n,t){var e=B4(n);if(e%t)throw new z4("Wrong offset");return e}});var Mb=X((Frt,wb)=>{"use strict";var G4=Math.round;wb.exports=function(n){var t=G4(n);return t<0?0:t>255?255:t&255}});var Ab=X((Urt,bb)=>{"use strict";var k4=Fm(),q4=qu(),V4=TypeError;bb.exports=function(n){if(k4(n))return n;throw new V4(q4(n)+" is not a constructor")}});var r0=X((Brt,Cb)=>{"use strict";var H4=Zs(),Tb=Pc(),W4=nh(),X4=Wu(),Y4=Xr(),$4=Y4("iterator");Cb.exports=function(n){if(!W4(n))return Tb(n,$4)||Tb(n,"@@iterator")||X4[H4(n)]}});var Pb=X((zrt,Ib)=>{"use strict";var Z4=vr(),J4=_s(),j4=so(),K4=qu(),Q4=r0(),tk=TypeError;Ib.exports=function(n,t){var e=arguments.length<2?Q4(n):t;if(J4(e))return j4(Z4(e,n));throw new tk(K4(n)+" is not iterable")}});var Lb=X((Grt,Rb)=>{"use strict";var ek=Xr(),nk=Wu(),rk=ek("iterator"),ik=Array.prototype;Rb.exports=function(n){return n!==void 0&&(nk.Array===n||ik[rk]===n)}});var i0=X((krt,Nb)=>{"use strict";var ok=Zs();Nb.exports=function(n){var t=ok(n);return t==="BigInt64Array"||t==="BigUint64Array"}});var Yh=X((qrt,Ob)=>{"use strict";var sk=Jg(),ak=TypeError;Ob.exports=function(n){var t=sk(n,"number");if(typeof t=="number")throw new ak("Can't convert number to bigint");return BigInt(t)}});var Fb=X((Vrt,Db)=>{"use strict";var uk=kc(),lk=vr(),ck=Ab(),fk=Vi(),hk=ii(),pk=Pb(),dk=r0(),gk=Lb(),mk=i0(),yk=Wi().aTypedArrayConstructor,vk=Yh();Db.exports=function(t){var e=ck(this),i=fk(t),s=arguments.length,u=s>1?arguments[1]:void 0,c=u!==void 0,f=dk(i),p,d,g,y,v,E,M,A;if(f&&!gk(f))for(M=pk(i,f),A=M.next,i=[];!(E=lk(A,M)).done;)i.push(E.value);for(c&&s>2&&(u=uk(u,arguments[2])),d=hk(i),g=new(yk(e))(d),y=mk(g),p=0;d>p;p++)v=c?u(i[p],p):i[p],g[p]=y?vk(v):+v;return g}});var zb=X((Hrt,Bb)=>{"use strict";var _k=kc(),xk=In(),Ek=eh(),Sk=Vi(),wk=ii(),Mk=Um(),Ub=xk([].push),ta=function(n){var t=n===1,e=n===2,i=n===3,s=n===4,u=n===6,c=n===7,f=n===5||u;return function(p,d,g,y){for(var v=Sk(p),E=Ek(v),M=wk(E),A=_k(d,g),_=0,x=y||Mk,T=t?x(p,M):e||c?x(p,0):void 0,w,R;M>_;_++)if((f||_ in E)&&(w=E[_],R=A(w,_,v),n))if(t)T[_]=R;else if(R)switch(n){case 3:return!0;case 5:return w;case 6:return _;case 2:Ub(T,w)}else switch(n){case 4:return!1;case 7:Ub(T,w)}return u?-1:i||s?s:T}};Bb.exports={forEach:ta(0),map:ta(1),filter:ta(2),some:ta(3),every:ta(4),find:ta(5),findIndex:ta(6),filterReject:ta(7)}});var o0=X((Wrt,kb)=>{"use strict";var bk=$s(),Ak=$u(),Tk=Xr(),Ck=ri(),Gb=Tk("species");kb.exports=function(n){var t=bk(n);Ck&&t&&!t[Gb]&&Ak(t,Gb,{configurable:!0,get:function(){return this}})}});var s0=X((Xrt,qb)=>{"use strict";var Ik=ii();qb.exports=function(n,t,e){for(var i=0,s=arguments.length>2?e:Ik(t),u=new n(s);s>i;)u[i]=t[i++];return u}});var uA=X((Yrt,p0)=>{"use strict";var Vb=sr(),tA=Sn(),Hb=vr(),Pk=ri(),Rk=OM(),$c=Wi(),eA=Xh(),Wb=Ym(),Lk=Ac(),Wc=xs(),Nk=_b(),Ok=Wa(),Xb=Bh(),a0=n0(),Dk=Mb(),nA=lh(),Xc=oo(),Fk=Zs(),c0=Ei(),Uk=Ic(),Bk=Hu(),zk=Tc(),$h=Xu(),Gk=mm().f,Yb=Fb(),kk=zb().forEach,qk=o0(),Vk=$u(),rA=Wo(),iA=fh(),$b=s0(),d0=Va(),Hk=Zm(),f0=d0.get,Wk=d0.set,Xk=d0.enforce,oA=rA.f,Yk=iA.f,u0=tA.RangeError,sA=eA.ArrayBuffer,$k=sA.prototype,Zk=eA.DataView,Zh=$c.NATIVE_ARRAY_BUFFER_VIEWS,Zb=$c.TYPED_ARRAY_TAG,Jb=$c.TypedArray,Yc=$c.TypedArrayPrototype,h0=$c.isTypedArray,Jh="BYTES_PER_ELEMENT",l0="Wrong length",jh=function(n,t){Vk(n,t,{configurable:!0,get:function(){return f0(this)[t]}})},jb=function(n){var t;return zk($k,n)||(t=Fk(n))==="ArrayBuffer"||t==="SharedArrayBuffer"},aA=function(n,t){return h0(n)&&!Uk(t)&&t in n&&Nk(+t)&&t>=0},Kb=function(t,e){return e=nA(e),aA(t,e)?Lk(2,t[e]):Yk(t,e)},Qb=function(t,e,i){return e=nA(e),aA(t,e)&&c0(i)&&Xc(i,"value")&&!Xc(i,"get")&&!Xc(i,"set")&&!i.configurable&&(!Xc(i,"writable")||i.writable)&&(!Xc(i,"enumerable")||i.enumerable)?(t[e]=i.value,t):oA(t,e,i)};Pk?(Zh||(iA.f=Kb,rA.f=Qb,jh(Yc,"buffer"),jh(Yc,"byteOffset"),jh(Yc,"byteLength"),jh(Yc,"length")),Vb({target:"Object",stat:!0,forced:!Zh},{getOwnPropertyDescriptor:Kb,defineProperty:Qb}),p0.exports=function(n,t,e){var i=n.match(/\\d+/)[0]/8,s=n+(e?"Clamped":"")+"Array",u="get"+n,c="set"+n,f=tA[s],p=f,d=p&&p.prototype,g={},y=function(A,_){var x=f0(A);return x.view[u](_*i+x.byteOffset,!0)},v=function(A,_,x){var T=f0(A);T.view[c](_*i+T.byteOffset,e?Dk(x):x,!0)},E=function(A,_){oA(A,_,{get:function(){return y(this,_)},set:function(x){return v(this,_,x)},enumerable:!0})};Zh?Rk&&(p=t(function(A,_,x,T){return Wb(A,d),Hk(function(){return c0(_)?jb(_)?T!==void 0?new f(_,a0(x,i),T):x!==void 0?new f(_,a0(x,i)):new f(_):h0(_)?$b(p,_):Hb(Yb,p,_):new f(Xb(_))}(),A,p)}),$h&&$h(p,Jb),kk(Gk(f),function(A){A in p||Wc(p,A,f[A])}),p.prototype=d):(p=t(function(A,_,x,T){Wb(A,d);var w=0,R=0,z,U,D;if(!c0(_))D=Xb(_),U=D*i,z=new sA(U);else if(jb(_)){z=_,R=a0(x,i);var P=_.byteLength;if(T===void 0){if(P%i)throw new u0(l0);if(U=P-R,U<0)throw new u0(l0)}else if(U=Ok(T)*i,U+R>P)throw new u0(l0);D=U/i}else return h0(_)?$b(p,_):Hb(Yb,p,_);for(Wk(A,{buffer:z,byteOffset:R,byteLength:U,length:D,view:new Zk(z)});w<D;)E(A,w++)}),$h&&$h(p,Jb),d=p.prototype=Bk(Yc)),d.constructor!==p&&Wc(d,"constructor",p),Xk(d).TypedArrayConstructor=p,Zb&&Wc(d,Zb,s);var M=p!==f;g[s]=p,Vb({global:!0,constructor:!0,forced:M,sham:!Zh},g),Jh in p||Wc(p,Jh,i),Jh in d||Wc(d,Jh,i),qk(s)}):p0.exports=function(){}});var g0=X(()=>{"use strict";var Jk=uA();Jk("Float32",function(n){return function(e,i,s){return n(this,e,i,s)}})});var m0=X(()=>{"use strict";var lA=Wi(),jk=ii(),Kk=Hi(),Qk=lA.aTypedArray,tq=lA.exportTypedArrayMethod;tq("at",function(t){var e=Qk(this),i=jk(e),s=Kk(t),u=s>=0?s:i+s;return u<0||u>=i?void 0:e[u]})});var y0=X(()=>{"use strict";var cA=Wi(),eq=$m(),nq=Yh(),rq=Zs(),iq=vr(),oq=In(),sq=An(),aq=cA.aTypedArray,uq=cA.exportTypedArrayMethod,lq=oq("".slice),cq=sq(function(){var n=0;return new Int8Array(2).fill({valueOf:function(){return n++}}),n!==1});uq("fill",function(t){var e=arguments.length;aq(this);var i=lq(rq(this),0,3)==="Big"?nq(t):+t;return iq(eq,this,i,e>1?arguments[1]:void 0,e>2?arguments[2]:void 0)},cq)});var v0=X((tit,hA)=>{"use strict";var fq=kc(),hq=eh(),pq=Vi(),dq=ii(),fA=function(n){var t=n===1;return function(e,i,s){for(var u=pq(e),c=hq(u),f=dq(c),p=fq(i,s),d,g;f-- >0;)if(d=c[f],g=p(d,f,u),g)switch(n){case 0:return d;case 1:return f}return t?-1:void 0}};hA.exports={findLast:fA(0),findLastIndex:fA(1)}});var _0=X(()=>{"use strict";var pA=Wi(),gq=v0().findLast,mq=pA.aTypedArray,yq=pA.exportTypedArrayMethod;yq("findLast",function(t){return gq(mq(this),t,arguments.length>1?arguments[1]:void 0)})});var x0=X(()=>{"use strict";var dA=Wi(),vq=v0().findLastIndex,_q=dA.aTypedArray,xq=dA.exportTypedArrayMethod;xq("findLastIndex",function(t){return vq(_q(this),t,arguments.length>1?arguments[1]:void 0)})});var M0=X(()=>{"use strict";var mA=Sn(),yA=vr(),w0=Wi(),Eq=ii(),Sq=n0(),wq=Vi(),vA=An(),Mq=mA.RangeError,E0=mA.Int8Array,gA=E0&&E0.prototype,_A=gA&&gA.set,bq=w0.aTypedArray,Aq=w0.exportTypedArrayMethod,S0=!vA(function(){var n=new Uint8ClampedArray(2);return yA(_A,n,{length:1,0:3},1),n[1]!==3}),Tq=S0&&w0.NATIVE_ARRAY_BUFFER_VIEWS&&vA(function(){var n=new E0(2);return n.set(1),n.set("2",1),n[0]!==0||n[1]!==2});Aq("set",function(t){bq(this);var e=Sq(arguments.length>1?arguments[1]:void 0,1),i=wq(t);if(S0)return yA(_A,this,i,e);var s=this.length,u=Eq(i),c=0;if(u+e>s)throw new Mq("Wrong length");for(;c<u;)this[e+c]=i[c++]},!S0||Tq)});var A0=X((ait,EA)=>{"use strict";var xA=zh(),Cq=Math.floor,b0=function(n,t){var e=n.length;if(e<8)for(var i=1,s,u;i<e;){for(u=i,s=n[i];u&&t(n[u-1],s)>0;)n[u]=n[--u];u!==i++&&(n[u]=s)}else for(var c=Cq(e/2),f=b0(xA(n,0,c),t),p=b0(xA(n,c),t),d=f.length,g=p.length,y=0,v=0;y<d||v<g;)n[y+v]=y<d&&v<g?t(f[y],p[v])<=0?f[y++]:p[v++]:y<d?f[y++]:p[v++];return n};EA.exports=b0});var T0=X((uit,wA)=>{"use strict";var Iq=ku(),SA=Iq.match(/firefox\\/(\\d+)/i);wA.exports=!!SA&&+SA[1]});var C0=X((lit,MA)=>{"use strict";var Pq=ku();MA.exports=/MSIE|Trident/.test(Pq)});var I0=X((cit,AA)=>{"use strict";var Rq=ku(),bA=Rq.match(/AppleWebKit\\/(\\d+)\\./);AA.exports=!!bA&&+bA[1]});var R0=X(()=>{"use strict";var Lq=Sn(),Nq=Rh(),P0=An(),Oq=_s(),Dq=A0(),RA=Wi(),TA=T0(),Fq=C0(),CA=Cc(),IA=I0(),Uq=RA.aTypedArray,Bq=RA.exportTypedArrayMethod,Zc=Lq.Uint16Array,tl=Zc&&Nq(Zc.prototype.sort),zq=!!tl&&!(P0(function(){tl(new Zc(2),null)})&&P0(function(){tl(new Zc(2),{})})),PA=!!tl&&!P0(function(){if(CA)return CA<74;if(TA)return TA<67;if(Fq)return!0;if(IA)return IA<602;var n=new Zc(516),t=Array(516),e,i;for(e=0;e<516;e++)i=e%4,n[e]=515-e,t[e]=e-2*i+3;for(tl(n,function(s,u){return(s/4|0)-(u/4|0)}),e=0;e<516;e++)if(n[e]!==t[e])return!0}),Gq=function(n){return function(t,e){return n!==void 0?+n(t,e)||0:e!==e?-1:t!==t?1:t===0&&e===0?1/t>0&&1/e<0?1:-1:t>e}};Bq("sort",function(t){return t!==void 0&&Oq(t),PA?tl(this,t):Dq(Uq(this),Gq(t))},!PA||zq)});var NA=X((pit,LA)=>{"use strict";var kq=ii();LA.exports=function(n,t){for(var e=kq(n),i=new t(e),s=0;s<e;s++)i[s]=n[e-s-1];return i}});var N0=X(()=>{"use strict";var qq=NA(),L0=Wi(),Vq=L0.aTypedArray,Hq=L0.exportTypedArrayMethod,Wq=L0.getTypedArrayConstructor;Hq("toReversed",function(){return qq(Vq(this),Wq(this))})});var O0=X(()=>{"use strict";var Kh=Wi(),Xq=In(),Yq=_s(),$q=s0(),Zq=Kh.aTypedArray,Jq=Kh.getTypedArrayConstructor,jq=Kh.exportTypedArrayMethod,Kq=Xq(Kh.TypedArrayPrototype.sort);jq("toSorted",function(t){t!==void 0&&Yq(t);var e=Zq(this),i=$q(Jq(e),e);return Kq(i,t)})});var DA=X((vit,OA)=>{"use strict";var Qq=ii(),t5=Hi(),e5=RangeError;OA.exports=function(n,t,e,i){var s=Qq(n),u=t5(e),c=u<0?s+u:u;if(c>=s||c<0)throw new e5("Incorrect index");for(var f=new t(s),p=0;p<s;p++)f[p]=p===c?i:n[p];return f}});var F0=X(()=>{"use strict";var n5=DA(),D0=Wi(),r5=i0(),i5=Hi(),o5=Yh(),s5=D0.aTypedArray,a5=D0.getTypedArrayConstructor,u5=D0.exportTypedArrayMethod,l5=!!function(){try{new Int8Array(1).with(2,{valueOf:function(){throw 8}})}catch(n){return n===8}}();u5("with",function(n,t){var e=s5(this),i=i5(n),s=r5(e)?o5(t):+t;return n5(e,a5(e),i,s)},!l5)});var B0=X(()=>{"use strict";var c5=sr(),f5=Sn(),h5=Xh(),p5=o0(),U0="ArrayBuffer",FA=h5[U0],d5=f5[U0];c5({global:!0,constructor:!0,forced:d5!==FA},{ArrayBuffer:FA});p5(U0)});var q0=X(()=>{"use strict";var g5=sr(),G0=Rh(),m5=An(),GA=Xh(),UA=so(),BA=xh(),y5=Wa(),k0=GA.ArrayBuffer,z0=GA.DataView,kA=z0.prototype,zA=G0(k0.prototype.slice),v5=G0(kA.getUint8),_5=G0(kA.setUint8),x5=m5(function(){return!new k0(2).slice(1,void 0).byteLength});g5({target:"ArrayBuffer",proto:!0,unsafe:!0,forced:x5},{slice:function(t,e){if(zA&&e===void 0)return zA(UA(this),t);for(var i=UA(this).byteLength,s=BA(t,i),u=BA(e===void 0?i:e,i),c=new k0(y5(u-s)),f=new z0(this),p=new z0(c),d=0;s<u;)_5(p,d++,v5(f,s++));return c}})});var V0=X((bit,HA)=>{"use strict";var VA=Sn(),E5=Uc(),S5=vs(),qA=VA.ArrayBuffer,w5=VA.TypeError;HA.exports=qA&&E5(qA.prototype,"byteLength","get")||function(n){if(S5(n)!=="ArrayBuffer")throw new w5("ArrayBuffer expected");return n.byteLength}});var H0=X((Ait,WA)=>{"use strict";var M5=Sn(),b5=Nh(),A5=V0(),T5=M5.DataView;WA.exports=function(n){if(!b5||A5(n)!==0)return!1;try{return new T5(n),!1}catch(t){return!0}}});var W0=X(()=>{"use strict";var C5=ri(),I5=$u(),P5=H0(),XA=ArrayBuffer.prototype;C5&&!("detached"in XA)&&I5(XA,"detached",{configurable:!0,get:function(){return P5(this)}})});var $A=X((Iit,YA)=>{"use strict";var R5=H0(),L5=TypeError;YA.exports=function(n){if(R5(n))throw new L5("ArrayBuffer is detached");return n}});var X0=X((Pit,ZA)=>{"use strict";var Jc=Sn(),N5=ku(),O5=vs(),Qh=function(n){return N5.slice(0,n.length)===n};ZA.exports=function(){return Qh("Bun/")?"BUN":Qh("Cloudflare-Workers")?"CLOUDFLARE":Qh("Deno/")?"DENO":Qh("Node.js/")?"NODE":Jc.Bun&&typeof Bun.version=="string"?"BUN":Jc.Deno&&typeof Deno.version=="object"?"DENO":O5(Jc.process)==="process"?"NODE":Jc.window&&Jc.document?"BROWSER":"REST"}()});var jA=X((Rit,JA)=>{"use strict";var D5=X0();JA.exports=D5==="NODE"});var QA=X((Lit,KA)=>{"use strict";var F5=Sn(),U5=jA();KA.exports=function(n){if(U5){try{return F5.process.getBuiltinModule(n)}catch(t){}try{return Function('return require("'+n+'")')()}catch(t){}}}});var Z0=X((Nit,eT)=>{"use strict";var B5=Sn(),z5=An(),Y0=Cc(),$0=X0(),tT=B5.structuredClone;eT.exports=!!tT&&!z5(function(){if($0==="DENO"&&Y0>92||$0==="NODE"&&Y0>94||$0==="BROWSER"&&Y0>97)return!1;var n=new ArrayBuffer(8),t=tT(n,{transfer:[n]});return n.byteLength!==0||t.byteLength!==8})});var oT=X((Oit,iT)=>{"use strict";var Q0=Sn(),G5=QA(),k5=Z0(),q5=Q0.structuredClone,nT=Q0.ArrayBuffer,tp=Q0.MessageChannel,K0=!1,J0,rT,ep,j0;if(k5)K0=function(n){q5(n,{transfer:[n]})};else if(nT)try{tp||(J0=G5("worker_threads"),J0&&(tp=J0.MessageChannel)),tp&&(rT=new tp,ep=new nT(2),j0=function(n){rT.port1.postMessage(null,[n])},ep.byteLength===2&&(j0(ep),ep.byteLength===0&&(K0=j0)))}catch(n){}iT.exports=K0});var oy=X((Dit,hT)=>{"use strict";var ny=Sn(),ry=In(),lT=Uc(),V5=Bh(),H5=$A(),W5=V0(),sT=oT(),ty=Z0(),X5=ny.structuredClone,cT=ny.ArrayBuffer,ey=ny.DataView,Y5=Math.min,iy=cT.prototype,fT=ey.prototype,$5=ry(iy.slice),aT=lT(iy,"resizable","get"),uT=lT(iy,"maxByteLength","get"),Z5=ry(fT.getInt8),J5=ry(fT.setInt8);hT.exports=(ty||sT)&&function(n,t,e){var i=W5(n),s=t===void 0?i:V5(t),u=!aT||!aT(n),c;if(H5(n),ty&&(n=X5(n,{transfer:[n]}),i===s&&(e||u)))return n;if(i>=s&&(!e||u))c=$5(n,0,s);else{var f=e&&!u&&uT?{maxByteLength:uT(n)}:void 0;c=new cT(s,f);for(var p=new ey(n),d=new ey(c),g=Y5(s,i),y=0;y<g;y++)J5(d,y,Z5(p,y))}return ty||sT(n),c}});var sy=X(()=>{"use strict";var j5=sr(),pT=oy();pT&&j5({target:"ArrayBuffer",proto:!0},{transfer:function(){return pT(this,arguments.length?arguments[0]:void 0,!0)}})});var ay=X(()=>{"use strict";var K5=sr(),dT=oy();dT&&K5({target:"ArrayBuffer",proto:!0},{transferToFixedLength:function(){return dT(this,arguments.length?arguments[0]:void 0,!1)}})});var To=X((Git,gT)=>{"use strict";var uy=In(),np=Set.prototype;gT.exports={Set,add:uy(np.add),has:uy(np.has),remove:uy(np.delete),proto:np}});var ea=X((kit,mT)=>{"use strict";var Q5=To().has;mT.exports=function(n){return Q5(n),n}});var na=X((qit,yT)=>{"use strict";var tV=vr();yT.exports=function(n,t,e){for(var i=e?n:n.iterator,s=n.next,u,c;!(u=tV(s,i)).done;)if(c=t(u.value),c!==void 0)return c}});var el=X((Vit,ST)=>{"use strict";var vT=In(),eV=na(),_T=To(),nV=_T.Set,xT=_T.proto,rV=vT(xT.forEach),ET=vT(xT.keys),iV=ET(new nV).next;ST.exports=function(n,t,e){return e?eV({iterator:ET(n),next:iV},t):rV(n,t)}});var rp=X((Hit,MT)=>{"use strict";var wT=To(),oV=el(),sV=wT.Set,aV=wT.add;MT.exports=function(n){var t=new sV;return oV(n,function(e){aV(t,e)}),t}});var nl=X((Wit,bT)=>{"use strict";var uV=Uc(),lV=To();bT.exports=uV(lV.proto,"size","get")||function(n){return n.size}});var TT=X((Xit,AT)=>{"use strict";AT.exports=function(n){return{iterator:n,next:n.next,done:!1}}});var ra=X((Yit,NT)=>{"use strict";var CT=_s(),RT=so(),IT=vr(),cV=Hi(),fV=TT(),PT="Invalid size",hV=RangeError,pV=TypeError,dV=Math.max,LT=function(n,t){this.set=n,this.size=dV(t,0),this.has=CT(n.has),this.keys=CT(n.keys)};LT.prototype={getIterator:function(){return fV(RT(IT(this.keys,this.set)))},includes:function(n){return IT(this.has,this.set,n)}};NT.exports=function(n){RT(n);var t=+n.size;if(t!==t)throw new pV(PT);var e=cV(t);if(e<0)throw new hV(PT);return new LT(n,e)}});var UT=X(($it,FT)=>{"use strict";var gV=ea(),DT=To(),mV=rp(),yV=nl(),vV=ra(),_V=el(),xV=na(),EV=DT.has,OT=DT.remove;FT.exports=function(t){var e=gV(this),i=vV(t),s=mV(e);return yV(e)<=i.size?_V(e,function(u){i.includes(u)&&OT(s,u)}):xV(i.getIterator(),function(u){EV(e,u)&&OT(s,u)}),s}});var ia=X((Zit,GT)=>{"use strict";var SV=$s(),BT=function(n){return{size:n,has:function(){return!1},keys:function(){return{next:function(){return{done:!0}}}}}},zT=function(n){return{size:n,has:function(){return!0},keys:function(){throw new Error("e")}}};GT.exports=function(n,t){var e=SV("Set");try{new e()[n](BT(0));try{return new e()[n](BT(-1)),!1}catch(s){if(!t)return!0;try{return new e()[n](zT(-1/0)),!1}catch(u){var i=new e;return i.add(1),i.add(2),t(i[n](zT(1/0)))}}}catch(s){return!1}}});var kT=X(()=>{"use strict";var wV=sr(),MV=UT(),bV=ia(),AV=!bV("difference",function(n){return n.size===0});wV({target:"Set",proto:!0,real:!0,forced:AV},{difference:MV})});var HT=X((Kit,VT)=>{"use strict";var TV=ea(),ly=To(),CV=nl(),IV=ra(),PV=el(),RV=na(),LV=ly.Set,qT=ly.add,NV=ly.has;VT.exports=function(t){var e=TV(this),i=IV(t),s=new LV;return CV(e)>i.size?RV(i.getIterator(),function(u){NV(e,u)&&qT(s,u)}):PV(e,function(u){i.includes(u)&&qT(s,u)}),s}});var WT=X(()=>{"use strict";var OV=sr(),DV=An(),FV=HT(),UV=ia(),BV=!UV("intersection",function(n){return n.size===2&&n.has(1)&&n.has(2)})||DV(function(){return String(Array.from(new Set([1,2,3]).intersection(new Set([3,2]))))!=="3,2"});OV({target:"Set",proto:!0,real:!0,forced:BV},{intersection:FV})});var cy=X((eot,YT)=>{"use strict";var zV=vr(),XT=so(),GV=Pc();YT.exports=function(n,t,e){var i,s;XT(n);try{if(i=GV(n,"return"),!i){if(t==="throw")throw e;return e}i=zV(i,n)}catch(u){s=!0,i=u}if(t==="throw")throw e;if(s)throw i;return XT(i),e}});var ZT=X((not,$T)=>{"use strict";var kV=ea(),qV=To().has,VV=nl(),HV=ra(),WV=el(),XV=na(),YV=cy();$T.exports=function(t){var e=kV(this),i=HV(t);if(VV(e)<=i.size)return WV(e,function(u){if(i.includes(u))return!1},!0)!==!1;var s=i.getIterator();return XV(s,function(u){if(qV(e,u))return YV(s,"normal",!1)})!==!1}});var JT=X(()=>{"use strict";var $V=sr(),ZV=ZT(),JV=ia(),jV=!JV("isDisjointFrom",function(n){return!n});$V({target:"Set",proto:!0,real:!0,forced:jV},{isDisjointFrom:ZV})});var KT=X((oot,jT)=>{"use strict";var KV=ea(),QV=nl(),tH=el(),eH=ra();jT.exports=function(t){var e=KV(this),i=eH(t);return QV(e)>i.size?!1:tH(e,function(s){if(!i.includes(s))return!1},!0)!==!1}});var QT=X(()=>{"use strict";var nH=sr(),rH=KT(),iH=ia(),oH=!iH("isSubsetOf",function(n){return n});nH({target:"Set",proto:!0,real:!0,forced:oH},{isSubsetOf:rH})});var eC=X((uot,tC)=>{"use strict";var sH=ea(),aH=To().has,uH=nl(),lH=ra(),cH=na(),fH=cy();tC.exports=function(t){var e=sH(this),i=lH(t);if(uH(e)<i.size)return!1;var s=i.getIterator();return cH(s,function(u){if(!aH(e,u))return fH(s,"normal",!1)})!==!1}});var nC=X(()=>{"use strict";var hH=sr(),pH=eC(),dH=ia(),gH=!dH("isSupersetOf",function(n){return!n});hH({target:"Set",proto:!0,real:!0,forced:gH},{isSupersetOf:pH})});var iC=X((fot,rC)=>{"use strict";var mH=ea(),fy=To(),yH=rp(),vH=ra(),_H=na(),xH=fy.add,EH=fy.has,SH=fy.remove;rC.exports=function(t){var e=mH(this),i=vH(t).getIterator(),s=yH(e);return _H(i,function(u){EH(e,u)?SH(s,u):xH(s,u)}),s}});var oC=X(()=>{"use strict";var wH=sr(),MH=iC(),bH=ia();wH({target:"Set",proto:!0,real:!0,forced:!bH("symmetricDifference")},{symmetricDifference:MH})});var aC=X((dot,sC)=>{"use strict";var AH=ea(),TH=To().add,CH=rp(),IH=ra(),PH=na();sC.exports=function(t){var e=AH(this),i=IH(t).getIterator(),s=CH(e);return PH(i,function(u){TH(s,u)}),s}});var uC=X(()=>{"use strict";var RH=sr(),LH=aC(),NH=ia();RH({target:"Set",proto:!0,real:!0,forced:!NH("union")},{union:LH})});var hy=X((yot,cC)=>{"use strict";var lC=qu(),OH=TypeError;cC.exports=function(n,t){if(!delete n[t])throw new OH("Cannot delete property "+lC(t)+" of "+lC(n))}});var fC=X(()=>{"use strict";var DH=sr(),FH=Vi(),UH=ii(),BH=vm(),zH=hy(),GH=wh(),kH=[].unshift(0)!==1,qH=function(){try{Object.defineProperty([],"length",{writable:!1}).unshift()}catch(n){return n instanceof TypeError}},VH=kH||!qH();DH({target:"Array",proto:!0,arity:1,forced:VH},{unshift:function(t){var e=FH(this),i=UH(e),s=arguments.length;if(s){GH(i+s);for(var u=i;u--;){var c=u+s;u in e?e[c]=e[u]:zH(e,c)}for(var f=0;f<s;f++)e[f]=arguments[f]}return BH(e,i+s)}})});var Fl=X((Not,gP)=>{"use strict";var bY=Zs(),AY=String;gP.exports=function(n){if(bY(n)==="Symbol")throw new TypeError("Cannot convert a Symbol value to a string");return AY(n)}});var yP=X((Oot,mP)=>{"use strict";var TY=so();mP.exports=function(){var n=TY(this),t="";return n.hasIndices&&(t+="d"),n.global&&(t+="g"),n.ignoreCase&&(t+="i"),n.multiline&&(t+="m"),n.dotAll&&(t+="s"),n.unicode&&(t+="u"),n.unicodeSets&&(t+="v"),n.sticky&&(t+="y"),t}});var _P=X((Dot,vP)=>{"use strict";var t_=An(),CY=Sn(),e_=CY.RegExp,n_=t_(function(){var n=e_("a","y");return n.lastIndex=2,n.exec("abcd")!==null}),IY=n_||t_(function(){return!e_("a","y").sticky}),PY=n_||t_(function(){var n=e_("^r","gy");return n.lastIndex=2,n.exec("str")!==null});vP.exports={BROKEN_CARET:PY,MISSED_STICKY:IY,UNSUPPORTED_Y:n_}});var EP=X((Fot,xP)=>{"use strict";var RY=An(),LY=Sn(),NY=LY.RegExp;xP.exports=RY(function(){var n=NY(".","s");return!(n.dotAll&&n.test(\`
|
|
8118
8118
|
\`)&&n.flags==="s")})});var wP=X((Uot,SP)=>{"use strict";var OY=An(),DY=Sn(),FY=DY.RegExp;SP.exports=OY(function(){var n=FY("(?<a>b)","g");return n.exec("b").groups.a!=="b"||"b".replace(n,"$<a>c")!=="bc"})});var gd=X((Bot,bP)=>{"use strict";var Ul=vr(),dd=In(),UY=Fl(),BY=yP(),zY=_P(),GY=ah(),kY=Hu(),qY=Va().get,VY=EP(),HY=wP(),WY=GY("native-string-replace",String.prototype.replace),pd=RegExp.prototype.exec,i_=pd,XY=dd("".charAt),YY=dd("".indexOf),$Y=dd("".replace),r_=dd("".slice),o_=function(){var n=/a/,t=/b*/g;return Ul(pd,n,"a"),Ul(pd,t,"a"),n.lastIndex!==0||t.lastIndex!==0}(),MP=zY.BROKEN_CARET,s_=/()??/.exec("")[1]!==void 0,ZY=o_||s_||MP||VY||HY;ZY&&(i_=function(t){var e=this,i=qY(e),s=UY(t),u=i.raw,c,f,p,d,g,y,v;if(u)return u.lastIndex=e.lastIndex,c=Ul(i_,u,s),e.lastIndex=u.lastIndex,c;var E=i.groups,M=MP&&e.sticky,A=Ul(BY,e),_=e.source,x=0,T=s;if(M&&(A=$Y(A,"y",""),YY(A,"g")===-1&&(A+="g"),T=r_(s,e.lastIndex),e.lastIndex>0&&(!e.multiline||e.multiline&&XY(s,e.lastIndex-1)!==\`
|
|
8119
8119
|
\`)&&(_="(?: "+_+")",T=" "+T,x++),f=new RegExp("^(?:"+_+")",A)),s_&&(f=new RegExp("^"+_+"$(?!\\\\s)",A)),o_&&(p=e.lastIndex),d=Ul(pd,M?f:e,T),M?d?(d.input=r_(d.input,x),d[0]=r_(d[0],x),d.index=e.lastIndex,e.lastIndex+=d[0].length):e.lastIndex=0:o_&&d&&(e.lastIndex=e.global?d.index+d[0].length:p),s_&&d&&d.length>1&&Ul(WY,d[0],f,function(){for(g=1;g<arguments.length-2;g++)arguments[g]===void 0&&(d[g]=void 0)}),d&&E)for(d.groups=y=kY(null),g=0;g<E.length;g++)v=E[g],y[v[0]]=d[v[1]];return d});bP.exports=i_});var a_=X(()=>{"use strict";var JY=sr(),AP=gd();JY({target:"RegExp",proto:!0,forced:/./.exec!==AP},{exec:AP})});var md=X((Yot,IP)=>{"use strict";var CP=Object.getOwnPropertySymbols,t$=Object.prototype.hasOwnProperty,e$=Object.prototype.propertyIsEnumerable;function n$(n){if(n==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(n)}function r$(){try{if(!Object.assign)return!1;var n=new String("abc");if(n[5]="de",Object.getOwnPropertyNames(n)[0]==="5")return!1;for(var t={},e=0;e<10;e++)t["_"+String.fromCharCode(e)]=e;var i=Object.getOwnPropertyNames(t).map(function(u){return t[u]});if(i.join("")!=="0123456789")return!1;var s={};return"abcdefghijklmnopqrst".split("").forEach(function(u){s[u]=u}),Object.keys(Object.assign({},s)).join("")==="abcdefghijklmnopqrst"}catch(u){return!1}}IP.exports=r$()?Object.assign:function(n,t){for(var e,i=n$(n),s,u=1;u<arguments.length;u++){e=Object(arguments[u]);for(var c in e)t$.call(e,c)&&(i[c]=e[c]);if(CP){s=CP(e);for(var f=0;f<s.length;f++)e$.call(e,s[f])&&(i[s[f]]=e[s[f]])}}return i}});var p_=X((f_,h_)=>{(function(n,t){typeof f_=="object"&&typeof h_!="undefined"?h_.exports=t():typeof define=="function"&&define.amd?define(t):(n=n||self).RBush=t()})(f_,function(){"use strict";function n(_,x,T,w,R){(function z(U,D,P,ct,L){for(;ct>P;){if(ct-P>600){var W=ct-P+1,V=D-P+1,Mt=Math.log(W),$=.5*Math.exp(2*Mt/3),gt=.5*Math.sqrt(Mt*$*(W-$)/W)*(V-W/2<0?-1:1),ft=Math.max(P,Math.floor(D-V*$/W+gt)),vt=Math.min(ct,Math.floor(D+(W-V)*$/W+gt));z(U,D,ft,vt,L)}var it=U[D],lt=P,H=ct;for(t(U,P,D),L(U[ct],it)>0&&t(U,P,ct);lt<H;){for(t(U,lt,H),lt++,H--;L(U[lt],it)<0;)lt++;for(;L(U[H],it)>0;)H--}L(U[P],it)===0?t(U,P,H):t(U,++H,ct),H<=D&&(P=H+1),D<=H&&(ct=H-1)}})(_,x,T||0,w||_.length-1,R||e)}function t(_,x,T){var w=_[x];_[x]=_[T],_[T]=w}function e(_,x){return _<x?-1:_>x?1:0}var i=function(_){_===void 0&&(_=9),this._maxEntries=Math.max(4,_),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()};function s(_,x,T){if(!T)return x.indexOf(_);for(var w=0;w<x.length;w++)if(T(_,x[w]))return w;return-1}function u(_,x){c(_,0,_.children.length,x,_)}function c(_,x,T,w,R){R||(R=M(null)),R.minX=1/0,R.minY=1/0,R.maxX=-1/0,R.maxY=-1/0;for(var z=x;z<T;z++){var U=_.children[z];f(R,_.leaf?w(U):U)}return R}function f(_,x){return _.minX=Math.min(_.minX,x.minX),_.minY=Math.min(_.minY,x.minY),_.maxX=Math.max(_.maxX,x.maxX),_.maxY=Math.max(_.maxY,x.maxY),_}function p(_,x){return _.minX-x.minX}function d(_,x){return _.minY-x.minY}function g(_){return(_.maxX-_.minX)*(_.maxY-_.minY)}function y(_){return _.maxX-_.minX+(_.maxY-_.minY)}function v(_,x){return _.minX<=x.minX&&_.minY<=x.minY&&x.maxX<=_.maxX&&x.maxY<=_.maxY}function E(_,x){return x.minX<=_.maxX&&x.minY<=_.maxY&&x.maxX>=_.minX&&x.maxY>=_.minY}function M(_){return{children:_,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function A(_,x,T,w,R){for(var z=[x,T];z.length;)if(!((T=z.pop())-(x=z.pop())<=w)){var U=x+Math.ceil((T-x)/w/2)*w;n(_,U,x,T,R),z.push(x,U,U,T)}}return i.prototype.all=function(){return this._all(this.data,[])},i.prototype.search=function(_){var x=this.data,T=[];if(!E(_,x))return T;for(var w=this.toBBox,R=[];x;){for(var z=0;z<x.children.length;z++){var U=x.children[z],D=x.leaf?w(U):U;E(_,D)&&(x.leaf?T.push(U):v(_,D)?this._all(U,T):R.push(U))}x=R.pop()}return T},i.prototype.collides=function(_){var x=this.data;if(!E(_,x))return!1;for(var T=[];x;){for(var w=0;w<x.children.length;w++){var R=x.children[w],z=x.leaf?this.toBBox(R):R;if(E(_,z)){if(x.leaf||v(_,z))return!0;T.push(R)}}x=T.pop()}return!1},i.prototype.load=function(_){if(!_||!_.length)return this;if(_.length<this._minEntries){for(var x=0;x<_.length;x++)this.insert(_[x]);return this}var T=this._build(_.slice(),0,_.length-1,0);if(this.data.children.length)if(this.data.height===T.height)this._splitRoot(this.data,T);else{if(this.data.height<T.height){var w=this.data;this.data=T,T=w}this._insert(T,this.data.height-T.height-1,!0)}else this.data=T;return this},i.prototype.insert=function(_){return _&&this._insert(_,this.data.height-1),this},i.prototype.clear=function(){return this.data=M([]),this},i.prototype.remove=function(_,x){if(!_)return this;for(var T,w,R,z=this.data,U=this.toBBox(_),D=[],P=[];z||D.length;){if(z||(z=D.pop(),w=D[D.length-1],T=P.pop(),R=!0),z.leaf){var ct=s(_,z.children,x);if(ct!==-1)return z.children.splice(ct,1),D.push(z),this._condense(D),this}R||z.leaf||!v(z,U)?w?(T++,z=w.children[T],R=!1):z=null:(D.push(z),P.push(T),T=0,w=z,z=z.children[0])}return this},i.prototype.toBBox=function(_){return _},i.prototype.compareMinX=function(_,x){return _.minX-x.minX},i.prototype.compareMinY=function(_,x){return _.minY-x.minY},i.prototype.toJSON=function(){return this.data},i.prototype.fromJSON=function(_){return this.data=_,this},i.prototype._all=function(_,x){for(var T=[];_;)_.leaf?x.push.apply(x,_.children):T.push.apply(T,_.children),_=T.pop();return x},i.prototype._build=function(_,x,T,w){var R,z=T-x+1,U=this._maxEntries;if(z<=U)return u(R=M(_.slice(x,T+1)),this.toBBox),R;w||(w=Math.ceil(Math.log(z)/Math.log(U)),U=Math.ceil(z/Math.pow(U,w-1))),(R=M([])).leaf=!1,R.height=w;var D=Math.ceil(z/U),P=D*Math.ceil(Math.sqrt(U));A(_,x,T,P,this.compareMinX);for(var ct=x;ct<=T;ct+=P){var L=Math.min(ct+P-1,T);A(_,ct,L,D,this.compareMinY);for(var W=ct;W<=L;W+=D){var V=Math.min(W+D-1,L);R.children.push(this._build(_,W,V,w-1))}}return u(R,this.toBBox),R},i.prototype._chooseSubtree=function(_,x,T,w){for(;w.push(x),!x.leaf&&w.length-1!==T;){for(var R=1/0,z=1/0,U=void 0,D=0;D<x.children.length;D++){var P=x.children[D],ct=g(P),L=(W=_,V=P,(Math.max(V.maxX,W.maxX)-Math.min(V.minX,W.minX))*(Math.max(V.maxY,W.maxY)-Math.min(V.minY,W.minY))-ct);L<z?(z=L,R=ct<R?ct:R,U=P):L===z&&ct<R&&(R=ct,U=P)}x=U||x.children[0]}var W,V;return x},i.prototype._insert=function(_,x,T){var w=T?_:this.toBBox(_),R=[],z=this._chooseSubtree(w,this.data,x,R);for(z.children.push(_),f(z,w);x>=0&&R[x].children.length>this._maxEntries;)this._split(R,x),x--;this._adjustParentBBoxes(w,R,x)},i.prototype._split=function(_,x){var T=_[x],w=T.children.length,R=this._minEntries;this._chooseSplitAxis(T,R,w);var z=this._chooseSplitIndex(T,R,w),U=M(T.children.splice(z,T.children.length-z));U.height=T.height,U.leaf=T.leaf,u(T,this.toBBox),u(U,this.toBBox),x?_[x-1].children.push(U):this._splitRoot(T,U)},i.prototype._splitRoot=function(_,x){this.data=M([_,x]),this.data.height=_.height+1,this.data.leaf=!1,u(this.data,this.toBBox)},i.prototype._chooseSplitIndex=function(_,x,T){for(var w,R,z,U,D,P,ct,L=1/0,W=1/0,V=x;V<=T-x;V++){var Mt=c(_,0,V,this.toBBox),$=c(_,V,T,this.toBBox),gt=(R=Mt,z=$,U=void 0,D=void 0,P=void 0,ct=void 0,U=Math.max(R.minX,z.minX),D=Math.max(R.minY,z.minY),P=Math.min(R.maxX,z.maxX),ct=Math.min(R.maxY,z.maxY),Math.max(0,P-U)*Math.max(0,ct-D)),ft=g(Mt)+g($);gt<L?(L=gt,w=V,W=ft<W?ft:W):gt===L&&ft<W&&(W=ft,w=V)}return w||T-x},i.prototype._chooseSplitAxis=function(_,x,T){var w=_.leaf?this.compareMinX:p,R=_.leaf?this.compareMinY:d;this._allDistMargin(_,x,T,w)<this._allDistMargin(_,x,T,R)&&_.children.sort(w)},i.prototype._allDistMargin=function(_,x,T,w){_.children.sort(w);for(var R=this.toBBox,z=c(_,0,x,R),U=c(_,T-x,T,R),D=y(z)+y(U),P=x;P<T-x;P++){var ct=_.children[P];f(z,_.leaf?R(ct):ct),D+=y(z)}for(var L=T-x-1;L>=x;L--){var W=_.children[L];f(U,_.leaf?R(W):W),D+=y(U)}return D},i.prototype._adjustParentBBoxes=function(_,x,T){for(var w=T;w>=0;w--)f(x[w],_)},i.prototype._condense=function(_){for(var x=_.length-1,T=void 0;x>=0;x--)_[x].children.length===0?x>0?(T=_[x-1].children).splice(T.indexOf(_[x]),1):this.clear():u(_[x],this.toBBox)},i})});var PP=X((d_,g_)=>{(function(n,t){typeof d_=="object"&&typeof g_!="undefined"?g_.exports=t():typeof define=="function"&&define.amd?define(t):(n=n||self,n.TinyQueue=t())})(d_,function(){"use strict";var n=function(i,s){if(i===void 0&&(i=[]),s===void 0&&(s=t),this.data=i,this.length=this.data.length,this.compare=s,this.length>0)for(var u=(this.length>>1)-1;u>=0;u--)this._down(u)};n.prototype.push=function(i){this.data.push(i),this.length++,this._up(this.length-1)},n.prototype.pop=function(){if(this.length!==0){var i=this.data[0],s=this.data.pop();return this.length--,this.length>0&&(this.data[0]=s,this._down(0)),i}},n.prototype.peek=function(){return this.data[0]},n.prototype._up=function(i){for(var s=this,u=s.data,c=s.compare,f=u[i];i>0;){var p=i-1>>1,d=u[p];if(c(f,d)>=0)break;u[i]=d,i=p}u[i]=f},n.prototype._down=function(i){for(var s=this,u=s.data,c=s.compare,f=this.length>>1,p=u[i];i<f;){var d=(i<<1)+1,g=u[d],y=d+1;if(y<this.length&&c(u[y],g)<0&&(d=y,g=u[y]),c(g,p)>=0)break;u[i]=g,i=d}u[i]=p};function t(e,i){return e<i?-1:e>i?1:0}return n})});var LP=X((Qot,RP)=>{RP.exports=function(t,e,i,s){var u=t[0],c=t[1],f=!1;i===void 0&&(i=0),s===void 0&&(s=e.length);for(var p=(s-i)/2,d=0,g=p-1;d<p;g=d++){var y=e[i+d*2+0],v=e[i+d*2+1],E=e[i+g*2+0],M=e[i+g*2+1],A=v>c!=M>c&&u<(E-y)*(c-v)/(M-v)+y;A&&(f=!f)}return f}});var OP=X((tst,NP)=>{NP.exports=function(t,e,i,s){var u=t[0],c=t[1],f=!1;i===void 0&&(i=0),s===void 0&&(s=e.length);for(var p=s-i,d=0,g=p-1;d<p;g=d++){var y=e[d+i][0],v=e[d+i][1],E=e[g+i][0],M=e[g+i][1],A=v>c!=M>c&&u<(E-y)*(c-v)/(M-v)+y;A&&(f=!f)}return f}});var UP=X((est,_d)=>{var DP=LP(),FP=OP();_d.exports=function(t,e,i,s){return e.length>0&&Array.isArray(e[0])?FP(t,e,i,s):DP(t,e,i,s)};_d.exports.nested=FP;_d.exports.flat=DP});var zP=X((xd,BP)=>{(function(n,t){typeof xd=="object"&&typeof BP!="undefined"?t(xd):typeof define=="function"&&define.amd?define(["exports"],t):t((n=n||self).predicates={})})(xd,function(n){"use strict";let e=33306690738754706e-32;function i(E,M,A,_,x){let T,w,R,z,U=M[0],D=_[0],P=0,ct=0;D>U==D>-U?(T=U,U=M[++P]):(T=D,D=_[++ct]);let L=0;if(P<E&&ct<A)for(D>U==D>-U?(R=T-((w=U+T)-U),U=M[++P]):(R=T-((w=D+T)-D),D=_[++ct]),T=w,R!==0&&(x[L++]=R);P<E&&ct<A;)D>U==D>-U?(R=T-((w=T+U)-(z=w-T))+(U-z),U=M[++P]):(R=T-((w=T+D)-(z=w-T))+(D-z),D=_[++ct]),T=w,R!==0&&(x[L++]=R);for(;P<E;)R=T-((w=T+U)-(z=w-T))+(U-z),U=M[++P],T=w,R!==0&&(x[L++]=R);for(;ct<A;)R=T-((w=T+D)-(z=w-T))+(D-z),D=_[++ct],T=w,R!==0&&(x[L++]=R);return T===0&&L!==0||(x[L++]=T),L}function s(E){return new Float64Array(E)}let u=33306690738754716e-32,c=22204460492503146e-32,f=11093356479670487e-47,p=s(4),d=s(8),g=s(12),y=s(16),v=s(4);n.orient2d=function(E,M,A,_,x,T){let w=(M-T)*(A-x),R=(E-x)*(_-T),z=w-R;if(w===0||R===0||w>0!=R>0)return z;let U=Math.abs(w+R);return Math.abs(z)>=u*U?z:-function(D,P,ct,L,W,V,Mt){let $,gt,ft,vt,it,lt,H,At,It,Kt,nt,bt,Vt,$t,Ut,Gt,Ct,ee,Z=D-W,Dt=ct-W,_t=P-V,Nt=L-V;it=(Ut=(At=Z-(H=(lt=134217729*Z)-(lt-Z)))*(Kt=Nt-(It=(lt=134217729*Nt)-(lt-Nt)))-(($t=Z*Nt)-H*It-At*It-H*Kt))-(nt=Ut-(Ct=(At=_t-(H=(lt=134217729*_t)-(lt-_t)))*(Kt=Dt-(It=(lt=134217729*Dt)-(lt-Dt)))-((Gt=_t*Dt)-H*It-At*It-H*Kt))),p[0]=Ut-(nt+it)+(it-Ct),it=(Vt=$t-((bt=$t+nt)-(it=bt-$t))+(nt-it))-(nt=Vt-Gt),p[1]=Vt-(nt+it)+(it-Gt),it=(ee=bt+nt)-bt,p[2]=bt-(ee-it)+(nt-it),p[3]=ee;let wt=function(Y,N){let xt=N[0];for(let St=1;St<Y;St++)xt+=N[St];return xt}(4,p),Ht=c*Mt;if(wt>=Ht||-wt>=Ht||($=D-(Z+(it=D-Z))+(it-W),ft=ct-(Dt+(it=ct-Dt))+(it-W),gt=P-(_t+(it=P-_t))+(it-V),vt=L-(Nt+(it=L-Nt))+(it-V),$===0&>===0&&ft===0&&vt===0)||(Ht=f*Mt+e*Math.abs(wt),(wt+=Z*vt+Nt*$-(_t*ft+Dt*gt))>=Ht||-wt>=Ht))return wt;it=(Ut=(At=$-(H=(lt=134217729*$)-(lt-$)))*(Kt=Nt-(It=(lt=134217729*Nt)-(lt-Nt)))-(($t=$*Nt)-H*It-At*It-H*Kt))-(nt=Ut-(Ct=(At=gt-(H=(lt=134217729*gt)-(lt-gt)))*(Kt=Dt-(It=(lt=134217729*Dt)-(lt-Dt)))-((Gt=gt*Dt)-H*It-At*It-H*Kt))),v[0]=Ut-(nt+it)+(it-Ct),it=(Vt=$t-((bt=$t+nt)-(it=bt-$t))+(nt-it))-(nt=Vt-Gt),v[1]=Vt-(nt+it)+(it-Gt),it=(ee=bt+nt)-bt,v[2]=bt-(ee-it)+(nt-it),v[3]=ee;let Xt=i(4,p,4,v,d);it=(Ut=(At=Z-(H=(lt=134217729*Z)-(lt-Z)))*(Kt=vt-(It=(lt=134217729*vt)-(lt-vt)))-(($t=Z*vt)-H*It-At*It-H*Kt))-(nt=Ut-(Ct=(At=_t-(H=(lt=134217729*_t)-(lt-_t)))*(Kt=ft-(It=(lt=134217729*ft)-(lt-ft)))-((Gt=_t*ft)-H*It-At*It-H*Kt))),v[0]=Ut-(nt+it)+(it-Ct),it=(Vt=$t-((bt=$t+nt)-(it=bt-$t))+(nt-it))-(nt=Vt-Gt),v[1]=Vt-(nt+it)+(it-Gt),it=(ee=bt+nt)-bt,v[2]=bt-(ee-it)+(nt-it),v[3]=ee;let Pt=i(Xt,d,4,v,g);it=(Ut=(At=$-(H=(lt=134217729*$)-(lt-$)))*(Kt=vt-(It=(lt=134217729*vt)-(lt-vt)))-(($t=$*vt)-H*It-At*It-H*Kt))-(nt=Ut-(Ct=(At=gt-(H=(lt=134217729*gt)-(lt-gt)))*(Kt=ft-(It=(lt=134217729*ft)-(lt-ft)))-((Gt=gt*ft)-H*It-At*It-H*Kt))),v[0]=Ut-(nt+it)+(it-Ct),it=(Vt=$t-((bt=$t+nt)-(it=bt-$t))+(nt-it))-(nt=Vt-Gt),v[1]=Vt-(nt+it)+(it-Gt),it=(ee=bt+nt)-bt,v[2]=bt-(ee-it)+(nt-it),v[3]=ee;let ne=i(Pt,g,4,v,y);return y[ne-1]}(E,M,A,_,x,T,U)},n.orient2dfast=function(E,M,A,_,x,T){return(M-T)*(A-x)-(E-x)*(_-T)},Object.defineProperty(n,"__esModule",{value:!0})})});var WP=X((nst,__)=>{"use strict";var GP=p_(),Sd=PP(),o$=UP(),s$=zP().orient2d;Sd.default&&(Sd=Sd.default);__.exports=HP;__.exports.default=HP;function HP(n,t,e){t=Math.max(0,t===void 0?2:t),e=e||0;var i=f$(n),s=new GP(16);s.toBBox=function(T){return{minX:T[0],minY:T[1],maxX:T[0],maxY:T[1]}},s.compareMinX=function(T,w){return T[0]-w[0]},s.compareMinY=function(T,w){return T[1]-w[1]},s.load(n);for(var u=[],c=0,f;c<i.length;c++){var p=i[c];s.remove(p),f=VP(p,f),u.push(f)}var d=new GP(16);for(c=0;c<u.length;c++)d.insert(m_(u[c]));for(var g=t*t,y=e*e;u.length;){var v=u.shift(),E=v.p,M=v.next.p,A=y_(E,M);if(!(A<y)){var _=A/g;p=a$(s,v.prev.p,E,M,v.next.next.p,_,d),p&&Math.min(y_(p,E),y_(p,M))<=_&&(u.push(v),u.push(VP(p,v)),s.remove(p),d.remove(v),d.insert(m_(v)),d.insert(m_(v.next)))}}v=f;var x=[];do x.push(v.p),v=v.next;while(v!==f);return x.push(v.p),x}function a$(n,t,e,i,s,u,c){for(var f=new Sd([],u$),p=n.data;p;){for(var d=0;d<p.children.length;d++){var g=p.children[d],y=p.leaf?v_(g,e,i):l$(e,i,g);y>u||f.push({node:g,dist:y})}for(;f.length&&!f.peek().node.children;){var v=f.pop(),E=v.node,M=v_(E,t,e),A=v_(E,i,s);if(v.dist<M&&v.dist<A&&qP(e,E,c)&&qP(i,E,c))return E}p=f.pop(),p&&(p=p.node)}return null}function u$(n,t){return n.dist-t.dist}function l$(n,t,e){if(kP(n,e)||kP(t,e))return 0;var i=Ed(n[0],n[1],t[0],t[1],e.minX,e.minY,e.maxX,e.minY);if(i===0)return 0;var s=Ed(n[0],n[1],t[0],t[1],e.minX,e.minY,e.minX,e.maxY);if(s===0)return 0;var u=Ed(n[0],n[1],t[0],t[1],e.maxX,e.minY,e.maxX,e.maxY);if(u===0)return 0;var c=Ed(n[0],n[1],t[0],t[1],e.minX,e.maxY,e.maxX,e.maxY);return c===0?0:Math.min(i,s,u,c)}function kP(n,t){return n[0]>=t.minX&&n[0]<=t.maxX&&n[1]>=t.minY&&n[1]<=t.maxY}function qP(n,t,e){for(var i=Math.min(n[0],t[0]),s=Math.min(n[1],t[1]),u=Math.max(n[0],t[0]),c=Math.max(n[1],t[1]),f=e.search({minX:i,minY:s,maxX:u,maxY:c}),p=0;p<f.length;p++)if(c$(f[p].p,f[p].next.p,n,t))return!1;return!0}function Bl(n,t,e){return s$(n[0],n[1],t[0],t[1],e[0],e[1])}function c$(n,t,e,i){return n!==i&&t!==e&&Bl(n,t,e)>0!=Bl(n,t,i)>0&&Bl(e,i,n)>0!=Bl(e,i,t)>0}function m_(n){var t=n.p,e=n.next.p;return n.minX=Math.min(t[0],e[0]),n.minY=Math.min(t[1],e[1]),n.maxX=Math.max(t[0],e[0]),n.maxY=Math.max(t[1],e[1]),n}function f$(n){for(var t=n[0],e=n[0],i=n[0],s=n[0],u=0;u<n.length;u++){var c=n[u];c[0]<t[0]&&(t=c),c[0]>i[0]&&(i=c),c[1]<e[1]&&(e=c),c[1]>s[1]&&(s=c)}var f=[t,e,i,s],p=f.slice();for(u=0;u<n.length;u++)o$(n[u],f)||p.push(n[u]);return p$(p)}function VP(n,t){var e={p:n,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 y_(n,t){var e=n[0]-t[0],i=n[1]-t[1];return e*e+i*i}function v_(n,t,e){var i=t[0],s=t[1],u=e[0]-i,c=e[1]-s;if(u!==0||c!==0){var f=((n[0]-i)*u+(n[1]-s)*c)/(u*u+c*c);f>1?(i=e[0],s=e[1]):f>0&&(i+=u*f,s+=c*f)}return u=n[0]-i,c=n[1]-s,u*u+c*c}function Ed(n,t,e,i,s,u,c,f){var p=e-n,d=i-t,g=c-s,y=f-u,v=n-s,E=t-u,M=p*p+d*d,A=p*g+d*y,_=g*g+y*y,x=p*v+d*E,T=g*v+y*E,w=M*_-A*A,R,z,U,D,P=w,ct=w;w===0?(z=0,P=1,D=T,ct=_):(z=A*T-_*x,D=M*T-A*x,z<0?(z=0,D=T,ct=_):z>P&&(z=P,D=T+A,ct=_)),D<0?(D=0,-x<0?z=0:-x>M?z=P:(z=-x,P=M)):D>ct&&(D=ct,-x+A<0?z=0:-x+A>M?z=P:(z=-x+A,P=M)),R=z===0?0:z/P,U=D===0?0:D/ct;var L=(1-R)*n+R*e,W=(1-R)*t+R*i,V=(1-U)*s+U*c,Mt=(1-U)*u+U*f,$=V-L,gt=Mt-W;return $*$+gt*gt}function h$(n,t){return n[0]===t[0]?n[1]-t[1]:n[0]-t[0]}function p$(n){n.sort(h$);for(var t=[],e=0;e<n.length;e++){for(;t.length>=2&&Bl(t[t.length-2],t[t.length-1],n[e])<=0;)t.pop();t.push(n[e])}for(var i=[],s=n.length-1;s>=0;s--){for(;i.length>=2&&Bl(i[i.length-2],i[i.length-1],n[s])<=0;)i.pop();i.push(n[s])}return i.pop(),t.pop(),t.concat(i)}});var jP=X((E_,S_)=>{(function(n,t){typeof E_=="object"&&typeof S_!="undefined"?S_.exports=t():typeof define=="function"&&define.amd?define(t):n.quickselect=t()})(E_,function(){"use strict";function n(s,u,c,f,p){t(s,u,c||0,f||s.length-1,p||i)}function t(s,u,c,f,p){for(;f>c;){if(f-c>600){var d=f-c+1,g=u-c+1,y=Math.log(d),v=.5*Math.exp(2*y/3),E=.5*Math.sqrt(y*v*(d-v)/d)*(g-d/2<0?-1:1),M=Math.max(c,Math.floor(u-g*v/d+E)),A=Math.min(f,Math.floor(u+(d-g)*v/d+E));t(s,u,M,A,p)}var _=s[u],x=c,T=f;for(e(s,c,u),p(s[f],_)>0&&e(s,c,f);x<T;){for(e(s,x,T),x++,T--;p(s[x],_)<0;)x++;for(;p(s[T],_)>0;)T--}p(s[c],_)===0?e(s,c,T):(T++,e(s,T,f)),T<=u&&(c=T+1),u<=T&&(f=T-1)}}function e(s,u,c){var f=s[u];s[u]=s[c],s[c]=f}function i(s,u){return s<u?-1:s>u?1:0}return n})});var A_=X((Cut,b_)=>{"use strict";b_.exports=Ef;b_.exports.default=Ef;var A$=jP();function Ef(n,t){if(!(this instanceof Ef))return new Ef(n,t);this._maxEntries=Math.max(4,n||9),this._minEntries=Math.max(2,Math.ceil(this._maxEntries*.4)),t&&this._initFormat(t),this.clear()}Ef.prototype={all:function(){return this._all(this.data,[])},search:function(n){var t=this.data,e=[],i=this.toBBox;if(!Md(n,t))return e;for(var s=[],u,c,f,p;t;){for(u=0,c=t.children.length;u<c;u++)f=t.children[u],p=t.leaf?i(f):f,Md(n,p)&&(t.leaf?e.push(f):M_(n,p)?this._all(f,e):s.push(f));t=s.pop()}return e},collides:function(n){var t=this.data,e=this.toBBox;if(!Md(n,t))return!1;for(var i=[],s,u,c,f;t;){for(s=0,u=t.children.length;s<u;s++)if(c=t.children[s],f=t.leaf?e(c):c,Md(n,f)){if(t.leaf||M_(n,f))return!0;i.push(c)}t=i.pop()}return!1},load:function(n){if(!(n&&n.length))return this;if(n.length<this._minEntries){for(var t=0,e=n.length;t<e;t++)this.insert(n[t]);return this}var i=this._build(n.slice(),0,n.length-1,0);if(!this.data.children.length)this.data=i;else if(this.data.height===i.height)this._splitRoot(this.data,i);else{if(this.data.height<i.height){var s=this.data;this.data=i,i=s}this._insert(i,this.data.height-i.height-1,!0)}return this},insert:function(n){return n&&this._insert(n,this.data.height-1),this},clear:function(){return this.data=kl([]),this},remove:function(n,t){if(!n)return this;for(var e=this.data,i=this.toBBox(n),s=[],u=[],c,f,p,d;e||s.length;){if(e||(e=s.pop(),f=s[s.length-1],c=u.pop(),d=!0),e.leaf&&(p=T$(n,e.children,t),p!==-1))return e.children.splice(p,1),s.push(e),this._condense(s),this;!d&&!e.leaf&&M_(e,i)?(s.push(e),u.push(c),c=0,f=e,e=e.children[0]):f?(c++,e=f.children[c],d=!1):e=null}return this},toBBox:function(n){return n},compareMinX:KP,compareMinY:QP,toJSON:function(){return this.data},fromJSON:function(n){return this.data=n,this},_all:function(n,t){for(var e=[];n;)n.leaf?t.push.apply(t,n.children):e.push.apply(e,n.children),n=e.pop();return t},_build:function(n,t,e,i){var s=e-t+1,u=this._maxEntries,c;if(s<=u)return c=kl(n.slice(t,e+1)),Gl(c,this.toBBox),c;i||(i=Math.ceil(Math.log(s)/Math.log(u)),u=Math.ceil(s/Math.pow(u,i-1))),c=kl([]),c.leaf=!1,c.height=i;var f=Math.ceil(s/u),p=f*Math.ceil(Math.sqrt(u)),d,g,y,v;for(tR(n,t,e,p,this.compareMinX),d=t;d<=e;d+=p)for(y=Math.min(d+p-1,e),tR(n,d,y,f,this.compareMinY),g=d;g<=y;g+=f)v=Math.min(g+f-1,y),c.children.push(this._build(n,g,v,i-1));return Gl(c,this.toBBox),c},_chooseSubtree:function(n,t,e,i){for(var s,u,c,f,p,d,g,y;i.push(t),!(t.leaf||i.length-1===e);){for(g=y=1/0,s=0,u=t.children.length;s<u;s++)c=t.children[s],p=w_(c),d=C$(n,c)-p,d<y?(y=d,g=p<g?p:g,f=c):d===y&&p<g&&(g=p,f=c);t=f||t.children[0]}return t},_insert:function(n,t,e){var i=this.toBBox,s=e?n:i(n),u=[],c=this._chooseSubtree(s,this.data,t,u);for(c.children.push(n),xf(c,s);t>=0&&u[t].children.length>this._maxEntries;)this._split(u,t),t--;this._adjustParentBBoxes(s,u,t)},_split:function(n,t){var e=n[t],i=e.children.length,s=this._minEntries;this._chooseSplitAxis(e,s,i);var u=this._chooseSplitIndex(e,s,i),c=kl(e.children.splice(u,e.children.length-u));c.height=e.height,c.leaf=e.leaf,Gl(e,this.toBBox),Gl(c,this.toBBox),t?n[t-1].children.push(c):this._splitRoot(e,c)},_splitRoot:function(n,t){this.data=kl([n,t]),this.data.height=n.height+1,this.data.leaf=!1,Gl(this.data,this.toBBox)},_chooseSplitIndex:function(n,t,e){var i,s,u,c,f,p,d,g;for(p=d=1/0,i=t;i<=e-t;i++)s=_f(n,0,i,this.toBBox),u=_f(n,i,e,this.toBBox),c=I$(s,u),f=w_(s)+w_(u),c<p?(p=c,g=i,d=f<d?f:d):c===p&&f<d&&(d=f,g=i);return g},_chooseSplitAxis:function(n,t,e){var i=n.leaf?this.compareMinX:KP,s=n.leaf?this.compareMinY:QP,u=this._allDistMargin(n,t,e,i),c=this._allDistMargin(n,t,e,s);u<c&&n.children.sort(i)},_allDistMargin:function(n,t,e,i){n.children.sort(i);var s=this.toBBox,u=_f(n,0,t,s),c=_f(n,e-t,e,s),f=wd(u)+wd(c),p,d;for(p=t;p<e-t;p++)d=n.children[p],xf(u,n.leaf?s(d):d),f+=wd(u);for(p=e-t-1;p>=t;p--)d=n.children[p],xf(c,n.leaf?s(d):d),f+=wd(c);return f},_adjustParentBBoxes:function(n,t,e){for(var i=e;i>=0;i--)xf(t[i],n)},_condense:function(n){for(var t=n.length-1,e;t>=0;t--)n[t].children.length===0?t>0?(e=n[t-1].children,e.splice(e.indexOf(n[t]),1)):this.clear():Gl(n[t],this.toBBox)},_initFormat:function(n){var t=["return a"," - b",";"];this.compareMinX=new Function("a","b",t.join(n[0])),this.compareMinY=new Function("a","b",t.join(n[1])),this.toBBox=new Function("a","return {minX: a"+n[0]+", minY: a"+n[1]+", maxX: a"+n[2]+", maxY: a"+n[3]+"};")}};function T$(n,t,e){if(!e)return t.indexOf(n);for(var i=0;i<t.length;i++)if(e(n,t[i]))return i;return-1}function Gl(n,t){_f(n,0,n.children.length,t,n)}function _f(n,t,e,i,s){s||(s=kl(null)),s.minX=1/0,s.minY=1/0,s.maxX=-1/0,s.maxY=-1/0;for(var u=t,c;u<e;u++)c=n.children[u],xf(s,n.leaf?i(c):c);return s}function xf(n,t){return n.minX=Math.min(n.minX,t.minX),n.minY=Math.min(n.minY,t.minY),n.maxX=Math.max(n.maxX,t.maxX),n.maxY=Math.max(n.maxY,t.maxY),n}function KP(n,t){return n.minX-t.minX}function QP(n,t){return n.minY-t.minY}function w_(n){return(n.maxX-n.minX)*(n.maxY-n.minY)}function wd(n){return n.maxX-n.minX+(n.maxY-n.minY)}function C$(n,t){return(Math.max(t.maxX,n.maxX)-Math.min(t.minX,n.minX))*(Math.max(t.maxY,n.maxY)-Math.min(t.minY,n.minY))}function I$(n,t){var e=Math.max(n.minX,t.minX),i=Math.max(n.minY,t.minY),s=Math.min(n.maxX,t.maxX),u=Math.min(n.maxY,t.maxY);return Math.max(0,s-e)*Math.max(0,u-i)}function M_(n,t){return n.minX<=t.minX&&n.minY<=t.minY&&t.maxX<=n.maxX&&t.maxY<=n.maxY}function Md(n,t){return t.minX<=n.maxX&&t.minY<=n.maxY&&t.maxX>=n.minX&&t.maxY>=n.minY}function kl(n){return{children:n,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function tR(n,t,e,i,s){for(var u=[t,e],c;u.length;)e=u.pop(),t=u.pop(),!(e-t<=i)&&(c=t+Math.ceil((e-t)/i/2)*i,A$(n,c,t,e,s),u.push(t,c,c,e))}});var sR=X((klt,L_)=>{"use strict";L_.exports=Cd;L_.exports.default=Cd;function Cd(n,t,e){e=e||2;var i=t&&t.length,s=i?t[0]*e:n.length,u=rR(n,0,s,e,!0),c=[];if(!u||u.next===u.prev)return c;var f,p,d,g,y,v,E;if(i&&(u=G$(n,t,u,e)),n.length>80*e){f=d=n[0],p=g=n[1];for(var M=e;M<s;M+=e)y=n[M],v=n[M+1],y<f&&(f=y),v<p&&(p=v),y>d&&(d=y),v>g&&(g=v);E=Math.max(d-f,g-p),E=E!==0?32767/E:0}return Mf(u,c,e,f,p,E,0),c}function rR(n,t,e,i,s){var u,c;if(s===R_(n,t,e,i)>0)for(u=t;u<e;u+=i)c=nR(u,n[u],n[u+1],c);else for(u=e-i;u>=t;u-=i)c=nR(u,n[u],n[u+1],c);return c&&Id(c,c.next)&&(Af(c),c=c.next),c}function gu(n,t){if(!n)return n;t||(t=n);var e=n,i;do if(i=!1,!e.steiner&&(Id(e,e.next)||tr(e.prev,e,e.next)===0)){if(Af(e),e=t=e.prev,e===e.next)break;i=!0}else e=e.next;while(i||e!==t);return t}function Mf(n,t,e,i,s,u,c){if(n){!c&&u&&W$(n,i,s,u);for(var f=n,p,d;n.prev!==n.next;){if(p=n.prev,d=n.next,u?U$(n,i,s,u):F$(n)){t.push(p.i/e|0),t.push(n.i/e|0),t.push(d.i/e|0),Af(n),n=d.next,f=d.next;continue}if(n=d,n===f){c?c===1?(n=B$(gu(n),t,e),Mf(n,t,e,i,s,u,2)):c===2&&z$(n,t,e,i,s,u):Mf(gu(n),t,e,i,s,u,1);break}}}}function F$(n){var t=n.prev,e=n,i=n.next;if(tr(t,e,i)>=0)return!1;for(var s=t.x,u=e.x,c=i.x,f=t.y,p=e.y,d=i.y,g=s<u?s<c?s:c:u<c?u:c,y=f<p?f<d?f:d:p<d?p:d,v=s>u?s>c?s:c:u>c?u:c,E=f>p?f>d?f:d:p>d?p:d,M=i.next;M!==t;){if(M.x>=g&&M.x<=v&&M.y>=y&&M.y<=E&&Hl(s,f,u,p,c,d,M.x,M.y)&&tr(M.prev,M,M.next)>=0)return!1;M=M.next}return!0}function U$(n,t,e,i){var s=n.prev,u=n,c=n.next;if(tr(s,u,c)>=0)return!1;for(var f=s.x,p=u.x,d=c.x,g=s.y,y=u.y,v=c.y,E=f<p?f<d?f:d:p<d?p:d,M=g<y?g<v?g:v:y<v?y:v,A=f>p?f>d?f:d:p>d?p:d,_=g>y?g>v?g:v:y>v?y:v,x=I_(E,M,t,e,i),T=I_(A,_,t,e,i),w=n.prevZ,R=n.nextZ;w&&w.z>=x&&R&&R.z<=T;){if(w.x>=E&&w.x<=A&&w.y>=M&&w.y<=_&&w!==s&&w!==c&&Hl(f,g,p,y,d,v,w.x,w.y)&&tr(w.prev,w,w.next)>=0||(w=w.prevZ,R.x>=E&&R.x<=A&&R.y>=M&&R.y<=_&&R!==s&&R!==c&&Hl(f,g,p,y,d,v,R.x,R.y)&&tr(R.prev,R,R.next)>=0))return!1;R=R.nextZ}for(;w&&w.z>=x;){if(w.x>=E&&w.x<=A&&w.y>=M&&w.y<=_&&w!==s&&w!==c&&Hl(f,g,p,y,d,v,w.x,w.y)&&tr(w.prev,w,w.next)>=0)return!1;w=w.prevZ}for(;R&&R.z<=T;){if(R.x>=E&&R.x<=A&&R.y>=M&&R.y<=_&&R!==s&&R!==c&&Hl(f,g,p,y,d,v,R.x,R.y)&&tr(R.prev,R,R.next)>=0)return!1;R=R.nextZ}return!0}function B$(n,t,e){var i=n;do{var s=i.prev,u=i.next.next;!Id(s,u)&&iR(s,i,i.next,u)&&bf(s,u)&&bf(u,s)&&(t.push(s.i/e|0),t.push(i.i/e|0),t.push(u.i/e|0),Af(i),Af(i.next),i=n=u),i=i.next}while(i!==n);return gu(i)}function z$(n,t,e,i,s,u){var c=n;do{for(var f=c.next.next;f!==c.prev;){if(c.i!==f.i&&$$(c,f)){var p=oR(c,f);c=gu(c,c.next),p=gu(p,p.next),Mf(c,t,e,i,s,u,0),Mf(p,t,e,i,s,u,0);return}f=f.next}c=c.next}while(c!==n)}function G$(n,t,e,i){var s=[],u,c,f,p,d;for(u=0,c=t.length;u<c;u++)f=t[u]*i,p=u<c-1?t[u+1]*i:n.length,d=rR(n,f,p,i,!1),d===d.next&&(d.steiner=!0),s.push(Y$(d));for(s.sort(k$),u=0;u<s.length;u++)e=q$(s[u],e);return e}function k$(n,t){return n.x-t.x}function q$(n,t){var e=V$(n,t);if(!e)return t;var i=oR(e,n);return gu(i,i.next),gu(e,e.next)}function V$(n,t){var e=t,i=n.x,s=n.y,u=-1/0,c;do{if(s<=e.y&&s>=e.next.y&&e.next.y!==e.y){var f=e.x+(s-e.y)*(e.next.x-e.x)/(e.next.y-e.y);if(f<=i&&f>u&&(u=f,c=e.x<e.next.x?e:e.next,f===i))return c}e=e.next}while(e!==t);if(!c)return null;var p=c,d=c.x,g=c.y,y=1/0,v;e=c;do i>=e.x&&e.x>=d&&i!==e.x&&Hl(s<g?i:u,s,d,g,s<g?u:i,s,e.x,e.y)&&(v=Math.abs(s-e.y)/(i-e.x),bf(e,n)&&(v<y||v===y&&(e.x>c.x||e.x===c.x&&H$(c,e)))&&(c=e,y=v)),e=e.next;while(e!==p);return c}function H$(n,t){return tr(n.prev,n,t.prev)<0&&tr(t.next,n,n.next)<0}function W$(n,t,e,i){var s=n;do s.z===0&&(s.z=I_(s.x,s.y,t,e,i)),s.prevZ=s.prev,s.nextZ=s.next,s=s.next;while(s!==n);s.prevZ.nextZ=null,s.prevZ=null,X$(s)}function X$(n){var t,e,i,s,u,c,f,p,d=1;do{for(e=n,n=null,u=null,c=0;e;){for(c++,i=e,f=0,t=0;t<d&&(f++,i=i.nextZ,!!i);t++);for(p=d;f>0||p>0&&i;)f!==0&&(p===0||!i||e.z<=i.z)?(s=e,e=e.nextZ,f--):(s=i,i=i.nextZ,p--),u?u.nextZ=s:n=s,s.prevZ=u,u=s;e=i}u.nextZ=null,d*=2}while(c>1);return n}function I_(n,t,e,i,s){return n=(n-e)*s|0,t=(t-i)*s|0,n=(n|n<<8)&16711935,n=(n|n<<4)&252645135,n=(n|n<<2)&858993459,n=(n|n<<1)&1431655765,t=(t|t<<8)&16711935,t=(t|t<<4)&252645135,t=(t|t<<2)&858993459,t=(t|t<<1)&1431655765,n|t<<1}function Y$(n){var t=n,e=n;do(t.x<e.x||t.x===e.x&&t.y<e.y)&&(e=t),t=t.next;while(t!==n);return e}function Hl(n,t,e,i,s,u,c,f){return(s-c)*(t-f)>=(n-c)*(u-f)&&(n-c)*(i-f)>=(e-c)*(t-f)&&(e-c)*(u-f)>=(s-c)*(i-f)}function $$(n,t){return n.next.i!==t.i&&n.prev.i!==t.i&&!Z$(n,t)&&(bf(n,t)&&bf(t,n)&&J$(n,t)&&(tr(n.prev,n,t.prev)||tr(n,t.prev,t))||Id(n,t)&&tr(n.prev,n,n.next)>0&&tr(t.prev,t,t.next)>0)}function tr(n,t,e){return(t.y-n.y)*(e.x-t.x)-(t.x-n.x)*(e.y-t.y)}function Id(n,t){return n.x===t.x&&n.y===t.y}function iR(n,t,e,i){var s=Td(tr(n,t,e)),u=Td(tr(n,t,i)),c=Td(tr(e,i,n)),f=Td(tr(e,i,t));return!!(s!==u&&c!==f||s===0&&Ad(n,e,t)||u===0&&Ad(n,i,t)||c===0&&Ad(e,n,i)||f===0&&Ad(e,t,i))}function Ad(n,t,e){return t.x<=Math.max(n.x,e.x)&&t.x>=Math.min(n.x,e.x)&&t.y<=Math.max(n.y,e.y)&&t.y>=Math.min(n.y,e.y)}function Td(n){return n>0?1:n<0?-1:0}function Z$(n,t){var e=n;do{if(e.i!==n.i&&e.next.i!==n.i&&e.i!==t.i&&e.next.i!==t.i&&iR(e,e.next,n,t))return!0;e=e.next}while(e!==n);return!1}function bf(n,t){return tr(n.prev,n,n.next)<0?tr(n,t,n.next)>=0&&tr(n,n.prev,t)>=0:tr(n,t,n.prev)<0||tr(n,n.next,t)<0}function J$(n,t){var e=n,i=!1,s=(n.x+t.x)/2,u=(n.y+t.y)/2;do e.y>u!=e.next.y>u&&e.next.y!==e.y&&s<(e.next.x-e.x)*(u-e.y)/(e.next.y-e.y)+e.x&&(i=!i),e=e.next;while(e!==n);return i}function oR(n,t){var e=new P_(n.i,n.x,n.y),i=new P_(t.i,t.x,t.y),s=n.next,u=t.prev;return n.next=t,t.prev=n,e.next=s,s.prev=e,i.next=e,e.prev=i,u.next=i,i.prev=u,i}function nR(n,t,e,i){var s=new P_(n,t,e);return i?(s.next=i.next,s.prev=i,i.next.prev=s,i.next=s):(s.prev=s,s.next=s),s}function Af(n){n.next.prev=n.prev,n.prev.next=n.next,n.prevZ&&(n.prevZ.nextZ=n.nextZ),n.nextZ&&(n.nextZ.prevZ=n.prevZ)}function P_(n,t,e){this.i=n,this.x=t,this.y=e,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}Cd.deviation=function(n,t,e,i){var s=t&&t.length,u=s?t[0]*e:n.length,c=Math.abs(R_(n,0,u,e));if(s)for(var f=0,p=t.length;f<p;f++){var d=t[f]*e,g=f<p-1?t[f+1]*e:n.length;c-=Math.abs(R_(n,d,g,e))}var y=0;for(f=0;f<i.length;f+=3){var v=i[f]*e,E=i[f+1]*e,M=i[f+2]*e;y+=Math.abs((n[v]-n[M])*(n[E+1]-n[v+1])-(n[v]-n[E])*(n[M+1]-n[v+1]))}return c===0&&y===0?0:Math.abs((y-c)/c)};function R_(n,t,e,i){for(var s=0,u=t,c=e-i;u<e;u+=i)s+=(n[c]-n[u])*(n[u+1]+n[c+1]),c=u;return s}Cd.flatten=function(n){for(var t=n[0][0].length,e={vertices:[],holes:[],dimensions:t},i=0,s=0;s<n.length;s++){for(var u=0;u<n[s].length;u++)for(var c=0;c<t;c++)e.vertices.push(n[s][u][c]);s>0&&(i+=n[s-1].length,e.holes.push(i))}return e}});var U_=X(ge=>{"use strict";Object.defineProperty(ge,"__esModule",{value:!0});ge.earthRadius=63710088e-1;ge.factors={centimeters:ge.earthRadius*100,centimetres:ge.earthRadius*100,degrees:ge.earthRadius/111325,feet:ge.earthRadius*3.28084,inches:ge.earthRadius*39.37,kilometers:ge.earthRadius/1e3,kilometres:ge.earthRadius/1e3,meters:ge.earthRadius,metres:ge.earthRadius,miles:ge.earthRadius/1609.344,millimeters:ge.earthRadius*1e3,millimetres:ge.earthRadius*1e3,nauticalmiles:ge.earthRadius/1852,radians:1,yards:ge.earthRadius*1.0936};ge.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/ge.earthRadius,yards:1.0936133};ge.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 Sa(n,t,e){e===void 0&&(e={});var i={type:"Feature"};return(e.id===0||e.id)&&(i.id=e.id),e.bbox&&(i.bbox=e.bbox),i.properties=t||{},i.geometry=n,i}ge.feature=Sa;function K$(n,t,e){switch(e===void 0&&(e={}),n){case"Point":return N_(t).geometry;case"LineString":return D_(t).geometry;case"Polygon":return O_(t).geometry;case"MultiPoint":return uR(t).geometry;case"MultiLineString":return aR(t).geometry;case"MultiPolygon":return lR(t).geometry;default:throw new Error(n+" is invalid")}}ge.geometry=K$;function N_(n,t,e){if(e===void 0&&(e={}),!n)throw new Error("coordinates is required");if(!Array.isArray(n))throw new Error("coordinates must be an Array");if(n.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!Pd(n[0])||!Pd(n[1]))throw new Error("coordinates must contain numbers");var i={type:"Point",coordinates:n};return Sa(i,t,e)}ge.point=N_;function Q$(n,t,e){return e===void 0&&(e={}),Rd(n.map(function(i){return N_(i,t)}),e)}ge.points=Q$;function O_(n,t,e){e===void 0&&(e={});for(var i=0,s=n;i<s.length;i++){var u=s[i];if(u.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");for(var c=0;c<u[u.length-1].length;c++)if(u[u.length-1][c]!==u[0][c])throw new Error("First and last Position are not equivalent.")}var f={type:"Polygon",coordinates:n};return Sa(f,t,e)}ge.polygon=O_;function tZ(n,t,e){return e===void 0&&(e={}),Rd(n.map(function(i){return O_(i,t)}),e)}ge.polygons=tZ;function D_(n,t,e){if(e===void 0&&(e={}),n.length<2)throw new Error("coordinates must be an array of two or more positions");var i={type:"LineString",coordinates:n};return Sa(i,t,e)}ge.lineString=D_;function eZ(n,t,e){return e===void 0&&(e={}),Rd(n.map(function(i){return D_(i,t)}),e)}ge.lineStrings=eZ;function Rd(n,t){t===void 0&&(t={});var e={type:"FeatureCollection"};return t.id&&(e.id=t.id),t.bbox&&(e.bbox=t.bbox),e.features=n,e}ge.featureCollection=Rd;function aR(n,t,e){e===void 0&&(e={});var i={type:"MultiLineString",coordinates:n};return Sa(i,t,e)}ge.multiLineString=aR;function uR(n,t,e){e===void 0&&(e={});var i={type:"MultiPoint",coordinates:n};return Sa(i,t,e)}ge.multiPoint=uR;function lR(n,t,e){e===void 0&&(e={});var i={type:"MultiPolygon",coordinates:n};return Sa(i,t,e)}ge.multiPolygon=lR;function nZ(n,t,e){e===void 0&&(e={});var i={type:"GeometryCollection",geometries:n};return Sa(i,t,e)}ge.geometryCollection=nZ;function rZ(n,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(n*e)/e}ge.round=rZ;function cR(n,t){t===void 0&&(t="kilometers");var e=ge.factors[t];if(!e)throw new Error(t+" units is invalid");return n*e}ge.radiansToLength=cR;function F_(n,t){t===void 0&&(t="kilometers");var e=ge.factors[t];if(!e)throw new Error(t+" units is invalid");return n/e}ge.lengthToRadians=F_;function iZ(n,t){return fR(F_(n,t))}ge.lengthToDegrees=iZ;function oZ(n){var t=n%360;return t<0&&(t+=360),t}ge.bearingToAzimuth=oZ;function fR(n){var t=n%(2*Math.PI);return t*180/Math.PI}ge.radiansToDegrees=fR;function sZ(n){var t=n%360;return t*Math.PI/180}ge.degreesToRadians=sZ;function aZ(n,t,e){if(t===void 0&&(t="kilometers"),e===void 0&&(e="kilometers"),!(n>=0))throw new Error("length must be a positive number");return cR(F_(n,t),e)}ge.convertLength=aZ;function uZ(n,t,e){if(t===void 0&&(t="meters"),e===void 0&&(e="kilometers"),!(n>=0))throw new Error("area must be a positive number");var i=ge.areaFactors[t];if(!i)throw new Error("invalid original units");var s=ge.areaFactors[e];if(!s)throw new Error("invalid final units");return n/i*s}ge.convertArea=uZ;function Pd(n){return!isNaN(n)&&n!==null&&!Array.isArray(n)}ge.isNumber=Pd;function lZ(n){return!!n&&n.constructor===Object}ge.isObject=lZ;function cZ(n){if(!n)throw new Error("bbox is required");if(!Array.isArray(n))throw new Error("bbox must be an Array");if(n.length!==4&&n.length!==6)throw new Error("bbox must be an Array of 4 or 6 numbers");n.forEach(function(t){if(!Pd(t))throw new Error("bbox must only contain numbers")})}ge.validateBBox=cZ;function fZ(n){if(!n)throw new Error("id is required");if(["string","number"].indexOf(typeof n)===-1)throw new Error("id must be a number or a string")}ge.validateId=fZ});var z_=X(Mr=>{"use strict";Object.defineProperty(Mr,"__esModule",{value:!0});var fi=U_();function Tf(n,t,e){if(n!==null)for(var i,s,u,c,f,p,d,g=0,y=0,v,E=n.type,M=E==="FeatureCollection",A=E==="Feature",_=M?n.features.length:1,x=0;x<_;x++){d=M?n.features[x].geometry:A?n.geometry:n,v=d?d.type==="GeometryCollection":!1,f=v?d.geometries.length:1;for(var T=0;T<f;T++){var w=0,R=0;if(c=v?d.geometries[T]:d,c!==null){p=c.coordinates;var z=c.type;switch(g=e&&(z==="Polygon"||z==="MultiPolygon")?1:0,z){case null:break;case"Point":if(t(p,y,x,w,R)===!1)return!1;y++,w++;break;case"LineString":case"MultiPoint":for(i=0;i<p.length;i++){if(t(p[i],y,x,w,R)===!1)return!1;y++,z==="MultiPoint"&&w++}z==="LineString"&&w++;break;case"Polygon":case"MultiLineString":for(i=0;i<p.length;i++){for(s=0;s<p[i].length-g;s++){if(t(p[i][s],y,x,w,R)===!1)return!1;y++}z==="MultiLineString"&&w++,z==="Polygon"&&R++}z==="Polygon"&&w++;break;case"MultiPolygon":for(i=0;i<p.length;i++){for(R=0,s=0;s<p[i].length;s++){for(u=0;u<p[i][s].length-g;u++){if(t(p[i][s][u],y,x,w,R)===!1)return!1;y++}R++}w++}break;case"GeometryCollection":for(i=0;i<c.geometries.length;i++)if(Tf(c.geometries[i],t,e)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function hZ(n,t,e,i){var s=e;return Tf(n,function(u,c,f,p,d){c===0&&e===void 0?s=u:s=t(s,u,c,f,p,d)},i),s}function hR(n,t){var e;switch(n.type){case"FeatureCollection":for(e=0;e<n.features.length&&t(n.features[e].properties,e)!==!1;e++);break;case"Feature":t(n.properties,0);break}}function pZ(n,t,e){var i=e;return hR(n,function(s,u){u===0&&e===void 0?i=s:i=t(i,s,u)}),i}function pR(n,t){if(n.type==="Feature")t(n,0);else if(n.type==="FeatureCollection")for(var e=0;e<n.features.length&&t(n.features[e],e)!==!1;e++);}function dZ(n,t,e){var i=e;return pR(n,function(s,u){u===0&&e===void 0?i=s:i=t(i,s,u)}),i}function gZ(n){var t=[];return Tf(n,function(e){t.push(e)}),t}function B_(n,t){var e,i,s,u,c,f,p,d,g,y,v=0,E=n.type==="FeatureCollection",M=n.type==="Feature",A=E?n.features.length:1;for(e=0;e<A;e++){for(f=E?n.features[e].geometry:M?n.geometry:n,d=E?n.features[e].properties:M?n.properties:{},g=E?n.features[e].bbox:M?n.bbox:void 0,y=E?n.features[e].id:M?n.id:void 0,p=f?f.type==="GeometryCollection":!1,c=p?f.geometries.length:1,s=0;s<c;s++){if(u=p?f.geometries[s]:f,u===null){if(t(null,v,d,g,y)===!1)return!1;continue}switch(u.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":{if(t(u,v,d,g,y)===!1)return!1;break}case"GeometryCollection":{for(i=0;i<u.geometries.length;i++)if(t(u.geometries[i],v,d,g,y)===!1)return!1;break}default:throw new Error("Unknown Geometry Type")}}v++}}function mZ(n,t,e){var i=e;return B_(n,function(s,u,c,f,p){u===0&&e===void 0?i=s:i=t(i,s,u,c,f,p)}),i}function Ld(n,t){B_(n,function(e,i,s,u,c){var f=e===null?null:e.type;switch(f){case null:case"Point":case"LineString":case"Polygon":return t(fi.feature(e,s,{bbox:u,id:c}),i,0)===!1?!1:void 0}var p;switch(f){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],y={type:p,coordinates:g};if(t(fi.feature(y,s),i,d)===!1)return!1}})}function yZ(n,t,e){var i=e;return Ld(n,function(s,u,c){u===0&&c===0&&e===void 0?i=s:i=t(i,s,u,c)}),i}function dR(n,t){Ld(n,function(e,i,s){var u=0;if(e.geometry){var c=e.geometry.type;if(!(c==="Point"||c==="MultiPoint")){var f,p=0,d=0,g=0;if(Tf(e,function(y,v,E,M,A){if(f===void 0||i>p||M>d||A>g){f=y,p=i,d=M,g=A,u=0;return}var _=fi.lineString([f,y],e.properties);if(t(_,i,s,A,u)===!1)return!1;u++,f=y})===!1)return!1}}})}function vZ(n,t,e){var i=e,s=!1;return dR(n,function(u,c,f,p,d){s===!1&&e===void 0?i=u:i=t(i,u,c,f,p,d),s=!0}),i}function gR(n,t){if(!n)throw new Error("geojson is required");Ld(n,function(e,i,s){if(e.geometry!==null){var u=e.geometry.type,c=e.geometry.coordinates;switch(u){case"LineString":if(t(e,i,s,0,0)===!1)return!1;break;case"Polygon":for(var f=0;f<c.length;f++)if(t(fi.lineString(c[f],e.properties),i,s,f)===!1)return!1;break}}})}function _Z(n,t,e){var i=e;return gR(n,function(s,u,c,f){u===0&&e===void 0?i=s:i=t(i,s,u,c,f)}),i}function xZ(n,t){if(t=t||{},!fi.isObject(t))throw new Error("options is invalid");var e=t.featureIndex||0,i=t.multiFeatureIndex||0,s=t.geometryIndex||0,u=t.segmentIndex||0,c=t.properties,f;switch(n.type){case"FeatureCollection":e<0&&(e=n.features.length+e),c=c||n.features[e].properties,f=n.features[e].geometry;break;case"Feature":c=c||n.properties,f=n.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":f=n;break;default:throw new Error("geojson is invalid")}if(f===null)return null;var p=f.coordinates;switch(f.type){case"Point":case"MultiPoint":return null;case"LineString":return u<0&&(u=p.length+u-1),fi.lineString([p[u],p[u+1]],c,t);case"Polygon":return s<0&&(s=p.length+s),u<0&&(u=p[s].length+u-1),fi.lineString([p[s][u],p[s][u+1]],c,t);case"MultiLineString":return i<0&&(i=p.length+i),u<0&&(u=p[i].length+u-1),fi.lineString([p[i][u],p[i][u+1]],c,t);case"MultiPolygon":return i<0&&(i=p.length+i),s<0&&(s=p[i].length+s),u<0&&(u=p[i][s].length-u-1),fi.lineString([p[i][s][u],p[i][s][u+1]],c,t)}throw new Error("geojson is invalid")}function EZ(n,t){if(t=t||{},!fi.isObject(t))throw new Error("options is invalid");var e=t.featureIndex||0,i=t.multiFeatureIndex||0,s=t.geometryIndex||0,u=t.coordIndex||0,c=t.properties,f;switch(n.type){case"FeatureCollection":e<0&&(e=n.features.length+e),c=c||n.features[e].properties,f=n.features[e].geometry;break;case"Feature":c=c||n.properties,f=n.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":f=n;break;default:throw new Error("geojson is invalid")}if(f===null)return null;var p=f.coordinates;switch(f.type){case"Point":return fi.point(p,c,t);case"MultiPoint":return i<0&&(i=p.length+i),fi.point(p[i],c,t);case"LineString":return u<0&&(u=p.length+u),fi.point(p[u],c,t);case"Polygon":return s<0&&(s=p.length+s),u<0&&(u=p[s].length+u),fi.point(p[s][u],c,t);case"MultiLineString":return i<0&&(i=p.length+i),u<0&&(u=p[i].length+u),fi.point(p[i][u],c,t);case"MultiPolygon":return i<0&&(i=p.length+i),s<0&&(s=p[i].length+s),u<0&&(u=p[i][s].length-u),fi.point(p[i][s][u],c,t)}throw new Error("geojson is invalid")}Mr.coordAll=gZ;Mr.coordEach=Tf;Mr.coordReduce=hZ;Mr.featureEach=pR;Mr.featureReduce=dZ;Mr.findPoint=EZ;Mr.findSegment=xZ;Mr.flattenEach=Ld;Mr.flattenReduce=yZ;Mr.geomEach=B_;Mr.geomReduce=mZ;Mr.lineEach=gR;Mr.lineReduce=_Z;Mr.propEach=hR;Mr.propReduce=pZ;Mr.segmentEach=dR;Mr.segmentReduce=vZ});var mR=X(k_=>{"use strict";Object.defineProperty(k_,"__esModule",{value:!0});var SZ=z_();function G_(n){var t=[1/0,1/0,-1/0,-1/0];return SZ.coordEach(n,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}G_.default=G_;k_.default=G_});var Nd=X((rct,q_)=>{var ns=p_(),vR=U_(),_R=z_(),Wl=mR().default,wZ=_R.featureEach,ect=_R.coordEach,nct=vR.polygon,yR=vR.featureCollection;function xR(n){var t=new ns(n);return t.insert=function(e){if(e.type!=="Feature")throw new Error("invalid feature");return e.bbox=e.bbox?e.bbox:Wl(e),ns.prototype.insert.call(this,e)},t.load=function(e){var i=[];return Array.isArray(e)?e.forEach(function(s){if(s.type!=="Feature")throw new Error("invalid features");s.bbox=s.bbox?s.bbox:Wl(s),i.push(s)}):wZ(e,function(s){if(s.type!=="Feature")throw new Error("invalid features");s.bbox=s.bbox?s.bbox:Wl(s),i.push(s)}),ns.prototype.load.call(this,i)},t.remove=function(e,i){if(e.type!=="Feature")throw new Error("invalid feature");return e.bbox=e.bbox?e.bbox:Wl(e),ns.prototype.remove.call(this,e,i)},t.clear=function(){return ns.prototype.clear.call(this)},t.search=function(e){var i=ns.prototype.search.call(this,this.toBBox(e));return yR(i)},t.collides=function(e){return ns.prototype.collides.call(this,this.toBBox(e))},t.all=function(){var e=ns.prototype.all.call(this);return yR(e)},t.toJSON=function(){return ns.prototype.toJSON.call(this)},t.fromJSON=function(e){return ns.prototype.fromJSON.call(this,e)},t.toBBox=function(e){var i;if(e.bbox)i=e.bbox;else if(Array.isArray(e)&&e.length===4)i=e;else if(Array.isArray(e)&&e.length===6)i=[e[0],e[1],e[3],e[4]];else if(e.type==="Feature")i=Wl(e);else if(e.type==="FeatureCollection")i=Wl(e);else throw new Error("invalid geojson");return{minX:i[0],minY:i[1],maxX:i[2],maxY:i[3]}},t}q_.exports=xR;q_.exports.default=xR});var $_=X((hht,PR)=>{"use strict";var IR=Object.prototype.toString;PR.exports=function(t){var e=IR.call(t),i=e==="[object Arguments]";return i||(i=e!=="[object Array]"&&t!==null&&typeof t=="object"&&typeof t.length=="number"&&t.length>=0&&IR.call(t.callee)==="[object Function]"),i}});var zR=X((pht,BR)=>{"use strict";var UR;Object.keys||(Pf=Object.prototype.hasOwnProperty,Z_=Object.prototype.toString,RR=$_(),J_=Object.prototype.propertyIsEnumerable,LR=!J_.call({toString:null},"toString"),NR=J_.call(function(){},"prototype"),Rf=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],Ud=function(n){var t=n.constructor;return t&&t.prototype===n},OR={$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},DR=function(){if(typeof window=="undefined")return!1;for(var n in window)try{if(!OR["$"+n]&&Pf.call(window,n)&&window[n]!==null&&typeof window[n]=="object")try{Ud(window[n])}catch(t){return!0}}catch(t){return!0}return!1}(),FR=function(n){if(typeof window=="undefined"||!DR)return Ud(n);try{return Ud(n)}catch(t){return!1}},UR=function(t){var e=t!==null&&typeof t=="object",i=Z_.call(t)==="[object Function]",s=RR(t),u=e&&Z_.call(t)==="[object String]",c=[];if(!e&&!i&&!s)throw new TypeError("Object.keys called on a non-object");var f=NR&&i;if(u&&t.length>0&&!Pf.call(t,0))for(var p=0;p<t.length;++p)c.push(String(p));if(s&&t.length>0)for(var d=0;d<t.length;++d)c.push(String(d));else for(var g in t)!(f&&g==="prototype")&&Pf.call(t,g)&&c.push(String(g));if(LR)for(var y=FR(t),v=0;v<Rf.length;++v)!(y&&Rf[v]==="constructor")&&Pf.call(t,Rf[v])&&c.push(Rf[v]);return c});var Pf,Z_,RR,J_,LR,NR,Rf,Ud,OR,DR,FR;BR.exports=UR});var j_=X((dht,qR)=>{"use strict";var NZ=Array.prototype.slice,OZ=$_(),GR=Object.keys,Bd=GR?function(t){return GR(t)}:zR(),kR=Object.keys;Bd.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(i){return OZ(i)?kR(NZ.call(i)):kR(i)})}else Object.keys=Bd;return Object.keys||Bd};qR.exports=Bd});var K_=X((ght,VR)=>{"use strict";VR.exports=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var t={},e=Symbol("test"),i=Object(e);if(typeof e=="string"||Object.prototype.toString.call(e)!=="[object Symbol]"||Object.prototype.toString.call(i)!=="[object Symbol]")return!1;var s=42;t[e]=s;for(var u in t)return!1;if(typeof Object.keys=="function"&&Object.keys(t).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(t).length!==0)return!1;var c=Object.getOwnPropertySymbols(t);if(c.length!==1||c[0]!==e||!Object.prototype.propertyIsEnumerable.call(t,e))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var f=Object.getOwnPropertyDescriptor(t,e);if(f.value!==s||f.enumerable!==!0)return!1}return!0}});var zd=X((mht,HR)=>{"use strict";var DZ=K_();HR.exports=function(){return DZ()&&!!Symbol.toStringTag}});var Q_=X((yht,WR)=>{"use strict";WR.exports=Object});var tx=X((vht,XR)=>{"use strict";XR.exports=Error});var $R=X((_ht,YR)=>{"use strict";YR.exports=EvalError});var JR=X((xht,ZR)=>{"use strict";ZR.exports=RangeError});var KR=X((Eht,jR)=>{"use strict";jR.exports=ReferenceError});var ex=X((Sht,QR)=>{"use strict";QR.exports=SyntaxError});var mu=X((wht,tL)=>{"use strict";tL.exports=TypeError});var nL=X((Mht,eL)=>{"use strict";eL.exports=URIError});var iL=X((bht,rL)=>{"use strict";rL.exports=Math.abs});var sL=X((Aht,oL)=>{"use strict";oL.exports=Math.floor});var uL=X((Tht,aL)=>{"use strict";aL.exports=Math.max});var cL=X((Cht,lL)=>{"use strict";lL.exports=Math.min});var hL=X((Iht,fL)=>{"use strict";fL.exports=Math.pow});var dL=X((Pht,pL)=>{"use strict";pL.exports=Math.round});var mL=X((Rht,gL)=>{"use strict";gL.exports=Number.isNaN||function(t){return t!==t}});var vL=X((Lht,yL)=>{"use strict";var FZ=mL();yL.exports=function(t){return FZ(t)||t===0?t:t<0?-1:1}});var xL=X((Nht,_L)=>{"use strict";_L.exports=Object.getOwnPropertyDescriptor});var yu=X((Oht,EL)=>{"use strict";var Gd=xL();if(Gd)try{Gd([],"length")}catch(n){Gd=null}EL.exports=Gd});var Lf=X((Dht,SL)=>{"use strict";var kd=Object.defineProperty||!1;if(kd)try{kd({},"a",{value:1})}catch(n){kd=!1}SL.exports=kd});var bL=X((Fht,ML)=>{"use strict";var wL=typeof Symbol!="undefined"&&Symbol,UZ=K_();ML.exports=function(){return typeof wL!="function"||typeof Symbol!="function"||typeof wL("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:UZ()}});var nx=X((Uht,AL)=>{"use strict";AL.exports=typeof Reflect!="undefined"&&Reflect.getPrototypeOf||null});var rx=X((Bht,TL)=>{"use strict";var BZ=Q_();TL.exports=BZ.getPrototypeOf||null});var PL=X((zht,IL)=>{"use strict";var zZ="Function.prototype.bind called on incompatible ",GZ=Object.prototype.toString,kZ=Math.max,qZ="[object Function]",CL=function(t,e){for(var i=[],s=0;s<t.length;s+=1)i[s]=t[s];for(var u=0;u<e.length;u+=1)i[u+t.length]=e[u];return i},VZ=function(t,e){for(var i=[],s=e||0,u=0;s<t.length;s+=1,u+=1)i[u]=t[s];return i},HZ=function(n,t){for(var e="",i=0;i<n.length;i+=1)e+=n[i],i+1<n.length&&(e+=t);return e};IL.exports=function(t){var e=this;if(typeof e!="function"||GZ.apply(e)!==qZ)throw new TypeError(zZ+e);for(var i=VZ(arguments,1),s,u=function(){if(this instanceof s){var g=e.apply(this,CL(i,arguments));return Object(g)===g?g:this}return e.apply(t,CL(i,arguments))},c=kZ(0,e.length-i.length),f=[],p=0;p<c;p++)f[p]="$"+p;if(s=Function("binder","return function ("+HZ(f,",")+"){ return binder.apply(this,arguments); }")(u),e.prototype){var d=function(){};d.prototype=e.prototype,s.prototype=new d,d.prototype=null}return s}});var Xl=X((Ght,RL)=>{"use strict";var WZ=PL();RL.exports=Function.prototype.bind||WZ});var qd=X((kht,LL)=>{"use strict";LL.exports=Function.prototype.call});var Vd=X((qht,NL)=>{"use strict";NL.exports=Function.prototype.apply});var DL=X((Vht,OL)=>{"use strict";OL.exports=typeof Reflect!="undefined"&&Reflect&&Reflect.apply});var ix=X((Hht,FL)=>{"use strict";var XZ=Xl(),YZ=Vd(),$Z=qd(),ZZ=DL();FL.exports=ZZ||XZ.call($Z,YZ)});var Hd=X((Wht,UL)=>{"use strict";var JZ=Xl(),jZ=mu(),KZ=qd(),QZ=ix();UL.exports=function(t){if(t.length<1||typeof t[0]!="function")throw new jZ("a function is required");return QZ(JZ,KZ,t)}});var VL=X((Xht,qL)=>{"use strict";var tJ=Hd(),BL=yu(),GL;try{GL=[].__proto__===Array.prototype}catch(n){if(!n||typeof n!="object"||!("code"in n)||n.code!=="ERR_PROTO_ACCESS")throw n}var ox=!!GL&&BL&&BL(Object.prototype,"__proto__"),kL=Object,zL=kL.getPrototypeOf;qL.exports=ox&&typeof ox.get=="function"?tJ([ox.get]):typeof zL=="function"?function(t){return zL(t==null?t:kL(t))}:!1});var sx=X((Yht,YL)=>{"use strict";var HL=nx(),WL=rx(),XL=VL();YL.exports=HL?function(t){return HL(t)}:WL?function(t){if(!t||typeof t!="object"&&typeof t!="function")throw new TypeError("getProto: not an object");return WL(t)}:XL?function(t){return XL(t)}:null});var ax=X(($ht,$L)=>{"use strict";var eJ=Function.prototype.call,nJ=Object.prototype.hasOwnProperty,rJ=Xl();$L.exports=rJ.call(eJ,nJ)});var cx=X((Zht,tN)=>{"use strict";var tn,iJ=Q_(),oJ=tx(),sJ=$R(),aJ=JR(),uJ=KR(),Jl=ex(),Zl=mu(),lJ=nL(),cJ=iL(),fJ=sL(),hJ=uL(),pJ=cL(),dJ=hL(),gJ=dL(),mJ=vL(),KL=Function,ux=function(n){try{return KL('"use strict"; return ('+n+").constructor;")()}catch(t){}},Nf=yu(),yJ=Lf(),lx=function(){throw new Zl},vJ=Nf?function(){try{return arguments.callee,lx}catch(n){try{return Nf(arguments,"callee").get}catch(t){return lx}}}():lx,Yl=bL()(),Gr=sx(),_J=rx(),xJ=nx(),QL=Vd(),Of=qd(),$l={},EJ=typeof Uint8Array=="undefined"||!Gr?tn:Gr(Uint8Array),vu={__proto__:null,"%AggregateError%":typeof AggregateError=="undefined"?tn:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer=="undefined"?tn:ArrayBuffer,"%ArrayIteratorPrototype%":Yl&&Gr?Gr([][Symbol.iterator]()):tn,"%AsyncFromSyncIteratorPrototype%":tn,"%AsyncFunction%":$l,"%AsyncGenerator%":$l,"%AsyncGeneratorFunction%":$l,"%AsyncIteratorPrototype%":$l,"%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%":oJ,"%eval%":eval,"%EvalError%":sJ,"%Float16Array%":typeof Float16Array=="undefined"?tn:Float16Array,"%Float32Array%":typeof Float32Array=="undefined"?tn:Float32Array,"%Float64Array%":typeof Float64Array=="undefined"?tn:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry=="undefined"?tn:FinalizationRegistry,"%Function%":KL,"%GeneratorFunction%":$l,"%Int8Array%":typeof Int8Array=="undefined"?tn:Int8Array,"%Int16Array%":typeof Int16Array=="undefined"?tn:Int16Array,"%Int32Array%":typeof Int32Array=="undefined"?tn:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":Yl&&Gr?Gr(Gr([][Symbol.iterator]())):tn,"%JSON%":typeof JSON=="object"?JSON:tn,"%Map%":typeof Map=="undefined"?tn:Map,"%MapIteratorPrototype%":typeof Map=="undefined"||!Yl||!Gr?tn:Gr(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":iJ,"%Object.getOwnPropertyDescriptor%":Nf,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise=="undefined"?tn:Promise,"%Proxy%":typeof Proxy=="undefined"?tn:Proxy,"%RangeError%":aJ,"%ReferenceError%":uJ,"%Reflect%":typeof Reflect=="undefined"?tn:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set=="undefined"?tn:Set,"%SetIteratorPrototype%":typeof Set=="undefined"||!Yl||!Gr?tn:Gr(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer=="undefined"?tn:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":Yl&&Gr?Gr(""[Symbol.iterator]()):tn,"%Symbol%":Yl?Symbol:tn,"%SyntaxError%":Jl,"%ThrowTypeError%":vJ,"%TypedArray%":EJ,"%TypeError%":Zl,"%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%":lJ,"%WeakMap%":typeof WeakMap=="undefined"?tn:WeakMap,"%WeakRef%":typeof WeakRef=="undefined"?tn:WeakRef,"%WeakSet%":typeof WeakSet=="undefined"?tn:WeakSet,"%Function.prototype.call%":Of,"%Function.prototype.apply%":QL,"%Object.defineProperty%":yJ,"%Object.getPrototypeOf%":_J,"%Math.abs%":cJ,"%Math.floor%":fJ,"%Math.max%":hJ,"%Math.min%":pJ,"%Math.pow%":dJ,"%Math.round%":gJ,"%Math.sign%":mJ,"%Reflect.getPrototypeOf%":xJ};if(Gr)try{null.error}catch(n){ZL=Gr(Gr(n)),vu["%Error.prototype%"]=ZL}var ZL,SJ=function n(t){var e;if(t==="%AsyncFunction%")e=ux("async function () {}");else if(t==="%GeneratorFunction%")e=ux("function* () {}");else if(t==="%AsyncGeneratorFunction%")e=ux("async function* () {}");else if(t==="%AsyncGenerator%"){var i=n("%AsyncGeneratorFunction%");i&&(e=i.prototype)}else if(t==="%AsyncIteratorPrototype%"){var s=n("%AsyncGenerator%");s&&Gr&&(e=Gr(s.prototype))}return vu[t]=e,e},JL={__proto__:null,"%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"]},Df=Xl(),Wd=ax(),wJ=Df.call(Of,Array.prototype.concat),MJ=Df.call(QL,Array.prototype.splice),jL=Df.call(Of,String.prototype.replace),Xd=Df.call(Of,String.prototype.slice),bJ=Df.call(Of,RegExp.prototype.exec),AJ=/[^%.[\\]]+|\\[(?:(-?\\d+(?:\\.\\d+)?)|(["'])((?:(?!\\2)[^\\\\]|\\\\.)*?)\\2)\\]|(?=(?:\\.|\\[\\])(?:\\.|\\[\\]|%$))/g,TJ=/\\\\(\\\\)?/g,CJ=function(t){var e=Xd(t,0,1),i=Xd(t,-1);if(e==="%"&&i!=="%")throw new Jl("invalid intrinsic syntax, expected closing \`%\`");if(i==="%"&&e!=="%")throw new Jl("invalid intrinsic syntax, expected opening \`%\`");var s=[];return jL(t,AJ,function(u,c,f,p){s[s.length]=f?jL(p,TJ,"$1"):c||u}),s},IJ=function(t,e){var i=t,s;if(Wd(JL,i)&&(s=JL[i],i="%"+s[0]+"%"),Wd(vu,i)){var u=vu[i];if(u===$l&&(u=SJ(i)),typeof u=="undefined"&&!e)throw new Zl("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:s,name:i,value:u}}throw new Jl("intrinsic "+t+" does not exist!")};tN.exports=function(t,e){if(typeof t!="string"||t.length===0)throw new Zl("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof e!="boolean")throw new Zl('"allowMissing" argument must be a boolean');if(bJ(/^%?[^%]*%?$/,t)===null)throw new Jl("\`%\` may not be present anywhere but at the beginning and end of the intrinsic name");var i=CJ(t),s=i.length>0?i[0]:"",u=IJ("%"+s+"%",e),c=u.name,f=u.value,p=!1,d=u.alias;d&&(s=d[0],MJ(i,wJ([0,1],d)));for(var g=1,y=!0;g<i.length;g+=1){var v=i[g],E=Xd(v,0,1),M=Xd(v,-1);if((E==='"'||E==="'"||E==="\`"||M==='"'||M==="'"||M==="\`")&&E!==M)throw new Jl("property names with quotes must have matching quotes");if((v==="constructor"||!y)&&(p=!0),s+="."+v,c="%"+s+"%",Wd(vu,c))f=vu[c];else if(f!=null){if(!(v in f)){if(!e)throw new Zl("base intrinsic for "+t+" exists, but the property is not available.");return}if(Nf&&g+1>=i.length){var A=Nf(f,v);y=!!A,y&&"get"in A&&!("originalValue"in A.get)?f=A.get:f=f[v]}else y=Wd(f,v),f=f[v];y&&!p&&(vu[c]=f)}}return f}});var Yd=X((Jht,rN)=>{"use strict";var eN=cx(),nN=Hd(),PJ=nN([eN("%String.prototype.indexOf%")]);rN.exports=function(t,e){var i=eN(t,!!e);return typeof i=="function"&&PJ(t,".prototype.")>-1?nN([i]):i}});var sN=X((jht,oN)=>{"use strict";var RJ=zd()(),LJ=Yd(),fx=LJ("Object.prototype.toString"),$d=function(t){return RJ&&t&&typeof t=="object"&&Symbol.toStringTag in t?!1:fx(t)==="[object Arguments]"},iN=function(t){return $d(t)?!0:t!==null&&typeof t=="object"&&"length"in t&&typeof t.length=="number"&&t.length>=0&&fx(t)!=="[object Array]"&&"callee"in t&&fx(t.callee)==="[object Function]"},NJ=function(){return $d(arguments)}();$d.isLegacyArguments=iN;oN.exports=NJ?$d:iN});var Zd=X((Kht,lN)=>{"use strict";var aN=Lf(),OJ=ex(),jl=mu(),uN=yu();lN.exports=function(t,e,i){if(!t||typeof t!="object"&&typeof t!="function")throw new jl("\`obj\` must be an object or a function\`");if(typeof e!="string"&&typeof e!="symbol")throw new jl("\`property\` must be a string or a symbol\`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new jl("\`nonEnumerable\`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new jl("\`nonWritable\`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new jl("\`nonConfigurable\`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new jl("\`loose\`, if provided, must be a boolean");var s=arguments.length>3?arguments[3]:null,u=arguments.length>4?arguments[4]:null,c=arguments.length>5?arguments[5]:null,f=arguments.length>6?arguments[6]:!1,p=!!uN&&uN(t,e);if(aN)aN(t,e,{configurable:c===null&&p?p.configurable:!c,enumerable:s===null&&p?p.enumerable:!s,value:i,writable:u===null&&p?p.writable:!u});else if(f||!s&&!u&&!c)t[e]=i;else throw new OJ("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")}});var Jd=X((Qht,fN)=>{"use strict";var hx=Lf(),cN=function(){return!!hx};cN.hasArrayLengthDefineBug=function(){if(!hx)return null;try{return hx([],"length",{value:1}).length!==1}catch(t){return!0}};fN.exports=cN});var Kl=X((tpt,gN)=>{"use strict";var DJ=j_(),FJ=typeof Symbol=="function"&&typeof Symbol("foo")=="symbol",UJ=Object.prototype.toString,BJ=Array.prototype.concat,hN=Zd(),zJ=function(n){return typeof n=="function"&&UJ.call(n)==="[object Function]"},pN=Jd()(),GJ=function(n,t,e,i){if(t in n){if(i===!0){if(n[t]===e)return}else if(!zJ(i)||!i())return}pN?hN(n,t,e,!0):hN(n,t,e)},dN=function(n,t){var e=arguments.length>2?arguments[2]:{},i=DJ(t);FJ&&(i=BJ.call(i,Object.getOwnPropertySymbols(t)));for(var s=0;s<i.length;s+=1)GJ(n,i[s],t[i[s]],e[i[s]])};dN.supportsDescriptors=!!pN;gN.exports=dN});var xN=X((ept,_N)=>{"use strict";var kJ=cx(),mN=Zd(),qJ=Jd()(),yN=yu(),vN=mu(),VJ=kJ("%Math.floor%");_N.exports=function(t,e){if(typeof t!="function")throw new vN("\`fn\` is not a function");if(typeof e!="number"||e<0||e>4294967295||VJ(e)!==e)throw new vN("\`length\` must be a positive 32-bit integer");var i=arguments.length>2&&!!arguments[2],s=!0,u=!0;if("length"in t&&yN){var c=yN(t,"length");c&&!c.configurable&&(s=!1),c&&!c.writable&&(u=!1)}return(s||u||!i)&&(qJ?mN(t,"length",e,!0,!0):mN(t,"length",e)),t}});var SN=X((npt,EN)=>{"use strict";var HJ=Xl(),WJ=Vd(),XJ=ix();EN.exports=function(){return XJ(HJ,WJ,arguments)}});var px=X((rpt,jd)=>{"use strict";var YJ=xN(),wN=Lf(),$J=Hd(),MN=SN();jd.exports=function(t){var e=$J(arguments),i=t.length-(arguments.length-1);return YJ(e,1+(i>0?i:0),!0)};wN?wN(jd.exports,"apply",{value:MN}):jd.exports.apply=MN});var dx=X((ipt,AN)=>{"use strict";var bN=function(n){return n!==n};AN.exports=function(t,e){return t===0&&e===0?1/t===1/e:!!(t===e||bN(t)&&bN(e))}});var gx=X((opt,TN)=>{"use strict";var ZJ=dx();TN.exports=function(){return typeof Object.is=="function"?Object.is:ZJ}});var IN=X((spt,CN)=>{"use strict";var JJ=gx(),jJ=Kl();CN.exports=function(){var t=JJ();return jJ(Object,{is:t},{is:function(){return Object.is!==t}}),t}});var NN=X((apt,LN)=>{"use strict";var KJ=Kl(),QJ=px(),tj=dx(),PN=gx(),ej=IN(),RN=QJ(PN(),Object);KJ(RN,{getPolyfill:PN,implementation:tj,shim:ej});LN.exports=RN});var zN=X((upt,BN)=>{"use strict";var ON=Yd(),nj=zd()(),rj=ax(),ij=yu(),vx;nj?(DN=ON("RegExp.prototype.exec"),mx={},Kd=function(){throw mx},yx={toString:Kd,valueOf:Kd},typeof Symbol.toPrimitive=="symbol"&&(yx[Symbol.toPrimitive]=Kd),vx=function(t){if(!t||typeof t!="object")return!1;var e=ij(t,"lastIndex"),i=e&&rj(e,"value");if(!i)return!1;try{DN(t,yx)}catch(s){return s===mx}}):(FN=ON("Object.prototype.toString"),UN="[object RegExp]",vx=function(t){return!t||typeof t!="object"&&typeof t!="function"?!1:FN(t)===UN});var DN,mx,Kd,yx,FN,UN;BN.exports=vx});var kN=X((lpt,GN)=>{"use strict";var Uf=function(){return typeof function(){}.name=="string"},Ff=Object.getOwnPropertyDescriptor;if(Ff)try{Ff([],"length")}catch(n){Ff=null}Uf.functionsHaveConfigurableNames=function(){if(!Uf()||!Ff)return!1;var t=Ff(function(){},"name");return!!t&&!!t.configurable};var oj=Function.prototype.bind;Uf.boundFunctionsHaveNames=function(){return Uf()&&typeof oj=="function"&&function(){}.bind().name!==""};GN.exports=Uf});var HN=X((cpt,VN)=>{"use strict";var qN=Zd(),sj=Jd()(),aj=kN().functionsHaveConfigurableNames(),uj=mu();VN.exports=function(t,e){if(typeof t!="function")throw new uj("\`fn\` is not a function");var i=arguments.length>2&&!!arguments[2];return(!i||aj)&&(sj?qN(t,"name",e,!0,!0):qN(t,"name",e)),t}});var _x=X((fpt,WN)=>{"use strict";var lj=HN(),cj=mu(),fj=Object;WN.exports=lj(function(){if(this==null||this!==fj(this))throw new cj("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 xx=X((hpt,XN)=>{"use strict";var hj=_x(),pj=Kl().supportsDescriptors,dj=Object.getOwnPropertyDescriptor;XN.exports=function(){if(pj&&/a/mig.flags==="gim"){var t=dj(RegExp.prototype,"flags");if(t&&typeof t.get=="function"&&"dotAll"in RegExp.prototype&&"hasIndices"in RegExp.prototype){var e="",i={};if(Object.defineProperty(i,"hasIndices",{get:function(){e+="d"}}),Object.defineProperty(i,"sticky",{get:function(){e+="y"}}),t.get.call(i),e==="dy")return t.get}}return hj}});var ZN=X((ppt,$N)=>{"use strict";var gj=Kl().supportsDescriptors,mj=xx(),yj=yu(),vj=Object.defineProperty,_j=tx(),YN=sx(),xj=/a/;$N.exports=function(){if(!gj||!YN)throw new _j("RegExp.prototype.flags requires a true ES5 environment that supports property descriptors");var t=mj(),e=YN(xj),i=yj(e,"flags");return(!i||i.get!==t)&&vj(e,"flags",{configurable:!0,enumerable:!1,get:t}),t}});var QN=X((dpt,KN)=>{"use strict";var Ej=Kl(),Sj=px(),wj=_x(),JN=xx(),Mj=ZN(),jN=Sj(JN());Ej(jN,{getPolyfill:JN,implementation:wj,shim:Mj});KN.exports=jN});var n2=X((gpt,e2)=>{"use strict";var t2=Yd(),bj=t2("Date.prototype.getDay"),Aj=function(t){try{return bj(t),!0}catch(e){return!1}},Tj=t2("Object.prototype.toString"),Cj="[object Date]",Ij=zd()();e2.exports=function(t){return typeof t!="object"||t===null?!1:Ij?Aj(t):Tj(t)===Cj}});var Ex=X((mpt,p2)=>{var r2=j_(),i2=sN(),o2=NN(),s2=zN(),a2=QN(),u2=n2(),l2=Date.prototype.getTime;function h2(n,t,e){var i=e||{};return(i.strict?o2(n,t):n===t)?!0:!n||!t||typeof n!="object"&&typeof t!="object"?i.strict?o2(n,t):n==t:Pj(n,t,i)}function c2(n){return n==null}function f2(n){return!(!n||typeof n!="object"||typeof n.length!="number"||typeof n.copy!="function"||typeof n.slice!="function"||n.length>0&&typeof n[0]!="number")}function Pj(n,t,e){var i,s;if(typeof n!=typeof t||c2(n)||c2(t)||n.prototype!==t.prototype||i2(n)!==i2(t))return!1;var u=s2(n),c=s2(t);if(u!==c)return!1;if(u||c)return n.source===t.source&&a2(n)===a2(t);if(u2(n)&&u2(t))return l2.call(n)===l2.call(t);var f=f2(n),p=f2(t);if(f!==p)return!1;if(f||p){if(n.length!==t.length)return!1;for(i=0;i<n.length;i++)if(n[i]!==t[i])return!1;return!0}if(typeof n!=typeof t)return!1;try{var d=r2(n),g=r2(t)}catch(y){return!1}if(d.length!==g.length)return!1;for(d.sort(),g.sort(),i=d.length-1;i>=0;i--)if(d[i]!=g[i])return!1;for(i=d.length-1;i>=0;i--)if(s=d[i],!h2(n[s],t[s],e))return!1;return!0}p2.exports=h2});var Nx=X((Sgt,x2)=>{var xK=Ex(),rs=function(n){this.precision=n&&n.precision?n.precision:17,this.direction=n&&n.direction?n.direction:!1,this.pseudoNode=n&&n.pseudoNode?n.pseudoNode:!1,this.objectComparator=n&&n.objectComparator?n.objectComparator:EK};rs.prototype.compare=function(n,t){if(n.type!==t.type||!_2(n,t))return!1;switch(n.type){case"Point":return this.compareCoord(n.coordinates,t.coordinates);case"LineString":return this.compareLine(n.coordinates,t.coordinates,0,!1);case"Polygon":return this.comparePolygon(n,t);case"Feature":return this.compareFeature(n,t);default:if(n.type.indexOf("Multi")===0){var e=this,i=v2(n),s=v2(t);return i.every(function(u){return this.some(function(c){return e.compare(u,c)})},s)}}return!1};function v2(n){return n.coordinates.map(function(t){return{type:n.type.replace("Multi",""),coordinates:t}})}function _2(n,t){return n.hasOwnProperty("coordinates")?n.coordinates.length===t.coordinates.length:n.length===t.length}rs.prototype.compareCoord=function(n,t){if(n.length!==t.length)return!1;for(var e=0;e<n.length;e++)if(n[e].toFixed(this.precision)!==t[e].toFixed(this.precision))return!1;return!0};rs.prototype.compareLine=function(n,t,e,i){if(!_2(n,t))return!1;var s=this.pseudoNode?n:this.removePseudo(n),u=this.pseudoNode?t:this.removePseudo(t);if(!(i&&!this.compareCoord(s[0],u[0])&&(u=this.fixStartIndex(u,s),!u))){var c=this.compareCoord(s[e],u[e]);return this.direction||c?this.comparePath(s,u):this.compareCoord(s[e],u[u.length-(1+e)])?this.comparePath(s.slice().reverse(),u):!1}};rs.prototype.fixStartIndex=function(n,t){for(var e,i=-1,s=0;s<n.length;s++)if(this.compareCoord(n[s],t[0])){i=s;break}return i>=0&&(e=[].concat(n.slice(i,n.length),n.slice(1,i+1))),e};rs.prototype.comparePath=function(n,t){var e=this;return n.every(function(i,s){return e.compareCoord(i,this[s])},t)};rs.prototype.comparePolygon=function(n,t){if(this.compareLine(n.coordinates[0],t.coordinates[0],1,!0)){var e=n.coordinates.slice(1,n.coordinates.length),i=t.coordinates.slice(1,t.coordinates.length),s=this;return e.every(function(u){return this.some(function(c){return s.compareLine(u,c,1,!0)})},i)}else return!1};rs.prototype.compareFeature=function(n,t){return n.id!==t.id||!this.objectComparator(n.properties,t.properties)||!this.compareBBox(n,t)?!1:this.compare(n.geometry,t.geometry)};rs.prototype.compareBBox=function(n,t){return!!(!n.bbox&&!t.bbox||n.bbox&&t.bbox&&this.compareCoord(n.bbox,t.bbox))};rs.prototype.removePseudo=function(n){return n};function EK(n,t){return xK(n,t,{strict:!0})}x2.exports=rs});var E2=X((Ogt,eg)=>{function Ma(n,t,e,i){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(n,t,e,i)}Ma.prototype.run=function(n,t,e,i){this._init(n,t,e,i);for(var s=0;s<this._datasetLength;s++)if(this._visited[s]!==1){this._visited[s]=1;var u=this._regionQuery(s);if(u.length<this.minPts)this.noise.push(s);else{var c=this.clusters.length;this.clusters.push([]),this._addToCluster(s,c),this._expandCluster(c,u)}}return this.clusters};Ma.prototype._init=function(n,t,e,i){if(n){if(!(n instanceof Array))throw Error("Dataset must be of type array, "+typeof n+" given");this.dataset=n,this.clusters=[],this.noise=[],this._datasetLength=n.length,this._visited=new Array(this._datasetLength),this._assigned=new Array(this._datasetLength)}t&&(this.epsilon=t),e&&(this.minPts=e),i&&(this.distance=i)};Ma.prototype._expandCluster=function(n,t){for(var e=0;e<t.length;e++){var i=t[e];if(this._visited[i]!==1){this._visited[i]=1;var s=this._regionQuery(i);s.length>=this.minPts&&(t=this._mergeArrays(t,s))}this._assigned[i]!==1&&this._addToCluster(i,n)}};Ma.prototype._addToCluster=function(n,t){this.clusters[t].push(n),this._assigned[n]=1};Ma.prototype._regionQuery=function(n){for(var t=[],e=0;e<this._datasetLength;e++){var i=this.distance(this.dataset[n],this.dataset[e]);i<this.epsilon&&t.push(e)}return t};Ma.prototype._mergeArrays=function(n,t){for(var e=t.length,i=0;i<e;i++){var s=t[i];n.indexOf(s)<0&&n.push(s)}return n};Ma.prototype._euclideanDistance=function(n,t){for(var e=0,i=Math.min(n.length,t.length);i--;)e+=(n[i]-t[i])*(n[i]-t[i]);return Math.sqrt(e)};typeof eg!="undefined"&&eg.exports&&(eg.exports=Ma)});var S2=X((Dgt,ng)=>{function ba(n,t,e){this.k=3,this.dataset=[],this.assignments=[],this.centroids=[],this.init(n,t,e)}ba.prototype.init=function(n,t,e){this.assignments=[],this.centroids=[],typeof n!="undefined"&&(this.dataset=n),typeof t!="undefined"&&(this.k=t),typeof e!="undefined"&&(this.distance=e)};ba.prototype.run=function(n,t){this.init(n,t);for(var e=this.dataset.length,i=0;i<this.k;i++)this.centroids[i]=this.randomCentroid();for(var s=!0;s;){s=this.assign();for(var u=0;u<this.k;u++){for(var c=new Array(g),f=0,p=0;p<g;p++)c[p]=0;for(var d=0;d<e;d++){var g=this.dataset[d].length;if(u===this.assignments[d]){for(var p=0;p<g;p++)c[p]+=this.dataset[d][p];f++}}if(f>0){for(var p=0;p<g;p++)c[p]/=f;this.centroids[u]=c}else this.centroids[u]=this.randomCentroid(),s=!0}}return this.getClusters()};ba.prototype.randomCentroid=function(){var n=this.dataset.length-1,t,e;do e=Math.round(Math.random()*n),t=this.dataset[e];while(this.centroids.indexOf(t)>=0);return t};ba.prototype.assign=function(){for(var n=!1,t=this.dataset.length,e,i=0;i<t;i++)e=this.argmin(this.dataset[i],this.centroids,this.distance),e!=this.assignments[i]&&(this.assignments[i]=e,n=!0);return n};ba.prototype.getClusters=function(){for(var n=new Array(this.k),t,e=0;e<this.assignments.length;e++)t=this.assignments[e],typeof n[t]=="undefined"&&(n[t]=[]),n[t].push(e);return n};ba.prototype.argmin=function(n,t,e){for(var i=Number.MAX_VALUE,s=0,u=t.length,c,f=0;f<u;f++)c=e(n,t[f]),c<i&&(i=c,s=f);return s};ba.prototype.distance=function(n,t){for(var e=0,i=Math.min(n.length,t.length);i--;){var s=n[i]-t[i];e+=s*s}return Math.sqrt(e)};typeof ng!="undefined"&&ng.exports&&(ng.exports=ba)});var Ox=X((Fgt,rg)=>{function is(n,t,e){this._queue=[],this._priorities=[],this._sorting="desc",this._init(n,t,e)}is.prototype.insert=function(n,t){for(var e=this._queue.length,i=e;i--;){var s=this._priorities[i];this._sorting==="desc"?t>s&&(e=i):t<s&&(e=i)}this._insertAt(n,t,e)};is.prototype.remove=function(n){for(var t=this._queue.length;t--;){var e=this._queue[t];if(n===e){this._queue.splice(t,1),this._priorities.splice(t,1);break}}};is.prototype.forEach=function(n){this._queue.forEach(n)};is.prototype.getElements=function(){return this._queue};is.prototype.getElementPriority=function(n){return this._priorities[n]};is.prototype.getPriorities=function(){return this._priorities};is.prototype.getElementsWithPriorities=function(){for(var n=[],t=0,e=this._queue.length;t<e;t++)n.push([this._queue[t],this._priorities[t]]);return n};is.prototype._init=function(n,t,e){if(n&&t){if(this._queue=[],this._priorities=[],n.length!==t.length)throw new Error("Arrays must have the same length");for(var i=0;i<n.length;i++)this.insert(n[i],t[i])}e&&(this._sorting=e)};is.prototype._insertAt=function(n,t,e){this._queue.length===e?(this._queue.push(n),this._priorities.push(t)):(this._queue.splice(e,0,n),this._priorities.splice(e,0,t))};typeof rg!="undefined"&&rg.exports&&(rg.exports=is)});var M2=X((Ugt,tc)=>{typeof tc!="undefined"&&tc.exports&&(w2=Ox());var w2;function Bs(n,t,e,i){this.epsilon=1,this.minPts=1,this.distance=this._euclideanDistance,this._reachability=[],this._processed=[],this._coreDistance=0,this._orderedList=[],this._init(n,t,e,i)}Bs.prototype.run=function(n,t,e,i){this._init(n,t,e,i);for(var s=0,u=this.dataset.length;s<u;s++)if(this._processed[s]!==1){this._processed[s]=1,this.clusters.push([s]);var c=this.clusters.length-1;this._orderedList.push(s);var f=new w2(null,null,"asc"),p=this._regionQuery(s);this._distanceToCore(s)!==void 0&&(this._updateQueue(s,p,f),this._expandCluster(c,f))}return this.clusters};Bs.prototype.getReachabilityPlot=function(){for(var n=[],t=0,e=this._orderedList.length;t<e;t++){var i=this._orderedList[t],s=this._reachability[i];n.push([i,s])}return n};Bs.prototype._init=function(n,t,e,i){if(n){if(!(n instanceof Array))throw Error("Dataset must be of type array, "+typeof n+" given");this.dataset=n,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),i&&(this.distance=i)};Bs.prototype._updateQueue=function(n,t,e){var i=this;this._coreDistance=this._distanceToCore(n),t.forEach(function(s){if(i._processed[s]===void 0){var u=i.distance(i.dataset[n],i.dataset[s]),c=Math.max(i._coreDistance,u);i._reachability[s]===void 0?(i._reachability[s]=c,e.insert(s,c)):c<i._reachability[s]&&(i._reachability[s]=c,e.remove(s),e.insert(s,c))}})};Bs.prototype._expandCluster=function(n,t){for(var e=t.getElements(),i=0,s=e.length;i<s;i++){var u=e[i];if(this._processed[u]===void 0){var c=this._regionQuery(u);this._processed[u]=1,this.clusters[n].push(u),this._orderedList.push(u),this._distanceToCore(u)!==void 0&&(this._updateQueue(u,c,t),this._expandCluster(n,t))}}};Bs.prototype._distanceToCore=function(n){for(var t=this.epsilon,e=0;e<t;e++){var i=this._regionQuery(n,e);if(i.length>=this.minPts)return e}};Bs.prototype._regionQuery=function(n,t){t=t||this.epsilon;for(var e=[],i=0,s=this.dataset.length;i<s;i++)this.distance(this.dataset[n],this.dataset[i])<t&&e.push(i);return e};Bs.prototype._euclideanDistance=function(n,t){for(var e=0,i=Math.min(n.length,t.length);i--;)e+=(n[i]-t[i])*(n[i]-t[i]);return Math.sqrt(e)};typeof tc!="undefined"&&tc.exports&&(tc.exports=Bs)});var b2=X((Bgt,ig)=>{typeof ig!="undefined"&&ig.exports&&(ig.exports={DBSCAN:E2(),KMEANS:S2(),OPTICS:M2(),PriorityQueue:Ox()})});var Dx=X((Hgt,T2)=>{"use strict";T2.exports={eudist:function(t,e,i){for(var s=t.length,u=0,c=0;c<s;c++){var f=(t[c]||0)-(e[c]||0);u+=f*f}return i?Math.sqrt(u):u},mandist:function(t,e,i){for(var s=t.length,u=0,c=0;c<s;c++)u+=Math.abs((t[c]||0)-(e[c]||0));return i?Math.sqrt(u):u},dist:function(t,e,i){var s=Math.abs(t-e);return i?s:s*s}}});var P2=X((Wgt,I2)=>{"use strict";var C2=Dx(),TK=C2.eudist,CK=C2.dist;I2.exports={kmrand:function(t,e){for(var i={},s=[],u=e<<2,c=t.length,f=t[0].length>0;s.length<e&&u-- >0;){var p=t[Math.floor(Math.random()*c)],d=f?p.join("_"):""+p;i[d]||(i[d]=!0,s.push(p))}if(s.length<e)throw new Error("Error initializating clusters");return s},kmpp:function(t,e){var i=t[0].length?TK:CK,s=[],u=t.length,c=t[0].length>0,f={},p=t[Math.floor(Math.random()*u)],d=c?p.join("_"):""+p;for(s.push(p),f[d]=!0;s.length<e;){for(var g=[],y=s.length,v=0,E=[],M=0;M<u;M++){for(var A=1/0,_=0;_<y;_++){var x=i(t[M],s[_]);x<=A&&(A=x)}g[M]=A}for(var T=0;T<u;T++)v+=g[T];for(var w=0;w<u;w++)E[w]={i:w,v:t[w],pr:g[w]/v,cs:0};E.sort(function(D,P){return D.pr-P.pr}),E[0].cs=E[0].pr;for(var R=1;R<u;R++)E[R].cs=E[R-1].cs+E[R].pr;for(var z=Math.random(),U=0;U<u-1&&E[U++].cs<z;);s.push(E[U-1].v)}return s}}});var D2=X(($gt,O2)=>{"use strict";var Fx=Dx(),N2=P2(),IK=Fx.eudist,Xgt=Fx.mandist,Ygt=Fx.dist,PK=N2.kmrand,RK=N2.kmpp,R2=1e4;function L2(n,t,e){e=e||[];for(var i=0;i<n;i++)e[i]=t;return e}function LK(n,t,e,i){var s=[],u=[],c=[],f=[],p=!1,d=i||R2,g=n.length,y=n[0].length,v=y>0,E=[];if(e)e=="kmrand"?s=PK(n,t):e=="kmpp"?s=RK(n,t):s=e;else for(var M={};s.length<t;){var A=Math.floor(Math.random()*g);M[A]||(M[A]=!0,s.push(n[A]))}do{L2(t,0,E);for(var _=0;_<g;_++){for(var x=1/0,T=0,w=0;w<t;w++){var f=v?IK(n[_],s[w]):Math.abs(n[_]-s[w]);f<=x&&(x=f,T=w)}c[_]=T,E[T]++}for(var R=[],u=[],z=0,U=0;U<t;U++)R[U]=v?L2(y,0,R[U]):0,u[U]=s[U];if(v){for(var D=0;D<t;D++)s[D]=[];for(var P=0;P<g;P++)for(var ct=c[P],L=R[ct],W=n[P],V=0;V<y;V++)L[V]+=W[V];p=!0;for(var Mt=0;Mt<t;Mt++){for(var $=s[Mt],gt=R[Mt],ft=u[Mt],vt=E[Mt],it=0;it<y;it++)$[it]=gt[it]/vt||0;if(p){for(var lt=0;lt<y;lt++)if(ft[lt]!=$[lt]){p=!1;break}}}}else{for(var H=0;H<g;H++){var At=c[H];R[At]+=n[H]}for(var It=0;It<t;It++)s[It]=R[It]/E[It]||0;p=!0;for(var Kt=0;Kt<t;Kt++)if(u[Kt]!=s[Kt]){p=!1;break}}p=p||--d<=0}while(!p);return{it:R2-d,k:t,idxs:c,centroids:s}}O2.exports=LK});var oc=X((qx,Vx)=>{(function(n,t){typeof qx=="object"&&typeof Vx!="undefined"?Vx.exports=t():typeof define=="function"&&define.amd?define(t):(n=typeof globalThis!="undefined"?globalThis:n||self,n.polygonClipping=t())})(qx,function(){"use strict";function n(j,b){var I={label:0,sent:function(){if(G[0]&1)throw G[1];return G[1]},trys:[],ops:[]},F,k,G,rt;return rt={next:tt(0),throw:tt(1),return:tt(2)},typeof Symbol=="function"&&(rt[Symbol.iterator]=function(){return this}),rt;function tt(ht){return function(O){return pt([ht,O])}}function pt(ht){if(F)throw new TypeError("Generator is already executing.");for(;I;)try{if(F=1,k&&(G=ht[0]&2?k.return:ht[0]?k.throw||((G=k.return)&&G.call(k),0):k.next)&&!(G=G.call(k,ht[1])).done)return G;switch(k=0,G&&(ht=[ht[0]&2,G.value]),ht[0]){case 0:case 1:G=ht;break;case 4:return I.label++,{value:ht[1],done:!1};case 5:I.label++,k=ht[1],ht=[0];continue;case 7:ht=I.ops.pop(),I.trys.pop();continue;default:if(G=I.trys,!(G=G.length>0&&G[G.length-1])&&(ht[0]===6||ht[0]===2)){I=0;continue}if(ht[0]===3&&(!G||ht[1]>G[0]&&ht[1]<G[3])){I.label=ht[1];break}if(ht[0]===6&&I.label<G[1]){I.label=G[1],G=ht;break}if(G&&I.label<G[2]){I.label=G[2],I.ops.push(ht);break}G[2]&&I.ops.pop(),I.trys.pop();continue}ht=b.call(j,I)}catch(O){ht=[6,O],k=0}finally{F=G=0}if(ht[0]&5)throw ht[1];return{value:ht[0]?ht[1]:void 0,done:!0}}}var t=function(){function j(b,I){this.next=null,this.key=b,this.data=I,this.left=null,this.right=null}return j}();function e(j,b){return j>b?1:j<b?-1:0}function i(j,b,I){for(var F=new t(null,null),k=F,G=F;;){var rt=I(j,b.key);if(rt<0){if(b.left===null)break;if(I(j,b.left.key)<0){var tt=b.left;if(b.left=tt.right,tt.right=b,b=tt,b.left===null)break}G.left=b,G=b,b=b.left}else if(rt>0){if(b.right===null)break;if(I(j,b.right.key)>0){var tt=b.right;if(b.right=tt.left,tt.left=b,b=tt,b.right===null)break}k.right=b,k=b,b=b.right}else break}return k.right=b.left,G.left=b.right,b.left=F.right,b.right=F.left,b}function s(j,b,I,F){var k=new t(j,b);if(I===null)return k.left=k.right=null,k;I=i(j,I,F);var G=F(j,I.key);return G<0?(k.left=I.left,k.right=I,I.left=null):G>=0&&(k.right=I.right,k.left=I,I.right=null),k}function u(j,b,I){var F=null,k=null;if(b){b=i(j,b,I);var G=I(b.key,j);G===0?(F=b.left,k=b.right):G<0?(k=b.right,b.right=null,F=b):(F=b.left,b.left=null,k=b)}return{left:F,right:k}}function c(j,b,I){return b===null?j:(j===null||(b=i(j.key,b,I),b.left=j),b)}function f(j,b,I,F,k){if(j){F(""+b+(I?"\\u2514\\u2500\\u2500 ":"\\u251C\\u2500\\u2500 ")+k(j)+\`
|
|
8120
8120
|
\`);var G=b+(I?" ":"\\u2502 ");j.left&&f(j.left,G,!1,F,k),j.right&&f(j.right,G,!0,F,k)}}var p=function(){function j(b){b===void 0&&(b=e),this._root=null,this._size=0,this._comparator=b}return j.prototype.insert=function(b,I){return this._size++,this._root=s(b,I,this._root,this._comparator)},j.prototype.add=function(b,I){var F=new t(b,I);this._root===null&&(F.left=F.right=null,this._size++,this._root=F);var k=this._comparator,G=i(b,this._root,k),rt=k(b,G.key);return rt===0?this._root=G:(rt<0?(F.left=G.left,F.right=G,G.left=null):rt>0&&(F.right=G.right,F.left=G,G.right=null),this._size++,this._root=F),this._root},j.prototype.remove=function(b){this._root=this._remove(b,this._root,this._comparator)},j.prototype._remove=function(b,I,F){var k;if(I===null)return null;I=i(b,I,F);var G=F(b,I.key);return G===0?(I.left===null?k=I.right:(k=i(b,I.left,F),k.right=I.right),this._size--,k):I},j.prototype.pop=function(){var b=this._root;if(b){for(;b.left;)b=b.left;return this._root=i(b.key,this._root,this._comparator),this._root=this._remove(b.key,this._root,this._comparator),{key:b.key,data:b.data}}return null},j.prototype.findStatic=function(b){for(var I=this._root,F=this._comparator;I;){var k=F(b,I.key);if(k===0)return I;k<0?I=I.left:I=I.right}return null},j.prototype.find=function(b){return this._root&&(this._root=i(b,this._root,this._comparator),this._comparator(b,this._root.key)!==0)?null:this._root},j.prototype.contains=function(b){for(var I=this._root,F=this._comparator;I;){var k=F(b,I.key);if(k===0)return!0;k<0?I=I.left:I=I.right}return!1},j.prototype.forEach=function(b,I){for(var F=this._root,k=[],G=!1;!G;)F!==null?(k.push(F),F=F.left):k.length!==0?(F=k.pop(),b.call(I,F),F=F.right):G=!0;return this},j.prototype.range=function(b,I,F,k){for(var G=[],rt=this._comparator,tt=this._root,pt;G.length!==0||tt;)if(tt)G.push(tt),tt=tt.left;else{if(tt=G.pop(),pt=rt(tt.key,I),pt>0)break;if(rt(tt.key,b)>=0&&F.call(k,tt))return this;tt=tt.right}return this},j.prototype.keys=function(){var b=[];return this.forEach(function(I){var F=I.key;return b.push(F)}),b},j.prototype.values=function(){var b=[];return this.forEach(function(I){var F=I.data;return b.push(F)}),b},j.prototype.min=function(){return this._root?this.minNode(this._root).key:null},j.prototype.max=function(){return this._root?this.maxNode(this._root).key:null},j.prototype.minNode=function(b){if(b===void 0&&(b=this._root),b)for(;b.left;)b=b.left;return b},j.prototype.maxNode=function(b){if(b===void 0&&(b=this._root),b)for(;b.right;)b=b.right;return b},j.prototype.at=function(b){for(var I=this._root,F=!1,k=0,G=[];!F;)if(I)G.push(I),I=I.left;else if(G.length>0){if(I=G.pop(),k===b)return I;k++,I=I.right}else F=!0;return null},j.prototype.next=function(b){var I=this._root,F=null;if(b.right){for(F=b.right;F.left;)F=F.left;return F}for(var k=this._comparator;I;){var G=k(b.key,I.key);if(G===0)break;G<0?(F=I,I=I.left):I=I.right}return F},j.prototype.prev=function(b){var I=this._root,F=null;if(b.left!==null){for(F=b.left;F.right;)F=F.right;return F}for(var k=this._comparator;I;){var G=k(b.key,I.key);if(G===0)break;G<0?I=I.left:(F=I,I=I.right)}return F},j.prototype.clear=function(){return this._root=null,this._size=0,this},j.prototype.toList=function(){return y(this._root)},j.prototype.load=function(b,I,F){I===void 0&&(I=[]),F===void 0&&(F=!1);var k=b.length,G=this._comparator;if(F&&M(b,I,0,k-1,G),this._root===null)this._root=d(b,I,0,k),this._size=k;else{var rt=E(this.toList(),g(b,I),G);k=this._size+k,this._root=v({head:rt},0,k)}return this},j.prototype.isEmpty=function(){return this._root===null},Object.defineProperty(j.prototype,"size",{get:function(){return this._size},enumerable:!0,configurable:!0}),Object.defineProperty(j.prototype,"root",{get:function(){return this._root},enumerable:!0,configurable:!0}),j.prototype.toString=function(b){b===void 0&&(b=function(F){return String(F.key)});var I=[];return f(this._root,"",!0,function(F){return I.push(F)},b),I.join("")},j.prototype.update=function(b,I,F){var k=this._comparator,G=u(b,this._root,k),rt=G.left,tt=G.right;k(b,I)<0?tt=s(I,F,tt,k):rt=s(I,F,rt,k),this._root=c(rt,tt,k)},j.prototype.split=function(b){return u(b,this._root,this._comparator)},j.prototype[Symbol.iterator]=function(){var b,I,F;return n(this,function(k){switch(k.label){case 0:b=this._root,I=[],F=!1,k.label=1;case 1:return F?[3,6]:b===null?[3,2]:(I.push(b),b=b.left,[3,5]);case 2:return I.length===0?[3,4]:(b=I.pop(),[4,b]);case 3:return k.sent(),b=b.right,[3,5];case 4:F=!0,k.label=5;case 5:return[3,1];case 6:return[2]}})},j}();function d(j,b,I,F){var k=F-I;if(k>0){var G=I+Math.floor(k/2),rt=j[G],tt=b[G],pt=new t(rt,tt);return pt.left=d(j,b,I,G),pt.right=d(j,b,G+1,F),pt}return null}function g(j,b){for(var I=new t(null,null),F=I,k=0;k<j.length;k++)F=F.next=new t(j[k],b[k]);return F.next=null,I.next}function y(j){for(var b=j,I=[],F=!1,k=new t(null,null),G=k;!F;)b?(I.push(b),b=b.left):I.length>0?(b=G=G.next=I.pop(),b=b.right):F=!0;return G.next=null,k.next}function v(j,b,I){var F=I-b;if(F>0){var k=b+Math.floor(F/2),G=v(j,b,k),rt=j.head;return rt.left=G,j.head=j.head.next,rt.right=v(j,k+1,I),rt}return null}function E(j,b,I){for(var F=new t(null,null),k=F,G=j,rt=b;G!==null&&rt!==null;)I(G.key,rt.key)<0?(k.next=G,G=G.next):(k.next=rt,rt=rt.next),k=k.next;return G!==null?k.next=G:rt!==null&&(k.next=rt),F.next}function M(j,b,I,F,k){if(!(I>=F)){for(var G=j[I+F>>1],rt=I-1,tt=F+1;;){do rt++;while(k(j[rt],G)<0);do tt--;while(k(j[tt],G)>0);if(rt>=tt)break;var pt=j[rt];j[rt]=j[tt],j[tt]=pt,pt=b[rt],b[rt]=b[tt],b[tt]=pt}M(j,b,I,tt,k),M(j,b,tt+1,F,k)}}let A=(j,b)=>j.ll.x<=b.x&&b.x<=j.ur.x&&j.ll.y<=b.y&&b.y<=j.ur.y,_=(j,b)=>{if(b.ur.x<j.ll.x||j.ur.x<b.ll.x||b.ur.y<j.ll.y||j.ur.y<b.ll.y)return null;let I=j.ll.x<b.ll.x?b.ll.x:j.ll.x,F=j.ur.x<b.ur.x?j.ur.x:b.ur.x,k=j.ll.y<b.ll.y?b.ll.y:j.ll.y,G=j.ur.y<b.ur.y?j.ur.y:b.ur.y;return{ll:{x:I,y:k},ur:{x:F,y:G}}},x=Number.EPSILON;x===void 0&&(x=Math.pow(2,-52));let T=x*x,w=(j,b)=>{if(-x<j&&j<x&&-x<b&&b<x)return 0;let I=j-b;return I*I<T*j*b?0:j<b?-1:1};class R{constructor(){this.reset()}reset(){this.xRounder=new z,this.yRounder=new z}round(b,I){return{x:this.xRounder.round(b),y:this.yRounder.round(I)}}}class z{constructor(){this.tree=new p,this.round(0)}round(b){let I=this.tree.add(b),F=this.tree.prev(I);if(F!==null&&w(I.key,F.key)===0)return this.tree.remove(b),F.key;let k=this.tree.next(I);return k!==null&&w(I.key,k.key)===0?(this.tree.remove(b),k.key):b}}let U=new R,D=11102230246251565e-32,P=134217729,ct=(3+8*D)*D;function L(j,b,I,F,k){let G,rt,tt,pt,ht=b[0],O=F[0],Q=0,J=0;O>ht==O>-ht?(G=ht,ht=b[++Q]):(G=O,O=F[++J]);let et=0;if(Q<j&&J<I)for(O>ht==O>-ht?(rt=ht+G,tt=G-(rt-ht),ht=b[++Q]):(rt=O+G,tt=G-(rt-O),O=F[++J]),G=rt,tt!==0&&(k[et++]=tt);Q<j&&J<I;)O>ht==O>-ht?(rt=G+ht,pt=rt-G,tt=G-(rt-pt)+(ht-pt),ht=b[++Q]):(rt=G+O,pt=rt-G,tt=G-(rt-pt)+(O-pt),O=F[++J]),G=rt,tt!==0&&(k[et++]=tt);for(;Q<j;)rt=G+ht,pt=rt-G,tt=G-(rt-pt)+(ht-pt),ht=b[++Q],G=rt,tt!==0&&(k[et++]=tt);for(;J<I;)rt=G+O,pt=rt-G,tt=G-(rt-pt)+(O-pt),O=F[++J],G=rt,tt!==0&&(k[et++]=tt);return(G!==0||et===0)&&(k[et++]=G),et}function W(j,b){let I=b[0];for(let F=1;F<j;F++)I+=b[F];return I}function V(j){return new Float64Array(j)}let Mt=(3+16*D)*D,$=(2+12*D)*D,gt=(9+64*D)*D*D,ft=V(4),vt=V(8),it=V(12),lt=V(16),H=V(4);function At(j,b,I,F,k,G,rt){let tt,pt,ht,O,Q,J,et,Tt,kt,ie,oe,we,ye,be,Ae,Bn,dr,_n,pe=j-k,xn=I-k,Nn=b-G,Cn=F-G;be=pe*Cn,J=P*pe,et=J-(J-pe),Tt=pe-et,J=P*Cn,kt=J-(J-Cn),ie=Cn-kt,Ae=Tt*ie-(be-et*kt-Tt*kt-et*ie),Bn=Nn*xn,J=P*Nn,et=J-(J-Nn),Tt=Nn-et,J=P*xn,kt=J-(J-xn),ie=xn-kt,dr=Tt*ie-(Bn-et*kt-Tt*kt-et*ie),oe=Ae-dr,Q=Ae-oe,ft[0]=Ae-(oe+Q)+(Q-dr),we=be+oe,Q=we-be,ye=be-(we-Q)+(oe-Q),oe=ye-Bn,Q=ye-oe,ft[1]=ye-(oe+Q)+(Q-Bn),_n=we+oe,Q=_n-we,ft[2]=we-(_n-Q)+(oe-Q),ft[3]=_n;let En=W(4,ft),Kr=$*rt;if(En>=Kr||-En>=Kr||(Q=j-pe,tt=j-(pe+Q)+(Q-k),Q=I-xn,ht=I-(xn+Q)+(Q-k),Q=b-Nn,pt=b-(Nn+Q)+(Q-G),Q=F-Cn,O=F-(Cn+Q)+(Q-G),tt===0&&pt===0&&ht===0&&O===0)||(Kr=gt*rt+ct*Math.abs(En),En+=pe*O+Cn*tt-(Nn*ht+xn*pt),En>=Kr||-En>=Kr))return En;be=tt*Cn,J=P*tt,et=J-(J-tt),Tt=tt-et,J=P*Cn,kt=J-(J-Cn),ie=Cn-kt,Ae=Tt*ie-(be-et*kt-Tt*kt-et*ie),Bn=pt*xn,J=P*pt,et=J-(J-pt),Tt=pt-et,J=P*xn,kt=J-(J-xn),ie=xn-kt,dr=Tt*ie-(Bn-et*kt-Tt*kt-et*ie),oe=Ae-dr,Q=Ae-oe,H[0]=Ae-(oe+Q)+(Q-dr),we=be+oe,Q=we-be,ye=be-(we-Q)+(oe-Q),oe=ye-Bn,Q=ye-oe,H[1]=ye-(oe+Q)+(Q-Bn),_n=we+oe,Q=_n-we,H[2]=we-(_n-Q)+(oe-Q),H[3]=_n;let Ar=L(4,ft,4,H,vt);be=pe*O,J=P*pe,et=J-(J-pe),Tt=pe-et,J=P*O,kt=J-(J-O),ie=O-kt,Ae=Tt*ie-(be-et*kt-Tt*kt-et*ie),Bn=Nn*ht,J=P*Nn,et=J-(J-Nn),Tt=Nn-et,J=P*ht,kt=J-(J-ht),ie=ht-kt,dr=Tt*ie-(Bn-et*kt-Tt*kt-et*ie),oe=Ae-dr,Q=Ae-oe,H[0]=Ae-(oe+Q)+(Q-dr),we=be+oe,Q=we-be,ye=be-(we-Q)+(oe-Q),oe=ye-Bn,Q=ye-oe,H[1]=ye-(oe+Q)+(Q-Bn),_n=we+oe,Q=_n-we,H[2]=we-(_n-Q)+(oe-Q),H[3]=_n;let q=L(Ar,vt,4,H,it);be=tt*O,J=P*tt,et=J-(J-tt),Tt=tt-et,J=P*O,kt=J-(J-O),ie=O-kt,Ae=Tt*ie-(be-et*kt-Tt*kt-et*ie),Bn=pt*ht,J=P*pt,et=J-(J-pt),Tt=pt-et,J=P*ht,kt=J-(J-ht),ie=ht-kt,dr=Tt*ie-(Bn-et*kt-Tt*kt-et*ie),oe=Ae-dr,Q=Ae-oe,H[0]=Ae-(oe+Q)+(Q-dr),we=be+oe,Q=we-be,ye=be-(we-Q)+(oe-Q),oe=ye-Bn,Q=ye-oe,H[1]=ye-(oe+Q)+(Q-Bn),_n=we+oe,Q=_n-we,H[2]=we-(_n-Q)+(oe-Q),H[3]=_n;let at=L(q,it,4,H,lt);return lt[at-1]}function It(j,b,I,F,k,G){let rt=(b-G)*(I-k),tt=(j-k)*(F-G),pt=rt-tt,ht=Math.abs(rt+tt);return Math.abs(pt)>=Mt*ht?pt:-At(j,b,I,F,k,G,ht)}let Kt=(j,b)=>j.x*b.y-j.y*b.x,nt=(j,b)=>j.x*b.x+j.y*b.y,bt=(j,b,I)=>{let F=It(j.x,j.y,b.x,b.y,I.x,I.y);return F>0?-1:F<0?1:0},Vt=j=>Math.sqrt(nt(j,j)),$t=(j,b,I)=>{let F={x:b.x-j.x,y:b.y-j.y},k={x:I.x-j.x,y:I.y-j.y};return Kt(k,F)/Vt(k)/Vt(F)},Ut=(j,b,I)=>{let F={x:b.x-j.x,y:b.y-j.y},k={x:I.x-j.x,y:I.y-j.y};return nt(k,F)/Vt(k)/Vt(F)},Gt=(j,b,I)=>b.y===0?null:{x:j.x+b.x/b.y*(I-j.y),y:I},Ct=(j,b,I)=>b.x===0?null:{x:I,y:j.y+b.y/b.x*(I-j.x)},ee=(j,b,I,F)=>{if(b.x===0)return Ct(I,F,j.x);if(F.x===0)return Ct(j,b,I.x);if(b.y===0)return Gt(I,F,j.y);if(F.y===0)return Gt(j,b,I.y);let k=Kt(b,F);if(k==0)return null;let G={x:I.x-j.x,y:I.y-j.y},rt=Kt(G,b)/k,tt=Kt(G,F)/k,pt=j.x+tt*b.x,ht=I.x+rt*F.x,O=j.y+tt*b.y,Q=I.y+rt*F.y,J=(pt+ht)/2,et=(O+Q)/2;return{x:J,y:et}};class Z{static compare(b,I){let F=Z.comparePoints(b.point,I.point);return F!==0?F:(b.point!==I.point&&b.link(I),b.isLeft!==I.isLeft?b.isLeft?1:-1:_t.compare(b.segment,I.segment))}static comparePoints(b,I){return b.x<I.x?-1:b.x>I.x?1:b.y<I.y?-1:b.y>I.y?1:0}constructor(b,I){b.events===void 0?b.events=[this]:b.events.push(this),this.point=b,this.isLeft=I}link(b){if(b.point===this.point)throw new Error("Tried to link already linked events");let I=b.point.events;for(let F=0,k=I.length;F<k;F++){let G=I[F];this.point.events.push(G),G.point=this.point}this.checkForConsuming()}checkForConsuming(){let b=this.point.events.length;for(let I=0;I<b;I++){let F=this.point.events[I];if(F.segment.consumedBy===void 0)for(let k=I+1;k<b;k++){let G=this.point.events[k];G.consumedBy===void 0&&F.otherSE.point.events===G.otherSE.point.events&&F.segment.consume(G.segment)}}}getAvailableLinkedEvents(){let b=[];for(let I=0,F=this.point.events.length;I<F;I++){let k=this.point.events[I];k!==this&&!k.segment.ringOut&&k.segment.isInResult()&&b.push(k)}return b}getLeftmostComparator(b){let I=new Map,F=k=>{let G=k.otherSE;I.set(k,{sine:$t(this.point,b.point,G.point),cosine:Ut(this.point,b.point,G.point)})};return(k,G)=>{I.has(k)||F(k),I.has(G)||F(G);let{sine:rt,cosine:tt}=I.get(k),{sine:pt,cosine:ht}=I.get(G);return rt>=0&&pt>=0?tt<ht?1:tt>ht?-1:0:rt<0&&pt<0?tt<ht?-1:tt>ht?1:0:pt<rt?-1:pt>rt?1:0}}}let Dt=0;class _t{static compare(b,I){let F=b.leftSE.point.x,k=I.leftSE.point.x,G=b.rightSE.point.x,rt=I.rightSE.point.x;if(rt<F)return 1;if(G<k)return-1;let tt=b.leftSE.point.y,pt=I.leftSE.point.y,ht=b.rightSE.point.y,O=I.rightSE.point.y;if(F<k){if(pt<tt&&pt<ht)return 1;if(pt>tt&&pt>ht)return-1;let Q=b.comparePoint(I.leftSE.point);if(Q<0)return 1;if(Q>0)return-1;let J=I.comparePoint(b.rightSE.point);return J!==0?J:-1}if(F>k){if(tt<pt&&tt<O)return-1;if(tt>pt&&tt>O)return 1;let Q=I.comparePoint(b.leftSE.point);if(Q!==0)return Q;let J=b.comparePoint(I.rightSE.point);return J<0?1:J>0?-1:1}if(tt<pt)return-1;if(tt>pt)return 1;if(G<rt){let Q=I.comparePoint(b.rightSE.point);if(Q!==0)return Q}if(G>rt){let Q=b.comparePoint(I.rightSE.point);if(Q<0)return 1;if(Q>0)return-1}if(G!==rt){let Q=ht-tt,J=G-F,et=O-pt,Tt=rt-k;if(Q>J&&et<Tt)return 1;if(Q<J&&et>Tt)return-1}return G>rt?1:G<rt||ht<O?-1:ht>O?1:b.id<I.id?-1:b.id>I.id?1:0}constructor(b,I,F,k){this.id=++Dt,this.leftSE=b,b.segment=this,b.otherSE=I,this.rightSE=I,I.segment=this,I.otherSE=b,this.rings=F,this.windings=k}static fromRing(b,I,F){let k,G,rt,tt=Z.comparePoints(b,I);if(tt<0)k=b,G=I,rt=1;else if(tt>0)k=I,G=b,rt=-1;else throw new Error(\`Tried to create degenerate segment at [\${b.x}, \${b.y}]\`);let pt=new Z(k,!0),ht=new Z(G,!1);return new _t(pt,ht,[F],[rt])}replaceRightSE(b){this.rightSE=b,this.rightSE.segment=this,this.rightSE.otherSE=this.leftSE,this.leftSE.otherSE=this.rightSE}bbox(){let b=this.leftSE.point.y,I=this.rightSE.point.y;return{ll:{x:this.leftSE.point.x,y:b<I?b:I},ur:{x:this.rightSE.point.x,y:b>I?b:I}}}vector(){return{x:this.rightSE.point.x-this.leftSE.point.x,y:this.rightSE.point.y-this.leftSE.point.y}}isAnEndpoint(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}comparePoint(b){if(this.isAnEndpoint(b))return 0;let I=this.leftSE.point,F=this.rightSE.point,k=this.vector();if(I.x===F.x)return b.x===I.x?0:b.x<I.x?1:-1;let G=(b.y-I.y)/k.y,rt=I.x+G*k.x;if(b.x===rt)return 0;let tt=(b.x-I.x)/k.x,pt=I.y+tt*k.y;return b.y===pt?0:b.y<pt?-1:1}getIntersection(b){let I=this.bbox(),F=b.bbox(),k=_(I,F);if(k===null)return null;let G=this.leftSE.point,rt=this.rightSE.point,tt=b.leftSE.point,pt=b.rightSE.point,ht=A(I,tt)&&this.comparePoint(tt)===0,O=A(F,G)&&b.comparePoint(G)===0,Q=A(I,pt)&&this.comparePoint(pt)===0,J=A(F,rt)&&b.comparePoint(rt)===0;if(O&&ht)return J&&!Q?rt:!J&&Q?pt:null;if(O)return Q&&G.x===pt.x&&G.y===pt.y?null:G;if(ht)return J&&rt.x===tt.x&&rt.y===tt.y?null:tt;if(J&&Q)return null;if(J)return rt;if(Q)return pt;let et=ee(G,this.vector(),tt,b.vector());return et===null||!A(k,et)?null:U.round(et.x,et.y)}split(b){let I=[],F=b.events!==void 0,k=new Z(b,!0),G=new Z(b,!1),rt=this.rightSE;this.replaceRightSE(G),I.push(G),I.push(k);let tt=new _t(k,rt,this.rings.slice(),this.windings.slice());return Z.comparePoints(tt.leftSE.point,tt.rightSE.point)>0&&tt.swapEvents(),Z.comparePoints(this.leftSE.point,this.rightSE.point)>0&&this.swapEvents(),F&&(k.checkForConsuming(),G.checkForConsuming()),I}swapEvents(){let b=this.rightSE;this.rightSE=this.leftSE,this.leftSE=b,this.leftSE.isLeft=!0,this.rightSE.isLeft=!1;for(let I=0,F=this.windings.length;I<F;I++)this.windings[I]*=-1}consume(b){let I=this,F=b;for(;I.consumedBy;)I=I.consumedBy;for(;F.consumedBy;)F=F.consumedBy;let k=_t.compare(I,F);if(k!==0){if(k>0){let G=I;I=F,F=G}if(I.prev===F){let G=I;I=F,F=G}for(let G=0,rt=F.rings.length;G<rt;G++){let tt=F.rings[G],pt=F.windings[G],ht=I.rings.indexOf(tt);ht===-1?(I.rings.push(tt),I.windings.push(pt)):I.windings[ht]+=pt}F.rings=null,F.windings=null,F.consumedBy=I,F.leftSE.consumedBy=I.leftSE,F.rightSE.consumedBy=I.rightSE}}prevInResult(){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)}beforeState(){if(this._beforeState!==void 0)return this._beforeState;if(!this.prev)this._beforeState={rings:[],windings:[],multiPolys:[]};else{let b=this.prev.consumedBy||this.prev;this._beforeState=b.afterState()}return this._beforeState}afterState(){if(this._afterState!==void 0)return this._afterState;let b=this.beforeState();this._afterState={rings:b.rings.slice(0),windings:b.windings.slice(0),multiPolys:[]};let I=this._afterState.rings,F=this._afterState.windings,k=this._afterState.multiPolys;for(let tt=0,pt=this.rings.length;tt<pt;tt++){let ht=this.rings[tt],O=this.windings[tt],Q=I.indexOf(ht);Q===-1?(I.push(ht),F.push(O)):F[Q]+=O}let G=[],rt=[];for(let tt=0,pt=I.length;tt<pt;tt++){if(F[tt]===0)continue;let ht=I[tt],O=ht.poly;if(rt.indexOf(O)===-1)if(ht.isExterior)G.push(O);else{rt.indexOf(O)===-1&&rt.push(O);let Q=G.indexOf(ht.poly);Q!==-1&&G.splice(Q,1)}}for(let tt=0,pt=G.length;tt<pt;tt++){let ht=G[tt].multiPoly;k.indexOf(ht)===-1&&k.push(ht)}return this._afterState}isInResult(){if(this.consumedBy)return!1;if(this._isInResult!==void 0)return this._isInResult;let b=this.beforeState().multiPolys,I=this.afterState().multiPolys;switch(ot.type){case"union":{let F=b.length===0,k=I.length===0;this._isInResult=F!==k;break}case"intersection":{let F,k;b.length<I.length?(F=b.length,k=I.length):(F=I.length,k=b.length),this._isInResult=k===ot.numMultiPolys&&F<k;break}case"xor":{let F=Math.abs(b.length-I.length);this._isInResult=F%2===1;break}case"difference":{let F=k=>k.length===1&&k[0].isSubject;this._isInResult=F(b)!==F(I);break}default:throw new Error(\`Unrecognized operation type found \${ot.type}\`)}return this._isInResult}}class Nt{constructor(b,I,F){if(!Array.isArray(b)||b.length===0)throw new Error("Input geometry is not a valid Polygon or MultiPolygon");if(this.poly=I,this.isExterior=F,this.segments=[],typeof b[0][0]!="number"||typeof b[0][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");let k=U.round(b[0][0],b[0][1]);this.bbox={ll:{x:k.x,y:k.y},ur:{x:k.x,y:k.y}};let G=k;for(let rt=1,tt=b.length;rt<tt;rt++){if(typeof b[rt][0]!="number"||typeof b[rt][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");let pt=U.round(b[rt][0],b[rt][1]);pt.x===G.x&&pt.y===G.y||(this.segments.push(_t.fromRing(G,pt,this)),pt.x<this.bbox.ll.x&&(this.bbox.ll.x=pt.x),pt.y<this.bbox.ll.y&&(this.bbox.ll.y=pt.y),pt.x>this.bbox.ur.x&&(this.bbox.ur.x=pt.x),pt.y>this.bbox.ur.y&&(this.bbox.ur.y=pt.y),G=pt)}(k.x!==G.x||k.y!==G.y)&&this.segments.push(_t.fromRing(G,k,this))}getSweepEvents(){let b=[];for(let I=0,F=this.segments.length;I<F;I++){let k=this.segments[I];b.push(k.leftSE),b.push(k.rightSE)}return b}}class wt{constructor(b,I){if(!Array.isArray(b))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");this.exteriorRing=new Nt(b[0],this,!0),this.bbox={ll:{x:this.exteriorRing.bbox.ll.x,y:this.exteriorRing.bbox.ll.y},ur:{x:this.exteriorRing.bbox.ur.x,y:this.exteriorRing.bbox.ur.y}},this.interiorRings=[];for(let F=1,k=b.length;F<k;F++){let G=new Nt(b[F],this,!1);G.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=G.bbox.ll.x),G.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=G.bbox.ll.y),G.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=G.bbox.ur.x),G.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=G.bbox.ur.y),this.interiorRings.push(G)}this.multiPoly=I}getSweepEvents(){let b=this.exteriorRing.getSweepEvents();for(let I=0,F=this.interiorRings.length;I<F;I++){let k=this.interiorRings[I].getSweepEvents();for(let G=0,rt=k.length;G<rt;G++)b.push(k[G])}return b}}class Ht{constructor(b,I){if(!Array.isArray(b))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");try{typeof b[0][0][0]=="number"&&(b=[b])}catch(F){}this.polys=[],this.bbox={ll:{x:Number.POSITIVE_INFINITY,y:Number.POSITIVE_INFINITY},ur:{x:Number.NEGATIVE_INFINITY,y:Number.NEGATIVE_INFINITY}};for(let F=0,k=b.length;F<k;F++){let G=new wt(b[F],this);G.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=G.bbox.ll.x),G.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=G.bbox.ll.y),G.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=G.bbox.ur.x),G.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=G.bbox.ur.y),this.polys.push(G)}this.isSubject=I}getSweepEvents(){let b=[];for(let I=0,F=this.polys.length;I<F;I++){let k=this.polys[I].getSweepEvents();for(let G=0,rt=k.length;G<rt;G++)b.push(k[G])}return b}}class Xt{static factory(b){let I=[];for(let F=0,k=b.length;F<k;F++){let G=b[F];if(!G.isInResult()||G.ringOut)continue;let rt=null,tt=G.leftSE,pt=G.rightSE,ht=[tt],O=tt.point,Q=[];for(;rt=tt,tt=pt,ht.push(tt),tt.point!==O;)for(;;){let J=tt.getAvailableLinkedEvents();if(J.length===0){let kt=ht[0].point,ie=ht[ht.length-1].point;throw new Error(\`Unable to complete output ring starting at [\${kt.x}, \${kt.y}]. Last matching segment found ends at [\${ie.x}, \${ie.y}].\`)}if(J.length===1){pt=J[0].otherSE;break}let et=null;for(let kt=0,ie=Q.length;kt<ie;kt++)if(Q[kt].point===tt.point){et=kt;break}if(et!==null){let kt=Q.splice(et)[0],ie=ht.splice(kt.index);ie.unshift(ie[0].otherSE),I.push(new Xt(ie.reverse()));continue}Q.push({index:ht.length,point:tt.point});let Tt=tt.getLeftmostComparator(rt);pt=J.sort(Tt)[0].otherSE;break}I.push(new Xt(ht))}return I}constructor(b){this.events=b;for(let I=0,F=b.length;I<F;I++)b[I].segment.ringOut=this;this.poly=null}getGeom(){let b=this.events[0].point,I=[b];for(let ht=1,O=this.events.length-1;ht<O;ht++){let Q=this.events[ht].point,J=this.events[ht+1].point;bt(Q,b,J)!==0&&(I.push(Q),b=Q)}if(I.length===1)return null;let F=I[0],k=I[1];bt(F,b,k)===0&&I.shift(),I.push(I[0]);let G=this.isExteriorRing()?1:-1,rt=this.isExteriorRing()?0:I.length-1,tt=this.isExteriorRing()?I.length:-1,pt=[];for(let ht=rt;ht!=tt;ht+=G)pt.push([I[ht].x,I[ht].y]);return pt}isExteriorRing(){if(this._isExteriorRing===void 0){let b=this.enclosingRing();this._isExteriorRing=b?!b.isExteriorRing():!0}return this._isExteriorRing}enclosingRing(){return this._enclosingRing===void 0&&(this._enclosingRing=this._calcEnclosingRing()),this._enclosingRing}_calcEnclosingRing(){let b=this.events[0];for(let k=1,G=this.events.length;k<G;k++){let rt=this.events[k];Z.compare(b,rt)>0&&(b=rt)}let I=b.segment.prevInResult(),F=I?I.prevInResult():null;for(;;){if(!I)return null;if(!F)return I.ringOut;if(F.ringOut!==I.ringOut)return F.ringOut.enclosingRing()!==I.ringOut?I.ringOut:I.ringOut.enclosingRing();I=F.prevInResult(),F=I?I.prevInResult():null}}}class Pt{constructor(b){this.exteriorRing=b,b.poly=this,this.interiorRings=[]}addInterior(b){this.interiorRings.push(b),b.poly=this}getGeom(){let b=[this.exteriorRing.getGeom()];if(b[0]===null)return null;for(let I=0,F=this.interiorRings.length;I<F;I++){let k=this.interiorRings[I].getGeom();k!==null&&b.push(k)}return b}}class ne{constructor(b){this.rings=b,this.polys=this._composePolys(b)}getGeom(){let b=[];for(let I=0,F=this.polys.length;I<F;I++){let k=this.polys[I].getGeom();k!==null&&b.push(k)}return b}_composePolys(b){let I=[];for(let F=0,k=b.length;F<k;F++){let G=b[F];if(!G.poly)if(G.isExteriorRing())I.push(new Pt(G));else{let rt=G.enclosingRing();rt.poly||I.push(new Pt(rt)),rt.poly.addInterior(G)}}return I}}class Y{constructor(b){let I=arguments.length>1&&arguments[1]!==void 0?arguments[1]:_t.compare;this.queue=b,this.tree=new p(I),this.segments=[]}process(b){let I=b.segment,F=[];if(b.consumedBy)return b.isLeft?this.queue.remove(b.otherSE):this.tree.remove(I),F;let k=b.isLeft?this.tree.add(I):this.tree.find(I);if(!k)throw new Error(\`Unable to find segment #\${I.id} [\${I.leftSE.point.x}, \${I.leftSE.point.y}] -> [\${I.rightSE.point.x}, \${I.rightSE.point.y}] in SweepLine tree.\`);let G=k,rt=k,tt,pt;for(;tt===void 0;)G=this.tree.prev(G),G===null?tt=null:G.key.consumedBy===void 0&&(tt=G.key);for(;pt===void 0;)rt=this.tree.next(rt),rt===null?pt=null:rt.key.consumedBy===void 0&&(pt=rt.key);if(b.isLeft){let ht=null;if(tt){let Q=tt.getIntersection(I);if(Q!==null&&(I.isAnEndpoint(Q)||(ht=Q),!tt.isAnEndpoint(Q))){let J=this._splitSafely(tt,Q);for(let et=0,Tt=J.length;et<Tt;et++)F.push(J[et])}}let O=null;if(pt){let Q=pt.getIntersection(I);if(Q!==null&&(I.isAnEndpoint(Q)||(O=Q),!pt.isAnEndpoint(Q))){let J=this._splitSafely(pt,Q);for(let et=0,Tt=J.length;et<Tt;et++)F.push(J[et])}}if(ht!==null||O!==null){let Q=null;ht===null?Q=O:O===null?Q=ht:Q=Z.comparePoints(ht,O)<=0?ht:O,this.queue.remove(I.rightSE),F.push(I.rightSE);let J=I.split(Q);for(let et=0,Tt=J.length;et<Tt;et++)F.push(J[et])}F.length>0?(this.tree.remove(I),F.push(b)):(this.segments.push(I),I.prev=tt)}else{if(tt&&pt){let ht=tt.getIntersection(pt);if(ht!==null){if(!tt.isAnEndpoint(ht)){let O=this._splitSafely(tt,ht);for(let Q=0,J=O.length;Q<J;Q++)F.push(O[Q])}if(!pt.isAnEndpoint(ht)){let O=this._splitSafely(pt,ht);for(let Q=0,J=O.length;Q<J;Q++)F.push(O[Q])}}}this.tree.remove(I)}return F}_splitSafely(b,I){this.tree.remove(b);let F=b.rightSE;this.queue.remove(F);let k=b.split(I);return k.push(F),b.consumedBy===void 0&&this.tree.add(b),k}}let N=typeof process!="undefined"&&process.env.POLYGON_CLIPPING_MAX_QUEUE_SIZE||1e6,xt=typeof process!="undefined"&&process.env.POLYGON_CLIPPING_MAX_SWEEPLINE_SEGMENTS||1e6;class St{run(b,I,F){ot.type=b,U.reset();let k=[new Ht(I,!0)];for(let Q=0,J=F.length;Q<J;Q++)k.push(new Ht(F[Q],!1));if(ot.numMultiPolys=k.length,ot.type==="difference"){let Q=k[0],J=1;for(;J<k.length;)_(k[J].bbox,Q.bbox)!==null?J++:k.splice(J,1)}if(ot.type==="intersection")for(let Q=0,J=k.length;Q<J;Q++){let et=k[Q];for(let Tt=Q+1,kt=k.length;Tt<kt;Tt++)if(_(et.bbox,k[Tt].bbox)===null)return[]}let G=new p(Z.compare);for(let Q=0,J=k.length;Q<J;Q++){let et=k[Q].getSweepEvents();for(let Tt=0,kt=et.length;Tt<kt;Tt++)if(G.insert(et[Tt]),G.size>N)throw new Error("Infinite loop when putting segment endpoints in a priority queue (queue size too big).")}let rt=new Y(G),tt=G.size,pt=G.pop();for(;pt;){let Q=pt.key;if(G.size===tt){let et=Q.segment;throw new Error(\`Unable to pop() \${Q.isLeft?"left":"right"} SweepEvent [\${Q.point.x}, \${Q.point.y}] from segment #\${et.id} [\${et.leftSE.point.x}, \${et.leftSE.point.y}] -> [\${et.rightSE.point.x}, \${et.rightSE.point.y}] from queue.\`)}if(G.size>N)throw new Error("Infinite loop when passing sweep line over endpoints (queue size too big).");if(rt.segments.length>xt)throw new Error("Infinite loop when passing sweep line over endpoints (too many sweep line segments).");let J=rt.process(Q);for(let et=0,Tt=J.length;et<Tt;et++){let kt=J[et];kt.consumedBy===void 0&&G.insert(kt)}tt=G.size,pt=G.pop()}U.reset();let ht=Xt.factory(rt.segments);return new ne(ht).getGeom()}}let ot=new St;var Wt={union:function(j){for(var b=arguments.length,I=new Array(b>1?b-1:0),F=1;F<b;F++)I[F-1]=arguments[F];return ot.run("union",j,I)},intersection:function(j){for(var b=arguments.length,I=new Array(b>1?b-1:0),F=1;F<b;F++)I[F-1]=arguments[F];return ot.run("intersection",j,I)},xor:function(j){for(var b=arguments.length,I=new Array(b>1?b-1:0),F=1;F<b;F++)I[F-1]=arguments[F];return ot.run("xor",j,I)},difference:function(j){for(var b=arguments.length,I=new Array(b>1?b-1:0),F=1;F<b;F++)I[F-1]=arguments[F];return ot.run("difference",j,I)}};return Wt})});var tO=X((ug,Q2)=>{(function(n,t){typeof ug=="object"&&typeof Q2!="undefined"?t(ug):typeof define=="function"&&define.amd?define(["exports"],t):t(n.jsts={})})(ug,function(n){"use strict";function t(){}function e(r){this.message=r||""}function i(r){this.message=r||""}function s(r){this.message=r||""}function u(){}function c(r){return r===null?Ae:r.color}function f(r){return r===null?null:r.parent}function p(r,o){r!==null&&(r.color=o)}function d(r){return r===null?null:r.left}function g(r){return r===null?null:r.right}function y(){this.root_=null,this.size_=0}function v(){}function E(){this.array_=[],arguments[0]instanceof tt&&this.addAll(arguments[0])}function M(){}function A(r){this.message=r||""}function _(){this.array_=[]}"fill"in Array.prototype||Object.defineProperty(Array.prototype,"fill",{configurable:!0,value:function(r){if(this===void 0||this===null)throw new TypeError(this+" is not an object");var o=Object(this),a=Math.max(Math.min(o.length,9007199254740991),0)||0,l=1 in arguments&&parseInt(Number(arguments[1]),10)||0;l=l<0?Math.max(a+l,0):Math.min(l,a);var h=2 in arguments&&arguments[2]!==void 0?parseInt(Number(arguments[2]),10)||0:a;for(h=h<0?Math.max(a+arguments[2],0):Math.min(h,a);l<h;)o[l]=r,++l;return o},writable:!0}),Number.isFinite=Number.isFinite||function(r){return typeof r=="number"&&isFinite(r)},Number.isInteger=Number.isInteger||function(r){return typeof r=="number"&&isFinite(r)&&Math.floor(r)===r},Number.parseFloat=Number.parseFloat||parseFloat,Number.isNaN=Number.isNaN||function(r){return r!=r},Math.trunc=Math.trunc||function(r){return r<0?Math.ceil(r):Math.floor(r)};var x=function(){};x.prototype.interfaces_=function(){return[]},x.prototype.getClass=function(){return x},x.prototype.equalsWithTolerance=function(r,o,a){return Math.abs(r-o)<=a};var T=function(r){function o(a){r.call(this,a),this.name="IllegalArgumentException",this.message=a,this.stack=new r().stack}return r&&(o.__proto__=r),o.prototype=Object.create(r&&r.prototype),o.prototype.constructor=o,o}(Error),w=function(){},R={MAX_VALUE:{configurable:!0}};w.isNaN=function(r){return Number.isNaN(r)},w.doubleToLongBits=function(r){return r},w.longBitsToDouble=function(r){return r},w.isInfinite=function(r){return!Number.isFinite(r)},R.MAX_VALUE.get=function(){return Number.MAX_VALUE},Object.defineProperties(w,R);var z=function(){},U=function(){},D=function(){},P=function r(){if(this.x=null,this.y=null,this.z=null,arguments.length===0)this.x=0,this.y=0,this.z=r.NULL_ORDINATE;else if(arguments.length===1){var o=arguments[0];this.x=o.x,this.y=o.y,this.z=o.z}else arguments.length===2?(this.x=arguments[0],this.y=arguments[1],this.z=r.NULL_ORDINATE):arguments.length===3&&(this.x=arguments[0],this.y=arguments[1],this.z=arguments[2])},ct={DimensionalComparator:{configurable:!0},serialVersionUID:{configurable:!0},NULL_ORDINATE:{configurable:!0},X:{configurable:!0},Y:{configurable:!0},Z:{configurable:!0}};P.prototype.setOrdinate=function(r,o){switch(r){case P.X:this.x=o;break;case P.Y:this.y=o;break;case P.Z:this.z=o;break;default:throw new T("Invalid ordinate index: "+r)}},P.prototype.equals2D=function(){if(arguments.length===1){var r=arguments[0];return this.x===r.x&&this.y===r.y}if(arguments.length===2){var o=arguments[0],a=arguments[1];return!!x.equalsWithTolerance(this.x,o.x,a)&&!!x.equalsWithTolerance(this.y,o.y,a)}},P.prototype.getOrdinate=function(r){switch(r){case P.X:return this.x;case P.Y:return this.y;case P.Z:return this.z}throw new T("Invalid ordinate index: "+r)},P.prototype.equals3D=function(r){return this.x===r.x&&this.y===r.y&&(this.z===r.z||w.isNaN(this.z))&&w.isNaN(r.z)},P.prototype.equals=function(r){return r instanceof P&&this.equals2D(r)},P.prototype.equalInZ=function(r,o){return x.equalsWithTolerance(this.z,r.z,o)},P.prototype.compareTo=function(r){var o=r;return this.x<o.x?-1:this.x>o.x?1:this.y<o.y?-1:this.y>o.y?1:0},P.prototype.clone=function(){},P.prototype.copy=function(){return new P(this)},P.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},P.prototype.distance3D=function(r){var o=this.x-r.x,a=this.y-r.y,l=this.z-r.z;return Math.sqrt(o*o+a*a+l*l)},P.prototype.distance=function(r){var o=this.x-r.x,a=this.y-r.y;return Math.sqrt(o*o+a*a)},P.prototype.hashCode=function(){var r=17;return r=37*r+P.hashCode(this.x),r=37*r+P.hashCode(this.y)},P.prototype.setCoordinate=function(r){this.x=r.x,this.y=r.y,this.z=r.z},P.prototype.interfaces_=function(){return[z,U,t]},P.prototype.getClass=function(){return P},P.hashCode=function(){if(arguments.length===1){var r=arguments[0],o=w.doubleToLongBits(r);return Math.trunc((o^o)>>>32)}},ct.DimensionalComparator.get=function(){return L},ct.serialVersionUID.get=function(){return 6683108902428367e3},ct.NULL_ORDINATE.get=function(){return w.NaN},ct.X.get=function(){return 0},ct.Y.get=function(){return 1},ct.Z.get=function(){return 2},Object.defineProperties(P,ct);var L=function(r){if(this._dimensionsToTest=2,arguments.length!==0){if(arguments.length===1){var o=arguments[0];if(o!==2&&o!==3)throw new T("only 2 or 3 dimensions may be specified");this._dimensionsToTest=o}}};L.prototype.compare=function(r,o){var a=r,l=o,h=L.compare(a.x,l.x);if(h!==0)return h;var m=L.compare(a.y,l.y);return m!==0?m:this._dimensionsToTest<=2?0:L.compare(a.z,l.z)},L.prototype.interfaces_=function(){return[D]},L.prototype.getClass=function(){return L},L.compare=function(r,o){return r<o?-1:r>o?1:w.isNaN(r)?w.isNaN(o)?0:-1:w.isNaN(o)?1:0};var W=function(){};W.prototype.create=function(){},W.prototype.interfaces_=function(){return[]},W.prototype.getClass=function(){return W};var V=function(){},Mt={INTERIOR:{configurable:!0},BOUNDARY:{configurable:!0},EXTERIOR:{configurable:!0},NONE:{configurable:!0}};V.prototype.interfaces_=function(){return[]},V.prototype.getClass=function(){return V},V.toLocationSymbol=function(r){switch(r){case V.EXTERIOR:return"e";case V.BOUNDARY:return"b";case V.INTERIOR:return"i";case V.NONE:return"-"}throw new T("Unknown location value: "+r)},Mt.INTERIOR.get=function(){return 0},Mt.BOUNDARY.get=function(){return 1},Mt.EXTERIOR.get=function(){return 2},Mt.NONE.get=function(){return-1},Object.defineProperties(V,Mt);var $=function(r,o){return r.interfaces_&&r.interfaces_().indexOf(o)>-1},gt=function(){},ft={LOG_10:{configurable:!0}};gt.prototype.interfaces_=function(){return[]},gt.prototype.getClass=function(){return gt},gt.log10=function(r){var o=Math.log(r);return w.isInfinite(o)||w.isNaN(o)?o:o/gt.LOG_10},gt.min=function(r,o,a,l){var h=r;return o<h&&(h=o),a<h&&(h=a),l<h&&(h=l),h},gt.clamp=function(){if(typeof arguments[2]=="number"&&typeof arguments[0]=="number"&&typeof arguments[1]=="number"){var r=arguments[0],o=arguments[1],a=arguments[2];return r<o?o:r>a?a:r}if(Number.isInteger(arguments[2])&&Number.isInteger(arguments[0])&&Number.isInteger(arguments[1])){var l=arguments[0],h=arguments[1],m=arguments[2];return l<h?h:l>m?m:l}},gt.wrap=function(r,o){return r<0?o- -r%o:r%o},gt.max=function(){if(arguments.length===3){var r=arguments[0],o=arguments[1],a=arguments[2],l=r;return o>l&&(l=o),a>l&&(l=a),l}if(arguments.length===4){var h=arguments[0],m=arguments[1],S=arguments[2],C=arguments[3],B=h;return m>B&&(B=m),S>B&&(B=S),C>B&&(B=C),B}},gt.average=function(r,o){return(r+o)/2},ft.LOG_10.get=function(){return Math.log(10)},Object.defineProperties(gt,ft);var vt=function(r){this.str=r};vt.prototype.append=function(r){this.str+=r},vt.prototype.setCharAt=function(r,o){this.str=this.str.substr(0,r)+o+this.str.substr(r+1)},vt.prototype.toString=function(r){return this.str};var it=function(r){this.value=r};it.prototype.intValue=function(){return this.value},it.prototype.compareTo=function(r){return this.value<r?-1:this.value>r?1:0},it.isNaN=function(r){return Number.isNaN(r)};var lt=function(){};lt.isWhitespace=function(r){return r<=32&&r>=0||r===127},lt.toUpperCase=function(r){return r.toUpperCase()};var H=function r(){if(this._hi=0,this._lo=0,arguments.length===0)this.init(0);else if(arguments.length===1){if(typeof arguments[0]=="number"){var o=arguments[0];this.init(o)}else if(arguments[0]instanceof r){var a=arguments[0];this.init(a)}else if(typeof arguments[0]=="string"){var l=arguments[0];r.call(this,r.parse(l))}}else if(arguments.length===2){var h=arguments[0],m=arguments[1];this.init(h,m)}},At={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}};H.prototype.le=function(r){return(this._hi<r._hi||this._hi===r._hi)&&this._lo<=r._lo},H.prototype.extractSignificantDigits=function(r,o){var a=this.abs(),l=H.magnitude(a._hi),h=H.TEN.pow(l);(a=a.divide(h)).gt(H.TEN)?(a=a.divide(H.TEN),l+=1):a.lt(H.ONE)&&(a=a.multiply(H.TEN),l-=1);for(var m=l+1,S=new vt,C=H.MAX_PRINT_DIGITS-1,B=0;B<=C;B++){r&&B===m&&S.append(".");var K=Math.trunc(a._hi);if(K<0)break;var mt=!1,yt=0;K>9?(mt=!0,yt="9"):yt="0"+K,S.append(yt),a=a.subtract(H.valueOf(K)).multiply(H.TEN),mt&&a.selfAdd(H.TEN);var zt=!0,qt=H.magnitude(a._hi);if(qt<0&&Math.abs(qt)>=C-B&&(zt=!1),!zt)break}return o[0]=l,S.toString()},H.prototype.sqr=function(){return this.multiply(this)},H.prototype.doubleValue=function(){return this._hi+this._lo},H.prototype.subtract=function(){if(arguments[0]instanceof H){var r=arguments[0];return this.add(r.negate())}if(typeof arguments[0]=="number"){var o=arguments[0];return this.add(-o)}},H.prototype.equals=function(){if(arguments.length===1){var r=arguments[0];return this._hi===r._hi&&this._lo===r._lo}},H.prototype.isZero=function(){return this._hi===0&&this._lo===0},H.prototype.selfSubtract=function(){if(arguments[0]instanceof H){var r=arguments[0];return this.isNaN()?this:this.selfAdd(-r._hi,-r._lo)}if(typeof arguments[0]=="number"){var o=arguments[0];return this.isNaN()?this:this.selfAdd(-o,0)}},H.prototype.getSpecialNumberString=function(){return this.isZero()?"0.0":this.isNaN()?"NaN ":null},H.prototype.min=function(r){return this.le(r)?this:r},H.prototype.selfDivide=function(){if(arguments.length===1){if(arguments[0]instanceof H){var r=arguments[0];return this.selfDivide(r._hi,r._lo)}if(typeof arguments[0]=="number"){var o=arguments[0];return this.selfDivide(o,0)}}else if(arguments.length===2){var a=arguments[0],l=arguments[1],h=null,m=null,S=null,C=null,B=null,K=null,mt=null,yt=null;return B=this._hi/a,K=H.SPLIT*B,h=K-B,yt=H.SPLIT*a,h=K-h,m=B-h,S=yt-a,mt=B*a,S=yt-S,C=a-S,yt=h*S-mt+h*C+m*S+m*C,K=(this._hi-mt-yt+this._lo-B*l)/a,yt=B+K,this._hi=yt,this._lo=B-yt+K,this}},H.prototype.dump=function(){return"DD<"+this._hi+", "+this._lo+">"},H.prototype.divide=function(){if(arguments[0]instanceof H){var r=arguments[0],o=null,a=null,l=null,h=null,m=null,S=null,C=null,B=null;return a=(m=this._hi/r._hi)-(o=(S=H.SPLIT*m)-(o=S-m)),B=o*(l=(B=H.SPLIT*r._hi)-(l=B-r._hi))-(C=m*r._hi)+o*(h=r._hi-l)+a*l+a*h,S=(this._hi-C-B+this._lo-m*r._lo)/r._hi,new H(B=m+S,m-B+S)}if(typeof arguments[0]=="number"){var K=arguments[0];return w.isNaN(K)?H.createNaN():H.copy(this).selfDivide(K,0)}},H.prototype.ge=function(r){return(this._hi>r._hi||this._hi===r._hi)&&this._lo>=r._lo},H.prototype.pow=function(r){if(r===0)return H.valueOf(1);var o=new H(this),a=H.valueOf(1),l=Math.abs(r);if(l>1)for(;l>0;)l%2==1&&a.selfMultiply(o),(l/=2)>0&&(o=o.sqr());else a=o;return r<0?a.reciprocal():a},H.prototype.ceil=function(){if(this.isNaN())return H.NaN;var r=Math.ceil(this._hi),o=0;return r===this._hi&&(o=Math.ceil(this._lo)),new H(r,o)},H.prototype.compareTo=function(r){var o=r;return this._hi<o._hi?-1:this._hi>o._hi?1:this._lo<o._lo?-1:this._lo>o._lo?1:0},H.prototype.rint=function(){return this.isNaN()?this:this.add(.5).floor()},H.prototype.setValue=function(){if(arguments[0]instanceof H){var r=arguments[0];return this.init(r),this}if(typeof arguments[0]=="number"){var o=arguments[0];return this.init(o),this}},H.prototype.max=function(r){return this.ge(r)?this:r},H.prototype.sqrt=function(){if(this.isZero())return H.valueOf(0);if(this.isNegative())return H.NaN;var r=1/Math.sqrt(this._hi),o=this._hi*r,a=H.valueOf(o),l=this.subtract(a.sqr())._hi*(.5*r);return a.add(l)},H.prototype.selfAdd=function(){if(arguments.length===1){if(arguments[0]instanceof H){var r=arguments[0];return this.selfAdd(r._hi,r._lo)}if(typeof arguments[0]=="number"){var o=arguments[0],a=null,l=null,h=null,m=null,S=null,C=null;return h=this._hi+o,S=h-this._hi,m=h-S,m=o-S+(this._hi-m),C=m+this._lo,a=h+C,l=C+(h-a),this._hi=a+l,this._lo=l+(a-this._hi),this}}else if(arguments.length===2){var B=arguments[0],K=arguments[1],mt=null,yt=null,zt=null,qt=null,Jt=null,ue=null,dn=null;qt=this._hi+B,yt=this._lo+K,Jt=qt-(ue=qt-this._hi),zt=yt-(dn=yt-this._lo);var Xn=(mt=qt+(ue=(Jt=B-ue+(this._hi-Jt))+yt))+(ue=(zt=K-dn+(this._lo-zt))+(ue+(qt-mt))),Dr=ue+(mt-Xn);return this._hi=Xn,this._lo=Dr,this}},H.prototype.selfMultiply=function(){if(arguments.length===1){if(arguments[0]instanceof H){var r=arguments[0];return this.selfMultiply(r._hi,r._lo)}if(typeof arguments[0]=="number"){var o=arguments[0];return this.selfMultiply(o,0)}}else if(arguments.length===2){var a=arguments[0],l=arguments[1],h=null,m=null,S=null,C=null,B=null,K=null;h=(B=H.SPLIT*this._hi)-this._hi,K=H.SPLIT*a,h=B-h,m=this._hi-h,S=K-a;var mt=(B=this._hi*a)+(K=h*(S=K-S)-B+h*(C=a-S)+m*S+m*C+(this._hi*l+this._lo*a)),yt=K+(h=B-mt);return this._hi=mt,this._lo=yt,this}},H.prototype.selfSqr=function(){return this.selfMultiply(this)},H.prototype.floor=function(){if(this.isNaN())return H.NaN;var r=Math.floor(this._hi),o=0;return r===this._hi&&(o=Math.floor(this._lo)),new H(r,o)},H.prototype.negate=function(){return this.isNaN()?this:new H(-this._hi,-this._lo)},H.prototype.clone=function(){},H.prototype.multiply=function(){if(arguments[0]instanceof H){var r=arguments[0];return r.isNaN()?H.createNaN():H.copy(this).selfMultiply(r)}if(typeof arguments[0]=="number"){var o=arguments[0];return w.isNaN(o)?H.createNaN():H.copy(this).selfMultiply(o,0)}},H.prototype.isNaN=function(){return w.isNaN(this._hi)},H.prototype.intValue=function(){return Math.trunc(this._hi)},H.prototype.toString=function(){var r=H.magnitude(this._hi);return r>=-3&&r<=20?this.toStandardNotation():this.toSciNotation()},H.prototype.toStandardNotation=function(){var r=this.getSpecialNumberString();if(r!==null)return r;var o=new Array(1).fill(null),a=this.extractSignificantDigits(!0,o),l=o[0]+1,h=a;if(a.charAt(0)===".")h="0"+a;else if(l<0)h="0."+H.stringOfChar("0",-l)+a;else if(a.indexOf(".")===-1){var m=l-a.length;h=a+H.stringOfChar("0",m)+".0"}return this.isNegative()?"-"+h:h},H.prototype.reciprocal=function(){var r=null,o=null,a=null,l=null,h=null,m=null,S=null,C=null;o=(h=1/this._hi)-(r=(m=H.SPLIT*h)-(r=m-h)),a=(C=H.SPLIT*this._hi)-this._hi;var B=h+(m=(1-(S=h*this._hi)-(C=r*(a=C-a)-S+r*(l=this._hi-a)+o*a+o*l)-h*this._lo)/this._hi);return new H(B,h-B+m)},H.prototype.toSciNotation=function(){if(this.isZero())return H.SCI_NOT_ZERO;var r=this.getSpecialNumberString();if(r!==null)return r;var o=new Array(1).fill(null),a=this.extractSignificantDigits(!1,o),l=H.SCI_NOT_EXPONENT_CHAR+o[0];if(a.charAt(0)==="0")throw new Error("Found leading zero: "+a);var h="";a.length>1&&(h=a.substring(1));var m=a.charAt(0)+"."+h;return this.isNegative()?"-"+m+l:m+l},H.prototype.abs=function(){return this.isNaN()?H.NaN:this.isNegative()?this.negate():new H(this)},H.prototype.isPositive=function(){return(this._hi>0||this._hi===0)&&this._lo>0},H.prototype.lt=function(r){return(this._hi<r._hi||this._hi===r._hi)&&this._lo<r._lo},H.prototype.add=function(){if(arguments[0]instanceof H){var r=arguments[0];return H.copy(this).selfAdd(r)}if(typeof arguments[0]=="number"){var o=arguments[0];return H.copy(this).selfAdd(o)}},H.prototype.init=function(){if(arguments.length===1){if(typeof arguments[0]=="number"){var r=arguments[0];this._hi=r,this._lo=0}else if(arguments[0]instanceof H){var o=arguments[0];this._hi=o._hi,this._lo=o._lo}}else if(arguments.length===2){var a=arguments[0],l=arguments[1];this._hi=a,this._lo=l}},H.prototype.gt=function(r){return(this._hi>r._hi||this._hi===r._hi)&&this._lo>r._lo},H.prototype.isNegative=function(){return(this._hi<0||this._hi===0)&&this._lo<0},H.prototype.trunc=function(){return this.isNaN()?H.NaN:this.isPositive()?this.floor():this.ceil()},H.prototype.signum=function(){return this._hi>0?1:this._hi<0?-1:this._lo>0?1:this._lo<0?-1:0},H.prototype.interfaces_=function(){return[t,z,U]},H.prototype.getClass=function(){return H},H.sqr=function(r){return H.valueOf(r).selfMultiply(r)},H.valueOf=function(){if(typeof arguments[0]=="string"){var r=arguments[0];return H.parse(r)}if(typeof arguments[0]=="number"){var o=arguments[0];return new H(o)}},H.sqrt=function(r){return H.valueOf(r).sqrt()},H.parse=function(r){for(var o=0,a=r.length;lt.isWhitespace(r.charAt(o));)o++;var l=!1;if(o<a){var h=r.charAt(o);h!=="-"&&h!=="+"||(o++,h==="-"&&(l=!0))}for(var m=new H,S=0,C=0,B=0;!(o>=a);){var K=r.charAt(o);if(o++,lt.isDigit(K)){var mt=K-"0";m.selfMultiply(H.TEN),m.selfAdd(mt),S++}else{if(K!=="."){if(K==="e"||K==="E"){var yt=r.substring(o);try{B=it.parseInt(yt)}catch(dn){throw dn instanceof Error?new Error("Invalid exponent "+yt+" in string "+r):dn}break}throw new Error("Unexpected character '"+K+"' at position "+o+" in string "+r)}C=S}}var zt=m,qt=S-C-B;if(qt===0)zt=m;else if(qt>0){var Jt=H.TEN.pow(qt);zt=m.divide(Jt)}else if(qt<0){var ue=H.TEN.pow(-qt);zt=m.multiply(ue)}return l?zt.negate():zt},H.createNaN=function(){return new H(w.NaN,w.NaN)},H.copy=function(r){return new H(r)},H.magnitude=function(r){var o=Math.abs(r),a=Math.log(o)/Math.log(10),l=Math.trunc(Math.floor(a));return 10*Math.pow(10,l)<=o&&(l+=1),l},H.stringOfChar=function(r,o){for(var a=new vt,l=0;l<o;l++)a.append(r);return a.toString()},At.PI.get=function(){return new H(3.141592653589793,12246467991473532e-32)},At.TWO_PI.get=function(){return new H(6.283185307179586,24492935982947064e-32)},At.PI_2.get=function(){return new H(1.5707963267948966,6123233995736766e-32)},At.E.get=function(){return new H(2.718281828459045,14456468917292502e-32)},At.NaN.get=function(){return new H(w.NaN,w.NaN)},At.EPS.get=function(){return 123259516440783e-46},At.SPLIT.get=function(){return 134217729},At.MAX_PRINT_DIGITS.get=function(){return 32},At.TEN.get=function(){return H.valueOf(10)},At.ONE.get=function(){return H.valueOf(1)},At.SCI_NOT_EXPONENT_CHAR.get=function(){return"E"},At.SCI_NOT_ZERO.get=function(){return"0.0E0"},Object.defineProperties(H,At);var It=function(){},Kt={DP_SAFE_EPSILON:{configurable:!0}};It.prototype.interfaces_=function(){return[]},It.prototype.getClass=function(){return It},It.orientationIndex=function(r,o,a){var l=It.orientationIndexFilter(r,o,a);if(l<=1)return l;var h=H.valueOf(o.x).selfAdd(-r.x),m=H.valueOf(o.y).selfAdd(-r.y),S=H.valueOf(a.x).selfAdd(-o.x),C=H.valueOf(a.y).selfAdd(-o.y);return h.selfMultiply(C).selfSubtract(m.selfMultiply(S)).signum()},It.signOfDet2x2=function(r,o,a,l){return r.multiply(l).selfSubtract(o.multiply(a)).signum()},It.intersection=function(r,o,a,l){var h=H.valueOf(l.y).selfSubtract(a.y).selfMultiply(H.valueOf(o.x).selfSubtract(r.x)),m=H.valueOf(l.x).selfSubtract(a.x).selfMultiply(H.valueOf(o.y).selfSubtract(r.y)),S=h.subtract(m),C=H.valueOf(l.x).selfSubtract(a.x).selfMultiply(H.valueOf(r.y).selfSubtract(a.y)),B=H.valueOf(l.y).selfSubtract(a.y).selfMultiply(H.valueOf(r.x).selfSubtract(a.x)),K=C.subtract(B).selfDivide(S).doubleValue(),mt=H.valueOf(r.x).selfAdd(H.valueOf(o.x).selfSubtract(r.x).selfMultiply(K)).doubleValue(),yt=H.valueOf(o.x).selfSubtract(r.x).selfMultiply(H.valueOf(r.y).selfSubtract(a.y)),zt=H.valueOf(o.y).selfSubtract(r.y).selfMultiply(H.valueOf(r.x).selfSubtract(a.x)),qt=yt.subtract(zt).selfDivide(S).doubleValue(),Jt=H.valueOf(a.y).selfAdd(H.valueOf(l.y).selfSubtract(a.y).selfMultiply(qt)).doubleValue();return new P(mt,Jt)},It.orientationIndexFilter=function(r,o,a){var l=null,h=(r.x-a.x)*(o.y-a.y),m=(r.y-a.y)*(o.x-a.x),S=h-m;if(h>0){if(m<=0)return It.signum(S);l=h+m}else{if(!(h<0)||m>=0)return It.signum(S);l=-h-m}var C=It.DP_SAFE_EPSILON*l;return S>=C||-S>=C?It.signum(S):2},It.signum=function(r){return r>0?1:r<0?-1:0},Kt.DP_SAFE_EPSILON.get=function(){return 1e-15},Object.defineProperties(It,Kt);var nt=function(){},bt={X:{configurable:!0},Y:{configurable:!0},Z:{configurable:!0},M:{configurable:!0}};bt.X.get=function(){return 0},bt.Y.get=function(){return 1},bt.Z.get=function(){return 2},bt.M.get=function(){return 3},nt.prototype.setOrdinate=function(r,o,a){},nt.prototype.size=function(){},nt.prototype.getOrdinate=function(r,o){},nt.prototype.getCoordinate=function(){},nt.prototype.getCoordinateCopy=function(r){},nt.prototype.getDimension=function(){},nt.prototype.getX=function(r){},nt.prototype.clone=function(){},nt.prototype.expandEnvelope=function(r){},nt.prototype.copy=function(){},nt.prototype.getY=function(r){},nt.prototype.toCoordinateArray=function(){},nt.prototype.interfaces_=function(){return[U]},nt.prototype.getClass=function(){return nt},Object.defineProperties(nt,bt);var Vt=function(){},$t=function(r){function o(){r.call(this,"Projective point not representable on the Cartesian plane.")}return r&&(o.__proto__=r),o.prototype=Object.create(r&&r.prototype),o.prototype.constructor=o,o.prototype.interfaces_=function(){return[]},o.prototype.getClass=function(){return o},o}(Vt),Ut=function(){};Ut.arraycopy=function(r,o,a,l,h){for(var m=0,S=o;S<o+h;S++)a[l+m]=r[S],m++},Ut.getProperty=function(r){return{"line.separator":\`
|
|
@@ -11920,9 +11920,9 @@ void main() {
|
|
|
11920
11920
|
|
|
11921
11921
|
}\`,Sv=class{constructor(){this.texture=null,this.mesh=null,this.depthNear=0,this.depthFar=0}init(t,e,i){if(this.texture===null){let s=new uo,u=t.properties.get(s);u.__webglTexture=e.texture,(e.depthNear!=i.depthNear||e.depthFar!=i.depthFar)&&(this.depthNear=e.depthNear,this.depthFar=e.depthFar),this.texture=s}}render(t,e){if(this.texture!==null){if(this.mesh===null){let i=e.cameras[0].viewport,s=new Qo({extensions:{fragDepth:!0},vertexShader:U7,fragmentShader:B7,uniforms:{depthColor:{value:this.texture},depthWidth:{value:i.z},depthHeight:{value:i.w}}});this.mesh=new No(new jp(20,20),s)}t.render(this.mesh,e)}}reset(){this.texture=null,this.mesh=null}},wv=class extends _a{constructor(t,e){super();let i=this,s=null,u=1,c=null,f="local-floor",p=1,d=null,g=null,y=null,v=null,E=null,M=null,A=new Sv,_=e.getContextAttributes(),x=null,T=null,w=[],R=[],z=new Ot,U=null,D=new Zi;D.layers.enable(1),D.viewport=new Yr;let P=new Zi;P.layers.enable(2),P.viewport=new Yr;let ct=[D,P],L=new Ev;L.layers.enable(1),L.layers.enable(2);let W=null,V=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(nt){let bt=w[nt];return bt===void 0&&(bt=new af,w[nt]=bt),bt.getTargetRaySpace()},this.getControllerGrip=function(nt){let bt=w[nt];return bt===void 0&&(bt=new af,w[nt]=bt),bt.getGripSpace()},this.getHand=function(nt){let bt=w[nt];return bt===void 0&&(bt=new af,w[nt]=bt),bt.getHandSpace()};function Mt(nt){let bt=R.indexOf(nt.inputSource);if(bt===-1)return;let Vt=w[bt];Vt!==void 0&&(Vt.update(nt.inputSource,nt.frame,d||c),Vt.dispatchEvent({type:nt.type,data:nt.inputSource}))}function $(){s.removeEventListener("select",Mt),s.removeEventListener("selectstart",Mt),s.removeEventListener("selectend",Mt),s.removeEventListener("squeeze",Mt),s.removeEventListener("squeezestart",Mt),s.removeEventListener("squeezeend",Mt),s.removeEventListener("end",$),s.removeEventListener("inputsourceschange",gt);for(let nt=0;nt<w.length;nt++){let bt=R[nt];bt!==null&&(R[nt]=null,w[nt].disconnect(bt))}W=null,V=null,A.reset(),t.setRenderTarget(x),E=null,v=null,y=null,s=null,T=null,Kt.stop(),i.isPresenting=!1,t.setPixelRatio(U),t.setSize(z.width,z.height,!1),i.dispatchEvent({type:"sessionend"})}this.setFramebufferScaleFactor=function(nt){u=nt,i.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(nt){f=nt,i.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return d||c},this.setReferenceSpace=function(nt){d=nt},this.getBaseLayer=function(){return v!==null?v:E},this.getBinding=function(){return y},this.getFrame=function(){return M},this.getSession=function(){return s},this.setSession=function(nt){return Ri(this,null,function*(){if(s=nt,s!==null){if(x=t.getRenderTarget(),s.addEventListener("select",Mt),s.addEventListener("selectstart",Mt),s.addEventListener("selectend",Mt),s.addEventListener("squeeze",Mt),s.addEventListener("squeezestart",Mt),s.addEventListener("squeezeend",Mt),s.addEventListener("end",$),s.addEventListener("inputsourceschange",gt),_.xrCompatible!==!0&&(yield e.makeXRCompatible()),U=t.getPixelRatio(),t.getSize(z),s.renderState.layers===void 0||t.capabilities.isWebGL2===!1){let bt={antialias:s.renderState.layers===void 0?_.antialias:!0,alpha:!0,depth:_.depth,stencil:_.stencil,framebufferScaleFactor:u};E=new XRWebGLLayer(s,e,bt),s.updateRenderState({baseLayer:E}),t.setPixelRatio(1),t.setSize(E.framebufferWidth,E.framebufferHeight,!1),T=new Us(E.framebufferWidth,E.framebufferHeight,{format:Lo,type:ma,colorSpace:t.outputColorSpace,stencilBuffer:_.stencil})}else{let bt=null,Vt=null,$t=null;_.depth&&($t=_.stencil?e.DEPTH24_STENCIL8:e.DEPTH_COMPONENT24,bt=_.stencil?Pl:au,Vt=_.stencil?su:pa);let Ut={colorFormat:e.RGBA8,depthFormat:$t,scaleFactor:u};y=new XRWebGLBinding(s,e),v=y.createProjectionLayer(Ut),s.updateRenderState({layers:[v]}),t.setPixelRatio(1),t.setSize(v.textureWidth,v.textureHeight,!1),T=new Us(v.textureWidth,v.textureHeight,{format:Lo,type:ma,depthTexture:new Qp(v.textureWidth,v.textureHeight,Vt,void 0,void 0,void 0,void 0,void 0,void 0,bt),stencilBuffer:_.stencil,colorSpace:t.outputColorSpace,samples:_.antialias?4:0});let Gt=t.properties.get(T);Gt.__ignoreDepthValues=v.ignoreDepthValues}T.isXRRenderTarget=!0,this.setFoveation(p),d=null,c=yield s.requestReferenceSpace(f),Kt.setContext(s),Kt.start(),i.isPresenting=!0,i.dispatchEvent({type:"sessionstart"})}})},this.getEnvironmentBlendMode=function(){if(s!==null)return s.environmentBlendMode};function gt(nt){for(let bt=0;bt<nt.removed.length;bt++){let Vt=nt.removed[bt],$t=R.indexOf(Vt);$t>=0&&(R[$t]=null,w[$t].disconnect(Vt))}for(let bt=0;bt<nt.added.length;bt++){let Vt=nt.added[bt],$t=R.indexOf(Vt);if($t===-1){for(let Gt=0;Gt<w.length;Gt++)if(Gt>=R.length){R.push(Vt),$t=Gt;break}else if(R[Gt]===null){R[Gt]=Vt,$t=Gt;break}if($t===-1)break}let Ut=w[$t];Ut&&Ut.connect(Vt)}}let ft=new st,vt=new st;function it(nt,bt,Vt){ft.setFromMatrixPosition(bt.matrixWorld),vt.setFromMatrixPosition(Vt.matrixWorld);let $t=ft.distanceTo(vt),Ut=bt.projectionMatrix.elements,Gt=Vt.projectionMatrix.elements,Ct=Ut[14]/(Ut[10]-1),ee=Ut[14]/(Ut[10]+1),Z=(Ut[9]+1)/Ut[5],Dt=(Ut[9]-1)/Ut[5],_t=(Ut[8]-1)/Ut[0],Nt=(Gt[8]+1)/Gt[0],wt=Ct*_t,Ht=Ct*Nt,Xt=$t/(-_t+Nt),Pt=Xt*-_t;bt.matrixWorld.decompose(nt.position,nt.quaternion,nt.scale),nt.translateX(Pt),nt.translateZ(Xt),nt.matrixWorld.compose(nt.position,nt.quaternion,nt.scale),nt.matrixWorldInverse.copy(nt.matrixWorld).invert();let ne=Ct+Xt,Y=ee+Xt,N=wt-Pt,xt=Ht+($t-Pt),St=Z*ee/Y*ne,ot=Dt*ee/Y*ne;nt.projectionMatrix.makePerspective(N,xt,St,ot,ne,Y),nt.projectionMatrixInverse.copy(nt.projectionMatrix).invert()}function lt(nt,bt){bt===null?nt.matrixWorld.copy(nt.matrix):nt.matrixWorld.multiplyMatrices(bt.matrixWorld,nt.matrix),nt.matrixWorldInverse.copy(nt.matrixWorld).invert()}this.updateCamera=function(nt){if(s===null)return;A.texture!==null&&(nt.near=A.depthNear,nt.far=A.depthFar),L.near=P.near=D.near=nt.near,L.far=P.far=D.far=nt.far,(W!==L.near||V!==L.far)&&(s.updateRenderState({depthNear:L.near,depthFar:L.far}),W=L.near,V=L.far,D.near=W,D.far=V,P.near=W,P.far=V,D.updateProjectionMatrix(),P.updateProjectionMatrix(),nt.updateProjectionMatrix());let bt=nt.parent,Vt=L.cameras;lt(L,bt);for(let $t=0;$t<Vt.length;$t++)lt(Vt[$t],bt);Vt.length===2?it(L,D,P):L.projectionMatrix.copy(D.projectionMatrix),H(nt,L,bt)};function H(nt,bt,Vt){Vt===null?nt.matrix.copy(bt.matrixWorld):(nt.matrix.copy(Vt.matrixWorld),nt.matrix.invert(),nt.matrix.multiply(bt.matrixWorld)),nt.matrix.decompose(nt.position,nt.quaternion,nt.scale),nt.updateMatrixWorld(!0),nt.projectionMatrix.copy(bt.projectionMatrix),nt.projectionMatrixInverse.copy(bt.projectionMatrixInverse),nt.isPerspectiveCamera&&(nt.fov=ov*2*Math.atan(1/nt.projectionMatrix.elements[5]),nt.zoom=1)}this.getCamera=function(){return L},this.getFoveation=function(){if(!(v===null&&E===null))return p},this.setFoveation=function(nt){p=nt,v!==null&&(v.fixedFoveation=nt),E!==null&&E.fixedFoveation!==void 0&&(E.fixedFoveation=nt)},this.hasDepthSensing=function(){return A.texture!==null};let At=null;function It(nt,bt){if(g=bt.getViewerPose(d||c),M=bt,g!==null){let Vt=g.views;E!==null&&(t.setRenderTargetFramebuffer(T,E.framebuffer),t.setRenderTarget(T));let $t=!1;Vt.length!==L.cameras.length&&(L.cameras.length=0,$t=!0);for(let Gt=0;Gt<Vt.length;Gt++){let Ct=Vt[Gt],ee=null;if(E!==null)ee=E.getViewport(Ct);else{let Dt=y.getViewSubImage(v,Ct);ee=Dt.viewport,Gt===0&&(t.setRenderTargetTextures(T,Dt.colorTexture,v.ignoreDepthValues?void 0:Dt.depthStencilTexture),t.setRenderTarget(T))}let Z=ct[Gt];Z===void 0&&(Z=new Zi,Z.layers.enable(Gt),Z.viewport=new Yr,ct[Gt]=Z),Z.matrix.fromArray(Ct.transform.matrix),Z.matrix.decompose(Z.position,Z.quaternion,Z.scale),Z.projectionMatrix.fromArray(Ct.projectionMatrix),Z.projectionMatrixInverse.copy(Z.projectionMatrix).invert(),Z.viewport.set(ee.x,ee.y,ee.width,ee.height),Gt===0&&(L.matrix.copy(Z.matrix),L.matrix.decompose(L.position,L.quaternion,L.scale)),$t===!0&&L.cameras.push(Z)}let Ut=s.enabledFeatures;if(Ut&&Ut.includes("depth-sensing")){let Gt=y.getDepthInformation(Vt[0]);Gt&&Gt.isValid&&Gt.texture&&A.init(t,Gt,s.renderState)}}for(let Vt=0;Vt<w.length;Vt++){let $t=R[Vt],Ut=w[Vt];$t!==null&&Ut!==void 0&&Ut.update($t,bt,d||c)}A.render(t,L),At&&At(nt,bt),bt.detectedPlanes&&i.dispatchEvent({type:"planesdetected",data:bt}),M=null}let Kt=new oP;Kt.setAnimationLoop(It),this.setAnimationLoop=function(nt){At=nt},this.dispose=function(){}}},Qa=new lu,z7=new $n;function G7(n,t){function e(_,x){_.matrixAutoUpdate===!0&&_.updateMatrix(),x.value.copy(_.matrix)}function i(_,x){x.color.getRGB(_.fogColor.value,iP(n)),x.isFog?(_.fogNear.value=x.near,_.fogFar.value=x.far):x.isFogExp2&&(_.fogDensity.value=x.density)}function s(_,x,T,w,R){x.isMeshBasicMaterial||x.isMeshLambertMaterial?u(_,x):x.isMeshToonMaterial?(u(_,x),y(_,x)):x.isMeshPhongMaterial?(u(_,x),g(_,x)):x.isMeshStandardMaterial?(u(_,x),v(_,x),x.isMeshPhysicalMaterial&&E(_,x,R)):x.isMeshMatcapMaterial?(u(_,x),M(_,x)):x.isMeshDepthMaterial?u(_,x):x.isMeshDistanceMaterial?(u(_,x),A(_,x)):x.isMeshNormalMaterial?u(_,x):x.isLineBasicMaterial?(c(_,x),x.isLineDashedMaterial&&f(_,x)):x.isPointsMaterial?p(_,x,T,w):x.isSpriteMaterial?d(_,x):x.isShadowMaterial?(_.color.value.copy(x.color),_.opacity.value=x.opacity):x.isShaderMaterial&&(x.uniformsNeedUpdate=!1)}function u(_,x){_.opacity.value=x.opacity,x.color&&_.diffuse.value.copy(x.color),x.emissive&&_.emissive.value.copy(x.emissive).multiplyScalar(x.emissiveIntensity),x.map&&(_.map.value=x.map,e(x.map,_.mapTransform)),x.alphaMap&&(_.alphaMap.value=x.alphaMap,e(x.alphaMap,_.alphaMapTransform)),x.bumpMap&&(_.bumpMap.value=x.bumpMap,e(x.bumpMap,_.bumpMapTransform),_.bumpScale.value=x.bumpScale,x.side===Oi&&(_.bumpScale.value*=-1)),x.normalMap&&(_.normalMap.value=x.normalMap,e(x.normalMap,_.normalMapTransform),_.normalScale.value.copy(x.normalScale),x.side===Oi&&_.normalScale.value.negate()),x.displacementMap&&(_.displacementMap.value=x.displacementMap,e(x.displacementMap,_.displacementMapTransform),_.displacementScale.value=x.displacementScale,_.displacementBias.value=x.displacementBias),x.emissiveMap&&(_.emissiveMap.value=x.emissiveMap,e(x.emissiveMap,_.emissiveMapTransform)),x.specularMap&&(_.specularMap.value=x.specularMap,e(x.specularMap,_.specularMapTransform)),x.alphaTest>0&&(_.alphaTest.value=x.alphaTest);let T=t.get(x),w=T.envMap,R=T.envMapRotation;if(w&&(_.envMap.value=w,Qa.copy(R),Qa.x*=-1,Qa.y*=-1,Qa.z*=-1,w.isCubeTexture&&w.isRenderTargetTexture===!1&&(Qa.y*=-1,Qa.z*=-1),_.envMapRotation.value.setFromMatrix4(z7.makeRotationFromEuler(Qa)),_.flipEnvMap.value=w.isCubeTexture&&w.isRenderTargetTexture===!1?-1:1,_.reflectivity.value=x.reflectivity,_.ior.value=x.ior,_.refractionRatio.value=x.refractionRatio),x.lightMap){_.lightMap.value=x.lightMap;let z=n._useLegacyLights===!0?Math.PI:1;_.lightMapIntensity.value=x.lightMapIntensity*z,e(x.lightMap,_.lightMapTransform)}x.aoMap&&(_.aoMap.value=x.aoMap,_.aoMapIntensity.value=x.aoMapIntensity,e(x.aoMap,_.aoMapTransform))}function c(_,x){_.diffuse.value.copy(x.color),_.opacity.value=x.opacity,x.map&&(_.map.value=x.map,e(x.map,_.mapTransform))}function f(_,x){_.dashSize.value=x.dashSize,_.totalSize.value=x.dashSize+x.gapSize,_.scale.value=x.scale}function p(_,x,T,w){_.diffuse.value.copy(x.color),_.opacity.value=x.opacity,_.size.value=x.size*T,_.scale.value=w*.5,x.map&&(_.map.value=x.map,e(x.map,_.uvTransform)),x.alphaMap&&(_.alphaMap.value=x.alphaMap,e(x.alphaMap,_.alphaMapTransform)),x.alphaTest>0&&(_.alphaTest.value=x.alphaTest)}function d(_,x){_.diffuse.value.copy(x.color),_.opacity.value=x.opacity,_.rotation.value=x.rotation,x.map&&(_.map.value=x.map,e(x.map,_.mapTransform)),x.alphaMap&&(_.alphaMap.value=x.alphaMap,e(x.alphaMap,_.alphaMapTransform)),x.alphaTest>0&&(_.alphaTest.value=x.alphaTest)}function g(_,x){_.specular.value.copy(x.specular),_.shininess.value=Math.max(x.shininess,1e-4)}function y(_,x){x.gradientMap&&(_.gradientMap.value=x.gradientMap)}function v(_,x){_.metalness.value=x.metalness,x.metalnessMap&&(_.metalnessMap.value=x.metalnessMap,e(x.metalnessMap,_.metalnessMapTransform)),_.roughness.value=x.roughness,x.roughnessMap&&(_.roughnessMap.value=x.roughnessMap,e(x.roughnessMap,_.roughnessMapTransform)),t.get(x).envMap&&(_.envMapIntensity.value=x.envMapIntensity)}function E(_,x,T){_.ior.value=x.ior,x.sheen>0&&(_.sheenColor.value.copy(x.sheenColor).multiplyScalar(x.sheen),_.sheenRoughness.value=x.sheenRoughness,x.sheenColorMap&&(_.sheenColorMap.value=x.sheenColorMap,e(x.sheenColorMap,_.sheenColorMapTransform)),x.sheenRoughnessMap&&(_.sheenRoughnessMap.value=x.sheenRoughnessMap,e(x.sheenRoughnessMap,_.sheenRoughnessMapTransform))),x.clearcoat>0&&(_.clearcoat.value=x.clearcoat,_.clearcoatRoughness.value=x.clearcoatRoughness,x.clearcoatMap&&(_.clearcoatMap.value=x.clearcoatMap,e(x.clearcoatMap,_.clearcoatMapTransform)),x.clearcoatRoughnessMap&&(_.clearcoatRoughnessMap.value=x.clearcoatRoughnessMap,e(x.clearcoatRoughnessMap,_.clearcoatRoughnessMapTransform)),x.clearcoatNormalMap&&(_.clearcoatNormalMap.value=x.clearcoatNormalMap,e(x.clearcoatNormalMap,_.clearcoatNormalMapTransform),_.clearcoatNormalScale.value.copy(x.clearcoatNormalScale),x.side===Oi&&_.clearcoatNormalScale.value.negate())),x.iridescence>0&&(_.iridescence.value=x.iridescence,_.iridescenceIOR.value=x.iridescenceIOR,_.iridescenceThicknessMinimum.value=x.iridescenceThicknessRange[0],_.iridescenceThicknessMaximum.value=x.iridescenceThicknessRange[1],x.iridescenceMap&&(_.iridescenceMap.value=x.iridescenceMap,e(x.iridescenceMap,_.iridescenceMapTransform)),x.iridescenceThicknessMap&&(_.iridescenceThicknessMap.value=x.iridescenceThicknessMap,e(x.iridescenceThicknessMap,_.iridescenceThicknessMapTransform))),x.transmission>0&&(_.transmission.value=x.transmission,_.transmissionSamplerMap.value=T.texture,_.transmissionSamplerSize.value.set(T.width,T.height),x.transmissionMap&&(_.transmissionMap.value=x.transmissionMap,e(x.transmissionMap,_.transmissionMapTransform)),_.thickness.value=x.thickness,x.thicknessMap&&(_.thicknessMap.value=x.thicknessMap,e(x.thicknessMap,_.thicknessMapTransform)),_.attenuationDistance.value=x.attenuationDistance,_.attenuationColor.value.copy(x.attenuationColor)),x.anisotropy>0&&(_.anisotropyVector.value.set(x.anisotropy*Math.cos(x.anisotropyRotation),x.anisotropy*Math.sin(x.anisotropyRotation)),x.anisotropyMap&&(_.anisotropyMap.value=x.anisotropyMap,e(x.anisotropyMap,_.anisotropyMapTransform))),_.specularIntensity.value=x.specularIntensity,_.specularColor.value.copy(x.specularColor),x.specularColorMap&&(_.specularColorMap.value=x.specularColorMap,e(x.specularColorMap,_.specularColorMapTransform)),x.specularIntensityMap&&(_.specularIntensityMap.value=x.specularIntensityMap,e(x.specularIntensityMap,_.specularIntensityMapTransform))}function M(_,x){x.matcap&&(_.matcap.value=x.matcap)}function A(_,x){let T=t.get(x).light;_.referencePosition.value.setFromMatrixPosition(T.matrixWorld),_.nearDistance.value=T.shadow.camera.near,_.farDistance.value=T.shadow.camera.far}return{refreshFogUniforms:i,refreshMaterialUniforms:s}}function k7(n,t,e,i){let s={},u={},c=[],f=e.isWebGL2?n.getParameter(n.MAX_UNIFORM_BUFFER_BINDINGS):0;function p(T,w){let R=w.program;i.uniformBlockBinding(T,R)}function d(T,w){let R=s[T.id];R===void 0&&(M(T),R=g(T),s[T.id]=R,T.addEventListener("dispose",_));let z=w.program;i.updateUBOMapping(T,z);let U=t.render.frame;u[T.id]!==U&&(v(T),u[T.id]=U)}function g(T){let w=y();T.__bindingPointIndex=w;let R=n.createBuffer(),z=T.__size,U=T.usage;return n.bindBuffer(n.UNIFORM_BUFFER,R),n.bufferData(n.UNIFORM_BUFFER,z,U),n.bindBuffer(n.UNIFORM_BUFFER,null),n.bindBufferBase(n.UNIFORM_BUFFER,w,R),R}function y(){for(let T=0;T<f;T++)if(c.indexOf(T)===-1)return c.push(T),T;return console.error("THREE.WebGLRenderer: Maximum number of simultaneously usable uniforms groups reached."),0}function v(T){let w=s[T.id],R=T.uniforms,z=T.__cache;n.bindBuffer(n.UNIFORM_BUFFER,w);for(let U=0,D=R.length;U<D;U++){let P=Array.isArray(R[U])?R[U]:[R[U]];for(let ct=0,L=P.length;ct<L;ct++){let W=P[ct];if(E(W,U,ct,z)===!0){let V=W.__offset,Mt=Array.isArray(W.value)?W.value:[W.value],$=0;for(let gt=0;gt<Mt.length;gt++){let ft=Mt[gt],vt=A(ft);typeof ft=="number"||typeof ft=="boolean"?(W.__data[0]=ft,n.bufferSubData(n.UNIFORM_BUFFER,V+$,W.__data)):ft.isMatrix3?(W.__data[0]=ft.elements[0],W.__data[1]=ft.elements[1],W.__data[2]=ft.elements[2],W.__data[3]=0,W.__data[4]=ft.elements[3],W.__data[5]=ft.elements[4],W.__data[6]=ft.elements[5],W.__data[7]=0,W.__data[8]=ft.elements[6],W.__data[9]=ft.elements[7],W.__data[10]=ft.elements[8],W.__data[11]=0):(ft.toArray(W.__data,$),$+=vt.storage/Float32Array.BYTES_PER_ELEMENT)}n.bufferSubData(n.UNIFORM_BUFFER,V,W.__data)}}}n.bindBuffer(n.UNIFORM_BUFFER,null)}function E(T,w,R,z){let U=T.value,D=w+"_"+R;if(z[D]===void 0)return typeof U=="number"||typeof U=="boolean"?z[D]=U:z[D]=U.clone(),!0;{let P=z[D];if(typeof U=="number"||typeof U=="boolean"){if(P!==U)return z[D]=U,!0}else if(P.equals(U)===!1)return P.copy(U),!0}return!1}function M(T){let w=T.uniforms,R=0,z=16;for(let D=0,P=w.length;D<P;D++){let ct=Array.isArray(w[D])?w[D]:[w[D]];for(let L=0,W=ct.length;L<W;L++){let V=ct[L],Mt=Array.isArray(V.value)?V.value:[V.value];for(let $=0,gt=Mt.length;$<gt;$++){let ft=Mt[$],vt=A(ft),it=R%z;it!==0&&z-it<vt.boundary&&(R+=z-it),V.__data=new Float32Array(vt.storage/Float32Array.BYTES_PER_ELEMENT),V.__offset=R,R+=vt.storage}}}let U=R%z;return U>0&&(R+=z-U),T.__size=R,T.__cache={},this}function A(T){let w={boundary:0,storage:0};return typeof T=="number"||typeof T=="boolean"?(w.boundary=4,w.storage=4):T.isVector2?(w.boundary=8,w.storage=8):T.isVector3||T.isColor?(w.boundary=16,w.storage=12):T.isVector4?(w.boundary=16,w.storage=16):T.isMatrix3?(w.boundary=48,w.storage=48):T.isMatrix4?(w.boundary=64,w.storage=64):T.isTexture?console.warn("THREE.WebGLRenderer: Texture samplers can not be part of an uniforms group."):console.warn("THREE.WebGLRenderer: Unsupported uniform value type.",T),w}function _(T){let w=T.target;w.removeEventListener("dispose",_);let R=c.indexOf(w.__bindingPointIndex);c.splice(R,1),n.deleteBuffer(s[w.id]),delete s[w.id],delete u[w.id]}function x(){for(let T in s)n.deleteBuffer(s[T]);c=[],s={},u={}}return{bind:p,update:d,dispose:x}}var Mv=class{constructor(t={}){let{canvas:e=W6(),context:i=null,depth:s=!0,stencil:u=!0,alpha:c=!1,antialias:f=!1,premultipliedAlpha:p=!0,preserveDrawingBuffer:d=!1,powerPreference:g="default",failIfMajorPerformanceCaveat:y=!1}=t;this.isWebGLRenderer=!0;let v;i!==null?v=i.getContextAttributes().alpha:v=c;let E=new Uint32Array(4),M=new Int32Array(4),A=null,_=null,x=[],T=[];this.domElement=e,this.debug={checkShaderErrors:!0,onShaderError:null},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this._outputColorSpace=Zo,this._useLegacyLights=!1,this.toneMapping=ga,this.toneMappingExposure=1;let w=this,R=!1,z=0,U=0,D=null,P=-1,ct=null,L=new Yr,W=new Yr,V=null,Mt=new Te(0),$=0,gt=e.width,ft=e.height,vt=1,it=null,lt=null,H=new Yr(0,0,gt,ft),At=new Yr(0,0,gt,ft),It=!1,Kt=new Jp,nt=!1,bt=!1,Vt=null,$t=new $n,Ut=new Ot,Gt=new st,Ct={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};function ee(){return D===null?vt:1}let Z=i;function Dt(q,at){for(let Et=0;Et<q.length;Et++){let dt=q[Et],ut=e.getContext(dt,at);if(ut!==null)return ut}return null}try{let q={alpha:!0,depth:s,stencil:u,antialias:f,premultipliedAlpha:p,preserveDrawingBuffer:d,powerPreference:g,failIfMajorPerformanceCaveat:y};if("setAttribute"in e&&e.setAttribute("data-engine",\`three.js r\${Yv}\`),e.addEventListener("webglcontextlost",ht,!1),e.addEventListener("webglcontextrestored",O,!1),e.addEventListener("webglcontextcreationerror",Q,!1),Z===null){let at=["webgl2","webgl","experimental-webgl"];if(w.isWebGL1Renderer===!0&&at.shift(),Z=Dt(at,q),Z===null)throw Dt(at)?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.")}typeof WebGLRenderingContext!="undefined"&&Z instanceof WebGLRenderingContext&&console.warn("THREE.WebGLRenderer: WebGL 1 support was deprecated in r153 and will be removed in r163."),Z.getShaderPrecisionFormat===void 0&&(Z.getShaderPrecisionFormat=function(){return{rangeMin:1,rangeMax:1,precision:1}})}catch(q){throw console.error("THREE.WebGLRenderer: "+q.message),q}let _t,Nt,wt,Ht,Xt,Pt,ne,Y,N,xt,St,ot,Lt,ce,Rt,Bt,Wt,j,b,I,F,k,G,rt;function tt(){_t=new r9(Z),Nt=new jX(Z,_t,t),_t.init(Nt),k=new D7(Z,_t,Nt),wt=new N7(Z,_t,Nt),Ht=new s9(Z),Xt=new E7,Pt=new O7(Z,_t,wt,Xt,Nt,k,Ht),ne=new QX(w),Y=new n9(w),N=new h8(Z,Nt),G=new ZX(Z,_t,N,Nt),xt=new i9(Z,N,Ht,G),St=new c9(Z,xt,N,Ht),b=new l9(Z,Nt,Pt),Bt=new KX(Xt),ot=new x7(w,ne,Y,_t,Nt,G,Bt),Lt=new G7(w,Xt),ce=new w7,Rt=new I7(_t,Nt),j=new $X(w,ne,Y,wt,St,v,p),Wt=new L7(w,St,Nt),rt=new k7(Z,Ht,Nt,wt),I=new JX(Z,_t,Ht,Nt),F=new o9(Z,_t,Ht,Nt),Ht.programs=ot.programs,w.capabilities=Nt,w.extensions=_t,w.properties=Xt,w.renderLists=ce,w.shadowMap=Wt,w.state=wt,w.info=Ht}tt();let pt=new wv(w,Z);this.xr=pt,this.getContext=function(){return Z},this.getContextAttributes=function(){return Z.getContextAttributes()},this.forceContextLoss=function(){let q=_t.get("WEBGL_lose_context");q&&q.loseContext()},this.forceContextRestore=function(){let q=_t.get("WEBGL_lose_context");q&&q.restoreContext()},this.getPixelRatio=function(){return vt},this.setPixelRatio=function(q){q!==void 0&&(vt=q,this.setSize(gt,ft,!1))},this.getSize=function(q){return q.set(gt,ft)},this.setSize=function(q,at,Et=!0){if(pt.isPresenting){console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting.");return}gt=q,ft=at,e.width=Math.floor(q*vt),e.height=Math.floor(at*vt),Et===!0&&(e.style.width=q+"px",e.style.height=at+"px"),this.setViewport(0,0,q,at)},this.getDrawingBufferSize=function(q){return q.set(gt*vt,ft*vt).floor()},this.setDrawingBufferSize=function(q,at,Et){gt=q,ft=at,vt=Et,e.width=Math.floor(q*Et),e.height=Math.floor(at*Et),this.setViewport(0,0,q,at)},this.getCurrentViewport=function(q){return q.copy(L)},this.getViewport=function(q){return q.copy(H)},this.setViewport=function(q,at,Et,dt){q.isVector4?H.set(q.x,q.y,q.z,q.w):H.set(q,at,Et,dt),wt.viewport(L.copy(H).multiplyScalar(vt).round())},this.getScissor=function(q){return q.copy(At)},this.setScissor=function(q,at,Et,dt){q.isVector4?At.set(q.x,q.y,q.z,q.w):At.set(q,at,Et,dt),wt.scissor(W.copy(At).multiplyScalar(vt).round())},this.getScissorTest=function(){return It},this.setScissorTest=function(q){wt.setScissorTest(It=q)},this.setOpaqueSort=function(q){it=q},this.setTransparentSort=function(q){lt=q},this.getClearColor=function(q){return q.copy(j.getClearColor())},this.setClearColor=function(){j.setClearColor.apply(j,arguments)},this.getClearAlpha=function(){return j.getClearAlpha()},this.setClearAlpha=function(){j.setClearAlpha.apply(j,arguments)},this.clear=function(q=!0,at=!0,Et=!0){let dt=0;if(q){let ut=!1;if(D!==null){let Qt=D.texture.format;ut=Qt===KI||Qt===jI||Qt===JI}if(ut){let Qt=D.texture.type,te=Qt===ma||Qt===pa||Qt===$v||Qt===su||Qt===$I||Qt===ZI,le=j.getClearColor(),re=j.getClearAlpha(),ve=le.r,fe=le.g,he=le.b;te?(E[0]=ve,E[1]=fe,E[2]=he,E[3]=re,Z.clearBufferuiv(Z.COLOR,0,E)):(M[0]=ve,M[1]=fe,M[2]=he,M[3]=re,Z.clearBufferiv(Z.COLOR,0,M))}else dt|=Z.COLOR_BUFFER_BIT}at&&(dt|=Z.DEPTH_BUFFER_BIT),Et&&(dt|=Z.STENCIL_BUFFER_BIT,this.state.buffers.stencil.setMask(4294967295)),Z.clear(dt)},this.clearColor=function(){this.clear(!0,!1,!1)},this.clearDepth=function(){this.clear(!1,!0,!1)},this.clearStencil=function(){this.clear(!1,!1,!0)},this.dispose=function(){e.removeEventListener("webglcontextlost",ht,!1),e.removeEventListener("webglcontextrestored",O,!1),e.removeEventListener("webglcontextcreationerror",Q,!1),ce.dispose(),Rt.dispose(),Xt.dispose(),ne.dispose(),Y.dispose(),St.dispose(),G.dispose(),rt.dispose(),ot.dispose(),Wt.dispose(),pt.dispose(),pt.removeEventListener("sessionstart",we),pt.removeEventListener("sessionend",ye),Vt&&(Vt.dispose(),Vt=null),be.stop()};function ht(q){q.preventDefault(),console.log("THREE.WebGLRenderer: Context Lost."),R=!0}function O(){console.log("THREE.WebGLRenderer: Context Restored."),R=!1;let q=Ht.autoReset,at=Wt.enabled,Et=Wt.autoUpdate,dt=Wt.needsUpdate,ut=Wt.type;tt(),Ht.autoReset=q,Wt.enabled=at,Wt.autoUpdate=Et,Wt.needsUpdate=dt,Wt.type=ut}function Q(q){console.error("THREE.WebGLRenderer: A WebGL context could not be created. Reason: ",q.statusMessage)}function J(q){let at=q.target;at.removeEventListener("dispose",J),et(at)}function et(q){Tt(q),Xt.remove(q)}function Tt(q){let at=Xt.get(q).programs;at!==void 0&&(at.forEach(function(Et){ot.releaseProgram(Et)}),q.isShaderMaterial&&ot.releaseShaderCache(q))}this.renderBufferDirect=function(q,at,Et,dt,ut,Qt){at===null&&(at=Ct);let te=ut.isMesh&&ut.matrixWorld.determinant()<0,le=En(q,at,Et,dt,ut);wt.setMaterial(dt,te);let re=Et.index,ve=1;if(dt.wireframe===!0){if(re=xt.getWireframeAttribute(Et),re===void 0)return;ve=2}let fe=Et.drawRange,he=Et.attributes.position,cn=fe.start*ve,Tr=(fe.start+fe.count)*ve;Qt!==null&&(cn=Math.max(cn,Qt.start*ve),Tr=Math.min(Tr,(Qt.start+Qt.count)*ve)),re!==null?(cn=Math.max(cn,0),Tr=Math.min(Tr,re.count)):he!=null&&(cn=Math.max(cn,0),Tr=Math.min(Tr,he.count));let qn=Tr-cn;if(qn<0||qn===1/0)return;G.setup(ut,dt,le,Et,re);let hi,wn=I;if(re!==null&&(hi=N.get(re),wn=F,wn.setIndex(hi)),ut.isMesh)dt.wireframe===!0?(wt.setLineWidth(dt.wireframeLinewidth*ee()),wn.setMode(Z.LINES)):wn.setMode(Z.TRIANGLES);else if(ut.isLine){let se=dt.linewidth;se===void 0&&(se=1),wt.setLineWidth(se*ee()),ut.isLineSegments?wn.setMode(Z.LINES):ut.isLineLoop?wn.setMode(Z.LINE_LOOP):wn.setMode(Z.LINE_STRIP)}else ut.isPoints?wn.setMode(Z.POINTS):ut.isSprite&&wn.setMode(Z.TRIANGLES);if(ut.isBatchedMesh)wn.renderMultiDraw(ut._multiDrawStarts,ut._multiDrawCounts,ut._multiDrawCount);else if(ut.isInstancedMesh)wn.renderInstances(cn,qn,ut.count);else if(Et.isInstancedBufferGeometry){let se=Et._maxInstanceCount!==void 0?Et._maxInstanceCount:1/0,bu=Math.min(Et.instanceCount,se);wn.renderInstances(cn,qn,bu)}else wn.render(cn,qn)};function kt(q,at,Et){q.transparent===!0&&q.side===Ns&&q.forceSinglePass===!1?(q.side=Oi,q.needsUpdate=!0,xn(q,at,Et),q.side=va,q.needsUpdate=!0,xn(q,at,Et),q.side=Ns):xn(q,at,Et)}this.compile=function(q,at,Et=null){Et===null&&(Et=q),_=Rt.get(Et),_.init(),T.push(_),Et.traverseVisible(function(ut){ut.isLight&&ut.layers.test(at.layers)&&(_.pushLight(ut),ut.castShadow&&_.pushShadow(ut))}),q!==Et&&q.traverseVisible(function(ut){ut.isLight&&ut.layers.test(at.layers)&&(_.pushLight(ut),ut.castShadow&&_.pushShadow(ut))}),_.setupLights(w._useLegacyLights);let dt=new Set;return q.traverse(function(ut){let Qt=ut.material;if(Qt)if(Array.isArray(Qt))for(let te=0;te<Qt.length;te++){let le=Qt[te];kt(le,Et,ut),dt.add(le)}else kt(Qt,Et,ut),dt.add(Qt)}),T.pop(),_=null,dt},this.compileAsync=function(q,at,Et=null){let dt=this.compile(q,at,Et);return new Promise(ut=>{function Qt(){if(dt.forEach(function(te){Xt.get(te).currentProgram.isReady()&&dt.delete(te)}),dt.size===0){ut(q);return}setTimeout(Qt,10)}_t.get("KHR_parallel_shader_compile")!==null?Qt():setTimeout(Qt,10)})};let ie=null;function oe(q){ie&&ie(q)}function we(){be.stop()}function ye(){be.start()}let be=new oP;be.setAnimationLoop(oe),typeof self!="undefined"&&be.setContext(self),this.setAnimationLoop=function(q){ie=q,pt.setAnimationLoop(q),q===null?be.stop():be.start()},pt.addEventListener("sessionstart",we),pt.addEventListener("sessionend",ye),this.render=function(q,at){if(at!==void 0&&at.isCamera!==!0){console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");return}if(R===!0)return;q.matrixWorldAutoUpdate===!0&&q.updateMatrixWorld(),at.parent===null&&at.matrixWorldAutoUpdate===!0&&at.updateMatrixWorld(),pt.enabled===!0&&pt.isPresenting===!0&&(pt.cameraAutoUpdate===!0&&pt.updateCamera(at),at=pt.getCamera()),q.isScene===!0&&q.onBeforeRender(w,q,at,D),_=Rt.get(q,T.length),_.init(),T.push(_),$t.multiplyMatrices(at.projectionMatrix,at.matrixWorldInverse),Kt.setFromProjectionMatrix($t),bt=this.localClippingEnabled,nt=Bt.init(this.clippingPlanes,bt),A=ce.get(q,x.length),A.init(),x.push(A),Ae(q,at,0,w.sortObjects),A.finish(),w.sortObjects===!0&&A.sort(it,lt),this.info.render.frame++,nt===!0&&Bt.beginShadows();let Et=_.state.shadowsArray;if(Wt.render(Et,q,at),nt===!0&&Bt.endShadows(),this.info.autoReset===!0&&this.info.reset(),(pt.enabled===!1||pt.isPresenting===!1||pt.hasDepthSensing()===!1)&&j.render(A,q),_.setupLights(w._useLegacyLights),at.isArrayCamera){let dt=at.cameras;for(let ut=0,Qt=dt.length;ut<Qt;ut++){let te=dt[ut];Bn(A,q,te,te.viewport)}}else Bn(A,q,at);D!==null&&(Pt.updateMultisampleRenderTarget(D),Pt.updateRenderTargetMipmap(D)),q.isScene===!0&&q.onAfterRender(w,q,at),G.resetDefaultState(),P=-1,ct=null,T.pop(),T.length>0?_=T[T.length-1]:_=null,x.pop(),x.length>0?A=x[x.length-1]:A=null};function Ae(q,at,Et,dt){if(q.visible===!1)return;if(q.layers.test(at.layers)){if(q.isGroup)Et=q.renderOrder;else if(q.isLOD)q.autoUpdate===!0&&q.update(at);else if(q.isLight)_.pushLight(q),q.castShadow&&_.pushShadow(q);else if(q.isSprite){if(!q.frustumCulled||Kt.intersectsSprite(q)){dt&&Gt.setFromMatrixPosition(q.matrixWorld).applyMatrix4($t);let te=St.update(q),le=q.material;le.visible&&A.push(q,te,le,Et,Gt.z,null)}}else if((q.isMesh||q.isLine||q.isPoints)&&(!q.frustumCulled||Kt.intersectsObject(q))){let te=St.update(q),le=q.material;if(dt&&(q.boundingSphere!==void 0?(q.boundingSphere===null&&q.computeBoundingSphere(),Gt.copy(q.boundingSphere.center)):(te.boundingSphere===null&&te.computeBoundingSphere(),Gt.copy(te.boundingSphere.center)),Gt.applyMatrix4(q.matrixWorld).applyMatrix4($t)),Array.isArray(le)){let re=te.groups;for(let ve=0,fe=re.length;ve<fe;ve++){let he=re[ve],cn=le[he.materialIndex];cn&&cn.visible&&A.push(q,te,cn,Et,Gt.z,he)}}else le.visible&&A.push(q,te,le,Et,Gt.z,null)}}let Qt=q.children;for(let te=0,le=Qt.length;te<le;te++)Ae(Qt[te],at,Et,dt)}function Bn(q,at,Et,dt){let ut=q.opaque,Qt=q.transmissive,te=q.transparent;_.setupLightsView(Et),nt===!0&&Bt.setGlobalState(w.clippingPlanes,Et),Qt.length>0&&dr(ut,Qt,at,Et),dt&&wt.viewport(L.copy(dt)),ut.length>0&&_n(ut,at,Et),Qt.length>0&&_n(Qt,at,Et),te.length>0&&_n(te,at,Et),wt.buffers.depth.setTest(!0),wt.buffers.depth.setMask(!0),wt.buffers.color.setMask(!0),wt.setPolygonOffset(!1)}function dr(q,at,Et,dt){if((Et.isScene===!0?Et.overrideMaterial:null)!==null)return;let Qt=Nt.isWebGL2;Vt===null&&(Vt=new Us(1,1,{generateMipmaps:!0,type:_t.has("EXT_color_buffer_half_float")?cf:ma,minFilter:ru,samples:Qt?4:0})),w.getDrawingBufferSize(Ut),Qt?Vt.setSize(Ut.x,Ut.y):Vt.setSize(sv(Ut.x),sv(Ut.y));let te=w.getRenderTarget();w.setRenderTarget(Vt),w.getClearColor(Mt),$=w.getClearAlpha(),$<1&&w.setClearColor(16777215,.5),w.clear();let le=w.toneMapping;w.toneMapping=ga,_n(q,Et,dt),Pt.updateMultisampleRenderTarget(Vt),Pt.updateRenderTargetMipmap(Vt);let re=!1;for(let ve=0,fe=at.length;ve<fe;ve++){let he=at[ve],cn=he.object,Tr=he.geometry,qn=he.material,hi=he.group;if(qn.side===Ns&&cn.layers.test(dt.layers)){let wn=qn.side;qn.side=Oi,qn.needsUpdate=!0,pe(cn,Et,dt,Tr,qn,hi),qn.side=wn,qn.needsUpdate=!0,re=!0}}re===!0&&(Pt.updateMultisampleRenderTarget(Vt),Pt.updateRenderTargetMipmap(Vt)),w.setRenderTarget(te),w.setClearColor(Mt,$),w.toneMapping=le}function _n(q,at,Et){let dt=at.isScene===!0?at.overrideMaterial:null;for(let ut=0,Qt=q.length;ut<Qt;ut++){let te=q[ut],le=te.object,re=te.geometry,ve=dt===null?te.material:dt,fe=te.group;le.layers.test(Et.layers)&&pe(le,at,Et,re,ve,fe)}}function pe(q,at,Et,dt,ut,Qt){q.onBeforeRender(w,at,Et,dt,ut,Qt),q.modelViewMatrix.multiplyMatrices(Et.matrixWorldInverse,q.matrixWorld),q.normalMatrix.getNormalMatrix(q.modelViewMatrix),ut.onBeforeRender(w,at,Et,dt,q,Qt),ut.transparent===!0&&ut.side===Ns&&ut.forceSinglePass===!1?(ut.side=Oi,ut.needsUpdate=!0,w.renderBufferDirect(Et,at,dt,ut,q,Qt),ut.side=va,ut.needsUpdate=!0,w.renderBufferDirect(Et,at,dt,ut,q,Qt),ut.side=Ns):w.renderBufferDirect(Et,at,dt,ut,q,Qt),q.onAfterRender(w,at,Et,dt,ut,Qt)}function xn(q,at,Et){at.isScene!==!0&&(at=Ct);let dt=Xt.get(q),ut=_.state.lights,Qt=_.state.shadowsArray,te=ut.state.version,le=ot.getParameters(q,ut.state,Qt,at,Et),re=ot.getProgramCacheKey(le),ve=dt.programs;dt.environment=q.isMeshStandardMaterial?at.environment:null,dt.fog=at.fog,dt.envMap=(q.isMeshStandardMaterial?Y:ne).get(q.envMap||dt.environment),dt.envMapRotation=dt.environment!==null&&q.envMap===null?at.environmentRotation:q.envMapRotation,ve===void 0&&(q.addEventListener("dispose",J),ve=new Map,dt.programs=ve);let fe=ve.get(re);if(fe!==void 0){if(dt.currentProgram===fe&&dt.lightsStateVersion===te)return Cn(q,le),fe}else le.uniforms=ot.getUniforms(q),q.onBuild(Et,le,w),q.onBeforeCompile(le,w),fe=ot.acquireProgram(le,re),ve.set(re,fe),dt.uniforms=le.uniforms;let he=dt.uniforms;return(!q.isShaderMaterial&&!q.isRawShaderMaterial||q.clipping===!0)&&(he.clippingPlanes=Bt.uniform),Cn(q,le),dt.needsLights=Ar(q),dt.lightsStateVersion=te,dt.needsLights&&(he.ambientLightColor.value=ut.state.ambient,he.lightProbe.value=ut.state.probe,he.directionalLights.value=ut.state.directional,he.directionalLightShadows.value=ut.state.directionalShadow,he.spotLights.value=ut.state.spot,he.spotLightShadows.value=ut.state.spotShadow,he.rectAreaLights.value=ut.state.rectArea,he.ltc_1.value=ut.state.rectAreaLTC1,he.ltc_2.value=ut.state.rectAreaLTC2,he.pointLights.value=ut.state.point,he.pointLightShadows.value=ut.state.pointShadow,he.hemisphereLights.value=ut.state.hemi,he.directionalShadowMap.value=ut.state.directionalShadowMap,he.directionalShadowMatrix.value=ut.state.directionalShadowMatrix,he.spotShadowMap.value=ut.state.spotShadowMap,he.spotLightMatrix.value=ut.state.spotLightMatrix,he.spotLightMap.value=ut.state.spotLightMap,he.pointShadowMap.value=ut.state.pointShadowMap,he.pointShadowMatrix.value=ut.state.pointShadowMatrix),dt.currentProgram=fe,dt.uniformsList=null,fe}function Nn(q){if(q.uniformsList===null){let at=q.currentProgram.getUniforms();q.uniformsList=Tl.seqWithValue(at.seq,q.uniforms)}return q.uniformsList}function Cn(q,at){let Et=Xt.get(q);Et.outputColorSpace=at.outputColorSpace,Et.batching=at.batching,Et.instancing=at.instancing,Et.instancingColor=at.instancingColor,Et.instancingMorph=at.instancingMorph,Et.skinning=at.skinning,Et.morphTargets=at.morphTargets,Et.morphNormals=at.morphNormals,Et.morphColors=at.morphColors,Et.morphTargetsCount=at.morphTargetsCount,Et.numClippingPlanes=at.numClippingPlanes,Et.numIntersection=at.numClipIntersection,Et.vertexAlphas=at.vertexAlphas,Et.vertexTangents=at.vertexTangents,Et.toneMapping=at.toneMapping}function En(q,at,Et,dt,ut){at.isScene!==!0&&(at=Ct),Pt.resetTextureUnits();let Qt=at.fog,te=dt.isMeshStandardMaterial?at.environment:null,le=D===null?w.outputColorSpace:D.isXRRenderTarget===!0?D.texture.colorSpace:xa,re=(dt.isMeshStandardMaterial?Y:ne).get(dt.envMap||te),ve=dt.vertexColors===!0&&!!Et.attributes.color&&Et.attributes.color.itemSize===4,fe=!!Et.attributes.tangent&&(!!dt.normalMap||dt.anisotropy>0),he=!!Et.morphAttributes.position,cn=!!Et.morphAttributes.normal,Tr=!!Et.morphAttributes.color,qn=ga;dt.toneMapped&&(D===null||D.isXRRenderTarget===!0)&&(qn=w.toneMapping);let hi=Et.morphAttributes.position||Et.morphAttributes.normal||Et.morphAttributes.color,wn=hi!==void 0?hi.length:0,se=Xt.get(dt),bu=_.state.lights;if(nt===!0&&(bt===!0||q!==ct)){let pi=q===ct&&dt.id===P;Bt.setState(dt,q,pi)}let fn=!1;dt.version===se.__version?(se.needsLights&&se.lightsStateVersion!==bu.state.version||se.outputColorSpace!==le||ut.isBatchedMesh&&se.batching===!1||!ut.isBatchedMesh&&se.batching===!0||ut.isInstancedMesh&&se.instancing===!1||!ut.isInstancedMesh&&se.instancing===!0||ut.isSkinnedMesh&&se.skinning===!1||!ut.isSkinnedMesh&&se.skinning===!0||ut.isInstancedMesh&&se.instancingColor===!0&&ut.instanceColor===null||ut.isInstancedMesh&&se.instancingColor===!1&&ut.instanceColor!==null||ut.isInstancedMesh&&se.instancingMorph===!0&&ut.morphTexture===null||ut.isInstancedMesh&&se.instancingMorph===!1&&ut.morphTexture!==null||se.envMap!==re||dt.fog===!0&&se.fog!==Qt||se.numClippingPlanes!==void 0&&(se.numClippingPlanes!==Bt.numPlanes||se.numIntersection!==Bt.numIntersection)||se.vertexAlphas!==ve||se.vertexTangents!==fe||se.morphTargets!==he||se.morphNormals!==cn||se.morphColors!==Tr||se.toneMapping!==qn||Nt.isWebGL2===!0&&se.morphTargetsCount!==wn)&&(fn=!0):(fn=!0,se.__version=dt.version);let fo=se.currentProgram;fn===!0&&(fo=xn(dt,at,ut));let fc=!1,_e=!1,Pa=!1,Mn=fo.getUniforms(),ho=se.uniforms;if(wt.useProgram(fo.program)&&(fc=!0,_e=!0,Pa=!0),dt.id!==P&&(P=dt.id,_e=!0),fc||ct!==q){Mn.setValue(Z,"projectionMatrix",q.projectionMatrix),Mn.setValue(Z,"viewMatrix",q.matrixWorldInverse);let pi=Mn.map.cameraPosition;pi!==void 0&&pi.setValue(Z,Gt.setFromMatrixPosition(q.matrixWorld)),Nt.logarithmicDepthBuffer&&Mn.setValue(Z,"logDepthBufFC",2/(Math.log(q.far+1)/Math.LN2)),(dt.isMeshPhongMaterial||dt.isMeshToonMaterial||dt.isMeshLambertMaterial||dt.isMeshBasicMaterial||dt.isMeshStandardMaterial||dt.isShaderMaterial)&&Mn.setValue(Z,"isOrthographic",q.isOrthographicCamera===!0),ct!==q&&(ct=q,_e=!0,Pa=!0)}if(ut.isSkinnedMesh){Mn.setOptional(Z,ut,"bindMatrix"),Mn.setOptional(Z,ut,"bindMatrixInverse");let pi=ut.skeleton;pi&&(Nt.floatVertexTextures?(pi.boneTexture===null&&pi.computeBoneTexture(),Mn.setValue(Z,"boneTexture",pi.boneTexture,Pt)):console.warn("THREE.WebGLRenderer: SkinnedMesh can only be used with WebGL 2. With WebGL 1 OES_texture_float and vertex textures support is required."))}ut.isBatchedMesh&&(Mn.setOptional(Z,ut,"batchingTexture"),Mn.setValue(Z,"batchingTexture",ut._matricesTexture,Pt));let me=Et.morphAttributes;if((me.position!==void 0||me.normal!==void 0||me.color!==void 0&&Nt.isWebGL2===!0)&&b.update(ut,Et,fo),(_e||se.receiveShadow!==ut.receiveShadow)&&(se.receiveShadow=ut.receiveShadow,Mn.setValue(Z,"receiveShadow",ut.receiveShadow)),dt.isMeshGouraudMaterial&&dt.envMap!==null&&(ho.envMap.value=re,ho.flipEnvMap.value=re.isCubeTexture&&re.isRenderTargetTexture===!1?-1:1),_e&&(Mn.setValue(Z,"toneMappingExposure",w.toneMappingExposure),se.needsLights&&Kr(ho,Pa),Qt&&dt.fog===!0&&Lt.refreshFogUniforms(ho,Qt),Lt.refreshMaterialUniforms(ho,dt,vt,ft,Vt),Tl.upload(Z,Nn(se),ho,Pt)),dt.isShaderMaterial&&dt.uniformsNeedUpdate===!0&&(Tl.upload(Z,Nn(se),ho,Pt),dt.uniformsNeedUpdate=!1),dt.isSpriteMaterial&&Mn.setValue(Z,"center",ut.center),Mn.setValue(Z,"modelViewMatrix",ut.modelViewMatrix),Mn.setValue(Z,"normalMatrix",ut.normalMatrix),Mn.setValue(Z,"modelMatrix",ut.matrixWorld),dt.isShaderMaterial||dt.isRawShaderMaterial){let pi=dt.uniformsGroups;for(let hc=0,Au=pi.length;hc<Au;hc++)if(Nt.isWebGL2){let di=pi[hc];rt.update(di,fo),rt.bind(di,fo)}else console.warn("THREE.WebGLRenderer: Uniform Buffer Objects can only be used with WebGL 2.")}return fo}function Kr(q,at){q.ambientLightColor.needsUpdate=at,q.lightProbe.needsUpdate=at,q.directionalLights.needsUpdate=at,q.directionalLightShadows.needsUpdate=at,q.pointLights.needsUpdate=at,q.pointLightShadows.needsUpdate=at,q.spotLights.needsUpdate=at,q.spotLightShadows.needsUpdate=at,q.rectAreaLights.needsUpdate=at,q.hemisphereLights.needsUpdate=at}function Ar(q){return q.isMeshLambertMaterial||q.isMeshToonMaterial||q.isMeshPhongMaterial||q.isMeshStandardMaterial||q.isShadowMaterial||q.isShaderMaterial&&q.lights===!0}this.getActiveCubeFace=function(){return z},this.getActiveMipmapLevel=function(){return U},this.getRenderTarget=function(){return D},this.setRenderTargetTextures=function(q,at,Et){Xt.get(q.texture).__webglTexture=at,Xt.get(q.depthTexture).__webglTexture=Et;let dt=Xt.get(q);dt.__hasExternalTextures=!0,dt.__autoAllocateDepthBuffer=Et===void 0,dt.__autoAllocateDepthBuffer||_t.has("WEBGL_multisampled_render_to_texture")===!0&&(console.warn("THREE.WebGLRenderer: Render-to-texture extension was disabled because an external texture was provided"),dt.__useRenderToTexture=!1)},this.setRenderTargetFramebuffer=function(q,at){let Et=Xt.get(q);Et.__webglFramebuffer=at,Et.__useDefaultFramebuffer=at===void 0},this.setRenderTarget=function(q,at=0,Et=0){D=q,z=at,U=Et;let dt=!0,ut=null,Qt=!1,te=!1;if(q){let re=Xt.get(q);re.__useDefaultFramebuffer!==void 0?(wt.bindFramebuffer(Z.FRAMEBUFFER,null),dt=!1):re.__webglFramebuffer===void 0?Pt.setupRenderTarget(q):re.__hasExternalTextures&&Pt.rebindTextures(q,Xt.get(q.texture).__webglTexture,Xt.get(q.depthTexture).__webglTexture);let ve=q.texture;(ve.isData3DTexture||ve.isDataArrayTexture||ve.isCompressedArrayTexture)&&(te=!0);let fe=Xt.get(q).__webglFramebuffer;q.isWebGLCubeRenderTarget?(Array.isArray(fe[at])?ut=fe[at][Et]:ut=fe[at],Qt=!0):Nt.isWebGL2&&q.samples>0&&Pt.useMultisampledRTT(q)===!1?ut=Xt.get(q).__webglMultisampledFramebuffer:Array.isArray(fe)?ut=fe[Et]:ut=fe,L.copy(q.viewport),W.copy(q.scissor),V=q.scissorTest}else L.copy(H).multiplyScalar(vt).floor(),W.copy(At).multiplyScalar(vt).floor(),V=It;if(wt.bindFramebuffer(Z.FRAMEBUFFER,ut)&&Nt.drawBuffers&&dt&&wt.drawBuffers(q,ut),wt.viewport(L),wt.scissor(W),wt.setScissorTest(V),Qt){let re=Xt.get(q.texture);Z.framebufferTexture2D(Z.FRAMEBUFFER,Z.COLOR_ATTACHMENT0,Z.TEXTURE_CUBE_MAP_POSITIVE_X+at,re.__webglTexture,Et)}else if(te){let re=Xt.get(q.texture),ve=at||0;Z.framebufferTextureLayer(Z.FRAMEBUFFER,Z.COLOR_ATTACHMENT0,re.__webglTexture,Et||0,ve)}P=-1},this.readRenderTargetPixels=function(q,at,Et,dt,ut,Qt,te){if(!(q&&q.isWebGLRenderTarget)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}let le=Xt.get(q).__webglFramebuffer;if(q.isWebGLCubeRenderTarget&&te!==void 0&&(le=le[te]),le){wt.bindFramebuffer(Z.FRAMEBUFFER,le);try{let re=q.texture,ve=re.format,fe=re.type;if(ve!==Lo&&k.convert(ve)!==Z.getParameter(Z.IMPLEMENTATION_COLOR_READ_FORMAT)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}let he=fe===cf&&(_t.has("EXT_color_buffer_half_float")||Nt.isWebGL2&&_t.has("EXT_color_buffer_float"));if(fe!==ma&&k.convert(fe)!==Z.getParameter(Z.IMPLEMENTATION_COLOR_READ_TYPE)&&!(fe===Os&&(Nt.isWebGL2||_t.has("OES_texture_float")||_t.has("WEBGL_color_buffer_float")))&&!he){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}at>=0&&at<=q.width-dt&&Et>=0&&Et<=q.height-ut&&Z.readPixels(at,Et,dt,ut,k.convert(ve),k.convert(fe),Qt)}finally{let re=D!==null?Xt.get(D).__webglFramebuffer:null;wt.bindFramebuffer(Z.FRAMEBUFFER,re)}}},this.copyFramebufferToTexture=function(q,at,Et=0){let dt=Math.pow(2,-Et),ut=Math.floor(at.image.width*dt),Qt=Math.floor(at.image.height*dt);Pt.setTexture2D(at,0),Z.copyTexSubImage2D(Z.TEXTURE_2D,Et,0,0,q.x,q.y,ut,Qt),wt.unbindTexture()},this.copyTextureToTexture=function(q,at,Et,dt=0){let ut=at.image.width,Qt=at.image.height,te=k.convert(Et.format),le=k.convert(Et.type);Pt.setTexture2D(Et,0),Z.pixelStorei(Z.UNPACK_FLIP_Y_WEBGL,Et.flipY),Z.pixelStorei(Z.UNPACK_PREMULTIPLY_ALPHA_WEBGL,Et.premultiplyAlpha),Z.pixelStorei(Z.UNPACK_ALIGNMENT,Et.unpackAlignment),at.isDataTexture?Z.texSubImage2D(Z.TEXTURE_2D,dt,q.x,q.y,ut,Qt,te,le,at.image.data):at.isCompressedTexture?Z.compressedTexSubImage2D(Z.TEXTURE_2D,dt,q.x,q.y,at.mipmaps[0].width,at.mipmaps[0].height,te,at.mipmaps[0].data):Z.texSubImage2D(Z.TEXTURE_2D,dt,q.x,q.y,te,le,at.image),dt===0&&Et.generateMipmaps&&Z.generateMipmap(Z.TEXTURE_2D),wt.unbindTexture()},this.copyTextureToTexture3D=function(q,at,Et,dt,ut=0){if(w.isWebGL1Renderer){console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: can only be used with WebGL2.");return}let Qt=Math.round(q.max.x-q.min.x),te=Math.round(q.max.y-q.min.y),le=q.max.z-q.min.z+1,re=k.convert(dt.format),ve=k.convert(dt.type),fe;if(dt.isData3DTexture)Pt.setTexture3D(dt,0),fe=Z.TEXTURE_3D;else if(dt.isDataArrayTexture||dt.isCompressedArrayTexture)Pt.setTexture2DArray(dt,0),fe=Z.TEXTURE_2D_ARRAY;else{console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.");return}Z.pixelStorei(Z.UNPACK_FLIP_Y_WEBGL,dt.flipY),Z.pixelStorei(Z.UNPACK_PREMULTIPLY_ALPHA_WEBGL,dt.premultiplyAlpha),Z.pixelStorei(Z.UNPACK_ALIGNMENT,dt.unpackAlignment);let he=Z.getParameter(Z.UNPACK_ROW_LENGTH),cn=Z.getParameter(Z.UNPACK_IMAGE_HEIGHT),Tr=Z.getParameter(Z.UNPACK_SKIP_PIXELS),qn=Z.getParameter(Z.UNPACK_SKIP_ROWS),hi=Z.getParameter(Z.UNPACK_SKIP_IMAGES),wn=Et.isCompressedTexture?Et.mipmaps[ut]:Et.image;Z.pixelStorei(Z.UNPACK_ROW_LENGTH,wn.width),Z.pixelStorei(Z.UNPACK_IMAGE_HEIGHT,wn.height),Z.pixelStorei(Z.UNPACK_SKIP_PIXELS,q.min.x),Z.pixelStorei(Z.UNPACK_SKIP_ROWS,q.min.y),Z.pixelStorei(Z.UNPACK_SKIP_IMAGES,q.min.z),Et.isDataTexture||Et.isData3DTexture?Z.texSubImage3D(fe,ut,at.x,at.y,at.z,Qt,te,le,re,ve,wn.data):dt.isCompressedArrayTexture?Z.compressedTexSubImage3D(fe,ut,at.x,at.y,at.z,Qt,te,le,re,wn.data):Z.texSubImage3D(fe,ut,at.x,at.y,at.z,Qt,te,le,re,ve,wn),Z.pixelStorei(Z.UNPACK_ROW_LENGTH,he),Z.pixelStorei(Z.UNPACK_IMAGE_HEIGHT,cn),Z.pixelStorei(Z.UNPACK_SKIP_PIXELS,Tr),Z.pixelStorei(Z.UNPACK_SKIP_ROWS,qn),Z.pixelStorei(Z.UNPACK_SKIP_IMAGES,hi),ut===0&&dt.generateMipmaps&&Z.generateMipmap(fe),wt.unbindTexture()},this.initTexture=function(q){q.isCubeTexture?Pt.setTextureCube(q,0):q.isData3DTexture?Pt.setTexture3D(q,0):q.isDataArrayTexture||q.isCompressedArrayTexture?Pt.setTexture2DArray(q,0):Pt.setTexture2D(q,0),wt.unbindTexture()},this.resetState=function(){z=0,U=0,D=null,wt.reset(),G.reset()},typeof __THREE_DEVTOOLS__!="undefined"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}get coordinateSystem(){return Ds}get outputColorSpace(){return this._outputColorSpace}set outputColorSpace(t){this._outputColorSpace=t;let e=this.getContext();e.drawingBufferColorSpace=t===Zv?"display-p3":"srgb",e.unpackColorSpace=Rn.workingColorSpace===ld?"display-p3":"srgb"}get useLegacyLights(){return console.warn("THREE.WebGLRenderer: The property .useLegacyLights has been deprecated. Migrate your lighting according to the following guide: https://discourse.threejs.org/t/updates-to-lighting-in-three-js-r155/53733."),this._useLegacyLights}set useLegacyLights(t){console.warn("THREE.WebGLRenderer: The property .useLegacyLights has been deprecated. Migrate your lighting according to the following guide: https://discourse.threejs.org/t/updates-to-lighting-in-three-js-r155/53733."),this._useLegacyLights=t}},bv=class extends Mv{};bv.prototype.isWebGL1Renderer=!0;var hf=class{constructor(t,e){this.isInterleavedBuffer=!0,this.array=t,this.stride=e,this.count=t!==void 0?t.length/e:0,this.usage=rv,this._updateRange={offset:0,count:-1},this.updateRanges=[],this.version=0,this.uuid=Fs()}onUploadCallback(){}set needsUpdate(t){t===!0&&this.version++}get updateRange(){return nP("THREE.InterleavedBuffer: updateRange() is deprecated and will be removed in r169. Use addUpdateRange() instead."),this._updateRange}setUsage(t){return this.usage=t,this}addUpdateRange(t,e){this.updateRanges.push({start:t,count:e})}clearUpdateRanges(){this.updateRanges.length=0}copy(t){return this.array=new t.array.constructor(t.array),this.count=t.count,this.stride=t.stride,this.usage=t.usage,this}copyAt(t,e,i){t*=this.stride,i*=e.stride;for(let s=0,u=this.stride;s<u;s++)this.array[t+s]=e.array[i+s];return this}set(t,e=0){return this.array.set(t,e),this}clone(t){t.arrayBuffers===void 0&&(t.arrayBuffers={}),this.array.buffer._uuid===void 0&&(this.array.buffer._uuid=Fs()),t.arrayBuffers[this.array.buffer._uuid]===void 0&&(t.arrayBuffers[this.array.buffer._uuid]=this.array.slice(0).buffer);let e=new this.array.constructor(t.arrayBuffers[this.array.buffer._uuid]),i=new this.constructor(e,this.stride);return i.setUsage(this.usage),i}onUpload(t){return this.onUploadCallback=t,this}toJSON(t){return t.arrayBuffers===void 0&&(t.arrayBuffers={}),this.array.buffer._uuid===void 0&&(this.array.buffer._uuid=Fs()),t.arrayBuffers[this.array.buffer._uuid]===void 0&&(t.arrayBuffers[this.array.buffer._uuid]=Array.from(new Uint32Array(this.array.buffer))),{uuid:this.uuid,buffer:this.array.buffer._uuid,type:this.array.constructor.name,stride:this.stride}}},wi=new st,ts=class n{constructor(t,e,i,s=!1){this.isInterleavedBufferAttribute=!0,this.name="",this.data=t,this.itemSize=e,this.offset=i,this.normalized=s}get count(){return this.data.count}get array(){return this.data.array}set needsUpdate(t){this.data.needsUpdate=t}applyMatrix4(t){for(let e=0,i=this.data.count;e<i;e++)wi.fromBufferAttribute(this,e),wi.applyMatrix4(t),this.setXYZ(e,wi.x,wi.y,wi.z);return this}applyNormalMatrix(t){for(let e=0,i=this.count;e<i;e++)wi.fromBufferAttribute(this,e),wi.applyNormalMatrix(t),this.setXYZ(e,wi.x,wi.y,wi.z);return this}transformDirection(t){for(let e=0,i=this.count;e<i;e++)wi.fromBufferAttribute(this,e),wi.transformDirection(t),this.setXYZ(e,wi.x,wi.y,wi.z);return this}getComponent(t,e){let i=this.array[t*this.data.stride+this.offset+e];return this.normalized&&(i=jo(i,this.array)),i}setComponent(t,e,i){return this.normalized&&(i=Pn(i,this.array)),this.data.array[t*this.data.stride+this.offset+e]=i,this}setX(t,e){return this.normalized&&(e=Pn(e,this.array)),this.data.array[t*this.data.stride+this.offset]=e,this}setY(t,e){return this.normalized&&(e=Pn(e,this.array)),this.data.array[t*this.data.stride+this.offset+1]=e,this}setZ(t,e){return this.normalized&&(e=Pn(e,this.array)),this.data.array[t*this.data.stride+this.offset+2]=e,this}setW(t,e){return this.normalized&&(e=Pn(e,this.array)),this.data.array[t*this.data.stride+this.offset+3]=e,this}getX(t){let e=this.data.array[t*this.data.stride+this.offset];return this.normalized&&(e=jo(e,this.array)),e}getY(t){let e=this.data.array[t*this.data.stride+this.offset+1];return this.normalized&&(e=jo(e,this.array)),e}getZ(t){let e=this.data.array[t*this.data.stride+this.offset+2];return this.normalized&&(e=jo(e,this.array)),e}getW(t){let e=this.data.array[t*this.data.stride+this.offset+3];return this.normalized&&(e=jo(e,this.array)),e}setXY(t,e,i){return t=t*this.data.stride+this.offset,this.normalized&&(e=Pn(e,this.array),i=Pn(i,this.array)),this.data.array[t+0]=e,this.data.array[t+1]=i,this}setXYZ(t,e,i,s){return t=t*this.data.stride+this.offset,this.normalized&&(e=Pn(e,this.array),i=Pn(i,this.array),s=Pn(s,this.array)),this.data.array[t+0]=e,this.data.array[t+1]=i,this.data.array[t+2]=s,this}setXYZW(t,e,i,s,u){return t=t*this.data.stride+this.offset,this.normalized&&(e=Pn(e,this.array),i=Pn(i,this.array),s=Pn(s,this.array),u=Pn(u,this.array)),this.data.array[t+0]=e,this.data.array[t+1]=i,this.data.array[t+2]=s,this.data.array[t+3]=u,this}clone(t){if(t===void 0){console.log("THREE.InterleavedBufferAttribute.clone(): Cloning an interleaved buffer attribute will de-interleave buffer data.");let e=[];for(let i=0;i<this.count;i++){let s=i*this.data.stride+this.offset;for(let u=0;u<this.itemSize;u++)e.push(this.data.array[s+u])}return new Zn(new this.array.constructor(e),this.itemSize,this.normalized)}else return t.interleavedBuffers===void 0&&(t.interleavedBuffers={}),t.interleavedBuffers[this.data.uuid]===void 0&&(t.interleavedBuffers[this.data.uuid]=this.data.clone(t)),new n(t.interleavedBuffers[this.data.uuid],this.itemSize,this.offset,this.normalized)}toJSON(t){if(t===void 0){console.log("THREE.InterleavedBufferAttribute.toJSON(): Serializing an interleaved buffer attribute will de-interleave buffer data.");let e=[];for(let i=0;i<this.count;i++){let s=i*this.data.stride+this.offset;for(let u=0;u<this.itemSize;u++)e.push(this.data.array[s+u])}return{itemSize:this.itemSize,type:this.array.constructor.name,array:e,normalized:this.normalized}}else return t.interleavedBuffers===void 0&&(t.interleavedBuffers={}),t.interleavedBuffers[this.data.uuid]===void 0&&(t.interleavedBuffers[this.data.uuid]=this.data.toJSON(t)),{isInterleavedBufferAttribute:!0,itemSize:this.itemSize,data:this.data.uuid,offset:this.offset,normalized:this.normalized}}},Av=class extends cu{constructor(t){super(),this.isSpriteMaterial=!0,this.type="SpriteMaterial",this.color=new Te(16777215),this.map=null,this.alphaMap=null,this.rotation=0,this.sizeAttenuation=!0,this.transparent=!0,this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.map=t.map,this.alphaMap=t.alphaMap,this.rotation=t.rotation,this.sizeAttenuation=t.sizeAttenuation,this.fog=t.fog,this}},fa,rf=new st,_l=new st,xl=new st,El=new Ot,of=new Ot,fP=new $n,Ap=new st,sf=new st,Tp=new st,UI=new Ot,Yy=new Ot,BI=new Ot,Tv=class extends Oo{constructor(t=new Av){if(super(),this.isSprite=!0,this.type="Sprite",fa===void 0){fa=new ui;let e=new Float32Array([-.5,-.5,0,0,0,.5,-.5,0,1,0,.5,.5,0,1,1,-.5,.5,0,0,1]),i=new hf(e,5);fa.setIndex([0,1,2,0,2,3]),fa.setAttribute("position",new ts(i,3,0,!1)),fa.setAttribute("uv",new ts(i,2,3,!1))}this.geometry=fa,this.material=t,this.center=new Ot(.5,.5)}raycast(t,e){t.camera===null&&console.error('THREE.Sprite: "Raycaster.camera" needs to be set in order to raycast against sprites.'),_l.setFromMatrixScale(this.matrixWorld),fP.copy(t.camera.matrixWorld),this.modelViewMatrix.multiplyMatrices(t.camera.matrixWorldInverse,this.matrixWorld),xl.setFromMatrixPosition(this.modelViewMatrix),t.camera.isPerspectiveCamera&&this.material.sizeAttenuation===!1&&_l.multiplyScalar(-xl.z);let i=this.material.rotation,s,u;i!==0&&(u=Math.cos(i),s=Math.sin(i));let c=this.center;Cp(Ap.set(-.5,-.5,0),xl,c,_l,s,u),Cp(sf.set(.5,-.5,0),xl,c,_l,s,u),Cp(Tp.set(.5,.5,0),xl,c,_l,s,u),UI.set(0,0),Yy.set(1,0),BI.set(1,1);let f=t.ray.intersectTriangle(Ap,sf,Tp,!1,rf);if(f===null&&(Cp(sf.set(-.5,.5,0),xl,c,_l,s,u),Yy.set(0,1),f=t.ray.intersectTriangle(Ap,Tp,sf,!1,rf),f===null))return;let p=t.ray.origin.distanceTo(rf);p<t.near||p>t.far||e.push({distance:p,point:rf.clone(),uv:iu.getInterpolation(rf,Ap,sf,Tp,UI,Yy,BI,new Ot),face:null,object:this})}copy(t,e){return super.copy(t,e),t.center!==void 0&&this.center.copy(t.center),this.material=t.material,this}};Tv.Dispose=function(){fa.dispose(),fa=void 0};function Cp(n,t,e,i,s,u){El.subVectors(n,e).addScalar(.5).multiply(i),s!==void 0?(of.x=u*El.x-s*El.y,of.y=s*El.x+u*El.y):of.copy(El),n.copy(t),n.x+=of.x,n.y+=of.y,n.applyMatrix4(fP)}var co=class{constructor(){this.type="Curve",this.arcLengthDivisions=200}getPoint(){return console.warn("THREE.Curve: .getPoint() not implemented."),null}getPointAt(t,e){let i=this.getUtoTmapping(t);return this.getPoint(i,e)}getPoints(t=5){let e=[];for(let i=0;i<=t;i++)e.push(this.getPoint(i/t));return e}getSpacedPoints(t=5){let e=[];for(let i=0;i<=t;i++)e.push(this.getPointAt(i/t));return e}getLength(){let t=this.getLengths();return t[t.length-1]}getLengths(t=this.arcLengthDivisions){if(this.cacheArcLengths&&this.cacheArcLengths.length===t+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;let e=[],i,s=this.getPoint(0),u=0;e.push(0);for(let c=1;c<=t;c++)i=this.getPoint(c/t),u+=i.distanceTo(s),e.push(u),s=i;return this.cacheArcLengths=e,e}updateArcLengths(){this.needsUpdate=!0,this.getLengths()}getUtoTmapping(t,e){let i=this.getLengths(),s=0,u=i.length,c;e?c=e:c=t*i[u-1];let f=0,p=u-1,d;for(;f<=p;)if(s=Math.floor(f+(p-f)/2),d=i[s]-c,d<0)f=s+1;else if(d>0)p=s-1;else{p=s;break}if(s=p,i[s]===c)return s/(u-1);let g=i[s],v=i[s+1]-g,E=(c-g)/v;return(s+E)/(u-1)}getTangent(t,e){let s=t-1e-4,u=t+1e-4;s<0&&(s=0),u>1&&(u=1);let c=this.getPoint(s),f=this.getPoint(u),p=e||(c.isVector2?new Ot:new st);return p.copy(f).sub(c).normalize(),p}getTangentAt(t,e){let i=this.getUtoTmapping(t);return this.getTangent(i,e)}computeFrenetFrames(t,e){let i=new st,s=[],u=[],c=[],f=new st,p=new $n;for(let E=0;E<=t;E++){let M=E/t;s[E]=this.getTangentAt(M,new st)}u[0]=new st,c[0]=new st;let d=Number.MAX_VALUE,g=Math.abs(s[0].x),y=Math.abs(s[0].y),v=Math.abs(s[0].z);g<=d&&(d=g,i.set(1,0,0)),y<=d&&(d=y,i.set(0,1,0)),v<=d&&i.set(0,0,1),f.crossVectors(s[0],i).normalize(),u[0].crossVectors(s[0],f),c[0].crossVectors(s[0],u[0]);for(let E=1;E<=t;E++){if(u[E]=u[E-1].clone(),c[E]=c[E-1].clone(),f.crossVectors(s[E-1],s[E]),f.length()>Number.EPSILON){f.normalize();let M=Math.acos(ai(s[E-1].dot(s[E]),-1,1));u[E].applyMatrix4(p.makeRotationAxis(f,M))}c[E].crossVectors(s[E],u[E])}if(e===!0){let E=Math.acos(ai(u[0].dot(u[t]),-1,1));E/=t,s[0].dot(f.crossVectors(u[0],u[t]))>0&&(E=-E);for(let M=1;M<=t;M++)u[M].applyMatrix4(p.makeRotationAxis(s[M],E*M)),c[M].crossVectors(s[M],u[M])}return{tangents:s,normals:u,binormals:c}}clone(){return new this.constructor().copy(this)}copy(t){return this.arcLengthDivisions=t.arcLengthDivisions,this}toJSON(){let t={metadata:{version:4.6,type:"Curve",generator:"Curve.toJSON"}};return t.arcLengthDivisions=this.arcLengthDivisions,t.type=this.type,t}fromJSON(t){return this.arcLengthDivisions=t.arcLengthDivisions,this}},pf=class extends co{constructor(t=0,e=0,i=1,s=1,u=0,c=Math.PI*2,f=!1,p=0){super(),this.isEllipseCurve=!0,this.type="EllipseCurve",this.aX=t,this.aY=e,this.xRadius=i,this.yRadius=s,this.aStartAngle=u,this.aEndAngle=c,this.aClockwise=f,this.aRotation=p}getPoint(t,e=new Ot){let i=e,s=Math.PI*2,u=this.aEndAngle-this.aStartAngle,c=Math.abs(u)<Number.EPSILON;for(;u<0;)u+=s;for(;u>s;)u-=s;u<Number.EPSILON&&(c?u=0:u=s),this.aClockwise===!0&&!c&&(u===s?u=-s:u=u-s);let f=this.aStartAngle+t*u,p=this.aX+this.xRadius*Math.cos(f),d=this.aY+this.yRadius*Math.sin(f);if(this.aRotation!==0){let g=Math.cos(this.aRotation),y=Math.sin(this.aRotation),v=p-this.aX,E=d-this.aY;p=v*g-E*y+this.aX,d=v*y+E*g+this.aY}return i.set(p,d)}copy(t){return super.copy(t),this.aX=t.aX,this.aY=t.aY,this.xRadius=t.xRadius,this.yRadius=t.yRadius,this.aStartAngle=t.aStartAngle,this.aEndAngle=t.aEndAngle,this.aClockwise=t.aClockwise,this.aRotation=t.aRotation,this}toJSON(){let t=super.toJSON();return t.aX=this.aX,t.aY=this.aY,t.xRadius=this.xRadius,t.yRadius=this.yRadius,t.aStartAngle=this.aStartAngle,t.aEndAngle=this.aEndAngle,t.aClockwise=this.aClockwise,t.aRotation=this.aRotation,t}fromJSON(t){return super.fromJSON(t),this.aX=t.aX,this.aY=t.aY,this.xRadius=t.xRadius,this.yRadius=t.yRadius,this.aStartAngle=t.aStartAngle,this.aEndAngle=t.aEndAngle,this.aClockwise=t.aClockwise,this.aRotation=t.aRotation,this}},Cv=class extends pf{constructor(t,e,i,s,u,c){super(t,e,i,i,s,u,c),this.isArcCurve=!0,this.type="ArcCurve"}};function jv(){let n=0,t=0,e=0,i=0;function s(u,c,f,p){n=u,t=f,e=-3*u+3*c-2*f-p,i=2*u-2*c+f+p}return{initCatmullRom:function(u,c,f,p,d){s(c,f,d*(f-u),d*(p-c))},initNonuniformCatmullRom:function(u,c,f,p,d,g,y){let v=(c-u)/d-(f-u)/(d+g)+(f-c)/g,E=(f-c)/g-(p-c)/(g+y)+(p-f)/y;v*=g,E*=g,s(c,f,v,E)},calc:function(u){let c=u*u,f=c*u;return n+t*u+e*c+i*f}}}var Ip=new st,$y=new jv,Zy=new jv,Jy=new jv,Iv=class extends co{constructor(t=[],e=!1,i="centripetal",s=.5){super(),this.isCatmullRomCurve3=!0,this.type="CatmullRomCurve3",this.points=t,this.closed=e,this.curveType=i,this.tension=s}getPoint(t,e=new st){let i=e,s=this.points,u=s.length,c=(u-(this.closed?0:1))*t,f=Math.floor(c),p=c-f;this.closed?f+=f>0?0:(Math.floor(Math.abs(f)/u)+1)*u:p===0&&f===u-1&&(f=u-2,p=1);let d,g;this.closed||f>0?d=s[(f-1)%u]:(Ip.subVectors(s[0],s[1]).add(s[0]),d=Ip);let y=s[f%u],v=s[(f+1)%u];if(this.closed||f+2<u?g=s[(f+2)%u]:(Ip.subVectors(s[u-1],s[u-2]).add(s[u-1]),g=Ip),this.curveType==="centripetal"||this.curveType==="chordal"){let E=this.curveType==="chordal"?.5:.25,M=Math.pow(d.distanceToSquared(y),E),A=Math.pow(y.distanceToSquared(v),E),_=Math.pow(v.distanceToSquared(g),E);A<1e-4&&(A=1),M<1e-4&&(M=A),_<1e-4&&(_=A),$y.initNonuniformCatmullRom(d.x,y.x,v.x,g.x,M,A,_),Zy.initNonuniformCatmullRom(d.y,y.y,v.y,g.y,M,A,_),Jy.initNonuniformCatmullRom(d.z,y.z,v.z,g.z,M,A,_)}else this.curveType==="catmullrom"&&($y.initCatmullRom(d.x,y.x,v.x,g.x,this.tension),Zy.initCatmullRom(d.y,y.y,v.y,g.y,this.tension),Jy.initCatmullRom(d.z,y.z,v.z,g.z,this.tension));return i.set($y.calc(p),Zy.calc(p),Jy.calc(p)),i}copy(t){super.copy(t),this.points=[];for(let e=0,i=t.points.length;e<i;e++){let s=t.points[e];this.points.push(s.clone())}return this.closed=t.closed,this.curveType=t.curveType,this.tension=t.tension,this}toJSON(){let t=super.toJSON();t.points=[];for(let e=0,i=this.points.length;e<i;e++){let s=this.points[e];t.points.push(s.toArray())}return t.closed=this.closed,t.curveType=this.curveType,t.tension=this.tension,t}fromJSON(t){super.fromJSON(t),this.points=[];for(let e=0,i=t.points.length;e<i;e++){let s=t.points[e];this.points.push(new st().fromArray(s))}return this.closed=t.closed,this.curveType=t.curveType,this.tension=t.tension,this}};function zI(n,t,e,i,s){let u=(i-t)*.5,c=(s-e)*.5,f=n*n,p=n*f;return(2*e-2*i+u+c)*p+(-3*e+3*i-2*u-c)*f+u*n+e}function q7(n,t){let e=1-n;return e*e*t}function V7(n,t){return 2*(1-n)*n*t}function H7(n,t){return n*n*t}function uf(n,t,e,i){return q7(n,t)+V7(n,e)+H7(n,i)}function W7(n,t){let e=1-n;return e*e*e*t}function X7(n,t){let e=1-n;return 3*e*e*n*t}function Y7(n,t){return 3*(1-n)*n*n*t}function $7(n,t){return n*n*n*t}function lf(n,t,e,i,s){return W7(n,t)+X7(n,e)+Y7(n,i)+$7(n,s)}var td=class extends co{constructor(t=new Ot,e=new Ot,i=new Ot,s=new Ot){super(),this.isCubicBezierCurve=!0,this.type="CubicBezierCurve",this.v0=t,this.v1=e,this.v2=i,this.v3=s}getPoint(t,e=new Ot){let i=e,s=this.v0,u=this.v1,c=this.v2,f=this.v3;return i.set(lf(t,s.x,u.x,c.x,f.x),lf(t,s.y,u.y,c.y,f.y)),i}copy(t){return super.copy(t),this.v0.copy(t.v0),this.v1.copy(t.v1),this.v2.copy(t.v2),this.v3.copy(t.v3),this}toJSON(){let t=super.toJSON();return t.v0=this.v0.toArray(),t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t.v3=this.v3.toArray(),t}fromJSON(t){return super.fromJSON(t),this.v0.fromArray(t.v0),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this.v3.fromArray(t.v3),this}},Pv=class extends co{constructor(t=new st,e=new st,i=new st,s=new st){super(),this.isCubicBezierCurve3=!0,this.type="CubicBezierCurve3",this.v0=t,this.v1=e,this.v2=i,this.v3=s}getPoint(t,e=new st){let i=e,s=this.v0,u=this.v1,c=this.v2,f=this.v3;return i.set(lf(t,s.x,u.x,c.x,f.x),lf(t,s.y,u.y,c.y,f.y),lf(t,s.z,u.z,c.z,f.z)),i}copy(t){return super.copy(t),this.v0.copy(t.v0),this.v1.copy(t.v1),this.v2.copy(t.v2),this.v3.copy(t.v3),this}toJSON(){let t=super.toJSON();return t.v0=this.v0.toArray(),t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t.v3=this.v3.toArray(),t}fromJSON(t){return super.fromJSON(t),this.v0.fromArray(t.v0),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this.v3.fromArray(t.v3),this}},ed=class extends co{constructor(t=new Ot,e=new Ot){super(),this.isLineCurve=!0,this.type="LineCurve",this.v1=t,this.v2=e}getPoint(t,e=new Ot){let i=e;return t===1?i.copy(this.v2):(i.copy(this.v2).sub(this.v1),i.multiplyScalar(t).add(this.v1)),i}getPointAt(t,e){return this.getPoint(t,e)}getTangent(t,e=new Ot){return e.subVectors(this.v2,this.v1).normalize()}getTangentAt(t,e){return this.getTangent(t,e)}copy(t){return super.copy(t),this.v1.copy(t.v1),this.v2.copy(t.v2),this}toJSON(){let t=super.toJSON();return t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t}fromJSON(t){return super.fromJSON(t),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this}},Rv=class extends co{constructor(t=new st,e=new st){super(),this.isLineCurve3=!0,this.type="LineCurve3",this.v1=t,this.v2=e}getPoint(t,e=new st){let i=e;return t===1?i.copy(this.v2):(i.copy(this.v2).sub(this.v1),i.multiplyScalar(t).add(this.v1)),i}getPointAt(t,e){return this.getPoint(t,e)}getTangent(t,e=new st){return e.subVectors(this.v2,this.v1).normalize()}getTangentAt(t,e){return this.getTangent(t,e)}copy(t){return super.copy(t),this.v1.copy(t.v1),this.v2.copy(t.v2),this}toJSON(){let t=super.toJSON();return t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t}fromJSON(t){return super.fromJSON(t),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this}},nd=class extends co{constructor(t=new Ot,e=new Ot,i=new Ot){super(),this.isQuadraticBezierCurve=!0,this.type="QuadraticBezierCurve",this.v0=t,this.v1=e,this.v2=i}getPoint(t,e=new Ot){let i=e,s=this.v0,u=this.v1,c=this.v2;return i.set(uf(t,s.x,u.x,c.x),uf(t,s.y,u.y,c.y)),i}copy(t){return super.copy(t),this.v0.copy(t.v0),this.v1.copy(t.v1),this.v2.copy(t.v2),this}toJSON(){let t=super.toJSON();return t.v0=this.v0.toArray(),t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t}fromJSON(t){return super.fromJSON(t),this.v0.fromArray(t.v0),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this}},Lv=class extends co{constructor(t=new st,e=new st,i=new st){super(),this.isQuadraticBezierCurve3=!0,this.type="QuadraticBezierCurve3",this.v0=t,this.v1=e,this.v2=i}getPoint(t,e=new st){let i=e,s=this.v0,u=this.v1,c=this.v2;return i.set(uf(t,s.x,u.x,c.x),uf(t,s.y,u.y,c.y),uf(t,s.z,u.z,c.z)),i}copy(t){return super.copy(t),this.v0.copy(t.v0),this.v1.copy(t.v1),this.v2.copy(t.v2),this}toJSON(){let t=super.toJSON();return t.v0=this.v0.toArray(),t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t}fromJSON(t){return super.fromJSON(t),this.v0.fromArray(t.v0),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this}},rd=class extends co{constructor(t=[]){super(),this.isSplineCurve=!0,this.type="SplineCurve",this.points=t}getPoint(t,e=new Ot){let i=e,s=this.points,u=(s.length-1)*t,c=Math.floor(u),f=u-c,p=s[c===0?c:c-1],d=s[c],g=s[c>s.length-2?s.length-1:c+1],y=s[c>s.length-3?s.length-1:c+2];return i.set(zI(f,p.x,d.x,g.x,y.x),zI(f,p.y,d.y,g.y,y.y)),i}copy(t){super.copy(t),this.points=[];for(let e=0,i=t.points.length;e<i;e++){let s=t.points[e];this.points.push(s.clone())}return this}toJSON(){let t=super.toJSON();t.points=[];for(let e=0,i=this.points.length;e<i;e++){let s=this.points[e];t.points.push(s.toArray())}return t}fromJSON(t){super.fromJSON(t),this.points=[];for(let e=0,i=t.points.length;e<i;e++){let s=t.points[e];this.points.push(new Ot().fromArray(s))}return this}},Nv=Object.freeze({__proto__:null,ArcCurve:Cv,CatmullRomCurve3:Iv,CubicBezierCurve:td,CubicBezierCurve3:Pv,EllipseCurve:pf,LineCurve:ed,LineCurve3:Rv,QuadraticBezierCurve:nd,QuadraticBezierCurve3:Lv,SplineCurve:rd}),Ov=class extends co{constructor(){super(),this.type="CurvePath",this.curves=[],this.autoClose=!1}add(t){this.curves.push(t)}closePath(){let t=this.curves[0].getPoint(0),e=this.curves[this.curves.length-1].getPoint(1);if(!t.equals(e)){let i=t.isVector2===!0?"LineCurve":"LineCurve3";this.curves.push(new Nv[i](e,t))}return this}getPoint(t,e){let i=t*this.getLength(),s=this.getCurveLengths(),u=0;for(;u<s.length;){if(s[u]>=i){let c=s[u]-i,f=this.curves[u],p=f.getLength(),d=p===0?0:1-c/p;return f.getPointAt(d,e)}u++}return null}getLength(){let t=this.getCurveLengths();return t[t.length-1]}updateArcLengths(){this.needsUpdate=!0,this.cacheLengths=null,this.getCurveLengths()}getCurveLengths(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;let t=[],e=0;for(let i=0,s=this.curves.length;i<s;i++)e+=this.curves[i].getLength(),t.push(e);return this.cacheLengths=t,t}getSpacedPoints(t=40){let e=[];for(let i=0;i<=t;i++)e.push(this.getPoint(i/t));return this.autoClose&&e.push(e[0]),e}getPoints(t=12){let e=[],i;for(let s=0,u=this.curves;s<u.length;s++){let c=u[s],f=c.isEllipseCurve?t*2:c.isLineCurve||c.isLineCurve3?1:c.isSplineCurve?t*c.points.length:t,p=c.getPoints(f);for(let d=0;d<p.length;d++){let g=p[d];i&&i.equals(g)||(e.push(g),i=g)}}return this.autoClose&&e.length>1&&!e[e.length-1].equals(e[0])&&e.push(e[0]),e}copy(t){super.copy(t),this.curves=[];for(let e=0,i=t.curves.length;e<i;e++){let s=t.curves[e];this.curves.push(s.clone())}return this.autoClose=t.autoClose,this}toJSON(){let t=super.toJSON();t.autoClose=this.autoClose,t.curves=[];for(let e=0,i=this.curves.length;e<i;e++){let s=this.curves[e];t.curves.push(s.toJSON())}return t}fromJSON(t){super.fromJSON(t),this.autoClose=t.autoClose,this.curves=[];for(let e=0,i=t.curves.length;e<i;e++){let s=t.curves[e];this.curves.push(new Nv[s.type]().fromJSON(s))}return this}},Ll=class extends Ov{constructor(t){super(),this.type="Path",this.currentPoint=new Ot,t&&this.setFromPoints(t)}setFromPoints(t){this.moveTo(t[0].x,t[0].y);for(let e=1,i=t.length;e<i;e++)this.lineTo(t[e].x,t[e].y);return this}moveTo(t,e){return this.currentPoint.set(t,e),this}lineTo(t,e){let i=new ed(this.currentPoint.clone(),new Ot(t,e));return this.curves.push(i),this.currentPoint.set(t,e),this}quadraticCurveTo(t,e,i,s){let u=new nd(this.currentPoint.clone(),new Ot(t,e),new Ot(i,s));return this.curves.push(u),this.currentPoint.set(i,s),this}bezierCurveTo(t,e,i,s,u,c){let f=new td(this.currentPoint.clone(),new Ot(t,e),new Ot(i,s),new Ot(u,c));return this.curves.push(f),this.currentPoint.set(u,c),this}splineThru(t){let e=[this.currentPoint.clone()].concat(t),i=new rd(e);return this.curves.push(i),this.currentPoint.copy(t[t.length-1]),this}arc(t,e,i,s,u,c){let f=this.currentPoint.x,p=this.currentPoint.y;return this.absarc(t+f,e+p,i,s,u,c),this}absarc(t,e,i,s,u,c){return this.absellipse(t,e,i,i,s,u,c),this}ellipse(t,e,i,s,u,c,f,p){let d=this.currentPoint.x,g=this.currentPoint.y;return this.absellipse(t+d,e+g,i,s,u,c,f,p),this}absellipse(t,e,i,s,u,c,f,p){let d=new pf(t,e,i,s,u,c,f,p);if(this.curves.length>0){let y=d.getPoint(0);y.equals(this.currentPoint)||this.lineTo(y.x,y.y)}this.curves.push(d);let g=d.getPoint(1);return this.currentPoint.copy(g),this}copy(t){return super.copy(t),this.currentPoint.copy(t.currentPoint),this}toJSON(){let t=super.toJSON();return t.currentPoint=this.currentPoint.toArray(),t}fromJSON(t){return super.fromJSON(t),this.currentPoint.fromArray(t.currentPoint),this}};var Nl=class extends Ll{constructor(t){super(t),this.uuid=Fs(),this.type="Shape",this.holes=[]}getPointsHoles(t){let e=[];for(let i=0,s=this.holes.length;i<s;i++)e[i]=this.holes[i].getPoints(t);return e}extractPoints(t){return{shape:this.getPoints(t),holes:this.getPointsHoles(t)}}copy(t){super.copy(t),this.holes=[];for(let e=0,i=t.holes.length;e<i;e++){let s=t.holes[e];this.holes.push(s.clone())}return this}toJSON(){let t=super.toJSON();t.uuid=this.uuid,t.holes=[];for(let e=0,i=this.holes.length;e<i;e++){let s=this.holes[e];t.holes.push(s.toJSON())}return t}fromJSON(t){super.fromJSON(t),this.uuid=t.uuid,this.holes=[];for(let e=0,i=t.holes.length;e<i;e++){let s=t.holes[e];this.holes.push(new Ll().fromJSON(s))}return this}},Z7={triangulate:function(n,t,e=2){let i=t&&t.length,s=i?t[0]*e:n.length,u=hP(n,0,s,e,!0),c=[];if(!u||u.next===u.prev)return c;let f,p,d,g,y,v,E;if(i&&(u=tY(n,t,u,e)),n.length>80*e){f=d=n[0],p=g=n[1];for(let M=e;M<s;M+=e)y=n[M],v=n[M+1],y<f&&(f=y),v<p&&(p=v),y>d&&(d=y),v>g&&(g=v);E=Math.max(d-f,g-p),E=E!==0?32767/E:0}return df(u,c,e,f,p,E,0),c}};function hP(n,t,e,i,s){let u,c;if(s===fY(n,t,e,i)>0)for(u=t;u<e;u+=i)c=GI(u,n[u],n[u+1],c);else for(u=e-i;u>=t;u-=i)c=GI(u,n[u],n[u+1],c);return c&&fd(c,c.next)&&(mf(c),c=c.next),c}function fu(n,t){if(!n)return n;t||(t=n);let e=n,i;do if(i=!1,!e.steiner&&(fd(e,e.next)||jn(e.prev,e,e.next)===0)){if(mf(e),e=t=e.prev,e===e.next)break;i=!0}else e=e.next;while(i||e!==t);return t}function df(n,t,e,i,s,u,c){if(!n)return;!c&&u&&oY(n,i,s,u);let f=n,p,d;for(;n.prev!==n.next;){if(p=n.prev,d=n.next,u?j7(n,i,s,u):J7(n)){t.push(p.i/e|0),t.push(n.i/e|0),t.push(d.i/e|0),mf(n),n=d.next,f=d.next;continue}if(n=d,n===f){c?c===1?(n=K7(fu(n),t,e),df(n,t,e,i,s,u,2)):c===2&&Q7(n,t,e,i,s,u):df(fu(n),t,e,i,s,u,1);break}}}function J7(n){let t=n.prev,e=n,i=n.next;if(jn(t,e,i)>=0)return!1;let s=t.x,u=e.x,c=i.x,f=t.y,p=e.y,d=i.y,g=s<u?s<c?s:c:u<c?u:c,y=f<p?f<d?f:d:p<d?p:d,v=s>u?s>c?s:c:u>c?u:c,E=f>p?f>d?f:d:p>d?p:d,M=i.next;for(;M!==t;){if(M.x>=g&&M.x<=v&&M.y>=y&&M.y<=E&&Ml(s,f,u,p,c,d,M.x,M.y)&&jn(M.prev,M,M.next)>=0)return!1;M=M.next}return!0}function j7(n,t,e,i){let s=n.prev,u=n,c=n.next;if(jn(s,u,c)>=0)return!1;let f=s.x,p=u.x,d=c.x,g=s.y,y=u.y,v=c.y,E=f<p?f<d?f:d:p<d?p:d,M=g<y?g<v?g:v:y<v?y:v,A=f>p?f>d?f:d:p>d?p:d,_=g>y?g>v?g:v:y>v?y:v,x=Dv(E,M,t,e,i),T=Dv(A,_,t,e,i),w=n.prevZ,R=n.nextZ;for(;w&&w.z>=x&&R&&R.z<=T;){if(w.x>=E&&w.x<=A&&w.y>=M&&w.y<=_&&w!==s&&w!==c&&Ml(f,g,p,y,d,v,w.x,w.y)&&jn(w.prev,w,w.next)>=0||(w=w.prevZ,R.x>=E&&R.x<=A&&R.y>=M&&R.y<=_&&R!==s&&R!==c&&Ml(f,g,p,y,d,v,R.x,R.y)&&jn(R.prev,R,R.next)>=0))return!1;R=R.nextZ}for(;w&&w.z>=x;){if(w.x>=E&&w.x<=A&&w.y>=M&&w.y<=_&&w!==s&&w!==c&&Ml(f,g,p,y,d,v,w.x,w.y)&&jn(w.prev,w,w.next)>=0)return!1;w=w.prevZ}for(;R&&R.z<=T;){if(R.x>=E&&R.x<=A&&R.y>=M&&R.y<=_&&R!==s&&R!==c&&Ml(f,g,p,y,d,v,R.x,R.y)&&jn(R.prev,R,R.next)>=0)return!1;R=R.nextZ}return!0}function K7(n,t,e){let i=n;do{let s=i.prev,u=i.next.next;!fd(s,u)&&pP(s,i,i.next,u)&&gf(s,u)&&gf(u,s)&&(t.push(s.i/e|0),t.push(i.i/e|0),t.push(u.i/e|0),mf(i),mf(i.next),i=n=u),i=i.next}while(i!==n);return fu(i)}function Q7(n,t,e,i,s,u){let c=n;do{let f=c.next.next;for(;f!==c.prev;){if(c.i!==f.i&&uY(c,f)){let p=dP(c,f);c=fu(c,c.next),p=fu(p,p.next),df(c,t,e,i,s,u,0),df(p,t,e,i,s,u,0);return}f=f.next}c=c.next}while(c!==n)}function tY(n,t,e,i){let s=[],u,c,f,p,d;for(u=0,c=t.length;u<c;u++)f=t[u]*i,p=u<c-1?t[u+1]*i:n.length,d=hP(n,f,p,i,!1),d===d.next&&(d.steiner=!0),s.push(aY(d));for(s.sort(eY),u=0;u<s.length;u++)e=nY(s[u],e);return e}function eY(n,t){return n.x-t.x}function nY(n,t){let e=rY(n,t);if(!e)return t;let i=dP(e,n);return fu(i,i.next),fu(e,e.next)}function rY(n,t){let e=t,i=-1/0,s,u=n.x,c=n.y;do{if(c<=e.y&&c>=e.next.y&&e.next.y!==e.y){let v=e.x+(c-e.y)*(e.next.x-e.x)/(e.next.y-e.y);if(v<=u&&v>i&&(i=v,s=e.x<e.next.x?e:e.next,v===u))return s}e=e.next}while(e!==t);if(!s)return null;let f=s,p=s.x,d=s.y,g=1/0,y;e=s;do u>=e.x&&e.x>=p&&u!==e.x&&Ml(c<d?u:i,c,p,d,c<d?i:u,c,e.x,e.y)&&(y=Math.abs(c-e.y)/(u-e.x),gf(e,n)&&(y<g||y===g&&(e.x>s.x||e.x===s.x&&iY(s,e)))&&(s=e,g=y)),e=e.next;while(e!==f);return s}function iY(n,t){return jn(n.prev,n,t.prev)<0&&jn(t.next,n,n.next)<0}function oY(n,t,e,i){let s=n;do s.z===0&&(s.z=Dv(s.x,s.y,t,e,i)),s.prevZ=s.prev,s.nextZ=s.next,s=s.next;while(s!==n);s.prevZ.nextZ=null,s.prevZ=null,sY(s)}function sY(n){let t,e,i,s,u,c,f,p,d=1;do{for(e=n,n=null,u=null,c=0;e;){for(c++,i=e,f=0,t=0;t<d&&(f++,i=i.nextZ,!!i);t++);for(p=d;f>0||p>0&&i;)f!==0&&(p===0||!i||e.z<=i.z)?(s=e,e=e.nextZ,f--):(s=i,i=i.nextZ,p--),u?u.nextZ=s:n=s,s.prevZ=u,u=s;e=i}u.nextZ=null,d*=2}while(c>1);return n}function Dv(n,t,e,i,s){return n=(n-e)*s|0,t=(t-i)*s|0,n=(n|n<<8)&16711935,n=(n|n<<4)&252645135,n=(n|n<<2)&858993459,n=(n|n<<1)&1431655765,t=(t|t<<8)&16711935,t=(t|t<<4)&252645135,t=(t|t<<2)&858993459,t=(t|t<<1)&1431655765,n|t<<1}function aY(n){let t=n,e=n;do(t.x<e.x||t.x===e.x&&t.y<e.y)&&(e=t),t=t.next;while(t!==n);return e}function Ml(n,t,e,i,s,u,c,f){return(s-c)*(t-f)>=(n-c)*(u-f)&&(n-c)*(i-f)>=(e-c)*(t-f)&&(e-c)*(u-f)>=(s-c)*(i-f)}function uY(n,t){return n.next.i!==t.i&&n.prev.i!==t.i&&!lY(n,t)&&(gf(n,t)&&gf(t,n)&&cY(n,t)&&(jn(n.prev,n,t.prev)||jn(n,t.prev,t))||fd(n,t)&&jn(n.prev,n,n.next)>0&&jn(t.prev,t,t.next)>0)}function jn(n,t,e){return(t.y-n.y)*(e.x-t.x)-(t.x-n.x)*(e.y-t.y)}function fd(n,t){return n.x===t.x&&n.y===t.y}function pP(n,t,e,i){let s=Rp(jn(n,t,e)),u=Rp(jn(n,t,i)),c=Rp(jn(e,i,n)),f=Rp(jn(e,i,t));return!!(s!==u&&c!==f||s===0&&Pp(n,e,t)||u===0&&Pp(n,i,t)||c===0&&Pp(e,n,i)||f===0&&Pp(e,t,i))}function Pp(n,t,e){return t.x<=Math.max(n.x,e.x)&&t.x>=Math.min(n.x,e.x)&&t.y<=Math.max(n.y,e.y)&&t.y>=Math.min(n.y,e.y)}function Rp(n){return n>0?1:n<0?-1:0}function lY(n,t){let e=n;do{if(e.i!==n.i&&e.next.i!==n.i&&e.i!==t.i&&e.next.i!==t.i&&pP(e,e.next,n,t))return!0;e=e.next}while(e!==n);return!1}function gf(n,t){return jn(n.prev,n,n.next)<0?jn(n,t,n.next)>=0&&jn(n,n.prev,t)>=0:jn(n,t,n.prev)<0||jn(n,n.next,t)<0}function cY(n,t){let e=n,i=!1,s=(n.x+t.x)/2,u=(n.y+t.y)/2;do e.y>u!=e.next.y>u&&e.next.y!==e.y&&s<(e.next.x-e.x)*(u-e.y)/(e.next.y-e.y)+e.x&&(i=!i),e=e.next;while(e!==n);return i}function dP(n,t){let e=new Fv(n.i,n.x,n.y),i=new Fv(t.i,t.x,t.y),s=n.next,u=t.prev;return n.next=t,t.prev=n,e.next=s,s.prev=e,i.next=e,e.prev=i,u.next=i,i.prev=u,i}function GI(n,t,e,i){let s=new Fv(n,t,e);return i?(s.next=i.next,s.prev=i,i.next.prev=s,i.next=s):(s.prev=s,s.next=s),s}function mf(n){n.next.prev=n.prev,n.prev.next=n.next,n.prevZ&&(n.prevZ.nextZ=n.nextZ),n.nextZ&&(n.nextZ.prevZ=n.prevZ)}function Fv(n,t,e){this.i=n,this.x=t,this.y=e,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}function fY(n,t,e,i){let s=0;for(let u=t,c=e-i;u<e;u+=i)s+=(n[c]-n[u])*(n[u+1]+n[c+1]),c=u;return s}var ya=class n{static area(t){let e=t.length,i=0;for(let s=e-1,u=0;u<e;s=u++)i+=t[s].x*t[u].y-t[u].x*t[s].y;return i*.5}static isClockWise(t){return n.area(t)<0}static triangulateShape(t,e){let i=[],s=[],u=[];kI(t),qI(i,t);let c=t.length;e.forEach(kI);for(let p=0;p<e.length;p++)s.push(c),c+=e[p].length,qI(i,e[p]);let f=Z7.triangulate(i,s);for(let p=0;p<f.length;p+=3)u.push(f.slice(p,p+3));return u}};function kI(n){let t=n.length;t>2&&n[t-1].equals(n[0])&&n.pop()}function qI(n,t){for(let e=0;e<t.length;e++)n.push(t[e].x),n.push(t[e].y)}var id=class n extends ui{constructor(t=new Nl([new Ot(.5,.5),new Ot(-.5,.5),new Ot(-.5,-.5),new Ot(.5,-.5)]),e={}){super(),this.type="ExtrudeGeometry",this.parameters={shapes:t,options:e},t=Array.isArray(t)?t:[t];let i=this,s=[],u=[];for(let f=0,p=t.length;f<p;f++){let d=t[f];c(d)}this.setAttribute("position",new _r(s,3)),this.setAttribute("uv",new _r(u,2)),this.computeVertexNormals();function c(f){let p=[],d=e.curveSegments!==void 0?e.curveSegments:12,g=e.steps!==void 0?e.steps:1,y=e.depth!==void 0?e.depth:1,v=e.bevelEnabled!==void 0?e.bevelEnabled:!0,E=e.bevelThickness!==void 0?e.bevelThickness:.2,M=e.bevelSize!==void 0?e.bevelSize:E-.1,A=e.bevelOffset!==void 0?e.bevelOffset:0,_=e.bevelSegments!==void 0?e.bevelSegments:3,x=e.extrudePath,T=e.UVGenerator!==void 0?e.UVGenerator:hY,w,R=!1,z,U,D,P;x&&(w=x.getSpacedPoints(g),R=!0,v=!1,z=x.computeFrenetFrames(g,!1),U=new st,D=new st,P=new st),v||(_=0,E=0,M=0,A=0);let ct=f.extractPoints(d),L=ct.shape,W=ct.holes;if(!ya.isClockWise(L)){L=L.reverse();for(let Z=0,Dt=W.length;Z<Dt;Z++){let _t=W[Z];ya.isClockWise(_t)&&(W[Z]=_t.reverse())}}let Mt=ya.triangulateShape(L,W),$=L;for(let Z=0,Dt=W.length;Z<Dt;Z++){let _t=W[Z];L=L.concat(_t)}function gt(Z,Dt,_t){return Dt||console.error("THREE.ExtrudeGeometry: vec does not exist"),Z.clone().addScaledVector(Dt,_t)}let ft=L.length,vt=Mt.length;function it(Z,Dt,_t){let Nt,wt,Ht,Xt=Z.x-Dt.x,Pt=Z.y-Dt.y,ne=_t.x-Z.x,Y=_t.y-Z.y,N=Xt*Xt+Pt*Pt,xt=Xt*Y-Pt*ne;if(Math.abs(xt)>Number.EPSILON){let St=Math.sqrt(N),ot=Math.sqrt(ne*ne+Y*Y),Lt=Dt.x-Pt/St,ce=Dt.y+Xt/St,Rt=_t.x-Y/ot,Bt=_t.y+ne/ot,Wt=((Rt-Lt)*Y-(Bt-ce)*ne)/(Xt*Y-Pt*ne);Nt=Lt+Xt*Wt-Z.x,wt=ce+Pt*Wt-Z.y;let j=Nt*Nt+wt*wt;if(j<=2)return new Ot(Nt,wt);Ht=Math.sqrt(j/2)}else{let St=!1;Xt>Number.EPSILON?ne>Number.EPSILON&&(St=!0):Xt<-Number.EPSILON?ne<-Number.EPSILON&&(St=!0):Math.sign(Pt)===Math.sign(Y)&&(St=!0),St?(Nt=-Pt,wt=Xt,Ht=Math.sqrt(N)):(Nt=Xt,wt=Pt,Ht=Math.sqrt(N/2))}return new Ot(Nt/Ht,wt/Ht)}let lt=[];for(let Z=0,Dt=$.length,_t=Dt-1,Nt=Z+1;Z<Dt;Z++,_t++,Nt++)_t===Dt&&(_t=0),Nt===Dt&&(Nt=0),lt[Z]=it($[Z],$[_t],$[Nt]);let H=[],At,It=lt.concat();for(let Z=0,Dt=W.length;Z<Dt;Z++){let _t=W[Z];At=[];for(let Nt=0,wt=_t.length,Ht=wt-1,Xt=Nt+1;Nt<wt;Nt++,Ht++,Xt++)Ht===wt&&(Ht=0),Xt===wt&&(Xt=0),At[Nt]=it(_t[Nt],_t[Ht],_t[Xt]);H.push(At),It=It.concat(At)}for(let Z=0;Z<_;Z++){let Dt=Z/_,_t=E*Math.cos(Dt*Math.PI/2),Nt=M*Math.sin(Dt*Math.PI/2)+A;for(let wt=0,Ht=$.length;wt<Ht;wt++){let Xt=gt($[wt],lt[wt],Nt);$t(Xt.x,Xt.y,-_t)}for(let wt=0,Ht=W.length;wt<Ht;wt++){let Xt=W[wt];At=H[wt];for(let Pt=0,ne=Xt.length;Pt<ne;Pt++){let Y=gt(Xt[Pt],At[Pt],Nt);$t(Y.x,Y.y,-_t)}}}let Kt=M+A;for(let Z=0;Z<ft;Z++){let Dt=v?gt(L[Z],It[Z],Kt):L[Z];R?(D.copy(z.normals[0]).multiplyScalar(Dt.x),U.copy(z.binormals[0]).multiplyScalar(Dt.y),P.copy(w[0]).add(D).add(U),$t(P.x,P.y,P.z)):$t(Dt.x,Dt.y,0)}for(let Z=1;Z<=g;Z++)for(let Dt=0;Dt<ft;Dt++){let _t=v?gt(L[Dt],It[Dt],Kt):L[Dt];R?(D.copy(z.normals[Z]).multiplyScalar(_t.x),U.copy(z.binormals[Z]).multiplyScalar(_t.y),P.copy(w[Z]).add(D).add(U),$t(P.x,P.y,P.z)):$t(_t.x,_t.y,y/g*Z)}for(let Z=_-1;Z>=0;Z--){let Dt=Z/_,_t=E*Math.cos(Dt*Math.PI/2),Nt=M*Math.sin(Dt*Math.PI/2)+A;for(let wt=0,Ht=$.length;wt<Ht;wt++){let Xt=gt($[wt],lt[wt],Nt);$t(Xt.x,Xt.y,y+_t)}for(let wt=0,Ht=W.length;wt<Ht;wt++){let Xt=W[wt];At=H[wt];for(let Pt=0,ne=Xt.length;Pt<ne;Pt++){let Y=gt(Xt[Pt],At[Pt],Nt);R?$t(Y.x,Y.y+w[g-1].y,w[g-1].x+_t):$t(Y.x,Y.y,y+_t)}}}nt(),bt();function nt(){let Z=s.length/3;if(v){let Dt=0,_t=ft*Dt;for(let Nt=0;Nt<vt;Nt++){let wt=Mt[Nt];Ut(wt[2]+_t,wt[1]+_t,wt[0]+_t)}Dt=g+_*2,_t=ft*Dt;for(let Nt=0;Nt<vt;Nt++){let wt=Mt[Nt];Ut(wt[0]+_t,wt[1]+_t,wt[2]+_t)}}else{for(let Dt=0;Dt<vt;Dt++){let _t=Mt[Dt];Ut(_t[2],_t[1],_t[0])}for(let Dt=0;Dt<vt;Dt++){let _t=Mt[Dt];Ut(_t[0]+ft*g,_t[1]+ft*g,_t[2]+ft*g)}}i.addGroup(Z,s.length/3-Z,0)}function bt(){let Z=s.length/3,Dt=0;Vt($,Dt),Dt+=$.length;for(let _t=0,Nt=W.length;_t<Nt;_t++){let wt=W[_t];Vt(wt,Dt),Dt+=wt.length}i.addGroup(Z,s.length/3-Z,1)}function Vt(Z,Dt){let _t=Z.length;for(;--_t>=0;){let Nt=_t,wt=_t-1;wt<0&&(wt=Z.length-1);for(let Ht=0,Xt=g+_*2;Ht<Xt;Ht++){let Pt=ft*Ht,ne=ft*(Ht+1),Y=Dt+Nt+Pt,N=Dt+wt+Pt,xt=Dt+wt+ne,St=Dt+Nt+ne;Gt(Y,N,xt,St)}}}function $t(Z,Dt,_t){p.push(Z),p.push(Dt),p.push(_t)}function Ut(Z,Dt,_t){Ct(Z),Ct(Dt),Ct(_t);let Nt=s.length/3,wt=T.generateTopUV(i,s,Nt-3,Nt-2,Nt-1);ee(wt[0]),ee(wt[1]),ee(wt[2])}function Gt(Z,Dt,_t,Nt){Ct(Z),Ct(Dt),Ct(Nt),Ct(Dt),Ct(_t),Ct(Nt);let wt=s.length/3,Ht=T.generateSideWallUV(i,s,wt-6,wt-3,wt-2,wt-1);ee(Ht[0]),ee(Ht[1]),ee(Ht[3]),ee(Ht[1]),ee(Ht[2]),ee(Ht[3])}function Ct(Z){s.push(p[Z*3+0]),s.push(p[Z*3+1]),s.push(p[Z*3+2])}function ee(Z){u.push(Z.x),u.push(Z.y)}}}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}toJSON(){let t=super.toJSON(),e=this.parameters.shapes,i=this.parameters.options;return pY(e,i,t)}static fromJSON(t,e){let i=[];for(let u=0,c=t.shapes.length;u<c;u++){let f=e[t.shapes[u]];i.push(f)}let s=t.options.extrudePath;return s!==void 0&&(t.options.extrudePath=new Nv[s.type]().fromJSON(s)),new n(i,t.options)}},hY={generateTopUV:function(n,t,e,i,s){let u=t[e*3],c=t[e*3+1],f=t[i*3],p=t[i*3+1],d=t[s*3],g=t[s*3+1];return[new Ot(u,c),new Ot(f,p),new Ot(d,g)]},generateSideWallUV:function(n,t,e,i,s,u){let c=t[e*3],f=t[e*3+1],p=t[e*3+2],d=t[i*3],g=t[i*3+1],y=t[i*3+2],v=t[s*3],E=t[s*3+1],M=t[s*3+2],A=t[u*3],_=t[u*3+1],x=t[u*3+2];return Math.abs(f-g)<Math.abs(c-d)?[new Ot(c,1-p),new Ot(d,1-y),new Ot(v,1-M),new Ot(A,1-x)]:[new Ot(f,1-p),new Ot(g,1-y),new Ot(E,1-M),new Ot(_,1-x)]}};function pY(n,t,e){if(e.shapes=[],Array.isArray(n))for(let i=0,s=n.length;i<s;i++){let u=n[i];e.shapes.push(u.uuid)}else e.shapes.push(n.uuid);return e.options=Object.assign({},t),t.extrudePath!==void 0&&(e.options.extrudePath=t.extrudePath.toJSON()),e}var od=class n extends ui{constructor(t=new Nl([new Ot(0,.5),new Ot(-.5,-.5),new Ot(.5,-.5)]),e=12){super(),this.type="ShapeGeometry",this.parameters={shapes:t,curveSegments:e};let i=[],s=[],u=[],c=[],f=0,p=0;if(Array.isArray(t)===!1)d(t);else for(let g=0;g<t.length;g++)d(t[g]),this.addGroup(f,p,g),f+=p,p=0;this.setIndex(i),this.setAttribute("position",new _r(s,3)),this.setAttribute("normal",new _r(u,3)),this.setAttribute("uv",new _r(c,2));function d(g){let y=s.length/3,v=g.extractPoints(e),E=v.shape,M=v.holes;ya.isClockWise(E)===!1&&(E=E.reverse());for(let _=0,x=M.length;_<x;_++){let T=M[_];ya.isClockWise(T)===!0&&(M[_]=T.reverse())}let A=ya.triangulateShape(E,M);for(let _=0,x=M.length;_<x;_++){let T=M[_];E=E.concat(T)}for(let _=0,x=E.length;_<x;_++){let T=E[_];s.push(T.x,T.y,0),u.push(0,0,1),c.push(T.x,T.y)}for(let _=0,x=A.length;_<x;_++){let T=A[_],w=T[0]+y,R=T[1]+y,z=T[2]+y;i.push(w,R,z),p+=3}}}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}toJSON(){let t=super.toJSON(),e=this.parameters.shapes;return dY(e,t)}static fromJSON(t,e){let i=[];for(let s=0,u=t.shapes.length;s<u;s++){let c=e[t.shapes[s]];i.push(c)}return new n(i,t.curveSegments)}};function dY(n,t){if(t.shapes=[],Array.isArray(n))for(let e=0,i=n.length;e<i;e++){let s=n[e];t.shapes.push(s.uuid)}else t.shapes.push(n.uuid);return t}var sd=class extends ui{constructor(t=null){if(super(),this.type="WireframeGeometry",this.parameters={geometry:t},t!==null){let e=[],i=new Set,s=new st,u=new st;if(t.index!==null){let c=t.attributes.position,f=t.index,p=t.groups;p.length===0&&(p=[{start:0,count:f.count,materialIndex:0}]);for(let d=0,g=p.length;d<g;++d){let y=p[d],v=y.start,E=y.count;for(let M=v,A=v+E;M<A;M+=3)for(let _=0;_<3;_++){let x=f.getX(M+_),T=f.getX(M+(_+1)%3);s.fromBufferAttribute(c,x),u.fromBufferAttribute(c,T),VI(s,u,i)===!0&&(e.push(s.x,s.y,s.z),e.push(u.x,u.y,u.z))}}}else{let c=t.attributes.position;for(let f=0,p=c.count/3;f<p;f++)for(let d=0;d<3;d++){let g=3*f+d,y=3*f+(d+1)%3;s.fromBufferAttribute(c,g),u.fromBufferAttribute(c,y),VI(s,u,i)===!0&&(e.push(s.x,s.y,s.z),e.push(u.x,u.y,u.z))}}this.setAttribute("position",new _r(e,3))}}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}};function VI(n,t,e){let i=\`\${n.x},\${n.y},\${n.z}-\${t.x},\${t.y},\${t.z}\`,s=\`\${t.x},\${t.y},\${t.z}-\${n.x},\${n.y},\${n.z}\`;return e.has(i)===!0||e.has(s)===!0?!1:(e.add(i),e.add(s),!0)}function Lp(n,t,e){return!n||!e&&n.constructor===t?n:typeof t.BYTES_PER_ELEMENT=="number"?new t(n):Array.prototype.slice.call(n)}function gY(n){return ArrayBuffer.isView(n)&&!(n instanceof DataView)}var Ol=class{constructor(t,e,i,s){this.parameterPositions=t,this._cachedIndex=0,this.resultBuffer=s!==void 0?s:new e.constructor(i),this.sampleValues=e,this.valueSize=i,this.settings=null,this.DefaultSettings_={}}evaluate(t){let e=this.parameterPositions,i=this._cachedIndex,s=e[i],u=e[i-1];n:{t:{let c;e:{r:if(!(t<s)){for(let f=i+2;;){if(s===void 0){if(t<u)break r;return i=e.length,this._cachedIndex=i,this.copySampleValue_(i-1)}if(i===f)break;if(u=s,s=e[++i],t<s)break t}c=e.length;break e}if(!(t>=u)){let f=e[1];t<f&&(i=2,u=f);for(let p=i-2;;){if(u===void 0)return this._cachedIndex=0,this.copySampleValue_(0);if(i===p)break;if(s=u,u=e[--i-1],t>=u)break t}c=i,i=0;break e}break n}for(;i<c;){let f=i+c>>>1;t<e[f]?c=f:i=f+1}if(s=e[i],u=e[i-1],u===void 0)return this._cachedIndex=0,this.copySampleValue_(0);if(s===void 0)return i=e.length,this._cachedIndex=i,this.copySampleValue_(i-1)}this._cachedIndex=i,this.intervalChanged_(i,u,s)}return this.interpolate_(i,u,t,s)}getSettings_(){return this.settings||this.DefaultSettings_}copySampleValue_(t){let e=this.resultBuffer,i=this.sampleValues,s=this.valueSize,u=t*s;for(let c=0;c!==s;++c)e[c]=i[u+c];return e}interpolate_(){throw new Error("call to abstract method")}intervalChanged_(){}},Uv=class extends Ol{constructor(t,e,i,s){super(t,e,i,s),this._weightPrev=-0,this._offsetPrev=-0,this._weightNext=-0,this._offsetNext=-0,this.DefaultSettings_={endingStart:XC,endingEnd:XC}}intervalChanged_(t,e,i){let s=this.parameterPositions,u=t-2,c=t+1,f=s[u],p=s[c];if(f===void 0)switch(this.getSettings_().endingStart){case YC:u=t,f=2*e-i;break;case $C:u=s.length-2,f=e+s[u]-s[u+1];break;default:u=t,f=i}if(p===void 0)switch(this.getSettings_().endingEnd){case YC:c=t,p=2*i-e;break;case $C:c=1,p=i+s[1]-s[0];break;default:c=t-1,p=e}let d=(i-e)*.5,g=this.valueSize;this._weightPrev=d/(e-f),this._weightNext=d/(p-i),this._offsetPrev=u*g,this._offsetNext=c*g}interpolate_(t,e,i,s){let u=this.resultBuffer,c=this.sampleValues,f=this.valueSize,p=t*f,d=p-f,g=this._offsetPrev,y=this._offsetNext,v=this._weightPrev,E=this._weightNext,M=(i-e)/(s-e),A=M*M,_=A*M,x=-v*_+2*v*A-v*M,T=(1+v)*_+(-1.5-2*v)*A+(-.5+v)*M+1,w=(-1-E)*_+(1.5+E)*A+.5*M,R=E*_-E*A;for(let z=0;z!==f;++z)u[z]=x*c[g+z]+T*c[d+z]+w*c[p+z]+R*c[y+z];return u}},Bv=class extends Ol{constructor(t,e,i,s){super(t,e,i,s)}interpolate_(t,e,i,s){let u=this.resultBuffer,c=this.sampleValues,f=this.valueSize,p=t*f,d=p-f,g=(i-e)/(s-e),y=1-g;for(let v=0;v!==f;++v)u[v]=c[d+v]*y+c[p+v]*g;return u}},zv=class extends Ol{constructor(t,e,i,s){super(t,e,i,s)}interpolate_(t){return this.copySampleValue_(t-1)}},Do=class{constructor(t,e,i,s){if(t===void 0)throw new Error("THREE.KeyframeTrack: track name is undefined");if(e===void 0||e.length===0)throw new Error("THREE.KeyframeTrack: no keyframes in track named "+t);this.name=t,this.times=Lp(e,this.TimeBufferType),this.values=Lp(i,this.ValueBufferType),this.setInterpolation(s||this.DefaultInterpolation)}static toJSON(t){let e=t.constructor,i;if(e.toJSON!==this.toJSON)i=e.toJSON(t);else{i={name:t.name,times:Lp(t.times,Array),values:Lp(t.values,Array)};let s=t.getInterpolation();s!==t.DefaultInterpolation&&(i.interpolation=s)}return i.type=t.ValueTypeName,i}InterpolantFactoryMethodDiscrete(t){return new zv(this.times,this.values,this.getValueSize(),t)}InterpolantFactoryMethodLinear(t){return new Bv(this.times,this.values,this.getValueSize(),t)}InterpolantFactoryMethodSmooth(t){return new Uv(this.times,this.values,this.getValueSize(),t)}setInterpolation(t){let e;switch(t){case Op:e=this.InterpolantFactoryMethodDiscrete;break;case Dp:e=this.InterpolantFactoryMethodLinear;break;case xy:e=this.InterpolantFactoryMethodSmooth;break}if(e===void 0){let i="unsupported interpolation for "+this.ValueTypeName+" keyframe track named "+this.name;if(this.createInterpolant===void 0)if(t!==this.DefaultInterpolation)this.setInterpolation(this.DefaultInterpolation);else throw new Error(i);return console.warn("THREE.KeyframeTrack:",i),this}return this.createInterpolant=e,this}getInterpolation(){switch(this.createInterpolant){case this.InterpolantFactoryMethodDiscrete:return Op;case this.InterpolantFactoryMethodLinear:return Dp;case this.InterpolantFactoryMethodSmooth:return xy}}getValueSize(){return this.values.length/this.times.length}shift(t){if(t!==0){let e=this.times;for(let i=0,s=e.length;i!==s;++i)e[i]+=t}return this}scale(t){if(t!==1){let e=this.times;for(let i=0,s=e.length;i!==s;++i)e[i]*=t}return this}trim(t,e){let i=this.times,s=i.length,u=0,c=s-1;for(;u!==s&&i[u]<t;)++u;for(;c!==-1&&i[c]>e;)--c;if(++c,u!==0||c!==s){u>=c&&(c=Math.max(c,1),u=c-1);let f=this.getValueSize();this.times=i.slice(u,c),this.values=this.values.slice(u*f,c*f)}return this}validate(){let t=!0,e=this.getValueSize();e-Math.floor(e)!==0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),t=!1);let i=this.times,s=this.values,u=i.length;u===0&&(console.error("THREE.KeyframeTrack: Track is empty.",this),t=!1);let c=null;for(let f=0;f!==u;f++){let p=i[f];if(typeof p=="number"&&isNaN(p)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,f,p),t=!1;break}if(c!==null&&c>p){console.error("THREE.KeyframeTrack: Out of order keys.",this,f,p,c),t=!1;break}c=p}if(s!==void 0&&gY(s))for(let f=0,p=s.length;f!==p;++f){let d=s[f];if(isNaN(d)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,f,d),t=!1;break}}return t}optimize(){let t=this.times.slice(),e=this.values.slice(),i=this.getValueSize(),s=this.getInterpolation()===xy,u=t.length-1,c=1;for(let f=1;f<u;++f){let p=!1,d=t[f],g=t[f+1];if(d!==g&&(f!==1||d!==t[0]))if(s)p=!0;else{let y=f*i,v=y-i,E=y+i;for(let M=0;M!==i;++M){let A=e[y+M];if(A!==e[v+M]||A!==e[E+M]){p=!0;break}}}if(p){if(f!==c){t[c]=t[f];let y=f*i,v=c*i;for(let E=0;E!==i;++E)e[v+E]=e[y+E]}++c}}if(u>0){t[c]=t[u];for(let f=u*i,p=c*i,d=0;d!==i;++d)e[p+d]=e[f+d];++c}return c!==t.length?(this.times=t.slice(0,c),this.values=e.slice(0,c*i)):(this.times=t,this.values=e),this}clone(){let t=this.times.slice(),e=this.values.slice(),i=this.constructor,s=new i(this.name,t,e);return s.createInterpolant=this.createInterpolant,s}};Do.prototype.TimeBufferType=Float32Array;Do.prototype.ValueBufferType=Float32Array;Do.prototype.DefaultInterpolation=Dp;var hu=class extends Do{};hu.prototype.ValueTypeName="bool";hu.prototype.ValueBufferType=Array;hu.prototype.DefaultInterpolation=Op;hu.prototype.InterpolantFactoryMethodLinear=void 0;hu.prototype.InterpolantFactoryMethodSmooth=void 0;var Gv=class extends Do{};Gv.prototype.ValueTypeName="color";var kv=class extends Do{};kv.prototype.ValueTypeName="number";var qv=class extends Ol{constructor(t,e,i,s){super(t,e,i,s)}interpolate_(t,e,i,s){let u=this.resultBuffer,c=this.sampleValues,f=this.valueSize,p=(i-e)/(s-e),d=t*f;for(let g=d+f;d!==g;d+=4)lo.slerpFlat(u,0,c,d-f,c,d,p);return u}},yf=class extends Do{InterpolantFactoryMethodLinear(t){return new qv(this.times,this.values,this.getValueSize(),t)}};yf.prototype.ValueTypeName="quaternion";yf.prototype.DefaultInterpolation=Dp;yf.prototype.InterpolantFactoryMethodSmooth=void 0;var pu=class extends Do{};pu.prototype.ValueTypeName="string";pu.prototype.ValueBufferType=Array;pu.prototype.DefaultInterpolation=Op;pu.prototype.InterpolantFactoryMethodLinear=void 0;pu.prototype.InterpolantFactoryMethodSmooth=void 0;var Vv=class extends Do{};Vv.prototype.ValueTypeName="vector";var Hv=class{constructor(t,e,i){let s=this,u=!1,c=0,f=0,p,d=[];this.onStart=void 0,this.onLoad=t,this.onProgress=e,this.onError=i,this.itemStart=function(g){f++,u===!1&&s.onStart!==void 0&&s.onStart(g,c,f),u=!0},this.itemEnd=function(g){c++,s.onProgress!==void 0&&s.onProgress(g,c,f),c===f&&(u=!1,s.onLoad!==void 0&&s.onLoad())},this.itemError=function(g){s.onError!==void 0&&s.onError(g)},this.resolveURL=function(g){return p?p(g):g},this.setURLModifier=function(g){return p=g,this},this.addHandler=function(g,y){return d.push(g,y),this},this.removeHandler=function(g){let y=d.indexOf(g);return y!==-1&&d.splice(y,2),this},this.getHandler=function(g){for(let y=0,v=d.length;y<v;y+=2){let E=d[y],M=d[y+1];if(E.global&&(E.lastIndex=0),E.test(g))return M}return null}}},mY=new Hv,Wv=class{constructor(t){this.manager=t!==void 0?t:mY,this.crossOrigin="anonymous",this.withCredentials=!1,this.path="",this.resourcePath="",this.requestHeader={}}load(){}loadAsync(t,e){let i=this;return new Promise(function(s,u){i.load(t,s,e,u)})}parse(){}setCrossOrigin(t){return this.crossOrigin=t,this}setWithCredentials(t){return this.withCredentials=t,this}setPath(t){return this.path=t,this}setResourcePath(t){return this.resourcePath=t,this}setRequestHeader(t){return this.requestHeader=t,this}};Wv.DEFAULT_MATERIAL_NAME="__DEFAULT";var ad=class extends ui{constructor(){super(),this.isInstancedBufferGeometry=!0,this.type="InstancedBufferGeometry",this.instanceCount=1/0}copy(t){return super.copy(t),this.instanceCount=t.instanceCount,this}toJSON(){let t=super.toJSON();return t.instanceCount=this.instanceCount,t.isInstancedBufferGeometry=!0,t}};var Kv="\\\\[\\\\]\\\\.:\\\\/",yY=new RegExp("["+Kv+"]","g"),Qv="[^"+Kv+"]",vY="[^"+Kv.replace("\\\\.","")+"]",_Y=/((?:WC+[\\/:])*)/.source.replace("WC",Qv),xY=/(WCOD+)?/.source.replace("WCOD",vY),EY=/(?:\\.(WC+)(?:\\[(.+)\\])?)?/.source.replace("WC",Qv),SY=/\\.(WC+)(?:\\[(.+)\\])?/.source.replace("WC",Qv),wY=new RegExp("^"+_Y+xY+EY+SY+"$"),MY=["material","materials","bones","map"],Xv=class{constructor(t,e,i){let s=i||Yn.parseTrackName(e);this._targetGroup=t,this._bindings=t.subscribe_(e,s)}getValue(t,e){this.bind();let i=this._targetGroup.nCachedObjects_,s=this._bindings[i];s!==void 0&&s.getValue(t,e)}setValue(t,e){let i=this._bindings;for(let s=this._targetGroup.nCachedObjects_,u=i.length;s!==u;++s)i[s].setValue(t,e)}bind(){let t=this._bindings;for(let e=this._targetGroup.nCachedObjects_,i=t.length;e!==i;++e)t[e].bind()}unbind(){let t=this._bindings;for(let e=this._targetGroup.nCachedObjects_,i=t.length;e!==i;++e)t[e].unbind()}},Yn=class n{constructor(t,e,i){this.path=e,this.parsedPath=i||n.parseTrackName(e),this.node=n.findNode(t,this.parsedPath.nodeName),this.rootNode=t,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(t,e,i){return t&&t.isAnimationObjectGroup?new n.Composite(t,e,i):new n(t,e,i)}static sanitizeNodeName(t){return t.replace(/\\s/g,"_").replace(yY,"")}static parseTrackName(t){let e=wY.exec(t);if(e===null)throw new Error("PropertyBinding: Cannot parse trackName: "+t);let i={nodeName:e[2],objectName:e[3],objectIndex:e[4],propertyName:e[5],propertyIndex:e[6]},s=i.nodeName&&i.nodeName.lastIndexOf(".");if(s!==void 0&&s!==-1){let u=i.nodeName.substring(s+1);MY.indexOf(u)!==-1&&(i.nodeName=i.nodeName.substring(0,s),i.objectName=u)}if(i.propertyName===null||i.propertyName.length===0)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+t);return i}static findNode(t,e){if(e===void 0||e===""||e==="."||e===-1||e===t.name||e===t.uuid)return t;if(t.skeleton){let i=t.skeleton.getBoneByName(e);if(i!==void 0)return i}if(t.children){let i=function(u){for(let c=0;c<u.length;c++){let f=u[c];if(f.name===e||f.uuid===e)return f;let p=i(f.children);if(p)return p}return null},s=i(t.children);if(s)return s}return null}_getValue_unavailable(){}_setValue_unavailable(){}_getValue_direct(t,e){t[e]=this.targetObject[this.propertyName]}_getValue_array(t,e){let i=this.resolvedProperty;for(let s=0,u=i.length;s!==u;++s)t[e++]=i[s]}_getValue_arrayElement(t,e){t[e]=this.resolvedProperty[this.propertyIndex]}_getValue_toArray(t,e){this.resolvedProperty.toArray(t,e)}_setValue_direct(t,e){this.targetObject[this.propertyName]=t[e]}_setValue_direct_setNeedsUpdate(t,e){this.targetObject[this.propertyName]=t[e],this.targetObject.needsUpdate=!0}_setValue_direct_setMatrixWorldNeedsUpdate(t,e){this.targetObject[this.propertyName]=t[e],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_array(t,e){let i=this.resolvedProperty;for(let s=0,u=i.length;s!==u;++s)i[s]=t[e++]}_setValue_array_setNeedsUpdate(t,e){let i=this.resolvedProperty;for(let s=0,u=i.length;s!==u;++s)i[s]=t[e++];this.targetObject.needsUpdate=!0}_setValue_array_setMatrixWorldNeedsUpdate(t,e){let i=this.resolvedProperty;for(let s=0,u=i.length;s!==u;++s)i[s]=t[e++];this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_arrayElement(t,e){this.resolvedProperty[this.propertyIndex]=t[e]}_setValue_arrayElement_setNeedsUpdate(t,e){this.resolvedProperty[this.propertyIndex]=t[e],this.targetObject.needsUpdate=!0}_setValue_arrayElement_setMatrixWorldNeedsUpdate(t,e){this.resolvedProperty[this.propertyIndex]=t[e],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_fromArray(t,e){this.resolvedProperty.fromArray(t,e)}_setValue_fromArray_setNeedsUpdate(t,e){this.resolvedProperty.fromArray(t,e),this.targetObject.needsUpdate=!0}_setValue_fromArray_setMatrixWorldNeedsUpdate(t,e){this.resolvedProperty.fromArray(t,e),this.targetObject.matrixWorldNeedsUpdate=!0}_getValue_unbound(t,e){this.bind(),this.getValue(t,e)}_setValue_unbound(t,e){this.bind(),this.setValue(t,e)}bind(){let t=this.node,e=this.parsedPath,i=e.objectName,s=e.propertyName,u=e.propertyIndex;if(t||(t=n.findNode(this.rootNode,e.nodeName),this.node=t),this.getValue=this._getValue_unavailable,this.setValue=this._setValue_unavailable,!t){console.warn("THREE.PropertyBinding: No target node found for track: "+this.path+".");return}if(i){let d=e.objectIndex;switch(i){case"materials":if(!t.material){console.error("THREE.PropertyBinding: Can not bind to material as node does not have a material.",this);return}if(!t.material.materials){console.error("THREE.PropertyBinding: Can not bind to material.materials as node.material does not have a materials array.",this);return}t=t.material.materials;break;case"bones":if(!t.skeleton){console.error("THREE.PropertyBinding: Can not bind to bones as node does not have a skeleton.",this);return}t=t.skeleton.bones;for(let g=0;g<t.length;g++)if(t[g].name===d){d=g;break}break;case"map":if("map"in t){t=t.map;break}if(!t.material){console.error("THREE.PropertyBinding: Can not bind to material as node does not have a material.",this);return}if(!t.material.map){console.error("THREE.PropertyBinding: Can not bind to material.map as node.material does not have a map.",this);return}t=t.material.map;break;default:if(t[i]===void 0){console.error("THREE.PropertyBinding: Can not bind to objectName of node undefined.",this);return}t=t[i]}if(d!==void 0){if(t[d]===void 0){console.error("THREE.PropertyBinding: Trying to bind to objectIndex of objectName, but is undefined.",this,t);return}t=t[d]}}let c=t[s];if(c===void 0){let d=e.nodeName;console.error("THREE.PropertyBinding: Trying to update property for track: "+d+"."+s+" but it wasn't found.",t);return}let f=this.Versioning.None;this.targetObject=t,t.needsUpdate!==void 0?f=this.Versioning.NeedsUpdate:t.matrixWorldNeedsUpdate!==void 0&&(f=this.Versioning.MatrixWorldNeedsUpdate);let p=this.BindingType.Direct;if(u!==void 0){if(s==="morphTargetInfluences"){if(!t.geometry){console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.",this);return}if(!t.geometry.morphAttributes){console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphAttributes.",this);return}t.morphTargetDictionary[u]!==void 0&&(u=t.morphTargetDictionary[u])}p=this.BindingType.ArrayElement,this.resolvedProperty=c,this.propertyIndex=u}else c.fromArray!==void 0&&c.toArray!==void 0?(p=this.BindingType.HasFromToArray,this.resolvedProperty=c):Array.isArray(c)?(p=this.BindingType.EntireArray,this.resolvedProperty=c):this.propertyName=s;this.getValue=this.GetterByBindingType[p],this.setValue=this.SetterByBindingTypeAndVersioning[p][f]}unbind(){this.node=null,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}};Yn.Composite=Xv;Yn.prototype.BindingType={Direct:0,EntireArray:1,ArrayElement:2,HasFromToArray:3};Yn.prototype.Versioning={None:0,NeedsUpdate:1,MatrixWorldNeedsUpdate:2};Yn.prototype.GetterByBindingType=[Yn.prototype._getValue_direct,Yn.prototype._getValue_array,Yn.prototype._getValue_arrayElement,Yn.prototype._getValue_toArray];Yn.prototype.SetterByBindingTypeAndVersioning=[[Yn.prototype._setValue_direct,Yn.prototype._setValue_direct_setNeedsUpdate,Yn.prototype._setValue_direct_setMatrixWorldNeedsUpdate],[Yn.prototype._setValue_array,Yn.prototype._setValue_array_setNeedsUpdate,Yn.prototype._setValue_array_setMatrixWorldNeedsUpdate],[Yn.prototype._setValue_arrayElement,Yn.prototype._setValue_arrayElement_setNeedsUpdate,Yn.prototype._setValue_arrayElement_setMatrixWorldNeedsUpdate],[Yn.prototype._setValue_fromArray,Yn.prototype._setValue_fromArray_setNeedsUpdate,Yn.prototype._setValue_fromArray_setMatrixWorldNeedsUpdate]];var Mot=new Float32Array(1);var vf=class extends hf{constructor(t,e,i=1){super(t,e),this.isInstancedInterleavedBuffer=!0,this.meshPerAttribute=i}copy(t){return super.copy(t),this.meshPerAttribute=t.meshPerAttribute,this}clone(t){let e=super.clone(t);return e.meshPerAttribute=this.meshPerAttribute,e}toJSON(t){let e=super.toJSON(t);return e.isInstancedInterleavedBuffer=!0,e.meshPerAttribute=this.meshPerAttribute,e}};typeof __THREE_DEVTOOLS__!="undefined"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:Yv}}));typeof window!="undefined"&&(window.__THREE__?console.warn("WARNING: Multiple instances of Three.js being imported."):window.__THREE__=Yv);function hd(n,t){t===void 0&&(t=[]);let e=new Nl(n.map(i=>new Ot(...i)));return t.length&&t.forEach(i=>{var s=new Ll(i.map(u=>new Ot(...u)));e.holes.push(s)}),e}var MAt=jt(Yu(),1);var Ur=63710088e-1,kot={centimeters:Ur*100,centimetres:Ur*100,degrees:Ur/111325,feet:Ur*3.28084,inches:Ur*39.37,kilometers:Ur/1e3,kilometres:Ur/1e3,meters:Ur,metres:Ur,miles:Ur/1609.344,millimeters:Ur*1e3,millimetres:Ur*1e3,nauticalmiles:Ur/1852,radians:1,yards:Ur*1.0936},qot={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/Ur,yards:1.0936133};function Ai(n,t,e){e===void 0&&(e={});var i={type:"Feature"};return(e.id===0||e.id)&&(i.id=e.id),e.bbox&&(i.bbox=e.bbox),i.properties=t||{},i.geometry=n,i}function Dn(n,t,e){if(e===void 0&&(e={}),!n)throw new Error("coordinates is required");if(!Array.isArray(n))throw new Error("coordinates must be an Array");if(n.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!es(n[0])||!es(n[1]))throw new Error("coordinates must contain numbers");var i={type:"Point",coordinates:n};return Ai(i,t,e)}function Un(n,t,e){e===void 0&&(e={});for(var i=0,s=n;i<s.length;i++){var u=s[i];if(u.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");for(var c=0;c<u[u.length-1].length;c++)if(u[u.length-1][c]!==u[0][c])throw new Error("First and last Position are not equivalent.")}var f={type:"Polygon",coordinates:n};return Ai(f,t,e)}function Br(n,t,e){if(e===void 0&&(e={}),n.length<2)throw new Error("coordinates must be an array of two or more positions");var i={type:"LineString",coordinates:n};return Ai(i,t,e)}function u_(n,t,e){e===void 0&&(e={});var i={type:"MultiPoint",coordinates:n};return Ai(i,t,e)}function es(n){return!isNaN(n)&&n!==null&&!Array.isArray(n)}function Sr(n,t,e){if(n!==null)for(var i,s,u,c,f,p,d,g=0,y=0,v,E=n.type,M=E==="FeatureCollection",A=E==="Feature",_=M?n.features.length:1,x=0;x<_;x++){d=M?n.features[x].geometry:A?n.geometry:n,v=d?d.type==="GeometryCollection":!1,f=v?d.geometries.length:1;for(var T=0;T<f;T++){var w=0,R=0;if(c=v?d.geometries[T]:d,c!==null){p=c.coordinates;var z=c.type;switch(g=e&&(z==="Polygon"||z==="MultiPolygon")?1:0,z){case null:break;case"Point":if(t(p,y,x,w,R)===!1)return!1;y++,w++;break;case"LineString":case"MultiPoint":for(i=0;i<p.length;i++){if(t(p[i],y,x,w,R)===!1)return!1;y++,z==="MultiPoint"&&w++}z==="LineString"&&w++;break;case"Polygon":case"MultiLineString":for(i=0;i<p.length;i++){for(s=0;s<p[i].length-g;s++){if(t(p[i][s],y,x,w,R)===!1)return!1;y++}z==="MultiLineString"&&w++,z==="Polygon"&&R++}z==="Polygon"&&w++;break;case"MultiPolygon":for(i=0;i<p.length;i++){for(R=0,s=0;s<p[i].length;s++){for(u=0;u<p[i][s].length-g;u++){if(t(p[i][s][u],y,x,w,R)===!1)return!1;y++}R++}w++}break;case"GeometryCollection":for(i=0;i<c.geometries.length;i++)if(Sr(c.geometries[i],t,e)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function TP(n,t,e,i){var s=e;return Sr(n,function(u,c,f,p,d){c===0&&e===void 0?s=u:s=t(s,u,c,f,p,d)},i),s}function Ea(n,t){var e,i,s,u,c,f,p,d,g,y,v=0,E=n.type==="FeatureCollection",M=n.type==="Feature",A=E?n.features.length:1;for(e=0;e<A;e++){for(f=E?n.features[e].geometry:M?n.geometry:n,d=E?n.features[e].properties:M?n.properties:{},g=E?n.features[e].bbox:M?n.bbox:void 0,y=E?n.features[e].id:M?n.id:void 0,p=f?f.type==="GeometryCollection":!1,c=p?f.geometries.length:1,s=0;s<c;s++){if(u=p?f.geometries[s]:f,u===null){if(t(null,v,d,g,y)===!1)return!1;continue}switch(u.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":{if(t(u,v,d,g,y)===!1)return!1;break}case"GeometryCollection":{for(i=0;i<u.geometries.length;i++)if(t(u.geometries[i],v,d,g,y)===!1)return!1;break}default:throw new Error("Unknown Geometry Type")}}v++}}function Ji(n,t){Ea(n,function(e,i,s,u,c){var f=e===null?null:e.type;switch(f){case null:case"Point":case"LineString":case"Polygon":return t(Ai(e,s,{bbox:u,id:c}),i,0)===!1?!1:void 0}var p;switch(f){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],y={type:p,coordinates:g};if(t(Ai(y,s),i,d)===!1)return!1}})}function l_(n){var t=[1/0,1/0,-1/0,-1/0];return Sr(n,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}l_.default=l_;var li=l_;function $r(n){if(!n)throw new Error("coord is required");if(!Array.isArray(n)){if(n.type==="Feature"&&n.geometry!==null&&n.geometry.type==="Point")return n.geometry.coordinates;if(n.type==="Point")return n.coordinates}if(Array.isArray(n)&&n.length>=2&&!Array.isArray(n[0])&&!Array.isArray(n[1]))return n;throw new Error("coord must be GeoJSON Point or an Array of numbers")}function c_(n,t,e){if(!n)throw new Error("No feature passed");if(!e)throw new Error(".featureOf() requires a name");if(!n||n.type!=="Feature"||!n.geometry)throw new Error("Invalid input to "+e+", Feature with geometry required");if(!n.geometry||n.geometry.type!==t)throw new Error("Invalid input to "+e+": must be a "+t+", given "+n.geometry.type)}function Zr(n){return n.type==="Feature"?n.geometry:n}var i$=jt(md(),1);var d$=jt(WP(),1);function zr(n,t,e){if(e===void 0&&(e={}),!n)throw new Error("point is required");if(!t)throw new Error("polygon is required");var i=$r(n),s=Zr(t),u=s.type,c=t.bbox,f=s.coordinates;if(c&&g$(i,c)===!1)return!1;u==="Polygon"&&(f=[f]);for(var p=!1,d=0;d<f.length&&!p;d++)if(XP(i,f[d][0],e.ignoreBoundary)){for(var g=!1,y=1;y<f[d].length&&!g;)XP(i,f[d][y],!e.ignoreBoundary)&&(g=!0),y++;g||(p=!0)}return p}function XP(n,t,e){var i=!1;t[0][0]===t[t.length-1][0]&&t[0][1]===t[t.length-1][1]&&(t=t.slice(0,t.length-1));for(var s=0,u=t.length-1;s<t.length;u=s++){var c=t[s][0],f=t[s][1],p=t[u][0],d=t[u][1],g=n[1]*(c-p)+f*(p-n[0])+d*(n[0]-c)===0&&(c-n[0])*(p-n[0])<=0&&(f-n[1])*(d-n[1])<=0;if(g)return!e;var y=f>n[1]!=d>n[1]&&n[0]<(p-c)*(n[1]-f)/(d-f)+c;y&&(i=!i)}return i}function g$(n,t){return t[0]<=n[0]&&t[1]<=n[1]&&t[2]>=n[0]&&t[3]>=n[1]}var ZP=new ArrayBuffer(16),yat=new Float64Array(ZP),vat=new Uint32Array(ZP);var P$=jt(A_(),1);var Hut=function(){function n(t){this.points=t.points||[],this.duration=t.duration||1e4,this.sharpness=t.sharpness||.85,this.centers=[],this.controls=[],this.stepLength=t.stepLength||60,this.length=this.points.length,this.delay=0;for(var e=0;e<this.length;e++)this.points[e].z=this.points[e].z||0;for(var e=0;e<this.length-1;e++){var i=this.points[e],s=this.points[e+1];this.centers.push({x:(i.x+s.x)/2,y:(i.y+s.y)/2,z:(i.z+s.z)/2})}this.controls.push([this.points[0],this.points[0]]);for(var e=0;e<this.centers.length-1;e++){var u=this.points[e+1].x-(this.centers[e].x+this.centers[e+1].x)/2,c=this.points[e+1].y-(this.centers[e].y+this.centers[e+1].y)/2,f=this.points[e+1].z-(this.centers[e].y+this.centers[e+1].z)/2;this.controls.push([{x:(1-this.sharpness)*this.points[e+1].x+this.sharpness*(this.centers[e].x+u),y:(1-this.sharpness)*this.points[e+1].y+this.sharpness*(this.centers[e].y+c),z:(1-this.sharpness)*this.points[e+1].z+this.sharpness*(this.centers[e].z+f)},{x:(1-this.sharpness)*this.points[e+1].x+this.sharpness*(this.centers[e+1].x+u),y:(1-this.sharpness)*this.points[e+1].y+this.sharpness*(this.centers[e+1].y+c),z:(1-this.sharpness)*this.points[e+1].z+this.sharpness*(this.centers[e+1].z+f)}])}return this.controls.push([this.points[this.length-1],this.points[this.length-1]]),this.steps=this.cacheSteps(this.stepLength),this}return n.prototype.cacheSteps=function(t){var e=[],i=this.pos(0);e.push(0);for(var s=0;s<this.duration;s+=10){var u=this.pos(s),c=Math.sqrt((u.x-i.x)*(u.x-i.x)+(u.y-i.y)*(u.y-i.y)+(u.z-i.z)*(u.z-i.z));c>t&&(e.push(s),i=u)}return e},n.prototype.vector=function(t){var e=this.pos(t+10),i=this.pos(t-10);return{angle:180*Math.atan2(e.y-i.y,e.x-i.x)/3.14,speed:Math.sqrt((i.x-e.x)*(i.x-e.x)+(i.y-e.y)*(i.y-e.y)+(i.z-e.z)*(i.z-e.z))}},n.prototype.pos=function(t){var e=t-this.delay;e<0&&(e=0),e>this.duration&&(e=this.duration-1);var i=e/this.duration;if(i>=1)return this.points[this.length-1];var s=Math.floor((this.points.length-1)*i),u=(this.length-1)*i-s;return R$(u,this.points[s],this.controls[s][1],this.controls[s+1][0],this.points[s+1])},n}();function R$(n,t,e,i,s){var u=L$(n),c={x:s.x*u[0]+i.x*u[1]+e.x*u[2]+t.x*u[3],y:s.y*u[0]+i.y*u[1]+e.y*u[2]+t.y*u[3],z:s.z*u[0]+i.z*u[1]+e.z*u[2]+t.z*u[3]};return c}function L$(n){var t=n*n,e=t*n;return[e,3*t*(1-n),3*n*(1-n)*(1-n),(1-n)*(1-n)*(1-n)]}function Sf(n,t){t===void 0&&(t={});var e=Number(n[0]),i=Number(n[1]),s=Number(n[2]),u=Number(n[3]);if(n.length===6)throw new Error("@turf/bbox-polygon does not support BBox with 6 positions");var c=[e,i],f=[e,u],p=[s,u],d=[s,i];return Un([[c,d,p,f,c]],t.properties,{bbox:n,id:t.id})}function N$(n){return Sf(li(n))}var T_=N$;function O$(n,t){t===void 0&&(t={});var e=li(n),i=(e[0]+e[2])/2,s=(e[1]+e[3])/2;return Dn([i,s],t.properties,t)}var du=O$;var j$=jt(sR(),1);var MZ=jt(Nd(),1);var AZ=jt(md(),1);var IZ=jt(A_(),1);var MR=Math.PI/180,bR=180/Math.PI,If=function(n,t){this.lon=n,this.lat=t,this.x=MR*n,this.y=MR*t};If.prototype.view=function(){return String(this.lon).slice(0,4)+","+String(this.lat).slice(0,4)};If.prototype.antipode=function(){var n=-1*this.lat,t=this.lon<0?180+this.lon:(180-this.lon)*-1;return new If(t,n)};var AR=function(){this.coords=[],this.length=0};AR.prototype.move_to=function(n){this.length++,this.coords.push(n)};var Y_=function(n){this.properties=n||{},this.geometries=[]};Y_.prototype.json=function(){if(this.geometries.length<=0)return{geometry:{type:"LineString",coordinates:null},type:"Feature",properties:this.properties};if(this.geometries.length===1)return{geometry:{type:"LineString",coordinates:this.geometries[0].coords},type:"Feature",properties:this.properties};for(var n=[],t=0;t<this.geometries.length;t++)n.push(this.geometries[t].coords);return{geometry:{type:"MultiLineString",coordinates:n},type:"Feature",properties:this.properties}};Y_.prototype.wkt=function(){for(var n="",t="LINESTRING(",e=function(u){t+=u[0]+" "+u[1]+","},i=0;i<this.geometries.length;i++){if(this.geometries[i].coords.length===0)return"LINESTRING(empty)";var s=this.geometries[i].coords;s.forEach(e),n+=t.substring(0,t.length-1)+")"}return n};var TR=function(n,t,e){if(!n||n.x===void 0||n.y===void 0)throw new Error("GreatCircle constructor expects two args: start and end objects with x and y properties");if(!t||t.x===void 0||t.y===void 0)throw new Error("GreatCircle constructor expects two args: start and end objects with x and y properties");this.start=new If(n.x,n.y),this.end=new If(t.x,t.y),this.properties=e||{};var i=this.start.x-this.end.x,s=this.start.y-this.end.y,u=Math.pow(Math.sin(s/2),2)+Math.cos(this.start.y)*Math.cos(this.end.y)*Math.pow(Math.sin(i/2),2);if(this.g=2*Math.asin(Math.sqrt(u)),this.g===Math.PI)throw new Error("it appears "+n.view()+" and "+t.view()+" are 'antipodal', e.g diametrically opposite, thus there is no single route but rather infinite");if(isNaN(this.g))throw new Error("could not calculate great circle between "+n+" and "+t)};TR.prototype.interpolate=function(n){var t=Math.sin((1-n)*this.g)/Math.sin(this.g),e=Math.sin(n*this.g)/Math.sin(this.g),i=t*Math.cos(this.start.y)*Math.cos(this.start.x)+e*Math.cos(this.end.y)*Math.cos(this.end.x),s=t*Math.cos(this.start.y)*Math.sin(this.start.x)+e*Math.cos(this.end.y)*Math.sin(this.end.x),u=t*Math.sin(this.start.y)+e*Math.sin(this.end.y),c=bR*Math.atan2(u,Math.sqrt(Math.pow(i,2)+Math.pow(s,2))),f=bR*Math.atan2(s,i);return[f,c]};TR.prototype.Arc=function(n,t){var e=[];if(!n||n<=2)e.push([this.start.lon,this.start.lat]),e.push([this.end.lon,this.end.lat]);else for(var i=1/(n-1),s=0;s<n;++s){var u=i*s,c=this.interpolate(u);e.push(c)}for(var f=!1,p=0,d=t&&t.offset?t.offset:10,g=180-d,y=-180+d,v=360-d,E=1;E<e.length;++E){var M=e[E-1][0],A=e[E][0],_=Math.abs(A-M);_>v&&(A>g&&M<y||M>g&&A<y)?f=!0:_>p&&(p=_)}var x=[];if(f&&p<d){var T=[];x.push(T);for(var w=0;w<e.length;++w){var R=parseFloat(e[w][0]);if(w>0&&Math.abs(R-e[w-1][0])>v){var z=parseFloat(e[w-1][0]),U=parseFloat(e[w-1][1]),D=parseFloat(e[w][0]),P=parseFloat(e[w][1]);if(z>-180&&z<y&&D===180&&w+1<e.length&&e[w-1][0]>-180&&e[w-1][0]<y){T.push([-180,e[w][1]]),w++,T.push([e[w][0],e[w][1]]);continue}else if(z>g&&z<180&&D===-180&&w+1<e.length&&e[w-1][0]>g&&e[w-1][0]<180){T.push([180,e[w][1]]),w++,T.push([e[w][0],e[w][1]]);continue}if(z<y&&D>g){var ct=z;z=D,D=ct;var L=U;U=P,P=L}if(z>g&&D<y&&(D+=360),z<=180&&D>=180&&z<D){var W=(180-z)/(D-z),V=W*P+(1-W)*U;T.push([e[w-1][0]>g?180:-180,V]),T=[],T.push([e[w-1][0]>g?-180:180,V]),x.push(T)}else T=[],x.push(T);T.push([R,e[w][1]])}else T.push([e[w][0],e[w][1]])}}else{var Mt=[];x.push(Mt);for(var $=0;$<e.length;++$)Mt.push([e[$][0],e[$][1]])}for(var gt=new Y_(this.properties),ft=0;ft<x.length;++ft){var vt=new AR;gt.geometries.push(vt);for(var it=x[ft],lt=0;lt<it.length;++lt)vt.move_to(it[lt])}return gt};var LZ=jt(Nd(),1);var Rj=jt(Nd(),1);var Lj=jt(Ex(),1);var Dj=jt(md(),1);var Ce=[],Ie=[],Pe=[],Re=[],Le=[],Ne=[],Oe=[],De=[],Fe=[],Ue=[],Be=[],ze=[],Ge=[],ke=[],qe=[],Ve=[],He=[],We=[],Xe=[],Ye=[],$e=[],Ze=[],Je=[],je=[];Oe[85]=Ue[85]=-1;De[85]=Be[85]=0;Fe[85]=ze[85]=1;Xe[85]=Ze[85]=1;Ye[85]=Je[85]=0;$e[85]=je[85]=1;Ce[85]=Re[85]=0;Ie[85]=Le[85]=-1;Pe[85]=qe[85]=0;Ve[85]=Ge[85]=0;He[85]=ke[85]=1;Ne[85]=We[85]=1;Ze[1]=Ze[169]=0;Je[1]=Je[169]=-1;je[1]=je[169]=0;Ge[1]=Ge[169]=-1;ke[1]=ke[169]=0;qe[1]=qe[169]=0;Ue[4]=Ue[166]=0;Be[4]=Be[166]=-1;ze[4]=ze[166]=1;Ve[4]=Ve[166]=1;He[4]=He[166]=0;We[4]=We[166]=0;Oe[16]=Oe[154]=0;De[16]=De[154]=1;Fe[16]=Fe[154]=1;Re[16]=Re[154]=1;Le[16]=Le[154]=0;Ne[16]=Ne[154]=1;Xe[64]=Xe[106]=0;Ye[64]=Ye[106]=1;$e[64]=$e[106]=0;Ce[64]=Ce[106]=-1;Ie[64]=Ie[106]=0;Pe[64]=Pe[106]=1;Xe[2]=Xe[168]=0;Ye[2]=Ye[168]=-1;$e[2]=$e[168]=1;Ze[2]=Ze[168]=0;Je[2]=Je[168]=-1;je[2]=je[168]=0;Ge[2]=Ge[168]=-1;ke[2]=ke[168]=0;qe[2]=qe[168]=0;Ve[2]=Ve[168]=-1;He[2]=He[168]=0;We[2]=We[168]=1;Oe[8]=Oe[162]=0;De[8]=De[162]=-1;Fe[8]=Fe[162]=0;Ue[8]=Ue[162]=0;Be[8]=Be[162]=-1;ze[8]=ze[162]=1;Ge[8]=Ge[162]=1;ke[8]=ke[162]=0;qe[8]=qe[162]=1;Ve[8]=Ve[162]=1;He[8]=He[162]=0;We[8]=We[162]=0;Oe[32]=Oe[138]=0;De[32]=De[138]=1;Fe[32]=Fe[138]=1;Ue[32]=Ue[138]=0;Be[32]=Be[138]=1;ze[32]=ze[138]=0;Ce[32]=Ce[138]=1;Ie[32]=Ie[138]=0;Pe[32]=Pe[138]=0;Re[32]=Re[138]=1;Le[32]=Le[138]=0;Ne[32]=Ne[138]=1;Ze[128]=Ze[42]=0;Je[128]=Je[42]=1;je[128]=je[42]=1;Xe[128]=Xe[42]=0;Ye[128]=Ye[42]=1;$e[128]=$e[42]=0;Ce[128]=Ce[42]=-1;Ie[128]=Ie[42]=0;Pe[128]=Pe[42]=1;Re[128]=Re[42]=-1;Le[128]=Le[42]=0;Ne[128]=Ne[42]=0;Ue[5]=Ue[165]=-1;Be[5]=Be[165]=0;ze[5]=ze[165]=0;Ze[5]=Ze[165]=1;Je[5]=Je[165]=0;je[5]=je[165]=0;Ve[20]=Ve[150]=0;He[20]=He[150]=1;We[20]=We[150]=1;Re[20]=Re[150]=0;Le[20]=Le[150]=-1;Ne[20]=Ne[150]=1;Oe[80]=Oe[90]=-1;De[80]=De[90]=0;Fe[80]=Fe[90]=1;Xe[80]=Xe[90]=1;Ye[80]=Ye[90]=0;$e[80]=$e[90]=1;Ge[65]=Ge[105]=0;ke[65]=ke[105]=1;qe[65]=qe[105]=0;Ce[65]=Ce[105]=0;Ie[65]=Ie[105]=-1;Pe[65]=Pe[105]=0;Oe[160]=Oe[10]=-1;De[160]=De[10]=0;Fe[160]=Fe[10]=1;Ue[160]=Ue[10]=-1;Be[160]=Be[10]=0;ze[160]=ze[10]=0;Ze[160]=Ze[10]=1;Je[160]=Je[10]=0;je[160]=je[10]=0;Xe[160]=Xe[10]=1;Ye[160]=Ye[10]=0;$e[160]=$e[10]=1;Ve[130]=Ve[40]=0;He[130]=He[40]=1;We[130]=We[40]=1;Ge[130]=Ge[40]=0;ke[130]=ke[40]=1;qe[130]=qe[40]=0;Ce[130]=Ce[40]=0;Ie[130]=Ie[40]=-1;Pe[130]=Pe[40]=0;Re[130]=Re[40]=0;Le[130]=Le[40]=-1;Ne[130]=Ne[40]=1;Ue[37]=Ue[133]=0;Be[37]=Be[133]=1;ze[37]=ze[133]=1;Ze[37]=Ze[133]=0;Je[37]=Je[133]=1;je[37]=je[133]=0;Ce[37]=Ce[133]=-1;Ie[37]=Ie[133]=0;Pe[37]=Pe[133]=0;Re[37]=Re[133]=1;Le[37]=Le[133]=0;Ne[37]=Ne[133]=0;Ve[148]=Ve[22]=-1;He[148]=He[22]=0;We[148]=We[22]=0;Ze[148]=Ze[22]=0;Je[148]=Je[22]=-1;je[148]=je[22]=1;Xe[148]=Xe[22]=0;Ye[148]=Ye[22]=1;$e[148]=$e[22]=1;Re[148]=Re[22]=-1;Le[148]=Le[22]=0;Ne[148]=Ne[22]=1;Oe[82]=Oe[88]=0;De[82]=De[88]=-1;Fe[82]=Fe[88]=1;Ve[82]=Ve[88]=1;He[82]=He[88]=0;We[82]=We[88]=1;Ge[82]=Ge[88]=-1;ke[82]=ke[88]=0;qe[82]=qe[88]=1;Xe[82]=Xe[88]=0;Ye[82]=Ye[88]=-1;$e[82]=$e[88]=0;Oe[73]=Oe[97]=0;De[73]=De[97]=1;Fe[73]=Fe[97]=0;Ue[73]=Ue[97]=0;Be[73]=Be[97]=-1;ze[73]=ze[97]=0;Ge[73]=Ge[97]=1;ke[73]=ke[97]=0;qe[73]=qe[97]=0;Ce[73]=Ce[97]=1;Ie[73]=Ie[97]=0;Pe[73]=Pe[97]=1;Oe[145]=Oe[25]=0;De[145]=De[25]=-1;Fe[145]=Fe[25]=0;Ge[145]=Ge[25]=1;ke[145]=ke[25]=0;qe[145]=qe[25]=1;Ze[145]=Ze[25]=0;Je[145]=Je[25]=1;je[145]=je[25]=1;Re[145]=Re[25]=-1;Le[145]=Le[25]=0;Ne[145]=Ne[25]=0;Ue[70]=Ue[100]=0;Be[70]=Be[100]=1;ze[70]=ze[100]=0;Ve[70]=Ve[100]=-1;He[70]=He[100]=0;We[70]=We[100]=1;Xe[70]=Xe[100]=0;Ye[70]=Ye[100]=-1;$e[70]=$e[100]=1;Ce[70]=Ce[100]=1;Ie[70]=Ie[100]=0;Pe[70]=Pe[100]=0;Ue[101]=Ue[69]=0;Be[101]=Be[69]=1;ze[101]=ze[69]=0;Ce[101]=Ce[69]=1;Ie[101]=Ie[69]=0;Pe[101]=Pe[69]=0;Ze[149]=Ze[21]=0;Je[149]=Je[21]=1;je[149]=je[21]=1;Re[149]=Re[21]=-1;Le[149]=Le[21]=0;Ne[149]=Ne[21]=0;Ve[86]=Ve[84]=-1;He[86]=He[84]=0;We[86]=We[84]=1;Xe[86]=Xe[84]=0;Ye[86]=Ye[84]=-1;$e[86]=$e[84]=1;Oe[89]=Oe[81]=0;De[89]=De[81]=-1;Fe[89]=Fe[81]=0;Ge[89]=Ge[81]=1;ke[89]=ke[81]=0;qe[89]=qe[81]=1;Oe[96]=Oe[74]=0;De[96]=De[74]=1;Fe[96]=Fe[74]=0;Ue[96]=Ue[74]=-1;Be[96]=Be[74]=0;ze[96]=ze[74]=1;Xe[96]=Xe[74]=1;Ye[96]=Ye[74]=0;$e[96]=$e[74]=0;Ce[96]=Ce[74]=1;Ie[96]=Ie[74]=0;Pe[96]=Pe[74]=1;Oe[24]=Oe[146]=0;De[24]=De[146]=-1;Fe[24]=Fe[146]=1;Ve[24]=Ve[146]=1;He[24]=He[146]=0;We[24]=We[146]=1;Ge[24]=Ge[146]=0;ke[24]=ke[146]=1;qe[24]=qe[146]=1;Re[24]=Re[146]=0;Le[24]=Le[146]=-1;Ne[24]=Ne[146]=0;Ue[6]=Ue[164]=-1;Be[6]=Be[164]=0;ze[6]=ze[164]=1;Ve[6]=Ve[164]=-1;He[6]=He[164]=0;We[6]=We[164]=0;Ze[6]=Ze[164]=0;Je[6]=Je[164]=-1;je[6]=je[164]=1;Xe[6]=Xe[164]=1;Ye[6]=Ye[164]=0;$e[6]=$e[164]=0;Ge[129]=Ge[41]=0;ke[129]=ke[41]=1;qe[129]=qe[41]=1;Ze[129]=Ze[41]=0;Je[129]=Je[41]=1;je[129]=je[41]=0;Ce[129]=Ce[41]=-1;Ie[129]=Ie[41]=0;Pe[129]=Pe[41]=0;Re[129]=Re[41]=0;Le[129]=Le[41]=-1;Ne[129]=Ne[41]=0;Ve[66]=Ve[104]=0;He[66]=He[104]=1;We[66]=We[104]=0;Ge[66]=Ge[104]=-1;ke[66]=ke[104]=0;qe[66]=qe[104]=1;Xe[66]=Xe[104]=0;Ye[66]=Ye[104]=-1;$e[66]=$e[104]=0;Ce[66]=Ce[104]=0;Ie[66]=Ie[104]=-1;Pe[66]=Pe[104]=1;Oe[144]=Oe[26]=-1;De[144]=De[26]=0;Fe[144]=Fe[26]=0;Ze[144]=Ze[26]=1;Je[144]=Je[26]=0;je[144]=je[26]=1;Xe[144]=Xe[26]=0;Ye[144]=Ye[26]=1;$e[144]=$e[26]=1;Re[144]=Re[26]=-1;Le[144]=Le[26]=0;Ne[144]=Ne[26]=1;Ue[36]=Ue[134]=0;Be[36]=Be[134]=1;ze[36]=ze[134]=1;Ve[36]=Ve[134]=0;He[36]=He[134]=1;We[36]=We[134]=0;Ce[36]=Ce[134]=0;Ie[36]=Ie[134]=-1;Pe[36]=Pe[134]=1;Re[36]=Re[134]=1;Le[36]=Le[134]=0;Ne[36]=Ne[134]=0;Oe[9]=Oe[161]=-1;De[9]=De[161]=0;Fe[9]=Fe[161]=0;Ue[9]=Ue[161]=0;Be[9]=Be[161]=-1;ze[9]=ze[161]=0;Ge[9]=Ge[161]=1;ke[9]=ke[161]=0;qe[9]=qe[161]=0;Ze[9]=Ze[161]=1;Je[9]=Je[161]=0;je[9]=je[161]=1;Oe[136]=0;De[136]=1;Fe[136]=1;Ue[136]=0;Be[136]=1;ze[136]=0;Ve[136]=-1;He[136]=0;We[136]=1;Ge[136]=-1;ke[136]=0;qe[136]=0;Ze[136]=0;Je[136]=-1;je[136]=0;Xe[136]=0;Ye[136]=-1;$e[136]=1;Ce[136]=1;Ie[136]=0;Pe[136]=0;Re[136]=1;Le[136]=0;Ne[136]=1;Oe[34]=0;De[34]=-1;Fe[34]=0;Ue[34]=0;Be[34]=-1;ze[34]=1;Ve[34]=1;He[34]=0;We[34]=0;Ge[34]=1;ke[34]=0;qe[34]=1;Ze[34]=0;Je[34]=1;je[34]=1;Xe[34]=0;Ye[34]=1;$e[34]=0;Ce[34]=-1;Ie[34]=0;Pe[34]=1;Re[34]=-1;Le[34]=0;Ne[34]=0;Oe[35]=0;De[35]=1;Fe[35]=1;Ue[35]=0;Be[35]=-1;ze[35]=1;Ve[35]=1;He[35]=0;We[35]=0;Ge[35]=-1;ke[35]=0;qe[35]=0;Ze[35]=0;Je[35]=-1;je[35]=0;Xe[35]=0;Ye[35]=1;$e[35]=0;Ce[35]=-1;Ie[35]=0;Pe[35]=1;Re[35]=1;Le[35]=0;Ne[35]=1;Oe[153]=0;De[153]=1;Fe[153]=1;Ge[153]=-1;ke[153]=0;qe[153]=0;Ze[153]=0;Je[153]=-1;je[153]=0;Re[153]=1;Le[153]=0;Ne[153]=1;Ue[102]=0;Be[102]=-1;ze[102]=1;Ve[102]=1;He[102]=0;We[102]=0;Xe[102]=0;Ye[102]=1;$e[102]=0;Ce[102]=-1;Ie[102]=0;Pe[102]=1;Oe[155]=0;De[155]=-1;Fe[155]=0;Ge[155]=1;ke[155]=0;qe[155]=1;Ze[155]=0;Je[155]=1;je[155]=1;Re[155]=-1;Le[155]=0;Ne[155]=0;Ue[103]=0;Be[103]=1;ze[103]=0;Ve[103]=-1;He[103]=0;We[103]=1;Xe[103]=0;Ye[103]=-1;$e[103]=1;Ce[103]=1;Ie[103]=0;Pe[103]=0;Oe[152]=0;De[152]=1;Fe[152]=1;Ve[152]=-1;He[152]=0;We[152]=1;Ge[152]=-1;ke[152]=0;qe[152]=0;Ze[152]=0;Je[152]=-1;je[152]=0;Xe[152]=0;Ye[152]=-1;$e[152]=1;Re[152]=1;Le[152]=0;Ne[152]=1;Oe[156]=0;De[156]=-1;Fe[156]=1;Ve[156]=1;He[156]=0;We[156]=1;Ge[156]=-1;ke[156]=0;qe[156]=0;Ze[156]=0;Je[156]=-1;je[156]=0;Xe[156]=0;Ye[156]=1;$e[156]=1;Re[156]=-1;Le[156]=0;Ne[156]=1;Oe[137]=0;De[137]=1;Fe[137]=1;Ue[137]=0;Be[137]=1;ze[137]=0;Ge[137]=-1;ke[137]=0;qe[137]=0;Ze[137]=0;Je[137]=-1;je[137]=0;Ce[137]=1;Ie[137]=0;Pe[137]=0;Re[137]=1;Le[137]=0;Ne[137]=1;Oe[139]=0;De[139]=1;Fe[139]=1;Ue[139]=0;Be[139]=-1;ze[139]=0;Ge[139]=1;ke[139]=0;qe[139]=0;Ze[139]=0;Je[139]=1;je[139]=0;Ce[139]=-1;Ie[139]=0;Pe[139]=0;Re[139]=1;Le[139]=0;Ne[139]=1;Oe[98]=0;De[98]=-1;Fe[98]=0;Ue[98]=0;Be[98]=-1;ze[98]=1;Ve[98]=1;He[98]=0;We[98]=0;Ge[98]=1;ke[98]=0;qe[98]=1;Xe[98]=0;Ye[98]=1;$e[98]=0;Ce[98]=-1;Ie[98]=0;Pe[98]=1;Oe[99]=0;De[99]=1;Fe[99]=0;Ue[99]=0;Be[99]=-1;ze[99]=1;Ve[99]=1;He[99]=0;We[99]=0;Ge[99]=-1;ke[99]=0;qe[99]=1;Xe[99]=0;Ye[99]=-1;$e[99]=0;Ce[99]=1;Ie[99]=0;Pe[99]=1;Ue[38]=0;Be[38]=-1;ze[38]=1;Ve[38]=1;He[38]=0;We[38]=0;Ze[38]=0;Je[38]=1;je[38]=1;Xe[38]=0;Ye[38]=1;$e[38]=0;Ce[38]=-1;Ie[38]=0;Pe[38]=1;Re[38]=-1;Le[38]=0;Ne[38]=0;Ue[39]=0;Be[39]=1;ze[39]=1;Ve[39]=-1;He[39]=0;We[39]=0;Ze[39]=0;Je[39]=-1;je[39]=1;Xe[39]=0;Ye[39]=1;$e[39]=0;Ce[39]=-1;Ie[39]=0;Pe[39]=1;Re[39]=1;Le[39]=0;Ne[39]=0;var Sx=function(n){return[[n.bottomleft,0],[0,0],[0,n.leftbottom]]},wx=function(n){return[[1,n.rightbottom],[1,0],[n.bottomright,0]]},Mx=function(n){return[[n.topright,1],[1,1],[1,n.righttop]]},bx=function(n){return[[0,n.lefttop],[0,1],[n.topleft,1]]},Ax=function(n){return[[n.bottomright,0],[n.bottomleft,0],[0,n.leftbottom],[0,n.lefttop]]},Tx=function(n){return[[n.bottomright,0],[n.bottomleft,0],[1,n.righttop],[1,n.rightbottom]]},Cx=function(n){return[[1,n.righttop],[1,n.rightbottom],[n.topleft,1],[n.topright,1]]},Ix=function(n){return[[0,n.leftbottom],[0,n.lefttop],[n.topleft,1],[n.topright,1]]},Fj=function(n){return[[0,0],[0,n.leftbottom],[1,n.rightbottom],[1,0]]},Uj=function(n){return[[1,0],[n.bottomright,0],[n.topright,1],[1,1]]},Bj=function(n){return[[1,1],[1,n.righttop],[0,n.lefttop],[0,1]]},zj=function(n){return[[n.bottomleft,0],[0,0],[0,1],[n.topleft,1]]},Gj=function(n){return[[1,n.righttop],[1,n.rightbottom],[0,n.leftbottom],[0,n.lefttop]]},kj=function(n){return[[n.topleft,1],[n.topright,1],[n.bottomright,0],[n.bottomleft,0]]},qj=function(){return[[0,0],[0,1],[1,1],[1,0]]},Vj=function(n){return[[1,n.rightbottom],[1,0],[0,0],[0,1],[n.topleft,1]]},Hj=function(n){return[[n.topright,1],[1,1],[1,0],[0,0],[0,n.leftbottom]]},Wj=function(n){return[[1,0],[n.bottomright,0],[0,n.lefttop],[0,1],[1,1]]},Xj=function(n){return[[1,1],[1,n.righttop],[n.bottomleft,0],[0,0],[0,1]]},Yj=function(n){return[[1,n.righttop],[1,n.rightbottom],[0,n.lefttop],[0,1],[n.topleft,1]]},$j=function(n){return[[1,1],[1,n.righttop],[n.bottomright,0],[n.bottomleft,0],[n.topright,1]]},Zj=function(n){return[[1,n.rightbottom],[1,0],[n.bottomright,0],[0,n.leftbottom],[0,n.lefttop]]},Jj=function(n){return[[n.topright,1],[n.bottomleft,0],[0,0],[0,n.leftbottom],[n.topleft,1]]},jj=function(n){return[[n.bottomright,0],[n.bottomleft,0],[0,n.lefttop],[0,1],[n.topleft,1]]},Kj=function(n){return[[1,1],[1,n.righttop],[0,n.leftbottom],[0,n.lefttop],[n.topright,1]]},Qj=function(n){return[[1,n.rightbottom],[1,0],[n.bottomright,0],[n.topleft,1],[n.topright,1]]},tK=function(n){return[[1,n.righttop],[1,n.rightbottom],[n.bottomleft,0],[0,0],[0,n.leftbottom]]},eK=function(n){return[[1,n.rightbottom],[1,0],[0,0],[0,n.leftbottom],[n.topleft,1],[n.topright,1]]},nK=function(n){return[[1,1],[1,0],[n.bottomright,0],[0,n.leftbottom],[0,n.lefttop],[n.topright,1]]},rK=function(n){return[[1,1],[1,n.righttop],[n.bottomright,0],[n.bottomleft,0],[0,n.lefttop],[0,1]]},iK=function(n){return[[1,n.righttop],[1,n.rightbottom],[n.bottomleft,0],[0,0],[0,1],[n.topleft,1]]},oK=function(n){return[[1,1],[1,n.righttop],[n.bottomleft,0],[0,0],[0,n.leftbottom],[n.topright,1]]},sK=function(n){return[[1,n.rightbottom],[1,0],[n.bottomright,0],[0,n.lefttop],[0,1],[n.topleft,1]]},aK=function(n){return[[1,n.righttop],[1,n.rightbottom],[n.bottomright,0],[n.bottomleft,0],[0,n.leftbottom],[0,n.lefttop],[n.topleft,1],[n.topright,1]]},uK=function(n){return[[1,1],[1,n.righttop],[n.bottomleft,0],[0,0],[0,n.leftbottom],[n.topright,1]]},lK=function(n){return[[1,n.rightbottom],[1,0],[n.bottomright,0],[0,n.lefttop],[0,1],[n.topleft,1]]},cK=function(n){return[[1,1],[1,n.righttop],[n.bottomright,0],[n.bottomleft,0],[0,n.leftbottom],[0,n.lefttop],[n.topright,1]]},fK=function(n){return[[1,n.righttop],[1,n.rightbottom],[n.bottomleft,0],[0,0],[0,n.leftbottom],[n.topleft,1],[n.topright,1]]},hK=function(n){return[[1,n.righttop],[1,n.rightbottom],[n.bottomright,0],[n.bottomleft,0],[0,n.lefttop],[0,1],[n.topleft,1]]},pK=function(n){return[[1,n.rightbottom],[1,0],[n.bottomright,0],[0,n.leftbottom],[0,n.lefttop],[n.topleft,1],[n.topright,1]]},en=[],nn=[],rn=[],on=[],sn=[],an=[],un=[],ln=[];on[1]=sn[1]=18;on[169]=sn[169]=18;rn[4]=nn[4]=12;rn[166]=nn[166]=12;en[16]=ln[16]=4;en[154]=ln[154]=4;an[64]=un[64]=22;an[106]=un[106]=22;rn[2]=an[2]=17;on[2]=sn[2]=18;rn[168]=an[168]=17;on[168]=sn[168]=18;en[8]=on[8]=9;nn[8]=rn[8]=12;en[162]=on[162]=9;nn[162]=rn[162]=12;en[32]=ln[32]=4;nn[32]=un[32]=1;en[138]=ln[138]=4;nn[138]=un[138]=1;sn[128]=ln[128]=21;an[128]=un[128]=22;sn[42]=ln[42]=21;an[42]=un[42]=22;nn[5]=sn[5]=14;nn[165]=sn[165]=14;rn[20]=ln[20]=6;rn[150]=ln[150]=6;en[80]=an[80]=11;en[90]=an[90]=11;on[65]=un[65]=3;on[105]=un[105]=3;en[160]=an[160]=11;nn[160]=sn[160]=14;en[10]=an[10]=11;nn[10]=sn[10]=14;rn[130]=ln[130]=6;on[130]=un[130]=3;rn[40]=ln[40]=6;on[40]=un[40]=3;nn[101]=un[101]=1;nn[69]=un[69]=1;sn[149]=ln[149]=21;sn[21]=ln[21]=21;rn[86]=an[86]=17;rn[84]=an[84]=17;en[89]=on[89]=9;en[81]=on[81]=9;en[96]=un[96]=0;nn[96]=an[96]=15;en[74]=un[74]=0;nn[74]=an[74]=15;en[24]=rn[24]=8;on[24]=ln[24]=7;en[146]=rn[146]=8;on[146]=ln[146]=7;nn[6]=an[6]=15;rn[6]=sn[6]=16;nn[164]=an[164]=15;rn[164]=sn[164]=16;on[129]=ln[129]=7;sn[129]=un[129]=20;on[41]=ln[41]=7;sn[41]=un[41]=20;rn[66]=un[66]=2;on[66]=an[66]=19;rn[104]=un[104]=2;on[104]=an[104]=19;en[144]=sn[144]=10;an[144]=ln[144]=23;en[26]=sn[26]=10;an[26]=ln[26]=23;nn[36]=ln[36]=5;rn[36]=un[36]=2;nn[134]=ln[134]=5;rn[134]=un[134]=2;en[9]=sn[9]=10;nn[9]=on[9]=13;en[161]=sn[161]=10;nn[161]=on[161]=13;nn[37]=ln[37]=5;sn[37]=un[37]=20;nn[133]=ln[133]=5;sn[133]=un[133]=20;rn[148]=sn[148]=16;an[148]=ln[148]=23;rn[22]=sn[22]=16;an[22]=ln[22]=23;en[82]=rn[82]=8;on[82]=an[82]=19;en[88]=rn[88]=8;on[88]=an[88]=19;en[73]=un[73]=0;nn[73]=on[73]=13;en[97]=un[97]=0;nn[97]=on[97]=13;en[145]=on[145]=9;sn[145]=ln[145]=21;en[25]=on[25]=9;sn[25]=ln[25]=21;nn[70]=un[70]=1;rn[70]=an[70]=17;nn[100]=un[100]=1;rn[100]=an[100]=17;en[34]=on[34]=9;nn[34]=rn[34]=12;sn[34]=ln[34]=21;an[34]=un[34]=22;en[136]=ln[136]=4;nn[136]=un[136]=1;rn[136]=an[136]=17;on[136]=sn[136]=18;en[35]=ln[35]=4;nn[35]=rn[35]=12;on[35]=sn[35]=18;an[35]=un[35]=22;en[153]=ln[153]=4;on[153]=sn[153]=18;nn[102]=rn[102]=12;an[102]=un[102]=22;en[155]=on[155]=9;sn[155]=ln[155]=23;nn[103]=un[103]=1;rn[103]=an[103]=17;en[152]=ln[152]=4;rn[152]=an[152]=17;on[152]=sn[152]=18;en[156]=rn[156]=8;on[156]=sn[156]=18;an[156]=ln[156]=23;en[137]=ln[137]=4;nn[137]=un[137]=1;on[137]=sn[137]=18;en[139]=ln[139]=4;nn[139]=on[139]=13;sn[139]=un[139]=20;en[98]=on[98]=9;nn[98]=rn[98]=12;an[98]=un[98]=22;en[99]=un[99]=0;nn[99]=rn[99]=12;on[99]=an[99]=19;nn[38]=rn[38]=12;sn[38]=ln[38]=21;an[38]=un[38]=22;nn[39]=ln[39]=5;rn[39]=sn[39]=16;an[39]=un[39]=22;var Yt=[];Yt[1]=Yt[169]=Sx;Yt[4]=Yt[166]=wx;Yt[16]=Yt[154]=Mx;Yt[64]=Yt[106]=bx;Yt[168]=Yt[2]=Ax;Yt[162]=Yt[8]=Tx;Yt[138]=Yt[32]=Cx;Yt[42]=Yt[128]=Ix;Yt[5]=Yt[165]=Fj;Yt[20]=Yt[150]=Uj;Yt[80]=Yt[90]=Bj;Yt[65]=Yt[105]=zj;Yt[160]=Yt[10]=Gj;Yt[130]=Yt[40]=kj;Yt[85]=qj;Yt[101]=Yt[69]=Vj;Yt[149]=Yt[21]=Hj;Yt[86]=Yt[84]=Wj;Yt[89]=Yt[81]=Xj;Yt[96]=Yt[74]=Yj;Yt[24]=Yt[146]=$j;Yt[6]=Yt[164]=Zj;Yt[129]=Yt[41]=Jj;Yt[66]=Yt[104]=jj;Yt[144]=Yt[26]=Kj;Yt[36]=Yt[134]=Qj;Yt[9]=Yt[161]=tK;Yt[37]=Yt[133]=eK;Yt[148]=Yt[22]=nK;Yt[82]=Yt[88]=rK;Yt[73]=Yt[97]=iK;Yt[145]=Yt[25]=oK;Yt[70]=Yt[100]=sK;Yt[34]=function(n){return[Ix(n),Tx(n)]};Yt[35]=aK;Yt[136]=function(n){return[Cx(n),Ax(n)]};Yt[153]=function(n){return[Mx(n),Sx(n)]};Yt[102]=function(n){return[wx(n),bx(n)]};Yt[155]=uK;Yt[103]=lK;Yt[152]=function(n){return[Mx(n),Ax(n)]};Yt[156]=cK;Yt[137]=function(n){return[Cx(n),Sx(n)]};Yt[139]=fK;Yt[98]=function(n){return[Tx(n),bx(n)]};Yt[99]=hK;Yt[38]=function(n){return[wx(n),Ix(n)]};Yt[39]=pK;function gK(n){return(n>0)-(n<0)||+n}function Ql(n,t,e){var i=t[0]-n[0],s=t[1]-n[1],u=e[0]-t[0],c=e[1]-t[1];return gK(i*c-u*s)}function d2(n,t){var e=n.geometry.coordinates[0].map(function(c){return c[0]}),i=n.geometry.coordinates[0].map(function(c){return c[1]}),s=t.geometry.coordinates[0].map(function(c){return c[0]}),u=t.geometry.coordinates[0].map(function(c){return c[1]});return Math.max.apply(null,e)===Math.max.apply(null,s)&&Math.max.apply(null,i)===Math.max.apply(null,u)&&Math.min.apply(null,e)===Math.min.apply(null,s)&&Math.min.apply(null,i)===Math.min.apply(null,u)}function Px(n,t){return t.geometry.coordinates[0].every(function(e){return zr(Dn(e),n)})}function g2(n,t){return n[0]===t[0]&&n[1]===t[1]}var mK=function(){function n(t){this.id=n.buildId(t),this.coordinates=t,this.innerEdges=[],this.outerEdges=[],this.outerEdgesSorted=!1}return n.buildId=function(t){return t.join(",")},n.prototype.removeInnerEdge=function(t){this.innerEdges=this.innerEdges.filter(function(e){return e.from.id!==t.from.id})},n.prototype.removeOuterEdge=function(t){this.outerEdges=this.outerEdges.filter(function(e){return e.to.id!==t.to.id})},n.prototype.addOuterEdge=function(t){this.outerEdges.push(t),this.outerEdgesSorted=!1},n.prototype.sortOuterEdges=function(){var t=this;this.outerEdgesSorted||(this.outerEdges.sort(function(e,i){var s=e.to,u=i.to;if(s.coordinates[0]-t.coordinates[0]>=0&&u.coordinates[0]-t.coordinates[0]<0)return 1;if(s.coordinates[0]-t.coordinates[0]<0&&u.coordinates[0]-t.coordinates[0]>=0)return-1;if(s.coordinates[0]-t.coordinates[0]===0&&u.coordinates[0]-t.coordinates[0]===0)return s.coordinates[1]-t.coordinates[1]>=0||u.coordinates[1]-t.coordinates[1]>=0?s.coordinates[1]-u.coordinates[1]:u.coordinates[1]-s.coordinates[1];var c=Ql(t.coordinates,s.coordinates,u.coordinates);if(c<0)return 1;if(c>0)return-1;var f=Math.pow(s.coordinates[0]-t.coordinates[0],2)+Math.pow(s.coordinates[1]-t.coordinates[1],2),p=Math.pow(u.coordinates[0]-t.coordinates[0],2)+Math.pow(u.coordinates[1]-t.coordinates[1],2);return f-p}),this.outerEdgesSorted=!0)},n.prototype.getOuterEdges=function(){return this.sortOuterEdges(),this.outerEdges},n.prototype.getOuterEdge=function(t){return this.sortOuterEdges(),this.outerEdges[t]},n.prototype.addInnerEdge=function(t){this.innerEdges.push(t)},n}(),Rx=mK;var yK=function(){function n(t,e){this.from=t,this.to=e,this.next=void 0,this.label=void 0,this.symetric=void 0,this.ring=void 0,this.from.addOuterEdge(this),this.to.addInnerEdge(this)}return n.prototype.getSymetric=function(){return this.symetric||(this.symetric=new n(this.to,this.from),this.symetric.symetric=this),this.symetric},n.prototype.deleteEdge=function(){this.from.removeOuterEdge(this),this.to.removeInnerEdge(this)},n.prototype.isEqual=function(t){return this.from.id===t.from.id&&this.to.id===t.to.id},n.prototype.toString=function(){return"Edge { "+this.from.id+" -> "+this.to.id+" }"},n.prototype.toLineString=function(){return Br([this.from.coordinates,this.to.coordinates])},n.prototype.compareTo=function(t){return Ql(t.from.coordinates,t.to.coordinates,this.to.coordinates)},n}(),m2=yK;var vK=function(){function n(){this.edges=[],this.polygon=void 0,this.envelope=void 0}return n.prototype.push=function(t){this.edges.push(t),this.polygon=this.envelope=void 0},n.prototype.get=function(t){return this.edges[t]},Object.defineProperty(n.prototype,"length",{get:function(){return this.edges.length},enumerable:!0,configurable:!0}),n.prototype.forEach=function(t){this.edges.forEach(t)},n.prototype.map=function(t){return this.edges.map(t)},n.prototype.some=function(t){return this.edges.some(t)},n.prototype.isValid=function(){return!0},n.prototype.isHole=function(){var t=this,e=this.edges.reduce(function(c,f,p){return f.from.coordinates[1]>t.edges[c].from.coordinates[1]&&(c=p),c},0),i=(e===0?this.length:e)-1,s=(e+1)%this.length,u=Ql(this.edges[i].from.coordinates,this.edges[e].from.coordinates,this.edges[s].from.coordinates);return u===0?this.edges[i].from.coordinates[0]>this.edges[s].from.coordinates[0]:u>0},n.prototype.toMultiPoint=function(){return u_(this.edges.map(function(t){return t.from.coordinates}))},n.prototype.toPolygon=function(){if(this.polygon)return this.polygon;var t=this.edges.map(function(e){return e.from.coordinates});return t.push(this.edges[0].from.coordinates),this.polygon=Un([t])},n.prototype.getEnvelope=function(){return this.envelope?this.envelope:this.envelope=T_(this.toPolygon())},n.findEdgeRingContaining=function(t,e){var i=t.getEnvelope(),s,u;return e.forEach(function(c){var f=c.getEnvelope();if(u&&(s=u.getEnvelope()),!d2(f,i)&&Px(f,i)){for(var p=t.map(function(M){return M.from.coordinates}),d=void 0,g=function(M){c.some(function(A){return g2(M,A.from.coordinates)})||(d=M)},y=0,v=p;y<v.length;y++){var E=v[y];g(E)}d&&c.inside(Dn(d))&&(!u||Px(s,f))&&(u=c)}}),u},n.prototype.inside=function(t){return zr(t,this.toPolygon())},n}(),Lx=vK;function _K(n){if(!n)throw new Error("No geojson passed");if(n.type!=="FeatureCollection"&&n.type!=="GeometryCollection"&&n.type!=="MultiLineString"&&n.type!=="LineString"&&n.type!=="Feature")throw new Error("Invalid input type '"+n.type+"'. Geojson must be FeatureCollection, GeometryCollection, LineString, MultiLineString or Feature")}var Kdt=function(){function n(){this.edges=[],this.nodes={}}return n.fromGeoJson=function(t){_K(t);var e=new n;return Ji(t,function(i){c_(i,"LineString","Graph::fromGeoJson"),TP(i,function(s,u){if(s){var c=e.getNode(s),f=e.getNode(u);e.addEdge(c,f)}return u})}),e},n.prototype.getNode=function(t){var e=Rx.buildId(t),i=this.nodes[e];return i||(i=this.nodes[e]=new Rx(t)),i},n.prototype.addEdge=function(t,e){var i=new m2(t,e),s=i.getSymetric();this.edges.push(i),this.edges.push(s)},n.prototype.deleteDangles=function(){var t=this;Object.keys(this.nodes).map(function(e){return t.nodes[e]}).forEach(function(e){return t._removeIfDangle(e)})},n.prototype._removeIfDangle=function(t){var e=this;if(t.innerEdges.length<=1){var i=t.getOuterEdges().map(function(s){return s.to});this.removeNode(t),i.forEach(function(s){return e._removeIfDangle(s)})}},n.prototype.deleteCutEdges=function(){var t=this;this._computeNextCWEdges(),this._findLabeledEdgeRings(),this.edges.forEach(function(e){e.label===e.symetric.label&&(t.removeEdge(e.symetric),t.removeEdge(e))})},n.prototype._computeNextCWEdges=function(t){var e=this;typeof t=="undefined"?Object.keys(this.nodes).forEach(function(i){return e._computeNextCWEdges(e.nodes[i])}):t.getOuterEdges().forEach(function(i,s){t.getOuterEdge((s===0?t.getOuterEdges().length:s)-1).symetric.next=i})},n.prototype._computeNextCCWEdges=function(t,e){for(var i=t.getOuterEdges(),s,u,c=i.length-1;c>=0;--c){var f=i[c],p=f.symetric,d=void 0,g=void 0;f.label===e&&(d=f),p.label===e&&(g=p),!(!d||!g)&&(g&&(u=g),d&&(u&&(u.next=d,u=void 0),s||(s=d)))}u&&(u.next=s)},n.prototype._findLabeledEdgeRings=function(){var t=[],e=0;return this.edges.forEach(function(i){if(!(i.label>=0)){t.push(i);var s=i;do s.label=e,s=s.next;while(!i.isEqual(s));e++}}),t},n.prototype.getEdgeRings=function(){var t=this;this._computeNextCWEdges(),this.edges.forEach(function(i){i.label=void 0}),this._findLabeledEdgeRings().forEach(function(i){t._findIntersectionNodes(i).forEach(function(s){t._computeNextCCWEdges(s,i.label)})});var e=[];return this.edges.forEach(function(i){i.ring||e.push(t._findEdgeRing(i))}),e},n.prototype._findIntersectionNodes=function(t){var e=[],i=t,s=function(){var u=0;i.from.getOuterEdges().forEach(function(c){c.label===t.label&&++u}),u>1&&e.push(i.from),i=i.next};do s();while(!t.isEqual(i));return e},n.prototype._findEdgeRing=function(t){var e=t,i=new Lx;do i.push(e),e.ring=i,e=e.next;while(!t.isEqual(e));return i},n.prototype.removeNode=function(t){var e=this;t.getOuterEdges().forEach(function(i){return e.removeEdge(i)}),t.innerEdges.forEach(function(i){return e.removeEdge(i)}),delete this.nodes[t.id]},n.prototype.removeEdge=function(t){this.edges=this.edges.filter(function(e){return!e.isEqual(t)}),t.deleteEdge()},n}();var wK=jt(Nx(),1);var MK=jt(Nx(),1);var AK=jt(b2(),1);var NK=jt(D2(),1);function U2(n){for(var t=n,e=[];t.parent;)e.unshift(t),t=t.parent;return e}function DK(){return new B2(function(n){return n.f})}var Ux={search:function(n,t,e,i){n.cleanDirty(),i=i||{};var s=i.heuristic||Ux.heuristics.manhattan,u=i.closest||!1,c=DK(),f=t;for(t.h=s(t,e),c.push(t);c.size()>0;){var p=c.pop();if(p===e)return U2(p);p.closed=!0;for(var d=n.neighbors(p),g=0,y=d.length;g<y;++g){var v=d[g];if(!(v.closed||v.isWall())){var E=p.g+v.getCost(p),M=v.visited;(!M||E<v.g)&&(v.visited=!0,v.parent=p,v.h=v.h||s(v,e),v.g=E,v.f=v.g+v.h,n.markDirty(v),u&&(v.h<f.h||v.h===f.h&&v.g<f.g)&&(f=v),M?c.rescoreElement(v):c.push(v))}}}return u?U2(f):[]},heuristics:{manhattan:function(n,t){var e=Math.abs(t.x-n.x),i=Math.abs(t.y-n.y);return e+i},diagonal:function(n,t){var e=1,i=Math.sqrt(2),s=Math.abs(t.x-n.x),u=Math.abs(t.y-n.y);return e*(s+u)+(i-2*e)*Math.min(s,u)}},cleanNode:function(n){n.f=0,n.g=0,n.h=0,n.visited=!1,n.closed=!1,n.parent=null}};function Bf(n,t){t=t||{},this.nodes=[],this.diagonal=!!t.diagonal,this.grid=[];for(var e=0;e<n.length;e++){this.grid[e]=[];for(var i=0,s=n[e];i<s.length;i++){var u=new og(e,i,s[i]);this.grid[e][i]=u,this.nodes.push(u)}}this.init()}Bf.prototype.init=function(){this.dirtyNodes=[];for(var n=0;n<this.nodes.length;n++)Ux.cleanNode(this.nodes[n])};Bf.prototype.cleanDirty=function(){for(var n=0;n<this.dirtyNodes.length;n++)Ux.cleanNode(this.dirtyNodes[n]);this.dirtyNodes=[]};Bf.prototype.markDirty=function(n){this.dirtyNodes.push(n)};Bf.prototype.neighbors=function(n){var t=[],e=n.x,i=n.y,s=this.grid;return s[e-1]&&s[e-1][i]&&t.push(s[e-1][i]),s[e+1]&&s[e+1][i]&&t.push(s[e+1][i]),s[e]&&s[e][i-1]&&t.push(s[e][i-1]),s[e]&&s[e][i+1]&&t.push(s[e][i+1]),this.diagonal&&(s[e-1]&&s[e-1][i-1]&&t.push(s[e-1][i-1]),s[e+1]&&s[e+1][i-1]&&t.push(s[e+1][i-1]),s[e-1]&&s[e-1][i+1]&&t.push(s[e-1][i+1]),s[e+1]&&s[e+1][i+1]&&t.push(s[e+1][i+1])),t};Bf.prototype.toString=function(){for(var n=[],t=this.grid,e,i,s,u,c=0,f=t.length;c<f;c++){for(e=[],i=t[c],s=0,u=i.length;s<u;s++)e.push(i[s].weight);n.push(e.join(" "))}return n.join(\`
|
|
11922
11922
|
\`)};function og(n,t,e){this.x=n,this.y=t,this.weight=e}og.prototype.toString=function(){return"["+this.x+" "+this.y+"]"};og.prototype.getCost=function(n){return n&&n.x!==this.x&&n.y!==this.y?this.weight*1.41421:this.weight};og.prototype.isWall=function(){return this.weight===0};function B2(n){this.content=[],this.scoreFunction=n}B2.prototype={push:function(n){this.content.push(n),this.sinkDown(this.content.length-1)},pop:function(){var n=this.content[0],t=this.content.pop();return this.content.length>0&&(this.content[0]=t,this.bubbleUp(0)),n},remove:function(n){var t=this.content.indexOf(n),e=this.content.pop();t!==this.content.length-1&&(this.content[t]=e,this.scoreFunction(e)<this.scoreFunction(n)?this.sinkDown(t):this.bubbleUp(t))},size:function(){return this.content.length},rescoreElement:function(n){this.sinkDown(this.content.indexOf(n))},sinkDown:function(n){for(var t=this.content[n];n>0;){var e=(n+1>>1)-1,i=this.content[e];if(this.scoreFunction(t)<this.scoreFunction(i))this.content[e]=t,this.content[n]=i,n=e;else break}},bubbleUp:function(n){for(var t=this.content.length,e=this.content[n],i=this.scoreFunction(e);;){var s=n+1<<1,u=s-1,c=null,f;if(u<t){var p=this.content[u];f=this.scoreFunction(p),f<i&&(c=u)}if(s<t){var d=this.content[s],g=this.scoreFunction(d);g<(c===null?i:f)&&(c=s)}if(c!==null)this.content[n]=this.content[c],this.content[c]=e,n=c;else break}}};function Bx(){this._=null}function ec(n){n.U=n.C=n.L=n.R=n.P=n.N=null}Bx.prototype={constructor:Bx,insert:function(n,t){var e,i,s;if(n){if(t.P=n,t.N=n.N,n.N&&(n.N.P=t),n.N=t,n.R){for(n=n.R;n.L;)n=n.L;n.L=t}else n.R=t;e=n}else this._?(n=z2(this._),t.P=null,t.N=n,n.P=n.L=t,e=n):(t.P=t.N=null,this._=t,e=null);for(t.L=t.R=null,t.U=e,t.C=!0,n=t;e&&e.C;)i=e.U,e===i.L?(s=i.R,s&&s.C?(e.C=s.C=!1,i.C=!0,n=i):(n===e.R&&(zf(this,e),n=e,e=n.U),e.C=!1,i.C=!0,Gf(this,i))):(s=i.L,s&&s.C?(e.C=s.C=!1,i.C=!0,n=i):(n===e.L&&(Gf(this,e),n=e,e=n.U),e.C=!1,i.C=!0,zf(this,i))),e=n.U;this._.C=!1},remove:function(n){n.N&&(n.N.P=n.P),n.P&&(n.P.N=n.N),n.N=n.P=null;var t=n.U,e,i=n.L,s=n.R,u,c;if(i?s?u=z2(s):u=i:u=s,t?t.L===n?t.L=u:t.R=u:this._=u,i&&s?(c=u.C,u.C=n.C,u.L=i,i.U=u,u!==s?(t=u.U,u.U=n.U,n=u.R,t.L=n,u.R=s,s.U=u):(u.U=t,t=u,n=u.R)):(c=n.C,n=u),n&&(n.U=t),!c){if(n&&n.C){n.C=!1;return}do{if(n===this._)break;if(n===t.L){if(e=t.R,e.C&&(e.C=!1,t.C=!0,zf(this,t),e=t.R),e.L&&e.L.C||e.R&&e.R.C){(!e.R||!e.R.C)&&(e.L.C=!1,e.C=!0,Gf(this,e),e=t.R),e.C=t.C,t.C=e.R.C=!1,zf(this,t),n=this._;break}}else if(e=t.L,e.C&&(e.C=!1,t.C=!0,Gf(this,t),e=t.L),e.L&&e.L.C||e.R&&e.R.C){(!e.L||!e.L.C)&&(e.R.C=!1,e.C=!0,zf(this,e),e=t.L),e.C=t.C,t.C=e.L.C=!1,Gf(this,t),n=this._;break}e.C=!0,n=t,t=t.U}while(!n.C);n&&(n.C=!1)}}};function zf(n,t){var e=t,i=t.R,s=e.U;s?s.L===e?s.L=i:s.R=i:n._=i,i.U=s,e.U=i,e.R=i.L,e.R&&(e.R.U=e),i.L=e}function Gf(n,t){var e=t,i=t.L,s=e.U;s?s.L===e?s.L=i:s.R=i:n._=i,i.U=s,e.U=i,e.L=i.R,e.L&&(e.L.U=e),i.R=e}function z2(n){for(;n.L;)n=n.L;return n}var zx=Bx;function nc(n,t,e,i){var s=[null,null],u=kr.push(s)-1;return s.left=n,s.right=t,e&&kf(s,n,t,e),i&&kf(s,t,n,i),Ti[n.index].halfedges.push(u),Ti[t.index].halfedges.push(u),s}function rc(n,t,e){var i=[t,e];return i.left=n,i}function kf(n,t,e,i){!n[0]&&!n[1]?(n[0]=i,n.left=t,n.right=e):n.left===e?n[1]=i:n[0]=i}function FK(n,t,e,i,s){var u=n[0],c=n[1],f=u[0],p=u[1],d=c[0],g=c[1],y=0,v=1,E=d-f,M=g-p,A;if(A=t-f,!(!E&&A>0)){if(A/=E,E<0){if(A<y)return;A<v&&(v=A)}else if(E>0){if(A>v)return;A>y&&(y=A)}if(A=i-f,!(!E&&A<0)){if(A/=E,E<0){if(A>v)return;A>y&&(y=A)}else if(E>0){if(A<y)return;A<v&&(v=A)}if(A=e-p,!(!M&&A>0)){if(A/=M,M<0){if(A<y)return;A<v&&(v=A)}else if(M>0){if(A>v)return;A>y&&(y=A)}if(A=s-p,!(!M&&A<0)){if(A/=M,M<0){if(A>v)return;A>y&&(y=A)}else if(M>0){if(A<y)return;A<v&&(v=A)}return!(y>0)&&!(v<1)||(y>0&&(n[0]=[f+y*E,p+y*M]),v<1&&(n[1]=[f+v*E,p+v*M])),!0}}}}}function UK(n,t,e,i,s){var u=n[1];if(u)return!0;var c=n[0],f=n.left,p=n.right,d=f[0],g=f[1],y=p[0],v=p[1],E=(d+y)/2,M=(g+v)/2,A,_;if(v===g){if(E<t||E>=i)return;if(d>y){if(!c)c=[E,e];else if(c[1]>=s)return;u=[E,s]}else{if(!c)c=[E,s];else if(c[1]<e)return;u=[E,e]}}else if(A=(d-y)/(v-g),_=M-A*E,A<-1||A>1)if(d>y){if(!c)c=[(e-_)/A,e];else if(c[1]>=s)return;u=[(s-_)/A,s]}else{if(!c)c=[(s-_)/A,s];else if(c[1]<e)return;u=[(e-_)/A,e]}else if(g<v){if(!c)c=[t,A*t+_];else if(c[0]>=i)return;u=[i,A*i+_]}else{if(!c)c=[i,A*i+_];else if(c[0]<t)return;u=[t,A*t+_]}return n[0]=c,n[1]=u,!0}function G2(n,t,e,i){for(var s=kr.length,u;s--;)(!UK(u=kr[s],n,t,e,i)||!FK(u,n,t,e,i)||!(Math.abs(u[0][0]-u[1][0])>Ln||Math.abs(u[0][1]-u[1][1])>Ln))&&delete kr[s]}function k2(n){return Ti[n.index]={site:n,halfedges:[]}}function BK(n,t){var e=n.site,i=t.left,s=t.right;return e===s&&(s=i,i=e),s?Math.atan2(s[1]-i[1],s[0]-i[0]):(e===i?(i=t[1],s=t[0]):(i=t[0],s=t[1]),Math.atan2(i[0]-s[0],s[1]-i[1]))}function Gx(n,t){return t[+(t.left!==n.site)]}function zK(n,t){return t[+(t.left===n.site)]}function q2(){for(var n=0,t=Ti.length,e,i,s,u;n<t;++n)if((e=Ti[n])&&(u=(i=e.halfedges).length)){var c=new Array(u),f=new Array(u);for(s=0;s<u;++s)c[s]=s,f[s]=BK(e,kr[i[s]]);for(c.sort(function(p,d){return f[d]-f[p]}),s=0;s<u;++s)f[s]=i[c[s]];for(s=0;s<u;++s)i[s]=f[s]}}function V2(n,t,e,i){var s=Ti.length,u,c,f,p,d,g,y,v,E,M,A,_,x=!0;for(u=0;u<s;++u)if(c=Ti[u]){for(f=c.site,d=c.halfedges,p=d.length;p--;)kr[d[p]]||d.splice(p,1);for(p=0,g=d.length;p<g;)M=zK(c,kr[d[p]]),A=M[0],_=M[1],y=Gx(c,kr[d[++p%g]]),v=y[0],E=y[1],(Math.abs(A-v)>Ln||Math.abs(_-E)>Ln)&&(d.splice(p,0,kr.push(rc(f,M,Math.abs(A-n)<Ln&&i-_>Ln?[n,Math.abs(v-n)<Ln?E:i]:Math.abs(_-i)<Ln&&e-A>Ln?[Math.abs(E-i)<Ln?v:e,i]:Math.abs(A-e)<Ln&&_-t>Ln?[e,Math.abs(v-e)<Ln?E:t]:Math.abs(_-t)<Ln&&A-n>Ln?[Math.abs(E-t)<Ln?v:n,t]:null))-1),++g);g&&(x=!1)}if(x){var T,w,R,z=1/0;for(u=0,x=null;u<s;++u)(c=Ti[u])&&(f=c.site,T=f[0]-n,w=f[1]-t,R=T*T+w*w,R<z&&(z=R,x=c));if(x){var U=[n,t],D=[n,i],P=[e,i],ct=[e,t];x.halfedges.push(kr.push(rc(f=x.site,U,D))-1,kr.push(rc(f,D,P))-1,kr.push(rc(f,P,ct))-1,kr.push(rc(f,ct,U))-1)}}for(u=0;u<s;++u)(c=Ti[u])&&(c.halfedges.length||delete Ti[u])}var H2=[],sg;function GK(){ec(this),this.x=this.y=this.arc=this.site=this.cy=null}function _u(n){var t=n.P,e=n.N;if(!(!t||!e)){var i=t.site,s=n.site,u=e.site;if(i!==u){var c=s[0],f=s[1],p=i[0]-c,d=i[1]-f,g=u[0]-c,y=u[1]-f,v=2*(p*y-d*g);if(!(v>=-W2)){var E=p*p+d*d,M=g*g+y*y,A=(y*E-d*M)/v,_=(p*M-g*E)/v,x=H2.pop()||new GK;x.arc=n,x.site=s,x.x=A+c,x.y=(x.cy=_+f)+Math.sqrt(A*A+_*_),n.circle=x;for(var T=null,w=ic._;w;)if(x.y<w.y||x.y===w.y&&x.x<=w.x)if(w.L)w=w.L;else{T=w.P;break}else if(w.R)w=w.R;else{T=w;break}ic.insert(T,x),T||(sg=x)}}}}function xu(n){var t=n.circle;t&&(t.P||(sg=t.N),ic.remove(t),H2.push(t),ec(t),n.circle=null)}var Y2=[];function kK(){ec(this),this.edge=this.site=this.circle=null}function X2(n){var t=Y2.pop()||new kK;return t.site=n,t}function kx(n){xu(n),Eu.remove(n),Y2.push(n),ec(n)}function $2(n){var t=n.circle,e=t.x,i=t.cy,s=[e,i],u=n.P,c=n.N,f=[n];kx(n);for(var p=u;p.circle&&Math.abs(e-p.circle.x)<Ln&&Math.abs(i-p.circle.cy)<Ln;)u=p.P,f.unshift(p),kx(p),p=u;f.unshift(p),xu(p);for(var d=c;d.circle&&Math.abs(e-d.circle.x)<Ln&&Math.abs(i-d.circle.cy)<Ln;)c=d.N,f.push(d),kx(d),d=c;f.push(d),xu(d);var g=f.length,y;for(y=1;y<g;++y)d=f[y],p=f[y-1],kf(d.edge,p.site,d.site,s);p=f[0],d=f[g-1],d.edge=nc(p.site,d.site,null,s),_u(p),_u(d)}function Z2(n){for(var t=n[0],e=n[1],i,s,u,c,f=Eu._;f;)if(u=J2(f,e)-t,u>Ln)f=f.L;else if(c=t-qK(f,e),c>Ln){if(!f.R){i=f;break}f=f.R}else{u>-Ln?(i=f.P,s=f):c>-Ln?(i=f,s=f.N):i=s=f;break}k2(n);var p=X2(n);if(Eu.insert(i,p),!(!i&&!s)){if(i===s){xu(i),s=X2(i.site),Eu.insert(p,s),p.edge=s.edge=nc(i.site,p.site),_u(i),_u(s);return}if(!s){p.edge=nc(i.site,p.site);return}xu(i),xu(s);var d=i.site,g=d[0],y=d[1],v=n[0]-g,E=n[1]-y,M=s.site,A=M[0]-g,_=M[1]-y,x=2*(v*_-E*A),T=v*v+E*E,w=A*A+_*_,R=[(_*T-E*w)/x+g,(v*w-A*T)/x+y];kf(s.edge,d,M,R),p.edge=nc(d,n,null,R),s.edge=nc(n,M,null,R),_u(i),_u(s)}}function J2(n,t){var e=n.site,i=e[0],s=e[1],u=s-t;if(!u)return i;var c=n.P;if(!c)return-1/0;e=c.site;var f=e[0],p=e[1],d=p-t;if(!d)return f;var g=f-i,y=1/u-1/d,v=g/d;return y?(-v+Math.sqrt(v*v-2*y*(g*g/(-2*d)-p+d/2+s-u/2)))/y+i:(i+f)/2}function qK(n,t){var e=n.N;if(e)return J2(e,t);var i=n.site;return i[1]===t?i[0]:1/0}var Ln=1e-6,W2=1e-12,Eu,Ti,ic,kr;function VK(n,t,e){return(n[0]-e[0])*(t[1]-n[1])-(n[0]-t[0])*(e[1]-n[1])}function HK(n,t){return t[1]-n[1]||t[0]-n[0]}function ag(n,t){var e=n.sort(HK).pop(),i,s,u;for(kr=[],Ti=new Array(n.length),Eu=new zx,ic=new zx;;)if(u=sg,e&&(!u||e[1]<u.y||e[1]===u.y&&e[0]<u.x))(e[0]!==i||e[1]!==s)&&(Z2(e),i=e[0],s=e[1]),e=n.pop();else if(u)$2(u.arc);else break;if(q2(),t){var c=+t[0][0],f=+t[0][1],p=+t[1][0],d=+t[1][1];G2(c,f,p,d),V2(c,f,p,d)}this.edges=kr,this.cells=Ti,Eu=ic=kr=Ti=null}ag.prototype={constructor:ag,polygons:function(){var n=this.edges;return this.cells.map(function(t){var e=t.halfedges.map(function(i){return Gx(t,n[i])});return e.data=t.site.data,e})},triangles:function(){var n=[],t=this.edges;return this.cells.forEach(function(e,i){if(f=(u=e.halfedges).length)for(var s=e.site,u,c=-1,f,p,d=t[u[f-1]],g=d.left===s?d.right:d.left;++c<f;)p=g,d=t[u[c]],g=d.left===s?d.right:d.left,p&&g&&i<p.index&&i<g.index&&VK(s,p,g)<0&&n.push([s.data,p.data,g.data])}),n},links:function(){return this.edges.filter(function(n){return n.right}).map(function(n){return{source:n.left.data,target:n.right.data}})},find:function(n,t,e){for(var i=this,s,u=i._found||0,c=i.cells.length,f;!(f=i.cells[u]);)if(++u>=c)return null;var p=n-f.site[0],d=t-f.site[1],g=p*p+d*d;do f=i.cells[s=u],u=null,f.halfedges.forEach(function(y){var v=i.edges[y],E=v.left;if(!((E===f.site||!E)&&!(E=v.right))){var M=n-E[0],A=t-E[1],_=M*M+A*A;_<g&&(g=_,u=E.index)}});while(u!==null);return i._found=s,e==null||g<=e*e?f.site:null}};var KK=jt(oc(),1);var n1=jt(tO(),1);function Di(){return new cg}function cg(){this.reset()}cg.prototype={constructor:cg,reset:function(){this.s=this.t=0},add:function(n){eO(lg,n,this.t),eO(this,lg.s,this.s),this.s?this.t+=lg.t:this.s=lg.t},valueOf:function(){return this.s}};var lg=new cg;function eO(n,t,e){var i=n.s=t+e,s=i-t,u=i-s;n.t=t-u+(e-s)}var yn=1e-6;var Tn=Math.PI,br=Tn/2,fg=Tn/4,os=Tn*2,Su=180/Tn,Fi=Tn/180,nr=Math.abs,Uo=Math.atan,Ui=Math.atan2,hn=Math.cos;var hg=Math.exp;var qf=Math.log;var Me=Math.sin;var jr=Math.sqrt,Vf=Math.tan;function Hx(n){return n>1?0:n<-1?Tn:Math.acos(n)}function Ci(n){return n>1?br:n<-1?-br:Math.asin(n)}function Bo(){}var QK=Di(),X0t=Di();function wu(n){var t=n[0],e=n[1],i=hn(e);return[i*hn(t),i*Me(t),Me(e)]}function Hf(n,t){return[n[1]*t[2]-n[2]*t[1],n[2]*t[0]-n[0]*t[2],n[0]*t[1]-n[1]*t[0]]}function Wf(n){var t=jr(n[0]*n[0]+n[1]*n[1]+n[2]*n[2]);n[0]/=t,n[1]/=t,n[2]/=t}var nyt=Di();function rO(n,t){return[n>Tn?n-os:n<-Tn?n+os:n,t]}rO.invert=rO;function Wx(){var n=[],t;return{point:function(e,i){t.push([e,i])},lineStart:function(){n.push(t=[])},lineEnd:Bo,rejoin:function(){n.length>1&&n.push(n.pop().concat(n.shift()))},result:function(){var e=n;return n=[],t=null,e}}}function Xx(n,t){return nr(n[0]-t[0])<yn&&nr(n[1]-t[1])<yn}function pg(n,t,e,i){this.x=n,this.z=t,this.o=e,this.e=i,this.v=!1,this.n=this.p=null}function Yx(n,t,e,i,s){var u=[],c=[],f,p;if(n.forEach(function(M){if(!((A=M.length-1)<=0)){var A,_=M[0],x=M[A],T;if(Xx(_,x)){for(s.lineStart(),f=0;f<A;++f)s.point((_=M[f])[0],_[1]);s.lineEnd();return}u.push(T=new pg(_,M,null,!0)),c.push(T.o=new pg(_,null,T,!1)),u.push(T=new pg(x,M,null,!1)),c.push(T.o=new pg(x,null,T,!0))}}),!!u.length){for(c.sort(t),iO(u),iO(c),f=0,p=c.length;f<p;++f)c[f].e=e=!e;for(var d=u[0],g,y;;){for(var v=d,E=!0;v.v;)if((v=v.n)===d)return;g=v.z,s.lineStart();do{if(v.v=v.o.v=!0,v.e){if(E)for(f=0,p=g.length;f<p;++f)s.point((y=g[f])[0],y[1]);else i(v.x,v.n.x,1,s);v=v.n}else{if(E)for(g=v.p.z,f=g.length-1;f>=0;--f)s.point((y=g[f])[0],y[1]);else i(v.x,v.p.x,-1,s);v=v.p}v=v.o,g=v.z,E=!E}while(!v.v);s.lineEnd()}}}function iO(n){if(t=n.length){for(var t,e=0,i=n[0],s;++e<t;)i.n=s=n[e],s.p=i,i=s;i.n=s=n[0],s.p=i}}function Aa(n,t){return n<t?-1:n>t?1:n>=t?0:NaN}function $x(n){return n.length===1&&(n=nQ(n)),{left:function(t,e,i,s){for(i==null&&(i=0),s==null&&(s=t.length);i<s;){var u=i+s>>>1;n(t[u],e)<0?i=u+1:s=u}return i},right:function(t,e,i,s){for(i==null&&(i=0),s==null&&(s=t.length);i<s;){var u=i+s>>>1;n(t[u],e)>0?s=u:i=u+1}return i}}}function nQ(n){return function(t,e){return Aa(n(t),e)}}var oO=$x(Aa),rQ=oO.right,iQ=oO.left;var sO=Array.prototype,sQ=sO.slice,aQ=sO.map;var $yt=Math.sqrt(50),Zyt=Math.sqrt(10),Jyt=Math.sqrt(2);function gg(n){for(var t=n.length,e,i=-1,s=0,u,c;++i<t;)s+=n[i].length;for(u=new Array(s);--t>=0;)for(c=n[t],e=c.length;--e>=0;)u[--s]=c[e];return u}var gQ=1e9,N_t=-gQ;var Zx=Di();function Jx(n,t){var e=t[0],i=t[1],s=[Me(e),-hn(e),0],u=0,c=0;Zx.reset();for(var f=0,p=n.length;f<p;++f)if(g=(d=n[f]).length)for(var d,g,y=d[g-1],v=y[0],E=y[1]/2+fg,M=Me(E),A=hn(E),_=0;_<g;++_,v=T,M=R,A=z,y=x){var x=d[_],T=x[0],w=x[1]/2+fg,R=Me(w),z=hn(w),U=T-v,D=U>=0?1:-1,P=D*U,ct=P>Tn,L=M*R;if(Zx.add(Ui(L*D*Me(P),A*z+L*hn(P))),u+=ct?U+D*os:U,ct^v>=e^T>=e){var W=Hf(wu(y),wu(x));Wf(W);var V=Hf(s,W);Wf(V);var Mt=(ct^U>=0?-1:1)*Ci(V[2]);(i>Mt||i===Mt&&(W[0]||W[1]))&&(c+=ct^U>=0?1:-1)}}return(u<-yn||u<yn&&Zx<-yn)^c&1}var V_t=Di();var uxt=Di(),lxt=Di();var vQ=1/0;var hxt=-vQ;function jx(n){this._context=n}jx.prototype={_radius:4.5,pointRadius:function(n){return this._radius=n,this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){this._line===0&&this._context.closePath(),this._point=NaN},point:function(n,t){switch(this._point){case 0:{this._context.moveTo(n,t),this._point=1;break}case 1:{this._context.lineTo(n,t);break}default:{this._context.moveTo(n+this._radius,t),this._context.arc(n,t,this._radius,0,os);break}}},result:Bo};var Sxt=Di();function Kx(){this._string=[]}Kx.prototype={_radius:4.5,_circle:lO(4.5),pointRadius:function(n){return(n=+n)!==this._radius&&(this._radius=n,this._circle=null),this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){this._line===0&&this._string.push("Z"),this._point=NaN},point:function(n,t){switch(this._point){case 0:{this._string.push("M",n,",",t),this._point=1;break}case 1:{this._string.push("L",n,",",t);break}default:{this._circle==null&&(this._circle=lO(this._radius)),this._string.push("M",n,",",t,this._circle);break}}},result:function(){if(this._string.length){var n=this._string.join("");return this._string=[],n}else return null}};function lO(n){return"m0,"+n+"a"+n+","+n+" 0 1,1 0,"+-2*n+"a"+n+","+n+" 0 1,1 0,"+2*n+"z"}function Qx(n,t,e,i){return function(s,u){var c=t(u),f=s.invert(i[0],i[1]),p=Wx(),d=t(p),g=!1,y,v,E,M={point:A,lineStart:x,lineEnd:T,polygonStart:function(){M.point=w,M.lineStart=R,M.lineEnd=z,v=[],y=[]},polygonEnd:function(){M.point=A,M.lineStart=x,M.lineEnd=T,v=gg(v);var U=Jx(y,f);v.length?(g||(u.polygonStart(),g=!0),Yx(v,EQ,U,e,u)):U&&(g||(u.polygonStart(),g=!0),u.lineStart(),e(null,null,1,u),u.lineEnd()),g&&(u.polygonEnd(),g=!1),v=y=null},sphere:function(){u.polygonStart(),u.lineStart(),e(null,null,1,u),u.lineEnd(),u.polygonEnd()}};function A(U,D){var P=s(U,D);n(U=P[0],D=P[1])&&u.point(U,D)}function _(U,D){var P=s(U,D);c.point(P[0],P[1])}function x(){M.point=_,c.lineStart()}function T(){M.point=A,c.lineEnd()}function w(U,D){E.push([U,D]);var P=s(U,D);d.point(P[0],P[1])}function R(){d.lineStart(),E=[]}function z(){w(E[0][0],E[0][1]),d.lineEnd();var U=d.clean(),D=p.result(),P,ct=D.length,L,W,V;if(E.pop(),y.push(E),E=null,!!ct){if(U&1){if(W=D[0],(L=W.length-1)>0){for(g||(u.polygonStart(),g=!0),u.lineStart(),P=0;P<L;++P)u.point((V=W[P])[0],V[1]);u.lineEnd()}return}ct>1&&U&2&&D.push(D.pop().concat(D.shift())),v.push(D.filter(xQ))}}return M}}function xQ(n){return n.length>1}function EQ(n,t){return((n=n.x)[0]<0?n[1]-br-yn:br-n[1])-((t=t.x)[0]<0?t[1]-br-yn:br-t[1])}var SQ=Qx(function(){return!0},wQ,bQ,[-Tn,-br]);function wQ(n){var t=NaN,e=NaN,i=NaN,s;return{lineStart:function(){n.lineStart(),s=1},point:function(u,c){var f=u>0?Tn:-Tn,p=nr(u-t);nr(p-Tn)<yn?(n.point(t,e=(e+c)/2>0?br:-br),n.point(i,e),n.lineEnd(),n.lineStart(),n.point(f,e),n.point(u,e),s=0):i!==f&&p>=Tn&&(nr(t-i)<yn&&(t-=i*yn),nr(u-f)<yn&&(u-=f*yn),e=MQ(t,e,u,c),n.point(i,e),n.lineEnd(),n.lineStart(),n.point(f,e),s=0),n.point(t=u,e=c),i=f},lineEnd:function(){n.lineEnd(),t=e=NaN},clean:function(){return 2-s}}}function MQ(n,t,e,i){var s,u,c=Me(n-e);return nr(c)>yn?Uo((Me(t)*(u=hn(i))*Me(e)-Me(i)*(s=hn(t))*Me(n))/(s*u*c)):(t+i)/2}function bQ(n,t,e,i){var s;if(n==null)s=e*br,i.point(-Tn,s),i.point(0,s),i.point(Tn,s),i.point(Tn,0),i.point(Tn,-s),i.point(0,-s),i.point(-Tn,-s),i.point(-Tn,0),i.point(-Tn,s);else if(nr(n[0]-t[0])>yn){var u=n[0]<t[0]?Tn:-Tn;s=e*u/2,i.point(-u,s),i.point(0,s),i.point(u,s)}else i.point(t[0],t[1])}function mg(n){return function(t){var e=new t1;for(var i in n)e[i]=n[i];return e.stream=t,e}}function t1(){}t1.prototype={constructor:t1,point:function(n,t){this.stream.point(n,t)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}};var l1t=hn(30*Fi);var w1t=mg({point:function(n,t){this.stream.point(n*Fi,t*Fi)}});function yg(n){return function(t,e){var i=hn(t),s=hn(e),u=n(i*s);return[u*s*Me(t),u*Me(e)]}}function ss(n){return function(t,e){var i=jr(t*t+e*e),s=n(i),u=Me(s),c=hn(s);return[Ui(t*u,i*c),Ci(i&&e*u/i)]}}var mO=yg(function(n){return jr(2/(1+n))});mO.invert=ss(function(n){return 2*Ci(n/2)});var yO=yg(function(n){return(n=Hx(n))&&n/Me(n)});yO.invert=ss(function(n){return n});function e1(n,t){return[n,qf(Vf((br+t)/2))]}e1.invert=function(n,t){return[n,2*Uo(hg(t))-br]};function vg(n,t){return[n,t]}vg.invert=vg;function vO(n,t){var e=hn(t),i=hn(n)*e;return[e*Me(n)/i,Me(t)/i]}vO.invert=ss(Uo);function _O(n,t){var e=t*t,i=e*e;return[n*(.8707-.131979*e+i*(-.013791+i*(.003971*e-.001529*i))),t*(1.007226+e*(.015085+i*(-.044475+.028874*e-.005916*i)))]}_O.invert=function(n,t){var e=t,i=25,s;do{var u=e*e,c=u*u;e-=s=(e*(1.007226+u*(.015085+c*(-.044475+.028874*u-.005916*c)))-t)/(1.007226+u*(.015085*3+c*(-.044475*7+.028874*9*u-.005916*11*c)))}while(nr(s)>yn&&--i>0);return[n/(.8707+(u=e*e)*(-.131979+u*(-.013791+u*u*u*(.003971-.001529*u)))),e]};function xO(n,t){return[hn(t)*Me(n),Me(t)]}xO.invert=ss(Ci);function EO(n,t){var e=hn(t),i=1+hn(n)*e;return[e*Me(n)/i,Me(t)/i]}EO.invert=ss(function(n){return 2*Uo(n)});function SO(n,t){return[qf(Vf((br+t)/2)),-n]}SO.invert=function(n,t){return[-t,2*Uo(hg(n))-br]};var RQ=jt(oc(),1);var LQ=jt(oc(),1);var OQ=jt(oc(),1);var DQ=jt(oc(),1);function Mu(n,t){return Math.sqrt((t[0]-n[0])**2+(t[1]-n[1])**2)}function MO(n,t,e){let i=new Ot(t[0]-n[0],t[1]-n[1]),s=new Ot(t[0]-e[0],t[1]-e[1]),c=i.angleTo(s)*180/Math.PI,f=new Ot(t[0]-n[0],t[1]-n[1]);return new Ot(e[0]-n[0],e[1]-n[1]).cross(f)>0?c:-c}function bO(n,t){let e=0,i=1/0,[s,u]=t;for(let c=0;c<n.length-1;c++){let[f,p]=n[c],[d,g]=n[c+1],y=Math.min(f,d)<=s&&s<=Math.max(f,d),v=Math.min(p,g)<=u&&u<=Math.max(p,g);if(y&&v){let E=Math.abs((d-f)*(u-p)-(g-p)*(s-f));E<i&&(i=E,e=c)}}return e}function AO(n,t){let e=n[0],i=n[1],s=!1;for(let u=0,c=t.length-1;u<t.length;c=u++){let f=t[u][0],p=t[u][1],d=t[c][0],g=t[c][1];p>i!=g>i&&e<(d-f)*(i-p)/(g-p)+f&&(s=!s)}return s}var zAt=jt(KO(),1),GAt=jt(a_(),1);function cD(n){return n.replace(/[A-Z]/g,t=>"_"+t.toLowerCase()).replace(/^_/,"")}function fD(n){let t={};for(let i in n)i.startsWith("on")&&(t[cD(i.slice(2))]=n[i],t[i]=n[i]);let e=i=>Ri(this,null,function*(){let{data:s}=i;if(t[s.type])try{let u=yield t[s.type](s.data);if(u!=null&&u.$transfer&&Array.isArray(u.$transfer)){let c=u.$transfer;delete u.$transfer,self.postMessage({type:""+s.type+"_result",key:s.key,data:u},c)}else self.postMessage({type:""+s.type+"_result",key:s.key,data:u})}catch(u){self.postMessage({type:""+s.type+"_result",key:s.key,error:u})}else self.postMessage({type:""+s.type+"_result",key:s.key,error:"no_event"})});return self.addEventListener("message",e),()=>{self.removeEventListener("message",e)}}var $At=jt(CD(),1),ZAt=jt(Yu(),1);function ID(n,t,e){e===void 0&&(e=0),n.forEach(i=>{if(i.geometry.coords=JSON.parse(JSON.stringify(i.geometry.cds)),i.geometry.type==="polygon"){var s;i.geometry.coords.map(u=>{Array.isArray(u)&&u.forEach(c=>{c[0]-=t[0],c[1]-=t[1]})}),i.geometry.otherCds&&(i.geometry.otherCoords=i.geometry.otherCds.map(u=>u.map(c=>uc(c,t)))),(s=i.doors)!=null&&s.length&&i.doors.map(u=>{u.coord=uc(u.coordinate,t)}),i.center&&(i.centerCoords=uc(i.center,t))}else i.geometry.coords=uc(i.geometry.cds,t),i.center&&(i.centerCoords=uc(i.center,t));if(i.center_x&&i.center_y){let[u,c]=uc([i.center_x,i.center_y],t);i.center_coord_x=u,i.center_coord_y=c}});for(let i=0;i<n.length;i++){let s=n[i];s.deltaHeight=1e-5*(e+i+1)}}function uc(n,t){return[n[0]-t[0],n[1]-t[1]]}var rTt=jt(g0(),1),iTt=jt(m0(),1),oTt=jt(y0(),1),sTt=jt(_0(),1),aTt=jt(x0(),1),uTt=jt(M0(),1),lTt=jt(R0(),1),cTt=jt(N0(),1),fTt=jt(O0(),1),hTt=jt(F0(),1),pTt=jt(B0(),1),dTt=jt(q0(),1),gTt=jt(W0(),1),mTt=jt(sy(),1),yTt=jt(ay(),1),vTt=jt(Mh(),1),_Tt=jt(Yu(),1);function Eg(n,t=!1){let e=n[0].index!==null,i=new Set(Object.keys(n[0].attributes)),s=new Set(Object.keys(n[0].morphAttributes)),u={},c={},f=n[0].morphTargetsRelative,p=new ui,d=0;for(let g=0;g<n.length;++g){let y=n[g],v=0;if(e!==(y.index!==null))return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+g+". All geometries must have compatible attributes; make sure index attribute exists among all geometries, or in none of them."),null;for(let E in y.attributes){if(!i.has(E))return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+g+'. All geometries must have compatible attributes; make sure "'+E+'" attribute exists among all geometries, or in none of them.'),null;u[E]===void 0&&(u[E]=[]),u[E].push(y.attributes[E]),v++}if(v!==i.size)return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+g+". Make sure all geometries have the same number of attributes."),null;if(f!==y.morphTargetsRelative)return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+g+". .morphTargetsRelative must be consistent throughout all geometries."),null;for(let E in y.morphAttributes){if(!s.has(E))return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+g+". .morphAttributes must be consistent throughout all geometries."),null;c[E]===void 0&&(c[E]=[]),c[E].push(y.morphAttributes[E])}if(t){let E;if(e)E=y.index.count;else if(y.attributes.position!==void 0)E=y.attributes.position.count;else return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+g+". The geometry must have either an index or a position attribute"),null;p.addGroup(d,E,g),d+=E}}if(e){let g=0,y=[];for(let v=0;v<n.length;++v){let E=n[v].index;for(let M=0;M<E.count;++M)y.push(E.getX(M)+g);g+=n[v].attributes.position.count}p.setIndex(y)}for(let g in u){let y=PD(u[g]);if(!y)return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed while trying to merge the "+g+" attribute."),null;p.setAttribute(g,y)}for(let g in c){let y=c[g][0].length;if(y===0)break;p.morphAttributes=p.morphAttributes||{},p.morphAttributes[g]=[];for(let v=0;v<y;++v){let E=[];for(let A=0;A<c[g].length;++A)E.push(c[g][A][v]);let M=PD(E);if(!M)return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed while trying to merge the "+g+" morphAttribute."),null;p.morphAttributes[g].push(M)}}return p}function PD(n){let t,e,i,s=-1,u=0;for(let d=0;d<n.length;++d){let g=n[d];if(t===void 0&&(t=g.array.constructor),t!==g.array.constructor)return console.error("THREE.BufferGeometryUtils: .mergeAttributes() failed. BufferAttribute.array must be of consistent array types across matching attributes."),null;if(e===void 0&&(e=g.itemSize),e!==g.itemSize)return console.error("THREE.BufferGeometryUtils: .mergeAttributes() failed. BufferAttribute.itemSize must be consistent across matching attributes."),null;if(i===void 0&&(i=g.normalized),i!==g.normalized)return console.error("THREE.BufferGeometryUtils: .mergeAttributes() failed. BufferAttribute.normalized must be consistent across matching attributes."),null;if(s===-1&&(s=g.gpuType),s!==g.gpuType)return console.error("THREE.BufferGeometryUtils: .mergeAttributes() failed. BufferAttribute.gpuType must be consistent across matching attributes."),null;u+=g.count*e}let c=new t(u),f=new Zn(c,e,i),p=0;for(let d=0;d<n.length;++d){let g=n[d];if(g.isInterleavedBufferAttribute){let y=p/e;for(let v=0,E=g.count;v<E;v++)for(let M=0;M<e;M++){let A=g.getComponent(v,M);f.setComponent(v+y,M,A)}}else c.set(g.array,p);p+=g.count*e}return s!==void 0&&(f.gpuType=s),f}function RD(n,t,e){t===void 0&&(t=!0),e===void 0&&(e=!1);let i=n.filter(f=>f.geometry.type==="polygon");if(!i.length)return null;let s=i.map(f=>{var p;let d=f.geometry.coords,g=hd(d[0],d.slice(1)),y=new id(g,{steps:1,bevelEnabled:!1,depth:f.height,curveSegments:4});(p=f).deltaHeight||(p.deltaHeight=0),y.translate(0,0,f.airHeight+f.deltaHeight);let v=y.attributes.position.count,E=new Float32Array(v).fill(f.height+f.airHeight+f.deltaHeight);if(y.setAttribute("maxZ",new Zn(E,1)),y.setAttribute("opacity",new Zn(new Float32Array(v).fill(f.fillOpacity),1)),e){let _=new Float32Array(v).fill(f.airHeight+f.deltaHeight);y.setAttribute("minZ",new Zn(_,1))}let M=new Te(f.fillColor).convertLinearToSRGB(),A=new Float32Array(v*3);for(let _=0;_<v;_++)A[_*3]=M.r,A[_*3+1]=M.g,A[_*3+2]=M.b;return y.setAttribute("color",new Zn(A,3)),y}),u=Eg(s);s.forEach(f=>f.dispose());let c={geometry:u};return u.dispose(),t&&(c.lineGeometry=Sg(i)||void 0),c}function h1(n){let t=n.filter(p=>p.geometry.type==="polygon");if(!t.length)return null;let e=[],i=[],s=[],u=[],c=[],f=[];return t.map((p,d)=>{var g;(g=p).deltaHeight||(g.deltaHeight=0);let y=p.geometry.coords,v=Mu(y[0][0],y[0][1]),E=Mu(y[0][1],y[0][2]),M=y[0][1][0]-y[0][0][0],A=y[0][1][1]-y[0][0][1],_=Math.atan2(A,M),x=du(Un(y)),T=x.geometry.coordinates[0],w=x.geometry.coordinates[1],R=new $n().compose(new st(T,w,p.deltaHeight+p.airHeight+p.height/2),new lo().setFromAxisAngle(new st(0,0,1),_),new st(v,E,p.height));e.push(...R.toArray()),i.push(...new Te(p.fillColor).convertLinearToSRGB().toArray()),s[d]=p.fillOpacity||1,u[d]=(p.deltaHeight||0)+p.airHeight+p.height,c[d]=p.id,f[d]=p.airHeight+p.deltaHeight}),{size:t.length,ids:c,matrixes:e,colors:i,opacities:s,maxZs:u,minZs:f}}function Sg(n){let{points:t,colors:e,opacities:i}=iet(n);if(!t.length)return null;let s=new ui().setFromPoints(t);return s.setAttribute("color",new Zn(new Float32Array(e),3)),s.setAttribute("opacity",new Zn(new Float32Array(i),1)),s}function iet(n){let t=[],e=[],i=[];return n.filter(s=>s.strokeOpacity>0).map(s=>{let u=s.height+(s.deltaHeight||0)+s.airHeight,{coords:c}=s.geometry,{strokeColor:f,strokeOpacity:p}=s,d=new Te(f).convertLinearToSRGB();for(let g=0;g<c.length;g++){let y=c[g];for(let v=0;v<y.length;v++){let E=y[v],M=v+1===y.length?y[0]:y[v+1];t.push(new st(E[0],E[1],u)),t.push(new st(M[0],M[1],u)),e.push(d.r,d.g,d.b),e.push(d.r,d.g,d.b),i.push(p),i.push(p)}}}),{points:t,colors:e,opacities:i}}function LD(n){if(n.length>1)return!1;let t=n[0];if(t.length!==5)return!1;let[e]=t,i=t[t.length-1];if(e[0]!==i[0]||e[1]!==i[1])return!1;let s=[Math.round(Mu(t[0],t[1])),Math.round(Mu(t[1],t[2])),Math.round(Mu(t[2],t[3])),Math.round(Mu(t[3],t[4]))];if(!(s[2]===s[0]&&s[3]===s[1]))return!1;let u=MO(t[0],t[1],t[2]);return Math.abs(Math.abs(u)-90)<1}var Yf=function(n){return n.HALF="half",n.POWER="power",n.MECHANICAL="mechanical",n.NORMAL="normal",n.VIP="vip",n}({});var ND=new Ko,wg=new st,Mg=class extends ad{constructor(){super(),this.isLineSegmentsGeometry=!0,this.type="LineSegmentsGeometry";let t=[-1,2,0,1,2,0,-1,1,0,1,1,0,-1,0,0,1,0,0,-1,-1,0,1,-1,0],e=[-1,2,1,2,-1,1,1,1,-1,-1,1,-1,-1,-2,1,-2],i=[0,2,1,2,3,1,2,4,3,4,5,3,4,6,5,6,7,5];this.setIndex(i),this.setAttribute("position",new _r(t,3)),this.setAttribute("uv",new _r(e,2))}applyMatrix4(t){let e=this.attributes.instanceStart,i=this.attributes.instanceEnd;return e!==void 0&&(e.applyMatrix4(t),i.applyMatrix4(t),e.needsUpdate=!0),this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this}setPositions(t){let e;t instanceof Float32Array?e=t:Array.isArray(t)&&(e=new Float32Array(t));let i=new vf(e,6,1);return this.setAttribute("instanceStart",new ts(i,3,0)),this.setAttribute("instanceEnd",new ts(i,3,3)),this.computeBoundingBox(),this.computeBoundingSphere(),this}setColors(t){let e;t instanceof Float32Array?e=t:Array.isArray(t)&&(e=new Float32Array(t));let i=new vf(e,6,1);return this.setAttribute("instanceColorStart",new ts(i,3,0)),this.setAttribute("instanceColorEnd",new ts(i,3,3)),this}fromWireframeGeometry(t){return this.setPositions(t.attributes.position.array),this}fromEdgesGeometry(t){return this.setPositions(t.attributes.position.array),this}fromMesh(t){return this.fromWireframeGeometry(new sd(t.geometry)),this}fromLineSegments(t){let e=t.geometry;return this.setPositions(e.attributes.position.array),this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new Ko);let t=this.attributes.instanceStart,e=this.attributes.instanceEnd;t!==void 0&&e!==void 0&&(this.boundingBox.setFromBufferAttribute(t),ND.setFromBufferAttribute(e),this.boundingBox.union(ND))}computeBoundingSphere(){this.boundingSphere===null&&(this.boundingSphere=new uu),this.boundingBox===null&&this.computeBoundingBox();let t=this.attributes.instanceStart,e=this.attributes.instanceEnd;if(t!==void 0&&e!==void 0){let i=this.boundingSphere.center;this.boundingBox.getCenter(i);let s=0;for(let u=0,c=t.count;u<c;u++)wg.fromBufferAttribute(t,u),s=Math.max(s,i.distanceToSquared(wg)),wg.fromBufferAttribute(e,u),s=Math.max(s,i.distanceToSquared(wg));this.boundingSphere.radius=Math.sqrt(s),isNaN(this.boundingSphere.radius)&&console.error("THREE.LineSegmentsGeometry.computeBoundingSphere(): Computed radius is NaN. The instanced position data is likely to have NaN values.",this)}}toJSON(){}applyMatrix(t){return console.warn("THREE.LineSegmentsGeometry: applyMatrix() has been renamed to applyMatrix4()."),this.applyMatrix4(t)}};var ITt=jt(lD(),1);var bg=function(n){return n.LAYERED_RENDER_VERSION="layeredRender",n.MERGED_RENDER_VERSION="mergedRender",n}({});var p1=["range","ground","store","facility","parkingSpace"];function OD(n){return p1.indexOf(n.l_type)===-1?p1.length:p1.indexOf(n.l_type)}function oet(n){n.layers.sort((t,e)=>OD(t)-OD(e))}function set(n){let t=n.layers.find(i=>i.l_type==="range"),e=[t.elements[0].center_x,t.elements[0].center_y];n.layers.map(i=>{if(i.l_type!=="range")return ID(i.elements,e)})}function DD(n){oet(n),set(n)}function Ag(n,t){return t===void 0&&(t=5),n.floor_id+"_"+n.version_id+(t?"_"+t:"")}var lc=[],cc=[];function UD(n,t){return Ri(this,null,function*(){return yield ip(),py(n,""+t)})}function FD(n,t,e){return Ri(this,null,function*(){let{db:i}=yield ip();return hC(n,""+t,e,i)})}function aet(n){return Ri(this,null,function*(){let t=yield fetch(n.map_url).then(e=>e.json());return t.floor=n.floor,DD(t),lc.push(t),t})}function uet(n,t){return Ri(this,null,function*(){let e=Ag(n,t===bg.LAYERED_RENDER_VERSION?1:void 0);try{let i=yield UD(jc.MAP_DATA,e);return i&&(t===bg.LAYERED_RENDER_VERSION||i.transformed)?(console.log("\\u4ECE\\u7F13\\u5B58\\u4E2D\\u53D6\\u5230\\u4E86\\u6570\\u636E"),i):(console.log("\\u7F13\\u5B58\\u4E2D\\u6CA1\\u6709\\u6570\\u636E",e,i),cc.push(n),null)}catch(i){return console.log("[get floor data error]",i),cc.push(n),null}})}function cet(n,t){return t===void 0&&(t=!0),t&&(n.layers.forEach(e=>{switch(e.l_type){case"ground":break;case"store":d1(e.elements),e.mergedElements=Tg(e.elements);break;case"facility":d1(e.elements),e.mergedElements=Tg(e.elements);break;case"parkingSpace":console.time("parkingSpace merge"),e.mergedElements=fet(e.elements),console.timeEnd("parkingSpace merge"),e.mergedParkingTexture=det(e.elements);break;case"graph":d1(e.elements),e.mergedElements=Tg(e.elements);break;case"wall":e.mergedElements=Tg(e.elements,!1,!0);break;case"lane":e.mergedElements=het(e.elements);break;case"texture2d":case"texture3d":e.mergedMatrixes=BD(e.elements);break;case"glb":case"text":}}),n.transformed=!0),n}function Tg(n,t,e){t===void 0&&(t=!0),e===void 0&&(e=!1);let i=[],s=[];n.forEach(p=>{p.geometry.type==="point"||p.doors.length?s.push(p):LD(p.geometry.cds)?i.push(p):s.push(p)});let u=h1(i),c=RD(s,!1,e),f=null;return t&&(f=Sg(n)),[Bu({},n[0],{mergedGeometry:(c==null?void 0:c.geometry.toJSON())||null,lineGeometry:(f==null?void 0:f.toJSON())||null,instancedGeometry:u})]}function fet(n){let t=h1(n),e=Sg(n);return Bu({},t,{lineGeometry:(e==null?void 0:e.toJSON())||null})}function BD(n){let t=n.reduce((i,s)=>{let{iconUrl:u}=s;return i.has(u)||i.set(u,[]),i.get(u).push(s),i},new Map);return Array.from(t.values()).map(i=>{let s=i.map(c=>new $n().compose(new st(c.centerCoords[0],c.centerCoords[1],c.deltaHeight+c.airHeight+c.height),new lo().setFromAxisAngle(new st(0,0,1),c.secondRotate),new st(c.secondWidth,c.secondHeight,1)).toArray());return Bu({},i[0],{mergedMatrixes:{size:s.length,array:s.flat()}})})}function het(n){let t=n.map(u=>{let c=hd(u.geometry.coords[0].slice(0,-1),u.geometry.coords.slice(1)),f=new od(c,4),p=f.getAttribute("position"),d=[],g=new Te(u.fillColor);for(let v=0;v<p.count;v++){p.setZ(v,u.airHeight+(u.deltaHeight||0));var y;d.push(g.r,g.g,g.b,(y=u.fillOpacity)!=null?y:1)}return f.setAttribute("color",new Zn(new Float32Array(d),4)),f}),e=Eg(t);t.forEach(u=>u.dispose());let i={mergedGeometry:e.toJSON()};e.dispose();let s=n.filter(u=>{var c,f;return u.double&&((f=u.geometry.otherCoords)==null||(c=f[1])==null?void 0:c.length)});return s.length&&[!0,!1].forEach(u=>{let c=s.filter(g=>g.double===!0&&g.dashed===u);if(!c.length)return;let f=[],p=[];c.forEach(g=>{let y=g.geometry.otherCoords[1],v=g.airHeight+(g.deltaHeight||0)+.01,E=new Te(g.secondColor);for(let M=0;M<y.length-1;M++){let A=y[M],_=y[M+1];f.push(A[0],A[1],v,_[0],_[1],v),p.push(E.r,E.g,E.b,E.r,E.g,E.b)}});let d=new Mg;d.setPositions(f),d.setColors(p),i[u?"dashedLineGeometry":"lineGeometry"]={positions:f,colors:p},d.dispose()}),i}var pet=new Set([Yf.HALF,Yf.MECHANICAL,Yf.POWER,Yf.VIP]);function det(n){let t=n.filter(e=>pet.has(e.parkingType)).map(e=>{let i=new Ot(...e.geometry.coords[0][0]),s=new Ot(...e.geometry.coords[0][1]),u=new Ot(...e.geometry.coords[0][2]),c=Math.min(i.distanceTo(s),s.distanceTo(u)),f=0;return c===i.distanceTo(s)?f=s.sub(i).angle()-Math.PI/2:f=u.sub(s).angle()-Math.PI/2,{uuid:e.id,iconUrl:e.parkingType,name:e.texts[0],deltaHeight:(e.deltaHeight||0)+.001,airHeight:e.airHeight,height:e.height,geometry:e.geometry,opacity:e.fillOpacity,visible:!0,secondWidth:c-1,secondHeight:c-1,secondRotate:f,centerCoords:[e.center_coord_x,e.center_coord_y]}});return BD(t)}function d1(n){n.map(t=>{var e;if((e=t.doors)!=null&&e.length&&t.geometry.type==="polygon"){let i=t.geometry.coords[0];t.doors.forEach(s=>{let u=s.type==="single"?.5:1,c=.5,f=bO(i,s.coord),p=new Ot(...s.coord),d=new Ot(...i[f]).sub(new Ot(...s.coord)).normalize(),g=new Ot().addVectors(p,d.clone().multiplyScalar(u)),y=new Ot().addVectors(p,d.clone().multiplyScalar(-u)),v=new Ot(-d.y,d.x),E=new Ot().addVectors(g,v.clone().multiplyScalar(c));AO([E.x,E.y],i)||(v.multiplyScalar(-1),E=new Ot().addVectors(g,v.clone().multiplyScalar(c)));let M=new Ot().addVectors(y,v.clone().multiplyScalar(c)),A=[[g.x,g.y],[E.x,E.y],[M.x,M.y],[y.x,y.y]];i=[...i.slice(0,f+1),...A,...i.slice(f+1)]}),t.geometry.coords[0]=i}})}var g1="";function zD(n){let t=cc.findIndex(e=>e.floor===n);if(t!==-1){console.log("\\u8C03\\u6574\\u697C\\u5C42\\u8BF7\\u6C42\\u7684\\u4F18\\u5148\\u7EA7",n,t);let e=cc.splice(t,1)[0];cc.unshift(e)}else g1=n}var m1="";function GD(n){let t=lc.findIndex(e=>e.floor===n);if(t!==-1){console.log("\\u8C03\\u6574\\u697C\\u5C42merge\\u4F18\\u5148\\u7EA7",n,t);let e=lc.splice(t,1)[0];lc.unshift(e)}else m1=n}function get(n){zD(n),GD(n)}fD({onLoad(n){return Ri(this,null,function*(){let{floors:t,version:e}=n;for(yield ip(),yield Promise.all(t.map(i=>Ri(this,null,function*(){return uet(i,e)}))),g1&&zD(g1),yield Promise.all(cc.map(i=>Ri(this,null,function*(){let s=yield aet(i);if(s&&e===bg.LAYERED_RENDER_VERSION){let u=Ag(t.find(c=>c.floor===s.floor),1);yield FD(jc.MAP_DATA,u,s),console.log(s.floor+" \\u5199\\u5165\\u7F13\\u5B58\\u6210\\u529F\\uFF0Ckey="+u),self.postMessage({type:"floor_success",data:{floor:s.floor}})}}))),m1&&GD(m1);lc.length>0;){let i=lc.shift(),s=cet(i),u=Ag(t.find(f=>f.floor===i.floor));yield FD(jc.MAP_DATA,u,s),console.log(i.floor+" \\u5199\\u5165\\u7F13\\u5B58\\u6210\\u529F\\uFF0Ckey="+u);let c=performance.now();yield UD(jc.MAP_DATA,u),console.log(i.floor+" \\u7F13\\u5B58\\u7F13\\u5B58\\u8BFB\\u53D6\\uFF0Ckey="+u,performance.now()-c),self.postMessage({type:"floor_success",data:{floor:i.floor}})}pC(),console.log("\\u6240\\u6709\\u6570\\u636E\\u5904\\u7406\\u5B8C\\u6210")})},onAdjustFloorPriority(n){let{floor:t}=n;get(t)}});
|
|
11923
|
-
`],{type:"text/javascript"}),t=URL.createObjectURL(a),e=new Worker(t);return URL.revokeObjectURL(t),e}var Gu={mergeParkingSpace:!0,mergeGraphic:!0,renderVersion:fn.MERGED_RENDER_VERSION,layers:["graph","wall","lane","texture2d","texture3d","glb","store","facility","parkingSpace","text"],filterPoi:()=>!0},Je=class extends ct{initDb(){return g(this,null,function*(){try{let{db:t}=yield Pr();this.db=t}catch(t){console.log("[\u6253\u5F00indexDb\u9519\u8BEF]",t)}})}load(t,e){return g(this,null,function*(){if(Array.isArray(t))this.floors=t,e&&(this.placeConfig=v({},this.placeConfig,e));else if(typeof t=="string"){let n=yield fetch(t).then(r=>r.json());n.code===200&&(this.floors=n.data.list,this.placeConfig=v({},this.placeConfig,JSON.parse(n.data.config||"{}")))}else return this.load("https://screen.aibee.cn/ai-map/map/get-floor-map?place_id="+t);this.getOtherDataByFreeTime()})}setCacheData(t,e,n){return g(this,null,function*(){return this.initDbPromise.then(()=>Lr(t,""+e,n))})}getCacheData(t,e){return g(this,null,function*(){return this.initDbPromise.then(()=>Un(t,""+e))})}getFloorData(t){return g(this,null,function*(){let e=yield this.getFloorJsonData(t);return e?this.getDataByJson(e):null})}getFloorDataByFloorInfo(t){return g(this,null,function*(){let e=yield this.getFloorJsonDataByFloorInfo(t);return this.getDataByJson(e)})}setLocale(t){this.locale=t,this.bmap.context.currentFloor&&this.bmap.context.currentFloor.poiLayer2.pois.forEach(e=>{e.userData.type==="store"&&(e.options.text=$r(e.userData.data,t)),e.userData.type==="facility"&&(e.options.text=Jr(e.userData.data,t))})}getFloorJsonDataByFloorInfo(t){return g(this,null,function*(){if(this.getFloorDataPromise.has(t.floor))return this.getFloorDataPromise.get(t.floor);let e=new Promise(n=>g(this,null,function*(){let r=dn(t),i=yield fetch(t.map_url).then(o=>o.json());i.floor=t.floor,pr(i),this.setCacheData(Pt.MAP_DATA,r,i),this.setCacheData(Pt.MAP_VERSION,r,t.version_id),n(i)}));return this.getFloorDataPromise.set(t.floor,e),e})}getFloorJsonData(t){return g(this,null,function*(){let e=this.floors.find(n=>n.floor===t);return e?new Promise(n=>g(this,null,function*(){let r=dn(e,this.options.renderVersion===fn.LAYERED_RENDER_VERSION?1:void 0);try{let i=dn(e),o=yield this.getCacheData(Pt.MAP_DATA,i);if(o&&o.transformed){console.log("\u4ECE\u7F13\u5B58\u4E2D\u53D6\u5230\u4E86\u5408\u5E76\u540E\u7684\u6570\u636E"),n(o);return}if(this.options.renderVersion===fn.LAYERED_RENDER_VERSION){let s=yield this.getCacheData(Pt.MAP_DATA,r);if(s){console.log("\u4ECE\u7F13\u5B58\u4E2D\u53D6\u5230\u4E86\u6570\u636E"),n(s);return}}if(console.log("\u7F13\u5B58\u4E2D\u6CA1\u6709\u6570\u636E"),this.loadWorker){Z(this.loadWorker,"adjust_floor_priority",{floor:t});let s=u=>{if(u.data.type==="floor_success"&&u.data.data.floor===t){var l;(l=this.loadWorker)==null||l.removeEventListener("message",s),n(this.getFloorJsonData(t))}};this.loadWorker.addEventListener("message",s)}else n(this.getFloorJsonDataByFloorInfo(e))}catch(i){console.log("[get floor data error]",i),n(this.getFloorJsonDataByFloorInfo(e))}})):null})}getRoadNetworkData(){return g(this,null,function*(){return(yield Promise.all(this.floors.map(e=>g(this,null,function*(){let n=dn(e,0);try{let r=yield this.getCacheData(Pt.ROAD_NETWORK_DATA,n);if(r)return r;let i=yield fetch(e.route_url).then(o=>o.json());return this.setCacheData(Pt.ROAD_NETWORK_DATA,n,i),this.setCacheData(Pt.ROUTE_VERSION,n,e.version_id),i}catch(r){let i=yield fetch(e.route_url).then(o=>o.json());return this.setCacheData(Pt.ROAD_NETWORK_DATA,n,i),i}})))).filter(e=>e.points)})}getFacilitiesData(){return g(this,null,function*(){let t=this.floors.reduce((r,i)=>r.updated_at>i.updated_at?r:i,this.floors[0]);if(!t)return null;let e=dn(t,0),n=()=>g(this,null,function*(){let r=yield fetch(t.entry_infra_url).then(i=>i.json());return r&&(this.setCacheData(Pt.FACILITY_DATA,e,r),this.setCacheData(Pt.FACILITY_VERSION,e,t.version_id)),r});try{let r=yield this.getCacheData(Pt.FACILITY_DATA,e);return r||n()}catch(r){return console.log("[get facility error]",r),n()}})}getOtherDataByFreeTime(){return g(this,null,function*(){yield this.initDbPromise,yield Z(this.loadWorker,"load",{floors:this.floors,version:this.options.renderVersion}),this.closeWorker()})}getMulFloorsData(t){return g(this,null,function*(){return Promise.all(t.map(e=>this.getFloorData(e))).then(e=>e.filter(n=>n))})}getDataByUrl(t){return g(this,null,function*(){let e=yield fetch(t).then(n=>n.json());return this.getDataByJson(e)})}getDataByJson(t,e,n){return g(this,null,function*(){pr(t),e=this.getFloorBaseLayer(t,e);let r=v({},this.placeConfig,n);return yield this.getFloorContentLayer(t,e),yield this.getFloorPoi(t,e,r),this.changeFloorBox(t,e),e})}getDataByJsonStep(t,e,n){return g(this,null,function*(){pr(t),e=this.getFloorBaseLayer(t,e);let r=v({},this.placeConfig,n);return this.changeFloorBox(t,e),requestAnimationFrame(()=>g(this,null,function*(){yield this.getFloorContentLayer(t,e),this.changeFloorBox(t,e),requestAnimationFrame(()=>g(this,null,function*(){yield this.getFloorPoi(t,e,r),this.changeFloorBox(t,e)}))})),e})}changeFloorBox(t,e){e.updateBox();let n=e.box.getSize(new Qr.Vector3),r=Math.max(n.x,n.y,n.z);e.userData.height=r/4+t.floorHeight}switchFloor(t,e){return g(this,null,function*(){return new Promise(n=>{let r={run:()=>this._switchFloor(t,e),meta:{type:"switchFloor"}},i=this.taskQueue.replaceByMetaType(r),o=s=>{let{task:u,res:l}=s;u.tid===i&&(this.taskQueue.removeEventListener("active-task-end",o),n(l))};this.taskQueue.addEventListener("active-task-end",o)})})}_switchFloor(t,e){return g(this,null,function*(){var n;let r=t;if(typeof t=="string"){let c=yield this.getFloorJsonData(t);if(c)r=c;else return null}else pr(t);let i=v({},this.placeConfig,e),o=new re(this.bmap.context);o.userData.data=t;let s=this.floors.find(c=>c.floor===r.floor);var u;let l=(u=s==null?void 0:s.map_angle)!=null?u:0;return this.bmap.dispatchEvent({type:bt.SWITCH_FLOOR_BEFORE,data:{curFloor:o,graphics:[]}}),this.dispatchEvent({type:"switch-floor-before",data:{curFloor:o,graphics:[],floorData:r}}),this.bmap.context.scene.background=new Qr.Color(i.backgroundColor),this.getFloorBaseLayer(r,o),this.changeFloorBox(r,o),this.bmap.buildingCenter=o.userData.center,this.bmap.currentBuildGround=(n=o.userData.data.layers.find(c=>c.l_type==="range"))==null?void 0:n.elements[0],this.bmap.context.switchFloor(o),this.bmap.initialFloorCamera(),this.bmap.context.control.setAzimuthalAngle(l/180*Math.PI,!0),this.bmap.context.cameraBound.updateBox(),this.dispatchEvent({type:"switch-floor-ground",data:{curFloor:o,graphics:[]}}),this.bmap.dispatchEvent({type:bt.SWITCH_FLOOR_GROUND,data:{curFloor:o}}),yield Mr(),yield this.getFloorContentLayer(r,o),this.changeFloorBox(r,o),this.bmap.context.cameraBound.updateBox(),this.dispatchEvent({type:"switch-floor-content",data:{curFloor:o,graphics:[]}}),yield Mi(2),yield this.getFloorPoi(r,o,i),this.dispatchEvent({type:"switch-floor-after",data:{curFloor:o,graphics:o.graphicLayer.children}}),this.bmap.dispatchEvent({type:bt.SWITCH_FLOOR_AFTER,data:{curFloor:o,graphics:o.graphicLayer.children}}),o})}getFloorBaseLayer(t,e){e||(e=new re(this.bmap.context));let n=[0,0];return t.layers.forEach(r=>{switch(r.l_type){case"range":let i=r.elements[0];n=[i.center_x,i.center_y],e.userData.range=i.geometry.cds[0],e.userData.rangeGraphic=i;break;case"ground":Ji(r,e);break;default:break}}),e.userData.center=n,e.name=t.floor,e.userData.data=t,e}getFloorContentLayer(t,e){return g(this,null,function*(){e||(e=new re(this.bmap.context)),e.userData.graphics=[],e.userData.graphicMap=new Map;let n=Date.now();for(let r=0;r<t.layers.length;r++){let i=t.layers[r];["range","ground"].includes(i.l_type)||this.options.layers.includes(i.l_type)&&(la(i,e,this.options),console.log("time",Date.now()-n,i.l_type),n=Date.now())}return e})}getFloorPoi(t,e,n){return g(this,null,function*(){n===void 0&&(n=this.placeConfig);let r=Date.now();yield Promise.all(t.layers.map(o=>{if(this.options.layers.includes(o.l_type))return ca(o,e,this.locale,n,this.options)})),console.log("poi time",Date.now()-r);let i=Date.now();Mr().then(()=>{console.log("poi render time",Date.now()-i)})})}clear(){return g(this,null,function*(){fs(),this.db=null})}closeWorker(){this.loadWorker&&(this.loadWorker.terminate(),this.loadWorker=null)}dispose(){super.dispose(),this.clear(),this.closeWorker(),this.getFloorDataPromise.clear()}constructor(t,e={}){super(),this.bmap=t,this.floors=[],this.initDbPromise=Promise.resolve(),this.db=null,this.taskQueue=new Ye,this.loadWorker=Qi(),this.locale="zh-cn",this.placeConfig={backgroundColor:"#f1f7f6",showFacilityName:!0,showStoreName:!0,textFontSize:14},this.getFloorDataPromise=new Map,this.options=v({},Gu,e),this.placeConfig=v({},this.placeConfig,t.config.loaderPlaceConfig),this.initDbPromise=this.initDb()}};var _v=require("core-js/modules/web.dom-collections.iterator.js");function to(a,t){return g(this,null,function*(){let{brand:e,project:n}=a,{apiDomain:r,apiPath:{floorRange:i},apiInfo:o}=t,s=""+r+i+"?brand="+e+"&project="+n+"&phase="+n+"&building="+n;return yield fetch(s,o).then(l=>l.json()).then(l=>l.data).then(l=>{let c=(l||[])[0];return c&&(c.info=JSON.parse(c.info)),c})})}function eo(a,t){return g(this,null,function*(){let{brand:e,project:n,floor:r,ts:i,resource_type_list:o}=a,{apiDomain:s,apiPath:{floorGraphic:u},apiInfo:l}=t,c=""+s+u+"?brand="+e+"&project="+n+"&phase="+n+"&building="+n+"&floor="+r+"&ts="+i+"&resource_type_list="+o;return yield fetch(c,l).then(p=>p.json()).then(p=>p.data).then(p=>((p||[]).map(f=>f.info=JSON.parse(f.info)),p||[]))})}function ku(a,t){return g(this,null,function*(){let{project:e,floor:n}=a,{apiDomain:r,apiInfo:i}=t,o=r+"/api/inception-map/external_street/get?projectCode="+e+"&floorCode="+n;return yield fetch(o,i).then(u=>u.json()).then(u=>u.data).then(u=>JSON.parse(u[0].streetInfo||"{}")).then(u=>u.fileId?Vu(u.fileId,t):null)})}function Vu(a,t){return g(this,null,function*(){let{apiDomain:e,apiInfo:n}=t;return fetch(e+"/api/inception-map/file/getFileStream?fileId="+a,n).then(r=>r.arrayBuffer()).then(r=>{let o=new TextDecoder("utf-8").decode(r);return o?JSON.parse(o):null})})}var no=class{load(t){return g(this,null,function*(){let e=Xe(t);if(this.cacheData.has(e))return this.cacheData.get(e);let[,n]=yield Promise.all([this.loadBuildGround(t),eo(t,this.bmap.config)]),r=Xe({floor:t.floor,ts:t.ts});Ln(n.map(o=>o.info),this.bmap.buildingCenter,this.floorDataLengthMap.get(r)||0),n.forEach(o=>o.info.transformToBuildingGround=!1),this.cacheData.set(e,n);let i=this.floorDataLengthMap.get(r)||0;return this.floorDataLengthMap.set(r,i+n.length),this.loadExternalStreet(t),n})}loadExternalStreet(t){return g(this,null,function*(){})}switchFloorByData(t,e){if(!t.length)return;let n=e.userData.legacyToGraphicMap||new Map,r=e.userData.graphicMap||new Map,{ground:i,markGraphic:o,graphic:s}=this.bmap.config;for(let u=0;u<t.length;u++){let l=t[u];l.info.group==="ground"?(l.info.fillColor=i.color,l.info.fillOpacity=i.opacity,l.info.height=i.height,l.info.stroke=i.stroke,l.info.strokeColor=i.strokeColor,l.info.strokeOpacity=i.strokeOpacity):l.info.userData.mark?(l.info.height=o.height,l.info.fillColor=o.color,l.info.fillOpacity=o.opacity,l.info.stroke=o.stroke,l.info.strokeColor=o.strokeColor,l.info.strokeOpacity=o.strokeOpacity):(l.info.fillOpacity=s.fillOpacity,this.bmap.config.initTransToMark&&(l.info.height=o.height,l.info.fillColor=o.color,l.info.stroke=o.stroke,l.info.strokeColor=o.strokeColor,l.info.strokeOpacity=o.strokeOpacity))}for(let u of t){if(u.info.group==="ground")e.createGround(u.info);else{let l=e.addGraphic(u.info);l.userData.data=u,n.set(u.legacy_id,l)}r.set(u.element_uuid,u)}e.userData.legacyToGraphicMap=n,e.userData.graphicMap=r,e.userData.rangeGraphic=this.bmap.currentBuildGround,e.userData.range=this.bmap.currentBuildGround.geometry.cds[0],e.userData.center=this.bmap.buildingCenter,e.updateBox(),e===this.bmap.context.currentFloor?(this.bmap.triggerHooks(bt.SWITCH_FLOOR_BEFORE,{curFloor:e,graphics:e.graphicLayer.children}),this.bmap.initialFloorCamera(),this.bmap.triggerHooks(bt.SWITCH_FLOOR_AFTER,{curFloor:e,graphics:e.graphicLayer.children})):this.bmap.switchFloorByFloor(e)}filterData(t,e){let n=e.userData.graphicMap||new Map;return t.filter(r=>!n.has(r.element_uuid))}switchFloorByStoreData(t,e){return g(this,null,function*(){let n=yield this.load(v({},t,{resource_type_list:"6"})),r=this.filterData(n,e);this.switchFloorByData(r,e)})}switchFloorByOtherData(t,e){return g(this,null,function*(){let n=yield this.load(v({},t,{resource_type_list:"1,2,3,4"})),r=this.filterData(n,e);this.switchFloorByData(r,e)})}loadBuildGround(t){return g(this,null,function*(){let{brand:e,project:n}=t,r=yield this.loadBuildingGround({brand:e,project:n});var i;return this.bmap.currentBuildGround=(i=r==null?void 0:r.info)!=null?i:null,this.bmap.changeBuildingCenter(r,{brand:e,project:n}),this.bmap.currentBuildGround})}loadBuildingGround(t){return g(this,null,function*(){let{brand:e,project:n}=t,r=Xe({brand:e,project:n});if(this.buildingGroundMap.has(r))return this.buildingGroundMap.get(r);let i=to({brand:e,project:n},this.bmap.config).then(o=>(this.buildingGroundMap.set(r,o),o));return this.buildingGroundMap.set(r,i),i})}switchFloor(t){return g(this,null,function*(){let e=new re(this.bmap.context);e.userData.graphicMap=new Map,e.name=t.floor;try{yield Promise.all([this.switchFloorByStoreData(t,e),this.switchFloorByOtherData(t,e)])}catch(n){console.log(n)}return e})}dispose(){this.cacheData.clear(),this.floorDataLengthMap.clear(),this.buildingGroundMap.clear()}constructor(t){this.bmap=t,this.cacheData=new Map,this.floorDataLengthMap=new Map,this.buildingGroundMap=new Map,this.externalStreetMap=new Map}};var Hu=function(a){return a[a.D2=0]="D2",a[a.D3=1.1]="D3",a}({}),ro=class extends Xt.EventDispatcher{get basicZoom(){return this.context.basicZoom}set basicZoom(t){this.context.basicZoom=t}changeBuildingCenter(t,e){let{brand:n,project:r}=e,i=t?Cn(t.info.geometry.cds[0]):[0,0];this.buildingCenter=i,this.dispatchEvent({type:"center-change",center:i,project:r,brand:n})}use(t){t.bmap=this,this.plugins.push(t)}unUse(t){this.plugins=this.plugins.filter(e=>e!==t)}triggerHooks(t,e){this.dispatchEvent({type:t,data:e})}switchFloor(t){return g(this,null,function*(){return this.loader||(this.loader=new Je(this),this.loader.placeConfig=v({},this.loader.placeConfig,this.config.loaderPlaceConfig),yield this.loader.load(this.config.apiPath.loadPlaceInfo+"?place_id="+this.config.placeId+"&env=prod")),this.loader.switchFloor(t)})}switchFloorByFloor(t,e,n){e===void 0&&(e=!0),n===void 0&&(n=t.graphicLayer.children),this.triggerHooks(bt.SWITCH_FLOOR_BEFORE,{curFloor:t,graphics:n}),this.buildingCenter=t.userData.center,this.currentBuildGround=t.userData.rangeGraphic,this.context.switchFloor(t,e),this.initialFloorCamera(),this.triggerHooks(bt.SWITCH_FLOOR_AFTER,{curFloor:t,graphics:n})}initialFloorCamera(){this.context.cameraBound.setEnable(!1),this.context.control.minZoom=0,this.context.control.maxZoom=1/0,this.context.camera.zoom=1,this.context.setAzimuthalAngle(this.config.control.defaultAzimuthal,0),this.context.setPolarAngle(this.config.control.defaultPolar,0),this.context.fitCameraToGround(this.config.defaultPadding,0);let t=this.context.camera.zoom;this.context.control.minZoom=t,this.context.control.maxZoom=t*this.config.control.maxZoomScale,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()}addModel(t,e){if(t.options.geometry.type==="polygon"){var n;let r=(n=this.context.currentFloor)==null?void 0:n.addModel(v({},e,{position:t.getPosition().setZ(.1),id:t.options.id}));if(r){let{facilityAngle:i=0,facilityXScale:o=1,facilityYScale:s=1}=t.options.userData;r.rotateZ((180-i)/180*Math.PI),r.scale.set(o,s,1)}}}addHeatmap(t){var e;return(e=this.context.currentFloor)==null?void 0:e.addHeatmap(t)}getLegacyToGraphicMap(){var t;return((t=this.context.currentFloor)==null?void 0:t.userData.legacyToGraphicMap)||new Map}getFloorAllGraphics(){var t;return((t=this.context.currentFloor)==null?void 0:t.getGraphics())||[]}createGraphicPoi(t,e){if(this.context.currentFloor){e.id===void 0&&(e.id=t.options.id);let n=t.options.center,r=t.getCenter(),i=(n==null?void 0:n[0])||r.x,o=(n==null?void 0:n[1])||r.y;return console.log(i,o,n,r),this.context.currentFloor.addPoi(v({},e,{position:{x:i,y:o,z:r.z+t.options.height/2}}))}return null}createPoi2ByPosition(t,e){if(this.context.currentFloor){let n=this.mercatorToWorld([t.x,t.y]),r=new st(this.context,v({},e,{position:{x:n.x,y:n.y,z:t.z}}));return this.context.currentFloor.poiLayer2.pushPoi(r),r}return null}removeHeatMap(){var t;(t=this.context.currentFloor)==null||t.removeHeatMap()}translateElementToCenter(t,e,n,r){e===void 0&&(e=500),n===void 0&&(n=0),r===void 0&&(r=0);let i=t.getPosition().clone(),{context:{camera:o}}=this;if(o.updateMatrix(),r){let s=new Xt.Vector3;s.setFromMatrixColumn(o.matrix,1),s.normalize(),s.multiplyScalar(r/o.zoom),i.add(s)}if(n){let s=new Xt.Vector3;s.setFromMatrixColumn(o.matrix,0),s.normalize(),s.multiplyScalar(n/o.zoom),i.add(s)}return this.context.setCameraPosition(i,e)}translateElementToCenterX(t,e){return g(this,null,function*(){return e===void 0&&(e=500),Gt(new Promise(n=>{let r=this.context.control.target.clone(),i=t.getPosition();this.timer.requestAnimationFrame(()=>{let{clientSize:{width:o,height:s},camera:u}=this.context,c=N(i,u,o,s).x-o/2,h=new Xt.Vector3;h.setFromMatrixColumn(this.context.camera.matrix,0),h.normalize(),h.multiplyScalar(c/this.context.camera.zoom),r.add(h),this.context.setCameraPosition(r,e).then(n)})}),e+500)})}getElementDeviceCoordinate(t){let e=t.position.clone(),{clientWidth:n,clientHeight:r}=this.container;return N(e,this.context.camera,n,r)}changeMapType(t,e){return e===void 0&&(e=500),this.type=t,t==="2d"?this.context.setPolarAngle(0,e):this.context.setPolarAngle(1.1,e)}resetView(t){return g(this,null,function*(){t===void 0&&(t=300);let e=t/3;yield this.context.setAzimuthalAngle(this.config.control.defaultAzimuthal,e),yield this.context.setPolarAngle(this.config.control.defaultPolar,e),yield this.context.fitCameraToGround(this.config.defaultPadding,e,!1)})}reduceMap(t,e){t===void 0&&(t=.5),e===void 0&&(e=500);let n=this.context.camera.zoom;return this.context.setZoom(n-t,this.context.control.target,e)}enlargeMap(t,e){t===void 0&&(t=.5),e===void 0&&(e=500);let n=this.context.camera.zoom;return this.context.setZoom(n+t,this.context.control.target,e)}registryEvent(){if(window.addEventListener("keydown",this.onKeydown),window.addEventListener("keyup",this.onKeyUp),this.config.resizeObserver){let t=new ResizeObserver(this.debounceResize);t.observe(this.container),this.observe=t}}unRegistryEvent(){var t;this.context.control.removeEventListener("change",this.onControlChange),window.removeEventListener("keydown",this.onKeydown),window.removeEventListener("keyup",this.onKeyUp),(t=this.observe)==null||t.disconnect(),this.observe=null}configurePolarShortcutKeys(t){this.polarKeys=t}configureAzimuthalShortcutKeys(t){this.azimuthalKeys=t}rotateMap(t,e){t===void 0&&(t=.1),e===void 0&&(e=500);let n=this.context.control.getAzimuthalAngle();return this.context.setAzimuthalAngle(n+t,e)}measureDistance(){return g(this,null,function*(){return this.cancelDistance(),new Promise((t,e)=>{this.changeMapType("2d",0),this.context.control.enableRotate=!1,this.svgLine=new Kn(this.context);let n=this.svgLine.dispose.bind(this.svgLine);this.svgLine.dispose=function(){n(),e("cancel")},this.svgLine.addEventListener("distance",r=>{let{distance:i}=r;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 $n(this.context);let n=this.svgPolygon.dispose.bind(this.svgPolygon);this.svgPolygon.dispose=function(){n(),e("cancel")},this.svgPolygon.addEventListener("area",r=>{let{area:i}=r;t(i)})})}cancelArea(){this.svgPolygon&&(this.svgPolygon.dispose(),this.svgPolygon=void 0,this.context.control.enableRotate=!0)}fitCameraByPois(t,e,n){return g(this,null,function*(){if(e===void 0&&(e=[20,20,20,20]),n===void 0&&(n=500),!t.length)return;let r=new Xt.Box3;return t.forEach(i=>{let{position:o}=i;r.expandByPoint(o)}),this.context.fitCameraToBox(r,e,n,!1)})}fitCameraByPoiNodeIds(t,e,n){return g(this,null,function*(){e===void 0&&(e=[20,20,20,20]),n===void 0&&(n=500);let r=t.map(i=>this.getPoiById(i)).filter(i=>!!i);if(r.length)return this.fitCameraByPois(r,e,n)})}getGraphicByNodeId(t){var e,n;return((e=this.context.currentFloor)==null?void 0:e.graphicLayer.getGraphicByNodeId(t))||((n=this.context.currentFloor)==null?void 0:n.parkingSpaceLayer.graphicMap.get(t))||null}deleteGraphic(t){var e;(e=this.context.currentFloor)==null||e.graphicLayer.removeGraphic(t)}createGraphicByOptions(t){var e;if(!t.transformToBuildingGround&&this.currentBuildGround){let n=Cn(this.currentBuildGround.geometry.cds[0]);if(t.geometry.type==="polygon")t.geometry.coords=JSON.parse(JSON.stringify(t.geometry.cds)),t.geometry.coords.map(r=>{Array.isArray(r)&&r.forEach(i=>{i[0]-=n[0],i[1]-=n[1]})});else{let[r,i]=t.geometry.cds;t.geometry.coords=[r-n[0],i-n[1]]}}return(e=this.context.currentFloor)==null?void 0:e.graphicLayer.createGraphic(t)}mercatorToWorld(t){let e=this.buildingCenter;return new Xt.Vector3(t[0]-e[0],t[1]-e[1],0)}removePoiById(t){var e,n;(e=this.context.currentFloor)==null||e.poiLayer.removePoiById(t),(n=this.context.currentFloor)==null||n.poiLayer2.removePoiById(t)}getPoiById(t){var e;let n=this.context.collisionSystem.objects;return((e=this.context.currentFloor)==null?void 0:e.poiLayer.getPoiById(t))||n.find(r=>r.options.id===t)}getPois(){var t;return[...(((t=this.context.currentFloor)==null?void 0:t.poiLayer.pois)||[]).filter(e=>!e.options.built_in),...this.context.collisionSystem.objects||[]]}clearPoi(){this.context.currentFloor&&this.context.currentFloor.poiLayer.clear()}removeSelectGraphic(t){this.context.selection.remove(t)}dispose(){this.loader&&(this.loader.dispose(),this.loader=null),this.unRegistryEvent(),this.timer.dispose(),this.plugins.forEach(t=>t.dispose()),this.plugins=[],this.context.dispose(),this.context=null,this.container=null,dt.dispose(),gt.dispose(),Re.dispose(),It.dispose(),A.dispose(),ne.dispose(),this.debounceResize=null,Xt.Sprite.Dispose==null||Xt.Sprite.Dispose.call(Xt.Sprite)}constructor(t,e={}){super(),this.container=t,this.polarKeys=[],this.azimuthalKeys=[],this.prevCameraZoom=1,this.type="2d",this.currentBuildGround=null,this.observe=null,this.buildingCenter=[0,0],this.timer=new $,this.plugins=[],this.loader=null,this.onControlChange=()=>{let{camera:{zoom:n}}=this.context;n!==this.prevCameraZoom&&(this.dispatchEvent({type:"zoom-change",basicZoom:this.basicZoom,cameraZoom:this.context.camera.zoom}),this.prevCameraZoom=n)},this.onKeydown=n=>{this.polarKeys.includes(n.code)&&(this.context.control.maxPolarAngle=this.config.control.maxPolar,this.context.control.minPolarAngle=0),this.azimuthalKeys.includes(n.code)&&(this.context.control.maxAzimuthAngle=1/0,this.context.control.minAzimuthAngle=1/0)},this.onKeyUp=n=>{if(this.polarKeys.includes(n.code)){let r=this.context.control.getPolarAngle();this.context.control.maxPolarAngle=r,this.context.control.minPolarAngle=r}if(this.azimuthalKeys.includes(n.code)){let r=this.context.control.getAzimuthalAngle();this.context.control.maxAzimuthAngle=r,this.context.control.minAzimuthAngle=r}},this.resize=()=>{this.context.cameraBound.setEnable(!1),this.context.onWindowResize();let n=this.context.control.getAzimuthalAngle(),r=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(this.config.defaultPadding,0)||1;this.context.camera.zoom=r,this.context.control.minZoom=i,this.context.control.maxZoom=i*this.config.control.maxZoomScale,this.basicZoom=r,this.context.control.addEventListener("change",this.onControlChange),this.context.setAzimuthalAngle(n,0),this.context.cameraBound.setEnable(!0)},this.config=Ki(e),this.context=new hr(t,this),this.debounceResize=(0,ha.debounce)(this.resize,5),this.registryEvent()}};var Wu=function(a){return a.HALF="half",a.POWER="power",a.MECHANICAL="mechanical",a.NORMAL="normal",a.VIP="vip",a}({});var zv=require("core-js/modules/web.dom-collections.iterator.js");var at=class extends ct{dispose(){let t=this.bmap.plugins.findIndex(e=>e===this);t!==-1&&this.bmap.plugins.splice(t,1),this.bmap=null,super.dispose()}constructor(t){super(),this.bmap=t,this.bmap.use(this)}};var io=class extends at{fetchEquipment(){return g(this,null,function*(){let{apiDomain:t,apiPath:{equipmentList:e},apiInfo:n}=this.bmap.config,r=""+t+e;yield fetch(r,n).then(i=>i.json()).then(i=>i.data).then(i=>{this.equipmentList=i,this.equipmentMap=new Map(i.map(o=>[o.equipment_id,o]))}),this.dispatchEvent({type:"change-equipment-list",data:this.equipmentList}),this.bmap.context.currentFloor&&this.changeGraphicToEquipment(this.bmap.context.currentFloor.graphicLayer.children)})}getGraphicEquipment(t){return t.userData.data.info.userData.equipment}changeGraphicToEquipment(t){t.filter(e=>{let n=this.getGraphicEquipment(e);return n&&this.equipmentMap.has(n)}).forEach(e=>{let n=this.equipmentMap.get(this.getGraphicEquipment(e)),r=this.bmap.createGraphicPoi(e,{icon:n==null?void 0:n.equipment_icon,built_in:!0,icon_size:[14,14]});r&&(r.userData.data=n,r.userData.type="equipment")})}dispose(){var t;this.bmap.removeEventListener(bt.SWITCH_FLOOR_AFTER,this.onSwitchFloor),Array.from(((t=this.bmap.context.currentFloor)==null?void 0:t.poiLayer.pois)||[]).forEach(e=>{if(e.userData.type==="equipment"){var n;(n=this.bmap.context.currentFloor)==null||n.poiLayer.removePoi(e)}}),super.dispose()}constructor(t){super(t),this.equipmentList=[],this.equipmentMap=new Map,this.onSwitchFloor=e=>{let{data:{graphics:n}}=e;this.equipmentList.length&&this.changeGraphicToEquipment(n)},this.fetchEquipment(),this.bmap.addEventListener(bt.SWITCH_FLOOR_AFTER,this.onSwitchFloor)}};var V2=require("core-js/modules/es.string.replace.js"),H2=require("core-js/modules/es.regexp.exec.js"),W2=require("core-js/modules/web.dom-collections.iterator.js"),X2=require("core-js/modules/es.promise.finally.js");var u2=require("core-js/modules/web.dom-collections.iterator.js"),l2=require("core-js/modules/es.array.push.js"),vt=require("three");var Wv=require("core-js/modules/es.typed-array.float32-array.js"),Xv=require("core-js/modules/es.typed-array.at.js"),qv=require("core-js/modules/es.typed-array.fill.js"),jv=require("core-js/modules/es.typed-array.find-last.js"),Yv=require("core-js/modules/es.typed-array.find-last-index.js"),Zv=require("core-js/modules/es.typed-array.set.js"),Kv=require("core-js/modules/es.typed-array.sort.js"),$v=require("core-js/modules/es.typed-array.to-reversed.js"),Jv=require("core-js/modules/es.typed-array.to-sorted.js"),Qv=require("core-js/modules/es.typed-array.with.js"),t2=require("core-js/modules/es.array-buffer.constructor.js"),e2=require("core-js/modules/es.array-buffer.slice.js"),n2=require("core-js/modules/es.array-buffer.detached.js"),r2=require("core-js/modules/es.array-buffer.transfer.js"),i2=require("core-js/modules/es.array-buffer.transfer-to-fixed-length.js"),o2=require("core-js/modules/es.array.push.js"),s2=require("core-js/modules/es.typed-array.uint16-array.js"),w=require("three"),qt=class extends w.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 w.Matrix4,Object.defineProperties(this,{geometry:{enumerable:!0,get:function(){return this}},geom:{enumerable:!0,get:function(){return this._geom},set:function(t){this.setGeometry(t,this.widthCallback)}},points:{enumerable:!0,get:function(){return this._points},set:function(t){this.setPoints(t,this.widthCallback)}}})}};qt.prototype.setMatrixWorld=function(a){this.matrixWorld=a};qt.prototype.setGeometry=function(a,t){this._geometry=a,this.setPoints(a.getAttribute("position").array,t)};qt.prototype.setPoints=function(a,t){if(!(a instanceof Float32Array)&&!(a instanceof Array)){console.error("ERROR: The BufferArray of points is not instancied correctly.");return}if(this._points=a,this.widthCallback=t,this.positions=[],this.counters=[],a.length&&a[0]instanceof w.Vector3)for(var e=0;e<a.length;e++){var n=a[e],r=e/a.length;this.positions.push(n.x,n.y,n.z),this.positions.push(n.x,n.y,n.z),this.counters.push(r),this.counters.push(r)}else for(var e=0;e<a.length;e+=3){var r=e/a.length;this.positions.push(a[e],a[e+1],a[e+2]),this.positions.push(a[e],a[e+1],a[e+2]),this.counters.push(r),this.counters.push(r)}this.process()};function Xu(a,t){var e=new w.Matrix4,n=new w.Ray,r=new w.Sphere,i=new w.Vector3,o=this.geometry;if(o.boundingSphere||o.computeBoundingSphere(),r.copy(o.boundingSphere),r.applyMatrix4(this.matrixWorld),a.ray.intersectSphere(r,i)!==!1){e.copy(this.matrixWorld).invert(),n.copy(a.ray).applyMatrix4(e);var s=new w.Vector3,u=new w.Vector3,l=new w.Vector3,c=this instanceof w.LineSegments?2:1,h=o.index,p=o.attributes;if(h!==null)for(var f=h.array,d=p.position.array,m=p.width.array,y=0,x=f.length-1;y<x;y+=c){var E=f[y],S=f[y+1];s.fromArray(d,E*3),u.fromArray(d,S*3);var R=m[Math.floor(y/3)]!==void 0?m[Math.floor(y/3)]:1,P=a.params.Line.threshold+this.material.lineWidth*R/2,K=P*P,T=n.distanceSqToSegment(s,u,i,l);if(!(T>K)){i.applyMatrix4(this.matrixWorld);var Q=a.ray.origin.distanceTo(i);Q<a.near||Q>a.far||(t.push({distance:Q,point:l.clone().applyMatrix4(this.matrixWorld),index:y,face:null,faceIndex:null,object:this}),y=x)}}}}qt.prototype.raycast=Xu;qt.prototype.compareV3=function(a,t){var e=a*6,n=t*6;return this.positions[e]===this.positions[n]&&this.positions[e+1]===this.positions[n+1]&&this.positions[e+2]===this.positions[n+2]};qt.prototype.copyV3=function(a){var t=a*6;return[this.positions[t],this.positions[t+1],this.positions[t+2]]};qt.prototype.getDistance=function(a){let t=0;for(let e=0;e<a;e++){let n=6*e,r=new w.Vector3(this.positions[n],this.positions[n+1],this.positions[n+2]),i=new w.Vector3(this.positions[n+6],this.positions[n+7],this.positions[n+8]),o=r.distanceTo(i);t+=o}return t};qt.prototype.process=function(){var a=this.positions.length/6;this.previous=[],this.next=[],this.side=[],this.width=[],this.indices_array=[],this.uvs=[];var t;let e=this.getDistance(a-1);var n;this.compareV3(0,a-1)?n=this.copyV3(a-2):n=this.copyV3(0),this.previous.push(n[0],n[1],n[2]),this.previous.push(n[0],n[1],n[2]);for(var r=0;r<a;r++){if(this.side.push(1),this.side.push(-1),this.widthCallback?t=this.widthCallback(r/(a-1)):t=1,this.width.push(t),this.width.push(t),r===0)this.uvs.push(0,0),this.uvs.push(0,1);else if(r===a-1)this.uvs.push(1,0),this.uvs.push(1,1);else{let o=this.getDistance(r)/e;this.uvs.push(o,0),this.uvs.push(o,1)}if(r<a-1){n=this.copyV3(r),this.previous.push(n[0],n[1],n[2]),this.previous.push(n[0],n[1],n[2]);var i=r*2;this.indices_array.push(i,i+1,i+2),this.indices_array.push(i+2,i+1,i+3)}r>0&&(n=this.copyV3(r),this.next.push(n[0],n[1],n[2]),this.next.push(n[0],n[1],n[2]))}this.compareV3(a-1,0)?n=this.copyV3(1):n=this.copyV3(a-1),this.next.push(n[0],n[1],n[2]),this.next.push(n[0],n[1],n[2]),!this._attributes||this._attributes.position.count!==this.positions.length?this._attributes={position:new w.BufferAttribute(new Float32Array(this.positions),3),previous:new w.BufferAttribute(new Float32Array(this.previous),3),next:new w.BufferAttribute(new Float32Array(this.next),3),side:new w.BufferAttribute(new Float32Array(this.side),1),width:new w.BufferAttribute(new Float32Array(this.width),1),uv:new w.BufferAttribute(new Float32Array(this.uvs),2),index:new w.BufferAttribute(new Uint16Array(this.indices_array),1),counters:new w.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 oo(a,t,e,n,r){var i;if(a=a.subarray||a.slice?a:a.buffer,e=e.subarray||e.slice?e:e.buffer,a=t?a.subarray?a.subarray(t,r&&t+r):a.slice(t,r&&t+r):a,e.set)e.set(a,n);else for(i=0;i<a.length;i++)e[i+n]=a[i];return e}qt.prototype.advance=function(a){var t=this._attributes.position.array,e=this._attributes.previous.array,n=this._attributes.next.array,r=t.length;oo(t,0,e,0,r),oo(t,6,t,0,r-6),t[r-6]=a.x,t[r-5]=a.y,t[r-4]=a.z,t[r-3]=a.x,t[r-2]=a.y,t[r-1]=a.z,oo(t,6,n,0,r-6),n[r-6]=a.x,n[r-5]=a.y,n[r-4]=a.z,n[r-3]=a.x,n[r-2]=a.y,n[r-1]=a.z,this._attributes.position.needsUpdate=!0,this._attributes.previous.needsUpdate=!0,this._attributes.next.needsUpdate=!0};w.ShaderChunk.meshline_vert=["",w.ShaderChunk.logdepthbuf_pars_vertex,w.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;","",w.ShaderChunk.logdepthbuf_vertex,w.ShaderChunk.fog_vertex&&" vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );",w.ShaderChunk.fog_vertex,"}"].join(`
|
|
11923
|
+
`],{type:"text/javascript"}),t=URL.createObjectURL(a),e=new Worker(t);return URL.revokeObjectURL(t),e}var Gu={mergeParkingSpace:!0,mergeGraphic:!0,renderVersion:fn.MERGED_RENDER_VERSION,layers:["graph","wall","lane","texture2d","texture3d","glb","store","facility","parkingSpace","text"],filterPoi:()=>!0},Je=class extends ct{initDb(){return g(this,null,function*(){try{let{db:t}=yield Pr();this.db=t}catch(t){console.log("[\u6253\u5F00indexDb\u9519\u8BEF]",t)}})}load(t,e){return g(this,null,function*(){if(Array.isArray(t))this.floors=t,e&&(this.placeConfig=v({},this.placeConfig,e));else if(typeof t=="string"){let n=yield fetch(t).then(r=>r.json());n.code===200&&(this.floors=n.data.list,this.placeConfig=v({},this.placeConfig,JSON.parse(n.data.config||"{}")))}else return this.load("https://screen.aibee.cn/ai-map/map/get-floor-map?place_id="+t);this.getOtherDataByFreeTime()})}setCacheData(t,e,n){return g(this,null,function*(){return this.initDbPromise.then(()=>Lr(t,""+e,n))})}getCacheData(t,e){return g(this,null,function*(){return this.initDbPromise.then(()=>Un(t,""+e))})}getFloorData(t){return g(this,null,function*(){let e=yield this.getFloorJsonData(t);return e?this.getDataByJson(e):null})}getFloorDataByFloorInfo(t){return g(this,null,function*(){let e=yield this.getFloorJsonDataByFloorInfo(t);return this.getDataByJson(e)})}setLocale(t){this.locale=t,this.bmap.context.currentFloor&&this.bmap.context.currentFloor.poiLayer2.pois.forEach(e=>{e.userData.type==="store"&&(e.options.text=$r(e.userData.data,t)),e.userData.type==="facility"&&(e.options.text=Jr(e.userData.data,t))})}getFloorJsonDataByFloorInfo(t){return g(this,null,function*(){if(this.getFloorDataPromise.has(t.floor))return this.getFloorDataPromise.get(t.floor);let e=new Promise(n=>g(this,null,function*(){let r=dn(t),i=yield fetch(t.map_url).then(o=>o.json());i.floor=t.floor,pr(i),this.setCacheData(Pt.MAP_DATA,r,i),this.setCacheData(Pt.MAP_VERSION,r,t.version_id),n(i)}));return this.getFloorDataPromise.set(t.floor,e),e})}getFloorJsonData(t){return g(this,null,function*(){let e=this.floors.find(n=>n.floor===t);return e?new Promise(n=>g(this,null,function*(){let r=dn(e,this.options.renderVersion===fn.LAYERED_RENDER_VERSION?1:void 0);try{let i=dn(e),o=yield this.getCacheData(Pt.MAP_DATA,i);if(o&&o.transformed){console.log("\u4ECE\u7F13\u5B58\u4E2D\u53D6\u5230\u4E86\u5408\u5E76\u540E\u7684\u6570\u636E"),n(o);return}if(this.options.renderVersion===fn.LAYERED_RENDER_VERSION){let s=yield this.getCacheData(Pt.MAP_DATA,r);if(s){console.log("\u4ECE\u7F13\u5B58\u4E2D\u53D6\u5230\u4E86\u6570\u636E"),n(s);return}}if(console.log("\u7F13\u5B58\u4E2D\u6CA1\u6709\u6570\u636E"),this.loadWorker){Z(this.loadWorker,"adjust_floor_priority",{floor:t});let s=u=>{if(u.data.type==="floor_success"&&u.data.data.floor===t){var l;(l=this.loadWorker)==null||l.removeEventListener("message",s),n(this.getFloorJsonData(t))}};this.loadWorker.addEventListener("message",s)}else n(this.getFloorJsonDataByFloorInfo(e))}catch(i){console.log("[get floor data error]",i),n(this.getFloorJsonDataByFloorInfo(e))}})):null})}getRoadNetworkData(){return g(this,null,function*(){return(yield Promise.all(this.floors.map(e=>g(this,null,function*(){let n=dn(e,0);try{let r=yield this.getCacheData(Pt.ROAD_NETWORK_DATA,n);if(r)return r;let i=yield fetch(e.route_url).then(o=>o.json());return this.setCacheData(Pt.ROAD_NETWORK_DATA,n,i),this.setCacheData(Pt.ROUTE_VERSION,n,e.version_id),i}catch(r){let i=yield fetch(e.route_url).then(o=>o.json());return this.setCacheData(Pt.ROAD_NETWORK_DATA,n,i),i}})))).filter(e=>e.points)})}getFacilitiesData(){return g(this,null,function*(){let t=this.floors.reduce((r,i)=>r.updated_at>i.updated_at?r:i,this.floors[0]);if(!t)return null;let e=dn(t,0),n=()=>g(this,null,function*(){let r=yield fetch(t.entry_infra_url).then(i=>i.json());return r&&(this.setCacheData(Pt.FACILITY_DATA,e,r),this.setCacheData(Pt.FACILITY_VERSION,e,t.version_id)),r});try{let r=yield this.getCacheData(Pt.FACILITY_DATA,e);return r||n()}catch(r){return console.log("[get facility error]",r),n()}})}getOtherDataByFreeTime(){return g(this,null,function*(){yield this.initDbPromise,yield Z(this.loadWorker,"load",{floors:this.floors,version:this.options.renderVersion}),this.closeWorker()})}getMulFloorsData(t){return g(this,null,function*(){return Promise.all(t.map(e=>this.getFloorData(e))).then(e=>e.filter(n=>n))})}getDataByUrl(t){return g(this,null,function*(){let e=yield fetch(t).then(n=>n.json());return this.getDataByJson(e)})}getDataByJson(t,e,n){return g(this,null,function*(){pr(t),e=this.getFloorBaseLayer(t,e);let r=v({},this.placeConfig,n);return yield this.getFloorContentLayer(t,e),yield this.getFloorPoi(t,e,r),this.changeFloorBox(t,e),e})}getDataByJsonStep(t,e,n){return g(this,null,function*(){pr(t),e=this.getFloorBaseLayer(t,e);let r=v({},this.placeConfig,n);return this.changeFloorBox(t,e),requestAnimationFrame(()=>g(this,null,function*(){yield this.getFloorContentLayer(t,e),this.changeFloorBox(t,e),requestAnimationFrame(()=>g(this,null,function*(){yield this.getFloorPoi(t,e,r),this.changeFloorBox(t,e)}))})),e})}changeFloorBox(t,e){e.updateBox();let n=e.box.getSize(new Qr.Vector3),r=Math.max(n.x,n.y,n.z);e.userData.height=r/4+t.floorHeight}switchFloor(t,e){return g(this,null,function*(){return new Promise(n=>{let r={run:()=>this._switchFloor(t,e),meta:{type:"switchFloor"}},i=this.taskQueue.replaceByMetaType(r),o=s=>{let{task:u,res:l}=s;u.tid===i&&(this.taskQueue.removeEventListener("active-task-end",o),n(l))};this.taskQueue.addEventListener("active-task-end",o)})})}_switchFloor(t,e){return g(this,null,function*(){var n;let r=t;if(typeof t=="string"){let c=yield this.getFloorJsonData(t);if(c)r=c;else return null}else pr(t);let i=v({},this.placeConfig,e),o=new re(this.bmap.context);o.userData.data=t;let s=this.floors.find(c=>c.floor===r.floor);var u;let l=(u=s==null?void 0:s.map_angle)!=null?u:0;return this.bmap.dispatchEvent({type:bt.SWITCH_FLOOR_BEFORE,data:{curFloor:o,graphics:[]}}),this.dispatchEvent({type:"switch-floor-before",data:{curFloor:o,graphics:[],floorData:r}}),this.bmap.context.scene.background=new Qr.Color(i.backgroundColor),this.getFloorBaseLayer(r,o),this.changeFloorBox(r,o),this.bmap.buildingCenter=o.userData.center,this.bmap.currentBuildGround=(n=o.userData.data.layers.find(c=>c.l_type==="range"))==null?void 0:n.elements[0],this.bmap.context.switchFloor(o),this.bmap.initialFloorCamera(),this.bmap.context.control.setAzimuthalAngle(l/180*Math.PI,!0),this.bmap.context.cameraBound.updateBox(),this.dispatchEvent({type:"switch-floor-ground",data:{curFloor:o,graphics:[]}}),this.bmap.dispatchEvent({type:bt.SWITCH_FLOOR_GROUND,data:{curFloor:o}}),yield Mr(),yield this.getFloorContentLayer(r,o),this.changeFloorBox(r,o),this.bmap.context.cameraBound.updateBox(),this.dispatchEvent({type:"switch-floor-content",data:{curFloor:o,graphics:[]}}),yield Mi(2),yield this.getFloorPoi(r,o,i),this.dispatchEvent({type:"switch-floor-after",data:{curFloor:o,graphics:o.graphicLayer.children}}),this.bmap.dispatchEvent({type:bt.SWITCH_FLOOR_AFTER,data:{curFloor:o,graphics:o.graphicLayer.children}}),o})}getFloorBaseLayer(t,e){e||(e=new re(this.bmap.context));let n=[0,0];return t.layers.forEach(r=>{switch(r.l_type){case"range":let i=r.elements[0];n=[i.center_x,i.center_y],e.userData.range=i.geometry.cds[0],e.userData.rangeGraphic=i;break;case"ground":Ji(r,e);break;default:break}}),e.userData.center=n,e.name=t.floor,e.userData.data=t,e}getFloorContentLayer(t,e){return g(this,null,function*(){e||(e=new re(this.bmap.context)),e.userData.graphics=[],e.userData.graphicMap=new Map;let n=Date.now();for(let r=0;r<t.layers.length;r++){let i=t.layers[r];["range","ground"].includes(i.l_type)||this.options.layers.includes(i.l_type)&&(la(i,e,this.options),console.log("time",Date.now()-n,i.l_type),n=Date.now())}return e})}getFloorPoi(t,e,n){return g(this,null,function*(){n===void 0&&(n=this.placeConfig);let r=Date.now();yield Promise.all(t.layers.map(o=>{if(this.options.layers.includes(o.l_type))return ca(o,e,this.locale,n,this.options)})),console.log("poi time",Date.now()-r);let i=Date.now();Mr().then(()=>{console.log("poi render time",Date.now()-i)})})}clear(){return g(this,null,function*(){fs(),this.db=null})}closeWorker(){this.loadWorker&&(this.loadWorker.terminate(),this.loadWorker=null)}dispose(){super.dispose(),this.clear(),this.closeWorker(),this.getFloorDataPromise.clear()}constructor(t,e={}){super(),this.bmap=t,this.floors=[],this.initDbPromise=Promise.resolve(),this.db=null,this.taskQueue=new Ye,this.loadWorker=Qi(),this.locale="zh-cn",this.placeConfig={backgroundColor:"#f1f7f6",showFacilityName:!0,showStoreName:!0,textFontSize:14},this.getFloorDataPromise=new Map,this.options=v({},Gu,e),this.placeConfig=v({},this.placeConfig,t.config.loaderPlaceConfig),this.initDbPromise=this.initDb()}};var _v=require("core-js/modules/web.dom-collections.iterator.js");function to(a,t){return g(this,null,function*(){let{brand:e,project:n}=a,{apiDomain:r,apiPath:{floorRange:i},apiInfo:o}=t,s=""+r+i+"?brand="+e+"&project="+n+"&phase="+n+"&building="+n;return yield fetch(s,o).then(l=>l.json()).then(l=>l.data).then(l=>{let c=(l||[])[0];return c&&(c.info=JSON.parse(c.info)),c})})}function eo(a,t){return g(this,null,function*(){let{brand:e,project:n,floor:r,ts:i,resource_type_list:o}=a,{apiDomain:s,apiPath:{floorGraphic:u},apiInfo:l}=t,c=""+s+u+"?brand="+e+"&project="+n+"&phase="+n+"&building="+n+"&floor="+r+"&ts="+i+"&resource_type_list="+o;return yield fetch(c,l).then(p=>p.json()).then(p=>p.data).then(p=>((p||[]).map(f=>f.info=JSON.parse(f.info)),p||[]))})}function ku(a,t){return g(this,null,function*(){let{project:e,floor:n}=a,{apiDomain:r,apiInfo:i}=t,o=r+"/api/inception-map/external_street/get?projectCode="+e+"&floorCode="+n;return yield fetch(o,i).then(u=>u.json()).then(u=>u.data).then(u=>JSON.parse(u[0].streetInfo||"{}")).then(u=>u.fileId?Vu(u.fileId,t):null)})}function Vu(a,t){return g(this,null,function*(){let{apiDomain:e,apiInfo:n}=t;return fetch(e+"/api/inception-map/file/getFileStream?fileId="+a,n).then(r=>r.arrayBuffer()).then(r=>{let o=new TextDecoder("utf-8").decode(r);return o?JSON.parse(o):null})})}var no=class{load(t){return g(this,null,function*(){let e=Xe(t);if(this.cacheData.has(e))return this.cacheData.get(e);let[,n]=yield Promise.all([this.loadBuildGround(t),eo(t,this.bmap.config)]),r=Xe({floor:t.floor,ts:t.ts});Ln(n.map(o=>o.info),this.bmap.buildingCenter,this.floorDataLengthMap.get(r)||0),n.forEach(o=>o.info.transformToBuildingGround=!1),this.cacheData.set(e,n);let i=this.floorDataLengthMap.get(r)||0;return this.floorDataLengthMap.set(r,i+n.length),this.loadExternalStreet(t),n})}loadExternalStreet(t){return g(this,null,function*(){})}switchFloorByData(t,e){if(!t.length)return;let n=e.userData.legacyToGraphicMap||new Map,r=e.userData.graphicMap||new Map,{ground:i,markGraphic:o,graphic:s}=this.bmap.config;for(let u=0;u<t.length;u++){let l=t[u];l.info.group==="ground"?(l.info.fillColor=i.color,l.info.fillOpacity=i.opacity,l.info.height=i.height,l.info.stroke=i.stroke,l.info.strokeColor=i.strokeColor,l.info.strokeOpacity=i.strokeOpacity):l.info.userData.mark?(l.info.height=o.height,l.info.fillColor=o.color,l.info.fillOpacity=o.opacity,l.info.stroke=o.stroke,l.info.strokeColor=o.strokeColor,l.info.strokeOpacity=o.strokeOpacity):(l.info.fillOpacity=s.fillOpacity,this.bmap.config.initTransToMark&&(l.info.height=o.height,l.info.fillColor=o.color,l.info.stroke=o.stroke,l.info.strokeColor=o.strokeColor,l.info.strokeOpacity=o.strokeOpacity))}for(let u of t){if(u.info.group==="ground")e.createGround(u.info);else{let l=e.addGraphic(u.info);l.userData.data=u,n.set(u.legacy_id,l)}r.set(u.element_uuid,u)}e.userData.legacyToGraphicMap=n,e.userData.graphicMap=r,e.userData.rangeGraphic=this.bmap.currentBuildGround,e.userData.range=this.bmap.currentBuildGround.geometry.cds[0],e.userData.center=this.bmap.buildingCenter,e.updateBox(),e===this.bmap.context.currentFloor?(this.bmap.triggerHooks(bt.SWITCH_FLOOR_BEFORE,{curFloor:e,graphics:e.graphicLayer.children}),this.bmap.initialFloorCamera(),this.bmap.triggerHooks(bt.SWITCH_FLOOR_AFTER,{curFloor:e,graphics:e.graphicLayer.children})):this.bmap.switchFloorByFloor(e)}filterData(t,e){let n=e.userData.graphicMap||new Map;return t.filter(r=>!n.has(r.element_uuid))}switchFloorByStoreData(t,e){return g(this,null,function*(){let n=yield this.load(v({},t,{resource_type_list:"6"})),r=this.filterData(n,e);this.switchFloorByData(r,e)})}switchFloorByOtherData(t,e){return g(this,null,function*(){let n=yield this.load(v({},t,{resource_type_list:"1,2,3,4"})),r=this.filterData(n,e);this.switchFloorByData(r,e)})}loadBuildGround(t){return g(this,null,function*(){let{brand:e,project:n}=t,r=yield this.loadBuildingGround({brand:e,project:n});var i;return this.bmap.currentBuildGround=(i=r==null?void 0:r.info)!=null?i:null,this.bmap.changeBuildingCenter(r,{brand:e,project:n}),this.bmap.currentBuildGround})}loadBuildingGround(t){return g(this,null,function*(){let{brand:e,project:n}=t,r=Xe({brand:e,project:n});if(this.buildingGroundMap.has(r))return this.buildingGroundMap.get(r);let i=to({brand:e,project:n},this.bmap.config).then(o=>(this.buildingGroundMap.set(r,o),o));return this.buildingGroundMap.set(r,i),i})}switchFloor(t){return g(this,null,function*(){let e=new re(this.bmap.context);e.userData.graphicMap=new Map,e.name=t.floor;try{yield Promise.all([this.switchFloorByStoreData(t,e),this.switchFloorByOtherData(t,e)])}catch(n){console.log(n)}return e})}dispose(){this.cacheData.clear(),this.floorDataLengthMap.clear(),this.buildingGroundMap.clear()}constructor(t){this.bmap=t,this.cacheData=new Map,this.floorDataLengthMap=new Map,this.buildingGroundMap=new Map,this.externalStreetMap=new Map}};var Hu=function(a){return a[a.D2=0]="D2",a[a.D3=1.1]="D3",a}({}),ro=class extends Xt.EventDispatcher{get basicZoom(){return this.context.basicZoom}set basicZoom(t){this.context.basicZoom=t}changeBuildingCenter(t,e){let{brand:n,project:r}=e,i=t?Cn(t.info.geometry.cds[0]):[0,0];this.buildingCenter=i,this.dispatchEvent({type:"center-change",center:i,project:r,brand:n})}use(t){t.bmap=this,this.plugins.push(t)}unUse(t){this.plugins=this.plugins.filter(e=>e!==t)}triggerHooks(t,e){this.dispatchEvent({type:t,data:e})}switchFloor(t){return g(this,null,function*(){return this.loader||(this.loader=new Je(this),this.loader.placeConfig=v({},this.loader.placeConfig,this.config.loaderPlaceConfig),yield this.loader.load(this.config.apiPath.loadPlaceInfo+"?place_id="+this.config.placeId+"&env=prod")),this.loader.switchFloor(t)})}switchFloorByFloor(t,e,n){e===void 0&&(e=!0),n===void 0&&(n=t.graphicLayer.children),this.triggerHooks(bt.SWITCH_FLOOR_BEFORE,{curFloor:t,graphics:n}),this.buildingCenter=t.userData.center,this.currentBuildGround=t.userData.rangeGraphic,this.context.switchFloor(t,e),this.initialFloorCamera(),this.triggerHooks(bt.SWITCH_FLOOR_AFTER,{curFloor:t,graphics:n})}initialFloorCamera(){this.context.cameraBound.setEnable(!1),this.context.control.minZoom=0,this.context.control.maxZoom=1/0,this.context.camera.zoom=1,this.context.setAzimuthalAngle(this.config.control.defaultAzimuthal,0),this.context.setPolarAngle(this.config.control.defaultPolar,0),this.context.fitCameraToGround(this.config.defaultPadding,0);let t=this.context.camera.zoom;this.context.control.minZoom=t,this.context.control.maxZoom=t*this.config.control.maxZoomScale,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()}addModel(t,e){if(t.options.geometry.type==="polygon"){var n;let r=(n=this.context.currentFloor)==null?void 0:n.addModel(v({},e,{position:t.getPosition().setZ(.1),id:t.options.id}));if(r){let{facilityAngle:i=0,facilityXScale:o=1,facilityYScale:s=1}=t.options.userData;r.rotateZ((180-i)/180*Math.PI),r.scale.set(o,s,1)}}}addHeatmap(t){var e;return(e=this.context.currentFloor)==null?void 0:e.addHeatmap(t)}getLegacyToGraphicMap(){var t;return((t=this.context.currentFloor)==null?void 0:t.userData.legacyToGraphicMap)||new Map}getFloorAllGraphics(){var t;return((t=this.context.currentFloor)==null?void 0:t.getGraphics())||[]}createGraphicPoi(t,e){if(this.context.currentFloor){e.id===void 0&&(e.id=t.options.id);let n=t.options.center,r=t.getCenter(),i=(n==null?void 0:n[0])||r.x,o=(n==null?void 0:n[1])||r.y;return console.log(i,o,n,r),this.context.currentFloor.addPoi(v({},e,{position:{x:i,y:o,z:r.z+t.options.height/2}}))}return null}createPoi2ByPosition(t,e){if(this.context.currentFloor){let n=this.mercatorToWorld([t.x,t.y]),r=new st(this.context,v({},e,{position:{x:n.x,y:n.y,z:t.z}}));return this.context.currentFloor.poiLayer2.pushPoi(r),r}return null}removeHeatMap(){var t;(t=this.context.currentFloor)==null||t.removeHeatMap()}translateElementToCenter(t,e,n,r){e===void 0&&(e=500),n===void 0&&(n=0),r===void 0&&(r=0);let i=t.getPosition().clone(),{context:{camera:o}}=this;if(o.updateMatrix(),r){let s=new Xt.Vector3;s.setFromMatrixColumn(o.matrix,1),s.normalize(),s.multiplyScalar(r/o.zoom),i.add(s)}if(n){let s=new Xt.Vector3;s.setFromMatrixColumn(o.matrix,0),s.normalize(),s.multiplyScalar(n/o.zoom),i.add(s)}return this.context.setCameraPosition(i,e)}translateElementToCenterX(t,e){return g(this,null,function*(){return e===void 0&&(e=500),Gt(new Promise(n=>{let r=this.context.control.target.clone(),i=t.getPosition();this.timer.requestAnimationFrame(()=>{let{clientSize:{width:o,height:s},camera:u}=this.context,c=N(i,u,o,s).x-o/2,h=new Xt.Vector3;h.setFromMatrixColumn(this.context.camera.matrix,0),h.normalize(),h.multiplyScalar(c/this.context.camera.zoom),r.add(h),this.context.setCameraPosition(r,e).then(n)})}),e+500)})}getElementDeviceCoordinate(t){let e=t.position.clone(),{clientWidth:n,clientHeight:r}=this.container;return N(e,this.context.camera,n,r)}changeMapType(t,e){return e===void 0&&(e=500),this.type=t,t==="2d"?this.context.setPolarAngle(0,e):this.context.setPolarAngle(1.1,e)}resetView(t){return g(this,null,function*(){t===void 0&&(t=300);let e=t/3;yield this.context.setAzimuthalAngle(this.config.control.defaultAzimuthal,e),yield this.context.setPolarAngle(this.config.control.defaultPolar,e),yield this.context.fitCameraToGround(this.config.defaultPadding,e,!1)})}reduceMap(t,e){t===void 0&&(t=.5),e===void 0&&(e=500);let n=this.context.camera.zoom;return this.context.setZoom(n-t,this.context.control.target,e)}enlargeMap(t,e){t===void 0&&(t=.5),e===void 0&&(e=500);let n=this.context.camera.zoom;return this.context.setZoom(n+t,this.context.control.target,e)}registryEvent(){if(window.addEventListener("keydown",this.onKeydown),window.addEventListener("keyup",this.onKeyUp),this.config.resizeObserver){let t=new ResizeObserver(this.debounceResize);t.observe(this.container),this.observe=t}}unRegistryEvent(){var t;this.context.control.removeEventListener("change",this.onControlChange),window.removeEventListener("keydown",this.onKeydown),window.removeEventListener("keyup",this.onKeyUp),(t=this.observe)==null||t.disconnect(),this.observe=null}configurePolarShortcutKeys(t){this.polarKeys=t}configureAzimuthalShortcutKeys(t){this.azimuthalKeys=t}rotateMap(t,e){t===void 0&&(t=.1),e===void 0&&(e=500);let n=this.context.control.getAzimuthalAngle();return this.context.setAzimuthalAngle(n+t,e)}measureDistance(){return g(this,null,function*(){return this.cancelDistance(),new Promise((t,e)=>{this.changeMapType("2d",0),this.context.control.enableRotate=!1,this.svgLine=new Kn(this.context);let n=this.svgLine.dispose.bind(this.svgLine);this.svgLine.dispose=function(){n(),e("cancel")},this.svgLine.addEventListener("distance",r=>{let{distance:i}=r;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 $n(this.context);let n=this.svgPolygon.dispose.bind(this.svgPolygon);this.svgPolygon.dispose=function(){n(),e("cancel")},this.svgPolygon.addEventListener("area",r=>{let{area:i}=r;t(i)})})}cancelArea(){this.svgPolygon&&(this.svgPolygon.dispose(),this.svgPolygon=void 0,this.context.control.enableRotate=!0)}fitCameraByPois(t,e,n){return g(this,null,function*(){if(e===void 0&&(e=[20,20,20,20]),n===void 0&&(n=500),!t.length)return;let r=new Xt.Box3;return t.forEach(i=>{let{position:o}=i;r.expandByPoint(o)}),this.context.fitCameraToBox(r,e,n,!1)})}fitCameraByPoiNodeIds(t,e,n){return g(this,null,function*(){e===void 0&&(e=[20,20,20,20]),n===void 0&&(n=500);let r=t.map(i=>this.getPoiById(i)).filter(i=>!!i);if(r.length)return this.fitCameraByPois(r,e,n)})}getGraphicByNodeId(t){var e,n;return((e=this.context.currentFloor)==null?void 0:e.graphicLayer.getGraphicByNodeId(t))||((n=this.context.currentFloor)==null?void 0:n.parkingSpaceLayer.graphicMap.get(t))||null}deleteGraphic(t){var e;(e=this.context.currentFloor)==null||e.graphicLayer.removeGraphic(t)}createGraphicByOptions(t){var e;if(!t.transformToBuildingGround&&this.currentBuildGround){let n=Cn(this.currentBuildGround.geometry.cds[0]);if(t.geometry.type==="polygon")t.geometry.coords=JSON.parse(JSON.stringify(t.geometry.cds)),t.geometry.coords.map(r=>{Array.isArray(r)&&r.forEach(i=>{i[0]-=n[0],i[1]-=n[1]})});else{let[r,i]=t.geometry.cds;t.geometry.coords=[r-n[0],i-n[1]]}}return(e=this.context.currentFloor)==null?void 0:e.graphicLayer.createGraphic(t)}mercatorToWorld(t){let e=this.buildingCenter;return new Xt.Vector3(t[0]-e[0],t[1]-e[1],0)}removePoiById(t){var e,n;(e=this.context.currentFloor)==null||e.poiLayer.removePoiById(t),(n=this.context.currentFloor)==null||n.poiLayer2.removePoiById(t)}getPoiById(t){var e;let n=this.context.collisionSystem.objects;return((e=this.context.currentFloor)==null?void 0:e.poiLayer.getPoiById(t))||n.find(r=>r.options.id===t)}getPois(){var t;return[...(((t=this.context.currentFloor)==null?void 0:t.poiLayer.pois)||[]).filter(e=>!e.options.built_in),...this.context.collisionSystem.objects||[]]}clearPoi(){this.context.currentFloor&&this.context.currentFloor.poiLayer.clear()}removeSelectGraphic(t){this.context.selection.remove(t)}dispose(){this.loader&&(this.loader.dispose(),this.loader=null),this.unRegistryEvent(),this.timer.dispose(),this.plugins.forEach(t=>t.dispose()),this.plugins=[],this.context.dispose(),this.context=null,this.container=null,dt.dispose(),gt.dispose(),Re.dispose(),It.dispose(),A.dispose(),ne.dispose(),this.debounceResize=null,Xt.Sprite.Dispose==null||Xt.Sprite.Dispose.call(Xt.Sprite)}constructor(t,e={}){super(),this.container=t,this.polarKeys=[],this.azimuthalKeys=[],this.prevCameraZoom=1,this.type="2d",this.currentBuildGround=null,this.observe=null,this.buildingCenter=[0,0],this.timer=new $,this.plugins=[],this.loader=null,this.onControlChange=()=>{let{camera:{zoom:n}}=this.context;n!==this.prevCameraZoom&&(this.dispatchEvent({type:"zoom-change",basicZoom:this.basicZoom,cameraZoom:this.context.camera.zoom}),this.prevCameraZoom=n)},this.onKeydown=n=>{this.polarKeys.includes(n.code)&&(this.context.control.maxPolarAngle=this.config.control.maxPolar,this.context.control.minPolarAngle=0),this.azimuthalKeys.includes(n.code)&&(this.context.control.maxAzimuthAngle=1/0,this.context.control.minAzimuthAngle=1/0)},this.onKeyUp=n=>{if(this.polarKeys.includes(n.code)){let r=this.context.control.getPolarAngle();this.context.control.maxPolarAngle=r,this.context.control.minPolarAngle=r}if(this.azimuthalKeys.includes(n.code)){let r=this.context.control.getAzimuthalAngle();this.context.control.maxAzimuthAngle=r,this.context.control.minAzimuthAngle=r}},this.resize=()=>{this.context.cameraBound.setEnable(!1),this.context.onWindowResize();let n=this.context.control.getAzimuthalAngle(),r=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(this.config.defaultPadding,0)||1;this.context.camera.zoom=r,this.context.control.minZoom=i,this.context.control.maxZoom=i*this.config.control.maxZoomScale,this.basicZoom=r,this.context.control.addEventListener("change",this.onControlChange),this.context.setAzimuthalAngle(n,0),this.context.cameraBound.setEnable(!0)},this.config=Ki(e),this.context=new hr(t,this),this.debounceResize=(0,ha.debounce)(this.resize,5),this.registryEvent()}};var Wu=function(a){return a.HALF="half",a.POWER="power",a.MECHANICAL="mechanical",a.NORMAL="normal",a.VIP="vip",a}({});var zv=require("core-js/modules/web.dom-collections.iterator.js");var at=class extends ct{dispose(){let t=this.bmap.plugins.findIndex(e=>e===this);t!==-1&&this.bmap.plugins.splice(t,1),this.bmap=null,super.dispose()}constructor(t){super(),this.bmap=t,this.bmap.use(this)}};var io=class extends at{fetchEquipment(){return g(this,null,function*(){let{apiDomain:t,apiPath:{equipmentList:e},apiInfo:n}=this.bmap.config,r=""+t+e;yield fetch(r,n).then(i=>i.json()).then(i=>i.data).then(i=>{this.equipmentList=i,this.equipmentMap=new Map(i.map(o=>[o.equipment_id,o]))}),this.dispatchEvent({type:"change-equipment-list",data:this.equipmentList}),this.bmap.context.currentFloor&&this.changeGraphicToEquipment(this.bmap.context.currentFloor.graphicLayer.children)})}getGraphicEquipment(t){return t.userData.data.info.userData.equipment}changeGraphicToEquipment(t){t.filter(e=>{let n=this.getGraphicEquipment(e);return n&&this.equipmentMap.has(n)}).forEach(e=>{let n=this.equipmentMap.get(this.getGraphicEquipment(e)),r=this.bmap.createGraphicPoi(e,{icon:n==null?void 0:n.equipment_icon,built_in:!0,icon_size:[14,14]});r&&(r.userData.data=n,r.userData.type="equipment")})}dispose(){var t;this.bmap.removeEventListener(bt.SWITCH_FLOOR_AFTER,this.onSwitchFloor),Array.from(((t=this.bmap.context.currentFloor)==null?void 0:t.poiLayer.pois)||[]).forEach(e=>{if(e.userData.type==="equipment"){var n;(n=this.bmap.context.currentFloor)==null||n.poiLayer.removePoi(e)}}),super.dispose()}constructor(t){super(t),this.equipmentList=[],this.equipmentMap=new Map,this.onSwitchFloor=e=>{let{data:{graphics:n}}=e;this.equipmentList.length&&this.changeGraphicToEquipment(n)},this.fetchEquipment(),this.bmap.addEventListener(bt.SWITCH_FLOOR_AFTER,this.onSwitchFloor)}};var V2=require("core-js/modules/es.string.replace.js"),H2=require("core-js/modules/es.regexp.exec.js"),W2=require("core-js/modules/web.dom-collections.iterator.js"),X2=require("core-js/modules/es.promise.finally.js");var u2=require("core-js/modules/web.dom-collections.iterator.js"),l2=require("core-js/modules/es.array.push.js"),vt=require("three");var Wv=require("core-js/modules/es.typed-array.float32-array.js"),Xv=require("core-js/modules/es.typed-array.at.js"),qv=require("core-js/modules/es.typed-array.fill.js"),jv=require("core-js/modules/es.typed-array.find-last.js"),Yv=require("core-js/modules/es.typed-array.find-last-index.js"),Zv=require("core-js/modules/es.typed-array.set.js"),Kv=require("core-js/modules/es.typed-array.sort.js"),$v=require("core-js/modules/es.typed-array.to-reversed.js"),Jv=require("core-js/modules/es.typed-array.to-sorted.js"),Qv=require("core-js/modules/es.typed-array.with.js"),t2=require("core-js/modules/es.array-buffer.constructor.js"),e2=require("core-js/modules/es.array-buffer.slice.js"),n2=require("core-js/modules/es.array-buffer.detached.js"),r2=require("core-js/modules/es.array-buffer.transfer.js"),i2=require("core-js/modules/es.array-buffer.transfer-to-fixed-length.js"),o2=require("core-js/modules/es.array.push.js"),s2=require("core-js/modules/es.typed-array.uint16-array.js"),w=require("three"),qt=class extends w.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 w.Matrix4,Object.defineProperties(this,{geometry:{enumerable:!0,get:function(){return this}},geom:{enumerable:!0,get:function(){return this._geom},set:function(t){this.setGeometry(t,this.widthCallback)}},points:{enumerable:!0,get:function(){return this._points},set:function(t){this.setPoints(t,this.widthCallback)}}})}};qt.prototype.setMatrixWorld=function(a){this.matrixWorld=a};qt.prototype.setGeometry=function(a,t){this._geometry=a,this.setPoints(a.getAttribute("position").array,t)};qt.prototype.setPoints=function(a,t){if(!(a instanceof Float32Array)&&!(a instanceof Array)){console.error("ERROR: The BufferArray of points is not instancied correctly.");return}if(this._points=a,this.widthCallback=t,this.positions=[],this.counters=[],a.length&&a[0]instanceof w.Vector3)for(var e=0;e<a.length;e++){var n=a[e],r=e/a.length;this.positions.push(n.x,n.y,n.z),this.positions.push(n.x,n.y,n.z),this.counters.push(r),this.counters.push(r)}else for(var e=0;e<a.length;e+=3){var r=e/a.length;this.positions.push(a[e],a[e+1],a[e+2]),this.positions.push(a[e],a[e+1],a[e+2]),this.counters.push(r),this.counters.push(r)}this.process()};function Xu(a,t){var e=new w.Matrix4,n=new w.Ray,r=new w.Sphere,i=new w.Vector3,o=this.geometry;if(o.boundingSphere||o.computeBoundingSphere(),r.copy(o.boundingSphere),r.applyMatrix4(this.matrixWorld),a.ray.intersectSphere(r,i)!==!1){e.copy(this.matrixWorld).invert(),n.copy(a.ray).applyMatrix4(e);var s=new w.Vector3,u=new w.Vector3,l=new w.Vector3,c=this instanceof w.LineSegments?2:1,h=o.index,p=o.attributes;if(h!==null)for(var f=h.array,d=p.position.array,m=p.width.array,_=0,x=f.length-1;_<x;_+=c){var E=f[_],S=f[_+1];s.fromArray(d,E*3),u.fromArray(d,S*3);var R=m[Math.floor(_/3)]!==void 0?m[Math.floor(_/3)]:1,P=a.params.Line.threshold+this.material.lineWidth*R/2,K=P*P,T=n.distanceSqToSegment(s,u,i,l);if(!(T>K)){i.applyMatrix4(this.matrixWorld);var Q=a.ray.origin.distanceTo(i);Q<a.near||Q>a.far||(t.push({distance:Q,point:l.clone().applyMatrix4(this.matrixWorld),index:_,face:null,faceIndex:null,object:this}),_=x)}}}}qt.prototype.raycast=Xu;qt.prototype.compareV3=function(a,t){var e=a*6,n=t*6;return this.positions[e]===this.positions[n]&&this.positions[e+1]===this.positions[n+1]&&this.positions[e+2]===this.positions[n+2]};qt.prototype.copyV3=function(a){var t=a*6;return[this.positions[t],this.positions[t+1],this.positions[t+2]]};qt.prototype.getDistance=function(a){let t=0;for(let e=0;e<a;e++){let n=6*e,r=new w.Vector3(this.positions[n],this.positions[n+1],this.positions[n+2]),i=new w.Vector3(this.positions[n+6],this.positions[n+7],this.positions[n+8]),o=r.distanceTo(i);t+=o}return t};qt.prototype.process=function(){var a=this.positions.length/6;this.previous=[],this.next=[],this.side=[],this.width=[],this.indices_array=[],this.uvs=[];var t;let e=this.getDistance(a-1);var n;this.compareV3(0,a-1)?n=this.copyV3(a-2):n=this.copyV3(0),this.previous.push(n[0],n[1],n[2]),this.previous.push(n[0],n[1],n[2]);for(var r=0;r<a;r++){if(this.side.push(1),this.side.push(-1),this.widthCallback?t=this.widthCallback(r/(a-1)):t=1,this.width.push(t),this.width.push(t),r===0)this.uvs.push(0,0),this.uvs.push(0,1);else if(r===a-1)this.uvs.push(1,0),this.uvs.push(1,1);else{let o=this.getDistance(r)/e;this.uvs.push(o,0),this.uvs.push(o,1)}if(r<a-1){n=this.copyV3(r),this.previous.push(n[0],n[1],n[2]),this.previous.push(n[0],n[1],n[2]);var i=r*2;this.indices_array.push(i,i+1,i+2),this.indices_array.push(i+2,i+1,i+3)}r>0&&(n=this.copyV3(r),this.next.push(n[0],n[1],n[2]),this.next.push(n[0],n[1],n[2]))}this.compareV3(a-1,0)?n=this.copyV3(1):n=this.copyV3(a-1),this.next.push(n[0],n[1],n[2]),this.next.push(n[0],n[1],n[2]),!this._attributes||this._attributes.position.count!==this.positions.length?this._attributes={position:new w.BufferAttribute(new Float32Array(this.positions),3),previous:new w.BufferAttribute(new Float32Array(this.previous),3),next:new w.BufferAttribute(new Float32Array(this.next),3),side:new w.BufferAttribute(new Float32Array(this.side),1),width:new w.BufferAttribute(new Float32Array(this.width),1),uv:new w.BufferAttribute(new Float32Array(this.uvs),2),index:new w.BufferAttribute(new Uint16Array(this.indices_array),1),counters:new w.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 oo(a,t,e,n,r){var i;if(a=a.subarray||a.slice?a:a.buffer,e=e.subarray||e.slice?e:e.buffer,a=t?a.subarray?a.subarray(t,r&&t+r):a.slice(t,r&&t+r):a,e.set)e.set(a,n);else for(i=0;i<a.length;i++)e[i+n]=a[i];return e}qt.prototype.advance=function(a){var t=this._attributes.position.array,e=this._attributes.previous.array,n=this._attributes.next.array,r=t.length;oo(t,0,e,0,r),oo(t,6,t,0,r-6),t[r-6]=a.x,t[r-5]=a.y,t[r-4]=a.z,t[r-3]=a.x,t[r-2]=a.y,t[r-1]=a.z,oo(t,6,n,0,r-6),n[r-6]=a.x,n[r-5]=a.y,n[r-4]=a.z,n[r-3]=a.x,n[r-2]=a.y,n[r-1]=a.z,this._attributes.position.needsUpdate=!0,this._attributes.previous.needsUpdate=!0,this._attributes.next.needsUpdate=!0};w.ShaderChunk.meshline_vert=["",w.ShaderChunk.logdepthbuf_pars_vertex,w.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;","",w.ShaderChunk.logdepthbuf_vertex,w.ShaderChunk.fog_vertex&&" vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );",w.ShaderChunk.fog_vertex,"}"].join(`
|
|
11924
11924
|
`);w.ShaderChunk.meshline_frag=["",w.ShaderChunk.fog_pars_fragment,w.ShaderChunk.logdepthbuf_pars_fragment,"","uniform sampler2D map;","uniform sampler2D alphaMap;","uniform float useMap;","uniform float useAlphaMap;","uniform float useDash;","uniform float dashArray;","uniform float dashOffset;","uniform float dashRatio;","uniform float visibility;","uniform float alphaTest;","uniform vec2 repeat;","uniform float thresholdRatio;","","varying vec2 vUV;","varying vec4 vColor;","varying float vCounters;","","void main() {",""," if (vUV.x <= thresholdRatio) {"," discard;"," }",w.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);","",w.ShaderChunk.fog_fragment,"}"].join(`
|
|
11925
|
-
`);var fr=class extends w.ShaderMaterial{constructor(t){super({uniforms:Object.assign({},w.UniformsLib.fog,{lineWidth:{value:1},map:{value:null},useMap:{value:0},alphaMap:{value:null},useAlphaMap:{value:0},color:{value:new w.Color(16777215)},opacity:{value:1},resolution:{value:new w.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 w.Vector2(1,1)},thresholdRatio:{value:0},transparent:{value:!0},depthTest:{vale:!1},depthWrite:{value:!1}}),vertexShader:w.ShaderChunk.meshline_vert,fragmentShader:w.ShaderChunk.meshline_frag}),this.isMeshLineMaterial=!0,this.type="MeshLineMaterial",Object.defineProperties(this,{lineWidth:{enumerable:!0,get:function(){return this.uniforms.lineWidth.value},set:function(e){this.uniforms.lineWidth.value=e}},map:{enumerable:!0,get:function(){return this.uniforms.map.value},set:function(e){this.uniforms.map.value=e}},useMap:{enumerable:!0,get:function(){return this.uniforms.useMap.value},set:function(e){this.uniforms.useMap.value=e}},alphaMap:{enumerable:!0,get:function(){return this.uniforms.alphaMap.value},set:function(e){this.uniforms.alphaMap.value=e}},useAlphaMap:{enumerable:!0,get:function(){return this.uniforms.useAlphaMap.value},set:function(e){this.uniforms.useAlphaMap.value=e}},color:{enumerable:!0,get:function(){return this.uniforms.color.value},set:function(e){this.uniforms.color.value=e}},opacity:{enumerable:!0,get:function(){return this.uniforms.opacity.value},set:function(e){this.uniforms.opacity.value=e}},resolution:{enumerable:!0,get:function(){return this.uniforms.resolution.value},set:function(e){this.uniforms.resolution.value.copy(e)}},sizeAttenuation:{enumerable:!0,get:function(){return this.uniforms.sizeAttenuation.value},set:function(e){this.uniforms.sizeAttenuation.value=e}},dashArray:{enumerable:!0,get:function(){return this.uniforms.dashArray.value},set:function(e){this.uniforms.dashArray.value=e,this.useDash=e!==0?1:0}},dashOffset:{enumerable:!0,get:function(){return this.uniforms.dashOffset.value},set:function(e){this.uniforms.dashOffset.value=e}},dashRatio:{enumerable:!0,get:function(){return this.uniforms.dashRatio.value},set:function(e){this.uniforms.dashRatio.value=e}},useDash:{enumerable:!0,get:function(){return this.uniforms.useDash.value},set:function(e){this.uniforms.useDash.value=e}},visibility:{enumerable:!0,get:function(){return this.uniforms.visibility.value},set:function(e){this.uniforms.visibility.value=e}},alphaTest:{enumerable:!0,get:function(){return this.uniforms.alphaTest.value},set:function(e){this.uniforms.alphaTest.value=e}},repeat:{enumerable:!0,get:function(){return this.uniforms.repeat.value},set:function(e){this.uniforms.repeat.value.copy(e)}},thresholdRatio:{enumerable:!0,get:function(){return this.uniforms.thresholdRatio.value},set:function(e){this.uniforms.thresholdRatio.value=e}}}),this.setValues(t)}};fr.prototype.copy=function(a){return w.ShaderMaterial.prototype.copy.call(this,a),this.lineWidth=a.lineWidth,this.map=a.map,this.useMap=a.useMap,this.alphaMap=a.alphaMap,this.useAlphaMap=a.useAlphaMap,this.color.copy(a.color),this.opacity=a.opacity,this.resolution.copy(a.resolution),this.sizeAttenuation=a.sizeAttenuation,this.dashArray.copy(a.dashArray),this.dashOffset.copy(a.dashOffset),this.dashRatio.copy(a.dashRatio),this.useDash=a.useDash,this.visibility=a.visibility,this.alphaTest=a.alphaTest,this.repeat.copy(a.repeat),this};var pa={texture_url:Or,lineWidth:10,color:16777215},ti=class extends vt.Object3D{registryEvent(){this.navigation.bmap.context.addEventListener("control-change",this.onControlChange),this.navigation.bmap.context.addEventListener("update",this.onUpdate),this.navigation.bmap.context.addEventListener("resize",this.onResize)}unRegistryEvent(){this.navigation.bmap.context.removeEventListener("control-change",this.onControlChange),this.navigation.bmap.context.removeEventListener("update",this.onUpdate),this.navigation.bmap.context.removeEventListener("resize",this.onResize)}getRepeat(){let{points:t,navigation:{bmap:{context:{camera:e,clientSize:{width:n,height:r}}}}}=this,i=t.map(s=>{let[u,l]=s;return N(new vt.Vector3(u,l,0),e,n,r)}).map(s=>{let{x:u,y:l}=s;return[u,l]});return Rt(i)/32}changeRepeat(){if(!this.material)return;let t=this.getRepeat();this.material.repeat=new vt.Vector2(t,1)}loadTexture(t){return new Promise((e,n)=>{new vt.TextureLoader().load(t,e,void 0,n)})}transformPoints(t){let e=[];for(let n=0;n<t.length;n++)e.push(...t[n],0);return e}updatePoints(t){this.points=t,this.changeRepeat();let e=this.transformPoints(t);this.geometry&&this.geometry.setPoints(e)}movePath(t){this.material&&(this.material.thresholdRatio=t)}create(t){return g(this,null,function*(){let e=this.geometry=new qt;if(this.updatePoints(t),!this.texture){let i=this.texture=yield this.loadTexture(this.config.texture_url);i.wrapS=i.wrapT=vt.RepeatWrapping}let n=this.material=new fr({useMap:!0,color:new vt.Color(this.config.color),transparent:!0,resolution:new vt.Vector2(this.navigation.bmap.context.clientSize.width,this.navigation.bmap.context.clientSize.height),depthTest:!1,sizeAttenuation:!1,lineWidth:this.config.lineWidth*2,map:this.texture,blending:vt.NormalBlending,repeat:new vt.Vector2(this.getRepeat(),1)}),r=this.mesh=new vt.Mesh(e,n);return r.renderOrder=99999,this.add(r),r})}dispose(){var t,e,n;this.unRegistryEvent(),this.clear(),(t=this.geometry)==null||t.dispose(),(e=this.material)==null||e.dispose(),(n=this.texture)==null||n.dispose(),this.navigation=null}constructor(t,e){super(),this.navigation=t,this.mesh=null,this.geometry=null,this.material=null,this.texture=null,this.config=pa,this.points=[],this.basicRepeat=1,this.prevCameraZoom=0,this.onControlChange=()=>{let n=this.navigation.bmap.context.camera.zoom;n!==this.prevCameraZoom&&(this.prevCameraZoom=n,this.changeRepeat())},this.onUpdate=()=>{this.texture},this.onResize=()=>{if(this.material){let{width:n,height:r}=this.navigation.bmap.context.clientSize;this.material.resolution.set(n,r)}},this.config=Object.assign({},pa,e),this.registryEvent(),this.prevCameraZoom=this.navigation.bmap.context.camera.zoom}};var mn=require("@tweenjs/tween.js"),Ut=require("three");var m2=require("core-js/modules/es.array.unshift.js"),_2=require("core-js/modules/web.dom-collections.iterator.js"),y2=require("core-js/modules/es.array.push.js"),fa=require("three");var da=require("@tweenjs/tween.js"),ga=require("lodash"),gn=require("@turf/turf");var qu={offsetDistance:15,offsetToResetTime:3e3,directionEmitThreshold:5,simulationSpeed:1,destinationDistanceThreshold:10},ei=class extends ct{get curRoutePath(){return this.paths[this.routeIndex]||null}get curRoutePathPoints(){var t;return((t=this.curRoutePath)==null?void 0:t.points)||[]}registryEvent(){this.navigation.bmap.context.addEventListener("update",this.onUpdate),this.navigation.addEventListener("add-path",this.onAddPaths)}unRegistryEvent(){this.navigation.bmap.context.removeEventListener("update",this.onUpdate),this.navigation.removeEventListener("add-path",this.onAddPaths)}setRoadData(t){this.roadData=t}resetStatus(t){this.offset=!1,this.reset=!1,this.routeIndex=0,this.pointIndex=0,this.offsetDistance=0,this.resetTimer&&(this.timer.clearTimeout(this.resetTimer),this.resetTimer=null),t.length&&(this.position=t[0].points[0])}emitNavigationStatus(){let t=this.getNavigationInfo();t&&this.dispatchEvent({type:"navigation-info",info:t})}adsorb(t,e){let{curRoutePathPoints:n,position:r,curRoutePath:i,paths:o,routeIndex:s}=this;if(!n.length)return null;let u=n,l=this.paths[this.routeIndex].floor,c=this.getCurRouteRemainDistance();if(r){let y=ue(n,r);u=u.slice(y+1),u.unshift(r)}let h=[{floor:i==null?void 0:i.floor,points:u},...o.slice(s+1)],{distance:p,closestPoint:f,index:d,i:m}=h.reduce((y,x,E)=>{if(x.floor!==t)return y;let{distance:S,closestPoint:R,index:P}=x.points.reduce((K,T,Q,L)=>{if(!L[Q+1])return v({},K,{distance:K.distance===1/0?U(T,e):K.distance});let{distance:O,closestPoint:I}=Ii(e,T,L[Q+1]);if(!this.navigation.options.canBack&&l===t){let V=[e,...L.slice(Q+1)],it=Rt(V);if(c-it>10)return K}return O<K.distance?{distance:O,closestPoint:I,index:Q}:K},{distance:1/0,closestPoint:x.points[0],index:0});return S<y.distance?{distance:S,closestPoint:R,index:E,i:P}:y},{distance:1/0,closestPoint:u[0],index:0,i:0});return{distance:p,closestPoint:f,routeIndex:d+s,pointIndex:d===0?m+this.pointIndex:m}}toPosition(t,e){let n=this.adsorb(t,e);if(!n)return;let{distance:r,closestPoint:i,routeIndex:o,pointIndex:s}=n;this.offsetDistance=r,r>this.options.offsetDistance?(this.offset=!0,this.resetTimer||(this.resetTimer=this.timer.setTimeout(()=>{this.reset=!0,this.resetTimer=null},this.options.offsetToResetTime))):(this.offset=!1,this.reset=!1,this.resetTimer&&(this.timer.clearTimeout(this.resetTimer),this.resetTimer=null)),this.routeIndex=o,this.pointIndex=s,this.position=i,this.emitNavigationStatus()}startSimulation(){this.resetStatus(this.paths),this.emitNavigationStatus(),this.startCurRouteSimulation()}pause(){var t;this.tweenUtil.clear(),(t=this.throttleUpdatePosition)==null||t.cancel(),this.paused=!0}continue(){this.paused=!1,this.startCurRouteSimulation()}startCurRouteSimulation(){return g(this,null,function*(){let{curRoutePath:t}=this;if(!t)return;this.simulationTween&&this.tweenUtil.remove(this.simulationTween);let e=[];return new Promise(n=>{let r=[this.position,...this.curRoutePathPoints.slice(this.pointIndex+1)],i=this.getCurRouteRemainDistance(),o=i/this.options.simulationSpeed,s=this.throttleUpdatePosition=(0,ga.throttle)(l=>{let c=qe(r,l.distance);c&&(e.push({floor:t.floor,pos:c}),this.toPosition(t.floor,c))},100),u=this.simulationTween=new da.Tween({distance:0},this.tweenUtil.group).to({distance:i},o*1e3).onUpdate(s).onComplete(()=>{this.tweenUtil.remove(u),s.flush(),s.cancel(),this.routeIndex+1<this.paths.length?(this.routeIndex++,this.position=this.paths[this.routeIndex].points[0],this.pointIndex=0,setTimeout(()=>{n(this.startCurRouteSimulation())},3e3)):(n(!0),console.log(e,this.routeIndex,this.paths))}).start()})})}changeSimulationSpeed(t){this.options.simulationSpeed=t,this.paused||this.startCurRouteSimulation()}getCurRouteRemainDistance(){let{curRoutePathPoints:t,pointIndex:e,position:n}=this;if(!t.length)return 0;let r=[n,...t.slice(e+1)];return Rt(r)}getCurRouteToStartDistance(){let{curRoutePathPoints:t,pointIndex:e,position:n}=this;if(!t.length)return 0;let r=[...t.slice(0,e+1),n];return Rt(r)}getRemainDistance(){let t=this.getCurRouteRemainDistance();return{total:this.paths.slice(this.routeIndex+1).reduce((r,i)=>r+i.distance,0)+t,curRoute:t}}getNextDirDistance(){var t;if(!this.position)return null;let{pointIndex:e,curRoutePathPoints:n,position:r,curRoutePath:i}=this,o=e,s=ce.FRONT,u=(i==null||(t=i.pointInfos[o])==null?void 0:t.crossName)||"",l=0,c=0,h=0;for(;s===ce.FRONT&&o<=n.length;){let m=n[o],y=n[o+1],x=n[o+2];if(!m||!y)s=ce.END;else if(l+=U(m,y),!x)s=ce.END;else{s=Tr(m,y,x),c=ke(m,y,x),h=(new fa.Vector2(x[0]-y[0],x[1]-y[1]).angle()*180/Math.PI-90+360)%360;var p;u=(p=i==null?void 0:i.pointInfos[o+1].crossName)!=null?p:"",o+=1}}n[o]&&(l=U(r,n[o]));let f=Ar(c);if(s===ce.END&&l<=this.options.directionEmitThreshold)return{dir:s,distance:l,crossName:u,angle:c,nextAngle:h,nextDir:f};let d=this.getCurRouteToStartDistance();return e===0&&d<=5?{dir:ce.START,distance:l,crossName:u,angle:c,nextAngle:h,nextDir:f}:(l>=this.options.directionEmitThreshold&&(s=ce.FRONT),{dir:s,distance:l,crossName:u,angle:c,nextAngle:h,nextDir:f})}getCurPointAreaInfo(){let t=this.roadData.find(e=>e.floor===this.paths[this.routeIndex].floor);if(t){let e=(t.areas||[]).find(n=>{let r=(0,gn.polygon)(n.cds),i=(0,gn.point)(this.position);return(0,gn.booleanPointInPolygon)(i,r)});if(e)return e}return{imageUrl:null}}getNavigationInfo(){let{total:t,curRoute:e}=this.getRemainDistance(),n=this.getNextDirDistance();if(!n)return null;let{dir:r,distance:i,crossName:o,angle:s,nextAngle:u,nextDir:l}=n;e<=this.options.destinationDistanceThreshold&&(r=ce.END);let{imageUrl:c}=this.getCurPointAreaInfo();return{distance:t,curRouteDistance:e,nextDirDistance:i,dir:r,angle:s,nextAngle:u,pos:this.position,routeIndex:this.routeIndex,crossName:o,offset:this.offset,reset:this.reset,imageUrl:c,nextDir:l,offsetDistance:this.offsetDistance}}dispose(){this.timer.dispose(),this.unRegistryEvent(),this.tweenUtil.clear(),this.navigation=null}constructor(t,e,n){super(),this.navigation=t,this.offset=!1,this.reset=!1,this.position=[0,0],this.routeIndex=0,this.pointIndex=0,this.paths=[],this.timer=new $,this.resetTimer=null,this.tweenUtil=new be,this.paused=!1,this.offsetDistance=0,this.onAddPaths=r=>{let{paths:i}=r;this.paths=i,this.resetStatus(i),this.simulationTween&&!this.paused&&this.startSimulation()},this.onUpdate=()=>{this.tweenUtil.update()},this.options=Object.assign({},qu,e),this.roadData=n,this.registryEvent()}};var b2=require("core-js/modules/es.typed-array.uint8-array.js"),S2=require("core-js/modules/es.typed-array.at.js"),M2=require("core-js/modules/es.typed-array.fill.js"),w2=require("core-js/modules/es.typed-array.find-last.js"),T2=require("core-js/modules/es.typed-array.find-last-index.js"),A2=require("core-js/modules/es.typed-array.set.js"),C2=require("core-js/modules/es.typed-array.sort.js"),I2=require("core-js/modules/es.typed-array.to-reversed.js"),R2=require("core-js/modules/es.typed-array.to-sorted.js"),P2=require("core-js/modules/es.typed-array.with.js"),L2=require("core-js/modules/es.array-buffer.constructor.js"),N2=require("core-js/modules/es.array-buffer.slice.js"),O2=require("core-js/modules/es.array-buffer.detached.js"),D2=require("core-js/modules/es.array-buffer.transfer.js"),U2=require("core-js/modules/es.array-buffer.transfer-to-fixed-length.js"),F2=require("core-js/modules/es.typed-array.from.js"),B2=require("core-js/modules/web.dom-collections.iterator.js"),te=require("three");var we=class a extends st{addDebug(){a.canvas.style.cssText=`
|
|
11925
|
+
`);var fr=class extends w.ShaderMaterial{constructor(t){super({uniforms:Object.assign({},w.UniformsLib.fog,{lineWidth:{value:1},map:{value:null},useMap:{value:0},alphaMap:{value:null},useAlphaMap:{value:0},color:{value:new w.Color(16777215)},opacity:{value:1},resolution:{value:new w.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 w.Vector2(1,1)},thresholdRatio:{value:0},transparent:{value:!0},depthTest:{vale:!1},depthWrite:{value:!1}}),vertexShader:w.ShaderChunk.meshline_vert,fragmentShader:w.ShaderChunk.meshline_frag}),this.isMeshLineMaterial=!0,this.type="MeshLineMaterial",Object.defineProperties(this,{lineWidth:{enumerable:!0,get:function(){return this.uniforms.lineWidth.value},set:function(e){this.uniforms.lineWidth.value=e}},map:{enumerable:!0,get:function(){return this.uniforms.map.value},set:function(e){this.uniforms.map.value=e}},useMap:{enumerable:!0,get:function(){return this.uniforms.useMap.value},set:function(e){this.uniforms.useMap.value=e}},alphaMap:{enumerable:!0,get:function(){return this.uniforms.alphaMap.value},set:function(e){this.uniforms.alphaMap.value=e}},useAlphaMap:{enumerable:!0,get:function(){return this.uniforms.useAlphaMap.value},set:function(e){this.uniforms.useAlphaMap.value=e}},color:{enumerable:!0,get:function(){return this.uniforms.color.value},set:function(e){this.uniforms.color.value=e}},opacity:{enumerable:!0,get:function(){return this.uniforms.opacity.value},set:function(e){this.uniforms.opacity.value=e}},resolution:{enumerable:!0,get:function(){return this.uniforms.resolution.value},set:function(e){this.uniforms.resolution.value.copy(e)}},sizeAttenuation:{enumerable:!0,get:function(){return this.uniforms.sizeAttenuation.value},set:function(e){this.uniforms.sizeAttenuation.value=e}},dashArray:{enumerable:!0,get:function(){return this.uniforms.dashArray.value},set:function(e){this.uniforms.dashArray.value=e,this.useDash=e!==0?1:0}},dashOffset:{enumerable:!0,get:function(){return this.uniforms.dashOffset.value},set:function(e){this.uniforms.dashOffset.value=e}},dashRatio:{enumerable:!0,get:function(){return this.uniforms.dashRatio.value},set:function(e){this.uniforms.dashRatio.value=e}},useDash:{enumerable:!0,get:function(){return this.uniforms.useDash.value},set:function(e){this.uniforms.useDash.value=e}},visibility:{enumerable:!0,get:function(){return this.uniforms.visibility.value},set:function(e){this.uniforms.visibility.value=e}},alphaTest:{enumerable:!0,get:function(){return this.uniforms.alphaTest.value},set:function(e){this.uniforms.alphaTest.value=e}},repeat:{enumerable:!0,get:function(){return this.uniforms.repeat.value},set:function(e){this.uniforms.repeat.value.copy(e)}},thresholdRatio:{enumerable:!0,get:function(){return this.uniforms.thresholdRatio.value},set:function(e){this.uniforms.thresholdRatio.value=e}}}),this.setValues(t)}};fr.prototype.copy=function(a){return w.ShaderMaterial.prototype.copy.call(this,a),this.lineWidth=a.lineWidth,this.map=a.map,this.useMap=a.useMap,this.alphaMap=a.alphaMap,this.useAlphaMap=a.useAlphaMap,this.color.copy(a.color),this.opacity=a.opacity,this.resolution.copy(a.resolution),this.sizeAttenuation=a.sizeAttenuation,this.dashArray.copy(a.dashArray),this.dashOffset.copy(a.dashOffset),this.dashRatio.copy(a.dashRatio),this.useDash=a.useDash,this.visibility=a.visibility,this.alphaTest=a.alphaTest,this.repeat.copy(a.repeat),this};var pa={texture_url:Or,lineWidth:10,color:16777215},ti=class extends vt.Object3D{registryEvent(){this.navigation.bmap.context.addEventListener("control-change",this.onControlChange),this.navigation.bmap.context.addEventListener("update",this.onUpdate),this.navigation.bmap.context.addEventListener("resize",this.onResize)}unRegistryEvent(){this.navigation.bmap.context.removeEventListener("control-change",this.onControlChange),this.navigation.bmap.context.removeEventListener("update",this.onUpdate),this.navigation.bmap.context.removeEventListener("resize",this.onResize)}getRepeat(){let{points:t,navigation:{bmap:{context:{camera:e,clientSize:{width:n,height:r}}}}}=this,i=t.map(s=>{let[u,l]=s;return N(new vt.Vector3(u,l,0),e,n,r)}).map(s=>{let{x:u,y:l}=s;return[u,l]});return Rt(i)/32}changeRepeat(){if(!this.material)return;let t=this.getRepeat();this.material.repeat=new vt.Vector2(t,1)}loadTexture(t){return new Promise((e,n)=>{new vt.TextureLoader().load(t,e,void 0,n)})}transformPoints(t){let e=[];for(let n=0;n<t.length;n++)e.push(...t[n],0);return e}updatePoints(t){this.points=t,this.changeRepeat();let e=this.transformPoints(t);this.geometry&&this.geometry.setPoints(e)}movePath(t){this.material&&(this.material.thresholdRatio=t)}create(t){return g(this,null,function*(){let e=this.geometry=new qt;if(this.updatePoints(t),!this.texture){let i=this.texture=yield this.loadTexture(this.config.texture_url);i.wrapS=i.wrapT=vt.RepeatWrapping}let n=this.material=new fr({useMap:!0,color:new vt.Color(this.config.color),transparent:!0,resolution:new vt.Vector2(this.navigation.bmap.context.clientSize.width,this.navigation.bmap.context.clientSize.height),depthTest:!1,sizeAttenuation:!1,lineWidth:this.config.lineWidth*2,map:this.texture,blending:vt.NormalBlending,repeat:new vt.Vector2(this.getRepeat(),1)}),r=this.mesh=new vt.Mesh(e,n);return r.renderOrder=99999,this.add(r),r})}dispose(){var t,e,n;this.unRegistryEvent(),this.clear(),(t=this.geometry)==null||t.dispose(),(e=this.material)==null||e.dispose(),(n=this.texture)==null||n.dispose(),this.navigation=null}constructor(t,e){super(),this.navigation=t,this.mesh=null,this.geometry=null,this.material=null,this.texture=null,this.config=pa,this.points=[],this.basicRepeat=1,this.prevCameraZoom=0,this.onControlChange=()=>{let n=this.navigation.bmap.context.camera.zoom;n!==this.prevCameraZoom&&(this.prevCameraZoom=n,this.changeRepeat())},this.onUpdate=()=>{this.texture},this.onResize=()=>{if(this.material){let{width:n,height:r}=this.navigation.bmap.context.clientSize;this.material.resolution.set(n,r)}},this.config=Object.assign({},pa,e),this.registryEvent(),this.prevCameraZoom=this.navigation.bmap.context.camera.zoom}};var mn=require("@tweenjs/tween.js"),Ut=require("three");var m2=require("core-js/modules/es.array.unshift.js"),_2=require("core-js/modules/web.dom-collections.iterator.js"),y2=require("core-js/modules/es.array.push.js"),fa=require("three");var da=require("@tweenjs/tween.js"),ga=require("lodash"),gn=require("@turf/turf");var qu={offsetDistance:15,offsetToResetTime:3e3,directionEmitThreshold:5,simulationSpeed:1,destinationDistanceThreshold:10},ei=class extends ct{get curRoutePath(){return this.paths[this.routeIndex]||null}get curRoutePathPoints(){var t;return((t=this.curRoutePath)==null?void 0:t.points)||[]}registryEvent(){this.navigation.bmap.context.addEventListener("update",this.onUpdate),this.navigation.addEventListener("add-path",this.onAddPaths)}unRegistryEvent(){this.navigation.bmap.context.removeEventListener("update",this.onUpdate),this.navigation.removeEventListener("add-path",this.onAddPaths)}setRoadData(t){this.roadData=t}resetStatus(t){this.offset=!1,this.reset=!1,this.routeIndex=0,this.pointIndex=0,this.offsetDistance=0,this.resetTimer&&(this.timer.clearTimeout(this.resetTimer),this.resetTimer=null),t.length&&(this.position=t[0].points[0])}emitNavigationStatus(){let t=this.getNavigationInfo();t&&this.dispatchEvent({type:"navigation-info",info:t})}adsorb(t,e){let{curRoutePathPoints:n,position:r,curRoutePath:i,paths:o,routeIndex:s}=this;if(!n.length)return null;let u=n,l=this.paths[this.routeIndex].floor,c=this.getCurRouteRemainDistance();if(r){let _=ue(n,r);u=u.slice(_+1),u.unshift(r)}let h=[{floor:i==null?void 0:i.floor,points:u},...o.slice(s+1)],{distance:p,closestPoint:f,index:d,i:m}=h.reduce((_,x,E)=>{if(x.floor!==t)return _;let{distance:S,closestPoint:R,index:P}=x.points.reduce((K,T,Q,L)=>{if(!L[Q+1])return v({},K,{distance:K.distance===1/0?U(T,e):K.distance});let{distance:O,closestPoint:I}=Ii(e,T,L[Q+1]);if(!this.navigation.options.canBack&&l===t){let V=[e,...L.slice(Q+1)],it=Rt(V);if(c-it>10)return K}return O<K.distance?{distance:O,closestPoint:I,index:Q}:K},{distance:1/0,closestPoint:x.points[0],index:0});return S<_.distance?{distance:S,closestPoint:R,index:E,i:P}:_},{distance:1/0,closestPoint:u[0],index:0,i:0});return{distance:p,closestPoint:f,routeIndex:d+s,pointIndex:d===0?m+this.pointIndex:m}}toPosition(t,e){let n=this.adsorb(t,e);if(!n)return;let{distance:r,closestPoint:i,routeIndex:o,pointIndex:s}=n;this.offsetDistance=r,r>this.options.offsetDistance?(this.offset=!0,this.resetTimer||(this.resetTimer=this.timer.setTimeout(()=>{this.reset=!0,this.resetTimer=null},this.options.offsetToResetTime))):(this.offset=!1,this.reset=!1,this.resetTimer&&(this.timer.clearTimeout(this.resetTimer),this.resetTimer=null)),this.routeIndex=o,this.pointIndex=s,this.position=i,this.emitNavigationStatus()}startSimulation(){this.resetStatus(this.paths),this.emitNavigationStatus(),this.startCurRouteSimulation()}pause(){var t;this.tweenUtil.clear(),(t=this.throttleUpdatePosition)==null||t.cancel(),this.paused=!0}continue(){this.paused=!1,this.startCurRouteSimulation()}startCurRouteSimulation(){return g(this,null,function*(){let{curRoutePath:t}=this;if(!t)return;this.simulationTween&&this.tweenUtil.remove(this.simulationTween);let e=[];return new Promise(n=>{let r=[this.position,...this.curRoutePathPoints.slice(this.pointIndex+1)],i=this.getCurRouteRemainDistance(),o=i/this.options.simulationSpeed,s=this.throttleUpdatePosition=(0,ga.throttle)(l=>{let c=qe(r,l.distance);c&&(e.push({floor:t.floor,pos:c}),this.toPosition(t.floor,c))},100),u=this.simulationTween=new da.Tween({distance:0},this.tweenUtil.group).to({distance:i},o*1e3).onUpdate(s).onComplete(()=>{this.tweenUtil.remove(u),s.flush(),s.cancel(),this.routeIndex+1<this.paths.length?(this.routeIndex++,this.position=this.paths[this.routeIndex].points[0],this.pointIndex=0,setTimeout(()=>{n(this.startCurRouteSimulation())},3e3)):(n(!0),console.log(e,this.routeIndex,this.paths))}).start()})})}changeSimulationSpeed(t){this.options.simulationSpeed=t,this.paused||this.startCurRouteSimulation()}getCurRouteRemainDistance(){let{curRoutePathPoints:t,pointIndex:e,position:n}=this;if(!t.length)return 0;let r=[n,...t.slice(e+1)];return Rt(r)}getCurRouteToStartDistance(){let{curRoutePathPoints:t,pointIndex:e,position:n}=this;if(!t.length)return 0;let r=[...t.slice(0,e+1),n];return Rt(r)}getRemainDistance(){let t=this.getCurRouteRemainDistance();return{total:this.paths.slice(this.routeIndex+1).reduce((r,i)=>r+i.distance,0)+t,curRoute:t}}getNextDirDistance(){var t;if(!this.position)return null;let{pointIndex:e,curRoutePathPoints:n,position:r,curRoutePath:i}=this,o=e,s=ce.FRONT,u=(i==null||(t=i.pointInfos[o])==null?void 0:t.crossName)||"",l=0,c=0,h=0;for(;s===ce.FRONT&&o<=n.length;){let m=n[o],_=n[o+1],x=n[o+2];if(!m||!_)s=ce.END;else if(l+=U(m,_),!x)s=ce.END;else{s=Tr(m,_,x),c=ke(m,_,x),h=(new fa.Vector2(x[0]-_[0],x[1]-_[1]).angle()*180/Math.PI-90+360)%360;var p;u=(p=i==null?void 0:i.pointInfos[o+1].crossName)!=null?p:"",o+=1}}n[o]&&(l=U(r,n[o]));let f=Ar(c);if(s===ce.END&&l<=this.options.directionEmitThreshold)return{dir:s,distance:l,crossName:u,angle:c,nextAngle:h,nextDir:f};let d=this.getCurRouteToStartDistance();return e===0&&d<=5?{dir:ce.START,distance:l,crossName:u,angle:c,nextAngle:h,nextDir:f}:(l>=this.options.directionEmitThreshold&&(s=ce.FRONT),{dir:s,distance:l,crossName:u,angle:c,nextAngle:h,nextDir:f})}getCurPointAreaInfo(){let t=this.roadData.find(e=>e.floor===this.paths[this.routeIndex].floor);if(t){let e=(t.areas||[]).find(n=>{let r=(0,gn.polygon)(n.cds),i=(0,gn.point)(this.position);return(0,gn.booleanPointInPolygon)(i,r)});if(e)return e}return{imageUrl:null}}getNavigationInfo(){let{total:t,curRoute:e}=this.getRemainDistance(),n=this.getNextDirDistance();if(!n)return null;let{dir:r,distance:i,crossName:o,angle:s,nextAngle:u,nextDir:l}=n;e<=this.options.destinationDistanceThreshold&&(r=ce.END);let{imageUrl:c}=this.getCurPointAreaInfo();return{distance:t,curRouteDistance:e,nextDirDistance:i,dir:r,angle:s,nextAngle:u,pos:this.position,routeIndex:this.routeIndex,crossName:o,offset:this.offset,reset:this.reset,imageUrl:c,nextDir:l,offsetDistance:this.offsetDistance}}dispose(){this.timer.dispose(),this.unRegistryEvent(),this.tweenUtil.clear(),this.navigation=null}constructor(t,e,n){super(),this.navigation=t,this.offset=!1,this.reset=!1,this.position=[0,0],this.routeIndex=0,this.pointIndex=0,this.paths=[],this.timer=new $,this.resetTimer=null,this.tweenUtil=new be,this.paused=!1,this.offsetDistance=0,this.onAddPaths=r=>{let{paths:i}=r;this.paths=i,this.resetStatus(i),this.simulationTween&&!this.paused&&this.startSimulation()},this.onUpdate=()=>{this.tweenUtil.update()},this.options=Object.assign({},qu,e),this.roadData=n,this.registryEvent()}};var b2=require("core-js/modules/es.typed-array.uint8-array.js"),S2=require("core-js/modules/es.typed-array.at.js"),M2=require("core-js/modules/es.typed-array.fill.js"),w2=require("core-js/modules/es.typed-array.find-last.js"),T2=require("core-js/modules/es.typed-array.find-last-index.js"),A2=require("core-js/modules/es.typed-array.set.js"),C2=require("core-js/modules/es.typed-array.sort.js"),I2=require("core-js/modules/es.typed-array.to-reversed.js"),R2=require("core-js/modules/es.typed-array.to-sorted.js"),P2=require("core-js/modules/es.typed-array.with.js"),L2=require("core-js/modules/es.array-buffer.constructor.js"),N2=require("core-js/modules/es.array-buffer.slice.js"),O2=require("core-js/modules/es.array-buffer.detached.js"),D2=require("core-js/modules/es.array-buffer.transfer.js"),U2=require("core-js/modules/es.array-buffer.transfer-to-fixed-length.js"),F2=require("core-js/modules/es.typed-array.from.js"),B2=require("core-js/modules/web.dom-collections.iterator.js"),te=require("three");var we=class a extends st{addDebug(){a.canvas.style.cssText=`
|
|
11926
11926
|
position: fixed;
|
|
11927
11927
|
top: 0;
|
|
11928
11928
|
left: 0;
|
|
@@ -19751,7 +19751,7 @@ void main() {
|
|
|
19751
19751
|
float uvx = prevUv + (vUv.y + 1.0) / 2.0 * vCustomUv;
|
|
19752
19752
|
gl_FragColor = diffuseColor * texture2D(map, vec2(uvx, (vUv.x + 1.0) / 2.0) * repeat);
|
|
19753
19753
|
}
|
|
19754
|
-
`};var ui=class extends xt.ShaderMaterial{constructor(t){super({type:"ArrowLineMaterial",uniforms:Object.assign({},xt.UniformsUtils.clone(xt.ShaderLib["custom-line"].uniforms),{map:{value:null}}),vertexShader:xt.ShaderLib["custom-line"].vertexShader,fragmentShader:xt.ShaderLib["custom-line"].fragmentShader,clipping:!0}),this.dashed=!1,Object.defineProperties(this,{map:{enumerable:!0,get:function(){return this.uniforms.map.value},set:function(e){this.uniforms.map.value=e}},color:{enumerable:!0,get:function(){return this.uniforms.diffuse.value},set:function(e){this.uniforms.diffuse.value=e}},linewidth:{enumerable:!0,get:function(){return this.uniforms.linewidth.value},set:function(e){this.uniforms.linewidth.value=e}},dashScale:{enumerable:!0,get:function(){return this.uniforms.dashScale.value},set:function(e){this.uniforms.dashScale.value=e}},dashSize:{enumerable:!0,get:function(){return this.uniforms.dashSize.value},set:function(e){this.uniforms.dashSize.value=e}},gapSize:{enumerable:!0,get:function(){return this.uniforms.gapSize.value},set:function(e){this.uniforms.gapSize.value=e}},resolution:{enumerable:!0,get:function(){return this.uniforms.resolution.value},set:function(e){this.uniforms.resolution.value.copy(e)}},repeat:{enumerable:!0,get:function(){return this.uniforms.repeat.value},set:function(e){this.uniforms.repeat.value.copy(e)}},allDistance:{enumerable:!0,get:function(){return this.uniforms.allDistance.value},set:function(e){this.uniforms.allDistance.value=e}}}),this.setValues(t),this.isLineMaterial=!0}};var Ea=require("three/examples/jsm/lines/LineGeometry.js"),ba=require("three/examples/jsm/lines/Line2.js");var xa={texture_url:Or,lineWidth:8,color:16777215},li=class extends Et.Object3D{registryEvent(){this.navigation.bmap.context.addEventListener("control-change",this.onControlChange),this.navigation.bmap.context.addEventListener("update",this.onUpdate),this.navigation.bmap.context.addEventListener("resize",this.onResize)}unRegistryEvent(){this.navigation.bmap.context.removeEventListener("control-change",this.onControlChange),this.navigation.bmap.context.removeEventListener("update",this.onUpdate),this.navigation.bmap.context.removeEventListener("resize",this.onResize)}getRepeat(){let{points:t,navigation:{bmap:{context:{camera:e,clientSize:{width:n,height:r}}}}}=this,i=t.map(s=>{let[u,l,c]=s;return N(new Et.Vector3(u,l,c),e,n,r)}).map(s=>{let{x:u,y:l}=s;return[u,l]});return Rt(i)/32}changeRepeat(){if(!this.material)return;let t=this.getRepeat();this.material.repeat=new Et.Vector2(t,1)}loadTexture(t){return new Promise((e,n)=>{new Et.TextureLoader().load(t,e,void 0,n)})}transformPoints(t){let e=[];for(let n=0;n<t.length;n++)e.push(...t[n]);return e}updatePoints(t){if(this.points=t,this.mesh){var e,n;this.remove(this.mesh),(e=this.material)==null||e.dispose(),(n=this.geometry)==null||n.dispose()}this.geometry=new Ea.LineGeometry,this.geometry.setPositions(t.flat(2));let r=Rt(t.map(s=>{let[u,l]=s;return[u,l]})),i=this.material=new ui({color:new Et.Color(this.config.color),transparent:!0,resolution:new Et.Vector2(this.navigation.bmap.context.clientSize.width,this.navigation.bmap.context.clientSize.height),depthTest:!0,depthWrite:!0,linewidth:this.config.lineWidth,map:this.texture,blending:Et.NormalBlending,repeat:new Et.Vector2(this.getRepeat(),1),allDistance:r}),o=this.mesh=new ba.Line2(this.geometry,i);return o.computeLineDistances(),o.renderOrder=9,this.add(o),o}movePath(t){this.material&&(this.material.thresholdRatio=t)}create(t){return g(this,null,function*(){if(!this.texture){let e=this.texture=yield this.loadTexture(this.config.texture_url);e.wrapS=e.wrapT=Et.RepeatWrapping}return this.updatePoints(t)})}getBoundingBox(){return this.mesh?(this.mesh.geometry.computeBoundingBox(),new Et.Box3().copy(this.mesh.geometry.boundingBox).applyMatrix4(this.mesh.matrixWorld)):null}dispose(){var t,e,n;this.unRegistryEvent(),this.clear(),(t=this.geometry)==null||t.dispose(),(e=this.material)==null||e.dispose(),(n=this.texture)==null||n.dispose(),this.navigation=null}constructor(t,e){super(),this.navigation=t,this.mesh=null,this.geometry=null,this.material=null,this.texture=null,this.config=xa,this.points=[],this.basicRepeat=1,this.prevCameraZoom=0,this.onControlChange=()=>{let n=this.navigation.bmap.context.camera.zoom;n!==this.prevCameraZoom&&(this.prevCameraZoom=n,this.changeRepeat())},this.onUpdate=()=>{this.texture},this.onResize=()=>{if(this.material){let{width:n,height:r}=this.navigation.bmap.context.clientSize;this.material.resolution.set(n,r)}},this.config=Object.assign({},xa,e),this.registryEvent(),this.prevCameraZoom=this.navigation.bmap.context.camera.zoom}};var Sa=require("@tweenjs/tween.js");var jt=require("three"),ci=class extends jt.Object3D{meshSetMaterial(t){t instanceof jt.Mesh&&(t.material.emissiveIntensity=.5,t.material.shininess=0,t.material.emissive=t.material.color,t.material.emissiveMap=t.material.map,t.material.transparent=!0,t.material.depthTest=!1,t.renderOrder=1e6),t.children.forEach(n=>{this.meshSetMaterial(n)})}getBaseScale(t){let{clientSize:{height:e},camera:n}=this.bmap.context,i=(n.top-n.bottom)/n.zoom/e;return this.options.size*i/this.modelMaxLength}registryEvent(){this.bmap.context.addEventListener("update",this._update),this.bmap.context.addEventListener("control-zoom-change",this._onChangeZoom)}unRegistryEvent(){this.bmap.context.removeEventListener("update",this._update),this.bmap.context.removeEventListener("control-zoom-change",this._onChangeZoom)}lookAtCamera(){if(this.model&&this.bmap&&this.bmap.context){let t=this.bmap.context.camera,e=new jt.Euler;e.setFromQuaternion(t.quaternion,"ZYX"),this.group.rotation.copy(e)}}setClips(t){this.clearClips(),t.length&&(this.mixer=new jt.AnimationMixer(this.model.scene),t.forEach(e=>this.mixer.clipAction(e).play()))}startClips(){var t;this.setClips(((t=this.model)==null?void 0:t.animations)||[])}clearClips(){this.mixer&&(this.mixer.stopAllAction(),this.mixer.uncacheRoot(this.mixer.getRoot()),this.mixer=null)}dispose(){this.unRegistryEvent(),this.clearClips(),this.clear(),this.model&&F(this.model.scene),this.bmap=null}constructor(t,e,n={}){super(),this.bmap=t,this.group=new jt.Object3D,this.mixer=null,this.previewTime=0,this.modelMaxLength=0,this.options={size:40},this._update=()=>{let r=Date.now();if(!this.previewTime)this.previewTime=r;else{var i;let o=r-this.previewTime;this.previewTime=r,(i=this.mixer)==null||i.update(o/1e3)}this.lookAtCamera()},this._onChangeZoom=r=>{let{zoom:i}=r;var o;if(!this.model)return;let s=this.getBaseScale(this.model.scene);(o=this.model)==null||o.scene.scale.set(s,s,s)},this.options=v({},this.options,n),this.add(this.group),It.loadModel(e,!1).then(r=>{this.model=r;let o=new jt.Box3().setFromObject(r.scene).getSize(new jt.Vector3),s=Math.max(o.x,o.y,o.z);this.modelMaxLength=s;let u=this.getBaseScale(r.scene);r.scene.scale.set(u,u,u),this.meshSetMaterial(r.scene),this.group.add(r.scene),this.setClips(r.animations),this.group.rotation.set(Math.PI/2,Math.PI,0),this.dispatchEvent({type:"loaded"})}),this.registryEvent()}};var hi=require("three");var po=class extends at{registryEvent(){this.bmap.context.addEventListener("update",this.onUpdate)}pauseAnimation(){this.tweenUtil.pause()}continueAnimation(){this.tweenUtil.continue()}clearTween(){this.tweenUtil.clear(),this.bmap.context.control.enabled=!0}unRegistryEvent(){this.bmap.context.removeEventListener("update",this.onUpdate)}clearPath(){this.path&&(this.bmap.context.scene.remove(this.path),this.path.dispose(),this.path=null,this.movedDistance=0,this.clearTween()),this.startModel&&(this.startModel.visible=!1),this.translatePath=null}addPath(t){this.paths=t;let e=t.map(n=>v({},n,{points:this.translatePoints(n.points)}));if(this.clearTween(),this.movedDistance=0,this.bmap.currentBuildGround)this.renderPath(e);else{let n=()=>{this.bmap.removeEventListener("center-change",n),this.renderPath(e)};this.bmap.addEventListener("center-change",n)}this.dispatchEvent({type:"add-path",paths:t})}translatePoints(t){let[e,n]=this.bmap.buildingCenter;return t.map(r=>[r[0]-e,r[1]-n])}renderPath(t){return g(this,null,function*(){if(!t.length)return this.clearPath();let e=[];t.forEach((n,r,i)=>{let o=this.mulFloor.floors.find(s=>s.name===n.floor);e.push(...n.points.map(s=>{let[u,l]=s;return[u,l,o.position.z+o.groundMaxHeight]}))}),this.cPath=e,this.animationPathOptions={cPathIndex:0},this.path?this.path.updatePoints(e):(this.path=new li(this),yield this.path.create(e),this.path.position.z=.5,this.bmap.context.scene.add(this.path)),this.startModel&&(this.startModel.position.set(e[0][0],e[0][1],e[0][2]),this.startModel.visible=!0),this.dispatchEvent({type:"render-path",path:this.path})})}catmullRomCurve3(t){return Pn(t,!1,!0,.1,170,2.5)}getPathDirection(t,e){if(t.length<2)return null;let n=ue(t,e),r=t[n],i=t[n+1],o=new hi.Vector3(i[0]-r[0],i[1]-r[1],0).normalize(),s=new hi.Vector3(0,1,0).normalize(),u=o.angleTo(s),l=new hi.Vector3().crossVectors(s,o);return(Object.is(l.y,0)?-1:1)*u}startSimulation(t){return g(this,null,function*(){t===void 0&&(t=1);let{paths:e,movedDistance:n}=this;if(!e.length)return;let r=e.reduce((o,s)=>o+s.distance,0);if(!r||n>=r)return;this.simulationTween&&this.tweenUtil.remove(this.simulationTween);let i=r/t;return this.startModel.startClips(),new Promise(o=>{let s=this.simulationTween=new Sa.Tween({distance:this.movedDistance},this.tweenUtil.group).to({distance:r},i*1e3).onUpdate(u=>{var l;this.movedDistance=u.distance;let c=u.distance,h=0;for(let y=0;y<e.length;y++)if(e[y].distance>=c){h=y;break}else c-=e[y].distance;let p=qe(e[h].points,c);if(p===null)return;this.currentPathPosition=p;let f=this.translatePoints([p])[0],d=this.mulFloor.floors.find(y=>y.name===e[h].floor),m=d?d.position.z+d.groundMaxHeight:(l=this.startModel)==null?void 0:l.position.z;this.startModel&&this.startModel.position.set(f[0],f[1],m)}).onComplete(()=>{this.tweenUtil.remove(s),this.startModel.clearClips(),o(!0)}).start()})})}setStartPoiRotate(t){if(this.startPoi){let n=(this.bmap.context.control.getAzimuthalAngle()*180/Math.PI+360)%360;this.startPoi.options.icon_rotate=(360-t-n)%360}}dispose(){this.path&&(this.bmap.context.scene.remove(this.path),this.path.dispose()),this.startModel&&(this.bmap.context.scene.remove(this.startModel),this.startModel.dispose()),this.tweenUtil.dispose(),this.unRegistryEvent(),super.dispose()}constructor(t,e,n={}){super(t),this.mulFloor=e,this.path=null,this.fetchRoadStatus=!1,this.paths=[],this.curFloorPath=null,this.translatePath=null,this.currentPathPosition=null,this.pathTween=null,this.startPoi=null,this.movedDistance=0,this.tweenUtil=new be,this.animationPathOptions={cPathIndex:0},this.cPath=[],this.onUpdate=()=>{this.tweenUtil.update()},this.startModel=new ci(t,Ss,n.startModel),this.startModel.visible=!1,this.bmap.context.scene.add(this.startModel),this.registryEvent()}};var L6=require("core-js/modules/es.array.flat.js"),N6=require("core-js/modules/es.array.unscopables.flat.js"),pi=require("three");var fo=class extends at{registryEvent(){this.clickHelper.addEventListener("click",this._click)}unRegistryEvent(){this.clickHelper.removeEventListener("click",this._click)}dispose(){this.unRegistryEvent(),this.clickHelper.dispose(),this.mulFloors=null,super.dispose()}constructor(t,e){super(t),this.mulFloors=e,this._click=n=>{let{e:r}=n;if(!this.mulFloors.showStatus)return;let i=new pi.Vector2,{offsetX:o,offsetY:s}=r,u=this.mulFloors.floors.map(p=>p.poiLayer2.getPoiByDeviceXy(o,s)).flat(2),{clientSize:l}=this.bmap.context;i.x=o/l.width*2-1,i.y=s/l.height*-2+1;let c=new pi.Raycaster;c.setFromCamera(i,this.bmap.context.camera),c.ray.origin.sub(c.ray.direction.clone().multiplyScalar(1e4));let h=this.mulFloors.floors.map(p=>p.graphicLayer.getGraphicByRaycaster(c).graphics).flat();this.dispatchEvent({type:"select",pois:u,graphics:h})},this.clickHelper=new Nn(this.bmap.context.container),this.registryEvent()}};var H6=require("core-js/modules/es.array.find-last-index.js"),W6=require("core-js/modules/es.array.find-last.js"),X6=require("core-js/modules/es.array.push.js");var F6=require("core-js/modules/web.dom-collections.iterator.js"),B6=require("core-js/modules/es.array.push.js"),z6=require("core-js/modules/es.array.sort.js"),yn=require("three");function $u(a){let t=a.length,e=0,n=0,r=0,i=0;a.forEach(u=>{e+=u[0],n+=u[1],r+=u[0]*u[1],i+=u[0]*u[0]});let o=(t*r-e*n)/(t*i-e*e),s=(n-o*e)/t;return{m:o,b:s}}function Ju(a,t,e){let n=e[0][0],r=e.slice(-1)[0][0],i=a*n+t,o=a*r+t;return{start:[n,i],end:[r,o]}}function vr(a){if(a.length<2)return null;let t=a.filter((u,l)=>{let c=[...a];return c.splice(l,1),c.every(h=>h[0]!==u[0]&&h[1]!==u[1])});if(t.length<2)return null;let{m:e,b:n}=$u(t),{start:r,end:i}=Ju(e,n,t),s=360-(new yn.Vector2().subVectors(new yn.Vector2(i[0],i[1]),new yn.Vector2(r[0],r[1])).angle()/Math.PI*180-90+360)%360;return Number.isNaN(s)?null:s}function Qu(a){let t=[];for(let e=1;e<a.length;e++){let n=a[e-1],r=a[e],i=r.position[0]-n.position[0],o=r.position[1]-n.position[1],s=Math.sqrt(i**2+o**2),u=r.time-n.time;if(u>0){let l=s/u;console.log("speedDelta",n.type,r.type,fi(l),s,u),t.push(l)}else t.push(0)}return t}function t0(a,t){let e=a[0],n=a.slice(-1)[0],r=U(n.position,e.position),i=n.time-e.time;return i<100||r<3?null:r/i}function fi(a){return a*60*60}function vn(a,t,e,n){let r=(e+90)%360*(Math.PI/180),i=t*n,o=new yn.Vector2(a[0],a[1]),s=Math.cos(r),u=Math.sin(r),l=new yn.Vector2(s,u);return o.add(l.normalize().multiplyScalar(i)),[o.x,o.y]}function e0(a){let t=[...a].sort((l,c)=>l-c),e=Ma(t,25),n=Ma(t,75),r=n-e,i=e-1.5*r,o=n+1.5*r,s=t.filter(l=>l>=i&&l<=o);return a.filter(l=>s.includes(l))}function Ma(a,t){let e=t/100*(a.length-1),n=Math.floor(e),r=Math.ceil(e);if(n===r)return a[n];let i=e-n;return a[n]*(1-i)+a[r]*i}var xr=require("lodash"),Er=class extends ct{setPathAngle(t){this.pathAngle=t,this.dispatchEvent({type:"change-compass",value:this.pathAngle}),(0,xr.isNil)(this.angle)&&(this.angle=t)}changeSpeed(){let t=this.history.filter(u=>["vision"].includes(u.type));if(t.length<2){this.speedFilter.filter(0),this.speed=0;return}let e=t[0],n=t.slice(-1)[0],r=U(n.position,e.position),i=n.time-e.time,o=i>0?r/i:0,s=this.speedFilter.filter(o);this.speed=s}changeAngle(t){t===void 0&&(t=this.visionHistory),t.length<2&&(this.angle=null);let e=vr(t.map(n=>n.position));e!==null&&this.setAngle(e)}setAngle(t,e){e===void 0&&(e=!0),this.angle=t,e&&this.dispatchEvent({type:"change-position-compass",value:t})}setPosition(t,e,n){let r={position:t,time:e,clientTime:Date.now()-n,type:"vision"};if(this._setVisionHistoryForAngle(r),(0,xr.isNil)(this.angle)||!this.speed){this.addHistory(r);return}let i=this.history.findLastIndex(s=>s.type==="vision"),o=this.history[i];if(o){if(o.time>e)return;let s=vr([this.history.slice(-1)[0].position,t]);if(s&&Math.abs(s-this.angle)<60){this.addHistory(r);return}let u=vn(t,this.speed,360-this.pathAngle,n);U(u,this.history.slice(-1)[0].position)>5?this.visionExcessesCount++:this.visionExcessesCount=0,this.visionExcessesCount>3&&(console.warn("\u8FDE\u7EED\u4E09\u6B21\u89C6\u89C9\u548Cpdr\u5DEE\u8DDD\u5927\u4E8E5\u7C73\uFF0C\u4F7F\u7528\u89C6\u89C9\u6821\u51C6"),this.addHistory(r),this.visionExcessesCount=0)}}resetPdrPosition(){let t=this.history.findLast(e=>e.type==="vision");if(t&&this.speed){let e=vn(t.position,this.speed,360-this.pathAngle,Date.now()-t.clientTime);e&&this.history.push({position:e,time:Date.now(),clientTime:Date.now(),type:"pdr"})}}getLastVisionPdrPos(){let t=this.history.findLastIndex(n=>n.type==="vision");if(t!==-1){var e;return(e=this.history[t+1])!=null?e:this.history[t]}return null}_setVisionHistoryForAngle(t){if(!this.visionHistory.length){this.visionHistory.push(t);return}let e=vr([this.visionHistory.slice(-1)[0].position,t.position]);if(e!==null&&(this.angle&&Math.abs(this.angle-e)>60?this.angleExcessesCount++:(this.angleExcessesCount=0,this.visionHistory.push(t))),this.angleExcessesCount>3)console.warn("\u8FDE\u7EED\u4E09\u6B21\u89D2\u5EA6\u6BD4\u8F83\u6B6A\uFF0C\u91CD\u65B0\u77EB\u6B63"),this.visionHistory=[t],this.angleExcessesCount=0;else{let n=U(this.visionHistory[0].position,this.visionHistory.slice(-1)[0].position);for(;n>5&&this.visionHistory.length>15;)this.visionHistory.shift(),n=U(this.visionHistory[0].position,this.visionHistory.slice(-1)[0].position)}this.changeAngle()}addHistory(t){this.history.push(t);let e=this.history.filter(s=>s.type==="vision"),n=e.length?Date.now()-e.slice(-1)[0].clientTime:0,r=U(this.history[0].position,this.history.slice(-1)[0].position),i=n>5e3?10:3,o=n>5e3?0:5;for(n>5e3&&console.warn("\u89C6\u89C9\u7ED3\u679C\u8D85\u51FA5s\u4E0D\u53EF\u7528\uFF0C\u5168\u90E8\u6E05\u7A7A");e.length>o&&r>i;)this.history.shift(),e=this.history.filter(s=>s.type==="vision"),r=U(this.history[0].position,this.history.slice(-1)[0].position);o===0?this.changeSpeed():t.type==="vision"&&this.changeSpeed(),this.changePosition(t.type)}setBeaconPosition(t,e,n){let r=Date.now()-n,i={position:t,time:e,clientTime:r,type:"beacon"},o=this.history.findLastIndex(c=>c.type!=="pdr"),s=this.history[o];if(!s){this.addHistory(i);return}if((0,xr.isNil)(this.pathAngle)||!this.speed){this.addHistory(i);return}if(s&&s.time>e)return;let u=vn(t,this.speed,360-this.pathAngle,n);U(u,this.history.slice(-1)[0].position)>5?this.beaconExcessesCount++:this.beaconExcessesCount=0,this.beaconExcessesCount>3&&(console.warn("\u8FDE\u7EED\u4E09\u6B21beacon\u548Cpdr\u5DEE\u8DDD\u5927\u4E8E5\u7C73\uFF0C\u4F7F\u7528beacon\u6821\u51C6"),this.addHistory(i),this.beaconExcessesCount=0)}startPositionTimer(){this.positionTimer&&this.timer.clearInterval(this.positionTimer),this.positionTimer=this.timer.setInterval(()=>{this.changePosition()},20)}stopPositionTimer(){this.positionTimer&&(this.timer.clearInterval(this.positionTimer),this.positionTimer=null)}changePosition(t){t===void 0&&(t="pdr");let e=this.getPosition(t);e.success&&(this.history.push({position:e.pos,time:Date.now(),clientTime:Date.now(),type:"pdr"}),this.speed?this.dispatchEvent({type:"change-pos",value:v({},e)}):this.dispatchEvent({type:"change-pos",value:e}))}getPosition(t){if(this.history.length===0)return{success:!1,pos:[0,0],compass:null,speed:0};let e=this.history.slice(-1)[0];if(this.history.length<2)return{success:!0,pos:e.position,compass:this.pathAngle,speed:this.speed};if((0,xr.isNil)(this.pathAngle)||!this.speed)return{success:!0,pos:e.position,compass:this.pathAngle,speed:this.speed};let n=e.clientTime,r=Date.now()-n;return{success:!0,pos:this.pathAngle?vn(e.position,this.speed,360-this.pathAngle,r):e.position,compass:this.pathAngle,speed:fi(this.speed)}}dispose(){this.timer.dispose()}constructor(){super(),this.history=[],this.visionHistory=[],this.speed=0,this.angle=null,this.timer=new $,this.positionTimer=null,this.speedFilter=new Dn,this.visionExcessesCount=0,this.beaconExcessesCount=0,this.angleExcessesCount=0,this.pathAngle=0,this.startPositionTimer()}};var J6=require("core-js/modules/es.json.stringify.js");function go(){let a=new Blob([`var PU=Object.create;var EE=Object.defineProperty;var IU=Object.getOwnPropertyDescriptor;var RU=Object.getOwnPropertyNames;var LU=Object.getPrototypeOf,NU=Object.prototype.hasOwnProperty;var st=(n,t)=>()=>(t||n((t={exports:{}}).exports,t),t.exports);var OU=(n,t,e,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of RU(t))!NU.call(n,s)&&s!==e&&EE(n,s,{get:()=>t[s],enumerable:!(o=IU(t,s))||o.enumerable});return n};var sn=(n,t,e)=>(e=n!=null?PU(LU(n)):{},OU(t||!n||!n.__esModule?EE(e,"default",{value:n,enumerable:!0}):e,n));var ac=(n,t,e)=>new Promise((o,s)=>{var l=g=>{try{h(e.next(g))}catch(m){s(m)}},p=g=>{try{h(e.throw(g))}catch(m){s(m)}},h=g=>g.done?o(g.value):Promise.resolve(g.value).then(l,p);h((e=e.apply(n,t)).next())});var so=st((Vm,wE)=>{"use strict";var zf=function(n){return n&&n.Math===Math&&n};wE.exports=zf(typeof globalThis=="object"&&globalThis)||zf(typeof window=="object"&&window)||zf(typeof self=="object"&&self)||zf(typeof global=="object"&&global)||zf(typeof Vm=="object"&&Vm)||function(){return this}()||Function("return this")()});var mi=st((oj,SE)=>{"use strict";SE.exports=function(n){try{return!!n()}catch(t){return!0}}});var Ys=st((sj,ME)=>{"use strict";var DU=mi();ME.exports=!DU(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!==7})});var Gf=st((aj,bE)=>{"use strict";var FU=mi();bE.exports=!FU(function(){var n=function(){}.bind();return typeof n!="function"||n.hasOwnProperty("prototype")})});var Ns=st((uj,AE)=>{"use strict";var UU=Gf(),gp=Function.prototype.call;AE.exports=UU?gp.bind(gp):function(){return gp.apply(gp,arguments)}});var IE=st(PE=>{"use strict";var TE={}.propertyIsEnumerable,CE=Object.getOwnPropertyDescriptor,BU=CE&&!TE.call({1:2},1);PE.f=BU?function(t){var e=CE(this,t);return!!e&&e.enumerable}:TE});var mp=st((cj,RE)=>{"use strict";RE.exports=function(n,t){return{enumerable:!(n&1),configurable:!(n&2),writable:!(n&4),value:t}}});var yi=st((fj,OE)=>{"use strict";var LE=Gf(),NE=Function.prototype,Wm=NE.call,zU=LE&&NE.bind.bind(Wm,Wm);OE.exports=LE?zU:function(n){return function(){return Wm.apply(n,arguments)}}});var uc=st((hj,FE)=>{"use strict";var DE=yi(),GU=DE({}.toString),kU=DE("".slice);FE.exports=function(n){return kU(GU(n),8,-1)}});var BE=st((pj,UE)=>{"use strict";var qU=yi(),HU=mi(),VU=uc(),Xm=Object,WU=qU("".split);UE.exports=HU(function(){return!Xm("z").propertyIsEnumerable(0)})?function(n){return VU(n)==="String"?WU(n,""):Xm(n)}:Xm});var Ym=st((dj,zE)=>{"use strict";zE.exports=function(n){return n==null}});var lc=st((gj,GE)=>{"use strict";var XU=Ym(),YU=TypeError;GE.exports=function(n){if(XU(n))throw new YU("Can't call method on "+n);return n}});var cc=st((mj,kE)=>{"use strict";var $U=BE(),ZU=lc();kE.exports=function(n){return $U(ZU(n))}});var Ui=st((yj,qE)=>{"use strict";var $m=typeof document=="object"&&document.all;qE.exports=typeof $m=="undefined"&&$m!==void 0?function(n){return typeof n=="function"||n===$m}:function(n){return typeof n=="function"}});var $s=st((vj,HE)=>{"use strict";var JU=Ui();HE.exports=function(n){return typeof n=="object"?n!==null:JU(n)}});var fc=st((_j,VE)=>{"use strict";var Zm=so(),KU=Ui(),jU=function(n){return KU(n)?n:void 0};VE.exports=function(n,t){return arguments.length<2?jU(Zm[n]):Zm[n]&&Zm[n][t]}});var XE=st((xj,WE)=>{"use strict";var QU=yi();WE.exports=QU({}.isPrototypeOf)});var JE=st((Ej,ZE)=>{"use strict";var tB=so(),YE=tB.navigator,$E=YE&&YE.userAgent;ZE.exports=$E?String($E):""});var rw=st((wj,nw)=>{"use strict";var ew=so(),Jm=JE(),KE=ew.process,jE=ew.Deno,QE=KE&&KE.versions||jE&&jE.version,tw=QE&&QE.v8,Zs,yp;tw&&(Zs=tw.split("."),yp=Zs[0]>0&&Zs[0]<4?1:+(Zs[0]+Zs[1]));!yp&&Jm&&(Zs=Jm.match(/Edge\\/(\\d+)/),(!Zs||Zs[1]>=74)&&(Zs=Jm.match(/Chrome\\/(\\d+)/),Zs&&(yp=+Zs[1])));nw.exports=yp});var Km=st((Sj,ow)=>{"use strict";var iw=rw(),eB=mi(),nB=so(),rB=nB.String;ow.exports=!!Object.getOwnPropertySymbols&&!eB(function(){var n=Symbol("symbol detection");return!rB(n)||!(Object(n)instanceof Symbol)||!Symbol.sham&&iw&&iw<41})});var jm=st((Mj,sw)=>{"use strict";var iB=Km();sw.exports=iB&&!Symbol.sham&&typeof Symbol.iterator=="symbol"});var Qm=st((bj,aw)=>{"use strict";var oB=fc(),sB=Ui(),aB=XE(),uB=jm(),lB=Object;aw.exports=uB?function(n){return typeof n=="symbol"}:function(n){var t=oB("Symbol");return sB(t)&&aB(t.prototype,lB(n))}});var lw=st((Aj,uw)=>{"use strict";var cB=String;uw.exports=function(n){try{return cB(n)}catch(t){return"Object"}}});var kf=st((Tj,cw)=>{"use strict";var fB=Ui(),hB=lw(),pB=TypeError;cw.exports=function(n){if(fB(n))return n;throw new pB(hB(n)+" is not a function")}});var vp=st((Cj,fw)=>{"use strict";var dB=kf(),gB=Ym();fw.exports=function(n,t){var e=n[t];return gB(e)?void 0:dB(e)}});var pw=st((Pj,hw)=>{"use strict";var t0=Ns(),e0=Ui(),n0=$s(),mB=TypeError;hw.exports=function(n,t){var e,o;if(t==="string"&&e0(e=n.toString)&&!n0(o=t0(e,n))||e0(e=n.valueOf)&&!n0(o=t0(e,n))||t!=="string"&&e0(e=n.toString)&&!n0(o=t0(e,n)))return o;throw new mB("Can't convert object to primitive value")}});var qf=st((Ij,dw)=>{"use strict";dw.exports=!1});var _p=st((Rj,mw)=>{"use strict";var gw=so(),yB=Object.defineProperty;mw.exports=function(n,t){try{yB(gw,n,{value:t,configurable:!0,writable:!0})}catch(e){gw[n]=t}return t}});var xp=st((Lj,_w)=>{"use strict";var vB=qf(),_B=so(),xB=_p(),yw="__core-js_shared__",vw=_w.exports=_B[yw]||xB(yw,{});(vw.versions||(vw.versions=[])).push({version:"3.42.0",mode:vB?"pure":"global",copyright:"\\xA9 2014-2025 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.42.0/LICENSE",source:"https://github.com/zloirock/core-js"})});var Ep=st((Nj,Ew)=>{"use strict";var xw=xp();Ew.exports=function(n,t){return xw[n]||(xw[n]=t||{})}});var hc=st((Oj,ww)=>{"use strict";var EB=lc(),wB=Object;ww.exports=function(n){return wB(EB(n))}});var ba=st((Dj,Sw)=>{"use strict";var SB=yi(),MB=hc(),bB=SB({}.hasOwnProperty);Sw.exports=Object.hasOwn||function(t,e){return bB(MB(t),e)}});var r0=st((Fj,Mw)=>{"use strict";var AB=yi(),TB=0,CB=Math.random(),PB=AB(1 .toString);Mw.exports=function(n){return"Symbol("+(n===void 0?"":n)+")_"+PB(++TB+CB,36)}});var Os=st((Uj,Aw)=>{"use strict";var IB=so(),RB=Ep(),bw=ba(),LB=r0(),NB=Km(),OB=jm(),pc=IB.Symbol,i0=RB("wks"),DB=OB?pc.for||pc:pc&&pc.withoutSetter||LB;Aw.exports=function(n){return bw(i0,n)||(i0[n]=NB&&bw(pc,n)?pc[n]:DB("Symbol."+n)),i0[n]}});var Iw=st((Bj,Pw)=>{"use strict";var FB=Ns(),Tw=$s(),Cw=Qm(),UB=vp(),BB=pw(),zB=Os(),GB=TypeError,kB=zB("toPrimitive");Pw.exports=function(n,t){if(!Tw(n)||Cw(n))return n;var e=UB(n,kB),o;if(e){if(t===void 0&&(t="default"),o=FB(e,n,t),!Tw(o)||Cw(o))return o;throw new GB("Can't convert object to primitive value")}return t===void 0&&(t="number"),BB(n,t)}});var o0=st((zj,Rw)=>{"use strict";var qB=Iw(),HB=Qm();Rw.exports=function(n){var t=qB(n,"string");return HB(t)?t:t+""}});var wp=st((Gj,Nw)=>{"use strict";var VB=so(),Lw=$s(),s0=VB.document,WB=Lw(s0)&&Lw(s0.createElement);Nw.exports=function(n){return WB?s0.createElement(n):{}}});var a0=st((kj,Ow)=>{"use strict";var XB=Ys(),YB=mi(),$B=wp();Ow.exports=!XB&&!YB(function(){return Object.defineProperty($B("div"),"a",{get:function(){return 7}}).a!==7})});var u0=st(Fw=>{"use strict";var ZB=Ys(),JB=Ns(),KB=IE(),jB=mp(),QB=cc(),tz=o0(),ez=ba(),nz=a0(),Dw=Object.getOwnPropertyDescriptor;Fw.f=ZB?Dw:function(t,e){if(t=QB(t),e=tz(e),nz)try{return Dw(t,e)}catch(o){}if(ez(t,e))return jB(!JB(KB.f,t,e),t[e])}});var l0=st((Hj,Uw)=>{"use strict";var rz=Ys(),iz=mi();Uw.exports=rz&&iz(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!==42})});var Aa=st((Vj,Bw)=>{"use strict";var oz=$s(),sz=String,az=TypeError;Bw.exports=function(n){if(oz(n))return n;throw new az(sz(n)+" is not an object")}});var Ru=st(Gw=>{"use strict";var uz=Ys(),lz=a0(),cz=l0(),Sp=Aa(),zw=o0(),fz=TypeError,c0=Object.defineProperty,hz=Object.getOwnPropertyDescriptor,f0="enumerable",h0="configurable",p0="writable";Gw.f=uz?cz?function(t,e,o){if(Sp(t),e=zw(e),Sp(o),typeof t=="function"&&e==="prototype"&&"value"in o&&p0 in o&&!o[p0]){var s=hz(t,e);s&&s[p0]&&(t[e]=o.value,o={configurable:h0 in o?o[h0]:s[h0],enumerable:f0 in o?o[f0]:s[f0],writable:!1})}return c0(t,e,o)}:c0:function(t,e,o){if(Sp(t),e=zw(e),Sp(o),lz)try{return c0(t,e,o)}catch(s){}if("get"in o||"set"in o)throw new fz("Accessors not supported");return"value"in o&&(t[e]=o.value),t}});var dc=st((Xj,kw)=>{"use strict";var pz=Ys(),dz=Ru(),gz=mp();kw.exports=pz?function(n,t,e){return dz.f(n,t,gz(1,e))}:function(n,t,e){return n[t]=e,n}});var m0=st((Yj,Hw)=>{"use strict";var d0=Ys(),mz=ba(),qw=Function.prototype,yz=d0&&Object.getOwnPropertyDescriptor,g0=mz(qw,"name"),vz=g0&&function(){}.name==="something",_z=g0&&(!d0||d0&&yz(qw,"name").configurable);Hw.exports={EXISTS:g0,PROPER:vz,CONFIGURABLE:_z}});var v0=st(($j,Vw)=>{"use strict";var xz=yi(),Ez=Ui(),y0=xp(),wz=xz(Function.toString);Ez(y0.inspectSource)||(y0.inspectSource=function(n){return wz(n)});Vw.exports=y0.inspectSource});var Yw=st((Zj,Xw)=>{"use strict";var Sz=so(),Mz=Ui(),Ww=Sz.WeakMap;Xw.exports=Mz(Ww)&&/native code/.test(String(Ww))});var Mp=st((Jj,Zw)=>{"use strict";var bz=Ep(),Az=r0(),$w=bz("keys");Zw.exports=function(n){return $w[n]||($w[n]=Az(n))}});var bp=st((Kj,Jw)=>{"use strict";Jw.exports={}});var Cp=st((jj,Qw)=>{"use strict";var Tz=Yw(),jw=so(),Cz=$s(),Pz=dc(),_0=ba(),x0=xp(),Iz=Mp(),Rz=bp(),Kw="Object already initialized",E0=jw.TypeError,Lz=jw.WeakMap,Ap,Hf,Tp,Nz=function(n){return Tp(n)?Hf(n):Ap(n,{})},Oz=function(n){return function(t){var e;if(!Cz(t)||(e=Hf(t)).type!==n)throw new E0("Incompatible receiver, "+n+" required");return e}};Tz||x0.state?(Js=x0.state||(x0.state=new Lz),Js.get=Js.get,Js.has=Js.has,Js.set=Js.set,Ap=function(n,t){if(Js.has(n))throw new E0(Kw);return t.facade=n,Js.set(n,t),t},Hf=function(n){return Js.get(n)||{}},Tp=function(n){return Js.has(n)}):(El=Iz("state"),Rz[El]=!0,Ap=function(n,t){if(_0(n,El))throw new E0(Kw);return t.facade=n,Pz(n,El,t),t},Hf=function(n){return _0(n,El)?n[El]:{}},Tp=function(n){return _0(n,El)});var Js,El;Qw.exports={set:Ap,get:Hf,has:Tp,enforce:Nz,getterFor:Oz}});var rS=st((Qj,nS)=>{"use strict";var S0=yi(),Dz=mi(),Fz=Ui(),Pp=ba(),w0=Ys(),Uz=m0().CONFIGURABLE,Bz=v0(),eS=Cp(),zz=eS.enforce,Gz=eS.get,tS=String,Ip=Object.defineProperty,kz=S0("".slice),qz=S0("".replace),Hz=S0([].join),Vz=w0&&!Dz(function(){return Ip(function(){},"length",{value:8}).length!==8}),Wz=String(String).split("String"),Xz=nS.exports=function(n,t,e){kz(tS(t),0,7)==="Symbol("&&(t="["+qz(tS(t),/^Symbol\\(([^)]*)\\).*$/,"$1")+"]"),e&&e.getter&&(t="get "+t),e&&e.setter&&(t="set "+t),(!Pp(n,"name")||Uz&&n.name!==t)&&(w0?Ip(n,"name",{value:t,configurable:!0}):n.name=t),Vz&&e&&Pp(e,"arity")&&n.length!==e.arity&&Ip(n,"length",{value:e.arity});try{e&&Pp(e,"constructor")&&e.constructor?w0&&Ip(n,"prototype",{writable:!1}):n.prototype&&(n.prototype=void 0)}catch(s){}var o=zz(n);return Pp(o,"source")||(o.source=Hz(Wz,typeof t=="string"?t:"")),n};Function.prototype.toString=Xz(function(){return Fz(this)&&Gz(this).source||Bz(this)},"toString")});var Vf=st((tQ,iS)=>{"use strict";var Yz=Ui(),$z=Ru(),Zz=rS(),Jz=_p();iS.exports=function(n,t,e,o){o||(o={});var s=o.enumerable,l=o.name!==void 0?o.name:t;if(Yz(e)&&Zz(e,l,o),o.global)s?n[t]=e:Jz(t,e);else{try{o.unsafe?n[t]&&(s=!0):delete n[t]}catch(p){}s?n[t]=e:$z.f(n,t,{value:e,enumerable:!1,configurable:!o.nonConfigurable,writable:!o.nonWritable})}return n}});var sS=st((eQ,oS)=>{"use strict";var Kz=Math.ceil,jz=Math.floor;oS.exports=Math.trunc||function(t){var e=+t;return(e>0?jz:Kz)(e)}});var wl=st((nQ,aS)=>{"use strict";var Qz=sS();aS.exports=function(n){var t=+n;return t!==t||t===0?0:Qz(t)}});var lS=st((rQ,uS)=>{"use strict";var tG=wl(),eG=Math.max,nG=Math.min;uS.exports=function(n,t){var e=tG(n);return e<0?eG(e+t,0):nG(e,t)}});var M0=st((iQ,cS)=>{"use strict";var rG=wl(),iG=Math.min;cS.exports=function(n){var t=rG(n);return t>0?iG(t,9007199254740991):0}});var Wf=st((oQ,fS)=>{"use strict";var oG=M0();fS.exports=function(n){return oG(n.length)}});var dS=st((sQ,pS)=>{"use strict";var sG=cc(),aG=lS(),uG=Wf(),hS=function(n){return function(t,e,o){var s=sG(t),l=uG(s);if(l===0)return!n&&-1;var p=aG(o,l),h;if(n&&e!==e){for(;l>p;)if(h=s[p++],h!==h)return!0}else for(;l>p;p++)if((n||p in s)&&s[p]===e)return n||p||0;return!n&&-1}};pS.exports={includes:hS(!0),indexOf:hS(!1)}});var A0=st((aQ,mS)=>{"use strict";var lG=yi(),b0=ba(),cG=cc(),fG=dS().indexOf,hG=bp(),gS=lG([].push);mS.exports=function(n,t){var e=cG(n),o=0,s=[],l;for(l in e)!b0(hG,l)&&b0(e,l)&&gS(s,l);for(;t.length>o;)b0(e,l=t[o++])&&(~fG(s,l)||gS(s,l));return s}});var Rp=st((uQ,yS)=>{"use strict";yS.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]});var _S=st(vS=>{"use strict";var pG=A0(),dG=Rp(),gG=dG.concat("length","prototype");vS.f=Object.getOwnPropertyNames||function(t){return pG(t,gG)}});var ES=st(xS=>{"use strict";xS.f=Object.getOwnPropertySymbols});var SS=st((fQ,wS)=>{"use strict";var mG=fc(),yG=yi(),vG=_S(),_G=ES(),xG=Aa(),EG=yG([].concat);wS.exports=mG("Reflect","ownKeys")||function(t){var e=vG.f(xG(t)),o=_G.f;return o?EG(e,o(t)):e}});var AS=st((hQ,bS)=>{"use strict";var MS=ba(),wG=SS(),SG=u0(),MG=Ru();bS.exports=function(n,t,e){for(var o=wG(t),s=MG.f,l=SG.f,p=0;p<o.length;p++){var h=o[p];!MS(n,h)&&!(e&&MS(e,h))&&s(n,h,l(t,h))}}});var CS=st((pQ,TS)=>{"use strict";var bG=mi(),AG=Ui(),TG=/#|\\.prototype\\./,Xf=function(n,t){var e=PG[CG(n)];return e===RG?!0:e===IG?!1:AG(t)?bG(t):!!t},CG=Xf.normalize=function(n){return String(n).replace(TG,".").toLowerCase()},PG=Xf.data={},IG=Xf.NATIVE="N",RG=Xf.POLYFILL="P";TS.exports=Xf});var Ds=st((dQ,PS)=>{"use strict";var Lp=so(),LG=u0().f,NG=dc(),OG=Vf(),DG=_p(),FG=AS(),UG=CS();PS.exports=function(n,t){var e=n.target,o=n.global,s=n.stat,l,p,h,g,m,v;if(o?p=Lp:s?p=Lp[e]||DG(e,{}):p=Lp[e]&&Lp[e].prototype,p)for(h in t){if(m=t[h],n.dontCallGetSet?(v=LG(p,h),g=v&&v.value):g=p[h],l=UG(o?h:e+(s?".":"#")+h,n.forced),!l&&g!==void 0){if(typeof m==typeof g)continue;FG(m,g)}(n.sham||g&&g.sham)&&NG(m,"sham",!0),OG(p,h,m,n)}}});var Np=st((gQ,IS)=>{"use strict";var BG=uc();IS.exports=Array.isArray||function(t){return BG(t)==="Array"}});var LS=st((mQ,RS)=>{"use strict";var zG=Ys(),GG=Np(),kG=TypeError,qG=Object.getOwnPropertyDescriptor,HG=zG&&!function(){if(this!==void 0)return!0;try{Object.defineProperty([],"length",{writable:!1}).length=1}catch(n){return n instanceof TypeError}}();RS.exports=HG?function(n,t){if(GG(n)&&!qG(n,"length").writable)throw new kG("Cannot set read only .length");return n.length=t}:function(n,t){return n.length=t}});var T0=st((yQ,NS)=>{"use strict";var VG=TypeError,WG=9007199254740991;NS.exports=function(n){if(n>WG)throw VG("Maximum allowed index exceeded");return n}});var C0=st(()=>{"use strict";var XG=Ds(),YG=hc(),$G=Wf(),ZG=LS(),JG=T0(),KG=mi(),jG=KG(function(){return[].push.call({length:4294967296},1)!==4294967297}),QG=function(){try{Object.defineProperty([],"length",{writable:!1}).push()}catch(n){return n instanceof TypeError}},t4=jG||!QG();XG({target:"Array",proto:!0,arity:1,forced:t4},{push:function(t){var e=YG(this),o=$G(e),s=arguments.length;JG(o+s);for(var l=0;l<s;l++)e[o]=arguments[l],o++;return ZG(e,o),o}})});var DS=st((EQ,OS)=>{"use strict";OS.exports={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0}});var BS=st((wQ,US)=>{"use strict";var e4=wp(),P0=e4("span").classList,FS=P0&&P0.constructor&&P0.constructor.prototype;US.exports=FS===Object.prototype?void 0:FS});var GS=st((SQ,zS)=>{"use strict";var n4=A0(),r4=Rp();zS.exports=Object.keys||function(t){return n4(t,r4)}});var qS=st(kS=>{"use strict";var i4=Ys(),o4=l0(),s4=Ru(),a4=Aa(),u4=cc(),l4=GS();kS.f=i4&&!o4?Object.defineProperties:function(t,e){a4(t);for(var o=u4(e),s=l4(e),l=s.length,p=0,h;l>p;)s4.f(t,h=s[p++],o[h]);return t}});var VS=st((bQ,HS)=>{"use strict";var c4=fc();HS.exports=c4("document","documentElement")});var Yf=st((AQ,KS)=>{"use strict";var f4=Aa(),h4=qS(),WS=Rp(),p4=bp(),d4=VS(),g4=wp(),m4=Mp(),XS=">",YS="<",R0="prototype",L0="script",ZS=m4("IE_PROTO"),I0=function(){},JS=function(n){return YS+L0+XS+n+YS+"/"+L0+XS},$S=function(n){n.write(JS("")),n.close();var t=n.parentWindow.Object;return n=null,t},y4=function(){var n=g4("iframe"),t="java"+L0+":",e;return n.style.display="none",d4.appendChild(n),n.src=String(t),e=n.contentWindow.document,e.open(),e.write(JS("document.F=Object")),e.close(),e.F},Op,Dp=function(){try{Op=new ActiveXObject("htmlfile")}catch(t){}Dp=typeof document!="undefined"?document.domain&&Op?$S(Op):y4():$S(Op);for(var n=WS.length;n--;)delete Dp[R0][WS[n]];return Dp()};p4[ZS]=!0;KS.exports=Object.create||function(t,e){var o;return t!==null?(I0[R0]=f4(t),o=new I0,I0[R0]=null,o[ZS]=t):o=Dp(),e===void 0?o:h4.f(o,e)}});var D0=st((TQ,jS)=>{"use strict";var v4=Os(),_4=Yf(),x4=Ru().f,N0=v4("unscopables"),O0=Array.prototype;O0[N0]===void 0&&x4(O0,N0,{configurable:!0,value:_4(null)});jS.exports=function(n){O0[N0][n]=!0}});var Fp=st((CQ,QS)=>{"use strict";QS.exports={}});var eM=st((PQ,tM)=>{"use strict";var E4=mi();tM.exports=!E4(function(){function n(){}return n.prototype.constructor=null,Object.getPrototypeOf(new n)!==n.prototype})});var U0=st((IQ,rM)=>{"use strict";var w4=ba(),S4=Ui(),M4=hc(),b4=Mp(),A4=eM(),nM=b4("IE_PROTO"),F0=Object,T4=F0.prototype;rM.exports=A4?F0.getPrototypeOf:function(n){var t=M4(n);if(w4(t,nM))return t[nM];var e=t.constructor;return S4(e)&&t instanceof e?e.prototype:t instanceof F0?T4:null}});var k0=st((RQ,sM)=>{"use strict";var C4=mi(),P4=Ui(),I4=$s(),R4=Yf(),iM=U0(),L4=Vf(),N4=Os(),O4=qf(),G0=N4("iterator"),oM=!1,nu,B0,z0;[].keys&&(z0=[].keys(),"next"in z0?(B0=iM(iM(z0)),B0!==Object.prototype&&(nu=B0)):oM=!0);var D4=!I4(nu)||C4(function(){var n={};return nu[G0].call(n)!==n});D4?nu={}:O4&&(nu=R4(nu));P4(nu[G0])||L4(nu,G0,function(){return this});sM.exports={IteratorPrototype:nu,BUGGY_SAFARI_ITERATORS:oM}});var Up=st((LQ,uM)=>{"use strict";var F4=Ru().f,U4=ba(),B4=Os(),aM=B4("toStringTag");uM.exports=function(n,t,e){n&&!e&&(n=n.prototype),n&&!U4(n,aM)&&F4(n,aM,{configurable:!0,value:t})}});var cM=st((NQ,lM)=>{"use strict";var z4=k0().IteratorPrototype,G4=Yf(),k4=mp(),q4=Up(),H4=Fp(),V4=function(){return this};lM.exports=function(n,t,e,o){var s=t+" Iterator";return n.prototype=G4(z4,{next:k4(+!o,e)}),q4(n,s,!1,!0),H4[s]=V4,n}});var q0=st((OQ,fM)=>{"use strict";var W4=yi(),X4=kf();fM.exports=function(n,t,e){try{return W4(X4(Object.getOwnPropertyDescriptor(n,t)[e]))}catch(o){}}});var pM=st((DQ,hM)=>{"use strict";var Y4=$s();hM.exports=function(n){return Y4(n)||n===null}});var gM=st((FQ,dM)=>{"use strict";var $4=pM(),Z4=String,J4=TypeError;dM.exports=function(n){if($4(n))return n;throw new J4("Can't set "+Z4(n)+" as a prototype")}});var yM=st((UQ,mM)=>{"use strict";var K4=q0(),j4=$s(),Q4=lc(),tk=gM();mM.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var n=!1,t={},e;try{e=K4(Object.prototype,"__proto__","set"),e(t,[]),n=t instanceof Array}catch(o){}return function(s,l){return Q4(s),tk(l),j4(s)&&(n?e(s,l):s.__proto__=l),s}}():void 0)});var CM=st((BQ,TM)=>{"use strict";var ek=Ds(),nk=Ns(),Bp=qf(),bM=m0(),rk=Ui(),ik=cM(),vM=U0(),_M=yM(),ok=Up(),sk=dc(),H0=Vf(),ak=Os(),xM=Fp(),AM=k0(),uk=bM.PROPER,lk=bM.CONFIGURABLE,EM=AM.IteratorPrototype,zp=AM.BUGGY_SAFARI_ITERATORS,$f=ak("iterator"),wM="keys",Zf="values",SM="entries",MM=function(){return this};TM.exports=function(n,t,e,o,s,l,p){ik(e,t,o);var h=function(w){if(w===s&&E)return E;if(!zp&&w&&w in v)return v[w];switch(w){case wM:return function(){return new e(this,w)};case Zf:return function(){return new e(this,w)};case SM:return function(){return new e(this,w)}}return function(){return new e(this)}},g=t+" Iterator",m=!1,v=n.prototype,x=v[$f]||v["@@iterator"]||s&&v[s],E=!zp&&x||h(s),M=t==="Array"&&v.entries||x,A,I,S;if(M&&(A=vM(M.call(new n)),A!==Object.prototype&&A.next&&(!Bp&&vM(A)!==EM&&(_M?_M(A,EM):rk(A[$f])||H0(A,$f,MM)),ok(A,g,!0,!0),Bp&&(xM[g]=MM))),uk&&s===Zf&&x&&x.name!==Zf&&(!Bp&&lk?sk(v,"name",Zf):(m=!0,E=function(){return nk(x,this)})),s)if(I={values:h(Zf),keys:l?E:h(wM),entries:h(SM)},p)for(S in I)(zp||m||!(S in v))&&H0(v,S,I[S]);else ek({target:t,proto:!0,forced:zp||m},I);return(!Bp||p)&&v[$f]!==E&&H0(v,$f,E,{name:s}),xM[t]=E,I}});var IM=st((zQ,PM)=>{"use strict";PM.exports=function(n,t){return{value:n,done:t}}});var FM=st((GQ,DM)=>{"use strict";var ck=cc(),V0=D0(),RM=Fp(),NM=Cp(),fk=Ru().f,hk=CM(),Gp=IM(),pk=qf(),dk=Ys(),OM="Array Iterator",gk=NM.set,mk=NM.getterFor(OM);DM.exports=hk(Array,"Array",function(n,t){gk(this,{type:OM,target:ck(n),index:0,kind:t})},function(){var n=mk(this),t=n.target,e=n.index++;if(!t||e>=t.length)return n.target=null,Gp(void 0,!0);switch(n.kind){case"keys":return Gp(e,!1);case"values":return Gp(t[e],!1)}return Gp([e,t[e]],!1)},"values");var LM=RM.Arguments=RM.Array;V0("keys");V0("values");V0("entries");if(!pk&&dk&&LM.name!=="values")try{fk(LM,"name",{value:"values"})}catch(n){}});var Y0=st(()=>{"use strict";var UM=so(),zM=DS(),yk=BS(),Jf=FM(),BM=dc(),vk=Up(),_k=Os(),W0=_k("iterator"),X0=Jf.values,GM=function(n,t){if(n){if(n[W0]!==X0)try{BM(n,W0,X0)}catch(o){n[W0]=X0}if(vk(n,t,!0),zM[t]){for(var e in Jf)if(n[e]!==Jf[e])try{BM(n,e,Jf[e])}catch(o){n[e]=Jf[e]}}}};for(kp in zM)GM(UM[kp]&&UM[kp].prototype,kp);var kp;GM(yk,"DOMTokenList")});var HM=st((HQ,qM)=>{"use strict";var xk=Os(),Ek=xk("toStringTag"),kM={};kM[Ek]="z";qM.exports=String(kM)==="[object z]"});var $0=st((VQ,VM)=>{"use strict";var wk=HM(),Sk=Ui(),qp=uc(),Mk=Os(),bk=Mk("toStringTag"),Ak=Object,Tk=qp(function(){return arguments}())==="Arguments",Ck=function(n,t){try{return n[t]}catch(e){}};VM.exports=wk?qp:function(n){var t,e,o;return n===void 0?"Undefined":n===null?"Null":typeof(e=Ck(t=Ak(n),bk))=="string"?e:Tk?qp(t):(o=qp(t))==="Object"&&Sk(t.callee)?"Arguments":o}});var Hp=st((WQ,WM)=>{"use strict";var Pk=$0(),Ik=String;WM.exports=function(n){if(Pk(n)==="Symbol")throw new TypeError("Cannot convert a Symbol value to a string");return Ik(n)}});var YM=st((XQ,XM)=>{"use strict";var Rk=Aa();XM.exports=function(){var n=Rk(this),t="";return n.hasIndices&&(t+="d"),n.global&&(t+="g"),n.ignoreCase&&(t+="i"),n.multiline&&(t+="m"),n.dotAll&&(t+="s"),n.unicode&&(t+="u"),n.unicodeSets&&(t+="v"),n.sticky&&(t+="y"),t}});var ZM=st((YQ,$M)=>{"use strict";var Z0=mi(),Lk=so(),J0=Lk.RegExp,K0=Z0(function(){var n=J0("a","y");return n.lastIndex=2,n.exec("abcd")!==null}),Nk=K0||Z0(function(){return!J0("a","y").sticky}),Ok=K0||Z0(function(){var n=J0("^r","gy");return n.lastIndex=2,n.exec("str")!==null});$M.exports={BROKEN_CARET:Ok,MISSED_STICKY:Nk,UNSUPPORTED_Y:K0}});var KM=st(($Q,JM)=>{"use strict";var Dk=mi(),Fk=so(),Uk=Fk.RegExp;JM.exports=Dk(function(){var n=Uk(".","s");return!(n.dotAll&&n.test(\`
|
|
19754
|
+
`};var ui=class extends xt.ShaderMaterial{constructor(t){super({type:"ArrowLineMaterial",uniforms:Object.assign({},xt.UniformsUtils.clone(xt.ShaderLib["custom-line"].uniforms),{map:{value:null}}),vertexShader:xt.ShaderLib["custom-line"].vertexShader,fragmentShader:xt.ShaderLib["custom-line"].fragmentShader,clipping:!0}),this.dashed=!1,Object.defineProperties(this,{map:{enumerable:!0,get:function(){return this.uniforms.map.value},set:function(e){this.uniforms.map.value=e}},color:{enumerable:!0,get:function(){return this.uniforms.diffuse.value},set:function(e){this.uniforms.diffuse.value=e}},linewidth:{enumerable:!0,get:function(){return this.uniforms.linewidth.value},set:function(e){this.uniforms.linewidth.value=e}},dashScale:{enumerable:!0,get:function(){return this.uniforms.dashScale.value},set:function(e){this.uniforms.dashScale.value=e}},dashSize:{enumerable:!0,get:function(){return this.uniforms.dashSize.value},set:function(e){this.uniforms.dashSize.value=e}},gapSize:{enumerable:!0,get:function(){return this.uniforms.gapSize.value},set:function(e){this.uniforms.gapSize.value=e}},resolution:{enumerable:!0,get:function(){return this.uniforms.resolution.value},set:function(e){this.uniforms.resolution.value.copy(e)}},repeat:{enumerable:!0,get:function(){return this.uniforms.repeat.value},set:function(e){this.uniforms.repeat.value.copy(e)}},allDistance:{enumerable:!0,get:function(){return this.uniforms.allDistance.value},set:function(e){this.uniforms.allDistance.value=e}}}),this.setValues(t),this.isLineMaterial=!0}};var Ea=require("three/examples/jsm/lines/LineGeometry.js"),ba=require("three/examples/jsm/lines/Line2.js");var xa={texture_url:Or,lineWidth:8,color:16777215},li=class extends Et.Object3D{registryEvent(){this.navigation.bmap.context.addEventListener("control-change",this.onControlChange),this.navigation.bmap.context.addEventListener("update",this.onUpdate),this.navigation.bmap.context.addEventListener("resize",this.onResize)}unRegistryEvent(){this.navigation.bmap.context.removeEventListener("control-change",this.onControlChange),this.navigation.bmap.context.removeEventListener("update",this.onUpdate),this.navigation.bmap.context.removeEventListener("resize",this.onResize)}getRepeat(){let{points:t,navigation:{bmap:{context:{camera:e,clientSize:{width:n,height:r}}}}}=this,i=t.map(s=>{let[u,l,c]=s;return N(new Et.Vector3(u,l,c),e,n,r)}).map(s=>{let{x:u,y:l}=s;return[u,l]});return Rt(i)/32}changeRepeat(){if(!this.material)return;let t=this.getRepeat();this.material.repeat=new Et.Vector2(t,1)}loadTexture(t){return new Promise((e,n)=>{new Et.TextureLoader().load(t,e,void 0,n)})}transformPoints(t){let e=[];for(let n=0;n<t.length;n++)e.push(...t[n]);return e}updatePoints(t){if(this.points=t,this.mesh){var e,n;this.remove(this.mesh),(e=this.material)==null||e.dispose(),(n=this.geometry)==null||n.dispose()}this.geometry=new Ea.LineGeometry,this.geometry.setPositions(t.flat(2));let r=Rt(t.map(s=>{let[u,l]=s;return[u,l]})),i=this.material=new ui({color:new Et.Color(this.config.color),transparent:!0,resolution:new Et.Vector2(this.navigation.bmap.context.clientSize.width,this.navigation.bmap.context.clientSize.height),depthTest:!0,depthWrite:!0,linewidth:this.config.lineWidth,map:this.texture,blending:Et.NormalBlending,repeat:new Et.Vector2(this.getRepeat(),1),allDistance:r}),o=this.mesh=new ba.Line2(this.geometry,i);return o.computeLineDistances(),o.renderOrder=9,this.add(o),o}movePath(t){this.material&&(this.material.thresholdRatio=t)}create(t){return g(this,null,function*(){if(!this.texture){let e=this.texture=yield this.loadTexture(this.config.texture_url);e.wrapS=e.wrapT=Et.RepeatWrapping}return this.updatePoints(t)})}getBoundingBox(){return this.mesh?(this.mesh.geometry.computeBoundingBox(),new Et.Box3().copy(this.mesh.geometry.boundingBox).applyMatrix4(this.mesh.matrixWorld)):null}dispose(){var t,e,n;this.unRegistryEvent(),this.clear(),(t=this.geometry)==null||t.dispose(),(e=this.material)==null||e.dispose(),(n=this.texture)==null||n.dispose(),this.navigation=null}constructor(t,e){super(),this.navigation=t,this.mesh=null,this.geometry=null,this.material=null,this.texture=null,this.config=xa,this.points=[],this.basicRepeat=1,this.prevCameraZoom=0,this.onControlChange=()=>{let n=this.navigation.bmap.context.camera.zoom;n!==this.prevCameraZoom&&(this.prevCameraZoom=n,this.changeRepeat())},this.onUpdate=()=>{this.texture},this.onResize=()=>{if(this.material){let{width:n,height:r}=this.navigation.bmap.context.clientSize;this.material.resolution.set(n,r)}},this.config=Object.assign({},xa,e),this.registryEvent(),this.prevCameraZoom=this.navigation.bmap.context.camera.zoom}};var Sa=require("@tweenjs/tween.js");var jt=require("three"),ci=class extends jt.Object3D{meshSetMaterial(t){t instanceof jt.Mesh&&(t.material.emissiveIntensity=.5,t.material.shininess=0,t.material.emissive=t.material.color,t.material.emissiveMap=t.material.map,t.material.transparent=!0,t.material.depthTest=!1,t.renderOrder=1e6),t.children.forEach(n=>{this.meshSetMaterial(n)})}getBaseScale(t){let{clientSize:{height:e},camera:n}=this.bmap.context,i=(n.top-n.bottom)/n.zoom/e;return this.options.size*i/this.modelMaxLength}registryEvent(){this.bmap.context.addEventListener("update",this._update),this.bmap.context.addEventListener("control-zoom-change",this._onChangeZoom)}unRegistryEvent(){this.bmap.context.removeEventListener("update",this._update),this.bmap.context.removeEventListener("control-zoom-change",this._onChangeZoom)}lookAtCamera(){if(this.model&&this.bmap&&this.bmap.context){let t=this.bmap.context.camera,e=new jt.Euler;e.setFromQuaternion(t.quaternion,"ZYX"),this.group.rotation.copy(e)}}setClips(t){this.clearClips(),t.length&&(this.mixer=new jt.AnimationMixer(this.model.scene),t.forEach(e=>this.mixer.clipAction(e).play()))}startClips(){var t;this.setClips(((t=this.model)==null?void 0:t.animations)||[])}clearClips(){this.mixer&&(this.mixer.stopAllAction(),this.mixer.uncacheRoot(this.mixer.getRoot()),this.mixer=null)}dispose(){this.unRegistryEvent(),this.clearClips(),this.clear(),this.model&&F(this.model.scene),this.bmap=null}constructor(t,e,n={}){super(),this.bmap=t,this.group=new jt.Object3D,this.mixer=null,this.previewTime=0,this.modelMaxLength=0,this.options={size:40},this._update=()=>{let r=Date.now();if(!this.previewTime)this.previewTime=r;else{var i;let o=r-this.previewTime;this.previewTime=r,(i=this.mixer)==null||i.update(o/1e3)}this.lookAtCamera()},this._onChangeZoom=r=>{let{zoom:i}=r;var o;if(!this.model)return;let s=this.getBaseScale(this.model.scene);(o=this.model)==null||o.scene.scale.set(s,s,s)},this.options=v({},this.options,n),this.add(this.group),It.loadModel(e,!1).then(r=>{this.model=r;let o=new jt.Box3().setFromObject(r.scene).getSize(new jt.Vector3),s=Math.max(o.x,o.y,o.z);this.modelMaxLength=s;let u=this.getBaseScale(r.scene);r.scene.scale.set(u,u,u),this.meshSetMaterial(r.scene),this.group.add(r.scene),this.setClips(r.animations),this.group.rotation.set(Math.PI/2,Math.PI,0),this.dispatchEvent({type:"loaded"})}),this.registryEvent()}};var hi=require("three");var po=class extends at{registryEvent(){this.bmap.context.addEventListener("update",this.onUpdate)}pauseAnimation(){this.tweenUtil.pause()}continueAnimation(){this.tweenUtil.continue()}clearTween(){this.tweenUtil.clear(),this.bmap.context.control.enabled=!0}unRegistryEvent(){this.bmap.context.removeEventListener("update",this.onUpdate)}clearPath(){this.path&&(this.bmap.context.scene.remove(this.path),this.path.dispose(),this.path=null,this.movedDistance=0,this.clearTween()),this.startModel&&(this.startModel.visible=!1),this.translatePath=null}addPath(t){this.paths=t;let e=t.map(n=>v({},n,{points:this.translatePoints(n.points)}));if(this.clearTween(),this.movedDistance=0,this.bmap.currentBuildGround)this.renderPath(e);else{let n=()=>{this.bmap.removeEventListener("center-change",n),this.renderPath(e)};this.bmap.addEventListener("center-change",n)}this.dispatchEvent({type:"add-path",paths:t})}translatePoints(t){let[e,n]=this.bmap.buildingCenter;return t.map(r=>[r[0]-e,r[1]-n])}renderPath(t){return g(this,null,function*(){if(!t.length)return this.clearPath();let e=[];t.forEach((n,r,i)=>{let o=this.mulFloor.floors.find(s=>s.name===n.floor);e.push(...n.points.map(s=>{let[u,l]=s;return[u,l,o.position.z+o.groundMaxHeight]}))}),this.cPath=e,this.animationPathOptions={cPathIndex:0},this.path?this.path.updatePoints(e):(this.path=new li(this),yield this.path.create(e),this.path.position.z=.5,this.bmap.context.scene.add(this.path)),this.startModel&&(this.startModel.position.set(e[0][0],e[0][1],e[0][2]),this.startModel.visible=!0),this.dispatchEvent({type:"render-path",path:this.path})})}catmullRomCurve3(t){return Pn(t,!1,!0,.1,170,2.5)}getPathDirection(t,e){if(t.length<2)return null;let n=ue(t,e),r=t[n],i=t[n+1],o=new hi.Vector3(i[0]-r[0],i[1]-r[1],0).normalize(),s=new hi.Vector3(0,1,0).normalize(),u=o.angleTo(s),l=new hi.Vector3().crossVectors(s,o);return(Object.is(l.y,0)?-1:1)*u}startSimulation(t){return g(this,null,function*(){t===void 0&&(t=1);let{paths:e,movedDistance:n}=this;if(!e.length)return;let r=e.reduce((o,s)=>o+s.distance,0);if(!r||n>=r)return;this.simulationTween&&this.tweenUtil.remove(this.simulationTween);let i=r/t;return this.startModel.startClips(),new Promise(o=>{let s=this.simulationTween=new Sa.Tween({distance:this.movedDistance},this.tweenUtil.group).to({distance:r},i*1e3).onUpdate(u=>{var l;this.movedDistance=u.distance;let c=u.distance,h=0;for(let _=0;_<e.length;_++)if(e[_].distance>=c){h=_;break}else c-=e[_].distance;let p=qe(e[h].points,c);if(p===null)return;this.currentPathPosition=p;let f=this.translatePoints([p])[0],d=this.mulFloor.floors.find(_=>_.name===e[h].floor),m=d?d.position.z+d.groundMaxHeight:(l=this.startModel)==null?void 0:l.position.z;this.startModel&&this.startModel.position.set(f[0],f[1],m)}).onComplete(()=>{if(this.tweenUtil.remove(s),this.startModel.clearClips(),this.startModel){var u,l,c,h;let p=(c=e.slice(-1)[0])==null||(l=c.points)==null||(u=l.slice(-1))==null?void 0:u[0];if(!p)return;let f=this.mulFloor.floors.find(_=>{var x;return _.name===((x=e.slice(-1)[0])==null?void 0:x.floor)});if(!f)return;let d=f?f.position.z+f.groundMaxHeight:(h=this.startModel)==null?void 0:h.position.z,m=this.translatePoints([p])[0];this.startModel.position.set(m[0],m[1],d)}o(!0)}).start()})})}setStartPoiRotate(t){if(this.startPoi){let n=(this.bmap.context.control.getAzimuthalAngle()*180/Math.PI+360)%360;this.startPoi.options.icon_rotate=(360-t-n)%360}}dispose(){this.path&&(this.bmap.context.scene.remove(this.path),this.path.dispose()),this.startModel&&(this.bmap.context.scene.remove(this.startModel),this.startModel.dispose()),this.tweenUtil.dispose(),this.unRegistryEvent(),super.dispose()}constructor(t,e,n={}){super(t),this.mulFloor=e,this.path=null,this.fetchRoadStatus=!1,this.paths=[],this.curFloorPath=null,this.translatePath=null,this.currentPathPosition=null,this.pathTween=null,this.startPoi=null,this.movedDistance=0,this.tweenUtil=new be,this.animationPathOptions={cPathIndex:0},this.cPath=[],this.onUpdate=()=>{this.tweenUtil.update()},this.startModel=new ci(t,Ss,n.startModel),this.startModel.visible=!1,this.bmap.context.scene.add(this.startModel),this.registryEvent()}};var L6=require("core-js/modules/es.array.flat.js"),N6=require("core-js/modules/es.array.unscopables.flat.js"),pi=require("three");var fo=class extends at{registryEvent(){this.clickHelper.addEventListener("click",this._click)}unRegistryEvent(){this.clickHelper.removeEventListener("click",this._click)}dispose(){this.unRegistryEvent(),this.clickHelper.dispose(),this.mulFloors=null,super.dispose()}constructor(t,e){super(t),this.mulFloors=e,this._click=n=>{let{e:r}=n;if(!this.mulFloors.showStatus)return;let i=new pi.Vector2,{offsetX:o,offsetY:s}=r,u=this.mulFloors.floors.map(p=>p.poiLayer2.getPoiByDeviceXy(o,s)).flat(2),{clientSize:l}=this.bmap.context;i.x=o/l.width*2-1,i.y=s/l.height*-2+1;let c=new pi.Raycaster;c.setFromCamera(i,this.bmap.context.camera),c.ray.origin.sub(c.ray.direction.clone().multiplyScalar(1e4));let h=this.mulFloors.floors.map(p=>p.graphicLayer.getGraphicByRaycaster(c).graphics).flat();this.dispatchEvent({type:"select",pois:u,graphics:h})},this.clickHelper=new Nn(this.bmap.context.container),this.registryEvent()}};var H6=require("core-js/modules/es.array.find-last-index.js"),W6=require("core-js/modules/es.array.find-last.js"),X6=require("core-js/modules/es.array.push.js");var F6=require("core-js/modules/web.dom-collections.iterator.js"),B6=require("core-js/modules/es.array.push.js"),z6=require("core-js/modules/es.array.sort.js"),yn=require("three");function $u(a){let t=a.length,e=0,n=0,r=0,i=0;a.forEach(u=>{e+=u[0],n+=u[1],r+=u[0]*u[1],i+=u[0]*u[0]});let o=(t*r-e*n)/(t*i-e*e),s=(n-o*e)/t;return{m:o,b:s}}function Ju(a,t,e){let n=e[0][0],r=e.slice(-1)[0][0],i=a*n+t,o=a*r+t;return{start:[n,i],end:[r,o]}}function vr(a){if(a.length<2)return null;let t=a.filter((u,l)=>{let c=[...a];return c.splice(l,1),c.every(h=>h[0]!==u[0]&&h[1]!==u[1])});if(t.length<2)return null;let{m:e,b:n}=$u(t),{start:r,end:i}=Ju(e,n,t),s=360-(new yn.Vector2().subVectors(new yn.Vector2(i[0],i[1]),new yn.Vector2(r[0],r[1])).angle()/Math.PI*180-90+360)%360;return Number.isNaN(s)?null:s}function Qu(a){let t=[];for(let e=1;e<a.length;e++){let n=a[e-1],r=a[e],i=r.position[0]-n.position[0],o=r.position[1]-n.position[1],s=Math.sqrt(i**2+o**2),u=r.time-n.time;if(u>0){let l=s/u;console.log("speedDelta",n.type,r.type,fi(l),s,u),t.push(l)}else t.push(0)}return t}function t0(a,t){let e=a[0],n=a.slice(-1)[0],r=U(n.position,e.position),i=n.time-e.time;return i<100||r<3?null:r/i}function fi(a){return a*60*60}function vn(a,t,e,n){let r=(e+90)%360*(Math.PI/180),i=t*n,o=new yn.Vector2(a[0],a[1]),s=Math.cos(r),u=Math.sin(r),l=new yn.Vector2(s,u);return o.add(l.normalize().multiplyScalar(i)),[o.x,o.y]}function e0(a){let t=[...a].sort((l,c)=>l-c),e=Ma(t,25),n=Ma(t,75),r=n-e,i=e-1.5*r,o=n+1.5*r,s=t.filter(l=>l>=i&&l<=o);return a.filter(l=>s.includes(l))}function Ma(a,t){let e=t/100*(a.length-1),n=Math.floor(e),r=Math.ceil(e);if(n===r)return a[n];let i=e-n;return a[n]*(1-i)+a[r]*i}var xr=require("lodash"),Er=class extends ct{setPathAngle(t){this.pathAngle=t,this.dispatchEvent({type:"change-compass",value:this.pathAngle}),(0,xr.isNil)(this.angle)&&(this.angle=t)}changeSpeed(){let t=this.history.filter(u=>["vision"].includes(u.type));if(t.length<2){this.speedFilter.filter(0),this.speed=0;return}let e=t[0],n=t.slice(-1)[0],r=U(n.position,e.position),i=n.time-e.time,o=i>0?r/i:0,s=this.speedFilter.filter(o);this.speed=s}changeAngle(t){t===void 0&&(t=this.visionHistory),t.length<2&&(this.angle=null);let e=vr(t.map(n=>n.position));e!==null&&this.setAngle(e)}setAngle(t,e){e===void 0&&(e=!0),this.angle=t,e&&this.dispatchEvent({type:"change-position-compass",value:t})}setPosition(t,e,n){let r={position:t,time:e,clientTime:Date.now()-n,type:"vision"};if(this._setVisionHistoryForAngle(r),(0,xr.isNil)(this.angle)||!this.speed){this.addHistory(r);return}let i=this.history.findLastIndex(s=>s.type==="vision"),o=this.history[i];if(o){if(o.time>e)return;let s=vr([this.history.slice(-1)[0].position,t]);if(s&&Math.abs(s-this.angle)<60){this.addHistory(r);return}let u=vn(t,this.speed,360-this.pathAngle,n);U(u,this.history.slice(-1)[0].position)>5?this.visionExcessesCount++:this.visionExcessesCount=0,this.visionExcessesCount>3&&(console.warn("\u8FDE\u7EED\u4E09\u6B21\u89C6\u89C9\u548Cpdr\u5DEE\u8DDD\u5927\u4E8E5\u7C73\uFF0C\u4F7F\u7528\u89C6\u89C9\u6821\u51C6"),this.addHistory(r),this.visionExcessesCount=0)}}resetPdrPosition(){let t=this.history.findLast(e=>e.type==="vision");if(t&&this.speed){let e=vn(t.position,this.speed,360-this.pathAngle,Date.now()-t.clientTime);e&&this.history.push({position:e,time:Date.now(),clientTime:Date.now(),type:"pdr"})}}getLastVisionPdrPos(){let t=this.history.findLastIndex(n=>n.type==="vision");if(t!==-1){var e;return(e=this.history[t+1])!=null?e:this.history[t]}return null}_setVisionHistoryForAngle(t){if(!this.visionHistory.length){this.visionHistory.push(t);return}let e=vr([this.visionHistory.slice(-1)[0].position,t.position]);if(e!==null&&(this.angle&&Math.abs(this.angle-e)>60?this.angleExcessesCount++:(this.angleExcessesCount=0,this.visionHistory.push(t))),this.angleExcessesCount>3)console.warn("\u8FDE\u7EED\u4E09\u6B21\u89D2\u5EA6\u6BD4\u8F83\u6B6A\uFF0C\u91CD\u65B0\u77EB\u6B63"),this.visionHistory=[t],this.angleExcessesCount=0;else{let n=U(this.visionHistory[0].position,this.visionHistory.slice(-1)[0].position);for(;n>5&&this.visionHistory.length>15;)this.visionHistory.shift(),n=U(this.visionHistory[0].position,this.visionHistory.slice(-1)[0].position)}this.changeAngle()}addHistory(t){this.history.push(t);let e=this.history.filter(s=>s.type==="vision"),n=e.length?Date.now()-e.slice(-1)[0].clientTime:0,r=U(this.history[0].position,this.history.slice(-1)[0].position),i=n>5e3?10:3,o=n>5e3?0:5;for(n>5e3&&console.warn("\u89C6\u89C9\u7ED3\u679C\u8D85\u51FA5s\u4E0D\u53EF\u7528\uFF0C\u5168\u90E8\u6E05\u7A7A");e.length>o&&r>i;)this.history.shift(),e=this.history.filter(s=>s.type==="vision"),r=U(this.history[0].position,this.history.slice(-1)[0].position);o===0?this.changeSpeed():t.type==="vision"&&this.changeSpeed(),this.changePosition(t.type)}setBeaconPosition(t,e,n){let r=Date.now()-n,i={position:t,time:e,clientTime:r,type:"beacon"},o=this.history.findLastIndex(c=>c.type!=="pdr"),s=this.history[o];if(!s){this.addHistory(i);return}if((0,xr.isNil)(this.pathAngle)||!this.speed){this.addHistory(i);return}if(s&&s.time>e)return;let u=vn(t,this.speed,360-this.pathAngle,n);U(u,this.history.slice(-1)[0].position)>5?this.beaconExcessesCount++:this.beaconExcessesCount=0,this.beaconExcessesCount>3&&(console.warn("\u8FDE\u7EED\u4E09\u6B21beacon\u548Cpdr\u5DEE\u8DDD\u5927\u4E8E5\u7C73\uFF0C\u4F7F\u7528beacon\u6821\u51C6"),this.addHistory(i),this.beaconExcessesCount=0)}startPositionTimer(){this.positionTimer&&this.timer.clearInterval(this.positionTimer),this.positionTimer=this.timer.setInterval(()=>{this.changePosition()},20)}stopPositionTimer(){this.positionTimer&&(this.timer.clearInterval(this.positionTimer),this.positionTimer=null)}changePosition(t){t===void 0&&(t="pdr");let e=this.getPosition(t);e.success&&(this.history.push({position:e.pos,time:Date.now(),clientTime:Date.now(),type:"pdr"}),this.speed?this.dispatchEvent({type:"change-pos",value:v({},e)}):this.dispatchEvent({type:"change-pos",value:e}))}getPosition(t){if(this.history.length===0)return{success:!1,pos:[0,0],compass:null,speed:0};let e=this.history.slice(-1)[0];if(this.history.length<2)return{success:!0,pos:e.position,compass:this.pathAngle,speed:this.speed};if((0,xr.isNil)(this.pathAngle)||!this.speed)return{success:!0,pos:e.position,compass:this.pathAngle,speed:this.speed};let n=e.clientTime,r=Date.now()-n;return{success:!0,pos:this.pathAngle?vn(e.position,this.speed,360-this.pathAngle,r):e.position,compass:this.pathAngle,speed:fi(this.speed)}}dispose(){this.timer.dispose()}constructor(){super(),this.history=[],this.visionHistory=[],this.speed=0,this.angle=null,this.timer=new $,this.positionTimer=null,this.speedFilter=new Dn,this.visionExcessesCount=0,this.beaconExcessesCount=0,this.angleExcessesCount=0,this.pathAngle=0,this.startPositionTimer()}};var J6=require("core-js/modules/es.json.stringify.js");function go(){let a=new Blob([`var PU=Object.create;var EE=Object.defineProperty;var IU=Object.getOwnPropertyDescriptor;var RU=Object.getOwnPropertyNames;var LU=Object.getPrototypeOf,NU=Object.prototype.hasOwnProperty;var st=(n,t)=>()=>(t||n((t={exports:{}}).exports,t),t.exports);var OU=(n,t,e,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of RU(t))!NU.call(n,s)&&s!==e&&EE(n,s,{get:()=>t[s],enumerable:!(o=IU(t,s))||o.enumerable});return n};var sn=(n,t,e)=>(e=n!=null?PU(LU(n)):{},OU(t||!n||!n.__esModule?EE(e,"default",{value:n,enumerable:!0}):e,n));var ac=(n,t,e)=>new Promise((o,s)=>{var l=g=>{try{h(e.next(g))}catch(m){s(m)}},p=g=>{try{h(e.throw(g))}catch(m){s(m)}},h=g=>g.done?o(g.value):Promise.resolve(g.value).then(l,p);h((e=e.apply(n,t)).next())});var so=st((Vm,wE)=>{"use strict";var zf=function(n){return n&&n.Math===Math&&n};wE.exports=zf(typeof globalThis=="object"&&globalThis)||zf(typeof window=="object"&&window)||zf(typeof self=="object"&&self)||zf(typeof global=="object"&&global)||zf(typeof Vm=="object"&&Vm)||function(){return this}()||Function("return this")()});var mi=st((oj,SE)=>{"use strict";SE.exports=function(n){try{return!!n()}catch(t){return!0}}});var Ys=st((sj,ME)=>{"use strict";var DU=mi();ME.exports=!DU(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!==7})});var Gf=st((aj,bE)=>{"use strict";var FU=mi();bE.exports=!FU(function(){var n=function(){}.bind();return typeof n!="function"||n.hasOwnProperty("prototype")})});var Ns=st((uj,AE)=>{"use strict";var UU=Gf(),gp=Function.prototype.call;AE.exports=UU?gp.bind(gp):function(){return gp.apply(gp,arguments)}});var IE=st(PE=>{"use strict";var TE={}.propertyIsEnumerable,CE=Object.getOwnPropertyDescriptor,BU=CE&&!TE.call({1:2},1);PE.f=BU?function(t){var e=CE(this,t);return!!e&&e.enumerable}:TE});var mp=st((cj,RE)=>{"use strict";RE.exports=function(n,t){return{enumerable:!(n&1),configurable:!(n&2),writable:!(n&4),value:t}}});var yi=st((fj,OE)=>{"use strict";var LE=Gf(),NE=Function.prototype,Wm=NE.call,zU=LE&&NE.bind.bind(Wm,Wm);OE.exports=LE?zU:function(n){return function(){return Wm.apply(n,arguments)}}});var uc=st((hj,FE)=>{"use strict";var DE=yi(),GU=DE({}.toString),kU=DE("".slice);FE.exports=function(n){return kU(GU(n),8,-1)}});var BE=st((pj,UE)=>{"use strict";var qU=yi(),HU=mi(),VU=uc(),Xm=Object,WU=qU("".split);UE.exports=HU(function(){return!Xm("z").propertyIsEnumerable(0)})?function(n){return VU(n)==="String"?WU(n,""):Xm(n)}:Xm});var Ym=st((dj,zE)=>{"use strict";zE.exports=function(n){return n==null}});var lc=st((gj,GE)=>{"use strict";var XU=Ym(),YU=TypeError;GE.exports=function(n){if(XU(n))throw new YU("Can't call method on "+n);return n}});var cc=st((mj,kE)=>{"use strict";var $U=BE(),ZU=lc();kE.exports=function(n){return $U(ZU(n))}});var Ui=st((yj,qE)=>{"use strict";var $m=typeof document=="object"&&document.all;qE.exports=typeof $m=="undefined"&&$m!==void 0?function(n){return typeof n=="function"||n===$m}:function(n){return typeof n=="function"}});var $s=st((vj,HE)=>{"use strict";var JU=Ui();HE.exports=function(n){return typeof n=="object"?n!==null:JU(n)}});var fc=st((_j,VE)=>{"use strict";var Zm=so(),KU=Ui(),jU=function(n){return KU(n)?n:void 0};VE.exports=function(n,t){return arguments.length<2?jU(Zm[n]):Zm[n]&&Zm[n][t]}});var XE=st((xj,WE)=>{"use strict";var QU=yi();WE.exports=QU({}.isPrototypeOf)});var JE=st((Ej,ZE)=>{"use strict";var tB=so(),YE=tB.navigator,$E=YE&&YE.userAgent;ZE.exports=$E?String($E):""});var rw=st((wj,nw)=>{"use strict";var ew=so(),Jm=JE(),KE=ew.process,jE=ew.Deno,QE=KE&&KE.versions||jE&&jE.version,tw=QE&&QE.v8,Zs,yp;tw&&(Zs=tw.split("."),yp=Zs[0]>0&&Zs[0]<4?1:+(Zs[0]+Zs[1]));!yp&&Jm&&(Zs=Jm.match(/Edge\\/(\\d+)/),(!Zs||Zs[1]>=74)&&(Zs=Jm.match(/Chrome\\/(\\d+)/),Zs&&(yp=+Zs[1])));nw.exports=yp});var Km=st((Sj,ow)=>{"use strict";var iw=rw(),eB=mi(),nB=so(),rB=nB.String;ow.exports=!!Object.getOwnPropertySymbols&&!eB(function(){var n=Symbol("symbol detection");return!rB(n)||!(Object(n)instanceof Symbol)||!Symbol.sham&&iw&&iw<41})});var jm=st((Mj,sw)=>{"use strict";var iB=Km();sw.exports=iB&&!Symbol.sham&&typeof Symbol.iterator=="symbol"});var Qm=st((bj,aw)=>{"use strict";var oB=fc(),sB=Ui(),aB=XE(),uB=jm(),lB=Object;aw.exports=uB?function(n){return typeof n=="symbol"}:function(n){var t=oB("Symbol");return sB(t)&&aB(t.prototype,lB(n))}});var lw=st((Aj,uw)=>{"use strict";var cB=String;uw.exports=function(n){try{return cB(n)}catch(t){return"Object"}}});var kf=st((Tj,cw)=>{"use strict";var fB=Ui(),hB=lw(),pB=TypeError;cw.exports=function(n){if(fB(n))return n;throw new pB(hB(n)+" is not a function")}});var vp=st((Cj,fw)=>{"use strict";var dB=kf(),gB=Ym();fw.exports=function(n,t){var e=n[t];return gB(e)?void 0:dB(e)}});var pw=st((Pj,hw)=>{"use strict";var t0=Ns(),e0=Ui(),n0=$s(),mB=TypeError;hw.exports=function(n,t){var e,o;if(t==="string"&&e0(e=n.toString)&&!n0(o=t0(e,n))||e0(e=n.valueOf)&&!n0(o=t0(e,n))||t!=="string"&&e0(e=n.toString)&&!n0(o=t0(e,n)))return o;throw new mB("Can't convert object to primitive value")}});var qf=st((Ij,dw)=>{"use strict";dw.exports=!1});var _p=st((Rj,mw)=>{"use strict";var gw=so(),yB=Object.defineProperty;mw.exports=function(n,t){try{yB(gw,n,{value:t,configurable:!0,writable:!0})}catch(e){gw[n]=t}return t}});var xp=st((Lj,_w)=>{"use strict";var vB=qf(),_B=so(),xB=_p(),yw="__core-js_shared__",vw=_w.exports=_B[yw]||xB(yw,{});(vw.versions||(vw.versions=[])).push({version:"3.42.0",mode:vB?"pure":"global",copyright:"\\xA9 2014-2025 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.42.0/LICENSE",source:"https://github.com/zloirock/core-js"})});var Ep=st((Nj,Ew)=>{"use strict";var xw=xp();Ew.exports=function(n,t){return xw[n]||(xw[n]=t||{})}});var hc=st((Oj,ww)=>{"use strict";var EB=lc(),wB=Object;ww.exports=function(n){return wB(EB(n))}});var ba=st((Dj,Sw)=>{"use strict";var SB=yi(),MB=hc(),bB=SB({}.hasOwnProperty);Sw.exports=Object.hasOwn||function(t,e){return bB(MB(t),e)}});var r0=st((Fj,Mw)=>{"use strict";var AB=yi(),TB=0,CB=Math.random(),PB=AB(1 .toString);Mw.exports=function(n){return"Symbol("+(n===void 0?"":n)+")_"+PB(++TB+CB,36)}});var Os=st((Uj,Aw)=>{"use strict";var IB=so(),RB=Ep(),bw=ba(),LB=r0(),NB=Km(),OB=jm(),pc=IB.Symbol,i0=RB("wks"),DB=OB?pc.for||pc:pc&&pc.withoutSetter||LB;Aw.exports=function(n){return bw(i0,n)||(i0[n]=NB&&bw(pc,n)?pc[n]:DB("Symbol."+n)),i0[n]}});var Iw=st((Bj,Pw)=>{"use strict";var FB=Ns(),Tw=$s(),Cw=Qm(),UB=vp(),BB=pw(),zB=Os(),GB=TypeError,kB=zB("toPrimitive");Pw.exports=function(n,t){if(!Tw(n)||Cw(n))return n;var e=UB(n,kB),o;if(e){if(t===void 0&&(t="default"),o=FB(e,n,t),!Tw(o)||Cw(o))return o;throw new GB("Can't convert object to primitive value")}return t===void 0&&(t="number"),BB(n,t)}});var o0=st((zj,Rw)=>{"use strict";var qB=Iw(),HB=Qm();Rw.exports=function(n){var t=qB(n,"string");return HB(t)?t:t+""}});var wp=st((Gj,Nw)=>{"use strict";var VB=so(),Lw=$s(),s0=VB.document,WB=Lw(s0)&&Lw(s0.createElement);Nw.exports=function(n){return WB?s0.createElement(n):{}}});var a0=st((kj,Ow)=>{"use strict";var XB=Ys(),YB=mi(),$B=wp();Ow.exports=!XB&&!YB(function(){return Object.defineProperty($B("div"),"a",{get:function(){return 7}}).a!==7})});var u0=st(Fw=>{"use strict";var ZB=Ys(),JB=Ns(),KB=IE(),jB=mp(),QB=cc(),tz=o0(),ez=ba(),nz=a0(),Dw=Object.getOwnPropertyDescriptor;Fw.f=ZB?Dw:function(t,e){if(t=QB(t),e=tz(e),nz)try{return Dw(t,e)}catch(o){}if(ez(t,e))return jB(!JB(KB.f,t,e),t[e])}});var l0=st((Hj,Uw)=>{"use strict";var rz=Ys(),iz=mi();Uw.exports=rz&&iz(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!==42})});var Aa=st((Vj,Bw)=>{"use strict";var oz=$s(),sz=String,az=TypeError;Bw.exports=function(n){if(oz(n))return n;throw new az(sz(n)+" is not an object")}});var Ru=st(Gw=>{"use strict";var uz=Ys(),lz=a0(),cz=l0(),Sp=Aa(),zw=o0(),fz=TypeError,c0=Object.defineProperty,hz=Object.getOwnPropertyDescriptor,f0="enumerable",h0="configurable",p0="writable";Gw.f=uz?cz?function(t,e,o){if(Sp(t),e=zw(e),Sp(o),typeof t=="function"&&e==="prototype"&&"value"in o&&p0 in o&&!o[p0]){var s=hz(t,e);s&&s[p0]&&(t[e]=o.value,o={configurable:h0 in o?o[h0]:s[h0],enumerable:f0 in o?o[f0]:s[f0],writable:!1})}return c0(t,e,o)}:c0:function(t,e,o){if(Sp(t),e=zw(e),Sp(o),lz)try{return c0(t,e,o)}catch(s){}if("get"in o||"set"in o)throw new fz("Accessors not supported");return"value"in o&&(t[e]=o.value),t}});var dc=st((Xj,kw)=>{"use strict";var pz=Ys(),dz=Ru(),gz=mp();kw.exports=pz?function(n,t,e){return dz.f(n,t,gz(1,e))}:function(n,t,e){return n[t]=e,n}});var m0=st((Yj,Hw)=>{"use strict";var d0=Ys(),mz=ba(),qw=Function.prototype,yz=d0&&Object.getOwnPropertyDescriptor,g0=mz(qw,"name"),vz=g0&&function(){}.name==="something",_z=g0&&(!d0||d0&&yz(qw,"name").configurable);Hw.exports={EXISTS:g0,PROPER:vz,CONFIGURABLE:_z}});var v0=st(($j,Vw)=>{"use strict";var xz=yi(),Ez=Ui(),y0=xp(),wz=xz(Function.toString);Ez(y0.inspectSource)||(y0.inspectSource=function(n){return wz(n)});Vw.exports=y0.inspectSource});var Yw=st((Zj,Xw)=>{"use strict";var Sz=so(),Mz=Ui(),Ww=Sz.WeakMap;Xw.exports=Mz(Ww)&&/native code/.test(String(Ww))});var Mp=st((Jj,Zw)=>{"use strict";var bz=Ep(),Az=r0(),$w=bz("keys");Zw.exports=function(n){return $w[n]||($w[n]=Az(n))}});var bp=st((Kj,Jw)=>{"use strict";Jw.exports={}});var Cp=st((jj,Qw)=>{"use strict";var Tz=Yw(),jw=so(),Cz=$s(),Pz=dc(),_0=ba(),x0=xp(),Iz=Mp(),Rz=bp(),Kw="Object already initialized",E0=jw.TypeError,Lz=jw.WeakMap,Ap,Hf,Tp,Nz=function(n){return Tp(n)?Hf(n):Ap(n,{})},Oz=function(n){return function(t){var e;if(!Cz(t)||(e=Hf(t)).type!==n)throw new E0("Incompatible receiver, "+n+" required");return e}};Tz||x0.state?(Js=x0.state||(x0.state=new Lz),Js.get=Js.get,Js.has=Js.has,Js.set=Js.set,Ap=function(n,t){if(Js.has(n))throw new E0(Kw);return t.facade=n,Js.set(n,t),t},Hf=function(n){return Js.get(n)||{}},Tp=function(n){return Js.has(n)}):(El=Iz("state"),Rz[El]=!0,Ap=function(n,t){if(_0(n,El))throw new E0(Kw);return t.facade=n,Pz(n,El,t),t},Hf=function(n){return _0(n,El)?n[El]:{}},Tp=function(n){return _0(n,El)});var Js,El;Qw.exports={set:Ap,get:Hf,has:Tp,enforce:Nz,getterFor:Oz}});var rS=st((Qj,nS)=>{"use strict";var S0=yi(),Dz=mi(),Fz=Ui(),Pp=ba(),w0=Ys(),Uz=m0().CONFIGURABLE,Bz=v0(),eS=Cp(),zz=eS.enforce,Gz=eS.get,tS=String,Ip=Object.defineProperty,kz=S0("".slice),qz=S0("".replace),Hz=S0([].join),Vz=w0&&!Dz(function(){return Ip(function(){},"length",{value:8}).length!==8}),Wz=String(String).split("String"),Xz=nS.exports=function(n,t,e){kz(tS(t),0,7)==="Symbol("&&(t="["+qz(tS(t),/^Symbol\\(([^)]*)\\).*$/,"$1")+"]"),e&&e.getter&&(t="get "+t),e&&e.setter&&(t="set "+t),(!Pp(n,"name")||Uz&&n.name!==t)&&(w0?Ip(n,"name",{value:t,configurable:!0}):n.name=t),Vz&&e&&Pp(e,"arity")&&n.length!==e.arity&&Ip(n,"length",{value:e.arity});try{e&&Pp(e,"constructor")&&e.constructor?w0&&Ip(n,"prototype",{writable:!1}):n.prototype&&(n.prototype=void 0)}catch(s){}var o=zz(n);return Pp(o,"source")||(o.source=Hz(Wz,typeof t=="string"?t:"")),n};Function.prototype.toString=Xz(function(){return Fz(this)&&Gz(this).source||Bz(this)},"toString")});var Vf=st((tQ,iS)=>{"use strict";var Yz=Ui(),$z=Ru(),Zz=rS(),Jz=_p();iS.exports=function(n,t,e,o){o||(o={});var s=o.enumerable,l=o.name!==void 0?o.name:t;if(Yz(e)&&Zz(e,l,o),o.global)s?n[t]=e:Jz(t,e);else{try{o.unsafe?n[t]&&(s=!0):delete n[t]}catch(p){}s?n[t]=e:$z.f(n,t,{value:e,enumerable:!1,configurable:!o.nonConfigurable,writable:!o.nonWritable})}return n}});var sS=st((eQ,oS)=>{"use strict";var Kz=Math.ceil,jz=Math.floor;oS.exports=Math.trunc||function(t){var e=+t;return(e>0?jz:Kz)(e)}});var wl=st((nQ,aS)=>{"use strict";var Qz=sS();aS.exports=function(n){var t=+n;return t!==t||t===0?0:Qz(t)}});var lS=st((rQ,uS)=>{"use strict";var tG=wl(),eG=Math.max,nG=Math.min;uS.exports=function(n,t){var e=tG(n);return e<0?eG(e+t,0):nG(e,t)}});var M0=st((iQ,cS)=>{"use strict";var rG=wl(),iG=Math.min;cS.exports=function(n){var t=rG(n);return t>0?iG(t,9007199254740991):0}});var Wf=st((oQ,fS)=>{"use strict";var oG=M0();fS.exports=function(n){return oG(n.length)}});var dS=st((sQ,pS)=>{"use strict";var sG=cc(),aG=lS(),uG=Wf(),hS=function(n){return function(t,e,o){var s=sG(t),l=uG(s);if(l===0)return!n&&-1;var p=aG(o,l),h;if(n&&e!==e){for(;l>p;)if(h=s[p++],h!==h)return!0}else for(;l>p;p++)if((n||p in s)&&s[p]===e)return n||p||0;return!n&&-1}};pS.exports={includes:hS(!0),indexOf:hS(!1)}});var A0=st((aQ,mS)=>{"use strict";var lG=yi(),b0=ba(),cG=cc(),fG=dS().indexOf,hG=bp(),gS=lG([].push);mS.exports=function(n,t){var e=cG(n),o=0,s=[],l;for(l in e)!b0(hG,l)&&b0(e,l)&&gS(s,l);for(;t.length>o;)b0(e,l=t[o++])&&(~fG(s,l)||gS(s,l));return s}});var Rp=st((uQ,yS)=>{"use strict";yS.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]});var _S=st(vS=>{"use strict";var pG=A0(),dG=Rp(),gG=dG.concat("length","prototype");vS.f=Object.getOwnPropertyNames||function(t){return pG(t,gG)}});var ES=st(xS=>{"use strict";xS.f=Object.getOwnPropertySymbols});var SS=st((fQ,wS)=>{"use strict";var mG=fc(),yG=yi(),vG=_S(),_G=ES(),xG=Aa(),EG=yG([].concat);wS.exports=mG("Reflect","ownKeys")||function(t){var e=vG.f(xG(t)),o=_G.f;return o?EG(e,o(t)):e}});var AS=st((hQ,bS)=>{"use strict";var MS=ba(),wG=SS(),SG=u0(),MG=Ru();bS.exports=function(n,t,e){for(var o=wG(t),s=MG.f,l=SG.f,p=0;p<o.length;p++){var h=o[p];!MS(n,h)&&!(e&&MS(e,h))&&s(n,h,l(t,h))}}});var CS=st((pQ,TS)=>{"use strict";var bG=mi(),AG=Ui(),TG=/#|\\.prototype\\./,Xf=function(n,t){var e=PG[CG(n)];return e===RG?!0:e===IG?!1:AG(t)?bG(t):!!t},CG=Xf.normalize=function(n){return String(n).replace(TG,".").toLowerCase()},PG=Xf.data={},IG=Xf.NATIVE="N",RG=Xf.POLYFILL="P";TS.exports=Xf});var Ds=st((dQ,PS)=>{"use strict";var Lp=so(),LG=u0().f,NG=dc(),OG=Vf(),DG=_p(),FG=AS(),UG=CS();PS.exports=function(n,t){var e=n.target,o=n.global,s=n.stat,l,p,h,g,m,v;if(o?p=Lp:s?p=Lp[e]||DG(e,{}):p=Lp[e]&&Lp[e].prototype,p)for(h in t){if(m=t[h],n.dontCallGetSet?(v=LG(p,h),g=v&&v.value):g=p[h],l=UG(o?h:e+(s?".":"#")+h,n.forced),!l&&g!==void 0){if(typeof m==typeof g)continue;FG(m,g)}(n.sham||g&&g.sham)&&NG(m,"sham",!0),OG(p,h,m,n)}}});var Np=st((gQ,IS)=>{"use strict";var BG=uc();IS.exports=Array.isArray||function(t){return BG(t)==="Array"}});var LS=st((mQ,RS)=>{"use strict";var zG=Ys(),GG=Np(),kG=TypeError,qG=Object.getOwnPropertyDescriptor,HG=zG&&!function(){if(this!==void 0)return!0;try{Object.defineProperty([],"length",{writable:!1}).length=1}catch(n){return n instanceof TypeError}}();RS.exports=HG?function(n,t){if(GG(n)&&!qG(n,"length").writable)throw new kG("Cannot set read only .length");return n.length=t}:function(n,t){return n.length=t}});var T0=st((yQ,NS)=>{"use strict";var VG=TypeError,WG=9007199254740991;NS.exports=function(n){if(n>WG)throw VG("Maximum allowed index exceeded");return n}});var C0=st(()=>{"use strict";var XG=Ds(),YG=hc(),$G=Wf(),ZG=LS(),JG=T0(),KG=mi(),jG=KG(function(){return[].push.call({length:4294967296},1)!==4294967297}),QG=function(){try{Object.defineProperty([],"length",{writable:!1}).push()}catch(n){return n instanceof TypeError}},t4=jG||!QG();XG({target:"Array",proto:!0,arity:1,forced:t4},{push:function(t){var e=YG(this),o=$G(e),s=arguments.length;JG(o+s);for(var l=0;l<s;l++)e[o]=arguments[l],o++;return ZG(e,o),o}})});var DS=st((EQ,OS)=>{"use strict";OS.exports={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0}});var BS=st((wQ,US)=>{"use strict";var e4=wp(),P0=e4("span").classList,FS=P0&&P0.constructor&&P0.constructor.prototype;US.exports=FS===Object.prototype?void 0:FS});var GS=st((SQ,zS)=>{"use strict";var n4=A0(),r4=Rp();zS.exports=Object.keys||function(t){return n4(t,r4)}});var qS=st(kS=>{"use strict";var i4=Ys(),o4=l0(),s4=Ru(),a4=Aa(),u4=cc(),l4=GS();kS.f=i4&&!o4?Object.defineProperties:function(t,e){a4(t);for(var o=u4(e),s=l4(e),l=s.length,p=0,h;l>p;)s4.f(t,h=s[p++],o[h]);return t}});var VS=st((bQ,HS)=>{"use strict";var c4=fc();HS.exports=c4("document","documentElement")});var Yf=st((AQ,KS)=>{"use strict";var f4=Aa(),h4=qS(),WS=Rp(),p4=bp(),d4=VS(),g4=wp(),m4=Mp(),XS=">",YS="<",R0="prototype",L0="script",ZS=m4("IE_PROTO"),I0=function(){},JS=function(n){return YS+L0+XS+n+YS+"/"+L0+XS},$S=function(n){n.write(JS("")),n.close();var t=n.parentWindow.Object;return n=null,t},y4=function(){var n=g4("iframe"),t="java"+L0+":",e;return n.style.display="none",d4.appendChild(n),n.src=String(t),e=n.contentWindow.document,e.open(),e.write(JS("document.F=Object")),e.close(),e.F},Op,Dp=function(){try{Op=new ActiveXObject("htmlfile")}catch(t){}Dp=typeof document!="undefined"?document.domain&&Op?$S(Op):y4():$S(Op);for(var n=WS.length;n--;)delete Dp[R0][WS[n]];return Dp()};p4[ZS]=!0;KS.exports=Object.create||function(t,e){var o;return t!==null?(I0[R0]=f4(t),o=new I0,I0[R0]=null,o[ZS]=t):o=Dp(),e===void 0?o:h4.f(o,e)}});var D0=st((TQ,jS)=>{"use strict";var v4=Os(),_4=Yf(),x4=Ru().f,N0=v4("unscopables"),O0=Array.prototype;O0[N0]===void 0&&x4(O0,N0,{configurable:!0,value:_4(null)});jS.exports=function(n){O0[N0][n]=!0}});var Fp=st((CQ,QS)=>{"use strict";QS.exports={}});var eM=st((PQ,tM)=>{"use strict";var E4=mi();tM.exports=!E4(function(){function n(){}return n.prototype.constructor=null,Object.getPrototypeOf(new n)!==n.prototype})});var U0=st((IQ,rM)=>{"use strict";var w4=ba(),S4=Ui(),M4=hc(),b4=Mp(),A4=eM(),nM=b4("IE_PROTO"),F0=Object,T4=F0.prototype;rM.exports=A4?F0.getPrototypeOf:function(n){var t=M4(n);if(w4(t,nM))return t[nM];var e=t.constructor;return S4(e)&&t instanceof e?e.prototype:t instanceof F0?T4:null}});var k0=st((RQ,sM)=>{"use strict";var C4=mi(),P4=Ui(),I4=$s(),R4=Yf(),iM=U0(),L4=Vf(),N4=Os(),O4=qf(),G0=N4("iterator"),oM=!1,nu,B0,z0;[].keys&&(z0=[].keys(),"next"in z0?(B0=iM(iM(z0)),B0!==Object.prototype&&(nu=B0)):oM=!0);var D4=!I4(nu)||C4(function(){var n={};return nu[G0].call(n)!==n});D4?nu={}:O4&&(nu=R4(nu));P4(nu[G0])||L4(nu,G0,function(){return this});sM.exports={IteratorPrototype:nu,BUGGY_SAFARI_ITERATORS:oM}});var Up=st((LQ,uM)=>{"use strict";var F4=Ru().f,U4=ba(),B4=Os(),aM=B4("toStringTag");uM.exports=function(n,t,e){n&&!e&&(n=n.prototype),n&&!U4(n,aM)&&F4(n,aM,{configurable:!0,value:t})}});var cM=st((NQ,lM)=>{"use strict";var z4=k0().IteratorPrototype,G4=Yf(),k4=mp(),q4=Up(),H4=Fp(),V4=function(){return this};lM.exports=function(n,t,e,o){var s=t+" Iterator";return n.prototype=G4(z4,{next:k4(+!o,e)}),q4(n,s,!1,!0),H4[s]=V4,n}});var q0=st((OQ,fM)=>{"use strict";var W4=yi(),X4=kf();fM.exports=function(n,t,e){try{return W4(X4(Object.getOwnPropertyDescriptor(n,t)[e]))}catch(o){}}});var pM=st((DQ,hM)=>{"use strict";var Y4=$s();hM.exports=function(n){return Y4(n)||n===null}});var gM=st((FQ,dM)=>{"use strict";var $4=pM(),Z4=String,J4=TypeError;dM.exports=function(n){if($4(n))return n;throw new J4("Can't set "+Z4(n)+" as a prototype")}});var yM=st((UQ,mM)=>{"use strict";var K4=q0(),j4=$s(),Q4=lc(),tk=gM();mM.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var n=!1,t={},e;try{e=K4(Object.prototype,"__proto__","set"),e(t,[]),n=t instanceof Array}catch(o){}return function(s,l){return Q4(s),tk(l),j4(s)&&(n?e(s,l):s.__proto__=l),s}}():void 0)});var CM=st((BQ,TM)=>{"use strict";var ek=Ds(),nk=Ns(),Bp=qf(),bM=m0(),rk=Ui(),ik=cM(),vM=U0(),_M=yM(),ok=Up(),sk=dc(),H0=Vf(),ak=Os(),xM=Fp(),AM=k0(),uk=bM.PROPER,lk=bM.CONFIGURABLE,EM=AM.IteratorPrototype,zp=AM.BUGGY_SAFARI_ITERATORS,$f=ak("iterator"),wM="keys",Zf="values",SM="entries",MM=function(){return this};TM.exports=function(n,t,e,o,s,l,p){ik(e,t,o);var h=function(w){if(w===s&&E)return E;if(!zp&&w&&w in v)return v[w];switch(w){case wM:return function(){return new e(this,w)};case Zf:return function(){return new e(this,w)};case SM:return function(){return new e(this,w)}}return function(){return new e(this)}},g=t+" Iterator",m=!1,v=n.prototype,x=v[$f]||v["@@iterator"]||s&&v[s],E=!zp&&x||h(s),M=t==="Array"&&v.entries||x,A,I,S;if(M&&(A=vM(M.call(new n)),A!==Object.prototype&&A.next&&(!Bp&&vM(A)!==EM&&(_M?_M(A,EM):rk(A[$f])||H0(A,$f,MM)),ok(A,g,!0,!0),Bp&&(xM[g]=MM))),uk&&s===Zf&&x&&x.name!==Zf&&(!Bp&&lk?sk(v,"name",Zf):(m=!0,E=function(){return nk(x,this)})),s)if(I={values:h(Zf),keys:l?E:h(wM),entries:h(SM)},p)for(S in I)(zp||m||!(S in v))&&H0(v,S,I[S]);else ek({target:t,proto:!0,forced:zp||m},I);return(!Bp||p)&&v[$f]!==E&&H0(v,$f,E,{name:s}),xM[t]=E,I}});var IM=st((zQ,PM)=>{"use strict";PM.exports=function(n,t){return{value:n,done:t}}});var FM=st((GQ,DM)=>{"use strict";var ck=cc(),V0=D0(),RM=Fp(),NM=Cp(),fk=Ru().f,hk=CM(),Gp=IM(),pk=qf(),dk=Ys(),OM="Array Iterator",gk=NM.set,mk=NM.getterFor(OM);DM.exports=hk(Array,"Array",function(n,t){gk(this,{type:OM,target:ck(n),index:0,kind:t})},function(){var n=mk(this),t=n.target,e=n.index++;if(!t||e>=t.length)return n.target=null,Gp(void 0,!0);switch(n.kind){case"keys":return Gp(e,!1);case"values":return Gp(t[e],!1)}return Gp([e,t[e]],!1)},"values");var LM=RM.Arguments=RM.Array;V0("keys");V0("values");V0("entries");if(!pk&&dk&&LM.name!=="values")try{fk(LM,"name",{value:"values"})}catch(n){}});var Y0=st(()=>{"use strict";var UM=so(),zM=DS(),yk=BS(),Jf=FM(),BM=dc(),vk=Up(),_k=Os(),W0=_k("iterator"),X0=Jf.values,GM=function(n,t){if(n){if(n[W0]!==X0)try{BM(n,W0,X0)}catch(o){n[W0]=X0}if(vk(n,t,!0),zM[t]){for(var e in Jf)if(n[e]!==Jf[e])try{BM(n,e,Jf[e])}catch(o){n[e]=Jf[e]}}}};for(kp in zM)GM(UM[kp]&&UM[kp].prototype,kp);var kp;GM(yk,"DOMTokenList")});var HM=st((HQ,qM)=>{"use strict";var xk=Os(),Ek=xk("toStringTag"),kM={};kM[Ek]="z";qM.exports=String(kM)==="[object z]"});var $0=st((VQ,VM)=>{"use strict";var wk=HM(),Sk=Ui(),qp=uc(),Mk=Os(),bk=Mk("toStringTag"),Ak=Object,Tk=qp(function(){return arguments}())==="Arguments",Ck=function(n,t){try{return n[t]}catch(e){}};VM.exports=wk?qp:function(n){var t,e,o;return n===void 0?"Undefined":n===null?"Null":typeof(e=Ck(t=Ak(n),bk))=="string"?e:Tk?qp(t):(o=qp(t))==="Object"&&Sk(t.callee)?"Arguments":o}});var Hp=st((WQ,WM)=>{"use strict";var Pk=$0(),Ik=String;WM.exports=function(n){if(Pk(n)==="Symbol")throw new TypeError("Cannot convert a Symbol value to a string");return Ik(n)}});var YM=st((XQ,XM)=>{"use strict";var Rk=Aa();XM.exports=function(){var n=Rk(this),t="";return n.hasIndices&&(t+="d"),n.global&&(t+="g"),n.ignoreCase&&(t+="i"),n.multiline&&(t+="m"),n.dotAll&&(t+="s"),n.unicode&&(t+="u"),n.unicodeSets&&(t+="v"),n.sticky&&(t+="y"),t}});var ZM=st((YQ,$M)=>{"use strict";var Z0=mi(),Lk=so(),J0=Lk.RegExp,K0=Z0(function(){var n=J0("a","y");return n.lastIndex=2,n.exec("abcd")!==null}),Nk=K0||Z0(function(){return!J0("a","y").sticky}),Ok=K0||Z0(function(){var n=J0("^r","gy");return n.lastIndex=2,n.exec("str")!==null});$M.exports={BROKEN_CARET:Ok,MISSED_STICKY:Nk,UNSUPPORTED_Y:K0}});var KM=st(($Q,JM)=>{"use strict";var Dk=mi(),Fk=so(),Uk=Fk.RegExp;JM.exports=Dk(function(){var n=Uk(".","s");return!(n.dotAll&&n.test(\`
|
|
19755
19755
|
\`)&&n.flags==="s")})});var QM=st((ZQ,jM)=>{"use strict";var Bk=mi(),zk=so(),Gk=zk.RegExp;jM.exports=Bk(function(){var n=Gk("(?<a>b)","g");return n.exec("b").groups.a!=="b"||"b".replace(n,"$<a>c")!=="bc"})});var Xp=st((JQ,eb)=>{"use strict";var gc=Ns(),Wp=yi(),kk=Hp(),qk=YM(),Hk=ZM(),Vk=Ep(),Wk=Yf(),Xk=Cp().get,Yk=KM(),$k=QM(),Zk=Vk("native-string-replace",String.prototype.replace),Vp=RegExp.prototype.exec,Q0=Vp,Jk=Wp("".charAt),Kk=Wp("".indexOf),jk=Wp("".replace),j0=Wp("".slice),ty=function(){var n=/a/,t=/b*/g;return gc(Vp,n,"a"),gc(Vp,t,"a"),n.lastIndex!==0||t.lastIndex!==0}(),tb=Hk.BROKEN_CARET,ey=/()??/.exec("")[1]!==void 0,Qk=ty||ey||tb||Yk||$k;Qk&&(Q0=function(t){var e=this,o=Xk(e),s=kk(t),l=o.raw,p,h,g,m,v,x,E;if(l)return l.lastIndex=e.lastIndex,p=gc(Q0,l,s),e.lastIndex=l.lastIndex,p;var M=o.groups,A=tb&&e.sticky,I=gc(qk,e),S=e.source,w=0,R=s;if(A&&(I=jk(I,"y",""),Kk(I,"g")===-1&&(I+="g"),R=j0(s,e.lastIndex),e.lastIndex>0&&(!e.multiline||e.multiline&&Jk(s,e.lastIndex-1)!==\`
|
|
19756
19756
|
\`)&&(S="(?: "+S+")",R=" "+R,w++),h=new RegExp("^(?:"+S+")",I)),ey&&(h=new RegExp("^"+S+"$(?!\\\\s)",I)),ty&&(g=e.lastIndex),m=gc(Vp,A?h:e,R),A?m?(m.input=j0(m.input,w),m[0]=j0(m[0],w),m.index=e.lastIndex,e.lastIndex+=m[0].length):e.lastIndex=0:ty&&m&&(e.lastIndex=e.global?m.index+m[0].length:g),ey&&m&&m.length>1&&gc(Zk,m[0],h,function(){for(v=1;v<arguments.length-2;v++)arguments[v]===void 0&&(m[v]=void 0)}),m&&M)for(m.groups=x=Wk(null),v=0;v<M.length;v++)E=M[v],x[E[0]]=m[E[1]];return m});eb.exports=Q0});var Yp=st(()=>{"use strict";var tq=Ds(),nb=Xp();tq({target:"RegExp",proto:!0,forced:/./.exec!==nb},{exec:nb})});var Ks=st((QQ,rb)=>{"use strict";var ny=yi(),$p=Set.prototype;rb.exports={Set,add:ny($p.add),has:ny($p.has),remove:ny($p.delete),proto:$p}});var Nu=st((ttt,ib)=>{"use strict";var eq=Ks().has;ib.exports=function(n){return eq(n),n}});var Ou=st((ett,ob)=>{"use strict";var nq=Ns();ob.exports=function(n,t,e){for(var o=e?n:n.iterator,s=n.next,l,p;!(l=nq(s,o)).done;)if(p=t(l.value),p!==void 0)return p}});var mc=st((ntt,cb)=>{"use strict";var sb=yi(),rq=Ou(),ab=Ks(),iq=ab.Set,ub=ab.proto,oq=sb(ub.forEach),lb=sb(ub.keys),sq=lb(new iq).next;cb.exports=function(n,t,e){return e?rq({iterator:lb(n),next:sq},t):oq(n,t)}});var Zp=st((rtt,hb)=>{"use strict";var fb=Ks(),aq=mc(),uq=fb.Set,lq=fb.add;hb.exports=function(n){var t=new uq;return aq(n,function(e){lq(t,e)}),t}});var yc=st((itt,pb)=>{"use strict";var cq=q0(),fq=Ks();pb.exports=cq(fq.proto,"size","get")||function(n){return n.size}});var gb=st((ott,db)=>{"use strict";db.exports=function(n){return{iterator:n,next:n.next,done:!1}}});var Du=st((stt,Eb)=>{"use strict";var mb=kf(),_b=Aa(),yb=Ns(),hq=wl(),pq=gb(),vb="Invalid size",dq=RangeError,gq=TypeError,mq=Math.max,xb=function(n,t){this.set=n,this.size=mq(t,0),this.has=mb(n.has),this.keys=mb(n.keys)};xb.prototype={getIterator:function(){return pq(_b(yb(this.keys,this.set)))},includes:function(n){return yb(this.has,this.set,n)}};Eb.exports=function(n){_b(n);var t=+n.size;if(t!==t)throw new gq(vb);var e=hq(t);if(e<0)throw new dq(vb);return new xb(n,e)}});var bb=st((att,Mb)=>{"use strict";var yq=Nu(),Sb=Ks(),vq=Zp(),_q=yc(),xq=Du(),Eq=mc(),wq=Ou(),Sq=Sb.has,wb=Sb.remove;Mb.exports=function(t){var e=yq(this),o=xq(t),s=vq(e);return _q(e)<=o.size?Eq(e,function(l){o.includes(l)&&wb(s,l)}):wq(o.getIterator(),function(l){Sq(e,l)&&wb(s,l)}),s}});var Fu=st((utt,Cb)=>{"use strict";var Mq=fc(),Ab=function(n){return{size:n,has:function(){return!1},keys:function(){return{next:function(){return{done:!0}}}}}},Tb=function(n){return{size:n,has:function(){return!0},keys:function(){throw new Error("e")}}};Cb.exports=function(n,t){var e=Mq("Set");try{new e()[n](Ab(0));try{return new e()[n](Ab(-1)),!1}catch(s){if(!t)return!0;try{return new e()[n](Tb(-1/0)),!1}catch(l){var o=new e;return o.add(1),o.add(2),t(o[n](Tb(1/0)))}}}catch(s){return!1}}});var Pb=st(()=>{"use strict";var bq=Ds(),Aq=bb(),Tq=Fu(),Cq=!Tq("difference",function(n){return n.size===0});bq({target:"Set",proto:!0,real:!0,forced:Cq},{difference:Aq})});var Lb=st((ftt,Rb)=>{"use strict";var Pq=Nu(),ry=Ks(),Iq=yc(),Rq=Du(),Lq=mc(),Nq=Ou(),Oq=ry.Set,Ib=ry.add,Dq=ry.has;Rb.exports=function(t){var e=Pq(this),o=Rq(t),s=new Oq;return Iq(e)>o.size?Nq(o.getIterator(),function(l){Dq(e,l)&&Ib(s,l)}):Lq(e,function(l){o.includes(l)&&Ib(s,l)}),s}});var Nb=st(()=>{"use strict";var Fq=Ds(),Uq=mi(),Bq=Lb(),zq=Fu(),Gq=!zq("intersection",function(n){return n.size===2&&n.has(1)&&n.has(2)})||Uq(function(){return String(Array.from(new Set([1,2,3]).intersection(new Set([3,2]))))!=="3,2"});Fq({target:"Set",proto:!0,real:!0,forced:Gq},{intersection:Bq})});var iy=st((dtt,Db)=>{"use strict";var kq=Ns(),Ob=Aa(),qq=vp();Db.exports=function(n,t,e){var o,s;Ob(n);try{if(o=qq(n,"return"),!o){if(t==="throw")throw e;return e}o=kq(o,n)}catch(l){s=!0,o=l}if(t==="throw")throw e;if(s)throw o;return Ob(o),e}});var Ub=st((gtt,Fb)=>{"use strict";var Hq=Nu(),Vq=Ks().has,Wq=yc(),Xq=Du(),Yq=mc(),$q=Ou(),Zq=iy();Fb.exports=function(t){var e=Hq(this),o=Xq(t);if(Wq(e)<=o.size)return Yq(e,function(l){if(o.includes(l))return!1},!0)!==!1;var s=o.getIterator();return $q(s,function(l){if(Vq(e,l))return Zq(s,"normal",!1)})!==!1}});var Bb=st(()=>{"use strict";var Jq=Ds(),Kq=Ub(),jq=Fu(),Qq=!jq("isDisjointFrom",function(n){return!n});Jq({target:"Set",proto:!0,real:!0,forced:Qq},{isDisjointFrom:Kq})});var Gb=st((vtt,zb)=>{"use strict";var t5=Nu(),e5=yc(),n5=mc(),r5=Du();zb.exports=function(t){var e=t5(this),o=r5(t);return e5(e)>o.size?!1:n5(e,function(s){if(!o.includes(s))return!1},!0)!==!1}});var kb=st(()=>{"use strict";var i5=Ds(),o5=Gb(),s5=Fu(),a5=!s5("isSubsetOf",function(n){return n});i5({target:"Set",proto:!0,real:!0,forced:a5},{isSubsetOf:o5})});var Hb=st((Ett,qb)=>{"use strict";var u5=Nu(),l5=Ks().has,c5=yc(),f5=Du(),h5=Ou(),p5=iy();qb.exports=function(t){var e=u5(this),o=f5(t);if(c5(e)<o.size)return!1;var s=o.getIterator();return h5(s,function(l){if(!l5(e,l))return p5(s,"normal",!1)})!==!1}});var Vb=st(()=>{"use strict";var d5=Ds(),g5=Hb(),m5=Fu(),y5=!m5("isSupersetOf",function(n){return!n});d5({target:"Set",proto:!0,real:!0,forced:y5},{isSupersetOf:g5})});var Xb=st((Mtt,Wb)=>{"use strict";var v5=Nu(),oy=Ks(),_5=Zp(),x5=Du(),E5=Ou(),w5=oy.add,S5=oy.has,M5=oy.remove;Wb.exports=function(t){var e=v5(this),o=x5(t).getIterator(),s=_5(e);return E5(o,function(l){S5(e,l)?M5(s,l):w5(s,l)}),s}});var Yb=st(()=>{"use strict";var b5=Ds(),A5=Xb(),T5=Fu();b5({target:"Set",proto:!0,real:!0,forced:!T5("symmetricDifference")},{symmetricDifference:A5})});var Zb=st((Ttt,$b)=>{"use strict";var C5=Nu(),P5=Ks().add,I5=Zp(),R5=Du(),L5=Ou();$b.exports=function(t){var e=C5(this),o=R5(t).getIterator(),s=I5(e);return L5(o,function(l){P5(s,l)}),s}});var Jb=st(()=>{"use strict";var N5=Ds(),O5=Zb(),D5=Fu();N5({target:"Set",proto:!0,real:!0,forced:!D5("union")},{union:O5})});var jb=st((Itt,Kb)=>{"use strict";var F5=uc(),U5=yi();Kb.exports=function(n){if(F5(n)==="Function")return U5(n)}});var eA=st((Rtt,tA)=>{"use strict";var Qb=jb(),B5=kf(),z5=Gf(),G5=Qb(Qb.bind);tA.exports=function(n,t){return B5(n),t===void 0?n:z5?G5(n,t):function(){return n.apply(t,arguments)}}});var iA=st((Ltt,rA)=>{"use strict";var k5=Np(),q5=Wf(),H5=T0(),V5=eA(),nA=function(n,t,e,o,s,l,p,h){for(var g=s,m=0,v=p?V5(p,h):!1,x,E;m<o;)m in e&&(x=v?v(e[m],m,t):e[m],l>0&&k5(x)?(E=q5(x),g=nA(n,t,x,E,g,l-1)-1):(H5(g+1),n[g]=x),g++),m++;return g};rA.exports=nA});var cA=st((Ntt,lA)=>{"use strict";var W5=yi(),X5=mi(),oA=Ui(),Y5=$0(),$5=fc(),Z5=v0(),sA=function(){},aA=$5("Reflect","construct"),sy=/^\\s*(?:class|function)\\b/,J5=W5(sy.exec),K5=!sy.test(sA),Kf=function(t){if(!oA(t))return!1;try{return aA(sA,[],t),!0}catch(e){return!1}},uA=function(t){if(!oA(t))return!1;switch(Y5(t)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return K5||!!J5(sy,Z5(t))}catch(e){return!0}};uA.sham=!0;lA.exports=!aA||X5(function(){var n;return Kf(Kf.call)||!Kf(Object)||!Kf(function(){n=!0})||n})?uA:Kf});var dA=st((Ott,pA)=>{"use strict";var fA=Np(),j5=cA(),Q5=$s(),tH=Os(),eH=tH("species"),hA=Array;pA.exports=function(n){var t;return fA(n)&&(t=n.constructor,j5(t)&&(t===hA||fA(t.prototype))?t=void 0:Q5(t)&&(t=t[eH],t===null&&(t=void 0))),t===void 0?hA:t}});var mA=st((Dtt,gA)=>{"use strict";var nH=dA();gA.exports=function(n,t){return new(nH(n))(t===0?0:t)}});var yA=st(()=>{"use strict";var rH=Ds(),iH=iA(),oH=hc(),sH=Wf(),aH=wl(),uH=mA();rH({target:"Array",proto:!0},{flat:function(){var t=arguments.length?arguments[0]:void 0,e=oH(this),o=sH(e),s=uH(e,0);return s.length=iH(s,e,e,o,0,t===void 0?1:aH(t)),s}})});var vA=st(()=>{"use strict";var lH=D0();lH("flat")});var xA=st((Gtt,_A)=>{var ay=class{constructor(){this.keys=new Set,this.queue=[]}sort(){this.queue.sort((t,e)=>t.priority-e.priority)}set(t,e){let o=Number(e);if(isNaN(o))throw new TypeError('"priority" must be a number');return this.keys.has(t)?this.queue.map(s=>(s.key===t&&Object.assign(s,{priority:o}),s)):(this.keys.add(t),this.queue.push({key:t,priority:o})),this.sort(),this.queue.length}next(){let t=this.queue.shift();return this.keys.delete(t.key),t}isEmpty(){return this.queue.length===0}has(t){return this.keys.has(t)}get(t){return this.queue.find(e=>e.key===t)}};_A.exports=ay});var SA=st((ktt,wA)=>{function EA(n,t){let e=new Map;for(let[o,s]of n)o!==t&&s instanceof Map?e.set(o,EA(s,t)):o!==t&&e.set(o,s);return e}wA.exports=EA});var AA=st((qtt,bA)=>{function cH(n){let t=Number(n);return!(isNaN(t)||t<=0)}function MA(n){let t=new Map;return Object.keys(n).forEach(o=>{let s=n[o];if(s!==null&&typeof s=="object"&&!Array.isArray(s))return t.set(o,MA(s));if(!cH(s))throw new Error(\`Could not add node at key "\${o}", make sure it's a valid node\`,s);return t.set(o,Number(s))}),t}bA.exports=MA});var PA=st((Htt,CA)=>{function TA(n){if(!(n instanceof Map))throw new Error(\`Invalid graph: Expected Map instead found \${typeof n}\`);n.forEach((t,e)=>{if(typeof t=="object"&&t instanceof Map){TA(t);return}if(typeof t!="number"||t<=0)throw new Error(\`Values must be numbers greater than 0. Found value \${t} at \${e}\`)})}CA.exports=TA});var NA=st((Vtt,LA)=>{var fH=xA(),hH=SA(),IA=AA(),RA=PA(),uy=class{constructor(t){t instanceof Map?(RA(t),this.graph=t):t?this.graph=IA(t):this.graph=new Map}addNode(t,e){let o;return e instanceof Map?(RA(e),o=e):o=IA(e),this.graph.set(t,o),this}addVertex(t,e){return this.addNode(t,e)}removeNode(t){return this.graph=hH(this.graph,t),this}path(t,e,o={}){if(!this.graph.size)return o.cost?{path:null,cost:0}:null;let s=new Set,l=new fH,p=new Map,h=[],g=0,m=[];if(o.avoid&&(m=[].concat(o.avoid)),m.includes(t))throw new Error(\`Starting node (\${t}) cannot be avoided\`);if(m.includes(e))throw new Error(\`Ending node (\${e}) cannot be avoided\`);for(l.set(t,0);!l.isEmpty();){let v=l.next();if(v.key===e){g=v.priority;let E=v.key;for(;p.has(E);)h.push(E),E=p.get(E);break}s.add(v.key),(this.graph.get(v.key)||new Map).forEach((E,M)=>{if(s.has(M)||m.includes(M))return null;if(!l.has(M))return p.set(M,v.key),l.set(M,v.priority+E);let A=l.get(M).priority,I=v.priority+E;return I<A?(p.set(M,v.key),l.set(M,I)):null})}return h.length?(o.trim?h.shift():h=h.concat([t]),o.reverse||(h=h.reverse()),o.cost?{path:h,cost:g}:h):o.cost?{path:null,cost:0}:null}shortestPath(...t){return this.path(...t)}};LA.exports=uy});var Xd=st((net,PC)=>{"use strict";var CC=Object.getOwnPropertySymbols,MX=Object.prototype.hasOwnProperty,bX=Object.prototype.propertyIsEnumerable;function AX(n){if(n==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(n)}function TX(){try{if(!Object.assign)return!1;var n=new String("abc");if(n[5]="de",Object.getOwnPropertyNames(n)[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 s={};return"abcdefghijklmnopqrst".split("").forEach(function(l){s[l]=l}),Object.keys(Object.assign({},s)).join("")==="abcdefghijklmnopqrst"}catch(l){return!1}}PC.exports=TX()?Object.assign:function(n,t){for(var e,o=AX(n),s,l=1;l<arguments.length;l++){e=Object(arguments[l]);for(var p in e)MX.call(e,p)&&(o[p]=e[p]);if(CC){s=CC(e);for(var h=0;h<s.length;h++)bX.call(e,s[h])&&(o[s[h]]=e[s[h]])}}return o}});var qv=st((Gv,kv)=>{(function(n,t){typeof Gv=="object"&&typeof kv!="undefined"?kv.exports=t():typeof define=="function"&&define.amd?define(t):(n=n||self).RBush=t()})(Gv,function(){"use strict";function n(S,w,R,C,F){(function V(X,q,D,xt,B){for(;xt>D;){if(xt-D>600){var j=xt-D+1,J=q-D+1,Dt=Math.log(j),Q=.5*Math.exp(2*Dt/3),At=.5*Math.sqrt(Dt*Q*(j-Q)/j)*(J-j/2<0?-1:1),Mt=Math.max(D,Math.floor(q-J*Q/j+At)),Lt=Math.min(xt,Math.floor(q+(j-J)*Q/j+At));V(X,q,Mt,Lt,B)}var pt=X[q],yt=D,K=xt;for(t(X,D,q),B(X[xt],pt)>0&&t(X,D,xt);yt<K;){for(t(X,yt,K),yt++,K--;B(X[yt],pt)<0;)yt++;for(;B(X[K],pt)>0;)K--}B(X[D],pt)===0?t(X,D,K):t(X,++K,xt),K<=q&&(D=K+1),q<=K&&(xt=K-1)}})(S,w,R||0,C||S.length-1,F||e)}function t(S,w,R){var C=S[w];S[w]=S[R],S[R]=C}function e(S,w){return S<w?-1:S>w?1:0}var o=function(S){S===void 0&&(S=9),this._maxEntries=Math.max(4,S),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()};function s(S,w,R){if(!R)return w.indexOf(S);for(var C=0;C<w.length;C++)if(R(S,w[C]))return C;return-1}function l(S,w){p(S,0,S.children.length,w,S)}function p(S,w,R,C,F){F||(F=A(null)),F.minX=1/0,F.minY=1/0,F.maxX=-1/0,F.maxY=-1/0;for(var V=w;V<R;V++){var X=S.children[V];h(F,S.leaf?C(X):X)}return F}function h(S,w){return S.minX=Math.min(S.minX,w.minX),S.minY=Math.min(S.minY,w.minY),S.maxX=Math.max(S.maxX,w.maxX),S.maxY=Math.max(S.maxY,w.maxY),S}function g(S,w){return S.minX-w.minX}function m(S,w){return S.minY-w.minY}function v(S){return(S.maxX-S.minX)*(S.maxY-S.minY)}function x(S){return S.maxX-S.minX+(S.maxY-S.minY)}function E(S,w){return S.minX<=w.minX&&S.minY<=w.minY&&w.maxX<=S.maxX&&w.maxY<=S.maxY}function M(S,w){return w.minX<=S.maxX&&w.minY<=S.maxY&&w.maxX>=S.minX&&w.maxY>=S.minY}function A(S){return{children:S,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function I(S,w,R,C,F){for(var V=[w,R];V.length;)if(!((R=V.pop())-(w=V.pop())<=C)){var X=w+Math.ceil((R-w)/C/2)*C;n(S,X,w,R,F),V.push(w,X,X,R)}}return o.prototype.all=function(){return this._all(this.data,[])},o.prototype.search=function(S){var w=this.data,R=[];if(!M(S,w))return R;for(var C=this.toBBox,F=[];w;){for(var V=0;V<w.children.length;V++){var X=w.children[V],q=w.leaf?C(X):X;M(S,q)&&(w.leaf?R.push(X):E(S,q)?this._all(X,R):F.push(X))}w=F.pop()}return R},o.prototype.collides=function(S){var w=this.data;if(!M(S,w))return!1;for(var R=[];w;){for(var C=0;C<w.children.length;C++){var F=w.children[C],V=w.leaf?this.toBBox(F):F;if(M(S,V)){if(w.leaf||E(S,V))return!0;R.push(F)}}w=R.pop()}return!1},o.prototype.load=function(S){if(!S||!S.length)return this;if(S.length<this._minEntries){for(var w=0;w<S.length;w++)this.insert(S[w]);return this}var R=this._build(S.slice(),0,S.length-1,0);if(this.data.children.length)if(this.data.height===R.height)this._splitRoot(this.data,R);else{if(this.data.height<R.height){var C=this.data;this.data=R,R=C}this._insert(R,this.data.height-R.height-1,!0)}else this.data=R;return this},o.prototype.insert=function(S){return S&&this._insert(S,this.data.height-1),this},o.prototype.clear=function(){return this.data=A([]),this},o.prototype.remove=function(S,w){if(!S)return this;for(var R,C,F,V=this.data,X=this.toBBox(S),q=[],D=[];V||q.length;){if(V||(V=q.pop(),C=q[q.length-1],R=D.pop(),F=!0),V.leaf){var xt=s(S,V.children,w);if(xt!==-1)return V.children.splice(xt,1),q.push(V),this._condense(q),this}F||V.leaf||!E(V,X)?C?(R++,V=C.children[R],F=!1):V=null:(q.push(V),D.push(R),R=0,C=V,V=V.children[0])}return this},o.prototype.toBBox=function(S){return S},o.prototype.compareMinX=function(S,w){return S.minX-w.minX},o.prototype.compareMinY=function(S,w){return S.minY-w.minY},o.prototype.toJSON=function(){return this.data},o.prototype.fromJSON=function(S){return this.data=S,this},o.prototype._all=function(S,w){for(var R=[];S;)S.leaf?w.push.apply(w,S.children):R.push.apply(R,S.children),S=R.pop();return w},o.prototype._build=function(S,w,R,C){var F,V=R-w+1,X=this._maxEntries;if(V<=X)return l(F=A(S.slice(w,R+1)),this.toBBox),F;C||(C=Math.ceil(Math.log(V)/Math.log(X)),X=Math.ceil(V/Math.pow(X,C-1))),(F=A([])).leaf=!1,F.height=C;var q=Math.ceil(V/X),D=q*Math.ceil(Math.sqrt(X));I(S,w,R,D,this.compareMinX);for(var xt=w;xt<=R;xt+=D){var B=Math.min(xt+D-1,R);I(S,xt,B,q,this.compareMinY);for(var j=xt;j<=B;j+=q){var J=Math.min(j+q-1,B);F.children.push(this._build(S,j,J,C-1))}}return l(F,this.toBBox),F},o.prototype._chooseSubtree=function(S,w,R,C){for(;C.push(w),!w.leaf&&C.length-1!==R;){for(var F=1/0,V=1/0,X=void 0,q=0;q<w.children.length;q++){var D=w.children[q],xt=v(D),B=(j=S,J=D,(Math.max(J.maxX,j.maxX)-Math.min(J.minX,j.minX))*(Math.max(J.maxY,j.maxY)-Math.min(J.minY,j.minY))-xt);B<V?(V=B,F=xt<F?xt:F,X=D):B===V&&xt<F&&(F=xt,X=D)}w=X||w.children[0]}var j,J;return w},o.prototype._insert=function(S,w,R){var C=R?S:this.toBBox(S),F=[],V=this._chooseSubtree(C,this.data,w,F);for(V.children.push(S),h(V,C);w>=0&&F[w].children.length>this._maxEntries;)this._split(F,w),w--;this._adjustParentBBoxes(C,F,w)},o.prototype._split=function(S,w){var R=S[w],C=R.children.length,F=this._minEntries;this._chooseSplitAxis(R,F,C);var V=this._chooseSplitIndex(R,F,C),X=A(R.children.splice(V,R.children.length-V));X.height=R.height,X.leaf=R.leaf,l(R,this.toBBox),l(X,this.toBBox),w?S[w-1].children.push(X):this._splitRoot(R,X)},o.prototype._splitRoot=function(S,w){this.data=A([S,w]),this.data.height=S.height+1,this.data.leaf=!1,l(this.data,this.toBBox)},o.prototype._chooseSplitIndex=function(S,w,R){for(var C,F,V,X,q,D,xt,B=1/0,j=1/0,J=w;J<=R-w;J++){var Dt=p(S,0,J,this.toBBox),Q=p(S,J,R,this.toBBox),At=(F=Dt,V=Q,X=void 0,q=void 0,D=void 0,xt=void 0,X=Math.max(F.minX,V.minX),q=Math.max(F.minY,V.minY),D=Math.min(F.maxX,V.maxX),xt=Math.min(F.maxY,V.maxY),Math.max(0,D-X)*Math.max(0,xt-q)),Mt=v(Dt)+v(Q);At<B?(B=At,C=J,j=Mt<j?Mt:j):At===B&&Mt<j&&(j=Mt,C=J)}return C||R-w},o.prototype._chooseSplitAxis=function(S,w,R){var C=S.leaf?this.compareMinX:g,F=S.leaf?this.compareMinY:m;this._allDistMargin(S,w,R,C)<this._allDistMargin(S,w,R,F)&&S.children.sort(C)},o.prototype._allDistMargin=function(S,w,R,C){S.children.sort(C);for(var F=this.toBBox,V=p(S,0,w,F),X=p(S,R-w,R,F),q=x(V)+x(X),D=w;D<R-w;D++){var xt=S.children[D];h(V,S.leaf?F(xt):xt),q+=x(V)}for(var B=R-w-1;B>=w;B--){var j=S.children[B];h(X,S.leaf?F(j):j),q+=x(X)}return q},o.prototype._adjustParentBBoxes=function(S,w,R){for(var C=R;C>=0;C--)h(w[C],S)},o.prototype._condense=function(S){for(var w=S.length-1,R=void 0;w>=0;w--)S[w].children.length===0?w>0?(R=S[w-1].children).splice(R.indexOf(S[w]),1):this.clear():l(S[w],this.toBBox)},o})});var IC=st((Hv,Vv)=>{(function(n,t){typeof Hv=="object"&&typeof Vv!="undefined"?Vv.exports=t():typeof define=="function"&&define.amd?define(t):(n=n||self,n.TinyQueue=t())})(Hv,function(){"use strict";var n=function(o,s){if(o===void 0&&(o=[]),s===void 0&&(s=t),this.data=o,this.length=this.data.length,this.compare=s,this.length>0)for(var l=(this.length>>1)-1;l>=0;l--)this._down(l)};n.prototype.push=function(o){this.data.push(o),this.length++,this._up(this.length-1)},n.prototype.pop=function(){if(this.length!==0){var o=this.data[0],s=this.data.pop();return this.length--,this.length>0&&(this.data[0]=s,this._down(0)),o}},n.prototype.peek=function(){return this.data[0]},n.prototype._up=function(o){for(var s=this,l=s.data,p=s.compare,h=l[o];o>0;){var g=o-1>>1,m=l[g];if(p(h,m)>=0)break;l[o]=m,o=g}l[o]=h},n.prototype._down=function(o){for(var s=this,l=s.data,p=s.compare,h=this.length>>1,g=l[o];o<h;){var m=(o<<1)+1,v=l[m],x=m+1;if(x<this.length&&p(l[x],v)<0&&(m=x,v=l[x]),p(v,g)>=0)break;l[o]=v,o=m}l[o]=g};function t(e,o){return e<o?-1:e>o?1:0}return n})});var LC=st((uet,RC)=>{RC.exports=function(t,e,o,s){var l=t[0],p=t[1],h=!1;o===void 0&&(o=0),s===void 0&&(s=e.length);for(var g=(s-o)/2,m=0,v=g-1;m<g;v=m++){var x=e[o+m*2+0],E=e[o+m*2+1],M=e[o+v*2+0],A=e[o+v*2+1],I=E>p!=A>p&&l<(M-x)*(p-E)/(A-E)+x;I&&(h=!h)}return h}});var OC=st((cet,NC)=>{NC.exports=function(t,e,o,s){var l=t[0],p=t[1],h=!1;o===void 0&&(o=0),s===void 0&&(s=e.length);for(var g=s-o,m=0,v=g-1;m<g;v=m++){var x=e[m+o][0],E=e[m+o][1],M=e[v+o][0],A=e[v+o][1],I=E>p!=A>p&&l<(M-x)*(p-E)/(A-E)+x;I&&(h=!h)}return h}});var UC=st((fet,Zd)=>{var DC=LC(),FC=OC();Zd.exports=function(t,e,o,s){return e.length>0&&Array.isArray(e[0])?FC(t,e,o,s):DC(t,e,o,s)};Zd.exports.nested=FC;Zd.exports.flat=DC});var zC=st((Jd,BC)=>{(function(n,t){typeof Jd=="object"&&typeof BC!="undefined"?t(Jd):typeof define=="function"&&define.amd?define(["exports"],t):t((n=n||self).predicates={})})(Jd,function(n){"use strict";let e=33306690738754706e-32;function o(M,A,I,S,w){let R,C,F,V,X=A[0],q=S[0],D=0,xt=0;q>X==q>-X?(R=X,X=A[++D]):(R=q,q=S[++xt]);let B=0;if(D<M&&xt<I)for(q>X==q>-X?(F=R-((C=X+R)-X),X=A[++D]):(F=R-((C=q+R)-q),q=S[++xt]),R=C,F!==0&&(w[B++]=F);D<M&&xt<I;)q>X==q>-X?(F=R-((C=R+X)-(V=C-R))+(X-V),X=A[++D]):(F=R-((C=R+q)-(V=C-R))+(q-V),q=S[++xt]),R=C,F!==0&&(w[B++]=F);for(;D<M;)F=R-((C=R+X)-(V=C-R))+(X-V),X=A[++D],R=C,F!==0&&(w[B++]=F);for(;xt<I;)F=R-((C=R+q)-(V=C-R))+(q-V),q=S[++xt],R=C,F!==0&&(w[B++]=F);return R===0&&B!==0||(w[B++]=R),B}function s(M){return new Float64Array(M)}let l=33306690738754716e-32,p=22204460492503146e-32,h=11093356479670487e-47,g=s(4),m=s(8),v=s(12),x=s(16),E=s(4);n.orient2d=function(M,A,I,S,w,R){let C=(A-R)*(I-w),F=(M-w)*(S-R),V=C-F;if(C===0||F===0||C>0!=F>0)return V;let X=Math.abs(C+F);return Math.abs(V)>=l*X?V:-function(q,D,xt,B,j,J,Dt){let Q,At,Mt,Lt,pt,yt,K,Bt,Gt,ae,ut,Ut,jt,ce,te,$t,qt,xe,ft=q-j,We=xt-j,ee=D-J,ge=B-J;pt=(te=(Bt=ft-(K=(yt=134217729*ft)-(yt-ft)))*(ae=ge-(Gt=(yt=134217729*ge)-(yt-ge)))-((ce=ft*ge)-K*Gt-Bt*Gt-K*ae))-(ut=te-(qt=(Bt=ee-(K=(yt=134217729*ee)-(yt-ee)))*(ae=We-(Gt=(yt=134217729*We)-(yt-We)))-(($t=ee*We)-K*Gt-Bt*Gt-K*ae))),g[0]=te-(ut+pt)+(pt-qt),pt=(jt=ce-((Ut=ce+ut)-(pt=Ut-ce))+(ut-pt))-(ut=jt-$t),g[1]=jt-(ut+pt)+(pt-$t),pt=(xe=Ut+ut)-Ut,g[2]=Ut-(xe-pt)+(ut-pt),g[3]=xe;let fe=function(tt,z){let Pt=z[0];for(let Ot=1;Ot<tt;Ot++)Pt+=z[Ot];return Pt}(4,g),Te=p*Dt;if(fe>=Te||-fe>=Te||(Q=q-(ft+(pt=q-ft))+(pt-j),Mt=xt-(We+(pt=xt-We))+(pt-j),At=D-(ee+(pt=D-ee))+(pt-J),Lt=B-(ge+(pt=B-ge))+(pt-J),Q===0&&At===0&&Mt===0&&Lt===0)||(Te=h*Dt+e*Math.abs(fe),(fe+=ft*Lt+ge*Q-(ee*Mt+We*At))>=Te||-fe>=Te))return fe;pt=(te=(Bt=Q-(K=(yt=134217729*Q)-(yt-Q)))*(ae=ge-(Gt=(yt=134217729*ge)-(yt-ge)))-((ce=Q*ge)-K*Gt-Bt*Gt-K*ae))-(ut=te-(qt=(Bt=At-(K=(yt=134217729*At)-(yt-At)))*(ae=We-(Gt=(yt=134217729*We)-(yt-We)))-(($t=At*We)-K*Gt-Bt*Gt-K*ae))),E[0]=te-(ut+pt)+(pt-qt),pt=(jt=ce-((Ut=ce+ut)-(pt=Ut-ce))+(ut-pt))-(ut=jt-$t),E[1]=jt-(ut+pt)+(pt-$t),pt=(xe=Ut+ut)-Ut,E[2]=Ut-(xe-pt)+(ut-pt),E[3]=xe;let be=o(4,g,4,E,m);pt=(te=(Bt=ft-(K=(yt=134217729*ft)-(yt-ft)))*(ae=Lt-(Gt=(yt=134217729*Lt)-(yt-Lt)))-((ce=ft*Lt)-K*Gt-Bt*Gt-K*ae))-(ut=te-(qt=(Bt=ee-(K=(yt=134217729*ee)-(yt-ee)))*(ae=Mt-(Gt=(yt=134217729*Mt)-(yt-Mt)))-(($t=ee*Mt)-K*Gt-Bt*Gt-K*ae))),E[0]=te-(ut+pt)+(pt-qt),pt=(jt=ce-((Ut=ce+ut)-(pt=Ut-ce))+(ut-pt))-(ut=jt-$t),E[1]=jt-(ut+pt)+(pt-$t),pt=(xe=Ut+ut)-Ut,E[2]=Ut-(xe-pt)+(ut-pt),E[3]=xe;let Wt=o(be,m,4,E,v);pt=(te=(Bt=Q-(K=(yt=134217729*Q)-(yt-Q)))*(ae=Lt-(Gt=(yt=134217729*Lt)-(yt-Lt)))-((ce=Q*Lt)-K*Gt-Bt*Gt-K*ae))-(ut=te-(qt=(Bt=At-(K=(yt=134217729*At)-(yt-At)))*(ae=Mt-(Gt=(yt=134217729*Mt)-(yt-Mt)))-(($t=At*Mt)-K*Gt-Bt*Gt-K*ae))),E[0]=te-(ut+pt)+(pt-qt),pt=(jt=ce-((Ut=ce+ut)-(pt=Ut-ce))+(ut-pt))-(ut=jt-$t),E[1]=jt-(ut+pt)+(pt-$t),pt=(xe=Ut+ut)-Ut,E[2]=Ut-(xe-pt)+(ut-pt),E[3]=xe;let Me=o(Wt,v,4,E,x);return x[Me-1]}(M,A,I,S,w,R,X)},n.orient2dfast=function(M,A,I,S,w,R){return(A-R)*(I-w)-(M-w)*(S-R)},Object.defineProperty(n,"__esModule",{value:!0})})});var WC=st((het,$v)=>{"use strict";var GC=qv(),jd=IC(),PX=UC(),IX=zC().orient2d;jd.default&&(jd=jd.default);$v.exports=VC;$v.exports.default=VC;function VC(n,t,e){t=Math.max(0,t===void 0?2:t),e=e||0;var o=DX(n),s=new GC(16);s.toBBox=function(R){return{minX:R[0],minY:R[1],maxX:R[0],maxY:R[1]}},s.compareMinX=function(R,C){return R[0]-C[0]},s.compareMinY=function(R,C){return R[1]-C[1]},s.load(n);for(var l=[],p=0,h;p<o.length;p++){var g=o[p];s.remove(g),h=HC(g,h),l.push(h)}var m=new GC(16);for(p=0;p<l.length;p++)m.insert(Wv(l[p]));for(var v=t*t,x=e*e;l.length;){var E=l.shift(),M=E.p,A=E.next.p,I=Xv(M,A);if(!(I<x)){var S=I/v;g=RX(s,E.prev.p,M,A,E.next.next.p,S,m),g&&Math.min(Xv(g,M),Xv(g,A))<=S&&(l.push(E),l.push(HC(g,E)),s.remove(g),m.remove(E),m.insert(Wv(E)),m.insert(Wv(E.next)))}}E=h;var w=[];do w.push(E.p),E=E.next;while(E!==h);return w.push(E.p),w}function RX(n,t,e,o,s,l,p){for(var h=new jd([],LX),g=n.data;g;){for(var m=0;m<g.children.length;m++){var v=g.children[m],x=g.leaf?Yv(v,e,o):NX(e,o,v);x>l||h.push({node:v,dist:x})}for(;h.length&&!h.peek().node.children;){var E=h.pop(),M=E.node,A=Yv(M,t,e),I=Yv(M,o,s);if(E.dist<A&&E.dist<I&&qC(e,M,p)&&qC(o,M,p))return M}g=h.pop(),g&&(g=g.node)}return null}function LX(n,t){return n.dist-t.dist}function NX(n,t,e){if(kC(n,e)||kC(t,e))return 0;var o=Kd(n[0],n[1],t[0],t[1],e.minX,e.minY,e.maxX,e.minY);if(o===0)return 0;var s=Kd(n[0],n[1],t[0],t[1],e.minX,e.minY,e.minX,e.maxY);if(s===0)return 0;var l=Kd(n[0],n[1],t[0],t[1],e.maxX,e.minY,e.maxX,e.maxY);if(l===0)return 0;var p=Kd(n[0],n[1],t[0],t[1],e.minX,e.maxY,e.maxX,e.maxY);return p===0?0:Math.min(o,s,l,p)}function kC(n,t){return n[0]>=t.minX&&n[0]<=t.maxX&&n[1]>=t.minY&&n[1]<=t.maxY}function qC(n,t,e){for(var o=Math.min(n[0],t[0]),s=Math.min(n[1],t[1]),l=Math.max(n[0],t[0]),p=Math.max(n[1],t[1]),h=e.search({minX:o,minY:s,maxX:l,maxY:p}),g=0;g<h.length;g++)if(OX(h[g].p,h[g].next.p,n,t))return!1;return!0}function Zc(n,t,e){return IX(n[0],n[1],t[0],t[1],e[0],e[1])}function OX(n,t,e,o){return n!==o&&t!==e&&Zc(n,t,e)>0!=Zc(n,t,o)>0&&Zc(e,o,n)>0!=Zc(e,o,t)>0}function Wv(n){var t=n.p,e=n.next.p;return n.minX=Math.min(t[0],e[0]),n.minY=Math.min(t[1],e[1]),n.maxX=Math.max(t[0],e[0]),n.maxY=Math.max(t[1],e[1]),n}function DX(n){for(var t=n[0],e=n[0],o=n[0],s=n[0],l=0;l<n.length;l++){var p=n[l];p[0]<t[0]&&(t=p),p[0]>o[0]&&(o=p),p[1]<e[1]&&(e=p),p[1]>s[1]&&(s=p)}var h=[t,e,o,s],g=h.slice();for(l=0;l<n.length;l++)PX(n[l],h)||g.push(n[l]);return UX(g)}function HC(n,t){var e={p:n,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 Xv(n,t){var e=n[0]-t[0],o=n[1]-t[1];return e*e+o*o}function Yv(n,t,e){var o=t[0],s=t[1],l=e[0]-o,p=e[1]-s;if(l!==0||p!==0){var h=((n[0]-o)*l+(n[1]-s)*p)/(l*l+p*p);h>1?(o=e[0],s=e[1]):h>0&&(o+=l*h,s+=p*h)}return l=n[0]-o,p=n[1]-s,l*l+p*p}function Kd(n,t,e,o,s,l,p,h){var g=e-n,m=o-t,v=p-s,x=h-l,E=n-s,M=t-l,A=g*g+m*m,I=g*v+m*x,S=v*v+x*x,w=g*E+m*M,R=v*E+x*M,C=A*S-I*I,F,V,X,q,D=C,xt=C;C===0?(V=0,D=1,q=R,xt=S):(V=I*R-S*w,q=A*R-I*w,V<0?(V=0,q=R,xt=S):V>D&&(V=D,q=R+I,xt=S)),q<0?(q=0,-w<0?V=0:-w>A?V=D:(V=-w,D=A)):q>xt&&(q=xt,-w+I<0?V=0:-w+I>A?V=D:(V=-w+I,D=A)),F=V===0?0:V/D,X=q===0?0:q/xt;var B=(1-F)*n+F*e,j=(1-F)*t+F*o,J=(1-X)*s+X*p,Dt=(1-X)*l+X*h,Q=J-B,At=Dt-j;return Q*Q+At*At}function FX(n,t){return n[0]===t[0]?n[1]-t[1]:n[0]-t[0]}function UX(n){n.sort(FX);for(var t=[],e=0;e<n.length;e++){for(;t.length>=2&&Zc(t[t.length-2],t[t.length-1],n[e])<=0;)t.pop();t.push(n[e])}for(var o=[],s=n.length-1;s>=0;s--){for(;o.length>=2&&Zc(o[o.length-2],o[o.length-1],n[s])<=0;)o.pop();o.push(n[s])}return o.pop(),t.pop(),t.concat(o)}});var KC=st((Jv,Kv)=>{(function(n,t){typeof Jv=="object"&&typeof Kv!="undefined"?Kv.exports=t():typeof define=="function"&&define.amd?define(t):n.quickselect=t()})(Jv,function(){"use strict";function n(s,l,p,h,g){t(s,l,p||0,h||s.length-1,g||o)}function t(s,l,p,h,g){for(;h>p;){if(h-p>600){var m=h-p+1,v=l-p+1,x=Math.log(m),E=.5*Math.exp(2*x/3),M=.5*Math.sqrt(x*E*(m-E)/m)*(v-m/2<0?-1:1),A=Math.max(p,Math.floor(l-v*E/m+M)),I=Math.min(h,Math.floor(l+(m-v)*E/m+M));t(s,l,A,I,g)}var S=s[l],w=p,R=h;for(e(s,p,l),g(s[h],S)>0&&e(s,p,h);w<R;){for(e(s,w,R),w++,R--;g(s[w],S)<0;)w++;for(;g(s[R],S)>0;)R--}g(s[p],S)===0?e(s,p,R):(R++,e(s,R,h)),R<=l&&(p=R+1),l<=R&&(h=R-1)}}function e(s,l,p){var h=s[l];s[l]=s[p],s[p]=h}function o(s,l){return s<l?-1:s>l?1:0}return n})});var e_=st((zrt,t_)=>{"use strict";t_.exports=ph;t_.exports.default=ph;var JX=KC();function ph(n,t){if(!(this instanceof ph))return new ph(n,t);this._maxEntries=Math.max(4,n||9),this._minEntries=Math.max(2,Math.ceil(this._maxEntries*.4)),t&&this._initFormat(t),this.clear()}ph.prototype={all:function(){return this._all(this.data,[])},search:function(n){var t=this.data,e=[],o=this.toBBox;if(!tg(n,t))return e;for(var s=[],l,p,h,g;t;){for(l=0,p=t.children.length;l<p;l++)h=t.children[l],g=t.leaf?o(h):h,tg(n,g)&&(t.leaf?e.push(h):Qv(n,g)?this._all(h,e):s.push(h));t=s.pop()}return e},collides:function(n){var t=this.data,e=this.toBBox;if(!tg(n,t))return!1;for(var o=[],s,l,p,h;t;){for(s=0,l=t.children.length;s<l;s++)if(p=t.children[s],h=t.leaf?e(p):p,tg(n,h)){if(t.leaf||Qv(n,h))return!0;o.push(p)}t=o.pop()}return!1},load:function(n){if(!(n&&n.length))return this;if(n.length<this._minEntries){for(var t=0,e=n.length;t<e;t++)this.insert(n[t]);return this}var o=this._build(n.slice(),0,n.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 s=this.data;this.data=o,o=s}this._insert(o,this.data.height-o.height-1,!0)}return this},insert:function(n){return n&&this._insert(n,this.data.height-1),this},clear:function(){return this.data=jc([]),this},remove:function(n,t){if(!n)return this;for(var e=this.data,o=this.toBBox(n),s=[],l=[],p,h,g,m;e||s.length;){if(e||(e=s.pop(),h=s[s.length-1],p=l.pop(),m=!0),e.leaf&&(g=KX(n,e.children,t),g!==-1))return e.children.splice(g,1),s.push(e),this._condense(s),this;!m&&!e.leaf&&Qv(e,o)?(s.push(e),l.push(p),p=0,h=e,e=e.children[0]):h?(p++,e=h.children[p],m=!1):e=null}return this},toBBox:function(n){return n},compareMinX:jC,compareMinY:QC,toJSON:function(){return this.data},fromJSON:function(n){return this.data=n,this},_all:function(n,t){for(var e=[];n;)n.leaf?t.push.apply(t,n.children):e.push.apply(e,n.children),n=e.pop();return t},_build:function(n,t,e,o){var s=e-t+1,l=this._maxEntries,p;if(s<=l)return p=jc(n.slice(t,e+1)),Kc(p,this.toBBox),p;o||(o=Math.ceil(Math.log(s)/Math.log(l)),l=Math.ceil(s/Math.pow(l,o-1))),p=jc([]),p.leaf=!1,p.height=o;var h=Math.ceil(s/l),g=h*Math.ceil(Math.sqrt(l)),m,v,x,E;for(tP(n,t,e,g,this.compareMinX),m=t;m<=e;m+=g)for(x=Math.min(m+g-1,e),tP(n,m,x,h,this.compareMinY),v=m;v<=x;v+=h)E=Math.min(v+h-1,x),p.children.push(this._build(n,v,E,o-1));return Kc(p,this.toBBox),p},_chooseSubtree:function(n,t,e,o){for(var s,l,p,h,g,m,v,x;o.push(t),!(t.leaf||o.length-1===e);){for(v=x=1/0,s=0,l=t.children.length;s<l;s++)p=t.children[s],g=jv(p),m=jX(n,p)-g,m<x?(x=m,v=g<v?g:v,h=p):m===x&&g<v&&(v=g,h=p);t=h||t.children[0]}return t},_insert:function(n,t,e){var o=this.toBBox,s=e?n:o(n),l=[],p=this._chooseSubtree(s,this.data,t,l);for(p.children.push(n),hh(p,s);t>=0&&l[t].children.length>this._maxEntries;)this._split(l,t),t--;this._adjustParentBBoxes(s,l,t)},_split:function(n,t){var e=n[t],o=e.children.length,s=this._minEntries;this._chooseSplitAxis(e,s,o);var l=this._chooseSplitIndex(e,s,o),p=jc(e.children.splice(l,e.children.length-l));p.height=e.height,p.leaf=e.leaf,Kc(e,this.toBBox),Kc(p,this.toBBox),t?n[t-1].children.push(p):this._splitRoot(e,p)},_splitRoot:function(n,t){this.data=jc([n,t]),this.data.height=n.height+1,this.data.leaf=!1,Kc(this.data,this.toBBox)},_chooseSplitIndex:function(n,t,e){var o,s,l,p,h,g,m,v;for(g=m=1/0,o=t;o<=e-t;o++)s=fh(n,0,o,this.toBBox),l=fh(n,o,e,this.toBBox),p=QX(s,l),h=jv(s)+jv(l),p<g?(g=p,v=o,m=h<m?h:m):p===g&&h<m&&(m=h,v=o);return v},_chooseSplitAxis:function(n,t,e){var o=n.leaf?this.compareMinX:jC,s=n.leaf?this.compareMinY:QC,l=this._allDistMargin(n,t,e,o),p=this._allDistMargin(n,t,e,s);l<p&&n.children.sort(o)},_allDistMargin:function(n,t,e,o){n.children.sort(o);var s=this.toBBox,l=fh(n,0,t,s),p=fh(n,e-t,e,s),h=Qd(l)+Qd(p),g,m;for(g=t;g<e-t;g++)m=n.children[g],hh(l,n.leaf?s(m):m),h+=Qd(l);for(g=e-t-1;g>=t;g--)m=n.children[g],hh(p,n.leaf?s(m):m),h+=Qd(p);return h},_adjustParentBBoxes:function(n,t,e){for(var o=e;o>=0;o--)hh(t[o],n)},_condense:function(n){for(var t=n.length-1,e;t>=0;t--)n[t].children.length===0?t>0?(e=n[t-1].children,e.splice(e.indexOf(n[t]),1)):this.clear():Kc(n[t],this.toBBox)},_initFormat:function(n){var t=["return a"," - b",";"];this.compareMinX=new Function("a","b",t.join(n[0])),this.compareMinY=new Function("a","b",t.join(n[1])),this.toBBox=new Function("a","return {minX: a"+n[0]+", minY: a"+n[1]+", maxX: a"+n[2]+", maxY: a"+n[3]+"};")}};function KX(n,t,e){if(!e)return t.indexOf(n);for(var o=0;o<t.length;o++)if(e(n,t[o]))return o;return-1}function Kc(n,t){fh(n,0,n.children.length,t,n)}function fh(n,t,e,o,s){s||(s=jc(null)),s.minX=1/0,s.minY=1/0,s.maxX=-1/0,s.maxY=-1/0;for(var l=t,p;l<e;l++)p=n.children[l],hh(s,n.leaf?o(p):p);return s}function hh(n,t){return n.minX=Math.min(n.minX,t.minX),n.minY=Math.min(n.minY,t.minY),n.maxX=Math.max(n.maxX,t.maxX),n.maxY=Math.max(n.maxY,t.maxY),n}function jC(n,t){return n.minX-t.minX}function QC(n,t){return n.minY-t.minY}function jv(n){return(n.maxX-n.minX)*(n.maxY-n.minY)}function Qd(n){return n.maxX-n.minX+(n.maxY-n.minY)}function jX(n,t){return(Math.max(t.maxX,n.maxX)-Math.min(t.minX,n.minX))*(Math.max(t.maxY,n.maxY)-Math.min(t.minY,n.minY))}function QX(n,t){var e=Math.max(n.minX,t.minX),o=Math.max(n.minY,t.minY),s=Math.min(n.maxX,t.maxX),l=Math.min(n.maxY,t.maxY);return Math.max(0,s-e)*Math.max(0,l-o)}function Qv(n,t){return n.minX<=t.minX&&n.minY<=t.minY&&t.maxX<=n.maxX&&t.maxY<=n.maxY}function tg(n,t){return t.minX<=n.maxX&&t.minY<=n.maxY&&t.maxX>=n.minX&&t.maxY>=n.minY}function jc(n){return{children:n,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function tP(n,t,e,o,s){for(var l=[t,e],p;l.length;)e=l.pop(),t=l.pop(),!(e-t<=o)&&(p=t+Math.ceil((e-t)/o/2)*o,JX(n,p,t,e,s),l.push(t,p,p,e))}});var sP=st((jit,a_)=>{"use strict";a_.exports=ig;a_.exports.default=ig;function ig(n,t,e){e=e||2;var o=t&&t.length,s=o?t[0]*e:n.length,l=rP(n,0,s,e,!0),p=[];if(!l||l.next===l.prev)return p;var h,g,m,v,x,E,M;if(o&&(l=l7(n,t,l,e)),n.length>80*e){h=m=n[0],g=v=n[1];for(var A=e;A<s;A+=e)x=n[A],E=n[A+1],x<h&&(h=x),E<g&&(g=E),x>m&&(m=x),E>v&&(v=E);M=Math.max(m-h,v-g),M=M!==0?32767/M:0}return mh(l,p,e,h,g,M,0),p}function rP(n,t,e,o,s){var l,p;if(s===s_(n,t,e,o)>0)for(l=t;l<e;l+=o)p=nP(l,n[l],n[l+1],p);else for(l=e-o;l>=t;l-=o)p=nP(l,n[l],n[l+1],p);return p&&og(p,p.next)&&(vh(p),p=p.next),p}function kl(n,t){if(!n)return n;t||(t=n);var e=n,o;do if(o=!1,!e.steiner&&(og(e,e.next)||Hr(e.prev,e,e.next)===0)){if(vh(e),e=t=e.prev,e===e.next)break;o=!0}else e=e.next;while(o||e!==t);return t}function mh(n,t,e,o,s,l,p){if(n){!p&&l&&d7(n,o,s,l);for(var h=n,g,m;n.prev!==n.next;){if(g=n.prev,m=n.next,l?s7(n,o,s,l):o7(n)){t.push(g.i/e|0),t.push(n.i/e|0),t.push(m.i/e|0),vh(n),n=m.next,h=m.next;continue}if(n=m,n===h){p?p===1?(n=a7(kl(n),t,e),mh(n,t,e,o,s,l,2)):p===2&&u7(n,t,e,o,s,l):mh(kl(n),t,e,o,s,l,1);break}}}}function o7(n){var t=n.prev,e=n,o=n.next;if(Hr(t,e,o)>=0)return!1;for(var s=t.x,l=e.x,p=o.x,h=t.y,g=e.y,m=o.y,v=s<l?s<p?s:p:l<p?l:p,x=h<g?h<m?h:m:g<m?g:m,E=s>l?s>p?s:p:l>p?l:p,M=h>g?h>m?h:m:g>m?g:m,A=o.next;A!==t;){if(A.x>=v&&A.x<=E&&A.y>=x&&A.y<=M&&ef(s,h,l,g,p,m,A.x,A.y)&&Hr(A.prev,A,A.next)>=0)return!1;A=A.next}return!0}function s7(n,t,e,o){var s=n.prev,l=n,p=n.next;if(Hr(s,l,p)>=0)return!1;for(var h=s.x,g=l.x,m=p.x,v=s.y,x=l.y,E=p.y,M=h<g?h<m?h:m:g<m?g:m,A=v<x?v<E?v:E:x<E?x:E,I=h>g?h>m?h:m:g>m?g:m,S=v>x?v>E?v:E:x>E?x:E,w=i_(M,A,t,e,o),R=i_(I,S,t,e,o),C=n.prevZ,F=n.nextZ;C&&C.z>=w&&F&&F.z<=R;){if(C.x>=M&&C.x<=I&&C.y>=A&&C.y<=S&&C!==s&&C!==p&&ef(h,v,g,x,m,E,C.x,C.y)&&Hr(C.prev,C,C.next)>=0||(C=C.prevZ,F.x>=M&&F.x<=I&&F.y>=A&&F.y<=S&&F!==s&&F!==p&&ef(h,v,g,x,m,E,F.x,F.y)&&Hr(F.prev,F,F.next)>=0))return!1;F=F.nextZ}for(;C&&C.z>=w;){if(C.x>=M&&C.x<=I&&C.y>=A&&C.y<=S&&C!==s&&C!==p&&ef(h,v,g,x,m,E,C.x,C.y)&&Hr(C.prev,C,C.next)>=0)return!1;C=C.prevZ}for(;F&&F.z<=R;){if(F.x>=M&&F.x<=I&&F.y>=A&&F.y<=S&&F!==s&&F!==p&&ef(h,v,g,x,m,E,F.x,F.y)&&Hr(F.prev,F,F.next)>=0)return!1;F=F.nextZ}return!0}function a7(n,t,e){var o=n;do{var s=o.prev,l=o.next.next;!og(s,l)&&iP(s,o,o.next,l)&&yh(s,l)&&yh(l,s)&&(t.push(s.i/e|0),t.push(o.i/e|0),t.push(l.i/e|0),vh(o),vh(o.next),o=n=l),o=o.next}while(o!==n);return kl(o)}function u7(n,t,e,o,s,l){var p=n;do{for(var h=p.next.next;h!==p.prev;){if(p.i!==h.i&&y7(p,h)){var g=oP(p,h);p=kl(p,p.next),g=kl(g,g.next),mh(p,t,e,o,s,l,0),mh(g,t,e,o,s,l,0);return}h=h.next}p=p.next}while(p!==n)}function l7(n,t,e,o){var s=[],l,p,h,g,m;for(l=0,p=t.length;l<p;l++)h=t[l]*o,g=l<p-1?t[l+1]*o:n.length,m=rP(n,h,g,o,!1),m===m.next&&(m.steiner=!0),s.push(m7(m));for(s.sort(c7),l=0;l<s.length;l++)e=f7(s[l],e);return e}function c7(n,t){return n.x-t.x}function f7(n,t){var e=h7(n,t);if(!e)return t;var o=oP(e,n);return kl(o,o.next),kl(e,e.next)}function h7(n,t){var e=t,o=n.x,s=n.y,l=-1/0,p;do{if(s<=e.y&&s>=e.next.y&&e.next.y!==e.y){var h=e.x+(s-e.y)*(e.next.x-e.x)/(e.next.y-e.y);if(h<=o&&h>l&&(l=h,p=e.x<e.next.x?e:e.next,h===o))return p}e=e.next}while(e!==t);if(!p)return null;var g=p,m=p.x,v=p.y,x=1/0,E;e=p;do o>=e.x&&e.x>=m&&o!==e.x&&ef(s<v?o:l,s,m,v,s<v?l:o,s,e.x,e.y)&&(E=Math.abs(s-e.y)/(o-e.x),yh(e,n)&&(E<x||E===x&&(e.x>p.x||e.x===p.x&&p7(p,e)))&&(p=e,x=E)),e=e.next;while(e!==g);return p}function p7(n,t){return Hr(n.prev,n,t.prev)<0&&Hr(t.next,n,n.next)<0}function d7(n,t,e,o){var s=n;do s.z===0&&(s.z=i_(s.x,s.y,t,e,o)),s.prevZ=s.prev,s.nextZ=s.next,s=s.next;while(s!==n);s.prevZ.nextZ=null,s.prevZ=null,g7(s)}function g7(n){var t,e,o,s,l,p,h,g,m=1;do{for(e=n,n=null,l=null,p=0;e;){for(p++,o=e,h=0,t=0;t<m&&(h++,o=o.nextZ,!!o);t++);for(g=m;h>0||g>0&&o;)h!==0&&(g===0||!o||e.z<=o.z)?(s=e,e=e.nextZ,h--):(s=o,o=o.nextZ,g--),l?l.nextZ=s:n=s,s.prevZ=l,l=s;e=o}l.nextZ=null,m*=2}while(p>1);return n}function i_(n,t,e,o,s){return n=(n-e)*s|0,t=(t-o)*s|0,n=(n|n<<8)&16711935,n=(n|n<<4)&252645135,n=(n|n<<2)&858993459,n=(n|n<<1)&1431655765,t=(t|t<<8)&16711935,t=(t|t<<4)&252645135,t=(t|t<<2)&858993459,t=(t|t<<1)&1431655765,n|t<<1}function m7(n){var t=n,e=n;do(t.x<e.x||t.x===e.x&&t.y<e.y)&&(e=t),t=t.next;while(t!==n);return e}function ef(n,t,e,o,s,l,p,h){return(s-p)*(t-h)>=(n-p)*(l-h)&&(n-p)*(o-h)>=(e-p)*(t-h)&&(e-p)*(l-h)>=(s-p)*(o-h)}function y7(n,t){return n.next.i!==t.i&&n.prev.i!==t.i&&!v7(n,t)&&(yh(n,t)&&yh(t,n)&&_7(n,t)&&(Hr(n.prev,n,t.prev)||Hr(n,t.prev,t))||og(n,t)&&Hr(n.prev,n,n.next)>0&&Hr(t.prev,t,t.next)>0)}function Hr(n,t,e){return(t.y-n.y)*(e.x-t.x)-(t.x-n.x)*(e.y-t.y)}function og(n,t){return n.x===t.x&&n.y===t.y}function iP(n,t,e,o){var s=rg(Hr(n,t,e)),l=rg(Hr(n,t,o)),p=rg(Hr(e,o,n)),h=rg(Hr(e,o,t));return!!(s!==l&&p!==h||s===0&&ng(n,e,t)||l===0&&ng(n,o,t)||p===0&&ng(e,n,o)||h===0&&ng(e,t,o))}function ng(n,t,e){return t.x<=Math.max(n.x,e.x)&&t.x>=Math.min(n.x,e.x)&&t.y<=Math.max(n.y,e.y)&&t.y>=Math.min(n.y,e.y)}function rg(n){return n>0?1:n<0?-1:0}function v7(n,t){var e=n;do{if(e.i!==n.i&&e.next.i!==n.i&&e.i!==t.i&&e.next.i!==t.i&&iP(e,e.next,n,t))return!0;e=e.next}while(e!==n);return!1}function yh(n,t){return Hr(n.prev,n,n.next)<0?Hr(n,t,n.next)>=0&&Hr(n,n.prev,t)>=0:Hr(n,t,n.prev)<0||Hr(n,n.next,t)<0}function _7(n,t){var e=n,o=!1,s=(n.x+t.x)/2,l=(n.y+t.y)/2;do e.y>l!=e.next.y>l&&e.next.y!==e.y&&s<(e.next.x-e.x)*(l-e.y)/(e.next.y-e.y)+e.x&&(o=!o),e=e.next;while(e!==n);return o}function oP(n,t){var e=new o_(n.i,n.x,n.y),o=new o_(t.i,t.x,t.y),s=n.next,l=t.prev;return n.next=t,t.prev=n,e.next=s,s.prev=e,o.next=e,e.prev=o,l.next=o,o.prev=l,o}function nP(n,t,e,o){var s=new o_(n,t,e);return o?(s.next=o.next,s.prev=o,o.next.prev=s,o.next=s):(s.prev=s,s.next=s),s}function vh(n){n.next.prev=n.prev,n.prev.next=n.next,n.prevZ&&(n.prevZ.nextZ=n.nextZ),n.nextZ&&(n.nextZ.prevZ=n.prevZ)}function o_(n,t,e){this.i=n,this.x=t,this.y=e,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}ig.deviation=function(n,t,e,o){var s=t&&t.length,l=s?t[0]*e:n.length,p=Math.abs(s_(n,0,l,e));if(s)for(var h=0,g=t.length;h<g;h++){var m=t[h]*e,v=h<g-1?t[h+1]*e:n.length;p-=Math.abs(s_(n,m,v,e))}var x=0;for(h=0;h<o.length;h+=3){var E=o[h]*e,M=o[h+1]*e,A=o[h+2]*e;x+=Math.abs((n[E]-n[A])*(n[M+1]-n[E+1])-(n[E]-n[M])*(n[A+1]-n[E+1]))}return p===0&&x===0?0:Math.abs((x-p)/p)};function s_(n,t,e,o){for(var s=0,l=t,p=e-o;l<e;l+=o)s+=(n[p]-n[l])*(n[l+1]+n[p+1]),p=l;return s}ig.flatten=function(n){for(var t=n[0][0].length,e={vertices:[],holes:[],dimensions:t},o=0,s=0;s<n.length;s++){for(var l=0;l<n[s].length;l++)for(var p=0;p<t;p++)e.vertices.push(n[s][l][p]);s>0&&(o+=n[s-1].length,e.holes.push(o))}return e}});var h_=st(Oe=>{"use strict";Object.defineProperty(Oe,"__esModule",{value:!0});Oe.earthRadius=63710088e-1;Oe.factors={centimeters:Oe.earthRadius*100,centimetres:Oe.earthRadius*100,degrees:Oe.earthRadius/111325,feet:Oe.earthRadius*3.28084,inches:Oe.earthRadius*39.37,kilometers:Oe.earthRadius/1e3,kilometres:Oe.earthRadius/1e3,meters:Oe.earthRadius,metres:Oe.earthRadius,miles:Oe.earthRadius/1609.344,millimeters:Oe.earthRadius*1e3,millimetres:Oe.earthRadius*1e3,nauticalmiles:Oe.earthRadius/1852,radians:1,yards:Oe.earthRadius*1.0936};Oe.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/Oe.earthRadius,yards:1.0936133};Oe.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 nl(n,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=n,o}Oe.feature=nl;function E7(n,t,e){switch(e===void 0&&(e={}),n){case"Point":return u_(t).geometry;case"LineString":return c_(t).geometry;case"Polygon":return l_(t).geometry;case"MultiPoint":return uP(t).geometry;case"MultiLineString":return aP(t).geometry;case"MultiPolygon":return lP(t).geometry;default:throw new Error(n+" is invalid")}}Oe.geometry=E7;function u_(n,t,e){if(e===void 0&&(e={}),!n)throw new Error("coordinates is required");if(!Array.isArray(n))throw new Error("coordinates must be an Array");if(n.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!sg(n[0])||!sg(n[1]))throw new Error("coordinates must contain numbers");var o={type:"Point",coordinates:n};return nl(o,t,e)}Oe.point=u_;function w7(n,t,e){return e===void 0&&(e={}),ag(n.map(function(o){return u_(o,t)}),e)}Oe.points=w7;function l_(n,t,e){e===void 0&&(e={});for(var o=0,s=n;o<s.length;o++){var l=s[o];if(l.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");for(var p=0;p<l[l.length-1].length;p++)if(l[l.length-1][p]!==l[0][p])throw new Error("First and last Position are not equivalent.")}var h={type:"Polygon",coordinates:n};return nl(h,t,e)}Oe.polygon=l_;function S7(n,t,e){return e===void 0&&(e={}),ag(n.map(function(o){return l_(o,t)}),e)}Oe.polygons=S7;function c_(n,t,e){if(e===void 0&&(e={}),n.length<2)throw new Error("coordinates must be an array of two or more positions");var o={type:"LineString",coordinates:n};return nl(o,t,e)}Oe.lineString=c_;function M7(n,t,e){return e===void 0&&(e={}),ag(n.map(function(o){return c_(o,t)}),e)}Oe.lineStrings=M7;function ag(n,t){t===void 0&&(t={});var e={type:"FeatureCollection"};return t.id&&(e.id=t.id),t.bbox&&(e.bbox=t.bbox),e.features=n,e}Oe.featureCollection=ag;function aP(n,t,e){e===void 0&&(e={});var o={type:"MultiLineString",coordinates:n};return nl(o,t,e)}Oe.multiLineString=aP;function uP(n,t,e){e===void 0&&(e={});var o={type:"MultiPoint",coordinates:n};return nl(o,t,e)}Oe.multiPoint=uP;function lP(n,t,e){e===void 0&&(e={});var o={type:"MultiPolygon",coordinates:n};return nl(o,t,e)}Oe.multiPolygon=lP;function b7(n,t,e){e===void 0&&(e={});var o={type:"GeometryCollection",geometries:n};return nl(o,t,e)}Oe.geometryCollection=b7;function A7(n,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(n*e)/e}Oe.round=A7;function cP(n,t){t===void 0&&(t="kilometers");var e=Oe.factors[t];if(!e)throw new Error(t+" units is invalid");return n*e}Oe.radiansToLength=cP;function f_(n,t){t===void 0&&(t="kilometers");var e=Oe.factors[t];if(!e)throw new Error(t+" units is invalid");return n/e}Oe.lengthToRadians=f_;function T7(n,t){return fP(f_(n,t))}Oe.lengthToDegrees=T7;function C7(n){var t=n%360;return t<0&&(t+=360),t}Oe.bearingToAzimuth=C7;function fP(n){var t=n%(2*Math.PI);return t*180/Math.PI}Oe.radiansToDegrees=fP;function P7(n){var t=n%360;return t*Math.PI/180}Oe.degreesToRadians=P7;function I7(n,t,e){if(t===void 0&&(t="kilometers"),e===void 0&&(e="kilometers"),!(n>=0))throw new Error("length must be a positive number");return cP(f_(n,t),e)}Oe.convertLength=I7;function R7(n,t,e){if(t===void 0&&(t="meters"),e===void 0&&(e="kilometers"),!(n>=0))throw new Error("area must be a positive number");var o=Oe.areaFactors[t];if(!o)throw new Error("invalid original units");var s=Oe.areaFactors[e];if(!s)throw new Error("invalid final units");return n/o*s}Oe.convertArea=R7;function sg(n){return!isNaN(n)&&n!==null&&!Array.isArray(n)}Oe.isNumber=sg;function L7(n){return!!n&&n.constructor===Object}Oe.isObject=L7;function N7(n){if(!n)throw new Error("bbox is required");if(!Array.isArray(n))throw new Error("bbox must be an Array");if(n.length!==4&&n.length!==6)throw new Error("bbox must be an Array of 4 or 6 numbers");n.forEach(function(t){if(!sg(t))throw new Error("bbox must only contain numbers")})}Oe.validateBBox=N7;function O7(n){if(!n)throw new Error("id is required");if(["string","number"].indexOf(typeof n)===-1)throw new Error("id must be a number or a string")}Oe.validateId=O7});var d_=st(Si=>{"use strict";Object.defineProperty(Si,"__esModule",{value:!0});var co=h_();function _h(n,t,e){if(n!==null)for(var o,s,l,p,h,g,m,v=0,x=0,E,M=n.type,A=M==="FeatureCollection",I=M==="Feature",S=A?n.features.length:1,w=0;w<S;w++){m=A?n.features[w].geometry:I?n.geometry:n,E=m?m.type==="GeometryCollection":!1,h=E?m.geometries.length:1;for(var R=0;R<h;R++){var C=0,F=0;if(p=E?m.geometries[R]:m,p!==null){g=p.coordinates;var V=p.type;switch(v=e&&(V==="Polygon"||V==="MultiPolygon")?1:0,V){case null:break;case"Point":if(t(g,x,w,C,F)===!1)return!1;x++,C++;break;case"LineString":case"MultiPoint":for(o=0;o<g.length;o++){if(t(g[o],x,w,C,F)===!1)return!1;x++,V==="MultiPoint"&&C++}V==="LineString"&&C++;break;case"Polygon":case"MultiLineString":for(o=0;o<g.length;o++){for(s=0;s<g[o].length-v;s++){if(t(g[o][s],x,w,C,F)===!1)return!1;x++}V==="MultiLineString"&&C++,V==="Polygon"&&F++}V==="Polygon"&&C++;break;case"MultiPolygon":for(o=0;o<g.length;o++){for(F=0,s=0;s<g[o].length;s++){for(l=0;l<g[o][s].length-v;l++){if(t(g[o][s][l],x,w,C,F)===!1)return!1;x++}F++}C++}break;case"GeometryCollection":for(o=0;o<p.geometries.length;o++)if(_h(p.geometries[o],t,e)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function D7(n,t,e,o){var s=e;return _h(n,function(l,p,h,g,m){p===0&&e===void 0?s=l:s=t(s,l,p,h,g,m)},o),s}function hP(n,t){var e;switch(n.type){case"FeatureCollection":for(e=0;e<n.features.length&&t(n.features[e].properties,e)!==!1;e++);break;case"Feature":t(n.properties,0);break}}function F7(n,t,e){var o=e;return hP(n,function(s,l){l===0&&e===void 0?o=s:o=t(o,s,l)}),o}function pP(n,t){if(n.type==="Feature")t(n,0);else if(n.type==="FeatureCollection")for(var e=0;e<n.features.length&&t(n.features[e],e)!==!1;e++);}function U7(n,t,e){var o=e;return pP(n,function(s,l){l===0&&e===void 0?o=s:o=t(o,s,l)}),o}function B7(n){var t=[];return _h(n,function(e){t.push(e)}),t}function p_(n,t){var e,o,s,l,p,h,g,m,v,x,E=0,M=n.type==="FeatureCollection",A=n.type==="Feature",I=M?n.features.length:1;for(e=0;e<I;e++){for(h=M?n.features[e].geometry:A?n.geometry:n,m=M?n.features[e].properties:A?n.properties:{},v=M?n.features[e].bbox:A?n.bbox:void 0,x=M?n.features[e].id:A?n.id:void 0,g=h?h.type==="GeometryCollection":!1,p=g?h.geometries.length:1,s=0;s<p;s++){if(l=g?h.geometries[s]:h,l===null){if(t(null,E,m,v,x)===!1)return!1;continue}switch(l.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":{if(t(l,E,m,v,x)===!1)return!1;break}case"GeometryCollection":{for(o=0;o<l.geometries.length;o++)if(t(l.geometries[o],E,m,v,x)===!1)return!1;break}default:throw new Error("Unknown Geometry Type")}}E++}}function z7(n,t,e){var o=e;return p_(n,function(s,l,p,h,g){l===0&&e===void 0?o=s:o=t(o,s,l,p,h,g)}),o}function ug(n,t){p_(n,function(e,o,s,l,p){var h=e===null?null:e.type;switch(h){case null:case"Point":case"LineString":case"Polygon":return t(co.feature(e,s,{bbox:l,id:p}),o,0)===!1?!1:void 0}var g;switch(h){case"MultiPoint":g="Point";break;case"MultiLineString":g="LineString";break;case"MultiPolygon":g="Polygon";break}for(var m=0;m<e.coordinates.length;m++){var v=e.coordinates[m],x={type:g,coordinates:v};if(t(co.feature(x,s),o,m)===!1)return!1}})}function G7(n,t,e){var o=e;return ug(n,function(s,l,p){l===0&&p===0&&e===void 0?o=s:o=t(o,s,l,p)}),o}function dP(n,t){ug(n,function(e,o,s){var l=0;if(e.geometry){var p=e.geometry.type;if(!(p==="Point"||p==="MultiPoint")){var h,g=0,m=0,v=0;if(_h(e,function(x,E,M,A,I){if(h===void 0||o>g||A>m||I>v){h=x,g=o,m=A,v=I,l=0;return}var S=co.lineString([h,x],e.properties);if(t(S,o,s,I,l)===!1)return!1;l++,h=x})===!1)return!1}}})}function k7(n,t,e){var o=e,s=!1;return dP(n,function(l,p,h,g,m){s===!1&&e===void 0?o=l:o=t(o,l,p,h,g,m),s=!0}),o}function gP(n,t){if(!n)throw new Error("geojson is required");ug(n,function(e,o,s){if(e.geometry!==null){var l=e.geometry.type,p=e.geometry.coordinates;switch(l){case"LineString":if(t(e,o,s,0,0)===!1)return!1;break;case"Polygon":for(var h=0;h<p.length;h++)if(t(co.lineString(p[h],e.properties),o,s,h)===!1)return!1;break}}})}function q7(n,t,e){var o=e;return gP(n,function(s,l,p,h){l===0&&e===void 0?o=s:o=t(o,s,l,p,h)}),o}function H7(n,t){if(t=t||{},!co.isObject(t))throw new Error("options is invalid");var e=t.featureIndex||0,o=t.multiFeatureIndex||0,s=t.geometryIndex||0,l=t.segmentIndex||0,p=t.properties,h;switch(n.type){case"FeatureCollection":e<0&&(e=n.features.length+e),p=p||n.features[e].properties,h=n.features[e].geometry;break;case"Feature":p=p||n.properties,h=n.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":h=n;break;default:throw new Error("geojson is invalid")}if(h===null)return null;var g=h.coordinates;switch(h.type){case"Point":case"MultiPoint":return null;case"LineString":return l<0&&(l=g.length+l-1),co.lineString([g[l],g[l+1]],p,t);case"Polygon":return s<0&&(s=g.length+s),l<0&&(l=g[s].length+l-1),co.lineString([g[s][l],g[s][l+1]],p,t);case"MultiLineString":return o<0&&(o=g.length+o),l<0&&(l=g[o].length+l-1),co.lineString([g[o][l],g[o][l+1]],p,t);case"MultiPolygon":return o<0&&(o=g.length+o),s<0&&(s=g[o].length+s),l<0&&(l=g[o][s].length-l-1),co.lineString([g[o][s][l],g[o][s][l+1]],p,t)}throw new Error("geojson is invalid")}function V7(n,t){if(t=t||{},!co.isObject(t))throw new Error("options is invalid");var e=t.featureIndex||0,o=t.multiFeatureIndex||0,s=t.geometryIndex||0,l=t.coordIndex||0,p=t.properties,h;switch(n.type){case"FeatureCollection":e<0&&(e=n.features.length+e),p=p||n.features[e].properties,h=n.features[e].geometry;break;case"Feature":p=p||n.properties,h=n.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":h=n;break;default:throw new Error("geojson is invalid")}if(h===null)return null;var g=h.coordinates;switch(h.type){case"Point":return co.point(g,p,t);case"MultiPoint":return o<0&&(o=g.length+o),co.point(g[o],p,t);case"LineString":return l<0&&(l=g.length+l),co.point(g[l],p,t);case"Polygon":return s<0&&(s=g.length+s),l<0&&(l=g[s].length+l),co.point(g[s][l],p,t);case"MultiLineString":return o<0&&(o=g.length+o),l<0&&(l=g[o].length+l),co.point(g[o][l],p,t);case"MultiPolygon":return o<0&&(o=g.length+o),s<0&&(s=g[o].length+s),l<0&&(l=g[o][s].length-l),co.point(g[o][s][l],p,t)}throw new Error("geojson is invalid")}Si.coordAll=B7;Si.coordEach=_h;Si.coordReduce=D7;Si.featureEach=pP;Si.featureReduce=U7;Si.findPoint=V7;Si.findSegment=H7;Si.flattenEach=ug;Si.flattenReduce=G7;Si.geomEach=p_;Si.geomReduce=z7;Si.lineEach=gP;Si.lineReduce=q7;Si.propEach=hP;Si.propReduce=F7;Si.segmentEach=dP;Si.segmentReduce=k7});var mP=st(m_=>{"use strict";Object.defineProperty(m_,"__esModule",{value:!0});var W7=d_();function g_(n){var t=[1/0,1/0,-1/0,-1/0];return W7.coordEach(n,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}g_.default=g_;m_.default=g_});var lg=st((dot,y_)=>{var La=qv(),vP=h_(),_P=d_(),nf=mP().default,X7=_P.featureEach,hot=_P.coordEach,pot=vP.polygon,yP=vP.featureCollection;function xP(n){var t=new La(n);return t.insert=function(e){if(e.type!=="Feature")throw new Error("invalid feature");return e.bbox=e.bbox?e.bbox:nf(e),La.prototype.insert.call(this,e)},t.load=function(e){var o=[];return Array.isArray(e)?e.forEach(function(s){if(s.type!=="Feature")throw new Error("invalid features");s.bbox=s.bbox?s.bbox:nf(s),o.push(s)}):X7(e,function(s){if(s.type!=="Feature")throw new Error("invalid features");s.bbox=s.bbox?s.bbox:nf(s),o.push(s)}),La.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:nf(e),La.prototype.remove.call(this,e,o)},t.clear=function(){return La.prototype.clear.call(this)},t.search=function(e){var o=La.prototype.search.call(this,this.toBBox(e));return yP(o)},t.collides=function(e){return La.prototype.collides.call(this,this.toBBox(e))},t.all=function(){var e=La.prototype.all.call(this);return yP(e)},t.toJSON=function(){return La.prototype.toJSON.call(this)},t.fromJSON=function(e){return La.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=nf(e);else if(e.type==="FeatureCollection")o=nf(e);else throw new Error("invalid geojson");return{minX:o[0],minY:o[1],maxX:o[2],maxY:o[3]}},t}y_.exports=xP;y_.exports.default=xP});var S_=st((Sat,IP)=>{"use strict";var PP=Object.prototype.toString;IP.exports=function(t){var e=PP.call(t),o=e==="[object Arguments]";return o||(o=e!=="[object Array]"&&t!==null&&typeof t=="object"&&typeof t.length=="number"&&t.length>=0&&PP.call(t.callee)==="[object Function]"),o}});var zP=st((Mat,BP)=>{"use strict";var UP;Object.keys||(wh=Object.prototype.hasOwnProperty,M_=Object.prototype.toString,RP=S_(),b_=Object.prototype.propertyIsEnumerable,LP=!b_.call({toString:null},"toString"),NP=b_.call(function(){},"prototype"),Sh=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],dg=function(n){var t=n.constructor;return t&&t.prototype===n},OP={$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},DP=function(){if(typeof window=="undefined")return!1;for(var n in window)try{if(!OP["$"+n]&&wh.call(window,n)&&window[n]!==null&&typeof window[n]=="object")try{dg(window[n])}catch(t){return!0}}catch(t){return!0}return!1}(),FP=function(n){if(typeof window=="undefined"||!DP)return dg(n);try{return dg(n)}catch(t){return!1}},UP=function(t){var e=t!==null&&typeof t=="object",o=M_.call(t)==="[object Function]",s=RP(t),l=e&&M_.call(t)==="[object String]",p=[];if(!e&&!o&&!s)throw new TypeError("Object.keys called on a non-object");var h=NP&&o;if(l&&t.length>0&&!wh.call(t,0))for(var g=0;g<t.length;++g)p.push(String(g));if(s&&t.length>0)for(var m=0;m<t.length;++m)p.push(String(m));else for(var v in t)!(h&&v==="prototype")&&wh.call(t,v)&&p.push(String(v));if(LP)for(var x=FP(t),E=0;E<Sh.length;++E)!(x&&Sh[E]==="constructor")&&wh.call(t,Sh[E])&&p.push(Sh[E]);return p});var wh,M_,RP,b_,LP,NP,Sh,dg,OP,DP,FP;BP.exports=UP});var A_=st((bat,qP)=>{"use strict";var nY=Array.prototype.slice,rY=S_(),GP=Object.keys,gg=GP?function(t){return GP(t)}:zP(),kP=Object.keys;gg.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 rY(o)?kP(nY.call(o)):kP(o)})}else Object.keys=gg;return Object.keys||gg};qP.exports=gg});var T_=st((Aat,HP)=>{"use strict";HP.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 s=42;t[e]=s;for(var l 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 p=Object.getOwnPropertySymbols(t);if(p.length!==1||p[0]!==e||!Object.prototype.propertyIsEnumerable.call(t,e))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var h=Object.getOwnPropertyDescriptor(t,e);if(h.value!==s||h.enumerable!==!0)return!1}return!0}});var mg=st((Tat,VP)=>{"use strict";var iY=T_();VP.exports=function(){return iY()&&!!Symbol.toStringTag}});var C_=st((Cat,WP)=>{"use strict";WP.exports=Object});var P_=st((Pat,XP)=>{"use strict";XP.exports=Error});var $P=st((Iat,YP)=>{"use strict";YP.exports=EvalError});var JP=st((Rat,ZP)=>{"use strict";ZP.exports=RangeError});var jP=st((Lat,KP)=>{"use strict";KP.exports=ReferenceError});var I_=st((Nat,QP)=>{"use strict";QP.exports=SyntaxError});var ql=st((Oat,tI)=>{"use strict";tI.exports=TypeError});var nI=st((Dat,eI)=>{"use strict";eI.exports=URIError});var iI=st((Fat,rI)=>{"use strict";rI.exports=Math.abs});var sI=st((Uat,oI)=>{"use strict";oI.exports=Math.floor});var uI=st((Bat,aI)=>{"use strict";aI.exports=Math.max});var cI=st((zat,lI)=>{"use strict";lI.exports=Math.min});var hI=st((Gat,fI)=>{"use strict";fI.exports=Math.pow});var dI=st((kat,pI)=>{"use strict";pI.exports=Math.round});var mI=st((qat,gI)=>{"use strict";gI.exports=Number.isNaN||function(t){return t!==t}});var vI=st((Hat,yI)=>{"use strict";var oY=mI();yI.exports=function(t){return oY(t)||t===0?t:t<0?-1:1}});var xI=st((Vat,_I)=>{"use strict";_I.exports=Object.getOwnPropertyDescriptor});var Hl=st((Wat,EI)=>{"use strict";var yg=xI();if(yg)try{yg([],"length")}catch(n){yg=null}EI.exports=yg});var Mh=st((Xat,wI)=>{"use strict";var vg=Object.defineProperty||!1;if(vg)try{vg({},"a",{value:1})}catch(n){vg=!1}wI.exports=vg});var bI=st((Yat,MI)=>{"use strict";var SI=typeof Symbol!="undefined"&&Symbol,sY=T_();MI.exports=function(){return typeof SI!="function"||typeof Symbol!="function"||typeof SI("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:sY()}});var R_=st(($at,AI)=>{"use strict";AI.exports=typeof Reflect!="undefined"&&Reflect.getPrototypeOf||null});var L_=st((Zat,TI)=>{"use strict";var aY=C_();TI.exports=aY.getPrototypeOf||null});var II=st((Jat,PI)=>{"use strict";var uY="Function.prototype.bind called on incompatible ",lY=Object.prototype.toString,cY=Math.max,fY="[object Function]",CI=function(t,e){for(var o=[],s=0;s<t.length;s+=1)o[s]=t[s];for(var l=0;l<e.length;l+=1)o[l+t.length]=e[l];return o},hY=function(t,e){for(var o=[],s=e||0,l=0;s<t.length;s+=1,l+=1)o[l]=t[s];return o},pY=function(n,t){for(var e="",o=0;o<n.length;o+=1)e+=n[o],o+1<n.length&&(e+=t);return e};PI.exports=function(t){var e=this;if(typeof e!="function"||lY.apply(e)!==fY)throw new TypeError(uY+e);for(var o=hY(arguments,1),s,l=function(){if(this instanceof s){var v=e.apply(this,CI(o,arguments));return Object(v)===v?v:this}return e.apply(t,CI(o,arguments))},p=cY(0,e.length-o.length),h=[],g=0;g<p;g++)h[g]="$"+g;if(s=Function("binder","return function ("+pY(h,",")+"){ return binder.apply(this,arguments); }")(l),e.prototype){var m=function(){};m.prototype=e.prototype,s.prototype=new m,m.prototype=null}return s}});var rf=st((Kat,RI)=>{"use strict";var dY=II();RI.exports=Function.prototype.bind||dY});var _g=st((jat,LI)=>{"use strict";LI.exports=Function.prototype.call});var xg=st((Qat,NI)=>{"use strict";NI.exports=Function.prototype.apply});var DI=st((tut,OI)=>{"use strict";OI.exports=typeof Reflect!="undefined"&&Reflect&&Reflect.apply});var N_=st((eut,FI)=>{"use strict";var gY=rf(),mY=xg(),yY=_g(),vY=DI();FI.exports=vY||gY.call(yY,mY)});var Eg=st((nut,UI)=>{"use strict";var _Y=rf(),xY=ql(),EY=_g(),wY=N_();UI.exports=function(t){if(t.length<1||typeof t[0]!="function")throw new xY("a function is required");return wY(_Y,EY,t)}});var HI=st((rut,qI)=>{"use strict";var SY=Eg(),BI=Hl(),GI;try{GI=[].__proto__===Array.prototype}catch(n){if(!n||typeof n!="object"||!("code"in n)||n.code!=="ERR_PROTO_ACCESS")throw n}var O_=!!GI&&BI&&BI(Object.prototype,"__proto__"),kI=Object,zI=kI.getPrototypeOf;qI.exports=O_&&typeof O_.get=="function"?SY([O_.get]):typeof zI=="function"?function(t){return zI(t==null?t:kI(t))}:!1});var D_=st((iut,YI)=>{"use strict";var VI=R_(),WI=L_(),XI=HI();YI.exports=VI?function(t){return VI(t)}:WI?function(t){if(!t||typeof t!="object"&&typeof t!="function")throw new TypeError("getProto: not an object");return WI(t)}:XI?function(t){return XI(t)}:null});var F_=st((out,$I)=>{"use strict";var MY=Function.prototype.call,bY=Object.prototype.hasOwnProperty,AY=rf();$I.exports=AY.call(MY,bY)});var z_=st((sut,tR)=>{"use strict";var Un,TY=C_(),CY=P_(),PY=$P(),IY=JP(),RY=jP(),uf=I_(),af=ql(),LY=nI(),NY=iI(),OY=sI(),DY=uI(),FY=cI(),UY=hI(),BY=dI(),zY=vI(),jI=Function,U_=function(n){try{return jI('"use strict"; return ('+n+").constructor;")()}catch(t){}},bh=Hl(),GY=Mh(),B_=function(){throw new af},kY=bh?function(){try{return arguments.callee,B_}catch(n){try{return bh(arguments,"callee").get}catch(t){return B_}}}():B_,of=bI()(),qi=D_(),qY=L_(),HY=R_(),QI=xg(),Ah=_g(),sf={},VY=typeof Uint8Array=="undefined"||!qi?Un:qi(Uint8Array),Vl={__proto__:null,"%AggregateError%":typeof AggregateError=="undefined"?Un:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer=="undefined"?Un:ArrayBuffer,"%ArrayIteratorPrototype%":of&&qi?qi([][Symbol.iterator]()):Un,"%AsyncFromSyncIteratorPrototype%":Un,"%AsyncFunction%":sf,"%AsyncGenerator%":sf,"%AsyncGeneratorFunction%":sf,"%AsyncIteratorPrototype%":sf,"%Atomics%":typeof Atomics=="undefined"?Un:Atomics,"%BigInt%":typeof BigInt=="undefined"?Un:BigInt,"%BigInt64Array%":typeof BigInt64Array=="undefined"?Un:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array=="undefined"?Un:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView=="undefined"?Un:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":CY,"%eval%":eval,"%EvalError%":PY,"%Float16Array%":typeof Float16Array=="undefined"?Un:Float16Array,"%Float32Array%":typeof Float32Array=="undefined"?Un:Float32Array,"%Float64Array%":typeof Float64Array=="undefined"?Un:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry=="undefined"?Un:FinalizationRegistry,"%Function%":jI,"%GeneratorFunction%":sf,"%Int8Array%":typeof Int8Array=="undefined"?Un:Int8Array,"%Int16Array%":typeof Int16Array=="undefined"?Un:Int16Array,"%Int32Array%":typeof Int32Array=="undefined"?Un:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":of&&qi?qi(qi([][Symbol.iterator]())):Un,"%JSON%":typeof JSON=="object"?JSON:Un,"%Map%":typeof Map=="undefined"?Un:Map,"%MapIteratorPrototype%":typeof Map=="undefined"||!of||!qi?Un:qi(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":TY,"%Object.getOwnPropertyDescriptor%":bh,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise=="undefined"?Un:Promise,"%Proxy%":typeof Proxy=="undefined"?Un:Proxy,"%RangeError%":IY,"%ReferenceError%":RY,"%Reflect%":typeof Reflect=="undefined"?Un:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set=="undefined"?Un:Set,"%SetIteratorPrototype%":typeof Set=="undefined"||!of||!qi?Un:qi(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer=="undefined"?Un:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":of&&qi?qi(""[Symbol.iterator]()):Un,"%Symbol%":of?Symbol:Un,"%SyntaxError%":uf,"%ThrowTypeError%":kY,"%TypedArray%":VY,"%TypeError%":af,"%Uint8Array%":typeof Uint8Array=="undefined"?Un:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray=="undefined"?Un:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array=="undefined"?Un:Uint16Array,"%Uint32Array%":typeof Uint32Array=="undefined"?Un:Uint32Array,"%URIError%":LY,"%WeakMap%":typeof WeakMap=="undefined"?Un:WeakMap,"%WeakRef%":typeof WeakRef=="undefined"?Un:WeakRef,"%WeakSet%":typeof WeakSet=="undefined"?Un:WeakSet,"%Function.prototype.call%":Ah,"%Function.prototype.apply%":QI,"%Object.defineProperty%":GY,"%Object.getPrototypeOf%":qY,"%Math.abs%":NY,"%Math.floor%":OY,"%Math.max%":DY,"%Math.min%":FY,"%Math.pow%":UY,"%Math.round%":BY,"%Math.sign%":zY,"%Reflect.getPrototypeOf%":HY};if(qi)try{null.error}catch(n){ZI=qi(qi(n)),Vl["%Error.prototype%"]=ZI}var ZI,WY=function n(t){var e;if(t==="%AsyncFunction%")e=U_("async function () {}");else if(t==="%GeneratorFunction%")e=U_("function* () {}");else if(t==="%AsyncGeneratorFunction%")e=U_("async function* () {}");else if(t==="%AsyncGenerator%"){var o=n("%AsyncGeneratorFunction%");o&&(e=o.prototype)}else if(t==="%AsyncIteratorPrototype%"){var s=n("%AsyncGenerator%");s&&qi&&(e=qi(s.prototype))}return Vl[t]=e,e},JI={__proto__:null,"%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"]},Th=rf(),wg=F_(),XY=Th.call(Ah,Array.prototype.concat),YY=Th.call(QI,Array.prototype.splice),KI=Th.call(Ah,String.prototype.replace),Sg=Th.call(Ah,String.prototype.slice),$Y=Th.call(Ah,RegExp.prototype.exec),ZY=/[^%.[\\]]+|\\[(?:(-?\\d+(?:\\.\\d+)?)|(["'])((?:(?!\\2)[^\\\\]|\\\\.)*?)\\2)\\]|(?=(?:\\.|\\[\\])(?:\\.|\\[\\]|%$))/g,JY=/\\\\(\\\\)?/g,KY=function(t){var e=Sg(t,0,1),o=Sg(t,-1);if(e==="%"&&o!=="%")throw new uf("invalid intrinsic syntax, expected closing \`%\`");if(o==="%"&&e!=="%")throw new uf("invalid intrinsic syntax, expected opening \`%\`");var s=[];return KI(t,ZY,function(l,p,h,g){s[s.length]=h?KI(g,JY,"$1"):p||l}),s},jY=function(t,e){var o=t,s;if(wg(JI,o)&&(s=JI[o],o="%"+s[0]+"%"),wg(Vl,o)){var l=Vl[o];if(l===sf&&(l=WY(o)),typeof l=="undefined"&&!e)throw new af("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:s,name:o,value:l}}throw new uf("intrinsic "+t+" does not exist!")};tR.exports=function(t,e){if(typeof t!="string"||t.length===0)throw new af("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof e!="boolean")throw new af('"allowMissing" argument must be a boolean');if($Y(/^%?[^%]*%?$/,t)===null)throw new uf("\`%\` may not be present anywhere but at the beginning and end of the intrinsic name");var o=KY(t),s=o.length>0?o[0]:"",l=jY("%"+s+"%",e),p=l.name,h=l.value,g=!1,m=l.alias;m&&(s=m[0],YY(o,XY([0,1],m)));for(var v=1,x=!0;v<o.length;v+=1){var E=o[v],M=Sg(E,0,1),A=Sg(E,-1);if((M==='"'||M==="'"||M==="\`"||A==='"'||A==="'"||A==="\`")&&M!==A)throw new uf("property names with quotes must have matching quotes");if((E==="constructor"||!x)&&(g=!0),s+="."+E,p="%"+s+"%",wg(Vl,p))h=Vl[p];else if(h!=null){if(!(E in h)){if(!e)throw new af("base intrinsic for "+t+" exists, but the property is not available.");return}if(bh&&v+1>=o.length){var I=bh(h,E);x=!!I,x&&"get"in I&&!("originalValue"in I.get)?h=I.get:h=h[E]}else x=wg(h,E),h=h[E];x&&!g&&(Vl[p]=h)}}return h}});var Mg=st((aut,rR)=>{"use strict";var eR=z_(),nR=Eg(),QY=nR([eR("%String.prototype.indexOf%")]);rR.exports=function(t,e){var o=eR(t,!!e);return typeof o=="function"&&QY(t,".prototype.")>-1?nR([o]):o}});var sR=st((uut,oR)=>{"use strict";var t$=mg()(),e$=Mg(),G_=e$("Object.prototype.toString"),bg=function(t){return t$&&t&&typeof t=="object"&&Symbol.toStringTag in t?!1:G_(t)==="[object Arguments]"},iR=function(t){return bg(t)?!0:t!==null&&typeof t=="object"&&"length"in t&&typeof t.length=="number"&&t.length>=0&&G_(t)!=="[object Array]"&&"callee"in t&&G_(t.callee)==="[object Function]"},n$=function(){return bg(arguments)}();bg.isLegacyArguments=iR;oR.exports=n$?bg:iR});var Ag=st((lut,lR)=>{"use strict";var aR=Mh(),r$=I_(),lf=ql(),uR=Hl();lR.exports=function(t,e,o){if(!t||typeof t!="object"&&typeof t!="function")throw new lf("\`obj\` must be an object or a function\`");if(typeof e!="string"&&typeof e!="symbol")throw new lf("\`property\` must be a string or a symbol\`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new lf("\`nonEnumerable\`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new lf("\`nonWritable\`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new lf("\`nonConfigurable\`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new lf("\`loose\`, if provided, must be a boolean");var s=arguments.length>3?arguments[3]:null,l=arguments.length>4?arguments[4]:null,p=arguments.length>5?arguments[5]:null,h=arguments.length>6?arguments[6]:!1,g=!!uR&&uR(t,e);if(aR)aR(t,e,{configurable:p===null&&g?g.configurable:!p,enumerable:s===null&&g?g.enumerable:!s,value:o,writable:l===null&&g?g.writable:!l});else if(h||!s&&!l&&!p)t[e]=o;else throw new r$("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")}});var Tg=st((cut,fR)=>{"use strict";var k_=Mh(),cR=function(){return!!k_};cR.hasArrayLengthDefineBug=function(){if(!k_)return null;try{return k_([],"length",{value:1}).length!==1}catch(t){return!0}};fR.exports=cR});var cf=st((fut,gR)=>{"use strict";var i$=A_(),o$=typeof Symbol=="function"&&typeof Symbol("foo")=="symbol",s$=Object.prototype.toString,a$=Array.prototype.concat,hR=Ag(),u$=function(n){return typeof n=="function"&&s$.call(n)==="[object Function]"},pR=Tg()(),l$=function(n,t,e,o){if(t in n){if(o===!0){if(n[t]===e)return}else if(!u$(o)||!o())return}pR?hR(n,t,e,!0):hR(n,t,e)},dR=function(n,t){var e=arguments.length>2?arguments[2]:{},o=i$(t);o$&&(o=a$.call(o,Object.getOwnPropertySymbols(t)));for(var s=0;s<o.length;s+=1)l$(n,o[s],t[o[s]],e[o[s]])};dR.supportsDescriptors=!!pR;gR.exports=dR});var xR=st((hut,_R)=>{"use strict";var c$=z_(),mR=Ag(),f$=Tg()(),yR=Hl(),vR=ql(),h$=c$("%Math.floor%");_R.exports=function(t,e){if(typeof t!="function")throw new vR("\`fn\` is not a function");if(typeof e!="number"||e<0||e>4294967295||h$(e)!==e)throw new vR("\`length\` must be a positive 32-bit integer");var o=arguments.length>2&&!!arguments[2],s=!0,l=!0;if("length"in t&&yR){var p=yR(t,"length");p&&!p.configurable&&(s=!1),p&&!p.writable&&(l=!1)}return(s||l||!o)&&(f$?mR(t,"length",e,!0,!0):mR(t,"length",e)),t}});var wR=st((put,ER)=>{"use strict";var p$=rf(),d$=xg(),g$=N_();ER.exports=function(){return g$(p$,d$,arguments)}});var q_=st((dut,Cg)=>{"use strict";var m$=xR(),SR=Mh(),y$=Eg(),MR=wR();Cg.exports=function(t){var e=y$(arguments),o=t.length-(arguments.length-1);return m$(e,1+(o>0?o:0),!0)};SR?SR(Cg.exports,"apply",{value:MR}):Cg.exports.apply=MR});var H_=st((gut,AR)=>{"use strict";var bR=function(n){return n!==n};AR.exports=function(t,e){return t===0&&e===0?1/t===1/e:!!(t===e||bR(t)&&bR(e))}});var V_=st((mut,TR)=>{"use strict";var v$=H_();TR.exports=function(){return typeof Object.is=="function"?Object.is:v$}});var PR=st((yut,CR)=>{"use strict";var _$=V_(),x$=cf();CR.exports=function(){var t=_$();return x$(Object,{is:t},{is:function(){return Object.is!==t}}),t}});var NR=st((vut,LR)=>{"use strict";var E$=cf(),w$=q_(),S$=H_(),IR=V_(),M$=PR(),RR=w$(IR(),Object);E$(RR,{getPolyfill:IR,implementation:S$,shim:M$});LR.exports=RR});var zR=st((_ut,BR)=>{"use strict";var OR=Mg(),b$=mg()(),A$=F_(),T$=Hl(),Y_;b$?(DR=OR("RegExp.prototype.exec"),W_={},Pg=function(){throw W_},X_={toString:Pg,valueOf:Pg},typeof Symbol.toPrimitive=="symbol"&&(X_[Symbol.toPrimitive]=Pg),Y_=function(t){if(!t||typeof t!="object")return!1;var e=T$(t,"lastIndex"),o=e&&A$(e,"value");if(!o)return!1;try{DR(t,X_)}catch(s){return s===W_}}):(FR=OR("Object.prototype.toString"),UR="[object RegExp]",Y_=function(t){return!t||typeof t!="object"&&typeof t!="function"?!1:FR(t)===UR});var DR,W_,Pg,X_,FR,UR;BR.exports=Y_});var kR=st((xut,GR)=>{"use strict";var Ph=function(){return typeof function(){}.name=="string"},Ch=Object.getOwnPropertyDescriptor;if(Ch)try{Ch([],"length")}catch(n){Ch=null}Ph.functionsHaveConfigurableNames=function(){if(!Ph()||!Ch)return!1;var t=Ch(function(){},"name");return!!t&&!!t.configurable};var C$=Function.prototype.bind;Ph.boundFunctionsHaveNames=function(){return Ph()&&typeof C$=="function"&&function(){}.bind().name!==""};GR.exports=Ph});var VR=st((Eut,HR)=>{"use strict";var qR=Ag(),P$=Tg()(),I$=kR().functionsHaveConfigurableNames(),R$=ql();HR.exports=function(t,e){if(typeof t!="function")throw new R$("\`fn\` is not a function");var o=arguments.length>2&&!!arguments[2];return(!o||I$)&&(P$?qR(t,"name",e,!0,!0):qR(t,"name",e)),t}});var $_=st((wut,WR)=>{"use strict";var L$=VR(),N$=ql(),O$=Object;WR.exports=L$(function(){if(this==null||this!==O$(this))throw new N$("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 Z_=st((Sut,XR)=>{"use strict";var D$=$_(),F$=cf().supportsDescriptors,U$=Object.getOwnPropertyDescriptor;XR.exports=function(){if(F$&&/a/mig.flags==="gim"){var t=U$(RegExp.prototype,"flags");if(t&&typeof t.get=="function"&&"dotAll"in RegExp.prototype&&"hasIndices"in RegExp.prototype){var e="",o={};if(Object.defineProperty(o,"hasIndices",{get:function(){e+="d"}}),Object.defineProperty(o,"sticky",{get:function(){e+="y"}}),t.get.call(o),e==="dy")return t.get}}return D$}});var ZR=st((Mut,$R)=>{"use strict";var B$=cf().supportsDescriptors,z$=Z_(),G$=Hl(),k$=Object.defineProperty,q$=P_(),YR=D_(),H$=/a/;$R.exports=function(){if(!B$||!YR)throw new q$("RegExp.prototype.flags requires a true ES5 environment that supports property descriptors");var t=z$(),e=YR(H$),o=G$(e,"flags");return(!o||o.get!==t)&&k$(e,"flags",{configurable:!0,enumerable:!1,get:t}),t}});var QR=st((but,jR)=>{"use strict";var V$=cf(),W$=q_(),X$=$_(),JR=Z_(),Y$=ZR(),KR=W$(JR());V$(KR,{getPolyfill:JR,implementation:X$,shim:Y$});jR.exports=KR});var nL=st((Aut,eL)=>{"use strict";var tL=Mg(),$$=tL("Date.prototype.getDay"),Z$=function(t){try{return $$(t),!0}catch(e){return!1}},J$=tL("Object.prototype.toString"),K$="[object Date]",j$=mg()();eL.exports=function(t){return typeof t!="object"||t===null?!1:j$?Z$(t):J$(t)===K$}});var J_=st((Tut,pL)=>{var rL=A_(),iL=sR(),oL=NR(),sL=zR(),aL=QR(),uL=nL(),lL=Date.prototype.getTime;function hL(n,t,e){var o=e||{};return(o.strict?oL(n,t):n===t)?!0:!n||!t||typeof n!="object"&&typeof t!="object"?o.strict?oL(n,t):n==t:Q$(n,t,o)}function cL(n){return n==null}function fL(n){return!(!n||typeof n!="object"||typeof n.length!="number"||typeof n.copy!="function"||typeof n.slice!="function"||n.length>0&&typeof n[0]!="number")}function Q$(n,t,e){var o,s;if(typeof n!=typeof t||cL(n)||cL(t)||n.prototype!==t.prototype||iL(n)!==iL(t))return!1;var l=sL(n),p=sL(t);if(l!==p)return!1;if(l||p)return n.source===t.source&&aL(n)===aL(t);if(uL(n)&&uL(t))return lL.call(n)===lL.call(t);var h=fL(n),g=fL(t);if(h!==g)return!1;if(h||g){if(n.length!==t.length)return!1;for(o=0;o<n.length;o++)if(n[o]!==t[o])return!1;return!0}if(typeof n!=typeof t)return!1;try{var m=rL(n),v=rL(t)}catch(x){return!1}if(m.length!==v.length)return!1;for(m.sort(),v.sort(),o=m.length-1;o>=0;o--)if(m[o]!=v[o])return!1;for(o=m.length-1;o>=0;o--)if(s=m[o],!hL(n[s],t[s],e))return!1;return!0}pL.exports=hL});var u1=st((Nct,xL)=>{var HZ=J_(),Na=function(n){this.precision=n&&n.precision?n.precision:17,this.direction=n&&n.direction?n.direction:!1,this.pseudoNode=n&&n.pseudoNode?n.pseudoNode:!1,this.objectComparator=n&&n.objectComparator?n.objectComparator:VZ};Na.prototype.compare=function(n,t){if(n.type!==t.type||!_L(n,t))return!1;switch(n.type){case"Point":return this.compareCoord(n.coordinates,t.coordinates);case"LineString":return this.compareLine(n.coordinates,t.coordinates,0,!1);case"Polygon":return this.comparePolygon(n,t);case"Feature":return this.compareFeature(n,t);default:if(n.type.indexOf("Multi")===0){var e=this,o=vL(n),s=vL(t);return o.every(function(l){return this.some(function(p){return e.compare(l,p)})},s)}}return!1};function vL(n){return n.coordinates.map(function(t){return{type:n.type.replace("Multi",""),coordinates:t}})}function _L(n,t){return n.hasOwnProperty("coordinates")?n.coordinates.length===t.coordinates.length:n.length===t.length}Na.prototype.compareCoord=function(n,t){if(n.length!==t.length)return!1;for(var e=0;e<n.length;e++)if(n[e].toFixed(this.precision)!==t[e].toFixed(this.precision))return!1;return!0};Na.prototype.compareLine=function(n,t,e,o){if(!_L(n,t))return!1;var s=this.pseudoNode?n:this.removePseudo(n),l=this.pseudoNode?t:this.removePseudo(t);if(!(o&&!this.compareCoord(s[0],l[0])&&(l=this.fixStartIndex(l,s),!l))){var p=this.compareCoord(s[e],l[e]);return this.direction||p?this.comparePath(s,l):this.compareCoord(s[e],l[l.length-(1+e)])?this.comparePath(s.slice().reverse(),l):!1}};Na.prototype.fixStartIndex=function(n,t){for(var e,o=-1,s=0;s<n.length;s++)if(this.compareCoord(n[s],t[0])){o=s;break}return o>=0&&(e=[].concat(n.slice(o,n.length),n.slice(1,o+1))),e};Na.prototype.comparePath=function(n,t){var e=this;return n.every(function(o,s){return e.compareCoord(o,this[s])},t)};Na.prototype.comparePolygon=function(n,t){if(this.compareLine(n.coordinates[0],t.coordinates[0],1,!0)){var e=n.coordinates.slice(1,n.coordinates.length),o=t.coordinates.slice(1,t.coordinates.length),s=this;return e.every(function(l){return this.some(function(p){return s.compareLine(l,p,1,!0)})},o)}else return!1};Na.prototype.compareFeature=function(n,t){return n.id!==t.id||!this.objectComparator(n.properties,t.properties)||!this.compareBBox(n,t)?!1:this.compare(n.geometry,t.geometry)};Na.prototype.compareBBox=function(n,t){return!!(!n.bbox&&!t.bbox||n.bbox&&t.bbox&&this.compareCoord(n.bbox,t.bbox))};Na.prototype.removePseudo=function(n){return n};function VZ(n,t){return HZ(n,t,{strict:!0})}xL.exports=Na});var EL=st((Wct,Lg)=>{function il(n,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(n,t,e,o)}il.prototype.run=function(n,t,e,o){this._init(n,t,e,o);for(var s=0;s<this._datasetLength;s++)if(this._visited[s]!==1){this._visited[s]=1;var l=this._regionQuery(s);if(l.length<this.minPts)this.noise.push(s);else{var p=this.clusters.length;this.clusters.push([]),this._addToCluster(s,p),this._expandCluster(p,l)}}return this.clusters};il.prototype._init=function(n,t,e,o){if(n){if(!(n instanceof Array))throw Error("Dataset must be of type array, "+typeof n+" given");this.dataset=n,this.clusters=[],this.noise=[],this._datasetLength=n.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)};il.prototype._expandCluster=function(n,t){for(var e=0;e<t.length;e++){var o=t[e];if(this._visited[o]!==1){this._visited[o]=1;var s=this._regionQuery(o);s.length>=this.minPts&&(t=this._mergeArrays(t,s))}this._assigned[o]!==1&&this._addToCluster(o,n)}};il.prototype._addToCluster=function(n,t){this.clusters[t].push(n),this._assigned[n]=1};il.prototype._regionQuery=function(n){for(var t=[],e=0;e<this._datasetLength;e++){var o=this.distance(this.dataset[n],this.dataset[e]);o<this.epsilon&&t.push(e)}return t};il.prototype._mergeArrays=function(n,t){for(var e=t.length,o=0;o<e;o++){var s=t[o];n.indexOf(s)<0&&n.push(s)}return n};il.prototype._euclideanDistance=function(n,t){for(var e=0,o=Math.min(n.length,t.length);o--;)e+=(n[o]-t[o])*(n[o]-t[o]);return Math.sqrt(e)};typeof Lg!="undefined"&&Lg.exports&&(Lg.exports=il)});var wL=st((Xct,Ng)=>{function ol(n,t,e){this.k=3,this.dataset=[],this.assignments=[],this.centroids=[],this.init(n,t,e)}ol.prototype.init=function(n,t,e){this.assignments=[],this.centroids=[],typeof n!="undefined"&&(this.dataset=n),typeof t!="undefined"&&(this.k=t),typeof e!="undefined"&&(this.distance=e)};ol.prototype.run=function(n,t){this.init(n,t);for(var e=this.dataset.length,o=0;o<this.k;o++)this.centroids[o]=this.randomCentroid();for(var s=!0;s;){s=this.assign();for(var l=0;l<this.k;l++){for(var p=new Array(v),h=0,g=0;g<v;g++)p[g]=0;for(var m=0;m<e;m++){var v=this.dataset[m].length;if(l===this.assignments[m]){for(var g=0;g<v;g++)p[g]+=this.dataset[m][g];h++}}if(h>0){for(var g=0;g<v;g++)p[g]/=h;this.centroids[l]=p}else this.centroids[l]=this.randomCentroid(),s=!0}}return this.getClusters()};ol.prototype.randomCentroid=function(){var n=this.dataset.length-1,t,e;do e=Math.round(Math.random()*n),t=this.dataset[e];while(this.centroids.indexOf(t)>=0);return t};ol.prototype.assign=function(){for(var n=!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,n=!0);return n};ol.prototype.getClusters=function(){for(var n=new Array(this.k),t,e=0;e<this.assignments.length;e++)t=this.assignments[e],typeof n[t]=="undefined"&&(n[t]=[]),n[t].push(e);return n};ol.prototype.argmin=function(n,t,e){for(var o=Number.MAX_VALUE,s=0,l=t.length,p,h=0;h<l;h++)p=e(n,t[h]),p<o&&(o=p,s=h);return s};ol.prototype.distance=function(n,t){for(var e=0,o=Math.min(n.length,t.length);o--;){var s=n[o]-t[o];e+=s*s}return Math.sqrt(e)};typeof Ng!="undefined"&&Ng.exports&&(Ng.exports=ol)});var l1=st((Yct,Og)=>{function Oa(n,t,e){this._queue=[],this._priorities=[],this._sorting="desc",this._init(n,t,e)}Oa.prototype.insert=function(n,t){for(var e=this._queue.length,o=e;o--;){var s=this._priorities[o];this._sorting==="desc"?t>s&&(e=o):t<s&&(e=o)}this._insertAt(n,t,e)};Oa.prototype.remove=function(n){for(var t=this._queue.length;t--;){var e=this._queue[t];if(n===e){this._queue.splice(t,1),this._priorities.splice(t,1);break}}};Oa.prototype.forEach=function(n){this._queue.forEach(n)};Oa.prototype.getElements=function(){return this._queue};Oa.prototype.getElementPriority=function(n){return this._priorities[n]};Oa.prototype.getPriorities=function(){return this._priorities};Oa.prototype.getElementsWithPriorities=function(){for(var n=[],t=0,e=this._queue.length;t<e;t++)n.push([this._queue[t],this._priorities[t]]);return n};Oa.prototype._init=function(n,t,e){if(n&&t){if(this._queue=[],this._priorities=[],n.length!==t.length)throw new Error("Arrays must have the same length");for(var o=0;o<n.length;o++)this.insert(n[o],t[o])}e&&(this._sorting=e)};Oa.prototype._insertAt=function(n,t,e){this._queue.length===e?(this._queue.push(n),this._priorities.push(t)):(this._queue.splice(e,0,n),this._priorities.splice(e,0,t))};typeof Og!="undefined"&&Og.exports&&(Og.exports=Oa)});var ML=st(($ct,hf)=>{typeof hf!="undefined"&&hf.exports&&(SL=l1());var SL;function gu(n,t,e,o){this.epsilon=1,this.minPts=1,this.distance=this._euclideanDistance,this._reachability=[],this._processed=[],this._coreDistance=0,this._orderedList=[],this._init(n,t,e,o)}gu.prototype.run=function(n,t,e,o){this._init(n,t,e,o);for(var s=0,l=this.dataset.length;s<l;s++)if(this._processed[s]!==1){this._processed[s]=1,this.clusters.push([s]);var p=this.clusters.length-1;this._orderedList.push(s);var h=new SL(null,null,"asc"),g=this._regionQuery(s);this._distanceToCore(s)!==void 0&&(this._updateQueue(s,g,h),this._expandCluster(p,h))}return this.clusters};gu.prototype.getReachabilityPlot=function(){for(var n=[],t=0,e=this._orderedList.length;t<e;t++){var o=this._orderedList[t],s=this._reachability[o];n.push([o,s])}return n};gu.prototype._init=function(n,t,e,o){if(n){if(!(n instanceof Array))throw Error("Dataset must be of type array, "+typeof n+" given");this.dataset=n,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)};gu.prototype._updateQueue=function(n,t,e){var o=this;this._coreDistance=this._distanceToCore(n),t.forEach(function(s){if(o._processed[s]===void 0){var l=o.distance(o.dataset[n],o.dataset[s]),p=Math.max(o._coreDistance,l);o._reachability[s]===void 0?(o._reachability[s]=p,e.insert(s,p)):p<o._reachability[s]&&(o._reachability[s]=p,e.remove(s),e.insert(s,p))}})};gu.prototype._expandCluster=function(n,t){for(var e=t.getElements(),o=0,s=e.length;o<s;o++){var l=e[o];if(this._processed[l]===void 0){var p=this._regionQuery(l);this._processed[l]=1,this.clusters[n].push(l),this._orderedList.push(l),this._distanceToCore(l)!==void 0&&(this._updateQueue(l,p,t),this._expandCluster(n,t))}}};gu.prototype._distanceToCore=function(n){for(var t=this.epsilon,e=0;e<t;e++){var o=this._regionQuery(n,e);if(o.length>=this.minPts)return e}};gu.prototype._regionQuery=function(n,t){t=t||this.epsilon;for(var e=[],o=0,s=this.dataset.length;o<s;o++)this.distance(this.dataset[n],this.dataset[o])<t&&e.push(o);return e};gu.prototype._euclideanDistance=function(n,t){for(var e=0,o=Math.min(n.length,t.length);o--;)e+=(n[o]-t[o])*(n[o]-t[o]);return Math.sqrt(e)};typeof hf!="undefined"&&hf.exports&&(hf.exports=gu)});var bL=st((Zct,Dg)=>{typeof Dg!="undefined"&&Dg.exports&&(Dg.exports={DBSCAN:EL(),KMEANS:wL(),OPTICS:ML(),PriorityQueue:l1()})});var c1=st((eft,TL)=>{"use strict";TL.exports={eudist:function(t,e,o){for(var s=t.length,l=0,p=0;p<s;p++){var h=(t[p]||0)-(e[p]||0);l+=h*h}return o?Math.sqrt(l):l},mandist:function(t,e,o){for(var s=t.length,l=0,p=0;p<s;p++)l+=Math.abs((t[p]||0)-(e[p]||0));return o?Math.sqrt(l):l},dist:function(t,e,o){var s=Math.abs(t-e);return o?s:s*s}}});var IL=st((nft,PL)=>{"use strict";var CL=c1(),JZ=CL.eudist,KZ=CL.dist;PL.exports={kmrand:function(t,e){for(var o={},s=[],l=e<<2,p=t.length,h=t[0].length>0;s.length<e&&l-- >0;){var g=t[Math.floor(Math.random()*p)],m=h?g.join("_"):""+g;o[m]||(o[m]=!0,s.push(g))}if(s.length<e)throw new Error("Error initializating clusters");return s},kmpp:function(t,e){var o=t[0].length?JZ:KZ,s=[],l=t.length,p=t[0].length>0,h={},g=t[Math.floor(Math.random()*l)],m=p?g.join("_"):""+g;for(s.push(g),h[m]=!0;s.length<e;){for(var v=[],x=s.length,E=0,M=[],A=0;A<l;A++){for(var I=1/0,S=0;S<x;S++){var w=o(t[A],s[S]);w<=I&&(I=w)}v[A]=I}for(var R=0;R<l;R++)E+=v[R];for(var C=0;C<l;C++)M[C]={i:C,v:t[C],pr:v[C]/E,cs:0};M.sort(function(q,D){return q.pr-D.pr}),M[0].cs=M[0].pr;for(var F=1;F<l;F++)M[F].cs=M[F-1].cs+M[F].pr;for(var V=Math.random(),X=0;X<l-1&&M[X++].cs<V;);s.push(M[X-1].v)}return s}}});var DL=st((oft,OL)=>{"use strict";var f1=c1(),NL=IL(),jZ=f1.eudist,rft=f1.mandist,ift=f1.dist,QZ=NL.kmrand,tJ=NL.kmpp,RL=1e4;function LL(n,t,e){e=e||[];for(var o=0;o<n;o++)e[o]=t;return e}function eJ(n,t,e,o){var s=[],l=[],p=[],h=[],g=!1,m=o||RL,v=n.length,x=n[0].length,E=x>0,M=[];if(e)e=="kmrand"?s=QZ(n,t):e=="kmpp"?s=tJ(n,t):s=e;else for(var A={};s.length<t;){var I=Math.floor(Math.random()*v);A[I]||(A[I]=!0,s.push(n[I]))}do{LL(t,0,M);for(var S=0;S<v;S++){for(var w=1/0,R=0,C=0;C<t;C++){var h=E?jZ(n[S],s[C]):Math.abs(n[S]-s[C]);h<=w&&(w=h,R=C)}p[S]=R,M[R]++}for(var F=[],l=[],V=0,X=0;X<t;X++)F[X]=E?LL(x,0,F[X]):0,l[X]=s[X];if(E){for(var q=0;q<t;q++)s[q]=[];for(var D=0;D<v;D++)for(var xt=p[D],B=F[xt],j=n[D],J=0;J<x;J++)B[J]+=j[J];g=!0;for(var Dt=0;Dt<t;Dt++){for(var Q=s[Dt],At=F[Dt],Mt=l[Dt],Lt=M[Dt],pt=0;pt<x;pt++)Q[pt]=At[pt]/Lt||0;if(g){for(var yt=0;yt<x;yt++)if(Mt[yt]!=Q[yt]){g=!1;break}}}}else{for(var K=0;K<v;K++){var Bt=p[K];F[Bt]+=n[K]}for(var Gt=0;Gt<t;Gt++)s[Gt]=F[Gt]/M[Gt]||0;g=!0;for(var ae=0;ae<t;ae++)if(l[ae]!=s[ae]){g=!1;break}}g=g||--m<=0}while(!g);return{it:RL-m,k:t,idxs:p,centroids:s}}OL.exports=eJ});var yf=st((y1,v1)=>{(function(n,t){typeof y1=="object"&&typeof v1!="undefined"?v1.exports=t():typeof define=="function"&&define.amd?define(t):(n=typeof globalThis!="undefined"?globalThis:n||self,n.polygonClipping=t())})(y1,function(){"use strict";function n(rt,P){var N={label:0,sent:function(){if(W[0]&1)throw W[1];return W[1]},trys:[],ops:[]},k,$,W,ht;return ht={next:at(0),throw:at(1),return:at(2)},typeof Symbol=="function"&&(ht[Symbol.iterator]=function(){return this}),ht;function at(Et){return function(G){return wt([Et,G])}}function wt(Et){if(k)throw new TypeError("Generator is already executing.");for(;N;)try{if(k=1,$&&(W=Et[0]&2?$.return:Et[0]?$.throw||((W=$.return)&&W.call($),0):$.next)&&!(W=W.call($,Et[1])).done)return W;switch($=0,W&&(Et=[Et[0]&2,W.value]),Et[0]){case 0:case 1:W=Et;break;case 4:return N.label++,{value:Et[1],done:!1};case 5:N.label++,$=Et[1],Et=[0];continue;case 7:Et=N.ops.pop(),N.trys.pop();continue;default:if(W=N.trys,!(W=W.length>0&&W[W.length-1])&&(Et[0]===6||Et[0]===2)){N=0;continue}if(Et[0]===3&&(!W||Et[1]>W[0]&&Et[1]<W[3])){N.label=Et[1];break}if(Et[0]===6&&N.label<W[1]){N.label=W[1],W=Et;break}if(W&&N.label<W[2]){N.label=W[2],N.ops.push(Et);break}W[2]&&N.ops.pop(),N.trys.pop();continue}Et=P.call(rt,N)}catch(G){Et=[6,G],$=0}finally{k=W=0}if(Et[0]&5)throw Et[1];return{value:Et[0]?Et[1]:void 0,done:!0}}}var t=function(){function rt(P,N){this.next=null,this.key=P,this.data=N,this.left=null,this.right=null}return rt}();function e(rt,P){return rt>P?1:rt<P?-1:0}function o(rt,P,N){for(var k=new t(null,null),$=k,W=k;;){var ht=N(rt,P.key);if(ht<0){if(P.left===null)break;if(N(rt,P.left.key)<0){var at=P.left;if(P.left=at.right,at.right=P,P=at,P.left===null)break}W.left=P,W=P,P=P.left}else if(ht>0){if(P.right===null)break;if(N(rt,P.right.key)>0){var at=P.right;if(P.right=at.left,at.left=P,P=at,P.right===null)break}$.right=P,$=P,P=P.right}else break}return $.right=P.left,W.left=P.right,P.left=k.right,P.right=k.left,P}function s(rt,P,N,k){var $=new t(rt,P);if(N===null)return $.left=$.right=null,$;N=o(rt,N,k);var W=k(rt,N.key);return W<0?($.left=N.left,$.right=N,N.left=null):W>=0&&($.right=N.right,$.left=N,N.right=null),$}function l(rt,P,N){var k=null,$=null;if(P){P=o(rt,P,N);var W=N(P.key,rt);W===0?(k=P.left,$=P.right):W<0?($=P.right,P.right=null,k=P):(k=P.left,P.left=null,$=P)}return{left:k,right:$}}function p(rt,P,N){return P===null?rt:(rt===null||(P=o(rt.key,P,N),P.left=rt),P)}function h(rt,P,N,k,$){if(rt){k(""+P+(N?"\\u2514\\u2500\\u2500 ":"\\u251C\\u2500\\u2500 ")+$(rt)+\`
|
|
19757
19757
|
\`);var W=P+(N?" ":"\\u2502 ");rt.left&&h(rt.left,W,!1,k,$),rt.right&&h(rt.right,W,!0,k,$)}}var g=function(){function rt(P){P===void 0&&(P=e),this._root=null,this._size=0,this._comparator=P}return rt.prototype.insert=function(P,N){return this._size++,this._root=s(P,N,this._root,this._comparator)},rt.prototype.add=function(P,N){var k=new t(P,N);this._root===null&&(k.left=k.right=null,this._size++,this._root=k);var $=this._comparator,W=o(P,this._root,$),ht=$(P,W.key);return ht===0?this._root=W:(ht<0?(k.left=W.left,k.right=W,W.left=null):ht>0&&(k.right=W.right,k.left=W,W.right=null),this._size++,this._root=k),this._root},rt.prototype.remove=function(P){this._root=this._remove(P,this._root,this._comparator)},rt.prototype._remove=function(P,N,k){var $;if(N===null)return null;N=o(P,N,k);var W=k(P,N.key);return W===0?(N.left===null?$=N.right:($=o(P,N.left,k),$.right=N.right),this._size--,$):N},rt.prototype.pop=function(){var P=this._root;if(P){for(;P.left;)P=P.left;return this._root=o(P.key,this._root,this._comparator),this._root=this._remove(P.key,this._root,this._comparator),{key:P.key,data:P.data}}return null},rt.prototype.findStatic=function(P){for(var N=this._root,k=this._comparator;N;){var $=k(P,N.key);if($===0)return N;$<0?N=N.left:N=N.right}return null},rt.prototype.find=function(P){return this._root&&(this._root=o(P,this._root,this._comparator),this._comparator(P,this._root.key)!==0)?null:this._root},rt.prototype.contains=function(P){for(var N=this._root,k=this._comparator;N;){var $=k(P,N.key);if($===0)return!0;$<0?N=N.left:N=N.right}return!1},rt.prototype.forEach=function(P,N){for(var k=this._root,$=[],W=!1;!W;)k!==null?($.push(k),k=k.left):$.length!==0?(k=$.pop(),P.call(N,k),k=k.right):W=!0;return this},rt.prototype.range=function(P,N,k,$){for(var W=[],ht=this._comparator,at=this._root,wt;W.length!==0||at;)if(at)W.push(at),at=at.left;else{if(at=W.pop(),wt=ht(at.key,N),wt>0)break;if(ht(at.key,P)>=0&&k.call($,at))return this;at=at.right}return this},rt.prototype.keys=function(){var P=[];return this.forEach(function(N){var k=N.key;return P.push(k)}),P},rt.prototype.values=function(){var P=[];return this.forEach(function(N){var k=N.data;return P.push(k)}),P},rt.prototype.min=function(){return this._root?this.minNode(this._root).key:null},rt.prototype.max=function(){return this._root?this.maxNode(this._root).key:null},rt.prototype.minNode=function(P){if(P===void 0&&(P=this._root),P)for(;P.left;)P=P.left;return P},rt.prototype.maxNode=function(P){if(P===void 0&&(P=this._root),P)for(;P.right;)P=P.right;return P},rt.prototype.at=function(P){for(var N=this._root,k=!1,$=0,W=[];!k;)if(N)W.push(N),N=N.left;else if(W.length>0){if(N=W.pop(),$===P)return N;$++,N=N.right}else k=!0;return null},rt.prototype.next=function(P){var N=this._root,k=null;if(P.right){for(k=P.right;k.left;)k=k.left;return k}for(var $=this._comparator;N;){var W=$(P.key,N.key);if(W===0)break;W<0?(k=N,N=N.left):N=N.right}return k},rt.prototype.prev=function(P){var N=this._root,k=null;if(P.left!==null){for(k=P.left;k.right;)k=k.right;return k}for(var $=this._comparator;N;){var W=$(P.key,N.key);if(W===0)break;W<0?N=N.left:(k=N,N=N.right)}return k},rt.prototype.clear=function(){return this._root=null,this._size=0,this},rt.prototype.toList=function(){return x(this._root)},rt.prototype.load=function(P,N,k){N===void 0&&(N=[]),k===void 0&&(k=!1);var $=P.length,W=this._comparator;if(k&&A(P,N,0,$-1,W),this._root===null)this._root=m(P,N,0,$),this._size=$;else{var ht=M(this.toList(),v(P,N),W);$=this._size+$,this._root=E({head:ht},0,$)}return this},rt.prototype.isEmpty=function(){return this._root===null},Object.defineProperty(rt.prototype,"size",{get:function(){return this._size},enumerable:!0,configurable:!0}),Object.defineProperty(rt.prototype,"root",{get:function(){return this._root},enumerable:!0,configurable:!0}),rt.prototype.toString=function(P){P===void 0&&(P=function(k){return String(k.key)});var N=[];return h(this._root,"",!0,function(k){return N.push(k)},P),N.join("")},rt.prototype.update=function(P,N,k){var $=this._comparator,W=l(P,this._root,$),ht=W.left,at=W.right;$(P,N)<0?at=s(N,k,at,$):ht=s(N,k,ht,$),this._root=p(ht,at,$)},rt.prototype.split=function(P){return l(P,this._root,this._comparator)},rt.prototype[Symbol.iterator]=function(){var P,N,k;return n(this,function($){switch($.label){case 0:P=this._root,N=[],k=!1,$.label=1;case 1:return k?[3,6]:P===null?[3,2]:(N.push(P),P=P.left,[3,5]);case 2:return N.length===0?[3,4]:(P=N.pop(),[4,P]);case 3:return $.sent(),P=P.right,[3,5];case 4:k=!0,$.label=5;case 5:return[3,1];case 6:return[2]}})},rt}();function m(rt,P,N,k){var $=k-N;if($>0){var W=N+Math.floor($/2),ht=rt[W],at=P[W],wt=new t(ht,at);return wt.left=m(rt,P,N,W),wt.right=m(rt,P,W+1,k),wt}return null}function v(rt,P){for(var N=new t(null,null),k=N,$=0;$<rt.length;$++)k=k.next=new t(rt[$],P[$]);return k.next=null,N.next}function x(rt){for(var P=rt,N=[],k=!1,$=new t(null,null),W=$;!k;)P?(N.push(P),P=P.left):N.length>0?(P=W=W.next=N.pop(),P=P.right):k=!0;return W.next=null,$.next}function E(rt,P,N){var k=N-P;if(k>0){var $=P+Math.floor(k/2),W=E(rt,P,$),ht=rt.head;return ht.left=W,rt.head=rt.head.next,ht.right=E(rt,$+1,N),ht}return null}function M(rt,P,N){for(var k=new t(null,null),$=k,W=rt,ht=P;W!==null&&ht!==null;)N(W.key,ht.key)<0?($.next=W,W=W.next):($.next=ht,ht=ht.next),$=$.next;return W!==null?$.next=W:ht!==null&&($.next=ht),k.next}function A(rt,P,N,k,$){if(!(N>=k)){for(var W=rt[N+k>>1],ht=N-1,at=k+1;;){do ht++;while($(rt[ht],W)<0);do at--;while($(rt[at],W)>0);if(ht>=at)break;var wt=rt[ht];rt[ht]=rt[at],rt[at]=wt,wt=P[ht],P[ht]=P[at],P[at]=wt}A(rt,P,N,at,$),A(rt,P,at+1,k,$)}}let I=(rt,P)=>rt.ll.x<=P.x&&P.x<=rt.ur.x&&rt.ll.y<=P.y&&P.y<=rt.ur.y,S=(rt,P)=>{if(P.ur.x<rt.ll.x||rt.ur.x<P.ll.x||P.ur.y<rt.ll.y||rt.ur.y<P.ll.y)return null;let N=rt.ll.x<P.ll.x?P.ll.x:rt.ll.x,k=rt.ur.x<P.ur.x?rt.ur.x:P.ur.x,$=rt.ll.y<P.ll.y?P.ll.y:rt.ll.y,W=rt.ur.y<P.ur.y?rt.ur.y:P.ur.y;return{ll:{x:N,y:$},ur:{x:k,y:W}}},w=Number.EPSILON;w===void 0&&(w=Math.pow(2,-52));let R=w*w,C=(rt,P)=>{if(-w<rt&&rt<w&&-w<P&&P<w)return 0;let N=rt-P;return N*N<R*rt*P?0:rt<P?-1:1};class F{constructor(){this.reset()}reset(){this.xRounder=new V,this.yRounder=new V}round(P,N){return{x:this.xRounder.round(P),y:this.yRounder.round(N)}}}class V{constructor(){this.tree=new g,this.round(0)}round(P){let N=this.tree.add(P),k=this.tree.prev(N);if(k!==null&&C(N.key,k.key)===0)return this.tree.remove(P),k.key;let $=this.tree.next(N);return $!==null&&C(N.key,$.key)===0?(this.tree.remove(P),$.key):P}}let X=new F,q=11102230246251565e-32,D=134217729,xt=(3+8*q)*q;function B(rt,P,N,k,$){let W,ht,at,wt,Et=P[0],G=k[0],ot=0,et=0;G>Et==G>-Et?(W=Et,Et=P[++ot]):(W=G,G=k[++et]);let lt=0;if(ot<rt&&et<N)for(G>Et==G>-Et?(ht=Et+W,at=W-(ht-Et),Et=P[++ot]):(ht=G+W,at=W-(ht-G),G=k[++et]),W=ht,at!==0&&($[lt++]=at);ot<rt&&et<N;)G>Et==G>-Et?(ht=W+Et,wt=ht-W,at=W-(ht-wt)+(Et-wt),Et=P[++ot]):(ht=W+G,wt=ht-W,at=W-(ht-wt)+(G-wt),G=k[++et]),W=ht,at!==0&&($[lt++]=at);for(;ot<rt;)ht=W+Et,wt=ht-W,at=W-(ht-wt)+(Et-wt),Et=P[++ot],W=ht,at!==0&&($[lt++]=at);for(;et<N;)ht=W+G,wt=ht-W,at=W-(ht-wt)+(G-wt),G=k[++et],W=ht,at!==0&&($[lt++]=at);return(W!==0||lt===0)&&($[lt++]=W),lt}function j(rt,P){let N=P[0];for(let k=1;k<rt;k++)N+=P[k];return N}function J(rt){return new Float64Array(rt)}let Dt=(3+16*q)*q,Q=(2+12*q)*q,At=(9+64*q)*q*q,Mt=J(4),Lt=J(8),pt=J(12),yt=J(16),K=J(4);function Bt(rt,P,N,k,$,W,ht){let at,wt,Et,G,ot,et,lt,Ft,Kt,me,ve,qe,Ue,Xe,Je,wr,Jr,nr,Ie=rt-$,rr=N-$,pr=P-W,ur=k-W;Xe=Ie*ur,et=D*Ie,lt=et-(et-Ie),Ft=Ie-lt,et=D*ur,Kt=et-(et-ur),me=ur-Kt,Je=Ft*me-(Xe-lt*Kt-Ft*Kt-lt*me),wr=pr*rr,et=D*pr,lt=et-(et-pr),Ft=pr-lt,et=D*rr,Kt=et-(et-rr),me=rr-Kt,Jr=Ft*me-(wr-lt*Kt-Ft*Kt-lt*me),ve=Je-Jr,ot=Je-ve,Mt[0]=Je-(ve+ot)+(ot-Jr),qe=Xe+ve,ot=qe-Xe,Ue=Xe-(qe-ot)+(ve-ot),ve=Ue-wr,ot=Ue-ve,Mt[1]=Ue-(ve+ot)+(ot-wr),nr=qe+ve,ot=nr-qe,Mt[2]=qe-(nr-ot)+(ve-ot),Mt[3]=nr;let Qn=j(4,Mt),bi=Q*ht;if(Qn>=bi||-Qn>=bi||(ot=rt-Ie,at=rt-(Ie+ot)+(ot-$),ot=N-rr,Et=N-(rr+ot)+(ot-$),ot=P-pr,wt=P-(pr+ot)+(ot-W),ot=k-ur,G=k-(ur+ot)+(ot-W),at===0&&wt===0&&Et===0&&G===0)||(bi=At*ht+xt*Math.abs(Qn),Qn+=Ie*G+ur*at-(pr*Et+rr*wt),Qn>=bi||-Qn>=bi))return Qn;Xe=at*ur,et=D*at,lt=et-(et-at),Ft=at-lt,et=D*ur,Kt=et-(et-ur),me=ur-Kt,Je=Ft*me-(Xe-lt*Kt-Ft*Kt-lt*me),wr=wt*rr,et=D*wt,lt=et-(et-wt),Ft=wt-lt,et=D*rr,Kt=et-(et-rr),me=rr-Kt,Jr=Ft*me-(wr-lt*Kt-Ft*Kt-lt*me),ve=Je-Jr,ot=Je-ve,K[0]=Je-(ve+ot)+(ot-Jr),qe=Xe+ve,ot=qe-Xe,Ue=Xe-(qe-ot)+(ve-ot),ve=Ue-wr,ot=Ue-ve,K[1]=Ue-(ve+ot)+(ot-wr),nr=qe+ve,ot=nr-qe,K[2]=qe-(nr-ot)+(ve-ot),K[3]=nr;let oi=B(4,Mt,4,K,Lt);Xe=Ie*G,et=D*Ie,lt=et-(et-Ie),Ft=Ie-lt,et=D*G,Kt=et-(et-G),me=G-Kt,Je=Ft*me-(Xe-lt*Kt-Ft*Kt-lt*me),wr=pr*Et,et=D*pr,lt=et-(et-pr),Ft=pr-lt,et=D*Et,Kt=et-(et-Et),me=Et-Kt,Jr=Ft*me-(wr-lt*Kt-Ft*Kt-lt*me),ve=Je-Jr,ot=Je-ve,K[0]=Je-(ve+ot)+(ot-Jr),qe=Xe+ve,ot=qe-Xe,Ue=Xe-(qe-ot)+(ve-ot),ve=Ue-wr,ot=Ue-ve,K[1]=Ue-(ve+ot)+(ot-wr),nr=qe+ve,ot=nr-qe,K[2]=qe-(nr-ot)+(ve-ot),K[3]=nr;let Z=B(oi,Lt,4,K,pt);Xe=at*G,et=D*at,lt=et-(et-at),Ft=at-lt,et=D*G,Kt=et-(et-G),me=G-Kt,Je=Ft*me-(Xe-lt*Kt-Ft*Kt-lt*me),wr=wt*Et,et=D*wt,lt=et-(et-wt),Ft=wt-lt,et=D*Et,Kt=et-(et-Et),me=Et-Kt,Jr=Ft*me-(wr-lt*Kt-Ft*Kt-lt*me),ve=Je-Jr,ot=Je-ve,K[0]=Je-(ve+ot)+(ot-Jr),qe=Xe+ve,ot=qe-Xe,Ue=Xe-(qe-ot)+(ve-ot),ve=Ue-wr,ot=Ue-ve,K[1]=Ue-(ve+ot)+(ot-wr),nr=qe+ve,ot=nr-qe,K[2]=qe-(nr-ot)+(ve-ot),K[3]=nr;let mt=B(Z,pt,4,K,yt);return yt[mt-1]}function Gt(rt,P,N,k,$,W){let ht=(P-W)*(N-$),at=(rt-$)*(k-W),wt=ht-at,Et=Math.abs(ht+at);return Math.abs(wt)>=Dt*Et?wt:-Bt(rt,P,N,k,$,W,Et)}let ae=(rt,P)=>rt.x*P.y-rt.y*P.x,ut=(rt,P)=>rt.x*P.x+rt.y*P.y,Ut=(rt,P,N)=>{let k=Gt(rt.x,rt.y,P.x,P.y,N.x,N.y);return k>0?-1:k<0?1:0},jt=rt=>Math.sqrt(ut(rt,rt)),ce=(rt,P,N)=>{let k={x:P.x-rt.x,y:P.y-rt.y},$={x:N.x-rt.x,y:N.y-rt.y};return ae($,k)/jt($)/jt(k)},te=(rt,P,N)=>{let k={x:P.x-rt.x,y:P.y-rt.y},$={x:N.x-rt.x,y:N.y-rt.y};return ut($,k)/jt($)/jt(k)},$t=(rt,P,N)=>P.y===0?null:{x:rt.x+P.x/P.y*(N-rt.y),y:N},qt=(rt,P,N)=>P.x===0?null:{x:N,y:rt.y+P.y/P.x*(N-rt.x)},xe=(rt,P,N,k)=>{if(P.x===0)return qt(N,k,rt.x);if(k.x===0)return qt(rt,P,N.x);if(P.y===0)return $t(N,k,rt.y);if(k.y===0)return $t(rt,P,N.y);let $=ae(P,k);if($==0)return null;let W={x:N.x-rt.x,y:N.y-rt.y},ht=ae(W,P)/$,at=ae(W,k)/$,wt=rt.x+at*P.x,Et=N.x+ht*k.x,G=rt.y+at*P.y,ot=N.y+ht*k.y,et=(wt+Et)/2,lt=(G+ot)/2;return{x:et,y:lt}};class ft{static compare(P,N){let k=ft.comparePoints(P.point,N.point);return k!==0?k:(P.point!==N.point&&P.link(N),P.isLeft!==N.isLeft?P.isLeft?1:-1:ee.compare(P.segment,N.segment))}static comparePoints(P,N){return P.x<N.x?-1:P.x>N.x?1:P.y<N.y?-1:P.y>N.y?1:0}constructor(P,N){P.events===void 0?P.events=[this]:P.events.push(this),this.point=P,this.isLeft=N}link(P){if(P.point===this.point)throw new Error("Tried to link already linked events");let N=P.point.events;for(let k=0,$=N.length;k<$;k++){let W=N[k];this.point.events.push(W),W.point=this.point}this.checkForConsuming()}checkForConsuming(){let P=this.point.events.length;for(let N=0;N<P;N++){let k=this.point.events[N];if(k.segment.consumedBy===void 0)for(let $=N+1;$<P;$++){let W=this.point.events[$];W.consumedBy===void 0&&k.otherSE.point.events===W.otherSE.point.events&&k.segment.consume(W.segment)}}}getAvailableLinkedEvents(){let P=[];for(let N=0,k=this.point.events.length;N<k;N++){let $=this.point.events[N];$!==this&&!$.segment.ringOut&&$.segment.isInResult()&&P.push($)}return P}getLeftmostComparator(P){let N=new Map,k=$=>{let W=$.otherSE;N.set($,{sine:ce(this.point,P.point,W.point),cosine:te(this.point,P.point,W.point)})};return($,W)=>{N.has($)||k($),N.has(W)||k(W);let{sine:ht,cosine:at}=N.get($),{sine:wt,cosine:Et}=N.get(W);return ht>=0&&wt>=0?at<Et?1:at>Et?-1:0:ht<0&&wt<0?at<Et?-1:at>Et?1:0:wt<ht?-1:wt>ht?1:0}}}let We=0;class ee{static compare(P,N){let k=P.leftSE.point.x,$=N.leftSE.point.x,W=P.rightSE.point.x,ht=N.rightSE.point.x;if(ht<k)return 1;if(W<$)return-1;let at=P.leftSE.point.y,wt=N.leftSE.point.y,Et=P.rightSE.point.y,G=N.rightSE.point.y;if(k<$){if(wt<at&&wt<Et)return 1;if(wt>at&&wt>Et)return-1;let ot=P.comparePoint(N.leftSE.point);if(ot<0)return 1;if(ot>0)return-1;let et=N.comparePoint(P.rightSE.point);return et!==0?et:-1}if(k>$){if(at<wt&&at<G)return-1;if(at>wt&&at>G)return 1;let ot=N.comparePoint(P.leftSE.point);if(ot!==0)return ot;let et=P.comparePoint(N.rightSE.point);return et<0?1:et>0?-1:1}if(at<wt)return-1;if(at>wt)return 1;if(W<ht){let ot=N.comparePoint(P.rightSE.point);if(ot!==0)return ot}if(W>ht){let ot=P.comparePoint(N.rightSE.point);if(ot<0)return 1;if(ot>0)return-1}if(W!==ht){let ot=Et-at,et=W-k,lt=G-wt,Ft=ht-$;if(ot>et&<<Ft)return 1;if(ot<et&<>Ft)return-1}return W>ht?1:W<ht||Et<G?-1:Et>G?1:P.id<N.id?-1:P.id>N.id?1:0}constructor(P,N,k,$){this.id=++We,this.leftSE=P,P.segment=this,P.otherSE=N,this.rightSE=N,N.segment=this,N.otherSE=P,this.rings=k,this.windings=$}static fromRing(P,N,k){let $,W,ht,at=ft.comparePoints(P,N);if(at<0)$=P,W=N,ht=1;else if(at>0)$=N,W=P,ht=-1;else throw new Error(\`Tried to create degenerate segment at [\${P.x}, \${P.y}]\`);let wt=new ft($,!0),Et=new ft(W,!1);return new ee(wt,Et,[k],[ht])}replaceRightSE(P){this.rightSE=P,this.rightSE.segment=this,this.rightSE.otherSE=this.leftSE,this.leftSE.otherSE=this.rightSE}bbox(){let P=this.leftSE.point.y,N=this.rightSE.point.y;return{ll:{x:this.leftSE.point.x,y:P<N?P:N},ur:{x:this.rightSE.point.x,y:P>N?P:N}}}vector(){return{x:this.rightSE.point.x-this.leftSE.point.x,y:this.rightSE.point.y-this.leftSE.point.y}}isAnEndpoint(P){return P.x===this.leftSE.point.x&&P.y===this.leftSE.point.y||P.x===this.rightSE.point.x&&P.y===this.rightSE.point.y}comparePoint(P){if(this.isAnEndpoint(P))return 0;let N=this.leftSE.point,k=this.rightSE.point,$=this.vector();if(N.x===k.x)return P.x===N.x?0:P.x<N.x?1:-1;let W=(P.y-N.y)/$.y,ht=N.x+W*$.x;if(P.x===ht)return 0;let at=(P.x-N.x)/$.x,wt=N.y+at*$.y;return P.y===wt?0:P.y<wt?-1:1}getIntersection(P){let N=this.bbox(),k=P.bbox(),$=S(N,k);if($===null)return null;let W=this.leftSE.point,ht=this.rightSE.point,at=P.leftSE.point,wt=P.rightSE.point,Et=I(N,at)&&this.comparePoint(at)===0,G=I(k,W)&&P.comparePoint(W)===0,ot=I(N,wt)&&this.comparePoint(wt)===0,et=I(k,ht)&&P.comparePoint(ht)===0;if(G&&Et)return et&&!ot?ht:!et&&ot?wt:null;if(G)return ot&&W.x===wt.x&&W.y===wt.y?null:W;if(Et)return et&&ht.x===at.x&&ht.y===at.y?null:at;if(et&&ot)return null;if(et)return ht;if(ot)return wt;let lt=xe(W,this.vector(),at,P.vector());return lt===null||!I($,lt)?null:X.round(lt.x,lt.y)}split(P){let N=[],k=P.events!==void 0,$=new ft(P,!0),W=new ft(P,!1),ht=this.rightSE;this.replaceRightSE(W),N.push(W),N.push($);let at=new ee($,ht,this.rings.slice(),this.windings.slice());return ft.comparePoints(at.leftSE.point,at.rightSE.point)>0&&at.swapEvents(),ft.comparePoints(this.leftSE.point,this.rightSE.point)>0&&this.swapEvents(),k&&($.checkForConsuming(),W.checkForConsuming()),N}swapEvents(){let P=this.rightSE;this.rightSE=this.leftSE,this.leftSE=P,this.leftSE.isLeft=!0,this.rightSE.isLeft=!1;for(let N=0,k=this.windings.length;N<k;N++)this.windings[N]*=-1}consume(P){let N=this,k=P;for(;N.consumedBy;)N=N.consumedBy;for(;k.consumedBy;)k=k.consumedBy;let $=ee.compare(N,k);if($!==0){if($>0){let W=N;N=k,k=W}if(N.prev===k){let W=N;N=k,k=W}for(let W=0,ht=k.rings.length;W<ht;W++){let at=k.rings[W],wt=k.windings[W],Et=N.rings.indexOf(at);Et===-1?(N.rings.push(at),N.windings.push(wt)):N.windings[Et]+=wt}k.rings=null,k.windings=null,k.consumedBy=N,k.leftSE.consumedBy=N.leftSE,k.rightSE.consumedBy=N.rightSE}}prevInResult(){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)}beforeState(){if(this._beforeState!==void 0)return this._beforeState;if(!this.prev)this._beforeState={rings:[],windings:[],multiPolys:[]};else{let P=this.prev.consumedBy||this.prev;this._beforeState=P.afterState()}return this._beforeState}afterState(){if(this._afterState!==void 0)return this._afterState;let P=this.beforeState();this._afterState={rings:P.rings.slice(0),windings:P.windings.slice(0),multiPolys:[]};let N=this._afterState.rings,k=this._afterState.windings,$=this._afterState.multiPolys;for(let at=0,wt=this.rings.length;at<wt;at++){let Et=this.rings[at],G=this.windings[at],ot=N.indexOf(Et);ot===-1?(N.push(Et),k.push(G)):k[ot]+=G}let W=[],ht=[];for(let at=0,wt=N.length;at<wt;at++){if(k[at]===0)continue;let Et=N[at],G=Et.poly;if(ht.indexOf(G)===-1)if(Et.isExterior)W.push(G);else{ht.indexOf(G)===-1&&ht.push(G);let ot=W.indexOf(Et.poly);ot!==-1&&W.splice(ot,1)}}for(let at=0,wt=W.length;at<wt;at++){let Et=W[at].multiPoly;$.indexOf(Et)===-1&&$.push(Et)}return this._afterState}isInResult(){if(this.consumedBy)return!1;if(this._isInResult!==void 0)return this._isInResult;let P=this.beforeState().multiPolys,N=this.afterState().multiPolys;switch(dt.type){case"union":{let k=P.length===0,$=N.length===0;this._isInResult=k!==$;break}case"intersection":{let k,$;P.length<N.length?(k=P.length,$=N.length):(k=N.length,$=P.length),this._isInResult=$===dt.numMultiPolys&&k<$;break}case"xor":{let k=Math.abs(P.length-N.length);this._isInResult=k%2===1;break}case"difference":{let k=$=>$.length===1&&$[0].isSubject;this._isInResult=k(P)!==k(N);break}default:throw new Error(\`Unrecognized operation type found \${dt.type}\`)}return this._isInResult}}class ge{constructor(P,N,k){if(!Array.isArray(P)||P.length===0)throw new Error("Input geometry is not a valid Polygon or MultiPolygon");if(this.poly=N,this.isExterior=k,this.segments=[],typeof P[0][0]!="number"||typeof P[0][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");let $=X.round(P[0][0],P[0][1]);this.bbox={ll:{x:$.x,y:$.y},ur:{x:$.x,y:$.y}};let W=$;for(let ht=1,at=P.length;ht<at;ht++){if(typeof P[ht][0]!="number"||typeof P[ht][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");let wt=X.round(P[ht][0],P[ht][1]);wt.x===W.x&&wt.y===W.y||(this.segments.push(ee.fromRing(W,wt,this)),wt.x<this.bbox.ll.x&&(this.bbox.ll.x=wt.x),wt.y<this.bbox.ll.y&&(this.bbox.ll.y=wt.y),wt.x>this.bbox.ur.x&&(this.bbox.ur.x=wt.x),wt.y>this.bbox.ur.y&&(this.bbox.ur.y=wt.y),W=wt)}($.x!==W.x||$.y!==W.y)&&this.segments.push(ee.fromRing(W,$,this))}getSweepEvents(){let P=[];for(let N=0,k=this.segments.length;N<k;N++){let $=this.segments[N];P.push($.leftSE),P.push($.rightSE)}return P}}class fe{constructor(P,N){if(!Array.isArray(P))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");this.exteriorRing=new ge(P[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(let k=1,$=P.length;k<$;k++){let W=new ge(P[k],this,!1);W.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=W.bbox.ll.x),W.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=W.bbox.ll.y),W.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=W.bbox.ur.x),W.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=W.bbox.ur.y),this.interiorRings.push(W)}this.multiPoly=N}getSweepEvents(){let P=this.exteriorRing.getSweepEvents();for(let N=0,k=this.interiorRings.length;N<k;N++){let $=this.interiorRings[N].getSweepEvents();for(let W=0,ht=$.length;W<ht;W++)P.push($[W])}return P}}class Te{constructor(P,N){if(!Array.isArray(P))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");try{typeof P[0][0][0]=="number"&&(P=[P])}catch(k){}this.polys=[],this.bbox={ll:{x:Number.POSITIVE_INFINITY,y:Number.POSITIVE_INFINITY},ur:{x:Number.NEGATIVE_INFINITY,y:Number.NEGATIVE_INFINITY}};for(let k=0,$=P.length;k<$;k++){let W=new fe(P[k],this);W.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=W.bbox.ll.x),W.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=W.bbox.ll.y),W.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=W.bbox.ur.x),W.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=W.bbox.ur.y),this.polys.push(W)}this.isSubject=N}getSweepEvents(){let P=[];for(let N=0,k=this.polys.length;N<k;N++){let $=this.polys[N].getSweepEvents();for(let W=0,ht=$.length;W<ht;W++)P.push($[W])}return P}}class be{static factory(P){let N=[];for(let k=0,$=P.length;k<$;k++){let W=P[k];if(!W.isInResult()||W.ringOut)continue;let ht=null,at=W.leftSE,wt=W.rightSE,Et=[at],G=at.point,ot=[];for(;ht=at,at=wt,Et.push(at),at.point!==G;)for(;;){let et=at.getAvailableLinkedEvents();if(et.length===0){let Kt=Et[0].point,me=Et[Et.length-1].point;throw new Error(\`Unable to complete output ring starting at [\${Kt.x}, \${Kt.y}]. Last matching segment found ends at [\${me.x}, \${me.y}].\`)}if(et.length===1){wt=et[0].otherSE;break}let lt=null;for(let Kt=0,me=ot.length;Kt<me;Kt++)if(ot[Kt].point===at.point){lt=Kt;break}if(lt!==null){let Kt=ot.splice(lt)[0],me=Et.splice(Kt.index);me.unshift(me[0].otherSE),N.push(new be(me.reverse()));continue}ot.push({index:Et.length,point:at.point});let Ft=at.getLeftmostComparator(ht);wt=et.sort(Ft)[0].otherSE;break}N.push(new be(Et))}return N}constructor(P){this.events=P;for(let N=0,k=P.length;N<k;N++)P[N].segment.ringOut=this;this.poly=null}getGeom(){let P=this.events[0].point,N=[P];for(let Et=1,G=this.events.length-1;Et<G;Et++){let ot=this.events[Et].point,et=this.events[Et+1].point;Ut(ot,P,et)!==0&&(N.push(ot),P=ot)}if(N.length===1)return null;let k=N[0],$=N[1];Ut(k,P,$)===0&&N.shift(),N.push(N[0]);let W=this.isExteriorRing()?1:-1,ht=this.isExteriorRing()?0:N.length-1,at=this.isExteriorRing()?N.length:-1,wt=[];for(let Et=ht;Et!=at;Et+=W)wt.push([N[Et].x,N[Et].y]);return wt}isExteriorRing(){if(this._isExteriorRing===void 0){let P=this.enclosingRing();this._isExteriorRing=P?!P.isExteriorRing():!0}return this._isExteriorRing}enclosingRing(){return this._enclosingRing===void 0&&(this._enclosingRing=this._calcEnclosingRing()),this._enclosingRing}_calcEnclosingRing(){let P=this.events[0];for(let $=1,W=this.events.length;$<W;$++){let ht=this.events[$];ft.compare(P,ht)>0&&(P=ht)}let N=P.segment.prevInResult(),k=N?N.prevInResult():null;for(;;){if(!N)return null;if(!k)return N.ringOut;if(k.ringOut!==N.ringOut)return k.ringOut.enclosingRing()!==N.ringOut?N.ringOut:N.ringOut.enclosingRing();N=k.prevInResult(),k=N?N.prevInResult():null}}}class Wt{constructor(P){this.exteriorRing=P,P.poly=this,this.interiorRings=[]}addInterior(P){this.interiorRings.push(P),P.poly=this}getGeom(){let P=[this.exteriorRing.getGeom()];if(P[0]===null)return null;for(let N=0,k=this.interiorRings.length;N<k;N++){let $=this.interiorRings[N].getGeom();$!==null&&P.push($)}return P}}class Me{constructor(P){this.rings=P,this.polys=this._composePolys(P)}getGeom(){let P=[];for(let N=0,k=this.polys.length;N<k;N++){let $=this.polys[N].getGeom();$!==null&&P.push($)}return P}_composePolys(P){let N=[];for(let k=0,$=P.length;k<$;k++){let W=P[k];if(!W.poly)if(W.isExteriorRing())N.push(new Wt(W));else{let ht=W.enclosingRing();ht.poly||N.push(new Wt(ht)),ht.poly.addInterior(W)}}return N}}class tt{constructor(P){let N=arguments.length>1&&arguments[1]!==void 0?arguments[1]:ee.compare;this.queue=P,this.tree=new g(N),this.segments=[]}process(P){let N=P.segment,k=[];if(P.consumedBy)return P.isLeft?this.queue.remove(P.otherSE):this.tree.remove(N),k;let $=P.isLeft?this.tree.add(N):this.tree.find(N);if(!$)throw new Error(\`Unable to find segment #\${N.id} [\${N.leftSE.point.x}, \${N.leftSE.point.y}] -> [\${N.rightSE.point.x}, \${N.rightSE.point.y}] in SweepLine tree.\`);let W=$,ht=$,at,wt;for(;at===void 0;)W=this.tree.prev(W),W===null?at=null:W.key.consumedBy===void 0&&(at=W.key);for(;wt===void 0;)ht=this.tree.next(ht),ht===null?wt=null:ht.key.consumedBy===void 0&&(wt=ht.key);if(P.isLeft){let Et=null;if(at){let ot=at.getIntersection(N);if(ot!==null&&(N.isAnEndpoint(ot)||(Et=ot),!at.isAnEndpoint(ot))){let et=this._splitSafely(at,ot);for(let lt=0,Ft=et.length;lt<Ft;lt++)k.push(et[lt])}}let G=null;if(wt){let ot=wt.getIntersection(N);if(ot!==null&&(N.isAnEndpoint(ot)||(G=ot),!wt.isAnEndpoint(ot))){let et=this._splitSafely(wt,ot);for(let lt=0,Ft=et.length;lt<Ft;lt++)k.push(et[lt])}}if(Et!==null||G!==null){let ot=null;Et===null?ot=G:G===null?ot=Et:ot=ft.comparePoints(Et,G)<=0?Et:G,this.queue.remove(N.rightSE),k.push(N.rightSE);let et=N.split(ot);for(let lt=0,Ft=et.length;lt<Ft;lt++)k.push(et[lt])}k.length>0?(this.tree.remove(N),k.push(P)):(this.segments.push(N),N.prev=at)}else{if(at&&wt){let Et=at.getIntersection(wt);if(Et!==null){if(!at.isAnEndpoint(Et)){let G=this._splitSafely(at,Et);for(let ot=0,et=G.length;ot<et;ot++)k.push(G[ot])}if(!wt.isAnEndpoint(Et)){let G=this._splitSafely(wt,Et);for(let ot=0,et=G.length;ot<et;ot++)k.push(G[ot])}}}this.tree.remove(N)}return k}_splitSafely(P,N){this.tree.remove(P);let k=P.rightSE;this.queue.remove(k);let $=P.split(N);return $.push(k),P.consumedBy===void 0&&this.tree.add(P),$}}let z=typeof process!="undefined"&&process.env.POLYGON_CLIPPING_MAX_QUEUE_SIZE||1e6,Pt=typeof process!="undefined"&&process.env.POLYGON_CLIPPING_MAX_SWEEPLINE_SEGMENTS||1e6;class Ot{run(P,N,k){dt.type=P,X.reset();let $=[new Te(N,!0)];for(let ot=0,et=k.length;ot<et;ot++)$.push(new Te(k[ot],!1));if(dt.numMultiPolys=$.length,dt.type==="difference"){let ot=$[0],et=1;for(;et<$.length;)S($[et].bbox,ot.bbox)!==null?et++:$.splice(et,1)}if(dt.type==="intersection")for(let ot=0,et=$.length;ot<et;ot++){let lt=$[ot];for(let Ft=ot+1,Kt=$.length;Ft<Kt;Ft++)if(S(lt.bbox,$[Ft].bbox)===null)return[]}let W=new g(ft.compare);for(let ot=0,et=$.length;ot<et;ot++){let lt=$[ot].getSweepEvents();for(let Ft=0,Kt=lt.length;Ft<Kt;Ft++)if(W.insert(lt[Ft]),W.size>z)throw new Error("Infinite loop when putting segment endpoints in a priority queue (queue size too big).")}let ht=new tt(W),at=W.size,wt=W.pop();for(;wt;){let ot=wt.key;if(W.size===at){let lt=ot.segment;throw new Error(\`Unable to pop() \${ot.isLeft?"left":"right"} SweepEvent [\${ot.point.x}, \${ot.point.y}] from segment #\${lt.id} [\${lt.leftSE.point.x}, \${lt.leftSE.point.y}] -> [\${lt.rightSE.point.x}, \${lt.rightSE.point.y}] from queue.\`)}if(W.size>z)throw new Error("Infinite loop when passing sweep line over endpoints (queue size too big).");if(ht.segments.length>Pt)throw new Error("Infinite loop when passing sweep line over endpoints (too many sweep line segments).");let et=ht.process(ot);for(let lt=0,Ft=et.length;lt<Ft;lt++){let Kt=et[lt];Kt.consumedBy===void 0&&W.insert(Kt)}at=W.size,wt=W.pop()}X.reset();let Et=be.factory(ht.segments);return new Me(Et).getGeom()}}let dt=new Ot;var ne={union:function(rt){for(var P=arguments.length,N=new Array(P>1?P-1:0),k=1;k<P;k++)N[k-1]=arguments[k];return dt.run("union",rt,N)},intersection:function(rt){for(var P=arguments.length,N=new Array(P>1?P-1:0),k=1;k<P;k++)N[k-1]=arguments[k];return dt.run("intersection",rt,N)},xor:function(rt){for(var P=arguments.length,N=new Array(P>1?P-1:0),k=1;k<P;k++)N[k-1]=arguments[k];return dt.run("xor",rt,N)},difference:function(rt){for(var P=arguments.length,N=new Array(P>1?P-1:0),k=1;k<P;k++)N[k-1]=arguments[k];return dt.run("difference",rt,N)}};return ne})});var tN=st((zg,QL)=>{(function(n,t){typeof zg=="object"&&typeof QL!="undefined"?t(zg):typeof define=="function"&&define.amd?define(["exports"],t):t(n.jsts={})})(zg,function(n){"use strict";function t(){}function e(r){this.message=r||""}function o(r){this.message=r||""}function s(r){this.message=r||""}function l(){}function p(r){return r===null?Je:r.color}function h(r){return r===null?null:r.parent}function g(r,i){r!==null&&(r.color=i)}function m(r){return r===null?null:r.left}function v(r){return r===null?null:r.right}function x(){this.root_=null,this.size_=0}function E(){}function M(){this.array_=[],arguments[0]instanceof at&&this.addAll(arguments[0])}function A(){}function I(r){this.message=r||""}function S(){this.array_=[]}"fill"in Array.prototype||Object.defineProperty(Array.prototype,"fill",{configurable:!0,value:function(r){if(this===void 0||this===null)throw new TypeError(this+" is not an object");var i=Object(this),a=Math.max(Math.min(i.length,9007199254740991),0)||0,c=1 in arguments&&parseInt(Number(arguments[1]),10)||0;c=c<0?Math.max(a+c,0):Math.min(c,a);var d=2 in arguments&&arguments[2]!==void 0?parseInt(Number(arguments[2]),10)||0:a;for(d=d<0?Math.max(a+arguments[2],0):Math.min(d,a);c<d;)i[c]=r,++c;return i},writable:!0}),Number.isFinite=Number.isFinite||function(r){return typeof r=="number"&&isFinite(r)},Number.isInteger=Number.isInteger||function(r){return typeof r=="number"&&isFinite(r)&&Math.floor(r)===r},Number.parseFloat=Number.parseFloat||parseFloat,Number.isNaN=Number.isNaN||function(r){return r!=r},Math.trunc=Math.trunc||function(r){return r<0?Math.ceil(r):Math.floor(r)};var w=function(){};w.prototype.interfaces_=function(){return[]},w.prototype.getClass=function(){return w},w.prototype.equalsWithTolerance=function(r,i,a){return Math.abs(r-i)<=a};var R=function(r){function i(a){r.call(this,a),this.name="IllegalArgumentException",this.message=a,this.stack=new r().stack}return r&&(i.__proto__=r),i.prototype=Object.create(r&&r.prototype),i.prototype.constructor=i,i}(Error),C=function(){},F={MAX_VALUE:{configurable:!0}};C.isNaN=function(r){return Number.isNaN(r)},C.doubleToLongBits=function(r){return r},C.longBitsToDouble=function(r){return r},C.isInfinite=function(r){return!Number.isFinite(r)},F.MAX_VALUE.get=function(){return Number.MAX_VALUE},Object.defineProperties(C,F);var V=function(){},X=function(){},q=function(){},D=function r(){if(this.x=null,this.y=null,this.z=null,arguments.length===0)this.x=0,this.y=0,this.z=r.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=r.NULL_ORDINATE):arguments.length===3&&(this.x=arguments[0],this.y=arguments[1],this.z=arguments[2])},xt={DimensionalComparator:{configurable:!0},serialVersionUID:{configurable:!0},NULL_ORDINATE:{configurable:!0},X:{configurable:!0},Y:{configurable:!0},Z:{configurable:!0}};D.prototype.setOrdinate=function(r,i){switch(r){case D.X:this.x=i;break;case D.Y:this.y=i;break;case D.Z:this.z=i;break;default:throw new R("Invalid ordinate index: "+r)}},D.prototype.equals2D=function(){if(arguments.length===1){var r=arguments[0];return this.x===r.x&&this.y===r.y}if(arguments.length===2){var i=arguments[0],a=arguments[1];return!!w.equalsWithTolerance(this.x,i.x,a)&&!!w.equalsWithTolerance(this.y,i.y,a)}},D.prototype.getOrdinate=function(r){switch(r){case D.X:return this.x;case D.Y:return this.y;case D.Z:return this.z}throw new R("Invalid ordinate index: "+r)},D.prototype.equals3D=function(r){return this.x===r.x&&this.y===r.y&&(this.z===r.z||C.isNaN(this.z))&&C.isNaN(r.z)},D.prototype.equals=function(r){return r instanceof D&&this.equals2D(r)},D.prototype.equalInZ=function(r,i){return w.equalsWithTolerance(this.z,r.z,i)},D.prototype.compareTo=function(r){var i=r;return this.x<i.x?-1:this.x>i.x?1:this.y<i.y?-1:this.y>i.y?1:0},D.prototype.clone=function(){},D.prototype.copy=function(){return new D(this)},D.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},D.prototype.distance3D=function(r){var i=this.x-r.x,a=this.y-r.y,c=this.z-r.z;return Math.sqrt(i*i+a*a+c*c)},D.prototype.distance=function(r){var i=this.x-r.x,a=this.y-r.y;return Math.sqrt(i*i+a*a)},D.prototype.hashCode=function(){var r=17;return r=37*r+D.hashCode(this.x),r=37*r+D.hashCode(this.y)},D.prototype.setCoordinate=function(r){this.x=r.x,this.y=r.y,this.z=r.z},D.prototype.interfaces_=function(){return[V,X,t]},D.prototype.getClass=function(){return D},D.hashCode=function(){if(arguments.length===1){var r=arguments[0],i=C.doubleToLongBits(r);return Math.trunc((i^i)>>>32)}},xt.DimensionalComparator.get=function(){return B},xt.serialVersionUID.get=function(){return 6683108902428367e3},xt.NULL_ORDINATE.get=function(){return C.NaN},xt.X.get=function(){return 0},xt.Y.get=function(){return 1},xt.Z.get=function(){return 2},Object.defineProperties(D,xt);var B=function(r){if(this._dimensionsToTest=2,arguments.length!==0){if(arguments.length===1){var i=arguments[0];if(i!==2&&i!==3)throw new R("only 2 or 3 dimensions may be specified");this._dimensionsToTest=i}}};B.prototype.compare=function(r,i){var a=r,c=i,d=B.compare(a.x,c.x);if(d!==0)return d;var _=B.compare(a.y,c.y);return _!==0?_:this._dimensionsToTest<=2?0:B.compare(a.z,c.z)},B.prototype.interfaces_=function(){return[q]},B.prototype.getClass=function(){return B},B.compare=function(r,i){return r<i?-1:r>i?1:C.isNaN(r)?C.isNaN(i)?0:-1:C.isNaN(i)?1:0};var j=function(){};j.prototype.create=function(){},j.prototype.interfaces_=function(){return[]},j.prototype.getClass=function(){return j};var J=function(){},Dt={INTERIOR:{configurable:!0},BOUNDARY:{configurable:!0},EXTERIOR:{configurable:!0},NONE:{configurable:!0}};J.prototype.interfaces_=function(){return[]},J.prototype.getClass=function(){return J},J.toLocationSymbol=function(r){switch(r){case J.EXTERIOR:return"e";case J.BOUNDARY:return"b";case J.INTERIOR:return"i";case J.NONE:return"-"}throw new R("Unknown location value: "+r)},Dt.INTERIOR.get=function(){return 0},Dt.BOUNDARY.get=function(){return 1},Dt.EXTERIOR.get=function(){return 2},Dt.NONE.get=function(){return-1},Object.defineProperties(J,Dt);var Q=function(r,i){return r.interfaces_&&r.interfaces_().indexOf(i)>-1},At=function(){},Mt={LOG_10:{configurable:!0}};At.prototype.interfaces_=function(){return[]},At.prototype.getClass=function(){return At},At.log10=function(r){var i=Math.log(r);return C.isInfinite(i)||C.isNaN(i)?i:i/At.LOG_10},At.min=function(r,i,a,c){var d=r;return i<d&&(d=i),a<d&&(d=a),c<d&&(d=c),d},At.clamp=function(){if(typeof arguments[2]=="number"&&typeof arguments[0]=="number"&&typeof arguments[1]=="number"){var r=arguments[0],i=arguments[1],a=arguments[2];return r<i?i:r>a?a:r}if(Number.isInteger(arguments[2])&&Number.isInteger(arguments[0])&&Number.isInteger(arguments[1])){var c=arguments[0],d=arguments[1],_=arguments[2];return c<d?d:c>_?_:c}},At.wrap=function(r,i){return r<0?i- -r%i:r%i},At.max=function(){if(arguments.length===3){var r=arguments[0],i=arguments[1],a=arguments[2],c=r;return i>c&&(c=i),a>c&&(c=a),c}if(arguments.length===4){var d=arguments[0],_=arguments[1],b=arguments[2],L=arguments[3],H=d;return _>H&&(H=_),b>H&&(H=b),L>H&&(H=L),H}},At.average=function(r,i){return(r+i)/2},Mt.LOG_10.get=function(){return Math.log(10)},Object.defineProperties(At,Mt);var Lt=function(r){this.str=r};Lt.prototype.append=function(r){this.str+=r},Lt.prototype.setCharAt=function(r,i){this.str=this.str.substr(0,r)+i+this.str.substr(r+1)},Lt.prototype.toString=function(r){return this.str};var pt=function(r){this.value=r};pt.prototype.intValue=function(){return this.value},pt.prototype.compareTo=function(r){return this.value<r?-1:this.value>r?1:0},pt.isNaN=function(r){return Number.isNaN(r)};var yt=function(){};yt.isWhitespace=function(r){return r<=32&&r>=0||r===127},yt.toUpperCase=function(r){return r.toUpperCase()};var K=function r(){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 r){var a=arguments[0];this.init(a)}else if(typeof arguments[0]=="string"){var c=arguments[0];r.call(this,r.parse(c))}}else if(arguments.length===2){var d=arguments[0],_=arguments[1];this.init(d,_)}},Bt={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}};K.prototype.le=function(r){return(this._hi<r._hi||this._hi===r._hi)&&this._lo<=r._lo},K.prototype.extractSignificantDigits=function(r,i){var a=this.abs(),c=K.magnitude(a._hi),d=K.TEN.pow(c);(a=a.divide(d)).gt(K.TEN)?(a=a.divide(K.TEN),c+=1):a.lt(K.ONE)&&(a=a.multiply(K.TEN),c-=1);for(var _=c+1,b=new Lt,L=K.MAX_PRINT_DIGITS-1,H=0;H<=L;H++){r&&H===_&&b.append(".");var it=Math.trunc(a._hi);if(it<0)break;var bt=!1,Tt=0;it>9?(bt=!0,Tt="9"):Tt="0"+it,b.append(Tt),a=a.subtract(K.valueOf(it)).multiply(K.TEN),bt&&a.selfAdd(K.TEN);var Jt=!0,Qt=K.magnitude(a._hi);if(Qt<0&&Math.abs(Qt)>=L-H&&(Jt=!1),!Jt)break}return i[0]=c,b.toString()},K.prototype.sqr=function(){return this.multiply(this)},K.prototype.doubleValue=function(){return this._hi+this._lo},K.prototype.subtract=function(){if(arguments[0]instanceof K){var r=arguments[0];return this.add(r.negate())}if(typeof arguments[0]=="number"){var i=arguments[0];return this.add(-i)}},K.prototype.equals=function(){if(arguments.length===1){var r=arguments[0];return this._hi===r._hi&&this._lo===r._lo}},K.prototype.isZero=function(){return this._hi===0&&this._lo===0},K.prototype.selfSubtract=function(){if(arguments[0]instanceof K){var r=arguments[0];return this.isNaN()?this:this.selfAdd(-r._hi,-r._lo)}if(typeof arguments[0]=="number"){var i=arguments[0];return this.isNaN()?this:this.selfAdd(-i,0)}},K.prototype.getSpecialNumberString=function(){return this.isZero()?"0.0":this.isNaN()?"NaN ":null},K.prototype.min=function(r){return this.le(r)?this:r},K.prototype.selfDivide=function(){if(arguments.length===1){if(arguments[0]instanceof K){var r=arguments[0];return this.selfDivide(r._hi,r._lo)}if(typeof arguments[0]=="number"){var i=arguments[0];return this.selfDivide(i,0)}}else if(arguments.length===2){var a=arguments[0],c=arguments[1],d=null,_=null,b=null,L=null,H=null,it=null,bt=null,Tt=null;return H=this._hi/a,it=K.SPLIT*H,d=it-H,Tt=K.SPLIT*a,d=it-d,_=H-d,b=Tt-a,bt=H*a,b=Tt-b,L=a-b,Tt=d*b-bt+d*L+_*b+_*L,it=(this._hi-bt-Tt+this._lo-H*c)/a,Tt=H+it,this._hi=Tt,this._lo=H-Tt+it,this}},K.prototype.dump=function(){return"DD<"+this._hi+", "+this._lo+">"},K.prototype.divide=function(){if(arguments[0]instanceof K){var r=arguments[0],i=null,a=null,c=null,d=null,_=null,b=null,L=null,H=null;return a=(_=this._hi/r._hi)-(i=(b=K.SPLIT*_)-(i=b-_)),H=i*(c=(H=K.SPLIT*r._hi)-(c=H-r._hi))-(L=_*r._hi)+i*(d=r._hi-c)+a*c+a*d,b=(this._hi-L-H+this._lo-_*r._lo)/r._hi,new K(H=_+b,_-H+b)}if(typeof arguments[0]=="number"){var it=arguments[0];return C.isNaN(it)?K.createNaN():K.copy(this).selfDivide(it,0)}},K.prototype.ge=function(r){return(this._hi>r._hi||this._hi===r._hi)&&this._lo>=r._lo},K.prototype.pow=function(r){if(r===0)return K.valueOf(1);var i=new K(this),a=K.valueOf(1),c=Math.abs(r);if(c>1)for(;c>0;)c%2==1&&a.selfMultiply(i),(c/=2)>0&&(i=i.sqr());else a=i;return r<0?a.reciprocal():a},K.prototype.ceil=function(){if(this.isNaN())return K.NaN;var r=Math.ceil(this._hi),i=0;return r===this._hi&&(i=Math.ceil(this._lo)),new K(r,i)},K.prototype.compareTo=function(r){var i=r;return this._hi<i._hi?-1:this._hi>i._hi?1:this._lo<i._lo?-1:this._lo>i._lo?1:0},K.prototype.rint=function(){return this.isNaN()?this:this.add(.5).floor()},K.prototype.setValue=function(){if(arguments[0]instanceof K){var r=arguments[0];return this.init(r),this}if(typeof arguments[0]=="number"){var i=arguments[0];return this.init(i),this}},K.prototype.max=function(r){return this.ge(r)?this:r},K.prototype.sqrt=function(){if(this.isZero())return K.valueOf(0);if(this.isNegative())return K.NaN;var r=1/Math.sqrt(this._hi),i=this._hi*r,a=K.valueOf(i),c=this.subtract(a.sqr())._hi*(.5*r);return a.add(c)},K.prototype.selfAdd=function(){if(arguments.length===1){if(arguments[0]instanceof K){var r=arguments[0];return this.selfAdd(r._hi,r._lo)}if(typeof arguments[0]=="number"){var i=arguments[0],a=null,c=null,d=null,_=null,b=null,L=null;return d=this._hi+i,b=d-this._hi,_=d-b,_=i-b+(this._hi-_),L=_+this._lo,a=d+L,c=L+(d-a),this._hi=a+c,this._lo=c+(a-this._hi),this}}else if(arguments.length===2){var H=arguments[0],it=arguments[1],bt=null,Tt=null,Jt=null,Qt=null,le=null,Ee=null,Dn=null;Qt=this._hi+H,Tt=this._lo+it,le=Qt-(Ee=Qt-this._hi),Jt=Tt-(Dn=Tt-this._lo);var Kn=(bt=Qt+(Ee=(le=H-Ee+(this._hi-le))+Tt))+(Ee=(Jt=it-Dn+(this._lo-Jt))+(Ee+(Qt-bt))),fi=Ee+(bt-Kn);return this._hi=Kn,this._lo=fi,this}},K.prototype.selfMultiply=function(){if(arguments.length===1){if(arguments[0]instanceof K){var r=arguments[0];return this.selfMultiply(r._hi,r._lo)}if(typeof arguments[0]=="number"){var i=arguments[0];return this.selfMultiply(i,0)}}else if(arguments.length===2){var a=arguments[0],c=arguments[1],d=null,_=null,b=null,L=null,H=null,it=null;d=(H=K.SPLIT*this._hi)-this._hi,it=K.SPLIT*a,d=H-d,_=this._hi-d,b=it-a;var bt=(H=this._hi*a)+(it=d*(b=it-b)-H+d*(L=a-b)+_*b+_*L+(this._hi*c+this._lo*a)),Tt=it+(d=H-bt);return this._hi=bt,this._lo=Tt,this}},K.prototype.selfSqr=function(){return this.selfMultiply(this)},K.prototype.floor=function(){if(this.isNaN())return K.NaN;var r=Math.floor(this._hi),i=0;return r===this._hi&&(i=Math.floor(this._lo)),new K(r,i)},K.prototype.negate=function(){return this.isNaN()?this:new K(-this._hi,-this._lo)},K.prototype.clone=function(){},K.prototype.multiply=function(){if(arguments[0]instanceof K){var r=arguments[0];return r.isNaN()?K.createNaN():K.copy(this).selfMultiply(r)}if(typeof arguments[0]=="number"){var i=arguments[0];return C.isNaN(i)?K.createNaN():K.copy(this).selfMultiply(i,0)}},K.prototype.isNaN=function(){return C.isNaN(this._hi)},K.prototype.intValue=function(){return Math.trunc(this._hi)},K.prototype.toString=function(){var r=K.magnitude(this._hi);return r>=-3&&r<=20?this.toStandardNotation():this.toSciNotation()},K.prototype.toStandardNotation=function(){var r=this.getSpecialNumberString();if(r!==null)return r;var i=new Array(1).fill(null),a=this.extractSignificantDigits(!0,i),c=i[0]+1,d=a;if(a.charAt(0)===".")d="0"+a;else if(c<0)d="0."+K.stringOfChar("0",-c)+a;else if(a.indexOf(".")===-1){var _=c-a.length;d=a+K.stringOfChar("0",_)+".0"}return this.isNegative()?"-"+d:d},K.prototype.reciprocal=function(){var r=null,i=null,a=null,c=null,d=null,_=null,b=null,L=null;i=(d=1/this._hi)-(r=(_=K.SPLIT*d)-(r=_-d)),a=(L=K.SPLIT*this._hi)-this._hi;var H=d+(_=(1-(b=d*this._hi)-(L=r*(a=L-a)-b+r*(c=this._hi-a)+i*a+i*c)-d*this._lo)/this._hi);return new K(H,d-H+_)},K.prototype.toSciNotation=function(){if(this.isZero())return K.SCI_NOT_ZERO;var r=this.getSpecialNumberString();if(r!==null)return r;var i=new Array(1).fill(null),a=this.extractSignificantDigits(!1,i),c=K.SCI_NOT_EXPONENT_CHAR+i[0];if(a.charAt(0)==="0")throw new Error("Found leading zero: "+a);var d="";a.length>1&&(d=a.substring(1));var _=a.charAt(0)+"."+d;return this.isNegative()?"-"+_+c:_+c},K.prototype.abs=function(){return this.isNaN()?K.NaN:this.isNegative()?this.negate():new K(this)},K.prototype.isPositive=function(){return(this._hi>0||this._hi===0)&&this._lo>0},K.prototype.lt=function(r){return(this._hi<r._hi||this._hi===r._hi)&&this._lo<r._lo},K.prototype.add=function(){if(arguments[0]instanceof K){var r=arguments[0];return K.copy(this).selfAdd(r)}if(typeof arguments[0]=="number"){var i=arguments[0];return K.copy(this).selfAdd(i)}},K.prototype.init=function(){if(arguments.length===1){if(typeof arguments[0]=="number"){var r=arguments[0];this._hi=r,this._lo=0}else if(arguments[0]instanceof K){var i=arguments[0];this._hi=i._hi,this._lo=i._lo}}else if(arguments.length===2){var a=arguments[0],c=arguments[1];this._hi=a,this._lo=c}},K.prototype.gt=function(r){return(this._hi>r._hi||this._hi===r._hi)&&this._lo>r._lo},K.prototype.isNegative=function(){return(this._hi<0||this._hi===0)&&this._lo<0},K.prototype.trunc=function(){return this.isNaN()?K.NaN:this.isPositive()?this.floor():this.ceil()},K.prototype.signum=function(){return this._hi>0?1:this._hi<0?-1:this._lo>0?1:this._lo<0?-1:0},K.prototype.interfaces_=function(){return[t,V,X]},K.prototype.getClass=function(){return K},K.sqr=function(r){return K.valueOf(r).selfMultiply(r)},K.valueOf=function(){if(typeof arguments[0]=="string"){var r=arguments[0];return K.parse(r)}if(typeof arguments[0]=="number"){var i=arguments[0];return new K(i)}},K.sqrt=function(r){return K.valueOf(r).sqrt()},K.parse=function(r){for(var i=0,a=r.length;yt.isWhitespace(r.charAt(i));)i++;var c=!1;if(i<a){var d=r.charAt(i);d!=="-"&&d!=="+"||(i++,d==="-"&&(c=!0))}for(var _=new K,b=0,L=0,H=0;!(i>=a);){var it=r.charAt(i);if(i++,yt.isDigit(it)){var bt=it-"0";_.selfMultiply(K.TEN),_.selfAdd(bt),b++}else{if(it!=="."){if(it==="e"||it==="E"){var Tt=r.substring(i);try{H=pt.parseInt(Tt)}catch(Dn){throw Dn instanceof Error?new Error("Invalid exponent "+Tt+" in string "+r):Dn}break}throw new Error("Unexpected character '"+it+"' at position "+i+" in string "+r)}L=b}}var Jt=_,Qt=b-L-H;if(Qt===0)Jt=_;else if(Qt>0){var le=K.TEN.pow(Qt);Jt=_.divide(le)}else if(Qt<0){var Ee=K.TEN.pow(-Qt);Jt=_.multiply(Ee)}return c?Jt.negate():Jt},K.createNaN=function(){return new K(C.NaN,C.NaN)},K.copy=function(r){return new K(r)},K.magnitude=function(r){var i=Math.abs(r),a=Math.log(i)/Math.log(10),c=Math.trunc(Math.floor(a));return 10*Math.pow(10,c)<=i&&(c+=1),c},K.stringOfChar=function(r,i){for(var a=new Lt,c=0;c<i;c++)a.append(r);return a.toString()},Bt.PI.get=function(){return new K(3.141592653589793,12246467991473532e-32)},Bt.TWO_PI.get=function(){return new K(6.283185307179586,24492935982947064e-32)},Bt.PI_2.get=function(){return new K(1.5707963267948966,6123233995736766e-32)},Bt.E.get=function(){return new K(2.718281828459045,14456468917292502e-32)},Bt.NaN.get=function(){return new K(C.NaN,C.NaN)},Bt.EPS.get=function(){return 123259516440783e-46},Bt.SPLIT.get=function(){return 134217729},Bt.MAX_PRINT_DIGITS.get=function(){return 32},Bt.TEN.get=function(){return K.valueOf(10)},Bt.ONE.get=function(){return K.valueOf(1)},Bt.SCI_NOT_EXPONENT_CHAR.get=function(){return"E"},Bt.SCI_NOT_ZERO.get=function(){return"0.0E0"},Object.defineProperties(K,Bt);var Gt=function(){},ae={DP_SAFE_EPSILON:{configurable:!0}};Gt.prototype.interfaces_=function(){return[]},Gt.prototype.getClass=function(){return Gt},Gt.orientationIndex=function(r,i,a){var c=Gt.orientationIndexFilter(r,i,a);if(c<=1)return c;var d=K.valueOf(i.x).selfAdd(-r.x),_=K.valueOf(i.y).selfAdd(-r.y),b=K.valueOf(a.x).selfAdd(-i.x),L=K.valueOf(a.y).selfAdd(-i.y);return d.selfMultiply(L).selfSubtract(_.selfMultiply(b)).signum()},Gt.signOfDet2x2=function(r,i,a,c){return r.multiply(c).selfSubtract(i.multiply(a)).signum()},Gt.intersection=function(r,i,a,c){var d=K.valueOf(c.y).selfSubtract(a.y).selfMultiply(K.valueOf(i.x).selfSubtract(r.x)),_=K.valueOf(c.x).selfSubtract(a.x).selfMultiply(K.valueOf(i.y).selfSubtract(r.y)),b=d.subtract(_),L=K.valueOf(c.x).selfSubtract(a.x).selfMultiply(K.valueOf(r.y).selfSubtract(a.y)),H=K.valueOf(c.y).selfSubtract(a.y).selfMultiply(K.valueOf(r.x).selfSubtract(a.x)),it=L.subtract(H).selfDivide(b).doubleValue(),bt=K.valueOf(r.x).selfAdd(K.valueOf(i.x).selfSubtract(r.x).selfMultiply(it)).doubleValue(),Tt=K.valueOf(i.x).selfSubtract(r.x).selfMultiply(K.valueOf(r.y).selfSubtract(a.y)),Jt=K.valueOf(i.y).selfSubtract(r.y).selfMultiply(K.valueOf(r.x).selfSubtract(a.x)),Qt=Tt.subtract(Jt).selfDivide(b).doubleValue(),le=K.valueOf(a.y).selfAdd(K.valueOf(c.y).selfSubtract(a.y).selfMultiply(Qt)).doubleValue();return new D(bt,le)},Gt.orientationIndexFilter=function(r,i,a){var c=null,d=(r.x-a.x)*(i.y-a.y),_=(r.y-a.y)*(i.x-a.x),b=d-_;if(d>0){if(_<=0)return Gt.signum(b);c=d+_}else{if(!(d<0)||_>=0)return Gt.signum(b);c=-d-_}var L=Gt.DP_SAFE_EPSILON*c;return b>=L||-b>=L?Gt.signum(b):2},Gt.signum=function(r){return r>0?1:r<0?-1:0},ae.DP_SAFE_EPSILON.get=function(){return 1e-15},Object.defineProperties(Gt,ae);var ut=function(){},Ut={X:{configurable:!0},Y:{configurable:!0},Z:{configurable:!0},M:{configurable:!0}};Ut.X.get=function(){return 0},Ut.Y.get=function(){return 1},Ut.Z.get=function(){return 2},Ut.M.get=function(){return 3},ut.prototype.setOrdinate=function(r,i,a){},ut.prototype.size=function(){},ut.prototype.getOrdinate=function(r,i){},ut.prototype.getCoordinate=function(){},ut.prototype.getCoordinateCopy=function(r){},ut.prototype.getDimension=function(){},ut.prototype.getX=function(r){},ut.prototype.clone=function(){},ut.prototype.expandEnvelope=function(r){},ut.prototype.copy=function(){},ut.prototype.getY=function(r){},ut.prototype.toCoordinateArray=function(){},ut.prototype.interfaces_=function(){return[X]},ut.prototype.getClass=function(){return ut},Object.defineProperties(ut,Ut);var jt=function(){},ce=function(r){function i(){r.call(this,"Projective point not representable on the Cartesian plane.")}return r&&(i.__proto__=r),i.prototype=Object.create(r&&r.prototype),i.prototype.constructor=i,i.prototype.interfaces_=function(){return[]},i.prototype.getClass=function(){return i},i}(jt),te=function(){};te.arraycopy=function(r,i,a,c,d){for(var _=0,b=i;b<i+d;b++)a[c+_]=r[b],_++},te.getProperty=function(r){return{"line.separator":\`
|
|
@@ -23576,4 +23576,4 @@ void main() {
|
|
|
23576
23576
|
|
|
23577
23577
|
}\`,dv=class{constructor(){this.texture=null,this.mesh=null,this.depthNear=0,this.depthFar=0}init(t,e,o){if(this.texture===null){let s=new Us,l=t.properties.get(s);l.__webglTexture=e.texture,(e.depthNear!=o.depthNear||e.depthFar!=o.depthFar)&&(this.depthNear=e.depthNear,this.depthFar=e.depthFar),this.texture=s}}render(t,e){if(this.texture!==null){if(this.mesh===null){let o=e.cameras[0].viewport,s=new Ia({extensions:{fragDepth:!0},vertexShader:sX,fragmentShader:aX,uniforms:{depthColor:{value:this.texture},depthWidth:{value:o.z},depthHeight:{value:o.w}}});this.mesh=new ra(new zd(20,20),s)}t.render(this.mesh,e)}}reset(){this.texture=null,this.mesh=null}},gv=class extends Ku{constructor(t,e){super();let o=this,s=null,l=1,p=null,h="local-floor",g=1,m=null,v=null,x=null,E=null,M=null,A=null,I=new dv,S=e.getContextAttributes(),w=null,R=null,C=[],F=[],V=new Ye,X=null,q=new gs;q.layers.enable(1),q.viewport=new ji;let D=new gs;D.layers.enable(2),D.viewport=new ji;let xt=[q,D],B=new pv;B.layers.enable(1),B.layers.enable(2);let j=null,J=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(ut){let Ut=C[ut];return Ut===void 0&&(Ut=new sh,C[ut]=Ut),Ut.getTargetRaySpace()},this.getControllerGrip=function(ut){let Ut=C[ut];return Ut===void 0&&(Ut=new sh,C[ut]=Ut),Ut.getGripSpace()},this.getHand=function(ut){let Ut=C[ut];return Ut===void 0&&(Ut=new sh,C[ut]=Ut),Ut.getHandSpace()};function Dt(ut){let Ut=F.indexOf(ut.inputSource);if(Ut===-1)return;let jt=C[Ut];jt!==void 0&&(jt.update(ut.inputSource,ut.frame,m||p),jt.dispatchEvent({type:ut.type,data:ut.inputSource}))}function Q(){s.removeEventListener("select",Dt),s.removeEventListener("selectstart",Dt),s.removeEventListener("selectend",Dt),s.removeEventListener("squeeze",Dt),s.removeEventListener("squeezestart",Dt),s.removeEventListener("squeezeend",Dt),s.removeEventListener("end",Q),s.removeEventListener("inputsourceschange",At);for(let ut=0;ut<C.length;ut++){let Ut=F[ut];Ut!==null&&(F[ut]=null,C[ut].disconnect(Ut))}j=null,J=null,I.reset(),t.setRenderTarget(w),M=null,E=null,x=null,s=null,R=null,ae.stop(),o.isPresenting=!1,t.setPixelRatio(X),t.setSize(V.width,V.height,!1),o.dispatchEvent({type:"sessionend"})}this.setFramebufferScaleFactor=function(ut){l=ut,o.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(ut){h=ut,o.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return m||p},this.setReferenceSpace=function(ut){m=ut},this.getBaseLayer=function(){return E!==null?E:M},this.getBinding=function(){return x},this.getFrame=function(){return A},this.getSession=function(){return s},this.setSession=function(ut){return ac(this,null,function*(){if(s=ut,s!==null){if(w=t.getRenderTarget(),s.addEventListener("select",Dt),s.addEventListener("selectstart",Dt),s.addEventListener("selectend",Dt),s.addEventListener("squeeze",Dt),s.addEventListener("squeezestart",Dt),s.addEventListener("squeezeend",Dt),s.addEventListener("end",Q),s.addEventListener("inputsourceschange",At),S.xrCompatible!==!0&&(yield e.makeXRCompatible()),X=t.getPixelRatio(),t.getSize(V),s.renderState.layers===void 0||t.capabilities.isWebGL2===!1){let Ut={antialias:s.renderState.layers===void 0?S.antialias:!0,alpha:!0,depth:S.depth,stencil:S.stencil,framebufferScaleFactor:l};M=new XRWebGLLayer(s,e,Ut),s.updateRenderState({baseLayer:M}),t.setPixelRatio(1),t.setSize(M.framebufferWidth,M.framebufferHeight,!1),R=new du(M.framebufferWidth,M.framebufferHeight,{format:na,type:$u,colorSpace:t.outputColorSpace,stencilBuffer:S.stencil})}else{let Ut=null,jt=null,ce=null;S.depth&&(ce=S.stencil?e.DEPTH24_STENCIL8:e.DEPTH_COMPONENT24,Ut=S.stencil?Wc:Dl,jt=S.stencil?Ol:Wu);let te={colorFormat:e.RGBA8,depthFormat:ce,scaleFactor:l};x=new XRWebGLBinding(s,e),E=x.createProjectionLayer(te),s.updateRenderState({layers:[E]}),t.setPixelRatio(1),t.setSize(E.textureWidth,E.textureHeight,!1),R=new du(E.textureWidth,E.textureHeight,{format:na,type:$u,depthTexture:new kd(E.textureWidth,E.textureHeight,jt,void 0,void 0,void 0,void 0,void 0,void 0,Ut),stencilBuffer:S.stencil,colorSpace:t.outputColorSpace,samples:S.antialias?4:0});let $t=t.properties.get(R);$t.__ignoreDepthValues=E.ignoreDepthValues}R.isXRRenderTarget=!0,this.setFoveation(g),m=null,p=yield s.requestReferenceSpace(h),ae.setContext(s),ae.start(),o.isPresenting=!0,o.dispatchEvent({type:"sessionstart"})}})},this.getEnvironmentBlendMode=function(){if(s!==null)return s.environmentBlendMode};function At(ut){for(let Ut=0;Ut<ut.removed.length;Ut++){let jt=ut.removed[Ut],ce=F.indexOf(jt);ce>=0&&(F[ce]=null,C[ce].disconnect(jt))}for(let Ut=0;Ut<ut.added.length;Ut++){let jt=ut.added[Ut],ce=F.indexOf(jt);if(ce===-1){for(let $t=0;$t<C.length;$t++)if($t>=F.length){F.push(jt),ce=$t;break}else if(F[$t]===null){F[$t]=jt,ce=$t;break}if(ce===-1)break}let te=C[ce];te&&te.connect(jt)}}let Mt=new Rt,Lt=new Rt;function pt(ut,Ut,jt){Mt.setFromMatrixPosition(Ut.matrixWorld),Lt.setFromMatrixPosition(jt.matrixWorld);let ce=Mt.distanceTo(Lt),te=Ut.projectionMatrix.elements,$t=jt.projectionMatrix.elements,qt=te[14]/(te[10]-1),xe=te[14]/(te[10]+1),ft=(te[9]+1)/te[5],We=(te[9]-1)/te[5],ee=(te[8]-1)/te[0],ge=($t[8]+1)/$t[0],fe=qt*ee,Te=qt*ge,be=ce/(-ee+ge),Wt=be*-ee;Ut.matrixWorld.decompose(ut.position,ut.quaternion,ut.scale),ut.translateX(Wt),ut.translateZ(be),ut.matrixWorld.compose(ut.position,ut.quaternion,ut.scale),ut.matrixWorldInverse.copy(ut.matrixWorld).invert();let Me=qt+be,tt=xe+be,z=fe-Wt,Pt=Te+(ce-Wt),Ot=ft*xe/tt*Me,dt=We*xe/tt*Me;ut.projectionMatrix.makePerspective(z,Pt,Ot,dt,Me,tt),ut.projectionMatrixInverse.copy(ut.projectionMatrix).invert()}function yt(ut,Ut){Ut===null?ut.matrixWorld.copy(ut.matrix):ut.matrixWorld.multiplyMatrices(Ut.matrixWorld,ut.matrix),ut.matrixWorldInverse.copy(ut.matrixWorld).invert()}this.updateCamera=function(ut){if(s===null)return;I.texture!==null&&(ut.near=I.depthNear,ut.far=I.depthFar),B.near=D.near=q.near=ut.near,B.far=D.far=q.far=ut.far,(j!==B.near||J!==B.far)&&(s.updateRenderState({depthNear:B.near,depthFar:B.far}),j=B.near,J=B.far,q.near=j,q.far=J,D.near=j,D.far=J,q.updateProjectionMatrix(),D.updateProjectionMatrix(),ut.updateProjectionMatrix());let Ut=ut.parent,jt=B.cameras;yt(B,Ut);for(let ce=0;ce<jt.length;ce++)yt(jt[ce],Ut);jt.length===2?pt(B,q,D):B.projectionMatrix.copy(q.projectionMatrix),K(ut,B,Ut)};function K(ut,Ut,jt){jt===null?ut.matrix.copy(Ut.matrixWorld):(ut.matrix.copy(jt.matrixWorld),ut.matrix.invert(),ut.matrix.multiply(Ut.matrixWorld)),ut.matrix.decompose(ut.position,ut.quaternion,ut.scale),ut.updateMatrixWorld(!0),ut.projectionMatrix.copy(Ut.projectionMatrix),ut.projectionMatrixInverse.copy(Ut.projectionMatrixInverse),ut.isPerspectiveCamera&&(ut.fov=Ky*2*Math.atan(1/ut.projectionMatrix.elements[5]),ut.zoom=1)}this.getCamera=function(){return B},this.getFoveation=function(){if(!(E===null&&M===null))return g},this.setFoveation=function(ut){g=ut,E!==null&&(E.fixedFoveation=ut),M!==null&&M.fixedFoveation!==void 0&&(M.fixedFoveation=ut)},this.hasDepthSensing=function(){return I.texture!==null};let Bt=null;function Gt(ut,Ut){if(v=Ut.getViewerPose(m||p),A=Ut,v!==null){let jt=v.views;M!==null&&(t.setRenderTargetFramebuffer(R,M.framebuffer),t.setRenderTarget(R));let ce=!1;jt.length!==B.cameras.length&&(B.cameras.length=0,ce=!0);for(let $t=0;$t<jt.length;$t++){let qt=jt[$t],xe=null;if(M!==null)xe=M.getViewport(qt);else{let We=x.getViewSubImage(E,qt);xe=We.viewport,$t===0&&(t.setRenderTargetTextures(R,We.colorTexture,E.ignoreDepthValues?void 0:We.depthStencilTexture),t.setRenderTarget(R))}let ft=xt[$t];ft===void 0&&(ft=new gs,ft.layers.enable($t),ft.viewport=new ji,xt[$t]=ft),ft.matrix.fromArray(qt.transform.matrix),ft.matrix.decompose(ft.position,ft.quaternion,ft.scale),ft.projectionMatrix.fromArray(qt.projectionMatrix),ft.projectionMatrixInverse.copy(ft.projectionMatrix).invert(),ft.viewport.set(xe.x,xe.y,xe.width,xe.height),$t===0&&(B.matrix.copy(ft.matrix),B.matrix.decompose(B.position,B.quaternion,B.scale)),ce===!0&&B.cameras.push(ft)}let te=s.enabledFeatures;if(te&&te.includes("depth-sensing")){let $t=x.getDepthInformation(jt[0]);$t&&$t.isValid&&$t.texture&&I.init(t,$t,s.renderState)}}for(let jt=0;jt<C.length;jt++){let ce=F[jt],te=C[jt];ce!==null&&te!==void 0&&te.update(ce,Ut,m||p)}I.render(t,B),Bt&&Bt(ut,Ut),Ut.detectedPlanes&&o.dispatchEvent({type:"planesdetected",data:Ut}),A=null}let ae=new xC;ae.setAnimationLoop(Gt),this.setAnimationLoop=function(ut){Bt=ut},this.dispose=function(){}}},Cl=new Ul,uX=new vi;function lX(n,t){function e(S,w){S.matrixAutoUpdate===!0&&S.updateMatrix(),w.value.copy(S.matrix)}function o(S,w){w.color.getRGB(S.fogColor.value,_C(n)),w.isFog?(S.fogNear.value=w.near,S.fogFar.value=w.far):w.isFogExp2&&(S.fogDensity.value=w.density)}function s(S,w,R,C,F){w.isMeshBasicMaterial||w.isMeshLambertMaterial?l(S,w):w.isMeshToonMaterial?(l(S,w),x(S,w)):w.isMeshPhongMaterial?(l(S,w),v(S,w)):w.isMeshStandardMaterial?(l(S,w),E(S,w),w.isMeshPhysicalMaterial&&M(S,w,F)):w.isMeshMatcapMaterial?(l(S,w),A(S,w)):w.isMeshDepthMaterial?l(S,w):w.isMeshDistanceMaterial?(l(S,w),I(S,w)):w.isMeshNormalMaterial?l(S,w):w.isLineBasicMaterial?(p(S,w),w.isLineDashedMaterial&&h(S,w)):w.isPointsMaterial?g(S,w,R,C):w.isSpriteMaterial?m(S,w):w.isShadowMaterial?(S.color.value.copy(w.color),S.opacity.value=w.opacity):w.isShaderMaterial&&(w.uniformsNeedUpdate=!1)}function l(S,w){S.opacity.value=w.opacity,w.color&&S.diffuse.value.copy(w.color),w.emissive&&S.emissive.value.copy(w.emissive).multiplyScalar(w.emissiveIntensity),w.map&&(S.map.value=w.map,e(w.map,S.mapTransform)),w.alphaMap&&(S.alphaMap.value=w.alphaMap,e(w.alphaMap,S.alphaMapTransform)),w.bumpMap&&(S.bumpMap.value=w.bumpMap,e(w.bumpMap,S.bumpMapTransform),S.bumpScale.value=w.bumpScale,w.side===$o&&(S.bumpScale.value*=-1)),w.normalMap&&(S.normalMap.value=w.normalMap,e(w.normalMap,S.normalMapTransform),S.normalScale.value.copy(w.normalScale),w.side===$o&&S.normalScale.value.negate()),w.displacementMap&&(S.displacementMap.value=w.displacementMap,e(w.displacementMap,S.displacementMapTransform),S.displacementScale.value=w.displacementScale,S.displacementBias.value=w.displacementBias),w.emissiveMap&&(S.emissiveMap.value=w.emissiveMap,e(w.emissiveMap,S.emissiveMapTransform)),w.specularMap&&(S.specularMap.value=w.specularMap,e(w.specularMap,S.specularMapTransform)),w.alphaTest>0&&(S.alphaTest.value=w.alphaTest);let R=t.get(w),C=R.envMap,F=R.envMapRotation;if(C&&(S.envMap.value=C,Cl.copy(F),Cl.x*=-1,Cl.y*=-1,Cl.z*=-1,C.isCubeTexture&&C.isRenderTargetTexture===!1&&(Cl.y*=-1,Cl.z*=-1),S.envMapRotation.value.setFromMatrix4(uX.makeRotationFromEuler(Cl)),S.flipEnvMap.value=C.isCubeTexture&&C.isRenderTargetTexture===!1?-1:1,S.reflectivity.value=w.reflectivity,S.ior.value=w.ior,S.refractionRatio.value=w.refractionRatio),w.lightMap){S.lightMap.value=w.lightMap;let V=n._useLegacyLights===!0?Math.PI:1;S.lightMapIntensity.value=w.lightMapIntensity*V,e(w.lightMap,S.lightMapTransform)}w.aoMap&&(S.aoMap.value=w.aoMap,S.aoMapIntensity.value=w.aoMapIntensity,e(w.aoMap,S.aoMapTransform))}function p(S,w){S.diffuse.value.copy(w.color),S.opacity.value=w.opacity,w.map&&(S.map.value=w.map,e(w.map,S.mapTransform))}function h(S,w){S.dashSize.value=w.dashSize,S.totalSize.value=w.dashSize+w.gapSize,S.scale.value=w.scale}function g(S,w,R,C){S.diffuse.value.copy(w.color),S.opacity.value=w.opacity,S.size.value=w.size*R,S.scale.value=C*.5,w.map&&(S.map.value=w.map,e(w.map,S.uvTransform)),w.alphaMap&&(S.alphaMap.value=w.alphaMap,e(w.alphaMap,S.alphaMapTransform)),w.alphaTest>0&&(S.alphaTest.value=w.alphaTest)}function m(S,w){S.diffuse.value.copy(w.color),S.opacity.value=w.opacity,S.rotation.value=w.rotation,w.map&&(S.map.value=w.map,e(w.map,S.mapTransform)),w.alphaMap&&(S.alphaMap.value=w.alphaMap,e(w.alphaMap,S.alphaMapTransform)),w.alphaTest>0&&(S.alphaTest.value=w.alphaTest)}function v(S,w){S.specular.value.copy(w.specular),S.shininess.value=Math.max(w.shininess,1e-4)}function x(S,w){w.gradientMap&&(S.gradientMap.value=w.gradientMap)}function E(S,w){S.metalness.value=w.metalness,w.metalnessMap&&(S.metalnessMap.value=w.metalnessMap,e(w.metalnessMap,S.metalnessMapTransform)),S.roughness.value=w.roughness,w.roughnessMap&&(S.roughnessMap.value=w.roughnessMap,e(w.roughnessMap,S.roughnessMapTransform)),t.get(w).envMap&&(S.envMapIntensity.value=w.envMapIntensity)}function M(S,w,R){S.ior.value=w.ior,w.sheen>0&&(S.sheenColor.value.copy(w.sheenColor).multiplyScalar(w.sheen),S.sheenRoughness.value=w.sheenRoughness,w.sheenColorMap&&(S.sheenColorMap.value=w.sheenColorMap,e(w.sheenColorMap,S.sheenColorMapTransform)),w.sheenRoughnessMap&&(S.sheenRoughnessMap.value=w.sheenRoughnessMap,e(w.sheenRoughnessMap,S.sheenRoughnessMapTransform))),w.clearcoat>0&&(S.clearcoat.value=w.clearcoat,S.clearcoatRoughness.value=w.clearcoatRoughness,w.clearcoatMap&&(S.clearcoatMap.value=w.clearcoatMap,e(w.clearcoatMap,S.clearcoatMapTransform)),w.clearcoatRoughnessMap&&(S.clearcoatRoughnessMap.value=w.clearcoatRoughnessMap,e(w.clearcoatRoughnessMap,S.clearcoatRoughnessMapTransform)),w.clearcoatNormalMap&&(S.clearcoatNormalMap.value=w.clearcoatNormalMap,e(w.clearcoatNormalMap,S.clearcoatNormalMapTransform),S.clearcoatNormalScale.value.copy(w.clearcoatNormalScale),w.side===$o&&S.clearcoatNormalScale.value.negate())),w.iridescence>0&&(S.iridescence.value=w.iridescence,S.iridescenceIOR.value=w.iridescenceIOR,S.iridescenceThicknessMinimum.value=w.iridescenceThicknessRange[0],S.iridescenceThicknessMaximum.value=w.iridescenceThicknessRange[1],w.iridescenceMap&&(S.iridescenceMap.value=w.iridescenceMap,e(w.iridescenceMap,S.iridescenceMapTransform)),w.iridescenceThicknessMap&&(S.iridescenceThicknessMap.value=w.iridescenceThicknessMap,e(w.iridescenceThicknessMap,S.iridescenceThicknessMapTransform))),w.transmission>0&&(S.transmission.value=w.transmission,S.transmissionSamplerMap.value=R.texture,S.transmissionSamplerSize.value.set(R.width,R.height),w.transmissionMap&&(S.transmissionMap.value=w.transmissionMap,e(w.transmissionMap,S.transmissionMapTransform)),S.thickness.value=w.thickness,w.thicknessMap&&(S.thicknessMap.value=w.thicknessMap,e(w.thicknessMap,S.thicknessMapTransform)),S.attenuationDistance.value=w.attenuationDistance,S.attenuationColor.value.copy(w.attenuationColor)),w.anisotropy>0&&(S.anisotropyVector.value.set(w.anisotropy*Math.cos(w.anisotropyRotation),w.anisotropy*Math.sin(w.anisotropyRotation)),w.anisotropyMap&&(S.anisotropyMap.value=w.anisotropyMap,e(w.anisotropyMap,S.anisotropyMapTransform))),S.specularIntensity.value=w.specularIntensity,S.specularColor.value.copy(w.specularColor),w.specularColorMap&&(S.specularColorMap.value=w.specularColorMap,e(w.specularColorMap,S.specularColorMapTransform)),w.specularIntensityMap&&(S.specularIntensityMap.value=w.specularIntensityMap,e(w.specularIntensityMap,S.specularIntensityMapTransform))}function A(S,w){w.matcap&&(S.matcap.value=w.matcap)}function I(S,w){let R=t.get(w).light;S.referencePosition.value.setFromMatrixPosition(R.matrixWorld),S.nearDistance.value=R.shadow.camera.near,S.farDistance.value=R.shadow.camera.far}return{refreshFogUniforms:o,refreshMaterialUniforms:s}}function cX(n,t,e,o){let s={},l={},p=[],h=e.isWebGL2?n.getParameter(n.MAX_UNIFORM_BUFFER_BINDINGS):0;function g(R,C){let F=C.program;o.uniformBlockBinding(R,F)}function m(R,C){let F=s[R.id];F===void 0&&(A(R),F=v(R),s[R.id]=F,R.addEventListener("dispose",S));let V=C.program;o.updateUBOMapping(R,V);let X=t.render.frame;l[R.id]!==X&&(E(R),l[R.id]=X)}function v(R){let C=x();R.__bindingPointIndex=C;let F=n.createBuffer(),V=R.__size,X=R.usage;return n.bindBuffer(n.UNIFORM_BUFFER,F),n.bufferData(n.UNIFORM_BUFFER,V,X),n.bindBuffer(n.UNIFORM_BUFFER,null),n.bindBufferBase(n.UNIFORM_BUFFER,C,F),F}function x(){for(let R=0;R<h;R++)if(p.indexOf(R)===-1)return p.push(R),R;return console.error("THREE.WebGLRenderer: Maximum number of simultaneously usable uniforms groups reached."),0}function E(R){let C=s[R.id],F=R.uniforms,V=R.__cache;n.bindBuffer(n.UNIFORM_BUFFER,C);for(let X=0,q=F.length;X<q;X++){let D=Array.isArray(F[X])?F[X]:[F[X]];for(let xt=0,B=D.length;xt<B;xt++){let j=D[xt];if(M(j,X,xt,V)===!0){let J=j.__offset,Dt=Array.isArray(j.value)?j.value:[j.value],Q=0;for(let At=0;At<Dt.length;At++){let Mt=Dt[At],Lt=I(Mt);typeof Mt=="number"||typeof Mt=="boolean"?(j.__data[0]=Mt,n.bufferSubData(n.UNIFORM_BUFFER,J+Q,j.__data)):Mt.isMatrix3?(j.__data[0]=Mt.elements[0],j.__data[1]=Mt.elements[1],j.__data[2]=Mt.elements[2],j.__data[3]=0,j.__data[4]=Mt.elements[3],j.__data[5]=Mt.elements[4],j.__data[6]=Mt.elements[5],j.__data[7]=0,j.__data[8]=Mt.elements[6],j.__data[9]=Mt.elements[7],j.__data[10]=Mt.elements[8],j.__data[11]=0):(Mt.toArray(j.__data,Q),Q+=Lt.storage/Float32Array.BYTES_PER_ELEMENT)}n.bufferSubData(n.UNIFORM_BUFFER,J,j.__data)}}}n.bindBuffer(n.UNIFORM_BUFFER,null)}function M(R,C,F,V){let X=R.value,q=C+"_"+F;if(V[q]===void 0)return typeof X=="number"||typeof X=="boolean"?V[q]=X:V[q]=X.clone(),!0;{let D=V[q];if(typeof X=="number"||typeof X=="boolean"){if(D!==X)return V[q]=X,!0}else if(D.equals(X)===!1)return D.copy(X),!0}return!1}function A(R){let C=R.uniforms,F=0,V=16;for(let q=0,D=C.length;q<D;q++){let xt=Array.isArray(C[q])?C[q]:[C[q]];for(let B=0,j=xt.length;B<j;B++){let J=xt[B],Dt=Array.isArray(J.value)?J.value:[J.value];for(let Q=0,At=Dt.length;Q<At;Q++){let Mt=Dt[Q],Lt=I(Mt),pt=F%V;pt!==0&&V-pt<Lt.boundary&&(F+=V-pt),J.__data=new Float32Array(Lt.storage/Float32Array.BYTES_PER_ELEMENT),J.__offset=F,F+=Lt.storage}}}let X=F%V;return X>0&&(F+=V-X),R.__size=F,R.__cache={},this}function I(R){let C={boundary:0,storage:0};return typeof R=="number"||typeof R=="boolean"?(C.boundary=4,C.storage=4):R.isVector2?(C.boundary=8,C.storage=8):R.isVector3||R.isColor?(C.boundary=16,C.storage=12):R.isVector4?(C.boundary=16,C.storage=16):R.isMatrix3?(C.boundary=48,C.storage=48):R.isMatrix4?(C.boundary=64,C.storage=64):R.isTexture?console.warn("THREE.WebGLRenderer: Texture samplers can not be part of an uniforms group."):console.warn("THREE.WebGLRenderer: Unsupported uniform value type.",R),C}function S(R){let C=R.target;C.removeEventListener("dispose",S);let F=p.indexOf(C.__bindingPointIndex);p.splice(F,1),n.deleteBuffer(s[C.id]),delete s[C.id],delete l[C.id]}function w(){for(let R in s)n.deleteBuffer(s[R]);p=[],s={},l={}}return{bind:g,update:m,dispose:w}}var mv=class{constructor(t={}){let{canvas:e=d6(),context:o=null,depth:s=!0,stencil:l=!0,alpha:p=!1,antialias:h=!1,premultipliedAlpha:g=!0,preserveDrawingBuffer:m=!1,powerPreference:v="default",failIfMajorPerformanceCaveat:x=!1}=t;this.isWebGLRenderer=!0;let E;o!==null?E=o.getContextAttributes().alpha:E=p;let M=new Uint32Array(4),A=new Int32Array(4),I=null,S=null,w=[],R=[];this.domElement=e,this.debug={checkShaderErrors:!0,onShaderError:null},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this._outputColorSpace=Ta,this._useLegacyLights=!1,this.toneMapping=Yu,this.toneMappingExposure=1;let C=this,F=!1,V=0,X=0,q=null,D=-1,xt=null,B=new ji,j=new ji,J=null,Dt=new ar(0),Q=0,At=e.width,Mt=e.height,Lt=1,pt=null,yt=null,K=new ji(0,0,At,Mt),Bt=new ji(0,0,At,Mt),Gt=!1,ae=new Bd,ut=!1,Ut=!1,jt=null,ce=new vi,te=new Ye,$t=new Rt,qt={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};function xe(){return q===null?Lt:1}let ft=o;function We(Z,mt){for(let It=0;It<Z.length;It++){let St=Z[It],vt=e.getContext(St,mt);if(vt!==null)return vt}return null}try{let Z={alpha:!0,depth:s,stencil:l,antialias:h,premultipliedAlpha:g,preserveDrawingBuffer:m,powerPreference:v,failIfMajorPerformanceCaveat:x};if("setAttribute"in e&&e.setAttribute("data-engine",\`three.js r\${Rv}\`),e.addEventListener("webglcontextlost",Et,!1),e.addEventListener("webglcontextrestored",G,!1),e.addEventListener("webglcontextcreationerror",ot,!1),ft===null){let mt=["webgl2","webgl","experimental-webgl"];if(C.isWebGL1Renderer===!0&&mt.shift(),ft=We(mt,Z),ft===null)throw We(mt)?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.")}typeof WebGLRenderingContext!="undefined"&&ft instanceof WebGLRenderingContext&&console.warn("THREE.WebGLRenderer: WebGL 1 support was deprecated in r153 and will be removed in r163."),ft.getShaderPrecisionFormat===void 0&&(ft.getShaderPrecisionFormat=function(){return{rangeMin:1,rangeMax:1,precision:1}})}catch(Z){throw console.error("THREE.WebGLRenderer: "+Z.message),Z}let ee,ge,fe,Te,be,Wt,Me,tt,z,Pt,Ot,dt,Ht,Ce,Vt,Zt,ne,rt,P,N,k,$,W,ht;function at(){ee=new AW(ft),ge=new xW(ft,ee,t),ee.init(ge),$=new iX(ft,ee,ge),fe=new nX(ft,ee,ge),Te=new PW(ft),be=new V9,Wt=new rX(ft,ee,fe,be,ge,$,Te),Me=new wW(C),tt=new bW(C),z=new D6(ft,ge),W=new vW(ft,ee,z,ge),Pt=new TW(ft,z,Te,W),Ot=new NW(ft,Pt,z,Te),P=new LW(ft,ge,Wt),Zt=new EW(be),dt=new H9(C,Me,tt,ee,ge,W,Zt),Ht=new lX(C,be),Ce=new X9,Vt=new j9(ee,ge),rt=new yW(C,Me,tt,fe,Ot,E,g),ne=new eX(C,Ot,ge),ht=new cX(ft,Te,ge,fe),N=new _W(ft,ee,Te,ge),k=new CW(ft,ee,Te,ge),Te.programs=dt.programs,C.capabilities=ge,C.extensions=ee,C.properties=be,C.renderLists=Ce,C.shadowMap=ne,C.state=fe,C.info=Te}at();let wt=new gv(C,ft);this.xr=wt,this.getContext=function(){return ft},this.getContextAttributes=function(){return ft.getContextAttributes()},this.forceContextLoss=function(){let Z=ee.get("WEBGL_lose_context");Z&&Z.loseContext()},this.forceContextRestore=function(){let Z=ee.get("WEBGL_lose_context");Z&&Z.restoreContext()},this.getPixelRatio=function(){return Lt},this.setPixelRatio=function(Z){Z!==void 0&&(Lt=Z,this.setSize(At,Mt,!1))},this.getSize=function(Z){return Z.set(At,Mt)},this.setSize=function(Z,mt,It=!0){if(wt.isPresenting){console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting.");return}At=Z,Mt=mt,e.width=Math.floor(Z*Lt),e.height=Math.floor(mt*Lt),It===!0&&(e.style.width=Z+"px",e.style.height=mt+"px"),this.setViewport(0,0,Z,mt)},this.getDrawingBufferSize=function(Z){return Z.set(At*Lt,Mt*Lt).floor()},this.setDrawingBufferSize=function(Z,mt,It){At=Z,Mt=mt,Lt=It,e.width=Math.floor(Z*It),e.height=Math.floor(mt*It),this.setViewport(0,0,Z,mt)},this.getCurrentViewport=function(Z){return Z.copy(B)},this.getViewport=function(Z){return Z.copy(K)},this.setViewport=function(Z,mt,It,St){Z.isVector4?K.set(Z.x,Z.y,Z.z,Z.w):K.set(Z,mt,It,St),fe.viewport(B.copy(K).multiplyScalar(Lt).round())},this.getScissor=function(Z){return Z.copy(Bt)},this.setScissor=function(Z,mt,It,St){Z.isVector4?Bt.set(Z.x,Z.y,Z.z,Z.w):Bt.set(Z,mt,It,St),fe.scissor(j.copy(Bt).multiplyScalar(Lt).round())},this.getScissorTest=function(){return Gt},this.setScissorTest=function(Z){fe.setScissorTest(Gt=Z)},this.setOpaqueSort=function(Z){pt=Z},this.setTransparentSort=function(Z){yt=Z},this.getClearColor=function(Z){return Z.copy(rt.getClearColor())},this.setClearColor=function(){rt.setClearColor.apply(rt,arguments)},this.getClearAlpha=function(){return rt.getClearAlpha()},this.setClearAlpha=function(){rt.setClearAlpha.apply(rt,arguments)},this.clear=function(Z=!0,mt=!0,It=!0){let St=0;if(Z){let vt=!1;if(q!==null){let he=q.texture.format;vt=he===pC||he===hC||he===fC}if(vt){let he=q.texture.type,ue=he===$u||he===Wu||he===Lv||he===Ol||he===lC||he===cC,we=rt.getClearColor(),de=rt.getClearAlpha(),Be=we.r,Ae=we.g,Pe=we.b;ue?(M[0]=Be,M[1]=Ae,M[2]=Pe,M[3]=de,ft.clearBufferuiv(ft.COLOR,0,M)):(A[0]=Be,A[1]=Ae,A[2]=Pe,A[3]=de,ft.clearBufferiv(ft.COLOR,0,A))}else St|=ft.COLOR_BUFFER_BIT}mt&&(St|=ft.DEPTH_BUFFER_BIT),It&&(St|=ft.STENCIL_BUFFER_BIT,this.state.buffers.stencil.setMask(4294967295)),ft.clear(St)},this.clearColor=function(){this.clear(!0,!1,!1)},this.clearDepth=function(){this.clear(!1,!0,!1)},this.clearStencil=function(){this.clear(!1,!1,!0)},this.dispose=function(){e.removeEventListener("webglcontextlost",Et,!1),e.removeEventListener("webglcontextrestored",G,!1),e.removeEventListener("webglcontextcreationerror",ot,!1),Ce.dispose(),Vt.dispose(),be.dispose(),Me.dispose(),tt.dispose(),Ot.dispose(),W.dispose(),ht.dispose(),dt.dispose(),ne.dispose(),wt.dispose(),wt.removeEventListener("sessionstart",qe),wt.removeEventListener("sessionend",Ue),jt&&(jt.dispose(),jt=null),Xe.stop()};function Et(Z){Z.preventDefault(),console.log("THREE.WebGLRenderer: Context Lost."),F=!0}function G(){console.log("THREE.WebGLRenderer: Context Restored."),F=!1;let Z=Te.autoReset,mt=ne.enabled,It=ne.autoUpdate,St=ne.needsUpdate,vt=ne.type;at(),Te.autoReset=Z,ne.enabled=mt,ne.autoUpdate=It,ne.needsUpdate=St,ne.type=vt}function ot(Z){console.error("THREE.WebGLRenderer: A WebGL context could not be created. Reason: ",Z.statusMessage)}function et(Z){let mt=Z.target;mt.removeEventListener("dispose",et),lt(mt)}function lt(Z){Ft(Z),be.remove(Z)}function Ft(Z){let mt=be.get(Z).programs;mt!==void 0&&(mt.forEach(function(It){dt.releaseProgram(It)}),Z.isShaderMaterial&&dt.releaseShaderCache(Z))}this.renderBufferDirect=function(Z,mt,It,St,vt,he){mt===null&&(mt=qt);let ue=vt.isMesh&&vt.matrixWorld.determinant()<0,we=Qn(Z,mt,It,St,vt);fe.setMaterial(St,ue);let de=It.index,Be=1;if(St.wireframe===!0){if(de=Pt.getWireframeAttribute(It),de===void 0)return;Be=2}let Ae=It.drawRange,Pe=It.attributes.position,en=Ae.start*Be,si=(Ae.start+Ae.count)*Be;he!==null&&(en=Math.max(en,he.start*Be),si=Math.min(si,(he.start+he.count)*Be)),de!==null?(en=Math.max(en,0),si=Math.min(si,de.count)):Pe!=null&&(en=Math.max(en,0),si=Math.min(si,Pe.count));let br=si-en;if(br<0||br===1/0)return;W.setup(vt,St,we,It,de);let Vi,sr=N;if(de!==null&&(Vi=z.get(de),sr=k,sr.setIndex(Vi)),vt.isMesh)St.wireframe===!0?(fe.setLineWidth(St.wireframeLinewidth*xe()),sr.setMode(ft.LINES)):sr.setMode(ft.TRIANGLES);else if(vt.isLine){let ye=St.linewidth;ye===void 0&&(ye=1),fe.setLineWidth(ye*xe()),vt.isLineSegments?sr.setMode(ft.LINES):vt.isLineLoop?sr.setMode(ft.LINE_LOOP):sr.setMode(ft.LINE_STRIP)}else vt.isPoints?sr.setMode(ft.POINTS):vt.isSprite&&sr.setMode(ft.TRIANGLES);if(vt.isBatchedMesh)sr.renderMultiDraw(vt._multiDrawStarts,vt._multiDrawCounts,vt._multiDrawCount);else if(vt.isInstancedMesh)sr.renderInstances(en,br,vt.count);else if(It.isInstancedBufferGeometry){let ye=It._maxInstanceCount!==void 0?It._maxInstanceCount:1/0,Ua=Math.min(It.instanceCount,ye);sr.renderInstances(en,br,Ua)}else sr.render(en,br)};function Kt(Z,mt,It){Z.transparent===!0&&Z.side===cu&&Z.forceSinglePass===!1?(Z.side=$o,Z.needsUpdate=!0,rr(Z,mt,It),Z.side=Ju,Z.needsUpdate=!0,rr(Z,mt,It),Z.side=cu):rr(Z,mt,It)}this.compile=function(Z,mt,It=null){It===null&&(It=Z),S=Vt.get(It),S.init(),R.push(S),It.traverseVisible(function(vt){vt.isLight&&vt.layers.test(mt.layers)&&(S.pushLight(vt),vt.castShadow&&S.pushShadow(vt))}),Z!==It&&Z.traverseVisible(function(vt){vt.isLight&&vt.layers.test(mt.layers)&&(S.pushLight(vt),vt.castShadow&&S.pushShadow(vt))}),S.setupLights(C._useLegacyLights);let St=new Set;return Z.traverse(function(vt){let he=vt.material;if(he)if(Array.isArray(he))for(let ue=0;ue<he.length;ue++){let we=he[ue];Kt(we,It,vt),St.add(we)}else Kt(he,It,vt),St.add(he)}),R.pop(),S=null,St},this.compileAsync=function(Z,mt,It=null){let St=this.compile(Z,mt,It);return new Promise(vt=>{function he(){if(St.forEach(function(ue){be.get(ue).currentProgram.isReady()&&St.delete(ue)}),St.size===0){vt(Z);return}setTimeout(he,10)}ee.get("KHR_parallel_shader_compile")!==null?he():setTimeout(he,10)})};let me=null;function ve(Z){me&&me(Z)}function qe(){Xe.stop()}function Ue(){Xe.start()}let Xe=new xC;Xe.setAnimationLoop(ve),typeof self!="undefined"&&Xe.setContext(self),this.setAnimationLoop=function(Z){me=Z,wt.setAnimationLoop(Z),Z===null?Xe.stop():Xe.start()},wt.addEventListener("sessionstart",qe),wt.addEventListener("sessionend",Ue),this.render=function(Z,mt){if(mt!==void 0&&mt.isCamera!==!0){console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");return}if(F===!0)return;Z.matrixWorldAutoUpdate===!0&&Z.updateMatrixWorld(),mt.parent===null&&mt.matrixWorldAutoUpdate===!0&&mt.updateMatrixWorld(),wt.enabled===!0&&wt.isPresenting===!0&&(wt.cameraAutoUpdate===!0&&wt.updateCamera(mt),mt=wt.getCamera()),Z.isScene===!0&&Z.onBeforeRender(C,Z,mt,q),S=Vt.get(Z,R.length),S.init(),R.push(S),ce.multiplyMatrices(mt.projectionMatrix,mt.matrixWorldInverse),ae.setFromProjectionMatrix(ce),Ut=this.localClippingEnabled,ut=Zt.init(this.clippingPlanes,Ut),I=Ce.get(Z,w.length),I.init(),w.push(I),Je(Z,mt,0,C.sortObjects),I.finish(),C.sortObjects===!0&&I.sort(pt,yt),this.info.render.frame++,ut===!0&&Zt.beginShadows();let It=S.state.shadowsArray;if(ne.render(It,Z,mt),ut===!0&&Zt.endShadows(),this.info.autoReset===!0&&this.info.reset(),(wt.enabled===!1||wt.isPresenting===!1||wt.hasDepthSensing()===!1)&&rt.render(I,Z),S.setupLights(C._useLegacyLights),mt.isArrayCamera){let St=mt.cameras;for(let vt=0,he=St.length;vt<he;vt++){let ue=St[vt];wr(I,Z,ue,ue.viewport)}}else wr(I,Z,mt);q!==null&&(Wt.updateMultisampleRenderTarget(q),Wt.updateRenderTargetMipmap(q)),Z.isScene===!0&&Z.onAfterRender(C,Z,mt),W.resetDefaultState(),D=-1,xt=null,R.pop(),R.length>0?S=R[R.length-1]:S=null,w.pop(),w.length>0?I=w[w.length-1]:I=null};function Je(Z,mt,It,St){if(Z.visible===!1)return;if(Z.layers.test(mt.layers)){if(Z.isGroup)It=Z.renderOrder;else if(Z.isLOD)Z.autoUpdate===!0&&Z.update(mt);else if(Z.isLight)S.pushLight(Z),Z.castShadow&&S.pushShadow(Z);else if(Z.isSprite){if(!Z.frustumCulled||ae.intersectsSprite(Z)){St&&$t.setFromMatrixPosition(Z.matrixWorld).applyMatrix4(ce);let ue=Ot.update(Z),we=Z.material;we.visible&&I.push(Z,ue,we,It,$t.z,null)}}else if((Z.isMesh||Z.isLine||Z.isPoints)&&(!Z.frustumCulled||ae.intersectsObject(Z))){let ue=Ot.update(Z),we=Z.material;if(St&&(Z.boundingSphere!==void 0?(Z.boundingSphere===null&&Z.computeBoundingSphere(),$t.copy(Z.boundingSphere.center)):(ue.boundingSphere===null&&ue.computeBoundingSphere(),$t.copy(ue.boundingSphere.center)),$t.applyMatrix4(Z.matrixWorld).applyMatrix4(ce)),Array.isArray(we)){let de=ue.groups;for(let Be=0,Ae=de.length;Be<Ae;Be++){let Pe=de[Be],en=we[Pe.materialIndex];en&&en.visible&&I.push(Z,ue,en,It,$t.z,Pe)}}else we.visible&&I.push(Z,ue,we,It,$t.z,null)}}let he=Z.children;for(let ue=0,we=he.length;ue<we;ue++)Je(he[ue],mt,It,St)}function wr(Z,mt,It,St){let vt=Z.opaque,he=Z.transmissive,ue=Z.transparent;S.setupLightsView(It),ut===!0&&Zt.setGlobalState(C.clippingPlanes,It),he.length>0&&Jr(vt,he,mt,It),St&&fe.viewport(B.copy(St)),vt.length>0&&nr(vt,mt,It),he.length>0&&nr(he,mt,It),ue.length>0&&nr(ue,mt,It),fe.buffers.depth.setTest(!0),fe.buffers.depth.setMask(!0),fe.buffers.color.setMask(!0),fe.setPolygonOffset(!1)}function Jr(Z,mt,It,St){if((It.isScene===!0?It.overrideMaterial:null)!==null)return;let he=ge.isWebGL2;jt===null&&(jt=new du(1,1,{generateMipmaps:!0,type:ee.has("EXT_color_buffer_half_float")?ah:$u,minFilter:Ll,samples:he?4:0})),C.getDrawingBufferSize(te),he?jt.setSize(te.x,te.y):jt.setSize(jy(te.x),jy(te.y));let ue=C.getRenderTarget();C.setRenderTarget(jt),C.getClearColor(Dt),Q=C.getClearAlpha(),Q<1&&C.setClearColor(16777215,.5),C.clear();let we=C.toneMapping;C.toneMapping=Yu,nr(Z,It,St),Wt.updateMultisampleRenderTarget(jt),Wt.updateRenderTargetMipmap(jt);let de=!1;for(let Be=0,Ae=mt.length;Be<Ae;Be++){let Pe=mt[Be],en=Pe.object,si=Pe.geometry,br=Pe.material,Vi=Pe.group;if(br.side===cu&&en.layers.test(St.layers)){let sr=br.side;br.side=$o,br.needsUpdate=!0,Ie(en,It,St,si,br,Vi),br.side=sr,br.needsUpdate=!0,de=!0}}de===!0&&(Wt.updateMultisampleRenderTarget(jt),Wt.updateRenderTargetMipmap(jt)),C.setRenderTarget(ue),C.setClearColor(Dt,Q),C.toneMapping=we}function nr(Z,mt,It){let St=mt.isScene===!0?mt.overrideMaterial:null;for(let vt=0,he=Z.length;vt<he;vt++){let ue=Z[vt],we=ue.object,de=ue.geometry,Be=St===null?ue.material:St,Ae=ue.group;we.layers.test(It.layers)&&Ie(we,mt,It,de,Be,Ae)}}function Ie(Z,mt,It,St,vt,he){Z.onBeforeRender(C,mt,It,St,vt,he),Z.modelViewMatrix.multiplyMatrices(It.matrixWorldInverse,Z.matrixWorld),Z.normalMatrix.getNormalMatrix(Z.modelViewMatrix),vt.onBeforeRender(C,mt,It,St,Z,he),vt.transparent===!0&&vt.side===cu&&vt.forceSinglePass===!1?(vt.side=$o,vt.needsUpdate=!0,C.renderBufferDirect(It,mt,St,vt,Z,he),vt.side=Ju,vt.needsUpdate=!0,C.renderBufferDirect(It,mt,St,vt,Z,he),vt.side=cu):C.renderBufferDirect(It,mt,St,vt,Z,he),Z.onAfterRender(C,mt,It,St,vt,he)}function rr(Z,mt,It){mt.isScene!==!0&&(mt=qt);let St=be.get(Z),vt=S.state.lights,he=S.state.shadowsArray,ue=vt.state.version,we=dt.getParameters(Z,vt.state,he,mt,It),de=dt.getProgramCacheKey(we),Be=St.programs;St.environment=Z.isMeshStandardMaterial?mt.environment:null,St.fog=mt.fog,St.envMap=(Z.isMeshStandardMaterial?tt:Me).get(Z.envMap||St.environment),St.envMapRotation=St.environment!==null&&Z.envMap===null?mt.environmentRotation:Z.envMapRotation,Be===void 0&&(Z.addEventListener("dispose",et),Be=new Map,St.programs=Be);let Ae=Be.get(de);if(Ae!==void 0){if(St.currentProgram===Ae&&St.lightsStateVersion===ue)return ur(Z,we),Ae}else we.uniforms=dt.getUniforms(Z),Z.onBuild(It,we,C),Z.onBeforeCompile(we,C),Ae=dt.acquireProgram(we,de),Be.set(de,Ae),St.uniforms=we.uniforms;let Pe=St.uniforms;return(!Z.isShaderMaterial&&!Z.isRawShaderMaterial||Z.clipping===!0)&&(Pe.clippingPlanes=Zt.uniform),ur(Z,we),St.needsLights=oi(Z),St.lightsStateVersion=ue,St.needsLights&&(Pe.ambientLightColor.value=vt.state.ambient,Pe.lightProbe.value=vt.state.probe,Pe.directionalLights.value=vt.state.directional,Pe.directionalLightShadows.value=vt.state.directionalShadow,Pe.spotLights.value=vt.state.spot,Pe.spotLightShadows.value=vt.state.spotShadow,Pe.rectAreaLights.value=vt.state.rectArea,Pe.ltc_1.value=vt.state.rectAreaLTC1,Pe.ltc_2.value=vt.state.rectAreaLTC2,Pe.pointLights.value=vt.state.point,Pe.pointLightShadows.value=vt.state.pointShadow,Pe.hemisphereLights.value=vt.state.hemi,Pe.directionalShadowMap.value=vt.state.directionalShadowMap,Pe.directionalShadowMatrix.value=vt.state.directionalShadowMatrix,Pe.spotShadowMap.value=vt.state.spotShadowMap,Pe.spotLightMatrix.value=vt.state.spotLightMatrix,Pe.spotLightMap.value=vt.state.spotLightMap,Pe.pointShadowMap.value=vt.state.pointShadowMap,Pe.pointShadowMatrix.value=vt.state.pointShadowMatrix),St.currentProgram=Ae,St.uniformsList=null,Ae}function pr(Z){if(Z.uniformsList===null){let mt=Z.currentProgram.getUniforms();Z.uniformsList=qc.seqWithValue(mt.seq,Z.uniforms)}return Z.uniformsList}function ur(Z,mt){let It=be.get(Z);It.outputColorSpace=mt.outputColorSpace,It.batching=mt.batching,It.instancing=mt.instancing,It.instancingColor=mt.instancingColor,It.instancingMorph=mt.instancingMorph,It.skinning=mt.skinning,It.morphTargets=mt.morphTargets,It.morphNormals=mt.morphNormals,It.morphColors=mt.morphColors,It.morphTargetsCount=mt.morphTargetsCount,It.numClippingPlanes=mt.numClippingPlanes,It.numIntersection=mt.numClipIntersection,It.vertexAlphas=mt.vertexAlphas,It.vertexTangents=mt.vertexTangents,It.toneMapping=mt.toneMapping}function Qn(Z,mt,It,St,vt){mt.isScene!==!0&&(mt=qt),Wt.resetTextureUnits();let he=mt.fog,ue=St.isMeshStandardMaterial?mt.environment:null,we=q===null?C.outputColorSpace:q.isXRRenderTarget===!0?q.texture.colorSpace:tl,de=(St.isMeshStandardMaterial?tt:Me).get(St.envMap||ue),Be=St.vertexColors===!0&&!!It.attributes.color&&It.attributes.color.itemSize===4,Ae=!!It.attributes.tangent&&(!!St.normalMap||St.anisotropy>0),Pe=!!It.morphAttributes.position,en=!!It.morphAttributes.normal,si=!!It.morphAttributes.color,br=Yu;St.toneMapped&&(q===null||q.isXRRenderTarget===!0)&&(br=C.toneMapping);let Vi=It.morphAttributes.position||It.morphAttributes.normal||It.morphAttributes.color,sr=Vi!==void 0?Vi.length:0,ye=be.get(St),Ua=S.state.lights;if(ut===!0&&(Ut===!0||Z!==xt)){let Ai=Z===xt&&St.id===D;Zt.setState(St,Z,Ai)}let nn=!1;St.version===ye.__version?(ye.needsLights&&ye.lightsStateVersion!==Ua.state.version||ye.outputColorSpace!==we||vt.isBatchedMesh&&ye.batching===!1||!vt.isBatchedMesh&&ye.batching===!0||vt.isInstancedMesh&&ye.instancing===!1||!vt.isInstancedMesh&&ye.instancing===!0||vt.isSkinnedMesh&&ye.skinning===!1||!vt.isSkinnedMesh&&ye.skinning===!0||vt.isInstancedMesh&&ye.instancingColor===!0&&vt.instanceColor===null||vt.isInstancedMesh&&ye.instancingColor===!1&&vt.instanceColor!==null||vt.isInstancedMesh&&ye.instancingMorph===!0&&vt.morphTexture===null||vt.isInstancedMesh&&ye.instancingMorph===!1&&vt.morphTexture!==null||ye.envMap!==de||St.fog===!0&&ye.fog!==he||ye.numClippingPlanes!==void 0&&(ye.numClippingPlanes!==Zt.numPlanes||ye.numIntersection!==Zt.numIntersection)||ye.vertexAlphas!==Be||ye.vertexTangents!==Ae||ye.morphTargets!==Pe||ye.morphNormals!==en||ye.morphColors!==si||ye.toneMapping!==br||ge.isWebGL2===!0&&ye.morphTargetsCount!==sr)&&(nn=!0):(nn=!0,ye.__version=St.version);let fo=ye.currentProgram;nn===!0&&(fo=rr(St,mt,vt));let ul=!1,ze=!1,vs=!1,ir=fo.getUniforms(),Qo=ye.uniforms;if(fe.useProgram(fo.program)&&(ul=!0,ze=!0,vs=!0),St.id!==D&&(D=St.id,ze=!0),ul||xt!==Z){ir.setValue(ft,"projectionMatrix",Z.projectionMatrix),ir.setValue(ft,"viewMatrix",Z.matrixWorldInverse);let Ai=ir.map.cameraPosition;Ai!==void 0&&Ai.setValue(ft,$t.setFromMatrixPosition(Z.matrixWorld)),ge.logarithmicDepthBuffer&&ir.setValue(ft,"logDepthBufFC",2/(Math.log(Z.far+1)/Math.LN2)),(St.isMeshPhongMaterial||St.isMeshToonMaterial||St.isMeshLambertMaterial||St.isMeshBasicMaterial||St.isMeshStandardMaterial||St.isShaderMaterial)&&ir.setValue(ft,"isOrthographic",Z.isOrthographicCamera===!0),xt!==Z&&(xt=Z,ze=!0,vs=!0)}if(vt.isSkinnedMesh){ir.setOptional(ft,vt,"bindMatrix"),ir.setOptional(ft,vt,"bindMatrixInverse");let Ai=vt.skeleton;Ai&&(ge.floatVertexTextures?(Ai.boneTexture===null&&Ai.computeBoneTexture(),ir.setValue(ft,"boneTexture",Ai.boneTexture,Wt)):console.warn("THREE.WebGLRenderer: SkinnedMesh can only be used with WebGL 2. With WebGL 1 OES_texture_float and vertex textures support is required."))}vt.isBatchedMesh&&(ir.setOptional(ft,vt,"batchingTexture"),ir.setValue(ft,"batchingTexture",vt._matricesTexture,Wt));let Le=It.morphAttributes;if((Le.position!==void 0||Le.normal!==void 0||Le.color!==void 0&&ge.isWebGL2===!0)&&P.update(vt,It,fo),(ze||ye.receiveShadow!==vt.receiveShadow)&&(ye.receiveShadow=vt.receiveShadow,ir.setValue(ft,"receiveShadow",vt.receiveShadow)),St.isMeshGouraudMaterial&&St.envMap!==null&&(Qo.envMap.value=de,Qo.flipEnvMap.value=de.isCubeTexture&&de.isRenderTargetTexture===!1?-1:1),ze&&(ir.setValue(ft,"toneMappingExposure",C.toneMappingExposure),ye.needsLights&&bi(Qo,vs),he&&St.fog===!0&&Ht.refreshFogUniforms(Qo,he),Ht.refreshMaterialUniforms(Qo,St,Lt,Mt,jt),qc.upload(ft,pr(ye),Qo,Wt)),St.isShaderMaterial&&St.uniformsNeedUpdate===!0&&(qc.upload(ft,pr(ye),Qo,Wt),St.uniformsNeedUpdate=!1),St.isSpriteMaterial&&ir.setValue(ft,"center",vt.center),ir.setValue(ft,"modelViewMatrix",vt.modelViewMatrix),ir.setValue(ft,"normalMatrix",vt.normalMatrix),ir.setValue(ft,"modelMatrix",vt.matrixWorld),St.isShaderMaterial||St.isRawShaderMaterial){let Ai=St.uniformsGroups;for(let Ba=0,mu=Ai.length;Ba<mu;Ba++)if(ge.isWebGL2){let Ti=Ai[Ba];ht.update(Ti,fo),ht.bind(Ti,fo)}else console.warn("THREE.WebGLRenderer: Uniform Buffer Objects can only be used with WebGL 2.")}return fo}function bi(Z,mt){Z.ambientLightColor.needsUpdate=mt,Z.lightProbe.needsUpdate=mt,Z.directionalLights.needsUpdate=mt,Z.directionalLightShadows.needsUpdate=mt,Z.pointLights.needsUpdate=mt,Z.pointLightShadows.needsUpdate=mt,Z.spotLights.needsUpdate=mt,Z.spotLightShadows.needsUpdate=mt,Z.rectAreaLights.needsUpdate=mt,Z.hemisphereLights.needsUpdate=mt}function oi(Z){return Z.isMeshLambertMaterial||Z.isMeshToonMaterial||Z.isMeshPhongMaterial||Z.isMeshStandardMaterial||Z.isShadowMaterial||Z.isShaderMaterial&&Z.lights===!0}this.getActiveCubeFace=function(){return V},this.getActiveMipmapLevel=function(){return X},this.getRenderTarget=function(){return q},this.setRenderTargetTextures=function(Z,mt,It){be.get(Z.texture).__webglTexture=mt,be.get(Z.depthTexture).__webglTexture=It;let St=be.get(Z);St.__hasExternalTextures=!0,St.__autoAllocateDepthBuffer=It===void 0,St.__autoAllocateDepthBuffer||ee.has("WEBGL_multisampled_render_to_texture")===!0&&(console.warn("THREE.WebGLRenderer: Render-to-texture extension was disabled because an external texture was provided"),St.__useRenderToTexture=!1)},this.setRenderTargetFramebuffer=function(Z,mt){let It=be.get(Z);It.__webglFramebuffer=mt,It.__useDefaultFramebuffer=mt===void 0},this.setRenderTarget=function(Z,mt=0,It=0){q=Z,V=mt,X=It;let St=!0,vt=null,he=!1,ue=!1;if(Z){let de=be.get(Z);de.__useDefaultFramebuffer!==void 0?(fe.bindFramebuffer(ft.FRAMEBUFFER,null),St=!1):de.__webglFramebuffer===void 0?Wt.setupRenderTarget(Z):de.__hasExternalTextures&&Wt.rebindTextures(Z,be.get(Z.texture).__webglTexture,be.get(Z.depthTexture).__webglTexture);let Be=Z.texture;(Be.isData3DTexture||Be.isDataArrayTexture||Be.isCompressedArrayTexture)&&(ue=!0);let Ae=be.get(Z).__webglFramebuffer;Z.isWebGLCubeRenderTarget?(Array.isArray(Ae[mt])?vt=Ae[mt][It]:vt=Ae[mt],he=!0):ge.isWebGL2&&Z.samples>0&&Wt.useMultisampledRTT(Z)===!1?vt=be.get(Z).__webglMultisampledFramebuffer:Array.isArray(Ae)?vt=Ae[It]:vt=Ae,B.copy(Z.viewport),j.copy(Z.scissor),J=Z.scissorTest}else B.copy(K).multiplyScalar(Lt).floor(),j.copy(Bt).multiplyScalar(Lt).floor(),J=Gt;if(fe.bindFramebuffer(ft.FRAMEBUFFER,vt)&&ge.drawBuffers&&St&&fe.drawBuffers(Z,vt),fe.viewport(B),fe.scissor(j),fe.setScissorTest(J),he){let de=be.get(Z.texture);ft.framebufferTexture2D(ft.FRAMEBUFFER,ft.COLOR_ATTACHMENT0,ft.TEXTURE_CUBE_MAP_POSITIVE_X+mt,de.__webglTexture,It)}else if(ue){let de=be.get(Z.texture),Be=mt||0;ft.framebufferTextureLayer(ft.FRAMEBUFFER,ft.COLOR_ATTACHMENT0,de.__webglTexture,It||0,Be)}D=-1},this.readRenderTargetPixels=function(Z,mt,It,St,vt,he,ue){if(!(Z&&Z.isWebGLRenderTarget)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}let we=be.get(Z).__webglFramebuffer;if(Z.isWebGLCubeRenderTarget&&ue!==void 0&&(we=we[ue]),we){fe.bindFramebuffer(ft.FRAMEBUFFER,we);try{let de=Z.texture,Be=de.format,Ae=de.type;if(Be!==na&&$.convert(Be)!==ft.getParameter(ft.IMPLEMENTATION_COLOR_READ_FORMAT)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}let Pe=Ae===ah&&(ee.has("EXT_color_buffer_half_float")||ge.isWebGL2&&ee.has("EXT_color_buffer_float"));if(Ae!==$u&&$.convert(Ae)!==ft.getParameter(ft.IMPLEMENTATION_COLOR_READ_TYPE)&&!(Ae===fu&&(ge.isWebGL2||ee.has("OES_texture_float")||ee.has("WEBGL_color_buffer_float")))&&!Pe){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}mt>=0&&mt<=Z.width-St&&It>=0&&It<=Z.height-vt&&ft.readPixels(mt,It,St,vt,$.convert(Be),$.convert(Ae),he)}finally{let de=q!==null?be.get(q).__webglFramebuffer:null;fe.bindFramebuffer(ft.FRAMEBUFFER,de)}}},this.copyFramebufferToTexture=function(Z,mt,It=0){let St=Math.pow(2,-It),vt=Math.floor(mt.image.width*St),he=Math.floor(mt.image.height*St);Wt.setTexture2D(mt,0),ft.copyTexSubImage2D(ft.TEXTURE_2D,It,0,0,Z.x,Z.y,vt,he),fe.unbindTexture()},this.copyTextureToTexture=function(Z,mt,It,St=0){let vt=mt.image.width,he=mt.image.height,ue=$.convert(It.format),we=$.convert(It.type);Wt.setTexture2D(It,0),ft.pixelStorei(ft.UNPACK_FLIP_Y_WEBGL,It.flipY),ft.pixelStorei(ft.UNPACK_PREMULTIPLY_ALPHA_WEBGL,It.premultiplyAlpha),ft.pixelStorei(ft.UNPACK_ALIGNMENT,It.unpackAlignment),mt.isDataTexture?ft.texSubImage2D(ft.TEXTURE_2D,St,Z.x,Z.y,vt,he,ue,we,mt.image.data):mt.isCompressedTexture?ft.compressedTexSubImage2D(ft.TEXTURE_2D,St,Z.x,Z.y,mt.mipmaps[0].width,mt.mipmaps[0].height,ue,mt.mipmaps[0].data):ft.texSubImage2D(ft.TEXTURE_2D,St,Z.x,Z.y,ue,we,mt.image),St===0&&It.generateMipmaps&&ft.generateMipmap(ft.TEXTURE_2D),fe.unbindTexture()},this.copyTextureToTexture3D=function(Z,mt,It,St,vt=0){if(C.isWebGL1Renderer){console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: can only be used with WebGL2.");return}let he=Math.round(Z.max.x-Z.min.x),ue=Math.round(Z.max.y-Z.min.y),we=Z.max.z-Z.min.z+1,de=$.convert(St.format),Be=$.convert(St.type),Ae;if(St.isData3DTexture)Wt.setTexture3D(St,0),Ae=ft.TEXTURE_3D;else if(St.isDataArrayTexture||St.isCompressedArrayTexture)Wt.setTexture2DArray(St,0),Ae=ft.TEXTURE_2D_ARRAY;else{console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.");return}ft.pixelStorei(ft.UNPACK_FLIP_Y_WEBGL,St.flipY),ft.pixelStorei(ft.UNPACK_PREMULTIPLY_ALPHA_WEBGL,St.premultiplyAlpha),ft.pixelStorei(ft.UNPACK_ALIGNMENT,St.unpackAlignment);let Pe=ft.getParameter(ft.UNPACK_ROW_LENGTH),en=ft.getParameter(ft.UNPACK_IMAGE_HEIGHT),si=ft.getParameter(ft.UNPACK_SKIP_PIXELS),br=ft.getParameter(ft.UNPACK_SKIP_ROWS),Vi=ft.getParameter(ft.UNPACK_SKIP_IMAGES),sr=It.isCompressedTexture?It.mipmaps[vt]:It.image;ft.pixelStorei(ft.UNPACK_ROW_LENGTH,sr.width),ft.pixelStorei(ft.UNPACK_IMAGE_HEIGHT,sr.height),ft.pixelStorei(ft.UNPACK_SKIP_PIXELS,Z.min.x),ft.pixelStorei(ft.UNPACK_SKIP_ROWS,Z.min.y),ft.pixelStorei(ft.UNPACK_SKIP_IMAGES,Z.min.z),It.isDataTexture||It.isData3DTexture?ft.texSubImage3D(Ae,vt,mt.x,mt.y,mt.z,he,ue,we,de,Be,sr.data):St.isCompressedArrayTexture?ft.compressedTexSubImage3D(Ae,vt,mt.x,mt.y,mt.z,he,ue,we,de,sr.data):ft.texSubImage3D(Ae,vt,mt.x,mt.y,mt.z,he,ue,we,de,Be,sr),ft.pixelStorei(ft.UNPACK_ROW_LENGTH,Pe),ft.pixelStorei(ft.UNPACK_IMAGE_HEIGHT,en),ft.pixelStorei(ft.UNPACK_SKIP_PIXELS,si),ft.pixelStorei(ft.UNPACK_SKIP_ROWS,br),ft.pixelStorei(ft.UNPACK_SKIP_IMAGES,Vi),vt===0&&St.generateMipmaps&&ft.generateMipmap(Ae),fe.unbindTexture()},this.initTexture=function(Z){Z.isCubeTexture?Wt.setTextureCube(Z,0):Z.isData3DTexture?Wt.setTexture3D(Z,0):Z.isDataArrayTexture||Z.isCompressedArrayTexture?Wt.setTexture2DArray(Z,0):Wt.setTexture2D(Z,0),fe.unbindTexture()},this.resetState=function(){V=0,X=0,q=null,fe.reset(),W.reset()},typeof __THREE_DEVTOOLS__!="undefined"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}get coordinateSystem(){return hu}get outputColorSpace(){return this._outputColorSpace}set outputColorSpace(t){this._outputColorSpace=t;let e=this.getContext();e.drawingBufferColorSpace=t===Nv?"display-p3":"srgb",e.unpackColorSpace=xr.workingColorSpace===Vd?"display-p3":"srgb"}get useLegacyLights(){return console.warn("THREE.WebGLRenderer: The property .useLegacyLights has been deprecated. Migrate your lighting according to the following guide: https://discourse.threejs.org/t/updates-to-lighting-in-three-js-r155/53733."),this._useLegacyLights}set useLegacyLights(t){console.warn("THREE.WebGLRenderer: The property .useLegacyLights has been deprecated. Migrate your lighting according to the following guide: https://discourse.threejs.org/t/updates-to-lighting-in-three-js-r155/53733."),this._useLegacyLights=t}},yv=class extends mv{};yv.prototype.isWebGL1Renderer=!0;var vv=class{constructor(t,e){this.isInterleavedBuffer=!0,this.array=t,this.stride=e,this.count=t!==void 0?t.length/e:0,this.usage=Zy,this._updateRange={offset:0,count:-1},this.updateRanges=[],this.version=0,this.uuid=Zu()}onUploadCallback(){}set needsUpdate(t){t===!0&&this.version++}get updateRange(){return yC("THREE.InterleavedBuffer: updateRange() is deprecated and will be removed in r169. Use addUpdateRange() instead."),this._updateRange}setUsage(t){return this.usage=t,this}addUpdateRange(t,e){this.updateRanges.push({start:t,count:e})}clearUpdateRanges(){this.updateRanges.length=0}copy(t){return this.array=new t.array.constructor(t.array),this.count=t.count,this.stride=t.stride,this.usage=t.usage,this}copyAt(t,e,o){t*=this.stride,o*=e.stride;for(let s=0,l=this.stride;s<l;s++)this.array[t+s]=e.array[o+s];return this}set(t,e=0){return this.array.set(t,e),this}clone(t){t.arrayBuffers===void 0&&(t.arrayBuffers={}),this.array.buffer._uuid===void 0&&(this.array.buffer._uuid=Zu()),t.arrayBuffers[this.array.buffer._uuid]===void 0&&(t.arrayBuffers[this.array.buffer._uuid]=this.array.slice(0).buffer);let e=new this.array.constructor(t.arrayBuffers[this.array.buffer._uuid]),o=new this.constructor(e,this.stride);return o.setUsage(this.usage),o}onUpload(t){return this.onUploadCallback=t,this}toJSON(t){return t.arrayBuffers===void 0&&(t.arrayBuffers={}),this.array.buffer._uuid===void 0&&(this.array.buffer._uuid=Zu()),t.arrayBuffers[this.array.buffer._uuid]===void 0&&(t.arrayBuffers[this.array.buffer._uuid]=Array.from(new Uint32Array(this.array.buffer))),{uuid:this.uuid,buffer:this.array.buffer._uuid,type:this.array.constructor.name,stride:this.stride}}},wo=new Rt,qd=class n{constructor(t,e,o,s=!1){this.isInterleavedBufferAttribute=!0,this.name="",this.data=t,this.itemSize=e,this.offset=o,this.normalized=s}get count(){return this.data.count}get array(){return this.data.array}set needsUpdate(t){this.data.needsUpdate=t}applyMatrix4(t){for(let e=0,o=this.data.count;e<o;e++)wo.fromBufferAttribute(this,e),wo.applyMatrix4(t),this.setXYZ(e,wo.x,wo.y,wo.z);return this}applyNormalMatrix(t){for(let e=0,o=this.count;e<o;e++)wo.fromBufferAttribute(this,e),wo.applyNormalMatrix(t),this.setXYZ(e,wo.x,wo.y,wo.z);return this}transformDirection(t){for(let e=0,o=this.count;e<o;e++)wo.fromBufferAttribute(this,e),wo.transformDirection(t),this.setXYZ(e,wo.x,wo.y,wo.z);return this}getComponent(t,e){let o=this.array[t*this.data.stride+this.offset+e];return this.normalized&&(o=Pa(o,this.array)),o}setComponent(t,e,o){return this.normalized&&(o=_r(o,this.array)),this.data.array[t*this.data.stride+this.offset+e]=o,this}setX(t,e){return this.normalized&&(e=_r(e,this.array)),this.data.array[t*this.data.stride+this.offset]=e,this}setY(t,e){return this.normalized&&(e=_r(e,this.array)),this.data.array[t*this.data.stride+this.offset+1]=e,this}setZ(t,e){return this.normalized&&(e=_r(e,this.array)),this.data.array[t*this.data.stride+this.offset+2]=e,this}setW(t,e){return this.normalized&&(e=_r(e,this.array)),this.data.array[t*this.data.stride+this.offset+3]=e,this}getX(t){let e=this.data.array[t*this.data.stride+this.offset];return this.normalized&&(e=Pa(e,this.array)),e}getY(t){let e=this.data.array[t*this.data.stride+this.offset+1];return this.normalized&&(e=Pa(e,this.array)),e}getZ(t){let e=this.data.array[t*this.data.stride+this.offset+2];return this.normalized&&(e=Pa(e,this.array)),e}getW(t){let e=this.data.array[t*this.data.stride+this.offset+3];return this.normalized&&(e=Pa(e,this.array)),e}setXY(t,e,o){return t=t*this.data.stride+this.offset,this.normalized&&(e=_r(e,this.array),o=_r(o,this.array)),this.data.array[t+0]=e,this.data.array[t+1]=o,this}setXYZ(t,e,o,s){return t=t*this.data.stride+this.offset,this.normalized&&(e=_r(e,this.array),o=_r(o,this.array),s=_r(s,this.array)),this.data.array[t+0]=e,this.data.array[t+1]=o,this.data.array[t+2]=s,this}setXYZW(t,e,o,s,l){return t=t*this.data.stride+this.offset,this.normalized&&(e=_r(e,this.array),o=_r(o,this.array),s=_r(s,this.array),l=_r(l,this.array)),this.data.array[t+0]=e,this.data.array[t+1]=o,this.data.array[t+2]=s,this.data.array[t+3]=l,this}clone(t){if(t===void 0){console.log("THREE.InterleavedBufferAttribute.clone(): Cloning an interleaved buffer attribute will de-interleave buffer data.");let e=[];for(let o=0;o<this.count;o++){let s=o*this.data.stride+this.offset;for(let l=0;l<this.itemSize;l++)e.push(this.data.array[s+l])}return new ms(new this.array.constructor(e),this.itemSize,this.normalized)}else return t.interleavedBuffers===void 0&&(t.interleavedBuffers={}),t.interleavedBuffers[this.data.uuid]===void 0&&(t.interleavedBuffers[this.data.uuid]=this.data.clone(t)),new n(t.interleavedBuffers[this.data.uuid],this.itemSize,this.offset,this.normalized)}toJSON(t){if(t===void 0){console.log("THREE.InterleavedBufferAttribute.toJSON(): Serializing an interleaved buffer attribute will de-interleave buffer data.");let e=[];for(let o=0;o<this.count;o++){let s=o*this.data.stride+this.offset;for(let l=0;l<this.itemSize;l++)e.push(this.data.array[s+l])}return{itemSize:this.itemSize,type:this.array.constructor.name,array:e,normalized:this.normalized}}else return t.interleavedBuffers===void 0&&(t.interleavedBuffers={}),t.interleavedBuffers[this.data.uuid]===void 0&&(t.interleavedBuffers[this.data.uuid]=this.data.toJSON(t)),{isInterleavedBufferAttribute:!0,itemSize:this.itemSize,data:this.data.uuid,offset:this.offset,normalized:this.normalized}}},_v=class extends Bl{constructor(t){super(),this.isSpriteMaterial=!0,this.type="SpriteMaterial",this.color=new ar(16777215),this.map=null,this.alphaMap=null,this.rotation=0,this.sizeAttenuation=!0,this.transparent=!0,this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.map=t.map,this.alphaMap=t.alphaMap,this.rotation=t.rotation,this.sizeAttenuation=t.sizeAttenuation,this.fog=t.fog,this}},Hu,rh=new Rt,Oc=new Rt,Dc=new Rt,Fc=new Ye,ih=new Ye,AC=new vi,yd=new Rt,oh=new Rt,vd=new Rt,rC=new Ye,qy=new Ye,iC=new Ye,xv=class extends ia{constructor(t=new _v){if(super(),this.isSprite=!0,this.type="Sprite",Hu===void 0){Hu=new Qu;let e=new Float32Array([-.5,-.5,0,0,0,.5,-.5,0,1,0,.5,.5,0,1,1,-.5,.5,0,0,1]),o=new vv(e,5);Hu.setIndex([0,1,2,0,2,3]),Hu.setAttribute("position",new qd(o,3,0,!1)),Hu.setAttribute("uv",new qd(o,2,3,!1))}this.geometry=Hu,this.material=t,this.center=new Ye(.5,.5)}raycast(t,e){t.camera===null&&console.error('THREE.Sprite: "Raycaster.camera" needs to be set in order to raycast against sprites.'),Oc.setFromMatrixScale(this.matrixWorld),AC.copy(t.camera.matrixWorld),this.modelViewMatrix.multiplyMatrices(t.camera.matrixWorldInverse,this.matrixWorld),Dc.setFromMatrixPosition(this.modelViewMatrix),t.camera.isPerspectiveCamera&&this.material.sizeAttenuation===!1&&Oc.multiplyScalar(-Dc.z);let o=this.material.rotation,s,l;o!==0&&(l=Math.cos(o),s=Math.sin(o));let p=this.center;_d(yd.set(-.5,-.5,0),Dc,p,Oc,s,l),_d(oh.set(.5,-.5,0),Dc,p,Oc,s,l),_d(vd.set(.5,.5,0),Dc,p,Oc,s,l),rC.set(0,0),qy.set(1,0),iC.set(1,1);let h=t.ray.intersectTriangle(yd,oh,vd,!1,rh);if(h===null&&(_d(oh.set(-.5,.5,0),Dc,p,Oc,s,l),qy.set(0,1),h=t.ray.intersectTriangle(yd,vd,oh,!1,rh),h===null))return;let g=t.ray.origin.distanceTo(rh);g<t.near||g>t.far||e.push({distance:g,point:rh.clone(),uv:Nl.getInterpolation(rh,yd,oh,vd,rC,qy,iC,new Ye),face:null,object:this})}copy(t,e){return super.copy(t,e),t.center!==void 0&&this.center.copy(t.center),this.material=t.material,this}};xv.Dispose=function(){Hu.dispose(),Hu=void 0};function _d(n,t,e,o,s,l){Fc.subVectors(n,e).addScalar(.5).multiply(o),s!==void 0?(ih.x=l*Fc.x-s*Fc.y,ih.y=s*Fc.x+l*Fc.y):ih.copy(Fc),n.copy(t),n.x+=ih.x,n.y+=ih.y,n.applyMatrix4(AC)}function xd(n,t,e){return!n||!e&&n.constructor===t?n:typeof t.BYTES_PER_ELEMENT=="number"?new t(n):Array.prototype.slice.call(n)}function fX(n){return ArrayBuffer.isView(n)&&!(n instanceof DataView)}var Yc=class{constructor(t,e,o,s){this.parameterPositions=t,this._cachedIndex=0,this.resultBuffer=s!==void 0?s:new e.constructor(o),this.sampleValues=e,this.valueSize=o,this.settings=null,this.DefaultSettings_={}}evaluate(t){let e=this.parameterPositions,o=this._cachedIndex,s=e[o],l=e[o-1];t:{e:{let p;n:{r:if(!(t<s)){for(let h=o+2;;){if(s===void 0){if(t<l)break r;return o=e.length,this._cachedIndex=o,this.copySampleValue_(o-1)}if(o===h)break;if(l=s,s=e[++o],t<s)break e}p=e.length;break n}if(!(t>=l)){let h=e[1];t<h&&(o=2,l=h);for(let g=o-2;;){if(l===void 0)return this._cachedIndex=0,this.copySampleValue_(0);if(o===g)break;if(s=l,l=e[--o-1],t>=l)break e}p=o,o=0;break n}break t}for(;o<p;){let h=o+p>>>1;t<e[h]?p=h:o=h+1}if(s=e[o],l=e[o-1],l===void 0)return this._cachedIndex=0,this.copySampleValue_(0);if(s===void 0)return o=e.length,this._cachedIndex=o,this.copySampleValue_(o-1)}this._cachedIndex=o,this.intervalChanged_(o,l,s)}return this.interpolate_(o,l,t,s)}getSettings_(){return this.settings||this.DefaultSettings_}copySampleValue_(t){let e=this.resultBuffer,o=this.sampleValues,s=this.valueSize,l=t*s;for(let p=0;p!==s;++p)e[p]=o[l+p];return e}interpolate_(){throw new Error("call to abstract method")}intervalChanged_(){}},Ev=class extends Yc{constructor(t,e,o,s){super(t,e,o,s),this._weightPrev=-0,this._offsetPrev=-0,this._weightNext=-0,this._offsetNext=-0,this.DefaultSettings_={endingStart:hT,endingEnd:hT}}intervalChanged_(t,e,o){let s=this.parameterPositions,l=t-2,p=t+1,h=s[l],g=s[p];if(h===void 0)switch(this.getSettings_().endingStart){case pT:l=t,h=2*e-o;break;case dT:l=s.length-2,h=e+s[l]-s[l+1];break;default:l=t,h=o}if(g===void 0)switch(this.getSettings_().endingEnd){case pT:p=t,g=2*o-e;break;case dT:p=1,g=o+s[1]-s[0];break;default:p=t-1,g=e}let m=(o-e)*.5,v=this.valueSize;this._weightPrev=m/(e-h),this._weightNext=m/(g-o),this._offsetPrev=l*v,this._offsetNext=p*v}interpolate_(t,e,o,s){let l=this.resultBuffer,p=this.sampleValues,h=this.valueSize,g=t*h,m=g-h,v=this._offsetPrev,x=this._offsetNext,E=this._weightPrev,M=this._weightNext,A=(o-e)/(s-e),I=A*A,S=I*A,w=-E*S+2*E*I-E*A,R=(1+E)*S+(-1.5-2*E)*I+(-.5+E)*A+1,C=(-1-M)*S+(1.5+M)*I+.5*A,F=M*S-M*I;for(let V=0;V!==h;++V)l[V]=w*p[v+V]+R*p[m+V]+C*p[g+V]+F*p[x+V];return l}},wv=class extends Yc{constructor(t,e,o,s){super(t,e,o,s)}interpolate_(t,e,o,s){let l=this.resultBuffer,p=this.sampleValues,h=this.valueSize,g=t*h,m=g-h,v=(o-e)/(s-e),x=1-v;for(let E=0;E!==h;++E)l[E]=p[m+E]*x+p[g+E]*v;return l}},Sv=class extends Yc{constructor(t,e,o,s){super(t,e,o,s)}interpolate_(t){return this.copySampleValue_(t-1)}},oa=class{constructor(t,e,o,s){if(t===void 0)throw new Error("THREE.KeyframeTrack: track name is undefined");if(e===void 0||e.length===0)throw new Error("THREE.KeyframeTrack: no keyframes in track named "+t);this.name=t,this.times=xd(e,this.TimeBufferType),this.values=xd(o,this.ValueBufferType),this.setInterpolation(s||this.DefaultInterpolation)}static toJSON(t){let e=t.constructor,o;if(e.toJSON!==this.toJSON)o=e.toJSON(t);else{o={name:t.name,times:xd(t.times,Array),values:xd(t.values,Array)};let s=t.getInterpolation();s!==t.DefaultInterpolation&&(o.interpolation=s)}return o.type=t.ValueTypeName,o}InterpolantFactoryMethodDiscrete(t){return new Sv(this.times,this.values,this.getValueSize(),t)}InterpolantFactoryMethodLinear(t){return new wv(this.times,this.values,this.getValueSize(),t)}InterpolantFactoryMethodSmooth(t){return new Ev(this.times,this.values,this.getValueSize(),t)}setInterpolation(t){let e;switch(t){case wd:e=this.InterpolantFactoryMethodDiscrete;break;case Sd:e=this.InterpolantFactoryMethodLinear;break;case gy:e=this.InterpolantFactoryMethodSmooth;break}if(e===void 0){let o="unsupported interpolation for "+this.ValueTypeName+" keyframe track named "+this.name;if(this.createInterpolant===void 0)if(t!==this.DefaultInterpolation)this.setInterpolation(this.DefaultInterpolation);else throw new Error(o);return console.warn("THREE.KeyframeTrack:",o),this}return this.createInterpolant=e,this}getInterpolation(){switch(this.createInterpolant){case this.InterpolantFactoryMethodDiscrete:return wd;case this.InterpolantFactoryMethodLinear:return Sd;case this.InterpolantFactoryMethodSmooth:return gy}}getValueSize(){return this.values.length/this.times.length}shift(t){if(t!==0){let e=this.times;for(let o=0,s=e.length;o!==s;++o)e[o]+=t}return this}scale(t){if(t!==1){let e=this.times;for(let o=0,s=e.length;o!==s;++o)e[o]*=t}return this}trim(t,e){let o=this.times,s=o.length,l=0,p=s-1;for(;l!==s&&o[l]<t;)++l;for(;p!==-1&&o[p]>e;)--p;if(++p,l!==0||p!==s){l>=p&&(p=Math.max(p,1),l=p-1);let h=this.getValueSize();this.times=o.slice(l,p),this.values=this.values.slice(l*h,p*h)}return this}validate(){let t=!0,e=this.getValueSize();e-Math.floor(e)!==0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),t=!1);let o=this.times,s=this.values,l=o.length;l===0&&(console.error("THREE.KeyframeTrack: Track is empty.",this),t=!1);let p=null;for(let h=0;h!==l;h++){let g=o[h];if(typeof g=="number"&&isNaN(g)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,h,g),t=!1;break}if(p!==null&&p>g){console.error("THREE.KeyframeTrack: Out of order keys.",this,h,g,p),t=!1;break}p=g}if(s!==void 0&&fX(s))for(let h=0,g=s.length;h!==g;++h){let m=s[h];if(isNaN(m)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,h,m),t=!1;break}}return t}optimize(){let t=this.times.slice(),e=this.values.slice(),o=this.getValueSize(),s=this.getInterpolation()===gy,l=t.length-1,p=1;for(let h=1;h<l;++h){let g=!1,m=t[h],v=t[h+1];if(m!==v&&(h!==1||m!==t[0]))if(s)g=!0;else{let x=h*o,E=x-o,M=x+o;for(let A=0;A!==o;++A){let I=e[x+A];if(I!==e[E+A]||I!==e[M+A]){g=!0;break}}}if(g){if(h!==p){t[p]=t[h];let x=h*o,E=p*o;for(let M=0;M!==o;++M)e[E+M]=e[x+M]}++p}}if(l>0){t[p]=t[l];for(let h=l*o,g=p*o,m=0;m!==o;++m)e[g+m]=e[h+m];++p}return p!==t.length?(this.times=t.slice(0,p),this.values=e.slice(0,p*o)):(this.times=t,this.values=e),this}clone(){let t=this.times.slice(),e=this.values.slice(),o=this.constructor,s=new o(this.name,t,e);return s.createInterpolant=this.createInterpolant,s}};oa.prototype.TimeBufferType=Float32Array;oa.prototype.ValueBufferType=Float32Array;oa.prototype.DefaultInterpolation=Sd;var zl=class extends oa{};zl.prototype.ValueTypeName="bool";zl.prototype.ValueBufferType=Array;zl.prototype.DefaultInterpolation=wd;zl.prototype.InterpolantFactoryMethodLinear=void 0;zl.prototype.InterpolantFactoryMethodSmooth=void 0;var Mv=class extends oa{};Mv.prototype.ValueTypeName="color";var bv=class extends oa{};bv.prototype.ValueTypeName="number";var Av=class extends Yc{constructor(t,e,o,s){super(t,e,o,s)}interpolate_(t,e,o,s){let l=this.resultBuffer,p=this.sampleValues,h=this.valueSize,g=(o-e)/(s-e),m=t*h;for(let v=m+h;m!==v;m+=4)ju.slerpFlat(l,0,p,m-h,p,m,g);return l}},ch=class extends oa{InterpolantFactoryMethodLinear(t){return new Av(this.times,this.values,this.getValueSize(),t)}};ch.prototype.ValueTypeName="quaternion";ch.prototype.DefaultInterpolation=Sd;ch.prototype.InterpolantFactoryMethodSmooth=void 0;var Gl=class extends oa{};Gl.prototype.ValueTypeName="string";Gl.prototype.ValueBufferType=Array;Gl.prototype.DefaultInterpolation=wd;Gl.prototype.InterpolantFactoryMethodLinear=void 0;Gl.prototype.InterpolantFactoryMethodSmooth=void 0;var Tv=class extends oa{};Tv.prototype.ValueTypeName="vector";var Cv=class{constructor(t,e,o){let s=this,l=!1,p=0,h=0,g,m=[];this.onStart=void 0,this.onLoad=t,this.onProgress=e,this.onError=o,this.itemStart=function(v){h++,l===!1&&s.onStart!==void 0&&s.onStart(v,p,h),l=!0},this.itemEnd=function(v){p++,s.onProgress!==void 0&&s.onProgress(v,p,h),p===h&&(l=!1,s.onLoad!==void 0&&s.onLoad())},this.itemError=function(v){s.onError!==void 0&&s.onError(v)},this.resolveURL=function(v){return g?g(v):v},this.setURLModifier=function(v){return g=v,this},this.addHandler=function(v,x){return m.push(v,x),this},this.removeHandler=function(v){let x=m.indexOf(v);return x!==-1&&m.splice(x,2),this},this.getHandler=function(v){for(let x=0,E=m.length;x<E;x+=2){let M=m[x],A=m[x+1];if(M.global&&(M.lastIndex=0),M.test(v))return A}return null}}},hX=new Cv,Pv=class{constructor(t){this.manager=t!==void 0?t:hX,this.crossOrigin="anonymous",this.withCredentials=!1,this.path="",this.resourcePath="",this.requestHeader={}}load(){}loadAsync(t,e){let o=this;return new Promise(function(s,l){o.load(t,s,e,l)})}parse(){}setCrossOrigin(t){return this.crossOrigin=t,this}setWithCredentials(t){return this.withCredentials=t,this}setPath(t){return this.path=t,this}setResourcePath(t){return this.resourcePath=t,this}setRequestHeader(t){return this.requestHeader=t,this}};Pv.DEFAULT_MATERIAL_NAME="__DEFAULT";var Dv="\\\\[\\\\]\\\\.:\\\\/",pX=new RegExp("["+Dv+"]","g"),Fv="[^"+Dv+"]",dX="[^"+Dv.replace("\\\\.","")+"]",gX=/((?:WC+[\\/:])*)/.source.replace("WC",Fv),mX=/(WCOD+)?/.source.replace("WCOD",dX),yX=/(?:\\.(WC+)(?:\\[(.+)\\])?)?/.source.replace("WC",Fv),vX=/\\.(WC+)(?:\\[(.+)\\])?/.source.replace("WC",Fv),_X=new RegExp("^"+gX+mX+yX+vX+"$"),xX=["material","materials","bones","map"],Iv=class{constructor(t,e,o){let s=o||Or.parseTrackName(e);this._targetGroup=t,this._bindings=t.subscribe_(e,s)}getValue(t,e){this.bind();let o=this._targetGroup.nCachedObjects_,s=this._bindings[o];s!==void 0&&s.getValue(t,e)}setValue(t,e){let o=this._bindings;for(let s=this._targetGroup.nCachedObjects_,l=o.length;s!==l;++s)o[s].setValue(t,e)}bind(){let t=this._bindings;for(let e=this._targetGroup.nCachedObjects_,o=t.length;e!==o;++e)t[e].bind()}unbind(){let t=this._bindings;for(let e=this._targetGroup.nCachedObjects_,o=t.length;e!==o;++e)t[e].unbind()}},Or=class n{constructor(t,e,o){this.path=e,this.parsedPath=o||n.parseTrackName(e),this.node=n.findNode(t,this.parsedPath.nodeName),this.rootNode=t,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(t,e,o){return t&&t.isAnimationObjectGroup?new n.Composite(t,e,o):new n(t,e,o)}static sanitizeNodeName(t){return t.replace(/\\s/g,"_").replace(pX,"")}static parseTrackName(t){let e=_X.exec(t);if(e===null)throw new Error("PropertyBinding: Cannot parse trackName: "+t);let o={nodeName:e[2],objectName:e[3],objectIndex:e[4],propertyName:e[5],propertyIndex:e[6]},s=o.nodeName&&o.nodeName.lastIndexOf(".");if(s!==void 0&&s!==-1){let l=o.nodeName.substring(s+1);xX.indexOf(l)!==-1&&(o.nodeName=o.nodeName.substring(0,s),o.objectName=l)}if(o.propertyName===null||o.propertyName.length===0)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+t);return o}static findNode(t,e){if(e===void 0||e===""||e==="."||e===-1||e===t.name||e===t.uuid)return t;if(t.skeleton){let o=t.skeleton.getBoneByName(e);if(o!==void 0)return o}if(t.children){let o=function(l){for(let p=0;p<l.length;p++){let h=l[p];if(h.name===e||h.uuid===e)return h;let g=o(h.children);if(g)return g}return null},s=o(t.children);if(s)return s}return null}_getValue_unavailable(){}_setValue_unavailable(){}_getValue_direct(t,e){t[e]=this.targetObject[this.propertyName]}_getValue_array(t,e){let o=this.resolvedProperty;for(let s=0,l=o.length;s!==l;++s)t[e++]=o[s]}_getValue_arrayElement(t,e){t[e]=this.resolvedProperty[this.propertyIndex]}_getValue_toArray(t,e){this.resolvedProperty.toArray(t,e)}_setValue_direct(t,e){this.targetObject[this.propertyName]=t[e]}_setValue_direct_setNeedsUpdate(t,e){this.targetObject[this.propertyName]=t[e],this.targetObject.needsUpdate=!0}_setValue_direct_setMatrixWorldNeedsUpdate(t,e){this.targetObject[this.propertyName]=t[e],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_array(t,e){let o=this.resolvedProperty;for(let s=0,l=o.length;s!==l;++s)o[s]=t[e++]}_setValue_array_setNeedsUpdate(t,e){let o=this.resolvedProperty;for(let s=0,l=o.length;s!==l;++s)o[s]=t[e++];this.targetObject.needsUpdate=!0}_setValue_array_setMatrixWorldNeedsUpdate(t,e){let o=this.resolvedProperty;for(let s=0,l=o.length;s!==l;++s)o[s]=t[e++];this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_arrayElement(t,e){this.resolvedProperty[this.propertyIndex]=t[e]}_setValue_arrayElement_setNeedsUpdate(t,e){this.resolvedProperty[this.propertyIndex]=t[e],this.targetObject.needsUpdate=!0}_setValue_arrayElement_setMatrixWorldNeedsUpdate(t,e){this.resolvedProperty[this.propertyIndex]=t[e],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_fromArray(t,e){this.resolvedProperty.fromArray(t,e)}_setValue_fromArray_setNeedsUpdate(t,e){this.resolvedProperty.fromArray(t,e),this.targetObject.needsUpdate=!0}_setValue_fromArray_setMatrixWorldNeedsUpdate(t,e){this.resolvedProperty.fromArray(t,e),this.targetObject.matrixWorldNeedsUpdate=!0}_getValue_unbound(t,e){this.bind(),this.getValue(t,e)}_setValue_unbound(t,e){this.bind(),this.setValue(t,e)}bind(){let t=this.node,e=this.parsedPath,o=e.objectName,s=e.propertyName,l=e.propertyIndex;if(t||(t=n.findNode(this.rootNode,e.nodeName),this.node=t),this.getValue=this._getValue_unavailable,this.setValue=this._setValue_unavailable,!t){console.warn("THREE.PropertyBinding: No target node found for track: "+this.path+".");return}if(o){let m=e.objectIndex;switch(o){case"materials":if(!t.material){console.error("THREE.PropertyBinding: Can not bind to material as node does not have a material.",this);return}if(!t.material.materials){console.error("THREE.PropertyBinding: Can not bind to material.materials as node.material does not have a materials array.",this);return}t=t.material.materials;break;case"bones":if(!t.skeleton){console.error("THREE.PropertyBinding: Can not bind to bones as node does not have a skeleton.",this);return}t=t.skeleton.bones;for(let v=0;v<t.length;v++)if(t[v].name===m){m=v;break}break;case"map":if("map"in t){t=t.map;break}if(!t.material){console.error("THREE.PropertyBinding: Can not bind to material as node does not have a material.",this);return}if(!t.material.map){console.error("THREE.PropertyBinding: Can not bind to material.map as node.material does not have a map.",this);return}t=t.material.map;break;default:if(t[o]===void 0){console.error("THREE.PropertyBinding: Can not bind to objectName of node undefined.",this);return}t=t[o]}if(m!==void 0){if(t[m]===void 0){console.error("THREE.PropertyBinding: Trying to bind to objectIndex of objectName, but is undefined.",this,t);return}t=t[m]}}let p=t[s];if(p===void 0){let m=e.nodeName;console.error("THREE.PropertyBinding: Trying to update property for track: "+m+"."+s+" but it wasn't found.",t);return}let h=this.Versioning.None;this.targetObject=t,t.needsUpdate!==void 0?h=this.Versioning.NeedsUpdate:t.matrixWorldNeedsUpdate!==void 0&&(h=this.Versioning.MatrixWorldNeedsUpdate);let g=this.BindingType.Direct;if(l!==void 0){if(s==="morphTargetInfluences"){if(!t.geometry){console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.",this);return}if(!t.geometry.morphAttributes){console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphAttributes.",this);return}t.morphTargetDictionary[l]!==void 0&&(l=t.morphTargetDictionary[l])}g=this.BindingType.ArrayElement,this.resolvedProperty=p,this.propertyIndex=l}else p.fromArray!==void 0&&p.toArray!==void 0?(g=this.BindingType.HasFromToArray,this.resolvedProperty=p):Array.isArray(p)?(g=this.BindingType.EntireArray,this.resolvedProperty=p):this.propertyName=s;this.getValue=this.GetterByBindingType[g],this.setValue=this.SetterByBindingTypeAndVersioning[g][h]}unbind(){this.node=null,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}};Or.Composite=Iv;Or.prototype.BindingType={Direct:0,EntireArray:1,ArrayElement:2,HasFromToArray:3};Or.prototype.Versioning={None:0,NeedsUpdate:1,MatrixWorldNeedsUpdate:2};Or.prototype.GetterByBindingType=[Or.prototype._getValue_direct,Or.prototype._getValue_array,Or.prototype._getValue_arrayElement,Or.prototype._getValue_toArray];Or.prototype.SetterByBindingTypeAndVersioning=[[Or.prototype._setValue_direct,Or.prototype._setValue_direct_setNeedsUpdate,Or.prototype._setValue_direct_setMatrixWorldNeedsUpdate],[Or.prototype._setValue_array,Or.prototype._setValue_array_setNeedsUpdate,Or.prototype._setValue_array_setMatrixWorldNeedsUpdate],[Or.prototype._setValue_arrayElement,Or.prototype._setValue_arrayElement_setNeedsUpdate,Or.prototype._setValue_arrayElement_setMatrixWorldNeedsUpdate],[Or.prototype._setValue_fromArray,Or.prototype._setValue_fromArray_setNeedsUpdate,Or.prototype._setValue_fromArray_setMatrixWorldNeedsUpdate]];var Ytt=new Float32Array(1);typeof __THREE_DEVTOOLS__!="undefined"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:Rv}}));typeof window!="undefined"&&(window.__THREE__?console.warn("WARNING: Multiple instances of Three.js being imported."):window.__THREE__=Rv);var zi=63710088e-1,Jtt={centimeters:zi*100,centimetres:zi*100,degrees:zi/111325,feet:zi*3.28084,inches:zi*39.37,kilometers:zi/1e3,kilometres:zi/1e3,meters:zi,metres:zi,miles:zi/1609.344,millimeters:zi*1e3,millimetres:zi*1e3,nauticalmiles:zi/1852,radians:1,yards:zi*1.0936},Ktt={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/zi,yards:1.0936133};function bo(n,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=n,o}function Pr(n,t,e){if(e===void 0&&(e={}),!n)throw new Error("coordinates is required");if(!Array.isArray(n))throw new Error("coordinates must be an Array");if(n.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!Ra(n[0])||!Ra(n[1]))throw new Error("coordinates must contain numbers");var o={type:"Point",coordinates:n};return bo(o,t,e)}function Dr(n,t,e){e===void 0&&(e={});for(var o=0,s=n;o<s.length;o++){var l=s[o];if(l.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");for(var p=0;p<l[l.length-1].length;p++)if(l[l.length-1][p]!==l[0][p])throw new Error("First and last Position are not equivalent.")}var h={type:"Polygon",coordinates:n};return bo(h,t,e)}function Gi(n,t,e){if(e===void 0&&(e={}),n.length<2)throw new Error("coordinates must be an array of two or more positions");var o={type:"LineString",coordinates:n};return bo(o,t,e)}function Uv(n,t,e){e===void 0&&(e={});var o={type:"MultiPoint",coordinates:n};return bo(o,t,e)}function Ra(n){return!isNaN(n)&&n!==null&&!Array.isArray(n)}function Ei(n,t,e){if(n!==null)for(var o,s,l,p,h,g,m,v=0,x=0,E,M=n.type,A=M==="FeatureCollection",I=M==="Feature",S=A?n.features.length:1,w=0;w<S;w++){m=A?n.features[w].geometry:I?n.geometry:n,E=m?m.type==="GeometryCollection":!1,h=E?m.geometries.length:1;for(var R=0;R<h;R++){var C=0,F=0;if(p=E?m.geometries[R]:m,p!==null){g=p.coordinates;var V=p.type;switch(v=e&&(V==="Polygon"||V==="MultiPolygon")?1:0,V){case null:break;case"Point":if(t(g,x,w,C,F)===!1)return!1;x++,C++;break;case"LineString":case"MultiPoint":for(o=0;o<g.length;o++){if(t(g[o],x,w,C,F)===!1)return!1;x++,V==="MultiPoint"&&C++}V==="LineString"&&C++;break;case"Polygon":case"MultiLineString":for(o=0;o<g.length;o++){for(s=0;s<g[o].length-v;s++){if(t(g[o][s],x,w,C,F)===!1)return!1;x++}V==="MultiLineString"&&C++,V==="Polygon"&&F++}V==="Polygon"&&C++;break;case"MultiPolygon":for(o=0;o<g.length;o++){for(F=0,s=0;s<g[o].length;s++){for(l=0;l<g[o][s].length-v;l++){if(t(g[o][s][l],x,w,C,F)===!1)return!1;x++}F++}C++}break;case"GeometryCollection":for(o=0;o<p.geometries.length;o++)if(Ei(p.geometries[o],t,e)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function TC(n,t,e,o){var s=e;return Ei(n,function(l,p,h,g,m){p===0&&e===void 0?s=l:s=t(s,l,p,h,g,m)},o),s}function el(n,t){var e,o,s,l,p,h,g,m,v,x,E=0,M=n.type==="FeatureCollection",A=n.type==="Feature",I=M?n.features.length:1;for(e=0;e<I;e++){for(h=M?n.features[e].geometry:A?n.geometry:n,m=M?n.features[e].properties:A?n.properties:{},v=M?n.features[e].bbox:A?n.bbox:void 0,x=M?n.features[e].id:A?n.id:void 0,g=h?h.type==="GeometryCollection":!1,p=g?h.geometries.length:1,s=0;s<p;s++){if(l=g?h.geometries[s]:h,l===null){if(t(null,E,m,v,x)===!1)return!1;continue}switch(l.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":{if(t(l,E,m,v,x)===!1)return!1;break}case"GeometryCollection":{for(o=0;o<l.geometries.length;o++)if(t(l.geometries[o],E,m,v,x)===!1)return!1;break}default:throw new Error("Unknown Geometry Type")}}E++}}function ys(n,t){el(n,function(e,o,s,l,p){var h=e===null?null:e.type;switch(h){case null:case"Point":case"LineString":case"Polygon":return t(bo(e,s,{bbox:l,id:p}),o,0)===!1?!1:void 0}var g;switch(h){case"MultiPoint":g="Point";break;case"MultiLineString":g="LineString";break;case"MultiPolygon":g="Polygon";break}for(var m=0;m<e.coordinates.length;m++){var v=e.coordinates[m],x={type:g,coordinates:v};if(t(bo(x,s),o,m)===!1)return!1}})}function Bv(n){var t=[1/0,1/0,-1/0,-1/0];return Ei(n,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}Bv.default=Bv;var Ao=Bv;function Qi(n){if(!n)throw new Error("coord is required");if(!Array.isArray(n)){if(n.type==="Feature"&&n.geometry!==null&&n.geometry.type==="Point")return n.geometry.coordinates;if(n.type==="Point")return n.coordinates}if(Array.isArray(n)&&n.length>=2&&!Array.isArray(n[0])&&!Array.isArray(n[1]))return n;throw new Error("coord must be GeoJSON Point or an Array of numbers")}function zv(n,t,e){if(!n)throw new Error("No feature passed");if(!e)throw new Error(".featureOf() requires a name");if(!n||n.type!=="Feature"||!n.geometry)throw new Error("Invalid input to "+e+", Feature with geometry required");if(!n.geometry||n.geometry.type!==t)throw new Error("Invalid input to "+e+": must be a "+t+", given "+n.geometry.type)}function to(n){return n.type==="Feature"?n.geometry:n}var CX=sn(Xd(),1);var BX=sn(WC(),1);function ki(n,t,e){if(e===void 0&&(e={}),!n)throw new Error("point is required");if(!t)throw new Error("polygon is required");var o=Qi(n),s=to(t),l=s.type,p=t.bbox,h=s.coordinates;if(p&&zX(o,p)===!1)return!1;l==="Polygon"&&(h=[h]);for(var g=!1,m=0;m<h.length&&!g;m++)if(XC(o,h[m][0],e.ignoreBoundary)){for(var v=!1,x=1;x<h[m].length&&!v;)XC(o,h[m][x],!e.ignoreBoundary)&&(v=!0),x++;v||(g=!0)}return g}function XC(n,t,e){var o=!1;t[0][0]===t[t.length-1][0]&&t[0][1]===t[t.length-1][1]&&(t=t.slice(0,t.length-1));for(var s=0,l=t.length-1;s<t.length;l=s++){var p=t[s][0],h=t[s][1],g=t[l][0],m=t[l][1],v=n[1]*(p-g)+h*(g-n[0])+m*(n[0]-p)===0&&(p-n[0])*(g-n[0])<=0&&(h-n[1])*(m-n[1])<=0;if(v)return!e;var x=h>n[1]!=m>n[1]&&n[0]<(g-p)*(n[1]-h)/(m-h)+p;x&&(o=!o)}return o}function zX(n,t){return t[0]<=n[0]&&t[1]<=n[1]&&t[2]>=n[0]&&t[3]>=n[1]}var ZC=new ArrayBuffer(16),Cnt=new Float64Array(ZC),Pnt=new Uint32Array(ZC);var t7=sn(e_(),1);var eit=function(){function n(t){this.points=t.points||[],this.duration=t.duration||1e4,this.sharpness=t.sharpness||.85,this.centers=[],this.controls=[],this.stepLength=t.stepLength||60,this.length=this.points.length,this.delay=0;for(var e=0;e<this.length;e++)this.points[e].z=this.points[e].z||0;for(var e=0;e<this.length-1;e++){var o=this.points[e],s=this.points[e+1];this.centers.push({x:(o.x+s.x)/2,y:(o.y+s.y)/2,z:(o.z+s.z)/2})}this.controls.push([this.points[0],this.points[0]]);for(var e=0;e<this.centers.length-1;e++){var l=this.points[e+1].x-(this.centers[e].x+this.centers[e+1].x)/2,p=this.points[e+1].y-(this.centers[e].y+this.centers[e+1].y)/2,h=this.points[e+1].z-(this.centers[e].y+this.centers[e+1].z)/2;this.controls.push([{x:(1-this.sharpness)*this.points[e+1].x+this.sharpness*(this.centers[e].x+l),y:(1-this.sharpness)*this.points[e+1].y+this.sharpness*(this.centers[e].y+p),z:(1-this.sharpness)*this.points[e+1].z+this.sharpness*(this.centers[e].z+h)},{x:(1-this.sharpness)*this.points[e+1].x+this.sharpness*(this.centers[e+1].x+l),y:(1-this.sharpness)*this.points[e+1].y+this.sharpness*(this.centers[e+1].y+p),z:(1-this.sharpness)*this.points[e+1].z+this.sharpness*(this.centers[e+1].z+h)}])}return this.controls.push([this.points[this.length-1],this.points[this.length-1]]),this.steps=this.cacheSteps(this.stepLength),this}return n.prototype.cacheSteps=function(t){var e=[],o=this.pos(0);e.push(0);for(var s=0;s<this.duration;s+=10){var l=this.pos(s),p=Math.sqrt((l.x-o.x)*(l.x-o.x)+(l.y-o.y)*(l.y-o.y)+(l.z-o.z)*(l.z-o.z));p>t&&(e.push(s),o=l)}return e},n.prototype.vector=function(t){var e=this.pos(t+10),o=this.pos(t-10);return{angle:180*Math.atan2(e.y-o.y,e.x-o.x)/3.14,speed:Math.sqrt((o.x-e.x)*(o.x-e.x)+(o.y-e.y)*(o.y-e.y)+(o.z-e.z)*(o.z-e.z))}},n.prototype.pos=function(t){var e=t-this.delay;e<0&&(e=0),e>this.duration&&(e=this.duration-1);var o=e/this.duration;if(o>=1)return this.points[this.length-1];var s=Math.floor((this.points.length-1)*o),l=(this.length-1)*o-s;return e7(l,this.points[s],this.controls[s][1],this.controls[s+1][0],this.points[s+1])},n}();function e7(n,t,e,o,s){var l=n7(n),p={x:s.x*l[0]+o.x*l[1]+e.x*l[2]+t.x*l[3],y:s.y*l[0]+o.y*l[1]+e.y*l[2]+t.y*l[3],z:s.z*l[0]+o.z*l[1]+e.z*l[2]+t.z*l[3]};return p}function n7(n){var t=n*n,e=t*n;return[e,3*t*(1-n),3*n*(1-n)*(1-n),(1-n)*(1-n)*(1-n)]}function dh(n,t){t===void 0&&(t={});var e=Number(n[0]),o=Number(n[1]),s=Number(n[2]),l=Number(n[3]);if(n.length===6)throw new Error("@turf/bbox-polygon does not support BBox with 6 positions");var p=[e,o],h=[e,l],g=[s,l],m=[s,o];return Dr([[p,m,g,h,p]],t.properties,{bbox:n,id:t.id})}function r7(n){return dh(Ao(n))}var n_=r7;var x7=sn(sP(),1);var Y7=sn(lg(),1);var Z7=sn(Xd(),1);var j7=sn(e_(),1);var MP=Math.PI/180,bP=180/Math.PI,Eh=function(n,t){this.lon=n,this.lat=t,this.x=MP*n,this.y=MP*t};Eh.prototype.view=function(){return String(this.lon).slice(0,4)+","+String(this.lat).slice(0,4)};Eh.prototype.antipode=function(){var n=-1*this.lat,t=this.lon<0?180+this.lon:(180-this.lon)*-1;return new Eh(t,n)};var AP=function(){this.coords=[],this.length=0};AP.prototype.move_to=function(n){this.length++,this.coords.push(n)};var w_=function(n){this.properties=n||{},this.geometries=[]};w_.prototype.json=function(){if(this.geometries.length<=0)return{geometry:{type:"LineString",coordinates:null},type:"Feature",properties:this.properties};if(this.geometries.length===1)return{geometry:{type:"LineString",coordinates:this.geometries[0].coords},type:"Feature",properties:this.properties};for(var n=[],t=0;t<this.geometries.length;t++)n.push(this.geometries[t].coords);return{geometry:{type:"MultiLineString",coordinates:n},type:"Feature",properties:this.properties}};w_.prototype.wkt=function(){for(var n="",t="LINESTRING(",e=function(l){t+=l[0]+" "+l[1]+","},o=0;o<this.geometries.length;o++){if(this.geometries[o].coords.length===0)return"LINESTRING(empty)";var s=this.geometries[o].coords;s.forEach(e),n+=t.substring(0,t.length-1)+")"}return n};var TP=function(n,t,e){if(!n||n.x===void 0||n.y===void 0)throw new Error("GreatCircle constructor expects two args: start and end objects with x and y properties");if(!t||t.x===void 0||t.y===void 0)throw new Error("GreatCircle constructor expects two args: start and end objects with x and y properties");this.start=new Eh(n.x,n.y),this.end=new Eh(t.x,t.y),this.properties=e||{};var o=this.start.x-this.end.x,s=this.start.y-this.end.y,l=Math.pow(Math.sin(s/2),2)+Math.cos(this.start.y)*Math.cos(this.end.y)*Math.pow(Math.sin(o/2),2);if(this.g=2*Math.asin(Math.sqrt(l)),this.g===Math.PI)throw new Error("it appears "+n.view()+" and "+t.view()+" are 'antipodal', e.g diametrically opposite, thus there is no single route but rather infinite");if(isNaN(this.g))throw new Error("could not calculate great circle between "+n+" and "+t)};TP.prototype.interpolate=function(n){var t=Math.sin((1-n)*this.g)/Math.sin(this.g),e=Math.sin(n*this.g)/Math.sin(this.g),o=t*Math.cos(this.start.y)*Math.cos(this.start.x)+e*Math.cos(this.end.y)*Math.cos(this.end.x),s=t*Math.cos(this.start.y)*Math.sin(this.start.x)+e*Math.cos(this.end.y)*Math.sin(this.end.x),l=t*Math.sin(this.start.y)+e*Math.sin(this.end.y),p=bP*Math.atan2(l,Math.sqrt(Math.pow(o,2)+Math.pow(s,2))),h=bP*Math.atan2(s,o);return[h,p]};TP.prototype.Arc=function(n,t){var e=[];if(!n||n<=2)e.push([this.start.lon,this.start.lat]),e.push([this.end.lon,this.end.lat]);else for(var o=1/(n-1),s=0;s<n;++s){var l=o*s,p=this.interpolate(l);e.push(p)}for(var h=!1,g=0,m=t&&t.offset?t.offset:10,v=180-m,x=-180+m,E=360-m,M=1;M<e.length;++M){var A=e[M-1][0],I=e[M][0],S=Math.abs(I-A);S>E&&(I>v&&A<x||A>v&&I<x)?h=!0:S>g&&(g=S)}var w=[];if(h&&g<m){var R=[];w.push(R);for(var C=0;C<e.length;++C){var F=parseFloat(e[C][0]);if(C>0&&Math.abs(F-e[C-1][0])>E){var V=parseFloat(e[C-1][0]),X=parseFloat(e[C-1][1]),q=parseFloat(e[C][0]),D=parseFloat(e[C][1]);if(V>-180&&V<x&&q===180&&C+1<e.length&&e[C-1][0]>-180&&e[C-1][0]<x){R.push([-180,e[C][1]]),C++,R.push([e[C][0],e[C][1]]);continue}else if(V>v&&V<180&&q===-180&&C+1<e.length&&e[C-1][0]>v&&e[C-1][0]<180){R.push([180,e[C][1]]),C++,R.push([e[C][0],e[C][1]]);continue}if(V<x&&q>v){var xt=V;V=q,q=xt;var B=X;X=D,D=B}if(V>v&&q<x&&(q+=360),V<=180&&q>=180&&V<q){var j=(180-V)/(q-V),J=j*D+(1-j)*X;R.push([e[C-1][0]>v?180:-180,J]),R=[],R.push([e[C-1][0]>v?-180:180,J]),w.push(R)}else R=[],w.push(R);R.push([F,e[C][1]])}else R.push([e[C][0],e[C][1]])}}else{var Dt=[];w.push(Dt);for(var Q=0;Q<e.length;++Q)Dt.push([e[Q][0],e[Q][1]])}for(var At=new w_(this.properties),Mt=0;Mt<w.length;++Mt){var Lt=new AP;At.geometries.push(Lt);for(var pt=w[Mt],yt=0;yt<pt.length;++yt)Lt.move_to(pt[yt])}return At};var eY=sn(lg(),1);var tZ=sn(lg(),1);var eZ=sn(J_(),1);var iZ=sn(Xd(),1);var ln=[],cn=[],fn=[],hn=[],pn=[],dn=[],gn=[],mn=[],yn=[],vn=[],_n=[],xn=[],En=[],wn=[],Sn=[],Mn=[],bn=[],An=[],Tn=[],Cn=[],Pn=[],In=[],Rn=[],Ln=[];gn[85]=vn[85]=-1;mn[85]=_n[85]=0;yn[85]=xn[85]=1;Tn[85]=In[85]=1;Cn[85]=Rn[85]=0;Pn[85]=Ln[85]=1;ln[85]=hn[85]=0;cn[85]=pn[85]=-1;fn[85]=Sn[85]=0;Mn[85]=En[85]=0;bn[85]=wn[85]=1;dn[85]=An[85]=1;In[1]=In[169]=0;Rn[1]=Rn[169]=-1;Ln[1]=Ln[169]=0;En[1]=En[169]=-1;wn[1]=wn[169]=0;Sn[1]=Sn[169]=0;vn[4]=vn[166]=0;_n[4]=_n[166]=-1;xn[4]=xn[166]=1;Mn[4]=Mn[166]=1;bn[4]=bn[166]=0;An[4]=An[166]=0;gn[16]=gn[154]=0;mn[16]=mn[154]=1;yn[16]=yn[154]=1;hn[16]=hn[154]=1;pn[16]=pn[154]=0;dn[16]=dn[154]=1;Tn[64]=Tn[106]=0;Cn[64]=Cn[106]=1;Pn[64]=Pn[106]=0;ln[64]=ln[106]=-1;cn[64]=cn[106]=0;fn[64]=fn[106]=1;Tn[2]=Tn[168]=0;Cn[2]=Cn[168]=-1;Pn[2]=Pn[168]=1;In[2]=In[168]=0;Rn[2]=Rn[168]=-1;Ln[2]=Ln[168]=0;En[2]=En[168]=-1;wn[2]=wn[168]=0;Sn[2]=Sn[168]=0;Mn[2]=Mn[168]=-1;bn[2]=bn[168]=0;An[2]=An[168]=1;gn[8]=gn[162]=0;mn[8]=mn[162]=-1;yn[8]=yn[162]=0;vn[8]=vn[162]=0;_n[8]=_n[162]=-1;xn[8]=xn[162]=1;En[8]=En[162]=1;wn[8]=wn[162]=0;Sn[8]=Sn[162]=1;Mn[8]=Mn[162]=1;bn[8]=bn[162]=0;An[8]=An[162]=0;gn[32]=gn[138]=0;mn[32]=mn[138]=1;yn[32]=yn[138]=1;vn[32]=vn[138]=0;_n[32]=_n[138]=1;xn[32]=xn[138]=0;ln[32]=ln[138]=1;cn[32]=cn[138]=0;fn[32]=fn[138]=0;hn[32]=hn[138]=1;pn[32]=pn[138]=0;dn[32]=dn[138]=1;In[128]=In[42]=0;Rn[128]=Rn[42]=1;Ln[128]=Ln[42]=1;Tn[128]=Tn[42]=0;Cn[128]=Cn[42]=1;Pn[128]=Pn[42]=0;ln[128]=ln[42]=-1;cn[128]=cn[42]=0;fn[128]=fn[42]=1;hn[128]=hn[42]=-1;pn[128]=pn[42]=0;dn[128]=dn[42]=0;vn[5]=vn[165]=-1;_n[5]=_n[165]=0;xn[5]=xn[165]=0;In[5]=In[165]=1;Rn[5]=Rn[165]=0;Ln[5]=Ln[165]=0;Mn[20]=Mn[150]=0;bn[20]=bn[150]=1;An[20]=An[150]=1;hn[20]=hn[150]=0;pn[20]=pn[150]=-1;dn[20]=dn[150]=1;gn[80]=gn[90]=-1;mn[80]=mn[90]=0;yn[80]=yn[90]=1;Tn[80]=Tn[90]=1;Cn[80]=Cn[90]=0;Pn[80]=Pn[90]=1;En[65]=En[105]=0;wn[65]=wn[105]=1;Sn[65]=Sn[105]=0;ln[65]=ln[105]=0;cn[65]=cn[105]=-1;fn[65]=fn[105]=0;gn[160]=gn[10]=-1;mn[160]=mn[10]=0;yn[160]=yn[10]=1;vn[160]=vn[10]=-1;_n[160]=_n[10]=0;xn[160]=xn[10]=0;In[160]=In[10]=1;Rn[160]=Rn[10]=0;Ln[160]=Ln[10]=0;Tn[160]=Tn[10]=1;Cn[160]=Cn[10]=0;Pn[160]=Pn[10]=1;Mn[130]=Mn[40]=0;bn[130]=bn[40]=1;An[130]=An[40]=1;En[130]=En[40]=0;wn[130]=wn[40]=1;Sn[130]=Sn[40]=0;ln[130]=ln[40]=0;cn[130]=cn[40]=-1;fn[130]=fn[40]=0;hn[130]=hn[40]=0;pn[130]=pn[40]=-1;dn[130]=dn[40]=1;vn[37]=vn[133]=0;_n[37]=_n[133]=1;xn[37]=xn[133]=1;In[37]=In[133]=0;Rn[37]=Rn[133]=1;Ln[37]=Ln[133]=0;ln[37]=ln[133]=-1;cn[37]=cn[133]=0;fn[37]=fn[133]=0;hn[37]=hn[133]=1;pn[37]=pn[133]=0;dn[37]=dn[133]=0;Mn[148]=Mn[22]=-1;bn[148]=bn[22]=0;An[148]=An[22]=0;In[148]=In[22]=0;Rn[148]=Rn[22]=-1;Ln[148]=Ln[22]=1;Tn[148]=Tn[22]=0;Cn[148]=Cn[22]=1;Pn[148]=Pn[22]=1;hn[148]=hn[22]=-1;pn[148]=pn[22]=0;dn[148]=dn[22]=1;gn[82]=gn[88]=0;mn[82]=mn[88]=-1;yn[82]=yn[88]=1;Mn[82]=Mn[88]=1;bn[82]=bn[88]=0;An[82]=An[88]=1;En[82]=En[88]=-1;wn[82]=wn[88]=0;Sn[82]=Sn[88]=1;Tn[82]=Tn[88]=0;Cn[82]=Cn[88]=-1;Pn[82]=Pn[88]=0;gn[73]=gn[97]=0;mn[73]=mn[97]=1;yn[73]=yn[97]=0;vn[73]=vn[97]=0;_n[73]=_n[97]=-1;xn[73]=xn[97]=0;En[73]=En[97]=1;wn[73]=wn[97]=0;Sn[73]=Sn[97]=0;ln[73]=ln[97]=1;cn[73]=cn[97]=0;fn[73]=fn[97]=1;gn[145]=gn[25]=0;mn[145]=mn[25]=-1;yn[145]=yn[25]=0;En[145]=En[25]=1;wn[145]=wn[25]=0;Sn[145]=Sn[25]=1;In[145]=In[25]=0;Rn[145]=Rn[25]=1;Ln[145]=Ln[25]=1;hn[145]=hn[25]=-1;pn[145]=pn[25]=0;dn[145]=dn[25]=0;vn[70]=vn[100]=0;_n[70]=_n[100]=1;xn[70]=xn[100]=0;Mn[70]=Mn[100]=-1;bn[70]=bn[100]=0;An[70]=An[100]=1;Tn[70]=Tn[100]=0;Cn[70]=Cn[100]=-1;Pn[70]=Pn[100]=1;ln[70]=ln[100]=1;cn[70]=cn[100]=0;fn[70]=fn[100]=0;vn[101]=vn[69]=0;_n[101]=_n[69]=1;xn[101]=xn[69]=0;ln[101]=ln[69]=1;cn[101]=cn[69]=0;fn[101]=fn[69]=0;In[149]=In[21]=0;Rn[149]=Rn[21]=1;Ln[149]=Ln[21]=1;hn[149]=hn[21]=-1;pn[149]=pn[21]=0;dn[149]=dn[21]=0;Mn[86]=Mn[84]=-1;bn[86]=bn[84]=0;An[86]=An[84]=1;Tn[86]=Tn[84]=0;Cn[86]=Cn[84]=-1;Pn[86]=Pn[84]=1;gn[89]=gn[81]=0;mn[89]=mn[81]=-1;yn[89]=yn[81]=0;En[89]=En[81]=1;wn[89]=wn[81]=0;Sn[89]=Sn[81]=1;gn[96]=gn[74]=0;mn[96]=mn[74]=1;yn[96]=yn[74]=0;vn[96]=vn[74]=-1;_n[96]=_n[74]=0;xn[96]=xn[74]=1;Tn[96]=Tn[74]=1;Cn[96]=Cn[74]=0;Pn[96]=Pn[74]=0;ln[96]=ln[74]=1;cn[96]=cn[74]=0;fn[96]=fn[74]=1;gn[24]=gn[146]=0;mn[24]=mn[146]=-1;yn[24]=yn[146]=1;Mn[24]=Mn[146]=1;bn[24]=bn[146]=0;An[24]=An[146]=1;En[24]=En[146]=0;wn[24]=wn[146]=1;Sn[24]=Sn[146]=1;hn[24]=hn[146]=0;pn[24]=pn[146]=-1;dn[24]=dn[146]=0;vn[6]=vn[164]=-1;_n[6]=_n[164]=0;xn[6]=xn[164]=1;Mn[6]=Mn[164]=-1;bn[6]=bn[164]=0;An[6]=An[164]=0;In[6]=In[164]=0;Rn[6]=Rn[164]=-1;Ln[6]=Ln[164]=1;Tn[6]=Tn[164]=1;Cn[6]=Cn[164]=0;Pn[6]=Pn[164]=0;En[129]=En[41]=0;wn[129]=wn[41]=1;Sn[129]=Sn[41]=1;In[129]=In[41]=0;Rn[129]=Rn[41]=1;Ln[129]=Ln[41]=0;ln[129]=ln[41]=-1;cn[129]=cn[41]=0;fn[129]=fn[41]=0;hn[129]=hn[41]=0;pn[129]=pn[41]=-1;dn[129]=dn[41]=0;Mn[66]=Mn[104]=0;bn[66]=bn[104]=1;An[66]=An[104]=0;En[66]=En[104]=-1;wn[66]=wn[104]=0;Sn[66]=Sn[104]=1;Tn[66]=Tn[104]=0;Cn[66]=Cn[104]=-1;Pn[66]=Pn[104]=0;ln[66]=ln[104]=0;cn[66]=cn[104]=-1;fn[66]=fn[104]=1;gn[144]=gn[26]=-1;mn[144]=mn[26]=0;yn[144]=yn[26]=0;In[144]=In[26]=1;Rn[144]=Rn[26]=0;Ln[144]=Ln[26]=1;Tn[144]=Tn[26]=0;Cn[144]=Cn[26]=1;Pn[144]=Pn[26]=1;hn[144]=hn[26]=-1;pn[144]=pn[26]=0;dn[144]=dn[26]=1;vn[36]=vn[134]=0;_n[36]=_n[134]=1;xn[36]=xn[134]=1;Mn[36]=Mn[134]=0;bn[36]=bn[134]=1;An[36]=An[134]=0;ln[36]=ln[134]=0;cn[36]=cn[134]=-1;fn[36]=fn[134]=1;hn[36]=hn[134]=1;pn[36]=pn[134]=0;dn[36]=dn[134]=0;gn[9]=gn[161]=-1;mn[9]=mn[161]=0;yn[9]=yn[161]=0;vn[9]=vn[161]=0;_n[9]=_n[161]=-1;xn[9]=xn[161]=0;En[9]=En[161]=1;wn[9]=wn[161]=0;Sn[9]=Sn[161]=0;In[9]=In[161]=1;Rn[9]=Rn[161]=0;Ln[9]=Ln[161]=1;gn[136]=0;mn[136]=1;yn[136]=1;vn[136]=0;_n[136]=1;xn[136]=0;Mn[136]=-1;bn[136]=0;An[136]=1;En[136]=-1;wn[136]=0;Sn[136]=0;In[136]=0;Rn[136]=-1;Ln[136]=0;Tn[136]=0;Cn[136]=-1;Pn[136]=1;ln[136]=1;cn[136]=0;fn[136]=0;hn[136]=1;pn[136]=0;dn[136]=1;gn[34]=0;mn[34]=-1;yn[34]=0;vn[34]=0;_n[34]=-1;xn[34]=1;Mn[34]=1;bn[34]=0;An[34]=0;En[34]=1;wn[34]=0;Sn[34]=1;In[34]=0;Rn[34]=1;Ln[34]=1;Tn[34]=0;Cn[34]=1;Pn[34]=0;ln[34]=-1;cn[34]=0;fn[34]=1;hn[34]=-1;pn[34]=0;dn[34]=0;gn[35]=0;mn[35]=1;yn[35]=1;vn[35]=0;_n[35]=-1;xn[35]=1;Mn[35]=1;bn[35]=0;An[35]=0;En[35]=-1;wn[35]=0;Sn[35]=0;In[35]=0;Rn[35]=-1;Ln[35]=0;Tn[35]=0;Cn[35]=1;Pn[35]=0;ln[35]=-1;cn[35]=0;fn[35]=1;hn[35]=1;pn[35]=0;dn[35]=1;gn[153]=0;mn[153]=1;yn[153]=1;En[153]=-1;wn[153]=0;Sn[153]=0;In[153]=0;Rn[153]=-1;Ln[153]=0;hn[153]=1;pn[153]=0;dn[153]=1;vn[102]=0;_n[102]=-1;xn[102]=1;Mn[102]=1;bn[102]=0;An[102]=0;Tn[102]=0;Cn[102]=1;Pn[102]=0;ln[102]=-1;cn[102]=0;fn[102]=1;gn[155]=0;mn[155]=-1;yn[155]=0;En[155]=1;wn[155]=0;Sn[155]=1;In[155]=0;Rn[155]=1;Ln[155]=1;hn[155]=-1;pn[155]=0;dn[155]=0;vn[103]=0;_n[103]=1;xn[103]=0;Mn[103]=-1;bn[103]=0;An[103]=1;Tn[103]=0;Cn[103]=-1;Pn[103]=1;ln[103]=1;cn[103]=0;fn[103]=0;gn[152]=0;mn[152]=1;yn[152]=1;Mn[152]=-1;bn[152]=0;An[152]=1;En[152]=-1;wn[152]=0;Sn[152]=0;In[152]=0;Rn[152]=-1;Ln[152]=0;Tn[152]=0;Cn[152]=-1;Pn[152]=1;hn[152]=1;pn[152]=0;dn[152]=1;gn[156]=0;mn[156]=-1;yn[156]=1;Mn[156]=1;bn[156]=0;An[156]=1;En[156]=-1;wn[156]=0;Sn[156]=0;In[156]=0;Rn[156]=-1;Ln[156]=0;Tn[156]=0;Cn[156]=1;Pn[156]=1;hn[156]=-1;pn[156]=0;dn[156]=1;gn[137]=0;mn[137]=1;yn[137]=1;vn[137]=0;_n[137]=1;xn[137]=0;En[137]=-1;wn[137]=0;Sn[137]=0;In[137]=0;Rn[137]=-1;Ln[137]=0;ln[137]=1;cn[137]=0;fn[137]=0;hn[137]=1;pn[137]=0;dn[137]=1;gn[139]=0;mn[139]=1;yn[139]=1;vn[139]=0;_n[139]=-1;xn[139]=0;En[139]=1;wn[139]=0;Sn[139]=0;In[139]=0;Rn[139]=1;Ln[139]=0;ln[139]=-1;cn[139]=0;fn[139]=0;hn[139]=1;pn[139]=0;dn[139]=1;gn[98]=0;mn[98]=-1;yn[98]=0;vn[98]=0;_n[98]=-1;xn[98]=1;Mn[98]=1;bn[98]=0;An[98]=0;En[98]=1;wn[98]=0;Sn[98]=1;Tn[98]=0;Cn[98]=1;Pn[98]=0;ln[98]=-1;cn[98]=0;fn[98]=1;gn[99]=0;mn[99]=1;yn[99]=0;vn[99]=0;_n[99]=-1;xn[99]=1;Mn[99]=1;bn[99]=0;An[99]=0;En[99]=-1;wn[99]=0;Sn[99]=1;Tn[99]=0;Cn[99]=-1;Pn[99]=0;ln[99]=1;cn[99]=0;fn[99]=1;vn[38]=0;_n[38]=-1;xn[38]=1;Mn[38]=1;bn[38]=0;An[38]=0;In[38]=0;Rn[38]=1;Ln[38]=1;Tn[38]=0;Cn[38]=1;Pn[38]=0;ln[38]=-1;cn[38]=0;fn[38]=1;hn[38]=-1;pn[38]=0;dn[38]=0;vn[39]=0;_n[39]=1;xn[39]=1;Mn[39]=-1;bn[39]=0;An[39]=0;In[39]=0;Rn[39]=-1;Ln[39]=1;Tn[39]=0;Cn[39]=1;Pn[39]=0;ln[39]=-1;cn[39]=0;fn[39]=1;hn[39]=1;pn[39]=0;dn[39]=0;var K_=function(n){return[[n.bottomleft,0],[0,0],[0,n.leftbottom]]},j_=function(n){return[[1,n.rightbottom],[1,0],[n.bottomright,0]]},Q_=function(n){return[[n.topright,1],[1,1],[1,n.righttop]]},t1=function(n){return[[0,n.lefttop],[0,1],[n.topleft,1]]},e1=function(n){return[[n.bottomright,0],[n.bottomleft,0],[0,n.leftbottom],[0,n.lefttop]]},n1=function(n){return[[n.bottomright,0],[n.bottomleft,0],[1,n.righttop],[1,n.rightbottom]]},r1=function(n){return[[1,n.righttop],[1,n.rightbottom],[n.topleft,1],[n.topright,1]]},i1=function(n){return[[0,n.leftbottom],[0,n.lefttop],[n.topleft,1],[n.topright,1]]},oZ=function(n){return[[0,0],[0,n.leftbottom],[1,n.rightbottom],[1,0]]},sZ=function(n){return[[1,0],[n.bottomright,0],[n.topright,1],[1,1]]},aZ=function(n){return[[1,1],[1,n.righttop],[0,n.lefttop],[0,1]]},uZ=function(n){return[[n.bottomleft,0],[0,0],[0,1],[n.topleft,1]]},lZ=function(n){return[[1,n.righttop],[1,n.rightbottom],[0,n.leftbottom],[0,n.lefttop]]},cZ=function(n){return[[n.topleft,1],[n.topright,1],[n.bottomright,0],[n.bottomleft,0]]},fZ=function(){return[[0,0],[0,1],[1,1],[1,0]]},hZ=function(n){return[[1,n.rightbottom],[1,0],[0,0],[0,1],[n.topleft,1]]},pZ=function(n){return[[n.topright,1],[1,1],[1,0],[0,0],[0,n.leftbottom]]},dZ=function(n){return[[1,0],[n.bottomright,0],[0,n.lefttop],[0,1],[1,1]]},gZ=function(n){return[[1,1],[1,n.righttop],[n.bottomleft,0],[0,0],[0,1]]},mZ=function(n){return[[1,n.righttop],[1,n.rightbottom],[0,n.lefttop],[0,1],[n.topleft,1]]},yZ=function(n){return[[1,1],[1,n.righttop],[n.bottomright,0],[n.bottomleft,0],[n.topright,1]]},vZ=function(n){return[[1,n.rightbottom],[1,0],[n.bottomright,0],[0,n.leftbottom],[0,n.lefttop]]},_Z=function(n){return[[n.topright,1],[n.bottomleft,0],[0,0],[0,n.leftbottom],[n.topleft,1]]},xZ=function(n){return[[n.bottomright,0],[n.bottomleft,0],[0,n.lefttop],[0,1],[n.topleft,1]]},EZ=function(n){return[[1,1],[1,n.righttop],[0,n.leftbottom],[0,n.lefttop],[n.topright,1]]},wZ=function(n){return[[1,n.rightbottom],[1,0],[n.bottomright,0],[n.topleft,1],[n.topright,1]]},SZ=function(n){return[[1,n.righttop],[1,n.rightbottom],[n.bottomleft,0],[0,0],[0,n.leftbottom]]},MZ=function(n){return[[1,n.rightbottom],[1,0],[0,0],[0,n.leftbottom],[n.topleft,1],[n.topright,1]]},bZ=function(n){return[[1,1],[1,0],[n.bottomright,0],[0,n.leftbottom],[0,n.lefttop],[n.topright,1]]},AZ=function(n){return[[1,1],[1,n.righttop],[n.bottomright,0],[n.bottomleft,0],[0,n.lefttop],[0,1]]},TZ=function(n){return[[1,n.righttop],[1,n.rightbottom],[n.bottomleft,0],[0,0],[0,1],[n.topleft,1]]},CZ=function(n){return[[1,1],[1,n.righttop],[n.bottomleft,0],[0,0],[0,n.leftbottom],[n.topright,1]]},PZ=function(n){return[[1,n.rightbottom],[1,0],[n.bottomright,0],[0,n.lefttop],[0,1],[n.topleft,1]]},IZ=function(n){return[[1,n.righttop],[1,n.rightbottom],[n.bottomright,0],[n.bottomleft,0],[0,n.leftbottom],[0,n.lefttop],[n.topleft,1],[n.topright,1]]},RZ=function(n){return[[1,1],[1,n.righttop],[n.bottomleft,0],[0,0],[0,n.leftbottom],[n.topright,1]]},LZ=function(n){return[[1,n.rightbottom],[1,0],[n.bottomright,0],[0,n.lefttop],[0,1],[n.topleft,1]]},NZ=function(n){return[[1,1],[1,n.righttop],[n.bottomright,0],[n.bottomleft,0],[0,n.leftbottom],[0,n.lefttop],[n.topright,1]]},OZ=function(n){return[[1,n.righttop],[1,n.rightbottom],[n.bottomleft,0],[0,0],[0,n.leftbottom],[n.topleft,1],[n.topright,1]]},DZ=function(n){return[[1,n.righttop],[1,n.rightbottom],[n.bottomright,0],[n.bottomleft,0],[0,n.lefttop],[0,1],[n.topleft,1]]},FZ=function(n){return[[1,n.rightbottom],[1,0],[n.bottomright,0],[0,n.leftbottom],[0,n.lefttop],[n.topleft,1],[n.topright,1]]},Bn=[],zn=[],Gn=[],kn=[],qn=[],Hn=[],Vn=[],Wn=[];kn[1]=qn[1]=18;kn[169]=qn[169]=18;Gn[4]=zn[4]=12;Gn[166]=zn[166]=12;Bn[16]=Wn[16]=4;Bn[154]=Wn[154]=4;Hn[64]=Vn[64]=22;Hn[106]=Vn[106]=22;Gn[2]=Hn[2]=17;kn[2]=qn[2]=18;Gn[168]=Hn[168]=17;kn[168]=qn[168]=18;Bn[8]=kn[8]=9;zn[8]=Gn[8]=12;Bn[162]=kn[162]=9;zn[162]=Gn[162]=12;Bn[32]=Wn[32]=4;zn[32]=Vn[32]=1;Bn[138]=Wn[138]=4;zn[138]=Vn[138]=1;qn[128]=Wn[128]=21;Hn[128]=Vn[128]=22;qn[42]=Wn[42]=21;Hn[42]=Vn[42]=22;zn[5]=qn[5]=14;zn[165]=qn[165]=14;Gn[20]=Wn[20]=6;Gn[150]=Wn[150]=6;Bn[80]=Hn[80]=11;Bn[90]=Hn[90]=11;kn[65]=Vn[65]=3;kn[105]=Vn[105]=3;Bn[160]=Hn[160]=11;zn[160]=qn[160]=14;Bn[10]=Hn[10]=11;zn[10]=qn[10]=14;Gn[130]=Wn[130]=6;kn[130]=Vn[130]=3;Gn[40]=Wn[40]=6;kn[40]=Vn[40]=3;zn[101]=Vn[101]=1;zn[69]=Vn[69]=1;qn[149]=Wn[149]=21;qn[21]=Wn[21]=21;Gn[86]=Hn[86]=17;Gn[84]=Hn[84]=17;Bn[89]=kn[89]=9;Bn[81]=kn[81]=9;Bn[96]=Vn[96]=0;zn[96]=Hn[96]=15;Bn[74]=Vn[74]=0;zn[74]=Hn[74]=15;Bn[24]=Gn[24]=8;kn[24]=Wn[24]=7;Bn[146]=Gn[146]=8;kn[146]=Wn[146]=7;zn[6]=Hn[6]=15;Gn[6]=qn[6]=16;zn[164]=Hn[164]=15;Gn[164]=qn[164]=16;kn[129]=Wn[129]=7;qn[129]=Vn[129]=20;kn[41]=Wn[41]=7;qn[41]=Vn[41]=20;Gn[66]=Vn[66]=2;kn[66]=Hn[66]=19;Gn[104]=Vn[104]=2;kn[104]=Hn[104]=19;Bn[144]=qn[144]=10;Hn[144]=Wn[144]=23;Bn[26]=qn[26]=10;Hn[26]=Wn[26]=23;zn[36]=Wn[36]=5;Gn[36]=Vn[36]=2;zn[134]=Wn[134]=5;Gn[134]=Vn[134]=2;Bn[9]=qn[9]=10;zn[9]=kn[9]=13;Bn[161]=qn[161]=10;zn[161]=kn[161]=13;zn[37]=Wn[37]=5;qn[37]=Vn[37]=20;zn[133]=Wn[133]=5;qn[133]=Vn[133]=20;Gn[148]=qn[148]=16;Hn[148]=Wn[148]=23;Gn[22]=qn[22]=16;Hn[22]=Wn[22]=23;Bn[82]=Gn[82]=8;kn[82]=Hn[82]=19;Bn[88]=Gn[88]=8;kn[88]=Hn[88]=19;Bn[73]=Vn[73]=0;zn[73]=kn[73]=13;Bn[97]=Vn[97]=0;zn[97]=kn[97]=13;Bn[145]=kn[145]=9;qn[145]=Wn[145]=21;Bn[25]=kn[25]=9;qn[25]=Wn[25]=21;zn[70]=Vn[70]=1;Gn[70]=Hn[70]=17;zn[100]=Vn[100]=1;Gn[100]=Hn[100]=17;Bn[34]=kn[34]=9;zn[34]=Gn[34]=12;qn[34]=Wn[34]=21;Hn[34]=Vn[34]=22;Bn[136]=Wn[136]=4;zn[136]=Vn[136]=1;Gn[136]=Hn[136]=17;kn[136]=qn[136]=18;Bn[35]=Wn[35]=4;zn[35]=Gn[35]=12;kn[35]=qn[35]=18;Hn[35]=Vn[35]=22;Bn[153]=Wn[153]=4;kn[153]=qn[153]=18;zn[102]=Gn[102]=12;Hn[102]=Vn[102]=22;Bn[155]=kn[155]=9;qn[155]=Wn[155]=23;zn[103]=Vn[103]=1;Gn[103]=Hn[103]=17;Bn[152]=Wn[152]=4;Gn[152]=Hn[152]=17;kn[152]=qn[152]=18;Bn[156]=Gn[156]=8;kn[156]=qn[156]=18;Hn[156]=Wn[156]=23;Bn[137]=Wn[137]=4;zn[137]=Vn[137]=1;kn[137]=qn[137]=18;Bn[139]=Wn[139]=4;zn[139]=kn[139]=13;qn[139]=Vn[139]=20;Bn[98]=kn[98]=9;zn[98]=Gn[98]=12;Hn[98]=Vn[98]=22;Bn[99]=Vn[99]=0;zn[99]=Gn[99]=12;kn[99]=Hn[99]=19;zn[38]=Gn[38]=12;qn[38]=Wn[38]=21;Hn[38]=Vn[38]=22;zn[39]=Wn[39]=5;Gn[39]=qn[39]=16;Hn[39]=Vn[39]=22;var re=[];re[1]=re[169]=K_;re[4]=re[166]=j_;re[16]=re[154]=Q_;re[64]=re[106]=t1;re[168]=re[2]=e1;re[162]=re[8]=n1;re[138]=re[32]=r1;re[42]=re[128]=i1;re[5]=re[165]=oZ;re[20]=re[150]=sZ;re[80]=re[90]=aZ;re[65]=re[105]=uZ;re[160]=re[10]=lZ;re[130]=re[40]=cZ;re[85]=fZ;re[101]=re[69]=hZ;re[149]=re[21]=pZ;re[86]=re[84]=dZ;re[89]=re[81]=gZ;re[96]=re[74]=mZ;re[24]=re[146]=yZ;re[6]=re[164]=vZ;re[129]=re[41]=_Z;re[66]=re[104]=xZ;re[144]=re[26]=EZ;re[36]=re[134]=wZ;re[9]=re[161]=SZ;re[37]=re[133]=MZ;re[148]=re[22]=bZ;re[82]=re[88]=AZ;re[73]=re[97]=TZ;re[145]=re[25]=CZ;re[70]=re[100]=PZ;re[34]=function(n){return[i1(n),n1(n)]};re[35]=IZ;re[136]=function(n){return[r1(n),e1(n)]};re[153]=function(n){return[Q_(n),K_(n)]};re[102]=function(n){return[j_(n),t1(n)]};re[155]=RZ;re[103]=LZ;re[152]=function(n){return[Q_(n),e1(n)]};re[156]=NZ;re[137]=function(n){return[r1(n),K_(n)]};re[139]=OZ;re[98]=function(n){return[n1(n),t1(n)]};re[99]=DZ;re[38]=function(n){return[j_(n),i1(n)]};re[39]=FZ;function BZ(n){return(n>0)-(n<0)||+n}function ff(n,t,e){var o=t[0]-n[0],s=t[1]-n[1],l=e[0]-t[0],p=e[1]-t[1];return BZ(o*p-l*s)}function dL(n,t){var e=n.geometry.coordinates[0].map(function(p){return p[0]}),o=n.geometry.coordinates[0].map(function(p){return p[1]}),s=t.geometry.coordinates[0].map(function(p){return p[0]}),l=t.geometry.coordinates[0].map(function(p){return p[1]});return Math.max.apply(null,e)===Math.max.apply(null,s)&&Math.max.apply(null,o)===Math.max.apply(null,l)&&Math.min.apply(null,e)===Math.min.apply(null,s)&&Math.min.apply(null,o)===Math.min.apply(null,l)}function o1(n,t){return t.geometry.coordinates[0].every(function(e){return ki(Pr(e),n)})}function gL(n,t){return n[0]===t[0]&&n[1]===t[1]}var zZ=function(){function n(t){this.id=n.buildId(t),this.coordinates=t,this.innerEdges=[],this.outerEdges=[],this.outerEdgesSorted=!1}return n.buildId=function(t){return t.join(",")},n.prototype.removeInnerEdge=function(t){this.innerEdges=this.innerEdges.filter(function(e){return e.from.id!==t.from.id})},n.prototype.removeOuterEdge=function(t){this.outerEdges=this.outerEdges.filter(function(e){return e.to.id!==t.to.id})},n.prototype.addOuterEdge=function(t){this.outerEdges.push(t),this.outerEdgesSorted=!1},n.prototype.sortOuterEdges=function(){var t=this;this.outerEdgesSorted||(this.outerEdges.sort(function(e,o){var s=e.to,l=o.to;if(s.coordinates[0]-t.coordinates[0]>=0&&l.coordinates[0]-t.coordinates[0]<0)return 1;if(s.coordinates[0]-t.coordinates[0]<0&&l.coordinates[0]-t.coordinates[0]>=0)return-1;if(s.coordinates[0]-t.coordinates[0]===0&&l.coordinates[0]-t.coordinates[0]===0)return s.coordinates[1]-t.coordinates[1]>=0||l.coordinates[1]-t.coordinates[1]>=0?s.coordinates[1]-l.coordinates[1]:l.coordinates[1]-s.coordinates[1];var p=ff(t.coordinates,s.coordinates,l.coordinates);if(p<0)return 1;if(p>0)return-1;var h=Math.pow(s.coordinates[0]-t.coordinates[0],2)+Math.pow(s.coordinates[1]-t.coordinates[1],2),g=Math.pow(l.coordinates[0]-t.coordinates[0],2)+Math.pow(l.coordinates[1]-t.coordinates[1],2);return h-g}),this.outerEdgesSorted=!0)},n.prototype.getOuterEdges=function(){return this.sortOuterEdges(),this.outerEdges},n.prototype.getOuterEdge=function(t){return this.sortOuterEdges(),this.outerEdges[t]},n.prototype.addInnerEdge=function(t){this.innerEdges.push(t)},n}(),s1=zZ;var GZ=function(){function n(t,e){this.from=t,this.to=e,this.next=void 0,this.label=void 0,this.symetric=void 0,this.ring=void 0,this.from.addOuterEdge(this),this.to.addInnerEdge(this)}return n.prototype.getSymetric=function(){return this.symetric||(this.symetric=new n(this.to,this.from),this.symetric.symetric=this),this.symetric},n.prototype.deleteEdge=function(){this.from.removeOuterEdge(this),this.to.removeInnerEdge(this)},n.prototype.isEqual=function(t){return this.from.id===t.from.id&&this.to.id===t.to.id},n.prototype.toString=function(){return"Edge { "+this.from.id+" -> "+this.to.id+" }"},n.prototype.toLineString=function(){return Gi([this.from.coordinates,this.to.coordinates])},n.prototype.compareTo=function(t){return ff(t.from.coordinates,t.to.coordinates,this.to.coordinates)},n}(),mL=GZ;var kZ=function(){function n(){this.edges=[],this.polygon=void 0,this.envelope=void 0}return n.prototype.push=function(t){this.edges.push(t),this.polygon=this.envelope=void 0},n.prototype.get=function(t){return this.edges[t]},Object.defineProperty(n.prototype,"length",{get:function(){return this.edges.length},enumerable:!0,configurable:!0}),n.prototype.forEach=function(t){this.edges.forEach(t)},n.prototype.map=function(t){return this.edges.map(t)},n.prototype.some=function(t){return this.edges.some(t)},n.prototype.isValid=function(){return!0},n.prototype.isHole=function(){var t=this,e=this.edges.reduce(function(p,h,g){return h.from.coordinates[1]>t.edges[p].from.coordinates[1]&&(p=g),p},0),o=(e===0?this.length:e)-1,s=(e+1)%this.length,l=ff(this.edges[o].from.coordinates,this.edges[e].from.coordinates,this.edges[s].from.coordinates);return l===0?this.edges[o].from.coordinates[0]>this.edges[s].from.coordinates[0]:l>0},n.prototype.toMultiPoint=function(){return Uv(this.edges.map(function(t){return t.from.coordinates}))},n.prototype.toPolygon=function(){if(this.polygon)return this.polygon;var t=this.edges.map(function(e){return e.from.coordinates});return t.push(this.edges[0].from.coordinates),this.polygon=Dr([t])},n.prototype.getEnvelope=function(){return this.envelope?this.envelope:this.envelope=n_(this.toPolygon())},n.findEdgeRingContaining=function(t,e){var o=t.getEnvelope(),s,l;return e.forEach(function(p){var h=p.getEnvelope();if(l&&(s=l.getEnvelope()),!dL(h,o)&&o1(h,o)){for(var g=t.map(function(A){return A.from.coordinates}),m=void 0,v=function(A){p.some(function(I){return gL(A,I.from.coordinates)})||(m=A)},x=0,E=g;x<E.length;x++){var M=E[x];v(M)}m&&p.inside(Pr(m))&&(!l||o1(s,h))&&(l=p)}}),l},n.prototype.inside=function(t){return ki(t,this.toPolygon())},n}(),a1=kZ;function qZ(n){if(!n)throw new Error("No geojson passed");if(n.type!=="FeatureCollection"&&n.type!=="GeometryCollection"&&n.type!=="MultiLineString"&&n.type!=="LineString"&&n.type!=="Feature")throw new Error("Invalid input type '"+n.type+"'. Geojson must be FeatureCollection, GeometryCollection, LineString, MultiLineString or Feature")}var lct=function(){function n(){this.edges=[],this.nodes={}}return n.fromGeoJson=function(t){qZ(t);var e=new n;return ys(t,function(o){zv(o,"LineString","Graph::fromGeoJson"),TC(o,function(s,l){if(s){var p=e.getNode(s),h=e.getNode(l);e.addEdge(p,h)}return l})}),e},n.prototype.getNode=function(t){var e=s1.buildId(t),o=this.nodes[e];return o||(o=this.nodes[e]=new s1(t)),o},n.prototype.addEdge=function(t,e){var o=new mL(t,e),s=o.getSymetric();this.edges.push(o),this.edges.push(s)},n.prototype.deleteDangles=function(){var t=this;Object.keys(this.nodes).map(function(e){return t.nodes[e]}).forEach(function(e){return t._removeIfDangle(e)})},n.prototype._removeIfDangle=function(t){var e=this;if(t.innerEdges.length<=1){var o=t.getOuterEdges().map(function(s){return s.to});this.removeNode(t),o.forEach(function(s){return e._removeIfDangle(s)})}},n.prototype.deleteCutEdges=function(){var t=this;this._computeNextCWEdges(),this._findLabeledEdgeRings(),this.edges.forEach(function(e){e.label===e.symetric.label&&(t.removeEdge(e.symetric),t.removeEdge(e))})},n.prototype._computeNextCWEdges=function(t){var e=this;typeof t=="undefined"?Object.keys(this.nodes).forEach(function(o){return e._computeNextCWEdges(e.nodes[o])}):t.getOuterEdges().forEach(function(o,s){t.getOuterEdge((s===0?t.getOuterEdges().length:s)-1).symetric.next=o})},n.prototype._computeNextCCWEdges=function(t,e){for(var o=t.getOuterEdges(),s,l,p=o.length-1;p>=0;--p){var h=o[p],g=h.symetric,m=void 0,v=void 0;h.label===e&&(m=h),g.label===e&&(v=g),!(!m||!v)&&(v&&(l=v),m&&(l&&(l.next=m,l=void 0),s||(s=m)))}l&&(l.next=s)},n.prototype._findLabeledEdgeRings=function(){var t=[],e=0;return this.edges.forEach(function(o){if(!(o.label>=0)){t.push(o);var s=o;do s.label=e,s=s.next;while(!o.isEqual(s));e++}}),t},n.prototype.getEdgeRings=function(){var t=this;this._computeNextCWEdges(),this.edges.forEach(function(o){o.label=void 0}),this._findLabeledEdgeRings().forEach(function(o){t._findIntersectionNodes(o).forEach(function(s){t._computeNextCCWEdges(s,o.label)})});var e=[];return this.edges.forEach(function(o){o.ring||e.push(t._findEdgeRing(o))}),e},n.prototype._findIntersectionNodes=function(t){var e=[],o=t,s=function(){var l=0;o.from.getOuterEdges().forEach(function(p){p.label===t.label&&++l}),l>1&&e.push(o.from),o=o.next};do s();while(!t.isEqual(o));return e},n.prototype._findEdgeRing=function(t){var e=t,o=new a1;do o.push(e),e.ring=o,e=e.next;while(!t.isEqual(e));return o},n.prototype.removeNode=function(t){var e=this;t.getOuterEdges().forEach(function(o){return e.removeEdge(o)}),t.innerEdges.forEach(function(o){return e.removeEdge(o)}),delete this.nodes[t.id]},n.prototype.removeEdge=function(t){this.edges=this.edges.filter(function(e){return!e.isEqual(t)}),t.deleteEdge()},n}();var XZ=sn(u1(),1);var YZ=sn(u1(),1);var ZZ=sn(bL(),1);var nJ=sn(DL(),1);function UL(n){for(var t=n,e=[];t.parent;)e.unshift(t),t=t.parent;return e}function iJ(){return new BL(function(n){return n.f})}var h1={search:function(n,t,e,o){n.cleanDirty(),o=o||{};var s=o.heuristic||h1.heuristics.manhattan,l=o.closest||!1,p=iJ(),h=t;for(t.h=s(t,e),p.push(t);p.size()>0;){var g=p.pop();if(g===e)return UL(g);g.closed=!0;for(var m=n.neighbors(g),v=0,x=m.length;v<x;++v){var E=m[v];if(!(E.closed||E.isWall())){var M=g.g+E.getCost(g),A=E.visited;(!A||M<E.g)&&(E.visited=!0,E.parent=g,E.h=E.h||s(E,e),E.g=M,E.f=E.g+E.h,n.markDirty(E),l&&(E.h<h.h||E.h===h.h&&E.g<h.g)&&(h=E),A?p.rescoreElement(E):p.push(E))}}}return l?UL(h):[]},heuristics:{manhattan:function(n,t){var e=Math.abs(t.x-n.x),o=Math.abs(t.y-n.y);return e+o},diagonal:function(n,t){var e=1,o=Math.sqrt(2),s=Math.abs(t.x-n.x),l=Math.abs(t.y-n.y);return e*(s+l)+(o-2*e)*Math.min(s,l)}},cleanNode:function(n){n.f=0,n.g=0,n.h=0,n.visited=!1,n.closed=!1,n.parent=null}};function Ih(n,t){t=t||{},this.nodes=[],this.diagonal=!!t.diagonal,this.grid=[];for(var e=0;e<n.length;e++){this.grid[e]=[];for(var o=0,s=n[e];o<s.length;o++){var l=new Fg(e,o,s[o]);this.grid[e][o]=l,this.nodes.push(l)}}this.init()}Ih.prototype.init=function(){this.dirtyNodes=[];for(var n=0;n<this.nodes.length;n++)h1.cleanNode(this.nodes[n])};Ih.prototype.cleanDirty=function(){for(var n=0;n<this.dirtyNodes.length;n++)h1.cleanNode(this.dirtyNodes[n]);this.dirtyNodes=[]};Ih.prototype.markDirty=function(n){this.dirtyNodes.push(n)};Ih.prototype.neighbors=function(n){var t=[],e=n.x,o=n.y,s=this.grid;return s[e-1]&&s[e-1][o]&&t.push(s[e-1][o]),s[e+1]&&s[e+1][o]&&t.push(s[e+1][o]),s[e]&&s[e][o-1]&&t.push(s[e][o-1]),s[e]&&s[e][o+1]&&t.push(s[e][o+1]),this.diagonal&&(s[e-1]&&s[e-1][o-1]&&t.push(s[e-1][o-1]),s[e+1]&&s[e+1][o-1]&&t.push(s[e+1][o-1]),s[e-1]&&s[e-1][o+1]&&t.push(s[e-1][o+1]),s[e+1]&&s[e+1][o+1]&&t.push(s[e+1][o+1])),t};Ih.prototype.toString=function(){for(var n=[],t=this.grid,e,o,s,l,p=0,h=t.length;p<h;p++){for(e=[],o=t[p],s=0,l=o.length;s<l;s++)e.push(o[s].weight);n.push(e.join(" "))}return n.join(\`
|
|
23578
23578
|
\`)};function Fg(n,t,e){this.x=n,this.y=t,this.weight=e}Fg.prototype.toString=function(){return"["+this.x+" "+this.y+"]"};Fg.prototype.getCost=function(n){return n&&n.x!==this.x&&n.y!==this.y?this.weight*1.41421:this.weight};Fg.prototype.isWall=function(){return this.weight===0};function BL(n){this.content=[],this.scoreFunction=n}BL.prototype={push:function(n){this.content.push(n),this.sinkDown(this.content.length-1)},pop:function(){var n=this.content[0],t=this.content.pop();return this.content.length>0&&(this.content[0]=t,this.bubbleUp(0)),n},remove:function(n){var t=this.content.indexOf(n),e=this.content.pop();t!==this.content.length-1&&(this.content[t]=e,this.scoreFunction(e)<this.scoreFunction(n)?this.sinkDown(t):this.bubbleUp(t))},size:function(){return this.content.length},rescoreElement:function(n){this.sinkDown(this.content.indexOf(n))},sinkDown:function(n){for(var t=this.content[n];n>0;){var e=(n+1>>1)-1,o=this.content[e];if(this.scoreFunction(t)<this.scoreFunction(o))this.content[e]=t,this.content[n]=o,n=e;else break}},bubbleUp:function(n){for(var t=this.content.length,e=this.content[n],o=this.scoreFunction(e);;){var s=n+1<<1,l=s-1,p=null,h;if(l<t){var g=this.content[l];h=this.scoreFunction(g),h<o&&(p=l)}if(s<t){var m=this.content[s],v=this.scoreFunction(m);v<(p===null?o:h)&&(p=s)}if(p!==null)this.content[n]=this.content[p],this.content[p]=e,n=p;else break}}};function p1(){this._=null}function pf(n){n.U=n.C=n.L=n.R=n.P=n.N=null}p1.prototype={constructor:p1,insert:function(n,t){var e,o,s;if(n){if(t.P=n,t.N=n.N,n.N&&(n.N.P=t),n.N=t,n.R){for(n=n.R;n.L;)n=n.L;n.L=t}else n.R=t;e=n}else this._?(n=zL(this._),t.P=null,t.N=n,n.P=n.L=t,e=n):(t.P=t.N=null,this._=t,e=null);for(t.L=t.R=null,t.U=e,t.C=!0,n=t;e&&e.C;)o=e.U,e===o.L?(s=o.R,s&&s.C?(e.C=s.C=!1,o.C=!0,n=o):(n===e.R&&(Rh(this,e),n=e,e=n.U),e.C=!1,o.C=!0,Lh(this,o))):(s=o.L,s&&s.C?(e.C=s.C=!1,o.C=!0,n=o):(n===e.L&&(Lh(this,e),n=e,e=n.U),e.C=!1,o.C=!0,Rh(this,o))),e=n.U;this._.C=!1},remove:function(n){n.N&&(n.N.P=n.P),n.P&&(n.P.N=n.N),n.N=n.P=null;var t=n.U,e,o=n.L,s=n.R,l,p;if(o?s?l=zL(s):l=o:l=s,t?t.L===n?t.L=l:t.R=l:this._=l,o&&s?(p=l.C,l.C=n.C,l.L=o,o.U=l,l!==s?(t=l.U,l.U=n.U,n=l.R,t.L=n,l.R=s,s.U=l):(l.U=t,t=l,n=l.R)):(p=n.C,n=l),n&&(n.U=t),!p){if(n&&n.C){n.C=!1;return}do{if(n===this._)break;if(n===t.L){if(e=t.R,e.C&&(e.C=!1,t.C=!0,Rh(this,t),e=t.R),e.L&&e.L.C||e.R&&e.R.C){(!e.R||!e.R.C)&&(e.L.C=!1,e.C=!0,Lh(this,e),e=t.R),e.C=t.C,t.C=e.R.C=!1,Rh(this,t),n=this._;break}}else if(e=t.L,e.C&&(e.C=!1,t.C=!0,Lh(this,t),e=t.L),e.L&&e.L.C||e.R&&e.R.C){(!e.L||!e.L.C)&&(e.R.C=!1,e.C=!0,Rh(this,e),e=t.L),e.C=t.C,t.C=e.L.C=!1,Lh(this,t),n=this._;break}e.C=!0,n=t,t=t.U}while(!n.C);n&&(n.C=!1)}}};function Rh(n,t){var e=t,o=t.R,s=e.U;s?s.L===e?s.L=o:s.R=o:n._=o,o.U=s,e.U=o,e.R=o.L,e.R&&(e.R.U=e),o.L=e}function Lh(n,t){var e=t,o=t.L,s=e.U;s?s.L===e?s.L=o:s.R=o:n._=o,o.U=s,e.U=o,e.L=o.R,e.L&&(e.L.U=e),o.R=e}function zL(n){for(;n.L;)n=n.L;return n}var d1=p1;function df(n,t,e,o){var s=[null,null],l=Hi.push(s)-1;return s.left=n,s.right=t,e&&Nh(s,n,t,e),o&&Nh(s,t,n,o),To[n.index].halfedges.push(l),To[t.index].halfedges.push(l),s}function gf(n,t,e){var o=[t,e];return o.left=n,o}function Nh(n,t,e,o){!n[0]&&!n[1]?(n[0]=o,n.left=t,n.right=e):n.left===e?n[1]=o:n[0]=o}function oJ(n,t,e,o,s){var l=n[0],p=n[1],h=l[0],g=l[1],m=p[0],v=p[1],x=0,E=1,M=m-h,A=v-g,I;if(I=t-h,!(!M&&I>0)){if(I/=M,M<0){if(I<x)return;I<E&&(E=I)}else if(M>0){if(I>E)return;I>x&&(x=I)}if(I=o-h,!(!M&&I<0)){if(I/=M,M<0){if(I>E)return;I>x&&(x=I)}else if(M>0){if(I<x)return;I<E&&(E=I)}if(I=e-g,!(!A&&I>0)){if(I/=A,A<0){if(I<x)return;I<E&&(E=I)}else if(A>0){if(I>E)return;I>x&&(x=I)}if(I=s-g,!(!A&&I<0)){if(I/=A,A<0){if(I>E)return;I>x&&(x=I)}else if(A>0){if(I<x)return;I<E&&(E=I)}return!(x>0)&&!(E<1)||(x>0&&(n[0]=[h+x*M,g+x*A]),E<1&&(n[1]=[h+E*M,g+E*A])),!0}}}}}function sJ(n,t,e,o,s){var l=n[1];if(l)return!0;var p=n[0],h=n.left,g=n.right,m=h[0],v=h[1],x=g[0],E=g[1],M=(m+x)/2,A=(v+E)/2,I,S;if(E===v){if(M<t||M>=o)return;if(m>x){if(!p)p=[M,e];else if(p[1]>=s)return;l=[M,s]}else{if(!p)p=[M,s];else if(p[1]<e)return;l=[M,e]}}else if(I=(m-x)/(E-v),S=A-I*M,I<-1||I>1)if(m>x){if(!p)p=[(e-S)/I,e];else if(p[1]>=s)return;l=[(s-S)/I,s]}else{if(!p)p=[(s-S)/I,s];else if(p[1]<e)return;l=[(e-S)/I,e]}else if(v<E){if(!p)p=[t,I*t+S];else if(p[0]>=o)return;l=[o,I*o+S]}else{if(!p)p=[o,I*o+S];else if(p[0]<t)return;l=[t,I*t+S]}return n[0]=p,n[1]=l,!0}function GL(n,t,e,o){for(var s=Hi.length,l;s--;)(!sJ(l=Hi[s],n,t,e,o)||!oJ(l,n,t,e,o)||!(Math.abs(l[0][0]-l[1][0])>Er||Math.abs(l[0][1]-l[1][1])>Er))&&delete Hi[s]}function kL(n){return To[n.index]={site:n,halfedges:[]}}function aJ(n,t){var e=n.site,o=t.left,s=t.right;return e===s&&(s=o,o=e),s?Math.atan2(s[1]-o[1],s[0]-o[0]):(e===o?(o=t[1],s=t[0]):(o=t[0],s=t[1]),Math.atan2(o[0]-s[0],s[1]-o[1]))}function g1(n,t){return t[+(t.left!==n.site)]}function uJ(n,t){return t[+(t.left===n.site)]}function qL(){for(var n=0,t=To.length,e,o,s,l;n<t;++n)if((e=To[n])&&(l=(o=e.halfedges).length)){var p=new Array(l),h=new Array(l);for(s=0;s<l;++s)p[s]=s,h[s]=aJ(e,Hi[o[s]]);for(p.sort(function(g,m){return h[m]-h[g]}),s=0;s<l;++s)h[s]=o[p[s]];for(s=0;s<l;++s)o[s]=h[s]}}function HL(n,t,e,o){var s=To.length,l,p,h,g,m,v,x,E,M,A,I,S,w=!0;for(l=0;l<s;++l)if(p=To[l]){for(h=p.site,m=p.halfedges,g=m.length;g--;)Hi[m[g]]||m.splice(g,1);for(g=0,v=m.length;g<v;)A=uJ(p,Hi[m[g]]),I=A[0],S=A[1],x=g1(p,Hi[m[++g%v]]),E=x[0],M=x[1],(Math.abs(I-E)>Er||Math.abs(S-M)>Er)&&(m.splice(g,0,Hi.push(gf(h,A,Math.abs(I-n)<Er&&o-S>Er?[n,Math.abs(E-n)<Er?M:o]:Math.abs(S-o)<Er&&e-I>Er?[Math.abs(M-o)<Er?E:e,o]:Math.abs(I-e)<Er&&S-t>Er?[e,Math.abs(E-e)<Er?M:t]:Math.abs(S-t)<Er&&I-n>Er?[Math.abs(M-t)<Er?E:n,t]:null))-1),++v);v&&(w=!1)}if(w){var R,C,F,V=1/0;for(l=0,w=null;l<s;++l)(p=To[l])&&(h=p.site,R=h[0]-n,C=h[1]-t,F=R*R+C*C,F<V&&(V=F,w=p));if(w){var X=[n,t],q=[n,o],D=[e,o],xt=[e,t];w.halfedges.push(Hi.push(gf(h=w.site,X,q))-1,Hi.push(gf(h,q,D))-1,Hi.push(gf(h,D,xt))-1,Hi.push(gf(h,xt,X))-1)}}for(l=0;l<s;++l)(p=To[l])&&(p.halfedges.length||delete To[l])}var VL=[],Ug;function lJ(){pf(this),this.x=this.y=this.arc=this.site=this.cy=null}function Wl(n){var t=n.P,e=n.N;if(!(!t||!e)){var o=t.site,s=n.site,l=e.site;if(o!==l){var p=s[0],h=s[1],g=o[0]-p,m=o[1]-h,v=l[0]-p,x=l[1]-h,E=2*(g*x-m*v);if(!(E>=-WL)){var M=g*g+m*m,A=v*v+x*x,I=(x*M-m*A)/E,S=(g*A-v*M)/E,w=VL.pop()||new lJ;w.arc=n,w.site=s,w.x=I+p,w.y=(w.cy=S+h)+Math.sqrt(I*I+S*S),n.circle=w;for(var R=null,C=mf._;C;)if(w.y<C.y||w.y===C.y&&w.x<=C.x)if(C.L)C=C.L;else{R=C.P;break}else if(C.R)C=C.R;else{R=C;break}mf.insert(R,w),R||(Ug=w)}}}}function Xl(n){var t=n.circle;t&&(t.P||(Ug=t.N),mf.remove(t),VL.push(t),pf(t),n.circle=null)}var YL=[];function cJ(){pf(this),this.edge=this.site=this.circle=null}function XL(n){var t=YL.pop()||new cJ;return t.site=n,t}function m1(n){Xl(n),Yl.remove(n),YL.push(n),pf(n)}function $L(n){var t=n.circle,e=t.x,o=t.cy,s=[e,o],l=n.P,p=n.N,h=[n];m1(n);for(var g=l;g.circle&&Math.abs(e-g.circle.x)<Er&&Math.abs(o-g.circle.cy)<Er;)l=g.P,h.unshift(g),m1(g),g=l;h.unshift(g),Xl(g);for(var m=p;m.circle&&Math.abs(e-m.circle.x)<Er&&Math.abs(o-m.circle.cy)<Er;)p=m.N,h.push(m),m1(m),m=p;h.push(m),Xl(m);var v=h.length,x;for(x=1;x<v;++x)m=h[x],g=h[x-1],Nh(m.edge,g.site,m.site,s);g=h[0],m=h[v-1],m.edge=df(g.site,m.site,null,s),Wl(g),Wl(m)}function ZL(n){for(var t=n[0],e=n[1],o,s,l,p,h=Yl._;h;)if(l=JL(h,e)-t,l>Er)h=h.L;else if(p=t-fJ(h,e),p>Er){if(!h.R){o=h;break}h=h.R}else{l>-Er?(o=h.P,s=h):p>-Er?(o=h,s=h.N):o=s=h;break}kL(n);var g=XL(n);if(Yl.insert(o,g),!(!o&&!s)){if(o===s){Xl(o),s=XL(o.site),Yl.insert(g,s),g.edge=s.edge=df(o.site,g.site),Wl(o),Wl(s);return}if(!s){g.edge=df(o.site,g.site);return}Xl(o),Xl(s);var m=o.site,v=m[0],x=m[1],E=n[0]-v,M=n[1]-x,A=s.site,I=A[0]-v,S=A[1]-x,w=2*(E*S-M*I),R=E*E+M*M,C=I*I+S*S,F=[(S*R-M*C)/w+v,(E*C-I*R)/w+x];Nh(s.edge,m,A,F),g.edge=df(m,n,null,F),s.edge=df(n,A,null,F),Wl(o),Wl(s)}}function JL(n,t){var e=n.site,o=e[0],s=e[1],l=s-t;if(!l)return o;var p=n.P;if(!p)return-1/0;e=p.site;var h=e[0],g=e[1],m=g-t;if(!m)return h;var v=h-o,x=1/l-1/m,E=v/m;return x?(-E+Math.sqrt(E*E-2*x*(v*v/(-2*m)-g+m/2+s-l/2)))/x+o:(o+h)/2}function fJ(n,t){var e=n.N;if(e)return JL(e,t);var o=n.site;return o[1]===t?o[0]:1/0}var Er=1e-6,WL=1e-12,Yl,To,mf,Hi;function hJ(n,t,e){return(n[0]-e[0])*(t[1]-n[1])-(n[0]-t[0])*(e[1]-n[1])}function pJ(n,t){return t[1]-n[1]||t[0]-n[0]}function Bg(n,t){var e=n.sort(pJ).pop(),o,s,l;for(Hi=[],To=new Array(n.length),Yl=new d1,mf=new d1;;)if(l=Ug,e&&(!l||e[1]<l.y||e[1]===l.y&&e[0]<l.x))(e[0]!==o||e[1]!==s)&&(ZL(e),o=e[0],s=e[1]),e=n.pop();else if(l)$L(l.arc);else break;if(qL(),t){var p=+t[0][0],h=+t[0][1],g=+t[1][0],m=+t[1][1];GL(p,h,g,m),HL(p,h,g,m)}this.edges=Hi,this.cells=To,Yl=mf=Hi=To=null}Bg.prototype={constructor:Bg,polygons:function(){var n=this.edges;return this.cells.map(function(t){var e=t.halfedges.map(function(o){return g1(t,n[o])});return e.data=t.site.data,e})},triangles:function(){var n=[],t=this.edges;return this.cells.forEach(function(e,o){if(h=(l=e.halfedges).length)for(var s=e.site,l,p=-1,h,g,m=t[l[h-1]],v=m.left===s?m.right:m.left;++p<h;)g=v,m=t[l[p]],v=m.left===s?m.right:m.left,g&&v&&o<g.index&&o<v.index&&hJ(s,g,v)<0&&n.push([s.data,g.data,v.data])}),n},links:function(){return this.edges.filter(function(n){return n.right}).map(function(n){return{source:n.left.data,target:n.right.data}})},find:function(n,t,e){for(var o=this,s,l=o._found||0,p=o.cells.length,h;!(h=o.cells[l]);)if(++l>=p)return null;var g=n-h.site[0],m=t-h.site[1],v=g*g+m*m;do h=o.cells[s=l],l=null,h.halfedges.forEach(function(x){var E=o.edges[x],M=E.left;if(!((M===h.site||!M)&&!(M=E.right))){var A=n-M[0],I=t-M[1],S=A*A+I*I;S<v&&(v=S,l=M.index)}});while(l!==null);return o._found=s,e==null||v<=e*e?h.site:null}};var EJ=sn(yf(),1);var R1=sn(tN(),1);function Zo(){return new kg}function kg(){this.reset()}kg.prototype={constructor:kg,reset:function(){this.s=this.t=0},add:function(n){eN(Gg,n,this.t),eN(this,Gg.s,this.s),this.s?this.t+=Gg.t:this.s=Gg.t},valueOf:function(){return this.s}};var Gg=new kg;function eN(n,t,e){var o=n.s=t+e,s=o-t,l=o-s;n.t=t-l+(e-s)}var er=1e-6;var gr=Math.PI,Mi=gr/2,qg=gr/4,Da=gr*2,$l=180/gr,Jo=gr/180,Zr=Math.abs,aa=Math.atan,Ko=Math.atan2,Xn=Math.cos;var Hg=Math.exp;var Oh=Math.log;var an=Math.sin;var no=Math.sqrt,Dh=Math.tan;function _1(n){return n>1?0:n<-1?gr:Math.acos(n)}function Co(n){return n>1?Mi:n<-1?-Mi:Math.asin(n)}function ua(){}var wJ=Zo(),rpt=Zo();function Zl(n){var t=n[0],e=n[1],o=Xn(e);return[o*Xn(t),o*an(t),an(e)]}function Fh(n,t){return[n[1]*t[2]-n[2]*t[1],n[2]*t[0]-n[0]*t[2],n[0]*t[1]-n[1]*t[0]]}function Uh(n){var t=no(n[0]*n[0]+n[1]*n[1]+n[2]*n[2]);n[0]/=t,n[1]/=t,n[2]/=t}var ppt=Zo();function rN(n,t){return[n>gr?n-Da:n<-gr?n+Da:n,t]}rN.invert=rN;function x1(){var n=[],t;return{point:function(e,o){t.push([e,o])},lineStart:function(){n.push(t=[])},lineEnd:ua,rejoin:function(){n.length>1&&n.push(n.pop().concat(n.shift()))},result:function(){var e=n;return n=[],t=null,e}}}function E1(n,t){return Zr(n[0]-t[0])<er&&Zr(n[1]-t[1])<er}function Vg(n,t,e,o){this.x=n,this.z=t,this.o=e,this.e=o,this.v=!1,this.n=this.p=null}function w1(n,t,e,o,s){var l=[],p=[],h,g;if(n.forEach(function(A){if(!((I=A.length-1)<=0)){var I,S=A[0],w=A[I],R;if(E1(S,w)){for(s.lineStart(),h=0;h<I;++h)s.point((S=A[h])[0],S[1]);s.lineEnd();return}l.push(R=new Vg(S,A,null,!0)),p.push(R.o=new Vg(S,null,R,!1)),l.push(R=new Vg(w,A,null,!1)),p.push(R.o=new Vg(w,null,R,!0))}}),!!l.length){for(p.sort(t),iN(l),iN(p),h=0,g=p.length;h<g;++h)p[h].e=e=!e;for(var m=l[0],v,x;;){for(var E=m,M=!0;E.v;)if((E=E.n)===m)return;v=E.z,s.lineStart();do{if(E.v=E.o.v=!0,E.e){if(M)for(h=0,g=v.length;h<g;++h)s.point((x=v[h])[0],x[1]);else o(E.x,E.n.x,1,s);E=E.n}else{if(M)for(v=E.p.z,h=v.length-1;h>=0;--h)s.point((x=v[h])[0],x[1]);else o(E.x,E.p.x,-1,s);E=E.p}E=E.o,v=E.z,M=!M}while(!E.v);s.lineEnd()}}}function iN(n){if(t=n.length){for(var t,e=0,o=n[0],s;++e<t;)o.n=s=n[e],s.p=o,o=s;o.n=s=n[0],s.p=o}}function sl(n,t){return n<t?-1:n>t?1:n>=t?0:NaN}function S1(n){return n.length===1&&(n=bJ(n)),{left:function(t,e,o,s){for(o==null&&(o=0),s==null&&(s=t.length);o<s;){var l=o+s>>>1;n(t[l],e)<0?o=l+1:s=l}return o},right:function(t,e,o,s){for(o==null&&(o=0),s==null&&(s=t.length);o<s;){var l=o+s>>>1;n(t[l],e)>0?s=l:o=l+1}return o}}}function bJ(n){return function(t,e){return sl(n(t),e)}}var oN=S1(sl),AJ=oN.right,TJ=oN.left;var sN=Array.prototype,PJ=sN.slice,IJ=sN.map;var odt=Math.sqrt(50),sdt=Math.sqrt(10),adt=Math.sqrt(2);function Xg(n){for(var t=n.length,e,o=-1,s=0,l,p;++o<t;)s+=n[o].length;for(l=new Array(s);--t>=0;)for(p=n[t],e=p.length;--e>=0;)l[--s]=p[e];return l}var BJ=1e9,Vgt=-BJ;var M1=Zo();function b1(n,t){var e=t[0],o=t[1],s=[an(e),-Xn(e),0],l=0,p=0;M1.reset();for(var h=0,g=n.length;h<g;++h)if(v=(m=n[h]).length)for(var m,v,x=m[v-1],E=x[0],M=x[1]/2+qg,A=an(M),I=Xn(M),S=0;S<v;++S,E=R,A=F,I=V,x=w){var w=m[S],R=w[0],C=w[1]/2+qg,F=an(C),V=Xn(C),X=R-E,q=X>=0?1:-1,D=q*X,xt=D>gr,B=A*F;if(M1.add(Ko(B*q*an(D),I*V+B*Xn(D))),l+=xt?X+q*Da:X,xt^E>=e^R>=e){var j=Fh(Zl(x),Zl(w));Uh(j);var J=Fh(s,j);Uh(J);var Dt=(xt^X>=0?-1:1)*Co(J[2]);(o>Dt||o===Dt&&(j[0]||j[1]))&&(p+=xt^X>=0?1:-1)}}return(l<-er||l<er&&M1<-er)^p&1}var tmt=Zo();var _mt=Zo(),xmt=Zo();var kJ=1/0;var Smt=-kJ;function A1(n){this._context=n}A1.prototype={_radius:4.5,pointRadius:function(n){return this._radius=n,this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){this._line===0&&this._context.closePath(),this._point=NaN},point:function(n,t){switch(this._point){case 0:{this._context.moveTo(n,t),this._point=1;break}case 1:{this._context.lineTo(n,t);break}default:{this._context.moveTo(n+this._radius,t),this._context.arc(n,t,this._radius,0,Da);break}}},result:ua};var Nmt=Zo();function T1(){this._string=[]}T1.prototype={_radius:4.5,_circle:lN(4.5),pointRadius:function(n){return(n=+n)!==this._radius&&(this._radius=n,this._circle=null),this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){this._line===0&&this._string.push("Z"),this._point=NaN},point:function(n,t){switch(this._point){case 0:{this._string.push("M",n,",",t),this._point=1;break}case 1:{this._string.push("L",n,",",t);break}default:{this._circle==null&&(this._circle=lN(this._radius)),this._string.push("M",n,",",t,this._circle);break}}},result:function(){if(this._string.length){var n=this._string.join("");return this._string=[],n}else return null}};function lN(n){return"m0,"+n+"a"+n+","+n+" 0 1,1 0,"+-2*n+"a"+n+","+n+" 0 1,1 0,"+2*n+"z"}function C1(n,t,e,o){return function(s,l){var p=t(l),h=s.invert(o[0],o[1]),g=x1(),m=t(g),v=!1,x,E,M,A={point:I,lineStart:w,lineEnd:R,polygonStart:function(){A.point=C,A.lineStart=F,A.lineEnd=V,E=[],x=[]},polygonEnd:function(){A.point=I,A.lineStart=w,A.lineEnd=R,E=Xg(E);var X=b1(x,h);E.length?(v||(l.polygonStart(),v=!0),w1(E,VJ,X,e,l)):X&&(v||(l.polygonStart(),v=!0),l.lineStart(),e(null,null,1,l),l.lineEnd()),v&&(l.polygonEnd(),v=!1),E=x=null},sphere:function(){l.polygonStart(),l.lineStart(),e(null,null,1,l),l.lineEnd(),l.polygonEnd()}};function I(X,q){var D=s(X,q);n(X=D[0],q=D[1])&&l.point(X,q)}function S(X,q){var D=s(X,q);p.point(D[0],D[1])}function w(){A.point=S,p.lineStart()}function R(){A.point=I,p.lineEnd()}function C(X,q){M.push([X,q]);var D=s(X,q);m.point(D[0],D[1])}function F(){m.lineStart(),M=[]}function V(){C(M[0][0],M[0][1]),m.lineEnd();var X=m.clean(),q=g.result(),D,xt=q.length,B,j,J;if(M.pop(),x.push(M),M=null,!!xt){if(X&1){if(j=q[0],(B=j.length-1)>0){for(v||(l.polygonStart(),v=!0),l.lineStart(),D=0;D<B;++D)l.point((J=j[D])[0],J[1]);l.lineEnd()}return}xt>1&&X&2&&q.push(q.pop().concat(q.shift())),E.push(q.filter(HJ))}}return A}}function HJ(n){return n.length>1}function VJ(n,t){return((n=n.x)[0]<0?n[1]-Mi-er:Mi-n[1])-((t=t.x)[0]<0?t[1]-Mi-er:Mi-t[1])}var WJ=C1(function(){return!0},XJ,$J,[-gr,-Mi]);function XJ(n){var t=NaN,e=NaN,o=NaN,s;return{lineStart:function(){n.lineStart(),s=1},point:function(l,p){var h=l>0?gr:-gr,g=Zr(l-t);Zr(g-gr)<er?(n.point(t,e=(e+p)/2>0?Mi:-Mi),n.point(o,e),n.lineEnd(),n.lineStart(),n.point(h,e),n.point(l,e),s=0):o!==h&&g>=gr&&(Zr(t-o)<er&&(t-=o*er),Zr(l-h)<er&&(l-=h*er),e=YJ(t,e,l,p),n.point(o,e),n.lineEnd(),n.lineStart(),n.point(h,e),s=0),n.point(t=l,e=p),o=h},lineEnd:function(){n.lineEnd(),t=e=NaN},clean:function(){return 2-s}}}function YJ(n,t,e,o){var s,l,p=an(n-e);return Zr(p)>er?aa((an(t)*(l=Xn(o))*an(e)-an(o)*(s=Xn(t))*an(n))/(s*l*p)):(t+o)/2}function $J(n,t,e,o){var s;if(n==null)s=e*Mi,o.point(-gr,s),o.point(0,s),o.point(gr,s),o.point(gr,0),o.point(gr,-s),o.point(0,-s),o.point(-gr,-s),o.point(-gr,0),o.point(-gr,s);else if(Zr(n[0]-t[0])>er){var l=n[0]<t[0]?gr:-gr;s=e*l/2,o.point(-l,s),o.point(0,s),o.point(l,s)}else o.point(t[0],t[1])}function Yg(n){return function(t){var e=new P1;for(var o in n)e[o]=n[o];return e.stream=t,e}}function P1(){}P1.prototype={constructor:P1,point:function(n,t){this.stream.point(n,t)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}};var x0t=Xn(30*Jo);var O0t=Yg({point:function(n,t){this.stream.point(n*Jo,t*Jo)}});function $g(n){return function(t,e){var o=Xn(t),s=Xn(e),l=n(o*s);return[l*s*an(t),l*an(e)]}}function Fa(n){return function(t,e){var o=no(t*t+e*e),s=n(o),l=an(s),p=Xn(s);return[Ko(t*l,o*p),Co(o&&e*l/o)]}}var mN=$g(function(n){return no(2/(1+n))});mN.invert=Fa(function(n){return 2*Co(n/2)});var yN=$g(function(n){return(n=_1(n))&&n/an(n)});yN.invert=Fa(function(n){return n});function I1(n,t){return[n,Oh(Dh((Mi+t)/2))]}I1.invert=function(n,t){return[n,2*aa(Hg(t))-Mi]};function Zg(n,t){return[n,t]}Zg.invert=Zg;function vN(n,t){var e=Xn(t),o=Xn(n)*e;return[e*an(n)/o,an(t)/o]}vN.invert=Fa(aa);function _N(n,t){var e=t*t,o=e*e;return[n*(.8707-.131979*e+o*(-.013791+o*(.003971*e-.001529*o))),t*(1.007226+e*(.015085+o*(-.044475+.028874*e-.005916*o)))]}_N.invert=function(n,t){var e=t,o=25,s;do{var l=e*e,p=l*l;e-=s=(e*(1.007226+l*(.015085+p*(-.044475+.028874*l-.005916*p)))-t)/(1.007226+l*(.015085*3+p*(-.044475*7+.028874*9*l-.005916*11*p)))}while(Zr(s)>er&&--o>0);return[n/(.8707+(l=e*e)*(-.131979+l*(-.013791+l*l*l*(.003971-.001529*l)))),e]};function xN(n,t){return[Xn(t)*an(n),an(t)]}xN.invert=Fa(Co);function EN(n,t){var e=Xn(t),o=1+Xn(n)*e;return[e*an(n)/o,an(t)/o]}EN.invert=Fa(function(n){return 2*aa(n)});function wN(n,t){return[Oh(Dh((Mi+t)/2)),-n]}wN.invert=function(n,t){return[-t,2*aa(Hg(n))-Mi]};var tK=sn(yf(),1);var eK=sn(yf(),1);var rK=sn(yf(),1);var iK=sn(yf(),1);function _f(n,t){return Math.sqrt((t[0]-n[0])**2+(t[1]-n[1])**2)}function MN(n){let t=0;for(let e=0;e<n.length-1;e++)t+=_f(n[e],n[e+1]);return t}var jo=sn(bN(),1);var Nn="___",Jg=class{setLiftPriority(t){this.lift_priority=t}isFacilityByType(t){return["facility","escalator","straightLadder","staircase","ramp","connectionPoint"].includes(t)}initFacilities(t){this.facilities=t.map(e=>{let o=[];try{o=JSON.parse(e.entry_end_floor)}catch(l){o=[]}let s=[];try{s=JSON.parse(e.entry_start_floor)}catch(l){s=[]}return Lu({},e,{entry_start_floor:s,entry_end_floor:o})})}getParkingSpaceInfo(t,e){let o=""+t+Nn+e;var s;return(s=this.parkingMap.get(o))!=null?s:null}getNodeInfo(t,e){let o=""+t+Nn+e,s=this.nodeMap.get(o);if(!(s!=null&&s.length))return null;let l=this.pointMap.get(s[0]);return l!=null?l:null}initRoute(t,e){this.clear(),this.roadInfo=t,this.initFacilities(e);let o=new Date,s=o.getHours()*60+o.getMinutes();t.length&&(t.forEach(l=>{let p=(l.points||[]).filter(h=>!(0,jo.isNil)(h.passWeight)&&h.passWeight!==1&&!(0,jo.isNil)(h.coverageArea)&&h.coverageArea!==0);(l.points||[]).filter(h=>h.openStatus!==!1).filter(h=>{if(!h.startTime||!h.endTime)return!0;let[g,m]=h.startTime.split(":").map(A=>+A),[v,x]=h.endTime.split(":").map(A=>+A),E=g*60+m,M=v*60+x;return s>=E&&s<=M}).forEach(h=>{h.floor=l.floor;let g=""+l.floor+Nn+h.id,m=""+l.floor+Nn+h.nodeId,v=this.nodeMap.get(m)||[];if(v.push(""+l.floor+Nn+(h.relatedId||h.id)),this.nodeMap.set(""+l.floor+Nn+h.nodeId,v),this.pointMap.set(g,h),this.isFacilityByType(h.type)){let x=this.facilities.find(E=>E.id===+h.targetId);if(x){switch(x.entry_infra_type){case"straightLadder":if(x.entry_end_floor.find(I=>I.floor===l.floor)&&x.entry_start_floor.find(I=>I.floor===l.floor)){let I=this.straightLadderMap.get(h.targetId)||[];I.push(Lu({},h)),this.straightLadderMap.set(h.targetId,I)}break;case"staircase":if(x.entry_end_floor.find(I=>I.floor===l.floor)&&x.entry_start_floor.find(I=>I.floor===l.floor)){let I=this.staircaseMap.get(h.targetId)||[];I.push(Lu({},h)),this.staircaseMap.set(h.targetId,I)}break;case"escalator":let M=this.escalatorMap.get(h.targetId)||[];if(x.entry_start_floor.find(I=>I.floor===l.floor)){let I=M.find(S=>{var w;return((w=S.end)==null?void 0:w.floor)!==l.floor&&!S.start});I?I.start=h:M.push({start:h})}if(x.entry_end_floor.find(I=>I.floor===l.floor)){let I=M.find(S=>{var w;return((w=S.start)==null?void 0:w.floor)!==l.floor&&!S.end});I?I.end=h:M.push({end:h})}this.escalatorMap.set(h.targetId,M);break;case"ramp":let A=this.rampMap.get(h.targetId)||[];if(x.entry_start_floor.find(I=>I.floor===l.floor)){let I=A.find(S=>{var w;return((w=S.end)==null?void 0:w.floor)!==l.floor&&!S.start});I?I.start=h:A.push({start:h})}if(x.entry_end_floor.find(I=>I.floor===l.floor)){let I=A.find(S=>{var w;return((w=S.start)==null?void 0:w.floor)!==l.floor&&!S.end});I?I.end=h:A.push({end:h})}this.rampMap.set(h.targetId,A);break;case"connectionPoint":if(x.entry_end_floor.find(I=>I.floor===l.floor)&&x.entry_start_floor.find(I=>I.floor===l.floor)){let I=this.connectionPointMap.get(h.targetId)||[];I.push(Lu({},h)),this.connectionPointMap.set(h.targetId,I)}break}let E=this.facilityMap.get(h.targetId)||[];E.push(Lu({},h)),this.facilityMap.set(h.targetId,E)}}h.type==="parkingSpace"&&h.name.split(/[,\uFF0C]/).forEach(E=>{this.parkingMap.set(""+l.floor+Nn+E,h)})}),(l.lines||[]).filter(h=>h.to!==h.from).forEach(h=>{let g=""+l.floor+Nn+h.from,m=""+l.floor+Nn+h.to,v=this.pointMap.get(g),x=this.pointMap.get(m);if(!v||!x)return;let E=v.cds,M=x.cds,A=_f(E,M);if(p.forEach(I=>{(I.id===h.from||I.id===h.to)&&(A=A/I.passWeight);let S=_f(E,I.cds)<=I.coverageArea,w=_f(M,I.cds)<=I.coverageArea;(S||w)&&(A=A/I.passWeight)}),!v.permission&&!x.permission){switch(this.addLineItem(g,m,A),this.addLineItem(m,g,A),h.direction){case"double":this.addLineItem(g,m,A,this.forwardLineMap),this.addLineItem(m,g,A,this.forwardLineMap);break;case"single":this.addLineItem(g,m,A,this.forwardLineMap);break;case"back":this.addLineItem(m,g,A,this.forwardLineMap);break}(v.type==="parkingSpace"||x.type==="parkingSpace")&&h.direction==="noDir"&&(this.addLineItem(g,m,A,this.forwardLineMap),this.addLineItem(m,g,A,this.forwardLineMap))}else v.permission&&(this.setPermissionLine(g,m,v.permission,A,""),this.setPermissionLine(m,g,v.permission,A,"")),x.permission&&x.permission!==v.permission&&(this.setPermissionLine(g,m,x.permission,A,""),this.setPermissionLine(m,g,x.permission,A,""))})}),this.addPermissionFacility(),this.initBaseRoute(),this.initEscalatorRoute(),this.initStraightLadderRoute(),this.initForwardRoute())}getPermissionMap(t){return this["permission_"+t]||(this["permission_"+t]=new Set),this["permission_"+t]}setPermissionLine(t,e,o,s,l){this.getPermissionMap(o).add({fromKey:t,toKey:e,distance:s,type:l})}addPermissionFacility(){this.straightLadderMap.forEach((t,e)=>{if(t.length<2){this.straightLadderMap.delete(e);return}for(let o=0;o<t.length;o++){let s=""+t[o].floor+Nn+t[o].id,l=this.pointMap.get(s);if(l){for(let p=0;p<t.length;p++)if(o!==p){let h=""+t[p].floor+Nn+t[p].id,g=this.pointMap.get(h);if(!g)continue;l.permission&&this.setPermissionLine(s,h,l.permission,1,"straightLadder"),g.permission&&g.permission!==l.permission&&this.setPermissionLine(s,h,g.permission,1,"straightLadder")}}}}),this.staircaseMap.forEach((t,e)=>{if(t.length<2){this.staircaseMap.delete(e);return}for(let o=0;o<t.length;o++){let s=""+t[o].floor+Nn+t[o].id,l=this.pointMap.get(s);if(l){for(let p=0;p<t.length;p++)if(o!==p){let h=""+t[p].floor+Nn+t[p].id,g=this.pointMap.get(h);if(!g)continue;l.permission&&this.setPermissionLine(s,h,l.permission,1,"staircase"),g.permission&&g.permission!==l.permission&&this.setPermissionLine(s,h,g.permission,1,"staircase")}}}}),this.escalatorMap.forEach((t,e)=>{t.forEach(o=>{if(o.start&&o.end){let s=""+o.start.floor+Nn+o.start.id,l=""+o.end.floor+Nn+o.end.id,p=this.pointMap.get(s),h=this.pointMap.get(l);p&&h&&(p.permission&&this.setPermissionLine(s,l,p.permission,1,"escalator"),h.permission&&h.permission!==p.permission&&this.setPermissionLine(s,l,h.permission,1,"escalator"))}})}),this.rampMap.forEach((t,e)=>{t.forEach(o=>{if(o.start&&o.end){let s=""+o.start.floor+Nn+o.start.id,l=""+o.end.floor+Nn+o.end.id,p=this.pointMap.get(s),h=this.pointMap.get(l);p&&h&&(p.permission&&this.setPermissionLine(s,l,p.permission,10,"ramp"),h.permission&&h.permission!==p.permission&&this.setPermissionLine(s,l,h.permission,10,"ramp"))}})}),this.connectionPointMap.forEach((t,e)=>{if(t.length<2){this.connectionPointMap.delete(e);return}for(let o=0;o<t.length;o++){let s=""+t[o].floor+Nn+t[o].id,l=this.pointMap.get(s);if(l){for(let p=0;p<t.length;p++)if(o!==p){let h=""+t[p].floor+Nn+t[p].id,g=this.pointMap.get(h);if(!g)continue;l.permission&&this.setPermissionLine(s,h,l.permission,1,"connectionPoint"),g.permission&&g.permission!==l.permission&&this.setPermissionLine(s,h,g.permission,1,"connectionPoint")}}}})}addPermissionLineToMap(t,e,o,s){this.getPermissionMap(t).forEach(p=>{e.includes(p.type)&&(p.type===""?this.addLineItem(p.fromKey,p.toKey,p.distance,o):this.addLineItem(p.fromKey,p.toKey,s.get(p.type),o))})}addLineItem(t,e,o,s){s===void 0&&(s=this.lineMap);let l=s.get(t)||new Map;l.set(e,o),s.set(t,l)}addFacilityToLineMap(t,e,o,s){[...this.straightLadderMap,...this.staircaseMap].forEach(l=>{let[p,h]=l;if(!(h.length<2))for(let g=0;g<h.length;g++){let m=""+h[g].floor+Nn+h[g].id,v=this.pointMap.get(m);if(!(!v||v.permission)){for(let x=0;x<h.length;x++)if(g!==x){let E=""+h[x].floor+Nn+h[x].id,M=this.pointMap.get(E);if(!M||M.permission)continue;if(h[g].type==="straightLadder"){let A=e;this.addLineItem(m,E,A,s)}else{let A=o;this.addLineItem(m,E,A,s)}}}}}),this.escalatorMap.forEach((l,p)=>{l.forEach(h=>{if(h.start&&h.end){let g=""+h.start.floor+Nn+h.start.id,m=""+h.end.floor+Nn+h.end.id,v=this.pointMap.get(g),x=this.pointMap.get(m);if(v&&x&&!v.permission&&!x.permission){let E=t;this.addLineItem(g,m,E,s)}}})}),this.connectionPointMap.forEach((l,p)=>{if(!(l.length<2))for(let h=0;h<l.length;h++){let g=""+l[h].floor+Nn+l[h].id,m=this.pointMap.get(g);if(!(!m||m.permission)){for(let v=0;v<l.length;v++)if(h!==v){let x=""+l[v].floor+Nn+l[v].id,E=this.pointMap.get(x);if(!E||E.permission)continue;this.addLineItem(g,x,100,s)}}}})}initBaseRoute(){let t=new Map((0,jo.cloneDeep)([...this.lineMap]));this.addFacilityToLineMap(100,100*this.lift_priority,3e4,t),this.baseRoute=new ro.default(t)}initEscalatorRoute(){let t=new Map((0,jo.cloneDeep)([...this.lineMap])),e=1e4;this.addFacilityToLineMap(100,this.lift_priority*e,3e4*e,t),this.escalatorRoute=new ro.default(t)}initStraightLadderRoute(){let t=new Map((0,jo.cloneDeep)([...this.lineMap])),e=1e4;this.addFacilityToLineMap(3*e,300,3e4*e,t),this.straightLadderRoute=new ro.default(t)}initForwardRoute(){this.rampMap.forEach((t,e)=>{t.forEach(o=>{if(o.start&&o.end){let s=""+o.start.floor+Nn+o.start.id,l=""+o.end.floor+Nn+o.end.id,p=this.pointMap.get(s),h=this.pointMap.get(l);p&&h&&!p.permission&&!h.permission&&this.addLineItem(s,l,10,this.forwardLineMap)}})}),this.connectionPointMap.forEach((t,e)=>{if(!(t.length<2))for(let o=0;o<t.length;o++){let s=""+t[o].floor+Nn+t[o].id,l=this.pointMap.get(s);if(!(!l||l.permission)){for(let p=0;p<t.length;p++)if(o!==p){let h=""+t[p].floor+Nn+t[p].id,g=this.pointMap.get(h);if(!g||g.permission)continue;this.addLineItem(s,h,100,this.forwardLineMap)}}}}),this.forwardRoute=new ro.default(this.forwardLineMap)}checkStart(t){return!(!t.floor||!t.nodeId&&(!t.coord||t.coord.length<2))}checkEnd(t){return t.facility||t.parkingSpace&&t.floor?!0:this.checkStart(t)}transformStart(t,e,o){o===void 0&&(o={});var s;if(t.nodeId){let l=this.nodeMap.get(""+t.floor+Nn+t.nodeId);if(l!=null&&l.length)return l.map(p=>{let[h,g]=p.split(Nn);return{floor:h,id:g}})}if((s=t.coord)!=null&&s.length){let l=this.roadInfo.find(m=>m.floor===t.floor);if(!l)return null;let p=l.points.filter(m=>m.isStarted),h=l.points.filter(m=>{let v=""+m.floor+Nn+m.id;if(e==="forward"){if(!this.forwardLineMap.has(v)||o.adsorptionIntersection&&p.length&&!m.isStarted)return!1}else if(!this.lineMap.has(v))return!1;return!0});if(!h.length)return null;let g=h.reduce((m,v)=>{if(v.relatedId)return m;let x=_f(t.coord,v.cds);return x<m.min&&(m.min=x,m.point=v),m},{min:1/0,point:h[0]});return[{floor:l.floor,id:g.point.id}]}return null}transformEnd(t,e){if(t.floor){if(t.parkingSpace){let s=this.parkingMap.get(""+t.floor+Nn+t.parkingSpace);if(s)return[{floor:t.floor,id:s.id}]}let o=this.transformStart(t,e);if(o)return o}if(t.facility){let s=this.facilities.filter(l=>+l.type_id==+t.facility).map(l=>l.id).map(l=>this.facilityMap.get(""+l)).flat(2);if(s!=null&&s.length)return{floor:t.floor,facility:t.facility}}return null}getPath(t,e,o,s,l,p){if(o===void 0&&(o=""),p===void 0&&(p={}),!this.checkStart(t))return"start-error";if(!this.checkEnd(e))return"end-error";let h=this.transformStart(t,o,p);if(!h)return"no-start";let g=this.transformEnd(e,o);if(!g)return"no-end";let m=[];if(Array.isArray(g))for(let E=0;E<h.length;E++){let M=h[E];for(let A=0;A<g.length;A++){let I=g[A];if(M.floor===I.floor&&M.id===I.id)return"near"}}else{m=this.facilities.filter(M=>+M.type_id==+e.facility).map(M=>M.id).map(M=>this.facilityMap.get(""+M)).flat(2).filter(M=>M).filter(M=>g.floor?M.floor===g.floor:!0);for(let M=0;M<h.length;M++){let A=h[M];for(let I=0;I<m.length;I++){let S=m[I];if(A.floor===S.floor&&A.id===S.id)return"near"}}}let v;switch(o){case"escalator":v=this.getEscalatorPath.bind(this);break;case"straightLadder":v=this.getStraightLadderPath.bind(this);break;case"forward":v=this.getForwardPath.bind(this);break;default:v=this.getBasePath.bind(this);break}let x=null;return h.forEach(E=>{if(Array.isArray(g))g.forEach(M=>{let A=v(E,M,s,l);A&&A&&(!x||A[0].consume<x[0].consume)&&(x=A)});else{if(!m.length)return null;let M=m.map(A=>v(E,{floor:A.floor,id:A.id},s,l)).filter(A=>!!A);x=M.reduce((A,I)=>{let S=I[0].consume;return S<A.distance&&(A.distance=S,A.path=I),A},{distance:1/0,path:M[0]}).path}}),x}getRoutePath(t,e,o){let s=""+t.floor+Nn+t.id,l=this.pointMap.get(s),p=""+e.floor+Nn+e.id,h=this.pointMap.get(p);if(!l||!h)return null;let g=""+l.floor+Nn+(l.relatedId||l.id),m=""+h.floor+Nn+(h.relatedId||h.id),v=o.path(g,m);if(!v)return null;let x=[],E=v.reduce((M,A,I,S)=>{if(I===0)return 0;let w=S[I-1],R=o.graph.get(w).get(A);return M+R},0);return v.map(M=>{let A=this.pointMap.get(M);if(A){var I;let{floor:S}=A,w=A.type;if(this.isFacilityByType(A.type)){let R=this.facilities.find(C=>C.id===+A.targetId);R&&(w=R.entry_infra_type)}if(((I=x[x.length-1])==null?void 0:I.floor)===S){let R=x[x.length-1];R.points.push(A.cds),R.pointInfos.push(A),R.endType=w,R.destId=A.nodeId,R.distance=MN(R.points)}else x.push({floor:S,points:[A.cds],pointInfos:[A],endType:w,destId:A.nodeId,distance:0,consume:E})}}),x}getBasePath(t,e,o){if(!o)return this.getRoutePath(t,e,this.baseRoute);let s=(0,jo.cloneDeep)(this.baseRoute.graph),l=h=>{this.addPermissionLineToMap(h,["","escalator","staircase","straightLadder","connectionPoint"],s,new Map([["escalator",100],["connectionPoint",100],["straightLadder",100*this.lift_priority],["staircase",3e4]]))};Array.isArray(o)?o.forEach(h=>{l(h)}):l(o);let p=new ro.default(s);return this.getRoutePath(t,e,p)}getEscalatorPath(t,e,o){if(!o)return this.getRoutePath(t,e,this.escalatorRoute);let s=(0,jo.cloneDeep)(this.escalatorRoute.graph),l=1e4,p=g=>{this.addPermissionLineToMap(g,["","escalator","staircase","straightLadder","connectionPoint"],s,new Map([["escalator",100],["connectionPoint",100],["straightLadder",this.lift_priority*l],["staircase",3e4*l]]))};Array.isArray(o)?o.forEach(g=>{p(g)}):p(o);let h=new ro.default(s);return this.getRoutePath(t,e,h)}getStraightLadderPath(t,e,o){if(!o)return this.getRoutePath(t,e,this.straightLadderRoute);let s=(0,jo.cloneDeep)(this.straightLadderRoute.graph),l=1e4,p=g=>{this.addPermissionLineToMap(g,["","escalator","staircase","straightLadder","connectionPoint"],s,new Map([["escalator",3*l],["connectionPoint",100],["straightLadder",300],["staircase",3e4*l]]))};Array.isArray(o)?o.forEach(g=>{p(g)}):p(o);let h=new ro.default(s);return this.getRoutePath(t,e,h)}getForwardPath(t,e,o,s){let l=new Map,p=M=>{let A=this.forwardRoute.graph.get(g);M.forEach(I=>{let S=A.get(I);(0,jo.isNil)(S)||(l.set(I,S),A.delete(I))})},h=()=>{let M=this.forwardRoute.graph.get(g);l.forEach((A,I)=>{M.set(I,A)})},g=""+t.floor+Nn+t.id;if(!(0,jo.isNil)(s)){let M=this.forwardLineMap.get(g),A=this.pointMap.get(g);if(A&&(M!=null&&M.size)&&M.size>1){let I=new Ye(A.cds[0],A.cds[1]),S=new Map;M.forEach((R,C)=>{let F=this.pointMap.get(C);if(F){let V=new Ye(F.cds[0],F.cds[1]),q=360-(new Ye().subVectors(V,I).angle()/Math.PI*180-90+360)%360;S.set(C,q)}});let w=Array.from(S).filter(R=>{let[C,F]=R;return Math.abs(F-s)<=60}).map(R=>{let[C]=R;return C});if(w.length)w.forEach(R=>S.delete(R)),p([...S.keys()]);else{let R=Array.from(S).reduce((C,F)=>{let V=Math.abs(F[1]-s);return V<C.diff?{diff:V,key:F[0]}:C},{diff:1/0,key:""});S.delete(R.key),p([...S.keys()])}}}if(!o){let M=this.getRoutePath(t,e,this.forwardRoute);return h(),M||this.getRoutePath(t,e,this.forwardRoute)}let m=(0,jo.cloneDeep)(this.forwardRoute.graph),v=M=>{this.addPermissionLineToMap(M,["","ramp"],m,new Map([["ramp",10]]))};Array.isArray(o)?o.forEach(M=>{v(M)}):v(o);let x=new ro.default(m),E=this.getRoutePath(t,e,x);if(h(),E)return E;{let M=(0,jo.cloneDeep)(this.forwardRoute.graph);Array.isArray(o)?o.forEach(S=>{v(S)}):v(o);let A=new ro.default(M);return this.getRoutePath(t,e,A)}}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 ro.default,this.escalatorRoute=new ro.default,this.straightLadderRoute=new ro.default}constructor(t=3){this.lift_priority=t,this.roadInfo=[],this.facilities=[],this.pointMap=new Map,this.nodeMap=new Map,this.facilityMap=new Map,this.straightLadderMap=new Map,this.escalatorMap=new Map,this.rampMap=new Map,this.staircaseMap=new Map,this.connectionPointMap=new Map,this.parkingMap=new Map,this.lineMap=new Map,this.baseRoute=new ro.default,this.escalatorRoute=new ro.default,this.straightLadderRoute=new ro.default,this.forwardLineMap=new Map,this.forwardRoute=new ro.default}};var uwt=sn(jN(),1),lwt=sn(Yp(),1);function QN(n){return n.replace(/[A-Z]/g,t=>"_"+t.toLowerCase()).replace(/^_/,"")}function t2(n){let t={};for(let o in n)o.startsWith("on")&&(t[QN(o.slice(2))]=n[o],t[o]=n[o]);let e=o=>ac(this,null,function*(){let{data:s}=o;if(t[s.type])try{let l=yield t[s.type](s.data);if(l!=null&&l.$transfer&&Array.isArray(l.$transfer)){let p=l.$transfer;delete l.$transfer,self.postMessage({type:""+s.type+"_result",key:s.key,data:l},p)}else self.postMessage({type:""+s.type+"_result",key:s.key,data:l})}catch(l){self.postMessage({type:""+s.type+"_result",key:s.key,error:l})}else self.postMessage({type:""+s.type+"_result",key:s.key,error:"no_event"})});return self.addEventListener("message",e),()=>{self.removeEventListener("message",e)}}var la=new Jg,r2,QK=new Promise(n=>{r2=n});function i2(n,t,e){let{floor:o,coord:s}=n,l=null;return(t||[]).forEach(p=>{let h=la.getPath({floor:o,coord:s},{floor:p.floor,parkingSpace:p.lot_id},"forward",0,e);if(h==="near"){l={floor:p.floor,spaceNo:p.lot_id,distance:0};return}if(!h||typeof h=="string")return;let g={floor:p.floor,spaceNo:p.lot_id,distance:h[0].consume};l||(l=g),l.distance>g.distance&&(l=g)}),l}function e2(n,t,e,o,s){let l=i2({floor:n,coord:t},e[n],s);return l||tj(n,t,e,o,s)}function tj(n,t,e,o,s){let l=o.indexOf(n);l===-1&&(l=o.length);let p=1,h=null;for(;p<=o.length;){if(o.filter((m,v)=>v===l-1||v===l+1).forEach(m=>{let v=i2({floor:n,coord:t},e[m],s);h?v&&h.distance>v.distance&&(h=v):h=v}),h)return h;p++}return h}function n2(n,t,e,o,s){let l=z1(n,t,t.floor,e,s);if(l)return l;let p=z1(n,t,n.floor,e,s);return p||ej(n,t,n.floor,e,o,s)}function z1(n,t,e,o,s){let l=o[e]||[];if(!l.length)return null;let p=null;return l.forEach(h=>{let g={floor:h.floor,parkingSpace:h.lot_id},m=la.getPath(n,g,"forward",0,s);if(!m||typeof m=="string"&&m!=="near")return;let v=la.getParkingSpaceInfo(h.floor,h.lot_id);if(!v)return;let x=la.getPath({floor:h.floor,coord:v.cds},t,"",0);if(x==="near"){p={floor:h.floor,spaceNo:h.lot_id,distance:0};return}if(!x||typeof x=="string")return;let E={floor:h.floor,spaceNo:h.lot_id,distance:x[0].consume};p?p.distance>E.distance&&(p=E):p=E}),p}function ej(n,t,e,o,s,l){let p=s.indexOf(e);p===-1&&(p=s.length);let h=1,g=null;for(;h<=s.length;){if(s.filter((v,x)=>x===p-1||x===p+1).forEach(v=>{let x=z1(n,t,v,o,l);g?x&&g.distance>x.distance&&(g=x):g=x}),g)return g;h++}return g}function nj(n){if(n.coord)return{floor:n.floor,coord:n.coord};if(n.nodeId){let t=la.getNodeInfo(n.floor,n.nodeId);if(t)return{floor:t.floor,coord:t.cds}}return null}function rj(n){if(n.coord)return{floor:n.floor,coord:n.coord};if(n.nodeId){let t=la.getNodeInfo(n.floor,n.nodeId);if(t)return{floor:t.floor,coord:t.cds}}if(n.parkingSpace){let t=la.getParkingSpaceInfo(n.floor,n.parkingSpace);if(t)return{floor:t.floor,coord:t.cds}}return null}t2({onSetRoadInfo(n){let{roadData:t,facilities:e}=n;la.initRoute(t,e),r2(!0)},onRecommend(n){return ac(this,null,function*(){let{start:t,end:e,travelDirection:o,carLotStatus:s,parkingType:l}=n;yield QK;let p=s.reduce((v,x)=>(v[x.floor]?v[x.floor].push(x):v[x.floor]=[x],v),{}),h=la.roadInfo.map(v=>v.floor),g=nj(t);if(!g)return null;let m=e?rj(e):null;if(l){let v=s.filter(x=>{let E=la.getParkingSpaceInfo(x.floor,x.lot_id);return E?E.parkingType===l:!1});if(v){let x=v.reduce((E,M)=>(E[M.floor]?E[M.floor].push(M):E[M.floor]=[M],E),{});if(m){let E=n2(g,m,x,h,o);if(E)return E}else{let E=e2(g.floor,g.coord,x,h,o);if(E)return E}}}return m?n2(g,m,p,h,o):e2(g.floor,g.coord,p,h,o)})},onClear(){la.clear()}});
|
|
23579
|
-
`],{type:"text/javascript"}),t=URL.createObjectURL(a),e=new Worker(t);return URL.revokeObjectURL(t),e}var n0={placeId:0,catLotStatusApi:"https://vrapi.aibee.cn/parking/cat-lot-status"},mo=class{setRoadData(t,e){return Z(this.worker,"set_road_info",{roadData:t,facilities:e})}recommend(t){return g(this,null,function*(){let e=yield fetch(this.options.catLotStatusApi,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({place_id:+this.options.placeId})}).then(n=>n.json()).then(n=>n.data.filter(r=>r.status===0));return Z(this.worker,"recommend",v({},t,{carLotStatus:e}))})}dispose(){this.worker.terminate()}constructor(t={}){this.worker=go(),this.options=v({},n0,t)}};var l3=require("core-js/modules/es.json.stringify.js"),c3=require("core-js/modules/web.dom-collections.iterator.js"),h3=require("core-js/modules/es.array.sort.js"),p3=require("core-js/modules/es.array.push.js"),f3=require("core-js/modules/web.url-search-params.js"),d3=require("core-js/modules/web.url-search-params.delete.js"),g3=require("core-js/modules/web.url-search-params.has.js"),m3=require("core-js/modules/web.url-search-params.size.js"),_3=require("core-js/modules/es.regexp.exec.js");var i3=require("core-js/modules/es.json.stringify.js");var r0={url:"",reconnect:!0,heartBeat:2e3,heartMsg:JSON.stringify({command:"PING"}),reconnectTime:3e3,reconnectMaxCount:1e6,noMessageTime:6e3},xn=class extends ct{initWebsocket(){this.ws=new WebSocket(this.options.url),this.ws.onopen=()=>{this.alive=!0,this.startHeart(),this.startOnMessageTimer(),this.stopReconnect(),this.dispatchEvent({type:"open"})},this.ws.onerror=()=>{this.alive=!1,this.ws=null,this.stopHeart(),this.stopOnMessageTimer(),this.startReconnect(),this.registryEvent()},this.ws.onclose=()=>{this.alive=!1,this.ws=null,this.stopHeart(),this.stopOnMessageTimer(),this.startReconnect()},this.ws.onmessage=t=>{this.startOnMessageTimer(),this.dispatchEvent({type:"message",message:t})}}startHeart(){this.stopHeart(),this.heartTimer=this.timer.setInterval(()=>{this.send(this.options.heartMsg)&&this.dispatchEvent({type:"send-heart"})},this.options.heartBeat)}stopHeart(){this.heartTimer&&(this.timer.clearInterval(this.heartTimer),this.heartTimer=null)}startReconnect(t){t===void 0&&(t=this.options.reconnectTime),this.stopReconnect(),this.options.reconnect&&(this.options.reconnectMaxCount--,this.options.reconnectMaxCount>=0&&(this.reconnectTimer=this.timer.setTimeout(()=>{this.initWebsocket()},t)))}stopReconnect(){this.reconnectTimer&&(this.timer.clearTimeout(this.reconnectTimer),this.reconnectTimer=null)}startOnMessageTimer(){this.stopOnMessageTimer(),this.noMessageTimer=this.timer.setTimeout(()=>{var t;(t=this.ws)==null||t.close(),this.dispatchEvent({type:"no-message-timeout"})},this.options.noMessageTime)}stopOnMessageTimer(){this.noMessageTimer&&(this.timer.clearTimeout(this.noMessageTimer),this.noMessageTimer=null)}send(t){var e;let n=typeof t=="string"?t:JSON.stringify(t);return this.alive&&((e=this.ws)==null?void 0:e.readyState)===1?(this.ws.send(n),this.dispatchEvent({type:"send-success",msg:n}),!0):(this.dispatchEvent({type:"send-fail",msg:n}),!1)}registryEvent(){window.addEventListener("online",this.onOnline)}unRegistryEvent(){window.removeEventListener("online",this.onOnline)}close(){var t;this.unRegistryEvent(),this.options.reconnect=!1,this.alive=!1,this.stopHeart(),this.stopReconnect(),this.stopOnMessageTimer(),(t=this.ws)==null||t.close(),this.ws=null,this.dispatchEvent({type:"close"})}dispose(){this.close(),this.timer.dispose(),super.dispose()}constructor(t){super(),this.ws=null,this.alive=!1,this.timer=new $,this.heartTimer=null,this.reconnectTimer=null,this.noMessageTimer=null,this.onOnline=()=>{this.startReconnect()},this.options=v({},r0,t||{}),this.options.url&&this.initWebsocket()}};var yo=require("lodash");var _o=a=>{let t=a.toString(2),e=""+Array(16-t.length+1).join("0")+t,n=parseInt(e.slice(0,4),2)*10,r=parseInt(e.slice(4,16),2);return[n,r]};var vo=class extends ct{initPositionWebSocket(){let t=v({},this.options.ext_position_params,{place_id:this.options.place_id,token:this.options.access_token}),e=Object.keys(t).filter(n=>!(0,yo.isNil)(t[n])).map(n=>n+"="+t[n]).join("&");this.positionWebSocket=new xn({url:this.options.wss_position_url+"?"+e}),this.positionWebSocket.addEventListener("message",n=>{let{message:r}=n,i=(()=>{try{return JSON.parse(r.data)}catch(H){return r.data}})();if(this.dispatchEvent({type:"ws-message",data:i}),i.command==="POSITION_RESULT"&&i.data.success)if(["POSITION","FLOOR","PARK_POSITION","AOA"].includes(i.data.success_type)&&this.useGpsFloorTimer&&(this.positionFloor=i.data.floor,this.timer.clearTimeout(this.useGpsFloorTimer),this.useGpsFloorTimer=null),i.data.success_type==="AOA"){let{x:H,y:j,time:ut,floor:ot,ts:oe}=i.data,se=this.positionFloor!==ot;if(this.positionFloor=ot,this.dispatchEvent({type:"ws-position",floor:ot,x:H,y:j,time:ut,_type:"aoa"}),this.options.upload_position){var o;(o=this.positionWebSocket)==null||o.send({command:"UPLOAD_POSITION",ts:Date.now(),index:this.uploadIndex++,data:JSON.stringify({x:H,y:j,floor:ot,type:"aoa"}),serverData:JSON.stringify(i)})}if(!this.options.use_pdr){this.dispatchEvent({type:"position",floor:ot,x:H,y:j,time:new Date(oe).getTime()-i.lag-i.duration});return}if(this.options.type!==1){var s;if(se){var u,l,c;(c=this.pdrPosition)==null||(l=c.pdr)==null||(u=l.particleFilter)==null||u.setPosInitFlag(!1)}(s=this.pdrPosition)==null||s.setBeaconPosition({x:H,y:j},new Date(oe).getTime()-i.lag-i.duration)}else if(se){var h;if(this.resetPdr(),(h=this.carInertialPosition)==null||h.stopPositionTimer(),this.path){let Ae=this.path.findIndex(En=>En.floor===ot),me=this.path[Ae];if(me){var p;this.resetPdr(),(p=this.carInertialPosition)==null||p.setBeaconPosition(me.points[0],new Date(ut).getTime()-i.lag-i.duration,i.lag+i.duration)}else{var f;(f=this.carInertialPosition)==null||f.setBeaconPosition([H,j],new Date(ut).getTime()-i.lag-i.duration,i.lag+i.duration)}}else{var d;(d=this.carInertialPosition)==null||d.setBeaconPosition([H,j],new Date(ut).getTime()-i.lag-i.duration,i.lag+i.duration)}}else{var m;(m=this.carInertialPosition)==null||m.setBeaconPosition([H,j],new Date(ut).getTime()-i.lag-i.duration,i.lag+i.duration)}}else if(i.data.success_type==="POSITION"){let{x:H,y:j,time:ut,floor:ot,ts:oe}=i.data,se=this.positionFloor!==ot;if(this.positionFloor=ot,this.dispatchEvent({type:"ws-position",floor:ot,x:H,y:j,time:ut,_type:"beacon"}),console.log("positionFloor",ot,se),this.options.upload_position){var y;(y=this.positionWebSocket)==null||y.send({command:"UPLOAD_POSITION",ts:Date.now(),index:this.uploadIndex++,data:JSON.stringify({x:H,y:j,floor:ot,type:"originBeacon"}),serverData:JSON.stringify(i)})}if(!this.options.use_pdr){this.dispatchEvent({type:"position",floor:ot,x:H,y:j,time:new Date(oe).getTime()-i.lag-i.duration});return}if(this.options.type!==1){var x;if(se){var E,S,R;(R=this.pdrPosition)==null||(S=R.pdr)==null||(E=S.particleFilter)==null||E.setPosInitFlag(!1)}(x=this.pdrPosition)==null||x.setBeaconPosition({x:H,y:j},new Date(oe).getTime()-i.lag-i.duration)}else if(se){var P;if(this.resetPdr(),(P=this.carInertialPosition)==null||P.stopPositionTimer(),this.path){let Ae=this.path.findIndex(En=>En.floor===ot),me=this.path[Ae];if(me){var K;this.resetPdr(),(K=this.carInertialPosition)==null||K.setBeaconPosition(me.points[0],new Date(ut).getTime()-i.lag-i.duration,i.lag+i.duration)}else{var T;(T=this.carInertialPosition)==null||T.setBeaconPosition([H,j],new Date(ut).getTime()-i.lag-i.duration,i.lag+i.duration)}}else{var Q;(Q=this.carInertialPosition)==null||Q.setBeaconPosition([H,j],new Date(ut).getTime()-i.lag-i.duration,i.lag+i.duration)}}else{var L;(L=this.carInertialPosition)==null||L.setBeaconPosition([H,j],new Date(ut).getTime()-i.lag-i.duration,i.lag+i.duration)}}else if(i.data.success_type==="PARK_POSITION"&&i.data.success){if(this.options.type===1){let{x:H,y:j,time:ut,floor:ot}=i.data,oe=this.positionFloor!==ot;if(this.positionFloor=i.data.floor,this.dispatchEvent({type:"ws-position",floor:ot,x:H,y:j,time:ut,_type:"vision"}),!this.options.use_pdr){this.dispatchEvent({type:"position",floor:ot,x:H,y:j,time:new Date(ut).getTime()});return}if(oe){var O;if(this.resetPdr(),(O=this.carInertialPosition)==null||O.stopPositionTimer(),this.path){let se=this.path.findIndex(me=>me.floor===ot),Ae=this.path[se];if(Ae){var I;this.resetPdr(),(I=this.carInertialPosition)==null||I.setPosition(Ae.points[0],new Date(ut).getTime(),i.duration)}else{var V;(V=this.carInertialPosition)==null||V.setPosition([H,j],new Date(ut).getTime(),i.duration)}}else{var it;(it=this.carInertialPosition)==null||it.setPosition([H,j],new Date(ut).getTime(),i.duration)}}else{var q,z;if((q=this.carInertialPosition)==null||q.setPosition([H,j],new Date(ut).getTime(),i.duration),!((z=this.carInertialPosition)!=null&&z.positionTimer)){var ge;(ge=this.carInertialPosition)==null||ge.startPositionTimer()}}if(this.options.upload_position){var Te;(Te=this.positionWebSocket)==null||Te.send({command:"UPLOAD_POSITION",ts:Date.now(),index:this.uploadIndex++,data:JSON.stringify({x:H,y:j,floor:ot,type:"vision"}),serverData:JSON.stringify(i)})}}}else this.dispatchEvent({type:"floor",floor:i.data.floor,time:i.data.time})})}initSensorWebSocket(){let t=v({},this.options.ext_sensor_params,{token:this.options.access_token,place_id:this.options.place_id,record_sensor:1}),e=Object.keys(t).filter(n=>!(0,yo.isNil)(t[n])).map(n=>n+"="+t[n]).join("&");this.sensorWebSocket=new xn({url:this.options.wss_sensor_url+"?"+e})}initPdr(){this.options.type===1?(this.carInertialPosition=new Er,this.carInertialPosition.addEventListener("change-pos",t=>{let{value:e}=t,{pos:n,success:r,speed:i}=e;if(r&&(this.dispatchEvent({type:"position",floor:this.positionFloor,x:n[0],y:n[1],time:Date.now(),speed:i}),this.options.upload_position)){var o;(o=this.positionWebSocket)==null||o.send({command:"UPLOAD_POSITION",ts:Date.now(),index:this.uploadIndex++,data:JSON.stringify({x:n[0],y:n[1],floor:this.positionFloor,type:"vision_pdr"})})}}),this.carInertialPosition.addEventListener("change-compass",t=>{let{value:e}=t;this.dispatchEvent({type:"compass",value:e})})):(this.pdrPosition=new yr(this.bmap,{pdr:{using_gps:this.options.use_gps},sensor:{elements:[G.COMPASS,G.ACCELERATION,G.DEVICE_MOTION].concat(this.options.use_gps?[G.GPS]:[])}}),this.requestDeviceOrientationPermission(),this.options.upload_position&&this.pdrPosition.sensor.addEventListener("sensor-data",t=>{let{data:e}=t;var n;(n=this.positionWebSocket)==null||n.send({command:"UPLOAD_SENSOR",ts:Date.now(),index:this.uploadIndex++,data:JSON.stringify(e)})}),this.pdrPosition.sensor.addEventListener("add-data-item",t=>{t.item.type==="compass"&&this.dispatchEvent({type:"compass",value:t.item.res})}),this.pdrPosition.addEventListener("position",t=>{let{x:e,y:n,_type:r}=t;if(console.log("_type",r,e,n,this.positionFloor,this.gpsFloor),r==="gps"&&!this.useGpsFloorTimer){let o=()=>{this.useGpsFloorTimer=this.timer.setTimeout(()=>{this.gpsFloor?this.positionFloor=this.gpsFloor:o()},5e3)};o()}if(this.positionFloor&&(this.dispatchEvent({type:"position",floor:this.positionFloor,x:e,y:n,time:Date.now()}),this.options.upload_position)){var i;(i=this.positionWebSocket)==null||i.send({command:"UPLOAD_POSITION",ts:Date.now(),index:this.uploadIndex++,data:JSON.stringify({x:e,y:n,floor:this.positionFloor,type:r})})}}))}setSensor(t){this.pdrPosition&&this.pdrPosition.setSensor(t)}requestDeviceOrientationPermission(){return g(this,null,function*(){if(this.pdrPosition){let t=yield this.pdrPosition.checkSensor();return t.deviceOrientation?this.pdrPosition.start():(this.dispatchEvent(v({type:"check-sensor"},t)),!t.deviceOrientation&&this.options.use_default_permission),t}else return null})}getGpsFloor(){return g(this,null,function*(){if(this.options.use_gps&&this.options.get_gps_floor_url){let t=yield fetch(this.options.get_gps_floor_url+"/"+this.options.place_id).then(e=>e.json());t.code===200&&(this.gpsFloor=t.data.gps_floor)}})}pausePdr(){if(this.options.type===1){var t;(t=this.carInertialPosition)==null||t.stopPositionTimer()}else{var e;(e=this.pdrPosition)==null||e.pause()}}continuePdr(){if(this.options.type===1)this.carInertialPosition&&(this.carInertialPosition.positionTimer||this.carInertialPosition.startPositionTimer());else{var t;(t=this.pdrPosition)==null||t.continue()}}setPathAngle(t){if(this.options.type===1){var e;(e=this.carInertialPosition)==null||e.setPathAngle(t)}}getForwardAngle(){if(this.options.type===1){var t,e;return(e=(t=this.carInertialPosition)==null?void 0:t.angle)!=null?e:null}else return null}resetPdr(){this.carInertialPosition&&(this.carInertialPosition.history=[],this.carInertialPosition.setPathAngle(0),this.carInertialPosition.speed=0),this.pdrPosition&&this.pdrPosition.pdr.particleFilter.setPosInitFlag(!1)}setPath(t){this.path=t}sendBeacon(t){var e;let n=[];if(Ie)n=t.map(i=>{let[o,s]=_o(i.major);return[i.uuid,s,i.minor,i.rssi,i.accuracy,o]}).filter(i=>i[3]!==0).sort((i,o)=>o[3]-i[3]);else{let i=t.reduce((o,s)=>{var u,l;let[c,h]=_o(s.major),p=""+h+s.minor;return(u=o)[l=p]||(u[l]=[]),o[p].push(v({},s,{battery:c,major:h})),o},{});Object.entries(i).forEach(o=>{let[s,u]=o,{uuid:l,major:c,minor:h,accuracy:p,battery:f}=u[0];if(u.length>1){let d=u.filter(y=>y.rssi<0),m=d.reduce((y,x)=>y+x.rssi,0);n.push([l,c,h,m/d.length,p,f])}else n.push([l,c,h,u[0].rssi,p,f])})}let r={command:"POSITION",index:this.uploadIndex++,ts:Date.now(),beacons:JSON.stringify([{type:"ibeacon",timestamp:Date.now()/1e3,res:n}]),ext_sensors:JSON.stringify({})};(e=this.sensorWebSocket)==null||e.send(r)}dispose(){var t,e,n,r;this.timer.dispose(),(t=this.positionWebSocket)==null||t.dispose(),this.positionWebSocket=null,(e=this.sensorWebSocket)==null||e.dispose(),this.sensorWebSocket=null,(n=this.pdrPosition)==null||n.dispose(),this.pdrPosition=null,(r=this.carInertialPosition)==null||r.dispose(),this.carInertialPosition=null,super.dispose()}constructor(t,e){super(),this.bmap=t,this.positionWebSocket=null,this.sensorWebSocket=null,this.pdrPosition=null,this.carInertialPosition=null,this.gpsFloor="",this.positionFloor="",this.useGpsFloorTimer=null,this.uploadIndex=0,this.path=null,this.timer=new $;let n=new URLSearchParams(location.search),r=n.get("server_env")||"prod",i={test:"nav-test.aibee.cn",prod:"nav.aibee.cn"},o="wss://"+i[r]+"/aether-walker/indoor/position",s="wss://"+i[r]+"/aether-walker/indoor/sensor";this.options=v({place_id:n.get("place_id"),access_token:n.get("access_token"),env:r,wss_position_url:o,wss_sensor_url:s,get_gps_floor_url:"https://"+i[r]+"/aether-walker/indoor/conf",use_sensor:!1,type:-1,use_gps:!0,use_pdr:!0,upload_position:!0,use_default_permission:!0,ext_position_params:{},ext_sensor_params:{}},e),this.initPositionWebSocket(),this.options.use_sensor&&this.initSensorWebSocket(),this.options.use_pdr&&this.initPdr(),this.options.use_gps&&this.getGpsFloor()}};var T3=require("core-js/modules/web.dom-collections.iterator.js");var xo=class extends at{showMyPosition(t,e){var n;let r=(n=this.bmap.context.currentFloor)==null?void 0:n.getGraphicPosition(t);if(r){let i=new Ze(this.bmap.context,{autoUpdate:!0,appendToBody:!1});i.div.appendChild(e),i.position.copy(this.bmap.mercatorToWorld(r)),this.myPositionOverlay=i,console.log("graphicPos",r,this)}else console.warn("[showMyPosition] \u6CA1\u6709\u627E\u5230\u56FE\u5143\u6240\u5728\u7684\u4F4D\u7F6E")}hideMyPosition(){this.myPositionOverlay&&(this.myPositionOverlay.dispose(),this.myPositionOverlay=null)}dispose(){this.hideMyPosition()}constructor(...t){super(...t),this.myPositionOverlay=null}};var Eo=class extends at{highlightPoi(t,e){e===void 0&&(e={icon_size:[40,40],collision_enable:!1}),t.map(r=>this.bmap.getPoiById(r)).filter(r=>!!r).forEach(r=>{var i;(i=r.userData).restore||(i.restore={});for(let u in e)if(u in r.options){var o,s;(o=r.userData.restore)[s=u]||(o[s]=r.options[u]),r.options[u]=e[u]}})}restorePoi(t){t.map(n=>this.bmap.getPoiById(n)).filter(n=>!!n).forEach(n=>{console.log("poi.userData.restore",n.userData.restore);for(let r in n.userData.restore)r in n.options&&(n.options[r]=n.userData.restore[r]);n.userData.restore={}})}};var L3=require("core-js/modules/web.dom-collections.iterator.js"),N3=require("core-js/modules/es.array.sort.js");var bo=class extends at{sortByDistance(t,e,n){return g(this,null,function*(){n===void 0&&(n=!1);let r=[...e];if(n||e.length<20)return yield Promise.all(r.map(i=>g(this,null,function*(){i.distance=yield this._getDistance(t,{floor:i.floor,x:i.center_x,y:i.center_y})}))),r.sort((i,o)=>i.distance-o.distance);{let i=r.sort((s,u)=>{let l=Math.sqrt((s.center_x-t.x)**2+(s.center_y-t.y)**2)+(t.floor===s.floor?0:100),c=Math.sqrt((u.center_x-t.x)**2+(u.center_y-t.y)**2)+(t.floor===u.floor?0:100);return l-c});return[...(yield Promise.all(i.slice(0,20).map(s=>g(this,null,function*(){return s.distance=yield this._getDistance(t,{floor:s.floor,x:s.center_x,y:s.center_y}),s})))).sort((s,u)=>s.distance-u.distance),...i.slice(20)]}})}_getDistance(t,e){return g(this,null,function*(){return this.navPath.getPath({floor:t.floor,coord:[t.x,t.y]},{floor:e.floor,coord:[e.x,e.y]},"",0).then(n=>n.reduce((r,i,o)=>{if(r+=i.distance,o!==n.length-1)switch(i.endType){case"escalator":case"straightLadder":case"staircase":case"ramp":r+=100;break}return r},0)).catch(n=>n==="near"?0:1/0)})}dispose(){super.dispose(),this.needDisposeNavPath&&this.navPath.dispose()}constructor(t,e){if(super(t),this.needDisposeNavPath=!1,e)this.navPath=e;else{this.navPath=new gr;let n=new Je(t);this.needDisposeNavPath=!0,n.load(t.config.apiPath.loadPlaceInfo+"?place_id="+t.config.placeId+"&env=prod").then(r=>g(this,null,function*(){let[i,o]=yield Promise.all([n.getRoadNetworkData(),n.getFacilitiesData()]);this.navPath.setRoadData(i,o.infrastructures)}))}}};var i0="https://robot-vr-public.bj.bcebos.com/v1/static_resource/satellite_tiles",o0={base_url:i0},So=class extends at{setVisible(t){this.tileLayer.setVisibility(t)}dispose(){this.bmap.context.scene.remove(this.tileLayer),this.tileLayer.dispose(),super.dispose()}constructor(t,e){super(t),this.options=v({},o0,e),this.tileLayer=new De(t.context,this.options),this.tileLayer.position.z=-1,this.bmap.context.scene.add(this.tileLayer)}};
|
|
23579
|
+
`],{type:"text/javascript"}),t=URL.createObjectURL(a),e=new Worker(t);return URL.revokeObjectURL(t),e}var n0={placeId:0,catLotStatusApi:"https://vrapi.aibee.cn/parking/cat-lot-status"},mo=class{setRoadData(t,e){return Z(this.worker,"set_road_info",{roadData:t,facilities:e})}recommend(t){return g(this,null,function*(){let e=yield fetch(this.options.catLotStatusApi,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({place_id:+this.options.placeId})}).then(n=>n.json()).then(n=>n.data.filter(r=>r.status===0));return Z(this.worker,"recommend",v({},t,{carLotStatus:e}))})}dispose(){this.worker.terminate()}constructor(t={}){this.worker=go(),this.options=v({},n0,t)}};var l3=require("core-js/modules/es.json.stringify.js"),c3=require("core-js/modules/web.dom-collections.iterator.js"),h3=require("core-js/modules/es.array.sort.js"),p3=require("core-js/modules/es.array.push.js"),f3=require("core-js/modules/web.url-search-params.js"),d3=require("core-js/modules/web.url-search-params.delete.js"),g3=require("core-js/modules/web.url-search-params.has.js"),m3=require("core-js/modules/web.url-search-params.size.js"),_3=require("core-js/modules/es.regexp.exec.js");var i3=require("core-js/modules/es.json.stringify.js");var r0={url:"",reconnect:!0,heartBeat:2e3,heartMsg:JSON.stringify({command:"PING"}),reconnectTime:3e3,reconnectMaxCount:1e6,noMessageTime:6e3},xn=class extends ct{initWebsocket(){this.ws=new WebSocket(this.options.url),this.ws.onopen=()=>{this.alive=!0,this.startHeart(),this.startOnMessageTimer(),this.stopReconnect(),this.dispatchEvent({type:"open"})},this.ws.onerror=()=>{this.alive=!1,this.ws=null,this.stopHeart(),this.stopOnMessageTimer(),this.startReconnect(),this.registryEvent()},this.ws.onclose=()=>{this.alive=!1,this.ws=null,this.stopHeart(),this.stopOnMessageTimer(),this.startReconnect()},this.ws.onmessage=t=>{this.startOnMessageTimer(),this.dispatchEvent({type:"message",message:t})}}startHeart(){this.stopHeart(),this.heartTimer=this.timer.setInterval(()=>{this.send(this.options.heartMsg)&&this.dispatchEvent({type:"send-heart"})},this.options.heartBeat)}stopHeart(){this.heartTimer&&(this.timer.clearInterval(this.heartTimer),this.heartTimer=null)}startReconnect(t){t===void 0&&(t=this.options.reconnectTime),this.stopReconnect(),this.options.reconnect&&(this.options.reconnectMaxCount--,this.options.reconnectMaxCount>=0&&(this.reconnectTimer=this.timer.setTimeout(()=>{this.initWebsocket()},t)))}stopReconnect(){this.reconnectTimer&&(this.timer.clearTimeout(this.reconnectTimer),this.reconnectTimer=null)}startOnMessageTimer(){this.stopOnMessageTimer(),this.noMessageTimer=this.timer.setTimeout(()=>{var t;(t=this.ws)==null||t.close(),this.dispatchEvent({type:"no-message-timeout"})},this.options.noMessageTime)}stopOnMessageTimer(){this.noMessageTimer&&(this.timer.clearTimeout(this.noMessageTimer),this.noMessageTimer=null)}send(t){var e;let n=typeof t=="string"?t:JSON.stringify(t);return this.alive&&((e=this.ws)==null?void 0:e.readyState)===1?(this.ws.send(n),this.dispatchEvent({type:"send-success",msg:n}),!0):(this.dispatchEvent({type:"send-fail",msg:n}),!1)}registryEvent(){window.addEventListener("online",this.onOnline)}unRegistryEvent(){window.removeEventListener("online",this.onOnline)}close(){var t;this.unRegistryEvent(),this.options.reconnect=!1,this.alive=!1,this.stopHeart(),this.stopReconnect(),this.stopOnMessageTimer(),(t=this.ws)==null||t.close(),this.ws=null,this.dispatchEvent({type:"close"})}dispose(){this.close(),this.timer.dispose(),super.dispose()}constructor(t){super(),this.ws=null,this.alive=!1,this.timer=new $,this.heartTimer=null,this.reconnectTimer=null,this.noMessageTimer=null,this.onOnline=()=>{this.startReconnect()},this.options=v({},r0,t||{}),this.options.url&&this.initWebsocket()}};var yo=require("lodash");var _o=a=>{let t=a.toString(2),e=""+Array(16-t.length+1).join("0")+t,n=parseInt(e.slice(0,4),2)*10,r=parseInt(e.slice(4,16),2);return[n,r]};var vo=class extends ct{initPositionWebSocket(){let t=v({},this.options.ext_position_params,{place_id:this.options.place_id,token:this.options.access_token}),e=Object.keys(t).filter(n=>!(0,yo.isNil)(t[n])).map(n=>n+"="+t[n]).join("&");this.positionWebSocket=new xn({url:this.options.wss_position_url+"?"+e}),this.positionWebSocket.addEventListener("message",n=>{let{message:r}=n,i=(()=>{try{return JSON.parse(r.data)}catch(H){return r.data}})();if(this.dispatchEvent({type:"ws-message",data:i}),i.command==="POSITION_RESULT"&&i.data.success)if(["POSITION","FLOOR","PARK_POSITION","AOA"].includes(i.data.success_type)&&this.useGpsFloorTimer&&(this.positionFloor=i.data.floor,this.timer.clearTimeout(this.useGpsFloorTimer),this.useGpsFloorTimer=null),i.data.success_type==="AOA"){let{x:H,y:j,time:ut,floor:ot,ts:oe}=i.data,se=this.positionFloor!==ot;if(this.positionFloor=ot,this.dispatchEvent({type:"ws-position",floor:ot,x:H,y:j,time:ut,_type:"aoa"}),this.options.upload_position){var o;(o=this.positionWebSocket)==null||o.send({command:"UPLOAD_POSITION",ts:Date.now(),index:this.uploadIndex++,data:JSON.stringify({x:H,y:j,floor:ot,type:"aoa"}),serverData:JSON.stringify(i)})}if(!this.options.use_pdr){this.dispatchEvent({type:"position",floor:ot,x:H,y:j,time:new Date(oe).getTime()-i.lag-i.duration});return}if(this.options.type!==1){var s;if(se){var u,l,c;(c=this.pdrPosition)==null||(l=c.pdr)==null||(u=l.particleFilter)==null||u.setPosInitFlag(!1)}(s=this.pdrPosition)==null||s.setBeaconPosition({x:H,y:j},new Date(oe).getTime()-i.lag-i.duration)}else if(se){var h;if(this.resetPdr(),(h=this.carInertialPosition)==null||h.stopPositionTimer(),this.path){let Ae=this.path.findIndex(En=>En.floor===ot),me=this.path[Ae];if(me){var p;this.resetPdr(),(p=this.carInertialPosition)==null||p.setBeaconPosition(me.points[0],new Date(ut).getTime()-i.lag-i.duration,i.lag+i.duration)}else{var f;(f=this.carInertialPosition)==null||f.setBeaconPosition([H,j],new Date(ut).getTime()-i.lag-i.duration,i.lag+i.duration)}}else{var d;(d=this.carInertialPosition)==null||d.setBeaconPosition([H,j],new Date(ut).getTime()-i.lag-i.duration,i.lag+i.duration)}}else{var m;(m=this.carInertialPosition)==null||m.setBeaconPosition([H,j],new Date(ut).getTime()-i.lag-i.duration,i.lag+i.duration)}}else if(i.data.success_type==="POSITION"){let{x:H,y:j,time:ut,floor:ot,ts:oe}=i.data,se=this.positionFloor!==ot;if(this.positionFloor=ot,this.dispatchEvent({type:"ws-position",floor:ot,x:H,y:j,time:ut,_type:"beacon"}),console.log("positionFloor",ot,se),this.options.upload_position){var _;(_=this.positionWebSocket)==null||_.send({command:"UPLOAD_POSITION",ts:Date.now(),index:this.uploadIndex++,data:JSON.stringify({x:H,y:j,floor:ot,type:"originBeacon"}),serverData:JSON.stringify(i)})}if(!this.options.use_pdr){this.dispatchEvent({type:"position",floor:ot,x:H,y:j,time:new Date(oe).getTime()-i.lag-i.duration});return}if(this.options.type!==1){var x;if(se){var E,S,R;(R=this.pdrPosition)==null||(S=R.pdr)==null||(E=S.particleFilter)==null||E.setPosInitFlag(!1)}(x=this.pdrPosition)==null||x.setBeaconPosition({x:H,y:j},new Date(oe).getTime()-i.lag-i.duration)}else if(se){var P;if(this.resetPdr(),(P=this.carInertialPosition)==null||P.stopPositionTimer(),this.path){let Ae=this.path.findIndex(En=>En.floor===ot),me=this.path[Ae];if(me){var K;this.resetPdr(),(K=this.carInertialPosition)==null||K.setBeaconPosition(me.points[0],new Date(ut).getTime()-i.lag-i.duration,i.lag+i.duration)}else{var T;(T=this.carInertialPosition)==null||T.setBeaconPosition([H,j],new Date(ut).getTime()-i.lag-i.duration,i.lag+i.duration)}}else{var Q;(Q=this.carInertialPosition)==null||Q.setBeaconPosition([H,j],new Date(ut).getTime()-i.lag-i.duration,i.lag+i.duration)}}else{var L;(L=this.carInertialPosition)==null||L.setBeaconPosition([H,j],new Date(ut).getTime()-i.lag-i.duration,i.lag+i.duration)}}else if(i.data.success_type==="PARK_POSITION"&&i.data.success){if(this.options.type===1){let{x:H,y:j,time:ut,floor:ot}=i.data,oe=this.positionFloor!==ot;if(this.positionFloor=i.data.floor,this.dispatchEvent({type:"ws-position",floor:ot,x:H,y:j,time:ut,_type:"vision"}),!this.options.use_pdr){this.dispatchEvent({type:"position",floor:ot,x:H,y:j,time:new Date(ut).getTime()});return}if(oe){var O;if(this.resetPdr(),(O=this.carInertialPosition)==null||O.stopPositionTimer(),this.path){let se=this.path.findIndex(me=>me.floor===ot),Ae=this.path[se];if(Ae){var I;this.resetPdr(),(I=this.carInertialPosition)==null||I.setPosition(Ae.points[0],new Date(ut).getTime(),i.duration)}else{var V;(V=this.carInertialPosition)==null||V.setPosition([H,j],new Date(ut).getTime(),i.duration)}}else{var it;(it=this.carInertialPosition)==null||it.setPosition([H,j],new Date(ut).getTime(),i.duration)}}else{var q,z;if((q=this.carInertialPosition)==null||q.setPosition([H,j],new Date(ut).getTime(),i.duration),!((z=this.carInertialPosition)!=null&&z.positionTimer)){var ge;(ge=this.carInertialPosition)==null||ge.startPositionTimer()}}if(this.options.upload_position){var Te;(Te=this.positionWebSocket)==null||Te.send({command:"UPLOAD_POSITION",ts:Date.now(),index:this.uploadIndex++,data:JSON.stringify({x:H,y:j,floor:ot,type:"vision"}),serverData:JSON.stringify(i)})}}}else this.dispatchEvent({type:"floor",floor:i.data.floor,time:i.data.time})})}initSensorWebSocket(){let t=v({},this.options.ext_sensor_params,{token:this.options.access_token,place_id:this.options.place_id,record_sensor:1}),e=Object.keys(t).filter(n=>!(0,yo.isNil)(t[n])).map(n=>n+"="+t[n]).join("&");this.sensorWebSocket=new xn({url:this.options.wss_sensor_url+"?"+e})}initPdr(){this.options.type===1?(this.carInertialPosition=new Er,this.carInertialPosition.addEventListener("change-pos",t=>{let{value:e}=t,{pos:n,success:r,speed:i}=e;if(r&&(this.dispatchEvent({type:"position",floor:this.positionFloor,x:n[0],y:n[1],time:Date.now(),speed:i}),this.options.upload_position)){var o;(o=this.positionWebSocket)==null||o.send({command:"UPLOAD_POSITION",ts:Date.now(),index:this.uploadIndex++,data:JSON.stringify({x:n[0],y:n[1],floor:this.positionFloor,type:"vision_pdr"})})}}),this.carInertialPosition.addEventListener("change-compass",t=>{let{value:e}=t;this.dispatchEvent({type:"compass",value:e})})):(this.pdrPosition=new yr(this.bmap,{pdr:{using_gps:this.options.use_gps},sensor:{elements:[G.COMPASS,G.ACCELERATION,G.DEVICE_MOTION].concat(this.options.use_gps?[G.GPS]:[])}}),this.requestDeviceOrientationPermission(),this.options.upload_position&&this.pdrPosition.sensor.addEventListener("sensor-data",t=>{let{data:e}=t;var n;(n=this.positionWebSocket)==null||n.send({command:"UPLOAD_SENSOR",ts:Date.now(),index:this.uploadIndex++,data:JSON.stringify(e)})}),this.pdrPosition.sensor.addEventListener("add-data-item",t=>{t.item.type==="compass"&&this.dispatchEvent({type:"compass",value:t.item.res})}),this.pdrPosition.addEventListener("position",t=>{let{x:e,y:n,_type:r}=t;if(console.log("_type",r,e,n,this.positionFloor,this.gpsFloor),r==="gps"&&!this.useGpsFloorTimer){let o=()=>{this.useGpsFloorTimer=this.timer.setTimeout(()=>{this.gpsFloor?this.positionFloor=this.gpsFloor:o()},5e3)};o()}if(this.positionFloor&&(this.dispatchEvent({type:"position",floor:this.positionFloor,x:e,y:n,time:Date.now()}),this.options.upload_position)){var i;(i=this.positionWebSocket)==null||i.send({command:"UPLOAD_POSITION",ts:Date.now(),index:this.uploadIndex++,data:JSON.stringify({x:e,y:n,floor:this.positionFloor,type:r})})}}))}setSensor(t){this.pdrPosition&&this.pdrPosition.setSensor(t)}requestDeviceOrientationPermission(){return g(this,null,function*(){if(this.pdrPosition){let t=yield this.pdrPosition.checkSensor();return t.deviceOrientation?this.pdrPosition.start():(this.dispatchEvent(v({type:"check-sensor"},t)),!t.deviceOrientation&&this.options.use_default_permission),t}else return null})}getGpsFloor(){return g(this,null,function*(){if(this.options.use_gps&&this.options.get_gps_floor_url){let t=yield fetch(this.options.get_gps_floor_url+"/"+this.options.place_id).then(e=>e.json());t.code===200&&(this.gpsFloor=t.data.gps_floor)}})}pausePdr(){if(this.options.type===1){var t;(t=this.carInertialPosition)==null||t.stopPositionTimer()}else{var e;(e=this.pdrPosition)==null||e.pause()}}continuePdr(){if(this.options.type===1)this.carInertialPosition&&(this.carInertialPosition.positionTimer||this.carInertialPosition.startPositionTimer());else{var t;(t=this.pdrPosition)==null||t.continue()}}setPathAngle(t){if(this.options.type===1){var e;(e=this.carInertialPosition)==null||e.setPathAngle(t)}}getForwardAngle(){if(this.options.type===1){var t,e;return(e=(t=this.carInertialPosition)==null?void 0:t.angle)!=null?e:null}else return null}resetPdr(){this.carInertialPosition&&(this.carInertialPosition.history=[],this.carInertialPosition.setPathAngle(0),this.carInertialPosition.speed=0),this.pdrPosition&&this.pdrPosition.pdr.particleFilter.setPosInitFlag(!1)}setPath(t){this.path=t}sendBeacon(t){var e;let n=[];if(Ie)n=t.map(i=>{let[o,s]=_o(i.major);return[i.uuid,s,i.minor,i.rssi,i.accuracy,o]}).filter(i=>i[3]!==0).sort((i,o)=>o[3]-i[3]);else{let i=t.reduce((o,s)=>{var u,l;let[c,h]=_o(s.major),p=""+h+s.minor;return(u=o)[l=p]||(u[l]=[]),o[p].push(v({},s,{battery:c,major:h})),o},{});Object.entries(i).forEach(o=>{let[s,u]=o,{uuid:l,major:c,minor:h,accuracy:p,battery:f}=u[0];if(u.length>1){let d=u.filter(_=>_.rssi<0),m=d.reduce((_,x)=>_+x.rssi,0);n.push([l,c,h,m/d.length,p,f])}else n.push([l,c,h,u[0].rssi,p,f])})}let r={command:"POSITION",index:this.uploadIndex++,ts:Date.now(),beacons:JSON.stringify([{type:"ibeacon",timestamp:Date.now()/1e3,res:n}]),ext_sensors:JSON.stringify({})};(e=this.sensorWebSocket)==null||e.send(r)}dispose(){var t,e,n,r;this.timer.dispose(),(t=this.positionWebSocket)==null||t.dispose(),this.positionWebSocket=null,(e=this.sensorWebSocket)==null||e.dispose(),this.sensorWebSocket=null,(n=this.pdrPosition)==null||n.dispose(),this.pdrPosition=null,(r=this.carInertialPosition)==null||r.dispose(),this.carInertialPosition=null,super.dispose()}constructor(t,e){super(),this.bmap=t,this.positionWebSocket=null,this.sensorWebSocket=null,this.pdrPosition=null,this.carInertialPosition=null,this.gpsFloor="",this.positionFloor="",this.useGpsFloorTimer=null,this.uploadIndex=0,this.path=null,this.timer=new $;let n=new URLSearchParams(location.search),r=n.get("server_env")||"prod",i={test:"nav-test.aibee.cn",prod:"nav.aibee.cn"},o="wss://"+i[r]+"/aether-walker/indoor/position",s="wss://"+i[r]+"/aether-walker/indoor/sensor";this.options=v({place_id:n.get("place_id"),access_token:n.get("access_token"),env:r,wss_position_url:o,wss_sensor_url:s,get_gps_floor_url:"https://"+i[r]+"/aether-walker/indoor/conf",use_sensor:!1,type:-1,use_gps:!0,use_pdr:!0,upload_position:!0,use_default_permission:!0,ext_position_params:{},ext_sensor_params:{}},e),this.initPositionWebSocket(),this.options.use_sensor&&this.initSensorWebSocket(),this.options.use_pdr&&this.initPdr(),this.options.use_gps&&this.getGpsFloor()}};var T3=require("core-js/modules/web.dom-collections.iterator.js");var xo=class extends at{showMyPosition(t,e){var n;let r=(n=this.bmap.context.currentFloor)==null?void 0:n.getGraphicPosition(t);if(r){let i=new Ze(this.bmap.context,{autoUpdate:!0,appendToBody:!1});i.div.appendChild(e),i.position.copy(this.bmap.mercatorToWorld(r)),this.myPositionOverlay=i,console.log("graphicPos",r,this)}else console.warn("[showMyPosition] \u6CA1\u6709\u627E\u5230\u56FE\u5143\u6240\u5728\u7684\u4F4D\u7F6E")}hideMyPosition(){this.myPositionOverlay&&(this.myPositionOverlay.dispose(),this.myPositionOverlay=null)}dispose(){this.hideMyPosition()}constructor(...t){super(...t),this.myPositionOverlay=null}};var Eo=class extends at{highlightPoi(t,e){e===void 0&&(e={icon_size:[40,40],collision_enable:!1}),t.map(r=>this.bmap.getPoiById(r)).filter(r=>!!r).forEach(r=>{var i;(i=r.userData).restore||(i.restore={});for(let u in e)if(u in r.options){var o,s;(o=r.userData.restore)[s=u]||(o[s]=r.options[u]),r.options[u]=e[u]}})}restorePoi(t){t.map(n=>this.bmap.getPoiById(n)).filter(n=>!!n).forEach(n=>{console.log("poi.userData.restore",n.userData.restore);for(let r in n.userData.restore)r in n.options&&(n.options[r]=n.userData.restore[r]);n.userData.restore={}})}};var L3=require("core-js/modules/web.dom-collections.iterator.js"),N3=require("core-js/modules/es.array.sort.js");var bo=class extends at{sortByDistance(t,e,n){return g(this,null,function*(){n===void 0&&(n=!1);let r=[...e];if(n||e.length<20)return yield Promise.all(r.map(i=>g(this,null,function*(){i.distance=yield this._getDistance(t,{floor:i.floor,x:i.center_x,y:i.center_y})}))),r.sort((i,o)=>i.distance-o.distance);{let i=r.sort((s,u)=>{let l=Math.sqrt((s.center_x-t.x)**2+(s.center_y-t.y)**2)+(t.floor===s.floor?0:100),c=Math.sqrt((u.center_x-t.x)**2+(u.center_y-t.y)**2)+(t.floor===u.floor?0:100);return l-c});return[...(yield Promise.all(i.slice(0,20).map(s=>g(this,null,function*(){return s.distance=yield this._getDistance(t,{floor:s.floor,x:s.center_x,y:s.center_y}),s})))).sort((s,u)=>s.distance-u.distance),...i.slice(20)]}})}_getDistance(t,e){return g(this,null,function*(){return this.navPath.getPath({floor:t.floor,coord:[t.x,t.y]},{floor:e.floor,coord:[e.x,e.y]},"",0).then(n=>n.reduce((r,i,o)=>{if(r+=i.distance,o!==n.length-1)switch(i.endType){case"escalator":case"straightLadder":case"staircase":case"ramp":r+=100;break}return r},0)).catch(n=>n==="near"?0:1/0)})}dispose(){super.dispose(),this.needDisposeNavPath&&this.navPath.dispose()}constructor(t,e){if(super(t),this.needDisposeNavPath=!1,e)this.navPath=e;else{this.navPath=new gr;let n=new Je(t);this.needDisposeNavPath=!0,n.load(t.config.apiPath.loadPlaceInfo+"?place_id="+t.config.placeId+"&env=prod").then(r=>g(this,null,function*(){let[i,o]=yield Promise.all([n.getRoadNetworkData(),n.getFacilitiesData()]);this.navPath.setRoadData(i,o.infrastructures)}))}}};var i0="https://robot-vr-public.bj.bcebos.com/v1/static_resource/satellite_tiles",o0={base_url:i0},So=class extends at{setVisible(t){this.tileLayer.setVisibility(t)}dispose(){this.bmap.context.scene.remove(this.tileLayer),this.tileLayer.dispose(),super.dispose()}constructor(t,e){super(t),this.options=v({},o0,e),this.tileLayer=new De(t.context,this.options),this.tileLayer.position.z=-1,this.bmap.context.scene.add(this.tileLayer)}};
|